hoodini-viz 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{3Dmol--3ohBuYp.js → 3Dmol-C30ZsCRh.js} +1 -1
- package/dist/{data-grid-overlay-editor-Dh2mDScX.js → data-grid-overlay-editor-BXNMfm9z.js} +1 -1
- package/dist/hoodini-viz.js +1 -1
- package/dist/hoodini-viz.umd.js +2 -2
- package/dist/{index-DqedK8nv.js → index-ciHcxGZv.js} +23 -13
- package/dist/{number-overlay-editor-BOabzjpX.js → number-overlay-editor-6q3QaWsc.js} +1 -1
- package/package.json +1 -1
package/dist/hoodini-viz.umd.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
`+Sr[Yt].replace(" at new "," at ");return Dt.displayName&&ui.includes("<anonymous>")&&(ui=ui.replace("<anonymous>",Dt.displayName)),ui}while(1<=Yt&&0<=an);break}}}finally{Wn=!1,Error.prepareStackTrace=$t}return($t=Dt?Dt.displayName||Dt.name:"")?jn($t):""}function Fr(Dt,Bt){switch(Dt.tag){case 26:case 27:case 5:return jn(Dt.type);case 16:return jn("Lazy");case 13:return Dt.child!==Bt&&Bt!==null?jn("Suspense Fallback"):jn("Suspense");case 19:return jn("SuspenseList");case 0:case 15:return br(Dt.type,!1);case 11:return br(Dt.type.render,!1);case 1:return br(Dt.type,!0);case 31:return jn("Activity");default:return""}}function Cr(Dt){try{var Bt="",$t=null;do Bt+=Fr(Dt,$t),$t=Dt,Dt=Dt.return;while(Dt);return Bt}catch(Yt){return`
|
|
7
7
|
Error generating stack: `+Yt.message+`
|
|
8
8
|
`+Yt.stack}}var dr=Object.prototype.hasOwnProperty,_r=yt.unstable_scheduleCallback,pr=yt.unstable_cancelCallback,wr=yt.unstable_shouldYield,xr=yt.unstable_requestPaint,Dr=yt.unstable_now,ar=yt.unstable_getCurrentPriorityLevel,Qn=yt.unstable_ImmediatePriority,Cn=yt.unstable_UserBlockingPriority,Bn=yt.unstable_NormalPriority,In=yt.unstable_LowPriority,or=yt.unstable_IdlePriority,rr=yt.log,vr=yt.unstable_setDisableYieldValue,cr=null,gn=null;function wn(Dt){if(typeof rr=="function"&&vr(Dt),gn&&typeof gn.setStrictMode=="function")try{gn.setStrictMode(cr,Dt)}catch{}}var Xn=Math.clz32?Math.clz32:Kn,tr=Math.log,Hn=Math.LN2;function Kn(Dt){return Dt>>>=0,Dt===0?32:31-(tr(Dt)/Hn|0)|0}var _n=256,yr=262144,Or=4194304;function hn(Dt){var Bt=Dt&42;if(Bt!==0)return Bt;switch(Dt&-Dt){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return Dt&261888;case 262144:case 524288:case 1048576:case 2097152:return Dt&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return Dt&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return Dt}}function Ar(Dt,Bt,$t){var Yt=Dt.pendingLanes;if(Yt===0)return 0;var an=0,un=Dt.suspendedLanes,bn=Dt.pingedLanes;Dt=Dt.warmLanes;var qn=Yt&134217727;return qn!==0?(Yt=qn&~un,Yt!==0?an=hn(Yt):(bn&=qn,bn!==0?an=hn(bn):$t||($t=qn&~Dt,$t!==0&&(an=hn($t))))):(qn=Yt&~un,qn!==0?an=hn(qn):bn!==0?an=hn(bn):$t||($t=Yt&~Dt,$t!==0&&(an=hn($t)))),an===0?0:Bt!==0&&Bt!==an&&(Bt&un)===0&&(un=an&-an,$t=Bt&-Bt,un>=$t||un===32&&($t&4194048)!==0)?Bt:an}function hr(Dt,Bt){return(Dt.pendingLanes&~(Dt.suspendedLanes&~Dt.pingedLanes)&Bt)===0}function An(Dt,Bt){switch(Dt){case 1:case 2:case 4:case 8:case 64:return Bt+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return Bt+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nr(){var Dt=Or;return Or<<=1,(Or&62914560)===0&&(Or=4194304),Dt}function gr(Dt){for(var Bt=[],$t=0;31>$t;$t++)Bt.push(Dt);return Bt}function ii(Dt,Bt){Dt.pendingLanes|=Bt,Bt!==268435456&&(Dt.suspendedLanes=0,Dt.pingedLanes=0,Dt.warmLanes=0)}function ti(Dt,Bt,$t,Yt,an,un){var bn=Dt.pendingLanes;Dt.pendingLanes=$t,Dt.suspendedLanes=0,Dt.pingedLanes=0,Dt.warmLanes=0,Dt.expiredLanes&=$t,Dt.entangledLanes&=$t,Dt.errorRecoveryDisabledLanes&=$t,Dt.shellSuspendCounter=0;var qn=Dt.entanglements,Sr=Dt.expirationTimes,Jr=Dt.hiddenUpdates;for($t=bn&~$t;0<$t;){var ui=31-Xn($t),gi=1<<ui;qn[ui]=0,Sr[ui]=-1;var ni=Jr[ui];if(ni!==null)for(Jr[ui]=null,ui=0;ui<ni.length;ui++){var oi=ni[ui];oi!==null&&(oi.lane&=-536870913)}$t&=~gi}Yt!==0&&di(Dt,Yt,0),un!==0&&an===0&&Dt.tag!==0&&(Dt.suspendedLanes|=un&~(bn&~Bt))}function di(Dt,Bt,$t){Dt.pendingLanes|=Bt,Dt.suspendedLanes&=~Bt;var Yt=31-Xn(Bt);Dt.entangledLanes|=Bt,Dt.entanglements[Yt]=Dt.entanglements[Yt]|1073741824|$t&261930}function Bi(Dt,Bt){var $t=Dt.entangledLanes|=Bt;for(Dt=Dt.entanglements;$t;){var Yt=31-Xn($t),an=1<<Yt;an&Bt|Dt[Yt]&Bt&&(Dt[Yt]|=Bt),$t&=~an}}function as(Dt,Bt){var $t=Bt&-Bt;return $t=($t&42)!==0?1:ki($t),($t&(Dt.suspendedLanes|Bt))!==0?0:$t}function ki(Dt){switch(Dt){case 2:Dt=1;break;case 8:Dt=4;break;case 32:Dt=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:Dt=128;break;case 268435456:Dt=134217728;break;default:Dt=0}return Dt}function Xi(Dt){return Dt&=-Dt,2<Dt?8<Dt?(Dt&134217727)!==0?32:268435456:8:2}function _i(){var Dt=nn.p;return Dt!==0?Dt:(Dt=window.event,Dt===void 0?32:L0(Dt.type))}function ci(Dt,Bt){var $t=nn.p;try{return nn.p=Dt,Bt()}finally{nn.p=$t}}var xi=Math.random().toString(36).slice(2),mi="__reactFiber$"+xi,wi="__reactProps$"+xi,vi="__reactContainer$"+xi,qi="__reactEvents$"+xi,ji="__reactListeners$"+xi,Ni="__reactHandles$"+xi,ls="__reactResources$"+xi,xs="__reactMarker$"+xi;function $s(Dt){delete Dt[mi],delete Dt[wi],delete Dt[qi],delete Dt[ji],delete Dt[Ni]}function Is(Dt){var Bt=Dt[mi];if(Bt)return Bt;for(var $t=Dt.parentNode;$t;){if(Bt=$t[vi]||$t[mi]){if($t=Bt.alternate,Bt.child!==null||$t!==null&&$t.child!==null)for(Dt=x0(Dt);Dt!==null;){if($t=Dt[mi])return $t;Dt=x0(Dt)}return Bt}Dt=$t,$t=Dt.parentNode}return null}function Hs(Dt){if(Dt=Dt[mi]||Dt[vi]){var Bt=Dt.tag;if(Bt===5||Bt===6||Bt===13||Bt===31||Bt===26||Bt===27||Bt===3)return Dt}return null}function ws(Dt){var Bt=Dt.tag;if(Bt===5||Bt===26||Bt===27||Bt===6)return Dt.stateNode;throw Error(vt(33))}function Es(Dt){var Bt=Dt[ls];return Bt||(Bt=Dt[ls]={hoistableStyles:new Map,hoistableScripts:new Map}),Bt}function Ds(Dt){Dt[xs]=!0}var Fa=new Set,Ja={};function oa(Dt,Bt){aa(Dt,Bt),aa(Dt+"Capture",Bt)}function aa(Dt,Bt){for(Ja[Dt]=Bt,Dt=0;Dt<Bt.length;Dt++)Fa.add(Bt[Dt])}var Mi=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Wa={},Wi={};function Mo(Dt){return dr.call(Wi,Dt)?!0:dr.call(Wa,Dt)?!1:Mi.test(Dt)?Wi[Dt]=!0:(Wa[Dt]=!0,!1)}function ys(Dt,Bt,$t){if(Mo(Bt))if($t===null)Dt.removeAttribute(Bt);else{switch(typeof $t){case"undefined":case"function":case"symbol":Dt.removeAttribute(Bt);return;case"boolean":var Yt=Bt.toLowerCase().slice(0,5);if(Yt!=="data-"&&Yt!=="aria-"){Dt.removeAttribute(Bt);return}}Dt.setAttribute(Bt,""+$t)}}function Va(Dt,Bt,$t){if($t===null)Dt.removeAttribute(Bt);else{switch(typeof $t){case"undefined":case"function":case"symbol":case"boolean":Dt.removeAttribute(Bt);return}Dt.setAttribute(Bt,""+$t)}}function io(Dt,Bt,$t,Yt){if(Yt===null)Dt.removeAttribute($t);else{switch(typeof Yt){case"undefined":case"function":case"symbol":case"boolean":Dt.removeAttribute($t);return}Dt.setAttributeNS(Bt,$t,""+Yt)}}function Fo(Dt){switch(typeof Dt){case"bigint":case"boolean":case"number":case"string":case"undefined":return Dt;case"object":return Dt;default:return""}}function _o(Dt){var Bt=Dt.type;return(Dt=Dt.nodeName)&&Dt.toLowerCase()==="input"&&(Bt==="checkbox"||Bt==="radio")}function lo(Dt,Bt,$t){var Yt=Object.getOwnPropertyDescriptor(Dt.constructor.prototype,Bt);if(!Dt.hasOwnProperty(Bt)&&typeof Yt<"u"&&typeof Yt.get=="function"&&typeof Yt.set=="function"){var an=Yt.get,un=Yt.set;return Object.defineProperty(Dt,Bt,{configurable:!0,get:function(){return an.call(this)},set:function(bn){$t=""+bn,un.call(this,bn)}}),Object.defineProperty(Dt,Bt,{enumerable:Yt.enumerable}),{getValue:function(){return $t},setValue:function(bn){$t=""+bn},stopTracking:function(){Dt._valueTracker=null,delete Dt[Bt]}}}}function Do(Dt){if(!Dt._valueTracker){var Bt=_o(Dt)?"checked":"value";Dt._valueTracker=lo(Dt,Bt,""+Dt[Bt])}}function Cl(Dt){if(!Dt)return!1;var Bt=Dt._valueTracker;if(!Bt)return!0;var $t=Bt.getValue(),Yt="";return Dt&&(Yt=_o(Dt)?Dt.checked?"true":"false":Dt.value),Dt=Yt,Dt!==$t?(Bt.setValue(Dt),!0):!1}function ea(Dt){if(Dt=Dt||(typeof document<"u"?document:void 0),typeof Dt>"u")return null;try{return Dt.activeElement||Dt.body}catch{return Dt.body}}var ma=/[\n"\\]/g;function cs(Dt){return Dt.replace(ma,function(Bt){return"\\"+Bt.charCodeAt(0).toString(16)+" "})}function wa(Dt,Bt,$t,Yt,an,un,bn,qn){Dt.name="",bn!=null&&typeof bn!="function"&&typeof bn!="symbol"&&typeof bn!="boolean"?Dt.type=bn:Dt.removeAttribute("type"),Bt!=null?bn==="number"?(Bt===0&&Dt.value===""||Dt.value!=Bt)&&(Dt.value=""+Fo(Bt)):Dt.value!==""+Fo(Bt)&&(Dt.value=""+Fo(Bt)):bn!=="submit"&&bn!=="reset"||Dt.removeAttribute("value"),Bt!=null?Sa(Dt,bn,Fo(Bt)):$t!=null?Sa(Dt,bn,Fo($t)):Yt!=null&&Dt.removeAttribute("value"),an==null&&un!=null&&(Dt.defaultChecked=!!un),an!=null&&(Dt.checked=an&&typeof an!="function"&&typeof an!="symbol"),qn!=null&&typeof qn!="function"&&typeof qn!="symbol"&&typeof qn!="boolean"?Dt.name=""+Fo(qn):Dt.removeAttribute("name")}function la(Dt,Bt,$t,Yt,an,un,bn,qn){if(un!=null&&typeof un!="function"&&typeof un!="symbol"&&typeof un!="boolean"&&(Dt.type=un),Bt!=null||$t!=null){if(!(un!=="submit"&&un!=="reset"||Bt!=null)){Do(Dt);return}$t=$t!=null?""+Fo($t):"",Bt=Bt!=null?""+Fo(Bt):$t,qn||Bt===Dt.value||(Dt.value=Bt),Dt.defaultValue=Bt}Yt=Yt??an,Yt=typeof Yt!="function"&&typeof Yt!="symbol"&&!!Yt,Dt.checked=qn?Dt.checked:!!Yt,Dt.defaultChecked=!!Yt,bn!=null&&typeof bn!="function"&&typeof bn!="symbol"&&typeof bn!="boolean"&&(Dt.name=bn),Do(Dt)}function Sa(Dt,Bt,$t){Bt==="number"&&ea(Dt.ownerDocument)===Dt||Dt.defaultValue===""+$t||(Dt.defaultValue=""+$t)}function Io(Dt,Bt,$t,Yt){if(Dt=Dt.options,Bt){Bt={};for(var an=0;an<$t.length;an++)Bt["$"+$t[an]]=!0;for($t=0;$t<Dt.length;$t++)an=Bt.hasOwnProperty("$"+Dt[$t].value),Dt[$t].selected!==an&&(Dt[$t].selected=an),an&&Yt&&(Dt[$t].defaultSelected=!0)}else{for($t=""+Fo($t),Bt=null,an=0;an<Dt.length;an++){if(Dt[an].value===$t){Dt[an].selected=!0,Yt&&(Dt[an].defaultSelected=!0);return}Bt!==null||Dt[an].disabled||(Bt=Dt[an])}Bt!==null&&(Bt.selected=!0)}}function xo(Dt,Bt,$t){if(Bt!=null&&(Bt=""+Fo(Bt),Bt!==Dt.value&&(Dt.value=Bt),$t==null)){Dt.defaultValue!==Bt&&(Dt.defaultValue=Bt);return}Dt.defaultValue=$t!=null?""+Fo($t):""}function Ga(Dt,Bt,$t,Yt){if(Bt==null){if(Yt!=null){if($t!=null)throw Error(vt(92));if(sn(Yt)){if(1<Yt.length)throw Error(vt(93));Yt=Yt[0]}$t=Yt}$t==null&&($t=""),Bt=$t}$t=Fo(Bt),Dt.defaultValue=$t,Yt=Dt.textContent,Yt===$t&&Yt!==""&&Yt!==null&&(Dt.value=Yt),Do(Dt)}function wo(Dt,Bt){if(Bt){var $t=Dt.firstChild;if($t&&$t===Dt.lastChild&&$t.nodeType===3){$t.nodeValue=Bt;return}}Dt.textContent=Bt}var Fl=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ca(Dt,Bt,$t){var Yt=Bt.indexOf("--")===0;$t==null||typeof $t=="boolean"||$t===""?Yt?Dt.setProperty(Bt,""):Bt==="float"?Dt.cssFloat="":Dt[Bt]="":Yt?Dt.setProperty(Bt,$t):typeof $t!="number"||$t===0||Fl.has(Bt)?Bt==="float"?Dt.cssFloat=$t:Dt[Bt]=(""+$t).trim():Dt[Bt]=$t+"px"}function za(Dt,Bt,$t){if(Bt!=null&&typeof Bt!="object")throw Error(vt(62));if(Dt=Dt.style,$t!=null){for(var Yt in $t)!$t.hasOwnProperty(Yt)||Bt!=null&&Bt.hasOwnProperty(Yt)||(Yt.indexOf("--")===0?Dt.setProperty(Yt,""):Yt==="float"?Dt.cssFloat="":Dt[Yt]="");for(var an in Bt)Yt=Bt[an],Bt.hasOwnProperty(an)&&$t[an]!==Yt&&ca(Dt,an,Yt)}else for(var un in Bt)Bt.hasOwnProperty(un)&&ca(Dt,un,Bt[un])}function Uo(Dt){if(Dt.indexOf("-")===-1)return!1;switch(Dt){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 Vi=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Os=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function bs(Dt){return Os.test(""+Dt)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":Dt}function $o(){}var al=null;function qo(Dt){return Dt=Dt.target||Dt.srcElement||window,Dt.correspondingUseElement&&(Dt=Dt.correspondingUseElement),Dt.nodeType===3?Dt.parentNode:Dt}var Da=null,qa=null;function Ta(Dt){var Bt=Hs(Dt);if(Bt&&(Dt=Bt.stateNode)){var $t=Dt[wi]||null;e:switch(Dt=Bt.stateNode,Bt.type){case"input":if(wa(Dt,$t.value,$t.defaultValue,$t.defaultValue,$t.checked,$t.defaultChecked,$t.type,$t.name),Bt=$t.name,$t.type==="radio"&&Bt!=null){for($t=Dt;$t.parentNode;)$t=$t.parentNode;for($t=$t.querySelectorAll('input[name="'+cs(""+Bt)+'"][type="radio"]'),Bt=0;Bt<$t.length;Bt++){var Yt=$t[Bt];if(Yt!==Dt&&Yt.form===Dt.form){var an=Yt[wi]||null;if(!an)throw Error(vt(90));wa(Yt,an.value,an.defaultValue,an.defaultValue,an.checked,an.defaultChecked,an.type,an.name)}}for(Bt=0;Bt<$t.length;Bt++)Yt=$t[Bt],Yt.form===Dt.form&&Cl(Yt)}break e;case"textarea":xo(Dt,$t.value,$t.defaultValue);break e;case"select":Bt=$t.value,Bt!=null&&Io(Dt,!!$t.multiple,Bt,!1)}}}var Zl=!1;function $l(Dt,Bt,$t){if(Zl)return Dt(Bt,$t);Zl=!0;try{var Yt=Dt(Bt);return Yt}finally{if(Zl=!1,(Da!==null||qa!==null)&&(gd(),Da&&(Bt=Da,Dt=qa,qa=Da=null,Ta(Bt),Dt)))for(Bt=0;Bt<Dt.length;Bt++)Ta(Dt[Bt])}}function Ts(Dt,Bt){var $t=Dt.stateNode;if($t===null)return null;var Yt=$t[wi]||null;if(Yt===null)return null;$t=Yt[Bt];e:switch(Bt){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(Yt=!Yt.disabled)||(Dt=Dt.type,Yt=!(Dt==="button"||Dt==="input"||Dt==="select"||Dt==="textarea")),Dt=!Yt;break e;default:Dt=!1}if(Dt)return null;if($t&&typeof $t!="function")throw Error(vt(231,Bt,typeof $t));return $t}var To=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ea=!1;if(To)try{var Kr={};Object.defineProperty(Kr,"passive",{get:function(){Ea=!0}}),window.addEventListener("test",Kr,Kr),window.removeEventListener("test",Kr,Kr)}catch{Ea=!1}var gs=null,Ra=null,po=null;function el(){if(po)return po;var Dt,Bt=Ra,$t=Bt.length,Yt,an="value"in gs?gs.value:gs.textContent,un=an.length;for(Dt=0;Dt<$t&&Bt[Dt]===an[Dt];Dt++);var bn=$t-Dt;for(Yt=1;Yt<=bn&&Bt[$t-Yt]===an[un-Yt];Yt++);return po=an.slice(Dt,1<Yt?1-Yt:void 0)}function tl(Dt){var Bt=Dt.keyCode;return"charCode"in Dt?(Dt=Dt.charCode,Dt===0&&Bt===13&&(Dt=13)):Dt=Bt,Dt===10&&(Dt=13),32<=Dt||Dt===13?Dt:0}function ll(){return!0}function us(){return!1}function si(Dt){function Bt($t,Yt,an,un,bn){this._reactName=$t,this._targetInst=an,this.type=Yt,this.nativeEvent=un,this.target=bn,this.currentTarget=null;for(var qn in Dt)Dt.hasOwnProperty(qn)&&($t=Dt[qn],this[qn]=$t?$t(un):un[qn]);return this.isDefaultPrevented=(un.defaultPrevented!=null?un.defaultPrevented:un.returnValue===!1)?ll:us,this.isPropagationStopped=us,this}return Rt(Bt.prototype,{preventDefault:function(){this.defaultPrevented=!0;var $t=this.nativeEvent;$t&&($t.preventDefault?$t.preventDefault():typeof $t.returnValue!="unknown"&&($t.returnValue=!1),this.isDefaultPrevented=ll)},stopPropagation:function(){var $t=this.nativeEvent;$t&&($t.stopPropagation?$t.stopPropagation():typeof $t.cancelBubble!="unknown"&&($t.cancelBubble=!0),this.isPropagationStopped=ll)},persist:function(){},isPersistent:ll}),Bt}var Un={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(Dt){return Dt.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pi=si(Un),zi=Rt({},Un,{view:0,detail:0}),Zi=si(zi),bi,Fi,ts,Gi=Rt({},zi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yo,button:0,buttons:0,relatedTarget:function(Dt){return Dt.relatedTarget===void 0?Dt.fromElement===Dt.srcElement?Dt.toElement:Dt.fromElement:Dt.relatedTarget},movementX:function(Dt){return"movementX"in Dt?Dt.movementX:(Dt!==ts&&(ts&&Dt.type==="mousemove"?(bi=Dt.screenX-ts.screenX,Fi=Dt.screenY-ts.screenY):Fi=bi=0,ts=Dt),bi)},movementY:function(Dt){return"movementY"in Dt?Dt.movementY:Fi}}),hs=si(Gi),Rs=Rt({},Gi,{dataTransfer:0}),vo=si(Rs),go=Rt({},zi,{relatedTarget:0}),ms=si(go),Ii=Rt({},Un,{animationName:0,elapsedTime:0,pseudoElement:0}),Ui=si(Ii),Fs=Rt({},Un,{clipboardData:function(Dt){return"clipboardData"in Dt?Dt.clipboardData:window.clipboardData}}),Ws=si(Fs),Ba=Rt({},Un,{data:0}),ua=si(Ba),Oo={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jo={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},qs={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ya(Dt){var Bt=this.nativeEvent;return Bt.getModifierState?Bt.getModifierState(Dt):(Dt=qs[Dt])?!!Bt[Dt]:!1}function Yo(){return Ya}var wl=Rt({},zi,{key:function(Dt){if(Dt.key){var Bt=Oo[Dt.key]||Dt.key;if(Bt!=="Unidentified")return Bt}return Dt.type==="keypress"?(Dt=tl(Dt),Dt===13?"Enter":String.fromCharCode(Dt)):Dt.type==="keydown"||Dt.type==="keyup"?jo[Dt.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yo,charCode:function(Dt){return Dt.type==="keypress"?tl(Dt):0},keyCode:function(Dt){return Dt.type==="keydown"||Dt.type==="keyup"?Dt.keyCode:0},which:function(Dt){return Dt.type==="keypress"?tl(Dt):Dt.type==="keydown"||Dt.type==="keyup"?Dt.keyCode:0}}),cl=si(wl),As=Rt({},Gi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Po=si(As),da=Rt({},zi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yo}),nl=si(da),uo=Rt({},Un,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ls=si(uo),ya=Rt({},Gi,{deltaX:function(Dt){return"deltaX"in Dt?Dt.deltaX:"wheelDeltaX"in Dt?-Dt.wheelDeltaX:0},deltaY:function(Dt){return"deltaY"in Dt?Dt.deltaY:"wheelDeltaY"in Dt?-Dt.wheelDeltaY:"wheelDelta"in Dt?-Dt.wheelDelta:0},deltaZ:0,deltaMode:0}),jl=si(ya),Ho=Rt({},Un,{newState:0,oldState:0}),hi=si(Ho),Bs=[9,13,27,32],Li=To&&"CompositionEvent"in window,_a=null;To&&"documentMode"in document&&(_a=document.documentMode);var ta=To&&"TextEvent"in window&&!_a,Pl=To&&(!Li||_a&&8<_a&&11>=_a),lc=" ",_l=!1;function ul(Dt,Bt){switch(Dt){case"keyup":return Bs.indexOf(Bt.keyCode)!==-1;case"keydown":return Bt.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ec(Dt){return Dt=Dt.detail,typeof Dt=="object"&&"data"in Dt?Dt.data:null}var Sl=!1;function Lo(Dt,Bt){switch(Dt){case"compositionend":return Ec(Bt);case"keypress":return Bt.which!==32?null:(_l=!0,lc);case"textInput":return Dt=Bt.data,Dt===lc&&_l?null:Dt;default:return null}}function cc(Dt,Bt){if(Sl)return Dt==="compositionend"||!Li&&ul(Dt,Bt)?(Dt=el(),po=Ra=gs=null,Sl=!1,Dt):null;switch(Dt){case"paste":return null;case"keypress":if(!(Bt.ctrlKey||Bt.altKey||Bt.metaKey)||Bt.ctrlKey&&Bt.altKey){if(Bt.char&&1<Bt.char.length)return Bt.char;if(Bt.which)return String.fromCharCode(Bt.which)}return null;case"compositionend":return Pl&&Bt.locale!=="ko"?null:Bt.data;default:return null}}var ss={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Dl(Dt){var Bt=Dt&&Dt.nodeName&&Dt.nodeName.toLowerCase();return Bt==="input"?!!ss[Dt.type]:Bt==="textarea"}function Ql(Dt,Bt,$t,Yt){Da?qa?qa.push(Yt):qa=[Yt]:Da=Yt,Bt=bd(Bt,"onChange"),0<Bt.length&&($t=new pi("onChange","change",null,$t,Yt),Dt.push({event:$t,listeners:Bt}))}var so=null,xl=null;function Jl(Dt){o0(Dt,0)}function Ll(Dt){var Bt=ws(Dt);if(Cl(Bt))return Dt}function uc(Dt,Bt){if(Dt==="change")return Bt}var Xa=!1;if(To){var rl;if(To){var mo="oninput"in document;if(!mo){var na=document.createElement("div");na.setAttribute("oninput","return;"),mo=typeof na.oninput=="function"}rl=mo}else rl=!1;Xa=rl&&(!document.documentMode||9<document.documentMode)}function dl(){so&&(so.detachEvent("onpropertychange",Tl),xl=so=null)}function Tl(Dt){if(Dt.propertyName==="value"&&Ll(xl)){var Bt=[];Ql(Bt,xl,Dt,qo(Dt)),$l(Jl,Bt)}}function Rl(Dt,Bt,$t){Dt==="focusin"?(dl(),so=Bt,xl=$t,so.attachEvent("onpropertychange",Tl)):Dt==="focusout"&&dl()}function Ma(Dt){if(Dt==="selectionchange"||Dt==="keyup"||Dt==="keydown")return Ll(xl)}function kr(Dt,Bt){if(Dt==="click")return Ll(Bt)}function kl(Dt,Bt){if(Dt==="input"||Dt==="change")return Ll(Bt)}function bo(Dt,Bt){return Dt===Bt&&(Dt!==0||1/Dt===1/Bt)||Dt!==Dt&&Bt!==Bt}var Ys=typeof Object.is=="function"?Object.is:bo;function va(Dt,Bt){if(Ys(Dt,Bt))return!0;if(typeof Dt!="object"||Dt===null||typeof Bt!="object"||Bt===null)return!1;var $t=Object.keys(Dt),Yt=Object.keys(Bt);if($t.length!==Yt.length)return!1;for(Yt=0;Yt<$t.length;Yt++){var an=$t[Yt];if(!dr.call(Bt,an)||!Ys(Dt[an],Bt[an]))return!1}return!0}function dc(Dt){for(;Dt&&Dt.firstChild;)Dt=Dt.firstChild;return Dt}function fc(Dt,Bt){var $t=dc(Dt);Dt=0;for(var Yt;$t;){if($t.nodeType===3){if(Yt=Dt+$t.textContent.length,Dt<=Bt&&Yt>=Bt)return{node:$t,offset:Bt-Dt};Dt=Yt}e:{for(;$t;){if($t.nextSibling){$t=$t.nextSibling;break e}$t=$t.parentNode}$t=void 0}$t=dc($t)}}function il(Dt,Bt){return Dt&&Bt?Dt===Bt?!0:Dt&&Dt.nodeType===3?!1:Bt&&Bt.nodeType===3?il(Dt,Bt.parentNode):"contains"in Dt?Dt.contains(Bt):Dt.compareDocumentPosition?!!(Dt.compareDocumentPosition(Bt)&16):!1:!1}function Bl(Dt){Dt=Dt!=null&&Dt.ownerDocument!=null&&Dt.ownerDocument.defaultView!=null?Dt.ownerDocument.defaultView:window;for(var Bt=ea(Dt.document);Bt instanceof Dt.HTMLIFrameElement;){try{var $t=typeof Bt.contentWindow.location.href=="string"}catch{$t=!1}if($t)Dt=Bt.contentWindow;else break;Bt=ea(Dt.document)}return Bt}function sl(Dt){var Bt=Dt&&Dt.nodeName&&Dt.nodeName.toLowerCase();return Bt&&(Bt==="input"&&(Dt.type==="text"||Dt.type==="search"||Dt.type==="tel"||Dt.type==="url"||Dt.type==="password")||Bt==="textarea"||Dt.contentEditable==="true")}var Nl=To&&"documentMode"in document&&11>=document.documentMode,Ml=null,Hl=null,ko=null,Zs=!1;function En(Dt,Bt,$t){var Yt=$t.window===$t?$t.document:$t.nodeType===9?$t:$t.ownerDocument;Zs||Ml==null||Ml!==ea(Yt)||(Yt=Ml,"selectionStart"in Yt&&sl(Yt)?Yt={start:Yt.selectionStart,end:Yt.selectionEnd}:(Yt=(Yt.ownerDocument&&Yt.ownerDocument.defaultView||window).getSelection(),Yt={anchorNode:Yt.anchorNode,anchorOffset:Yt.anchorOffset,focusNode:Yt.focusNode,focusOffset:Yt.focusOffset}),ko&&va(ko,Yt)||(ko=Yt,Yt=bd(Hl,"onSelect"),0<Yt.length&&(Bt=new pi("onSelect","select",null,Bt,$t),Dt.push({event:Bt,listeners:Yt}),Bt.target=Ml)))}function kn(Dt,Bt){var $t={};return $t[Dt.toLowerCase()]=Bt.toLowerCase(),$t["Webkit"+Dt]="webkit"+Bt,$t["Moz"+Dt]="moz"+Bt,$t}var Vn={animationend:kn("Animation","AnimationEnd"),animationiteration:kn("Animation","AnimationIteration"),animationstart:kn("Animation","AnimationStart"),transitionrun:kn("Transition","TransitionRun"),transitionstart:kn("Transition","TransitionStart"),transitioncancel:kn("Transition","TransitionCancel"),transitionend:kn("Transition","TransitionEnd")},Nn={},Dn={};To&&(Dn=document.createElement("div").style,"AnimationEvent"in window||(delete Vn.animationend.animation,delete Vn.animationiteration.animation,delete Vn.animationstart.animation),"TransitionEvent"in window||delete Vn.transitionend.transition);function On(Dt){if(Nn[Dt])return Nn[Dt];if(!Vn[Dt])return Dt;var Bt=Vn[Dt],$t;for($t in Bt)if(Bt.hasOwnProperty($t)&&$t in Dn)return Nn[Dt]=Bt[$t];return Dt}var Pn=On("animationend"),Zn=On("animationiteration"),sr=On("animationstart"),fr=On("transitionrun"),mr=On("transitionstart"),Pr=On("transitioncancel"),Ur=On("transitionend"),Rr=new Map,Wr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Wr.push("scrollEnd");function $r(Dt,Bt){Rr.set(Dt,Bt),oa(Bt,[Dt])}var qr=typeof reportError=="function"?reportError:function(Dt){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Bt=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Dt=="object"&&Dt!==null&&typeof Dt.message=="string"?String(Dt.message):String(Dt),error:Dt});if(!window.dispatchEvent(Bt))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",Dt);return}console.error(Dt)},Vr=[],ri=0,Ei=0;function Di(){for(var Dt=ri,Bt=Ei=ri=0;Bt<Dt;){var $t=Vr[Bt];Vr[Bt++]=null;var Yt=Vr[Bt];Vr[Bt++]=null;var an=Vr[Bt];Vr[Bt++]=null;var un=Vr[Bt];if(Vr[Bt++]=null,Yt!==null&&an!==null){var bn=Yt.pending;bn===null?an.next=an:(an.next=bn.next,bn.next=an),Yt.pending=an}un!==0&&Si($t,an,un)}}function Hi(Dt,Bt,$t,Yt){Vr[ri++]=Dt,Vr[ri++]=Bt,Vr[ri++]=$t,Vr[ri++]=Yt,Ei|=Yt,Dt.lanes|=Yt,Dt=Dt.alternate,Dt!==null&&(Dt.lanes|=Yt)}function Pi(Dt,Bt,$t,Yt){return Hi(Dt,Bt,$t,Yt),Ci(Dt)}function Qi(Dt,Bt){return Hi(Dt,null,null,Bt),Ci(Dt)}function Si(Dt,Bt,$t){Dt.lanes|=$t;var Yt=Dt.alternate;Yt!==null&&(Yt.lanes|=$t);for(var an=!1,un=Dt.return;un!==null;)un.childLanes|=$t,Yt=un.alternate,Yt!==null&&(Yt.childLanes|=$t),un.tag===22&&(Dt=un.stateNode,Dt===null||Dt._visibility&1||(an=!0)),Dt=un,un=un.return;return Dt.tag===3?(un=Dt.stateNode,an&&Bt!==null&&(an=31-Xn($t),Dt=un.hiddenUpdates,Yt=Dt[an],Yt===null?Dt[an]=[Bt]:Yt.push(Bt),Bt.lane=$t|536870912),un):null}function Ci(Dt){if(50<Pu)throw Pu=0,Tf=null,Error(vt(185));for(var Bt=Dt.return;Bt!==null;)Dt=Bt,Bt=Dt.return;return Dt.tag===3?Dt.stateNode:null}var Ai={};function Xs(Dt,Bt,$t,Yt){this.tag=Dt,this.key=$t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=Bt,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=Yt,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ks(Dt,Bt,$t,Yt){return new Xs(Dt,Bt,$t,Yt)}function fa(Dt){return Dt=Dt.prototype,!(!Dt||!Dt.isReactComponent)}function ra(Dt,Bt){var $t=Dt.alternate;return $t===null?($t=Ks(Dt.tag,Bt,Dt.key,Dt.mode),$t.elementType=Dt.elementType,$t.type=Dt.type,$t.stateNode=Dt.stateNode,$t.alternate=Dt,Dt.alternate=$t):($t.pendingProps=Bt,$t.type=Dt.type,$t.flags=0,$t.subtreeFlags=0,$t.deletions=null),$t.flags=Dt.flags&65011712,$t.childLanes=Dt.childLanes,$t.lanes=Dt.lanes,$t.child=Dt.child,$t.memoizedProps=Dt.memoizedProps,$t.memoizedState=Dt.memoizedState,$t.updateQueue=Dt.updateQueue,Bt=Dt.dependencies,$t.dependencies=Bt===null?null:{lanes:Bt.lanes,firstContext:Bt.firstContext},$t.sibling=Dt.sibling,$t.index=Dt.index,$t.ref=Dt.ref,$t.refCleanup=Dt.refCleanup,$t}function Qs(Dt,Bt){Dt.flags&=65011714;var $t=Dt.alternate;return $t===null?(Dt.childLanes=0,Dt.lanes=Bt,Dt.child=null,Dt.subtreeFlags=0,Dt.memoizedProps=null,Dt.memoizedState=null,Dt.updateQueue=null,Dt.dependencies=null,Dt.stateNode=null):(Dt.childLanes=$t.childLanes,Dt.lanes=$t.lanes,Dt.child=$t.child,Dt.subtreeFlags=0,Dt.deletions=null,Dt.memoizedProps=$t.memoizedProps,Dt.memoizedState=$t.memoizedState,Dt.updateQueue=$t.updateQueue,Dt.type=$t.type,Bt=$t.dependencies,Dt.dependencies=Bt===null?null:{lanes:Bt.lanes,firstContext:Bt.firstContext}),Dt}function Ia(Dt,Bt,$t,Yt,an,un){var bn=0;if(Yt=Dt,typeof Dt=="function")fa(Dt)&&(bn=1);else if(typeof Dt=="string")bn=Wg(Dt,$t,mn.current)?26:Dt==="html"||Dt==="head"||Dt==="body"?27:5;else e:switch(Dt){case Gt:return Dt=Ks(31,$t,Bt,an),Dt.elementType=Gt,Dt.lanes=un,Dt;case Ot:return ba($t.children,an,un,Bt);case Mt:bn=8,an|=24;break;case It:return Dt=Ks(12,$t,Bt,an|2),Dt.elementType=It,Dt.lanes=un,Dt;case Vt:return Dt=Ks(13,$t,Bt,an),Dt.elementType=Vt,Dt.lanes=un,Dt;case zt:return Dt=Ks(19,$t,Bt,an),Dt.elementType=zt,Dt.lanes=un,Dt;default:if(typeof Dt=="object"&&Dt!==null)switch(Dt.$$typeof){case Ut:bn=10;break e;case Nt:bn=9;break e;case jt:bn=11;break e;case Ht:bn=14;break e;case Wt:bn=16,Yt=null;break e}bn=29,$t=Error(vt(130,Dt===null?"null":typeof Dt,"")),Yt=null}return Bt=Ks(bn,$t,Bt,an),Bt.elementType=Dt,Bt.type=Yt,Bt.lanes=un,Bt}function ba(Dt,Bt,$t,Yt){return Dt=Ks(7,Dt,Yt,Bt),Dt.lanes=$t,Dt}function zl(Dt,Bt,$t){return Dt=Ks(6,Dt,null,Bt),Dt.lanes=$t,Dt}function Ua(Dt){var Bt=Ks(18,null,null,0);return Bt.stateNode=Dt,Bt}function Il(Dt,Bt,$t){return Bt=Ks(4,Dt.children!==null?Dt.children:[],Dt.key,Bt),Bt.lanes=$t,Bt.stateNode={containerInfo:Dt.containerInfo,pendingChildren:null,implementation:Dt.implementation},Bt}var Oa=new WeakMap;function Xo(Dt,Bt){if(typeof Dt=="object"&&Dt!==null){var $t=Oa.get(Dt);return $t!==void 0?$t:(Bt={value:Dt,source:Bt,stack:Cr(Bt)},Oa.set(Dt,Bt),Bt)}return{value:Dt,source:Bt,stack:Cr(Bt)}}var Pa=[],Ko=0,ia=null,Ol=0,$a=[],Aa=0,fl=null,hl=1,pl="";function vl(Dt,Bt){Pa[Ko++]=Ol,Pa[Ko++]=ia,ia=Dt,Ol=Bt}function bc(Dt,Bt,$t){$a[Aa++]=hl,$a[Aa++]=pl,$a[Aa++]=fl,fl=Dt;var Yt=hl;Dt=pl;var an=32-Xn(Yt)-1;Yt&=~(1<<an),$t+=1;var un=32-Xn(Bt)+an;if(30<un){var bn=an-an%5;un=(Yt&(1<<bn)-1).toString(32),Yt>>=bn,an-=bn,hl=1<<32-Xn(Bt)+an|$t<<an|Yt,pl=un+Dt}else hl=1<<un|$t<<an|Yt,pl=Dt}function zn(Dt){Dt.return!==null&&(vl(Dt,1),bc(Dt,1,0))}function Mr(Dt){for(;Dt===ia;)ia=Pa[--Ko],Pa[Ko]=null,Ol=Pa[--Ko],Pa[Ko]=null;for(;Dt===fl;)fl=$a[--Aa],$a[Aa]=null,pl=$a[--Aa],$a[Aa]=null,hl=$a[--Aa],$a[Aa]=null}function Br(Dt,Bt){$a[Aa++]=hl,$a[Aa++]=pl,$a[Aa++]=fl,hl=Bt.id,pl=Bt.overflow,fl=Dt}var Nr=null,Hr=null,Fn=!1,Ln=null,Gn=!1,er=Error(vt(519));function Er(Dt){var Bt=Error(vt(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ri(Xo(Bt,Dt)),er}function Tr(Dt){var Bt=Dt.stateNode,$t=Dt.type,Yt=Dt.memoizedProps;switch(Bt[mi]=Dt,Bt[wi]=Yt,$t){case"dialog":ro("cancel",Bt),ro("close",Bt);break;case"iframe":case"object":case"embed":ro("load",Bt);break;case"video":case"audio":for($t=0;$t<ku.length;$t++)ro(ku[$t],Bt);break;case"source":ro("error",Bt);break;case"img":case"image":case"link":ro("error",Bt),ro("load",Bt);break;case"details":ro("toggle",Bt);break;case"input":ro("invalid",Bt),la(Bt,Yt.value,Yt.defaultValue,Yt.checked,Yt.defaultChecked,Yt.type,Yt.name,!0);break;case"select":ro("invalid",Bt);break;case"textarea":ro("invalid",Bt),Ga(Bt,Yt.value,Yt.defaultValue,Yt.children)}$t=Yt.children,typeof $t!="string"&&typeof $t!="number"&&typeof $t!="bigint"||Bt.textContent===""+$t||Yt.suppressHydrationWarning===!0||u0(Bt.textContent,$t)?(Yt.popover!=null&&(ro("beforetoggle",Bt),ro("toggle",Bt)),Yt.onScroll!=null&&ro("scroll",Bt),Yt.onScrollEnd!=null&&ro("scrollend",Bt),Yt.onClick!=null&&(Bt.onclick=$o),Bt=!0):Bt=!1,Bt||Er(Dt,!0)}function ai(Dt){for(Nr=Dt.return;Nr;)switch(Nr.tag){case 5:case 31:case 13:Gn=!1;return;case 27:case 3:Gn=!0;return;default:Nr=Nr.return}}function Yr(Dt){if(Dt!==Nr)return!1;if(!Fn)return ai(Dt),Fn=!0,!1;var Bt=Dt.tag,$t;if(($t=Bt!==3&&Bt!==27)&&(($t=Bt===5)&&($t=Dt.type,$t=!($t!=="form"&&$t!=="button")||Wf(Dt.type,Dt.memoizedProps)),$t=!$t),$t&&Hr&&Er(Dt),ai(Dt),Bt===13){if(Dt=Dt.memoizedState,Dt=Dt!==null?Dt.dehydrated:null,!Dt)throw Error(vt(317));Hr=_0(Dt)}else if(Bt===31){if(Dt=Dt.memoizedState,Dt=Dt!==null?Dt.dehydrated:null,!Dt)throw Error(vt(317));Hr=_0(Dt)}else Bt===27?(Bt=Hr,Yc(Dt.type)?(Dt=Xf,Xf=null,Hr=Dt):Hr=Bt):Hr=Nr?gc(Dt.stateNode.nextSibling):null;return!0}function li(){Hr=Nr=null,Fn=!1}function yi(){var Dt=Ln;return Dt!==null&&(Xl===null?Xl=Dt:Xl.push.apply(Xl,Dt),Ln=null),Dt}function Ri(Dt){Ln===null?Ln=[Dt]:Ln.push(Dt)}var Ki=Qt(null),ns=null,Vs=null;function Ps(Dt,Bt,$t){pn(Ki,Bt._currentValue),Bt._currentValue=$t}function ks(Dt){Dt._currentValue=Ki.current,fn(Ki)}function Ms(Dt,Bt,$t){for(;Dt!==null;){var Yt=Dt.alternate;if((Dt.childLanes&Bt)!==Bt?(Dt.childLanes|=Bt,Yt!==null&&(Yt.childLanes|=Bt)):Yt!==null&&(Yt.childLanes&Bt)!==Bt&&(Yt.childLanes|=Bt),Dt===$t)break;Dt=Dt.return}}function fo(Dt,Bt,$t,Yt){var an=Dt.child;for(an!==null&&(an.return=Dt);an!==null;){var un=an.dependencies;if(un!==null){var bn=an.child;un=un.firstContext;e:for(;un!==null;){var qn=un;un=an;for(var Sr=0;Sr<Bt.length;Sr++)if(qn.context===Bt[Sr]){un.lanes|=$t,qn=un.alternate,qn!==null&&(qn.lanes|=$t),Ms(un.return,$t,Dt),Yt||(bn=null);break e}un=qn.next}}else if(an.tag===18){if(bn=an.return,bn===null)throw Error(vt(341));bn.lanes|=$t,un=bn.alternate,un!==null&&(un.lanes|=$t),Ms(bn,$t,Dt),bn=null}else bn=an.child;if(bn!==null)bn.return=an;else for(bn=an;bn!==null;){if(bn===Dt){bn=null;break}if(an=bn.sibling,an!==null){an.return=bn.return,bn=an;break}bn=bn.return}an=bn}}function Zo(Dt,Bt,$t,Yt){Dt=null;for(var an=Bt,un=!1;an!==null;){if(!un){if((an.flags&524288)!==0)un=!0;else if((an.flags&262144)!==0)break}if(an.tag===10){var bn=an.alternate;if(bn===null)throw Error(vt(387));if(bn=bn.memoizedProps,bn!==null){var qn=an.type;Ys(an.pendingProps.value,bn.value)||(Dt!==null?Dt.push(qn):Dt=[qn])}}else if(an===xn.current){if(bn=an.alternate,bn===null)throw Error(vt(387));bn.memoizedState.memoizedState!==an.memoizedState.memoizedState&&(Dt!==null?Dt.push(ju):Dt=[ju])}an=an.return}Dt!==null&&fo(Bt,Dt,$t,Yt),Bt.flags|=262144}function Qo(Dt){for(Dt=Dt.firstContext;Dt!==null;){if(!Ys(Dt.context._currentValue,Dt.memoizedValue))return!0;Dt=Dt.next}return!1}function ha(Dt){ns=Dt,Vs=null,Dt=Dt.dependencies,Dt!==null&&(Dt.firstContext=null)}function co(Dt){return Wl(ns,Dt)}function Ca(Dt,Bt){return ns===null&&ha(Dt),Wl(Dt,Bt)}function Wl(Dt,Bt){var $t=Bt._currentValue;if(Bt={context:Bt,memoizedValue:$t,next:null},Vs===null){if(Dt===null)throw Error(vt(308));Vs=Bt,Dt.dependencies={lanes:0,firstContext:Bt},Dt.flags|=524288}else Vs=Vs.next=Bt;return $t}var ho=typeof AbortController<"u"?AbortController:function(){var Dt=[],Bt=this.signal={aborted:!1,addEventListener:function($t,Yt){Dt.push(Yt)}};this.abort=function(){Bt.aborted=!0,Dt.forEach(function($t){return $t()})}},gl=yt.unstable_scheduleCallback,sa=yt.unstable_NormalPriority,Eo={$$typeof:Ut,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tc(){return{controller:new ho,data:new Map,refCount:0}}function hc(Dt){Dt.refCount--,Dt.refCount===0&&gl(sa,function(){Dt.controller.abort()})}var Vl=null,Ac=0,ml=0,nc=null;function eu(Dt,Bt){if(Vl===null){var $t=Vl=[];Ac=0,ml=Pf(),nc={status:"pending",value:void 0,then:function(Yt){$t.push(Yt)}}}return Ac++,Bt.then(wc,wc),Bt}function wc(){if(--Ac===0&&Vl!==null){nc!==null&&(nc.status="fulfilled");var Dt=Vl;Vl=null,ml=0,nc=null;for(var Bt=0;Bt<Dt.length;Bt++)(0,Dt[Bt])()}}function tu(Dt,Bt){var $t=[],Yt={status:"pending",value:null,reason:null,then:function(an){$t.push(an)}};return Dt.then(function(){Yt.status="fulfilled",Yt.value=Bt;for(var an=0;an<$t.length;an++)(0,$t[an])(Bt)},function(an){for(Yt.status="rejected",Yt.reason=an,an=0;an<$t.length;an++)(0,$t[an])(void 0)}),Yt}var Nc=Zt.S;Zt.S=function(Dt,Bt){Op=Dr(),typeof Bt=="object"&&Bt!==null&&typeof Bt.then=="function"&&eu(Dt,Bt),Nc!==null&&Nc(Dt,Bt)};var La=Qt(null);function en(){var Dt=La.current;return Dt!==null?Dt:Jo.pooledCache}function Sn(Dt,Bt){Bt===null?pn(La,La.current):pn(La,Bt.pool)}function dn(){var Dt=en();return Dt===null?null:{parent:Eo._currentValue,pool:Dt}}var Yn=Error(vt(460)),ur=Error(vt(474)),lr=Error(vt(542)),ei={then:function(){}};function zr(Dt){return Dt=Dt.status,Dt==="fulfilled"||Dt==="rejected"}function Yi(Dt,Bt,$t){switch($t=Dt[$t],$t===void 0?Dt.push(Bt):$t!==Bt&&(Bt.then($o,$o),Bt=$t),Bt.status){case"fulfilled":return Bt.value;case"rejected":throw Dt=Bt.reason,$i(Dt),Dt;default:if(typeof Bt.status=="string")Bt.then($o,$o);else{if(Dt=Jo,Dt!==null&&100<Dt.shellSuspendCounter)throw Error(vt(482));Dt=Bt,Dt.status="pending",Dt.then(function(Yt){if(Bt.status==="pending"){var an=Bt;an.status="fulfilled",an.value=Yt}},function(Yt){if(Bt.status==="pending"){var an=Bt;an.status="rejected",an.reason=Yt}})}switch(Bt.status){case"fulfilled":return Bt.value;case"rejected":throw Dt=Bt.reason,$i(Dt),Dt}throw Xr=Bt,Yn}}function Ir(Dt){try{var Bt=Dt._init;return Bt(Dt._payload)}catch($t){throw $t!==null&&typeof $t=="object"&&typeof $t.then=="function"?(Xr=$t,Yn):$t}}var Xr=null;function eo(){if(Xr===null)throw Error(vt(459));var Dt=Xr;return Xr=null,Dt}function $i(Dt){if(Dt===Yn||Dt===lr)throw Error(vt(483))}var Qr=null,os=0;function Ro(Dt){var Bt=os;return os+=1,Qr===null&&(Qr=[]),Yi(Qr,Dt,Bt)}function Ns(Dt,Bt){Bt=Bt.props.ref,Dt.ref=Bt!==void 0?Bt:null}function Cs(Dt,Bt){throw Bt.$$typeof===Pt?Error(vt(525)):(Dt=Object.prototype.toString.call(Bt),Error(vt(31,Dt==="[object Object]"?"object with keys {"+Object.keys(Bt).join(", ")+"}":Dt)))}function to(Dt){function Bt(jr,Lr){if(Dt){var Zr=jr.deletions;Zr===null?(jr.deletions=[Lr],jr.flags|=16):Zr.push(Lr)}}function $t(jr,Lr){if(!Dt)return null;for(;Lr!==null;)Bt(jr,Lr),Lr=Lr.sibling;return null}function Yt(jr){for(var Lr=new Map;jr!==null;)jr.key!==null?Lr.set(jr.key,jr):Lr.set(jr.index,jr),jr=jr.sibling;return Lr}function an(jr,Lr){return jr=ra(jr,Lr),jr.index=0,jr.sibling=null,jr}function un(jr,Lr,Zr){return jr.index=Zr,Dt?(Zr=jr.alternate,Zr!==null?(Zr=Zr.index,Zr<Lr?(jr.flags|=67108866,Lr):Zr):(jr.flags|=67108866,Lr)):(jr.flags|=1048576,Lr)}function bn(jr){return Dt&&jr.alternate===null&&(jr.flags|=67108866),jr}function qn(jr,Lr,Zr,fi){return Lr===null||Lr.tag!==6?(Lr=zl(Zr,jr.mode,fi),Lr.return=jr,Lr):(Lr=an(Lr,Zr),Lr.return=jr,Lr)}function Sr(jr,Lr,Zr,fi){var ps=Zr.type;return ps===Ot?ui(jr,Lr,Zr.props.children,fi,Zr.key):Lr!==null&&(Lr.elementType===ps||typeof ps=="object"&&ps!==null&&ps.$$typeof===Wt&&Ir(ps)===Lr.type)?(Lr=an(Lr,Zr.props),Ns(Lr,Zr),Lr.return=jr,Lr):(Lr=Ia(Zr.type,Zr.key,Zr.props,null,jr.mode,fi),Ns(Lr,Zr),Lr.return=jr,Lr)}function Jr(jr,Lr,Zr,fi){return Lr===null||Lr.tag!==4||Lr.stateNode.containerInfo!==Zr.containerInfo||Lr.stateNode.implementation!==Zr.implementation?(Lr=Il(Zr,jr.mode,fi),Lr.return=jr,Lr):(Lr=an(Lr,Zr.children||[]),Lr.return=jr,Lr)}function ui(jr,Lr,Zr,fi,ps){return Lr===null||Lr.tag!==7?(Lr=ba(Zr,jr.mode,fi,ps),Lr.return=jr,Lr):(Lr=an(Lr,Zr),Lr.return=jr,Lr)}function gi(jr,Lr,Zr){if(typeof Lr=="string"&&Lr!==""||typeof Lr=="number"||typeof Lr=="bigint")return Lr=zl(""+Lr,jr.mode,Zr),Lr.return=jr,Lr;if(typeof Lr=="object"&&Lr!==null){switch(Lr.$$typeof){case Lt:return Zr=Ia(Lr.type,Lr.key,Lr.props,null,jr.mode,Zr),Ns(Zr,Lr),Zr.return=jr,Zr;case kt:return Lr=Il(Lr,jr.mode,Zr),Lr.return=jr,Lr;case Wt:return Lr=Ir(Lr),gi(jr,Lr,Zr)}if(sn(Lr)||Kt(Lr))return Lr=ba(Lr,jr.mode,Zr,null),Lr.return=jr,Lr;if(typeof Lr.then=="function")return gi(jr,Ro(Lr),Zr);if(Lr.$$typeof===Ut)return gi(jr,Ca(jr,Lr),Zr);Cs(jr,Lr)}return null}function ni(jr,Lr,Zr,fi){var ps=Lr!==null?Lr.key:null;if(typeof Zr=="string"&&Zr!==""||typeof Zr=="number"||typeof Zr=="bigint")return ps!==null?null:qn(jr,Lr,""+Zr,fi);if(typeof Zr=="object"&&Zr!==null){switch(Zr.$$typeof){case Lt:return Zr.key===ps?Sr(jr,Lr,Zr,fi):null;case kt:return Zr.key===ps?Jr(jr,Lr,Zr,fi):null;case Wt:return Zr=Ir(Zr),ni(jr,Lr,Zr,fi)}if(sn(Zr)||Kt(Zr))return ps!==null?null:ui(jr,Lr,Zr,fi,null);if(typeof Zr.then=="function")return ni(jr,Lr,Ro(Zr),fi);if(Zr.$$typeof===Ut)return ni(jr,Lr,Ca(jr,Zr),fi);Cs(jr,Zr)}return null}function oi(jr,Lr,Zr,fi,ps){if(typeof fi=="string"&&fi!==""||typeof fi=="number"||typeof fi=="bigint")return jr=jr.get(Zr)||null,qn(Lr,jr,""+fi,ps);if(typeof fi=="object"&&fi!==null){switch(fi.$$typeof){case Lt:return jr=jr.get(fi.key===null?Zr:fi.key)||null,Sr(Lr,jr,fi,ps);case kt:return jr=jr.get(fi.key===null?Zr:fi.key)||null,Jr(Lr,jr,fi,ps);case Wt:return fi=Ir(fi),oi(jr,Lr,Zr,fi,ps)}if(sn(fi)||Kt(fi))return jr=jr.get(Zr)||null,ui(Lr,jr,fi,ps,null);if(typeof fi.then=="function")return oi(jr,Lr,Zr,Ro(fi),ps);if(fi.$$typeof===Ut)return oi(jr,Lr,Zr,Ca(Lr,fi),ps);Cs(Lr,fi)}return null}function Ji(jr,Lr,Zr,fi){for(var ps=null,Ao=null,is=Lr,Gs=Lr=0,ao=null;is!==null&&Gs<Zr.length;Gs++){is.index>Gs?(ao=is,is=null):ao=is.sibling;var Co=ni(jr,is,Zr[Gs],fi);if(Co===null){is===null&&(is=ao);break}Dt&&is&&Co.alternate===null&&Bt(jr,is),Lr=un(Co,Lr,Gs),Ao===null?ps=Co:Ao.sibling=Co,Ao=Co,is=ao}if(Gs===Zr.length)return $t(jr,is),Fn&&vl(jr,Gs),ps;if(is===null){for(;Gs<Zr.length;Gs++)is=gi(jr,Zr[Gs],fi),is!==null&&(Lr=un(is,Lr,Gs),Ao===null?ps=is:Ao.sibling=is,Ao=is);return Fn&&vl(jr,Gs),ps}for(is=Yt(is);Gs<Zr.length;Gs++)ao=oi(is,jr,Gs,Zr[Gs],fi),ao!==null&&(Dt&&ao.alternate!==null&&is.delete(ao.key===null?Gs:ao.key),Lr=un(ao,Lr,Gs),Ao===null?ps=ao:Ao.sibling=ao,Ao=ao);return Dt&&is.forEach(function(Jc){return Bt(jr,Jc)}),Fn&&vl(jr,Gs),ps}function _s(jr,Lr,Zr,fi){if(Zr==null)throw Error(vt(151));for(var ps=null,Ao=null,is=Lr,Gs=Lr=0,ao=null,Co=Zr.next();is!==null&&!Co.done;Gs++,Co=Zr.next()){is.index>Gs?(ao=is,is=null):ao=is.sibling;var Jc=ni(jr,is,Co.value,fi);if(Jc===null){is===null&&(is=ao);break}Dt&&is&&Jc.alternate===null&&Bt(jr,is),Lr=un(Jc,Lr,Gs),Ao===null?ps=Jc:Ao.sibling=Jc,Ao=Jc,is=ao}if(Co.done)return $t(jr,is),Fn&&vl(jr,Gs),ps;if(is===null){for(;!Co.done;Gs++,Co=Zr.next())Co=gi(jr,Co.value,fi),Co!==null&&(Lr=un(Co,Lr,Gs),Ao===null?ps=Co:Ao.sibling=Co,Ao=Co);return Fn&&vl(jr,Gs),ps}for(is=Yt(is);!Co.done;Gs++,Co=Zr.next())Co=oi(is,jr,Gs,Co.value,fi),Co!==null&&(Dt&&Co.alternate!==null&&is.delete(Co.key===null?Gs:Co.key),Lr=un(Co,Lr,Gs),Ao===null?ps=Co:Ao.sibling=Co,Ao=Co);return Dt&&is.forEach(function(tm){return Bt(jr,tm)}),Fn&&vl(jr,Gs),ps}function Go(jr,Lr,Zr,fi){if(typeof Zr=="object"&&Zr!==null&&Zr.type===Ot&&Zr.key===null&&(Zr=Zr.props.children),typeof Zr=="object"&&Zr!==null){switch(Zr.$$typeof){case Lt:e:{for(var ps=Zr.key;Lr!==null;){if(Lr.key===ps){if(ps=Zr.type,ps===Ot){if(Lr.tag===7){$t(jr,Lr.sibling),fi=an(Lr,Zr.props.children),fi.return=jr,jr=fi;break e}}else if(Lr.elementType===ps||typeof ps=="object"&&ps!==null&&ps.$$typeof===Wt&&Ir(ps)===Lr.type){$t(jr,Lr.sibling),fi=an(Lr,Zr.props),Ns(fi,Zr),fi.return=jr,jr=fi;break e}$t(jr,Lr);break}else Bt(jr,Lr);Lr=Lr.sibling}Zr.type===Ot?(fi=ba(Zr.props.children,jr.mode,fi,Zr.key),fi.return=jr,jr=fi):(fi=Ia(Zr.type,Zr.key,Zr.props,null,jr.mode,fi),Ns(fi,Zr),fi.return=jr,jr=fi)}return bn(jr);case kt:e:{for(ps=Zr.key;Lr!==null;){if(Lr.key===ps)if(Lr.tag===4&&Lr.stateNode.containerInfo===Zr.containerInfo&&Lr.stateNode.implementation===Zr.implementation){$t(jr,Lr.sibling),fi=an(Lr,Zr.children||[]),fi.return=jr,jr=fi;break e}else{$t(jr,Lr);break}else Bt(jr,Lr);Lr=Lr.sibling}fi=Il(Zr,jr.mode,fi),fi.return=jr,jr=fi}return bn(jr);case Wt:return Zr=Ir(Zr),Go(jr,Lr,Zr,fi)}if(sn(Zr))return Ji(jr,Lr,Zr,fi);if(Kt(Zr)){if(ps=Kt(Zr),typeof ps!="function")throw Error(vt(150));return Zr=ps.call(Zr),_s(jr,Lr,Zr,fi)}if(typeof Zr.then=="function")return Go(jr,Lr,Ro(Zr),fi);if(Zr.$$typeof===Ut)return Go(jr,Lr,Ca(jr,Zr),fi);Cs(jr,Zr)}return typeof Zr=="string"&&Zr!==""||typeof Zr=="number"||typeof Zr=="bigint"?(Zr=""+Zr,Lr!==null&&Lr.tag===6?($t(jr,Lr.sibling),fi=an(Lr,Zr),fi.return=jr,jr=fi):($t(jr,Lr),fi=zl(Zr,jr.mode,fi),fi.return=jr,jr=fi),bn(jr)):$t(jr,Lr)}return function(jr,Lr,Zr,fi){try{os=0;var ps=Go(jr,Lr,Zr,fi);return Qr=null,ps}catch(is){if(is===Yn||is===lr)throw is;var Ao=Ks(29,is,null,jr.mode);return Ao.lanes=fi,Ao.return=jr,Ao}}}var Ss=to(!0),Oi=to(!1),zs=!1;function pa(Dt){Dt.updateQueue={baseState:Dt.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ds(Dt,Bt){Dt=Dt.updateQueue,Bt.updateQueue===Dt&&(Bt.updateQueue={baseState:Dt.baseState,firstBaseUpdate:Dt.firstBaseUpdate,lastBaseUpdate:Dt.lastBaseUpdate,shared:Dt.shared,callbacks:null})}function Js(Dt){return{lane:Dt,tag:0,payload:null,callback:null,next:null}}function Gr(Dt,Bt,$t){var Yt=Dt.updateQueue;if(Yt===null)return null;if(Yt=Yt.shared,(So&2)!==0){var an=Yt.pending;return an===null?Bt.next=Bt:(Bt.next=an.next,an.next=Bt),Yt.pending=Bt,Bt=Ci(Dt),Si(Dt,null,$t),Bt}return Hi(Dt,Yt,Bt,$t),Ci(Dt)}function Ti(Dt,Bt,$t){if(Bt=Bt.updateQueue,Bt!==null&&(Bt=Bt.shared,($t&4194048)!==0)){var Yt=Bt.lanes;Yt&=Dt.pendingLanes,$t|=Yt,Bt.lanes=$t,Bi(Dt,$t)}}function rs(Dt,Bt){var $t=Dt.updateQueue,Yt=Dt.alternate;if(Yt!==null&&(Yt=Yt.updateQueue,$t===Yt)){var an=null,un=null;if($t=$t.firstBaseUpdate,$t!==null){do{var bn={lane:$t.lane,tag:$t.tag,payload:$t.payload,callback:null,next:null};un===null?an=un=bn:un=un.next=bn,$t=$t.next}while($t!==null);un===null?an=un=Bt:un=un.next=Bt}else an=un=Bt;$t={baseState:Yt.baseState,firstBaseUpdate:an,lastBaseUpdate:un,shared:Yt.shared,callbacks:Yt.callbacks},Dt.updateQueue=$t;return}Dt=$t.lastBaseUpdate,Dt===null?$t.firstBaseUpdate=Bt:Dt.next=Bt,$t.lastBaseUpdate=Bt}var es=!1;function yo(){if(es){var Dt=nc;if(Dt!==null)throw Dt}}function Bo(Dt,Bt,$t,Yt){es=!1;var an=Dt.updateQueue;zs=!1;var un=an.firstBaseUpdate,bn=an.lastBaseUpdate,qn=an.shared.pending;if(qn!==null){an.shared.pending=null;var Sr=qn,Jr=Sr.next;Sr.next=null,bn===null?un=Jr:bn.next=Jr,bn=Sr;var ui=Dt.alternate;ui!==null&&(ui=ui.updateQueue,qn=ui.lastBaseUpdate,qn!==bn&&(qn===null?ui.firstBaseUpdate=Jr:qn.next=Jr,ui.lastBaseUpdate=Sr))}if(un!==null){var gi=an.baseState;bn=0,ui=Jr=Sr=null,qn=un;do{var ni=qn.lane&-536870913,oi=ni!==qn.lane;if(oi?(oo&ni)===ni:(Yt&ni)===ni){ni!==0&&ni===ml&&(es=!0),ui!==null&&(ui=ui.next={lane:0,tag:qn.tag,payload:qn.payload,callback:null,next:null});e:{var Ji=Dt,_s=qn;ni=Bt;var Go=$t;switch(_s.tag){case 1:if(Ji=_s.payload,typeof Ji=="function"){gi=Ji.call(Go,gi,ni);break e}gi=Ji;break e;case 3:Ji.flags=Ji.flags&-65537|128;case 0:if(Ji=_s.payload,ni=typeof Ji=="function"?Ji.call(Go,gi,ni):Ji,ni==null)break e;gi=Rt({},gi,ni);break e;case 2:zs=!0}}ni=qn.callback,ni!==null&&(Dt.flags|=64,oi&&(Dt.flags|=8192),oi=an.callbacks,oi===null?an.callbacks=[ni]:oi.push(ni))}else oi={lane:ni,tag:qn.tag,payload:qn.payload,callback:qn.callback,next:null},ui===null?(Jr=ui=oi,Sr=gi):ui=ui.next=oi,bn|=ni;if(qn=qn.next,qn===null){if(qn=an.shared.pending,qn===null)break;oi=qn,qn=oi.next,oi.next=null,an.lastBaseUpdate=oi,an.shared.pending=null}}while(!0);ui===null&&(Sr=gi),an.baseState=Sr,an.firstBaseUpdate=Jr,an.lastBaseUpdate=ui,un===null&&(an.shared.lanes=0),Hc|=bn,Dt.lanes=bn,Dt.memoizedState=gi}}function El(Dt,Bt){if(typeof Dt!="function")throw Error(vt(191,Dt));Dt.call(Bt)}function yc(Dt,Bt){var $t=Dt.callbacks;if($t!==null)for(Dt.callbacks=null,Dt=0;Dt<$t.length;Dt++)El($t[Dt],Bt)}var _c=Qt(null),ou=Qt(0);function Yu(Dt,Bt){Dt=Pc,pn(ou,Dt),pn(_c,Bt),Pc=Dt|Bt.baseLanes}function au(){pn(ou,Pc),pn(_c,_c.current)}function zd(){Pc=ou.current,fn(_c),fn(ou)}var rc=Qt(null),pc=null;function zc(Dt){var Bt=Dt.alternate;pn(ja,ja.current&1),pn(rc,Dt),pc===null&&(Bt===null||_c.current!==null||Bt.memoizedState!==null)&&(pc=Dt)}function Ud(Dt){pn(ja,ja.current),pn(rc,Dt),pc===null&&(pc=Dt)}function lh(Dt){Dt.tag===22?(pn(ja,ja.current),pn(rc,Dt),pc===null&&(pc=Dt)):Uc()}function Uc(){pn(ja,ja.current),pn(rc,rc.current)}function ic(Dt){fn(rc),pc===Dt&&(pc=null),fn(ja)}var ja=Qt(0);function Xu(Dt){for(var Bt=Dt;Bt!==null;){if(Bt.tag===13){var $t=Bt.memoizedState;if($t!==null&&($t=$t.dehydrated,$t===null||qf($t)||Yf($t)))return Bt}else if(Bt.tag===19&&(Bt.memoizedProps.revealOrder==="forwards"||Bt.memoizedProps.revealOrder==="backwards"||Bt.memoizedProps.revealOrder==="unstable_legacy-backwards"||Bt.memoizedProps.revealOrder==="together")){if((Bt.flags&128)!==0)return Bt}else if(Bt.child!==null){Bt.child.return=Bt,Bt=Bt.child;continue}if(Bt===Dt)break;for(;Bt.sibling===null;){if(Bt.return===null||Bt.return===Dt)return null;Bt=Bt.return}Bt.sibling.return=Bt.return,Bt=Bt.sibling}return null}var Sc=0,Us=null,Wo=null,Ka=null,Ku=!1,lu=!1,nu=!1,Zu=0,Au=0,cu=null,V0=0;function ka(){throw Error(vt(321))}function $d(Dt,Bt){if(Bt===null)return!1;for(var $t=0;$t<Bt.length&&$t<Dt.length;$t++)if(!Ys(Dt[$t],Bt[$t]))return!1;return!0}function jd(Dt,Bt,$t,Yt,an,un){return Sc=un,Us=Bt,Bt.memoizedState=null,Bt.updateQueue=null,Bt.lanes=0,Zt.H=Dt===null||Dt.memoizedState===null?Vh:rf,nu=!1,un=$t(Yt,an),nu=!1,lu&&(un=uh(Bt,$t,Yt,an)),ch(Dt),un}function ch(Dt){Zt.H=wu;var Bt=Wo!==null&&Wo.next!==null;if(Sc=0,Ka=Wo=Us=null,Ku=!1,Au=0,cu=null,Bt)throw Error(vt(300));Dt===null||Za||(Dt=Dt.dependencies,Dt!==null&&Qo(Dt)&&(Za=!0))}function uh(Dt,Bt,$t,Yt){Us=Dt;var an=0;do{if(lu&&(cu=null),Au=0,lu=!1,25<=an)throw Error(vt(301));if(an+=1,Ka=Wo=null,Dt.updateQueue!=null){var un=Dt.updateQueue;un.lastEffect=null,un.events=null,un.stores=null,un.memoCache!=null&&(un.memoCache.index=0)}Zt.H=Gh,un=Bt($t,Yt)}while(lu);return un}function G0(){var Dt=Zt.H,Bt=Dt.useState()[0];return Bt=typeof Bt.then=="function"?Cu(Bt):Bt,Dt=Dt.useState()[0],(Wo!==null?Wo.memoizedState:null)!==Dt&&(Us.flags|=1024),Bt}function Hd(){var Dt=Zu!==0;return Zu=0,Dt}function Wd(Dt,Bt,$t){Bt.updateQueue=Dt.updateQueue,Bt.flags&=-2053,Dt.lanes&=~$t}function Vd(Dt){if(Ku){for(Dt=Dt.memoizedState;Dt!==null;){var Bt=Dt.queue;Bt!==null&&(Bt.pending=null),Dt=Dt.next}Ku=!1}Sc=0,Ka=Wo=Us=null,lu=!1,Au=Zu=0,cu=null}function Ul(){var Dt={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ka===null?Us.memoizedState=Ka=Dt:Ka=Ka.next=Dt,Ka}function Ha(){if(Wo===null){var Dt=Us.alternate;Dt=Dt!==null?Dt.memoizedState:null}else Dt=Wo.next;var Bt=Ka===null?Us.memoizedState:Ka.next;if(Bt!==null)Ka=Bt,Wo=Dt;else{if(Dt===null)throw Us.alternate===null?Error(vt(467)):Error(vt(310));Wo=Dt,Dt={memoizedState:Wo.memoizedState,baseState:Wo.baseState,baseQueue:Wo.baseQueue,queue:Wo.queue,next:null},Ka===null?Us.memoizedState=Ka=Dt:Ka=Ka.next=Dt}return Ka}function Qu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Cu(Dt){var Bt=Au;return Au+=1,cu===null&&(cu=[]),Dt=Yi(cu,Dt,Bt),Bt=Us,(Ka===null?Bt.memoizedState:Ka.next)===null&&(Bt=Bt.alternate,Zt.H=Bt===null||Bt.memoizedState===null?Vh:rf),Dt}function Ju(Dt){if(Dt!==null&&typeof Dt=="object"){if(typeof Dt.then=="function")return Cu(Dt);if(Dt.$$typeof===Ut)return co(Dt)}throw Error(vt(438,String(Dt)))}function Gd(Dt){var Bt=null,$t=Us.updateQueue;if($t!==null&&(Bt=$t.memoCache),Bt==null){var Yt=Us.alternate;Yt!==null&&(Yt=Yt.updateQueue,Yt!==null&&(Yt=Yt.memoCache,Yt!=null&&(Bt={data:Yt.data.map(function(an){return an.slice()}),index:0})))}if(Bt==null&&(Bt={data:[],index:0}),$t===null&&($t=Qu(),Us.updateQueue=$t),$t.memoCache=Bt,$t=Bt.data[Bt.index],$t===void 0)for($t=Bt.data[Bt.index]=Array(Dt),Yt=0;Yt<Dt;Yt++)$t[Yt]=qt;return Bt.index++,$t}function Dc(Dt,Bt){return typeof Bt=="function"?Bt(Dt):Bt}function ed(Dt){var Bt=Ha();return qd(Bt,Wo,Dt)}function qd(Dt,Bt,$t){var Yt=Dt.queue;if(Yt===null)throw Error(vt(311));Yt.lastRenderedReducer=$t;var an=Dt.baseQueue,un=Yt.pending;if(un!==null){if(an!==null){var bn=an.next;an.next=un.next,un.next=bn}Bt.baseQueue=an=un,Yt.pending=null}if(un=Dt.baseState,an===null)Dt.memoizedState=un;else{Bt=an.next;var qn=bn=null,Sr=null,Jr=Bt,ui=!1;do{var gi=Jr.lane&-536870913;if(gi!==Jr.lane?(oo&gi)===gi:(Sc&gi)===gi){var ni=Jr.revertLane;if(ni===0)Sr!==null&&(Sr=Sr.next={lane:0,revertLane:0,gesture:null,action:Jr.action,hasEagerState:Jr.hasEagerState,eagerState:Jr.eagerState,next:null}),gi===ml&&(ui=!0);else if((Sc&ni)===ni){Jr=Jr.next,ni===ml&&(ui=!0);continue}else gi={lane:0,revertLane:Jr.revertLane,gesture:null,action:Jr.action,hasEagerState:Jr.hasEagerState,eagerState:Jr.eagerState,next:null},Sr===null?(qn=Sr=gi,bn=un):Sr=Sr.next=gi,Us.lanes|=ni,Hc|=ni;gi=Jr.action,nu&&$t(un,gi),un=Jr.hasEagerState?Jr.eagerState:$t(un,gi)}else ni={lane:gi,revertLane:Jr.revertLane,gesture:Jr.gesture,action:Jr.action,hasEagerState:Jr.hasEagerState,eagerState:Jr.eagerState,next:null},Sr===null?(qn=Sr=ni,bn=un):Sr=Sr.next=ni,Us.lanes|=gi,Hc|=gi;Jr=Jr.next}while(Jr!==null&&Jr!==Bt);if(Sr===null?bn=un:Sr.next=qn,!Ys(un,Dt.memoizedState)&&(Za=!0,ui&&($t=nc,$t!==null)))throw $t;Dt.memoizedState=un,Dt.baseState=bn,Dt.baseQueue=Sr,Yt.lastRenderedState=un}return an===null&&(Yt.lanes=0),[Dt.memoizedState,Yt.dispatch]}function Yd(Dt){var Bt=Ha(),$t=Bt.queue;if($t===null)throw Error(vt(311));$t.lastRenderedReducer=Dt;var Yt=$t.dispatch,an=$t.pending,un=Bt.memoizedState;if(an!==null){$t.pending=null;var bn=an=an.next;do un=Dt(un,bn.action),bn=bn.next;while(bn!==an);Ys(un,Bt.memoizedState)||(Za=!0),Bt.memoizedState=un,Bt.baseQueue===null&&(Bt.baseState=un),$t.lastRenderedState=un}return[un,Yt]}function dh(Dt,Bt,$t){var Yt=Us,an=Ha(),un=Fn;if(un){if($t===void 0)throw Error(vt(407));$t=$t()}else $t=Bt();var bn=!Ys((Wo||an).memoizedState,$t);if(bn&&(an.memoizedState=$t,Za=!0),an=an.queue,Zd(ph.bind(null,Yt,an,Dt),[Dt]),an.getSnapshot!==Bt||bn||Ka!==null&&Ka.memoizedState.tag&1){if(Yt.flags|=2048,uu(9,{destroy:void 0},hh.bind(null,Yt,an,$t,Bt),null),Jo===null)throw Error(vt(349));un||(Sc&127)!==0||fh(Yt,Bt,$t)}return $t}function fh(Dt,Bt,$t){Dt.flags|=16384,Dt={getSnapshot:Bt,value:$t},Bt=Us.updateQueue,Bt===null?(Bt=Qu(),Us.updateQueue=Bt,Bt.stores=[Dt]):($t=Bt.stores,$t===null?Bt.stores=[Dt]:$t.push(Dt))}function hh(Dt,Bt,$t,Yt){Bt.value=$t,Bt.getSnapshot=Yt,gh(Bt)&&mh(Dt)}function ph(Dt,Bt,$t){return $t(function(){gh(Bt)&&mh(Dt)})}function gh(Dt){var Bt=Dt.getSnapshot;Dt=Dt.value;try{var $t=Bt();return!Ys(Dt,$t)}catch{return!0}}function mh(Dt){var Bt=Qi(Dt,2);Bt!==null&&Kl(Bt,Dt,2)}function Xd(Dt){var Bt=Ul();if(typeof Dt=="function"){var $t=Dt;if(Dt=$t(),nu){wn(!0);try{$t()}finally{wn(!1)}}}return Bt.memoizedState=Bt.baseState=Dt,Bt.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dc,lastRenderedState:Dt},Bt}function Eh(Dt,Bt,$t,Yt){return Dt.baseState=$t,qd(Dt,Wo,typeof Yt=="function"?Yt:Dc)}function q0(Dt,Bt,$t,Yt,an){if(rd(Dt))throw Error(vt(485));if(Dt=Bt.action,Dt!==null){var un={payload:an,action:Dt,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(bn){un.listeners.push(bn)}};Zt.T!==null?$t(!0):un.isTransition=!1,Yt(un),$t=Bt.pending,$t===null?(un.next=Bt.pending=un,yh(Bt,un)):(un.next=$t.next,Bt.pending=$t.next=un)}}function yh(Dt,Bt){var $t=Bt.action,Yt=Bt.payload,an=Dt.state;if(Bt.isTransition){var un=Zt.T,bn={};Zt.T=bn;try{var qn=$t(an,Yt),Sr=Zt.S;Sr!==null&&Sr(bn,qn),_h(Dt,Bt,qn)}catch(Jr){Kd(Dt,Bt,Jr)}finally{un!==null&&bn.types!==null&&(un.types=bn.types),Zt.T=un}}else try{un=$t(an,Yt),_h(Dt,Bt,un)}catch(Jr){Kd(Dt,Bt,Jr)}}function _h(Dt,Bt,$t){$t!==null&&typeof $t=="object"&&typeof $t.then=="function"?$t.then(function(Yt){xh(Dt,Bt,Yt)},function(Yt){return Kd(Dt,Bt,Yt)}):xh(Dt,Bt,$t)}function xh(Dt,Bt,$t){Bt.status="fulfilled",Bt.value=$t,vh(Bt),Dt.state=$t,Bt=Dt.pending,Bt!==null&&($t=Bt.next,$t===Bt?Dt.pending=null:($t=$t.next,Bt.next=$t,yh(Dt,$t)))}function Kd(Dt,Bt,$t){var Yt=Dt.pending;if(Dt.pending=null,Yt!==null){Yt=Yt.next;do Bt.status="rejected",Bt.reason=$t,vh(Bt),Bt=Bt.next;while(Bt!==Yt)}Dt.action=null}function vh(Dt){Dt=Dt.listeners;for(var Bt=0;Bt<Dt.length;Bt++)(0,Dt[Bt])()}function bh(Dt,Bt){return Bt}function Ah(Dt,Bt){if(Fn){var $t=Jo.formState;if($t!==null){e:{var Yt=Us;if(Fn){if(Hr){t:{for(var an=Hr,un=Gn;an.nodeType!==8;){if(!un){an=null;break t}if(an=gc(an.nextSibling),an===null){an=null;break t}}un=an.data,an=un==="F!"||un==="F"?an:null}if(an){Hr=gc(an.nextSibling),Yt=an.data==="F!";break e}}Er(Yt)}Yt=!1}Yt&&(Bt=$t[0])}}return $t=Ul(),$t.memoizedState=$t.baseState=Bt,Yt={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bh,lastRenderedState:Bt},$t.queue=Yt,$t=jh.bind(null,Us,Yt),Yt.dispatch=$t,Yt=Xd(!1),un=nf.bind(null,Us,!1,Yt.queue),Yt=Ul(),an={state:Bt,dispatch:null,action:Dt,pending:null},Yt.queue=an,$t=q0.bind(null,Us,an,un,$t),an.dispatch=$t,Yt.memoizedState=Dt,[Bt,$t,!1]}function Ch(Dt){var Bt=Ha();return Fh(Bt,Wo,Dt)}function Fh(Dt,Bt,$t){if(Bt=qd(Dt,Bt,bh)[0],Dt=ed(Dc)[0],typeof Bt=="object"&&Bt!==null&&typeof Bt.then=="function")try{var Yt=Cu(Bt)}catch(bn){throw bn===Yn?lr:bn}else Yt=Bt;Bt=Ha();var an=Bt.queue,un=an.dispatch;return $t!==Bt.memoizedState&&(Us.flags|=2048,uu(9,{destroy:void 0},Y0.bind(null,an,$t),null)),[Yt,un,Dt]}function Y0(Dt,Bt){Dt.action=Bt}function wh(Dt){var Bt=Ha(),$t=Wo;if($t!==null)return Fh(Bt,$t,Dt);Ha(),Bt=Bt.memoizedState,$t=Ha();var Yt=$t.queue.dispatch;return $t.memoizedState=Dt,[Bt,Yt,!1]}function uu(Dt,Bt,$t,Yt){return Dt={tag:Dt,create:$t,deps:Yt,inst:Bt,next:null},Bt=Us.updateQueue,Bt===null&&(Bt=Qu(),Us.updateQueue=Bt),$t=Bt.lastEffect,$t===null?Bt.lastEffect=Dt.next=Dt:(Yt=$t.next,$t.next=Dt,Dt.next=Yt,Bt.lastEffect=Dt),Dt}function Sh(){return Ha().memoizedState}function td(Dt,Bt,$t,Yt){var an=Ul();Us.flags|=Dt,an.memoizedState=uu(1|Bt,{destroy:void 0},$t,Yt===void 0?null:Yt)}function nd(Dt,Bt,$t,Yt){var an=Ha();Yt=Yt===void 0?null:Yt;var un=an.memoizedState.inst;Wo!==null&&Yt!==null&&$d(Yt,Wo.memoizedState.deps)?an.memoizedState=uu(Bt,un,$t,Yt):(Us.flags|=Dt,an.memoizedState=uu(1|Bt,un,$t,Yt))}function Dh(Dt,Bt){td(8390656,8,Dt,Bt)}function Zd(Dt,Bt){nd(2048,8,Dt,Bt)}function X0(Dt){Us.flags|=4;var Bt=Us.updateQueue;if(Bt===null)Bt=Qu(),Us.updateQueue=Bt,Bt.events=[Dt];else{var $t=Bt.events;$t===null?Bt.events=[Dt]:$t.push(Dt)}}function Th(Dt){var Bt=Ha().memoizedState;return X0({ref:Bt,nextImpl:Dt}),function(){if((So&2)!==0)throw Error(vt(440));return Bt.impl.apply(void 0,arguments)}}function Rh(Dt,Bt){return nd(4,2,Dt,Bt)}function Bh(Dt,Bt){return nd(4,4,Dt,Bt)}function Mh(Dt,Bt){if(typeof Bt=="function"){Dt=Dt();var $t=Bt(Dt);return function(){typeof $t=="function"?$t():Bt(null)}}if(Bt!=null)return Dt=Dt(),Bt.current=Dt,function(){Bt.current=null}}function Ih(Dt,Bt,$t){$t=$t!=null?$t.concat([Dt]):null,nd(4,4,Mh.bind(null,Bt,Dt),$t)}function Qd(){}function Oh(Dt,Bt){var $t=Ha();Bt=Bt===void 0?null:Bt;var Yt=$t.memoizedState;return Bt!==null&&$d(Bt,Yt[1])?Yt[0]:($t.memoizedState=[Dt,Bt],Dt)}function Ph(Dt,Bt){var $t=Ha();Bt=Bt===void 0?null:Bt;var Yt=$t.memoizedState;if(Bt!==null&&$d(Bt,Yt[1]))return Yt[0];if(Yt=Dt(),nu){wn(!0);try{Dt()}finally{wn(!1)}}return $t.memoizedState=[Yt,Bt],Yt}function Jd(Dt,Bt,$t){return $t===void 0||(Sc&1073741824)!==0&&(oo&261930)===0?Dt.memoizedState=Bt:(Dt.memoizedState=$t,Dt=Lp(),Us.lanes|=Dt,Hc|=Dt,$t)}function Lh(Dt,Bt,$t,Yt){return Ys($t,Bt)?$t:_c.current!==null?(Dt=Jd(Dt,$t,Yt),Ys(Dt,Bt)||(Za=!0),Dt):(Sc&42)===0||(Sc&1073741824)!==0&&(oo&261930)===0?(Za=!0,Dt.memoizedState=$t):(Dt=Lp(),Us.lanes|=Dt,Hc|=Dt,Bt)}function kh(Dt,Bt,$t,Yt,an){var un=nn.p;nn.p=un!==0&&8>un?un:8;var bn=Zt.T,qn={};Zt.T=qn,nf(Dt,!1,Bt,$t);try{var Sr=an(),Jr=Zt.S;if(Jr!==null&&Jr(qn,Sr),Sr!==null&&typeof Sr=="object"&&typeof Sr.then=="function"){var ui=tu(Sr,Yt);Fu(Dt,Bt,ui,ac(Dt))}else Fu(Dt,Bt,Yt,ac(Dt))}catch(gi){Fu(Dt,Bt,{then:function(){},status:"rejected",reason:gi},ac())}finally{nn.p=un,bn!==null&&qn.types!==null&&(bn.types=qn.types),Zt.T=bn}}function K0(){}function ef(Dt,Bt,$t,Yt){if(Dt.tag!==5)throw Error(vt(476));var an=Nh(Dt).queue;kh(Dt,an,Bt,rn,$t===null?K0:function(){return zh(Dt),$t(Yt)})}function Nh(Dt){var Bt=Dt.memoizedState;if(Bt!==null)return Bt;Bt={memoizedState:rn,baseState:rn,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dc,lastRenderedState:rn},next:null};var $t={};return Bt.next={memoizedState:$t,baseState:$t,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dc,lastRenderedState:$t},next:null},Dt.memoizedState=Bt,Dt=Dt.alternate,Dt!==null&&(Dt.memoizedState=Bt),Bt}function zh(Dt){var Bt=Nh(Dt);Bt.next===null&&(Bt=Dt.alternate.memoizedState),Fu(Dt,Bt.next.queue,{},ac())}function tf(){return co(ju)}function Uh(){return Ha().memoizedState}function $h(){return Ha().memoizedState}function Z0(Dt){for(var Bt=Dt.return;Bt!==null;){switch(Bt.tag){case 24:case 3:var $t=ac();Dt=Js($t);var Yt=Gr(Bt,Dt,$t);Yt!==null&&(Kl(Yt,Bt,$t),Ti(Yt,Bt,$t)),Bt={cache:tc()},Dt.payload=Bt;return}Bt=Bt.return}}function Q0(Dt,Bt,$t){var Yt=ac();$t={lane:Yt,revertLane:0,gesture:null,action:$t,hasEagerState:!1,eagerState:null,next:null},rd(Dt)?Hh(Bt,$t):($t=Pi(Dt,Bt,$t,Yt),$t!==null&&(Kl($t,Dt,Yt),Wh($t,Bt,Yt)))}function jh(Dt,Bt,$t){var Yt=ac();Fu(Dt,Bt,$t,Yt)}function Fu(Dt,Bt,$t,Yt){var an={lane:Yt,revertLane:0,gesture:null,action:$t,hasEagerState:!1,eagerState:null,next:null};if(rd(Dt))Hh(Bt,an);else{var un=Dt.alternate;if(Dt.lanes===0&&(un===null||un.lanes===0)&&(un=Bt.lastRenderedReducer,un!==null))try{var bn=Bt.lastRenderedState,qn=un(bn,$t);if(an.hasEagerState=!0,an.eagerState=qn,Ys(qn,bn))return Hi(Dt,Bt,an,0),Jo===null&&Di(),!1}catch{}if($t=Pi(Dt,Bt,an,Yt),$t!==null)return Kl($t,Dt,Yt),Wh($t,Bt,Yt),!0}return!1}function nf(Dt,Bt,$t,Yt){if(Yt={lane:2,revertLane:Pf(),gesture:null,action:Yt,hasEagerState:!1,eagerState:null,next:null},rd(Dt)){if(Bt)throw Error(vt(479))}else Bt=Pi(Dt,$t,Yt,2),Bt!==null&&Kl(Bt,Dt,2)}function rd(Dt){var Bt=Dt.alternate;return Dt===Us||Bt!==null&&Bt===Us}function Hh(Dt,Bt){lu=Ku=!0;var $t=Dt.pending;$t===null?Bt.next=Bt:(Bt.next=$t.next,$t.next=Bt),Dt.pending=Bt}function Wh(Dt,Bt,$t){if(($t&4194048)!==0){var Yt=Bt.lanes;Yt&=Dt.pendingLanes,$t|=Yt,Bt.lanes=$t,Bi(Dt,$t)}}var wu={readContext:co,use:Ju,useCallback:ka,useContext:ka,useEffect:ka,useImperativeHandle:ka,useLayoutEffect:ka,useInsertionEffect:ka,useMemo:ka,useReducer:ka,useRef:ka,useState:ka,useDebugValue:ka,useDeferredValue:ka,useTransition:ka,useSyncExternalStore:ka,useId:ka,useHostTransitionStatus:ka,useFormState:ka,useActionState:ka,useOptimistic:ka,useMemoCache:ka,useCacheRefresh:ka};wu.useEffectEvent=ka;var Vh={readContext:co,use:Ju,useCallback:function(Dt,Bt){return Ul().memoizedState=[Dt,Bt===void 0?null:Bt],Dt},useContext:co,useEffect:Dh,useImperativeHandle:function(Dt,Bt,$t){$t=$t!=null?$t.concat([Dt]):null,td(4194308,4,Mh.bind(null,Bt,Dt),$t)},useLayoutEffect:function(Dt,Bt){return td(4194308,4,Dt,Bt)},useInsertionEffect:function(Dt,Bt){td(4,2,Dt,Bt)},useMemo:function(Dt,Bt){var $t=Ul();Bt=Bt===void 0?null:Bt;var Yt=Dt();if(nu){wn(!0);try{Dt()}finally{wn(!1)}}return $t.memoizedState=[Yt,Bt],Yt},useReducer:function(Dt,Bt,$t){var Yt=Ul();if($t!==void 0){var an=$t(Bt);if(nu){wn(!0);try{$t(Bt)}finally{wn(!1)}}}else an=Bt;return Yt.memoizedState=Yt.baseState=an,Dt={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dt,lastRenderedState:an},Yt.queue=Dt,Dt=Dt.dispatch=Q0.bind(null,Us,Dt),[Yt.memoizedState,Dt]},useRef:function(Dt){var Bt=Ul();return Dt={current:Dt},Bt.memoizedState=Dt},useState:function(Dt){Dt=Xd(Dt);var Bt=Dt.queue,$t=jh.bind(null,Us,Bt);return Bt.dispatch=$t,[Dt.memoizedState,$t]},useDebugValue:Qd,useDeferredValue:function(Dt,Bt){var $t=Ul();return Jd($t,Dt,Bt)},useTransition:function(){var Dt=Xd(!1);return Dt=kh.bind(null,Us,Dt.queue,!0,!1),Ul().memoizedState=Dt,[!1,Dt]},useSyncExternalStore:function(Dt,Bt,$t){var Yt=Us,an=Ul();if(Fn){if($t===void 0)throw Error(vt(407));$t=$t()}else{if($t=Bt(),Jo===null)throw Error(vt(349));(oo&127)!==0||fh(Yt,Bt,$t)}an.memoizedState=$t;var un={value:$t,getSnapshot:Bt};return an.queue=un,Dh(ph.bind(null,Yt,un,Dt),[Dt]),Yt.flags|=2048,uu(9,{destroy:void 0},hh.bind(null,Yt,un,$t,Bt),null),$t},useId:function(){var Dt=Ul(),Bt=Jo.identifierPrefix;if(Fn){var $t=pl,Yt=hl;$t=(Yt&~(1<<32-Xn(Yt)-1)).toString(32)+$t,Bt="_"+Bt+"R_"+$t,$t=Zu++,0<$t&&(Bt+="H"+$t.toString(32)),Bt+="_"}else $t=V0++,Bt="_"+Bt+"r_"+$t.toString(32)+"_";return Dt.memoizedState=Bt},useHostTransitionStatus:tf,useFormState:Ah,useActionState:Ah,useOptimistic:function(Dt){var Bt=Ul();Bt.memoizedState=Bt.baseState=Dt;var $t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return Bt.queue=$t,Bt=nf.bind(null,Us,!0,$t),$t.dispatch=Bt,[Dt,Bt]},useMemoCache:Gd,useCacheRefresh:function(){return Ul().memoizedState=Z0.bind(null,Us)},useEffectEvent:function(Dt){var Bt=Ul(),$t={impl:Dt};return Bt.memoizedState=$t,function(){if((So&2)!==0)throw Error(vt(440));return $t.impl.apply(void 0,arguments)}}},rf={readContext:co,use:Ju,useCallback:Oh,useContext:co,useEffect:Zd,useImperativeHandle:Ih,useInsertionEffect:Rh,useLayoutEffect:Bh,useMemo:Ph,useReducer:ed,useRef:Sh,useState:function(){return ed(Dc)},useDebugValue:Qd,useDeferredValue:function(Dt,Bt){var $t=Ha();return Lh($t,Wo.memoizedState,Dt,Bt)},useTransition:function(){var Dt=ed(Dc)[0],Bt=Ha().memoizedState;return[typeof Dt=="boolean"?Dt:Cu(Dt),Bt]},useSyncExternalStore:dh,useId:Uh,useHostTransitionStatus:tf,useFormState:Ch,useActionState:Ch,useOptimistic:function(Dt,Bt){var $t=Ha();return Eh($t,Wo,Dt,Bt)},useMemoCache:Gd,useCacheRefresh:$h};rf.useEffectEvent=Th;var Gh={readContext:co,use:Ju,useCallback:Oh,useContext:co,useEffect:Zd,useImperativeHandle:Ih,useInsertionEffect:Rh,useLayoutEffect:Bh,useMemo:Ph,useReducer:Yd,useRef:Sh,useState:function(){return Yd(Dc)},useDebugValue:Qd,useDeferredValue:function(Dt,Bt){var $t=Ha();return Wo===null?Jd($t,Dt,Bt):Lh($t,Wo.memoizedState,Dt,Bt)},useTransition:function(){var Dt=Yd(Dc)[0],Bt=Ha().memoizedState;return[typeof Dt=="boolean"?Dt:Cu(Dt),Bt]},useSyncExternalStore:dh,useId:Uh,useHostTransitionStatus:tf,useFormState:wh,useActionState:wh,useOptimistic:function(Dt,Bt){var $t=Ha();return Wo!==null?Eh($t,Wo,Dt,Bt):($t.baseState=Dt,[Dt,$t.queue.dispatch])},useMemoCache:Gd,useCacheRefresh:$h};Gh.useEffectEvent=Th;function sf(Dt,Bt,$t,Yt){Bt=Dt.memoizedState,$t=$t(Yt,Bt),$t=$t==null?Bt:Rt({},Bt,$t),Dt.memoizedState=$t,Dt.lanes===0&&(Dt.updateQueue.baseState=$t)}var of={enqueueSetState:function(Dt,Bt,$t){Dt=Dt._reactInternals;var Yt=ac(),an=Js(Yt);an.payload=Bt,$t!=null&&(an.callback=$t),Bt=Gr(Dt,an,Yt),Bt!==null&&(Kl(Bt,Dt,Yt),Ti(Bt,Dt,Yt))},enqueueReplaceState:function(Dt,Bt,$t){Dt=Dt._reactInternals;var Yt=ac(),an=Js(Yt);an.tag=1,an.payload=Bt,$t!=null&&(an.callback=$t),Bt=Gr(Dt,an,Yt),Bt!==null&&(Kl(Bt,Dt,Yt),Ti(Bt,Dt,Yt))},enqueueForceUpdate:function(Dt,Bt){Dt=Dt._reactInternals;var $t=ac(),Yt=Js($t);Yt.tag=2,Bt!=null&&(Yt.callback=Bt),Bt=Gr(Dt,Yt,$t),Bt!==null&&(Kl(Bt,Dt,$t),Ti(Bt,Dt,$t))}};function qh(Dt,Bt,$t,Yt,an,un,bn){return Dt=Dt.stateNode,typeof Dt.shouldComponentUpdate=="function"?Dt.shouldComponentUpdate(Yt,un,bn):Bt.prototype&&Bt.prototype.isPureReactComponent?!va($t,Yt)||!va(an,un):!0}function Yh(Dt,Bt,$t,Yt){Dt=Bt.state,typeof Bt.componentWillReceiveProps=="function"&&Bt.componentWillReceiveProps($t,Yt),typeof Bt.UNSAFE_componentWillReceiveProps=="function"&&Bt.UNSAFE_componentWillReceiveProps($t,Yt),Bt.state!==Dt&&of.enqueueReplaceState(Bt,Bt.state,null)}function ru(Dt,Bt){var $t=Bt;if("ref"in Bt){$t={};for(var Yt in Bt)Yt!=="ref"&&($t[Yt]=Bt[Yt])}if(Dt=Dt.defaultProps){$t===Bt&&($t=Rt({},$t));for(var an in Dt)$t[an]===void 0&&($t[an]=Dt[an])}return $t}function Xh(Dt){qr(Dt)}function Kh(Dt){console.error(Dt)}function Zh(Dt){qr(Dt)}function id(Dt,Bt){try{var $t=Dt.onUncaughtError;$t(Bt.value,{componentStack:Bt.stack})}catch(Yt){setTimeout(function(){throw Yt})}}function Qh(Dt,Bt,$t){try{var Yt=Dt.onCaughtError;Yt($t.value,{componentStack:$t.stack,errorBoundary:Bt.tag===1?Bt.stateNode:null})}catch(an){setTimeout(function(){throw an})}}function af(Dt,Bt,$t){return $t=Js($t),$t.tag=3,$t.payload={element:null},$t.callback=function(){id(Dt,Bt)},$t}function Jh(Dt){return Dt=Js(Dt),Dt.tag=3,Dt}function ep(Dt,Bt,$t,Yt){var an=$t.type.getDerivedStateFromError;if(typeof an=="function"){var un=Yt.value;Dt.payload=function(){return an(un)},Dt.callback=function(){Qh(Bt,$t,Yt)}}var bn=$t.stateNode;bn!==null&&typeof bn.componentDidCatch=="function"&&(Dt.callback=function(){Qh(Bt,$t,Yt),typeof an!="function"&&(Wc===null?Wc=new Set([this]):Wc.add(this));var qn=Yt.stack;this.componentDidCatch(Yt.value,{componentStack:qn!==null?qn:""})})}function J0(Dt,Bt,$t,Yt,an){if($t.flags|=32768,Yt!==null&&typeof Yt=="object"&&typeof Yt.then=="function"){if(Bt=$t.alternate,Bt!==null&&Zo(Bt,$t,an,!0),$t=rc.current,$t!==null){switch($t.tag){case 31:case 13:return pc===null?md():$t.alternate===null&&Na===0&&(Na=3),$t.flags&=-257,$t.flags|=65536,$t.lanes=an,Yt===ei?$t.flags|=16384:(Bt=$t.updateQueue,Bt===null?$t.updateQueue=new Set([Yt]):Bt.add(Yt),Mf(Dt,Yt,an)),!1;case 22:return $t.flags|=65536,Yt===ei?$t.flags|=16384:(Bt=$t.updateQueue,Bt===null?(Bt={transitions:null,markerInstances:null,retryQueue:new Set([Yt])},$t.updateQueue=Bt):($t=Bt.retryQueue,$t===null?Bt.retryQueue=new Set([Yt]):$t.add(Yt)),Mf(Dt,Yt,an)),!1}throw Error(vt(435,$t.tag))}return Mf(Dt,Yt,an),md(),!1}if(Fn)return Bt=rc.current,Bt!==null?((Bt.flags&65536)===0&&(Bt.flags|=256),Bt.flags|=65536,Bt.lanes=an,Yt!==er&&(Dt=Error(vt(422),{cause:Yt}),Ri(Xo(Dt,$t)))):(Yt!==er&&(Bt=Error(vt(423),{cause:Yt}),Ri(Xo(Bt,$t))),Dt=Dt.current.alternate,Dt.flags|=65536,an&=-an,Dt.lanes|=an,Yt=Xo(Yt,$t),an=af(Dt.stateNode,Yt,an),rs(Dt,an),Na!==4&&(Na=2)),!1;var un=Error(vt(520),{cause:Yt});if(un=Xo(un,$t),Ou===null?Ou=[un]:Ou.push(un),Na!==4&&(Na=2),Bt===null)return!0;Yt=Xo(Yt,$t),$t=Bt;do{switch($t.tag){case 3:return $t.flags|=65536,Dt=an&-an,$t.lanes|=Dt,Dt=af($t.stateNode,Yt,Dt),rs($t,Dt),!1;case 1:if(Bt=$t.type,un=$t.stateNode,($t.flags&128)===0&&(typeof Bt.getDerivedStateFromError=="function"||un!==null&&typeof un.componentDidCatch=="function"&&(Wc===null||!Wc.has(un))))return $t.flags|=65536,an&=-an,$t.lanes|=an,an=Jh(an),ep(an,Dt,$t,Yt),rs($t,an),!1}$t=$t.return}while($t!==null);return!1}var lf=Error(vt(461)),Za=!1;function bl(Dt,Bt,$t,Yt){Bt.child=Dt===null?Oi(Bt,null,$t,Yt):Ss(Bt,Dt.child,$t,Yt)}function tp(Dt,Bt,$t,Yt,an){$t=$t.render;var un=Bt.ref;if("ref"in Yt){var bn={};for(var qn in Yt)qn!=="ref"&&(bn[qn]=Yt[qn])}else bn=Yt;return ha(Bt),Yt=jd(Dt,Bt,$t,bn,un,an),qn=Hd(),Dt!==null&&!Za?(Wd(Dt,Bt,an),Tc(Dt,Bt,an)):(Fn&&qn&&zn(Bt),Bt.flags|=1,bl(Dt,Bt,Yt,an),Bt.child)}function np(Dt,Bt,$t,Yt,an){if(Dt===null){var un=$t.type;return typeof un=="function"&&!fa(un)&&un.defaultProps===void 0&&$t.compare===null?(Bt.tag=15,Bt.type=un,rp(Dt,Bt,un,Yt,an)):(Dt=Ia($t.type,null,Yt,Bt,Bt.mode,an),Dt.ref=Bt.ref,Dt.return=Bt,Bt.child=Dt)}if(un=Dt.child,!mf(Dt,an)){var bn=un.memoizedProps;if($t=$t.compare,$t=$t!==null?$t:va,$t(bn,Yt)&&Dt.ref===Bt.ref)return Tc(Dt,Bt,an)}return Bt.flags|=1,Dt=ra(un,Yt),Dt.ref=Bt.ref,Dt.return=Bt,Bt.child=Dt}function rp(Dt,Bt,$t,Yt,an){if(Dt!==null){var un=Dt.memoizedProps;if(va(un,Yt)&&Dt.ref===Bt.ref)if(Za=!1,Bt.pendingProps=Yt=un,mf(Dt,an))(Dt.flags&131072)!==0&&(Za=!0);else return Bt.lanes=Dt.lanes,Tc(Dt,Bt,an)}return cf(Dt,Bt,$t,Yt,an)}function ip(Dt,Bt,$t,Yt){var an=Yt.children,un=Dt!==null?Dt.memoizedState:null;if(Dt===null&&Bt.stateNode===null&&(Bt.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),Yt.mode==="hidden"){if((Bt.flags&128)!==0){if(un=un!==null?un.baseLanes|$t:$t,Dt!==null){for(Yt=Bt.child=Dt.child,an=0;Yt!==null;)an=an|Yt.lanes|Yt.childLanes,Yt=Yt.sibling;Yt=an&~un}else Yt=0,Bt.child=null;return sp(Dt,Bt,un,$t,Yt)}if(($t&536870912)!==0)Bt.memoizedState={baseLanes:0,cachePool:null},Dt!==null&&Sn(Bt,un!==null?un.cachePool:null),un!==null?Yu(Bt,un):au(),lh(Bt);else return Yt=Bt.lanes=536870912,sp(Dt,Bt,un!==null?un.baseLanes|$t:$t,$t,Yt)}else un!==null?(Sn(Bt,un.cachePool),Yu(Bt,un),Uc(),Bt.memoizedState=null):(Dt!==null&&Sn(Bt,null),au(),Uc());return bl(Dt,Bt,an,$t),Bt.child}function Su(Dt,Bt){return Dt!==null&&Dt.tag===22||Bt.stateNode!==null||(Bt.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),Bt.sibling}function sp(Dt,Bt,$t,Yt,an){var un=en();return un=un===null?null:{parent:Eo._currentValue,pool:un},Bt.memoizedState={baseLanes:$t,cachePool:un},Dt!==null&&Sn(Bt,null),au(),lh(Bt),Dt!==null&&Zo(Dt,Bt,Yt,!0),Bt.childLanes=an,null}function sd(Dt,Bt){return Bt=ad({mode:Bt.mode,children:Bt.children},Dt.mode),Bt.ref=Dt.ref,Dt.child=Bt,Bt.return=Dt,Bt}function op(Dt,Bt,$t){return Ss(Bt,Dt.child,null,$t),Dt=sd(Bt,Bt.pendingProps),Dt.flags|=2,ic(Bt),Bt.memoizedState=null,Dt}function eg(Dt,Bt,$t){var Yt=Bt.pendingProps,an=(Bt.flags&128)!==0;if(Bt.flags&=-129,Dt===null){if(Fn){if(Yt.mode==="hidden")return Dt=sd(Bt,Yt),Bt.lanes=536870912,Su(null,Dt);if(Ud(Bt),(Dt=Hr)?(Dt=y0(Dt,Gn),Dt=Dt!==null&&Dt.data==="&"?Dt:null,Dt!==null&&(Bt.memoizedState={dehydrated:Dt,treeContext:fl!==null?{id:hl,overflow:pl}:null,retryLane:536870912,hydrationErrors:null},$t=Ua(Dt),$t.return=Bt,Bt.child=$t,Nr=Bt,Hr=null)):Dt=null,Dt===null)throw Er(Bt);return Bt.lanes=536870912,null}return sd(Bt,Yt)}var un=Dt.memoizedState;if(un!==null){var bn=un.dehydrated;if(Ud(Bt),an)if(Bt.flags&256)Bt.flags&=-257,Bt=op(Dt,Bt,$t);else if(Bt.memoizedState!==null)Bt.child=Dt.child,Bt.flags|=128,Bt=null;else throw Error(vt(558));else if(Za||Zo(Dt,Bt,$t,!1),an=($t&Dt.childLanes)!==0,Za||an){if(Yt=Jo,Yt!==null&&(bn=as(Yt,$t),bn!==0&&bn!==un.retryLane))throw un.retryLane=bn,Qi(Dt,bn),Kl(Yt,Dt,bn),lf;md(),Bt=op(Dt,Bt,$t)}else Dt=un.treeContext,Hr=gc(bn.nextSibling),Nr=Bt,Fn=!0,Ln=null,Gn=!1,Dt!==null&&Br(Bt,Dt),Bt=sd(Bt,Yt),Bt.flags|=4096;return Bt}return Dt=ra(Dt.child,{mode:Yt.mode,children:Yt.children}),Dt.ref=Bt.ref,Bt.child=Dt,Dt.return=Bt,Dt}function od(Dt,Bt){var $t=Bt.ref;if($t===null)Dt!==null&&Dt.ref!==null&&(Bt.flags|=4194816);else{if(typeof $t!="function"&&typeof $t!="object")throw Error(vt(284));(Dt===null||Dt.ref!==$t)&&(Bt.flags|=4194816)}}function cf(Dt,Bt,$t,Yt,an){return ha(Bt),$t=jd(Dt,Bt,$t,Yt,void 0,an),Yt=Hd(),Dt!==null&&!Za?(Wd(Dt,Bt,an),Tc(Dt,Bt,an)):(Fn&&Yt&&zn(Bt),Bt.flags|=1,bl(Dt,Bt,$t,an),Bt.child)}function ap(Dt,Bt,$t,Yt,an,un){return ha(Bt),Bt.updateQueue=null,$t=uh(Bt,Yt,$t,an),ch(Dt),Yt=Hd(),Dt!==null&&!Za?(Wd(Dt,Bt,un),Tc(Dt,Bt,un)):(Fn&&Yt&&zn(Bt),Bt.flags|=1,bl(Dt,Bt,$t,un),Bt.child)}function lp(Dt,Bt,$t,Yt,an){if(ha(Bt),Bt.stateNode===null){var un=Ai,bn=$t.contextType;typeof bn=="object"&&bn!==null&&(un=co(bn)),un=new $t(Yt,un),Bt.memoizedState=un.state!==null&&un.state!==void 0?un.state:null,un.updater=of,Bt.stateNode=un,un._reactInternals=Bt,un=Bt.stateNode,un.props=Yt,un.state=Bt.memoizedState,un.refs={},pa(Bt),bn=$t.contextType,un.context=typeof bn=="object"&&bn!==null?co(bn):Ai,un.state=Bt.memoizedState,bn=$t.getDerivedStateFromProps,typeof bn=="function"&&(sf(Bt,$t,bn,Yt),un.state=Bt.memoizedState),typeof $t.getDerivedStateFromProps=="function"||typeof un.getSnapshotBeforeUpdate=="function"||typeof un.UNSAFE_componentWillMount!="function"&&typeof un.componentWillMount!="function"||(bn=un.state,typeof un.componentWillMount=="function"&&un.componentWillMount(),typeof un.UNSAFE_componentWillMount=="function"&&un.UNSAFE_componentWillMount(),bn!==un.state&&of.enqueueReplaceState(un,un.state,null),Bo(Bt,Yt,un,an),yo(),un.state=Bt.memoizedState),typeof un.componentDidMount=="function"&&(Bt.flags|=4194308),Yt=!0}else if(Dt===null){un=Bt.stateNode;var qn=Bt.memoizedProps,Sr=ru($t,qn);un.props=Sr;var Jr=un.context,ui=$t.contextType;bn=Ai,typeof ui=="object"&&ui!==null&&(bn=co(ui));var gi=$t.getDerivedStateFromProps;ui=typeof gi=="function"||typeof un.getSnapshotBeforeUpdate=="function",qn=Bt.pendingProps!==qn,ui||typeof un.UNSAFE_componentWillReceiveProps!="function"&&typeof un.componentWillReceiveProps!="function"||(qn||Jr!==bn)&&Yh(Bt,un,Yt,bn),zs=!1;var ni=Bt.memoizedState;un.state=ni,Bo(Bt,Yt,un,an),yo(),Jr=Bt.memoizedState,qn||ni!==Jr||zs?(typeof gi=="function"&&(sf(Bt,$t,gi,Yt),Jr=Bt.memoizedState),(Sr=zs||qh(Bt,$t,Sr,Yt,ni,Jr,bn))?(ui||typeof un.UNSAFE_componentWillMount!="function"&&typeof un.componentWillMount!="function"||(typeof un.componentWillMount=="function"&&un.componentWillMount(),typeof un.UNSAFE_componentWillMount=="function"&&un.UNSAFE_componentWillMount()),typeof un.componentDidMount=="function"&&(Bt.flags|=4194308)):(typeof un.componentDidMount=="function"&&(Bt.flags|=4194308),Bt.memoizedProps=Yt,Bt.memoizedState=Jr),un.props=Yt,un.state=Jr,un.context=bn,Yt=Sr):(typeof un.componentDidMount=="function"&&(Bt.flags|=4194308),Yt=!1)}else{un=Bt.stateNode,ds(Dt,Bt),bn=Bt.memoizedProps,ui=ru($t,bn),un.props=ui,gi=Bt.pendingProps,ni=un.context,Jr=$t.contextType,Sr=Ai,typeof Jr=="object"&&Jr!==null&&(Sr=co(Jr)),qn=$t.getDerivedStateFromProps,(Jr=typeof qn=="function"||typeof un.getSnapshotBeforeUpdate=="function")||typeof un.UNSAFE_componentWillReceiveProps!="function"&&typeof un.componentWillReceiveProps!="function"||(bn!==gi||ni!==Sr)&&Yh(Bt,un,Yt,Sr),zs=!1,ni=Bt.memoizedState,un.state=ni,Bo(Bt,Yt,un,an),yo();var oi=Bt.memoizedState;bn!==gi||ni!==oi||zs||Dt!==null&&Dt.dependencies!==null&&Qo(Dt.dependencies)?(typeof qn=="function"&&(sf(Bt,$t,qn,Yt),oi=Bt.memoizedState),(ui=zs||qh(Bt,$t,ui,Yt,ni,oi,Sr)||Dt!==null&&Dt.dependencies!==null&&Qo(Dt.dependencies))?(Jr||typeof un.UNSAFE_componentWillUpdate!="function"&&typeof un.componentWillUpdate!="function"||(typeof un.componentWillUpdate=="function"&&un.componentWillUpdate(Yt,oi,Sr),typeof un.UNSAFE_componentWillUpdate=="function"&&un.UNSAFE_componentWillUpdate(Yt,oi,Sr)),typeof un.componentDidUpdate=="function"&&(Bt.flags|=4),typeof un.getSnapshotBeforeUpdate=="function"&&(Bt.flags|=1024)):(typeof un.componentDidUpdate!="function"||bn===Dt.memoizedProps&&ni===Dt.memoizedState||(Bt.flags|=4),typeof un.getSnapshotBeforeUpdate!="function"||bn===Dt.memoizedProps&&ni===Dt.memoizedState||(Bt.flags|=1024),Bt.memoizedProps=Yt,Bt.memoizedState=oi),un.props=Yt,un.state=oi,un.context=Sr,Yt=ui):(typeof un.componentDidUpdate!="function"||bn===Dt.memoizedProps&&ni===Dt.memoizedState||(Bt.flags|=4),typeof un.getSnapshotBeforeUpdate!="function"||bn===Dt.memoizedProps&&ni===Dt.memoizedState||(Bt.flags|=1024),Yt=!1)}return un=Yt,od(Dt,Bt),Yt=(Bt.flags&128)!==0,un||Yt?(un=Bt.stateNode,$t=Yt&&typeof $t.getDerivedStateFromError!="function"?null:un.render(),Bt.flags|=1,Dt!==null&&Yt?(Bt.child=Ss(Bt,Dt.child,null,an),Bt.child=Ss(Bt,null,$t,an)):bl(Dt,Bt,$t,an),Bt.memoizedState=un.state,Dt=Bt.child):Dt=Tc(Dt,Bt,an),Dt}function cp(Dt,Bt,$t,Yt){return li(),Bt.flags|=256,bl(Dt,Bt,$t,Yt),Bt.child}var uf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function df(Dt){return{baseLanes:Dt,cachePool:dn()}}function ff(Dt,Bt,$t){return Dt=Dt!==null?Dt.childLanes&~$t:0,Bt&&(Dt|=oc),Dt}function up(Dt,Bt,$t){var Yt=Bt.pendingProps,an=!1,un=(Bt.flags&128)!==0,bn;if((bn=un)||(bn=Dt!==null&&Dt.memoizedState===null?!1:(ja.current&2)!==0),bn&&(an=!0,Bt.flags&=-129),bn=(Bt.flags&32)!==0,Bt.flags&=-33,Dt===null){if(Fn){if(an?zc(Bt):Uc(),(Dt=Hr)?(Dt=y0(Dt,Gn),Dt=Dt!==null&&Dt.data!=="&"?Dt:null,Dt!==null&&(Bt.memoizedState={dehydrated:Dt,treeContext:fl!==null?{id:hl,overflow:pl}:null,retryLane:536870912,hydrationErrors:null},$t=Ua(Dt),$t.return=Bt,Bt.child=$t,Nr=Bt,Hr=null)):Dt=null,Dt===null)throw Er(Bt);return Yf(Dt)?Bt.lanes=32:Bt.lanes=536870912,null}var qn=Yt.children;return Yt=Yt.fallback,an?(Uc(),an=Bt.mode,qn=ad({mode:"hidden",children:qn},an),Yt=ba(Yt,an,$t,null),qn.return=Bt,Yt.return=Bt,qn.sibling=Yt,Bt.child=qn,Yt=Bt.child,Yt.memoizedState=df($t),Yt.childLanes=ff(Dt,bn,$t),Bt.memoizedState=uf,Su(null,Yt)):(zc(Bt),hf(Bt,qn))}var Sr=Dt.memoizedState;if(Sr!==null&&(qn=Sr.dehydrated,qn!==null)){if(un)Bt.flags&256?(zc(Bt),Bt.flags&=-257,Bt=pf(Dt,Bt,$t)):Bt.memoizedState!==null?(Uc(),Bt.child=Dt.child,Bt.flags|=128,Bt=null):(Uc(),qn=Yt.fallback,an=Bt.mode,Yt=ad({mode:"visible",children:Yt.children},an),qn=ba(qn,an,$t,null),qn.flags|=2,Yt.return=Bt,qn.return=Bt,Yt.sibling=qn,Bt.child=Yt,Ss(Bt,Dt.child,null,$t),Yt=Bt.child,Yt.memoizedState=df($t),Yt.childLanes=ff(Dt,bn,$t),Bt.memoizedState=uf,Bt=Su(null,Yt));else if(zc(Bt),Yf(qn)){if(bn=qn.nextSibling&&qn.nextSibling.dataset,bn)var Jr=bn.dgst;bn=Jr,Yt=Error(vt(419)),Yt.stack="",Yt.digest=bn,Ri({value:Yt,source:null,stack:null}),Bt=pf(Dt,Bt,$t)}else if(Za||Zo(Dt,Bt,$t,!1),bn=($t&Dt.childLanes)!==0,Za||bn){if(bn=Jo,bn!==null&&(Yt=as(bn,$t),Yt!==0&&Yt!==Sr.retryLane))throw Sr.retryLane=Yt,Qi(Dt,Yt),Kl(bn,Dt,Yt),lf;qf(qn)||md(),Bt=pf(Dt,Bt,$t)}else qf(qn)?(Bt.flags|=192,Bt.child=Dt.child,Bt=null):(Dt=Sr.treeContext,Hr=gc(qn.nextSibling),Nr=Bt,Fn=!0,Ln=null,Gn=!1,Dt!==null&&Br(Bt,Dt),Bt=hf(Bt,Yt.children),Bt.flags|=4096);return Bt}return an?(Uc(),qn=Yt.fallback,an=Bt.mode,Sr=Dt.child,Jr=Sr.sibling,Yt=ra(Sr,{mode:"hidden",children:Yt.children}),Yt.subtreeFlags=Sr.subtreeFlags&65011712,Jr!==null?qn=ra(Jr,qn):(qn=ba(qn,an,$t,null),qn.flags|=2),qn.return=Bt,Yt.return=Bt,Yt.sibling=qn,Bt.child=Yt,Su(null,Yt),Yt=Bt.child,qn=Dt.child.memoizedState,qn===null?qn=df($t):(an=qn.cachePool,an!==null?(Sr=Eo._currentValue,an=an.parent!==Sr?{parent:Sr,pool:Sr}:an):an=dn(),qn={baseLanes:qn.baseLanes|$t,cachePool:an}),Yt.memoizedState=qn,Yt.childLanes=ff(Dt,bn,$t),Bt.memoizedState=uf,Su(Dt.child,Yt)):(zc(Bt),$t=Dt.child,Dt=$t.sibling,$t=ra($t,{mode:"visible",children:Yt.children}),$t.return=Bt,$t.sibling=null,Dt!==null&&(bn=Bt.deletions,bn===null?(Bt.deletions=[Dt],Bt.flags|=16):bn.push(Dt)),Bt.child=$t,Bt.memoizedState=null,$t)}function hf(Dt,Bt){return Bt=ad({mode:"visible",children:Bt},Dt.mode),Bt.return=Dt,Dt.child=Bt}function ad(Dt,Bt){return Dt=Ks(22,Dt,null,Bt),Dt.lanes=0,Dt}function pf(Dt,Bt,$t){return Ss(Bt,Dt.child,null,$t),Dt=hf(Bt,Bt.pendingProps.children),Dt.flags|=2,Bt.memoizedState=null,Dt}function dp(Dt,Bt,$t){Dt.lanes|=Bt;var Yt=Dt.alternate;Yt!==null&&(Yt.lanes|=Bt),Ms(Dt.return,Bt,$t)}function gf(Dt,Bt,$t,Yt,an,un){var bn=Dt.memoizedState;bn===null?Dt.memoizedState={isBackwards:Bt,rendering:null,renderingStartTime:0,last:Yt,tail:$t,tailMode:an,treeForkCount:un}:(bn.isBackwards=Bt,bn.rendering=null,bn.renderingStartTime=0,bn.last=Yt,bn.tail=$t,bn.tailMode=an,bn.treeForkCount=un)}function fp(Dt,Bt,$t){var Yt=Bt.pendingProps,an=Yt.revealOrder,un=Yt.tail;Yt=Yt.children;var bn=ja.current,qn=(bn&2)!==0;if(qn?(bn=bn&1|2,Bt.flags|=128):bn&=1,pn(ja,bn),bl(Dt,Bt,Yt,$t),Yt=Fn?Ol:0,!qn&&Dt!==null&&(Dt.flags&128)!==0)e:for(Dt=Bt.child;Dt!==null;){if(Dt.tag===13)Dt.memoizedState!==null&&dp(Dt,$t,Bt);else if(Dt.tag===19)dp(Dt,$t,Bt);else if(Dt.child!==null){Dt.child.return=Dt,Dt=Dt.child;continue}if(Dt===Bt)break e;for(;Dt.sibling===null;){if(Dt.return===null||Dt.return===Bt)break e;Dt=Dt.return}Dt.sibling.return=Dt.return,Dt=Dt.sibling}switch(an){case"forwards":for($t=Bt.child,an=null;$t!==null;)Dt=$t.alternate,Dt!==null&&Xu(Dt)===null&&(an=$t),$t=$t.sibling;$t=an,$t===null?(an=Bt.child,Bt.child=null):(an=$t.sibling,$t.sibling=null),gf(Bt,!1,an,$t,un,Yt);break;case"backwards":case"unstable_legacy-backwards":for($t=null,an=Bt.child,Bt.child=null;an!==null;){if(Dt=an.alternate,Dt!==null&&Xu(Dt)===null){Bt.child=an;break}Dt=an.sibling,an.sibling=$t,$t=an,an=Dt}gf(Bt,!0,$t,null,un,Yt);break;case"together":gf(Bt,!1,null,null,void 0,Yt);break;default:Bt.memoizedState=null}return Bt.child}function Tc(Dt,Bt,$t){if(Dt!==null&&(Bt.dependencies=Dt.dependencies),Hc|=Bt.lanes,($t&Bt.childLanes)===0)if(Dt!==null){if(Zo(Dt,Bt,$t,!1),($t&Bt.childLanes)===0)return null}else return null;if(Dt!==null&&Bt.child!==Dt.child)throw Error(vt(153));if(Bt.child!==null){for(Dt=Bt.child,$t=ra(Dt,Dt.pendingProps),Bt.child=$t,$t.return=Bt;Dt.sibling!==null;)Dt=Dt.sibling,$t=$t.sibling=ra(Dt,Dt.pendingProps),$t.return=Bt;$t.sibling=null}return Bt.child}function mf(Dt,Bt){return(Dt.lanes&Bt)!==0?!0:(Dt=Dt.dependencies,!!(Dt!==null&&Qo(Dt)))}function tg(Dt,Bt,$t){switch(Bt.tag){case 3:Mn(Bt,Bt.stateNode.containerInfo),Ps(Bt,Eo,Dt.memoizedState.cache),li();break;case 27:case 5:Rn(Bt);break;case 4:Mn(Bt,Bt.stateNode.containerInfo);break;case 10:Ps(Bt,Bt.type,Bt.memoizedProps.value);break;case 31:if(Bt.memoizedState!==null)return Bt.flags|=128,Ud(Bt),null;break;case 13:var Yt=Bt.memoizedState;if(Yt!==null)return Yt.dehydrated!==null?(zc(Bt),Bt.flags|=128,null):($t&Bt.child.childLanes)!==0?up(Dt,Bt,$t):(zc(Bt),Dt=Tc(Dt,Bt,$t),Dt!==null?Dt.sibling:null);zc(Bt);break;case 19:var an=(Dt.flags&128)!==0;if(Yt=($t&Bt.childLanes)!==0,Yt||(Zo(Dt,Bt,$t,!1),Yt=($t&Bt.childLanes)!==0),an){if(Yt)return fp(Dt,Bt,$t);Bt.flags|=128}if(an=Bt.memoizedState,an!==null&&(an.rendering=null,an.tail=null,an.lastEffect=null),pn(ja,ja.current),Yt)break;return null;case 22:return Bt.lanes=0,ip(Dt,Bt,$t,Bt.pendingProps);case 24:Ps(Bt,Eo,Dt.memoizedState.cache)}return Tc(Dt,Bt,$t)}function hp(Dt,Bt,$t){if(Dt!==null)if(Dt.memoizedProps!==Bt.pendingProps)Za=!0;else{if(!mf(Dt,$t)&&(Bt.flags&128)===0)return Za=!1,tg(Dt,Bt,$t);Za=(Dt.flags&131072)!==0}else Za=!1,Fn&&(Bt.flags&1048576)!==0&&bc(Bt,Ol,Bt.index);switch(Bt.lanes=0,Bt.tag){case 16:e:{var Yt=Bt.pendingProps;if(Dt=Ir(Bt.elementType),Bt.type=Dt,typeof Dt=="function")fa(Dt)?(Yt=ru(Dt,Yt),Bt.tag=1,Bt=lp(null,Bt,Dt,Yt,$t)):(Bt.tag=0,Bt=cf(null,Bt,Dt,Yt,$t));else{if(Dt!=null){var an=Dt.$$typeof;if(an===jt){Bt.tag=11,Bt=tp(null,Bt,Dt,Yt,$t);break e}else if(an===Ht){Bt.tag=14,Bt=np(null,Bt,Dt,Yt,$t);break e}}throw Bt=tn(Dt)||Dt,Error(vt(306,Bt,""))}}return Bt;case 0:return cf(Dt,Bt,Bt.type,Bt.pendingProps,$t);case 1:return Yt=Bt.type,an=ru(Yt,Bt.pendingProps),lp(Dt,Bt,Yt,an,$t);case 3:e:{if(Mn(Bt,Bt.stateNode.containerInfo),Dt===null)throw Error(vt(387));Yt=Bt.pendingProps;var un=Bt.memoizedState;an=un.element,ds(Dt,Bt),Bo(Bt,Yt,null,$t);var bn=Bt.memoizedState;if(Yt=bn.cache,Ps(Bt,Eo,Yt),Yt!==un.cache&&fo(Bt,[Eo],$t,!0),yo(),Yt=bn.element,un.isDehydrated)if(un={element:Yt,isDehydrated:!1,cache:bn.cache},Bt.updateQueue.baseState=un,Bt.memoizedState=un,Bt.flags&256){Bt=cp(Dt,Bt,Yt,$t);break e}else if(Yt!==an){an=Xo(Error(vt(424)),Bt),Ri(an),Bt=cp(Dt,Bt,Yt,$t);break e}else for(Dt=Bt.stateNode.containerInfo,Dt.nodeType===9?Dt=Dt.body:Dt=Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt,Hr=gc(Dt.firstChild),Nr=Bt,Fn=!0,Ln=null,Gn=!0,$t=Oi(Bt,null,Yt,$t),Bt.child=$t;$t;)$t.flags=$t.flags&-3|4096,$t=$t.sibling;else{if(li(),Yt===an){Bt=Tc(Dt,Bt,$t);break e}bl(Dt,Bt,Yt,$t)}Bt=Bt.child}return Bt;case 26:return od(Dt,Bt),Dt===null?($t=C0(Bt.type,null,Bt.pendingProps,null))?Bt.memoizedState=$t:Fn||($t=Bt.type,Dt=Bt.pendingProps,Yt=Ad(yn.current).createElement($t),Yt[mi]=Bt,Yt[wi]=Dt,Al(Yt,$t,Dt),Ds(Yt),Bt.stateNode=Yt):Bt.memoizedState=C0(Bt.type,Dt.memoizedProps,Bt.pendingProps,Dt.memoizedState),null;case 27:return Rn(Bt),Dt===null&&Fn&&(Yt=Bt.stateNode=v0(Bt.type,Bt.pendingProps,yn.current),Nr=Bt,Gn=!0,an=Hr,Yc(Bt.type)?(Xf=an,Hr=gc(Yt.firstChild)):Hr=an),bl(Dt,Bt,Bt.pendingProps.children,$t),od(Dt,Bt),Dt===null&&(Bt.flags|=4194304),Bt.child;case 5:return Dt===null&&Fn&&((an=Yt=Hr)&&(Yt=Bg(Yt,Bt.type,Bt.pendingProps,Gn),Yt!==null?(Bt.stateNode=Yt,Nr=Bt,Hr=gc(Yt.firstChild),Gn=!1,an=!0):an=!1),an||Er(Bt)),Rn(Bt),an=Bt.type,un=Bt.pendingProps,bn=Dt!==null?Dt.memoizedProps:null,Yt=un.children,Wf(an,un)?Yt=null:bn!==null&&Wf(an,bn)&&(Bt.flags|=32),Bt.memoizedState!==null&&(an=jd(Dt,Bt,G0,null,null,$t),ju._currentValue=an),od(Dt,Bt),bl(Dt,Bt,Yt,$t),Bt.child;case 6:return Dt===null&&Fn&&((Dt=$t=Hr)&&($t=Mg($t,Bt.pendingProps,Gn),$t!==null?(Bt.stateNode=$t,Nr=Bt,Hr=null,Dt=!0):Dt=!1),Dt||Er(Bt)),null;case 13:return up(Dt,Bt,$t);case 4:return Mn(Bt,Bt.stateNode.containerInfo),Yt=Bt.pendingProps,Dt===null?Bt.child=Ss(Bt,null,Yt,$t):bl(Dt,Bt,Yt,$t),Bt.child;case 11:return tp(Dt,Bt,Bt.type,Bt.pendingProps,$t);case 7:return bl(Dt,Bt,Bt.pendingProps,$t),Bt.child;case 8:return bl(Dt,Bt,Bt.pendingProps.children,$t),Bt.child;case 12:return bl(Dt,Bt,Bt.pendingProps.children,$t),Bt.child;case 10:return Yt=Bt.pendingProps,Ps(Bt,Bt.type,Yt.value),bl(Dt,Bt,Yt.children,$t),Bt.child;case 9:return an=Bt.type._context,Yt=Bt.pendingProps.children,ha(Bt),an=co(an),Yt=Yt(an),Bt.flags|=1,bl(Dt,Bt,Yt,$t),Bt.child;case 14:return np(Dt,Bt,Bt.type,Bt.pendingProps,$t);case 15:return rp(Dt,Bt,Bt.type,Bt.pendingProps,$t);case 19:return fp(Dt,Bt,$t);case 31:return eg(Dt,Bt,$t);case 22:return ip(Dt,Bt,$t,Bt.pendingProps);case 24:return ha(Bt),Yt=co(Eo),Dt===null?(an=en(),an===null&&(an=Jo,un=tc(),an.pooledCache=un,un.refCount++,un!==null&&(an.pooledCacheLanes|=$t),an=un),Bt.memoizedState={parent:Yt,cache:an},pa(Bt),Ps(Bt,Eo,an)):((Dt.lanes&$t)!==0&&(ds(Dt,Bt),Bo(Bt,null,null,$t),yo()),an=Dt.memoizedState,un=Bt.memoizedState,an.parent!==Yt?(an={parent:Yt,cache:Yt},Bt.memoizedState=an,Bt.lanes===0&&(Bt.memoizedState=Bt.updateQueue.baseState=an),Ps(Bt,Eo,Yt)):(Yt=un.cache,Ps(Bt,Eo,Yt),Yt!==an.cache&&fo(Bt,[Eo],$t,!0))),bl(Dt,Bt,Bt.pendingProps.children,$t),Bt.child;case 29:throw Bt.pendingProps}throw Error(vt(156,Bt.tag))}function Rc(Dt){Dt.flags|=4}function Ef(Dt,Bt,$t,Yt,an){if((Bt=(Dt.mode&32)!==0)&&(Bt=!1),Bt){if(Dt.flags|=16777216,(an&335544128)===an)if(Dt.stateNode.complete)Dt.flags|=8192;else if(Up())Dt.flags|=8192;else throw Xr=ei,ur}else Dt.flags&=-16777217}function pp(Dt,Bt){if(Bt.type!=="stylesheet"||(Bt.state.loading&4)!==0)Dt.flags&=-16777217;else if(Dt.flags|=16777216,!T0(Bt))if(Up())Dt.flags|=8192;else throw Xr=ei,ur}function ld(Dt,Bt){Bt!==null&&(Dt.flags|=4),Dt.flags&16384&&(Bt=Dt.tag!==22?nr():536870912,Dt.lanes|=Bt,pu|=Bt)}function Du(Dt,Bt){if(!Fn)switch(Dt.tailMode){case"hidden":Bt=Dt.tail;for(var $t=null;Bt!==null;)Bt.alternate!==null&&($t=Bt),Bt=Bt.sibling;$t===null?Dt.tail=null:$t.sibling=null;break;case"collapsed":$t=Dt.tail;for(var Yt=null;$t!==null;)$t.alternate!==null&&(Yt=$t),$t=$t.sibling;Yt===null?Bt||Dt.tail===null?Dt.tail=null:Dt.tail.sibling=null:Yt.sibling=null}}function ga(Dt){var Bt=Dt.alternate!==null&&Dt.alternate.child===Dt.child,$t=0,Yt=0;if(Bt)for(var an=Dt.child;an!==null;)$t|=an.lanes|an.childLanes,Yt|=an.subtreeFlags&65011712,Yt|=an.flags&65011712,an.return=Dt,an=an.sibling;else for(an=Dt.child;an!==null;)$t|=an.lanes|an.childLanes,Yt|=an.subtreeFlags,Yt|=an.flags,an.return=Dt,an=an.sibling;return Dt.subtreeFlags|=Yt,Dt.childLanes=$t,Bt}function ng(Dt,Bt,$t){var Yt=Bt.pendingProps;switch(Mr(Bt),Bt.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ga(Bt),null;case 1:return ga(Bt),null;case 3:return $t=Bt.stateNode,Yt=null,Dt!==null&&(Yt=Dt.memoizedState.cache),Bt.memoizedState.cache!==Yt&&(Bt.flags|=2048),ks(Eo),$n(),$t.pendingContext&&($t.context=$t.pendingContext,$t.pendingContext=null),(Dt===null||Dt.child===null)&&(Yr(Bt)?Rc(Bt):Dt===null||Dt.memoizedState.isDehydrated&&(Bt.flags&256)===0||(Bt.flags|=1024,yi())),ga(Bt),null;case 26:var an=Bt.type,un=Bt.memoizedState;return Dt===null?(Rc(Bt),un!==null?(ga(Bt),pp(Bt,un)):(ga(Bt),Ef(Bt,an,null,Yt,$t))):un?un!==Dt.memoizedState?(Rc(Bt),ga(Bt),pp(Bt,un)):(ga(Bt),Bt.flags&=-16777217):(Dt=Dt.memoizedProps,Dt!==Yt&&Rc(Bt),ga(Bt),Ef(Bt,an,Dt,Yt,$t)),null;case 27:if(Tn(Bt),$t=yn.current,an=Bt.type,Dt!==null&&Bt.stateNode!=null)Dt.memoizedProps!==Yt&&Rc(Bt);else{if(!Yt){if(Bt.stateNode===null)throw Error(vt(166));return ga(Bt),null}Dt=mn.current,Yr(Bt)?Tr(Bt):(Dt=v0(an,Yt,$t),Bt.stateNode=Dt,Rc(Bt))}return ga(Bt),null;case 5:if(Tn(Bt),an=Bt.type,Dt!==null&&Bt.stateNode!=null)Dt.memoizedProps!==Yt&&Rc(Bt);else{if(!Yt){if(Bt.stateNode===null)throw Error(vt(166));return ga(Bt),null}if(un=mn.current,Yr(Bt))Tr(Bt);else{var bn=Ad(yn.current);switch(un){case 1:un=bn.createElementNS("http://www.w3.org/2000/svg",an);break;case 2:un=bn.createElementNS("http://www.w3.org/1998/Math/MathML",an);break;default:switch(an){case"svg":un=bn.createElementNS("http://www.w3.org/2000/svg",an);break;case"math":un=bn.createElementNS("http://www.w3.org/1998/Math/MathML",an);break;case"script":un=bn.createElement("div"),un.innerHTML="<script><\/script>",un=un.removeChild(un.firstChild);break;case"select":un=typeof Yt.is=="string"?bn.createElement("select",{is:Yt.is}):bn.createElement("select"),Yt.multiple?un.multiple=!0:Yt.size&&(un.size=Yt.size);break;default:un=typeof Yt.is=="string"?bn.createElement(an,{is:Yt.is}):bn.createElement(an)}}un[mi]=Bt,un[wi]=Yt;e:for(bn=Bt.child;bn!==null;){if(bn.tag===5||bn.tag===6)un.appendChild(bn.stateNode);else if(bn.tag!==4&&bn.tag!==27&&bn.child!==null){bn.child.return=bn,bn=bn.child;continue}if(bn===Bt)break e;for(;bn.sibling===null;){if(bn.return===null||bn.return===Bt)break e;bn=bn.return}bn.sibling.return=bn.return,bn=bn.sibling}Bt.stateNode=un;e:switch(Al(un,an,Yt),an){case"button":case"input":case"select":case"textarea":Yt=!!Yt.autoFocus;break e;case"img":Yt=!0;break e;default:Yt=!1}Yt&&Rc(Bt)}}return ga(Bt),Ef(Bt,Bt.type,Dt===null?null:Dt.memoizedProps,Bt.pendingProps,$t),null;case 6:if(Dt&&Bt.stateNode!=null)Dt.memoizedProps!==Yt&&Rc(Bt);else{if(typeof Yt!="string"&&Bt.stateNode===null)throw Error(vt(166));if(Dt=yn.current,Yr(Bt)){if(Dt=Bt.stateNode,$t=Bt.memoizedProps,Yt=null,an=Nr,an!==null)switch(an.tag){case 27:case 5:Yt=an.memoizedProps}Dt[mi]=Bt,Dt=!!(Dt.nodeValue===$t||Yt!==null&&Yt.suppressHydrationWarning===!0||u0(Dt.nodeValue,$t)),Dt||Er(Bt,!0)}else Dt=Ad(Dt).createTextNode(Yt),Dt[mi]=Bt,Bt.stateNode=Dt}return ga(Bt),null;case 31:if($t=Bt.memoizedState,Dt===null||Dt.memoizedState!==null){if(Yt=Yr(Bt),$t!==null){if(Dt===null){if(!Yt)throw Error(vt(318));if(Dt=Bt.memoizedState,Dt=Dt!==null?Dt.dehydrated:null,!Dt)throw Error(vt(557));Dt[mi]=Bt}else li(),(Bt.flags&128)===0&&(Bt.memoizedState=null),Bt.flags|=4;ga(Bt),Dt=!1}else $t=yi(),Dt!==null&&Dt.memoizedState!==null&&(Dt.memoizedState.hydrationErrors=$t),Dt=!0;if(!Dt)return Bt.flags&256?(ic(Bt),Bt):(ic(Bt),null);if((Bt.flags&128)!==0)throw Error(vt(558))}return ga(Bt),null;case 13:if(Yt=Bt.memoizedState,Dt===null||Dt.memoizedState!==null&&Dt.memoizedState.dehydrated!==null){if(an=Yr(Bt),Yt!==null&&Yt.dehydrated!==null){if(Dt===null){if(!an)throw Error(vt(318));if(an=Bt.memoizedState,an=an!==null?an.dehydrated:null,!an)throw Error(vt(317));an[mi]=Bt}else li(),(Bt.flags&128)===0&&(Bt.memoizedState=null),Bt.flags|=4;ga(Bt),an=!1}else an=yi(),Dt!==null&&Dt.memoizedState!==null&&(Dt.memoizedState.hydrationErrors=an),an=!0;if(!an)return Bt.flags&256?(ic(Bt),Bt):(ic(Bt),null)}return ic(Bt),(Bt.flags&128)!==0?(Bt.lanes=$t,Bt):($t=Yt!==null,Dt=Dt!==null&&Dt.memoizedState!==null,$t&&(Yt=Bt.child,an=null,Yt.alternate!==null&&Yt.alternate.memoizedState!==null&&Yt.alternate.memoizedState.cachePool!==null&&(an=Yt.alternate.memoizedState.cachePool.pool),un=null,Yt.memoizedState!==null&&Yt.memoizedState.cachePool!==null&&(un=Yt.memoizedState.cachePool.pool),un!==an&&(Yt.flags|=2048)),$t!==Dt&&$t&&(Bt.child.flags|=8192),ld(Bt,Bt.updateQueue),ga(Bt),null);case 4:return $n(),Dt===null&&zf(Bt.stateNode.containerInfo),ga(Bt),null;case 10:return ks(Bt.type),ga(Bt),null;case 19:if(fn(ja),Yt=Bt.memoizedState,Yt===null)return ga(Bt),null;if(an=(Bt.flags&128)!==0,un=Yt.rendering,un===null)if(an)Du(Yt,!1);else{if(Na!==0||Dt!==null&&(Dt.flags&128)!==0)for(Dt=Bt.child;Dt!==null;){if(un=Xu(Dt),un!==null){for(Bt.flags|=128,Du(Yt,!1),Dt=un.updateQueue,Bt.updateQueue=Dt,ld(Bt,Dt),Bt.subtreeFlags=0,Dt=$t,$t=Bt.child;$t!==null;)Qs($t,Dt),$t=$t.sibling;return pn(ja,ja.current&1|2),Fn&&vl(Bt,Yt.treeForkCount),Bt.child}Dt=Dt.sibling}Yt.tail!==null&&Dr()>hd&&(Bt.flags|=128,an=!0,Du(Yt,!1),Bt.lanes=4194304)}else{if(!an)if(Dt=Xu(un),Dt!==null){if(Bt.flags|=128,an=!0,Dt=Dt.updateQueue,Bt.updateQueue=Dt,ld(Bt,Dt),Du(Yt,!0),Yt.tail===null&&Yt.tailMode==="hidden"&&!un.alternate&&!Fn)return ga(Bt),null}else 2*Dr()-Yt.renderingStartTime>hd&&$t!==536870912&&(Bt.flags|=128,an=!0,Du(Yt,!1),Bt.lanes=4194304);Yt.isBackwards?(un.sibling=Bt.child,Bt.child=un):(Dt=Yt.last,Dt!==null?Dt.sibling=un:Bt.child=un,Yt.last=un)}return Yt.tail!==null?(Dt=Yt.tail,Yt.rendering=Dt,Yt.tail=Dt.sibling,Yt.renderingStartTime=Dr(),Dt.sibling=null,$t=ja.current,pn(ja,an?$t&1|2:$t&1),Fn&&vl(Bt,Yt.treeForkCount),Dt):(ga(Bt),null);case 22:case 23:return ic(Bt),zd(),Yt=Bt.memoizedState!==null,Dt!==null?Dt.memoizedState!==null!==Yt&&(Bt.flags|=8192):Yt&&(Bt.flags|=8192),Yt?($t&536870912)!==0&&(Bt.flags&128)===0&&(ga(Bt),Bt.subtreeFlags&6&&(Bt.flags|=8192)):ga(Bt),$t=Bt.updateQueue,$t!==null&&ld(Bt,$t.retryQueue),$t=null,Dt!==null&&Dt.memoizedState!==null&&Dt.memoizedState.cachePool!==null&&($t=Dt.memoizedState.cachePool.pool),Yt=null,Bt.memoizedState!==null&&Bt.memoizedState.cachePool!==null&&(Yt=Bt.memoizedState.cachePool.pool),Yt!==$t&&(Bt.flags|=2048),Dt!==null&&fn(La),null;case 24:return $t=null,Dt!==null&&($t=Dt.memoizedState.cache),Bt.memoizedState.cache!==$t&&(Bt.flags|=2048),ks(Eo),ga(Bt),null;case 25:return null;case 30:return null}throw Error(vt(156,Bt.tag))}function rg(Dt,Bt){switch(Mr(Bt),Bt.tag){case 1:return Dt=Bt.flags,Dt&65536?(Bt.flags=Dt&-65537|128,Bt):null;case 3:return ks(Eo),$n(),Dt=Bt.flags,(Dt&65536)!==0&&(Dt&128)===0?(Bt.flags=Dt&-65537|128,Bt):null;case 26:case 27:case 5:return Tn(Bt),null;case 31:if(Bt.memoizedState!==null){if(ic(Bt),Bt.alternate===null)throw Error(vt(340));li()}return Dt=Bt.flags,Dt&65536?(Bt.flags=Dt&-65537|128,Bt):null;case 13:if(ic(Bt),Dt=Bt.memoizedState,Dt!==null&&Dt.dehydrated!==null){if(Bt.alternate===null)throw Error(vt(340));li()}return Dt=Bt.flags,Dt&65536?(Bt.flags=Dt&-65537|128,Bt):null;case 19:return fn(ja),null;case 4:return $n(),null;case 10:return ks(Bt.type),null;case 22:case 23:return ic(Bt),zd(),Dt!==null&&fn(La),Dt=Bt.flags,Dt&65536?(Bt.flags=Dt&-65537|128,Bt):null;case 24:return ks(Eo),null;case 25:return null;default:return null}}function gp(Dt,Bt){switch(Mr(Bt),Bt.tag){case 3:ks(Eo),$n();break;case 26:case 27:case 5:Tn(Bt);break;case 4:$n();break;case 31:Bt.memoizedState!==null&&ic(Bt);break;case 13:ic(Bt);break;case 19:fn(ja);break;case 10:ks(Bt.type);break;case 22:case 23:ic(Bt),zd(),Dt!==null&&fn(La);break;case 24:ks(Eo)}}function Tu(Dt,Bt){try{var $t=Bt.updateQueue,Yt=$t!==null?$t.lastEffect:null;if(Yt!==null){var an=Yt.next;$t=an;do{if(($t.tag&Dt)===Dt){Yt=void 0;var un=$t.create,bn=$t.inst;Yt=un(),bn.destroy=Yt}$t=$t.next}while($t!==an)}}catch(qn){zo(Bt,Bt.return,qn)}}function $c(Dt,Bt,$t){try{var Yt=Bt.updateQueue,an=Yt!==null?Yt.lastEffect:null;if(an!==null){var un=an.next;Yt=un;do{if((Yt.tag&Dt)===Dt){var bn=Yt.inst,qn=bn.destroy;if(qn!==void 0){bn.destroy=void 0,an=Bt;var Sr=$t,Jr=qn;try{Jr()}catch(ui){zo(an,Sr,ui)}}}Yt=Yt.next}while(Yt!==un)}}catch(ui){zo(Bt,Bt.return,ui)}}function mp(Dt){var Bt=Dt.updateQueue;if(Bt!==null){var $t=Dt.stateNode;try{yc(Bt,$t)}catch(Yt){zo(Dt,Dt.return,Yt)}}}function Ep(Dt,Bt,$t){$t.props=ru(Dt.type,Dt.memoizedProps),$t.state=Dt.memoizedState;try{$t.componentWillUnmount()}catch(Yt){zo(Dt,Bt,Yt)}}function Ru(Dt,Bt){try{var $t=Dt.ref;if($t!==null){switch(Dt.tag){case 26:case 27:case 5:var Yt=Dt.stateNode;break;case 30:Yt=Dt.stateNode;break;default:Yt=Dt.stateNode}typeof $t=="function"?Dt.refCleanup=$t(Yt):$t.current=Yt}}catch(an){zo(Dt,Bt,an)}}function Cc(Dt,Bt){var $t=Dt.ref,Yt=Dt.refCleanup;if($t!==null)if(typeof Yt=="function")try{Yt()}catch(an){zo(Dt,Bt,an)}finally{Dt.refCleanup=null,Dt=Dt.alternate,Dt!=null&&(Dt.refCleanup=null)}else if(typeof $t=="function")try{$t(null)}catch(an){zo(Dt,Bt,an)}else $t.current=null}function yp(Dt){var Bt=Dt.type,$t=Dt.memoizedProps,Yt=Dt.stateNode;try{e:switch(Bt){case"button":case"input":case"select":case"textarea":$t.autoFocus&&Yt.focus();break e;case"img":$t.src?Yt.src=$t.src:$t.srcSet&&(Yt.srcset=$t.srcSet)}}catch(an){zo(Dt,Dt.return,an)}}function yf(Dt,Bt,$t){try{var Yt=Dt.stateNode;Fg(Yt,Dt.type,$t,Bt),Yt[wi]=Bt}catch(an){zo(Dt,Dt.return,an)}}function _p(Dt){return Dt.tag===5||Dt.tag===3||Dt.tag===26||Dt.tag===27&&Yc(Dt.type)||Dt.tag===4}function _f(Dt){e:for(;;){for(;Dt.sibling===null;){if(Dt.return===null||_p(Dt.return))return null;Dt=Dt.return}for(Dt.sibling.return=Dt.return,Dt=Dt.sibling;Dt.tag!==5&&Dt.tag!==6&&Dt.tag!==18;){if(Dt.tag===27&&Yc(Dt.type)||Dt.flags&2||Dt.child===null||Dt.tag===4)continue e;Dt.child.return=Dt,Dt=Dt.child}if(!(Dt.flags&2))return Dt.stateNode}}function xf(Dt,Bt,$t){var Yt=Dt.tag;if(Yt===5||Yt===6)Dt=Dt.stateNode,Bt?($t.nodeType===9?$t.body:$t.nodeName==="HTML"?$t.ownerDocument.body:$t).insertBefore(Dt,Bt):(Bt=$t.nodeType===9?$t.body:$t.nodeName==="HTML"?$t.ownerDocument.body:$t,Bt.appendChild(Dt),$t=$t._reactRootContainer,$t!=null||Bt.onclick!==null||(Bt.onclick=$o));else if(Yt!==4&&(Yt===27&&Yc(Dt.type)&&($t=Dt.stateNode,Bt=null),Dt=Dt.child,Dt!==null))for(xf(Dt,Bt,$t),Dt=Dt.sibling;Dt!==null;)xf(Dt,Bt,$t),Dt=Dt.sibling}function cd(Dt,Bt,$t){var Yt=Dt.tag;if(Yt===5||Yt===6)Dt=Dt.stateNode,Bt?$t.insertBefore(Dt,Bt):$t.appendChild(Dt);else if(Yt!==4&&(Yt===27&&Yc(Dt.type)&&($t=Dt.stateNode),Dt=Dt.child,Dt!==null))for(cd(Dt,Bt,$t),Dt=Dt.sibling;Dt!==null;)cd(Dt,Bt,$t),Dt=Dt.sibling}function xp(Dt){var Bt=Dt.stateNode,$t=Dt.memoizedProps;try{for(var Yt=Dt.type,an=Bt.attributes;an.length;)Bt.removeAttributeNode(an[0]);Al(Bt,Yt,$t),Bt[mi]=Dt,Bt[wi]=$t}catch(un){zo(Dt,Dt.return,un)}}var Bc=!1,Qa=!1,vf=!1,vp=typeof WeakSet=="function"?WeakSet:Set,yl=null;function ig(Dt,Bt){if(Dt=Dt.containerInfo,jf=Rd,Dt=Bl(Dt),sl(Dt)){if("selectionStart"in Dt)var $t={start:Dt.selectionStart,end:Dt.selectionEnd};else e:{$t=($t=Dt.ownerDocument)&&$t.defaultView||window;var Yt=$t.getSelection&&$t.getSelection();if(Yt&&Yt.rangeCount!==0){$t=Yt.anchorNode;var an=Yt.anchorOffset,un=Yt.focusNode;Yt=Yt.focusOffset;try{$t.nodeType,un.nodeType}catch{$t=null;break e}var bn=0,qn=-1,Sr=-1,Jr=0,ui=0,gi=Dt,ni=null;t:for(;;){for(var oi;gi!==$t||an!==0&&gi.nodeType!==3||(qn=bn+an),gi!==un||Yt!==0&&gi.nodeType!==3||(Sr=bn+Yt),gi.nodeType===3&&(bn+=gi.nodeValue.length),(oi=gi.firstChild)!==null;)ni=gi,gi=oi;for(;;){if(gi===Dt)break t;if(ni===$t&&++Jr===an&&(qn=bn),ni===un&&++ui===Yt&&(Sr=bn),(oi=gi.nextSibling)!==null)break;gi=ni,ni=gi.parentNode}gi=oi}$t=qn===-1||Sr===-1?null:{start:qn,end:Sr}}else $t=null}$t=$t||{start:0,end:0}}else $t=null;for(Hf={focusedElem:Dt,selectionRange:$t},Rd=!1,yl=Bt;yl!==null;)if(Bt=yl,Dt=Bt.child,(Bt.subtreeFlags&1028)!==0&&Dt!==null)Dt.return=Bt,yl=Dt;else for(;yl!==null;){switch(Bt=yl,un=Bt.alternate,Dt=Bt.flags,Bt.tag){case 0:if((Dt&4)!==0&&(Dt=Bt.updateQueue,Dt=Dt!==null?Dt.events:null,Dt!==null))for($t=0;$t<Dt.length;$t++)an=Dt[$t],an.ref.impl=an.nextImpl;break;case 11:case 15:break;case 1:if((Dt&1024)!==0&&un!==null){Dt=void 0,$t=Bt,an=un.memoizedProps,un=un.memoizedState,Yt=$t.stateNode;try{var Ji=ru($t.type,an);Dt=Yt.getSnapshotBeforeUpdate(Ji,un),Yt.__reactInternalSnapshotBeforeUpdate=Dt}catch(_s){zo($t,$t.return,_s)}}break;case 3:if((Dt&1024)!==0){if(Dt=Bt.stateNode.containerInfo,$t=Dt.nodeType,$t===9)Gf(Dt);else if($t===1)switch(Dt.nodeName){case"HEAD":case"HTML":case"BODY":Gf(Dt);break;default:Dt.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((Dt&1024)!==0)throw Error(vt(163))}if(Dt=Bt.sibling,Dt!==null){Dt.return=Bt.return,yl=Dt;break}yl=Bt.return}}function bp(Dt,Bt,$t){var Yt=$t.flags;switch($t.tag){case 0:case 11:case 15:Ic(Dt,$t),Yt&4&&Tu(5,$t);break;case 1:if(Ic(Dt,$t),Yt&4)if(Dt=$t.stateNode,Bt===null)try{Dt.componentDidMount()}catch(bn){zo($t,$t.return,bn)}else{var an=ru($t.type,Bt.memoizedProps);Bt=Bt.memoizedState;try{Dt.componentDidUpdate(an,Bt,Dt.__reactInternalSnapshotBeforeUpdate)}catch(bn){zo($t,$t.return,bn)}}Yt&64&&mp($t),Yt&512&&Ru($t,$t.return);break;case 3:if(Ic(Dt,$t),Yt&64&&(Dt=$t.updateQueue,Dt!==null)){if(Bt=null,$t.child!==null)switch($t.child.tag){case 27:case 5:Bt=$t.child.stateNode;break;case 1:Bt=$t.child.stateNode}try{yc(Dt,Bt)}catch(bn){zo($t,$t.return,bn)}}break;case 27:Bt===null&&Yt&4&&xp($t);case 26:case 5:Ic(Dt,$t),Bt===null&&Yt&4&&yp($t),Yt&512&&Ru($t,$t.return);break;case 12:Ic(Dt,$t);break;case 31:Ic(Dt,$t),Yt&4&&Fp(Dt,$t);break;case 13:Ic(Dt,$t),Yt&4&&wp(Dt,$t),Yt&64&&(Dt=$t.memoizedState,Dt!==null&&(Dt=Dt.dehydrated,Dt!==null&&($t=hg.bind(null,$t),Ig(Dt,$t))));break;case 22:if(Yt=$t.memoizedState!==null||Bc,!Yt){Bt=Bt!==null&&Bt.memoizedState!==null||Qa,an=Bc;var un=Qa;Bc=Yt,(Qa=Bt)&&!un?Oc(Dt,$t,($t.subtreeFlags&8772)!==0):Ic(Dt,$t),Bc=an,Qa=un}break;case 30:break;default:Ic(Dt,$t)}}function Ap(Dt){var Bt=Dt.alternate;Bt!==null&&(Dt.alternate=null,Ap(Bt)),Dt.child=null,Dt.deletions=null,Dt.sibling=null,Dt.tag===5&&(Bt=Dt.stateNode,Bt!==null&&$s(Bt)),Dt.stateNode=null,Dt.return=null,Dt.dependencies=null,Dt.memoizedProps=null,Dt.memoizedState=null,Dt.pendingProps=null,Dt.stateNode=null,Dt.updateQueue=null}var xa=null,Gl=!1;function Mc(Dt,Bt,$t){for($t=$t.child;$t!==null;)Cp(Dt,Bt,$t),$t=$t.sibling}function Cp(Dt,Bt,$t){if(gn&&typeof gn.onCommitFiberUnmount=="function")try{gn.onCommitFiberUnmount(cr,$t)}catch{}switch($t.tag){case 26:Qa||Cc($t,Bt),Mc(Dt,Bt,$t),$t.memoizedState?$t.memoizedState.count--:$t.stateNode&&($t=$t.stateNode,$t.parentNode.removeChild($t));break;case 27:Qa||Cc($t,Bt);var Yt=xa,an=Gl;Yc($t.type)&&(xa=$t.stateNode,Gl=!1),Mc(Dt,Bt,$t),zu($t.stateNode),xa=Yt,Gl=an;break;case 5:Qa||Cc($t,Bt);case 6:if(Yt=xa,an=Gl,xa=null,Mc(Dt,Bt,$t),xa=Yt,Gl=an,xa!==null)if(Gl)try{(xa.nodeType===9?xa.body:xa.nodeName==="HTML"?xa.ownerDocument.body:xa).removeChild($t.stateNode)}catch(un){zo($t,Bt,un)}else try{xa.removeChild($t.stateNode)}catch(un){zo($t,Bt,un)}break;case 18:xa!==null&&(Gl?(Dt=xa,m0(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt,$t.stateNode),bu(Dt)):m0(xa,$t.stateNode));break;case 4:Yt=xa,an=Gl,xa=$t.stateNode.containerInfo,Gl=!0,Mc(Dt,Bt,$t),xa=Yt,Gl=an;break;case 0:case 11:case 14:case 15:$c(2,$t,Bt),Qa||$c(4,$t,Bt),Mc(Dt,Bt,$t);break;case 1:Qa||(Cc($t,Bt),Yt=$t.stateNode,typeof Yt.componentWillUnmount=="function"&&Ep($t,Bt,Yt)),Mc(Dt,Bt,$t);break;case 21:Mc(Dt,Bt,$t);break;case 22:Qa=(Yt=Qa)||$t.memoizedState!==null,Mc(Dt,Bt,$t),Qa=Yt;break;default:Mc(Dt,Bt,$t)}}function Fp(Dt,Bt){if(Bt.memoizedState===null&&(Dt=Bt.alternate,Dt!==null&&(Dt=Dt.memoizedState,Dt!==null))){Dt=Dt.dehydrated;try{bu(Dt)}catch($t){zo(Bt,Bt.return,$t)}}}function wp(Dt,Bt){if(Bt.memoizedState===null&&(Dt=Bt.alternate,Dt!==null&&(Dt=Dt.memoizedState,Dt!==null&&(Dt=Dt.dehydrated,Dt!==null))))try{bu(Dt)}catch($t){zo(Bt,Bt.return,$t)}}function sg(Dt){switch(Dt.tag){case 31:case 13:case 19:var Bt=Dt.stateNode;return Bt===null&&(Bt=Dt.stateNode=new vp),Bt;case 22:return Dt=Dt.stateNode,Bt=Dt._retryCache,Bt===null&&(Bt=Dt._retryCache=new vp),Bt;default:throw Error(vt(435,Dt.tag))}}function ud(Dt,Bt){var $t=sg(Dt);Bt.forEach(function(Yt){if(!$t.has(Yt)){$t.add(Yt);var an=pg.bind(null,Dt,Yt);Yt.then(an,an)}})}function ql(Dt,Bt){var $t=Bt.deletions;if($t!==null)for(var Yt=0;Yt<$t.length;Yt++){var an=$t[Yt],un=Dt,bn=Bt,qn=bn;e:for(;qn!==null;){switch(qn.tag){case 27:if(Yc(qn.type)){xa=qn.stateNode,Gl=!1;break e}break;case 5:xa=qn.stateNode,Gl=!1;break e;case 3:case 4:xa=qn.stateNode.containerInfo,Gl=!0;break e}qn=qn.return}if(xa===null)throw Error(vt(160));Cp(un,bn,an),xa=null,Gl=!1,un=an.alternate,un!==null&&(un.return=null),an.return=null}if(Bt.subtreeFlags&13886)for(Bt=Bt.child;Bt!==null;)Sp(Bt,Dt),Bt=Bt.sibling}var xc=null;function Sp(Dt,Bt){var $t=Dt.alternate,Yt=Dt.flags;switch(Dt.tag){case 0:case 11:case 14:case 15:ql(Bt,Dt),Yl(Dt),Yt&4&&($c(3,Dt,Dt.return),Tu(3,Dt),$c(5,Dt,Dt.return));break;case 1:ql(Bt,Dt),Yl(Dt),Yt&512&&(Qa||$t===null||Cc($t,$t.return)),Yt&64&&Bc&&(Dt=Dt.updateQueue,Dt!==null&&(Yt=Dt.callbacks,Yt!==null&&($t=Dt.shared.hiddenCallbacks,Dt.shared.hiddenCallbacks=$t===null?Yt:$t.concat(Yt))));break;case 26:var an=xc;if(ql(Bt,Dt),Yl(Dt),Yt&512&&(Qa||$t===null||Cc($t,$t.return)),Yt&4){var un=$t!==null?$t.memoizedState:null;if(Yt=Dt.memoizedState,$t===null)if(Yt===null)if(Dt.stateNode===null){e:{Yt=Dt.type,$t=Dt.memoizedProps,an=an.ownerDocument||an;t:switch(Yt){case"title":un=an.getElementsByTagName("title")[0],(!un||un[xs]||un[mi]||un.namespaceURI==="http://www.w3.org/2000/svg"||un.hasAttribute("itemprop"))&&(un=an.createElement(Yt),an.head.insertBefore(un,an.querySelector("head > title"))),Al(un,Yt,$t),un[mi]=Dt,Ds(un),Yt=un;break e;case"link":var bn=S0("link","href",an).get(Yt+($t.href||""));if(bn){for(var qn=0;qn<bn.length;qn++)if(un=bn[qn],un.getAttribute("href")===($t.href==null||$t.href===""?null:$t.href)&&un.getAttribute("rel")===($t.rel==null?null:$t.rel)&&un.getAttribute("title")===($t.title==null?null:$t.title)&&un.getAttribute("crossorigin")===($t.crossOrigin==null?null:$t.crossOrigin)){bn.splice(qn,1);break t}}un=an.createElement(Yt),Al(un,Yt,$t),an.head.appendChild(un);break;case"meta":if(bn=S0("meta","content",an).get(Yt+($t.content||""))){for(qn=0;qn<bn.length;qn++)if(un=bn[qn],un.getAttribute("content")===($t.content==null?null:""+$t.content)&&un.getAttribute("name")===($t.name==null?null:$t.name)&&un.getAttribute("property")===($t.property==null?null:$t.property)&&un.getAttribute("http-equiv")===($t.httpEquiv==null?null:$t.httpEquiv)&&un.getAttribute("charset")===($t.charSet==null?null:$t.charSet)){bn.splice(qn,1);break t}}un=an.createElement(Yt),Al(un,Yt,$t),an.head.appendChild(un);break;default:throw Error(vt(468,Yt))}un[mi]=Dt,Ds(un),Yt=un}Dt.stateNode=Yt}else D0(an,Dt.type,Dt.stateNode);else Dt.stateNode=w0(an,Yt,Dt.memoizedProps);else un!==Yt?(un===null?$t.stateNode!==null&&($t=$t.stateNode,$t.parentNode.removeChild($t)):un.count--,Yt===null?D0(an,Dt.type,Dt.stateNode):w0(an,Yt,Dt.memoizedProps)):Yt===null&&Dt.stateNode!==null&&yf(Dt,Dt.memoizedProps,$t.memoizedProps)}break;case 27:ql(Bt,Dt),Yl(Dt),Yt&512&&(Qa||$t===null||Cc($t,$t.return)),$t!==null&&Yt&4&&yf(Dt,Dt.memoizedProps,$t.memoizedProps);break;case 5:if(ql(Bt,Dt),Yl(Dt),Yt&512&&(Qa||$t===null||Cc($t,$t.return)),Dt.flags&32){an=Dt.stateNode;try{wo(an,"")}catch(Ji){zo(Dt,Dt.return,Ji)}}Yt&4&&Dt.stateNode!=null&&(an=Dt.memoizedProps,yf(Dt,an,$t!==null?$t.memoizedProps:an)),Yt&1024&&(vf=!0);break;case 6:if(ql(Bt,Dt),Yl(Dt),Yt&4){if(Dt.stateNode===null)throw Error(vt(162));Yt=Dt.memoizedProps,$t=Dt.stateNode;try{$t.nodeValue=Yt}catch(Ji){zo(Dt,Dt.return,Ji)}}break;case 3:if(wd=null,an=xc,xc=Cd(Bt.containerInfo),ql(Bt,Dt),xc=an,Yl(Dt),Yt&4&&$t!==null&&$t.memoizedState.isDehydrated)try{bu(Bt.containerInfo)}catch(Ji){zo(Dt,Dt.return,Ji)}vf&&(vf=!1,Dp(Dt));break;case 4:Yt=xc,xc=Cd(Dt.stateNode.containerInfo),ql(Bt,Dt),Yl(Dt),xc=Yt;break;case 12:ql(Bt,Dt),Yl(Dt);break;case 31:ql(Bt,Dt),Yl(Dt),Yt&4&&(Yt=Dt.updateQueue,Yt!==null&&(Dt.updateQueue=null,ud(Dt,Yt)));break;case 13:ql(Bt,Dt),Yl(Dt),Dt.child.flags&8192&&Dt.memoizedState!==null!=($t!==null&&$t.memoizedState!==null)&&(fd=Dr()),Yt&4&&(Yt=Dt.updateQueue,Yt!==null&&(Dt.updateQueue=null,ud(Dt,Yt)));break;case 22:an=Dt.memoizedState!==null;var Sr=$t!==null&&$t.memoizedState!==null,Jr=Bc,ui=Qa;if(Bc=Jr||an,Qa=ui||Sr,ql(Bt,Dt),Qa=ui,Bc=Jr,Yl(Dt),Yt&8192)e:for(Bt=Dt.stateNode,Bt._visibility=an?Bt._visibility&-2:Bt._visibility|1,an&&($t===null||Sr||Bc||Qa||iu(Dt)),$t=null,Bt=Dt;;){if(Bt.tag===5||Bt.tag===26){if($t===null){Sr=$t=Bt;try{if(un=Sr.stateNode,an)bn=un.style,typeof bn.setProperty=="function"?bn.setProperty("display","none","important"):bn.display="none";else{qn=Sr.stateNode;var gi=Sr.memoizedProps.style,ni=gi!=null&&gi.hasOwnProperty("display")?gi.display:null;qn.style.display=ni==null||typeof ni=="boolean"?"":(""+ni).trim()}}catch(Ji){zo(Sr,Sr.return,Ji)}}}else if(Bt.tag===6){if($t===null){Sr=Bt;try{Sr.stateNode.nodeValue=an?"":Sr.memoizedProps}catch(Ji){zo(Sr,Sr.return,Ji)}}}else if(Bt.tag===18){if($t===null){Sr=Bt;try{var oi=Sr.stateNode;an?E0(oi,!0):E0(Sr.stateNode,!1)}catch(Ji){zo(Sr,Sr.return,Ji)}}}else if((Bt.tag!==22&&Bt.tag!==23||Bt.memoizedState===null||Bt===Dt)&&Bt.child!==null){Bt.child.return=Bt,Bt=Bt.child;continue}if(Bt===Dt)break e;for(;Bt.sibling===null;){if(Bt.return===null||Bt.return===Dt)break e;$t===Bt&&($t=null),Bt=Bt.return}$t===Bt&&($t=null),Bt.sibling.return=Bt.return,Bt=Bt.sibling}Yt&4&&(Yt=Dt.updateQueue,Yt!==null&&($t=Yt.retryQueue,$t!==null&&(Yt.retryQueue=null,ud(Dt,$t))));break;case 19:ql(Bt,Dt),Yl(Dt),Yt&4&&(Yt=Dt.updateQueue,Yt!==null&&(Dt.updateQueue=null,ud(Dt,Yt)));break;case 30:break;case 21:break;default:ql(Bt,Dt),Yl(Dt)}}function Yl(Dt){var Bt=Dt.flags;if(Bt&2){try{for(var $t,Yt=Dt.return;Yt!==null;){if(_p(Yt)){$t=Yt;break}Yt=Yt.return}if($t==null)throw Error(vt(160));switch($t.tag){case 27:var an=$t.stateNode,un=_f(Dt);cd(Dt,un,an);break;case 5:var bn=$t.stateNode;$t.flags&32&&(wo(bn,""),$t.flags&=-33);var qn=_f(Dt);cd(Dt,qn,bn);break;case 3:case 4:var Sr=$t.stateNode.containerInfo,Jr=_f(Dt);xf(Dt,Jr,Sr);break;default:throw Error(vt(161))}}catch(ui){zo(Dt,Dt.return,ui)}Dt.flags&=-3}Bt&4096&&(Dt.flags&=-4097)}function Dp(Dt){if(Dt.subtreeFlags&1024)for(Dt=Dt.child;Dt!==null;){var Bt=Dt;Dp(Bt),Bt.tag===5&&Bt.flags&1024&&Bt.stateNode.reset(),Dt=Dt.sibling}}function Ic(Dt,Bt){if(Bt.subtreeFlags&8772)for(Bt=Bt.child;Bt!==null;)bp(Dt,Bt.alternate,Bt),Bt=Bt.sibling}function iu(Dt){for(Dt=Dt.child;Dt!==null;){var Bt=Dt;switch(Bt.tag){case 0:case 11:case 14:case 15:$c(4,Bt,Bt.return),iu(Bt);break;case 1:Cc(Bt,Bt.return);var $t=Bt.stateNode;typeof $t.componentWillUnmount=="function"&&Ep(Bt,Bt.return,$t),iu(Bt);break;case 27:zu(Bt.stateNode);case 26:case 5:Cc(Bt,Bt.return),iu(Bt);break;case 22:Bt.memoizedState===null&&iu(Bt);break;case 30:iu(Bt);break;default:iu(Bt)}Dt=Dt.sibling}}function Oc(Dt,Bt,$t){for($t=$t&&(Bt.subtreeFlags&8772)!==0,Bt=Bt.child;Bt!==null;){var Yt=Bt.alternate,an=Dt,un=Bt,bn=un.flags;switch(un.tag){case 0:case 11:case 15:Oc(an,un,$t),Tu(4,un);break;case 1:if(Oc(an,un,$t),Yt=un,an=Yt.stateNode,typeof an.componentDidMount=="function")try{an.componentDidMount()}catch(Jr){zo(Yt,Yt.return,Jr)}if(Yt=un,an=Yt.updateQueue,an!==null){var qn=Yt.stateNode;try{var Sr=an.shared.hiddenCallbacks;if(Sr!==null)for(an.shared.hiddenCallbacks=null,an=0;an<Sr.length;an++)El(Sr[an],qn)}catch(Jr){zo(Yt,Yt.return,Jr)}}$t&&bn&64&&mp(un),Ru(un,un.return);break;case 27:xp(un);case 26:case 5:Oc(an,un,$t),$t&&Yt===null&&bn&4&&yp(un),Ru(un,un.return);break;case 12:Oc(an,un,$t);break;case 31:Oc(an,un,$t),$t&&bn&4&&Fp(an,un);break;case 13:Oc(an,un,$t),$t&&bn&4&&wp(an,un);break;case 22:un.memoizedState===null&&Oc(an,un,$t),Ru(un,un.return);break;case 30:break;default:Oc(an,un,$t)}Bt=Bt.sibling}}function bf(Dt,Bt){var $t=null;Dt!==null&&Dt.memoizedState!==null&&Dt.memoizedState.cachePool!==null&&($t=Dt.memoizedState.cachePool.pool),Dt=null,Bt.memoizedState!==null&&Bt.memoizedState.cachePool!==null&&(Dt=Bt.memoizedState.cachePool.pool),Dt!==$t&&(Dt!=null&&Dt.refCount++,$t!=null&&hc($t))}function Af(Dt,Bt){Dt=null,Bt.alternate!==null&&(Dt=Bt.alternate.memoizedState.cache),Bt=Bt.memoizedState.cache,Bt!==Dt&&(Bt.refCount++,Dt!=null&&hc(Dt))}function vc(Dt,Bt,$t,Yt){if(Bt.subtreeFlags&10256)for(Bt=Bt.child;Bt!==null;)Tp(Dt,Bt,$t,Yt),Bt=Bt.sibling}function Tp(Dt,Bt,$t,Yt){var an=Bt.flags;switch(Bt.tag){case 0:case 11:case 15:vc(Dt,Bt,$t,Yt),an&2048&&Tu(9,Bt);break;case 1:vc(Dt,Bt,$t,Yt);break;case 3:vc(Dt,Bt,$t,Yt),an&2048&&(Dt=null,Bt.alternate!==null&&(Dt=Bt.alternate.memoizedState.cache),Bt=Bt.memoizedState.cache,Bt!==Dt&&(Bt.refCount++,Dt!=null&&hc(Dt)));break;case 12:if(an&2048){vc(Dt,Bt,$t,Yt),Dt=Bt.stateNode;try{var un=Bt.memoizedProps,bn=un.id,qn=un.onPostCommit;typeof qn=="function"&&qn(bn,Bt.alternate===null?"mount":"update",Dt.passiveEffectDuration,-0)}catch(Sr){zo(Bt,Bt.return,Sr)}}else vc(Dt,Bt,$t,Yt);break;case 31:vc(Dt,Bt,$t,Yt);break;case 13:vc(Dt,Bt,$t,Yt);break;case 23:break;case 22:un=Bt.stateNode,bn=Bt.alternate,Bt.memoizedState!==null?un._visibility&2?vc(Dt,Bt,$t,Yt):Bu(Dt,Bt):un._visibility&2?vc(Dt,Bt,$t,Yt):(un._visibility|=2,du(Dt,Bt,$t,Yt,(Bt.subtreeFlags&10256)!==0||!1)),an&2048&&bf(bn,Bt);break;case 24:vc(Dt,Bt,$t,Yt),an&2048&&Af(Bt.alternate,Bt);break;default:vc(Dt,Bt,$t,Yt)}}function du(Dt,Bt,$t,Yt,an){for(an=an&&((Bt.subtreeFlags&10256)!==0||!1),Bt=Bt.child;Bt!==null;){var un=Dt,bn=Bt,qn=$t,Sr=Yt,Jr=bn.flags;switch(bn.tag){case 0:case 11:case 15:du(un,bn,qn,Sr,an),Tu(8,bn);break;case 23:break;case 22:var ui=bn.stateNode;bn.memoizedState!==null?ui._visibility&2?du(un,bn,qn,Sr,an):Bu(un,bn):(ui._visibility|=2,du(un,bn,qn,Sr,an)),an&&Jr&2048&&bf(bn.alternate,bn);break;case 24:du(un,bn,qn,Sr,an),an&&Jr&2048&&Af(bn.alternate,bn);break;default:du(un,bn,qn,Sr,an)}Bt=Bt.sibling}}function Bu(Dt,Bt){if(Bt.subtreeFlags&10256)for(Bt=Bt.child;Bt!==null;){var $t=Dt,Yt=Bt,an=Yt.flags;switch(Yt.tag){case 22:Bu($t,Yt),an&2048&&bf(Yt.alternate,Yt);break;case 24:Bu($t,Yt),an&2048&&Af(Yt.alternate,Yt);break;default:Bu($t,Yt)}Bt=Bt.sibling}}var Mu=8192;function fu(Dt,Bt,$t){if(Dt.subtreeFlags&Mu)for(Dt=Dt.child;Dt!==null;)Rp(Dt,Bt,$t),Dt=Dt.sibling}function Rp(Dt,Bt,$t){switch(Dt.tag){case 26:fu(Dt,Bt,$t),Dt.flags&Mu&&Dt.memoizedState!==null&&Vg($t,xc,Dt.memoizedState,Dt.memoizedProps);break;case 5:fu(Dt,Bt,$t);break;case 3:case 4:var Yt=xc;xc=Cd(Dt.stateNode.containerInfo),fu(Dt,Bt,$t),xc=Yt;break;case 22:Dt.memoizedState===null&&(Yt=Dt.alternate,Yt!==null&&Yt.memoizedState!==null?(Yt=Mu,Mu=16777216,fu(Dt,Bt,$t),Mu=Yt):fu(Dt,Bt,$t));break;default:fu(Dt,Bt,$t)}}function Bp(Dt){var Bt=Dt.alternate;if(Bt!==null&&(Dt=Bt.child,Dt!==null)){Bt.child=null;do Bt=Dt.sibling,Dt.sibling=null,Dt=Bt;while(Dt!==null)}}function Iu(Dt){var Bt=Dt.deletions;if((Dt.flags&16)!==0){if(Bt!==null)for(var $t=0;$t<Bt.length;$t++){var Yt=Bt[$t];yl=Yt,Ip(Yt,Dt)}Bp(Dt)}if(Dt.subtreeFlags&10256)for(Dt=Dt.child;Dt!==null;)Mp(Dt),Dt=Dt.sibling}function Mp(Dt){switch(Dt.tag){case 0:case 11:case 15:Iu(Dt),Dt.flags&2048&&$c(9,Dt,Dt.return);break;case 3:Iu(Dt);break;case 12:Iu(Dt);break;case 22:var Bt=Dt.stateNode;Dt.memoizedState!==null&&Bt._visibility&2&&(Dt.return===null||Dt.return.tag!==13)?(Bt._visibility&=-3,dd(Dt)):Iu(Dt);break;default:Iu(Dt)}}function dd(Dt){var Bt=Dt.deletions;if((Dt.flags&16)!==0){if(Bt!==null)for(var $t=0;$t<Bt.length;$t++){var Yt=Bt[$t];yl=Yt,Ip(Yt,Dt)}Bp(Dt)}for(Dt=Dt.child;Dt!==null;){switch(Bt=Dt,Bt.tag){case 0:case 11:case 15:$c(8,Bt,Bt.return),dd(Bt);break;case 22:$t=Bt.stateNode,$t._visibility&2&&($t._visibility&=-3,dd(Bt));break;default:dd(Bt)}Dt=Dt.sibling}}function Ip(Dt,Bt){for(;yl!==null;){var $t=yl;switch($t.tag){case 0:case 11:case 15:$c(8,$t,Bt);break;case 23:case 22:if($t.memoizedState!==null&&$t.memoizedState.cachePool!==null){var Yt=$t.memoizedState.cachePool.pool;Yt!=null&&Yt.refCount++}break;case 24:hc($t.memoizedState.cache)}if(Yt=$t.child,Yt!==null)Yt.return=$t,yl=Yt;else e:for($t=Dt;yl!==null;){Yt=yl;var an=Yt.sibling,un=Yt.return;if(Ap(Yt),Yt===$t){yl=null;break e}if(an!==null){an.return=un,yl=an;break e}yl=un}}}var og={getCacheForType:function(Dt){var Bt=co(Eo),$t=Bt.data.get(Dt);return $t===void 0&&($t=Dt(),Bt.data.set(Dt,$t)),$t},cacheSignal:function(){return co(Eo).controller.signal}},ag=typeof WeakMap=="function"?WeakMap:Map,So=0,Jo=null,no=null,oo=0,No=0,sc=null,jc=!1,hu=!1,Cf=!1,Pc=0,Na=0,Hc=0,su=0,Ff=0,oc=0,pu=0,Ou=null,Xl=null,wf=!1,fd=0,Op=0,hd=1/0,pd=null,Wc=null,ol=0,Vc=null,gu=null,Lc=0,Sf=0,Df=null,Pp=null,Pu=0,Tf=null;function ac(){return(So&2)!==0&&oo!==0?oo&-oo:Zt.T!==null?Pf():_i()}function Lp(){if(oc===0)if((oo&536870912)===0||Fn){var Dt=yr;yr<<=1,(yr&3932160)===0&&(yr=262144),oc=Dt}else oc=536870912;return Dt=rc.current,Dt!==null&&(Dt.flags|=32),oc}function Kl(Dt,Bt,$t){(Dt===Jo&&(No===2||No===9)||Dt.cancelPendingCommit!==null)&&(mu(Dt,0),Gc(Dt,oo,oc,!1)),ii(Dt,$t),((So&2)===0||Dt!==Jo)&&(Dt===Jo&&((So&2)===0&&(su|=$t),Na===4&&Gc(Dt,oo,oc,!1)),Fc(Dt))}function kp(Dt,Bt,$t){if((So&6)!==0)throw Error(vt(327));var Yt=!$t&&(Bt&127)===0&&(Bt&Dt.expiredLanes)===0||hr(Dt,Bt),an=Yt?ug(Dt,Bt):Bf(Dt,Bt,!0),un=Yt;do{if(an===0){hu&&!Yt&&Gc(Dt,Bt,0,!1);break}else{if($t=Dt.current.alternate,un&&!lg($t)){an=Bf(Dt,Bt,!1),un=!1;continue}if(an===2){if(un=Bt,Dt.errorRecoveryDisabledLanes&un)var bn=0;else bn=Dt.pendingLanes&-536870913,bn=bn!==0?bn:bn&536870912?536870912:0;if(bn!==0){Bt=bn;e:{var qn=Dt;an=Ou;var Sr=qn.current.memoizedState.isDehydrated;if(Sr&&(mu(qn,bn).flags|=256),bn=Bf(qn,bn,!1),bn!==2){if(Cf&&!Sr){qn.errorRecoveryDisabledLanes|=un,su|=un,an=4;break e}un=Xl,Xl=an,un!==null&&(Xl===null?Xl=un:Xl.push.apply(Xl,un))}an=bn}if(un=!1,an!==2)continue}}if(an===1){mu(Dt,0),Gc(Dt,Bt,0,!0);break}e:{switch(Yt=Dt,un=an,un){case 0:case 1:throw Error(vt(345));case 4:if((Bt&4194048)!==Bt)break;case 6:Gc(Yt,Bt,oc,!jc);break e;case 2:Xl=null;break;case 3:case 5:break;default:throw Error(vt(329))}if((Bt&62914560)===Bt&&(an=fd+300-Dr(),10<an)){if(Gc(Yt,Bt,oc,!jc),Ar(Yt,0,!0)!==0)break e;Lc=Bt,Yt.timeoutHandle=p0(Np.bind(null,Yt,$t,Xl,pd,wf,Bt,oc,su,pu,jc,un,"Throttled",-0,0),an);break e}Np(Yt,$t,Xl,pd,wf,Bt,oc,su,pu,jc,un,null,-0,0)}}break}while(!0);Fc(Dt)}function Np(Dt,Bt,$t,Yt,an,un,bn,qn,Sr,Jr,ui,gi,ni,oi){if(Dt.timeoutHandle=-1,gi=Bt.subtreeFlags,gi&8192||(gi&16785408)===16785408){gi={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$o},Rp(Bt,un,gi);var Ji=(un&62914560)===un?fd-Dr():(un&4194048)===un?Op-Dr():0;if(Ji=Gg(gi,Ji),Ji!==null){Lc=un,Dt.cancelPendingCommit=Ji(Gp.bind(null,Dt,Bt,un,$t,Yt,an,bn,qn,Sr,ui,gi,null,ni,oi)),Gc(Dt,un,bn,!Jr);return}}Gp(Dt,Bt,un,$t,Yt,an,bn,qn,Sr)}function lg(Dt){for(var Bt=Dt;;){var $t=Bt.tag;if(($t===0||$t===11||$t===15)&&Bt.flags&16384&&($t=Bt.updateQueue,$t!==null&&($t=$t.stores,$t!==null)))for(var Yt=0;Yt<$t.length;Yt++){var an=$t[Yt],un=an.getSnapshot;an=an.value;try{if(!Ys(un(),an))return!1}catch{return!1}}if($t=Bt.child,Bt.subtreeFlags&16384&&$t!==null)$t.return=Bt,Bt=$t;else{if(Bt===Dt)break;for(;Bt.sibling===null;){if(Bt.return===null||Bt.return===Dt)return!0;Bt=Bt.return}Bt.sibling.return=Bt.return,Bt=Bt.sibling}}return!0}function Gc(Dt,Bt,$t,Yt){Bt&=~Ff,Bt&=~su,Dt.suspendedLanes|=Bt,Dt.pingedLanes&=~Bt,Yt&&(Dt.warmLanes|=Bt),Yt=Dt.expirationTimes;for(var an=Bt;0<an;){var un=31-Xn(an),bn=1<<un;Yt[un]=-1,an&=~bn}$t!==0&&di(Dt,$t,Bt)}function gd(){return(So&6)===0?(Lu(0),!1):!0}function Rf(){if(no!==null){if(No===0)var Dt=no.return;else Dt=no,Vs=ns=null,Vd(Dt),Qr=null,os=0,Dt=no;for(;Dt!==null;)gp(Dt.alternate,Dt),Dt=Dt.return;no=null}}function mu(Dt,Bt){var $t=Dt.timeoutHandle;$t!==-1&&(Dt.timeoutHandle=-1,Dg($t)),$t=Dt.cancelPendingCommit,$t!==null&&(Dt.cancelPendingCommit=null,$t()),Lc=0,Rf(),Jo=Dt,no=$t=ra(Dt.current,null),oo=Bt,No=0,sc=null,jc=!1,hu=hr(Dt,Bt),Cf=!1,pu=oc=Ff=su=Hc=Na=0,Xl=Ou=null,wf=!1,(Bt&8)!==0&&(Bt|=Bt&32);var Yt=Dt.entangledLanes;if(Yt!==0)for(Dt=Dt.entanglements,Yt&=Bt;0<Yt;){var an=31-Xn(Yt),un=1<<an;Bt|=Dt[an],Yt&=~un}return Pc=Bt,Di(),$t}function zp(Dt,Bt){Us=null,Zt.H=wu,Bt===Yn||Bt===lr?(Bt=eo(),No=3):Bt===ur?(Bt=eo(),No=4):No=Bt===lf?8:Bt!==null&&typeof Bt=="object"&&typeof Bt.then=="function"?6:1,sc=Bt,no===null&&(Na=1,id(Dt,Xo(Bt,Dt.current)))}function Up(){var Dt=rc.current;return Dt===null?!0:(oo&4194048)===oo?pc===null:(oo&62914560)===oo||(oo&536870912)!==0?Dt===pc:!1}function $p(){var Dt=Zt.H;return Zt.H=wu,Dt===null?wu:Dt}function jp(){var Dt=Zt.A;return Zt.A=og,Dt}function md(){Na=4,jc||(oo&4194048)!==oo&&rc.current!==null||(hu=!0),(Hc&134217727)===0&&(su&134217727)===0||Jo===null||Gc(Jo,oo,oc,!1)}function Bf(Dt,Bt,$t){var Yt=So;So|=2;var an=$p(),un=jp();(Jo!==Dt||oo!==Bt)&&(pd=null,mu(Dt,Bt)),Bt=!1;var bn=Na;e:do try{if(No!==0&&no!==null){var qn=no,Sr=sc;switch(No){case 8:Rf(),bn=6;break e;case 3:case 2:case 9:case 6:rc.current===null&&(Bt=!0);var Jr=No;if(No=0,sc=null,Eu(Dt,qn,Sr,Jr),$t&&hu){bn=0;break e}break;default:Jr=No,No=0,sc=null,Eu(Dt,qn,Sr,Jr)}}cg(),bn=Na;break}catch(ui){zp(Dt,ui)}while(!0);return Bt&&Dt.shellSuspendCounter++,Vs=ns=null,So=Yt,Zt.H=an,Zt.A=un,no===null&&(Jo=null,oo=0,Di()),bn}function cg(){for(;no!==null;)Hp(no)}function ug(Dt,Bt){var $t=So;So|=2;var Yt=$p(),an=jp();Jo!==Dt||oo!==Bt?(pd=null,hd=Dr()+500,mu(Dt,Bt)):hu=hr(Dt,Bt);e:do try{if(No!==0&&no!==null){Bt=no;var un=sc;t:switch(No){case 1:No=0,sc=null,Eu(Dt,Bt,un,1);break;case 2:case 9:if(zr(un)){No=0,sc=null,Wp(Bt);break}Bt=function(){No!==2&&No!==9||Jo!==Dt||(No=7),Fc(Dt)},un.then(Bt,Bt);break e;case 3:No=7;break e;case 4:No=5;break e;case 7:zr(un)?(No=0,sc=null,Wp(Bt)):(No=0,sc=null,Eu(Dt,Bt,un,7));break;case 5:var bn=null;switch(no.tag){case 26:bn=no.memoizedState;case 5:case 27:var qn=no;if(bn?T0(bn):qn.stateNode.complete){No=0,sc=null;var Sr=qn.sibling;if(Sr!==null)no=Sr;else{var Jr=qn.return;Jr!==null?(no=Jr,Ed(Jr)):no=null}break t}}No=0,sc=null,Eu(Dt,Bt,un,5);break;case 6:No=0,sc=null,Eu(Dt,Bt,un,6);break;case 8:Rf(),Na=6;break e;default:throw Error(vt(462))}}dg();break}catch(ui){zp(Dt,ui)}while(!0);return Vs=ns=null,Zt.H=Yt,Zt.A=an,So=$t,no!==null?0:(Jo=null,oo=0,Di(),Na)}function dg(){for(;no!==null&&!wr();)Hp(no)}function Hp(Dt){var Bt=hp(Dt.alternate,Dt,Pc);Dt.memoizedProps=Dt.pendingProps,Bt===null?Ed(Dt):no=Bt}function Wp(Dt){var Bt=Dt,$t=Bt.alternate;switch(Bt.tag){case 15:case 0:Bt=ap($t,Bt,Bt.pendingProps,Bt.type,void 0,oo);break;case 11:Bt=ap($t,Bt,Bt.pendingProps,Bt.type.render,Bt.ref,oo);break;case 5:Vd(Bt);default:gp($t,Bt),Bt=no=Qs(Bt,Pc),Bt=hp($t,Bt,Pc)}Dt.memoizedProps=Dt.pendingProps,Bt===null?Ed(Dt):no=Bt}function Eu(Dt,Bt,$t,Yt){Vs=ns=null,Vd(Bt),Qr=null,os=0;var an=Bt.return;try{if(J0(Dt,an,Bt,$t,oo)){Na=1,id(Dt,Xo($t,Dt.current)),no=null;return}}catch(un){if(an!==null)throw no=an,un;Na=1,id(Dt,Xo($t,Dt.current)),no=null;return}Bt.flags&32768?(Fn||Yt===1?Dt=!0:hu||(oo&536870912)!==0?Dt=!1:(jc=Dt=!0,(Yt===2||Yt===9||Yt===3||Yt===6)&&(Yt=rc.current,Yt!==null&&Yt.tag===13&&(Yt.flags|=16384))),Vp(Bt,Dt)):Ed(Bt)}function Ed(Dt){var Bt=Dt;do{if((Bt.flags&32768)!==0){Vp(Bt,jc);return}Dt=Bt.return;var $t=ng(Bt.alternate,Bt,Pc);if($t!==null){no=$t;return}if(Bt=Bt.sibling,Bt!==null){no=Bt;return}no=Bt=Dt}while(Bt!==null);Na===0&&(Na=5)}function Vp(Dt,Bt){do{var $t=rg(Dt.alternate,Dt);if($t!==null){$t.flags&=32767,no=$t;return}if($t=Dt.return,$t!==null&&($t.flags|=32768,$t.subtreeFlags=0,$t.deletions=null),!Bt&&(Dt=Dt.sibling,Dt!==null)){no=Dt;return}no=Dt=$t}while(Dt!==null);Na=6,no=null}function Gp(Dt,Bt,$t,Yt,an,un,bn,qn,Sr){Dt.cancelPendingCommit=null;do yd();while(ol!==0);if((So&6)!==0)throw Error(vt(327));if(Bt!==null){if(Bt===Dt.current)throw Error(vt(177));if(un=Bt.lanes|Bt.childLanes,un|=Ei,ti(Dt,$t,un,bn,qn,Sr),Dt===Jo&&(no=Jo=null,oo=0),gu=Bt,Vc=Dt,Lc=$t,Sf=un,Df=an,Pp=Yt,(Bt.subtreeFlags&10256)!==0||(Bt.flags&10256)!==0?(Dt.callbackNode=null,Dt.callbackPriority=0,gg(Bn,function(){return Zp(),null})):(Dt.callbackNode=null,Dt.callbackPriority=0),Yt=(Bt.flags&13878)!==0,(Bt.subtreeFlags&13878)!==0||Yt){Yt=Zt.T,Zt.T=null,an=nn.p,nn.p=2,bn=So,So|=4;try{ig(Dt,Bt,$t)}finally{So=bn,nn.p=an,Zt.T=Yt}}ol=1,qp(),Yp(),Xp()}}function qp(){if(ol===1){ol=0;var Dt=Vc,Bt=gu,$t=(Bt.flags&13878)!==0;if((Bt.subtreeFlags&13878)!==0||$t){$t=Zt.T,Zt.T=null;var Yt=nn.p;nn.p=2;var an=So;So|=4;try{Sp(Bt,Dt);var un=Hf,bn=Bl(Dt.containerInfo),qn=un.focusedElem,Sr=un.selectionRange;if(bn!==qn&&qn&&qn.ownerDocument&&il(qn.ownerDocument.documentElement,qn)){if(Sr!==null&&sl(qn)){var Jr=Sr.start,ui=Sr.end;if(ui===void 0&&(ui=Jr),"selectionStart"in qn)qn.selectionStart=Jr,qn.selectionEnd=Math.min(ui,qn.value.length);else{var gi=qn.ownerDocument||document,ni=gi&&gi.defaultView||window;if(ni.getSelection){var oi=ni.getSelection(),Ji=qn.textContent.length,_s=Math.min(Sr.start,Ji),Go=Sr.end===void 0?_s:Math.min(Sr.end,Ji);!oi.extend&&_s>Go&&(bn=Go,Go=_s,_s=bn);var jr=fc(qn,_s),Lr=fc(qn,Go);if(jr&&Lr&&(oi.rangeCount!==1||oi.anchorNode!==jr.node||oi.anchorOffset!==jr.offset||oi.focusNode!==Lr.node||oi.focusOffset!==Lr.offset)){var Zr=gi.createRange();Zr.setStart(jr.node,jr.offset),oi.removeAllRanges(),_s>Go?(oi.addRange(Zr),oi.extend(Lr.node,Lr.offset)):(Zr.setEnd(Lr.node,Lr.offset),oi.addRange(Zr))}}}}for(gi=[],oi=qn;oi=oi.parentNode;)oi.nodeType===1&&gi.push({element:oi,left:oi.scrollLeft,top:oi.scrollTop});for(typeof qn.focus=="function"&&qn.focus(),qn=0;qn<gi.length;qn++){var fi=gi[qn];fi.element.scrollLeft=fi.left,fi.element.scrollTop=fi.top}}Rd=!!jf,Hf=jf=null}finally{So=an,nn.p=Yt,Zt.T=$t}}Dt.current=Bt,ol=2}}function Yp(){if(ol===2){ol=0;var Dt=Vc,Bt=gu,$t=(Bt.flags&8772)!==0;if((Bt.subtreeFlags&8772)!==0||$t){$t=Zt.T,Zt.T=null;var Yt=nn.p;nn.p=2;var an=So;So|=4;try{bp(Dt,Bt.alternate,Bt)}finally{So=an,nn.p=Yt,Zt.T=$t}}ol=3}}function Xp(){if(ol===4||ol===3){ol=0,xr();var Dt=Vc,Bt=gu,$t=Lc,Yt=Pp;(Bt.subtreeFlags&10256)!==0||(Bt.flags&10256)!==0?ol=5:(ol=0,gu=Vc=null,Kp(Dt,Dt.pendingLanes));var an=Dt.pendingLanes;if(an===0&&(Wc=null),Xi($t),Bt=Bt.stateNode,gn&&typeof gn.onCommitFiberRoot=="function")try{gn.onCommitFiberRoot(cr,Bt,void 0,(Bt.current.flags&128)===128)}catch{}if(Yt!==null){Bt=Zt.T,an=nn.p,nn.p=2,Zt.T=null;try{for(var un=Dt.onRecoverableError,bn=0;bn<Yt.length;bn++){var qn=Yt[bn];un(qn.value,{componentStack:qn.stack})}}finally{Zt.T=Bt,nn.p=an}}(Lc&3)!==0&&yd(),Fc(Dt),an=Dt.pendingLanes,($t&261930)!==0&&(an&42)!==0?Dt===Tf?Pu++:(Pu=0,Tf=Dt):Pu=0,Lu(0)}}function Kp(Dt,Bt){(Dt.pooledCacheLanes&=Bt)===0&&(Bt=Dt.pooledCache,Bt!=null&&(Dt.pooledCache=null,hc(Bt)))}function yd(){return qp(),Yp(),Xp(),Zp()}function Zp(){if(ol!==5)return!1;var Dt=Vc,Bt=Sf;Sf=0;var $t=Xi(Lc),Yt=Zt.T,an=nn.p;try{nn.p=32>$t?32:$t,Zt.T=null,$t=Df,Df=null;var un=Vc,bn=Lc;if(ol=0,gu=Vc=null,Lc=0,(So&6)!==0)throw Error(vt(331));var qn=So;if(So|=4,Mp(un.current),Tp(un,un.current,bn,$t),So=qn,Lu(0,!1),gn&&typeof gn.onPostCommitFiberRoot=="function")try{gn.onPostCommitFiberRoot(cr,un)}catch{}return!0}finally{nn.p=an,Zt.T=Yt,Kp(Dt,Bt)}}function Qp(Dt,Bt,$t){Bt=Xo($t,Bt),Bt=af(Dt.stateNode,Bt,2),Dt=Gr(Dt,Bt,2),Dt!==null&&(ii(Dt,2),Fc(Dt))}function zo(Dt,Bt,$t){if(Dt.tag===3)Qp(Dt,Dt,$t);else for(;Bt!==null;){if(Bt.tag===3){Qp(Bt,Dt,$t);break}else if(Bt.tag===1){var Yt=Bt.stateNode;if(typeof Bt.type.getDerivedStateFromError=="function"||typeof Yt.componentDidCatch=="function"&&(Wc===null||!Wc.has(Yt))){Dt=Xo($t,Dt),$t=Jh(2),Yt=Gr(Bt,$t,2),Yt!==null&&(ep($t,Yt,Bt,Dt),ii(Yt,2),Fc(Yt));break}}Bt=Bt.return}}function Mf(Dt,Bt,$t){var Yt=Dt.pingCache;if(Yt===null){Yt=Dt.pingCache=new ag;var an=new Set;Yt.set(Bt,an)}else an=Yt.get(Bt),an===void 0&&(an=new Set,Yt.set(Bt,an));an.has($t)||(Cf=!0,an.add($t),Dt=fg.bind(null,Dt,Bt,$t),Bt.then(Dt,Dt))}function fg(Dt,Bt,$t){var Yt=Dt.pingCache;Yt!==null&&Yt.delete(Bt),Dt.pingedLanes|=Dt.suspendedLanes&$t,Dt.warmLanes&=~$t,Jo===Dt&&(oo&$t)===$t&&(Na===4||Na===3&&(oo&62914560)===oo&&300>Dr()-fd?(So&2)===0&&mu(Dt,0):Ff|=$t,pu===oo&&(pu=0)),Fc(Dt)}function Jp(Dt,Bt){Bt===0&&(Bt=nr()),Dt=Qi(Dt,Bt),Dt!==null&&(ii(Dt,Bt),Fc(Dt))}function hg(Dt){var Bt=Dt.memoizedState,$t=0;Bt!==null&&($t=Bt.retryLane),Jp(Dt,$t)}function pg(Dt,Bt){var $t=0;switch(Dt.tag){case 31:case 13:var Yt=Dt.stateNode,an=Dt.memoizedState;an!==null&&($t=an.retryLane);break;case 19:Yt=Dt.stateNode;break;case 22:Yt=Dt.stateNode._retryCache;break;default:throw Error(vt(314))}Yt!==null&&Yt.delete(Bt),Jp(Dt,$t)}function gg(Dt,Bt){return _r(Dt,Bt)}var _d=null,yu=null,If=!1,xd=!1,Of=!1,qc=0;function Fc(Dt){Dt!==yu&&Dt.next===null&&(yu===null?_d=yu=Dt:yu=yu.next=Dt),xd=!0,If||(If=!0,Eg())}function Lu(Dt,Bt){if(!Of&&xd){Of=!0;do for(var $t=!1,Yt=_d;Yt!==null;){if(Dt!==0){var an=Yt.pendingLanes;if(an===0)var un=0;else{var bn=Yt.suspendedLanes,qn=Yt.pingedLanes;un=(1<<31-Xn(42|Dt)+1)-1,un&=an&~(bn&~qn),un=un&201326741?un&201326741|1:un?un|2:0}un!==0&&($t=!0,r0(Yt,un))}else un=oo,un=Ar(Yt,Yt===Jo?un:0,Yt.cancelPendingCommit!==null||Yt.timeoutHandle!==-1),(un&3)===0||hr(Yt,un)||($t=!0,r0(Yt,un));Yt=Yt.next}while($t);Of=!1}}function mg(){e0()}function e0(){xd=If=!1;var Dt=0;qc!==0&&Sg()&&(Dt=qc);for(var Bt=Dr(),$t=null,Yt=_d;Yt!==null;){var an=Yt.next,un=t0(Yt,Bt);un===0?(Yt.next=null,$t===null?_d=an:$t.next=an,an===null&&(yu=$t)):($t=Yt,(Dt!==0||(un&3)!==0)&&(xd=!0)),Yt=an}ol!==0&&ol!==5||Lu(Dt),qc!==0&&(qc=0)}function t0(Dt,Bt){for(var $t=Dt.suspendedLanes,Yt=Dt.pingedLanes,an=Dt.expirationTimes,un=Dt.pendingLanes&-62914561;0<un;){var bn=31-Xn(un),qn=1<<bn,Sr=an[bn];Sr===-1?((qn&$t)===0||(qn&Yt)!==0)&&(an[bn]=An(qn,Bt)):Sr<=Bt&&(Dt.expiredLanes|=qn),un&=~qn}if(Bt=Jo,$t=oo,$t=Ar(Dt,Dt===Bt?$t:0,Dt.cancelPendingCommit!==null||Dt.timeoutHandle!==-1),Yt=Dt.callbackNode,$t===0||Dt===Bt&&(No===2||No===9)||Dt.cancelPendingCommit!==null)return Yt!==null&&Yt!==null&&pr(Yt),Dt.callbackNode=null,Dt.callbackPriority=0;if(($t&3)===0||hr(Dt,$t)){if(Bt=$t&-$t,Bt===Dt.callbackPriority)return Bt;switch(Yt!==null&&pr(Yt),Xi($t)){case 2:case 8:$t=Cn;break;case 32:$t=Bn;break;case 268435456:$t=or;break;default:$t=Bn}return Yt=n0.bind(null,Dt),$t=_r($t,Yt),Dt.callbackPriority=Bt,Dt.callbackNode=$t,Bt}return Yt!==null&&Yt!==null&&pr(Yt),Dt.callbackPriority=2,Dt.callbackNode=null,2}function n0(Dt,Bt){if(ol!==0&&ol!==5)return Dt.callbackNode=null,Dt.callbackPriority=0,null;var $t=Dt.callbackNode;if(yd()&&Dt.callbackNode!==$t)return null;var Yt=oo;return Yt=Ar(Dt,Dt===Jo?Yt:0,Dt.cancelPendingCommit!==null||Dt.timeoutHandle!==-1),Yt===0?null:(kp(Dt,Yt,Bt),t0(Dt,Dr()),Dt.callbackNode!=null&&Dt.callbackNode===$t?n0.bind(null,Dt):null)}function r0(Dt,Bt){if(yd())return null;kp(Dt,Bt,!0)}function Eg(){Tg(function(){(So&6)!==0?_r(Qn,mg):e0()})}function Pf(){if(qc===0){var Dt=ml;Dt===0&&(Dt=_n,_n<<=1,(_n&261888)===0&&(_n=256)),qc=Dt}return qc}function i0(Dt){return Dt==null||typeof Dt=="symbol"||typeof Dt=="boolean"?null:typeof Dt=="function"?Dt:bs(""+Dt)}function s0(Dt,Bt){var $t=Bt.ownerDocument.createElement("input");return $t.name=Bt.name,$t.value=Bt.value,Dt.id&&$t.setAttribute("form",Dt.id),Bt.parentNode.insertBefore($t,Bt),Dt=new FormData(Dt),$t.parentNode.removeChild($t),Dt}function yg(Dt,Bt,$t,Yt,an){if(Bt==="submit"&&$t&&$t.stateNode===an){var un=i0((an[wi]||null).action),bn=Yt.submitter;bn&&(Bt=(Bt=bn[wi]||null)?i0(Bt.formAction):bn.getAttribute("formAction"),Bt!==null&&(un=Bt,bn=null));var qn=new pi("action","action",null,Yt,an);Dt.push({event:qn,listeners:[{instance:null,listener:function(){if(Yt.defaultPrevented){if(qc!==0){var Sr=bn?s0(an,bn):new FormData(an);ef($t,{pending:!0,data:Sr,method:an.method,action:un},null,Sr)}}else typeof un=="function"&&(qn.preventDefault(),Sr=bn?s0(an,bn):new FormData(an),ef($t,{pending:!0,data:Sr,method:an.method,action:un},un,Sr))},currentTarget:an}]})}}for(var Lf=0;Lf<Wr.length;Lf++){var kf=Wr[Lf],_g=kf.toLowerCase(),xg=kf[0].toUpperCase()+kf.slice(1);$r(_g,"on"+xg)}$r(Pn,"onAnimationEnd"),$r(Zn,"onAnimationIteration"),$r(sr,"onAnimationStart"),$r("dblclick","onDoubleClick"),$r("focusin","onFocus"),$r("focusout","onBlur"),$r(fr,"onTransitionRun"),$r(mr,"onTransitionStart"),$r(Pr,"onTransitionCancel"),$r(Ur,"onTransitionEnd"),aa("onMouseEnter",["mouseout","mouseover"]),aa("onMouseLeave",["mouseout","mouseover"]),aa("onPointerEnter",["pointerout","pointerover"]),aa("onPointerLeave",["pointerout","pointerover"]),oa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),oa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),oa("onBeforeInput",["compositionend","keypress","textInput","paste"]),oa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ku="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),vg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ku));function o0(Dt,Bt){Bt=(Bt&4)!==0;for(var $t=0;$t<Dt.length;$t++){var Yt=Dt[$t],an=Yt.event;Yt=Yt.listeners;e:{var un=void 0;if(Bt)for(var bn=Yt.length-1;0<=bn;bn--){var qn=Yt[bn],Sr=qn.instance,Jr=qn.currentTarget;if(qn=qn.listener,Sr!==un&&an.isPropagationStopped())break e;un=qn,an.currentTarget=Jr;try{un(an)}catch(ui){qr(ui)}an.currentTarget=null,un=Sr}else for(bn=0;bn<Yt.length;bn++){if(qn=Yt[bn],Sr=qn.instance,Jr=qn.currentTarget,qn=qn.listener,Sr!==un&&an.isPropagationStopped())break e;un=qn,an.currentTarget=Jr;try{un(an)}catch(ui){qr(ui)}an.currentTarget=null,un=Sr}}}}function ro(Dt,Bt){var $t=Bt[qi];$t===void 0&&($t=Bt[qi]=new Set);var Yt=Dt+"__bubble";$t.has(Yt)||(a0(Bt,Dt,2,!1),$t.add(Yt))}function Nf(Dt,Bt,$t){var Yt=0;Bt&&(Yt|=4),a0($t,Dt,Yt,Bt)}var vd="_reactListening"+Math.random().toString(36).slice(2);function zf(Dt){if(!Dt[vd]){Dt[vd]=!0,Fa.forEach(function($t){$t!=="selectionchange"&&(vg.has($t)||Nf($t,!1,Dt),Nf($t,!0,Dt))});var Bt=Dt.nodeType===9?Dt:Dt.ownerDocument;Bt===null||Bt[vd]||(Bt[vd]=!0,Nf("selectionchange",!1,Bt))}}function a0(Dt,Bt,$t,Yt){switch(L0(Bt)){case 2:var an=Xg;break;case 8:an=Kg;break;default:an=eh}$t=an.bind(null,Bt,$t,Dt),an=void 0,!Ea||Bt!=="touchstart"&&Bt!=="touchmove"&&Bt!=="wheel"||(an=!0),Yt?an!==void 0?Dt.addEventListener(Bt,$t,{capture:!0,passive:an}):Dt.addEventListener(Bt,$t,!0):an!==void 0?Dt.addEventListener(Bt,$t,{passive:an}):Dt.addEventListener(Bt,$t,!1)}function Uf(Dt,Bt,$t,Yt,an){var un=Yt;if((Bt&1)===0&&(Bt&2)===0&&Yt!==null)e:for(;;){if(Yt===null)return;var bn=Yt.tag;if(bn===3||bn===4){var qn=Yt.stateNode.containerInfo;if(qn===an)break;if(bn===4)for(bn=Yt.return;bn!==null;){var Sr=bn.tag;if((Sr===3||Sr===4)&&bn.stateNode.containerInfo===an)return;bn=bn.return}for(;qn!==null;){if(bn=Is(qn),bn===null)return;if(Sr=bn.tag,Sr===5||Sr===6||Sr===26||Sr===27){Yt=un=bn;continue e}qn=qn.parentNode}}Yt=Yt.return}$l(function(){var Jr=un,ui=qo($t),gi=[];e:{var ni=Rr.get(Dt);if(ni!==void 0){var oi=pi,Ji=Dt;switch(Dt){case"keypress":if(tl($t)===0)break e;case"keydown":case"keyup":oi=cl;break;case"focusin":Ji="focus",oi=ms;break;case"focusout":Ji="blur",oi=ms;break;case"beforeblur":case"afterblur":oi=ms;break;case"click":if($t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oi=hs;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oi=vo;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oi=nl;break;case Pn:case Zn:case sr:oi=Ui;break;case Ur:oi=Ls;break;case"scroll":case"scrollend":oi=Zi;break;case"wheel":oi=jl;break;case"copy":case"cut":case"paste":oi=Ws;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oi=Po;break;case"toggle":case"beforetoggle":oi=hi}var _s=(Bt&4)!==0,Go=!_s&&(Dt==="scroll"||Dt==="scrollend"),jr=_s?ni!==null?ni+"Capture":null:ni;_s=[];for(var Lr=Jr,Zr;Lr!==null;){var fi=Lr;if(Zr=fi.stateNode,fi=fi.tag,fi!==5&&fi!==26&&fi!==27||Zr===null||jr===null||(fi=Ts(Lr,jr),fi!=null&&_s.push(Nu(Lr,fi,Zr))),Go)break;Lr=Lr.return}0<_s.length&&(ni=new oi(ni,Ji,null,$t,ui),gi.push({event:ni,listeners:_s}))}}if((Bt&7)===0){e:{if(ni=Dt==="mouseover"||Dt==="pointerover",oi=Dt==="mouseout"||Dt==="pointerout",ni&&$t!==al&&(Ji=$t.relatedTarget||$t.fromElement)&&(Is(Ji)||Ji[vi]))break e;if((oi||ni)&&(ni=ui.window===ui?ui:(ni=ui.ownerDocument)?ni.defaultView||ni.parentWindow:window,oi?(Ji=$t.relatedTarget||$t.toElement,oi=Jr,Ji=Ji?Is(Ji):null,Ji!==null&&(Go=At(Ji),_s=Ji.tag,Ji!==Go||_s!==5&&_s!==27&&_s!==6)&&(Ji=null)):(oi=null,Ji=Jr),oi!==Ji)){if(_s=hs,fi="onMouseLeave",jr="onMouseEnter",Lr="mouse",(Dt==="pointerout"||Dt==="pointerover")&&(_s=Po,fi="onPointerLeave",jr="onPointerEnter",Lr="pointer"),Go=oi==null?ni:ws(oi),Zr=Ji==null?ni:ws(Ji),ni=new _s(fi,Lr+"leave",oi,$t,ui),ni.target=Go,ni.relatedTarget=Zr,fi=null,Is(ui)===Jr&&(_s=new _s(jr,Lr+"enter",Ji,$t,ui),_s.target=Zr,_s.relatedTarget=Go,fi=_s),Go=fi,oi&&Ji)t:{for(_s=bg,jr=oi,Lr=Ji,Zr=0,fi=jr;fi;fi=_s(fi))Zr++;fi=0;for(var ps=Lr;ps;ps=_s(ps))fi++;for(;0<Zr-fi;)jr=_s(jr),Zr--;for(;0<fi-Zr;)Lr=_s(Lr),fi--;for(;Zr--;){if(jr===Lr||Lr!==null&&jr===Lr.alternate){_s=jr;break t}jr=_s(jr),Lr=_s(Lr)}_s=null}else _s=null;oi!==null&&l0(gi,ni,oi,_s,!1),Ji!==null&&Go!==null&&l0(gi,Go,Ji,_s,!0)}}e:{if(ni=Jr?ws(Jr):window,oi=ni.nodeName&&ni.nodeName.toLowerCase(),oi==="select"||oi==="input"&&ni.type==="file")var Ao=uc;else if(Dl(ni))if(Xa)Ao=kl;else{Ao=Ma;var is=Rl}else oi=ni.nodeName,!oi||oi.toLowerCase()!=="input"||ni.type!=="checkbox"&&ni.type!=="radio"?Jr&&Uo(Jr.elementType)&&(Ao=uc):Ao=kr;if(Ao&&(Ao=Ao(Dt,Jr))){Ql(gi,Ao,$t,ui);break e}is&&is(Dt,ni,Jr),Dt==="focusout"&&Jr&&ni.type==="number"&&Jr.memoizedProps.value!=null&&Sa(ni,"number",ni.value)}switch(is=Jr?ws(Jr):window,Dt){case"focusin":(Dl(is)||is.contentEditable==="true")&&(Ml=is,Hl=Jr,ko=null);break;case"focusout":ko=Hl=Ml=null;break;case"mousedown":Zs=!0;break;case"contextmenu":case"mouseup":case"dragend":Zs=!1,En(gi,$t,ui);break;case"selectionchange":if(Nl)break;case"keydown":case"keyup":En(gi,$t,ui)}var Gs;if(Li)e:{switch(Dt){case"compositionstart":var ao="onCompositionStart";break e;case"compositionend":ao="onCompositionEnd";break e;case"compositionupdate":ao="onCompositionUpdate";break e}ao=void 0}else Sl?ul(Dt,$t)&&(ao="onCompositionEnd"):Dt==="keydown"&&$t.keyCode===229&&(ao="onCompositionStart");ao&&(Pl&&$t.locale!=="ko"&&(Sl||ao!=="onCompositionStart"?ao==="onCompositionEnd"&&Sl&&(Gs=el()):(gs=ui,Ra="value"in gs?gs.value:gs.textContent,Sl=!0)),is=bd(Jr,ao),0<is.length&&(ao=new ua(ao,Dt,null,$t,ui),gi.push({event:ao,listeners:is}),Gs?ao.data=Gs:(Gs=Ec($t),Gs!==null&&(ao.data=Gs)))),(Gs=ta?Lo(Dt,$t):cc(Dt,$t))&&(ao=bd(Jr,"onBeforeInput"),0<ao.length&&(is=new ua("onBeforeInput","beforeinput",null,$t,ui),gi.push({event:is,listeners:ao}),is.data=Gs)),yg(gi,Dt,Jr,$t,ui)}o0(gi,Bt)})}function Nu(Dt,Bt,$t){return{instance:Dt,listener:Bt,currentTarget:$t}}function bd(Dt,Bt){for(var $t=Bt+"Capture",Yt=[];Dt!==null;){var an=Dt,un=an.stateNode;if(an=an.tag,an!==5&&an!==26&&an!==27||un===null||(an=Ts(Dt,$t),an!=null&&Yt.unshift(Nu(Dt,an,un)),an=Ts(Dt,Bt),an!=null&&Yt.push(Nu(Dt,an,un))),Dt.tag===3)return Yt;Dt=Dt.return}return[]}function bg(Dt){if(Dt===null)return null;do Dt=Dt.return;while(Dt&&Dt.tag!==5&&Dt.tag!==27);return Dt||null}function l0(Dt,Bt,$t,Yt,an){for(var un=Bt._reactName,bn=[];$t!==null&&$t!==Yt;){var qn=$t,Sr=qn.alternate,Jr=qn.stateNode;if(qn=qn.tag,Sr!==null&&Sr===Yt)break;qn!==5&&qn!==26&&qn!==27||Jr===null||(Sr=Jr,an?(Jr=Ts($t,un),Jr!=null&&bn.unshift(Nu($t,Jr,Sr))):an||(Jr=Ts($t,un),Jr!=null&&bn.push(Nu($t,Jr,Sr)))),$t=$t.return}bn.length!==0&&Dt.push({event:Bt,listeners:bn})}var Ag=/\r\n?/g,Cg=/\u0000|\uFFFD/g;function c0(Dt){return(typeof Dt=="string"?Dt:""+Dt).replace(Ag,`
|
|
9
|
-
`).replace(Cg,"")}function u0(Dt,Bt){return Bt=c0(Bt),c0(Dt)===Bt}function Vo(Dt,Bt,$t,Yt,an,un){switch($t){case"children":typeof Yt=="string"?Bt==="body"||Bt==="textarea"&&Yt===""||wo(Dt,Yt):(typeof Yt=="number"||typeof Yt=="bigint")&&Bt!=="body"&&wo(Dt,""+Yt);break;case"className":Va(Dt,"class",Yt);break;case"tabIndex":Va(Dt,"tabindex",Yt);break;case"dir":case"role":case"viewBox":case"width":case"height":Va(Dt,$t,Yt);break;case"style":za(Dt,Yt,un);break;case"data":if(Bt!=="object"){Va(Dt,"data",Yt);break}case"src":case"href":if(Yt===""&&(Bt!=="a"||$t!=="href")){Dt.removeAttribute($t);break}if(Yt==null||typeof Yt=="function"||typeof Yt=="symbol"||typeof Yt=="boolean"){Dt.removeAttribute($t);break}Yt=bs(""+Yt),Dt.setAttribute($t,Yt);break;case"action":case"formAction":if(typeof Yt=="function"){Dt.setAttribute($t,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof un=="function"&&($t==="formAction"?(Bt!=="input"&&Vo(Dt,Bt,"name",an.name,an,null),Vo(Dt,Bt,"formEncType",an.formEncType,an,null),Vo(Dt,Bt,"formMethod",an.formMethod,an,null),Vo(Dt,Bt,"formTarget",an.formTarget,an,null)):(Vo(Dt,Bt,"encType",an.encType,an,null),Vo(Dt,Bt,"method",an.method,an,null),Vo(Dt,Bt,"target",an.target,an,null)));if(Yt==null||typeof Yt=="symbol"||typeof Yt=="boolean"){Dt.removeAttribute($t);break}Yt=bs(""+Yt),Dt.setAttribute($t,Yt);break;case"onClick":Yt!=null&&(Dt.onclick=$o);break;case"onScroll":Yt!=null&&ro("scroll",Dt);break;case"onScrollEnd":Yt!=null&&ro("scrollend",Dt);break;case"dangerouslySetInnerHTML":if(Yt!=null){if(typeof Yt!="object"||!("__html"in Yt))throw Error(vt(61));if($t=Yt.__html,$t!=null){if(an.children!=null)throw Error(vt(60));Dt.innerHTML=$t}}break;case"multiple":Dt.multiple=Yt&&typeof Yt!="function"&&typeof Yt!="symbol";break;case"muted":Dt.muted=Yt&&typeof Yt!="function"&&typeof Yt!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(Yt==null||typeof Yt=="function"||typeof Yt=="boolean"||typeof Yt=="symbol"){Dt.removeAttribute("xlink:href");break}$t=bs(""+Yt),Dt.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",$t);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":Yt!=null&&typeof Yt!="function"&&typeof Yt!="symbol"?Dt.setAttribute($t,""+Yt):Dt.removeAttribute($t);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":Yt&&typeof Yt!="function"&&typeof Yt!="symbol"?Dt.setAttribute($t,""):Dt.removeAttribute($t);break;case"capture":case"download":Yt===!0?Dt.setAttribute($t,""):Yt!==!1&&Yt!=null&&typeof Yt!="function"&&typeof Yt!="symbol"?Dt.setAttribute($t,Yt):Dt.removeAttribute($t);break;case"cols":case"rows":case"size":case"span":Yt!=null&&typeof Yt!="function"&&typeof Yt!="symbol"&&!isNaN(Yt)&&1<=Yt?Dt.setAttribute($t,Yt):Dt.removeAttribute($t);break;case"rowSpan":case"start":Yt==null||typeof Yt=="function"||typeof Yt=="symbol"||isNaN(Yt)?Dt.removeAttribute($t):Dt.setAttribute($t,Yt);break;case"popover":ro("beforetoggle",Dt),ro("toggle",Dt),ys(Dt,"popover",Yt);break;case"xlinkActuate":io(Dt,"http://www.w3.org/1999/xlink","xlink:actuate",Yt);break;case"xlinkArcrole":io(Dt,"http://www.w3.org/1999/xlink","xlink:arcrole",Yt);break;case"xlinkRole":io(Dt,"http://www.w3.org/1999/xlink","xlink:role",Yt);break;case"xlinkShow":io(Dt,"http://www.w3.org/1999/xlink","xlink:show",Yt);break;case"xlinkTitle":io(Dt,"http://www.w3.org/1999/xlink","xlink:title",Yt);break;case"xlinkType":io(Dt,"http://www.w3.org/1999/xlink","xlink:type",Yt);break;case"xmlBase":io(Dt,"http://www.w3.org/XML/1998/namespace","xml:base",Yt);break;case"xmlLang":io(Dt,"http://www.w3.org/XML/1998/namespace","xml:lang",Yt);break;case"xmlSpace":io(Dt,"http://www.w3.org/XML/1998/namespace","xml:space",Yt);break;case"is":ys(Dt,"is",Yt);break;case"innerText":case"textContent":break;default:(!(2<$t.length)||$t[0]!=="o"&&$t[0]!=="O"||$t[1]!=="n"&&$t[1]!=="N")&&($t=Vi.get($t)||$t,ys(Dt,$t,Yt))}}function $f(Dt,Bt,$t,Yt,an,un){switch($t){case"style":za(Dt,Yt,un);break;case"dangerouslySetInnerHTML":if(Yt!=null){if(typeof Yt!="object"||!("__html"in Yt))throw Error(vt(61));if($t=Yt.__html,$t!=null){if(an.children!=null)throw Error(vt(60));Dt.innerHTML=$t}}break;case"children":typeof Yt=="string"?wo(Dt,Yt):(typeof Yt=="number"||typeof Yt=="bigint")&&wo(Dt,""+Yt);break;case"onScroll":Yt!=null&&ro("scroll",Dt);break;case"onScrollEnd":Yt!=null&&ro("scrollend",Dt);break;case"onClick":Yt!=null&&(Dt.onclick=$o);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ja.hasOwnProperty($t))e:{if($t[0]==="o"&&$t[1]==="n"&&(an=$t.endsWith("Capture"),Bt=$t.slice(2,an?$t.length-7:void 0),un=Dt[wi]||null,un=un!=null?un[$t]:null,typeof un=="function"&&Dt.removeEventListener(Bt,un,an),typeof Yt=="function")){typeof un!="function"&&un!==null&&($t in Dt?Dt[$t]=null:Dt.hasAttribute($t)&&Dt.removeAttribute($t)),Dt.addEventListener(Bt,Yt,an);break e}$t in Dt?Dt[$t]=Yt:Yt===!0?Dt.setAttribute($t,""):ys(Dt,$t,Yt)}}}function Al(Dt,Bt,$t){switch(Bt){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ro("error",Dt),ro("load",Dt);var Yt=!1,an=!1,un;for(un in $t)if($t.hasOwnProperty(un)){var bn=$t[un];if(bn!=null)switch(un){case"src":Yt=!0;break;case"srcSet":an=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(vt(137,Bt));default:Vo(Dt,Bt,un,bn,$t,null)}}an&&Vo(Dt,Bt,"srcSet",$t.srcSet,$t,null),Yt&&Vo(Dt,Bt,"src",$t.src,$t,null);return;case"input":ro("invalid",Dt);var qn=un=bn=an=null,Sr=null,Jr=null;for(Yt in $t)if($t.hasOwnProperty(Yt)){var ui=$t[Yt];if(ui!=null)switch(Yt){case"name":an=ui;break;case"type":bn=ui;break;case"checked":Sr=ui;break;case"defaultChecked":Jr=ui;break;case"value":un=ui;break;case"defaultValue":qn=ui;break;case"children":case"dangerouslySetInnerHTML":if(ui!=null)throw Error(vt(137,Bt));break;default:Vo(Dt,Bt,Yt,ui,$t,null)}}la(Dt,un,qn,Sr,Jr,bn,an,!1);return;case"select":ro("invalid",Dt),Yt=bn=un=null;for(an in $t)if($t.hasOwnProperty(an)&&(qn=$t[an],qn!=null))switch(an){case"value":un=qn;break;case"defaultValue":bn=qn;break;case"multiple":Yt=qn;default:Vo(Dt,Bt,an,qn,$t,null)}Bt=un,$t=bn,Dt.multiple=!!Yt,Bt!=null?Io(Dt,!!Yt,Bt,!1):$t!=null&&Io(Dt,!!Yt,$t,!0);return;case"textarea":ro("invalid",Dt),un=an=Yt=null;for(bn in $t)if($t.hasOwnProperty(bn)&&(qn=$t[bn],qn!=null))switch(bn){case"value":Yt=qn;break;case"defaultValue":an=qn;break;case"children":un=qn;break;case"dangerouslySetInnerHTML":if(qn!=null)throw Error(vt(91));break;default:Vo(Dt,Bt,bn,qn,$t,null)}Ga(Dt,Yt,an,un);return;case"option":for(Sr in $t)$t.hasOwnProperty(Sr)&&(Yt=$t[Sr],Yt!=null)&&(Sr==="selected"?Dt.selected=Yt&&typeof Yt!="function"&&typeof Yt!="symbol":Vo(Dt,Bt,Sr,Yt,$t,null));return;case"dialog":ro("beforetoggle",Dt),ro("toggle",Dt),ro("cancel",Dt),ro("close",Dt);break;case"iframe":case"object":ro("load",Dt);break;case"video":case"audio":for(Yt=0;Yt<ku.length;Yt++)ro(ku[Yt],Dt);break;case"image":ro("error",Dt),ro("load",Dt);break;case"details":ro("toggle",Dt);break;case"embed":case"source":case"link":ro("error",Dt),ro("load",Dt);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Jr in $t)if($t.hasOwnProperty(Jr)&&(Yt=$t[Jr],Yt!=null))switch(Jr){case"children":case"dangerouslySetInnerHTML":throw Error(vt(137,Bt));default:Vo(Dt,Bt,Jr,Yt,$t,null)}return;default:if(Uo(Bt)){for(ui in $t)$t.hasOwnProperty(ui)&&(Yt=$t[ui],Yt!==void 0&&$f(Dt,Bt,ui,Yt,$t,void 0));return}}for(qn in $t)$t.hasOwnProperty(qn)&&(Yt=$t[qn],Yt!=null&&Vo(Dt,Bt,qn,Yt,$t,null))}function Fg(Dt,Bt,$t,Yt){switch(Bt){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var an=null,un=null,bn=null,qn=null,Sr=null,Jr=null,ui=null;for(oi in $t){var gi=$t[oi];if($t.hasOwnProperty(oi)&&gi!=null)switch(oi){case"checked":break;case"value":break;case"defaultValue":Sr=gi;default:Yt.hasOwnProperty(oi)||Vo(Dt,Bt,oi,null,Yt,gi)}}for(var ni in Yt){var oi=Yt[ni];if(gi=$t[ni],Yt.hasOwnProperty(ni)&&(oi!=null||gi!=null))switch(ni){case"type":un=oi;break;case"name":an=oi;break;case"checked":Jr=oi;break;case"defaultChecked":ui=oi;break;case"value":bn=oi;break;case"defaultValue":qn=oi;break;case"children":case"dangerouslySetInnerHTML":if(oi!=null)throw Error(vt(137,Bt));break;default:oi!==gi&&Vo(Dt,Bt,ni,oi,Yt,gi)}}wa(Dt,bn,qn,Sr,Jr,ui,un,an);return;case"select":oi=bn=qn=ni=null;for(un in $t)if(Sr=$t[un],$t.hasOwnProperty(un)&&Sr!=null)switch(un){case"value":break;case"multiple":oi=Sr;default:Yt.hasOwnProperty(un)||Vo(Dt,Bt,un,null,Yt,Sr)}for(an in Yt)if(un=Yt[an],Sr=$t[an],Yt.hasOwnProperty(an)&&(un!=null||Sr!=null))switch(an){case"value":ni=un;break;case"defaultValue":qn=un;break;case"multiple":bn=un;default:un!==Sr&&Vo(Dt,Bt,an,un,Yt,Sr)}Bt=qn,$t=bn,Yt=oi,ni!=null?Io(Dt,!!$t,ni,!1):!!Yt!=!!$t&&(Bt!=null?Io(Dt,!!$t,Bt,!0):Io(Dt,!!$t,$t?[]:"",!1));return;case"textarea":oi=ni=null;for(qn in $t)if(an=$t[qn],$t.hasOwnProperty(qn)&&an!=null&&!Yt.hasOwnProperty(qn))switch(qn){case"value":break;case"children":break;default:Vo(Dt,Bt,qn,null,Yt,an)}for(bn in Yt)if(an=Yt[bn],un=$t[bn],Yt.hasOwnProperty(bn)&&(an!=null||un!=null))switch(bn){case"value":ni=an;break;case"defaultValue":oi=an;break;case"children":break;case"dangerouslySetInnerHTML":if(an!=null)throw Error(vt(91));break;default:an!==un&&Vo(Dt,Bt,bn,an,Yt,un)}xo(Dt,ni,oi);return;case"option":for(var Ji in $t)ni=$t[Ji],$t.hasOwnProperty(Ji)&&ni!=null&&!Yt.hasOwnProperty(Ji)&&(Ji==="selected"?Dt.selected=!1:Vo(Dt,Bt,Ji,null,Yt,ni));for(Sr in Yt)ni=Yt[Sr],oi=$t[Sr],Yt.hasOwnProperty(Sr)&&ni!==oi&&(ni!=null||oi!=null)&&(Sr==="selected"?Dt.selected=ni&&typeof ni!="function"&&typeof ni!="symbol":Vo(Dt,Bt,Sr,ni,Yt,oi));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _s in $t)ni=$t[_s],$t.hasOwnProperty(_s)&&ni!=null&&!Yt.hasOwnProperty(_s)&&Vo(Dt,Bt,_s,null,Yt,ni);for(Jr in Yt)if(ni=Yt[Jr],oi=$t[Jr],Yt.hasOwnProperty(Jr)&&ni!==oi&&(ni!=null||oi!=null))switch(Jr){case"children":case"dangerouslySetInnerHTML":if(ni!=null)throw Error(vt(137,Bt));break;default:Vo(Dt,Bt,Jr,ni,Yt,oi)}return;default:if(Uo(Bt)){for(var Go in $t)ni=$t[Go],$t.hasOwnProperty(Go)&&ni!==void 0&&!Yt.hasOwnProperty(Go)&&$f(Dt,Bt,Go,void 0,Yt,ni);for(ui in Yt)ni=Yt[ui],oi=$t[ui],!Yt.hasOwnProperty(ui)||ni===oi||ni===void 0&&oi===void 0||$f(Dt,Bt,ui,ni,Yt,oi);return}}for(var jr in $t)ni=$t[jr],$t.hasOwnProperty(jr)&&ni!=null&&!Yt.hasOwnProperty(jr)&&Vo(Dt,Bt,jr,null,Yt,ni);for(gi in Yt)ni=Yt[gi],oi=$t[gi],!Yt.hasOwnProperty(gi)||ni===oi||ni==null&&oi==null||Vo(Dt,Bt,gi,ni,Yt,oi)}function d0(Dt){switch(Dt){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function wg(){if(typeof performance.getEntriesByType=="function"){for(var Dt=0,Bt=0,$t=performance.getEntriesByType("resource"),Yt=0;Yt<$t.length;Yt++){var an=$t[Yt],un=an.transferSize,bn=an.initiatorType,qn=an.duration;if(un&&qn&&d0(bn)){for(bn=0,qn=an.responseEnd,Yt+=1;Yt<$t.length;Yt++){var Sr=$t[Yt],Jr=Sr.startTime;if(Jr>qn)break;var ui=Sr.transferSize,gi=Sr.initiatorType;ui&&d0(gi)&&(Sr=Sr.responseEnd,bn+=ui*(Sr<qn?1:(qn-Jr)/(Sr-Jr)))}if(--Yt,Bt+=8*(un+bn)/(an.duration/1e3),Dt++,10<Dt)break}}if(0<Dt)return Bt/Dt/1e6}return navigator.connection&&(Dt=navigator.connection.downlink,typeof Dt=="number")?Dt:5}var jf=null,Hf=null;function Ad(Dt){return Dt.nodeType===9?Dt:Dt.ownerDocument}function f0(Dt){switch(Dt){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function h0(Dt,Bt){if(Dt===0)switch(Bt){case"svg":return 1;case"math":return 2;default:return 0}return Dt===1&&Bt==="foreignObject"?0:Dt}function Wf(Dt,Bt){return Dt==="textarea"||Dt==="noscript"||typeof Bt.children=="string"||typeof Bt.children=="number"||typeof Bt.children=="bigint"||typeof Bt.dangerouslySetInnerHTML=="object"&&Bt.dangerouslySetInnerHTML!==null&&Bt.dangerouslySetInnerHTML.__html!=null}var Vf=null;function Sg(){var Dt=window.event;return Dt&&Dt.type==="popstate"?Dt===Vf?!1:(Vf=Dt,!0):(Vf=null,!1)}var p0=typeof setTimeout=="function"?setTimeout:void 0,Dg=typeof clearTimeout=="function"?clearTimeout:void 0,g0=typeof Promise=="function"?Promise:void 0,Tg=typeof queueMicrotask=="function"?queueMicrotask:typeof g0<"u"?function(Dt){return g0.resolve(null).then(Dt).catch(Rg)}:p0;function Rg(Dt){setTimeout(function(){throw Dt})}function Yc(Dt){return Dt==="head"}function m0(Dt,Bt){var $t=Bt,Yt=0;do{var an=$t.nextSibling;if(Dt.removeChild($t),an&&an.nodeType===8)if($t=an.data,$t==="/$"||$t==="/&"){if(Yt===0){Dt.removeChild(an),bu(Bt);return}Yt--}else if($t==="$"||$t==="$?"||$t==="$~"||$t==="$!"||$t==="&")Yt++;else if($t==="html")zu(Dt.ownerDocument.documentElement);else if($t==="head"){$t=Dt.ownerDocument.head,zu($t);for(var un=$t.firstChild;un;){var bn=un.nextSibling,qn=un.nodeName;un[xs]||qn==="SCRIPT"||qn==="STYLE"||qn==="LINK"&&un.rel.toLowerCase()==="stylesheet"||$t.removeChild(un),un=bn}}else $t==="body"&&zu(Dt.ownerDocument.body);$t=an}while($t);bu(Bt)}function E0(Dt,Bt){var $t=Dt;Dt=0;do{var Yt=$t.nextSibling;if($t.nodeType===1?Bt?($t._stashedDisplay=$t.style.display,$t.style.display="none"):($t.style.display=$t._stashedDisplay||"",$t.getAttribute("style")===""&&$t.removeAttribute("style")):$t.nodeType===3&&(Bt?($t._stashedText=$t.nodeValue,$t.nodeValue=""):$t.nodeValue=$t._stashedText||""),Yt&&Yt.nodeType===8)if($t=Yt.data,$t==="/$"){if(Dt===0)break;Dt--}else $t!=="$"&&$t!=="$?"&&$t!=="$~"&&$t!=="$!"||Dt++;$t=Yt}while($t)}function Gf(Dt){var Bt=Dt.firstChild;for(Bt&&Bt.nodeType===10&&(Bt=Bt.nextSibling);Bt;){var $t=Bt;switch(Bt=Bt.nextSibling,$t.nodeName){case"HTML":case"HEAD":case"BODY":Gf($t),$s($t);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if($t.rel.toLowerCase()==="stylesheet")continue}Dt.removeChild($t)}}function Bg(Dt,Bt,$t,Yt){for(;Dt.nodeType===1;){var an=$t;if(Dt.nodeName.toLowerCase()!==Bt.toLowerCase()){if(!Yt&&(Dt.nodeName!=="INPUT"||Dt.type!=="hidden"))break}else if(Yt){if(!Dt[xs])switch(Bt){case"meta":if(!Dt.hasAttribute("itemprop"))break;return Dt;case"link":if(un=Dt.getAttribute("rel"),un==="stylesheet"&&Dt.hasAttribute("data-precedence"))break;if(un!==an.rel||Dt.getAttribute("href")!==(an.href==null||an.href===""?null:an.href)||Dt.getAttribute("crossorigin")!==(an.crossOrigin==null?null:an.crossOrigin)||Dt.getAttribute("title")!==(an.title==null?null:an.title))break;return Dt;case"style":if(Dt.hasAttribute("data-precedence"))break;return Dt;case"script":if(un=Dt.getAttribute("src"),(un!==(an.src==null?null:an.src)||Dt.getAttribute("type")!==(an.type==null?null:an.type)||Dt.getAttribute("crossorigin")!==(an.crossOrigin==null?null:an.crossOrigin))&&un&&Dt.hasAttribute("async")&&!Dt.hasAttribute("itemprop"))break;return Dt;default:return Dt}}else if(Bt==="input"&&Dt.type==="hidden"){var un=an.name==null?null:""+an.name;if(an.type==="hidden"&&Dt.getAttribute("name")===un)return Dt}else return Dt;if(Dt=gc(Dt.nextSibling),Dt===null)break}return null}function Mg(Dt,Bt,$t){if(Bt==="")return null;for(;Dt.nodeType!==3;)if((Dt.nodeType!==1||Dt.nodeName!=="INPUT"||Dt.type!=="hidden")&&!$t||(Dt=gc(Dt.nextSibling),Dt===null))return null;return Dt}function y0(Dt,Bt){for(;Dt.nodeType!==8;)if((Dt.nodeType!==1||Dt.nodeName!=="INPUT"||Dt.type!=="hidden")&&!Bt||(Dt=gc(Dt.nextSibling),Dt===null))return null;return Dt}function qf(Dt){return Dt.data==="$?"||Dt.data==="$~"}function Yf(Dt){return Dt.data==="$!"||Dt.data==="$?"&&Dt.ownerDocument.readyState!=="loading"}function Ig(Dt,Bt){var $t=Dt.ownerDocument;if(Dt.data==="$~")Dt._reactRetry=Bt;else if(Dt.data!=="$?"||$t.readyState!=="loading")Bt();else{var Yt=function(){Bt(),$t.removeEventListener("DOMContentLoaded",Yt)};$t.addEventListener("DOMContentLoaded",Yt),Dt._reactRetry=Yt}}function gc(Dt){for(;Dt!=null;Dt=Dt.nextSibling){var Bt=Dt.nodeType;if(Bt===1||Bt===3)break;if(Bt===8){if(Bt=Dt.data,Bt==="$"||Bt==="$!"||Bt==="$?"||Bt==="$~"||Bt==="&"||Bt==="F!"||Bt==="F")break;if(Bt==="/$"||Bt==="/&")return null}}return Dt}var Xf=null;function _0(Dt){Dt=Dt.nextSibling;for(var Bt=0;Dt;){if(Dt.nodeType===8){var $t=Dt.data;if($t==="/$"||$t==="/&"){if(Bt===0)return gc(Dt.nextSibling);Bt--}else $t!=="$"&&$t!=="$!"&&$t!=="$?"&&$t!=="$~"&&$t!=="&"||Bt++}Dt=Dt.nextSibling}return null}function x0(Dt){Dt=Dt.previousSibling;for(var Bt=0;Dt;){if(Dt.nodeType===8){var $t=Dt.data;if($t==="$"||$t==="$!"||$t==="$?"||$t==="$~"||$t==="&"){if(Bt===0)return Dt;Bt--}else $t!=="/$"&&$t!=="/&"||Bt++}Dt=Dt.previousSibling}return null}function v0(Dt,Bt,$t){switch(Bt=Ad($t),Dt){case"html":if(Dt=Bt.documentElement,!Dt)throw Error(vt(452));return Dt;case"head":if(Dt=Bt.head,!Dt)throw Error(vt(453));return Dt;case"body":if(Dt=Bt.body,!Dt)throw Error(vt(454));return Dt;default:throw Error(vt(451))}}function zu(Dt){for(var Bt=Dt.attributes;Bt.length;)Dt.removeAttributeNode(Bt[0]);$s(Dt)}var mc=new Map,b0=new Set;function Cd(Dt){return typeof Dt.getRootNode=="function"?Dt.getRootNode():Dt.nodeType===9?Dt:Dt.ownerDocument}var kc=nn.d;nn.d={f:Og,r:Pg,D:Lg,C:kg,L:Ng,m:zg,X:$g,S:Ug,M:jg};function Og(){var Dt=kc.f(),Bt=gd();return Dt||Bt}function Pg(Dt){var Bt=Hs(Dt);Bt!==null&&Bt.tag===5&&Bt.type==="form"?zh(Bt):kc.r(Dt)}var _u=typeof document>"u"?null:document;function A0(Dt,Bt,$t){var Yt=_u;if(Yt&&typeof Bt=="string"&&Bt){var an=cs(Bt);an='link[rel="'+Dt+'"][href="'+an+'"]',typeof $t=="string"&&(an+='[crossorigin="'+$t+'"]'),b0.has(an)||(b0.add(an),Dt={rel:Dt,crossOrigin:$t,href:Bt},Yt.querySelector(an)===null&&(Bt=Yt.createElement("link"),Al(Bt,"link",Dt),Ds(Bt),Yt.head.appendChild(Bt)))}}function Lg(Dt){kc.D(Dt),A0("dns-prefetch",Dt,null)}function kg(Dt,Bt){kc.C(Dt,Bt),A0("preconnect",Dt,Bt)}function Ng(Dt,Bt,$t){kc.L(Dt,Bt,$t);var Yt=_u;if(Yt&&Dt&&Bt){var an='link[rel="preload"][as="'+cs(Bt)+'"]';Bt==="image"&&$t&&$t.imageSrcSet?(an+='[imagesrcset="'+cs($t.imageSrcSet)+'"]',typeof $t.imageSizes=="string"&&(an+='[imagesizes="'+cs($t.imageSizes)+'"]')):an+='[href="'+cs(Dt)+'"]';var un=an;switch(Bt){case"style":un=xu(Dt);break;case"script":un=vu(Dt)}mc.has(un)||(Dt=Rt({rel:"preload",href:Bt==="image"&&$t&&$t.imageSrcSet?void 0:Dt,as:Bt},$t),mc.set(un,Dt),Yt.querySelector(an)!==null||Bt==="style"&&Yt.querySelector(Uu(un))||Bt==="script"&&Yt.querySelector($u(un))||(Bt=Yt.createElement("link"),Al(Bt,"link",Dt),Ds(Bt),Yt.head.appendChild(Bt)))}}function zg(Dt,Bt){kc.m(Dt,Bt);var $t=_u;if($t&&Dt){var Yt=Bt&&typeof Bt.as=="string"?Bt.as:"script",an='link[rel="modulepreload"][as="'+cs(Yt)+'"][href="'+cs(Dt)+'"]',un=an;switch(Yt){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":un=vu(Dt)}if(!mc.has(un)&&(Dt=Rt({rel:"modulepreload",href:Dt},Bt),mc.set(un,Dt),$t.querySelector(an)===null)){switch(Yt){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if($t.querySelector($u(un)))return}Yt=$t.createElement("link"),Al(Yt,"link",Dt),Ds(Yt),$t.head.appendChild(Yt)}}}function Ug(Dt,Bt,$t){kc.S(Dt,Bt,$t);var Yt=_u;if(Yt&&Dt){var an=Es(Yt).hoistableStyles,un=xu(Dt);Bt=Bt||"default";var bn=an.get(un);if(!bn){var qn={loading:0,preload:null};if(bn=Yt.querySelector(Uu(un)))qn.loading=5;else{Dt=Rt({rel:"stylesheet",href:Dt,"data-precedence":Bt},$t),($t=mc.get(un))&&Kf(Dt,$t);var Sr=bn=Yt.createElement("link");Ds(Sr),Al(Sr,"link",Dt),Sr._p=new Promise(function(Jr,ui){Sr.onload=Jr,Sr.onerror=ui}),Sr.addEventListener("load",function(){qn.loading|=1}),Sr.addEventListener("error",function(){qn.loading|=2}),qn.loading|=4,Fd(bn,Bt,Yt)}bn={type:"stylesheet",instance:bn,count:1,state:qn},an.set(un,bn)}}}function $g(Dt,Bt){kc.X(Dt,Bt);var $t=_u;if($t&&Dt){var Yt=Es($t).hoistableScripts,an=vu(Dt),un=Yt.get(an);un||(un=$t.querySelector($u(an)),un||(Dt=Rt({src:Dt,async:!0},Bt),(Bt=mc.get(an))&&Zf(Dt,Bt),un=$t.createElement("script"),Ds(un),Al(un,"link",Dt),$t.head.appendChild(un)),un={type:"script",instance:un,count:1,state:null},Yt.set(an,un))}}function jg(Dt,Bt){kc.M(Dt,Bt);var $t=_u;if($t&&Dt){var Yt=Es($t).hoistableScripts,an=vu(Dt),un=Yt.get(an);un||(un=$t.querySelector($u(an)),un||(Dt=Rt({src:Dt,async:!0,type:"module"},Bt),(Bt=mc.get(an))&&Zf(Dt,Bt),un=$t.createElement("script"),Ds(un),Al(un,"link",Dt),$t.head.appendChild(un)),un={type:"script",instance:un,count:1,state:null},Yt.set(an,un))}}function C0(Dt,Bt,$t,Yt){var an=(an=yn.current)?Cd(an):null;if(!an)throw Error(vt(446));switch(Dt){case"meta":case"title":return null;case"style":return typeof $t.precedence=="string"&&typeof $t.href=="string"?(Bt=xu($t.href),$t=Es(an).hoistableStyles,Yt=$t.get(Bt),Yt||(Yt={type:"style",instance:null,count:0,state:null},$t.set(Bt,Yt)),Yt):{type:"void",instance:null,count:0,state:null};case"link":if($t.rel==="stylesheet"&&typeof $t.href=="string"&&typeof $t.precedence=="string"){Dt=xu($t.href);var un=Es(an).hoistableStyles,bn=un.get(Dt);if(bn||(an=an.ownerDocument||an,bn={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},un.set(Dt,bn),(un=an.querySelector(Uu(Dt)))&&!un._p&&(bn.instance=un,bn.state.loading=5),mc.has(Dt)||($t={rel:"preload",as:"style",href:$t.href,crossOrigin:$t.crossOrigin,integrity:$t.integrity,media:$t.media,hrefLang:$t.hrefLang,referrerPolicy:$t.referrerPolicy},mc.set(Dt,$t),un||Hg(an,Dt,$t,bn.state))),Bt&&Yt===null)throw Error(vt(528,""));return bn}if(Bt&&Yt!==null)throw Error(vt(529,""));return null;case"script":return Bt=$t.async,$t=$t.src,typeof $t=="string"&&Bt&&typeof Bt!="function"&&typeof Bt!="symbol"?(Bt=vu($t),$t=Es(an).hoistableScripts,Yt=$t.get(Bt),Yt||(Yt={type:"script",instance:null,count:0,state:null},$t.set(Bt,Yt)),Yt):{type:"void",instance:null,count:0,state:null};default:throw Error(vt(444,Dt))}}function xu(Dt){return'href="'+cs(Dt)+'"'}function Uu(Dt){return'link[rel="stylesheet"]['+Dt+"]"}function F0(Dt){return Rt({},Dt,{"data-precedence":Dt.precedence,precedence:null})}function Hg(Dt,Bt,$t,Yt){Dt.querySelector('link[rel="preload"][as="style"]['+Bt+"]")?Yt.loading=1:(Bt=Dt.createElement("link"),Yt.preload=Bt,Bt.addEventListener("load",function(){return Yt.loading|=1}),Bt.addEventListener("error",function(){return Yt.loading|=2}),Al(Bt,"link",$t),Ds(Bt),Dt.head.appendChild(Bt))}function vu(Dt){return'[src="'+cs(Dt)+'"]'}function $u(Dt){return"script[async]"+Dt}function w0(Dt,Bt,$t){if(Bt.count++,Bt.instance===null)switch(Bt.type){case"style":var Yt=Dt.querySelector('style[data-href~="'+cs($t.href)+'"]');if(Yt)return Bt.instance=Yt,Ds(Yt),Yt;var an=Rt({},$t,{"data-href":$t.href,"data-precedence":$t.precedence,href:null,precedence:null});return Yt=(Dt.ownerDocument||Dt).createElement("style"),Ds(Yt),Al(Yt,"style",an),Fd(Yt,$t.precedence,Dt),Bt.instance=Yt;case"stylesheet":an=xu($t.href);var un=Dt.querySelector(Uu(an));if(un)return Bt.state.loading|=4,Bt.instance=un,Ds(un),un;Yt=F0($t),(an=mc.get(an))&&Kf(Yt,an),un=(Dt.ownerDocument||Dt).createElement("link"),Ds(un);var bn=un;return bn._p=new Promise(function(qn,Sr){bn.onload=qn,bn.onerror=Sr}),Al(un,"link",Yt),Bt.state.loading|=4,Fd(un,$t.precedence,Dt),Bt.instance=un;case"script":return un=vu($t.src),(an=Dt.querySelector($u(un)))?(Bt.instance=an,Ds(an),an):(Yt=$t,(an=mc.get(un))&&(Yt=Rt({},$t),Zf(Yt,an)),Dt=Dt.ownerDocument||Dt,an=Dt.createElement("script"),Ds(an),Al(an,"link",Yt),Dt.head.appendChild(an),Bt.instance=an);case"void":return null;default:throw Error(vt(443,Bt.type))}else Bt.type==="stylesheet"&&(Bt.state.loading&4)===0&&(Yt=Bt.instance,Bt.state.loading|=4,Fd(Yt,$t.precedence,Dt));return Bt.instance}function Fd(Dt,Bt,$t){for(var Yt=$t.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),an=Yt.length?Yt[Yt.length-1]:null,un=an,bn=0;bn<Yt.length;bn++){var qn=Yt[bn];if(qn.dataset.precedence===Bt)un=qn;else if(un!==an)break}un?un.parentNode.insertBefore(Dt,un.nextSibling):(Bt=$t.nodeType===9?$t.head:$t,Bt.insertBefore(Dt,Bt.firstChild))}function Kf(Dt,Bt){Dt.crossOrigin==null&&(Dt.crossOrigin=Bt.crossOrigin),Dt.referrerPolicy==null&&(Dt.referrerPolicy=Bt.referrerPolicy),Dt.title==null&&(Dt.title=Bt.title)}function Zf(Dt,Bt){Dt.crossOrigin==null&&(Dt.crossOrigin=Bt.crossOrigin),Dt.referrerPolicy==null&&(Dt.referrerPolicy=Bt.referrerPolicy),Dt.integrity==null&&(Dt.integrity=Bt.integrity)}var wd=null;function S0(Dt,Bt,$t){if(wd===null){var Yt=new Map,an=wd=new Map;an.set($t,Yt)}else an=wd,Yt=an.get($t),Yt||(Yt=new Map,an.set($t,Yt));if(Yt.has(Dt))return Yt;for(Yt.set(Dt,null),$t=$t.getElementsByTagName(Dt),an=0;an<$t.length;an++){var un=$t[an];if(!(un[xs]||un[mi]||Dt==="link"&&un.getAttribute("rel")==="stylesheet")&&un.namespaceURI!=="http://www.w3.org/2000/svg"){var bn=un.getAttribute(Bt)||"";bn=Dt+bn;var qn=Yt.get(bn);qn?qn.push(un):Yt.set(bn,[un])}}return Yt}function D0(Dt,Bt,$t){Dt=Dt.ownerDocument||Dt,Dt.head.insertBefore($t,Bt==="title"?Dt.querySelector("head > title"):null)}function Wg(Dt,Bt,$t){if($t===1||Bt.itemProp!=null)return!1;switch(Dt){case"meta":case"title":return!0;case"style":if(typeof Bt.precedence!="string"||typeof Bt.href!="string"||Bt.href==="")break;return!0;case"link":if(typeof Bt.rel!="string"||typeof Bt.href!="string"||Bt.href===""||Bt.onLoad||Bt.onError)break;return Bt.rel==="stylesheet"?(Dt=Bt.disabled,typeof Bt.precedence=="string"&&Dt==null):!0;case"script":if(Bt.async&&typeof Bt.async!="function"&&typeof Bt.async!="symbol"&&!Bt.onLoad&&!Bt.onError&&Bt.src&&typeof Bt.src=="string")return!0}return!1}function T0(Dt){return!(Dt.type==="stylesheet"&&(Dt.state.loading&3)===0)}function Vg(Dt,Bt,$t,Yt){if($t.type==="stylesheet"&&(typeof Yt.media!="string"||matchMedia(Yt.media).matches!==!1)&&($t.state.loading&4)===0){if($t.instance===null){var an=xu(Yt.href),un=Bt.querySelector(Uu(an));if(un){Bt=un._p,Bt!==null&&typeof Bt=="object"&&typeof Bt.then=="function"&&(Dt.count++,Dt=Sd.bind(Dt),Bt.then(Dt,Dt)),$t.state.loading|=4,$t.instance=un,Ds(un);return}un=Bt.ownerDocument||Bt,Yt=F0(Yt),(an=mc.get(an))&&Kf(Yt,an),un=un.createElement("link"),Ds(un);var bn=un;bn._p=new Promise(function(qn,Sr){bn.onload=qn,bn.onerror=Sr}),Al(un,"link",Yt),$t.instance=un}Dt.stylesheets===null&&(Dt.stylesheets=new Map),Dt.stylesheets.set($t,Bt),(Bt=$t.state.preload)&&($t.state.loading&3)===0&&(Dt.count++,$t=Sd.bind(Dt),Bt.addEventListener("load",$t),Bt.addEventListener("error",$t))}}var Qf=0;function Gg(Dt,Bt){return Dt.stylesheets&&Dt.count===0&&Td(Dt,Dt.stylesheets),0<Dt.count||0<Dt.imgCount?function($t){var Yt=setTimeout(function(){if(Dt.stylesheets&&Td(Dt,Dt.stylesheets),Dt.unsuspend){var un=Dt.unsuspend;Dt.unsuspend=null,un()}},6e4+Bt);0<Dt.imgBytes&&Qf===0&&(Qf=62500*wg());var an=setTimeout(function(){if(Dt.waitingForImages=!1,Dt.count===0&&(Dt.stylesheets&&Td(Dt,Dt.stylesheets),Dt.unsuspend)){var un=Dt.unsuspend;Dt.unsuspend=null,un()}},(Dt.imgBytes>Qf?50:800)+Bt);return Dt.unsuspend=$t,function(){Dt.unsuspend=null,clearTimeout(Yt),clearTimeout(an)}}:null}function Sd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Td(this,this.stylesheets);else if(this.unsuspend){var Dt=this.unsuspend;this.unsuspend=null,Dt()}}}var Dd=null;function Td(Dt,Bt){Dt.stylesheets=null,Dt.unsuspend!==null&&(Dt.count++,Dd=new Map,Bt.forEach(qg,Dt),Dd=null,Sd.call(Dt))}function qg(Dt,Bt){if(!(Bt.state.loading&4)){var $t=Dd.get(Dt);if($t)var Yt=$t.get(null);else{$t=new Map,Dd.set(Dt,$t);for(var an=Dt.querySelectorAll("link[data-precedence],style[data-precedence]"),un=0;un<an.length;un++){var bn=an[un];(bn.nodeName==="LINK"||bn.getAttribute("media")!=="not all")&&($t.set(bn.dataset.precedence,bn),Yt=bn)}Yt&&$t.set(null,Yt)}an=Bt.instance,bn=an.getAttribute("data-precedence"),un=$t.get(bn)||Yt,un===Yt&&$t.set(null,an),$t.set(bn,an),this.count++,Yt=Sd.bind(this),an.addEventListener("load",Yt),an.addEventListener("error",Yt),un?un.parentNode.insertBefore(an,un.nextSibling):(Dt=Dt.nodeType===9?Dt.head:Dt,Dt.insertBefore(an,Dt.firstChild)),Bt.state.loading|=4}}var ju={$$typeof:Ut,Provider:null,Consumer:null,_currentValue:rn,_currentValue2:rn,_threadCount:0};function Yg(Dt,Bt,$t,Yt,an,un,bn,qn,Sr){this.tag=1,this.containerInfo=Dt,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=gr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gr(0),this.hiddenUpdates=gr(null),this.identifierPrefix=Yt,this.onUncaughtError=an,this.onCaughtError=un,this.onRecoverableError=bn,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Sr,this.incompleteTransitions=new Map}function R0(Dt,Bt,$t,Yt,an,un,bn,qn,Sr,Jr,ui,gi){return Dt=new Yg(Dt,Bt,$t,bn,Sr,Jr,ui,gi,qn),Bt=1,un===!0&&(Bt|=24),un=Ks(3,null,null,Bt),Dt.current=un,un.stateNode=Dt,Bt=tc(),Bt.refCount++,Dt.pooledCache=Bt,Bt.refCount++,un.memoizedState={element:Yt,isDehydrated:$t,cache:Bt},pa(un),Dt}function B0(Dt){return Dt?(Dt=Ai,Dt):Ai}function M0(Dt,Bt,$t,Yt,an,un){an=B0(an),Yt.context===null?Yt.context=an:Yt.pendingContext=an,Yt=Js(Bt),Yt.payload={element:$t},un=un===void 0?null:un,un!==null&&(Yt.callback=un),$t=Gr(Dt,Yt,Bt),$t!==null&&(Kl($t,Dt,Bt),Ti($t,Dt,Bt))}function I0(Dt,Bt){if(Dt=Dt.memoizedState,Dt!==null&&Dt.dehydrated!==null){var $t=Dt.retryLane;Dt.retryLane=$t!==0&&$t<Bt?$t:Bt}}function Jf(Dt,Bt){I0(Dt,Bt),(Dt=Dt.alternate)&&I0(Dt,Bt)}function O0(Dt){if(Dt.tag===13||Dt.tag===31){var Bt=Qi(Dt,67108864);Bt!==null&&Kl(Bt,Dt,67108864),Jf(Dt,67108864)}}function P0(Dt){if(Dt.tag===13||Dt.tag===31){var Bt=ac();Bt=ki(Bt);var $t=Qi(Dt,Bt);$t!==null&&Kl($t,Dt,Bt),Jf(Dt,Bt)}}var Rd=!0;function Xg(Dt,Bt,$t,Yt){var an=Zt.T;Zt.T=null;var un=nn.p;try{nn.p=2,eh(Dt,Bt,$t,Yt)}finally{nn.p=un,Zt.T=an}}function Kg(Dt,Bt,$t,Yt){var an=Zt.T;Zt.T=null;var un=nn.p;try{nn.p=8,eh(Dt,Bt,$t,Yt)}finally{nn.p=un,Zt.T=an}}function eh(Dt,Bt,$t,Yt){if(Rd){var an=th(Yt);if(an===null)Uf(Dt,Bt,Yt,Bd,$t),k0(Dt,Yt);else if(Qg(an,Dt,Bt,$t,Yt))Yt.stopPropagation();else if(k0(Dt,Yt),Bt&4&&-1<Zg.indexOf(Dt)){for(;an!==null;){var un=Hs(an);if(un!==null)switch(un.tag){case 3:if(un=un.stateNode,un.current.memoizedState.isDehydrated){var bn=hn(un.pendingLanes);if(bn!==0){var qn=un;for(qn.pendingLanes|=2,qn.entangledLanes|=2;bn;){var Sr=1<<31-Xn(bn);qn.entanglements[1]|=Sr,bn&=~Sr}Fc(un),(So&6)===0&&(hd=Dr()+500,Lu(0))}}break;case 31:case 13:qn=Qi(un,2),qn!==null&&Kl(qn,un,2),gd(),Jf(un,2)}if(un=th(Yt),un===null&&Uf(Dt,Bt,Yt,Bd,$t),un===an)break;an=un}an!==null&&Yt.stopPropagation()}else Uf(Dt,Bt,Yt,null,$t)}}function th(Dt){return Dt=qo(Dt),nh(Dt)}var Bd=null;function nh(Dt){if(Bd=null,Dt=Is(Dt),Dt!==null){var Bt=At(Dt);if(Bt===null)Dt=null;else{var $t=Bt.tag;if($t===13){if(Dt=Ft(Bt),Dt!==null)return Dt;Dt=null}else if($t===31){if(Dt=Ct(Bt),Dt!==null)return Dt;Dt=null}else if($t===3){if(Bt.stateNode.current.memoizedState.isDehydrated)return Bt.tag===3?Bt.stateNode.containerInfo:null;Dt=null}else Bt!==Dt&&(Dt=null)}}return Bd=Dt,null}function L0(Dt){switch(Dt){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ar()){case Qn:return 2;case Cn:return 8;case Bn:case In:return 32;case or:return 268435456;default:return 32}default:return 32}}var rh=!1,Xc=null,Kc=null,Zc=null,Hu=new Map,Wu=new Map,Qc=[],Zg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function k0(Dt,Bt){switch(Dt){case"focusin":case"focusout":Xc=null;break;case"dragenter":case"dragleave":Kc=null;break;case"mouseover":case"mouseout":Zc=null;break;case"pointerover":case"pointerout":Hu.delete(Bt.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wu.delete(Bt.pointerId)}}function Vu(Dt,Bt,$t,Yt,an,un){return Dt===null||Dt.nativeEvent!==un?(Dt={blockedOn:Bt,domEventName:$t,eventSystemFlags:Yt,nativeEvent:un,targetContainers:[an]},Bt!==null&&(Bt=Hs(Bt),Bt!==null&&O0(Bt)),Dt):(Dt.eventSystemFlags|=Yt,Bt=Dt.targetContainers,an!==null&&Bt.indexOf(an)===-1&&Bt.push(an),Dt)}function Qg(Dt,Bt,$t,Yt,an){switch(Bt){case"focusin":return Xc=Vu(Xc,Dt,Bt,$t,Yt,an),!0;case"dragenter":return Kc=Vu(Kc,Dt,Bt,$t,Yt,an),!0;case"mouseover":return Zc=Vu(Zc,Dt,Bt,$t,Yt,an),!0;case"pointerover":var un=an.pointerId;return Hu.set(un,Vu(Hu.get(un)||null,Dt,Bt,$t,Yt,an)),!0;case"gotpointercapture":return un=an.pointerId,Wu.set(un,Vu(Wu.get(un)||null,Dt,Bt,$t,Yt,an)),!0}return!1}function N0(Dt){var Bt=Is(Dt.target);if(Bt!==null){var $t=At(Bt);if($t!==null){if(Bt=$t.tag,Bt===13){if(Bt=Ft($t),Bt!==null){Dt.blockedOn=Bt,ci(Dt.priority,function(){P0($t)});return}}else if(Bt===31){if(Bt=Ct($t),Bt!==null){Dt.blockedOn=Bt,ci(Dt.priority,function(){P0($t)});return}}else if(Bt===3&&$t.stateNode.current.memoizedState.isDehydrated){Dt.blockedOn=$t.tag===3?$t.stateNode.containerInfo:null;return}}}Dt.blockedOn=null}function Md(Dt){if(Dt.blockedOn!==null)return!1;for(var Bt=Dt.targetContainers;0<Bt.length;){var $t=th(Dt.nativeEvent);if($t===null){$t=Dt.nativeEvent;var Yt=new $t.constructor($t.type,$t);al=Yt,$t.target.dispatchEvent(Yt),al=null}else return Bt=Hs($t),Bt!==null&&O0(Bt),Dt.blockedOn=$t,!1;Bt.shift()}return!0}function z0(Dt,Bt,$t){Md(Dt)&&$t.delete(Bt)}function Jg(){rh=!1,Xc!==null&&Md(Xc)&&(Xc=null),Kc!==null&&Md(Kc)&&(Kc=null),Zc!==null&&Md(Zc)&&(Zc=null),Hu.forEach(z0),Wu.forEach(z0)}function Id(Dt,Bt){Dt.blockedOn===Bt&&(Dt.blockedOn=null,rh||(rh=!0,yt.unstable_scheduleCallback(yt.unstable_NormalPriority,Jg)))}var Od=null;function U0(Dt){Od!==Dt&&(Od=Dt,yt.unstable_scheduleCallback(yt.unstable_NormalPriority,function(){Od===Dt&&(Od=null);for(var Bt=0;Bt<Dt.length;Bt+=3){var $t=Dt[Bt],Yt=Dt[Bt+1],an=Dt[Bt+2];if(typeof Yt!="function"){if(nh(Yt||$t)===null)continue;break}var un=Hs($t);un!==null&&(Dt.splice(Bt,3),Bt-=3,ef(un,{pending:!0,data:an,method:$t.method,action:Yt},Yt,an))}}))}function bu(Dt){function Bt(Sr){return Id(Sr,Dt)}Xc!==null&&Id(Xc,Dt),Kc!==null&&Id(Kc,Dt),Zc!==null&&Id(Zc,Dt),Hu.forEach(Bt),Wu.forEach(Bt);for(var $t=0;$t<Qc.length;$t++){var Yt=Qc[$t];Yt.blockedOn===Dt&&(Yt.blockedOn=null)}for(;0<Qc.length&&($t=Qc[0],$t.blockedOn===null);)N0($t),$t.blockedOn===null&&Qc.shift();if($t=(Dt.ownerDocument||Dt).$$reactFormReplay,$t!=null)for(Yt=0;Yt<$t.length;Yt+=3){var an=$t[Yt],un=$t[Yt+1],bn=an[wi]||null;if(typeof un=="function")bn||U0($t);else if(bn){var qn=null;if(un&&un.hasAttribute("formAction")){if(an=un,bn=un[wi]||null)qn=bn.formAction;else if(nh(an)!==null)continue}else qn=bn.action;typeof qn=="function"?$t[Yt+1]=qn:($t.splice(Yt,3),Yt-=3),U0($t)}}}function $0(){function Dt(un){un.canIntercept&&un.info==="react-transition"&&un.intercept({handler:function(){return new Promise(function(bn){return an=bn})},focusReset:"manual",scroll:"manual"})}function Bt(){an!==null&&(an(),an=null),Yt||setTimeout($t,20)}function $t(){if(!Yt&&!navigation.transition){var un=navigation.currentEntry;un&&un.url!=null&&navigation.navigate(un.url,{state:un.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var Yt=!1,an=null;return navigation.addEventListener("navigate",Dt),navigation.addEventListener("navigatesuccess",Bt),navigation.addEventListener("navigateerror",Bt),setTimeout($t,100),function(){Yt=!0,navigation.removeEventListener("navigate",Dt),navigation.removeEventListener("navigatesuccess",Bt),navigation.removeEventListener("navigateerror",Bt),an!==null&&(an(),an=null)}}}function ih(Dt){this._internalRoot=Dt}Pd.prototype.render=ih.prototype.render=function(Dt){var Bt=this._internalRoot;if(Bt===null)throw Error(vt(409));var $t=Bt.current,Yt=ac();M0($t,Yt,Dt,Bt,null,null)},Pd.prototype.unmount=ih.prototype.unmount=function(){var Dt=this._internalRoot;if(Dt!==null){this._internalRoot=null;var Bt=Dt.containerInfo;M0(Dt.current,2,null,Dt,null,null),gd(),Bt[vi]=null}};function Pd(Dt){this._internalRoot=Dt}Pd.prototype.unstable_scheduleHydration=function(Dt){if(Dt){var Bt=_i();Dt={blockedOn:null,target:Dt,priority:Bt};for(var $t=0;$t<Qc.length&&Bt!==0&&Bt<Qc[$t].priority;$t++);Qc.splice($t,0,Dt),$t===0&&N0(Dt)}};var j0=Et.version;if(j0!=="19.2.4")throw Error(vt(527,j0,"19.2.4"));nn.findDOMNode=function(Dt){var Bt=Dt._reactInternals;if(Bt===void 0)throw typeof Dt.render=="function"?Error(vt(188)):(Dt=Object.keys(Dt).join(","),Error(vt(268,Dt)));return Dt=St(Bt),Dt=Dt!==null?Tt(Dt):null,Dt=Dt===null?null:Dt.stateNode,Dt};var em={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Zt,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ld=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ld.isDisabled&&Ld.supportsFiber)try{cr=Ld.inject(em),gn=Ld}catch{}}return reactDomClient_production.createRoot=function(Dt,Bt){if(!bt(Dt))throw Error(vt(299));var $t=!1,Yt="",an=Xh,un=Kh,bn=Zh;return Bt!=null&&(Bt.unstable_strictMode===!0&&($t=!0),Bt.identifierPrefix!==void 0&&(Yt=Bt.identifierPrefix),Bt.onUncaughtError!==void 0&&(an=Bt.onUncaughtError),Bt.onCaughtError!==void 0&&(un=Bt.onCaughtError),Bt.onRecoverableError!==void 0&&(bn=Bt.onRecoverableError)),Bt=R0(Dt,1,!1,null,null,$t,Yt,null,an,un,bn,$0),Dt[vi]=Bt.current,zf(Dt),new ih(Bt)},reactDomClient_production.hydrateRoot=function(Dt,Bt,$t){if(!bt(Dt))throw Error(vt(299));var Yt=!1,an="",un=Xh,bn=Kh,qn=Zh,Sr=null;return $t!=null&&($t.unstable_strictMode===!0&&(Yt=!0),$t.identifierPrefix!==void 0&&(an=$t.identifierPrefix),$t.onUncaughtError!==void 0&&(un=$t.onUncaughtError),$t.onCaughtError!==void 0&&(bn=$t.onCaughtError),$t.onRecoverableError!==void 0&&(qn=$t.onRecoverableError),$t.formState!==void 0&&(Sr=$t.formState)),Bt=R0(Dt,1,!0,Bt,$t??null,Yt,an,Sr,un,bn,qn,$0),Bt.context=B0(null),$t=Bt.current,Yt=ac(),Yt=ki(Yt),an=Js(Yt),an.callback=null,Gr($t,an,Yt),$t=Yt,Bt.current.lanes=$t,ii(Bt,$t),Fc(Bt),Dt[vi]=Bt.current,zf(Dt),new Pd(Bt)},reactDomClient_production.version="19.2.4",reactDomClient_production}var hasRequiredClient;function requireClient(){if(hasRequiredClient)return client.exports;hasRequiredClient=1;function yt(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yt)}catch(Et){console.error(Et)}}return yt(),client.exports=requireReactDomClient_production(),client.exports}var clientExports=requireClient();const ReactDOM$1=getDefaultExportFromCjs(clientExports);var jsxRuntime={exports:{}},reactJsxRuntime_production={};var hasRequiredReactJsxRuntime_production;function requireReactJsxRuntime_production(){if(hasRequiredReactJsxRuntime_production)return reactJsxRuntime_production;hasRequiredReactJsxRuntime_production=1;var yt=Symbol.for("react.transitional.element"),Et=Symbol.for("react.fragment");function xt(vt,bt,At){var Ft=null;if(At!==void 0&&(Ft=""+At),bt.key!==void 0&&(Ft=""+bt.key),"key"in bt){At={};for(var Ct in bt)Ct!=="key"&&(At[Ct]=bt[Ct])}else At=bt;return bt=At.ref,{$$typeof:yt,type:vt,key:Ft,ref:bt!==void 0?bt:null,props:At}}return reactJsxRuntime_production.Fragment=Et,reactJsxRuntime_production.jsx=xt,reactJsxRuntime_production.jsxs=xt,reactJsxRuntime_production}var hasRequiredJsxRuntime;function requireJsxRuntime(){return hasRequiredJsxRuntime||(hasRequiredJsxRuntime=1,jsxRuntime.exports=requireReactJsxRuntime_production()),jsxRuntime.exports}var jsxRuntimeExports=requireJsxRuntime();const toKebabCase=yt=>yt.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),toCamelCase=yt=>yt.replace(/^([A-Z])|[\s-_]+(\w)/g,(Et,xt,vt)=>vt?vt.toUpperCase():xt.toLowerCase()),toPascalCase=yt=>{const Et=toCamelCase(yt);return Et.charAt(0).toUpperCase()+Et.slice(1)},mergeClasses=(...yt)=>yt.filter((Et,xt,vt)=>!!Et&&Et.trim()!==""&&vt.indexOf(Et)===xt).join(" ").trim(),hasA11yProp=yt=>{for(const Et in yt)if(Et.startsWith("aria-")||Et==="role"||Et==="title")return!0};var defaultAttributes={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Icon$1=reactExports.forwardRef(({color:yt="currentColor",size:Et=24,strokeWidth:xt=2,absoluteStrokeWidth:vt,className:bt="",children:At,iconNode:Ft,...Ct},wt)=>reactExports.createElement("svg",{ref:wt,...defaultAttributes,width:Et,height:Et,stroke:yt,strokeWidth:vt?Number(xt)*24/Number(Et):xt,className:mergeClasses("lucide",bt),...!At&&!hasA11yProp(Ct)&&{"aria-hidden":"true"},...Ct},[...Ft.map(([St,Tt])=>reactExports.createElement(St,Tt)),...Array.isArray(At)?At:[At]]));const createLucideIcon=(yt,Et)=>{const xt=reactExports.forwardRef(({className:vt,...bt},At)=>reactExports.createElement(Icon$1,{ref:At,iconNode:Et,className:mergeClasses(`lucide-${toKebabCase(toPascalCase(yt))}`,`lucide-${yt}`,vt),...bt}));return xt.displayName=toPascalCase(yt),xt};const __iconNode$o=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],BookOpen=createLucideIcon("book-open",__iconNode$o);const __iconNode$n=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Camera=createLucideIcon("camera",__iconNode$n);const __iconNode$m=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Check=createLucideIcon("check",__iconNode$m);const __iconNode$l=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ChevronDown=createLucideIcon("chevron-down",__iconNode$l);const __iconNode$k=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ChevronRight=createLucideIcon("chevron-right",__iconNode$k);const __iconNode$j=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ChevronUp=createLucideIcon("chevron-up",__iconNode$j);const __iconNode$i=[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]],Crop=createLucideIcon("crop",__iconNode$i);const __iconNode$h=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Info=createLucideIcon("info",__iconNode$h);const __iconNode$g=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Key=createLucideIcon("key",__iconNode$g);const __iconNode$f=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Lightbulb=createLucideIcon("lightbulb",__iconNode$f);const __iconNode$e=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Maximize2=createLucideIcon("maximize-2",__iconNode$e);const __iconNode$d=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Monitor=createLucideIcon("monitor",__iconNode$d);const __iconNode$c=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Moon=createLucideIcon("moon",__iconNode$c);const __iconNode$b=[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]],Move=createLucideIcon("move",__iconNode$b);const __iconNode$a=[["path",{d:"m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z",key:"irua1i"}],["path",{d:"m5 2 5 5",key:"1lls2c"}],["path",{d:"M2 13h15",key:"1hkzvu"}],["path",{d:"M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z",key:"xk76lq"}]],PaintBucket=createLucideIcon("paint-bucket",__iconNode$a);const __iconNode$9=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Palette=createLucideIcon("palette",__iconNode$9);const __iconNode$8=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],Presentation=createLucideIcon("presentation",__iconNode$8);const __iconNode$7=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],Printer=createLucideIcon("printer",__iconNode$7);const __iconNode$6=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],RotateCcw=createLucideIcon("rotate-ccw",__iconNode$6);const __iconNode$5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Settings=createLucideIcon("settings",__iconNode$5);const __iconNode$4=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Sun=createLucideIcon("sun",__iconNode$4);const __iconNode$3=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],Table=createLucideIcon("table",__iconNode$3);const __iconNode$2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],X$2=createLucideIcon("x",__iconNode$2);const __iconNode$1=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],ZoomIn=createLucideIcon("zoom-in",__iconNode$1);const __iconNode=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],ZoomOut=createLucideIcon("zoom-out",__iconNode),DEFAULT_CONFIG$1={tree:{ySpacing:150,yScaleFactor:1e3,xScalePercent:100,fixedCoordinateWidth:2e3,nodeRadius:{internal:12,leaf:20},edgeColor:[40,40,4,255],edgeWidth:.5,gap:50,labelPadding:{charWidth:50},phyloLabelPosition:"after-tree",labelOffset:10,alignLabels:!0},gene:{height:60,defaultHeight:60,fillColor:[230,230,230,255],tipWidthFactor:.05,tipWidthMode:"fixed",tipWidthFixed:20,strokeWidthFactor:.9,edgeWidth:1,arrowheadHeight:0,prevalenceThreshold:10},genome:{xScalePercent:30},theme:{mode:"light",light:{background:"#ffffff",text:"#222222",treeEdges:[0,0,0,255],phyloLabelFill:[0,0,0,255],hoods:[100,100,100,255],geneFill:[230,230,230,255],rulerBackground:"#ffffff",rulerText:"#222222",rulerTicks:"#666666",buttonBackground:"#ffffff",buttonText:"#222222",buttonBorder:"#cccccc",tooltipBackground:"#ffffff",tooltipText:"#222222",tooltipBorder:"#cccccc",widgetBackground:"#f8f9fa",border:"#dee2e6",textSecondary:"#6c757d",sliderTrack:"#e9ecef"},dark:{background:"#000000",text:"#ffffff",treeEdges:[255,255,255,255],phyloLabelFill:[255,255,255,255],hoods:[200,200,200,255],geneFill:[100,100,100,255],rulerBackground:"#000000",rulerText:"#ffffff",rulerTicks:"#cccccc",buttonBackground:"#333333",buttonText:"#ffffff",buttonBorder:"#555555",tooltipBackground:"#333333",tooltipText:"#ffffff",tooltipBorder:"#555555",widgetBackground:"#212529",border:"#495057",textSecondary:"#adb5bd",sliderTrack:"#495057"}},domain:{edgeWidth:.01,heightFactor:.7},hood:{width:.25,color:[100,100,100,255]},region:{padding:5,fillOpacity:.2,strokeOpacity:.6,strokeWidth:2,colors:{phage:[255,0,0,255],prophage:[255,165,0,255],operon:[0,128,0,255],cluster:[0,0,255,255],island:[255,255,0,255],region:[1,1,1,255],default:[128,128,128,255],crispr:[255,0,0,255]}},layout:{padding:0,geneOffset:0,containerFallback:{minX:0,minY:0,maxX:1e3,maxY:1e3,treeOffset:0,geneOffset:0}},text:{geneLabelSize:12,phyloLabelSize:20,scaleFactors:{gene:5,phylo:5},rulerLabelSize:14},stroke:{lineWidth:.1,fadeAlpha:.1,darkenFactor:.7},ruler:{height:30,tickHeight:10,labelOffset:22,targetTicks:35},scrollbar:{width:32,barWidth:3,minThumbHeight:24,margin:"2%",borderRadius:"0",panPaddingY:50,panPaddingX:500,minZoom:-5,maxZoom:2},proteinLink:{bezierSegments:120,color:[100,0,220,255],colorBy:"source_gene",solidColor:[100,0,220,255],useAlpha:!0,minAlpha:0,maxAlpha:.5,palette:{type:"sequential",name:"Blues",numColors:9,reverse:!1,enabled:!0}},nucleotideLink:{color:[200,200,200,255],colorBy:"solid",solidColor:[200,200,200,255],strandColoring:!0,sameStrandColor:[180,180,180,255],oppositeStrandColor:[220,80,80,255],sameStrandPalette:{type:"sequential",name:"Greys",numColors:9,reverse:!1,enabled:!0},oppositeStrandPalette:{type:"sequential",name:"Reds",numColors:9,reverse:!1,enabled:!0},useAlpha:!0,minAlpha:0,maxAlpha:.5,palette:{type:"sequential",name:"Reds",numColors:9,reverse:!1,enabled:!0}},connectingLines:{width:.5,color:[128,128,128,255]},colorPalettes:{genePalette:{type:"qualitative",name:"RPRlab",numColors:15,reverse:!1,enabled:!0,desaturateByPrevalence:!0},domainPalette:{type:"sequential",name:"Gray",numColors:9,reverse:!0,enabled:!0,alphaRange:[.1,.3]},phyloPalette:{type:"qualitative",name:"RPRlab",numColors:15,reverse:!1,enabled:!0},ncRNAPalette:{type:"qualitative",name:"RPRlab",numColors:15,reverse:!1,enabled:!0},regionPalette:{type:"qualitative",name:"RPRlab",numColors:15,reverse:!1,enabled:!0}},colors:{black:[0,0,0,255],gray:[100,100,100,255],lightGray:[230,230,230,255],darkGray:[85,85,85,255],transparent:[0,0,0,0]},animation:{transitionDuration:"0.1s",hoverTransition:"0.25s"},export:{svg:{minFontSize:0,fontSizeScale:1e3}}},{tree:TREE_CONFIG,gene:GENE_CONFIG,layout:LAYOUT_CONFIG,text:TEXT_CONFIG,stroke:STROKE_CONFIG,ruler:RULER_CONFIG,scrollbar:SCROLLBAR_CONFIG,proteinLink:PROTEIN_LINK_CONFIG,nucleotideLink:NUCLEOTIDE_LINK_CONFIG,colors:COLORS_CONFIG,animation:ANIMATION_CONFIG,export:EXPORT_CONFIG}=DEFAULT_CONFIG$1;function calculateTipWidth(yt,Et){const xt="gene"in Et?Et.gene:Et;if((xt.tipWidthMode||"factor")==="fixed"){const bt=xt.tipWidthFixed??200,At=yt*.5;return Math.min(bt,At)}else{const bt=xt.tipWidthFactor||.05;return yt*bt}}function resolveMode(yt){if(!yt)return"light";if(yt==="system"&&typeof window<"u")try{return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}return yt==="dark"?"dark":"light"}if(typeof window<"u")try{const Et=window.localStorage.getItem("hoodini_theme"),xt=DEFAULT_CONFIG$1.theme?.mode??"light",bt=resolveMode(Et||xt||"light"),At=document.documentElement;bt==="dark"?(At.classList.add("dark"),At.classList.remove("light")):(At.classList.remove("dark"),At.classList.add("light"))}catch{}const STORAGE_KEY="hoodini_theme",ThemeContext$1=reactExports.createContext(null),useTheme=()=>{const yt=reactExports.useContext(ThemeContext$1);return yt||{theme:"light",setTheme:()=>{},resolvedTheme:"light",getThemeColors:()=>({background:"#ffffff",foreground:"#000000",muted:"#f4f4f5",mutedForeground:"#71717a",border:"#e4e4e7",primary:"#18181b",primaryForeground:"#fafafa"})}},ThemeProvider=({children:yt})=>{const Et=DEFAULT_CONFIG$1.theme?.mode??"light",vt=(typeof window<"u"?window.localStorage.getItem(STORAGE_KEY):null)||Et||"light",[bt,At]=reactExports.useState(vt),[Ft,Ct]=reactExports.useState(()=>resolveMode(vt)),wt=(Pt=bt)=>{let Lt=Pt;return Pt==="system"&&typeof window<"u"&&(Lt=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),DEFAULT_CONFIG$1.theme?.[Lt]??{}},St=wt(Ft),Tt=Pt=>{At(Pt);try{window.localStorage.setItem(STORAGE_KEY,Pt)}catch{}try{const Lt=resolveMode(Pt);Ct(Lt);const kt=document.documentElement;Lt==="dark"?(kt.classList.add("dark"),kt.classList.remove("light")):(kt.classList.remove("dark"),kt.classList.add("light"))}catch{}},Rt=()=>{Tt(Ft==="light"?"dark":"light")};return reactExports.useEffect(()=>{const Pt=resolveMode(bt);Ct(Pt);const Lt=document.documentElement;Pt==="dark"?(Lt.classList.add("dark"),Lt.classList.remove("light")):(Lt.classList.remove("dark"),Lt.classList.add("light"));let kt,Ot;if(bt==="system"&&typeof window<"u"&&window.matchMedia)try{kt=window.matchMedia("(prefers-color-scheme: dark)"),Ot=Mt=>{const It=Mt.matches?"dark":"light";It==="dark"?(Lt.classList.add("dark"),Lt.classList.remove("light")):(Lt.classList.remove("dark"),Lt.classList.add("light")),Ct(It)},kt.addEventListener?kt.addEventListener("change",Ot):kt.addListener&&kt.addListener(Ot)}catch{}return()=>{kt&&Ot&&(kt.removeEventListener?kt.removeEventListener("change",Ot):kt.removeListener&&kt.removeListener(Ot))}},[bt]),jsxRuntimeExports.jsx(ThemeContext$1.Provider,{value:{theme:bt,resolvedTheme:Ft,themeColors:St,getThemeColors:Pt=>wt(Pt||Ft),setTheme:Tt,toggleTheme:Rt,isLight:Ft==="light",isDark:Ft==="dark"},children:yt})};function setRef(yt,Et){if(typeof yt=="function")return yt(Et);yt!=null&&(yt.current=Et)}function composeRefs(...yt){return Et=>{let xt=!1;const vt=yt.map(bt=>{const At=setRef(bt,Et);return!xt&&typeof At=="function"&&(xt=!0),At});if(xt)return()=>{for(let bt=0;bt<vt.length;bt++){const At=vt[bt];typeof At=="function"?At():setRef(yt[bt],null)}}}}function useComposedRefs(...yt){return reactExports.useCallback(composeRefs(...yt),yt)}var REACT_LAZY_TYPE=Symbol.for("react.lazy"),use=React$1[" use ".trim().toString()];function isPromiseLike(yt){return typeof yt=="object"&&yt!==null&&"then"in yt}function isLazyComponent(yt){return yt!=null&&typeof yt=="object"&&"$$typeof"in yt&&yt.$$typeof===REACT_LAZY_TYPE&&"_payload"in yt&&isPromiseLike(yt._payload)}function createSlot$c(yt){const Et=createSlotClone$c(yt),xt=reactExports.forwardRef((vt,bt)=>{let{children:At,...Ft}=vt;isLazyComponent(At)&&typeof use=="function"&&(At=use(At._payload));const Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$c);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}var Slot$1=createSlot$c("Slot");function createSlotClone$c(yt){const Et=reactExports.forwardRef((xt,vt)=>{let{children:bt,...At}=xt;if(isLazyComponent(bt)&&typeof use=="function"&&(bt=use(bt._payload)),reactExports.isValidElement(bt)){const Ft=getElementRef$d(bt),Ct=mergeProps$c(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$c=Symbol("radix.slottable");function isSlottable$c(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$c}function mergeProps$c(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$d(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}function r$1(yt){var Et,xt,vt="";if(typeof yt=="string"||typeof yt=="number")vt+=yt;else if(typeof yt=="object")if(Array.isArray(yt)){var bt=yt.length;for(Et=0;Et<bt;Et++)yt[Et]&&(xt=r$1(yt[Et]))&&(vt&&(vt+=" "),vt+=xt)}else for(xt in yt)yt[xt]&&(vt&&(vt+=" "),vt+=xt);return vt}function clsx(){for(var yt,Et,xt=0,vt="",bt=arguments.length;xt<bt;xt++)(yt=arguments[xt])&&(Et=r$1(yt))&&(vt&&(vt+=" "),vt+=Et);return vt}const falsyToString=yt=>typeof yt=="boolean"?`${yt}`:yt===0?"0":yt,cx$1=clsx,cva=(yt,Et)=>xt=>{var vt;if(Et?.variants==null)return cx$1(yt,xt?.class,xt?.className);const{variants:bt,defaultVariants:At}=Et,Ft=Object.keys(bt).map(St=>{const Tt=xt?.[St],Rt=At?.[St];if(Tt===null)return null;const Pt=falsyToString(Tt)||falsyToString(Rt);return bt[St][Pt]}),Ct=xt&&Object.entries(xt).reduce((St,Tt)=>{let[Rt,Pt]=Tt;return Pt===void 0||(St[Rt]=Pt),St},{}),wt=Et==null||(vt=Et.compoundVariants)===null||vt===void 0?void 0:vt.reduce((St,Tt)=>{let{class:Rt,className:Pt,...Lt}=Tt;return Object.entries(Lt).every(kt=>{let[Ot,Mt]=kt;return Array.isArray(Mt)?Mt.includes({...At,...Ct}[Ot]):{...At,...Ct}[Ot]===Mt})?[...St,Rt,Pt]:St},[]);return cx$1(yt,Ft,wt,xt?.class,xt?.className)},MOBILE_BREAKPOINT=768;function useIsMobile(){const[yt,Et]=reactExports.useState(void 0);return reactExports.useEffect(()=>{const xt=window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT-1}px)`),vt=()=>{Et(window.innerWidth<MOBILE_BREAKPOINT)};return xt.addEventListener("change",vt),Et(window.innerWidth<MOBILE_BREAKPOINT),()=>xt.removeEventListener("change",vt)},[]),!!yt}const concatArrays=(yt,Et)=>{const xt=new Array(yt.length+Et.length);for(let vt=0;vt<yt.length;vt++)xt[vt]=yt[vt];for(let vt=0;vt<Et.length;vt++)xt[yt.length+vt]=Et[vt];return xt},createClassValidatorObject=(yt,Et)=>({classGroupId:yt,validator:Et}),createClassPartObject=(yt=new Map,Et=null,xt)=>({nextPart:yt,validators:Et,classGroupId:xt}),CLASS_PART_SEPARATOR="-",EMPTY_CONFLICTS=[],ARBITRARY_PROPERTY_PREFIX="arbitrary..",createClassGroupUtils=yt=>{const Et=createClassMap(yt),{conflictingClassGroups:xt,conflictingClassGroupModifiers:vt}=yt;return{getClassGroupId:Ft=>{if(Ft.startsWith("[")&&Ft.endsWith("]"))return getGroupIdForArbitraryProperty(Ft);const Ct=Ft.split(CLASS_PART_SEPARATOR),wt=Ct[0]===""&&Ct.length>1?1:0;return getGroupRecursive(Ct,wt,Et)},getConflictingClassGroupIds:(Ft,Ct)=>{if(Ct){const wt=vt[Ft],St=xt[Ft];return wt?St?concatArrays(St,wt):wt:St||EMPTY_CONFLICTS}return xt[Ft]||EMPTY_CONFLICTS}}},getGroupRecursive=(yt,Et,xt)=>{if(yt.length-Et===0)return xt.classGroupId;const bt=yt[Et],At=xt.nextPart.get(bt);if(At){const St=getGroupRecursive(yt,Et+1,At);if(St)return St}const Ft=xt.validators;if(Ft===null)return;const Ct=Et===0?yt.join(CLASS_PART_SEPARATOR):yt.slice(Et).join(CLASS_PART_SEPARATOR),wt=Ft.length;for(let St=0;St<wt;St++){const Tt=Ft[St];if(Tt.validator(Ct))return Tt.classGroupId}},getGroupIdForArbitraryProperty=yt=>yt.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const Et=yt.slice(1,-1),xt=Et.indexOf(":"),vt=Et.slice(0,xt);return vt?ARBITRARY_PROPERTY_PREFIX+vt:void 0})(),createClassMap=yt=>{const{theme:Et,classGroups:xt}=yt;return processClassGroups(xt,Et)},processClassGroups=(yt,Et)=>{const xt=createClassPartObject();for(const vt in yt){const bt=yt[vt];processClassesRecursively(bt,xt,vt,Et)}return xt},processClassesRecursively=(yt,Et,xt,vt)=>{const bt=yt.length;for(let At=0;At<bt;At++){const Ft=yt[At];processClassDefinition(Ft,Et,xt,vt)}},processClassDefinition=(yt,Et,xt,vt)=>{if(typeof yt=="string"){processStringDefinition(yt,Et,xt);return}if(typeof yt=="function"){processFunctionDefinition(yt,Et,xt,vt);return}processObjectDefinition(yt,Et,xt,vt)},processStringDefinition=(yt,Et,xt)=>{const vt=yt===""?Et:getPart(Et,yt);vt.classGroupId=xt},processFunctionDefinition=(yt,Et,xt,vt)=>{if(isThemeGetter(yt)){processClassesRecursively(yt(vt),Et,xt,vt);return}Et.validators===null&&(Et.validators=[]),Et.validators.push(createClassValidatorObject(xt,yt))},processObjectDefinition=(yt,Et,xt,vt)=>{const bt=Object.entries(yt),At=bt.length;for(let Ft=0;Ft<At;Ft++){const[Ct,wt]=bt[Ft];processClassesRecursively(wt,getPart(Et,Ct),xt,vt)}},getPart=(yt,Et)=>{let xt=yt;const vt=Et.split(CLASS_PART_SEPARATOR),bt=vt.length;for(let At=0;At<bt;At++){const Ft=vt[At];let Ct=xt.nextPart.get(Ft);Ct||(Ct=createClassPartObject(),xt.nextPart.set(Ft,Ct)),xt=Ct}return xt},isThemeGetter=yt=>"isThemeGetter"in yt&&yt.isThemeGetter===!0,createLruCache=yt=>{if(yt<1)return{get:()=>{},set:()=>{}};let Et=0,xt=Object.create(null),vt=Object.create(null);const bt=(At,Ft)=>{xt[At]=Ft,Et++,Et>yt&&(Et=0,vt=xt,xt=Object.create(null))};return{get(At){let Ft=xt[At];if(Ft!==void 0)return Ft;if((Ft=vt[At])!==void 0)return bt(At,Ft),Ft},set(At,Ft){At in xt?xt[At]=Ft:bt(At,Ft)}}},IMPORTANT_MODIFIER="!",MODIFIER_SEPARATOR=":",EMPTY_MODIFIERS=[],createResultObject=(yt,Et,xt,vt,bt)=>({modifiers:yt,hasImportantModifier:Et,baseClassName:xt,maybePostfixModifierPosition:vt,isExternal:bt}),createParseClassName=yt=>{const{prefix:Et,experimentalParseClassName:xt}=yt;let vt=bt=>{const At=[];let Ft=0,Ct=0,wt=0,St;const Tt=bt.length;for(let Ot=0;Ot<Tt;Ot++){const Mt=bt[Ot];if(Ft===0&&Ct===0){if(Mt===MODIFIER_SEPARATOR){At.push(bt.slice(wt,Ot)),wt=Ot+1;continue}if(Mt==="/"){St=Ot;continue}}Mt==="["?Ft++:Mt==="]"?Ft--:Mt==="("?Ct++:Mt===")"&&Ct--}const Rt=At.length===0?bt:bt.slice(wt);let Pt=Rt,Lt=!1;Rt.endsWith(IMPORTANT_MODIFIER)?(Pt=Rt.slice(0,-1),Lt=!0):Rt.startsWith(IMPORTANT_MODIFIER)&&(Pt=Rt.slice(1),Lt=!0);const kt=St&&St>wt?St-wt:void 0;return createResultObject(At,Lt,Pt,kt)};if(Et){const bt=Et+MODIFIER_SEPARATOR,At=vt;vt=Ft=>Ft.startsWith(bt)?At(Ft.slice(bt.length)):createResultObject(EMPTY_MODIFIERS,!1,Ft,void 0,!0)}if(xt){const bt=vt;vt=At=>xt({className:At,parseClassName:bt})}return vt},createSortModifiers=yt=>{const Et=new Map;return yt.orderSensitiveModifiers.forEach((xt,vt)=>{Et.set(xt,1e6+vt)}),xt=>{const vt=[];let bt=[];for(let At=0;At<xt.length;At++){const Ft=xt[At],Ct=Ft[0]==="[",wt=Et.has(Ft);Ct||wt?(bt.length>0&&(bt.sort(),vt.push(...bt),bt=[]),vt.push(Ft)):bt.push(Ft)}return bt.length>0&&(bt.sort(),vt.push(...bt)),vt}},createConfigUtils=yt=>({cache:createLruCache(yt.cacheSize),parseClassName:createParseClassName(yt),sortModifiers:createSortModifiers(yt),...createClassGroupUtils(yt)}),SPLIT_CLASSES_REGEX=/\s+/,mergeClassList=(yt,Et)=>{const{parseClassName:xt,getClassGroupId:vt,getConflictingClassGroupIds:bt,sortModifiers:At}=Et,Ft=[],Ct=yt.trim().split(SPLIT_CLASSES_REGEX);let wt="";for(let St=Ct.length-1;St>=0;St-=1){const Tt=Ct[St],{isExternal:Rt,modifiers:Pt,hasImportantModifier:Lt,baseClassName:kt,maybePostfixModifierPosition:Ot}=xt(Tt);if(Rt){wt=Tt+(wt.length>0?" "+wt:wt);continue}let Mt=!!Ot,It=vt(Mt?kt.substring(0,Ot):kt);if(!It){if(!Mt){wt=Tt+(wt.length>0?" "+wt:wt);continue}if(It=vt(kt),!It){wt=Tt+(wt.length>0?" "+wt:wt);continue}Mt=!1}const Nt=Pt.length===0?"":Pt.length===1?Pt[0]:At(Pt).join(":"),Ut=Lt?Nt+IMPORTANT_MODIFIER:Nt,jt=Ut+It;if(Ft.indexOf(jt)>-1)continue;Ft.push(jt);const Vt=bt(It,Mt);for(let zt=0;zt<Vt.length;++zt){const Ht=Vt[zt];Ft.push(Ut+Ht)}wt=Tt+(wt.length>0?" "+wt:wt)}return wt},twJoin=(...yt)=>{let Et=0,xt,vt,bt="";for(;Et<yt.length;)(xt=yt[Et++])&&(vt=toValue(xt))&&(bt&&(bt+=" "),bt+=vt);return bt},toValue=yt=>{if(typeof yt=="string")return yt;let Et,xt="";for(let vt=0;vt<yt.length;vt++)yt[vt]&&(Et=toValue(yt[vt]))&&(xt&&(xt+=" "),xt+=Et);return xt},createTailwindMerge=(yt,...Et)=>{let xt,vt,bt,At;const Ft=wt=>{const St=Et.reduce((Tt,Rt)=>Rt(Tt),yt());return xt=createConfigUtils(St),vt=xt.cache.get,bt=xt.cache.set,At=Ct,Ct(wt)},Ct=wt=>{const St=vt(wt);if(St)return St;const Tt=mergeClassList(wt,xt);return bt(wt,Tt),Tt};return At=Ft,(...wt)=>At(twJoin(...wt))},fallbackThemeArr=[],fromTheme=yt=>{const Et=xt=>xt[yt]||fallbackThemeArr;return Et.isThemeGetter=!0,Et},arbitraryValueRegex=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,arbitraryVariableRegex=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fractionRegex=/^\d+\/\d+$/,tshirtUnitRegex=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lengthUnitRegex=/\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$/,colorFunctionRegex=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,shadowRegex=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,imageRegex=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,isFraction=yt=>fractionRegex.test(yt),isNumber=yt=>!!yt&&!Number.isNaN(Number(yt)),isInteger=yt=>!!yt&&Number.isInteger(Number(yt)),isPercent=yt=>yt.endsWith("%")&&isNumber(yt.slice(0,-1)),isTshirtSize=yt=>tshirtUnitRegex.test(yt),isAny=()=>!0,isLengthOnly=yt=>lengthUnitRegex.test(yt)&&!colorFunctionRegex.test(yt),isNever=()=>!1,isShadow=yt=>shadowRegex.test(yt),isImage=yt=>imageRegex.test(yt),isAnyNonArbitrary=yt=>!isArbitraryValue(yt)&&!isArbitraryVariable(yt),isArbitrarySize=yt=>getIsArbitraryValue(yt,isLabelSize,isNever),isArbitraryValue=yt=>arbitraryValueRegex.test(yt),isArbitraryLength=yt=>getIsArbitraryValue(yt,isLabelLength,isLengthOnly),isArbitraryNumber=yt=>getIsArbitraryValue(yt,isLabelNumber,isNumber),isArbitraryPosition=yt=>getIsArbitraryValue(yt,isLabelPosition,isNever),isArbitraryImage=yt=>getIsArbitraryValue(yt,isLabelImage,isImage),isArbitraryShadow=yt=>getIsArbitraryValue(yt,isLabelShadow,isShadow),isArbitraryVariable=yt=>arbitraryVariableRegex.test(yt),isArbitraryVariableLength=yt=>getIsArbitraryVariable(yt,isLabelLength),isArbitraryVariableFamilyName=yt=>getIsArbitraryVariable(yt,isLabelFamilyName),isArbitraryVariablePosition=yt=>getIsArbitraryVariable(yt,isLabelPosition),isArbitraryVariableSize=yt=>getIsArbitraryVariable(yt,isLabelSize),isArbitraryVariableImage=yt=>getIsArbitraryVariable(yt,isLabelImage),isArbitraryVariableShadow=yt=>getIsArbitraryVariable(yt,isLabelShadow,!0),getIsArbitraryValue=(yt,Et,xt)=>{const vt=arbitraryValueRegex.exec(yt);return vt?vt[1]?Et(vt[1]):xt(vt[2]):!1},getIsArbitraryVariable=(yt,Et,xt=!1)=>{const vt=arbitraryVariableRegex.exec(yt);return vt?vt[1]?Et(vt[1]):xt:!1},isLabelPosition=yt=>yt==="position"||yt==="percentage",isLabelImage=yt=>yt==="image"||yt==="url",isLabelSize=yt=>yt==="length"||yt==="size"||yt==="bg-size",isLabelLength=yt=>yt==="length",isLabelNumber=yt=>yt==="number",isLabelFamilyName=yt=>yt==="family-name",isLabelShadow=yt=>yt==="shadow",getDefaultConfig=()=>{const yt=fromTheme("color"),Et=fromTheme("font"),xt=fromTheme("text"),vt=fromTheme("font-weight"),bt=fromTheme("tracking"),At=fromTheme("leading"),Ft=fromTheme("breakpoint"),Ct=fromTheme("container"),wt=fromTheme("spacing"),St=fromTheme("radius"),Tt=fromTheme("shadow"),Rt=fromTheme("inset-shadow"),Pt=fromTheme("text-shadow"),Lt=fromTheme("drop-shadow"),kt=fromTheme("blur"),Ot=fromTheme("perspective"),Mt=fromTheme("aspect"),It=fromTheme("ease"),Nt=fromTheme("animate"),Ut=()=>["auto","avoid","all","avoid-page","page","left","right","column"],jt=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Vt=()=>[...jt(),isArbitraryVariable,isArbitraryValue],zt=()=>["auto","hidden","clip","visible","scroll"],Ht=()=>["auto","contain","none"],Wt=()=>[isArbitraryVariable,isArbitraryValue,wt],Gt=()=>[isFraction,"full","auto",...Wt()],qt=()=>[isInteger,"none","subgrid",isArbitraryVariable,isArbitraryValue],Xt=()=>["auto",{span:["full",isInteger,isArbitraryVariable,isArbitraryValue]},isInteger,isArbitraryVariable,isArbitraryValue],Kt=()=>[isInteger,"auto",isArbitraryVariable,isArbitraryValue],Jt=()=>["auto","min","max","fr",isArbitraryVariable,isArbitraryValue],tn=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],sn=()=>["start","end","center","stretch","center-safe","end-safe"],Zt=()=>["auto",...Wt()],nn=()=>[isFraction,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Wt()],rn=()=>[yt,isArbitraryVariable,isArbitraryValue],on=()=>[...jt(),isArbitraryVariablePosition,isArbitraryPosition,{position:[isArbitraryVariable,isArbitraryValue]}],ln=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Qt=()=>["auto","cover","contain",isArbitraryVariableSize,isArbitrarySize,{size:[isArbitraryVariable,isArbitraryValue]}],fn=()=>[isPercent,isArbitraryVariableLength,isArbitraryLength],pn=()=>["","none","full",St,isArbitraryVariable,isArbitraryValue],mn=()=>["",isNumber,isArbitraryVariableLength,isArbitraryLength],vn=()=>["solid","dashed","dotted","double"],yn=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xn=()=>[isNumber,isPercent,isArbitraryVariablePosition,isArbitraryPosition],Mn=()=>["","none",kt,isArbitraryVariable,isArbitraryValue],$n=()=>["none",isNumber,isArbitraryVariable,isArbitraryValue],Rn=()=>["none",isNumber,isArbitraryVariable,isArbitraryValue],Tn=()=>[isNumber,isArbitraryVariable,isArbitraryValue],ir=()=>[isFraction,"full",...Wt()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[isTshirtSize],breakpoint:[isTshirtSize],color:[isAny],container:[isTshirtSize],"drop-shadow":[isTshirtSize],ease:["in","out","in-out"],font:[isAnyNonArbitrary],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[isTshirtSize],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[isTshirtSize],shadow:[isTshirtSize],spacing:["px",isNumber],text:[isTshirtSize],"text-shadow":[isTshirtSize],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",isFraction,isArbitraryValue,isArbitraryVariable,Mt]}],container:["container"],columns:[{columns:[isNumber,isArbitraryValue,isArbitraryVariable,Ct]}],"break-after":[{"break-after":Ut()}],"break-before":[{"break-before":Ut()}],"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:Vt()}],overflow:[{overflow:zt()}],"overflow-x":[{"overflow-x":zt()}],"overflow-y":[{"overflow-y":zt()}],overscroll:[{overscroll:Ht()}],"overscroll-x":[{"overscroll-x":Ht()}],"overscroll-y":[{"overscroll-y":Ht()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Gt()}],"inset-x":[{"inset-x":Gt()}],"inset-y":[{"inset-y":Gt()}],start:[{start:Gt()}],end:[{end:Gt()}],top:[{top:Gt()}],right:[{right:Gt()}],bottom:[{bottom:Gt()}],left:[{left:Gt()}],visibility:["visible","invisible","collapse"],z:[{z:[isInteger,"auto",isArbitraryVariable,isArbitraryValue]}],basis:[{basis:[isFraction,"full","auto",Ct,...Wt()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[isNumber,isFraction,"auto","initial","none",isArbitraryValue]}],grow:[{grow:["",isNumber,isArbitraryVariable,isArbitraryValue]}],shrink:[{shrink:["",isNumber,isArbitraryVariable,isArbitraryValue]}],order:[{order:[isInteger,"first","last","none",isArbitraryVariable,isArbitraryValue]}],"grid-cols":[{"grid-cols":qt()}],"col-start-end":[{col:Xt()}],"col-start":[{"col-start":Kt()}],"col-end":[{"col-end":Kt()}],"grid-rows":[{"grid-rows":qt()}],"row-start-end":[{row:Xt()}],"row-start":[{"row-start":Kt()}],"row-end":[{"row-end":Kt()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Jt()}],"auto-rows":[{"auto-rows":Jt()}],gap:[{gap:Wt()}],"gap-x":[{"gap-x":Wt()}],"gap-y":[{"gap-y":Wt()}],"justify-content":[{justify:[...tn(),"normal"]}],"justify-items":[{"justify-items":[...sn(),"normal"]}],"justify-self":[{"justify-self":["auto",...sn()]}],"align-content":[{content:["normal",...tn()]}],"align-items":[{items:[...sn(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...sn(),{baseline:["","last"]}]}],"place-content":[{"place-content":tn()}],"place-items":[{"place-items":[...sn(),"baseline"]}],"place-self":[{"place-self":["auto",...sn()]}],p:[{p:Wt()}],px:[{px:Wt()}],py:[{py:Wt()}],ps:[{ps:Wt()}],pe:[{pe:Wt()}],pt:[{pt:Wt()}],pr:[{pr:Wt()}],pb:[{pb:Wt()}],pl:[{pl:Wt()}],m:[{m:Zt()}],mx:[{mx:Zt()}],my:[{my:Zt()}],ms:[{ms:Zt()}],me:[{me:Zt()}],mt:[{mt:Zt()}],mr:[{mr:Zt()}],mb:[{mb:Zt()}],ml:[{ml:Zt()}],"space-x":[{"space-x":Wt()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Wt()}],"space-y-reverse":["space-y-reverse"],size:[{size:nn()}],w:[{w:[Ct,"screen",...nn()]}],"min-w":[{"min-w":[Ct,"screen","none",...nn()]}],"max-w":[{"max-w":[Ct,"screen","none","prose",{screen:[Ft]},...nn()]}],h:[{h:["screen","lh",...nn()]}],"min-h":[{"min-h":["screen","lh","none",...nn()]}],"max-h":[{"max-h":["screen","lh",...nn()]}],"font-size":[{text:["base",xt,isArbitraryVariableLength,isArbitraryLength]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[vt,isArbitraryVariable,isArbitraryNumber]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",isPercent,isArbitraryValue]}],"font-family":[{font:[isArbitraryVariableFamilyName,isArbitraryValue,Et]}],"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:[bt,isArbitraryVariable,isArbitraryValue]}],"line-clamp":[{"line-clamp":[isNumber,"none",isArbitraryVariable,isArbitraryNumber]}],leading:[{leading:[At,...Wt()]}],"list-image":[{"list-image":["none",isArbitraryVariable,isArbitraryValue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",isArbitraryVariable,isArbitraryValue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:rn()}],"text-color":[{text:rn()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...vn(),"wavy"]}],"text-decoration-thickness":[{decoration:[isNumber,"from-font","auto",isArbitraryVariable,isArbitraryLength]}],"text-decoration-color":[{decoration:rn()}],"underline-offset":[{"underline-offset":[isNumber,"auto",isArbitraryVariable,isArbitraryValue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Wt()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",isArbitraryVariable,isArbitraryValue]}],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",isArbitraryVariable,isArbitraryValue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:on()}],"bg-repeat":[{bg:ln()}],"bg-size":[{bg:Qt()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},isInteger,isArbitraryVariable,isArbitraryValue],radial:["",isArbitraryVariable,isArbitraryValue],conic:[isInteger,isArbitraryVariable,isArbitraryValue]},isArbitraryVariableImage,isArbitraryImage]}],"bg-color":[{bg:rn()}],"gradient-from-pos":[{from:fn()}],"gradient-via-pos":[{via:fn()}],"gradient-to-pos":[{to:fn()}],"gradient-from":[{from:rn()}],"gradient-via":[{via:rn()}],"gradient-to":[{to:rn()}],rounded:[{rounded:pn()}],"rounded-s":[{"rounded-s":pn()}],"rounded-e":[{"rounded-e":pn()}],"rounded-t":[{"rounded-t":pn()}],"rounded-r":[{"rounded-r":pn()}],"rounded-b":[{"rounded-b":pn()}],"rounded-l":[{"rounded-l":pn()}],"rounded-ss":[{"rounded-ss":pn()}],"rounded-se":[{"rounded-se":pn()}],"rounded-ee":[{"rounded-ee":pn()}],"rounded-es":[{"rounded-es":pn()}],"rounded-tl":[{"rounded-tl":pn()}],"rounded-tr":[{"rounded-tr":pn()}],"rounded-br":[{"rounded-br":pn()}],"rounded-bl":[{"rounded-bl":pn()}],"border-w":[{border:mn()}],"border-w-x":[{"border-x":mn()}],"border-w-y":[{"border-y":mn()}],"border-w-s":[{"border-s":mn()}],"border-w-e":[{"border-e":mn()}],"border-w-t":[{"border-t":mn()}],"border-w-r":[{"border-r":mn()}],"border-w-b":[{"border-b":mn()}],"border-w-l":[{"border-l":mn()}],"divide-x":[{"divide-x":mn()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":mn()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...vn(),"hidden","none"]}],"divide-style":[{divide:[...vn(),"hidden","none"]}],"border-color":[{border:rn()}],"border-color-x":[{"border-x":rn()}],"border-color-y":[{"border-y":rn()}],"border-color-s":[{"border-s":rn()}],"border-color-e":[{"border-e":rn()}],"border-color-t":[{"border-t":rn()}],"border-color-r":[{"border-r":rn()}],"border-color-b":[{"border-b":rn()}],"border-color-l":[{"border-l":rn()}],"divide-color":[{divide:rn()}],"outline-style":[{outline:[...vn(),"none","hidden"]}],"outline-offset":[{"outline-offset":[isNumber,isArbitraryVariable,isArbitraryValue]}],"outline-w":[{outline:["",isNumber,isArbitraryVariableLength,isArbitraryLength]}],"outline-color":[{outline:rn()}],shadow:[{shadow:["","none",Tt,isArbitraryVariableShadow,isArbitraryShadow]}],"shadow-color":[{shadow:rn()}],"inset-shadow":[{"inset-shadow":["none",Rt,isArbitraryVariableShadow,isArbitraryShadow]}],"inset-shadow-color":[{"inset-shadow":rn()}],"ring-w":[{ring:mn()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:rn()}],"ring-offset-w":[{"ring-offset":[isNumber,isArbitraryLength]}],"ring-offset-color":[{"ring-offset":rn()}],"inset-ring-w":[{"inset-ring":mn()}],"inset-ring-color":[{"inset-ring":rn()}],"text-shadow":[{"text-shadow":["none",Pt,isArbitraryVariableShadow,isArbitraryShadow]}],"text-shadow-color":[{"text-shadow":rn()}],opacity:[{opacity:[isNumber,isArbitraryVariable,isArbitraryValue]}],"mix-blend":[{"mix-blend":[...yn(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":yn()}],"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":[isNumber]}],"mask-image-linear-from-pos":[{"mask-linear-from":xn()}],"mask-image-linear-to-pos":[{"mask-linear-to":xn()}],"mask-image-linear-from-color":[{"mask-linear-from":rn()}],"mask-image-linear-to-color":[{"mask-linear-to":rn()}],"mask-image-t-from-pos":[{"mask-t-from":xn()}],"mask-image-t-to-pos":[{"mask-t-to":xn()}],"mask-image-t-from-color":[{"mask-t-from":rn()}],"mask-image-t-to-color":[{"mask-t-to":rn()}],"mask-image-r-from-pos":[{"mask-r-from":xn()}],"mask-image-r-to-pos":[{"mask-r-to":xn()}],"mask-image-r-from-color":[{"mask-r-from":rn()}],"mask-image-r-to-color":[{"mask-r-to":rn()}],"mask-image-b-from-pos":[{"mask-b-from":xn()}],"mask-image-b-to-pos":[{"mask-b-to":xn()}],"mask-image-b-from-color":[{"mask-b-from":rn()}],"mask-image-b-to-color":[{"mask-b-to":rn()}],"mask-image-l-from-pos":[{"mask-l-from":xn()}],"mask-image-l-to-pos":[{"mask-l-to":xn()}],"mask-image-l-from-color":[{"mask-l-from":rn()}],"mask-image-l-to-color":[{"mask-l-to":rn()}],"mask-image-x-from-pos":[{"mask-x-from":xn()}],"mask-image-x-to-pos":[{"mask-x-to":xn()}],"mask-image-x-from-color":[{"mask-x-from":rn()}],"mask-image-x-to-color":[{"mask-x-to":rn()}],"mask-image-y-from-pos":[{"mask-y-from":xn()}],"mask-image-y-to-pos":[{"mask-y-to":xn()}],"mask-image-y-from-color":[{"mask-y-from":rn()}],"mask-image-y-to-color":[{"mask-y-to":rn()}],"mask-image-radial":[{"mask-radial":[isArbitraryVariable,isArbitraryValue]}],"mask-image-radial-from-pos":[{"mask-radial-from":xn()}],"mask-image-radial-to-pos":[{"mask-radial-to":xn()}],"mask-image-radial-from-color":[{"mask-radial-from":rn()}],"mask-image-radial-to-color":[{"mask-radial-to":rn()}],"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":jt()}],"mask-image-conic-pos":[{"mask-conic":[isNumber]}],"mask-image-conic-from-pos":[{"mask-conic-from":xn()}],"mask-image-conic-to-pos":[{"mask-conic-to":xn()}],"mask-image-conic-from-color":[{"mask-conic-from":rn()}],"mask-image-conic-to-color":[{"mask-conic-to":rn()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:on()}],"mask-repeat":[{mask:ln()}],"mask-size":[{mask:Qt()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",isArbitraryVariable,isArbitraryValue]}],filter:[{filter:["","none",isArbitraryVariable,isArbitraryValue]}],blur:[{blur:Mn()}],brightness:[{brightness:[isNumber,isArbitraryVariable,isArbitraryValue]}],contrast:[{contrast:[isNumber,isArbitraryVariable,isArbitraryValue]}],"drop-shadow":[{"drop-shadow":["","none",Lt,isArbitraryVariableShadow,isArbitraryShadow]}],"drop-shadow-color":[{"drop-shadow":rn()}],grayscale:[{grayscale:["",isNumber,isArbitraryVariable,isArbitraryValue]}],"hue-rotate":[{"hue-rotate":[isNumber,isArbitraryVariable,isArbitraryValue]}],invert:[{invert:["",isNumber,isArbitraryVariable,isArbitraryValue]}],saturate:[{saturate:[isNumber,isArbitraryVariable,isArbitraryValue]}],sepia:[{sepia:["",isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-filter":[{"backdrop-filter":["","none",isArbitraryVariable,isArbitraryValue]}],"backdrop-blur":[{"backdrop-blur":Mn()}],"backdrop-brightness":[{"backdrop-brightness":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-contrast":[{"backdrop-contrast":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-invert":[{"backdrop-invert":["",isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-opacity":[{"backdrop-opacity":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-saturate":[{"backdrop-saturate":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-sepia":[{"backdrop-sepia":["",isNumber,isArbitraryVariable,isArbitraryValue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Wt()}],"border-spacing-x":[{"border-spacing-x":Wt()}],"border-spacing-y":[{"border-spacing-y":Wt()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",isArbitraryVariable,isArbitraryValue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[isNumber,"initial",isArbitraryVariable,isArbitraryValue]}],ease:[{ease:["linear","initial",It,isArbitraryVariable,isArbitraryValue]}],delay:[{delay:[isNumber,isArbitraryVariable,isArbitraryValue]}],animate:[{animate:["none",Nt,isArbitraryVariable,isArbitraryValue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[Ot,isArbitraryVariable,isArbitraryValue]}],"perspective-origin":[{"perspective-origin":Vt()}],rotate:[{rotate:$n()}],"rotate-x":[{"rotate-x":$n()}],"rotate-y":[{"rotate-y":$n()}],"rotate-z":[{"rotate-z":$n()}],scale:[{scale:Rn()}],"scale-x":[{"scale-x":Rn()}],"scale-y":[{"scale-y":Rn()}],"scale-z":[{"scale-z":Rn()}],"scale-3d":["scale-3d"],skew:[{skew:Tn()}],"skew-x":[{"skew-x":Tn()}],"skew-y":[{"skew-y":Tn()}],transform:[{transform:[isArbitraryVariable,isArbitraryValue,"","none","gpu","cpu"]}],"transform-origin":[{origin:Vt()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ir()}],"translate-x":[{"translate-x":ir()}],"translate-y":[{"translate-y":ir()}],"translate-z":[{"translate-z":ir()}],"translate-none":["translate-none"],accent:[{accent:rn()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:rn()}],"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",isArbitraryVariable,isArbitraryValue]}],"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":Wt()}],"scroll-mx":[{"scroll-mx":Wt()}],"scroll-my":[{"scroll-my":Wt()}],"scroll-ms":[{"scroll-ms":Wt()}],"scroll-me":[{"scroll-me":Wt()}],"scroll-mt":[{"scroll-mt":Wt()}],"scroll-mr":[{"scroll-mr":Wt()}],"scroll-mb":[{"scroll-mb":Wt()}],"scroll-ml":[{"scroll-ml":Wt()}],"scroll-p":[{"scroll-p":Wt()}],"scroll-px":[{"scroll-px":Wt()}],"scroll-py":[{"scroll-py":Wt()}],"scroll-ps":[{"scroll-ps":Wt()}],"scroll-pe":[{"scroll-pe":Wt()}],"scroll-pt":[{"scroll-pt":Wt()}],"scroll-pr":[{"scroll-pr":Wt()}],"scroll-pb":[{"scroll-pb":Wt()}],"scroll-pl":[{"scroll-pl":Wt()}],"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",isArbitraryVariable,isArbitraryValue]}],fill:[{fill:["none",...rn()]}],"stroke-w":[{stroke:[isNumber,isArbitraryVariableLength,isArbitraryLength,isArbitraryNumber]}],stroke:[{stroke:["none",...rn()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],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-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},twMerge=createTailwindMerge(getDefaultConfig);function cn(...yt){return twMerge(clsx(yt))}const buttonVariants=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Button({className:yt,variant:Et,size:xt,asChild:vt=!1,...bt}){const At=vt?Slot$1:"button";return jsxRuntimeExports.jsx(At,{"data-slot":"button",className:cn(buttonVariants({variant:Et,size:xt,className:yt})),...bt})}function Input$2({className:yt,type:Et,...xt}){return jsxRuntimeExports.jsx("input",{type:Et,"data-slot":"input",className:cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",yt),...xt})}var reactDomExports=requireReactDom();const ReactDOM=getDefaultExportFromCjs(reactDomExports);var NODES$b=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$b=NODES$b.reduce((yt,Et)=>{const xt=createSlot$c(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),NAME$4="Separator",DEFAULT_ORIENTATION="horizontal",ORIENTATIONS=["horizontal","vertical"],Separator$1=reactExports.forwardRef((yt,Et)=>{const{decorative:xt,orientation:vt=DEFAULT_ORIENTATION,...bt}=yt,At=isValidOrientation(vt)?vt:DEFAULT_ORIENTATION,Ct=xt?{role:"none"}:{"aria-orientation":At==="vertical"?At:void 0,role:"separator"};return jsxRuntimeExports.jsx(Primitive$b.div,{"data-orientation":At,...Ct,...bt,ref:Et})});Separator$1.displayName=NAME$4;function isValidOrientation(yt){return ORIENTATIONS.includes(yt)}var Root$6=Separator$1;function Separator({className:yt,orientation:Et="horizontal",decorative:xt=!0,...vt}){return jsxRuntimeExports.jsx(Root$6,{"data-slot":"separator",decorative:xt,orientation:Et,className:cn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",yt),...vt})}function composeEventHandlers(yt,Et,{checkForDefaultPrevented:xt=!0}={}){return function(bt){if(yt?.(bt),xt===!1||!bt.defaultPrevented)return Et?.(bt)}}function createContextScope$6(yt,Et=[]){let xt=[];function vt(At,Ft){const Ct=reactExports.createContext(Ft),wt=xt.length;xt=[...xt,Ft];const St=Rt=>{const{scope:Pt,children:Lt,...kt}=Rt,Ot=Pt?.[yt]?.[wt]||Ct,Mt=reactExports.useMemo(()=>kt,Object.values(kt));return jsxRuntimeExports.jsx(Ot.Provider,{value:Mt,children:Lt})};St.displayName=At+"Provider";function Tt(Rt,Pt){const Lt=Pt?.[yt]?.[wt]||Ct,kt=reactExports.useContext(Lt);if(kt)return kt;if(Ft!==void 0)return Ft;throw new Error(`\`${Rt}\` must be used within \`${At}\``)}return[St,Tt]}const bt=()=>{const At=xt.map(Ft=>reactExports.createContext(Ft));return function(Ct){const wt=Ct?.[yt]||At;return reactExports.useMemo(()=>({[`__scope${yt}`]:{...Ct,[yt]:wt}}),[Ct,wt])}};return bt.scopeName=yt,[vt,composeContextScopes$6(bt,...Et)]}function composeContextScopes$6(...yt){const Et=yt[0];if(yt.length===1)return Et;const xt=()=>{const vt=yt.map(bt=>({useScope:bt(),scopeName:bt.scopeName}));return function(At){const Ft=vt.reduce((Ct,{useScope:wt,scopeName:St})=>{const Rt=wt(At)[`__scope${St}`];return{...Ct,...Rt}},{});return reactExports.useMemo(()=>({[`__scope${Et.scopeName}`]:Ft}),[Ft])}};return xt.scopeName=Et.scopeName,xt}function createSlot$b(yt){const Et=createSlotClone$b(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$b);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$b(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$c(bt),Ct=mergeProps$b(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$b=Symbol("radix.slottable");function isSlottable$b(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$b}function mergeProps$b(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$c(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$a=NODES$a.reduce((yt,Et)=>{const xt=createSlot$b(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{});function dispatchDiscreteCustomEvent(yt,Et){yt&&reactDomExports.flushSync(()=>yt.dispatchEvent(Et))}function useCallbackRef$2(yt){const Et=reactExports.useRef(yt);return reactExports.useEffect(()=>{Et.current=yt}),reactExports.useMemo(()=>(...xt)=>Et.current?.(...xt),[])}function useEscapeKeydown(yt,Et=globalThis?.document){const xt=useCallbackRef$2(yt);reactExports.useEffect(()=>{const vt=bt=>{bt.key==="Escape"&&xt(bt)};return Et.addEventListener("keydown",vt,{capture:!0}),()=>Et.removeEventListener("keydown",vt,{capture:!0})},[xt,Et])}var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=reactExports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=reactExports.forwardRef((yt,Et)=>{const{disableOutsidePointerEvents:xt=!1,onEscapeKeyDown:vt,onPointerDownOutside:bt,onFocusOutside:At,onInteractOutside:Ft,onDismiss:Ct,...wt}=yt,St=reactExports.useContext(DismissableLayerContext),[Tt,Rt]=reactExports.useState(null),Pt=Tt?.ownerDocument??globalThis?.document,[,Lt]=reactExports.useState({}),kt=useComposedRefs(Et,Ht=>Rt(Ht)),Ot=Array.from(St.layers),[Mt]=[...St.layersWithOutsidePointerEventsDisabled].slice(-1),It=Ot.indexOf(Mt),Nt=Tt?Ot.indexOf(Tt):-1,Ut=St.layersWithOutsidePointerEventsDisabled.size>0,jt=Nt>=It,Vt=usePointerDownOutside(Ht=>{const Wt=Ht.target,Gt=[...St.branches].some(qt=>qt.contains(Wt));!jt||Gt||(bt?.(Ht),Ft?.(Ht),Ht.defaultPrevented||Ct?.())},Pt),zt=useFocusOutside(Ht=>{const Wt=Ht.target;[...St.branches].some(qt=>qt.contains(Wt))||(At?.(Ht),Ft?.(Ht),Ht.defaultPrevented||Ct?.())},Pt);return useEscapeKeydown(Ht=>{Nt===St.layers.size-1&&(vt?.(Ht),!Ht.defaultPrevented&&Ct&&(Ht.preventDefault(),Ct()))},Pt),reactExports.useEffect(()=>{if(Tt)return xt&&(St.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=Pt.body.style.pointerEvents,Pt.body.style.pointerEvents="none"),St.layersWithOutsidePointerEventsDisabled.add(Tt)),St.layers.add(Tt),dispatchUpdate(),()=>{xt&&St.layersWithOutsidePointerEventsDisabled.size===1&&(Pt.body.style.pointerEvents=originalBodyPointerEvents)}},[Tt,Pt,xt,St]),reactExports.useEffect(()=>()=>{Tt&&(St.layers.delete(Tt),St.layersWithOutsidePointerEventsDisabled.delete(Tt),dispatchUpdate())},[Tt,St]),reactExports.useEffect(()=>{const Ht=()=>Lt({});return document.addEventListener(CONTEXT_UPDATE,Ht),()=>document.removeEventListener(CONTEXT_UPDATE,Ht)},[]),jsxRuntimeExports.jsx(Primitive$a.div,{...wt,ref:kt,style:{pointerEvents:Ut?jt?"auto":"none":void 0,...yt.style},onFocusCapture:composeEventHandlers(yt.onFocusCapture,zt.onFocusCapture),onBlurCapture:composeEventHandlers(yt.onBlurCapture,zt.onBlurCapture),onPointerDownCapture:composeEventHandlers(yt.onPointerDownCapture,Vt.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=reactExports.forwardRef((yt,Et)=>{const xt=reactExports.useContext(DismissableLayerContext),vt=reactExports.useRef(null),bt=useComposedRefs(Et,vt);return reactExports.useEffect(()=>{const At=vt.current;if(At)return xt.branches.add(At),()=>{xt.branches.delete(At)}},[xt.branches]),jsxRuntimeExports.jsx(Primitive$a.div,{...yt,ref:bt})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(yt,Et=globalThis?.document){const xt=useCallbackRef$2(yt),vt=reactExports.useRef(!1),bt=reactExports.useRef(()=>{});return reactExports.useEffect(()=>{const At=Ct=>{if(Ct.target&&!vt.current){let wt=function(){handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE,xt,St,{discrete:!0})};const St={originalEvent:Ct};Ct.pointerType==="touch"?(Et.removeEventListener("click",bt.current),bt.current=wt,Et.addEventListener("click",bt.current,{once:!0})):wt()}else Et.removeEventListener("click",bt.current);vt.current=!1},Ft=window.setTimeout(()=>{Et.addEventListener("pointerdown",At)},0);return()=>{window.clearTimeout(Ft),Et.removeEventListener("pointerdown",At),Et.removeEventListener("click",bt.current)}},[Et,xt]),{onPointerDownCapture:()=>vt.current=!0}}function useFocusOutside(yt,Et=globalThis?.document){const xt=useCallbackRef$2(yt),vt=reactExports.useRef(!1);return reactExports.useEffect(()=>{const bt=At=>{At.target&&!vt.current&&handleAndDispatchCustomEvent(FOCUS_OUTSIDE,xt,{originalEvent:At},{discrete:!1})};return Et.addEventListener("focusin",bt),()=>Et.removeEventListener("focusin",bt)},[Et,xt]),{onFocusCapture:()=>vt.current=!0,onBlurCapture:()=>vt.current=!1}}function dispatchUpdate(){const yt=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(yt)}function handleAndDispatchCustomEvent(yt,Et,xt,{discrete:vt}){const bt=xt.originalEvent.target,At=new CustomEvent(yt,{bubbles:!1,cancelable:!0,detail:xt});Et&&bt.addEventListener(yt,Et,{once:!0}),vt?dispatchDiscreteCustomEvent(bt,At):bt.dispatchEvent(At)}var useLayoutEffect2=globalThis?.document?reactExports.useLayoutEffect:()=>{},useReactId=React$1[" useId ".trim().toString()]||(()=>{}),count$2=0;function useId(yt){const[Et,xt]=reactExports.useState(useReactId());return useLayoutEffect2(()=>{xt(vt=>vt??String(count$2++))},[yt]),Et?`radix-${Et}`:""}const sides=["top","right","bottom","left"],min=Math.min,max=Math.max,round$1=Math.round,floor=Math.floor,createCoords=yt=>({x:yt,y:yt}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$5(yt,Et,xt){return max(yt,min(Et,xt))}function evaluate(yt,Et){return typeof yt=="function"?yt(Et):yt}function getSide(yt){return yt.split("-")[0]}function getAlignment(yt){return yt.split("-")[1]}function getOppositeAxis(yt){return yt==="x"?"y":"x"}function getAxisLength(yt){return yt==="y"?"height":"width"}const yAxisSides=new Set(["top","bottom"]);function getSideAxis(yt){return yAxisSides.has(getSide(yt))?"y":"x"}function getAlignmentAxis(yt){return getOppositeAxis(getSideAxis(yt))}function getAlignmentSides(yt,Et,xt){xt===void 0&&(xt=!1);const vt=getAlignment(yt),bt=getAlignmentAxis(yt),At=getAxisLength(bt);let Ft=bt==="x"?vt===(xt?"end":"start")?"right":"left":vt==="start"?"bottom":"top";return Et.reference[At]>Et.floating[At]&&(Ft=getOppositePlacement(Ft)),[Ft,getOppositePlacement(Ft)]}function getExpandedPlacements(yt){const Et=getOppositePlacement(yt);return[getOppositeAlignmentPlacement(yt),Et,getOppositeAlignmentPlacement(Et)]}function getOppositeAlignmentPlacement(yt){return yt.replace(/start|end/g,Et=>oppositeAlignmentMap[Et])}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(yt,Et,xt){switch(yt){case"top":case"bottom":return xt?Et?rlPlacement:lrPlacement:Et?lrPlacement:rlPlacement;case"left":case"right":return Et?tbPlacement:btPlacement;default:return[]}}function getOppositeAxisPlacements(yt,Et,xt,vt){const bt=getAlignment(yt);let At=getSideList(getSide(yt),xt==="start",vt);return bt&&(At=At.map(Ft=>Ft+"-"+bt),Et&&(At=At.concat(At.map(getOppositeAlignmentPlacement)))),At}function getOppositePlacement(yt){return yt.replace(/left|right|bottom|top/g,Et=>oppositeSideMap[Et])}function expandPaddingObject(yt){return{top:0,right:0,bottom:0,left:0,...yt}}function getPaddingObject$1(yt){return typeof yt!="number"?expandPaddingObject(yt):{top:yt,right:yt,bottom:yt,left:yt}}function rectToClientRect(yt){const{x:Et,y:xt,width:vt,height:bt}=yt;return{width:vt,height:bt,top:xt,left:Et,right:Et+vt,bottom:xt+bt,x:Et,y:xt}}function computeCoordsFromPlacement(yt,Et,xt){let{reference:vt,floating:bt}=yt;const At=getSideAxis(Et),Ft=getAlignmentAxis(Et),Ct=getAxisLength(Ft),wt=getSide(Et),St=At==="y",Tt=vt.x+vt.width/2-bt.width/2,Rt=vt.y+vt.height/2-bt.height/2,Pt=vt[Ct]/2-bt[Ct]/2;let Lt;switch(wt){case"top":Lt={x:Tt,y:vt.y-bt.height};break;case"bottom":Lt={x:Tt,y:vt.y+vt.height};break;case"right":Lt={x:vt.x+vt.width,y:Rt};break;case"left":Lt={x:vt.x-bt.width,y:Rt};break;default:Lt={x:vt.x,y:vt.y}}switch(getAlignment(Et)){case"start":Lt[Ft]-=Pt*(xt&&St?-1:1);break;case"end":Lt[Ft]+=Pt*(xt&&St?-1:1);break}return Lt}async function detectOverflow(yt,Et){var xt;Et===void 0&&(Et={});const{x:vt,y:bt,platform:At,rects:Ft,elements:Ct,strategy:wt}=yt,{boundary:St="clippingAncestors",rootBoundary:Tt="viewport",elementContext:Rt="floating",altBoundary:Pt=!1,padding:Lt=0}=evaluate(Et,yt),kt=getPaddingObject$1(Lt),Mt=Ct[Pt?Rt==="floating"?"reference":"floating":Rt],It=rectToClientRect(await At.getClippingRect({element:(xt=await(At.isElement==null?void 0:At.isElement(Mt)))==null||xt?Mt:Mt.contextElement||await(At.getDocumentElement==null?void 0:At.getDocumentElement(Ct.floating)),boundary:St,rootBoundary:Tt,strategy:wt})),Nt=Rt==="floating"?{x:vt,y:bt,width:Ft.floating.width,height:Ft.floating.height}:Ft.reference,Ut=await(At.getOffsetParent==null?void 0:At.getOffsetParent(Ct.floating)),jt=await(At.isElement==null?void 0:At.isElement(Ut))?await(At.getScale==null?void 0:At.getScale(Ut))||{x:1,y:1}:{x:1,y:1},Vt=rectToClientRect(At.convertOffsetParentRelativeRectToViewportRelativeRect?await At.convertOffsetParentRelativeRectToViewportRelativeRect({elements:Ct,rect:Nt,offsetParent:Ut,strategy:wt}):Nt);return{top:(It.top-Vt.top+kt.top)/jt.y,bottom:(Vt.bottom-It.bottom+kt.bottom)/jt.y,left:(It.left-Vt.left+kt.left)/jt.x,right:(Vt.right-It.right+kt.right)/jt.x}}const computePosition$1=async(yt,Et,xt)=>{const{placement:vt="bottom",strategy:bt="absolute",middleware:At=[],platform:Ft}=xt,Ct=At.filter(Boolean),wt=await(Ft.isRTL==null?void 0:Ft.isRTL(Et));let St=await Ft.getElementRects({reference:yt,floating:Et,strategy:bt}),{x:Tt,y:Rt}=computeCoordsFromPlacement(St,vt,wt),Pt=vt,Lt={},kt=0;for(let Mt=0;Mt<Ct.length;Mt++){var Ot;const{name:It,fn:Nt}=Ct[Mt],{x:Ut,y:jt,data:Vt,reset:zt}=await Nt({x:Tt,y:Rt,initialPlacement:vt,placement:Pt,strategy:bt,middlewareData:Lt,rects:St,platform:{...Ft,detectOverflow:(Ot=Ft.detectOverflow)!=null?Ot:detectOverflow},elements:{reference:yt,floating:Et}});Tt=Ut??Tt,Rt=jt??Rt,Lt={...Lt,[It]:{...Lt[It],...Vt}},zt&&kt<=50&&(kt++,typeof zt=="object"&&(zt.placement&&(Pt=zt.placement),zt.rects&&(St=zt.rects===!0?await Ft.getElementRects({reference:yt,floating:Et,strategy:bt}):zt.rects),{x:Tt,y:Rt}=computeCoordsFromPlacement(St,Pt,wt)),Mt=-1)}return{x:Tt,y:Rt,placement:Pt,strategy:bt,middlewareData:Lt}},arrow$3=yt=>({name:"arrow",options:yt,async fn(Et){const{x:xt,y:vt,placement:bt,rects:At,platform:Ft,elements:Ct,middlewareData:wt}=Et,{element:St,padding:Tt=0}=evaluate(yt,Et)||{};if(St==null)return{};const Rt=getPaddingObject$1(Tt),Pt={x:xt,y:vt},Lt=getAlignmentAxis(bt),kt=getAxisLength(Lt),Ot=await Ft.getDimensions(St),Mt=Lt==="y",It=Mt?"top":"left",Nt=Mt?"bottom":"right",Ut=Mt?"clientHeight":"clientWidth",jt=At.reference[kt]+At.reference[Lt]-Pt[Lt]-At.floating[kt],Vt=Pt[Lt]-At.reference[Lt],zt=await(Ft.getOffsetParent==null?void 0:Ft.getOffsetParent(St));let Ht=zt?zt[Ut]:0;(!Ht||!await(Ft.isElement==null?void 0:Ft.isElement(zt)))&&(Ht=Ct.floating[Ut]||At.floating[kt]);const Wt=jt/2-Vt/2,Gt=Ht/2-Ot[kt]/2-1,qt=min(Rt[It],Gt),Xt=min(Rt[Nt],Gt),Kt=qt,Jt=Ht-Ot[kt]-Xt,tn=Ht/2-Ot[kt]/2+Wt,sn=clamp$5(Kt,tn,Jt),Zt=!wt.arrow&&getAlignment(bt)!=null&&tn!==sn&&At.reference[kt]/2-(tn<Kt?qt:Xt)-Ot[kt]/2<0,nn=Zt?tn<Kt?tn-Kt:tn-Jt:0;return{[Lt]:Pt[Lt]+nn,data:{[Lt]:sn,centerOffset:tn-sn-nn,...Zt&&{alignmentOffset:nn}},reset:Zt}}}),flip$2=function(yt){return yt===void 0&&(yt={}),{name:"flip",options:yt,async fn(Et){var xt,vt;const{placement:bt,middlewareData:At,rects:Ft,initialPlacement:Ct,platform:wt,elements:St}=Et,{mainAxis:Tt=!0,crossAxis:Rt=!0,fallbackPlacements:Pt,fallbackStrategy:Lt="bestFit",fallbackAxisSideDirection:kt="none",flipAlignment:Ot=!0,...Mt}=evaluate(yt,Et);if((xt=At.arrow)!=null&&xt.alignmentOffset)return{};const It=getSide(bt),Nt=getSideAxis(Ct),Ut=getSide(Ct)===Ct,jt=await(wt.isRTL==null?void 0:wt.isRTL(St.floating)),Vt=Pt||(Ut||!Ot?[getOppositePlacement(Ct)]:getExpandedPlacements(Ct)),zt=kt!=="none";!Pt&&zt&&Vt.push(...getOppositeAxisPlacements(Ct,Ot,kt,jt));const Ht=[Ct,...Vt],Wt=await wt.detectOverflow(Et,Mt),Gt=[];let qt=((vt=At.flip)==null?void 0:vt.overflows)||[];if(Tt&&Gt.push(Wt[It]),Rt){const tn=getAlignmentSides(bt,Ft,jt);Gt.push(Wt[tn[0]],Wt[tn[1]])}if(qt=[...qt,{placement:bt,overflows:Gt}],!Gt.every(tn=>tn<=0)){var Xt,Kt;const tn=(((Xt=At.flip)==null?void 0:Xt.index)||0)+1,sn=Ht[tn];if(sn&&(!(Rt==="alignment"?Nt!==getSideAxis(sn):!1)||qt.every(rn=>getSideAxis(rn.placement)===Nt?rn.overflows[0]>0:!0)))return{data:{index:tn,overflows:qt},reset:{placement:sn}};let Zt=(Kt=qt.filter(nn=>nn.overflows[0]<=0).sort((nn,rn)=>nn.overflows[1]-rn.overflows[1])[0])==null?void 0:Kt.placement;if(!Zt)switch(Lt){case"bestFit":{var Jt;const nn=(Jt=qt.filter(rn=>{if(zt){const on=getSideAxis(rn.placement);return on===Nt||on==="y"}return!0}).map(rn=>[rn.placement,rn.overflows.filter(on=>on>0).reduce((on,ln)=>on+ln,0)]).sort((rn,on)=>rn[1]-on[1])[0])==null?void 0:Jt[0];nn&&(Zt=nn);break}case"initialPlacement":Zt=Ct;break}if(bt!==Zt)return{reset:{placement:Zt}}}return{}}}};function getSideOffsets(yt,Et){return{top:yt.top-Et.height,right:yt.right-Et.width,bottom:yt.bottom-Et.height,left:yt.left-Et.width}}function isAnySideFullyClipped(yt){return sides.some(Et=>yt[Et]>=0)}const hide$2=function(yt){return yt===void 0&&(yt={}),{name:"hide",options:yt,async fn(Et){const{rects:xt,platform:vt}=Et,{strategy:bt="referenceHidden",...At}=evaluate(yt,Et);switch(bt){case"referenceHidden":{const Ft=await vt.detectOverflow(Et,{...At,elementContext:"reference"}),Ct=getSideOffsets(Ft,xt.reference);return{data:{referenceHiddenOffsets:Ct,referenceHidden:isAnySideFullyClipped(Ct)}}}case"escaped":{const Ft=await vt.detectOverflow(Et,{...At,altBoundary:!0}),Ct=getSideOffsets(Ft,xt.floating);return{data:{escapedOffsets:Ct,escaped:isAnySideFullyClipped(Ct)}}}default:return{}}}}},originSides=new Set(["left","top"]);async function convertValueToCoords(yt,Et){const{placement:xt,platform:vt,elements:bt}=yt,At=await(vt.isRTL==null?void 0:vt.isRTL(bt.floating)),Ft=getSide(xt),Ct=getAlignment(xt),wt=getSideAxis(xt)==="y",St=originSides.has(Ft)?-1:1,Tt=At&&wt?-1:1,Rt=evaluate(Et,yt);let{mainAxis:Pt,crossAxis:Lt,alignmentAxis:kt}=typeof Rt=="number"?{mainAxis:Rt,crossAxis:0,alignmentAxis:null}:{mainAxis:Rt.mainAxis||0,crossAxis:Rt.crossAxis||0,alignmentAxis:Rt.alignmentAxis};return Ct&&typeof kt=="number"&&(Lt=Ct==="end"?kt*-1:kt),wt?{x:Lt*Tt,y:Pt*St}:{x:Pt*St,y:Lt*Tt}}const offset$2=function(yt){return yt===void 0&&(yt=0),{name:"offset",options:yt,async fn(Et){var xt,vt;const{x:bt,y:At,placement:Ft,middlewareData:Ct}=Et,wt=await convertValueToCoords(Et,yt);return Ft===((xt=Ct.offset)==null?void 0:xt.placement)&&(vt=Ct.arrow)!=null&&vt.alignmentOffset?{}:{x:bt+wt.x,y:At+wt.y,data:{...wt,placement:Ft}}}}},shift$2=function(yt){return yt===void 0&&(yt={}),{name:"shift",options:yt,async fn(Et){const{x:xt,y:vt,placement:bt,platform:At}=Et,{mainAxis:Ft=!0,crossAxis:Ct=!1,limiter:wt={fn:It=>{let{x:Nt,y:Ut}=It;return{x:Nt,y:Ut}}},...St}=evaluate(yt,Et),Tt={x:xt,y:vt},Rt=await At.detectOverflow(Et,St),Pt=getSideAxis(getSide(bt)),Lt=getOppositeAxis(Pt);let kt=Tt[Lt],Ot=Tt[Pt];if(Ft){const It=Lt==="y"?"top":"left",Nt=Lt==="y"?"bottom":"right",Ut=kt+Rt[It],jt=kt-Rt[Nt];kt=clamp$5(Ut,kt,jt)}if(Ct){const It=Pt==="y"?"top":"left",Nt=Pt==="y"?"bottom":"right",Ut=Ot+Rt[It],jt=Ot-Rt[Nt];Ot=clamp$5(Ut,Ot,jt)}const Mt=wt.fn({...Et,[Lt]:kt,[Pt]:Ot});return{...Mt,data:{x:Mt.x-xt,y:Mt.y-vt,enabled:{[Lt]:Ft,[Pt]:Ct}}}}}},limitShift$2=function(yt){return yt===void 0&&(yt={}),{options:yt,fn(Et){const{x:xt,y:vt,placement:bt,rects:At,middlewareData:Ft}=Et,{offset:Ct=0,mainAxis:wt=!0,crossAxis:St=!0}=evaluate(yt,Et),Tt={x:xt,y:vt},Rt=getSideAxis(bt),Pt=getOppositeAxis(Rt);let Lt=Tt[Pt],kt=Tt[Rt];const Ot=evaluate(Ct,Et),Mt=typeof Ot=="number"?{mainAxis:Ot,crossAxis:0}:{mainAxis:0,crossAxis:0,...Ot};if(wt){const Ut=Pt==="y"?"height":"width",jt=At.reference[Pt]-At.floating[Ut]+Mt.mainAxis,Vt=At.reference[Pt]+At.reference[Ut]-Mt.mainAxis;Lt<jt?Lt=jt:Lt>Vt&&(Lt=Vt)}if(St){var It,Nt;const Ut=Pt==="y"?"width":"height",jt=originSides.has(getSide(bt)),Vt=At.reference[Rt]-At.floating[Ut]+(jt&&((It=Ft.offset)==null?void 0:It[Rt])||0)+(jt?0:Mt.crossAxis),zt=At.reference[Rt]+At.reference[Ut]+(jt?0:((Nt=Ft.offset)==null?void 0:Nt[Rt])||0)-(jt?Mt.crossAxis:0);kt<Vt?kt=Vt:kt>zt&&(kt=zt)}return{[Pt]:Lt,[Rt]:kt}}}},size$2=function(yt){return yt===void 0&&(yt={}),{name:"size",options:yt,async fn(Et){var xt,vt;const{placement:bt,rects:At,platform:Ft,elements:Ct}=Et,{apply:wt=()=>{},...St}=evaluate(yt,Et),Tt=await Ft.detectOverflow(Et,St),Rt=getSide(bt),Pt=getAlignment(bt),Lt=getSideAxis(bt)==="y",{width:kt,height:Ot}=At.floating;let Mt,It;Rt==="top"||Rt==="bottom"?(Mt=Rt,It=Pt===(await(Ft.isRTL==null?void 0:Ft.isRTL(Ct.floating))?"start":"end")?"left":"right"):(It=Rt,Mt=Pt==="end"?"top":"bottom");const Nt=Ot-Tt.top-Tt.bottom,Ut=kt-Tt.left-Tt.right,jt=min(Ot-Tt[Mt],Nt),Vt=min(kt-Tt[It],Ut),zt=!Et.middlewareData.shift;let Ht=jt,Wt=Vt;if((xt=Et.middlewareData.shift)!=null&&xt.enabled.x&&(Wt=Ut),(vt=Et.middlewareData.shift)!=null&&vt.enabled.y&&(Ht=Nt),zt&&!Pt){const qt=max(Tt.left,0),Xt=max(Tt.right,0),Kt=max(Tt.top,0),Jt=max(Tt.bottom,0);Lt?Wt=kt-2*(qt!==0||Xt!==0?qt+Xt:max(Tt.left,Tt.right)):Ht=Ot-2*(Kt!==0||Jt!==0?Kt+Jt:max(Tt.top,Tt.bottom))}await wt({...Et,availableWidth:Wt,availableHeight:Ht});const Gt=await Ft.getDimensions(Ct.floating);return kt!==Gt.width||Ot!==Gt.height?{reset:{rects:!0}}:{}}}};function hasWindow(){return typeof window<"u"}function getNodeName(yt){return isNode(yt)?(yt.nodeName||"").toLowerCase():"#document"}function getWindow(yt){var Et;return(yt==null||(Et=yt.ownerDocument)==null?void 0:Et.defaultView)||window}function getDocumentElement(yt){var Et;return(Et=(isNode(yt)?yt.ownerDocument:yt.document)||window.document)==null?void 0:Et.documentElement}function isNode(yt){return hasWindow()?yt instanceof Node||yt instanceof getWindow(yt).Node:!1}function isElement(yt){return hasWindow()?yt instanceof Element||yt instanceof getWindow(yt).Element:!1}function isHTMLElement(yt){return hasWindow()?yt instanceof HTMLElement||yt instanceof getWindow(yt).HTMLElement:!1}function isShadowRoot(yt){return!hasWindow()||typeof ShadowRoot>"u"?!1:yt instanceof ShadowRoot||yt instanceof getWindow(yt).ShadowRoot}const invalidOverflowDisplayValues=new Set(["inline","contents"]);function isOverflowElement(yt){const{overflow:Et,overflowX:xt,overflowY:vt,display:bt}=getComputedStyle$1(yt);return/auto|scroll|overlay|hidden|clip/.test(Et+vt+xt)&&!invalidOverflowDisplayValues.has(bt)}const tableElements=new Set(["table","td","th"]);function isTableElement(yt){return tableElements.has(getNodeName(yt))}const topLayerSelectors=[":popover-open",":modal"];function isTopLayer(yt){return topLayerSelectors.some(Et=>{try{return yt.matches(Et)}catch{return!1}})}const transformProperties=["transform","translate","scale","rotate","perspective"],willChangeValues=["transform","translate","scale","rotate","perspective","filter"],containValues=["paint","layout","strict","content"];function isContainingBlock(yt){const Et=isWebKit(),xt=isElement(yt)?getComputedStyle$1(yt):yt;return transformProperties.some(vt=>xt[vt]?xt[vt]!=="none":!1)||(xt.containerType?xt.containerType!=="normal":!1)||!Et&&(xt.backdropFilter?xt.backdropFilter!=="none":!1)||!Et&&(xt.filter?xt.filter!=="none":!1)||willChangeValues.some(vt=>(xt.willChange||"").includes(vt))||containValues.some(vt=>(xt.contain||"").includes(vt))}function getContainingBlock(yt){let Et=getParentNode(yt);for(;isHTMLElement(Et)&&!isLastTraversableNode(Et);){if(isContainingBlock(Et))return Et;if(isTopLayer(Et))return null;Et=getParentNode(Et)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lastTraversableNodeNames=new Set(["html","body","#document"]);function isLastTraversableNode(yt){return lastTraversableNodeNames.has(getNodeName(yt))}function getComputedStyle$1(yt){return getWindow(yt).getComputedStyle(yt)}function getNodeScroll(yt){return isElement(yt)?{scrollLeft:yt.scrollLeft,scrollTop:yt.scrollTop}:{scrollLeft:yt.scrollX,scrollTop:yt.scrollY}}function getParentNode(yt){if(getNodeName(yt)==="html")return yt;const Et=yt.assignedSlot||yt.parentNode||isShadowRoot(yt)&&yt.host||getDocumentElement(yt);return isShadowRoot(Et)?Et.host:Et}function getNearestOverflowAncestor(yt){const Et=getParentNode(yt);return isLastTraversableNode(Et)?yt.ownerDocument?yt.ownerDocument.body:yt.body:isHTMLElement(Et)&&isOverflowElement(Et)?Et:getNearestOverflowAncestor(Et)}function getOverflowAncestors(yt,Et,xt){var vt;Et===void 0&&(Et=[]),xt===void 0&&(xt=!0);const bt=getNearestOverflowAncestor(yt),At=bt===((vt=yt.ownerDocument)==null?void 0:vt.body),Ft=getWindow(bt);if(At){const Ct=getFrameElement(Ft);return Et.concat(Ft,Ft.visualViewport||[],isOverflowElement(bt)?bt:[],Ct&&xt?getOverflowAncestors(Ct):[])}return Et.concat(bt,getOverflowAncestors(bt,[],xt))}function getFrameElement(yt){return yt.parent&&Object.getPrototypeOf(yt.parent)?yt.frameElement:null}function getCssDimensions(yt){const Et=getComputedStyle$1(yt);let xt=parseFloat(Et.width)||0,vt=parseFloat(Et.height)||0;const bt=isHTMLElement(yt),At=bt?yt.offsetWidth:xt,Ft=bt?yt.offsetHeight:vt,Ct=round$1(xt)!==At||round$1(vt)!==Ft;return Ct&&(xt=At,vt=Ft),{width:xt,height:vt,$:Ct}}function unwrapElement(yt){return isElement(yt)?yt:yt.contextElement}function getScale$1(yt){const Et=unwrapElement(yt);if(!isHTMLElement(Et))return createCoords(1);const xt=Et.getBoundingClientRect(),{width:vt,height:bt,$:At}=getCssDimensions(Et);let Ft=(At?round$1(xt.width):xt.width)/vt,Ct=(At?round$1(xt.height):xt.height)/bt;return(!Ft||!Number.isFinite(Ft))&&(Ft=1),(!Ct||!Number.isFinite(Ct))&&(Ct=1),{x:Ft,y:Ct}}const noOffsets=createCoords(0);function getVisualOffsets(yt){const Et=getWindow(yt);return!isWebKit()||!Et.visualViewport?noOffsets:{x:Et.visualViewport.offsetLeft,y:Et.visualViewport.offsetTop}}function shouldAddVisualOffsets(yt,Et,xt){return Et===void 0&&(Et=!1),!xt||Et&&xt!==getWindow(yt)?!1:Et}function getBoundingClientRect(yt,Et,xt,vt){Et===void 0&&(Et=!1),xt===void 0&&(xt=!1);const bt=yt.getBoundingClientRect(),At=unwrapElement(yt);let Ft=createCoords(1);Et&&(vt?isElement(vt)&&(Ft=getScale$1(vt)):Ft=getScale$1(yt));const Ct=shouldAddVisualOffsets(At,xt,vt)?getVisualOffsets(At):createCoords(0);let wt=(bt.left+Ct.x)/Ft.x,St=(bt.top+Ct.y)/Ft.y,Tt=bt.width/Ft.x,Rt=bt.height/Ft.y;if(At){const Pt=getWindow(At),Lt=vt&&isElement(vt)?getWindow(vt):vt;let kt=Pt,Ot=getFrameElement(kt);for(;Ot&&vt&&Lt!==kt;){const Mt=getScale$1(Ot),It=Ot.getBoundingClientRect(),Nt=getComputedStyle$1(Ot),Ut=It.left+(Ot.clientLeft+parseFloat(Nt.paddingLeft))*Mt.x,jt=It.top+(Ot.clientTop+parseFloat(Nt.paddingTop))*Mt.y;wt*=Mt.x,St*=Mt.y,Tt*=Mt.x,Rt*=Mt.y,wt+=Ut,St+=jt,kt=getWindow(Ot),Ot=getFrameElement(kt)}}return rectToClientRect({width:Tt,height:Rt,x:wt,y:St})}function getWindowScrollBarX(yt,Et){const xt=getNodeScroll(yt).scrollLeft;return Et?Et.left+xt:getBoundingClientRect(getDocumentElement(yt)).left+xt}function getHTMLOffset(yt,Et){const xt=yt.getBoundingClientRect(),vt=xt.left+Et.scrollLeft-getWindowScrollBarX(yt,xt),bt=xt.top+Et.scrollTop;return{x:vt,y:bt}}function convertOffsetParentRelativeRectToViewportRelativeRect(yt){let{elements:Et,rect:xt,offsetParent:vt,strategy:bt}=yt;const At=bt==="fixed",Ft=getDocumentElement(vt),Ct=Et?isTopLayer(Et.floating):!1;if(vt===Ft||Ct&&At)return xt;let wt={scrollLeft:0,scrollTop:0},St=createCoords(1);const Tt=createCoords(0),Rt=isHTMLElement(vt);if((Rt||!Rt&&!At)&&((getNodeName(vt)!=="body"||isOverflowElement(Ft))&&(wt=getNodeScroll(vt)),isHTMLElement(vt))){const Lt=getBoundingClientRect(vt);St=getScale$1(vt),Tt.x=Lt.x+vt.clientLeft,Tt.y=Lt.y+vt.clientTop}const Pt=Ft&&!Rt&&!At?getHTMLOffset(Ft,wt):createCoords(0);return{width:xt.width*St.x,height:xt.height*St.y,x:xt.x*St.x-wt.scrollLeft*St.x+Tt.x+Pt.x,y:xt.y*St.y-wt.scrollTop*St.y+Tt.y+Pt.y}}function getClientRects(yt){return Array.from(yt.getClientRects())}function getDocumentRect(yt){const Et=getDocumentElement(yt),xt=getNodeScroll(yt),vt=yt.ownerDocument.body,bt=max(Et.scrollWidth,Et.clientWidth,vt.scrollWidth,vt.clientWidth),At=max(Et.scrollHeight,Et.clientHeight,vt.scrollHeight,vt.clientHeight);let Ft=-xt.scrollLeft+getWindowScrollBarX(yt);const Ct=-xt.scrollTop;return getComputedStyle$1(vt).direction==="rtl"&&(Ft+=max(Et.clientWidth,vt.clientWidth)-bt),{width:bt,height:At,x:Ft,y:Ct}}const SCROLLBAR_MAX=25;function getViewportRect(yt,Et){const xt=getWindow(yt),vt=getDocumentElement(yt),bt=xt.visualViewport;let At=vt.clientWidth,Ft=vt.clientHeight,Ct=0,wt=0;if(bt){At=bt.width,Ft=bt.height;const Tt=isWebKit();(!Tt||Tt&&Et==="fixed")&&(Ct=bt.offsetLeft,wt=bt.offsetTop)}const St=getWindowScrollBarX(vt);if(St<=0){const Tt=vt.ownerDocument,Rt=Tt.body,Pt=getComputedStyle(Rt),Lt=Tt.compatMode==="CSS1Compat"&&parseFloat(Pt.marginLeft)+parseFloat(Pt.marginRight)||0,kt=Math.abs(vt.clientWidth-Rt.clientWidth-Lt);kt<=SCROLLBAR_MAX&&(At-=kt)}else St<=SCROLLBAR_MAX&&(At+=St);return{width:At,height:Ft,x:Ct,y:wt}}const absoluteOrFixed=new Set(["absolute","fixed"]);function getInnerBoundingClientRect(yt,Et){const xt=getBoundingClientRect(yt,!0,Et==="fixed"),vt=xt.top+yt.clientTop,bt=xt.left+yt.clientLeft,At=isHTMLElement(yt)?getScale$1(yt):createCoords(1),Ft=yt.clientWidth*At.x,Ct=yt.clientHeight*At.y,wt=bt*At.x,St=vt*At.y;return{width:Ft,height:Ct,x:wt,y:St}}function getClientRectFromClippingAncestor(yt,Et,xt){let vt;if(Et==="viewport")vt=getViewportRect(yt,xt);else if(Et==="document")vt=getDocumentRect(getDocumentElement(yt));else if(isElement(Et))vt=getInnerBoundingClientRect(Et,xt);else{const bt=getVisualOffsets(yt);vt={x:Et.x-bt.x,y:Et.y-bt.y,width:Et.width,height:Et.height}}return rectToClientRect(vt)}function hasFixedPositionAncestor(yt,Et){const xt=getParentNode(yt);return xt===Et||!isElement(xt)||isLastTraversableNode(xt)?!1:getComputedStyle$1(xt).position==="fixed"||hasFixedPositionAncestor(xt,Et)}function getClippingElementAncestors(yt,Et){const xt=Et.get(yt);if(xt)return xt;let vt=getOverflowAncestors(yt,[],!1).filter(Ct=>isElement(Ct)&&getNodeName(Ct)!=="body"),bt=null;const At=getComputedStyle$1(yt).position==="fixed";let Ft=At?getParentNode(yt):yt;for(;isElement(Ft)&&!isLastTraversableNode(Ft);){const Ct=getComputedStyle$1(Ft),wt=isContainingBlock(Ft);!wt&&Ct.position==="fixed"&&(bt=null),(At?!wt&&!bt:!wt&&Ct.position==="static"&&!!bt&&absoluteOrFixed.has(bt.position)||isOverflowElement(Ft)&&!wt&&hasFixedPositionAncestor(yt,Ft))?vt=vt.filter(Tt=>Tt!==Ft):bt=Ct,Ft=getParentNode(Ft)}return Et.set(yt,vt),vt}function getClippingRect(yt){let{element:Et,boundary:xt,rootBoundary:vt,strategy:bt}=yt;const Ft=[...xt==="clippingAncestors"?isTopLayer(Et)?[]:getClippingElementAncestors(Et,this._c):[].concat(xt),vt],Ct=Ft[0],wt=Ft.reduce((St,Tt)=>{const Rt=getClientRectFromClippingAncestor(Et,Tt,bt);return St.top=max(Rt.top,St.top),St.right=min(Rt.right,St.right),St.bottom=min(Rt.bottom,St.bottom),St.left=max(Rt.left,St.left),St},getClientRectFromClippingAncestor(Et,Ct,bt));return{width:wt.right-wt.left,height:wt.bottom-wt.top,x:wt.left,y:wt.top}}function getDimensions(yt){const{width:Et,height:xt}=getCssDimensions(yt);return{width:Et,height:xt}}function getRectRelativeToOffsetParent(yt,Et,xt){const vt=isHTMLElement(Et),bt=getDocumentElement(Et),At=xt==="fixed",Ft=getBoundingClientRect(yt,!0,At,Et);let Ct={scrollLeft:0,scrollTop:0};const wt=createCoords(0);function St(){wt.x=getWindowScrollBarX(bt)}if(vt||!vt&&!At)if((getNodeName(Et)!=="body"||isOverflowElement(bt))&&(Ct=getNodeScroll(Et)),vt){const Lt=getBoundingClientRect(Et,!0,At,Et);wt.x=Lt.x+Et.clientLeft,wt.y=Lt.y+Et.clientTop}else bt&&St();At&&!vt&&bt&&St();const Tt=bt&&!vt&&!At?getHTMLOffset(bt,Ct):createCoords(0),Rt=Ft.left+Ct.scrollLeft-wt.x-Tt.x,Pt=Ft.top+Ct.scrollTop-wt.y-Tt.y;return{x:Rt,y:Pt,width:Ft.width,height:Ft.height}}function isStaticPositioned(yt){return getComputedStyle$1(yt).position==="static"}function getTrueOffsetParent(yt,Et){if(!isHTMLElement(yt)||getComputedStyle$1(yt).position==="fixed")return null;if(Et)return Et(yt);let xt=yt.offsetParent;return getDocumentElement(yt)===xt&&(xt=xt.ownerDocument.body),xt}function getOffsetParent(yt,Et){const xt=getWindow(yt);if(isTopLayer(yt))return xt;if(!isHTMLElement(yt)){let bt=getParentNode(yt);for(;bt&&!isLastTraversableNode(bt);){if(isElement(bt)&&!isStaticPositioned(bt))return bt;bt=getParentNode(bt)}return xt}let vt=getTrueOffsetParent(yt,Et);for(;vt&&isTableElement(vt)&&isStaticPositioned(vt);)vt=getTrueOffsetParent(vt,Et);return vt&&isLastTraversableNode(vt)&&isStaticPositioned(vt)&&!isContainingBlock(vt)?xt:vt||getContainingBlock(yt)||xt}const getElementRects=async function(yt){const Et=this.getOffsetParent||getOffsetParent,xt=this.getDimensions,vt=await xt(yt.floating);return{reference:getRectRelativeToOffsetParent(yt.reference,await Et(yt.floating),yt.strategy),floating:{x:0,y:0,width:vt.width,height:vt.height}}};function isRTL(yt){return getComputedStyle$1(yt).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale:getScale$1,isElement,isRTL};function rectsAreEqual(yt,Et){return yt.x===Et.x&&yt.y===Et.y&&yt.width===Et.width&&yt.height===Et.height}function observeMove(yt,Et){let xt=null,vt;const bt=getDocumentElement(yt);function At(){var Ct;clearTimeout(vt),(Ct=xt)==null||Ct.disconnect(),xt=null}function Ft(Ct,wt){Ct===void 0&&(Ct=!1),wt===void 0&&(wt=1),At();const St=yt.getBoundingClientRect(),{left:Tt,top:Rt,width:Pt,height:Lt}=St;if(Ct||Et(),!Pt||!Lt)return;const kt=floor(Rt),Ot=floor(bt.clientWidth-(Tt+Pt)),Mt=floor(bt.clientHeight-(Rt+Lt)),It=floor(Tt),Ut={rootMargin:-kt+"px "+-Ot+"px "+-Mt+"px "+-It+"px",threshold:max(0,min(1,wt))||1};let jt=!0;function Vt(zt){const Ht=zt[0].intersectionRatio;if(Ht!==wt){if(!jt)return Ft();Ht?Ft(!1,Ht):vt=setTimeout(()=>{Ft(!1,1e-7)},1e3)}Ht===1&&!rectsAreEqual(St,yt.getBoundingClientRect())&&Ft(),jt=!1}try{xt=new IntersectionObserver(Vt,{...Ut,root:bt.ownerDocument})}catch{xt=new IntersectionObserver(Vt,Ut)}xt.observe(yt)}return Ft(!0),At}function autoUpdate(yt,Et,xt,vt){vt===void 0&&(vt={});const{ancestorScroll:bt=!0,ancestorResize:At=!0,elementResize:Ft=typeof ResizeObserver=="function",layoutShift:Ct=typeof IntersectionObserver=="function",animationFrame:wt=!1}=vt,St=unwrapElement(yt),Tt=bt||At?[...St?getOverflowAncestors(St):[],...getOverflowAncestors(Et)]:[];Tt.forEach(It=>{bt&&It.addEventListener("scroll",xt,{passive:!0}),At&&It.addEventListener("resize",xt)});const Rt=St&&Ct?observeMove(St,xt):null;let Pt=-1,Lt=null;Ft&&(Lt=new ResizeObserver(It=>{let[Nt]=It;Nt&&Nt.target===St&&Lt&&(Lt.unobserve(Et),cancelAnimationFrame(Pt),Pt=requestAnimationFrame(()=>{var Ut;(Ut=Lt)==null||Ut.observe(Et)})),xt()}),St&&!wt&&Lt.observe(St),Lt.observe(Et));let kt,Ot=wt?getBoundingClientRect(yt):null;wt&&Mt();function Mt(){const It=getBoundingClientRect(yt);Ot&&!rectsAreEqual(Ot,It)&&xt(),Ot=It,kt=requestAnimationFrame(Mt)}return xt(),()=>{var It;Tt.forEach(Nt=>{bt&&Nt.removeEventListener("scroll",xt),At&&Nt.removeEventListener("resize",xt)}),Rt?.(),(It=Lt)==null||It.disconnect(),Lt=null,wt&&cancelAnimationFrame(kt)}}const offset$1=offset$2,shift$1=shift$2,flip$1=flip$2,size$1=size$2,hide$1=hide$2,arrow$2=arrow$3,limitShift$1=limitShift$2,computePosition=(yt,Et,xt)=>{const vt=new Map,bt={platform,...xt},At={...bt.platform,_c:vt};return computePosition$1(yt,Et,{...bt,platform:At})};var isClient=typeof document<"u",noop$5=function(){},index$2=isClient?reactExports.useLayoutEffect:noop$5;function deepEqual$3(yt,Et){if(yt===Et)return!0;if(typeof yt!=typeof Et)return!1;if(typeof yt=="function"&&yt.toString()===Et.toString())return!0;let xt,vt,bt;if(yt&&Et&&typeof yt=="object"){if(Array.isArray(yt)){if(xt=yt.length,xt!==Et.length)return!1;for(vt=xt;vt--!==0;)if(!deepEqual$3(yt[vt],Et[vt]))return!1;return!0}if(bt=Object.keys(yt),xt=bt.length,xt!==Object.keys(Et).length)return!1;for(vt=xt;vt--!==0;)if(!{}.hasOwnProperty.call(Et,bt[vt]))return!1;for(vt=xt;vt--!==0;){const At=bt[vt];if(!(At==="_owner"&&yt.$$typeof)&&!deepEqual$3(yt[At],Et[At]))return!1}return!0}return yt!==yt&&Et!==Et}function getDPR(yt){return typeof window>"u"?1:(yt.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(yt,Et){const xt=getDPR(yt);return Math.round(Et*xt)/xt}function useLatestRef(yt){const Et=reactExports.useRef(yt);return index$2(()=>{Et.current=yt}),Et}function useFloating(yt){yt===void 0&&(yt={});const{placement:Et="bottom",strategy:xt="absolute",middleware:vt=[],platform:bt,elements:{reference:At,floating:Ft}={},transform:Ct=!0,whileElementsMounted:wt,open:St}=yt,[Tt,Rt]=reactExports.useState({x:0,y:0,strategy:xt,placement:Et,middlewareData:{},isPositioned:!1}),[Pt,Lt]=reactExports.useState(vt);deepEqual$3(Pt,vt)||Lt(vt);const[kt,Ot]=reactExports.useState(null),[Mt,It]=reactExports.useState(null),Nt=reactExports.useCallback(rn=>{rn!==zt.current&&(zt.current=rn,Ot(rn))},[]),Ut=reactExports.useCallback(rn=>{rn!==Ht.current&&(Ht.current=rn,It(rn))},[]),jt=At||kt,Vt=Ft||Mt,zt=reactExports.useRef(null),Ht=reactExports.useRef(null),Wt=reactExports.useRef(Tt),Gt=wt!=null,qt=useLatestRef(wt),Xt=useLatestRef(bt),Kt=useLatestRef(St),Jt=reactExports.useCallback(()=>{if(!zt.current||!Ht.current)return;const rn={placement:Et,strategy:xt,middleware:Pt};Xt.current&&(rn.platform=Xt.current),computePosition(zt.current,Ht.current,rn).then(on=>{const ln={...on,isPositioned:Kt.current!==!1};tn.current&&!deepEqual$3(Wt.current,ln)&&(Wt.current=ln,reactDomExports.flushSync(()=>{Rt(ln)}))})},[Pt,Et,xt,Xt,Kt]);index$2(()=>{St===!1&&Wt.current.isPositioned&&(Wt.current.isPositioned=!1,Rt(rn=>({...rn,isPositioned:!1})))},[St]);const tn=reactExports.useRef(!1);index$2(()=>(tn.current=!0,()=>{tn.current=!1}),[]),index$2(()=>{if(jt&&(zt.current=jt),Vt&&(Ht.current=Vt),jt&&Vt){if(qt.current)return qt.current(jt,Vt,Jt);Jt()}},[jt,Vt,Jt,qt,Gt]);const sn=reactExports.useMemo(()=>({reference:zt,floating:Ht,setReference:Nt,setFloating:Ut}),[Nt,Ut]),Zt=reactExports.useMemo(()=>({reference:jt,floating:Vt}),[jt,Vt]),nn=reactExports.useMemo(()=>{const rn={position:xt,left:0,top:0};if(!Zt.floating)return rn;const on=roundByDPR(Zt.floating,Tt.x),ln=roundByDPR(Zt.floating,Tt.y);return Ct?{...rn,transform:"translate("+on+"px, "+ln+"px)",...getDPR(Zt.floating)>=1.5&&{willChange:"transform"}}:{position:xt,left:on,top:ln}},[xt,Ct,Zt.floating,Tt.x,Tt.y]);return reactExports.useMemo(()=>({...Tt,update:Jt,refs:sn,elements:Zt,floatingStyles:nn}),[Tt,Jt,sn,Zt,nn])}const arrow$1=yt=>{function Et(xt){return{}.hasOwnProperty.call(xt,"current")}return{name:"arrow",options:yt,fn(xt){const{element:vt,padding:bt}=typeof yt=="function"?yt(xt):yt;return vt&&Et(vt)?vt.current!=null?arrow$2({element:vt.current,padding:bt}).fn(xt):{}:vt?arrow$2({element:vt,padding:bt}).fn(xt):{}}}},offset=(yt,Et)=>({...offset$1(yt),options:[yt,Et]}),shift=(yt,Et)=>({...shift$1(yt),options:[yt,Et]}),limitShift=(yt,Et)=>({...limitShift$1(yt),options:[yt,Et]}),flip=(yt,Et)=>({...flip$1(yt),options:[yt,Et]}),size=(yt,Et)=>({...size$1(yt),options:[yt,Et]}),hide=(yt,Et)=>({...hide$1(yt),options:[yt,Et]}),arrow=(yt,Et)=>({...arrow$1(yt),options:[yt,Et]});function createSlot$a(yt){const Et=createSlotClone$a(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$a);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$a(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$b(bt),Ct=mergeProps$a(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$a=Symbol("radix.slottable");function isSlottable$a(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$a}function mergeProps$a(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$b(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$9=NODES$9.reduce((yt,Et)=>{const xt=createSlot$a(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),NAME$3="Arrow",Arrow$1=reactExports.forwardRef((yt,Et)=>{const{children:xt,width:vt=10,height:bt=5,...At}=yt;return jsxRuntimeExports.jsx(Primitive$9.svg,{...At,ref:Et,width:vt,height:bt,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:yt.asChild?xt:jsxRuntimeExports.jsx("polygon",{points:"0,0 30,0 15,10"})})});Arrow$1.displayName=NAME$3;var Root$5=Arrow$1;function createContextScope$5(yt,Et=[]){let xt=[];function vt(At,Ft){const Ct=reactExports.createContext(Ft),wt=xt.length;xt=[...xt,Ft];const St=Rt=>{const{scope:Pt,children:Lt,...kt}=Rt,Ot=Pt?.[yt]?.[wt]||Ct,Mt=reactExports.useMemo(()=>kt,Object.values(kt));return jsxRuntimeExports.jsx(Ot.Provider,{value:Mt,children:Lt})};St.displayName=At+"Provider";function Tt(Rt,Pt){const Lt=Pt?.[yt]?.[wt]||Ct,kt=reactExports.useContext(Lt);if(kt)return kt;if(Ft!==void 0)return Ft;throw new Error(`\`${Rt}\` must be used within \`${At}\``)}return[St,Tt]}const bt=()=>{const At=xt.map(Ft=>reactExports.createContext(Ft));return function(Ct){const wt=Ct?.[yt]||At;return reactExports.useMemo(()=>({[`__scope${yt}`]:{...Ct,[yt]:wt}}),[Ct,wt])}};return bt.scopeName=yt,[vt,composeContextScopes$5(bt,...Et)]}function composeContextScopes$5(...yt){const Et=yt[0];if(yt.length===1)return Et;const xt=()=>{const vt=yt.map(bt=>({useScope:bt(),scopeName:bt.scopeName}));return function(At){const Ft=vt.reduce((Ct,{useScope:wt,scopeName:St})=>{const Rt=wt(At)[`__scope${St}`];return{...Ct,...Rt}},{});return reactExports.useMemo(()=>({[`__scope${Et.scopeName}`]:Ft}),[Ft])}};return xt.scopeName=Et.scopeName,xt}function createSlot$9(yt){const Et=createSlotClone$9(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$9);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$9(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$a(bt),Ct=mergeProps$9(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$9=Symbol("radix.slottable");function isSlottable$9(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$9}function mergeProps$9(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$a(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$8=NODES$8.reduce((yt,Et)=>{const xt=createSlot$9(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{});function useSize(yt){const[Et,xt]=reactExports.useState(void 0);return useLayoutEffect2(()=>{if(yt){xt({width:yt.offsetWidth,height:yt.offsetHeight});const vt=new ResizeObserver(bt=>{if(!Array.isArray(bt)||!bt.length)return;const At=bt[0];let Ft,Ct;if("borderBoxSize"in At){const wt=At.borderBoxSize,St=Array.isArray(wt)?wt[0]:wt;Ft=St.inlineSize,Ct=St.blockSize}else Ft=yt.offsetWidth,Ct=yt.offsetHeight;xt({width:Ft,height:Ct})});return vt.observe(yt,{box:"border-box"}),()=>vt.unobserve(yt)}else xt(void 0)},[yt]),Et}var POPPER_NAME="Popper",[createPopperContext,createPopperScope]=createContextScope$5(POPPER_NAME),[PopperProvider,usePopperContext]=createPopperContext(POPPER_NAME),Popper=yt=>{const{__scopePopper:Et,children:xt}=yt,[vt,bt]=reactExports.useState(null);return jsxRuntimeExports.jsx(PopperProvider,{scope:Et,anchor:vt,onAnchorChange:bt,children:xt})};Popper.displayName=POPPER_NAME;var ANCHOR_NAME="PopperAnchor",PopperAnchor=reactExports.forwardRef((yt,Et)=>{const{__scopePopper:xt,virtualRef:vt,...bt}=yt,At=usePopperContext(ANCHOR_NAME,xt),Ft=reactExports.useRef(null),Ct=useComposedRefs(Et,Ft),wt=reactExports.useRef(null);return reactExports.useEffect(()=>{const St=wt.current;wt.current=vt?.current||Ft.current,St!==wt.current&&At.onAnchorChange(wt.current)}),vt?null:jsxRuntimeExports.jsx(Primitive$8.div,{...bt,ref:Ct})});PopperAnchor.displayName=ANCHOR_NAME;var CONTENT_NAME$3="PopperContent",[PopperContentProvider,useContentContext]=createPopperContext(CONTENT_NAME$3),PopperContent=reactExports.forwardRef((yt,Et)=>{const{__scopePopper:xt,side:vt="bottom",sideOffset:bt=0,align:At="center",alignOffset:Ft=0,arrowPadding:Ct=0,avoidCollisions:wt=!0,collisionBoundary:St=[],collisionPadding:Tt=0,sticky:Rt="partial",hideWhenDetached:Pt=!1,updatePositionStrategy:Lt="optimized",onPlaced:kt,...Ot}=yt,Mt=usePopperContext(CONTENT_NAME$3,xt),[It,Nt]=reactExports.useState(null),Ut=useComposedRefs(Et,xn=>Nt(xn)),[jt,Vt]=reactExports.useState(null),zt=useSize(jt),Ht=zt?.width??0,Wt=zt?.height??0,Gt=vt+(At!=="center"?"-"+At:""),qt=typeof Tt=="number"?Tt:{top:0,right:0,bottom:0,left:0,...Tt},Xt=Array.isArray(St)?St:[St],Kt=Xt.length>0,Jt={padding:qt,boundary:Xt.filter(isNotNull),altBoundary:Kt},{refs:tn,floatingStyles:sn,placement:Zt,isPositioned:nn,middlewareData:rn}=useFloating({strategy:"fixed",placement:Gt,whileElementsMounted:(...xn)=>autoUpdate(...xn,{animationFrame:Lt==="always"}),elements:{reference:Mt.anchor},middleware:[offset({mainAxis:bt+Wt,alignmentAxis:Ft}),wt&&shift({mainAxis:!0,crossAxis:!1,limiter:Rt==="partial"?limitShift():void 0,...Jt}),wt&&flip({...Jt}),size({...Jt,apply:({elements:xn,rects:Mn,availableWidth:$n,availableHeight:Rn})=>{const{width:Tn,height:ir}=Mn.reference,Jn=xn.floating.style;Jn.setProperty("--radix-popper-available-width",`${$n}px`),Jn.setProperty("--radix-popper-available-height",`${Rn}px`),Jn.setProperty("--radix-popper-anchor-width",`${Tn}px`),Jn.setProperty("--radix-popper-anchor-height",`${ir}px`)}}),jt&&arrow({element:jt,padding:Ct}),transformOrigin({arrowWidth:Ht,arrowHeight:Wt}),Pt&&hide({strategy:"referenceHidden",...Jt})]}),[on,ln]=getSideAndAlignFromPlacement(Zt),Qt=useCallbackRef$2(kt);useLayoutEffect2(()=>{nn&&Qt?.()},[nn,Qt]);const fn=rn.arrow?.x,pn=rn.arrow?.y,mn=rn.arrow?.centerOffset!==0,[vn,yn]=reactExports.useState();return useLayoutEffect2(()=>{It&&yn(window.getComputedStyle(It).zIndex)},[It]),jsxRuntimeExports.jsx("div",{ref:tn.setFloating,"data-radix-popper-content-wrapper":"",style:{...sn,transform:nn?sn.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:vn,"--radix-popper-transform-origin":[rn.transformOrigin?.x,rn.transformOrigin?.y].join(" "),...rn.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:yt.dir,children:jsxRuntimeExports.jsx(PopperContentProvider,{scope:xt,placedSide:on,onArrowChange:Vt,arrowX:fn,arrowY:pn,shouldHideArrow:mn,children:jsxRuntimeExports.jsx(Primitive$8.div,{"data-side":on,"data-align":ln,...Ot,ref:Ut,style:{...Ot.style,animation:nn?void 0:"none"}})})})});PopperContent.displayName=CONTENT_NAME$3;var ARROW_NAME$2="PopperArrow",OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},PopperArrow=reactExports.forwardRef(function(Et,xt){const{__scopePopper:vt,...bt}=Et,At=useContentContext(ARROW_NAME$2,vt),Ft=OPPOSITE_SIDE[At.placedSide];return jsxRuntimeExports.jsx("span",{ref:At.onArrowChange,style:{position:"absolute",left:At.arrowX,top:At.arrowY,[Ft]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[At.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[At.placedSide],visibility:At.shouldHideArrow?"hidden":void 0},children:jsxRuntimeExports.jsx(Root$5,{...bt,ref:xt,style:{...bt.style,display:"block"}})})});PopperArrow.displayName=ARROW_NAME$2;function isNotNull(yt){return yt!==null}var transformOrigin=yt=>({name:"transformOrigin",options:yt,fn(Et){const{placement:xt,rects:vt,middlewareData:bt}=Et,Ft=bt.arrow?.centerOffset!==0,Ct=Ft?0:yt.arrowWidth,wt=Ft?0:yt.arrowHeight,[St,Tt]=getSideAndAlignFromPlacement(xt),Rt={start:"0%",center:"50%",end:"100%"}[Tt],Pt=(bt.arrow?.x??0)+Ct/2,Lt=(bt.arrow?.y??0)+wt/2;let kt="",Ot="";return St==="bottom"?(kt=Ft?Rt:`${Pt}px`,Ot=`${-wt}px`):St==="top"?(kt=Ft?Rt:`${Pt}px`,Ot=`${vt.floating.height+wt}px`):St==="right"?(kt=`${-wt}px`,Ot=Ft?Rt:`${Lt}px`):St==="left"&&(kt=`${vt.floating.width+wt}px`,Ot=Ft?Rt:`${Lt}px`),{data:{x:kt,y:Ot}}}});function getSideAndAlignFromPlacement(yt){const[Et,xt="center"]=yt.split("-");return[Et,xt]}var Root2$1=Popper,Anchor=PopperAnchor,Content=PopperContent,Arrow=PopperArrow;function createSlot$8(yt){const Et=createSlotClone$8(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$8);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$8(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$9(bt),Ct=mergeProps$8(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$8=Symbol("radix.slottable");function isSlottable$8(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$8}function mergeProps$8(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$9(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$7=NODES$7.reduce((yt,Et)=>{const xt=createSlot$8(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),PORTAL_NAME$2="Portal",Portal$1=reactExports.forwardRef((yt,Et)=>{const{container:xt,...vt}=yt,[bt,At]=reactExports.useState(!1);useLayoutEffect2(()=>At(!0),[]);const Ft=xt||bt&&globalThis?.document?.body;return Ft?ReactDOM.createPortal(jsxRuntimeExports.jsx(Primitive$7.div,{...vt,ref:Et}),Ft):null});Portal$1.displayName=PORTAL_NAME$2;function useStateMachine(yt,Et){return reactExports.useReducer((xt,vt)=>Et[xt][vt]??xt,yt)}var Presence=yt=>{const{present:Et,children:xt}=yt,vt=usePresence(Et),bt=typeof xt=="function"?xt({present:vt.isPresent}):reactExports.Children.only(xt),At=useComposedRefs(vt.ref,getElementRef$8(bt));return typeof xt=="function"||vt.isPresent?reactExports.cloneElement(bt,{ref:At}):null};Presence.displayName="Presence";function usePresence(yt){const[Et,xt]=reactExports.useState(),vt=reactExports.useRef(null),bt=reactExports.useRef(yt),At=reactExports.useRef("none"),Ft=yt?"mounted":"unmounted",[Ct,wt]=useStateMachine(Ft,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const St=getAnimationName(vt.current);At.current=Ct==="mounted"?St:"none"},[Ct]),useLayoutEffect2(()=>{const St=vt.current,Tt=bt.current;if(Tt!==yt){const Pt=At.current,Lt=getAnimationName(St);yt?wt("MOUNT"):Lt==="none"||St?.display==="none"?wt("UNMOUNT"):wt(Tt&&Pt!==Lt?"ANIMATION_OUT":"UNMOUNT"),bt.current=yt}},[yt,wt]),useLayoutEffect2(()=>{if(Et){let St;const Tt=Et.ownerDocument.defaultView??window,Rt=Lt=>{const Ot=getAnimationName(vt.current).includes(CSS.escape(Lt.animationName));if(Lt.target===Et&&Ot&&(wt("ANIMATION_END"),!bt.current)){const Mt=Et.style.animationFillMode;Et.style.animationFillMode="forwards",St=Tt.setTimeout(()=>{Et.style.animationFillMode==="forwards"&&(Et.style.animationFillMode=Mt)})}},Pt=Lt=>{Lt.target===Et&&(At.current=getAnimationName(vt.current))};return Et.addEventListener("animationstart",Pt),Et.addEventListener("animationcancel",Rt),Et.addEventListener("animationend",Rt),()=>{Tt.clearTimeout(St),Et.removeEventListener("animationstart",Pt),Et.removeEventListener("animationcancel",Rt),Et.removeEventListener("animationend",Rt)}}else wt("ANIMATION_END")},[Et,wt]),{isPresent:["mounted","unmountSuspended"].includes(Ct),ref:reactExports.useCallback(St=>{vt.current=St?getComputedStyle(St):null,xt(St)},[])}}function getAnimationName(yt){return yt?.animationName||"none"}function getElementRef$8(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}function createSlot$7(yt){const Et=createSlotClone$7(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$7);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$7(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$7(bt),Ct=mergeProps$7(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$7=Symbol("radix.slottable");function createSlottable(yt){const Et=({children:xt})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:xt});return Et.displayName=`${yt}.Slottable`,Et.__radixId=SLOTTABLE_IDENTIFIER$7,Et}function isSlottable$7(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$7}function mergeProps$7(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$7(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$6=NODES$6.reduce((yt,Et)=>{const xt=createSlot$7(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),useInsertionEffect=React$1[" useInsertionEffect ".trim().toString()]||useLayoutEffect2;function useControllableState({prop:yt,defaultProp:Et,onChange:xt=()=>{},caller:vt}){const[bt,At,Ft]=useUncontrolledState({defaultProp:Et,onChange:xt}),Ct=yt!==void 0,wt=Ct?yt:bt;{const Tt=reactExports.useRef(yt!==void 0);reactExports.useEffect(()=>{const Rt=Tt.current;Rt!==Ct&&console.warn(`${vt} is changing from ${Rt?"controlled":"uncontrolled"} to ${Ct?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),Tt.current=Ct},[Ct,vt])}const St=reactExports.useCallback(Tt=>{if(Ct){const Rt=isFunction$1(Tt)?Tt(yt):Tt;Rt!==yt&&Ft.current?.(Rt)}else At(Tt)},[Ct,yt,At,Ft]);return[wt,St]}function useUncontrolledState({defaultProp:yt,onChange:Et}){const[xt,vt]=reactExports.useState(yt),bt=reactExports.useRef(xt),At=reactExports.useRef(Et);return useInsertionEffect(()=>{At.current=Et},[Et]),reactExports.useEffect(()=>{bt.current!==xt&&(At.current?.(xt),bt.current=xt)},[xt,bt]),[xt,vt,At]}function isFunction$1(yt){return typeof yt=="function"}function createSlot$6(yt){const Et=createSlotClone$6(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$6);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$6(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$6(bt),Ct=mergeProps$6(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$6=Symbol("radix.slottable");function isSlottable$6(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$6}function mergeProps$6(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$6(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$5=NODES$5.reduce((yt,Et)=>{const xt=createSlot$6(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),VISUALLY_HIDDEN_STYLES=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),NAME$2="VisuallyHidden",VisuallyHidden=reactExports.forwardRef((yt,Et)=>jsxRuntimeExports.jsx(Primitive$5.span,{...yt,ref:Et,style:{...VISUALLY_HIDDEN_STYLES,...yt.style}}));VisuallyHidden.displayName=NAME$2;var Root$4=VisuallyHidden,[createTooltipContext]=createContextScope$6("Tooltip",[createPopperScope]),usePopperScope$1=createPopperScope(),PROVIDER_NAME="TooltipProvider",DEFAULT_DELAY_DURATION=700,TOOLTIP_OPEN="tooltip.open",[TooltipProviderContextProvider,useTooltipProviderContext]=createTooltipContext(PROVIDER_NAME),TooltipProvider$1=yt=>{const{__scopeTooltip:Et,delayDuration:xt=DEFAULT_DELAY_DURATION,skipDelayDuration:vt=300,disableHoverableContent:bt=!1,children:At}=yt,Ft=reactExports.useRef(!0),Ct=reactExports.useRef(!1),wt=reactExports.useRef(0);return reactExports.useEffect(()=>{const St=wt.current;return()=>window.clearTimeout(St)},[]),jsxRuntimeExports.jsx(TooltipProviderContextProvider,{scope:Et,isOpenDelayedRef:Ft,delayDuration:xt,onOpen:reactExports.useCallback(()=>{window.clearTimeout(wt.current),Ft.current=!1},[]),onClose:reactExports.useCallback(()=>{window.clearTimeout(wt.current),wt.current=window.setTimeout(()=>Ft.current=!0,vt)},[vt]),isPointerInTransitRef:Ct,onPointerInTransitChange:reactExports.useCallback(St=>{Ct.current=St},[]),disableHoverableContent:bt,children:At})};TooltipProvider$1.displayName=PROVIDER_NAME;var TOOLTIP_NAME="Tooltip",[TooltipContextProvider,useTooltipContext]=createTooltipContext(TOOLTIP_NAME),TRIGGER_NAME$2="TooltipTrigger",TooltipTrigger=reactExports.forwardRef((yt,Et)=>{const{__scopeTooltip:xt,...vt}=yt,bt=useTooltipContext(TRIGGER_NAME$2,xt),At=useTooltipProviderContext(TRIGGER_NAME$2,xt),Ft=usePopperScope$1(xt),Ct=reactExports.useRef(null),wt=useComposedRefs(Et,Ct,bt.onTriggerChange),St=reactExports.useRef(!1),Tt=reactExports.useRef(!1),Rt=reactExports.useCallback(()=>St.current=!1,[]);return reactExports.useEffect(()=>()=>document.removeEventListener("pointerup",Rt),[Rt]),jsxRuntimeExports.jsx(Anchor,{asChild:!0,...Ft,children:jsxRuntimeExports.jsx(Primitive$6.button,{"aria-describedby":bt.open?bt.contentId:void 0,"data-state":bt.stateAttribute,...vt,ref:wt,onPointerMove:composeEventHandlers(yt.onPointerMove,Pt=>{Pt.pointerType!=="touch"&&!Tt.current&&!At.isPointerInTransitRef.current&&(bt.onTriggerEnter(),Tt.current=!0)}),onPointerLeave:composeEventHandlers(yt.onPointerLeave,()=>{bt.onTriggerLeave(),Tt.current=!1}),onPointerDown:composeEventHandlers(yt.onPointerDown,()=>{bt.open&&bt.onClose(),St.current=!0,document.addEventListener("pointerup",Rt,{once:!0})}),onFocus:composeEventHandlers(yt.onFocus,()=>{St.current||bt.onOpen()}),onBlur:composeEventHandlers(yt.onBlur,bt.onClose),onClick:composeEventHandlers(yt.onClick,bt.onClose)})})});TooltipTrigger.displayName=TRIGGER_NAME$2;var PORTAL_NAME$1="TooltipPortal",[PortalProvider,usePortalContext]=createTooltipContext(PORTAL_NAME$1,{forceMount:void 0}),CONTENT_NAME$2="TooltipContent",TooltipContent=reactExports.forwardRef((yt,Et)=>{const xt=usePortalContext(CONTENT_NAME$2,yt.__scopeTooltip),{forceMount:vt=xt.forceMount,side:bt="top",...At}=yt,Ft=useTooltipContext(CONTENT_NAME$2,yt.__scopeTooltip);return jsxRuntimeExports.jsx(Presence,{present:vt||Ft.open,children:Ft.disableHoverableContent?jsxRuntimeExports.jsx(TooltipContentImpl,{side:bt,...At,ref:Et}):jsxRuntimeExports.jsx(TooltipContentHoverable,{side:bt,...At,ref:Et})})}),TooltipContentHoverable=reactExports.forwardRef((yt,Et)=>{const xt=useTooltipContext(CONTENT_NAME$2,yt.__scopeTooltip),vt=useTooltipProviderContext(CONTENT_NAME$2,yt.__scopeTooltip),bt=reactExports.useRef(null),At=useComposedRefs(Et,bt),[Ft,Ct]=reactExports.useState(null),{trigger:wt,onClose:St}=xt,Tt=bt.current,{onPointerInTransitChange:Rt}=vt,Pt=reactExports.useCallback(()=>{Ct(null),Rt(!1)},[Rt]),Lt=reactExports.useCallback((kt,Ot)=>{const Mt=kt.currentTarget,It={x:kt.clientX,y:kt.clientY},Nt=getExitSideFromRect(It,Mt.getBoundingClientRect()),Ut=getPaddedExitPoints(It,Nt),jt=getPointsFromRect(Ot.getBoundingClientRect()),Vt=getHull([...Ut,...jt]);Ct(Vt),Rt(!0)},[Rt]);return reactExports.useEffect(()=>()=>Pt(),[Pt]),reactExports.useEffect(()=>{if(wt&&Tt){const kt=Mt=>Lt(Mt,Tt),Ot=Mt=>Lt(Mt,wt);return wt.addEventListener("pointerleave",kt),Tt.addEventListener("pointerleave",Ot),()=>{wt.removeEventListener("pointerleave",kt),Tt.removeEventListener("pointerleave",Ot)}}},[wt,Tt,Lt,Pt]),reactExports.useEffect(()=>{if(Ft){const kt=Ot=>{const Mt=Ot.target,It={x:Ot.clientX,y:Ot.clientY},Nt=wt?.contains(Mt)||Tt?.contains(Mt),Ut=!isPointInPolygon(It,Ft);Nt?Pt():Ut&&(Pt(),St())};return document.addEventListener("pointermove",kt),()=>document.removeEventListener("pointermove",kt)}},[wt,Tt,Ft,St,Pt]),jsxRuntimeExports.jsx(TooltipContentImpl,{...yt,ref:At})}),[VisuallyHiddenContentContextProvider,useVisuallyHiddenContentContext]=createTooltipContext(TOOLTIP_NAME,{isInside:!1}),Slottable=createSlottable("TooltipContent"),TooltipContentImpl=reactExports.forwardRef((yt,Et)=>{const{__scopeTooltip:xt,children:vt,"aria-label":bt,onEscapeKeyDown:At,onPointerDownOutside:Ft,...Ct}=yt,wt=useTooltipContext(CONTENT_NAME$2,xt),St=usePopperScope$1(xt),{onClose:Tt}=wt;return reactExports.useEffect(()=>(document.addEventListener(TOOLTIP_OPEN,Tt),()=>document.removeEventListener(TOOLTIP_OPEN,Tt)),[Tt]),reactExports.useEffect(()=>{if(wt.trigger){const Rt=Pt=>{Pt.target?.contains(wt.trigger)&&Tt()};return window.addEventListener("scroll",Rt,{capture:!0}),()=>window.removeEventListener("scroll",Rt,{capture:!0})}},[wt.trigger,Tt]),jsxRuntimeExports.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:At,onPointerDownOutside:Ft,onFocusOutside:Rt=>Rt.preventDefault(),onDismiss:Tt,children:jsxRuntimeExports.jsxs(Content,{"data-state":wt.stateAttribute,...St,...Ct,ref:Et,style:{...Ct.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[jsxRuntimeExports.jsx(Slottable,{children:vt}),jsxRuntimeExports.jsx(VisuallyHiddenContentContextProvider,{scope:xt,isInside:!0,children:jsxRuntimeExports.jsx(Root$4,{id:wt.contentId,role:"tooltip",children:bt||vt})})]})})});TooltipContent.displayName=CONTENT_NAME$2;var ARROW_NAME$1="TooltipArrow",TooltipArrow=reactExports.forwardRef((yt,Et)=>{const{__scopeTooltip:xt,...vt}=yt,bt=usePopperScope$1(xt);return useVisuallyHiddenContentContext(ARROW_NAME$1,xt).isInside?null:jsxRuntimeExports.jsx(Arrow,{...bt,...vt,ref:Et})});TooltipArrow.displayName=ARROW_NAME$1;function getExitSideFromRect(yt,Et){const xt=Math.abs(Et.top-yt.y),vt=Math.abs(Et.bottom-yt.y),bt=Math.abs(Et.right-yt.x),At=Math.abs(Et.left-yt.x);switch(Math.min(xt,vt,bt,At)){case At:return"left";case bt:return"right";case xt:return"top";case vt:return"bottom";default:throw new Error("unreachable")}}function getPaddedExitPoints(yt,Et,xt=5){const vt=[];switch(Et){case"top":vt.push({x:yt.x-xt,y:yt.y+xt},{x:yt.x+xt,y:yt.y+xt});break;case"bottom":vt.push({x:yt.x-xt,y:yt.y-xt},{x:yt.x+xt,y:yt.y-xt});break;case"left":vt.push({x:yt.x+xt,y:yt.y-xt},{x:yt.x+xt,y:yt.y+xt});break;case"right":vt.push({x:yt.x-xt,y:yt.y-xt},{x:yt.x-xt,y:yt.y+xt});break}return vt}function getPointsFromRect(yt){const{top:Et,right:xt,bottom:vt,left:bt}=yt;return[{x:bt,y:Et},{x:xt,y:Et},{x:xt,y:vt},{x:bt,y:vt}]}function isPointInPolygon(yt,Et){const{x:xt,y:vt}=yt;let bt=!1;for(let At=0,Ft=Et.length-1;At<Et.length;Ft=At++){const Ct=Et[At],wt=Et[Ft],St=Ct.x,Tt=Ct.y,Rt=wt.x,Pt=wt.y;Tt>vt!=Pt>vt&&xt<(Rt-St)*(vt-Tt)/(Pt-Tt)+St&&(bt=!bt)}return bt}function getHull(yt){const Et=yt.slice();return Et.sort((xt,vt)=>xt.x<vt.x?-1:xt.x>vt.x?1:xt.y<vt.y?-1:xt.y>vt.y?1:0),getHullPresorted(Et)}function getHullPresorted(yt){if(yt.length<=1)return yt.slice();const Et=[];for(let vt=0;vt<yt.length;vt++){const bt=yt[vt];for(;Et.length>=2;){const At=Et[Et.length-1],Ft=Et[Et.length-2];if((At.x-Ft.x)*(bt.y-Ft.y)>=(At.y-Ft.y)*(bt.x-Ft.x))Et.pop();else break}Et.push(bt)}Et.pop();const xt=[];for(let vt=yt.length-1;vt>=0;vt--){const bt=yt[vt];for(;xt.length>=2;){const At=xt[xt.length-1],Ft=xt[xt.length-2];if((At.x-Ft.x)*(bt.y-Ft.y)>=(At.y-Ft.y)*(bt.x-Ft.x))xt.pop();else break}xt.push(bt)}return xt.pop(),Et.length===1&&xt.length===1&&Et[0].x===xt[0].x&&Et[0].y===xt[0].y?Et:Et.concat(xt)}var Provider=TooltipProvider$1;function TooltipProvider({delayDuration:yt=0,...Et}){return jsxRuntimeExports.jsx(Provider,{"data-slot":"tooltip-provider",delayDuration:yt,...Et})}const SIDEBAR_COOKIE_NAME="sidebar_state",SIDEBAR_COOKIE_MAX_AGE=3600*24*7,SIDEBAR_WIDTH="18rem",SIDEBAR_WIDTH_ICON="3rem",SIDEBAR_KEYBOARD_SHORTCUT="b",SidebarContext=reactExports.createContext(null);function useSidebar(){const yt=reactExports.useContext(SidebarContext);if(!yt)throw new Error("useSidebar must be used within a SidebarProvider.");return yt}function SidebarProvider({defaultOpen:yt=!0,open:Et,onOpenChange:xt,className:vt,style:bt,children:At,...Ft}){const Ct=useIsMobile(),[wt,St]=reactExports.useState(!1),[Tt,Rt]=reactExports.useState(yt),Pt=Et??Tt,Lt=reactExports.useCallback(It=>{const Nt=typeof It=="function"?It(Pt):It;xt?xt(Nt):Rt(Nt),document.cookie=`${SIDEBAR_COOKIE_NAME}=${Nt}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`},[xt,Pt]),kt=reactExports.useCallback(()=>Ct?St(It=>!It):Lt(It=>!It),[Ct,Lt,St]);reactExports.useEffect(()=>{const It=Nt=>{Nt.key===SIDEBAR_KEYBOARD_SHORTCUT&&(Nt.metaKey||Nt.ctrlKey)&&(Nt.preventDefault(),kt())};return window.addEventListener("keydown",It),()=>window.removeEventListener("keydown",It)},[kt]);const Ot=Ct?wt?"expanded":"collapsed":Pt?"expanded":"collapsed",Mt=reactExports.useMemo(()=>({state:Ot,open:Pt,setOpen:Lt,isMobile:Ct,openMobile:wt,setOpenMobile:St,toggleSidebar:kt}),[Ot,Pt,Lt,Ct,wt,St,kt]);return jsxRuntimeExports.jsx(SidebarContext.Provider,{value:Mt,children:jsxRuntimeExports.jsx(TooltipProvider,{delayDuration:0,children:jsxRuntimeExports.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":SIDEBAR_WIDTH,"--sidebar-width-icon":SIDEBAR_WIDTH_ICON,...bt},className:cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",vt),...Ft,children:At})})})}function Sidebar({side:yt="left",variant:Et="sidebar",collapsible:xt="offcanvas",className:vt,children:bt,...At}){const{isMobile:Ft,state:Ct,openMobile:wt,setOpenMobile:St}=useSidebar(),Tt=Et==="inset",Rt=Tt?"relative":"fixed inset-y-0";return jsxRuntimeExports.jsxs("div",{className:cn("group peer text-sidebar-foreground",vt),"data-state":Ct,"data-collapsible":Ct==="collapsed"?xt:"","data-variant":Et,"data-side":yt,"data-slot":"sidebar",...At,children:[jsxRuntimeExports.jsx("div",{"data-slot":"sidebar-gap",className:cn("relative bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",Et==="floating"||Et==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)"),style:Ct==="collapsed"&&xt==="offcanvas"?{width:"0",boxSizing:"border-box",overflow:"hidden"}:{width:"var(--sidebar-width)",boxSizing:"border-box"}}),jsxRuntimeExports.jsx("div",{"data-slot":"sidebar-container",className:cn(`${Rt} z-10 h-svh transition-[left,right,width] duration-200 ease-linear flex`,yt==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",Et==="floating"||Et==="inset"?"p-2 group-data-[collapsible=offcanvas]:p-0 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l group-data-[collapsible=offcanvas]:border-none",vt),style:Ct==="collapsed"&&xt==="offcanvas"?{width:"0",boxSizing:"border-box",overflow:"hidden",visibility:"hidden"}:Tt?{width:"var(--sidebar-width)",boxSizing:"border-box"}:{width:"var(--sidebar-width)"},children:jsxRuntimeExports.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:bt})})]})}function SidebarTrigger({className:yt,onClick:Et,style:xt,...vt}){const{toggleSidebar:bt}=useSidebar(),{state:At}=useSidebar();return jsxRuntimeExports.jsxs(Button,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:cn("size-7 flex items-center justify-center border touch-manipulation",yt),style:{zIndex:1e5,boxShadow:"0 2px 8px rgba(0,0,0,0.08)",transition:"transform 0.2s",pointerEvents:"auto",...xt},onClick:Ft=>{Et&&Et(Ft),bt()},...vt,children:[jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transition:"transform 0.2s",transform:At==="expanded"?"rotate(180deg)":"rotate(0deg)"},children:jsxRuntimeExports.jsx("path",{d:"M7 5l5 5-5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function SidebarInset({className:yt,...Et}){return jsxRuntimeExports.jsx("main",{"data-slot":"sidebar-inset",className:cn("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:my-2 md:peer-data-[variant=inset]:mr-2 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",yt),style:{maxHeight:"100vh",overflow:"hidden",isolation:"isolate"},...Et})}function createContextScope$4(yt,Et=[]){let xt=[];function vt(At,Ft){const Ct=reactExports.createContext(Ft),wt=xt.length;xt=[...xt,Ft];const St=Rt=>{const{scope:Pt,children:Lt,...kt}=Rt,Ot=Pt?.[yt]?.[wt]||Ct,Mt=reactExports.useMemo(()=>kt,Object.values(kt));return jsxRuntimeExports.jsx(Ot.Provider,{value:Mt,children:Lt})};St.displayName=At+"Provider";function Tt(Rt,Pt){const Lt=Pt?.[yt]?.[wt]||Ct,kt=reactExports.useContext(Lt);if(kt)return kt;if(Ft!==void 0)return Ft;throw new Error(`\`${Rt}\` must be used within \`${At}\``)}return[St,Tt]}const bt=()=>{const At=xt.map(Ft=>reactExports.createContext(Ft));return function(Ct){const wt=Ct?.[yt]||At;return reactExports.useMemo(()=>({[`__scope${yt}`]:{...Ct,[yt]:wt}}),[Ct,wt])}};return bt.scopeName=yt,[vt,composeContextScopes$4(bt,...Et)]}function composeContextScopes$4(...yt){const Et=yt[0];if(yt.length===1)return Et;const xt=()=>{const vt=yt.map(bt=>({useScope:bt(),scopeName:bt.scopeName}));return function(At){const Ft=vt.reduce((Ct,{useScope:wt,scopeName:St})=>{const Rt=wt(At)[`__scope${St}`];return{...Ct,...Rt}},{});return reactExports.useMemo(()=>({[`__scope${Et.scopeName}`]:Ft}),[Ft])}};return xt.scopeName=Et.scopeName,xt}function createSlot$5(yt){const Et=createSlotClone$5(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$5);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$5(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$5(bt),Ct=mergeProps$5(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$5=Symbol("radix.slottable");function isSlottable$5(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$5}function mergeProps$5(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$5(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$4=NODES$4.reduce((yt,Et)=>{const xt=createSlot$5(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),COLLAPSIBLE_NAME="Collapsible",[createCollapsibleContext]=createContextScope$4(COLLAPSIBLE_NAME),[CollapsibleProvider,useCollapsibleContext]=createCollapsibleContext(COLLAPSIBLE_NAME),Collapsible$1=reactExports.forwardRef((yt,Et)=>{const{__scopeCollapsible:xt,open:vt,defaultOpen:bt,disabled:At,onOpenChange:Ft,...Ct}=yt,[wt,St]=useControllableState({prop:vt,defaultProp:bt??!1,onChange:Ft,caller:COLLAPSIBLE_NAME});return jsxRuntimeExports.jsx(CollapsibleProvider,{scope:xt,disabled:At,contentId:useId(),open:wt,onOpenToggle:reactExports.useCallback(()=>St(Tt=>!Tt),[St]),children:jsxRuntimeExports.jsx(Primitive$4.div,{"data-state":getState$1(wt),"data-disabled":At?"":void 0,...Ct,ref:Et})})});Collapsible$1.displayName=COLLAPSIBLE_NAME;var TRIGGER_NAME$1="CollapsibleTrigger",CollapsibleTrigger$1=reactExports.forwardRef((yt,Et)=>{const{__scopeCollapsible:xt,...vt}=yt,bt=useCollapsibleContext(TRIGGER_NAME$1,xt);return jsxRuntimeExports.jsx(Primitive$4.button,{type:"button","aria-controls":bt.contentId,"aria-expanded":bt.open||!1,"data-state":getState$1(bt.open),"data-disabled":bt.disabled?"":void 0,disabled:bt.disabled,...vt,ref:Et,onClick:composeEventHandlers(yt.onClick,bt.onOpenToggle)})});CollapsibleTrigger$1.displayName=TRIGGER_NAME$1;var CONTENT_NAME$1="CollapsibleContent",CollapsibleContent$1=reactExports.forwardRef((yt,Et)=>{const{forceMount:xt,...vt}=yt,bt=useCollapsibleContext(CONTENT_NAME$1,yt.__scopeCollapsible);return jsxRuntimeExports.jsx(Presence,{present:xt||bt.open,children:({present:At})=>jsxRuntimeExports.jsx(CollapsibleContentImpl,{...vt,ref:Et,present:At})})});CollapsibleContent$1.displayName=CONTENT_NAME$1;var CollapsibleContentImpl=reactExports.forwardRef((yt,Et)=>{const{__scopeCollapsible:xt,present:vt,children:bt,...At}=yt,Ft=useCollapsibleContext(CONTENT_NAME$1,xt),[Ct,wt]=reactExports.useState(vt),St=reactExports.useRef(null),Tt=useComposedRefs(Et,St),Rt=reactExports.useRef(0),Pt=Rt.current,Lt=reactExports.useRef(0),kt=Lt.current,Ot=Ft.open||Ct,Mt=reactExports.useRef(Ot),It=reactExports.useRef(void 0);return reactExports.useEffect(()=>{const Nt=requestAnimationFrame(()=>Mt.current=!1);return()=>cancelAnimationFrame(Nt)},[]),useLayoutEffect2(()=>{const Nt=St.current;if(Nt){It.current=It.current||{transitionDuration:Nt.style.transitionDuration,animationName:Nt.style.animationName},Nt.style.transitionDuration="0s",Nt.style.animationName="none";const Ut=Nt.getBoundingClientRect();Rt.current=Ut.height,Lt.current=Ut.width,Mt.current||(Nt.style.transitionDuration=It.current.transitionDuration,Nt.style.animationName=It.current.animationName),wt(vt)}},[Ft.open,vt]),jsxRuntimeExports.jsx(Primitive$4.div,{"data-state":getState$1(Ft.open),"data-disabled":Ft.disabled?"":void 0,id:Ft.contentId,hidden:!Ot,...At,ref:Tt,style:{"--radix-collapsible-content-height":Pt?`${Pt}px`:void 0,"--radix-collapsible-content-width":kt?`${kt}px`:void 0,...yt.style},children:Ot&&bt})});function getState$1(yt){return yt?"open":"closed"}var Root$3=Collapsible$1;function Collapsible({...yt}){return jsxRuntimeExports.jsx(Root$3,{"data-slot":"collapsible",...yt})}function CollapsibleTrigger({...yt}){return jsxRuntimeExports.jsx(CollapsibleTrigger$1,{"data-slot":"collapsible-trigger",...yt})}function CollapsibleContent({...yt}){return jsxRuntimeExports.jsx(CollapsibleContent$1,{"data-slot":"collapsible-content",...yt})}function createContextScope$3(yt,Et=[]){let xt=[];function vt(At,Ft){const Ct=reactExports.createContext(Ft),wt=xt.length;xt=[...xt,Ft];const St=Rt=>{const{scope:Pt,children:Lt,...kt}=Rt,Ot=Pt?.[yt]?.[wt]||Ct,Mt=reactExports.useMemo(()=>kt,Object.values(kt));return jsxRuntimeExports.jsx(Ot.Provider,{value:Mt,children:Lt})};St.displayName=At+"Provider";function Tt(Rt,Pt){const Lt=Pt?.[yt]?.[wt]||Ct,kt=reactExports.useContext(Lt);if(kt)return kt;if(Ft!==void 0)return Ft;throw new Error(`\`${Rt}\` must be used within \`${At}\``)}return[St,Tt]}const bt=()=>{const At=xt.map(Ft=>reactExports.createContext(Ft));return function(Ct){const wt=Ct?.[yt]||At;return reactExports.useMemo(()=>({[`__scope${yt}`]:{...Ct,[yt]:wt}}),[Ct,wt])}};return bt.scopeName=yt,[vt,composeContextScopes$3(bt,...Et)]}function composeContextScopes$3(...yt){const Et=yt[0];if(yt.length===1)return Et;const xt=()=>{const vt=yt.map(bt=>({useScope:bt(),scopeName:bt.scopeName}));return function(At){const Ft=vt.reduce((Ct,{useScope:wt,scopeName:St})=>{const Rt=wt(At)[`__scope${St}`];return{...Ct,...Rt}},{});return reactExports.useMemo(()=>({[`__scope${Et.scopeName}`]:Ft}),[Ft])}};return xt.scopeName=Et.scopeName,xt}function usePrevious(yt){const Et=reactExports.useRef({value:yt,previous:yt});return reactExports.useMemo(()=>(Et.current.value!==yt&&(Et.current.previous=Et.current.value,Et.current.value=yt),Et.current.previous),[yt])}function createSlot$4(yt){const Et=createSlotClone$4(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$4);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$4(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$4(bt),Ct=mergeProps$4(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$4=Symbol("radix.slottable");function isSlottable$4(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$4}function mergeProps$4(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$4(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$3=NODES$3.reduce((yt,Et)=>{const xt=createSlot$4(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),SWITCH_NAME="Switch",[createSwitchContext]=createContextScope$3(SWITCH_NAME),[SwitchProvider,useSwitchContext]=createSwitchContext(SWITCH_NAME),Switch$1=reactExports.forwardRef((yt,Et)=>{const{__scopeSwitch:xt,name:vt,checked:bt,defaultChecked:At,required:Ft,disabled:Ct,value:wt="on",onCheckedChange:St,form:Tt,...Rt}=yt,[Pt,Lt]=reactExports.useState(null),kt=useComposedRefs(Et,Ut=>Lt(Ut)),Ot=reactExports.useRef(!1),Mt=Pt?Tt||!!Pt.closest("form"):!0,[It,Nt]=useControllableState({prop:bt,defaultProp:At??!1,onChange:St,caller:SWITCH_NAME});return jsxRuntimeExports.jsxs(SwitchProvider,{scope:xt,checked:It,disabled:Ct,children:[jsxRuntimeExports.jsx(Primitive$3.button,{type:"button",role:"switch","aria-checked":It,"aria-required":Ft,"data-state":getState(It),"data-disabled":Ct?"":void 0,disabled:Ct,value:wt,...Rt,ref:kt,onClick:composeEventHandlers(yt.onClick,Ut=>{Nt(jt=>!jt),Mt&&(Ot.current=Ut.isPropagationStopped(),Ot.current||Ut.stopPropagation())})}),Mt&&jsxRuntimeExports.jsx(SwitchBubbleInput,{control:Pt,bubbles:!Ot.current,name:vt,value:wt,checked:It,required:Ft,disabled:Ct,form:Tt,style:{transform:"translateX(-100%)"}})]})});Switch$1.displayName=SWITCH_NAME;var THUMB_NAME$1="SwitchThumb",SwitchThumb=reactExports.forwardRef((yt,Et)=>{const{__scopeSwitch:xt,...vt}=yt,bt=useSwitchContext(THUMB_NAME$1,xt);return jsxRuntimeExports.jsx(Primitive$3.span,{"data-state":getState(bt.checked),"data-disabled":bt.disabled?"":void 0,...vt,ref:Et})});SwitchThumb.displayName=THUMB_NAME$1;var BUBBLE_INPUT_NAME$2="SwitchBubbleInput",SwitchBubbleInput=reactExports.forwardRef(({__scopeSwitch:yt,control:Et,checked:xt,bubbles:vt=!0,...bt},At)=>{const Ft=reactExports.useRef(null),Ct=useComposedRefs(Ft,At),wt=usePrevious(xt),St=useSize(Et);return reactExports.useEffect(()=>{const Tt=Ft.current;if(!Tt)return;const Rt=window.HTMLInputElement.prototype,Lt=Object.getOwnPropertyDescriptor(Rt,"checked").set;if(wt!==xt&&Lt){const kt=new Event("click",{bubbles:vt});Lt.call(Tt,xt),Tt.dispatchEvent(kt)}},[wt,xt,vt]),jsxRuntimeExports.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:xt,...bt,tabIndex:-1,ref:Ct,style:{...bt.style,...St,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});SwitchBubbleInput.displayName=BUBBLE_INPUT_NAME$2;function getState(yt){return yt?"checked":"unchecked"}var Root$2=Switch$1,Thumb$1=SwitchThumb;function Switch({className:yt,...Et}){return jsxRuntimeExports.jsx(Root$2,{"data-slot":"switch",className:cn("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-3.5 w-7 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",yt),...Et,children:jsxRuntimeExports.jsx(Thumb$1,{"data-slot":"switch-thumb",className:cn("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-2.5 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%+4px)] data-[state=unchecked]:translate-x-0.5")})})}var NAME$1="Label",Label$1=reactExports.forwardRef((yt,Et)=>jsxRuntimeExports.jsx(Primitive$b.label,{...yt,ref:Et,onMouseDown:xt=>{xt.target.closest("button, input, select, textarea")||(yt.onMouseDown?.(xt),!xt.defaultPrevented&&xt.detail>1&&xt.preventDefault())}}));Label$1.displayName=NAME$1;var Root$1=Label$1;function Label({className:yt,...Et}){return jsxRuntimeExports.jsx(Root$1,{"data-slot":"label",className:cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",yt),...Et})}function clamp$4(yt,[Et,xt]){return Math.min(xt,Math.max(Et,yt))}function createContextScope$2(yt,Et=[]){let xt=[];function vt(At,Ft){const Ct=reactExports.createContext(Ft),wt=xt.length;xt=[...xt,Ft];const St=Rt=>{const{scope:Pt,children:Lt,...kt}=Rt,Ot=Pt?.[yt]?.[wt]||Ct,Mt=reactExports.useMemo(()=>kt,Object.values(kt));return jsxRuntimeExports.jsx(Ot.Provider,{value:Mt,children:Lt})};St.displayName=At+"Provider";function Tt(Rt,Pt){const Lt=Pt?.[yt]?.[wt]||Ct,kt=reactExports.useContext(Lt);if(kt)return kt;if(Ft!==void 0)return Ft;throw new Error(`\`${Rt}\` must be used within \`${At}\``)}return[St,Tt]}const bt=()=>{const At=xt.map(Ft=>reactExports.createContext(Ft));return function(Ct){const wt=Ct?.[yt]||At;return reactExports.useMemo(()=>({[`__scope${yt}`]:{...Ct,[yt]:wt}}),[Ct,wt])}};return bt.scopeName=yt,[vt,composeContextScopes$2(bt,...Et)]}function composeContextScopes$2(...yt){const Et=yt[0];if(yt.length===1)return Et;const xt=()=>{const vt=yt.map(bt=>({useScope:bt(),scopeName:bt.scopeName}));return function(At){const Ft=vt.reduce((Ct,{useScope:wt,scopeName:St})=>{const Rt=wt(At)[`__scope${St}`];return{...Ct,...Rt}},{});return reactExports.useMemo(()=>({[`__scope${Et.scopeName}`]:Ft}),[Ft])}};return xt.scopeName=Et.scopeName,xt}function createSlot$3(yt){const Et=createSlotClone$3(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$3);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$3(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$3(bt),Ct=mergeProps$3(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$3=Symbol("radix.slottable");function isSlottable$3(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$3}function mergeProps$3(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$3(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}function createCollection(yt){const Et=yt+"CollectionProvider",[xt,vt]=createContextScope$2(Et),[bt,At]=xt(Et,{collectionRef:{current:null},itemMap:new Map}),Ft=Ot=>{const{scope:Mt,children:It}=Ot,Nt=React.useRef(null),Ut=React.useRef(new Map).current;return jsxRuntimeExports.jsx(bt,{scope:Mt,itemMap:Ut,collectionRef:Nt,children:It})};Ft.displayName=Et;const Ct=yt+"CollectionSlot",wt=createSlot$3(Ct),St=React.forwardRef((Ot,Mt)=>{const{scope:It,children:Nt}=Ot,Ut=At(Ct,It),jt=useComposedRefs(Mt,Ut.collectionRef);return jsxRuntimeExports.jsx(wt,{ref:jt,children:Nt})});St.displayName=Ct;const Tt=yt+"CollectionItemSlot",Rt="data-radix-collection-item",Pt=createSlot$3(Tt),Lt=React.forwardRef((Ot,Mt)=>{const{scope:It,children:Nt,...Ut}=Ot,jt=React.useRef(null),Vt=useComposedRefs(Mt,jt),zt=At(Tt,It);return React.useEffect(()=>(zt.itemMap.set(jt,{ref:jt,...Ut}),()=>{zt.itemMap.delete(jt)})),jsxRuntimeExports.jsx(Pt,{[Rt]:"",ref:Vt,children:Nt})});Lt.displayName=Tt;function kt(Ot){const Mt=At(yt+"CollectionConsumer",Ot);return React.useCallback(()=>{const Nt=Mt.collectionRef.current;if(!Nt)return[];const Ut=Array.from(Nt.querySelectorAll(`[${Rt}]`));return Array.from(Mt.itemMap.values()).sort((zt,Ht)=>Ut.indexOf(zt.ref.current)-Ut.indexOf(Ht.ref.current))},[Mt.collectionRef,Mt.itemMap])}return[{Provider:Ft,Slot:St,ItemSlot:Lt},kt,vt]}function createContextScope$1(yt,Et=[]){let xt=[];function vt(At,Ft){const Ct=reactExports.createContext(Ft),wt=xt.length;xt=[...xt,Ft];const St=Rt=>{const{scope:Pt,children:Lt,...kt}=Rt,Ot=Pt?.[yt]?.[wt]||Ct,Mt=reactExports.useMemo(()=>kt,Object.values(kt));return jsxRuntimeExports.jsx(Ot.Provider,{value:Mt,children:Lt})};St.displayName=At+"Provider";function Tt(Rt,Pt){const Lt=Pt?.[yt]?.[wt]||Ct,kt=reactExports.useContext(Lt);if(kt)return kt;if(Ft!==void 0)return Ft;throw new Error(`\`${Rt}\` must be used within \`${At}\``)}return[St,Tt]}const bt=()=>{const At=xt.map(Ft=>reactExports.createContext(Ft));return function(Ct){const wt=Ct?.[yt]||At;return reactExports.useMemo(()=>({[`__scope${yt}`]:{...Ct,[yt]:wt}}),[Ct,wt])}};return bt.scopeName=yt,[vt,composeContextScopes$1(bt,...Et)]}function composeContextScopes$1(...yt){const Et=yt[0];if(yt.length===1)return Et;const xt=()=>{const vt=yt.map(bt=>({useScope:bt(),scopeName:bt.scopeName}));return function(At){const Ft=vt.reduce((Ct,{useScope:wt,scopeName:St})=>{const Rt=wt(At)[`__scope${St}`];return{...Ct,...Rt}},{});return reactExports.useMemo(()=>({[`__scope${Et.scopeName}`]:Ft}),[Ft])}};return xt.scopeName=Et.scopeName,xt}var DirectionContext=reactExports.createContext(void 0);function useDirection(yt){const Et=reactExports.useContext(DirectionContext);return yt||Et||"ltr"}var count$1=0;function useFocusGuards(){reactExports.useEffect(()=>{const yt=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",yt[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",yt[1]??createFocusGuard()),count$1++,()=>{count$1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(Et=>Et.remove()),count$1--}},[])}function createFocusGuard(){const yt=document.createElement("span");return yt.setAttribute("data-radix-focus-guard",""),yt.tabIndex=0,yt.style.outline="none",yt.style.opacity="0",yt.style.position="fixed",yt.style.pointerEvents="none",yt}function createSlot$2(yt){const Et=createSlotClone$2(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$2);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$2(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$2(bt),Ct=mergeProps$2(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$2=Symbol("radix.slottable");function isSlottable$2(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$2}function mergeProps$2(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$2(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$2=NODES$2.reduce((yt,Et)=>{const xt=createSlot$2(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),AUTOFOCUS_ON_MOUNT="focusScope.autoFocusOnMount",AUTOFOCUS_ON_UNMOUNT="focusScope.autoFocusOnUnmount",EVENT_OPTIONS={bubbles:!1,cancelable:!0},FOCUS_SCOPE_NAME="FocusScope",FocusScope=reactExports.forwardRef((yt,Et)=>{const{loop:xt=!1,trapped:vt=!1,onMountAutoFocus:bt,onUnmountAutoFocus:At,...Ft}=yt,[Ct,wt]=reactExports.useState(null),St=useCallbackRef$2(bt),Tt=useCallbackRef$2(At),Rt=reactExports.useRef(null),Pt=useComposedRefs(Et,Ot=>wt(Ot)),Lt=reactExports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;reactExports.useEffect(()=>{if(vt){let Ot=function(Ut){if(Lt.paused||!Ct)return;const jt=Ut.target;Ct.contains(jt)?Rt.current=jt:focus(Rt.current,{select:!0})},Mt=function(Ut){if(Lt.paused||!Ct)return;const jt=Ut.relatedTarget;jt!==null&&(Ct.contains(jt)||focus(Rt.current,{select:!0}))},It=function(Ut){if(document.activeElement===document.body)for(const Vt of Ut)Vt.removedNodes.length>0&&focus(Ct)};document.addEventListener("focusin",Ot),document.addEventListener("focusout",Mt);const Nt=new MutationObserver(It);return Ct&&Nt.observe(Ct,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",Ot),document.removeEventListener("focusout",Mt),Nt.disconnect()}}},[vt,Ct,Lt.paused]),reactExports.useEffect(()=>{if(Ct){focusScopesStack.add(Lt);const Ot=document.activeElement;if(!Ct.contains(Ot)){const It=new CustomEvent(AUTOFOCUS_ON_MOUNT,EVENT_OPTIONS);Ct.addEventListener(AUTOFOCUS_ON_MOUNT,St),Ct.dispatchEvent(It),It.defaultPrevented||(focusFirst(removeLinks(getTabbableCandidates(Ct)),{select:!0}),document.activeElement===Ot&&focus(Ct))}return()=>{Ct.removeEventListener(AUTOFOCUS_ON_MOUNT,St),setTimeout(()=>{const It=new CustomEvent(AUTOFOCUS_ON_UNMOUNT,EVENT_OPTIONS);Ct.addEventListener(AUTOFOCUS_ON_UNMOUNT,Tt),Ct.dispatchEvent(It),It.defaultPrevented||focus(Ot??document.body,{select:!0}),Ct.removeEventListener(AUTOFOCUS_ON_UNMOUNT,Tt),focusScopesStack.remove(Lt)},0)}}},[Ct,St,Tt,Lt]);const kt=reactExports.useCallback(Ot=>{if(!xt&&!vt||Lt.paused)return;const Mt=Ot.key==="Tab"&&!Ot.altKey&&!Ot.ctrlKey&&!Ot.metaKey,It=document.activeElement;if(Mt&&It){const Nt=Ot.currentTarget,[Ut,jt]=getTabbableEdges(Nt);Ut&&jt?!Ot.shiftKey&&It===jt?(Ot.preventDefault(),xt&&focus(Ut,{select:!0})):Ot.shiftKey&&It===Ut&&(Ot.preventDefault(),xt&&focus(jt,{select:!0})):It===Nt&&Ot.preventDefault()}},[xt,vt,Lt.paused]);return jsxRuntimeExports.jsx(Primitive$2.div,{tabIndex:-1,...Ft,ref:Pt,onKeyDown:kt})});FocusScope.displayName=FOCUS_SCOPE_NAME;function focusFirst(yt,{select:Et=!1}={}){const xt=document.activeElement;for(const vt of yt)if(focus(vt,{select:Et}),document.activeElement!==xt)return}function getTabbableEdges(yt){const Et=getTabbableCandidates(yt),xt=findVisible(Et,yt),vt=findVisible(Et.reverse(),yt);return[xt,vt]}function getTabbableCandidates(yt){const Et=[],xt=document.createTreeWalker(yt,NodeFilter.SHOW_ELEMENT,{acceptNode:vt=>{const bt=vt.tagName==="INPUT"&&vt.type==="hidden";return vt.disabled||vt.hidden||bt?NodeFilter.FILTER_SKIP:vt.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;xt.nextNode();)Et.push(xt.currentNode);return Et}function findVisible(yt,Et){for(const xt of yt)if(!isHidden(xt,{upTo:Et}))return xt}function isHidden(yt,{upTo:Et}){if(getComputedStyle(yt).visibility==="hidden")return!0;for(;yt;){if(Et!==void 0&&yt===Et)return!1;if(getComputedStyle(yt).display==="none")return!0;yt=yt.parentElement}return!1}function isSelectableInput(yt){return yt instanceof HTMLInputElement&&"select"in yt}function focus(yt,{select:Et=!1}={}){if(yt&&yt.focus){const xt=document.activeElement;yt.focus({preventScroll:!0}),yt!==xt&&isSelectableInput(yt)&&Et&&yt.select()}}var focusScopesStack=createFocusScopesStack();function createFocusScopesStack(){let yt=[];return{add(Et){const xt=yt[0];Et!==xt&&xt?.pause(),yt=arrayRemove(yt,Et),yt.unshift(Et)},remove(Et){yt=arrayRemove(yt,Et),yt[0]?.resume()}}}function arrayRemove(yt,Et){const xt=[...yt],vt=xt.indexOf(Et);return vt!==-1&&xt.splice(vt,1),xt}function removeLinks(yt){return yt.filter(Et=>Et.tagName!=="A")}function createSlot$1(yt){const Et=createSlotClone$1(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$1);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$1(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$1(bt),Ct=mergeProps$1(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$1=Symbol("radix.slottable");function isSlottable$1(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$1}function mergeProps$1(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$1(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$1=NODES$1.reduce((yt,Et)=>{const xt=createSlot$1(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),getDefaultParent=function(yt){if(typeof document>"u")return null;var Et=Array.isArray(yt)?yt[0]:yt;return Et.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(yt){return yt&&(yt.host||unwrapHost(yt.parentNode))},correctTargets=function(yt,Et){return Et.map(function(xt){if(yt.contains(xt))return xt;var vt=unwrapHost(xt);return vt&&yt.contains(vt)?vt:(console.error("aria-hidden",xt,"in not contained inside",yt,". Doing nothing"),null)}).filter(function(xt){return!!xt})},applyAttributeToOthers=function(yt,Et,xt,vt){var bt=correctTargets(Et,Array.isArray(yt)?yt:[yt]);markerMap[xt]||(markerMap[xt]=new WeakMap);var At=markerMap[xt],Ft=[],Ct=new Set,wt=new Set(bt),St=function(Rt){!Rt||Ct.has(Rt)||(Ct.add(Rt),St(Rt.parentNode))};bt.forEach(St);var Tt=function(Rt){!Rt||wt.has(Rt)||Array.prototype.forEach.call(Rt.children,function(Pt){if(Ct.has(Pt))Tt(Pt);else try{var Lt=Pt.getAttribute(vt),kt=Lt!==null&&Lt!=="false",Ot=(counterMap.get(Pt)||0)+1,Mt=(At.get(Pt)||0)+1;counterMap.set(Pt,Ot),At.set(Pt,Mt),Ft.push(Pt),Ot===1&&kt&&uncontrolledNodes.set(Pt,!0),Mt===1&&Pt.setAttribute(xt,"true"),kt||Pt.setAttribute(vt,"true")}catch(It){console.error("aria-hidden: cannot operate on ",Pt,It)}})};return Tt(Et),Ct.clear(),lockCount++,function(){Ft.forEach(function(Rt){var Pt=counterMap.get(Rt)-1,Lt=At.get(Rt)-1;counterMap.set(Rt,Pt),At.set(Rt,Lt),Pt||(uncontrolledNodes.has(Rt)||Rt.removeAttribute(vt),uncontrolledNodes.delete(Rt)),Lt||Rt.removeAttribute(xt)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(yt,Et,xt){xt===void 0&&(xt="data-aria-hidden");var vt=Array.from(Array.isArray(yt)?yt:[yt]),bt=getDefaultParent(yt);return bt?(vt.push.apply(vt,Array.from(bt.querySelectorAll("[aria-live], script"))),applyAttributeToOthers(vt,bt,xt,"aria-hidden")):function(){return null}},__assign=function(){return __assign=Object.assign||function(Et){for(var xt,vt=1,bt=arguments.length;vt<bt;vt++){xt=arguments[vt];for(var At in xt)Object.prototype.hasOwnProperty.call(xt,At)&&(Et[At]=xt[At])}return Et},__assign.apply(this,arguments)};function __rest$1(yt,Et){var xt={};for(var vt in yt)Object.prototype.hasOwnProperty.call(yt,vt)&&Et.indexOf(vt)<0&&(xt[vt]=yt[vt]);if(yt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var bt=0,vt=Object.getOwnPropertySymbols(yt);bt<vt.length;bt++)Et.indexOf(vt[bt])<0&&Object.prototype.propertyIsEnumerable.call(yt,vt[bt])&&(xt[vt[bt]]=yt[vt[bt]]);return xt}function __spreadArray(yt,Et,xt){if(xt||arguments.length===2)for(var vt=0,bt=Et.length,At;vt<bt;vt++)(At||!(vt in Et))&&(At||(At=Array.prototype.slice.call(Et,0,vt)),At[vt]=Et[vt]);return yt.concat(At||Array.prototype.slice.call(Et))}typeof SuppressedError=="function"&&SuppressedError;var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";function assignRef(yt,Et){return typeof yt=="function"?yt(Et):yt&&(yt.current=Et),yt}function useCallbackRef$1(yt,Et){var xt=reactExports.useState(function(){return{value:yt,callback:Et,facade:{get current(){return xt.value},set current(vt){var bt=xt.value;bt!==vt&&(xt.value=vt,xt.callback(vt,bt))}}}})[0];return xt.callback=Et,xt.facade}var useIsomorphicLayoutEffect$1=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,currentValues=new WeakMap;function useMergeRefs(yt,Et){var xt=useCallbackRef$1(null,function(vt){return yt.forEach(function(bt){return assignRef(bt,vt)})});return useIsomorphicLayoutEffect$1(function(){var vt=currentValues.get(xt);if(vt){var bt=new Set(vt),At=new Set(yt),Ft=xt.current;bt.forEach(function(Ct){At.has(Ct)||assignRef(Ct,null)}),At.forEach(function(Ct){bt.has(Ct)||assignRef(Ct,Ft)})}currentValues.set(xt,yt)},[yt]),xt}function ItoI(yt){return yt}function innerCreateMedium(yt,Et){Et===void 0&&(Et=ItoI);var xt=[],vt=!1,bt={read:function(){if(vt)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return xt.length?xt[xt.length-1]:yt},useMedium:function(At){var Ft=Et(At,vt);return xt.push(Ft),function(){xt=xt.filter(function(Ct){return Ct!==Ft})}},assignSyncMedium:function(At){for(vt=!0;xt.length;){var Ft=xt;xt=[],Ft.forEach(At)}xt={push:function(Ct){return At(Ct)},filter:function(){return xt}}},assignMedium:function(At){vt=!0;var Ft=[];if(xt.length){var Ct=xt;xt=[],Ct.forEach(At),Ft=xt}var wt=function(){var Tt=Ft;Ft=[],Tt.forEach(At)},St=function(){return Promise.resolve().then(wt)};St(),xt={push:function(Tt){Ft.push(Tt),St()},filter:function(Tt){return Ft=Ft.filter(Tt),xt}}}};return bt}function createSidecarMedium(yt){yt===void 0&&(yt={});var Et=innerCreateMedium(null);return Et.options=__assign({async:!0,ssr:!1},yt),Et}var SideCar$1=function(yt){var Et=yt.sideCar,xt=__rest$1(yt,["sideCar"]);if(!Et)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var vt=Et.read();if(!vt)throw new Error("Sidecar medium not found");return reactExports.createElement(vt,__assign({},xt))};SideCar$1.isSideCarExport=!0;function exportSidecar(yt,Et){return yt.useMedium(Et),SideCar$1}var effectCar=createSidecarMedium(),nothing=function(){},RemoveScroll=reactExports.forwardRef(function(yt,Et){var xt=reactExports.useRef(null),vt=reactExports.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),bt=vt[0],At=vt[1],Ft=yt.forwardProps,Ct=yt.children,wt=yt.className,St=yt.removeScrollBar,Tt=yt.enabled,Rt=yt.shards,Pt=yt.sideCar,Lt=yt.noRelative,kt=yt.noIsolation,Ot=yt.inert,Mt=yt.allowPinchZoom,It=yt.as,Nt=It===void 0?"div":It,Ut=yt.gapMode,jt=__rest$1(yt,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),Vt=Pt,zt=useMergeRefs([xt,Et]),Ht=__assign(__assign({},jt),bt);return reactExports.createElement(reactExports.Fragment,null,Tt&&reactExports.createElement(Vt,{sideCar:effectCar,removeScrollBar:St,shards:Rt,noRelative:Lt,noIsolation:kt,inert:Ot,setCallbacks:At,allowPinchZoom:!!Mt,lockRef:xt,gapMode:Ut}),Ft?reactExports.cloneElement(reactExports.Children.only(Ct),__assign(__assign({},Ht),{ref:zt})):reactExports.createElement(Nt,__assign({},Ht,{className:wt,ref:zt}),Ct))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var getNonce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var yt=document.createElement("style");yt.type="text/css";var Et=getNonce();return Et&&yt.setAttribute("nonce",Et),yt}function injectStyles(yt,Et){yt.styleSheet?yt.styleSheet.cssText=Et:yt.appendChild(document.createTextNode(Et))}function insertStyleTag(yt){var Et=document.head||document.getElementsByTagName("head")[0];Et.appendChild(yt)}var stylesheetSingleton=function(){var yt=0,Et=null;return{add:function(xt){yt==0&&(Et=makeStyleTag())&&(injectStyles(Et,xt),insertStyleTag(Et)),yt++},remove:function(){yt--,!yt&&Et&&(Et.parentNode&&Et.parentNode.removeChild(Et),Et=null)}}},styleHookSingleton=function(){var yt=stylesheetSingleton();return function(Et,xt){reactExports.useEffect(function(){return yt.add(Et),function(){yt.remove()}},[Et&&xt])}},styleSingleton=function(){var yt=styleHookSingleton(),Et=function(xt){var vt=xt.styles,bt=xt.dynamic;return yt(vt,bt),null};return Et},zeroGap={left:0,top:0,right:0,gap:0},parse$1=function(yt){return parseInt(yt||"",10)||0},getOffset=function(yt){var Et=window.getComputedStyle(document.body),xt=Et[yt==="padding"?"paddingLeft":"marginLeft"],vt=Et[yt==="padding"?"paddingTop":"marginTop"],bt=Et[yt==="padding"?"paddingRight":"marginRight"];return[parse$1(xt),parse$1(vt),parse$1(bt)]},getGapWidth=function(yt){if(yt===void 0&&(yt="margin"),typeof window>"u")return zeroGap;var Et=getOffset(yt),xt=document.documentElement.clientWidth,vt=window.innerWidth;return{left:Et[0],top:Et[1],right:Et[2],gap:Math.max(0,vt-xt+Et[2]-Et[0])}},Style=styleSingleton(),lockAttribute="data-scroll-locked",getStyles=function(yt,Et,xt,vt){var bt=yt.left,At=yt.top,Ft=yt.right,Ct=yt.gap;return xt===void 0&&(xt="margin"),`
|
|
9
|
+
`).replace(Cg,"")}function u0(Dt,Bt){return Bt=c0(Bt),c0(Dt)===Bt}function Vo(Dt,Bt,$t,Yt,an,un){switch($t){case"children":typeof Yt=="string"?Bt==="body"||Bt==="textarea"&&Yt===""||wo(Dt,Yt):(typeof Yt=="number"||typeof Yt=="bigint")&&Bt!=="body"&&wo(Dt,""+Yt);break;case"className":Va(Dt,"class",Yt);break;case"tabIndex":Va(Dt,"tabindex",Yt);break;case"dir":case"role":case"viewBox":case"width":case"height":Va(Dt,$t,Yt);break;case"style":za(Dt,Yt,un);break;case"data":if(Bt!=="object"){Va(Dt,"data",Yt);break}case"src":case"href":if(Yt===""&&(Bt!=="a"||$t!=="href")){Dt.removeAttribute($t);break}if(Yt==null||typeof Yt=="function"||typeof Yt=="symbol"||typeof Yt=="boolean"){Dt.removeAttribute($t);break}Yt=bs(""+Yt),Dt.setAttribute($t,Yt);break;case"action":case"formAction":if(typeof Yt=="function"){Dt.setAttribute($t,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof un=="function"&&($t==="formAction"?(Bt!=="input"&&Vo(Dt,Bt,"name",an.name,an,null),Vo(Dt,Bt,"formEncType",an.formEncType,an,null),Vo(Dt,Bt,"formMethod",an.formMethod,an,null),Vo(Dt,Bt,"formTarget",an.formTarget,an,null)):(Vo(Dt,Bt,"encType",an.encType,an,null),Vo(Dt,Bt,"method",an.method,an,null),Vo(Dt,Bt,"target",an.target,an,null)));if(Yt==null||typeof Yt=="symbol"||typeof Yt=="boolean"){Dt.removeAttribute($t);break}Yt=bs(""+Yt),Dt.setAttribute($t,Yt);break;case"onClick":Yt!=null&&(Dt.onclick=$o);break;case"onScroll":Yt!=null&&ro("scroll",Dt);break;case"onScrollEnd":Yt!=null&&ro("scrollend",Dt);break;case"dangerouslySetInnerHTML":if(Yt!=null){if(typeof Yt!="object"||!("__html"in Yt))throw Error(vt(61));if($t=Yt.__html,$t!=null){if(an.children!=null)throw Error(vt(60));Dt.innerHTML=$t}}break;case"multiple":Dt.multiple=Yt&&typeof Yt!="function"&&typeof Yt!="symbol";break;case"muted":Dt.muted=Yt&&typeof Yt!="function"&&typeof Yt!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(Yt==null||typeof Yt=="function"||typeof Yt=="boolean"||typeof Yt=="symbol"){Dt.removeAttribute("xlink:href");break}$t=bs(""+Yt),Dt.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",$t);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":Yt!=null&&typeof Yt!="function"&&typeof Yt!="symbol"?Dt.setAttribute($t,""+Yt):Dt.removeAttribute($t);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":Yt&&typeof Yt!="function"&&typeof Yt!="symbol"?Dt.setAttribute($t,""):Dt.removeAttribute($t);break;case"capture":case"download":Yt===!0?Dt.setAttribute($t,""):Yt!==!1&&Yt!=null&&typeof Yt!="function"&&typeof Yt!="symbol"?Dt.setAttribute($t,Yt):Dt.removeAttribute($t);break;case"cols":case"rows":case"size":case"span":Yt!=null&&typeof Yt!="function"&&typeof Yt!="symbol"&&!isNaN(Yt)&&1<=Yt?Dt.setAttribute($t,Yt):Dt.removeAttribute($t);break;case"rowSpan":case"start":Yt==null||typeof Yt=="function"||typeof Yt=="symbol"||isNaN(Yt)?Dt.removeAttribute($t):Dt.setAttribute($t,Yt);break;case"popover":ro("beforetoggle",Dt),ro("toggle",Dt),ys(Dt,"popover",Yt);break;case"xlinkActuate":io(Dt,"http://www.w3.org/1999/xlink","xlink:actuate",Yt);break;case"xlinkArcrole":io(Dt,"http://www.w3.org/1999/xlink","xlink:arcrole",Yt);break;case"xlinkRole":io(Dt,"http://www.w3.org/1999/xlink","xlink:role",Yt);break;case"xlinkShow":io(Dt,"http://www.w3.org/1999/xlink","xlink:show",Yt);break;case"xlinkTitle":io(Dt,"http://www.w3.org/1999/xlink","xlink:title",Yt);break;case"xlinkType":io(Dt,"http://www.w3.org/1999/xlink","xlink:type",Yt);break;case"xmlBase":io(Dt,"http://www.w3.org/XML/1998/namespace","xml:base",Yt);break;case"xmlLang":io(Dt,"http://www.w3.org/XML/1998/namespace","xml:lang",Yt);break;case"xmlSpace":io(Dt,"http://www.w3.org/XML/1998/namespace","xml:space",Yt);break;case"is":ys(Dt,"is",Yt);break;case"innerText":case"textContent":break;default:(!(2<$t.length)||$t[0]!=="o"&&$t[0]!=="O"||$t[1]!=="n"&&$t[1]!=="N")&&($t=Vi.get($t)||$t,ys(Dt,$t,Yt))}}function $f(Dt,Bt,$t,Yt,an,un){switch($t){case"style":za(Dt,Yt,un);break;case"dangerouslySetInnerHTML":if(Yt!=null){if(typeof Yt!="object"||!("__html"in Yt))throw Error(vt(61));if($t=Yt.__html,$t!=null){if(an.children!=null)throw Error(vt(60));Dt.innerHTML=$t}}break;case"children":typeof Yt=="string"?wo(Dt,Yt):(typeof Yt=="number"||typeof Yt=="bigint")&&wo(Dt,""+Yt);break;case"onScroll":Yt!=null&&ro("scroll",Dt);break;case"onScrollEnd":Yt!=null&&ro("scrollend",Dt);break;case"onClick":Yt!=null&&(Dt.onclick=$o);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ja.hasOwnProperty($t))e:{if($t[0]==="o"&&$t[1]==="n"&&(an=$t.endsWith("Capture"),Bt=$t.slice(2,an?$t.length-7:void 0),un=Dt[wi]||null,un=un!=null?un[$t]:null,typeof un=="function"&&Dt.removeEventListener(Bt,un,an),typeof Yt=="function")){typeof un!="function"&&un!==null&&($t in Dt?Dt[$t]=null:Dt.hasAttribute($t)&&Dt.removeAttribute($t)),Dt.addEventListener(Bt,Yt,an);break e}$t in Dt?Dt[$t]=Yt:Yt===!0?Dt.setAttribute($t,""):ys(Dt,$t,Yt)}}}function Al(Dt,Bt,$t){switch(Bt){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ro("error",Dt),ro("load",Dt);var Yt=!1,an=!1,un;for(un in $t)if($t.hasOwnProperty(un)){var bn=$t[un];if(bn!=null)switch(un){case"src":Yt=!0;break;case"srcSet":an=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(vt(137,Bt));default:Vo(Dt,Bt,un,bn,$t,null)}}an&&Vo(Dt,Bt,"srcSet",$t.srcSet,$t,null),Yt&&Vo(Dt,Bt,"src",$t.src,$t,null);return;case"input":ro("invalid",Dt);var qn=un=bn=an=null,Sr=null,Jr=null;for(Yt in $t)if($t.hasOwnProperty(Yt)){var ui=$t[Yt];if(ui!=null)switch(Yt){case"name":an=ui;break;case"type":bn=ui;break;case"checked":Sr=ui;break;case"defaultChecked":Jr=ui;break;case"value":un=ui;break;case"defaultValue":qn=ui;break;case"children":case"dangerouslySetInnerHTML":if(ui!=null)throw Error(vt(137,Bt));break;default:Vo(Dt,Bt,Yt,ui,$t,null)}}la(Dt,un,qn,Sr,Jr,bn,an,!1);return;case"select":ro("invalid",Dt),Yt=bn=un=null;for(an in $t)if($t.hasOwnProperty(an)&&(qn=$t[an],qn!=null))switch(an){case"value":un=qn;break;case"defaultValue":bn=qn;break;case"multiple":Yt=qn;default:Vo(Dt,Bt,an,qn,$t,null)}Bt=un,$t=bn,Dt.multiple=!!Yt,Bt!=null?Io(Dt,!!Yt,Bt,!1):$t!=null&&Io(Dt,!!Yt,$t,!0);return;case"textarea":ro("invalid",Dt),un=an=Yt=null;for(bn in $t)if($t.hasOwnProperty(bn)&&(qn=$t[bn],qn!=null))switch(bn){case"value":Yt=qn;break;case"defaultValue":an=qn;break;case"children":un=qn;break;case"dangerouslySetInnerHTML":if(qn!=null)throw Error(vt(91));break;default:Vo(Dt,Bt,bn,qn,$t,null)}Ga(Dt,Yt,an,un);return;case"option":for(Sr in $t)$t.hasOwnProperty(Sr)&&(Yt=$t[Sr],Yt!=null)&&(Sr==="selected"?Dt.selected=Yt&&typeof Yt!="function"&&typeof Yt!="symbol":Vo(Dt,Bt,Sr,Yt,$t,null));return;case"dialog":ro("beforetoggle",Dt),ro("toggle",Dt),ro("cancel",Dt),ro("close",Dt);break;case"iframe":case"object":ro("load",Dt);break;case"video":case"audio":for(Yt=0;Yt<ku.length;Yt++)ro(ku[Yt],Dt);break;case"image":ro("error",Dt),ro("load",Dt);break;case"details":ro("toggle",Dt);break;case"embed":case"source":case"link":ro("error",Dt),ro("load",Dt);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Jr in $t)if($t.hasOwnProperty(Jr)&&(Yt=$t[Jr],Yt!=null))switch(Jr){case"children":case"dangerouslySetInnerHTML":throw Error(vt(137,Bt));default:Vo(Dt,Bt,Jr,Yt,$t,null)}return;default:if(Uo(Bt)){for(ui in $t)$t.hasOwnProperty(ui)&&(Yt=$t[ui],Yt!==void 0&&$f(Dt,Bt,ui,Yt,$t,void 0));return}}for(qn in $t)$t.hasOwnProperty(qn)&&(Yt=$t[qn],Yt!=null&&Vo(Dt,Bt,qn,Yt,$t,null))}function Fg(Dt,Bt,$t,Yt){switch(Bt){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var an=null,un=null,bn=null,qn=null,Sr=null,Jr=null,ui=null;for(oi in $t){var gi=$t[oi];if($t.hasOwnProperty(oi)&&gi!=null)switch(oi){case"checked":break;case"value":break;case"defaultValue":Sr=gi;default:Yt.hasOwnProperty(oi)||Vo(Dt,Bt,oi,null,Yt,gi)}}for(var ni in Yt){var oi=Yt[ni];if(gi=$t[ni],Yt.hasOwnProperty(ni)&&(oi!=null||gi!=null))switch(ni){case"type":un=oi;break;case"name":an=oi;break;case"checked":Jr=oi;break;case"defaultChecked":ui=oi;break;case"value":bn=oi;break;case"defaultValue":qn=oi;break;case"children":case"dangerouslySetInnerHTML":if(oi!=null)throw Error(vt(137,Bt));break;default:oi!==gi&&Vo(Dt,Bt,ni,oi,Yt,gi)}}wa(Dt,bn,qn,Sr,Jr,ui,un,an);return;case"select":oi=bn=qn=ni=null;for(un in $t)if(Sr=$t[un],$t.hasOwnProperty(un)&&Sr!=null)switch(un){case"value":break;case"multiple":oi=Sr;default:Yt.hasOwnProperty(un)||Vo(Dt,Bt,un,null,Yt,Sr)}for(an in Yt)if(un=Yt[an],Sr=$t[an],Yt.hasOwnProperty(an)&&(un!=null||Sr!=null))switch(an){case"value":ni=un;break;case"defaultValue":qn=un;break;case"multiple":bn=un;default:un!==Sr&&Vo(Dt,Bt,an,un,Yt,Sr)}Bt=qn,$t=bn,Yt=oi,ni!=null?Io(Dt,!!$t,ni,!1):!!Yt!=!!$t&&(Bt!=null?Io(Dt,!!$t,Bt,!0):Io(Dt,!!$t,$t?[]:"",!1));return;case"textarea":oi=ni=null;for(qn in $t)if(an=$t[qn],$t.hasOwnProperty(qn)&&an!=null&&!Yt.hasOwnProperty(qn))switch(qn){case"value":break;case"children":break;default:Vo(Dt,Bt,qn,null,Yt,an)}for(bn in Yt)if(an=Yt[bn],un=$t[bn],Yt.hasOwnProperty(bn)&&(an!=null||un!=null))switch(bn){case"value":ni=an;break;case"defaultValue":oi=an;break;case"children":break;case"dangerouslySetInnerHTML":if(an!=null)throw Error(vt(91));break;default:an!==un&&Vo(Dt,Bt,bn,an,Yt,un)}xo(Dt,ni,oi);return;case"option":for(var Ji in $t)ni=$t[Ji],$t.hasOwnProperty(Ji)&&ni!=null&&!Yt.hasOwnProperty(Ji)&&(Ji==="selected"?Dt.selected=!1:Vo(Dt,Bt,Ji,null,Yt,ni));for(Sr in Yt)ni=Yt[Sr],oi=$t[Sr],Yt.hasOwnProperty(Sr)&&ni!==oi&&(ni!=null||oi!=null)&&(Sr==="selected"?Dt.selected=ni&&typeof ni!="function"&&typeof ni!="symbol":Vo(Dt,Bt,Sr,ni,Yt,oi));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _s in $t)ni=$t[_s],$t.hasOwnProperty(_s)&&ni!=null&&!Yt.hasOwnProperty(_s)&&Vo(Dt,Bt,_s,null,Yt,ni);for(Jr in Yt)if(ni=Yt[Jr],oi=$t[Jr],Yt.hasOwnProperty(Jr)&&ni!==oi&&(ni!=null||oi!=null))switch(Jr){case"children":case"dangerouslySetInnerHTML":if(ni!=null)throw Error(vt(137,Bt));break;default:Vo(Dt,Bt,Jr,ni,Yt,oi)}return;default:if(Uo(Bt)){for(var Go in $t)ni=$t[Go],$t.hasOwnProperty(Go)&&ni!==void 0&&!Yt.hasOwnProperty(Go)&&$f(Dt,Bt,Go,void 0,Yt,ni);for(ui in Yt)ni=Yt[ui],oi=$t[ui],!Yt.hasOwnProperty(ui)||ni===oi||ni===void 0&&oi===void 0||$f(Dt,Bt,ui,ni,Yt,oi);return}}for(var jr in $t)ni=$t[jr],$t.hasOwnProperty(jr)&&ni!=null&&!Yt.hasOwnProperty(jr)&&Vo(Dt,Bt,jr,null,Yt,ni);for(gi in Yt)ni=Yt[gi],oi=$t[gi],!Yt.hasOwnProperty(gi)||ni===oi||ni==null&&oi==null||Vo(Dt,Bt,gi,ni,Yt,oi)}function d0(Dt){switch(Dt){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function wg(){if(typeof performance.getEntriesByType=="function"){for(var Dt=0,Bt=0,$t=performance.getEntriesByType("resource"),Yt=0;Yt<$t.length;Yt++){var an=$t[Yt],un=an.transferSize,bn=an.initiatorType,qn=an.duration;if(un&&qn&&d0(bn)){for(bn=0,qn=an.responseEnd,Yt+=1;Yt<$t.length;Yt++){var Sr=$t[Yt],Jr=Sr.startTime;if(Jr>qn)break;var ui=Sr.transferSize,gi=Sr.initiatorType;ui&&d0(gi)&&(Sr=Sr.responseEnd,bn+=ui*(Sr<qn?1:(qn-Jr)/(Sr-Jr)))}if(--Yt,Bt+=8*(un+bn)/(an.duration/1e3),Dt++,10<Dt)break}}if(0<Dt)return Bt/Dt/1e6}return navigator.connection&&(Dt=navigator.connection.downlink,typeof Dt=="number")?Dt:5}var jf=null,Hf=null;function Ad(Dt){return Dt.nodeType===9?Dt:Dt.ownerDocument}function f0(Dt){switch(Dt){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function h0(Dt,Bt){if(Dt===0)switch(Bt){case"svg":return 1;case"math":return 2;default:return 0}return Dt===1&&Bt==="foreignObject"?0:Dt}function Wf(Dt,Bt){return Dt==="textarea"||Dt==="noscript"||typeof Bt.children=="string"||typeof Bt.children=="number"||typeof Bt.children=="bigint"||typeof Bt.dangerouslySetInnerHTML=="object"&&Bt.dangerouslySetInnerHTML!==null&&Bt.dangerouslySetInnerHTML.__html!=null}var Vf=null;function Sg(){var Dt=window.event;return Dt&&Dt.type==="popstate"?Dt===Vf?!1:(Vf=Dt,!0):(Vf=null,!1)}var p0=typeof setTimeout=="function"?setTimeout:void 0,Dg=typeof clearTimeout=="function"?clearTimeout:void 0,g0=typeof Promise=="function"?Promise:void 0,Tg=typeof queueMicrotask=="function"?queueMicrotask:typeof g0<"u"?function(Dt){return g0.resolve(null).then(Dt).catch(Rg)}:p0;function Rg(Dt){setTimeout(function(){throw Dt})}function Yc(Dt){return Dt==="head"}function m0(Dt,Bt){var $t=Bt,Yt=0;do{var an=$t.nextSibling;if(Dt.removeChild($t),an&&an.nodeType===8)if($t=an.data,$t==="/$"||$t==="/&"){if(Yt===0){Dt.removeChild(an),bu(Bt);return}Yt--}else if($t==="$"||$t==="$?"||$t==="$~"||$t==="$!"||$t==="&")Yt++;else if($t==="html")zu(Dt.ownerDocument.documentElement);else if($t==="head"){$t=Dt.ownerDocument.head,zu($t);for(var un=$t.firstChild;un;){var bn=un.nextSibling,qn=un.nodeName;un[xs]||qn==="SCRIPT"||qn==="STYLE"||qn==="LINK"&&un.rel.toLowerCase()==="stylesheet"||$t.removeChild(un),un=bn}}else $t==="body"&&zu(Dt.ownerDocument.body);$t=an}while($t);bu(Bt)}function E0(Dt,Bt){var $t=Dt;Dt=0;do{var Yt=$t.nextSibling;if($t.nodeType===1?Bt?($t._stashedDisplay=$t.style.display,$t.style.display="none"):($t.style.display=$t._stashedDisplay||"",$t.getAttribute("style")===""&&$t.removeAttribute("style")):$t.nodeType===3&&(Bt?($t._stashedText=$t.nodeValue,$t.nodeValue=""):$t.nodeValue=$t._stashedText||""),Yt&&Yt.nodeType===8)if($t=Yt.data,$t==="/$"){if(Dt===0)break;Dt--}else $t!=="$"&&$t!=="$?"&&$t!=="$~"&&$t!=="$!"||Dt++;$t=Yt}while($t)}function Gf(Dt){var Bt=Dt.firstChild;for(Bt&&Bt.nodeType===10&&(Bt=Bt.nextSibling);Bt;){var $t=Bt;switch(Bt=Bt.nextSibling,$t.nodeName){case"HTML":case"HEAD":case"BODY":Gf($t),$s($t);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if($t.rel.toLowerCase()==="stylesheet")continue}Dt.removeChild($t)}}function Bg(Dt,Bt,$t,Yt){for(;Dt.nodeType===1;){var an=$t;if(Dt.nodeName.toLowerCase()!==Bt.toLowerCase()){if(!Yt&&(Dt.nodeName!=="INPUT"||Dt.type!=="hidden"))break}else if(Yt){if(!Dt[xs])switch(Bt){case"meta":if(!Dt.hasAttribute("itemprop"))break;return Dt;case"link":if(un=Dt.getAttribute("rel"),un==="stylesheet"&&Dt.hasAttribute("data-precedence"))break;if(un!==an.rel||Dt.getAttribute("href")!==(an.href==null||an.href===""?null:an.href)||Dt.getAttribute("crossorigin")!==(an.crossOrigin==null?null:an.crossOrigin)||Dt.getAttribute("title")!==(an.title==null?null:an.title))break;return Dt;case"style":if(Dt.hasAttribute("data-precedence"))break;return Dt;case"script":if(un=Dt.getAttribute("src"),(un!==(an.src==null?null:an.src)||Dt.getAttribute("type")!==(an.type==null?null:an.type)||Dt.getAttribute("crossorigin")!==(an.crossOrigin==null?null:an.crossOrigin))&&un&&Dt.hasAttribute("async")&&!Dt.hasAttribute("itemprop"))break;return Dt;default:return Dt}}else if(Bt==="input"&&Dt.type==="hidden"){var un=an.name==null?null:""+an.name;if(an.type==="hidden"&&Dt.getAttribute("name")===un)return Dt}else return Dt;if(Dt=gc(Dt.nextSibling),Dt===null)break}return null}function Mg(Dt,Bt,$t){if(Bt==="")return null;for(;Dt.nodeType!==3;)if((Dt.nodeType!==1||Dt.nodeName!=="INPUT"||Dt.type!=="hidden")&&!$t||(Dt=gc(Dt.nextSibling),Dt===null))return null;return Dt}function y0(Dt,Bt){for(;Dt.nodeType!==8;)if((Dt.nodeType!==1||Dt.nodeName!=="INPUT"||Dt.type!=="hidden")&&!Bt||(Dt=gc(Dt.nextSibling),Dt===null))return null;return Dt}function qf(Dt){return Dt.data==="$?"||Dt.data==="$~"}function Yf(Dt){return Dt.data==="$!"||Dt.data==="$?"&&Dt.ownerDocument.readyState!=="loading"}function Ig(Dt,Bt){var $t=Dt.ownerDocument;if(Dt.data==="$~")Dt._reactRetry=Bt;else if(Dt.data!=="$?"||$t.readyState!=="loading")Bt();else{var Yt=function(){Bt(),$t.removeEventListener("DOMContentLoaded",Yt)};$t.addEventListener("DOMContentLoaded",Yt),Dt._reactRetry=Yt}}function gc(Dt){for(;Dt!=null;Dt=Dt.nextSibling){var Bt=Dt.nodeType;if(Bt===1||Bt===3)break;if(Bt===8){if(Bt=Dt.data,Bt==="$"||Bt==="$!"||Bt==="$?"||Bt==="$~"||Bt==="&"||Bt==="F!"||Bt==="F")break;if(Bt==="/$"||Bt==="/&")return null}}return Dt}var Xf=null;function _0(Dt){Dt=Dt.nextSibling;for(var Bt=0;Dt;){if(Dt.nodeType===8){var $t=Dt.data;if($t==="/$"||$t==="/&"){if(Bt===0)return gc(Dt.nextSibling);Bt--}else $t!=="$"&&$t!=="$!"&&$t!=="$?"&&$t!=="$~"&&$t!=="&"||Bt++}Dt=Dt.nextSibling}return null}function x0(Dt){Dt=Dt.previousSibling;for(var Bt=0;Dt;){if(Dt.nodeType===8){var $t=Dt.data;if($t==="$"||$t==="$!"||$t==="$?"||$t==="$~"||$t==="&"){if(Bt===0)return Dt;Bt--}else $t!=="/$"&&$t!=="/&"||Bt++}Dt=Dt.previousSibling}return null}function v0(Dt,Bt,$t){switch(Bt=Ad($t),Dt){case"html":if(Dt=Bt.documentElement,!Dt)throw Error(vt(452));return Dt;case"head":if(Dt=Bt.head,!Dt)throw Error(vt(453));return Dt;case"body":if(Dt=Bt.body,!Dt)throw Error(vt(454));return Dt;default:throw Error(vt(451))}}function zu(Dt){for(var Bt=Dt.attributes;Bt.length;)Dt.removeAttributeNode(Bt[0]);$s(Dt)}var mc=new Map,b0=new Set;function Cd(Dt){return typeof Dt.getRootNode=="function"?Dt.getRootNode():Dt.nodeType===9?Dt:Dt.ownerDocument}var kc=nn.d;nn.d={f:Og,r:Pg,D:Lg,C:kg,L:Ng,m:zg,X:$g,S:Ug,M:jg};function Og(){var Dt=kc.f(),Bt=gd();return Dt||Bt}function Pg(Dt){var Bt=Hs(Dt);Bt!==null&&Bt.tag===5&&Bt.type==="form"?zh(Bt):kc.r(Dt)}var _u=typeof document>"u"?null:document;function A0(Dt,Bt,$t){var Yt=_u;if(Yt&&typeof Bt=="string"&&Bt){var an=cs(Bt);an='link[rel="'+Dt+'"][href="'+an+'"]',typeof $t=="string"&&(an+='[crossorigin="'+$t+'"]'),b0.has(an)||(b0.add(an),Dt={rel:Dt,crossOrigin:$t,href:Bt},Yt.querySelector(an)===null&&(Bt=Yt.createElement("link"),Al(Bt,"link",Dt),Ds(Bt),Yt.head.appendChild(Bt)))}}function Lg(Dt){kc.D(Dt),A0("dns-prefetch",Dt,null)}function kg(Dt,Bt){kc.C(Dt,Bt),A0("preconnect",Dt,Bt)}function Ng(Dt,Bt,$t){kc.L(Dt,Bt,$t);var Yt=_u;if(Yt&&Dt&&Bt){var an='link[rel="preload"][as="'+cs(Bt)+'"]';Bt==="image"&&$t&&$t.imageSrcSet?(an+='[imagesrcset="'+cs($t.imageSrcSet)+'"]',typeof $t.imageSizes=="string"&&(an+='[imagesizes="'+cs($t.imageSizes)+'"]')):an+='[href="'+cs(Dt)+'"]';var un=an;switch(Bt){case"style":un=xu(Dt);break;case"script":un=vu(Dt)}mc.has(un)||(Dt=Rt({rel:"preload",href:Bt==="image"&&$t&&$t.imageSrcSet?void 0:Dt,as:Bt},$t),mc.set(un,Dt),Yt.querySelector(an)!==null||Bt==="style"&&Yt.querySelector(Uu(un))||Bt==="script"&&Yt.querySelector($u(un))||(Bt=Yt.createElement("link"),Al(Bt,"link",Dt),Ds(Bt),Yt.head.appendChild(Bt)))}}function zg(Dt,Bt){kc.m(Dt,Bt);var $t=_u;if($t&&Dt){var Yt=Bt&&typeof Bt.as=="string"?Bt.as:"script",an='link[rel="modulepreload"][as="'+cs(Yt)+'"][href="'+cs(Dt)+'"]',un=an;switch(Yt){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":un=vu(Dt)}if(!mc.has(un)&&(Dt=Rt({rel:"modulepreload",href:Dt},Bt),mc.set(un,Dt),$t.querySelector(an)===null)){switch(Yt){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if($t.querySelector($u(un)))return}Yt=$t.createElement("link"),Al(Yt,"link",Dt),Ds(Yt),$t.head.appendChild(Yt)}}}function Ug(Dt,Bt,$t){kc.S(Dt,Bt,$t);var Yt=_u;if(Yt&&Dt){var an=Es(Yt).hoistableStyles,un=xu(Dt);Bt=Bt||"default";var bn=an.get(un);if(!bn){var qn={loading:0,preload:null};if(bn=Yt.querySelector(Uu(un)))qn.loading=5;else{Dt=Rt({rel:"stylesheet",href:Dt,"data-precedence":Bt},$t),($t=mc.get(un))&&Kf(Dt,$t);var Sr=bn=Yt.createElement("link");Ds(Sr),Al(Sr,"link",Dt),Sr._p=new Promise(function(Jr,ui){Sr.onload=Jr,Sr.onerror=ui}),Sr.addEventListener("load",function(){qn.loading|=1}),Sr.addEventListener("error",function(){qn.loading|=2}),qn.loading|=4,Fd(bn,Bt,Yt)}bn={type:"stylesheet",instance:bn,count:1,state:qn},an.set(un,bn)}}}function $g(Dt,Bt){kc.X(Dt,Bt);var $t=_u;if($t&&Dt){var Yt=Es($t).hoistableScripts,an=vu(Dt),un=Yt.get(an);un||(un=$t.querySelector($u(an)),un||(Dt=Rt({src:Dt,async:!0},Bt),(Bt=mc.get(an))&&Zf(Dt,Bt),un=$t.createElement("script"),Ds(un),Al(un,"link",Dt),$t.head.appendChild(un)),un={type:"script",instance:un,count:1,state:null},Yt.set(an,un))}}function jg(Dt,Bt){kc.M(Dt,Bt);var $t=_u;if($t&&Dt){var Yt=Es($t).hoistableScripts,an=vu(Dt),un=Yt.get(an);un||(un=$t.querySelector($u(an)),un||(Dt=Rt({src:Dt,async:!0,type:"module"},Bt),(Bt=mc.get(an))&&Zf(Dt,Bt),un=$t.createElement("script"),Ds(un),Al(un,"link",Dt),$t.head.appendChild(un)),un={type:"script",instance:un,count:1,state:null},Yt.set(an,un))}}function C0(Dt,Bt,$t,Yt){var an=(an=yn.current)?Cd(an):null;if(!an)throw Error(vt(446));switch(Dt){case"meta":case"title":return null;case"style":return typeof $t.precedence=="string"&&typeof $t.href=="string"?(Bt=xu($t.href),$t=Es(an).hoistableStyles,Yt=$t.get(Bt),Yt||(Yt={type:"style",instance:null,count:0,state:null},$t.set(Bt,Yt)),Yt):{type:"void",instance:null,count:0,state:null};case"link":if($t.rel==="stylesheet"&&typeof $t.href=="string"&&typeof $t.precedence=="string"){Dt=xu($t.href);var un=Es(an).hoistableStyles,bn=un.get(Dt);if(bn||(an=an.ownerDocument||an,bn={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},un.set(Dt,bn),(un=an.querySelector(Uu(Dt)))&&!un._p&&(bn.instance=un,bn.state.loading=5),mc.has(Dt)||($t={rel:"preload",as:"style",href:$t.href,crossOrigin:$t.crossOrigin,integrity:$t.integrity,media:$t.media,hrefLang:$t.hrefLang,referrerPolicy:$t.referrerPolicy},mc.set(Dt,$t),un||Hg(an,Dt,$t,bn.state))),Bt&&Yt===null)throw Error(vt(528,""));return bn}if(Bt&&Yt!==null)throw Error(vt(529,""));return null;case"script":return Bt=$t.async,$t=$t.src,typeof $t=="string"&&Bt&&typeof Bt!="function"&&typeof Bt!="symbol"?(Bt=vu($t),$t=Es(an).hoistableScripts,Yt=$t.get(Bt),Yt||(Yt={type:"script",instance:null,count:0,state:null},$t.set(Bt,Yt)),Yt):{type:"void",instance:null,count:0,state:null};default:throw Error(vt(444,Dt))}}function xu(Dt){return'href="'+cs(Dt)+'"'}function Uu(Dt){return'link[rel="stylesheet"]['+Dt+"]"}function F0(Dt){return Rt({},Dt,{"data-precedence":Dt.precedence,precedence:null})}function Hg(Dt,Bt,$t,Yt){Dt.querySelector('link[rel="preload"][as="style"]['+Bt+"]")?Yt.loading=1:(Bt=Dt.createElement("link"),Yt.preload=Bt,Bt.addEventListener("load",function(){return Yt.loading|=1}),Bt.addEventListener("error",function(){return Yt.loading|=2}),Al(Bt,"link",$t),Ds(Bt),Dt.head.appendChild(Bt))}function vu(Dt){return'[src="'+cs(Dt)+'"]'}function $u(Dt){return"script[async]"+Dt}function w0(Dt,Bt,$t){if(Bt.count++,Bt.instance===null)switch(Bt.type){case"style":var Yt=Dt.querySelector('style[data-href~="'+cs($t.href)+'"]');if(Yt)return Bt.instance=Yt,Ds(Yt),Yt;var an=Rt({},$t,{"data-href":$t.href,"data-precedence":$t.precedence,href:null,precedence:null});return Yt=(Dt.ownerDocument||Dt).createElement("style"),Ds(Yt),Al(Yt,"style",an),Fd(Yt,$t.precedence,Dt),Bt.instance=Yt;case"stylesheet":an=xu($t.href);var un=Dt.querySelector(Uu(an));if(un)return Bt.state.loading|=4,Bt.instance=un,Ds(un),un;Yt=F0($t),(an=mc.get(an))&&Kf(Yt,an),un=(Dt.ownerDocument||Dt).createElement("link"),Ds(un);var bn=un;return bn._p=new Promise(function(qn,Sr){bn.onload=qn,bn.onerror=Sr}),Al(un,"link",Yt),Bt.state.loading|=4,Fd(un,$t.precedence,Dt),Bt.instance=un;case"script":return un=vu($t.src),(an=Dt.querySelector($u(un)))?(Bt.instance=an,Ds(an),an):(Yt=$t,(an=mc.get(un))&&(Yt=Rt({},$t),Zf(Yt,an)),Dt=Dt.ownerDocument||Dt,an=Dt.createElement("script"),Ds(an),Al(an,"link",Yt),Dt.head.appendChild(an),Bt.instance=an);case"void":return null;default:throw Error(vt(443,Bt.type))}else Bt.type==="stylesheet"&&(Bt.state.loading&4)===0&&(Yt=Bt.instance,Bt.state.loading|=4,Fd(Yt,$t.precedence,Dt));return Bt.instance}function Fd(Dt,Bt,$t){for(var Yt=$t.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),an=Yt.length?Yt[Yt.length-1]:null,un=an,bn=0;bn<Yt.length;bn++){var qn=Yt[bn];if(qn.dataset.precedence===Bt)un=qn;else if(un!==an)break}un?un.parentNode.insertBefore(Dt,un.nextSibling):(Bt=$t.nodeType===9?$t.head:$t,Bt.insertBefore(Dt,Bt.firstChild))}function Kf(Dt,Bt){Dt.crossOrigin==null&&(Dt.crossOrigin=Bt.crossOrigin),Dt.referrerPolicy==null&&(Dt.referrerPolicy=Bt.referrerPolicy),Dt.title==null&&(Dt.title=Bt.title)}function Zf(Dt,Bt){Dt.crossOrigin==null&&(Dt.crossOrigin=Bt.crossOrigin),Dt.referrerPolicy==null&&(Dt.referrerPolicy=Bt.referrerPolicy),Dt.integrity==null&&(Dt.integrity=Bt.integrity)}var wd=null;function S0(Dt,Bt,$t){if(wd===null){var Yt=new Map,an=wd=new Map;an.set($t,Yt)}else an=wd,Yt=an.get($t),Yt||(Yt=new Map,an.set($t,Yt));if(Yt.has(Dt))return Yt;for(Yt.set(Dt,null),$t=$t.getElementsByTagName(Dt),an=0;an<$t.length;an++){var un=$t[an];if(!(un[xs]||un[mi]||Dt==="link"&&un.getAttribute("rel")==="stylesheet")&&un.namespaceURI!=="http://www.w3.org/2000/svg"){var bn=un.getAttribute(Bt)||"";bn=Dt+bn;var qn=Yt.get(bn);qn?qn.push(un):Yt.set(bn,[un])}}return Yt}function D0(Dt,Bt,$t){Dt=Dt.ownerDocument||Dt,Dt.head.insertBefore($t,Bt==="title"?Dt.querySelector("head > title"):null)}function Wg(Dt,Bt,$t){if($t===1||Bt.itemProp!=null)return!1;switch(Dt){case"meta":case"title":return!0;case"style":if(typeof Bt.precedence!="string"||typeof Bt.href!="string"||Bt.href==="")break;return!0;case"link":if(typeof Bt.rel!="string"||typeof Bt.href!="string"||Bt.href===""||Bt.onLoad||Bt.onError)break;return Bt.rel==="stylesheet"?(Dt=Bt.disabled,typeof Bt.precedence=="string"&&Dt==null):!0;case"script":if(Bt.async&&typeof Bt.async!="function"&&typeof Bt.async!="symbol"&&!Bt.onLoad&&!Bt.onError&&Bt.src&&typeof Bt.src=="string")return!0}return!1}function T0(Dt){return!(Dt.type==="stylesheet"&&(Dt.state.loading&3)===0)}function Vg(Dt,Bt,$t,Yt){if($t.type==="stylesheet"&&(typeof Yt.media!="string"||matchMedia(Yt.media).matches!==!1)&&($t.state.loading&4)===0){if($t.instance===null){var an=xu(Yt.href),un=Bt.querySelector(Uu(an));if(un){Bt=un._p,Bt!==null&&typeof Bt=="object"&&typeof Bt.then=="function"&&(Dt.count++,Dt=Sd.bind(Dt),Bt.then(Dt,Dt)),$t.state.loading|=4,$t.instance=un,Ds(un);return}un=Bt.ownerDocument||Bt,Yt=F0(Yt),(an=mc.get(an))&&Kf(Yt,an),un=un.createElement("link"),Ds(un);var bn=un;bn._p=new Promise(function(qn,Sr){bn.onload=qn,bn.onerror=Sr}),Al(un,"link",Yt),$t.instance=un}Dt.stylesheets===null&&(Dt.stylesheets=new Map),Dt.stylesheets.set($t,Bt),(Bt=$t.state.preload)&&($t.state.loading&3)===0&&(Dt.count++,$t=Sd.bind(Dt),Bt.addEventListener("load",$t),Bt.addEventListener("error",$t))}}var Qf=0;function Gg(Dt,Bt){return Dt.stylesheets&&Dt.count===0&&Td(Dt,Dt.stylesheets),0<Dt.count||0<Dt.imgCount?function($t){var Yt=setTimeout(function(){if(Dt.stylesheets&&Td(Dt,Dt.stylesheets),Dt.unsuspend){var un=Dt.unsuspend;Dt.unsuspend=null,un()}},6e4+Bt);0<Dt.imgBytes&&Qf===0&&(Qf=62500*wg());var an=setTimeout(function(){if(Dt.waitingForImages=!1,Dt.count===0&&(Dt.stylesheets&&Td(Dt,Dt.stylesheets),Dt.unsuspend)){var un=Dt.unsuspend;Dt.unsuspend=null,un()}},(Dt.imgBytes>Qf?50:800)+Bt);return Dt.unsuspend=$t,function(){Dt.unsuspend=null,clearTimeout(Yt),clearTimeout(an)}}:null}function Sd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Td(this,this.stylesheets);else if(this.unsuspend){var Dt=this.unsuspend;this.unsuspend=null,Dt()}}}var Dd=null;function Td(Dt,Bt){Dt.stylesheets=null,Dt.unsuspend!==null&&(Dt.count++,Dd=new Map,Bt.forEach(qg,Dt),Dd=null,Sd.call(Dt))}function qg(Dt,Bt){if(!(Bt.state.loading&4)){var $t=Dd.get(Dt);if($t)var Yt=$t.get(null);else{$t=new Map,Dd.set(Dt,$t);for(var an=Dt.querySelectorAll("link[data-precedence],style[data-precedence]"),un=0;un<an.length;un++){var bn=an[un];(bn.nodeName==="LINK"||bn.getAttribute("media")!=="not all")&&($t.set(bn.dataset.precedence,bn),Yt=bn)}Yt&&$t.set(null,Yt)}an=Bt.instance,bn=an.getAttribute("data-precedence"),un=$t.get(bn)||Yt,un===Yt&&$t.set(null,an),$t.set(bn,an),this.count++,Yt=Sd.bind(this),an.addEventListener("load",Yt),an.addEventListener("error",Yt),un?un.parentNode.insertBefore(an,un.nextSibling):(Dt=Dt.nodeType===9?Dt.head:Dt,Dt.insertBefore(an,Dt.firstChild)),Bt.state.loading|=4}}var ju={$$typeof:Ut,Provider:null,Consumer:null,_currentValue:rn,_currentValue2:rn,_threadCount:0};function Yg(Dt,Bt,$t,Yt,an,un,bn,qn,Sr){this.tag=1,this.containerInfo=Dt,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=gr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gr(0),this.hiddenUpdates=gr(null),this.identifierPrefix=Yt,this.onUncaughtError=an,this.onCaughtError=un,this.onRecoverableError=bn,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Sr,this.incompleteTransitions=new Map}function R0(Dt,Bt,$t,Yt,an,un,bn,qn,Sr,Jr,ui,gi){return Dt=new Yg(Dt,Bt,$t,bn,Sr,Jr,ui,gi,qn),Bt=1,un===!0&&(Bt|=24),un=Ks(3,null,null,Bt),Dt.current=un,un.stateNode=Dt,Bt=tc(),Bt.refCount++,Dt.pooledCache=Bt,Bt.refCount++,un.memoizedState={element:Yt,isDehydrated:$t,cache:Bt},pa(un),Dt}function B0(Dt){return Dt?(Dt=Ai,Dt):Ai}function M0(Dt,Bt,$t,Yt,an,un){an=B0(an),Yt.context===null?Yt.context=an:Yt.pendingContext=an,Yt=Js(Bt),Yt.payload={element:$t},un=un===void 0?null:un,un!==null&&(Yt.callback=un),$t=Gr(Dt,Yt,Bt),$t!==null&&(Kl($t,Dt,Bt),Ti($t,Dt,Bt))}function I0(Dt,Bt){if(Dt=Dt.memoizedState,Dt!==null&&Dt.dehydrated!==null){var $t=Dt.retryLane;Dt.retryLane=$t!==0&&$t<Bt?$t:Bt}}function Jf(Dt,Bt){I0(Dt,Bt),(Dt=Dt.alternate)&&I0(Dt,Bt)}function O0(Dt){if(Dt.tag===13||Dt.tag===31){var Bt=Qi(Dt,67108864);Bt!==null&&Kl(Bt,Dt,67108864),Jf(Dt,67108864)}}function P0(Dt){if(Dt.tag===13||Dt.tag===31){var Bt=ac();Bt=ki(Bt);var $t=Qi(Dt,Bt);$t!==null&&Kl($t,Dt,Bt),Jf(Dt,Bt)}}var Rd=!0;function Xg(Dt,Bt,$t,Yt){var an=Zt.T;Zt.T=null;var un=nn.p;try{nn.p=2,eh(Dt,Bt,$t,Yt)}finally{nn.p=un,Zt.T=an}}function Kg(Dt,Bt,$t,Yt){var an=Zt.T;Zt.T=null;var un=nn.p;try{nn.p=8,eh(Dt,Bt,$t,Yt)}finally{nn.p=un,Zt.T=an}}function eh(Dt,Bt,$t,Yt){if(Rd){var an=th(Yt);if(an===null)Uf(Dt,Bt,Yt,Bd,$t),k0(Dt,Yt);else if(Qg(an,Dt,Bt,$t,Yt))Yt.stopPropagation();else if(k0(Dt,Yt),Bt&4&&-1<Zg.indexOf(Dt)){for(;an!==null;){var un=Hs(an);if(un!==null)switch(un.tag){case 3:if(un=un.stateNode,un.current.memoizedState.isDehydrated){var bn=hn(un.pendingLanes);if(bn!==0){var qn=un;for(qn.pendingLanes|=2,qn.entangledLanes|=2;bn;){var Sr=1<<31-Xn(bn);qn.entanglements[1]|=Sr,bn&=~Sr}Fc(un),(So&6)===0&&(hd=Dr()+500,Lu(0))}}break;case 31:case 13:qn=Qi(un,2),qn!==null&&Kl(qn,un,2),gd(),Jf(un,2)}if(un=th(Yt),un===null&&Uf(Dt,Bt,Yt,Bd,$t),un===an)break;an=un}an!==null&&Yt.stopPropagation()}else Uf(Dt,Bt,Yt,null,$t)}}function th(Dt){return Dt=qo(Dt),nh(Dt)}var Bd=null;function nh(Dt){if(Bd=null,Dt=Is(Dt),Dt!==null){var Bt=At(Dt);if(Bt===null)Dt=null;else{var $t=Bt.tag;if($t===13){if(Dt=Ft(Bt),Dt!==null)return Dt;Dt=null}else if($t===31){if(Dt=Ct(Bt),Dt!==null)return Dt;Dt=null}else if($t===3){if(Bt.stateNode.current.memoizedState.isDehydrated)return Bt.tag===3?Bt.stateNode.containerInfo:null;Dt=null}else Bt!==Dt&&(Dt=null)}}return Bd=Dt,null}function L0(Dt){switch(Dt){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ar()){case Qn:return 2;case Cn:return 8;case Bn:case In:return 32;case or:return 268435456;default:return 32}default:return 32}}var rh=!1,Xc=null,Kc=null,Zc=null,Hu=new Map,Wu=new Map,Qc=[],Zg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function k0(Dt,Bt){switch(Dt){case"focusin":case"focusout":Xc=null;break;case"dragenter":case"dragleave":Kc=null;break;case"mouseover":case"mouseout":Zc=null;break;case"pointerover":case"pointerout":Hu.delete(Bt.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wu.delete(Bt.pointerId)}}function Vu(Dt,Bt,$t,Yt,an,un){return Dt===null||Dt.nativeEvent!==un?(Dt={blockedOn:Bt,domEventName:$t,eventSystemFlags:Yt,nativeEvent:un,targetContainers:[an]},Bt!==null&&(Bt=Hs(Bt),Bt!==null&&O0(Bt)),Dt):(Dt.eventSystemFlags|=Yt,Bt=Dt.targetContainers,an!==null&&Bt.indexOf(an)===-1&&Bt.push(an),Dt)}function Qg(Dt,Bt,$t,Yt,an){switch(Bt){case"focusin":return Xc=Vu(Xc,Dt,Bt,$t,Yt,an),!0;case"dragenter":return Kc=Vu(Kc,Dt,Bt,$t,Yt,an),!0;case"mouseover":return Zc=Vu(Zc,Dt,Bt,$t,Yt,an),!0;case"pointerover":var un=an.pointerId;return Hu.set(un,Vu(Hu.get(un)||null,Dt,Bt,$t,Yt,an)),!0;case"gotpointercapture":return un=an.pointerId,Wu.set(un,Vu(Wu.get(un)||null,Dt,Bt,$t,Yt,an)),!0}return!1}function N0(Dt){var Bt=Is(Dt.target);if(Bt!==null){var $t=At(Bt);if($t!==null){if(Bt=$t.tag,Bt===13){if(Bt=Ft($t),Bt!==null){Dt.blockedOn=Bt,ci(Dt.priority,function(){P0($t)});return}}else if(Bt===31){if(Bt=Ct($t),Bt!==null){Dt.blockedOn=Bt,ci(Dt.priority,function(){P0($t)});return}}else if(Bt===3&&$t.stateNode.current.memoizedState.isDehydrated){Dt.blockedOn=$t.tag===3?$t.stateNode.containerInfo:null;return}}}Dt.blockedOn=null}function Md(Dt){if(Dt.blockedOn!==null)return!1;for(var Bt=Dt.targetContainers;0<Bt.length;){var $t=th(Dt.nativeEvent);if($t===null){$t=Dt.nativeEvent;var Yt=new $t.constructor($t.type,$t);al=Yt,$t.target.dispatchEvent(Yt),al=null}else return Bt=Hs($t),Bt!==null&&O0(Bt),Dt.blockedOn=$t,!1;Bt.shift()}return!0}function z0(Dt,Bt,$t){Md(Dt)&&$t.delete(Bt)}function Jg(){rh=!1,Xc!==null&&Md(Xc)&&(Xc=null),Kc!==null&&Md(Kc)&&(Kc=null),Zc!==null&&Md(Zc)&&(Zc=null),Hu.forEach(z0),Wu.forEach(z0)}function Id(Dt,Bt){Dt.blockedOn===Bt&&(Dt.blockedOn=null,rh||(rh=!0,yt.unstable_scheduleCallback(yt.unstable_NormalPriority,Jg)))}var Od=null;function U0(Dt){Od!==Dt&&(Od=Dt,yt.unstable_scheduleCallback(yt.unstable_NormalPriority,function(){Od===Dt&&(Od=null);for(var Bt=0;Bt<Dt.length;Bt+=3){var $t=Dt[Bt],Yt=Dt[Bt+1],an=Dt[Bt+2];if(typeof Yt!="function"){if(nh(Yt||$t)===null)continue;break}var un=Hs($t);un!==null&&(Dt.splice(Bt,3),Bt-=3,ef(un,{pending:!0,data:an,method:$t.method,action:Yt},Yt,an))}}))}function bu(Dt){function Bt(Sr){return Id(Sr,Dt)}Xc!==null&&Id(Xc,Dt),Kc!==null&&Id(Kc,Dt),Zc!==null&&Id(Zc,Dt),Hu.forEach(Bt),Wu.forEach(Bt);for(var $t=0;$t<Qc.length;$t++){var Yt=Qc[$t];Yt.blockedOn===Dt&&(Yt.blockedOn=null)}for(;0<Qc.length&&($t=Qc[0],$t.blockedOn===null);)N0($t),$t.blockedOn===null&&Qc.shift();if($t=(Dt.ownerDocument||Dt).$$reactFormReplay,$t!=null)for(Yt=0;Yt<$t.length;Yt+=3){var an=$t[Yt],un=$t[Yt+1],bn=an[wi]||null;if(typeof un=="function")bn||U0($t);else if(bn){var qn=null;if(un&&un.hasAttribute("formAction")){if(an=un,bn=un[wi]||null)qn=bn.formAction;else if(nh(an)!==null)continue}else qn=bn.action;typeof qn=="function"?$t[Yt+1]=qn:($t.splice(Yt,3),Yt-=3),U0($t)}}}function $0(){function Dt(un){un.canIntercept&&un.info==="react-transition"&&un.intercept({handler:function(){return new Promise(function(bn){return an=bn})},focusReset:"manual",scroll:"manual"})}function Bt(){an!==null&&(an(),an=null),Yt||setTimeout($t,20)}function $t(){if(!Yt&&!navigation.transition){var un=navigation.currentEntry;un&&un.url!=null&&navigation.navigate(un.url,{state:un.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var Yt=!1,an=null;return navigation.addEventListener("navigate",Dt),navigation.addEventListener("navigatesuccess",Bt),navigation.addEventListener("navigateerror",Bt),setTimeout($t,100),function(){Yt=!0,navigation.removeEventListener("navigate",Dt),navigation.removeEventListener("navigatesuccess",Bt),navigation.removeEventListener("navigateerror",Bt),an!==null&&(an(),an=null)}}}function ih(Dt){this._internalRoot=Dt}Pd.prototype.render=ih.prototype.render=function(Dt){var Bt=this._internalRoot;if(Bt===null)throw Error(vt(409));var $t=Bt.current,Yt=ac();M0($t,Yt,Dt,Bt,null,null)},Pd.prototype.unmount=ih.prototype.unmount=function(){var Dt=this._internalRoot;if(Dt!==null){this._internalRoot=null;var Bt=Dt.containerInfo;M0(Dt.current,2,null,Dt,null,null),gd(),Bt[vi]=null}};function Pd(Dt){this._internalRoot=Dt}Pd.prototype.unstable_scheduleHydration=function(Dt){if(Dt){var Bt=_i();Dt={blockedOn:null,target:Dt,priority:Bt};for(var $t=0;$t<Qc.length&&Bt!==0&&Bt<Qc[$t].priority;$t++);Qc.splice($t,0,Dt),$t===0&&N0(Dt)}};var j0=Et.version;if(j0!=="19.2.4")throw Error(vt(527,j0,"19.2.4"));nn.findDOMNode=function(Dt){var Bt=Dt._reactInternals;if(Bt===void 0)throw typeof Dt.render=="function"?Error(vt(188)):(Dt=Object.keys(Dt).join(","),Error(vt(268,Dt)));return Dt=St(Bt),Dt=Dt!==null?Tt(Dt):null,Dt=Dt===null?null:Dt.stateNode,Dt};var em={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Zt,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ld=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ld.isDisabled&&Ld.supportsFiber)try{cr=Ld.inject(em),gn=Ld}catch{}}return reactDomClient_production.createRoot=function(Dt,Bt){if(!bt(Dt))throw Error(vt(299));var $t=!1,Yt="",an=Xh,un=Kh,bn=Zh;return Bt!=null&&(Bt.unstable_strictMode===!0&&($t=!0),Bt.identifierPrefix!==void 0&&(Yt=Bt.identifierPrefix),Bt.onUncaughtError!==void 0&&(an=Bt.onUncaughtError),Bt.onCaughtError!==void 0&&(un=Bt.onCaughtError),Bt.onRecoverableError!==void 0&&(bn=Bt.onRecoverableError)),Bt=R0(Dt,1,!1,null,null,$t,Yt,null,an,un,bn,$0),Dt[vi]=Bt.current,zf(Dt),new ih(Bt)},reactDomClient_production.hydrateRoot=function(Dt,Bt,$t){if(!bt(Dt))throw Error(vt(299));var Yt=!1,an="",un=Xh,bn=Kh,qn=Zh,Sr=null;return $t!=null&&($t.unstable_strictMode===!0&&(Yt=!0),$t.identifierPrefix!==void 0&&(an=$t.identifierPrefix),$t.onUncaughtError!==void 0&&(un=$t.onUncaughtError),$t.onCaughtError!==void 0&&(bn=$t.onCaughtError),$t.onRecoverableError!==void 0&&(qn=$t.onRecoverableError),$t.formState!==void 0&&(Sr=$t.formState)),Bt=R0(Dt,1,!0,Bt,$t??null,Yt,an,Sr,un,bn,qn,$0),Bt.context=B0(null),$t=Bt.current,Yt=ac(),Yt=ki(Yt),an=Js(Yt),an.callback=null,Gr($t,an,Yt),$t=Yt,Bt.current.lanes=$t,ii(Bt,$t),Fc(Bt),Dt[vi]=Bt.current,zf(Dt),new Pd(Bt)},reactDomClient_production.version="19.2.4",reactDomClient_production}var hasRequiredClient;function requireClient(){if(hasRequiredClient)return client.exports;hasRequiredClient=1;function yt(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yt)}catch(Et){console.error(Et)}}return yt(),client.exports=requireReactDomClient_production(),client.exports}var clientExports=requireClient();const ReactDOM$1=getDefaultExportFromCjs(clientExports);var jsxRuntime={exports:{}},reactJsxRuntime_production={};var hasRequiredReactJsxRuntime_production;function requireReactJsxRuntime_production(){if(hasRequiredReactJsxRuntime_production)return reactJsxRuntime_production;hasRequiredReactJsxRuntime_production=1;var yt=Symbol.for("react.transitional.element"),Et=Symbol.for("react.fragment");function xt(vt,bt,At){var Ft=null;if(At!==void 0&&(Ft=""+At),bt.key!==void 0&&(Ft=""+bt.key),"key"in bt){At={};for(var Ct in bt)Ct!=="key"&&(At[Ct]=bt[Ct])}else At=bt;return bt=At.ref,{$$typeof:yt,type:vt,key:Ft,ref:bt!==void 0?bt:null,props:At}}return reactJsxRuntime_production.Fragment=Et,reactJsxRuntime_production.jsx=xt,reactJsxRuntime_production.jsxs=xt,reactJsxRuntime_production}var hasRequiredJsxRuntime;function requireJsxRuntime(){return hasRequiredJsxRuntime||(hasRequiredJsxRuntime=1,jsxRuntime.exports=requireReactJsxRuntime_production()),jsxRuntime.exports}var jsxRuntimeExports=requireJsxRuntime();const toKebabCase=yt=>yt.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),toCamelCase=yt=>yt.replace(/^([A-Z])|[\s-_]+(\w)/g,(Et,xt,vt)=>vt?vt.toUpperCase():xt.toLowerCase()),toPascalCase=yt=>{const Et=toCamelCase(yt);return Et.charAt(0).toUpperCase()+Et.slice(1)},mergeClasses=(...yt)=>yt.filter((Et,xt,vt)=>!!Et&&Et.trim()!==""&&vt.indexOf(Et)===xt).join(" ").trim(),hasA11yProp=yt=>{for(const Et in yt)if(Et.startsWith("aria-")||Et==="role"||Et==="title")return!0};var defaultAttributes={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Icon$1=reactExports.forwardRef(({color:yt="currentColor",size:Et=24,strokeWidth:xt=2,absoluteStrokeWidth:vt,className:bt="",children:At,iconNode:Ft,...Ct},wt)=>reactExports.createElement("svg",{ref:wt,...defaultAttributes,width:Et,height:Et,stroke:yt,strokeWidth:vt?Number(xt)*24/Number(Et):xt,className:mergeClasses("lucide",bt),...!At&&!hasA11yProp(Ct)&&{"aria-hidden":"true"},...Ct},[...Ft.map(([St,Tt])=>reactExports.createElement(St,Tt)),...Array.isArray(At)?At:[At]]));const createLucideIcon=(yt,Et)=>{const xt=reactExports.forwardRef(({className:vt,...bt},At)=>reactExports.createElement(Icon$1,{ref:At,iconNode:Et,className:mergeClasses(`lucide-${toKebabCase(toPascalCase(yt))}`,`lucide-${yt}`,vt),...bt}));return xt.displayName=toPascalCase(yt),xt};const __iconNode$o=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],BookOpen=createLucideIcon("book-open",__iconNode$o);const __iconNode$n=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Camera=createLucideIcon("camera",__iconNode$n);const __iconNode$m=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Check=createLucideIcon("check",__iconNode$m);const __iconNode$l=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ChevronDown=createLucideIcon("chevron-down",__iconNode$l);const __iconNode$k=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ChevronRight=createLucideIcon("chevron-right",__iconNode$k);const __iconNode$j=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ChevronUp=createLucideIcon("chevron-up",__iconNode$j);const __iconNode$i=[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]],Crop=createLucideIcon("crop",__iconNode$i);const __iconNode$h=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Info=createLucideIcon("info",__iconNode$h);const __iconNode$g=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Key=createLucideIcon("key",__iconNode$g);const __iconNode$f=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Lightbulb=createLucideIcon("lightbulb",__iconNode$f);const __iconNode$e=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Maximize2=createLucideIcon("maximize-2",__iconNode$e);const __iconNode$d=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Monitor=createLucideIcon("monitor",__iconNode$d);const __iconNode$c=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Moon=createLucideIcon("moon",__iconNode$c);const __iconNode$b=[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]],Move=createLucideIcon("move",__iconNode$b);const __iconNode$a=[["path",{d:"m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z",key:"irua1i"}],["path",{d:"m5 2 5 5",key:"1lls2c"}],["path",{d:"M2 13h15",key:"1hkzvu"}],["path",{d:"M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z",key:"xk76lq"}]],PaintBucket=createLucideIcon("paint-bucket",__iconNode$a);const __iconNode$9=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Palette=createLucideIcon("palette",__iconNode$9);const __iconNode$8=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],Presentation=createLucideIcon("presentation",__iconNode$8);const __iconNode$7=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],Printer=createLucideIcon("printer",__iconNode$7);const __iconNode$6=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],RotateCcw=createLucideIcon("rotate-ccw",__iconNode$6);const __iconNode$5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Settings=createLucideIcon("settings",__iconNode$5);const __iconNode$4=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Sun=createLucideIcon("sun",__iconNode$4);const __iconNode$3=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],Table=createLucideIcon("table",__iconNode$3);const __iconNode$2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],X$2=createLucideIcon("x",__iconNode$2);const __iconNode$1=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],ZoomIn=createLucideIcon("zoom-in",__iconNode$1);const __iconNode=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],ZoomOut=createLucideIcon("zoom-out",__iconNode),DEFAULT_CONFIG$1={tree:{ySpacing:150,yScaleFactor:1e3,xScalePercent:100,fixedCoordinateWidth:2e3,nodeRadius:{internal:12,leaf:20},edgeColor:[40,40,4,255],edgeWidth:.5,gap:50,labelPadding:{charWidth:50},phyloLabelPosition:"after-tree",labelOffset:10,alignLabels:!0},gene:{height:60,defaultHeight:60,fillColor:[230,230,230,255],tipWidthFactor:.05,tipWidthMode:"fixed",tipWidthFixed:20,strokeWidthFactor:.9,edgeWidth:1,arrowheadHeight:0,prevalenceThreshold:10},genome:{xScalePercent:30},theme:{mode:"light",light:{background:"#ffffff",text:"#222222",treeEdges:[0,0,0,255],phyloLabelFill:[0,0,0,255],hoods:[100,100,100,255],geneFill:[230,230,230,255],rulerBackground:"#ffffff",rulerText:"#222222",rulerTicks:"#666666",buttonBackground:"#ffffff",buttonText:"#222222",buttonBorder:"#cccccc",tooltipBackground:"#ffffff",tooltipText:"#222222",tooltipBorder:"#cccccc",widgetBackground:"#f8f9fa",border:"#dee2e6",textSecondary:"#6c757d",sliderTrack:"#e9ecef"},dark:{background:"#000000",text:"#ffffff",treeEdges:[255,255,255,255],phyloLabelFill:[255,255,255,255],hoods:[200,200,200,255],geneFill:[100,100,100,255],rulerBackground:"#000000",rulerText:"#ffffff",rulerTicks:"#cccccc",buttonBackground:"#333333",buttonText:"#ffffff",buttonBorder:"#555555",tooltipBackground:"#333333",tooltipText:"#ffffff",tooltipBorder:"#555555",widgetBackground:"#212529",border:"#495057",textSecondary:"#adb5bd",sliderTrack:"#495057"}},domain:{edgeWidth:.01,heightFactor:.7},hood:{width:.25,color:[100,100,100,255]},region:{padding:5,fillOpacity:.2,strokeOpacity:.6,strokeWidth:2,colors:{phage:[255,0,0,255],prophage:[255,165,0,255],operon:[0,128,0,255],cluster:[0,0,255,255],island:[255,255,0,255],region:[1,1,1,255],default:[128,128,128,255],crispr:[255,0,0,255]}},layout:{padding:0,geneOffset:0,containerFallback:{minX:0,minY:0,maxX:1e3,maxY:1e3,treeOffset:0,geneOffset:0}},text:{geneLabelSize:12,phyloLabelSize:20,scaleFactors:{gene:5,phylo:5},rulerLabelSize:14},stroke:{lineWidth:.1,fadeAlpha:.1,darkenFactor:.7},ruler:{height:30,tickHeight:10,labelOffset:22,targetTicks:35},scrollbar:{width:32,barWidth:3,minThumbHeight:24,margin:"2%",borderRadius:"0",panPaddingY:50,panPaddingX:500,minZoom:-5,maxZoom:2},proteinLink:{bezierSegments:120,color:[100,0,220,255],colorBy:"source_gene",solidColor:[100,0,220,255],useAlpha:!0,minAlpha:0,maxAlpha:.5,palette:{type:"sequential",name:"Blues",numColors:9,reverse:!1,enabled:!0}},nucleotideLink:{color:[200,200,200,255],colorBy:"solid",solidColor:[200,200,200,255],strandColoring:!0,sameStrandColor:[180,180,180,255],oppositeStrandColor:[220,80,80,255],sameStrandPalette:{type:"sequential",name:"Greys",numColors:9,reverse:!1,enabled:!0},oppositeStrandPalette:{type:"sequential",name:"Reds",numColors:9,reverse:!1,enabled:!0},useAlpha:!0,minAlpha:0,maxAlpha:.5,palette:{type:"sequential",name:"Reds",numColors:9,reverse:!1,enabled:!0}},connectingLines:{width:.5,color:[128,128,128,255]},colorPalettes:{genePalette:{type:"qualitative",name:"RPRlab",numColors:15,reverse:!1,enabled:!0,desaturateByPrevalence:!0},domainPalette:{type:"sequential",name:"Gray",numColors:9,reverse:!0,enabled:!0,alphaRange:[.1,.3]},phyloPalette:{type:"qualitative",name:"RPRlab",numColors:15,reverse:!1,enabled:!0},ncRNAPalette:{type:"qualitative",name:"RPRlab",numColors:15,reverse:!1,enabled:!0},regionPalette:{type:"qualitative",name:"RPRlab",numColors:15,reverse:!1,enabled:!0}},colors:{black:[0,0,0,255],gray:[100,100,100,255],lightGray:[230,230,230,255],darkGray:[85,85,85,255],transparent:[0,0,0,0]},animation:{transitionDuration:"0.1s",hoverTransition:"0.25s"},export:{svg:{minFontSize:0,fontSizeScale:1e3}}},{tree:TREE_CONFIG,gene:GENE_CONFIG,layout:LAYOUT_CONFIG,text:TEXT_CONFIG,stroke:STROKE_CONFIG,ruler:RULER_CONFIG,scrollbar:SCROLLBAR_CONFIG,proteinLink:PROTEIN_LINK_CONFIG,nucleotideLink:NUCLEOTIDE_LINK_CONFIG,colors:COLORS_CONFIG,animation:ANIMATION_CONFIG,export:EXPORT_CONFIG}=DEFAULT_CONFIG$1;function calculateTipWidth(yt,Et){const xt="gene"in Et?Et.gene:Et;if((xt.tipWidthMode||"factor")==="fixed"){const bt=xt.tipWidthFixed??200,At=yt*.5;return Math.min(bt,At)}else{const bt=xt.tipWidthFactor||.05;return yt*bt}}function resolveMode(yt){if(!yt)return"light";if(yt==="system"&&typeof window<"u")try{return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}return yt==="dark"?"dark":"light"}if(typeof window<"u")try{const Et=window.localStorage.getItem("hoodini_theme"),xt=DEFAULT_CONFIG$1.theme?.mode??"light",bt=resolveMode(Et||xt||"light"),At=document.documentElement;bt==="dark"?(At.classList.add("dark"),At.classList.remove("light")):(At.classList.remove("dark"),At.classList.add("light"))}catch{}const STORAGE_KEY="hoodini_theme",ThemeContext$1=reactExports.createContext(null),useTheme=()=>{const yt=reactExports.useContext(ThemeContext$1);return yt||{theme:"light",setTheme:()=>{},resolvedTheme:"light",getThemeColors:()=>({background:"#ffffff",foreground:"#000000",muted:"#f4f4f5",mutedForeground:"#71717a",border:"#e4e4e7",primary:"#18181b",primaryForeground:"#fafafa"})}},ThemeProvider=({children:yt})=>{const Et=DEFAULT_CONFIG$1.theme?.mode??"light",vt=(typeof window<"u"?window.localStorage.getItem(STORAGE_KEY):null)||Et||"light",[bt,At]=reactExports.useState(vt),[Ft,Ct]=reactExports.useState(()=>resolveMode(vt)),wt=(Pt=bt)=>{let Lt=Pt;return Pt==="system"&&typeof window<"u"&&(Lt=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),DEFAULT_CONFIG$1.theme?.[Lt]??{}},St=wt(Ft),Tt=Pt=>{At(Pt);try{window.localStorage.setItem(STORAGE_KEY,Pt)}catch{}try{const Lt=resolveMode(Pt);Ct(Lt);const kt=document.documentElement;Lt==="dark"?(kt.classList.add("dark"),kt.classList.remove("light")):(kt.classList.remove("dark"),kt.classList.add("light"))}catch{}},Rt=()=>{Tt(Ft==="light"?"dark":"light")};return reactExports.useEffect(()=>{const Pt=resolveMode(bt);Ct(Pt);const Lt=document.documentElement;Pt==="dark"?(Lt.classList.add("dark"),Lt.classList.remove("light")):(Lt.classList.remove("dark"),Lt.classList.add("light"));let kt=null;try{kt=new MutationObserver(It=>{for(const Nt of It)if(Nt.type==="attributes"&&Nt.attributeName==="class"){const Ut=Lt.classList.contains("dark"),jt=Ft;Ut&&jt!=="dark"?(Ct("dark"),At("dark")):!Ut&&jt!=="light"&&(Ct("light"),At("light"))}}),kt.observe(Lt,{attributes:!0,attributeFilter:["class"]})}catch{}let Ot,Mt;if(bt==="system"&&typeof window<"u"&&window.matchMedia)try{Ot=window.matchMedia("(prefers-color-scheme: dark)"),Mt=It=>{const Nt=It.matches?"dark":"light";Nt==="dark"?(Lt.classList.add("dark"),Lt.classList.remove("light")):(Lt.classList.remove("dark"),Lt.classList.add("light")),Ct(Nt)},Ot.addEventListener?Ot.addEventListener("change",Mt):Ot.addListener&&Ot.addListener(Mt)}catch{}return()=>{kt&&kt.disconnect(),Ot&&Mt&&(Ot.removeEventListener?Ot.removeEventListener("change",Mt):Ot.removeListener&&Ot.removeListener(Mt))}},[bt]),jsxRuntimeExports.jsx(ThemeContext$1.Provider,{value:{theme:bt,resolvedTheme:Ft,themeColors:St,getThemeColors:Pt=>wt(Pt||Ft),setTheme:Tt,toggleTheme:Rt,isLight:Ft==="light",isDark:Ft==="dark"},children:yt})};function setRef(yt,Et){if(typeof yt=="function")return yt(Et);yt!=null&&(yt.current=Et)}function composeRefs(...yt){return Et=>{let xt=!1;const vt=yt.map(bt=>{const At=setRef(bt,Et);return!xt&&typeof At=="function"&&(xt=!0),At});if(xt)return()=>{for(let bt=0;bt<vt.length;bt++){const At=vt[bt];typeof At=="function"?At():setRef(yt[bt],null)}}}}function useComposedRefs(...yt){return reactExports.useCallback(composeRefs(...yt),yt)}var REACT_LAZY_TYPE=Symbol.for("react.lazy"),use=React$1[" use ".trim().toString()];function isPromiseLike(yt){return typeof yt=="object"&&yt!==null&&"then"in yt}function isLazyComponent(yt){return yt!=null&&typeof yt=="object"&&"$$typeof"in yt&&yt.$$typeof===REACT_LAZY_TYPE&&"_payload"in yt&&isPromiseLike(yt._payload)}function createSlot$c(yt){const Et=createSlotClone$c(yt),xt=reactExports.forwardRef((vt,bt)=>{let{children:At,...Ft}=vt;isLazyComponent(At)&&typeof use=="function"&&(At=use(At._payload));const Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$c);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}var Slot$1=createSlot$c("Slot");function createSlotClone$c(yt){const Et=reactExports.forwardRef((xt,vt)=>{let{children:bt,...At}=xt;if(isLazyComponent(bt)&&typeof use=="function"&&(bt=use(bt._payload)),reactExports.isValidElement(bt)){const Ft=getElementRef$d(bt),Ct=mergeProps$c(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$c=Symbol("radix.slottable");function isSlottable$c(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$c}function mergeProps$c(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$d(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}function r$1(yt){var Et,xt,vt="";if(typeof yt=="string"||typeof yt=="number")vt+=yt;else if(typeof yt=="object")if(Array.isArray(yt)){var bt=yt.length;for(Et=0;Et<bt;Et++)yt[Et]&&(xt=r$1(yt[Et]))&&(vt&&(vt+=" "),vt+=xt)}else for(xt in yt)yt[xt]&&(vt&&(vt+=" "),vt+=xt);return vt}function clsx(){for(var yt,Et,xt=0,vt="",bt=arguments.length;xt<bt;xt++)(yt=arguments[xt])&&(Et=r$1(yt))&&(vt&&(vt+=" "),vt+=Et);return vt}const falsyToString=yt=>typeof yt=="boolean"?`${yt}`:yt===0?"0":yt,cx$1=clsx,cva=(yt,Et)=>xt=>{var vt;if(Et?.variants==null)return cx$1(yt,xt?.class,xt?.className);const{variants:bt,defaultVariants:At}=Et,Ft=Object.keys(bt).map(St=>{const Tt=xt?.[St],Rt=At?.[St];if(Tt===null)return null;const Pt=falsyToString(Tt)||falsyToString(Rt);return bt[St][Pt]}),Ct=xt&&Object.entries(xt).reduce((St,Tt)=>{let[Rt,Pt]=Tt;return Pt===void 0||(St[Rt]=Pt),St},{}),wt=Et==null||(vt=Et.compoundVariants)===null||vt===void 0?void 0:vt.reduce((St,Tt)=>{let{class:Rt,className:Pt,...Lt}=Tt;return Object.entries(Lt).every(kt=>{let[Ot,Mt]=kt;return Array.isArray(Mt)?Mt.includes({...At,...Ct}[Ot]):{...At,...Ct}[Ot]===Mt})?[...St,Rt,Pt]:St},[]);return cx$1(yt,Ft,wt,xt?.class,xt?.className)},MOBILE_BREAKPOINT=768;function useIsMobile(){const[yt,Et]=reactExports.useState(void 0);return reactExports.useEffect(()=>{const xt=window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT-1}px)`),vt=()=>{Et(window.innerWidth<MOBILE_BREAKPOINT)};return xt.addEventListener("change",vt),Et(window.innerWidth<MOBILE_BREAKPOINT),()=>xt.removeEventListener("change",vt)},[]),!!yt}const concatArrays=(yt,Et)=>{const xt=new Array(yt.length+Et.length);for(let vt=0;vt<yt.length;vt++)xt[vt]=yt[vt];for(let vt=0;vt<Et.length;vt++)xt[yt.length+vt]=Et[vt];return xt},createClassValidatorObject=(yt,Et)=>({classGroupId:yt,validator:Et}),createClassPartObject=(yt=new Map,Et=null,xt)=>({nextPart:yt,validators:Et,classGroupId:xt}),CLASS_PART_SEPARATOR="-",EMPTY_CONFLICTS=[],ARBITRARY_PROPERTY_PREFIX="arbitrary..",createClassGroupUtils=yt=>{const Et=createClassMap(yt),{conflictingClassGroups:xt,conflictingClassGroupModifiers:vt}=yt;return{getClassGroupId:Ft=>{if(Ft.startsWith("[")&&Ft.endsWith("]"))return getGroupIdForArbitraryProperty(Ft);const Ct=Ft.split(CLASS_PART_SEPARATOR),wt=Ct[0]===""&&Ct.length>1?1:0;return getGroupRecursive(Ct,wt,Et)},getConflictingClassGroupIds:(Ft,Ct)=>{if(Ct){const wt=vt[Ft],St=xt[Ft];return wt?St?concatArrays(St,wt):wt:St||EMPTY_CONFLICTS}return xt[Ft]||EMPTY_CONFLICTS}}},getGroupRecursive=(yt,Et,xt)=>{if(yt.length-Et===0)return xt.classGroupId;const bt=yt[Et],At=xt.nextPart.get(bt);if(At){const St=getGroupRecursive(yt,Et+1,At);if(St)return St}const Ft=xt.validators;if(Ft===null)return;const Ct=Et===0?yt.join(CLASS_PART_SEPARATOR):yt.slice(Et).join(CLASS_PART_SEPARATOR),wt=Ft.length;for(let St=0;St<wt;St++){const Tt=Ft[St];if(Tt.validator(Ct))return Tt.classGroupId}},getGroupIdForArbitraryProperty=yt=>yt.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const Et=yt.slice(1,-1),xt=Et.indexOf(":"),vt=Et.slice(0,xt);return vt?ARBITRARY_PROPERTY_PREFIX+vt:void 0})(),createClassMap=yt=>{const{theme:Et,classGroups:xt}=yt;return processClassGroups(xt,Et)},processClassGroups=(yt,Et)=>{const xt=createClassPartObject();for(const vt in yt){const bt=yt[vt];processClassesRecursively(bt,xt,vt,Et)}return xt},processClassesRecursively=(yt,Et,xt,vt)=>{const bt=yt.length;for(let At=0;At<bt;At++){const Ft=yt[At];processClassDefinition(Ft,Et,xt,vt)}},processClassDefinition=(yt,Et,xt,vt)=>{if(typeof yt=="string"){processStringDefinition(yt,Et,xt);return}if(typeof yt=="function"){processFunctionDefinition(yt,Et,xt,vt);return}processObjectDefinition(yt,Et,xt,vt)},processStringDefinition=(yt,Et,xt)=>{const vt=yt===""?Et:getPart(Et,yt);vt.classGroupId=xt},processFunctionDefinition=(yt,Et,xt,vt)=>{if(isThemeGetter(yt)){processClassesRecursively(yt(vt),Et,xt,vt);return}Et.validators===null&&(Et.validators=[]),Et.validators.push(createClassValidatorObject(xt,yt))},processObjectDefinition=(yt,Et,xt,vt)=>{const bt=Object.entries(yt),At=bt.length;for(let Ft=0;Ft<At;Ft++){const[Ct,wt]=bt[Ft];processClassesRecursively(wt,getPart(Et,Ct),xt,vt)}},getPart=(yt,Et)=>{let xt=yt;const vt=Et.split(CLASS_PART_SEPARATOR),bt=vt.length;for(let At=0;At<bt;At++){const Ft=vt[At];let Ct=xt.nextPart.get(Ft);Ct||(Ct=createClassPartObject(),xt.nextPart.set(Ft,Ct)),xt=Ct}return xt},isThemeGetter=yt=>"isThemeGetter"in yt&&yt.isThemeGetter===!0,createLruCache=yt=>{if(yt<1)return{get:()=>{},set:()=>{}};let Et=0,xt=Object.create(null),vt=Object.create(null);const bt=(At,Ft)=>{xt[At]=Ft,Et++,Et>yt&&(Et=0,vt=xt,xt=Object.create(null))};return{get(At){let Ft=xt[At];if(Ft!==void 0)return Ft;if((Ft=vt[At])!==void 0)return bt(At,Ft),Ft},set(At,Ft){At in xt?xt[At]=Ft:bt(At,Ft)}}},IMPORTANT_MODIFIER="!",MODIFIER_SEPARATOR=":",EMPTY_MODIFIERS=[],createResultObject=(yt,Et,xt,vt,bt)=>({modifiers:yt,hasImportantModifier:Et,baseClassName:xt,maybePostfixModifierPosition:vt,isExternal:bt}),createParseClassName=yt=>{const{prefix:Et,experimentalParseClassName:xt}=yt;let vt=bt=>{const At=[];let Ft=0,Ct=0,wt=0,St;const Tt=bt.length;for(let Ot=0;Ot<Tt;Ot++){const Mt=bt[Ot];if(Ft===0&&Ct===0){if(Mt===MODIFIER_SEPARATOR){At.push(bt.slice(wt,Ot)),wt=Ot+1;continue}if(Mt==="/"){St=Ot;continue}}Mt==="["?Ft++:Mt==="]"?Ft--:Mt==="("?Ct++:Mt===")"&&Ct--}const Rt=At.length===0?bt:bt.slice(wt);let Pt=Rt,Lt=!1;Rt.endsWith(IMPORTANT_MODIFIER)?(Pt=Rt.slice(0,-1),Lt=!0):Rt.startsWith(IMPORTANT_MODIFIER)&&(Pt=Rt.slice(1),Lt=!0);const kt=St&&St>wt?St-wt:void 0;return createResultObject(At,Lt,Pt,kt)};if(Et){const bt=Et+MODIFIER_SEPARATOR,At=vt;vt=Ft=>Ft.startsWith(bt)?At(Ft.slice(bt.length)):createResultObject(EMPTY_MODIFIERS,!1,Ft,void 0,!0)}if(xt){const bt=vt;vt=At=>xt({className:At,parseClassName:bt})}return vt},createSortModifiers=yt=>{const Et=new Map;return yt.orderSensitiveModifiers.forEach((xt,vt)=>{Et.set(xt,1e6+vt)}),xt=>{const vt=[];let bt=[];for(let At=0;At<xt.length;At++){const Ft=xt[At],Ct=Ft[0]==="[",wt=Et.has(Ft);Ct||wt?(bt.length>0&&(bt.sort(),vt.push(...bt),bt=[]),vt.push(Ft)):bt.push(Ft)}return bt.length>0&&(bt.sort(),vt.push(...bt)),vt}},createConfigUtils=yt=>({cache:createLruCache(yt.cacheSize),parseClassName:createParseClassName(yt),sortModifiers:createSortModifiers(yt),...createClassGroupUtils(yt)}),SPLIT_CLASSES_REGEX=/\s+/,mergeClassList=(yt,Et)=>{const{parseClassName:xt,getClassGroupId:vt,getConflictingClassGroupIds:bt,sortModifiers:At}=Et,Ft=[],Ct=yt.trim().split(SPLIT_CLASSES_REGEX);let wt="";for(let St=Ct.length-1;St>=0;St-=1){const Tt=Ct[St],{isExternal:Rt,modifiers:Pt,hasImportantModifier:Lt,baseClassName:kt,maybePostfixModifierPosition:Ot}=xt(Tt);if(Rt){wt=Tt+(wt.length>0?" "+wt:wt);continue}let Mt=!!Ot,It=vt(Mt?kt.substring(0,Ot):kt);if(!It){if(!Mt){wt=Tt+(wt.length>0?" "+wt:wt);continue}if(It=vt(kt),!It){wt=Tt+(wt.length>0?" "+wt:wt);continue}Mt=!1}const Nt=Pt.length===0?"":Pt.length===1?Pt[0]:At(Pt).join(":"),Ut=Lt?Nt+IMPORTANT_MODIFIER:Nt,jt=Ut+It;if(Ft.indexOf(jt)>-1)continue;Ft.push(jt);const Vt=bt(It,Mt);for(let zt=0;zt<Vt.length;++zt){const Ht=Vt[zt];Ft.push(Ut+Ht)}wt=Tt+(wt.length>0?" "+wt:wt)}return wt},twJoin=(...yt)=>{let Et=0,xt,vt,bt="";for(;Et<yt.length;)(xt=yt[Et++])&&(vt=toValue(xt))&&(bt&&(bt+=" "),bt+=vt);return bt},toValue=yt=>{if(typeof yt=="string")return yt;let Et,xt="";for(let vt=0;vt<yt.length;vt++)yt[vt]&&(Et=toValue(yt[vt]))&&(xt&&(xt+=" "),xt+=Et);return xt},createTailwindMerge=(yt,...Et)=>{let xt,vt,bt,At;const Ft=wt=>{const St=Et.reduce((Tt,Rt)=>Rt(Tt),yt());return xt=createConfigUtils(St),vt=xt.cache.get,bt=xt.cache.set,At=Ct,Ct(wt)},Ct=wt=>{const St=vt(wt);if(St)return St;const Tt=mergeClassList(wt,xt);return bt(wt,Tt),Tt};return At=Ft,(...wt)=>At(twJoin(...wt))},fallbackThemeArr=[],fromTheme=yt=>{const Et=xt=>xt[yt]||fallbackThemeArr;return Et.isThemeGetter=!0,Et},arbitraryValueRegex=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,arbitraryVariableRegex=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fractionRegex=/^\d+\/\d+$/,tshirtUnitRegex=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lengthUnitRegex=/\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$/,colorFunctionRegex=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,shadowRegex=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,imageRegex=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,isFraction=yt=>fractionRegex.test(yt),isNumber=yt=>!!yt&&!Number.isNaN(Number(yt)),isInteger=yt=>!!yt&&Number.isInteger(Number(yt)),isPercent=yt=>yt.endsWith("%")&&isNumber(yt.slice(0,-1)),isTshirtSize=yt=>tshirtUnitRegex.test(yt),isAny=()=>!0,isLengthOnly=yt=>lengthUnitRegex.test(yt)&&!colorFunctionRegex.test(yt),isNever=()=>!1,isShadow=yt=>shadowRegex.test(yt),isImage=yt=>imageRegex.test(yt),isAnyNonArbitrary=yt=>!isArbitraryValue(yt)&&!isArbitraryVariable(yt),isArbitrarySize=yt=>getIsArbitraryValue(yt,isLabelSize,isNever),isArbitraryValue=yt=>arbitraryValueRegex.test(yt),isArbitraryLength=yt=>getIsArbitraryValue(yt,isLabelLength,isLengthOnly),isArbitraryNumber=yt=>getIsArbitraryValue(yt,isLabelNumber,isNumber),isArbitraryPosition=yt=>getIsArbitraryValue(yt,isLabelPosition,isNever),isArbitraryImage=yt=>getIsArbitraryValue(yt,isLabelImage,isImage),isArbitraryShadow=yt=>getIsArbitraryValue(yt,isLabelShadow,isShadow),isArbitraryVariable=yt=>arbitraryVariableRegex.test(yt),isArbitraryVariableLength=yt=>getIsArbitraryVariable(yt,isLabelLength),isArbitraryVariableFamilyName=yt=>getIsArbitraryVariable(yt,isLabelFamilyName),isArbitraryVariablePosition=yt=>getIsArbitraryVariable(yt,isLabelPosition),isArbitraryVariableSize=yt=>getIsArbitraryVariable(yt,isLabelSize),isArbitraryVariableImage=yt=>getIsArbitraryVariable(yt,isLabelImage),isArbitraryVariableShadow=yt=>getIsArbitraryVariable(yt,isLabelShadow,!0),getIsArbitraryValue=(yt,Et,xt)=>{const vt=arbitraryValueRegex.exec(yt);return vt?vt[1]?Et(vt[1]):xt(vt[2]):!1},getIsArbitraryVariable=(yt,Et,xt=!1)=>{const vt=arbitraryVariableRegex.exec(yt);return vt?vt[1]?Et(vt[1]):xt:!1},isLabelPosition=yt=>yt==="position"||yt==="percentage",isLabelImage=yt=>yt==="image"||yt==="url",isLabelSize=yt=>yt==="length"||yt==="size"||yt==="bg-size",isLabelLength=yt=>yt==="length",isLabelNumber=yt=>yt==="number",isLabelFamilyName=yt=>yt==="family-name",isLabelShadow=yt=>yt==="shadow",getDefaultConfig=()=>{const yt=fromTheme("color"),Et=fromTheme("font"),xt=fromTheme("text"),vt=fromTheme("font-weight"),bt=fromTheme("tracking"),At=fromTheme("leading"),Ft=fromTheme("breakpoint"),Ct=fromTheme("container"),wt=fromTheme("spacing"),St=fromTheme("radius"),Tt=fromTheme("shadow"),Rt=fromTheme("inset-shadow"),Pt=fromTheme("text-shadow"),Lt=fromTheme("drop-shadow"),kt=fromTheme("blur"),Ot=fromTheme("perspective"),Mt=fromTheme("aspect"),It=fromTheme("ease"),Nt=fromTheme("animate"),Ut=()=>["auto","avoid","all","avoid-page","page","left","right","column"],jt=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Vt=()=>[...jt(),isArbitraryVariable,isArbitraryValue],zt=()=>["auto","hidden","clip","visible","scroll"],Ht=()=>["auto","contain","none"],Wt=()=>[isArbitraryVariable,isArbitraryValue,wt],Gt=()=>[isFraction,"full","auto",...Wt()],qt=()=>[isInteger,"none","subgrid",isArbitraryVariable,isArbitraryValue],Xt=()=>["auto",{span:["full",isInteger,isArbitraryVariable,isArbitraryValue]},isInteger,isArbitraryVariable,isArbitraryValue],Kt=()=>[isInteger,"auto",isArbitraryVariable,isArbitraryValue],Jt=()=>["auto","min","max","fr",isArbitraryVariable,isArbitraryValue],tn=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],sn=()=>["start","end","center","stretch","center-safe","end-safe"],Zt=()=>["auto",...Wt()],nn=()=>[isFraction,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Wt()],rn=()=>[yt,isArbitraryVariable,isArbitraryValue],on=()=>[...jt(),isArbitraryVariablePosition,isArbitraryPosition,{position:[isArbitraryVariable,isArbitraryValue]}],ln=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Qt=()=>["auto","cover","contain",isArbitraryVariableSize,isArbitrarySize,{size:[isArbitraryVariable,isArbitraryValue]}],fn=()=>[isPercent,isArbitraryVariableLength,isArbitraryLength],pn=()=>["","none","full",St,isArbitraryVariable,isArbitraryValue],mn=()=>["",isNumber,isArbitraryVariableLength,isArbitraryLength],vn=()=>["solid","dashed","dotted","double"],yn=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xn=()=>[isNumber,isPercent,isArbitraryVariablePosition,isArbitraryPosition],Mn=()=>["","none",kt,isArbitraryVariable,isArbitraryValue],$n=()=>["none",isNumber,isArbitraryVariable,isArbitraryValue],Rn=()=>["none",isNumber,isArbitraryVariable,isArbitraryValue],Tn=()=>[isNumber,isArbitraryVariable,isArbitraryValue],ir=()=>[isFraction,"full",...Wt()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[isTshirtSize],breakpoint:[isTshirtSize],color:[isAny],container:[isTshirtSize],"drop-shadow":[isTshirtSize],ease:["in","out","in-out"],font:[isAnyNonArbitrary],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[isTshirtSize],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[isTshirtSize],shadow:[isTshirtSize],spacing:["px",isNumber],text:[isTshirtSize],"text-shadow":[isTshirtSize],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",isFraction,isArbitraryValue,isArbitraryVariable,Mt]}],container:["container"],columns:[{columns:[isNumber,isArbitraryValue,isArbitraryVariable,Ct]}],"break-after":[{"break-after":Ut()}],"break-before":[{"break-before":Ut()}],"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:Vt()}],overflow:[{overflow:zt()}],"overflow-x":[{"overflow-x":zt()}],"overflow-y":[{"overflow-y":zt()}],overscroll:[{overscroll:Ht()}],"overscroll-x":[{"overscroll-x":Ht()}],"overscroll-y":[{"overscroll-y":Ht()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Gt()}],"inset-x":[{"inset-x":Gt()}],"inset-y":[{"inset-y":Gt()}],start:[{start:Gt()}],end:[{end:Gt()}],top:[{top:Gt()}],right:[{right:Gt()}],bottom:[{bottom:Gt()}],left:[{left:Gt()}],visibility:["visible","invisible","collapse"],z:[{z:[isInteger,"auto",isArbitraryVariable,isArbitraryValue]}],basis:[{basis:[isFraction,"full","auto",Ct,...Wt()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[isNumber,isFraction,"auto","initial","none",isArbitraryValue]}],grow:[{grow:["",isNumber,isArbitraryVariable,isArbitraryValue]}],shrink:[{shrink:["",isNumber,isArbitraryVariable,isArbitraryValue]}],order:[{order:[isInteger,"first","last","none",isArbitraryVariable,isArbitraryValue]}],"grid-cols":[{"grid-cols":qt()}],"col-start-end":[{col:Xt()}],"col-start":[{"col-start":Kt()}],"col-end":[{"col-end":Kt()}],"grid-rows":[{"grid-rows":qt()}],"row-start-end":[{row:Xt()}],"row-start":[{"row-start":Kt()}],"row-end":[{"row-end":Kt()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Jt()}],"auto-rows":[{"auto-rows":Jt()}],gap:[{gap:Wt()}],"gap-x":[{"gap-x":Wt()}],"gap-y":[{"gap-y":Wt()}],"justify-content":[{justify:[...tn(),"normal"]}],"justify-items":[{"justify-items":[...sn(),"normal"]}],"justify-self":[{"justify-self":["auto",...sn()]}],"align-content":[{content:["normal",...tn()]}],"align-items":[{items:[...sn(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...sn(),{baseline:["","last"]}]}],"place-content":[{"place-content":tn()}],"place-items":[{"place-items":[...sn(),"baseline"]}],"place-self":[{"place-self":["auto",...sn()]}],p:[{p:Wt()}],px:[{px:Wt()}],py:[{py:Wt()}],ps:[{ps:Wt()}],pe:[{pe:Wt()}],pt:[{pt:Wt()}],pr:[{pr:Wt()}],pb:[{pb:Wt()}],pl:[{pl:Wt()}],m:[{m:Zt()}],mx:[{mx:Zt()}],my:[{my:Zt()}],ms:[{ms:Zt()}],me:[{me:Zt()}],mt:[{mt:Zt()}],mr:[{mr:Zt()}],mb:[{mb:Zt()}],ml:[{ml:Zt()}],"space-x":[{"space-x":Wt()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Wt()}],"space-y-reverse":["space-y-reverse"],size:[{size:nn()}],w:[{w:[Ct,"screen",...nn()]}],"min-w":[{"min-w":[Ct,"screen","none",...nn()]}],"max-w":[{"max-w":[Ct,"screen","none","prose",{screen:[Ft]},...nn()]}],h:[{h:["screen","lh",...nn()]}],"min-h":[{"min-h":["screen","lh","none",...nn()]}],"max-h":[{"max-h":["screen","lh",...nn()]}],"font-size":[{text:["base",xt,isArbitraryVariableLength,isArbitraryLength]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[vt,isArbitraryVariable,isArbitraryNumber]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",isPercent,isArbitraryValue]}],"font-family":[{font:[isArbitraryVariableFamilyName,isArbitraryValue,Et]}],"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:[bt,isArbitraryVariable,isArbitraryValue]}],"line-clamp":[{"line-clamp":[isNumber,"none",isArbitraryVariable,isArbitraryNumber]}],leading:[{leading:[At,...Wt()]}],"list-image":[{"list-image":["none",isArbitraryVariable,isArbitraryValue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",isArbitraryVariable,isArbitraryValue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:rn()}],"text-color":[{text:rn()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...vn(),"wavy"]}],"text-decoration-thickness":[{decoration:[isNumber,"from-font","auto",isArbitraryVariable,isArbitraryLength]}],"text-decoration-color":[{decoration:rn()}],"underline-offset":[{"underline-offset":[isNumber,"auto",isArbitraryVariable,isArbitraryValue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Wt()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",isArbitraryVariable,isArbitraryValue]}],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",isArbitraryVariable,isArbitraryValue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:on()}],"bg-repeat":[{bg:ln()}],"bg-size":[{bg:Qt()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},isInteger,isArbitraryVariable,isArbitraryValue],radial:["",isArbitraryVariable,isArbitraryValue],conic:[isInteger,isArbitraryVariable,isArbitraryValue]},isArbitraryVariableImage,isArbitraryImage]}],"bg-color":[{bg:rn()}],"gradient-from-pos":[{from:fn()}],"gradient-via-pos":[{via:fn()}],"gradient-to-pos":[{to:fn()}],"gradient-from":[{from:rn()}],"gradient-via":[{via:rn()}],"gradient-to":[{to:rn()}],rounded:[{rounded:pn()}],"rounded-s":[{"rounded-s":pn()}],"rounded-e":[{"rounded-e":pn()}],"rounded-t":[{"rounded-t":pn()}],"rounded-r":[{"rounded-r":pn()}],"rounded-b":[{"rounded-b":pn()}],"rounded-l":[{"rounded-l":pn()}],"rounded-ss":[{"rounded-ss":pn()}],"rounded-se":[{"rounded-se":pn()}],"rounded-ee":[{"rounded-ee":pn()}],"rounded-es":[{"rounded-es":pn()}],"rounded-tl":[{"rounded-tl":pn()}],"rounded-tr":[{"rounded-tr":pn()}],"rounded-br":[{"rounded-br":pn()}],"rounded-bl":[{"rounded-bl":pn()}],"border-w":[{border:mn()}],"border-w-x":[{"border-x":mn()}],"border-w-y":[{"border-y":mn()}],"border-w-s":[{"border-s":mn()}],"border-w-e":[{"border-e":mn()}],"border-w-t":[{"border-t":mn()}],"border-w-r":[{"border-r":mn()}],"border-w-b":[{"border-b":mn()}],"border-w-l":[{"border-l":mn()}],"divide-x":[{"divide-x":mn()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":mn()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...vn(),"hidden","none"]}],"divide-style":[{divide:[...vn(),"hidden","none"]}],"border-color":[{border:rn()}],"border-color-x":[{"border-x":rn()}],"border-color-y":[{"border-y":rn()}],"border-color-s":[{"border-s":rn()}],"border-color-e":[{"border-e":rn()}],"border-color-t":[{"border-t":rn()}],"border-color-r":[{"border-r":rn()}],"border-color-b":[{"border-b":rn()}],"border-color-l":[{"border-l":rn()}],"divide-color":[{divide:rn()}],"outline-style":[{outline:[...vn(),"none","hidden"]}],"outline-offset":[{"outline-offset":[isNumber,isArbitraryVariable,isArbitraryValue]}],"outline-w":[{outline:["",isNumber,isArbitraryVariableLength,isArbitraryLength]}],"outline-color":[{outline:rn()}],shadow:[{shadow:["","none",Tt,isArbitraryVariableShadow,isArbitraryShadow]}],"shadow-color":[{shadow:rn()}],"inset-shadow":[{"inset-shadow":["none",Rt,isArbitraryVariableShadow,isArbitraryShadow]}],"inset-shadow-color":[{"inset-shadow":rn()}],"ring-w":[{ring:mn()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:rn()}],"ring-offset-w":[{"ring-offset":[isNumber,isArbitraryLength]}],"ring-offset-color":[{"ring-offset":rn()}],"inset-ring-w":[{"inset-ring":mn()}],"inset-ring-color":[{"inset-ring":rn()}],"text-shadow":[{"text-shadow":["none",Pt,isArbitraryVariableShadow,isArbitraryShadow]}],"text-shadow-color":[{"text-shadow":rn()}],opacity:[{opacity:[isNumber,isArbitraryVariable,isArbitraryValue]}],"mix-blend":[{"mix-blend":[...yn(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":yn()}],"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":[isNumber]}],"mask-image-linear-from-pos":[{"mask-linear-from":xn()}],"mask-image-linear-to-pos":[{"mask-linear-to":xn()}],"mask-image-linear-from-color":[{"mask-linear-from":rn()}],"mask-image-linear-to-color":[{"mask-linear-to":rn()}],"mask-image-t-from-pos":[{"mask-t-from":xn()}],"mask-image-t-to-pos":[{"mask-t-to":xn()}],"mask-image-t-from-color":[{"mask-t-from":rn()}],"mask-image-t-to-color":[{"mask-t-to":rn()}],"mask-image-r-from-pos":[{"mask-r-from":xn()}],"mask-image-r-to-pos":[{"mask-r-to":xn()}],"mask-image-r-from-color":[{"mask-r-from":rn()}],"mask-image-r-to-color":[{"mask-r-to":rn()}],"mask-image-b-from-pos":[{"mask-b-from":xn()}],"mask-image-b-to-pos":[{"mask-b-to":xn()}],"mask-image-b-from-color":[{"mask-b-from":rn()}],"mask-image-b-to-color":[{"mask-b-to":rn()}],"mask-image-l-from-pos":[{"mask-l-from":xn()}],"mask-image-l-to-pos":[{"mask-l-to":xn()}],"mask-image-l-from-color":[{"mask-l-from":rn()}],"mask-image-l-to-color":[{"mask-l-to":rn()}],"mask-image-x-from-pos":[{"mask-x-from":xn()}],"mask-image-x-to-pos":[{"mask-x-to":xn()}],"mask-image-x-from-color":[{"mask-x-from":rn()}],"mask-image-x-to-color":[{"mask-x-to":rn()}],"mask-image-y-from-pos":[{"mask-y-from":xn()}],"mask-image-y-to-pos":[{"mask-y-to":xn()}],"mask-image-y-from-color":[{"mask-y-from":rn()}],"mask-image-y-to-color":[{"mask-y-to":rn()}],"mask-image-radial":[{"mask-radial":[isArbitraryVariable,isArbitraryValue]}],"mask-image-radial-from-pos":[{"mask-radial-from":xn()}],"mask-image-radial-to-pos":[{"mask-radial-to":xn()}],"mask-image-radial-from-color":[{"mask-radial-from":rn()}],"mask-image-radial-to-color":[{"mask-radial-to":rn()}],"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":jt()}],"mask-image-conic-pos":[{"mask-conic":[isNumber]}],"mask-image-conic-from-pos":[{"mask-conic-from":xn()}],"mask-image-conic-to-pos":[{"mask-conic-to":xn()}],"mask-image-conic-from-color":[{"mask-conic-from":rn()}],"mask-image-conic-to-color":[{"mask-conic-to":rn()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:on()}],"mask-repeat":[{mask:ln()}],"mask-size":[{mask:Qt()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",isArbitraryVariable,isArbitraryValue]}],filter:[{filter:["","none",isArbitraryVariable,isArbitraryValue]}],blur:[{blur:Mn()}],brightness:[{brightness:[isNumber,isArbitraryVariable,isArbitraryValue]}],contrast:[{contrast:[isNumber,isArbitraryVariable,isArbitraryValue]}],"drop-shadow":[{"drop-shadow":["","none",Lt,isArbitraryVariableShadow,isArbitraryShadow]}],"drop-shadow-color":[{"drop-shadow":rn()}],grayscale:[{grayscale:["",isNumber,isArbitraryVariable,isArbitraryValue]}],"hue-rotate":[{"hue-rotate":[isNumber,isArbitraryVariable,isArbitraryValue]}],invert:[{invert:["",isNumber,isArbitraryVariable,isArbitraryValue]}],saturate:[{saturate:[isNumber,isArbitraryVariable,isArbitraryValue]}],sepia:[{sepia:["",isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-filter":[{"backdrop-filter":["","none",isArbitraryVariable,isArbitraryValue]}],"backdrop-blur":[{"backdrop-blur":Mn()}],"backdrop-brightness":[{"backdrop-brightness":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-contrast":[{"backdrop-contrast":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-invert":[{"backdrop-invert":["",isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-opacity":[{"backdrop-opacity":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-saturate":[{"backdrop-saturate":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-sepia":[{"backdrop-sepia":["",isNumber,isArbitraryVariable,isArbitraryValue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Wt()}],"border-spacing-x":[{"border-spacing-x":Wt()}],"border-spacing-y":[{"border-spacing-y":Wt()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",isArbitraryVariable,isArbitraryValue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[isNumber,"initial",isArbitraryVariable,isArbitraryValue]}],ease:[{ease:["linear","initial",It,isArbitraryVariable,isArbitraryValue]}],delay:[{delay:[isNumber,isArbitraryVariable,isArbitraryValue]}],animate:[{animate:["none",Nt,isArbitraryVariable,isArbitraryValue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[Ot,isArbitraryVariable,isArbitraryValue]}],"perspective-origin":[{"perspective-origin":Vt()}],rotate:[{rotate:$n()}],"rotate-x":[{"rotate-x":$n()}],"rotate-y":[{"rotate-y":$n()}],"rotate-z":[{"rotate-z":$n()}],scale:[{scale:Rn()}],"scale-x":[{"scale-x":Rn()}],"scale-y":[{"scale-y":Rn()}],"scale-z":[{"scale-z":Rn()}],"scale-3d":["scale-3d"],skew:[{skew:Tn()}],"skew-x":[{"skew-x":Tn()}],"skew-y":[{"skew-y":Tn()}],transform:[{transform:[isArbitraryVariable,isArbitraryValue,"","none","gpu","cpu"]}],"transform-origin":[{origin:Vt()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ir()}],"translate-x":[{"translate-x":ir()}],"translate-y":[{"translate-y":ir()}],"translate-z":[{"translate-z":ir()}],"translate-none":["translate-none"],accent:[{accent:rn()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:rn()}],"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",isArbitraryVariable,isArbitraryValue]}],"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":Wt()}],"scroll-mx":[{"scroll-mx":Wt()}],"scroll-my":[{"scroll-my":Wt()}],"scroll-ms":[{"scroll-ms":Wt()}],"scroll-me":[{"scroll-me":Wt()}],"scroll-mt":[{"scroll-mt":Wt()}],"scroll-mr":[{"scroll-mr":Wt()}],"scroll-mb":[{"scroll-mb":Wt()}],"scroll-ml":[{"scroll-ml":Wt()}],"scroll-p":[{"scroll-p":Wt()}],"scroll-px":[{"scroll-px":Wt()}],"scroll-py":[{"scroll-py":Wt()}],"scroll-ps":[{"scroll-ps":Wt()}],"scroll-pe":[{"scroll-pe":Wt()}],"scroll-pt":[{"scroll-pt":Wt()}],"scroll-pr":[{"scroll-pr":Wt()}],"scroll-pb":[{"scroll-pb":Wt()}],"scroll-pl":[{"scroll-pl":Wt()}],"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",isArbitraryVariable,isArbitraryValue]}],fill:[{fill:["none",...rn()]}],"stroke-w":[{stroke:[isNumber,isArbitraryVariableLength,isArbitraryLength,isArbitraryNumber]}],stroke:[{stroke:["none",...rn()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],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-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},twMerge=createTailwindMerge(getDefaultConfig);function cn(...yt){return twMerge(clsx(yt))}const buttonVariants=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Button({className:yt,variant:Et,size:xt,asChild:vt=!1,...bt}){const At=vt?Slot$1:"button";return jsxRuntimeExports.jsx(At,{"data-slot":"button",className:cn(buttonVariants({variant:Et,size:xt,className:yt})),...bt})}function Input$2({className:yt,type:Et,...xt}){return jsxRuntimeExports.jsx("input",{type:Et,"data-slot":"input",className:cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",yt),...xt})}var reactDomExports=requireReactDom();const ReactDOM=getDefaultExportFromCjs(reactDomExports);var NODES$b=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$b=NODES$b.reduce((yt,Et)=>{const xt=createSlot$c(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),NAME$4="Separator",DEFAULT_ORIENTATION="horizontal",ORIENTATIONS=["horizontal","vertical"],Separator$1=reactExports.forwardRef((yt,Et)=>{const{decorative:xt,orientation:vt=DEFAULT_ORIENTATION,...bt}=yt,At=isValidOrientation(vt)?vt:DEFAULT_ORIENTATION,Ct=xt?{role:"none"}:{"aria-orientation":At==="vertical"?At:void 0,role:"separator"};return jsxRuntimeExports.jsx(Primitive$b.div,{"data-orientation":At,...Ct,...bt,ref:Et})});Separator$1.displayName=NAME$4;function isValidOrientation(yt){return ORIENTATIONS.includes(yt)}var Root$6=Separator$1;function Separator({className:yt,orientation:Et="horizontal",decorative:xt=!0,...vt}){return jsxRuntimeExports.jsx(Root$6,{"data-slot":"separator",decorative:xt,orientation:Et,className:cn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",yt),...vt})}function composeEventHandlers(yt,Et,{checkForDefaultPrevented:xt=!0}={}){return function(bt){if(yt?.(bt),xt===!1||!bt.defaultPrevented)return Et?.(bt)}}function createContextScope$6(yt,Et=[]){let xt=[];function vt(At,Ft){const Ct=reactExports.createContext(Ft),wt=xt.length;xt=[...xt,Ft];const St=Rt=>{const{scope:Pt,children:Lt,...kt}=Rt,Ot=Pt?.[yt]?.[wt]||Ct,Mt=reactExports.useMemo(()=>kt,Object.values(kt));return jsxRuntimeExports.jsx(Ot.Provider,{value:Mt,children:Lt})};St.displayName=At+"Provider";function Tt(Rt,Pt){const Lt=Pt?.[yt]?.[wt]||Ct,kt=reactExports.useContext(Lt);if(kt)return kt;if(Ft!==void 0)return Ft;throw new Error(`\`${Rt}\` must be used within \`${At}\``)}return[St,Tt]}const bt=()=>{const At=xt.map(Ft=>reactExports.createContext(Ft));return function(Ct){const wt=Ct?.[yt]||At;return reactExports.useMemo(()=>({[`__scope${yt}`]:{...Ct,[yt]:wt}}),[Ct,wt])}};return bt.scopeName=yt,[vt,composeContextScopes$6(bt,...Et)]}function composeContextScopes$6(...yt){const Et=yt[0];if(yt.length===1)return Et;const xt=()=>{const vt=yt.map(bt=>({useScope:bt(),scopeName:bt.scopeName}));return function(At){const Ft=vt.reduce((Ct,{useScope:wt,scopeName:St})=>{const Rt=wt(At)[`__scope${St}`];return{...Ct,...Rt}},{});return reactExports.useMemo(()=>({[`__scope${Et.scopeName}`]:Ft}),[Ft])}};return xt.scopeName=Et.scopeName,xt}function createSlot$b(yt){const Et=createSlotClone$b(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$b);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$b(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$c(bt),Ct=mergeProps$b(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$b=Symbol("radix.slottable");function isSlottable$b(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$b}function mergeProps$b(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$c(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$a=NODES$a.reduce((yt,Et)=>{const xt=createSlot$b(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{});function dispatchDiscreteCustomEvent(yt,Et){yt&&reactDomExports.flushSync(()=>yt.dispatchEvent(Et))}function useCallbackRef$2(yt){const Et=reactExports.useRef(yt);return reactExports.useEffect(()=>{Et.current=yt}),reactExports.useMemo(()=>(...xt)=>Et.current?.(...xt),[])}function useEscapeKeydown(yt,Et=globalThis?.document){const xt=useCallbackRef$2(yt);reactExports.useEffect(()=>{const vt=bt=>{bt.key==="Escape"&&xt(bt)};return Et.addEventListener("keydown",vt,{capture:!0}),()=>Et.removeEventListener("keydown",vt,{capture:!0})},[xt,Et])}var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=reactExports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=reactExports.forwardRef((yt,Et)=>{const{disableOutsidePointerEvents:xt=!1,onEscapeKeyDown:vt,onPointerDownOutside:bt,onFocusOutside:At,onInteractOutside:Ft,onDismiss:Ct,...wt}=yt,St=reactExports.useContext(DismissableLayerContext),[Tt,Rt]=reactExports.useState(null),Pt=Tt?.ownerDocument??globalThis?.document,[,Lt]=reactExports.useState({}),kt=useComposedRefs(Et,Ht=>Rt(Ht)),Ot=Array.from(St.layers),[Mt]=[...St.layersWithOutsidePointerEventsDisabled].slice(-1),It=Ot.indexOf(Mt),Nt=Tt?Ot.indexOf(Tt):-1,Ut=St.layersWithOutsidePointerEventsDisabled.size>0,jt=Nt>=It,Vt=usePointerDownOutside(Ht=>{const Wt=Ht.target,Gt=[...St.branches].some(qt=>qt.contains(Wt));!jt||Gt||(bt?.(Ht),Ft?.(Ht),Ht.defaultPrevented||Ct?.())},Pt),zt=useFocusOutside(Ht=>{const Wt=Ht.target;[...St.branches].some(qt=>qt.contains(Wt))||(At?.(Ht),Ft?.(Ht),Ht.defaultPrevented||Ct?.())},Pt);return useEscapeKeydown(Ht=>{Nt===St.layers.size-1&&(vt?.(Ht),!Ht.defaultPrevented&&Ct&&(Ht.preventDefault(),Ct()))},Pt),reactExports.useEffect(()=>{if(Tt)return xt&&(St.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=Pt.body.style.pointerEvents,Pt.body.style.pointerEvents="none"),St.layersWithOutsidePointerEventsDisabled.add(Tt)),St.layers.add(Tt),dispatchUpdate(),()=>{xt&&St.layersWithOutsidePointerEventsDisabled.size===1&&(Pt.body.style.pointerEvents=originalBodyPointerEvents)}},[Tt,Pt,xt,St]),reactExports.useEffect(()=>()=>{Tt&&(St.layers.delete(Tt),St.layersWithOutsidePointerEventsDisabled.delete(Tt),dispatchUpdate())},[Tt,St]),reactExports.useEffect(()=>{const Ht=()=>Lt({});return document.addEventListener(CONTEXT_UPDATE,Ht),()=>document.removeEventListener(CONTEXT_UPDATE,Ht)},[]),jsxRuntimeExports.jsx(Primitive$a.div,{...wt,ref:kt,style:{pointerEvents:Ut?jt?"auto":"none":void 0,...yt.style},onFocusCapture:composeEventHandlers(yt.onFocusCapture,zt.onFocusCapture),onBlurCapture:composeEventHandlers(yt.onBlurCapture,zt.onBlurCapture),onPointerDownCapture:composeEventHandlers(yt.onPointerDownCapture,Vt.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=reactExports.forwardRef((yt,Et)=>{const xt=reactExports.useContext(DismissableLayerContext),vt=reactExports.useRef(null),bt=useComposedRefs(Et,vt);return reactExports.useEffect(()=>{const At=vt.current;if(At)return xt.branches.add(At),()=>{xt.branches.delete(At)}},[xt.branches]),jsxRuntimeExports.jsx(Primitive$a.div,{...yt,ref:bt})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(yt,Et=globalThis?.document){const xt=useCallbackRef$2(yt),vt=reactExports.useRef(!1),bt=reactExports.useRef(()=>{});return reactExports.useEffect(()=>{const At=Ct=>{if(Ct.target&&!vt.current){let wt=function(){handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE,xt,St,{discrete:!0})};const St={originalEvent:Ct};Ct.pointerType==="touch"?(Et.removeEventListener("click",bt.current),bt.current=wt,Et.addEventListener("click",bt.current,{once:!0})):wt()}else Et.removeEventListener("click",bt.current);vt.current=!1},Ft=window.setTimeout(()=>{Et.addEventListener("pointerdown",At)},0);return()=>{window.clearTimeout(Ft),Et.removeEventListener("pointerdown",At),Et.removeEventListener("click",bt.current)}},[Et,xt]),{onPointerDownCapture:()=>vt.current=!0}}function useFocusOutside(yt,Et=globalThis?.document){const xt=useCallbackRef$2(yt),vt=reactExports.useRef(!1);return reactExports.useEffect(()=>{const bt=At=>{At.target&&!vt.current&&handleAndDispatchCustomEvent(FOCUS_OUTSIDE,xt,{originalEvent:At},{discrete:!1})};return Et.addEventListener("focusin",bt),()=>Et.removeEventListener("focusin",bt)},[Et,xt]),{onFocusCapture:()=>vt.current=!0,onBlurCapture:()=>vt.current=!1}}function dispatchUpdate(){const yt=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(yt)}function handleAndDispatchCustomEvent(yt,Et,xt,{discrete:vt}){const bt=xt.originalEvent.target,At=new CustomEvent(yt,{bubbles:!1,cancelable:!0,detail:xt});Et&&bt.addEventListener(yt,Et,{once:!0}),vt?dispatchDiscreteCustomEvent(bt,At):bt.dispatchEvent(At)}var useLayoutEffect2=globalThis?.document?reactExports.useLayoutEffect:()=>{},useReactId=React$1[" useId ".trim().toString()]||(()=>{}),count$2=0;function useId(yt){const[Et,xt]=reactExports.useState(useReactId());return useLayoutEffect2(()=>{xt(vt=>vt??String(count$2++))},[yt]),Et?`radix-${Et}`:""}const sides=["top","right","bottom","left"],min=Math.min,max=Math.max,round$1=Math.round,floor=Math.floor,createCoords=yt=>({x:yt,y:yt}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$5(yt,Et,xt){return max(yt,min(Et,xt))}function evaluate(yt,Et){return typeof yt=="function"?yt(Et):yt}function getSide(yt){return yt.split("-")[0]}function getAlignment(yt){return yt.split("-")[1]}function getOppositeAxis(yt){return yt==="x"?"y":"x"}function getAxisLength(yt){return yt==="y"?"height":"width"}const yAxisSides=new Set(["top","bottom"]);function getSideAxis(yt){return yAxisSides.has(getSide(yt))?"y":"x"}function getAlignmentAxis(yt){return getOppositeAxis(getSideAxis(yt))}function getAlignmentSides(yt,Et,xt){xt===void 0&&(xt=!1);const vt=getAlignment(yt),bt=getAlignmentAxis(yt),At=getAxisLength(bt);let Ft=bt==="x"?vt===(xt?"end":"start")?"right":"left":vt==="start"?"bottom":"top";return Et.reference[At]>Et.floating[At]&&(Ft=getOppositePlacement(Ft)),[Ft,getOppositePlacement(Ft)]}function getExpandedPlacements(yt){const Et=getOppositePlacement(yt);return[getOppositeAlignmentPlacement(yt),Et,getOppositeAlignmentPlacement(Et)]}function getOppositeAlignmentPlacement(yt){return yt.replace(/start|end/g,Et=>oppositeAlignmentMap[Et])}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(yt,Et,xt){switch(yt){case"top":case"bottom":return xt?Et?rlPlacement:lrPlacement:Et?lrPlacement:rlPlacement;case"left":case"right":return Et?tbPlacement:btPlacement;default:return[]}}function getOppositeAxisPlacements(yt,Et,xt,vt){const bt=getAlignment(yt);let At=getSideList(getSide(yt),xt==="start",vt);return bt&&(At=At.map(Ft=>Ft+"-"+bt),Et&&(At=At.concat(At.map(getOppositeAlignmentPlacement)))),At}function getOppositePlacement(yt){return yt.replace(/left|right|bottom|top/g,Et=>oppositeSideMap[Et])}function expandPaddingObject(yt){return{top:0,right:0,bottom:0,left:0,...yt}}function getPaddingObject$1(yt){return typeof yt!="number"?expandPaddingObject(yt):{top:yt,right:yt,bottom:yt,left:yt}}function rectToClientRect(yt){const{x:Et,y:xt,width:vt,height:bt}=yt;return{width:vt,height:bt,top:xt,left:Et,right:Et+vt,bottom:xt+bt,x:Et,y:xt}}function computeCoordsFromPlacement(yt,Et,xt){let{reference:vt,floating:bt}=yt;const At=getSideAxis(Et),Ft=getAlignmentAxis(Et),Ct=getAxisLength(Ft),wt=getSide(Et),St=At==="y",Tt=vt.x+vt.width/2-bt.width/2,Rt=vt.y+vt.height/2-bt.height/2,Pt=vt[Ct]/2-bt[Ct]/2;let Lt;switch(wt){case"top":Lt={x:Tt,y:vt.y-bt.height};break;case"bottom":Lt={x:Tt,y:vt.y+vt.height};break;case"right":Lt={x:vt.x+vt.width,y:Rt};break;case"left":Lt={x:vt.x-bt.width,y:Rt};break;default:Lt={x:vt.x,y:vt.y}}switch(getAlignment(Et)){case"start":Lt[Ft]-=Pt*(xt&&St?-1:1);break;case"end":Lt[Ft]+=Pt*(xt&&St?-1:1);break}return Lt}async function detectOverflow(yt,Et){var xt;Et===void 0&&(Et={});const{x:vt,y:bt,platform:At,rects:Ft,elements:Ct,strategy:wt}=yt,{boundary:St="clippingAncestors",rootBoundary:Tt="viewport",elementContext:Rt="floating",altBoundary:Pt=!1,padding:Lt=0}=evaluate(Et,yt),kt=getPaddingObject$1(Lt),Mt=Ct[Pt?Rt==="floating"?"reference":"floating":Rt],It=rectToClientRect(await At.getClippingRect({element:(xt=await(At.isElement==null?void 0:At.isElement(Mt)))==null||xt?Mt:Mt.contextElement||await(At.getDocumentElement==null?void 0:At.getDocumentElement(Ct.floating)),boundary:St,rootBoundary:Tt,strategy:wt})),Nt=Rt==="floating"?{x:vt,y:bt,width:Ft.floating.width,height:Ft.floating.height}:Ft.reference,Ut=await(At.getOffsetParent==null?void 0:At.getOffsetParent(Ct.floating)),jt=await(At.isElement==null?void 0:At.isElement(Ut))?await(At.getScale==null?void 0:At.getScale(Ut))||{x:1,y:1}:{x:1,y:1},Vt=rectToClientRect(At.convertOffsetParentRelativeRectToViewportRelativeRect?await At.convertOffsetParentRelativeRectToViewportRelativeRect({elements:Ct,rect:Nt,offsetParent:Ut,strategy:wt}):Nt);return{top:(It.top-Vt.top+kt.top)/jt.y,bottom:(Vt.bottom-It.bottom+kt.bottom)/jt.y,left:(It.left-Vt.left+kt.left)/jt.x,right:(Vt.right-It.right+kt.right)/jt.x}}const computePosition$1=async(yt,Et,xt)=>{const{placement:vt="bottom",strategy:bt="absolute",middleware:At=[],platform:Ft}=xt,Ct=At.filter(Boolean),wt=await(Ft.isRTL==null?void 0:Ft.isRTL(Et));let St=await Ft.getElementRects({reference:yt,floating:Et,strategy:bt}),{x:Tt,y:Rt}=computeCoordsFromPlacement(St,vt,wt),Pt=vt,Lt={},kt=0;for(let Mt=0;Mt<Ct.length;Mt++){var Ot;const{name:It,fn:Nt}=Ct[Mt],{x:Ut,y:jt,data:Vt,reset:zt}=await Nt({x:Tt,y:Rt,initialPlacement:vt,placement:Pt,strategy:bt,middlewareData:Lt,rects:St,platform:{...Ft,detectOverflow:(Ot=Ft.detectOverflow)!=null?Ot:detectOverflow},elements:{reference:yt,floating:Et}});Tt=Ut??Tt,Rt=jt??Rt,Lt={...Lt,[It]:{...Lt[It],...Vt}},zt&&kt<=50&&(kt++,typeof zt=="object"&&(zt.placement&&(Pt=zt.placement),zt.rects&&(St=zt.rects===!0?await Ft.getElementRects({reference:yt,floating:Et,strategy:bt}):zt.rects),{x:Tt,y:Rt}=computeCoordsFromPlacement(St,Pt,wt)),Mt=-1)}return{x:Tt,y:Rt,placement:Pt,strategy:bt,middlewareData:Lt}},arrow$3=yt=>({name:"arrow",options:yt,async fn(Et){const{x:xt,y:vt,placement:bt,rects:At,platform:Ft,elements:Ct,middlewareData:wt}=Et,{element:St,padding:Tt=0}=evaluate(yt,Et)||{};if(St==null)return{};const Rt=getPaddingObject$1(Tt),Pt={x:xt,y:vt},Lt=getAlignmentAxis(bt),kt=getAxisLength(Lt),Ot=await Ft.getDimensions(St),Mt=Lt==="y",It=Mt?"top":"left",Nt=Mt?"bottom":"right",Ut=Mt?"clientHeight":"clientWidth",jt=At.reference[kt]+At.reference[Lt]-Pt[Lt]-At.floating[kt],Vt=Pt[Lt]-At.reference[Lt],zt=await(Ft.getOffsetParent==null?void 0:Ft.getOffsetParent(St));let Ht=zt?zt[Ut]:0;(!Ht||!await(Ft.isElement==null?void 0:Ft.isElement(zt)))&&(Ht=Ct.floating[Ut]||At.floating[kt]);const Wt=jt/2-Vt/2,Gt=Ht/2-Ot[kt]/2-1,qt=min(Rt[It],Gt),Xt=min(Rt[Nt],Gt),Kt=qt,Jt=Ht-Ot[kt]-Xt,tn=Ht/2-Ot[kt]/2+Wt,sn=clamp$5(Kt,tn,Jt),Zt=!wt.arrow&&getAlignment(bt)!=null&&tn!==sn&&At.reference[kt]/2-(tn<Kt?qt:Xt)-Ot[kt]/2<0,nn=Zt?tn<Kt?tn-Kt:tn-Jt:0;return{[Lt]:Pt[Lt]+nn,data:{[Lt]:sn,centerOffset:tn-sn-nn,...Zt&&{alignmentOffset:nn}},reset:Zt}}}),flip$2=function(yt){return yt===void 0&&(yt={}),{name:"flip",options:yt,async fn(Et){var xt,vt;const{placement:bt,middlewareData:At,rects:Ft,initialPlacement:Ct,platform:wt,elements:St}=Et,{mainAxis:Tt=!0,crossAxis:Rt=!0,fallbackPlacements:Pt,fallbackStrategy:Lt="bestFit",fallbackAxisSideDirection:kt="none",flipAlignment:Ot=!0,...Mt}=evaluate(yt,Et);if((xt=At.arrow)!=null&&xt.alignmentOffset)return{};const It=getSide(bt),Nt=getSideAxis(Ct),Ut=getSide(Ct)===Ct,jt=await(wt.isRTL==null?void 0:wt.isRTL(St.floating)),Vt=Pt||(Ut||!Ot?[getOppositePlacement(Ct)]:getExpandedPlacements(Ct)),zt=kt!=="none";!Pt&&zt&&Vt.push(...getOppositeAxisPlacements(Ct,Ot,kt,jt));const Ht=[Ct,...Vt],Wt=await wt.detectOverflow(Et,Mt),Gt=[];let qt=((vt=At.flip)==null?void 0:vt.overflows)||[];if(Tt&&Gt.push(Wt[It]),Rt){const tn=getAlignmentSides(bt,Ft,jt);Gt.push(Wt[tn[0]],Wt[tn[1]])}if(qt=[...qt,{placement:bt,overflows:Gt}],!Gt.every(tn=>tn<=0)){var Xt,Kt;const tn=(((Xt=At.flip)==null?void 0:Xt.index)||0)+1,sn=Ht[tn];if(sn&&(!(Rt==="alignment"?Nt!==getSideAxis(sn):!1)||qt.every(rn=>getSideAxis(rn.placement)===Nt?rn.overflows[0]>0:!0)))return{data:{index:tn,overflows:qt},reset:{placement:sn}};let Zt=(Kt=qt.filter(nn=>nn.overflows[0]<=0).sort((nn,rn)=>nn.overflows[1]-rn.overflows[1])[0])==null?void 0:Kt.placement;if(!Zt)switch(Lt){case"bestFit":{var Jt;const nn=(Jt=qt.filter(rn=>{if(zt){const on=getSideAxis(rn.placement);return on===Nt||on==="y"}return!0}).map(rn=>[rn.placement,rn.overflows.filter(on=>on>0).reduce((on,ln)=>on+ln,0)]).sort((rn,on)=>rn[1]-on[1])[0])==null?void 0:Jt[0];nn&&(Zt=nn);break}case"initialPlacement":Zt=Ct;break}if(bt!==Zt)return{reset:{placement:Zt}}}return{}}}};function getSideOffsets(yt,Et){return{top:yt.top-Et.height,right:yt.right-Et.width,bottom:yt.bottom-Et.height,left:yt.left-Et.width}}function isAnySideFullyClipped(yt){return sides.some(Et=>yt[Et]>=0)}const hide$2=function(yt){return yt===void 0&&(yt={}),{name:"hide",options:yt,async fn(Et){const{rects:xt,platform:vt}=Et,{strategy:bt="referenceHidden",...At}=evaluate(yt,Et);switch(bt){case"referenceHidden":{const Ft=await vt.detectOverflow(Et,{...At,elementContext:"reference"}),Ct=getSideOffsets(Ft,xt.reference);return{data:{referenceHiddenOffsets:Ct,referenceHidden:isAnySideFullyClipped(Ct)}}}case"escaped":{const Ft=await vt.detectOverflow(Et,{...At,altBoundary:!0}),Ct=getSideOffsets(Ft,xt.floating);return{data:{escapedOffsets:Ct,escaped:isAnySideFullyClipped(Ct)}}}default:return{}}}}},originSides=new Set(["left","top"]);async function convertValueToCoords(yt,Et){const{placement:xt,platform:vt,elements:bt}=yt,At=await(vt.isRTL==null?void 0:vt.isRTL(bt.floating)),Ft=getSide(xt),Ct=getAlignment(xt),wt=getSideAxis(xt)==="y",St=originSides.has(Ft)?-1:1,Tt=At&&wt?-1:1,Rt=evaluate(Et,yt);let{mainAxis:Pt,crossAxis:Lt,alignmentAxis:kt}=typeof Rt=="number"?{mainAxis:Rt,crossAxis:0,alignmentAxis:null}:{mainAxis:Rt.mainAxis||0,crossAxis:Rt.crossAxis||0,alignmentAxis:Rt.alignmentAxis};return Ct&&typeof kt=="number"&&(Lt=Ct==="end"?kt*-1:kt),wt?{x:Lt*Tt,y:Pt*St}:{x:Pt*St,y:Lt*Tt}}const offset$2=function(yt){return yt===void 0&&(yt=0),{name:"offset",options:yt,async fn(Et){var xt,vt;const{x:bt,y:At,placement:Ft,middlewareData:Ct}=Et,wt=await convertValueToCoords(Et,yt);return Ft===((xt=Ct.offset)==null?void 0:xt.placement)&&(vt=Ct.arrow)!=null&&vt.alignmentOffset?{}:{x:bt+wt.x,y:At+wt.y,data:{...wt,placement:Ft}}}}},shift$2=function(yt){return yt===void 0&&(yt={}),{name:"shift",options:yt,async fn(Et){const{x:xt,y:vt,placement:bt,platform:At}=Et,{mainAxis:Ft=!0,crossAxis:Ct=!1,limiter:wt={fn:It=>{let{x:Nt,y:Ut}=It;return{x:Nt,y:Ut}}},...St}=evaluate(yt,Et),Tt={x:xt,y:vt},Rt=await At.detectOverflow(Et,St),Pt=getSideAxis(getSide(bt)),Lt=getOppositeAxis(Pt);let kt=Tt[Lt],Ot=Tt[Pt];if(Ft){const It=Lt==="y"?"top":"left",Nt=Lt==="y"?"bottom":"right",Ut=kt+Rt[It],jt=kt-Rt[Nt];kt=clamp$5(Ut,kt,jt)}if(Ct){const It=Pt==="y"?"top":"left",Nt=Pt==="y"?"bottom":"right",Ut=Ot+Rt[It],jt=Ot-Rt[Nt];Ot=clamp$5(Ut,Ot,jt)}const Mt=wt.fn({...Et,[Lt]:kt,[Pt]:Ot});return{...Mt,data:{x:Mt.x-xt,y:Mt.y-vt,enabled:{[Lt]:Ft,[Pt]:Ct}}}}}},limitShift$2=function(yt){return yt===void 0&&(yt={}),{options:yt,fn(Et){const{x:xt,y:vt,placement:bt,rects:At,middlewareData:Ft}=Et,{offset:Ct=0,mainAxis:wt=!0,crossAxis:St=!0}=evaluate(yt,Et),Tt={x:xt,y:vt},Rt=getSideAxis(bt),Pt=getOppositeAxis(Rt);let Lt=Tt[Pt],kt=Tt[Rt];const Ot=evaluate(Ct,Et),Mt=typeof Ot=="number"?{mainAxis:Ot,crossAxis:0}:{mainAxis:0,crossAxis:0,...Ot};if(wt){const Ut=Pt==="y"?"height":"width",jt=At.reference[Pt]-At.floating[Ut]+Mt.mainAxis,Vt=At.reference[Pt]+At.reference[Ut]-Mt.mainAxis;Lt<jt?Lt=jt:Lt>Vt&&(Lt=Vt)}if(St){var It,Nt;const Ut=Pt==="y"?"width":"height",jt=originSides.has(getSide(bt)),Vt=At.reference[Rt]-At.floating[Ut]+(jt&&((It=Ft.offset)==null?void 0:It[Rt])||0)+(jt?0:Mt.crossAxis),zt=At.reference[Rt]+At.reference[Ut]+(jt?0:((Nt=Ft.offset)==null?void 0:Nt[Rt])||0)-(jt?Mt.crossAxis:0);kt<Vt?kt=Vt:kt>zt&&(kt=zt)}return{[Pt]:Lt,[Rt]:kt}}}},size$2=function(yt){return yt===void 0&&(yt={}),{name:"size",options:yt,async fn(Et){var xt,vt;const{placement:bt,rects:At,platform:Ft,elements:Ct}=Et,{apply:wt=()=>{},...St}=evaluate(yt,Et),Tt=await Ft.detectOverflow(Et,St),Rt=getSide(bt),Pt=getAlignment(bt),Lt=getSideAxis(bt)==="y",{width:kt,height:Ot}=At.floating;let Mt,It;Rt==="top"||Rt==="bottom"?(Mt=Rt,It=Pt===(await(Ft.isRTL==null?void 0:Ft.isRTL(Ct.floating))?"start":"end")?"left":"right"):(It=Rt,Mt=Pt==="end"?"top":"bottom");const Nt=Ot-Tt.top-Tt.bottom,Ut=kt-Tt.left-Tt.right,jt=min(Ot-Tt[Mt],Nt),Vt=min(kt-Tt[It],Ut),zt=!Et.middlewareData.shift;let Ht=jt,Wt=Vt;if((xt=Et.middlewareData.shift)!=null&&xt.enabled.x&&(Wt=Ut),(vt=Et.middlewareData.shift)!=null&&vt.enabled.y&&(Ht=Nt),zt&&!Pt){const qt=max(Tt.left,0),Xt=max(Tt.right,0),Kt=max(Tt.top,0),Jt=max(Tt.bottom,0);Lt?Wt=kt-2*(qt!==0||Xt!==0?qt+Xt:max(Tt.left,Tt.right)):Ht=Ot-2*(Kt!==0||Jt!==0?Kt+Jt:max(Tt.top,Tt.bottom))}await wt({...Et,availableWidth:Wt,availableHeight:Ht});const Gt=await Ft.getDimensions(Ct.floating);return kt!==Gt.width||Ot!==Gt.height?{reset:{rects:!0}}:{}}}};function hasWindow(){return typeof window<"u"}function getNodeName(yt){return isNode(yt)?(yt.nodeName||"").toLowerCase():"#document"}function getWindow(yt){var Et;return(yt==null||(Et=yt.ownerDocument)==null?void 0:Et.defaultView)||window}function getDocumentElement(yt){var Et;return(Et=(isNode(yt)?yt.ownerDocument:yt.document)||window.document)==null?void 0:Et.documentElement}function isNode(yt){return hasWindow()?yt instanceof Node||yt instanceof getWindow(yt).Node:!1}function isElement(yt){return hasWindow()?yt instanceof Element||yt instanceof getWindow(yt).Element:!1}function isHTMLElement(yt){return hasWindow()?yt instanceof HTMLElement||yt instanceof getWindow(yt).HTMLElement:!1}function isShadowRoot(yt){return!hasWindow()||typeof ShadowRoot>"u"?!1:yt instanceof ShadowRoot||yt instanceof getWindow(yt).ShadowRoot}const invalidOverflowDisplayValues=new Set(["inline","contents"]);function isOverflowElement(yt){const{overflow:Et,overflowX:xt,overflowY:vt,display:bt}=getComputedStyle$1(yt);return/auto|scroll|overlay|hidden|clip/.test(Et+vt+xt)&&!invalidOverflowDisplayValues.has(bt)}const tableElements=new Set(["table","td","th"]);function isTableElement(yt){return tableElements.has(getNodeName(yt))}const topLayerSelectors=[":popover-open",":modal"];function isTopLayer(yt){return topLayerSelectors.some(Et=>{try{return yt.matches(Et)}catch{return!1}})}const transformProperties=["transform","translate","scale","rotate","perspective"],willChangeValues=["transform","translate","scale","rotate","perspective","filter"],containValues=["paint","layout","strict","content"];function isContainingBlock(yt){const Et=isWebKit(),xt=isElement(yt)?getComputedStyle$1(yt):yt;return transformProperties.some(vt=>xt[vt]?xt[vt]!=="none":!1)||(xt.containerType?xt.containerType!=="normal":!1)||!Et&&(xt.backdropFilter?xt.backdropFilter!=="none":!1)||!Et&&(xt.filter?xt.filter!=="none":!1)||willChangeValues.some(vt=>(xt.willChange||"").includes(vt))||containValues.some(vt=>(xt.contain||"").includes(vt))}function getContainingBlock(yt){let Et=getParentNode(yt);for(;isHTMLElement(Et)&&!isLastTraversableNode(Et);){if(isContainingBlock(Et))return Et;if(isTopLayer(Et))return null;Et=getParentNode(Et)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lastTraversableNodeNames=new Set(["html","body","#document"]);function isLastTraversableNode(yt){return lastTraversableNodeNames.has(getNodeName(yt))}function getComputedStyle$1(yt){return getWindow(yt).getComputedStyle(yt)}function getNodeScroll(yt){return isElement(yt)?{scrollLeft:yt.scrollLeft,scrollTop:yt.scrollTop}:{scrollLeft:yt.scrollX,scrollTop:yt.scrollY}}function getParentNode(yt){if(getNodeName(yt)==="html")return yt;const Et=yt.assignedSlot||yt.parentNode||isShadowRoot(yt)&&yt.host||getDocumentElement(yt);return isShadowRoot(Et)?Et.host:Et}function getNearestOverflowAncestor(yt){const Et=getParentNode(yt);return isLastTraversableNode(Et)?yt.ownerDocument?yt.ownerDocument.body:yt.body:isHTMLElement(Et)&&isOverflowElement(Et)?Et:getNearestOverflowAncestor(Et)}function getOverflowAncestors(yt,Et,xt){var vt;Et===void 0&&(Et=[]),xt===void 0&&(xt=!0);const bt=getNearestOverflowAncestor(yt),At=bt===((vt=yt.ownerDocument)==null?void 0:vt.body),Ft=getWindow(bt);if(At){const Ct=getFrameElement(Ft);return Et.concat(Ft,Ft.visualViewport||[],isOverflowElement(bt)?bt:[],Ct&&xt?getOverflowAncestors(Ct):[])}return Et.concat(bt,getOverflowAncestors(bt,[],xt))}function getFrameElement(yt){return yt.parent&&Object.getPrototypeOf(yt.parent)?yt.frameElement:null}function getCssDimensions(yt){const Et=getComputedStyle$1(yt);let xt=parseFloat(Et.width)||0,vt=parseFloat(Et.height)||0;const bt=isHTMLElement(yt),At=bt?yt.offsetWidth:xt,Ft=bt?yt.offsetHeight:vt,Ct=round$1(xt)!==At||round$1(vt)!==Ft;return Ct&&(xt=At,vt=Ft),{width:xt,height:vt,$:Ct}}function unwrapElement(yt){return isElement(yt)?yt:yt.contextElement}function getScale$1(yt){const Et=unwrapElement(yt);if(!isHTMLElement(Et))return createCoords(1);const xt=Et.getBoundingClientRect(),{width:vt,height:bt,$:At}=getCssDimensions(Et);let Ft=(At?round$1(xt.width):xt.width)/vt,Ct=(At?round$1(xt.height):xt.height)/bt;return(!Ft||!Number.isFinite(Ft))&&(Ft=1),(!Ct||!Number.isFinite(Ct))&&(Ct=1),{x:Ft,y:Ct}}const noOffsets=createCoords(0);function getVisualOffsets(yt){const Et=getWindow(yt);return!isWebKit()||!Et.visualViewport?noOffsets:{x:Et.visualViewport.offsetLeft,y:Et.visualViewport.offsetTop}}function shouldAddVisualOffsets(yt,Et,xt){return Et===void 0&&(Et=!1),!xt||Et&&xt!==getWindow(yt)?!1:Et}function getBoundingClientRect(yt,Et,xt,vt){Et===void 0&&(Et=!1),xt===void 0&&(xt=!1);const bt=yt.getBoundingClientRect(),At=unwrapElement(yt);let Ft=createCoords(1);Et&&(vt?isElement(vt)&&(Ft=getScale$1(vt)):Ft=getScale$1(yt));const Ct=shouldAddVisualOffsets(At,xt,vt)?getVisualOffsets(At):createCoords(0);let wt=(bt.left+Ct.x)/Ft.x,St=(bt.top+Ct.y)/Ft.y,Tt=bt.width/Ft.x,Rt=bt.height/Ft.y;if(At){const Pt=getWindow(At),Lt=vt&&isElement(vt)?getWindow(vt):vt;let kt=Pt,Ot=getFrameElement(kt);for(;Ot&&vt&&Lt!==kt;){const Mt=getScale$1(Ot),It=Ot.getBoundingClientRect(),Nt=getComputedStyle$1(Ot),Ut=It.left+(Ot.clientLeft+parseFloat(Nt.paddingLeft))*Mt.x,jt=It.top+(Ot.clientTop+parseFloat(Nt.paddingTop))*Mt.y;wt*=Mt.x,St*=Mt.y,Tt*=Mt.x,Rt*=Mt.y,wt+=Ut,St+=jt,kt=getWindow(Ot),Ot=getFrameElement(kt)}}return rectToClientRect({width:Tt,height:Rt,x:wt,y:St})}function getWindowScrollBarX(yt,Et){const xt=getNodeScroll(yt).scrollLeft;return Et?Et.left+xt:getBoundingClientRect(getDocumentElement(yt)).left+xt}function getHTMLOffset(yt,Et){const xt=yt.getBoundingClientRect(),vt=xt.left+Et.scrollLeft-getWindowScrollBarX(yt,xt),bt=xt.top+Et.scrollTop;return{x:vt,y:bt}}function convertOffsetParentRelativeRectToViewportRelativeRect(yt){let{elements:Et,rect:xt,offsetParent:vt,strategy:bt}=yt;const At=bt==="fixed",Ft=getDocumentElement(vt),Ct=Et?isTopLayer(Et.floating):!1;if(vt===Ft||Ct&&At)return xt;let wt={scrollLeft:0,scrollTop:0},St=createCoords(1);const Tt=createCoords(0),Rt=isHTMLElement(vt);if((Rt||!Rt&&!At)&&((getNodeName(vt)!=="body"||isOverflowElement(Ft))&&(wt=getNodeScroll(vt)),isHTMLElement(vt))){const Lt=getBoundingClientRect(vt);St=getScale$1(vt),Tt.x=Lt.x+vt.clientLeft,Tt.y=Lt.y+vt.clientTop}const Pt=Ft&&!Rt&&!At?getHTMLOffset(Ft,wt):createCoords(0);return{width:xt.width*St.x,height:xt.height*St.y,x:xt.x*St.x-wt.scrollLeft*St.x+Tt.x+Pt.x,y:xt.y*St.y-wt.scrollTop*St.y+Tt.y+Pt.y}}function getClientRects(yt){return Array.from(yt.getClientRects())}function getDocumentRect(yt){const Et=getDocumentElement(yt),xt=getNodeScroll(yt),vt=yt.ownerDocument.body,bt=max(Et.scrollWidth,Et.clientWidth,vt.scrollWidth,vt.clientWidth),At=max(Et.scrollHeight,Et.clientHeight,vt.scrollHeight,vt.clientHeight);let Ft=-xt.scrollLeft+getWindowScrollBarX(yt);const Ct=-xt.scrollTop;return getComputedStyle$1(vt).direction==="rtl"&&(Ft+=max(Et.clientWidth,vt.clientWidth)-bt),{width:bt,height:At,x:Ft,y:Ct}}const SCROLLBAR_MAX=25;function getViewportRect(yt,Et){const xt=getWindow(yt),vt=getDocumentElement(yt),bt=xt.visualViewport;let At=vt.clientWidth,Ft=vt.clientHeight,Ct=0,wt=0;if(bt){At=bt.width,Ft=bt.height;const Tt=isWebKit();(!Tt||Tt&&Et==="fixed")&&(Ct=bt.offsetLeft,wt=bt.offsetTop)}const St=getWindowScrollBarX(vt);if(St<=0){const Tt=vt.ownerDocument,Rt=Tt.body,Pt=getComputedStyle(Rt),Lt=Tt.compatMode==="CSS1Compat"&&parseFloat(Pt.marginLeft)+parseFloat(Pt.marginRight)||0,kt=Math.abs(vt.clientWidth-Rt.clientWidth-Lt);kt<=SCROLLBAR_MAX&&(At-=kt)}else St<=SCROLLBAR_MAX&&(At+=St);return{width:At,height:Ft,x:Ct,y:wt}}const absoluteOrFixed=new Set(["absolute","fixed"]);function getInnerBoundingClientRect(yt,Et){const xt=getBoundingClientRect(yt,!0,Et==="fixed"),vt=xt.top+yt.clientTop,bt=xt.left+yt.clientLeft,At=isHTMLElement(yt)?getScale$1(yt):createCoords(1),Ft=yt.clientWidth*At.x,Ct=yt.clientHeight*At.y,wt=bt*At.x,St=vt*At.y;return{width:Ft,height:Ct,x:wt,y:St}}function getClientRectFromClippingAncestor(yt,Et,xt){let vt;if(Et==="viewport")vt=getViewportRect(yt,xt);else if(Et==="document")vt=getDocumentRect(getDocumentElement(yt));else if(isElement(Et))vt=getInnerBoundingClientRect(Et,xt);else{const bt=getVisualOffsets(yt);vt={x:Et.x-bt.x,y:Et.y-bt.y,width:Et.width,height:Et.height}}return rectToClientRect(vt)}function hasFixedPositionAncestor(yt,Et){const xt=getParentNode(yt);return xt===Et||!isElement(xt)||isLastTraversableNode(xt)?!1:getComputedStyle$1(xt).position==="fixed"||hasFixedPositionAncestor(xt,Et)}function getClippingElementAncestors(yt,Et){const xt=Et.get(yt);if(xt)return xt;let vt=getOverflowAncestors(yt,[],!1).filter(Ct=>isElement(Ct)&&getNodeName(Ct)!=="body"),bt=null;const At=getComputedStyle$1(yt).position==="fixed";let Ft=At?getParentNode(yt):yt;for(;isElement(Ft)&&!isLastTraversableNode(Ft);){const Ct=getComputedStyle$1(Ft),wt=isContainingBlock(Ft);!wt&&Ct.position==="fixed"&&(bt=null),(At?!wt&&!bt:!wt&&Ct.position==="static"&&!!bt&&absoluteOrFixed.has(bt.position)||isOverflowElement(Ft)&&!wt&&hasFixedPositionAncestor(yt,Ft))?vt=vt.filter(Tt=>Tt!==Ft):bt=Ct,Ft=getParentNode(Ft)}return Et.set(yt,vt),vt}function getClippingRect(yt){let{element:Et,boundary:xt,rootBoundary:vt,strategy:bt}=yt;const Ft=[...xt==="clippingAncestors"?isTopLayer(Et)?[]:getClippingElementAncestors(Et,this._c):[].concat(xt),vt],Ct=Ft[0],wt=Ft.reduce((St,Tt)=>{const Rt=getClientRectFromClippingAncestor(Et,Tt,bt);return St.top=max(Rt.top,St.top),St.right=min(Rt.right,St.right),St.bottom=min(Rt.bottom,St.bottom),St.left=max(Rt.left,St.left),St},getClientRectFromClippingAncestor(Et,Ct,bt));return{width:wt.right-wt.left,height:wt.bottom-wt.top,x:wt.left,y:wt.top}}function getDimensions(yt){const{width:Et,height:xt}=getCssDimensions(yt);return{width:Et,height:xt}}function getRectRelativeToOffsetParent(yt,Et,xt){const vt=isHTMLElement(Et),bt=getDocumentElement(Et),At=xt==="fixed",Ft=getBoundingClientRect(yt,!0,At,Et);let Ct={scrollLeft:0,scrollTop:0};const wt=createCoords(0);function St(){wt.x=getWindowScrollBarX(bt)}if(vt||!vt&&!At)if((getNodeName(Et)!=="body"||isOverflowElement(bt))&&(Ct=getNodeScroll(Et)),vt){const Lt=getBoundingClientRect(Et,!0,At,Et);wt.x=Lt.x+Et.clientLeft,wt.y=Lt.y+Et.clientTop}else bt&&St();At&&!vt&&bt&&St();const Tt=bt&&!vt&&!At?getHTMLOffset(bt,Ct):createCoords(0),Rt=Ft.left+Ct.scrollLeft-wt.x-Tt.x,Pt=Ft.top+Ct.scrollTop-wt.y-Tt.y;return{x:Rt,y:Pt,width:Ft.width,height:Ft.height}}function isStaticPositioned(yt){return getComputedStyle$1(yt).position==="static"}function getTrueOffsetParent(yt,Et){if(!isHTMLElement(yt)||getComputedStyle$1(yt).position==="fixed")return null;if(Et)return Et(yt);let xt=yt.offsetParent;return getDocumentElement(yt)===xt&&(xt=xt.ownerDocument.body),xt}function getOffsetParent(yt,Et){const xt=getWindow(yt);if(isTopLayer(yt))return xt;if(!isHTMLElement(yt)){let bt=getParentNode(yt);for(;bt&&!isLastTraversableNode(bt);){if(isElement(bt)&&!isStaticPositioned(bt))return bt;bt=getParentNode(bt)}return xt}let vt=getTrueOffsetParent(yt,Et);for(;vt&&isTableElement(vt)&&isStaticPositioned(vt);)vt=getTrueOffsetParent(vt,Et);return vt&&isLastTraversableNode(vt)&&isStaticPositioned(vt)&&!isContainingBlock(vt)?xt:vt||getContainingBlock(yt)||xt}const getElementRects=async function(yt){const Et=this.getOffsetParent||getOffsetParent,xt=this.getDimensions,vt=await xt(yt.floating);return{reference:getRectRelativeToOffsetParent(yt.reference,await Et(yt.floating),yt.strategy),floating:{x:0,y:0,width:vt.width,height:vt.height}}};function isRTL(yt){return getComputedStyle$1(yt).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale:getScale$1,isElement,isRTL};function rectsAreEqual(yt,Et){return yt.x===Et.x&&yt.y===Et.y&&yt.width===Et.width&&yt.height===Et.height}function observeMove(yt,Et){let xt=null,vt;const bt=getDocumentElement(yt);function At(){var Ct;clearTimeout(vt),(Ct=xt)==null||Ct.disconnect(),xt=null}function Ft(Ct,wt){Ct===void 0&&(Ct=!1),wt===void 0&&(wt=1),At();const St=yt.getBoundingClientRect(),{left:Tt,top:Rt,width:Pt,height:Lt}=St;if(Ct||Et(),!Pt||!Lt)return;const kt=floor(Rt),Ot=floor(bt.clientWidth-(Tt+Pt)),Mt=floor(bt.clientHeight-(Rt+Lt)),It=floor(Tt),Ut={rootMargin:-kt+"px "+-Ot+"px "+-Mt+"px "+-It+"px",threshold:max(0,min(1,wt))||1};let jt=!0;function Vt(zt){const Ht=zt[0].intersectionRatio;if(Ht!==wt){if(!jt)return Ft();Ht?Ft(!1,Ht):vt=setTimeout(()=>{Ft(!1,1e-7)},1e3)}Ht===1&&!rectsAreEqual(St,yt.getBoundingClientRect())&&Ft(),jt=!1}try{xt=new IntersectionObserver(Vt,{...Ut,root:bt.ownerDocument})}catch{xt=new IntersectionObserver(Vt,Ut)}xt.observe(yt)}return Ft(!0),At}function autoUpdate(yt,Et,xt,vt){vt===void 0&&(vt={});const{ancestorScroll:bt=!0,ancestorResize:At=!0,elementResize:Ft=typeof ResizeObserver=="function",layoutShift:Ct=typeof IntersectionObserver=="function",animationFrame:wt=!1}=vt,St=unwrapElement(yt),Tt=bt||At?[...St?getOverflowAncestors(St):[],...getOverflowAncestors(Et)]:[];Tt.forEach(It=>{bt&&It.addEventListener("scroll",xt,{passive:!0}),At&&It.addEventListener("resize",xt)});const Rt=St&&Ct?observeMove(St,xt):null;let Pt=-1,Lt=null;Ft&&(Lt=new ResizeObserver(It=>{let[Nt]=It;Nt&&Nt.target===St&&Lt&&(Lt.unobserve(Et),cancelAnimationFrame(Pt),Pt=requestAnimationFrame(()=>{var Ut;(Ut=Lt)==null||Ut.observe(Et)})),xt()}),St&&!wt&&Lt.observe(St),Lt.observe(Et));let kt,Ot=wt?getBoundingClientRect(yt):null;wt&&Mt();function Mt(){const It=getBoundingClientRect(yt);Ot&&!rectsAreEqual(Ot,It)&&xt(),Ot=It,kt=requestAnimationFrame(Mt)}return xt(),()=>{var It;Tt.forEach(Nt=>{bt&&Nt.removeEventListener("scroll",xt),At&&Nt.removeEventListener("resize",xt)}),Rt?.(),(It=Lt)==null||It.disconnect(),Lt=null,wt&&cancelAnimationFrame(kt)}}const offset$1=offset$2,shift$1=shift$2,flip$1=flip$2,size$1=size$2,hide$1=hide$2,arrow$2=arrow$3,limitShift$1=limitShift$2,computePosition=(yt,Et,xt)=>{const vt=new Map,bt={platform,...xt},At={...bt.platform,_c:vt};return computePosition$1(yt,Et,{...bt,platform:At})};var isClient=typeof document<"u",noop$5=function(){},index$2=isClient?reactExports.useLayoutEffect:noop$5;function deepEqual$3(yt,Et){if(yt===Et)return!0;if(typeof yt!=typeof Et)return!1;if(typeof yt=="function"&&yt.toString()===Et.toString())return!0;let xt,vt,bt;if(yt&&Et&&typeof yt=="object"){if(Array.isArray(yt)){if(xt=yt.length,xt!==Et.length)return!1;for(vt=xt;vt--!==0;)if(!deepEqual$3(yt[vt],Et[vt]))return!1;return!0}if(bt=Object.keys(yt),xt=bt.length,xt!==Object.keys(Et).length)return!1;for(vt=xt;vt--!==0;)if(!{}.hasOwnProperty.call(Et,bt[vt]))return!1;for(vt=xt;vt--!==0;){const At=bt[vt];if(!(At==="_owner"&&yt.$$typeof)&&!deepEqual$3(yt[At],Et[At]))return!1}return!0}return yt!==yt&&Et!==Et}function getDPR(yt){return typeof window>"u"?1:(yt.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(yt,Et){const xt=getDPR(yt);return Math.round(Et*xt)/xt}function useLatestRef(yt){const Et=reactExports.useRef(yt);return index$2(()=>{Et.current=yt}),Et}function useFloating(yt){yt===void 0&&(yt={});const{placement:Et="bottom",strategy:xt="absolute",middleware:vt=[],platform:bt,elements:{reference:At,floating:Ft}={},transform:Ct=!0,whileElementsMounted:wt,open:St}=yt,[Tt,Rt]=reactExports.useState({x:0,y:0,strategy:xt,placement:Et,middlewareData:{},isPositioned:!1}),[Pt,Lt]=reactExports.useState(vt);deepEqual$3(Pt,vt)||Lt(vt);const[kt,Ot]=reactExports.useState(null),[Mt,It]=reactExports.useState(null),Nt=reactExports.useCallback(rn=>{rn!==zt.current&&(zt.current=rn,Ot(rn))},[]),Ut=reactExports.useCallback(rn=>{rn!==Ht.current&&(Ht.current=rn,It(rn))},[]),jt=At||kt,Vt=Ft||Mt,zt=reactExports.useRef(null),Ht=reactExports.useRef(null),Wt=reactExports.useRef(Tt),Gt=wt!=null,qt=useLatestRef(wt),Xt=useLatestRef(bt),Kt=useLatestRef(St),Jt=reactExports.useCallback(()=>{if(!zt.current||!Ht.current)return;const rn={placement:Et,strategy:xt,middleware:Pt};Xt.current&&(rn.platform=Xt.current),computePosition(zt.current,Ht.current,rn).then(on=>{const ln={...on,isPositioned:Kt.current!==!1};tn.current&&!deepEqual$3(Wt.current,ln)&&(Wt.current=ln,reactDomExports.flushSync(()=>{Rt(ln)}))})},[Pt,Et,xt,Xt,Kt]);index$2(()=>{St===!1&&Wt.current.isPositioned&&(Wt.current.isPositioned=!1,Rt(rn=>({...rn,isPositioned:!1})))},[St]);const tn=reactExports.useRef(!1);index$2(()=>(tn.current=!0,()=>{tn.current=!1}),[]),index$2(()=>{if(jt&&(zt.current=jt),Vt&&(Ht.current=Vt),jt&&Vt){if(qt.current)return qt.current(jt,Vt,Jt);Jt()}},[jt,Vt,Jt,qt,Gt]);const sn=reactExports.useMemo(()=>({reference:zt,floating:Ht,setReference:Nt,setFloating:Ut}),[Nt,Ut]),Zt=reactExports.useMemo(()=>({reference:jt,floating:Vt}),[jt,Vt]),nn=reactExports.useMemo(()=>{const rn={position:xt,left:0,top:0};if(!Zt.floating)return rn;const on=roundByDPR(Zt.floating,Tt.x),ln=roundByDPR(Zt.floating,Tt.y);return Ct?{...rn,transform:"translate("+on+"px, "+ln+"px)",...getDPR(Zt.floating)>=1.5&&{willChange:"transform"}}:{position:xt,left:on,top:ln}},[xt,Ct,Zt.floating,Tt.x,Tt.y]);return reactExports.useMemo(()=>({...Tt,update:Jt,refs:sn,elements:Zt,floatingStyles:nn}),[Tt,Jt,sn,Zt,nn])}const arrow$1=yt=>{function Et(xt){return{}.hasOwnProperty.call(xt,"current")}return{name:"arrow",options:yt,fn(xt){const{element:vt,padding:bt}=typeof yt=="function"?yt(xt):yt;return vt&&Et(vt)?vt.current!=null?arrow$2({element:vt.current,padding:bt}).fn(xt):{}:vt?arrow$2({element:vt,padding:bt}).fn(xt):{}}}},offset=(yt,Et)=>({...offset$1(yt),options:[yt,Et]}),shift=(yt,Et)=>({...shift$1(yt),options:[yt,Et]}),limitShift=(yt,Et)=>({...limitShift$1(yt),options:[yt,Et]}),flip=(yt,Et)=>({...flip$1(yt),options:[yt,Et]}),size=(yt,Et)=>({...size$1(yt),options:[yt,Et]}),hide=(yt,Et)=>({...hide$1(yt),options:[yt,Et]}),arrow=(yt,Et)=>({...arrow$1(yt),options:[yt,Et]});function createSlot$a(yt){const Et=createSlotClone$a(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$a);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$a(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$b(bt),Ct=mergeProps$a(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$a=Symbol("radix.slottable");function isSlottable$a(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$a}function mergeProps$a(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$b(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$9=NODES$9.reduce((yt,Et)=>{const xt=createSlot$a(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),NAME$3="Arrow",Arrow$1=reactExports.forwardRef((yt,Et)=>{const{children:xt,width:vt=10,height:bt=5,...At}=yt;return jsxRuntimeExports.jsx(Primitive$9.svg,{...At,ref:Et,width:vt,height:bt,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:yt.asChild?xt:jsxRuntimeExports.jsx("polygon",{points:"0,0 30,0 15,10"})})});Arrow$1.displayName=NAME$3;var Root$5=Arrow$1;function createContextScope$5(yt,Et=[]){let xt=[];function vt(At,Ft){const Ct=reactExports.createContext(Ft),wt=xt.length;xt=[...xt,Ft];const St=Rt=>{const{scope:Pt,children:Lt,...kt}=Rt,Ot=Pt?.[yt]?.[wt]||Ct,Mt=reactExports.useMemo(()=>kt,Object.values(kt));return jsxRuntimeExports.jsx(Ot.Provider,{value:Mt,children:Lt})};St.displayName=At+"Provider";function Tt(Rt,Pt){const Lt=Pt?.[yt]?.[wt]||Ct,kt=reactExports.useContext(Lt);if(kt)return kt;if(Ft!==void 0)return Ft;throw new Error(`\`${Rt}\` must be used within \`${At}\``)}return[St,Tt]}const bt=()=>{const At=xt.map(Ft=>reactExports.createContext(Ft));return function(Ct){const wt=Ct?.[yt]||At;return reactExports.useMemo(()=>({[`__scope${yt}`]:{...Ct,[yt]:wt}}),[Ct,wt])}};return bt.scopeName=yt,[vt,composeContextScopes$5(bt,...Et)]}function composeContextScopes$5(...yt){const Et=yt[0];if(yt.length===1)return Et;const xt=()=>{const vt=yt.map(bt=>({useScope:bt(),scopeName:bt.scopeName}));return function(At){const Ft=vt.reduce((Ct,{useScope:wt,scopeName:St})=>{const Rt=wt(At)[`__scope${St}`];return{...Ct,...Rt}},{});return reactExports.useMemo(()=>({[`__scope${Et.scopeName}`]:Ft}),[Ft])}};return xt.scopeName=Et.scopeName,xt}function createSlot$9(yt){const Et=createSlotClone$9(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$9);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$9(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$a(bt),Ct=mergeProps$9(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$9=Symbol("radix.slottable");function isSlottable$9(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$9}function mergeProps$9(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$a(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$8=NODES$8.reduce((yt,Et)=>{const xt=createSlot$9(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{});function useSize(yt){const[Et,xt]=reactExports.useState(void 0);return useLayoutEffect2(()=>{if(yt){xt({width:yt.offsetWidth,height:yt.offsetHeight});const vt=new ResizeObserver(bt=>{if(!Array.isArray(bt)||!bt.length)return;const At=bt[0];let Ft,Ct;if("borderBoxSize"in At){const wt=At.borderBoxSize,St=Array.isArray(wt)?wt[0]:wt;Ft=St.inlineSize,Ct=St.blockSize}else Ft=yt.offsetWidth,Ct=yt.offsetHeight;xt({width:Ft,height:Ct})});return vt.observe(yt,{box:"border-box"}),()=>vt.unobserve(yt)}else xt(void 0)},[yt]),Et}var POPPER_NAME="Popper",[createPopperContext,createPopperScope]=createContextScope$5(POPPER_NAME),[PopperProvider,usePopperContext]=createPopperContext(POPPER_NAME),Popper=yt=>{const{__scopePopper:Et,children:xt}=yt,[vt,bt]=reactExports.useState(null);return jsxRuntimeExports.jsx(PopperProvider,{scope:Et,anchor:vt,onAnchorChange:bt,children:xt})};Popper.displayName=POPPER_NAME;var ANCHOR_NAME="PopperAnchor",PopperAnchor=reactExports.forwardRef((yt,Et)=>{const{__scopePopper:xt,virtualRef:vt,...bt}=yt,At=usePopperContext(ANCHOR_NAME,xt),Ft=reactExports.useRef(null),Ct=useComposedRefs(Et,Ft),wt=reactExports.useRef(null);return reactExports.useEffect(()=>{const St=wt.current;wt.current=vt?.current||Ft.current,St!==wt.current&&At.onAnchorChange(wt.current)}),vt?null:jsxRuntimeExports.jsx(Primitive$8.div,{...bt,ref:Ct})});PopperAnchor.displayName=ANCHOR_NAME;var CONTENT_NAME$3="PopperContent",[PopperContentProvider,useContentContext]=createPopperContext(CONTENT_NAME$3),PopperContent=reactExports.forwardRef((yt,Et)=>{const{__scopePopper:xt,side:vt="bottom",sideOffset:bt=0,align:At="center",alignOffset:Ft=0,arrowPadding:Ct=0,avoidCollisions:wt=!0,collisionBoundary:St=[],collisionPadding:Tt=0,sticky:Rt="partial",hideWhenDetached:Pt=!1,updatePositionStrategy:Lt="optimized",onPlaced:kt,...Ot}=yt,Mt=usePopperContext(CONTENT_NAME$3,xt),[It,Nt]=reactExports.useState(null),Ut=useComposedRefs(Et,xn=>Nt(xn)),[jt,Vt]=reactExports.useState(null),zt=useSize(jt),Ht=zt?.width??0,Wt=zt?.height??0,Gt=vt+(At!=="center"?"-"+At:""),qt=typeof Tt=="number"?Tt:{top:0,right:0,bottom:0,left:0,...Tt},Xt=Array.isArray(St)?St:[St],Kt=Xt.length>0,Jt={padding:qt,boundary:Xt.filter(isNotNull),altBoundary:Kt},{refs:tn,floatingStyles:sn,placement:Zt,isPositioned:nn,middlewareData:rn}=useFloating({strategy:"fixed",placement:Gt,whileElementsMounted:(...xn)=>autoUpdate(...xn,{animationFrame:Lt==="always"}),elements:{reference:Mt.anchor},middleware:[offset({mainAxis:bt+Wt,alignmentAxis:Ft}),wt&&shift({mainAxis:!0,crossAxis:!1,limiter:Rt==="partial"?limitShift():void 0,...Jt}),wt&&flip({...Jt}),size({...Jt,apply:({elements:xn,rects:Mn,availableWidth:$n,availableHeight:Rn})=>{const{width:Tn,height:ir}=Mn.reference,Jn=xn.floating.style;Jn.setProperty("--radix-popper-available-width",`${$n}px`),Jn.setProperty("--radix-popper-available-height",`${Rn}px`),Jn.setProperty("--radix-popper-anchor-width",`${Tn}px`),Jn.setProperty("--radix-popper-anchor-height",`${ir}px`)}}),jt&&arrow({element:jt,padding:Ct}),transformOrigin({arrowWidth:Ht,arrowHeight:Wt}),Pt&&hide({strategy:"referenceHidden",...Jt})]}),[on,ln]=getSideAndAlignFromPlacement(Zt),Qt=useCallbackRef$2(kt);useLayoutEffect2(()=>{nn&&Qt?.()},[nn,Qt]);const fn=rn.arrow?.x,pn=rn.arrow?.y,mn=rn.arrow?.centerOffset!==0,[vn,yn]=reactExports.useState();return useLayoutEffect2(()=>{It&&yn(window.getComputedStyle(It).zIndex)},[It]),jsxRuntimeExports.jsx("div",{ref:tn.setFloating,"data-radix-popper-content-wrapper":"",style:{...sn,transform:nn?sn.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:vn,"--radix-popper-transform-origin":[rn.transformOrigin?.x,rn.transformOrigin?.y].join(" "),...rn.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:yt.dir,children:jsxRuntimeExports.jsx(PopperContentProvider,{scope:xt,placedSide:on,onArrowChange:Vt,arrowX:fn,arrowY:pn,shouldHideArrow:mn,children:jsxRuntimeExports.jsx(Primitive$8.div,{"data-side":on,"data-align":ln,...Ot,ref:Ut,style:{...Ot.style,animation:nn?void 0:"none"}})})})});PopperContent.displayName=CONTENT_NAME$3;var ARROW_NAME$2="PopperArrow",OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},PopperArrow=reactExports.forwardRef(function(Et,xt){const{__scopePopper:vt,...bt}=Et,At=useContentContext(ARROW_NAME$2,vt),Ft=OPPOSITE_SIDE[At.placedSide];return jsxRuntimeExports.jsx("span",{ref:At.onArrowChange,style:{position:"absolute",left:At.arrowX,top:At.arrowY,[Ft]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[At.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[At.placedSide],visibility:At.shouldHideArrow?"hidden":void 0},children:jsxRuntimeExports.jsx(Root$5,{...bt,ref:xt,style:{...bt.style,display:"block"}})})});PopperArrow.displayName=ARROW_NAME$2;function isNotNull(yt){return yt!==null}var transformOrigin=yt=>({name:"transformOrigin",options:yt,fn(Et){const{placement:xt,rects:vt,middlewareData:bt}=Et,Ft=bt.arrow?.centerOffset!==0,Ct=Ft?0:yt.arrowWidth,wt=Ft?0:yt.arrowHeight,[St,Tt]=getSideAndAlignFromPlacement(xt),Rt={start:"0%",center:"50%",end:"100%"}[Tt],Pt=(bt.arrow?.x??0)+Ct/2,Lt=(bt.arrow?.y??0)+wt/2;let kt="",Ot="";return St==="bottom"?(kt=Ft?Rt:`${Pt}px`,Ot=`${-wt}px`):St==="top"?(kt=Ft?Rt:`${Pt}px`,Ot=`${vt.floating.height+wt}px`):St==="right"?(kt=`${-wt}px`,Ot=Ft?Rt:`${Lt}px`):St==="left"&&(kt=`${vt.floating.width+wt}px`,Ot=Ft?Rt:`${Lt}px`),{data:{x:kt,y:Ot}}}});function getSideAndAlignFromPlacement(yt){const[Et,xt="center"]=yt.split("-");return[Et,xt]}var Root2$1=Popper,Anchor=PopperAnchor,Content=PopperContent,Arrow=PopperArrow;function createSlot$8(yt){const Et=createSlotClone$8(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$8);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$8(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$9(bt),Ct=mergeProps$8(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$8=Symbol("radix.slottable");function isSlottable$8(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$8}function mergeProps$8(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$9(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$7=NODES$7.reduce((yt,Et)=>{const xt=createSlot$8(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),PORTAL_NAME$2="Portal",Portal$1=reactExports.forwardRef((yt,Et)=>{const{container:xt,...vt}=yt,[bt,At]=reactExports.useState(!1);useLayoutEffect2(()=>At(!0),[]);const Ft=xt||bt&&globalThis?.document?.body;return Ft?ReactDOM.createPortal(jsxRuntimeExports.jsx(Primitive$7.div,{...vt,ref:Et}),Ft):null});Portal$1.displayName=PORTAL_NAME$2;function useStateMachine(yt,Et){return reactExports.useReducer((xt,vt)=>Et[xt][vt]??xt,yt)}var Presence=yt=>{const{present:Et,children:xt}=yt,vt=usePresence(Et),bt=typeof xt=="function"?xt({present:vt.isPresent}):reactExports.Children.only(xt),At=useComposedRefs(vt.ref,getElementRef$8(bt));return typeof xt=="function"||vt.isPresent?reactExports.cloneElement(bt,{ref:At}):null};Presence.displayName="Presence";function usePresence(yt){const[Et,xt]=reactExports.useState(),vt=reactExports.useRef(null),bt=reactExports.useRef(yt),At=reactExports.useRef("none"),Ft=yt?"mounted":"unmounted",[Ct,wt]=useStateMachine(Ft,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const St=getAnimationName(vt.current);At.current=Ct==="mounted"?St:"none"},[Ct]),useLayoutEffect2(()=>{const St=vt.current,Tt=bt.current;if(Tt!==yt){const Pt=At.current,Lt=getAnimationName(St);yt?wt("MOUNT"):Lt==="none"||St?.display==="none"?wt("UNMOUNT"):wt(Tt&&Pt!==Lt?"ANIMATION_OUT":"UNMOUNT"),bt.current=yt}},[yt,wt]),useLayoutEffect2(()=>{if(Et){let St;const Tt=Et.ownerDocument.defaultView??window,Rt=Lt=>{const Ot=getAnimationName(vt.current).includes(CSS.escape(Lt.animationName));if(Lt.target===Et&&Ot&&(wt("ANIMATION_END"),!bt.current)){const Mt=Et.style.animationFillMode;Et.style.animationFillMode="forwards",St=Tt.setTimeout(()=>{Et.style.animationFillMode==="forwards"&&(Et.style.animationFillMode=Mt)})}},Pt=Lt=>{Lt.target===Et&&(At.current=getAnimationName(vt.current))};return Et.addEventListener("animationstart",Pt),Et.addEventListener("animationcancel",Rt),Et.addEventListener("animationend",Rt),()=>{Tt.clearTimeout(St),Et.removeEventListener("animationstart",Pt),Et.removeEventListener("animationcancel",Rt),Et.removeEventListener("animationend",Rt)}}else wt("ANIMATION_END")},[Et,wt]),{isPresent:["mounted","unmountSuspended"].includes(Ct),ref:reactExports.useCallback(St=>{vt.current=St?getComputedStyle(St):null,xt(St)},[])}}function getAnimationName(yt){return yt?.animationName||"none"}function getElementRef$8(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}function createSlot$7(yt){const Et=createSlotClone$7(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$7);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$7(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$7(bt),Ct=mergeProps$7(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$7=Symbol("radix.slottable");function createSlottable(yt){const Et=({children:xt})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:xt});return Et.displayName=`${yt}.Slottable`,Et.__radixId=SLOTTABLE_IDENTIFIER$7,Et}function isSlottable$7(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$7}function mergeProps$7(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$7(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$6=NODES$6.reduce((yt,Et)=>{const xt=createSlot$7(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),useInsertionEffect=React$1[" useInsertionEffect ".trim().toString()]||useLayoutEffect2;function useControllableState({prop:yt,defaultProp:Et,onChange:xt=()=>{},caller:vt}){const[bt,At,Ft]=useUncontrolledState({defaultProp:Et,onChange:xt}),Ct=yt!==void 0,wt=Ct?yt:bt;{const Tt=reactExports.useRef(yt!==void 0);reactExports.useEffect(()=>{const Rt=Tt.current;Rt!==Ct&&console.warn(`${vt} is changing from ${Rt?"controlled":"uncontrolled"} to ${Ct?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),Tt.current=Ct},[Ct,vt])}const St=reactExports.useCallback(Tt=>{if(Ct){const Rt=isFunction$1(Tt)?Tt(yt):Tt;Rt!==yt&&Ft.current?.(Rt)}else At(Tt)},[Ct,yt,At,Ft]);return[wt,St]}function useUncontrolledState({defaultProp:yt,onChange:Et}){const[xt,vt]=reactExports.useState(yt),bt=reactExports.useRef(xt),At=reactExports.useRef(Et);return useInsertionEffect(()=>{At.current=Et},[Et]),reactExports.useEffect(()=>{bt.current!==xt&&(At.current?.(xt),bt.current=xt)},[xt,bt]),[xt,vt,At]}function isFunction$1(yt){return typeof yt=="function"}function createSlot$6(yt){const Et=createSlotClone$6(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$6);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$6(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$6(bt),Ct=mergeProps$6(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$6=Symbol("radix.slottable");function isSlottable$6(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$6}function mergeProps$6(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$6(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$5=NODES$5.reduce((yt,Et)=>{const xt=createSlot$6(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),VISUALLY_HIDDEN_STYLES=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),NAME$2="VisuallyHidden",VisuallyHidden=reactExports.forwardRef((yt,Et)=>jsxRuntimeExports.jsx(Primitive$5.span,{...yt,ref:Et,style:{...VISUALLY_HIDDEN_STYLES,...yt.style}}));VisuallyHidden.displayName=NAME$2;var Root$4=VisuallyHidden,[createTooltipContext]=createContextScope$6("Tooltip",[createPopperScope]),usePopperScope$1=createPopperScope(),PROVIDER_NAME="TooltipProvider",DEFAULT_DELAY_DURATION=700,TOOLTIP_OPEN="tooltip.open",[TooltipProviderContextProvider,useTooltipProviderContext]=createTooltipContext(PROVIDER_NAME),TooltipProvider$1=yt=>{const{__scopeTooltip:Et,delayDuration:xt=DEFAULT_DELAY_DURATION,skipDelayDuration:vt=300,disableHoverableContent:bt=!1,children:At}=yt,Ft=reactExports.useRef(!0),Ct=reactExports.useRef(!1),wt=reactExports.useRef(0);return reactExports.useEffect(()=>{const St=wt.current;return()=>window.clearTimeout(St)},[]),jsxRuntimeExports.jsx(TooltipProviderContextProvider,{scope:Et,isOpenDelayedRef:Ft,delayDuration:xt,onOpen:reactExports.useCallback(()=>{window.clearTimeout(wt.current),Ft.current=!1},[]),onClose:reactExports.useCallback(()=>{window.clearTimeout(wt.current),wt.current=window.setTimeout(()=>Ft.current=!0,vt)},[vt]),isPointerInTransitRef:Ct,onPointerInTransitChange:reactExports.useCallback(St=>{Ct.current=St},[]),disableHoverableContent:bt,children:At})};TooltipProvider$1.displayName=PROVIDER_NAME;var TOOLTIP_NAME="Tooltip",[TooltipContextProvider,useTooltipContext]=createTooltipContext(TOOLTIP_NAME),TRIGGER_NAME$2="TooltipTrigger",TooltipTrigger=reactExports.forwardRef((yt,Et)=>{const{__scopeTooltip:xt,...vt}=yt,bt=useTooltipContext(TRIGGER_NAME$2,xt),At=useTooltipProviderContext(TRIGGER_NAME$2,xt),Ft=usePopperScope$1(xt),Ct=reactExports.useRef(null),wt=useComposedRefs(Et,Ct,bt.onTriggerChange),St=reactExports.useRef(!1),Tt=reactExports.useRef(!1),Rt=reactExports.useCallback(()=>St.current=!1,[]);return reactExports.useEffect(()=>()=>document.removeEventListener("pointerup",Rt),[Rt]),jsxRuntimeExports.jsx(Anchor,{asChild:!0,...Ft,children:jsxRuntimeExports.jsx(Primitive$6.button,{"aria-describedby":bt.open?bt.contentId:void 0,"data-state":bt.stateAttribute,...vt,ref:wt,onPointerMove:composeEventHandlers(yt.onPointerMove,Pt=>{Pt.pointerType!=="touch"&&!Tt.current&&!At.isPointerInTransitRef.current&&(bt.onTriggerEnter(),Tt.current=!0)}),onPointerLeave:composeEventHandlers(yt.onPointerLeave,()=>{bt.onTriggerLeave(),Tt.current=!1}),onPointerDown:composeEventHandlers(yt.onPointerDown,()=>{bt.open&&bt.onClose(),St.current=!0,document.addEventListener("pointerup",Rt,{once:!0})}),onFocus:composeEventHandlers(yt.onFocus,()=>{St.current||bt.onOpen()}),onBlur:composeEventHandlers(yt.onBlur,bt.onClose),onClick:composeEventHandlers(yt.onClick,bt.onClose)})})});TooltipTrigger.displayName=TRIGGER_NAME$2;var PORTAL_NAME$1="TooltipPortal",[PortalProvider,usePortalContext]=createTooltipContext(PORTAL_NAME$1,{forceMount:void 0}),CONTENT_NAME$2="TooltipContent",TooltipContent=reactExports.forwardRef((yt,Et)=>{const xt=usePortalContext(CONTENT_NAME$2,yt.__scopeTooltip),{forceMount:vt=xt.forceMount,side:bt="top",...At}=yt,Ft=useTooltipContext(CONTENT_NAME$2,yt.__scopeTooltip);return jsxRuntimeExports.jsx(Presence,{present:vt||Ft.open,children:Ft.disableHoverableContent?jsxRuntimeExports.jsx(TooltipContentImpl,{side:bt,...At,ref:Et}):jsxRuntimeExports.jsx(TooltipContentHoverable,{side:bt,...At,ref:Et})})}),TooltipContentHoverable=reactExports.forwardRef((yt,Et)=>{const xt=useTooltipContext(CONTENT_NAME$2,yt.__scopeTooltip),vt=useTooltipProviderContext(CONTENT_NAME$2,yt.__scopeTooltip),bt=reactExports.useRef(null),At=useComposedRefs(Et,bt),[Ft,Ct]=reactExports.useState(null),{trigger:wt,onClose:St}=xt,Tt=bt.current,{onPointerInTransitChange:Rt}=vt,Pt=reactExports.useCallback(()=>{Ct(null),Rt(!1)},[Rt]),Lt=reactExports.useCallback((kt,Ot)=>{const Mt=kt.currentTarget,It={x:kt.clientX,y:kt.clientY},Nt=getExitSideFromRect(It,Mt.getBoundingClientRect()),Ut=getPaddedExitPoints(It,Nt),jt=getPointsFromRect(Ot.getBoundingClientRect()),Vt=getHull([...Ut,...jt]);Ct(Vt),Rt(!0)},[Rt]);return reactExports.useEffect(()=>()=>Pt(),[Pt]),reactExports.useEffect(()=>{if(wt&&Tt){const kt=Mt=>Lt(Mt,Tt),Ot=Mt=>Lt(Mt,wt);return wt.addEventListener("pointerleave",kt),Tt.addEventListener("pointerleave",Ot),()=>{wt.removeEventListener("pointerleave",kt),Tt.removeEventListener("pointerleave",Ot)}}},[wt,Tt,Lt,Pt]),reactExports.useEffect(()=>{if(Ft){const kt=Ot=>{const Mt=Ot.target,It={x:Ot.clientX,y:Ot.clientY},Nt=wt?.contains(Mt)||Tt?.contains(Mt),Ut=!isPointInPolygon(It,Ft);Nt?Pt():Ut&&(Pt(),St())};return document.addEventListener("pointermove",kt),()=>document.removeEventListener("pointermove",kt)}},[wt,Tt,Ft,St,Pt]),jsxRuntimeExports.jsx(TooltipContentImpl,{...yt,ref:At})}),[VisuallyHiddenContentContextProvider,useVisuallyHiddenContentContext]=createTooltipContext(TOOLTIP_NAME,{isInside:!1}),Slottable=createSlottable("TooltipContent"),TooltipContentImpl=reactExports.forwardRef((yt,Et)=>{const{__scopeTooltip:xt,children:vt,"aria-label":bt,onEscapeKeyDown:At,onPointerDownOutside:Ft,...Ct}=yt,wt=useTooltipContext(CONTENT_NAME$2,xt),St=usePopperScope$1(xt),{onClose:Tt}=wt;return reactExports.useEffect(()=>(document.addEventListener(TOOLTIP_OPEN,Tt),()=>document.removeEventListener(TOOLTIP_OPEN,Tt)),[Tt]),reactExports.useEffect(()=>{if(wt.trigger){const Rt=Pt=>{Pt.target?.contains(wt.trigger)&&Tt()};return window.addEventListener("scroll",Rt,{capture:!0}),()=>window.removeEventListener("scroll",Rt,{capture:!0})}},[wt.trigger,Tt]),jsxRuntimeExports.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:At,onPointerDownOutside:Ft,onFocusOutside:Rt=>Rt.preventDefault(),onDismiss:Tt,children:jsxRuntimeExports.jsxs(Content,{"data-state":wt.stateAttribute,...St,...Ct,ref:Et,style:{...Ct.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[jsxRuntimeExports.jsx(Slottable,{children:vt}),jsxRuntimeExports.jsx(VisuallyHiddenContentContextProvider,{scope:xt,isInside:!0,children:jsxRuntimeExports.jsx(Root$4,{id:wt.contentId,role:"tooltip",children:bt||vt})})]})})});TooltipContent.displayName=CONTENT_NAME$2;var ARROW_NAME$1="TooltipArrow",TooltipArrow=reactExports.forwardRef((yt,Et)=>{const{__scopeTooltip:xt,...vt}=yt,bt=usePopperScope$1(xt);return useVisuallyHiddenContentContext(ARROW_NAME$1,xt).isInside?null:jsxRuntimeExports.jsx(Arrow,{...bt,...vt,ref:Et})});TooltipArrow.displayName=ARROW_NAME$1;function getExitSideFromRect(yt,Et){const xt=Math.abs(Et.top-yt.y),vt=Math.abs(Et.bottom-yt.y),bt=Math.abs(Et.right-yt.x),At=Math.abs(Et.left-yt.x);switch(Math.min(xt,vt,bt,At)){case At:return"left";case bt:return"right";case xt:return"top";case vt:return"bottom";default:throw new Error("unreachable")}}function getPaddedExitPoints(yt,Et,xt=5){const vt=[];switch(Et){case"top":vt.push({x:yt.x-xt,y:yt.y+xt},{x:yt.x+xt,y:yt.y+xt});break;case"bottom":vt.push({x:yt.x-xt,y:yt.y-xt},{x:yt.x+xt,y:yt.y-xt});break;case"left":vt.push({x:yt.x+xt,y:yt.y-xt},{x:yt.x+xt,y:yt.y+xt});break;case"right":vt.push({x:yt.x-xt,y:yt.y-xt},{x:yt.x-xt,y:yt.y+xt});break}return vt}function getPointsFromRect(yt){const{top:Et,right:xt,bottom:vt,left:bt}=yt;return[{x:bt,y:Et},{x:xt,y:Et},{x:xt,y:vt},{x:bt,y:vt}]}function isPointInPolygon(yt,Et){const{x:xt,y:vt}=yt;let bt=!1;for(let At=0,Ft=Et.length-1;At<Et.length;Ft=At++){const Ct=Et[At],wt=Et[Ft],St=Ct.x,Tt=Ct.y,Rt=wt.x,Pt=wt.y;Tt>vt!=Pt>vt&&xt<(Rt-St)*(vt-Tt)/(Pt-Tt)+St&&(bt=!bt)}return bt}function getHull(yt){const Et=yt.slice();return Et.sort((xt,vt)=>xt.x<vt.x?-1:xt.x>vt.x?1:xt.y<vt.y?-1:xt.y>vt.y?1:0),getHullPresorted(Et)}function getHullPresorted(yt){if(yt.length<=1)return yt.slice();const Et=[];for(let vt=0;vt<yt.length;vt++){const bt=yt[vt];for(;Et.length>=2;){const At=Et[Et.length-1],Ft=Et[Et.length-2];if((At.x-Ft.x)*(bt.y-Ft.y)>=(At.y-Ft.y)*(bt.x-Ft.x))Et.pop();else break}Et.push(bt)}Et.pop();const xt=[];for(let vt=yt.length-1;vt>=0;vt--){const bt=yt[vt];for(;xt.length>=2;){const At=xt[xt.length-1],Ft=xt[xt.length-2];if((At.x-Ft.x)*(bt.y-Ft.y)>=(At.y-Ft.y)*(bt.x-Ft.x))xt.pop();else break}xt.push(bt)}return xt.pop(),Et.length===1&&xt.length===1&&Et[0].x===xt[0].x&&Et[0].y===xt[0].y?Et:Et.concat(xt)}var Provider=TooltipProvider$1;function TooltipProvider({delayDuration:yt=0,...Et}){return jsxRuntimeExports.jsx(Provider,{"data-slot":"tooltip-provider",delayDuration:yt,...Et})}const SIDEBAR_COOKIE_NAME="sidebar_state",SIDEBAR_COOKIE_MAX_AGE=3600*24*7,SIDEBAR_WIDTH="18rem",SIDEBAR_WIDTH_ICON="3rem",SIDEBAR_KEYBOARD_SHORTCUT="b",SidebarContext=reactExports.createContext(null);function useSidebar(){const yt=reactExports.useContext(SidebarContext);if(!yt)throw new Error("useSidebar must be used within a SidebarProvider.");return yt}function SidebarProvider({defaultOpen:yt=!0,open:Et,onOpenChange:xt,className:vt,style:bt,children:At,...Ft}){const Ct=useIsMobile(),[wt,St]=reactExports.useState(!1),[Tt,Rt]=reactExports.useState(yt),Pt=Et??Tt,Lt=reactExports.useCallback(It=>{const Nt=typeof It=="function"?It(Pt):It;xt?xt(Nt):Rt(Nt),document.cookie=`${SIDEBAR_COOKIE_NAME}=${Nt}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`},[xt,Pt]),kt=reactExports.useCallback(()=>Ct?St(It=>!It):Lt(It=>!It),[Ct,Lt,St]);reactExports.useEffect(()=>{const It=Nt=>{Nt.key===SIDEBAR_KEYBOARD_SHORTCUT&&(Nt.metaKey||Nt.ctrlKey)&&(Nt.preventDefault(),kt())};return window.addEventListener("keydown",It),()=>window.removeEventListener("keydown",It)},[kt]);const Ot=Ct?wt?"expanded":"collapsed":Pt?"expanded":"collapsed",Mt=reactExports.useMemo(()=>({state:Ot,open:Pt,setOpen:Lt,isMobile:Ct,openMobile:wt,setOpenMobile:St,toggleSidebar:kt}),[Ot,Pt,Lt,Ct,wt,St,kt]);return jsxRuntimeExports.jsx(SidebarContext.Provider,{value:Mt,children:jsxRuntimeExports.jsx(TooltipProvider,{delayDuration:0,children:jsxRuntimeExports.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":SIDEBAR_WIDTH,"--sidebar-width-icon":SIDEBAR_WIDTH_ICON,...bt},className:cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",vt),...Ft,children:At})})})}function Sidebar({side:yt="left",variant:Et="sidebar",collapsible:xt="offcanvas",className:vt,children:bt,...At}){const{isMobile:Ft,state:Ct,openMobile:wt,setOpenMobile:St}=useSidebar(),Tt=Et==="inset",Rt=Tt?"relative":"fixed inset-y-0";return jsxRuntimeExports.jsxs("div",{className:cn("group peer text-sidebar-foreground",vt),"data-state":Ct,"data-collapsible":Ct==="collapsed"?xt:"","data-variant":Et,"data-side":yt,"data-slot":"sidebar",...At,children:[jsxRuntimeExports.jsx("div",{"data-slot":"sidebar-gap",className:cn("relative bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",Et==="floating"||Et==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)"),style:Ct==="collapsed"&&xt==="offcanvas"?{width:"0",boxSizing:"border-box",overflow:"hidden"}:{width:"var(--sidebar-width)",boxSizing:"border-box"}}),jsxRuntimeExports.jsx("div",{"data-slot":"sidebar-container",className:cn(`${Rt} z-10 h-svh transition-[left,right,width] duration-200 ease-linear flex`,yt==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",Et==="floating"||Et==="inset"?"p-2 group-data-[collapsible=offcanvas]:p-0 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l group-data-[collapsible=offcanvas]:border-none",vt),style:Ct==="collapsed"&&xt==="offcanvas"?{width:"0",boxSizing:"border-box",overflow:"hidden",visibility:"hidden"}:Tt?{width:"var(--sidebar-width)",boxSizing:"border-box"}:{width:"var(--sidebar-width)"},children:jsxRuntimeExports.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:bt})})]})}function SidebarTrigger({className:yt,onClick:Et,style:xt,...vt}){const{toggleSidebar:bt}=useSidebar(),{state:At}=useSidebar();return jsxRuntimeExports.jsxs(Button,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:cn("size-7 flex items-center justify-center border touch-manipulation",yt),style:{zIndex:1e5,boxShadow:"0 2px 8px rgba(0,0,0,0.08)",transition:"transform 0.2s",pointerEvents:"auto",...xt},onClick:Ft=>{Et&&Et(Ft),bt()},...vt,children:[jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transition:"transform 0.2s",transform:At==="expanded"?"rotate(180deg)":"rotate(0deg)"},children:jsxRuntimeExports.jsx("path",{d:"M7 5l5 5-5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function SidebarInset({className:yt,...Et}){return jsxRuntimeExports.jsx("main",{"data-slot":"sidebar-inset",className:cn("bg-background relative flex w-full flex-1 flex-col min-h-0 overflow-hidden","md:peer-data-[variant=inset]:my-2 md:peer-data-[variant=inset]:mr-2 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",yt),...Et})}function createContextScope$4(yt,Et=[]){let xt=[];function vt(At,Ft){const Ct=reactExports.createContext(Ft),wt=xt.length;xt=[...xt,Ft];const St=Rt=>{const{scope:Pt,children:Lt,...kt}=Rt,Ot=Pt?.[yt]?.[wt]||Ct,Mt=reactExports.useMemo(()=>kt,Object.values(kt));return jsxRuntimeExports.jsx(Ot.Provider,{value:Mt,children:Lt})};St.displayName=At+"Provider";function Tt(Rt,Pt){const Lt=Pt?.[yt]?.[wt]||Ct,kt=reactExports.useContext(Lt);if(kt)return kt;if(Ft!==void 0)return Ft;throw new Error(`\`${Rt}\` must be used within \`${At}\``)}return[St,Tt]}const bt=()=>{const At=xt.map(Ft=>reactExports.createContext(Ft));return function(Ct){const wt=Ct?.[yt]||At;return reactExports.useMemo(()=>({[`__scope${yt}`]:{...Ct,[yt]:wt}}),[Ct,wt])}};return bt.scopeName=yt,[vt,composeContextScopes$4(bt,...Et)]}function composeContextScopes$4(...yt){const Et=yt[0];if(yt.length===1)return Et;const xt=()=>{const vt=yt.map(bt=>({useScope:bt(),scopeName:bt.scopeName}));return function(At){const Ft=vt.reduce((Ct,{useScope:wt,scopeName:St})=>{const Rt=wt(At)[`__scope${St}`];return{...Ct,...Rt}},{});return reactExports.useMemo(()=>({[`__scope${Et.scopeName}`]:Ft}),[Ft])}};return xt.scopeName=Et.scopeName,xt}function createSlot$5(yt){const Et=createSlotClone$5(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$5);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$5(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$5(bt),Ct=mergeProps$5(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$5=Symbol("radix.slottable");function isSlottable$5(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$5}function mergeProps$5(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$5(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$4=NODES$4.reduce((yt,Et)=>{const xt=createSlot$5(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),COLLAPSIBLE_NAME="Collapsible",[createCollapsibleContext]=createContextScope$4(COLLAPSIBLE_NAME),[CollapsibleProvider,useCollapsibleContext]=createCollapsibleContext(COLLAPSIBLE_NAME),Collapsible$1=reactExports.forwardRef((yt,Et)=>{const{__scopeCollapsible:xt,open:vt,defaultOpen:bt,disabled:At,onOpenChange:Ft,...Ct}=yt,[wt,St]=useControllableState({prop:vt,defaultProp:bt??!1,onChange:Ft,caller:COLLAPSIBLE_NAME});return jsxRuntimeExports.jsx(CollapsibleProvider,{scope:xt,disabled:At,contentId:useId(),open:wt,onOpenToggle:reactExports.useCallback(()=>St(Tt=>!Tt),[St]),children:jsxRuntimeExports.jsx(Primitive$4.div,{"data-state":getState$1(wt),"data-disabled":At?"":void 0,...Ct,ref:Et})})});Collapsible$1.displayName=COLLAPSIBLE_NAME;var TRIGGER_NAME$1="CollapsibleTrigger",CollapsibleTrigger$1=reactExports.forwardRef((yt,Et)=>{const{__scopeCollapsible:xt,...vt}=yt,bt=useCollapsibleContext(TRIGGER_NAME$1,xt);return jsxRuntimeExports.jsx(Primitive$4.button,{type:"button","aria-controls":bt.contentId,"aria-expanded":bt.open||!1,"data-state":getState$1(bt.open),"data-disabled":bt.disabled?"":void 0,disabled:bt.disabled,...vt,ref:Et,onClick:composeEventHandlers(yt.onClick,bt.onOpenToggle)})});CollapsibleTrigger$1.displayName=TRIGGER_NAME$1;var CONTENT_NAME$1="CollapsibleContent",CollapsibleContent$1=reactExports.forwardRef((yt,Et)=>{const{forceMount:xt,...vt}=yt,bt=useCollapsibleContext(CONTENT_NAME$1,yt.__scopeCollapsible);return jsxRuntimeExports.jsx(Presence,{present:xt||bt.open,children:({present:At})=>jsxRuntimeExports.jsx(CollapsibleContentImpl,{...vt,ref:Et,present:At})})});CollapsibleContent$1.displayName=CONTENT_NAME$1;var CollapsibleContentImpl=reactExports.forwardRef((yt,Et)=>{const{__scopeCollapsible:xt,present:vt,children:bt,...At}=yt,Ft=useCollapsibleContext(CONTENT_NAME$1,xt),[Ct,wt]=reactExports.useState(vt),St=reactExports.useRef(null),Tt=useComposedRefs(Et,St),Rt=reactExports.useRef(0),Pt=Rt.current,Lt=reactExports.useRef(0),kt=Lt.current,Ot=Ft.open||Ct,Mt=reactExports.useRef(Ot),It=reactExports.useRef(void 0);return reactExports.useEffect(()=>{const Nt=requestAnimationFrame(()=>Mt.current=!1);return()=>cancelAnimationFrame(Nt)},[]),useLayoutEffect2(()=>{const Nt=St.current;if(Nt){It.current=It.current||{transitionDuration:Nt.style.transitionDuration,animationName:Nt.style.animationName},Nt.style.transitionDuration="0s",Nt.style.animationName="none";const Ut=Nt.getBoundingClientRect();Rt.current=Ut.height,Lt.current=Ut.width,Mt.current||(Nt.style.transitionDuration=It.current.transitionDuration,Nt.style.animationName=It.current.animationName),wt(vt)}},[Ft.open,vt]),jsxRuntimeExports.jsx(Primitive$4.div,{"data-state":getState$1(Ft.open),"data-disabled":Ft.disabled?"":void 0,id:Ft.contentId,hidden:!Ot,...At,ref:Tt,style:{"--radix-collapsible-content-height":Pt?`${Pt}px`:void 0,"--radix-collapsible-content-width":kt?`${kt}px`:void 0,...yt.style},children:Ot&&bt})});function getState$1(yt){return yt?"open":"closed"}var Root$3=Collapsible$1;function Collapsible({...yt}){return jsxRuntimeExports.jsx(Root$3,{"data-slot":"collapsible",...yt})}function CollapsibleTrigger({...yt}){return jsxRuntimeExports.jsx(CollapsibleTrigger$1,{"data-slot":"collapsible-trigger",...yt})}function CollapsibleContent({...yt}){return jsxRuntimeExports.jsx(CollapsibleContent$1,{"data-slot":"collapsible-content",...yt})}function createContextScope$3(yt,Et=[]){let xt=[];function vt(At,Ft){const Ct=reactExports.createContext(Ft),wt=xt.length;xt=[...xt,Ft];const St=Rt=>{const{scope:Pt,children:Lt,...kt}=Rt,Ot=Pt?.[yt]?.[wt]||Ct,Mt=reactExports.useMemo(()=>kt,Object.values(kt));return jsxRuntimeExports.jsx(Ot.Provider,{value:Mt,children:Lt})};St.displayName=At+"Provider";function Tt(Rt,Pt){const Lt=Pt?.[yt]?.[wt]||Ct,kt=reactExports.useContext(Lt);if(kt)return kt;if(Ft!==void 0)return Ft;throw new Error(`\`${Rt}\` must be used within \`${At}\``)}return[St,Tt]}const bt=()=>{const At=xt.map(Ft=>reactExports.createContext(Ft));return function(Ct){const wt=Ct?.[yt]||At;return reactExports.useMemo(()=>({[`__scope${yt}`]:{...Ct,[yt]:wt}}),[Ct,wt])}};return bt.scopeName=yt,[vt,composeContextScopes$3(bt,...Et)]}function composeContextScopes$3(...yt){const Et=yt[0];if(yt.length===1)return Et;const xt=()=>{const vt=yt.map(bt=>({useScope:bt(),scopeName:bt.scopeName}));return function(At){const Ft=vt.reduce((Ct,{useScope:wt,scopeName:St})=>{const Rt=wt(At)[`__scope${St}`];return{...Ct,...Rt}},{});return reactExports.useMemo(()=>({[`__scope${Et.scopeName}`]:Ft}),[Ft])}};return xt.scopeName=Et.scopeName,xt}function usePrevious(yt){const Et=reactExports.useRef({value:yt,previous:yt});return reactExports.useMemo(()=>(Et.current.value!==yt&&(Et.current.previous=Et.current.value,Et.current.value=yt),Et.current.previous),[yt])}function createSlot$4(yt){const Et=createSlotClone$4(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$4);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$4(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$4(bt),Ct=mergeProps$4(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$4=Symbol("radix.slottable");function isSlottable$4(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$4}function mergeProps$4(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$4(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$3=NODES$3.reduce((yt,Et)=>{const xt=createSlot$4(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),SWITCH_NAME="Switch",[createSwitchContext]=createContextScope$3(SWITCH_NAME),[SwitchProvider,useSwitchContext]=createSwitchContext(SWITCH_NAME),Switch$1=reactExports.forwardRef((yt,Et)=>{const{__scopeSwitch:xt,name:vt,checked:bt,defaultChecked:At,required:Ft,disabled:Ct,value:wt="on",onCheckedChange:St,form:Tt,...Rt}=yt,[Pt,Lt]=reactExports.useState(null),kt=useComposedRefs(Et,Ut=>Lt(Ut)),Ot=reactExports.useRef(!1),Mt=Pt?Tt||!!Pt.closest("form"):!0,[It,Nt]=useControllableState({prop:bt,defaultProp:At??!1,onChange:St,caller:SWITCH_NAME});return jsxRuntimeExports.jsxs(SwitchProvider,{scope:xt,checked:It,disabled:Ct,children:[jsxRuntimeExports.jsx(Primitive$3.button,{type:"button",role:"switch","aria-checked":It,"aria-required":Ft,"data-state":getState(It),"data-disabled":Ct?"":void 0,disabled:Ct,value:wt,...Rt,ref:kt,onClick:composeEventHandlers(yt.onClick,Ut=>{Nt(jt=>!jt),Mt&&(Ot.current=Ut.isPropagationStopped(),Ot.current||Ut.stopPropagation())})}),Mt&&jsxRuntimeExports.jsx(SwitchBubbleInput,{control:Pt,bubbles:!Ot.current,name:vt,value:wt,checked:It,required:Ft,disabled:Ct,form:Tt,style:{transform:"translateX(-100%)"}})]})});Switch$1.displayName=SWITCH_NAME;var THUMB_NAME$1="SwitchThumb",SwitchThumb=reactExports.forwardRef((yt,Et)=>{const{__scopeSwitch:xt,...vt}=yt,bt=useSwitchContext(THUMB_NAME$1,xt);return jsxRuntimeExports.jsx(Primitive$3.span,{"data-state":getState(bt.checked),"data-disabled":bt.disabled?"":void 0,...vt,ref:Et})});SwitchThumb.displayName=THUMB_NAME$1;var BUBBLE_INPUT_NAME$2="SwitchBubbleInput",SwitchBubbleInput=reactExports.forwardRef(({__scopeSwitch:yt,control:Et,checked:xt,bubbles:vt=!0,...bt},At)=>{const Ft=reactExports.useRef(null),Ct=useComposedRefs(Ft,At),wt=usePrevious(xt),St=useSize(Et);return reactExports.useEffect(()=>{const Tt=Ft.current;if(!Tt)return;const Rt=window.HTMLInputElement.prototype,Lt=Object.getOwnPropertyDescriptor(Rt,"checked").set;if(wt!==xt&&Lt){const kt=new Event("click",{bubbles:vt});Lt.call(Tt,xt),Tt.dispatchEvent(kt)}},[wt,xt,vt]),jsxRuntimeExports.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:xt,...bt,tabIndex:-1,ref:Ct,style:{...bt.style,...St,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});SwitchBubbleInput.displayName=BUBBLE_INPUT_NAME$2;function getState(yt){return yt?"checked":"unchecked"}var Root$2=Switch$1,Thumb$1=SwitchThumb;function Switch({className:yt,...Et}){return jsxRuntimeExports.jsx(Root$2,{"data-slot":"switch",className:cn("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-3.5 w-7 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",yt),...Et,children:jsxRuntimeExports.jsx(Thumb$1,{"data-slot":"switch-thumb",className:cn("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-2.5 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%+4px)] data-[state=unchecked]:translate-x-0.5")})})}var NAME$1="Label",Label$1=reactExports.forwardRef((yt,Et)=>jsxRuntimeExports.jsx(Primitive$b.label,{...yt,ref:Et,onMouseDown:xt=>{xt.target.closest("button, input, select, textarea")||(yt.onMouseDown?.(xt),!xt.defaultPrevented&&xt.detail>1&&xt.preventDefault())}}));Label$1.displayName=NAME$1;var Root$1=Label$1;function Label({className:yt,...Et}){return jsxRuntimeExports.jsx(Root$1,{"data-slot":"label",className:cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",yt),...Et})}function clamp$4(yt,[Et,xt]){return Math.min(xt,Math.max(Et,yt))}function createContextScope$2(yt,Et=[]){let xt=[];function vt(At,Ft){const Ct=reactExports.createContext(Ft),wt=xt.length;xt=[...xt,Ft];const St=Rt=>{const{scope:Pt,children:Lt,...kt}=Rt,Ot=Pt?.[yt]?.[wt]||Ct,Mt=reactExports.useMemo(()=>kt,Object.values(kt));return jsxRuntimeExports.jsx(Ot.Provider,{value:Mt,children:Lt})};St.displayName=At+"Provider";function Tt(Rt,Pt){const Lt=Pt?.[yt]?.[wt]||Ct,kt=reactExports.useContext(Lt);if(kt)return kt;if(Ft!==void 0)return Ft;throw new Error(`\`${Rt}\` must be used within \`${At}\``)}return[St,Tt]}const bt=()=>{const At=xt.map(Ft=>reactExports.createContext(Ft));return function(Ct){const wt=Ct?.[yt]||At;return reactExports.useMemo(()=>({[`__scope${yt}`]:{...Ct,[yt]:wt}}),[Ct,wt])}};return bt.scopeName=yt,[vt,composeContextScopes$2(bt,...Et)]}function composeContextScopes$2(...yt){const Et=yt[0];if(yt.length===1)return Et;const xt=()=>{const vt=yt.map(bt=>({useScope:bt(),scopeName:bt.scopeName}));return function(At){const Ft=vt.reduce((Ct,{useScope:wt,scopeName:St})=>{const Rt=wt(At)[`__scope${St}`];return{...Ct,...Rt}},{});return reactExports.useMemo(()=>({[`__scope${Et.scopeName}`]:Ft}),[Ft])}};return xt.scopeName=Et.scopeName,xt}function createSlot$3(yt){const Et=createSlotClone$3(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$3);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$3(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$3(bt),Ct=mergeProps$3(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$3=Symbol("radix.slottable");function isSlottable$3(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$3}function mergeProps$3(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$3(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}function createCollection(yt){const Et=yt+"CollectionProvider",[xt,vt]=createContextScope$2(Et),[bt,At]=xt(Et,{collectionRef:{current:null},itemMap:new Map}),Ft=Ot=>{const{scope:Mt,children:It}=Ot,Nt=React.useRef(null),Ut=React.useRef(new Map).current;return jsxRuntimeExports.jsx(bt,{scope:Mt,itemMap:Ut,collectionRef:Nt,children:It})};Ft.displayName=Et;const Ct=yt+"CollectionSlot",wt=createSlot$3(Ct),St=React.forwardRef((Ot,Mt)=>{const{scope:It,children:Nt}=Ot,Ut=At(Ct,It),jt=useComposedRefs(Mt,Ut.collectionRef);return jsxRuntimeExports.jsx(wt,{ref:jt,children:Nt})});St.displayName=Ct;const Tt=yt+"CollectionItemSlot",Rt="data-radix-collection-item",Pt=createSlot$3(Tt),Lt=React.forwardRef((Ot,Mt)=>{const{scope:It,children:Nt,...Ut}=Ot,jt=React.useRef(null),Vt=useComposedRefs(Mt,jt),zt=At(Tt,It);return React.useEffect(()=>(zt.itemMap.set(jt,{ref:jt,...Ut}),()=>{zt.itemMap.delete(jt)})),jsxRuntimeExports.jsx(Pt,{[Rt]:"",ref:Vt,children:Nt})});Lt.displayName=Tt;function kt(Ot){const Mt=At(yt+"CollectionConsumer",Ot);return React.useCallback(()=>{const Nt=Mt.collectionRef.current;if(!Nt)return[];const Ut=Array.from(Nt.querySelectorAll(`[${Rt}]`));return Array.from(Mt.itemMap.values()).sort((zt,Ht)=>Ut.indexOf(zt.ref.current)-Ut.indexOf(Ht.ref.current))},[Mt.collectionRef,Mt.itemMap])}return[{Provider:Ft,Slot:St,ItemSlot:Lt},kt,vt]}function createContextScope$1(yt,Et=[]){let xt=[];function vt(At,Ft){const Ct=reactExports.createContext(Ft),wt=xt.length;xt=[...xt,Ft];const St=Rt=>{const{scope:Pt,children:Lt,...kt}=Rt,Ot=Pt?.[yt]?.[wt]||Ct,Mt=reactExports.useMemo(()=>kt,Object.values(kt));return jsxRuntimeExports.jsx(Ot.Provider,{value:Mt,children:Lt})};St.displayName=At+"Provider";function Tt(Rt,Pt){const Lt=Pt?.[yt]?.[wt]||Ct,kt=reactExports.useContext(Lt);if(kt)return kt;if(Ft!==void 0)return Ft;throw new Error(`\`${Rt}\` must be used within \`${At}\``)}return[St,Tt]}const bt=()=>{const At=xt.map(Ft=>reactExports.createContext(Ft));return function(Ct){const wt=Ct?.[yt]||At;return reactExports.useMemo(()=>({[`__scope${yt}`]:{...Ct,[yt]:wt}}),[Ct,wt])}};return bt.scopeName=yt,[vt,composeContextScopes$1(bt,...Et)]}function composeContextScopes$1(...yt){const Et=yt[0];if(yt.length===1)return Et;const xt=()=>{const vt=yt.map(bt=>({useScope:bt(),scopeName:bt.scopeName}));return function(At){const Ft=vt.reduce((Ct,{useScope:wt,scopeName:St})=>{const Rt=wt(At)[`__scope${St}`];return{...Ct,...Rt}},{});return reactExports.useMemo(()=>({[`__scope${Et.scopeName}`]:Ft}),[Ft])}};return xt.scopeName=Et.scopeName,xt}var DirectionContext=reactExports.createContext(void 0);function useDirection(yt){const Et=reactExports.useContext(DirectionContext);return yt||Et||"ltr"}var count$1=0;function useFocusGuards(){reactExports.useEffect(()=>{const yt=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",yt[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",yt[1]??createFocusGuard()),count$1++,()=>{count$1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(Et=>Et.remove()),count$1--}},[])}function createFocusGuard(){const yt=document.createElement("span");return yt.setAttribute("data-radix-focus-guard",""),yt.tabIndex=0,yt.style.outline="none",yt.style.opacity="0",yt.style.position="fixed",yt.style.pointerEvents="none",yt}function createSlot$2(yt){const Et=createSlotClone$2(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$2);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$2(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$2(bt),Ct=mergeProps$2(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$2=Symbol("radix.slottable");function isSlottable$2(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$2}function mergeProps$2(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$2(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$2=NODES$2.reduce((yt,Et)=>{const xt=createSlot$2(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),AUTOFOCUS_ON_MOUNT="focusScope.autoFocusOnMount",AUTOFOCUS_ON_UNMOUNT="focusScope.autoFocusOnUnmount",EVENT_OPTIONS={bubbles:!1,cancelable:!0},FOCUS_SCOPE_NAME="FocusScope",FocusScope=reactExports.forwardRef((yt,Et)=>{const{loop:xt=!1,trapped:vt=!1,onMountAutoFocus:bt,onUnmountAutoFocus:At,...Ft}=yt,[Ct,wt]=reactExports.useState(null),St=useCallbackRef$2(bt),Tt=useCallbackRef$2(At),Rt=reactExports.useRef(null),Pt=useComposedRefs(Et,Ot=>wt(Ot)),Lt=reactExports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;reactExports.useEffect(()=>{if(vt){let Ot=function(Ut){if(Lt.paused||!Ct)return;const jt=Ut.target;Ct.contains(jt)?Rt.current=jt:focus(Rt.current,{select:!0})},Mt=function(Ut){if(Lt.paused||!Ct)return;const jt=Ut.relatedTarget;jt!==null&&(Ct.contains(jt)||focus(Rt.current,{select:!0}))},It=function(Ut){if(document.activeElement===document.body)for(const Vt of Ut)Vt.removedNodes.length>0&&focus(Ct)};document.addEventListener("focusin",Ot),document.addEventListener("focusout",Mt);const Nt=new MutationObserver(It);return Ct&&Nt.observe(Ct,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",Ot),document.removeEventListener("focusout",Mt),Nt.disconnect()}}},[vt,Ct,Lt.paused]),reactExports.useEffect(()=>{if(Ct){focusScopesStack.add(Lt);const Ot=document.activeElement;if(!Ct.contains(Ot)){const It=new CustomEvent(AUTOFOCUS_ON_MOUNT,EVENT_OPTIONS);Ct.addEventListener(AUTOFOCUS_ON_MOUNT,St),Ct.dispatchEvent(It),It.defaultPrevented||(focusFirst(removeLinks(getTabbableCandidates(Ct)),{select:!0}),document.activeElement===Ot&&focus(Ct))}return()=>{Ct.removeEventListener(AUTOFOCUS_ON_MOUNT,St),setTimeout(()=>{const It=new CustomEvent(AUTOFOCUS_ON_UNMOUNT,EVENT_OPTIONS);Ct.addEventListener(AUTOFOCUS_ON_UNMOUNT,Tt),Ct.dispatchEvent(It),It.defaultPrevented||focus(Ot??document.body,{select:!0}),Ct.removeEventListener(AUTOFOCUS_ON_UNMOUNT,Tt),focusScopesStack.remove(Lt)},0)}}},[Ct,St,Tt,Lt]);const kt=reactExports.useCallback(Ot=>{if(!xt&&!vt||Lt.paused)return;const Mt=Ot.key==="Tab"&&!Ot.altKey&&!Ot.ctrlKey&&!Ot.metaKey,It=document.activeElement;if(Mt&&It){const Nt=Ot.currentTarget,[Ut,jt]=getTabbableEdges(Nt);Ut&&jt?!Ot.shiftKey&&It===jt?(Ot.preventDefault(),xt&&focus(Ut,{select:!0})):Ot.shiftKey&&It===Ut&&(Ot.preventDefault(),xt&&focus(jt,{select:!0})):It===Nt&&Ot.preventDefault()}},[xt,vt,Lt.paused]);return jsxRuntimeExports.jsx(Primitive$2.div,{tabIndex:-1,...Ft,ref:Pt,onKeyDown:kt})});FocusScope.displayName=FOCUS_SCOPE_NAME;function focusFirst(yt,{select:Et=!1}={}){const xt=document.activeElement;for(const vt of yt)if(focus(vt,{select:Et}),document.activeElement!==xt)return}function getTabbableEdges(yt){const Et=getTabbableCandidates(yt),xt=findVisible(Et,yt),vt=findVisible(Et.reverse(),yt);return[xt,vt]}function getTabbableCandidates(yt){const Et=[],xt=document.createTreeWalker(yt,NodeFilter.SHOW_ELEMENT,{acceptNode:vt=>{const bt=vt.tagName==="INPUT"&&vt.type==="hidden";return vt.disabled||vt.hidden||bt?NodeFilter.FILTER_SKIP:vt.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;xt.nextNode();)Et.push(xt.currentNode);return Et}function findVisible(yt,Et){for(const xt of yt)if(!isHidden(xt,{upTo:Et}))return xt}function isHidden(yt,{upTo:Et}){if(getComputedStyle(yt).visibility==="hidden")return!0;for(;yt;){if(Et!==void 0&&yt===Et)return!1;if(getComputedStyle(yt).display==="none")return!0;yt=yt.parentElement}return!1}function isSelectableInput(yt){return yt instanceof HTMLInputElement&&"select"in yt}function focus(yt,{select:Et=!1}={}){if(yt&&yt.focus){const xt=document.activeElement;yt.focus({preventScroll:!0}),yt!==xt&&isSelectableInput(yt)&&Et&&yt.select()}}var focusScopesStack=createFocusScopesStack();function createFocusScopesStack(){let yt=[];return{add(Et){const xt=yt[0];Et!==xt&&xt?.pause(),yt=arrayRemove(yt,Et),yt.unshift(Et)},remove(Et){yt=arrayRemove(yt,Et),yt[0]?.resume()}}}function arrayRemove(yt,Et){const xt=[...yt],vt=xt.indexOf(Et);return vt!==-1&&xt.splice(vt,1),xt}function removeLinks(yt){return yt.filter(Et=>Et.tagName!=="A")}function createSlot$1(yt){const Et=createSlotClone$1(yt),xt=reactExports.forwardRef((vt,bt)=>{const{children:At,...Ft}=vt,Ct=reactExports.Children.toArray(At),wt=Ct.find(isSlottable$1);if(wt){const St=wt.props.children,Tt=Ct.map(Rt=>Rt===wt?reactExports.Children.count(St)>1?reactExports.Children.only(null):reactExports.isValidElement(St)?St.props.children:null:Rt);return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:reactExports.isValidElement(St)?reactExports.cloneElement(St,void 0,Tt):null})}return jsxRuntimeExports.jsx(Et,{...Ft,ref:bt,children:At})});return xt.displayName=`${yt}.Slot`,xt}function createSlotClone$1(yt){const Et=reactExports.forwardRef((xt,vt)=>{const{children:bt,...At}=xt;if(reactExports.isValidElement(bt)){const Ft=getElementRef$1(bt),Ct=mergeProps$1(At,bt.props);return bt.type!==reactExports.Fragment&&(Ct.ref=vt?composeRefs(vt,Ft):Ft),reactExports.cloneElement(bt,Ct)}return reactExports.Children.count(bt)>1?reactExports.Children.only(null):null});return Et.displayName=`${yt}.SlotClone`,Et}var SLOTTABLE_IDENTIFIER$1=Symbol("radix.slottable");function isSlottable$1(yt){return reactExports.isValidElement(yt)&&typeof yt.type=="function"&&"__radixId"in yt.type&&yt.type.__radixId===SLOTTABLE_IDENTIFIER$1}function mergeProps$1(yt,Et){const xt={...Et};for(const vt in Et){const bt=yt[vt],At=Et[vt];/^on[A-Z]/.test(vt)?bt&&At?xt[vt]=(...Ct)=>{const wt=At(...Ct);return bt(...Ct),wt}:bt&&(xt[vt]=bt):vt==="style"?xt[vt]={...bt,...At}:vt==="className"&&(xt[vt]=[bt,At].filter(Boolean).join(" "))}return{...yt,...xt}}function getElementRef$1(yt){let Et=Object.getOwnPropertyDescriptor(yt.props,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning;return xt?yt.ref:(Et=Object.getOwnPropertyDescriptor(yt,"ref")?.get,xt=Et&&"isReactWarning"in Et&&Et.isReactWarning,xt?yt.props.ref:yt.props.ref||yt.ref)}var NODES$1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive$1=NODES$1.reduce((yt,Et)=>{const xt=createSlot$1(`Primitive.${Et}`),vt=reactExports.forwardRef((bt,At)=>{const{asChild:Ft,...Ct}=bt,wt=Ft?xt:Et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(wt,{...Ct,ref:At})});return vt.displayName=`Primitive.${Et}`,{...yt,[Et]:vt}},{}),getDefaultParent=function(yt){if(typeof document>"u")return null;var Et=Array.isArray(yt)?yt[0]:yt;return Et.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(yt){return yt&&(yt.host||unwrapHost(yt.parentNode))},correctTargets=function(yt,Et){return Et.map(function(xt){if(yt.contains(xt))return xt;var vt=unwrapHost(xt);return vt&&yt.contains(vt)?vt:(console.error("aria-hidden",xt,"in not contained inside",yt,". Doing nothing"),null)}).filter(function(xt){return!!xt})},applyAttributeToOthers=function(yt,Et,xt,vt){var bt=correctTargets(Et,Array.isArray(yt)?yt:[yt]);markerMap[xt]||(markerMap[xt]=new WeakMap);var At=markerMap[xt],Ft=[],Ct=new Set,wt=new Set(bt),St=function(Rt){!Rt||Ct.has(Rt)||(Ct.add(Rt),St(Rt.parentNode))};bt.forEach(St);var Tt=function(Rt){!Rt||wt.has(Rt)||Array.prototype.forEach.call(Rt.children,function(Pt){if(Ct.has(Pt))Tt(Pt);else try{var Lt=Pt.getAttribute(vt),kt=Lt!==null&&Lt!=="false",Ot=(counterMap.get(Pt)||0)+1,Mt=(At.get(Pt)||0)+1;counterMap.set(Pt,Ot),At.set(Pt,Mt),Ft.push(Pt),Ot===1&&kt&&uncontrolledNodes.set(Pt,!0),Mt===1&&Pt.setAttribute(xt,"true"),kt||Pt.setAttribute(vt,"true")}catch(It){console.error("aria-hidden: cannot operate on ",Pt,It)}})};return Tt(Et),Ct.clear(),lockCount++,function(){Ft.forEach(function(Rt){var Pt=counterMap.get(Rt)-1,Lt=At.get(Rt)-1;counterMap.set(Rt,Pt),At.set(Rt,Lt),Pt||(uncontrolledNodes.has(Rt)||Rt.removeAttribute(vt),uncontrolledNodes.delete(Rt)),Lt||Rt.removeAttribute(xt)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(yt,Et,xt){xt===void 0&&(xt="data-aria-hidden");var vt=Array.from(Array.isArray(yt)?yt:[yt]),bt=getDefaultParent(yt);return bt?(vt.push.apply(vt,Array.from(bt.querySelectorAll("[aria-live], script"))),applyAttributeToOthers(vt,bt,xt,"aria-hidden")):function(){return null}},__assign=function(){return __assign=Object.assign||function(Et){for(var xt,vt=1,bt=arguments.length;vt<bt;vt++){xt=arguments[vt];for(var At in xt)Object.prototype.hasOwnProperty.call(xt,At)&&(Et[At]=xt[At])}return Et},__assign.apply(this,arguments)};function __rest$1(yt,Et){var xt={};for(var vt in yt)Object.prototype.hasOwnProperty.call(yt,vt)&&Et.indexOf(vt)<0&&(xt[vt]=yt[vt]);if(yt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var bt=0,vt=Object.getOwnPropertySymbols(yt);bt<vt.length;bt++)Et.indexOf(vt[bt])<0&&Object.prototype.propertyIsEnumerable.call(yt,vt[bt])&&(xt[vt[bt]]=yt[vt[bt]]);return xt}function __spreadArray(yt,Et,xt){if(xt||arguments.length===2)for(var vt=0,bt=Et.length,At;vt<bt;vt++)(At||!(vt in Et))&&(At||(At=Array.prototype.slice.call(Et,0,vt)),At[vt]=Et[vt]);return yt.concat(At||Array.prototype.slice.call(Et))}typeof SuppressedError=="function"&&SuppressedError;var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";function assignRef(yt,Et){return typeof yt=="function"?yt(Et):yt&&(yt.current=Et),yt}function useCallbackRef$1(yt,Et){var xt=reactExports.useState(function(){return{value:yt,callback:Et,facade:{get current(){return xt.value},set current(vt){var bt=xt.value;bt!==vt&&(xt.value=vt,xt.callback(vt,bt))}}}})[0];return xt.callback=Et,xt.facade}var useIsomorphicLayoutEffect$1=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,currentValues=new WeakMap;function useMergeRefs(yt,Et){var xt=useCallbackRef$1(null,function(vt){return yt.forEach(function(bt){return assignRef(bt,vt)})});return useIsomorphicLayoutEffect$1(function(){var vt=currentValues.get(xt);if(vt){var bt=new Set(vt),At=new Set(yt),Ft=xt.current;bt.forEach(function(Ct){At.has(Ct)||assignRef(Ct,null)}),At.forEach(function(Ct){bt.has(Ct)||assignRef(Ct,Ft)})}currentValues.set(xt,yt)},[yt]),xt}function ItoI(yt){return yt}function innerCreateMedium(yt,Et){Et===void 0&&(Et=ItoI);var xt=[],vt=!1,bt={read:function(){if(vt)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return xt.length?xt[xt.length-1]:yt},useMedium:function(At){var Ft=Et(At,vt);return xt.push(Ft),function(){xt=xt.filter(function(Ct){return Ct!==Ft})}},assignSyncMedium:function(At){for(vt=!0;xt.length;){var Ft=xt;xt=[],Ft.forEach(At)}xt={push:function(Ct){return At(Ct)},filter:function(){return xt}}},assignMedium:function(At){vt=!0;var Ft=[];if(xt.length){var Ct=xt;xt=[],Ct.forEach(At),Ft=xt}var wt=function(){var Tt=Ft;Ft=[],Tt.forEach(At)},St=function(){return Promise.resolve().then(wt)};St(),xt={push:function(Tt){Ft.push(Tt),St()},filter:function(Tt){return Ft=Ft.filter(Tt),xt}}}};return bt}function createSidecarMedium(yt){yt===void 0&&(yt={});var Et=innerCreateMedium(null);return Et.options=__assign({async:!0,ssr:!1},yt),Et}var SideCar$1=function(yt){var Et=yt.sideCar,xt=__rest$1(yt,["sideCar"]);if(!Et)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var vt=Et.read();if(!vt)throw new Error("Sidecar medium not found");return reactExports.createElement(vt,__assign({},xt))};SideCar$1.isSideCarExport=!0;function exportSidecar(yt,Et){return yt.useMedium(Et),SideCar$1}var effectCar=createSidecarMedium(),nothing=function(){},RemoveScroll=reactExports.forwardRef(function(yt,Et){var xt=reactExports.useRef(null),vt=reactExports.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),bt=vt[0],At=vt[1],Ft=yt.forwardProps,Ct=yt.children,wt=yt.className,St=yt.removeScrollBar,Tt=yt.enabled,Rt=yt.shards,Pt=yt.sideCar,Lt=yt.noRelative,kt=yt.noIsolation,Ot=yt.inert,Mt=yt.allowPinchZoom,It=yt.as,Nt=It===void 0?"div":It,Ut=yt.gapMode,jt=__rest$1(yt,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),Vt=Pt,zt=useMergeRefs([xt,Et]),Ht=__assign(__assign({},jt),bt);return reactExports.createElement(reactExports.Fragment,null,Tt&&reactExports.createElement(Vt,{sideCar:effectCar,removeScrollBar:St,shards:Rt,noRelative:Lt,noIsolation:kt,inert:Ot,setCallbacks:At,allowPinchZoom:!!Mt,lockRef:xt,gapMode:Ut}),Ft?reactExports.cloneElement(reactExports.Children.only(Ct),__assign(__assign({},Ht),{ref:zt})):reactExports.createElement(Nt,__assign({},Ht,{className:wt,ref:zt}),Ct))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var getNonce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var yt=document.createElement("style");yt.type="text/css";var Et=getNonce();return Et&&yt.setAttribute("nonce",Et),yt}function injectStyles(yt,Et){yt.styleSheet?yt.styleSheet.cssText=Et:yt.appendChild(document.createTextNode(Et))}function insertStyleTag(yt){var Et=document.head||document.getElementsByTagName("head")[0];Et.appendChild(yt)}var stylesheetSingleton=function(){var yt=0,Et=null;return{add:function(xt){yt==0&&(Et=makeStyleTag())&&(injectStyles(Et,xt),insertStyleTag(Et)),yt++},remove:function(){yt--,!yt&&Et&&(Et.parentNode&&Et.parentNode.removeChild(Et),Et=null)}}},styleHookSingleton=function(){var yt=stylesheetSingleton();return function(Et,xt){reactExports.useEffect(function(){return yt.add(Et),function(){yt.remove()}},[Et&&xt])}},styleSingleton=function(){var yt=styleHookSingleton(),Et=function(xt){var vt=xt.styles,bt=xt.dynamic;return yt(vt,bt),null};return Et},zeroGap={left:0,top:0,right:0,gap:0},parse$1=function(yt){return parseInt(yt||"",10)||0},getOffset=function(yt){var Et=window.getComputedStyle(document.body),xt=Et[yt==="padding"?"paddingLeft":"marginLeft"],vt=Et[yt==="padding"?"paddingTop":"marginTop"],bt=Et[yt==="padding"?"paddingRight":"marginRight"];return[parse$1(xt),parse$1(vt),parse$1(bt)]},getGapWidth=function(yt){if(yt===void 0&&(yt="margin"),typeof window>"u")return zeroGap;var Et=getOffset(yt),xt=document.documentElement.clientWidth,vt=window.innerWidth;return{left:Et[0],top:Et[1],right:Et[2],gap:Math.max(0,vt-xt+Et[2]-Et[0])}},Style=styleSingleton(),lockAttribute="data-scroll-locked",getStyles=function(yt,Et,xt,vt){var bt=yt.left,At=yt.top,Ft=yt.right,Ct=yt.gap;return xt===void 0&&(xt="margin"),`
|
|
10
10
|
.`.concat(noScrollbarsClassName,` {
|
|
11
11
|
overflow: hidden `).concat(vt,`;
|
|
12
12
|
padding-right: `).concat(Ct,"px ").concat(vt,`;
|
|
@@ -2790,7 +2790,7 @@ DECKGL_FILTER_COLOR(fragColor, geometry);
|
|
|
2790
2790
|
`,pr+=`<!-- Scale: ${Mn.scale.toFixed(3)}x -->
|
|
2791
2791
|
`,pr+=`<!-- Original size: ${Mn.originalWidth.toFixed(0)}×${Mn.originalHeight.toFixed(0)}px -->
|
|
2792
2792
|
`);const wr=At.background||"#ffffff";pr+=`<rect width='${fn}' height='${mn}' fill='${wr}'/>`;let xr;if(kt)isFinite(Xt)?xr=Gt(Xt)+10:xr=mn-Rt-20;else if(Ot&&xn!==1){const ar=Qt*xn,Qn=pn-Rt,Cn=Qn/2,Bn=Cn-ar/2,In=Bn+ar;xr=In+10,console.log("🖼️ Scale to format ruler calc:",{scaledHeight:ar,availableHeight:Qn,yCenter:Cn,contentStartY:Bn,contentEndY:In,rulerTopY:xr})}else isFinite(Xt)?xr=Gt(Xt)-yn+10:xr=Qt;console.log("🖼️ Ruler positioning:",{useGuidesCrop:kt,useFormatDimensions:Ot,contentScale:xn,actualMinWorldY:Xt,rulerTopY:xr,totalSVGHeight:mn,rulerHeight:Rt});const Dr=bt?xr:mn;pr+="<defs>",pr+=`<clipPath id='viz-clip'><rect x='0' y='0' width='${fn}' height='${Dr}'/></clipPath>`,pr+="</defs>",pr+="<g id='visualization' clip-path='url(#viz-clip)'>";for(const ar of yt){const Qn=ar.props;if(Qn.visible===!1)continue;const Cn=ar.id==="domains"||ar.id.startsWith("domains-"),Bn=ar.id==="region-polygons";if(ar.id==="genes"||ar.id==="protein-polygons"||ar.id==="nucleotide-polygons"||Cn||ar.id==="ncrna-features"||Bn)for(const In of Qn.data){const or=Qn.getPolygon(In),rr=Qn.getFillColor(In);let vr=[0,0,0,255],cr="none",gn=1;if(ar.id==="genes"||ar.id==="ncrna-features"){typeof Qn.getLineColor=="function"?vr=Qn.getLineColor(In):Array.isArray(Qn.getLineColor)&&(vr=Qn.getLineColor);const Or=colorToStr(vr);cr=vr[3]===0||Or==="none"?"none":Or,gn=vt?.gene?.edgeWidth||1}else Cn?(vr=At.text||vt?.colors?.black||[0,0,0,255],cr=colorToStr(vr),gn=vt?.domain?.edgeWidth||1):Bn&&(typeof Qn.getLineColor=="function"?vr=Qn.getLineColor(In):In.strokeColor&&(vr=In.strokeColor),cr=colorToStr(vr),typeof Qn.getLineWidth=="function"?gn=Qn.getLineWidth(In):In.strokeWidth?gn=In.strokeWidth:gn=2);const wn=colorToStr(rr),Xn=getOpacity(rr),tr=getOpacity(vr),Hn=dr(or,It,Nt,Ut,jt);if(!Hn||Hn.length===0)continue;let _n=Hn.map(Or=>Rn(Or)).map((Or,hn)=>hn===0?`M${Or[0]},${Or[1]}`:`L${Or[0]},${Or[1]}`).join(" ")+"Z",yr="";Xn<1&&(yr+=` fill-opacity='${Xn}'`),tr<1&&(yr+=` stroke-opacity='${tr}'`),pr+=`<path d='${_n}' fill='${wn}' stroke='${cr}' stroke-width='${gn}'${yr}/>`}if(ar.id==="region-outlines"){const In=Qn.getDashArray||[6,4],or=Array.isArray(In)?In.join(","):"6,4";for(const rr of Qn.data){let vr=[];if(typeof Qn.getPath=="function"?vr=Qn.getPath(rr):vr=rr.polygon||rr.path||[],!vr||vr.length<2)continue;let cr=[100,100,100,255];if(rr.strokeColor)cr=rr.strokeColor;else if(Qn.getColor)if(typeof Qn.getColor=="function")try{cr=Qn.getColor(rr)}catch{cr=[100,100,100,255]}else Array.isArray(Qn.getColor)&&(cr=Qn.getColor);let gn=rr.strokeWidth||2;if(Qn.getWidth)if(typeof Qn.getWidth=="function")try{gn=Qn.getWidth(rr)}catch{gn=2}else gn=Qn.getWidth;const wn=colorToStr(cr),Xn=getOpacity(cr),tr=Cr(vr,It,Nt,Ut,jt);if(!tr||tr.length===0)continue;const Kn=tr.map(_n=>Rn(_n)).map((_n,yr)=>yr===0?`M${_n[0]},${_n[1]}`:`L${_n[0]},${_n[1]}`).join(" ")+" Z";pr+=`<path d='${Kn}' fill='none' stroke='${wn}' stroke-width='${gn}' stroke-dasharray='${or}'${Xn<1?` stroke-opacity='${Xn}'`:""}/>`}}if(ar.id==="phylo-tree")for(const In of Qn.data){let or=[];typeof Qn.getPath=="function"?or=Qn.getPath(In):Array.isArray(Qn.getPath)&&(or=Qn.getPath);let rr=[0,0,0,255];if(In.color)rr=In.color;else if(Qn.getColor)if(typeof Qn.getColor=="function")try{rr=Qn.getColor(In)}catch{rr=Qn.getColor()}else Array.isArray(Qn.getColor)&&(rr=Qn.getColor);const vr=colorToStr(rr),cr=Cr(or,It,Nt,Ut,jt);if(!cr||cr.length===0)continue;const wn=cr.map(Xn=>Rn(Xn)).map((Xn,tr)=>tr===0?`M${Xn[0]},${Xn[1]}`:`L${Xn[0]},${Xn[1]}`).join(" ");pr+=`<path d='${wn}' fill='none' stroke='${vr}' stroke-width='1'/>`}if(ar.id==="connecting-lines"||ar.id==="hoods")for(const In of Qn.data){const or=In.sourcePosition||(Qn.getSourcePosition?Qn.getSourcePosition(In):[0,0]),rr=In.targetPosition||(Qn.getTargetPosition?Qn.getTargetPosition(In):[0,0]);let vr=[0,0,0,255];if(In.color)vr=In.color;else if(Qn.getColor)if(typeof Qn.getColor=="function")try{vr=Qn.getColor(In)}catch{try{vr=Qn.getColor()}catch{vr=[0,0,0,255]}}else Array.isArray(Qn.getColor)&&(vr=Qn.getColor);let cr=1;if(ar.id==="hoods")cr=vt?.stroke?.hoodWidth||vt?.hood?.width||.25;else if(In.width)cr=In.width;else if(Qn.getWidth)if(typeof Qn.getWidth=="function")try{cr=Qn.getWidth(In)}catch{try{cr=Qn.getWidth()}catch{cr=1}}else cr=Qn.getWidth;const gn=colorToStr(vr),wn=Fr(or[0],or[1],rr[0],rr[1],It,Nt,Ut,jt);if(!wn)continue;const[Xn,tr,Hn,Kn]=wn,[_n,yr]=Rn([Xn,tr]),[Or,hn]=Rn([Hn,Kn]);pr+=`<line x1="${_n}" y1="${yr}" x2="${Or}" y2="${hn}" stroke="${gn}" stroke-width="${cr}" />`}if(ar.id==="nodes"||ar.id==="tree-nodes")for(const In of Qn.data){const or=In.position||(Qn.getPosition?Qn.getPosition(In):[0,0]),rr=In.color||(Qn.getFillColor?Qn.getFillColor(In):[0,0,0,255]),vr=In.radius||(Qn.getRadius?Qn.getRadius(In):5),[cr,gn]=Rn(or);if(!_r([cr,gn]))continue;const wn=colorToStr(rr),Xn=(vr||1)*br;pr+=`<circle cx="${cr}" cy="${gn}" r="${Xn}" fill="${wn}" />`}if(ar.id==="phylo-labels"||ar.id==="gene-labels"||ar.id==="scale-labels")for(const In of Qn.data){const or=In.position||(Qn.getPosition?typeof Qn.getPosition=="function"?Qn.getPosition(In):Qn.getPosition:[0,0]),rr=In.text||(Qn.getText?typeof Qn.getText=="function"?Qn.getText(In):Qn.getText:""),vr=In.color||(Qn.getColor?typeof Qn.getColor=="function"?Qn.getColor(In):Qn.getColor:[0,0,0,255]),cr=In.size||(Qn.getSize?typeof Qn.getSize=="function"?Qn.getSize(In):Qn.getSize:14),gn=colorToStr(vr),wn=getOpacity(vr);let[Xn,tr]=Rn(or);if(!_r([Xn,tr]))continue;const Hn=In.textAnchor||(Qn.getTextAnchor?typeof Qn.getTextAnchor=="function"?Qn.getTextAnchor(In):Qn.getTextAnchor:"start");let Kn=In.pixelOffset;Kn===void 0&&Qn.getPixelOffset&&(typeof Qn.getPixelOffset=="function"?Kn=Qn.getPixelOffset(In):Array.isArray(Qn.getPixelOffset)&&(Kn=Qn.getPixelOffset)),Array.isArray(Kn)&&Kn.length===2&&(Xn+=Kn[0],tr+=Kn[1]);const _n=Math.max(.1,(cr||12)*Wn);let yr="alphabetic",Or=0;if(ar.id==="phylo-labels")yr="middle",Or=0;else if(ar.id==="gene-labels")switch((In.alignmentBaseline||(Qn.getAlignmentBaseline?typeof Qn.getAlignmentBaseline=="function"?Qn.getAlignmentBaseline(In):Qn.getAlignmentBaseline:"top")||"top").toString().toLowerCase()){case"top":yr="hanging",Or=_n*.2;break;case"center":case"middle":yr="middle",Or=0;break;case"bottom":yr="alphabetic",Or=-_n*.25;break;default:yr="middle",Or=0}if(ar.id==="phylo-labels"&&Qn.background){let An=[255,255,255,255];Qn.getBackgroundColor&&(typeof Qn.getBackgroundColor=="function"?An=Qn.getBackgroundColor(In):Array.isArray(Qn.getBackgroundColor)&&(An=Qn.getBackgroundColor));const nr=Qn.backgroundPadding||[2,1,2,1],gr=colorToStr(An),ii=rr.length*_n*.6,ti=_n,di=Xn-nr[0]-(Hn==="middle"?ii/2:Hn==="end"?ii:0),Bi=tr-ti/2-nr[1],as=ii+nr[0]+nr[2],ki=ti+nr[1]+nr[3];pr+=`<rect x="${di}" y="${Bi}" width="${as}" height="${ki}" fill="${gr}" />`}let hn=0;yr==="hanging"?hn=_n*.85:yr==="middle"?hn=_n*.35:(yr==="alphabetic"||yr==="baseline")&&(hn=0);const Ar=tr+Or+hn,hr=wn<1?` fill-opacity="${wn}"`:"";pr+=`<text x="${Xn}" y="${Ar}" fill="${gn}"${hr} font-size="${_n}px" font-family="sans-serif" text-anchor="${Hn}">${rr}</text>`}}if(pr+="</g>",console.log("🎯 Ruler section - checking conditions:",{hasRulerOptions:!!bt,hasConfig:!!bt?.config,hasWidth:typeof bt?.width,hasHeight:typeof bt?.height,hasPrecomputedTicks:!!bt?.precomputedTicks,ticksLength:bt?.precomputedTicks?.length}),bt&&bt.config&&typeof bt.width=="number"&&typeof bt.height=="number"){const{minX:ar,maxX:Qn,config:Cn,viewState:Bn,alignmentReferencePoint:In,bounds:or,genomeView:rr,precomputedTicks:vr}=bt;bt.width,bt.height;const cr=Cn||vt;if(console.log("🎯 Ruler section - inside condition, precomputedTicks:",vr?.length),vr&&Array.isArray(vr)){const _i=At.text||(At.background==="#ffffff"?"#666":"#aaa"),ci=At.text||(At.background==="#ffffff"?"#333":"#ccc"),xi=At.text||(At.background==="#ffffff"?"#666":"#aaa");console.log("🎯 Ruler rendering with rulerScaleFactor:",$n,"base fontSize: 11 -> scaled:",11*$n),cr.ruler.height*$n;const mi=xr,wi=cr.ruler.tickHeight*$n,vi=cr.ruler.labelOffset*$n,qi=11*$n;pr+="<g id='ruler'>";const ji=In||0,ls=(cr.genome&&typeof cr.genome.xScalePercent=="number"?cr.genome.xScalePercent:100)/100,xs=Mi=>Mi*ls+ji,$s=Mi=>{const Wa=xs(Mi.x),[Wi]=Rn([Wa,0]);return Wi},Is=vr.slice(0,3);console.log("🎯 Ruler debug - sample ticks:",Is.map(Mi=>({relativeX:Mi.x,worldX:xs(Mi.x),screenX:Mi.screenX,type:Mi.type,computedSvgX:$s(Mi)}))),console.log("🎯 Ruler debug - bounds:",{min_x:It,max_x:Nt,svgWidth:Vt,xOffset:vn,contentScale:xn,useFormatDimensions:Ot,compactWidth:ln,finalWidth:fn,alignmentRef:ji,genomeXScaleValue:ls});const Hs=vr.filter(Mi=>Mi&&typeof Mi.x=="number"&&isFinite(Mi.x)).map(Mi=>$s(Mi)),ws=10,Es=Math.max(0,Math.min(...Hs)-ws),Ds=Math.min(fn,Math.max(...Hs)+ws);pr+=`<line x1='${Es}' y1='${mi}' x2='${Ds}' y2='${mi}' stroke='${_i}' stroke-width='0.5'/>`;const Fa=vr.filter(Mi=>Mi&&Mi.type&&typeof Mi.x=="number"&&isFinite(Mi.x)).map(Mi=>({...Mi,worldX:xs(Mi.x),screenX:$s(Mi)})).filter(Mi=>Mi.screenX>=0&&Mi.screenX<=fn);console.log("🎯 SVG Export: filtered ticks:",Fa.length,{contentScale:xn,useFormatDimensions:Ot});const oa=bt.showTreeLayer===!0||bt.showTreeTextLayer===!0?Fa.filter(Mi=>Mi.type==="tree"&&Mi.isScale):[],aa=Fa.filter(Mi=>Mi.type==="gene");pr+="<g id='ruler-tree'>";for(const Mi of oa)pr+=`<line x1='${Mi.screenX}' y1='${mi}' x2='${Mi.screenX}' y2='${mi+wi/2}' stroke='${xi}' stroke-width='1'/>`,pr+=`<text x='${Mi.screenX}' y='${mi+vi}' text-anchor='middle' font-size='${qi}px' fill='${xi}' font-family='Helvetica, Arial, sans-serif' font-weight='bold'>${Mi.label}</text>`;pr+="</g>",pr+="<g id='ruler-genes'>";for(const Mi of aa)pr+=`<line x1='${Mi.screenX}' y1='${mi}' x2='${Mi.screenX}' y2='${mi+wi}' stroke='${_i}' stroke-width='1'/>`,pr+=`<text x='${Mi.screenX}' y='${mi+vi}' text-anchor='middle' font-size='${qi}px' fill='${ci}' font-family='Helvetica, Arial, sans-serif'>${formatCoordinate(Mi.x)}</text>`;if(aa.length>1)for(let Mi=0;Mi<aa.length-1;Mi++){const Wa=aa[Mi],Wi=aa[Mi+1];if(Wi.x-Wa.x>20){const ys=Wa.screenX+(Wi.screenX-Wa.screenX)/2;ys>=0&&ys<=fn&&(pr+=`<line x1='${ys}' y1='${mi}' x2='${ys}' y2='${mi+wi/2}' stroke='${_i}' stroke-width='0.5'/>`)}}return pr+="</g>",pr+="</g>",pr+="</svg>",pr}(cr.ruler?.height||36)*$n;const gn=xr,wn=(cr.ruler?.tickHeight||8)*$n,Xn=(cr.ruler?.labelOffset||24)*$n,tr=11*$n,Hn=At.text||(At.background==="#ffffff"?"#666":"#aaa"),Kn=At.text||(At.background==="#ffffff"?"#333":"#ccc"),_n=At.text||(At.background==="#ffffff"?"#666":"#aaa");let yr=null;if(rr&&rr.nucleotidesBySeqid){let _i=1/0;Object.values(rr.nucleotidesBySeqid).forEach(ci=>{ci.hood&&(_i=Math.min(_i,Math.min(ci.hood.start,ci.hood.end)))}),isFinite(_i)&&(yr=_i)}const Or=_i=>{const[ci]=Rn([_i,0]);return ci},hn=yr!==null?Or(yr):0,Ar=[],hr=[],An=[],nr=or?.minX??It,gr=or?.maxX??Nt,ii=In||0,ti=cr.genome&&typeof cr.genome.xScalePercent=="number"?cr.genome.xScalePercent/100:1,di=Math.max(yr!==null?yr:It,It,nr),Bi=Math.min(Nt,gr),as=(di-ii)/ti,ki=(Bi-ii)/ti;if(ki>as){const _i=ki-as,ci=60,xi=ln-hn,mi=Math.floor(xi/ci),wi=Math.max(3,Math.min(8,mi)),vi=_i/wi,qi=Math.pow(10,Math.floor(Math.log10(vi))),ji=vi/qi;let Ni;ji<=1?Ni=1:ji<=2?Ni=2:ji<=5?Ni=5:Ni=10;const ls=Ni*qi,xs=Math.floor(as/ls),$s=Math.ceil(ki/ls);for(let Is=xs;Is<=$s;Is++){const Hs=Is*ls;if(Hs<as-ls*.1||Hs>ki+ls*.1)continue;const ws=Hs*ti+ii,Es=Or(ws);Es>=hn&&Es<=fn&&(hr.push({screenX:Es,label:formatCoordinate(Hs)}),Ar.push(Es))}}if((bt.showTreeLayer===!0||bt.showTreeTextLayer===!0)&&yr!==null&&hn>30&&rr&&rr.tree&&or){const _i=or.treeOffset||0,ci=cr.tree&&typeof cr.tree.xScalePercent=="number"?cr.tree.xScalePercent/100:1,xi=rr.tree.allNodes.map(ls=>ls.y*ci+_i),mi=Math.min(...xi),wi=Math.max(...xi),vi=rr.tree.maxEvolutionaryDistance||1,qi=cr.tree?.fixedCoordinateWidth||2e3,ji=Math.max(mi,It),Ni=Math.min(wi,yr);if(Ni>ji){const xs=Math.floor(hn/60),$s=Math.min(4,Math.max(2,xs));for(let Is=0;Is<$s;Is++){const Hs=ji+Is/Math.max(1,$s-1)*(Ni-ji),ws=Or(Hs),Es=(Hs-_i)/ci*(vi/qi);let Ds;vi<.001?Ds=Es.toExponential(1):vi<.1||vi<1?Ds=Es.toFixed(2):Ds=Es.toFixed(1),ws>=0&&ws<=hn&&(An.push({screenX:ws,label:Ds}),Ar.push(ws))}}}if(pr+="<g id='ruler'>",Ar.length>0){const ci=Math.max(0,Math.min(...Ar)-10),xi=Math.min(fn,Math.max(...Ar)+10);pr+=`<line x1='${ci}' y1='${gn}' x2='${xi}' y2='${gn}' stroke='${Hn}' stroke-width='0.5'/>`}pr+="<g id='ruler-tree'>";for(const _i of An)pr+=`<line x1='${_i.screenX}' y1='${gn}' x2='${_i.screenX}' y2='${gn+wn/2}' stroke='${_n}' stroke-width='1'/>`,pr+=`<text x='${_i.screenX}' y='${gn+Xn}' text-anchor='middle' font-size='${tr}px' fill='${_n}' font-family='Helvetica, Arial, sans-serif' font-weight='bold'>${_i.label}</text>`;pr+="</g>",pr+="<g id='ruler-genes'>";for(const _i of hr)pr+=`<line x1='${_i.screenX}' y1='${gn}' x2='${_i.screenX}' y2='${gn+wn}' stroke='${Hn}' stroke-width='1'/>`,pr+=`<text x='${_i.screenX}' y='${gn+Xn}' text-anchor='middle' font-size='${tr}px' fill='${Kn}' font-family='Helvetica, Arial, sans-serif'>${_i.label}</text>`;pr+="</g>",pr+="</g>"}return pr+="</svg>",pr}function formatCoordinate(yt){const Et=Math.abs(yt);return Et>=1e6?`${(yt/1e6).toFixed(1)}M`:Et>=1e3?`${(yt/1e3).toFixed(1)}K`:Math.round(yt).toString()}const DEBUG_LOGS=!1,HoodiniViz=React.forwardRef(({newickStr:yt,gffFeatures:Et,proteinLinks:xt,nucleotideLinks:vt,domainsByGene:bt,hoods:At,hiddenHoodIds:Ft,visibleGeneIds:Ct,hiddenGeneIds:wt,showScrollbar:St,setGenomeViewRef:Tt,onLegendChange:Rt,alignCluster:Pt,defaultAlign:Lt="start",useDefaultGeneAlignment:kt=!0,showRuler:Ot=!0,onObjectClick:Mt,showSVGWidget:It=!1,proteinMetadata:Nt,domainMetadata:Ut,nonCodingMetadata:jt,colorBy:Vt="cluster",labelBy:zt,treeMetadata:Ht,treeLabelBy:Wt,treeColorBy:Gt,config:qt=DEFAULT_CONFIG$1,ultrametric:Xt=!1,showConnectingLines:Kt=!1,forceUpdateCounter:Jt=1e3,phyloLabelPosition:tn="after-tree",alignLabels:sn=!0,arrowheadHeight:Zt,geneHeight:nn,tipWidthMode:rn,tipWidthFactor:on,tipWidthFixed:ln,genePalette:Qt,domainPalette:fn,phyloPalette:pn,ncRNAPalette:mn,regionPalette:vn,geneColorBy:yn,geneLabelBy:xn,domainColorBy:Mn="domainName",domainSource:$n="all",proteinLinkConfig:Rn,nucleotideLinkConfig:Tn,styleConfig:ir,treeXScale:Jn,adjacencyN:jn=1,showTreeLayer:Wn=!0,showGeneLayer:br=!0,showDomainLayer:Fr=!0,showProteinLinkLayer:Cr=!0,showNucleotideLinkLayer:dr=!0,showNcRNALayer:_r=!0,showRegionsLayer:pr=!0,showGeneTextLayer:wr=!0,showTreeTextLayer:xr=!0,showBaselineLayer:Dr=!0,geneLabelPosition:ar="bottom",flashHood:Qn=null,geneColors:Cn=null,phyloColors:Bn=null,showFormatGuides:In=!1,formatGuidePreset:or=null,scaleExportToFormat:rr=!1,cropToGuides:vr=!0,scaleRulerWithCrop:cr=!0,ySpacing:gn,phyloLabelSize:wn,geneLabelSize:Xn,rulerLabelSize:tr,strokeLineWidth:Hn,genomeXScale:Kn},_n)=>{const yr=reactExports.useRef(0),Or=reactExports.useRef({});React.useEffect(()=>{yr.current+=1;try{const En=["treeXScale","arrowheadHeight","geneHeight","alignmentVersion","paletteVersion","geneColorBy","colorBy","phyloLabelPosition"],kn={treeXScale:Jn,arrowheadHeight:Zt,geneHeight:nn,alignmentVersion:mi,paletteVersion:typeof mo<"u"?mo:null,geneColorBy:yn,colorBy:Vt,phyloLabelPosition:tn};En.filter(Nn=>Or.current[Nn]!==kn[Nn]).length>0,Or.current=kn}catch{}});const{getThemeColors:hn,theme:Ar,resolvedTheme:hr}=useTheme(),An=React.useMemo(()=>hn(hr),[hr]),nr=memoGetPalette,gr=React.useMemo(()=>Ft?Ft instanceof Set?Ft:Array.isArray(Ft)?new Set(Ft):new Set:new Set,[Ft]),ii=React.useCallback(En=>gr.size===0||En==null?!1:gr.has(String(En))||gr.has(Number(En)),[gr]),ti=React.useMemo(()=>wt?wt instanceof Set?wt:Array.isArray(wt)?new Set(wt.map(String)):new Set:new Set,[wt]),di=React.useMemo(()=>{if(!Cn)return null;if(Cn instanceof Map)return Cn;if(typeof Cn=="object"){const En=new Map;for(const[kn,Vn]of Object.entries(Cn))En.set(String(kn),Vn);return En}return null},[Cn]),Bi=React.useMemo(()=>{if(!Bn)return null;if(Bn instanceof Map)return Bn;if(typeof Bn=="object"){const En=new Map;for(const[kn,Vn]of Object.entries(Bn))En.set(String(kn),Vn);return En}return null},[Bn]),as=React.useCallback((En,kn)=>{if(!En)return null;const Vn=kn?.origStart??kn?.start,Nn=kn?.origEnd??kn?.end;return Vn!=null&&Nn!=null?`${En}:${Vn}-${Nn}`:String(En)},[]),ki=React.useMemo(()=>{if(!At||!Array.isArray(At))return"none";try{return At.map(En=>as(En?.hood_id||En?.hoodId||En?.seqid,En)||"").join("|")}catch{return`len:${At.length}`}},[At,as]),Xi=qt&&qt.ruler&&typeof qt.ruler.height=="number"?qt.ruler.height:DEFAULT_CONFIG$1.ruler.height,_i=En=>{if(!Ht)return{};if(Ht[En])return Ht[En];const kn=Object.values(Ht);for(let Vn=0;Vn<kn.length;++Vn){const Nn=kn[Vn];if(Nn&&(Nn.leaf_id==En||Nn.leaf_id===En||Nn.leaf_name==En||Nn.leaf_name===En||Nn.id==En||Nn.id===En||Nn.name==En||Nn.name===En||Nn.originalId==En||Nn.original_id==En))return Nn}return{}},[ci,xi]=reactExports.useState(null),[mi,wi]=reactExports.useState(0),[vi,qi]=reactExports.useState(!1),ji=React.useRef(null),[Ni,ls]=React.useState({width:0,height:0}),[xs,$s]=React.useState(!0),[Is,Hs]=reactExports.useState(qt?.tree?.xScalePercent||DEFAULT_CONFIG$1.tree.xScalePercent),ws=Jn??Is,[Es,Ds]=reactExports.useState({target:[0,0,0],zoom:-2}),[Fa,Ja]=reactExports.useState(null),[oa,aa]=reactExports.useState(null),[Mi,Wa]=reactExports.useState(null),[Wi,Mo]=reactExports.useState(null),[ys,Va]=reactExports.useState(null),[io,Fo]=reactExports.useState(null),[_o,lo]=reactExports.useState(null),[Do,Cl]=reactExports.useState(null),ea=reactExports.useRef(!1),ma=reactExports.useRef(null),cs=reactExports.useRef(null),wa=reactExports.useRef(0),la=reactExports.useRef([]),Sa=React.useRef(null);React.useEffect(()=>{try{console.debug("[HoodiniViz] mounted; initial selectedNode=",ci)}catch{}return()=>{}},[]),React.useEffect(()=>{try{console.debug("[HoodiniViz] selectedNode changed ->",ci&&(ci.id||ci.name||ci))}catch{}},[ci]);const Io=React.useCallback(()=>{Ja(null),Wa(null)},[]),xo=React.useCallback(()=>{lo(null)},[]),Ga=React.useCallback(()=>{ea.current=!1,Fo(null)},[]),wo=React.useCallback(()=>{aa(null),Mo(null)},[]),Fl=React.useCallback(()=>{Va(null)},[]),ca=React.useCallback(()=>{Cl(null)},[]),za=React.useCallback((En,kn=null)=>{if(!En){Io();return}xo(),ca(),Ja(String(En)),kn&&Wa([kn])},[Io,xo,ca]),Uo=React.useCallback(En=>{if(!En){xo();return}ca(),lo([En])},[xo,ca]),Vi=React.useCallback(En=>{if(!En){ca();return}xo(),Cl([En])},[ca,xo]),Os=reactExports.useRef(Qn);reactExports.useEffect(()=>{const En=Os.current;if(Os.current=Qn,ea.current)return;if(!Qn){En&&Fo(null);return}const kn=typeof Qn=="string"?Qn:Qn?.id!=null?String(Qn.id):null;if(!kn||!bs.current){Fo(null);return}const Nn=(bs.current.nucleotideLinks?.filter(Dn=>Dn.hood)||[]).filter(Dn=>{const On=Dn?.hood_id!=null?String(Dn.hood_id):null,Pn=Dn?.seqid!=null?String(Dn.seqid):null;return On===kn||Pn===kn});Fo(Nn.length>0?Nn:null)},[Qn]);const bs=reactExports.useRef(null),$o=reactExports.useRef(null),al=reactExports.useRef(ws),qo=reactExports.useRef(null);reactExports.useRef(null),reactExports.useRef(null);const Da=reactExports.useRef(null),qa=reactExports.useRef(null),Ta=reactExports.useRef([]),Zl=reactExports.useRef(null),$l=reactExports.useRef(null),Ts=reactExports.useRef(null),To=reactExports.useRef(null),Ea=reactExports.useRef(!1),Kr=React.useMemo(()=>Nt?Object.values(Nt):[],[Nt]),gs=React.useMemo(()=>{if(!Kr.length)return null;const En={};for(const kn of Kr){const Vn=kn?.id||kn?.gene_id||kn?.geneId;if(!Vn)continue;const Nn=kn?.cluster??kn?.clusterId??kn?.cluster_id;Nn==null||Nn===""||(En[Vn]=Nn)}return Object.keys(En).length?En:null},[Kr]),Ra=React.useMemo(()=>({}),[]),po=yt&&typeof yt=="string"&&yt.trim()!=="",el=React.useMemo(()=>{if(po||!At||!Array.isArray(At))return null;const En=[...new Set(At.map(kn=>kn?.hood_id||kn?.hoodId||kn?.seqid).filter(Boolean))];return En.sort((kn,Vn)=>{const Nn=String(kn),Dn=String(Vn),On=parseFloat(Nn),Pn=parseFloat(Dn);return!isNaN(On)&&!isNaN(Pn)?On-Pn:Nn.localeCompare(Dn,void 0,{numeric:!0,sensitivity:"base"})}),En.map(String)},[po,At]),tl=React.useMemo(()=>{const En=typeof gn=="number"?gn:qt?.tree?.ySpacing||DEFAULT_CONFIG$1.tree.ySpacing;return{...qt,tree:{...qt?.tree,ySpacing:En}}},[qt,gn]),ll=React.useMemo(()=>{const En=typeof gn=="number"?gn:qt?.tree?.ySpacing||DEFAULT_CONFIG$1.tree.ySpacing,kn=typeof Kn=="number"?Kn:qt?.genome?.xScalePercent||DEFAULT_CONFIG$1.genome.xScalePercent;return{...qt,tree:{...qt?.tree,ySpacing:En},genome:{...qt?.genome,xScalePercent:kn}}},[qt,gn,Kn]),us=React.useMemo(()=>{const En=po?yt:el||[],kn=new PhyloTree(En,tl,Xt),Vn=kn.getLeafNodes().map(Nn=>Nn.name);return kn.layout(Vn),kn},[yt,po,el,Xt,tl,Ra]),si=React.useMemo(()=>{const En=po?yt:el||[],kn=new PhyloTree(En,tl,!1),Vn=kn.getLeafNodes().map(Nn=>Nn.name);return kn.layout(Vn),kn},[yt,po,el,tl,Ra]),Un=React.useMemo(()=>{const En=si.getLeafNodes().map(Nn=>Nn.name),kn=new GenomeView(En,si,ll);if(kn.addFeatures(Et),At&&kn.applyHoods(At),kn.initGenes(),gs&&Object.keys(gs).length>0){kn.proteinClusters={},kn._genesIndexReady||kn._buildGeneIndex();for(const Nn of Object.keys(gs)){const Dn=gs[Nn],On=Dn==null?null:String(Dn).trim(),Pn=kn._genesByOriginalId.get(Nn)||[];for(const Zn of Pn)kn.proteinClusters[Zn]=On}}if(kn.computeTrackPositions(),Pt!=null&&Pt!=="")kn.alignCluster(String(Pt));else{const Nn=Object.values(kn.hoodRanges||{}).some(Dn=>Dn.align_gene);kt&&Nn?kn.alignByDefaultGenes():Lt==="center"?kn.alignAllToCenter():Lt==="end"?kn.alignAllToEnd():kn.alignAllToStart()}if(kn.addDomains(bt),Ut&&kn.addDomainMetadata(Ut),kn.addProteinLinks(xt,[200,200,200,255],jn),kn.addNucleotideLinks(vt,[200,200,200,255],jn),Nt&&Object.keys(Nt).length>0){performance.now();for(const Nn in kn.genesById){const Dn=kn.genesById[Nn],On=Dn.originalGeneId;On&&Nt[On]?Dn.metadata=Nt[On]:Dn.metadata={}}if(gs&&kn.proteinClusters){kn._clusterSummary=null;for(const Nn in kn.genesById){const Dn=kn.genesById[Nn],On=kn.proteinClusters[Nn];Dn.metadata||(Dn.metadata={}),Dn.metadata.clusterId=On||null}}performance.now()}const Vn=Nn=>{if(!Nn||typeof Nn!="object")return Nn;const Dn={...Nn};return Dn.sequence||(Dn.sequence=Dn.rna_sequence||Dn.sequence_nt||Dn.nucleotide_sequence||Dn.rna_seq||Dn.seq||null),Dn.structure||(Dn.structure=Dn.secondary_structure||Dn.dot_bracket||Dn.dbn||Dn.structure_dbn||null),Dn.type||(Dn.type=Dn.ncrna_type||Dn.rna_type||Dn.subtype||null),Dn};if(jt&&Object.keys(jt).length>0)for(const Nn in kn.ncRNAsById){const Dn=kn.ncRNAsById[Nn],On=Number.isFinite(Number(Dn.genomicStart))?Number(Dn.genomicStart):null,Pn=Number.isFinite(Number(Dn.genomicEnd))?Number(Dn.genomicEnd):null;let Zn=!1;if(On!==null&&Pn!==null){const sr=`${Dn.seqid}:${On}:${Pn}`;if(jt[sr]&&(Dn.metadata={...Dn.metadata||{},...Vn(jt[sr])},Zn=!0),!Zn){const fr=`${Dn.seqid}:${Pn}:${On}`;jt[fr]&&(Dn.metadata={...Dn.metadata||{},...Vn(jt[fr])},Zn=!0)}}if(!Zn){const sr=Number.isFinite(Number(Dn.start))?Number(Dn.start):null,fr=Number.isFinite(Number(Dn.end))?Number(Dn.end):null;if(sr!==null&&fr!==null){const mr=`${Dn.seqid}:${sr}:${fr}`;jt[mr]&&(Dn.metadata={...Dn.metadata||{},...Vn(jt[mr])},Zn=!0)}}if(!Zn){const sr=Dn.id||Dn.originalId;sr&&jt[sr]&&(Dn.metadata={...Dn.metadata||{},...Vn(jt[sr])},Zn=!0)}Zn||Dn.metadata||(Dn.metadata={})}else for(const Nn in kn.ncRNAsById){const Dn=kn.ncRNAsById[Nn];Dn.metadata||(Dn.metadata={})}return bs.current=kn,performance.now(),kn},[si,ll,Et?Et.length:0,xt?xt.length:0,vt?vt.length:0,bt?Object.keys(bt).length:0,ki,Nt?Object.keys(Nt).length:0,Ut?Object.keys(Ut).length:0,gs?Object.keys(gs).length:0,jt?Object.keys(jt).length:0,Pt,kt,Lt,Ra]);reactExports.useEffect(()=>{xi(null)},[us]),reactExports.useEffect(()=>{if(!Un)return;const En=Qt||qt?.colorPalettes?.genePalette;gs&&Un.setProteinClustersWithPalette(gs,En);const kn=mn||qt?.colorPalettes?.ncRNAPalette;Un.setNcRNAColorsWithPalette(kn);const Vn=vn||qt?.colorPalettes?.regionPalette;Un.setRegionColorsWithPalette(Vn),wi(Nn=>Nn+1)},[Un,Qt,mn,vn,gs,qt?.colorPalettes]),reactExports.useEffect(()=>{Jt>0&&(Ea.current=!0,wi(En=>En+1))},[Jt]);const pi=React.useRef(Kn),zi=React.useRef(Lt),Zi=React.useRef(Pt),bi=React.useRef(kt),Fi=React.useRef(gn),ts=React.useRef(0),Gi=React.useMemo(()=>{if(!Un)return`empty-${ts.current}`;const En=Un.config?.genome?.xScalePercent,kn=Kn??En??30;En!==kn&&(Un.config={...Un.config,genome:{...Un.config?.genome,xScalePercent:kn}});const Vn=pi.current!==Kn,Nn=zi.current!==Lt,Dn=Zi.current!==Pt,On=bi.current!==kt,Pn=Fi.current!==gn;if(Vn||Nn||Dn||On){if(pi.current=Kn,zi.current=Lt,Zi.current=Pt,bi.current=kt,Pt!=null&&Pt!=="")Un.alignCluster(String(Pt));else{const Zn=Object.values(Un.hoodRanges||{}).some(sr=>sr.align_gene);kt&&Zn?Un.alignByDefaultGenes():Lt==="center"?Un.alignAllToCenter():Lt==="end"?Un.alignAllToEnd():Un.alignAllToStart()}ts.current++}return Pn&&(Fi.current=gn),`${Kn}-${Lt}-${Pt||""}-${kt}-${gn}-${ts.current}`},[Un,Kn,Lt,Pt,kt,gn]),hs=React.useMemo(()=>{if(!us)return 100;const En=mr=>{if(!Ht)return{};if(Ht[mr])return Ht[mr];const Pr=Object.values(Ht);for(let Ur=0;Ur<Pr.length;++Ur){const Rr=Pr[Ur];if(Rr&&(Rr.leaf_id==mr||Rr.leaf_id===mr||Rr.leaf_name==mr||Rr.leaf_name===mr||Rr.id==mr||Rr.id===mr||Rr.name==mr||Rr.name===mr||Rr.originalId==mr||Rr.original_id==mr))return Rr}return{}},kn=Wt?Array.isArray(Wt)?Wt:Wt.split(",").map(mr=>mr.trim()).filter(Boolean):null,Nn=us.leafNodes.map(mr=>{const Pr=En(mr.name)||{};let Ur;if(kn&&kn.length>0){const Rr=kn.map(Wr=>Wr==="name"?mr.name:Pr[Wr]).filter(Wr=>Wr!=null&&Wr!=="");Ur=Rr.length>0?Rr.join(" | "):mr.name}else Ur=Pr[Wt],Ur==null&&(Ur=mr.name);return String(Ur)}).reduce((mr,Pr)=>Math.max(mr,Pr.length),0),Dn=qt.tree.labelPadding.charWidth,On=Nn*Dn,Pn=typeof wn=="number"?wn:qt?.text?.phyloLabelSize||14,Zn=qt?.text?.scaleFactors?.phylo||1,fr=Pn*Zn*5;return On+fr},[us,Ht,Wt,qt,wn]),Rs=React.useMemo(()=>{if(!us)return new Map;const En=Nn=>{if(!Ht)return{};if(Ht[Nn])return Ht[Nn];const Dn=Object.values(Ht);for(let On=0;On<Dn.length;++On){const Pn=Dn[On];if(Pn&&(Pn.leaf_id==Nn||Pn.leaf_name==Nn||Pn.id==Nn||Pn.name==Nn))return Pn}return{}},kn=Wt?Array.isArray(Wt)?Wt:Wt.split(",").map(Nn=>Nn.trim()).filter(Boolean):null,Vn=new Map;return us.leafNodes.forEach(Nn=>{const Dn=En(Nn.name)||{};let On;if(kn&&kn.length>0){const Pn=kn.map(Zn=>Zn==="name"?Nn.name:Dn[Zn]).filter(Zn=>Zn!=null&&Zn!=="");On=Pn.length>0?Pn.join(" | "):Nn.name}else On=Dn[Wt],On==null&&(On=Nn.name);Vn.set(String(Nn.name),String(On).length)}),Vn},[us,Ht,Wt]);function vo(En,kn,Vn="after-tree",Nn=null,Dn=!0,On=null){let Pn=1/0,Zn=1/0,sr=-1/0,fr=-1/0,mr=1/0,Pr=null;if(!En)return qt.layout.containerFallback;const Ur=On&&On.size>0;Ur?(Object.values(En.genesById).forEach(Si=>{On.has(String(Si.hood_id))&&Si.polygon&&Si.polygon.forEach(([Ci,Ai])=>{Pn=Math.min(Pn,Ci),sr=Math.max(sr,Ci)})}),Object.values(En.ncRNAsById).forEach(Si=>{On.has(String(Si.hood_id))&&Si.polygon&&Si.polygon.forEach(([Ci,Ai])=>{Pn=Math.min(Pn,Ci),sr=Math.max(sr,Ci)})}),En.getAllDomains().forEach(Si=>{const Ci=Si.parentGene;Ci&&!On.has(String(Ci.hood_id))||Si.polygon&&Si.polygon.forEach(([Ai,Xs])=>{Pn=Math.min(Pn,Ai),sr=Math.max(sr,Ai)})})):En.globalMin!==1/0&&En.globalMax!==-1/0?(Pn=En.globalMin,sr=En.globalMax):(Object.values(En.genesById).forEach(Si=>{Si.polygon&&Si.polygon.forEach(([Ci,Ai])=>{Pn=Math.min(Pn,Ci),sr=Math.max(sr,Ci)})}),Object.values(En.ncRNAsById).forEach(Si=>{Si.polygon&&Si.polygon.forEach(([Ci,Ai])=>{Pn=Math.min(Pn,Ci),sr=Math.max(sr,Ci)})}),En.getAllDomains().forEach(Si=>{Si.polygon&&Si.polygon.forEach(([Ci,Ai])=>{Pn=Math.min(Pn,Ci),sr=Math.max(sr,Ci)})})),Object.values(En.genesById).forEach(Si=>{Ur&&!On.has(String(Si.hood_id))||Si.polygon&&Si.polygon.forEach(([Ci,Ai])=>{Zn=Math.min(Zn,Ai),fr=Math.max(fr,Ai)})}),Object.values(En.ncRNAsById).forEach(Si=>{Ur&&!On.has(String(Si.hood_id))||Si.polygon&&Si.polygon.forEach(([Ci,Ai])=>{Zn=Math.min(Zn,Ai),fr=Math.max(fr,Ai)})}),En.getAllDomains().forEach(Si=>{const Ci=Si.parentGene;Ur&&Ci&&!On.has(String(Ci.hood_id))||Si.polygon&&Si.polygon.forEach(([Ai,Xs])=>{Zn=Math.min(Zn,Xs),fr=Math.max(fr,Xs)})});const Rr=En.leaves&&En.leaves.length>0,Wr=Rr?new Set:null;if(Rr){const Si=new Set(En.leaves.map(Ci=>String(Ci)));for(const Ci of Si){const Ai=En.hoodToSeqidMap[Ci];Ai&&Wr.add(Ai)}}let $r=-1/0;const qr=Nn!==null?Nn/100:qt.tree&&typeof qt.tree.xScalePercent=="number"?qt.tree.xScalePercent/100:1;if(kn){let Si=null;if(Ur&&On&&On.size>0){Si=new Set;for(const Ci of kn.allNodes)if((!Ci.branchset||Ci.branchset.length===0)&&(On.has(String(Ci.name))||On.has(String(Ci.id)))){let Xs=Ci;for(;Xs;)Si.add(String(Xs.id||Xs.name)),Xs=Xs.parent}}kn.buildEdges().forEach(Ci=>{if(Si){const Ai=String(Ci.source?.id||Ci.source?.name),Xs=String(Ci.target?.id||Ci.target?.name);if(!Si.has(Ai)&&!Si.has(Xs))return}Ci.path.forEach(([Ai,Xs])=>{$r=Math.max($r,Ai*qr)})})}const Vr=Ur?isFinite(Pn)?Pn:isFinite(mr)?mr:-1/0:isFinite(En.globalMin)?En.globalMin:isFinite(mr)?mr:isFinite(Pn)?Pn:-1/0,ri=isFinite(Vr)?qt.layout.geneOffset-Vr:0,Ei=qt.tree.gap,Di=isFinite(Vr)?Vr:Pn,Hi=Vn||qt.tree?.phyloLabelPosition||"after-tree";let Pi=0;if(Hi==="after-tree"&&kn){const Si=Ur&&On?kn.leafNodes.filter(Ci=>On.has(String(Ci.name))||On.has(String(Ci.id))):kn.leafNodes;if(Si.length>0){const Ci=qt.tree.labelPadding.charWidth,Ai=typeof wn=="number"?wn:qt?.text?.phyloLabelSize||14,Xs=qt?.text?.scaleFactors?.phylo||1,fa=Ai*Xs*5;Pi=Si.reduce((Qs,Ia)=>{const ba=Rs.get(String(Ia.name))??String(Ia.name).length;return Math.max(Qs,ba)},0)*Ci+fa}}const Qi=isFinite($r)&&isFinite(Di)?Di-$r-Ei-Pi:0;if(kn&&Dn&&isFinite(Qi)){let Si=1/0;kn.buildEdges().forEach(Ci=>{Ci.path.forEach(([Ai,Xs])=>{Si=Math.min(Si,Ai*qr+Qi)})}),isFinite(Si)&&(Pn=Math.min(Pn,Si))}if(!isFinite(Pn)||!isFinite(Zn)||!isFinite(sr)||!isFinite(fr)){const Si=qt.layout.containerFallback;Pn=Si.minX,Zn=Si.minY,sr=Si.maxX,fr=Si.maxY}return{minX:Pn,minY:Zn,maxX:sr,maxY:fr,treeOffset:Qi,geneOffset:ri}}React.useEffect(()=>{const En=ji.current;if(!En)return;const kn={w:-1,h:-1};let Vn=0;const Nn=new ResizeObserver(Pn=>{const{width:Zn,height:sr}=Pn[0].contentRect,fr=Math.floor(Zn),mr=Math.floor(sr);fr===kn.w&&mr===kn.h||(kn.w=fr,kn.h=mr,Vn&&cancelAnimationFrame(Vn),Vn=requestAnimationFrame(()=>ls({width:fr,height:mr})))});Nn.observe(En);const Dn=En.clientWidth||0,On=En.clientHeight||0;return kn.w=Dn,kn.h=On,ls({width:Dn,height:On}),()=>{Nn.disconnect(),Vn&&cancelAnimationFrame(Vn)}},[ji.current]);function go(En){if(!En)return null;const kn=En.leaves.some(On=>En.trackOffset&&En.trackOffset[On]!==void 0&&En.trackOffset[On]!==0),Vn=(Lt==="start"||Lt==="center"||Lt==="end")&&En.leaves.some(On=>En.trackOffset&&En.trackOffset[On]!==void 0),Nn=Pt!=null&&Pt!=="";return!kn&&!Vn&&!Nn&&!!!kt?null:0}const ms=React.useMemo(()=>{const En=bs.current;if(!En||!us||!ci)return null;try{const kn=typeof En.getNodeDescendantLeaves=="function"?En.getNodeDescendantLeaves(ci):us&&typeof us.getNodeDescendantLeaves=="function"?us.getNodeDescendantLeaves(ci):[],Vn=Array.isArray(kn)?kn:[];return new Set(Vn.map(Nn=>String(Nn)))}catch{return null}},[us,ci]),Ii=React.useMemo(()=>vo(bs.current,us,tn,ws,!1,ms),[us,tn,ws,Gi,Kn,gn,nn,Zt,ms,wn,Rs]),Ui=React.useMemo(()=>po?vo(bs.current,us,tn,ws,!0,ms):Ii,[po,us,tn,ws,Gi,Ii,Kn,gn,nn,Zt,ms,wn,Rs]);React.useEffect(()=>{isFinite(Ii.minY)&&isFinite(Ii.maxY)&&Ii.maxY>Ii.minY&&isFinite(Ii.minX)&&isFinite(Ii.maxX)&&(Sa.current={minY:Ii.minY,maxY:Ii.maxY,minX:Ii.minX,maxX:Ii.maxX,ySpacing:gn,genomeXScale:Kn})},[Ii.minY,Ii.maxY,Ii.minX,Ii.maxX,gn,Kn,nn,Zt,ws]);const Fs=React.useRef(!1);React.useEffect(()=>{if(Fs.current||!Ni.width||!Ni.height||!isFinite(Ui.minX)||!isFinite(Ui.maxX)||!isFinite(Ui.minY)||!isFinite(Ui.maxY))return;const En=Ui.maxX-Ui.minX,kn=Ui.maxY-Ui.minY;if(En<=0||kn<=0)return;const Vn=.5,Nn=Math.log2(Ni.width*Vn/En),Dn=Math.log2(Ni.height*Vn/kn),On=Math.min(Nn,Dn),Pn=Math.max(-5,Math.min(2,On)),Zn=(Ui.minX+Ui.maxX)/2,sr=(Ui.minY+Ui.maxY)/2;Ds(fr=>({...fr,target:[Zn,sr,0],zoom:Pn})),Fs.current=!0},[Ni.width,Ni.height,Ui.minX,Ui.maxX,Ui.minY,Ui.maxY]);const Ws=Sa.current||Ii,Ba=Ws.minY,ua=Ws.maxY,Oo=Ws.minX??Ii.minX,jo=Ws.maxX??Ii.maxX,qs=qt?.scrollbar?.panPaddingY??50,Ya=Ba-qs,Yo=ua+qs,[wl,cl]=React.useState(0);React.useEffect(()=>{if(Es&&isFinite(Es.target[1])&&isFinite(Ba)&&isFinite(ua)&&ua>Ba){const En=(ua-Es.target[1])/(ua-Ba)*100;cl(Math.max(0,Math.min(100,En)))}},[Es?.target?.[1],Ba,ua]);let As=1;if(Es&&Ni.height&&ua>Ba){const En=Math.pow(2,Es.zoom||0),kn=Ni.height/En;As=Math.min(1,kn/(ua-Ba))}function Po(En,kn,Vn,Nn,Dn,On,Pn="bottom",Zn=null,sr=100,fr=150){const mr=Vr=>{if(Array.isArray(Vr))return Vr.length===3?[Vr[0],Vr[1],Vr[2],255]:Vr;if(typeof Vr=="string"){const ri=Vr.split(",").map(Ei=>parseInt(Ei.trim(),10)).filter(Ei=>!isNaN(Ei));if(ri.length===3)return[ri[0],ri[1],ri[2],255];if(ri.length>=4)return[ri[0],ri[1],ri[2],ri[3]]}return Array.isArray(Dn.geneFill)?Dn.geneFill:[150,150,150,255]},Pr=Vr=>{if(!hi?.enabled)return mr(Dn.geneFill);const ri=Vn||Nn||"cluster";let Ei=Vr?.metadata?.[ri];(Ei==null||Ei==="")&&ri==="cluster"&&(Ei=Vr?.metadata?.clusterId??Vr?.metadata?.cluster_id??Vr?.cluster);let Di=null;return kn&&!Ls(Ei)&&(Di=ya(kn,normalizeKey(Ei),hi?.type)||null),mr(Di||Vr.fillColor||Dn.geneFill)},Ur=(Vr,ri,Ei,Di=1/0)=>{const Hi=Ei*.6,Pi=Math.max(3,Math.floor(ri/Hi));if(Vr.length<=Pi)return Vr;const Qi=[];let Si=Vr;for(;Si.length>Pi&&Qi.length<Di;){let Ci=Pi;const Ai=Si.substring(0,Pi),Xs=Math.floor(Pi*.7);for(let Ks=Pi-1;Ks>=Xs;Ks--){const fa=Ai[Ks];if(fa==="_"||fa==="-"||fa===" "||fa==="|"){Ci=Ks+1;break}}Qi.push(Si.substring(0,Ci).trim()),Si=Si.substring(Ci).trim()}if(Si&&Qi.length<Di)Qi.push(Si);else if(Si&&Qi.length>=Di){const Ci=Qi[Qi.length-1],Ai=Ci.length>3?Ci.substring(0,Ci.length-3)+"...":"...";Qi[Qi.length-1]=Ai}return Qi.join(`
|
|
2793
|
-
`)},Rr=Zn?Array.isArray(Zn)?Zn:Zn.split(",").map(Vr=>Vr.trim()).filter(Boolean):null;let Wr=null;const $r=(Pn||"bottom").toLowerCase();if(fr<150&&$r!=="center"){const Vr=new Map;for(const ri of En){const Ei=ri.id||ri.uniqueId||"",Di=Ei.indexOf("_"),Hi=Di>0?Ei.substring(0,Di):"";if(!Hi)continue;const Pi=ri.trackY??0;(!Vr.has(Hi)||Pi<Vr.get(Hi))&&Vr.set(Hi,Pi)}if(Vr.size>0){let ri="",Ei="",Di=-1/0,Hi=1/0;for(const[Pi,Qi]of Vr)Qi>Di&&(Di=Qi,ri=Pi),Qi<Hi&&(Hi=Qi,Ei=Pi);Wr=$r==="bottom"?Ei:ri}}return En.map(Vr=>{if(Wr!==null){const Ko=Vr.id||Vr.uniqueId||"",ia=Ko.indexOf("_");if((ia>0?Ko.substring(0,ia):"")!==Wr)return null}const ri=Vr;let Ei;if(Rr&&Rr.length>0){const Ko=Rr.map(ia=>ia==="gene_id"?ri.id||ri.geneId||ri.metadata?.gene_id:ri.metadata?.[ia]).filter(ia=>ia!=null&&ia!=="");Ei=Ko.length>0?Ko.join(" | "):null}else Ei=ri.id||ri.geneId||ri.metadata?.gene_id||null;if(Ei==null)return null;const Di=(ri.start+ri.end)/2,Hi=ri.trackY!==void 0&&ri.trackY!==null?ri.trackY:ri.polygon&&ri.polygon.length?Math.min(...ri.polygon.map(([Ko,ia])=>ia)):0,Qi=(ri.geneHeight!==void 0&&ri.geneHeight!==null?ri.geneHeight:On&&On.gene?On.gene.height:60)/2,Si=Pr(ri),Ci=da(Si)||mr(Dn.geneFill),Ai=Math.abs(ri.end-ri.start)*(sr/100),Xs=On&&On.text&&On.text.geneLabelSize?On.text.geneLabelSize:12,Ks=Ei==null?"":String(Ei),ra=Ai/(Xs*.4);let Qs=Xs;if(Ks.length>ra&&ra>0){const Ko=Math.min(1,ra*2/Ks.length);Qs=Math.max(Xs*.5,Xs*Math.max(.5,Ko))}const Ia=ri.geneHeight!==void 0&&ri.geneHeight!==null?ri.geneHeight:On&&On.gene?On.gene.height:60,ba=fr-Ia-10,zl=Qs*7,Ua=Math.max(1,Math.floor(ba/zl)),Il=Ur(Ks,Ai,Qs,Ua),Oa=2;let Xo;switch((Pn||"bottom").toLowerCase()){case"top":Xo=Hi+Qi+Oa;break;case"center":Xo=Hi;break;default:Xo=Hi-Qi-Oa;break}let Pa="top";switch((Pn||"bottom").toLowerCase()){case"center":Pa="center";break;case"top":Pa="bottom";break;default:Pa="top";break}return{position:[Di,Xo],text:Il,color:Ci,size:Qs,textAnchor:"middle",alignmentBaseline:Pa}}).filter(Boolean)}function da(En,kn=qt.stroke.darkenFactor){return!Array.isArray(En)||En.length<3?En:[Math.max(0,Math.floor(En[0]*kn)),Math.max(0,Math.floor(En[1]*kn)),Math.max(0,Math.floor(En[2]*kn)),En.length>3?En[3]:255]}function nl(En){let kn=0;for(let On=0;On<En.length;++On)kn=En.charCodeAt(On)+((kn<<5)-kn);const Vn=kn>>0&255,Nn=kn>>8&255,Dn=kn>>16&255;return[Math.abs(Vn),Math.abs(Nn),Math.abs(Dn),255]}function uo(En){if(En==null)return NaN;if(typeof En=="number")return Number.isFinite(En)?En:NaN;let kn=String(En).trim();if(kn==="")return NaN;kn=kn.replace(/,/g,""),kn=kn.replace(/^\s*[<>]=?\s*/,""),kn.endsWith("%")&&(kn=kn.slice(0,-1));const Vn=Number(kn);return Number.isFinite(Vn)?Vn:NaN}function Ls(En){if(En==null)return!0;if(typeof En=="string"){const kn=En.trim();if(kn==="")return!0;const Vn=kn.toLowerCase();return Vn==="null"||Vn==="none"}return!1}function ya(En,kn,Vn){if(En&&!Ls(kn)){if(Vn==="sequential"){const Nn=uo(kn);return isNaN(Nn)?void 0:En.get(Nn)}return En.get(String(kn).trim())}}function jl(En,kn){if(!En||!kn)return;if(En[kn]!==void 0&&En[kn]!=="")return En[kn];if(En.metadata&&En.metadata[kn]!==void 0&&En.metadata[kn]!=="")return En.metadata[kn];const Vn={start:["start","from","begin","pos","coord_start"],end:["end","to","stop","finish","pos2","coord_end"],evalue:["evalue","e_value","E-value","score"],coverage:["coverage","cov","pct_coverage","percent_coverage"]},Nn=String(kn).toLowerCase(),Dn=Vn[Nn]||[kn];for(const On of Dn){if(En[On]!==void 0&&En[On]!=="")return En[On];if(En.metadata&&En.metadata[On]!==void 0&&En.metadata[On]!=="")return En.metadata[On]}if(En.metadata){for(const[On,Pn]of Object.entries(En.metadata))if(On&&String(On).toLowerCase()===Nn&&Pn!==void 0&&Pn!=="")return Pn}}function Ho(En,kn,Vn,Nn,Dn=null){if(!Nn||!Nn.enabled)return En.map(fr=>({...fr,color:[0,0,0,255]}));if(Dn&&Dn.size>0)return En.map(fr=>{const Pr=(_i(fr.leafNode.name)||{})[kn];if(Pr!=null){const Ur=String(Pr),Rr=Dn.get(Ur)||Dn.get(Number(Ur))||[0,0,0,255];return{...fr,color:Rr}}else return{...fr,color:[0,0,0,255]}});const On=new Set;for(const fr of En){const Pr=(_i(fr.leafNode.name)||{})[kn];Pr!=null&&Pr!==""&&On.add(String(Pr))}const Pn=Array.from(On).sort();let Zn=[];if(Nn&&Nn.name)try{Zn=nr(Nn.name,Math.max(Pn.length,Nn.numColors||Pn.length),Nn.reverse||!1)}catch{Zn=[]}const sr={};if(Nn.type==="sequential"&&Pn.length>0&&Pn.every(fr=>!isNaN(Number(fr)))){const fr=Pn.map(Ur=>Number(Ur)),mr=Math.min(...fr),Pr=Math.max(...fr);Pn.forEach(Ur=>{const Rr=Number(Ur),Wr=Pr>mr?(Rr-mr)/(Pr-mr):0,$r=Math.floor(Wr*(Zn.length-1));sr[Ur]=Zn[$r]})}else Pn.forEach((fr,mr)=>{sr[fr]=Zn[mr%Zn.length]});return En.map(fr=>{const Pr=(_i(fr.leafNode.name)||{})[kn];if(Pr!=null){const Ur=String(Pr);return{...fr,color:sr[Ur]||[0,0,0,255]}}else return{...fr,color:[0,0,0,255]}})}const hi=Qt||qt?.colorPalettes?.genePalette,Bs=fn||qt?.colorPalettes?.domainPalette,Li=pn||qt?.colorPalettes?.phyloPalette;mn||qt?.colorPalettes?.ncRNAPalette,reactExports.useEffect(()=>{if(!Wi||Wi.length===0)return;const En=Wi[0]?.id;if(!En)return;const kn=requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!Ts.current?.nodes)return;const Vn=Ts.current.nodes.find(Nn=>Nn.id===En||Nn.name===En||Nn.leaf_id===En||Nn.node?.id===En||Nn.node?.name===En||Nn.node?.leaf_id===En);if(Vn?.color){const Nn=Array.isArray(Vn.color)?[...Vn.color]:Vn.color,Dn=Wi[0]?.color;(!Dn||Nn[0]!==Dn[0]||Nn[1]!==Dn[1]||Nn[2]!==Dn[2])&&Mo(Pn=>Pn?Pn.map(Zn=>({...Zn,color:Nn})):null)}})});return()=>cancelAnimationFrame(kn)},[Wi?.[0]?.id,Gt,Li?.name,Li?.type]);const _a=React.useMemo(()=>{if(!Un)return new Set;if(!ci)return new Set(Un.leaves||[]);try{const En=Un.filterBySelectedNode(ci)||{};if(Array.isArray(En.genes)){const kn=En.genes.map(Vn=>Vn.hood_id).filter(Boolean);return new Set(kn)}}catch{}return new Set(Un.leaves||[])},[Un,ci]),ta=React.useMemo(()=>{if(!Un)return null;const En=yn||Vt||"cluster";if(!ci)return Un.computeGenePrevalence(En);const kn=_a,Vn=kn.size||0;if(Vn===0)return new Map;const Nn=new Map;for(const On of Object.values(Un.genesById)){const Pn=On.hood_id||Un.getHoodIdFromSeqid(On.seqid);if(!Pn||!kn.has(Pn))continue;let Zn=null;if(En==="cluster"?Zn=On.metadata?.cluster??On.metadata?.clusterId??On.cluster:Zn=On.metadata?.[En],Zn==null||Zn==="")continue;const sr=String(Zn);Nn.has(sr)||Nn.set(sr,new Set),Nn.get(sr).add(Pn)}const Dn=new Map;for(const[On,Pn]of Nn)Dn.set(On,Pn.size/Vn);return Dn},[Un,yn,Vt,ci,_a]),Pl=React.useRef(null),lc=React.useRef(null),_l=React.useMemo(()=>{if(!Un||!hi?.enabled)return null;const En=yn||Vt||"cluster",kn=Object.values(Un.genesById),Vn=mr=>{let Pr=mr?.metadata?.[En];return(Pr==null||Pr==="")&&En==="cluster"&&(Pr=mr?.metadata?.clusterId??mr?.metadata?.cluster_id??mr?.cluster),Pr},Nn=kn.map(Vn).map(mr=>normalizeKey(mr)).filter(mr=>!Ls(mr)),Dn=[...new Set(Nn)].sort((mr,Pr)=>{const Ur=Number(mr),Rr=Number(Pr);return!isNaN(Ur)&&!isNaN(Rr)?Ur-Rr:String(mr).localeCompare(String(Pr))});if(Dn.length===0)return null;const On=`${En}-${hi.name}-${hi.numColors}-${hi.reverse}-${Dn.length}`;if(Pl.current&&lc.current===On)return Pl.current;const Zn=Dn.map(mr=>uo(mr)).filter(mr=>!isNaN(mr)).length===Dn.length&&Dn.length>0,sr=nr(hi.name,hi.numColors&&hi.type==="sequential"?hi.numColors:Math.max(Dn.length,hi.numColors||Dn.length),hi.reverse||!1,hi.type||"qualitative"),fr=new Map;if(hi.type==="sequential"&&Zn){const mr=Dn.map(Rr=>uo(Rr)),Pr=Math.min(...mr),Ur=Math.max(...mr);Dn.forEach(Rr=>{const Wr=uo(Rr),$r=Ur>Pr?(Wr-Pr)/(Ur-Pr):0,qr=Math.floor($r*(sr.length-1));fr.set(Wr,sr[qr]);try{fr.set(String(Rr),sr[qr])}catch{}})}else Dn.forEach((mr,Pr)=>{fr.set(String(mr),sr[Pr%sr.length]);const Ur=uo(mr);isNaN(Ur)||fr.set(Ur,sr[Pr%sr.length])});return Pl.current=fr,lc.current=On,console.debug("stableGeneColorMap: generated for",Dn.length,"unique values"),fr},[Un,yn,Vt,hi?.enabled,hi?.name,hi?.numColors,hi?.reverse,hi?.type]),ul=React.useRef(null),Ec=React.useRef(null),Sl=React.useMemo(()=>{if(!us||!Ht||!Gt||!Li?.enabled)return null;const En=new Set;for(const On of us.leafNodes||[]){const Zn=(Ht[On.name]||{})[Gt];Zn!=null&&Zn!==""&&En.add(String(Zn))}const kn=Array.from(En).sort();if(kn.length===0)return null;const Vn=`${Gt}-${Li.name}-${Li.numColors}-${Li.reverse}-${kn.length}`;if(ul.current&&Ec.current===Vn)return ul.current;let Nn=[];try{Nn=nr(Li.name,Math.max(kn.length,Li.numColors||kn.length),Li.reverse||!1,Li.type||"qualitative")}catch{Nn=[]}const Dn=new Map;if(Li.type==="sequential"&&kn.every(On=>!isNaN(Number(On)))){const On=kn.map(sr=>Number(sr)),Pn=Math.min(...On),Zn=Math.max(...On);kn.forEach(sr=>{const fr=Number(sr),mr=Zn>Pn?(fr-Pn)/(Zn-Pn):0,Pr=Math.floor(mr*(Nn.length-1));Dn.set(sr,Nn[Pr]),Dn.set(fr,Nn[Pr])})}else kn.forEach((On,Pn)=>{Dn.set(On,Nn[Pn%Nn.length]);const Zn=Number(On);isNaN(Zn)||Dn.set(Zn,Nn[Pn%Nn.length])});return ul.current=Dn,Ec.current=Vn,console.debug("stableTreeColorMap: generated for",kn.length,"unique values"),Dn},[us,Ht,Gt,Li?.enabled,Li?.name,Li?.numColors,Li?.reverse,Li?.type]),Lo=hi?.stableColors!==!1,cc=Li?.stableColors!==!1,ss=React.useMemo(()=>{if(!Un||!hi?.enabled||Lo&&!_l)return null;const En=yn||Vt||"cluster";let kn=Object.values(Un.genesById);!Lo&&_a&&_a.size>0&&(kn=kn.filter(Pr=>{const Ur=Pr.hood_id||Un.getHoodIdFromSeqid(Pr.seqid);return Ur&&_a.has(Ur)}));const Vn=Pr=>{let Ur=Pr?.metadata?.[En];return(Ur==null||Ur==="")&&En==="cluster"&&(Ur=Pr?.metadata?.clusterId??Pr?.metadata?.cluster_id??Pr?.cluster),Ur},Nn=kn.map(Vn).map(Pr=>normalizeKey(Pr)).filter(Pr=>!Ls(Pr)),Dn=[...new Set(Nn)].sort((Pr,Ur)=>{const Rr=Number(Pr),Wr=Number(Ur);return!isNaN(Rr)&&!isNaN(Wr)?Rr-Wr:String(Pr).localeCompare(String(Ur))});if(Dn.length===0)return null;const Pn=Dn.map(Pr=>uo(Pr)).filter(Pr=>!isNaN(Pr)).length===Dn.length&&Dn.length>0,Zn=new Map,sr=DEFAULT_CONFIG$1.gene.fillColor,fr=hi.transparentByPrevalence?[sr[0],sr[1],sr[2],0]:sr,mr=(hi.prevalenceFilter||0)/100;if(Lo)Dn.forEach(Pr=>{const Ur=ta?.get(String(Pr))||0,Rr=Ur>=mr,Wr=ya(_l,Pr,hi?.type);let $r=Rr?Wr:fr;Rr&&hi.desaturateByPrevalence&&ta&&Un._desaturateColorByPrevalence&&($r=Un._desaturateColorByPrevalence($r,Ur)),Rr&&hi.transparentByPrevalence&&ta&&Un._transparentByPrevalence&&($r=Un._transparentByPrevalence($r,Ur));const qr=hi.type==="sequential"&&Pn?uo(Pr):String(Pr);Zn.set(qr,$r);try{Zn.set(String(Pr),$r)}catch{}const Vr=uo(Pr);isNaN(Vr)||Zn.set(Vr,$r)});else{const Pr=Dn.filter(Rr=>(ta?.get(String(Rr))||0)>=mr),Ur=nr(hi.name,hi.numColors&&hi.type==="sequential"?hi.numColors:Math.max(Pr.length,hi.numColors||Pr.length),hi.reverse||!1,hi.type||"qualitative");if(hi.type==="sequential"&&Pn){const Rr=Pr.map(qr=>uo(qr)),Wr=Math.min(...Rr),$r=Math.max(...Rr);Pr.forEach(qr=>{const Vr=uo(qr),ri=$r>Wr?(Vr-Wr)/($r-Wr):0,Ei=Math.floor(ri*(Ur.length-1));let Di=Ur[Ei];if(hi.desaturateByPrevalence&&ta&&Un._desaturateColorByPrevalence){const Hi=ta.get(String(qr))||0;Di=Un._desaturateColorByPrevalence(Di,Hi)}if(hi.transparentByPrevalence&&ta&&Un._transparentByPrevalence){const Hi=ta.get(String(qr))||0;Di=Un._transparentByPrevalence(Di,Hi)}Zn.set(Vr,Di);try{Zn.set(String(qr),Di)}catch{}})}else Pr.forEach((Rr,Wr)=>{let $r=Ur[Wr%Ur.length];if(hi.desaturateByPrevalence&&ta&&Un._desaturateColorByPrevalence){const Vr=ta.get(String(Rr))||0;$r=Un._desaturateColorByPrevalence($r,Vr)}if(hi.transparentByPrevalence&&ta&&Un._transparentByPrevalence){const Vr=ta.get(String(Rr))||0;$r=Un._transparentByPrevalence($r,Vr)}Zn.set(String(Rr),$r);const qr=uo(Rr);isNaN(qr)||Zn.set(qr,$r)});Dn.forEach(Rr=>{if((ta?.get(String(Rr))||0)<mr){const $r=hi.type==="sequential"&&Pn?uo(Rr):String(Rr);Zn.set($r,fr);try{Zn.set(String(Rr),fr)}catch{}const qr=uo(Rr);isNaN(qr)||Zn.set(qr,fr)}})}return Zn},[Un,_l,ta,_a,hi?.enabled,hi?.type,hi?.name,hi?.numColors,hi?.reverse,hi?.desaturateByPrevalence,hi?.transparentByPrevalence,hi?.prevalenceFilter,hi?.stableColors,Lo,Vt,yn,mi]);React.useEffect(()=>{try{if(!Un)return;const En=yn||Vt||"cluster",Vn=Object.values(Un.genesById||{}).map(Pn=>{let Zn=Pn?.metadata?.[En];return(Zn==null||Zn==="")&&En==="cluster"&&(Zn=Pn?.metadata?.clusterId??Pn?.metadata?.cluster_id??Pn?.cluster),Zn}).filter(Pn=>Pn!=null&&Pn!==""),Nn=[...new Set(Vn)],On=Nn.map(Pn=>uo(Pn)).filter(Pn=>!isNaN(Pn)).length===Nn.length&&Nn.length>0}catch(En){console.error("ColorSelect gene logging error",En)}},[yn,Vt,Un,ss,hi?.name,hi?.type]);const Dl=({object:En,layer:kn})=>{if(!En)return null;if(kn&&kn.id==="protein-polygons"){const Vn=bs.current,Nn=Vn?.genesById?.[En.gAId],Dn=Vn?.genesById?.[En.gBId],On=En.metadata?.similarity??En.similarity??"N/A",Pn=[["type","Protein Link"],["similarity",typeof On=="number"?`${On.toFixed(1)}%`:On]];if(Nn){const fr=Nn.metadata?.gene_name||Nn.metadata?.name||Nn.gene_id||En.gAId,mr=Nn.metadata?.cluster||Nn.metadata?.clusterId||Nn.cluster||"";Pn.push(["source gene",fr]),mr&&String(mr)!==String(fr)&&Pn.push(["source cluster",mr]),Pn.push(["source hood",Nn.hood_id||Nn.seqid||""])}if(Dn){const fr=Dn.metadata?.gene_name||Dn.metadata?.name||Dn.gene_id||En.gBId,mr=Dn.metadata?.cluster||Dn.metadata?.clusterId||Dn.cluster||"";Pn.push(["target gene",fr]),mr&&String(mr)!==String(fr)&&Pn.push(["target cluster",mr]),Pn.push(["target hood",Dn.hood_id||Dn.seqid||""])}const Zn=Pn.filter(([fr,mr])=>mr!==""&&mr!==null&&mr!==void 0);return Zn.length===0?null:{html:`<table>${Zn.map(([fr,mr])=>`<tr><td><b>${fr}</b></td><td style="width:10px"></td><td>${String(mr)}</td></tr>`).join("")}</table>`}}if(kn&&kn.id==="nucleotide-polygons"){let Vn=En.similarity;if(Vn==null&&(Vn=En.metadata?.similarity),Vn==null){const fr=bs.current;if(fr&&fr.nucleotideLinks){const mr=fr.nucleotideLinks.find(Pr=>Pr.hoodA===En.hoodA&&Pr.hoodB===En.hoodB&&Pr.hoodStartA===En.hoodStartA);mr&&(Vn=mr.similarity)}}let Nn="N/A";typeof Vn=="number"&&!isNaN(Vn)?Nn=`${Vn.toFixed(1)}%`:typeof Vn=="string"&&Vn!==""&&(Nn=Vn);const Dn=bs.current;let On="";if(Dn){const fr=Dn.nucleotideLinks?.find(mr=>mr.hoodA===En.hoodA&&mr.hoodB===En.hoodB&&mr.hoodStartA===En.hoodStartA);if(fr){const mr=fr.strandA||"+",Pr=fr.strandB||"+",Ur=!!Dn.trackFlipped[En.hoodA],Rr=!!Dn.trackFlipped[En.hoodB],Wr=mr==="+"!==Ur?"+":"-",$r=Pr==="+"!==Rr?"+":"-";On=`${Wr}/${$r} (${Wr===$r?"same strand":"opposite strand"})`}}const Pn=[["type","Nucleotide Link"],["similarity",Nn],["strand",On],["hood A",En.hoodA||""],["hood B",En.hoodB||""]];En.hoodStartA!==void 0&&En.hoodEndA!==void 0&&Pn.push(["region A",`${Math.round(En.hoodStartA)}-${Math.round(En.hoodEndA)}`]),En.hoodStartB!==void 0&&En.hoodEndB!==void 0&&Pn.push(["region B",`${Math.round(En.hoodStartB)}-${Math.round(En.hoodEndB)}`]);const Zn=Pn.filter(([fr,mr])=>mr!==""&&mr!==null&&mr!==void 0);return Zn.length===0?null:{html:`<table>${Zn.map(([fr,mr])=>`<tr><td><b>${fr}</b></td><td style="width:10px"></td><td>${String(mr)}</td></tr>`).join("")}</table>`}}if(kn&&kn.id==="nodes"&&En.node&&En.node.branchset&&En.node.branchset.length===0){const Vn=En.node.name||En.node.id||En.id,Dn=(Zn=>{if(!Ht)return{};if(!Zn)return{};if(Ht[Zn])return Ht[Zn];const sr=Object.values(Ht);for(let fr=0;fr<sr.length;++fr){const mr=sr[fr];if(mr&&(mr.leaf_id==Zn||mr.leaf_id===Zn||mr.leaf_name==Zn||mr.leaf_name===Zn||mr.id==Zn||mr.id===Zn||mr.name==Zn||mr.name===Zn||mr.originalId==Zn||mr.original_id==Zn))return mr}return{}})(Vn)||{},On=Object.entries(Dn).filter(([Zn,sr])=>{if(!Zn)return!1;const fr=String(Zn).toLowerCase();if(fr==="sequence"||fr==="attributes"||Ls(sr))return!1;const mr=typeof sr;return mr==="string"||mr==="number"||mr==="boolean"});return On.length===0?null:{html:`<table>${On.map(([Zn,sr])=>`<tr><td><b>${Zn}</b></td><td style="width:10px"></td><td>${String(sr)}</td></tr>`).join("")}</table>`}}if(En.metadata){const Vn=En.metadata||{},Nn=Object.entries(Vn).filter(([On,Pn])=>{if(!On)return!1;const Zn=String(On).toLowerCase();if(Zn==="sequence"||Zn==="structure"||Zn==="attributes"||Zn==="clusterid"||Zn==="cluster_id"||Ls(Pn))return!1;const sr=typeof Pn;return sr==="string"||sr==="number"||sr==="boolean"});if(En.metadata.attributes){if(typeof En.metadata.attributes=="object"&&!Array.isArray(En.metadata.attributes))Object.entries(En.metadata.attributes).forEach(([On,Pn])=>{On&&Pn!==null&&Pn!==void 0&&Nn.push([On,String(Pn)])});else if(typeof En.metadata.attributes=="string"){const On=En.metadata.attributes.split(";").filter(Pn=>Pn.trim());for(const Pn of On){const[Zn,sr]=Pn.split("=").map(fr=>fr.trim());Zn&&sr&&Nn.push([Zn,sr])}}}if(ta&&En.metadata&&(yn||Vt)){const On=yn||Vt||"cluster";let Pn=En.metadata[On];if((Pn==null||Pn==="")&&On==="cluster"&&(Pn=En.metadata.clusterId??En.metadata.cluster_id??En.cluster),Pn!=null&&Pn!==""){const Zn=ta.get(String(Pn));if(Zn!==void 0){const sr=(Zn*100).toFixed(1);Nn.push(["prevalence",`${sr}% of hoods`])}}}return Nn.length===0?null:{html:`<table>${Nn.map(([On,Pn])=>`<tr><td><b>${On}</b></td><td style="width:10px"></td><td>${String(Pn)}</td></tr>`).join("")}</table>`}}return En.name?{text:En.name}:En.id?{text:En.id}:En.gene_id?{text:En.gene_id}:null};React.useMemo(()=>!0,[mi,hi?.enabled,hi?.name,hi?.numColors,hi?.reverse]);const{filteredProteinPolygons:Ql,filteredNucleotidePolygons:so}=React.useMemo(()=>{if(!Un)return{filteredProteinPolygons:[],filteredNucleotidePolygons:[]};let En=Un.getProteinPolygons(),kn=Un.getNucleotidePolygons(),Vn=Un.leaves;if(ci)try{const sr=Un.filterBySelectedNode(ci);sr&&Array.isArray(sr.proteinPolygons)&&(En=sr.proteinPolygons.map(fr=>({polygon:fr.polygon||fr.polygon,fillColor:fr.fillColor,metadata:fr.metadata}))),sr&&Array.isArray(sr.nucleotidePolygons)&&(kn=sr.nucleotidePolygons.map(fr=>({polygon:fr.polygon||fr.polygon,fillColor:fr.fillColor,metadata:fr.metadata}))),Vn=sr&&Array.isArray(sr.genes)?sr.genes.map(fr=>fr.hood_id):Vn}catch{}const Nn=new Set;for(let sr=0;sr<Vn.length-1;sr++){const[fr,mr]=[Vn[sr],Vn[sr+1]].sort();Nn.add(`${fr}__${mr}`)}const Dn=En.filter(sr=>{if(!sr.metadata)return!1;const{gAId:fr,gBId:mr,hoodA:Pr,hoodB:Ur,seqids:Rr}=sr.metadata;let Wr=Pr||fr&&Un.genesById[fr]?.hood_id||Rr?.[0],$r=Ur||mr&&Un.genesById[mr]?.hood_id||Rr?.[1];if(gr.size>0&&(Wr!=null&&(gr.has(String(Wr))||gr.has(Number(Wr)))||$r!=null&&(gr.has(String($r))||gr.has(Number($r)))))return!1;if(Wr&&$r){const[qr,Vr]=[Wr,$r].sort();return Nn.has(`${qr}__${Vr}`)}return!1}),On=new Set;for(let sr=0;sr<Vn.length-1;sr++){const[fr,mr]=[Vn[sr],Vn[sr+1]].sort();On.add(`${fr}__${mr}`)}const Pn=new Set,Zn=kn.filter(sr=>{if(!sr.metadata)return!1;const{seqids:fr,hoodA:mr,hoodB:Pr}=sr.metadata;if(!fr||fr.length<2)return!1;const Ur=mr||fr[0],Rr=Pr||fr[1];if(gr.size>0&&(Ur!=null&&(gr.has(String(Ur))||gr.has(Number(Ur)))||Rr!=null&&(gr.has(String(Rr))||gr.has(Number(Rr)))))return!1;const[Wr,$r]=fr.sort(),qr=`${Wr}__${$r}`;return On.has(qr)&&!Pn.has(qr)?(Pn.add(qr),!0):!1});return{filteredProteinPolygons:Dn,filteredNucleotidePolygons:Zn}},[Un,xt,vt,mi,Rn,Tn,ss,hi,ci,gr]),xl=React.useMemo(()=>{if(!Un)return[];try{if(ci){const En=Un.filterBySelectedNode(ci);if(En&&Array.isArray(En.genes))return En.genes.map(kn=>({...kn,fillColor:kn.fillColor||An.geneFill}))}}catch{}return Object.values(Un.genesById).map(En=>({...En,fillColor:En.fillColor||An.geneFill}))},[Un,ss,yn,Vt,An.geneFill,mi,ci]),Jl=React.useCallback(()=>{const En=Un;mn||qt?.colorPalettes?.ncRNAPalette,vn||qt?.colorPalettes?.regionPalette;const kn={genes:null,phylo:null,regions:null,ncRNAs:null,proteinLinks:null,nucleotideLinks:null};try{if(typeof ss<"u"&&ss&&ss.size>0){const Nn=new Set,Dn=Array.from(ss.entries()).filter(([On])=>{const Pn=String(On);return Nn.has(Pn)?!1:(Nn.add(Pn),!0)}).map(([On,Pn])=>({value:String(On),color:Pn,stroke:Array.isArray(Pn)?da(Pn):null}));kn.genes=Dn}else if(En&&En.genesById){const Nn=new Map,Dn=yn||Vt||"cluster",On=Pn=>{try{if(ss){let Zn=Pn?.metadata?.[Dn];if((Zn==null||Zn==="")&&Dn==="cluster"&&(Zn=Pn?.metadata?.clusterId??Pn?.metadata?.cluster_id??Pn?.cluster),Zn!=null&&Zn!==""){const sr=ya(ss,Zn,hi?.type);if(sr)return sr}}}catch{}return Pn.fillColor||An.geneFill};xl.forEach(Pn=>{const Zn=Pn.metadata&&Pn.metadata[Dn]?Pn.metadata[Dn]:null;if(Zn!=null){const sr=String(Zn);if(!Nn.has(sr)){const fr=On(Pn);Nn.set(sr,{value:sr,color:fr,stroke:Array.isArray(fr)?da(fr):null})}}}),kn.genes=Array.from(Nn.values())}const Vn=new Map;if(us&&us.leafNodes&&Array.isArray(us.leafNodes)&&us.leafNodes.length>0&&Ht&&Gt){const Nn=Gt,On=[...new Set(us.leafNodes.map(Zn=>{const fr=(Ht[Zn.name]||{})[Nn];return fr!=null&&fr!==""?fr:null}).filter(Zn=>Zn!==null))].sort();let Pn=[];if(Li&&Li.enabled&&On.length>0)try{Pn=nr(Li.name,Math.max(On.length,Li.numColors||On.length),Li.reverse||!1,Li.type||"qualitative")}catch{Pn=[]}On.forEach((Zn,sr)=>{const fr=String(Zn);let mr=null;if(Pn.length>0&&sr<Pn.length)mr=Pn[sr];else{let Pr=0;for(let $r=0;$r<fr.length;++$r)Pr=fr.charCodeAt($r)+((Pr<<5)-Pr);const Ur=Pr>>0&255,Rr=Pr>>8&255,Wr=Pr>>16&255;mr=[Math.abs(Ur),Math.abs(Rr),Math.abs(Wr),255]}Vn.set(fr,{value:fr,color:mr,stroke:Array.isArray(mr)?da(mr):null})})}if(kn.phylo=Array.from(Vn.values()),En&&Array.isArray(En.proteinLinks)&&En.proteinLinks.length>0){const Nn=Rn||{};if(Nn.colorBy==="identity_gradient"&&Nn.palette&&Nn.palette.enabled){const Dn=En.proteinLinks.map(sr=>typeof sr.similarity=="number"?sr.similarity:0),On=Math.min(...Dn),Pn=Math.max(...Dn);let Zn=[];try{Zn=nr(Nn.palette.name,Nn.palette.numColors||8,Nn.palette.reverse||!1)}catch{Zn=[]}kn.proteinLinks={mode:"identity_gradient",minSim:On,maxSim:Pn,palette:Zn}}else if(Nn.colorBy==="source_gene"||Nn.colorBy==="target_gene"){const Dn=[];En.proteinLinks.forEach(Pn=>{const Zn=En.genesById&&En.genesById[Pn.gAId],sr=En.genesById&&En.genesById[Pn.gBId];if(Nn.colorBy==="source_gene"&&Zn){const fr=yn||Vt||"cluster";let mr=Zn.metadata&&Zn.metadata[fr];Ls(mr)&&fr==="cluster"&&(mr=Zn.cluster);const Pr=ss&&Zn&&!Ls(mr)?ya(ss,normalizeKey(mr),hi?.type)||Zn.fillColor:Zn.fillColor||An.geneFill;Dn.push({id:Pn.gAId,label:Zn.metadata?Zn.metadata[yn||Vt]:Zn.id,color:Pr,stroke:Array.isArray(Pr)?da(Pr):null})}if(Nn.colorBy==="target_gene"&&sr){const fr=yn||Vt||"cluster";let mr=sr.metadata&&sr.metadata[fr];Ls(mr)&&fr==="cluster"&&(mr=sr.cluster);const Pr=ss&&sr&&!Ls(mr)?ya(ss,normalizeKey(mr),hi?.type)||sr.fillColor:sr.fillColor||An.geneFill;Dn.push({id:Pn.gBId,label:sr.metadata?sr.metadata[yn||Vt]:sr.id,color:Pr,stroke:Array.isArray(Pr)?da(Pr):null})}});const On=new Map;Dn.forEach(Pn=>{Pn&&Pn.id&&!On.has(Pn.id)&&On.set(Pn.id,Pn)}),kn.proteinLinks={mode:Nn.colorBy,mapping:Array.from(On.values())}}else kn.proteinLinks={mode:Nn.colorBy,solidColor:Nn.solidColor||null,useAlpha:Nn.useAlpha,minAlpha:Nn.minAlpha,maxAlpha:Nn.maxAlpha}}if(En&&Array.isArray(En.nucleotideLinks)&&En.nucleotideLinks.length>0){const Nn=Tn||{};if(Nn.colorBy==="identity_gradient"&&Nn.palette&&Nn.palette.enabled){const Dn=En.nucleotideLinks.map(sr=>typeof sr.similarity=="number"?sr.similarity:0),On=Math.min(...Dn),Pn=Math.max(...Dn);let Zn=[];try{Zn=nr(Nn.palette.name,Nn.palette.numColors||8,Nn.palette.reverse||!1)}catch{Zn=[]}kn.nucleotideLinks={mode:"identity_gradient",minSim:On,maxSim:Pn,palette:Zn}}else if(Nn.colorBy==="source_gene"||Nn.colorBy==="target_gene"){const Dn=[];En.nucleotideLinks.forEach(Pn=>{const Zn=En.genesById&&En.genesById[Pn.gAId],sr=En.genesById&&En.genesById[Pn.gBId];if(Nn.colorBy==="source_gene"&&Zn){const fr=Zn.metadata&&Zn.metadata[yn||Vt]||Zn.cluster,mr=ss&&Zn&&fr?ya(ss,fr,hi?.type)||Zn.fillColor:Zn.fillColor||An.geneFill;Dn.push({id:Pn.gAId,label:Zn.metadata?Zn.metadata[yn||Vt]:Zn.id,color:mr,stroke:Array.isArray(mr)?da(mr):null})}if(Nn.colorBy==="target_gene"&&sr){const fr=sr.metadata&&sr.metadata[yn||Vt]||sr.cluster,mr=ss&&sr&&fr?ya(ss,fr,hi?.type)||sr.fillColor:sr.fillColor||An.geneFill;Dn.push({id:Pn.gBId,label:sr.metadata?sr.metadata[yn||Vt]:sr.id,color:mr,stroke:Array.isArray(mr)?da(mr):null})}});const On=new Map;Dn.forEach(Pn=>{Pn&&Pn.id&&!On.has(Pn.id)&&On.set(Pn.id,Pn)}),kn.nucleotideLinks={mode:Nn.colorBy,mapping:Array.from(On.values())}}else kn.nucleotideLinks={mode:Nn.colorBy,solidColor:Nn.solidColor||null,useAlpha:Nn.useAlpha,minAlpha:Nn.minAlpha,maxAlpha:Nn.maxAlpha}}try{const Nn=En?En.getAllRegions():[];if(Nn.length>0){const Dn={};if(Nn.forEach(On=>{if(On.fillColor){const Pn=On.getColorKey();Pn!=null&&Pn!==""&&(Dn[String(Pn)]=On.fillColor)}}),Object.keys(Dn).length>0)kn.regions=Dn;else{const On={};Nn.forEach(Pn=>{const Zn=Pn.metadata&&(Pn.metadata.region_type||Pn.metadata.type)?String(Pn.metadata.region_type||Pn.metadata.type):Pn.name||Pn.id||"region",sr=Pn.fillColor||Pn.color||null,fr=Pn.strokeColor||(Array.isArray(sr)?da(sr):null);On[Zn]={color:sr,stroke:fr}}),kn.regions=On}}}catch{}try{const Nn=En?En.getAllNonCodingFeatures():[];if(Nn&&Nn.length>0){const Dn=new Map;Nn.forEach(On=>{const Pn=On.metadata&&On.metadata.type?String(On.metadata.type):On.name||On.id||"ncRNA",Zn=On.fillColor||On.color||null,sr=On.strokeColor||(Array.isArray(Zn)?da(Zn):null);Dn.has(Pn)||Dn.set(Pn,{label:String(Pn),color:Zn,stroke:sr})}),kn.ncRNAs=Array.from(Dn.values())}}catch{}}catch{}return kn},[Un,ss,xl,yn,Vt,An.geneFill,hi,us,Ht,Gt,Li,mn,vn,Rn,Tn,qt]),Ll=React.useRef(null);React.useEffect(()=>{if(typeof Rt!="function"){try{console.debug("[Legend] onLegendChange not provided or not a function:",Rt)}catch{}return}try{const En=Jl();if(!En||typeof En!="object")return;let kn=null;try{kn=JSON.stringify(En)}catch{kn=String(En)}if(Ll.current!==kn){Ll.current=kn;try{(Nn=>!Nn||typeof Nn!="object"?!1:Object.keys(Nn).some(Dn=>{const On=Nn[Dn];return On==null?!1:!!(Array.isArray(On)&&On.length>0||typeof On=="object"&&Object.keys(On).length>0)}))(En)}catch{}try{const Vn={};try{En.genes&&(Vn.genes=Array.isArray(En.genes)?En.genes.length:Object.keys(En.genes||{}).length),En.phylo&&(Vn.phylo=Array.isArray(En.phylo)?En.phylo.length:0),En.regions&&(Vn.regions=Array.isArray(En.regions)?En.regions.length:Object.keys(En.regions||{}).length),En.ncRNAs&&(Vn.ncRNAs=Array.isArray(En.ncRNAs)?En.ncRNAs.length:Object.keys(En.ncRNAs||{}).length),En.proteinLinks&&(Vn.proteinLinks=typeof En.proteinLinks=="object"?Object.keys(En.proteinLinks).length:0),En.nucleotideLinks&&(Vn.nucleotideLinks=typeof En.nucleotideLinks=="object"?Object.keys(En.nucleotideLinks).length:0)}catch{}}catch{}Rt(En)}}catch{}},[Jl,Rt]);const uc=React.useRef(null);React.useEffect(()=>{if(Un)try{const kn=[Un?Object.keys(Un.genesById||{}).length:0,Nt&&typeof Nt=="object"?Object.keys(Nt).length:0,Rn?JSON.stringify(Rn):"",Tn?JSON.stringify(Tn):"",String(yn||""),String(Vt||"")].join("|");uc.current!==kn&&(uc.current=kn,wi(Vn=>Vn+1))}catch{wi(kn=>kn+1)}},[Un,Nt,jt,Rn,Tn,yn,Vt]);const Xa=React.useMemo(()=>{if(!Un||!Bs?.enabled)return null;let En=Un.getAllDomains();$n&&$n!=="all"&&(En=En.filter(fr=>{const mr=fr&&(fr.source||fr.metadata&&fr.metadata.source)||null;return String(mr)===String($n)}));const kn=En.map(fr=>{if(Mn==="domainName")return fr.domainName;const mr=jl(fr,Mn);return mr!==void 0&&mr!==""?mr:void 0}).filter(fr=>fr!=null&&fr!==""),Vn=[...new Set(kn)];if(Vn.length===0)return null;const Dn=Vn.map(fr=>uo(fr)).filter(fr=>!isNaN(fr)).length===Vn.length&&Vn.length>0;let On=Bs.reverse||!1;const Pn=String(Mn).toLowerCase()==="evalue"||String(Mn).toLowerCase()==="e_value";Bs.type==="sequential"&&Dn&&Pn&&(On=!On);const Zn=nr(Bs.name,Bs.numColors&&Bs.type==="sequential"?Bs.numColors:Math.max(Vn.length,Bs.numColors||Vn.length),On,Bs.type||"qualitative"),sr=new Map;if(Bs.type==="sequential"&&Dn){const fr=Vn.map(Wr=>uo(Wr));let mr=fr.slice();(String(Mn).toLowerCase()==="evalue"||String(Mn).toLowerCase()==="e_value")&&(mr=fr.map(Wr=>!isFinite(Wr)||Wr<=0?-Math.log10(Number.MIN_VALUE):-Math.log10(Wr)),mr=mr.map(Wr=>Math.log2(1+Math.max(0,Wr))));const Pr=Math.max(...mr);let Ur=128,Rr=255;try{if(Bs.alphaRange&&Array.isArray(Bs.alphaRange)&&Bs.alphaRange.length===2){let Wr=Number(Bs.alphaRange[0]),$r=Number(Bs.alphaRange[1]);!isNaN(Wr)&&!isNaN($r)&&(Wr<=1&&$r<=1&&(Wr=Wr*255,$r=$r*255),Ur=Math.max(0,Math.min(255,Math.round(Wr))),Rr=Math.max(0,Math.min(255,Math.round($r))))}}catch{}Vn.forEach((Wr,$r)=>{const qr=fr[$r],Vr=mr[$r],Ei=Pr>0?Vr/Pr:0,Di=Math.floor(Ei*(Zn.length-1)),Hi=Zn[Di]||[0,0,0,255],Pi=Math.round(Ur+(Rr-Ur)*Ei),Qi=[Hi[0]!==void 0?Hi[0]:0,Hi[1]!==void 0?Hi[1]:0,Hi[2]!==void 0?Hi[2]:0,Pi];try{sr.set(qr,Qi)}catch{}try{sr.set(String(qr),Qi)}catch{}try{sr.set(String(Wr),Qi)}catch{}})}else Vn.forEach((fr,mr)=>{sr.set(String(fr),Zn[mr%Zn.length]);const Pr=uo(fr);isNaN(Pr)||sr.set(Pr,Zn[mr%Zn.length])});return sr},[Un,Bs,Mn,$n]);React.useEffect(()=>{try{if(!Un)return;const kn=Un.getAllDomains().map(On=>Mn==="domainName"?On.domainName:jl(On,Mn)).filter(On=>On!=null&&On!==""),Vn=[...new Set(kn)],Dn=Vn.map(On=>uo(On)).filter(On=>!isNaN(On)).length===Vn.length&&Vn.length>0}catch(En){console.error("ColorSelect domain logging error",En)}},[Mn,Un,Xa,Bs?.name,Bs?.type,$n]),React.useMemo(()=>{const En=[],kn=_l||ss;if(kn&&kn.size>0){const Dn=new Set,On=[];for(const[sr,fr]of kn.entries())if(typeof sr=="string"){const mr=String(sr).trim();!Dn.has(mr)&&mr.length>0&&(Dn.add(mr),On.push({label:mr,color:fr}))}const Pn=[],Zn=new Set;for(const sr of On)Zn.has(sr.label)||(Zn.add(sr.label),Pn.push(sr));Pn.length>0&&En.push({id:"genes",title:"Gene families",items:Pn.slice(0,20)})}if(Li&&Li.enabled&&us&&Ht&&Gt){const Dn=new Set;us.leafNodes.forEach(Pn=>{const sr=(Ht[Pn.name]||{})[Gt];sr!=null&&sr!==""&&Dn.add(String(sr))});const On=Array.from(Dn).sort();if(On.length>0){let Pn=[];try{Pn=nr(Li.name,Math.max(On.length,Li.numColors||On.length),Li.reverse||!1)}catch{Pn=[]}const Zn=On.map((sr,fr)=>({label:sr,color:Pn[fr%(Pn.length||1)]||[0,0,0,255]}));En.push({id:"phylo",title:"Phylo labels",items:Zn})}}const Vn=[];Un&&Object.values(Un.ncRNAsById||{}).slice(0,20).forEach(Dn=>{const On=Dn.name||Dn.originalId||Dn.id||"ncRNA",Pn=Dn.fillColor||Dn.color||[0,0,0,255];Vn.push({label:String(On),color:Pn})}),Vn.length>0&&En.push({id:"ncrna",title:"ncRNAs",items:Vn});const Nn=Un.getAllRegions();if(Nn.length>0){const Dn=new Map;if(Nn.forEach(On=>{if(On.fillColor){const Pn=On.getColorKey();Pn!=null&&Pn!==""&&Dn.set(Pn,On.fillColor)}}),Dn.size>0){const On=Array.from(Dn.entries()).map(([Pn,Zn])=>({label:String(Pn),color:Zn}));En.push({id:"regions",title:"Regions",items:On})}}if(Rn)if(Rn.palette&&Rn.palette.enabled||Rn.colorBy==="identity_gradient"){let Dn=[];try{Dn=nr(Rn.palette?.name||DEFAULT_CONFIG$1.proteinLink.palette.name,Math.max(Rn.palette?.numColors||6,6),Rn.palette?.reverse||!1)}catch{Dn=[]}const On=(Dn.length>0?Dn:[[100,0,220,255]]).slice(0,12).map((Pn,Zn)=>({label:`${Zn+1}`,color:Pn}));En.push({id:"proteinLinks",title:"Protein links (palette)",items:On})}else Rn.colorBy==="source_gene"||Rn.colorBy==="target_gene"?En.push({id:"proteinLinks",title:"Protein links",note:`Colored by ${Rn.colorBy.replace("_"," ")}`}):En.push({id:"proteinLinks",title:"Protein links",items:[{label:"solid",color:Rn.solidColor||DEFAULT_CONFIG$1.proteinLink.solidColor}]});if(Tn)if(Tn.palette&&Tn.palette.enabled||Tn.colorBy==="identity_gradient"){let Dn=[];try{Dn=nr(Tn.palette?.name||DEFAULT_CONFIG$1.nucleotideLink.palette.name,Math.max(Tn.palette?.numColors||6,6),Tn.palette?.reverse||!1)}catch{Dn=[]}const On=(Dn.length>0?Dn:[[200,200,200,255]]).slice(0,12).map((Pn,Zn)=>({label:`${Zn+1}`,color:Pn}));En.push({id:"nucleotideLinks",title:"Nucleotide links (palette)",items:On})}else En.push({id:"nucleotideLinks",title:"Nucleotide links",items:[{label:"solid",color:Tn.solidColor||DEFAULT_CONFIG$1.nucleotideLink.solidColor}]});return En},[ss,_l,Li,us,Ht,Gt,JSON.stringify(Qt),JSON.stringify(mn),JSON.stringify(vn),Rn,Tn,An,mi]);const rl=React.useMemo(()=>{if(!Un||!us)return new Map;if((tn||qt.tree?.phyloLabelPosition||"after-tree")!=="after-tracks")return new Map;const kn=new Map;return us.leafNodes.forEach(Nn=>{kn.set(Nn.name,-1/0)}),Object.values(Un.genesById).forEach(Nn=>{const Dn=Nn.hood_id||Un.getHoodIdFromSeqid(Nn.seqid);if(Dn&&kn.has(Dn)){const On=kn.get(Dn);kn.set(Dn,Math.max(On,Math.max(Nn.start,Nn.end)))}}),Object.values(Un.ncRNAsById).forEach(Nn=>{const Dn=Nn.hood_id||Un.getHoodIdFromSeqid(Nn.seqid);if(Dn&&kn.has(Dn)){const On=kn.get(Dn);kn.set(Dn,Math.max(On,Math.max(Nn.start,Nn.end)))}}),Un.nucleotideLinks.filter(Nn=>Nn.hood).forEach(Nn=>{if(Nn.hood_id&&kn.has(Nn.hood_id)){const Dn=kn.get(Nn.hood_id);kn.set(Nn.hood_id,Math.max(Dn,Math.max(Nn.start,Nn.end)))}}),kn},[Un,us,tn,qt.tree?.phyloLabelPosition,mi,ws,pn,Gt,Ht,Wt,Kn]),mo=React.useMemo(()=>{const En=JSON.stringify(Qt||qt?.colorPalettes?.genePalette||{}),kn=JSON.stringify(mn||qt?.colorPalettes?.ncRNAPalette||{}),Vn=JSON.stringify(vn||qt?.colorPalettes?.regionPalette||{}),Nn=JSON.stringify(fn||qt?.colorPalettes?.domainPalette||{}),Dn=JSON.stringify(Rn||{}),On=JSON.stringify(Tn||{});return`${En}|${kn}|${Vn}|${Nn}|${Dn}|${On}|${mi}`},[Qt,mn,vn,Rn,Tn,mi,qt]),na=React.useMemo(()=>{const En=new Map;if(!Un)return En;const kn=hi?.enabled,Vn=yn||Vt||"cluster",Nn=Dn=>{if(!Dn)return null;if(Array.isArray(Dn))return Dn.length>=3?Dn:null;if(typeof Dn=="string"){const On=Dn.split(",").map(Pn=>parseInt(Pn.trim(),10)).filter(Pn=>!isNaN(Pn));if(On.length>=3)return On.length===3?[...On,255]:On.slice(0,4)}return null};di&&di.size>0,Nt&&Object.keys(Nt).slice(0,3);for(const Dn in Un.genesById){const On=Un.genesById[Dn];let Pn=null;if(di&&(Pn=di.get(Dn)||di.get(On?.id)||di.get(On?.originalGeneId)||di.get(On?.gene_id),Dn.includes("gene_A1")),!Pn&&Nt){const Zn=On?.id||On?.gene_id||On?.originalGeneId||Dn,sr=Nt[Zn]||Nt[Dn];sr?.color&&(Pn=Nn(sr.color),Dn.includes("gene_A1"))}if(kn){if(!Pn&&ss){const Zn=On?.metadata?.[Vn];if(Zn!=null&&Zn!==""){const sr=normalizeKey(Zn);Pn=ya(ss,sr,hi?.type)}}if(!Pn&&Un.proteinClusters&&Un.proteinClusters[Dn]){const Zn=Un.proteinClusters[Dn];Un.clusterColors&&Un.clusterColors[Zn]&&(Pn=Un.clusterColors[Zn])}}En.set(Dn,Pn||null)}return[...En.entries()].filter(([,Dn])=>Dn!==null),En},[Un,Un?._paletteVersion,hi?.enabled,hi?.type,hi?.prevalenceFilter,mo,ss,yn,Vt,di,Nt]);React.useMemo(()=>{if(!Un)return[];const En=Ct instanceof Set?Ct:null,kn=Dn=>Dn?.gene_id||Dn?.originalGeneId||Dn?.originalId||Dn?.id||Dn?.uniqueId||"",Vn=Dn=>{const On=kn(Dn),Pn=Dn?.hood_id??Dn?.hoodId;return ii(Pn)||ti.size>0&&On&&ti.has(String(On))?!1:En&&On?En.has(String(On)):!0};if(ci)try{const Dn=Un.filterBySelectedNode(ci);if(Dn&&Array.isArray(Dn.genes))return Dn.genes.filter(Vn).map(On=>{const Pn=On.uniqueId||On.id||"";return{id:Pn,gene:On,start:On.start,end:On.end,strand:On.strand,trackY:On.trackY,fillColor:na.get(Pn)||An.geneFill||[200,200,200,255]}})}catch{}const Nn=Object.entries(Un.genesById).filter(([,Dn])=>Vn(Dn)).map(([Dn,On])=>({id:Dn,gene:On,start:On.start,end:On.end,strand:On.strand,trackY:On.trackY,fillColor:na.get(Dn)||An.geneFill||[200,200,200,255]}));return Nn.filter(Dn=>Dn.fillColor&&Dn.fillColor[0]!==200),Nn},[Un,Un?._paletteVersion,hi?.enabled,na,An,mo,Ct,ti,ii,ci,mi,Kn,gn]);const dl=React.useMemo(()=>JSON.stringify(Rn),[Rn]),Tl=React.useMemo(()=>JSON.stringify(Tn),[Tn]),Rl=React.useMemo(()=>{if(!Un||!Un.proteinLinks||!Array.isArray(Un.proteinLinks))return[];Rn&&Un.applyProteinLinkColors(Rn,An.geneFill);let En=null;if(ci&&Un.getNodeDescendantLeaves)try{const Vn=Un.getNodeDescendantLeaves(ci);Array.isArray(Vn)&&Vn.length>0&&(En=new Set(Vn))}catch(Vn){console.warn("[proteinLinkData] Error getting descendant leaves:",Vn)}const kn=Vn=>{if(!Vn)return null;const Nn=Vn.attributes;let Dn=null;if(Nn)if(typeof Nn=="string"){const On=Nn.match(/ID=([^;]+)/);Dn=On?On[1]:null}else typeof Nn=="object"&&(Dn=Nn.ID||Nn.gene_id||Nn.protein_id||null);return Vn.originalGeneId||Vn.gene_id||Dn||Vn.uniqueId};return Un.proteinLinks.filter(Vn=>{const Nn=Un.genesById[Vn.gAId],Dn=Un.genesById[Vn.gBId],On=Nn?.hood_id,Pn=Dn?.hood_id;if(ii(On)||ii(Pn))return!1;if(ti.size>0){const Zn=kn(Nn),sr=kn(Dn);if(Zn&&ti.has(String(Zn))||sr&&ti.has(String(sr)))return!1}return En?On&&Pn&&En.has(On)&&En.has(Pn):!0}).map((Vn,Nn)=>{let Dn=Vn.fillColor||[150,150,150,255];if(hi?.transparentByPrevalence&&ss){const On=Un.genesById[Vn.gAId],Pn=Un.genesById[Vn.gBId],Zn=yn||Vt||"cluster";let sr=On?.metadata?.[Zn];(sr==null||sr==="")&&Zn==="cluster"&&(sr=On?.metadata?.clusterId??On?.metadata?.cluster_id??On?.cluster);const fr=sr!=null&&sr!==""?ya(ss,sr,hi?.type):null;let mr=Pn?.metadata?.[Zn];(mr==null||mr==="")&&Zn==="cluster"&&(mr=Pn?.metadata?.clusterId??Pn?.metadata?.cluster_id??Pn?.cluster);const Pr=mr!=null&&mr!==""?ya(ss,mr,hi?.type):null,Ur=fr&&Array.isArray(fr)&&fr.length>=4?fr[3]/255:0,Rr=Pr&&Array.isArray(Pr)&&Pr.length>=4?Pr[3]/255:0,Wr=Math.min(Ur,Rr),$r=Array.isArray(Dn)&&Dn.length>=4?Dn[3]/255:1,qr=Math.round($r*Wr*255);Dn=Array.isArray(Dn)?[Dn[0],Dn[1],Dn[2],qr]:Dn}return{id:`${Vn.gAId}|${Vn.gBId}|${Nn}`,gAId:Vn.gAId,gBId:Vn.gBId,metadata:Vn.metadata||Vn,fillColor:Dn,_k:`${mi}_${Nn}`}})},[Un,Un?.proteinLinks,Un?._paletteVersion,mo,mi,dl,ss,ci,ii,ti,hi?.enabled,hi?.transparentByPrevalence,hi?.prevalenceFilter,yn,Vt,An.geneFill]);React.useEffect(()=>{},[ci]);const Ma=React.useMemo(()=>{if(!Un||!Un.nucleotideLinks||!Array.isArray(Un.nucleotideLinks))return[];Tn&&Un.applyNucleotideLinkColors(Tn);let En=null;if(ci&&Un.getNodeDescendantLeaves)try{const Vn=Un.getNodeDescendantLeaves(ci);Array.isArray(Vn)&&Vn.length>0&&(En=new Set(Vn))}catch{}return Un.nucleotideLinks.filter(Vn=>{const Nn=Vn.hoodA,Dn=Vn.hoodB;if(ii(Nn)||ii(Dn))return!1;if(!En)return!0;const On=En.has(Nn),Pn=En.has(Dn),Zn=On&&Pn;return!Zn&&Un.nucleotideLinks.indexOf(Vn)<5,Zn}).map((Vn,Nn)=>({id:`${Vn.seqidA}:${Vn.startA}-${Vn.endA}|${Vn.seqidB}:${Vn.startB}-${Vn.endB}|${Nn}`,seqidA:Vn.seqidA,seqidB:Vn.seqidB,hoodA:Vn.hoodA||Vn.seqidA,hoodB:Vn.hoodB||Vn.seqidB,hoodStartA:Vn.hoodStartA??Vn.startA,hoodEndA:Vn.hoodEndA??Vn.endA,hoodStartB:Vn.hoodStartB??Vn.startB,hoodEndB:Vn.hoodEndB??Vn.endB,similarity:Vn.similarity,metadata:{similarity:Vn.similarity},fillColor:Vn.fillColor||[200,100,100,255],_k:`${mi}_${Nn}`}))},[Un,Un?.nucleotideLinks,mo,mi,Tl,ci,ii]),kr=React.useMemo(()=>{const En=ir||qt,kn=typeof nn=="number"?nn:En.gene?.height||En.gene?.defaultHeight||DEFAULT_CONFIG$1.gene.height,Vn=typeof Zt=="number"?Zt:En.gene?.arrowheadHeight??DEFAULT_CONFIG$1.gene.arrowheadHeight,Nn=typeof gn=="number"?gn:En.tree?.ySpacing||DEFAULT_CONFIG$1.tree.ySpacing,Dn=typeof Kn=="number"?Kn:En.genome?.xScalePercent||DEFAULT_CONFIG$1.genome.xScalePercent,On=typeof Hn=="number"?Hn:En.gene?.edgeWidth||DEFAULT_CONFIG$1.gene.edgeWidth,Pn=typeof wn=="number"?wn:En.text?.phyloLabelSize||DEFAULT_CONFIG$1.text.phyloLabelSize,Zn=typeof Xn=="number"?Xn:En.text?.geneLabelSize||DEFAULT_CONFIG$1.text.geneLabelSize,sr=typeof tr=="number"?tr:En.text?.rulerLabelSize||DEFAULT_CONFIG$1.text.rulerLabelSize;return{...En,debug:{...En.debug,alignment:En?.debug?.alignment||!1},tree:{...En.tree,xScalePercent:ws,ySpacing:Nn},gene:{...En.gene,height:kn,arrowheadHeight:Vn,edgeWidth:On,tipWidthMode:rn??En.gene?.tipWidthMode??DEFAULT_CONFIG$1.gene.tipWidthMode,tipWidthFactor:on??En.gene?.tipWidthFactor??DEFAULT_CONFIG$1.gene.tipWidthFactor,tipWidthFixed:ln??En.gene?.tipWidthFixed??DEFAULT_CONFIG$1.gene.tipWidthFixed},genome:{...En.genome,xScalePercent:Dn},domain:{...En.domain},text:{...En.text,phyloLabelSize:Pn,geneLabelSize:Zn,rulerLabelSize:sr},stroke:{...En.stroke,lineWidth:On}}},[ir,qt,ws,nn,Zt,rn,on,ln,gn,Kn,Hn,wn,Xn,tr]);reactExports.useEffect(()=>{if(!ys||ys.length===0)return;const En=An.treeEdges||[100,180,255,255],kn=ys[0]?.color;(!kn||En[0]!==kn[0]||En[1]!==kn[1]||En[2]!==kn[2])&&Va(Nn=>Nn?Nn.map(Dn=>({...Dn,color:En})):null)},[An.treeEdges,ys?.length]),reactExports.useEffect(()=>{if(!ys||ys.length===0||!Ts.current?.nodes)return;const En=ys[0]?.id;if(!En)return;const kn=requestAnimationFrame(()=>{const Vn=Ts.current.nodes.find(Nn=>Nn.id===En);if(Vn){const Nn=(kr.tree?.xScalePercent||100)/100,Dn=Ii?.treeOffset||0,On=Number(Vn.rawY),Pn=Number(Vn.x);if(Number.isFinite(On)&&Number.isFinite(Pn)){const Zn=[On*Nn+Dn,Pn];Va(sr=>sr?sr.map(fr=>({...fr,position:Zn})):null)}}});return()=>cancelAnimationFrame(kn)},[kr.tree?.xScalePercent,Ii?.treeOffset,kr.tree?.ySpacing,ys?.[0]?.id]),reactExports.useEffect(()=>{if(!Wi||Wi.length===0||!Ts.current?.nodes)return;const En=Wi[0]?.id;if(!En)return;const kn=requestAnimationFrame(()=>{const Vn=Ts.current.nodes.find(Nn=>Nn.id===En||Nn.name===En||Nn.leaf_id===En||Nn.node?.id===En||Nn.node?.name===En||Nn.node?.leaf_id===En);if(Vn){const Nn=(kr.tree?.xScalePercent||100)/100,Dn=Ii?.treeOffset||0,On=Number(Vn.rawY),Pn=Number(Vn.x);if(Number.isFinite(On)&&Number.isFinite(Pn)){const Zn=[On*Nn+Dn,Pn];Mo(sr=>sr?sr.map(fr=>({...fr,position:Zn})):null)}}});return()=>cancelAnimationFrame(kn)},[kr.tree?.xScalePercent,Ii?.treeOffset,kr.tree?.ySpacing,Wi?.[0]?.id]);const kl=React.useCallback((En,kn=null)=>{if(!En)return null;const Vn=kr.gene?.height||kr.gene?.geneHeight||20,Nn=kr.gene?.arrowheadHeight||10,Dn=(kr.genome?.xScalePercent||100)/100,On=En.gene||En,Pn=kn??En.trackY??On.trackY??0,Zn=(En.start??On.start)*Dn,sr=(En.end??On.end)*Dn,fr=En.strand??On.strand,mr=Vn/2,Pr=Nn/2,Ur=Math.abs(sr-Zn),Rr=calculateTipWidth(Ur,kr);if(Rr<1){const Wr=Math.min(Zn,sr),$r=Math.max(Zn,sr);return[[Wr,Pn-mr],[$r,Pn-mr],[$r,Pn+mr],[Wr,Pn+mr]]}if(fr==="+"||fr===1){const Wr=Math.max(Zn,sr-Rr);return[[Zn,Pn-mr],[Wr,Pn-mr],[Wr,Pn-mr-Pr],[sr,Pn],[Wr,Pn+mr+Pr],[Wr,Pn+mr],[Zn,Pn+mr]]}else{const Wr=Math.min(sr,Zn+Rr);return[[sr,Pn-mr],[Wr,Pn-mr],[Wr,Pn-mr-Pr],[Zn,Pn],[Wr,Pn+mr+Pr],[Wr,Pn+mr],[sr,Pn+mr]]}},[kr.gene?.height,kr.gene?.geneHeight,kr.gene?.arrowheadHeight,kr.genome?.xScalePercent,kr.gene?.tipWidthFactor,kr.gene?.tipWidthMode,kr.gene?.tipWidthFixed]);reactExports.useEffect(()=>{if(!Mi||Mi.length===0)return;const En=Mi[0];if(En.polygon&&Array.isArray(En.polygon)&&En.polygon.length>0)return;const kn=En.gene||En,Vn=En.id||En.uniqueId||En.gene?.uniqueId||En.gene?.id,Nn=kn.hood_id||En.hood_id;let Dn=null;if(Un&&Nn&&typeof Un.getTrackYByHoodId=="function"&&(Dn=Un.getTrackYByHoodId(Nn)),Dn===null&&Un&&Vn&&Un.genesById){const sr=Un.genesById[Vn];sr&&(Dn=sr.trackY)}const Pn=ss?.get?.(Vn)||En.fillColor||En.gene?.fillColor||An.geneFill||qt.gene?.fillColor||[100,200,255,255],Zn=kl(En,Dn);Zn&&Wa(sr=>!sr||sr.length===0?null:sr.map(fr=>({...fr,polygon:Zn,fillColor:Pn,trackY:Dn??fr.trackY})))},[Mi,kl,An.geneFill,qt.gene?.fillColor,ss,Un]),reactExports.useEffect(()=>{if(!Mi||Mi.length===0||!Un||!Mi[0]?.polygon)return;const En=Mi[0],kn=En.id||En.uniqueId||En.gene?.uniqueId||En.gene?.id,Vn=En.gene||En,Nn=Vn.hood_id||En.hood_id,Dn=requestAnimationFrame(()=>{let On=null,Pn=En.start??Vn.start,Zn=En.end??Vn.end,sr=En.strand??Vn.strand;if(kn&&Un.genesById){const Rr=Un.genesById[kn];Rr&&(On=Rr.trackY,Pn=Rr.start,Zn=Rr.end,sr=Rr.strand)}On===null&&Nn&&typeof Un.getTrackYByHoodId=="function"&&(On=Un.getTrackYByHoodId(Nn));const mr=ss?.get?.(kn)||En.fillColor||En.gene?.fillColor||An.geneFill||qt.gene?.fillColor||[100,200,255,255],Pr={...En,start:Pn,end:Zn,strand:sr,trackY:On??En.trackY},Ur=kl(Pr,On);Ur&&Wa(Rr=>!Rr||Rr.length===0?null:Rr.map(Wr=>({...Wr,polygon:Ur,fillColor:mr,start:Pn,end:Zn,strand:sr,trackY:On??Wr.trackY})))});return()=>cancelAnimationFrame(Dn)},[An.geneFill,qt.gene?.fillColor,kr.gene?.height,kr.gene?.geneHeight,kr.gene?.arrowheadHeight,kr.genome?.xScalePercent,kr.gene?.tipWidthFactor,kr.tree?.ySpacing,gn,Kn,mi,ss,kl,Un]),reactExports.useEffect(()=>{if(!_o||_o.length===0||!Un)return;const kn=_o[0].id;if(!kn)return;const Vn=requestAnimationFrame(()=>{const On=(Un.getAllRegions?.()||[]).find(Pn=>Pn.id===kn);On&&lo(Pn=>{if(!Pn||Pn.length===0)return null;const Zn=On.fillColor||On.strokeColor||[255,180,50,255];return Pn.map(sr=>({...sr,polygon:On.polygon,startX:On.start,endX:On.end,strokeColor:Zn,fillColor:Zn,trackY:On.trackY}))})});return()=>cancelAnimationFrame(Vn)},[Un,kr.gene?.height,kr.gene?.geneHeight,kr.gene?.arrowheadHeight,kr.region?.padding,kr.tree?.ySpacing,kr.genome?.xScalePercent,gn,Kn,mi,mo]);const bo=React.useMemo(()=>{if(!Un||!us)return new Set;let En=Un.leaves||[];if(ci)try{const kn=typeof Un.getNodeDescendantLeaves=="function"?Un.getNodeDescendantLeaves(ci):us&&typeof us.getNodeDescendantLeaves=="function"?us.getNodeDescendantLeaves(ci):[];En=Array.isArray(kn)?kn:[]}catch{En=Un.leaves||[]}if(Qn){const kn=typeof Qn=="string"?Qn:Qn?.id!=null?String(Qn.id):null;kn&&!new Set(En).has(kn)&&(En=[...En,kn])}return new Set(En)},[Un,us,ci,Qn,gr]),Ys=React.useMemo(()=>{if(performance.now(),!Un||!us)return[];const En=`${Object.keys(Un.genesById).length}:${kr.gene.height}:${kr.gene.arrowheadHeight}:${kr.domain.heightFactor||.6}:${kr.genome.xScalePercent}:${kr.tree.ySpacing}:${mi}:${Lt}:${Pt||""}:${kt}:${ci?.id??"null"}:${bo.size}:${gr.size}:${ti.size}:${kr.gene.tipWidthMode}:${kr.gene.tipWidthFactor}:${kr.gene.tipWidthFixed}`,kn=qo.current===En,Vn=al.current===ws,Nn=qo.current===null,Dn=kn&&!Vn,On=kn&&Vn;if((Dn||On)&&!Nn)al.current=ws,Un.config=kr;else{const Fn=performance.now();try{Un.config=kr,typeof Un.computeTrackPositions=="function"&&Un.computeTrackPositions();const Gn=performance.now();for(const er in Un.genesById){const Er=Un.genesById[er];if(Er&&(Er.config=kr,Er.geneHeight=kr.gene.height,typeof Er.updatePolygon=="function"))try{Er.updatePolygon()}catch{}}}catch{}performance.now();for(const Gn in Un.ncRNAsById){const er=Un.ncRNAsById[Gn];er.config=kr,typeof kr?.gene?.height=="number"&&(er.featureHeight=kr.gene.height),er.updatePolygon&&er.updatePolygon()}performance.now();for(const Gn in Un.genesById){const er=Un.genesById[Gn];if(er&&er.domains)for(const Er of er.domains)Er.config=kr,Er.updatePolygon&&Er.updatePolygon()}Un._cachedAllDomains=void 0,performance.now(),Un.proteinLinks&&Un.proteinLinks.forEach(Gn=>{Gn.config=kr,Gn.updatePolygon&&Gn.updatePolygon()}),performance.now(),Un.nucleotideLinks&&Un.nucleotideLinks.forEach(Gn=>{Gn.config=kr,Gn.updatePolygon&&Gn.updatePolygon()}),performance.now(),Un.getAllRegions().forEach(Gn=>{Gn.config=kr;const er=Un.getTrackYByHoodId(Gn.hood_id);er!=null&&Gn.updatePolygon([],er)}),performance.now()-Fn,qo.current=En,al.current=ws,To.current=null}const Pn=`${En}:${ws}:${ci?.id??"null"}:${tn}:${Xt}`,Zn=On&&To.current===Pn,sr=`${Object.keys(Un.genesById).length}:${mi}:${ws}:${ci?.id??"null"}:${Xt}:${Lt}:${Pt||""}:${kt}:${gr.size}:${bo.size}:${kr.tree.ySpacing}:${kr.genome.xScalePercent}:${tn}:${wn}`,fr=$l.current?.signature===sr,mr=Ts.current?.structuralSignature===sr;performance.now();const Pr=vo(Un,us,tn,ws,!0,ms),Ur=Pr.treeOffset||0;Zl.current=Pr,performance.now();const Rr=(Ql||[]).map((Fn,Ln)=>({...Fn,polygon:Fn.polygon,fillColor:Fn.fillColor||An.proteinFill||Fn.fillColor,_alignmentKey:`${mi}_${Ln}`}));performance.now();const Wr=(so||[]).map((Fn,Ln)=>({...Fn,polygon:Fn.polygon,fillColor:Fn.fillColor||An.nucleotideFill||Fn.fillColor,_alignmentKey:`${mi}_${Ln}`}));performance.now();const $r=Fn=>{if(ti.size===0)return!1;const Ln=Fn.gene_id||Fn.geneId||Fn.metadata?.gene_id||Fn.metadata?.geneId||Fn.metadata?.Parent;return Ln?ti.has(String(Ln)):!1},qr=(Un.getAllRegions()||[]).filter(Fn=>{if(ii(Fn.hood_id)||$r(Fn))return!1;if(!ci)return!0;try{return bo.has(Fn.hood_id)}catch{return!0}}).map(Fn=>{let Ln=Fn.fillColor,Gn,er;return!Ln||Array.isArray(Ln)&&Ln[3]===0?(Gn=Fn.strokeColor||[100,100,100,255],er=[0,0,0,0]):(Gn=Ln,er=[0,0,0,0]),{polygon:Fn.polygon,fillColor:er,strokeColor:Gn,strokeWidth:Fn.strokeWidth,metadata:Fn.metadata,hood_id:Fn.hood_id,seqid:Fn.seqid,start:Fn.start,end:Fn.end,trackY:Fn.trackY,type:Fn.type||"region",id:Fn.id||Fn.metadata?.ID||`${Fn.hood_id}:${Fn.start}-${Fn.end}`}});Ta.current=qr,performance.now(),performance.now();const Vr=Un.getAllDomains();let ri=[];const Ei=Fn=>{const Gn=(Fn.gene||Fn.geneId&&Un.genesById[Fn.geneId])?.hood_id??Fn.hood_id;return ii(Gn)},Di=Fn=>{if(ti.size===0)return!1;const Ln=Fn.gene||Fn.geneId&&Un.genesById[Fn.geneId];if(!Ln)return!1;const Gn=typeof Ln.attributes=="string"?Ln.attributes.match(/ID=([^;]+)/)?.[1]||null:Ln.attributes?.ID||null,er=Ln.originalGeneId||Ln.gene_id||Gn||Fn.geneId;return er&&ti.has(String(er))};if(Vr.length!==0){let Fn=Vr;if(ci)try{const Ln=Un.filterBySelectedNode(ci);Ln&&Array.isArray(Ln.domains)&&(Fn=Ln.domains)}catch{}$n&&$n!=="all"&&(Fn=Fn.filter(Ln=>{const Gn=Ln&&(Ln.source||Ln.metadata&&Ln.metadata.source)||null;return String(Gn)===String($n)})),gr.size>0&&(Fn=Fn.filter(Ln=>!Ei(Ln))),ti.size>0&&(Fn=Fn.filter(Ln=>!Di(Ln))),performance.now(),ri=Fn.map(Ln=>{let Gn;if(!Bs||!Bs.enabled?Gn=An.domainFill:Gn=Ln.fillColor||An.domainFill,Xa){const er=Mn==="domainName"?Ln.domainName:jl(Ln,Mn);if(er!==void 0){const Er=ya(Xa,er,Bs?.type);Er&&(Gn=Er)}}if(hi?.transparentByPrevalence&&Ln.geneId&&ss){const er=Un.genesById[Ln.geneId];if(er){const Er=yn||Vt||"cluster";let Tr=er?.metadata?.[Er];(Tr==null||Tr==="")&&Er==="cluster"&&(Tr=er?.metadata?.clusterId??er?.metadata?.cluster_id??er?.cluster);const ai=Tr!=null&&Tr!==""?ya(ss,Tr,hi?.type):null;if(ai&&Array.isArray(ai)&&ai.length>=4){const Yr=ai[3]/255,li=Array.isArray(Gn)&&Gn.length>=4?Gn[3]/255:1,yi=Math.round(li*Yr*255);Gn=Array.isArray(Gn)?[Gn[0],Gn[1],Gn[2],yi]:Gn}else ai||(Gn=Array.isArray(Gn)?[Gn[0],Gn[1],Gn[2],0]:Gn)}}return{...Ln,fillColor:Gn,polygon:Ln.polygon?[...Ln.polygon]:null}})}performance.now();let Hi;if(fr)Hi=$l.current.data;else{const Fn=er=>{const Er=Un.hoodRanges[er],Tr=Un.hoodToSeqidMap[er],ai=Un.nucleotidesBySeqid[Tr];if(!Er||!ai)return null;const Yr=Un.trackOffset[er]||0,li=!!Un.trackFlipped[er],yi=Er.length/2,Ri=0,Ki=Er.length,ns=Un.constructor.getTransformedXUnified(Ri,yi,Yr,li),Vs=Un.constructor.getTransformedXUnified(Ki,yi,Yr,li),Ps=kr.genome&&typeof kr.genome.xScalePercent=="number"?kr.genome.xScalePercent/100:1,ks=yi+(ns-yi)*Ps,Ms=yi+(Vs-yi)*Ps,fo=Un.getTrackYByHoodId(er);return fo==null?null:{hood_id:er,seqid:Tr,start:ks,end:Ms,trackY:fo}},Ln=Object.keys(Un.hoodRanges||{});let Gn=ci?Array.from(bo):Ln;if(Gn.length||(Gn=Ln),Hi=Gn.filter(er=>!Un.hoodRanges[er]||gr.size>0&&(gr.has(String(er))||gr.has(Number(er)))?!1:Un.getTrackYByHoodId(er)!=null).map(Fn).filter(Boolean),!Hi.length&&Gn.length){try{Un.computeTrackPositions()}catch{}Hi=Gn.filter(er=>!Un.hoodRanges[er]||gr.size>0&&(gr.has(String(er))||gr.has(Number(er)))?!1:Un.getTrackYByHoodId(er)!=null).map(Fn).filter(Boolean)}$l.current={data:Hi,signature:sr}}performance.now();const Pi=po?us.buildEdges().filter(Fn=>{if(!ci)return!0;try{const Ln=Un.getNodeDescendantLeaves(Fn.target)||[];return!Array.isArray(Ln)||Ln.length===0?!1:Ln.every(Gn=>bo.has(Gn))}catch{return!1}}).map(Fn=>({rawPath:Fn.path,metadata:{source:Fn.source.name||`internal_${Fn.source.id}`,target:Fn.target.name||`internal_${Fn.target.id}`,length:Fn.target.branchLength||0,type:"phylo_edge"},color:An?.treeEdges||qt.tree.edgeColor||[85,85,85,255]})):[];performance.now();const Qi=tn||qt.tree?.phyloLabelPosition||"after-tree",Si=sn!==void 0?sn:qt.tree?.alignLabels!==void 0?qt.tree.alignLabels:!0,Ci=Wt?Array.isArray(Wt)?Wt:Wt.split(",").map(Fn=>Fn.trim()).filter(Boolean):null;let Ai=[],Xs="";if(po){let Fn=us.leafNodes.filter(er=>!ci||bo.has(er.name)).map(er=>{const Er=typeof _i=="function"?_i(er.name):Ht?.[er.name]||{};let Tr;if(Ci&&Ci.length>0){const Yr=Ci.map(li=>li==="name"?er.name:Er[li]).filter(li=>li!=null&&li!=="");Tr=Yr.length>0?Yr.join(" | "):er.name}else Tr=Er[Wt],Tr==null&&(Tr=er.name);typeof Tr!="string"&&(Tr=String(Tr));let ai;if(Li&&Li.enabled){const Yr=Er[Gt];Yr!=null?ai=nl(Yr):ai=An.phyloLabelFill||[0,0,0,255]}else ai=An.phyloLabelFill||[0,0,0,255];return{rawY:er.y,x:er.x,text:Tr,color:ai,size:kr.text.phyloLabelSize,textAnchor:"start",alignmentBaseline:"center",leafNode:er,labelPosition:Qi,rightmostX:Qi==="after-tracks"?rl.get(er.name):null}});const Ln=er=>{if(!er)return null;if(Array.isArray(er))return er.length>=3?er:null;if(typeof er=="string"){const Er=er.split(",").map(Tr=>parseInt(Tr.trim(),10)).filter(Tr=>!isNaN(Tr));if(Er.length>=3)return Er.length===3?[...Er,255]:Er.slice(0,4)}return null};let Gn;Li&&Li.enabled&&Ht?Gn=Ho(Fn,Gt,Ht,Li,cc?Sl:null).map(Er=>{if(Bi){const Yr=Bi.get(Er.leafNode.name);if(Yr)return{...Er,color:Yr}}const Tr=_i(Er.leafNode.name);if(Tr?.color){const Yr=Ln(Tr.color);if(Yr)return{...Er,color:Yr}}const ai=Ht?.[Er.leafNode.name]?.[Gt];return ai!=null&&ai!==""?Er:{...Er,color:An.phyloLabelFill}}):Gn=Fn.map(er=>{if(Bi){const Tr=Bi.get(er.leafNode.name);if(Tr)return{...er,color:Tr}}const Er=_i(er.leafNode.name);if(Er?.color){const Tr=Ln(Er.color);if(Tr)return{...er,color:Tr}}return{...er,color:An.phyloLabelFill}}),Ai=Gn.filter(er=>Number.isFinite(er.rawY)&&Number.isFinite(er.x)&&typeof er.text=="string"&&er.text.trim()!==""),Ai.length===0&&Ai.push({rawY:0,x:0,text:"_",color:[0,0,0,0],size:1,textAnchor:"start"}),Xs=Ai.map(er=>Array.isArray(er.color)?er.color.join(","):String(er.color)).join("|")}performance.now();const Ks=qt?.tree?.nodeRadius||{internal:4,leaf:2};let fa=`${us.allNodes.length}:${ci?.id||"null"}:${Ks?.internal||4}:${Ks?.leaf||2}:${Xt}:${kr.tree.ySpacing}`;const ra=po&&(mr||Zn)&&Ts.current&&Ts.current.geometrySignature===fa;let Qs;if(!po)Qs=[],fa="no-tree";else if(ra){const Fn=new Map;Ai&&Array.isArray(Ai)&&Ai.forEach(Ln=>{Ln.leafNode&&Ln.leafNode.name&&Fn.set(Ln.leafNode.name,Ln.color)}),Qs=Ts.current.nodes.map(Ln=>{let Gn;const er=Ln.node;return er.branchset.length>0?Gn=An.treeEdges||[0,0,0,255]:Gn=Fn.get(er.name)||An.treeEdges||[100,100,100,255],{...Ln,color:Gn}}),Ts.current={...Ts.current,nodes:Qs}}else{const Fn=ci?bo:null,Ln=new Map;Ai&&Array.isArray(Ai)&&Ai.forEach(Gn=>{Gn.leafNode&&Gn.leafNode.name&&Ln.set(Gn.leafNode.name,Gn.color)}),Qs=us.allNodes.filter(Gn=>{if(!ci)return!0;try{const er=Un.getNodeDescendantLeaves(Gn)||[];return er.length===0?!1:er.every(Er=>Fn.has(Er))}catch{return!1}}).map(Gn=>{const er=Un.getNodeDescendantLeaves(Gn);!ci||er.some(Ki=>Fn.has(Ki));let Er;const Tr=Gn.metadata||_i(Gn.name)||{},ai=Tr.leaf_id||Gn.leaf_id;if(!Gn.leaf_id&&ai&&(Gn.leaf_id=ai),!Gn.metadata&&Object.keys(Tr).length&&(Gn.metadata=Tr),Gn.branchset.length>0)Er=An.treeEdges||[0,0,0,255];else{const Ki=Ln.get(Gn.name);if(Ki)Er=Ki;else{const Vs=(Gn.metadata||{})[Gt];if(Vs&&Li&&Li.enabled)try{const ks=[...new Set(us.leafNodes.map(fo=>{const Qo=(Ht&&Ht[fo.name]||{})[Gt];return Qo!=null&&Qo!==""?Qo:null}).filter(fo=>fo!==null))].sort(),Ms=ks.indexOf(Vs);if(Ms>=0){const fo=nr(Li.name,Math.max(ks.length,Li.numColors||ks.length),Li.reverse||!1);fo&&fo[Ms]?Er=fo[Ms]:Er=An.treeEdges||[100,100,100,255]}else Er=An.treeEdges||[100,100,100,255]}catch{const ks=String(Vs);let Ms=0;for(let ha=0;ha<ks.length;++ha)Ms=ks.charCodeAt(ha)+((Ms<<5)-Ms);const fo=Ms>>0&255,Zo=Ms>>8&255,Qo=Ms>>16&255;Er=[Math.abs(fo),Math.abs(Zo),Math.abs(Qo),255]}else Er=An.treeEdges||[100,100,100,255]}}const Yr=Array.isArray(Gn.branchset)&&Gn.branchset.length>0,li=Yr?Ks.internal||4:Ks.leaf||2,Ri=ci&&ci.id===Gn.id&&Yr?Math.max(li*2,li+8):li;return{id:Gn.id,name:Gn.name,leaf_id:ai,node:Gn,rawY:Gn.y,x:Gn.x,color:Er,radius:Ri,metadata:{...Tr,name:Gn.name,id:Gn.id,leaf_id:ai||Tr.leaf_id||Gn.leaf_id}}}),Ts.current={nodes:Qs,geometrySignature:fa,structuralSignature:sr}}function Ia(Fn){const Ln=Yr=>{if(Array.isArray(Yr))return Yr.length===3?[Yr[0],Yr[1],Yr[2],255]:Yr;if(typeof Yr=="string"){const li=Yr.split(",").map(yi=>parseInt(yi.trim(),10)).filter(yi=>!isNaN(yi));if(li.length===3)return[li[0],li[1],li[2],255];if(li.length>=4)return[li[0],li[1],li[2],li[3]]}return Array.isArray(An.geneFill)?An.geneFill:[150,150,150,255]};if(!hi?.enabled){const Yr=Ln(An.geneFill||kr.gene.fillColor),yi=An.background==="#ffffff"?.7:1.3;return[Math.max(0,Math.min(255,Math.floor(Yr[0]*yi))),Math.max(0,Math.min(255,Math.floor(Yr[1]*yi))),Math.max(0,Math.min(255,Math.floor(Yr[2]*yi))),Yr[3]??255]}let Gn=null;const er=yn||Vt||"cluster";if(ss){let Yr=Fn?.metadata?.[er];(Yr==null||Yr==="")&&er==="cluster"&&(Yr=Fn?.metadata?.clusterId??Fn?.metadata?.cluster_id??Fn?.cluster),Yr!=null&&Yr!==""&&(Gn=ya(ss,Yr,hi?.type)||null)}let Er;if(ss&&er!=="cluster")if(Gn)Er=Ln(Gn);else if(hi.transparentByPrevalence){const Yr=Ln(kr.gene.fillColor);Er=[Yr[0],Yr[1],Yr[2],0]}else Er=Ln(kr.gene.fillColor);else if(Gn)Er=Ln(Gn);else if(hi.transparentByPrevalence){const Yr=Ln(Fn.fillColor||kr.gene.fillColor);Er=[Yr[0],Yr[1],Yr[2],0]}else Er=Ln(Fn.fillColor||kr.gene.fillColor);const ai=An.background==="#ffffff"?.7:1.3;return[Math.max(0,Math.min(255,Math.floor(Er[0]*ai))),Math.max(0,Math.min(255,Math.floor(Er[1]*ai))),Math.max(0,Math.min(255,Math.floor(Er[2]*ai))),Er[3]??255]}const ba=`${Object.keys(Un.genesById).length}:${kr.gene.height}:${ci?.id??"null"}:${mi}:${bo.size}:${gr.size}:${ti.size}`,zl=performance.now(),Ua=(()=>{if(On&&Da.current&&qa.current===ba)return Da.current.forEach(er=>{const Er=na.get(er.uniqueId);er.fillColor=Er||er._originalFillColor||An.geneFill}),Da.current;const Fn=er=>{if(!er)return null;if(typeof er=="string"){const Er=er.match(/ID=([^;]+)/);return Er?Er[1]:null}else if(typeof er=="object")return er.ID||er.gene_id||er.protein_id||null;return null},Ln=(er,Er)=>{const Tr=er.hood_id??er.hoodId;if(gr.size>0&&Tr!=null&&(gr.has(String(Tr))||gr.has(Number(Tr))))return!1;const ai=Fn(er.attributes),Yr=er.originalGeneId||er.gene_id||ai||Er;return ti.size>0&&console.log("[isGeneVisibleInLayer] geneKey:",Yr,"uid:",Er,"originalGeneId:",er.originalGeneId,"attrId:",ai,"hiddenGeneSet:",Array.from(ti)),!(ti.size>0&&Yr&&ti.has(String(Yr)))};let Gn=Object.entries(Un.genesById).filter(([er,Er])=>Ln(Er,er));if(ci)try{Gn=Gn.filter(([er,Er])=>{const Tr=Er.hood_id||Un.getHoodIdFromSeqid(Er.seqid);return Tr?bo.has(Tr):!1})}catch{}return Gn.map(([er,Er])=>{const ai=na.get(er)||Er.fillColor||An.geneFill;return{type:"gene",id:Er.id||er,uniqueId:er,start:Er.start,end:Er.end,trackY:Er.trackY,strand:Er.strand,fillColor:ai,_originalFillColor:Er.fillColor,geneHeight:Er.geneHeight||kr.gene.height,config:Er.config||kr,polygon:Er.polygon,metadata:Er.metadata}})})();Da.current=Ua,qa.current=ba,performance.now()-zl;const Il=typeof gn=="number"?gn:qt?.tree?.ySpacing||150,Oa=Po(Ua,ss,yn,Vt,An,kr||qt,ar,xn,Kn||100,Il);try{typeof console<"u"&&console.debug&&console.debug("[HoodiniViz] geneLabels sample:",{geneHeight:nn,effectiveGeneHeight:kr&&kr.gene?kr.gene.height:null,sample:Oa&&Oa.length?Oa.slice(0,6):[]})}catch{}const Xo=Ua.map(Fn=>{const Ln=Fn.geneHeight!==void 0&&Fn.geneHeight!==null?Fn.geneHeight:kr&&kr.gene?kr.gene.height:0,Gn=Fn.config&&Fn.config.gene&&Fn.config.gene.arrowheadHeight?Fn.config.gene.arrowheadHeight:kr&&kr.gene?kr.gene.arrowheadHeight:0;return`${Fn.uniqueId||""}:${Ln}:${Gn}`}).join("|"),Pa=8,Ko=(Fn,Ln=0,Gn=255)=>Math.max(Ln,Math.min(Gn,Fn)),ia=(Fn,Ln)=>[Ko(Math.round(Fn[0]*Ln)),Ko(Math.round(Fn[1]*Ln)),Ko(Math.round(Fn[2]*Ln)),Fn[3]!==void 0?Ko(Math.round(Fn[3])):255],Ol=(Fn,Ln,Gn)=>[Math.round(Fn[0]+(Ln[0]-Fn[0])*Gn),Math.round(Fn[1]+(Ln[1]-Fn[1])*Gn),Math.round(Fn[2]+(Ln[2]-Fn[2])*Gn),Math.round((Fn[3]||255)+((Ln[3]||255)-(Fn[3]||255))*Gn)],$a=(Fn,Ln)=>{if(!Fn||Fn.length===0)return[];if(!Ln)return[];if(!(Ln.colorBy==="identity_gradient"&&Ln.palette&&Ln.palette.enabled))return[];let Gn=[];try{Gn=nr(Ln.palette.name,Ln.palette.numColors||8,Ln.palette.reverse||!1)}catch{Gn=[]}const er=[];for(const Er of Fn){const Tr=Er.polygon||[];if(!Tr||Tr.length<4)continue;const ai=Math.floor(Tr.length/2),Yr=[];for(let Ps=0;Ps<ai;Ps++){const ks=Tr[Ps],Ms=Tr[Ps+ai]||Tr[Tr.length-1];Yr.push([(ks[0]+Ms[0])/2,(ks[1]+Ms[1])/2])}if(Yr.length<2)continue;const li=Er.metadata&&typeof Er.metadata.similarity=="number"?Er.metadata.similarity:0,yi=Gn.length>0?Math.floor(Math.max(0,Math.min(1,li/100))*(Gn.length-1)):0,Ri=Gn.length>0?Gn[yi]:Er.fillColor||[150,150,150,255],Ki=ia(Ri.slice(0,4),.9),ns=ia(Ri.slice(0,4),1.1),Vs=Math.max(2,Pa);for(let Ps=0;Ps<Vs-1;Ps++){const ks=Ps/(Vs-1),Ms=(Ps+1)/(Vs-1),fo=Wl=>{const ho=Wl*(Yr.length-1),gl=Math.floor(ho),sa=Yr[gl],Eo=Yr[Math.min(Yr.length-1,gl+1)],tc=ho-gl;return[sa[0]+(Eo[0]-sa[0])*tc,sa[1]+(Eo[1]-sa[1])*tc]},Zo=fo(ks),Qo=fo(Ms),ha=Ol(Ki,ns,ks),co=Ol(Ki,ns,Ms),Ca=Ol(ha,co,.5);er.push({path:[Zo,Qo],color:Ca,width:Math.max(1,Ln.strokeWidth||2)})}}return er};$a(Rr,Rn),$a(Wr,Tn);const Aa=(Un.nucleotideLinks||[]).map((Fn,Ln)=>{let Gn=Fn.fillColor||An.nucleotideFill;try{const er=Un.genesById&&Un.genesById[Fn.gAId],Er=Un.genesById&&Un.genesById[Fn.gBId],Tr=yn||Vt||"cluster",ai=er&&ss?.get(er.metadata?.[Tr])||Er&&ss?.get(Er.metadata?.[Tr]);ai&&(Gn=ai)}catch{}return{hoodA:Fn.hoodA,hoodB:Fn.hoodB,hoodStartA:Fn.hoodStartA,hoodEndA:Fn.hoodEndA,hoodStartB:Fn.hoodStartB,hoodEndB:Fn.hoodEndB,seqidA:Fn.seqidA,seqidB:Fn.seqidB,fillColor:Gn,metadata:Fn.metadata,_k:`${mi}_${Ln}`}}).filter(Fn=>!(!Fn.hoodA||!Fn.hoodB||gr.size>0&&(gr.has(String(Fn.hoodA))||gr.has(Number(Fn.hoodA))||gr.has(String(Fn.hoodB))||gr.has(Number(Fn.hoodB))))),fl=(Rr||[]).map((Fn,Ln)=>{let Gn=Fn.fillColor||An.proteinFill||[200,200,200,255];try{const er=Un.genesById&&Un.genesById[Fn?.metadata?.gAId],Er=Un.genesById&&Un.genesById[Fn?.metadata?.gBId],Tr=yn||Vt||"cluster",ai=er&&ss?.get(er.metadata?.[Tr])||Er&&ss?.get(Er.metadata?.[Tr]);ai&&(Gn=ai)}catch{}return{gAId:Fn?.metadata?.gAId,gBId:Fn?.metadata?.gBId,fillColor:Gn,metadata:Fn.metadata,_k:`${mi}_${Ln}`}}).filter(Fn=>Fn.gAId&&Fn.gBId),hl=(Fn,Ln,Gn,er,Er=20)=>{const Tr=[];for(let ai=0;ai<=1;ai+=1/Er){const Yr=Math.pow(1-ai,3)*Fn[0]+3*Math.pow(1-ai,2)*ai*Ln[0]+3*(1-ai)*ai*ai*Gn[0]+ai*ai*ai*er[0],li=Math.pow(1-ai,3)*Fn[1]+3*Math.pow(1-ai,2)*ai*Ln[1]+3*(1-ai)*ai*ai*Gn[1]+ai*ai*ai*er[1];Tr.push([Yr,li])}return Tr},pl=(Fn,Ln)=>{if(!Fn||!Ln)return[];const Gn=Math.min(Fn.start,Fn.end),er=Math.max(Fn.start,Fn.end),Er=Math.min(Ln.start,Ln.end),Tr=Math.max(Ln.start,Ln.end),ai=Fn.trackY,Yr=Ln.trackY;let li,yi;ai<=Yr?(li={left:[Gn,ai],right:[er,ai]},yi={left:[Er,Yr],right:[Tr,Yr]}):(li={left:[Er,Yr],right:[Tr,Yr]},yi={left:[Gn,ai],right:[er,ai]});const Ri=(li.left[1]+yi.right[1])/2,Ki=(Ps,ks)=>hl(Ps,[Ps[0],Ri],[ks[0],Ri],ks,20),ns=Ki(li.right,yi.right),Vs=Ki(yi.left,li.left);return[li.left,li.right,...ns,yi.right,yi.left,...Vs]},vl=Fn=>{if(Fn.gene&&Fn.gene.polygon&&Array.isArray(Fn.gene.polygon)&&Fn.gene.polygon.length>0)return Fn.gene.polygon;const Ln=Fn.trackY;if(Ln==null)return[];const Gn=kr.gene.height||kr.gene.defaultHeight,er=kr.gene.arrowheadHeight||0;let Er=Fn.start,Tr=Fn.end;if(Er>Tr){const Ki=Er;Er=Tr,Tr=Ki}const ai=Math.abs(Tr-Er),Yr=calculateTipWidth(ai,kr),li=Gn/2,yi=Fn.strand==="+",Ri=li+er/2;return yi?[[Er,Ln-li],[Tr-Yr,Ln-li],[Tr-Yr,Ln-Ri],[Tr,Ln],[Tr-Yr,Ln+Ri],[Tr-Yr,Ln+li],[Er,Ln+li]]:[[Tr,Ln-li],[Er+Yr,Ln-li],[Er+Yr,Ln-Ri],[Er,Ln],[Er+Yr,Ln+Ri],[Er+Yr,Ln+li],[Tr,Ln+li]]},bc=typeof kr.gene.glowPadFactor=="number"?kr.gene.glowPadFactor:.2;(kr.gene.height||kr.gene.defaultHeight||10)*bc;const Mr=((Fn,Ln=[100,100,100,255])=>{const Gn=er=>Math.max(0,Math.min(255,Math.round(er)));if(Array.isArray(Fn)){const[er=0,Er=0,Tr=0,ai=255]=Fn;return[Gn(er),Gn(Er),Gn(Tr),Gn(ai)]}if(typeof Fn=="string"){const er=Fn.split(",").map(Er=>parseInt(Er.trim(),10)).filter(Er=>!isNaN(Er));if(er.length>=3){const[Er,Tr,ai,Yr=255]=er;return[Gn(Er),Gn(Tr),Gn(ai),Gn(Yr)]}}return Ln})(An.hoods||kr.colors.darkGray||[85,85,85,255]),Br=kr.hood?.width||kr.stroke?.hoodWidth||kr.stroke?.lineWidth||2;performance.now();const Nr=[new LineLayer({id:"hoods",data:Hi,visible:Dr,getSourcePosition:Fn=>[Fn.start,Fn.trackY],getTargetPosition:Fn=>[Fn.end,Fn.trackY],getColor:Mr,getWidth:Br,widthUnits:"meters",pickable:!1,updateTriggers:{getSourcePosition:[Hi,mi,ki,gn,Kn],getTargetPosition:[Hi,mi,ki,gn,Kn]}}),new PolygonLayer({id:"protein-polygons",data:fl,visible:Cr,getPolygon:Fn=>{const Ln=bs.current;if(ci&&bo.size>0){const Er=Ln?.genesById?.[Fn.gAId],Tr=Ln?.genesById?.[Fn.gBId],ai=Er?.hood_id,Yr=Tr?.hood_id;if(ai&&Yr&&(!bo.has(ai)||!bo.has(Yr)))return[]}if(ti.size>0){const Er=Ln?.genesById?.[Fn.gAId],Tr=Ln?.genesById?.[Fn.gBId],ai=(yi,Ri)=>{if(!yi)return Ri;const Ki=typeof yi.attributes=="string"?yi.attributes.match(/ID=([^;]+)/)?.[1]||null:yi.attributes?.ID||null;return yi.originalGeneId||yi.gene_id||Ki||Ri},Yr=ai(Er,Fn.gAId),li=ai(Tr,Fn.gBId);if(Yr&&ti.has(String(Yr))||li&&ti.has(String(li)))return[]}const Gn=Ln?.genesById?.[Fn.gAId],er=Ln?.genesById?.[Fn.gBId];return pl(Gn,er)},getFillColor:Fn=>{bs.current;let Ln=An?.geneFill?.slice(0,3)||[100,150,200],Gn=255;const er=Rn?.colorBy;if(er==="source_gene"){const Tr=na.get(Fn.gAId);Tr&&(Ln=Tr.slice(0,3))}else if(er==="target_gene"){const Tr=na.get(Fn.gBId);Tr&&(Ln=Tr.slice(0,3))}else if(er==="identity_solid")Rn?.solidColor&&(Ln=Rn.solidColor.slice(0,3));else if(er==="identity_gradient"&&Rn?.palette?.enabled)try{const Tr=nr(Rn.palette.name,Rn.palette.numColors,Rn.palette.reverse),ai=Fn.metadata?.similarity??50,Yr=Math.max(0,Math.min(1,ai/100)),li=Math.floor(Yr*(Tr.length-1));Ln=Tr[li]?.slice(0,3)||Ln}catch{}const Er=Rn||kr?.proteinLink||DEFAULT_CONFIG$1.proteinLink;if(Er?.useAlpha&&Fn.metadata?.similarity!==void 0){const Tr=Fn.metadata.similarity/100,ai=Er.minAlpha??0,li=(Er.maxAlpha??.5)-ai,yi=ai+Tr*li;Gn=Math.round(yi*255)}if(Fn.fillColor&&Array.isArray(Fn.fillColor)&&Fn.fillColor.length>=4){const Tr=Fn.fillColor[3]/255;Gn=Math.round(Gn*Tr)}return[...Ln,Gn]},stroked:!1,autoHighlight:!0,filled:!0,pickable:!0,updateTriggers:{getPolygon:[fl,mi,mo,ci,gn,Kn],getFillColor:[fl,mo,dl,na.size,ss,hi?.prevalenceFilter,hi?.name,yn,Vt,An?.geneFill,ci]}}),new PolygonLayer({id:"nucleotide-polygons",data:Aa,visible:dr,getPolygon:Fn=>{const Ln=bs.current;if(!Ln)return[];if(ci&&bo.size>0&&(!bo.has(Fn.hoodA)||!bo.has(Fn.hoodB)))return[];if(ti.size>0&&Fn.geneA&&Fn.geneB){const co=(sa,Eo)=>{if(!sa)return Eo;const tc=typeof sa.attributes=="string"?sa.attributes.match(/ID=([^;]+)/)?.[1]||null:sa.attributes?.ID||null;return sa.originalGeneId||sa.gene_id||tc||Eo},Ca=Ln?.genesById?.[Fn.geneA],Wl=Ln?.genesById?.[Fn.geneB],ho=co(Ca,Fn.geneA),gl=co(Wl,Fn.geneB);if(ho&&ti.has(String(ho))||gl&&ti.has(String(gl)))return[]}const Gn=Ln.getTrackYByHoodId(Fn.hoodA),er=Ln.getTrackYByHoodId(Fn.hoodB);if(Gn==null||er==null)return[];const Tr=(Ln.config.genome&&typeof Ln.config.genome.xScalePercent=="number"?Ln.config.genome.xScalePercent:100)/100,ai=Ln.hoodRanges[Fn.hoodA],Yr=Ln.hoodRanges[Fn.hoodB],li=ai?ai.length/2:0,yi=Yr?Yr.length/2:0,Ri=Ln.trackOffset[Fn.hoodA]||0,Ki=Ln.trackOffset[Fn.hoodB]||0,ns=!!Ln.trackFlipped[Fn.hoodA],Vs=!!Ln.trackFlipped[Fn.hoodB],Ps=Ln.constructor.getTransformedXUnified;let ks=Ps(Fn.hoodStartA,li,Ri,ns),Ms=Ps(Fn.hoodEndA,li,Ri,ns),fo=Ps(Fn.hoodStartB,yi,Ki,Vs),Zo=Ps(Fn.hoodEndB,yi,Ki,Vs);ks=li+(ks-li)*Tr,Ms=li+(Ms-li)*Tr,fo=yi+(fo-yi)*Tr,Zo=yi+(Zo-yi)*Tr;const Qo=[[ks,Gn],[Ms,Gn]].sort((co,Ca)=>co[0]-Ca[0]),ha=[[fo,er],[Zo,er]].sort((co,Ca)=>co[0]-Ca[0]);return[Qo[0],Qo[1],ha[1],ha[0]]},getFillColor:Fn=>{let Ln=[200,200,200],Gn=255;const er=Tn?.colorBy,Er=Tn?.strandColoring,Tr=Fn.similarity??Fn.metadata?.similarity??50,ai=()=>{const li=bs.current;if(!li)return!0;const yi=li.nucleotideLinks?.find(Ms=>Ms.hoodA===Fn.hoodA&&Ms.hoodB===Fn.hoodB&&Ms.hoodStartA===Fn.hoodStartA);if(!yi)return!0;const Ri=yi.strandA||"+",Ki=yi.strandB||"+",ns=!!li.trackFlipped[Fn.hoodA],Vs=!!li.trackFlipped[Fn.hoodB];return(Ri==="+"!==ns?"+":"-")===(Ki==="+"!==Vs?"+":"-")};if(er==="solid")Er?ai()?Ln=Tn?.sameStrandColor?.slice(0,3)||[180,180,180]:Ln=Tn?.oppositeStrandColor?.slice(0,3)||[220,80,80]:Tn?.solidColor&&(Ln=Tn.solidColor.slice(0,3),!Tn?.useAlpha&&Tn.solidColor.length>3&&(Gn=Tn.solidColor[3]));else if(er==="identity_gradient"){if(Er){const yi=ai()?Tn?.sameStrandPalette:Tn?.oppositeStrandPalette;if(yi?.enabled)try{const Ri=nr(yi.name,yi.numColors,yi.reverse),Ki=Math.max(0,Math.min(1,Tr/100)),ns=Math.floor(Ki*(Ri.length-1));Ln=Ri[ns]?.slice(0,3)||Ln}catch{}}else if(Tn?.palette?.enabled)try{const li=nr(Tn.palette.name,Tn.palette.numColors,Tn.palette.reverse),yi=Math.max(0,Math.min(1,Tr/100)),Ri=Math.floor(yi*(li.length-1));Ln=li[Ri]?.slice(0,3)||Ln}catch{}}const Yr=Tn||kr?.nucleotideLink||DEFAULT_CONFIG$1.nucleotideLink;if(Yr?.useAlpha){const li=Tr/100,yi=Yr.minAlpha??0,Ki=(Yr.maxAlpha??.5)-yi,ns=yi+li*Ki;Gn=Math.round(ns*255)}return[...Ln,Gn]},stroked:!1,filled:!0,autoHighlight:!0,pickable:!0,updateTriggers:{getPolygon:[Aa,mi,mo,bs.current&&bs.current.config&&bs.current.config.genome&&bs.current.config.genome.xScalePercent||null,ci,gn,Kn],getFillColor:[Aa,mo,Tl,Tn?.useAlpha,Tn?.minAlpha,Tn?.maxAlpha,Tn?.colorBy,Tn?.strandColoring,Tn?.sameStrandColor,Tn?.oppositeStrandColor,Tn?.sameStrandPalette,Tn?.oppositeStrandPalette,ci,bs.current?.trackFlipped,mi]}}),new PolygonLayer({id:"region-polygons",data:qr,visible:pr,getPolygon:Fn=>Fn.polygon,getFillColor:Fn=>{const Ln=Fn.strokeColor||[100,100,100,255];return[Ln[0],Ln[1],Ln[2],30]},stroked:!0,getLineColor:Fn=>Fn.strokeColor||[100,100,100,255],getLineWidth:Fn=>Fn.strokeWidth||2,lineWidthUnits:"pixels",filled:!0,autoHighlight:!0,pickable:!0,updateTriggers:{getPolygon:[qr,mi,gn,Kn],getFillColor:[qr,mi],getLineColor:[qr,mi],getLineWidth:[qr,mi]}}),new PathLayer({id:"phylo-tree",data:Pi,visible:Wn&&po,getPath:Fn=>{const Ln=kr.tree&&typeof kr.tree.xScalePercent=="number"?kr.tree.xScalePercent/100:1;return Fn.rawPath.map(([Gn,er])=>[Gn*Ln+Ur,er])},getColor:Fn=>Fn.color||An.treeEdges||kr.tree.edgeColor,autoHighlight:!0,widthUnits:"pixels",jointRounded:!0,capRounded:!0,getWidth:()=>kr.tree.edgeWidth||3,pickable:!0,updateTriggers:{getPath:[Pi.length,kr.tree.xScalePercent,Ur,mi],getColor:[Pi.length,An.treeEdges,kr.tree.edgeColor],getWidth:kr.tree.edgeWidth}}),new PolygonLayer({id:"genes",data:Ua,visible:br,getPolygon:vl,getFillColor:Fn=>{const Ln=Tr=>{if(Array.isArray(Tr))return Tr.length===3?[Tr[0],Tr[1],Tr[2],255]:Tr;if(typeof Tr=="string"){const ai=Tr.split(",").map(Yr=>parseInt(Yr.trim(),10)).filter(Yr=>!isNaN(Yr));if(ai.length===3)return[ai[0],ai[1],ai[2],255];if(ai.length>=4)return[ai[0],ai[1],ai[2],ai[3]]}return An.geneFill||[150,150,150,255]};let Gn=null;const er=yn||Vt||"cluster";if(ss){let Tr=Fn?.metadata?.[er];(Tr==null||Tr==="")&&er==="cluster"&&(Tr=Fn?.metadata?.clusterId??Fn?.metadata?.cluster_id??Fn?.cluster),Tr!=null&&Tr!==""&&(Gn=ya(ss,Tr,hi?.type)||null)}if(!hi?.enabled)Gn||(Gn=An.geneFill||kr.gene.fillColor);else if(ss&&er!=="cluster"){if(!Gn)if(hi.transparentByPrevalence){const Tr=An.geneFill||kr.gene.fillColor;Gn=[Tr[0],Tr[1],Tr[2],0]}else Gn=An.geneFill||kr.gene.fillColor}else if(!Gn)if(hi.transparentByPrevalence){const Tr=Fn.fillColor||An.geneFill||kr.gene.fillColor;Gn=[Tr[0],Tr[1],Tr[2],0]}else Gn=Fn.fillColor||An.geneFill||kr.gene.fillColor;return Ln(Gn)},stroked:kr.gene.edgeWidth>0,getLineColor:Fn=>Ia(Fn),getLineWidth:()=>kr.gene.edgeWidth,lineWidthUnits:"pixels",lineWidthMinPixels:0,filled:!0,pickable:!0,autoHighlight:!0,updateTriggers:{getPolygon:[Ua,Xo,mi,kr.gene.height,kr.gene.defaultHeight,kr.gene.arrowheadHeight,kr.gene.tipWidthFactor,Zt,nn,ci,gn,Kn],getFillColor:[Ua,yn,Vt,mo,An.geneFill,mi,hi?.enabled,hi?.transparentByPrevalence],getLineColor:[Ua,yn,Vt,mo,An.geneFill,kr.gene.edgeWidth,mi,hr,hi?.transparentByPrevalence],getLineWidth:kr.gene.edgeWidth,stroked:kr.gene.edgeWidth}}),new PolygonLayer({id:`domains-${kr.gene.height}-${kr.gene.arrowheadHeight}`,data:ri,visible:Fr,getPolygon:Fn=>Fn.polygon,getFillColor:Fn=>Fn.fillColor||An.geneFill||qt.colors.gray,stroked:!0,getLineColor:Fn=>{const Ln=Fn.fillColor||qt.colors.black;return Array.isArray(Ln)&&Ln.length>=4&&Ln[3]<255?[0,0,0,Ln[3]]:qt.colors.black},getLineWidth:()=>kr.domain.edgeWidth||2,lineWidthUnits:"pixels",filled:!0,autoHighlight:!0,pickable:!0,updateTriggers:{getPolygon:[ri,mi,kr.domain.height,kr.gene.height,kr.gene.arrowheadHeight,kr.domain.heightFactor,$n,ci,gn,Kn],getFillColor:[ri.length,Mn,mo,An.domainFill,$n,ci,hi?.transparentByPrevalence,ss],getLineColor:[ri.length,hi?.transparentByPrevalence],getLineWidth:kr.domain.edgeWidth}}),new TextLayer({id:"gene-labels",data:Oa,visible:wr,getPosition:Fn=>Fn.position,getText:Fn=>Fn.text,getColor:Fn=>Fn.color,getSize:Fn=>Fn.size*(kr.text?.scaleFactors?.gene||1),sizeUnits:"meters",fontFamily:"sans-serif",getTextAnchor:Fn=>Fn.textAnchor||"middle",getAlignmentBaseline:Fn=>Fn.alignmentBaseline||"top",pickable:!1,updateTriggers:{getPosition:[Oa.length,mi,kr&&kr.gene?kr.gene.height:null,nn,ar,gn,Kn,Ua],getText:[Oa.length,xn,Kn,gn],getColor:[Oa.length,yn,hi&&hi.name||null,mo],getSize:[kr.text?.geneLabelSize,kr.text?.scaleFactors?.gene,Oa.length,nn,ar],getAlignmentBaseline:[Oa.length,ar,mi]}}),new TextLayer({id:"phylo-labels",data:Ai,visible:xr&&po,getPosition:Fn=>{const Ln=kr.tree&&typeof kr.tree.xScalePercent=="number"?kr.tree.xScalePercent/100:1;let Gn;if(Fn.labelPosition==="after-tracks")if(Si){const er=Ai.map(Tr=>Tr.rightmostX).filter(Tr=>isFinite(Tr));Gn=(er.length>0?Math.max(...er):Fn.rawY*Ln+Ur+(qt.tree?.labelOffset||10))+(qt.tree?.labelOffset||10)}else{let er=Fn.rightmostX;isFinite(er)?er+=kr.tree?.labelOffset||10:er=Fn.rawY*Ln+Ur+(kr.tree?.labelOffset||10),Gn=er}else if(Si){const er=Ai.map(Tr=>Tr.rawY*Ln);Gn=(er.length>0?Math.max(...er):Fn.rawY*Ln)+Ur+(kr.tree?.labelOffset||10)}else Gn=Fn.rawY*Ln+Ur+(kr.tree?.labelOffset||10);return[Gn,Fn.x]},getText:Fn=>Fn.text,getColor:Fn=>Fn.color,getSize:Fn=>Fn.size*kr.text.scaleFactors.phylo,sizeUnits:"meters",fontFamily:"sans-serif",getTextAnchor:Fn=>Fn.textAnchor||"start",getAlignmentBaseline:Fn=>Fn.alignmentBaseline||"center",getPixelOffset:Fn=>[5,0],background:Kt,getBackgroundColor:()=>{const Fn=An.background==="#ffffff";return Kt?[Fn?255:0,Fn?255:0,Fn?255:0,255]:[0,0,0,0]},backgroundPadding:Kt?[2,1,2,1]:[0,0,0,0],pickable:!1,updateTriggers:{getPosition:[Ai.length,kr.tree.xScalePercent,Ur,mi,rl,Si],getText:Ai,getSize:[kr.text.phyloLabelSize,kr.text.scaleFactors.phylo,Ai],getColor:[Ai,Gt,Li?`${Li.name}|${Li.numColors||0}|${Li.reverse||!1}|${Li.enabled||!1}`:null,Xs,An.phyloLabelFill,Ht?Object.keys(Ht).length:0],background:Kt,getBackgroundColor:Kt,backgroundPadding:Kt}}),new ScatterplotLayer({id:"nodes",data:Qs,visible:Wn&&po,getPosition:Fn=>{const Ln=Number(Fn.rawY),Gn=Number(Fn.x);if(!Number.isFinite(Ln)||!Number.isFinite(Gn))return[0,0];const er=kr.tree&&typeof kr.tree.xScalePercent=="number"?kr.tree.xScalePercent/100:1;return[Ln*er+Ur,Gn]},getFillColor:Fn=>Fn.color,getRadius:Fn=>Fn.radius,lineWidthUnits:"meters",radiusUnits:"meters",autoHighlight:!0,filled:!0,stroked:!1,pickable:!0,updateTriggers:{getPosition:[Qs.length,kr.tree.xScalePercent,Ur,mi],getFillColor:[Qs.length,An.treeEdges,ci,Gt,Li?`${Li.name}|${Li.numColors||0}|${Li.reverse||!1}|${Li.enabled||!1}`:null,Xs,Ht?Object.keys(Ht).length:0]}})];if(Kt){const Fn=us.leafNodes.filter(Ln=>ci&&!bo.has(Ln.name)?!1:Un.getTrackYByHoodId(Ln.name)!=null).map(Ln=>{const Gn=Un.getTrackYByHoodId(Ln.name);let er=1/0;const Er=Hi.find(Tr=>Tr.hood_id===Ln.name);return Er?er=Math.min(Er.start,Er.end):Object.values(Un.genesById).forEach(Tr=>{(Tr.hood_id===Ln.name||Un.getHoodIdFromSeqid(Tr.seqid)===Ln.name)&&(er=Math.min(er,Math.min(Tr.start,Tr.end)))}),{rawLeafY:Ln.y,leafX:Ln.x,genomeStartX:isFinite(er)?er:null,trackY:Gn,metadata:{leaf_id:Ln.name,type:"connecting_line"}}}).filter(Ln=>Ln.genomeStartX!==null);Fn.length>0&&Nr.unshift(new LineLayer({id:"connecting-lines",data:Fn,getSourcePosition:Ln=>{const Gn=kr.tree&&typeof kr.tree.xScalePercent=="number"?kr.tree.xScalePercent/100:1;return[Ln.rawLeafY*Gn+Ur,Ln.leafX]},getTargetPosition:Ln=>[Ln.genomeStartX,Ln.trackY],getColor:qt.connectingLines.color,getWidth:qt.connectingLines.width,widthUnits:"pixels",pickable:!0,autoHighlight:!1,updateTriggers:{getSourcePosition:[Fn.length,kr.tree.xScalePercent,Ur,mi],getTargetPosition:Fn}}))}let Hr=Object.values(Un.ncRNAsById||{});if(ci)try{const Fn=Un.filterBySelectedNode(ci)||{};Array.isArray(Fn.ncRNAs)&&(Hr=Fn.ncRNAs)}catch{}Hr=Hr.filter(Fn=>!ii(Fn.hood_id??Fn.hoodId)),ti.size>0&&(Hr=Hr.filter(Fn=>{const Ln=Fn.gene_id||Fn.geneId||Fn.metadata?.gene_id||Fn.metadata?.geneId||Fn.metadata?.Parent;return Ln?!ti.has(String(Ln)):!0})),Hr=Hr.map(Fn=>({...Fn,fillColor:Fn.fillColor||Fn.metadata&&Fn.metadata.color||An.geneFill})),Nr.push(new PolygonLayer({id:"ncrna-features",data:Hr,visible:_r,getPolygon:Fn=>Fn.polygon,getFillColor:Fn=>Fn.fillColor,stroked:kr.gene.edgeWidth>0,getLineColor:Fn=>Ia(Fn),getLineWidth:()=>kr.gene.edgeWidth,lineWidthUnits:"pixels",lineWidthMinPixels:0,filled:!0,pickable:!0,autoHighlight:!0,updateTriggers:{getPolygon:[Hr,kr.gene.height,kr.gene.arrowheadHeight,mi,mo,gn,Kn],getFillColor:[Hr.length,mo],getLineColor:[Hr.length,mo],getLineWidth:kr.gene.edgeWidth,stroked:kr.gene.edgeWidth}})),To.current=Pn,performance.now();try{console.groupEnd&&console.groupEnd()}catch{}return Nr},[kr,bo,ms,Un,Ii,mi,us,ci,Ma,Rl,ss,na,Xa,hr,Kt,tn,sn,zt,Wt,Gt,pn,Ht,$n,ki,Rn,Tn,Nt,jt,Vt,yn,Mn,Qt,fn,xn,ar,gn,di,Bi,gr,ti,ii,Dr,Wn,br,Fr,Cr,dr,_r,pr,wr,xr,bs.current?._paletteVersion,hi?.enabled]);React.useMemo(()=>{const En=[],kn=Vn=>{const Nn=Dn=>Math.max(0,Math.min(255,Math.round(Dn)));if(Array.isArray(Vn)){const[Dn=0,On=0,Pn=0,Zn=255]=Vn;return[Nn(Dn),Nn(On),Nn(Pn),Nn(Zn??255)]}if(typeof Vn=="string"){const Dn=Vn.split(",").map(On=>parseInt(On.trim(),10)).filter(On=>!isNaN(On));if(Dn.length>=3){const[On,Pn,Zn,sr=255]=Dn;return[Nn(On),Nn(Pn),Nn(Zn),Nn(sr)]}}return[150,150,150,255]};if(Mi&&Mi.length>0){const Vn=Dn=>{const On=Dn?.fillColor||An.geneFill||qt.gene?.fillColor||[100,200,255,255];return kn(On)},Nn=Dn=>{if(Dn.polygon&&Array.isArray(Dn.polygon)&&Dn.polygon.length>0)return Dn.polygon;const On=Dn.gene||Dn,Pn=Dn.trackY??On.trackY??0,Zn=kr.gene?.height||kr.gene?.geneHeight||20,sr=kr.gene?.arrowheadHeight||10,fr=(kr.genome?.xScalePercent||100)/100,mr=(Dn.start??On.start)*fr,Pr=(Dn.end??On.end)*fr,Ur=Dn.strand??On.strand,Rr=Zn/2,Wr=sr/2,$r=Math.abs(Pr-mr),qr=calculateTipWidth($r,kr);if(qr<1){const[Vr,ri]=mr<Pr?[mr,Pr]:[Pr,mr];return[[Vr,Pn-Rr-Wr],[ri,Pn-Rr-Wr],[ri,Pn+Rr+Wr],[Vr,Pn+Rr+Wr]]}if(Ur==="+"||Ur===1){const Vr=Math.max(mr,Pr-qr);return[[mr,Pn-Rr],[Vr,Pn-Rr],[Vr,Pn-Rr-Wr],[Pr,Pn],[Vr,Pn+Rr+Wr],[Vr,Pn+Rr],[mr,Pn+Rr]]}else{const Vr=Math.min(Pr,mr+qr);return[[Pr,Pn-Rr],[Vr,Pn-Rr],[Vr,Pn-Rr-Wr],[mr,Pn],[Vr,Pn+Rr+Wr],[Vr,Pn+Rr],[Pr,Pn+Rr]]}};En.push(new PolygonLayer({id:"genes-glow-outer",data:Mi,getPolygon:Nn,stroked:!0,filled:!1,getLineWidth:35,getLineColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,70]},lineWidthUnits:"pixels",lineWidthMinPixels:8,pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new PolygonLayer({id:"genes-glow-mid",data:Mi,getPolygon:Nn,stroked:!0,filled:!1,getLineWidth:18,getLineColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,120]},lineWidthUnits:"pixels",lineWidthMinPixels:4,pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new PolygonLayer({id:"genes-glow-core",data:Mi,getPolygon:Nn,stroked:!0,filled:!0,getFillColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,40]},getLineColor:[255,255,255,255],getLineWidth:3,lineWidthUnits:"pixels",lineWidthMinPixels:2,pickable:!1,parameters:{depthTest:!1,depthMask:!1,polygonOffset:[-2,-2]}}))}if(_o&&_o.length>0){console.log("[glowLayers] highlightedRegionData:",_o[0]);const Vn=Dn=>{const On=Dn?.fillColor||Dn?.strokeColor||[255,180,50,255];return console.log("[glowLayers] getRegionColor:",{fillColor:Dn?.fillColor,strokeColor:Dn?.strokeColor,base:On}),kn(On)},Nn=Dn=>{if(Dn.polygon&&Array.isArray(Dn.polygon)&&Dn.polygon.length>0)return Dn.polygon;const On=Math.min(Dn.startX||0,Dn.endX||0),Pn=Math.max(Dn.startX||0,Dn.endX||0),Zn=Dn.trackY||0,sr=25;return[[On,Zn-sr],[Pn,Zn-sr],[Pn,Zn+sr],[On,Zn+sr]]};En.push(new PolygonLayer({id:"regions-glow-outer",data:_o,getPolygon:Nn,stroked:!0,filled:!1,getLineWidth:30,getLineColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,70]},lineWidthUnits:"pixels",lineWidthMinPixels:6,pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new PolygonLayer({id:"regions-glow-mid",data:_o,getPolygon:Nn,stroked:!0,filled:!1,getLineWidth:15,getLineColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,130]},lineWidthUnits:"pixels",lineWidthMinPixels:3,pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new PolygonLayer({id:"regions-glow-core",data:_o,getPolygon:Nn,stroked:!0,filled:!1,getLineColor:[255,255,255,255],getLineWidth:3,lineWidthUnits:"pixels",lineWidthMinPixels:2,pickable:!1,parameters:{depthTest:!1,depthMask:!1,polygonOffset:[-2,-2]}}))}if(Do&&Do.length>0){const Vn=Dn=>{const On=Dn?.fillColor||Dn?.strokeColor||[120,200,255,255];return kn(On)},Nn=Dn=>{if(Dn.polygon&&Array.isArray(Dn.polygon)&&Dn.polygon.length>0)return Dn.polygon;const On=Math.min(Dn.start||0,Dn.end||0),Pn=Math.max(Dn.start||0,Dn.end||0),Zn=Dn.trackY||0,sr=15;return[[On,Zn-sr],[Pn,Zn-sr],[Pn,Zn+sr],[On,Zn+sr]]};En.push(new PolygonLayer({id:"ncrna-glow-outer",data:Do,getPolygon:Nn,stroked:!0,filled:!1,getLineWidth:25,getLineColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,70]},lineWidthUnits:"pixels",lineWidthMinPixels:6,pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new PolygonLayer({id:"ncrna-glow-mid",data:Do,getPolygon:Nn,stroked:!0,filled:!1,getLineWidth:12,getLineColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,150]},lineWidthUnits:"pixels",lineWidthMinPixels:3,pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new PolygonLayer({id:"ncrna-glow-core",data:Do,getPolygon:Nn,stroked:!0,filled:!1,getLineColor:[255,255,255,255],getLineWidth:3,lineWidthUnits:"pixels",lineWidthMinPixels:2,pickable:!1,parameters:{depthTest:!1,depthMask:!1,polygonOffset:[-2,-2]}}))}return Wi&&Wi.length>0&&(En.push(new ScatterplotLayer({id:"tree-glow-outer",data:Wi,getPosition:Vn=>Vn.position||[0,0],getRadius:Vn=>(Vn.radius||2)*3.5,getFillColor:Vn=>{const Nn=Vn?.color||An.treeEdges||[255,200,100,255],[Dn,On,Pn]=kn(Nn);return[Dn,On,Pn,90]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"meters",radiusMinPixels:12,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new ScatterplotLayer({id:"tree-glow-core",data:Wi,getPosition:Vn=>Vn.position||[0,0],getRadius:Vn=>(Vn.radius||2)*1.8,getFillColor:[255,255,255,255],stroked:!1,filled:!0,pickable:!1,radiusUnits:"meters",radiusMinPixels:6,parameters:{depthTest:!1,depthMask:!1}}))),ys&&ys.length>0&&(En.push(new ScatterplotLayer({id:"tree-node-glow-outer",data:ys,getPosition:Vn=>Vn.position||[0,0],getRadius:Vn=>(Vn.radius||2)*4,getFillColor:Vn=>{const Nn=Vn?.color||An.treeEdges||[100,180,255,255],[Dn,On,Pn]=kn(Nn);return[Dn,On,Pn,80]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"meters",radiusMinPixels:14,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new ScatterplotLayer({id:"tree-node-glow-mid",data:ys,getPosition:Vn=>Vn.position||[0,0],getRadius:Vn=>(Vn.radius||2)*2.5,getFillColor:Vn=>{const Nn=Vn?.color||An.treeEdges||[100,180,255,255],[Dn,On,Pn]=kn(Nn);return[Dn,On,Pn,130]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"meters",radiusMinPixels:10,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new ScatterplotLayer({id:"tree-node-glow-core",data:ys,getPosition:Vn=>Vn.position||[0,0],getRadius:Vn=>(Vn.radius||2)*1.5,getFillColor:[255,255,255,255],stroked:!1,filled:!0,pickable:!1,radiusUnits:"meters",radiusMinPixels:5,parameters:{depthTest:!1,depthMask:!1}}))),io&&io.length>0&&(En.push(new LineLayer({id:"hoods-glow-outer",data:io,getSourcePosition:Vn=>[Vn.start,Vn.trackY],getTargetPosition:Vn=>[Vn.end,Vn.trackY],getColor:[255,215,80,100],getWidth:28,widthUnits:"pixels",pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new LineLayer({id:"hoods-glow-core",data:io,getSourcePosition:Vn=>[Vn.start,Vn.trackY],getTargetPosition:Vn=>[Vn.end,Vn.trackY],getColor:[255,255,255,255],getWidth:3,widthUnits:"pixels",pickable:!1,parameters:{depthTest:!1,depthMask:!1}}))),En},[Mi,Wi,ys,io,_o,Do,An.geneFill,An.treeEdges,qt.gene?.fillColor,qt.stroke?.hoodWidth,qt.stroke?.lineWidth,kr.gene?.height,kr.gene?.geneHeight,kr.gene?.arrowheadHeight,kr.genome?.xScalePercent,kr.gene?.tipWidthFactor,kr.tree?.ySpacing,Kn,mi]);const va=React.useCallback(En=>{const kn=[],Vn=Math.sin(En*.2),Nn=1+Vn*.15,Dn=hr==="light",On=Pr=>{const Ur=Rr=>Math.max(0,Math.min(255,Math.round(Rr)));if(Array.isArray(Pr)){const[Rr=0,Wr=0,$r=0,qr=255]=Pr;return[Ur(Rr),Ur(Wr),Ur($r),Ur(qr??255)]}return[150,150,150,255]},Pn=(Pr,Ur,Rr)=>(.299*Pr+.587*Ur+.114*Rr)/255,Zn=(Pr,Ur,Rr,Wr)=>{const $r=Pn(Pr,Ur,Rr);if(Dn){if($r>.7){const qr=.4+(1-$r)*.3;return{color:[Math.round(Pr*qr),Math.round(Ur*qr),Math.round(Rr*qr)],opacity:Math.min(255,Math.round(Wr*1.5))}}else if($r>.4)return{color:[Math.round(Pr*.7),Math.round(Ur*.7),Math.round(Rr*.7)],opacity:Math.round(Wr*1.2)}}return{color:[Pr,Ur,Rr],opacity:Wr}},sr=kr.gene?.height||nn||DEFAULT_CONFIG$1.gene.height,fr=kr.gene?.arrowheadHeight??Zt??DEFAULT_CONFIG$1.gene.arrowheadHeight,mr=Pr=>{const Ur=Pr.trackY;if(Ur==null)return Pr.polygon||[];let Rr=Pr.start,Wr=Pr.end;if(Rr>Wr){const Di=Rr;Rr=Wr,Wr=Di}const $r=Math.abs(Wr-Rr),qr=calculateTipWidth($r,kr),Vr=sr/2,ri=Pr.strand==="+";if(qr<1)return[[Rr,Ur-Vr],[Wr,Ur-Vr],[Wr,Ur+Vr],[Rr,Ur+Vr]];if(fr<.1)return ri?[[Rr,Ur-Vr],[Wr-qr,Ur-Vr],[Wr,Ur],[Wr-qr,Ur+Vr],[Rr,Ur+Vr]]:[[Wr,Ur-Vr],[Rr+qr,Ur-Vr],[Rr,Ur],[Rr+qr,Ur+Vr],[Wr,Ur+Vr]];const Ei=Vr+fr/2;return ri?[[Rr,Ur-Vr],[Wr-qr,Ur-Vr],[Wr-qr,Ur-Ei],[Wr,Ur],[Wr-qr,Ur+Ei],[Wr-qr,Ur+Vr],[Rr,Ur+Vr]]:[[Wr,Ur-Vr],[Rr+qr,Ur-Vr],[Rr+qr,Ur-Ei],[Rr,Ur],[Rr+qr,Ur+Ei],[Rr+qr,Ur+Vr],[Wr,Ur+Vr]]};if(Mi&&Mi.length>0){const Pr=$r=>{const qr=$r?.fillColor||An.geneFill||qt.gene?.fillColor||[100,200,255,255];return On(qr)},Ur=sr*(.3+Vn*.2),Rr=Math.round(150+Vn*50);kn.push(new PolygonLayer({id:`genes-glow-outer-anim-${En}`,data:Mi,getPolygon:mr,stroked:!0,filled:!1,getLineWidth:Ur,getLineColor:$r=>{const[qr,Vr,ri]=Pr($r),Ei=Zn(qr,Vr,ri,Rr);return[...Ei.color,Ei.opacity]},lineWidthUnits:"common",pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}}));const Wr=Dn?[80,80,80,200]:[255,255,255,255];kn.push(new PolygonLayer({id:"genes-glow-core-anim",data:Mi,getPolygon:mr,stroked:!0,filled:!1,getLineColor:Wr,getLineWidth:sr*.03,lineWidthUnits:"common",pickable:!1,parameters:{depthTest:!1,depthMask:!1,polygonOffset:[-1,-1]}}))}if(Wi&&Wi.length>0){const Pr=qr=>{const Vr=qr?.color;return Vr&&Array.isArray(Vr)&&Vr.some(ri=>ri>0)?On(Vr):[220,180,60,255]},Ur=4*(1.5+Vn*.5)*Nn,Rr=4*(.8+Vn*.3)*Nn,Wr=Math.round(60+Vn*30),$r=Math.round(120+Vn*50);kn.push(new ScatterplotLayer({id:`tree-glow-outer-anim-${En}`,data:Wi,getPosition:qr=>qr.position||[0,0],getRadius:qr=>(qr.radius||2)*Ur,getFillColor:qr=>{const[Vr,ri,Ei]=Pr(qr),Di=Zn(Vr,ri,Ei,Wr);return[...Di.color,Di.opacity]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"common",parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),kn.push(new ScatterplotLayer({id:`tree-glow-mid-anim-${En}`,data:Wi,getPosition:qr=>qr.position||[0,0],getRadius:qr=>(qr.radius||2)*Rr,getFillColor:qr=>{const[Vr,ri,Ei]=Pr(qr),Di=Zn(Vr,ri,Ei,$r);return[...Di.color,Di.opacity]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"common",parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),kn.push(new ScatterplotLayer({id:"tree-glow-core-anim",data:Wi,getPosition:qr=>qr.position||[0,0],getRadius:qr=>(qr.radius||2)*1.5,getFillColor:qr=>{const[Vr,ri,Ei]=Pr(qr),Di=Zn(Vr,ri,Ei,255);return[...Di.color,Di.opacity]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"common",parameters:{depthTest:!1,depthMask:!1}}))}if(ys&&ys.length>0){const Pr=qr=>{const Vr=qr?.color;return Vr&&Array.isArray(Vr)&&Vr.some(ri=>ri>0)?On(Vr):[100,180,255,255]},Ur=4*(1.6+Vn*.6)*Nn,Rr=4*(.9+Vn*.35)*Nn,Wr=Math.round(50+Vn*30),$r=Math.round(110+Vn*50);kn.push(new ScatterplotLayer({id:`tree-node-glow-outer-anim-${En}`,data:ys,getPosition:qr=>qr.position||[0,0],getRadius:qr=>(qr.radius||4)*Ur,getFillColor:qr=>{const[Vr,ri,Ei]=Pr(qr),Di=Zn(Vr,ri,Ei,Wr);return[...Di.color,Di.opacity]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"common",parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),kn.push(new ScatterplotLayer({id:`tree-node-glow-mid-anim-${En}`,data:ys,getPosition:qr=>qr.position||[0,0],getRadius:qr=>(qr.radius||4)*Rr,getFillColor:qr=>{const[Vr,ri,Ei]=Pr(qr),Di=Zn(Vr,ri,Ei,$r);return[...Di.color,Di.opacity]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"common",parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),kn.push(new ScatterplotLayer({id:"tree-node-glow-core-anim",data:ys,getPosition:qr=>qr.position||[0,0],getRadius:qr=>(qr.radius||4)*1.5,getFillColor:qr=>{const[Vr,ri,Ei]=Pr(qr),Di=Zn(Vr,ri,Ei,255);return[...Di.color,Di.opacity]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"common",parameters:{depthTest:!1,depthMask:!1}}))}if(io&&io.length>0){const Pr=10+Vn*8,Ur=Math.round(150+Vn*50),Rr=Dn?[180,140,40]:[255,215,80],Wr=Dn?Math.min(255,Math.round(Ur*1.3)):Ur;kn.push(new LineLayer({id:`hoods-glow-outer-anim-${En}`,data:io,getSourcePosition:qr=>[qr.start,qr.trackY],getTargetPosition:qr=>[qr.end,qr.trackY],getColor:[...Rr,Wr],getWidth:Pr*Nn,widthUnits:"common",pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}}));const $r=Dn?[80,80,80,200]:[255,255,255,255];kn.push(new LineLayer({id:"hoods-glow-core-anim",data:io,getSourcePosition:qr=>[qr.start,qr.trackY],getTargetPosition:qr=>[qr.end,qr.trackY],getColor:$r,getWidth:1,widthUnits:"common",pickable:!1,parameters:{depthTest:!1,depthMask:!1}}))}if(_o&&_o.length>0){const Pr=$r=>{if($r.polygon&&Array.isArray($r.polygon)&&$r.polygon.length>0)return $r.polygon;const qr=Math.min($r.startX||0,$r.endX||0),Vr=Math.max($r.startX||0,$r.endX||0),ri=$r.trackY||0,Ei=$r.geneHeight||sr,Di=$r.arrowheadHeight||fr,Hi=$r.padding||10,Qi=Math.max(Ei,Di)/2+Hi;return[[qr,ri-Qi],[Vr,ri-Qi],[Vr,ri+Qi],[qr,ri+Qi]]},Ur=$r=>{const qr=$r?.strokeColor||$r?.fillColor||[255,180,50,255];return On(qr)},Rr=sr*(.4+Vn*.2),Wr=Math.round(120+Vn*60);kn.push(new PolygonLayer({id:`regions-glow-outer-anim-${En}`,data:_o,getPolygon:Pr,stroked:!0,filled:!1,getLineWidth:Rr,getLineColor:$r=>{const[qr,Vr,ri]=Ur($r),Ei=Zn(qr,Vr,ri,Wr);return[...Ei.color,Ei.opacity]},lineWidthUnits:"common",pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),kn.push(new PolygonLayer({id:"regions-glow-core-anim",data:_o,getPolygon:Pr,stroked:!0,filled:!1,getLineColor:$r=>{const[qr,Vr,ri]=Ur($r);return Dn?[Math.round(qr*.5),Math.round(Vr*.5),Math.round(ri*.5),220]:[255,255,255,255]},getLineWidth:sr*.04,lineWidthUnits:"common",pickable:!1,parameters:{depthTest:!1,depthMask:!1,polygonOffset:[-1,-1]}}))}if(Do&&Do.length>0){const Pr=$r=>{if($r.polygon&&Array.isArray($r.polygon)&&$r.polygon.length>0)return $r.polygon;const qr=Math.min($r.start||0,$r.end||0),Vr=Math.max($r.start||0,$r.end||0),ri=$r.trackY||0,Ei=15;return[[qr,ri-Ei],[Vr,ri-Ei],[Vr,ri+Ei],[qr,ri+Ei]]},Ur=$r=>{const qr=$r?.fillColor||$r?.strokeColor||[120,200,255,255];return On(qr)},Rr=sr*(.35+Vn*.15),Wr=Math.round(100+Vn*50);kn.push(new PolygonLayer({id:`ncrna-glow-outer-anim-${En}`,data:Do,getPolygon:Pr,stroked:!0,filled:!1,getLineWidth:Rr,getLineColor:$r=>{const[qr,Vr,ri]=Ur($r),Ei=Zn(qr,Vr,ri,Wr);return[...Ei.color,Ei.opacity]},lineWidthUnits:"common",pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),kn.push(new PolygonLayer({id:"ncrna-glow-core-anim",data:Do,getPolygon:Pr,stroked:!0,filled:!1,getLineColor:$r=>{const[qr,Vr,ri]=Ur($r);return Dn?[Math.round(qr*.5),Math.round(Vr*.5),Math.round(ri*.5),220]:[255,255,255,255]},getLineWidth:sr*.04,lineWidthUnits:"common",pickable:!1,parameters:{depthTest:!1,depthMask:!1,polygonOffset:[-1,-1]}}))}return kn},[Mi,Wi,ys,io,_o,Do,An,qt.gene?.fillColor,hr,kr.gene?.height,kr.gene?.geneHeight,kr.gene?.arrowheadHeight,kr.gene?.tipWidthFactor,kr.genome?.xScalePercent,kr.tree?.ySpacing,Kn,mi,Gt,Li?.name,Li?.enabled,Li?.numColors,Li?.reverse]),dc=Mi?.length>0||Wi?.length>0||ys?.length>0||io?.length>0||_o?.length>0||Do?.length>0;reactExports.useEffect(()=>{la.current=Ys},[Ys]),reactExports.useEffect(()=>(cs.current&&(cancelAnimationFrame(cs.current),cs.current=null),dc?((()=>{let kn=0;const Vn=33,Nn=Dn=>{if(Dn-kn<Vn){cs.current=requestAnimationFrame(Nn);return}kn=Dn,wa.current+=1;const On=va(wa.current),Pn=ma.current?.deck;if(Pn){const Zn=[...la.current,...On];Pn.setProps({layers:Zn})}cs.current=requestAnimationFrame(Nn)};cs.current=requestAnimationFrame(Nn)})(),()=>{cs.current&&(cancelAnimationFrame(cs.current),cs.current=null)}):void 0),[dc,va]);const fc=React.useMemo(()=>Ys,[Ys]),il=React.useRef(!0),Bl=React.useRef(Pt),sl=React.useRef(Lt),Nl=React.useRef(kt),Ml=React.useRef(0),Hl=100;reactExports.useEffect(()=>{if(typeof window.__hoodini_alignCluster=="function"){Bl.current=Pt,sl.current=Lt,Nl.current=kt,il.current&&(il.current=!1);return}const kn=bs.current;if(!kn||Ea.current||performance.now()-Ml.current<Hl)return;const Nn=Pt!==Bl.current,Dn=Lt!==sl.current,On=kt!==Nl.current;window._visualConfigUpdateTime&&(performance.now()-window._visualConfigUpdateTime,window._visualConfigUpdateTime=null);let Pn=!1;if((Nn||Dn||On||il.current)&&!(il.current&&!Nn&&!Dn&&!On)){const sr=performance.now();if(Pt!=null&&Pt!=="")kn.alignCluster(Pt),Pn=!0;else{const fr=Object.values(kn.hoodRanges||{}).some(mr=>mr.align_gene);kt&&fr?(kn.alignByDefaultGenes(),Pn=!0):Lt==="center"?(kn.alignAllToCenter(),Pn=!0):Lt==="end"?(kn.alignAllToEnd(),Pn=!0):(kn.alignAllToStart(),Pn=!0)}Ml.current=sr}Pn?wi(Zn=>Zn+1):il.current,il.current&&(il.current=!1),Bl.current=Pt,sl.current=Lt,Nl.current=kt},[Pt,Lt,kt]),reactExports.useEffect(()=>{!bs.current||Ni.width===0&&Ni.height},[Ni,tn]),React.useRef(!1),React.useRef(null);const ko=Math.max(0,Ni.height-(Ot?Xi:0)),Zs=React.useRef(Es);return React.useEffect(()=>{Zs.current=Es},[Es]),reactExports.useImperativeHandle(_n,()=>({exportToSVG:()=>{let En=Zs.current||Es;if(!Ys||!En){console.warn("🖼️ HoodiniViz.exportToSVG - missing layers or viewState, aborting");return}let kn=null;if(rr&&or&&vr){const mr=or.unit==="mm"?300:96,Pr=1/25.4;let Ur,Rr;or.unit==="mm"?(Ur=or.width*Pr*mr,Rr=or.height*Pr*mr):(Ur=or.width,Rr=or.height);const Wr=40,$r=Ni.width-2*Wr,qr=ko-2*Wr,Vr=$r/Ur,ri=qr/Rr,Ei=Math.min(Vr,ri),Di=Ur*Ei,Hi=Rr*Ei,Pi=(Ni.width-Di)/2,Qi=(ko-Hi)/2,Si=Pi+Di,Ci=Qi+Hi,Ai=Math.pow(2,En.zoom||0),Xs=En.target[0],Ks=En.target[1],fa=Qs=>Xs+(Qs-Ni.width/2)/Ai,ra=Qs=>Ks+(ko/2-Qs)/Ai;kn={minX:fa(Pi),maxX:fa(Si),minY:ra(Ci),maxY:ra(Qi)}}const Vn=Ot?{minX:Ii.minX,maxX:Ii.maxX,width:Ni.width,height:ko,config:{...qt,tree:{...qt.tree,xScalePercent:ws}},viewState:En,alignmentReferencePoint:go(bs.current),bounds:Ii,genomeView:bs.current,precomputedTicks:$o.current?$o.current.getTicks():void 0,showTreeLayer:Wn&&po,showTreeTextLayer:xr&&po}:void 0,Nn=Ys.filter(mr=>{if(!mr||!mr.id)return!0;const Pr=mr.id;return Pr==="phylo-tree"||Pr==="nodes"||Pr==="tree-nodes"?Wn:Pr==="phylo-labels"?xr:Pr==="genes"?br:Pr==="gene-labels"?wr:Pr==="domains"||Pr.startsWith("domains-")?Fr:Pr==="protein-polygons"?Cr:Pr==="nucleotide-polygons"?dr:Pr==="ncrna-features"?_r:Pr==="region-polygons"?pr:!0}),Dn=exportToSVG(Nn,En,{width:Ni.width,height:ko},qt,Ot?Vn:void 0,An,5,1,rr&&or?{scaleToFormat:!0,formatPreset:or,guideBounds:vr?kn:null,scaleRulerWithCrop:cr}:void 0);if(!Dn)return;let On=Dn,Pn="hoodini-viz-export.svg";if(rr&&or){const mr=new Date().toISOString().slice(0,19).replace(/[:-]/g,"");Pn=`hoodini_${or.name.toLowerCase().replace(/\s+/g,"_")}_${mr}.svg`}const Zn=new Blob([On],{type:"image/svg+xml"}),sr=URL.createObjectURL(Zn),fr=document.createElement("a");fr.href=sr,fr.download=Pn,document.body.appendChild(fr),fr.click(),document.body.removeChild(fr),URL.revokeObjectURL(sr)},genomeView:bs.current,forceAlignUpdate:()=>{try{return wi(En=>En+1),!0}catch{return!1}},alignCluster:En=>{try{const kn=bs.current;return!kn||typeof kn.alignCluster!="function"?!1:(kn.alignCluster(En),wi(Vn=>Vn+1),!0)}catch{return!1}},alignByDefaultGenes:()=>{try{const En=bs.current;return!En||typeof En.alignByDefaultGenes!="function"?!1:(En.alignByDefaultGenes(),wi(kn=>kn+1),!0)}catch{return!1}},focusFeatureByPosition:(En,kn,Vn,Nn="region",Dn=null)=>{try{if(Io(),xo(),ca(),!En||kn==null||Vn==null)return!1;const On=bs.current;if(!On)return!1;const Pn=String(En),sr=Nn==="ncRNA"||Nn==="ncRNA_gene"?On.getAllNcRNAs?.()||[]:On.getAllRegions?.()||[];console.log(`[focusFeatureByPosition] Searching for ${Nn}:`,{seqid:Pn,start:kn,end:Vn,featureCount:sr.length});let fr=null,mr=null;if(Dn&&(fr=sr.find(ri=>ri.id===Dn),fr&&(mr=fr.hood_id)),!fr){let ri=[];On.hoodRanges?.[Pn]&&ri.push(Pn),On.seqidToHoodsMap?.[Pn]&&ri.push(...On.seqidToHoodsMap[Pn]);for(const Ei of ri){const Di=On.hoodRanges?.[Ei];if(Di&&kn>=Di.origStart&&Vn<=Di.origEnd){const Hi=kn-Di.origStart,Pi=Vn-Di.origStart;if(fr=sr.find(Qi=>Qi.hood_id===Ei&&(Qi.origStart===Hi||Qi.start===Hi||Qi.metadata?.start===Hi)&&(Qi.origEnd===Pi||Qi.end===Pi||Qi.metadata?.end===Pi)),fr){mr=Ei;break}}}}if(!fr){for(const ri of sr)if(ri.metadata?.seqid===Pn||ri.hood_id===Pn||ri.seqid===Pn){const Ei=On.hoodRanges?.[ri.hood_id];if(Ei){const Di=kn-(Ei.origStart||0),Hi=Vn-(Ei.origStart||0);if(ri.metadata?.start===Di&&ri.metadata?.end===Hi||ri.origStart===Di&&ri.origEnd===Hi){fr=ri,mr=ri.hood_id;break}}}}if(!fr||!mr)return console.warn(`[focusFeatureByPosition] ${Nn} not found. seqid:`,Pn,"start:",kn,"end:",Vn),!1;if(console.log(`[focusFeatureByPosition] Found ${Nn}:`,{id:fr.id,hood_id:mr,start:fr.start,end:fr.end}),!On.hoodRanges?.[mr])return console.warn("[focusFeatureByPosition] No hoodRange found for hood:",mr),!1;const Ur=On.getTrackYByHoodId?.(mr);if(Ur==null)return console.warn("[focusFeatureByPosition] No trackY found for hood:",mr),!1;const Rr=(fr.start+fr.end)/2,Wr=fr.trackY??Ur;console.log(`[focusFeatureByPosition] ${Nn} colors:`,{fillColor:fr.fillColor,strokeColor:fr.strokeColor,color:fr.color});let $r=[255,180,50,255];if(fr.fillColor&&Array.isArray(fr.fillColor)&&fr.fillColor[3]!==0)$r=fr.fillColor;else if(fr.color&&Array.isArray(fr.color)&&fr.color[3]!==0)$r=fr.color;else if(fr.strokeColor&&Array.isArray(fr.strokeColor)&&fr.strokeColor[3]!==0)$r=fr.strokeColor;else if(typeof fr.getStrokeColor=="function"){const ri=fr.getStrokeColor();ri&&Array.isArray(ri)&&ri[3]!==0&&($r=ri)}const qr={id:fr.id,polygon:fr.polygon,startX:fr.start,endX:fr.end,trackY:fr.trackY,strokeColor:$r,fillColor:$r,featureType:Nn,hoodId:mr};Uo(qr);const Vr=Zs.current&&Zs.current.zoom!==void 0?Zs.current.zoom:Es.zoom||-3;return Ds(ri=>({...ri,target:[Rr,Wr,0],zoom:Vr})),Zs.current={...Zs.current||{},target:[Rr,Wr,0],zoom:Vr},!0}catch(On){return console.error("[focusFeatureByPosition] Error:",On),!1}},focusGeneById:En=>{try{if(!En)return!1;const kn=bs.current;if(!kn)return!1;const Vn=String(En);let Nn=null;if(kn._genesByOriginalId&&typeof kn._genesByOriginalId.get=="function"){const sr=kn._genesByOriginalId.get(Vn);sr&&sr.length&&(Nn=sr[0])}if(!Nn)for(const[sr,fr]of Object.entries(kn.genesById||{})){const mr=fr.originalGeneId||fr.gene_id||fr.originalId||fr.id||fr.metadata&&(fr.metadata.gene_id||fr.metadata.id);if(mr&&String(mr)===Vn){Nn=sr;break}}if(!Nn)return!1;const Dn=kn.genesById[Nn];if(!Dn)return!1;const On=(Dn.start+Dn.end)/2,Pn=Dn.trackY||0,Zn=Zs.current&&Zs.current.zoom!==void 0?Zs.current.zoom:Es.zoom||-3;return Ds(sr=>({...sr,target:[On,Pn,0],zoom:Zn})),Zs.current={...Zs.current||{},target:[On,Pn,0],zoom:Zn},za(Nn,Dn),!0}catch{return!1}},focusBaselineByHood:En=>{try{if(Io(),xo(),ca(),!En)return!1;const kn=bs.current;if(!kn||!kn.hoodRanges)return!1;const Vn=String(En),Nn=kn.hoodRanges[Vn];if(!Nn)return!1;const Dn=kn.trackOffset&&kn.trackOffset[Vn]||0,On=kn.trackFlipped?!!kn.trackFlipped[Vn]:!1,Pn=Nn.length/2,Zn=0,sr=Nn.length,fr=kn.constructor.getTransformedXUnified(Zn,Pn,Dn,On),mr=kn.constructor.getTransformedXUnified(sr,Pn,Dn,On),Pr=kr.genome&&typeof kr.genome.xScalePercent=="number"?kr.genome.xScalePercent/100:1,Ur=Pn+(fr-Pn)*Pr,Rr=Pn+(mr-Pn)*Pr,Wr=(Ur+Rr)/2,$r=typeof kn.getTrackYByHoodId=="function"&&kn.getTrackYByHoodId(Vn)||0,qr=Zs.current&&Zs.current.zoom!==void 0?Zs.current.zoom:Es.zoom||-3;Ds(Ei=>({...Ei,target:[Wr,$r,0],zoom:qr})),Zs.current={...Zs.current||{},target:[Wr,$r,0],zoom:qr},ea.current=!0;const Vr=kn.hoodToSeqidMap?kn.hoodToSeqidMap[Vn]:null;return Fo([{hood_id:Vn,seqid:Vr,start:Ur,end:Rr,trackY:$r}]),setTimeout(()=>{ea.current=!1},100),!0}catch{return!1}},focusTreeLeafById:En=>{try{if(!En)return!1;const kn=us;if(!kn||!Array.isArray(kn.leafNodes))return!1;const Vn=String(En),Nn=kn.leafNodes.find(Wr=>[Wr?.leaf_id,Wr?.metadata?.leaf_id,Wr?.metadata?.leaf_name,Wr?.name,Wr?.metadata?.name].filter($r=>$r!=null).some($r=>String($r)===Vn));if(!Nn)return!1;const Dn=Number.isFinite(Number(Nn.rawY))?Number(Nn.rawY):Number(Nn.y),On=Number.isFinite(Number(Nn.x))?Number(Nn.x):Number(Nn.rawX);if(!Number.isFinite(Dn)||!Number.isFinite(On))return!1;const Pn=qt.tree&&typeof qt.tree.xScalePercent=="number"?qt.tree.xScalePercent/100:1,Zn=Ii.treeOffset||0,sr=[Dn*Pn+Zn,On,0],fr=Zs.current&&Zs.current.zoom!==void 0?Zs.current.zoom:Es.zoom||-3;Ds(Wr=>({...Wr,target:sr,zoom:fr})),Zs.current={...Zs.current||{},target:sr,zoom:fr};const mr=String(Nn.leaf_id||Nn.metadata?.leaf_id||Nn.name||Vn);aa(null),setTimeout(()=>aa(mr),0);const Pr=qt?.tree?.nodeRadius||{internal:4,leaf:2};let Ur=An.treeEdges||[220,180,60,255];if(Ts.current?.nodes){const Wr=Ts.current.nodes.find($r=>$r.leaf_id===mr||$r.name===mr||$r.id===mr||$r.metadata?.leaf_id===mr);Wr?.color&&Array.isArray(Wr.color)&&Wr.color.some($r=>$r>0)&&(Ur=Wr.color)}const Rr=[{id:mr,position:[Dn*Pn+Zn,On],radius:Pr.leaf||2,color:Ur}];return Mo(Rr),!0}catch{return!1}},getLegendData:()=>{try{return Jl()}catch{return null}},geneColorMap:ss}),[Ys,Es,qt,Ot,Ii,An,ws,ko,za,Io,rr,or,vr,cr]),jsxRuntimeExports.jsxs("div",{id:"phylo-tree-viewer-container",ref:ji,style:{width:"100vw",height:"100%",position:"relative",overflow:"hidden",background:An?.background||"var(--background, #ffffff)",color:An?.text||"var(--foreground, #222)"},children:[jsxRuntimeExports.jsx(DeckGL,{ref:ma,views:[new OrthographicView({flipY:!1})],controller:{dragPan:!0,dragRotate:!1,scrollZoom:{smooth:!1,speed:.01},doubleClickZoom:!1,keyboard:!1,inertia:!0,transitionDuration:0,touchZoom:!0,touchRotate:!1},onViewStateChange:En=>{try{const kn=En.viewState;if(In){Zs.current=kn;return}const Vn=qt?.scrollbar?.panPaddingY??50,Nn=qt?.scrollbar?.panPaddingX??500,Dn=Math.pow(2,kn.zoom||0),On=Math.max(1,Dn*.5),Pn=tn!=="none"?hs||200:0,Zn=Vn*On,sr=(Nn+Pn)*On,fr=ua-Ba||1e3,mr=jo-Oo||1e4,Pr=Ni.height||600,Ur=Ni.width||800,Rr=Math.log2(Pr/(fr*1.5)),Wr=Math.log2(Ur/(mr*1.5)),$r=Math.min(Rr,Wr,qt?.scrollbar?.minZoom??-5),qr=qt?.scrollbar?.maxZoom??2;isFinite(kn.zoom)&&(kn.zoom=Math.max($r,Math.min(qr,kn.zoom)));const Vr=Ba-Zn,ri=ua+Zn;if(isFinite(Vr)&&isFinite(ri)&&ri>Vr){const Hi=kn.target[1],Pi=Math.max(Vr,Math.min(ri,Hi));Pi!==Hi&&(kn.target=[kn.target[0],Pi,kn.target[2]||0])}const Ei=Oo-sr,Di=jo+sr;if(isFinite(Ei)&&isFinite(Di)&&Di>Ei){const Hi=kn.target[0],Pi=Math.max(Ei,Math.min(Di,Hi));Pi!==Hi&&(kn.target=[Pi,kn.target[1],kn.target[2]||0])}Zs.current=kn}catch{}},initialViewState:Es,layers:fc,pickingRadius:100,style:{width:"100vw",height:Ot?`${ko}px`:`${ko}px`,position:"absolute",left:"0",top:"0",backgroundColor:"transparent"},getTooltip:Dl,useDevicePixels:!0,_animate:!1,onClick:({object:En,x:kn,y:Vn,srcEvent:Nn})=>{try{console.debug("[HoodiniViz] DeckGL onClick event",{objectType:En&&En.metadata&&En.metadata.type,object:En,x:kn,y:Vn});const Dn=Ii?.treeOffset||0,On=kr?.tree?.nodeRadius||{internal:4,leaf:2},Pn=En&&En.node&&Array.isArray(En.node.branchset)&&En.node.branchset.length===0;if(Pn){const Rr=En.node?.leaf_id||En.node?.metadata?.leaf_id||En.node?.metadata?.leaf_name||En.node?.name||En.node?.id;if(Rr){aa(null),setTimeout(()=>aa(String(Rr)),0);const Wr=Number.isFinite(Number(En.rawY))?Number(En.rawY):Number.isFinite(Number(En.node?.y))?Number(En.node.y):Number(En.node?.rawY),$r=Number.isFinite(Number(En.x))?Number(En.x):Number(En.node?.x),qr=kr.tree&&typeof kr.tree.xScalePercent=="number"?kr.tree.xScalePercent/100:1;Number.isFinite(Wr)&&Number.isFinite($r)&&Mo([{id:Rr,position:[Wr*qr+Dn,$r],radius:En.radius||On.leaf||2,color:En.color||En.node?.color||An.treeEdges||[220,180,60,255]}])}}const Zn=En&&(En.type==="gene"||En.gene),sr=En&&En.type==="hood",fr=En&&En.type==="region",mr=En&&(En.type==="ncRNA"||En.type==="ncRNA_gene"),Pr=Rr=>{try{if(!Rr||!jt||Object.keys(jt).length===0)return;const Wr=Ci=>{if(!Ci||typeof Ci!="object")return Ci;const Ai={...Ci};return Ai.sequence||(Ai.sequence=Ai.rna_sequence||Ai.sequence_nt||Ai.nucleotide_sequence||Ai.rna_seq||Ai.seq||null),Ai.structure||(Ai.structure=Ai.secondary_structure||Ai.dot_bracket||Ai.dbn||Ai.structure_dbn||null),Ai.type||(Ai.type=Ai.ncrna_type||Ai.rna_type||Ai.subtype||null),Ai},$r=bs.current,qr=Rr.hood_id||Rr.hoodId||($r&&$r.getHoodIdFromSeqid?$r.getHoodIdFromSeqid(Rr.seqid):null),Vr=qr&&$r&&$r.hoodRanges?$r.hoodRanges[qr]:null,ri=Vr&&Number.isFinite(Number(Vr.start))?Number(Vr.start):null,Ei=Number.isFinite(Number(Rr.origStart))?Number(Rr.origStart):Number(Rr.start),Di=Number.isFinite(Number(Rr.origEnd))?Number(Rr.origEnd):Number(Rr.end),Hi=Ci=>Ci&&jt[Ci]?(Rr.metadata={...Rr.metadata||{},...Wr(jt[Ci])},!0):!1;if(ri!==null&&Number.isFinite(Ei)&&Number.isFinite(Di)){const Ci=Ei+ri,Ai=Di+ri,Xs=`${Rr.seqid}:${Ci}:${Ai}`;if(Hi(Xs))return}const Pi=`${Rr.seqid}:${Ei}:${Di}`;if(Hi(Pi))return;const Qi=`${Rr.seqid}:${Di}:${Ei}`;if(Hi(Qi))return;const Si=Rr.id||Rr.originalId;if(Hi(Si))return}catch(Wr){console.debug("[HoodiniViz] ncRNA click-time metadata hydration failed",Wr)}};if(Zn){const Rr=En.id||En.uniqueId||En.gene&&(En.gene.uniqueId||En.gene.id||En.gene.gene_id||En.gene.originalGeneId);Rr&&za(Rr,En),Ga(),wo(),xo(),ca()}else fr?(Uo(En),Io(),Ga(),wo(),ca()):mr?(Vi(En),Pr(En),Io(),Ga(),wo(),xo()):(Io(),xo(),ca());if(sr||Ga(),Pn||wo(),En&&En.node&&En.node.branchset&&En.node.branchset.length>0){const Rr=En.node;if(ci&&ci.id===Rr.id)console.debug("[HoodiniViz] deselecting node",Rr.id),xi(null),Fl();else{console.debug("[HoodiniViz] selecting node",Rr.id),xi(Rr);const Wr=Number.isFinite(Number(En.rawY))?Number(En.rawY):Number.isFinite(Number(Rr.y))?Number(Rr.y):Number(Rr.rawY),$r=Number.isFinite(Number(En.x))?Number(En.x):Number(Rr.x),qr=kr.tree&&typeof kr.tree.xScalePercent=="number"?kr.tree.xScalePercent/100:1;Number.isFinite(Wr)&&Number.isFinite($r)&&Va([{id:Rr.id,position:[Wr*qr+Dn,$r],radius:En.radius||On&&On.internal||4,color:En.color||An.treeEdges||[100,180,255,255]}])}}}catch(Dn){console.warn("[HoodiniViz] onClick handler error",Dn)}if(En&&Mt){try{console.debug("[HoodiniViz] forwarding click to onObjectClick",En&&(En.type||En.metadata&&En.metadata.type||En.node&&"tree-node"))}catch{}Mt(En)}En||(Io(),Ga(),wo(),xo(),ca())}}),Ot&&jsxRuntimeExports.jsx("div",{style:{position:"absolute",left:"0",bottom:"0",width:"100%",height:`${Xi}px`,transform:"translateX(0)",zIndex:1},children:jsxRuntimeExports.jsx(RulerWidget,{ref:$o,minX:Ii.minX,maxX:Ii.maxX,viewState:Es,viewStateRef:Zs,containerWidth:Ni.width,containerHeight:ko,visible:Ot,genomeView:bs.current,hasNewick:po,alignmentReferencePoint:go(bs.current),bounds:Ii,config:kr})}),St&&jsxRuntimeExports.jsx(ScrollbarWidget,{minY:Ya,maxY:Yo,scrollNorm:wl,setScrollNorm:cl,visibleFraction:As,setViewState:Ds,containerHeight:ko,viewState:Es,viewStateRef:Zs,config:qt,themeColors:An}),jsxRuntimeExports.jsx(GuideOverlay,{visible:In,formatPreset:or,containerWidth:Ni.width,containerHeight:ko,viewState:Es,themeColors:{accent:An.accent,border:An.border}})]})});var _baseHas,hasRequired_baseHas;function require_baseHas(){if(hasRequired_baseHas)return _baseHas;hasRequired_baseHas=1;var yt=Object.prototype,Et=yt.hasOwnProperty;function xt(vt,bt){return vt!=null&&Et.call(vt,bt)}return _baseHas=xt,_baseHas}var isArray_1,hasRequiredIsArray;function requireIsArray(){if(hasRequiredIsArray)return isArray_1;hasRequiredIsArray=1;var yt=Array.isArray;return isArray_1=yt,isArray_1}var _freeGlobal,hasRequired_freeGlobal;function require_freeGlobal(){if(hasRequired_freeGlobal)return _freeGlobal;hasRequired_freeGlobal=1;var yt=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;return _freeGlobal=yt,_freeGlobal}var _root,hasRequired_root;function require_root(){if(hasRequired_root)return _root;hasRequired_root=1;var yt=require_freeGlobal(),Et=typeof self=="object"&&self&&self.Object===Object&&self,xt=yt||Et||Function("return this")();return _root=xt,_root}var _Symbol,hasRequired_Symbol;function require_Symbol(){if(hasRequired_Symbol)return _Symbol;hasRequired_Symbol=1;var yt=require_root(),Et=yt.Symbol;return _Symbol=Et,_Symbol}var _getRawTag,hasRequired_getRawTag;function require_getRawTag(){if(hasRequired_getRawTag)return _getRawTag;hasRequired_getRawTag=1;var yt=require_Symbol(),Et=Object.prototype,xt=Et.hasOwnProperty,vt=Et.toString,bt=yt?yt.toStringTag:void 0;function At(Ft){var Ct=xt.call(Ft,bt),wt=Ft[bt];try{Ft[bt]=void 0;var St=!0}catch{}var Tt=vt.call(Ft);return St&&(Ct?Ft[bt]=wt:delete Ft[bt]),Tt}return _getRawTag=At,_getRawTag}var _objectToString,hasRequired_objectToString;function require_objectToString(){if(hasRequired_objectToString)return _objectToString;hasRequired_objectToString=1;var yt=Object.prototype,Et=yt.toString;function xt(vt){return Et.call(vt)}return _objectToString=xt,_objectToString}var _baseGetTag,hasRequired_baseGetTag;function require_baseGetTag(){if(hasRequired_baseGetTag)return _baseGetTag;hasRequired_baseGetTag=1;var yt=require_Symbol(),Et=require_getRawTag(),xt=require_objectToString(),vt="[object Null]",bt="[object Undefined]",At=yt?yt.toStringTag:void 0;function Ft(Ct){return Ct==null?Ct===void 0?bt:vt:At&&At in Object(Ct)?Et(Ct):xt(Ct)}return _baseGetTag=Ft,_baseGetTag}var isObjectLike_1,hasRequiredIsObjectLike;function requireIsObjectLike(){if(hasRequiredIsObjectLike)return isObjectLike_1;hasRequiredIsObjectLike=1;function yt(Et){return Et!=null&&typeof Et=="object"}return isObjectLike_1=yt,isObjectLike_1}var isSymbol_1,hasRequiredIsSymbol;function requireIsSymbol(){if(hasRequiredIsSymbol)return isSymbol_1;hasRequiredIsSymbol=1;var yt=require_baseGetTag(),Et=requireIsObjectLike(),xt="[object Symbol]";function vt(bt){return typeof bt=="symbol"||Et(bt)&&yt(bt)==xt}return isSymbol_1=vt,isSymbol_1}var _isKey,hasRequired_isKey;function require_isKey(){if(hasRequired_isKey)return _isKey;hasRequired_isKey=1;var yt=requireIsArray(),Et=requireIsSymbol(),xt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vt=/^\w*$/;function bt(At,Ft){if(yt(At))return!1;var Ct=typeof At;return Ct=="number"||Ct=="symbol"||Ct=="boolean"||At==null||Et(At)?!0:vt.test(At)||!xt.test(At)||Ft!=null&&At in Object(Ft)}return _isKey=bt,_isKey}var isObject_1,hasRequiredIsObject;function requireIsObject(){if(hasRequiredIsObject)return isObject_1;hasRequiredIsObject=1;function yt(Et){var xt=typeof Et;return Et!=null&&(xt=="object"||xt=="function")}return isObject_1=yt,isObject_1}var isFunction_1,hasRequiredIsFunction;function requireIsFunction(){if(hasRequiredIsFunction)return isFunction_1;hasRequiredIsFunction=1;var yt=require_baseGetTag(),Et=requireIsObject(),xt="[object AsyncFunction]",vt="[object Function]",bt="[object GeneratorFunction]",At="[object Proxy]";function Ft(Ct){if(!Et(Ct))return!1;var wt=yt(Ct);return wt==vt||wt==bt||wt==xt||wt==At}return isFunction_1=Ft,isFunction_1}var _coreJsData,hasRequired_coreJsData;function require_coreJsData(){if(hasRequired_coreJsData)return _coreJsData;hasRequired_coreJsData=1;var yt=require_root(),Et=yt["__core-js_shared__"];return _coreJsData=Et,_coreJsData}var _isMasked,hasRequired_isMasked;function require_isMasked(){if(hasRequired_isMasked)return _isMasked;hasRequired_isMasked=1;var yt=require_coreJsData(),Et=(function(){var vt=/[^.]+$/.exec(yt&&yt.keys&&yt.keys.IE_PROTO||"");return vt?"Symbol(src)_1."+vt:""})();function xt(vt){return!!Et&&Et in vt}return _isMasked=xt,_isMasked}var _toSource,hasRequired_toSource;function require_toSource(){if(hasRequired_toSource)return _toSource;hasRequired_toSource=1;var yt=Function.prototype,Et=yt.toString;function xt(vt){if(vt!=null){try{return Et.call(vt)}catch{}try{return vt+""}catch{}}return""}return _toSource=xt,_toSource}var _baseIsNative,hasRequired_baseIsNative;function require_baseIsNative(){if(hasRequired_baseIsNative)return _baseIsNative;hasRequired_baseIsNative=1;var yt=requireIsFunction(),Et=require_isMasked(),xt=requireIsObject(),vt=require_toSource(),bt=/[\\^$.*+?()[\]{}|]/g,At=/^\[object .+?Constructor\]$/,Ft=Function.prototype,Ct=Object.prototype,wt=Ft.toString,St=Ct.hasOwnProperty,Tt=RegExp("^"+wt.call(St).replace(bt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Rt(Pt){if(!xt(Pt)||Et(Pt))return!1;var Lt=yt(Pt)?Tt:At;return Lt.test(vt(Pt))}return _baseIsNative=Rt,_baseIsNative}var _getValue,hasRequired_getValue;function require_getValue(){if(hasRequired_getValue)return _getValue;hasRequired_getValue=1;function yt(Et,xt){return Et?.[xt]}return _getValue=yt,_getValue}var _getNative,hasRequired_getNative;function require_getNative(){if(hasRequired_getNative)return _getNative;hasRequired_getNative=1;var yt=require_baseIsNative(),Et=require_getValue();function xt(vt,bt){var At=Et(vt,bt);return yt(At)?At:void 0}return _getNative=xt,_getNative}var _nativeCreate,hasRequired_nativeCreate;function require_nativeCreate(){if(hasRequired_nativeCreate)return _nativeCreate;hasRequired_nativeCreate=1;var yt=require_getNative(),Et=yt(Object,"create");return _nativeCreate=Et,_nativeCreate}var _hashClear,hasRequired_hashClear;function require_hashClear(){if(hasRequired_hashClear)return _hashClear;hasRequired_hashClear=1;var yt=require_nativeCreate();function Et(){this.__data__=yt?yt(null):{},this.size=0}return _hashClear=Et,_hashClear}var _hashDelete,hasRequired_hashDelete;function require_hashDelete(){if(hasRequired_hashDelete)return _hashDelete;hasRequired_hashDelete=1;function yt(Et){var xt=this.has(Et)&&delete this.__data__[Et];return this.size-=xt?1:0,xt}return _hashDelete=yt,_hashDelete}var _hashGet,hasRequired_hashGet;function require_hashGet(){if(hasRequired_hashGet)return _hashGet;hasRequired_hashGet=1;var yt=require_nativeCreate(),Et="__lodash_hash_undefined__",xt=Object.prototype,vt=xt.hasOwnProperty;function bt(At){var Ft=this.__data__;if(yt){var Ct=Ft[At];return Ct===Et?void 0:Ct}return vt.call(Ft,At)?Ft[At]:void 0}return _hashGet=bt,_hashGet}var _hashHas,hasRequired_hashHas;function require_hashHas(){if(hasRequired_hashHas)return _hashHas;hasRequired_hashHas=1;var yt=require_nativeCreate(),Et=Object.prototype,xt=Et.hasOwnProperty;function vt(bt){var At=this.__data__;return yt?At[bt]!==void 0:xt.call(At,bt)}return _hashHas=vt,_hashHas}var _hashSet,hasRequired_hashSet;function require_hashSet(){if(hasRequired_hashSet)return _hashSet;hasRequired_hashSet=1;var yt=require_nativeCreate(),Et="__lodash_hash_undefined__";function xt(vt,bt){var At=this.__data__;return this.size+=this.has(vt)?0:1,At[vt]=yt&&bt===void 0?Et:bt,this}return _hashSet=xt,_hashSet}var _Hash,hasRequired_Hash;function require_Hash(){if(hasRequired_Hash)return _Hash;hasRequired_Hash=1;var yt=require_hashClear(),Et=require_hashDelete(),xt=require_hashGet(),vt=require_hashHas(),bt=require_hashSet();function At(Ft){var Ct=-1,wt=Ft==null?0:Ft.length;for(this.clear();++Ct<wt;){var St=Ft[Ct];this.set(St[0],St[1])}}return At.prototype.clear=yt,At.prototype.delete=Et,At.prototype.get=xt,At.prototype.has=vt,At.prototype.set=bt,_Hash=At,_Hash}var _listCacheClear,hasRequired_listCacheClear;function require_listCacheClear(){if(hasRequired_listCacheClear)return _listCacheClear;hasRequired_listCacheClear=1;function yt(){this.__data__=[],this.size=0}return _listCacheClear=yt,_listCacheClear}var eq_1,hasRequiredEq;function requireEq(){if(hasRequiredEq)return eq_1;hasRequiredEq=1;function yt(Et,xt){return Et===xt||Et!==Et&&xt!==xt}return eq_1=yt,eq_1}var _assocIndexOf,hasRequired_assocIndexOf;function require_assocIndexOf(){if(hasRequired_assocIndexOf)return _assocIndexOf;hasRequired_assocIndexOf=1;var yt=requireEq();function Et(xt,vt){for(var bt=xt.length;bt--;)if(yt(xt[bt][0],vt))return bt;return-1}return _assocIndexOf=Et,_assocIndexOf}var _listCacheDelete,hasRequired_listCacheDelete;function require_listCacheDelete(){if(hasRequired_listCacheDelete)return _listCacheDelete;hasRequired_listCacheDelete=1;var yt=require_assocIndexOf(),Et=Array.prototype,xt=Et.splice;function vt(bt){var At=this.__data__,Ft=yt(At,bt);if(Ft<0)return!1;var Ct=At.length-1;return Ft==Ct?At.pop():xt.call(At,Ft,1),--this.size,!0}return _listCacheDelete=vt,_listCacheDelete}var _listCacheGet,hasRequired_listCacheGet;function require_listCacheGet(){if(hasRequired_listCacheGet)return _listCacheGet;hasRequired_listCacheGet=1;var yt=require_assocIndexOf();function Et(xt){var vt=this.__data__,bt=yt(vt,xt);return bt<0?void 0:vt[bt][1]}return _listCacheGet=Et,_listCacheGet}var _listCacheHas,hasRequired_listCacheHas;function require_listCacheHas(){if(hasRequired_listCacheHas)return _listCacheHas;hasRequired_listCacheHas=1;var yt=require_assocIndexOf();function Et(xt){return yt(this.__data__,xt)>-1}return _listCacheHas=Et,_listCacheHas}var _listCacheSet,hasRequired_listCacheSet;function require_listCacheSet(){if(hasRequired_listCacheSet)return _listCacheSet;hasRequired_listCacheSet=1;var yt=require_assocIndexOf();function Et(xt,vt){var bt=this.__data__,At=yt(bt,xt);return At<0?(++this.size,bt.push([xt,vt])):bt[At][1]=vt,this}return _listCacheSet=Et,_listCacheSet}var _ListCache,hasRequired_ListCache;function require_ListCache(){if(hasRequired_ListCache)return _ListCache;hasRequired_ListCache=1;var yt=require_listCacheClear(),Et=require_listCacheDelete(),xt=require_listCacheGet(),vt=require_listCacheHas(),bt=require_listCacheSet();function At(Ft){var Ct=-1,wt=Ft==null?0:Ft.length;for(this.clear();++Ct<wt;){var St=Ft[Ct];this.set(St[0],St[1])}}return At.prototype.clear=yt,At.prototype.delete=Et,At.prototype.get=xt,At.prototype.has=vt,At.prototype.set=bt,_ListCache=At,_ListCache}var _Map,hasRequired_Map;function require_Map(){if(hasRequired_Map)return _Map;hasRequired_Map=1;var yt=require_getNative(),Et=require_root(),xt=yt(Et,"Map");return _Map=xt,_Map}var _mapCacheClear,hasRequired_mapCacheClear;function require_mapCacheClear(){if(hasRequired_mapCacheClear)return _mapCacheClear;hasRequired_mapCacheClear=1;var yt=require_Hash(),Et=require_ListCache(),xt=require_Map();function vt(){this.size=0,this.__data__={hash:new yt,map:new(xt||Et),string:new yt}}return _mapCacheClear=vt,_mapCacheClear}var _isKeyable,hasRequired_isKeyable;function require_isKeyable(){if(hasRequired_isKeyable)return _isKeyable;hasRequired_isKeyable=1;function yt(Et){var xt=typeof Et;return xt=="string"||xt=="number"||xt=="symbol"||xt=="boolean"?Et!=="__proto__":Et===null}return _isKeyable=yt,_isKeyable}var _getMapData,hasRequired_getMapData;function require_getMapData(){if(hasRequired_getMapData)return _getMapData;hasRequired_getMapData=1;var yt=require_isKeyable();function Et(xt,vt){var bt=xt.__data__;return yt(vt)?bt[typeof vt=="string"?"string":"hash"]:bt.map}return _getMapData=Et,_getMapData}var _mapCacheDelete,hasRequired_mapCacheDelete;function require_mapCacheDelete(){if(hasRequired_mapCacheDelete)return _mapCacheDelete;hasRequired_mapCacheDelete=1;var yt=require_getMapData();function Et(xt){var vt=yt(this,xt).delete(xt);return this.size-=vt?1:0,vt}return _mapCacheDelete=Et,_mapCacheDelete}var _mapCacheGet,hasRequired_mapCacheGet;function require_mapCacheGet(){if(hasRequired_mapCacheGet)return _mapCacheGet;hasRequired_mapCacheGet=1;var yt=require_getMapData();function Et(xt){return yt(this,xt).get(xt)}return _mapCacheGet=Et,_mapCacheGet}var _mapCacheHas,hasRequired_mapCacheHas;function require_mapCacheHas(){if(hasRequired_mapCacheHas)return _mapCacheHas;hasRequired_mapCacheHas=1;var yt=require_getMapData();function Et(xt){return yt(this,xt).has(xt)}return _mapCacheHas=Et,_mapCacheHas}var _mapCacheSet,hasRequired_mapCacheSet;function require_mapCacheSet(){if(hasRequired_mapCacheSet)return _mapCacheSet;hasRequired_mapCacheSet=1;var yt=require_getMapData();function Et(xt,vt){var bt=yt(this,xt),At=bt.size;return bt.set(xt,vt),this.size+=bt.size==At?0:1,this}return _mapCacheSet=Et,_mapCacheSet}var _MapCache,hasRequired_MapCache;function require_MapCache(){if(hasRequired_MapCache)return _MapCache;hasRequired_MapCache=1;var yt=require_mapCacheClear(),Et=require_mapCacheDelete(),xt=require_mapCacheGet(),vt=require_mapCacheHas(),bt=require_mapCacheSet();function At(Ft){var Ct=-1,wt=Ft==null?0:Ft.length;for(this.clear();++Ct<wt;){var St=Ft[Ct];this.set(St[0],St[1])}}return At.prototype.clear=yt,At.prototype.delete=Et,At.prototype.get=xt,At.prototype.has=vt,At.prototype.set=bt,_MapCache=At,_MapCache}var memoize_1,hasRequiredMemoize;function requireMemoize(){if(hasRequiredMemoize)return memoize_1;hasRequiredMemoize=1;var yt=require_MapCache(),Et="Expected a function";function xt(vt,bt){if(typeof vt!="function"||bt!=null&&typeof bt!="function")throw new TypeError(Et);var At=function(){var Ft=arguments,Ct=bt?bt.apply(this,Ft):Ft[0],wt=At.cache;if(wt.has(Ct))return wt.get(Ct);var St=vt.apply(this,Ft);return At.cache=wt.set(Ct,St)||wt,St};return At.cache=new(xt.Cache||yt),At}return xt.Cache=yt,memoize_1=xt,memoize_1}var _memoizeCapped,hasRequired_memoizeCapped;function require_memoizeCapped(){if(hasRequired_memoizeCapped)return _memoizeCapped;hasRequired_memoizeCapped=1;var yt=requireMemoize(),Et=500;function xt(vt){var bt=yt(vt,function(Ft){return At.size===Et&&At.clear(),Ft}),At=bt.cache;return bt}return _memoizeCapped=xt,_memoizeCapped}var _stringToPath,hasRequired_stringToPath;function require_stringToPath(){if(hasRequired_stringToPath)return _stringToPath;hasRequired_stringToPath=1;var yt=require_memoizeCapped(),Et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xt=/\\(\\)?/g,vt=yt(function(bt){var At=[];return bt.charCodeAt(0)===46&&At.push(""),bt.replace(Et,function(Ft,Ct,wt,St){At.push(wt?St.replace(xt,"$1"):Ct||Ft)}),At});return _stringToPath=vt,_stringToPath}var _arrayMap,hasRequired_arrayMap;function require_arrayMap(){if(hasRequired_arrayMap)return _arrayMap;hasRequired_arrayMap=1;function yt(Et,xt){for(var vt=-1,bt=Et==null?0:Et.length,At=Array(bt);++vt<bt;)At[vt]=xt(Et[vt],vt,Et);return At}return _arrayMap=yt,_arrayMap}var _baseToString,hasRequired_baseToString;function require_baseToString(){if(hasRequired_baseToString)return _baseToString;hasRequired_baseToString=1;var yt=require_Symbol(),Et=require_arrayMap(),xt=requireIsArray(),vt=requireIsSymbol(),bt=yt?yt.prototype:void 0,At=bt?bt.toString:void 0;function Ft(Ct){if(typeof Ct=="string")return Ct;if(xt(Ct))return Et(Ct,Ft)+"";if(vt(Ct))return At?At.call(Ct):"";var wt=Ct+"";return wt=="0"&&1/Ct==-1/0?"-0":wt}return _baseToString=Ft,_baseToString}var toString_1,hasRequiredToString;function requireToString(){if(hasRequiredToString)return toString_1;hasRequiredToString=1;var yt=require_baseToString();function Et(xt){return xt==null?"":yt(xt)}return toString_1=Et,toString_1}var _castPath,hasRequired_castPath;function require_castPath(){if(hasRequired_castPath)return _castPath;hasRequired_castPath=1;var yt=requireIsArray(),Et=require_isKey(),xt=require_stringToPath(),vt=requireToString();function bt(At,Ft){return yt(At)?At:Et(At,Ft)?[At]:xt(vt(At))}return _castPath=bt,_castPath}var _baseIsArguments,hasRequired_baseIsArguments;function require_baseIsArguments(){if(hasRequired_baseIsArguments)return _baseIsArguments;hasRequired_baseIsArguments=1;var yt=require_baseGetTag(),Et=requireIsObjectLike(),xt="[object Arguments]";function vt(bt){return Et(bt)&&yt(bt)==xt}return _baseIsArguments=vt,_baseIsArguments}var isArguments_1,hasRequiredIsArguments;function requireIsArguments(){if(hasRequiredIsArguments)return isArguments_1;hasRequiredIsArguments=1;var yt=require_baseIsArguments(),Et=requireIsObjectLike(),xt=Object.prototype,vt=xt.hasOwnProperty,bt=xt.propertyIsEnumerable,At=yt((function(){return arguments})())?yt:function(Ft){return Et(Ft)&&vt.call(Ft,"callee")&&!bt.call(Ft,"callee")};return isArguments_1=At,isArguments_1}var _isIndex,hasRequired_isIndex;function require_isIndex(){if(hasRequired_isIndex)return _isIndex;hasRequired_isIndex=1;var yt=9007199254740991,Et=/^(?:0|[1-9]\d*)$/;function xt(vt,bt){var At=typeof vt;return bt=bt??yt,!!bt&&(At=="number"||At!="symbol"&&Et.test(vt))&&vt>-1&&vt%1==0&&vt<bt}return _isIndex=xt,_isIndex}var isLength_1,hasRequiredIsLength;function requireIsLength(){if(hasRequiredIsLength)return isLength_1;hasRequiredIsLength=1;var yt=9007199254740991;function Et(xt){return typeof xt=="number"&&xt>-1&&xt%1==0&&xt<=yt}return isLength_1=Et,isLength_1}var _toKey,hasRequired_toKey;function require_toKey(){if(hasRequired_toKey)return _toKey;hasRequired_toKey=1;var yt=requireIsSymbol();function Et(xt){if(typeof xt=="string"||yt(xt))return xt;var vt=xt+"";return vt=="0"&&1/xt==-1/0?"-0":vt}return _toKey=Et,_toKey}var _hasPath,hasRequired_hasPath;function require_hasPath(){if(hasRequired_hasPath)return _hasPath;hasRequired_hasPath=1;var yt=require_castPath(),Et=requireIsArguments(),xt=requireIsArray(),vt=require_isIndex(),bt=requireIsLength(),At=require_toKey();function Ft(Ct,wt,St){wt=yt(wt,Ct);for(var Tt=-1,Rt=wt.length,Pt=!1;++Tt<Rt;){var Lt=At(wt[Tt]);if(!(Pt=Ct!=null&&St(Ct,Lt)))break;Ct=Ct[Lt]}return Pt||++Tt!=Rt?Pt:(Rt=Ct==null?0:Ct.length,!!Rt&&bt(Rt)&&vt(Lt,Rt)&&(xt(Ct)||Et(Ct)))}return _hasPath=Ft,_hasPath}var has_1,hasRequiredHas;function requireHas(){if(hasRequiredHas)return has_1;hasRequiredHas=1;var yt=require_baseHas(),Et=require_hasPath();function xt(vt,bt){return vt!=null&&Et(vt,bt,yt)}return has_1=xt,has_1}var hasExports=requireHas();const has$1=getDefaultExportFromCjs(hasExports);function panic(yt="This should not happen"){throw new Error(yt)}function assert(yt,Et="Assertion failed"){if(!yt)return panic(Et)}function assertNever(yt,Et){return panic(Et??"Hell froze over")}function maybe(yt,Et){try{return yt()}catch{return Et}}const has=Object.prototype.hasOwnProperty;function deepEqual(yt,Et){let xt,vt;if(yt===Et)return!0;if(yt&&Et&&(xt=yt.constructor)===Et.constructor){if(xt===Date)return yt.getTime()===Et.getTime();if(xt===RegExp)return yt.toString()===Et.toString();if(xt===Array){if((vt=yt.length)===Et.length)for(;vt--&&deepEqual(yt[vt],Et[vt]););return vt===-1}if(!xt||typeof yt=="object"){vt=0;for(xt in yt)if(has.call(yt,xt)&&++vt&&!has.call(Et,xt)||!(xt in Et)||!deepEqual(yt[xt],Et[xt]))return!1;return Object.keys(Et).length===vt}}return yt!==yt&&Et!==Et}const BooleanEmpty=null,BooleanIndeterminate=void 0;var GridCellKind;(function(yt){yt.Uri="uri",yt.Text="text",yt.Image="image",yt.RowID="row-id",yt.Number="number",yt.Bubble="bubble",yt.Boolean="boolean",yt.Loading="loading",yt.Markdown="markdown",yt.Drilldown="drilldown",yt.Protected="protected",yt.Custom="custom"})(GridCellKind||(GridCellKind={}));var GridColumnIcon;(function(yt){yt.HeaderRowID="headerRowID",yt.HeaderCode="headerCode",yt.HeaderNumber="headerNumber",yt.HeaderString="headerString",yt.HeaderBoolean="headerBoolean",yt.HeaderAudioUri="headerAudioUri",yt.HeaderVideoUri="headerVideoUri",yt.HeaderEmoji="headerEmoji",yt.HeaderImage="headerImage",yt.HeaderUri="headerUri",yt.HeaderPhone="headerPhone",yt.HeaderMarkdown="headerMarkdown",yt.HeaderDate="headerDate",yt.HeaderTime="headerTime",yt.HeaderEmail="headerEmail",yt.HeaderReference="headerReference",yt.HeaderIfThenElse="headerIfThenElse",yt.HeaderSingleValue="headerSingleValue",yt.HeaderLookup="headerLookup",yt.HeaderTextTemplate="headerTextTemplate",yt.HeaderMath="headerMath",yt.HeaderRollup="headerRollup",yt.HeaderJoinStrings="headerJoinStrings",yt.HeaderSplitString="headerSplitString",yt.HeaderGeoDistance="headerGeoDistance",yt.HeaderArray="headerArray",yt.RowOwnerOverlay="rowOwnerOverlay",yt.ProtectedColumnOverlay="protectedColumnOverlay"})(GridColumnIcon||(GridColumnIcon={}));var GridColumnMenuIcon;(function(yt){yt.Triangle="triangle",yt.Dots="dots"})(GridColumnMenuIcon||(GridColumnMenuIcon={}));function isSizedGridColumn(yt){return"width"in yt&&typeof yt.width=="number"}async function resolveCellsThunk(yt){return typeof yt=="object"?yt:await yt()}function isEditableGridCell(yt){return!(yt.kind===GridCellKind.Loading||yt.kind===GridCellKind.Bubble||yt.kind===GridCellKind.RowID||yt.kind===GridCellKind.Protected||yt.kind===GridCellKind.Drilldown)}function isInnerOnlyCell(yt){return yt.kind===InnerGridCellKind.Marker||yt.kind===InnerGridCellKind.NewRow}function isReadWriteCell(yt){if(!isEditableGridCell(yt)||yt.kind===GridCellKind.Image)return!1;switch(yt.kind){case GridCellKind.Text:case GridCellKind.Number:case GridCellKind.Markdown:case GridCellKind.Uri:case GridCellKind.Custom:case GridCellKind.Boolean:return yt.readonly!==!0;default:assertNever(yt,"A cell was passed with an invalid kind")}}function isObjectEditorCallbackResult(yt){return has$1(yt,"editor")}function booleanCellIsEditable(yt){return!(yt.readonly??!1)}var InnerGridCellKind;(function(yt){yt.NewRow="new-row",yt.Marker="marker"})(InnerGridCellKind||(InnerGridCellKind={}));const DEFAULT_FILL_HANDLE={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function mergeRanges(yt){if(yt.length===0)return[];const Et=[...yt],xt=[];Et.sort(function(vt,bt){return vt[0]-bt[0]}),xt.push([...Et[0]]);for(const vt of Et.slice(1)){const bt=xt[xt.length-1];bt[1]<vt[0]?xt.push([...vt]):bt[1]<vt[1]&&(bt[1]=vt[1])}return xt}let emptyCompactSelection;class CompactSelection{items;constructor(Et){this.items=Et}static create=Et=>new CompactSelection(mergeRanges(Et));static empty=()=>emptyCompactSelection??(emptyCompactSelection=new CompactSelection([]));static fromSingleSelection=Et=>CompactSelection.empty().add(Et);static fromArray=Et=>{if(Et.length===0)return CompactSelection.empty();const xt=Et.map(bt=>[bt,bt+1]),vt=mergeRanges(xt);return new CompactSelection(vt)};offset(Et){if(Et===0)return this;const xt=this.items.map(vt=>[vt[0]+Et,vt[1]+Et]);return new CompactSelection(xt)}add(Et){const xt=typeof Et=="number"?[Et,Et+1]:Et,vt=mergeRanges([...this.items,xt]);return new CompactSelection(vt)}remove(Et){const xt=[...this.items],vt=typeof Et=="number"?Et:Et[0],bt=typeof Et=="number"?Et+1:Et[1];for(const[At,Ft]of xt.entries()){const[Ct,wt]=Ft;if(Ct<=bt&&vt<=wt){const St=[];Ct<vt&&St.push([Ct,vt]),bt<wt&&St.push([bt,wt]),xt.splice(At,1,...St)}}return new CompactSelection(xt)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(Et){for(let xt=0;xt<this.items.length;xt++){const[vt,bt]=this.items[xt];if(Et>=vt&&Et<bt)return!0}return!1}hasAll(Et){for(let xt=Et[0];xt<Et[1];xt++)if(!this.hasIndex(xt))return!1;return!0}some(Et){for(const xt of this)if(Et(xt))return!0;return!1}equals(Et){if(Et===this)return!0;if(Et.items.length!==this.items.length)return!1;for(let xt=0;xt<this.items.length;xt++){const vt=Et.items[xt],bt=this.items[xt];if(vt[0]!==bt[0]||vt[1]!==bt[1])return!1}return!0}toArray(){const Et=[];for(const[xt,vt]of this.items)for(let bt=xt;bt<vt;bt++)Et.push(bt);return Et}get length(){let Et=0;for(const[xt,vt]of this.items)Et+=vt-xt;return Et}*[Symbol.iterator](){for(const[Et,xt]of this.items)for(let vt=Et;vt<xt;vt++)yield vt}}function memoize(yt){var Et=Object.create(null);return function(xt){return Et[xt]===void 0&&(Et[xt]=yt(xt)),Et[xt]}}var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,isPropValid=memoize(function(yt){return reactPropsRegex.test(yt)||yt.charCodeAt(0)===111&&yt.charCodeAt(1)===110&&yt.charCodeAt(2)<91}),cx=function(){const Et=Array.prototype.slice.call(arguments).filter(Boolean),xt={},vt=[];Et.forEach(At=>{(At?At.split(" "):[]).forEach(Ct=>{if(Ct.startsWith("atm_")){const[,wt]=Ct.split("_");xt[wt]=Ct}else vt.push(Ct)})});const bt=[];for(const At in xt)Object.prototype.hasOwnProperty.call(xt,At)&&bt.push(xt[At]);return bt.push(...vt),bt.join(" ")},cx_default=cx,isCapital=yt=>yt.toUpperCase()===yt,filterKey=yt=>Et=>yt.indexOf(Et)===-1,omit=(yt,Et)=>{const xt={};return Object.keys(yt).filter(filterKey(Et)).forEach(vt=>{xt[vt]=yt[vt]}),xt};function filterProps(yt,Et,xt){const vt=omit(Et,xt);if(!yt){const bt=typeof isPropValid=="function"?{default:isPropValid}:isPropValid;Object.keys(vt).forEach(At=>{bt.default(At)||delete vt[At]})}return vt}var warnIfInvalid=(yt,Et)=>{};function styled(yt){let Et="";return xt=>{const vt=(At,Ft)=>{const{as:Ct=yt,class:wt=Et}=At,St=xt.propsAsIs===void 0?!(typeof Ct=="string"&&Ct.indexOf("-")===-1&&!isCapital(Ct[0])):xt.propsAsIs,Tt=filterProps(St,At,["as","class"]);Tt.ref=Ft,Tt.className=xt.atomic?cx_default(xt.class,Tt.className||wt):cx_default(Tt.className||wt,xt.class);const{vars:Rt}=xt;if(Rt){const Pt={};for(const Ot in Rt){const Mt=Rt[Ot],It=Mt[0],Nt=Mt[1]||"",Ut=typeof It=="function"?It(At):It;warnIfInvalid(Ut,xt.name),Pt[`--${Ot}`]=`${Ut}${Nt}`}const Lt=Tt.style||{},kt=Object.keys(Lt);kt.length>0&&kt.forEach(Ot=>{Pt[Ot]=Lt[Ot]}),Tt.style=Pt}return yt.__wyw_meta&&yt!==Ct?(Tt.as=Ct,reactExports.createElement(yt,Tt)):reactExports.createElement(Ct,Tt)},bt=reactExports.forwardRef?reactExports.forwardRef(vt):(At=>{const Ft=omit(At,["innerRef"]);return vt(Ft,At.innerRef)});return bt.displayName=xt.name,bt.__wyw_meta={className:xt.class||Et,extends:yt},bt}}var styled_default=styled;const ImageOverlayEditorStyle=styled_default("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var js={},Carousel={},lib={},reactSwipe={},propTypes={exports:{}},ReactPropTypesSecret_1,hasRequiredReactPropTypesSecret;function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;var yt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ReactPropTypesSecret_1=yt,ReactPropTypesSecret_1}var factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var yt=requireReactPropTypesSecret();function Et(){}function xt(){}return xt.resetWarningCache=Et,factoryWithThrowingShims=function(){function vt(Ft,Ct,wt,St,Tt,Rt){if(Rt!==yt){var Pt=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw Pt.name="Invariant Violation",Pt}}vt.isRequired=vt;function bt(){return vt}var At={array:vt,bigint:vt,bool:vt,func:vt,number:vt,object:vt,string:vt,symbol:vt,any:vt,arrayOf:bt,element:vt,elementType:vt,instanceOf:bt,node:vt,objectOf:bt,oneOf:bt,oneOfType:bt,shape:bt,exact:bt,checkPropTypes:xt,resetWarningCache:Et};return At.PropTypes=At,At},factoryWithThrowingShims}var hasRequiredPropTypes;function requirePropTypes(){return hasRequiredPropTypes||(hasRequiredPropTypes=1,propTypes.exports=requireFactoryWithThrowingShims()()),propTypes.exports}var hasRequiredReactSwipe;function requireReactSwipe(){return hasRequiredReactSwipe||(hasRequiredReactSwipe=1,(function(yt){(function(Et,xt){xt(yt,requireReact(),requirePropTypes())})(reactSwipe,function(Et,xt,vt){Object.defineProperty(Et,"__esModule",{value:!0}),Et.setHasSupportToCaptureOption=kt;var bt=Ft(xt),At=Ft(vt);function Ft(Nt){return Nt&&Nt.__esModule?Nt:{default:Nt}}var Ct=Object.assign||function(Nt){for(var Ut=1;Ut<arguments.length;Ut++){var jt=arguments[Ut];for(var Vt in jt)Object.prototype.hasOwnProperty.call(jt,Vt)&&(Nt[Vt]=jt[Vt])}return Nt};function wt(Nt,Ut){var jt={};for(var Vt in Nt)Ut.indexOf(Vt)>=0||Object.prototype.hasOwnProperty.call(Nt,Vt)&&(jt[Vt]=Nt[Vt]);return jt}function St(Nt,Ut){if(!(Nt instanceof Ut))throw new TypeError("Cannot call a class as a function")}var Tt=(function(){function Nt(Ut,jt){for(var Vt=0;Vt<jt.length;Vt++){var zt=jt[Vt];zt.enumerable=zt.enumerable||!1,zt.configurable=!0,"value"in zt&&(zt.writable=!0),Object.defineProperty(Ut,zt.key,zt)}}return function(Ut,jt,Vt){return jt&&Nt(Ut.prototype,jt),Vt&&Nt(Ut,Vt),Ut}})();function Rt(Nt,Ut){if(!Nt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ut&&(typeof Ut=="object"||typeof Ut=="function")?Ut:Nt}function Pt(Nt,Ut){if(typeof Ut!="function"&&Ut!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Ut);Nt.prototype=Object.create(Ut&&Ut.prototype,{constructor:{value:Nt,enumerable:!1,writable:!0,configurable:!0}}),Ut&&(Object.setPrototypeOf?Object.setPrototypeOf(Nt,Ut):Nt.__proto__=Ut)}var Lt=!1;function kt(Nt){Lt=Nt}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){kt(!0)}}))}catch{}function Ot(){var Nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return Lt?Nt:Nt.capture}function Mt(Nt){if("touches"in Nt){var Ut=Nt.touches[0],jt=Ut.pageX,Vt=Ut.pageY;return{x:jt,y:Vt}}var zt=Nt.screenX,Ht=Nt.screenY;return{x:zt,y:Ht}}var It=(function(Nt){Pt(Ut,Nt);function Ut(){var jt;St(this,Ut);for(var Vt=arguments.length,zt=Array(Vt),Ht=0;Ht<Vt;Ht++)zt[Ht]=arguments[Ht];var Wt=Rt(this,(jt=Ut.__proto__||Object.getPrototypeOf(Ut)).call.apply(jt,[this].concat(zt)));return Wt._handleSwipeStart=Wt._handleSwipeStart.bind(Wt),Wt._handleSwipeMove=Wt._handleSwipeMove.bind(Wt),Wt._handleSwipeEnd=Wt._handleSwipeEnd.bind(Wt),Wt._onMouseDown=Wt._onMouseDown.bind(Wt),Wt._onMouseMove=Wt._onMouseMove.bind(Wt),Wt._onMouseUp=Wt._onMouseUp.bind(Wt),Wt._setSwiperRef=Wt._setSwiperRef.bind(Wt),Wt}return Tt(Ut,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,Ot({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,Ot({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(Vt){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(Vt))}},{key:"_onMouseMove",value:function(Vt){this.mouseDown&&this._handleSwipeMove(Vt)}},{key:"_onMouseUp",value:function(Vt){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(Vt)}},{key:"_handleSwipeStart",value:function(Vt){var zt=Mt(Vt),Ht=zt.x,Wt=zt.y;this.moveStart={x:Ht,y:Wt},this.props.onSwipeStart(Vt)}},{key:"_handleSwipeMove",value:function(Vt){if(this.moveStart){var zt=Mt(Vt),Ht=zt.x,Wt=zt.y,Gt=Ht-this.moveStart.x,qt=Wt-this.moveStart.y;this.moving=!0;var Xt=this.props.onSwipeMove({x:Gt,y:qt},Vt);Xt&&Vt.cancelable&&Vt.preventDefault(),this.movePosition={deltaX:Gt,deltaY:qt}}}},{key:"_handleSwipeEnd",value:function(Vt){this.props.onSwipeEnd(Vt);var zt=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-zt?this.props.onSwipeLeft(1,Vt):this.movePosition.deltaX>zt&&this.props.onSwipeRight(1,Vt),this.movePosition.deltaY<-zt?this.props.onSwipeUp(1,Vt):this.movePosition.deltaY>zt&&this.props.onSwipeDown(1,Vt)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(Vt){this.swiper=Vt,this.props.innerRef(Vt)}},{key:"render",value:function(){var Vt=this.props;Vt.tagName;var zt=Vt.className,Ht=Vt.style,Wt=Vt.children;Vt.allowMouseEvents,Vt.onSwipeUp,Vt.onSwipeDown,Vt.onSwipeLeft,Vt.onSwipeRight,Vt.onSwipeStart,Vt.onSwipeMove,Vt.onSwipeEnd,Vt.innerRef,Vt.tolerance;var Gt=wt(Vt,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return bt.default.createElement(this.props.tagName,Ct({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:zt,style:Ht},Gt),Wt)}}]),Ut})(xt.Component);It.displayName="ReactSwipe",It.propTypes={tagName:At.default.string,className:At.default.string,style:At.default.object,children:At.default.node,allowMouseEvents:At.default.bool,onSwipeUp:At.default.func,onSwipeDown:At.default.func,onSwipeLeft:At.default.func,onSwipeRight:At.default.func,onSwipeStart:At.default.func,onSwipeMove:At.default.func,onSwipeEnd:At.default.func,innerRef:At.default.func,tolerance:At.default.number.isRequired},It.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},Et.default=It})})(reactSwipe)),reactSwipe}var hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,(function(yt){(function(Et,xt){xt(yt,requireReactSwipe())})(lib,function(Et,xt){Object.defineProperty(Et,"__esModule",{value:!0});var vt=bt(xt);function bt(At){return At&&At.__esModule?At:{default:At}}Et.default=vt.default})})(lib)),lib}var cssClasses={},classnames={exports:{}};var hasRequiredClassnames;function requireClassnames(){return hasRequiredClassnames||(hasRequiredClassnames=1,(function(yt){(function(){var Et={}.hasOwnProperty;function xt(){for(var At="",Ft=0;Ft<arguments.length;Ft++){var Ct=arguments[Ft];Ct&&(At=bt(At,vt(Ct)))}return At}function vt(At){if(typeof At=="string"||typeof At=="number")return At;if(typeof At!="object")return"";if(Array.isArray(At))return xt.apply(null,At);if(At.toString!==Object.prototype.toString&&!At.toString.toString().includes("[native code]"))return At.toString();var Ft="";for(var Ct in At)Et.call(At,Ct)&&At[Ct]&&(Ft=bt(Ft,Ct));return Ft}function bt(At,Ft){return Ft?At?At+" "+Ft:At+Ft:At}yt.exports?(xt.default=xt,yt.exports=xt):window.classNames=xt})()})(classnames)),classnames.exports}var hasRequiredCssClasses;function requireCssClasses(){if(hasRequiredCssClasses)return cssClasses;hasRequiredCssClasses=1,Object.defineProperty(cssClasses,"__esModule",{value:!0}),cssClasses.default=void 0;var yt=Et(requireClassnames());function Et(bt){return bt&&bt.__esModule?bt:{default:bt}}function xt(bt,At,Ft){return At in bt?Object.defineProperty(bt,At,{value:Ft,enumerable:!0,configurable:!0,writable:!0}):bt[At]=Ft,bt}var vt={ROOT:function(At){return(0,yt.default)(xt({"carousel-root":!0},At||"",!!At))},CAROUSEL:function(At){return(0,yt.default)({carousel:!0,"carousel-slider":At})},WRAPPER:function(At,Ft){return(0,yt.default)({"thumbs-wrapper":!At,"slider-wrapper":At,"axis-horizontal":Ft==="horizontal","axis-vertical":Ft!=="horizontal"})},SLIDER:function(At,Ft){return(0,yt.default)({thumbs:!At,slider:At,animated:!Ft})},ITEM:function(At,Ft,Ct){return(0,yt.default)({thumb:!At,slide:At,selected:Ft,previous:Ct})},ARROW_PREV:function(At){return(0,yt.default)({"control-arrow control-prev":!0,"control-disabled":At})},ARROW_NEXT:function(At){return(0,yt.default)({"control-arrow control-next":!0,"control-disabled":At})},DOT:function(At){return(0,yt.default)({dot:!0,selected:At})}};return cssClasses.default=vt,cssClasses}var Thumbs={},dimensions={},hasRequiredDimensions;function requireDimensions(){if(hasRequiredDimensions)return dimensions;hasRequiredDimensions=1,Object.defineProperty(dimensions,"__esModule",{value:!0}),dimensions.outerWidth=void 0;var yt=function(xt){var vt=xt.offsetWidth,bt=getComputedStyle(xt);return vt+=parseInt(bt.marginLeft)+parseInt(bt.marginRight),vt};return dimensions.outerWidth=yt,dimensions}var CSSTranslate={},hasRequiredCSSTranslate;function requireCSSTranslate(){if(hasRequiredCSSTranslate)return CSSTranslate;hasRequiredCSSTranslate=1,Object.defineProperty(CSSTranslate,"__esModule",{value:!0}),CSSTranslate.default=void 0;var yt=function(xt,vt,bt){var At=xt===0?xt:xt+vt,Ft=bt==="horizontal"?[At,0,0]:[0,At,0],Ct="translate3d",wt="("+Ft.join(",")+")";return Ct+wt};return CSSTranslate.default=yt,CSSTranslate}var window$1={},hasRequiredWindow;function requireWindow(){if(hasRequiredWindow)return window$1;hasRequiredWindow=1,Object.defineProperty(window$1,"__esModule",{value:!0}),window$1.default=void 0;var yt=function(){return window};return window$1.default=yt,window$1}var hasRequiredThumbs;function requireThumbs(){if(hasRequiredThumbs)return Thumbs;hasRequiredThumbs=1,Object.defineProperty(Thumbs,"__esModule",{value:!0}),Thumbs.default=void 0;var yt=wt(requireReact()),Et=Ft(requireCssClasses()),xt=requireDimensions(),vt=Ft(requireCSSTranslate()),bt=Ft(requireLib()),At=Ft(requireWindow());function Ft(Wt){return Wt&&Wt.__esModule?Wt:{default:Wt}}function Ct(){if(typeof WeakMap!="function")return null;var Wt=new WeakMap;return Ct=function(){return Wt},Wt}function wt(Wt){if(Wt&&Wt.__esModule)return Wt;if(Wt===null||St(Wt)!=="object"&&typeof Wt!="function")return{default:Wt};var Gt=Ct();if(Gt&&Gt.has(Wt))return Gt.get(Wt);var qt={},Xt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Kt in Wt)if(Object.prototype.hasOwnProperty.call(Wt,Kt)){var Jt=Xt?Object.getOwnPropertyDescriptor(Wt,Kt):null;Jt&&(Jt.get||Jt.set)?Object.defineProperty(qt,Kt,Jt):qt[Kt]=Wt[Kt]}return qt.default=Wt,Gt&&Gt.set(Wt,qt),qt}function St(Wt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?St=function(qt){return typeof qt}:St=function(qt){return qt&&typeof Symbol=="function"&&qt.constructor===Symbol&&qt!==Symbol.prototype?"symbol":typeof qt},St(Wt)}function Tt(){return Tt=Object.assign||function(Wt){for(var Gt=1;Gt<arguments.length;Gt++){var qt=arguments[Gt];for(var Xt in qt)Object.prototype.hasOwnProperty.call(qt,Xt)&&(Wt[Xt]=qt[Xt])}return Wt},Tt.apply(this,arguments)}function Rt(Wt,Gt){if(!(Wt instanceof Gt))throw new TypeError("Cannot call a class as a function")}function Pt(Wt,Gt){for(var qt=0;qt<Gt.length;qt++){var Xt=Gt[qt];Xt.enumerable=Xt.enumerable||!1,Xt.configurable=!0,"value"in Xt&&(Xt.writable=!0),Object.defineProperty(Wt,Xt.key,Xt)}}function Lt(Wt,Gt,qt){return Gt&&Pt(Wt.prototype,Gt),Wt}function kt(Wt,Gt){if(typeof Gt!="function"&&Gt!==null)throw new TypeError("Super expression must either be null or a function");Wt.prototype=Object.create(Gt&&Gt.prototype,{constructor:{value:Wt,writable:!0,configurable:!0}}),Gt&&Ot(Wt,Gt)}function Ot(Wt,Gt){return Ot=Object.setPrototypeOf||function(Xt,Kt){return Xt.__proto__=Kt,Xt},Ot(Wt,Gt)}function Mt(Wt){var Gt=Ut();return function(){var Xt=jt(Wt),Kt;if(Gt){var Jt=jt(this).constructor;Kt=Reflect.construct(Xt,arguments,Jt)}else Kt=Xt.apply(this,arguments);return It(this,Kt)}}function It(Wt,Gt){return Gt&&(St(Gt)==="object"||typeof Gt=="function")?Gt:Nt(Wt)}function Nt(Wt){if(Wt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Wt}function Ut(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function jt(Wt){return jt=Object.setPrototypeOf?Object.getPrototypeOf:function(qt){return qt.__proto__||Object.getPrototypeOf(qt)},jt(Wt)}function Vt(Wt,Gt,qt){return Gt in Wt?Object.defineProperty(Wt,Gt,{value:qt,enumerable:!0,configurable:!0,writable:!0}):Wt[Gt]=qt,Wt}var zt=function(Gt){return Gt.hasOwnProperty("key")},Ht=(function(Wt){kt(qt,Wt);var Gt=Mt(qt);function qt(Xt){var Kt;return Rt(this,qt),Kt=Gt.call(this,Xt),Vt(Nt(Kt),"itemsWrapperRef",void 0),Vt(Nt(Kt),"itemsListRef",void 0),Vt(Nt(Kt),"thumbsRef",void 0),Vt(Nt(Kt),"setItemsWrapperRef",function(Jt){Kt.itemsWrapperRef=Jt}),Vt(Nt(Kt),"setItemsListRef",function(Jt){Kt.itemsListRef=Jt}),Vt(Nt(Kt),"setThumbsRef",function(Jt,tn){Kt.thumbsRef||(Kt.thumbsRef=[]),Kt.thumbsRef[tn]=Jt}),Vt(Nt(Kt),"updateSizes",function(){if(!(!Kt.props.children||!Kt.itemsWrapperRef||!Kt.thumbsRef)){var Jt=yt.Children.count(Kt.props.children),tn=Kt.itemsWrapperRef.clientWidth,sn=Kt.props.thumbWidth?Kt.props.thumbWidth:(0,xt.outerWidth)(Kt.thumbsRef[0]),Zt=Math.floor(tn/sn),nn=Zt<Jt,rn=nn?Jt-Zt:0;Kt.setState(function(on,ln){return{itemSize:sn,visibleItems:Zt,firstItem:nn?Kt.getFirstItem(ln.selectedItem):0,lastPosition:rn,showArrows:nn}})}}),Vt(Nt(Kt),"handleClickItem",function(Jt,tn,sn){if(!zt(sn)||sn.key==="Enter"){var Zt=Kt.props.onSelectItem;typeof Zt=="function"&&Zt(Jt,tn)}}),Vt(Nt(Kt),"onSwipeStart",function(){Kt.setState({swiping:!0})}),Vt(Nt(Kt),"onSwipeEnd",function(){Kt.setState({swiping:!1})}),Vt(Nt(Kt),"onSwipeMove",function(Jt){var tn=Jt.x;if(!Kt.state.itemSize||!Kt.itemsWrapperRef||!Kt.state.visibleItems)return!1;var sn=0,Zt=yt.Children.count(Kt.props.children),nn=-(Kt.state.firstItem*100)/Kt.state.visibleItems,rn=Math.max(Zt-Kt.state.visibleItems,0),on=-rn*100/Kt.state.visibleItems;nn===sn&&tn>0&&(tn=0),nn===on&&tn<0&&(tn=0);var ln=Kt.itemsWrapperRef.clientWidth,Qt=nn+100/(ln/tn);return Kt.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(fn){Kt.itemsListRef.style[fn]=(0,vt.default)(Qt,"%",Kt.props.axis)}),!0}),Vt(Nt(Kt),"slideRight",function(Jt){Kt.moveTo(Kt.state.firstItem-(typeof Jt=="number"?Jt:1))}),Vt(Nt(Kt),"slideLeft",function(Jt){Kt.moveTo(Kt.state.firstItem+(typeof Jt=="number"?Jt:1))}),Vt(Nt(Kt),"moveTo",function(Jt){Jt=Jt<0?0:Jt,Jt=Jt>=Kt.state.lastPosition?Kt.state.lastPosition:Jt,Kt.setState({firstItem:Jt})}),Kt.state={selectedItem:Xt.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},Kt}return Lt(qt,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(Kt){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==Kt.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,At.default)().addEventListener("resize",this.updateSizes),(0,At.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,At.default)().removeEventListener("resize",this.updateSizes),(0,At.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(Kt){var Jt=Kt;return Kt>=this.state.lastPosition&&(Jt=this.state.lastPosition),Kt<this.state.firstItem+this.state.visibleItems&&(Jt=this.state.firstItem),Kt<this.state.firstItem&&(Jt=Kt),Jt}},{key:"renderItems",value:function(){var Kt=this;return this.props.children.map(function(Jt,tn){var sn=Et.default.ITEM(!1,tn===Kt.state.selectedItem),Zt={key:tn,ref:function(rn){return Kt.setThumbsRef(rn,tn)},className:sn,onClick:Kt.handleClickItem.bind(Kt,tn,Kt.props.children[tn]),onKeyDown:Kt.handleClickItem.bind(Kt,tn,Kt.props.children[tn]),"aria-label":"".concat(Kt.props.labels.item," ").concat(tn+1),style:{width:Kt.props.thumbWidth}};return yt.default.createElement("li",Tt({},Zt,{role:"button",tabIndex:0}),Jt)})}},{key:"render",value:function(){var Kt=this;if(!this.props.children)return null;var Jt=yt.Children.count(this.props.children)>1,tn=this.state.showArrows&&this.state.firstItem>0,sn=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,Zt={},nn=-this.state.firstItem*(this.state.itemSize||0),rn=(0,vt.default)(nn,"px",this.props.axis),on=this.props.transitionTime+"ms";return Zt={WebkitTransform:rn,MozTransform:rn,MsTransform:rn,OTransform:rn,transform:rn,msTransform:rn,WebkitTransitionDuration:on,MozTransitionDuration:on,MsTransitionDuration:on,OTransitionDuration:on,transitionDuration:on,msTransitionDuration:on},yt.default.createElement("div",{className:Et.default.CAROUSEL(!1)},yt.default.createElement("div",{className:Et.default.WRAPPER(!1),ref:this.setItemsWrapperRef},yt.default.createElement("button",{type:"button",className:Et.default.ARROW_PREV(!tn),onClick:function(){return Kt.slideRight()},"aria-label":this.props.labels.leftArrow}),Jt?yt.default.createElement(bt.default,{tagName:"ul",className:Et.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:Zt,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):yt.default.createElement("ul",{className:Et.default.SLIDER(!1,this.state.swiping),ref:function(Qt){return Kt.setItemsListRef(Qt)},style:Zt},this.renderItems()),yt.default.createElement("button",{type:"button",className:Et.default.ARROW_NEXT(!sn),onClick:function(){return Kt.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),qt})(yt.Component);return Thumbs.default=Ht,Vt(Ht,"displayName","Thumbs"),Vt(Ht,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Thumbs}var document$1={},hasRequiredDocument;function requireDocument(){if(hasRequiredDocument)return document$1;hasRequiredDocument=1,Object.defineProperty(document$1,"__esModule",{value:!0}),document$1.default=void 0;var yt=function(){return document};return document$1.default=yt,document$1}var utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1,Object.defineProperty(utils,"__esModule",{value:!0}),utils.setPosition=utils.getPosition=utils.isKeyboardEvent=utils.defaultStatusFormatter=utils.noop=void 0;var yt=requireReact(),Et=xt(requireCSSTranslate());function xt(wt){return wt&&wt.__esModule?wt:{default:wt}}var vt=function(){};utils.noop=vt;var bt=function(St,Tt){return"".concat(St," of ").concat(Tt)};utils.defaultStatusFormatter=bt;var At=function(St){return St?St.hasOwnProperty("key"):!1};utils.isKeyboardEvent=At;var Ft=function(St,Tt){if(Tt.infiniteLoop&&++St,St===0)return 0;var Rt=yt.Children.count(Tt.children);if(Tt.centerMode&&Tt.axis==="horizontal"){var Pt=-St*Tt.centerSlidePercentage,Lt=Rt-1;return St&&(St!==Lt||Tt.infiniteLoop)?Pt+=(100-Tt.centerSlidePercentage)/2:St===Lt&&(Pt+=100-Tt.centerSlidePercentage),Pt}return-St*100};utils.getPosition=Ft;var Ct=function(St,Tt){var Rt={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(Pt){Rt[Pt]=(0,Et.default)(St,"%",Tt)}),Rt};return utils.setPosition=Ct,utils}var animations={},hasRequiredAnimations;function requireAnimations(){if(hasRequiredAnimations)return animations;hasRequiredAnimations=1,Object.defineProperty(animations,"__esModule",{value:!0}),animations.fadeAnimationHandler=animations.slideStopSwipingHandler=animations.slideSwipeAnimationHandler=animations.slideAnimationHandler=void 0;var yt=requireReact(),Et=vt(requireCSSTranslate()),xt=requireUtils();function vt(Rt){return Rt&&Rt.__esModule?Rt:{default:Rt}}function bt(Rt,Pt){var Lt=Object.keys(Rt);if(Object.getOwnPropertySymbols){var kt=Object.getOwnPropertySymbols(Rt);Pt&&(kt=kt.filter(function(Ot){return Object.getOwnPropertyDescriptor(Rt,Ot).enumerable})),Lt.push.apply(Lt,kt)}return Lt}function At(Rt){for(var Pt=1;Pt<arguments.length;Pt++){var Lt=arguments[Pt]!=null?arguments[Pt]:{};Pt%2?bt(Object(Lt),!0).forEach(function(kt){Ft(Rt,kt,Lt[kt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Rt,Object.getOwnPropertyDescriptors(Lt)):bt(Object(Lt)).forEach(function(kt){Object.defineProperty(Rt,kt,Object.getOwnPropertyDescriptor(Lt,kt))})}return Rt}function Ft(Rt,Pt,Lt){return Pt in Rt?Object.defineProperty(Rt,Pt,{value:Lt,enumerable:!0,configurable:!0,writable:!0}):Rt[Pt]=Lt,Rt}var Ct=function(Pt,Lt){var kt={},Ot=Lt.selectedItem,Mt=Ot,It=yt.Children.count(Pt.children)-1,Nt=Pt.infiniteLoop&&(Ot<0||Ot>It);if(Nt)return Mt<0?Pt.centerMode&&Pt.centerSlidePercentage&&Pt.axis==="horizontal"?kt.itemListStyle=(0,xt.setPosition)(-(It+2)*Pt.centerSlidePercentage-(100-Pt.centerSlidePercentage)/2,Pt.axis):kt.itemListStyle=(0,xt.setPosition)(-(It+2)*100,Pt.axis):Mt>It&&(kt.itemListStyle=(0,xt.setPosition)(0,Pt.axis)),kt;var Ut=(0,xt.getPosition)(Ot,Pt),jt=(0,Et.default)(Ut,"%",Pt.axis),Vt=Pt.transitionTime+"ms";return kt.itemListStyle={WebkitTransform:jt,msTransform:jt,OTransform:jt,transform:jt},Lt.swiping||(kt.itemListStyle=At(At({},kt.itemListStyle),{},{WebkitTransitionDuration:Vt,MozTransitionDuration:Vt,OTransitionDuration:Vt,transitionDuration:Vt,msTransitionDuration:Vt})),kt};animations.slideAnimationHandler=Ct;var wt=function(Pt,Lt,kt,Ot){var Mt={},It=Lt.axis==="horizontal",Nt=yt.Children.count(Lt.children),Ut=0,jt=(0,xt.getPosition)(kt.selectedItem,Lt),Vt=Lt.infiniteLoop?(0,xt.getPosition)(Nt-1,Lt)-100:(0,xt.getPosition)(Nt-1,Lt),zt=It?Pt.x:Pt.y,Ht=zt;jt===Ut&&zt>0&&(Ht=0),jt===Vt&&zt<0&&(Ht=0);var Wt=jt+100/(kt.itemSize/Ht),Gt=Math.abs(zt)>Lt.swipeScrollTolerance;return Lt.infiniteLoop&&Gt&&(kt.selectedItem===0&&Wt>-100?Wt-=Nt*100:kt.selectedItem===Nt-1&&Wt<-Nt*100&&(Wt+=Nt*100)),(!Lt.preventMovementUntilSwipeScrollTolerance||Gt||kt.swipeMovementStarted)&&(kt.swipeMovementStarted||Ot({swipeMovementStarted:!0}),Mt.itemListStyle=(0,xt.setPosition)(Wt,Lt.axis)),Gt&&!kt.cancelClick&&Ot({cancelClick:!0}),Mt};animations.slideSwipeAnimationHandler=wt;var St=function(Pt,Lt){var kt=(0,xt.getPosition)(Lt.selectedItem,Pt),Ot=(0,xt.setPosition)(kt,Pt.axis);return{itemListStyle:Ot}};animations.slideStopSwipingHandler=St;var Tt=function(Pt,Lt){var kt=Pt.transitionTime+"ms",Ot="ease-in-out",Mt={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:Ot,msTransitionTimingFunction:Ot,MozTransitionTimingFunction:Ot,WebkitTransitionTimingFunction:Ot,OTransitionTimingFunction:Ot};return Lt.swiping||(Mt=At(At({},Mt),{},{WebkitTransitionDuration:kt,MozTransitionDuration:kt,OTransitionDuration:kt,transitionDuration:kt,msTransitionDuration:kt})),{slideStyle:Mt,selectedStyle:At(At({},Mt),{},{opacity:1,position:"relative"}),prevStyle:At({},Mt)}};return animations.fadeAnimationHandler=Tt,animations}var hasRequiredCarousel;function requireCarousel(){if(hasRequiredCarousel)return Carousel;hasRequiredCarousel=1,Object.defineProperty(Carousel,"__esModule",{value:!0}),Carousel.default=void 0;var yt=Tt(requireReact()),Et=wt(requireLib()),xt=wt(requireCssClasses()),vt=wt(requireThumbs()),bt=wt(requireDocument()),At=wt(requireWindow()),Ft=requireUtils(),Ct=requireAnimations();function wt(Xt){return Xt&&Xt.__esModule?Xt:{default:Xt}}function St(){if(typeof WeakMap!="function")return null;var Xt=new WeakMap;return St=function(){return Xt},Xt}function Tt(Xt){if(Xt&&Xt.__esModule)return Xt;if(Xt===null||Rt(Xt)!=="object"&&typeof Xt!="function")return{default:Xt};var Kt=St();if(Kt&&Kt.has(Xt))return Kt.get(Xt);var Jt={},tn=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var sn in Xt)if(Object.prototype.hasOwnProperty.call(Xt,sn)){var Zt=tn?Object.getOwnPropertyDescriptor(Xt,sn):null;Zt&&(Zt.get||Zt.set)?Object.defineProperty(Jt,sn,Zt):Jt[sn]=Xt[sn]}return Jt.default=Xt,Kt&&Kt.set(Xt,Jt),Jt}function Rt(Xt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rt=function(Jt){return typeof Jt}:Rt=function(Jt){return Jt&&typeof Symbol=="function"&&Jt.constructor===Symbol&&Jt!==Symbol.prototype?"symbol":typeof Jt},Rt(Xt)}function Pt(){return Pt=Object.assign||function(Xt){for(var Kt=1;Kt<arguments.length;Kt++){var Jt=arguments[Kt];for(var tn in Jt)Object.prototype.hasOwnProperty.call(Jt,tn)&&(Xt[tn]=Jt[tn])}return Xt},Pt.apply(this,arguments)}function Lt(Xt,Kt){var Jt=Object.keys(Xt);if(Object.getOwnPropertySymbols){var tn=Object.getOwnPropertySymbols(Xt);Kt&&(tn=tn.filter(function(sn){return Object.getOwnPropertyDescriptor(Xt,sn).enumerable})),Jt.push.apply(Jt,tn)}return Jt}function kt(Xt){for(var Kt=1;Kt<arguments.length;Kt++){var Jt=arguments[Kt]!=null?arguments[Kt]:{};Kt%2?Lt(Object(Jt),!0).forEach(function(tn){Gt(Xt,tn,Jt[tn])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Xt,Object.getOwnPropertyDescriptors(Jt)):Lt(Object(Jt)).forEach(function(tn){Object.defineProperty(Xt,tn,Object.getOwnPropertyDescriptor(Jt,tn))})}return Xt}function Ot(Xt,Kt){if(!(Xt instanceof Kt))throw new TypeError("Cannot call a class as a function")}function Mt(Xt,Kt){for(var Jt=0;Jt<Kt.length;Jt++){var tn=Kt[Jt];tn.enumerable=tn.enumerable||!1,tn.configurable=!0,"value"in tn&&(tn.writable=!0),Object.defineProperty(Xt,tn.key,tn)}}function It(Xt,Kt,Jt){return Kt&&Mt(Xt.prototype,Kt),Xt}function Nt(Xt,Kt){if(typeof Kt!="function"&&Kt!==null)throw new TypeError("Super expression must either be null or a function");Xt.prototype=Object.create(Kt&&Kt.prototype,{constructor:{value:Xt,writable:!0,configurable:!0}}),Kt&&Ut(Xt,Kt)}function Ut(Xt,Kt){return Ut=Object.setPrototypeOf||function(tn,sn){return tn.__proto__=sn,tn},Ut(Xt,Kt)}function jt(Xt){var Kt=Ht();return function(){var tn=Wt(Xt),sn;if(Kt){var Zt=Wt(this).constructor;sn=Reflect.construct(tn,arguments,Zt)}else sn=tn.apply(this,arguments);return Vt(this,sn)}}function Vt(Xt,Kt){return Kt&&(Rt(Kt)==="object"||typeof Kt=="function")?Kt:zt(Xt)}function zt(Xt){if(Xt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Xt}function Ht(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Wt(Xt){return Wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Jt){return Jt.__proto__||Object.getPrototypeOf(Jt)},Wt(Xt)}function Gt(Xt,Kt,Jt){return Kt in Xt?Object.defineProperty(Xt,Kt,{value:Jt,enumerable:!0,configurable:!0,writable:!0}):Xt[Kt]=Jt,Xt}var qt=(function(Xt){Nt(Jt,Xt);var Kt=jt(Jt);function Jt(tn){var sn;Ot(this,Jt),sn=Kt.call(this,tn),Gt(zt(sn),"thumbsRef",void 0),Gt(zt(sn),"carouselWrapperRef",void 0),Gt(zt(sn),"listRef",void 0),Gt(zt(sn),"itemsRef",void 0),Gt(zt(sn),"timer",void 0),Gt(zt(sn),"animationHandler",void 0),Gt(zt(sn),"setThumbsRef",function(nn){sn.thumbsRef=nn}),Gt(zt(sn),"setCarouselWrapperRef",function(nn){sn.carouselWrapperRef=nn}),Gt(zt(sn),"setListRef",function(nn){sn.listRef=nn}),Gt(zt(sn),"setItemsRef",function(nn,rn){sn.itemsRef||(sn.itemsRef=[]),sn.itemsRef[rn]=nn}),Gt(zt(sn),"autoPlay",function(){yt.Children.count(sn.props.children)<=1||(sn.clearAutoPlay(),sn.props.autoPlay&&(sn.timer=setTimeout(function(){sn.increment()},sn.props.interval)))}),Gt(zt(sn),"clearAutoPlay",function(){sn.timer&&clearTimeout(sn.timer)}),Gt(zt(sn),"resetAutoPlay",function(){sn.clearAutoPlay(),sn.autoPlay()}),Gt(zt(sn),"stopOnHover",function(){sn.setState({isMouseEntered:!0},sn.clearAutoPlay)}),Gt(zt(sn),"startOnLeave",function(){sn.setState({isMouseEntered:!1},sn.autoPlay)}),Gt(zt(sn),"isFocusWithinTheCarousel",function(){return sn.carouselWrapperRef?!!((0,bt.default)().activeElement===sn.carouselWrapperRef||sn.carouselWrapperRef.contains((0,bt.default)().activeElement)):!1}),Gt(zt(sn),"navigateWithKeyboard",function(nn){if(sn.isFocusWithinTheCarousel()){var rn=sn.props.axis,on=rn==="horizontal",ln={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},Qt=on?ln.ArrowRight:ln.ArrowDown,fn=on?ln.ArrowLeft:ln.ArrowUp;Qt===nn.keyCode?sn.increment():fn===nn.keyCode&&sn.decrement()}}),Gt(zt(sn),"updateSizes",function(){if(!(!sn.state.initialized||!sn.itemsRef||sn.itemsRef.length===0)){var nn=sn.props.axis==="horizontal",rn=sn.itemsRef[0];if(rn){var on=nn?rn.clientWidth:rn.clientHeight;sn.setState({itemSize:on}),sn.thumbsRef&&sn.thumbsRef.updateSizes()}}}),Gt(zt(sn),"setMountState",function(){sn.setState({hasMount:!0}),sn.updateSizes()}),Gt(zt(sn),"handleClickItem",function(nn,rn){if(yt.Children.count(sn.props.children)!==0){if(sn.state.cancelClick){sn.setState({cancelClick:!1});return}sn.props.onClickItem(nn,rn),nn!==sn.state.selectedItem&&sn.setState({selectedItem:nn})}}),Gt(zt(sn),"handleOnChange",function(nn,rn){yt.Children.count(sn.props.children)<=1||sn.props.onChange(nn,rn)}),Gt(zt(sn),"handleClickThumb",function(nn,rn){sn.props.onClickThumb(nn,rn),sn.moveTo(nn)}),Gt(zt(sn),"onSwipeStart",function(nn){sn.setState({swiping:!0}),sn.props.onSwipeStart(nn)}),Gt(zt(sn),"onSwipeEnd",function(nn){sn.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),sn.props.onSwipeEnd(nn),sn.clearAutoPlay(),sn.state.autoPlay&&sn.autoPlay()}),Gt(zt(sn),"onSwipeMove",function(nn,rn){sn.props.onSwipeMove(rn);var on=sn.props.swipeAnimationHandler(nn,sn.props,sn.state,sn.setState.bind(zt(sn)));return sn.setState(kt({},on)),!!Object.keys(on).length}),Gt(zt(sn),"decrement",function(){var nn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;sn.moveTo(sn.state.selectedItem-(typeof nn=="number"?nn:1))}),Gt(zt(sn),"increment",function(){var nn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;sn.moveTo(sn.state.selectedItem+(typeof nn=="number"?nn:1))}),Gt(zt(sn),"moveTo",function(nn){if(typeof nn=="number"){var rn=yt.Children.count(sn.props.children)-1;nn<0&&(nn=sn.props.infiniteLoop?rn:0),nn>rn&&(nn=sn.props.infiniteLoop?0:rn),sn.selectItem({selectedItem:nn}),sn.state.autoPlay&&sn.state.isMouseEntered===!1&&sn.resetAutoPlay()}}),Gt(zt(sn),"onClickNext",function(){sn.increment(1)}),Gt(zt(sn),"onClickPrev",function(){sn.decrement(1)}),Gt(zt(sn),"onSwipeForward",function(){sn.increment(1),sn.props.emulateTouch&&sn.setState({cancelClick:!0})}),Gt(zt(sn),"onSwipeBackwards",function(){sn.decrement(1),sn.props.emulateTouch&&sn.setState({cancelClick:!0})}),Gt(zt(sn),"changeItem",function(nn){return function(rn){(!(0,Ft.isKeyboardEvent)(rn)||rn.key==="Enter")&&sn.moveTo(nn)}}),Gt(zt(sn),"selectItem",function(nn){sn.setState(kt({previousItem:sn.state.selectedItem},nn),function(){sn.setState(sn.animationHandler(sn.props,sn.state))}),sn.handleOnChange(nn.selectedItem,yt.Children.toArray(sn.props.children)[nn.selectedItem])}),Gt(zt(sn),"getInitialImage",function(){var nn=sn.props.selectedItem,rn=sn.itemsRef&&sn.itemsRef[nn],on=rn&&rn.getElementsByTagName("img")||[];return on[0]}),Gt(zt(sn),"getVariableItemHeight",function(nn){var rn=sn.itemsRef&&sn.itemsRef[nn];if(sn.state.hasMount&&rn&&rn.children.length){var on=rn.children[0].getElementsByTagName("img")||[];if(on.length>0){var ln=on[0];if(!ln.complete){var Qt=function mn(){sn.forceUpdate(),ln.removeEventListener("load",mn)};ln.addEventListener("load",Qt)}}var fn=on[0]||rn.children[0],pn=fn.clientHeight;return pn>0?pn:null}return null});var Zt={initialized:!1,previousItem:tn.selectedItem,selectedItem:tn.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:tn.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return sn.animationHandler=typeof tn.animationHandler=="function"&&tn.animationHandler||tn.animationHandler==="fade"&&Ct.fadeAnimationHandler||Ct.slideAnimationHandler,sn.state=kt(kt({},Zt),sn.animationHandler(tn,Zt)),sn}return It(Jt,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(sn,Zt){!sn.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!sn.autoFocus&&this.props.autoFocus&&this.forceFocus(),Zt.swiping&&!this.state.swiping&&this.setState(kt({},this.props.stopSwipingHandler(this.props,this.state))),(sn.selectedItem!==this.props.selectedItem||sn.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),sn.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var sn=this;this.bindEvents(),this.state.autoPlay&&yt.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var Zt=sn.getInitialImage();Zt&&!Zt.complete?Zt.addEventListener("load",sn.setMountState):sn.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var sn=this.carouselWrapperRef;this.props.stopOnHover&&sn&&(sn.addEventListener("mouseenter",this.stopOnHover),sn.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var sn=this.carouselWrapperRef;this.props.stopOnHover&&sn&&(sn.removeEventListener("mouseenter",this.stopOnHover),sn.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,At.default)().addEventListener("resize",this.updateSizes),(0,At.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,bt.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,At.default)().removeEventListener("resize",this.updateSizes),(0,At.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var sn=this.getInitialImage();sn&&sn.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,bt.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var sn;(sn=this.carouselWrapperRef)===null||sn===void 0||sn.focus()}},{key:"renderItems",value:function(sn){var Zt=this;return this.props.children?yt.Children.map(this.props.children,function(nn,rn){var on=rn===Zt.state.selectedItem,ln=rn===Zt.state.previousItem,Qt=on&&Zt.state.selectedStyle||ln&&Zt.state.prevStyle||Zt.state.slideStyle||{};Zt.props.centerMode&&Zt.props.axis==="horizontal"&&(Qt=kt(kt({},Qt),{},{minWidth:Zt.props.centerSlidePercentage+"%"})),Zt.state.swiping&&Zt.state.swipeMovementStarted&&(Qt=kt(kt({},Qt),{},{pointerEvents:"none"}));var fn={ref:function(mn){return Zt.setItemsRef(mn,rn)},key:"itemKey"+rn+(sn?"clone":""),className:xt.default.ITEM(!0,rn===Zt.state.selectedItem,rn===Zt.state.previousItem),onClick:Zt.handleClickItem.bind(Zt,rn,nn),style:Qt};return yt.default.createElement("li",fn,Zt.props.renderItem(nn,{isSelected:rn===Zt.state.selectedItem,isPrevious:rn===Zt.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var sn=this,Zt=this.props,nn=Zt.showIndicators,rn=Zt.labels,on=Zt.renderIndicator,ln=Zt.children;return nn?yt.default.createElement("ul",{className:"control-dots"},yt.Children.map(ln,function(Qt,fn){return on&&on(sn.changeItem(fn),fn===sn.state.selectedItem,fn,rn.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?yt.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,yt.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||yt.Children.count(this.props.children)===0?null:yt.default.createElement(vt.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var sn=this;if(!this.props.children||yt.Children.count(this.props.children)===0)return null;var Zt=this.props.swipeable&&yt.Children.count(this.props.children)>1,nn=this.props.axis==="horizontal",rn=this.props.showArrows&&yt.Children.count(this.props.children)>1,on=rn&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ln=rn&&(this.state.selectedItem<yt.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,Qt=this.renderItems(!0),fn=Qt.shift(),pn=Qt.pop(),mn={className:xt.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},vn={};if(nn){if(mn.onSwipeLeft=this.onSwipeForward,mn.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var yn=this.getVariableItemHeight(this.state.selectedItem);vn.height=yn||"auto"}}else mn.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,mn.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,mn.style=kt(kt({},mn.style),{},{height:this.state.itemSize}),vn.height=this.state.itemSize;return yt.default.createElement("div",{"aria-label":this.props.ariaLabel,className:xt.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},yt.default.createElement("div",{className:xt.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,on,this.props.labels.leftArrow),yt.default.createElement("div",{className:xt.default.WRAPPER(!0,this.props.axis),style:vn},Zt?yt.default.createElement(Et.default,Pt({tagName:"ul",innerRef:this.setListRef},mn,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&pn,this.renderItems(),this.props.infiniteLoop&&fn):yt.default.createElement("ul",{className:xt.default.SLIDER(!0,this.state.swiping),ref:function(Mn){return sn.setListRef(Mn)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&pn,this.renderItems(),this.props.infiniteLoop&&fn)),this.props.renderArrowNext(this.onClickNext,ln,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),Jt})(yt.default.Component);return Carousel.default=qt,Gt(qt,"displayName","Carousel"),Gt(qt,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:Ft.noop,onClickThumb:Ft.noop,onChange:Ft.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(Kt,Jt,tn){return yt.default.createElement("button",{type:"button","aria-label":tn,className:xt.default.ARROW_PREV(!Jt),onClick:Kt})},renderArrowNext:function(Kt,Jt,tn){return yt.default.createElement("button",{type:"button","aria-label":tn,className:xt.default.ARROW_NEXT(!Jt),onClick:Kt})},renderIndicator:function(Kt,Jt,tn,sn){return yt.default.createElement("li",{className:xt.default.DOT(Jt),onClick:Kt,onKeyDown:Kt,value:tn,key:tn,role:"button",tabIndex:0,"aria-label":"".concat(sn," ").concat(tn+1)})},renderItem:function(Kt){return Kt},renderThumbs:function(Kt){var Jt=yt.Children.map(Kt,function(tn){var sn=tn;if(tn.type!=="img"&&(sn=yt.Children.toArray(tn.props.children).find(function(Zt){return Zt.type==="img"})),!!sn)return sn});return Jt.filter(function(tn){return tn}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):Jt},statusFormatter:Ft.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:Ct.slideSwipeAnimationHandler,stopSwipingHandler:Ct.slideStopSwipingHandler}),Carousel}var types={},hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1),types}var hasRequiredJs;function requireJs(){return hasRequiredJs||(hasRequiredJs=1,(function(yt){Object.defineProperty(yt,"__esModule",{value:!0}),Object.defineProperty(yt,"Carousel",{enumerable:!0,get:function(){return Et.default}}),Object.defineProperty(yt,"CarouselProps",{enumerable:!0,get:function(){return xt.CarouselProps}}),Object.defineProperty(yt,"Thumbs",{enumerable:!0,get:function(){return vt.default}});var Et=bt(requireCarousel()),xt=requireTypes(),vt=bt(requireThumbs());function bt(At){return At&&At.__esModule?At:{default:At}}})(js)),js}var jsExports=requireJs(),now_1,hasRequiredNow;function requireNow(){if(hasRequiredNow)return now_1;hasRequiredNow=1;var yt=require_root(),Et=function(){return yt.Date.now()};return now_1=Et,now_1}var _trimmedEndIndex,hasRequired_trimmedEndIndex;function require_trimmedEndIndex(){if(hasRequired_trimmedEndIndex)return _trimmedEndIndex;hasRequired_trimmedEndIndex=1;var yt=/\s/;function Et(xt){for(var vt=xt.length;vt--&&yt.test(xt.charAt(vt)););return vt}return _trimmedEndIndex=Et,_trimmedEndIndex}var _baseTrim,hasRequired_baseTrim;function require_baseTrim(){if(hasRequired_baseTrim)return _baseTrim;hasRequired_baseTrim=1;var yt=require_trimmedEndIndex(),Et=/^\s+/;function xt(vt){return vt&&vt.slice(0,yt(vt)+1).replace(Et,"")}return _baseTrim=xt,_baseTrim}var toNumber_1,hasRequiredToNumber;function requireToNumber(){if(hasRequiredToNumber)return toNumber_1;hasRequiredToNumber=1;var yt=require_baseTrim(),Et=requireIsObject(),xt=requireIsSymbol(),vt=NaN,bt=/^[-+]0x[0-9a-f]+$/i,At=/^0b[01]+$/i,Ft=/^0o[0-7]+$/i,Ct=parseInt;function wt(St){if(typeof St=="number")return St;if(xt(St))return vt;if(Et(St)){var Tt=typeof St.valueOf=="function"?St.valueOf():St;St=Et(Tt)?Tt+"":Tt}if(typeof St!="string")return St===0?St:+St;St=yt(St);var Rt=At.test(St);return Rt||Ft.test(St)?Ct(St.slice(2),Rt?2:8):bt.test(St)?vt:+St}return toNumber_1=wt,toNumber_1}var debounce_1,hasRequiredDebounce;function requireDebounce(){if(hasRequiredDebounce)return debounce_1;hasRequiredDebounce=1;var yt=requireIsObject(),Et=requireNow(),xt=requireToNumber(),vt="Expected a function",bt=Math.max,At=Math.min;function Ft(Ct,wt,St){var Tt,Rt,Pt,Lt,kt,Ot,Mt=0,It=!1,Nt=!1,Ut=!0;if(typeof Ct!="function")throw new TypeError(vt);wt=xt(wt)||0,yt(St)&&(It=!!St.leading,Nt="maxWait"in St,Pt=Nt?bt(xt(St.maxWait)||0,wt):Pt,Ut="trailing"in St?!!St.trailing:Ut);function jt(Jt){var tn=Tt,sn=Rt;return Tt=Rt=void 0,Mt=Jt,Lt=Ct.apply(sn,tn),Lt}function Vt(Jt){return Mt=Jt,kt=setTimeout(Wt,wt),It?jt(Jt):Lt}function zt(Jt){var tn=Jt-Ot,sn=Jt-Mt,Zt=wt-tn;return Nt?At(Zt,Pt-sn):Zt}function Ht(Jt){var tn=Jt-Ot,sn=Jt-Mt;return Ot===void 0||tn>=wt||tn<0||Nt&&sn>=Pt}function Wt(){var Jt=Et();if(Ht(Jt))return Gt(Jt);kt=setTimeout(Wt,zt(Jt))}function Gt(Jt){return kt=void 0,Ut&&Tt?jt(Jt):(Tt=Rt=void 0,Lt)}function qt(){kt!==void 0&&clearTimeout(kt),Mt=0,Tt=Ot=Rt=kt=void 0}function Xt(){return kt===void 0?Lt:Gt(Et())}function Kt(){var Jt=Et(),tn=Ht(Jt);if(Tt=arguments,Rt=this,Ot=Jt,tn){if(kt===void 0)return Vt(Ot);if(Nt)return clearTimeout(kt),kt=setTimeout(Wt,wt),jt(Ot)}return kt===void 0&&(kt=setTimeout(Wt,wt)),Lt}return Kt.cancel=qt,Kt.flush=Xt,Kt}return debounce_1=Ft,debounce_1}var debounceExports=requireDebounce();const debounce=getDefaultExportFromCjs(debounceExports);function useEventListener(yt,Et,xt,vt,bt=!1){const At=reactExports.useRef();At.current=Et,reactExports.useEffect(()=>{if(xt===null||xt.addEventListener===void 0)return;const Ft=xt,Ct=wt=>{At.current?.call(Ft,wt)};return Ft.addEventListener(yt,Ct,{passive:vt,capture:bt}),()=>{Ft.removeEventListener(yt,Ct,{capture:bt})}},[yt,xt,vt,bt])}function whenDefined(yt,Et){return yt===void 0?void 0:Et}const PI=Math.PI;function degreesToRadians(yt){return yt*PI/180}const getSquareBB=(yt,Et,xt)=>({x1:yt-xt/2,y1:Et-xt/2,x2:yt+xt/2,y2:Et+xt/2}),getSquareXPosFromAlign=(yt,Et,xt,vt,bt)=>{switch(yt){case"left":return Math.floor(Et)+vt+bt/2;case"center":return Math.floor(Et+xt/2);case"right":return Math.floor(Et+xt)-vt-bt/2}},getSquareWidth=(yt,Et,xt)=>Math.min(yt,Et-xt*2),pointIsWithinBB=(yt,Et,xt)=>xt.x1<=yt&&yt<=xt.x2&&xt.y1<=Et&&Et<=xt.y2,EditPencil=yt=>{const Et=yt.fgColor??"currentColor";return reactExports.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},reactExports.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:Et,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),reactExports.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:Et,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},Checkmark=yt=>{const Et=yt.fgColor??"currentColor";return reactExports.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},reactExports.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:Et,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function useDebouncedMemo(yt,Et,xt){const[vt,bt]=reactExports.useState(yt),At=reactExports.useRef(!0);reactExports.useEffect(()=>()=>{At.current=!1},[]);const Ft=reactExports.useRef(debounce(Ct=>{At.current&&bt(Ct)},xt));return reactExports.useLayoutEffect(()=>{At.current&&Ft.current(()=>yt())},Et),vt}const rtlRange="֑-߿יִ-﷽ﹰ-ﻼ",ltrRange="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",rtl=new RegExp("^[^"+ltrRange+"]*["+rtlRange+"]");function direction(yt){return rtl.test(yt)?"rtl":"not-rtl"}let scrollbarWidthCache;function getScrollBarWidth(){if(typeof document>"u")return 0;if(scrollbarWidthCache!==void 0)return scrollbarWidthCache;const yt=document.createElement("p");yt.style.width="100%",yt.style.height="200px";const Et=document.createElement("div");Et.id="testScrollbar",Et.style.position="absolute",Et.style.top="0px",Et.style.left="0px",Et.style.visibility="hidden",Et.style.width="200px",Et.style.height="150px",Et.style.overflow="hidden",Et.append(yt),document.body.append(Et);const xt=yt.offsetWidth;Et.style.overflow="scroll";let vt=yt.offsetWidth;return xt===vt&&(vt=Et.clientWidth),Et.remove(),scrollbarWidthCache=xt-vt,scrollbarWidthCache}const empty=Symbol();function useStateWithReactiveInput(yt){const Et=reactExports.useRef([empty,yt]);Et.current[1]!==yt&&(Et.current[0]=yt),Et.current[1]=yt;const[xt,vt]=reactExports.useState(yt),[,bt]=reactExports.useState(),At=reactExports.useCallback(Ct=>{const wt=Et.current[0];wt!==empty&&(Ct=typeof Ct=="function"?Ct(wt):Ct,Ct===wt)||(wt!==empty&&bt({}),vt(St=>typeof Ct=="function"?Ct(wt===empty?St:wt):Ct),Et.current[0]=empty)},[]),Ft=reactExports.useCallback(()=>{Et.current[0]=empty,bt({})},[]);return[Et.current[0]===empty?xt:Et.current[0],At,Ft]}function makeAccessibilityStringForArray(yt){if(yt.length===0)return"";let Et=0,xt=0;for(const vt of yt){if(xt+=vt.length,xt>1e4)break;Et++}return yt.slice(0,Et).join(", ")}function useDeepMemo(yt){const Et=reactExports.useRef(yt);return deepEqual(yt,Et.current)||(Et.current=yt),Et.current}const ImageOverlayEditor=yt=>{const{urls:Et,canWrite:xt,onEditClick:vt,renderImage:bt}=yt,At=Et.filter(Ct=>Ct!=="");if(At.length===0)return null;const Ft=At.length>1;return reactExports.createElement(ImageOverlayEditorStyle,{"data-testid":"GDG-default-image-overlay-editor"},reactExports.createElement(jsExports.Carousel,{showArrows:Ft,showThumbs:!1,swipeable:Ft,emulateTouch:Ft,infiniteLoop:Ft},At.map(Ct=>{const wt=bt?.(Ct)??reactExports.createElement("img",{draggable:!1,src:Ct});return reactExports.createElement("div",{className:"gdg-centering-container",key:Ct},wt)})),xt&&vt&&reactExports.createElement("button",{className:"gdg-edit-icon",onClick:vt},reactExports.createElement(EditPencil,null)))};function L(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var T$1=L();function G(yt){T$1=yt}var E={exec:()=>null};function d$1(yt,Et=""){let xt=typeof yt=="string"?yt:yt.source,vt={replace:(bt,At)=>{let Ft=typeof At=="string"?At:At.source;return Ft=Ft.replace(m.caret,"$1"),xt=xt.replace(bt,Ft),vt},getRegex:()=>new RegExp(xt,Et)};return vt}var be=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),m={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:yt=>new RegExp(`^( {0,3}${yt})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:yt=>new RegExp(`^ {0,${Math.min(3,yt-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:yt=>new RegExp(`^ {0,${Math.min(3,yt-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:yt=>new RegExp(`^ {0,${Math.min(3,yt-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:yt=>new RegExp(`^ {0,${Math.min(3,yt-1)}}#`),htmlBeginRegex:yt=>new RegExp(`^ {0,${Math.min(3,yt-1)}}<(?:[a-z].*>|!--)`,"i")},Re=/^(?:[ \t]*(?:\n|$))+/,Te=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Oe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,I=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,we=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,F=/(?:[*+-]|\d{1,9}[.)])/,ie=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,oe=d$1(ie).replace(/bull/g,F).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ye=d$1(ie).replace(/bull/g,F).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),j=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Pe=/^[^\n]+/,Q=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Se=d$1(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Q).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$e=d$1(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,F).getRegex(),v$1="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",U=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_e=d$1("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",U).replace("tag",v$1).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae=d$1(j).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v$1).getRegex(),Le=d$1(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ae).getRegex(),K={blockquote:Le,code:Te,def:Se,fences:Oe,heading:we,hr:I,html:_e,lheading:oe,list:$e,newline:Re,paragraph:ae,table:E,text:Pe},re=d$1("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v$1).getRegex(),Me={...K,lheading:ye,table:re,paragraph:d$1(j).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",re).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v$1).getRegex()},ze={...K,html:d$1(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",U).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:E,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d$1(j).replace("hr",I).replace("heading",` *#{1,6} *[^
|
|
2793
|
+
`)},Rr=Zn?Array.isArray(Zn)?Zn:Zn.split(",").map(Vr=>Vr.trim()).filter(Boolean):null;let Wr=null;const $r=(Pn||"bottom").toLowerCase();if(fr<150&&$r!=="center"){const Vr=new Map;for(const ri of En){const Ei=ri.id||ri.uniqueId||"",Di=Ei.indexOf("_"),Hi=Di>0?Ei.substring(0,Di):"";if(!Hi)continue;const Pi=ri.trackY??0;(!Vr.has(Hi)||Pi<Vr.get(Hi))&&Vr.set(Hi,Pi)}if(Vr.size>0){let ri="",Ei="",Di=-1/0,Hi=1/0;for(const[Pi,Qi]of Vr)Qi>Di&&(Di=Qi,ri=Pi),Qi<Hi&&(Hi=Qi,Ei=Pi);Wr=$r==="bottom"?Ei:ri}}return En.map(Vr=>{if(Wr!==null){const Ko=Vr.id||Vr.uniqueId||"",ia=Ko.indexOf("_");if((ia>0?Ko.substring(0,ia):"")!==Wr)return null}const ri=Vr;let Ei;if(Rr&&Rr.length>0){const Ko=Rr.map(ia=>ia==="gene_id"?ri.id||ri.geneId||ri.metadata?.gene_id:ri.metadata?.[ia]).filter(ia=>ia!=null&&ia!=="");Ei=Ko.length>0?Ko.join(" | "):null}else Ei=ri.id||ri.geneId||ri.metadata?.gene_id||null;if(Ei==null)return null;const Di=(ri.start+ri.end)/2,Hi=ri.trackY!==void 0&&ri.trackY!==null?ri.trackY:ri.polygon&&ri.polygon.length?Math.min(...ri.polygon.map(([Ko,ia])=>ia)):0,Qi=(ri.geneHeight!==void 0&&ri.geneHeight!==null?ri.geneHeight:On&&On.gene?On.gene.height:60)/2,Si=Pr(ri),Ci=da(Si)||mr(Dn.geneFill),Ai=Math.abs(ri.end-ri.start)*(sr/100),Xs=On&&On.text&&On.text.geneLabelSize?On.text.geneLabelSize:12,Ks=Ei==null?"":String(Ei),ra=Ai/(Xs*.4);let Qs=Xs;if(Ks.length>ra&&ra>0){const Ko=Math.min(1,ra*2/Ks.length);Qs=Math.max(Xs*.5,Xs*Math.max(.5,Ko))}const Ia=ri.geneHeight!==void 0&&ri.geneHeight!==null?ri.geneHeight:On&&On.gene?On.gene.height:60,ba=fr-Ia-10,zl=Qs*7,Ua=Math.max(1,Math.floor(ba/zl)),Il=Ur(Ks,Ai,Qs,Ua),Oa=2;let Xo;switch((Pn||"bottom").toLowerCase()){case"top":Xo=Hi+Qi+Oa;break;case"center":Xo=Hi;break;default:Xo=Hi-Qi-Oa;break}let Pa="top";switch((Pn||"bottom").toLowerCase()){case"center":Pa="center";break;case"top":Pa="bottom";break;default:Pa="top";break}return{position:[Di,Xo],text:Il,color:Ci,size:Qs,textAnchor:"middle",alignmentBaseline:Pa}}).filter(Boolean)}function da(En,kn=qt.stroke.darkenFactor){return!Array.isArray(En)||En.length<3?En:[Math.max(0,Math.floor(En[0]*kn)),Math.max(0,Math.floor(En[1]*kn)),Math.max(0,Math.floor(En[2]*kn)),En.length>3?En[3]:255]}function nl(En){let kn=0;for(let On=0;On<En.length;++On)kn=En.charCodeAt(On)+((kn<<5)-kn);const Vn=kn>>0&255,Nn=kn>>8&255,Dn=kn>>16&255;return[Math.abs(Vn),Math.abs(Nn),Math.abs(Dn),255]}function uo(En){if(En==null)return NaN;if(typeof En=="number")return Number.isFinite(En)?En:NaN;let kn=String(En).trim();if(kn==="")return NaN;kn=kn.replace(/,/g,""),kn=kn.replace(/^\s*[<>]=?\s*/,""),kn.endsWith("%")&&(kn=kn.slice(0,-1));const Vn=Number(kn);return Number.isFinite(Vn)?Vn:NaN}function Ls(En){if(En==null)return!0;if(typeof En=="string"){const kn=En.trim();if(kn==="")return!0;const Vn=kn.toLowerCase();return Vn==="null"||Vn==="none"}return!1}function ya(En,kn,Vn){if(En&&!Ls(kn)){if(Vn==="sequential"){const Nn=uo(kn);return isNaN(Nn)?void 0:En.get(Nn)}return En.get(String(kn).trim())}}function jl(En,kn){if(!En||!kn)return;if(En[kn]!==void 0&&En[kn]!=="")return En[kn];if(En.metadata&&En.metadata[kn]!==void 0&&En.metadata[kn]!=="")return En.metadata[kn];const Vn={start:["start","from","begin","pos","coord_start"],end:["end","to","stop","finish","pos2","coord_end"],evalue:["evalue","e_value","E-value","score"],coverage:["coverage","cov","pct_coverage","percent_coverage"]},Nn=String(kn).toLowerCase(),Dn=Vn[Nn]||[kn];for(const On of Dn){if(En[On]!==void 0&&En[On]!=="")return En[On];if(En.metadata&&En.metadata[On]!==void 0&&En.metadata[On]!=="")return En.metadata[On]}if(En.metadata){for(const[On,Pn]of Object.entries(En.metadata))if(On&&String(On).toLowerCase()===Nn&&Pn!==void 0&&Pn!=="")return Pn}}function Ho(En,kn,Vn,Nn,Dn=null){if(!Nn||!Nn.enabled)return En.map(fr=>({...fr,color:[0,0,0,255]}));if(Dn&&Dn.size>0)return En.map(fr=>{const Pr=(_i(fr.leafNode.name)||{})[kn];if(Pr!=null){const Ur=String(Pr),Rr=Dn.get(Ur)||Dn.get(Number(Ur))||[0,0,0,255];return{...fr,color:Rr}}else return{...fr,color:[0,0,0,255]}});const On=new Set;for(const fr of En){const Pr=(_i(fr.leafNode.name)||{})[kn];Pr!=null&&Pr!==""&&On.add(String(Pr))}const Pn=Array.from(On).sort();let Zn=[];if(Nn&&Nn.name)try{Zn=nr(Nn.name,Math.max(Pn.length,Nn.numColors||Pn.length),Nn.reverse||!1)}catch{Zn=[]}const sr={};if(Nn.type==="sequential"&&Pn.length>0&&Pn.every(fr=>!isNaN(Number(fr)))){const fr=Pn.map(Ur=>Number(Ur)),mr=Math.min(...fr),Pr=Math.max(...fr);Pn.forEach(Ur=>{const Rr=Number(Ur),Wr=Pr>mr?(Rr-mr)/(Pr-mr):0,$r=Math.floor(Wr*(Zn.length-1));sr[Ur]=Zn[$r]})}else Pn.forEach((fr,mr)=>{sr[fr]=Zn[mr%Zn.length]});return En.map(fr=>{const Pr=(_i(fr.leafNode.name)||{})[kn];if(Pr!=null){const Ur=String(Pr);return{...fr,color:sr[Ur]||[0,0,0,255]}}else return{...fr,color:[0,0,0,255]}})}const hi=Qt||qt?.colorPalettes?.genePalette,Bs=fn||qt?.colorPalettes?.domainPalette,Li=pn||qt?.colorPalettes?.phyloPalette;mn||qt?.colorPalettes?.ncRNAPalette,reactExports.useEffect(()=>{if(!Wi||Wi.length===0)return;const En=Wi[0]?.id;if(!En)return;const kn=requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!Ts.current?.nodes)return;const Vn=Ts.current.nodes.find(Nn=>Nn.id===En||Nn.name===En||Nn.leaf_id===En||Nn.node?.id===En||Nn.node?.name===En||Nn.node?.leaf_id===En);if(Vn?.color){const Nn=Array.isArray(Vn.color)?[...Vn.color]:Vn.color,Dn=Wi[0]?.color;(!Dn||Nn[0]!==Dn[0]||Nn[1]!==Dn[1]||Nn[2]!==Dn[2])&&Mo(Pn=>Pn?Pn.map(Zn=>({...Zn,color:Nn})):null)}})});return()=>cancelAnimationFrame(kn)},[Wi?.[0]?.id,Gt,Li?.name,Li?.type]);const _a=React.useMemo(()=>{if(!Un)return new Set;if(!ci)return new Set(Un.leaves||[]);try{const En=Un.filterBySelectedNode(ci)||{};if(Array.isArray(En.genes)){const kn=En.genes.map(Vn=>Vn.hood_id).filter(Boolean);return new Set(kn)}}catch{}return new Set(Un.leaves||[])},[Un,ci]),ta=React.useMemo(()=>{if(!Un)return null;const En=yn||Vt||"cluster";if(!ci)return Un.computeGenePrevalence(En);const kn=_a,Vn=kn.size||0;if(Vn===0)return new Map;const Nn=new Map;for(const On of Object.values(Un.genesById)){const Pn=On.hood_id||Un.getHoodIdFromSeqid(On.seqid);if(!Pn||!kn.has(Pn))continue;let Zn=null;if(En==="cluster"?Zn=On.metadata?.cluster??On.metadata?.clusterId??On.cluster:Zn=On.metadata?.[En],Zn==null||Zn==="")continue;const sr=String(Zn);Nn.has(sr)||Nn.set(sr,new Set),Nn.get(sr).add(Pn)}const Dn=new Map;for(const[On,Pn]of Nn)Dn.set(On,Pn.size/Vn);return Dn},[Un,yn,Vt,ci,_a]),Pl=React.useRef(null),lc=React.useRef(null),_l=React.useMemo(()=>{if(!Un||!hi?.enabled)return null;const En=yn||Vt||"cluster",kn=Object.values(Un.genesById),Vn=mr=>{let Pr=mr?.metadata?.[En];return(Pr==null||Pr==="")&&En==="cluster"&&(Pr=mr?.metadata?.clusterId??mr?.metadata?.cluster_id??mr?.cluster),Pr},Nn=kn.map(Vn).map(mr=>normalizeKey(mr)).filter(mr=>!Ls(mr)),Dn=[...new Set(Nn)].sort((mr,Pr)=>{const Ur=Number(mr),Rr=Number(Pr);return!isNaN(Ur)&&!isNaN(Rr)?Ur-Rr:String(mr).localeCompare(String(Pr))});if(Dn.length===0)return null;const On=`${En}-${hi.name}-${hi.numColors}-${hi.reverse}-${Dn.length}`;if(Pl.current&&lc.current===On)return Pl.current;const Zn=Dn.map(mr=>uo(mr)).filter(mr=>!isNaN(mr)).length===Dn.length&&Dn.length>0,sr=nr(hi.name,hi.numColors&&hi.type==="sequential"?hi.numColors:Math.max(Dn.length,hi.numColors||Dn.length),hi.reverse||!1,hi.type||"qualitative"),fr=new Map;if(hi.type==="sequential"&&Zn){const mr=Dn.map(Rr=>uo(Rr)),Pr=Math.min(...mr),Ur=Math.max(...mr);Dn.forEach(Rr=>{const Wr=uo(Rr),$r=Ur>Pr?(Wr-Pr)/(Ur-Pr):0,qr=Math.floor($r*(sr.length-1));fr.set(Wr,sr[qr]);try{fr.set(String(Rr),sr[qr])}catch{}})}else Dn.forEach((mr,Pr)=>{fr.set(String(mr),sr[Pr%sr.length]);const Ur=uo(mr);isNaN(Ur)||fr.set(Ur,sr[Pr%sr.length])});return Pl.current=fr,lc.current=On,console.debug("stableGeneColorMap: generated for",Dn.length,"unique values"),fr},[Un,yn,Vt,hi?.enabled,hi?.name,hi?.numColors,hi?.reverse,hi?.type]),ul=React.useRef(null),Ec=React.useRef(null),Sl=React.useMemo(()=>{if(!us||!Ht||!Gt||!Li?.enabled)return null;const En=new Set;for(const On of us.leafNodes||[]){const Zn=(Ht[On.name]||{})[Gt];Zn!=null&&Zn!==""&&En.add(String(Zn))}const kn=Array.from(En).sort();if(kn.length===0)return null;const Vn=`${Gt}-${Li.name}-${Li.numColors}-${Li.reverse}-${kn.length}`;if(ul.current&&Ec.current===Vn)return ul.current;let Nn=[];try{Nn=nr(Li.name,Math.max(kn.length,Li.numColors||kn.length),Li.reverse||!1,Li.type||"qualitative")}catch{Nn=[]}const Dn=new Map;if(Li.type==="sequential"&&kn.every(On=>!isNaN(Number(On)))){const On=kn.map(sr=>Number(sr)),Pn=Math.min(...On),Zn=Math.max(...On);kn.forEach(sr=>{const fr=Number(sr),mr=Zn>Pn?(fr-Pn)/(Zn-Pn):0,Pr=Math.floor(mr*(Nn.length-1));Dn.set(sr,Nn[Pr]),Dn.set(fr,Nn[Pr])})}else kn.forEach((On,Pn)=>{Dn.set(On,Nn[Pn%Nn.length]);const Zn=Number(On);isNaN(Zn)||Dn.set(Zn,Nn[Pn%Nn.length])});return ul.current=Dn,Ec.current=Vn,console.debug("stableTreeColorMap: generated for",kn.length,"unique values"),Dn},[us,Ht,Gt,Li?.enabled,Li?.name,Li?.numColors,Li?.reverse,Li?.type]),Lo=hi?.stableColors!==!1,cc=Li?.stableColors!==!1,ss=React.useMemo(()=>{if(!Un||!hi?.enabled||Lo&&!_l)return null;const En=yn||Vt||"cluster";let kn=Object.values(Un.genesById);!Lo&&_a&&_a.size>0&&(kn=kn.filter(Pr=>{const Ur=Pr.hood_id||Un.getHoodIdFromSeqid(Pr.seqid);return Ur&&_a.has(Ur)}));const Vn=Pr=>{let Ur=Pr?.metadata?.[En];return(Ur==null||Ur==="")&&En==="cluster"&&(Ur=Pr?.metadata?.clusterId??Pr?.metadata?.cluster_id??Pr?.cluster),Ur},Nn=kn.map(Vn).map(Pr=>normalizeKey(Pr)).filter(Pr=>!Ls(Pr)),Dn=[...new Set(Nn)].sort((Pr,Ur)=>{const Rr=Number(Pr),Wr=Number(Ur);return!isNaN(Rr)&&!isNaN(Wr)?Rr-Wr:String(Pr).localeCompare(String(Ur))});if(Dn.length===0)return null;const Pn=Dn.map(Pr=>uo(Pr)).filter(Pr=>!isNaN(Pr)).length===Dn.length&&Dn.length>0,Zn=new Map,sr=DEFAULT_CONFIG$1.gene.fillColor,fr=hi.transparentByPrevalence?[sr[0],sr[1],sr[2],0]:sr,mr=(hi.prevalenceFilter||0)/100;if(Lo)Dn.forEach(Pr=>{const Ur=ta?.get(String(Pr))||0,Rr=Ur>=mr,Wr=ya(_l,Pr,hi?.type);let $r=Rr?Wr:fr;Rr&&hi.desaturateByPrevalence&&ta&&Un._desaturateColorByPrevalence&&($r=Un._desaturateColorByPrevalence($r,Ur)),Rr&&hi.transparentByPrevalence&&ta&&Un._transparentByPrevalence&&($r=Un._transparentByPrevalence($r,Ur));const qr=hi.type==="sequential"&&Pn?uo(Pr):String(Pr);Zn.set(qr,$r);try{Zn.set(String(Pr),$r)}catch{}const Vr=uo(Pr);isNaN(Vr)||Zn.set(Vr,$r)});else{const Pr=Dn.filter(Rr=>(ta?.get(String(Rr))||0)>=mr),Ur=nr(hi.name,hi.numColors&&hi.type==="sequential"?hi.numColors:Math.max(Pr.length,hi.numColors||Pr.length),hi.reverse||!1,hi.type||"qualitative");if(hi.type==="sequential"&&Pn){const Rr=Pr.map(qr=>uo(qr)),Wr=Math.min(...Rr),$r=Math.max(...Rr);Pr.forEach(qr=>{const Vr=uo(qr),ri=$r>Wr?(Vr-Wr)/($r-Wr):0,Ei=Math.floor(ri*(Ur.length-1));let Di=Ur[Ei];if(hi.desaturateByPrevalence&&ta&&Un._desaturateColorByPrevalence){const Hi=ta.get(String(qr))||0;Di=Un._desaturateColorByPrevalence(Di,Hi)}if(hi.transparentByPrevalence&&ta&&Un._transparentByPrevalence){const Hi=ta.get(String(qr))||0;Di=Un._transparentByPrevalence(Di,Hi)}Zn.set(Vr,Di);try{Zn.set(String(qr),Di)}catch{}})}else Pr.forEach((Rr,Wr)=>{let $r=Ur[Wr%Ur.length];if(hi.desaturateByPrevalence&&ta&&Un._desaturateColorByPrevalence){const Vr=ta.get(String(Rr))||0;$r=Un._desaturateColorByPrevalence($r,Vr)}if(hi.transparentByPrevalence&&ta&&Un._transparentByPrevalence){const Vr=ta.get(String(Rr))||0;$r=Un._transparentByPrevalence($r,Vr)}Zn.set(String(Rr),$r);const qr=uo(Rr);isNaN(qr)||Zn.set(qr,$r)});Dn.forEach(Rr=>{if((ta?.get(String(Rr))||0)<mr){const $r=hi.type==="sequential"&&Pn?uo(Rr):String(Rr);Zn.set($r,fr);try{Zn.set(String(Rr),fr)}catch{}const qr=uo(Rr);isNaN(qr)||Zn.set(qr,fr)}})}return Zn},[Un,_l,ta,_a,hi?.enabled,hi?.type,hi?.name,hi?.numColors,hi?.reverse,hi?.desaturateByPrevalence,hi?.transparentByPrevalence,hi?.prevalenceFilter,hi?.stableColors,Lo,Vt,yn,mi]);React.useEffect(()=>{try{if(!Un)return;const En=yn||Vt||"cluster",Vn=Object.values(Un.genesById||{}).map(Pn=>{let Zn=Pn?.metadata?.[En];return(Zn==null||Zn==="")&&En==="cluster"&&(Zn=Pn?.metadata?.clusterId??Pn?.metadata?.cluster_id??Pn?.cluster),Zn}).filter(Pn=>Pn!=null&&Pn!==""),Nn=[...new Set(Vn)],On=Nn.map(Pn=>uo(Pn)).filter(Pn=>!isNaN(Pn)).length===Nn.length&&Nn.length>0}catch(En){console.error("ColorSelect gene logging error",En)}},[yn,Vt,Un,ss,hi?.name,hi?.type]);const Dl=({object:En,layer:kn})=>{if(!En)return null;if(kn&&kn.id==="protein-polygons"){const Vn=bs.current,Nn=Vn?.genesById?.[En.gAId],Dn=Vn?.genesById?.[En.gBId],On=En.metadata?.similarity??En.similarity??"N/A",Pn=[["type","Protein Link"],["similarity",typeof On=="number"?`${On.toFixed(1)}%`:On]];if(Nn){const fr=Nn.metadata?.gene_name||Nn.metadata?.name||Nn.gene_id||En.gAId,mr=Nn.metadata?.cluster||Nn.metadata?.clusterId||Nn.cluster||"";Pn.push(["source gene",fr]),mr&&String(mr)!==String(fr)&&Pn.push(["source cluster",mr]),Pn.push(["source hood",Nn.hood_id||Nn.seqid||""])}if(Dn){const fr=Dn.metadata?.gene_name||Dn.metadata?.name||Dn.gene_id||En.gBId,mr=Dn.metadata?.cluster||Dn.metadata?.clusterId||Dn.cluster||"";Pn.push(["target gene",fr]),mr&&String(mr)!==String(fr)&&Pn.push(["target cluster",mr]),Pn.push(["target hood",Dn.hood_id||Dn.seqid||""])}const Zn=Pn.filter(([fr,mr])=>mr!==""&&mr!==null&&mr!==void 0);return Zn.length===0?null:{html:`<table>${Zn.map(([fr,mr])=>`<tr><td><b>${fr}</b></td><td style="width:10px"></td><td>${String(mr)}</td></tr>`).join("")}</table>`}}if(kn&&kn.id==="nucleotide-polygons"){let Vn=En.similarity;if(Vn==null&&(Vn=En.metadata?.similarity),Vn==null){const fr=bs.current;if(fr&&fr.nucleotideLinks){const mr=fr.nucleotideLinks.find(Pr=>Pr.hoodA===En.hoodA&&Pr.hoodB===En.hoodB&&Pr.hoodStartA===En.hoodStartA);mr&&(Vn=mr.similarity)}}let Nn="N/A";typeof Vn=="number"&&!isNaN(Vn)?Nn=`${Vn.toFixed(1)}%`:typeof Vn=="string"&&Vn!==""&&(Nn=Vn);const Dn=bs.current;let On="";if(Dn){const fr=Dn.nucleotideLinks?.find(mr=>mr.hoodA===En.hoodA&&mr.hoodB===En.hoodB&&mr.hoodStartA===En.hoodStartA);if(fr){const mr=fr.strandA||"+",Pr=fr.strandB||"+",Ur=!!Dn.trackFlipped[En.hoodA],Rr=!!Dn.trackFlipped[En.hoodB],Wr=mr==="+"!==Ur?"+":"-",$r=Pr==="+"!==Rr?"+":"-";On=`${Wr}/${$r} (${Wr===$r?"same strand":"opposite strand"})`}}const Pn=[["type","Nucleotide Link"],["similarity",Nn],["strand",On],["hood A",En.hoodA||""],["hood B",En.hoodB||""]];En.hoodStartA!==void 0&&En.hoodEndA!==void 0&&Pn.push(["region A",`${Math.round(En.hoodStartA)}-${Math.round(En.hoodEndA)}`]),En.hoodStartB!==void 0&&En.hoodEndB!==void 0&&Pn.push(["region B",`${Math.round(En.hoodStartB)}-${Math.round(En.hoodEndB)}`]);const Zn=Pn.filter(([fr,mr])=>mr!==""&&mr!==null&&mr!==void 0);return Zn.length===0?null:{html:`<table>${Zn.map(([fr,mr])=>`<tr><td><b>${fr}</b></td><td style="width:10px"></td><td>${String(mr)}</td></tr>`).join("")}</table>`}}if(kn&&kn.id==="nodes"&&En.node&&En.node.branchset&&En.node.branchset.length===0){const Vn=En.node.name||En.node.id||En.id,Dn=(Zn=>{if(!Ht)return{};if(!Zn)return{};if(Ht[Zn])return Ht[Zn];const sr=Object.values(Ht);for(let fr=0;fr<sr.length;++fr){const mr=sr[fr];if(mr&&(mr.leaf_id==Zn||mr.leaf_id===Zn||mr.leaf_name==Zn||mr.leaf_name===Zn||mr.id==Zn||mr.id===Zn||mr.name==Zn||mr.name===Zn||mr.originalId==Zn||mr.original_id==Zn))return mr}return{}})(Vn)||{},On=Object.entries(Dn).filter(([Zn,sr])=>{if(!Zn)return!1;const fr=String(Zn).toLowerCase();if(fr==="sequence"||fr==="attributes"||Ls(sr))return!1;const mr=typeof sr;return mr==="string"||mr==="number"||mr==="boolean"});return On.length===0?null:{html:`<table>${On.map(([Zn,sr])=>`<tr><td><b>${Zn}</b></td><td style="width:10px"></td><td>${String(sr)}</td></tr>`).join("")}</table>`}}if(En.metadata){const Vn=En.metadata||{},Nn=Object.entries(Vn).filter(([On,Pn])=>{if(!On)return!1;const Zn=String(On).toLowerCase();if(Zn==="sequence"||Zn==="structure"||Zn==="attributes"||Zn==="clusterid"||Zn==="cluster_id"||Ls(Pn))return!1;const sr=typeof Pn;return sr==="string"||sr==="number"||sr==="boolean"});if(En.metadata.attributes){if(typeof En.metadata.attributes=="object"&&!Array.isArray(En.metadata.attributes))Object.entries(En.metadata.attributes).forEach(([On,Pn])=>{On&&Pn!==null&&Pn!==void 0&&Nn.push([On,String(Pn)])});else if(typeof En.metadata.attributes=="string"){const On=En.metadata.attributes.split(";").filter(Pn=>Pn.trim());for(const Pn of On){const[Zn,sr]=Pn.split("=").map(fr=>fr.trim());Zn&&sr&&Nn.push([Zn,sr])}}}if(ta&&En.metadata&&(yn||Vt)){const On=yn||Vt||"cluster";let Pn=En.metadata[On];if((Pn==null||Pn==="")&&On==="cluster"&&(Pn=En.metadata.clusterId??En.metadata.cluster_id??En.cluster),Pn!=null&&Pn!==""){const Zn=ta.get(String(Pn));if(Zn!==void 0){const sr=(Zn*100).toFixed(1);Nn.push(["prevalence",`${sr}% of hoods`])}}}return Nn.length===0?null:{html:`<table>${Nn.map(([On,Pn])=>`<tr><td><b>${On}</b></td><td style="width:10px"></td><td>${String(Pn)}</td></tr>`).join("")}</table>`}}return En.name?{text:En.name}:En.id?{text:En.id}:En.gene_id?{text:En.gene_id}:null};React.useMemo(()=>!0,[mi,hi?.enabled,hi?.name,hi?.numColors,hi?.reverse]);const{filteredProteinPolygons:Ql,filteredNucleotidePolygons:so}=React.useMemo(()=>{if(!Un)return{filteredProteinPolygons:[],filteredNucleotidePolygons:[]};let En=Un.getProteinPolygons(),kn=Un.getNucleotidePolygons(),Vn=Un.leaves;if(ci)try{const sr=Un.filterBySelectedNode(ci);sr&&Array.isArray(sr.proteinPolygons)&&(En=sr.proteinPolygons.map(fr=>({polygon:fr.polygon||fr.polygon,fillColor:fr.fillColor,metadata:fr.metadata}))),sr&&Array.isArray(sr.nucleotidePolygons)&&(kn=sr.nucleotidePolygons.map(fr=>({polygon:fr.polygon||fr.polygon,fillColor:fr.fillColor,metadata:fr.metadata}))),Vn=sr&&Array.isArray(sr.genes)?sr.genes.map(fr=>fr.hood_id):Vn}catch{}const Nn=new Set;for(let sr=0;sr<Vn.length-1;sr++){const[fr,mr]=[Vn[sr],Vn[sr+1]].sort();Nn.add(`${fr}__${mr}`)}const Dn=En.filter(sr=>{if(!sr.metadata)return!1;const{gAId:fr,gBId:mr,hoodA:Pr,hoodB:Ur,seqids:Rr}=sr.metadata;let Wr=Pr||fr&&Un.genesById[fr]?.hood_id||Rr?.[0],$r=Ur||mr&&Un.genesById[mr]?.hood_id||Rr?.[1];if(gr.size>0&&(Wr!=null&&(gr.has(String(Wr))||gr.has(Number(Wr)))||$r!=null&&(gr.has(String($r))||gr.has(Number($r)))))return!1;if(Wr&&$r){const[qr,Vr]=[Wr,$r].sort();return Nn.has(`${qr}__${Vr}`)}return!1}),On=new Set;for(let sr=0;sr<Vn.length-1;sr++){const[fr,mr]=[Vn[sr],Vn[sr+1]].sort();On.add(`${fr}__${mr}`)}const Pn=new Set,Zn=kn.filter(sr=>{if(!sr.metadata)return!1;const{seqids:fr,hoodA:mr,hoodB:Pr}=sr.metadata;if(!fr||fr.length<2)return!1;const Ur=mr||fr[0],Rr=Pr||fr[1];if(gr.size>0&&(Ur!=null&&(gr.has(String(Ur))||gr.has(Number(Ur)))||Rr!=null&&(gr.has(String(Rr))||gr.has(Number(Rr)))))return!1;const[Wr,$r]=fr.sort(),qr=`${Wr}__${$r}`;return On.has(qr)&&!Pn.has(qr)?(Pn.add(qr),!0):!1});return{filteredProteinPolygons:Dn,filteredNucleotidePolygons:Zn}},[Un,xt,vt,mi,Rn,Tn,ss,hi,ci,gr]),xl=React.useMemo(()=>{if(!Un)return[];try{if(ci){const En=Un.filterBySelectedNode(ci);if(En&&Array.isArray(En.genes))return En.genes.map(kn=>({...kn,fillColor:kn.fillColor||An.geneFill}))}}catch{}return Object.values(Un.genesById).map(En=>({...En,fillColor:En.fillColor||An.geneFill}))},[Un,ss,yn,Vt,An.geneFill,mi,ci]),Jl=React.useCallback(()=>{const En=Un;mn||qt?.colorPalettes?.ncRNAPalette,vn||qt?.colorPalettes?.regionPalette;const kn={genes:null,phylo:null,regions:null,ncRNAs:null,proteinLinks:null,nucleotideLinks:null};try{if(typeof ss<"u"&&ss&&ss.size>0){const Nn=new Set,Dn=Array.from(ss.entries()).filter(([On])=>{const Pn=String(On);return Nn.has(Pn)?!1:(Nn.add(Pn),!0)}).map(([On,Pn])=>({value:String(On),color:Pn,stroke:Array.isArray(Pn)?da(Pn):null}));kn.genes=Dn}else if(En&&En.genesById){const Nn=new Map,Dn=yn||Vt||"cluster",On=Pn=>{try{if(ss){let Zn=Pn?.metadata?.[Dn];if((Zn==null||Zn==="")&&Dn==="cluster"&&(Zn=Pn?.metadata?.clusterId??Pn?.metadata?.cluster_id??Pn?.cluster),Zn!=null&&Zn!==""){const sr=ya(ss,Zn,hi?.type);if(sr)return sr}}}catch{}return Pn.fillColor||An.geneFill};xl.forEach(Pn=>{const Zn=Pn.metadata&&Pn.metadata[Dn]?Pn.metadata[Dn]:null;if(Zn!=null){const sr=String(Zn);if(!Nn.has(sr)){const fr=On(Pn);Nn.set(sr,{value:sr,color:fr,stroke:Array.isArray(fr)?da(fr):null})}}}),kn.genes=Array.from(Nn.values())}const Vn=new Map;if(us&&us.leafNodes&&Array.isArray(us.leafNodes)&&us.leafNodes.length>0&&Ht&&Gt){const Nn=Gt,On=[...new Set(us.leafNodes.map(Zn=>{const fr=(Ht[Zn.name]||{})[Nn];return fr!=null&&fr!==""?fr:null}).filter(Zn=>Zn!==null))].sort();let Pn=[];if(Li&&Li.enabled&&On.length>0)try{Pn=nr(Li.name,Math.max(On.length,Li.numColors||On.length),Li.reverse||!1,Li.type||"qualitative")}catch{Pn=[]}On.forEach((Zn,sr)=>{const fr=String(Zn);let mr=null;if(Pn.length>0&&sr<Pn.length)mr=Pn[sr];else{let Pr=0;for(let $r=0;$r<fr.length;++$r)Pr=fr.charCodeAt($r)+((Pr<<5)-Pr);const Ur=Pr>>0&255,Rr=Pr>>8&255,Wr=Pr>>16&255;mr=[Math.abs(Ur),Math.abs(Rr),Math.abs(Wr),255]}Vn.set(fr,{value:fr,color:mr,stroke:Array.isArray(mr)?da(mr):null})})}if(kn.phylo=Array.from(Vn.values()),En&&Array.isArray(En.proteinLinks)&&En.proteinLinks.length>0){const Nn=Rn||{};if(Nn.colorBy==="identity_gradient"&&Nn.palette&&Nn.palette.enabled){const Dn=En.proteinLinks.map(sr=>typeof sr.similarity=="number"?sr.similarity:0),On=Math.min(...Dn),Pn=Math.max(...Dn);let Zn=[];try{Zn=nr(Nn.palette.name,Nn.palette.numColors||8,Nn.palette.reverse||!1)}catch{Zn=[]}kn.proteinLinks={mode:"identity_gradient",minSim:On,maxSim:Pn,palette:Zn}}else if(Nn.colorBy==="source_gene"||Nn.colorBy==="target_gene"){const Dn=[];En.proteinLinks.forEach(Pn=>{const Zn=En.genesById&&En.genesById[Pn.gAId],sr=En.genesById&&En.genesById[Pn.gBId];if(Nn.colorBy==="source_gene"&&Zn){const fr=yn||Vt||"cluster";let mr=Zn.metadata&&Zn.metadata[fr];Ls(mr)&&fr==="cluster"&&(mr=Zn.cluster);const Pr=ss&&Zn&&!Ls(mr)?ya(ss,normalizeKey(mr),hi?.type)||Zn.fillColor:Zn.fillColor||An.geneFill;Dn.push({id:Pn.gAId,label:Zn.metadata?Zn.metadata[yn||Vt]:Zn.id,color:Pr,stroke:Array.isArray(Pr)?da(Pr):null})}if(Nn.colorBy==="target_gene"&&sr){const fr=yn||Vt||"cluster";let mr=sr.metadata&&sr.metadata[fr];Ls(mr)&&fr==="cluster"&&(mr=sr.cluster);const Pr=ss&&sr&&!Ls(mr)?ya(ss,normalizeKey(mr),hi?.type)||sr.fillColor:sr.fillColor||An.geneFill;Dn.push({id:Pn.gBId,label:sr.metadata?sr.metadata[yn||Vt]:sr.id,color:Pr,stroke:Array.isArray(Pr)?da(Pr):null})}});const On=new Map;Dn.forEach(Pn=>{Pn&&Pn.id&&!On.has(Pn.id)&&On.set(Pn.id,Pn)}),kn.proteinLinks={mode:Nn.colorBy,mapping:Array.from(On.values())}}else kn.proteinLinks={mode:Nn.colorBy,solidColor:Nn.solidColor||null,useAlpha:Nn.useAlpha,minAlpha:Nn.minAlpha,maxAlpha:Nn.maxAlpha}}if(En&&Array.isArray(En.nucleotideLinks)&&En.nucleotideLinks.length>0){const Nn=Tn||{};if(Nn.colorBy==="identity_gradient"&&Nn.palette&&Nn.palette.enabled){const Dn=En.nucleotideLinks.map(sr=>typeof sr.similarity=="number"?sr.similarity:0),On=Math.min(...Dn),Pn=Math.max(...Dn);let Zn=[];try{Zn=nr(Nn.palette.name,Nn.palette.numColors||8,Nn.palette.reverse||!1)}catch{Zn=[]}kn.nucleotideLinks={mode:"identity_gradient",minSim:On,maxSim:Pn,palette:Zn}}else if(Nn.colorBy==="source_gene"||Nn.colorBy==="target_gene"){const Dn=[];En.nucleotideLinks.forEach(Pn=>{const Zn=En.genesById&&En.genesById[Pn.gAId],sr=En.genesById&&En.genesById[Pn.gBId];if(Nn.colorBy==="source_gene"&&Zn){const fr=Zn.metadata&&Zn.metadata[yn||Vt]||Zn.cluster,mr=ss&&Zn&&fr?ya(ss,fr,hi?.type)||Zn.fillColor:Zn.fillColor||An.geneFill;Dn.push({id:Pn.gAId,label:Zn.metadata?Zn.metadata[yn||Vt]:Zn.id,color:mr,stroke:Array.isArray(mr)?da(mr):null})}if(Nn.colorBy==="target_gene"&&sr){const fr=sr.metadata&&sr.metadata[yn||Vt]||sr.cluster,mr=ss&&sr&&fr?ya(ss,fr,hi?.type)||sr.fillColor:sr.fillColor||An.geneFill;Dn.push({id:Pn.gBId,label:sr.metadata?sr.metadata[yn||Vt]:sr.id,color:mr,stroke:Array.isArray(mr)?da(mr):null})}});const On=new Map;Dn.forEach(Pn=>{Pn&&Pn.id&&!On.has(Pn.id)&&On.set(Pn.id,Pn)}),kn.nucleotideLinks={mode:Nn.colorBy,mapping:Array.from(On.values())}}else kn.nucleotideLinks={mode:Nn.colorBy,solidColor:Nn.solidColor||null,useAlpha:Nn.useAlpha,minAlpha:Nn.minAlpha,maxAlpha:Nn.maxAlpha}}try{const Nn=En?En.getAllRegions():[];if(Nn.length>0){const Dn={};if(Nn.forEach(On=>{if(On.fillColor){const Pn=On.getColorKey();Pn!=null&&Pn!==""&&(Dn[String(Pn)]=On.fillColor)}}),Object.keys(Dn).length>0)kn.regions=Dn;else{const On={};Nn.forEach(Pn=>{const Zn=Pn.metadata&&(Pn.metadata.region_type||Pn.metadata.type)?String(Pn.metadata.region_type||Pn.metadata.type):Pn.name||Pn.id||"region",sr=Pn.fillColor||Pn.color||null,fr=Pn.strokeColor||(Array.isArray(sr)?da(sr):null);On[Zn]={color:sr,stroke:fr}}),kn.regions=On}}}catch{}try{const Nn=En?En.getAllNonCodingFeatures():[];if(Nn&&Nn.length>0){const Dn=new Map;Nn.forEach(On=>{const Pn=On.metadata&&On.metadata.type?String(On.metadata.type):On.name||On.id||"ncRNA",Zn=On.fillColor||On.color||null,sr=On.strokeColor||(Array.isArray(Zn)?da(Zn):null);Dn.has(Pn)||Dn.set(Pn,{label:String(Pn),color:Zn,stroke:sr})}),kn.ncRNAs=Array.from(Dn.values())}}catch{}}catch{}return kn},[Un,ss,xl,yn,Vt,An.geneFill,hi,us,Ht,Gt,Li,mn,vn,Rn,Tn,qt]),Ll=React.useRef(null);React.useEffect(()=>{if(typeof Rt!="function"){try{console.debug("[Legend] onLegendChange not provided or not a function:",Rt)}catch{}return}try{const En=Jl();if(!En||typeof En!="object")return;let kn=null;try{kn=JSON.stringify(En)}catch{kn=String(En)}if(Ll.current!==kn){Ll.current=kn;try{(Nn=>!Nn||typeof Nn!="object"?!1:Object.keys(Nn).some(Dn=>{const On=Nn[Dn];return On==null?!1:!!(Array.isArray(On)&&On.length>0||typeof On=="object"&&Object.keys(On).length>0)}))(En)}catch{}try{const Vn={};try{En.genes&&(Vn.genes=Array.isArray(En.genes)?En.genes.length:Object.keys(En.genes||{}).length),En.phylo&&(Vn.phylo=Array.isArray(En.phylo)?En.phylo.length:0),En.regions&&(Vn.regions=Array.isArray(En.regions)?En.regions.length:Object.keys(En.regions||{}).length),En.ncRNAs&&(Vn.ncRNAs=Array.isArray(En.ncRNAs)?En.ncRNAs.length:Object.keys(En.ncRNAs||{}).length),En.proteinLinks&&(Vn.proteinLinks=typeof En.proteinLinks=="object"?Object.keys(En.proteinLinks).length:0),En.nucleotideLinks&&(Vn.nucleotideLinks=typeof En.nucleotideLinks=="object"?Object.keys(En.nucleotideLinks).length:0)}catch{}}catch{}Rt(En)}}catch{}},[Jl,Rt]);const uc=React.useRef(null);React.useEffect(()=>{if(Un)try{const kn=[Un?Object.keys(Un.genesById||{}).length:0,Nt&&typeof Nt=="object"?Object.keys(Nt).length:0,Rn?JSON.stringify(Rn):"",Tn?JSON.stringify(Tn):"",String(yn||""),String(Vt||"")].join("|");uc.current!==kn&&(uc.current=kn,wi(Vn=>Vn+1))}catch{wi(kn=>kn+1)}},[Un,Nt,jt,Rn,Tn,yn,Vt]);const Xa=React.useMemo(()=>{if(!Un||!Bs?.enabled)return null;let En=Un.getAllDomains();$n&&$n!=="all"&&(En=En.filter(fr=>{const mr=fr&&(fr.source||fr.metadata&&fr.metadata.source)||null;return String(mr)===String($n)}));const kn=En.map(fr=>{if(Mn==="domainName")return fr.domainName;const mr=jl(fr,Mn);return mr!==void 0&&mr!==""?mr:void 0}).filter(fr=>fr!=null&&fr!==""),Vn=[...new Set(kn)];if(Vn.length===0)return null;const Dn=Vn.map(fr=>uo(fr)).filter(fr=>!isNaN(fr)).length===Vn.length&&Vn.length>0;let On=Bs.reverse||!1;const Pn=String(Mn).toLowerCase()==="evalue"||String(Mn).toLowerCase()==="e_value";Bs.type==="sequential"&&Dn&&Pn&&(On=!On);const Zn=nr(Bs.name,Bs.numColors&&Bs.type==="sequential"?Bs.numColors:Math.max(Vn.length,Bs.numColors||Vn.length),On,Bs.type||"qualitative"),sr=new Map;if(Bs.type==="sequential"&&Dn){const fr=Vn.map(Wr=>uo(Wr));let mr=fr.slice();(String(Mn).toLowerCase()==="evalue"||String(Mn).toLowerCase()==="e_value")&&(mr=fr.map(Wr=>!isFinite(Wr)||Wr<=0?-Math.log10(Number.MIN_VALUE):-Math.log10(Wr)),mr=mr.map(Wr=>Math.log2(1+Math.max(0,Wr))));const Pr=Math.max(...mr);let Ur=128,Rr=255;try{if(Bs.alphaRange&&Array.isArray(Bs.alphaRange)&&Bs.alphaRange.length===2){let Wr=Number(Bs.alphaRange[0]),$r=Number(Bs.alphaRange[1]);!isNaN(Wr)&&!isNaN($r)&&(Wr<=1&&$r<=1&&(Wr=Wr*255,$r=$r*255),Ur=Math.max(0,Math.min(255,Math.round(Wr))),Rr=Math.max(0,Math.min(255,Math.round($r))))}}catch{}Vn.forEach((Wr,$r)=>{const qr=fr[$r],Vr=mr[$r],Ei=Pr>0?Vr/Pr:0,Di=Math.floor(Ei*(Zn.length-1)),Hi=Zn[Di]||[0,0,0,255],Pi=Math.round(Ur+(Rr-Ur)*Ei),Qi=[Hi[0]!==void 0?Hi[0]:0,Hi[1]!==void 0?Hi[1]:0,Hi[2]!==void 0?Hi[2]:0,Pi];try{sr.set(qr,Qi)}catch{}try{sr.set(String(qr),Qi)}catch{}try{sr.set(String(Wr),Qi)}catch{}})}else Vn.forEach((fr,mr)=>{sr.set(String(fr),Zn[mr%Zn.length]);const Pr=uo(fr);isNaN(Pr)||sr.set(Pr,Zn[mr%Zn.length])});return sr},[Un,Bs,Mn,$n]);React.useEffect(()=>{try{if(!Un)return;const kn=Un.getAllDomains().map(On=>Mn==="domainName"?On.domainName:jl(On,Mn)).filter(On=>On!=null&&On!==""),Vn=[...new Set(kn)],Dn=Vn.map(On=>uo(On)).filter(On=>!isNaN(On)).length===Vn.length&&Vn.length>0}catch(En){console.error("ColorSelect domain logging error",En)}},[Mn,Un,Xa,Bs?.name,Bs?.type,$n]),React.useMemo(()=>{const En=[],kn=_l||ss;if(kn&&kn.size>0){const Dn=new Set,On=[];for(const[sr,fr]of kn.entries())if(typeof sr=="string"){const mr=String(sr).trim();!Dn.has(mr)&&mr.length>0&&(Dn.add(mr),On.push({label:mr,color:fr}))}const Pn=[],Zn=new Set;for(const sr of On)Zn.has(sr.label)||(Zn.add(sr.label),Pn.push(sr));Pn.length>0&&En.push({id:"genes",title:"Gene families",items:Pn.slice(0,20)})}if(Li&&Li.enabled&&us&&Ht&&Gt){const Dn=new Set;us.leafNodes.forEach(Pn=>{const sr=(Ht[Pn.name]||{})[Gt];sr!=null&&sr!==""&&Dn.add(String(sr))});const On=Array.from(Dn).sort();if(On.length>0){let Pn=[];try{Pn=nr(Li.name,Math.max(On.length,Li.numColors||On.length),Li.reverse||!1)}catch{Pn=[]}const Zn=On.map((sr,fr)=>({label:sr,color:Pn[fr%(Pn.length||1)]||[0,0,0,255]}));En.push({id:"phylo",title:"Phylo labels",items:Zn})}}const Vn=[];Un&&Object.values(Un.ncRNAsById||{}).slice(0,20).forEach(Dn=>{const On=Dn.name||Dn.originalId||Dn.id||"ncRNA",Pn=Dn.fillColor||Dn.color||[0,0,0,255];Vn.push({label:String(On),color:Pn})}),Vn.length>0&&En.push({id:"ncrna",title:"ncRNAs",items:Vn});const Nn=Un.getAllRegions();if(Nn.length>0){const Dn=new Map;if(Nn.forEach(On=>{if(On.fillColor){const Pn=On.getColorKey();Pn!=null&&Pn!==""&&Dn.set(Pn,On.fillColor)}}),Dn.size>0){const On=Array.from(Dn.entries()).map(([Pn,Zn])=>({label:String(Pn),color:Zn}));En.push({id:"regions",title:"Regions",items:On})}}if(Rn)if(Rn.palette&&Rn.palette.enabled||Rn.colorBy==="identity_gradient"){let Dn=[];try{Dn=nr(Rn.palette?.name||DEFAULT_CONFIG$1.proteinLink.palette.name,Math.max(Rn.palette?.numColors||6,6),Rn.palette?.reverse||!1)}catch{Dn=[]}const On=(Dn.length>0?Dn:[[100,0,220,255]]).slice(0,12).map((Pn,Zn)=>({label:`${Zn+1}`,color:Pn}));En.push({id:"proteinLinks",title:"Protein links (palette)",items:On})}else Rn.colorBy==="source_gene"||Rn.colorBy==="target_gene"?En.push({id:"proteinLinks",title:"Protein links",note:`Colored by ${Rn.colorBy.replace("_"," ")}`}):En.push({id:"proteinLinks",title:"Protein links",items:[{label:"solid",color:Rn.solidColor||DEFAULT_CONFIG$1.proteinLink.solidColor}]});if(Tn)if(Tn.palette&&Tn.palette.enabled||Tn.colorBy==="identity_gradient"){let Dn=[];try{Dn=nr(Tn.palette?.name||DEFAULT_CONFIG$1.nucleotideLink.palette.name,Math.max(Tn.palette?.numColors||6,6),Tn.palette?.reverse||!1)}catch{Dn=[]}const On=(Dn.length>0?Dn:[[200,200,200,255]]).slice(0,12).map((Pn,Zn)=>({label:`${Zn+1}`,color:Pn}));En.push({id:"nucleotideLinks",title:"Nucleotide links (palette)",items:On})}else En.push({id:"nucleotideLinks",title:"Nucleotide links",items:[{label:"solid",color:Tn.solidColor||DEFAULT_CONFIG$1.nucleotideLink.solidColor}]});return En},[ss,_l,Li,us,Ht,Gt,JSON.stringify(Qt),JSON.stringify(mn),JSON.stringify(vn),Rn,Tn,An,mi]);const rl=React.useMemo(()=>{if(!Un||!us)return new Map;if((tn||qt.tree?.phyloLabelPosition||"after-tree")!=="after-tracks")return new Map;const kn=new Map;return us.leafNodes.forEach(Nn=>{kn.set(Nn.name,-1/0)}),Object.values(Un.genesById).forEach(Nn=>{const Dn=Nn.hood_id||Un.getHoodIdFromSeqid(Nn.seqid);if(Dn&&kn.has(Dn)){const On=kn.get(Dn);kn.set(Dn,Math.max(On,Math.max(Nn.start,Nn.end)))}}),Object.values(Un.ncRNAsById).forEach(Nn=>{const Dn=Nn.hood_id||Un.getHoodIdFromSeqid(Nn.seqid);if(Dn&&kn.has(Dn)){const On=kn.get(Dn);kn.set(Dn,Math.max(On,Math.max(Nn.start,Nn.end)))}}),Un.nucleotideLinks.filter(Nn=>Nn.hood).forEach(Nn=>{if(Nn.hood_id&&kn.has(Nn.hood_id)){const Dn=kn.get(Nn.hood_id);kn.set(Nn.hood_id,Math.max(Dn,Math.max(Nn.start,Nn.end)))}}),kn},[Un,us,tn,qt.tree?.phyloLabelPosition,mi,ws,pn,Gt,Ht,Wt,Kn]),mo=React.useMemo(()=>{const En=JSON.stringify(Qt||qt?.colorPalettes?.genePalette||{}),kn=JSON.stringify(mn||qt?.colorPalettes?.ncRNAPalette||{}),Vn=JSON.stringify(vn||qt?.colorPalettes?.regionPalette||{}),Nn=JSON.stringify(fn||qt?.colorPalettes?.domainPalette||{}),Dn=JSON.stringify(Rn||{}),On=JSON.stringify(Tn||{});return`${En}|${kn}|${Vn}|${Nn}|${Dn}|${On}|${mi}`},[Qt,mn,vn,Rn,Tn,mi,qt]),na=React.useMemo(()=>{const En=new Map;if(!Un)return En;const kn=hi?.enabled,Vn=yn||Vt||"cluster",Nn=Dn=>{if(!Dn)return null;if(Array.isArray(Dn))return Dn.length>=3?Dn:null;if(typeof Dn=="string"){const On=Dn.split(",").map(Pn=>parseInt(Pn.trim(),10)).filter(Pn=>!isNaN(Pn));if(On.length>=3)return On.length===3?[...On,255]:On.slice(0,4)}return null};di&&di.size>0,Nt&&Object.keys(Nt).slice(0,3);for(const Dn in Un.genesById){const On=Un.genesById[Dn];let Pn=null;if(di&&(Pn=di.get(Dn)||di.get(On?.id)||di.get(On?.originalGeneId)||di.get(On?.gene_id),Dn.includes("gene_A1")),!Pn&&Nt){const Zn=On?.id||On?.gene_id||On?.originalGeneId||Dn,sr=Nt[Zn]||Nt[Dn];sr?.color&&(Pn=Nn(sr.color),Dn.includes("gene_A1"))}if(kn){if(!Pn&&ss){const Zn=On?.metadata?.[Vn];if(Zn!=null&&Zn!==""){const sr=normalizeKey(Zn);Pn=ya(ss,sr,hi?.type)}}if(!Pn&&Un.proteinClusters&&Un.proteinClusters[Dn]){const Zn=Un.proteinClusters[Dn];Un.clusterColors&&Un.clusterColors[Zn]&&(Pn=Un.clusterColors[Zn])}}En.set(Dn,Pn||null)}return[...En.entries()].filter(([,Dn])=>Dn!==null),En},[Un,Un?._paletteVersion,hi?.enabled,hi?.type,hi?.prevalenceFilter,mo,ss,yn,Vt,di,Nt]);React.useMemo(()=>{if(!Un)return[];const En=Ct instanceof Set?Ct:null,kn=Dn=>Dn?.gene_id||Dn?.originalGeneId||Dn?.originalId||Dn?.id||Dn?.uniqueId||"",Vn=Dn=>{const On=kn(Dn),Pn=Dn?.hood_id??Dn?.hoodId;return ii(Pn)||ti.size>0&&On&&ti.has(String(On))?!1:En&&On?En.has(String(On)):!0};if(ci)try{const Dn=Un.filterBySelectedNode(ci);if(Dn&&Array.isArray(Dn.genes))return Dn.genes.filter(Vn).map(On=>{const Pn=On.uniqueId||On.id||"";return{id:Pn,gene:On,start:On.start,end:On.end,strand:On.strand,trackY:On.trackY,fillColor:na.get(Pn)||An.geneFill||[200,200,200,255]}})}catch{}const Nn=Object.entries(Un.genesById).filter(([,Dn])=>Vn(Dn)).map(([Dn,On])=>({id:Dn,gene:On,start:On.start,end:On.end,strand:On.strand,trackY:On.trackY,fillColor:na.get(Dn)||An.geneFill||[200,200,200,255]}));return Nn.filter(Dn=>Dn.fillColor&&Dn.fillColor[0]!==200),Nn},[Un,Un?._paletteVersion,hi?.enabled,na,An,mo,Ct,ti,ii,ci,mi,Kn,gn]);const dl=React.useMemo(()=>JSON.stringify(Rn),[Rn]),Tl=React.useMemo(()=>JSON.stringify(Tn),[Tn]),Rl=React.useMemo(()=>{if(!Un||!Un.proteinLinks||!Array.isArray(Un.proteinLinks))return[];Rn&&Un.applyProteinLinkColors(Rn,An.geneFill);let En=null;if(ci&&Un.getNodeDescendantLeaves)try{const Vn=Un.getNodeDescendantLeaves(ci);Array.isArray(Vn)&&Vn.length>0&&(En=new Set(Vn))}catch(Vn){console.warn("[proteinLinkData] Error getting descendant leaves:",Vn)}const kn=Vn=>{if(!Vn)return null;const Nn=Vn.attributes;let Dn=null;if(Nn)if(typeof Nn=="string"){const On=Nn.match(/ID=([^;]+)/);Dn=On?On[1]:null}else typeof Nn=="object"&&(Dn=Nn.ID||Nn.gene_id||Nn.protein_id||null);return Vn.originalGeneId||Vn.gene_id||Dn||Vn.uniqueId};return Un.proteinLinks.filter(Vn=>{const Nn=Un.genesById[Vn.gAId],Dn=Un.genesById[Vn.gBId],On=Nn?.hood_id,Pn=Dn?.hood_id;if(ii(On)||ii(Pn))return!1;if(ti.size>0){const Zn=kn(Nn),sr=kn(Dn);if(Zn&&ti.has(String(Zn))||sr&&ti.has(String(sr)))return!1}return En?On&&Pn&&En.has(On)&&En.has(Pn):!0}).map((Vn,Nn)=>{let Dn=Vn.fillColor||[150,150,150,255];if(hi?.transparentByPrevalence&&ss){const On=Un.genesById[Vn.gAId],Pn=Un.genesById[Vn.gBId],Zn=yn||Vt||"cluster";let sr=On?.metadata?.[Zn];(sr==null||sr==="")&&Zn==="cluster"&&(sr=On?.metadata?.clusterId??On?.metadata?.cluster_id??On?.cluster);const fr=sr!=null&&sr!==""?ya(ss,sr,hi?.type):null;let mr=Pn?.metadata?.[Zn];(mr==null||mr==="")&&Zn==="cluster"&&(mr=Pn?.metadata?.clusterId??Pn?.metadata?.cluster_id??Pn?.cluster);const Pr=mr!=null&&mr!==""?ya(ss,mr,hi?.type):null,Ur=fr&&Array.isArray(fr)&&fr.length>=4?fr[3]/255:0,Rr=Pr&&Array.isArray(Pr)&&Pr.length>=4?Pr[3]/255:0,Wr=Math.min(Ur,Rr),$r=Array.isArray(Dn)&&Dn.length>=4?Dn[3]/255:1,qr=Math.round($r*Wr*255);Dn=Array.isArray(Dn)?[Dn[0],Dn[1],Dn[2],qr]:Dn}return{id:`${Vn.gAId}|${Vn.gBId}|${Nn}`,gAId:Vn.gAId,gBId:Vn.gBId,metadata:Vn.metadata||Vn,fillColor:Dn,_k:`${mi}_${Nn}`}})},[Un,Un?.proteinLinks,Un?._paletteVersion,mo,mi,dl,ss,ci,ii,ti,hi?.enabled,hi?.transparentByPrevalence,hi?.prevalenceFilter,yn,Vt,An.geneFill]);React.useEffect(()=>{},[ci]);const Ma=React.useMemo(()=>{if(!Un||!Un.nucleotideLinks||!Array.isArray(Un.nucleotideLinks))return[];Tn&&Un.applyNucleotideLinkColors(Tn);let En=null;if(ci&&Un.getNodeDescendantLeaves)try{const Vn=Un.getNodeDescendantLeaves(ci);Array.isArray(Vn)&&Vn.length>0&&(En=new Set(Vn))}catch{}return Un.nucleotideLinks.filter(Vn=>{const Nn=Vn.hoodA,Dn=Vn.hoodB;if(ii(Nn)||ii(Dn))return!1;if(!En)return!0;const On=En.has(Nn),Pn=En.has(Dn),Zn=On&&Pn;return!Zn&&Un.nucleotideLinks.indexOf(Vn)<5,Zn}).map((Vn,Nn)=>({id:`${Vn.seqidA}:${Vn.startA}-${Vn.endA}|${Vn.seqidB}:${Vn.startB}-${Vn.endB}|${Nn}`,seqidA:Vn.seqidA,seqidB:Vn.seqidB,hoodA:Vn.hoodA||Vn.seqidA,hoodB:Vn.hoodB||Vn.seqidB,hoodStartA:Vn.hoodStartA??Vn.startA,hoodEndA:Vn.hoodEndA??Vn.endA,hoodStartB:Vn.hoodStartB??Vn.startB,hoodEndB:Vn.hoodEndB??Vn.endB,similarity:Vn.similarity,metadata:{similarity:Vn.similarity},fillColor:Vn.fillColor||[200,100,100,255],_k:`${mi}_${Nn}`}))},[Un,Un?.nucleotideLinks,mo,mi,Tl,ci,ii]),kr=React.useMemo(()=>{const En=ir||qt,kn=typeof nn=="number"?nn:En.gene?.height||En.gene?.defaultHeight||DEFAULT_CONFIG$1.gene.height,Vn=typeof Zt=="number"?Zt:En.gene?.arrowheadHeight??DEFAULT_CONFIG$1.gene.arrowheadHeight,Nn=typeof gn=="number"?gn:En.tree?.ySpacing||DEFAULT_CONFIG$1.tree.ySpacing,Dn=typeof Kn=="number"?Kn:En.genome?.xScalePercent||DEFAULT_CONFIG$1.genome.xScalePercent,On=typeof Hn=="number"?Hn:En.gene?.edgeWidth||DEFAULT_CONFIG$1.gene.edgeWidth,Pn=typeof wn=="number"?wn:En.text?.phyloLabelSize||DEFAULT_CONFIG$1.text.phyloLabelSize,Zn=typeof Xn=="number"?Xn:En.text?.geneLabelSize||DEFAULT_CONFIG$1.text.geneLabelSize,sr=typeof tr=="number"?tr:En.text?.rulerLabelSize||DEFAULT_CONFIG$1.text.rulerLabelSize;return{...En,debug:{...En.debug,alignment:En?.debug?.alignment||!1},tree:{...En.tree,xScalePercent:ws,ySpacing:Nn},gene:{...En.gene,height:kn,arrowheadHeight:Vn,edgeWidth:On,tipWidthMode:rn??En.gene?.tipWidthMode??DEFAULT_CONFIG$1.gene.tipWidthMode,tipWidthFactor:on??En.gene?.tipWidthFactor??DEFAULT_CONFIG$1.gene.tipWidthFactor,tipWidthFixed:ln??En.gene?.tipWidthFixed??DEFAULT_CONFIG$1.gene.tipWidthFixed},genome:{...En.genome,xScalePercent:Dn},domain:{...En.domain},text:{...En.text,phyloLabelSize:Pn,geneLabelSize:Zn,rulerLabelSize:sr},stroke:{...En.stroke,lineWidth:On}}},[ir,qt,ws,nn,Zt,rn,on,ln,gn,Kn,Hn,wn,Xn,tr]);reactExports.useEffect(()=>{if(!ys||ys.length===0)return;const En=An.treeEdges||[100,180,255,255],kn=ys[0]?.color;(!kn||En[0]!==kn[0]||En[1]!==kn[1]||En[2]!==kn[2])&&Va(Nn=>Nn?Nn.map(Dn=>({...Dn,color:En})):null)},[An.treeEdges,ys?.length]),reactExports.useEffect(()=>{if(!ys||ys.length===0||!Ts.current?.nodes)return;const En=ys[0]?.id;if(!En)return;const kn=requestAnimationFrame(()=>{const Vn=Ts.current.nodes.find(Nn=>Nn.id===En);if(Vn){const Nn=(kr.tree?.xScalePercent||100)/100,Dn=Ii?.treeOffset||0,On=Number(Vn.rawY),Pn=Number(Vn.x);if(Number.isFinite(On)&&Number.isFinite(Pn)){const Zn=[On*Nn+Dn,Pn];Va(sr=>sr?sr.map(fr=>({...fr,position:Zn})):null)}}});return()=>cancelAnimationFrame(kn)},[kr.tree?.xScalePercent,Ii?.treeOffset,kr.tree?.ySpacing,ys?.[0]?.id]),reactExports.useEffect(()=>{if(!Wi||Wi.length===0||!Ts.current?.nodes)return;const En=Wi[0]?.id;if(!En)return;const kn=requestAnimationFrame(()=>{const Vn=Ts.current.nodes.find(Nn=>Nn.id===En||Nn.name===En||Nn.leaf_id===En||Nn.node?.id===En||Nn.node?.name===En||Nn.node?.leaf_id===En);if(Vn){const Nn=(kr.tree?.xScalePercent||100)/100,Dn=Ii?.treeOffset||0,On=Number(Vn.rawY),Pn=Number(Vn.x);if(Number.isFinite(On)&&Number.isFinite(Pn)){const Zn=[On*Nn+Dn,Pn];Mo(sr=>sr?sr.map(fr=>({...fr,position:Zn})):null)}}});return()=>cancelAnimationFrame(kn)},[kr.tree?.xScalePercent,Ii?.treeOffset,kr.tree?.ySpacing,Wi?.[0]?.id]);const kl=React.useCallback((En,kn=null)=>{if(!En)return null;const Vn=kr.gene?.height||kr.gene?.geneHeight||20,Nn=kr.gene?.arrowheadHeight||10,Dn=(kr.genome?.xScalePercent||100)/100,On=En.gene||En,Pn=kn??En.trackY??On.trackY??0,Zn=(En.start??On.start)*Dn,sr=(En.end??On.end)*Dn,fr=En.strand??On.strand,mr=Vn/2,Pr=Nn/2,Ur=Math.abs(sr-Zn),Rr=calculateTipWidth(Ur,kr);if(Rr<1){const Wr=Math.min(Zn,sr),$r=Math.max(Zn,sr);return[[Wr,Pn-mr],[$r,Pn-mr],[$r,Pn+mr],[Wr,Pn+mr]]}if(fr==="+"||fr===1){const Wr=Math.max(Zn,sr-Rr);return[[Zn,Pn-mr],[Wr,Pn-mr],[Wr,Pn-mr-Pr],[sr,Pn],[Wr,Pn+mr+Pr],[Wr,Pn+mr],[Zn,Pn+mr]]}else{const Wr=Math.min(sr,Zn+Rr);return[[sr,Pn-mr],[Wr,Pn-mr],[Wr,Pn-mr-Pr],[Zn,Pn],[Wr,Pn+mr+Pr],[Wr,Pn+mr],[sr,Pn+mr]]}},[kr.gene?.height,kr.gene?.geneHeight,kr.gene?.arrowheadHeight,kr.genome?.xScalePercent,kr.gene?.tipWidthFactor,kr.gene?.tipWidthMode,kr.gene?.tipWidthFixed]);reactExports.useEffect(()=>{if(!Mi||Mi.length===0)return;const En=Mi[0];if(En.polygon&&Array.isArray(En.polygon)&&En.polygon.length>0)return;const kn=En.gene||En,Vn=En.id||En.uniqueId||En.gene?.uniqueId||En.gene?.id,Nn=kn.hood_id||En.hood_id;let Dn=null;if(Un&&Nn&&typeof Un.getTrackYByHoodId=="function"&&(Dn=Un.getTrackYByHoodId(Nn)),Dn===null&&Un&&Vn&&Un.genesById){const sr=Un.genesById[Vn];sr&&(Dn=sr.trackY)}const Pn=ss?.get?.(Vn)||En.fillColor||En.gene?.fillColor||An.geneFill||qt.gene?.fillColor||[100,200,255,255],Zn=kl(En,Dn);Zn&&Wa(sr=>!sr||sr.length===0?null:sr.map(fr=>({...fr,polygon:Zn,fillColor:Pn,trackY:Dn??fr.trackY})))},[Mi,kl,An.geneFill,qt.gene?.fillColor,ss,Un]),reactExports.useEffect(()=>{if(!Mi||Mi.length===0||!Un||!Mi[0]?.polygon)return;const En=Mi[0],kn=En.id||En.uniqueId||En.gene?.uniqueId||En.gene?.id,Vn=En.gene||En,Nn=Vn.hood_id||En.hood_id,Dn=requestAnimationFrame(()=>{let On=null,Pn=En.start??Vn.start,Zn=En.end??Vn.end,sr=En.strand??Vn.strand;if(kn&&Un.genesById){const Rr=Un.genesById[kn];Rr&&(On=Rr.trackY,Pn=Rr.start,Zn=Rr.end,sr=Rr.strand)}On===null&&Nn&&typeof Un.getTrackYByHoodId=="function"&&(On=Un.getTrackYByHoodId(Nn));const mr=ss?.get?.(kn)||En.fillColor||En.gene?.fillColor||An.geneFill||qt.gene?.fillColor||[100,200,255,255],Pr={...En,start:Pn,end:Zn,strand:sr,trackY:On??En.trackY},Ur=kl(Pr,On);Ur&&Wa(Rr=>!Rr||Rr.length===0?null:Rr.map(Wr=>({...Wr,polygon:Ur,fillColor:mr,start:Pn,end:Zn,strand:sr,trackY:On??Wr.trackY})))});return()=>cancelAnimationFrame(Dn)},[An.geneFill,qt.gene?.fillColor,kr.gene?.height,kr.gene?.geneHeight,kr.gene?.arrowheadHeight,kr.genome?.xScalePercent,kr.gene?.tipWidthFactor,kr.tree?.ySpacing,gn,Kn,mi,ss,kl,Un]),reactExports.useEffect(()=>{if(!_o||_o.length===0||!Un)return;const kn=_o[0].id;if(!kn)return;const Vn=requestAnimationFrame(()=>{const On=(Un.getAllRegions?.()||[]).find(Pn=>Pn.id===kn);On&&lo(Pn=>{if(!Pn||Pn.length===0)return null;const Zn=On.fillColor||On.strokeColor||[255,180,50,255];return Pn.map(sr=>({...sr,polygon:On.polygon,startX:On.start,endX:On.end,strokeColor:Zn,fillColor:Zn,trackY:On.trackY}))})});return()=>cancelAnimationFrame(Vn)},[Un,kr.gene?.height,kr.gene?.geneHeight,kr.gene?.arrowheadHeight,kr.region?.padding,kr.tree?.ySpacing,kr.genome?.xScalePercent,gn,Kn,mi,mo]);const bo=React.useMemo(()=>{if(!Un||!us)return new Set;let En=Un.leaves||[];if(ci)try{const kn=typeof Un.getNodeDescendantLeaves=="function"?Un.getNodeDescendantLeaves(ci):us&&typeof us.getNodeDescendantLeaves=="function"?us.getNodeDescendantLeaves(ci):[];En=Array.isArray(kn)?kn:[]}catch{En=Un.leaves||[]}if(Qn){const kn=typeof Qn=="string"?Qn:Qn?.id!=null?String(Qn.id):null;kn&&!new Set(En).has(kn)&&(En=[...En,kn])}return new Set(En)},[Un,us,ci,Qn,gr]),Ys=React.useMemo(()=>{if(performance.now(),!Un||!us)return[];const En=`${Object.keys(Un.genesById).length}:${kr.gene.height}:${kr.gene.arrowheadHeight}:${kr.domain.heightFactor||.6}:${kr.genome.xScalePercent}:${kr.tree.ySpacing}:${mi}:${Lt}:${Pt||""}:${kt}:${ci?.id??"null"}:${bo.size}:${gr.size}:${ti.size}:${kr.gene.tipWidthMode}:${kr.gene.tipWidthFactor}:${kr.gene.tipWidthFixed}`,kn=qo.current===En,Vn=al.current===ws,Nn=qo.current===null,Dn=kn&&!Vn,On=kn&&Vn;if((Dn||On)&&!Nn)al.current=ws,Un.config=kr;else{const Fn=performance.now();try{Un.config=kr,typeof Un.computeTrackPositions=="function"&&Un.computeTrackPositions();const Gn=performance.now();for(const er in Un.genesById){const Er=Un.genesById[er];if(Er&&(Er.config=kr,Er.geneHeight=kr.gene.height,typeof Er.updatePolygon=="function"))try{Er.updatePolygon()}catch{}}}catch{}performance.now();for(const Gn in Un.ncRNAsById){const er=Un.ncRNAsById[Gn];er.config=kr,typeof kr?.gene?.height=="number"&&(er.featureHeight=kr.gene.height),er.updatePolygon&&er.updatePolygon()}performance.now();for(const Gn in Un.genesById){const er=Un.genesById[Gn];if(er&&er.domains)for(const Er of er.domains)Er.config=kr,Er.updatePolygon&&Er.updatePolygon()}Un._cachedAllDomains=void 0,performance.now(),Un.proteinLinks&&Un.proteinLinks.forEach(Gn=>{Gn.config=kr,Gn.updatePolygon&&Gn.updatePolygon()}),performance.now(),Un.nucleotideLinks&&Un.nucleotideLinks.forEach(Gn=>{Gn.config=kr,Gn.updatePolygon&&Gn.updatePolygon()}),performance.now(),Un.getAllRegions().forEach(Gn=>{Gn.config=kr;const er=Un.getTrackYByHoodId(Gn.hood_id);er!=null&&Gn.updatePolygon([],er)}),performance.now()-Fn,qo.current=En,al.current=ws,To.current=null}const Pn=`${En}:${ws}:${ci?.id??"null"}:${tn}:${Xt}`,Zn=On&&To.current===Pn,sr=`${Object.keys(Un.genesById).length}:${mi}:${ws}:${ci?.id??"null"}:${Xt}:${Lt}:${Pt||""}:${kt}:${gr.size}:${bo.size}:${kr.tree.ySpacing}:${kr.genome.xScalePercent}:${tn}:${wn}`,fr=$l.current?.signature===sr,mr=Ts.current?.structuralSignature===sr;performance.now();const Pr=vo(Un,us,tn,ws,!0,ms),Ur=Pr.treeOffset||0;Zl.current=Pr,performance.now();const Rr=(Ql||[]).map((Fn,Ln)=>({...Fn,polygon:Fn.polygon,fillColor:Fn.fillColor||An.proteinFill||Fn.fillColor,_alignmentKey:`${mi}_${Ln}`}));performance.now();const Wr=(so||[]).map((Fn,Ln)=>({...Fn,polygon:Fn.polygon,fillColor:Fn.fillColor||An.nucleotideFill||Fn.fillColor,_alignmentKey:`${mi}_${Ln}`}));performance.now();const $r=Fn=>{if(ti.size===0)return!1;const Ln=Fn.gene_id||Fn.geneId||Fn.metadata?.gene_id||Fn.metadata?.geneId||Fn.metadata?.Parent;return Ln?ti.has(String(Ln)):!1},qr=(Un.getAllRegions()||[]).filter(Fn=>{if(ii(Fn.hood_id)||$r(Fn))return!1;if(!ci)return!0;try{return bo.has(Fn.hood_id)}catch{return!0}}).map(Fn=>{let Ln=Fn.fillColor,Gn,er;return!Ln||Array.isArray(Ln)&&Ln[3]===0?(Gn=Fn.strokeColor||[100,100,100,255],er=[0,0,0,0]):(Gn=Ln,er=[0,0,0,0]),{polygon:Fn.polygon,fillColor:er,strokeColor:Gn,strokeWidth:Fn.strokeWidth,metadata:Fn.metadata,hood_id:Fn.hood_id,seqid:Fn.seqid,start:Fn.start,end:Fn.end,trackY:Fn.trackY,type:Fn.type||"region",id:Fn.id||Fn.metadata?.ID||`${Fn.hood_id}:${Fn.start}-${Fn.end}`}});Ta.current=qr,performance.now(),performance.now();const Vr=Un.getAllDomains();let ri=[];const Ei=Fn=>{const Gn=(Fn.gene||Fn.geneId&&Un.genesById[Fn.geneId])?.hood_id??Fn.hood_id;return ii(Gn)},Di=Fn=>{if(ti.size===0)return!1;const Ln=Fn.gene||Fn.geneId&&Un.genesById[Fn.geneId];if(!Ln)return!1;const Gn=typeof Ln.attributes=="string"?Ln.attributes.match(/ID=([^;]+)/)?.[1]||null:Ln.attributes?.ID||null,er=Ln.originalGeneId||Ln.gene_id||Gn||Fn.geneId;return er&&ti.has(String(er))};if(Vr.length!==0){let Fn=Vr;if(ci)try{const Ln=Un.filterBySelectedNode(ci);Ln&&Array.isArray(Ln.domains)&&(Fn=Ln.domains)}catch{}$n&&$n!=="all"&&(Fn=Fn.filter(Ln=>{const Gn=Ln&&(Ln.source||Ln.metadata&&Ln.metadata.source)||null;return String(Gn)===String($n)})),gr.size>0&&(Fn=Fn.filter(Ln=>!Ei(Ln))),ti.size>0&&(Fn=Fn.filter(Ln=>!Di(Ln))),performance.now(),ri=Fn.map(Ln=>{let Gn;if(!Bs||!Bs.enabled?Gn=An.domainFill:Gn=Ln.fillColor||An.domainFill,Xa){const er=Mn==="domainName"?Ln.domainName:jl(Ln,Mn);if(er!==void 0){const Er=ya(Xa,er,Bs?.type);Er&&(Gn=Er)}}if(hi?.transparentByPrevalence&&Ln.geneId&&ss){const er=Un.genesById[Ln.geneId];if(er){const Er=yn||Vt||"cluster";let Tr=er?.metadata?.[Er];(Tr==null||Tr==="")&&Er==="cluster"&&(Tr=er?.metadata?.clusterId??er?.metadata?.cluster_id??er?.cluster);const ai=Tr!=null&&Tr!==""?ya(ss,Tr,hi?.type):null;if(ai&&Array.isArray(ai)&&ai.length>=4){const Yr=ai[3]/255,li=Array.isArray(Gn)&&Gn.length>=4?Gn[3]/255:1,yi=Math.round(li*Yr*255);Gn=Array.isArray(Gn)?[Gn[0],Gn[1],Gn[2],yi]:Gn}else ai||(Gn=Array.isArray(Gn)?[Gn[0],Gn[1],Gn[2],0]:Gn)}}return{...Ln,fillColor:Gn,polygon:Ln.polygon?[...Ln.polygon]:null}})}performance.now();let Hi;if(fr)Hi=$l.current.data;else{const Fn=er=>{const Er=Un.hoodRanges[er],Tr=Un.hoodToSeqidMap[er],ai=Un.nucleotidesBySeqid[Tr];if(!Er||!ai)return null;const Yr=Un.trackOffset[er]||0,li=!!Un.trackFlipped[er],yi=Er.length/2,Ri=0,Ki=Er.length,ns=Un.constructor.getTransformedXUnified(Ri,yi,Yr,li),Vs=Un.constructor.getTransformedXUnified(Ki,yi,Yr,li),Ps=kr.genome&&typeof kr.genome.xScalePercent=="number"?kr.genome.xScalePercent/100:1,ks=yi+(ns-yi)*Ps,Ms=yi+(Vs-yi)*Ps,fo=Un.getTrackYByHoodId(er);return fo==null?null:{hood_id:er,seqid:Tr,start:ks,end:Ms,trackY:fo}},Ln=Object.keys(Un.hoodRanges||{});let Gn=ci?Array.from(bo):Ln;if(Gn.length||(Gn=Ln),Hi=Gn.filter(er=>!Un.hoodRanges[er]||gr.size>0&&(gr.has(String(er))||gr.has(Number(er)))?!1:Un.getTrackYByHoodId(er)!=null).map(Fn).filter(Boolean),!Hi.length&&Gn.length){try{Un.computeTrackPositions()}catch{}Hi=Gn.filter(er=>!Un.hoodRanges[er]||gr.size>0&&(gr.has(String(er))||gr.has(Number(er)))?!1:Un.getTrackYByHoodId(er)!=null).map(Fn).filter(Boolean)}$l.current={data:Hi,signature:sr}}performance.now();const Pi=po?us.buildEdges().filter(Fn=>{if(!ci)return!0;try{const Ln=Un.getNodeDescendantLeaves(Fn.target)||[];return!Array.isArray(Ln)||Ln.length===0?!1:Ln.every(Gn=>bo.has(Gn))}catch{return!1}}).map(Fn=>({rawPath:Fn.path,metadata:{source:Fn.source.name||`internal_${Fn.source.id}`,target:Fn.target.name||`internal_${Fn.target.id}`,length:Fn.target.branchLength||0,type:"phylo_edge"},color:An?.treeEdges||qt.tree.edgeColor||[85,85,85,255]})):[];performance.now();const Qi=tn||qt.tree?.phyloLabelPosition||"after-tree",Si=sn!==void 0?sn:qt.tree?.alignLabels!==void 0?qt.tree.alignLabels:!0,Ci=Wt?Array.isArray(Wt)?Wt:Wt.split(",").map(Fn=>Fn.trim()).filter(Boolean):null;let Ai=[],Xs="";if(po){let Fn=us.leafNodes.filter(er=>!ci||bo.has(er.name)).map(er=>{const Er=typeof _i=="function"?_i(er.name):Ht?.[er.name]||{};let Tr;if(Ci&&Ci.length>0){const Yr=Ci.map(li=>li==="name"?er.name:Er[li]).filter(li=>li!=null&&li!=="");Tr=Yr.length>0?Yr.join(" | "):er.name}else Tr=Er[Wt],Tr==null&&(Tr=er.name);typeof Tr!="string"&&(Tr=String(Tr));let ai;if(Li&&Li.enabled){const Yr=Er[Gt];Yr!=null?ai=nl(Yr):ai=An.phyloLabelFill||[0,0,0,255]}else ai=An.phyloLabelFill||[0,0,0,255];return{rawY:er.y,x:er.x,text:Tr,color:ai,size:kr.text.phyloLabelSize,textAnchor:"start",alignmentBaseline:"center",leafNode:er,labelPosition:Qi,rightmostX:Qi==="after-tracks"?rl.get(er.name):null}});const Ln=er=>{if(!er)return null;if(Array.isArray(er))return er.length>=3?er:null;if(typeof er=="string"){const Er=er.split(",").map(Tr=>parseInt(Tr.trim(),10)).filter(Tr=>!isNaN(Tr));if(Er.length>=3)return Er.length===3?[...Er,255]:Er.slice(0,4)}return null};let Gn;Li&&Li.enabled&&Ht?Gn=Ho(Fn,Gt,Ht,Li,cc?Sl:null).map(Er=>{if(Bi){const Yr=Bi.get(Er.leafNode.name);if(Yr)return{...Er,color:Yr}}const Tr=_i(Er.leafNode.name);if(Tr?.color){const Yr=Ln(Tr.color);if(Yr)return{...Er,color:Yr}}const ai=Ht?.[Er.leafNode.name]?.[Gt];return ai!=null&&ai!==""?Er:{...Er,color:An.phyloLabelFill}}):Gn=Fn.map(er=>{if(Bi){const Tr=Bi.get(er.leafNode.name);if(Tr)return{...er,color:Tr}}const Er=_i(er.leafNode.name);if(Er?.color){const Tr=Ln(Er.color);if(Tr)return{...er,color:Tr}}return{...er,color:An.phyloLabelFill}}),Ai=Gn.filter(er=>Number.isFinite(er.rawY)&&Number.isFinite(er.x)&&typeof er.text=="string"&&er.text.trim()!==""),Ai.length===0&&Ai.push({rawY:0,x:0,text:"_",color:[0,0,0,0],size:1,textAnchor:"start"}),Xs=Ai.map(er=>Array.isArray(er.color)?er.color.join(","):String(er.color)).join("|")}performance.now();const Ks=qt?.tree?.nodeRadius||{internal:4,leaf:2};let fa=`${us.allNodes.length}:${ci?.id||"null"}:${Ks?.internal||4}:${Ks?.leaf||2}:${Xt}:${kr.tree.ySpacing}`;const ra=po&&(mr||Zn)&&Ts.current&&Ts.current.geometrySignature===fa;let Qs;if(!po)Qs=[],fa="no-tree";else if(ra){const Fn=new Map;Ai&&Array.isArray(Ai)&&Ai.forEach(Ln=>{Ln.leafNode&&Ln.leafNode.name&&Fn.set(Ln.leafNode.name,Ln.color)}),Qs=Ts.current.nodes.map(Ln=>{let Gn;const er=Ln.node;return er.branchset.length>0?Gn=An.treeEdges||[0,0,0,255]:Gn=Fn.get(er.name)||An.treeEdges||[100,100,100,255],{...Ln,color:Gn}}),Ts.current={...Ts.current,nodes:Qs}}else{const Fn=ci?bo:null,Ln=new Map;Ai&&Array.isArray(Ai)&&Ai.forEach(Gn=>{Gn.leafNode&&Gn.leafNode.name&&Ln.set(Gn.leafNode.name,Gn.color)}),Qs=us.allNodes.filter(Gn=>{if(!ci)return!0;try{const er=Un.getNodeDescendantLeaves(Gn)||[];return er.length===0?!1:er.every(Er=>Fn.has(Er))}catch{return!1}}).map(Gn=>{const er=Un.getNodeDescendantLeaves(Gn);!ci||er.some(Ki=>Fn.has(Ki));let Er;const Tr=Gn.metadata||_i(Gn.name)||{},ai=Tr.leaf_id||Gn.leaf_id;if(!Gn.leaf_id&&ai&&(Gn.leaf_id=ai),!Gn.metadata&&Object.keys(Tr).length&&(Gn.metadata=Tr),Gn.branchset.length>0)Er=An.treeEdges||[0,0,0,255];else{const Ki=Ln.get(Gn.name);if(Ki)Er=Ki;else{const Vs=(Gn.metadata||{})[Gt];if(Vs&&Li&&Li.enabled)try{const ks=[...new Set(us.leafNodes.map(fo=>{const Qo=(Ht&&Ht[fo.name]||{})[Gt];return Qo!=null&&Qo!==""?Qo:null}).filter(fo=>fo!==null))].sort(),Ms=ks.indexOf(Vs);if(Ms>=0){const fo=nr(Li.name,Math.max(ks.length,Li.numColors||ks.length),Li.reverse||!1);fo&&fo[Ms]?Er=fo[Ms]:Er=An.treeEdges||[100,100,100,255]}else Er=An.treeEdges||[100,100,100,255]}catch{const ks=String(Vs);let Ms=0;for(let ha=0;ha<ks.length;++ha)Ms=ks.charCodeAt(ha)+((Ms<<5)-Ms);const fo=Ms>>0&255,Zo=Ms>>8&255,Qo=Ms>>16&255;Er=[Math.abs(fo),Math.abs(Zo),Math.abs(Qo),255]}else Er=An.treeEdges||[100,100,100,255]}}const Yr=Array.isArray(Gn.branchset)&&Gn.branchset.length>0,li=Yr?Ks.internal||4:Ks.leaf||2,Ri=ci&&ci.id===Gn.id&&Yr?Math.max(li*2,li+8):li;return{id:Gn.id,name:Gn.name,leaf_id:ai,node:Gn,rawY:Gn.y,x:Gn.x,color:Er,radius:Ri,metadata:{...Tr,name:Gn.name,id:Gn.id,leaf_id:ai||Tr.leaf_id||Gn.leaf_id}}}),Ts.current={nodes:Qs,geometrySignature:fa,structuralSignature:sr}}function Ia(Fn){const Ln=Yr=>{if(Array.isArray(Yr))return Yr.length===3?[Yr[0],Yr[1],Yr[2],255]:Yr;if(typeof Yr=="string"){const li=Yr.split(",").map(yi=>parseInt(yi.trim(),10)).filter(yi=>!isNaN(yi));if(li.length===3)return[li[0],li[1],li[2],255];if(li.length>=4)return[li[0],li[1],li[2],li[3]]}return Array.isArray(An.geneFill)?An.geneFill:[150,150,150,255]};if(!hi?.enabled){const Yr=Ln(An.geneFill||kr.gene.fillColor),yi=An.background==="#ffffff"?.7:1.3;return[Math.max(0,Math.min(255,Math.floor(Yr[0]*yi))),Math.max(0,Math.min(255,Math.floor(Yr[1]*yi))),Math.max(0,Math.min(255,Math.floor(Yr[2]*yi))),Yr[3]??255]}let Gn=null;const er=yn||Vt||"cluster";if(ss){let Yr=Fn?.metadata?.[er];(Yr==null||Yr==="")&&er==="cluster"&&(Yr=Fn?.metadata?.clusterId??Fn?.metadata?.cluster_id??Fn?.cluster),Yr!=null&&Yr!==""&&(Gn=ya(ss,Yr,hi?.type)||null)}let Er;if(ss&&er!=="cluster")if(Gn)Er=Ln(Gn);else if(hi.transparentByPrevalence){const Yr=Ln(kr.gene.fillColor);Er=[Yr[0],Yr[1],Yr[2],0]}else Er=Ln(kr.gene.fillColor);else if(Gn)Er=Ln(Gn);else if(hi.transparentByPrevalence){const Yr=Ln(Fn.fillColor||kr.gene.fillColor);Er=[Yr[0],Yr[1],Yr[2],0]}else Er=Ln(Fn.fillColor||kr.gene.fillColor);const ai=An.background==="#ffffff"?.7:1.3;return[Math.max(0,Math.min(255,Math.floor(Er[0]*ai))),Math.max(0,Math.min(255,Math.floor(Er[1]*ai))),Math.max(0,Math.min(255,Math.floor(Er[2]*ai))),Er[3]??255]}const ba=`${Object.keys(Un.genesById).length}:${kr.gene.height}:${ci?.id??"null"}:${mi}:${bo.size}:${gr.size}:${ti.size}`,zl=performance.now(),Ua=(()=>{if(On&&Da.current&&qa.current===ba)return Da.current.forEach(er=>{const Er=na.get(er.uniqueId);er.fillColor=Er||er._originalFillColor||An.geneFill}),Da.current;const Fn=er=>{if(!er)return null;if(typeof er=="string"){const Er=er.match(/ID=([^;]+)/);return Er?Er[1]:null}else if(typeof er=="object")return er.ID||er.gene_id||er.protein_id||null;return null},Ln=(er,Er)=>{const Tr=er.hood_id??er.hoodId;if(gr.size>0&&Tr!=null&&(gr.has(String(Tr))||gr.has(Number(Tr))))return!1;const ai=Fn(er.attributes),Yr=er.originalGeneId||er.gene_id||ai||Er;return ti.size>0&&console.log("[isGeneVisibleInLayer] geneKey:",Yr,"uid:",Er,"originalGeneId:",er.originalGeneId,"attrId:",ai,"hiddenGeneSet:",Array.from(ti)),!(ti.size>0&&Yr&&ti.has(String(Yr)))};let Gn=Object.entries(Un.genesById).filter(([er,Er])=>Ln(Er,er));if(ci)try{Gn=Gn.filter(([er,Er])=>{const Tr=Er.hood_id||Un.getHoodIdFromSeqid(Er.seqid);return Tr?bo.has(Tr):!1})}catch{}return Gn.map(([er,Er])=>{const ai=na.get(er)||Er.fillColor||An.geneFill;return{type:"gene",id:Er.id||er,uniqueId:er,start:Er.start,end:Er.end,trackY:Er.trackY,strand:Er.strand,fillColor:ai,_originalFillColor:Er.fillColor,geneHeight:Er.geneHeight||kr.gene.height,config:Er.config||kr,polygon:Er.polygon,metadata:Er.metadata}})})();Da.current=Ua,qa.current=ba,performance.now()-zl;const Il=typeof gn=="number"?gn:qt?.tree?.ySpacing||150,Oa=Po(Ua,ss,yn,Vt,An,kr||qt,ar,xn,Kn||100,Il);try{typeof console<"u"&&console.debug&&console.debug("[HoodiniViz] geneLabels sample:",{geneHeight:nn,effectiveGeneHeight:kr&&kr.gene?kr.gene.height:null,sample:Oa&&Oa.length?Oa.slice(0,6):[]})}catch{}const Xo=Ua.map(Fn=>{const Ln=Fn.geneHeight!==void 0&&Fn.geneHeight!==null?Fn.geneHeight:kr&&kr.gene?kr.gene.height:0,Gn=Fn.config&&Fn.config.gene&&Fn.config.gene.arrowheadHeight?Fn.config.gene.arrowheadHeight:kr&&kr.gene?kr.gene.arrowheadHeight:0;return`${Fn.uniqueId||""}:${Ln}:${Gn}`}).join("|"),Pa=8,Ko=(Fn,Ln=0,Gn=255)=>Math.max(Ln,Math.min(Gn,Fn)),ia=(Fn,Ln)=>[Ko(Math.round(Fn[0]*Ln)),Ko(Math.round(Fn[1]*Ln)),Ko(Math.round(Fn[2]*Ln)),Fn[3]!==void 0?Ko(Math.round(Fn[3])):255],Ol=(Fn,Ln,Gn)=>[Math.round(Fn[0]+(Ln[0]-Fn[0])*Gn),Math.round(Fn[1]+(Ln[1]-Fn[1])*Gn),Math.round(Fn[2]+(Ln[2]-Fn[2])*Gn),Math.round((Fn[3]||255)+((Ln[3]||255)-(Fn[3]||255))*Gn)],$a=(Fn,Ln)=>{if(!Fn||Fn.length===0)return[];if(!Ln)return[];if(!(Ln.colorBy==="identity_gradient"&&Ln.palette&&Ln.palette.enabled))return[];let Gn=[];try{Gn=nr(Ln.palette.name,Ln.palette.numColors||8,Ln.palette.reverse||!1)}catch{Gn=[]}const er=[];for(const Er of Fn){const Tr=Er.polygon||[];if(!Tr||Tr.length<4)continue;const ai=Math.floor(Tr.length/2),Yr=[];for(let Ps=0;Ps<ai;Ps++){const ks=Tr[Ps],Ms=Tr[Ps+ai]||Tr[Tr.length-1];Yr.push([(ks[0]+Ms[0])/2,(ks[1]+Ms[1])/2])}if(Yr.length<2)continue;const li=Er.metadata&&typeof Er.metadata.similarity=="number"?Er.metadata.similarity:0,yi=Gn.length>0?Math.floor(Math.max(0,Math.min(1,li/100))*(Gn.length-1)):0,Ri=Gn.length>0?Gn[yi]:Er.fillColor||[150,150,150,255],Ki=ia(Ri.slice(0,4),.9),ns=ia(Ri.slice(0,4),1.1),Vs=Math.max(2,Pa);for(let Ps=0;Ps<Vs-1;Ps++){const ks=Ps/(Vs-1),Ms=(Ps+1)/(Vs-1),fo=Wl=>{const ho=Wl*(Yr.length-1),gl=Math.floor(ho),sa=Yr[gl],Eo=Yr[Math.min(Yr.length-1,gl+1)],tc=ho-gl;return[sa[0]+(Eo[0]-sa[0])*tc,sa[1]+(Eo[1]-sa[1])*tc]},Zo=fo(ks),Qo=fo(Ms),ha=Ol(Ki,ns,ks),co=Ol(Ki,ns,Ms),Ca=Ol(ha,co,.5);er.push({path:[Zo,Qo],color:Ca,width:Math.max(1,Ln.strokeWidth||2)})}}return er};$a(Rr,Rn),$a(Wr,Tn);const Aa=(Un.nucleotideLinks||[]).map((Fn,Ln)=>{let Gn=Fn.fillColor||An.nucleotideFill;try{const er=Un.genesById&&Un.genesById[Fn.gAId],Er=Un.genesById&&Un.genesById[Fn.gBId],Tr=yn||Vt||"cluster",ai=er&&ss?.get(er.metadata?.[Tr])||Er&&ss?.get(Er.metadata?.[Tr]);ai&&(Gn=ai)}catch{}return{hoodA:Fn.hoodA,hoodB:Fn.hoodB,hoodStartA:Fn.hoodStartA,hoodEndA:Fn.hoodEndA,hoodStartB:Fn.hoodStartB,hoodEndB:Fn.hoodEndB,seqidA:Fn.seqidA,seqidB:Fn.seqidB,fillColor:Gn,metadata:Fn.metadata,_k:`${mi}_${Ln}`}}).filter(Fn=>!(!Fn.hoodA||!Fn.hoodB||gr.size>0&&(gr.has(String(Fn.hoodA))||gr.has(Number(Fn.hoodA))||gr.has(String(Fn.hoodB))||gr.has(Number(Fn.hoodB))))),fl=(Rr||[]).map((Fn,Ln)=>{let Gn=Fn.fillColor||An.proteinFill||[200,200,200,255];try{const er=Un.genesById&&Un.genesById[Fn?.metadata?.gAId],Er=Un.genesById&&Un.genesById[Fn?.metadata?.gBId],Tr=yn||Vt||"cluster",ai=er&&ss?.get(er.metadata?.[Tr])||Er&&ss?.get(Er.metadata?.[Tr]);ai&&(Gn=ai)}catch{}return{gAId:Fn?.metadata?.gAId,gBId:Fn?.metadata?.gBId,fillColor:Gn,metadata:Fn.metadata,_k:`${mi}_${Ln}`}}).filter(Fn=>Fn.gAId&&Fn.gBId),hl=(Fn,Ln,Gn,er,Er=20)=>{const Tr=[];for(let ai=0;ai<=1;ai+=1/Er){const Yr=Math.pow(1-ai,3)*Fn[0]+3*Math.pow(1-ai,2)*ai*Ln[0]+3*(1-ai)*ai*ai*Gn[0]+ai*ai*ai*er[0],li=Math.pow(1-ai,3)*Fn[1]+3*Math.pow(1-ai,2)*ai*Ln[1]+3*(1-ai)*ai*ai*Gn[1]+ai*ai*ai*er[1];Tr.push([Yr,li])}return Tr},pl=(Fn,Ln)=>{if(!Fn||!Ln)return[];const Gn=Math.min(Fn.start,Fn.end),er=Math.max(Fn.start,Fn.end),Er=Math.min(Ln.start,Ln.end),Tr=Math.max(Ln.start,Ln.end),ai=Fn.trackY,Yr=Ln.trackY;let li,yi;ai<=Yr?(li={left:[Gn,ai],right:[er,ai]},yi={left:[Er,Yr],right:[Tr,Yr]}):(li={left:[Er,Yr],right:[Tr,Yr]},yi={left:[Gn,ai],right:[er,ai]});const Ri=(li.left[1]+yi.right[1])/2,Ki=(Ps,ks)=>hl(Ps,[Ps[0],Ri],[ks[0],Ri],ks,20),ns=Ki(li.right,yi.right),Vs=Ki(yi.left,li.left);return[li.left,li.right,...ns,yi.right,yi.left,...Vs]},vl=Fn=>{if(Fn.gene&&Fn.gene.polygon&&Array.isArray(Fn.gene.polygon)&&Fn.gene.polygon.length>0)return Fn.gene.polygon;const Ln=Fn.trackY;if(Ln==null)return[];const Gn=kr.gene.height||kr.gene.defaultHeight,er=kr.gene.arrowheadHeight||0;let Er=Fn.start,Tr=Fn.end;if(Er>Tr){const Ki=Er;Er=Tr,Tr=Ki}const ai=Math.abs(Tr-Er),Yr=calculateTipWidth(ai,kr),li=Gn/2,yi=Fn.strand==="+",Ri=li+er/2;return yi?[[Er,Ln-li],[Tr-Yr,Ln-li],[Tr-Yr,Ln-Ri],[Tr,Ln],[Tr-Yr,Ln+Ri],[Tr-Yr,Ln+li],[Er,Ln+li]]:[[Tr,Ln-li],[Er+Yr,Ln-li],[Er+Yr,Ln-Ri],[Er,Ln],[Er+Yr,Ln+Ri],[Er+Yr,Ln+li],[Tr,Ln+li]]},bc=typeof kr.gene.glowPadFactor=="number"?kr.gene.glowPadFactor:.2;(kr.gene.height||kr.gene.defaultHeight||10)*bc;const Mr=((Fn,Ln=[100,100,100,255])=>{const Gn=er=>Math.max(0,Math.min(255,Math.round(er)));if(Array.isArray(Fn)){const[er=0,Er=0,Tr=0,ai=255]=Fn;return[Gn(er),Gn(Er),Gn(Tr),Gn(ai)]}if(typeof Fn=="string"){const er=Fn.split(",").map(Er=>parseInt(Er.trim(),10)).filter(Er=>!isNaN(Er));if(er.length>=3){const[Er,Tr,ai,Yr=255]=er;return[Gn(Er),Gn(Tr),Gn(ai),Gn(Yr)]}}return Ln})(An.hoods||kr.colors.darkGray||[85,85,85,255]),Br=kr.hood?.width||kr.stroke?.hoodWidth||kr.stroke?.lineWidth||2;performance.now();const Nr=[new LineLayer({id:"hoods",data:Hi,visible:Dr,getSourcePosition:Fn=>[Fn.start,Fn.trackY],getTargetPosition:Fn=>[Fn.end,Fn.trackY],getColor:Mr,getWidth:Br,widthUnits:"meters",pickable:!1,updateTriggers:{getSourcePosition:[Hi,mi,ki,gn,Kn],getTargetPosition:[Hi,mi,ki,gn,Kn]}}),new PolygonLayer({id:"protein-polygons",data:fl,visible:Cr,getPolygon:Fn=>{const Ln=bs.current;if(ci&&bo.size>0){const Er=Ln?.genesById?.[Fn.gAId],Tr=Ln?.genesById?.[Fn.gBId],ai=Er?.hood_id,Yr=Tr?.hood_id;if(ai&&Yr&&(!bo.has(ai)||!bo.has(Yr)))return[]}if(ti.size>0){const Er=Ln?.genesById?.[Fn.gAId],Tr=Ln?.genesById?.[Fn.gBId],ai=(yi,Ri)=>{if(!yi)return Ri;const Ki=typeof yi.attributes=="string"?yi.attributes.match(/ID=([^;]+)/)?.[1]||null:yi.attributes?.ID||null;return yi.originalGeneId||yi.gene_id||Ki||Ri},Yr=ai(Er,Fn.gAId),li=ai(Tr,Fn.gBId);if(Yr&&ti.has(String(Yr))||li&&ti.has(String(li)))return[]}const Gn=Ln?.genesById?.[Fn.gAId],er=Ln?.genesById?.[Fn.gBId];return pl(Gn,er)},getFillColor:Fn=>{bs.current;let Ln=An?.geneFill?.slice(0,3)||[100,150,200],Gn=255;const er=Rn?.colorBy;if(er==="source_gene"){const Tr=na.get(Fn.gAId);Tr&&(Ln=Tr.slice(0,3))}else if(er==="target_gene"){const Tr=na.get(Fn.gBId);Tr&&(Ln=Tr.slice(0,3))}else if(er==="identity_solid")Rn?.solidColor&&(Ln=Rn.solidColor.slice(0,3));else if(er==="identity_gradient"&&Rn?.palette?.enabled)try{const Tr=nr(Rn.palette.name,Rn.palette.numColors,Rn.palette.reverse),ai=Fn.metadata?.similarity??50,Yr=Math.max(0,Math.min(1,ai/100)),li=Math.floor(Yr*(Tr.length-1));Ln=Tr[li]?.slice(0,3)||Ln}catch{}const Er=Rn||kr?.proteinLink||DEFAULT_CONFIG$1.proteinLink;if(Er?.useAlpha&&Fn.metadata?.similarity!==void 0){const Tr=Fn.metadata.similarity/100,ai=Er.minAlpha??0,li=(Er.maxAlpha??.5)-ai,yi=ai+Tr*li;Gn=Math.round(yi*255)}if(Fn.fillColor&&Array.isArray(Fn.fillColor)&&Fn.fillColor.length>=4){const Tr=Fn.fillColor[3]/255;Gn=Math.round(Gn*Tr)}return[...Ln,Gn]},stroked:!1,autoHighlight:!0,filled:!0,pickable:!0,updateTriggers:{getPolygon:[fl,mi,mo,ci,gn,Kn],getFillColor:[fl,mo,dl,na.size,ss,hi?.prevalenceFilter,hi?.name,yn,Vt,An?.geneFill,ci]}}),new PolygonLayer({id:"nucleotide-polygons",data:Aa,visible:dr,getPolygon:Fn=>{const Ln=bs.current;if(!Ln)return[];if(ci&&bo.size>0&&(!bo.has(Fn.hoodA)||!bo.has(Fn.hoodB)))return[];if(ti.size>0&&Fn.geneA&&Fn.geneB){const co=(sa,Eo)=>{if(!sa)return Eo;const tc=typeof sa.attributes=="string"?sa.attributes.match(/ID=([^;]+)/)?.[1]||null:sa.attributes?.ID||null;return sa.originalGeneId||sa.gene_id||tc||Eo},Ca=Ln?.genesById?.[Fn.geneA],Wl=Ln?.genesById?.[Fn.geneB],ho=co(Ca,Fn.geneA),gl=co(Wl,Fn.geneB);if(ho&&ti.has(String(ho))||gl&&ti.has(String(gl)))return[]}const Gn=Ln.getTrackYByHoodId(Fn.hoodA),er=Ln.getTrackYByHoodId(Fn.hoodB);if(Gn==null||er==null)return[];const Tr=(Ln.config.genome&&typeof Ln.config.genome.xScalePercent=="number"?Ln.config.genome.xScalePercent:100)/100,ai=Ln.hoodRanges[Fn.hoodA],Yr=Ln.hoodRanges[Fn.hoodB],li=ai?ai.length/2:0,yi=Yr?Yr.length/2:0,Ri=Ln.trackOffset[Fn.hoodA]||0,Ki=Ln.trackOffset[Fn.hoodB]||0,ns=!!Ln.trackFlipped[Fn.hoodA],Vs=!!Ln.trackFlipped[Fn.hoodB],Ps=Ln.constructor.getTransformedXUnified;let ks=Ps(Fn.hoodStartA,li,Ri,ns),Ms=Ps(Fn.hoodEndA,li,Ri,ns),fo=Ps(Fn.hoodStartB,yi,Ki,Vs),Zo=Ps(Fn.hoodEndB,yi,Ki,Vs);ks=li+(ks-li)*Tr,Ms=li+(Ms-li)*Tr,fo=yi+(fo-yi)*Tr,Zo=yi+(Zo-yi)*Tr;const Qo=[[ks,Gn],[Ms,Gn]].sort((co,Ca)=>co[0]-Ca[0]),ha=[[fo,er],[Zo,er]].sort((co,Ca)=>co[0]-Ca[0]);return[Qo[0],Qo[1],ha[1],ha[0]]},getFillColor:Fn=>{let Ln=[200,200,200],Gn=255;const er=Tn?.colorBy,Er=Tn?.strandColoring,Tr=Fn.similarity??Fn.metadata?.similarity??50,ai=()=>{const li=bs.current;if(!li)return!0;const yi=li.nucleotideLinks?.find(Ms=>Ms.hoodA===Fn.hoodA&&Ms.hoodB===Fn.hoodB&&Ms.hoodStartA===Fn.hoodStartA);if(!yi)return!0;const Ri=yi.strandA||"+",Ki=yi.strandB||"+",ns=!!li.trackFlipped[Fn.hoodA],Vs=!!li.trackFlipped[Fn.hoodB];return(Ri==="+"!==ns?"+":"-")===(Ki==="+"!==Vs?"+":"-")};if(er==="solid")Er?ai()?Ln=Tn?.sameStrandColor?.slice(0,3)||[180,180,180]:Ln=Tn?.oppositeStrandColor?.slice(0,3)||[220,80,80]:Tn?.solidColor&&(Ln=Tn.solidColor.slice(0,3),!Tn?.useAlpha&&Tn.solidColor.length>3&&(Gn=Tn.solidColor[3]));else if(er==="identity_gradient"){if(Er){const yi=ai()?Tn?.sameStrandPalette:Tn?.oppositeStrandPalette;if(yi?.enabled)try{const Ri=nr(yi.name,yi.numColors,yi.reverse),Ki=Math.max(0,Math.min(1,Tr/100)),ns=Math.floor(Ki*(Ri.length-1));Ln=Ri[ns]?.slice(0,3)||Ln}catch{}}else if(Tn?.palette?.enabled)try{const li=nr(Tn.palette.name,Tn.palette.numColors,Tn.palette.reverse),yi=Math.max(0,Math.min(1,Tr/100)),Ri=Math.floor(yi*(li.length-1));Ln=li[Ri]?.slice(0,3)||Ln}catch{}}const Yr=Tn||kr?.nucleotideLink||DEFAULT_CONFIG$1.nucleotideLink;if(Yr?.useAlpha){const li=Tr/100,yi=Yr.minAlpha??0,Ki=(Yr.maxAlpha??.5)-yi,ns=yi+li*Ki;Gn=Math.round(ns*255)}return[...Ln,Gn]},stroked:!1,filled:!0,autoHighlight:!0,pickable:!0,updateTriggers:{getPolygon:[Aa,mi,mo,bs.current&&bs.current.config&&bs.current.config.genome&&bs.current.config.genome.xScalePercent||null,ci,gn,Kn],getFillColor:[Aa,mo,Tl,Tn?.useAlpha,Tn?.minAlpha,Tn?.maxAlpha,Tn?.colorBy,Tn?.strandColoring,Tn?.sameStrandColor,Tn?.oppositeStrandColor,Tn?.sameStrandPalette,Tn?.oppositeStrandPalette,ci,bs.current?.trackFlipped,mi]}}),new PolygonLayer({id:"region-polygons",data:qr,visible:pr,getPolygon:Fn=>Fn.polygon,getFillColor:Fn=>{const Ln=Fn.strokeColor||[100,100,100,255];return[Ln[0],Ln[1],Ln[2],30]},stroked:!0,getLineColor:Fn=>Fn.strokeColor||[100,100,100,255],getLineWidth:Fn=>Fn.strokeWidth||2,lineWidthUnits:"pixels",filled:!0,autoHighlight:!0,pickable:!0,updateTriggers:{getPolygon:[qr,mi,gn,Kn],getFillColor:[qr,mi],getLineColor:[qr,mi],getLineWidth:[qr,mi]}}),new PathLayer({id:"phylo-tree",data:Pi,visible:Wn&&po,getPath:Fn=>{const Ln=kr.tree&&typeof kr.tree.xScalePercent=="number"?kr.tree.xScalePercent/100:1;return Fn.rawPath.map(([Gn,er])=>[Gn*Ln+Ur,er])},getColor:Fn=>Fn.color||An.treeEdges||kr.tree.edgeColor,autoHighlight:!0,widthUnits:"pixels",jointRounded:!0,capRounded:!0,getWidth:()=>kr.tree.edgeWidth||3,pickable:!0,updateTriggers:{getPath:[Pi.length,kr.tree.xScalePercent,Ur,mi],getColor:[Pi.length,An.treeEdges,kr.tree.edgeColor],getWidth:kr.tree.edgeWidth}}),new PolygonLayer({id:"genes",data:Ua,visible:br,getPolygon:vl,getFillColor:Fn=>{const Ln=Tr=>{if(Array.isArray(Tr))return Tr.length===3?[Tr[0],Tr[1],Tr[2],255]:Tr;if(typeof Tr=="string"){const ai=Tr.split(",").map(Yr=>parseInt(Yr.trim(),10)).filter(Yr=>!isNaN(Yr));if(ai.length===3)return[ai[0],ai[1],ai[2],255];if(ai.length>=4)return[ai[0],ai[1],ai[2],ai[3]]}return An.geneFill||[150,150,150,255]};let Gn=null;const er=yn||Vt||"cluster";if(ss){let Tr=Fn?.metadata?.[er];(Tr==null||Tr==="")&&er==="cluster"&&(Tr=Fn?.metadata?.clusterId??Fn?.metadata?.cluster_id??Fn?.cluster),Tr!=null&&Tr!==""&&(Gn=ya(ss,Tr,hi?.type)||null)}if(!hi?.enabled)Gn||(Gn=An.geneFill||kr.gene.fillColor);else if(ss&&er!=="cluster"){if(!Gn)if(hi.transparentByPrevalence){const Tr=An.geneFill||kr.gene.fillColor;Gn=[Tr[0],Tr[1],Tr[2],0]}else Gn=An.geneFill||kr.gene.fillColor}else if(!Gn)if(hi.transparentByPrevalence){const Tr=Fn.fillColor||An.geneFill||kr.gene.fillColor;Gn=[Tr[0],Tr[1],Tr[2],0]}else Gn=Fn.fillColor||An.geneFill||kr.gene.fillColor;return Ln(Gn)},stroked:kr.gene.edgeWidth>0,getLineColor:Fn=>Ia(Fn),getLineWidth:()=>kr.gene.edgeWidth,lineWidthUnits:"pixels",lineWidthMinPixels:0,filled:!0,pickable:!0,autoHighlight:!0,updateTriggers:{getPolygon:[Ua,Xo,mi,kr.gene.height,kr.gene.defaultHeight,kr.gene.arrowheadHeight,kr.gene.tipWidthFactor,Zt,nn,ci,gn,Kn],getFillColor:[Ua,yn,Vt,mo,An.geneFill,mi,hi?.enabled,hi?.transparentByPrevalence],getLineColor:[Ua,yn,Vt,mo,An.geneFill,kr.gene.edgeWidth,mi,hr,hi?.transparentByPrevalence],getLineWidth:kr.gene.edgeWidth,stroked:kr.gene.edgeWidth}}),new PolygonLayer({id:`domains-${kr.gene.height}-${kr.gene.arrowheadHeight}`,data:ri,visible:Fr,getPolygon:Fn=>Fn.polygon,getFillColor:Fn=>Fn.fillColor||An.geneFill||qt.colors.gray,stroked:!0,getLineColor:Fn=>{const Ln=Fn.fillColor||qt.colors.black;return Array.isArray(Ln)&&Ln.length>=4&&Ln[3]<255?[0,0,0,Ln[3]]:qt.colors.black},getLineWidth:()=>kr.domain.edgeWidth||2,lineWidthUnits:"pixels",filled:!0,autoHighlight:!0,pickable:!0,updateTriggers:{getPolygon:[ri,mi,kr.domain.height,kr.gene.height,kr.gene.arrowheadHeight,kr.domain.heightFactor,$n,ci,gn,Kn],getFillColor:[ri.length,Mn,mo,An.domainFill,$n,ci,hi?.transparentByPrevalence,ss],getLineColor:[ri.length,hi?.transparentByPrevalence],getLineWidth:kr.domain.edgeWidth}}),new TextLayer({id:"gene-labels",data:Oa,visible:wr,getPosition:Fn=>Fn.position,getText:Fn=>Fn.text,getColor:Fn=>Fn.color,getSize:Fn=>Fn.size*(kr.text?.scaleFactors?.gene||1),sizeUnits:"meters",fontFamily:"sans-serif",getTextAnchor:Fn=>Fn.textAnchor||"middle",getAlignmentBaseline:Fn=>Fn.alignmentBaseline||"top",pickable:!1,updateTriggers:{getPosition:[Oa.length,mi,kr&&kr.gene?kr.gene.height:null,nn,ar,gn,Kn,Ua],getText:[Oa.length,xn,Kn,gn],getColor:[Oa.length,yn,hi&&hi.name||null,mo],getSize:[kr.text?.geneLabelSize,kr.text?.scaleFactors?.gene,Oa.length,nn,ar],getAlignmentBaseline:[Oa.length,ar,mi]}}),new TextLayer({id:"phylo-labels",data:Ai,visible:xr&&po,getPosition:Fn=>{const Ln=kr.tree&&typeof kr.tree.xScalePercent=="number"?kr.tree.xScalePercent/100:1;let Gn;if(Fn.labelPosition==="after-tracks")if(Si){const er=Ai.map(Tr=>Tr.rightmostX).filter(Tr=>isFinite(Tr));Gn=(er.length>0?Math.max(...er):Fn.rawY*Ln+Ur+(qt.tree?.labelOffset||10))+(qt.tree?.labelOffset||10)}else{let er=Fn.rightmostX;isFinite(er)?er+=kr.tree?.labelOffset||10:er=Fn.rawY*Ln+Ur+(kr.tree?.labelOffset||10),Gn=er}else if(Si){const er=Ai.map(Tr=>Tr.rawY*Ln);Gn=(er.length>0?Math.max(...er):Fn.rawY*Ln)+Ur+(kr.tree?.labelOffset||10)}else Gn=Fn.rawY*Ln+Ur+(kr.tree?.labelOffset||10);return[Gn,Fn.x]},getText:Fn=>Fn.text,getColor:Fn=>Fn.color,getSize:Fn=>Fn.size*kr.text.scaleFactors.phylo,sizeUnits:"meters",fontFamily:"sans-serif",getTextAnchor:Fn=>Fn.textAnchor||"start",getAlignmentBaseline:Fn=>Fn.alignmentBaseline||"center",getPixelOffset:Fn=>[5,0],background:Kt,getBackgroundColor:()=>{const Fn=An.background==="#ffffff";return Kt?[Fn?255:0,Fn?255:0,Fn?255:0,255]:[0,0,0,0]},backgroundPadding:Kt?[2,1,2,1]:[0,0,0,0],pickable:!1,updateTriggers:{getPosition:[Ai.length,kr.tree.xScalePercent,Ur,mi,rl,Si],getText:Ai,getSize:[kr.text.phyloLabelSize,kr.text.scaleFactors.phylo,Ai],getColor:[Ai,Gt,Li?`${Li.name}|${Li.numColors||0}|${Li.reverse||!1}|${Li.enabled||!1}`:null,Xs,An.phyloLabelFill,Ht?Object.keys(Ht).length:0],background:Kt,getBackgroundColor:Kt,backgroundPadding:Kt}}),new ScatterplotLayer({id:"nodes",data:Qs,visible:Wn&&po,getPosition:Fn=>{const Ln=Number(Fn.rawY),Gn=Number(Fn.x);if(!Number.isFinite(Ln)||!Number.isFinite(Gn))return[0,0];const er=kr.tree&&typeof kr.tree.xScalePercent=="number"?kr.tree.xScalePercent/100:1;return[Ln*er+Ur,Gn]},getFillColor:Fn=>Fn.color,getRadius:Fn=>Fn.radius,lineWidthUnits:"meters",radiusUnits:"meters",autoHighlight:!0,filled:!0,stroked:!1,pickable:!0,updateTriggers:{getPosition:[Qs.length,kr.tree.xScalePercent,Ur,mi],getFillColor:[Qs.length,An.treeEdges,ci,Gt,Li?`${Li.name}|${Li.numColors||0}|${Li.reverse||!1}|${Li.enabled||!1}`:null,Xs,Ht?Object.keys(Ht).length:0]}})];if(Kt){const Fn=us.leafNodes.filter(Ln=>ci&&!bo.has(Ln.name)?!1:Un.getTrackYByHoodId(Ln.name)!=null).map(Ln=>{const Gn=Un.getTrackYByHoodId(Ln.name);let er=1/0;const Er=Hi.find(Tr=>Tr.hood_id===Ln.name);return Er?er=Math.min(Er.start,Er.end):Object.values(Un.genesById).forEach(Tr=>{(Tr.hood_id===Ln.name||Un.getHoodIdFromSeqid(Tr.seqid)===Ln.name)&&(er=Math.min(er,Math.min(Tr.start,Tr.end)))}),{rawLeafY:Ln.y,leafX:Ln.x,genomeStartX:isFinite(er)?er:null,trackY:Gn,metadata:{leaf_id:Ln.name,type:"connecting_line"}}}).filter(Ln=>Ln.genomeStartX!==null);Fn.length>0&&Nr.unshift(new LineLayer({id:"connecting-lines",data:Fn,getSourcePosition:Ln=>{const Gn=kr.tree&&typeof kr.tree.xScalePercent=="number"?kr.tree.xScalePercent/100:1;return[Ln.rawLeafY*Gn+Ur,Ln.leafX]},getTargetPosition:Ln=>[Ln.genomeStartX,Ln.trackY],getColor:qt.connectingLines.color,getWidth:qt.connectingLines.width,widthUnits:"pixels",pickable:!0,autoHighlight:!1,updateTriggers:{getSourcePosition:[Fn.length,kr.tree.xScalePercent,Ur,mi],getTargetPosition:Fn}}))}let Hr=Object.values(Un.ncRNAsById||{});if(ci)try{const Fn=Un.filterBySelectedNode(ci)||{};Array.isArray(Fn.ncRNAs)&&(Hr=Fn.ncRNAs)}catch{}Hr=Hr.filter(Fn=>!ii(Fn.hood_id??Fn.hoodId)),ti.size>0&&(Hr=Hr.filter(Fn=>{const Ln=Fn.gene_id||Fn.geneId||Fn.metadata?.gene_id||Fn.metadata?.geneId||Fn.metadata?.Parent;return Ln?!ti.has(String(Ln)):!0})),Hr=Hr.map(Fn=>({...Fn,fillColor:Fn.fillColor||Fn.metadata&&Fn.metadata.color||An.geneFill})),Nr.push(new PolygonLayer({id:"ncrna-features",data:Hr,visible:_r,getPolygon:Fn=>Fn.polygon,getFillColor:Fn=>Fn.fillColor,stroked:kr.gene.edgeWidth>0,getLineColor:Fn=>Ia(Fn),getLineWidth:()=>kr.gene.edgeWidth,lineWidthUnits:"pixels",lineWidthMinPixels:0,filled:!0,pickable:!0,autoHighlight:!0,updateTriggers:{getPolygon:[Hr,kr.gene.height,kr.gene.arrowheadHeight,mi,mo,gn,Kn],getFillColor:[Hr.length,mo],getLineColor:[Hr.length,mo],getLineWidth:kr.gene.edgeWidth,stroked:kr.gene.edgeWidth}})),To.current=Pn,performance.now();try{console.groupEnd&&console.groupEnd()}catch{}return Nr},[kr,bo,ms,Un,Ii,mi,us,ci,Ma,Rl,ss,na,Xa,hr,Kt,tn,sn,zt,Wt,Gt,pn,Ht,$n,ki,Rn,Tn,Nt,jt,Vt,yn,Mn,Qt,fn,xn,ar,gn,di,Bi,gr,ti,ii,Dr,Wn,br,Fr,Cr,dr,_r,pr,wr,xr,bs.current?._paletteVersion,hi?.enabled]);React.useMemo(()=>{const En=[],kn=Vn=>{const Nn=Dn=>Math.max(0,Math.min(255,Math.round(Dn)));if(Array.isArray(Vn)){const[Dn=0,On=0,Pn=0,Zn=255]=Vn;return[Nn(Dn),Nn(On),Nn(Pn),Nn(Zn??255)]}if(typeof Vn=="string"){const Dn=Vn.split(",").map(On=>parseInt(On.trim(),10)).filter(On=>!isNaN(On));if(Dn.length>=3){const[On,Pn,Zn,sr=255]=Dn;return[Nn(On),Nn(Pn),Nn(Zn),Nn(sr)]}}return[150,150,150,255]};if(Mi&&Mi.length>0){const Vn=Dn=>{const On=Dn?.fillColor||An.geneFill||qt.gene?.fillColor||[100,200,255,255];return kn(On)},Nn=Dn=>{if(Dn.polygon&&Array.isArray(Dn.polygon)&&Dn.polygon.length>0)return Dn.polygon;const On=Dn.gene||Dn,Pn=Dn.trackY??On.trackY??0,Zn=kr.gene?.height||kr.gene?.geneHeight||20,sr=kr.gene?.arrowheadHeight||10,fr=(kr.genome?.xScalePercent||100)/100,mr=(Dn.start??On.start)*fr,Pr=(Dn.end??On.end)*fr,Ur=Dn.strand??On.strand,Rr=Zn/2,Wr=sr/2,$r=Math.abs(Pr-mr),qr=calculateTipWidth($r,kr);if(qr<1){const[Vr,ri]=mr<Pr?[mr,Pr]:[Pr,mr];return[[Vr,Pn-Rr-Wr],[ri,Pn-Rr-Wr],[ri,Pn+Rr+Wr],[Vr,Pn+Rr+Wr]]}if(Ur==="+"||Ur===1){const Vr=Math.max(mr,Pr-qr);return[[mr,Pn-Rr],[Vr,Pn-Rr],[Vr,Pn-Rr-Wr],[Pr,Pn],[Vr,Pn+Rr+Wr],[Vr,Pn+Rr],[mr,Pn+Rr]]}else{const Vr=Math.min(Pr,mr+qr);return[[Pr,Pn-Rr],[Vr,Pn-Rr],[Vr,Pn-Rr-Wr],[mr,Pn],[Vr,Pn+Rr+Wr],[Vr,Pn+Rr],[Pr,Pn+Rr]]}};En.push(new PolygonLayer({id:"genes-glow-outer",data:Mi,getPolygon:Nn,stroked:!0,filled:!1,getLineWidth:35,getLineColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,70]},lineWidthUnits:"pixels",lineWidthMinPixels:8,pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new PolygonLayer({id:"genes-glow-mid",data:Mi,getPolygon:Nn,stroked:!0,filled:!1,getLineWidth:18,getLineColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,120]},lineWidthUnits:"pixels",lineWidthMinPixels:4,pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new PolygonLayer({id:"genes-glow-core",data:Mi,getPolygon:Nn,stroked:!0,filled:!0,getFillColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,40]},getLineColor:[255,255,255,255],getLineWidth:3,lineWidthUnits:"pixels",lineWidthMinPixels:2,pickable:!1,parameters:{depthTest:!1,depthMask:!1,polygonOffset:[-2,-2]}}))}if(_o&&_o.length>0){console.log("[glowLayers] highlightedRegionData:",_o[0]);const Vn=Dn=>{const On=Dn?.fillColor||Dn?.strokeColor||[255,180,50,255];return console.log("[glowLayers] getRegionColor:",{fillColor:Dn?.fillColor,strokeColor:Dn?.strokeColor,base:On}),kn(On)},Nn=Dn=>{if(Dn.polygon&&Array.isArray(Dn.polygon)&&Dn.polygon.length>0)return Dn.polygon;const On=Math.min(Dn.startX||0,Dn.endX||0),Pn=Math.max(Dn.startX||0,Dn.endX||0),Zn=Dn.trackY||0,sr=25;return[[On,Zn-sr],[Pn,Zn-sr],[Pn,Zn+sr],[On,Zn+sr]]};En.push(new PolygonLayer({id:"regions-glow-outer",data:_o,getPolygon:Nn,stroked:!0,filled:!1,getLineWidth:30,getLineColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,70]},lineWidthUnits:"pixels",lineWidthMinPixels:6,pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new PolygonLayer({id:"regions-glow-mid",data:_o,getPolygon:Nn,stroked:!0,filled:!1,getLineWidth:15,getLineColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,130]},lineWidthUnits:"pixels",lineWidthMinPixels:3,pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new PolygonLayer({id:"regions-glow-core",data:_o,getPolygon:Nn,stroked:!0,filled:!1,getLineColor:[255,255,255,255],getLineWidth:3,lineWidthUnits:"pixels",lineWidthMinPixels:2,pickable:!1,parameters:{depthTest:!1,depthMask:!1,polygonOffset:[-2,-2]}}))}if(Do&&Do.length>0){const Vn=Dn=>{const On=Dn?.fillColor||Dn?.strokeColor||[120,200,255,255];return kn(On)},Nn=Dn=>{if(Dn.polygon&&Array.isArray(Dn.polygon)&&Dn.polygon.length>0)return Dn.polygon;const On=Math.min(Dn.start||0,Dn.end||0),Pn=Math.max(Dn.start||0,Dn.end||0),Zn=Dn.trackY||0,sr=15;return[[On,Zn-sr],[Pn,Zn-sr],[Pn,Zn+sr],[On,Zn+sr]]};En.push(new PolygonLayer({id:"ncrna-glow-outer",data:Do,getPolygon:Nn,stroked:!0,filled:!1,getLineWidth:25,getLineColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,70]},lineWidthUnits:"pixels",lineWidthMinPixels:6,pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new PolygonLayer({id:"ncrna-glow-mid",data:Do,getPolygon:Nn,stroked:!0,filled:!1,getLineWidth:12,getLineColor:Dn=>{const[On,Pn,Zn]=Vn(Dn);return[On,Pn,Zn,150]},lineWidthUnits:"pixels",lineWidthMinPixels:3,pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new PolygonLayer({id:"ncrna-glow-core",data:Do,getPolygon:Nn,stroked:!0,filled:!1,getLineColor:[255,255,255,255],getLineWidth:3,lineWidthUnits:"pixels",lineWidthMinPixels:2,pickable:!1,parameters:{depthTest:!1,depthMask:!1,polygonOffset:[-2,-2]}}))}return Wi&&Wi.length>0&&(En.push(new ScatterplotLayer({id:"tree-glow-outer",data:Wi,getPosition:Vn=>Vn.position||[0,0],getRadius:Vn=>(Vn.radius||2)*3.5,getFillColor:Vn=>{const Nn=Vn?.color||An.treeEdges||[255,200,100,255],[Dn,On,Pn]=kn(Nn);return[Dn,On,Pn,90]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"meters",radiusMinPixels:12,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new ScatterplotLayer({id:"tree-glow-core",data:Wi,getPosition:Vn=>Vn.position||[0,0],getRadius:Vn=>(Vn.radius||2)*1.8,getFillColor:[255,255,255,255],stroked:!1,filled:!0,pickable:!1,radiusUnits:"meters",radiusMinPixels:6,parameters:{depthTest:!1,depthMask:!1}}))),ys&&ys.length>0&&(En.push(new ScatterplotLayer({id:"tree-node-glow-outer",data:ys,getPosition:Vn=>Vn.position||[0,0],getRadius:Vn=>(Vn.radius||2)*4,getFillColor:Vn=>{const Nn=Vn?.color||An.treeEdges||[100,180,255,255],[Dn,On,Pn]=kn(Nn);return[Dn,On,Pn,80]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"meters",radiusMinPixels:14,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new ScatterplotLayer({id:"tree-node-glow-mid",data:ys,getPosition:Vn=>Vn.position||[0,0],getRadius:Vn=>(Vn.radius||2)*2.5,getFillColor:Vn=>{const Nn=Vn?.color||An.treeEdges||[100,180,255,255],[Dn,On,Pn]=kn(Nn);return[Dn,On,Pn,130]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"meters",radiusMinPixels:10,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new ScatterplotLayer({id:"tree-node-glow-core",data:ys,getPosition:Vn=>Vn.position||[0,0],getRadius:Vn=>(Vn.radius||2)*1.5,getFillColor:[255,255,255,255],stroked:!1,filled:!0,pickable:!1,radiusUnits:"meters",radiusMinPixels:5,parameters:{depthTest:!1,depthMask:!1}}))),io&&io.length>0&&(En.push(new LineLayer({id:"hoods-glow-outer",data:io,getSourcePosition:Vn=>[Vn.start,Vn.trackY],getTargetPosition:Vn=>[Vn.end,Vn.trackY],getColor:[255,215,80,100],getWidth:28,widthUnits:"pixels",pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),En.push(new LineLayer({id:"hoods-glow-core",data:io,getSourcePosition:Vn=>[Vn.start,Vn.trackY],getTargetPosition:Vn=>[Vn.end,Vn.trackY],getColor:[255,255,255,255],getWidth:3,widthUnits:"pixels",pickable:!1,parameters:{depthTest:!1,depthMask:!1}}))),En},[Mi,Wi,ys,io,_o,Do,An.geneFill,An.treeEdges,qt.gene?.fillColor,qt.stroke?.hoodWidth,qt.stroke?.lineWidth,kr.gene?.height,kr.gene?.geneHeight,kr.gene?.arrowheadHeight,kr.genome?.xScalePercent,kr.gene?.tipWidthFactor,kr.tree?.ySpacing,Kn,mi]);const va=React.useCallback(En=>{const kn=[],Vn=Math.sin(En*.2),Nn=1+Vn*.15,Dn=hr==="light",On=Pr=>{const Ur=Rr=>Math.max(0,Math.min(255,Math.round(Rr)));if(Array.isArray(Pr)){const[Rr=0,Wr=0,$r=0,qr=255]=Pr;return[Ur(Rr),Ur(Wr),Ur($r),Ur(qr??255)]}return[150,150,150,255]},Pn=(Pr,Ur,Rr)=>(.299*Pr+.587*Ur+.114*Rr)/255,Zn=(Pr,Ur,Rr,Wr)=>{const $r=Pn(Pr,Ur,Rr);if(Dn){if($r>.7){const qr=.4+(1-$r)*.3;return{color:[Math.round(Pr*qr),Math.round(Ur*qr),Math.round(Rr*qr)],opacity:Math.min(255,Math.round(Wr*1.5))}}else if($r>.4)return{color:[Math.round(Pr*.7),Math.round(Ur*.7),Math.round(Rr*.7)],opacity:Math.round(Wr*1.2)}}return{color:[Pr,Ur,Rr],opacity:Wr}},sr=kr.gene?.height||nn||DEFAULT_CONFIG$1.gene.height,fr=kr.gene?.arrowheadHeight??Zt??DEFAULT_CONFIG$1.gene.arrowheadHeight,mr=Pr=>{const Ur=Pr.trackY;if(Ur==null)return Pr.polygon||[];let Rr=Pr.start,Wr=Pr.end;if(Rr>Wr){const Di=Rr;Rr=Wr,Wr=Di}const $r=Math.abs(Wr-Rr),qr=calculateTipWidth($r,kr),Vr=sr/2,ri=Pr.strand==="+";if(qr<1)return[[Rr,Ur-Vr],[Wr,Ur-Vr],[Wr,Ur+Vr],[Rr,Ur+Vr]];if(fr<.1)return ri?[[Rr,Ur-Vr],[Wr-qr,Ur-Vr],[Wr,Ur],[Wr-qr,Ur+Vr],[Rr,Ur+Vr]]:[[Wr,Ur-Vr],[Rr+qr,Ur-Vr],[Rr,Ur],[Rr+qr,Ur+Vr],[Wr,Ur+Vr]];const Ei=Vr+fr/2;return ri?[[Rr,Ur-Vr],[Wr-qr,Ur-Vr],[Wr-qr,Ur-Ei],[Wr,Ur],[Wr-qr,Ur+Ei],[Wr-qr,Ur+Vr],[Rr,Ur+Vr]]:[[Wr,Ur-Vr],[Rr+qr,Ur-Vr],[Rr+qr,Ur-Ei],[Rr,Ur],[Rr+qr,Ur+Ei],[Rr+qr,Ur+Vr],[Wr,Ur+Vr]]};if(Mi&&Mi.length>0){const Pr=$r=>{const qr=$r?.fillColor||An.geneFill||qt.gene?.fillColor||[100,200,255,255];return On(qr)},Ur=sr*(.3+Vn*.2),Rr=Math.round(150+Vn*50);kn.push(new PolygonLayer({id:`genes-glow-outer-anim-${En}`,data:Mi,getPolygon:mr,stroked:!0,filled:!1,getLineWidth:Ur,getLineColor:$r=>{const[qr,Vr,ri]=Pr($r),Ei=Zn(qr,Vr,ri,Rr);return[...Ei.color,Ei.opacity]},lineWidthUnits:"common",pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}}));const Wr=Dn?[80,80,80,200]:[255,255,255,255];kn.push(new PolygonLayer({id:"genes-glow-core-anim",data:Mi,getPolygon:mr,stroked:!0,filled:!1,getLineColor:Wr,getLineWidth:sr*.03,lineWidthUnits:"common",pickable:!1,parameters:{depthTest:!1,depthMask:!1,polygonOffset:[-1,-1]}}))}if(Wi&&Wi.length>0){const Pr=qr=>{const Vr=qr?.color;return Vr&&Array.isArray(Vr)&&Vr.some(ri=>ri>0)?On(Vr):[220,180,60,255]},Ur=4*(1.5+Vn*.5)*Nn,Rr=4*(.8+Vn*.3)*Nn,Wr=Math.round(60+Vn*30),$r=Math.round(120+Vn*50);kn.push(new ScatterplotLayer({id:`tree-glow-outer-anim-${En}`,data:Wi,getPosition:qr=>qr.position||[0,0],getRadius:qr=>(qr.radius||2)*Ur,getFillColor:qr=>{const[Vr,ri,Ei]=Pr(qr),Di=Zn(Vr,ri,Ei,Wr);return[...Di.color,Di.opacity]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"common",parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),kn.push(new ScatterplotLayer({id:`tree-glow-mid-anim-${En}`,data:Wi,getPosition:qr=>qr.position||[0,0],getRadius:qr=>(qr.radius||2)*Rr,getFillColor:qr=>{const[Vr,ri,Ei]=Pr(qr),Di=Zn(Vr,ri,Ei,$r);return[...Di.color,Di.opacity]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"common",parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),kn.push(new ScatterplotLayer({id:"tree-glow-core-anim",data:Wi,getPosition:qr=>qr.position||[0,0],getRadius:qr=>(qr.radius||2)*1.5,getFillColor:qr=>{const[Vr,ri,Ei]=Pr(qr),Di=Zn(Vr,ri,Ei,255);return[...Di.color,Di.opacity]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"common",parameters:{depthTest:!1,depthMask:!1}}))}if(ys&&ys.length>0){const Pr=qr=>{const Vr=qr?.color;return Vr&&Array.isArray(Vr)&&Vr.some(ri=>ri>0)?On(Vr):[100,180,255,255]},Ur=4*(1.6+Vn*.6)*Nn,Rr=4*(.9+Vn*.35)*Nn,Wr=Math.round(50+Vn*30),$r=Math.round(110+Vn*50);kn.push(new ScatterplotLayer({id:`tree-node-glow-outer-anim-${En}`,data:ys,getPosition:qr=>qr.position||[0,0],getRadius:qr=>(qr.radius||4)*Ur,getFillColor:qr=>{const[Vr,ri,Ei]=Pr(qr),Di=Zn(Vr,ri,Ei,Wr);return[...Di.color,Di.opacity]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"common",parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),kn.push(new ScatterplotLayer({id:`tree-node-glow-mid-anim-${En}`,data:ys,getPosition:qr=>qr.position||[0,0],getRadius:qr=>(qr.radius||4)*Rr,getFillColor:qr=>{const[Vr,ri,Ei]=Pr(qr),Di=Zn(Vr,ri,Ei,$r);return[...Di.color,Di.opacity]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"common",parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),kn.push(new ScatterplotLayer({id:"tree-node-glow-core-anim",data:ys,getPosition:qr=>qr.position||[0,0],getRadius:qr=>(qr.radius||4)*1.5,getFillColor:qr=>{const[Vr,ri,Ei]=Pr(qr),Di=Zn(Vr,ri,Ei,255);return[...Di.color,Di.opacity]},stroked:!1,filled:!0,pickable:!1,radiusUnits:"common",parameters:{depthTest:!1,depthMask:!1}}))}if(io&&io.length>0){const Pr=10+Vn*8,Ur=Math.round(150+Vn*50),Rr=Dn?[180,140,40]:[255,215,80],Wr=Dn?Math.min(255,Math.round(Ur*1.3)):Ur;kn.push(new LineLayer({id:`hoods-glow-outer-anim-${En}`,data:io,getSourcePosition:qr=>[qr.start,qr.trackY],getTargetPosition:qr=>[qr.end,qr.trackY],getColor:[...Rr,Wr],getWidth:Pr*Nn,widthUnits:"common",pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}}));const $r=Dn?[80,80,80,200]:[255,255,255,255];kn.push(new LineLayer({id:"hoods-glow-core-anim",data:io,getSourcePosition:qr=>[qr.start,qr.trackY],getTargetPosition:qr=>[qr.end,qr.trackY],getColor:$r,getWidth:1,widthUnits:"common",pickable:!1,parameters:{depthTest:!1,depthMask:!1}}))}if(_o&&_o.length>0){const Pr=$r=>{if($r.polygon&&Array.isArray($r.polygon)&&$r.polygon.length>0)return $r.polygon;const qr=Math.min($r.startX||0,$r.endX||0),Vr=Math.max($r.startX||0,$r.endX||0),ri=$r.trackY||0,Ei=$r.geneHeight||sr,Di=$r.arrowheadHeight||fr,Hi=$r.padding||10,Qi=Math.max(Ei,Di)/2+Hi;return[[qr,ri-Qi],[Vr,ri-Qi],[Vr,ri+Qi],[qr,ri+Qi]]},Ur=$r=>{const qr=$r?.strokeColor||$r?.fillColor||[255,180,50,255];return On(qr)},Rr=sr*(.4+Vn*.2),Wr=Math.round(120+Vn*60);kn.push(new PolygonLayer({id:`regions-glow-outer-anim-${En}`,data:_o,getPolygon:Pr,stroked:!0,filled:!1,getLineWidth:Rr,getLineColor:$r=>{const[qr,Vr,ri]=Ur($r),Ei=Zn(qr,Vr,ri,Wr);return[...Ei.color,Ei.opacity]},lineWidthUnits:"common",pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),kn.push(new PolygonLayer({id:"regions-glow-core-anim",data:_o,getPolygon:Pr,stroked:!0,filled:!1,getLineColor:$r=>{const[qr,Vr,ri]=Ur($r);return Dn?[Math.round(qr*.5),Math.round(Vr*.5),Math.round(ri*.5),220]:[255,255,255,255]},getLineWidth:sr*.04,lineWidthUnits:"common",pickable:!1,parameters:{depthTest:!1,depthMask:!1,polygonOffset:[-1,-1]}}))}if(Do&&Do.length>0){const Pr=$r=>{if($r.polygon&&Array.isArray($r.polygon)&&$r.polygon.length>0)return $r.polygon;const qr=Math.min($r.start||0,$r.end||0),Vr=Math.max($r.start||0,$r.end||0),ri=$r.trackY||0,Ei=15;return[[qr,ri-Ei],[Vr,ri-Ei],[Vr,ri+Ei],[qr,ri+Ei]]},Ur=$r=>{const qr=$r?.fillColor||$r?.strokeColor||[120,200,255,255];return On(qr)},Rr=sr*(.35+Vn*.15),Wr=Math.round(100+Vn*50);kn.push(new PolygonLayer({id:`ncrna-glow-outer-anim-${En}`,data:Do,getPolygon:Pr,stroked:!0,filled:!1,getLineWidth:Rr,getLineColor:$r=>{const[qr,Vr,ri]=Ur($r),Ei=Zn(qr,Vr,ri,Wr);return[...Ei.color,Ei.opacity]},lineWidthUnits:"common",pickable:!1,parameters:{blendFunc:[770,1],depthTest:!1,depthMask:!1}})),kn.push(new PolygonLayer({id:"ncrna-glow-core-anim",data:Do,getPolygon:Pr,stroked:!0,filled:!1,getLineColor:$r=>{const[qr,Vr,ri]=Ur($r);return Dn?[Math.round(qr*.5),Math.round(Vr*.5),Math.round(ri*.5),220]:[255,255,255,255]},getLineWidth:sr*.04,lineWidthUnits:"common",pickable:!1,parameters:{depthTest:!1,depthMask:!1,polygonOffset:[-1,-1]}}))}return kn},[Mi,Wi,ys,io,_o,Do,An,qt.gene?.fillColor,hr,kr.gene?.height,kr.gene?.geneHeight,kr.gene?.arrowheadHeight,kr.gene?.tipWidthFactor,kr.genome?.xScalePercent,kr.tree?.ySpacing,Kn,mi,Gt,Li?.name,Li?.enabled,Li?.numColors,Li?.reverse]),dc=Mi?.length>0||Wi?.length>0||ys?.length>0||io?.length>0||_o?.length>0||Do?.length>0;reactExports.useEffect(()=>{la.current=Ys},[Ys]),reactExports.useEffect(()=>(cs.current&&(cancelAnimationFrame(cs.current),cs.current=null),dc?((()=>{let kn=0;const Vn=33,Nn=Dn=>{if(Dn-kn<Vn){cs.current=requestAnimationFrame(Nn);return}kn=Dn,wa.current+=1;const On=va(wa.current),Pn=ma.current?.deck;if(Pn){const Zn=[...la.current,...On];Pn.setProps({layers:Zn})}cs.current=requestAnimationFrame(Nn)};cs.current=requestAnimationFrame(Nn)})(),()=>{cs.current&&(cancelAnimationFrame(cs.current),cs.current=null)}):void 0),[dc,va]);const fc=React.useMemo(()=>Ys,[Ys]),il=React.useRef(!0),Bl=React.useRef(Pt),sl=React.useRef(Lt),Nl=React.useRef(kt),Ml=React.useRef(0),Hl=100;reactExports.useEffect(()=>{if(typeof window.__hoodini_alignCluster=="function"){Bl.current=Pt,sl.current=Lt,Nl.current=kt,il.current&&(il.current=!1);return}const kn=bs.current;if(!kn||Ea.current||performance.now()-Ml.current<Hl)return;const Nn=Pt!==Bl.current,Dn=Lt!==sl.current,On=kt!==Nl.current;window._visualConfigUpdateTime&&(performance.now()-window._visualConfigUpdateTime,window._visualConfigUpdateTime=null);let Pn=!1;if((Nn||Dn||On||il.current)&&!(il.current&&!Nn&&!Dn&&!On)){const sr=performance.now();if(Pt!=null&&Pt!=="")kn.alignCluster(Pt),Pn=!0;else{const fr=Object.values(kn.hoodRanges||{}).some(mr=>mr.align_gene);kt&&fr?(kn.alignByDefaultGenes(),Pn=!0):Lt==="center"?(kn.alignAllToCenter(),Pn=!0):Lt==="end"?(kn.alignAllToEnd(),Pn=!0):(kn.alignAllToStart(),Pn=!0)}Ml.current=sr}Pn?wi(Zn=>Zn+1):il.current,il.current&&(il.current=!1),Bl.current=Pt,sl.current=Lt,Nl.current=kt},[Pt,Lt,kt]),reactExports.useEffect(()=>{!bs.current||Ni.width===0&&Ni.height},[Ni,tn]),React.useRef(!1),React.useRef(null);const ko=Math.max(0,Ni.height-(Ot?Xi:0)),Zs=React.useRef(Es);return React.useEffect(()=>{Zs.current=Es},[Es]),reactExports.useImperativeHandle(_n,()=>({exportToSVG:()=>{let En=Zs.current||Es;if(!Ys||!En){console.warn("🖼️ HoodiniViz.exportToSVG - missing layers or viewState, aborting");return}let kn=null;if(rr&&or&&vr){const mr=or.unit==="mm"?300:96,Pr=1/25.4;let Ur,Rr;or.unit==="mm"?(Ur=or.width*Pr*mr,Rr=or.height*Pr*mr):(Ur=or.width,Rr=or.height);const Wr=40,$r=Ni.width-2*Wr,qr=ko-2*Wr,Vr=$r/Ur,ri=qr/Rr,Ei=Math.min(Vr,ri),Di=Ur*Ei,Hi=Rr*Ei,Pi=(Ni.width-Di)/2,Qi=(ko-Hi)/2,Si=Pi+Di,Ci=Qi+Hi,Ai=Math.pow(2,En.zoom||0),Xs=En.target[0],Ks=En.target[1],fa=Qs=>Xs+(Qs-Ni.width/2)/Ai,ra=Qs=>Ks+(ko/2-Qs)/Ai;kn={minX:fa(Pi),maxX:fa(Si),minY:ra(Ci),maxY:ra(Qi)}}const Vn=Ot?{minX:Ii.minX,maxX:Ii.maxX,width:Ni.width,height:ko,config:{...qt,tree:{...qt.tree,xScalePercent:ws}},viewState:En,alignmentReferencePoint:go(bs.current),bounds:Ii,genomeView:bs.current,precomputedTicks:$o.current?$o.current.getTicks():void 0,showTreeLayer:Wn&&po,showTreeTextLayer:xr&&po}:void 0,Nn=Ys.filter(mr=>{if(!mr||!mr.id)return!0;const Pr=mr.id;return Pr==="phylo-tree"||Pr==="nodes"||Pr==="tree-nodes"?Wn:Pr==="phylo-labels"?xr:Pr==="genes"?br:Pr==="gene-labels"?wr:Pr==="domains"||Pr.startsWith("domains-")?Fr:Pr==="protein-polygons"?Cr:Pr==="nucleotide-polygons"?dr:Pr==="ncrna-features"?_r:Pr==="region-polygons"?pr:!0}),Dn=exportToSVG(Nn,En,{width:Ni.width,height:ko},qt,Ot?Vn:void 0,An,5,1,rr&&or?{scaleToFormat:!0,formatPreset:or,guideBounds:vr?kn:null,scaleRulerWithCrop:cr}:void 0);if(!Dn)return;let On=Dn,Pn="hoodini-viz-export.svg";if(rr&&or){const mr=new Date().toISOString().slice(0,19).replace(/[:-]/g,"");Pn=`hoodini_${or.name.toLowerCase().replace(/\s+/g,"_")}_${mr}.svg`}const Zn=new Blob([On],{type:"image/svg+xml"}),sr=URL.createObjectURL(Zn),fr=document.createElement("a");fr.href=sr,fr.download=Pn,document.body.appendChild(fr),fr.click(),document.body.removeChild(fr),URL.revokeObjectURL(sr)},genomeView:bs.current,forceAlignUpdate:()=>{try{return wi(En=>En+1),!0}catch{return!1}},alignCluster:En=>{try{const kn=bs.current;return!kn||typeof kn.alignCluster!="function"?!1:(kn.alignCluster(En),wi(Vn=>Vn+1),!0)}catch{return!1}},alignByDefaultGenes:()=>{try{const En=bs.current;return!En||typeof En.alignByDefaultGenes!="function"?!1:(En.alignByDefaultGenes(),wi(kn=>kn+1),!0)}catch{return!1}},focusFeatureByPosition:(En,kn,Vn,Nn="region",Dn=null)=>{try{if(Io(),xo(),ca(),!En||kn==null||Vn==null)return!1;const On=bs.current;if(!On)return!1;const Pn=String(En),sr=Nn==="ncRNA"||Nn==="ncRNA_gene"?On.getAllNcRNAs?.()||[]:On.getAllRegions?.()||[];console.log(`[focusFeatureByPosition] Searching for ${Nn}:`,{seqid:Pn,start:kn,end:Vn,featureCount:sr.length});let fr=null,mr=null;if(Dn&&(fr=sr.find(ri=>ri.id===Dn),fr&&(mr=fr.hood_id)),!fr){let ri=[];On.hoodRanges?.[Pn]&&ri.push(Pn),On.seqidToHoodsMap?.[Pn]&&ri.push(...On.seqidToHoodsMap[Pn]);for(const Ei of ri){const Di=On.hoodRanges?.[Ei];if(Di&&kn>=Di.origStart&&Vn<=Di.origEnd){const Hi=kn-Di.origStart,Pi=Vn-Di.origStart;if(fr=sr.find(Qi=>Qi.hood_id===Ei&&(Qi.origStart===Hi||Qi.start===Hi||Qi.metadata?.start===Hi)&&(Qi.origEnd===Pi||Qi.end===Pi||Qi.metadata?.end===Pi)),fr){mr=Ei;break}}}}if(!fr){for(const ri of sr)if(ri.metadata?.seqid===Pn||ri.hood_id===Pn||ri.seqid===Pn){const Ei=On.hoodRanges?.[ri.hood_id];if(Ei){const Di=kn-(Ei.origStart||0),Hi=Vn-(Ei.origStart||0);if(ri.metadata?.start===Di&&ri.metadata?.end===Hi||ri.origStart===Di&&ri.origEnd===Hi){fr=ri,mr=ri.hood_id;break}}}}if(!fr||!mr)return console.warn(`[focusFeatureByPosition] ${Nn} not found. seqid:`,Pn,"start:",kn,"end:",Vn),!1;if(console.log(`[focusFeatureByPosition] Found ${Nn}:`,{id:fr.id,hood_id:mr,start:fr.start,end:fr.end}),!On.hoodRanges?.[mr])return console.warn("[focusFeatureByPosition] No hoodRange found for hood:",mr),!1;const Ur=On.getTrackYByHoodId?.(mr);if(Ur==null)return console.warn("[focusFeatureByPosition] No trackY found for hood:",mr),!1;const Rr=(fr.start+fr.end)/2,Wr=fr.trackY??Ur;console.log(`[focusFeatureByPosition] ${Nn} colors:`,{fillColor:fr.fillColor,strokeColor:fr.strokeColor,color:fr.color});let $r=[255,180,50,255];if(fr.fillColor&&Array.isArray(fr.fillColor)&&fr.fillColor[3]!==0)$r=fr.fillColor;else if(fr.color&&Array.isArray(fr.color)&&fr.color[3]!==0)$r=fr.color;else if(fr.strokeColor&&Array.isArray(fr.strokeColor)&&fr.strokeColor[3]!==0)$r=fr.strokeColor;else if(typeof fr.getStrokeColor=="function"){const ri=fr.getStrokeColor();ri&&Array.isArray(ri)&&ri[3]!==0&&($r=ri)}const qr={id:fr.id,polygon:fr.polygon,startX:fr.start,endX:fr.end,trackY:fr.trackY,strokeColor:$r,fillColor:$r,featureType:Nn,hoodId:mr};Uo(qr);const Vr=Zs.current&&Zs.current.zoom!==void 0?Zs.current.zoom:Es.zoom||-3;return Ds(ri=>({...ri,target:[Rr,Wr,0],zoom:Vr})),Zs.current={...Zs.current||{},target:[Rr,Wr,0],zoom:Vr},!0}catch(On){return console.error("[focusFeatureByPosition] Error:",On),!1}},focusGeneById:En=>{try{if(!En)return!1;const kn=bs.current;if(!kn)return!1;const Vn=String(En);let Nn=null;if(kn._genesByOriginalId&&typeof kn._genesByOriginalId.get=="function"){const sr=kn._genesByOriginalId.get(Vn);sr&&sr.length&&(Nn=sr[0])}if(!Nn)for(const[sr,fr]of Object.entries(kn.genesById||{})){const mr=fr.originalGeneId||fr.gene_id||fr.originalId||fr.id||fr.metadata&&(fr.metadata.gene_id||fr.metadata.id);if(mr&&String(mr)===Vn){Nn=sr;break}}if(!Nn)return!1;const Dn=kn.genesById[Nn];if(!Dn)return!1;const On=(Dn.start+Dn.end)/2,Pn=Dn.trackY||0,Zn=Zs.current&&Zs.current.zoom!==void 0?Zs.current.zoom:Es.zoom||-3;return Ds(sr=>({...sr,target:[On,Pn,0],zoom:Zn})),Zs.current={...Zs.current||{},target:[On,Pn,0],zoom:Zn},za(Nn,Dn),!0}catch{return!1}},focusBaselineByHood:En=>{try{if(Io(),xo(),ca(),!En)return!1;const kn=bs.current;if(!kn||!kn.hoodRanges)return!1;const Vn=String(En),Nn=kn.hoodRanges[Vn];if(!Nn)return!1;const Dn=kn.trackOffset&&kn.trackOffset[Vn]||0,On=kn.trackFlipped?!!kn.trackFlipped[Vn]:!1,Pn=Nn.length/2,Zn=0,sr=Nn.length,fr=kn.constructor.getTransformedXUnified(Zn,Pn,Dn,On),mr=kn.constructor.getTransformedXUnified(sr,Pn,Dn,On),Pr=kr.genome&&typeof kr.genome.xScalePercent=="number"?kr.genome.xScalePercent/100:1,Ur=Pn+(fr-Pn)*Pr,Rr=Pn+(mr-Pn)*Pr,Wr=(Ur+Rr)/2,$r=typeof kn.getTrackYByHoodId=="function"&&kn.getTrackYByHoodId(Vn)||0,qr=Zs.current&&Zs.current.zoom!==void 0?Zs.current.zoom:Es.zoom||-3;Ds(Ei=>({...Ei,target:[Wr,$r,0],zoom:qr})),Zs.current={...Zs.current||{},target:[Wr,$r,0],zoom:qr},ea.current=!0;const Vr=kn.hoodToSeqidMap?kn.hoodToSeqidMap[Vn]:null;return Fo([{hood_id:Vn,seqid:Vr,start:Ur,end:Rr,trackY:$r}]),setTimeout(()=>{ea.current=!1},100),!0}catch{return!1}},focusTreeLeafById:En=>{try{if(!En)return!1;const kn=us;if(!kn||!Array.isArray(kn.leafNodes))return!1;const Vn=String(En),Nn=kn.leafNodes.find(Wr=>[Wr?.leaf_id,Wr?.metadata?.leaf_id,Wr?.metadata?.leaf_name,Wr?.name,Wr?.metadata?.name].filter($r=>$r!=null).some($r=>String($r)===Vn));if(!Nn)return!1;const Dn=Number.isFinite(Number(Nn.rawY))?Number(Nn.rawY):Number(Nn.y),On=Number.isFinite(Number(Nn.x))?Number(Nn.x):Number(Nn.rawX);if(!Number.isFinite(Dn)||!Number.isFinite(On))return!1;const Pn=qt.tree&&typeof qt.tree.xScalePercent=="number"?qt.tree.xScalePercent/100:1,Zn=Ii.treeOffset||0,sr=[Dn*Pn+Zn,On,0],fr=Zs.current&&Zs.current.zoom!==void 0?Zs.current.zoom:Es.zoom||-3;Ds(Wr=>({...Wr,target:sr,zoom:fr})),Zs.current={...Zs.current||{},target:sr,zoom:fr};const mr=String(Nn.leaf_id||Nn.metadata?.leaf_id||Nn.name||Vn);aa(null),setTimeout(()=>aa(mr),0);const Pr=qt?.tree?.nodeRadius||{internal:4,leaf:2};let Ur=An.treeEdges||[220,180,60,255];if(Ts.current?.nodes){const Wr=Ts.current.nodes.find($r=>$r.leaf_id===mr||$r.name===mr||$r.id===mr||$r.metadata?.leaf_id===mr);Wr?.color&&Array.isArray(Wr.color)&&Wr.color.some($r=>$r>0)&&(Ur=Wr.color)}const Rr=[{id:mr,position:[Dn*Pn+Zn,On],radius:Pr.leaf||2,color:Ur}];return Mo(Rr),!0}catch{return!1}},getLegendData:()=>{try{return Jl()}catch{return null}},geneColorMap:ss}),[Ys,Es,qt,Ot,Ii,An,ws,ko,za,Io,rr,or,vr,cr]),jsxRuntimeExports.jsxs("div",{id:"phylo-tree-viewer-container",ref:ji,style:{width:"100%",height:"100%",position:"relative",overflow:"hidden",background:An?.background||"var(--background, #ffffff)",color:An?.text||"var(--foreground, #222)"},children:[jsxRuntimeExports.jsx(DeckGL,{ref:ma,views:[new OrthographicView({flipY:!1})],controller:{dragPan:!0,dragRotate:!1,scrollZoom:{smooth:!1,speed:.01},doubleClickZoom:!1,keyboard:!1,inertia:!0,transitionDuration:0,touchZoom:!0,touchRotate:!1},onViewStateChange:En=>{try{const kn=En.viewState;if(In){Zs.current=kn;return}const Vn=qt?.scrollbar?.panPaddingY??50,Nn=qt?.scrollbar?.panPaddingX??500,Dn=Math.pow(2,kn.zoom||0),On=Math.max(1,Dn*.5),Pn=tn!=="none"?hs||200:0,Zn=Vn*On,sr=(Nn+Pn)*On,fr=ua-Ba||1e3,mr=jo-Oo||1e4,Pr=Ni.height||600,Ur=Ni.width||800,Rr=Math.log2(Pr/(fr*1.5)),Wr=Math.log2(Ur/(mr*1.5)),$r=Math.min(Rr,Wr,qt?.scrollbar?.minZoom??-5),qr=qt?.scrollbar?.maxZoom??2;isFinite(kn.zoom)&&(kn.zoom=Math.max($r,Math.min(qr,kn.zoom)));const Vr=Ba-Zn,ri=ua+Zn;if(isFinite(Vr)&&isFinite(ri)&&ri>Vr){const Hi=kn.target[1],Pi=Math.max(Vr,Math.min(ri,Hi));Pi!==Hi&&(kn.target=[kn.target[0],Pi,kn.target[2]||0])}const Ei=Oo-sr,Di=jo+sr;if(isFinite(Ei)&&isFinite(Di)&&Di>Ei){const Hi=kn.target[0],Pi=Math.max(Ei,Math.min(Di,Hi));Pi!==Hi&&(kn.target=[Pi,kn.target[1],kn.target[2]||0])}Zs.current=kn}catch{}},initialViewState:Es,layers:fc,pickingRadius:100,style:{width:"100%",height:Ot?`${ko}px`:`${ko}px`,position:"absolute",left:"0",top:"0",backgroundColor:"transparent"},getTooltip:Dl,useDevicePixels:!0,_animate:!1,onClick:({object:En,x:kn,y:Vn,srcEvent:Nn})=>{try{console.debug("[HoodiniViz] DeckGL onClick event",{objectType:En&&En.metadata&&En.metadata.type,object:En,x:kn,y:Vn});const Dn=Ii?.treeOffset||0,On=kr?.tree?.nodeRadius||{internal:4,leaf:2},Pn=En&&En.node&&Array.isArray(En.node.branchset)&&En.node.branchset.length===0;if(Pn){const Rr=En.node?.leaf_id||En.node?.metadata?.leaf_id||En.node?.metadata?.leaf_name||En.node?.name||En.node?.id;if(Rr){aa(null),setTimeout(()=>aa(String(Rr)),0);const Wr=Number.isFinite(Number(En.rawY))?Number(En.rawY):Number.isFinite(Number(En.node?.y))?Number(En.node.y):Number(En.node?.rawY),$r=Number.isFinite(Number(En.x))?Number(En.x):Number(En.node?.x),qr=kr.tree&&typeof kr.tree.xScalePercent=="number"?kr.tree.xScalePercent/100:1;Number.isFinite(Wr)&&Number.isFinite($r)&&Mo([{id:Rr,position:[Wr*qr+Dn,$r],radius:En.radius||On.leaf||2,color:En.color||En.node?.color||An.treeEdges||[220,180,60,255]}])}}const Zn=En&&(En.type==="gene"||En.gene),sr=En&&En.type==="hood",fr=En&&En.type==="region",mr=En&&(En.type==="ncRNA"||En.type==="ncRNA_gene"),Pr=Rr=>{try{if(!Rr||!jt||Object.keys(jt).length===0)return;const Wr=Ci=>{if(!Ci||typeof Ci!="object")return Ci;const Ai={...Ci};return Ai.sequence||(Ai.sequence=Ai.rna_sequence||Ai.sequence_nt||Ai.nucleotide_sequence||Ai.rna_seq||Ai.seq||null),Ai.structure||(Ai.structure=Ai.secondary_structure||Ai.dot_bracket||Ai.dbn||Ai.structure_dbn||null),Ai.type||(Ai.type=Ai.ncrna_type||Ai.rna_type||Ai.subtype||null),Ai},$r=bs.current,qr=Rr.hood_id||Rr.hoodId||($r&&$r.getHoodIdFromSeqid?$r.getHoodIdFromSeqid(Rr.seqid):null),Vr=qr&&$r&&$r.hoodRanges?$r.hoodRanges[qr]:null,ri=Vr&&Number.isFinite(Number(Vr.start))?Number(Vr.start):null,Ei=Number.isFinite(Number(Rr.origStart))?Number(Rr.origStart):Number(Rr.start),Di=Number.isFinite(Number(Rr.origEnd))?Number(Rr.origEnd):Number(Rr.end),Hi=Ci=>Ci&&jt[Ci]?(Rr.metadata={...Rr.metadata||{},...Wr(jt[Ci])},!0):!1;if(ri!==null&&Number.isFinite(Ei)&&Number.isFinite(Di)){const Ci=Ei+ri,Ai=Di+ri,Xs=`${Rr.seqid}:${Ci}:${Ai}`;if(Hi(Xs))return}const Pi=`${Rr.seqid}:${Ei}:${Di}`;if(Hi(Pi))return;const Qi=`${Rr.seqid}:${Di}:${Ei}`;if(Hi(Qi))return;const Si=Rr.id||Rr.originalId;if(Hi(Si))return}catch(Wr){console.debug("[HoodiniViz] ncRNA click-time metadata hydration failed",Wr)}};if(Zn){const Rr=En.id||En.uniqueId||En.gene&&(En.gene.uniqueId||En.gene.id||En.gene.gene_id||En.gene.originalGeneId);Rr&&za(Rr,En),Ga(),wo(),xo(),ca()}else fr?(Uo(En),Io(),Ga(),wo(),ca()):mr?(Vi(En),Pr(En),Io(),Ga(),wo(),xo()):(Io(),xo(),ca());if(sr||Ga(),Pn||wo(),En&&En.node&&En.node.branchset&&En.node.branchset.length>0){const Rr=En.node;if(ci&&ci.id===Rr.id)console.debug("[HoodiniViz] deselecting node",Rr.id),xi(null),Fl();else{console.debug("[HoodiniViz] selecting node",Rr.id),xi(Rr);const Wr=Number.isFinite(Number(En.rawY))?Number(En.rawY):Number.isFinite(Number(Rr.y))?Number(Rr.y):Number(Rr.rawY),$r=Number.isFinite(Number(En.x))?Number(En.x):Number(Rr.x),qr=kr.tree&&typeof kr.tree.xScalePercent=="number"?kr.tree.xScalePercent/100:1;Number.isFinite(Wr)&&Number.isFinite($r)&&Va([{id:Rr.id,position:[Wr*qr+Dn,$r],radius:En.radius||On&&On.internal||4,color:En.color||An.treeEdges||[100,180,255,255]}])}}}catch(Dn){console.warn("[HoodiniViz] onClick handler error",Dn)}if(En&&Mt){try{console.debug("[HoodiniViz] forwarding click to onObjectClick",En&&(En.type||En.metadata&&En.metadata.type||En.node&&"tree-node"))}catch{}Mt(En)}En||(Io(),Ga(),wo(),xo(),ca())}}),Ot&&jsxRuntimeExports.jsx("div",{style:{position:"absolute",left:"0",bottom:"0",width:"100%",height:`${Xi}px`,transform:"translateX(0)",zIndex:1},children:jsxRuntimeExports.jsx(RulerWidget,{ref:$o,minX:Ii.minX,maxX:Ii.maxX,viewState:Es,viewStateRef:Zs,containerWidth:Ni.width,containerHeight:ko,visible:Ot,genomeView:bs.current,hasNewick:po,alignmentReferencePoint:go(bs.current),bounds:Ii,config:kr})}),St&&jsxRuntimeExports.jsx(ScrollbarWidget,{minY:Ya,maxY:Yo,scrollNorm:wl,setScrollNorm:cl,visibleFraction:As,setViewState:Ds,containerHeight:ko,viewState:Es,viewStateRef:Zs,config:qt,themeColors:An}),jsxRuntimeExports.jsx(GuideOverlay,{visible:In,formatPreset:or,containerWidth:Ni.width,containerHeight:ko,viewState:Es,themeColors:{accent:An.accent,border:An.border}})]})});var _baseHas,hasRequired_baseHas;function require_baseHas(){if(hasRequired_baseHas)return _baseHas;hasRequired_baseHas=1;var yt=Object.prototype,Et=yt.hasOwnProperty;function xt(vt,bt){return vt!=null&&Et.call(vt,bt)}return _baseHas=xt,_baseHas}var isArray_1,hasRequiredIsArray;function requireIsArray(){if(hasRequiredIsArray)return isArray_1;hasRequiredIsArray=1;var yt=Array.isArray;return isArray_1=yt,isArray_1}var _freeGlobal,hasRequired_freeGlobal;function require_freeGlobal(){if(hasRequired_freeGlobal)return _freeGlobal;hasRequired_freeGlobal=1;var yt=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;return _freeGlobal=yt,_freeGlobal}var _root,hasRequired_root;function require_root(){if(hasRequired_root)return _root;hasRequired_root=1;var yt=require_freeGlobal(),Et=typeof self=="object"&&self&&self.Object===Object&&self,xt=yt||Et||Function("return this")();return _root=xt,_root}var _Symbol,hasRequired_Symbol;function require_Symbol(){if(hasRequired_Symbol)return _Symbol;hasRequired_Symbol=1;var yt=require_root(),Et=yt.Symbol;return _Symbol=Et,_Symbol}var _getRawTag,hasRequired_getRawTag;function require_getRawTag(){if(hasRequired_getRawTag)return _getRawTag;hasRequired_getRawTag=1;var yt=require_Symbol(),Et=Object.prototype,xt=Et.hasOwnProperty,vt=Et.toString,bt=yt?yt.toStringTag:void 0;function At(Ft){var Ct=xt.call(Ft,bt),wt=Ft[bt];try{Ft[bt]=void 0;var St=!0}catch{}var Tt=vt.call(Ft);return St&&(Ct?Ft[bt]=wt:delete Ft[bt]),Tt}return _getRawTag=At,_getRawTag}var _objectToString,hasRequired_objectToString;function require_objectToString(){if(hasRequired_objectToString)return _objectToString;hasRequired_objectToString=1;var yt=Object.prototype,Et=yt.toString;function xt(vt){return Et.call(vt)}return _objectToString=xt,_objectToString}var _baseGetTag,hasRequired_baseGetTag;function require_baseGetTag(){if(hasRequired_baseGetTag)return _baseGetTag;hasRequired_baseGetTag=1;var yt=require_Symbol(),Et=require_getRawTag(),xt=require_objectToString(),vt="[object Null]",bt="[object Undefined]",At=yt?yt.toStringTag:void 0;function Ft(Ct){return Ct==null?Ct===void 0?bt:vt:At&&At in Object(Ct)?Et(Ct):xt(Ct)}return _baseGetTag=Ft,_baseGetTag}var isObjectLike_1,hasRequiredIsObjectLike;function requireIsObjectLike(){if(hasRequiredIsObjectLike)return isObjectLike_1;hasRequiredIsObjectLike=1;function yt(Et){return Et!=null&&typeof Et=="object"}return isObjectLike_1=yt,isObjectLike_1}var isSymbol_1,hasRequiredIsSymbol;function requireIsSymbol(){if(hasRequiredIsSymbol)return isSymbol_1;hasRequiredIsSymbol=1;var yt=require_baseGetTag(),Et=requireIsObjectLike(),xt="[object Symbol]";function vt(bt){return typeof bt=="symbol"||Et(bt)&&yt(bt)==xt}return isSymbol_1=vt,isSymbol_1}var _isKey,hasRequired_isKey;function require_isKey(){if(hasRequired_isKey)return _isKey;hasRequired_isKey=1;var yt=requireIsArray(),Et=requireIsSymbol(),xt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vt=/^\w*$/;function bt(At,Ft){if(yt(At))return!1;var Ct=typeof At;return Ct=="number"||Ct=="symbol"||Ct=="boolean"||At==null||Et(At)?!0:vt.test(At)||!xt.test(At)||Ft!=null&&At in Object(Ft)}return _isKey=bt,_isKey}var isObject_1,hasRequiredIsObject;function requireIsObject(){if(hasRequiredIsObject)return isObject_1;hasRequiredIsObject=1;function yt(Et){var xt=typeof Et;return Et!=null&&(xt=="object"||xt=="function")}return isObject_1=yt,isObject_1}var isFunction_1,hasRequiredIsFunction;function requireIsFunction(){if(hasRequiredIsFunction)return isFunction_1;hasRequiredIsFunction=1;var yt=require_baseGetTag(),Et=requireIsObject(),xt="[object AsyncFunction]",vt="[object Function]",bt="[object GeneratorFunction]",At="[object Proxy]";function Ft(Ct){if(!Et(Ct))return!1;var wt=yt(Ct);return wt==vt||wt==bt||wt==xt||wt==At}return isFunction_1=Ft,isFunction_1}var _coreJsData,hasRequired_coreJsData;function require_coreJsData(){if(hasRequired_coreJsData)return _coreJsData;hasRequired_coreJsData=1;var yt=require_root(),Et=yt["__core-js_shared__"];return _coreJsData=Et,_coreJsData}var _isMasked,hasRequired_isMasked;function require_isMasked(){if(hasRequired_isMasked)return _isMasked;hasRequired_isMasked=1;var yt=require_coreJsData(),Et=(function(){var vt=/[^.]+$/.exec(yt&&yt.keys&&yt.keys.IE_PROTO||"");return vt?"Symbol(src)_1."+vt:""})();function xt(vt){return!!Et&&Et in vt}return _isMasked=xt,_isMasked}var _toSource,hasRequired_toSource;function require_toSource(){if(hasRequired_toSource)return _toSource;hasRequired_toSource=1;var yt=Function.prototype,Et=yt.toString;function xt(vt){if(vt!=null){try{return Et.call(vt)}catch{}try{return vt+""}catch{}}return""}return _toSource=xt,_toSource}var _baseIsNative,hasRequired_baseIsNative;function require_baseIsNative(){if(hasRequired_baseIsNative)return _baseIsNative;hasRequired_baseIsNative=1;var yt=requireIsFunction(),Et=require_isMasked(),xt=requireIsObject(),vt=require_toSource(),bt=/[\\^$.*+?()[\]{}|]/g,At=/^\[object .+?Constructor\]$/,Ft=Function.prototype,Ct=Object.prototype,wt=Ft.toString,St=Ct.hasOwnProperty,Tt=RegExp("^"+wt.call(St).replace(bt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Rt(Pt){if(!xt(Pt)||Et(Pt))return!1;var Lt=yt(Pt)?Tt:At;return Lt.test(vt(Pt))}return _baseIsNative=Rt,_baseIsNative}var _getValue,hasRequired_getValue;function require_getValue(){if(hasRequired_getValue)return _getValue;hasRequired_getValue=1;function yt(Et,xt){return Et?.[xt]}return _getValue=yt,_getValue}var _getNative,hasRequired_getNative;function require_getNative(){if(hasRequired_getNative)return _getNative;hasRequired_getNative=1;var yt=require_baseIsNative(),Et=require_getValue();function xt(vt,bt){var At=Et(vt,bt);return yt(At)?At:void 0}return _getNative=xt,_getNative}var _nativeCreate,hasRequired_nativeCreate;function require_nativeCreate(){if(hasRequired_nativeCreate)return _nativeCreate;hasRequired_nativeCreate=1;var yt=require_getNative(),Et=yt(Object,"create");return _nativeCreate=Et,_nativeCreate}var _hashClear,hasRequired_hashClear;function require_hashClear(){if(hasRequired_hashClear)return _hashClear;hasRequired_hashClear=1;var yt=require_nativeCreate();function Et(){this.__data__=yt?yt(null):{},this.size=0}return _hashClear=Et,_hashClear}var _hashDelete,hasRequired_hashDelete;function require_hashDelete(){if(hasRequired_hashDelete)return _hashDelete;hasRequired_hashDelete=1;function yt(Et){var xt=this.has(Et)&&delete this.__data__[Et];return this.size-=xt?1:0,xt}return _hashDelete=yt,_hashDelete}var _hashGet,hasRequired_hashGet;function require_hashGet(){if(hasRequired_hashGet)return _hashGet;hasRequired_hashGet=1;var yt=require_nativeCreate(),Et="__lodash_hash_undefined__",xt=Object.prototype,vt=xt.hasOwnProperty;function bt(At){var Ft=this.__data__;if(yt){var Ct=Ft[At];return Ct===Et?void 0:Ct}return vt.call(Ft,At)?Ft[At]:void 0}return _hashGet=bt,_hashGet}var _hashHas,hasRequired_hashHas;function require_hashHas(){if(hasRequired_hashHas)return _hashHas;hasRequired_hashHas=1;var yt=require_nativeCreate(),Et=Object.prototype,xt=Et.hasOwnProperty;function vt(bt){var At=this.__data__;return yt?At[bt]!==void 0:xt.call(At,bt)}return _hashHas=vt,_hashHas}var _hashSet,hasRequired_hashSet;function require_hashSet(){if(hasRequired_hashSet)return _hashSet;hasRequired_hashSet=1;var yt=require_nativeCreate(),Et="__lodash_hash_undefined__";function xt(vt,bt){var At=this.__data__;return this.size+=this.has(vt)?0:1,At[vt]=yt&&bt===void 0?Et:bt,this}return _hashSet=xt,_hashSet}var _Hash,hasRequired_Hash;function require_Hash(){if(hasRequired_Hash)return _Hash;hasRequired_Hash=1;var yt=require_hashClear(),Et=require_hashDelete(),xt=require_hashGet(),vt=require_hashHas(),bt=require_hashSet();function At(Ft){var Ct=-1,wt=Ft==null?0:Ft.length;for(this.clear();++Ct<wt;){var St=Ft[Ct];this.set(St[0],St[1])}}return At.prototype.clear=yt,At.prototype.delete=Et,At.prototype.get=xt,At.prototype.has=vt,At.prototype.set=bt,_Hash=At,_Hash}var _listCacheClear,hasRequired_listCacheClear;function require_listCacheClear(){if(hasRequired_listCacheClear)return _listCacheClear;hasRequired_listCacheClear=1;function yt(){this.__data__=[],this.size=0}return _listCacheClear=yt,_listCacheClear}var eq_1,hasRequiredEq;function requireEq(){if(hasRequiredEq)return eq_1;hasRequiredEq=1;function yt(Et,xt){return Et===xt||Et!==Et&&xt!==xt}return eq_1=yt,eq_1}var _assocIndexOf,hasRequired_assocIndexOf;function require_assocIndexOf(){if(hasRequired_assocIndexOf)return _assocIndexOf;hasRequired_assocIndexOf=1;var yt=requireEq();function Et(xt,vt){for(var bt=xt.length;bt--;)if(yt(xt[bt][0],vt))return bt;return-1}return _assocIndexOf=Et,_assocIndexOf}var _listCacheDelete,hasRequired_listCacheDelete;function require_listCacheDelete(){if(hasRequired_listCacheDelete)return _listCacheDelete;hasRequired_listCacheDelete=1;var yt=require_assocIndexOf(),Et=Array.prototype,xt=Et.splice;function vt(bt){var At=this.__data__,Ft=yt(At,bt);if(Ft<0)return!1;var Ct=At.length-1;return Ft==Ct?At.pop():xt.call(At,Ft,1),--this.size,!0}return _listCacheDelete=vt,_listCacheDelete}var _listCacheGet,hasRequired_listCacheGet;function require_listCacheGet(){if(hasRequired_listCacheGet)return _listCacheGet;hasRequired_listCacheGet=1;var yt=require_assocIndexOf();function Et(xt){var vt=this.__data__,bt=yt(vt,xt);return bt<0?void 0:vt[bt][1]}return _listCacheGet=Et,_listCacheGet}var _listCacheHas,hasRequired_listCacheHas;function require_listCacheHas(){if(hasRequired_listCacheHas)return _listCacheHas;hasRequired_listCacheHas=1;var yt=require_assocIndexOf();function Et(xt){return yt(this.__data__,xt)>-1}return _listCacheHas=Et,_listCacheHas}var _listCacheSet,hasRequired_listCacheSet;function require_listCacheSet(){if(hasRequired_listCacheSet)return _listCacheSet;hasRequired_listCacheSet=1;var yt=require_assocIndexOf();function Et(xt,vt){var bt=this.__data__,At=yt(bt,xt);return At<0?(++this.size,bt.push([xt,vt])):bt[At][1]=vt,this}return _listCacheSet=Et,_listCacheSet}var _ListCache,hasRequired_ListCache;function require_ListCache(){if(hasRequired_ListCache)return _ListCache;hasRequired_ListCache=1;var yt=require_listCacheClear(),Et=require_listCacheDelete(),xt=require_listCacheGet(),vt=require_listCacheHas(),bt=require_listCacheSet();function At(Ft){var Ct=-1,wt=Ft==null?0:Ft.length;for(this.clear();++Ct<wt;){var St=Ft[Ct];this.set(St[0],St[1])}}return At.prototype.clear=yt,At.prototype.delete=Et,At.prototype.get=xt,At.prototype.has=vt,At.prototype.set=bt,_ListCache=At,_ListCache}var _Map,hasRequired_Map;function require_Map(){if(hasRequired_Map)return _Map;hasRequired_Map=1;var yt=require_getNative(),Et=require_root(),xt=yt(Et,"Map");return _Map=xt,_Map}var _mapCacheClear,hasRequired_mapCacheClear;function require_mapCacheClear(){if(hasRequired_mapCacheClear)return _mapCacheClear;hasRequired_mapCacheClear=1;var yt=require_Hash(),Et=require_ListCache(),xt=require_Map();function vt(){this.size=0,this.__data__={hash:new yt,map:new(xt||Et),string:new yt}}return _mapCacheClear=vt,_mapCacheClear}var _isKeyable,hasRequired_isKeyable;function require_isKeyable(){if(hasRequired_isKeyable)return _isKeyable;hasRequired_isKeyable=1;function yt(Et){var xt=typeof Et;return xt=="string"||xt=="number"||xt=="symbol"||xt=="boolean"?Et!=="__proto__":Et===null}return _isKeyable=yt,_isKeyable}var _getMapData,hasRequired_getMapData;function require_getMapData(){if(hasRequired_getMapData)return _getMapData;hasRequired_getMapData=1;var yt=require_isKeyable();function Et(xt,vt){var bt=xt.__data__;return yt(vt)?bt[typeof vt=="string"?"string":"hash"]:bt.map}return _getMapData=Et,_getMapData}var _mapCacheDelete,hasRequired_mapCacheDelete;function require_mapCacheDelete(){if(hasRequired_mapCacheDelete)return _mapCacheDelete;hasRequired_mapCacheDelete=1;var yt=require_getMapData();function Et(xt){var vt=yt(this,xt).delete(xt);return this.size-=vt?1:0,vt}return _mapCacheDelete=Et,_mapCacheDelete}var _mapCacheGet,hasRequired_mapCacheGet;function require_mapCacheGet(){if(hasRequired_mapCacheGet)return _mapCacheGet;hasRequired_mapCacheGet=1;var yt=require_getMapData();function Et(xt){return yt(this,xt).get(xt)}return _mapCacheGet=Et,_mapCacheGet}var _mapCacheHas,hasRequired_mapCacheHas;function require_mapCacheHas(){if(hasRequired_mapCacheHas)return _mapCacheHas;hasRequired_mapCacheHas=1;var yt=require_getMapData();function Et(xt){return yt(this,xt).has(xt)}return _mapCacheHas=Et,_mapCacheHas}var _mapCacheSet,hasRequired_mapCacheSet;function require_mapCacheSet(){if(hasRequired_mapCacheSet)return _mapCacheSet;hasRequired_mapCacheSet=1;var yt=require_getMapData();function Et(xt,vt){var bt=yt(this,xt),At=bt.size;return bt.set(xt,vt),this.size+=bt.size==At?0:1,this}return _mapCacheSet=Et,_mapCacheSet}var _MapCache,hasRequired_MapCache;function require_MapCache(){if(hasRequired_MapCache)return _MapCache;hasRequired_MapCache=1;var yt=require_mapCacheClear(),Et=require_mapCacheDelete(),xt=require_mapCacheGet(),vt=require_mapCacheHas(),bt=require_mapCacheSet();function At(Ft){var Ct=-1,wt=Ft==null?0:Ft.length;for(this.clear();++Ct<wt;){var St=Ft[Ct];this.set(St[0],St[1])}}return At.prototype.clear=yt,At.prototype.delete=Et,At.prototype.get=xt,At.prototype.has=vt,At.prototype.set=bt,_MapCache=At,_MapCache}var memoize_1,hasRequiredMemoize;function requireMemoize(){if(hasRequiredMemoize)return memoize_1;hasRequiredMemoize=1;var yt=require_MapCache(),Et="Expected a function";function xt(vt,bt){if(typeof vt!="function"||bt!=null&&typeof bt!="function")throw new TypeError(Et);var At=function(){var Ft=arguments,Ct=bt?bt.apply(this,Ft):Ft[0],wt=At.cache;if(wt.has(Ct))return wt.get(Ct);var St=vt.apply(this,Ft);return At.cache=wt.set(Ct,St)||wt,St};return At.cache=new(xt.Cache||yt),At}return xt.Cache=yt,memoize_1=xt,memoize_1}var _memoizeCapped,hasRequired_memoizeCapped;function require_memoizeCapped(){if(hasRequired_memoizeCapped)return _memoizeCapped;hasRequired_memoizeCapped=1;var yt=requireMemoize(),Et=500;function xt(vt){var bt=yt(vt,function(Ft){return At.size===Et&&At.clear(),Ft}),At=bt.cache;return bt}return _memoizeCapped=xt,_memoizeCapped}var _stringToPath,hasRequired_stringToPath;function require_stringToPath(){if(hasRequired_stringToPath)return _stringToPath;hasRequired_stringToPath=1;var yt=require_memoizeCapped(),Et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xt=/\\(\\)?/g,vt=yt(function(bt){var At=[];return bt.charCodeAt(0)===46&&At.push(""),bt.replace(Et,function(Ft,Ct,wt,St){At.push(wt?St.replace(xt,"$1"):Ct||Ft)}),At});return _stringToPath=vt,_stringToPath}var _arrayMap,hasRequired_arrayMap;function require_arrayMap(){if(hasRequired_arrayMap)return _arrayMap;hasRequired_arrayMap=1;function yt(Et,xt){for(var vt=-1,bt=Et==null?0:Et.length,At=Array(bt);++vt<bt;)At[vt]=xt(Et[vt],vt,Et);return At}return _arrayMap=yt,_arrayMap}var _baseToString,hasRequired_baseToString;function require_baseToString(){if(hasRequired_baseToString)return _baseToString;hasRequired_baseToString=1;var yt=require_Symbol(),Et=require_arrayMap(),xt=requireIsArray(),vt=requireIsSymbol(),bt=yt?yt.prototype:void 0,At=bt?bt.toString:void 0;function Ft(Ct){if(typeof Ct=="string")return Ct;if(xt(Ct))return Et(Ct,Ft)+"";if(vt(Ct))return At?At.call(Ct):"";var wt=Ct+"";return wt=="0"&&1/Ct==-1/0?"-0":wt}return _baseToString=Ft,_baseToString}var toString_1,hasRequiredToString;function requireToString(){if(hasRequiredToString)return toString_1;hasRequiredToString=1;var yt=require_baseToString();function Et(xt){return xt==null?"":yt(xt)}return toString_1=Et,toString_1}var _castPath,hasRequired_castPath;function require_castPath(){if(hasRequired_castPath)return _castPath;hasRequired_castPath=1;var yt=requireIsArray(),Et=require_isKey(),xt=require_stringToPath(),vt=requireToString();function bt(At,Ft){return yt(At)?At:Et(At,Ft)?[At]:xt(vt(At))}return _castPath=bt,_castPath}var _baseIsArguments,hasRequired_baseIsArguments;function require_baseIsArguments(){if(hasRequired_baseIsArguments)return _baseIsArguments;hasRequired_baseIsArguments=1;var yt=require_baseGetTag(),Et=requireIsObjectLike(),xt="[object Arguments]";function vt(bt){return Et(bt)&&yt(bt)==xt}return _baseIsArguments=vt,_baseIsArguments}var isArguments_1,hasRequiredIsArguments;function requireIsArguments(){if(hasRequiredIsArguments)return isArguments_1;hasRequiredIsArguments=1;var yt=require_baseIsArguments(),Et=requireIsObjectLike(),xt=Object.prototype,vt=xt.hasOwnProperty,bt=xt.propertyIsEnumerable,At=yt((function(){return arguments})())?yt:function(Ft){return Et(Ft)&&vt.call(Ft,"callee")&&!bt.call(Ft,"callee")};return isArguments_1=At,isArguments_1}var _isIndex,hasRequired_isIndex;function require_isIndex(){if(hasRequired_isIndex)return _isIndex;hasRequired_isIndex=1;var yt=9007199254740991,Et=/^(?:0|[1-9]\d*)$/;function xt(vt,bt){var At=typeof vt;return bt=bt??yt,!!bt&&(At=="number"||At!="symbol"&&Et.test(vt))&&vt>-1&&vt%1==0&&vt<bt}return _isIndex=xt,_isIndex}var isLength_1,hasRequiredIsLength;function requireIsLength(){if(hasRequiredIsLength)return isLength_1;hasRequiredIsLength=1;var yt=9007199254740991;function Et(xt){return typeof xt=="number"&&xt>-1&&xt%1==0&&xt<=yt}return isLength_1=Et,isLength_1}var _toKey,hasRequired_toKey;function require_toKey(){if(hasRequired_toKey)return _toKey;hasRequired_toKey=1;var yt=requireIsSymbol();function Et(xt){if(typeof xt=="string"||yt(xt))return xt;var vt=xt+"";return vt=="0"&&1/xt==-1/0?"-0":vt}return _toKey=Et,_toKey}var _hasPath,hasRequired_hasPath;function require_hasPath(){if(hasRequired_hasPath)return _hasPath;hasRequired_hasPath=1;var yt=require_castPath(),Et=requireIsArguments(),xt=requireIsArray(),vt=require_isIndex(),bt=requireIsLength(),At=require_toKey();function Ft(Ct,wt,St){wt=yt(wt,Ct);for(var Tt=-1,Rt=wt.length,Pt=!1;++Tt<Rt;){var Lt=At(wt[Tt]);if(!(Pt=Ct!=null&&St(Ct,Lt)))break;Ct=Ct[Lt]}return Pt||++Tt!=Rt?Pt:(Rt=Ct==null?0:Ct.length,!!Rt&&bt(Rt)&&vt(Lt,Rt)&&(xt(Ct)||Et(Ct)))}return _hasPath=Ft,_hasPath}var has_1,hasRequiredHas;function requireHas(){if(hasRequiredHas)return has_1;hasRequiredHas=1;var yt=require_baseHas(),Et=require_hasPath();function xt(vt,bt){return vt!=null&&Et(vt,bt,yt)}return has_1=xt,has_1}var hasExports=requireHas();const has$1=getDefaultExportFromCjs(hasExports);function panic(yt="This should not happen"){throw new Error(yt)}function assert(yt,Et="Assertion failed"){if(!yt)return panic(Et)}function assertNever(yt,Et){return panic(Et??"Hell froze over")}function maybe(yt,Et){try{return yt()}catch{return Et}}const has=Object.prototype.hasOwnProperty;function deepEqual(yt,Et){let xt,vt;if(yt===Et)return!0;if(yt&&Et&&(xt=yt.constructor)===Et.constructor){if(xt===Date)return yt.getTime()===Et.getTime();if(xt===RegExp)return yt.toString()===Et.toString();if(xt===Array){if((vt=yt.length)===Et.length)for(;vt--&&deepEqual(yt[vt],Et[vt]););return vt===-1}if(!xt||typeof yt=="object"){vt=0;for(xt in yt)if(has.call(yt,xt)&&++vt&&!has.call(Et,xt)||!(xt in Et)||!deepEqual(yt[xt],Et[xt]))return!1;return Object.keys(Et).length===vt}}return yt!==yt&&Et!==Et}const BooleanEmpty=null,BooleanIndeterminate=void 0;var GridCellKind;(function(yt){yt.Uri="uri",yt.Text="text",yt.Image="image",yt.RowID="row-id",yt.Number="number",yt.Bubble="bubble",yt.Boolean="boolean",yt.Loading="loading",yt.Markdown="markdown",yt.Drilldown="drilldown",yt.Protected="protected",yt.Custom="custom"})(GridCellKind||(GridCellKind={}));var GridColumnIcon;(function(yt){yt.HeaderRowID="headerRowID",yt.HeaderCode="headerCode",yt.HeaderNumber="headerNumber",yt.HeaderString="headerString",yt.HeaderBoolean="headerBoolean",yt.HeaderAudioUri="headerAudioUri",yt.HeaderVideoUri="headerVideoUri",yt.HeaderEmoji="headerEmoji",yt.HeaderImage="headerImage",yt.HeaderUri="headerUri",yt.HeaderPhone="headerPhone",yt.HeaderMarkdown="headerMarkdown",yt.HeaderDate="headerDate",yt.HeaderTime="headerTime",yt.HeaderEmail="headerEmail",yt.HeaderReference="headerReference",yt.HeaderIfThenElse="headerIfThenElse",yt.HeaderSingleValue="headerSingleValue",yt.HeaderLookup="headerLookup",yt.HeaderTextTemplate="headerTextTemplate",yt.HeaderMath="headerMath",yt.HeaderRollup="headerRollup",yt.HeaderJoinStrings="headerJoinStrings",yt.HeaderSplitString="headerSplitString",yt.HeaderGeoDistance="headerGeoDistance",yt.HeaderArray="headerArray",yt.RowOwnerOverlay="rowOwnerOverlay",yt.ProtectedColumnOverlay="protectedColumnOverlay"})(GridColumnIcon||(GridColumnIcon={}));var GridColumnMenuIcon;(function(yt){yt.Triangle="triangle",yt.Dots="dots"})(GridColumnMenuIcon||(GridColumnMenuIcon={}));function isSizedGridColumn(yt){return"width"in yt&&typeof yt.width=="number"}async function resolveCellsThunk(yt){return typeof yt=="object"?yt:await yt()}function isEditableGridCell(yt){return!(yt.kind===GridCellKind.Loading||yt.kind===GridCellKind.Bubble||yt.kind===GridCellKind.RowID||yt.kind===GridCellKind.Protected||yt.kind===GridCellKind.Drilldown)}function isInnerOnlyCell(yt){return yt.kind===InnerGridCellKind.Marker||yt.kind===InnerGridCellKind.NewRow}function isReadWriteCell(yt){if(!isEditableGridCell(yt)||yt.kind===GridCellKind.Image)return!1;switch(yt.kind){case GridCellKind.Text:case GridCellKind.Number:case GridCellKind.Markdown:case GridCellKind.Uri:case GridCellKind.Custom:case GridCellKind.Boolean:return yt.readonly!==!0;default:assertNever(yt,"A cell was passed with an invalid kind")}}function isObjectEditorCallbackResult(yt){return has$1(yt,"editor")}function booleanCellIsEditable(yt){return!(yt.readonly??!1)}var InnerGridCellKind;(function(yt){yt.NewRow="new-row",yt.Marker="marker"})(InnerGridCellKind||(InnerGridCellKind={}));const DEFAULT_FILL_HANDLE={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function mergeRanges(yt){if(yt.length===0)return[];const Et=[...yt],xt=[];Et.sort(function(vt,bt){return vt[0]-bt[0]}),xt.push([...Et[0]]);for(const vt of Et.slice(1)){const bt=xt[xt.length-1];bt[1]<vt[0]?xt.push([...vt]):bt[1]<vt[1]&&(bt[1]=vt[1])}return xt}let emptyCompactSelection;class CompactSelection{items;constructor(Et){this.items=Et}static create=Et=>new CompactSelection(mergeRanges(Et));static empty=()=>emptyCompactSelection??(emptyCompactSelection=new CompactSelection([]));static fromSingleSelection=Et=>CompactSelection.empty().add(Et);static fromArray=Et=>{if(Et.length===0)return CompactSelection.empty();const xt=Et.map(bt=>[bt,bt+1]),vt=mergeRanges(xt);return new CompactSelection(vt)};offset(Et){if(Et===0)return this;const xt=this.items.map(vt=>[vt[0]+Et,vt[1]+Et]);return new CompactSelection(xt)}add(Et){const xt=typeof Et=="number"?[Et,Et+1]:Et,vt=mergeRanges([...this.items,xt]);return new CompactSelection(vt)}remove(Et){const xt=[...this.items],vt=typeof Et=="number"?Et:Et[0],bt=typeof Et=="number"?Et+1:Et[1];for(const[At,Ft]of xt.entries()){const[Ct,wt]=Ft;if(Ct<=bt&&vt<=wt){const St=[];Ct<vt&&St.push([Ct,vt]),bt<wt&&St.push([bt,wt]),xt.splice(At,1,...St)}}return new CompactSelection(xt)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(Et){for(let xt=0;xt<this.items.length;xt++){const[vt,bt]=this.items[xt];if(Et>=vt&&Et<bt)return!0}return!1}hasAll(Et){for(let xt=Et[0];xt<Et[1];xt++)if(!this.hasIndex(xt))return!1;return!0}some(Et){for(const xt of this)if(Et(xt))return!0;return!1}equals(Et){if(Et===this)return!0;if(Et.items.length!==this.items.length)return!1;for(let xt=0;xt<this.items.length;xt++){const vt=Et.items[xt],bt=this.items[xt];if(vt[0]!==bt[0]||vt[1]!==bt[1])return!1}return!0}toArray(){const Et=[];for(const[xt,vt]of this.items)for(let bt=xt;bt<vt;bt++)Et.push(bt);return Et}get length(){let Et=0;for(const[xt,vt]of this.items)Et+=vt-xt;return Et}*[Symbol.iterator](){for(const[Et,xt]of this.items)for(let vt=Et;vt<xt;vt++)yield vt}}function memoize(yt){var Et=Object.create(null);return function(xt){return Et[xt]===void 0&&(Et[xt]=yt(xt)),Et[xt]}}var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,isPropValid=memoize(function(yt){return reactPropsRegex.test(yt)||yt.charCodeAt(0)===111&&yt.charCodeAt(1)===110&&yt.charCodeAt(2)<91}),cx=function(){const Et=Array.prototype.slice.call(arguments).filter(Boolean),xt={},vt=[];Et.forEach(At=>{(At?At.split(" "):[]).forEach(Ct=>{if(Ct.startsWith("atm_")){const[,wt]=Ct.split("_");xt[wt]=Ct}else vt.push(Ct)})});const bt=[];for(const At in xt)Object.prototype.hasOwnProperty.call(xt,At)&&bt.push(xt[At]);return bt.push(...vt),bt.join(" ")},cx_default=cx,isCapital=yt=>yt.toUpperCase()===yt,filterKey=yt=>Et=>yt.indexOf(Et)===-1,omit=(yt,Et)=>{const xt={};return Object.keys(yt).filter(filterKey(Et)).forEach(vt=>{xt[vt]=yt[vt]}),xt};function filterProps(yt,Et,xt){const vt=omit(Et,xt);if(!yt){const bt=typeof isPropValid=="function"?{default:isPropValid}:isPropValid;Object.keys(vt).forEach(At=>{bt.default(At)||delete vt[At]})}return vt}var warnIfInvalid=(yt,Et)=>{};function styled(yt){let Et="";return xt=>{const vt=(At,Ft)=>{const{as:Ct=yt,class:wt=Et}=At,St=xt.propsAsIs===void 0?!(typeof Ct=="string"&&Ct.indexOf("-")===-1&&!isCapital(Ct[0])):xt.propsAsIs,Tt=filterProps(St,At,["as","class"]);Tt.ref=Ft,Tt.className=xt.atomic?cx_default(xt.class,Tt.className||wt):cx_default(Tt.className||wt,xt.class);const{vars:Rt}=xt;if(Rt){const Pt={};for(const Ot in Rt){const Mt=Rt[Ot],It=Mt[0],Nt=Mt[1]||"",Ut=typeof It=="function"?It(At):It;warnIfInvalid(Ut,xt.name),Pt[`--${Ot}`]=`${Ut}${Nt}`}const Lt=Tt.style||{},kt=Object.keys(Lt);kt.length>0&&kt.forEach(Ot=>{Pt[Ot]=Lt[Ot]}),Tt.style=Pt}return yt.__wyw_meta&&yt!==Ct?(Tt.as=Ct,reactExports.createElement(yt,Tt)):reactExports.createElement(Ct,Tt)},bt=reactExports.forwardRef?reactExports.forwardRef(vt):(At=>{const Ft=omit(At,["innerRef"]);return vt(Ft,At.innerRef)});return bt.displayName=xt.name,bt.__wyw_meta={className:xt.class||Et,extends:yt},bt}}var styled_default=styled;const ImageOverlayEditorStyle=styled_default("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var js={},Carousel={},lib={},reactSwipe={},propTypes={exports:{}},ReactPropTypesSecret_1,hasRequiredReactPropTypesSecret;function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;var yt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ReactPropTypesSecret_1=yt,ReactPropTypesSecret_1}var factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var yt=requireReactPropTypesSecret();function Et(){}function xt(){}return xt.resetWarningCache=Et,factoryWithThrowingShims=function(){function vt(Ft,Ct,wt,St,Tt,Rt){if(Rt!==yt){var Pt=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw Pt.name="Invariant Violation",Pt}}vt.isRequired=vt;function bt(){return vt}var At={array:vt,bigint:vt,bool:vt,func:vt,number:vt,object:vt,string:vt,symbol:vt,any:vt,arrayOf:bt,element:vt,elementType:vt,instanceOf:bt,node:vt,objectOf:bt,oneOf:bt,oneOfType:bt,shape:bt,exact:bt,checkPropTypes:xt,resetWarningCache:Et};return At.PropTypes=At,At},factoryWithThrowingShims}var hasRequiredPropTypes;function requirePropTypes(){return hasRequiredPropTypes||(hasRequiredPropTypes=1,propTypes.exports=requireFactoryWithThrowingShims()()),propTypes.exports}var hasRequiredReactSwipe;function requireReactSwipe(){return hasRequiredReactSwipe||(hasRequiredReactSwipe=1,(function(yt){(function(Et,xt){xt(yt,requireReact(),requirePropTypes())})(reactSwipe,function(Et,xt,vt){Object.defineProperty(Et,"__esModule",{value:!0}),Et.setHasSupportToCaptureOption=kt;var bt=Ft(xt),At=Ft(vt);function Ft(Nt){return Nt&&Nt.__esModule?Nt:{default:Nt}}var Ct=Object.assign||function(Nt){for(var Ut=1;Ut<arguments.length;Ut++){var jt=arguments[Ut];for(var Vt in jt)Object.prototype.hasOwnProperty.call(jt,Vt)&&(Nt[Vt]=jt[Vt])}return Nt};function wt(Nt,Ut){var jt={};for(var Vt in Nt)Ut.indexOf(Vt)>=0||Object.prototype.hasOwnProperty.call(Nt,Vt)&&(jt[Vt]=Nt[Vt]);return jt}function St(Nt,Ut){if(!(Nt instanceof Ut))throw new TypeError("Cannot call a class as a function")}var Tt=(function(){function Nt(Ut,jt){for(var Vt=0;Vt<jt.length;Vt++){var zt=jt[Vt];zt.enumerable=zt.enumerable||!1,zt.configurable=!0,"value"in zt&&(zt.writable=!0),Object.defineProperty(Ut,zt.key,zt)}}return function(Ut,jt,Vt){return jt&&Nt(Ut.prototype,jt),Vt&&Nt(Ut,Vt),Ut}})();function Rt(Nt,Ut){if(!Nt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ut&&(typeof Ut=="object"||typeof Ut=="function")?Ut:Nt}function Pt(Nt,Ut){if(typeof Ut!="function"&&Ut!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Ut);Nt.prototype=Object.create(Ut&&Ut.prototype,{constructor:{value:Nt,enumerable:!1,writable:!0,configurable:!0}}),Ut&&(Object.setPrototypeOf?Object.setPrototypeOf(Nt,Ut):Nt.__proto__=Ut)}var Lt=!1;function kt(Nt){Lt=Nt}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){kt(!0)}}))}catch{}function Ot(){var Nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return Lt?Nt:Nt.capture}function Mt(Nt){if("touches"in Nt){var Ut=Nt.touches[0],jt=Ut.pageX,Vt=Ut.pageY;return{x:jt,y:Vt}}var zt=Nt.screenX,Ht=Nt.screenY;return{x:zt,y:Ht}}var It=(function(Nt){Pt(Ut,Nt);function Ut(){var jt;St(this,Ut);for(var Vt=arguments.length,zt=Array(Vt),Ht=0;Ht<Vt;Ht++)zt[Ht]=arguments[Ht];var Wt=Rt(this,(jt=Ut.__proto__||Object.getPrototypeOf(Ut)).call.apply(jt,[this].concat(zt)));return Wt._handleSwipeStart=Wt._handleSwipeStart.bind(Wt),Wt._handleSwipeMove=Wt._handleSwipeMove.bind(Wt),Wt._handleSwipeEnd=Wt._handleSwipeEnd.bind(Wt),Wt._onMouseDown=Wt._onMouseDown.bind(Wt),Wt._onMouseMove=Wt._onMouseMove.bind(Wt),Wt._onMouseUp=Wt._onMouseUp.bind(Wt),Wt._setSwiperRef=Wt._setSwiperRef.bind(Wt),Wt}return Tt(Ut,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,Ot({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,Ot({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(Vt){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(Vt))}},{key:"_onMouseMove",value:function(Vt){this.mouseDown&&this._handleSwipeMove(Vt)}},{key:"_onMouseUp",value:function(Vt){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(Vt)}},{key:"_handleSwipeStart",value:function(Vt){var zt=Mt(Vt),Ht=zt.x,Wt=zt.y;this.moveStart={x:Ht,y:Wt},this.props.onSwipeStart(Vt)}},{key:"_handleSwipeMove",value:function(Vt){if(this.moveStart){var zt=Mt(Vt),Ht=zt.x,Wt=zt.y,Gt=Ht-this.moveStart.x,qt=Wt-this.moveStart.y;this.moving=!0;var Xt=this.props.onSwipeMove({x:Gt,y:qt},Vt);Xt&&Vt.cancelable&&Vt.preventDefault(),this.movePosition={deltaX:Gt,deltaY:qt}}}},{key:"_handleSwipeEnd",value:function(Vt){this.props.onSwipeEnd(Vt);var zt=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-zt?this.props.onSwipeLeft(1,Vt):this.movePosition.deltaX>zt&&this.props.onSwipeRight(1,Vt),this.movePosition.deltaY<-zt?this.props.onSwipeUp(1,Vt):this.movePosition.deltaY>zt&&this.props.onSwipeDown(1,Vt)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(Vt){this.swiper=Vt,this.props.innerRef(Vt)}},{key:"render",value:function(){var Vt=this.props;Vt.tagName;var zt=Vt.className,Ht=Vt.style,Wt=Vt.children;Vt.allowMouseEvents,Vt.onSwipeUp,Vt.onSwipeDown,Vt.onSwipeLeft,Vt.onSwipeRight,Vt.onSwipeStart,Vt.onSwipeMove,Vt.onSwipeEnd,Vt.innerRef,Vt.tolerance;var Gt=wt(Vt,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return bt.default.createElement(this.props.tagName,Ct({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:zt,style:Ht},Gt),Wt)}}]),Ut})(xt.Component);It.displayName="ReactSwipe",It.propTypes={tagName:At.default.string,className:At.default.string,style:At.default.object,children:At.default.node,allowMouseEvents:At.default.bool,onSwipeUp:At.default.func,onSwipeDown:At.default.func,onSwipeLeft:At.default.func,onSwipeRight:At.default.func,onSwipeStart:At.default.func,onSwipeMove:At.default.func,onSwipeEnd:At.default.func,innerRef:At.default.func,tolerance:At.default.number.isRequired},It.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},Et.default=It})})(reactSwipe)),reactSwipe}var hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,(function(yt){(function(Et,xt){xt(yt,requireReactSwipe())})(lib,function(Et,xt){Object.defineProperty(Et,"__esModule",{value:!0});var vt=bt(xt);function bt(At){return At&&At.__esModule?At:{default:At}}Et.default=vt.default})})(lib)),lib}var cssClasses={},classnames={exports:{}};var hasRequiredClassnames;function requireClassnames(){return hasRequiredClassnames||(hasRequiredClassnames=1,(function(yt){(function(){var Et={}.hasOwnProperty;function xt(){for(var At="",Ft=0;Ft<arguments.length;Ft++){var Ct=arguments[Ft];Ct&&(At=bt(At,vt(Ct)))}return At}function vt(At){if(typeof At=="string"||typeof At=="number")return At;if(typeof At!="object")return"";if(Array.isArray(At))return xt.apply(null,At);if(At.toString!==Object.prototype.toString&&!At.toString.toString().includes("[native code]"))return At.toString();var Ft="";for(var Ct in At)Et.call(At,Ct)&&At[Ct]&&(Ft=bt(Ft,Ct));return Ft}function bt(At,Ft){return Ft?At?At+" "+Ft:At+Ft:At}yt.exports?(xt.default=xt,yt.exports=xt):window.classNames=xt})()})(classnames)),classnames.exports}var hasRequiredCssClasses;function requireCssClasses(){if(hasRequiredCssClasses)return cssClasses;hasRequiredCssClasses=1,Object.defineProperty(cssClasses,"__esModule",{value:!0}),cssClasses.default=void 0;var yt=Et(requireClassnames());function Et(bt){return bt&&bt.__esModule?bt:{default:bt}}function xt(bt,At,Ft){return At in bt?Object.defineProperty(bt,At,{value:Ft,enumerable:!0,configurable:!0,writable:!0}):bt[At]=Ft,bt}var vt={ROOT:function(At){return(0,yt.default)(xt({"carousel-root":!0},At||"",!!At))},CAROUSEL:function(At){return(0,yt.default)({carousel:!0,"carousel-slider":At})},WRAPPER:function(At,Ft){return(0,yt.default)({"thumbs-wrapper":!At,"slider-wrapper":At,"axis-horizontal":Ft==="horizontal","axis-vertical":Ft!=="horizontal"})},SLIDER:function(At,Ft){return(0,yt.default)({thumbs:!At,slider:At,animated:!Ft})},ITEM:function(At,Ft,Ct){return(0,yt.default)({thumb:!At,slide:At,selected:Ft,previous:Ct})},ARROW_PREV:function(At){return(0,yt.default)({"control-arrow control-prev":!0,"control-disabled":At})},ARROW_NEXT:function(At){return(0,yt.default)({"control-arrow control-next":!0,"control-disabled":At})},DOT:function(At){return(0,yt.default)({dot:!0,selected:At})}};return cssClasses.default=vt,cssClasses}var Thumbs={},dimensions={},hasRequiredDimensions;function requireDimensions(){if(hasRequiredDimensions)return dimensions;hasRequiredDimensions=1,Object.defineProperty(dimensions,"__esModule",{value:!0}),dimensions.outerWidth=void 0;var yt=function(xt){var vt=xt.offsetWidth,bt=getComputedStyle(xt);return vt+=parseInt(bt.marginLeft)+parseInt(bt.marginRight),vt};return dimensions.outerWidth=yt,dimensions}var CSSTranslate={},hasRequiredCSSTranslate;function requireCSSTranslate(){if(hasRequiredCSSTranslate)return CSSTranslate;hasRequiredCSSTranslate=1,Object.defineProperty(CSSTranslate,"__esModule",{value:!0}),CSSTranslate.default=void 0;var yt=function(xt,vt,bt){var At=xt===0?xt:xt+vt,Ft=bt==="horizontal"?[At,0,0]:[0,At,0],Ct="translate3d",wt="("+Ft.join(",")+")";return Ct+wt};return CSSTranslate.default=yt,CSSTranslate}var window$1={},hasRequiredWindow;function requireWindow(){if(hasRequiredWindow)return window$1;hasRequiredWindow=1,Object.defineProperty(window$1,"__esModule",{value:!0}),window$1.default=void 0;var yt=function(){return window};return window$1.default=yt,window$1}var hasRequiredThumbs;function requireThumbs(){if(hasRequiredThumbs)return Thumbs;hasRequiredThumbs=1,Object.defineProperty(Thumbs,"__esModule",{value:!0}),Thumbs.default=void 0;var yt=wt(requireReact()),Et=Ft(requireCssClasses()),xt=requireDimensions(),vt=Ft(requireCSSTranslate()),bt=Ft(requireLib()),At=Ft(requireWindow());function Ft(Wt){return Wt&&Wt.__esModule?Wt:{default:Wt}}function Ct(){if(typeof WeakMap!="function")return null;var Wt=new WeakMap;return Ct=function(){return Wt},Wt}function wt(Wt){if(Wt&&Wt.__esModule)return Wt;if(Wt===null||St(Wt)!=="object"&&typeof Wt!="function")return{default:Wt};var Gt=Ct();if(Gt&&Gt.has(Wt))return Gt.get(Wt);var qt={},Xt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Kt in Wt)if(Object.prototype.hasOwnProperty.call(Wt,Kt)){var Jt=Xt?Object.getOwnPropertyDescriptor(Wt,Kt):null;Jt&&(Jt.get||Jt.set)?Object.defineProperty(qt,Kt,Jt):qt[Kt]=Wt[Kt]}return qt.default=Wt,Gt&&Gt.set(Wt,qt),qt}function St(Wt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?St=function(qt){return typeof qt}:St=function(qt){return qt&&typeof Symbol=="function"&&qt.constructor===Symbol&&qt!==Symbol.prototype?"symbol":typeof qt},St(Wt)}function Tt(){return Tt=Object.assign||function(Wt){for(var Gt=1;Gt<arguments.length;Gt++){var qt=arguments[Gt];for(var Xt in qt)Object.prototype.hasOwnProperty.call(qt,Xt)&&(Wt[Xt]=qt[Xt])}return Wt},Tt.apply(this,arguments)}function Rt(Wt,Gt){if(!(Wt instanceof Gt))throw new TypeError("Cannot call a class as a function")}function Pt(Wt,Gt){for(var qt=0;qt<Gt.length;qt++){var Xt=Gt[qt];Xt.enumerable=Xt.enumerable||!1,Xt.configurable=!0,"value"in Xt&&(Xt.writable=!0),Object.defineProperty(Wt,Xt.key,Xt)}}function Lt(Wt,Gt,qt){return Gt&&Pt(Wt.prototype,Gt),Wt}function kt(Wt,Gt){if(typeof Gt!="function"&&Gt!==null)throw new TypeError("Super expression must either be null or a function");Wt.prototype=Object.create(Gt&&Gt.prototype,{constructor:{value:Wt,writable:!0,configurable:!0}}),Gt&&Ot(Wt,Gt)}function Ot(Wt,Gt){return Ot=Object.setPrototypeOf||function(Xt,Kt){return Xt.__proto__=Kt,Xt},Ot(Wt,Gt)}function Mt(Wt){var Gt=Ut();return function(){var Xt=jt(Wt),Kt;if(Gt){var Jt=jt(this).constructor;Kt=Reflect.construct(Xt,arguments,Jt)}else Kt=Xt.apply(this,arguments);return It(this,Kt)}}function It(Wt,Gt){return Gt&&(St(Gt)==="object"||typeof Gt=="function")?Gt:Nt(Wt)}function Nt(Wt){if(Wt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Wt}function Ut(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function jt(Wt){return jt=Object.setPrototypeOf?Object.getPrototypeOf:function(qt){return qt.__proto__||Object.getPrototypeOf(qt)},jt(Wt)}function Vt(Wt,Gt,qt){return Gt in Wt?Object.defineProperty(Wt,Gt,{value:qt,enumerable:!0,configurable:!0,writable:!0}):Wt[Gt]=qt,Wt}var zt=function(Gt){return Gt.hasOwnProperty("key")},Ht=(function(Wt){kt(qt,Wt);var Gt=Mt(qt);function qt(Xt){var Kt;return Rt(this,qt),Kt=Gt.call(this,Xt),Vt(Nt(Kt),"itemsWrapperRef",void 0),Vt(Nt(Kt),"itemsListRef",void 0),Vt(Nt(Kt),"thumbsRef",void 0),Vt(Nt(Kt),"setItemsWrapperRef",function(Jt){Kt.itemsWrapperRef=Jt}),Vt(Nt(Kt),"setItemsListRef",function(Jt){Kt.itemsListRef=Jt}),Vt(Nt(Kt),"setThumbsRef",function(Jt,tn){Kt.thumbsRef||(Kt.thumbsRef=[]),Kt.thumbsRef[tn]=Jt}),Vt(Nt(Kt),"updateSizes",function(){if(!(!Kt.props.children||!Kt.itemsWrapperRef||!Kt.thumbsRef)){var Jt=yt.Children.count(Kt.props.children),tn=Kt.itemsWrapperRef.clientWidth,sn=Kt.props.thumbWidth?Kt.props.thumbWidth:(0,xt.outerWidth)(Kt.thumbsRef[0]),Zt=Math.floor(tn/sn),nn=Zt<Jt,rn=nn?Jt-Zt:0;Kt.setState(function(on,ln){return{itemSize:sn,visibleItems:Zt,firstItem:nn?Kt.getFirstItem(ln.selectedItem):0,lastPosition:rn,showArrows:nn}})}}),Vt(Nt(Kt),"handleClickItem",function(Jt,tn,sn){if(!zt(sn)||sn.key==="Enter"){var Zt=Kt.props.onSelectItem;typeof Zt=="function"&&Zt(Jt,tn)}}),Vt(Nt(Kt),"onSwipeStart",function(){Kt.setState({swiping:!0})}),Vt(Nt(Kt),"onSwipeEnd",function(){Kt.setState({swiping:!1})}),Vt(Nt(Kt),"onSwipeMove",function(Jt){var tn=Jt.x;if(!Kt.state.itemSize||!Kt.itemsWrapperRef||!Kt.state.visibleItems)return!1;var sn=0,Zt=yt.Children.count(Kt.props.children),nn=-(Kt.state.firstItem*100)/Kt.state.visibleItems,rn=Math.max(Zt-Kt.state.visibleItems,0),on=-rn*100/Kt.state.visibleItems;nn===sn&&tn>0&&(tn=0),nn===on&&tn<0&&(tn=0);var ln=Kt.itemsWrapperRef.clientWidth,Qt=nn+100/(ln/tn);return Kt.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(fn){Kt.itemsListRef.style[fn]=(0,vt.default)(Qt,"%",Kt.props.axis)}),!0}),Vt(Nt(Kt),"slideRight",function(Jt){Kt.moveTo(Kt.state.firstItem-(typeof Jt=="number"?Jt:1))}),Vt(Nt(Kt),"slideLeft",function(Jt){Kt.moveTo(Kt.state.firstItem+(typeof Jt=="number"?Jt:1))}),Vt(Nt(Kt),"moveTo",function(Jt){Jt=Jt<0?0:Jt,Jt=Jt>=Kt.state.lastPosition?Kt.state.lastPosition:Jt,Kt.setState({firstItem:Jt})}),Kt.state={selectedItem:Xt.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},Kt}return Lt(qt,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(Kt){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==Kt.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,At.default)().addEventListener("resize",this.updateSizes),(0,At.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,At.default)().removeEventListener("resize",this.updateSizes),(0,At.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(Kt){var Jt=Kt;return Kt>=this.state.lastPosition&&(Jt=this.state.lastPosition),Kt<this.state.firstItem+this.state.visibleItems&&(Jt=this.state.firstItem),Kt<this.state.firstItem&&(Jt=Kt),Jt}},{key:"renderItems",value:function(){var Kt=this;return this.props.children.map(function(Jt,tn){var sn=Et.default.ITEM(!1,tn===Kt.state.selectedItem),Zt={key:tn,ref:function(rn){return Kt.setThumbsRef(rn,tn)},className:sn,onClick:Kt.handleClickItem.bind(Kt,tn,Kt.props.children[tn]),onKeyDown:Kt.handleClickItem.bind(Kt,tn,Kt.props.children[tn]),"aria-label":"".concat(Kt.props.labels.item," ").concat(tn+1),style:{width:Kt.props.thumbWidth}};return yt.default.createElement("li",Tt({},Zt,{role:"button",tabIndex:0}),Jt)})}},{key:"render",value:function(){var Kt=this;if(!this.props.children)return null;var Jt=yt.Children.count(this.props.children)>1,tn=this.state.showArrows&&this.state.firstItem>0,sn=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,Zt={},nn=-this.state.firstItem*(this.state.itemSize||0),rn=(0,vt.default)(nn,"px",this.props.axis),on=this.props.transitionTime+"ms";return Zt={WebkitTransform:rn,MozTransform:rn,MsTransform:rn,OTransform:rn,transform:rn,msTransform:rn,WebkitTransitionDuration:on,MozTransitionDuration:on,MsTransitionDuration:on,OTransitionDuration:on,transitionDuration:on,msTransitionDuration:on},yt.default.createElement("div",{className:Et.default.CAROUSEL(!1)},yt.default.createElement("div",{className:Et.default.WRAPPER(!1),ref:this.setItemsWrapperRef},yt.default.createElement("button",{type:"button",className:Et.default.ARROW_PREV(!tn),onClick:function(){return Kt.slideRight()},"aria-label":this.props.labels.leftArrow}),Jt?yt.default.createElement(bt.default,{tagName:"ul",className:Et.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:Zt,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):yt.default.createElement("ul",{className:Et.default.SLIDER(!1,this.state.swiping),ref:function(Qt){return Kt.setItemsListRef(Qt)},style:Zt},this.renderItems()),yt.default.createElement("button",{type:"button",className:Et.default.ARROW_NEXT(!sn),onClick:function(){return Kt.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),qt})(yt.Component);return Thumbs.default=Ht,Vt(Ht,"displayName","Thumbs"),Vt(Ht,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Thumbs}var document$1={},hasRequiredDocument;function requireDocument(){if(hasRequiredDocument)return document$1;hasRequiredDocument=1,Object.defineProperty(document$1,"__esModule",{value:!0}),document$1.default=void 0;var yt=function(){return document};return document$1.default=yt,document$1}var utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1,Object.defineProperty(utils,"__esModule",{value:!0}),utils.setPosition=utils.getPosition=utils.isKeyboardEvent=utils.defaultStatusFormatter=utils.noop=void 0;var yt=requireReact(),Et=xt(requireCSSTranslate());function xt(wt){return wt&&wt.__esModule?wt:{default:wt}}var vt=function(){};utils.noop=vt;var bt=function(St,Tt){return"".concat(St," of ").concat(Tt)};utils.defaultStatusFormatter=bt;var At=function(St){return St?St.hasOwnProperty("key"):!1};utils.isKeyboardEvent=At;var Ft=function(St,Tt){if(Tt.infiniteLoop&&++St,St===0)return 0;var Rt=yt.Children.count(Tt.children);if(Tt.centerMode&&Tt.axis==="horizontal"){var Pt=-St*Tt.centerSlidePercentage,Lt=Rt-1;return St&&(St!==Lt||Tt.infiniteLoop)?Pt+=(100-Tt.centerSlidePercentage)/2:St===Lt&&(Pt+=100-Tt.centerSlidePercentage),Pt}return-St*100};utils.getPosition=Ft;var Ct=function(St,Tt){var Rt={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(Pt){Rt[Pt]=(0,Et.default)(St,"%",Tt)}),Rt};return utils.setPosition=Ct,utils}var animations={},hasRequiredAnimations;function requireAnimations(){if(hasRequiredAnimations)return animations;hasRequiredAnimations=1,Object.defineProperty(animations,"__esModule",{value:!0}),animations.fadeAnimationHandler=animations.slideStopSwipingHandler=animations.slideSwipeAnimationHandler=animations.slideAnimationHandler=void 0;var yt=requireReact(),Et=vt(requireCSSTranslate()),xt=requireUtils();function vt(Rt){return Rt&&Rt.__esModule?Rt:{default:Rt}}function bt(Rt,Pt){var Lt=Object.keys(Rt);if(Object.getOwnPropertySymbols){var kt=Object.getOwnPropertySymbols(Rt);Pt&&(kt=kt.filter(function(Ot){return Object.getOwnPropertyDescriptor(Rt,Ot).enumerable})),Lt.push.apply(Lt,kt)}return Lt}function At(Rt){for(var Pt=1;Pt<arguments.length;Pt++){var Lt=arguments[Pt]!=null?arguments[Pt]:{};Pt%2?bt(Object(Lt),!0).forEach(function(kt){Ft(Rt,kt,Lt[kt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Rt,Object.getOwnPropertyDescriptors(Lt)):bt(Object(Lt)).forEach(function(kt){Object.defineProperty(Rt,kt,Object.getOwnPropertyDescriptor(Lt,kt))})}return Rt}function Ft(Rt,Pt,Lt){return Pt in Rt?Object.defineProperty(Rt,Pt,{value:Lt,enumerable:!0,configurable:!0,writable:!0}):Rt[Pt]=Lt,Rt}var Ct=function(Pt,Lt){var kt={},Ot=Lt.selectedItem,Mt=Ot,It=yt.Children.count(Pt.children)-1,Nt=Pt.infiniteLoop&&(Ot<0||Ot>It);if(Nt)return Mt<0?Pt.centerMode&&Pt.centerSlidePercentage&&Pt.axis==="horizontal"?kt.itemListStyle=(0,xt.setPosition)(-(It+2)*Pt.centerSlidePercentage-(100-Pt.centerSlidePercentage)/2,Pt.axis):kt.itemListStyle=(0,xt.setPosition)(-(It+2)*100,Pt.axis):Mt>It&&(kt.itemListStyle=(0,xt.setPosition)(0,Pt.axis)),kt;var Ut=(0,xt.getPosition)(Ot,Pt),jt=(0,Et.default)(Ut,"%",Pt.axis),Vt=Pt.transitionTime+"ms";return kt.itemListStyle={WebkitTransform:jt,msTransform:jt,OTransform:jt,transform:jt},Lt.swiping||(kt.itemListStyle=At(At({},kt.itemListStyle),{},{WebkitTransitionDuration:Vt,MozTransitionDuration:Vt,OTransitionDuration:Vt,transitionDuration:Vt,msTransitionDuration:Vt})),kt};animations.slideAnimationHandler=Ct;var wt=function(Pt,Lt,kt,Ot){var Mt={},It=Lt.axis==="horizontal",Nt=yt.Children.count(Lt.children),Ut=0,jt=(0,xt.getPosition)(kt.selectedItem,Lt),Vt=Lt.infiniteLoop?(0,xt.getPosition)(Nt-1,Lt)-100:(0,xt.getPosition)(Nt-1,Lt),zt=It?Pt.x:Pt.y,Ht=zt;jt===Ut&&zt>0&&(Ht=0),jt===Vt&&zt<0&&(Ht=0);var Wt=jt+100/(kt.itemSize/Ht),Gt=Math.abs(zt)>Lt.swipeScrollTolerance;return Lt.infiniteLoop&&Gt&&(kt.selectedItem===0&&Wt>-100?Wt-=Nt*100:kt.selectedItem===Nt-1&&Wt<-Nt*100&&(Wt+=Nt*100)),(!Lt.preventMovementUntilSwipeScrollTolerance||Gt||kt.swipeMovementStarted)&&(kt.swipeMovementStarted||Ot({swipeMovementStarted:!0}),Mt.itemListStyle=(0,xt.setPosition)(Wt,Lt.axis)),Gt&&!kt.cancelClick&&Ot({cancelClick:!0}),Mt};animations.slideSwipeAnimationHandler=wt;var St=function(Pt,Lt){var kt=(0,xt.getPosition)(Lt.selectedItem,Pt),Ot=(0,xt.setPosition)(kt,Pt.axis);return{itemListStyle:Ot}};animations.slideStopSwipingHandler=St;var Tt=function(Pt,Lt){var kt=Pt.transitionTime+"ms",Ot="ease-in-out",Mt={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:Ot,msTransitionTimingFunction:Ot,MozTransitionTimingFunction:Ot,WebkitTransitionTimingFunction:Ot,OTransitionTimingFunction:Ot};return Lt.swiping||(Mt=At(At({},Mt),{},{WebkitTransitionDuration:kt,MozTransitionDuration:kt,OTransitionDuration:kt,transitionDuration:kt,msTransitionDuration:kt})),{slideStyle:Mt,selectedStyle:At(At({},Mt),{},{opacity:1,position:"relative"}),prevStyle:At({},Mt)}};return animations.fadeAnimationHandler=Tt,animations}var hasRequiredCarousel;function requireCarousel(){if(hasRequiredCarousel)return Carousel;hasRequiredCarousel=1,Object.defineProperty(Carousel,"__esModule",{value:!0}),Carousel.default=void 0;var yt=Tt(requireReact()),Et=wt(requireLib()),xt=wt(requireCssClasses()),vt=wt(requireThumbs()),bt=wt(requireDocument()),At=wt(requireWindow()),Ft=requireUtils(),Ct=requireAnimations();function wt(Xt){return Xt&&Xt.__esModule?Xt:{default:Xt}}function St(){if(typeof WeakMap!="function")return null;var Xt=new WeakMap;return St=function(){return Xt},Xt}function Tt(Xt){if(Xt&&Xt.__esModule)return Xt;if(Xt===null||Rt(Xt)!=="object"&&typeof Xt!="function")return{default:Xt};var Kt=St();if(Kt&&Kt.has(Xt))return Kt.get(Xt);var Jt={},tn=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var sn in Xt)if(Object.prototype.hasOwnProperty.call(Xt,sn)){var Zt=tn?Object.getOwnPropertyDescriptor(Xt,sn):null;Zt&&(Zt.get||Zt.set)?Object.defineProperty(Jt,sn,Zt):Jt[sn]=Xt[sn]}return Jt.default=Xt,Kt&&Kt.set(Xt,Jt),Jt}function Rt(Xt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rt=function(Jt){return typeof Jt}:Rt=function(Jt){return Jt&&typeof Symbol=="function"&&Jt.constructor===Symbol&&Jt!==Symbol.prototype?"symbol":typeof Jt},Rt(Xt)}function Pt(){return Pt=Object.assign||function(Xt){for(var Kt=1;Kt<arguments.length;Kt++){var Jt=arguments[Kt];for(var tn in Jt)Object.prototype.hasOwnProperty.call(Jt,tn)&&(Xt[tn]=Jt[tn])}return Xt},Pt.apply(this,arguments)}function Lt(Xt,Kt){var Jt=Object.keys(Xt);if(Object.getOwnPropertySymbols){var tn=Object.getOwnPropertySymbols(Xt);Kt&&(tn=tn.filter(function(sn){return Object.getOwnPropertyDescriptor(Xt,sn).enumerable})),Jt.push.apply(Jt,tn)}return Jt}function kt(Xt){for(var Kt=1;Kt<arguments.length;Kt++){var Jt=arguments[Kt]!=null?arguments[Kt]:{};Kt%2?Lt(Object(Jt),!0).forEach(function(tn){Gt(Xt,tn,Jt[tn])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Xt,Object.getOwnPropertyDescriptors(Jt)):Lt(Object(Jt)).forEach(function(tn){Object.defineProperty(Xt,tn,Object.getOwnPropertyDescriptor(Jt,tn))})}return Xt}function Ot(Xt,Kt){if(!(Xt instanceof Kt))throw new TypeError("Cannot call a class as a function")}function Mt(Xt,Kt){for(var Jt=0;Jt<Kt.length;Jt++){var tn=Kt[Jt];tn.enumerable=tn.enumerable||!1,tn.configurable=!0,"value"in tn&&(tn.writable=!0),Object.defineProperty(Xt,tn.key,tn)}}function It(Xt,Kt,Jt){return Kt&&Mt(Xt.prototype,Kt),Xt}function Nt(Xt,Kt){if(typeof Kt!="function"&&Kt!==null)throw new TypeError("Super expression must either be null or a function");Xt.prototype=Object.create(Kt&&Kt.prototype,{constructor:{value:Xt,writable:!0,configurable:!0}}),Kt&&Ut(Xt,Kt)}function Ut(Xt,Kt){return Ut=Object.setPrototypeOf||function(tn,sn){return tn.__proto__=sn,tn},Ut(Xt,Kt)}function jt(Xt){var Kt=Ht();return function(){var tn=Wt(Xt),sn;if(Kt){var Zt=Wt(this).constructor;sn=Reflect.construct(tn,arguments,Zt)}else sn=tn.apply(this,arguments);return Vt(this,sn)}}function Vt(Xt,Kt){return Kt&&(Rt(Kt)==="object"||typeof Kt=="function")?Kt:zt(Xt)}function zt(Xt){if(Xt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Xt}function Ht(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Wt(Xt){return Wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Jt){return Jt.__proto__||Object.getPrototypeOf(Jt)},Wt(Xt)}function Gt(Xt,Kt,Jt){return Kt in Xt?Object.defineProperty(Xt,Kt,{value:Jt,enumerable:!0,configurable:!0,writable:!0}):Xt[Kt]=Jt,Xt}var qt=(function(Xt){Nt(Jt,Xt);var Kt=jt(Jt);function Jt(tn){var sn;Ot(this,Jt),sn=Kt.call(this,tn),Gt(zt(sn),"thumbsRef",void 0),Gt(zt(sn),"carouselWrapperRef",void 0),Gt(zt(sn),"listRef",void 0),Gt(zt(sn),"itemsRef",void 0),Gt(zt(sn),"timer",void 0),Gt(zt(sn),"animationHandler",void 0),Gt(zt(sn),"setThumbsRef",function(nn){sn.thumbsRef=nn}),Gt(zt(sn),"setCarouselWrapperRef",function(nn){sn.carouselWrapperRef=nn}),Gt(zt(sn),"setListRef",function(nn){sn.listRef=nn}),Gt(zt(sn),"setItemsRef",function(nn,rn){sn.itemsRef||(sn.itemsRef=[]),sn.itemsRef[rn]=nn}),Gt(zt(sn),"autoPlay",function(){yt.Children.count(sn.props.children)<=1||(sn.clearAutoPlay(),sn.props.autoPlay&&(sn.timer=setTimeout(function(){sn.increment()},sn.props.interval)))}),Gt(zt(sn),"clearAutoPlay",function(){sn.timer&&clearTimeout(sn.timer)}),Gt(zt(sn),"resetAutoPlay",function(){sn.clearAutoPlay(),sn.autoPlay()}),Gt(zt(sn),"stopOnHover",function(){sn.setState({isMouseEntered:!0},sn.clearAutoPlay)}),Gt(zt(sn),"startOnLeave",function(){sn.setState({isMouseEntered:!1},sn.autoPlay)}),Gt(zt(sn),"isFocusWithinTheCarousel",function(){return sn.carouselWrapperRef?!!((0,bt.default)().activeElement===sn.carouselWrapperRef||sn.carouselWrapperRef.contains((0,bt.default)().activeElement)):!1}),Gt(zt(sn),"navigateWithKeyboard",function(nn){if(sn.isFocusWithinTheCarousel()){var rn=sn.props.axis,on=rn==="horizontal",ln={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},Qt=on?ln.ArrowRight:ln.ArrowDown,fn=on?ln.ArrowLeft:ln.ArrowUp;Qt===nn.keyCode?sn.increment():fn===nn.keyCode&&sn.decrement()}}),Gt(zt(sn),"updateSizes",function(){if(!(!sn.state.initialized||!sn.itemsRef||sn.itemsRef.length===0)){var nn=sn.props.axis==="horizontal",rn=sn.itemsRef[0];if(rn){var on=nn?rn.clientWidth:rn.clientHeight;sn.setState({itemSize:on}),sn.thumbsRef&&sn.thumbsRef.updateSizes()}}}),Gt(zt(sn),"setMountState",function(){sn.setState({hasMount:!0}),sn.updateSizes()}),Gt(zt(sn),"handleClickItem",function(nn,rn){if(yt.Children.count(sn.props.children)!==0){if(sn.state.cancelClick){sn.setState({cancelClick:!1});return}sn.props.onClickItem(nn,rn),nn!==sn.state.selectedItem&&sn.setState({selectedItem:nn})}}),Gt(zt(sn),"handleOnChange",function(nn,rn){yt.Children.count(sn.props.children)<=1||sn.props.onChange(nn,rn)}),Gt(zt(sn),"handleClickThumb",function(nn,rn){sn.props.onClickThumb(nn,rn),sn.moveTo(nn)}),Gt(zt(sn),"onSwipeStart",function(nn){sn.setState({swiping:!0}),sn.props.onSwipeStart(nn)}),Gt(zt(sn),"onSwipeEnd",function(nn){sn.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),sn.props.onSwipeEnd(nn),sn.clearAutoPlay(),sn.state.autoPlay&&sn.autoPlay()}),Gt(zt(sn),"onSwipeMove",function(nn,rn){sn.props.onSwipeMove(rn);var on=sn.props.swipeAnimationHandler(nn,sn.props,sn.state,sn.setState.bind(zt(sn)));return sn.setState(kt({},on)),!!Object.keys(on).length}),Gt(zt(sn),"decrement",function(){var nn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;sn.moveTo(sn.state.selectedItem-(typeof nn=="number"?nn:1))}),Gt(zt(sn),"increment",function(){var nn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;sn.moveTo(sn.state.selectedItem+(typeof nn=="number"?nn:1))}),Gt(zt(sn),"moveTo",function(nn){if(typeof nn=="number"){var rn=yt.Children.count(sn.props.children)-1;nn<0&&(nn=sn.props.infiniteLoop?rn:0),nn>rn&&(nn=sn.props.infiniteLoop?0:rn),sn.selectItem({selectedItem:nn}),sn.state.autoPlay&&sn.state.isMouseEntered===!1&&sn.resetAutoPlay()}}),Gt(zt(sn),"onClickNext",function(){sn.increment(1)}),Gt(zt(sn),"onClickPrev",function(){sn.decrement(1)}),Gt(zt(sn),"onSwipeForward",function(){sn.increment(1),sn.props.emulateTouch&&sn.setState({cancelClick:!0})}),Gt(zt(sn),"onSwipeBackwards",function(){sn.decrement(1),sn.props.emulateTouch&&sn.setState({cancelClick:!0})}),Gt(zt(sn),"changeItem",function(nn){return function(rn){(!(0,Ft.isKeyboardEvent)(rn)||rn.key==="Enter")&&sn.moveTo(nn)}}),Gt(zt(sn),"selectItem",function(nn){sn.setState(kt({previousItem:sn.state.selectedItem},nn),function(){sn.setState(sn.animationHandler(sn.props,sn.state))}),sn.handleOnChange(nn.selectedItem,yt.Children.toArray(sn.props.children)[nn.selectedItem])}),Gt(zt(sn),"getInitialImage",function(){var nn=sn.props.selectedItem,rn=sn.itemsRef&&sn.itemsRef[nn],on=rn&&rn.getElementsByTagName("img")||[];return on[0]}),Gt(zt(sn),"getVariableItemHeight",function(nn){var rn=sn.itemsRef&&sn.itemsRef[nn];if(sn.state.hasMount&&rn&&rn.children.length){var on=rn.children[0].getElementsByTagName("img")||[];if(on.length>0){var ln=on[0];if(!ln.complete){var Qt=function mn(){sn.forceUpdate(),ln.removeEventListener("load",mn)};ln.addEventListener("load",Qt)}}var fn=on[0]||rn.children[0],pn=fn.clientHeight;return pn>0?pn:null}return null});var Zt={initialized:!1,previousItem:tn.selectedItem,selectedItem:tn.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:tn.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return sn.animationHandler=typeof tn.animationHandler=="function"&&tn.animationHandler||tn.animationHandler==="fade"&&Ct.fadeAnimationHandler||Ct.slideAnimationHandler,sn.state=kt(kt({},Zt),sn.animationHandler(tn,Zt)),sn}return It(Jt,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(sn,Zt){!sn.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!sn.autoFocus&&this.props.autoFocus&&this.forceFocus(),Zt.swiping&&!this.state.swiping&&this.setState(kt({},this.props.stopSwipingHandler(this.props,this.state))),(sn.selectedItem!==this.props.selectedItem||sn.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),sn.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var sn=this;this.bindEvents(),this.state.autoPlay&&yt.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var Zt=sn.getInitialImage();Zt&&!Zt.complete?Zt.addEventListener("load",sn.setMountState):sn.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var sn=this.carouselWrapperRef;this.props.stopOnHover&&sn&&(sn.addEventListener("mouseenter",this.stopOnHover),sn.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var sn=this.carouselWrapperRef;this.props.stopOnHover&&sn&&(sn.removeEventListener("mouseenter",this.stopOnHover),sn.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,At.default)().addEventListener("resize",this.updateSizes),(0,At.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,bt.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,At.default)().removeEventListener("resize",this.updateSizes),(0,At.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var sn=this.getInitialImage();sn&&sn.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,bt.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var sn;(sn=this.carouselWrapperRef)===null||sn===void 0||sn.focus()}},{key:"renderItems",value:function(sn){var Zt=this;return this.props.children?yt.Children.map(this.props.children,function(nn,rn){var on=rn===Zt.state.selectedItem,ln=rn===Zt.state.previousItem,Qt=on&&Zt.state.selectedStyle||ln&&Zt.state.prevStyle||Zt.state.slideStyle||{};Zt.props.centerMode&&Zt.props.axis==="horizontal"&&(Qt=kt(kt({},Qt),{},{minWidth:Zt.props.centerSlidePercentage+"%"})),Zt.state.swiping&&Zt.state.swipeMovementStarted&&(Qt=kt(kt({},Qt),{},{pointerEvents:"none"}));var fn={ref:function(mn){return Zt.setItemsRef(mn,rn)},key:"itemKey"+rn+(sn?"clone":""),className:xt.default.ITEM(!0,rn===Zt.state.selectedItem,rn===Zt.state.previousItem),onClick:Zt.handleClickItem.bind(Zt,rn,nn),style:Qt};return yt.default.createElement("li",fn,Zt.props.renderItem(nn,{isSelected:rn===Zt.state.selectedItem,isPrevious:rn===Zt.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var sn=this,Zt=this.props,nn=Zt.showIndicators,rn=Zt.labels,on=Zt.renderIndicator,ln=Zt.children;return nn?yt.default.createElement("ul",{className:"control-dots"},yt.Children.map(ln,function(Qt,fn){return on&&on(sn.changeItem(fn),fn===sn.state.selectedItem,fn,rn.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?yt.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,yt.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||yt.Children.count(this.props.children)===0?null:yt.default.createElement(vt.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var sn=this;if(!this.props.children||yt.Children.count(this.props.children)===0)return null;var Zt=this.props.swipeable&&yt.Children.count(this.props.children)>1,nn=this.props.axis==="horizontal",rn=this.props.showArrows&&yt.Children.count(this.props.children)>1,on=rn&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ln=rn&&(this.state.selectedItem<yt.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,Qt=this.renderItems(!0),fn=Qt.shift(),pn=Qt.pop(),mn={className:xt.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},vn={};if(nn){if(mn.onSwipeLeft=this.onSwipeForward,mn.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var yn=this.getVariableItemHeight(this.state.selectedItem);vn.height=yn||"auto"}}else mn.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,mn.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,mn.style=kt(kt({},mn.style),{},{height:this.state.itemSize}),vn.height=this.state.itemSize;return yt.default.createElement("div",{"aria-label":this.props.ariaLabel,className:xt.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},yt.default.createElement("div",{className:xt.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,on,this.props.labels.leftArrow),yt.default.createElement("div",{className:xt.default.WRAPPER(!0,this.props.axis),style:vn},Zt?yt.default.createElement(Et.default,Pt({tagName:"ul",innerRef:this.setListRef},mn,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&pn,this.renderItems(),this.props.infiniteLoop&&fn):yt.default.createElement("ul",{className:xt.default.SLIDER(!0,this.state.swiping),ref:function(Mn){return sn.setListRef(Mn)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&pn,this.renderItems(),this.props.infiniteLoop&&fn)),this.props.renderArrowNext(this.onClickNext,ln,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),Jt})(yt.default.Component);return Carousel.default=qt,Gt(qt,"displayName","Carousel"),Gt(qt,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:Ft.noop,onClickThumb:Ft.noop,onChange:Ft.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(Kt,Jt,tn){return yt.default.createElement("button",{type:"button","aria-label":tn,className:xt.default.ARROW_PREV(!Jt),onClick:Kt})},renderArrowNext:function(Kt,Jt,tn){return yt.default.createElement("button",{type:"button","aria-label":tn,className:xt.default.ARROW_NEXT(!Jt),onClick:Kt})},renderIndicator:function(Kt,Jt,tn,sn){return yt.default.createElement("li",{className:xt.default.DOT(Jt),onClick:Kt,onKeyDown:Kt,value:tn,key:tn,role:"button",tabIndex:0,"aria-label":"".concat(sn," ").concat(tn+1)})},renderItem:function(Kt){return Kt},renderThumbs:function(Kt){var Jt=yt.Children.map(Kt,function(tn){var sn=tn;if(tn.type!=="img"&&(sn=yt.Children.toArray(tn.props.children).find(function(Zt){return Zt.type==="img"})),!!sn)return sn});return Jt.filter(function(tn){return tn}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):Jt},statusFormatter:Ft.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:Ct.slideSwipeAnimationHandler,stopSwipingHandler:Ct.slideStopSwipingHandler}),Carousel}var types={},hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1),types}var hasRequiredJs;function requireJs(){return hasRequiredJs||(hasRequiredJs=1,(function(yt){Object.defineProperty(yt,"__esModule",{value:!0}),Object.defineProperty(yt,"Carousel",{enumerable:!0,get:function(){return Et.default}}),Object.defineProperty(yt,"CarouselProps",{enumerable:!0,get:function(){return xt.CarouselProps}}),Object.defineProperty(yt,"Thumbs",{enumerable:!0,get:function(){return vt.default}});var Et=bt(requireCarousel()),xt=requireTypes(),vt=bt(requireThumbs());function bt(At){return At&&At.__esModule?At:{default:At}}})(js)),js}var jsExports=requireJs(),now_1,hasRequiredNow;function requireNow(){if(hasRequiredNow)return now_1;hasRequiredNow=1;var yt=require_root(),Et=function(){return yt.Date.now()};return now_1=Et,now_1}var _trimmedEndIndex,hasRequired_trimmedEndIndex;function require_trimmedEndIndex(){if(hasRequired_trimmedEndIndex)return _trimmedEndIndex;hasRequired_trimmedEndIndex=1;var yt=/\s/;function Et(xt){for(var vt=xt.length;vt--&&yt.test(xt.charAt(vt)););return vt}return _trimmedEndIndex=Et,_trimmedEndIndex}var _baseTrim,hasRequired_baseTrim;function require_baseTrim(){if(hasRequired_baseTrim)return _baseTrim;hasRequired_baseTrim=1;var yt=require_trimmedEndIndex(),Et=/^\s+/;function xt(vt){return vt&&vt.slice(0,yt(vt)+1).replace(Et,"")}return _baseTrim=xt,_baseTrim}var toNumber_1,hasRequiredToNumber;function requireToNumber(){if(hasRequiredToNumber)return toNumber_1;hasRequiredToNumber=1;var yt=require_baseTrim(),Et=requireIsObject(),xt=requireIsSymbol(),vt=NaN,bt=/^[-+]0x[0-9a-f]+$/i,At=/^0b[01]+$/i,Ft=/^0o[0-7]+$/i,Ct=parseInt;function wt(St){if(typeof St=="number")return St;if(xt(St))return vt;if(Et(St)){var Tt=typeof St.valueOf=="function"?St.valueOf():St;St=Et(Tt)?Tt+"":Tt}if(typeof St!="string")return St===0?St:+St;St=yt(St);var Rt=At.test(St);return Rt||Ft.test(St)?Ct(St.slice(2),Rt?2:8):bt.test(St)?vt:+St}return toNumber_1=wt,toNumber_1}var debounce_1,hasRequiredDebounce;function requireDebounce(){if(hasRequiredDebounce)return debounce_1;hasRequiredDebounce=1;var yt=requireIsObject(),Et=requireNow(),xt=requireToNumber(),vt="Expected a function",bt=Math.max,At=Math.min;function Ft(Ct,wt,St){var Tt,Rt,Pt,Lt,kt,Ot,Mt=0,It=!1,Nt=!1,Ut=!0;if(typeof Ct!="function")throw new TypeError(vt);wt=xt(wt)||0,yt(St)&&(It=!!St.leading,Nt="maxWait"in St,Pt=Nt?bt(xt(St.maxWait)||0,wt):Pt,Ut="trailing"in St?!!St.trailing:Ut);function jt(Jt){var tn=Tt,sn=Rt;return Tt=Rt=void 0,Mt=Jt,Lt=Ct.apply(sn,tn),Lt}function Vt(Jt){return Mt=Jt,kt=setTimeout(Wt,wt),It?jt(Jt):Lt}function zt(Jt){var tn=Jt-Ot,sn=Jt-Mt,Zt=wt-tn;return Nt?At(Zt,Pt-sn):Zt}function Ht(Jt){var tn=Jt-Ot,sn=Jt-Mt;return Ot===void 0||tn>=wt||tn<0||Nt&&sn>=Pt}function Wt(){var Jt=Et();if(Ht(Jt))return Gt(Jt);kt=setTimeout(Wt,zt(Jt))}function Gt(Jt){return kt=void 0,Ut&&Tt?jt(Jt):(Tt=Rt=void 0,Lt)}function qt(){kt!==void 0&&clearTimeout(kt),Mt=0,Tt=Ot=Rt=kt=void 0}function Xt(){return kt===void 0?Lt:Gt(Et())}function Kt(){var Jt=Et(),tn=Ht(Jt);if(Tt=arguments,Rt=this,Ot=Jt,tn){if(kt===void 0)return Vt(Ot);if(Nt)return clearTimeout(kt),kt=setTimeout(Wt,wt),jt(Ot)}return kt===void 0&&(kt=setTimeout(Wt,wt)),Lt}return Kt.cancel=qt,Kt.flush=Xt,Kt}return debounce_1=Ft,debounce_1}var debounceExports=requireDebounce();const debounce=getDefaultExportFromCjs(debounceExports);function useEventListener(yt,Et,xt,vt,bt=!1){const At=reactExports.useRef();At.current=Et,reactExports.useEffect(()=>{if(xt===null||xt.addEventListener===void 0)return;const Ft=xt,Ct=wt=>{At.current?.call(Ft,wt)};return Ft.addEventListener(yt,Ct,{passive:vt,capture:bt}),()=>{Ft.removeEventListener(yt,Ct,{capture:bt})}},[yt,xt,vt,bt])}function whenDefined(yt,Et){return yt===void 0?void 0:Et}const PI=Math.PI;function degreesToRadians(yt){return yt*PI/180}const getSquareBB=(yt,Et,xt)=>({x1:yt-xt/2,y1:Et-xt/2,x2:yt+xt/2,y2:Et+xt/2}),getSquareXPosFromAlign=(yt,Et,xt,vt,bt)=>{switch(yt){case"left":return Math.floor(Et)+vt+bt/2;case"center":return Math.floor(Et+xt/2);case"right":return Math.floor(Et+xt)-vt-bt/2}},getSquareWidth=(yt,Et,xt)=>Math.min(yt,Et-xt*2),pointIsWithinBB=(yt,Et,xt)=>xt.x1<=yt&&yt<=xt.x2&&xt.y1<=Et&&Et<=xt.y2,EditPencil=yt=>{const Et=yt.fgColor??"currentColor";return reactExports.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},reactExports.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:Et,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),reactExports.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:Et,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},Checkmark=yt=>{const Et=yt.fgColor??"currentColor";return reactExports.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},reactExports.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:Et,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function useDebouncedMemo(yt,Et,xt){const[vt,bt]=reactExports.useState(yt),At=reactExports.useRef(!0);reactExports.useEffect(()=>()=>{At.current=!1},[]);const Ft=reactExports.useRef(debounce(Ct=>{At.current&&bt(Ct)},xt));return reactExports.useLayoutEffect(()=>{At.current&&Ft.current(()=>yt())},Et),vt}const rtlRange="֑-߿יִ-﷽ﹰ-ﻼ",ltrRange="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",rtl=new RegExp("^[^"+ltrRange+"]*["+rtlRange+"]");function direction(yt){return rtl.test(yt)?"rtl":"not-rtl"}let scrollbarWidthCache;function getScrollBarWidth(){if(typeof document>"u")return 0;if(scrollbarWidthCache!==void 0)return scrollbarWidthCache;const yt=document.createElement("p");yt.style.width="100%",yt.style.height="200px";const Et=document.createElement("div");Et.id="testScrollbar",Et.style.position="absolute",Et.style.top="0px",Et.style.left="0px",Et.style.visibility="hidden",Et.style.width="200px",Et.style.height="150px",Et.style.overflow="hidden",Et.append(yt),document.body.append(Et);const xt=yt.offsetWidth;Et.style.overflow="scroll";let vt=yt.offsetWidth;return xt===vt&&(vt=Et.clientWidth),Et.remove(),scrollbarWidthCache=xt-vt,scrollbarWidthCache}const empty=Symbol();function useStateWithReactiveInput(yt){const Et=reactExports.useRef([empty,yt]);Et.current[1]!==yt&&(Et.current[0]=yt),Et.current[1]=yt;const[xt,vt]=reactExports.useState(yt),[,bt]=reactExports.useState(),At=reactExports.useCallback(Ct=>{const wt=Et.current[0];wt!==empty&&(Ct=typeof Ct=="function"?Ct(wt):Ct,Ct===wt)||(wt!==empty&&bt({}),vt(St=>typeof Ct=="function"?Ct(wt===empty?St:wt):Ct),Et.current[0]=empty)},[]),Ft=reactExports.useCallback(()=>{Et.current[0]=empty,bt({})},[]);return[Et.current[0]===empty?xt:Et.current[0],At,Ft]}function makeAccessibilityStringForArray(yt){if(yt.length===0)return"";let Et=0,xt=0;for(const vt of yt){if(xt+=vt.length,xt>1e4)break;Et++}return yt.slice(0,Et).join(", ")}function useDeepMemo(yt){const Et=reactExports.useRef(yt);return deepEqual(yt,Et.current)||(Et.current=yt),Et.current}const ImageOverlayEditor=yt=>{const{urls:Et,canWrite:xt,onEditClick:vt,renderImage:bt}=yt,At=Et.filter(Ct=>Ct!=="");if(At.length===0)return null;const Ft=At.length>1;return reactExports.createElement(ImageOverlayEditorStyle,{"data-testid":"GDG-default-image-overlay-editor"},reactExports.createElement(jsExports.Carousel,{showArrows:Ft,showThumbs:!1,swipeable:Ft,emulateTouch:Ft,infiniteLoop:Ft},At.map(Ct=>{const wt=bt?.(Ct)??reactExports.createElement("img",{draggable:!1,src:Ct});return reactExports.createElement("div",{className:"gdg-centering-container",key:Ct},wt)})),xt&&vt&&reactExports.createElement("button",{className:"gdg-edit-icon",onClick:vt},reactExports.createElement(EditPencil,null)))};function L(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var T$1=L();function G(yt){T$1=yt}var E={exec:()=>null};function d$1(yt,Et=""){let xt=typeof yt=="string"?yt:yt.source,vt={replace:(bt,At)=>{let Ft=typeof At=="string"?At:At.source;return Ft=Ft.replace(m.caret,"$1"),xt=xt.replace(bt,Ft),vt},getRegex:()=>new RegExp(xt,Et)};return vt}var be=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),m={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:yt=>new RegExp(`^( {0,3}${yt})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:yt=>new RegExp(`^ {0,${Math.min(3,yt-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:yt=>new RegExp(`^ {0,${Math.min(3,yt-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:yt=>new RegExp(`^ {0,${Math.min(3,yt-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:yt=>new RegExp(`^ {0,${Math.min(3,yt-1)}}#`),htmlBeginRegex:yt=>new RegExp(`^ {0,${Math.min(3,yt-1)}}<(?:[a-z].*>|!--)`,"i")},Re=/^(?:[ \t]*(?:\n|$))+/,Te=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Oe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,I=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,we=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,F=/(?:[*+-]|\d{1,9}[.)])/,ie=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,oe=d$1(ie).replace(/bull/g,F).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ye=d$1(ie).replace(/bull/g,F).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),j=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Pe=/^[^\n]+/,Q=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Se=d$1(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Q).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$e=d$1(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,F).getRegex(),v$1="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",U=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_e=d$1("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",U).replace("tag",v$1).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae=d$1(j).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v$1).getRegex(),Le=d$1(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ae).getRegex(),K={blockquote:Le,code:Te,def:Se,fences:Oe,heading:we,hr:I,html:_e,lheading:oe,list:$e,newline:Re,paragraph:ae,table:E,text:Pe},re=d$1("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v$1).getRegex(),Me={...K,lheading:ye,table:re,paragraph:d$1(j).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",re).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v$1).getRegex()},ze={...K,html:d$1(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",U).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:E,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d$1(j).replace("hr",I).replace("heading",` *#{1,6} *[^
|
|
2794
2794
|
]`).replace("lheading",oe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ae=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ee=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,le=/^( {2,}|\\)\n(?!\s*$)/,Ie=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,D=/[\p{P}\p{S}]/u,W=/[\s\p{P}\p{S}]/u,ue=/[^\s\p{P}\p{S}]/u,Ce=d$1(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,W).getRegex(),pe=/(?!~)[\p{P}\p{S}]/u,Be=/(?!~)[\s\p{P}\p{S}]/u,qe=/(?:[^\s\p{P}\p{S}]|~)/u,ve=d$1(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",be?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ce=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,De=d$1(ce,"u").replace(/punct/g,D).getRegex(),He=d$1(ce,"u").replace(/punct/g,pe).getRegex(),he="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ze=d$1(he,"gu").replace(/notPunctSpace/g,ue).replace(/punctSpace/g,W).replace(/punct/g,D).getRegex(),Ge=d$1(he,"gu").replace(/notPunctSpace/g,qe).replace(/punctSpace/g,Be).replace(/punct/g,pe).getRegex(),Ne=d$1("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ue).replace(/punctSpace/g,W).replace(/punct/g,D).getRegex(),Fe=d$1(/\\(punct)/,"gu").replace(/punct/g,D).getRegex(),je=d$1(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Qe=d$1(U).replace("(?:-->|$)","-->").getRegex(),Ue=d$1("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Qe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),q=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Ke=d$1(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",q).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),de=d$1(/^!?\[(label)\]\[(ref)\]/).replace("label",q).replace("ref",Q).getRegex(),ke=d$1(/^!?\[(ref)\](?:\[\])?/).replace("ref",Q).getRegex(),We=d$1("reflink|nolink(?!\\()","g").replace("reflink",de).replace("nolink",ke).getRegex(),se=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,X={_backpedal:E,anyPunctuation:Fe,autolink:je,blockSkip:ve,br:le,code:Ee,del:E,emStrongLDelim:De,emStrongRDelimAst:Ze,emStrongRDelimUnd:Ne,escape:Ae,link:Ke,nolink:ke,punctuation:Ce,reflink:de,reflinkSearch:We,tag:Ue,text:Ie,url:E},Xe={...X,link:d$1(/^!?\[(label)\]\((.*?)\)/).replace("label",q).getRegex(),reflink:d$1(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q).getRegex()},N={...X,emStrongRDelimAst:Ge,emStrongLDelim:He,url:d$1(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",se).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:d$1(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",se).getRegex()},Je={...N,br:d$1(le).replace("{2,}","*").getRegex(),text:d$1(N.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},C={normal:K,gfm:Me,pedantic:ze},M={normal:X,gfm:N,breaks:Je,pedantic:Xe},Ve={"&":"&","<":"<",">":">",'"':""","'":"'"},ge=yt=>Ve[yt];function w$1(yt,Et){if(Et){if(m.escapeTest.test(yt))return yt.replace(m.escapeReplace,ge)}else if(m.escapeTestNoEncode.test(yt))return yt.replace(m.escapeReplaceNoEncode,ge);return yt}function J(yt){try{yt=encodeURI(yt).replace(m.percentDecode,"%")}catch{return null}return yt}function V(yt,Et){let xt=yt.replace(m.findPipe,(At,Ft,Ct)=>{let wt=!1,St=Ft;for(;--St>=0&&Ct[St]==="\\";)wt=!wt;return wt?"|":" |"}),vt=xt.split(m.splitPipe),bt=0;if(vt[0].trim()||vt.shift(),vt.length>0&&!vt.at(-1)?.trim()&&vt.pop(),Et)if(vt.length>Et)vt.splice(Et);else for(;vt.length<Et;)vt.push("");for(;bt<vt.length;bt++)vt[bt]=vt[bt].trim().replace(m.slashPipe,"|");return vt}function z$1(yt,Et,xt){let vt=yt.length;if(vt===0)return"";let bt=0;for(;bt<vt&&yt.charAt(vt-bt-1)===Et;)bt++;return yt.slice(0,vt-bt)}function fe(yt,Et){if(yt.indexOf(Et[1])===-1)return-1;let xt=0;for(let vt=0;vt<yt.length;vt++)if(yt[vt]==="\\")vt++;else if(yt[vt]===Et[0])xt++;else if(yt[vt]===Et[1]&&(xt--,xt<0))return vt;return xt>0?-2:-1}function me(yt,Et,xt,vt,bt){let At=Et.href,Ft=Et.title||null,Ct=yt[1].replace(bt.other.outputLinkReplace,"$1");vt.state.inLink=!0;let wt={type:yt[0].charAt(0)==="!"?"image":"link",raw:xt,href:At,title:Ft,text:Ct,tokens:vt.inlineTokens(Ct)};return vt.state.inLink=!1,wt}function Ye(yt,Et,xt){let vt=yt.match(xt.other.indentCodeCompensation);if(vt===null)return Et;let bt=vt[1];return Et.split(`
|
|
2795
2795
|
`).map(At=>{let Ft=At.match(xt.other.beginningSpace);if(Ft===null)return At;let[Ct]=Ft;return Ct.length>=bt.length?At.slice(bt.length):At}).join(`
|
|
2796
2796
|
`)}var y=class{options;rules;lexer;constructor(yt){this.options=yt||T$1}space(yt){let Et=this.rules.block.newline.exec(yt);if(Et&&Et[0].length>0)return{type:"space",raw:Et[0]}}code(yt){let Et=this.rules.block.code.exec(yt);if(Et){let xt=Et[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:Et[0],codeBlockStyle:"indented",text:this.options.pedantic?xt:z$1(xt,`
|