moi-computer 0.10.1-next.1 → 0.10.1-next.2
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/client/components/shared/AgentBlobatar.tsx +93 -0
- package/client/features/chat/ChatEmptyState.tsx +110 -80
- package/client/features/chat/ChatPanel.tsx +19 -11
- package/client/features/chat/ChatPopup.tsx +23 -11
- package/client/features/chat/ChatPromptBubbles.tsx +1 -1
- package/client/features/chat/TurnView.tsx +0 -17
- package/client/features/chat/useStickToBottom.ts +1 -1
- package/client/features/dev/ChatStatesPage.tsx +17 -9
- package/client/features/workspace/CustomizePanel.tsx +33 -4
- package/client/features/workspace/WorkspaceScreen.tsx +11 -5
- package/client/features/workspace/WorkspaceTabs.tsx +5 -8
- package/client/index.css +22 -12
- package/client/index.tsx +1 -0
- package/client/theme.css +9 -0
- package/dist/{chunk-efdyz6xp.js → chunk-0pcdwjkp.js} +1 -1
- package/dist/chunk-4xmcsjjv.js +1 -0
- package/dist/{chunk-5t06zksf.js → chunk-8jh75pjg.js} +2 -2
- package/dist/{chunk-97eg9mjn.js → chunk-9y2zbzqz.js} +1 -1
- package/dist/chunk-dfs36zgc.js +1 -0
- package/dist/chunk-e4e993yf.js +83 -0
- package/dist/chunk-ek8w9tsp.css +1 -0
- package/dist/chunk-vq8ga42s.js +1 -0
- package/dist/{chunk-ht1f95h9.js → chunk-yhj9bg1s.js} +2 -2
- package/dist/{chunk-0set7tmf.js → chunk-yt2qjn3m.js} +2 -2
- package/dist/chunk-yz743a75.js +10 -0
- package/dist/index.html +1 -1
- package/lib/themes.ts +21 -3
- package/lib/types.ts +1 -1
- package/package.json +4 -2
- package/server/bundler/build-applet.ts +30 -0
- package/server/cli-ui-components.ts +258 -0
- package/server/cli.ts +48 -5
- package/server/control.ts +5 -3
- package/server/moi-scaffold.ts +9 -1
- package/server/skills-template.ts +5 -0
- package/server/theme.ts +17 -5
- package/server/ui-components.ts +545 -0
- package/workspace/.claude/skills/moi-workspace/SKILL.md +27 -6
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +10 -2
- package/workspace/.claude/skills/moi-workspace/references/UI-COMPONENTS.md +211 -0
- package/client/components/shared/IconGhost.tsx +0 -127
- package/dist/chunk-10knptd0.css +0 -1
- package/dist/chunk-b4qp3p42.js +0 -83
- package/dist/chunk-dfe7qnrp.js +0 -1
- package/dist/chunk-h2kj1ysj.js +0 -1
- package/dist/chunk-nek4ec05.js +0 -1
- package/dist/chunk-qtc5a8qa.js +0 -10
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import{$ as rK,$a as UZ,$b as FT,A as vP,Aa as bm,Ab as Xp,Ac as f_,B as gP,Ba as ym,Bb as Xq,Bc as e_,C as b6,Ca as hm,Cb as nv,D as SH,Da as xm,Db as fp,Dc as i_,E as fP,Ea as vm,Eb as zp,Ec as H5,F as nK,Fa as L3,Fb as Gp,Fc as Dc,G as mP,Ga as gm,Gb as Fp,Gc as $O,H as pP,Ha as bF,Hb as Up,Hc as ZO,I as T4,Ia as H7,Ib as IF,Ic as e2,J as Y4,Ja as fv,Jc as Kf,K as dS,Ka as H_,Kb as Yp,Kc as B5,L as GF,La as gp,Lb as RF,M as rP,Ma as fm,Mb as Kp,N as s7,Na as mm,Nb as Vv,O as hS,Oa as pm,Ob as SV,P as s8,Pa as oX,Pb as Dv,Q as _P,Qa as um,Qb as UY,R as F0,Ra as cm,Rb as Wp,S as QP,Sa as dm,Sb as K4,T as JF,Ta as lm,U as u5,Ua as im,Ub as Np,V as XX,Va as KO,Vb as Lp,W as SP,Wa as YR,Wb as uB,X as cK,Xa as eC,Xb as uJ,Y as dK,Yb as Ap,Z as lK,Za as rm,Zb as Vp,_ as iK,_a as JR,_b as lB,aa as aK,ab as am,ac as Dp,b as c,bb as nm,bc as qp,c as F4,ca as OD,cb as Mu,d as aJ0,da as s,db as Wj,dc as Mp,e as k1,ea as Eu,eb as om,f as E0,fa as u6,fb as sm,fc as Pp,g as VQ,ga as C0,gb as tm,gc as _p,h as Y0,ha as bv,hb as em,hc as Op,i as U0,ia as Cm,ic as jp,j as l1,ja as Z_,jb as $p,jc as vf,k as hB,ka as YX,kb as Zp,kc as Tp,l as b1,la as wm,m as tQ,ma as UR,mb as Hp,mc as QR,n as S2,na as fw,nb as B_,nc as mp,o as PP,oa as mw,ob as AY,oc as Cp,p as T1,pa as Kj,pb as dB,q as O5,qa as cw,qb as Yc,qc as XR,r as jM,ra as vp,rb as Bp,rc as wp,s as IX,sa as cB,sb as Kc,sc as Ep,t as wP,ta as Em,tc as S5,u as t7,ua as Sm,ub as I5,uc as Af,v as o7,va as pB,vb as J_,vc as UT,w as $X,wa as Im,wb as Du,wc as tI,x as jH,xa as Rm,xb as Jp,xc as sX,y as JW,ya as km,yb as Qp,yc as ZR,z as DK,za as Uc,zb as Nj,zc as g_}from"/chunk-yz743a75.js";import{Lc as V1,Mc as E4,Nc as n5,Pc as Z9}from"/chunk-yt2qjn3m.js";import{Qc as g,Rc as n_,Tc as B2}from"/chunk-yhj9bg1s.js";import{Uc as O,Vc as G5,Wc as O4,Xc as vN}from"/chunk-9y2zbzqz.js";var GQ=G5((ac)=>{var F8=O(g());function fc($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var mc=typeof Object.is==="function"?Object.is:fc,pc=F8.useState,uc=F8.useEffect,cc=F8.useLayoutEffect,dc=F8.useDebugValue;function lc($,Z){var H=Z(),B=pc({inst:{value:H,getSnapshot:Z}}),J=B[0].inst,Q=B[1];return cc(function(){J.value=H,J.getSnapshot=Z,eY(J)&&Q({inst:J})},[$,H,Z]),uc(function(){return eY(J)&&Q({inst:J}),$(function(){eY(J)&&Q({inst:J})})},[$]),dc(H),H}function eY($){var Z=$.getSnapshot;$=$.value;try{var H=Z();return!mc($,H)}catch(B){return!0}}function ic($,Z){return Z()}var rc=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ic:lc;ac.useSyncExternalStore=F8.useSyncExternalStore!==void 0?F8.useSyncExternalStore:rc});var wR=G5((qo0,CR)=>{var _R=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,s00=/\n/g,t00=/^\s*/,e00=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$10=/^:\s*/,Z10=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,H10=/^[;\s]*/,B10=/^\s+|\s+$/g,J10=`
|
|
2
|
+
`,OR="/",jR="*",Y7="",Q10="comment",X10="declaration";function z10($,Z){if(typeof $!=="string")throw TypeError("First argument must be a string");if(!$)return[];Z=Z||{};var H=1,B=1;function J(N){var L=N.match(s00);if(L)H+=L.length;var V=N.lastIndexOf(J10);B=~V?N.length-V:B+N.length}function Q(){var N={line:H,column:B};return function(L){return L.position=new X(N),F(),L}}function X(N){this.start=N,this.end={line:H,column:B},this.source=Z.source}X.prototype.content=$;function z(N){var L=Error(Z.source+":"+H+":"+B+": "+N);if(L.reason=N,L.filename=Z.source,L.line=H,L.column=B,L.source=$,Z.silent);else throw L}function G(N){var L=N.exec($);if(!L)return;var V=L[0];return J(V),$=$.slice(V.length),L}function F(){G(t00)}function U(N){var L;N=N||[];while(L=Y())if(L!==!1)N.push(L);return N}function Y(){var N=Q();if(OR!=$.charAt(0)||jR!=$.charAt(1))return;var L=2;while(Y7!=$.charAt(L)&&(jR!=$.charAt(L)||OR!=$.charAt(L+1)))++L;if(L+=2,Y7===$.charAt(L-1))return z("End of comment missing");var V=$.slice(2,L-2);return B+=2,J(V),$=$.slice(L),B+=2,N({type:Q10,comment:V})}function K(){var N=Q(),L=G(e00);if(!L)return;if(Y(),!G($10))return z("property missing ':'");var V=G(Z10),A=N({type:X10,property:TR(L[0].replace(_R,Y7)),value:V?TR(V[0].replace(_R,Y7)):Y7});return G(H10),A}function W(){var N=[];U(N);var L;while(L=K())if(L!==!1)N.push(L),U(N);return N}return F(),W()}function TR($){return $?$.replace(B10,Y7):Y7}CR.exports=z10});var ER=G5((nB)=>{var G10=nB&&nB.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(nB,"__esModule",{value:!0});nB.default=U10;var F10=G10(wR());function U10($,Z){let H=null;if(!$||typeof $!=="string")return H;let B=(0,F10.default)($),J=typeof Z==="function";return B.forEach((Q)=>{if(Q.type!=="declaration")return;let{property:X,value:z}=Q;if(J)Z(X,z,Q);else if(z)H=H||{},H[X]=z}),H}});var kR=G5((IR)=>{Object.defineProperty(IR,"__esModule",{value:!0});IR.camelCase=void 0;var Y10=/^--[a-zA-Z0-9_-]+$/,K10=/-([a-z])/g,W10=/^[^-]+$/,N10=/^-(webkit|moz|ms|o|khtml)-/,L10=/^-(ms)-/,A10=function($){return!$||W10.test($)||Y10.test($)},V10=function($,Z){return Z.toUpperCase()},SR=function($,Z){return"".concat(Z,"-")},D10=function($,Z){if(Z===void 0)Z={};if(A10($))return $;if($=$.toLowerCase(),Z.reactCompat)$=$.replace(L10,SR);else $=$.replace(N10,SR);return $.replace(K10,V10)};IR.camelCase=D10});var yR=G5((vL,bR)=>{var q10=vL&&vL.__importDefault||function($){return $&&$.__esModule?$:{default:$}},M10=q10(ER()),P10=kR();function xL($,Z){var H={};if(!$||typeof $!=="string")return H;return(0,M10.default)($,function(B,J){if(B&&J)H[(0,P10.camelCase)(B,Z)]=J}),H}xL.default=xL;bR.exports=xL});var Zb=G5((U51,$b)=>{var UU=Object.prototype.hasOwnProperty,ek=Object.prototype.toString,rk=Object.defineProperty,ak=Object.getOwnPropertyDescriptor,nk=function(Z){if(typeof Array.isArray==="function")return Array.isArray(Z);return ek.call(Z)==="[object Array]"},ok=function(Z){if(!Z||ek.call(Z)!=="[object Object]")return!1;var H=UU.call(Z,"constructor"),B=Z.constructor&&Z.constructor.prototype&&UU.call(Z.constructor.prototype,"isPrototypeOf");if(Z.constructor&&!H&&!B)return!1;var J;for(J in Z);return typeof J>"u"||UU.call(Z,J)},sk=function(Z,H){if(rk&&H.name==="__proto__")rk(Z,H.name,{enumerable:!0,configurable:!0,value:H.newValue,writable:!0});else Z[H.name]=H.newValue},tk=function(Z,H){if(H==="__proto__"){if(!UU.call(Z,H))return;else if(ak)return ak(Z,H).value}return Z[H]};$b.exports=function $(){var Z,H,B,J,Q,X,z=arguments[0],G=1,F=arguments.length,U=!1;if(typeof z==="boolean")U=z,z=arguments[1]||{},G=2;if(z==null||typeof z!=="object"&&typeof z!=="function")z={};for(;G<F;++G)if(Z=arguments[G],Z!=null){for(H in Z)if(B=tk(z,H),J=tk(Z,H),z!==J){if(U&&J&&(ok(J)||(Q=nk(J)))){if(Q)Q=!1,X=B&&nk(B)?B:[];else X=B&&ok(B)?B:{};sk(z,{name:H,newValue:$(U,X,J)})}else if(typeof J<"u")sk(z,{name:H,newValue:J})}}return z}});var ry=G5((R41,iy)=>{function Ry($){if($ instanceof Map)$.clear=$.delete=$.set=function(){throw Error("map is read-only")};else if($ instanceof Set)$.add=$.clear=$.delete=function(){throw Error("set is read-only")};return Object.freeze($),Object.getOwnPropertyNames($).forEach((Z)=>{let H=$[Z],B=typeof H;if((B==="object"||B==="function")&&!Object.isFrozen(H))Ry(H)}),$}class EA{constructor($){if($.data===void 0)$.data={};this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ky($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r3($,...Z){let H=Object.create(null);for(let B in $)H[B]=$[B];return Z.forEach(function(B){for(let J in B)H[J]=B[J]}),H}var i40="</span>",Ty=($)=>{return!!$.scope},r40=($,{prefix:Z})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){let H=$.split(".");return[`${Z}${H.shift()}`,...H.map((B,J)=>`${B}${"_".repeat(J+1)}`)].join(" ")}return`${Z}${$}`};class by{constructor($,Z){this.buffer="",this.classPrefix=Z.classPrefix,$.walk(this)}addText($){this.buffer+=ky($)}openNode($){if(!Ty($))return;let Z=r40($.scope,{prefix:this.classPrefix});this.span(Z)}closeNode($){if(!Ty($))return;this.buffer+=i40}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}var Cy=($={})=>{let Z={children:[]};return Object.assign(Z,$),Z};class SA{constructor(){this.rootNode=Cy(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add($){this.top.children.push($)}openNode($){let Z=Cy({scope:$});this.add(Z),this.stack.push(Z)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk($){return this.constructor._walk($,this.rootNode)}static _walk($,Z){if(typeof Z==="string")$.addText(Z);else if(Z.children)$.openNode(Z),Z.children.forEach((H)=>this._walk($,H)),$.closeNode(Z);return $}static _collapse($){if(typeof $==="string")return;if(!$.children)return;if($.children.every((Z)=>typeof Z==="string"))$.children=[$.children.join("")];else $.children.forEach((Z)=>{SA._collapse(Z)})}}class yy extends SA{constructor($){super();this.options=$}addText($){if($==="")return;this.add($)}startScope($){this.openNode($)}endScope(){this.closeNode()}__addSublanguage($,Z){let H=$.root;if(Z)H.scope=`language:${Z}`;this.add(H)}toHTML(){return new by(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function KJ($){if(!$)return null;if(typeof $==="string")return $;return $.source}function hy($){return P7("(?=",$,")")}function a40($){return P7("(?:",$,")*")}function n40($){return P7("(?:",$,")?")}function P7(...$){return $.map((H)=>KJ(H)).join("")}function o40($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function IA(...$){return"("+(o40($).capture?"":"?:")+$.map((B)=>KJ(B)).join("|")+")"}function xy($){return new RegExp($.toString()+"|").exec("").length-1}function s40($,Z){let H=$&&$.exec(Z);return H&&H.index===0}var t40=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function RA($,{joinWith:Z}){let H=0;return $.map((B)=>{H+=1;let J=H,Q=KJ(B),X="";while(Q.length>0){let z=t40.exec(Q);if(!z){X+=Q;break}if(X+=Q.substring(0,z.index),Q=Q.substring(z.index+z[0].length),z[0][0]==="\\"&&z[1])X+="\\"+String(Number(z[1])+J);else if(X+=z[0],z[0]==="(")H++}return X}).map((B)=>`(${B})`).join(Z)}var e40=/\b\B/,vy="[a-zA-Z]\\w*",kA="[a-zA-Z_]\\w*",gy="\\b\\d+(\\.\\d+)?",fy="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",my="\\b(0b[01]+)",$80="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Z80=($={})=>{let Z=/^#![ ]*\//;if($.binary)$.begin=P7(Z,/.*\b/,$.binary,/\b.*/);return r3({scope:"meta",begin:Z,end:/$/,relevance:0,"on:begin":(H,B)=>{if(H.index!==0)B.ignoreMatch()}},$)},WJ={begin:"\\\\[\\s\\S]",relevance:0},H80={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[WJ]},B80={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[WJ]},J80={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},OU=function($,Z,H={}){let B=r3({scope:"comment",begin:$,end:Z,contains:[]},H);B.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let J=IA("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return B.contains.push({begin:P7(/[ ]+/,"(",J,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),B},Q80=OU("//","$"),X80=OU("/\\*","\\*/"),z80=OU("#","$"),G80={scope:"number",begin:gy,relevance:0},F80={scope:"number",begin:fy,relevance:0},U80={scope:"number",begin:my,relevance:0},Y80={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[WJ,{begin:/\[/,end:/\]/,relevance:0,contains:[WJ]}]},K80={scope:"title",begin:vy,relevance:0},W80={scope:"title",begin:kA,relevance:0},N80={begin:"\\.\\s*"+kA,relevance:0},L80=function($){return Object.assign($,{"on:begin":(Z,H)=>{H.data._beginMatch=Z[1]},"on:end":(Z,H)=>{if(H.data._beginMatch!==Z[1])H.ignoreMatch()}})},PU=Object.freeze({__proto__:null,APOS_STRING_MODE:H80,BACKSLASH_ESCAPE:WJ,BINARY_NUMBER_MODE:U80,BINARY_NUMBER_RE:my,COMMENT:OU,C_BLOCK_COMMENT_MODE:X80,C_LINE_COMMENT_MODE:Q80,C_NUMBER_MODE:F80,C_NUMBER_RE:fy,END_SAME_AS_BEGIN:L80,HASH_COMMENT_MODE:z80,IDENT_RE:vy,MATCH_NOTHING_RE:e40,METHOD_GUARD:N80,NUMBER_MODE:G80,NUMBER_RE:gy,PHRASAL_WORDS_MODE:J80,QUOTE_STRING_MODE:B80,REGEXP_MODE:Y80,RE_STARTERS_RE:$80,SHEBANG:Z80,TITLE_MODE:K80,UNDERSCORE_IDENT_RE:kA,UNDERSCORE_TITLE_MODE:W80});function A80($,Z){if($.input[$.index-1]===".")Z.ignoreMatch()}function V80($,Z){if($.className!==void 0)$.scope=$.className,delete $.className}function D80($,Z){if(!Z)return;if(!$.beginKeywords)return;if($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=A80,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0)$.relevance=0}function q80($,Z){if(!Array.isArray($.illegal))return;$.illegal=IA(...$.illegal)}function M80($,Z){if(!$.match)return;if($.begin||$.end)throw Error("begin & end are not supported with match");$.begin=$.match,delete $.match}function P80($,Z){if($.relevance===void 0)$.relevance=1}var _80=($,Z)=>{if(!$.beforeMatch)return;if($.starts)throw Error("beforeMatch cannot be used with starts");let H=Object.assign({},$);Object.keys($).forEach((B)=>{delete $[B]}),$.keywords=H.keywords,$.begin=P7(H.beforeMatch,hy(H.begin)),$.starts={relevance:0,contains:[Object.assign(H,{endsParent:!0})]},$.relevance=0,delete H.beforeMatch},O80=["of","and","for","in","not","or","if","then","parent","list","value"],j80="keyword";function py($,Z,H=j80){let B=Object.create(null);if(typeof $==="string")J(H,$.split(" "));else if(Array.isArray($))J(H,$);else Object.keys($).forEach(function(Q){Object.assign(B,py($[Q],Z,Q))});return B;function J(Q,X){if(Z)X=X.map((z)=>z.toLowerCase());X.forEach(function(z){let G=z.split("|");B[G[0]]=[Q,T80(G[0],G[1])]})}}function T80($,Z){if(Z)return Number(Z);return C80($)?0:1}function C80($){return O80.includes($.toLowerCase())}var wy={},M7=($)=>{console.error($)},Ey=($,...Z)=>{console.log(`WARN: ${$}`,...Z)},OZ=($,Z)=>{if(wy[`${$}/${Z}`])return;console.log(`Deprecated as of ${$}. ${Z}`),wy[`${$}/${Z}`]=!0},_U=Error();function uy($,Z,{key:H}){let B=0,J=$[H],Q={},X={};for(let z=1;z<=Z.length;z++)X[z+B]=J[z],Q[z+B]=!0,B+=xy(Z[z-1]);$[H]=X,$[H]._emit=Q,$[H]._multi=!0}function w80($){if(!Array.isArray($.begin))return;if($.skip||$.excludeBegin||$.returnBegin)throw M7("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),_U;if(typeof $.beginScope!=="object"||$.beginScope===null)throw M7("beginScope must be object"),_U;uy($,$.begin,{key:"beginScope"}),$.begin=RA($.begin,{joinWith:""})}function E80($){if(!Array.isArray($.end))return;if($.skip||$.excludeEnd||$.returnEnd)throw M7("skip, excludeEnd, returnEnd not compatible with endScope: {}"),_U;if(typeof $.endScope!=="object"||$.endScope===null)throw M7("endScope must be object"),_U;uy($,$.end,{key:"endScope"}),$.end=RA($.end,{joinWith:""})}function S80($){if($.scope&&typeof $.scope==="object"&&$.scope!==null)$.beginScope=$.scope,delete $.scope}function I80($){if(S80($),typeof $.beginScope==="string")$.beginScope={_wrap:$.beginScope};if(typeof $.endScope==="string")$.endScope={_wrap:$.endScope};w80($),E80($)}function R80($){function Z(X,z){return new RegExp(KJ(X),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(z?"g":""))}class H{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(X,z){z.position=this.position++,this.matchIndexes[this.matchAt]=z,this.regexes.push([z,X]),this.matchAt+=xy(X)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let X=this.regexes.map((z)=>z[1]);this.matcherRe=Z(RA(X,{joinWith:"|"}),!0),this.lastIndex=0}exec(X){this.matcherRe.lastIndex=this.lastIndex;let z=this.matcherRe.exec(X);if(!z)return null;let G=z.findIndex((U,Y)=>Y>0&&U!==void 0),F=this.matchIndexes[G];return z.splice(0,G),Object.assign(z,F)}}class B{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(X){if(this.multiRegexes[X])return this.multiRegexes[X];let z=new H;return this.rules.slice(X).forEach(([G,F])=>z.addRule(G,F)),z.compile(),this.multiRegexes[X]=z,z}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(X,z){if(this.rules.push([X,z]),z.type==="begin")this.count++}exec(X){let z=this.getMatcher(this.regexIndex);z.lastIndex=this.lastIndex;let G=z.exec(X);if(this.resumingScanAtSamePosition())if(G&&G.index===this.lastIndex);else{let F=this.getMatcher(0);F.lastIndex=this.lastIndex+1,G=F.exec(X)}if(G){if(this.regexIndex+=G.position+1,this.regexIndex===this.count)this.considerAll()}return G}}function J(X){let z=new B;if(X.contains.forEach((G)=>z.addRule(G.begin,{rule:G,type:"begin"})),X.terminatorEnd)z.addRule(X.terminatorEnd,{type:"end"});if(X.illegal)z.addRule(X.illegal,{type:"illegal"});return z}function Q(X,z){let G=X;if(X.isCompiled)return G;[V80,M80,I80,_80].forEach((U)=>U(X,z)),$.compilerExtensions.forEach((U)=>U(X,z)),X.__beforeBegin=null,[D80,q80,P80].forEach((U)=>U(X,z)),X.isCompiled=!0;let F=null;if(typeof X.keywords==="object"&&X.keywords.$pattern)X.keywords=Object.assign({},X.keywords),F=X.keywords.$pattern,delete X.keywords.$pattern;if(F=F||/\w+/,X.keywords)X.keywords=py(X.keywords,$.case_insensitive);if(G.keywordPatternRe=Z(F,!0),z){if(!X.begin)X.begin=/\B|\b/;if(G.beginRe=Z(G.begin),!X.end&&!X.endsWithParent)X.end=/\B|\b/;if(X.end)G.endRe=Z(G.end);if(G.terminatorEnd=KJ(G.end)||"",X.endsWithParent&&z.terminatorEnd)G.terminatorEnd+=(X.end?"|":"")+z.terminatorEnd}if(X.illegal)G.illegalRe=Z(X.illegal);if(!X.contains)X.contains=[];if(X.contains=[].concat(...X.contains.map(function(U){return k80(U==="self"?X:U)})),X.contains.forEach(function(U){Q(U,G)}),X.starts)Q(X.starts,z);return G.matcher=J(G),G}if(!$.compilerExtensions)$.compilerExtensions=[];if($.contains&&$.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return $.classNameAliases=r3($.classNameAliases||{}),Q($)}function cy($){if(!$)return!1;return $.endsWithParent||cy($.starts)}function k80($){if($.variants&&!$.cachedVariants)$.cachedVariants=$.variants.map(function(Z){return r3($,{variants:null},Z)});if($.cachedVariants)return $.cachedVariants;if(cy($))return r3($,{starts:$.starts?r3($.starts):null});if(Object.isFrozen($))return r3($);return $}var b80="11.11.1";class dy extends Error{constructor($,Z){super($);this.name="HTMLInjectionError",this.html=Z}}var wA=ky,Sy=r3,Iy=Symbol("nomatch"),y80=7,ly=function($){let Z=Object.create(null),H=Object.create(null),B=[],J=!0,Q="Could not find the language '{}', did you forget to load/include a language module?",X={disableAutodetect:!0,name:"Plain text",contains:[]},z={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:yy};function G(k){return z.noHighlightRe.test(k)}function F(k){let b=k.className+" ";b+=k.parentNode?k.parentNode.className:"";let v=z.languageDetectRe.exec(b);if(v){let u=R(v[1]);if(!u)Ey(Q.replace("{}",v[1])),Ey("Falling back to no-highlight mode for this block.",k);return u?v[1]:"no-highlight"}return b.split(/\s+/).find((u)=>G(u)||R(u))}function U(k,b,v){let u="",C="";if(typeof b==="object")u=k,v=b.ignoreIllegals,C=b.language;else OZ("10.7.0","highlight(lang, code, ...args) has been deprecated."),OZ("10.7.0",`Please use highlight(code, options) instead.
|
|
3
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),C=k,u=b;if(v===void 0)v=!0;let t={code:u,language:C};j("before:highlight",t);let H0=t.result?t.result:Y(t.language,t.code,v);return H0.code=t.code,j("after:highlight",H0),H0}function Y(k,b,v,u){let C=Object.create(null);function t(p,r){return p.keywords[r]}function H0(){if(!l.keywords){a.addText(o);return}let p=0;l.keywordPatternRe.lastIndex=0;let r=l.keywordPatternRe.exec(o),Z0="";while(r){Z0+=o.substring(p,r.index);let V0=J0.case_insensitive?r[0].toLowerCase():r[0],j0=t(l,V0);if(j0){let[v0,z1]=j0;if(a.addText(Z0),Z0="",C[V0]=(C[V0]||0)+1,C[V0]<=y80)D0+=z1;if(v0.startsWith("_"))Z0+=r[0];else{let Y1=J0.classNameAliases[v0]||v0;L0(r[0],Y1)}}else Z0+=r[0];p=l.keywordPatternRe.lastIndex,r=l.keywordPatternRe.exec(o)}Z0+=o.substring(p),a.addText(Z0)}function x(){if(o==="")return;let p=null;if(typeof l.subLanguage==="string"){if(!Z[l.subLanguage]){a.addText(o);return}p=Y(l.subLanguage,o,!0,m[l.subLanguage]),m[l.subLanguage]=p._top}else p=W(o,l.subLanguage.length?l.subLanguage:null);if(l.relevance>0)D0+=p.relevance;a.__addSublanguage(p._emitter,p.language)}function e(){if(l.subLanguage!=null)x();else H0();o=""}function L0(p,r){if(p==="")return;a.startScope(r),a.addText(p),a.endScope()}function d(p,r){let Z0=1,V0=r.length-1;while(Z0<=V0){if(!p._emit[Z0]){Z0++;continue}let j0=J0.classNameAliases[p[Z0]]||p[Z0],v0=r[Z0];if(j0)L0(v0,j0);else o=v0,H0(),o="";Z0++}}function X0(p,r){if(p.scope&&typeof p.scope==="string")a.openNode(J0.classNameAliases[p.scope]||p.scope);if(p.beginScope){if(p.beginScope._wrap)L0(o,J0.classNameAliases[p.beginScope._wrap]||p.beginScope._wrap),o="";else if(p.beginScope._multi)d(p.beginScope,r),o=""}return l=Object.create(p,{parent:{value:l}}),l}function K0(p,r,Z0){let V0=s40(p.endRe,Z0);if(V0){if(p["on:end"]){let j0=new EA(p);if(p["on:end"](r,j0),j0.isMatchIgnored)V0=!1}if(V0){while(p.endsParent&&p.parent)p=p.parent;return p}}if(p.endsWithParent)return K0(p.parent,r,Z0)}function Q0(p){if(l.matcher.regexIndex===0)return o+=p[0],1;else return r0=!0,0}function z0(p){let r=p[0],Z0=p.rule,V0=new EA(Z0),j0=[Z0.__beforeBegin,Z0["on:begin"]];for(let v0 of j0){if(!v0)continue;if(v0(p,V0),V0.isMatchIgnored)return Q0(r)}if(Z0.skip)o+=r;else{if(Z0.excludeBegin)o+=r;if(e(),!Z0.returnBegin&&!Z0.excludeBegin)o=r}return X0(Z0,p),Z0.returnBegin?0:r.length}function A0(p){let r=p[0],Z0=b.substring(p.index),V0=K0(l,p,Z0);if(!V0)return Iy;let j0=l;if(l.endScope&&l.endScope._wrap)e(),L0(r,l.endScope._wrap);else if(l.endScope&&l.endScope._multi)e(),d(l.endScope,p);else if(j0.skip)o+=r;else{if(!(j0.returnEnd||j0.excludeEnd))o+=r;if(e(),j0.excludeEnd)o=r}do{if(l.scope)a.closeNode();if(!l.skip&&!l.subLanguage)D0+=l.relevance;l=l.parent}while(l!==V0.parent);if(V0.starts)X0(V0.starts,p);return j0.returnEnd?0:r.length}function i(){let p=[];for(let r=l;r!==J0;r=r.parent)if(r.scope)p.unshift(r.scope);p.forEach((r)=>a.openNode(r))}let B0={};function $0(p,r){let Z0=r&&r[0];if(o+=p,Z0==null)return e(),0;if(B0.type==="begin"&&r.type==="end"&&B0.index===r.index&&Z0===""){if(o+=b.slice(r.index,r.index+1),!J){let V0=Error(`0 width match regex (${k})`);throw V0.languageName=k,V0.badRule=B0.rule,V0}return 1}if(B0=r,r.type==="begin")return z0(r);else if(r.type==="illegal"&&!v){let V0=Error('Illegal lexeme "'+Z0+'" for mode "'+(l.scope||"<unnamed>")+'"');throw V0.mode=l,V0}else if(r.type==="end"){let V0=A0(r);if(V0!==Iy)return V0}if(r.type==="illegal"&&Z0==="")return o+=`
|
|
4
|
+
`,1;if(k0>1e5&&k0>r.index*3)throw Error("potential infinite loop, way more iterations than matches");return o+=Z0,Z0.length}let J0=R(k);if(!J0)throw M7(Q.replace("{}",k)),Error('Unknown language: "'+k+'"');let n=R80(J0),f="",l=u||n,m={},a=new z.__emitter(z);i();let o="",D0=0,O0=0,k0=0,r0=!1;try{if(!J0.__emitTokens){l.matcher.considerAll();for(;;){if(k0++,r0)r0=!1;else l.matcher.considerAll();l.matcher.lastIndex=O0;let p=l.matcher.exec(b);if(!p)break;let r=b.substring(O0,p.index),Z0=$0(r,p);O0=p.index+Z0}$0(b.substring(O0))}else J0.__emitTokens(b,a);return a.finalize(),f=a.toHTML(),{language:k,value:f,relevance:D0,illegal:!1,_emitter:a,_top:l}}catch(p){if(p.message&&p.message.includes("Illegal"))return{language:k,value:wA(b),illegal:!0,relevance:0,_illegalBy:{message:p.message,index:O0,context:b.slice(O0-100,O0+100),mode:p.mode,resultSoFar:f},_emitter:a};else if(J)return{language:k,value:wA(b),illegal:!1,relevance:0,errorRaised:p,_emitter:a,_top:l};else throw p}}function K(k){let b={value:wA(k),illegal:!1,relevance:0,_top:X,_emitter:new z.__emitter(z)};return b._emitter.addText(k),b}function W(k,b){b=b||z.languages||Object.keys(Z);let v=K(k),u=b.filter(R).filter(w).map((e)=>Y(e,k,!1));u.unshift(v);let C=u.sort((e,L0)=>{if(e.relevance!==L0.relevance)return L0.relevance-e.relevance;if(e.language&&L0.language){if(R(e.language).supersetOf===L0.language)return 1;else if(R(L0.language).supersetOf===e.language)return-1}return 0}),[t,H0]=C,x=t;return x.secondBest=H0,x}function N(k,b,v){let u=b&&H[b]||v;k.classList.add("hljs"),k.classList.add(`language-${u}`)}function L(k){let b=null,v=F(k);if(G(v))return;if(j("before:highlightElement",{el:k,language:v}),k.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",k);return}if(k.children.length>0){if(!z.ignoreUnescapedHTML)console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(k);if(z.throwUnescapedHTML)throw new dy("One of your code blocks includes unescaped HTML.",k.innerHTML)}b=k;let u=b.textContent,C=v?U(u,{language:v,ignoreIllegals:!0}):W(u);if(k.innerHTML=C.value,k.dataset.highlighted="yes",N(k,v,C.language),k.result={language:C.language,re:C.relevance,relevance:C.relevance},C.secondBest)k.secondBest={language:C.secondBest.language,relevance:C.secondBest.relevance};j("after:highlightElement",{el:k,result:C,text:u})}function V(k){z=Sy(z,k)}let A=()=>{_(),OZ("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function D(){_(),OZ("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let q=!1;function _(){function k(){_()}if(document.readyState==="loading"){if(!q)window.addEventListener("DOMContentLoaded",k,!1);q=!0;return}document.querySelectorAll(z.cssSelector).forEach(L)}function M(k,b){let v=null;try{v=b($)}catch(u){if(M7("Language definition for '{}' could not be registered.".replace("{}",k)),!J)throw u;else M7(u);v=X}if(!v.name)v.name=k;if(Z[k]=v,v.rawDefinition=b.bind(null,$),v.aliases)y(v.aliases,{languageName:k})}function P(k){delete Z[k];for(let b of Object.keys(H))if(H[b]===k)delete H[b]}function T(){return Object.keys(Z)}function R(k){return k=(k||"").toLowerCase(),Z[k]||Z[H[k]]}function y(k,{languageName:b}){if(typeof k==="string")k=[k];k.forEach((v)=>{H[v.toLowerCase()]=b})}function w(k){let b=R(k);return b&&!b.disableAutodetect}function h(k){if(k["before:highlightBlock"]&&!k["before:highlightElement"])k["before:highlightElement"]=(b)=>{k["before:highlightBlock"](Object.assign({block:b.el},b))};if(k["after:highlightBlock"]&&!k["after:highlightElement"])k["after:highlightElement"]=(b)=>{k["after:highlightBlock"](Object.assign({block:b.el},b))}}function E(k){h(k),B.push(k)}function I(k){let b=B.indexOf(k);if(b!==-1)B.splice(b,1)}function j(k,b){let v=k;B.forEach(function(u){if(u[v])u[v](b)})}function S(k){return OZ("10.7.0","highlightBlock will be removed entirely in v12.0"),OZ("10.7.0","Please use highlightElement now."),L(k)}Object.assign($,{highlight:U,highlightAuto:W,highlightAll:_,highlightElement:L,highlightBlock:S,configure:V,initHighlighting:A,initHighlightingOnLoad:D,registerLanguage:M,unregisterLanguage:P,listLanguages:T,getLanguage:R,registerAliases:y,autoDetection:w,inherit:Sy,addPlugin:E,removePlugin:I}),$.debugMode=function(){J=!1},$.safeMode=function(){J=!0},$.versionString=b80,$.regex={concat:P7,lookahead:hy,either:IA,optional:n40,anyNumberOfTimes:a40};for(let k in PU)if(typeof PU[k]==="object")Ry(PU[k]);return Object.assign($,PU),$},jZ=ly({});jZ.newInstance=()=>ly({});iy.exports=jZ;jZ.HighlightJS=jZ;jZ.default=jZ});var ax=G5((I$1,rx)=>{var z60=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],ix=/[\n\r\u2028\u2029]/,G60=/[\s#!"$&'():;<=>@\\^`|]/g;rx.exports=function(Z){return Z.map(function(H){if(H==="")return"''";if(H&&typeof H==="object"){if("op"in H&&H.op==="glob"){if(typeof H.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(ix.test(H.pattern))throw TypeError("glob `pattern` must not contain line terminators");return H.pattern.replace(G60,"\\$&")}if("op"in H&&typeof H.op==="string"){if(z60.indexOf(H.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(H.op));return H.op.replace(/[\s\S]/g,"\\$&")}if("comment"in H&&typeof H.comment==="string"){if(ix.test(H.comment))throw TypeError("`comment` must not contain line terminators");return"#"+H.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(H)&&!/'/.test(H))return"'"+H.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(H))return'"'+H.replace(/(["\\$`!])/g,"\\$1")+'"';return String(H).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}});var Zv=G5((R$1,$v)=>{var ex="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",nx=new RegExp("^"+ex+"$"),ox="|&;()<> \\t",F60="'([^']*?)'",U60='"((\\\\"|[^"])*?)"',Y60=/^#$/,sx="'",tx='"',bU="$",j7="",K60=4294967296;for(yU=0;yU<4;yU++)j7+=(K60*Math.random()).toString(16);var yU,W60=new RegExp("^"+j7);function N60($,Z){var H=Z.lastIndex,B=[],J;while(J=Z.exec($))if(B[B.length]=J,Z.lastIndex===J.index)Z.lastIndex+=1;return Z.lastIndex=H,B}function L60($,Z,H){var B=typeof $==="function"?$(H):$[H];if(typeof B>"u"&&H!="")B="";else if(typeof B>"u")B="$";if(typeof B==="object")return Z+j7+JSON.stringify(B)+j7;return Z+B}function A60($,Z,H){if(!H)H={};var B=H.escape||"\\",J=H.splitUnquoted===!0?`
|
|
5
|
+
`:typeof H.splitUnquoted==="string"?H.splitUnquoted:"",Q="(\\"+B+`['"`+ox+`]|[^\\s'"`+ox+"])+",X=new RegExp(["("+ex+")","("+Q+"|"+U60+"|"+F60+")+"].join("|"),"g"),z=N60($,X);if(z.length===0)return[];if(!Z)Z={};var G=!1;return z.map(function(F){var U=F[0];if(!U||G)return;if(nx.test(U))return{op:U};var Y=!1,K=!1,W="",N=[],L=!1,V=null,A=!1,D;function q(){D+=1;var h,E,I=U.charAt(D);if(I==="{"){if(D+=1,U.charAt(D)==="}")throw Error("Bad substitution: "+U.slice(D-2,D+1));var j=1;h=D;while(j>0&&h<U.length){if(U.charAt(h)==="{"&&U.charAt(h-1)==="$")j+=1;else if(U.charAt(h)==="}")j-=1;h+=1}if(j!==0)throw Error("Bad substitution: "+U.slice(D));h-=1,E=U.slice(D,h),D=h}else if(/[*@#?$!_-]/.test(I))E=I,D+=1;else{var S=U.slice(D);if(h=S.match(/[^\w\d_]/),!h)E=S,D=U.length;else E=S.slice(0,h.index),D+=h.index-1}return L60(Z,"",E)}function _(){if(V===null)return;if(V===0){if(W!=="")N[N.length]=W,W=""}else{N[N.length]=W,W="";for(var h=1;h<V;h+=1)N[N.length]=""}V=null}for(D=0;D<U.length;D++){var M=U.charAt(D);if(J&&M!==bU)_();if(A=A||!Y&&(M==="*"||M==="?"),K)W+=M,K=!1;else if(Y)if(M===Y)Y=!1;else if(Y==sx)W+=M;else if(M===B)if(D+=1,M=U.charAt(D),M===tx||M===B||M===bU)W+=M;else W+=B+M;else if(M===bU)W+=q();else W+=M;else if(M===tx||M===sx)Y=M,L=!0;else if(nx.test(M))return{op:U};else if(Y60.test(M)){G=!0;var P={comment:$.slice(F.index+D+1)};if(W.length)return[W,P];return[P]}else if(M===B)K=!0;else if(M===bU){var T=q();if(!J)W+=T;else for(var R=0;R<T.length;R+=1){var y=T.charAt(R);if(J.indexOf(y)<0)_(),W+=y;else if(V===null)V=y===" "||y==="\t"||y===`
|
|
6
|
+
`?0:1;else if(y!==" "&&y!=="\t"&&y!==`
|
|
7
|
+
`)V+=1}}else W+=M}if(A)return{op:"glob",pattern:W};if(J){if(V!==null&&V>0){N[N.length]=W,W="";for(var w=1;w<V;w+=1)N[N.length]=""}if(W!==""||L&&N.length===0)N[N.length]=W;return N}return W}).reduce(function(F,U){if(typeof U>"u")return F;return[].concat(U).forEach(function(Y){F[F.length]=Y}),F},[])}$v.exports=function(Z,H,B){var J=A60(Z,H,B);if(typeof H!=="function")return J;return J.reduce(function(Q,X){if(typeof X==="object")return Q[Q.length]=X,Q;var z=X.split(RegExp("("+j7+".*?"+j7+")","g"));if(z.length===1)return Q[Q.length]=z[0],Q;return z.filter(Boolean).forEach(function(G){Q[Q.length]=W60.test(G)?JSON.parse(G.split(j7)[1]):G}),Q},[])}});var Yg=G5((sU,Ug)=>{(function($,Z){typeof sU==="object"&&typeof Ug<"u"?Z(sU):typeof define==="function"&&define.amd?define(["exports"],Z):($=typeof globalThis<"u"?globalThis:$||self,Z($["fast-equals"]={}))})(sU,function($){function Z(d){return function(K0,Q0,z0,A0,i,B0,$0){return d(K0,Q0,$0)}}function H(d){return function(K0,Q0,z0,A0){if(!K0||!Q0||typeof K0!=="object"||typeof Q0!=="object")return d(K0,Q0,z0,A0);var i=A0.get(K0),B0=A0.get(Q0);if(i&&B0)return i===Q0&&B0===K0;A0.set(K0,Q0),A0.set(Q0,K0);var $0=d(K0,Q0,z0,A0);return A0.delete(K0),A0.delete(Q0),$0}}function B(d,X0){var K0={};for(var Q0 in d)K0[Q0]=d[Q0];for(var Q0 in X0)K0[Q0]=X0[Q0];return K0}function J(d){return d.constructor===Object||d.constructor==null}function Q(d){return typeof d.then==="function"}function X(d,X0){return d===X0||d!==d&&X0!==X0}var z="[object Arguments]",G="[object Boolean]",F="[object Date]",U="[object RegExp]",Y="[object Map]",K="[object Number]",W="[object Object]",N="[object Set]",L="[object String]",V=Object.prototype.toString;function A(d){var{areArraysEqual:X0,areDatesEqual:K0,areMapsEqual:Q0,areObjectsEqual:z0,areRegExpsEqual:A0,areSetsEqual:i,createIsNestedEqual:B0}=d,$0=B0(J0);function J0(n,f,l){if(n===f)return!0;if(!n||!f||typeof n!=="object"||typeof f!=="object")return n!==n&&f!==f;if(J(n)&&J(f))return z0(n,f,$0,l);var m=Array.isArray(n),a=Array.isArray(f);if(m||a)return m===a&&X0(n,f,$0,l);var o=V.call(n);if(o!==V.call(f))return!1;if(o===F)return K0(n,f,$0,l);if(o===U)return A0(n,f,$0,l);if(o===Y)return Q0(n,f,$0,l);if(o===N)return i(n,f,$0,l);if(o===W||o===z)return Q(n)||Q(f)?!1:z0(n,f,$0,l);if(o===G||o===K||o===L)return X(n.valueOf(),f.valueOf());return!1}return J0}function D(d,X0,K0,Q0){var z0=d.length;if(X0.length!==z0)return!1;while(z0-- >0)if(!K0(d[z0],X0[z0],z0,z0,d,X0,Q0))return!1;return!0}var q=H(D);function _(d,X0){return X(d.valueOf(),X0.valueOf())}function M(d,X0,K0,Q0){var z0=d.size===X0.size;if(!z0)return!1;if(!d.size)return!0;var A0={},i=0;return d.forEach(function(B0,$0){if(!z0)return;var J0=!1,n=0;X0.forEach(function(f,l){if(!J0&&!A0[n]&&(J0=K0($0,l,i,n,d,X0,Q0)&&K0(B0,f,$0,l,d,X0,Q0)))A0[n]=!0;n++}),i++,z0=J0}),z0}var P=H(M),T="_owner",R=Object.prototype.hasOwnProperty;function y(d,X0,K0,Q0){var z0=Object.keys(d),A0=z0.length;if(Object.keys(X0).length!==A0)return!1;var i;while(A0-- >0){if(i=z0[A0],i===T){var B0=!!d.$$typeof,$0=!!X0.$$typeof;if((B0||$0)&&B0!==$0)return!1}if(!R.call(X0,i)||!K0(d[i],X0[i],i,i,d,X0,Q0))return!1}return!0}var w=H(y);function h(d,X0){return d.source===X0.source&&d.flags===X0.flags}function E(d,X0,K0,Q0){var z0=d.size===X0.size;if(!z0)return!1;if(!d.size)return!0;var A0={};return d.forEach(function(i,B0){if(!z0)return;var $0=!1,J0=0;X0.forEach(function(n,f){if(!$0&&!A0[J0]&&($0=K0(i,n,B0,f,d,X0,Q0)))A0[J0]=!0;J0++}),z0=$0}),z0}var I=H(E),j=Object.freeze({areArraysEqual:D,areDatesEqual:_,areMapsEqual:M,areObjectsEqual:y,areRegExpsEqual:h,areSetsEqual:E,createIsNestedEqual:Z}),S=Object.freeze({areArraysEqual:q,areDatesEqual:_,areMapsEqual:P,areObjectsEqual:w,areRegExpsEqual:h,areSetsEqual:I,createIsNestedEqual:Z}),k=A(j);function b(d,X0){return k(d,X0,void 0)}var v=A(B(j,{createIsNestedEqual:function(){return X}}));function u(d,X0){return v(d,X0,void 0)}var C=A(S);function t(d,X0){return C(d,X0,new WeakMap)}var H0=A(B(S,{createIsNestedEqual:function(){return X}}));function x(d,X0){return H0(d,X0,new WeakMap)}function e(d){return A(B(j,d(j)))}function L0(d){var X0=A(B(S,d(S)));return function(K0,Q0,z0){if(z0===void 0)z0=new WeakMap;return X0(K0,Q0,z0)}}$.circularDeepEqual=t,$.circularShallowEqual=x,$.createCustomCircularEqual=L0,$.createCustomEqual=e,$.deepEqual=b,$.sameValueZeroEqual=X,$.shallowEqual=u,Object.defineProperty($,"__esModule",{value:!0})})});var Wg=G5((CB1,Kg)=>{var N$0="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Kg.exports=N$0});var Vg=G5((wB1,Ag)=>{var L$0=Wg();function Ng(){}function Lg(){}Lg.resetWarningCache=Ng;Ag.exports=function(){function $(B,J,Q,X,z,G){if(G===L$0)return;var F=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 F.name="Invariant Violation",F}$.isRequired=$;function Z(){return $}var H={array:$,bigint:$,bool:$,func:$,number:$,object:$,string:$,symbol:$,any:$,arrayOf:Z,element:$,elementType:$,instanceOf:Z,node:$,objectOf:Z,oneOf:Z,oneOfType:Z,shape:Z,exact:Z,checkPropTypes:Lg,resetWarningCache:Ng};return H.PropTypes=H,H}});var RJ=G5((EB1,Dg)=>{Dg.exports=Vg()();var A$0,V$0});var Pg=G5((SB1,BD)=>{function Mg($){var Z,H,B="";if(typeof $=="string"||typeof $=="number")B+=$;else if(typeof $=="object")if(Array.isArray($)){var J=$.length;for(Z=0;Z<J;Z++)$[Z]&&(H=Mg($[Z]))&&(B&&(B+=" "),B+=H)}else for(H in $)$[H]&&(B&&(B+=" "),B+=H);return B}function qg(){for(var $,Z,H=0,B="",J=arguments.length;H<J;H++)($=arguments[H])&&(Z=Mg($))&&(B&&(B+=" "),B+=Z);return B}BD.exports=qg,BD.exports.clsx=qg});var kJ=G5((_g)=>{Object.defineProperty(_g,"__esModule",{value:!0});_g.dontSetMe=_$0;_g.findInArray=D$0;_g.int=P$0;_g.isFunction=q$0;_g.isNum=M$0;function D$0($,Z){for(let H=0,B=$.length;H<B;H++)if(Z.apply(Z,[$[H],H,$]))return $[H]}function q$0($){return typeof $==="function"||Object.prototype.toString.call($)==="[object Function]"}function M$0($){return typeof $==="number"&&!isNaN($)}function P$0($){return parseInt($,10)}function _$0($,Z,H){if($[Z])return Error(`Invalid prop ${Z} passed to ${H} - do not set this, set it on the child.`)}});var wg=G5((Tg)=>{Object.defineProperty(Tg,"__esModule",{value:!0});Tg.browserPrefixToKey=jg;Tg.browserPrefixToStyle=E$0;Tg.default=void 0;Tg.getPrefix=Og;var JD=["Moz","Webkit","O","ms"];function Og(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";let Z=window.document?.documentElement?.style;if(!Z)return"";if($ in Z)return"";for(let H=0;H<JD.length;H++)if(jg($,JD[H])in Z)return JD[H];return""}function jg($,Z){return Z?`${Z}${S$0($)}`:$}function E$0($,Z){return Z?`-${Z.toLowerCase()}-${$}`:$}function S$0($){let Z="",H=!0;for(let B=0;B<$.length;B++)if(H)Z+=$[B].toUpperCase(),H=!1;else if($[B]==="-")H=!0;else Z+=$[B];return Z}var RB1=Tg.default=Og()});var eU=G5((yg)=>{Object.defineProperty(yg,"__esModule",{value:!0});yg.addClassName=kg;yg.addEvent=y$0;yg.addUserSelectStyles=l$0;yg.createCSSTransform=p$0;yg.createSVGTransform=u$0;yg.getTouch=c$0;yg.getTouchIdentifier=d$0;yg.getTranslation=QD;yg.innerHeight=g$0;yg.innerWidth=f$0;yg.matchesSelector=Rg;yg.matchesSelectorAndParentsTo=b$0;yg.offsetXYFromParent=m$0;yg.outerHeight=x$0;yg.outerWidth=v$0;yg.removeClassName=bg;yg.removeEvent=h$0;yg.scheduleRemoveUserSelectStyles=i$0;var x4=kJ(),Eg=Ig(wg());function Ig($,Z){if(typeof WeakMap=="function")var H=new WeakMap,B=new WeakMap;return(Ig=function(J,Q){if(!Q&&J&&J.__esModule)return J;var X,z,G={__proto__:null,default:J};if(J===null||typeof J!="object"&&typeof J!="function")return G;if(X=Q?B:H){if(X.has(J))return X.get(J);X.set(J,G)}for(let F in J)F!=="default"&&{}.hasOwnProperty.call(J,F)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(J,F))&&(z.get||z.set)?X(G,F,z):G[F]=J[F]);return G})($,Z)}var tU="";function Rg($,Z){if(!tU)tU=(0,x4.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(H){return(0,x4.isFunction)($[H])});if(!(0,x4.isFunction)($[tU]))return!1;return $[tU](Z)}function b$0($,Z,H){let B=$;do{if(Rg(B,Z))return!0;if(B===H)return!1;B=B.parentNode}while(B);return!1}function y$0($,Z,H,B){if(!$)return;let J={capture:!0,...B};if($.addEventListener)$.addEventListener(Z,H,J);else if($.attachEvent)$.attachEvent("on"+Z,H);else $["on"+Z]=H}function h$0($,Z,H,B){if(!$)return;let J={capture:!0,...B};if($.removeEventListener)$.removeEventListener(Z,H,J);else if($.detachEvent)$.detachEvent("on"+Z,H);else $["on"+Z]=null}function x$0($){let Z=$.clientHeight,H=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,x4.int)(H.borderTopWidth),Z+=(0,x4.int)(H.borderBottomWidth),Z}function v$0($){let Z=$.clientWidth,H=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,x4.int)(H.borderLeftWidth),Z+=(0,x4.int)(H.borderRightWidth),Z}function g$0($){let Z=$.clientHeight,H=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,x4.int)(H.paddingTop),Z-=(0,x4.int)(H.paddingBottom),Z}function f$0($){let Z=$.clientWidth,H=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,x4.int)(H.paddingLeft),Z-=(0,x4.int)(H.paddingRight),Z}function m$0($,Z,H){let J=Z===Z.ownerDocument.body?{left:0,top:0}:Z.getBoundingClientRect(),Q=($.clientX+Z.scrollLeft-J.left)/H,X=($.clientY+Z.scrollTop-J.top)/H;return{x:Q,y:X}}function p$0($,Z){let H=QD($,Z,"px");return{[(0,Eg.browserPrefixToKey)("transform",Eg.default)]:H}}function u$0($,Z){return QD($,Z,"")}function QD($,Z,H){let{x:B,y:J}=$,Q=`translate(${B}${H},${J}${H})`;if(Z){let X=`${typeof Z.x==="string"?Z.x:Z.x+H}`,z=`${typeof Z.y==="string"?Z.y:Z.y+H}`;Q=`translate(${X}, ${z})`+Q}return Q}function c$0($,Z){return $.targetTouches&&(0,x4.findInArray)($.targetTouches,(H)=>Z===H.identifier)||$.changedTouches&&(0,x4.findInArray)($.changedTouches,(H)=>Z===H.identifier)}function d$0($){if($.targetTouches&&$.targetTouches[0])return $.targetTouches[0].identifier;if($.changedTouches&&$.changedTouches[0])return $.changedTouches[0].identifier}function l$0($){if(!$)return;let Z=$.getElementById("react-draggable-style-el");if(!Z)Z=$.createElement("style"),Z.type="text/css",Z.id="react-draggable-style-el",Z.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
8
|
+
`,Z.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
9
|
+
`,$.getElementsByTagName("head")[0].appendChild(Z);if($.body)kg($.body,"react-draggable-transparent-selection")}function i$0($){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{Sg($)});else Sg($)}function Sg($){if(!$)return;try{if($.body)bg($.body,"react-draggable-transparent-selection");if($.selection)$.selection.empty();else{let Z=($.defaultView||window).getSelection();if(Z&&Z.type!=="Caret")Z.removeAllRanges()}}catch(Z){}}function kg($,Z){if($.classList)$.classList.add(Z);else if(!$.className.match(new RegExp(`(?:^|\\s)${Z}(?!\\S)`)))$.className+=` ${Z}`}function bg($,Z){if($.classList)$.classList.remove(Z);else $.className=$.className.replace(new RegExp(`(?:^|\\s)${Z}(?!\\S)`,"g"),"")}});var zD=G5((hg)=>{Object.defineProperty(hg,"__esModule",{value:!0});hg.canDragX=WZ0;hg.canDragY=NZ0;hg.createCoreData=AZ0;hg.createDraggableData=VZ0;hg.getBoundPosition=YZ0;hg.getControlPosition=LZ0;hg.snapToGrid=KZ0;var v4=kJ(),pZ=eU();function YZ0($,Z,H){if(!$.props.bounds)return[Z,H];let{bounds:B}=$.props;B=typeof B==="string"?B:DZ0(B);let J=XD($);if(typeof B==="string"){let{ownerDocument:Q}=J,X=Q.defaultView,z;if(B==="parent")z=J.parentNode;else z=J.getRootNode().querySelector(B);if(!(z instanceof X.HTMLElement))throw Error('Bounds selector "'+B+'" could not find an element.');let G=z,F=X.getComputedStyle(J),U=X.getComputedStyle(G);B={left:-J.offsetLeft+(0,v4.int)(U.paddingLeft)+(0,v4.int)(F.marginLeft),top:-J.offsetTop+(0,v4.int)(U.paddingTop)+(0,v4.int)(F.marginTop),right:(0,pZ.innerWidth)(G)-(0,pZ.outerWidth)(J)-J.offsetLeft+(0,v4.int)(U.paddingRight)-(0,v4.int)(F.marginRight),bottom:(0,pZ.innerHeight)(G)-(0,pZ.outerHeight)(J)-J.offsetTop+(0,v4.int)(U.paddingBottom)-(0,v4.int)(F.marginBottom)}}if((0,v4.isNum)(B.right))Z=Math.min(Z,B.right);if((0,v4.isNum)(B.bottom))H=Math.min(H,B.bottom);if((0,v4.isNum)(B.left))Z=Math.max(Z,B.left);if((0,v4.isNum)(B.top))H=Math.max(H,B.top);return[Z,H]}function KZ0($,Z,H){let B=Math.round(Z/$[0])*$[0],J=Math.round(H/$[1])*$[1];return[B,J]}function WZ0($){return $.props.axis==="both"||$.props.axis==="x"}function NZ0($){return $.props.axis==="both"||$.props.axis==="y"}function LZ0($,Z,H){let B=typeof Z==="number"?(0,pZ.getTouch)($,Z):null;if(typeof Z==="number"&&!B)return null;let J=XD(H),Q=H.props.offsetParent||J.offsetParent||J.ownerDocument.body;return(0,pZ.offsetXYFromParent)(B||$,Q,H.props.scale)}function AZ0($,Z,H){let B=!(0,v4.isNum)($.lastX),J=XD($);if(B)return{node:J,deltaX:0,deltaY:0,lastX:Z,lastY:H,x:Z,y:H};else return{node:J,deltaX:Z-$.lastX,deltaY:H-$.lastY,lastX:$.lastX,lastY:$.lastY,x:Z,y:H}}function VZ0($,Z){let H=$.props.scale;return{node:Z.node,x:$.state.x+Z.deltaX/H,y:$.state.y+Z.deltaY/H,deltaX:Z.deltaX/H,deltaY:Z.deltaY/H,lastX:$.state.x,lastY:$.state.y}}function DZ0($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom}}function XD($){let Z=$.findDOMNode();if(!Z)throw Error("<DraggableCore>: Unmounted during event!");return Z}});var GD=G5((xg)=>{Object.defineProperty(xg,"__esModule",{value:!0});xg.default=CZ0;function CZ0(){}});var mg=G5((gg)=>{var RZ0=O(g()),kZ0=O(F4());Object.defineProperty(gg,"__esModule",{value:!0});gg.default=void 0;var FD=vg(RZ0),J4=YD(RJ()),EZ0=YD(kZ0),u2=eU(),B6=zD(),UD=kJ(),bJ=YD(GD());function YD($){return $&&$.__esModule?$:{default:$}}function vg($,Z){if(typeof WeakMap=="function")var H=new WeakMap,B=new WeakMap;return(vg=function(J,Q){if(!Q&&J&&J.__esModule)return J;var X,z,G={__proto__:null,default:J};if(J===null||typeof J!="object"&&typeof J!="function")return G;if(X=Q?B:H){if(X.has(J))return X.get(J);X.set(J,G)}for(let F in J)F!=="default"&&{}.hasOwnProperty.call(J,F)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(J,F))&&(z.get||z.set)?X(G,F,z):G[F]=J[F]);return G})($,Z)}function Q4($,Z,H){return(Z=SZ0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function SZ0($){var Z=IZ0($,"string");return typeof Z=="symbol"?Z:Z+""}function IZ0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var B=H.call($,Z||"default");if(typeof B!="object")return B;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}var E8={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},J6=E8.mouse;class yJ extends FD.Component{constructor(){super(...arguments);Q4(this,"dragging",!1),Q4(this,"lastX",NaN),Q4(this,"lastY",NaN),Q4(this,"touchIdentifier",null),Q4(this,"mounted",!1),Q4(this,"handleDragStart",($)=>{if(this.props.onMouseDown($),!this.props.allowAnyClick&&typeof $.button==="number"&&$.button!==0)return!1;let Z=this.findDOMNode();if(!Z||!Z.ownerDocument||!Z.ownerDocument.body)throw Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:H}=Z;if(this.props.disabled||!($.target instanceof H.defaultView.Node)||this.props.handle&&!(0,u2.matchesSelectorAndParentsTo)($.target,this.props.handle,Z)||this.props.cancel&&(0,u2.matchesSelectorAndParentsTo)($.target,this.props.cancel,Z))return;if($.type==="touchstart"&&!this.props.allowMobileScroll)$.preventDefault();let B=(0,u2.getTouchIdentifier)($);this.touchIdentifier=B;let J=(0,B6.getControlPosition)($,B,this);if(J==null)return;let{x:Q,y:X}=J,z=(0,B6.createCoreData)(this,Q,X);if((0,bJ.default)("DraggableCore: handleDragStart: %j",z),(0,bJ.default)("calling",this.props.onStart),this.props.onStart($,z)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,u2.addUserSelectStyles)(H);this.dragging=!0,this.lastX=Q,this.lastY=X,(0,u2.addEvent)(H,J6.move,this.handleDrag),(0,u2.addEvent)(H,J6.stop,this.handleDragStop)}),Q4(this,"handleDrag",($)=>{let Z=(0,B6.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:H,y:B}=Z;if(Array.isArray(this.props.grid)){let X=H-this.lastX,z=B-this.lastY;if([X,z]=(0,B6.snapToGrid)(this.props.grid,X,z),!X&&!z)return;H=this.lastX+X,B=this.lastY+z}let J=(0,B6.createCoreData)(this,H,B);if((0,bJ.default)("DraggableCore: handleDrag: %j",J),this.props.onDrag($,J)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(X){let z=document.createEvent("MouseEvents");z.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(z)}return}this.lastX=H,this.lastY=B}),Q4(this,"handleDragStop",($)=>{if(!this.dragging)return;let Z=(0,B6.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:H,y:B}=Z;if(Array.isArray(this.props.grid)){let z=H-this.lastX||0,G=B-this.lastY||0;[z,G]=(0,B6.snapToGrid)(this.props.grid,z,G),H=this.lastX+z,B=this.lastY+G}let J=(0,B6.createCoreData)(this,H,B);if(this.props.onStop($,J)===!1||this.mounted===!1)return!1;let X=this.findDOMNode();if(X){if(this.props.enableUserSelectHack)(0,u2.scheduleRemoveUserSelectStyles)(X.ownerDocument)}if((0,bJ.default)("DraggableCore: handleDragStop: %j",J),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,X)(0,bJ.default)("DraggableCore: Removing handlers"),(0,u2.removeEvent)(X.ownerDocument,J6.move,this.handleDrag),(0,u2.removeEvent)(X.ownerDocument,J6.stop,this.handleDragStop)}),Q4(this,"onMouseDown",($)=>{return J6=E8.mouse,this.handleDragStart($)}),Q4(this,"onMouseUp",($)=>{return J6=E8.mouse,this.handleDragStop($)}),Q4(this,"onTouchStart",($)=>{return J6=E8.touch,this.handleDragStart($)}),Q4(this,"onTouchEnd",($)=>{return J6=E8.touch,this.handleDragStop($)})}componentDidMount(){this.mounted=!0;let $=this.findDOMNode();if($)(0,u2.addEvent)($,E8.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let $=this.findDOMNode();if($){let{ownerDocument:Z}=$;if((0,u2.removeEvent)(Z,E8.mouse.move,this.handleDrag),(0,u2.removeEvent)(Z,E8.touch.move,this.handleDrag),(0,u2.removeEvent)(Z,E8.mouse.stop,this.handleDragStop),(0,u2.removeEvent)(Z,E8.touch.stop,this.handleDragStop),(0,u2.removeEvent)($,E8.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,u2.scheduleRemoveUserSelectStyles)(Z)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:EZ0.default.findDOMNode(this)}render(){return FD.cloneElement(FD.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}gg.default=yJ;Q4(yJ,"displayName","DraggableCore");Q4(yJ,"propTypes",{allowAnyClick:J4.default.bool,allowMobileScroll:J4.default.bool,children:J4.default.node.isRequired,disabled:J4.default.bool,enableUserSelectHack:J4.default.bool,offsetParent:function($,Z){if($[Z]&&$[Z].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:J4.default.arrayOf(J4.default.number),handle:J4.default.string,cancel:J4.default.string,nodeRef:J4.default.object,onStart:J4.default.func,onDrag:J4.default.func,onStop:J4.default.func,onMouseDown:J4.default.func,scale:J4.default.number,className:UD.dontSetMe,style:UD.dontSetMe,transform:UD.dontSetMe});Q4(yJ,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var dg=G5((ND)=>{var vZ0=O(g()),gZ0=O(F4());Object.defineProperty(ND,"__esModule",{value:!0});Object.defineProperty(ND,"DraggableCore",{enumerable:!0,get:function(){return HY.default}});ND.default=void 0;var $Y=ug(vZ0),A5=BY(RJ()),bZ0=BY(gZ0),yZ0=Pg(),pg=eU(),uZ=zD(),KD=kJ(),HY=BY(mg()),ZY=BY(GD());function BY($){return $&&$.__esModule?$:{default:$}}function ug($,Z){if(typeof WeakMap=="function")var H=new WeakMap,B=new WeakMap;return(ug=function(J,Q){if(!Q&&J&&J.__esModule)return J;var X,z,G={__proto__:null,default:J};if(J===null||typeof J!="object"&&typeof J!="function")return G;if(X=Q?B:H){if(X.has(J))return X.get(J);X.set(J,G)}for(let F in J)F!=="default"&&{}.hasOwnProperty.call(J,F)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(J,F))&&(z.get||z.set)?X(G,F,z):G[F]=J[F]);return G})($,Z)}function WD(){return WD=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z];for(var B in H)({}).hasOwnProperty.call(H,B)&&($[B]=H[B])}return $},WD.apply(null,arguments)}function cZ($,Z,H){return(Z=hZ0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function hZ0($){var Z=xZ0($,"string");return typeof Z=="symbol"?Z:Z+""}function xZ0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var B=H.call($,Z||"default");if(typeof B!="object")return B;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class hJ extends $Y.Component{static getDerivedStateFromProps($,Z){let{position:H}=$,{prevPropsPosition:B}=Z;if(H&&(!B||H.x!==B.x||H.y!==B.y))return(0,ZY.default)("Draggable: getDerivedStateFromProps %j",{position:H,prevPropsPosition:B}),{x:H.x,y:H.y,prevPropsPosition:{...H}};return null}constructor($){super($);if(cZ(this,"onDragStart",(Z,H)=>{if((0,ZY.default)("Draggable: onDragStart: %j",H),this.props.onStart(Z,(0,uZ.createDraggableData)(this,H))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),cZ(this,"onDrag",(Z,H)=>{if(!this.state.dragging)return!1;(0,ZY.default)("Draggable: onDrag: %j",H);let B=(0,uZ.createDraggableData)(this,H),J={x:B.x,y:B.y,slackX:0,slackY:0};if(this.props.bounds){let{x:X,y:z}=J;J.x+=this.state.slackX,J.y+=this.state.slackY;let[G,F]=(0,uZ.getBoundPosition)(this,J.x,J.y);J.x=G,J.y=F,J.slackX=this.state.slackX+(X-J.x),J.slackY=this.state.slackY+(z-J.y),B.x=J.x,B.y=J.y,B.deltaX=J.x-this.state.x,B.deltaY=J.y-this.state.y}if(this.props.onDrag(Z,B)===!1)return!1;this.setState(J)}),cZ(this,"onDragStop",(Z,H)=>{if(!this.state.dragging)return!1;if(this.props.onStop(Z,(0,uZ.createDraggableData)(this,H))===!1)return!1;(0,ZY.default)("Draggable: onDragStop: %j",H);let J={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){let{x:X,y:z}=this.props.position;J.x=X,J.y=z}this.setState(J)}),this.state={dragging:!1,dragged:!1,x:$.position?$.position.x:$.defaultPosition.x,y:$.position?$.position.y:$.defaultPosition.y,prevPropsPosition:{...$.position},slackX:0,slackY:0,isElementSVG:!1},$.position&&!($.onDrag||$.onStop))console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){if(typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement)this.setState({isElementSVG:!0})}componentWillUnmount(){if(this.state.dragging)this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??bZ0.default.findDOMNode(this)}render(){let{axis:$,bounds:Z,children:H,defaultPosition:B,defaultClassName:J,defaultClassNameDragging:Q,defaultClassNameDragged:X,position:z,positionOffset:G,scale:F,...U}=this.props,Y={},K=null,N=!Boolean(z)||this.state.dragging,L=z||B,V={x:(0,uZ.canDragX)(this)&&N?this.state.x:L.x,y:(0,uZ.canDragY)(this)&&N?this.state.y:L.y};if(this.state.isElementSVG)K=(0,pg.createSVGTransform)(V,G);else Y=(0,pg.createCSSTransform)(V,G);let A=(0,yZ0.clsx)(H.props.className||"",J,{[Q]:this.state.dragging,[X]:this.state.dragged});return $Y.createElement(HY.default,WD({},U,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),$Y.cloneElement($Y.Children.only(H),{className:A,style:{...H.props.style,...Y},transform:K}))}}ND.default=hJ;cZ(hJ,"displayName","Draggable");cZ(hJ,"propTypes",{...HY.default.propTypes,axis:A5.default.oneOf(["both","x","y","none"]),bounds:A5.default.oneOfType([A5.default.shape({left:A5.default.number,right:A5.default.number,top:A5.default.number,bottom:A5.default.number}),A5.default.string,A5.default.oneOf([!1])]),defaultClassName:A5.default.string,defaultClassNameDragging:A5.default.string,defaultClassNameDragged:A5.default.string,defaultPosition:A5.default.shape({x:A5.default.number,y:A5.default.number}),positionOffset:A5.default.shape({x:A5.default.oneOfType([A5.default.number,A5.default.string]),y:A5.default.oneOfType([A5.default.number,A5.default.string])}),position:A5.default.shape({x:A5.default.number,y:A5.default.number}),className:KD.dontSetMe,style:KD.dontSetMe,transform:KD.dontSetMe});cZ(hJ,"defaultProps",{...HY.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})});var QY=G5((gB1,JY)=>{var{default:lg,DraggableCore:fZ0}=dg();JY.exports=lg;JY.exports.default=lg;JY.exports.DraggableCore=fZ0});var ag=G5((iZ0)=>{var nZ0=O(g());iZ0.__esModule=!0;iZ0.cloneElement=lZ0;var mZ0=pZ0(nZ0);function pZ0($){return $&&$.__esModule?$:{default:$}}function ig($,Z){var H=Object.keys($);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols($);Z&&(B=B.filter(function(J){return Object.getOwnPropertyDescriptor($,J).enumerable})),H.push.apply(H,B)}return H}function rg($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z]!=null?arguments[Z]:{};Z%2?ig(Object(H),!0).forEach(function(B){uZ0($,B,H[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(H)):ig(Object(H)).forEach(function(B){Object.defineProperty($,B,Object.getOwnPropertyDescriptor(H,B))})}return $}function uZ0($,Z,H){return(Z=cZ0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function cZ0($){var Z=dZ0($,"string");return typeof Z=="symbol"?Z:Z+""}function dZ0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var B=H.call($,Z||"default");if(typeof B!="object")return B;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function lZ0($,Z){if(Z.style&&$.props.style)Z.style=rg(rg({},$.props.style),Z.style);if(Z.className&&$.props.className)Z.className=`${$.props.className} ${Z.className}`;return mZ0.default.cloneElement($,Z)}});var LD=G5((sZ0)=>{sZ0.__esModule=!0;sZ0.resizableProps=void 0;var D1=oZ0(RJ()),mB1=QY();function oZ0($){return $&&$.__esModule?$:{default:$}}var pB1=sZ0.resizableProps={axis:D1.default.oneOf(["both","x","y","none"]),className:D1.default.string,children:D1.default.element.isRequired,draggableOpts:D1.default.shape({allowAnyClick:D1.default.bool,cancel:D1.default.string,children:D1.default.node,disabled:D1.default.bool,enableUserSelectHack:D1.default.bool,offsetParent:typeof Element<"u"?D1.default.instanceOf(Element):D1.default.any,grid:D1.default.arrayOf(D1.default.number),handle:D1.default.string,nodeRef:D1.default.object,onStart:D1.default.func,onDrag:D1.default.func,onStop:D1.default.func,onMouseDown:D1.default.func,scale:D1.default.number}),height:function(){for(var $=arguments.length,Z=Array($),H=0;H<$;H++)Z[H]=arguments[H];let[B]=Z;if(B.axis==="both"||B.axis==="y")return D1.default.number.isRequired(...Z);return D1.default.number(...Z)},handle:D1.default.oneOfType([D1.default.node,D1.default.func]),handleSize:D1.default.arrayOf(D1.default.number),lockAspectRatio:D1.default.bool,maxConstraints:D1.default.arrayOf(D1.default.number),minConstraints:D1.default.arrayOf(D1.default.number),onResizeStop:D1.default.func,onResizeStart:D1.default.func,onResize:D1.default.func,resizeHandles:D1.default.arrayOf(D1.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:D1.default.number,width:function(){for(var $=arguments.length,Z=Array($),H=0;H<$;H++)Z[H]=arguments[H];let[B]=Z;if(B.axis==="both"||B.axis==="x")return D1.default.number.isRequired(...Z);return D1.default.number(...Z)}}});var DD=G5((GH0)=>{var UH0=O(g());GH0.__esModule=!0;GH0.default=void 0;var dZ=sg(UH0),eZ0=QY(),$H0=ag(),ZH0=LD(),HH0=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function sg($,Z){if(typeof WeakMap=="function")var H=new WeakMap,B=new WeakMap;return(sg=function(J,Q){if(!Q&&J&&J.__esModule)return J;var X,z,G={__proto__:null,default:J};if(J===null||typeof J!="object"&&typeof J!="function")return G;if(X=Q?B:H){if(X.has(J))return X.get(J);X.set(J,G)}for(let F in J)F!=="default"&&{}.hasOwnProperty.call(J,F)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(J,F))&&(z.get||z.set)?X(G,F,z):G[F]=J[F]);return G})($,Z)}function VD(){return VD=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z];for(var B in H)({}).hasOwnProperty.call(H,B)&&($[B]=H[B])}return $},VD.apply(null,arguments)}function BH0($,Z){if($==null)return{};var H,B,J=JH0($,Z);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);for(B=0;B<Q.length;B++)H=Q[B],Z.indexOf(H)===-1&&{}.propertyIsEnumerable.call($,H)&&(J[H]=$[H])}return J}function JH0($,Z){if($==null)return{};var H={};for(var B in $)if({}.hasOwnProperty.call($,B)){if(Z.indexOf(B)!==-1)continue;H[B]=$[B]}return H}function og($,Z){var H=Object.keys($);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols($);Z&&(B=B.filter(function(J){return Object.getOwnPropertyDescriptor($,J).enumerable})),H.push.apply(H,B)}return H}function AD($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z]!=null?arguments[Z]:{};Z%2?og(Object(H),!0).forEach(function(B){QH0($,B,H[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(H)):og(Object(H)).forEach(function(B){Object.defineProperty($,B,Object.getOwnPropertyDescriptor(H,B))})}return $}function QH0($,Z,H){return(Z=XH0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function XH0($){var Z=zH0($,"string");return typeof Z=="symbol"?Z:Z+""}function zH0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var B=H.call($,Z||"default");if(typeof B!="object")return B;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class XY extends dZ.Component{constructor(){super(...arguments);this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints($,Z){let{minConstraints:H,maxConstraints:B,lockAspectRatio:J}=this.props;if(!H&&!B&&!J)return[$,Z];if(J){let F=this.props.width/this.props.height,U=$-this.props.width,Y=Z-this.props.height;if(Math.abs(U)>Math.abs(Y*F))Z=$/F;else $=Z*F}let[Q,X]=[$,Z],[z,G]=this.slack||[0,0];if($+=z,Z+=G,H)$=Math.max(H[0],$),Z=Math.max(H[1],Z);if(B)$=Math.min(B[0],$),Z=Math.min(B[1],Z);return this.slack=[z+(Q-$),G+(X-Z)],[$,Z]}resizeHandler($,Z){return(H,B)=>{let{node:J,deltaX:Q,deltaY:X}=B;if($==="onResizeStart")this.resetData();let z=(this.props.axis==="both"||this.props.axis==="x")&&Z!=="n"&&Z!=="s",G=(this.props.axis==="both"||this.props.axis==="y")&&Z!=="e"&&Z!=="w";if(!z&&!G)return;let F=Z[0],U=Z[Z.length-1],Y=J.getBoundingClientRect();if(this.lastHandleRect!=null){if(U==="w"){let A=Y.left-this.lastHandleRect.left;Q+=A}if(F==="n"){let A=Y.top-this.lastHandleRect.top;X+=A}}if(this.lastHandleRect=Y,U==="w")Q=-Q;if(F==="n")X=-X;let K=this.props.width+(z?Q/this.props.transformScale:0),W=this.props.height+(G?X/this.props.transformScale:0);if([K,W]=this.runConstraints(K,W),$==="onResizeStop"&&this.lastSize)({width:K,height:W}=this.lastSize);let N=K!==this.props.width||W!==this.props.height;if($!=="onResizeStop")this.lastSize={width:K,height:W};let L=typeof this.props[$]==="function"?this.props[$]:null;if(L&&!($==="onResize"&&!N))H.persist?.(),L(H,{node:J,size:{width:K,height:W},handle:Z});if($==="onResizeStop")this.resetData()}}renderResizeHandle($,Z){let{handle:H}=this.props;if(!H)return dZ.createElement("span",{className:`react-resizable-handle react-resizable-handle-${$}`,ref:Z});if(typeof H==="function")return H($,Z);let B=typeof H.type==="string",J=AD({ref:Z},B?{}:{handleAxis:$});return dZ.cloneElement(H,J)}render(){let $=this.props,{children:Z,className:H,draggableOpts:B,width:J,height:Q,handle:X,handleSize:z,lockAspectRatio:G,axis:F,minConstraints:U,maxConstraints:Y,onResize:K,onResizeStop:W,onResizeStart:N,resizeHandles:L,transformScale:V}=$,A=BH0($,HH0);return(0,$H0.cloneElement)(Z,AD(AD({},A),{},{className:`${H?`${H} `:""}react-resizable`,children:[...dZ.Children.toArray(Z.props.children),...L.map((D)=>{let q=this.handleRefs[D]??(this.handleRefs[D]=dZ.createRef());return dZ.createElement(eZ0.DraggableCore,VD({},B,{nodeRef:q,key:`resizableHandle-${D}`,onStop:this.resizeHandler("onResizeStop",D),onStart:this.resizeHandler("onResizeStart",D),onDrag:this.resizeHandler("onResize",D)}),this.renderResizeHandle(D,q))})]}))}}GH0.default=XY;XY.propTypes=ZH0.resizableProps;XY.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var Bf=G5((MH0)=>{var _H0=O(g());MH0.__esModule=!0;MH0.default=void 0;var qD=Zf(_H0),YH0=$f(RJ()),KH0=$f(DD()),WH0=LD(),NH0=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function $f($){return $&&$.__esModule?$:{default:$}}function Zf($,Z){if(typeof WeakMap=="function")var H=new WeakMap,B=new WeakMap;return(Zf=function(J,Q){if(!Q&&J&&J.__esModule)return J;var X,z,G={__proto__:null,default:J};if(J===null||typeof J!="object"&&typeof J!="function")return G;if(X=Q?B:H){if(X.has(J))return X.get(J);X.set(J,G)}for(let F in J)F!=="default"&&{}.hasOwnProperty.call(J,F)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(J,F))&&(z.get||z.set)?X(G,F,z):G[F]=J[F]);return G})($,Z)}function MD(){return MD=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z];for(var B in H)({}).hasOwnProperty.call(H,B)&&($[B]=H[B])}return $},MD.apply(null,arguments)}function eg($,Z){var H=Object.keys($);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols($);Z&&(B=B.filter(function(J){return Object.getOwnPropertyDescriptor($,J).enumerable})),H.push.apply(H,B)}return H}function zY($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z]!=null?arguments[Z]:{};Z%2?eg(Object(H),!0).forEach(function(B){LH0($,B,H[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(H)):eg(Object(H)).forEach(function(B){Object.defineProperty($,B,Object.getOwnPropertyDescriptor(H,B))})}return $}function LH0($,Z,H){return(Z=AH0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function AH0($){var Z=VH0($,"string");return typeof Z=="symbol"?Z:Z+""}function VH0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var B=H.call($,Z||"default");if(typeof B!="object")return B;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function DH0($,Z){if($==null)return{};var H,B,J=qH0($,Z);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);for(B=0;B<Q.length;B++)H=Q[B],Z.indexOf(H)===-1&&{}.propertyIsEnumerable.call($,H)&&(J[H]=$[H])}return J}function qH0($,Z){if($==null)return{};var H={};for(var B in $)if({}.hasOwnProperty.call($,B)){if(Z.indexOf(B)!==-1)continue;H[B]=$[B]}return H}class PD extends qD.Component{constructor(){super(...arguments);this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=($,Z)=>{let{size:H}=Z;if(this.props.onResize)$.persist?.(),this.setState(H,()=>this.props.onResize&&this.props.onResize($,Z));else this.setState(H)}}static getDerivedStateFromProps($,Z){if(Z.propsWidth!==$.width||Z.propsHeight!==$.height)return{width:$.width,height:$.height,propsWidth:$.width,propsHeight:$.height};return null}render(){let $=this.props,{handle:Z,handleSize:H,onResize:B,onResizeStart:J,onResizeStop:Q,draggableOpts:X,minConstraints:z,maxConstraints:G,lockAspectRatio:F,axis:U,width:Y,height:K,resizeHandles:W,style:N,transformScale:L}=$,V=DH0($,NH0);return qD.createElement(KH0.default,{axis:U,draggableOpts:X,handle:Z,handleSize:H,height:this.state.height,lockAspectRatio:F,maxConstraints:G,minConstraints:z,onResizeStart:J,onResize:this.onResize,onResizeStop:Q,resizeHandles:W,transformScale:L,width:this.state.width},qD.createElement("div",MD({},V,{style:zY(zY({},N),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}MH0.default=PD;PD.propTypes=zY(zY({},WH0.resizableProps),{},{children:YH0.default.element})});var Jf=G5((lB1,GY)=>{GY.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};GY.exports.Resizable=DD().default;GY.exports.ResizableBox=Bf().default});var m4=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe($){return this.listeners.add($),this.onSubscribe(),()=>{this.listeners.delete($),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var Cc=class extends m4{#$;#Z;#H;constructor(){super();this.#H=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$();return window.addEventListener("visibilitychange",Z,!1),()=>{window.removeEventListener("visibilitychange",Z)}}return}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#H)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#H=$,this.#Z?.(),this.#Z=$((Z)=>{if(typeof Z==="boolean")this.setFocused(Z);else this.onFocus()})}setFocused($){if(this.#$!==$)this.#$=$,this.onFocus()}onFocus(){let $=this.isFocused();this.listeners.forEach((Z)=>{Z($)})}isFocused(){if(typeof this.#$==="boolean")return this.#$;return globalThis.document?.visibilityState!=="hidden"}},v7=new Cc;var wc={setTimeout:($,Z)=>setTimeout($,Z),clearTimeout:($)=>clearTimeout($),setInterval:($,Z)=>setInterval($,Z),clearInterval:($)=>clearInterval($)},Ec=class{#$=wc;#Z=!1;setTimeoutProvider($){this.#$=$}setTimeout($,Z){return this.#$.setTimeout($,Z)}clearTimeout($){this.#$.clearTimeout($)}setInterval($,Z){return this.#$.setInterval($,Z)}clearInterval($){this.#$.clearInterval($)}},k8=new Ec;function zq($){setTimeout($,0)}var fY=typeof window>"u"||"Deno"in globalThis;function b5(){}function Uq($,Z){return typeof $==="function"?$(Z):$}function JH($){return typeof $==="number"&&$>=0&&$!==1/0}function eJ($,Z){return Math.max($+(Z||0)-Date.now(),0)}function G8($,Z){return typeof $==="function"?$(Z):$}function i2($,Z){return typeof $==="function"?$(Z):$}function $Q($,Z){let{type:H="all",exact:B,fetchStatus:J,predicate:Q,queryKey:X,stale:z}=$;if(X){if(B){if(Z.queryHash!==QH(X,Z.options))return!1}else if(!W6(Z.queryKey,X))return!1}if(H!=="all"){let G=Z.isActive();if(H==="active"&&!G)return!1;if(H==="inactive"&&G)return!1}if(typeof z==="boolean"&&Z.isStale()!==z)return!1;if(J&&J!==Z.state.fetchStatus)return!1;if(Q&&!Q(Z))return!1;return!0}function ZQ($,Z){let{exact:H,status:B,predicate:J,mutationKey:Q}=$;if(Q){if(!Z.options.mutationKey)return!1;if(H){if(b8(Z.options.mutationKey)!==b8(Q))return!1}else if(!W6(Z.options.mutationKey,Q))return!1}if(B&&Z.state.status!==B)return!1;if(J&&!J(Z))return!1;return!0}function QH($,Z){return(Z?.queryKeyHashFn||b8)($)}function b8($){return JSON.stringify($,(Z,H)=>gY(H)?Object.keys(H).sort().reduce((B,J)=>{return B[J]=H[J],B},{}):H)}function W6($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if($&&Z&&typeof $==="object"&&typeof Z==="object")return Object.keys(Z).every((H)=>W6($[H],Z[H]));return!1}var Sc=Object.prototype.hasOwnProperty;function XH($,Z,H=0){if($===Z)return $;if(H>500)return Z;let B=Gq($)&&Gq(Z);if(!B&&!(gY($)&&gY(Z)))return Z;let Q=(B?$:Object.keys($)).length,X=B?Z:Object.keys(Z),z=X.length,G=B?Array(z):{},F=0;for(let U=0;U<z;U++){let Y=B?U:X[U],K=$[Y],W=Z[Y];if(K===W){if(G[Y]=K,B?U<Q:Sc.call($,Y))F++;continue}if(K===null||W===null||typeof K!=="object"||typeof W!=="object"){G[Y]=W;continue}let N=XH(K,W,H+1);if(G[Y]=N,N===K)F++}return Q===z&&F===Q?$:G}function g7($,Z){if(!Z||Object.keys($).length!==Object.keys(Z).length)return!1;for(let H in $)if($[H]!==Z[H])return!1;return!0}function Gq($){return Array.isArray($)&&$.length===Object.keys($).length}function gY($){if(!Fq($))return!1;let Z=$.constructor;if(Z===void 0)return!0;let H=Z.prototype;if(!Fq(H))return!1;if(!H.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf($)!==Object.prototype)return!1;return!0}function Fq($){return Object.prototype.toString.call($)==="[object Object]"}function Yq($){return new Promise((Z)=>{k8.setTimeout(Z,$)})}function zH($,Z,H){if(typeof H.structuralSharing==="function")return H.structuralSharing($,Z);else if(H.structuralSharing!==!1)return XH($,Z);return Z}function Kq($,Z,H=0){let B=[...$,Z];return H&&B.length>H?B.slice(1):B}function Wq($,Z,H=0){let B=[Z,...$];return H&&B.length>H?B.slice(0,-1):B}var f7=Symbol();function HQ($,Z){if(!$.queryFn&&Z?.initialPromise)return()=>Z.initialPromise;if(!$.queryFn||$.queryFn===f7)return()=>Promise.reject(Error(`Missing queryFn: '${$.queryHash}'`));return $.queryFn}function m7($,Z){if(typeof $==="function")return $(...Z);return!!$}function Nq($,Z,H){let B=!1,J;return Object.defineProperty($,"signal",{enumerable:!0,get:()=>{if(J??=Z(),B)return J;if(B=!0,J.aborted)H();else J.addEventListener("abort",H,{once:!0});return J}}),$}var y8=(()=>{let $=()=>fY;return{isServer(){return $()},setIsServer(Z){$=Z}}})();function GH(){let $,Z,H=new Promise((J,Q)=>{$=J,Z=Q});H.status="pending",H.catch(()=>{});function B(J){Object.assign(H,J),delete H.resolve,delete H.reject}return H.resolve=(J)=>{B({status:"fulfilled",value:J}),$(J)},H.reject=(J)=>{B({status:"rejected",reason:J}),Z(J)},H}var Lq=zq;function Ic(){let $=[],Z=0,H=(z)=>{z()},B=(z)=>{z()},J=Lq,Q=(z)=>{if(Z)$.push(z);else J(()=>{H(z)})},X=()=>{let z=$;if($=[],z.length)J(()=>{B(()=>{z.forEach((G)=>{H(G)})})})};return{batch:(z)=>{let G;Z++;try{G=z()}finally{if(Z--,!Z)X()}return G},batchCalls:(z)=>{return(...G)=>{Q(()=>{z(...G)})}},schedule:Q,setNotifyFunction:(z)=>{H=z},setBatchNotifyFunction:(z)=>{B=z},setScheduler:(z)=>{J=z}}}var u1=Ic();var Rc=class extends m4{#$=!0;#Z;#H;constructor(){super();this.#H=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$(!0),H=()=>$(!1);return window.addEventListener("online",Z,!1),window.addEventListener("offline",H,!1),()=>{window.removeEventListener("online",Z),window.removeEventListener("offline",H)}}return}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#H)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#H=$,this.#Z?.(),this.#Z=$(this.setOnline.bind(this))}setOnline($){if(this.#$!==$)this.#$=$,this.listeners.forEach((H)=>{H($)})}isOnline(){return this.#$}},p7=new Rc;function kc($){return Math.min(1000*2**$,30000)}function mY($){return($??"online")==="online"?p7.isOnline():!0}var BQ=class extends Error{constructor($){super("CancelledError");this.revert=$?.revert,this.silent=$?.silent}};function JQ($){let Z=!1,H=0,B,J=GH(),Q=()=>J.status!=="pending",X=(L)=>{if(!Q()){let V=new BQ(L);K(V),$.onCancel?.(V)}},z=()=>{Z=!0},G=()=>{Z=!1},F=()=>v7.isFocused()&&($.networkMode==="always"||p7.isOnline())&&$.canRun(),U=()=>mY($.networkMode)&&$.canRun(),Y=(L)=>{if(!Q())B?.(),J.resolve(L)},K=(L)=>{if(!Q())B?.(),J.reject(L)},W=()=>{return new Promise((L)=>{B=(V)=>{if(Q()||F())L(V)},$.onPause?.()}).then(()=>{if(B=void 0,!Q())$.onContinue?.()})},N=()=>{if(Q())return;let L,V=H===0?$.initialPromise:void 0;try{L=V??$.fn()}catch(A){L=Promise.reject(A)}Promise.resolve(L).then(Y).catch((A)=>{if(Q())return;let D=$.retry??(y8.isServer()?0:3),q=$.retryDelay??kc,_=typeof q==="function"?q(H,A):q,M=D===!0||typeof D==="number"&&H<D||typeof D==="function"&&D(H,A);if(Z||!M){K(A);return}H++,$.onFail?.(H,A),Yq(_).then(()=>{return F()?void 0:W()}).then(()=>{if(Z)K(A);else N()})})};return{promise:J,status:()=>J.status,cancel:X,continue:()=>{return B?.(),J},cancelRetry:z,continueRetry:G,canStart:U,start:()=>{if(U())N();else W().then(N);return J}}}var QQ=class{#$;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),JH(this.gcTime))this.#$=k8.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime($){this.gcTime=Math.max(this.gcTime||0,$??(y8.isServer()?1/0:300000))}clearGcTimeout(){if(this.#$!==void 0)k8.clearTimeout(this.#$),this.#$=void 0}};var Dq=class extends QQ{#$;#Z;#H;#J;#B;#Q;#X;constructor($){super();this.#X=!1,this.#Q=$.defaultOptions,this.setOptions($.options),this.observers=[],this.#J=$.client,this.#H=this.#J.getQueryCache(),this.queryKey=$.queryKey,this.queryHash=$.queryHash,this.#$=Vq(this.options),this.state=$.state??this.#$,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#B?.promise}setOptions($){if(this.options={...this.#Q,...$},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let Z=Vq(this.options);if(Z.data!==void 0)this.setState(Aq(Z.data,Z.dataUpdatedAt)),this.#$=Z}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#H.remove(this)}setData($,Z){let H=zH(this.state.data,$,this.options);return this.#G({data:H,type:"success",dataUpdatedAt:Z?.updatedAt,manual:Z?.manual}),H}setState($,Z){this.#G({type:"setState",state:$,setStateOptions:Z})}cancel($){let Z=this.#B?.promise;return this.#B?.cancel($),Z?Z.then(b5).catch(b5):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#$}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(($)=>i2($.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===f7||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(($)=>G8($.options.staleTime,this)==="static");return!1}isStale(){if(this.getObserversCount()>0)return this.observers.some(($)=>$.getCurrentResult().isStale);return this.state.data===void 0||this.state.isInvalidated}isStaleByTime($=0){if(this.state.data===void 0)return!0;if($==="static")return!1;if(this.state.isInvalidated)return!0;return!eJ(this.state.dataUpdatedAt,$)}onFocus(){this.observers.find((Z)=>Z.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#B?.continue()}onOnline(){this.observers.find((Z)=>Z.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#B?.continue()}addObserver($){if(!this.observers.includes($))this.observers.push($),this.clearGcTimeout(),this.#H.notify({type:"observerAdded",query:this,observer:$})}removeObserver($){if(this.observers.includes($)){if(this.observers=this.observers.filter((Z)=>Z!==$),!this.observers.length){if(this.#B)if(this.#X||this.#z())this.#B.cancel({revert:!0});else this.#B.cancelRetry();this.scheduleGc()}this.#H.notify({type:"observerRemoved",query:this,observer:$})}}getObserversCount(){return this.observers.length}#z(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){if(!this.state.isInvalidated)this.#G({type:"invalidate"})}async fetch($,Z){if(this.state.fetchStatus!=="idle"&&this.#B?.status()!=="rejected"){if(this.state.data!==void 0&&Z?.cancelRefetch)this.cancel({silent:!0});else if(this.#B)return this.#B.continueRetry(),this.#B.promise}if($)this.setOptions($);if(!this.options.queryFn){let z=this.observers.find((G)=>G.options.queryFn);if(z)this.setOptions(z.options)}let H=new AbortController,B=(z)=>{Object.defineProperty(z,"signal",{enumerable:!0,get:()=>{return this.#X=!0,H.signal}})},J=()=>{let z=HQ(this.options,Z),F=(()=>{let U={client:this.#J,queryKey:this.queryKey,meta:this.meta};return B(U),U})();if(this.#X=!1,this.options.persister)return this.options.persister(z,F,this);return z(F)},X=(()=>{let z={fetchOptions:Z,options:this.options,queryKey:this.queryKey,client:this.#J,state:this.state,fetchFn:J};return B(z),z})();if(this.options.behavior?.onFetch(X,this),this.#Z=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==X.fetchOptions?.meta)this.#G({type:"fetch",meta:X.fetchOptions?.meta});this.#B=JQ({initialPromise:Z?.initialPromise,fn:X.fetchFn,onCancel:(z)=>{if(z instanceof BQ&&z.revert)this.setState({...this.#Z,fetchStatus:"idle"});H.abort()},onFail:(z,G)=>{this.#G({type:"failed",failureCount:z,error:G})},onPause:()=>{this.#G({type:"pause"})},onContinue:()=>{this.#G({type:"continue"})},retry:X.options.retry,retryDelay:X.options.retryDelay,networkMode:X.options.networkMode,canRun:()=>!0});try{let z=await this.#B.start();if(z===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(z),this.#H.config.onSuccess?.(z,this),this.#H.config.onSettled?.(z,this.state.error,this),z}catch(z){if(z instanceof BQ){if(z.silent)return this.#B.promise;else if(z.revert){if(this.state.data===void 0)throw z;return this.state.data}}throw this.#G({type:"error",error:z}),this.#H.config.onError?.(z,this),this.#H.config.onSettled?.(this.state.data,z,this),z}finally{this.scheduleGc()}}#G($){let Z=(H)=>{switch($.type){case"failed":return{...H,fetchFailureCount:$.failureCount,fetchFailureReason:$.error};case"pause":return{...H,fetchStatus:"paused"};case"continue":return{...H,fetchStatus:"fetching"};case"fetch":return{...H,...pY(H.data,this.options),fetchMeta:$.meta??null};case"success":let B={...H,...Aq($.data,$.dataUpdatedAt),dataUpdateCount:H.dataUpdateCount+1,...!$.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#Z=$.manual?B:void 0,B;case"error":let J=$.error;return{...H,error:J,errorUpdateCount:H.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:H.fetchFailureCount+1,fetchFailureReason:J,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...H,isInvalidated:!0};case"setState":return{...H,...$.state}}};this.state=Z(this.state),u1.batch(()=>{this.observers.forEach((H)=>{H.onQueryUpdate()}),this.#H.notify({query:this,type:"updated",action:$})})}};function pY($,Z){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mY(Z.networkMode)?"fetching":"paused",...$===void 0&&{error:null,status:"pending"}}}function Aq($,Z){return{data:$,dataUpdatedAt:Z??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Vq($){let Z=typeof $.initialData==="function"?$.initialData():$.initialData,H=Z!==void 0,B=H?typeof $.initialDataUpdatedAt==="function"?$.initialDataUpdatedAt():$.initialDataUpdatedAt:0;return{data:Z,dataUpdateCount:0,dataUpdatedAt:H?B??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:H?"success":"pending",fetchStatus:"idle"}}var cY=class extends m4{constructor($,Z){super();this.options=Z,this.#$=$,this.#z=null,this.#X=GH(),this.bindMethods(),this.setOptions(Z)}#$;#Z=void 0;#H=void 0;#J=void 0;#B;#Q;#X;#z;#G;#W;#N;#U;#Y;#F;#L=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#Z.addObserver(this),qq(this.#Z,this.options))this.#K();else this.updateResult();this.#q()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return uY(this.#Z,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return uY(this.#Z,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#M(),this.#P(),this.#Z.removeObserver(this)}setOptions($){let Z=this.options,H=this.#Z;if(this.options=this.#$.defaultQueryOptions($),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof i2(this.options.enabled,this.#Z)!=="boolean")throw Error("Expected enabled to be a boolean or a callback that returns a boolean");if(this.#_(),this.#Z.setOptions(this.options),Z._defaulted&&!g7(this.options,Z))this.#$.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#Z,observer:this});let B=this.hasListeners();if(B&&Mq(this.#Z,H,this.options,Z))this.#K();if(this.updateResult(),B&&(this.#Z!==H||i2(this.options.enabled,this.#Z)!==i2(Z.enabled,this.#Z)||G8(this.options.staleTime,this.#Z)!==G8(Z.staleTime,this.#Z)))this.#A();let J=this.#V();if(B&&(this.#Z!==H||i2(this.options.enabled,this.#Z)!==i2(Z.enabled,this.#Z)||J!==this.#F))this.#D(J)}getOptimisticResult($){let Z=this.#$.getQueryCache().build(this.#$,$),H=this.createResult(Z,$);if(yc(this,H))this.#J=H,this.#Q=this.options,this.#B=this.#Z.state;return H}getCurrentResult(){return this.#J}trackResult($,Z){return new Proxy($,{get:(H,B)=>{if(this.trackProp(B),Z?.(B),B==="promise"){if(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#X.status==="pending")this.#X.reject(Error("experimental_prefetchInRender feature flag is not enabled"))}return Reflect.get(H,B)}})}trackProp($){this.#L.add($)}getCurrentQuery(){return this.#Z}refetch({...$}={}){return this.fetch({...$})}fetchOptimistic($){let Z=this.#$.defaultQueryOptions($),H=this.#$.getQueryCache().build(this.#$,Z);return H.fetch().then(()=>this.createResult(H,Z))}fetch($){return this.#K({...$,cancelRefetch:$.cancelRefetch??!0}).then(()=>{return this.updateResult(),this.#J})}#K($){this.#_();let Z=this.#Z.fetch(this.options,$);if(!$?.throwOnError)Z=Z.catch(b5);return Z}#A(){this.#M();let $=G8(this.options.staleTime,this.#Z);if(y8.isServer()||this.#J.isStale||!JH($))return;let H=eJ(this.#J.dataUpdatedAt,$)+1;this.#U=k8.setTimeout(()=>{if(!this.#J.isStale)this.updateResult()},H)}#V(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#Z):this.options.refetchInterval)??!1}#D($){if(this.#P(),this.#F=$,y8.isServer()||i2(this.options.enabled,this.#Z)===!1||!JH(this.#F)||this.#F===0)return;this.#Y=k8.setInterval(()=>{if(this.options.refetchIntervalInBackground||v7.isFocused())this.#K()},this.#F)}#q(){this.#A(),this.#D(this.#V())}#M(){if(this.#U!==void 0)k8.clearTimeout(this.#U),this.#U=void 0}#P(){if(this.#Y!==void 0)k8.clearInterval(this.#Y),this.#Y=void 0}createResult($,Z){let H=this.#Z,B=this.options,J=this.#J,Q=this.#B,X=this.#Q,G=$!==H?$.state:this.#H,{state:F}=$,U={...F},Y=!1,K;if(Z._optimisticResults){let R=this.hasListeners(),y=!R&&qq($,Z),w=R&&Mq($,H,Z,B);if(y||w)U={...U,...pY(F.data,$.options)};if(Z._optimisticResults==="isRestoring")U.fetchStatus="idle"}let{error:W,errorUpdatedAt:N,status:L}=U;K=U.data;let V=!1;if(Z.placeholderData!==void 0&&K===void 0&&L==="pending"){let R;if(J?.isPlaceholderData&&Z.placeholderData===X?.placeholderData)R=J.data,V=!0;else R=typeof Z.placeholderData==="function"?Z.placeholderData(this.#N?.state.data,this.#N):Z.placeholderData;if(R!==void 0)L="success",K=zH(J?.data,R,Z),Y=!0}if(Z.select&&K!==void 0&&!V)if(J&&K===Q?.data&&Z.select===this.#G)K=this.#W;else try{this.#G=Z.select,K=Z.select(K),K=zH(J?.data,K,Z),this.#W=K,this.#z=null}catch(R){this.#z=R}if(this.#z)W=this.#z,K=this.#W,N=Date.now(),L="error";let A=U.fetchStatus==="fetching",D=L==="pending",q=L==="error",_=D&&A,M=K!==void 0,T={status:L,fetchStatus:U.fetchStatus,isPending:D,isSuccess:L==="success",isError:q,isInitialLoading:_,isLoading:_,data:K,dataUpdatedAt:U.dataUpdatedAt,error:W,errorUpdatedAt:N,failureCount:U.fetchFailureCount,failureReason:U.fetchFailureReason,errorUpdateCount:U.errorUpdateCount,isFetched:$.isFetched(),isFetchedAfterMount:U.dataUpdateCount>G.dataUpdateCount||U.errorUpdateCount>G.errorUpdateCount,isFetching:A,isRefetching:A&&!D,isLoadingError:q&&!M,isPaused:U.fetchStatus==="paused",isPlaceholderData:Y,isRefetchError:q&&M,isStale:dY($,Z),refetch:this.refetch,promise:this.#X,isEnabled:i2(Z.enabled,$)!==!1};if(this.options.experimental_prefetchInRender){let R=T.data!==void 0,y=T.status==="error"&&!R,w=(I)=>{if(y)I.reject(T.error);else if(R)I.resolve(T.data)},h=()=>{let I=this.#X=T.promise=GH();w(I)},E=this.#X;switch(E.status){case"pending":if($.queryHash===H.queryHash)w(E);break;case"fulfilled":if(y||T.data!==E.value)h();break;case"rejected":if(!y||T.error!==E.reason)h();break}}return T}updateResult(){let $=this.#J,Z=this.createResult(this.#Z,this.options);if(this.#B=this.#Z.state,this.#Q=this.options,this.#B.data!==void 0)this.#N=this.#Z;if(g7(Z,$))return;this.#J=Z;let H=()=>{if(!$)return!0;let{notifyOnChangeProps:B}=this.options,J=typeof B==="function"?B():B;if(J==="all"||!J&&!this.#L.size)return!0;let Q=new Set(J??this.#L);if(this.options.throwOnError)Q.add("error");return Object.keys(this.#J).some((X)=>{let z=X;return this.#J[z]!==$[z]&&Q.has(z)})};this.#O({listeners:H()})}#_(){let $=this.#$.getQueryCache().build(this.#$,this.options);if($===this.#Z)return;let Z=this.#Z;if(this.#Z=$,this.#H=$.state,this.hasListeners())Z?.removeObserver(this),$.addObserver(this)}onQueryUpdate(){if(this.updateResult(),this.hasListeners())this.#q()}#O($){u1.batch(()=>{if($.listeners)this.listeners.forEach((Z)=>{Z(this.#J)});this.#$.getQueryCache().notify({query:this.#Z,type:"observerResultsUpdated"})})}};function bc($,Z){return i2(Z.enabled,$)!==!1&&$.state.data===void 0&&!($.state.status==="error"&&i2(Z.retryOnMount,$)===!1)}function qq($,Z){return bc($,Z)||$.state.data!==void 0&&uY($,Z,Z.refetchOnMount)}function uY($,Z,H){if(i2(Z.enabled,$)!==!1&&G8(Z.staleTime,$)!=="static"){let B=typeof H==="function"?H($):H;return B==="always"||B!==!1&&dY($,Z)}return!1}function Mq($,Z,H,B){return($!==Z||i2(B.enabled,$)===!1)&&(!H.suspense||$.state.status!=="error")&&dY($,H)}function dY($,Z){return i2(Z.enabled,$)!==!1&&$.isStaleByTime(G8(Z.staleTime,$))}function yc($,Z){if(!g7($.getCurrentResult(),Z))return!0;return!1}function lY($){return{onFetch:(Z,H)=>{let B=Z.options,J=Z.fetchOptions?.meta?.fetchMore?.direction,Q=Z.state.data?.pages||[],X=Z.state.data?.pageParams||[],z={pages:[],pageParams:[]},G=0,F=async()=>{let U=!1,Y=(N)=>{Nq(N,()=>Z.signal,()=>U=!0)},K=HQ(Z.options,Z.fetchOptions),W=async(N,L,V)=>{if(U)return Promise.reject();if(L==null&&N.pages.length)return Promise.resolve(N);let D=(()=>{let P={client:Z.client,queryKey:Z.queryKey,pageParam:L,direction:V?"backward":"forward",meta:Z.options.meta};return Y(P),P})(),q=await K(D),{maxPages:_}=Z.options,M=V?Wq:Kq;return{pages:M(N.pages,q,_),pageParams:M(N.pageParams,L,_)}};if(J&&Q.length){let N=J==="backward",L=N?hc:Pq,V={pages:Q,pageParams:X},A=L(B,V);z=await W(V,A,N)}else{let N=$??Q.length;do{let L=G===0?X[0]??B.initialPageParam:Pq(B,z);if(G>0&&L==null)break;z=await W(z,L),G++}while(G<N)}return z};if(Z.options.persister)Z.fetchFn=()=>{return Z.options.persister?.(F,{client:Z.client,queryKey:Z.queryKey,meta:Z.options.meta,signal:Z.signal},H)};else Z.fetchFn=F}}}function Pq($,{pages:Z,pageParams:H}){let B=Z.length-1;return Z.length>0?$.getNextPageParam(Z[B],Z,H[B],H):void 0}function hc($,{pages:Z,pageParams:H}){return Z.length>0?$.getPreviousPageParam?.(Z[0],Z,H[0],H):void 0}var _q=class extends QQ{#$;#Z;#H;#J;constructor($){super();this.#$=$.client,this.mutationId=$.mutationId,this.#H=$.mutationCache,this.#Z=[],this.state=$.state||iY(),this.setOptions($.options),this.scheduleGc()}setOptions($){this.options=$,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver($){if(!this.#Z.includes($))this.#Z.push($),this.clearGcTimeout(),this.#H.notify({type:"observerAdded",mutation:this,observer:$})}removeObserver($){this.#Z=this.#Z.filter((Z)=>Z!==$),this.scheduleGc(),this.#H.notify({type:"observerRemoved",mutation:this,observer:$})}optionalRemove(){if(!this.#Z.length)if(this.state.status==="pending")this.scheduleGc();else this.#H.remove(this)}continue(){return this.#J?.continue()??this.execute(this.state.variables)}async execute($){let Z=()=>{this.#B({type:"continue"})},H={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#J=JQ({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn($,H)},onFail:(Q,X)=>{this.#B({type:"failed",failureCount:Q,error:X})},onPause:()=>{this.#B({type:"pause"})},onContinue:Z,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#H.canRun(this)});let B=this.state.status==="pending",J=!this.#J.canStart();try{if(B)Z();else{if(this.#B({type:"pending",variables:$,isPaused:J}),this.#H.config.onMutate)await this.#H.config.onMutate($,this,H);let X=await this.options.onMutate?.($,H);if(X!==this.state.context)this.#B({type:"pending",context:X,variables:$,isPaused:J})}let Q=await this.#J.start();return await this.#H.config.onSuccess?.(Q,$,this.state.context,this,H),await this.options.onSuccess?.(Q,$,this.state.context,H),await this.#H.config.onSettled?.(Q,null,this.state.variables,this.state.context,this,H),await this.options.onSettled?.(Q,null,$,this.state.context,H),this.#B({type:"success",data:Q}),Q}catch(Q){try{await this.#H.config.onError?.(Q,$,this.state.context,this,H)}catch(X){Promise.reject(X)}try{await this.options.onError?.(Q,$,this.state.context,H)}catch(X){Promise.reject(X)}try{await this.#H.config.onSettled?.(void 0,Q,this.state.variables,this.state.context,this,H)}catch(X){Promise.reject(X)}try{await this.options.onSettled?.(void 0,Q,$,this.state.context,H)}catch(X){Promise.reject(X)}throw this.#B({type:"error",error:Q}),Q}finally{this.#H.runNext(this)}}#B($){let Z=(H)=>{switch($.type){case"failed":return{...H,failureCount:$.failureCount,failureReason:$.error};case"pause":return{...H,isPaused:!0};case"continue":return{...H,isPaused:!1};case"pending":return{...H,context:$.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:$.isPaused,status:"pending",variables:$.variables,submittedAt:Date.now()};case"success":return{...H,data:$.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...H,data:void 0,error:$.error,failureCount:H.failureCount+1,failureReason:$.error,isPaused:!1,status:"error"}}};this.state=Z(this.state),u1.batch(()=>{this.#Z.forEach((H)=>{H.onMutationUpdate($)}),this.#H.notify({mutation:this,type:"updated",action:$})})}};function iY(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Oq=class extends m4{constructor($={}){super();this.config=$,this.#$=new Set,this.#Z=new Map,this.#H=0}#$;#Z;#H;build($,Z,H){let B=new _q({client:$,mutationCache:this,mutationId:++this.#H,options:$.defaultMutationOptions(Z),state:H});return this.add(B),B}add($){this.#$.add($);let Z=XQ($);if(typeof Z==="string"){let H=this.#Z.get(Z);if(H)H.push($);else this.#Z.set(Z,[$])}this.notify({type:"added",mutation:$})}remove($){if(this.#$.delete($)){let Z=XQ($);if(typeof Z==="string"){let H=this.#Z.get(Z);if(H){if(H.length>1){let B=H.indexOf($);if(B!==-1)H.splice(B,1)}else if(H[0]===$)this.#Z.delete(Z)}}}this.notify({type:"removed",mutation:$})}canRun($){let Z=XQ($);if(typeof Z==="string"){let B=this.#Z.get(Z)?.find((J)=>J.state.status==="pending");return!B||B===$}else return!0}runNext($){let Z=XQ($);if(typeof Z==="string")return this.#Z.get(Z)?.find((B)=>B!==$&&B.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){u1.batch(()=>{this.#$.forEach(($)=>{this.notify({type:"removed",mutation:$})}),this.#$.clear(),this.#Z.clear()})}getAll(){return Array.from(this.#$)}find($){let Z={exact:!0,...$};return this.getAll().find((H)=>ZQ(Z,H))}findAll($={}){return this.getAll().filter((Z)=>ZQ($,Z))}notify($){u1.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}resumePausedMutations(){let $=this.getAll().filter((Z)=>Z.state.isPaused);return u1.batch(()=>Promise.all($.map((Z)=>Z.continue().catch(b5))))}};function XQ($){return $.options.scope?.id}var rY=class extends m4{#$;#Z=void 0;#H;#J;constructor($,Z){super();this.#$=$,this.setOptions(Z),this.bindMethods(),this.#B()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions($){let Z=this.options;if(this.options=this.#$.defaultMutationOptions($),!g7(this.options,Z))this.#$.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#H,observer:this});if(Z?.mutationKey&&this.options.mutationKey&&b8(Z.mutationKey)!==b8(this.options.mutationKey))this.reset();else if(this.#H?.state.status==="pending")this.#H.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners())this.#H?.removeObserver(this)}onMutationUpdate($){this.#B(),this.#Q($)}getCurrentResult(){return this.#Z}reset(){this.#H?.removeObserver(this),this.#H=void 0,this.#B(),this.#Q()}mutate($,Z){return this.#J=Z,this.#H?.removeObserver(this),this.#H=this.#$.getMutationCache().build(this.#$,this.options),this.#H.addObserver(this),this.#H.execute($)}#B(){let $=this.#H?.state??iY();this.#Z={...$,isPending:$.status==="pending",isSuccess:$.status==="success",isError:$.status==="error",isIdle:$.status==="idle",mutate:this.mutate,reset:this.reset}}#Q($){u1.batch(()=>{if(this.#J&&this.hasListeners()){let Z=this.#Z.variables,H=this.#Z.context,B={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};if($?.type==="success"){try{this.#J.onSuccess?.($.data,Z,H,B)}catch(J){Promise.reject(J)}try{this.#J.onSettled?.($.data,null,Z,H,B)}catch(J){Promise.reject(J)}}else if($?.type==="error"){try{this.#J.onError?.($.error,Z,H,B)}catch(J){Promise.reject(J)}try{this.#J.onSettled?.(void 0,$.error,Z,H,B)}catch(J){Promise.reject(J)}}}this.listeners.forEach((Z)=>{Z(this.#Z)})})}};var jq=class extends m4{constructor($={}){super();this.config=$,this.#$=new Map}#$;build($,Z,H){let B=Z.queryKey,J=Z.queryHash??QH(B,Z),Q=this.get(J);if(!Q)Q=new Dq({client:$,queryKey:B,queryHash:J,options:$.defaultQueryOptions(Z),state:H,defaultOptions:$.getQueryDefaults(B)}),this.add(Q);return Q}add($){if(!this.#$.has($.queryHash))this.#$.set($.queryHash,$),this.notify({type:"added",query:$})}remove($){let Z=this.#$.get($.queryHash);if(Z){if($.destroy(),Z===$)this.#$.delete($.queryHash);this.notify({type:"removed",query:$})}}clear(){u1.batch(()=>{this.getAll().forEach(($)=>{this.remove($)})})}get($){return this.#$.get($)}getAll(){return[...this.#$.values()]}find($){let Z={exact:!0,...$};return this.getAll().find((H)=>$Q(Z,H))}findAll($={}){let Z=this.getAll();return Object.keys($).length>0?Z.filter((H)=>$Q($,H)):Z}notify($){u1.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}onFocus(){u1.batch(()=>{this.getAll().forEach(($)=>{$.onFocus()})})}onOnline(){u1.batch(()=>{this.getAll().forEach(($)=>{$.onOnline()})})}};var aY=class{#$;#Z;#H;#J;#B;#Q;#X;#z;constructor($={}){this.#$=$.queryCache||new jq,this.#Z=$.mutationCache||new Oq,this.#H=$.defaultOptions||{},this.#J=new Map,this.#B=new Map,this.#Q=0}mount(){if(this.#Q++,this.#Q!==1)return;this.#X=v7.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onFocus()}),this.#z=p7.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onOnline()})}unmount(){if(this.#Q--,this.#Q!==0)return;this.#X?.(),this.#X=void 0,this.#z?.(),this.#z=void 0}isFetching($){return this.#$.findAll({...$,fetchStatus:"fetching"}).length}isMutating($){return this.#Z.findAll({...$,status:"pending"}).length}getQueryData($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state.data}ensureQueryData($){let Z=this.defaultQueryOptions($),H=this.#$.build(this,Z),B=H.state.data;if(B===void 0)return this.fetchQuery($);if($.revalidateIfStale&&H.isStaleByTime(G8(Z.staleTime,H)))this.prefetchQuery(Z);return Promise.resolve(B)}getQueriesData($){return this.#$.findAll($).map(({queryKey:Z,state:H})=>{let B=H.data;return[Z,B]})}setQueryData($,Z,H){let B=this.defaultQueryOptions({queryKey:$}),Q=this.#$.get(B.queryHash)?.state.data,X=Uq(Z,Q);if(X===void 0)return;return this.#$.build(this,B).setData(X,{...H,manual:!0})}setQueriesData($,Z,H){return u1.batch(()=>this.#$.findAll($).map(({queryKey:B})=>[B,this.setQueryData(B,Z,H)]))}getQueryState($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state}removeQueries($){let Z=this.#$;u1.batch(()=>{Z.findAll($).forEach((H)=>{Z.remove(H)})})}resetQueries($,Z){let H=this.#$;return u1.batch(()=>{return H.findAll($).forEach((B)=>{B.reset()}),this.refetchQueries({type:"active",...$},Z)})}cancelQueries($,Z={}){let H={revert:!0,...Z},B=u1.batch(()=>this.#$.findAll($).map((J)=>J.cancel(H)));return Promise.all(B).then(b5).catch(b5)}invalidateQueries($,Z={}){return u1.batch(()=>{if(this.#$.findAll($).forEach((H)=>{H.invalidate()}),$?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...$,type:$?.refetchType??$?.type??"active"},Z)})}refetchQueries($,Z={}){let H={...Z,cancelRefetch:Z.cancelRefetch??!0},B=u1.batch(()=>this.#$.findAll($).filter((J)=>!J.isDisabled()&&!J.isStatic()).map((J)=>{let Q=J.fetch(void 0,H);if(!H.throwOnError)Q=Q.catch(b5);return J.state.fetchStatus==="paused"?Promise.resolve():Q}));return Promise.all(B).then(b5)}fetchQuery($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let H=this.#$.build(this,Z);return H.isStaleByTime(G8(Z.staleTime,H))?H.fetch(Z):Promise.resolve(H.state.data)}prefetchQuery($){return this.fetchQuery($).then(b5).catch(b5)}fetchInfiniteQuery($){return $.behavior=lY($.pages),this.fetchQuery($)}prefetchInfiniteQuery($){return this.fetchInfiniteQuery($).then(b5).catch(b5)}ensureInfiniteQueryData($){return $.behavior=lY($.pages),this.ensureQueryData($)}resumePausedMutations(){if(p7.isOnline())return this.#Z.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#$}getMutationCache(){return this.#Z}getDefaultOptions(){return this.#H}setDefaultOptions($){this.#H=$}setQueryDefaults($,Z){this.#J.set(b8($),{queryKey:$,defaultOptions:Z})}getQueryDefaults($){let Z=[...this.#J.values()],H={};return Z.forEach((B)=>{if(W6($,B.queryKey))Object.assign(H,B.defaultOptions)}),H}setMutationDefaults($,Z){this.#B.set(b8($),{mutationKey:$,defaultOptions:Z})}getMutationDefaults($){let Z=[...this.#B.values()],H={};return Z.forEach((B)=>{if(W6($,B.mutationKey))Object.assign(H,B.defaultOptions)}),H}defaultQueryOptions($){if($._defaulted)return $;let Z={...this.#H.queries,...this.getQueryDefaults($.queryKey),...$,_defaulted:!0};if(!Z.queryHash)Z.queryHash=QH(Z.queryKey,Z);if(Z.refetchOnReconnect===void 0)Z.refetchOnReconnect=Z.networkMode!=="always";if(Z.throwOnError===void 0)Z.throwOnError=!!Z.suspense;if(!Z.networkMode&&Z.persister)Z.networkMode="offlineFirst";if(Z.queryFn===f7)Z.enabled=!1;return Z}defaultMutationOptions($){if($?._defaulted)return $;return{...this.#H.mutations,...$?.mutationKey&&this.getMutationDefaults($.mutationKey),...$,_defaulted:!0}}clear(){this.#$.clear(),this.#Z.clear()}};var o9=O(g(),1);var u7=O(g(),1),Tq=O(c(),1),nY=u7.createContext(void 0),$1=($)=>{let Z=u7.useContext(nY);if($)return $;if(!Z)throw Error("No QueryClient set, use QueryClientProvider to set one");return Z},oY=({client:$,children:Z})=>{return u7.useEffect(()=>{return $.mount(),()=>{$.unmount()}},[$]),Tq.jsx(nY.Provider,{value:$,children:Z})};var FH=O(g(),1),xc=O(c(),1);function vc(){let $=!1;return{clearReset:()=>{$=!1},reset:()=>{$=!0},isReset:()=>{return $}}}var gc=FH.createContext(vc()),Cq=()=>FH.useContext(gc);var wq=O(g(),1);var Eq=($,Z,H)=>{let B=H?.state.error&&typeof $.throwOnError==="function"?m7($.throwOnError,[H.state.error,H]):$.throwOnError;if($.suspense||$.experimental_prefetchInRender||B){if(!Z.isReset())$.retryOnMount=!1}},Sq=($)=>{wq.useEffect(()=>{$.clearReset()},[$])},Iq=({result:$,errorResetBoundary:Z,throwOnError:H,query:B,suspense:J})=>{return $.isError&&!Z.isReset()&&!$.isFetching&&B&&(J&&$.data===void 0||m7(H,[$.error,B]))};var zQ=O(g(),1),Rq=zQ.createContext(!1),kq=()=>zQ.useContext(Rq),bX0=Rq.Provider;var bq=($)=>{if($.suspense){let H=(J)=>J==="static"?J:Math.max(J??1000,1000),B=$.staleTime;if($.staleTime=typeof B==="function"?(...J)=>H(B(...J)):H(B),typeof $.gcTime==="number")$.gcTime=Math.max($.gcTime,1000)}},yq=($,Z)=>$.isLoading&&$.isFetching&&!Z,hq=($,Z)=>$?.suspense&&Z.isPending,sY=($,Z,H)=>Z.fetchOptimistic($).catch(()=>{H.clearReset()});function xq($,Z,H){let B=kq(),J=Cq(),Q=$1(H),X=Q.defaultQueryOptions($);Q.getDefaultOptions().queries?._experimental_beforeQuery?.(X);let z=Q.getQueryCache().get(X.queryHash);X._optimisticResults=B?"isRestoring":"optimistic",bq(X),Eq(X,J,z),Sq(J);let G=!Q.getQueryCache().get(X.queryHash),[F]=o9.useState(()=>new Z(Q,X)),U=F.getOptimisticResult(X),Y=!B&&$.subscribed!==!1;if(o9.useSyncExternalStore(o9.useCallback((K)=>{let W=Y?F.subscribe(u1.batchCalls(K)):b5;return F.updateResult(),W},[F,Y]),()=>F.getCurrentResult(),()=>F.getCurrentResult()),o9.useEffect(()=>{F.setOptions(X)},[X,F]),hq(X,U))throw sY(X,F,J);if(Iq({result:U,errorResetBoundary:J,throwOnError:X.throwOnError,query:z,suspense:X.suspense}))throw U.error;if(Q.getDefaultOptions().queries?._experimental_afterQuery?.(X,U),X.experimental_prefetchInRender&&!y8.isServer()&&yq(U,B))(G?sY(X,F,J):z?.promise)?.catch(b5).finally(()=>{F.updateResult()});return!X.notifyOnChangeProps?F.trackResult(U):U}function o1($,Z){return xq($,cY,Z)}var w9=O(g(),1);function tY($,Z){let H=$1(Z);return gq({filters:{...$,status:"pending"}},H).length}function vq($,Z){return $.findAll(Z.filters).map((H)=>Z.select?Z.select(H):H.state)}function gq($={},Z){let H=$1(Z).getMutationCache(),B=w9.useRef($),J=w9.useRef(null);if(J.current===null)J.current=vq(H,$);return w9.useEffect(()=>{B.current=$}),w9.useSyncExternalStore(w9.useCallback((Q)=>H.subscribe(()=>{let X=XH(J.current,vq(H,B.current));if(J.current!==X)J.current=X,u1.schedule(Q)}),[H]),()=>J.current,()=>J.current)}var E9=O(g(),1);function s1($,Z){let H=$1(Z),[B]=E9.useState(()=>new rY(H,$));E9.useEffect(()=>{B.setOptions($)},[B,$]);let J=E9.useSyncExternalStore(E9.useCallback((X)=>B.subscribe(u1.batchCalls(X)),[B]),()=>B.getCurrentResult(),()=>B.getCurrentResult()),Q=E9.useCallback((X,z)=>{B.mutate(X,z).catch(b5)},[B]);if(J.error&&m7(B.options.throwOnError,[J.error]))throw J.error;return{...J,mutate:Q,mutateAsync:J.mutate}}var _c=O(aJ0(),1);function fq($,Z){if($ instanceof RegExp)return{keys:!1,pattern:$};var H,B,J,Q,X=[],z="",G=$.split("/");G[0]||G.shift();while(J=G.shift())if(H=J[0],H==="*")X.push(H),z+=J[1]==="?"?"(?:/(.*))?":"/(.*)";else if(H===":"){if(B=J.indexOf("?",1),Q=J.indexOf(".",1),X.push(J.substring(1,~B?B:~Q?Q:J.length)),z+=!!~B&&!~Q?"(?:/([^/]+?))?":"/([^/]+?)",~Q)z+=(~B?"?":"")+"\\"+J.substring(Q)}else z+="/"+J;return{keys:X,pattern:new RegExp("^"+z+(Z?"(?=$|/)":"/?$"),"i")}}var N6=O(g(),1),w1=O(g(),1);var FQ=O(GQ(),1);var oc=N6.useInsertionEffect,sc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$K=sc?N6.useLayoutEffect:N6.useEffect,tc=oc||$K,UQ=($)=>{let Z=N6.useRef([$,(...H)=>Z[0](...H)]).current;return tc(()=>{Z[0]=$}),Z[1]};var ec="popstate",ZK="pushState",HK="replaceState",$d="hashchange",mq=[ec,ZK,HK,$d],Zd=($)=>{for(let Z of mq)addEventListener(Z,$);return()=>{for(let Z of mq)removeEventListener(Z,$)}},BK=($,Z)=>FQ.useSyncExternalStore(Zd,$,Z),pq=()=>location.search,dq=({ssrSearch:$}={})=>BK(pq,$!=null?()=>$:pq),uq=()=>location.pathname,Hd=({ssrPath:$}={})=>BK(uq,$!=null?()=>$:uq),Bd=()=>history.state,lq=()=>BK(Bd,()=>null),Jd=($,{replace:Z=!1,state:H=null}={})=>history[Z?HK:ZK](H,"",$),iq=($={})=>[Hd($),Jd],cq=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[cq]>"u"){for(let $ of[ZK,HK]){let Z=history[$];history[$]=function(){let H=Z.apply(this,arguments),B=new Event($);return B.arguments=arguments,dispatchEvent(B),H}}Object.defineProperty(window,cq,{value:!0})}var Qd=($,Z)=>!Z.toLowerCase().indexOf($.toLowerCase())?Z.slice($.length)||"/":"~"+Z,aq=($="")=>$==="/"?"":$,nq=($,Z)=>$[0]==="~"?$.slice(1):aq(Z)+$,oq=($="",Z)=>Qd(rq(aq($)),rq(Z));var rq=($)=>{try{return decodeURI($)}catch(Z){return $}};var tq={hook:iq,searchHook:dq,parser:fq,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:($)=>$,aroundNav:($,Z,H)=>$(Z,H)},eq=w1.createContext(tq),c7=()=>w1.useContext(eq),$M={},ZM=w1.createContext($M),JK=()=>w1.useContext(ZM),UH=($)=>{let[Z,H]=$.hook($);return[oq($.base,Z),UQ((B,J)=>$.aroundNav(H,nq(B,$.base),J))]},p4=()=>UH(c7());var HM=($,Z,H,B)=>{let{pattern:J,keys:Q}=Z instanceof RegExp?{keys:!1,pattern:Z}:$(Z||"*",B),X=J.exec(H)||[],[z,...G]=X;return z!==void 0?[!0,(()=>{let F=Q!==!1?Object.fromEntries(Q.map((Y,K)=>[Y,G[K]])):X.groups,U={...G};return F&&Object.assign(U,F),U})(),...B?[z]:[]]:[!1,null]};var QK=({children:$,...Z})=>{let H=c7(),B=Z.hook?tq:H,J=B,[Q,X=Z.ssrSearch??""]=Z.ssrPath?.split("?")??[];if(Q)Z.ssrSearch=X,Z.ssrPath=Q;Z.hrefs=Z.hrefs??Z.hook?.hrefs,Z.searchHook=Z.searchHook??Z.hook?.searchHook;let z=w1.useRef({}),G=z.current,F=G;for(let U in B){let Y=U==="base"?B[U]+(Z[U]??""):Z[U]??B[U];if(G===F&&Y!==F[U])z.current=F={...F};if(F[U]=Y,Y!==B[U]||Y!==J[U])J=F}return w1.createElement(eq.Provider,{value:J,children:$})},sq=({children:$,component:Z},H)=>{if(Z)return w1.createElement(Z,{params:H});return typeof $==="function"?$(H):$},Xd=($)=>{let Z=w1.useRef($M),H=Z.current;return Z.current=Object.keys($).length!==Object.keys(H).length||Object.entries($).some(([B,J])=>J!==H[B])?$:H};var YQ=({path:$,nest:Z,match:H,...B})=>{let J=c7(),[Q]=UH(J),[X,z,G]=H??HM(J.parser,$,Q,Z),F=Xd({...JK(),...z});if(!X)return null;let U=G?w1.createElement(QK,{base:G},sq(B,F)):sq(B,F);return w1.createElement(ZM.Provider,{value:F,children:U})},YH=w1.forwardRef(($,Z)=>{let H=c7(),[B,J]=UH(H),{to:Q="",href:X=Q,onClick:z,asChild:G,children:F,className:U,replace:Y,state:K,transition:W,...N}=$,L=UQ((A)=>{if(A.ctrlKey||A.metaKey||A.altKey||A.shiftKey||A.button!==0)return;if(z?.(A),!A.defaultPrevented)A.preventDefault(),J(X,$)}),V=H.hrefs(X[0]==="~"?X.slice(1):H.base+X,H);return G&&w1.isValidElement(F)?w1.cloneElement(F,{onClick:L,href:V}):w1.createElement("a",{...N,onClick:L,href:V,className:U?.call?U(B===X):U,children:F,ref:Z})}),BM=($)=>Array.isArray($)?$.flatMap((Z)=>BM(Z&&Z.type===w1.Fragment?Z.props.children:Z)):[$],JM=({children:$,location:Z})=>{let H=c7(),[B]=UH(H);for(let J of BM($)){let Q=0;if(w1.isValidElement(J)&&(Q=HM(H.parser,J.props.path,Z||B,J.props.nest))[0])return w1.cloneElement(J,{match:Q})}return null},QM=($)=>{let{to:Z,href:H=Z}=$,B=c7(),[,J]=UH(B),Q=UQ(()=>J(Z||H,$)),{ssrContext:X}=B;if($K(()=>{Q()},[]),X)X.redirectTo=Z;return null};var b2={};O4(b2,{useToastManager:()=>eP,createToastManager:()=>$_,Viewport:()=>nM,Title:()=>FP,Root:()=>ZP,Provider:()=>dM,Positioner:()=>oP,Portal:()=>xP,Description:()=>zP,Content:()=>HP,Close:()=>UP,Arrow:()=>tP,Action:()=>KP});var uM=O(g(),1);var XM=O(g(),1),zd=[];function E2($){XM.useEffect($,zd)}var KQ=O(g(),1),KH=KQ.createContext(void 0);function s9(){let $=KQ.useContext(KH);if(!$)throw Error(E0(73));return $}var NQ=Symbol("NOT_FOUND");function Gd($,Z=`expected a function, instead received ${typeof $}`){if(typeof $!=="function")throw TypeError(Z)}function Fd($,Z=`expected an object, instead received ${typeof $}`){if(typeof $!=="object")throw TypeError(Z)}function Ud($,Z="expected all items to be functions, instead received the following types: "){if(!$.every((H)=>typeof H==="function")){let H=$.map((B)=>typeof B==="function"?`function ${B.name||"unnamed"}()`:typeof B).join(", ");throw TypeError(`${Z}[${H}]`)}}var zM=($)=>{return Array.isArray($)?$:[$]};function Yd($){let Z=Array.isArray($[0])?$[0]:$;return Ud(Z,"createSelector expects all input-selectors to be functions, but received the following types: "),Z}function Kd($,Z){let H=[],{length:B}=$;for(let J=0;J<B;J++)H.push($[J].apply(null,Z));return H}var GM=0,Wd=null,UM=class{revision=GM;_value;_lastValue;_isEqual=XK;constructor($,Z=XK){this._value=this._lastValue=$,this._isEqual=Z}get value(){return Wd?.add(this),this._value}set value($){if(this.value===$)return;this._value=$,this.revision=++GM}};function XK($,Z){return $===Z}function zK($){if(!($ instanceof UM))console.warn("Not a valid cell! ",$);return $.value}function Nd($,Z=XK){return new UM($,Z)}var Ld=($,Z)=>!1;function LQ(){return Nd(null,Ld)}var YM=($)=>{let Z=$.collectionTag;if(Z===null)Z=$.collectionTag=LQ();zK(Z)};var tz0=Symbol(),KM=0,Ad=Object.getPrototypeOf({}),Vd=class{constructor($){this.value=$,this.value=$,this.tag.value=$}proxy=new Proxy(this,WH);tag=LQ();tags={};children={};collectionTag=null;id=KM++},WH={get($,Z){function H(){let{value:J}=$,Q=Reflect.get(J,Z);if(typeof Z==="symbol")return Q;if(Z in Ad)return Q;if(typeof Q==="object"&&Q!==null){let X=$.children[Z];if(X===void 0)X=$.children[Z]=Md(Q);if(X.tag)zK(X.tag);return X.proxy}else{let X=$.tags[Z];if(X===void 0)X=$.tags[Z]=LQ(),X.value=Q;return zK(X),Q}}return H()},ownKeys($){return YM($),Reflect.ownKeys($.value)},getOwnPropertyDescriptor($,Z){return Reflect.getOwnPropertyDescriptor($.value,Z)},has($,Z){return Reflect.has($.value,Z)}},Dd=class{constructor($){this.value=$,this.value=$,this.tag.value=$}proxy=new Proxy([this],qd);tag=LQ();tags={};children={};collectionTag=null;id=KM++},qd={get([$],Z){if(Z==="length")YM($);return WH.get($,Z)},ownKeys([$]){return WH.ownKeys($)},getOwnPropertyDescriptor([$],Z){return WH.getOwnPropertyDescriptor($,Z)},has([$],Z){return WH.has($,Z)}};function Md($){if(Array.isArray($))return new Dd($);return new Vd($)}function Pd($){let Z;return{get(H){if(Z&&$(Z.key,H))return Z.value;return NQ},put(H,B){Z={key:H,value:B}},getEntries(){return Z?[Z]:[]},clear(){Z=void 0}}}function _d($,Z){let H=[];function B(z){let G=H.findIndex((F)=>Z(z,F.key));if(G>-1){let F=H[G];if(G>0)H.splice(G,1),H.unshift(F);return F.value}return NQ}function J(z,G){if(B(z)===NQ){if(H.unshift({key:z,value:G}),H.length>$)H.pop()}}function Q(){return H}function X(){H=[]}return{get:B,put:J,getEntries:Q,clear:X}}var Od=($,Z)=>$===Z;function jd($){return function(H,B){if(H===null||B===null||H.length!==B.length)return!1;let{length:J}=H;for(let Q=0;Q<J;Q++)if(!$(H[Q],B[Q]))return!1;return!0}}function WM($,Z){let H=typeof Z==="object"?Z:{equalityCheck:Z},{equalityCheck:B=Od,maxSize:J=1,resultEqualityCheck:Q}=H,X=jd(B),z=0,G=J<=1?Pd(X):_d(J,X);function F(){let U=G.get(arguments);if(U===NQ){if(U=$.apply(null,arguments),z++,Q){let K=G.getEntries().find((W)=>Q(W.value,U));if(K)U=K.value,z!==0&&z--}G.put(arguments,U)}return U}return F.clearCache=()=>{G.clear(),F.resetResultsCount()},F.resultsCount=()=>z,F.resetResultsCount=()=>{z=0},F}var Td=class{constructor($){this.value=$}deref(){return this.value}},Cd=typeof WeakRef<"u"?WeakRef:Td,wd=0,FM=1;function WQ(){return{s:wd,v:void 0,o:null,p:null}}function NM($,Z={}){let H=WQ(),{resultEqualityCheck:B}=Z,J,Q=0;function X(){let z=H,{length:G}=arguments;for(let Y=0,K=G;Y<K;Y++){let W=arguments[Y];if(typeof W==="function"||typeof W==="object"&&W!==null){let N=z.o;if(N===null)z.o=N=new WeakMap;let L=N.get(W);if(L===void 0)z=WQ(),N.set(W,z);else z=L}else{let N=z.p;if(N===null)z.p=N=new Map;let L=N.get(W);if(L===void 0)z=WQ(),N.set(W,z);else z=L}}let F=z,U;if(z.s===FM)U=z.v;else if(U=$.apply(null,arguments),Q++,B){let Y=J?.deref?.()??J;if(Y!=null&&B(Y,U))U=Y,Q!==0&&Q--;J=typeof U==="object"&&U!==null||typeof U==="function"?new Cd(U):U}return F.s=FM,F.v=U,U}return X.clearCache=()=>{H=WQ(),X.resetResultsCount()},X.resultsCount=()=>Q,X.resetResultsCount=()=>{Q=0},X}function GK($,...Z){let H=typeof $==="function"?{memoize:$,memoizeOptions:Z}:$,B=(...J)=>{let Q=0,X=0,z,G={},F=J.pop();if(typeof F==="object")G=F,F=J.pop();Gd(F,`createSelector expects an output function after the inputs, but received: [${typeof F}]`);let U={...H,...G},{memoize:Y,memoizeOptions:K=[],argsMemoize:W=NM,argsMemoizeOptions:N=[],devModeChecks:L={}}=U,V=zM(K),A=zM(N),D=Yd(J),q=Y(function(){return Q++,F.apply(null,arguments)},...V),_=!0,M=W(function(){X++;let T=Kd(D,arguments);return z=q.apply(null,T),z},...A);return Object.assign(M,{resultFunc:F,memoizedResultFunc:q,dependencies:D,dependencyRecomputations:()=>X,resetDependencyRecomputations:()=>{X=0},lastResult:()=>z,recomputations:()=>Q,resetRecomputations:()=>{Q=0},memoize:Y,argsMemoize:W})};return Object.assign(B,{withTypes:()=>B}),B}var Ed=GK(NM),Sd=Object.assign(($,Z=Ed)=>{Fd($,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof $}`);let H=Object.keys($),B=H.map((Q)=>$[Q]);return Z(B,(...Q)=>{return Q.reduce((X,z,G)=>{return X[H[G]]=z,X},{})})},{withTypes:()=>Sd});var Id=GK({memoize:WM,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),S0=($,Z,H,B,J,Q,...X)=>{if(X.length>0)throw Error(E0(1));let z;if($&&Z&&H&&B&&J&&Q)z=(G,F,U,Y)=>{let K=$(G,F,U,Y),W=Z(G,F,U,Y),N=H(G,F,U,Y),L=B(G,F,U,Y),V=J(G,F,U,Y);return Q(K,W,N,L,V,F,U,Y)};else if($&&Z&&H&&B&&J)z=(G,F,U,Y)=>{let K=$(G,F,U,Y),W=Z(G,F,U,Y),N=H(G,F,U,Y),L=B(G,F,U,Y);return J(K,W,N,L,F,U,Y)};else if($&&Z&&H&&B)z=(G,F,U,Y)=>{let K=$(G,F,U,Y),W=Z(G,F,U,Y),N=H(G,F,U,Y);return B(K,W,N,F,U,Y)};else if($&&Z&&H)z=(G,F,U,Y)=>{let K=$(G,F,U,Y),W=Z(G,F,U,Y);return H(K,W,F,U,Y)};else if($&&Z)z=(G,F,U,Y)=>{let K=$(G,F,U,Y);return Z(K,F,U,Y)};else if($)z=$;else throw Error("Missing arguments");return z},LM=(...$)=>{let Z=new WeakMap,H=1,B=$[$.length-1],J=$.length-1||1,Q=B.length-J;if(Q>3)throw Error(E0(2));return(z,G,F,U)=>{let Y=z.__cacheKey__;if(!Y)Y={id:H},z.__cacheKey__=Y,H+=1;let K=Z.get(Y);if(!K){let W=$,N=[void 0,void 0,void 0];switch(Q){case 0:break;case 1:{W=[...$.slice(0,-1),()=>N[0],B];break}case 2:{W=[...$.slice(0,-1),()=>N[0],()=>N[1],B];break}case 3:{W=[...$.slice(0,-1),()=>N[0],()=>N[1],()=>N[2],B];break}default:throw Error(E0(2))}K=Id(...W),K.selectorArgs=N,Z.set(Y,K)}switch(K.selectorArgs[0]=G,K.selectorArgs[1]=F,K.selectorArgs[2]=U,Q){case 0:return K(z);case 1:return K(z,G);case 2:return K(z,G,F);case 3:return K(z,G,F,U);default:throw Error("unreachable")}}};var qM=O(g(),1),KK=O(GQ(),1);var t9=O(g(),1),Rd=GQ();function kd($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var bd=typeof Object.is==="function"?Object.is:kd,yd=Rd.useSyncExternalStore,hd=t9.useRef,xd=t9.useEffect,vd=t9.useMemo,gd=t9.useDebugValue;var FK=function($,Z,H,B,J){var Q=hd(null);if(Q.current===null){var X={hasValue:!1,value:null};Q.current=X}else X=Q.current;Q=vd(function(){function G(W){if(!F){if(F=!0,U=W,W=B(W),J!==void 0&&X.hasValue){var N=X.value;if(J(N,W))return Y=N}return Y=W}if(N=Y,bd(U,W))return N;var L=B(W);if(J!==void 0&&J(N,L))return U=W,N;return U=W,Y=L}var F=!1,U,Y,K=H===void 0?null:H;return[function(){return G(Z())},K===null?void 0:function(){return G(K())}]},[Z,H,B,J]);var z=yd($,Q[0],Q[1]);return xd(function(){X.hasValue=!0,X.value=z},[z]),gd(z),z};var AM=O(g(),1);var UK=[],YK=void 0;function VM(){return YK}function DM($){UK.push($)}function NH($){let Z=(H,B)=>{let J=k1(fd).current,Q;try{YK=J;for(let X of UK)X.before(J);Q=$(H,B);for(let X of UK)X.after(J);J.didInitialize=!0}finally{YK=void 0}return Q};return Z.displayName=$.displayName||$.name,Z}function AQ($){return AM.forwardRef(NH($))}function fd(){return{didInitialize:!1}}var md=VQ(19),pd=md?cd:dd;function DQ($,Z,H,B,J){return pd($,Z,H,B,J)}function ud($,Z,H,B,J){let Q=qM.useCallback(()=>Z($.getSnapshot(),H,B,J),[$,Z,H,B,J]);return KK.useSyncExternalStore($.subscribe,Q,Q)}DM({before($){if($.syncIndex=0,!$.didInitialize)$.syncTick=1,$.syncHooks=[],$.didChangeStore=!0,$.getSnapshot=()=>{let Z=!1;for(let H=0;H<$.syncHooks.length;H+=1){let B=$.syncHooks[H],J=B.selector(B.store.state,B.a1,B.a2,B.a3);if(B.didChange||!Object.is(B.value,J))Z=!0,B.value=J,B.didChange=!1}if(Z)$.syncTick+=1;return $.syncTick}},after($){if($.syncHooks.length>0){if($.didChangeStore)$.didChangeStore=!1,$.subscribe=(Z)=>{let H=new Set;for(let J of $.syncHooks)H.add(J.store);let B=[];for(let J of H)B.push(J.subscribe(Z));return()=>{for(let J of B)J()}};KK.useSyncExternalStore($.subscribe,$.getSnapshot,$.getSnapshot)}}});function cd($,Z,H,B,J){let Q=VM();if(!Q)return ud($,Z,H,B,J);let X=Q.syncIndex;Q.syncIndex+=1;let z;if(!Q.didInitialize)z={store:$,selector:Z,a1:H,a2:B,a3:J,value:Z($.getSnapshot(),H,B,J),didChange:!1},Q.syncHooks.push(z);else if(z=Q.syncHooks[X],z.store!==$||z.selector!==Z||!Object.is(z.a1,H)||!Object.is(z.a2,B)||!Object.is(z.a3,J)){if(z.store!==$)Q.didChangeStore=!0;z.store=$,z.selector=Z,z.a1=H,z.a2=B,z.a3=J,z.didChange=!0}return z.value}function dd($,Z,H,B,J){return FK($.subscribe,$.getSnapshot,$.getSnapshot,(Q)=>Z(Q,H,B,J))}class WK{constructor($){this.state=$,this.listeners=new Set,this.updateTick=0}subscribe=($)=>{return this.listeners.add($),()=>{this.listeners.delete($)}};getSnapshot=()=>{return this.state};setState($){if(this.state===$)return;this.state=$,this.updateTick+=1;let Z=this.updateTick;for(let H of this.listeners){if(Z!==this.updateTick)return;H($)}}update($){for(let Z in $)if(!Object.is(this.state[Z],$[Z])){this.setState({...this.state,...$});return}}set($,Z){if(!Object.is(this.state[$],Z))this.setState({...this.state,[$]:Z})}notifyAll(){let $={...this.state};this.setState($)}use($,Z,H,B){return DQ(this,$,Z,H,B)}}var L6=O(g(),1);class r2 extends WK{constructor($,Z={},H){super($);this.context=Z,this.selectors=H}useSyncedValue($,Z){L6.useDebugValue($),U0(()=>{if(this.state[$]!==Z)this.set($,Z)},[$,Z])}useSyncedValueWithCleanup($,Z){let H=this;U0(()=>{if(H.state[$]!==Z)H.set($,Z);return()=>{H.set($,void 0)}},[H,$,Z])}useSyncedValues($){let Z=this,H=Object.values($);U0(()=>{Z.update($)},[Z,...H])}useControlledProp($,Z){L6.useDebugValue($);let H=Z!==void 0;U0(()=>{if(H&&!Object.is(this.state[$],Z))super.setState({...this.state,[$]:Z})},[$,Z,H])}select($,Z,H,B){let J=this.selectors[$];return J(this.state,Z,H,B)}useState($,Z,H,B){return L6.useDebugValue($),DQ(this,this.selectors[$],Z,H,B)}useContextCallback($,Z){L6.useDebugValue($);let H=Y0(Z??l1);this.context[$]=H}useStateSetter($){let Z=L6.useRef(void 0);if(Z.current===void 0)Z.current=(H)=>{this.set($,H)};return Z.current}observe($,Z){let H;if(typeof $==="function")H=$;else H=this.selectors[$];let B=H(this.state);return Z(B,B,this),this.subscribe((J)=>{let Q=H(J);if(!Object.is(B,Q)){let X=B;B=Q,Z(Q,X,this)}})}}var qQ=null,jG0=globalThis.requestAnimationFrame;class MM{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=($)=>{this.isScheduled=!1;let Z=this.callbacks,H=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,H>0)for(let B=0;B<Z.length;B+=1)Z[B]?.($)};request($){let Z=this.nextId;this.nextId+=1,this.callbacks.push($),this.callbacksCount+=1;let H=!1;if(!this.isScheduled||H)requestAnimationFrame(this.tick),this.isScheduled=!0;return Z}cancel($){let Z=$-this.startId;if(Z<0||Z>=this.callbacks.length)return;this.callbacks[Z]=null,this.callbacksCount-=1}}var MQ=new MM;class N5{static create(){return new N5}static request($){return MQ.request($)}static cancel($){return MQ.cancel($)}currentId=qQ;request($){this.cancel(),this.currentId=MQ.request(()=>{this.currentId=qQ,$()})}cancel=()=>{if(this.currentId!==qQ)MQ.cancel(this.currentId),this.currentId=qQ};disposeEffect=()=>{return this.cancel}}function G4(){let $=k1(N5.create).current;return E2($.disposeEffect),$}var LH=0;class r5{static create(){return new r5}currentId=LH;start($,Z){this.clear(),this.currentId=setTimeout(()=>{this.currentId=LH,Z()},$)}isStarted(){return this.currentId!==LH}clear=()=>{if(this.currentId!==LH)clearTimeout(this.currentId),this.currentId=LH};disposeEffect=()=>{return this.clear}}function _5(){let $=k1(r5.create).current;return E2($.disposeEffect),$}var PM=0;function PQ($){return PM+=1,`${$}-${Math.random().toString(36).slice(2,6)}-${PM}`}function m0($){return $?.ownerDocument||document}function _Q($,Z){if(typeof $==="string")return{description:$};if(typeof $==="function"){let H=$(Z);return typeof H==="string"?{description:H}:H}return $}var e9=typeof navigator<"u",NK=ld(),_M=rd(),OQ=id(),jQ=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),TQ=NK.platform==="MacIntel"&&NK.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(NK.platform),bG0=e9&&/firefox/i.test(OQ),CQ=e9&&/apple/i.test(navigator.vendor),yG0=e9&&/Edg/i.test(OQ),wQ=e9&&/android/i.test(_M)||/android/i.test(OQ),OM=e9&&_M.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,EQ=OQ.includes("jsdom/");function ld(){if(!e9)return{platform:"",maxTouchPoints:-1};let $=navigator.userAgentData;if($?.platform)return{platform:$.platform,maxTouchPoints:navigator.maxTouchPoints};return{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function id(){if(!e9)return"";let $=navigator.userAgentData;if($&&Array.isArray($.brands))return $.brands.map(({brand:Z,version:H})=>`${Z}/${H}`).join(" ");return navigator.userAgent}function rd(){if(!e9)return"";let $=navigator.userAgentData;if($?.platform)return $.platform;return navigator.platform??""}var AH="data-base-ui-focusable",LK="active",AK="selected",d7="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",h8="ArrowLeft",x8="ArrowRight",VH="ArrowUp",A6="ArrowDown";function Z5($){let Z=$.activeElement;while(Z?.shadowRoot?.activeElement!=null)Z=Z.shadowRoot.activeElement;return Z}function f0($,Z){if(!$||!Z)return!1;let H=Z.getRootNode?.();if($.contains(Z))return!0;if(H&&jM(H)){let B=Z;while(B){if($===B)return!0;B=B.parentNode||B.host}}return!1}function V6($,Z){if(!T1($))return!1;let H=$;if(Z.hasElement(H))return!H.hasAttribute("data-trigger-disabled");for(let[,B]of Z.entries())if(f0(B,H))return!B.hasAttribute("data-trigger-disabled");return!1}function h1($){if("composedPath"in $)return $.composedPath()[0];return $.target}function u4($,Z){if(Z==null)return!1;if("composedPath"in $)return $.composedPath().includes(Z);let H=$;return H.target!=null&&Z.contains(H.target)}function TM($){return $.matches("html,body")}function D6($){return O5($)&&$.matches(d7)}function DH($){if(!$)return!1;return $.getAttribute("role")==="combobox"&&D6($)}function $3($){if(!$||EQ)return!0;try{return $.matches(":focus-visible")}catch(Z){return!0}}function q6($){if(!$)return null;return $.hasAttribute(AH)?$:$.querySelector(`[${AH}]`)||$}function v8($,Z,H=!0){return $.filter((J)=>J.parentId===Z&&(!H||J.context?.open)).flatMap((J)=>[J,...v8($,J.id,H)])}function VK($,Z){let H=[],B=$.find((J)=>J.id===Z)?.parentId;while(B){let J=$.find((Q)=>Q.id===B);if(B=J?.parentId,J)H=H.concat(J)}return H}function a5($){$.preventDefault(),$.stopPropagation()}function CM($){return"nativeEvent"in $}function SQ($){if($.pointerType===""&&$.isTrusted)return!0;if(wQ&&$.pointerType)return $.type==="click"&&$.buttons===1;return $.detail===0&&!$.pointerType}function IQ($){if(EQ)return!1;return!wQ&&$.width===0&&$.height===0||wQ&&$.width===1&&$.height===1&&$.pressure===0&&$.detail===0&&$.pointerType==="mouse"||$.width<1&&$.height<1&&$.pressure===0&&$.detail===0&&$.pointerType==="touch"}function c4($,Z){let H=["mouse","pen"];if(!Z)H.push("",void 0);return H.includes($)}function RQ($){let Z=$.type;return Z==="click"||Z==="mousedown"||Z==="keydown"||Z==="keyup"}function kQ($,Z,H){return Math.floor($/Z)!==H}function l7($,Z){return Z<0||Z>=$.current.length}function bQ($,Z){return P2($,{disabledIndices:Z})}function qK($,Z){return P2($,{decrement:!0,startingIndex:$.current.length,disabledIndices:Z})}function P2($,{startingIndex:Z=-1,decrement:H=!1,disabledIndices:B,amount:J=1}={}){let Q=Z;do Q+=H?-J:J;while(Q>=0&&Q<=$.current.length-1&&i7($,Q,B));return Q}function wM($,{event:Z,orientation:H,loopFocus:B,rtl:J,cols:Q,disabledIndices:X,minIndex:z,maxIndex:G,prevIndex:F,stopEvent:U=!1}){let Y=F,K=[],W={},N=!1;{let A=null,D=-1;$.current.forEach((q,_)=>{if(q==null)return;let M=q.closest('[role="row"]');if(M)N=!0;if(M!==A||D===-1)A=M,D+=1,K[D]=[];K[D].push(_),W[_]=D})}let L=N&&K.length>0&&K.some((A)=>A.length!==Q);function V(A){if(!L||F===-1)return;let D=W[F];if(D==null)return;let q=K[D].indexOf(F),_=A==="up"?D-1:D+1;if(B){if(_<0)_=K.length-1;else if(_>=K.length)_=0}let M=new Set;while(_>=0&&_<K.length&&!M.has(_)){M.add(_);let P=K[_];if(P.length===0){_=A==="up"?_-1:_+1;continue}let T=Math.min(q,P.length-1);for(let R=T;R>=0;R-=1){let y=P[R];if(!i7($,y,X))return y}if(_=A==="up"?_-1:_+1,B){if(_<0)_=K.length-1;else if(_>=K.length)_=0}}return}if(Z.key===VH){let A=V("up");if(A!==void 0){if(U)a5(Z);Y=A}else{if(U)a5(Z);if(F===-1)Y=G;else if(Y=P2($,{startingIndex:Y,amount:Q,decrement:!0,disabledIndices:X}),B&&(F-Q<z||Y<0)){let D=F%Q,q=G%Q,_=G-(q-D);if(q===D)Y=G;else Y=q>D?_:_-Q}if(l7($,Y))Y=F}}if(Z.key===A6){let A=V("down");if(A!==void 0){if(U)a5(Z);Y=A}else{if(U)a5(Z);if(F===-1)Y=z;else if(Y=P2($,{startingIndex:F,amount:Q,disabledIndices:X}),B&&F+Q>G)Y=P2($,{startingIndex:F%Q-Q,amount:Q,disabledIndices:X});if(l7($,Y))Y=F}}if(H==="both"){let A=DK(F/Q);if(Z.key===(J?h8:x8)){if(U)a5(Z);if(F%Q!==Q-1){if(Y=P2($,{startingIndex:F,disabledIndices:X}),B&&kQ(Y,Q,A))Y=P2($,{startingIndex:F-F%Q-1,disabledIndices:X})}else if(B)Y=P2($,{startingIndex:F-F%Q-1,disabledIndices:X});if(kQ(Y,Q,A))Y=F}if(Z.key===(J?x8:h8)){if(U)a5(Z);if(F%Q!==0){if(Y=P2($,{startingIndex:F,decrement:!0,disabledIndices:X}),B&&kQ(Y,Q,A))Y=P2($,{startingIndex:F+(Q-F%Q),decrement:!0,disabledIndices:X})}else if(B)Y=P2($,{startingIndex:F+(Q-F%Q),decrement:!0,disabledIndices:X});if(kQ(Y,Q,A))Y=F}let D=DK(G/Q)===A;if(l7($,Y))if(B&&D)Y=Z.key===(J?x8:h8)?G:P2($,{startingIndex:F-F%Q-1,disabledIndices:X});else Y=F}return Y}function EM($,Z,H){let B=[],J=0;return $.forEach(({width:Q,height:X},z)=>{if(Q>Z);let G=!1;if(H)J=0;while(!G){let F=[];for(let U=0;U<Q;U+=1)for(let Y=0;Y<X;Y+=1)F.push(J+U+Y*Z);if(J%Z+Q<=Z&&F.every((U)=>B[U]==null))F.forEach((U)=>{B[U]=z}),G=!0;else J+=1}}),[...B]}function SM($,Z,H,B,J){if($===-1)return-1;let Q=H.indexOf($),X=Z[$];switch(J){case"tl":return Q;case"tr":if(!X)return Q;return Q+X.width-1;case"bl":if(!X)return Q;return Q+(X.height-1)*B;case"br":return H.lastIndexOf($);default:return-1}}function IM($,Z){return Z.flatMap((H,B)=>$.includes(H)?[B]:[])}function i7($,Z,H){if(typeof H==="function")return H(Z);if(H)return H.includes(Z);let B=$.current[Z];if(!B)return!1;return B.hasAttribute("disabled")||B.getAttribute("aria-disabled")==="true"}/*!
|
|
10
|
+
* tabbable 6.4.0
|
|
11
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
12
|
+
*/var ad=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],yQ=ad.join(","),kM=typeof Element>"u",r7=kM?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,hQ=!kM&&Element.prototype.getRootNode?function($){var Z;return $===null||$===void 0?void 0:(Z=$.getRootNode)===null||Z===void 0?void 0:Z.call($)}:function($){return $===null||$===void 0?void 0:$.ownerDocument},xQ=function(Z,H){var B;if(H===void 0)H=!0;var J=Z===null||Z===void 0?void 0:(B=Z.getAttribute)===null||B===void 0?void 0:B.call(Z,"inert"),Q=J===""||J==="true",X=Q||H&&Z&&(typeof Z.closest==="function"?Z.closest("[inert]"):xQ(Z.parentNode));return X},nd=function(Z){var H,B=Z===null||Z===void 0?void 0:(H=Z.getAttribute)===null||H===void 0?void 0:H.call(Z,"contenteditable");return B===""||B==="true"},bM=function(Z,H,B){if(xQ(Z))return[];var J=Array.prototype.slice.apply(Z.querySelectorAll(yQ));if(H&&r7.call(Z,yQ))J.unshift(Z);return J=J.filter(B),J},vQ=function(Z,H,B){var J=[],Q=Array.from(Z);while(Q.length){var X=Q.shift();if(xQ(X,!1))continue;if(X.tagName==="SLOT"){var z=X.assignedElements(),G=z.length?z:X.children,F=vQ(G,!0,B);if(B.flatten)J.push.apply(J,F);else J.push({scopeParent:X,candidates:F})}else{var U=r7.call(X,yQ);if(U&&B.filter(X)&&(H||!Z.includes(X)))J.push(X);var Y=X.shadowRoot||typeof B.getShadowRoot==="function"&&B.getShadowRoot(X),K=!xQ(Y,!1)&&(!B.shadowRootFilter||B.shadowRootFilter(X));if(Y&&K){var W=vQ(Y===!0?X.children:Y.children,!0,B);if(B.flatten)J.push.apply(J,W);else J.push({scopeParent:X,candidates:W})}else Q.unshift.apply(Q,X.children)}}return J},yM=function(Z){return!isNaN(parseInt(Z.getAttribute("tabindex"),10))},hM=function(Z){if(!Z)throw Error("No node provided");if(Z.tabIndex<0){if((/^(AUDIO|VIDEO|DETAILS)$/.test(Z.tagName)||nd(Z))&&!yM(Z))return 0}return Z.tabIndex},od=function(Z,H){var B=hM(Z);if(B<0&&H&&!yM(Z))return 0;return B},sd=function(Z,H){return Z.tabIndex===H.tabIndex?Z.documentOrder-H.documentOrder:Z.tabIndex-H.tabIndex},xM=function(Z){return Z.tagName==="INPUT"},td=function(Z){return xM(Z)&&Z.type==="hidden"},ed=function(Z){var H=Z.tagName==="DETAILS"&&Array.prototype.slice.apply(Z.children).some(function(B){return B.tagName==="SUMMARY"});return H},$l=function(Z,H){for(var B=0;B<Z.length;B++)if(Z[B].checked&&Z[B].form===H)return Z[B]},Zl=function(Z){if(!Z.name)return!0;var H=Z.form||hQ(Z),B=function(z){return H.querySelectorAll('input[type="radio"][name="'+z+'"]')},J;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape==="function")J=B(window.CSS.escape(Z.name));else try{J=B(Z.name)}catch(X){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",X.message),!1}var Q=$l(J,Z.form);return!Q||Q===Z},Hl=function(Z){return xM(Z)&&Z.type==="radio"},Bl=function(Z){return Hl(Z)&&!Zl(Z)},Jl=function(Z){var H,B=Z&&hQ(Z),J=(H=B)===null||H===void 0?void 0:H.host,Q=!1;if(B&&B!==Z){var X,z,G;Q=!!((X=J)!==null&&X!==void 0&&(z=X.ownerDocument)!==null&&z!==void 0&&z.contains(J)||Z!==null&&Z!==void 0&&(G=Z.ownerDocument)!==null&&G!==void 0&&G.contains(Z));while(!Q&&J){var F,U,Y;B=hQ(J),J=(F=B)===null||F===void 0?void 0:F.host,Q=!!((U=J)!==null&&U!==void 0&&(Y=U.ownerDocument)!==null&&Y!==void 0&&Y.contains(J))}}return Q},RM=function(Z){var H=Z.getBoundingClientRect(),B=H.width,J=H.height;return B===0&&J===0},Ql=function(Z,H){var{displayCheck:B,getShadowRoot:J}=H;if(B==="full-native"){if("checkVisibility"in Z){var Q=Z.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!Q}}if(getComputedStyle(Z).visibility==="hidden")return!0;var X=r7.call(Z,"details>summary:first-of-type"),z=X?Z.parentElement:Z;if(r7.call(z,"details:not([open]) *"))return!0;if(!B||B==="full"||B==="full-native"||B==="legacy-full"){if(typeof J==="function"){var G=Z;while(Z){var F=Z.parentElement,U=hQ(Z);if(F&&!F.shadowRoot&&J(F)===!0)return RM(Z);else if(Z.assignedSlot)Z=Z.assignedSlot;else if(!F&&U!==Z.ownerDocument)Z=U.host;else Z=F}Z=G}if(Jl(Z))return!Z.getClientRects().length;if(B!=="legacy-full")return!0}else if(B==="non-zero-area")return RM(Z);return!1},Xl=function(Z){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(Z.tagName)){var H=Z.parentElement;while(H){if(H.tagName==="FIELDSET"&&H.disabled){for(var B=0;B<H.children.length;B++){var J=H.children.item(B);if(J.tagName==="LEGEND")return r7.call(H,"fieldset[disabled] *")?!0:!J.contains(Z)}return!0}H=H.parentElement}}return!1},MK=function(Z,H){if(H.disabled||td(H)||Ql(H,Z)||ed(H)||Xl(H))return!1;return!0},PK=function(Z,H){if(Bl(H)||hM(H)<0||!MK(Z,H))return!1;return!0},zl=function(Z){var H=parseInt(Z.getAttribute("tabindex"),10);if(isNaN(H)||H>=0)return!0;return!1},vM=function(Z){var H=[],B=[];return Z.forEach(function(J,Q){var X=!!J.scopeParent,z=X?J.scopeParent:J,G=od(z,X),F=X?vM(J.candidates):z;if(G===0)X?H.push.apply(H,F):H.push(z);else B.push({documentOrder:Q,tabIndex:G,item:J,isScope:X,content:F})}),B.sort(sd).reduce(function(J,Q){return Q.isScope?J.push.apply(J,Q.content):J.push(Q.content),J},[]).concat(H)},M6=function(Z,H){H=H||{};var B;if(H.getShadowRoot)B=vQ([Z],H.includeContainer,{filter:PK.bind(null,H),flatten:!1,getShadowRoot:H.getShadowRoot,shadowRootFilter:zl});else B=bM(Z,H.includeContainer,PK.bind(null,H));return vM(B)},gM=function(Z,H){H=H||{};var B;if(H.getShadowRoot)B=vQ([Z],H.includeContainer,{filter:MK.bind(null,H),flatten:!0,getShadowRoot:H.getShadowRoot});else B=bM(Z,H.includeContainer,MK.bind(null,H));return B},_K=function(Z,H){if(H=H||{},!Z)throw Error("No node provided");if(r7.call(Z,yQ)===!1)return!1;return PK(H,Z)};var P6=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function fM($,Z){let H=M6($,P6()),B=H.length;if(B===0)return;let J=Z5(m0($)),Q=H.indexOf(J),X=Q===-1?Z===1?0:B-1:Q+Z;return H[X]}function Z3($){return fM(m0($).body,1)||$}function gQ($){return fM(m0($).body,-1)||$}function mM($,Z){if(!$)return null;let H=M6(m0($).body,P6()),B=H.length;if(B===0)return null;let J=H.indexOf($);if(J===-1)return null;let Q=(J+Z+B)%B;return H[Q]}function fQ($){return mM($,1)}function mQ($){return mM($,-1)}function U8($,Z){let H=Z||$.currentTarget,B=$.relatedTarget;return!B||!f0(H,B)}function pM($){M6($,P6()).forEach((H)=>{H.dataset.tabindex=H.getAttribute("tabindex")||"",H.setAttribute("tabindex","-1")})}function OK($){$.querySelectorAll("[data-tabindex]").forEach((H)=>{let B=H.dataset.tabindex;if(delete H.dataset.tabindex,B)H.setAttribute("tabindex",B);else H.removeAttribute("tabindex")})}var pQ=LM(($)=>$.toasts,($)=>{let Z=new Map,H=0,B=0;return $.forEach((J,Q)=>{let X=J.transitionStatus==="ending";if(Z.set(J.id,{value:J,domIndex:Q,visibleIndex:X?-1:H,offsetY:B}),B+=J.height||0,!X)H+=1}),Z}),S9={toasts:S0(($)=>$.toasts),isEmpty:S0(($)=>$.toasts.length===0),toast:S0(pQ,($,Z)=>$.get(Z)?.value),toastIndex:S0(pQ,($,Z)=>$.get(Z)?.domIndex??-1),toastOffsetY:S0(pQ,($,Z)=>$.get(Z)?.offsetY??0),toastVisibleIndex:S0(pQ,($,Z)=>$.get(Z)?.visibleIndex??-1),hovering:S0(($)=>$.hovering),focused:S0(($)=>$.focused),expanded:S0(($)=>$.hovering||$.focused),expandedOrOutOfFocus:S0(($)=>$.hovering||$.focused||!$.isWindowFocused),prevFocusElement:S0(($)=>$.prevFocusElement)};class jK extends r2{timers=new Map;areTimersPaused=!1;constructor($){super($,{},S9)}setFocused($){this.set("focused",$)}setHovering($){this.set("hovering",$)}setIsWindowFocused($){this.set("isWindowFocused",$)}setPrevFocusElement($){this.set("prevFocusElement",$)}setViewport=($)=>{this.set("viewport",$)};disposeEffect=()=>{return()=>{this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear()}};removeToast($){let Z=S9.toastIndex(this.state,$);if(Z===-1)return;this.state.toasts[Z]?.onRemove?.();let B=[...this.state.toasts];B.splice(Z,1),this.setToasts(B)}addToast=($)=>{let{toasts:Z,timeout:H,limit:B}=this.state,J=$.id||PQ("toast"),Q={...$,id:J,transitionStatus:"starting"},X=[Q,...Z],z=X.filter((F)=>F.transitionStatus!=="ending");if(z.length>B){let F=z.length-B,U=z.slice(-F),Y=new Set(U.map((K)=>K.id));this.setToasts(X.map((K)=>{let W=Y.has(K.id);if(K.limited!==W)return{...K,limited:W};return K}))}else this.setToasts(X.map((F)=>F.limited?{...F,limited:!1}:F));let G=Q.timeout??H;if(Q.type!=="loading"&&G>0)this.scheduleTimer(J,G,()=>this.closeToast(J));if(S9.expandedOrOutOfFocus(this.state))this.pauseTimers();return J};updateToast=($,Z)=>{this.updateToastInternal($,Z)};updateToastInternal=($,Z)=>{let{timeout:H,toasts:B}=this.state,J=S9.toast(this.state,$)??null;if(!J)return;if(J.transitionStatus==="ending")return;let Q={...J,...Z};this.setToasts(B.map((W)=>W.id===$?{...W,...Z}:W));let X=Q.timeout??H,z=J?.timeout??H,G=Object.hasOwn(Z,"timeout"),F=Q.transitionStatus!=="ending"&&Q.type!=="loading"&&X>0,U=this.timers.has($),Y=z!==X,K=J?.type==="loading";if(!F&&U){this.timers.get($)?.timeout?.clear(),this.timers.delete($);return}if(F&&(!U||Y||G||K)){let W=this.timers.get($);if(W)W.timeout?.clear(),this.timers.delete($);if(this.scheduleTimer($,X,()=>this.closeToast($)),S9.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=($)=>{S9.toast(this.state,$)?.onClose?.();let{limit:H,toasts:B}=this.state,J=0,Q=B.map((z)=>{if(z.id===$)return{...z,transitionStatus:"ending",height:0};if(z.transitionStatus==="ending")return z;let G=J>=H;return J+=1,z.limited!==G?{...z,limited:G}:z}),X=this.timers.get($);if(X&&X.timeout)X.timeout.clear(),this.timers.delete($);this.handleFocusManagement($),this.setToasts(Q)};promiseToast=($,Z)=>{let H=_Q(Z.loading),B=this.addToast({...H,type:"loading"}),J=$.then((Q)=>{let X=_Q(Z.success,Q);return this.updateToast(B,{...X,type:"success",timeout:X.timeout}),Q}).catch((Q)=>{let X=_Q(Z.error,Q);return this.updateToast(B,{...X,type:"error",timeout:X.timeout}),Promise.reject(Q)});if({}.hasOwnProperty.call(Z,"setPromise"))Z.setPromise(J);return J};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach(($)=>{if($.timeout){$.timeout.clear();let Z=Date.now()-$.start,H=$.delay-Z;$.remaining=H>0?H:0}})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach(($,Z)=>{$.remaining=$.remaining>0?$.remaining:$.delay,$.timeout??=r5.create(),$.timeout.start($.remaining,()=>{this.timers.delete(Z),$.callback()}),$.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=($)=>{if($.pointerType!=="touch")return;let Z=h1($);if(f0(this.state.viewport,Z))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer($,Z,H){let B=Date.now(),J=!S9.expandedOrOutOfFocus(this.state),Q=J?r5.create():void 0;Q?.start(Z,()=>{this.timers.delete($),H()}),this.timers.set($,{timeout:Q,start:J?B:0,delay:Z,remaining:Z,callback:H})}setToasts($){let Z={toasts:$};if($.length===0)Z.hovering=!1,Z.focused=!1;this.update(Z)}handleFocusManagement($){let Z=Z5(m0(this.state.viewport));if(!this.state.viewport||!f0(this.state.viewport,Z)||!$3(Z))return;let H=S9.toasts(this.state),B=S9.toastIndex(this.state,$),J=null,Q=B+1;while(Q<H.length){if(H[Q].transitionStatus!=="ending"){J=H[Q];break}Q+=1}if(!J){Q=B-1;while(Q>=0){if(H[Q].transitionStatus!=="ending"){J=H[Q];break}Q-=1}}if(J)J.ref?.current?.focus();else this.restoreFocusToPrevElement()}}var cM=O(c(),1),dM=function(Z){let{children:H,timeout:B=5000,limit:J=3,toastManager:Q}=Z,X=k1(()=>new jK({timeout:B,limit:J,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return E2(X.disposeEffect),uM.useEffect(function(){if(!Q)return;return Q[" subscribe"](({action:F,options:U})=>{let Y=U.id;if(F==="promise"&&U.promise)X.promiseToast(U.promise,U);else if(F==="update"&&Y)X.updateToast(Y,U);else if(F==="close"&&Y)X.closeToast(Y);else X.addToast(U)})},[X,B,Q]),X.useSyncedValues({timeout:B,limit:J}),cM.jsx(KH.Provider,{value:X,children:H})};var R2=O(g(),1);var lM={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Y8={...lM,position:"fixed",top:0,left:0},iM={...lM,position:"absolute"};var uQ=O(g(),1);var rM=O(c(),1),I2=uQ.forwardRef(function(Z,H){let[B,J]=uQ.useState();return U0(()=>{if(CQ)J("button")},[]),rM.jsx("span",{...Z,ref:H,style:Y8,"aria-hidden":B?void 0:!0,...{tabIndex:0,role:B},"data-base-ui-focus-guard":""})});var aM=function($){return $.frontmostHeight="--toast-frontmost-height",$}({});var K8=O(c(),1),nM=R2.forwardRef(function(Z,H){let{render:B,className:J,children:Q,...X}=Z,z=s9(),G=_5(),F=R2.useRef(!1),U=R2.useRef(!1),Y=z.useState("isEmpty"),K=z.useState("toasts"),W=z.useState("focused"),N=z.useState("expanded"),L=z.useState("prevFocusElement"),V=K[0]?.height??0,A=R2.useMemo(()=>K.some((E)=>E.transitionStatus==="ending"),[K]);R2.useEffect(()=>{let E=z.state.viewport;if(!E)return;function I(S){if(Y)return;if(S.key==="F6"&&S.target!==E)S.preventDefault(),z.setPrevFocusElement(Z5(m0(E))),E?.focus({preventScroll:!0}),z.pauseTimers(),z.setFocused(!0)}let j=S2(E);return j.addEventListener("keydown",I),()=>{j.removeEventListener("keydown",I)}},[z,Y]),R2.useEffect(()=>{let E=z.state.viewport;if(!E||Y)return;let I=S2(E);function j(k){if(k.target!==I)return;z.setIsWindowFocused(!1),z.pauseTimers()}function S(k){if(k.relatedTarget||k.target===I)return;let b=h1(k),v=Z5(m0(E));if(!f0(E,b)||!$3(v))z.resumeTimers();G.start(0,()=>z.setIsWindowFocused(!0))}return I.addEventListener("blur",j,!0),I.addEventListener("focus",S,!0),()=>{I.removeEventListener("blur",j,!0),I.removeEventListener("focus",S,!0)}},[z,G,Y]),R2.useEffect(()=>{let E=z.state.viewport;if(!E||Y)return;let I=m0(E);return I.addEventListener("pointerdown",z.handleDocumentPointerDown,!0),()=>{I.removeEventListener("pointerdown",z.handleDocumentPointerDown,!0)}},[Y,z]);function D(E){let I=z.state.viewport;if(!I)return;if(F.current=!0,E.relatedTarget===I)K[0]?.ref?.current?.focus();else z.restoreFocusToPrevElement()}function q(E){if(E.key==="Tab"&&E.shiftKey&&E.target===z.state.viewport)E.preventDefault(),z.restoreFocusToPrevElement(),z.resumeTimers()}R2.useEffect(()=>{if(!z.state.isWindowFocused||A||!U.current)return;z.resumeTimers(),z.setHovering(!1),U.current=!1},[A,z]);function _(){z.pauseTimers(),z.setHovering(!0),U.current=!1}function M(){if(A)U.current=!0;else z.resumeTimers(),z.setHovering(!1)}function P(){if(F.current){F.current=!1;return}if(W)return;if($3(m0(z.state.viewport).activeElement))z.setFocused(!0),z.pauseTimers()}function T(E){if(!W||f0(z.state.viewport,E.relatedTarget))return;z.setFocused(!1),z.resumeTimers()}let R={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:_,onMouseMove:_,onMouseLeave:M,onFocus:P,onBlur:T,onKeyDown:q,onClick:P},y={expanded:N},w=F0("div",Z,{ref:[H,z.setViewport],state:y,props:[R,{style:{[aM.frontmostHeight]:V?`${V}px`:void 0}},X,{children:K8.jsxs(R2.Fragment,{children:[!Y&&L&&K8.jsx(I2,{onFocus:D}),Q,!Y&&L&&K8.jsx(I2,{onFocus:D})]})}]}),h=R2.useMemo(()=>K.filter((E)=>E.priority==="high"),[K]);return K8.jsxs(R2.Fragment,{children:[!Y&&L&&K8.jsx(I2,{onFocus:D}),w,!W&&h.length>0&&K8.jsx("div",{style:Y8,children:h.map((E)=>K8.jsxs("div",{role:"alert","aria-atomic":!0,children:[K8.jsx("div",{children:E.title}),K8.jsx("div",{children:E.description})]},E.id))})]})});var L5=O(g(),1),eM=O(F4(),1);function g8($){if(VQ(19))return $;return $?"true":void 0}var cQ=O(g(),1),TK=cQ.createContext(void 0);function f8(){let $=cQ.useContext(TK);if(!$)throw Error(E0(66));return $}var m8=function($){return $.startingStyle="data-starting-style",$.endingStyle="data-ending-style",$}({}),Gl={[m8.startingStyle]:""},Fl={[m8.endingStyle]:""},i1={transitionStatus($){if($==="starting")return Gl;if($==="ending")return Fl;return null}};var sM=O(g(),1);var oM=O(F4(),1);function W8($){if($==null)return $;return"current"in $?$.current:$}function p8($,Z=!1,H=!0){let B=G4();return Y0((J,Q=null)=>{B.cancel();function X(){oM.flushSync(J)}let z=W8($);if(z==null)return;let G=z;if(typeof G.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)J();else{let F=function(){let Y=m8.startingStyle;if(!G.hasAttribute(Y)){B.request(U);return}let K=new MutationObserver(()=>{if(!G.hasAttribute(Y))K.disconnect(),U()});K.observe(G,{attributes:!0,attributeFilter:[Y]}),Q?.addEventListener("abort",()=>K.disconnect(),{once:!0})},U=function(){Promise.all(G.getAnimations().map((Y)=>Y.finished)).then(()=>{if(Q?.aborted)return;X()}).catch(()=>{let Y=G.getAnimations();if(H){if(Q?.aborted)return;X()}else if(Y.length>0&&Y.some((K)=>K.pending||K.playState!=="finished"))U()})};if(Z){F();return}B.request(U)}})}function y5($){let{enabled:Z=!0,open:H,ref:B,onComplete:J}=$,Q=Y0(J),X=p8(B,H,!1);sM.useEffect(()=>{if(!Z)return;let z=new AbortController;return X(Q,z.signal),()=>{z.abort()}},[Z,H,Q,X])}var u8=function($){return $.index="--toast-index",$.offsetY="--toast-offset-y",$.height="--toast-height",$.swipeMovementX="--toast-swipe-movement-x",$.swipeMovementY="--toast-swipe-movement-y",$}({});var $P=O(c(),1),Ul={...i1,swipeDirection($){return $?{"data-swipe-direction":$}:null}},qH=40,Yl=10,H3=0.5,Kl=1;function tM($,Z,H){switch($){case"up":return-H;case"down":return H;case"left":return-Z;case"right":return Z;default:return 0}}function Wl($){let H=window.getComputedStyle($).transform,B=0,J=0,Q=1;if(H&&H!=="none"){let X=H.match(/matrix(?:3d)?\(([^)]+)\)/);if(X){let z=X[1].split(", ").map(parseFloat);if(z.length===6)B=z[4],J=z[5],Q=Math.sqrt(z[0]*z[0]+z[1]*z[1]);else if(z.length===16)B=z[12],J=z[13],Q=z[0]}}return{x:B,y:J,scale:Q}}var ZP=L5.forwardRef(function(Z,H){let{toast:B,render:J,className:Q,swipeDirection:X=["down","right"],...z}=Z,G=B.positionerProps?.anchor!==void 0,F=[];if(!G)F=Array.isArray(X)?X:[X];let U=F.length>0,Y=s9(),[K,W]=L5.useState(void 0),[N,L]=L5.useState(!1),[V,A]=L5.useState(!1),[D,q]=L5.useState(!1),[_,M]=L5.useState({x:0,y:0}),[P,T]=L5.useState({x:0,y:0,scale:1}),[R,y]=L5.useState(),[w,h]=L5.useState(),[E,I]=L5.useState(null),j=L5.useRef(null),S=L5.useRef({x:0,y:0}),k=L5.useRef({x:0,y:0,scale:1}),b=L5.useRef(void 0),v=L5.useRef(0),u=L5.useRef(!1),C=L5.useRef({x:0,y:0}),t=L5.useRef(!1),H0=Y.useState("toastIndex",B.id),x=Y.useState("toastVisibleIndex",B.id),e=Y.useState("toastOffsetY",B.id),L0=Y.useState("focused"),d=Y.useState("expanded");y5({open:B.transitionStatus!=="ending",ref:j,onComplete(){if(B.transitionStatus==="ending")Y.removeToast(B.id)}});let X0=Y0((m=!1)=>{let a=j.current;if(!a)return;let o=a.style.height;a.style.height="auto";let D0=a.offsetHeight;a.style.height=o;function O0(){Y.updateToastInternal(B.id,{ref:j,height:D0,...B.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}if(m)eM.flushSync(O0);else O0()});U0(X0,[X0]);function K0(m,a){let o=m,D0=a;if(!F.includes("left")&&!F.includes("right"))o=m>0?m**H3:-(Math.abs(m)**H3);else{if(!F.includes("right")&&m>0)o=m**H3;if(!F.includes("left")&&m<0)o=-(Math.abs(m)**H3)}if(!F.includes("up")&&!F.includes("down"))D0=a>0?a**H3:-(Math.abs(a)**H3);else{if(!F.includes("down")&&a>0)D0=a**H3;if(!F.includes("up")&&a<0)D0=-(Math.abs(a)**H3)}return{x:o,y:D0}}function Q0(m){if(m.button!==0)return;if(m.pointerType==="touch")Y.pauseTimers();let a=h1(m.nativeEvent);if(a?a.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'):!1)return;if(u.current=!1,b.current=void 0,v.current=0,S.current={x:m.clientX,y:m.clientY},C.current=S.current,j.current){let D0=Wl(j.current);k.current=D0,T(D0),M({x:D0.x,y:D0.y})}Y.setHovering(!0),L(!0),A(!1),I(null),t.current=!0,j.current?.setPointerCapture(m.pointerId)}function z0(m){if(!N)return;if(m.preventDefault(),t.current)S.current={x:m.clientX,y:m.clientY},t.current=!1;let{clientY:a,clientX:o,movementX:D0,movementY:O0}=m;if(O0<0&&a>C.current.y||O0>0&&a<C.current.y)C.current={x:C.current.x,y:a};if(D0<0&&o>C.current.x||D0>0&&o<C.current.x)C.current={x:o,y:C.current.y};let k0=o-S.current.x,r0=a-S.current.y,p=a-C.current.y,r=o-C.current.x;if(!V){if(Math.sqrt(k0*k0+r0*r0)>=Kl){if(A(!0),E===null){let Y1=F.includes("left")||F.includes("right"),c0=F.includes("up")||F.includes("down");if(Y1&&c0){let R0=Math.abs(k0),d0=Math.abs(r0);I(R0>d0?"horizontal":"vertical")}}}}let Z0;if(!b.current){if(E==="vertical"){if(r0>0)Z0="down";else if(r0<0)Z0="up"}else if(E==="horizontal"){if(k0>0)Z0="right";else if(k0<0)Z0="left"}else if(Math.abs(k0)>=Math.abs(r0))Z0=k0>0?"right":"left";else Z0=r0>0?"down":"up";if(Z0&&F.includes(Z0))b.current=Z0,v.current=tM(Z0,k0,r0),W(Z0)}else{let z1=b.current,Y1=tM(z1,r,p);if(Y1>qH)u.current=!1,W(z1);else if(!(F.includes("left")&&F.includes("right"))&&!(F.includes("up")&&F.includes("down"))&&v.current-Y1>=Yl)u.current=!0}let V0=K0(k0,r0),j0=k.current.x,v0=k.current.y;if(E==="horizontal"){if(F.includes("left")||F.includes("right"))j0+=V0.x}else if(E==="vertical"){if(F.includes("up")||F.includes("down"))v0+=V0.y}else{if(F.includes("left")||F.includes("right"))j0+=V0.x;if(F.includes("up")||F.includes("down"))v0+=V0.y}M({x:j0,y:v0})}function A0(m){if(!N)return;if(L(!1),A(!1),I(null),j.current?.releasePointerCapture(m.pointerId),u.current){M({x:P.x,y:P.y}),W(void 0);return}let a=!1,o=_.x-P.x,D0=_.y-P.y,O0;for(let k0 of F){switch(k0){case"right":if(o>qH)a=!0,O0="right";break;case"left":if(o<-qH)a=!0,O0="left";break;case"down":if(D0>qH)a=!0,O0="down";break;case"up":if(D0<-qH)a=!0,O0="up";break;default:break}if(a)break}if(a)W(O0),q(!0),Y.closeToast(B.id);else M({x:P.x,y:P.y}),W(void 0)}function i(m){if(m.key==="Escape"){if(!j.current||!f0(j.current,Z5(m0(j.current))))return;Y.closeToast(B.id)}}L5.useEffect(()=>{if(!U)return;let m=j.current;if(!m)return;function a(o){if(f0(m,o.target))o.preventDefault()}return m.addEventListener("touchmove",a,{passive:!1}),()=>{m.removeEventListener("touchmove",a)}},[U]);function B0(){if(!N&&_.x===P.x&&_.y===P.y&&!D)return{[u8.swipeMovementX]:"0px",[u8.swipeMovementY]:"0px"};let m=_.x-P.x,a=_.y-P.y;return{transition:N?"none":void 0,transform:N?`translateX(${_.x}px) translateY(${_.y}px) scale(${P.scale})`:void 0,[u8.swipeMovementX]:`${m}px`,[u8.swipeMovementY]:`${a}px`}}let $0=B.priority==="high",J0={role:$0?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":R,"aria-describedby":w,"aria-hidden":$0&&!L0?!0:void 0,onPointerDown:U?Q0:void 0,onPointerMove:U?z0:void 0,onPointerUp:U?A0:void 0,onKeyDown:i,inert:g8(B.limited),style:{...B0(),[u8.index]:B.transitionStatus==="ending"?H0:x,[u8.offsetY]:`${e}px`,[u8.height]:B.height?`${B.height}px`:void 0}},n=L5.useMemo(()=>({rootRef:j,toast:B,titleId:R,setTitleId:y,descriptionId:w,setDescriptionId:h,swiping:N,swipeDirection:K,recalculateHeight:X0,index:H0,visibleIndex:x,expanded:d}),[B,R,w,N,K,X0,H0,x,d]),f={transitionStatus:B.transitionStatus,expanded:d,limited:B.limited||!1,type:B.type,swiping:n.swiping,swipeDirection:n.swipeDirection},l=F0("div",Z,{ref:[H,n.rootRef],state:f,stateAttributesMapping:Ul,props:[J0,z]});return $P.jsx(TK.Provider,{value:n,children:l})});var dQ=O(g(),1);var HP=dQ.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{visibleIndex:X,expanded:z,recalculateHeight:G}=f8(),F=dQ.useRef(null);U0(()=>{let W=F.current;if(!W)return;if(G(),typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let N=new ResizeObserver(()=>G(!0)),L=new MutationObserver(()=>G(!0));return N.observe(W),L.observe(W,{childList:!0,subtree:!0,characterData:!0}),()=>{N.disconnect(),L.disconnect()}},[G]);let U=X>0;return F0("div",Z,{ref:[H,F],state:{expanded:z,behind:U},props:Q})});var XP=O(g(),1);var lQ=O(g(),1);var BP=0;function Nl($,Z="mui"){let[H,B]=lQ.useState($),J=$||H;return lQ.useEffect(()=>{if(H==null)BP+=1,B(`${Z}-${BP}`)},[H,Z]),J}var JP=QP.useId;function Y2($,Z){if(JP!==void 0){let H=JP();return $??(Z?`${Z}-${H}`:H)}return Nl($,Z)}var zP=XP.forwardRef(function(Z,H){let{render:B,className:J,id:Q,children:X,...z}=Z,{toast:G,setDescriptionId:F}=f8(),U=X??G.description,Y=Boolean(U),K=Y2(Q);U0(()=>{if(!Y)return;return F(K),()=>{F(void 0)}},[Y,K,F]);let W={type:G.type},N=F0("p",Z,{ref:H,state:W,props:{...z,id:K,children:U}});if(!Y)return null;return N});var GP=O(g(),1);var FP=GP.forwardRef(function(Z,H){let{render:B,className:J,id:Q,children:X,...z}=Z,{toast:G,setTitleId:F}=f8(),U=X??G.title,Y=Boolean(U),K=Y2(Q);U0(()=>{if(!Y)return;return F(K),()=>{F(void 0)}},[Y,K,F]);let W={type:G.type},N=F0("h2",Z,{ref:H,state:W,props:{...z,id:K,children:U}});if(!Y)return null;return N});var iQ=O(g(),1);var UP=iQ.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q,nativeButton:X=!0,...z}=Z,G=s9(),{toast:F}=f8(),U=G.useState("expanded"),[Y,K]=iQ.useState(!1),{getButtonProps:W,buttonRef:N}=u5({disabled:Q,native:X}),L={type:F.type};return F0("button",Z,{ref:[H,N],state:L,props:[{"aria-hidden":!U&&!Y,onClick(){G.closeToast(F.id)},onFocus(){K(!0)},onBlur(){K(!1)}},z,W]})});var YP=O(g(),1);var KP=YP.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q,nativeButton:X=!0,...z}=Z,{toast:G}=f8(),F=G.actionProps?.children??z.children,U=Boolean(F),{getButtonProps:Y,buttonRef:K}=u5({disabled:Q,native:X}),W={type:G.type},N=F0("button",Z,{ref:[H,K],state:W,props:[z,G.actionProps,Y,{children:F}]});if(!U)return null;return N});var zX=O(g(),1),yP=O(F4(),1);var U4=O(g(),1);var nQ=O(g(),1);function w5($){let Z=k1(Ll,$).current;return Z.next=$,U0(Z.effect),Z}function Ll($){let Z={current:$,next:$,effect:()=>{Z.current=Z.next}};return Z}var B3=O(g(),1);function rQ(){let $=new Map;return{emit(Z,H){$.get(Z)?.forEach((B)=>B(H))},on(Z,H){if(!$.has(Z))$.set(Z,new Set);$.get(Z).add(H)},off(Z,H){$.get(Z)?.delete(H)}}}class _6{nodesRef={current:[]};events=rQ();addNode($){this.nodesRef.current.push($)}removeNode($){let Z=this.nodesRef.current.findIndex((H)=>H===$);if(Z!==-1)this.nodesRef.current.splice(Z,1)}}var CK=O(c(),1),WP=B3.createContext(null),NP=B3.createContext(null),e5=()=>B3.useContext(WP)?.id||null,k2=($)=>{let Z=B3.useContext(NP);return $??Z};function O6($){let Z=Y2(),H=k2($),B=e5();return U0(()=>{if(!Z)return;let J={id:Z,parentId:B};return H?.addNode(J),()=>{H?.removeNode(J)}},[H,Z,B]),Z}function MH($){let{children:Z,id:H}=$,B=e5();return CK.jsx(WP.Provider,{value:B3.useMemo(()=>({id:H,parentId:B}),[H,B]),children:Z})}function PH($){let{children:Z,externalTree:H}=$,B=k1(()=>H??new _6).current;return CK.jsx(NP.Provider,{value:B,children:Z})}var G0={};O4(G0,{windowResize:()=>al,wheel:()=>pl,triggerPress:()=>Vl,triggerHover:()=>Dl,triggerFocus:()=>ql,trackPress:()=>Cl,swipe:()=>rl,siblingOpen:()=>dl,scrub:()=>ul,pointer:()=>fl,outsidePress:()=>Ml,none:()=>Al,listNavigation:()=>vl,linkPress:()=>Ol,keyboard:()=>gl,itemPress:()=>Pl,inputPress:()=>bl,inputPaste:()=>kl,inputClear:()=>Il,inputChange:()=>Sl,inputBlur:()=>Rl,incrementPress:()=>wl,imperativeAction:()=>il,focusOut:()=>yl,escapeKey:()=>hl,drag:()=>ml,disabled:()=>ll,decrementPress:()=>El,closeWatcher:()=>xl,closePress:()=>_l,clearPress:()=>jl,chipRemovePress:()=>Tl,cancelOpen:()=>cl});var Al="none",Vl="trigger-press",Dl="trigger-hover",ql="trigger-focus",Ml="outside-press",Pl="item-press",_l="close-press",Ol="link-press",jl="clear-press",Tl="chip-remove-press",Cl="track-press",wl="increment-press",El="decrement-press",Sl="input-change",Il="input-clear",Rl="input-blur",kl="input-paste",bl="input-press",yl="focus-out",hl="escape-key",xl="close-watcher",vl="list-navigation",gl="keyboard",fl="pointer",ml="drag",pl="wheel",ul="scrub",cl="cancel-open",dl="sibling-open",ll="disabled",il="imperative-action",rl="swipe",al="window-resize";function M0($,Z,H,B){let J=!1,Q=!1,X=B??b1;return{reason:$,event:Z??new Event("base-ui"),cancel(){J=!0},allowPropagation(){Q=!0},get isCanceled(){return J},get isPropagationAllowed(){return Q},trigger:H,...X}}function aQ($,Z,H){let B=H??b1;return{reason:$,event:Z??new Event("base-ui"),...B}}function j4($){return`data-base-ui-${$}`}var iU0=j4("safe-polygon"),rU0=`button,[role="button"],select,[tabindex]:not([tabindex="-1"]),${d7}`;function a7($,Z,H){if(H&&!c4(H))return 0;if(typeof $==="number")return $;if(typeof $==="function"){let B=$();if(typeof B==="number")return B;return B?.[Z]}return $?.[Z]}var LP=O(c(),1),AP=U4.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new r5,currentIdRef:{current:null},currentContextRef:{current:null}});function wK($){let{children:Z,delay:H,timeoutMs:B=0}=$,J=U4.useRef(H),Q=U4.useRef(H),X=U4.useRef(null),z=U4.useRef(null),G=_5();return LP.jsx(AP.Provider,{value:U4.useMemo(()=>({hasProvider:!0,delayRef:J,initialDelayRef:Q,currentIdRef:X,timeoutMs:B,currentContextRef:z,timeout:G}),[B,G]),children:Z})}function EK($,Z={open:!1}){let H="rootStore"in $?$.rootStore:$,B=H.useState("floatingId"),{open:J}=Z,Q=U4.useContext(AP),{currentIdRef:X,delayRef:z,timeoutMs:G,initialDelayRef:F,currentContextRef:U,hasProvider:Y,timeout:K}=Q,[W,N]=U4.useState(!1);return U0(()=>{function L(){N(!1),U.current?.setIsInstantPhase(!1),X.current=null,U.current=null,z.current=F.current}if(!X.current)return;if(!J&&X.current===B){if(N(!1),G){let V=B;return K.start(G,()=>{if(H.select("open")||X.current&&X.current!==V)return;L()}),()=>{K.clear()}}L()}return},[J,B,X,z,G,F,U,K,H]),U0(()=>{if(!J)return;let L=U.current,V=X.current;if(K.clear(),U.current={onOpenChange:H.setOpen,setIsInstantPhase:N},X.current=B,z.current={open:0,close:a7(F.current,"close")},V!==null&&V!==B)N(!0),L?.setIsInstantPhase(!0),L?.onOpenChange(!1,M0(G0.none));else N(!1),L?.setIsInstantPhase(!1)},[J,B,H,X,z,G,F,U,K]),U0(()=>{return()=>{U.current=null}},[U]),U4.useMemo(()=>({hasProvider:Y,delayRef:z,isInstantPhase:W}),[Y,z,W])}var $2=O(g(),1);var VP=0;function j6($,Z={}){let{preventScroll:H=!1,cancelPrevious:B=!0,sync:J=!1}=Z;if(B)cancelAnimationFrame(VP);let Q=()=>$?.focus({preventScroll:H});if(J)Q();else VP=requestAnimationFrame(Q)}var n7={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function DP($){if($==="inert")return n7.inert;if($==="aria-hidden")return n7["aria-hidden"];return n7.none}var oQ=new WeakSet,sQ={},SK=0;var qP=($)=>$&&($.host||qP($.parentNode)),nl=($,Z)=>Z.map((H)=>{if($.contains(H))return H;let B=qP(H);if($.contains(B))return B;return null}).filter((H)=>H!=null);function ol($,Z,H,B){let Q=B?"inert":H?"aria-hidden":null,X=nl(Z,$),z=new Set,G=new Set(X),F=[];if(!sQ["data-base-ui-inert"])sQ["data-base-ui-inert"]=new WeakMap;let U=sQ["data-base-ui-inert"];X.forEach(Y),K(Z),z.clear();function Y(W){if(!W||z.has(W))return;if(z.add(W),W.parentNode)Y(W.parentNode)}function K(W){if(!W||G.has(W))return;[].forEach.call(W.children,(N)=>{if(tQ(N)==="script")return;if(z.has(N))K(N);else{let L=Q?N.getAttribute(Q):null,V=L!==null&&L!=="false",A=DP(Q),D=(A.get(N)||0)+1,q=(U.get(N)||0)+1;if(A.set(N,D),U.set(N,q),F.push(N),D===1&&V)oQ.add(N);if(q===1)N.setAttribute("data-base-ui-inert","");if(!V&&Q)N.setAttribute(Q,Q==="inert"?"":"true")}})}return SK+=1,()=>{if(F.forEach((W)=>{let N=DP(Q),V=(N.get(W)||0)-1,A=(U.get(W)||0)-1;if(N.set(W,V),U.set(W,A),!V){if(!oQ.has(W)&&Q)W.removeAttribute(Q);oQ.delete(W)}if(!A)W.removeAttribute("data-base-ui-inert")}),SK-=1,!SK)n7.inert=new WeakMap,n7["aria-hidden"]=new WeakMap,n7.none=new WeakMap,oQ=new WeakSet,sQ={}}}function MP($,Z=!1,H=!1){let B=m0($[0]).body;return ol($.concat(Array.from(B.querySelectorAll("[aria-live]"))),B,Z,H)}var E5=O(g(),1),IK=O(F4(),1);var T6=O(c(),1),OP=E5.createContext(null),RK=()=>E5.useContext(OP),sl=j4("portal");function eQ($={}){let{ref:Z,container:H,componentProps:B=b1,elementProps:J}=$,Q=Y2(),z=RK()?.portalNode,[G,F]=E5.useState(null),[U,Y]=E5.useState(null),K=Y0((V)=>{if(V!==null)Y(V)}),W=E5.useRef(null);U0(()=>{if(H===null){if(W.current)W.current=null,Y(null),F(null);return}if(Q==null)return;let V=(H&&(PP(H)?H:H.current))??z??document.body;if(V==null){if(W.current)W.current=null,Y(null),F(null);return}if(W.current!==V)W.current=V,Y(null),F(V)},[H,z,Q]);let N=F0("div",B,{ref:[Z,K],props:[{id:Q,[sl]:""},J]});return{portalNode:U,portalSubtree:G&&N?IK.createPortal(N,G):null}}var C6=E5.forwardRef(function(Z,H){let{children:B,container:J,className:Q,render:X,renderGuards:z,...G}=Z,{portalNode:F,portalSubtree:U}=eQ({container:J,ref:H,componentProps:Z,elementProps:G}),Y=E5.useRef(null),K=E5.useRef(null),W=E5.useRef(null),N=E5.useRef(null),[L,V]=E5.useState(null),A=L?.modal,D=L?.open,q=typeof z==="boolean"?z:!!L&&!L.modal&&L.open&&!!F;E5.useEffect(()=>{if(!F||A)return;function M(P){if(F&&P.relatedTarget&&U8(P))(P.type==="focusin"?OK:pM)(F)}return F.addEventListener("focusin",M,!0),F.addEventListener("focusout",M,!0),()=>{F.removeEventListener("focusin",M,!0),F.removeEventListener("focusout",M,!0)}},[F,A]),E5.useEffect(()=>{if(!F||D)return;OK(F)},[D,F]);let _=E5.useMemo(()=>({beforeOutsideRef:Y,afterOutsideRef:K,beforeInsideRef:W,afterInsideRef:N,portalNode:F,setFocusManagerState:V}),[F]);return T6.jsxs(E5.Fragment,{children:[U,T6.jsxs(OP.Provider,{value:_,children:[q&&F&&T6.jsx(I2,{"data-type":"outside",ref:Y,onFocus:(M)=>{if(U8(M,F))W.current?.focus();else{let P=L?L.domReference:null;gQ(P)?.focus()}}}),q&&F&&T6.jsx("span",{"aria-owns":F.id,style:_P}),F&&IK.createPortal(B,F),q&&F&&T6.jsx(I2,{"data-type":"outside",ref:K,onFocus:(M)=>{if(U8(M,F))N.current?.focus();else{let P=L?L.domReference:null;if(Z3(P)?.focus(),L?.closeOnFocusOut)L?.onOpenChange(!1,M0(G0.focusOut,M.nativeEvent))}}})]})]})});var _H=O(c(),1);function tl($,Z){let H=S2($.target);if($ instanceof H.KeyboardEvent)return"keyboard";if($ instanceof H.FocusEvent)return Z||"keyboard";if("pointerType"in $)return $.pointerType||"keyboard";if("touches"in $)return"touch";if($ instanceof H.MouseEvent)return Z||($.detail===0?"keyboard":"mouse");return""}var jP=20,J3=[];function bK(){J3=J3.filter(($)=>{return $.deref()?.isConnected})}function el($){if(bK(),$&&tQ($)!=="body"){if(J3.push(new WeakRef($)),J3.length>jP)J3=J3.slice(-jP)}}function kK(){return bK(),J3[J3.length-1]?.deref()}function $i($){if(!$)return null;let Z=P6();if(_K($,Z))return $;return M6($,Z)[0]||$}function Zi($){if(!$||!$.isConnected)return!1;if(typeof $.checkVisibility==="function")return $.checkVisibility();return o7($).display!=="none"}function TP($,Z){if(!Z.current.includes("floating")&&!$.getAttribute("role")?.includes("dialog"))return;let H=P6(),J=gM($,H).filter((X)=>{let z=X.getAttribute("data-tabindex")||"";return _K(X,H)||X.hasAttribute("data-tabindex")&&!z.startsWith("-")}),Q=$.getAttribute("tabindex");if(Z.current.includes("floating")||J.length===0){if(Q!=="0")$.setAttribute("tabindex","0")}else if(Q!=="-1"||$.hasAttribute("data-tabindex")&&$.getAttribute("data-tabindex")!=="-1")$.setAttribute("tabindex","-1"),$.setAttribute("data-tabindex","-1")}function w6($){let{context:Z,children:H,disabled:B=!1,initialFocus:J=!0,returnFocus:Q=!0,restoreFocus:X=!1,modal:z=!0,closeOnFocusOut:G=!0,openInteractionType:F="",nextFocusableElement:U,previousFocusableElement:Y,beforeContentFocusGuardRef:K,externalTree:W}=$,N="rootStore"in Z?Z.rootStore:Z,L=N.useState("open"),V=N.useState("domReferenceElement"),A=N.useState("floatingElement"),{events:D,dataRef:q}=N.context,_=Y0(()=>q.current.floatingContext?.nodeId),M=J===!1,P=DH(V)&&M,T=$2.useRef(["content"]),R=w5(J),y=w5(Q),w=w5(F),h=k2(W),E=RK(),I=$2.useRef(null),j=$2.useRef(null),S=$2.useRef(!1),k=$2.useRef(!1),b=$2.useRef(!1),v=$2.useRef(-1),u=$2.useRef(""),C=$2.useRef(""),t=$2.useRef(null),H0=$2.useRef(null),x=T4(t,K,E?.beforeInsideRef),e=T4(H0,E?.afterInsideRef),L0=_5(),d=_5(),X0=G4(),K0=E!=null,Q0=q6(A),z0=Y0((B0=Q0)=>{return B0?M6(B0,P6()):[]}),A0=Y0((B0)=>{let $0=z0(B0);return T.current.map(()=>$0).filter(Boolean).flat()});$2.useEffect(()=>{if(B||!z)return;function B0(J0){if(J0.key==="Tab"){if(f0(Q0,Z5(m0(Q0)))&&z0().length===0&&!P)a5(J0)}}let $0=m0(Q0);return $0.addEventListener("keydown",B0),()=>{$0.removeEventListener("keydown",B0)}},[B,V,Q0,z,T,P,z0,A0]),$2.useEffect(()=>{if(B||!L)return;let B0=m0(Q0);function $0(){b.current=!1}function J0(f){let l=h1(f),m=f0(A,l)||f0(V,l)||f0(E?.portalNode,l);if(b.current=!m,C.current=f.pointerType||"keyboard",l?.closest(`[${s7}]`))k.current=!0}function n(){C.current="keyboard"}return B0.addEventListener("pointerdown",J0,!0),B0.addEventListener("pointerup",$0,!0),B0.addEventListener("pointercancel",$0,!0),B0.addEventListener("keydown",n,!0),()=>{B0.removeEventListener("pointerdown",J0,!0),B0.removeEventListener("pointerup",$0,!0),B0.removeEventListener("pointercancel",$0,!0),B0.removeEventListener("keydown",n,!0)}},[B,A,V,Q0,L,E]),$2.useEffect(()=>{if(B||!G)return;let B0=m0(Q0);function $0(){k.current=!0,d.start(0,()=>{k.current=!1})}function J0(a){let o=h1(a),O0=z0().indexOf(o);if(O0!==-1)v.current=O0}function n(a){let{relatedTarget:o,currentTarget:D0}=a,O0=h1(a);queueMicrotask(()=>{let k0=_(),r0=N.context.triggerElements,p=o?.hasAttribute(j4("focus-guard"))&&[t.current,H0.current,E?.beforeInsideRef.current,E?.afterInsideRef.current,E?.beforeOutsideRef.current,E?.afterOutsideRef.current,W8(Y),W8(U)].includes(o),r=!(f0(V,o)||f0(A,o)||f0(o,A)||f0(E?.portalNode,o)||o!=null&&r0.hasElement(o)||r0.hasMatchingElement((Z0)=>f0(Z0,o))||p||h&&(v8(h.nodesRef.current,k0).find((Z0)=>f0(Z0.context?.elements.floating,o)||f0(Z0.context?.elements.domReference,o))||VK(h.nodesRef.current,k0).find((Z0)=>[Z0.context?.elements.floating,q6(Z0.context?.elements.floating)].includes(o)||Z0.context?.elements.domReference===o)));if(D0===V&&Q0)TP(Q0,T);if(X&&D0!==V&&!Zi(O0)&&Z5(B0)===B0.body){if(O5(Q0)){if(Q0.focus(),X==="popup"){X0.request(()=>{Q0.focus()});return}}let Z0=v.current,V0=z0(),j0=V0[Z0]||V0[V0.length-1]||Q0;if(O5(j0))j0.focus()}if(q.current.insideReactTree){q.current.insideReactTree=!1;return}if((P?!0:!z)&&o&&r&&!k.current&&(P||o!==kK()))S.current=!0,N.setOpen(!1,M0(G0.focusOut,a))})}function f(){if(b.current)return;q.current.insideReactTree=!0,L0.start(0,()=>{q.current.insideReactTree=!1})}let l=O5(V)?V:null,m=[];if(!A&&!l)return;if(l)l.addEventListener("focusout",n),l.addEventListener("pointerdown",$0),m.push(()=>{l.removeEventListener("focusout",n),l.removeEventListener("pointerdown",$0)});if(A){if(A.addEventListener("focusin",J0),A.addEventListener("focusout",n),E)A.addEventListener("focusout",f,!0),m.push(()=>{A.removeEventListener("focusout",f,!0)});m.push(()=>{A.removeEventListener("focusin",J0),A.removeEventListener("focusout",n)})}return()=>{m.forEach((a)=>{a()})}},[B,V,A,Q0,z,h,E,N,G,X,z0,P,_,T,q,L0,d,X0,U,Y]),$2.useEffect(()=>{if(B||!A||!L)return;let B0=Array.from(E?.portalNode?.querySelectorAll(`[${j4("portal")}]`)||[]),J0=(h?VK(h.nodesRef.current,_()):[]).find((f)=>DH(f.context?.elements.domReference||null))?.context?.elements.domReference,n=[A,J0,...B0,I.current,j.current,t.current,H0.current,E?.beforeOutsideRef.current,E?.afterOutsideRef.current,W8(Y),W8(U),P?V:null].filter((f)=>f!=null);return MP(n,z||P)},[L,B,V,A,z,T,E,P,h,_,U,Y]),U0(()=>{if(!L||B||!O5(Q0))return;let B0=m0(Q0),$0=Z5(B0);queueMicrotask(()=>{let J0=A0(Q0),n=R.current,f=typeof n==="function"?n(w.current||""):n;if(f===void 0||f===!1)return;let l;if(f===!0||f===null)l=J0[0]||Q0;else l=W8(f);if(l=l||J0[0]||Q0,f0(Q0,$0))return;j6(l,{preventScroll:l===Q0})})},[B,L,Q0,M,A0,R,w]),U0(()=>{if(B||!Q0)return;let B0=m0(Q0),$0=Z5(B0);el($0);function J0(l){if(!l.open)u.current=tl(l.nativeEvent,C.current);if(l.reason===G0.triggerHover&&l.nativeEvent.type==="mouseleave")S.current=!0;if(l.reason!==G0.outsidePress)return;if(l.nested)S.current=!1;else if(SQ(l.nativeEvent)||IQ(l.nativeEvent))S.current=!1;else{let m=!1;if(document.createElement("div").focus({get preventScroll(){return m=!0,!1}}),m)S.current=!1;else S.current=!0}}D.on("openchange",J0);let n=B0.createElement("span");if(n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),Object.assign(n.style,Y8),K0&&V)V.insertAdjacentElement("afterend",n);function f(){let l=y.current,m=typeof l==="function"?l(u.current):l;if(m===void 0||m===!1)return null;if(m===null)m=!0;if(typeof m==="boolean"){let o=V||kK();return o&&o.isConnected?o:n}let a=V||kK()||n;return W8(m)||a}return()=>{D.off("openchange",J0);let l=Z5(B0),m=f0(A,l)||h&&v8(h.nodesRef.current,_(),!1).some((o)=>f0(o.context?.elements.floating,l)),a=f();queueMicrotask(()=>{let o=$i(a),D0=typeof y.current!=="boolean";if(y.current&&!S.current&&O5(o)&&(!D0&&o!==l&&l!==B0.body?m:!0))o.focus({preventScroll:!0});n.remove(),S.current=!1})}},[B,A,Q0,y,q,D,h,K0,V,_]),U0(()=>{if(!jQ||L||!A)return;let B0=Z5(m0(A));if(!O5(B0)||!D6(B0))return;if(f0(A,B0))B0.blur()},[L,A]),U0(()=>{if(B||!E)return;return E.setFocusManagerState({modal:z,closeOnFocusOut:G,open:L,onOpenChange:N.setOpen,domReference:V}),()=>{E.setFocusManagerState(null)}},[B,E,z,L,N,G,V]),U0(()=>{if(B||!Q0)return;return TP(Q0,T),()=>{queueMicrotask(bK)}},[B,Q0,T]);let i=!B&&(z?!P:!0)&&(K0||z);return _H.jsxs($2.Fragment,{children:[i&&_H.jsx(I2,{"data-type":"inside",ref:x,onFocus:(B0)=>{if(z){let $0=A0();j6($0[$0.length-1])}else if(E?.portalNode)if(S.current=!1,U8(B0,E.portalNode))Z3(V)?.focus();else W8(Y??E.beforeOutsideRef)?.focus()}}),H,i&&_H.jsx(I2,{"data-type":"inside",ref:e,onFocus:(B0)=>{if(z)j6(A0()[0]);else if(E?.portalNode){if(G)S.current=!0;if(U8(B0,E.portalNode))gQ(V)?.focus();else W8(U??E.afterOutsideRef)?.focus()}}})]})}var OH=O(g(),1);function I9($,Z={}){let H="rootStore"in $?$.rootStore:$,B=H.context.dataRef,{enabled:J=!0,event:Q="click",toggle:X=!0,ignoreMouse:z=!1,stickIfOpen:G=!0,touchOpenDelay:F=0,reason:U=G0.triggerPress}=Z,Y=OH.useRef(void 0),K=G4(),W=_5(),N=OH.useMemo(()=>({onPointerDown(L){Y.current=L.pointerType},onMouseDown(L){let V=Y.current,A=L.nativeEvent,D=H.select("open");if(L.button!==0||Q==="click"||c4(V,!0)&&z)return;let q=B.current.openEvent,_=q?.type,M=H.select("domReferenceElement")!==L.currentTarget,P=D&&M||!(D&&X&&(q&&G?_==="click"||_==="mousedown":!0));if(D6(A.target)){let R=M0(U,A,A.target);if(P&&V==="touch"&&F>0)W.start(F,()=>{H.setOpen(!0,R)});else H.setOpen(P,R);return}let T=L.currentTarget;K.request(()=>{let R=M0(U,A,T);if(P&&V==="touch"&&F>0)W.start(F,()=>{H.setOpen(!0,R)});else H.setOpen(P,R)})},onClick(L){if(Q==="mousedown-only")return;let V=Y.current;if(Q==="mousedown"&&V){Y.current=void 0;return}if(c4(V,!0)&&z)return;let A=H.select("open"),D=B.current.openEvent,q=H.select("domReferenceElement")!==L.currentTarget,_=A&&q||!(A&&X&&(D&&G?RQ(D):!0)),M=M0(U,L.nativeEvent,L.currentTarget);if(_&&V==="touch"&&F>0)W.start(F,()=>{H.setOpen(!0,M)});else H.setOpen(_,M)},onKeyDown(){Y.current=void 0}}),[B,Q,z,H,G,X,K,W,F,U]);return OH.useMemo(()=>J?{reference:N}:b1,[J,N])}var a2=O(g(),1);function Hi($,Z){let H=null,B=null,J=!1;return{contextElement:$||void 0,getBoundingClientRect(){let Q=$?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},X=Z.axis==="x"||Z.axis==="both",z=Z.axis==="y"||Z.axis==="both",G=["mouseenter","mousemove"].includes(Z.dataRef.current.openEvent?.type||"")&&Z.pointerType!=="touch",F=Q.width,U=Q.height,Y=Q.x,K=Q.y;if(H==null&&Z.x&&X)H=Q.x-Z.x;if(B==null&&Z.y&&z)B=Q.y-Z.y;if(Y-=H||0,K-=B||0,F=0,U=0,!J||G)F=Z.axis==="y"?Q.width:0,U=Z.axis==="x"?Q.height:0,Y=X&&Z.x!=null?Z.x:Y,K=z&&Z.y!=null?Z.y:K;else if(J&&!G)U=Z.axis==="x"?Q.height:U,F=Z.axis==="y"?Q.width:F;return J=!0,{width:F,height:U,x:Y,y:K,top:K,right:Y+F,bottom:K+U,left:Y}}}}function CP($){return $!=null&&$.clientX!=null}function yK($,Z={}){let H="rootStore"in $?$.rootStore:$,B=H.useState("open"),J=H.useState("floatingElement"),Q=H.useState("domReferenceElement"),X=H.context.dataRef,{enabled:z=!0,axis:G="both"}=Z,F=a2.useRef(!1),U=a2.useRef(null),[Y,K]=a2.useState(),[W,N]=a2.useState([]),L=Y0((_,M,P)=>{if(F.current)return;if(X.current.openEvent&&!CP(X.current.openEvent))return;H.set("positionReference",Hi(P??Q,{x:_,y:M,axis:G,dataRef:X,pointerType:Y}))}),V=Y0((_)=>{if(!B)L(_.clientX,_.clientY,_.currentTarget);else if(!U.current)N([])}),A=c4(Y)?J:B,D=a2.useCallback(()=>{if(!A||!z)return;let _=S2(J);function M(P){let T=h1(P);if(!f0(J,T))L(P.clientX,P.clientY);else _.removeEventListener("mousemove",M),U.current=null}if(!X.current.openEvent||CP(X.current.openEvent)){_.addEventListener("mousemove",M);let P=()=>{_.removeEventListener("mousemove",M),U.current=null};return U.current=P,P}H.set("positionReference",Q);return},[A,z,J,X,Q,H,L]);a2.useEffect(()=>{return D()},[D,W]),a2.useEffect(()=>{if(z&&!J)F.current=!1},[z,J]),a2.useEffect(()=>{if(!z&&B)F.current=!0},[z,B]);let q=a2.useMemo(()=>{function _(M){K(M.pointerType)}return{onPointerDown:_,onPointerEnter:_,onMouseMove:V,onMouseEnter:V}},[V]);return a2.useMemo(()=>z?{reference:q,trigger:q}:{},[z,q])}var d4=O(g(),1);var Bi={intentional:"onClick",sloppy:"onPointerDown"};function Ji($){return{escapeKey:typeof $==="boolean"?$:$?.escapeKey??!1,outsidePress:typeof $==="boolean"?$:$?.outsidePress??!0}}function N8($,Z={}){let H="rootStore"in $?$.rootStore:$,B=H.useState("open"),J=H.useState("floatingElement"),Q=H.useState("referenceElement"),X=H.useState("domReferenceElement"),{onOpenChange:z,dataRef:G}=H.context,{enabled:F=!0,escapeKey:U=!0,outsidePress:Y=!0,outsidePressEvent:K="sloppy",referencePress:W=!1,referencePressEvent:N="sloppy",ancestorScroll:L=!1,bubbles:V,externalTree:A}=Z,D=k2(A),q=Y0(typeof Y==="function"?Y:()=>!1),_=typeof Y==="function"?q:Y,M=d4.useRef(!1),{escapeKey:P,outsidePress:T}=Ji(V),R=d4.useRef(null),y=_5(),w=_5(),h=Y0(()=>{w.clear(),G.current.insideReactTree=!1}),E=d4.useRef(!1),I=d4.useRef(""),j=Y0((i)=>{I.current=i.pointerType}),S=Y0(()=>{let i=I.current,B0=i==="pen"||!i?"mouse":i,$0=typeof K==="function"?K():K;if(typeof $0==="string")return $0;return $0[B0]}),k=Y0((i)=>{if(!B||!F||!U||i.key!=="Escape")return;if(E.current)return;let B0=G.current.floatingContext?.nodeId,$0=D?v8(D.nodesRef.current,B0):[];if(!P){if($0.length>0){let f=!0;if($0.forEach((l)=>{if(l.context?.open&&!l.context.dataRef.current.__escapeKeyBubbles)f=!1}),!f)return}}let J0=CM(i)?i.nativeEvent:i,n=M0(G0.escapeKey,J0);if(H.setOpen(!1,n),!P&&!n.isPropagationAllowed)i.stopPropagation()}),b=Y0((i)=>{let B0=S();return B0==="intentional"&&i.type!=="click"||B0==="sloppy"&&i.type==="click"}),v=Y0(()=>{G.current.insideReactTree=!0,w.start(0,h)}),u=Y0((i,B0=!1)=>{if(b(i)){h();return}if(G.current.insideReactTree){h();return}if(S()==="intentional"&&B0)return;if(typeof _==="function"&&!_(i))return;let $0=h1(i),J0=`[${j4("inert")}]`,n=m0(H.select("floatingElement")).querySelectorAll(J0),f=H.context.triggerElements;if($0&&(f.hasElement($0)||f.hasMatchingElement((D0)=>f0(D0,$0))))return;let l=T1($0)?$0:null;while(l&&!t7(l)){let D0=$X(l);if(t7(D0)||!T1(D0))break;l=D0}if(n.length&&T1($0)&&!TM($0)&&!f0($0,H.select("floatingElement"))&&Array.from(n).every((D0)=>!f0(l,D0)))return;if(O5($0)&&!("touches"in i)){let D0=t7($0),O0=o7($0),k0=/auto|scroll/,r0=D0||k0.test(O0.overflowX),p=D0||k0.test(O0.overflowY),r=r0&&$0.clientWidth>0&&$0.scrollWidth>$0.clientWidth,Z0=p&&$0.clientHeight>0&&$0.scrollHeight>$0.clientHeight,V0=O0.direction==="rtl",j0=Z0&&(V0?i.offsetX<=$0.offsetWidth-$0.clientWidth:i.offsetX>$0.clientWidth),v0=r&&i.offsetY>$0.clientHeight;if(j0||v0)return}let m=G.current.floatingContext?.nodeId,a=D&&v8(D.nodesRef.current,m).some((D0)=>u4(i,D0.context?.elements.floating));if(u4(i,H.select("floatingElement"))||u4(i,H.select("domReferenceElement"))||a)return;let o=D?v8(D.nodesRef.current,m):[];if(o.length>0){let D0=!0;if(o.forEach((O0)=>{if(O0.context?.open&&!O0.context.dataRef.current.__outsidePressBubbles)D0=!1}),!D0)return}H.setOpen(!1,M0(G0.outsidePress,i)),h()}),C=Y0((i)=>{if(S()!=="sloppy"||i.pointerType==="touch"||!H.select("open")||!F||u4(i,H.select("floatingElement"))||u4(i,H.select("domReferenceElement")))return;u(i)}),t=Y0((i)=>{if(S()!=="sloppy"||!H.select("open")||!F||u4(i,H.select("floatingElement"))||u4(i,H.select("domReferenceElement")))return;let B0=i.touches[0];if(B0)R.current={startTime:Date.now(),startX:B0.clientX,startY:B0.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},y.start(1000,()=>{if(R.current)R.current.dismissOnTouchEnd=!1,R.current.dismissOnMouseDown=!1})}),H0=Y0((i)=>{let B0=h1(i);function $0(){t(i),B0?.removeEventListener(i.type,$0)}B0?.addEventListener(i.type,$0)}),x=Y0((i)=>{let B0=M.current;if(M.current=!1,y.clear(),i.type==="mousedown"&&R.current&&!R.current.dismissOnMouseDown)return;let $0=h1(i);function J0(){if(i.type==="pointerdown")C(i);else u(i,B0);$0?.removeEventListener(i.type,J0)}$0?.addEventListener(i.type,J0)}),e=Y0((i)=>{if(S()!=="sloppy"||!R.current||u4(i,H.select("floatingElement"))||u4(i,H.select("domReferenceElement")))return;let B0=i.touches[0];if(!B0)return;let $0=Math.abs(B0.clientX-R.current.startX),J0=Math.abs(B0.clientY-R.current.startY),n=Math.sqrt($0*$0+J0*J0);if(n>5)R.current.dismissOnTouchEnd=!0;if(n>10)u(i),y.clear(),R.current=null}),L0=Y0((i)=>{let B0=h1(i);function $0(){e(i),B0?.removeEventListener(i.type,$0)}B0?.addEventListener(i.type,$0)}),d=Y0((i)=>{if(S()!=="sloppy"||!R.current||u4(i,H.select("floatingElement"))||u4(i,H.select("domReferenceElement")))return;if(R.current.dismissOnTouchEnd)u(i);y.clear(),R.current=null}),X0=Y0((i)=>{let B0=h1(i);function $0(){d(i),B0?.removeEventListener(i.type,$0)}B0?.addEventListener(i.type,$0)});d4.useEffect(()=>{if(!B||!F)return;G.current.__escapeKeyBubbles=P,G.current.__outsidePressBubbles=T;let i=new r5;function B0(l){H.setOpen(!1,M0(G0.none,l))}function $0(){i.clear(),E.current=!0}function J0(){i.start(wP()?5:0,()=>{E.current=!1})}let n=m0(J);if(n.addEventListener("pointerdown",j,!0),U)n.addEventListener("keydown",k),n.addEventListener("compositionstart",$0),n.addEventListener("compositionend",J0);if(_)n.addEventListener("click",x,!0),n.addEventListener("pointerdown",x,!0),n.addEventListener("touchstart",H0,!0),n.addEventListener("touchmove",L0,!0),n.addEventListener("touchend",X0,!0),n.addEventListener("mousedown",x,!0);let f=[];if(L){if(T1(X))f=jH(X);if(T1(J))f=f.concat(jH(J));if(!T1(Q)&&Q&&Q.contextElement)f=f.concat(jH(Q.contextElement))}return f=f.filter((l)=>l!==n.defaultView?.visualViewport),f.forEach((l)=>{l.addEventListener("scroll",B0,{passive:!0})}),()=>{if(n.removeEventListener("pointerdown",j,!0),U)n.removeEventListener("keydown",k),n.removeEventListener("compositionstart",$0),n.removeEventListener("compositionend",J0);if(_)n.removeEventListener("click",x,!0),n.removeEventListener("pointerdown",x,!0),n.removeEventListener("touchstart",H0,!0),n.removeEventListener("touchmove",L0,!0),n.removeEventListener("touchend",X0,!0),n.removeEventListener("mousedown",x,!0);f.forEach((l)=>{l.removeEventListener("scroll",B0)}),i.clear(),M.current=!1}},[G,J,Q,X,U,_,B,z,L,F,P,T,k,u,x,C,H0,L0,X0,j,H]),d4.useEffect(h,[_,h]);let K0=d4.useMemo(()=>({onKeyDown:k,...W&&{[Bi[N]]:(i)=>{H.setOpen(!1,M0(G0.triggerPress,i.nativeEvent))},...N!=="intentional"&&{onClick(i){H.setOpen(!1,M0(G0.triggerPress,i.nativeEvent))}}}}),[k,H,W,N]),Q0=Y0((i)=>{let B0=h1(i.nativeEvent);if(!f0(H.select("floatingElement"),B0)||i.button!==0)return;M.current=!0}),z0=Y0((i)=>{if(!B||!F||i.button!==0)return;M.current=!0}),A0=d4.useMemo(()=>({onKeyDown:k,onPointerDown:Q0,onMouseDown:Q0,onMouseUp:Q0,onClickCapture:v,onMouseDownCapture(i){v(),z0(i)},onPointerDownCapture(i){v(),z0(i)},onMouseUpCapture:v,onTouchEndCapture:v,onTouchMoveCapture:v}),[k,Q0,v,z0]);return d4.useMemo(()=>F?{reference:K0,floating:A0,trigger:K0}:{},[F,K0,A0])}var o2=O(g(),1);var Qi={open:S0(($)=>$.open),domReferenceElement:S0(($)=>$.domReferenceElement),referenceElement:S0(($)=>$.positionReference??$.referenceElement),floatingElement:S0(($)=>$.floatingElement),floatingId:S0(($)=>$.floatingId)};class E6 extends r2{constructor($){let{nested:Z,noEmit:H,onOpenChange:B,triggerElements:J,...Q}=$;super({...Q,positionReference:Q.referenceElement,domReferenceElement:Q.referenceElement},{onOpenChange:B,dataRef:{current:{}},events:rQ(),nested:Z,noEmit:H,triggerElements:J},Qi)}setOpen=($,Z)=>{if(!$||!this.state.open||RQ(Z.event))this.context.dataRef.current.openEvent=$?Z.event:void 0;if(!this.context.noEmit){let H={open:$,reason:Z.reason,nativeEvent:Z.event,nested:this.context.nested,triggerElement:Z.trigger};this.context.events.emit("openchange",H)}this.context.onOpenChange?.($,Z)}}var CH=O(g(),1);var TH=O(g(),1);function l4($,Z=!1,H=!1){let[B,J]=TH.useState($&&Z?"idle":void 0),[Q,X]=TH.useState($);if($&&!Q)X(!0),J("starting");if(!$&&Q&&B!=="ending"&&!H)J("ending");if(!$&&!Q&&B==="ending")J(void 0);return U0(()=>{if(!$&&Q&&B!=="ending"&&H){let z=N5.request(()=>{J("ending")});return()=>{N5.cancel(z)}}return},[$,Q,B,H]),U0(()=>{if(!$||Z)return;let z=N5.request(()=>{J(void 0)});return()=>{N5.cancel(z)}},[Z,$]),U0(()=>{if(!$||!Z)return;if($&&Q&&B!=="idle")J("starting");let z=N5.request(()=>{J("idle")});return()=>{N5.cancel(z)}},[Z,$,Q,J,B]),TH.useMemo(()=>({mounted:Q,setMounted:X,transitionStatus:B}),[Q,B])}function hK($,Z){let H=CH.useRef(null),B=CH.useRef(null);return CH.useCallback((J)=>{if($===void 0)return;if(H.current!==null){let Q=H.current,X=B.current,z=Z.context.triggerElements.getById(Q);if(X&&z===X)Z.context.triggerElements.delete(Q);H.current=null,B.current=null}if(J!==null)H.current=$,B.current=J,Z.context.triggerElements.add($,J)},[Z,$])}function c8($,Z,H,B){let J=H.useState("isMountedByTrigger",$),Q=hK($,H),X=Y0((z)=>{if(Q(z),!z||!H.select("open"))return;let G=H.select("activeTriggerId");if(G===$){H.update({activeTriggerElement:z,...B});return}if(G==null)H.update({activeTriggerId:$,activeTriggerElement:z,...B})});return U0(()=>{if(J)H.update({activeTriggerElement:Z.current,...B})},[J,H,Z,...Object.values(B)]),{registerTrigger:X,isMountedByThisTrigger:J}}function d8($){let Z=$.useState("open");U0(()=>{if(Z&&!$.select("activeTriggerId")&&$.context.triggerElements.size===1){let H=$.context.triggerElements.entries().next();if(!H.done){let[B,J]=H.value;$.update({activeTriggerId:B,activeTriggerElement:J})}}},[Z,$])}function l8($,Z,H){let{mounted:B,setMounted:J,transitionStatus:Q}=l4($);Z.useSyncedValues({mounted:B,transitionStatus:Q});let X=Y0(()=>{J(!1),Z.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),H?.(),Z.context.onOpenChangeComplete?.(!1)}),z=Z.useState("preventUnmountingOnClose");return y5({enabled:!z,open:$,ref:Z.context.popupRef,onComplete(){if(!$)X()}}),{forceUnmount:X,transitionStatus:Q}}class n2{constructor(){this.elementsSet=new Set,this.idMap=new Map}add($,Z){let H=this.idMap.get($);if(H===Z)return;if(H!==void 0)this.elementsSet.delete(H);this.elementsSet.add(Z),this.idMap.set($,Z)}delete($){let Z=this.idMap.get($);if(Z)this.elementsSet.delete(Z),this.idMap.delete($)}hasElement($){return this.elementsSet.has($)}hasMatchingElement($){for(let Z of this.elementsSet)if($(Z))return!0;return!1}getById($){return this.idMap.get($)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function EP(){return new E6({open:!1,floatingElement:null,referenceElement:null,triggerElements:new n2,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function i8(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:EP(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:b1,inactiveTriggerProps:b1,popupProps:b1}}var ZX=S0(($)=>$.triggerIdProp??$.activeTriggerId),r8={open:S0(($)=>$.openProp??$.open),mounted:S0(($)=>$.mounted),transitionStatus:S0(($)=>$.transitionStatus),floatingRootContext:S0(($)=>$.floatingRootContext),preventUnmountingOnClose:S0(($)=>$.preventUnmountingOnClose),payload:S0(($)=>$.payload),activeTriggerId:ZX,activeTriggerElement:S0(($)=>$.mounted?$.activeTriggerElement:null),isTriggerActive:S0(($,Z)=>Z!==void 0&&ZX($)===Z),isOpenedByTrigger:S0(($,Z)=>Z!==void 0&&ZX($)===Z&&$.open),isMountedByTrigger:S0(($,Z)=>Z!==void 0&&ZX($)===Z&&$.mounted),triggerProps:S0(($,Z)=>Z?$.activeTriggerProps:$.inactiveTriggerProps),popupProps:S0(($)=>$.popupProps),popupElement:S0(($)=>$.popupElement),positionerElement:S0(($)=>$.positionerElement)};function wH($){let{open:Z=!1,onOpenChange:H,elements:B={}}=$,J=Y2(),Q=e5()!=null,X=k1(()=>new E6({open:Z,onOpenChange:H,referenceElement:B.reference??null,floatingElement:B.floating??null,triggerElements:new n2,floatingId:J,nested:Q,noEmit:!1})).current;return U0(()=>{let z={open:Z,floatingId:J};if(B.reference!==void 0)z.referenceElement=B.reference,z.domReferenceElement=T1(B.reference)?B.reference:null;if(B.floating!==void 0)z.floatingElement=B.floating;X.update(z)},[Z,J,B.reference,B.floating,X]),X.context.onOpenChange=H,X.context.nested=Q,X.context.noEmit=!1,X}function xK($={}){let{nodeId:Z,externalTree:H}=$,B=wH($),J=$.rootContext||B,Q={reference:J.useState("referenceElement"),floating:J.useState("floatingElement"),domReference:J.useState("domReferenceElement")},[X,z]=o2.useState(null),G=o2.useRef(null),F=k2(H);U0(()=>{if(Q.domReference)G.current=Q.domReference},[Q.domReference]);let U=SP({...$,elements:{...Q,...X&&{reference:X}}}),Y=o2.useCallback((T)=>{let R=T1(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;z(R),U.refs.setReference(R)},[U.refs]),[K,W]=o2.useState(null),[N,L]=o2.useState(null);J.useSyncedValue("referenceElement",K),J.useSyncedValue("domReferenceElement",T1(K)?K:null),J.useSyncedValue("floatingElement",N);let V=o2.useCallback((T)=>{if(T1(T)||T===null)G.current=T,W(T);if(T1(U.refs.reference.current)||U.refs.reference.current===null||T!==null&&!T1(T))U.refs.setReference(T)},[U.refs,W]),A=o2.useCallback((T)=>{L(T),U.refs.setFloating(T)},[U.refs]),D=o2.useMemo(()=>({...U.refs,setReference:V,setFloating:A,setPositionReference:Y,domReference:G}),[U.refs,V,A,Y]),q=o2.useMemo(()=>({...U.elements,domReference:Q.domReference}),[U.elements,Q.domReference]),_=J.useState("open"),M=J.useState("floatingId"),P=o2.useMemo(()=>({...U,dataRef:J.context.dataRef,open:_,onOpenChange:J.setOpen,events:J.context.events,floatingId:M,refs:D,elements:q,nodeId:Z,rootStore:J}),[U,D,q,Z,J,_,M]);return U0(()=>{J.context.dataRef.current.floatingContext=P;let T=F?.nodesRef.current.find((R)=>R.id===Z);if(T)T.context=P}),o2.useMemo(()=>({...U,context:P,refs:D,elements:q,rootStore:J}),[U,D,q,P,J])}function L8($){let{popupStore:Z,noEmit:H=!1,treatPopupAsFloatingElement:B=!1,onOpenChange:J}=$,Q=Y2(),X=e5()!=null,z=Z.useState("open"),G=Z.useState("activeTriggerElement"),F=Z.useState(B?"popupElement":"positionerElement"),U=Z.context.triggerElements,Y=k1(()=>new E6({open:z,referenceElement:G,floatingElement:F,triggerElements:U,onOpenChange:J,floatingId:Q,nested:X,noEmit:H})).current;return U0(()=>{let K={open:z,floatingId:Q,referenceElement:G,floatingElement:F};if(T1(G))K.domReferenceElement=G;if(Y.state.positionReference===Y.state.referenceElement)K.positionReference=G;Y.update(K)},[z,Q,G,F,Y]),Y.context.onOpenChange=J,Y.context.nested=X,Y.context.noEmit=H,Y}var a8=O(g(),1);var vK=OM&&CQ;function S6($,Z={}){let H="rootStore"in $?$.rootStore:$,{events:B,dataRef:J}=H.context,{enabled:Q=!0,delay:X}=Z,z=a8.useRef(!1),G=a8.useRef(null),F=_5(),U=a8.useRef(!0);a8.useEffect(()=>{let K=H.select("domReferenceElement");if(!Q)return;let W=S2(K);function N(){let A=H.select("domReferenceElement");if(!H.select("open")&&O5(A)&&A===Z5(m0(A)))z.current=!0}function L(){U.current=!0}function V(){U.current=!1}if(W.addEventListener("blur",N),vK)W.addEventListener("keydown",L,!0),W.addEventListener("pointerdown",V,!0);return()=>{if(W.removeEventListener("blur",N),vK)W.removeEventListener("keydown",L,!0),W.removeEventListener("pointerdown",V,!0)}},[H,Q]),a8.useEffect(()=>{if(!Q)return;function K(W){if(W.reason===G0.triggerPress||W.reason===G0.escapeKey){let N=H.select("domReferenceElement");if(T1(N))G.current=N,z.current=!0}}return B.on("openchange",K),()=>{B.off("openchange",K)}},[B,Q,H]);let Y=a8.useMemo(()=>({onMouseLeave(){z.current=!1,G.current=null},onFocus(K){let W=K.currentTarget;if(z.current){if(G.current===W)return;z.current=!1,G.current=null}let N=h1(K.nativeEvent);if(T1(N)){if(vK&&!K.relatedTarget){if(!U.current&&!D6(N))return}else if(!$3(N))return}let L=V6(K.relatedTarget,H.context.triggerElements),{nativeEvent:V,currentTarget:A}=K,D=typeof X==="function"?X():X;if(H.select("open")&&L||D===0||D===void 0){H.setOpen(!0,M0(G0.triggerFocus,V,A));return}F.start(D,()=>{if(z.current)return;H.setOpen(!0,M0(G0.triggerFocus,V,A))})},onBlur(K){z.current=!1,G.current=null;let{relatedTarget:W,nativeEvent:N}=K,L=T1(W)&&W.hasAttribute(j4("focus-guard"))&&W.getAttribute("data-type")==="outside";F.start(0,()=>{let V=H.select("domReferenceElement"),A=Z5(V?V.ownerDocument:document);if(!W&&A===V)return;if(f0(J.current.floatingContext?.refs.floating.current,A)||f0(V,A)||L)return;if(V6(W??A,H.context.triggerElements))return;H.setOpen(!1,M0(G0.triggerFocus,N))})}}),[J,H,F,X]);return a8.useMemo(()=>Q?{reference:Y,trigger:Y}:{},[Q,Y])}var e7=O(g(),1);var EH=j4("safe-polygon"),Xi=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${d7}`;function IP($){return $?Boolean($.closest(Xi)):!1}class gK{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new r5,this.restTimeout=new r5,this.handleCloseOptions=void 0}static create(){return new gK}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>{return this.dispose}}function HX($){let Z=k1(gK.create).current,H=$.context.dataRef.current;if(!H.hoverInteractionState)H.hoverInteractionState=Z;return E2(H.hoverInteractionState.disposeEffect),H.hoverInteractionState}var zi=new Set(["click","mousedown"]);function R9($,Z={}){let H="rootStore"in $?$.rootStore:$,B=H.useState("open"),J=H.useState("floatingElement"),Q=H.useState("domReferenceElement"),{dataRef:X}=H.context,{enabled:z=!0,closeDelay:G=0}=Z,F=HX(H),U=k2(),Y=e5(),K=Y0(()=>{if(F.interactedInside)return!0;return X.current.openEvent?zi.has(X.current.openEvent.type):!1}),W=Y0(()=>{let q=X.current.openEvent?.type;return q?.includes("mouse")&&q!=="mousedown"}),N=Y0((q)=>{return V6(q,H.context.triggerElements)}),L=e7.useCallback((q,_=!0)=>{let M=Gi(G,F.pointerType);if(M&&!F.handler)F.openChangeTimeout.start(M,()=>H.setOpen(!1,M0(G0.triggerHover,q)));else if(_)F.openChangeTimeout.clear(),H.setOpen(!1,M0(G0.triggerHover,q))},[G,H,F]),V=Y0(()=>{F.unbindMouseMove(),F.handler=void 0}),A=Y0(()=>{if(F.performedPointerEventsMutation){let q=m0(J).body;q.style.pointerEvents="",q.removeAttribute(EH),F.performedPointerEventsMutation=!1}}),D=Y0((q)=>{let _=h1(q);if(!IP(_)){F.interactedInside=!1;return}F.interactedInside=!0});U0(()=>{if(!B)F.pointerType=void 0,F.restTimeoutPending=!1,F.interactedInside=!1,V(),A()},[B,F,V,A]),e7.useEffect(()=>{return()=>{V()}},[V]),e7.useEffect(()=>{return A},[A]),U0(()=>{if(!z)return;if(B&&F.handleCloseOptions?.blockPointerEvents&&W()&&T1(Q)&&J){F.performedPointerEventsMutation=!0;let q=m0(J).body;q.setAttribute(EH,"");let _=Q,M=J,P=U?.nodesRef.current.find((T)=>T.id===Y)?.context?.elements.floating;if(P)P.style.pointerEvents="";return q.style.pointerEvents="none",_.style.pointerEvents="auto",M.style.pointerEvents="auto",()=>{q.style.pointerEvents="",_.style.pointerEvents="",M.style.pointerEvents=""}}return},[z,B,Q,J,F,W,U,Y]),e7.useEffect(()=>{if(!z)return;function q(T){if(K()||!X.current.floatingContext||!H.select("open"))return;if(N(T.relatedTarget))return;if(A(),V(),!K())L(T)}function _(T){F.openChangeTimeout.clear(),A(),F.handler?.(T),V()}function M(T){if(!K())L(T,!1)}let P=J;if(P)P.addEventListener("mouseleave",q),P.addEventListener("mouseenter",_),P.addEventListener("mouseleave",M),P.addEventListener("pointerdown",D,!0);return()=>{if(P)P.removeEventListener("mouseleave",q),P.removeEventListener("mouseenter",_),P.removeEventListener("mouseleave",M),P.removeEventListener("pointerdown",D,!0)}},[z,J,H,X,K,N,L,A,V,D,F])}function Gi($,Z){if(Z&&!c4(Z))return 0;if(typeof $==="function")return $();return $}var I6=O(g(),1),RP=O(F4(),1);function fK($){if(typeof $==="function")return $();return $}var Fi={current:null};function A8($,Z={}){let H="rootStore"in $?$.rootStore:$,{dataRef:B,events:J}=H.context,{enabled:Q=!0,delay:X=0,handleClose:z=null,mouseOnly:G=!1,restMs:F=0,move:U=!0,triggerElementRef:Y=Fi,externalTree:K,isActiveTrigger:W=!0}=Z,N=k2(K),L=HX(H),V=w5(z),A=w5(X),D=w5(F),q=w5(Q);if(W)L.handleCloseOptions=V.current?.__options;let _=Y0(()=>{if(L.interactedInside)return!0;return B.current.openEvent?["click","mousedown"].includes(B.current.openEvent.type):!1}),M=Y0((w)=>{return V6(w,H.context.triggerElements)}),P=I6.useCallback((w,h=!0)=>{let E=a7(A.current,"close",L.pointerType);if(E&&!L.handler)L.openChangeTimeout.start(E,()=>H.setOpen(!1,M0(G0.triggerHover,w)));else if(h)L.openChangeTimeout.clear(),H.setOpen(!1,M0(G0.triggerHover,w))},[A,H,L]),T=Y0(()=>{L.unbindMouseMove(),L.handler=void 0}),R=Y0(()=>{if(L.performedPointerEventsMutation){let w=m0(H.select("domReferenceElement")).body;w.style.pointerEvents="",w.removeAttribute(EH),L.performedPointerEventsMutation=!1}});I6.useEffect(()=>{if(!Q)return;function w(h){if(!h.open)L.openChangeTimeout.clear(),L.restTimeout.clear(),L.blockMouseMove=!0,L.restTimeoutPending=!1}return J.on("openchange",w),()=>{J.off("openchange",w)}},[Q,J,L]);let y=Y0((w)=>{if(_())return;if(!B.current.floatingContext)return;if(M(w.relatedTarget))return;let h=Y.current;V.current?.({...B.current.floatingContext,tree:N,x:w.clientX,y:w.clientY,onClose(){if(R(),T(),!_()&&h===H.select("domReferenceElement"))P(w)}})(w)});return I6.useEffect(()=>{if(!Q)return;let w=Y.current??(W?H.select("domReferenceElement"):null);if(!T1(w))return;function h(j){if(L.openChangeTimeout.clear(),L.blockMouseMove=!1,G&&!c4(L.pointerType))return;if(fK(D.current)>0&&!a7(A.current,"open"))return;let S=a7(A.current,"open",L.pointerType),k=H.select("domReferenceElement"),b=H.context.triggerElements,v=(b.hasElement(j.target)||b.hasMatchingElement((H0)=>f0(H0,j.target)))&&(!k||!f0(k,j.target)),u=j.currentTarget??null,C=H.select("open"),t=!C||v;if(v&&C)H.setOpen(!0,M0(G0.triggerHover,j,u));else if(S)L.openChangeTimeout.start(S,()=>{if(t)H.setOpen(!0,M0(G0.triggerHover,j,u))});else if(t)H.setOpen(!0,M0(G0.triggerHover,j,u))}function E(j){if(_()){R();return}L.unbindMouseMove();let S=H.select("domReferenceElement"),k=m0(S);if(L.restTimeout.clear(),L.restTimeoutPending=!1,M(j.relatedTarget))return;if(V.current&&B.current.floatingContext){if(!H.select("open"))L.openChangeTimeout.clear();let v=Y.current;L.handler=V.current({...B.current.floatingContext,tree:N,x:j.clientX,y:j.clientY,onClose(){if(R(),T(),q.current&&!_()&&v===H.select("domReferenceElement"))P(j,!0)}});let u=L.handler;u(j),k.addEventListener("mousemove",u),L.unbindMouseMove=()=>{k.removeEventListener("mousemove",u)};return}if(L.pointerType==="touch"?!f0(H.select("floatingElement"),j.relatedTarget):!0)P(j)}function I(j){y(j)}if(H.select("open"))w.addEventListener("mouseleave",I);if(U)w.addEventListener("mousemove",h,{once:!0});return w.addEventListener("mouseenter",h),w.addEventListener("mouseleave",E),()=>{if(w.removeEventListener("mouseleave",I),U)w.removeEventListener("mousemove",h);w.removeEventListener("mouseenter",h),w.removeEventListener("mouseleave",E)}},[T,R,B,A,P,H,Q,V,y,L,W,_,M,G,U,D,Y,N,q]),I6.useMemo(()=>{if(!Q)return;function w(h){L.pointerType=h.pointerType}return{onPointerDown:w,onPointerEnter:w,onMouseMove(h){let{nativeEvent:E}=h,I=h.currentTarget,j=H.select("domReferenceElement"),S=H.context.triggerElements,k=H.select("open"),b=(S.hasElement(h.target)||S.hasMatchingElement((u)=>f0(u,h.target)))&&(!j||!f0(j,h.target));if(G&&!c4(L.pointerType))return;if(k&&!b||fK(D.current)===0)return;if(!b&&L.restTimeoutPending&&h.movementX**2+h.movementY**2<2)return;L.restTimeout.clear();function v(){if(L.restTimeoutPending=!1,_())return;let u=H.select("open");if(!L.blockMouseMove&&(!u||b))H.setOpen(!0,M0(G0.triggerHover,E,I))}if(L.pointerType==="touch")RP.flushSync(()=>{v()});else if(b&&k)v();else L.restTimeoutPending=!0,L.restTimeout.start(fK(D.current),v)}}},[Q,L,_,G,H,D])}var R6=O(g(),1);function Z2($=[]){let Z=$.map((F)=>F?.reference),H=$.map((F)=>F?.floating),B=$.map((F)=>F?.item),J=$.map((F)=>F?.trigger),Q=R6.useCallback((F)=>BX(F,$,"reference"),Z),X=R6.useCallback((F)=>BX(F,$,"floating"),H),z=R6.useCallback((F)=>BX(F,$,"item"),B),G=R6.useCallback((F)=>BX(F,$,"trigger"),J);return R6.useMemo(()=>({getReferenceProps:Q,getFloatingProps:X,getItemProps:z,getTriggerProps:G}),[Q,X,z,G])}function BX($,Z,H){let B=new Map,J=H==="item",Q={};if(H==="floating")Q.tabIndex=-1,Q[AH]="";for(let X in $){if(J&&$){if(X===LK||X===AK)continue}Q[X]=$[X]}for(let X=0;X<Z.length;X+=1){let z,G=Z[X]?.[H];if(typeof G==="function")z=$?G($):null;else z=G;if(!z)continue;kP(Q,z,J,B)}return kP(Q,$,J,B),Q}function kP($,Z,H,B){for(let J in Z){let Q=Z[J];if(H&&(J===LK||J===AK))continue;if(!J.startsWith("on"))$[J]=Q;else{if(!B.has(J))B.set(J,[]);if(typeof Q==="function")B.get(J)?.push(Q),$[J]=(...X)=>{return B.get(J)?.map((z)=>z(...X)).find((z)=>z!==void 0)}}}}var H2=O(g(),1);var Ui="Escape";function QX($,Z,H){switch($){case"vertical":return Z;case"horizontal":return H;default:return Z||H}}function JX($,Z){return QX(Z,$===VH||$===A6,$===h8||$===x8)}function mK($,Z,H){return QX(Z,$===A6,H?$===h8:$===x8)||$==="Enter"||$===" "||$===""}function Yi($,Z,H){return QX(Z,H?$===h8:$===x8,$===A6)}function Ki($,Z,H,B){let J=H?$===x8:$===h8,Q=$===VH;if(Z==="both"||Z==="horizontal"&&B&&B>1)return $===Ui;return QX(Z,J,Q)}function pK($,Z){let H="rootStore"in $?$.rootStore:$,B=H.useState("open"),J=H.useState("floatingElement"),Q=H.useState("domReferenceElement"),X=H.context.dataRef,{listRef:z,activeIndex:G,onNavigate:F=()=>{},enabled:U=!0,selectedIndex:Y=null,allowEscape:K=!1,loopFocus:W=!1,nested:N=!1,rtl:L=!1,virtual:V=!1,focusItemOnOpen:A="auto",focusItemOnHover:D=!0,openOnArrowKeyDown:q=!0,disabledIndices:_=void 0,orientation:M="vertical",parentOrientation:P,cols:T=1,id:R,resetOnPointerLeave:y=!0,externalTree:w}=Z,h=q6(J),E=w5(h),I=e5(),j=k2(w);U0(()=>{X.current.orientation=M},[X,M]);let S=DH(Q),k=H2.useRef(A),b=H2.useRef(Y??-1),v=H2.useRef(null),u=H2.useRef(!0),C=Y0((m)=>{F(b.current===-1?null:b.current,m)}),t=H2.useRef(C),H0=H2.useRef(!!J),x=H2.useRef(B),e=H2.useRef(!1),L0=H2.useRef(!1),d=w5(_),X0=w5(B),K0=w5(Y),Q0=w5(y),z0=Y0(()=>{function m(O0){if(V)j?.events.emit("virtualfocus",O0);else j6(O0,{sync:e.current,preventScroll:!0})}let a=z.current[b.current],o=L0.current;if(a)m(a);(e.current?(O0)=>O0():requestAnimationFrame)(()=>{let O0=z.current[b.current]||a;if(!O0)return;if(!a)m(O0);if(i&&(o||!u.current))O0.scrollIntoView?.({block:"nearest",inline:"nearest"})})});U0(()=>{if(!U)return;if(B&&J){if(b.current=Y??-1,k.current&&Y!=null)L0.current=!0,C()}else if(H0.current)b.current=-1,t.current()},[U,B,J,Y,C]),U0(()=>{if(!U)return;if(!B){e.current=!1;return}if(!J)return;if(G==null){if(e.current=!1,K0.current!=null)return;if(H0.current)b.current=-1,z0();if((!x.current||!H0.current)&&k.current&&(v.current!=null||k.current===!0&&v.current==null)){let m=0,a=()=>{if(z.current[0]==null){if(m<2)(m?requestAnimationFrame:queueMicrotask)(a);m+=1}else b.current=v.current==null||mK(v.current,M,L)||N?bQ(z):qK(z),v.current=null,C()};a()}}else if(!l7(z,G))b.current=G,z0(),L0.current=!1},[U,B,J,G,K0,N,z,M,L,C,z0,d]),U0(()=>{if(!U||J||!j||V||!H0.current)return;let m=j.nodesRef.current,a=m.find((O0)=>O0.id===I)?.context?.elements.floating,o=Z5(m0(J)),D0=m.some((O0)=>O0.context&&f0(O0.context.elements.floating,o));if(a&&!D0&&u.current)a.focus({preventScroll:!0})},[U,J,j,I,V]),U0(()=>{t.current=C,x.current=B,H0.current=!!J}),U0(()=>{if(!B)v.current=null,k.current=A},[B,A]);let A0=G!=null,i=H2.useMemo(()=>{function m(o){if(!X0.current)return;let D0=z.current.indexOf(o.currentTarget);if(D0!==-1&&b.current!==D0)b.current=D0,C(o)}return{onFocus(o){e.current=!0,m(o)},onClick:({currentTarget:o})=>o.focus({preventScroll:!0}),onMouseMove(o){if(e.current=!0,L0.current=!1,D)m(o)},onPointerLeave(o){if(!X0.current||!u.current||o.pointerType==="touch")return;e.current=!0;let D0=o.relatedTarget;if(!D||z.current.includes(D0))return;if(!Q0.current)return;if(j6(null,{sync:!0}),b.current=-1,C(o),!V)E.current?.focus({preventScroll:!0})}}},[X0,E,D,z,C,Q0,V]),B0=H2.useCallback(()=>{return P??j?.nodesRef.current.find((m)=>m.id===I)?.context?.dataRef?.current.orientation},[I,j,P]),$0=Y0((m)=>{if(u.current=!1,e.current=!0,m.which===229)return;if(!X0.current&&m.currentTarget===E.current)return;if(N&&Ki(m.key,M,L,T)){if(!JX(m.key,B0()))a5(m);if(H.setOpen(!1,M0(G0.listNavigation,m.nativeEvent)),O5(Q))if(V)j?.events.emit("virtualfocus",Q);else Q.focus();return}let a=b.current,o=bQ(z,_),D0=qK(z,_);if(!S){if(m.key==="Home")a5(m),b.current=o,C(m);if(m.key==="End")a5(m),b.current=D0,C(m)}if(T>1){let O0=Array.from({length:z.current.length},()=>({width:1,height:1})),k0=EM(O0,T,!1),r0=k0.findIndex((Z0)=>Z0!=null&&!i7(z,Z0,_)),p=k0.reduce((Z0,V0,j0)=>V0!=null&&!i7(z,V0,_)?j0:Z0,-1),r=k0[wM({current:k0.map((Z0)=>Z0!=null?z.current[Z0]:null)},{event:m,orientation:M,loopFocus:W,rtl:L,cols:T,disabledIndices:IM([...(typeof _!=="function"?_:null)||z.current.map((Z0,V0)=>i7(z,V0,_)?V0:void 0),void 0],k0),minIndex:r0,maxIndex:p,prevIndex:SM(b.current>D0?o:b.current,O0,k0,T,m.key===A6?"bl":m.key===(L?h8:x8)?"tr":"tl"),stopEvent:!0})];if(r!=null)b.current=r,C(m);if(M==="both")return}if(JX(m.key,M)){if(a5(m),B&&!V&&Z5(m.currentTarget.ownerDocument)===m.currentTarget){b.current=mK(m.key,M,L)?o:D0,C(m);return}if(mK(m.key,M,L))if(W)if(a>=D0)if(K&&a!==z.current.length)b.current=-1;else e.current=!1,b.current=o;else b.current=P2(z,{startingIndex:a,disabledIndices:_});else b.current=Math.min(D0,P2(z,{startingIndex:a,disabledIndices:_}));else if(W)if(a<=o)if(K&&a!==-1)b.current=z.current.length;else e.current=!1,b.current=D0;else b.current=P2(z,{startingIndex:a,decrement:!0,disabledIndices:_});else b.current=Math.max(o,P2(z,{startingIndex:a,decrement:!0,disabledIndices:_}));if(l7(z,b.current))b.current=-1;C(m)}}),J0=H2.useMemo(()=>{return V&&B&&A0&&{"aria-activedescendant":`${R}-${G}`}},[V,B,A0,R,G]),n=H2.useMemo(()=>{return{"aria-orientation":M==="both"?void 0:M,...!S?J0:{},onKeyDown(m){if(m.key==="Tab"&&m.shiftKey&&B&&!V){let a=h1(m.nativeEvent);if(a&&!f0(E.current,a))return;if(a5(m),H.setOpen(!1,M0(G0.focusOut,m.nativeEvent)),O5(Q))Q.focus();return}$0(m)},onPointerMove(){u.current=!0}}},[J0,$0,E,M,S,H,B,V,Q]),f=H2.useMemo(()=>{function m(o){if(A==="auto"&&SQ(o.nativeEvent))k.current=!V}function a(o){if(k.current=A,A==="auto"&&IQ(o.nativeEvent))k.current=!0}return{onKeyDown(o){let D0=H.select("open");u.current=!1;let O0=o.key.startsWith("Arrow"),k0=Yi(o.key,B0(),L),r0=JX(o.key,M),p=(N?k0:r0)||o.key==="Enter"||o.key.trim()==="";if(V&&D0)return $0(o);if(!D0&&!q&&O0)return;if(p){let r=JX(o.key,B0());v.current=N&&r?null:o.key}if(N){if(k0)if(a5(o),D0)b.current=bQ(z,d.current),C(o);else H.setOpen(!0,M0(G0.listNavigation,o.nativeEvent,o.currentTarget));return}if(r0){if(K0.current!=null)b.current=K0.current;if(a5(o),!D0&&q)H.setOpen(!0,M0(G0.listNavigation,o.nativeEvent,o.currentTarget));else $0(o);if(D0)C(o)}return},onFocus(o){if(H.select("open")&&!V)b.current=-1,C(o)},onPointerDown:a,onPointerEnter:a,onMouseDown:m,onClick:m}},[$0,d,A,z,N,C,H,q,M,B0,L,K0,V]),l=H2.useMemo(()=>{return{...J0,...f}},[J0,f]);return H2.useMemo(()=>U?{reference:l,floating:n,item:i,trigger:f}:{},[U,l,n,f,i])}var Q3=O(g(),1);var Wi=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function k6($,Z={}){let H="rootStore"in $?$.rootStore:$,B=H.useState("open"),J=H.useState("floatingId"),Q=H.useState("domReferenceElement"),X=H.useState("floatingElement"),{role:z="dialog"}=Z,G=Y2(),F=Q?.id||G,U=Q3.useMemo(()=>q6(X)?.id||J,[X,J]),Y=Wi.get(z)??z,W=e5()!=null,N=Q3.useMemo(()=>{if(Y==="tooltip"||z==="label")return b1;return{"aria-haspopup":Y==="alertdialog"?"dialog":Y,"aria-expanded":"false",...Y==="listbox"&&{role:"combobox"},...Y==="menu"&&W&&{role:"menuitem"},...z==="select"&&{"aria-autocomplete":"none"},...z==="combobox"&&{"aria-autocomplete":"list"}}},[Y,W,z]),L=Q3.useMemo(()=>{if(Y==="tooltip"||z==="label")return{[`aria-${z==="label"?"labelledby":"describedby"}`]:B?U:void 0};return{...N,"aria-expanded":B?"true":"false","aria-controls":B?U:void 0,...Y==="menu"&&{id:F}}},[Y,U,B,F,z,N]),V=Q3.useMemo(()=>{let D={id:U,...Y&&{role:Y}};if(Y==="tooltip"||z==="label")return D;return{...D,...Y==="menu"&&{"aria-labelledby":F}}},[Y,U,F,z]),A=Q3.useCallback(({active:D,selected:q})=>{let _={role:"option",...D&&{id:`${U}-fui-option`}};switch(z){case"select":case"combobox":return{..._,"aria-selected":q};default:}return{}},[U,z]);return Q3.useMemo(()=>({reference:L,floating:V,item:A,trigger:N}),[L,V,N,A])}var X3=O(g(),1);function uK($,Z){let H="rootStore"in $?$.rootStore:$,B=H.context.dataRef,J=H.useState("open"),{listRef:Q,activeIndex:X,onMatch:z,onTypingChange:G,enabled:F=!0,resetMs:U=750,selectedIndex:Y=null}=Z,K=_5(),W=X3.useRef(""),N=X3.useRef(Y??X??-1),L=X3.useRef(null);U0(()=>{if(!J&&Y!==null)return;if(K.clear(),L.current=null,W.current!=="")W.current=""},[J,Y,K]),U0(()=>{if(J&&W.current==="")N.current=Y??X??-1},[J,Y,X]);let V=Y0((M)=>{if(M){if(!B.current.typing)B.current.typing=M,G?.(M)}else if(B.current.typing)B.current.typing=M,G?.(M)}),A=Y0((M)=>{function P(E,I,j){let S=I.find((k)=>k?.toLocaleLowerCase().indexOf(j.toLocaleLowerCase())===0);return S?E.indexOf(S):-1}let T=Q.current;if(W.current.length>0&&W.current[0]!==" "){if(P(T,T,W.current)===-1)V(!1);else if(M.key===" ")a5(M)}if(T==null||M.key.length!==1||M.ctrlKey||M.metaKey||M.altKey)return;if(J&&M.key!==" ")a5(M),V(!0);let R=W.current==="";if(R)N.current=Y??X??-1;if(T.every((E)=>E?E[0]?.toLocaleLowerCase()!==E[1]?.toLocaleLowerCase():!0)&&W.current===M.key)W.current="",N.current=L.current;W.current+=M.key,K.start(U,()=>{W.current="",N.current=L.current,V(!1)});let w=R?Y??X??-1:N.current,h=P(T,[...T.slice((w||0)+1),...T.slice(0,(w||0)+1)],W.current);if(h!==-1)z?.(h),L.current=h;else if(M.key!==" ")W.current="",V(!1)}),D=Y0((M)=>{let P=M.relatedTarget,T=H.select("domReferenceElement"),R=H.select("floatingElement"),y=f0(T,P),w=f0(R,P);if(y||w)return;K.clear(),W.current="",N.current=L.current,V(!1)}),q=X3.useMemo(()=>({onKeyDown:A,onBlur:D}),[A,D]),_=X3.useMemo(()=>{return{onKeyDown:A,onKeyUp(M){if(M.key===" ")V(!1)},onBlur:D}},[A,D,V]);return X3.useMemo(()=>F?{reference:q,floating:_}:{},[F,q,_])}function bP($,Z){let[H,B]=$,J=!1,Q=Z.length;for(let X=0,z=Q-1;X<Q;z=X++){let[G,F]=Z[X]||[0,0],[U,Y]=Z[z]||[0,0];if(F>=B!==Y>=B&&H<=(U-G)*(B-F)/(Y-F)+G)J=!J}return J}function Ni($,Z){return $[0]>=Z.x&&$[0]<=Z.x+Z.width&&$[1]>=Z.y&&$[1]<=Z.y+Z.height}function V8($={}){let{buffer:Z=0.5,blockPointerEvents:H=!1,requireIntent:B=!0}=$,J=new r5,Q=!1,X=null,z=null,G=typeof performance<"u"?performance.now():0;function F(Y,K){let W=performance.now(),N=W-G;if(X===null||z===null||N===0)return X=Y,z=K,G=W,null;let L=Y-X,V=K-z,D=Math.sqrt(L*L+V*V)/N;return X=Y,z=K,G=W,D}let U=({x:Y,y:K,placement:W,elements:N,onClose:L,nodeId:V,tree:A})=>{return function(q){function _(){J.clear(),L()}if(J.clear(),!N.domReference||!N.floating||W==null||Y==null||K==null)return;let{clientX:M,clientY:P}=q,T=[M,P],R=h1(q),y=q.type==="mouseleave",w=f0(N.floating,R),h=f0(N.domReference,R),E=N.domReference.getBoundingClientRect(),I=N.floating.getBoundingClientRect(),j=W.split("-")[0],S=Y>I.right-I.width/2,k=K>I.bottom-I.height/2,b=Ni(T,E),v=I.width>E.width,u=I.height>E.height,C=(v?E:I).left,t=(v?E:I).right,H0=(u?E:I).top,x=(u?E:I).bottom;if(w){if(Q=!0,!y)return}if(h)Q=!1;if(h&&!y){Q=!0;return}if(y&&T1(q.relatedTarget)&&f0(N.floating,q.relatedTarget))return;if(A&&v8(A.nodesRef.current,V).some(({context:d})=>d?.open))return;if(j==="top"&&K>=E.bottom-1||j==="bottom"&&K<=E.top+1||j==="left"&&Y>=E.right-1||j==="right"&&Y<=E.left+1)return _();let e=[];switch(j){case"top":e=[[C,E.top+1],[C,I.bottom-1],[t,I.bottom-1],[t,E.top+1]];break;case"bottom":e=[[C,I.top+1],[C,E.bottom-1],[t,E.bottom-1],[t,I.top+1]];break;case"left":e=[[I.right-1,x],[I.right-1,H0],[E.left+1,H0],[E.left+1,x]];break;case"right":e=[[E.right-1,x],[E.right-1,H0],[I.left+1,H0],[I.left+1,x]];break;default:}function L0([d,X0]){switch(j){case"top":{let K0=[v?d+Z/2:S?d+Z*4:d-Z*4,X0+Z+1],Q0=[v?d-Z/2:S?d+Z*4:d-Z*4,X0+Z+1],z0=[[I.left,S?I.bottom-Z:v?I.bottom-Z:I.top],[I.right,S?v?I.bottom-Z:I.top:I.bottom-Z]];return[K0,Q0,...z0]}case"bottom":{let K0=[v?d+Z/2:S?d+Z*4:d-Z*4,X0-Z],Q0=[v?d-Z/2:S?d+Z*4:d-Z*4,X0-Z],z0=[[I.left,S?I.top+Z:v?I.top+Z:I.bottom],[I.right,S?v?I.top+Z:I.bottom:I.top+Z]];return[K0,Q0,...z0]}case"left":{let K0=[d+Z+1,u?X0+Z/2:k?X0+Z*4:X0-Z*4],Q0=[d+Z+1,u?X0-Z/2:k?X0+Z*4:X0-Z*4];return[...[[k?I.right-Z:u?I.right-Z:I.left,I.top],[k?u?I.right-Z:I.left:I.right-Z,I.bottom]],K0,Q0]}case"right":{let K0=[d-Z,u?X0+Z/2:k?X0+Z*4:X0-Z*4],Q0=[d-Z,u?X0-Z/2:k?X0+Z*4:X0-Z*4],z0=[[k?I.left+Z:u?I.left+Z:I.right,I.top],[k?u?I.left+Z:I.right:I.left+Z,I.bottom]];return[K0,Q0,...z0]}default:return[]}}if(bP([M,P],e))return;if(Q&&!b)return _();if(!y&&B){let d=F(q.clientX,q.clientY),X0=0.1;if(d!==null&&d<0.1)return _()}if(!bP([M,P],L0([Y,K])))_();else if(!Q&&B)J.start(40,_);return}};return U.__options={blockPointerEvents:H},U}var hP=O(c(),1),$$=zX.forwardRef(function(Z,H){let{children:B,container:J,className:Q,render:X,...z}=Z,{portalNode:G,portalSubtree:F}=eQ({container:J,ref:H,componentProps:Z,elementProps:z});if(!F&&!G)return null;return hP.jsxs(zX.Fragment,{children:[F,G&&yP.createPortal(B,G)]})});var xP=$$;var z3=O(g(),1);var C4=O(g(),1);var GX=O(g(),1),Li=GX.createContext(void 0);function i4(){return GX.useContext(Li)?.direction??"ltr"}var Ai=($)=>({name:"arrow",options:$,async fn(Z){let{x:H,y:B,placement:J,rects:Q,platform:X,elements:z,middlewareData:G}=Z,{element:F,padding:U=0,offsetParent:Y="real"}=gP($,Z)||{};if(F==null)return{};let K=pP(U),W={x:H,y:B},N=mP(J),L=fP(N),V=await X.getDimensions(F),A=N==="y",D=A?"top":"left",q=A?"bottom":"right",_=A?"clientHeight":"clientWidth",M=Q.reference[L]+Q.reference[N]-W[N]-Q.floating[L],P=W[N]-Q.reference[N],T=Y==="real"?await X.getOffsetParent?.(F):z.floating,R=z.floating[_]||Q.floating[L];if(!R||!await X.isElement?.(T))R=z.floating[_]||Q.floating[L];let y=M/2-P/2,w=R/2-V[L]/2-1,h=Math.min(K[D],w),E=Math.min(K[q],w),I=h,j=R-V[L]-E,S=R/2-V[L]/2+y,k=vP(I,S,j),b=!G.arrow&&SH(J)!=null&&S!==k&&Q.reference[L]/2-(S<I?h:E)-V[L]/2<0,v=b?S<I?S-I:S-j:0;return{[N]:W[N]+v,data:{[N]:k,centerOffset:S-k-v,...b&&{alignmentOffset:v}},reset:b}}}),uP=($,Z)=>({...Ai($),options:[$,Z]});var cP={name:"hide",async fn($){let{width:Z,height:H,x:B,y:J}=$.rects.reference,Q=Z===0&&H===0&&B===0&&J===0;return{data:{referenceHidden:(await aK().fn($)).data?.referenceHidden||Q}}}};var IH={sideX:"left",sideY:"top"},Z$={name:"adaptiveOrigin",async fn($){let{x:Z,y:H,rects:{floating:B},elements:{floating:J},platform:Q,strategy:X,placement:z}=$,G=S2(J),F=G.getComputedStyle(J);if(!(F.transitionDuration!=="0s"&&F.transitionDuration!==""))return{x:Z,y:H,data:IH};let Y=await Q.getOffsetParent?.(J),K={width:0,height:0};if(X==="fixed"&&G?.visualViewport)K={width:G.visualViewport.width,height:G.visualViewport.height};else if(Y===G){let D=m0(J);K={width:D.documentElement.clientWidth,height:D.documentElement.clientHeight}}else if(await Q.isElement?.(Y))K=await Q.getDimensions(Y);let W=b6(z),N=Z,L=H;if(W==="left")N=K.width-(Z+B.width);if(W==="top")L=K.height-(H+B.height);let V=W==="left"?"right":IH.sideX,A=W==="top"?"bottom":IH.sideY;return{x:N,y:L,data:{sideX:V,sideY:A}}}};function iP($,Z,H){let B=$==="inline-start"||$==="inline-end";return{top:"top",right:B?H?"inline-start":"inline-end":"right",bottom:"bottom",left:B?H?"inline-end":"inline-start":"left"}[Z]}function dP($,Z,H){let{rects:B,placement:J}=$;return{side:iP(Z,b6(J),H),align:SH(J)||"center",anchor:{width:B.reference.width,height:B.reference.height},positioner:{width:B.floating.width,height:B.floating.height}}}function n8($){let{anchor:Z,positionMethod:H="absolute",side:B="bottom",sideOffset:J=0,align:Q="center",alignOffset:X=0,collisionBoundary:z,collisionPadding:G=5,sticky:F=!1,arrowPadding:U=5,disableAnchorTracking:Y=!1,keepMounted:K=!1,floatingRootContext:W,mounted:N,collisionAvoidance:L,shiftCrossAxis:V=!1,nodeId:A,adaptiveOrigin:D,lazyFlip:q=!1,externalTree:_}=$,[M,P]=C4.useState(null);if(!N&&M!==null)P(null);let T=L.side||"flip",R=L.align||"flip",y=L.fallbackAxisSide||"end",w=typeof Z==="function"?Z:void 0,h=Y0(w),E=w?h:Z,I=w5(Z),S=i4()==="rtl",k=M||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":S?"left":"right","inline-start":S?"right":"left"}[B],b=Q==="center"?k:`${k}-${Q}`,v=G,u=1,C=B==="bottom"?u:0,t=B==="top"?u:0,H0=B==="right"?u:0,x=B==="left"?u:0;if(typeof v==="number")v={top:v+C,right:v+x,bottom:v+t,left:v+H0};else if(v)v={top:(v.top||0)+C,right:(v.right||0)+x,bottom:(v.bottom||0)+t,left:(v.left||0)+H0};let e={boundary:z==="clipping-ancestors"?"clippingAncestors":z,padding:v},L0=C4.useRef(null),d=w5(J),X0=w5(X),z0=[cK((p0)=>{let s0=dP(p0,B,S),N0=typeof d.current==="function"?d.current(s0):d.current,b0=typeof X0.current==="function"?X0.current(s0):X0.current;return{mainAxis:N0,crossAxis:b0,alignmentAxis:b0}},[typeof J!=="function"?J:0,typeof X!=="function"?X:0,S,B])],A0=R==="none"&&T!=="shift",i=!A0&&(F||V||T==="shift"),B0=T==="none"?null:iK({...e,padding:{top:v.top+u,right:v.right+u,bottom:v.bottom+u,left:v.left+u},mainAxis:!V&&T==="flip",crossAxis:R==="flip"?"alignment":!1,fallbackAxisSideDirection:y}),$0=A0?null:dK((p0)=>{let s0=m0(p0.elements.floating).documentElement;return{...e,rootBoundary:V?{x:0,y:0,width:s0.clientWidth,height:s0.clientHeight}:void 0,mainAxis:R!=="none",crossAxis:i,limiter:F||V?void 0:lK((N0)=>{if(!L0.current)return{};let{width:b0,height:K1}=L0.current.getBoundingClientRect(),T0=nK(b6(N0.placement)),I0=T0==="y"?b0:K1,g0=T0==="y"?v.left+v.right:v.top+v.bottom;return{offset:I0/2+g0/2}})}},[e,F,V,v,R]);if(T==="shift"||R==="shift"||Q==="center")z0.push($0,B0);else z0.push(B0,$0);z0.push(rK({...e,apply({elements:{floating:p0},rects:{reference:s0},availableWidth:N0,availableHeight:b0}){let K1=p0.style;K1.setProperty("--available-width",`${N0}px`),K1.setProperty("--available-height",`${b0}px`),K1.setProperty("--anchor-width",`${s0.width}px`),K1.setProperty("--anchor-height",`${s0.height}px`)}}),uP(()=>({element:L0.current||document.createElement("div"),padding:U,offsetParent:"floating"}),[U]),{name:"transformOrigin",fn(p0){let{elements:s0,middlewareData:N0,placement:b0,rects:K1,y:T0}=p0,I0=b6(b0),g0=nK(I0),e0=L0.current,l0=N0.arrow?.x||0,L1=N0.arrow?.y||0,f1=e0?.clientWidth||0,m1=e0?.clientHeight||0,M1=l0+f1/2,q5=L1+m1/2,p5=Math.abs(N0.shift?.y||0),i5=K1.reference.height/2,x0=typeof J==="function"?J(dP(p0,B,S)):J,Q1=p5>x0,u0={top:`${M1}px calc(100% + ${x0}px)`,bottom:`${M1}px ${-x0}px`,left:`calc(100% + ${x0}px) ${q5}px`,right:`${-x0}px ${q5}px`}[I0],A1=`${M1}px ${K1.reference.y+i5-T0}px`;return s0.floating.style.setProperty("--transform-origin",i&&g0==="y"&&Q1?A1:u0),{}}},cP,D),U0(()=>{if(!N&&W)W.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[N,W]);let J0=C4.useMemo(()=>({elementResize:!Y&&typeof ResizeObserver<"u",layoutShift:!Y&&typeof IntersectionObserver<"u"}),[Y]),{refs:n,elements:f,x:l,y:m,middlewareData:a,update:o,placement:D0,context:O0,isPositioned:k0,floatingStyles:r0}=xK({rootContext:W,placement:b,middleware:z0,strategy:H,whileElementsMounted:K?void 0:(...p0)=>XX(...p0,J0),nodeId:A,externalTree:_}),{sideX:p,sideY:r}=a.adaptiveOrigin||IH,Z0=k0?H:"fixed",V0=C4.useMemo(()=>{let p0=D?{position:Z0,[p]:l,[r]:m}:{position:Z0,...r0};if(!k0)p0.opacity=0;return p0},[D,Z0,p,l,r,m,r0,k0]),j0=C4.useRef(null);U0(()=>{if(!N)return;let p0=I.current,s0=typeof p0==="function"?p0():p0,b0=(lP(s0)?s0.current:s0)||null||null;if(b0!==j0.current)n.setPositionReference(b0),j0.current=b0},[N,n,E,I]),C4.useEffect(()=>{if(!N)return;let p0=I.current;if(typeof p0==="function")return;if(lP(p0)&&p0.current!==j0.current)n.setPositionReference(p0.current),j0.current=p0.current},[N,n,E,I]),C4.useEffect(()=>{if(K&&N&&f.domReference&&f.floating)return XX(f.domReference,f.floating,o,J0);return},[K,N,f,o,J0]);let v0=b6(D0),z1=iP(B,v0,S),Y1=SH(D0)||"center",c0=Boolean(a.hide?.referenceHidden);U0(()=>{if(q&&N&&k0)P(v0)},[q,N,k0,v0]);let R0=C4.useMemo(()=>({position:"absolute",top:a.arrow?.y,left:a.arrow?.x}),[a.arrow]),d0=a.arrow?.centerOffset!==0;return C4.useMemo(()=>({positionerStyles:V0,arrowStyles:R0,arrowRef:L0,arrowUncentered:d0,side:z1,align:Y1,physicalSide:v0,anchorHidden:c0,refs:n,context:O0,isPositioned:k0,update:o}),[V0,R0,L0,d0,z1,Y1,v0,c0,n,O0,k0,o])}function lP($){return $!=null&&"current"in $}var w4=function($){return $.open="data-open",$.closed="data-closed",$[$.startingStyle=m8.startingStyle]="startingStyle",$[$.endingStyle=m8.endingStyle]="endingStyle",$.anchorHidden="data-anchor-hidden",$.side="data-side",$.align="data-align",$}({}),RH=function($){return $.popupOpen="data-popup-open",$.pressed="data-pressed",$}({}),Vi={[RH.popupOpen]:""},Di={[RH.popupOpen]:"",[RH.pressed]:""},qi={[w4.open]:""},Mi={[w4.closed]:""},Pi={[w4.anchorHidden]:""},o8={open($){if($)return Vi;return null}},kH={open($){if($)return Di;return null}},P1={open($){if($)return qi;return Mi},anchorHidden($){if($)return Pi;return null}};function K2($){return $==="starting"?rP:b1}var FX=O(g(),1),oK=FX.createContext(void 0);function aP(){let $=FX.useContext(oK);if($===void 0)throw Error(E0(84));return $}var nP=O(c(),1),oP=z3.forwardRef(function(Z,H){let{toast:B,...J}=Z,Q=s9(),X=B.positionerProps??b1,{render:z,className:G,anchor:F=X.anchor,positionMethod:U=X.positionMethod??"absolute",side:Y=X.side??"top",align:K=X.align??"center",sideOffset:W=X.sideOffset??0,alignOffset:N=X.alignOffset??0,collisionBoundary:L=X.collisionBoundary??"clipping-ancestors",collisionPadding:V=X.collisionPadding??5,arrowPadding:A=X.arrowPadding??5,sticky:D=X.sticky??!1,disableAnchorTracking:q=X.disableAnchorTracking??!1,collisionAvoidance:_=X.collisionAvoidance??s8,...M}=J,[P,T]=z3.useState(null),R=Q.useState("toastIndex",B.id),y=Q.useState("toastVisibleIndex",B.id),w=T1(F)?F:null,h=wH({open:!0,onOpenChange:l1,elements:{floating:P,reference:w}}),E=n8({anchor:w,positionMethod:U,floatingRootContext:h,mounted:!0,side:Y,sideOffset:W,align:K,alignOffset:N,collisionBoundary:L,collisionPadding:V,sticky:D,arrowPadding:A,disableAnchorTracking:q,keepMounted:!0,collisionAvoidance:_}),I=z3.useMemo(()=>{let b={};return{role:"presentation",style:{...E.positionerStyles,...b,[u8.index]:B.transitionStatus==="ending"?R:y}}},[E.positionerStyles,B.transitionStatus,R,y]),j=z3.useMemo(()=>({side:E.side,align:E.align,anchorHidden:E.anchorHidden}),[E.side,E.align,E.anchorHidden]),S=z3.useMemo(()=>({...j,arrowRef:E.arrowRef,arrowStyles:E.arrowStyles,arrowUncentered:E.arrowUncentered}),[j,E.arrowRef,E.arrowStyles,E.arrowUncentered]),k=F0("div",Z,{state:j,props:[I,K2(B.transitionStatus),M],ref:[H,T],stateAttributesMapping:P1});return nP.jsx(oK.Provider,{value:S,children:k})});var sP=O(g(),1);var tP=sP.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,{arrowRef:X,side:z,align:G,arrowUncentered:F,arrowStyles:U}=aP();return F0("div",Z,{state:{side:z,align:G,uncentered:F},ref:[H,X],props:[{style:U,"aria-hidden":!0},Q]})});var UX=O(g(),1);function eP(){let $=UX.useContext(KH);if(!$)throw Error(E0(73));let Z=$.useState("toasts");return UX.useMemo(()=>({toasts:Z,add:$.addToast,close:$.closeToast,update:$.updateToast,promise:$.promiseToast}),[Z,$])}function $_(){let $=new Set;function Z(H){$.forEach((B)=>B(H))}return{" subscribe":function(B){return $.add(B),()=>{$.delete(B)}},add(H){let B=H.id||PQ("toast"),J={...H,id:B,transitionStatus:"starting"};return Z({action:"add",options:J}),B},close(H){Z({action:"close",options:{id:H}})},update(H,B){Z({action:"update",options:{...B,id:H}})},promise(H,B){let J=H;return Z({action:"promise",options:{...B,promise:H,setPromise(Q){J=Q}}}),J}}}var x1=O(c(),1),r4=b2.createToastManager();function _i({...$}){return x1.jsx(b2.Provider,{...$})}function Oi({...$}){return x1.jsx(b2.Portal,{"data-slot":"toast-portal",...$})}function ji({className:$,...Z}){return x1.jsx(b2.Viewport,{"data-slot":"toast-viewport",className:s("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",$),...Z})}function Ti({className:$,...Z}){return x1.jsx(b2.Root,{"data-slot":"toast",className:s("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl border bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",$),...Z})}function Ci({className:$,...Z}){return x1.jsx(b2.Content,{"data-slot":"toast-content",className:s("flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",$),...Z})}function wi({className:$,...Z}){return x1.jsx(b2.Title,{"data-slot":"toast-title",className:s("text-sm font-medium",$),...Z})}function Ei({className:$,...Z}){return x1.jsx(b2.Description,{"data-slot":"toast-description",className:s("text-sm text-muted-foreground",$),...Z})}function Si({className:$,render:Z=x1.jsx(C0,{variant:"outline",size:"sm"}),...H}){return x1.jsx(b2.Action,{"data-slot":"toast-action",render:Z,className:s("shrink-0",$),...H})}function Ii({className:$,children:Z,render:H=x1.jsx(C0,{variant:"ghost",size:"icon-sm"}),...B}){return x1.jsx(b2.Close,{"data-slot":"toast-close","aria-label":"Close toast",render:H,className:s("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",$),...B,children:Z??x1.jsx(S5,{"aria-hidden":"true",stroke:1.75})})}function Ri({type:$}){let Z=null;if($==="success")Z=x1.jsx(H_,{"aria-hidden":"true",stroke:1.75});if($==="info")Z=x1.jsx(B_,{"aria-hidden":"true",stroke:1.75});if($==="warning")Z=x1.jsx(YX,{"aria-hidden":"true",stroke:1.75});if($==="error")Z=x1.jsx(Z_,{className:"text-destructive","aria-hidden":"true",stroke:1.75});if($==="loading")Z=x1.jsx(J_,{className:"animate-spin","aria-hidden":"true",stroke:1.75});if(!Z)return null;return x1.jsx("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:Z})}function ki(){let{toasts:$}=b2.useToastManager();return $.map((Z)=>x1.jsx(Ti,{toast:Z,children:x1.jsxs(Ci,{children:[x1.jsx(Ri,{type:Z.type}),x1.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[x1.jsx(wi,{}),x1.jsx(Ei,{})]}),x1.jsx(Si,{}),x1.jsx(Ii,{})]})},Z.id))}function Q_({children:$,toastManager:Z=r4,...H}){return x1.jsxs(_i,{toastManager:Z,...H,children:[$,x1.jsx(Oi,{children:x1.jsx(ji,{children:x1.jsx(ki,{})})})]})}var sL0=b2.createToastManager,tL0=b2.useToastManager;var k9={};O4(k9,{createHandle:()=>y_,Viewport:()=>b_,Trigger:()=>L_,Root:()=>U_,Provider:()=>T_,Positioner:()=>M_,Portal:()=>D_,Popup:()=>__,Handle:()=>DX,Arrow:()=>j_});var e8=O(g(),1);var X_=O(g(),1);function t8($){let Z=X_.useRef(!0);if(Z.current)Z.current=!1,$()}var KX=O(g(),1),sK=KX.createContext(void 0);function a4($){let Z=KX.useContext(sK);if(Z===void 0&&!$)throw Error(E0(72));return Z}var z_=O(g(),1),G_=O(F4(),1);var bi={...r8,disabled:S0(($)=>$.disabled),instantType:S0(($)=>$.instantType),isInstantPhase:S0(($)=>$.isInstantPhase),trackCursorAxis:S0(($)=>$.trackCursorAxis),disableHoverablePopup:S0(($)=>$.disableHoverablePopup),lastOpenChangeReason:S0(($)=>$.openChangeReason),closeDelay:S0(($)=>$.closeDelay),hasViewport:S0(($)=>$.hasViewport)};class H$ extends r2{constructor($){super({...yi(),...$},{popupRef:z_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new n2},bi)}setOpen=($,Z)=>{let H=Z.reason,B=H===G0.triggerHover,J=$&&H===G0.triggerFocus,Q=!$&&(H===G0.triggerPress||H===G0.escapeKey);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let X=()=>{let z={open:$,openChangeReason:H};if(J)z.instantType="focus";else if(Q)z.instantType="dismiss";else if(H===G0.triggerHover)z.instantType=void 0;let G=Z.trigger?.id??null;if(G||$)z.activeTriggerId=G,z.activeTriggerElement=Z.trigger??null;this.update(z)};if(B)G_.flushSync(X);else X()};static useStore($,Z){let H=k1(()=>{return new H$(Z)}).current,B=$??H,J=L8({popupStore:B,onOpenChange:B.setOpen});return B.state.floatingRootContext=J,B}}function yi(){return{...i8(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}var F_=O(c(),1),U_=NH(function(Z){let{disabled:H=!1,defaultOpen:B=!1,open:J,disableHoverablePopup:Q=!1,trackCursorAxis:X="none",actionsRef:z,onOpenChange:G,onOpenChangeComplete:F,handle:U,triggerId:Y,defaultTriggerId:K=null,children:W}=Z,N=H$.useStore(U?.store,{open:B,openProp:J,activeTriggerId:K,triggerIdProp:Y});t8(()=>{if(J===void 0&&N.state.open===!1&&B===!0)N.update({open:!0,activeTriggerId:K})}),N.useControlledProp("openProp",J),N.useControlledProp("triggerIdProp",Y),N.useContextCallback("onOpenChange",G),N.useContextCallback("onOpenChangeComplete",F);let L=N.useState("open"),V=!H&&L,A=N.useState("activeTriggerId"),D=N.useState("payload");N.useSyncedValues({trackCursorAxis:X,disableHoverablePopup:Q}),U0(()=>{if(L&&H)N.setOpen(!1,M0(G0.disabled))},[L,H,N]),N.useSyncedValue("disabled",H),d8(N);let{forceUnmount:q,transitionStatus:_}=l8(V,N),M=N.useState("isInstantPhase"),P=N.useState("instantType"),T=N.useState("lastOpenChangeReason"),R=e8.useRef(null);U0(()=>{if(_==="ending"&&T===G0.none||_!=="ending"&&M){if(P!=="delay")R.current=P;N.set("instantType","delay")}else if(R.current!==null)N.set("instantType",R.current),R.current=null},[_,M,T,P,N]),U0(()=>{if(V){if(A==null)N.set("payload",void 0)}},[N,A,V]);let y=e8.useCallback(()=>{N.setOpen(!1,hi(N,G0.imperativeAction))},[N]);e8.useImperativeHandle(z,()=>({unmount:q,close:y}),[q,y]);let w=N.useState("floatingRootContext"),h=N8(w,{enabled:!H,referencePress:!0}),E=yK(w,{enabled:!H&&X!=="none",axis:X==="none"?void 0:X}),{getReferenceProps:I,getFloatingProps:j,getTriggerProps:S}=Z2([h,E]),k=e8.useMemo(()=>I(),[I]),b=e8.useMemo(()=>S(),[S]),v=e8.useMemo(()=>j(),[j]);return N.useSyncedValues({activeTriggerProps:k,inactiveTriggerProps:b,popupProps:v}),F_.jsx(sK.Provider,{value:N,children:typeof W==="function"?W({payload:D}):W})});function hi($,Z){let H=M0(Z);return H.preventUnmountOnClose=()=>{$.set("preventUnmountingOnClose",!0)},H}var N_=O(g(),1);function Z1($){return Y2($,"base-ui")}var WX=O(g(),1),tK=WX.createContext(void 0);function Y_(){return WX.useContext(tK)}var K_=function($){return $[$.popupOpen=RH.popupOpen]="popupOpen",$.triggerDisabled="data-trigger-disabled",$}({});var W_=600;var L_=AQ(function(Z,H){let{className:B,render:J,handle:Q,payload:X,disabled:z,delay:G,closeDelay:F,id:U,...Y}=Z,K=a4(!0),W=Q?.store??K;if(!W)throw Error(E0(82));let N=Z1(U),L=W.useState("isTriggerActive",N),V=W.useState("isOpenedByTrigger",N),A=W.useState("floatingRootContext"),D=N_.useRef(null),q=G??W_,_=F??0,{registerTrigger:M,isMountedByThisTrigger:P}=c8(N,D,W,{payload:X,closeDelay:_}),T=Y_(),{delayRef:R,isInstantPhase:y,hasProvider:w}=EK(A,{open:V});W.useSyncedValue("isInstantPhase",y);let h=W.useState("disabled"),E=z??h,I=W.useState("trackCursorAxis"),j=W.useState("disableHoverablePopup"),S=A8(A,{enabled:!E,mouseOnly:!0,move:!1,handleClose:!j&&I!=="both"?V8():null,restMs(){let C=T?.delay,t=typeof R.current==="object"?R.current.open:void 0,H0=q;if(w)if(t!==0)H0=G??C??q;else H0=0;return H0},delay(){let C=typeof R.current==="object"?R.current.close:void 0,t=_;if(F==null&&w)t=C;return{close:t}},triggerElementRef:D,isActiveTrigger:L}),k=S6(A,{enabled:!E}).reference,b={open:V},v=W.useState("triggerProps",P);return F0("button",Z,{state:b,ref:[H,M,D],props:[S,k,v,{id:N,[K_.triggerDisabled]:E?"":void 0},Y],stateAttributesMapping:o8})});var V_=O(g(),1);var NX=O(g(),1),eK=NX.createContext(void 0);function A_(){let $=NX.useContext(eK);if($===void 0)throw Error(E0(70));return $}var $W=O(c(),1),D_=V_.forwardRef(function(Z,H){let{keepMounted:B=!1,...J}=Z;if(!(a4().useState("mounted")||B))return null;return $W.jsx(eK.Provider,{value:B,children:$W.jsx($$,{ref:H,...J})})});var J$=O(g(),1);var LX=O(g(),1),ZW=LX.createContext(void 0);function B$(){let $=LX.useContext(ZW);if($===void 0)throw Error(E0(71));return $}var q_=O(c(),1),M_=J$.forwardRef(function(Z,H){let{render:B,className:J,anchor:Q,positionMethod:X="absolute",side:z="top",align:G="center",sideOffset:F=0,alignOffset:U=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:K=5,arrowPadding:W=5,sticky:N=!1,disableAnchorTracking:L=!1,collisionAvoidance:V=s8,...A}=Z,D=a4(),q=A_(),_=D.useState("open"),M=D.useState("mounted"),P=D.useState("trackCursorAxis"),T=D.useState("disableHoverablePopup"),R=D.useState("floatingRootContext"),y=D.useState("instantType"),w=D.useState("transitionStatus"),h=D.useState("hasViewport"),E=n8({anchor:Q,positionMethod:X,floatingRootContext:R,mounted:M,side:z,sideOffset:F,align:G,alignOffset:U,collisionBoundary:Y,collisionPadding:K,sticky:N,arrowPadding:W,disableAnchorTracking:L,keepMounted:q,collisionAvoidance:V,adaptiveOrigin:h?Z$:void 0}),I=J$.useMemo(()=>{let b={};if(!_||P==="both"||T)b.pointerEvents="none";return{role:"presentation",hidden:!M,style:{...E.positionerStyles,...b}}},[_,P,T,M,E.positionerStyles]),j=J$.useMemo(()=>({open:_,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:P!=="none"?"tracking-cursor":y}),[_,E.side,E.align,E.anchorHidden,P,y]),S=J$.useMemo(()=>({...j,arrowRef:E.arrowRef,arrowStyles:E.arrowStyles,arrowUncentered:E.arrowUncentered}),[j,E.arrowRef,E.arrowStyles,E.arrowUncentered]),k=F0("div",Z,{state:j,props:[I,K2(w),A],ref:[H,D.useStateSetter("positionerElement")],stateAttributesMapping:P1});return q_.jsx(ZW.Provider,{value:S,children:k})});var P_=O(g(),1);var xi={...P1,...i1},__=P_.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,X=a4(),{side:z,align:G}=B$(),F=X.useState("open"),U=X.useState("instantType"),Y=X.useState("transitionStatus"),K=X.useState("popupProps"),W=X.useState("floatingRootContext");y5({open:F,ref:X.context.popupRef,onComplete(){if(F)X.context.onOpenChangeComplete?.(!0)}});let N=X.useState("disabled"),L=X.useState("closeDelay");return R9(W,{enabled:!N,closeDelay:L}),F0("div",Z,{state:{open:F,side:z,align:G,instant:U,transitionStatus:Y},ref:[H,X.context.popupRef,X.useStateSetter("popupElement")],props:[K,K2(Y),Q],stateAttributesMapping:xi})});var O_=O(g(),1);var j_=O_.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,z=a4().useState("instantType"),{open:G,arrowRef:F,side:U,align:Y,arrowUncentered:K,arrowStyles:W}=B$();return F0("div",Z,{state:{open:G,side:U,align:Y,uncentered:K,instant:z},ref:[H,F],props:[{style:W,"aria-hidden":!0},Q],stateAttributesMapping:P1})});var HW=O(g(),1);var BW=O(c(),1),T_=function(Z){let{delay:H,closeDelay:B,timeout:J=400}=Z,Q=HW.useMemo(()=>({delay:H,closeDelay:B}),[H,B]),X=HW.useMemo(()=>({open:H,close:B}),[H,B]);return BW.jsx(tK.Provider,{value:Q,children:BW.jsx(wK,{delay:X,timeoutMs:J,children:Z.children})})};var k_=O(g(),1);var C_=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var y2=O(g(),1);var w_=O(g(),1);function E_($){let[Z,H]=w_.useState({current:$,previous:null});if($!==Z.current)H({current:$,previous:Z.current});return Z.previous}var y6=O(g(),1);function QW($){let Z=o7($),H=parseFloat(Z.width)||0,B=parseFloat(Z.height)||0,J=O5($),Q=J?$.offsetWidth:H,X=J?$.offsetHeight:B;if(JW(H)!==Q||JW(B)!==X)H=Q,B=X;return{width:H,height:B}}var vi=typeof ResizeObserver<"u",gi=()=>!0;function I_($){let{popupElement:Z,positionerElement:H,content:B,mounted:J,enabled:Q=gi,onMeasureLayout:X,onMeasureLayoutComplete:z,side:G,direction:F}=$,U=p8(Z,!0,!1),Y=G4(),K=y6.useRef(null),W=y6.useRef(null),N=y6.useRef(!0),L=y6.useRef(l1),V=Y0(X),A=Y0(z),D=y6.useMemo(()=>{let q=G==="top",_=G==="left";if(F==="rtl")q=q||G==="inline-end",_=_||G==="inline-end";else q=q||G==="inline-start",_=_||G==="inline-start";return q?{position:"absolute",[G==="top"?"bottom":"top"]:"0",[_?"right":"left"]:"0"}:b1},[G,F]);U0(()=>{if(!J||!Q()||!vi){L.current=l1,N.current=!0,K.current=null,W.current=null;return}if(!Z||!H)return;L.current=S_(Z,D);let q=new ResizeObserver((I)=>{let j=I[0];if(j)W.current={width:Math.ceil(j.borderBoxSize[0].inlineSize),height:Math.ceil(j.borderBoxSize[0].blockSize)}});q.observe(Z),AX(Z,"auto");let _=VX(Z,"position","static"),M=VX(Z,"transform","none"),P=VX(Z,"scale","1"),T=S_(H,{"--available-width":"max-content","--available-height":"max-content"});function R(){_(),M(),T()}function y(){R(),P()}if(V?.(),N.current||K.current===null){bH(H,"max-content");let I=QW(Z);return K.current=I,bH(H,I),y(),A?.(null,I),N.current=!1,()=>{q.disconnect(),L.current(),L.current=l1}}AX(Z,"auto"),bH(H,"max-content");let w=K.current??W.current,h=QW(Z);if(K.current=h,!w)return bH(H,h),y(),A?.(null,h),()=>{q.disconnect(),Y.cancel(),L.current(),L.current=l1};AX(Z,w),y(),A?.(w,h),bH(H,h);let E=new AbortController;return Y.request(()=>{AX(Z,h),U(()=>{Z.style.setProperty("--popup-width","auto"),Z.style.setProperty("--popup-height","auto")},E.signal)}),()=>{q.disconnect(),E.abort(),Y.cancel(),L.current(),L.current=l1}},[B,Z,H,U,Y,Q,J,V,A,D])}function VX($,Z,H){let B=$.style.getPropertyValue(Z);return $.style.setProperty(Z,H),()=>{$.style.setProperty(Z,B)}}function S_($,Z){let H=[];for(let[B,J]of Object.entries(Z))H.push(VX($,B,J));return H.length?()=>{H.forEach((B)=>B())}:l1}function AX($,Z){let H=Z==="auto"?"auto":`${Z.width}px`,B=Z==="auto"?"auto":`${Z.height}px`;$.style.setProperty("--popup-width",H),$.style.setProperty("--popup-height",B)}function bH($,Z){let H=Z==="max-content"?"max-content":`${Z.width}px`,B=Z==="max-content"?"max-content":`${Z.height}px`;$.style.setProperty("--positioner-width",H),$.style.setProperty("--positioner-height",B)}var Q$=O(c(),1);function X$($){let{store:Z,side:H,cssVars:B,children:J}=$,Q=i4(),X=Z.useState("activeTriggerElement"),z=Z.useState("activeTriggerId"),G=Z.useState("open"),F=Z.useState("payload"),U=Z.useState("mounted"),Y=Z.useState("popupElement"),K=Z.useState("positionerElement"),W=E_(G?X:null),N=pi(z,F),L=y2.useRef(null),[V,A]=y2.useState(null),[D,q]=y2.useState(null),_=y2.useRef(null),M=y2.useRef(null),P=p8(_,!0,!1),T=G4(),[R,y]=y2.useState(null),[w,h]=y2.useState(!1);U0(()=>{return Z.set("hasViewport",!0),()=>{Z.set("hasViewport",!1)}},[Z]);let E=Y0(()=>{_.current?.style.setProperty("animation","none"),_.current?.style.setProperty("transition","none"),M.current?.style.setProperty("display","none")}),I=Y0((v)=>{if(_.current?.style.removeProperty("animation"),_.current?.style.removeProperty("transition"),M.current?.style.removeProperty("display"),v)y(v)}),j=y2.useRef(null);U0(()=>{if(X&&W&&X!==W&&j.current!==X&&L.current){A(L.current),h(!0);let v=mi(W,X);q(v),T.request(()=>{T.request(()=>{h(!1),P(()=>{A(null),y(null),L.current=null})})}),j.current=X}},[X,W,V,P,T]),U0(()=>{let v=_.current;if(!v)return;let u=document.createElement("div");for(let C of Array.from(v.childNodes))u.appendChild(C.cloneNode(!0));L.current=u});let S=V!=null,k;if(!S)k=Q$.jsx("div",{"data-current":!0,ref:_,children:J},N);else k=Q$.jsxs(y2.Fragment,{children:[Q$.jsx("div",{"data-previous":!0,inert:g8(!0),ref:M,style:{[B.popupWidth]:`${R?.width}px`,[B.popupHeight]:`${R?.height}px`,position:"absolute"},"data-ending-style":w?void 0:""},"previous"),Q$.jsx("div",{"data-current":!0,ref:_,"data-starting-style":w?"":void 0,children:J},N)]});U0(()=>{let v=M.current;if(!v||!V)return;v.replaceChildren(...Array.from(V.childNodes))},[V]),I_({popupElement:Y,positionerElement:K,mounted:U,content:F,onMeasureLayout:E,onMeasureLayoutComplete:I,side:H,direction:Q});let b={activationDirection:fi(D),transitioning:S};return{children:k,state:b}}function fi($){if(!$)return;return`${R_($.horizontal,5,"right","left")} ${R_($.vertical,5,"down","up")}`}function R_($,Z,H,B){if($>Z)return H;if($<-Z)return B;return""}function mi($,Z){let H=$.getBoundingClientRect(),B=Z.getBoundingClientRect(),J={x:H.left+H.width/2,y:H.top+H.height/2},Q={x:B.left+B.width/2,y:B.top+B.height/2};return{horizontal:Q.x-J.x,vertical:Q.y-J.y}}function pi($,Z){let[H,B]=y2.useState(0),J=y2.useRef($),Q=y2.useRef(Z),X=y2.useRef(!1);return U0(()=>{let z=J.current,G=Q.current,F=$!==z,U=Z!==G;if(F)B((Y)=>Y+1),X.current=!U;else if(X.current&&U)B((Y)=>Y+1),X.current=!1;J.current=$,Q.current=Z},[$,Z]),`${$??"current"}-${H}`}var ui={activationDirection:($)=>$?{"data-activation-direction":$}:null},b_=k_.forwardRef(function(Z,H){let{render:B,className:J,children:Q,...X}=Z,z=a4(),G=B$(),F=z.useState("instantType"),{children:U,state:Y}=X$({store:z,side:G.side,cssVars:C_,children:Q}),K={activationDirection:Y.activationDirection,transitioning:Y.transitioning,instant:F};return F0("div",Z,{state:K,ref:H,props:[X,{children:U}],stateAttributesMapping:ui})});class DX{constructor(){this.store=new H$}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(E0(81,$));this.store.setOpen(!0,M0(G0.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,M0(G0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function y_(){return new DX}var h6=O(c(),1);function qX({delay:$=100,...Z}){return h6.jsx(k9.Provider,{"data-slot":"tooltip-provider",delay:$,...Z})}function r1({...$}){return h6.jsx(k9.Root,{"data-slot":"tooltip",...$})}function a1({...$}){return h6.jsx(k9.Trigger,{"data-slot":"tooltip-trigger",...$})}function n1({className:$,side:Z="top",sideOffset:H=6,align:B="center",alignOffset:J=0,children:Q,...X}){return h6.jsx(k9.Portal,{children:h6.jsx(k9.Positioner,{align:B,alignOffset:J,side:Z,sideOffset:H,className:"isolate z-50",children:h6.jsx(k9.Popup,{"data-slot":"tooltip-content",className:s("z-50 flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-lg bg-popover px-2.5 py-1.5 text-xs font-medium text-popover-foreground shadow-md has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...X,children:Q})})})}function MX({cooldownMs:$,windowMs:Z,maxPerWindow:H,maxKeys:B=256,now:J=Date.now}){let Q=new Map,X=0,z=0;return{admit(G){let F=J(),U=Q.get(G);if(U!==void 0&&F-U<$)return"cooldown";if(F-X>=Z)X=F,z=0;if(z>=H)return"window";if(z++,Q.set(G,F),Q.size>B)for(let Y of[...Q.keys()].slice(0,Math.ceil(B/2)))Q.delete(Y);return"ok"}}}var ci=MX({cooldownMs:5000,windowMs:60000,maxPerWindow:30});function D8($,Z){let H=[$,Z.source,Z.kind,Z.name,Z.message].join("\x00");if(ci.admit(H)!=="ok")return;fetch(`/api/workspaces/${$}/applet-log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:[Z]})}).catch(()=>{})}var di=/\/api\/workspaces\/([^/\s)]+)\/(widgets|views)\/([^/\s)]+)\//;function h_($){if(!$)return null;let Z=di.exec($);if(!Z)return null;return{workspaceId:Z[1],kind:Z[2]==="widgets"?"widget":"view",name:Z[3]}}var x_=!1;function v_(){if(x_)return;x_=!0;let $=(Z,H,B)=>{let J=H instanceof Error?H:null,Q=J?.stack??"",X=Z??h_(Q);if(!X)return;D8(X.workspaceId,{source:"window",kind:X.kind,name:X.name,message:J?.message||B||String(H),...Q?{stack:Q}:{}})};window.addEventListener("error",(Z)=>$(h_(Z.filename),Z.error,Z.message)),window.addEventListener("unhandledrejection",(Z)=>$(null,Z.reason))}function G3($,Z){return`${$}:${Z}`}function z$($){return $==="running"}function m_($){return Object.values($).some(z$)}function yH($,Z,H){return z$($[G3(Z,H)])}function p_($,Z){let H=`${Z}:`;return Object.entries($).some(([B,J])=>B.startsWith(H)&&z$(J))}function u_($,Z,H){if(!H)return!1;let B=`${Z}:`,J=G3(Z,H);return Object.entries($).some(([Q,X])=>Q.startsWith(B)&&Q!==J&&z$(X))}function s2($,Z){return G3($,Z??"new")}var E1=g_()(($)=>({activity:{},errors:{},previews:{},attachments:{},setActivity:(Z,H,B)=>$((J)=>({activity:{...J.activity,[G3(Z,H)]:B}})),reconcileActivity:(Z)=>$(()=>({activity:Object.fromEntries(Z.map((H)=>[G3(H.workspaceId,H.sessionId),H.activity]))})),setError:(Z,H,B)=>$((J)=>({errors:{...J.errors,[G3(Z,H)]:B}})),setPreview:(Z)=>$((H)=>({previews:{...H.previews,[Z.messageId]:{workspaceId:Z.workspaceId,sessionId:Z.sessionId,parentToolUseId:Z.parentToolUseId,blocks:Z.blocks,updatedAt:Date.now()}}})),clearPreview:(Z)=>$((H)=>{if(!(Z in H.previews))return H;let{[Z]:B,...J}=H.previews;return{previews:J}}),clearPreviewsForSession:(Z,H)=>$((B)=>{let J={},Q=!1;for(let[X,z]of Object.entries(B.previews))if(z.workspaceId===Z&&z.sessionId===H)Q=!0;else J[X]=z;return Q?{previews:J}:B}),clearAllPreviews:()=>$((Z)=>Object.keys(Z.previews).length?{previews:{}}:Z),sweepPreviews:(Z,H)=>$((B)=>{let J={},Q=!1;for(let[X,z]of Object.entries(B.previews))if(H-z.updatedAt>Z)Q=!0;else J[X]=z;return Q?{previews:J}:B}),addAttachments:(Z,H,B)=>$((J)=>{let Q=s2(Z,H);return{attachments:{...J.attachments,[Q]:[...J.attachments[Q]??[],...B]}}}),updateAttachment:(Z,H,B,J)=>$((Q)=>{let X=s2(Z,H),z=Q.attachments[X];if(!z)return{};let G=z.find((F)=>F.localId===B);if(G?.previewUrl&&"previewUrl"in J&&J.previewUrl!==G.previewUrl)URL.revokeObjectURL(G.previewUrl);return{attachments:{...Q.attachments,[X]:z.map((F)=>F.localId===B?{...F,...J}:F)}}}),removeAttachment:(Z,H,B)=>$((J)=>{let Q=s2(Z,H),X=J.attachments[Q];if(!X)return{};let z=X.find((G)=>G.localId===B);if(z?.previewUrl)URL.revokeObjectURL(z.previewUrl);return{attachments:{...J.attachments,[Q]:X.filter((G)=>G.localId!==B)}}}),clearAttachments:(Z,H)=>$((B)=>{let J=s2(Z,H);for(let X of B.attachments[J]??[])if(X.previewUrl)URL.revokeObjectURL(X.previewUrl);let Q={...B.attachments};return delete Q[J],{attachments:Q}}),renameSession:(Z,H,B)=>$((J)=>{let Q=G3(Z,H),X=G3(Z,B),z={...J.activity},G={...J.errors};if(Q in z)z[X]=z[Q],delete z[Q];if(Q in G)G[X]=G[Q],delete G[Q];let F=J.previews,U=!1;for(let[Y,K]of Object.entries(J.previews))if(K.workspaceId===Z&&K.sessionId===H){if(!U)F={...J.previews},U=!0;F[Y]={...K,sessionId:B}}return{activity:z,errors:G,previews:F}})}));function c_($,Z,H){if(!H)return{root:null,byParent:{}};let B=null,J={};for(let Q of Object.values($)){if(Q.workspaceId!==Z||Q.sessionId!==H)continue;if(Q.parentToolUseId===null){if(!B||Q.updatedAt>B.updatedAt)B=Q}else{let X=J[Q.parentToolUseId];if(!X||Q.updatedAt>X.updatedAt)J[Q.parentToolUseId]=Q}}return{root:B,byParent:J}}function t2($){return f_(E1,$)}var w0={all:["workspaces"],discover:["workspaces","discover"],setupInfo:["workspaces","setup-info"],preview:($)=>["workspaces","preview",$],layout:($)=>["workspaces","layout",$],widgets:($)=>["workspaces","widgets",$],appletThumbnails:($)=>["workspaces","applet-thumbnails",$],views:($)=>["workspaces","views",$],viewBuilders:($)=>["workspaces","view-builders",$],sessions:($)=>["workspaces","sessions",$],events:($,Z)=>["workspaces","events",$,Z],sessionConfig:($,Z)=>["workspaces","sessionConfig",$,Z],mcp:($)=>["workspaces","mcp",$],agent:($)=>["workspaces","agent",$],skills:($)=>["workspaces","skills",$],env:($)=>["workspaces","env",$]};var hH=O(g(),1);var x6={all:["app-ui"],selectedSession:($)=>["app-ui","selected-session",$]};function li($){return[...x6.selectedSession($),"save"]}function ii($,Z,H){let B=x6.selectedSession(Z),J=$.getQueryData(B),Q=J?.sessionId??null;if(J&&Q===H)return null;return $.setQueryData(B,{sessionId:H}),{sessionId:H,previousSessionId:Q}}function ri($,Z,H,B){let J=x6.selectedSession(Z),Q=$.getQueryData(J);if(H.sessionId!==B.sessionId&&Q?.sessionId!==H.sessionId)return"conflict";if(Q?.sessionId!==B.sessionId&&Q?.sessionId!==B.previousSessionId)return"ignored";return $.setQueryData(J,H),"applied"}function ai($,Z,H,B){if(B)return;$.setQueryData(x6.selectedSession(Z),{sessionId:H})}function d_($,Z,H,B){$.setQueryData(x6.selectedSession(Z),(J)=>J?.sessionId===H?{sessionId:B}:J)}function F3(){let $=H5(),Z=$1(),H=hH.useMemo(()=>x6.selectedSession($),[$]),B=hH.useMemo(()=>li($),[$]),J=tY({mutationKey:B,exact:!0}),Q=o1({queryKey:H,queryFn:()=>V1(`/api/workspaces/${$}/selected-session`),staleTime:1/0,gcTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}),{mutate:X}=s1({mutationKey:B,scope:{id:`selected-session:${$}`},mutationFn:(F)=>V1(`/api/workspaces/${$}/selected-session`,n5("PUT",F),"Couldn’t save selected chat"),onSuccess:(F,U)=>{if(ri(Z,$,F,U)!=="conflict")return;r4.add({title:"Couldn’t save selected chat",type:"error"}),Z.invalidateQueries({queryKey:H})},onError:(F,U)=>{if(Z.getQueryData(H)?.sessionId!==U.sessionId)return;r4.add({title:"Couldn’t save selected chat",type:"error"}),Z.invalidateQueries({queryKey:H})}}),z=hH.useCallback((F)=>{let U=ii(Z,$,F);if(U)X(U)},[Z,X,$]);return B2((F)=>{if(F.type!=="selected-session:updated"||F.workspaceId!==$)return;ai(Z,$,F.sessionId,J>0)}),[Q.isLoading?void 0:Q.data?.sessionId??null,z]}function xH(){return{turns:[],notices:[]}}function vH($,Z){switch(Z.kind){case"snapshot":return{...$,snapshot:Z.snapshot};case"turn":{let H=$.turns.findIndex((J)=>J.id===Z.turn.id);if(H>=0)return{...$,turns:$.turns.map((J,Q)=>Q===H?Z.turn:J)};if(Z.turn.seq===void 0)return{...$,turns:[...$.turns,Z.turn]};let B=$.turns.findIndex((J)=>J.seq!==void 0&&J.seq>Z.turn.seq);if(B<0)return{...$,turns:[...$.turns,Z.turn]};return{...$,turns:[...$.turns.slice(0,B),Z.turn,...$.turns.slice(B)]}}case"notice":{if($.notices.some((H)=>H.id===Z.notice.id))return{...$,notices:$.notices.map((H)=>H.id===Z.notice.id?Z.notice:H)};return{...$,notices:[...$.notices,Z.notice]}}case"result":return{...$,result:Z.result}}}function l_($){return $.reduce(vH,xH())}function r_($,Z){let{queryClient:H,sendMessage:B,onWorkspaceSwitch:J}=Z,Q=E1.getState();if($.type==="status_snapshot"){Q.reconcileActivity($.sessions??[]);return}if($.type==="status"){let{workspaceId:F,sessionId:U,activity:Y}=$;if(Q.setActivity(F,U,Y),Y!=="running")Q.clearPreviewsForSession(F,U);return}if($.type==="preview"){let F=$,U=w0.events(F.workspaceId,F.sessionId);if(H?.getQueryData(U)===void 0)return;Q.setPreview({workspaceId:F.workspaceId,sessionId:F.sessionId,messageId:F.messageId,parentToolUseId:F.parentToolUseId,blocks:F.blocks});return}if($.type==="session_renamed"){let{workspaceId:F,from:U,to:Y}=$,K=w0.sessions(F),N=H?.getQueryData(K)?.find((A)=>A.sessionId===U||A.sessionId===Y);if(N)H?.cancelQueries({queryKey:K});if(Q.renameSession(F,U,Y),H)d_(H,F,U,Y);if(N)H?.setQueryData(K,(A)=>[{...N,sessionId:Y},...(A??[]).filter((D)=>D.sessionId!==U&&D.sessionId!==Y)]);let L=H?.getQueryData(w0.events(F,U));if(L!==void 0)H?.setQueryData(w0.events(F,Y),L),H?.removeQueries({queryKey:w0.events(F,U)});let V=H?.getQueryData(w0.sessionConfig(F,U));if(V!==void 0)H?.setQueryData(w0.sessionConfig(F,Y),V),H?.removeQueries({queryKey:w0.sessionConfig(F,U)});if(!N)H?.invalidateQueries({queryKey:K});H?.invalidateQueries({queryKey:w0.preview(F)});return}if($.type==="sessions_changed"){let F=$.workspaceId,U=w0.sessions(F);H?.invalidateQueries({queryKey:U}),H?.invalidateQueries({queryKey:w0.preview(F)});return}if($.type==="workspace:switch"){J?.($.workspaceId);return}if($.type==="scratchpad:op"){let F=i_($.workspaceId);if(!F)return;let U=$.opId;F($.op).then((Y)=>B({type:"scratchpad:op-result",opId:U,result:Y}),(Y)=>B({type:"scratchpad:op-result",opId:U,error:Y instanceof Error?Y.message:String(Y)}));return}let{workspaceId:X,sessionId:z}=$;if(!X||!z)return;let G=$.kind;if(G==="snapshot"||G==="turn"||G==="notice"||G==="result"){if(ni(H,X,z,$),G==="turn"){let F=$.turn?.meta?.apiMessageId;if(F)Q.clearPreview(F)}if(G==="result")Q.clearPreviewsForSession(X,z)}if(G==="error"&&typeof $.content==="string")Q.setError(X,z,$.content),Q.setActivity(X,z,"idle"),Q.clearPreviewsForSession(X,z);if(G==="stopped")Q.setActivity(X,z,"idle"),Q.clearPreviewsForSession(X,z)}function ni($,Z,H,B){let J=w0.events(Z,H),Q=$?.getQueryData(J);if(Q===void 0)return;$?.setQueryData(J,vH(Q,B))}var zW=null,G$=null,PX=0,_X=null,XW=[],o_=null,a_=null,oi=15000;function s_($){if(zW=$,!a_)a_=setInterval(()=>E1.getState().sweepPreviews(oi,Date.now()),5000);if(G$)return;t_()}function t_(){let $=++PX;if(_X)clearTimeout(_X),_X=null;let Z=new WebSocket(n_("/ws"));G$=Z,Z.onopen=()=>{if(PX!==$){Z.close();return}for(let H of XW)Z.send(JSON.stringify(H));XW.length=0,zW?.invalidateQueries({queryKey:["workspaces","events"]}),E1.getState().clearAllPreviews()},Z.onmessage=(H)=>{if(PX!==$)return;let B;try{B=JSON.parse(H.data)}catch{return}si(B)},Z.onclose=()=>{if(PX!==$)return;G$=null,_X=setTimeout(t_,1000)},Z.onerror=()=>Z.close()}function si($){r_($,{queryClient:zW,sendMessage:OX,onWorkspaceSwitch:o_})}function OX($){if(G$&&G$.readyState===WebSocket.OPEN)G$.send(JSON.stringify($));else XW.push($)}function GW($){o_=$}var hY=O(g(),1);var ti=($)=>e_()(ZO((Z)=>({discoveredWorkspacesOpen:!0,hasSentMessageFromMoi:!1,workspaceIdsPendingAnalysis:[],composerDrafts:{},viewBuilderDrafts:{},dockedChatWidth:360,setDiscoveredWorkspacesOpen:(H)=>Z({discoveredWorkspacesOpen:H}),markWorkspacePendingAnalysis:(H)=>Z((B)=>{let J=B.workspaceIdsPendingAnalysis??[];return{workspaceIdsPendingAnalysis:J.includes(H)?J:[...J,H]}}),markMessageSentFromMoi:(H)=>Z((B)=>({hasSentMessageFromMoi:!0,workspaceIdsPendingAnalysis:(B.workspaceIdsPendingAnalysis??[]).filter((J)=>J!==H)})),setComposerDraft:(H,B)=>Z((J)=>{let Q={...J.composerDrafts??{}};if(B)Q[H]=B;else delete Q[H];return{composerDrafts:Q}}),setViewBuilderDraft:(H,B)=>Z((J)=>{let Q=J.viewBuilderDrafts??{};if(B===null){if(!(H in Q))return J;let X={...Q};return delete X[H],{viewBuilderDrafts:X}}if(Q[H]===B)return J;return{viewBuilderDrafts:{...Q,[H]:B}}}),setDockedChatWidth:(H)=>Z({dockedChatWidth:H})}),$?{name:"moi:ui",storage:$O(()=>$)}:{name:"moi:ui"})),j5=ti();function HO($,Z){let H=$??[],B=H.findIndex((J)=>J.id===Z.id||J.path===Z.path);if(B===-1)return[Z,...H];return H.map((J,Q)=>Q===B?{...J,...Z}:J)}function jX(){return o1({queryKey:w0.all,queryFn:()=>V1("/api/workspaces"),staleTime:1/0,refetchOnMount:"always"})}function TX($){return o1({queryKey:w0.preview($),queryFn:()=>V1(`/api/workspaces/${$}/preview`),staleTime:60000})}function BO(){return o1({queryKey:w0.discover,queryFn:()=>V1("/api/workspaces/discover")})}function JO(){let $=$1();return s1({mutationFn:(Z)=>V1("/api/workspaces",n5("POST",Z),"Failed to add workspace"),onSuccess:(Z,H)=>{j5.getState().markWorkspacePendingAnalysis(Z.id),$.setQueryData(w0.all,(B)=>HO(B,Z)),$.setQueryData(w0.discover,(B)=>(B??[]).filter((J)=>J.path!==H.path))}})}function CX(){return o1({queryKey:w0.setupInfo,queryFn:()=>V1("/api/workspaces/create"),staleTime:30000,refetchOnMount:"always"})}function QO(){let $=$1();return s1({mutationFn:(Z)=>V1("/api/workspaces/create",n5("POST",Z),"Failed to create workspace"),onSuccess:(Z)=>{$.setQueryData(w0.all,(H)=>HO(H,Z))}})}function XO(){let $=$1();return s1({mutationFn:(Z)=>V1("/api/workspaces/order",n5("PUT",{ids:Z}),"Failed to reorder spaces"),onMutate:async(Z)=>{await $.cancelQueries({queryKey:w0.all,exact:!0});let H=$.getQueryData(w0.all);if(H){let B=new Map(H.map((Q)=>[Q.id,Q])),J=Z.map((Q)=>B.get(Q)).filter((Q)=>Boolean(Q));if(J.length===H.length)$.setQueryData(w0.all,J)}return{previous:H}},onError:(Z,H,B)=>{if(B?.previous)$.setQueryData(w0.all,B.previous);$.invalidateQueries({queryKey:w0.all,exact:!0})},onSuccess:(Z)=>{$.setQueryData(w0.all,Z)}})}function zO(){let $=$1();return s1({mutationFn:(Z)=>E4(`/api/workspaces/${Z}`,{method:"DELETE"},"Failed to remove workspace"),onSuccess:(Z,H)=>{$.setQueryData(w0.all,(B)=>(B??[]).filter((J)=>J.id!==H)),$.invalidateQueries({queryKey:w0.discover})}})}var WO=O(g(),1);var GO=O(c(),1);function S4({className:$,...Z}){return GO.jsx(I5,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:s("size-4 animate-spin",$),stroke:1.75,...Z})}var FW="Wait for active agents to finish, or stop them before updating moi";var ei=["update"],FO=300000,$r=1000;function UO($){return o1({queryKey:ei,queryFn:()=>V1("/api/update"),staleTime:FO,refetchInterval:$?$r:FO,refetchOnWindowFocus:!0,retry:!1})}function YO(){return s1({mutationFn:()=>V1("/api/update",{method:"POST"},"Could not update moi")})}var b9=O(c(),1);function Zr($,Z){return!!Z&&$?.runningVersion===Z}function Hr($,Z,H){let B=Z||H,J=$&&!B;return{busy:B,blocked:J,label:Z?"Updating":H?"Restarting":J?FW:"Update"}}function NO(){let $=YO(),Z=UO($.isSuccess),H=t2((z)=>m_(z.activity)),B=Z.data,J=$.data?.installedVersion??null;if(WO.useEffect(()=>{if(Zr(B,J))window.location.reload()},[J,B]),!B?.availableVersion)return null;let Q=$.isSuccess,X=Hr(H,$.isPending,Q);return b9.jsxs(r1,{children:[b9.jsx(a1,{render:b9.jsx("div",{children:b9.jsx(C0,{type:"button",size:"icon",variant:X.busy?"ghost":"default","aria-label":X.label,disabled:X.blocked||X.busy,onClick:()=>$.mutate(),children:X.busy?b9.jsx(S4,{stroke:1.5}):b9.jsx(KO,{stroke:1.5})})})}),b9.jsx(n1,{side:"right",className:X.blocked?"max-w-56":void 0,children:X.blocked?FW:$.error?.message??X.label})]})}var oH=O(g(),1);var q8={};O4(q8,{createHandle:()=>dO,Viewport:()=>mO,Trigger:()=>cO,Title:()=>uO,Root:()=>gO,Portal:()=>SO,Popup:()=>TO,Handle:()=>bX,Description:()=>MO,Close:()=>DO,Backdrop:()=>AO});var LO=O(g(),1);var wX=O(g(),1),UW=wX.createContext(void 0);function W2($){let Z=wX.useContext(UW);if($===!1&&Z===void 0)throw Error(E0(27));return Z}var Br={...P1,...i1},AO=LO.forwardRef(function(Z,H){let{render:B,className:J,forceRender:Q=!1,...X}=Z,{store:z}=W2(),G=z.useState("open"),F=z.useState("nested"),U=z.useState("mounted"),Y=z.useState("transitionStatus");return F0("div",Z,{state:{open:G,transitionStatus:Y},ref:[z.context.backdropRef,H],stateAttributesMapping:Br,props:[{role:"presentation",hidden:!U,style:{userSelect:"none",WebkitUserSelect:"none"}},X],enabled:Q||!F})});var VO=O(g(),1);var DO=VO.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q=!1,nativeButton:X=!0,...z}=Z,{store:G}=W2(),F=G.useState("open");function U(N){if(F)G.setOpen(!1,M0(G0.closePress,N.nativeEvent))}let{getButtonProps:Y,buttonRef:K}=u5({disabled:Q,native:X});return F0("button",Z,{state:{disabled:Q},ref:[H,K],props:[{onClick:U},z,Y]})});var qO=O(g(),1);var MO=qO.forwardRef(function(Z,H){let{render:B,className:J,id:Q,...X}=Z,{store:z}=W2(),G=Z1(Q);return z.useSyncedValueWithCleanup("descriptionElementId",G),F0("p",Z,{ref:H,props:[{id:G},X]})});var OO=O(g(),1);var PO=function($){return $.nestedDialogs="--nested-dialogs",$}({});var _O=function($){return $[$.open=w4.open]="open",$[$.closed=w4.closed]="closed",$[$.startingStyle=w4.startingStyle]="startingStyle",$[$.endingStyle=w4.endingStyle]="endingStyle",$.nested="data-nested",$.nestedDialogOpen="data-nested-dialog-open",$}({});var EX=O(g(),1),YW=EX.createContext(void 0);function SX(){let $=EX.useContext(YW);if($===void 0)throw Error(E0(26));return $}var gH="ArrowUp",fH="ArrowDown",mH="ArrowLeft",pH="ArrowRight",uH="Home",cH="End",Jr=new Set([mH,pH]);var Qr=new Set([gH,fH]);var Xr=new Set([...Jr,...Qr]),yq0=new Set([...Xr,uH,cH]),U3=new Set([gH,fH,mH,pH,uH,cH]);var jO=O(c(),1),zr={...P1,...i1,nestedDialogOpen($){return $?{[_O.nestedDialogOpen]:""}:null}},TO=OO.forwardRef(function(Z,H){let{className:B,finalFocus:J,initialFocus:Q,render:X,...z}=Z,{store:G}=W2(),F=G.useState("descriptionElementId"),U=G.useState("disablePointerDismissal"),Y=G.useState("floatingRootContext"),K=G.useState("popupProps"),W=G.useState("modal"),N=G.useState("mounted"),L=G.useState("nested"),V=G.useState("nestedOpenDialogCount"),A=G.useState("open"),D=G.useState("openMethod"),q=G.useState("titleElementId"),_=G.useState("transitionStatus"),M=G.useState("role");SX(),y5({open:A,ref:G.context.popupRef,onComplete(){if(A)G.context.onOpenChangeComplete?.(!0)}});function P(h){if(h==="touch")return G.context.popupRef.current;return!0}let T=Q===void 0?P:Q,R=V>0,w=F0("div",Z,{state:{open:A,nested:L,transitionStatus:_,nestedDialogOpen:R},props:[K,{"aria-labelledby":q??void 0,"aria-describedby":F??void 0,role:M,tabIndex:-1,hidden:!N,onKeyDown(h){if(U3.has(h.key))h.stopPropagation()},style:{[PO.nestedDialogs]:V}},z],ref:[H,G.context.popupRef,G.useStateSetter("popupElement")],stateAttributesMapping:zr});return jO.jsx(w6,{context:Y,openInteractionType:D,disabled:!N,closeOnFocusOut:!U,initialFocus:T,returnFocus:J,modal:W!==!1,restoreFocus:"popup",children:w})});var EO=O(g(),1);var CO=O(g(),1),wO=O(c(),1),F$=CO.forwardRef(function(Z,H){let{cutout:B,...J}=Z,Q;if(B){let X=B?.getBoundingClientRect();Q=`polygon(
|
|
13
|
+
0% 0%,
|
|
14
|
+
100% 0%,
|
|
15
|
+
100% 100%,
|
|
16
|
+
0% 100%,
|
|
17
|
+
0% 0%,
|
|
18
|
+
${X.left}px ${X.top}px,
|
|
19
|
+
${X.left}px ${X.bottom}px,
|
|
20
|
+
${X.right}px ${X.bottom}px,
|
|
21
|
+
${X.right}px ${X.top}px,
|
|
22
|
+
${X.left}px ${X.top}px
|
|
23
|
+
)`}return wO.jsx("div",{ref:H,role:"presentation","data-base-ui-inert":"",...J,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:Q}})});var dH=O(c(),1),SO=EO.forwardRef(function(Z,H){let{keepMounted:B=!1,...J}=Z,{store:Q}=W2(),X=Q.useState("mounted"),z=Q.useState("modal"),G=Q.useState("open");if(!(X||B))return null;return dH.jsx(YW.Provider,{value:B,children:dH.jsxs(C6,{ref:H,...J,children:[X&&z===!0&&dH.jsx(F$,{ref:Q.context.internalBackdropRef,inert:g8(!G)}),Z.children]})})});var xO=O(g(),1);var n4=O(g(),1);var IO={},RO={},kO="";function Gr($){if(typeof document>"u")return!1;let Z=m0($);return S2(Z).innerWidth-Z.documentElement.clientWidth>0}function Fr($){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let H=m0($),B=H.documentElement,J=H.body,Q=IX(B)?B:J,X=Q.style.overflowY,z=B.style.scrollbarGutter;B.style.scrollbarGutter="stable",Q.style.overflowY="scroll";let G=Q.offsetWidth;Q.style.overflowY="hidden";let F=Q.offsetWidth;return Q.style.overflowY=X,B.style.scrollbarGutter=z,G===F}function Ur($){let Z=m0($),H=Z.documentElement,B=Z.body,J=IX(H)?H:B,Q={overflowY:J.style.overflowY,overflowX:J.style.overflowX};return Object.assign(J.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(J.style,Q)}}function Yr($){let Z=m0($),H=Z.documentElement,B=Z.body,J=S2(H),Q=0,X=0,z=!1,G=N5.create();if(jQ&&(J.visualViewport?.scale??1)!==1)return()=>{};function F(){let K=J.getComputedStyle(H),W=J.getComputedStyle(B),V=(K.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";Q=H.scrollTop,X=H.scrollLeft,IO={scrollbarGutter:H.style.scrollbarGutter,overflowY:H.style.overflowY,overflowX:H.style.overflowX},kO=H.style.scrollBehavior,RO={position:B.style.position,height:B.style.height,width:B.style.width,boxSizing:B.style.boxSizing,overflowY:B.style.overflowY,overflowX:B.style.overflowX,scrollBehavior:B.style.scrollBehavior};let A=H.scrollHeight>H.clientHeight,D=H.scrollWidth>H.clientWidth,q=K.overflowY==="scroll"||W.overflowY==="scroll",_=K.overflowX==="scroll"||W.overflowX==="scroll",M=Math.max(0,J.innerWidth-B.clientWidth),P=Math.max(0,J.innerHeight-B.clientHeight),T=parseFloat(W.marginTop)+parseFloat(W.marginBottom),R=parseFloat(W.marginLeft)+parseFloat(W.marginRight),y=IX(H)?H:B;if(z=Fr($),z){H.style.scrollbarGutter=V,y.style.overflowY="hidden",y.style.overflowX="hidden";return}if(Object.assign(H.style,{scrollbarGutter:V,overflowY:"hidden",overflowX:"hidden"}),A||q)H.style.overflowY="scroll";if(D||_)H.style.overflowX="scroll";Object.assign(B.style,{position:"relative",height:T||P?`calc(100dvh - ${T+P}px)`:"100dvh",width:R||M?`calc(100vw - ${R+M}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),B.scrollTop=Q,B.scrollLeft=X,H.setAttribute("data-base-ui-scroll-locked",""),H.style.scrollBehavior="unset"}function U(){if(Object.assign(H.style,IO),Object.assign(B.style,RO),!z)H.scrollTop=Q,H.scrollLeft=X,H.removeAttribute("data-base-ui-scroll-locked"),H.style.scrollBehavior=kO}function Y(){U(),G.request(F)}return F(),J.addEventListener("resize",Y),()=>{if(G.cancel(),U(),typeof J.removeEventListener==="function")J.removeEventListener("resize",Y)}}class bO{lockCount=0;restore=null;timeoutLock=r5.create();timeoutUnlock=r5.create();acquire($){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock($));return this.release}release=()=>{if(this.lockCount-=1,this.lockCount===0&&this.restore)this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{if(this.lockCount===0&&this.restore)this.restore?.(),this.restore=null};lock($){if(this.lockCount===0||this.restore!==null)return;let H=m0($).documentElement,B=S2(H).getComputedStyle(H).overflowY;if(B==="hidden"||B==="clip"){this.restore=l1;return}let J=TQ||!Gr($);this.restore=J?Ur($):Yr($)}}var Kr=new bO;function U$($=!0,Z=null){U0(()=>{if(!$)return;return Kr.acquire(Z)},[$,Z])}var Y$=O(g(),1);var lH=O(g(),1);function yO($){let Z=lH.useRef(""),H=lH.useCallback((J)=>{if(J.defaultPrevented)return;Z.current=J.pointerType,$(J,J.pointerType)},[$]);return{onClick:lH.useCallback((J)=>{if(J.detail===0){$(J,"keyboard");return}if("pointerType"in J)$(J,J.pointerType);else $(J,Z.current);Z.current=""},[$]),onPointerDown:H}}function K$($){let[Z,H]=Y$.useState(null),B=Y0((z,G)=>{if(!$)H(G||(TQ?"touch":""))}),J=Y$.useCallback(()=>{H(null)},[]),{onClick:Q,onPointerDown:X}=yO(B);return Y$.useMemo(()=>({openMethod:Z,reset:J,triggerProps:{onClick:Q,onPointerDown:X}}),[Z,J,Q,X])}function hO($){let{store:Z,parentContext:H,actionsRef:B}=$,J=Z.useState("open"),Q=Z.useState("disablePointerDismissal"),X=Z.useState("modal"),z=Z.useState("popupElement"),{openMethod:G,triggerProps:F,reset:U}=K$(J);d8(Z);let{forceUnmount:Y}=l8(J,Z,()=>{U()}),K=Y0((w)=>{let h=M0(w);return h.preventUnmountOnClose=()=>{Z.set("preventUnmountingOnClose",!0)},h}),W=n4.useCallback(()=>{Z.setOpen(!1,K(G0.imperativeAction))},[Z,K]);n4.useImperativeHandle(B,()=>({unmount:Y,close:W}),[Y,W]);let N=L8({popupStore:Z,onOpenChange:Z.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[L,V]=n4.useState(0),A=L===0,D=k6(N),q=N8(N,{outsidePressEvent(){if(Z.context.internalBackdropRef.current||Z.context.backdropRef.current)return"intentional";return{mouse:X==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(w){if(!Z.context.outsidePressEnabledRef.current)return!1;if("button"in w&&w.button!==0)return!1;if("touches"in w&&w.touches.length!==1)return!1;let h=h1(w);if(A&&!Q){let E=h;if(X)return Z.context.internalBackdropRef.current||Z.context.backdropRef.current?Z.context.internalBackdropRef.current===E||Z.context.backdropRef.current===E||f0(E,z)&&!E?.hasAttribute("data-base-ui-portal"):!0;return!0}return!1},escapeKey:A});U$(J&&X===!0,z);let{getReferenceProps:_,getFloatingProps:M,getTriggerProps:P}=Z2([D,q]);Z.useContextCallback("onNestedDialogOpen",(w)=>{V(w+1)}),Z.useContextCallback("onNestedDialogClose",()=>{V(0)}),n4.useEffect(()=>{if(H?.onNestedDialogOpen&&J)H.onNestedDialogOpen(L);if(H?.onNestedDialogClose&&!J)H.onNestedDialogClose();return()=>{if(H?.onNestedDialogClose&&J)H.onNestedDialogClose()}},[J,H,L]);let T=n4.useMemo(()=>_(F),[_,F]),R=n4.useMemo(()=>P(F),[P,F]),y=n4.useMemo(()=>M(),[M]);Z.useSyncedValues({openMethod:G,activeTriggerProps:T,inactiveTriggerProps:R,popupProps:y,floatingRootContext:N,nestedOpenDialogCount:L})}var RX=O(g(),1);var Wr={...r8,modal:S0(($)=>$.modal),nested:S0(($)=>$.nested),nestedOpenDialogCount:S0(($)=>$.nestedOpenDialogCount),disablePointerDismissal:S0(($)=>$.disablePointerDismissal),openMethod:S0(($)=>$.openMethod),descriptionElementId:S0(($)=>$.descriptionElementId),titleElementId:S0(($)=>$.titleElementId),viewportElement:S0(($)=>$.viewportElement),role:S0(($)=>$.role)};class iH extends r2{constructor($){super(Nr($),{popupRef:RX.createRef(),backdropRef:RX.createRef(),internalBackdropRef:RX.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new n2,onOpenChange:void 0,onOpenChangeComplete:void 0},Wr)}setOpen=($,Z)=>{if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!$&&Z.trigger==null&&this.state.activeTriggerId!=null)Z.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.($,Z),Z.isCanceled)return;let H={open:$,nativeEvent:Z.event,reason:Z.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",H);let B={open:$},J=Z.trigger?.id??null;if(J||$)B.activeTriggerId=J,B.activeTriggerElement=Z.trigger??null;this.update(B)}}function Nr($={}){return{...i8(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...$}}var vO=O(c(),1);function gO($){let{children:Z,open:H,defaultOpen:B=!1,onOpenChange:J,onOpenChangeComplete:Q,disablePointerDismissal:X=!1,modal:z=!0,actionsRef:G,handle:F,triggerId:U,defaultTriggerId:Y=null}=$,K=W2(!0),W=Boolean(K),N=k1(()=>{return F?.store??new iH({open:B,openProp:H,activeTriggerId:Y,triggerIdProp:U,modal:z,disablePointerDismissal:X,nested:W})}).current;t8(()=>{if(H===void 0&&N.state.open===!1&&B===!0)N.update({open:!0,activeTriggerId:Y})}),N.useControlledProp("openProp",H),N.useControlledProp("triggerIdProp",U),N.useSyncedValues({disablePointerDismissal:X,nested:W,modal:z}),N.useContextCallback("onOpenChange",J),N.useContextCallback("onOpenChangeComplete",Q);let L=N.useState("payload");hO({store:N,actionsRef:G,parentContext:K?.store.context,onOpenChange:J,triggerIdProp:U});let V=xO.useMemo(()=>({store:N}),[N]);return vO.jsx(UW.Provider,{value:V,children:typeof Z==="function"?Z({payload:L}):Z})}var fO=O(g(),1);var KW=function($){return $[$.open=w4.open]="open",$[$.closed=w4.closed]="closed",$[$.startingStyle=w4.startingStyle]="startingStyle",$[$.endingStyle=w4.endingStyle]="endingStyle",$.nested="data-nested",$.nestedDialogOpen="data-nested-dialog-open",$}({});var Lr={...P1,...i1,nested($){return $?{[KW.nested]:""}:null},nestedDialogOpen($){return $?{[KW.nestedDialogOpen]:""}:null}},mO=fO.forwardRef(function(Z,H){let{className:B,render:J,children:Q,...X}=Z,z=SX(),{store:G}=W2(),F=G.useState("open"),U=G.useState("nested"),Y=G.useState("transitionStatus"),K=G.useState("nestedOpenDialogCount"),W=G.useState("mounted"),N=K>0;return F0("div",Z,{enabled:z||W,state:{open:F,nested:U,transitionStatus:Y,nestedDialogOpen:N},ref:[H,G.useStateSetter("viewportElement")],stateAttributesMapping:Lr,props:[{role:"presentation",hidden:!W,style:{pointerEvents:!F?"none":void 0},children:Q},X]})});var pO=O(g(),1);var uO=pO.forwardRef(function(Z,H){let{render:B,className:J,id:Q,...X}=Z,{store:z}=W2(),G=Z1(Q);return z.useSyncedValueWithCleanup("titleElementId",G),F0("h2",Z,{ref:H,props:[{id:G},X]})});var kX=O(g(),1);var cO=kX.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q=!1,nativeButton:X=!0,id:z,payload:G,handle:F,...U}=Z,Y=W2(!0),K=F?.store??Y?.store;if(!K)throw Error(E0(79));let W=Z1(z),N=K.useState("floatingRootContext"),L=K.useState("isOpenedByTrigger",W),V=kX.useRef(null),{registerTrigger:A,isMountedByThisTrigger:D}=c8(W,V,K,{payload:G}),{getButtonProps:q,buttonRef:_}=u5({disabled:Q,native:X}),M=I9(N,{enabled:N!=null}),P=Z2([M]),T={disabled:Q,open:L},R=K.useState("triggerProps",D);return F0("button",Z,{state:T,ref:[_,H,A,V],props:[P.getReferenceProps(),R,{[s7]:"",id:W},U,q],stateAttributesMapping:o8})});class bX{constructor($){this.store=$??new iH}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;this.store.setOpen(!0,M0(G0.imperativeAction,void 0,Z))}openWithPayload($){this.store.set("payload",$),this.store.setOpen(!0,M0(G0.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,M0(G0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function dO(){return new bX}var $9=O(c(),1);function Y3({...$}){return $9.jsx(q8.Root,{"data-slot":"dialog",...$})}function yX({...$}){return $9.jsx(q8.Trigger,{"data-slot":"dialog-trigger",...$})}function W$({...$}){return $9.jsx(q8.Close,{"data-slot":"dialog-close",...$})}function N$({className:$,children:Z,...H}){return $9.jsxs(q8.Portal,{children:[$9.jsx(q8.Backdrop,{"data-slot":"dialog-backdrop",className:"fixed inset-0 z-50 bg-foreground/40 duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0"}),$9.jsx(q8.Popup,{"data-slot":"dialog-content",className:s("fixed top-1/2 left-1/2 z-50 origin-center -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-xl bg-card text-card-foreground shadow-xl outline-hidden duration-150 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...H,children:Z})]})}function K3({className:$,...Z}){return $9.jsx(q8.Title,{"data-slot":"dialog-title",className:s("text-lg font-semibold",$),...Z})}function L$({className:$,...Z}){return $9.jsx(q8.Description,{"data-slot":"dialog-description",className:s("text-sm text-muted-foreground",$),...Z})}var Xj=O(g(),1);var lX={};O4(lX,{Validity:()=>Hj,Root:()=>aO,Label:()=>nO,Item:()=>Qj,Error:()=>oO,Description:()=>tO,Control:()=>$j});var L2=O(g(),1);var hX=O(g(),1);var WW=function($){return $.disabled="data-disabled",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.filled="data-filled",$.focused="data-focused",$}({});var v6={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},h2={valid($){if($===null)return null;if($)return{[WW.valid]:""};return{[WW.invalid]:""}}};var NW=hX.createContext({invalid:void 0,name:void 0,validityData:{state:v6,errors:[],error:"",value:"",initialValue:null},setValidityData:l1,disabled:void 0,touched:!1,setTouched:l1,dirty:!1,setDirty:l1,filled:!1,setFilled:l1,focused:!1,setFocused:l1,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:($=b1)=>$,getInputValidationProps:($=b1)=>$,inputRef:{current:null},commit:async()=>{}}});function h5($=!0){let Z=hX.useContext(NW);if(Z.setValidityData===l1&&!$)throw Error(E0(28));return Z}var xX=O(g(),1),Ar=xX.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function lO($=!1){let Z=xX.useContext(Ar);if(!Z&&!$)throw Error(E0(86));return Z}var vX=O(g(),1);var Vr=vX.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:l1,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function o4(){return vX.useContext(Vr)}var W3=O(g(),1);var gX=O(g(),1);var LW=gX.createContext({controlId:void 0,registerControlId:l1,labelId:void 0,setLabelId:l1,messageIds:[],setMessageIds:l1,getDescriptionProps:($)=>$});function N2(){return gX.useContext(LW)}var iO=O(c(),1),fX=function(Z){let H=Z1(),[B,J]=W3.useState(Z.initialControlId===void 0?H:Z.initialControlId),[Q,X]=W3.useState(void 0),[z,G]=W3.useState([]),F=k1(()=>new Map),{messageIds:U}=N2(),Y=Y0((N,L)=>{let V=F.current;if(L===void 0){V.delete(N);return}V.set(N,L),J((A)=>{if(V.size===0)return;let D;for(let q of V.values()){if(A!==void 0&&q===A)return A;if(D===void 0)D=q}return D})}),K=W3.useCallback((N)=>{return Y4({"aria-describedby":U.concat(z).join(" ")||void 0},N)},[U,z]),W=W3.useMemo(()=>({controlId:B,registerControlId:Y,labelId:Q,setLabelId:X,messageIds:z,setMessageIds:G,getDescriptionProps:K}),[B,Y,Q,X,z,G,K]);return iO.jsx(LW.Provider,{value:W,children:Z.children})};var f6=O(g(),1);function g6($,Z){return{...$,state:{...$.state,valid:!Z&&$.state.valid}}}var mX=Object.keys(v6);function Dr($){if(!$||$.valid||!$.valueMissing)return!1;let Z=!1;for(let H of mX){if(H==="valid")continue;if(H==="valueMissing")Z=$[H];if($[H])Z=!1}return Z}function rO($){let{formRef:Z,clearErrors:H}=o4(),{setValidityData:B,validate:J,validityData:Q,validationDebounceTime:X,invalid:z,markedDirtyRef:G,state:F,name:U,shouldValidateOnChange:Y}=$,{controlId:K,getDescriptionProps:W}=N2(),N=_5(),L=f6.useRef(null),V=Y0(async(q,_=!1)=>{let M=L.current;if(!M)return;if(_){if(F.valid!==!1)return;let I=M.validity;if(!I.valueMissing){let S={value:q,state:{...v6,valid:!0},error:"",errors:[],initialValue:Q.initialValue};if(M.setCustomValidity(""),K){let k=Z.current.fields.get(K);if(k)Z.current.fields.set(K,{...k,...g6(S,!1)})}B(S);return}let j=mX.reduce((S,k)=>{return S[k]=I[k],S},{});if(!j.valid&&!Dr(j))return}function P(I){let j=mX.reduce((k,b)=>{return k[b]=I.validity[b],k},{}),S=!1;for(let k of mX){if(k==="valid")continue;if(k==="valueMissing"&&j[k])S=!0;else if(j[k])return j}if(S&&!G.current)j.valid=!0,j.valueMissing=!1;return j}N.clear();let T=null,R=[],y=P(M),w,h=Y();if(M.validationMessage&&!h)w=M.validationMessage,R=[M.validationMessage];else{let I=Array.from(Z.current.fields.values()).reduce((S,k)=>{if(k.name)S[k.name]=k.getValue();return S},{}),j=J(q,I);if(typeof j==="object"&&j!==null&&"then"in j)T=await j;else T=j;if(T!==null){if(y.valid=!1,y.customError=!0,Array.isArray(T))R=T,M.setCustomValidity(T.join(`
|
|
24
|
+
`));else if(T)R=[T],M.setCustomValidity(T)}else if(h){if(M.setCustomValidity(""),y.customError=!1,M.validationMessage)w=M.validationMessage,R=[M.validationMessage];else if(M.validity.valid&&!y.valid)y.valid=!0}}let E={value:q,state:y,error:w??(Array.isArray(T)?T[0]:T??""),errors:R,initialValue:Q.initialValue};if(K){let I=Z.current.fields.get(K);if(I)Z.current.fields.set(K,{...I,...g6(E,z)})}B(E)}),A=f6.useCallback((q={})=>Y4(W,F.valid===!1?{"aria-invalid":!0}:b1,q),[W,F.valid]),D=f6.useCallback((q={})=>Y4({onChange(_){if(_.nativeEvent.defaultPrevented)return;if(H(U),!Y()){V(_.currentTarget.value,!0);return}if(z)return;let M=_.currentTarget;if(M.value===""){V(M.value);return}if(N.clear(),X)N.start(X,()=>{V(M.value)});else V(M.value)}},A(q)),[A,H,U,N,V,z,X,Y]);return f6.useMemo(()=>({getValidationProps:A,getInputValidationProps:D,inputRef:L,commit:V}),[A,D,V])}var pX=O(c(),1),qr=L2.forwardRef(function(Z,H){let{errors:B,validationMode:J,submitAttemptedRef:Q}=o4(),{render:X,className:z,validate:G,validationDebounceTime:F=0,validationMode:U=J,name:Y,disabled:K=!1,invalid:W,dirty:N,touched:L,actionsRef:V,...A}=Z,{disabled:D}=lO(),q=Y0(G||(()=>null)),_=D||K,[M,P]=L2.useState(!1),[T,R]=L2.useState(!1),[y,w]=L2.useState(!1),[h,E]=L2.useState(!1),I=N??T,j=L??M,S=L2.useRef(!1),k=Y0((K0)=>{if(N!==void 0)return;if(K0)S.current=!0;R(K0)}),b=Y0((K0)=>{if(L!==void 0)return;P(K0)}),v=Y0(()=>U==="onChange"||U==="onSubmit"&&Q.current),u=Boolean(W||Y&&{}.hasOwnProperty.call(B,Y)&&B[Y]!==void 0),[C,t]=L2.useState({state:v6,error:"",errors:[],value:null,initialValue:null}),H0=!u&&C.state.valid,x=L2.useMemo(()=>({disabled:_,touched:j,dirty:I,valid:H0,filled:y,focused:h}),[_,j,I,H0,y,h]),e=rO({setValidityData:t,validate:q,validityData:C,validationDebounceTime:F,invalid:u,markedDirtyRef:S,state:x,name:Y,shouldValidateOnChange:v}),L0=L2.useCallback(()=>{S.current=!0,e.commit(C.value)},[e,C]);L2.useImperativeHandle(V,()=>({validate:L0}),[L0]);let d=L2.useMemo(()=>({invalid:u,name:Y,validityData:C,setValidityData:t,disabled:_,touched:j,setTouched:b,dirty:I,setDirty:k,filled:y,setFilled:w,focused:h,setFocused:E,validate:q,validationMode:U,validationDebounceTime:F,shouldValidateOnChange:v,state:x,markedDirtyRef:S,validation:e}),[u,Y,C,_,j,b,I,k,y,w,h,E,q,U,F,v,x,e]),X0=F0("div",Z,{ref:H,state:x,props:A,stateAttributesMapping:h2});return pX.jsx(NW.Provider,{value:d,children:X0})}),aO=L2.forwardRef(function(Z,H){return pX.jsx(fX,{children:pX.jsx(qr,{...Z,ref:H})})});var rH=O(g(),1);var nO=rH.forwardRef(function(Z,H){let{render:B,className:J,id:Q,nativeLabel:X=!0,...z}=Z,G=h5(!1),{controlId:F,setLabelId:U,labelId:Y}=N2(),K=Z1(Q),W=rH.useRef(null),N=Y0((V)=>{if(h1(V.nativeEvent)?.closest("button,input,select,textarea"))return;if(!V.defaultPrevented&&V.detail>1)V.preventDefault();if(X||!F)return;let D=m0(V.currentTarget).getElementById(F);if(O5(D))D.focus({focusVisible:!0})});return U0(()=>{if(K)U(K);return()=>{U(void 0)}},[K,U]),F0("label",Z,{ref:[H,W],state:G.state,props:[{id:Y},X?{htmlFor:F??void 0,onMouseDown:N}:{onClick:N,onPointerDown(V){V.preventDefault()}},z],stateAttributesMapping:h2})});var m6=O(g(),1);var AW=O(c(),1),Mr={...h2,...i1},oO=m6.forwardRef(function(Z,H){let{render:B,id:J,className:Q,match:X,...z}=Z,G=Z1(J),{validityData:F,state:U,name:Y}=h5(!1),{setMessageIds:K}=N2(),{errors:W}=o4(),N=Y?W[Y]:null,L=!1;if(N||X===!0)L=!0;else if(X)L=Boolean(F.state[X]);else L=F.state.valid===!1;let{mounted:V,transitionStatus:A,setMounted:D}=l4(L);U0(()=>{if(!L||!G)return;return K((E)=>E.concat(G)),()=>{K((E)=>E.filter((I)=>I!==G))}},[L,G,K]);let q=m6.useRef(null),[_,M]=m6.useState(null),[P,T]=m6.useState(null),R=N||(F.errors.length>1?AW.jsx("ul",{children:F.errors.map((E)=>AW.jsx("li",{children:E},E))}):F.error),y=F.error;if(N!=null)y=Array.isArray(N)?JSON.stringify(N):N;else if(F.errors.length>1)y=JSON.stringify(F.errors);if(L&&y!==P)T(y),M(R);y5({open:L,ref:q,onComplete(){if(!L)D(!1)}});let w={...U,transitionStatus:A},h=F0("div",Z,{ref:[H,q],state:w,props:[{id:G,children:L?R:_},z],stateAttributesMapping:Mr,enabled:V});if(!V)return null;return h});var sO=O(g(),1);var tO=sO.forwardRef(function(Z,H){let{render:B,id:J,className:Q,...X}=Z,z=Z1(J),G=h5(!1),{setMessageIds:F}=N2();return U0(()=>{if(!z)return;return F((Y)=>Y.concat(z)),()=>{F((Y)=>Y.filter((K)=>K!==z))}},[z,F]),F0("p",Z,{ref:H,state:G.state,props:[{id:z},X],stateAttributesMapping:h2})});var uX=O(g(),1);var p6=O(g(),1);function s4({controlled:$,default:Z,name:H,state:B="value"}){let{current:J}=p6.useRef($!==void 0),[Q,X]=p6.useState(Z),z=J?$:Q,G=p6.useCallback((F)=>{if(!J)X(F)},[]);return[z,G]}var aH=O(g(),1);function A$($={}){let{id:Z,implicit:H=!1,controlRef:B}=$,{controlId:J,registerControlId:Q}=N2(),X=Z1(Z),z=H?J:void 0,G=k1(()=>Symbol("labelable-control")),F=aH.useRef(!1),U=aH.useRef(Z!=null),Y=Y0(()=>{if(!F.current||Q===l1)return;F.current=!1,Q(G.current,void 0)});return U0(()=>{if(Q===l1)return;let K;if(H){let W=B?.current;if(T1(W)&&W.closest("label")!=null)K=Z??null;else K=z??X}else if(Z!=null)U.current=!0,K=Z;else if(U.current)K=X;else{Y();return}if(K===void 0){Y();return}F.current=!0,Q(G.current,K);return},[Z,B,z,Q,H,X,G,Y]),aH.useEffect(()=>{return Y},[Y]),J??X}var eO=O(F4(),1);function V$($){let{enabled:Z=!0,value:H,id:B,name:J,controlRef:Q,commit:X}=$,{formRef:z}=o4(),{invalid:G,markedDirtyRef:F,validityData:U,setValidityData:Y}=h5(),K=Y0($.getValue);U0(()=>{if(!Z)return;let W=H;if(W===void 0)W=K();if(U.initialValue===null&&W!==null)Y((N)=>({...N,initialValue:W}))},[Z,Y,H,U.initialValue,K]),U0(()=>{if(!Z||!B)return;z.current.fields.set(B,{getValue:K,name:J,controlRef:Q,validityData:g6(U,G),validate(W=!0){let N=H;if(N===void 0)N=K();if(F.current=!0,!W)X(N);else eO.flushSync(()=>X(N))}})},[X,Q,Z,z,K,B,G,F,J,U,H]),U0(()=>{let W=z.current.fields;return()=>{if(B)W.delete(B)}},[z,B])}var $j=uX.forwardRef(function(Z,H){let{render:B,className:J,id:Q,name:X,value:z,disabled:G=!1,onValueChange:F,defaultValue:U,autoFocus:Y=!1,...K}=Z,{state:W,name:N,disabled:L,setTouched:V,setDirty:A,validityData:D,setFocused:q,setFilled:_,validationMode:M,validation:P}=h5(),T=L||G,R=N??X,y={...W,disabled:T},{labelId:w}=N2(),h=A$({id:Q});U0(()=>{let b=z!=null;if(P.inputRef.current?.value||b&&z!=="")_(!0);else if(b&&z==="")_(!1)},[P.inputRef,_,z]);let E=uX.useRef(null);U0(()=>{if(Y&&E.current===Z5(m0(E.current)))q(!0)},[Y,q]);let[I]=s4({controlled:z,default:U,name:"FieldControl",state:"value"}),j=z!==void 0,S=j?I:void 0;return V$({id:h,name:R,commit:P.commit,value:S,getValue:()=>P.inputRef.current?.value,controlRef:P.inputRef}),F0("input",Z,{ref:[H,E],state:y,props:[{id:h,disabled:T,name:R,ref:P.inputRef,"aria-labelledby":w,autoFocus:Y,...j?{value:S}:{defaultValue:U},onChange(b){let v=b.currentTarget.value;F?.(v,M0(G0.none,b.nativeEvent)),A(v!==D.initialValue),_(v!=="")},onFocus(){q(!0)},onBlur(b){if(V(!0),q(!1),M==="onBlur")P.commit(b.currentTarget.value)},onKeyDown(b){if(b.currentTarget.tagName==="INPUT"&&b.key==="Enter")V(!0),P.commit(b.currentTarget.value)}},P.getInputValidationProps(),K],stateAttributesMapping:h2})});var nH=O(g(),1);var Zj=O(c(),1),Hj=function(Z){let{children:H}=Z,{validityData:B,invalid:J}=h5(!1),Q=nH.useMemo(()=>g6(B,J),[B,J]),X=Q.state.valid===!1,{transitionStatus:z}=l4(X),G=nH.useMemo(()=>{return{...Q,validity:Q.state,transitionStatus:z}},[Q,z]);return Zj.jsx(nH.Fragment,{children:H(G)})};var dX=O(g(),1);var VW=O(g(),1),Bj=VW.createContext({disabled:!1});var cX=O(g(),1),Pr=cX.createContext(void 0);function Jj($=!0){let Z=cX.useContext(Pr);if(Z===void 0&&!$)throw Error(E0(3));return Z}var DW=O(c(),1),Qj=dX.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q=!1,...X}=Z,{state:z,disabled:G}=h5(!1),F=G||Q,U=Jj(),Y=U?.parent.id,W=U?.allValues!==void 0?Y:void 0,N=dX.useMemo(()=>({disabled:F}),[F]),L=F0("div",Z,{ref:H,state:z,props:X,stateAttributesMapping:h2});return DW.jsx(fX,{initialControlId:W,children:DW.jsx(Bj.Provider,{value:N,children:L})})});var zj=O(c(),1),qW=Xj.forwardRef(function(Z,H){return zj.jsx(lX.Control,{ref:H,...Z})});var Gj=O(c(),1);function N3({className:$,type:Z,...H}){return Gj.jsx(qW,{type:Z,"data-slot":"input",className:s("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",$),...H})}function Fj($){if(!$)return"Folder name is required";if($.length>64)return"Folder name is too long (max 64 characters)";if(!/^[A-Za-z0-9][A-Za-z0-9._ -]*$/.test($))return"Use letters, numbers, dots, dashes, underscores and spaces, starting with a letter or number";if($.endsWith(".")||$.endsWith(" "))return"Folder name cannot end with a dot or space";return null}var D$=["claude-code","codex","openclaw","hermes"];var q$=O(g(),1);var iX="/claude-z2xnay0d.svg";var Uj="/floppy-disk-wmjs0n85.webp";var rX="/hermes-pznd63x9.png";var aX="/openai-ep9ht2pq.svg";var nX="/openclaw-a2pyfhpn.svg";var H1=O(c(),1),Lj="Set up the moi workspace for this project. Fetch https://moi.computer/INSTALL.md, and follow the steps.";function M$({trigger:$,open:Z,onOpenChange:H}){return H1.jsxs(Y3,{open:Z,onOpenChange:H,children:[$&&H1.jsx(yX,{render:$}),H1.jsx(Sr,{})]})}var Yj=2;function wr({demoInstallUrl:$}){let Z=q$.useRef(null);return H1.jsx("div",{className:"relative min-h-56 overflow-hidden md:min-h-full",onMouseMove:(J)=>{if(!Z.current)return;let Q=J.currentTarget.getBoundingClientRect(),X=(J.clientX-Q.left)/Q.width-0.5,z=(J.clientY-Q.top)/Q.height-0.5;Z.current.style.setProperty("--floppy-x",`${X*-2*Yj}px`),Z.current.style.setProperty("--floppy-y",`${z*-2*Yj}px`)},onMouseLeave:()=>{Z.current?.style.removeProperty("--floppy-x"),Z.current?.style.removeProperty("--floppy-y")},children:H1.jsxs("a",{ref:Z,href:$,target:"_blank",rel:"noreferrer",className:"group absolute top-1/2 left-1/2 w-44 -translate-x-1/2 -translate-y-1/2 rotate-4 [transform:translate3d(var(--floppy-x,0px),var(--floppy-y,0px),0)] rounded-lg transition-transform duration-150 ease-out will-change-transform outline-none focus-visible:ring-3 focus-visible:ring-ring/50 motion-reduce:transform-none motion-reduce:transition-none md:w-40",children:[H1.jsx("img",{src:Uj,alt:"",className:"w-full drop-shadow-xl"}),H1.jsxs("div",{className:u6({variant:"outline",className:"absolute -right-3 -bottom-2 -rotate-8"}),children:["About moi",H1.jsx(Kj,{"data-icon":"inline-end",stroke:1.5})]})]})})}function Er(){let[$,Z]=q$.useState(!1);return q$.useEffect(()=>{if(!$)return;let B=setTimeout(()=>Z(!1),1500);return()=>clearTimeout(B)},[$]),{copied:$,copy:()=>{navigator.clipboard?.writeText(Lj).then(()=>Z(!0)).catch(()=>{})}}}function Sr(){let{demoInstallUrl:$}=Z9(),{copied:Z,copy:H}=Er();return H1.jsxs(N$,{"data-vivid":!0,className:"w-full max-w-md rounded-2xl bg-primary texture-checker-16 p-2 text-primary-foreground md:max-w-2xl",children:[H1.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(to_right,color-mix(in_oklch,var(--background)_14%,transparent),color-mix(in_oklch,var(--background)_6%,transparent))]"}),H1.jsxs("svg",{className:"pointer-events-none absolute inset-0 size-full opacity-30 mix-blend-soft-light","aria-hidden":"true",children:[H1.jsx("filter",{id:"floppy-grain",children:H1.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.8",numOctaves:"2",stitchTiles:"stitch"})}),H1.jsx("rect",{width:"100%",height:"100%",filter:"url(#floppy-grain)"})]}),H1.jsxs("div",{className:"relative grid max-h-[calc(100dvh-2rem)] overflow-y-auto md:grid-cols-[3fr_2fr] md:overflow-visible",children:[H1.jsxs("div",{className:"rounded-xl bg-card p-6 text-card-foreground shadow-sm md:p-8",children:[H1.jsxs("div",{className:"flex flex-col gap-0.5",children:[H1.jsx(K3,{children:"Unlock all features"}),H1.jsx(L$,{className:"mt-1",children:"This is a demo version with sample workspaces. Install moi locally and connect to your agent."})]}),H1.jsxs("ul",{className:"mt-4 flex flex-col gap-3",children:[H1.jsxs("li",{className:"flex items-center gap-3",children:[H1.jsx(Wj,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),H1.jsx("span",{className:"text-sm text-foreground",children:"Connect your own data sources and work on existing projects"})]}),H1.jsxs("li",{className:"flex items-center gap-3",children:[H1.jsx(Nj,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),H1.jsxs("span",{className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-sm text-foreground",children:[H1.jsx("span",{children:"Build with"}),H1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[H1.jsx("img",{src:iX,alt:"",className:"size-3.5 object-contain"}),"Claude Code,"]}),H1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[H1.jsx("img",{src:aX,alt:"",className:"size-3.5 object-contain"}),"Codex,"]}),H1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[H1.jsx("img",{src:rX,alt:"",className:"size-3.5 object-contain"}),"Hermes,"]}),H1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[H1.jsx("img",{src:nX,alt:"",className:"size-3.5 object-contain"}),"OpenClaw,"]}),H1.jsx("span",{children:"and more"})]})]})]}),H1.jsxs("div",{className:"mt-8 flex flex-col gap-3 pb-4",children:[H1.jsx("p",{className:"text-sm text-muted-foreground",children:"Give this prompt to your agent:"}),H1.jsxs("div",{className:"relative rounded-lg bg-muted p-4 pb-8 ring-1 ring-border",children:[H1.jsx("code",{className:"block font-mono text-sm leading-relaxed text-foreground",children:Lj}),H1.jsxs(C0,{type:"button",onClick:H,className:"absolute right-4 -bottom-4",children:[Z?H1.jsx(L3,{"data-icon":"inline-start",stroke:1.5}):H1.jsx(oX,{"data-icon":"inline-start",stroke:1.5}),Z?"Copied":"Copy prompt"]})]})]})]}),H1.jsx(wr,{demoInstallUrl:$})]}),H1.jsx(W$,{render:H1.jsx(C0,{variant:"outline",size:"icon","aria-label":"Close",className:"absolute top-4 right-4",children:H1.jsx(S5,{stroke:1.5})})})]})}var Vj=O(g(),1);var MW=O(c(),1),M8={"claude-code":iX,openclaw:nX,codex:aX,hermes:rX},PW={"claude-code":"Claude Code",openclaw:"OpenClaw",codex:"Codex",hermes:"Hermes"};function Aj({types:$}){let Z=$.map((H)=>PW[H]).join(", ");return MW.jsx("span",{role:"img","aria-label":Z,className:"inline-flex shrink-0 items-center -space-x-0.5",children:$.map((H)=>MW.jsx("img",{src:M8[H],alt:"",className:"size-4 shrink-0 rounded-full bg-muted ring-2 ring-muted"},H))})}function c6($){if("types"in $)return $.path.split("/").pop()||$.path;if($.name)return $.name;if($.type==="openclaw")return $.agentId??"OpenClaw agent";if($.type==="hermes")return $.agentId??"Hermes agent";return $.path.split("/").pop()||$.path}var c1=O(c(),1),Ir="Choose which agent moi will use to build your workspace",Rr={openclaw:"To connect an OpenClaw agent, run",hermes:"To connect a Hermes agent, run"},kr={openclaw:"moi openclaw init",hermes:"moi hermes init"},br={"claude-code":"Anthropic",codex:"OpenAI",openclaw:"Open-source",hermes:"Nous Research"};function yr({availability:$,detectedTypes:Z=[]}){return D$.map((H)=>{let B=$?.[H],J=B?.available===!1?B.reason:void 0,Q=!Z.includes(H)?Rr[H]:void 0,X=!Z.includes(H)?kr[H]:void 0,z=J??Q;return{type:H,description:br[H],disabled:Boolean(z),...z?{disabledReason:z}:{},...!J&&X?{disabledCommand:X}:{}}})}function hr($,Z){let H=$.find((B)=>B.type===Z);if(H&&!H.disabled)return H.type;return $.find((B)=>!B.disabled)?.type}function tX({title:$,selectedType:Z,detectedTypes:H,availability:B,isPending:J,errorMessage:Q,secondaryAction:X,primaryLabel:z,pendingLabel:G,onTypeChange:F,onSubmit:U}){let Y=j5((V)=>V.hasSentMessageFromMoi),K=yr({availability:B,detectedTypes:H}),W=hr(K,Z),N=W!==Z,L=W==="claude-code"?"Tip: you can use your existing Claude subscription in moi":W==="codex"?"Tip: you can use your existing ChatGPT subscription in moi":void 0;return Vj.useEffect(()=>{if(W&&N)F(W)},[F,W,N]),c1.jsxs("div",{className:"flex flex-col gap-5",children:[c1.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[c1.jsx(K3,{children:$}),c1.jsx(L$,{children:Ir})]}),c1.jsxs("div",{className:"flex flex-col gap-4",children:[c1.jsx(xr,{options:K,selectedType:N?void 0:Z,onTypeChange:F}),!Y&&L&&c1.jsx("p",{className:"text-sm text-muted-foreground",children:L})]}),Q&&c1.jsx("p",{role:"alert",className:"text-xs text-destructive",children:Q}),c1.jsxs("div",{className:"flex items-center justify-end gap-2",children:[X,c1.jsx(C0,{onClick:U,disabled:J||N,children:J&&G?G:z})]})]})}function xr({options:$,selectedType:Z,onTypeChange:H}){return c1.jsx("div",{role:"group","aria-label":"Agent",className:s("grid gap-2",$.length>2?"grid-cols-4":"grid-cols-2"),children:$.map((B)=>c1.jsx(vr,{option:B,selected:Z===B.type,onSelect:H},B.type))})}function vr({option:$,selected:Z,onSelect:H}){let B=Boolean($.disabledReason),J=c1.jsxs("button",{type:"button",disabled:$.disabled&&!B,"aria-disabled":$.disabled||void 0,"aria-pressed":Z,onClick:(Q)=>{if($.disabled){Q.preventDefault();return}H($.type)},className:s("relative flex w-full flex-col items-start justify-between gap-6 rounded-xl bg-card p-4 text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50",!Z&&"opacity-70",!Z&&!$.disabled&&"cursor-pointer hover:opacity-100",$.disabled&&"cursor-not-allowed"),children:[c1.jsxs("span",{className:"relative inline-flex",children:[c1.jsx(gr,{type:$.type}),Z&&c1.jsx(sX,{size:16,stroke:1.75,"aria-hidden":"true",className:"absolute -top-1.5 -right-1.5"})]}),c1.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[c1.jsx("span",{className:"text-sm font-medium text-foreground",children:PW[$.type]}),c1.jsx("span",{className:"text-xs leading-4 text-muted-foreground",children:$.description})]})]});if(!B)return J;return c1.jsxs(r1,{children:[c1.jsx(a1,{render:J}),c1.jsx(n1,{className:s("max-w-64",$.disabledCommand&&"max-w-none leading-5"),children:c1.jsxs("span",{className:"text-center",children:[$.disabledReason,$.disabledCommand&&c1.jsxs(c1.Fragment,{children:[c1.jsx("br",{}),c1.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:$.disabledCommand})]})]})})]})}function gr({type:$}){return c1.jsx("img",{src:M8[$],alt:"",className:"size-8 shrink-0"})}var P$=O(c(),1);function eX({children:$,closeDisabled:Z=!1}){return P$.jsxs(N$,{className:"w-[calc(100%-2rem)] max-w-xl p-6",children:[P$.jsx(W$,{render:P$.jsx(C0,{variant:"ghost",size:"icon-sm","aria-label":"Close",className:"absolute top-4 right-4",disabled:Z,children:P$.jsx(S5,{stroke:1.75})})}),$]})}var Y5=O(c(),1),Dj=D$[0];function sH({trigger:$}){let[,Z]=p4(),H=Z9(),B=CX(),J=QO(),[Q,X]=oH.useState(!1),[z,G]=oH.useState("agent"),[F,U]=oH.useState(Dj),[Y,K]=oH.useState(""),W=Y.trim(),N=W?Fj(W):null,L=J.isPending;if(H.cloudDemo)return Y5.jsx(M$,{trigger:$});function V(_){X(!1),Z(`/workspace/${_}`)}function A(){G("agent"),U(Dj),K(""),J.reset()}function D(){J.reset(),G("name")}function q(){if(!W||N||L)return;J.reset(),J.mutate({name:W,type:F},{onSuccess:(_)=>V(_.id)})}return Y5.jsxs(Y3,{open:Q,onOpenChange:X,onOpenChangeComplete:(_)=>{if(!_)A()},children:[Y5.jsx(yX,{render:$}),Y5.jsx(eX,{children:z==="agent"?Y5.jsx(tX,{title:"Create new workspace",selectedType:F,availability:B.data?.availability,isPending:!1,secondaryAction:Y5.jsx(mr,{}),primaryLabel:"Next",onTypeChange:U,onSubmit:D}):Y5.jsx(fr,{name:Y,validationError:N,requestError:J.error?.message,isPending:L,onNameChange:K,onSubmit:q})})]})}function fr({name:$,validationError:Z,requestError:H,isPending:B,onNameChange:J,onSubmit:Q}){function X(z){z.preventDefault(),Q()}return Y5.jsxs("form",{className:"flex flex-col gap-5",onSubmit:X,children:[Y5.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[Y5.jsx(K3,{children:"Create new workspace"}),Y5.jsx(L$,{children:"Give it a short and recognizable name"})]}),Y5.jsxs("div",{className:"flex flex-col gap-2",children:[Y5.jsx("label",{htmlFor:"workspace-name",className:"sr-only",children:"Workspace name"}),Y5.jsx(N3,{id:"workspace-name",value:$,onChange:(z)=>J(z.target.value),placeholder:"my-workspace",autoFocus:!0,"aria-invalid":Boolean(Z),"aria-describedby":Z?"workspace-name-error":void 0,autoComplete:"off",spellCheck:!1}),Z&&Y5.jsx("p",{id:"workspace-name-error",role:"alert",className:"text-xs text-destructive",children:Z})]}),H&&Y5.jsx("p",{role:"alert",className:"text-xs text-destructive",children:H}),Y5.jsx("div",{className:"flex items-center justify-end gap-2",children:Y5.jsx(C0,{type:"submit",disabled:!$.trim()||Boolean(Z)||B,children:B?"Creating…":"Create workspace"})})]})}function mr(){return Y5.jsxs(r1,{children:[Y5.jsx(a1,{render:Y5.jsx(C0,{variant:"secondary","aria-disabled":!0,onClick:(Z)=>Z.preventDefault(),className:"cursor-not-allowed opacity-50",children:"Use existing folder"})}),Y5.jsx(n1,{className:"max-w-64",children:Y5.jsxs("span",{className:"text-center",children:["Not supported yet — run"," ",Y5.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:"moi init"})," ","in the folder from your console to add it"]})})]})}var V3=O(g(),1);var W0=O(g(),1),a6=O(F4(),1);var o5=O(g(),1);var tH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function d6($){let Z=Object.prototype.toString.call($);return Z==="[object Window]"||Z==="[object global]"}function $z($){return"nodeType"in $}function x2($){var Z,H;if(!$)return window;if(d6($))return $;if(!$z($))return window;return(Z=(H=$.ownerDocument)==null?void 0:H.defaultView)!=null?Z:window}function Zz($){let{Document:Z}=x2($);return $ instanceof Z}function O$($){if(d6($))return!1;return $ instanceof x2($).HTMLElement}function OW($){return $ instanceof x2($).SVGElement}function l6($){if(!$)return document;if(d6($))return $.document;if(!$z($))return document;if(Zz($))return $;if(O$($)||OW($))return $.ownerDocument;return document}var H9=tH?o5.useLayoutEffect:o5.useEffect;function eH($){let Z=o5.useRef($);return H9(()=>{Z.current=$}),o5.useCallback(function(){for(var H=arguments.length,B=Array(H),J=0;J<H;J++)B[J]=arguments[J];return Z.current==null?void 0:Z.current(...B)},[])}function Mj(){let $=o5.useRef(null),Z=o5.useCallback((B,J)=>{$.current=setInterval(B,J)},[]),H=o5.useCallback(()=>{if($.current!==null)clearInterval($.current),$.current=null},[]);return[Z,H]}function j$($,Z){if(Z===void 0)Z=[$];let H=o5.useRef($);return H9(()=>{if(H.current!==$)H.current=$},Z),H}function T$($,Z){let H=o5.useRef();return o5.useMemo(()=>{let B=$(H.current);return H.current=B,B},[...Z])}function $B($){let Z=eH($),H=o5.useRef(null),B=o5.useCallback((J)=>{if(J!==H.current)Z==null||Z(J,H.current);H.current=J},[]);return[H,B]}function ZB($){let Z=o5.useRef();return o5.useEffect(()=>{Z.current=$},[$]),Z.current}var _W={};function HB($,Z){return o5.useMemo(()=>{if(Z)return Z;let H=_W[$]==null?0:_W[$]+1;return _W[$]=H,$+"-"+H},[$,Z])}function Pj($){return function(Z){for(var H=arguments.length,B=Array(H>1?H-1:0),J=1;J<H;J++)B[J-1]=arguments[J];return B.reduce((Q,X)=>{let z=Object.entries(X);for(let[G,F]of z){let U=Q[G];if(U!=null)Q[G]=U+$*F}return Q},{...Z})}}var i6=Pj(1),BB=Pj(-1);function pr($){return"clientX"in $&&"clientY"in $}function Hz($){if(!$)return!1;let{KeyboardEvent:Z}=x2($.target);return Z&&$ instanceof Z}function ur($){if(!$)return!1;let{TouchEvent:Z}=x2($.target);return Z&&$ instanceof Z}function JB($){if(ur($)){if($.touches&&$.touches.length){let{clientX:Z,clientY:H}=$.touches[0];return{x:Z,y:H}}else if($.changedTouches&&$.changedTouches.length){let{clientX:Z,clientY:H}=$.changedTouches[0];return{x:Z,y:H}}}if(pr($))return{x:$.clientX,y:$.clientY};return null}var _$=Object.freeze({Translate:{toString($){if(!$)return;let{x:Z,y:H}=$;return"translate3d("+(Z?Math.round(Z):0)+"px, "+(H?Math.round(H):0)+"px, 0)"}},Scale:{toString($){if(!$)return;let{scaleX:Z,scaleY:H}=$;return"scaleX("+Z+") scaleY("+H+")"}},Transform:{toString($){if(!$)return;return[_$.Translate.toString($),_$.Scale.toString($)].join(" ")}},Transition:{toString($){let{property:Z,duration:H,easing:B}=$;return Z+" "+H+"ms "+B}}}),qj="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function _j($){if($.matches(qj))return $;return $.querySelector(qj)}var r6=O(g(),1),cr={display:"none"};function Oj($){let{id:Z,value:H}=$;return r6.default.createElement("div",{id:Z,style:cr},H)}function jj($){let{id:Z,announcement:H,ariaLiveType:B="assertive"}=$,J={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return r6.default.createElement("div",{id:Z,style:J,role:"status","aria-live":B,"aria-atomic":!0},H)}function Tj(){let[$,Z]=r6.useState("");return{announce:r6.useCallback((B)=>{if(B!=null)Z(B)},[]),announcement:$}}var gj=W0.createContext(null);function dr($){let Z=W0.useContext(gj);W0.useEffect(()=>{if(!Z)throw Error("useDndMonitor must be used within a children of <DndContext>");return Z($)},[$,Z])}function lr(){let[$]=W0.useState(()=>new Set),Z=W0.useCallback((B)=>{return $.add(B),()=>$.delete(B)},[$]);return[W0.useCallback((B)=>{let{type:J,event:Q}=B;$.forEach((X)=>{var z;return(z=X[J])==null?void 0:z.call(X,Q)})},[$]),Z]}var ir={draggable:`
|
|
25
|
+
To pick up a draggable item, press the space bar.
|
|
26
|
+
While dragging, use the arrow keys to move the item.
|
|
27
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
28
|
+
`},rr={onDragStart($){let{active:Z}=$;return"Picked up draggable item "+Z.id+"."},onDragOver($){let{active:Z,over:H}=$;if(H)return"Draggable item "+Z.id+" was moved over droppable area "+H.id+".";return"Draggable item "+Z.id+" is no longer over a droppable area."},onDragEnd($){let{active:Z,over:H}=$;if(H)return"Draggable item "+Z.id+" was dropped over droppable area "+H.id;return"Draggable item "+Z.id+" was dropped."},onDragCancel($){let{active:Z}=$;return"Dragging was cancelled. Draggable item "+Z.id+" was dropped."}};function ar($){let{announcements:Z=rr,container:H,hiddenTextDescribedById:B,screenReaderInstructions:J=ir}=$,{announce:Q,announcement:X}=Tj(),z=HB("DndLiveRegion"),[G,F]=W0.useState(!1);if(W0.useEffect(()=>{F(!0)},[]),dr(W0.useMemo(()=>({onDragStart(Y){let{active:K}=Y;Q(Z.onDragStart({active:K}))},onDragMove(Y){let{active:K,over:W}=Y;if(Z.onDragMove)Q(Z.onDragMove({active:K,over:W}))},onDragOver(Y){let{active:K,over:W}=Y;Q(Z.onDragOver({active:K,over:W}))},onDragEnd(Y){let{active:K,over:W}=Y;Q(Z.onDragEnd({active:K,over:W}))},onDragCancel(Y){let{active:K,over:W}=Y;Q(Z.onDragCancel({active:K,over:W}))}}),[Q,Z])),!G)return null;let U=W0.default.createElement(W0.default.Fragment,null,W0.default.createElement(Oj,{id:B,value:J.draggable}),W0.default.createElement(jj,{id:z,announcement:X}));return H?a6.createPortal(U,H):U}var J2;(function($){$.DragStart="dragStart",$.DragMove="dragMove",$.DragEnd="dragEnd",$.DragCancel="dragCancel",$.DragOver="dragOver",$.RegisterDroppable="registerDroppable",$.SetDroppableDisabled="setDroppableDisabled",$.UnregisterDroppable="unregisterDroppable"})(J2||(J2={}));function Jz(){}function IW($,Z){return W0.useMemo(()=>({sensor:$,options:Z!=null?Z:{}}),[$,Z])}function fj(){for(var $=arguments.length,Z=Array($),H=0;H<$;H++)Z[H]=arguments[H];return W0.useMemo(()=>[...Z].filter((B)=>B!=null),[...Z])}var P8=Object.freeze({x:0,y:0});function nr($,Z){return Math.sqrt(Math.pow($.x-Z.x,2)+Math.pow($.y-Z.y,2))}function or($,Z){let H=JB($);if(!H)return"0 0";let B={x:(H.x-Z.left)/Z.width*100,y:(H.y-Z.top)/Z.height*100};return B.x+"% "+B.y+"%"}function sr($,Z){let{data:{value:H}}=$,{data:{value:B}}=Z;return H-B}function tr($,Z){let{data:{value:H}}=$,{data:{value:B}}=Z;return B-H}function er($,Z){if(!$||$.length===0)return null;let[H]=$;return Z?H[Z]:H}function Cj($,Z,H){if(Z===void 0)Z=$.left;if(H===void 0)H=$.top;return{x:Z+$.width*0.5,y:H+$.height*0.5}}var mj=($)=>{let{collisionRect:Z,droppableRects:H,droppableContainers:B}=$,J=Cj(Z,Z.left,Z.top),Q=[];for(let X of B){let{id:z}=X,G=H.get(z);if(G){let F=nr(Cj(G),J);Q.push({id:z,data:{droppableContainer:X,value:F}})}}return Q.sort(sr)};function $a($,Z){let H=Math.max(Z.top,$.top),B=Math.max(Z.left,$.left),J=Math.min(Z.left+Z.width,$.left+$.width),Q=Math.min(Z.top+Z.height,$.top+$.height),X=J-B,z=Q-H;if(B<J&&H<Q){let G=Z.width*Z.height,F=$.width*$.height,U=X*z,Y=U/(G+F-U);return Number(Y.toFixed(4))}return 0}var Za=($)=>{let{collisionRect:Z,droppableRects:H,droppableContainers:B}=$,J=[];for(let Q of B){let{id:X}=Q,z=H.get(X);if(z){let G=$a(z,Z);if(G>0)J.push({id:X,data:{droppableContainer:Q,value:G}})}}return J.sort(tr)};function Ha($,Z,H){return{...$,scaleX:Z&&H?Z.width/H.width:1,scaleY:Z&&H?Z.height/H.height:1}}function pj($,Z){return $&&Z?{x:$.left-Z.left,y:$.top-Z.top}:P8}function Ba($){return function(H){for(var B=arguments.length,J=Array(B>1?B-1:0),Q=1;Q<B;Q++)J[Q-1]=arguments[Q];return J.reduce((X,z)=>({...X,top:X.top+$*z.y,bottom:X.bottom+$*z.y,left:X.left+$*z.x,right:X.right+$*z.x}),{...H})}}var Ja=Ba(1);function uj($){if($.startsWith("matrix3d(")){let Z=$.slice(9,-1).split(/, /);return{x:+Z[12],y:+Z[13],scaleX:+Z[0],scaleY:+Z[5]}}else if($.startsWith("matrix(")){let Z=$.slice(7,-1).split(/, /);return{x:+Z[4],y:+Z[5],scaleX:+Z[0],scaleY:+Z[3]}}return null}function Qa($,Z,H){let B=uj(Z);if(!B)return $;let{scaleX:J,scaleY:Q,x:X,y:z}=B,G=$.left-X-(1-J)*parseFloat(H),F=$.top-z-(1-Q)*parseFloat(H.slice(H.indexOf(" ")+1)),U=J?$.width/J:$.width,Y=Q?$.height/Q:$.height;return{width:U,height:Y,top:F,right:G+U,bottom:F+Y,left:G}}var Xa={ignoreTransform:!1};function zB($,Z){if(Z===void 0)Z=Xa;let H=$.getBoundingClientRect();if(Z.ignoreTransform){let{transform:F,transformOrigin:U}=x2($).getComputedStyle($);if(F)H=Qa(H,F,U)}let{top:B,left:J,width:Q,height:X,bottom:z,right:G}=H;return{top:B,left:J,width:Q,height:X,bottom:z,right:G}}function wj($){return zB($,{ignoreTransform:!0})}function za($){let{innerWidth:Z,innerHeight:H}=$;return{top:0,left:0,right:Z,bottom:H,width:Z,height:H}}function Ga($,Z){if(Z===void 0)Z=x2($).getComputedStyle($);return Z.position==="fixed"}function Fa($,Z){if(Z===void 0)Z=x2($).getComputedStyle($);let H=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((J)=>{let Q=Z[J];return typeof Q==="string"?H.test(Q):!1})}function RW($,Z){let H=[];function B(J){if(Z!=null&&H.length>=Z)return H;if(!J)return H;if(Zz(J)&&J.scrollingElement!=null&&!H.includes(J.scrollingElement))return H.push(J.scrollingElement),H;if(!O$(J)||OW(J))return H;if(H.includes(J))return H;let Q=x2($).getComputedStyle(J);if(J!==$){if(Fa(J,Q))H.push(J)}if(Ga(J,Q))return H;return B(J.parentNode)}if(!$)return H;return B($)}function cj($){let[Z]=RW($,1);return Z!=null?Z:null}function jW($){if(!tH||!$)return null;if(d6($))return $;if(!$z($))return null;if(Zz($)||$===l6($).scrollingElement)return window;if(O$($))return $;return null}function dj($){if(d6($))return $.scrollX;return $.scrollLeft}function lj($){if(d6($))return $.scrollY;return $.scrollTop}function wW($){return{x:dj($),y:lj($)}}var A2;(function($){$[$.Forward=1]="Forward",$[$.Backward=-1]="Backward"})(A2||(A2={}));function ij($){if(!tH||!$)return!1;return $===document.scrollingElement}function rj($){let Z={x:0,y:0},H=ij($)?{height:window.innerHeight,width:window.innerWidth}:{height:$.clientHeight,width:$.clientWidth},B={x:$.scrollWidth-H.width,y:$.scrollHeight-H.height},J=$.scrollTop<=Z.y,Q=$.scrollLeft<=Z.x,X=$.scrollTop>=B.y,z=$.scrollLeft>=B.x;return{isTop:J,isLeft:Q,isBottom:X,isRight:z,maxScroll:B,minScroll:Z}}var Ua={x:0.2,y:0.2};function Ya($,Z,H,B,J){let{top:Q,left:X,right:z,bottom:G}=H;if(B===void 0)B=10;if(J===void 0)J=Ua;let{isTop:F,isBottom:U,isLeft:Y,isRight:K}=rj($),W={x:0,y:0},N={x:0,y:0},L={height:Z.height*J.y,width:Z.width*J.x};if(!F&&Q<=Z.top+L.height)W.y=A2.Backward,N.y=B*Math.abs((Z.top+L.height-Q)/L.height);else if(!U&&G>=Z.bottom-L.height)W.y=A2.Forward,N.y=B*Math.abs((Z.bottom-L.height-G)/L.height);if(!K&&z>=Z.right-L.width)W.x=A2.Forward,N.x=B*Math.abs((Z.right-L.width-z)/L.width);else if(!Y&&X<=Z.left+L.width)W.x=A2.Backward,N.x=B*Math.abs((Z.left+L.width-X)/L.width);return{direction:W,speed:N}}function Ka($){if($===document.scrollingElement){let{innerWidth:Q,innerHeight:X}=window;return{top:0,left:0,right:Q,bottom:X,width:Q,height:X}}let{top:Z,left:H,right:B,bottom:J}=$.getBoundingClientRect();return{top:Z,left:H,right:B,bottom:J,width:$.clientWidth,height:$.clientHeight}}function aj($){return $.reduce((Z,H)=>{return i6(Z,wW(H))},P8)}function Wa($){return $.reduce((Z,H)=>{return Z+dj(H)},0)}function Na($){return $.reduce((Z,H)=>{return Z+lj(H)},0)}function nj($,Z){if(Z===void 0)Z=zB;if(!$)return;let{top:H,left:B,bottom:J,right:Q}=Z($);if(!cj($))return;if(J<=0||Q<=0||H>=window.innerHeight||B>=window.innerWidth)$.scrollIntoView({block:"center",inline:"center"})}var La=[["x",["left","right"],Wa],["y",["top","bottom"],Na]];class Xz{constructor($,Z){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let H=RW(Z),B=aj(H);this.rect={...$},this.width=$.width,this.height=$.height;for(let[J,Q,X]of La)for(let z of Q)Object.defineProperty(this,z,{get:()=>{let G=X(H),F=B[J]-G;return this.rect[z]+F},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class C${constructor($){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((Z)=>{var H;return(H=this.target)==null?void 0:H.removeEventListener(...Z)})},this.target=$}add($,Z,H){var B;(B=this.target)==null||B.addEventListener($,Z,H),this.listeners.push([$,Z,H])}}function Aa($){let{EventTarget:Z}=x2($);return $ instanceof Z?$:l6($)}function TW($,Z){let H=Math.abs($.x),B=Math.abs($.y);if(typeof Z==="number")return Math.sqrt(H**2+B**2)>Z;if("x"in Z&&"y"in Z)return H>Z.x&&B>Z.y;if("x"in Z)return H>Z.x;if("y"in Z)return B>Z.y;return!1}var t4;(function($){$.Click="click",$.DragStart="dragstart",$.Keydown="keydown",$.ContextMenu="contextmenu",$.Resize="resize",$.SelectionChange="selectionchange",$.VisibilityChange="visibilitychange"})(t4||(t4={}));function Ej($){$.preventDefault()}function Va($){$.stopPropagation()}var v1;(function($){$.Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter",$.Tab="Tab"})(v1||(v1={}));var oj={start:[v1.Space,v1.Enter],cancel:[v1.Esc],end:[v1.Space,v1.Enter,v1.Tab]},Da=($,Z)=>{let{currentCoordinates:H}=Z;switch($.code){case v1.Right:return{...H,x:H.x+25};case v1.Left:return{...H,x:H.x-25};case v1.Down:return{...H,y:H.y+25};case v1.Up:return{...H,y:H.y-25}}return};class GB{constructor($){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=$;let{event:{target:Z}}=$;this.props=$,this.listeners=new C$(l6(Z)),this.windowListeners=new C$(x2(Z)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(t4.Resize,this.handleCancel),this.windowListeners.add(t4.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(t4.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:$,onStart:Z}=this.props,H=$.node.current;if(H)nj(H);Z(P8)}handleKeyDown($){if(Hz($)){let{active:Z,context:H,options:B}=this.props,{keyboardCodes:J=oj,coordinateGetter:Q=Da,scrollBehavior:X="smooth"}=B,{code:z}=$;if(J.end.includes(z)){this.handleEnd($);return}if(J.cancel.includes(z)){this.handleCancel($);return}let{collisionRect:G}=H.current,F=G?{x:G.left,y:G.top}:P8;if(!this.referenceCoordinates)this.referenceCoordinates=F;let U=Q($,{active:Z,context:H.current,currentCoordinates:F});if(U){let Y=BB(U,F),K={x:0,y:0},{scrollableAncestors:W}=H.current;for(let N of W){let L=$.code,{isTop:V,isRight:A,isLeft:D,isBottom:q,maxScroll:_,minScroll:M}=rj(N),P=Ka(N),T={x:Math.min(L===v1.Right?P.right-P.width/2:P.right,Math.max(L===v1.Right?P.left:P.left+P.width/2,U.x)),y:Math.min(L===v1.Down?P.bottom-P.height/2:P.bottom,Math.max(L===v1.Down?P.top:P.top+P.height/2,U.y))},R=L===v1.Right&&!A||L===v1.Left&&!D,y=L===v1.Down&&!q||L===v1.Up&&!V;if(R&&T.x!==U.x){let w=N.scrollLeft+Y.x,h=L===v1.Right&&w<=_.x||L===v1.Left&&w>=M.x;if(h&&!Y.y){N.scrollTo({left:w,behavior:X});return}if(h)K.x=N.scrollLeft-w;else K.x=L===v1.Right?N.scrollLeft-_.x:N.scrollLeft-M.x;if(K.x)N.scrollBy({left:-K.x,behavior:X});break}else if(y&&T.y!==U.y){let w=N.scrollTop+Y.y,h=L===v1.Down&&w<=_.y||L===v1.Up&&w>=M.y;if(h&&!Y.x){N.scrollTo({top:w,behavior:X});return}if(h)K.y=N.scrollTop-w;else K.y=L===v1.Down?N.scrollTop-_.y:N.scrollTop-M.y;if(K.y)N.scrollBy({top:-K.y,behavior:X});break}}this.handleMove($,i6(BB(U,this.referenceCoordinates),K))}}}handleMove($,Z){let{onMove:H}=this.props;$.preventDefault(),H(Z)}handleEnd($){let{onEnd:Z}=this.props;$.preventDefault(),this.detach(),Z()}handleCancel($){let{onCancel:Z}=this.props;$.preventDefault(),this.detach(),Z()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}GB.activators=[{eventName:"onKeyDown",handler:($,Z,H)=>{let{keyboardCodes:B=oj,onActivation:J}=Z,{active:Q}=H,{code:X}=$.nativeEvent;if(B.start.includes(X)){let z=Q.activatorNode.current;if(z&&$.target!==z)return!1;return $.preventDefault(),J==null||J({event:$.nativeEvent}),!0}return!1}}];function Sj($){return Boolean($&&"distance"in $)}function Ij($){return Boolean($&&"delay"in $)}class zz{constructor($,Z,H){var B;if(H===void 0)H=Aa($.event.target);this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=$,this.events=Z;let{event:J}=$,{target:Q}=J;this.props=$,this.events=Z,this.document=l6(Q),this.documentListeners=new C$(this.document),this.listeners=new C$(H),this.windowListeners=new C$(x2(Q)),this.initialCoordinates=(B=JB(J))!=null?B:P8,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:$,props:{options:{activationConstraint:Z,bypassActivationConstraint:H}}}=this;if(this.listeners.add($.move.name,this.handleMove,{passive:!1}),this.listeners.add($.end.name,this.handleEnd),$.cancel)this.listeners.add($.cancel.name,this.handleCancel);if(this.windowListeners.add(t4.Resize,this.handleCancel),this.windowListeners.add(t4.DragStart,Ej),this.windowListeners.add(t4.VisibilityChange,this.handleCancel),this.windowListeners.add(t4.ContextMenu,Ej),this.documentListeners.add(t4.Keydown,this.handleKeydown),Z){if(H!=null&&H({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ij(Z)){this.timeoutId=setTimeout(this.handleStart,Z.delay),this.handlePending(Z);return}if(Sj(Z)){this.handlePending(Z);return}}this.handleStart()}detach(){if(this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null)clearTimeout(this.timeoutId),this.timeoutId=null}handlePending($,Z){let{active:H,onPending:B}=this.props;B(H,$,this.initialCoordinates,Z)}handleStart(){let{initialCoordinates:$}=this,{onStart:Z}=this.props;if($)this.activated=!0,this.documentListeners.add(t4.Click,Va,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(t4.SelectionChange,this.removeTextSelection),Z($)}handleMove($){var Z;let{activated:H,initialCoordinates:B,props:J}=this,{onMove:Q,options:{activationConstraint:X}}=J;if(!B)return;let z=(Z=JB($))!=null?Z:P8,G=BB(B,z);if(!H&&X){if(Sj(X)){if(X.tolerance!=null&&TW(G,X.tolerance))return this.handleCancel();if(TW(G,X.distance))return this.handleStart()}if(Ij(X)){if(TW(G,X.tolerance))return this.handleCancel()}this.handlePending(X,G);return}if($.cancelable)$.preventDefault();Q(z)}handleEnd(){let{onAbort:$,onEnd:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleCancel(){let{onAbort:$,onCancel:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleKeydown($){if($.code===v1.Esc)this.handleCancel()}removeTextSelection(){var $;($=this.document.getSelection())==null||$.removeAllRanges()}}var qa={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class FB extends zz{constructor($){let{event:Z}=$,H=l6(Z.target);super($,qa,H)}}FB.activators=[{eventName:"onPointerDown",handler:($,Z)=>{let{nativeEvent:H}=$,{onActivation:B}=Z;if(!H.isPrimary||H.button!==0)return!1;return B==null||B({event:H}),!0}}];var Ma={move:{name:"mousemove"},end:{name:"mouseup"}},EW;(function($){$[$.RightClick=2]="RightClick"})(EW||(EW={}));class sj extends zz{constructor($){super($,Ma,l6($.event.target))}}sj.activators=[{eventName:"onMouseDown",handler:($,Z)=>{let{nativeEvent:H}=$,{onActivation:B}=Z;if(H.button===EW.RightClick)return!1;return B==null||B({event:H}),!0}}];var CW={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class tj extends zz{constructor($){super($,CW)}static setup(){return window.addEventListener(CW.move.name,$,{capture:!1,passive:!1}),function(){window.removeEventListener(CW.move.name,$)};function $(){}}}tj.activators=[{eventName:"onTouchStart",handler:($,Z)=>{let{nativeEvent:H}=$,{onActivation:B}=Z,{touches:J}=H;if(J.length>1)return!1;return B==null||B({event:H}),!0}}];var QB;(function($){$[$.Pointer=0]="Pointer",$[$.DraggableRect=1]="DraggableRect"})(QB||(QB={}));var Qz;(function($){$[$.TreeOrder=0]="TreeOrder",$[$.ReversedTreeOrder=1]="ReversedTreeOrder"})(Qz||(Qz={}));function Pa($){let{acceleration:Z,activator:H=QB.Pointer,canScroll:B,draggingRect:J,enabled:Q,interval:X=5,order:z=Qz.TreeOrder,pointerCoordinates:G,scrollableAncestors:F,scrollableAncestorRects:U,delta:Y,threshold:K}=$,W=Oa({delta:Y,disabled:!Q}),[N,L]=Mj(),V=W0.useRef({x:0,y:0}),A=W0.useRef({x:0,y:0}),D=W0.useMemo(()=>{switch(H){case QB.Pointer:return G?{top:G.y,bottom:G.y,left:G.x,right:G.x}:null;case QB.DraggableRect:return J}},[H,J,G]),q=W0.useRef(null),_=W0.useCallback(()=>{let P=q.current;if(!P)return;let T=V.current.x*A.current.x,R=V.current.y*A.current.y;P.scrollBy(T,R)},[]),M=W0.useMemo(()=>z===Qz.TreeOrder?[...F].reverse():F,[z,F]);W0.useEffect(()=>{if(!Q||!F.length||!D){L();return}for(let P of M){if((B==null?void 0:B(P))===!1)continue;let T=F.indexOf(P),R=U[T];if(!R)continue;let{direction:y,speed:w}=Ya(P,R,D,Z,K);for(let h of["x","y"])if(!W[h][y[h]])w[h]=0,y[h]=0;if(w.x>0||w.y>0){L(),q.current=P,N(_,X),V.current=w,A.current=y;return}}V.current={x:0,y:0},A.current={x:0,y:0},L()},[Z,_,B,L,Q,X,JSON.stringify(D),JSON.stringify(W),N,F,M,U,JSON.stringify(K)])}var _a={x:{[A2.Backward]:!1,[A2.Forward]:!1},y:{[A2.Backward]:!1,[A2.Forward]:!1}};function Oa($){let{delta:Z,disabled:H}=$,B=ZB(Z);return T$((J)=>{if(H||!B||!J)return _a;let Q={x:Math.sign(Z.x-B.x),y:Math.sign(Z.y-B.y)};return{x:{[A2.Backward]:J.x[A2.Backward]||Q.x===-1,[A2.Forward]:J.x[A2.Forward]||Q.x===1},y:{[A2.Backward]:J.y[A2.Backward]||Q.y===-1,[A2.Forward]:J.y[A2.Forward]||Q.y===1}}},[H,Z,B])}function ja($,Z){let H=Z!=null?$.get(Z):void 0,B=H?H.node.current:null;return T$((J)=>{var Q;if(Z==null)return null;return(Q=B!=null?B:J)!=null?Q:null},[B,Z])}function Ta($,Z){return W0.useMemo(()=>$.reduce((H,B)=>{let{sensor:J}=B,Q=J.activators.map((X)=>({eventName:X.eventName,handler:Z(X.handler,B)}));return[...H,...Q]},[]),[$,Z])}var XB;(function($){$[$.Always=0]="Always",$[$.BeforeDragging=1]="BeforeDragging",$[$.WhileDragging=2]="WhileDragging"})(XB||(XB={}));var SW;(function($){$.Optimized="optimized"})(SW||(SW={}));var Rj=new Map;function Ca($,Z){let{dragging:H,dependencies:B,config:J}=Z,[Q,X]=W0.useState(null),{frequency:z,measure:G,strategy:F}=J,U=W0.useRef($),Y=V(),K=j$(Y),W=W0.useCallback(function(A){if(A===void 0)A=[];if(K.current)return;X((D)=>{if(D===null)return A;return D.concat(A.filter((q)=>!D.includes(q)))})},[K]),N=W0.useRef(null),L=T$((A)=>{if(Y&&!H)return Rj;if(!A||A===Rj||U.current!==$||Q!=null){let D=new Map;for(let q of $){if(!q)continue;if(Q&&Q.length>0&&!Q.includes(q.id)&&q.rect.current){D.set(q.id,q.rect.current);continue}let _=q.node.current,M=_?new Xz(G(_),_):null;if(q.rect.current=M,M)D.set(q.id,M)}return D}return A},[$,Q,H,Y,G]);return W0.useEffect(()=>{U.current=$},[$]),W0.useEffect(()=>{if(Y)return;W()},[H,Y]),W0.useEffect(()=>{if(Q&&Q.length>0)X(null)},[JSON.stringify(Q)]),W0.useEffect(()=>{if(Y||typeof z!=="number"||N.current!==null)return;N.current=setTimeout(()=>{W(),N.current=null},z)},[z,Y,W,...B]),{droppableRects:L,measureDroppableContainers:W,measuringScheduled:Q!=null};function V(){switch(F){case XB.Always:return!1;case XB.BeforeDragging:return H;default:return!H}}}function kW($,Z){return T$((H)=>{if(!$)return null;if(H)return H;return typeof Z==="function"?Z($):$},[Z,$])}function wa($,Z){return kW($,Z)}function Ea($){let{callback:Z,disabled:H}=$,B=eH(Z),J=W0.useMemo(()=>{if(H||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:Q}=window;return new Q(B)},[B,H]);return W0.useEffect(()=>{return()=>J==null?void 0:J.disconnect()},[J]),J}function Gz($){let{callback:Z,disabled:H}=$,B=eH(Z),J=W0.useMemo(()=>{if(H||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:Q}=window;return new Q(B)},[H]);return W0.useEffect(()=>{return()=>J==null?void 0:J.disconnect()},[J]),J}function Sa($){return new Xz(zB($),$)}function kj($,Z,H){if(Z===void 0)Z=Sa;let[B,J]=W0.useState(null);function Q(){J((G)=>{if(!$)return null;if($.isConnected===!1){var F;return(F=G!=null?G:H)!=null?F:null}let U=Z($);if(JSON.stringify(G)===JSON.stringify(U))return G;return U})}let X=Ea({callback(G){if(!$)return;for(let F of G){let{type:U,target:Y}=F;if(U==="childList"&&Y instanceof HTMLElement&&Y.contains($)){Q();break}}}}),z=Gz({callback:Q});return H9(()=>{if(Q(),$)z==null||z.observe($),X==null||X.observe(document.body,{childList:!0,subtree:!0});else z==null||z.disconnect(),X==null||X.disconnect()},[$]),B}function Ia($){let Z=kW($);return pj($,Z)}var bj=[];function Ra($){let Z=W0.useRef($),H=T$((B)=>{if(!$)return bj;if(B&&B!==bj&&$&&Z.current&&$.parentNode===Z.current.parentNode)return B;return RW($)},[$]);return W0.useEffect(()=>{Z.current=$},[$]),H}function ka($){let[Z,H]=W0.useState(null),B=W0.useRef($),J=W0.useCallback((Q)=>{let X=jW(Q.target);if(!X)return;H((z)=>{if(!z)return null;return z.set(X,wW(X)),new Map(z)})},[]);return W0.useEffect(()=>{let Q=B.current;if($!==Q){X(Q);let z=$.map((G)=>{let F=jW(G);if(F)return F.addEventListener("scroll",J,{passive:!0}),[F,wW(F)];return null}).filter((G)=>G!=null);H(z.length?new Map(z):null),B.current=$}return()=>{X($),X(Q)};function X(z){z.forEach((G)=>{let F=jW(G);F==null||F.removeEventListener("scroll",J)})}},[J,$]),W0.useMemo(()=>{if($.length)return Z?Array.from(Z.values()).reduce((Q,X)=>i6(Q,X),P8):aj($);return P8},[$,Z])}function yj($,Z){if(Z===void 0)Z=[];let H=W0.useRef(null);return W0.useEffect(()=>{H.current=null},Z),W0.useEffect(()=>{let B=$!==P8;if(B&&!H.current)H.current=$;if(!B&&H.current)H.current=null},[$]),H.current?BB($,H.current):P8}function ba($){W0.useEffect(()=>{if(!tH)return;let Z=$.map((H)=>{let{sensor:B}=H;return B.setup==null?void 0:B.setup()});return()=>{for(let H of Z)H==null||H()}},$.map((Z)=>{let{sensor:H}=Z;return H}))}function ya($,Z){return W0.useMemo(()=>{return $.reduce((H,B)=>{let{eventName:J,handler:Q}=B;return H[J]=(X)=>{Q(X,Z)},H},{})},[$,Z])}function ej($){return W0.useMemo(()=>$?za($):null,[$])}var hj=[];function ha($,Z){if(Z===void 0)Z=zB;let[H]=$,B=ej(H?x2(H):null),[J,Q]=W0.useState(hj);function X(){Q(()=>{if(!$.length)return hj;return $.map((G)=>ij(G)?B:new Xz(Z(G),G))})}let z=Gz({callback:X});return H9(()=>{z==null||z.disconnect(),X(),$.forEach((G)=>z==null?void 0:z.observe(G))},[$]),J}function $T($){if(!$)return null;if($.children.length>1)return $;let Z=$.children[0];return O$(Z)?Z:$}function xa($){let{measure:Z}=$,[H,B]=W0.useState(null),J=W0.useCallback((F)=>{for(let{target:U}of F)if(O$(U)){B((Y)=>{let K=Z(U);return Y?{...Y,width:K.width,height:K.height}:K});break}},[Z]),Q=Gz({callback:J}),X=W0.useCallback((F)=>{let U=$T(F);if(Q==null||Q.disconnect(),U)Q==null||Q.observe(U);B(U?Z(U):null)},[Z,Q]),[z,G]=$B(X);return W0.useMemo(()=>({nodeRef:z,rect:H,setRef:G}),[H,z,G])}var va=[{sensor:FB,options:{}},{sensor:GB,options:{}}],ga={current:{}},Bz={draggable:{measure:wj},droppable:{measure:wj,strategy:XB.WhileDragging,frequency:SW.Optimized},dragOverlay:{measure:zB}};class w$ extends Map{get($){var Z;return $!=null?(Z=super.get($))!=null?Z:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(($)=>{let{disabled:Z}=$;return!Z})}getNodeFor($){var Z,H;return(Z=(H=this.get($))==null?void 0:H.node.current)!=null?Z:void 0}}var fa={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new w$,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Jz},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Bz,measureDroppableContainers:Jz,windowRect:null,measuringScheduled:!1},ZT={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Jz,draggableNodes:new Map,over:null,measureDroppableContainers:Jz},UB=W0.createContext(ZT),HT=W0.createContext(fa);function ma(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new w$}}}function pa($,Z){switch(Z.type){case J2.DragStart:return{...$,draggable:{...$.draggable,initialCoordinates:Z.initialCoordinates,active:Z.active}};case J2.DragMove:if($.draggable.active==null)return $;return{...$,draggable:{...$.draggable,translate:{x:Z.coordinates.x-$.draggable.initialCoordinates.x,y:Z.coordinates.y-$.draggable.initialCoordinates.y}}};case J2.DragEnd:case J2.DragCancel:return{...$,draggable:{...$.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case J2.RegisterDroppable:{let{element:H}=Z,{id:B}=H,J=new w$($.droppable.containers);return J.set(B,H),{...$,droppable:{...$.droppable,containers:J}}}case J2.SetDroppableDisabled:{let{id:H,key:B,disabled:J}=Z,Q=$.droppable.containers.get(H);if(!Q||B!==Q.key)return $;let X=new w$($.droppable.containers);return X.set(H,{...Q,disabled:J}),{...$,droppable:{...$.droppable,containers:X}}}case J2.UnregisterDroppable:{let{id:H,key:B}=Z,J=$.droppable.containers.get(H);if(!J||B!==J.key)return $;let Q=new w$($.droppable.containers);return Q.delete(H),{...$,droppable:{...$.droppable,containers:Q}}}default:return $}}function ua($){let{disabled:Z}=$,{active:H,activatorEvent:B,draggableNodes:J}=W0.useContext(UB),Q=ZB(B),X=ZB(H==null?void 0:H.id);return W0.useEffect(()=>{if(Z)return;if(!B&&Q&&X!=null){if(!Hz(Q))return;if(document.activeElement===Q.target)return;let z=J.get(X);if(!z)return;let{activatorNode:G,node:F}=z;if(!G.current&&!F.current)return;requestAnimationFrame(()=>{for(let U of[G.current,F.current]){if(!U)continue;let Y=_j(U);if(Y){Y.focus();break}}})}},[B,Z,J,X,Q]),null}function BT($,Z){let{transform:H,...B}=Z;return $!=null&&$.length?$.reduce((J,Q)=>{return Q({transform:J,...B})},H):H}function ca($){return W0.useMemo(()=>({draggable:{...Bz.draggable,...$==null?void 0:$.draggable},droppable:{...Bz.droppable,...$==null?void 0:$.droppable},dragOverlay:{...Bz.dragOverlay,...$==null?void 0:$.dragOverlay}}),[$==null?void 0:$.draggable,$==null?void 0:$.droppable,$==null?void 0:$.dragOverlay])}function da($){let{activeNode:Z,measure:H,initialRect:B,config:J=!0}=$,Q=W0.useRef(!1),{x:X,y:z}=typeof J==="boolean"?{x:J,y:J}:J;H9(()=>{if(!X&&!z||!Z){Q.current=!1;return}if(Q.current||!B)return;let F=Z==null?void 0:Z.node.current;if(!F||F.isConnected===!1)return;let U=H(F),Y=pj(U,B);if(!X)Y.x=0;if(!z)Y.y=0;if(Q.current=!0,Math.abs(Y.x)>0||Math.abs(Y.y)>0){let K=cj(F);if(K)K.scrollBy({top:Y.y,left:Y.x})}},[Z,X,z,B,H])}var Fz=W0.createContext({...P8,scaleX:1,scaleY:1}),A3;(function($){$[$.Uninitialized=0]="Uninitialized",$[$.Initializing=1]="Initializing",$[$.Initialized=2]="Initialized"})(A3||(A3={}));var JT=W0.memo(function(Z){var H,B,J,Q;let{id:X,accessibility:z,autoScroll:G=!0,children:F,sensors:U=va,collisionDetection:Y=Za,measuring:K,modifiers:W,...N}=Z,L=W0.useReducer(pa,void 0,ma),[V,A]=L,[D,q]=lr(),[_,M]=W0.useState(A3.Uninitialized),P=_===A3.Initialized,{draggable:{active:T,nodes:R,translate:y},droppable:{containers:w}}=V,h=T!=null?R.get(T):null,E=W0.useRef({initial:null,translated:null}),I=W0.useMemo(()=>{var T0;return T!=null?{id:T,data:(T0=h==null?void 0:h.data)!=null?T0:ga,rect:E}:null},[T,h]),j=W0.useRef(null),[S,k]=W0.useState(null),[b,v]=W0.useState(null),u=j$(N,Object.values(N)),C=HB("DndDescribedBy",X),t=W0.useMemo(()=>w.getEnabled(),[w]),H0=ca(K),{droppableRects:x,measureDroppableContainers:e,measuringScheduled:L0}=Ca(t,{dragging:P,dependencies:[y.x,y.y],config:H0.droppable}),d=ja(R,T),X0=W0.useMemo(()=>b?JB(b):null,[b]),K0=K1(),Q0=wa(d,H0.draggable.measure);da({activeNode:T!=null?R.get(T):null,config:K0.layoutShiftCompensation,initialRect:Q0,measure:H0.draggable.measure});let z0=kj(d,H0.draggable.measure,Q0),A0=kj(d?d.parentElement:null),i=W0.useRef({activatorEvent:null,active:null,activeNode:d,collisionRect:null,collisions:null,droppableRects:x,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:w,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),B0=w.getNodeFor((H=i.current.over)==null?void 0:H.id),$0=xa({measure:H0.dragOverlay.measure}),J0=(B=$0.nodeRef.current)!=null?B:d,n=P?(J=$0.rect)!=null?J:z0:null,f=Boolean($0.nodeRef.current&&$0.rect),l=Ia(f?null:z0),m=ej(J0?x2(J0):null),a=Ra(P?B0!=null?B0:d:null),o=ha(a),D0=BT(W,{transform:{x:y.x-l.x,y:y.y-l.y,scaleX:1,scaleY:1},activatorEvent:b,active:I,activeNodeRect:z0,containerNodeRect:A0,draggingNodeRect:n,over:i.current.over,overlayNodeRect:$0.rect,scrollableAncestors:a,scrollableAncestorRects:o,windowRect:m}),O0=X0?i6(X0,y):null,k0=ka(a),r0=yj(k0),p=yj(k0,[z0]),r=i6(D0,r0),Z0=n?Ja(n,D0):null,V0=I&&Z0?Y({active:I,collisionRect:Z0,droppableRects:x,droppableContainers:t,pointerCoordinates:O0}):null,j0=er(V0,"id"),[v0,z1]=W0.useState(null),Y1=f?D0:i6(D0,p),c0=Ha(Y1,(Q=v0==null?void 0:v0.rect)!=null?Q:null,z0),R0=W0.useRef(null),d0=W0.useCallback((T0,I0)=>{let{sensor:g0,options:e0}=I0;if(j.current==null)return;let l0=R.get(j.current);if(!l0)return;let L1=T0.nativeEvent,f1=new g0({active:j.current,activeNode:l0,event:L1,options:e0,context:i,onAbort(M1){if(!R.get(M1))return;let{onDragAbort:p5}=u.current,i5={id:M1};p5==null||p5(i5),D({type:"onDragAbort",event:i5})},onPending(M1,q5,p5,i5){if(!R.get(M1))return;let{onDragPending:Q1}=u.current,u0={id:M1,constraint:q5,initialCoordinates:p5,offset:i5};Q1==null||Q1(u0),D({type:"onDragPending",event:u0})},onStart(M1){let q5=j.current;if(q5==null)return;let p5=R.get(q5);if(!p5)return;let{onDragStart:i5}=u.current,x0={activatorEvent:L1,active:{id:q5,data:p5.data,rect:E}};a6.unstable_batchedUpdates(()=>{i5==null||i5(x0),M(A3.Initializing),A({type:J2.DragStart,initialCoordinates:M1,active:q5}),D({type:"onDragStart",event:x0}),k(R0.current),v(L1)})},onMove(M1){A({type:J2.DragMove,coordinates:M1})},onEnd:m1(J2.DragEnd),onCancel:m1(J2.DragCancel)});R0.current=f1;function m1(M1){return async function(){let{active:p5,collisions:i5,over:x0,scrollAdjustedTranslate:Q1}=i.current,u0=null;if(p5&&Q1){let{cancelDrop:A1}=u.current;if(u0={activatorEvent:L1,active:p5,collisions:i5,delta:Q1,over:x0},M1===J2.DragEnd&&typeof A1==="function"){if(await Promise.resolve(A1(u0)))M1=J2.DragCancel}}j.current=null,a6.unstable_batchedUpdates(()=>{A({type:M1}),M(A3.Uninitialized),z1(null),k(null),v(null),R0.current=null;let A1=M1===J2.DragEnd?"onDragEnd":"onDragCancel";if(u0){let y1=u.current[A1];y1==null||y1(u0),D({type:A1,event:u0})}})}}},[R]),p0=W0.useCallback((T0,I0)=>{return(g0,e0)=>{let l0=g0.nativeEvent,L1=R.get(e0);if(j.current!==null||!L1||l0.dndKit||l0.defaultPrevented)return;let f1={active:L1};if(T0(g0,I0.options,f1)===!0)l0.dndKit={capturedBy:I0.sensor},j.current=e0,d0(g0,I0)}},[R,d0]),s0=Ta(U,p0);ba(U),H9(()=>{if(z0&&_===A3.Initializing)M(A3.Initialized)},[z0,_]),W0.useEffect(()=>{let{onDragMove:T0}=u.current,{active:I0,activatorEvent:g0,collisions:e0,over:l0}=i.current;if(!I0||!g0)return;let L1={active:I0,activatorEvent:g0,collisions:e0,delta:{x:r.x,y:r.y},over:l0};a6.unstable_batchedUpdates(()=>{T0==null||T0(L1),D({type:"onDragMove",event:L1})})},[r.x,r.y]),W0.useEffect(()=>{let{active:T0,activatorEvent:I0,collisions:g0,droppableContainers:e0,scrollAdjustedTranslate:l0}=i.current;if(!T0||j.current==null||!I0||!l0)return;let{onDragOver:L1}=u.current,f1=e0.get(j0),m1=f1&&f1.rect.current?{id:f1.id,rect:f1.rect.current,data:f1.data,disabled:f1.disabled}:null,M1={active:T0,activatorEvent:I0,collisions:g0,delta:{x:l0.x,y:l0.y},over:m1};a6.unstable_batchedUpdates(()=>{z1(m1),L1==null||L1(M1),D({type:"onDragOver",event:M1})})},[j0]),H9(()=>{i.current={activatorEvent:b,active:I,activeNode:d,collisionRect:Z0,collisions:V0,droppableRects:x,draggableNodes:R,draggingNode:J0,draggingNodeRect:n,droppableContainers:w,over:v0,scrollableAncestors:a,scrollAdjustedTranslate:r},E.current={initial:n,translated:Z0}},[I,d,V0,Z0,R,J0,n,x,w,v0,a,r]),Pa({...K0,delta:y,draggingRect:Z0,pointerCoordinates:O0,scrollableAncestors:a,scrollableAncestorRects:o});let N0=W0.useMemo(()=>{return{active:I,activeNode:d,activeNodeRect:z0,activatorEvent:b,collisions:V0,containerNodeRect:A0,dragOverlay:$0,draggableNodes:R,droppableContainers:w,droppableRects:x,over:v0,measureDroppableContainers:e,scrollableAncestors:a,scrollableAncestorRects:o,measuringConfiguration:H0,measuringScheduled:L0,windowRect:m}},[I,d,z0,b,V0,A0,$0,R,w,x,v0,e,a,o,H0,L0,m]),b0=W0.useMemo(()=>{return{activatorEvent:b,activators:s0,active:I,activeNodeRect:z0,ariaDescribedById:{draggable:C},dispatch:A,draggableNodes:R,over:v0,measureDroppableContainers:e}},[b,s0,I,z0,A,C,R,v0,e]);return W0.default.createElement(gj.Provider,{value:q},W0.default.createElement(UB.Provider,{value:b0},W0.default.createElement(HT.Provider,{value:N0},W0.default.createElement(Fz.Provider,{value:c0},F)),W0.default.createElement(ua,{disabled:(z==null?void 0:z.restoreFocus)===!1})),W0.default.createElement(ar,{...z,hiddenTextDescribedById:C}));function K1(){let T0=(S==null?void 0:S.autoScrollEnabled)===!1,I0=typeof G==="object"?G.enabled===!1:G===!1,g0=P&&!T0&&!I0;if(typeof G==="object")return{...G,enabled:g0};return{enabled:g0}}}),la=W0.createContext(null),xj="button",ia="Draggable";function QT($){let{id:Z,data:H,disabled:B=!1,attributes:J}=$,Q=HB(ia),{activators:X,activatorEvent:z,active:G,activeNodeRect:F,ariaDescribedById:U,draggableNodes:Y,over:K}=W0.useContext(UB),{role:W=xj,roleDescription:N="draggable",tabIndex:L=0}=J!=null?J:{},V=(G==null?void 0:G.id)===Z,A=W0.useContext(V?Fz:la),[D,q]=$B(),[_,M]=$B(),P=ya(X,Z),T=j$(H);H9(()=>{return Y.set(Z,{id:Z,key:Q,node:D,activatorNode:_,data:T}),()=>{let y=Y.get(Z);if(y&&y.key===Q)Y.delete(Z)}},[Y,Z]);let R=W0.useMemo(()=>({role:W,tabIndex:L,"aria-disabled":B,"aria-pressed":V&&W===xj?!0:void 0,"aria-roledescription":N,"aria-describedby":U.draggable}),[B,W,L,V,N,U.draggable]);return{active:G,activatorEvent:z,activeNodeRect:F,attributes:R,isDragging:V,listeners:B?void 0:P,node:D,over:K,setNodeRef:q,setActivatorNodeRef:M,transform:A}}function ra(){return W0.useContext(HT)}var aa="Droppable",na={timeout:25};function XT($){let{data:Z,disabled:H=!1,id:B,resizeObserverConfig:J}=$,Q=HB(aa),{active:X,dispatch:z,over:G,measureDroppableContainers:F}=W0.useContext(UB),U=W0.useRef({disabled:H}),Y=W0.useRef(!1),K=W0.useRef(null),W=W0.useRef(null),{disabled:N,updateMeasurementsFor:L,timeout:V}={...na,...J},A=j$(L!=null?L:B),D=W0.useCallback(()=>{if(!Y.current){Y.current=!0;return}if(W.current!=null)clearTimeout(W.current);W.current=setTimeout(()=>{F(Array.isArray(A.current)?A.current:[A.current]),W.current=null},V)},[V]),q=Gz({callback:D,disabled:N||!X}),_=W0.useCallback((R,y)=>{if(!q)return;if(y)q.unobserve(y),Y.current=!1;if(R)q.observe(R)},[q]),[M,P]=$B(_),T=j$(Z);return W0.useEffect(()=>{if(!q||!M.current)return;q.disconnect(),Y.current=!1,q.observe(M.current)},[M,q]),W0.useEffect(()=>{return z({type:J2.RegisterDroppable,element:{id:B,key:Q,disabled:H,node:M,rect:K,data:T}}),()=>z({type:J2.UnregisterDroppable,key:Q,id:B})},[B]),W0.useEffect(()=>{if(H!==U.current.disabled)z({type:J2.SetDroppableDisabled,id:B,key:Q,disabled:H}),U.current.disabled=H},[B,Q,H,z]),{active:X,rect:K,isOver:(G==null?void 0:G.id)===B,node:M,over:G,setNodeRef:P}}function oa($){let{animation:Z,children:H}=$,[B,J]=W0.useState(null),[Q,X]=W0.useState(null),z=ZB(H);if(!H&&!B&&z)J(z);return H9(()=>{if(!Q)return;let G=B==null?void 0:B.key,F=B==null?void 0:B.props.id;if(G==null||F==null){J(null);return}Promise.resolve(Z(F,Q)).then(()=>{J(null)})},[Z,B,Q]),W0.default.createElement(W0.default.Fragment,null,H,B?W0.cloneElement(B,{ref:X}):null)}var sa={x:0,y:0,scaleX:1,scaleY:1};function ta($){let{children:Z}=$;return W0.default.createElement(UB.Provider,{value:ZT},W0.default.createElement(Fz.Provider,{value:sa},Z))}var ea={position:"fixed",touchAction:"none"},$n=($)=>{return Hz($)?"transform 250ms ease":void 0},Zn=W0.forwardRef(($,Z)=>{let{as:H,activatorEvent:B,adjustScale:J,children:Q,className:X,rect:z,style:G,transform:F,transition:U=$n}=$;if(!z)return null;let Y=J?F:{...F,scaleX:1,scaleY:1},K={...ea,width:z.width,height:z.height,top:z.top,left:z.left,transform:_$.Transform.toString(Y),transformOrigin:J&&B?or(B,z):void 0,transition:typeof U==="function"?U(B):U,...G};return W0.default.createElement(H,{className:X,style:K,ref:Z},Q)}),Hn=($)=>(Z)=>{let{active:H,dragOverlay:B}=Z,J={},{styles:Q,className:X}=$;if(Q!=null&&Q.active)for(let[z,G]of Object.entries(Q.active)){if(G===void 0)continue;J[z]=H.node.style.getPropertyValue(z),H.node.style.setProperty(z,G)}if(Q!=null&&Q.dragOverlay)for(let[z,G]of Object.entries(Q.dragOverlay)){if(G===void 0)continue;B.node.style.setProperty(z,G)}if(X!=null&&X.active)H.node.classList.add(X.active);if(X!=null&&X.dragOverlay)B.node.classList.add(X.dragOverlay);return function(){for(let[G,F]of Object.entries(J))H.node.style.setProperty(G,F);if(X!=null&&X.active)H.node.classList.remove(X.active)}},Bn=($)=>{let{transform:{initial:Z,final:H}}=$;return[{transform:_$.Transform.toString(Z)},{transform:_$.Transform.toString(H)}]},Jn={duration:250,easing:"ease",keyframes:Bn,sideEffects:Hn({styles:{active:{opacity:"0"}}})};function Qn($){let{config:Z,draggableNodes:H,droppableContainers:B,measuringConfiguration:J}=$;return eH((Q,X)=>{if(Z===null)return;let z=H.get(Q);if(!z)return;let G=z.node.current;if(!G)return;let F=$T(X);if(!F)return;let{transform:U}=x2(X).getComputedStyle(X),Y=uj(U);if(!Y)return;let K=typeof Z==="function"?Z:Xn(Z);return nj(G,J.draggable.measure),K({active:{id:Q,data:z.data,node:G,rect:J.draggable.measure(G)},draggableNodes:H,dragOverlay:{node:X,rect:J.dragOverlay.measure(F)},droppableContainers:B,measuringConfiguration:J,transform:Y})})}function Xn($){let{duration:Z,easing:H,sideEffects:B,keyframes:J}={...Jn,...$};return(Q)=>{let{active:X,dragOverlay:z,transform:G,...F}=Q;if(!Z)return;let U={x:z.rect.left-X.rect.left,y:z.rect.top-X.rect.top},Y={scaleX:G.scaleX!==1?X.rect.width*G.scaleX/z.rect.width:1,scaleY:G.scaleY!==1?X.rect.height*G.scaleY/z.rect.height:1},K={x:G.x-U.x,y:G.y-U.y,...Y},W=J({...F,active:X,dragOverlay:z,transform:{initial:G,final:K}}),[N]=W,L=W[W.length-1];if(JSON.stringify(N)===JSON.stringify(L))return;let V=B==null?void 0:B({active:X,dragOverlay:z,...F}),A=z.node.animate(W,{duration:Z,easing:H,fill:"forwards"});return new Promise((D)=>{A.onfinish=()=>{V==null||V(),D()}})}}var vj=0;function zn($){return W0.useMemo(()=>{if($==null)return;return vj++,vj},[$])}var zT=W0.default.memo(($)=>{let{adjustScale:Z=!1,children:H,dropAnimation:B,style:J,transition:Q,modifiers:X,wrapperElement:z="div",className:G,zIndex:F=999}=$,{activatorEvent:U,active:Y,activeNodeRect:K,containerNodeRect:W,draggableNodes:N,droppableContainers:L,dragOverlay:V,over:A,measuringConfiguration:D,scrollableAncestors:q,scrollableAncestorRects:_,windowRect:M}=ra(),P=W0.useContext(Fz),T=zn(Y==null?void 0:Y.id),R=BT(X,{activatorEvent:U,active:Y,activeNodeRect:K,containerNodeRect:W,draggingNodeRect:V.rect,over:A,overlayNodeRect:V.rect,scrollableAncestors:q,scrollableAncestorRects:_,transform:P,windowRect:M}),y=kW(K),w=Qn({config:B,draggableNodes:N,droppableContainers:L,measuringConfiguration:D}),h=y?V.setRef:void 0;return W0.default.createElement(ta,null,W0.default.createElement(oa,{animation:w},Y&&T?W0.default.createElement(Zn,{key:T,id:Y.id,ref:h,as:z,activatorEvent:U,adjustScale:Z,className:G,transition:Q,rect:y,style:{zIndex:F,...J},transform:R},H):null))});var n6=O(c(),1),Gn={start:[v1.Space],cancel:[v1.Esc],end:[v1.Space,v1.Tab]};function Fn($,Z,H){let B=$.indexOf(Z),J=$.indexOf(H);if(B<0||J<0||B===J)return $;let Q=[...$],[X]=Q.splice(B,1);return Q.splice(J,0,X),Q}function Uz({items:$,getId:Z,className:H,itemClassName:B,dragDisabled:J=!1,onReorder:Q,renderItem:X,renderPlaceholder:z,renderOverlay:G}){let F=fj(IW(FB,{activationConstraint:{distance:4}}),IW(GB,{keyboardCodes:Gn})),[U,Y]=V3.useState(null),[K,W]=V3.useState(null),N=V3.useRef(null),L=V3.useMemo(()=>$.map(Z),[$,Z]),V=V3.useMemo(()=>new Map($.map((T)=>[Z(T),T])),[$,Z]),D=(U&&K?K:L).map((T)=>V.get(T)).filter((T)=>Boolean(T)),q=U?V.get(U):void 0,_=J||$.length<2;return n6.jsxs(JT,{sensors:F,collisionDetection:mj,onDragStart:(T)=>{let R=$.map(Z);Y(String(T.active.id)),N.current=R,W(R)},onDragOver:(T)=>{let R=String(T.active.id),y=T.over?String(T.over.id):void 0,w=N.current;if(!y||y===R||!w)return;let h=Fn(w,R,y);if(h===w)return;N.current=h,W(h)},onDragCancel:()=>{N.current=null,Y(null),W(null)},onDragEnd:(T)=>{let R=String(T.active.id),y=N.current;if(N.current=null,Y(null),W(null),!y||y.join("|")===L.join("|"))return;if(!y.includes(R))return;Q(y)},children:[n6.jsx("div",{className:H,children:D.map((T)=>n6.jsx(Un,{id:Z(T),item:T,disabled:_,itemClassName:B,renderItem:X,renderPlaceholder:z},Z(T)))}),n6.jsx(zT,{dropAnimation:null,children:q&&G?G(q):null})]})}function Un({id:$,item:Z,disabled:H,itemClassName:B,renderItem:J,renderPlaceholder:Q}){let{setNodeRef:X,isOver:z}=XT({id:$,disabled:H}),{attributes:G,listeners:F,setNodeRef:U,isDragging:Y}=QT({id:$,disabled:H,attributes:{roleDescription:"sortable item"}}),K=(N)=>{X(N),U(N)},W={isDragging:Y,isOver:z,dragDisabled:H,dragHandleProps:H?{}:{...G,...F}};return n6.jsxs(B5.div,{layout:!0,ref:K,className:s("relative",B?.(Z,W)),transition:{type:"spring",duration:0.25,bounce:0},children:[Y&&Q?.(Z),J(Z,W)]})}var W1=O(c(),1);function Yn($){return s(u6({variant:"ghost",size:"icon"}),$&&"bg-accent text-accent-foreground")}function Yz({children:$,showWorkspaces:Z=!0}){let{data:H}=jX(),B=$1();return B2((J)=>{if(J.type==="workspace:updated"||J.type==="workspaces-list:updated")B.invalidateQueries({queryKey:w0.all,exact:!0})}),W1.jsxs("div",{className:"flex h-dvh bg-muted transition-colors duration-100 ease-out motion-reduce:transition-none",children:[W1.jsx(Kn,{workspaces:Z?H??[]:[]}),W1.jsx("main",{className:"flex min-w-0 flex-1 flex-col",children:$})]})}function Kn({workspaces:$}){let Z=XO(),{cloudDemo:H}=Z9();return W1.jsx(qX,{delay:500,children:W1.jsxs("aside",{className:"flex h-full shrink-0 flex-col items-center gap-4 px-2 py-5 [font-family:var(--default-sans)]",children:[W1.jsxs(r1,{children:[W1.jsx(a1,{render:W1.jsx(YH,{href:"/","aria-label":"Home",className:Yn,children:W1.jsx(FT,{stroke:1.5})})}),W1.jsx(n1,{side:"right",children:"Home"})]}),W1.jsx("nav",{className:"flex max-h-full min-h-0 w-14 flex-1 flex-col items-center justify-center gap-4",children:$.length>0&&W1.jsxs(W1.Fragment,{children:[W1.jsx("div",{className:"no-scrollbar min-h-0 scroll-fade overflow-y-auto [--scroll-fade-reveal:16px]",children:W1.jsx(Uz,{items:$,getId:(B)=>B.id,className:"flex flex-col gap-4",onReorder:(B)=>Z.mutate(B),renderPlaceholder:()=>W1.jsx("div",{className:"pointer-events-none absolute top-0 left-1 size-10 rounded-xl bg-accent"}),renderOverlay:(B)=>W1.jsx(GT,{workspace:B,dragOverlay:!0}),renderItem:(B,J)=>W1.jsx(GT,{workspace:B,dragState:J})})}),W1.jsx("div",{className:"shrink-0",children:W1.jsxs(r1,{children:[W1.jsx(sH,{trigger:W1.jsx(a1,{render:W1.jsx(C0,{type:"button",variant:"ghost",size:"icon-lg","aria-label":"Create new workspace",className:"text-muted-foreground hover:text-foreground",children:W1.jsx(K4,{"data-icon":"inline-start",stroke:1.5})})})}),W1.jsx(n1,{side:"right",children:"Create new workspace"})]})})]})}),W1.jsx("div",{className:"size-8 shrink-0",children:H?W1.jsx(M$,{trigger:W1.jsx(C0,{size:"icon","aria-label":"Unlock all features",title:"Unlock all features",children:W1.jsx(UT,{stroke:1.5})})}):W1.jsx(NO,{})})]})})}function GT({workspace:$,dragOverlay:Z=!1,dragState:H}){let[B]=p4(),J=`/workspace/${$.id}`,Q=c6($),X=B===J||B.startsWith(`${J}/`),z=W1.jsx("div",{className:s(u6({variant:"ghost",size:"icon-lg"}),"pointer-events-none size-12 transition-[border-radius,background-color,color] duration-100 ease-out motion-reduce:transition-none",Z?"bg-background shadow-lg":"group-hover:bg-accent group-hover:text-accent-foreground group-focus-visible:ring-3 group-focus-visible:ring-ring/50",X&&!Z&&"bg-accent text-accent-foreground"),children:W1.jsx("img",{src:$.icon??M8[$.type??"claude-code"],alt:"",className:"size-7 shrink-0 rounded-xs transition-[border-radius] duration-100 ease-out motion-reduce:transition-none"})}),G=W1.jsx("span",{className:"mt-0.5 line-clamp-2 w-full text-center text-[11px] leading-snug font-medium text-ellipsis text-foreground",children:Q});if(Z)return W1.jsxs("span",{className:"flex w-14 flex-col items-center",children:[z,G]});return W1.jsxs(YH,{href:J,"aria-label":Q,onClick:(F)=>{if(H?.isDragging)F.preventDefault()},className:s("group flex w-14 flex-col items-center rounded-lg outline-none",H?.isDragging&&"invisible"),...H?.dragHandleProps,children:[z,W1.jsxs(r1,{children:[W1.jsx(a1,{render:G}),W1.jsx(n1,{side:"right",children:Q})]})]})}var $w=O(g(),1);var YT=O(g(),1);var E$=O(c(),1);function Wn({choice:$,availability:Z,isPending:H,errorMessage:B,onTypeChange:J,onCancel:Q,onSubmit:X}){return E$.jsx(tX,{title:`Import ${c6($.workspace)}`,selectedType:$.selectedType,detectedTypes:$.workspace.types,availability:Z,isPending:H,errorMessage:B,secondaryAction:E$.jsx(C0,{variant:"secondary",onClick:Q,disabled:H,children:"Cancel"}),primaryLabel:"Add workspace",pendingLabel:"Adding…",onTypeChange:J,onSubmit:X})}function KT({choice:$,availability:Z,isPending:H,errorMessage:B,onTypeChange:J,onSubmit:Q,onReset:X}){let[z,G]=YT.useState(!0);function F(Y){if(!Y&&H)return;G(Y)}function U(Y){if(!Y)X()}return E$.jsx(Y3,{open:z,onOpenChange:F,onOpenChangeComplete:U,children:E$.jsx(eX,{closeDisabled:H,children:E$.jsx(Wn,{choice:$,availability:Z,isPending:H,errorMessage:B,onTypeChange:J,onCancel:()=>G(!1),onSubmit:Q})})})}var WT=O(g(),1);function Nn($){return $.types[0]??D$[0]}function NT({onSuccess:$}){let Z=JO(),[H,B]=WT.useState(null);function J(G){Z.reset(),B({workspace:G,selectedType:Nn(G)})}function Q(G){B((F)=>F?{...F,selectedType:G}:F)}function X(){if(!H||Z.isPending)return;Z.mutate({path:H.workspace.path,type:H.selectedType},{onSuccess:$})}function z(){B(null),Z.reset()}return{choice:H,isPending:Z.isPending,error:Z.error,startImport:J,selectType:Q,submit:X,reset:z}}var KB=O(g(),1);var WB=O(c(),1),Ln=[["OOOOO","O.O.O","O.O.O"],["OOO","O.O","OOO"],["O","O","O"]],D3=10,Kz=3,An=2.5,Vn={O:1,o:0.5,".":0},Dn=3000,qn=2,LT=3,q3=3,AT=0.001,o6={courantSquared:0.14,damping:0.976,driveAmplitude:1.4,driveFrequency:0.027,gain:0.65,fadeIn:0.36,fadeOut:0.1};function Mn($){let Z=Math.max(...$.map((Q)=>Q.length)),H=Z*D3+(Z-1)*Kz,B=$.length*D3+($.length-1)*Kz,J=[];return $.forEach((Q,X)=>{Array.from(Q).forEach((z,G)=>{let F=Vn[z];if(F===void 0)return;let U=G*(D3+Kz),Y=X*(D3+Kz);J.push({x:U,y:Y,centerX:U+D3/2,centerY:Y+D3/2,targetOpacity:F})})}),{width:H,height:B,fieldColumns:Math.round(H/q3)+1,fieldRows:Math.round(B/q3)+1,pixels:J}}var Pn=Ln.map(Mn);function YB($,Z,H){return $<Z?Z:$>H?H:$}function _n($){return $<0.5?2*$*$:1-(-2*$+2)**2/2}class VT{rects;svg;geometry;animationFrame=0;running=!1;intro=!0;introStartedAt=-1;field;previousField;nextField;pointerActive=!1;pointerX=0;pointerY=0;activation=0;constructor($,Z,H){this.rects=$,this.svg=Z,this.geometry=H;let B=H.fieldColumns*H.fieldRows;this.field=new Float32Array(B),this.previousField=new Float32Array(B),this.nextField=new Float32Array(B)}start(){this.seedImpulse(),this.activation=1,this.resume()}stop(){cancelAnimationFrame(this.animationFrame),this.running=!1}handlePointerMove=($)=>{let Z=this.svg.getBoundingClientRect();if(!Z.width||!Z.height)return;if(this.pointerActive=$.clientX>=Z.left&&$.clientX<=Z.right&&$.clientY>=Z.top&&$.clientY<=Z.bottom,this.pointerActive)this.pointerX=($.clientX-Z.left)/Z.width*this.geometry.width,this.pointerY=($.clientY-Z.top)/Z.height*this.geometry.height,this.resume()};seedImpulse(){let $=Math.round(this.geometry.width/2/q3),Z=Math.round(this.geometry.height/2/q3),H=2*LT*LT;for(let B=0;B<this.geometry.fieldRows;B++)for(let J=0;J<this.geometry.fieldColumns;J++){let Q=(J-$)**2+(B-Z)**2,X=qn*Math.exp(-Q/H),z=B*this.geometry.fieldColumns+J;this.field[z]=X,this.previousField[z]=X}}resume(){if(this.running)return;this.running=!0,this.animationFrame=requestAnimationFrame(this.animate)}animate=($)=>{if(this.stepWave(),this.pointerActive)this.driveWave($);if(this.intro&&!this.pointerActive){if(this.introStartedAt<0)this.introStartedAt=$;let H=($-this.introStartedAt)/Dn;if(this.activation=1-_n(Math.min(1,H)),H>=1)this.intro=!1}else{this.intro=!1;let H=this.pointerActive?1:0,B=this.pointerActive?o6.fadeIn:o6.fadeOut;this.activation+=(H-this.activation)*B}let Z=this.renderWave();if(this.intro||this.pointerActive||this.activation>AT||Z>AT){this.animationFrame=requestAnimationFrame(this.animate);return}this.running=!1,this.activation=0,this.renderTargets()};stepWave(){let{fieldColumns:$,fieldRows:Z}=this.geometry;for(let B=1;B<Z-1;B++)for(let J=1;J<$-1;J++){let Q=B*$+J,X=this.field[Q-1]+this.field[Q+1]+this.field[Q-$]+this.field[Q+$]-4*this.field[Q];this.nextField[Q]=(2*this.field[Q]-this.previousField[Q]+o6.courantSquared*X)*o6.damping}let H=this.previousField;this.previousField=this.field,this.field=this.nextField,this.nextField=H}driveWave($){let Z=YB(Math.round(this.pointerX/q3),1,this.geometry.fieldColumns-2),H=YB(Math.round(this.pointerY/q3),1,this.geometry.fieldRows-2);this.field[H*this.geometry.fieldColumns+Z]=o6.driveAmplitude*Math.sin($*o6.driveFrequency)}sampleField($,Z){let H=YB($/q3,0,this.geometry.fieldColumns-1),B=YB(Z/q3,0,this.geometry.fieldRows-1),J=Math.floor(H),Q=Math.floor(B),X=Math.min(J+1,this.geometry.fieldColumns-1),z=Math.min(Q+1,this.geometry.fieldRows-1),G=H-J,F=B-Q,{fieldColumns:U}=this.geometry,Y=this.field[Q*U+J],K=this.field[Q*U+X],W=this.field[z*U+J],N=this.field[z*U+X];return(Y*(1-G)+K*G)*(1-F)+(W*(1-G)+N*G)*F}renderWave(){let $=0;return this.geometry.pixels.forEach((Z,H)=>{let B=this.rects[H];if(!B)return;let J=this.sampleField(Z.centerX,Z.centerY);$=Math.max($,Math.abs(J));let Q=YB(0.5+J*o6.gain,0,1),X=Z.targetOpacity*(1-this.activation)+Q*this.activation;B.setAttribute("opacity",X.toFixed(3))}),$}renderTargets(){this.geometry.pixels.forEach(($,Z)=>{this.rects[Z]?.setAttribute("opacity",String($.targetOpacity))})}}function On({geometry:$}){let Z=KB.useRef([]),H=KB.useRef(null);return KB.useEffect(()=>{let B=H.current;if(!B||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let J=new VT(Z.current,B,$);return J.start(),window.addEventListener("pointermove",J.handlePointerMove),()=>{J.stop(),window.removeEventListener("pointermove",J.handlePointerMove)}},[$]),WB.jsx("svg",{ref:H,className:"h-8 w-auto",viewBox:`0 0 ${$.width} ${$.height}`,fill:"currentColor","aria-hidden":"true",children:$.pixels.map((B,J)=>WB.jsx("rect",{ref:(Q)=>{Z.current[J]=Q},x:B.x,y:B.y,width:D3,height:D3,rx:An,opacity:B.targetOpacity},`${B.x}-${B.y}`))})}function DT({className:$}){return WB.jsx("div",{role:"img","aria-label":"moi",className:s("flex items-center gap-2 text-accent",$),children:Pn.map((Z,H)=>WB.jsx(On,{geometry:Z},H))})}var S$={};O4(S$,{Trigger:()=>TT,Root:()=>jT,Panel:()=>ET});var NB=O(g(),1);var I4=O(g(),1);function qT($){let{open:Z,defaultOpen:H,onOpenChange:B,disabled:J}=$,Q=Z!==void 0,[X,z]=s4({controlled:Z,default:H,name:"Collapsible",state:"open"}),{mounted:G,setMounted:F,transitionStatus:U}=l4(X,!0,!0),[Y,K]=I4.useState(X),[{height:W,width:N},L]=I4.useState({height:void 0,width:void 0}),V=Z1(),[A,D]=I4.useState(),q=A??V,[_,M]=I4.useState(!1),[P,T]=I4.useState(!1),R=I4.useRef(null),y=I4.useRef(null),w=I4.useRef(null),h=I4.useRef(null),E=p8(h,!1),I=Y0((j)=>{let S=!X,k=M0(G0.triggerPress,j.nativeEvent);if(B(S,k),k.isCanceled)return;let b=h.current;if(y.current==="css-animation"&&b!=null)b.style.removeProperty("animation-name");if(!_&&!P){if(y.current!=null&&y.current!=="css-animation"){if(!G&&S)F(!0)}if(y.current==="css-animation"){if(!Y&&S)K(!0);if(!G&&S)F(!0)}}if(z(S),y.current==="none"&&G&&!S)F(!1)});return U0(()=>{if(Q&&y.current==="none"&&!P&&!X)F(!1)},[Q,P,X,Z,F]),I4.useMemo(()=>({abortControllerRef:R,animationTypeRef:y,disabled:J,handleTrigger:I,height:W,mounted:G,open:X,panelId:q,panelRef:h,runOnceAnimationsFinish:E,setDimensions:L,setHiddenUntilFound:M,setKeepMounted:T,setMounted:F,setOpen:z,setPanelIdState:D,setVisible:K,transitionDimensionRef:w,transitionStatus:U,visible:Y,width:N}),[R,y,J,I,W,G,X,q,h,E,L,M,T,F,z,K,w,U,Y,N])}var Wz=O(g(),1),bW=Wz.createContext(void 0);function Nz(){let $=Wz.useContext(bW);if($===void 0)throw Error(E0(15));return $}var s6=function($){return $.open="data-open",$.closed="data-closed",$[$.startingStyle=m8.startingStyle]="startingStyle",$[$.endingStyle=m8.endingStyle]="endingStyle",$}({});var MT=function($){return $.panelOpen="data-panel-open",$}({});var jn={[s6.open]:""},Tn={[s6.closed]:""},PT={open($){if($)return{[MT.panelOpen]:""};return null}},_T={open($){if($)return jn;return Tn}};var Lz={..._T,...i1};var OT=O(c(),1),jT=NB.forwardRef(function(Z,H){let{render:B,className:J,defaultOpen:Q=!1,disabled:X=!1,onOpenChange:z,open:G,...F}=Z,U=Y0(z),Y=qT({open:G,defaultOpen:Q,onOpenChange:U,disabled:X}),K=NB.useMemo(()=>({open:Y.open,disabled:Y.disabled,transitionStatus:Y.transitionStatus}),[Y.open,Y.disabled,Y.transitionStatus]),W=NB.useMemo(()=>({...Y,onOpenChange:U,state:K}),[Y,U,K]),N=F0("div",Z,{state:K,ref:H,props:F,stateAttributesMapping:Lz});return OT.jsx(bW.Provider,{value:W,children:N})});var Az=O(g(),1);var Cn={...PT,...i1},TT=Az.forwardRef(function(Z,H){let{panelId:B,open:J,handleTrigger:Q,state:X,disabled:z}=Nz(),{className:G,disabled:F=z,id:U,render:Y,nativeButton:K=!0,...W}=Z,{getButtonProps:N,buttonRef:L}=u5({disabled:F,focusableWhenDisabled:!0,native:K}),V=Az.useMemo(()=>({"aria-controls":J?B:void 0,"aria-expanded":J,onClick:Q}),[B,J,Q]);return F0("button",Z,{state:X,ref:[H,L],props:[V,W,N],stateAttributesMapping:Cn})});var Vz=O(g(),1);var B9=O(g(),1);var CT=function($){return $.disabled="data-disabled",$.orientation="data-orientation",$}({});function wT($){let{abortControllerRef:Z,animationTypeRef:H,externalRef:B,height:J,hiddenUntilFound:Q,keepMounted:X,id:z,mounted:G,onOpenChange:F,open:U,panelRef:Y,runOnceAnimationsFinish:K,setDimensions:W,setMounted:N,setOpen:L,setVisible:V,transitionDimensionRef:A,visible:D,width:q}=$,_=B9.useRef(!1),M=B9.useRef(null),P=B9.useRef(U),T=B9.useRef(U),R=G4(),y=B9.useMemo(()=>{if(H.current==="css-animation")return!D;return!U&&!G},[U,G,D,H]),w=Y0((E)=>{if(!E)return;if(H.current==null||A.current==null){let S=getComputedStyle(E),k=S.animationName!=="none"&&S.animationName!=="",b=S.transitionDuration!=="0s"&&S.transitionDuration!=="";if(k&&b);else if(S.animationName==="none"&&S.transitionDuration!=="0s")H.current="css-transition";else if(S.animationName!=="none"&&S.transitionDuration==="0s")H.current="css-animation";else H.current="none";if(E.getAttribute(CT.orientation)==="horizontal"||S.transitionProperty.indexOf("width")>-1)A.current="width";else A.current="height"}if(H.current!=="css-transition")return;if(J===void 0||q===void 0){if(W({height:E.scrollHeight,width:E.scrollWidth}),T.current)E.style.setProperty("transition-duration","0s")}let I=-1,j=-1;return I=N5.request(()=>{T.current=!1,j=N5.request(()=>{setTimeout(()=>{E.style.removeProperty("transition-duration")})})}),()=>{N5.cancel(I),N5.cancel(j)}}),h=T4(B,Y,w);return U0(()=>{if(H.current!=="css-transition")return;let E=Y.current;if(!E)return;let I=-1;if(Z.current!=null)Z.current.abort(),Z.current=null;if(U){let j={"justify-content":E.style.justifyContent,"align-items":E.style.alignItems,"align-content":E.style.alignContent,"justify-items":E.style.justifyItems};if(Object.keys(j).forEach((S)=>{E.style.setProperty(S,"initial","important")}),!T.current&&!X)E.setAttribute(s6.startingStyle,"");W({height:E.scrollHeight,width:E.scrollWidth}),I=N5.request(()=>{Object.entries(j).forEach(([S,k])=>{if(k==="")E.style.removeProperty(S);else E.style.setProperty(S,k)})})}else{if(E.scrollHeight===0&&E.scrollWidth===0)return;W({height:E.scrollHeight,width:E.scrollWidth});let j=new AbortController;Z.current=j;let S=j.signal,k=null,b=s6.endingStyle;return k=new MutationObserver((v)=>{if(v.some((C)=>C.type==="attributes"&&C.attributeName===b))k?.disconnect(),k=null,K(()=>{if(W({height:0,width:0}),E.style.removeProperty("content-visibility"),N(!1),Z.current===j)Z.current=null},S)}),k.observe(E,{attributes:!0,attributeFilter:[b]}),()=>{if(k?.disconnect(),R.cancel(),Z.current===j)j.abort(),Z.current=null}}return()=>{N5.cancel(I)}},[Z,H,R,Q,X,G,U,Y,K,W,N]),U0(()=>{if(H.current!=="css-animation")return;let E=Y.current;if(!E)return;if(M.current=E.style.animationName||M.current,E.style.setProperty("animation-name","none"),W({height:E.scrollHeight,width:E.scrollWidth}),!P.current&&!_.current)E.style.removeProperty("animation-name");if(U){if(Z.current!=null)Z.current.abort(),Z.current=null;N(!0),V(!0)}else Z.current=new AbortController,K(()=>{N(!1),V(!1),Z.current=null},Z.current.signal)},[Z,H,U,Y,K,W,N,V,D]),E2(()=>{let E=N5.request(()=>{P.current=!1});return()=>N5.cancel(E)}),U0(()=>{if(!Q)return;let E=Y.current;if(!E)return;let I=-1,j=-1;if(U&&_.current)E.style.transitionDuration="0s",W({height:E.scrollHeight,width:E.scrollWidth}),I=N5.request(()=>{_.current=!1,j=N5.request(()=>{setTimeout(()=>{E.style.removeProperty("transition-duration")})})});return()=>{N5.cancel(I),N5.cancel(j)}},[Q,U,Y,W]),U0(()=>{let E=Y.current;if(E&&Q&&y){if(E.setAttribute("hidden","until-found"),H.current==="css-transition")E.setAttribute(s6.startingStyle,"")}},[Q,y,H,Y]),B9.useEffect(function(){let I=Y.current;if(!I)return;function j(S){_.current=!0,L(!0),F(!0,M0(G0.none,S))}return I.addEventListener("beforematch",j),()=>{I.removeEventListener("beforematch",j)}},[F,Y,L]),B9.useMemo(()=>({props:{hidden:y,id:z,ref:h}}),[y,z,h])}var yW=function($){return $.collapsiblePanelHeight="--collapsible-panel-height",$.collapsiblePanelWidth="--collapsible-panel-width",$}({});var ET=Vz.forwardRef(function(Z,H){let{className:B,hiddenUntilFound:J,keepMounted:Q,render:X,id:z,...G}=Z,{abortControllerRef:F,animationTypeRef:U,height:Y,mounted:K,onOpenChange:W,open:N,panelId:L,panelRef:V,runOnceAnimationsFinish:A,setDimensions:D,setHiddenUntilFound:q,setKeepMounted:_,setMounted:M,setPanelIdState:P,setOpen:T,setVisible:R,state:y,transitionDimensionRef:w,visible:h,width:E,transitionStatus:I}=Nz(),j=J??!1,S=Q??!1;U0(()=>{if(z)return P(z),()=>{P(void 0)};return},[z,P]),U0(()=>{q(j)},[q,j]),U0(()=>{_(S)},[_,S]);let{props:k}=wT({abortControllerRef:F,animationTypeRef:U,externalRef:H,height:Y,hiddenUntilFound:j,id:L,keepMounted:S,mounted:K,onOpenChange:W,open:N,panelRef:V,runOnceAnimationsFinish:A,setDimensions:D,setMounted:M,setOpen:T,setVisible:R,transitionDimensionRef:w,visible:h,width:E});y5({open:N&&I==="idle",ref:V,onComplete(){if(!N)return;D({height:void 0,width:void 0})}});let b=Vz.useMemo(()=>({...y,transitionStatus:I}),[y,I]),v=F0("div",Z,{state:b,ref:[H,V],props:[k,{style:{[yW.collapsiblePanelHeight]:Y===void 0?"auto":`${Y}px`,[yW.collapsiblePanelWidth]:E===void 0?"auto":`${E}px`}},G],stateAttributesMapping:Lz});if(!(S||j||!S&&K))return null;return v});var Pz=O(c(),1);function Dz({...$}){return Pz.jsx(S$.Root,{"data-slot":"collapsible",...$})}function qz({...$}){return Pz.jsx(S$.Trigger,{"data-slot":"collapsible-trigger",...$})}function Mz({...$}){return Pz.jsx(S$.Panel,{"data-slot":"collapsible-content",...$})}var JG=O(g(),1);var wn=($,Z)=>{if(typeof $!=="number")return;if(Z===3)return{mode:"rgb",r:($>>8&15|$>>4&240)/255,g:($>>4&15|$&240)/255,b:($&15|$<<4&240)/255};if(Z===4)return{mode:"rgb",r:($>>12&15|$>>8&240)/255,g:($>>8&15|$>>4&240)/255,b:($>>4&15|$&240)/255,alpha:($&15|$<<4&240)/255};if(Z===6)return{mode:"rgb",r:($>>16&255)/255,g:($>>8&255)/255,b:($&255)/255};if(Z===8)return{mode:"rgb",r:($>>24&255)/255,g:($>>16&255)/255,b:($>>8&255)/255,alpha:($&255)/255}},_z=wn;var En={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ST=En;var Sn=($)=>{return _z(ST[$.toLowerCase()],6)},IT=Sn;var In=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,Rn=($)=>{let Z;return(Z=$.match(In))?_z(parseInt(Z[1],16),Z[1].length):void 0},RT=Rn;var Oz="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";var t6="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%";var LB="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var kT="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(deg|grad|rad|turn)|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var M3="\\s*,\\s*";var _C0=new RegExp("^(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)|none)$");var kn=new RegExp(`^rgba?\\(\\s*${Oz}${M3}${Oz}${M3}${Oz}\\s*(?:,\\s*${LB}\\s*)?\\)$`),bn=new RegExp(`^rgba?\\(\\s*${t6}${M3}${t6}${M3}${t6}\\s*(?:,\\s*${LB}\\s*)?\\)$`),yn=($)=>{let Z={mode:"rgb"},H;if(H=$.match(kn)){if(H[1]!==void 0)Z.r=H[1]/255;if(H[2]!==void 0)Z.g=H[2]/255;if(H[3]!==void 0)Z.b=H[3]/255}else if(H=$.match(bn)){if(H[1]!==void 0)Z.r=H[1]/100;if(H[2]!==void 0)Z.g=H[2]/100;if(H[3]!==void 0)Z.b=H[3]/100}else return;if(H[4]!==void 0)Z.alpha=Math.max(0,Math.min(1,H[4]/100));else if(H[5]!==void 0)Z.alpha=Math.max(0,Math.min(1,+H[5]));return Z},bT=yn;var hn=($,Z)=>$===void 0?void 0:typeof $!=="object"?hT($):$.mode!==void 0?$:Z?{...$,mode:Z}:void 0,yT=hn;var xn=($="rgb")=>(Z)=>(Z=yT(Z,$))!==void 0?Z.mode===$?Z:_8[Z.mode][$]?_8[Z.mode][$](Z):$==="rgb"?_8[Z.mode].rgb(Z):_8.rgb[$](_8[Z.mode].rgb(Z)):void 0,jz=xn;var _8={},xT={},AB=[],hW={},vn=($)=>$,d1=($)=>{if(_8[$.mode]={..._8[$.mode],...$.toMode},Object.keys($.fromMode||{}).forEach((Z)=>{if(!_8[Z])_8[Z]={};_8[Z][$.mode]=$.fromMode[Z]}),!$.ranges)$.ranges={};if(!$.difference)$.difference={};return $.channels.forEach((Z)=>{if($.ranges[Z]===void 0)$.ranges[Z]=[0,1];if(!$.interpolate[Z])throw Error(`Missing interpolator for: ${Z}`);if(typeof $.interpolate[Z]==="function")$.interpolate[Z]={use:$.interpolate[Z]};if(!$.interpolate[Z].fixup)$.interpolate[Z].fixup=vn}),xT[$.mode]=$,($.parse||[]).forEach((Z)=>{gn(Z,$.mode)}),jz($.mode)},vT=($)=>xT[$],gn=($,Z)=>{if(typeof $==="string"){if(!Z)throw Error("'mode' required when 'parser' is a string");hW[$]=Z}else if(typeof $==="function"){if(AB.indexOf($)<0)AB.push($)}};var xW=/[^\x00-\x7F]|[a-zA-Z_]/,fn=/[^\x00-\x7F]|[-\w]/,q0={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},B1=0;function Tz($){let Z=$[B1],H=$[B1+1];if(Z==="-"||Z==="+")return/\d/.test(H)||H==="."&&/\d/.test($[B1+2]);if(Z===".")return/\d/.test(H);return/\d/.test(Z)}function vW($){if(B1>=$.length)return!1;let Z=$[B1];if(xW.test(Z))return!0;if(Z==="-"){if($.length-B1<2)return!1;let H=$[B1+1];if(H==="-"||xW.test(H))return!0;return!1}return!1}var mn={deg:1,rad:180/Math.PI,grad:0.9,turn:360};function VB($){let Z="";if($[B1]==="-"||$[B1]==="+")Z+=$[B1++];if(Z+=Cz($),$[B1]==="."&&/\d/.test($[B1+1]))Z+=$[B1++]+Cz($);if($[B1]==="e"||$[B1]==="E"){if(($[B1+1]==="-"||$[B1+1]==="+")&&/\d/.test($[B1+2]))Z+=$[B1++]+$[B1++]+Cz($);else if(/\d/.test($[B1+1]))Z+=$[B1++]+Cz($)}if(vW($)){let H=wz($);if(H==="deg"||H==="rad"||H==="turn"||H==="grad")return{type:q0.Hue,value:Z*mn[H]};return}if($[B1]==="%")return B1++,{type:q0.Percentage,value:+Z};return{type:q0.Number,value:+Z}}function Cz($){let Z="";while(/\d/.test($[B1]))Z+=$[B1++];return Z}function wz($){let Z="";while(B1<$.length&&fn.test($[B1]))Z+=$[B1++];return Z}function pn($){let Z=wz($);if($[B1]==="(")return B1++,{type:q0.Function,value:Z};if(Z==="none")return{type:q0.None,value:void 0};return{type:q0.Ident,value:Z}}function un($=""){let Z=$.trim(),H=[],B;B1=0;while(B1<Z.length){if(B=Z[B1++],B===`
|
|
29
|
+
`||B==="\t"||B===" "){while(B1<Z.length&&(Z[B1]===`
|
|
30
|
+
`||Z[B1]==="\t"||Z[B1]===" "))B1++;continue}if(B===",")return;if(B===")"){H.push({type:q0.ParenClose});continue}if(B==="+"){if(B1--,Tz(Z)){H.push(VB(Z));continue}return}if(B==="-"){if(B1--,Tz(Z)){H.push(VB(Z));continue}if(vW(Z)){H.push({type:q0.Ident,value:wz(Z)});continue}return}if(B==="."){if(B1--,Tz(Z)){H.push(VB(Z));continue}return}if(B==="/"){while(B1<Z.length&&(Z[B1]===`
|
|
31
|
+
`||Z[B1]==="\t"||Z[B1]===" "))B1++;let J;if(Tz(Z)){if(J=VB(Z),J.type!==q0.Hue){H.push({type:q0.Alpha,value:J});continue}}if(vW(Z)){if(wz(Z)==="none"){H.push({type:q0.Alpha,value:{type:q0.None,value:void 0}});continue}}return}if(/\d/.test(B)){B1--,H.push(VB(Z));continue}if(xW.test(B)){B1--,H.push(pn(Z));continue}return}return H}function cn($){$._i=0;let Z=$[$._i++];if(!Z||Z.type!==q0.Function||Z.value!=="color")return;if(Z=$[$._i++],Z.type!==q0.Ident)return;let H=hW[Z.value];if(!H)return;let B={mode:H},J=gT($,!1);if(!J)return;let Q=vT(H).channels;for(let X=0,z,G;X<Q.length;X++)if(z=J[X],G=Q[X],z.type!==q0.None){if(B[G]=z.type===q0.Number?z.value:z.value/100,G==="alpha")B[G]=Math.max(0,Math.min(1,B[G]))}return B}function gT($,Z){let H=[],B;while($._i<$.length){if(B=$[$._i++],B.type===q0.None||B.type===q0.Number||B.type===q0.Alpha||B.type===q0.Percentage||Z&&B.type===q0.Hue){H.push(B);continue}if(B.type===q0.ParenClose){if($._i<$.length)return;continue}return}if(H.length<3||H.length>4)return;if(H.length===4){if(H[3].type!==q0.Alpha)return;H[3]=H[3].value}if(H.length===3)H.push({type:q0.None,value:void 0});return H.every((J)=>J.type!==q0.Alpha)?H:void 0}function dn($,Z){$._i=0;let H=$[$._i++];if(!H||H.type!==q0.Function)return;let B=gT($,Z);if(!B)return;return B.unshift(H.value),B}var ln=($)=>{if(typeof $!=="string")return;let Z=un($),H=Z?dn(Z,!0):void 0,B=void 0,J=0,Q=AB.length;while(J<Q)if((B=AB[J++]($,H))!==void 0)return B;return Z?cn(Z):void 0},hT=ln;function rn($,Z){if(!Z||Z[0]!=="rgb"&&Z[0]!=="rgba")return;let H={mode:"rgb"},[,B,J,Q,X]=Z;if(B.type===q0.Hue||J.type===q0.Hue||Q.type===q0.Hue)return;if(B.type!==q0.None)H.r=B.type===q0.Number?B.value/255:B.value/100;if(J.type!==q0.None)H.g=J.type===q0.Number?J.value/255:J.value/100;if(Q.type!==q0.None)H.b=Q.type===q0.Number?Q.value/255:Q.value/100;if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var fT=rn;var an=($)=>$==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,mT=an;var pT=($,Z,H)=>$+H*(Z-$);var nn=($)=>{let Z=[];for(let H=0;H<$.length-1;H++){let B=$[H],J=$[H+1];if(B===void 0&&J===void 0)Z.push(void 0);else if(B!==void 0&&J!==void 0)Z.push([B,J]);else Z.push(B!==void 0?[B,B]:[J,J])}return Z},uT=($)=>(Z)=>{let H=nn(Z);return(B)=>{let J=B*H.length,Q=B>=1?H.length-1:Math.max(Math.floor(J),0),X=H[Q];return X===void 0?void 0:$(X[0],X[1],J-Q)}};var P0=uT(pT);var _1=($)=>{let Z=!1,H=$.map((B)=>{if(B!==void 0)return Z=!0,B;return 1});return Z?H:$};var on={mode:"rgb",channels:["r","g","b","alpha"],parse:[fT,RT,bT,IT,mT,"srgb"],serialize:"srgb",interpolate:{r:P0,g:P0,b:P0,alpha:{use:P0,fixup:_1}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},e4=on;var gW=($=0)=>Math.pow(Math.abs($),2.19921875)*Math.sign($),sn=($)=>{let Z=gW($.r),H=gW($.g),B=gW($.b),J={mode:"xyz65",x:0.5766690429101305*Z+0.1855582379065463*H+0.1882286462349947*B,y:0.297344975250536*Z+0.6273635662554661*H+0.0752914584939979*B,z:0.0270313613864123*Z+0.0706888525358272*H+0.9913375368376386*B};if($.alpha!==void 0)J.alpha=$.alpha;return J},fW=sn;var mW=($)=>Math.pow(Math.abs($),0.4547069271758437)*Math.sign($),tn=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J={mode:"a98",r:mW($*2.0415879038107465-Z*0.5650069742788597-0.3447313507783297*H),g:mW($*-0.9692436362808798+Z*1.8759675015077206+0.0415550574071756*H),b:mW($*0.0134442806320312-Z*0.1183623922310184+1.0151749943912058*H)};if(B!==void 0)J.alpha=B;return J},pW=tn;var uW=($=0)=>{let Z=Math.abs($);if(Z<=0.04045)return $/12.92;return(Math.sign($)||1)*Math.pow((Z+0.055)/1.055,2.4)},en=({r:$,g:Z,b:H,alpha:B})=>{let J={mode:"lrgb",r:uW($),g:uW(Z),b:uW(H)};if(B!==void 0)J.alpha=B;return J},$8=en;var $o=($)=>{let{r:Z,g:H,b:B,alpha:J}=$8($),Q={mode:"xyz65",x:0.4123907992659593*Z+0.357584339383878*H+0.1804807884018343*B,y:0.2126390058715102*Z+0.715168678767756*H+0.0721923153607337*B,z:0.0193308187155918*Z+0.119194779794626*H+0.9505321522496607*B};if(J!==void 0)Q.alpha=J;return Q},W4=$o;var cW=($=0)=>{let Z=Math.abs($);if(Z>0.0031308)return(Math.sign($)||1)*(1.055*Math.pow(Z,0.4166666666666667)-0.055);return $*12.92},Zo=({r:$,g:Z,b:H,alpha:B},J="rgb")=>{let Q={mode:J,r:cW($),g:cW(Z),b:cW(H)};if(B!==void 0)Q.alpha=B;return Q},Z8=Zo;var Ho=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Z8({r:$*3.2409699419045226-Z*1.537383177570094-0.4986107602930034*H,g:$*-0.9692436362808796+Z*1.8759675015077204+0.0415550574071756*H,b:$*0.0556300796969936-Z*0.2039769588889765+1.0569715142428784*H});if(B!==void 0)J.alpha=B;return J},N4=Ho;var Bo={...e4,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:($)=>pW(W4($)),xyz65:pW},toMode:{rgb:($)=>N4(fW($)),xyz65:fW}},cT=Bo;var Jo=($)=>($=$%360)<0?$+360:$,J5=Jo;var Qo=($,Z)=>{return $.map((H,B,J)=>{if(H===void 0)return H;let Q=J5(H);if(B===0||$[B-1]===void 0)return Q;return Z(Q-J5(J[B-1]))}).reduce((H,B)=>{if(!H.length||B===void 0||H[H.length-1]===void 0)return H.push(B),H;return H.push(B+H[H.length-1]),H},[])},V2=($)=>Qo($,(Z)=>Math.abs(Z)<=180?Z:Z-360*Math.sign(Z));var s5=[-0.14861,1.78277,-0.29227,-0.90649,1.97294,0],dT=Math.PI/180,lT=180/Math.PI;var iT=s5[3]*s5[4],rT=s5[1]*s5[4],aT=s5[1]*s5[2]-s5[0]*s5[3],Xo=({r:$,g:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=(aT*H+$*iT-Z*rT)/(aT+iT-rT),Q=H-J,X=(s5[4]*(Z-J)-s5[2]*Q)/s5[3],z={mode:"cubehelix",l:J,s:J===0||J===1?void 0:Math.sqrt(Q*Q+X*X)/(s5[4]*J*(1-J))};if(z.s)z.h=Math.atan2(X,Q)*lT-120;if(B!==void 0)z.alpha=B;return z},nT=Xo;var zo=({h:$,s:Z,l:H,alpha:B})=>{let J={mode:"rgb"};if($=($===void 0?0:$+120)*dT,H===void 0)H=0;let Q=Z===void 0?0:Z*H*(1-H),X=Math.cos($),z=Math.sin($);if(J.r=H+Q*(s5[0]*X+s5[1]*z),J.g=H+Q*(s5[2]*X+s5[3]*z),J.b=H+Q*(s5[4]*X+s5[5]*z),B!==void 0)J.alpha=B;return J},oT=zo;var P3=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.s||!Z.s)return 0;let H=J5($.h),B=J5(Z.h),J=Math.sin((B-H+360)/2*Math.PI/180);return 2*Math.sqrt($.s*Z.s)*J},sT=($,Z)=>{if($.h===void 0||Z.h===void 0)return 0;let H=J5($.h),B=J5(Z.h);if(Math.abs(B-H)>180)return H-(B-360*Math.sign(B-H));return B-H},_3=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.c||!Z.c)return 0;let H=J5($.h),B=J5(Z.h),J=Math.sin((B-H+360)/2*Math.PI/180);return 2*Math.sqrt($.c*Z.c)*J};var D2=($)=>{let Z=$.reduce((B,J)=>{if(J!==void 0){let Q=J*Math.PI/180;B.sin+=Math.sin(Q),B.cos+=Math.cos(Q)}return B},{sin:0,cos:0}),H=Math.atan2(Z.sin,Z.cos)*180/Math.PI;return H<0?360+H:H};var Go={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:nT},toMode:{rgb:oT},interpolate:{h:{use:P0,fixup:V2},s:P0,l:P0,alpha:{use:P0,fixup:_1}},difference:{h:P3},average:{h:D2}},tT=Go;var Fo=({l:$,a:Z,b:H,alpha:B},J="lch")=>{if(Z===void 0)Z=0;if(H===void 0)H=0;let Q=Math.sqrt(Z*Z+H*H),X={mode:J,l:$,c:Q};if(Q)X.h=J5(Math.atan2(H,Z)*180/Math.PI);if(B!==void 0)X.alpha=B;return X},R4=Fo;var Uo=({l:$,c:Z,h:H,alpha:B},J="lab")=>{if(H===void 0)H=0;let Q={mode:J,l:$,a:Z?Z*Math.cos(H/180*Math.PI):0,b:Z?Z*Math.sin(H/180*Math.PI):0};if(B!==void 0)Q.alpha=B;return Q},k4=Uo;var Ez=Math.pow(29,3)/Math.pow(3,3),Sz=Math.pow(6,3)/Math.pow(29,3);var T5={X:0.9642956764295677,Y:1,Z:0.8251046025104602},O3={X:0.9504559270516716,Y:1,Z:1.0890577507598784},hw0=Math.pow(29,3)/Math.pow(3,3),xw0=Math.pow(6,3)/Math.pow(29,3);var dW=($)=>Math.pow($,3)>Sz?Math.pow($,3):(116*$-16)/Ez,Yo=({l:$,a:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=($+16)/116,Q=Z/500+J,X=J-H/200,z={mode:"xyz65",x:dW(Q)*O3.X,y:dW(J)*O3.Y,z:dW(X)*O3.Z};if(B!==void 0)z.alpha=B;return z},Iz=Yo;var Ko=($)=>N4(Iz($)),j3=Ko;var lW=($)=>$>Sz?Math.cbrt($):(Ez*$+16)/116,Wo=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=lW($/O3.X),Q=lW(Z/O3.Y),X=lW(H/O3.Z),z={mode:"lab65",l:116*Q-16,a:500*(J-Q),b:200*(Q-X)};if(B!==void 0)z.alpha=B;return z},Rz=Wo;var No=($)=>{let Z=Rz(W4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},T3=No;var I$=1,kz=1,e6=0.14444444444444443*Math.PI,R$=Math.cos(e6),k$=Math.sin(e6),bz=100/Math.log(1.39);var Lo=({l:$,c:Z,h:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J={mode:"lab65",l:(Math.exp($*I$/bz)-1)/0.0039},Q=(Math.exp(0.0435*Z*kz*I$)-1)/0.075,X=Q*Math.cos(H/180*Math.PI-e6),z=Q*Math.sin(H/180*Math.PI-e6);if(J.a=X*R$-z/0.83*k$,J.b=X*k$+z/0.83*R$,B!==void 0)J.alpha=B;return J},DB=Lo;var Ao=({l:$,a:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Z*R$+H*k$,Q=0.83*(H*R$-Z*k$),X=Math.sqrt(J*J+Q*Q),z={mode:"dlch",l:bz/I$*Math.log(1+0.0039*$),c:Math.log(1+0.075*X)/(0.0435*kz*I$)};if(z.c)z.h=J5((Math.atan2(Q,J)+e6)/Math.PI*180);if(B!==void 0)z.alpha=B;return z},qB=Ao;var eT=($)=>DB(R4($,"dlch")),$C=($)=>k4(qB($),"dlab"),Vo={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:eT,rgb:($)=>j3(eT($))},fromMode:{lab65:$C,rgb:($)=>$C(T3($))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:P0,a:P0,b:P0,alpha:{use:P0,fixup:_1}}},ZC=Vo;var Do={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:DB,dlab:($)=>k4($,"dlab"),rgb:($)=>j3(DB($))},fromMode:{lab65:qB,dlab:($)=>R4($,"dlch"),rgb:($)=>qB(T3($))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:P0,c:P0,h:{use:P0,fixup:V2},alpha:{use:P0,fixup:_1}},difference:{h:_3},average:{h:D2}},HC=Do;function iW({h:$,s:Z,i:H,alpha:B}){if($=J5($!==void 0?$:0),Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:H*(1+Z*(3/(2-J)-1)),g:H*(1+Z*(3*(1-J)/(2-J)-1)),b:H*(1-Z)};break;case 1:Q={r:H*(1+Z*(3*(1-J)/(2-J)-1)),g:H*(1+Z*(3/(2-J)-1)),b:H*(1-Z)};break;case 2:Q={r:H*(1-Z),g:H*(1+Z*(3/(2-J)-1)),b:H*(1+Z*(3*(1-J)/(2-J)-1))};break;case 3:Q={r:H*(1-Z),g:H*(1+Z*(3*(1-J)/(2-J)-1)),b:H*(1+Z*(3/(2-J)-1))};break;case 4:Q={r:H*(1+Z*(3*(1-J)/(2-J)-1)),g:H*(1-Z),b:H*(1+Z*(3/(2-J)-1))};break;case 5:Q={r:H*(1+Z*(3/(2-J)-1)),g:H*(1-Z),b:H*(1+Z*(3*(1-J)/(2-J)-1))};break;default:Q={r:H*(1-Z),g:H*(1-Z),b:H*(1-Z)}}if(Q.mode="rgb",B!==void 0)Q.alpha=B;return Q}function rW({r:$,g:Z,b:H,alpha:B}){if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.max($,Z,H),Q=Math.min($,Z,H),X={mode:"hsi",s:$+Z+H===0?0:1-3*Q/($+Z+H),i:($+Z+H)/3};if(J-Q!==0)X.h=(J===$?(Z-H)/(J-Q)+(Z<H)*6:J===Z?(H-$)/(J-Q)+2:($-Z)/(J-Q)+4)*60;if(B!==void 0)X.alpha=B;return X}var qo={mode:"hsi",toMode:{rgb:iW},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:rW},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:P0,fixup:V2},s:P0,i:P0,alpha:{use:P0,fixup:_1}},difference:{h:P3},average:{h:D2}},BC=qo;function aW({h:$,s:Z,l:H,alpha:B}){if($=J5($!==void 0?$:0),Z===void 0)Z=0;if(H===void 0)H=0;let J=H+Z*(H<0.5?H:1-H),Q=J-(J-H)*2*Math.abs($/60%2-1),X;switch(Math.floor($/60)){case 0:X={r:J,g:Q,b:2*H-J};break;case 1:X={r:Q,g:J,b:2*H-J};break;case 2:X={r:2*H-J,g:J,b:Q};break;case 3:X={r:2*H-J,g:Q,b:J};break;case 4:X={r:Q,g:2*H-J,b:J};break;case 5:X={r:J,g:2*H-J,b:Q};break;default:X={r:2*H-J,g:2*H-J,b:2*H-J}}if(X.mode="rgb",B!==void 0)X.alpha=B;return X}function nW({r:$,g:Z,b:H,alpha:B}){if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.max($,Z,H),Q=Math.min($,Z,H),X={mode:"hsl",s:J===Q?0:(J-Q)/(1-Math.abs(J+Q-1)),l:0.5*(J+Q)};if(J-Q!==0)X.h=(J===$?(Z-H)/(J-Q)+(Z<H)*6:J===Z?(H-$)/(J-Q)+2:($-Z)/(J-Q)+4)*60;if(B!==void 0)X.alpha=B;return X}var Mo=($,Z)=>{switch(Z){case"deg":return+$;case"rad":return $/Math.PI*180;case"grad":return $/10*9;case"turn":return $*360}},JC=Mo;var Po=new RegExp(`^hsla?\\(\\s*${kT}${M3}${t6}${M3}${t6}\\s*(?:,\\s*${LB}\\s*)?\\)$`),_o=($)=>{let Z=$.match(Po);if(!Z)return;let H={mode:"hsl"};if(Z[3]!==void 0)H.h=+Z[3];else if(Z[1]!==void 0&&Z[2]!==void 0)H.h=JC(Z[1],Z[2]);if(Z[4]!==void 0)H.s=Math.min(Math.max(0,Z[4]/100),1);if(Z[5]!==void 0)H.l=Math.min(Math.max(0,Z[5]/100),1);if(Z[6]!==void 0)H.alpha=Math.max(0,Math.min(1,Z[6]/100));else if(Z[7]!==void 0)H.alpha=Math.max(0,Math.min(1,+Z[7]));return H},QC=_o;function Oo($,Z){if(!Z||Z[0]!=="hsl"&&Z[0]!=="hsla")return;let H={mode:"hsl"},[,B,J,Q,X]=Z;if(B.type!==q0.None){if(B.type===q0.Percentage)return;H.h=B.value}if(J.type!==q0.None){if(J.type===q0.Hue)return;H.s=J.value/100}if(Q.type!==q0.None){if(Q.type===q0.Hue)return;H.l=Q.value/100}if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var XC=Oo;var jo={mode:"hsl",toMode:{rgb:aW},fromMode:{rgb:nW},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[XC,QC],serialize:($)=>`hsl(${$.h!==void 0?$.h:"none"} ${$.s!==void 0?$.s*100+"%":"none"} ${$.l!==void 0?$.l*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:P0,fixup:V2},s:P0,l:P0,alpha:{use:P0,fixup:_1}},difference:{h:P3},average:{h:D2}},yz=jo;function MB({h:$,s:Z,v:H,alpha:B}){if($=J5($!==void 0?$:0),Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:H,g:H*(1-Z*J),b:H*(1-Z)};break;case 1:Q={r:H*(1-Z*J),g:H,b:H*(1-Z)};break;case 2:Q={r:H*(1-Z),g:H,b:H*(1-Z*J)};break;case 3:Q={r:H*(1-Z),g:H*(1-Z*J),b:H};break;case 4:Q={r:H*(1-Z*J),g:H*(1-Z),b:H};break;case 5:Q={r:H,g:H*(1-Z),b:H*(1-Z*J)};break;default:Q={r:H*(1-Z),g:H*(1-Z),b:H*(1-Z)}}if(Q.mode="rgb",B!==void 0)Q.alpha=B;return Q}function PB({r:$,g:Z,b:H,alpha:B}){if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.max($,Z,H),Q=Math.min($,Z,H),X={mode:"hsv",s:J===0?0:1-Q/J,v:J};if(J-Q!==0)X.h=(J===$?(Z-H)/(J-Q)+(Z<H)*6:J===Z?(H-$)/(J-Q)+2:($-Z)/(J-Q)+4)*60;if(B!==void 0)X.alpha=B;return X}var To={mode:"hsv",toMode:{rgb:MB},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:PB},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:P0,fixup:V2},s:P0,v:P0,alpha:{use:P0,fixup:_1}},difference:{h:P3},average:{h:D2}},hz=To;function oW({h:$,w:Z,b:H,alpha:B}){if(Z===void 0)Z=0;if(H===void 0)H=0;if(Z+H>1){let J=Z+H;Z/=J,H/=J}return MB({h:$,s:H===1?1:1-Z/(1-H),v:1-H,alpha:B})}function sW($){let Z=PB($);if(Z===void 0)return;let H=Z.s!==void 0?Z.s:0,B=Z.v!==void 0?Z.v:0,J={mode:"hwb",w:(1-H)*B,b:1-B};if(Z.h!==void 0)J.h=Z.h;if(Z.alpha!==void 0)J.alpha=Z.alpha;return J}function Co($,Z){if(!Z||Z[0]!=="hwb")return;let H={mode:"hwb"},[,B,J,Q,X]=Z;if(B.type!==q0.None){if(B.type===q0.Percentage)return;H.h=B.value}if(J.type!==q0.None){if(J.type===q0.Hue)return;H.w=J.value/100}if(Q.type!==q0.None){if(Q.type===q0.Hue)return;H.b=Q.value/100}if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var zC=Co;var wo={mode:"hwb",toMode:{rgb:oW},fromMode:{rgb:sW},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[zC],serialize:($)=>`hwb(${$.h!==void 0?$.h:"none"} ${$.w!==void 0?$.w*100+"%":"none"} ${$.b!==void 0?$.b*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:P0,fixup:V2},w:P0,b:P0,alpha:{use:P0,fixup:_1}},difference:{h:sT},average:{h:D2}},GC=wo;var xz=203;var vz=0.1593017578125;var gz=0.8359375,fz=18.8515625,mz=18.6875;function pz($){if($<0)return 0;let Z=Math.pow($,0.012683313515655966);return 1e4*Math.pow(Math.max(0,Z-0.8359375)/(18.8515625-18.6875*Z),6.277394636015326)}function uz($){if($<0)return 0;let Z=Math.pow($/1e4,0.1593017578125);return Math.pow((0.8359375+18.8515625*Z)/(1+18.6875*Z),78.84375)}var tW=($)=>Math.max($/xz,0),Eo=({i:$,t:Z,p:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=pz($+0.008609037037932761*Z+0.11102962500302593*H),Q=pz($-0.00860903703793275*Z-0.11102962500302599*H),X=pz($+0.5600313357106791*Z-0.32062717498731885*H),z={mode:"xyz65",x:tW(2.070152218389422*J-1.3263473389671556*Q+0.2066510476294051*X),y:tW(0.3647385209748074*J+0.680566024947227*Q-0.0453045459220346*X),z:tW(-0.049747207535812*J-0.0492609666966138*Q+1.1880659249923042*X)};if(B!==void 0)z.alpha=B;return z},eW=Eo;var $N=($=0)=>Math.max($*xz,0),So=({x:$,y:Z,z:H,alpha:B})=>{let J=$N($),Q=$N(Z),X=$N(H),z=uz(0.3592832590121217*J+0.6976051147779502*Q-0.0358915932320289*X),G=uz(-0.1920808463704995*J+1.1004767970374323*Q+0.0753748658519118*X),F=uz(0.0070797844607477*J+0.0748396662186366*Q+0.8433265453898765*X),U=0.5*z+0.5*G,Y=1.61376953125*z-3.323486328125*G+1.709716796875*F,K=4.378173828125*z-4.24560546875*G-0.132568359375*F,W={mode:"itp",i:U,t:Y,p:K};if(B!==void 0)W.alpha=B;return W},ZN=So;var Io={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:eW,rgb:($)=>N4(eW($))},fromMode:{xyz65:ZN,rgb:($)=>ZN(W4($))},ranges:{i:[0,0.581],t:[-0.369,0.272],p:[-0.164,0.331]},interpolate:{i:P0,t:P0,p:P0,alpha:{use:P0,fixup:_1}}},FC=Io;var Ro=134.03437499999998,ko=0.000000000016295499532821565,HN=($)=>{if($<0)return 0;let Z=Math.pow($/1e4,vz);return Math.pow((gz+fz*Z)/(1+mz*Z),Ro)},BN=($=0)=>Math.max($*203,0),bo=({x:$,y:Z,z:H,alpha:B})=>{$=BN($),Z=BN(Z),H=BN(H);let J=1.15*$-0.15*H,Q=0.66*Z+0.34*$,X=HN(0.41478972*J+0.579999*Q+0.014648*H),z=HN(-0.20151*J+1.120649*Q+0.0531008*H),G=HN(-0.0166008*J+0.2648*Q+0.6684799*H),F=(X+z)/2,U={mode:"jab",j:0.44*F/(1-0.56*F)-ko,a:3.524*X-4.066708*z+0.542708*G,b:0.199076*X+1.096799*z-1.295875*G};if(B!==void 0)U.alpha=B;return U},cz=bo;var yo=134.03437499999998,UC=0.000000000016295499532821565,JN=($)=>{if($<0)return 0;let Z=Math.pow($,1/yo);return 1e4*Math.pow((gz-Z)/(mz*Z-fz),1/vz)},QN=($)=>$/203,ho=({j:$,a:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=($+UC)/(0.44+0.56*($+UC)),Q=JN(J+0.13860504*Z+0.058047316*H),X=JN(J-0.13860504*Z-0.058047316*H),z=JN(J-0.096019242*Z-0.8118919*H),G={mode:"xyz65",x:QN(1.661373024652174*Q-0.914523081304348*X+0.23136208173913045*z),y:QN(-0.3250758611844533*Q+1.571847026732543*X-0.21825383453227928*z),z:QN(-0.090982811*Q-0.31272829*X+1.5227666*z)};if(B!==void 0)G.alpha=B;return G},dz=ho;var xo=($)=>{let Z=cz(W4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},lz=xo;var vo=($)=>N4(dz($)),iz=vo;var go={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:lz,xyz65:cz},toMode:{rgb:iz,xyz65:dz},ranges:{j:[0,0.222],a:[-0.109,0.129],b:[-0.185,0.134]},interpolate:{j:P0,a:P0,b:P0,alpha:{use:P0,fixup:_1}}},YC=go;var fo=({j:$,a:Z,b:H,alpha:B})=>{if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.sqrt(Z*Z+H*H),Q={mode:"jch",j:$,c:J};if(J)Q.h=J5(Math.atan2(H,Z)*180/Math.PI);if(B!==void 0)Q.alpha=B;return Q},XN=fo;var mo=({j:$,c:Z,h:H,alpha:B})=>{if(H===void 0)H=0;let J={mode:"jab",j:$,a:Z?Z*Math.cos(H/180*Math.PI):0,b:Z?Z*Math.sin(H/180*Math.PI):0};if(B!==void 0)J.alpha=B;return J},zN=mo;var po={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:zN,rgb:($)=>iz(zN($))},fromMode:{rgb:($)=>XN(lz($)),jab:XN},channels:["j","c","h","alpha"],ranges:{j:[0,0.221],c:[0,0.19],h:[0,360]},interpolate:{h:{use:P0,fixup:V2},c:P0,j:P0,alpha:{use:P0,fixup:_1}},difference:{h:_3},average:{h:D2}},KC=po;var C3=Math.pow(29,3)/Math.pow(3,3),b$=Math.pow(6,3)/Math.pow(29,3);var GN=($)=>Math.pow($,3)>b$?Math.pow($,3):(116*$-16)/C3,uo=({l:$,a:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=($+16)/116,Q=Z/500+J,X=J-H/200,z={mode:"xyz50",x:GN(Q)*T5.X,y:GN(J)*T5.Y,z:GN(X)*T5.Z};if(B!==void 0)z.alpha=B;return z},y$=uo;var co=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Z8({r:$*3.1341359569958707-Z*1.6173863321612538-0.4906619460083532*H,g:$*-0.978795502912089+Z*1.916254567259524+0.03344273116131949*H,b:$*0.07195537988411677-Z*0.2289768264158322+1.405386058324125*H});if(B!==void 0)J.alpha=B;return J},J9=co;var lo=($)=>J9(y$($)),rz=lo;var io=($)=>{let{r:Z,g:H,b:B,alpha:J}=$8($),Q={mode:"xyz50",x:0.436065742824811*Z+0.3851514688337912*H+0.14307845442264197*B,y:0.22249319175623702*Z+0.7168870538238823*H+0.06061979053616537*B,z:0.013923904500943465*Z+0.09708128566574634*H+0.7140993584005155*B};if(J!==void 0)Q.alpha=J;return Q},Q9=io;var FN=($)=>$>b$?Math.cbrt($):(C3*$+16)/116,ro=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=FN($/T5.X),Q=FN(Z/T5.Y),X=FN(H/T5.Z),z={mode:"lab",l:116*Q-16,a:500*(J-Q),b:200*(Q-X)};if(B!==void 0)z.alpha=B;return z},h$=ro;var ao=($)=>{let Z=h$(Q9($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},az=ao;function no($,Z){if(!Z||Z[0]!=="lab")return;let H={mode:"lab"},[,B,J,Q,X]=Z;if(B.type===q0.Hue||J.type===q0.Hue||Q.type===q0.Hue)return;if(B.type!==q0.None)H.l=Math.min(Math.max(0,B.value),100);if(J.type!==q0.None)H.a=J.type===q0.Number?J.value:J.value*125/100;if(Q.type!==q0.None)H.b=Q.type===q0.Number?Q.value:Q.value*125/100;if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var WC=no;var oo={mode:"lab",toMode:{xyz50:y$,rgb:rz},fromMode:{xyz50:h$,rgb:az},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[WC],serialize:($)=>`lab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{l:P0,a:P0,b:P0,alpha:{use:P0,fixup:_1}}},x$=oo;var so={...x$,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:Iz,rgb:j3},fromMode:{xyz65:Rz,rgb:T3},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},NC=so;function to($,Z){if(!Z||Z[0]!=="lch")return;let H={mode:"lch"},[,B,J,Q,X]=Z;if(B.type!==q0.None){if(B.type===q0.Hue)return;H.l=Math.min(Math.max(0,B.value),100)}if(J.type!==q0.None)H.c=Math.max(0,J.type===q0.Number?J.value:J.value*150/100);if(Q.type!==q0.None){if(Q.type===q0.Percentage)return;H.h=Q.value}if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var LC=to;var eo={mode:"lch",toMode:{lab:k4,rgb:($)=>rz(k4($))},fromMode:{rgb:($)=>R4(az($)),lab:R4},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[LC],serialize:($)=>`lch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:P0,fixup:V2},c:P0,l:P0,alpha:{use:P0,fixup:_1}},difference:{h:_3},average:{h:D2}},v$=eo;var $s={...v$,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:($)=>k4($,"lab65"),rgb:($)=>j3(k4($,"lab65"))},fromMode:{rgb:($)=>R4(T3($),"lch65"),lab65:($)=>R4($,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},AC=$s;var Zs=({l:$,u:Z,v:H,alpha:B})=>{if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.sqrt(Z*Z+H*H),Q={mode:"lchuv",l:$,c:J};if(J)Q.h=J5(Math.atan2(H,Z)*180/Math.PI);if(B!==void 0)Q.alpha=B;return Q},UN=Zs;var Hs=({l:$,c:Z,h:H,alpha:B})=>{if(H===void 0)H=0;let J={mode:"luv",l:$,u:Z?Z*Math.cos(H/180*Math.PI):0,v:Z?Z*Math.sin(H/180*Math.PI):0};if(B!==void 0)J.alpha=B;return J},YN=Hs;var VC=($,Z,H)=>4*$/($+15*Z+3*H),DC=($,Z,H)=>9*Z/($+15*Z+3*H),Bs=VC(T5.X,T5.Y,T5.Z),Js=DC(T5.X,T5.Y,T5.Z),Qs=($)=>$<=b$?C3*$:116*Math.cbrt($)-16,Xs=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Qs(Z/T5.Y),Q=VC($,Z,H),X=DC($,Z,H);if(!isFinite(Q)||!isFinite(X))J=Q=X=0;else Q=13*J*(Q-Bs),X=13*J*(X-Js);let z={mode:"luv",l:J,u:Q,v:X};if(B!==void 0)z.alpha=B;return z},_B=Xs;var zs=($,Z,H)=>4*$/($+15*Z+3*H),Gs=($,Z,H)=>9*Z/($+15*Z+3*H),Fs=zs(T5.X,T5.Y,T5.Z),Us=Gs(T5.X,T5.Y,T5.Z),Ys=({l:$,u:Z,v:H,alpha:B})=>{if($===void 0)$=0;if($===0)return{mode:"xyz50",x:0,y:0,z:0};if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Z/(13*$)+Fs,Q=H/(13*$)+Us,X=T5.Y*($<=8?$/C3:Math.pow(($+16)/116,3)),z=X*(9*J)/(4*Q),G=X*(12-3*J-20*Q)/(4*Q),F={mode:"xyz50",x:z,y:X,z:G};if(B!==void 0)F.alpha=B;return F},OB=Ys;var Ks=($)=>UN(_B(Q9($))),Ws=($)=>J9(OB(YN($))),Ns={mode:"lchuv",toMode:{luv:YN,rgb:Ws},fromMode:{rgb:Ks,luv:UN},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:P0,fixup:V2},c:P0,l:P0,alpha:{use:P0,fixup:_1}},difference:{h:_3},average:{h:D2}},qC=Ns;var Ls={...e4,mode:"lrgb",toMode:{rgb:Z8},fromMode:{rgb:$8},parse:["srgb-linear"],serialize:"srgb-linear"},MC=Ls;var As={mode:"luv",toMode:{xyz50:OB,rgb:($)=>J9(OB($))},fromMode:{xyz50:_B,rgb:($)=>_B(Q9($))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:P0,u:P0,v:P0,alpha:{use:P0,fixup:_1}}},PC=As;var Vs=({r:$,g:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.cbrt(0.412221469470763*$+0.5363325372617348*Z+0.0514459932675022*H),Q=Math.cbrt(0.2119034958178252*$+0.6806995506452344*Z+0.1073969535369406*H),X=Math.cbrt(0.0883024591900564*$+0.2817188391361215*Z+0.6299787016738222*H),z={mode:"oklab",l:0.210454268309314*J+0.7936177747023054*Q-0.0040720430116193*X,a:1.9779985324311684*J-2.42859224204858*Q+0.450593709617411*X,b:0.0259040424655478*J+0.7827717124575296*Q-0.8086757549230774*X};if(B!==void 0)z.alpha=B;return z},nz=Vs;var Ds=($)=>{let Z=nz($8($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},w3=Ds;var qs=({l:$,a:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.pow($+0.3963377773761749*Z+0.2158037573099136*H,3),Q=Math.pow($-0.1055613458156586*Z-0.0638541728258133*H,3),X=Math.pow($-0.0894841775298119*Z-1.2914855480194092*H,3),z={mode:"lrgb",r:4.076741636075957*J-3.3077115392580616*Q+0.2309699031821044*X,g:-1.2684379732850317*J+2.6097573492876887*Q-0.3413193760026573*X,b:-0.0041960761386756*J-0.7034186179359362*Q+1.7076146940746117*X};if(B!==void 0)z.alpha=B;return z},X9=qs;var Ms=($)=>Z8(X9($)),E3=Ms;function jB($){return 0.5*(1.170873786407767*$-0.206+Math.sqrt((1.170873786407767*$-0.206)*(1.170873786407767*$-0.206)+0.14050485436893204*$))}function $7($){return($*$+0.206*$)/(1.170873786407767*($+0.03))}function Ps($,Z){let H,B,J,Q,X,z,G,F;if(-1.88170328*$-0.80936493*Z>1)H=1.19086277,B=1.76576728,J=0.59662641,Q=0.75515197,X=0.56771245,z=4.0767416621,G=-3.3077115913,F=0.2309699292;else if(1.81444104*$-1.19445276*Z>1)H=0.73956515,B=-0.45954404,J=0.08285427,Q=0.1254107,X=0.14503204,z=-1.2684380046,G=2.6097574011,F=-0.3413193965;else H=1.35733652,B=-0.00915799,J=-1.1513021,Q=-0.50559606,X=0.00692167,z=-0.0041960863,G=-0.7034186147,F=1.707614701;let U=H+B*$+J*Z+Q*$*$+X*$*Z,Y=0.3963377774*$+0.2158037573*Z,K=-0.1055613458*$-0.0638541728*Z,W=-0.0894841775*$-1.291485548*Z;{let N=1+U*Y,L=1+U*K,V=1+U*W,A=N*N*N,D=L*L*L,q=V*V*V,_=3*Y*N*N,M=3*K*L*L,P=3*W*V*V,T=6*Y*Y*N,R=6*K*K*L,y=6*W*W*V,w=z*A+G*D+F*q,h=z*_+G*M+F*P,E=z*T+G*R+F*y;U=U-w*h/(h*h-0.5*w*E)}return U}function KN($,Z){let H=Ps($,Z),B=X9({l:1,a:H*$,b:H*Z}),J=Math.cbrt(1/Math.max(B.r,B.g,B.b)),Q=J*H;return[J,Q]}function _s($,Z,H,B,J,Q=null){if(!Q)Q=KN($,Z);let X;if((H-J)*Q[1]-(Q[0]-J)*B<=0)X=Q[1]*J/(B*Q[0]+Q[1]*(J-H));else{X=Q[1]*(J-1)/(B*(Q[0]-1)+Q[1]*(J-H));{let z=H-J,G=B,F=0.3963377774*$+0.2158037573*Z,U=-0.1055613458*$-0.0638541728*Z,Y=-0.0894841775*$-1.291485548*Z,K=z+G*F,W=z+G*U,N=z+G*Y;{let L=J*(1-X)+X*H,V=X*B,A=L+V*F,D=L+V*U,q=L+V*Y,_=A*A*A,M=D*D*D,P=q*q*q,T=3*K*A*A,R=3*W*D*D,y=3*N*q*q,w=6*K*K*A,h=6*W*W*D,E=6*N*N*q,I=4.0767416621*_-3.3077115913*M+0.2309699292*P-1,j=4.0767416621*T-3.3077115913*R+0.2309699292*y,S=4.0767416621*w-3.3077115913*h+0.2309699292*E,k=j/(j*j-0.5*I*S),b=-I*k,v=-1.2684380046*_+2.6097574011*M-0.3413193965*P-1,u=-1.2684380046*T+2.6097574011*R-0.3413193965*y,C=-1.2684380046*w+2.6097574011*h-0.3413193965*E,t=u/(u*u-0.5*v*C),H0=-v*t,x=-0.0041960863*_-0.7034186147*M+1.707614701*P-1,e=-0.0041960863*T-0.7034186147*R+1.707614701*y,L0=-0.0041960863*w-0.7034186147*h+1.707614701*E,d=e/(e*e-0.5*x*L0),X0=-x*d;b=k>=0?b:1e6,H0=t>=0?H0:1e6,X0=d>=0?X0:1e6,X+=Math.min(b,Math.min(H0,X0))}}}return X}function TB($,Z,H=null){if(!H)H=KN($,Z);let B=H[0],J=H[1];return[J/B,J/(1-B)]}function oz($,Z,H){let B=KN(Z,H),J=_s(Z,H,$,1,$,B),Q=TB(Z,H,B),X=0.11516993+1/(7.4477897+4.1590124*H+Z*(-2.19557347+1.75198401*H+Z*(-2.13704948-10.02301043*H+Z*(-4.24894561+5.38770819*H+4.69891013*Z)))),z=0.11239642+1/(1.6132032-0.68124379*H+Z*(0.40370612+0.90148123*H+Z*(-0.27087943+0.6122399*H+Z*(0.00299215-0.45399568*H-0.14661872*Z)))),G=J/Math.min($*Q[0],(1-$)*Q[1]),F=$*X,U=(1-$)*z,Y=0.9*G*Math.sqrt(Math.sqrt(1/(1/(F*F*F*F)+1/(U*U*U*U))));return F=$*0.4,U=(1-$)*0.8,[Math.sqrt(1/(1/(F*F)+1/(U*U))),Y,J]}function sz($){let Z=$.l!==void 0?$.l:0,H=$.a!==void 0?$.a:0,B=$.b!==void 0?$.b:0,J={mode:"okhsl",l:jB(Z)};if($.alpha!==void 0)J.alpha=$.alpha;let Q=Math.sqrt(H*H+B*B);if(!Q)return J.s=0,J;let[X,z,G]=oz(Z,H/Q,B/Q),F;if(Q<z){let U=0,Y=0.8*X,K=1-Y/z;F=(Q-U)/(Y+K*(Q-U))*0.8}else{let U=z,Y=0.2*z*z*1.25*1.25/X,K=1-Y/(G-z);F=0.8+0.2*((Q-U)/(Y+K*(Q-U)))}if(F)J.s=F,J.h=J5(Math.atan2(B,H)*180/Math.PI);return J}function tz($){let Z=$.h!==void 0?$.h:0,H=$.s!==void 0?$.s:0,B=$.l!==void 0?$.l:0,J={mode:"oklab",l:$7(B)};if($.alpha!==void 0)J.alpha=$.alpha;if(!H||B===1)return J.a=J.b=0,J;let Q=Math.cos(Z/180*Math.PI),X=Math.sin(Z/180*Math.PI),[z,G,F]=oz(J.l,Q,X),U,Y,K,W;if(H<0.8)U=1.25*H,Y=0,K=0.8*z,W=1-K/G;else U=5*(H-0.8),Y=G,K=0.2*G*G*1.25*1.25/z,W=1-K/(F-G);let N=Y+U*K/(1-W*U);return J.a=N*Q,J.b=N*X,J}var Os={...yz,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:sz,rgb:($)=>sz(w3($))},toMode:{oklab:tz,rgb:($)=>E3(tz($))}},_C=Os;function ez($){let Z=$.l!==void 0?$.l:0,H=$.a!==void 0?$.a:0,B=$.b!==void 0?$.b:0,J=Math.sqrt(H*H+B*B),Q=J?H/J:1,X=J?B/J:1,[z,G]=TB(Q,X),F=0.5,U=1-F/z,Y=G/(J+Z*G),K=Y*Z,W=Y*J,N=$7(K),L=W*N/K,V=X9({l:N,a:Q*L,b:X*L}),A=Math.cbrt(1/Math.max(V.r,V.g,V.b,0));Z=Z/A,J=J/A*jB(Z)/Z,Z=jB(Z);let D={mode:"okhsv",s:J?(F+G)*W/(G*F+G*U*W):0,v:Z?Z/K:0};if(D.s)D.h=J5(Math.atan2(B,H)*180/Math.PI);if($.alpha!==void 0)D.alpha=$.alpha;return D}function $G($){let Z={mode:"oklab"};if($.alpha!==void 0)Z.alpha=$.alpha;let H=$.h!==void 0?$.h:0,B=$.s!==void 0?$.s:0,J=$.v!==void 0?$.v:0,Q=Math.cos(H/180*Math.PI),X=Math.sin(H/180*Math.PI),[z,G]=TB(Q,X),F=0.5,U=1-F/z,Y=1-B*F/(F+G-G*U*B),K=B*G*F/(F+G-G*U*B),W=$7(Y),N=K*W/Y,L=X9({l:W,a:Q*N,b:X*N}),V=Math.cbrt(1/Math.max(L.r,L.g,L.b,0)),A=$7(J*Y),D=K*A/Y;return Z.l=A*V,Z.a=D*Q*V,Z.b=D*X*V,Z}var js={...hz,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:ez,rgb:($)=>ez(w3($))},toMode:{oklab:$G,rgb:($)=>E3($G($))}},OC=js;function Ts($,Z){if(!Z||Z[0]!=="oklab")return;let H={mode:"oklab"},[,B,J,Q,X]=Z;if(B.type===q0.Hue||J.type===q0.Hue||Q.type===q0.Hue)return;if(B.type!==q0.None)H.l=Math.min(Math.max(0,B.type===q0.Number?B.value:B.value/100),1);if(J.type!==q0.None)H.a=J.type===q0.Number?J.value:J.value*0.4/100;if(Q.type!==q0.None)H.b=Q.type===q0.Number?Q.value:Q.value*0.4/100;if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var jC=Ts;var Cs={...x$,mode:"oklab",toMode:{lrgb:X9,rgb:E3},fromMode:{lrgb:nz,rgb:w3},ranges:{l:[0,1],a:[-0.4,0.4],b:[-0.4,0.4]},parse:[jC],serialize:($)=>`oklab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`},TC=Cs;function ws($,Z){if(!Z||Z[0]!=="oklch")return;let H={mode:"oklch"},[,B,J,Q,X]=Z;if(B.type!==q0.None){if(B.type===q0.Hue)return;H.l=Math.min(Math.max(0,B.type===q0.Number?B.value:B.value/100),1)}if(J.type!==q0.None)H.c=Math.max(0,J.type===q0.Number?J.value:J.value*0.4/100);if(Q.type!==q0.None){if(Q.type===q0.Percentage)return;H.h=Q.value}if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var CC=ws;var Es={...v$,mode:"oklch",toMode:{oklab:($)=>k4($,"oklab"),rgb:($)=>E3(k4($,"oklab"))},fromMode:{rgb:($)=>R4(w3($),"oklch"),oklab:($)=>R4($,"oklch")},parse:[CC],serialize:($)=>`oklch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,ranges:{l:[0,1],c:[0,0.4],h:[0,360]}},wC=Es;var Ss=($)=>{let{r:Z,g:H,b:B,alpha:J}=$8($),Q={mode:"xyz65",x:0.486570948648216*Z+0.265667693169093*H+0.1982172852343625*B,y:0.2289745640697487*Z+0.6917385218365062*H+0.079286914093745*B,z:0*Z+0.0451133818589026*H+1.043944368900976*B};if(J!==void 0)Q.alpha=J;return Q},WN=Ss;var Is=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Z8({r:$*2.4934969119414263-Z*0.9313836179191242-0.402710784450717*H,g:$*-0.8294889695615749+Z*1.7626640603183465+0.0236246858419436*H,b:$*0.0358458302437845-Z*0.0761723892680418+0.9568845240076871*H},"p3");if(B!==void 0)J.alpha=B;return J},NN=Is;var Rs={...e4,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:($)=>NN(W4($)),xyz65:NN},toMode:{rgb:($)=>N4(WN($)),xyz65:WN}},EC=Rs;var LN=($)=>{let Z=Math.abs($);if(Z>=0.001953125)return Math.sign($)*Math.pow(Z,0.5555555555555556);return 16*$},ks=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J={mode:"prophoto",r:LN($*1.3457868816471585-Z*0.2555720873797946-0.0511018649755453*H),g:LN($*-0.5446307051249019+Z*1.5082477428451466+0.0205274474364214*H),b:LN($*0+Z*0+1.2119675456389452*H)};if(B!==void 0)J.alpha=B;return J},AN=ks;var VN=($=0)=>{let Z=Math.abs($);if(Z>=0.03125)return Math.sign($)*Math.pow(Z,1.8);return $/16},bs=($)=>{let Z=VN($.r),H=VN($.g),B=VN($.b),J={mode:"xyz50",x:0.7977666449006423*Z+0.1351812974005331*H+0.0313477341283922*B,y:0.2880748288194013*Z+0.7118352342418731*H+0.0000899369387256*B,z:0*Z+0*H+0.8251046025104602*B};if($.alpha!==void 0)J.alpha=$.alpha;return J},DN=bs;var ys={...e4,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:AN,rgb:($)=>AN(Q9($))},toMode:{xyz50:DN,rgb:($)=>J9(DN($))}},SC=ys;var qN=($)=>{let Z=Math.abs($);if(Z>0.018053968510807)return(Math.sign($)||1)*(1.09929682680944*Math.pow(Z,0.45)-0.09929682680944008);return 4.5*$},hs=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J={mode:"rec2020",r:qN($*1.7166511879712683-Z*0.3556707837763925-0.2533662813736599*H),g:qN($*-0.6666843518324893+Z*1.6164812366349395+0.0157685458139111*H),b:qN($*0.0176398574453108-Z*0.0427706132578085+0.9421031212354739*H)};if(B!==void 0)J.alpha=B;return J},MN=hs;var PN=($=0)=>{let Z=Math.abs($);if(Z<0.08124285829863151)return $/4.5;return(Math.sign($)||1)*Math.pow((Z+1.09929682680944-1)/1.09929682680944,2.2222222222222223)},xs=($)=>{let Z=PN($.r),H=PN($.g),B=PN($.b),J={mode:"xyz65",x:0.6369580483012911*Z+0.1446169035862083*H+0.1688809751641721*B,y:0.262700212011267*Z+0.6779980715188708*H+0.059301716469862*B,z:0*Z+0.0280726930490874*H+1.0609850577107909*B};if($.alpha!==void 0)J.alpha=$.alpha;return J},_N=xs;var vs={...e4,mode:"rec2020",fromMode:{xyz65:MN,rgb:($)=>MN(W4($))},toMode:{xyz65:_N,rgb:($)=>N4(_N($))},parse:["rec2020"],serialize:"rec2020"},IC=vs;var S3=0.0037930732552754493,ZG=Math.cbrt(0.0037930732552754493);var ON=($)=>Math.cbrt($)-ZG,gs=($)=>{let{r:Z,g:H,b:B,alpha:J}=$8($),Q=ON(0.3*Z+0.622*H+0.078*B+S3),X=ON(0.23*Z+0.692*H+0.078*B+S3),z=ON(0.2434226892454782*Z+0.2047674442449682*H+0.5518098665095535*B+S3),G={mode:"xyb",x:(Q-X)/2,y:(Q+X)/2,b:z-(Q+X)/2};if(J!==void 0)G.alpha=J;return G},RC=gs;var jN=($)=>Math.pow($+ZG,3),fs=({x:$,y:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=jN($+Z)-S3,Q=jN(Z-$)-S3,X=jN(H+Z)-S3,z=Z8({r:11.031566904639861*J-9.866943908131562*Q-0.16462299650829934*X,g:-3.2541473810744237*J+4.418770377582723*Q-0.16462299650829934*X,b:-3.6588512867136815*J+2.7129230459360922*Q+1.9459282407775895*X});if(B!==void 0)z.alpha=B;return z},kC=fs;var ms={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:kC},fromMode:{rgb:RC},ranges:{x:[-0.0154,0.0281],y:[0,0.8453],b:[-0.2778,0.388]},interpolate:{x:P0,y:P0,b:P0,alpha:{use:P0,fixup:_1}}},bC=ms;var ps={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:J9,lab:h$},fromMode:{rgb:Q9,lab:y$},channels:["x","y","z","alpha"],ranges:{x:[0,0.964],y:[0,0.999],z:[0,0.825]},interpolate:{x:P0,y:P0,z:P0,alpha:{use:P0,fixup:_1}}},yC=ps;var us=($)=>{let{x:Z,y:H,z:B,alpha:J}=$;if(Z===void 0)Z=0;if(H===void 0)H=0;if(B===void 0)B=0;let Q={mode:"xyz50",x:1.0479298208405488*Z+0.0229467933410191*H-0.0501922295431356*B,y:0.0296278156881593*Z+0.990434484573249*H-0.0170738250293851*B,z:-0.0092430581525912*Z+0.0150551448965779*H+0.7518742899580008*B};if(J!==void 0)Q.alpha=J;return Q},hC=us;var cs=($)=>{let{x:Z,y:H,z:B,alpha:J}=$;if(Z===void 0)Z=0;if(H===void 0)H=0;if(B===void 0)B=0;let Q={mode:"xyz65",x:0.9554734527042182*Z-0.0230985368742614*H+0.0632593086610217*B,y:-0.0283697069632081*Z+1.0099954580058226*H+0.021041398966943*B,z:0.0123140016883199*Z-0.0205076964334779*H+1.3303659366080753*B};if(J!==void 0)Q.alpha=J;return Q},xC=cs;var ds={mode:"xyz65",toMode:{rgb:N4,xyz50:hC},fromMode:{rgb:W4,xyz50:xC},ranges:{x:[0,0.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:P0,y:P0,z:P0,alpha:{use:P0,fixup:_1}}},vC=ds;var ls=({r:$,g:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J={mode:"yiq",y:0.29889531*$+0.58662247*Z+0.11448223*H,i:0.59597799*$-0.2741761*Z-0.32180189*H,q:0.21147017*$-0.52261711*Z+0.31114694*H};if(B!==void 0)J.alpha=B;return J},gC=ls;var is=({y:$,i:Z,q:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J={mode:"rgb",r:$+0.95608445*Z+0.6208885*H,g:$-0.27137664*Z-0.6486059*H,b:$-1.10561724*Z+1.70250126*H};if(B!==void 0)J.alpha=B;return J},fC=is;var rs={mode:"yiq",toMode:{rgb:fC},fromMode:{rgb:gC},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-0.595,0.595],q:[-0.522,0.522]},interpolate:{y:P0,i:P0,q:P0,alpha:{use:P0,fixup:_1}}},mC=rs;function TN($){let Z=jz("lrgb")($);return 0.2126*Z.r+0.7152*Z.g+0.0722*Z.b}var Ry0=d1(cT),ky0=d1(tT),by0=d1(ZC),yy0=d1(HC),hy0=d1(BC),xy0=d1(yz),vy0=d1(hz),gy0=d1(GC),fy0=d1(FC),my0=d1(YC),py0=d1(KC),uy0=d1(x$),cy0=d1(NC),dy0=d1(v$),ly0=d1(AC),iy0=d1(qC),ry0=d1(MC),ay0=d1(PC),ny0=d1(_C),oy0=d1(OC),sy0=d1(TC),ty0=d1(wC),ey0=d1(EC),$h0=d1(SC),Zh0=d1(IC),Hh0=d1(e4),Bh0=d1(bC),Jh0=d1(yC),Qh0=d1(vC),Xh0=d1(mC);var Z7={sans:{label:"Sans",sans:"system-ui",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"},serif:{label:"Serif",sans:"Literata",mono:"Geist Mono",googleFontsQuery:"Literata:wght@400;600;700&family=Geist+Mono:wght@400;500"},mono:{label:"Mono",sans:"Geist Mono",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500;600"},geometric:{label:"Geometric",sans:"Manrope",mono:"Geist Mono",googleFontsQuery:"Manrope:wght@400;500;600&family=Geist+Mono:wght@400;500"},rounded:{label:"Rounded",sans:"SN Pro",mono:"Geist Mono",googleFontsQuery:"SN+Pro:wght@400;500;600&family=Geist+Mono:wght@400;500"},blobby:{label:"Blobby",sans:"Sour Gummy",mono:"Azeret Mono",googleFontsQuery:"Sour+Gummy:wght@400;500;600&family=Azeret+Mono:wght@400;500"},awkward:{label:"Awkward",sans:"Averia Sans Libre",mono:"Azeret Mono",googleFontsQuery:"Averia+Sans+Libre:wght@400;500;600&family=Azeret+Mono:wght@400;500"},comic:{label:"Comic",sans:"Comic Sans MS, Comic Sans, cursive",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"}},HG={squishy:{label:"Squishy",radius:"0.875rem"},soft:{label:"Soft",radius:"0.625rem"},subtle:{label:"Subtle",radius:"0.375rem"},square:{label:"Square",radius:"0"}},BG={round:{label:"Round",shape:0.11},boxy:{label:"Boxy",shape:0.54},capsule:{label:"Capsule",shape:0.65},triangle:{label:"Triangle",shape:0.99}},uC="oklch(0.205 0 0)";function pC($){return TN($)>0.3?"oklch(0 0 0)":"oklch(1 0 0)"}var cC={workspace:{primary:($)=>$,primaryForeground:($)=>pC($),background:()=>"color-mix(in srgb, var(--primary) 3%, oklch(1 0 0) 97%)",foreground:()=>"color-mix(in srgb, var(--primary) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 97%, var(--foreground) 3%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 4%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 7%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"},widget:{background:($)=>$,foreground:($)=>pC($),primary:()=>"color-mix(in srgb, var(--background) 3%, oklch(1 0 0) 97%)",primaryForeground:()=>"color-mix(in srgb, var(--background) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 97%, var(--foreground) 3%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 4%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 15%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"}},CN=Object.keys(cC.workspace);function dC($,Z="workspace"){let H={},B=cC[Z];for(let J of CN)H[J]=B[J]($);return H}var CB={default:{label:"Default"},paper:{label:"Paper",primary:"oklch(0.4328 0.0351 66.67)"},rose:{label:"Rose",primary:"oklch(0.6322 0.2171 26.02)"},tangerine:{label:"Tangerine",primary:"oklch(0.6886 0.22 37.15)"},sand:{label:"Sand",primary:"oklch(0.8334 0.1271 67.80)"},mint:{label:"Tropics",primary:"oklch(0.5774 0.1399 156.06)"},sky:{label:"Sky",primary:"oklch(0.5824 0.1830 253.59)"},lavender:{label:"Lavender",primary:"oklch(0.6025 0.2426 294.58)"}},y9={font:"sans",color:"default",radius:"soft",agent:"boxy"};function h9($){return{...y9,...$}}var wN="moi-fonts",lC="moi-font-previews",as=Object.values(Z7).map(($)=>$.googleFontsQuery).filter(Boolean).join("&family="),rC=[["sans","--sans"],["mono","--mono"]],aC=CN.map(($)=>[$,ns($)]),nC="--radius",iC=[...rC.map(([,$])=>$),...aC.map(([,$])=>$),nC];function ns($){return`--${$.replace(/[A-Z]/g,(H)=>`-${H.toLowerCase()}`)}`}function os($){let Z={},H=h9($),B=H.font===y9.font?void 0:Z7[H.font];for(let[J,Q]of rC)Z[Q]=B?.[J];return Z}function EN($,Z="workspace"){let H={},B=h9($),Q=(CB[B.color]??CB[y9.color]).primary??(Z==="widget"?uC:void 0),X=Q?dC(Q,Z):void 0;for(let[z,G]of aC)H[G]=X?.[z];return H}function ss($){let Z={},H=h9($),B=H.radius===y9.radius?void 0:HG[H.radius];return Z[nC]=B?.radius,Z}function z9($,Z="workspace"){return{...os($),...EN($,Z),...ss($)}}function QG(){JG.useEffect(()=>{if(document.getElementById(lC))return;let $=document.createElement("link");return $.id=lC,$.rel="stylesheet",$.crossOrigin="anonymous",$.href=`https://fonts.googleapis.com/css2?family=${as}&display=swap`,document.head.appendChild($),()=>{$.remove()}},[])}function ts($){JG.useEffect(()=>{let Z=document.documentElement,H=z9($);for(let B of iC){let J=H[B];if(J)Z.style.setProperty(B,J);else Z.style.removeProperty(B)}return()=>{for(let B of iC)Z.style.removeProperty(B)}},[$])}function oC($){let{font:Z}=h9($);ts($),JG.useEffect(()=>{let H=Z7[Z]??Z7[y9.font],B=document.getElementById(wN);if(!H.googleFontsQuery)B?.remove();else{let J=`https://fonts.googleapis.com/css2?family=${H.googleFontsQuery}&display=swap`;if(B)B.href=J;else{let Q=document.createElement("link");Q.id=wN,Q.rel="stylesheet",Q.crossOrigin="anonymous",Q.href=J,document.head.appendChild(Q)}}return()=>{document.getElementById(wN)?.remove()}},[Z])}var g$=O(g(),1);var Q2=O(c(),1),wB={width:320,height:180,radius:32,topLeftRadius:18,bodyTop:24,tabEnd:124,shoulder:{width:48,roundness:20}};function es($){let{width:Z,height:H,radius:B,topLeftRadius:J,bodyTop:Q,tabEnd:X,shoulder:z}=wB,G=Math.min(Z/2,B*$),F=Math.min(Z/2,J*$),U=Math.max(0,z.width),Y=X+U,K=Math.max(0,Math.min(z.roundness,U/2));return[`M ${F} 0`,`H ${X}`,`C ${X+K} 0 ${Y-K} ${Q} ${Y} ${Q}`,`H ${Z-G}`,`Q ${Z} ${Q} ${Z} ${Q+B}`,`V ${H-B}`,`Q ${Z} ${H} ${Z-G} ${H}`,`H ${G}`,`Q 0 ${H} 0 ${H-B}`,`V ${J}`,`Q 0 0 ${F} 0`,"Z"].join(" ")}function $t(){let $=g$.useRef(null),[Z,H]=g$.useState(1);return g$.useLayoutEffect(()=>{let B=$.current;if(!B)return;let J=(z,G)=>{if(z<=0||G<=0)return;let F=z/wB.width,Y=G/wB.height/F;H((K)=>Math.abs(K-Y)<0.001?K:Y)},Q=B.getBoundingClientRect();J(Q.width,Q.height);let X=new ResizeObserver(([z])=>{if(z)J(z.contentRect.width,z.contentRect.height)});return X.observe(B),()=>X.disconnect()},[]),{ref:$,horizontalRadiusScale:Z}}var sC=[{frame:s("-translate-x-3 translate-y-3 -rotate-6","group-hover:translate-y-2 group-focus-visible:translate-y-2"),img:"opacity-40"},{frame:s("translate-x-3 translate-y-2 rotate-5","group-hover:translate-y-1 group-focus-visible:translate-y-1"),img:"opacity-50"},{frame:s("-translate-x-1 translate-y-1 -rotate-2","group-hover:-translate-y-2 group-focus-visible:-translate-y-2"),img:"opacity-100"}];function tC({workspaceId:$}){let Z=TX($),H=Z.data?[...Z.data.thumbnails].reverse():[],B=sC.slice(sC.length-H.length),J=Z.data?.firstUserMessage,Q=Z.data?.theme,{ref:X,horizontalRadiusScale:z}=$t(),G=es(z),F=`folder-noise-${$}`,U=z9(Q),Y=EN(Q);return Q2.jsxs("div",{ref:X,style:Y,className:"relative h-45 w-full",children:[Q2.jsxs("svg",{viewBox:`0 0 ${wB.width} ${wB.height}`,preserveAspectRatio:"none","aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",children:[Q2.jsx("defs",{children:Q2.jsxs("filter",{id:F,x:"0%",y:"0%",width:"100%",height:"100%",colorInterpolationFilters:"sRGB",children:[Q2.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",seed:"7",result:"noise"}),Q2.jsx("feColorMatrix",{in:"noise",type:"saturate",values:"0",result:"monochromeNoise"}),Q2.jsx("feComponentTransfer",{in:"monochromeNoise",result:"faintNoise",children:Q2.jsx("feFuncA",{type:"linear",slope:"0.24"})}),Q2.jsx("feComposite",{in:"faintNoise",in2:"SourceAlpha",operator:"in",result:"clippedNoise"}),Q2.jsx("feBlend",{in:"SourceGraphic",in2:"clippedNoise",mode:"soft-light"})]})}),Q2.jsx("path",{d:G,filter:`url(#${F})`,className:"fill-accent"})]}),H.map((K,W)=>Q2.jsx("div",{className:s("absolute top-[12%] left-[14%] w-fit max-w-[72%] overflow-hidden rounded-[calc(var(--radius-2xl)*0.4)] bg-background shadow-xs [corner-shape:superellipse(1.2)]","animate-in duration-300 ease-out fade-in",B[W].frame),children:Q2.jsx("img",{src:K,alt:"",loading:"lazy",className:s("block h-auto max-h-32 w-auto max-w-full object-contain",B[W].img)})},K)),H.length===0&&J&&Q2.jsx("div",{className:"absolute inset-x-[12%] top-[22%] flex justify-end",children:Q2.jsx("div",{"aria-hidden":"true",style:U,className:s("w-max max-w-40 origin-center rounded-lg bg-card px-3 py-2 font-sans shadow-xs","animate-in transition-transform duration-300 ease-out fade-in","-translate-x-1 translate-y-1 -rotate-2","group-hover:translate-y-0.5 group-focus-visible:translate-y-0.5"),children:Q2.jsx("p",{className:"line-clamp-3 text-sm leading-normal whitespace-normal",children:J})})}),Q2.jsx("div",{className:s("absolute inset-x-2 top-[40%] bottom-2 rounded-2xl bg-[color-mix(in_oklch,var(--accent),var(--foreground)_5%)]","mask-[linear-gradient(to_bottom,rgba(0,0,0,0.9)_0%,black_50%)] backdrop-blur-lg","inset-shadow-[0_0_12px_color-mix(in_oklab,var(--background)_20%,transparent)]")})]})}var X1=O(c(),1);function Zw(){QG();let[,$]=p4(),Z=jX(),H=BO(),B=CX(),J=NT({onSuccess:(N)=>$(`/workspace/${N.id}`)}),Q=Z9(),[X,z]=$w.useState(!1),G=j5((N)=>N.discoveredWorkspacesOpen),F=j5((N)=>N.setDiscoveredWorkspacesOpen);if(Z.isPending||H.isPending)return X1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:X1.jsx(I5,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(Z.isError||H.isError)return X1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:X1.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let U=Z.data,Y=H.data,K=U.length;function W(N){if(Q.cloudDemo){z(!0);return}J.startImport(N)}return X1.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[X1.jsx(DT,{className:"mb-10"}),K>0?X1.jsxs("section",{className:"mb-12",children:[X1.jsxs("div",{className:"mb-4 flex items-center justify-between gap-2",children:[X1.jsx("h1",{className:"text-sm font-medium text-foreground",children:"My workspaces"}),X1.jsx(sH,{trigger:X1.jsxs(C0,{variant:"outline",size:"sm",children:[X1.jsx(K4,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),X1.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2 md:grid-cols-3",children:U.map((N)=>X1.jsx(Zt,{workspace:N},N.id))})]}):X1.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 pt-8 pb-16 text-center",children:[X1.jsx(eC,{size:32,stroke:1.5,className:"text-muted-foreground"}),X1.jsxs("div",{className:"flex flex-col gap-1.5",children:[X1.jsx("h2",{className:"font-medium",children:"Let’s start with creating your first workspace"}),X1.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Workspace is a place for all the chats, widgets, and views that share the same context. Create a new one or import an existing folder you’ve worked in before."})]}),X1.jsx(sH,{trigger:X1.jsx(C0,{children:"Create workspace"})})]}),Y.length>0&&X1.jsx("section",{children:X1.jsxs(Dz,{open:G,onOpenChange:F,className:"group",children:[X1.jsxs(qz,{className:s("group/trigger","flex w-full items-center gap-1 pb-4 text-left outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","text-muted-foreground group-data-open:text-foreground hover:text-foreground"),children:[X1.jsx("span",{className:"text-sm font-medium",children:"Import from this computer"}),X1.jsx(H7,{size:16,stroke:2,className:s("opacity-0 transition-[opacity,transform]","group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100 group-data-open:rotate-90")})]}),X1.jsx(Mz,{children:X1.jsx("ul",{className:"border-t border-border",children:Y.map((N)=>X1.jsx(Ht,{suggestion:N,onAdd:W},N.path))})})]})}),J.choice&&X1.jsx(KT,{choice:J.choice,availability:B.data?.availability,isPending:J.isPending,errorMessage:J.error?.message,onTypeChange:J.selectType,onSubmit:J.submit,onReset:J.reset}),X1.jsx(M$,{open:X,onOpenChange:z})]})}function Zt({workspace:$}){let Z=c6($),H=TX($.id),B=H.data?.theme,J=H.data?.updatedAt??new Date($.addedAt).getTime();return X1.jsxs(YH,{href:`/workspace/${$.id}`,className:"group flex min-w-0 flex-col gap-3",children:[X1.jsx(tC,{workspaceId:$.id}),X1.jsxs("div",{className:"flex min-w-0 flex-col gap-2 px-2",children:[X1.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 font-sans",style:z9(B),children:[X1.jsx("img",{src:$.icon??M8[$.type??"claude-code"],alt:"",className:"size-4 shrink-0 rounded-xs"}),X1.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Z})]}),X1.jsx("span",{className:"text-xs text-muted-foreground",children:Bt(J)})]})]})}function Ht({suggestion:$,onAdd:Z}){let{path:H,types:B}=$,J=c6($);return X1.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[X1.jsx(Aj,{types:B}),X1.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:J}),X1.jsx("span",{title:H,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:$.displayPath??H}),X1.jsxs(C0,{variant:"outline",size:"sm",onClick:()=>Z($),children:[X1.jsx(K4,{stroke:1.75}),"Add"]})]})}function Bt($){let Z=Date.now()-$,H=Math.floor(Z/60000);if(H<1)return"Updated just now";if(H<60)return`Updated ${H} min${H===1?"":"s"} ago`;let B=Math.floor(H/60);if(B<24)return`Updated ${B} hour${B===1?"":"s"} ago`;let J=Math.floor(B/24);if(J<30)return`Updated ${J} day${J===1?"":"s"} ago`;return`Updated ${new Date($).toLocaleDateString()}`}var XG=O(c(),1);function Hw(){return XG.jsx(Yz,{showWorkspaces:!1,children:XG.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:XG.jsx(Zw,{})})})}var zG=O(g(),1);var SN=O(c(),1),Qw=($)=>$.map((Z)=>[...Z].map((H)=>H==="#"?1:0)),Jt=["####.","#.#.#","#.#.#","#.#.#","#.#.#"],Qt=["###.#","#.#.#","#.#.#","#.#.#","###.#"],Xt=Qw([".....","####.","#.#.#","#.#.#","#.#.#"]),zt=Qw(Jt.map(($,Z)=>`${$}.${Qt[Z]}`)),Gt={moi:Xt,"moi-full":zt};function Xw($,Z,H){let B=[];for(let J=0;J<Z;J++){let Q=[];for(let X=0;X<$;X++)Q.push(H(X,J));B.push(Q)}return B}function Bw($,Z,H){let B=Math.sin($*12.9898+Z*78.233+H*37.719)*43758.5453;return B-Math.floor(B)}function Ft($,Z,H){return Xw(Z,H,(B,J)=>{let Q=Bw(B,J,0)*Math.PI*2,X=5+Bw(B,J,1)*6,z=0.5+0.5*Math.sin($*X+Q);return z*z})}function Ut($,Z,H){return Xw(Z,H,(J,Q)=>0.5+0.5*Math.sin(J*0.5+Q*0.32-$*6.5))}var zw=0.55;function Yt($,Z){let H=$.length,B=$.reduce((G,F)=>Math.max(G,F.length),0),J=Math.min(Z/zw,1),Q=1-Math.pow(1-J,3),X=Math.round((1-Q)*H),z=[];for(let G=0;G<H;G++){let F=[];for(let U=0;U<B;U++)F.push($[G-X]?.[U]??0);z.push(F)}return z}function Jw($,Z,H){let B=Gt[$];if(Z===void 0)return Yt(B,H);let J=B.length,Q=B[0]?.length??0;return Z==="wave"?Ut(H,Q,J):Ft(H,Q,J)}var Kt=24;function Wt($,Z,H){let[B,J]=zG.useState(()=>Jw($,Z,0));return zG.useEffect(()=>{let Q=0,X=null,z=0,G=1000/H,F=(U)=>{if(X===null)X=U;let Y=(U-X)/1000;if(U-z>=G){if(z=U,J(Jw($,Z,Y)),Z===void 0&&Y>=zw)return}Q=requestAnimationFrame(F)};return Q=requestAnimationFrame(F),()=>cancelAnimationFrame(Q)},[$,Z,H]),B}function Nt($){return`rgba(23, 23, 23, ${(0.1+Math.max(0,Math.min(1,$))*0.9).toFixed(3)})`}function Gw({sprite:$="moi",effect:Z,fps:H=Kt,pixelSize:B=3,gap:J=1,className:Q}){let X=Wt($,Z,H),z=X[0]?.length??0,G=Z!==void 0;return SN.jsx("div",{className:s("grid",Q),style:{gridTemplateColumns:`repeat(${z}, ${B}px)`,gap:`${J}px`},children:X.flatMap((F,U)=>F.map((Y,K)=>SN.jsx("div",{className:"rounded-[2px]",style:{width:B,height:B,background:Nt(Y),boxShadow:G?`0 0 ${(B*(0.4+Y)).toFixed(1)}px rgba(23, 23, 23, ${(Y*0.35).toFixed(3)})`:void 0}},`${U}-${K}`)))})}var p$=O(g(),1);var UG=O(g(),1);var Fw=()=>({emit($,...Z){for(let H=this.events[$]||[],B=0,J=H.length;B<J;B++)H[B](...Z)},events:{},on($,Z){return(this.events[$]||=[]).push(Z),()=>{this.events[$]=this.events[$]?.filter((H)=>Z!==H)}}});function IN($){return $==="agent"||$==="widgets"||$==="scratchpad"||typeof $==="string"&&(/^view:[^/]+$/.test($)||/^view-builder:[^/]+$/.test($))}function EB($){return IN($)?$:null}function Uw($,Z){return`/workspace/${$}/${Z}`}var GG=($)=>`view:${$}`,I3=($)=>$.startsWith("view:")?$.slice(5):null,R3=($)=>`view-builder:${$}`,B7=($)=>$.startsWith("view-builder:")?$.slice(13):null;function f$($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function Yw($){if(!f$($))return{};let Z=$.appletParams;return f$(Z)?Z:{}}var RN=2000;var Lt=({kind:$,name:Z})=>`${$}:${Z}`,Kw=1000,kN={cooldownMs:2000,windowMs:60000,maxPerWindow:10,maxKeys:64};function At($){let Z=Fw(),H=MX(kN),B=(Q,X)=>{D8($,{source:"runtime",kind:Q.kind,name:Q.name,message:X})},J=(Q,X,z)=>{let G=H.admit(`${X}\x00${z}`);if(G==="cooldown")return B(Q,`sendChatMessage("${z}") was dropped: the same message was already sent less than ${kN.cooldownMs/1000}s ago. Call it from an event handler, not during render.`),!1;if(G==="window")return B(Q,`sendChatMessage("${z}") was dropped: more than ${kN.maxPerWindow} messages in a minute from this workspace. Each one starts an agent run, so send only on a real user action.`),!1;return!0};return{on(Q,X){return Z.on(Q,X)},connect(Q){let X=!0,z=Lt(Q);return{bridge:{focusTab(F,U){if(!X)return;if(!IN(F))return;Z.emit("focusTab",F,f$(U)?U:void 0)},sendChatMessage(F,U){if(!X)return;if(typeof F!=="string")return;let Y=F.trim();if(!Y)return;if(Y.length>Kw){B(Q,`sendChatMessage() was dropped: the message is ${Y.length} characters (max ${Kw}). Put long content in the context argument, not the message.`);return}if(!J(Q,z,Y))return;Z.emit("sendChatMessage",{message:Y,source:z,...U!==void 0?{context:Vt(Q,U,B)}:{}})}},dispose:()=>{X=!1}}}}}function Vt($,Z,H){if(!f$(Z)){H($,"sendChatMessage() ignored its context argument: it must be a plain object.");return}let B;try{B=JSON.stringify(Z)}catch{H($,"sendChatMessage() ignored its context argument: it is not JSON-serializable (cycles, functions, or BigInt).");return}if(B.length>RN){H($,`sendChatMessage() ignored its context argument: ${B.length} characters serialized (max ${RN}). Send an id the agent can look up instead of the whole payload.`);return}return Z}var Ww=new Map;function Nw($){let Z=Ww.get($);if(!Z)Z=At($),Ww.set($,Z);return Z}function YG($,Z,H){let B=UG.useRef(H);B.current=H,UG.useEffect(()=>{let J=(...Q)=>B.current(...Q);return Nw($).on(Z,J)},[$,Z])}var FG=new Map;function Lw($,Z,H,B){let J=$.__attachBridge;if(typeof J!=="function")return;FG.get(H)?.();let{bridge:Q,dispose:X}=Nw(Z).connect(B);FG.set(H,X),J(Q)}function bN($){let Z=FG.get($);if(!Z)return;FG.delete($),Z()}function KG($,Z,H){return`${$}/${Z}/${H}`}var m$=new Map,SB=new Map;function Dt($,Z,H){return m$.get(KG($,Z,H))??0}var qt="module";function Aw($,Z,H){return`/api/workspaces/${Z}/${$}/${H}/${qt}?v=${Dt($,Z,H)}`}function WG($,Z,H){return`/api/workspaces/${Z}/${$}/${H}`}function NG($,Z){return`${$==="widgets"?"widget":"view"}:${Z}`}function Vw($){return SB.get($)}function Dw($,Z){SB.set($,Z)}function LG($,Z,H){let B=KG($,Z,H);SB.delete(B),m$.set(B,(m$.get(B)??0)+1),bN(B)}function yN($){let Z=`${$}/`;for(let H of new Set([...SB.keys(),...m$.keys()]))if(H.startsWith(Z))SB.delete(H),m$.set(H,(m$.get(H)??0)+1),bN(H)}var Mt={kind:"widget",segment:"widgets",shouldReload:($,Z)=>$.type==="widget:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="views"},Pt={kind:"view",segment:"views",shouldReload:($,Z)=>$.type==="view:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="widgets"};function _t($,Z,H){let{segment:B}=$,J=KG(B,Z,H),Q=Vw(J);if(Q)return Q;let X=import(Aw(B,Z,H)).then((z)=>{if(!z.default)throw Error(`"${H}" has no default export`);return Lw(z,Z,J,{kind:$.kind,name:H}),z.default});return Dw(J,X),X}function qw($,Z){let H=H5(),[B,J]=p$.useState({status:"loading",version:0}),Q=p$.useCallback(()=>{J((X)=>({status:"loading",version:X.version})),_t($,H,Z).then((X)=>J((z)=>({status:"ready",Component:X,version:z.version+1}))).catch((X)=>{D8(H,{source:"load",kind:$.kind,name:Z,message:String(X),...X instanceof Error&&X.stack?{stack:X.stack}:{}}),J((z)=>({status:"error",error:String(X),version:z.version+1}))})},[$,H,Z]);return p$.useEffect(()=>{Q()},[Q]),B2((X)=>{if($.shouldReload(X,Z))LG($.segment,H,Z),Q()}),B}function Mw($){return qw(Mt,$)}function Pw($){return qw(Pt,$)}function _w(){let $=H5();B2((Z)=>{if(Z.type==="view:updated")LG("views",$,Z.name);else if(Z.type==="widget:updated")LG("widgets",$,Z.name);else if(Z.type==="applets:refresh"){if(Z.only!=="views")yN("widgets");if(Z.only!=="widgets")yN("views")}})}var H8=O(g(),1);var b4={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function Ow($){return o1({queryKey:w0.layout($),queryFn:()=>V1(`/api/workspaces/${$}`),...b4})}function G9($){let Z=$1();return B2((H)=>{if(H.type==="agent:updated"&&H.workspaceId===$)Z.setQueryData(w0.agent($),(B)=>B?{...B,availability:H.availability,login:H.login}:B);if(H.type==="env:updated"&&H.workspaceId===$)Z.invalidateQueries({queryKey:w0.agent($)})}),o1({queryKey:w0.agent($),queryFn:()=>V1(`/api/workspaces/${$}/agent`),staleTime:30000,refetchOnWindowFocus:!0})}function jw($){return V1(`/api/workspaces/${$}/auth/login`,{method:"POST"},"Could not start sign-in")}function Tw($){return o1({queryKey:w0.skills($),queryFn:()=>V1(`/api/workspaces/${$}/skills`),...b4})}async function Ot($){let Z=await fetch(`/api/workspaces/${$}/skills/update`,{method:"POST"}),H=await Z.text(),B=null;try{B=JSON.parse(H)}catch{}if(!Z.ok){let J=B&&"error"in B?B.error:H,Q=Error(J||"Failed to update workspace skill");if(B?.skills)Q.status={skills:B.skills,updateAvailable:B.updateAvailable};throw Q}if(!B)throw Error("Invalid workspace skill update response");return B}function Cw($){let Z=$1();return s1({mutationFn:()=>Ot($),onSuccess:(H)=>{Z.setQueryData(w0.skills($),H)},onError:(H)=>{if(H.status)Z.setQueryData(w0.skills($),H.status)}})}function ww($){return o1({queryKey:w0.widgets($),queryFn:async()=>{return(await V1(`/api/workspaces/${$}/widgets`)).widgets},...b4})}function AG($){return o1({queryKey:w0.views($),queryFn:async()=>{return(await V1(`/api/workspaces/${$}/views`)).views},...b4})}function Ew($){let Z=$1();return s1({mutationFn:(H)=>E4(`/api/workspaces/${$}`,n5("PUT",H),"Failed to save layout"),onSuccess:()=>{Z.invalidateQueries({queryKey:w0.preview($)})}})}function hN(){return{open:["agent","widgets","scratchpad"],active:"agent"}}function Sw(){return{version:1,widgetGrid:[],layoutMode:"split",tabs:hN()}}var bw=O(c(),1),xN=H8.createContext(null);function K5(){let $=H8.useContext(xN);if(!$)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return $}function Rw(){return H8.useContext(xN)?.layout.theme}function Iw($){let{cwd:Z,name:H,provider:B,agentId:J,...Q}=$;return Q}function kw({id:$,children:Z}){let H=$1(),B=Ow($),J=Ew($),Q=H8.useRef(J.mutate);Q.current=J.mutate;let X=H8.useRef(null),z=H8.useCallback((F)=>{let U=w0.layout($),Y=H.getQueryData(U);if(!Y)return;let K={...Y,...F};if(H.setQueryData(U,K),X.current)clearTimeout(X.current);X.current=setTimeout(()=>{X.current=null,Q.current(Iw(K))},600)},[$,H]),G=H8.useMemo(()=>({layout:B.data?Iw(B.data):Sw(),setLayout:z,name:B.data?.name??null,icon:B.data?.icon??null,cwd:B.data?.cwd??null,provider:B.data?.provider??null,workspaceId:$,isLoading:B.isLoading}),[B.data,B.isLoading,z,$]);return bw.jsx(xN,{value:G,children:Z})}var z4=O(g(),1);var DG=O(c(),1);function VG({visible:$,editing:Z,canvasRef:H,width:B,height:J,pointerProps:Q,onKeyDown:X,children:z}){if(!$)return null;return DG.jsxs("div",{className:"absolute inset-0 animate-in duration-100 fade-in",onKeyDown:X,children:[DG.jsx("canvas",{ref:H,...Q,width:B,height:J,"aria-label":"Drawing area",tabIndex:0,className:"absolute inset-0 size-full cursor-pencil touch-none outline-none"}),Z&&z]})}var i0=O(g(),1);function gN($,Z,H){let B=Math.max($,Z);if(B<=0)return 1;return Math.min(Math.max(H,1),1568/B)}function jt($){return new Promise((Z,H)=>{setTimeout(()=>H(Error("Annotation capture timed out")),$)})}async function yw($){let Z=$.getBoundingClientRect();if(Z.width<=0||Z.height<=0)throw Error("Annotation target is not visible");let{createContext:H,destroyContext:B,domToCanvas:J}=await import("/chunk-0pcdwjkp.js"),Q=async()=>{let X=await H($,{width:Math.round(Z.width),height:Math.round(Z.height),scale:gN(Z.width,Z.height,window.devicePixelRatio),type:"image/png",backgroundColor:getComputedStyle($).backgroundColor,timeout:1000,features:{restoreScrollPosition:!0},style:{overflow:"hidden"}});try{return await J(X)}finally{B(X)}};return Promise.race([Q(),jt(1e4)])}var fN={past:[],present:[],future:[]};function Tt($,Z){if(Z.type==="commit")return{past:[...$.past,$.present],present:[...$.present,Z.stroke],future:[]};if(Z.type==="undo"){let H=$.past.at(-1);if(!H)return $;return{past:$.past.slice(0,-1),present:H,future:[$.present,...$.future]}}if(Z.type==="redo"){let H=$.future[0];if(!H)return $;return{past:[...$.past,$.present],present:H,future:$.future.slice(1)}}if($.present.length===0)return $;return{past:[...$.past,$.present],present:[],future:[]}}function vw($,Z,H){let B=$.getBoundingClientRect();return{x:(Z-B.left)/B.width*$.width,y:(H-B.top)/B.height*$.height}}function hw($,Z){let H=Z.getCoalescedEvents?.()??[];return(H.length>0?H:[Z]).map((J)=>vw($,J.clientX,J.clientY))}var Ct={canUndo:!1,canRedo:!1,hasStrokes:!1};function IB($){return i0.useSyncExternalStore($.subscribeHistory,$.getHistoryState,$.getHistoryState)}function xw($,Z,H,B){let J=Z.points[0];if(!J)return;$.beginPath(),$.lineCap="round",$.lineJoin="round",$.lineWidth=B,$.strokeStyle=H,$.moveTo(J.x,J.y);for(let Q=1;Q<Z.points.length;Q++){let X=Z.points[Q];$.lineTo(X.x,X.y)}if(Z.points.length===1)$.lineTo(J.x+0.01,J.y+0.01);$.stroke()}function gw($,Z,H,B,J,Q=null){let X=Math.max(3,Math.min(Z,H)*0.005),z=X+Math.max(2,X*0.75),G=Q?[...J,Q]:J;for(let F of G)xw($,F,B.haloColor,z);for(let F of G)xw($,F,B.strokeColor,X)}function wt($,Z,H,B=null){let J=$.getContext("2d");if(!J)return;J.clearRect(0,0,$.width,$.height),gw(J,$.width,$.height,Z,H,B)}function Et($,Z,H){let B=$.getContext("2d");if(!B)return;B.clearRect(0,0,$.width,$.height),B.drawImage(Z.snapshot,0,0,$.width,$.height),gw(B,$.width,$.height,Z,H)}function St($){return new Promise((Z,H)=>{$.toBlob((B)=>{if(B)Z(B);else H(Error("Could not export drawing"))},"image/png")})}function It($,Z,H){let B=$.getBoundingClientRect();if(B.width<=0||B.height<=0)return null;let J=getComputedStyle($),Q=gN(B.width,B.height,window.devicePixelRatio),X=Math.max(1,Math.round(B.width*Q)),z=Math.max(1,Math.round(B.height*Q)),G=document.createElement("canvas");G.width=X,G.height=z;let F=J.getPropertyValue("--background").trim()||"#ffffff",U=G.getContext("2d");if(U)U.fillStyle=F,U.fillRect(0,0,X,z);return Z.width=X,Z.height=z,{id:H,snapshot:G,strokeColor:J.getPropertyValue("--primary").trim()||"#2563eb",haloColor:F,targetWidth:B.width,targetHeight:B.height}}function Rt($){return $ instanceof HTMLInputElement||$ instanceof HTMLTextAreaElement||$ instanceof HTMLElement&&$.isContentEditable}function qG({mode:$="annotation",onChange:Z,onEditingStart:H,onFinish:B}={}){let J=i0.useRef(null),Q=i0.useRef(null),[X,z]=i0.useState(null),G=i0.useRef(X),[F,U]=i0.useState(!1),Y=i0.useRef(!1),K=i0.useRef(fN),W=i0.useRef(Ct),N=i0.useRef(new Set),L=i0.useRef(0),V=i0.useRef(null),A=i0.useRef(null),D=i0.useRef(0),q=i0.useRef(0),_=i0.useRef(null),M=i0.useRef(null),[P,T]=i0.useState(!1),R=i0.useRef(!1),[y,w]=i0.useState(!1),h=i0.useRef(!1),E=i0.useRef(Z),I=i0.useRef(H),j=i0.useRef(B);E.current=Z,I.current=H,j.current=B;let S=i0.useCallback(()=>{let f=K.current,l=W.current,m={canUndo:f.past.length>0,canRedo:f.future.length>0,hasStrokes:f.present.length>0};if(m.canUndo===l.canUndo&&m.canRedo===l.canRedo&&m.hasStrokes===l.hasStrokes)return;W.current=m;for(let a of N.current)a()},[]),k=i0.useCallback((f)=>{return N.current.add(f),()=>{N.current.delete(f)}},[]),b=i0.useCallback(()=>W.current,[]),v=i0.useCallback((f,l=null)=>{if(D.current)cancelAnimationFrame(D.current),D.current=0;let m=Q.current,a=G.current;if(m&&a)wt(m,a,f,l)},[]),u=i0.useCallback(()=>{if(D.current)return;D.current=requestAnimationFrame(()=>{D.current=0,v(K.current.present,V.current)})},[v]),C=i0.useCallback((f,l,m)=>{let a=_.current;if(a?.sessionId===f.id&&a.historyVersion===m)return Promise.resolve(a.blob);let o=M.current;if(o?.sessionId===f.id&&o.historyVersion===m)return o.promise;if(l.length===0)return _.current={sessionId:f.id,historyVersion:m,blob:null},E.current?.(null),Promise.resolve(null);let D0=document.createElement("canvas");D0.width=f.snapshot.width,D0.height=f.snapshot.height,Et(D0,f,l);let O0=St(D0).then((k0)=>{if(G.current?.id!==f.id||L.current!==m)return k0;return _.current={sessionId:f.id,historyVersion:m,blob:k0},E.current?.(k0),k0}).catch(()=>{if(G.current?.id===f.id&&L.current===m)r4.add({title:"Couldn’t export the drawing",type:"error"});return null}).finally(()=>{if(M.current?.promise===O0)M.current=null});return M.current={sessionId:f.id,historyVersion:m,promise:O0},O0},[]),t=i0.useCallback(()=>{if(!V.current)return;let f=Q.current,l=A.current;if(f&&l!==null&&f.hasPointerCapture(l))f.releasePointerCapture(l);V.current=null,A.current=null,v(K.current.present)},[v]),H0=i0.useCallback((f)=>{let l=G.current;if(!l||h.current)return;let m=Tt(K.current,f);if(m===K.current)return;K.current=m,S(),V.current=null;let a=++L.current;v(m.present),C(l,m.present,a)},[C,S,v]),x=i0.useCallback((f)=>{K.current=fN,L.current=0,_.current=null,M.current=null,V.current=null,A.current=null,S(),G.current=f,z(f)},[S]),e=i0.useCallback(()=>{if(Y.current)return;Y.current=!0,U(!0),I.current?.()},[]),L0=i0.useCallback(async()=>{let f=J.current;if(!f||G.current||R.current)return!1;let l=++q.current;R.current=!0,T(!0);try{let m=await yw(f);if(l!==q.current||J.current!==f)return!1;let a=f.getBoundingClientRect(),o=getComputedStyle(f),D0={id:l,snapshot:m,strokeColor:o.getPropertyValue("--primary").trim()||"#2563eb",haloColor:o.getPropertyValue("--background").trim()||"#ffffff",targetWidth:a.width,targetHeight:a.height};return x(D0),e(),!0}finally{if(l===q.current)R.current=!1,T(!1)}},[e,x]),d=i0.useCallback(()=>{let f=G.current;q.current+=1,R.current=!1,h.current=!1,T(!1),w(!1),Y.current=!1,U(!1),t(),z(null),K.current=fN,S();let l=M.current;if(!f||l?.sessionId!==f.id)return G.current=null,Promise.resolve();return l.promise.then(()=>{if(G.current?.id===f.id)G.current=null})},[t,S]),X0=i0.useCallback(async()=>{let f=G.current;if(!f)return null;return t(),C(f,K.current.present,L.current)},[t,C]),K0=i0.useCallback(async()=>{return Y.current=!1,U(!1),X0()},[X0]),Q0=i0.useCallback(async()=>{let f=G.current;if(!f||h.current)return null;h.current=!0,w(!0),t();let l=L.current,m=K.current.present,a=null;if(m.length>0||l>0)a=await C(f,m,l);if(G.current?.id!==f.id)return a;try{await j.current?.(a)}finally{if(G.current?.id===f.id)q.current+=1,Y.current=!1,U(!1),G.current=null,z(null),h.current=!1,w(!1)}return a},[t,C]),z0=i0.useCallback(()=>H0({type:"undo"}),[H0]),A0=i0.useCallback(()=>H0({type:"redo"}),[H0]),i=i0.useCallback(()=>H0({type:"clear"}),[H0]),B0=i0.useMemo(()=>({onPointerDown:(f)=>{if(h.current||!f.isPrimary||f.pointerType==="mouse"&&f.button!==0)return;if(!G.current&&$==="sketch"){let l=J.current;if(!l)return;let m=It(l,f.currentTarget,++q.current);if(!m)return;x(m)}if(!G.current)return;e(),A.current=f.pointerId,f.currentTarget.setPointerCapture(f.pointerId),V.current={points:[vw(f.currentTarget,f.clientX,f.clientY)]},v(K.current.present,V.current)},onPointerMove:(f)=>{if(f.pointerId!==A.current||!V.current)return;V.current.points.push(...hw(f.currentTarget,f.nativeEvent)),u()},onPointerUp:(f)=>{if(f.pointerId!==A.current||!V.current)return;let l=V.current;if(l.points.push(...hw(f.currentTarget,f.nativeEvent)),V.current=null,A.current=null,f.currentTarget.hasPointerCapture(f.pointerId))f.currentTarget.releasePointerCapture(f.pointerId);H0({type:"commit",stroke:l})},onPointerCancel:(f)=>{if(f.pointerId===A.current)t()}}),[H0,e,t,x,$,v,u]),$0=i0.useCallback((f)=>{if(Rt(f.target))return;if(f.key==="Escape"&&$==="annotation"){f.preventDefault(),Q0();return}if(!(f.metaKey||f.ctrlKey)||f.key.toLowerCase()!=="z")return;if(f.preventDefault(),f.shiftKey)A0();else z0()},[Q0,$,A0,z0]);i0.useLayoutEffect(()=>{if(!X)return;if(v(K.current.present,V.current),F)Q.current?.focus()},[F,v,X]),i0.useEffect(()=>{if(!X||$==="sketch")return;let f=J.current;if(!f){d();return}let l=new ResizeObserver((m)=>{let a=m[0]?.contentRect;if(!a)return;if(Math.abs(a.width-X.targetWidth)>1||Math.abs(a.height-X.targetHeight)>1)d()});return l.observe(f),()=>l.disconnect()},[d,$,X]),i0.useEffect(()=>()=>{if(q.current+=1,Y.current=!1,G.current=null,D.current)cancelAnimationFrame(D.current)},[]);let J0=i0.useMemo(()=>({active:F,visible:$==="sketch"||X!==null,starting:P,finishing:y,open:L0,undo:z0,redo:A0,clear:i,flush:X0,deactivate:K0,finish:Q0,cancel:d,subscribeHistory:k,getHistoryState:b}),[F,$,X,P,y,L0,z0,A0,i,X0,K0,Q0,d,k,b]),n=i0.useMemo(()=>({visible:J0.visible,editing:J0.active,canvasRef:Q,width:X?.snapshot.width??1,height:X?.snapshot.height??1,pointerProps:B0,onKeyDown:$0}),[J0.active,J0.visible,X,B0,$0]);return i0.useMemo(()=>({targetRef:J,controls:J0,layerProps:n}),[J0,n])}var c5=O(c(),1);function MG({controls:$,title:Z,busy:H,onComplete:B}){let{canUndo:J,canRedo:Q,hasStrokes:X}=IB($);return c5.jsxs("div",{className:"absolute bottom-3 left-1/2 flex -translate-x-1/2 items-center gap-2 rounded-lg bg-popover p-1.5 shadow-md",children:[c5.jsx("span",{className:"mr-2 ml-2 text-sm font-medium",children:Z}),c5.jsxs("div",{className:"flex gap-1",children:[c5.jsxs(r1,{children:[c5.jsx(a1,{render:c5.jsx(C0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.undo,disabled:H||!J,"aria-label":"Undo",children:c5.jsx(fw,{stroke:1.75})})}),c5.jsx(n1,{children:"Undo"})]}),c5.jsxs(r1,{children:[c5.jsx(a1,{render:c5.jsx(C0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.redo,disabled:H||!Q,"aria-label":"Redo",children:c5.jsx(mw,{stroke:1.75})})}),c5.jsx(n1,{children:"Redo"})]}),c5.jsx(C0,{type:"button",variant:"outline",size:"sm",onClick:$.clear,disabled:H||!X,children:"Clear"})]}),c5.jsx(e2,{mode:"popLayout",initial:!1,children:c5.jsx(B5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.1,bounce:0},children:c5.jsx(C0,{type:"button",variant:X?"default":"ghost",size:"icon-sm",onClick:B,disabled:H,"aria-label":"Complete",className:s(!X&&"text-muted-foreground"),children:X?c5.jsx(L3,{stroke:1.75}):c5.jsx(S5,{stroke:1.75})})},X?"complete":"cancel")})]})}var x5=O(g(),1);async function mN($,Z){let H=new FormData;for(let J of Z)H.append("files",J);let B=await fetch(`/api/workspaces/${$}/uploads`,{method:"POST",body:H});if(!B.ok){let J=await B.text().catch(()=>"");throw Error(J||`Upload failed (${B.status})`)}return B.json()}function pw({workspaceId:$,sessionId:Z},H){if(H.length===0)return;let B=H.map((J)=>({kind:"file",localId:crypto.randomUUID(),name:J.name||"file",mediaType:J.type||"application/octet-stream",previewUrl:J.type.startsWith("image/")?URL.createObjectURL(J):void 0,status:"uploading"}));E1.getState().addAttachments($,Z,B),B.forEach((J,Q)=>{mN($,[H[Q]]).then(([X])=>{E1.getState().updateAttachment($,Z,J.localId,{status:"ready",upload:X,mediaType:X.mediaType})}).catch((X)=>{E1.getState().updateAttachment($,Z,J.localId,{status:"error",error:X instanceof Error?X.message:"Upload failed"})})})}function PG({workspaceId:$,sessionId:Z,localId:H,purpose:B,sourceTab:J,blob:Q}){let X=B==="sketch"?"Sketch":"Annotation",z=URL.createObjectURL(Q),G=E1.getState();if(G.attachments[s2($,Z)]?.some((U)=>U.localId===H))G.updateAttachment($,Z,H,{previewUrl:z,status:"draft",upload:void 0,error:void 0});else G.addAttachments($,Z,[{kind:"drawing",purpose:B,localId:H,sourceTab:J,name:`${X}.png`,mediaType:"image/png",previewUrl:z,status:"draft"}])}async function _G({workspaceId:$,sessionId:Z,localId:H,purpose:B,sourceTab:J,blob:Q,isCurrent:X}){let z=B==="sketch"?"Sketch":"Annotation",G=URL.createObjectURL(Q),F=E1.getState();if(F.attachments[s2($,Z)]?.some((Y)=>Y.localId===H))F.updateAttachment($,Z,H,{previewUrl:G,status:"uploading",upload:void 0,error:void 0});else F.addAttachments($,Z,[{kind:"drawing",purpose:B,localId:H,sourceTab:J,name:`${z}.png`,mediaType:"image/png",previewUrl:G,status:"uploading"}]);try{let[Y]=await mN($,[new File([Q],`${z}.png`,{type:"image/png"})]);if(!X())return;E1.getState().updateAttachment($,Z,H,{status:"ready",upload:Y,mediaType:Y.mediaType,error:void 0})}catch{if(!X())return;E1.getState().removeAttachment($,Z,H)}}function uw({workspaceId:$,sessionId:Z,activeTab:H,mode:B,available:J,closePopup:Q,openPopup:X}){let z=x5.useRef(null),G=x5.useRef(null),F=x5.useRef(new Map),U=x5.useRef(Q),Y=x5.useRef(X);U.current=Q,Y.current=X;let K=x5.useCallback((j)=>{let S=z.current;if(!S)return;if(G.current=j,!j){E1.getState().removeAttachment(S.workspaceId,S.sourceSessionId,S.attachmentId);return}PG({workspaceId:S.workspaceId,sessionId:S.sourceSessionId,localId:S.attachmentId,purpose:"annotation",sourceTab:S.sourceTab,blob:j})},[]),W=x5.useCallback((j,S)=>{let k=(F.current.get(j.attachmentId)??0)+1;return F.current.set(j.attachmentId,k),_G({workspaceId:j.workspaceId,sessionId:j.sourceSessionId,localId:j.attachmentId,purpose:"annotation",sourceTab:j.sourceTab,blob:S,isCurrent:()=>F.current.get(j.attachmentId)===k})},[]),N=x5.useCallback(async(j)=>{let S=z.current;if(z.current=null,G.current=null,S&&j)await W(S,j);if(S?.origin==="popup")Y.current()},[W]),L=qG({onChange:K,onFinish:N}),{controls:V}=L,{active:A,starting:D,open:q,finish:_,cancel:M}=V,P=x5.useCallback(async(j)=>{if(!J||A||D)return;let S={workspaceId:$,sourceSessionId:Z,sourceTab:H,origin:j,attachmentId:crypto.randomUUID()};z.current=S;try{if(!await q()){if(z.current===S)z.current=null;return}if(j==="popup")U.current()}catch{if(z.current!==S)return;z.current=null,r4.add({title:"Couldn’t capture this page",type:"error"})}},[A,H,J,q,Z,D,$]),T=x5.useCallback(async()=>{let j=z.current;if(await M(),z.current!==j)return;z.current=null;let S=G.current;if(G.current=null,j&&S)W(j,S)},[M,W]),R=x5.useCallback((j)=>{let S=(F.current.get(j)??0)+1;if(F.current.set(j,S),E1.getState().removeAttachment($,Z,j),z.current?.attachmentId===j)z.current=null,G.current=null,M()},[M,Z,$]),y=x5.useCallback(async()=>{if(D){await T();return}await _()},[T,_,D]),w=x5.useCallback(()=>{if(A||D)y();else P("docked")},[A,y,P,D]),h=x5.useCallback(()=>{if(A||D)y();else P("popup")},[A,y,P,D]);x5.useEffect(()=>{let j=z.current;if(!j)return;let S=j.origin==="docked"?"split":"fullscreen";if(j.workspaceId!==$||j.sourceSessionId!==Z||j.sourceTab!==H||B!==S||!J)T()},[H,J,T,B,Z,$]);let E=x5.useMemo(()=>J?{active:A||D,finish:y,onRemove:R,onToggle:w}:void 0,[J,A,D,y,R,w]),I=x5.useMemo(()=>J?{active:A||D,finish:y,onRemove:R,onToggle:h}:void 0,[J,A,D,y,R,h]);return x5.useMemo(()=>({...L,docked:E,popup:I}),[L,E,I])}var h4=O(g(),1);var B8=O(c(),1);function pN($){if(!$)return;$.focus();let Z=$.value.length;$.setSelectionRange(Z,Z)}function dw({composerRef:$,className:Z,onMouseDown:H,children:B,...J}){return B8.jsx("form",{...J,onMouseDown:(Q)=>{if(H?.(Q),Q.defaultPrevented)return;if(Q.target instanceof Element&&Q.target.closest('button, input, textarea, select, a, [contenteditable="true"]'))return;pN($.current)},className:s("group/composer flex w-full cursor-text flex-col gap-1 rounded-xl bg-card p-2 text-card-foreground shadow-xs transition-[color,box-shadow] outline-none focus-within:shadow-sm",Z),children:B})}function lw({textareaRef:$,className:Z,...H}){return B8.jsx("textarea",{...H,ref:$,className:s("field-sizing-content max-h-40 w-full resize-none bg-transparent px-2 py-1 text-sm leading-relaxed outline-none placeholder:text-muted-foreground disabled:opacity-50",Z)})}function iw({className:$,children:Z,...H}){return B8.jsx("div",{...H,className:s("flex items-center justify-end gap-3",$),children:Z})}function kt($){if($.status==="checking")return"Checking agent status…";return}function RB($,Z,H){return $&&!Z&&H.status==="available"}function rw({label:$,hasContent:Z,busy:H=!1,loading:B=!1,availability:J}){let Q=RB(Z,H||B,J),X=kt(J),z=B8.jsx(C0,{type:"submit",size:"icon",disabled:!Q,"aria-label":$,children:B?B8.jsx(S4,{}):B8.jsx(cw,{stroke:1.5})});if(B||!X)return z;return B8.jsxs(r1,{children:[B8.jsx(a1,{render:B8.jsx("span",{className:"inline-flex",children:z})}),B8.jsx(n1,{className:"max-w-64 text-center",children:X})]})}var jG=O(g(),1),J7=O(c(),1),bt=($,Z)=>`mo-root${$==="always"?" mo-always":""}${Z?" mo-expr":""}`;function yt($){let Z=(z)=>`${-Math.round(z)}ms`,H=(z)=>String(Math.round(z*100)/100),B=Math.round($.num("motion.blink",3500,6500)),J=Math.round($.num("motion.saccade",4200,7600)),Q=$.num("motion.lookX",1,2.2),X=$.num("motion.lookY",0.8,1.7);return{"--mo-phase":Z($.num("motion.phase",0,2800)),"--mo-bob-phase":Z($.num("motion.bob",0,3400)),"--mo-blink":`${B}ms`,"--mo-blink-phase":Z($.num("motion.blinkPhase",0,B)),"--mo-look-x":H(Q*($.bool("motion.lookXFlip")?-1:1)),"--mo-look-mx":H(Q),"--mo-look-y":H(X*($.bool("motion.lookYFlip")?-1:1)),"--mo-look-my":H(X),"--mo-saccade":`${J}ms`,"--mo-saccade-phase":Z($.num("motion.saccadePhase",0,J))}}function uN({l:$,c:Z,h:H}){let B=H*Math.PI/180,J=Z*Math.cos(B),Q=Z*Math.sin(B),X=$+0.3963377774*J+0.2158037573*Q,z=$-0.1055613458*J-0.0638541728*Q,G=$-0.0894841775*J-1.291485548*Q,F=X*X*X,U=z*z*z,Y=G*G*G;return[4.0767416621*F-3.3077115913*U+0.2309699292*Y,-1.2684380046*F+2.6097574011*U-0.3413193965*Y,-0.0041960863*F-0.7034186147*U+1.707614701*Y]}var aw=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function tw($){let Z=uN($);if(!aw(Z)){let H=0,B=$.c;for(let J=0;J<12;J++){let Q=(H+B)/2;if(aw(uN({...$,c:Q})))H=Q;else B=Q}Z=uN({...$,c:H})}return Z.map((H)=>Math.min(1,Math.max(0,H)))}function nw($){let[Z,H,B]=tw($);return 0.2126*Z+0.7152*H+0.0722*B}function OG($,Z){let H=nw($),B=nw(Z);return(Math.max(H,B)+0.05)/(Math.min(H,B)+0.05)}function ew($,Z,H){if(OG($,Z)>=H)return $;let B=$.l>=Z.l?1:-1;for(let X of[B,-B]){let z={...$};for(let G=0;G<60;G++){if(z.l=Math.min(1,Math.max(0,z.l+X*0.02)),OG(z,Z)>=H)return z;if(z.l===0||z.l===1)break}}let J={...$,l:0,c:0},Q={...$,l:1,c:0};return OG(J,Z)>=OG(Q,Z)?J:Q}function ht($){return"#"+tw($).map((Z)=>{let H=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(H*255).toString(16).padStart(2,"0")}).join("")}var ow=[[0.2,{l:0.86,c:0.085}],[0.36,{l:0.9,c:0.028}],[0.62,{l:0.73,c:0.135}],[0.8,{l:0.62,c:0.165}],[0.93,{l:0.87,c:0.16}],[1,{l:0.34,c:0.035}]],xt=($)=>ow.find(([Z])=>$<Z)?.[1]??ow[0][1],vt={l:0.145,c:0,h:0},gt=1.5,ft=($,Z)=>{let H=xt(Z),B=ew({l:H.l,c:H.c,h:$},vt,gt);return{bg:{l:0.965,c:0.01,h:$},head:B,eye:B.l>=0.5?{l:0.17,c:0.02,h:$}:{l:0.97,c:0.012,h:$}}},mt=[["head","bg",1.25],["eye","head",4.5]];function pt($,Z=!0,H=0){let B=ft($,H);if(Z)for(let[J,Q,X]of mt)B[J]=ew(B[J],B[Q],X);return B}function ut($,Z=!0,H=0){let B=pt($,Z,H),J={};for(let Q in B)J[Q]=ht(B[Q]);return J}var Q5=($)=>{let Z=Math.round($*100)/100;return Object.is(Z,-0)?"0":String(Z)};function cN({cx:$,cy:Z,rx:H,ry:B,n:J=4,rot:Q=0}){let X=Math.min(1,(8*Math.pow(2,-1/J)-4)/3),z=H,G=B,F=z*X,U=G*X,Y=[[z,0],[z,U],[F,G],[0,G],[-F,G],[-z,U],[-z,0],[-z,-U],[-F,-G],[0,-G],[F,-G],[z,-U],[z,0]],K=Q*Math.PI/180,W=Math.cos(K),N=Math.sin(K),L=(A)=>{let[D,q]=Y[A];return`${Q5($+D*W-q*N)} ${Q5(Z+D*N+q*W)}`},V=`M${L(0)}`;for(let A=1;A<13;A+=3)V+=`C${L(A)} ${L(A+1)} ${L(A+2)}`;return V+"Z"}function ct($,Z,H,B,J,Q=0){let X=J.length,z=Q*Math.PI/180,G=J.map((Y,K)=>{let W=z+2*Math.PI*K/X;return[$+H*Y*Math.cos(W),Z+B*Y*Math.sin(W)]}),F=(Y)=>G[(Y%X+X)%X],U=`M${Q5(F(0)[0])} ${Q5(F(0)[1])}`;for(let Y=0;Y<X;Y++){let[K,W]=F(Y-1),[N,L]=F(Y),[V,A]=F(Y+1),[D,q]=F(Y+2);U+=`C${Q5(N+(V-K)/6)} ${Q5(L+(A-W)/6)} ${Q5(V-(D-N)/6)} ${Q5(A-(q-L)/6)} ${Q5(V)} ${Q5(A)}`}return U+"Z"}function dt({cx:$,cy:Z,rx:H,ry:B,sides:J,round:Q=0.3,rot:X=0}){let z=Q>0?Q<1?Q/2:0.5:0,G=X*Math.PI/180-Math.PI/2,F=Array.from({length:J},(W,N)=>{let L=G+2*Math.PI*N/J;return[$+H*Math.cos(L),Z+B*Math.sin(L)]}),U=(W)=>F[(W%J+J)%J],Y=(W,N)=>{let[L,V]=U(W),[A,D]=U(N);return`${Q5(L+(A-L)*z)} ${Q5(V+(D-V)*z)}`},K=`M${Y(0,-1)}`;for(let W=0;W<J;W++){let[N,L]=U(W);if(K+=`Q${Q5(N)} ${Q5(L)} ${Y(W,W+1)}`,z<0.5)K+=`L${Y(W+1,W)}`}return K+"Z"}function lt($,Z,H,B){let J=Q5($-H),Q=Q5($+H);return`M${J} ${Q5(Z-B)}H${Q}V${Q5(Z+B)}H${J}Z`}function it($,Z,H,B,J){let Q=Math.max(1.05,J),X=H*Math.sqrt(1-1/(Q*Q)),z=Z-B/Q,G=Z-Q*B,F=X*0.14,U=z+0.86*(G-z);return`M${Q5($-X)} ${Q5(z)}L${Q5($-F)} ${Q5(U)}Q${Q5($)} ${Q5(G)} ${Q5($+F)} ${Q5(U)}L${Q5($+X)} ${Q5(z)}Z`}function dN($,Z){for(let H=0;H<Z.length;H++)$=Math.imul($^Z[H],3432918353),$=$<<13|$>>>19;return $}function rt($){return $=Math.imul($^$>>>16,2246822507),$=Math.imul($^$>>>13,3266489909),($^$>>>16)>>>0}var $E=new TextEncoder;function at($){return $.normalize("NFC").trim().toLowerCase()}function nt($,Z=!0){let H=Z?at($):$;return dN(1779033703^H.length,$E.encode(H))}function sw($,Z){return rt(dN(dN($,Uint8Array.of(255)),$E.encode(Z)))/4294967296}function ot($,Z=!0,H){let B=nt($,Z),J=(Q)=>{let X=H?.[Q],z=Array.isArray(X)?X[Math.floor(sw(B,Q)*X.length)]:X;return z===void 0?sw(B,Q):z>0?z<1?z:0.999999:0};return J.num=(Q,X,z)=>X+J(Q)*(z-X),J.int=(Q,X,z)=>X+Math.floor(J(Q)*(z-X+1)),J.pick=(Q,X)=>X[Math.floor(J(Q)*X.length)],J.bool=(Q,X=0.5)=>J(Q)<X,J.jitter=(Q,X)=>(J(Q)*2-1)*X,J}function ZE($,Z,H){let B=Z.expression;if(H||!B)return{l:$,wrap:""};return B.bake($,B.p)}var st=($,Z)=>Z?.tint?Z.tint($,Z.p):$,HE=($,Z)=>Z?`<g transform="${Z}">${$}</g>`:$,tt=($)=>$.replace(/[&<>]/g,(Z)=>Z==="&"?"&":Z==="<"?"<":">");function BE($,Z){let H=ot($,Z.normalize??!0,Z.traits);return{t:H,palette:{...ut(Z.hue??H.num("hue",0,360),Z.contrast??!0,Z.tone??H("tone")),...Z.palette}}}var et=($)=>$.title?`<title>${tt($.title)}</title>`:"";function JE($,Z,H){let B=Z.background??$.background;if(B===!1)return;return{d:B==="square"?"M0 0H100V100H0Z":cN({cx:50,cy:50,rx:50,ry:50,n:B==="circle"?2:6}),fill:H.bg}}var $e=($)=>$?`<path d="${$.d}" fill="${$.fill}"/>`:"";function Ze($){return(Z,H={})=>{let{t:B,palette:J}=BE(Z,H),Q=st(J,H.expression),X=H.size?` width="${H.size}" height="${H.size}"`:"",z=ZE($.layout(B),H),G=et(H)+$e(JE($,H,Q))+HE($.render(z.l,Q),z.wrap);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"${X}>${G}</svg>`}}function He($){return(Z,H={},B)=>{let{t:J,palette:Q}=BE(Z,H),X=B?.(J,Q),z=ZE($.layout(J),H,X);return{cls:X?.cls,bg:JE($,H,Q),inner:HE($.render(z.l,Q,!!X),z.wrap),vars:X?.vars}}}var Be=($,Z,H)=>{let B=Z.rx,J=$.num("eye.rx",0.075,0.105)*B,Q=$.num("eye.ratio",1.9,3.2),X=$.num("eye.scale",0.78,1.24),z=$.num("eye.stretch",0.85,1.18),G=$.num("eye.gap",0.1,0.24)*B,F=J*Math.max(1,X),U=J*Q*Math.max(1,X*z),Y=F+B*0.03+G,K=$.jitter("gaze.x",0.09)*H.rx,W=$.num("gaze.y",-0.2,0.08)*H.ry,N=$.jitter("eye.dy",0.04)*H.ry,L=Math.hypot(F,U),V=Math.hypot((Math.abs(K)+Y+L)/H.rx,(Math.abs(W)+Math.abs(N)+L)/H.ry),A=V>0.9?0.9/V:1,D=J*A,q=D*Q,_=Y*A,M=Math.max(0,Math.min(1,G/U)),P=Math.min(12,Math.asin(M)*180/Math.PI),T=$.num("eye.lean",-1,1)*P,R=Math.max(-12,Math.min(12,T+$.jitter("eye.lean2",3.5))),y=H.cx+K*A,w=H.cy+W*A;return[{cx:y-_,cy:w,rx:D,ry:q,n:$.num("eye.n",3.5,6),rot:T},{cx:y+_,cy:w+N*A,rx:D*X,ry:q*X*z,n:$.num("eye.n",3.5,6),rot:R}]};function Je($,Z){let H=(Q)=>($.find(([,X])=>Q<X)??$[$.length-1])[0];function B(Q){let X=H(Q("shape")),z=Q.num("body.r",31,38)*X.core,G={cx:50+Q.jitter("body.x",1.5),cy:50+Q.jitter("body.y",1.5),rx:z,ry:z*Q.num("body.ratio",0.92,1.08),n:Q.num("body.n",1.9,2.5),rot:0,radii:Array.from({length:Q.int("body.pts",6,8)},(Y,K)=>1+Q.jitter(`body.r${K}`,0.16))};X.body?.(Q,G);let F=X.face?.(G)??G,U={petals:[],extra:[]};return X.decorate?.(Q,G,U),{shape:X.name,draw:X.path,body:G,face:F,petals:U.petals,extra:U.extra,eyes:Z(Q,G,F)}}function J(Q,X,z){let G=(Y)=>Math.round(Y*100)/100,F=(Y,K)=>{let W=`<path d="${cN(Y)}"/>`;return z?`<g class="mo-eye" style="--mo-wrap:${K?1:-1};--mo-lean:${G(Y.rot)};transform-origin:${G(Y.cx)}px ${G(Y.cy)}px">${W}</g>`:W},U=`<g fill="${X.head}">`+Q.petals.map((Y)=>`<circle cx="${G(Y.cx)}" cy="${G(Y.cy)}" r="${G(Y.r)}"/>`).join("")+Q.extra.map((Y)=>`<path d="${Y}"/>`).join("")+`<path d="${Q.draw?Q.draw(Q.body):cN(Q.body)}"/></g><g fill="${X.eye}"${z?' class="mo-eyes"':""}>`+Q.eyes.map(F).join("")+"</g>";return z?`<g class="mo-breathe"><g class="mo-bob">${U}</g></g>`:U}return{layout:B,render:J,background:!1}}var QE=($)=>dt($),XE=($)=>ct($.cx,$.cy,$.rx,$.ry,$.radii,$.rot),lN=($)=>(Z)=>({cx:Z.cx,cy:Z.cy,rx:Z.rx*$,ry:Z.ry*$}),zE=($)=>lN(Math.min(...$.radii)*0.95)($),Qe=($)=>lN(0.84)($),Xe={name:"round",core:1},ze={name:"organic",core:0.98,path:XE,face:zE},Ge={name:"boxy",core:0.86,body:($,Z)=>{Z.n=$.num("body.n",3.4,6),Z.rot=$.num("body.rot",-20,20)}},Fe={name:"capsule",core:1.02,body:($,Z)=>{Z.ry*=$.num("capsule.squat",0.55,0.68)},face:lN(0.94),decorate:($,Z,H)=>{for(let B of[-1,1])H.petals.push({cx:Z.cx+B*(Z.rx-Z.ry),cy:Z.cy,r:Z.ry})},path:($)=>lt($.cx,$.cy,$.rx-$.ry,$.ry)},Ue={name:"nub",core:0.88,decorate:($,Z,H)=>{let B=$.int("nub.n",1,2);for(let J=0;J<B;J++){let Q=$.num(`nub.a${J}`,0,2*Math.PI);H.petals.push({cx:Z.cx+Math.cos(Q)*Z.rx*0.88,cy:Z.cy+Math.sin(Q)*Z.rx*0.88,r:Z.rx*$.num(`nub.r${J}`,0.24,0.4)})}}},Ye={name:"cloud",core:0.78,face:zE,path:XE,decorate:($,Z,H)=>{let B=$.int("cloud.n",4,6);for(let J=0;J<B;J++){let Q=Math.PI+Math.PI*(J+0.5)/B;H.petals.push({cx:Z.cx+Math.cos(Q)*Z.rx*0.8,cy:Z.cy+Math.sin(Q)*Z.rx*0.5,r:Z.rx*$.num(`cloud.r${J}`,0.44,0.62)})}}},Ke={name:"droplet",core:0.78,body:($,Z)=>{Z.cy+=0.22*Z.ry,Z.n=2},face:($)=>({cx:$.cx,cy:$.cy+$.ry*0.05,rx:$.rx*0.88,ry:$.ry*0.88}),decorate:($,Z,H)=>{H.extra.push(it(Z.cx,Z.cy,Z.rx,Z.ry,$.num("droplet.tip",1.4,1.65)))}},We={name:"hexagon",core:1.05,path:QE,face:Qe,body:($,Z)=>{Z.sides=6,Z.rot=$.num("body.rot",-12,12),Z.round=$.num("poly.round",0.24,0.5)}},Ne={name:"sun",core:0.7,decorate:($,Z,H)=>{let B=$.int("sun.n",6,9),J=Z.rx*$.num("sun.dist",1,1.08),Q=Z.rx*$.num("sun.r",0.2,0.26),X=$.num("sun.rot",0,2*Math.PI);for(let z=0;z<B;z++){let G=X+2*Math.PI*z/B;H.petals.push({cx:Z.cx+Math.cos(G)*J,cy:Z.cy+Math.sin(G)*J,r:Q})}}},Le={name:"triangle",core:1.15,path:QE,body:($,Z)=>{Z.sides=3,Z.rot=$.num("body.rot",-5,5),Z.round=$.num("poly.round",0.24,0.5)},face:($)=>({cx:$.cx,cy:$.cy+$.ry*0.1,rx:$.rx*0.54,ry:$.ry*0.36})},Ae=[[Xe,0.22],[ze,0.48],[Ge,0.6],[Fe,0.7],[Ue,0.79],[Ye,0.86],[Ke,0.915],[We,0.95],[Ne,0.98],[Le,1]],GE=Je(Ae,Be),Ve=Ze(GE),De=($,Z)=>(H,B)=>{let J=Z?Z.vars(Z.p):{},Q=Z?.tint?Z.tint(B,Z.p):B;return{cls:bt($,!!Object.keys(J).length||!!Z?.tint),vars:{...yt(H),"--mo-head":Q.head,"--mo-eye":Q.eye,...J}}};function qe($,Z={}){return He(GE)($,Z,Z.animate&&De(Z.animate,Z.expression))}function Me($,Z){return"data:image/svg+xml,"+Ve($,Z).replace(/"/g,"'").replace(/[%#<>{}|\\^[\]`]/g,(H)=>"%"+H.charCodeAt(0).toString(16).toUpperCase()).replace(/\s+/g," ")}function FE({name:$,size:Z,background:H,palette:B,hue:J,tone:Q,normalize:X,contrast:z,title:G,animate:F,expression:U,traits:Y,...K}){let W={size:Z,background:H,palette:B,hue:J,tone:Q,normalize:X,contrast:z,title:G,expression:U,traits:Y},N=JSON.stringify([$,W,F]),L=jG.useMemo(()=>F?"":Me($,W),[N]),V=jG.useMemo(()=>F?qe($,{...W,animate:F}):null,[N]),A=jG.useMemo(()=>({__html:V?.inner??""}),[V?.inner]);if(V){let{style:_,...M}=K;return J7.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:Z,height:Z,role:G?"img":void 0,"aria-hidden":G?void 0:!0,style:{...V.vars,..._},...M,children:[G?J7.jsx("title",{children:G}):null,V.bg?J7.jsx("path",{d:V.bg.d,fill:V.bg.fill}):null,J7.jsx("g",{className:V.cls,dangerouslySetInnerHTML:A})]})}let{alt:D,...q}=K;return J7.jsx("img",{src:L,width:Z,height:Z,alt:D??G??"",...q})}var UE=FE;function iN({l:$,c:Z,h:H}){let B=H*Math.PI/180,J=Z*Math.cos(B),Q=Z*Math.sin(B),X=$+0.3963377774*J+0.2158037573*Q,z=$-0.1055613458*J-0.0638541728*Q,G=$-0.0894841775*J-1.291485548*Q,F=X*X*X,U=z*z*z,Y=G*G*G;return[4.0767416621*F-3.3077115913*U+0.2309699292*Y,-1.2684380046*F+2.6097574011*U-0.3413193965*Y,-0.0041960863*F-0.7034186147*U+1.707614701*Y]}var YE=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function LE($){let Z=iN($);if(!YE(Z)){let H=0,B=$.c;for(let J=0;J<12;J++){let Q=(H+B)/2;if(YE(iN({...$,c:Q})))H=Q;else B=Q}Z=iN({...$,c:H})}return Z.map((H)=>Math.min(1,Math.max(0,H)))}function KE($){let[Z,H,B]=LE($);return 0.2126*Z+0.7152*H+0.0722*B}function kB($,Z){let H=KE($),B=KE(Z);return(Math.max(H,B)+0.05)/(Math.min(H,B)+0.05)}function WE($,Z,H){if(kB($,Z)>=H)return $;let B=$.l>=Z.l?1:-1;for(let X of[B,-B]){let z={...$};for(let G=0;G<60;G++){if(z.l=Math.min(1,Math.max(0,z.l+X*0.02)),kB(z,Z)>=H)return z;if(z.l===0||z.l===1)break}}let J={...$,l:0,c:0},Q={...$,l:1,c:0};return kB(J,Z)>=kB(Q,Z)?J:Q}function TG($){return"#"+LE($).map((Z)=>{let H=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(H*255).toString(16).padStart(2,"0")}).join("")}function u$($){let Z=parseInt($.slice(1),16),[H,B,J]=[Z>>16&255,Z>>8&255,Z&255].map((U)=>{let Y=U/255;return Y<=0.04045?Y/12.92:Math.pow((Y+0.055)/1.055,2.4)}),Q=Math.cbrt(0.4122214708*H+0.5363325363*B+0.0514459929*J),X=Math.cbrt(0.2119034982*H+0.6806995451*B+0.1073969566*J),z=Math.cbrt(0.0883024619*H+0.2817188376*B+0.6299787005*J),G=1.9779984951*Q-2.428592205*X+0.4505937099*z,F=0.0259040371*Q+0.7827717662*X-0.808675766*z;return{l:0.2104542553*Q+0.793617785*X-0.0040720468*z,c:Math.hypot(G,F),h:Math.atan2(F,G)*180/Math.PI}}function Pe($,Z,H){let B=(U)=>U*Math.PI/180,J=$.c*Math.cos(B($.h)),Q=$.c*Math.sin(B($.h)),X=Z.c*Math.cos(B(Z.h)),z=Z.c*Math.sin(B(Z.h)),G=J+(X-J)*H,F=Q+(z-Q)*H;return{l:$.l+(Z.l-$.l)*H,c:Math.hypot(G,F),h:Math.atan2(F,G)*180/Math.PI}}var CG=($,Z,H)=>TG(Pe(u$($),u$(Z),H));var _e={h:12,l:0.84,pull:0.4,c:0.1};var NE=4.55;function Oe($,Z,H){let B=u$($),J=u$(Z),Q={l:B.l+(H.l-B.l)*H.pull,c:Math.max(B.c,H.c),h:H.h};Q=WE(Q,je,Te);let X=WE(J,Q,NE),z=X.l>=Q.l?1:-1,G=TG(Q);for(let F=0;F<40;F++){let U=TG(X),Y=1/0;for(let W=0;W<=10;W++){let N=W/10;Y=Math.min(Y,kB(u$(CG(Z,U,N)),u$(CG($,G,N))))}if(Y>=NE)return[G,U];let K=Math.min(1,Math.max(0,X.l+z*0.02));if(K===X.l)return[G,U];X={...X,l:K}}return[G,TG(X)]}var je={l:0.145,c:0,h:0},Te=1.5;var rN={esx:1,esy:1,tilt:0,edy:0,edx:0,esx2:0,esy2:0,tilt2:0,edy2:0,lock:0,heat:0,shake:0,rock:0,bdy:0},AE=($)=>String(Math.round($*1000)/1000);function F9($){let Z={};for(let H in rN){if(H==="heat")continue;let B=$[H];if(B!==rN[H])Z["--mo-"+H]=AE(B)}return Z}function Ce($,Z,H){let[B,J]=Oe($.head,$.eye,H);return{...$,head:CG($.head,B,Z.heat),eye:CG($.eye,J,Z.heat)}}function U9($,Z){return{l:{...$,eyes:$.eyes.map((H,B)=>({...H,cx:H.cx+Z.edx*(B?1:-1),cy:H.cy+Z.edy+(B?Z.edy2:0),rx:H.rx*(Z.esx+(B?Z.esx2:0)),ry:H.ry*(Z.esy+(B?Z.esy2:0)),rot:H.rot*(1-Z.lock)+(Z.tilt+(B?Z.tilt2:0))*(B?1:-1)}))},wrap:Z.bdy!==0?`translate(0 ${AE(Z.bdy)})`:""}}var VE={p:rN,vars:F9,bake:U9},DE={p:{esx:1.72,esy:0.3,tilt:8,edy:-1.5,edx:1.5,esx2:0.08,esy2:0.05,tilt2:-16,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-2.2},vars:F9,bake:U9},qE={p:{esx:0.6,esy:0.56,tilt:26,edy:3.6,edx:1.9,esx2:-0.05,esy2:-0.07,tilt2:-7,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:2.6},vars:F9,bake:U9};var ME={p:{esx:1.34,esy:1.2,tilt:-6,edy:-1.05,edx:0.5,esx2:0.05,esy2:0.07,tilt2:3,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.4},vars:F9,bake:U9},PE={p:{esx:1.32,esy:0.76,tilt:5,edy:-0.6,edx:0.8,esx2:0.26,esy2:-0.56,tilt2:-11,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.1},vars:F9,bake:U9},_E={p:{esx:1.14,esy:0.22,tilt:0,edy:2.4,edx:0.3,esx2:-0.04,esy2:0.03,tilt2:4,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:1.2},vars:F9,bake:U9},OE={p:{esx:1.3,esy:0.42,tilt:18,edy:-0.5,edx:0.5,esx2:0.06,esy2:-0.06,tilt2:-36,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1},vars:F9,bake:U9},jE={p:{esx:0.95,esy:1.02,tilt:4,edy:-0.2,edx:0.3,esx2:0.24,esy2:-0.44,tilt2:-18,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:0},vars:F9,bake:U9};var TE={p:{esx:0.62,esy:0.5,tilt:10,edy:1.4,edx:-0.2,esx2:-0.05,esy2:-0.04,tilt2:-8,edy2:0,lock:1,heat:0.55,shake:0,rock:0,bdy:0.9},vars:F9,bake:U9,tint:($,Z)=>Ce($,Z,_e)};var CE={p:{esx:1.15,esy:0.62,tilt:0,edy:4.2,edx:0.4,esx2:0.02,esy2:0.06,tilt2:0,edy2:-8.4,lock:1,heat:0,shake:0,rock:0.8,bdy:-0.4},vars:F9,bake:U9};var wE=O(c(),1),we="moi-agent",Ee={default:{head:"var(--foreground)",eye:"var(--background)"},primary:{head:"var(--primary)",eye:"var(--primary-foreground)"},secondary:{head:"var(--accent)",eye:"var(--accent-foreground)"}},Se={idle:VE,happy:DE,sad:qE,surprised:ME,wink:PE,sleepy:_E,smug:OE,unsure:jE,shy:TE,thinking:CE};function k3({size:$,preset:Z=y9.agent,animated:H=!1,color:B="default",expression:J="idle",className:Q}){return wE.jsx(UE,{name:we,size:$,animate:H?"always":"hover",palette:Ee[B],expression:J?Se[J]:void 0,className:s("shrink-0",Q),traits:{shape:BG[Z].shape}})}var y4=O(g(),1),Ie=48;function EE($,Z){let H=y4.useRef(!0),[B,J]=y4.useState(!0),Q=y4.useCallback((G)=>{H.current=G,J((F)=>F===G?F:G)},[]),X=y4.useCallback((G="auto")=>{let F=$.current;if(!F)return;Q(!0),F.scrollTo({top:F.scrollHeight,behavior:G})},[$,Q]),z=y4.useCallback(()=>{let G=$.current;if(!G)return;Q(!1),G.scrollTo({top:0,behavior:"auto"})},[$,Q]);return y4.useEffect(()=>{let G=$.current;if(!G)return;let F=()=>{let U=G.scrollHeight-G.scrollTop-G.clientHeight;Q(U<=Ie)};return G.addEventListener("scroll",F,{passive:!0}),()=>G.removeEventListener("scroll",F)},[$,Q]),y4.useEffect(()=>{let G=$.current;if(!G)return;let F=G.firstElementChild??G,U=new ResizeObserver(()=>{if(H.current)G.scrollTop=G.scrollHeight});return U.observe(F),()=>U.disconnect()},[$]),y4.useLayoutEffect(()=>{X("auto")},[Z,X]),{atBottom:B,scrollToBottom:X,scrollToTop:z}}function Re($){return $.origin.kind!=="replay"&&$.origin.kind!=="synthetic"&&$.origin.kind!=="subagent-prompt"}function ke($,Z){let H=$.meta||Z.meta?{...$.meta,...Z.meta}:void 0;return{...$,parts:[...$.parts,...Z.parts],timestamp:Z.timestamp??$.timestamp,meta:H}}function SE($){let Z=[];for(let H of $){if(!Re(H))continue;if(H.role!=="assistant"){Z.push(H);continue}let B=Z.length>0?Z[Z.length-1]:null;if(B?.role==="assistant")Z[Z.length-1]=ke(B,H);else Z.push(H)}return Z.map((H,B)=>{let J=Z[B-1];if(H.role!=="assistant"||J?.role!=="user"||J.origin.kind!=="user-input"||!J.timestamp||!H.timestamp)return H;let Q=Date.parse(J.timestamp),X=Date.parse(H.timestamp);if(!Number.isFinite(Q)||!Number.isFinite(X)||X<Q)return H;return{...H,meta:{...H.meta,durationMs:X-Q}}})}function aN($){switch($.kind){case"compact":return"Context compacted";case"model-change":return $.prev?`Model changed to ${$.model} (was ${$.prev})`:`Model changed to ${$.model}`;case"rate-limit":case"api-retry":case"hook":case"session-state":case"files-persisted":case"elicitation":default:return null}}function IE($){if(!$)return;let Z=Date.parse($);return Number.isNaN(Z)?void 0:Z}function RE($,Z){let H=Z.filter((G)=>aN(G)!==null);if(H.length===0)return $.map((G)=>({kind:"turn",turn:G}));let B=[],J=[];for(let G of H){let F=IE(G.at);if(F===void 0)J.push(G);else B.push({notice:G,time:F})}B.sort((G,F)=>G.time-F.time);let Q=[],X=0,z=Number.NEGATIVE_INFINITY;for(let G of $){z=Math.max(z,IE(G.timestamp)??z);while(X<B.length&&B[X].time<=z)Q.push({kind:"notice",notice:B[X].notice}),X+=1;Q.push({kind:"turn",turn:G})}for(;X<B.length;X+=1)Q.push({kind:"notice",notice:B[X].notice});for(let G of J)Q.push({kind:"notice",notice:G});return Q}var FZ=O(g(),1);var y3={};O4(y3,{createHandle:()=>tE,Viewport:()=>sE,Trigger:()=>mE,Root:()=>xE,Positioner:()=>uE,Portal:()=>fE,Popup:()=>dE,Handle:()=>kG,Backdrop:()=>aE,Arrow:()=>iE});var b3=O(g(),1);var wG=O(g(),1),nN=wG.createContext(void 0);function L4($){let Z=wG.useContext(nN);if(Z===void 0&&!$)throw Error(E0(50));return Z}var bE=O(g(),1),yE=O(F4(),1);var kE=600,EG=300;var be={...r8,instantType:S0(($)=>$.instantType),hasViewport:S0(($)=>$.hasViewport)};class c$ extends r2{constructor($){super({...ye(),...$},{popupRef:bE.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new n2,closeDelayRef:{current:EG}},be)}setOpen=($,Z)=>{let H=Z.reason,B=H===G0.triggerHover,J=$&&H===G0.triggerFocus,Q=!$&&(H===G0.triggerPress||H===G0.escapeKey);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let X=()=>{let z={open:$};if(J)z.instantType="focus";else if(Q)z.instantType="dismiss";else if(H===G0.triggerHover)z.instantType=void 0;let G=Z.trigger?.id??null;if(G||$)z.activeTriggerId=G,z.activeTriggerElement=Z.trigger??null;this.update(z)};if(B)yE.flushSync(X);else X()};static useStore($,Z){let H=k1(()=>{return new c$(Z)}).current,B=$??H,J=L8({popupStore:B,onOpenChange:B.setOpen});return B.state.floatingRootContext=J,B}}function ye(){return{...i8(),instantType:void 0,hasViewport:!1}}var hE=O(c(),1);function xE($){let{open:Z,defaultOpen:H=!1,onOpenChange:B,onOpenChangeComplete:J,actionsRef:Q,handle:X,triggerId:z,defaultTriggerId:G=null,children:F}=$,U=c$.useStore(X?.store,{open:H,openProp:Z,activeTriggerId:G,triggerIdProp:z});t8(()=>{if(Z===void 0&&U.state.open===!1&&H===!0)U.update({open:!0,activeTriggerId:G})}),U.useControlledProp("openProp",Z),U.useControlledProp("triggerIdProp",z),U.useContextCallback("onOpenChange",B),U.useContextCallback("onOpenChangeComplete",J);let Y=U.useState("open"),K=U.useState("activeTriggerId"),W=U.useState("payload");d8(U);let{forceUnmount:N}=l8(Y,U);U0(()=>{if(Y){if(K==null)U.set("payload",void 0)}},[U,K,Y]);let L=b3.useCallback(()=>{U.setOpen(!1,he(U,G0.imperativeAction))},[U]);b3.useImperativeHandle(Q,()=>({unmount:N,close:L}),[N,L]);let V=U.useState("floatingRootContext"),A=N8(V),{getReferenceProps:D,getTriggerProps:q,getFloatingProps:_}=Z2([A]),M=b3.useMemo(()=>D(),[D]),P=b3.useMemo(()=>q(),[q]),T=b3.useMemo(()=>_(),[_]);return U.useSyncedValues({activeTriggerProps:M,inactiveTriggerProps:P,popupProps:T}),hE.jsx(nN.Provider,{value:U,children:typeof F==="function"?F({payload:W}):F})}function he($,Z){let H=M0(Z);return H.preventUnmountOnClose=()=>{$.set("preventUnmountingOnClose",!0)},H}var gE=O(g(),1);var SG=O(g(),1),oN=SG.createContext(void 0);function vE(){let $=SG.useContext(oN);if($===void 0)throw Error(E0(48));return $}var sN=O(c(),1),fE=gE.forwardRef(function(Z,H){let{keepMounted:B=!1,...J}=Z;if(!(L4().useState("mounted")||B))return null;return sN.jsx(oN.Provider,{value:B,children:sN.jsx($$,{ref:H,...J})})});var IG=O(g(),1);var mE=IG.forwardRef(function(Z,H){let{render:B,className:J,delay:Q,closeDelay:X,id:z,payload:G,handle:F,...U}=Z,Y=L4(!0),K=F?.store??Y;if(!K)throw Error(E0(89));let W=Z1(z),N=K.useState("isTriggerActive",W),L=K.useState("isOpenedByTrigger",W),V=K.useState("floatingRootContext"),A=IG.useRef(null),D=Q??kE,q=X??EG,{registerTrigger:_,isMountedByThisTrigger:M}=c8(W,A,K,{payload:G});U0(()=>{if(M)K.context.closeDelayRef.current=q},[K,M,q]);let P=A8(V,{mouseOnly:!0,move:!1,handleClose:V8(),delay:()=>({open:D,close:q}),triggerElementRef:A,isActiveTrigger:N}),T=S6(V,{delay:D}),R={open:L},y=K.useState("triggerProps",M);return F0("a",Z,{state:R,ref:[H,_,A],props:[P,T.reference,y,{id:W},U],stateAttributesMapping:o8})});var bB=O(g(),1);var RG=O(g(),1),tN=RG.createContext(void 0);function d$(){let $=RG.useContext(tN);if($===void 0)throw Error(E0(49));return $}var pE=O(c(),1),uE=bB.forwardRef(function(Z,H){let{render:B,className:J,anchor:Q,positionMethod:X="absolute",side:z="bottom",align:G="center",sideOffset:F=0,alignOffset:U=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:K=5,arrowPadding:W=5,sticky:N=!1,disableAnchorTracking:L=!1,collisionAvoidance:V=s8,...A}=Z,D=L4(),q=vE(),_=D.useState("open"),M=D.useState("mounted"),P=D.useState("floatingRootContext"),T=D.useState("instantType"),R=D.useState("transitionStatus"),y=D.useState("hasViewport"),w=n8({anchor:Q,floatingRootContext:P,positionMethod:X,mounted:M,side:z,sideOffset:F,align:G,alignOffset:U,arrowPadding:W,collisionBoundary:Y,collisionPadding:K,sticky:N,disableAnchorTracking:L,keepMounted:q,collisionAvoidance:V,adaptiveOrigin:y?Z$:void 0}),h=bB.useMemo(()=>{let S={};if(!_)S.pointerEvents="none";return{role:"presentation",hidden:!M,style:{...w.positionerStyles,...S}}},[_,M,w.positionerStyles]),E={open:_,side:w.side,align:w.align,anchorHidden:w.anchorHidden,instant:T},I=bB.useMemo(()=>({side:w.side,align:w.align,arrowRef:w.arrowRef,arrowUncentered:w.arrowUncentered,arrowStyles:w.arrowStyles}),[w.side,w.align,w.arrowRef,w.arrowUncentered,w.arrowStyles]),j=F0("div",Z,{state:E,props:[h,K2(R),A],ref:[H,D.useStateSetter("positionerElement")],stateAttributesMapping:P1});return pE.jsx(tN.Provider,{value:I,children:j})});var cE=O(g(),1);var xe={...P1,...i1},dE=cE.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,X=L4(),{side:z,align:G}=d$(),F=X.useState("open"),U=X.useState("instantType"),Y=X.useState("transitionStatus"),K=X.useState("popupProps"),W=X.useState("floatingRootContext");y5({open:F,ref:X.context.popupRef,onComplete(){if(F)X.context.onOpenChangeComplete?.(!0)}});let N=Y0(()=>X.context.closeDelayRef.current);return R9(W,{closeDelay:N}),F0("div",Z,{state:{open:F,side:z,align:G,instant:U,transitionStatus:Y},ref:[H,X.context.popupRef,X.useStateSetter("popupElement")],props:[K,K2(Y),Q],stateAttributesMapping:xe})});var lE=O(g(),1);var iE=lE.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,X=L4(),{arrowRef:z,side:G,align:F,arrowUncentered:U,arrowStyles:Y}=d$(),W={open:X.useState("open"),side:G,align:F,uncentered:U};return F0("div",Z,{state:W,ref:[z,H],props:[{style:Y,"aria-hidden":!0},Q],stateAttributesMapping:P1})});var rE=O(g(),1);var ve={...P1,...i1},aE=rE.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,X=L4(),z=X.useState("open"),G=X.useState("mounted"),F=X.useState("transitionStatus");return F0("div",Z,{state:{open:z,transitionStatus:F},ref:[H],props:[{role:"presentation",hidden:!G,style:{pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none"}},Q],stateAttributesMapping:ve})});var oE=O(g(),1);var nE=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var ge={activationDirection:($)=>$?{"data-activation-direction":$}:null},sE=oE.forwardRef(function(Z,H){let{render:B,className:J,children:Q,...X}=Z,z=L4(),G=d$(),F=z.useState("instantType"),{children:U,state:Y}=X$({store:z,side:G.side,cssVars:nE,children:Q}),K={activationDirection:Y.activationDirection,transitioning:Y.transitioning,instant:F};return F0("div",Z,{state:K,ref:H,props:[X,{children:U}],stateAttributesMapping:ge})});class kG{constructor(){this.store=new c$}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(E0(88,$));this.store.setOpen(!0,M0(G0.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,M0(G0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function tE(){return new kG}var l$=O(c(),1);function eE({...$}){return l$.jsx(y3.Root,{"data-slot":"hover-card",...$})}function $S({...$}){return l$.jsx(y3.Trigger,{"data-slot":"hover-card-trigger",...$})}function ZS({className:$,side:Z="bottom",sideOffset:H=4,align:B="center",alignOffset:J=0,...Q}){return l$.jsx(y3.Portal,{"data-slot":"hover-card-portal",children:l$.jsx(y3.Positioner,{align:B,alignOffset:J,side:Z,sideOffset:H,className:"isolate z-50",children:l$.jsx(y3.Popup,{"data-slot":"hover-card-content",className:s("z-50 w-64 origin-(--transform-origin) rounded-xl bg-popover p-2.5 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...Q})})})}var GZ=O(g(),1);function bG($){return o1({queryKey:w0.sessions($),queryFn:()=>V1(`/api/workspaces/${$}/sessions`),...b4})}function fe($,Z){return $?.filter((H)=>H.sessionId!==Z)}function HS($){let Z=$1();return s1({mutationFn:(H)=>E4(`/api/workspaces/${$}/sessions/${H}/archive`,{method:"POST"},"Couldn’t archive chat"),onSuccess:(H,B)=>{Z.setQueryData(w0.sessions($),(J)=>fe(J,B)),Z.removeQueries({queryKey:w0.events($,B)}),Z.removeQueries({queryKey:w0.sessionConfig($,B)}),Z.invalidateQueries({queryKey:w0.preview($)})}})}function BS($,Z){return o1({queryKey:w0.events($,Z??""),queryFn:async()=>{let H=await fetch(`/api/workspaces/${$}/sessions/${Z}/events`),B=H.ok?await H.json():[];return l_(B)},enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function yG($,Z){return o1({queryKey:w0.sessionConfig($,Z??""),queryFn:()=>V1(`/api/workspaces/${$}/sessions/${Z}/config`),enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function JS($){let Z=$1();return s1({mutationFn:({patch:H,sessionId:B})=>V1(`/api/workspaces/${$}/sessions/${B}/config`,n5("PUT",H),"Failed to save chat settings"),onSuccess:(H,{sessionId:B})=>{Z.setQueryData(w0.sessionConfig($,B),H)}})}var me=["fable","opus","sonnet","haiku"];function QS($){let Z=$.resolvedModel??$.value,H=me.findIndex((B)=>Z===B||Z.startsWith(`${B}[`)||Z.includes(`-${B}-`));return H===-1?void 0:H}function pe($,Z){if($===void 0&&Z===void 0)return 0;if($===void 0)return-1;if(Z===void 0)return 1;return $-Z}function ue($,Z){return pe(QS($),QS(Z))}var ce={"claude-code":ue};function de($,Z){return $.map((H,B)=>({model:H,index:B})).sort((H,B)=>Z(H.model,B.model)||H.index-B.index).map(({model:H})=>H)}function eN($,Z,H){if(Z&&$.includes(Z))return Z;if(H&&$.includes(H))return H;if($.includes("high"))return"high";return $[$.length-1]}function XS($,Z,H){let B=eN($,Z,H);return B?$.indexOf(B):-1}function zS($){return $.length>1}function GS($,Z){if($.supportsFastMode!==!0)return!1;return Z??$.defaultFastMode??!1}function FS($,Z){let H=ce[Z];return H?de($,H):$}function US($,Z){let H=[];for(let B of $){let J=B.group??Z,Q=H.find((X)=>X.label===J);if(Q)Q.models.push(B);else H.push({label:J,models:[B]})}return H}var $4={};O4($4,{createHandle:()=>ZI,Trigger:()=>sS,SubmenuTrigger:()=>$I,SubmenuRoot:()=>iS,Separator:()=>eS,Root:()=>BF,RadioItemIndicator:()=>cS,RadioItem:()=>uS,RadioGroup:()=>fS,Positioner:()=>xS,Portal:()=>bS,Popup:()=>IS,LinkItem:()=>ES,Item:()=>wS,Handle:()=>FF,GroupLabel:()=>TS,Group:()=>OS,CheckboxItemIndicator:()=>MS,CheckboxItem:()=>qS,Backdrop:()=>NS,Arrow:()=>KS});var YS=O(g(),1);var hG=O(g(),1),$L=hG.createContext(void 0);function A4($){let Z=hG.useContext($L);if(Z===void 0&&!$)throw Error(E0(33));return Z}var xG=O(g(),1),ZL=xG.createContext(void 0);function F5($){let Z=xG.useContext(ZL);if(Z===void 0&&!$)throw Error(E0(36));return Z}var KS=YS.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,{store:X}=F5(),{arrowRef:z,side:G,align:F,arrowUncentered:U,arrowStyles:Y}=A4(),W={open:X.useState("open"),side:G,align:F,uncentered:U};return F0("div",Z,{ref:[z,H],stateAttributesMapping:P1,state:W,props:{style:Y,"aria-hidden":!0,...Q}})});var WS=O(g(),1);var vG=O(g(),1),le=vG.createContext(void 0);function Y9($=!0){let Z=vG.useContext(le);if(Z===void 0&&!$)throw Error(E0(25));return Z}var ie={...P1,...i1},NS=WS.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,{store:X}=F5(),z=X.useState("open"),G=X.useState("mounted"),F=X.useState("transitionStatus"),U=X.useState("lastOpenChangeReason"),Y=Y9(),K={open:z,transitionStatus:F};return F0("div",Z,{ref:Y?.backdropRef?[H,Y.backdropRef]:H,state:K,stateAttributesMapping:ie,props:[{role:"presentation",hidden:!G,style:{pointerEvents:U===G0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},Q]})});var pG=O(g(),1);var gG=O(g(),1),HL=gG.createContext(void 0);function LS(){let $=gG.useContext(HL);if($===void 0)throw Error(E0(30));return $}var i$=O(g(),1);var AS=O(g(),1);function fG($){let{closeOnClick:Z,highlighted:H,id:B,nodeId:J,store:Q,itemRef:X,itemMetadata:z}=$,{events:G}=Q.useState("floatingTreeRoot"),F=Y9(!0),U=F!==void 0;return AS.useMemo(()=>({id:B,role:"menuitem",tabIndex:H?0:-1,onMouseMove(Y){if(!J)return;G.emit("itemhover",{nodeId:J,target:Y.currentTarget})},onClick(Y){if(Z)G.emit("close",{domEvent:Y,reason:G0.itemPress})},onMouseUp(Y){if(F){let K=F.initialCursorPointRef.current;if(F.initialCursorPointRef.current=null,U&&K&&Math.abs(Y.clientX-K.x)<=1&&Math.abs(Y.clientY-K.y)<=1)return}if(X.current&&Q.context.allowMouseUpTriggerRef.current&&(!U||Y.button===2)){if(!z||z.type==="regular-item")X.current.click()}}}),[Z,H,B,G,J,Q,X,F,U,z])}var r$={type:"regular-item"};function h3($){let{closeOnClick:Z,disabled:H=!1,highlighted:B,id:J,store:Q,nativeButton:X,itemMetadata:z,nodeId:G}=$,F=i$.useRef(null),{getButtonProps:U,buttonRef:Y}=u5({disabled:H,focusableWhenDisabled:!0,native:X}),K=fG({closeOnClick:Z,highlighted:B,id:J,nodeId:G,store:Q,itemRef:F,itemMetadata:z}),W=i$.useCallback((L)=>{return Y4(K,{onMouseEnter(){if(z.type!=="submenu-trigger")return;z.setActive()},onKeyUp(V){if(V.key===" "&&Q.context.typingRef.current)V.preventBaseUIHandler()}},L,U)},[K,U,Q,z]),N=T4(F,Y);return i$.useMemo(()=>({getItemProps:W,itemRef:N}),[W,N])}var x9=O(g(),1);var mG=O(g(),1),BL=mG.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>{return()=>{}},elementsRef:{current:[]},nextIndexRef:{current:0}});function VS(){return mG.useContext(BL)}var re=function($){return $[$.None=0]="None",$[$.GuessFromOrder=1]="GuessFromOrder",$}({});function V4($={}){let{label:Z,metadata:H,textRef:B,indexGuessBehavior:J,index:Q}=$,{register:X,unregister:z,subscribeMapChange:G,elementsRef:F,labelsRef:U,nextIndexRef:Y}=VS(),K=x9.useRef(-1),[W,N]=x9.useState(Q??(J===re.GuessFromOrder?()=>{if(K.current===-1){let A=Y.current;Y.current+=1,K.current=A}return K.current}:-1)),L=x9.useRef(null),V=x9.useCallback((A)=>{if(L.current=A,W!==-1&&A!==null){if(F.current[W]=A,U){let D=Z!==void 0;U.current[W]=D?Z:B?.current?.textContent??A.textContent}}},[W,F,U,Z,B]);return U0(()=>{if(Q!=null)return;let A=L.current;if(A)return X(A,H),()=>{z(A)};return},[Q,X,z,H]),U0(()=>{if(Q!=null)return;return G((A)=>{let D=L.current?A.get(L.current)?.index:null;if(D!=null)N(D)})},[Q,G,N]),x9.useMemo(()=>({ref:V,index:W}),[W,V])}var JL=function($){return $.checked="data-checked",$.unchecked="data-unchecked",$.disabled="data-disabled",$.highlighted="data-highlighted",$}({});var x3={checked($){if($)return{[JL.checked]:""};return{[JL.unchecked]:""}},...i1};var DS=O(c(),1),qS=pG.forwardRef(function(Z,H){let{render:B,className:J,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:F=!1,checked:U,defaultChecked:Y,onCheckedChange:K,...W}=Z,N=V4({label:X}),L=A4(!0),V=Z1(Q),{store:A}=F5(),D=A.useState("isActive",N.index),q=A.useState("itemProps"),[_,M]=s4({controlled:U,default:Y??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:P,itemRef:T}=h3({closeOnClick:F,disabled:G,highlighted:D,id:V,store:A,nativeButton:z,nodeId:L?.nodeId,itemMetadata:r$}),R=pG.useMemo(()=>({disabled:G,highlighted:D,checked:_}),[G,D,_]),y=Y0((h)=>{let E={...M0(G0.itemPress,h.nativeEvent),preventUnmountOnClose:()=>{}};if(K?.(!_,E),E.isCanceled)return;M((I)=>!I)}),w=F0("div",Z,{state:R,stateAttributesMapping:x3,props:[q,{role:"menuitemcheckbox","aria-checked":_,onClick:y},W,P],ref:[T,H,N.ref]});return DS.jsx(HL.Provider,{value:R,children:w})});var uG=O(g(),1);var MS=uG.forwardRef(function(Z,H){let{render:B,className:J,keepMounted:Q=!1,...X}=Z,z=LS(),G=uG.useRef(null),{transitionStatus:F,setMounted:U}=l4(z.checked);y5({open:z.checked,ref:G,onComplete(){if(!z.checked)U(!1)}});let Y={checked:z.checked,disabled:z.disabled,highlighted:z.highlighted,transitionStatus:F};return F0("span",Z,{state:Y,ref:[H,G],stateAttributesMapping:x3,props:{"aria-hidden":!0,...X},enabled:Q||z.checked})});var a$=O(g(),1);var cG=O(g(),1),QL=cG.createContext(void 0);function PS(){let $=cG.useContext(QL);if($===void 0)throw Error(E0(31));return $}var _S=O(c(),1),OS=a$.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,[X,z]=a$.useState(void 0),G=a$.useMemo(()=>({setLabelId:z}),[z]),F=F0("div",Z,{ref:H,props:{role:"group","aria-labelledby":X,...Q}});return _S.jsx(QL.Provider,{value:G,children:F})});var jS=O(g(),1);var TS=jS.forwardRef(function(Z,H){let{className:B,render:J,id:Q,...X}=Z,z=Z1(Q),{setLabelId:G}=PS();return U0(()=>{return G(z),()=>{G(void 0)}},[G,z]),F0("div",Z,{ref:H,props:{id:z,role:"presentation",...X}})});var CS=O(g(),1);var wS=CS.forwardRef(function(Z,H){let{render:B,className:J,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:F=!0,...U}=Z,Y=V4({label:X}),K=A4(!0),W=Z1(Q),{store:N}=F5(),L=N.useState("isActive",Y.index),V=N.useState("itemProps"),{getItemProps:A,itemRef:D}=h3({closeOnClick:F,disabled:G,highlighted:L,id:W,store:N,nativeButton:z,nodeId:K?.nodeId,itemMetadata:r$});return F0("div",Z,{state:{disabled:G,highlighted:L},props:[V,U,A],ref:[D,H,Y.ref]})});var n$=O(g(),1);var ES=n$.forwardRef(function(Z,H){let{render:B,className:J,id:Q,label:X,closeOnClick:z=!1,...G}=Z,F=n$.useRef(null),U=V4({label:X}),K=A4(!0)?.nodeId,W=Z1(Q),{store:N}=F5(),L=N.useState("isActive",U.index),V=N.useState("itemProps"),A=fG({closeOnClick:z,highlighted:L,id:W,nodeId:K,store:N,itemRef:F}),D=n$.useMemo(()=>({highlighted:L}),[L]);return F0("a",Z,{state:D,props:[V,G,A],ref:[F,H,U.ref]})});var iG=O(g(),1);var dG=O(g(),1),ae=dG.createContext(void 0);function lG($){let Z=dG.useContext(ae);if(Z===void 0&&!$)throw Error(E0(69));return Z}var SS=O(c(),1),ne={...P1,...i1},IS=iG.forwardRef(function(Z,H){let{render:B,className:J,finalFocus:Q,...X}=Z,{store:z}=F5(),{side:G,align:F}=A4(),U=lG(!0)!=null,Y=z.useState("open"),K=z.useState("transitionStatus"),W=z.useState("popupProps"),N=z.useState("mounted"),L=z.useState("instantType"),V=z.useState("activeTriggerElement"),A=z.useState("parent"),D=z.useState("lastOpenChangeReason"),q=z.useState("rootId"),_=z.useState("floatingRootContext"),M=z.useState("floatingTreeRoot"),P=z.useState("closeDelay"),T=z.useState("activeTriggerElement"),R=A.type==="context-menu";y5({open:Y,ref:z.context.popupRef,onComplete(){if(Y)z.context.onOpenChangeComplete?.(!0)}}),iG.useEffect(()=>{function j(S){z.setOpen(!1,M0(S.reason,S.domEvent))}return M.events.on("close",j),()=>{M.events.off("close",j)}},[M.events,z]);let y=z.useState("hoverEnabled"),w=z.useState("disabled");R9(_,{enabled:y&&!w&&!R&&A.type!=="menubar",closeDelay:P});let h={transitionStatus:K,side:G,align:F,open:Y,nested:A.type==="menu",instant:L},E=F0("div",Z,{state:h,ref:[H,z.context.popupRef],stateAttributesMapping:ne,props:[W,{onKeyDown(j){if(U&&U3.has(j.key))j.stopPropagation()}},K2(K),X,{"data-rootownerid":q}]}),I=A.type===void 0||R;if(V||A.type==="menubar"&&D!==G0.outsidePress)I=!0;return SS.jsx(w6,{context:_,modal:R,disabled:!N,returnFocus:Q===void 0?I:Q,initialFocus:A.type!=="menu",restoreFocus:!0,externalTree:A.type!=="menubar"?M:void 0,previousFocusableElement:T,nextFocusableElement:A.type===void 0?z.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:A.type===void 0?z.context.beforeContentFocusGuardRef:void 0,children:E})});var kS=O(g(),1);var rG=O(g(),1),XL=rG.createContext(void 0);function RS(){let $=rG.useContext(XL);if($===void 0)throw Error(E0(32));return $}var zL=O(c(),1),bS=kS.forwardRef(function(Z,H){let{keepMounted:B=!1,...J}=Z,{store:Q}=F5();if(!(Q.useState("mounted")||B))return null;return zL.jsx(XL.Provider,{value:B,children:zL.jsx(C6,{ref:H,...J})})});var K9=O(g(),1);var v3=O(g(),1);var yS=O(c(),1);function aG($){let{children:Z,elementsRef:H,labelsRef:B,onMapChange:J}=$,Q=Y0(J),X=v3.useRef(0),z=k1(se).current,G=k1(oe).current,[F,U]=v3.useState(0),Y=v3.useRef(F),K=Y0((A,D)=>{G.set(A,D??null),Y.current+=1,U(Y.current)}),W=Y0((A)=>{G.delete(A),Y.current+=1,U(Y.current)}),N=v3.useMemo(()=>{ee(F);let A=new Map;return Array.from(G.keys()).filter((q)=>q.isConnected).sort(te).forEach((q,_)=>{let M=G.get(q)??{};A.set(q,{...M,index:_})}),A},[G,F]);U0(()=>{if(typeof MutationObserver!=="function"||N.size===0)return;let A=new MutationObserver((D)=>{let q=new Set,_=(M)=>q.has(M)?q.delete(M):q.add(M);if(D.forEach((M)=>{M.removedNodes.forEach(_),M.addedNodes.forEach(_)}),q.size===0)Y.current+=1,U(Y.current)});return N.forEach((D,q)=>{if(q.parentElement)A.observe(q.parentElement,{childList:!0})}),()=>{A.disconnect()}},[N]),U0(()=>{if(Y.current===F){if(H.current.length!==N.size)H.current.length=N.size;if(B&&B.current.length!==N.size)B.current.length=N.size;X.current=N.size}Q(N)},[Q,N,H,B,F]),U0(()=>{return()=>{H.current=[]}},[H]),U0(()=>{return()=>{if(B)B.current=[]}},[B]);let L=Y0((A)=>{return z.add(A),()=>{z.delete(A)}});U0(()=>{z.forEach((A)=>A(N))},[z,N]);let V=v3.useMemo(()=>({register:K,unregister:W,subscribeMapChange:L,elementsRef:H,labelsRef:B,nextIndexRef:X}),[K,W,L,H,B,X]);return yS.jsx(BL.Provider,{value:V,children:Z})}function oe(){return new Map}function se(){return new Set}function te($,Z){let H=$.compareDocumentPosition(Z);if(H&Node.DOCUMENT_POSITION_FOLLOWING||H&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(H&Node.DOCUMENT_POSITION_PRECEDING||H&Node.DOCUMENT_POSITION_CONTAINS)return 1;return 0}function ee($){}var o$=O(c(),1),xS=K9.forwardRef(function(Z,H){let{anchor:B,positionMethod:J="absolute",className:Q,render:X,side:z,align:G,sideOffset:F=0,alignOffset:U=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:K=5,arrowPadding:W=5,sticky:N=!1,disableAnchorTracking:L=!1,collisionAvoidance:V=hS,...A}=Z,{store:D}=F5(),q=RS(),_=Y9(!0),M=D.useState("parent"),P=D.useState("floatingRootContext"),T=D.useState("floatingTreeRoot"),R=D.useState("mounted"),y=D.useState("open"),w=D.useState("modal"),h=D.useState("activeTriggerElement"),E=D.useState("transitionStatus"),I=D.useState("lastOpenChangeReason"),j=D.useState("floatingNodeId"),S=D.useState("floatingParentNodeId"),k=B,b=F,v=U,u=G,C=V;if(M.type==="context-menu"){if(k=B??M.context?.anchor,u=u??"start",!z&&u!=="center")v=Z.alignOffset??2,b=Z.sideOffset??-5}let t=z,H0=u;if(M.type==="menu")t=t??"inline-end",H0=H0??"start",C=Z.collisionAvoidance??s8;else if(M.type==="menubar")t=t??"bottom",H0=H0??"start";let x=M.type==="context-menu",e=n8({anchor:k,floatingRootContext:P,positionMethod:_?"fixed":J,mounted:R,side:t,sideOffset:b,align:H0,alignOffset:v,arrowPadding:x?0:W,collisionBoundary:Y,collisionPadding:K,sticky:N,nodeId:j,keepMounted:q,disableAnchorTracking:L,collisionAvoidance:C,shiftCrossAxis:x&&!(("side"in C)&&C.side==="flip"),externalTree:T}),L0=K9.useMemo(()=>{let A0={};if(!y)A0.pointerEvents="none";return{role:"presentation",hidden:!R,style:{...e.positionerStyles,...A0}}},[y,R,e.positionerStyles]);K9.useEffect(()=>{function A0(i){if(i.open){if(i.parentNodeId===j)D.set("hoverEnabled",!1);if(i.nodeId!==j&&i.parentNodeId===D.select("floatingParentNodeId"))D.setOpen(!1,M0(G0.siblingOpen))}}return T.events.on("menuopenchange",A0),()=>{T.events.off("menuopenchange",A0)}},[D,T.events,j]),K9.useEffect(()=>{if(D.select("floatingParentNodeId")==null)return;function A0(i){if(i.open||i.nodeId!==D.select("floatingParentNodeId"))return;let B0=i.reason??G0.siblingOpen;D.setOpen(!1,M0(B0))}return T.events.on("menuopenchange",A0),()=>{T.events.off("menuopenchange",A0)}},[T.events,D]),K9.useEffect(()=>{function A0(i){if(!y||i.nodeId!==D.select("floatingParentNodeId"))return;if(i.target&&h&&h!==i.target)D.setOpen(!1,M0(G0.siblingOpen))}return T.events.on("itemhover",A0),()=>{T.events.off("itemhover",A0)}},[T.events,y,h,D]),K9.useEffect(()=>{let A0={open:y,nodeId:j,parentNodeId:S,reason:D.select("lastOpenChangeReason")};T.events.emit("menuopenchange",A0)},[T.events,y,D,j,S]);let d={open:y,side:e.side,align:e.align,anchorHidden:e.anchorHidden,nested:M.type==="menu"},X0=K9.useMemo(()=>({side:e.side,align:e.align,arrowRef:e.arrowRef,arrowUncentered:e.arrowUncentered,arrowStyles:e.arrowStyles,nodeId:e.context.nodeId}),[e.side,e.align,e.arrowRef,e.arrowUncentered,e.arrowStyles,e.context.nodeId]),K0=F0("div",Z,{state:d,stateAttributesMapping:P1,ref:[H,D.useStateSetter("positionerElement")],props:[L0,K2(E),A]}),Q0=R&&M.type!=="menu"&&(M.type!=="menubar"&&w&&I!==G0.triggerHover||M.type==="menubar"&&M.context.modal),z0=null;if(M.type==="menubar")z0=M.context.contentElement;else if(M.type===void 0)z0=h;return o$.jsxs($L.Provider,{value:X0,children:[Q0&&o$.jsx(F$,{ref:M.type==="context-menu"||M.type==="nested-context-menu"?M.context.internalBackdropRef:null,inert:g8(!y),cutout:z0}),o$.jsx(MH,{id:j,children:o$.jsx(aG,{elementsRef:D.context.itemDomElements,labelsRef:D.context.itemLabels,children:K0})})]})});var s$=O(g(),1);var nG=O(g(),1),GL=nG.createContext(void 0);function vS(){let $=nG.useContext(GL);if($===void 0)throw Error(E0(34));return $}var gS=O(c(),1),fS=s$.memo(s$.forwardRef(function(Z,H){let{render:B,className:J,value:Q,defaultValue:X,onValueChange:z,disabled:G=!1,...F}=Z,[U,Y]=s4({controlled:Q,default:X,name:"MenuRadioGroup"}),K=Y0(z),W=Y0((A,D)=>{if(K?.(A,D),D.isCanceled)return;Y(A)}),L=F0("div",Z,{state:{disabled:G},ref:H,props:{role:"group","aria-disabled":G||void 0,...F}}),V=s$.useMemo(()=>({value:U,setValue:W,disabled:G}),[U,W,G]);return gS.jsx(GL.Provider,{value:V,children:L})}));var sG=O(g(),1);var oG=O(g(),1),FL=oG.createContext(void 0);function mS(){let $=oG.useContext(FL);if($===void 0)throw Error(E0(35));return $}var pS=O(c(),1),uS=sG.forwardRef(function(Z,H){let{render:B,className:J,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:F=!1,value:U,...Y}=Z,K=V4({label:X}),W=A4(!0),N=Z1(Q),{store:L}=F5(),V=L.useState("isActive",K.index),A=L.useState("itemProps"),{value:D,setValue:q,disabled:_}=vS(),M=_||G,P=D===U,{getItemProps:T,itemRef:R}=h3({closeOnClick:F,disabled:M,highlighted:V,id:N,store:L,nativeButton:z,nodeId:W?.nodeId,itemMetadata:r$}),y=sG.useMemo(()=>({disabled:M,highlighted:V,checked:P}),[M,V,P]),w=Y0((E)=>{let I={...M0(G0.itemPress,E.nativeEvent),preventUnmountOnClose:()=>{}};q(U,I)}),h=F0("div",Z,{state:y,stateAttributesMapping:x3,props:[A,{role:"menuitemradio","aria-checked":P,onClick:w},Y,T],ref:[R,H,K.ref]});return pS.jsx(FL.Provider,{value:y,children:h})});var tG=O(g(),1);var cS=tG.forwardRef(function(Z,H){let{render:B,className:J,keepMounted:Q=!1,...X}=Z,z=mS(),G=tG.useRef(null),{transitionStatus:F,setMounted:U}=l4(z.checked);y5({open:z.checked,ref:G,onComplete(){if(!z.checked)U(!1)}});let Y={checked:z.checked,disabled:z.disabled,highlighted:z.highlighted,transitionStatus:F};return F0("span",Z,{state:Y,stateAttributesMapping:x3,ref:[H,G],props:{"aria-hidden":!0,...X},enabled:Q||z.checked})});var R5=O(g(),1);var eG=O(g(),1),$00=eG.createContext(null);function $F($){let Z=eG.useContext($00);if(Z===null&&!$)throw Error(E0(5));return Z}var yB=O(g(),1);var Z00={...r8,disabled:S0(($)=>$.parent.type==="menubar"?$.parent.context.disabled||$.disabled:$.disabled),modal:S0(($)=>($.parent.type===void 0||$.parent.type==="context-menu")&&($.modal??!0)),allowMouseEnter:S0(($)=>$.allowMouseEnter),stickIfOpen:S0(($)=>$.stickIfOpen),parent:S0(($)=>$.parent),rootId:S0(($)=>{if($.parent.type==="menu")return $.parent.store.select("rootId");return $.parent.type!==void 0?$.parent.context.rootId:$.rootId}),activeIndex:S0(($)=>$.activeIndex),isActive:S0(($,Z)=>$.activeIndex===Z),hoverEnabled:S0(($)=>$.hoverEnabled),instantType:S0(($)=>$.instantType),lastOpenChangeReason:S0(($)=>$.openChangeReason),floatingTreeRoot:S0(($)=>{if($.parent.type==="menu")return $.parent.store.select("floatingTreeRoot");return $.floatingTreeRoot}),floatingNodeId:S0(($)=>$.floatingNodeId),floatingParentNodeId:S0(($)=>$.floatingParentNodeId),itemProps:S0(($)=>$.itemProps),closeDelay:S0(($)=>$.closeDelay),keyboardEventRelay:S0(($)=>{if($.keyboardEventRelay)return $.keyboardEventRelay;if($.parent.type==="menu")return $.parent.store.select("keyboardEventRelay");return})};class t$ extends r2{constructor($){super({...H00(),...$},{positionerRef:yB.createRef(),popupRef:yB.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:yB.createRef(),beforeContentFocusGuardRef:yB.createRef(),onOpenChangeComplete:void 0,triggerElements:new n2},Z00);this.unsubscribeParentListener=this.observe("parent",(Z)=>{if(this.unsubscribeParentListener?.(),Z.type==="menu"){this.unsubscribeParentListener=Z.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=Z.store.context.allowMouseUpTriggerRef;return}if(Z.type!==void 0)this.context.allowMouseUpTriggerRef=Z.context.allowMouseUpTriggerRef;this.unsubscribeParentListener=null})}setOpen($,Z){this.state.floatingRootContext.context.events.emit("setOpen",{open:$,eventDetails:Z})}static useStore($,Z){let H=k1(()=>{return new t$(Z)}).current;return $??H}unsubscribeParentListener=null}function H00(){return{...i8(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new _6,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:b1,keyboardEventRelay:void 0,closeDelay:0}}var ZF=O(g(),1),UL=ZF.createContext(void 0);function HF(){return ZF.useContext(UL)}var YL=O(c(),1),BF=NH(function(Z){let{children:H,open:B,onOpenChange:J,onOpenChangeComplete:Q,defaultOpen:X=!1,disabled:z=!1,modal:G,loopFocus:F=!0,orientation:U="vertical",actionsRef:Y,closeParentOnEsc:K=!1,handle:W,triggerId:N,defaultTriggerId:L=null,highlightItemOnHover:V=!0}=Z,A=Y9(!0),D=F5(!0),q=$F(!0),_=HF(),M=R5.useMemo(()=>{if(_&&D)return{type:"menu",store:D.store};if(q)return{type:"menubar",context:q};if(A&&!D)return{type:"context-menu",context:A};return{type:void 0}},[A,D,q,_]),P=t$.useStore(W?.store,{open:X,openProp:B,activeTriggerId:L,triggerIdProp:N,parent:M});t8(()=>{if(B===void 0&&P.state.open===!1&&X===!0)P.update({open:!0,activeTriggerId:L})}),P.useControlledProp("openProp",B),P.useControlledProp("triggerIdProp",N),P.useContextCallback("onOpenChangeComplete",Q);let T=P.useState("floatingTreeRoot"),R=O6(T),y=e5();U0(()=>{if(A&&!D)P.update({parent:{type:"context-menu",context:A},floatingNodeId:R,floatingParentNodeId:y});else if(D)P.update({floatingNodeId:R,floatingParentNodeId:y})},[A,D,R,y,P]);let w=P.useState("open"),h=P.useState("activeTriggerElement"),E=P.useState("positionerElement"),I=P.useState("hoverEnabled"),j=P.useState("modal"),S=P.useState("disabled"),k=P.useState("lastOpenChangeReason"),b=P.useState("parent"),v=P.useState("activeIndex"),u=P.useState("payload"),C=P.useState("floatingParentNodeId"),t=R5.useRef(null),H0=C!=null,x;P.useSyncedValues({disabled:z,modal:b.type===void 0?G:void 0,rootId:Y2()});let{openMethod:e,triggerProps:L0,reset:d}=K$(w);d8(P);let{forceUnmount:X0}=l8(w,P,()=>{P.update({allowMouseEnter:!1,stickIfOpen:!0}),d()}),K0=R5.useRef(b.type!=="context-menu"),Q0=_5();R5.useEffect(()=>{if(!w)t.current=null;if(b.type!=="context-menu")return;if(!w){Q0.clear(),K0.current=!1;return}Q0.start(500,()=>{K0.current=!0})},[Q0,w,b.type]),U$(w&&j&&k!==G0.triggerHover&&e!=="touch",E),U0(()=>{if(!w&&!I)P.set("hoverEnabled",!0)},[w,I,P]);let z0=R5.useRef(!0),A0=_5(),i=Y0((c0,R0)=>{let d0=R0.reason;if(w===c0&&R0.trigger===h&&k===d0)return;if(R0.preventUnmountOnClose=()=>{P.set("preventUnmountingOnClose",!0)},!c0&&R0.trigger==null)R0.trigger=h??void 0;if(J?.(c0,R0),R0.isCanceled)return;let p0={open:c0,nativeEvent:R0.event,reason:R0.reason,nested:H0};x?.emit("openchange",p0);let s0=R0.event;if(c0===!1&&s0?.type==="click"&&s0.pointerType==="touch"&&!z0.current)return;if(!c0&&v!==null){let I0=P.context.itemDomElements.current[v];queueMicrotask(()=>{I0?.setAttribute("tabindex","-1")})}if(c0&&d0===G0.triggerFocus)z0.current=!1,A0.start(300,()=>{z0.current=!0});else z0.current=!0,A0.clear();let N0=(d0===G0.triggerPress||d0===G0.itemPress)&&s0.detail===0&&s0?.isTrusted,b0=!c0&&(d0===G0.escapeKey||d0==null),K1={open:c0,openChangeReason:d0};t.current=R0.event??null;let T0=R0.trigger?.id??null;if(T0||c0)K1.activeTriggerId=T0,K1.activeTriggerElement=R0.trigger??null;if(P.update(K1),b.type==="menubar"&&(d0===G0.triggerFocus||d0===G0.focusOut||d0===G0.triggerHover||d0===G0.listNavigation||d0===G0.siblingOpen))P.set("instantType","group");else if(N0||b0)P.set("instantType",N0?"click":"dismiss");else P.set("instantType",void 0)}),B0=R5.useCallback((c0)=>{let R0=M0(c0);return R0.preventUnmountOnClose=()=>{P.set("preventUnmountingOnClose",!0)},R0},[P]),$0=R5.useCallback(()=>{P.setOpen(!1,B0(G0.imperativeAction))},[P,B0]);R5.useImperativeHandle(Y,()=>({unmount:X0,close:$0}),[X0,$0]);let J0;if(b.type==="context-menu")J0=b.context;R5.useImperativeHandle(J0?.positionerRef,()=>E,[E]),R5.useImperativeHandle(J0?.actionsRef,()=>({setOpen:i}),[i]);let n=L8({popupStore:P,onOpenChange:i});x=n.context.events,R5.useEffect(()=>{let c0=({open:R0,eventDetails:d0})=>i(R0,d0);return x.on("setOpen",c0),()=>{x?.off("setOpen",c0)}},[x,i]);let f=N8(n,{enabled:!S,bubbles:{escapeKey:K&&b.type==="menu"},outsidePress(){if(b.type!=="context-menu"||t.current?.type==="contextmenu")return!0;return K0.current},externalTree:H0?T:void 0}),l=k6(n,{role:"menu"}),m=i4(),a=R5.useCallback((c0)=>{if(P.select("activeIndex")===c0)return;P.set("activeIndex",c0)},[P]),o=pK(n,{enabled:!S,listRef:P.context.itemDomElements,activeIndex:v,nested:b.type!==void 0,loopFocus:F,orientation:U,parentOrientation:b.type==="menubar"?b.context.orientation:void 0,rtl:m==="rtl",disabledIndices:hB,onNavigate:a,openOnArrowKeyDown:b.type!=="context-menu",externalTree:H0?T:void 0,focusItemOnHover:V}),D0=R5.useCallback((c0)=>{P.context.typingRef.current=c0},[P]),O0=uK(n,{listRef:P.context.itemLabels,activeIndex:v,resetMs:dS,onMatch:(c0)=>{if(w&&c0!==v)P.set("activeIndex",c0)},onTypingChange:D0}),{getReferenceProps:k0,getFloatingProps:r0,getItemProps:p,getTriggerProps:r}=Z2([f,l,o,O0]),Z0=R5.useMemo(()=>{let c0=Y4(k0(),{onMouseMove(){P.set("allowMouseEnter",!0)}},L0);return delete c0.role,c0},[k0,P,L0]),V0=R5.useMemo(()=>{let c0=r();if(!c0)return c0;let R0=Y4(c0,L0);return delete R0.role,delete R0["aria-controls"],R0},[r,L0]),j0=R5.useMemo(()=>r0({onMouseMove(){if(P.set("allowMouseEnter",!0),b.type==="menu")P.set("hoverEnabled",!1)},onClick(){if(P.select("hoverEnabled"))P.set("hoverEnabled",!1)},onKeyDown(c0){let R0=P.select("keyboardEventRelay");if(R0&&!c0.isPropagationStopped())R0(c0)}}),[r0,b.type,P]),v0=R5.useMemo(()=>p(),[p]);P.useSyncedValues({floatingRootContext:n,activeTriggerProps:Z0,inactiveTriggerProps:V0,popupProps:j0,itemProps:v0});let z1=R5.useMemo(()=>({store:P,parent:M}),[P,M]),Y1=YL.jsx(ZL.Provider,{value:z1,children:typeof H==="function"?H({payload:u}):H});if(b.type===void 0||b.type==="context-menu")return YL.jsx(PH,{externalTree:T,children:Y1});return Y1});var lS=O(g(),1);var KL=O(c(),1);function iS($){let Z=F5().store,H=lS.useMemo(()=>({parentMenu:Z}),[Z]);return KL.jsx(UL.Provider,{value:H,children:KL.jsx(BF,{...$})})}var v2=O(g(),1),NL=O(F4(),1);function rS($){let Z=$.getBoundingClientRect(),H=window.getComputedStyle($,"::before"),B=window.getComputedStyle($,"::after");if(!(H.content!=="none"||B.content!=="none"))return Z;let Q=parseFloat(H.width)||0,X=parseFloat(H.height)||0,z=parseFloat(B.width)||0,G=parseFloat(B.height)||0,F=Math.max(Z.width,Q,z),U=Math.max(Z.height,X,G),Y=F-Z.width,K=U-Z.height;return{left:Z.left-Y/2,right:Z.right+Y/2,top:Z.top-K/2,bottom:Z.bottom+K/2}}var QF=O(g(),1);function aS($={}){let{highlightItemOnHover:Z,highlightedIndex:H,onHighlightedIndexChange:B}=JF(),{ref:J,index:Q}=V4($),X=H===Q,z=QF.useRef(null),G=T4(J,z);return{compositeProps:QF.useMemo(()=>({tabIndex:X?0:-1,onFocus(){B(Q)},onMouseMove(){let U=z.current;if(!Z||!U)return;let Y=U.hasAttribute("disabled")||U.ariaDisabled==="true";if(!X&&!Y)U.focus()}}),[X,B,Q,Z]),compositeRef:G,index:Q}}function nS($){let{render:Z,className:H,state:B=b1,props:J=hB,refs:Q=hB,metadata:X,stateAttributesMapping:z,tag:G="div",...F}=$,{compositeProps:U,compositeRef:Y}=aS({metadata:X});return F0(G,$,{state:B,ref:[...Q,Y],props:[U,...J,F],stateAttributesMapping:z})}function WL($){if(O5($)&&$.hasAttribute("data-rootownerid"))return $.getAttribute("data-rootownerid")??void 0;if(t7($))return;return WL($X($))}var XF=O(g(),1);function oS($){let{enabled:Z=!0,mouseDownAction:H,open:B}=$,J=XF.useRef(!1);return XF.useMemo(()=>{if(!Z)return b1;return{onMouseDown:(Q)=>{if(H==="open"&&!B||H==="close"&&B)J.current=!0,m0(Q.currentTarget).addEventListener("click",()=>{J.current=!1},{once:!0})},onClick:(Q)=>{if(J.current)J.current=!1,Q.preventBaseUIHandler()}}},[Z,H,B])}var g3=O(c(),1),zF=2,sS=AQ(function(Z,H){let{render:B,className:J,disabled:Q=!1,nativeButton:X=!0,id:z,openOnHover:G,delay:F=100,closeDelay:U=0,handle:Y,payload:K,...W}=Z,N=F5(!0),L=Y?.store??N?.store;if(!L)throw Error(E0(85));let V=Z1(z),A=L.useState("isTriggerActive",V),D=L.useState("floatingRootContext"),q=L.useState("isOpenedByTrigger",V),_=v2.useRef(null),M=J00(),P=JF(!0),T=k2(),R=v2.useMemo(()=>{return T??new _6},[T]),y=O6(R),w=e5(),{registerTrigger:h,isMountedByThisTrigger:E}=c8(V,_,L,{payload:K,closeDelay:U,parent:M,floatingTreeRoot:R,floatingNodeId:y,floatingParentNodeId:w,keyboardEventRelay:P?.relayKeyboardEvent}),I=M.type==="menubar",j=L.useState("disabled"),S=Q||j||I&&M.context.disabled,{getButtonProps:k,buttonRef:b}=u5({disabled:S,native:X});v2.useEffect(()=>{if(!q&&M.type===void 0)L.context.allowMouseUpTriggerRef.current=!1},[L,q,M.type]);let v=v2.useRef(null),u=_5(),C=Y0((f)=>{if(!v.current)return;u.clear(),L.context.allowMouseUpTriggerRef.current=!1;let l=f.target;if(f0(v.current,l)||f0(L.select("positionerElement"),l)||l===v.current)return;if(l!=null&&WL(l)===L.select("rootId"))return;let m=rS(v.current);if(f.clientX>=m.left-zF&&f.clientX<=m.right+zF&&f.clientY>=m.top-zF&&f.clientY<=m.bottom+zF)return;R.events.emit("close",{domEvent:f,reason:G0.cancelOpen})});v2.useEffect(()=>{if(q&&L.select("lastOpenChangeReason")===G0.triggerHover)m0(v.current).addEventListener("mouseup",C,{once:!0})},[q,C,L]);let t=I&&M.context.hasSubmenuOpen,x=A8(D,{enabled:(G??t)&&!S&&M.type!=="context-menu"&&(!I||t&&!E),handleClose:V8({blockPointerEvents:!I}),mouseOnly:!0,move:!1,restMs:M.type===void 0?F:void 0,delay:{close:U},triggerElementRef:_,externalTree:R,isActiveTrigger:A}),e=B00(q,L.select("lastOpenChangeReason")),L0=I9(D,{enabled:!S&&M.type!=="context-menu",event:q&&I?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:M.type===void 0?e:!1}),d=S6(D,{enabled:!S&&t}),X0=oS({open:q,enabled:I,mouseDownAction:"open"}),K0=Z2([L0,d]),Q0={disabled:S,open:q},z0=L.useState("triggerProps",E),A0=[v,H,b,h,_],i=[K0.getReferenceProps(),x??b1,z0,{"aria-haspopup":"menu",id:V,onMouseDown:(f)=>{if(L.select("open"))return;u.start(200,()=>{L.context.allowMouseUpTriggerRef.current=!0}),m0(f.currentTarget).addEventListener("mouseup",C,{once:!0})}},I?{role:"menuitem"}:{},X0,W,k],B0=v2.useRef(null),$0=Y0((f)=>{NL.flushSync(()=>{L.setOpen(!1,M0(G0.focusOut,f.nativeEvent,f.currentTarget))}),mQ(B0.current)?.focus()}),J0=Y0((f)=>{let l=L.select("positionerElement");if(l&&U8(f,l))L.context.beforeContentFocusGuardRef.current?.focus();else{NL.flushSync(()=>{L.setOpen(!1,M0(G0.focusOut,f.nativeEvent,f.currentTarget))});let m=fQ(L.context.triggerFocusTargetRef.current||_.current);while(m!==null&&f0(l,m)){let a=m;if(m=Z3(m),m===a)break}m?.focus()}}),n=F0("button",Z,{enabled:!I,stateAttributesMapping:kH,state:Q0,ref:A0,props:i});if(I)return g3.jsx(nS,{tag:"button",render:B,className:J,state:Q0,refs:A0,props:i,stateAttributesMapping:kH});if(q)return g3.jsxs(v2.Fragment,{children:[g3.jsx(I2,{ref:B0,onFocus:$0},`${V}-pre-focus-guard`),g3.jsx(v2.Fragment,{children:n},V),g3.jsx(I2,{ref:L.context.triggerFocusTargetRef,onFocus:J0},`${V}-post-focus-guard`)]});return g3.jsx(v2.Fragment,{children:n},V)});function B00($,Z){let H=_5(),[B,J]=v2.useState(!1);return U0(()=>{if($&&Z==="trigger-hover")J(!0),H.start(GF,()=>{J(!1)});else if(!$)H.clear(),J(!1)},[$,Z,H]),B}function J00(){let $=Y9(!0),Z=F5(!0),H=$F(!0);return v2.useMemo(()=>{if(H)return{type:"menubar",context:H};if($&&!Z)return{type:"context-menu",context:$};return{type:void 0}},[$,Z,H])}var tS=O(g(),1);var eS=tS.forwardRef(function(Z,H){let{className:B,render:J,orientation:Q="horizontal",...X}=Z;return F0("div",Z,{state:{orientation:Q},ref:H,props:[{role:"separator","aria-orientation":Q},X]})});var v9=O(g(),1);var $I=v9.forwardRef(function(Z,H){let{render:B,className:J,label:Q,id:X,nativeButton:z=!1,openOnHover:G=!0,delay:F=100,closeDelay:U=0,disabled:Y=!1,...K}=Z,W=V4(),N=A4(),{store:L}=F5(),V=Z1(X),A=L.useState("open"),D=L.useState("floatingRootContext"),q=L.useState("floatingTreeRoot"),_=hK(V,L),M=v9.useCallback((L0)=>{let d=_(L0);if(L0!==null&&L.select("open")&&L.select("activeTriggerId")==null)L.update({activeTriggerId:V,activeTriggerElement:L0,closeDelay:U});return d},[_,U,L,V]),P=v9.useRef(null),T=v9.useCallback((L0)=>{P.current=L0,L.set("activeTriggerElement",L0)},[L]),R=HF();if(!R?.parentMenu)throw Error(E0(37));L.useSyncedValue("closeDelay",U);let y=R.parentMenu,w=y.useState("itemProps"),h=y.useState("isActive",W.index),E=v9.useMemo(()=>({type:"submenu-trigger",setActive(){y.set("activeIndex",W.index)}}),[y,W.index]),I=L.useState("disabled"),j=Y||I,{getItemProps:S,itemRef:k}=h3({closeOnClick:!1,disabled:j,highlighted:h,id:V,store:L,nativeButton:z,itemMetadata:E,nodeId:N?.nodeId}),b=L.useState("hoverEnabled"),v=y.useState("allowMouseEnter"),u=A8(D,{enabled:b&&G&&!j,handleClose:V8({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:F,delay:v?{open:F,close:U}:0,triggerElementRef:P,externalTree:q}),C=I9(D,{enabled:!j,event:"mousedown",toggle:!G,ignoreMouse:G,stickIfOpen:!1}),t=Z2([C]),H0=L.useState("triggerProps",!0);return delete H0.id,F0("div",Z,{state:{disabled:j,highlighted:h,open:A},stateAttributesMapping:o8,props:[t.getReferenceProps(),u,H0,w,{tabIndex:A||h?0:-1,onBlur(){if(h)y.set("activeIndex",null)}},K,S],ref:[H,W.ref,k,M,T]})});class FF{constructor(){this.store=new t$}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(E0(83,$));this.store.setOpen(!0,M0("imperative-action",void 0,Z))}close(){this.store.setOpen(!1,M0("imperative-action",void 0,void 0))}get isOpen(){return this.store.state.open}}function ZI(){return new FF}var g2=O(c(),1);function e$({...$}){return g2.jsx($4.Root,{"data-slot":"dropdown-menu",...$})}function $Z({...$}){return g2.jsx($4.Trigger,{"data-slot":"dropdown-menu-trigger",...$})}function ZZ({align:$="start",alignOffset:Z=0,side:H="bottom",sideOffset:B=4,className:J,...Q}){return g2.jsx($4.Portal,{children:g2.jsx($4.Positioner,{className:"isolate z-50 outline-none",align:$,alignOffset:Z,side:H,sideOffset:B,children:g2.jsx($4.Popup,{"data-slot":"dropdown-menu-content",className:s("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",J),...Q})})})}function HZ({...$}){return g2.jsx($4.Group,{"data-slot":"dropdown-menu-group",...$})}function UF({className:$,inset:Z,...H}){return g2.jsx($4.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":Z,className:s("px-2 pt-1.5 pb-0.5 text-xs text-muted-foreground data-inset:pl-7",$),...H})}function xB({className:$,inset:Z,variant:H="default",...B}){return g2.jsx($4.Item,{"data-slot":"dropdown-menu-item","data-inset":Z,"data-variant":H,className:s("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-md px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",$),...B})}function HI({...$}){return g2.jsx($4.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...$})}function BI({className:$,children:Z,inset:H,...B}){return g2.jsxs($4.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":H,className:s("relative flex cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",$),...B,children:[g2.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:g2.jsx($4.RadioItemIndicator,{children:g2.jsx(L3,{stroke:1.75})})}),Z]})}function JI({className:$,...Z}){return g2.jsx($4.Separator,{"data-slot":"dropdown-menu-separator",className:s("mx-2 my-1 h-px bg-border",$),...Z})}var f3={};O4(f3,{createHandle:()=>SI,Viewport:()=>EI,Trigger:()=>FI,Title:()=>PI,Root:()=>zI,Positioner:()=>WI,Portal:()=>KI,Popup:()=>LI,Handle:()=>LF,Description:()=>OI,Close:()=>TI,Backdrop:()=>qI,Arrow:()=>VI});var J8=O(g(),1);var YF=O(g(),1),LL=YF.createContext(void 0);function v5($){let Z=YF.useContext(LL);if(Z===void 0&&!$)throw Error(E0(47));return Z}var BZ=O(g(),1),QI=O(F4(),1);function Q00(){return{...i8(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var X00={...r8,disabled:S0(($)=>$.disabled),instantType:S0(($)=>$.instantType),openMethod:S0(($)=>$.openMethod),openChangeReason:S0(($)=>$.openChangeReason),modal:S0(($)=>$.modal),stickIfOpen:S0(($)=>$.stickIfOpen),titleElementId:S0(($)=>$.titleElementId),descriptionElementId:S0(($)=>$.descriptionElementId),openOnHover:S0(($)=>$.openOnHover),closeDelay:S0(($)=>$.closeDelay),hasViewport:S0(($)=>$.hasViewport)};class JZ extends r2{constructor($){let Z={...Q00(),...$};if(Z.open&&$?.mounted===void 0)Z.mounted=!0;super(Z,{popupRef:BZ.createRef(),backdropRef:BZ.createRef(),internalBackdropRef:BZ.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:BZ.createRef(),beforeContentFocusGuardRef:BZ.createRef(),stickIfOpenTimeout:new r5,triggerElements:new n2},X00)}setOpen=($,Z)=>{let H=Z.reason===G0.triggerHover,B=Z.reason===G0.triggerPress&&Z.event.detail===0,J=!$&&(Z.reason===G0.escapeKey||Z.reason==null);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let Q={open:$,nativeEvent:Z.event,reason:Z.reason,nested:this.state.nested,triggerElement:Z.trigger};this.state.floatingRootContext.context.events?.emit("openchange",Q);let z=()=>{let G={open:$,openChangeReason:Z.reason},F=Z.trigger?.id??null;if(F||$)G.activeTriggerId=F,G.activeTriggerElement=Z.trigger??null;this.update(G)};if(H)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(GF,()=>{this.set("stickIfOpen",!1)}),QI.flushSync(z);else z();if(B||J)this.set("instantType",B?"click":"dismiss");else if(Z.reason===G0.focusOut)this.set("instantType","focus");else this.set("instantType",void 0)};static useStore($,Z){let H=k1(()=>{return new JZ(Z)}).current,B=$??H;return E2(H.disposeEffect),B}disposeEffect=()=>{return this.context.stickIfOpenTimeout.disposeEffect()}}var vB=O(c(),1);function XI({props:$}){let{children:Z,open:H,defaultOpen:B=!1,onOpenChange:J,onOpenChangeComplete:Q,modal:X=!1,handle:z,triggerId:G,defaultTriggerId:F=null}=$,U=JZ.useStore(z?.store,{modal:X,open:B,openProp:H,activeTriggerId:F,triggerIdProp:G});t8(()=>{if(H===void 0&&U.state.open===!1&&B===!0)U.update({open:!0,activeTriggerId:F})}),U.useControlledProp("openProp",H),U.useControlledProp("triggerIdProp",G);let Y=U.useState("open"),K=U.useState("positionerElement"),W=U.useState("payload"),N=U.useState("openChangeReason");U.useContextCallback("onOpenChange",J),U.useContextCallback("onOpenChangeComplete",Q);let{openMethod:L,triggerProps:V,reset:A}=K$(Y);d8(U);let{forceUnmount:D}=l8(Y,U,()=>{U.update({stickIfOpen:!0,openChangeReason:null}),A()});U$(Y&&X===!0&&N!==G0.triggerHover&&L!=="touch",K),J8.useEffect(()=>{if(!Y)U.context.stickIfOpenTimeout.clear()},[U,Y]);let q=J8.useCallback((S)=>{let k=M0(S);return k.preventUnmountOnClose=()=>{U.set("preventUnmountingOnClose",!0)},k},[U]),_=J8.useCallback(()=>{U.setOpen(!1,q(G0.imperativeAction))},[U,q]);J8.useImperativeHandle($.actionsRef,()=>({unmount:D,close:_}),[D,_]);let M=L8({popupStore:U,onOpenChange:U.setOpen}),P=N8(M,{outsidePressEvent:{mouse:X==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),T=k6(M),{getReferenceProps:R,getFloatingProps:y,getTriggerProps:w}=Z2([P,T]),h=J8.useMemo(()=>{return R(V)},[R,V]),E=J8.useMemo(()=>{return w(V)},[w,V]),I=J8.useMemo(()=>{return y()},[y]);U.useSyncedValues({modal:X,openMethod:L,activeTriggerProps:h,inactiveTriggerProps:E,popupProps:I,floatingRootContext:M,nested:e5()!=null});let j=J8.useMemo(()=>({store:U}),[U]);return vB.jsx(LL.Provider,{value:j,children:typeof Z==="function"?Z({payload:W}):Z})}function zI($){if(v5(!0))return vB.jsx(XI,{props:$});return vB.jsx(PH,{children:vB.jsx(XI,{props:$})})}var O8=O(g(),1),AL=O(F4(),1);var GI=300;var Q7=O(c(),1),FI=O8.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q=!1,nativeButton:X=!0,handle:z,payload:G,openOnHover:F=!1,delay:U=GI,closeDelay:Y=0,id:K,...W}=Z,N=v5(!0),L=z?.store??N?.store;if(!L)throw Error(E0(74));let V=Z1(K),A=L.useState("isTriggerActive",V),D=L.useState("floatingRootContext"),q=L.useState("isOpenedByTrigger",V),_=O8.useRef(null),{registerTrigger:M,isMountedByThisTrigger:P}=c8(V,_,L,{payload:G,disabled:Q,openOnHover:F,closeDelay:Y}),T=L.useState("openChangeReason"),R=L.useState("stickIfOpen"),y=L.useState("openMethod"),w=A8(D,{enabled:D!=null&&F&&(y!=="touch"||T!==G0.triggerPress),mouseOnly:!0,move:!1,handleClose:V8(),restMs:U,delay:{close:Y},triggerElementRef:_,isActiveTrigger:A}),h=I9(D,{enabled:D!=null,stickIfOpen:R}),E=Z2([h]),I=L.useState("triggerProps",P),j={disabled:Q,open:q},{getButtonProps:S,buttonRef:k}=u5({disabled:Q,native:X}),b=O8.useMemo(()=>({open(H0){if(H0&&T===G0.triggerPress)return kH.open(H0);return o8.open(H0)}}),[T]),v=F0("button",Z,{state:j,ref:[k,H,M,_],props:[E.getReferenceProps(),w,I,{[s7]:"",id:V},W,S],stateAttributesMapping:b}),u=O8.useRef(null),C=Y0((H0)=>{AL.flushSync(()=>{L.setOpen(!1,M0(G0.focusOut,H0.nativeEvent,H0.currentTarget))}),mQ(u.current)?.focus()}),t=Y0((H0)=>{let x=L.select("positionerElement");if(x&&U8(H0,x))L.context.beforeContentFocusGuardRef.current?.focus();else{AL.flushSync(()=>{L.setOpen(!1,M0(G0.focusOut,H0.nativeEvent,H0.currentTarget))});let e=fQ(L.context.triggerFocusTargetRef.current||_.current);while(e!==null&&f0(x,e)){let L0=e;if(e=Z3(e),e===L0)break}e?.focus()}});if(A)return Q7.jsxs(O8.Fragment,{children:[Q7.jsx(I2,{ref:u,onFocus:C}),Q7.jsx(O8.Fragment,{children:v},V),Q7.jsx(I2,{ref:L.context.triggerFocusTargetRef,onFocus:t})]});return Q7.jsx(O8.Fragment,{children:v},V)});var YI=O(g(),1);var KF=O(g(),1),VL=KF.createContext(void 0);function UI(){let $=KF.useContext(VL);if($===void 0)throw Error(E0(45));return $}var DL=O(c(),1),KI=YI.forwardRef(function(Z,H){let{keepMounted:B=!1,...J}=Z,{store:Q}=v5();if(!(Q.useState("mounted")||B))return null;return DL.jsx(VL.Provider,{value:B,children:DL.jsx(C6,{ref:H,...J})})});var g9=O(g(),1);var WF=O(g(),1),qL=WF.createContext(void 0);function QZ(){let $=WF.useContext(qL);if(!$)throw Error(E0(46));return $}var gB=O(c(),1),WI=g9.forwardRef(function(Z,H){let{render:B,className:J,anchor:Q,positionMethod:X="absolute",side:z="bottom",align:G="center",sideOffset:F=0,alignOffset:U=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:K=5,arrowPadding:W=5,sticky:N=!1,disableAnchorTracking:L=!1,collisionAvoidance:V=s8,...A}=Z,{store:D}=v5(),q=UI(),_=O6(),M=D.useState("floatingRootContext"),P=D.useState("mounted"),T=D.useState("open"),R=D.useState("openChangeReason"),y=D.useState("activeTriggerElement"),w=D.useState("modal"),h=D.useState("positionerElement"),E=D.useState("instantType"),I=D.useState("transitionStatus"),j=D.useState("hasViewport"),S=g9.useRef(null),k=p8(h,!1,!1),b=n8({anchor:Q,floatingRootContext:M,positionMethod:X,mounted:P,side:z,sideOffset:F,align:G,alignOffset:U,arrowPadding:W,collisionBoundary:Y,collisionPadding:K,sticky:N,disableAnchorTracking:L,keepMounted:q,nodeId:_,collisionAvoidance:V,adaptiveOrigin:j?Z$:void 0}),v=g9.useMemo(()=>{let e={};if(!T)e.pointerEvents="none";return{role:"presentation",hidden:!P,style:{...b.positionerStyles,...e}}},[T,P,b.positionerStyles]),u=g9.useMemo(()=>({props:v,...b}),[v,b]),C=M.useState("domReferenceElement");U0(()=>{let e=C,L0=S.current;if(e)S.current=e;if(L0&&e&&e!==L0){D.set("instantType",void 0);let d=new AbortController;return k(()=>{D.set("instantType","trigger-change")},d.signal),()=>{d.abort()}}return},[C,k,D]);let t={open:T,side:u.side,align:u.align,anchorHidden:u.anchorHidden,instant:E},H0=g9.useCallback((e)=>{D.set("positionerElement",e)},[D]),x=F0("div",Z,{state:t,props:[u.props,K2(I),A],ref:[H,H0],stateAttributesMapping:P1});return gB.jsxs(qL.Provider,{value:u,children:[P&&w===!0&&R!==G0.triggerHover&&gB.jsx(F$,{ref:D.context.internalBackdropRef,inert:g8(!T),cutout:y}),gB.jsx(MH,{id:_,children:x})]})});var NF=O(g(),1);var NI=O(c(),1),z00={...P1,...i1},LI=NF.forwardRef(function(Z,H){let{className:B,render:J,initialFocus:Q,finalFocus:X,...z}=Z,{store:G}=v5(),F=QZ(),U=lG(!0)!=null,Y=G.useState("open"),K=G.useState("openMethod"),W=G.useState("instantType"),N=G.useState("transitionStatus"),L=G.useState("popupProps"),V=G.useState("titleElementId"),A=G.useState("descriptionElementId"),D=G.useState("modal"),q=G.useState("mounted"),_=G.useState("openChangeReason"),M=G.useState("activeTriggerElement"),P=G.useState("floatingRootContext");y5({open:Y,ref:G.context.popupRef,onComplete(){if(Y)G.context.onOpenChangeComplete?.(!0)}});let T=G.useState("disabled"),R=G.useState("openOnHover"),y=G.useState("closeDelay");R9(P,{enabled:R&&!T,closeDelay:y});function w(S){if(S==="touch")return G.context.popupRef.current;return!0}let h=Q===void 0?w:Q,E={open:Y,side:F.side,align:F.align,instant:W,transitionStatus:N},I=NF.useCallback((S)=>{G.set("popupElement",S)},[G]),j=F0("div",Z,{state:E,ref:[H,G.context.popupRef,I],props:[L,{"aria-labelledby":V,"aria-describedby":A,onKeyDown(S){if(U&&U3.has(S.key))S.stopPropagation()}},K2(N),z],stateAttributesMapping:z00});return NI.jsx(w6,{context:P,openInteractionType:K,modal:D==="trap-focus",disabled:!q||_===G0.triggerHover,initialFocus:h,returnFocus:X,restoreFocus:"popup",previousFocusableElement:O5(M)?M:void 0,nextFocusableElement:G.context.triggerFocusTargetRef,beforeContentFocusGuardRef:G.context.beforeContentFocusGuardRef,children:j})});var AI=O(g(),1);var VI=AI.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,{store:X}=v5(),z=X.useState("open"),{arrowRef:G,side:F,align:U,arrowUncentered:Y,arrowStyles:K}=QZ();return F0("div",Z,{state:{open:z,side:F,align:U,uncentered:Y},ref:[H,G],props:[{style:K,"aria-hidden":!0},Q],stateAttributesMapping:P1})});var DI=O(g(),1);var G00={...P1,...i1},qI=DI.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,{store:X}=v5(),z=X.useState("open"),G=X.useState("mounted"),F=X.useState("transitionStatus"),U=X.useState("openChangeReason");return F0("div",Z,{state:{open:z,transitionStatus:F},ref:[X.context.backdropRef,H],props:[{role:"presentation",hidden:!G,style:{pointerEvents:U===G0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},Q],stateAttributesMapping:G00})});var MI=O(g(),1);var PI=MI.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{store:X}=v5(),z=Z1(Q.id);return U0(()=>{return X.set("titleElementId",z),()=>{X.set("titleElementId",void 0)}},[X,z]),F0("h2",Z,{ref:H,props:[{id:z},Q]})});var _I=O(g(),1);var OI=_I.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{store:X}=v5(),z=Z1(Q.id);return U0(()=>{return X.set("descriptionElementId",z),()=>{X.set("descriptionElementId",void 0)}},[X,z]),F0("p",Z,{ref:H,props:[{id:z},Q]})});var jI=O(g(),1);var TI=jI.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q=!1,nativeButton:X=!0,...z}=Z,{buttonRef:G,getButtonProps:F}=u5({disabled:Q,focusableWhenDisabled:!1,native:X}),{store:U}=v5();return F0("button",Z,{ref:[H,G],props:[{onClick(K){U.setOpen(!1,M0(G0.closePress,K.nativeEvent,K.currentTarget))}},z,F]})});var wI=O(g(),1);var CI=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var F00={activationDirection:($)=>$?{"data-activation-direction":$}:null},EI=wI.forwardRef(function(Z,H){let{render:B,className:J,children:Q,...X}=Z,{store:z}=v5(),{side:G}=QZ(),F=z.useState("instantType"),{children:U,state:Y}=X$({store:z,side:G,cssVars:CI,children:Q}),K={activationDirection:Y.activationDirection,transitioning:Y.transitioning,instant:F};return F0("div",Z,{state:K,ref:H,props:[X,{children:U}],stateAttributesMapping:F00})});class LF{constructor(){this.store=new JZ}open($){let Z=$?this.store.context.triggerElements.getById($)??void 0:void 0;if($&&!Z)throw Error(E0(80,$));this.store.setOpen(!0,M0(G0.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,M0(G0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function SI(){return new LF}var X7=O(c(),1);function AF({...$}){return X7.jsx(f3.Root,{"data-slot":"popover",...$})}function VF({...$}){return X7.jsx(f3.Trigger,{"data-slot":"popover-trigger",...$})}function DF({className:$,align:Z="center",alignOffset:H=0,disableAnchorTracking:B=!1,positionMethod:J="absolute",side:Q="bottom",sideOffset:X=4,keepMounted:z=!1,container:G,...F}){return X7.jsx(f3.Portal,{keepMounted:z,container:G,children:X7.jsx(f3.Positioner,{align:Z,alignOffset:H,disableAnchorTracking:B,positionMethod:J,side:Q,sideOffset:X,className:"isolate z-50",children:X7.jsx(f3.Popup,{"data-slot":"popover-content",className:s("z-50 flex w-72 origin-(--transform-origin) flex-col gap-3 rounded-lg bg-popover p-3 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...F})})})}function II({className:$,...Z}){return X7.jsx("div",{"data-slot":"popover-header",className:s("flex flex-col gap-0.5 text-sm",$),...Z})}var SF=O(g(),1);var m3={};O4(m3,{Value:()=>hI,Track:()=>fI,Thumb:()=>lI,Root:()=>bI,Indicator:()=>iI,Control:()=>vI});var g5=O(g(),1);var RI=O(g(),1);function qF($,Z){let H=RI.useRef($),B=Y0(Z);U0(()=>{if(H.current===$)return;B(H.current)},[$,B]),U0(()=>{H.current=$},[$])}function f2($,Z=Number.MIN_SAFE_INTEGER,H=Number.MAX_SAFE_INTEGER){return Math.max(Z,Math.min($,H))}function ML($,Z,H=(B,J)=>B===J){return $.length===Z.length&&$.every((B,J)=>H(B,Z[J]))}function MF($,Z){return $-Z}function kI($,Z,H){let B=$.slice();return B[Z]=H,B.sort(MF)}function PF($,Z,H,B,J,Q){let X=$;if(X=f2(X,H,B),J)X=kI(Q,Z,f2(X,Q[Z-1]||-1/0,Q[Z+1]||1/0));return X}function _F($,Z,H){if(!Array.isArray($))return!0;let B=$.reduce((J,Q,X,z)=>{if(X===z.length-1)return J;return J.push(Math.abs(Q-z[X+1])),J},[]);return Math.min(...B)>=Z*H}var Q8={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...h2};var OF=O(g(),1),PL=OF.createContext(void 0);function W9(){let $=OF.useContext(PL);if($===void 0)throw Error(E0(62));return $}var _L=O(c(),1);function U00($){return"key"in $?G0.keyboard:G0.inputChange}function Y00($,Z){if(typeof $==="number"&&typeof Z==="number")return $===Z;if(Array.isArray($)&&Array.isArray(Z))return ML($,Z);return!1}var bI=g5.forwardRef(function(Z,H){let{"aria-labelledby":B,className:J,defaultValue:Q,disabled:X=!1,id:z,format:G,largeStep:F=10,locale:U,render:Y,max:K=100,min:W=0,minStepsBetweenValues:N=0,name:L,onValueChange:V,onValueCommitted:A,orientation:D="horizontal",step:q=1,thumbCollisionBehavior:_="push",thumbAlignment:M="center",value:P,...T}=Z,R=Z1(z),y=Y0(V),w=Y0(A),{clearErrors:h}=o4(),{state:E,disabled:I,name:j,setTouched:S,setDirty:k,validityData:b,shouldValidateOnChange:v,validation:u}=h5(),{labelId:C}=N2(),t=B??C,H0=I||X,x=j??L,[e,L0]=s4({controlled:P,default:Q??W,name:"Slider"}),d=g5.useRef(null),X0=g5.useRef(null),K0=g5.useRef([]),Q0=g5.useRef(null),z0=g5.useRef(null),A0=g5.useRef(-1),i=g5.useRef(null),B0=g5.useRef(null),$0=g5.useRef("none"),J0=w5(G),[n,f]=g5.useState(-1),[l,m]=g5.useState(-1),[a,o]=g5.useState(!1),[D0,O0]=g5.useState(()=>new Map),[k0,r0]=g5.useState([void 0,void 0]),p=Y0((R0)=>{if(f(R0),R0!==-1)m(R0)});V$({id:R,commit:u.commit,value:e,controlRef:X0,name:x,getValue:()=>e}),qF(e,()=>{if(h(x),v())u.commit(e);else u.commit(e,!0);let R0=b.initialValue,d0;if(Array.isArray(e)&&Array.isArray(R0))d0=!ML(e,R0);else d0=e!==R0;k(d0)});let r=Y0((R0)=>{if(R0)X0.current=R0}),Z0=Array.isArray(e),V0=g5.useMemo(()=>{if(!Z0)return[f2(e,W,K)];return e.slice().sort(MF)},[K,W,Z0,e]),j0=Y0((R0,d0)=>{if(Number.isNaN(R0)||Y00(R0,e))return;let p0=d0??M0(G0.none,void 0,void 0,{activeThumbIndex:-1});$0.current=p0.reason;let s0=p0.event,b0=new(s0.constructor??Event)(s0.type,s0);if(Object.defineProperty(b0,"target",{writable:!0,value:{value:R0,name:x}}),p0.event=b0,B0.current=R0,y(R0,p0),p0.isCanceled)return;L0(R0)}),v0=Y0((R0,d0,p0)=>{let s0=PF(R0,d0,W,K,Z0,V0);if(_F(s0,q,N)){let N0=U00(p0);j0(s0,M0(N0,p0.nativeEvent,void 0,{activeThumbIndex:d0})),S(!0);let b0=B0.current??s0;w(b0,aQ(N0,p0.nativeEvent))}});if(U0(()=>{let R0=Z5(m0(d.current));if(H0&&R0&&d.current?.contains(R0))R0.blur()},[H0]),H0&&n!==-1)p(-1);let z1=g5.useMemo(()=>({...E,activeThumbIndex:n,disabled:H0,dragging:a,orientation:D,max:K,min:W,minStepsBetweenValues:N,step:q,values:V0}),[E,n,H0,a,K,W,N,D,q,V0]),Y1=g5.useMemo(()=>({active:n,controlRef:X0,disabled:H0,dragging:a,validation:u,formatOptionsRef:J0,handleInputChange:v0,indicatorPosition:k0,inset:M!=="center",labelId:t,largeStep:F,lastUsedThumbIndex:l,lastChangedValueRef:B0,lastChangeReasonRef:$0,locale:U,max:K,min:W,minStepsBetweenValues:N,name:x,onValueCommitted:w,orientation:D,pressedInputRef:Q0,pressedThumbCenterOffsetRef:z0,pressedThumbIndexRef:A0,pressedValuesRef:i,registerFieldControlRef:r,renderBeforeHydration:M==="edge",setActive:p,setDragging:o,setIndicatorPosition:r0,setValue:j0,state:z1,step:q,thumbCollisionBehavior:_,thumbMap:D0,thumbRefs:K0,values:V0}),[n,X0,t,H0,a,u,J0,v0,k0,F,l,B0,$0,U,K,W,N,x,w,D,Q0,z0,A0,i,r,p,o,r0,j0,z1,q,_,M,D0,K0,V0]),c0=F0("div",Z,{state:z1,ref:[H,d],props:[{"aria-labelledby":t,id:R,role:"group"},u.getValidationProps,T],stateAttributesMapping:Q8});return _L.jsx(PL.Provider,{value:Y1,children:_L.jsx(aG,{elementsRef:K0,onMapChange:O0,children:c0})})});var XZ=O(g(),1);var yI=new Map;function K00($,Z){let H=JSON.stringify({locale:$,options:Z}),B=yI.get(H);if(B)return B;let J=new Intl.NumberFormat($,Z);return yI.set(H,J),J}function z7($,Z,H){if($==null)return"";return K00(Z,H).format($)}var hI=XZ.forwardRef(function(Z,H){let{"aria-live":B="off",render:J,className:Q,children:X,...z}=Z,{thumbMap:G,state:F,values:U,formatOptionsRef:Y,locale:K}=W9(),W=XZ.useMemo(()=>{let A="";for(let D of G.values())if(D?.inputId)A+=`${D.inputId} `;return A.trim()===""?void 0:A.trim()},[G]),N=XZ.useMemo(()=>{let A=[];for(let D=0;D<U.length;D+=1)A.push(z7(U[D],K,Y.current??void 0));return A},[Y,K,U]),L=XZ.useMemo(()=>{let A=[];for(let D=0;D<U.length;D+=1)A.push(N[D]||U[D]);return A.join(" – ")},[U,N]);return F0("output",Z,{state:F,ref:H,props:[{"aria-live":B,children:typeof X==="function"?X(N,U):L,htmlFor:W},z],stateAttributesMapping:Q8})});var j8=O(g(),1);function jF($){let Z=$.getBoundingClientRect();return{x:(Z.left+Z.right)/2,y:(Z.top+Z.bottom)/2}}function W00($){if(Math.abs($)<1){let H=$.toExponential().split("e-"),B=H[0].split(".")[1];return(B?B.length:0)+parseInt(H[1],10)}let Z=$.toString().split(".")[1];return Z?Z.length:0}function TF($,Z,H){let B=Math.round(($-H)/Z)*Z+H;return Number(B.toFixed(W00(Z)))}function OL({values:$,index:Z,nextValue:H,min:B,max:J,step:Q,minStepsBetweenValues:X,initialValues:z}){if($.length===0)return[];let G=$.slice(),F=Q*X,U=G.length-1,Y=z??$,K=B+Z*F,W=J-(U-Z)*F;G[Z]=f2(H,K,W);for(let N=Z+1;N<=U;N+=1){let L=G[N-1]+F,V=J-(U-N)*F,A=Y[N]??G[N],D=Math.max(G[N],L);if(A<D)D=Math.max(A,L);G[N]=f2(D,L,V)}for(let N=Z-1;N>=0;N-=1){let L=G[N+1]-F,V=B+N*F,A=Y[N]??G[N],D=Math.min(G[N],L);if(A>D)D=Math.min(A,L);G[N]=f2(D,V,L)}for(let N=0;N<=U;N+=1)G[N]=Number(G[N].toFixed(12));return G}function xI({behavior:$,values:Z,currentValues:H,initialValues:B,pressedIndex:J,nextValue:Q,min:X,max:z,step:G,minStepsBetweenValues:F}){let U=H??Z,Y=B??Z;if(!(U.length>1))return{value:Q,thumbIndex:0,didSwap:!1};let W=G*F;switch($){case"swap":{let N=U[J],L=0.0000001,V=U.slice(),A=V[J-1],D=V[J+1],q=A!=null?A+W:X,_=D!=null?D-W:z,M=f2(Q,q,_),P=Number(M.toFixed(12));V[J]=P;let T=Q>N,R=Q<N,y=T&&D!=null&&Q>=D-0.0000001,w=R&&A!=null&&Q<=A+0.0000001;if(!y&&!w)return{value:V,thumbIndex:J,didSwap:!1};let h=y?J+1:J-1,E=V.map((k,b)=>{if(b===J)return P;let v=Y[b];if(v!=null)return v;return U[b]}),I=Q;if(y)I=Math.max(Q,V[h]);else I=Math.min(Q,V[h]);let j=OL({values:V,index:h,nextValue:I,min:X,max:z,step:G,minStepsBetweenValues:F,initialValues:E}),S=y?h-1:h+1;if(S>=0&&S<j.length){let k=j[S-1],b=j[S+1],v=k!=null?k+W:X;v=Math.max(v,X+S*W);let u=b!=null?b-W:z;u=Math.min(u,z-(j.length-1-S)*W);let C=f2(P,v,u);j[S]=Number(C.toFixed(12))}return{value:j,thumbIndex:h,didSwap:!0}}case"push":return{value:OL({values:U,index:J,nextValue:Q,min:X,max:z,step:G,minStepsBetweenValues:F}),thumbIndex:J,didSwap:!1};case"none":default:{let N=U.slice(),L=N[J-1],V=N[J+1],A=L!=null?L+W:X,D=V!=null?V-W:z,q=f2(Q,A,D);return N[J]=Number(q.toFixed(12)),{value:N,thumbIndex:J,didSwap:!1}}}}var N00=2;function L00($,Z){if(!$)return{start:0,end:0};function H(Q){let X=Q!=null?parseFloat(Q):0;return Number.isNaN(X)?0:X}let B=!Z?"InlineStart":"Top",J=!Z?"InlineEnd":"Bottom";return{start:H($[`border${B}Width`])+H($[`padding${B}`]),end:H($[`border${J}Width`])+H($[`padding${J}`])}}function CF($,Z){if(Z.current!=null&&$.changedTouches){let H=$;for(let B=0;B<H.changedTouches.length;B+=1){let J=H.changedTouches[B];if(J.identifier===Z.current)return{x:J.clientX,y:J.clientY}}return null}return{x:$.clientX,y:$.clientY}}var vI=j8.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{disabled:X,dragging:z,validation:G,inset:F,lastChangedValueRef:U,lastChangeReasonRef:Y,max:K,min:W,minStepsBetweenValues:N,onValueCommitted:L,orientation:V,pressedInputRef:A,pressedThumbCenterOffsetRef:D,pressedThumbIndexRef:q,pressedValuesRef:_,registerFieldControlRef:M,renderBeforeHydration:P,setActive:T,setDragging:R,setValue:y,state:w,step:h,thumbCollisionBehavior:E,thumbRefs:I,values:j}=W9(),S=i4(),k=j.length>1,b=V==="vertical",v=j8.useRef(null),u=j8.useRef(null),C=Y0((J0)=>{if(J0&&u.current==null){if(u.current==null)u.current=getComputedStyle(J0)}}),t=j8.useRef(null),H0=j8.useRef(0),x=j8.useRef(0),e=w5(j),L0=Y0((J0)=>{if(q.current!==J0)q.current=J0;let n=I.current[J0];if(!n){D.current=null,A.current=null;return}A.current=n.querySelector('input[type="range"]')}),d=Y0((J0)=>{let n=v.current;if(!n)return null;let{width:f,height:l,bottom:m,left:a,right:o}=n.getBoundingClientRect(),D0=L00(u.current,b),O0=x.current,k0=(b?l:f)-D0.start-D0.end-O0*2,r0=D.current??0,p=J0.x-r0,r=J0.y-r0,Z0=b?m-r-D0.end:(S==="rtl"?o-p:p-a)-D0.start,V0=f2((Z0-O0)/k0,0,1),j0=(K-W)*V0+W;if(j0=TF(j0,h,W),j0=f2(j0,W,K),!k)return{value:j0,thumbIndex:0,didSwap:!1};let v0=q.current;if(v0<0)return null;let z1=xI({behavior:E,values:j,currentValues:e.current??j,initialValues:_.current,pressedIndex:v0,nextValue:j0,min:W,max:K,step:h,minStepsBetweenValues:N});if(E==="swap"&&z1.didSwap)L0(z1.thumbIndex);else q.current=z1.thumbIndex;return z1}),X0=Y0((J0)=>{_.current=k?j.slice():null,e.current=j;let n=q.current,f=n;if(n>-1&&n<j.length){if(j[n]===K){let l=n;while(l>0&&j[l-1]===K)l-=1;f=l}}else{let l=!b?"x":"y",m;f=-1;for(let a=0;a<I.current.length;a+=1){let o=I.current[a];if(T1(o)){let D0=jF(o),O0=Math.abs(J0[l]-D0[l]);if(m===void 0||O0<=m)f=a,m=O0}}}if(f>-1&&f!==n)L0(f);if(F){let l=I.current[f];if(T1(l)){let m=l.getBoundingClientRect(),a=!b?"width":"height";x.current=m[a]/2}}}),K0=Y0((J0)=>{I.current?.[J0]?.querySelector('input[type="range"]')?.focus({preventScroll:!0})}),Q0=Y0((J0)=>{let n=CF(J0,t);if(n==null)return;if(H0.current+=1,J0.type==="pointermove"&&J0.buttons===0){z0(J0);return}let f=d(n);if(f==null)return;if(_F(f.value,h,N)){if(!z&&H0.current>N00)R(!0);if(y(f.value,M0(G0.drag,J0,void 0,{activeThumbIndex:f.thumbIndex})),e.current=Array.isArray(f.value)?f.value:[f.value],f.didSwap)K0(f.thumbIndex)}});function z0(J0){T(-1),R(!1),A.current=null,D.current=null;let n=CF(J0,t),f=n!=null?d(n):null;if(f!=null){let l=Y.current;G.commit(U.current??f.value),L(U.current??f.value,aQ(l,J0))}if("pointerType"in J0&&v.current?.hasPointerCapture(J0.pointerId))v.current?.releasePointerCapture(J0.pointerId);q.current=-1,t.current=null,_.current=null,i()}let A0=Y0((J0)=>{if(X)return;let n=J0.changedTouches[0];if(n!=null)t.current=n.identifier;let f=CF(J0,t);if(f!=null){X0(f);let m=d(f);if(m==null)return;if(K0(m.thumbIndex),y(m.value,M0(G0.trackPress,J0,void 0,{activeThumbIndex:m.thumbIndex})),e.current=Array.isArray(m.value)?m.value:[m.value],m.didSwap)K0(m.thumbIndex)}H0.current=0;let l=m0(v.current);l.addEventListener("touchmove",Q0,{passive:!0}),l.addEventListener("touchend",z0,{passive:!0})}),i=Y0(()=>{let J0=m0(v.current);J0.removeEventListener("pointermove",Q0),J0.removeEventListener("pointerup",z0),J0.removeEventListener("touchmove",Q0),J0.removeEventListener("touchend",z0),_.current=null}),B0=G4();return j8.useEffect(()=>{let J0=v.current;if(!J0)return()=>i();return J0.addEventListener("touchstart",A0,{passive:!0}),()=>{J0.removeEventListener("touchstart",A0),B0.cancel(),i()}},[i,A0,v,B0]),j8.useEffect(()=>{if(X)i()},[X,i]),F0("div",Z,{state:w,ref:[H,M,v,C],props:[{["data-base-ui-slider-control"]:P?"":void 0,onPointerDown(J0){let n=v.current;if(!n||X||J0.defaultPrevented||!T1(J0.target)||J0.button!==0)return;let f=CF(J0,t);if(f!=null){X0(f);let m=d(f);if(m==null)return;if(f0(I.current[m.thumbIndex],Z5(m0(n))))J0.preventDefault();else B0.request(()=>{K0(m.thumbIndex)});if(R(!0),D.current==null){if(y(m.value,M0(G0.trackPress,J0.nativeEvent,void 0,{activeThumbIndex:m.thumbIndex})),e.current=Array.isArray(m.value)?m.value:[m.value],m.didSwap)K0(m.thumbIndex)}}if(J0.nativeEvent.pointerId)n.setPointerCapture(J0.nativeEvent.pointerId);H0.current=0;let l=m0(v.current);l.addEventListener("pointermove",Q0,{passive:!0}),l.addEventListener("pointerup",z0,{once:!0})},tabIndex:-1},Q],stateAttributesMapping:Q8})});var gI=O(g(),1);var fI=gI.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{state:X}=W9();return F0("div",Z,{state:X,ref:H,props:[{style:{position:"relative"}},Q],stateAttributesMapping:Q8})});var D4=O(g(),1);function fB($,Z,H){return($-Z)*100/(H-Z)}var wF=O(g(),1),A00=wF.createContext(void 0),V00={disableStyleElements:!1};function mI(){return wF.useContext(A00)??V00}var pI=function($){return $.index="data-index",$.dragging="data-dragging",$.orientation="data-orientation",$.disabled="data-disabled",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.focused="data-focused",$}({});var uI='!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();';var mB=O(c(),1),cI="PageUp",dI="PageDown",D00=new Set([gH,fH,mH,pH,uH,cH,cI,dI]);function q00($,Z,H,B){if(Z<0)return;if($.length===2){if(Z===0)return`${z7($[Z],B,H)} start range`;return`${z7($[Z],B,H)} end range`}return H?z7($[Z],B,H):void 0}function zZ($,Z,H,B,J){return H===1?Math.min($+Z,J):Math.max($-Z,B)}var lI=D4.forwardRef(function(Z,H){let{render:B,children:J,className:Q,"aria-describedby":X,"aria-label":z,"aria-labelledby":G,disabled:F=!1,getAriaLabel:U,getAriaValueText:Y,id:K,index:W,inputRef:N,onBlur:L,onFocus:V,onKeyDown:A,tabIndex:D,...q}=Z,{nonce:_}=mI(),M=Z1(K),{active:P,lastUsedThumbIndex:T,controlRef:R,disabled:y,validation:w,formatOptionsRef:h,handleInputChange:E,inset:I,labelId:j,largeStep:S,locale:k,max:b,min:v,minStepsBetweenValues:u,name:C,orientation:t,pressedInputRef:H0,pressedThumbCenterOffsetRef:x,pressedThumbIndexRef:e,renderBeforeHydration:L0,setActive:d,setIndicatorPosition:X0,state:K0,step:Q0,values:z0}=W9(),A0=i4(),i=F||y,B0=z0.length>1,$0=t==="vertical",J0=A0==="rtl",{setTouched:n,setFocused:f,validationMode:l}=h5(),m=D4.useRef(null),a=D4.useRef(null),o=Z1(),D0=A$(),O0=B0?o:D0,k0=D4.useMemo(()=>({inputId:O0}),[O0]),{ref:r0,index:p}=V4({metadata:k0}),r=!B0?0:W??p,Z0=r===z0.length-1,V0=z0[r],j0=fB(V0,v,b),[v0,z1]=D4.useState(!1),[Y1,c0]=D4.useState();E2(()=>z1(!0));let R0=T>=0&&T<z0.length?T:-1,d0=Y0(()=>{let T0=R.current,I0=m.current;if(!T0||!I0)return;let g0=I0.getBoundingClientRect(),e0=T0.getBoundingClientRect(),l0=$0?"height":"width",L1=e0[l0]-g0[l0],m1=(g0[l0]/2+L1*j0/100)/e0[l0]*100;if(c0(m1),r===0)X0((M1)=>[m1,M1[1]]);else if(Z0)X0((M1)=>[M1[0],m1])});U0(()=>{if(I)queueMicrotask(d0)},[d0,I]),U0(()=>{if(I)d0()},[d0,I,j0]);let p0=D4.useCallback(()=>{let T0=$0?"bottom":"insetInlineStart",I0=$0?"left":"top",g0;if(B0){if(P===r)g0=2;else if(R0===r)g0=1}else if(P===r)g0=1;if(!I){if(!Number.isFinite(j0))return Y8;return{position:"absolute",[T0]:`${j0}%`,[I0]:"50%",translate:`${($0||!J0?-1:1)*50}% ${($0?1:-1)*50}%`,zIndex:g0}}return{["--position"]:`${Y1}%`,visibility:L0&&!v0||Y1===void 0?"hidden":void 0,position:"absolute",[T0]:"var(--position)",[I0]:"50%",translate:`${($0||!J0?-1:1)*50}% ${($0?1:-1)*50}%`,zIndex:g0}},[P,r,I,v0,Y1,B0,L0,J0,R0,j0,$0]),s0;if(t==="vertical")s0=J0?"vertical-rl":"vertical-lr";let N0=Y4({"aria-label":typeof U==="function"?U(r):z,"aria-labelledby":G??j,"aria-describedby":X,"aria-orientation":t,"aria-valuenow":V0,"aria-valuetext":typeof Y==="function"?Y(z7(V0,k,h.current??void 0),V0,r):q00(z0,r,h.current??void 0,k),disabled:i,id:O0,max:b,min:v,name:C,onChange(T0){E(T0.target.valueAsNumber,r,T0)},onFocus(){d(r),f(!0)},onBlur(){if(!m.current)return;if(d(-1),n(!0),f(!1),l==="onBlur")w.commit(PF(V0,r,v,b,B0,z0))},onKeyDown(T0){if(!D00.has(T0.key))return;if(U3.has(T0.key))T0.stopPropagation();let I0=null,g0=TF(V0,Q0,v);switch(T0.key){case gH:I0=zZ(g0,T0.shiftKey?S:Q0,1,v,b);break;case pH:I0=zZ(g0,T0.shiftKey?S:Q0,J0?-1:1,v,b);break;case fH:I0=zZ(g0,T0.shiftKey?S:Q0,-1,v,b);break;case mH:I0=zZ(g0,T0.shiftKey?S:Q0,J0?1:-1,v,b);break;case cI:I0=zZ(g0,S,1,v,b);break;case dI:I0=zZ(g0,S,-1,v,b);break;case cH:if(I0=b,B0)I0=Number.isFinite(z0[r+1])?z0[r+1]-Q0*u:b;break;case uH:if(I0=v,B0)I0=Number.isFinite(z0[r-1])?z0[r-1]+Q0*u:v;break;default:break}if(I0!==null)E(I0,r,T0),T0.preventDefault()},step:Q0,style:{...Y8,width:"100%",height:"100%",writingMode:s0},tabIndex:D??void 0,type:"range",value:V0??""},w.getInputValidationProps),b0=T4(a,w.inputRef,N);return F0("div",Z,{state:K0,ref:[H,r0,m],props:[{[pI.index]:r,children:mB.jsxs(D4.Fragment,{children:[J,mB.jsx("input",{ref:b0,...N0}),I&&!v0&&L0&&Z0&&mB.jsx("script",{nonce:_,dangerouslySetInnerHTML:{__html:uI},suppressHydrationWarning:!0})]}),id:M,onBlur:L,onFocus:V,onPointerDown(T0){if(e.current=r,m.current!=null){let I0=t==="horizontal"?"x":"y",g0=jF(m.current),e0=(t==="horizontal"?T0.clientX:T0.clientY)-g0[I0];x.current=e0}if(a.current!=null&&H0.current!==a.current)H0.current=a.current},style:p0(),suppressHydrationWarning:L0||void 0,tabIndex:-1},q],stateAttributesMapping:Q8})});var EF=O(g(),1);function M00($,Z,H,B,J,Q){let X=H===void 0||Z&&B===void 0?"hidden":void 0,z=$?"bottom":"insetInlineStart",G=$?"height":"width",U={visibility:J&&!Q?"hidden":X,position:$?"absolute":"relative",[$?"width":"height"]:"inherit"};if(U["--start-position"]=`${H??0}%`,!Z)return U[z]=0,U[G]="var(--start-position)",U;return U["--relative-size"]=`${(B??0)-(H??0)}%`,U[z]="var(--start-position)",U[G]="var(--relative-size)",U}function P00($,Z,H,B){let J=$?"bottom":"insetInlineStart",Q=$?"height":"width",z={position:$?"absolute":"relative",[$?"width":"height"]:"inherit"};if(!Z)return z[J]=0,z[Q]=`${H}%`,z;let G=B-H;return z[J]=`${H}%`,z[Q]=`${G}%`,z}var iI=EF.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{indicatorPosition:X,inset:z,max:G,min:F,orientation:U,renderBeforeHydration:Y,state:K,values:W}=W9(),[N,L]=EF.useState(!1);E2(()=>L(!0));let V=U==="vertical",A=W.length>1,D=z?M00(V,A,X[0],X[1],Y,N):P00(V,A,fB(W[0],F,G),fB(W[W.length-1],F,G));return F0("div",Z,{state:K,ref:H,props:[{["data-base-ui-slider-indicator"]:Y?"":void 0,style:D,suppressHydrationWarning:Y||void 0},Q],stateAttributesMapping:Q8})});var G7=O(c(),1);function rI({children:$,className:Z,defaultValue:H,value:B,min:J=0,max:Q=100,...X}){let[z,G]=SF.useState(!1),F=Array.isArray(B)?B:Array.isArray(H)?H:[J,Q];return SF.useEffect(()=>{let U=requestAnimationFrame(()=>G(!0));return()=>cancelAnimationFrame(U)},[]),G7.jsx(m3.Root,{className:s("data-horizontal:w-full data-vertical:h-full",Z),"data-slot":"slider",defaultValue:H,value:B,min:J,max:Q,thumbAlignment:"edge",...X,children:G7.jsxs(m3.Control,{className:"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",children:[G7.jsx(m3.Track,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-muted select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",children:G7.jsx(m3.Indicator,{"data-slot":"slider-range",className:s("bg-primary select-none data-horizontal:h-full data-vertical:w-full",z&&"transition-[width] duration-150 ease-in-out")})}),$,Array.from({length:F.length},(U,Y)=>G7.jsx(m3.Thumb,{"data-slot":"slider-thumb",className:s("relative block size-3 shrink-0 cursor-ew-resize rounded-full border border-ring bg-white ring-ring/50 select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50",z&&"transition-[inset-inline-start,color,box-shadow] duration-150 ease-in-out")},Y))]})})}var U1=O(c(),1);function _00($){return $?.split(/\s*·\s*/)[0]??""}function aI($){return _00($.description)||$.displayName}function O00($){return $.charAt(0).toUpperCase()+$.slice(1)}function j00($){return $==="xhigh"?"Extra":O00($)}function nI($){return typeof $==="number"?$:$[0]??0}var oI={from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},sI={type:"spring",duration:0.3,delay:0.1,bounce:0};function eI({label:$,leadingIcon:Z,className:H,...B}){return U1.jsxs(C0,{...B,variant:"ghost",className:s("group/picker max-w-56 min-w-0 px-2 text-muted-foreground hover:text-muted-foreground",H),children:[Z,U1.jsx("span",{className:"truncate font-normal",children:$})]})}function T00({current:$,model:Z,models:H,onValueChange:B}){let J=aI(Z),Q=US(H,"Models");return U1.jsxs(e$,{children:[U1.jsx($Z,{render:U1.jsx(eI,{label:J,className:"shrink","aria-label":`Model: ${J}`})}),U1.jsx(ZZ,{align:"end",side:"top",className:"w-max max-w-64 min-w-40",children:U1.jsx(HI,{value:$,onValueChange:B,children:Q.map((X)=>U1.jsxs(HZ,{children:[U1.jsx(UF,{children:X.label}),X.models.map((z)=>U1.jsx(BI,{value:z.value,closeOnClick:!0,children:aI(z)},z.value))]},X.label))})})]})}function C00({currentEffort:$,effortLevels:Z,fastMode:H,showFastMode:B,onFastModeChange:J,onValueChange:Q}){let X=XS(Z,$),[z,G]=GZ.useState(!1),[F,U]=GZ.useState(X),[Y,K]=GZ.useState(!1),N=Z[z?F:X]??$,L=j00(N),V=(D)=>{if(D)U(X);else K(!1);G(D)},A=(D)=>{let q=Z[D];if(q&&q!==$)Q(q)};return U1.jsxs(AF,{open:z,onOpenChange:V,children:[U1.jsx(VF,{render:U1.jsx(eI,{label:L,leadingIcon:H?U1.jsx(pB,{stroke:1.5}):void 0,"aria-label":`Effort: ${L}`})}),U1.jsxs(DF,{align:"end",side:"top",className:"w-64",disableAnchorTracking:!0,children:[U1.jsx(II,{className:"relative h-5 flex-row items-center",children:U1.jsx(e2,{mode:"popLayout",initial:!1,children:Y?U1.jsxs(B5.div,{className:"flex h-5 w-full items-center justify-between text-sm text-muted-foreground","aria-hidden":"true",variants:oI,initial:"from",animate:"to",exit:"from",transition:sI,children:[U1.jsx("span",{children:"Faster"}),U1.jsx("span",{children:"Smarter"})]},"range"):U1.jsxs(B5.div,{className:"flex h-5 w-full items-center justify-between gap-2",variants:oI,initial:"from",animate:"to",exit:"from",transition:sI,children:[U1.jsxs("div",{className:"flex items-center gap-1",children:[U1.jsx("span",{className:"text-muted-foreground",children:"Effort"}),U1.jsx("output",{"aria-live":"polite",children:L})]}),B&&U1.jsxs(r1,{children:[U1.jsx(a1,{render:U1.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":H?"Turn off Fast mode":"Turn on Fast mode","aria-pressed":H,onClick:()=>J(!H),className:"-my-1 -mr-1",children:H?U1.jsx(tI,{className:"text-primary"}):U1.jsx(pB,{className:"text-muted-foreground",stroke:1.5})})}),U1.jsxs(n1,{align:"center",className:"flex-col gap-0",children:[U1.jsx("span",{children:"Fast mode"}),U1.jsx("span",{className:"font-normal text-muted-foreground",children:"More usage"})]})]})]},"effort")})}),U1.jsxs("label",{className:"block",children:[U1.jsx("span",{className:"sr-only",children:"Reasoning effort"}),U1.jsx(rI,{value:F,min:0,max:Z.length-1,step:1,onPointerDown:(D)=>{if(D.button===0)K(!0)},onPointerCancel:()=>K(!1),onValueChange:(D)=>U(nI(D)),onValueCommitted:(D)=>{K(!1),A(nI(D))},className:s("**:data-[slot=slider-track]:h-6 **:data-[slot=slider-track]:rounded-sm","**:data-[slot=slider-thumb]:h-6 **:data-[slot=slider-thumb]:w-5 **:data-[slot=slider-thumb]:rounded-sm **:data-[slot=slider-thumb]:border-0 **:data-[slot=slider-thumb]:bg-card **:data-[slot=slider-thumb]:shadow-xs **:data-[slot=slider-thumb]:ring-0"),children:U1.jsx("span",{"data-slot":"slider-marks","aria-hidden":"true",className:"absolute inset-x-2 flex items-center justify-between",children:Array.from({length:Z.length},(D,q)=>U1.jsx("span",{className:s("size-1 rounded-full",q<=F?"bg-primary-foreground/30":"bg-foreground/30")},q))})})]})]})]})}var $R=GZ.memo(function({sessionId:Z}){let{workspaceId:H,layout:B,setLayout:J}=K5(),{data:Q}=G9(H),X=Q?.models??[],z=X.find((y)=>y.value==="default"),G=Q?FS(X.filter((y)=>y.value!=="default"),Q.provider):[],F=yG(H,Z).data,U=JS(H),Y=(Z?F?.model:void 0)??B.selectedModel,K=(Z?F?.effort:void 0)??B.selectedEffort,W=(Z?F?.fastMode:void 0)??B.selectedFastMode,N=(y)=>{if(Z)U.mutate({sessionId:Z,patch:{model:y}});else J({selectedModel:y})},L=(y)=>{if(Z)U.mutate({sessionId:Z,patch:{effort:y}});else J({selectedEffort:y})},V=(y)=>{if(Z)U.mutate({sessionId:Z,patch:{fastMode:y}});else J({selectedFastMode:y})};if(G.length===0)return null;let A=G.some((y)=>y.value===Y)?Y:void 0,D=G.find((y)=>z?.resolvedModel&&y.resolvedModel===z.resolvedModel)??G[0],q=A??D.value,_=G.find((y)=>y.value===q)??G[0],M=_.supportsEffort?_.supportedEffortLevels??[]:[],P=eN(M,K,_.defaultEffort),T=zS(M)&&P!==void 0,R=GS(_,W);return U1.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[U1.jsx(T00,{current:q,model:_,models:G,onValueChange:N}),T&&U1.jsx(C00,{currentEffort:P,effortLevels:M,fastMode:R,showFastMode:_.supportsFastMode===!0,onFastModeChange:V,onValueChange:L},_.value)]})});var J1=O(c(),1);function HR({composerRef:$,onSend:Z,onStop:H,processing:B,sessionId:J,modelSessionId:Q,availability:X,annotation:z,onRemoveDrawing:G,allowFiles:F=!0,placeholder:U,draft:Y}){let K=FZ.useRef(null),W=H5(),N=j5((j)=>j.composerDrafts[W]??""),L=j5((j)=>Y?(j.viewBuilderDrafts??{})[Y.id]:void 0),V=Y?L??Y.initialValue:N,A=FZ.useRef(V);A.current=V;let D=t2((j)=>j.attachments[s2(W,J)]??w00),[q,_]=FZ.useState(!1),M=D.some((j)=>j.status==="uploading"),P=D.some((j)=>j.status==="ready"||j.status==="draft"),T=V.trim().length>0||P,R=RB(T,M,X),y=(j)=>{if(A.current=j,Y)Y.onChange(j);else j5.getState().setComposerDraft(W,j)},w=(j)=>{if(F)pw({workspaceId:W,sessionId:J},j)},h=FZ.useRef(!1),E=(j)=>{if(j.kind==="drawing"&&G){G(j.localId);return}E1.getState().removeAttachment(W,J,j.localId)},I=async()=>{if(!R||h.current)return;h.current=!0;try{if(await z?.finish(),await Z(A.current),!Y)A.current="",j5.getState().setComposerDraft(W,"")}finally{h.current=!1}};return J1.jsxs(dw,{composerRef:$,onSubmit:(j)=>{j.preventDefault(),I()},onDragOver:(j)=>{if(!j.dataTransfer.types.includes("Files"))return;if(j.preventDefault(),F)_(!0)},onDragLeave:(j)=>{if(!F)return;if(j.currentTarget.contains(j.relatedTarget))return;_(!1)},onDrop:(j)=>{if(!j.dataTransfer.types.includes("Files"))return;j.preventDefault(),_(!1),w(Array.from(j.dataTransfer.files))},className:s(q&&"ring-2 ring-ring/60"),children:[D.length>0&&J1.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-1",children:D.map((j)=>J1.jsx(E00,{attachment:j,onRemove:()=>E(j)},j.localId))}),J1.jsx(lw,{textareaRef:$,id:"chat-input",name:"message",value:V,onChange:(j)=>y(j.target.value),onKeyDown:(j)=>{if(j.key==="Enter"&&!j.shiftKey)j.preventDefault(),I()},onPaste:(j)=>{let S=Array.from(j.clipboardData?.files??[]);if(S.length===0)return;j.preventDefault(),w(S)},placeholder:B?"Queue a follow-up":U??"Do anything",rows:1}),J1.jsxs(iw,{children:[F&&J1.jsx("input",{ref:K,type:"file",multiple:!0,hidden:!0,onChange:(j)=>{w(Array.from(j.target.files??[])),j.target.value=""}}),J1.jsxs("div",{className:"mr-auto flex shrink-0 items-center gap-0.5",children:[F&&J1.jsxs(r1,{children:[J1.jsx(a1,{render:J1.jsx(C0,{type:"button",variant:"ghost",size:"icon",onClick:()=>K.current?.click(),"aria-label":"Attach files",children:J1.jsx(IF,{stroke:1.6,className:"size-4.5!"})})}),J1.jsx(n1,{children:"Attach files"})]}),z&&J1.jsxs(r1,{children:[J1.jsx(a1,{render:J1.jsx(C0,{type:"button",variant:"ghost",size:"icon",onClick:z.onToggle,className:s(z.active&&"bg-accent"),"aria-label":"Draw annotation","aria-pressed":z.active,children:J1.jsx(uB,{stroke:1.5})})}),J1.jsx(n1,{children:"Draw annotation"})]})]}),J1.jsx($R,{sessionId:Q}),B?J1.jsxs(r1,{children:[J1.jsx(a1,{render:J1.jsx(C0,{type:"button",size:"icon",onClick:H,"aria-label":"Stop agent",children:J1.jsx(ZR,{})})}),J1.jsx(n1,{children:"Stop answering"})]}):J1.jsx(rw,{label:"Send message",hasContent:T,busy:M,availability:X})]})]})}var w00=[];function E00({attachment:$,onRemove:Z}){if($.kind==="drawing")return J1.jsx(S00,{attachment:$,onRemove:Z});let{name:H,previewUrl:B,status:J,error:Q}=$,X=!!B;return J1.jsxs("div",{className:s("group relative flex items-center gap-2 overflow-hidden rounded-lg bg-accent text-accent-foreground ring-1 ring-border",X?"size-14":"h-10 max-w-52 pr-2 pl-2",J==="error"&&"border-destructive/50"),title:Q??H,children:[X?J1.jsx("img",{src:B,alt:H,className:"size-full object-cover"}):J1.jsxs(J1.Fragment,{children:[J1.jsx(UZ,{size:16,stroke:1.75,className:"shrink-0 text-muted-foreground"}),J1.jsx("span",{className:"truncate text-xs",children:H})]}),J==="uploading"&&J1.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/70",children:J1.jsx(I5,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),J==="error"&&J1.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-destructive/10 text-[10px] text-destructive",children:"Failed"}),J1.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,"aria-label":`Remove ${H}`,className:"absolute top-0.5 right-0.5 size-4 rounded-full bg-primary/70 text-primary-foreground opacity-0 transition-opacity group-hover:opacity-100 hover:bg-primary/80 [&_svg]:size-3",children:J1.jsx(S5,{stroke:1.75})})]})}function S00({attachment:$,onRemove:Z}){let{previewUrl:H,purpose:B}=$,J=B==="sketch"?"Sketch":"Annotation";return J1.jsxs(eE,{children:[J1.jsxs($S,{render:J1.jsx("div",{tabIndex:0,className:"group flex h-7 cursor-default items-center rounded-md bg-background pr-2 pl-0.5 text-sm whitespace-nowrap text-foreground ring-1 ring-border outline-none focus-visible:ring-3 focus-visible:ring-ring/50"}),children:[J1.jsxs(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,"aria-label":`Remove ${J.toLowerCase()}`,className:"size-6 shrink-0 hover:bg-transparent hover:text-current",children:[J1.jsx(uB,{stroke:1.75,className:"group-focus-within:hidden group-hover:hidden"}),J1.jsx(S5,{stroke:1.75,className:"hidden group-focus-within:block group-hover:block"})]}),J1.jsx("span",{children:J})]}),H&&J1.jsx(ZS,{side:"top",align:"start",className:"w-60 max-w-[calc(100vw-2rem)]",children:J1.jsx("img",{src:H,alt:`${J} preview`,className:"max-h-72 w-full rounded-md object-contain"})})]})}var F7=O(c(),1);function jL({className:$,prompt:Z,disabled:H=!1,onSelect:B}){let J=Z.icon;return F7.jsxs(C0,{type:"button",size:"sm",disabled:H,onClick:()=>B(Z),className:s("h-auto items-start justify-start gap-2 rounded-lg p-2 px-3 text-left leading-snug whitespace-normal",$),children:[F7.jsx(J,{stroke:2,"aria-hidden":!0,className:"mt-0.5"}),F7.jsx("span",{children:Z.label})]})}function BR({prompts:$,disabled:Z=!1,onSelect:H}){return F7.jsx("div",{className:"row-gap-2 grid w-full grid-cols-1 gap-x-3 gap-y-2 @md:grid-cols-3",children:$.map((B,J)=>{return F7.jsx(jL,{prompt:B,disabled:Z,onSelect:H,className:s("h-full w-fit @md:w-full",J===0&&"@md:translate-y-3 @md:rotate-3 @md:hover:translate-y-2.5",J===1&&"@md:-rotate-1",J===2&&"@md:translate-y-3 @md:-rotate-4 @md:hover:translate-y-2.5")},B.prompt)})})}var t1=O(c(),1),TL="Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or bundle, test, and runtime-log summaries.",I00=[{label:"Check the weather",prompt:"Build me a set of weather widgets that surface current conditions, today's hourly forecast, and a simple weekly outlook at a glance",context:["Build this onboarding example immediately without asking follow-up questions.","Create three separate widgets: current conditions, today's hourly forecast, and a seven-day outlook.","Use one shared Open-Meteo server function with no API key and use Berlin as the default location.","Give each widget an appropriate grid size and a compact, visually distinct layout with loading, error, and last-updated states.","Bundle all three widgets, smoke-test the shared weather function, and check runtime logs before finishing.",TL],icon:QR},{label:"Track my finances",prompt:"Build me a personal finance view for tracking income, expenses, monthly budgets, spending trends, and savings, with an agent action that can add sample transactions",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services or bank connections.","Create a responsive View with a month selector, income, spending, and savings summaries, an income-versus-spending trend, category breakdowns, budget progress, and recent transactions.","Support adding, editing, and deleting income and expense transactions, categories, and monthly category budgets.","Persist transactions, categories, and budgets in a workspace-local SQLite database accessed through server functions. Store monetary amounts as integer cents and seed realistic sample data only when the database is empty.","Add an “Add with agent” action that imports `sendChatMessage` from `moi` and sends a concise request for the agent to generate and insert a realistic batch of sample transactions into the same database.","Provide a small documented workspace script the agent can use to validate and append transactions safely, then refresh the View data after the agent updates the database.","Include loading, empty, and error states, then bundle the View and smoke-test its SQLite persistence and transaction mutations before finishing.",TL],icon:XR},{label:"Build a playful synthesizer",prompt:"Build me a view with a simple, playful synthesizer featuring a keyboard, five sound controls, and the ability to record, save, and load music files from the workspace",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services.","Create a responsive View that uses the browser's audio capabilities, with an onscreen piano and computer-keyboard controls.","Include five clearly labeled sound controls for waveform, attack, release, filter cutoff, and volume.","Let the user record timed note events, play and stop recordings, give them names, and save and load them as JSON music files in a workspace music folder.","Include clear empty and error states, then bundle the View and check runtime logs before finishing.",TL],icon:RF}],R00={label:"Explore the workspace",prompt:"Explore this workspace and suggest what moi can build based on its content",context:["Explore the existing workspace files before making suggestions.","Briefly explain what the workspace appears to be for and which content informed your ideas.","Propose a focused set of useful widgets or views that fit the work already here.","Wait for me to choose before building anything."],icon:JR};function zR({isViewBuilderDraft:$,hasSentMessageFromMoi:Z,isWorkspacePendingAnalysis:H}){if($)return"view-builder";if(!Z)return"welcome";if(H)return"explore-workspace";return"empty"}function GR({agent:$,kind:Z,hasWorkspaceApplets:H,disabled:B=!1,onSelectPrompt:J,onNavigate:Q}){switch(Z){case"view-builder":return t1.jsx(k00,{agent:$});case"welcome":return t1.jsx(b00,{agent:$,disabled:B,showExamples:!H,onSelectPrompt:J,onNavigate:Q});case"explore-workspace":return t1.jsx(y00,{agent:$,disabled:B,onSelectPrompt:J});case"empty":return t1.jsx(h00,{agent:$})}}function kF({agent:$,children:Z,className:H}){return t1.jsxs("div",{className:s("flex flex-1 flex-col items-center justify-center self-center",H),children:[t1.jsx(k3,{preset:$,color:"secondary",expression:"idle",size:64,className:"mb-2",animated:!0}),Z]})}function k00({agent:$}){return t1.jsx(kF,{agent:$,className:"text-center text-muted-foreground",children:t1.jsx("p",{className:"mx-auto max-w-xs px-8 text-sm",children:"Describe the content, data, and key actions you need in the view"})})}function b00({agent:$,disabled:Z=!1,showExamples:H=!0,onSelectPrompt:B,onNavigate:J}){return t1.jsx(kF,{agent:$,className:"@container w-full max-w-md min-w-0",children:t1.jsxs("div",{className:"mt-2 flex flex-col gap-4",children:[t1.jsxs("div",{className:"prose prose-sm min-w-0 wrap-anywhere prose-inherit",children:[t1.jsx("p",{children:"moi is the visual workspace for you and your agent. It grows and adapts to the work you're doing."}),t1.jsxs("p",{children:["Ask your agent to build"," ",t1.jsx(CL,{Icon:dB,destination:"widgets",onNavigate:J,children:"Widgets"})," ","that surface information and quick actions, or entire"," ",t1.jsx(CL,{Icon:cB,destination:"views",onNavigate:J,children:"Views"})," ","for more complex tools. Use"," ",t1.jsx(CL,{Icon:lB,destination:"scratchpad",onNavigate:J,children:"Scratchpad"})," ","for exploring and shaping ideas with your agent."]}),H&&t1.jsx("p",{children:"Try an example:"})]}),H&&t1.jsx(BR,{prompts:I00,disabled:Z,onSelect:B})]})})}function y00({agent:$,disabled:Z=!1,onSelectPrompt:H}){return t1.jsx(kF,{agent:$,children:t1.jsxs("div",{className:"flex flex-col items-center gap-4",children:[t1.jsx("div",{className:"prose prose-sm max-w-xs min-w-0 text-center wrap-anywhere prose-inherit",children:t1.jsx("p",{children:"Your agent can explore this workspace and suggest useful widgets and views based on what’s already here"})}),t1.jsx(jL,{prompt:R00,disabled:Z,onSelect:H})]})})}function h00({agent:$}){return t1.jsx(kF,{agent:$,className:"text-center text-muted-foreground",children:t1.jsx("p",{className:"mx-auto max-w-sm px-8 text-sm",children:"Chat with your agent, create widgets and views, and manage your workspace context from here"})})}function CL({Icon:$,children:Z,destination:H,onNavigate:B}){return t1.jsxs("button",{type:"button","data-welcome-destination":H,onClick:()=>B(H),className:"-mx-0.5 inline-flex cursor-pointer items-center gap-0.5 rounded-xs px-0.5 align-bottom font-medium text-foreground hover:bg-accent focus-visible:bg-accent focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring",children:[t1.jsx($,{size:16,stroke:1.75,"aria-hidden":!0}),Z]})}var iB=O(g(),1);var C1=O(c(),1);function KR({label:$}){return C1.jsx("div",{className:"flex h-7 items-center px-2.5 text-sm font-medium",children:$})}function x00($){if($.flavor==="cron"||$.flavor==="subagent")return $.flavor;let Z=$.origin?.provider.trim().toLowerCase();return Z?Z:null}function v00({active:$,canArchive:Z,confirmingArchive:H,onArchive:B,onRequestArchive:J,onSelect:Q,session:X,workspaceId:z}){let G=iB.useRef(!1),[F,U]=iB.useState(!1),Y=t2((L)=>yH(L.activity,z,X.sessionId)),K=x00(X);function W(){J(X.sessionId)}async function N(){if(G.current)return;G.current=!0,U(!0);try{await B(X.sessionId)}catch{r4.add({title:"Couldn’t archive chat",type:"error"})}finally{G.current=!1,U(!1)}}return C1.jsxs("div",{className:"group/chat relative",children:[C1.jsx(xB,{className:s("font-medium group-hover/chat:bg-accent group-hover/chat:text-accent-foreground",$&&"bg-accent text-accent-foreground"),onClick:()=>Q(X.sessionId),children:C1.jsx("div",{className:s("flex min-w-0 flex-1 overflow-hidden",(Y||F)&&"mr-4 mask-r-from-[calc(100%-16px)]",Z&&!H&&"group-focus-within/chat:mr-4 group-focus-within/chat:mask-r-from-[calc(100%-16px)] group-hover/chat:mr-4 group-hover/chat:mask-r-from-[calc(100%-16px)] [@media(hover:none)]:mr-4 [@media(hover:none)]:mask-r-from-[calc(100%-16px)]",H&&"mr-14 mask-r-from-[calc(100%-16px)]"),children:C1.jsxs("span",{className:s("flex min-w-0 items-baseline gap-1.5",(Y||F)&&"-mr-4",H?"-mr-14":Z&&"group-focus-within/chat:-mr-4 group-hover/chat:-mr-4 [@media(hover:none)]:-mr-4"),children:[C1.jsx("span",{className:"min-w-0 truncate",children:X.summary}),K&&C1.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:K})]})})}),Y&&C1.jsx(S4,{className:s("pointer-events-none absolute top-1/2 right-1.5 -translate-y-1/2 text-muted-foreground",Z&&"group-focus-within/chat:hidden group-hover/chat:hidden [@media(hover:none)]:hidden",(H||F)&&"hidden")}),Z&&C1.jsx("div",{className:s("absolute top-1/2 right-0 flex -translate-y-1/2 items-center opacity-100 transition-none",!H&&"group-focus-within/chat:opacity-100 group-hover/chat:opacity-100 [@media(hover:hover)]:opacity-0",F&&"opacity-100!"),children:H?C1.jsx(C0,{type:"button",variant:"secondary",size:"sm","aria-label":`Confirm archive ${X.summary}`,tabIndex:-1,className:"mr-1 h-5 rounded-sm px-1.5 text-xs hover:bg-accent",disabled:F,onClick:N,onPointerDown:(L)=>L.stopPropagation(),children:"Confirm"}):C1.jsxs(r1,{children:[C1.jsx(a1,{render:C1.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Archive ${X.summary}`,tabIndex:-1,className:"text-muted-foreground hover:bg-transparent hover:text-foreground",disabled:F,onClick:W,onPointerDown:(L)=>L.stopPropagation(),children:C1.jsx(UR,{stroke:1.75})})}),C1.jsx(n1,{side:"right",children:"Archive chat"})]})})]})}function g00($){return`${$.getFullYear()}-${$.getMonth()}-${$.getDate()}`}function FR($){return Date.UTC($.getFullYear(),$.getMonth(),$.getDate())/86400000}function f00($,Z){let H=FR(Z)-FR($);if(H===0)return"Today";if(H===1)return"Yesterday";if(H>=2&&H<=5)return`${H} days ago`;return $.toLocaleDateString([],{month:"short",day:"numeric",...$.getFullYear()===Z.getFullYear()?{}:{year:"numeric"}})}function m00($,Z=new Date){let H=new Map;for(let B of $.slice().sort((J,Q)=>Q.lastModified-J.lastModified)){let J=new Date(B.lastModified),Q=g00(J),X=H.get(Q);if(X){X.sessions.push(B);continue}H.set(Q,{key:Q,label:f00(J,Z),sessions:[B]})}return[...H.values()]}function WR({isViewBuilder:$=!1}){if($)return C1.jsx(KR,{label:"Build a new view"});return C1.jsx(p00,{})}function p00(){let $=H5(),[Z,H]=F3(),B=Z??null,[J,Q]=iB.useState(null),{data:X=[]}=bG($),z=G9($).data?.supportsArchiving===!0,G=HS($),F=t2((L)=>u_(L.activity,$,B));if(X.length===0)return C1.jsx(KR,{label:"New chat"});let Y=X.find((L)=>L.sessionId===B)?.summary??"New chat",K=m00(X);function W(L){if(!L)Q(null)}async function N(L){Q(null),await G.mutateAsync(L);let V=E1.getState();if(V.clearAttachments($,L),V.clearPreviewsForSession($,L),B===L)H(null)}return C1.jsxs(e$,{onOpenChange:W,children:[C1.jsx($Z,{render:C1.jsxs(C0,{className:"group",variant:"ghost",size:"sm",children:[C1.jsx("span",{className:"max-w-64 truncate",children:Y}),F?C1.jsx(S4,{className:"size-4!",stroke:2}):C1.jsx(bF,{className:"text-muted-foreground group-hover:text-foreground",stroke:1.75})]})}),C1.jsxs(ZZ,{align:"start",className:"flex max-h-100 w-max max-w-72 min-w-40 flex-col overflow-hidden",children:[C1.jsxs(xB,{className:"shrink-0 gap-1 font-medium text-muted-foreground! **:text-muted-foreground!",onClick:()=>H(null),children:[C1.jsx(YR,{size:16,stroke:1.75}),"New chat"]}),K.length>0&&C1.jsxs(C1.Fragment,{children:[C1.jsx(JI,{className:"shrink-0"}),C1.jsx("div",{className:"no-scrollbar flex min-h-0 flex-1 scroll-fade flex-col gap-1 overflow-y-auto overscroll-contain [--scroll-fade-reveal:8px]",children:K.map((L)=>C1.jsxs(HZ,{children:[C1.jsx(UF,{children:L.label}),L.sessions.map((V)=>C1.jsx(v00,{session:V,active:B===V.sessionId,canArchive:z,confirmingArchive:J===V.sessionId,onSelect:H,onArchive:N,onRequestArchive:Q,workspaceId:$},V.sessionId))]},L.key))})]})]})]})}var hv=O(g(),1);function g1(){}function yF(){}function NR($,Z){let H=Z||{};return($[$.length-1]===""?[...$,""]:$).join((H.padRight?" ":"")+","+(H.padLeft===!1?"":" ")).trim()}var u00=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,c00=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d00={};function hF($,Z){return((Z||d00).jsx?c00:u00).test($)}var l00=/[ \t\n\f\r]/g;function wL($){return typeof $==="object"?$.type==="text"?LR($.value):!1:LR($)}function LR($){return $.replace(l00,"")===""}class p3{constructor($,Z,H){if(this.normal=Z,this.property=$,H)this.space=H}}p3.prototype.normal={};p3.prototype.property={};p3.prototype.space=void 0;function EL($,Z){let H={},B={};for(let J of $)Object.assign(H,J.property),Object.assign(B,J.normal);return new p3(H,B,Z)}function rB($){return $.toLowerCase()}class _2{constructor($,Z){this.attribute=Z,this.property=$}}_2.prototype.attribute="";_2.prototype.booleanish=!1;_2.prototype.boolean=!1;_2.prototype.commaOrSpaceSeparated=!1;_2.prototype.commaSeparated=!1;_2.prototype.defined=!1;_2.prototype.mustUseProperty=!1;_2.prototype.number=!1;_2.prototype.overloadedBoolean=!1;_2.prototype.property="";_2.prototype.spaceSeparated=!1;_2.prototype.space=void 0;var aB={};O4(aB,{spaceSeparated:()=>e1,overloadedBoolean:()=>xF,number:()=>_0,commaSeparated:()=>u3,commaOrSpaceSeparated:()=>q4,booleanish:()=>f5,boolean:()=>F1});var i00=0,F1=U7(),f5=U7(),xF=U7(),_0=U7(),e1=U7(),u3=U7(),q4=U7();function U7(){return 2**++i00}var SL=Object.keys(aB);class YZ extends _2{constructor($,Z,H,B){let J=-1;super($,Z);if(AR(this,"space",B),typeof H==="number")while(++J<SL.length){let Q=SL[J];AR(this,SL[J],(H&aB[Q])===aB[Q])}}}YZ.prototype.defined=!0;function AR($,Z,H){if(H)$[Z]=H}function X8($){let Z={},H={};for(let[B,J]of Object.entries($.properties)){let Q=new YZ(B,$.transform($.attributes||{},B),J,$.space);if($.mustUseProperty&&$.mustUseProperty.includes(B))Q.mustUseProperty=!0;Z[B]=Q,H[rB(B)]=B,H[rB(Q.attribute)]=B}return new p3(Z,H,$.space)}var IL=X8({properties:{ariaActiveDescendant:null,ariaAtomic:f5,ariaAutoComplete:null,ariaBusy:f5,ariaChecked:f5,ariaColCount:_0,ariaColIndex:_0,ariaColSpan:_0,ariaControls:e1,ariaCurrent:null,ariaDescribedBy:e1,ariaDetails:null,ariaDisabled:f5,ariaDropEffect:e1,ariaErrorMessage:null,ariaExpanded:f5,ariaFlowTo:e1,ariaGrabbed:f5,ariaHasPopup:null,ariaHidden:f5,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:e1,ariaLevel:_0,ariaLive:null,ariaModal:f5,ariaMultiLine:f5,ariaMultiSelectable:f5,ariaOrientation:null,ariaOwns:e1,ariaPlaceholder:null,ariaPosInSet:_0,ariaPressed:f5,ariaReadOnly:f5,ariaRelevant:null,ariaRequired:f5,ariaRoleDescription:e1,ariaRowCount:_0,ariaRowIndex:_0,ariaRowSpan:_0,ariaSelected:f5,ariaSetSize:_0,ariaSort:null,ariaValueMax:_0,ariaValueMin:_0,ariaValueNow:_0,ariaValueText:null,role:null},transform($,Z){return Z==="role"?Z:"aria-"+Z.slice(4).toLowerCase()}});function vF($,Z){return Z in $?$[Z]:Z}function gF($,Z){return vF($,Z.toLowerCase())}var VR=X8({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:u3,acceptCharset:e1,accessKey:e1,action:null,allow:null,allowFullScreen:F1,allowPaymentRequest:F1,allowUserMedia:F1,alt:null,as:null,async:F1,autoCapitalize:null,autoComplete:e1,autoFocus:F1,autoPlay:F1,blocking:e1,capture:null,charSet:null,checked:F1,cite:null,className:e1,cols:_0,colSpan:null,content:null,contentEditable:f5,controls:F1,controlsList:e1,coords:_0|u3,crossOrigin:null,data:null,dateTime:null,decoding:null,default:F1,defer:F1,dir:null,dirName:null,disabled:F1,download:xF,draggable:f5,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:F1,formTarget:null,headers:e1,height:_0,hidden:xF,high:_0,href:null,hrefLang:null,htmlFor:e1,httpEquiv:e1,id:null,imageSizes:null,imageSrcSet:null,inert:F1,inputMode:null,integrity:null,is:null,isMap:F1,itemId:null,itemProp:e1,itemRef:e1,itemScope:F1,itemType:e1,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:F1,low:_0,manifest:null,max:null,maxLength:_0,media:null,method:null,min:null,minLength:_0,multiple:F1,muted:F1,name:null,nonce:null,noModule:F1,noValidate:F1,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:F1,optimum:_0,pattern:null,ping:e1,placeholder:null,playsInline:F1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:F1,referrerPolicy:null,rel:e1,required:F1,reversed:F1,rows:_0,rowSpan:_0,sandbox:e1,scope:null,scoped:F1,seamless:F1,selected:F1,shadowRootClonable:F1,shadowRootDelegatesFocus:F1,shadowRootMode:null,shape:null,size:_0,sizes:null,slot:null,span:_0,spellCheck:f5,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_0,step:null,style:null,tabIndex:_0,target:null,title:null,translate:null,type:null,typeMustMatch:F1,useMap:null,value:f5,width:_0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:e1,axis:null,background:null,bgColor:null,border:_0,borderColor:null,bottomMargin:_0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:F1,declare:F1,event:null,face:null,frame:null,frameBorder:null,hSpace:_0,leftMargin:_0,link:null,longDesc:null,lowSrc:null,marginHeight:_0,marginWidth:_0,noResize:F1,noHref:F1,noShade:F1,noWrap:F1,object:null,profile:null,prompt:null,rev:null,rightMargin:_0,rules:null,scheme:null,scrolling:f5,standby:null,summary:null,text:null,topMargin:_0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_0,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:F1,disableRemotePlayback:F1,prefix:null,property:null,results:_0,security:null,unselectable:null},space:"html",transform:gF});var DR=X8({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:q4,accentHeight:_0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_0,amplitude:_0,arabicForm:null,ascent:_0,attributeName:null,attributeType:null,azimuth:_0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_0,by:null,calcMode:null,capHeight:_0,className:e1,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:_0,diffuseConstant:_0,direction:null,display:null,dur:null,divisor:_0,dominantBaseline:null,download:F1,dx:null,dy:null,edgeMode:null,editable:null,elevation:_0,enableBackground:null,end:null,event:null,exponent:_0,externalResourcesRequired:null,fill:null,fillOpacity:_0,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:u3,g2:u3,glyphName:u3,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_0,horizOriginX:_0,horizOriginY:_0,id:null,ideographic:_0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_0,k:_0,k1:_0,k2:_0,k3:_0,k4:_0,kernelMatrix:q4,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_0,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:_0,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:_0,overlineThickness:_0,paintOrder:null,panose1:null,path:null,pathLength:_0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:e1,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_0,pointsAtY:_0,pointsAtZ:_0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:q4,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:q4,rev:q4,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:q4,requiredFeatures:q4,requiredFonts:q4,requiredFormats:q4,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:_0,specularExponent:_0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_0,strikethroughThickness:_0,string:null,stroke:null,strokeDashArray:q4,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_0,strokeOpacity:_0,strokeWidth:null,style:null,surfaceScale:_0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:q4,tabIndex:_0,tableValues:null,target:null,targetX:_0,targetY:_0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:q4,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_0,underlineThickness:_0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_0,values:null,vAlphabetic:_0,vMathematical:_0,vectorEffect:null,vHanging:_0,vIdeographic:_0,version:null,vertAdvY:_0,vertOriginX:_0,vertOriginY:_0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:vF});var RL=X8({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform($,Z){return"xlink:"+Z.slice(5).toLowerCase()}});var kL=X8({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:gF});var bL=X8({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform($,Z){return"xml:"+Z.slice(3).toLowerCase()}});var yL={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var r00=/[A-Z]/g,qR=/-[a-z]/g,a00=/^data[-\w.:]+$/i;function hL($,Z){let H=rB(Z),B=Z,J=_2;if(H in $.normal)return $.property[$.normal[H]];if(H.length>4&&H.slice(0,4)==="data"&&a00.test(Z)){if(Z.charAt(4)==="-"){let Q=Z.slice(5).replace(qR,o00);B="data"+Q.charAt(0).toUpperCase()+Q.slice(1)}else{let Q=Z.slice(4);if(!qR.test(Q)){let X=Q.replace(r00,n00);if(X.charAt(0)!=="-")X="-"+X;Z="data"+X}}J=YZ}return new J(B,Z)}function n00($){return"-"+$.toLowerCase()}function o00($){return $.charAt(1).toUpperCase()}var MR=EL([IL,VR,RL,kL,bL],"html"),fF=EL([IL,DR,RL,kL,bL],"svg");function PR($){return $.join(" ").trim()}var gR=O(yR(),1);var mF=hR("end"),KZ=hR("start");function hR($){return Z;function Z(H){let B=H&&H.position&&H.position[$]||{};if(typeof B.line==="number"&&B.line>0&&typeof B.column==="number"&&B.column>0)return{line:B.line,column:B.column,offset:typeof B.offset==="number"&&B.offset>-1?B.offset:void 0}}}function gL($){let Z=KZ($),H=mF($);if(Z&&H)return{start:Z,end:H}}function c3($){if(!$||typeof $!=="object")return"";if("position"in $||"type"in $)return xR($.position);if("start"in $||"end"in $)return xR($);if("line"in $||"column"in $)return fL($);return""}function fL($){return vR($&&$.line)+":"+vR($&&$.column)}function xR($){return fL($&&$.start)+"-"+fL($&&$.end)}function vR($){return $&&typeof $==="number"?$:1}class t5 extends Error{constructor($,Z,H){super();if(typeof Z==="string")H=Z,Z=void 0;let B="",J={},Q=!1;if(Z)if("line"in Z&&"column"in Z)J={place:Z};else if("start"in Z&&"end"in Z)J={place:Z};else if("type"in Z)J={ancestors:[Z],place:Z.position};else J={...Z};if(typeof $==="string")B=$;else if(!J.cause&&$)Q=!0,B=$.message,J.cause=$;if(!J.ruleId&&!J.source&&typeof H==="string"){let z=H.indexOf(":");if(z===-1)J.ruleId=H;else J.source=H.slice(0,z),J.ruleId=H.slice(z+1)}if(!J.place&&J.ancestors&&J.ancestors){let z=J.ancestors[J.ancestors.length-1];if(z)J.place=z.position}let X=J.place&&"start"in J.place?J.place.start:J.place;this.ancestors=J.ancestors||void 0,this.cause=J.cause||void 0,this.column=X?X.column:void 0,this.fatal=void 0,this.file="",this.message=B,this.line=X?X.line:void 0,this.name=c3(J.place)||"1:1",this.place=J.place||void 0,this.reason=this.message,this.ruleId=J.ruleId||void 0,this.source=J.source||void 0,this.stack=Q&&J.cause&&typeof J.cause.stack==="string"?J.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}t5.prototype.file="";t5.prototype.name="";t5.prototype.reason="";t5.prototype.message="";t5.prototype.stack="";t5.prototype.column=void 0;t5.prototype.line=void 0;t5.prototype.ancestors=void 0;t5.prototype.cause=void 0;t5.prototype.fatal=void 0;t5.prototype.place=void 0;t5.prototype.ruleId=void 0;t5.prototype.source=void 0;var mL={}.hasOwnProperty,_10=new Map,O10=/[A-Z]/g,j10=new Set(["table","tbody","thead","tfoot","tr"]),T10=new Set(["td","th"]),fR="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pL($,Z){if(!Z||Z.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let H=Z.filePath||void 0,B;if(Z.development){if(typeof Z.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");B=b10(H,Z.jsxDEV)}else{if(typeof Z.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof Z.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");B=k10(H,Z.jsx,Z.jsxs)}let J={Fragment:Z.Fragment,ancestors:[],components:Z.components||{},create:B,elementAttributeNameCase:Z.elementAttributeNameCase||"react",evaluater:Z.createEvaluater?Z.createEvaluater():void 0,filePath:H,ignoreInvalidStyle:Z.ignoreInvalidStyle||!1,passKeys:Z.passKeys!==!1,passNode:Z.passNode||!1,schema:Z.space==="svg"?fF:MR,stylePropertyNameCase:Z.stylePropertyNameCase||"dom",tableCellAlignToStyle:Z.tableCellAlignToStyle!==!1},Q=mR(J,$,void 0);if(Q&&typeof Q!=="string")return Q;return J.create($,J.Fragment,{children:Q||void 0},void 0)}function mR($,Z,H){if(Z.type==="element")return C10($,Z,H);if(Z.type==="mdxFlowExpression"||Z.type==="mdxTextExpression")return w10($,Z);if(Z.type==="mdxJsxFlowElement"||Z.type==="mdxJsxTextElement")return S10($,Z,H);if(Z.type==="mdxjsEsm")return E10($,Z);if(Z.type==="root")return I10($,Z,H);if(Z.type==="text")return R10($,Z)}function C10($,Z,H){let B=$.schema,J=B;if(Z.tagName.toLowerCase()==="svg"&&B.space==="html")J=fF,$.schema=J;$.ancestors.push(Z);let Q=uR($,Z.tagName,!1),X=y10($,Z),z=cL($,Z);if(j10.has(Z.tagName))z=z.filter(function(G){return typeof G==="string"?!wL(G):!0});return pR($,X,Q,Z),uL(X,z),$.ancestors.pop(),$.schema=B,$.create(Z,Q,X,H)}function w10($,Z){if(Z.data&&Z.data.estree&&$.evaluater){let B=Z.data.estree.body[0];return g1(B.type==="ExpressionStatement"),$.evaluater.evaluateExpression(B.expression)}oB($,Z.position)}function E10($,Z){if(Z.data&&Z.data.estree&&$.evaluater)return $.evaluater.evaluateProgram(Z.data.estree);oB($,Z.position)}function S10($,Z,H){let B=$.schema,J=B;if(Z.name==="svg"&&B.space==="html")J=fF,$.schema=J;$.ancestors.push(Z);let Q=Z.name===null?$.Fragment:uR($,Z.name,!0),X=h10($,Z),z=cL($,Z);return pR($,X,Q,Z),uL(X,z),$.ancestors.pop(),$.schema=B,$.create(Z,Q,X,H)}function I10($,Z,H){let B={};return uL(B,cL($,Z)),$.create(Z,$.Fragment,B,H)}function R10($,Z){return Z.value}function pR($,Z,H,B){if(typeof H!=="string"&&H!==$.Fragment&&$.passNode)Z.node=B}function uL($,Z){if(Z.length>0){let H=Z.length>1?Z:Z[0];if(H)$.children=H}}function k10($,Z,H){return B;function B(J,Q,X,z){let F=Array.isArray(X.children)?H:Z;return z?F(Q,X,z):F(Q,X)}}function b10($,Z){return H;function H(B,J,Q,X){let z=Array.isArray(Q.children),G=KZ(B);return Z(J,Q,X,z,{columnNumber:G?G.column-1:void 0,fileName:$,lineNumber:G?G.line:void 0},void 0)}}function y10($,Z){let H={},B,J;for(J in Z.properties)if(J!=="children"&&mL.call(Z.properties,J)){let Q=x10($,J,Z.properties[J]);if(Q){let[X,z]=Q;if($.tableCellAlignToStyle&&X==="align"&&typeof z==="string"&&T10.has(Z.tagName))B=z;else H[X]=z}}if(B){let Q=H.style||(H.style={});Q[$.stylePropertyNameCase==="css"?"text-align":"textAlign"]=B}return H}function h10($,Z){let H={};for(let B of Z.attributes)if(B.type==="mdxJsxExpressionAttribute")if(B.data&&B.data.estree&&$.evaluater){let Q=B.data.estree.body[0];g1(Q.type==="ExpressionStatement");let X=Q.expression;g1(X.type==="ObjectExpression");let z=X.properties[0];g1(z.type==="SpreadElement"),Object.assign(H,$.evaluater.evaluateExpression(z.argument))}else oB($,Z.position);else{let J=B.name,Q;if(B.value&&typeof B.value==="object")if(B.value.data&&B.value.data.estree&&$.evaluater){let z=B.value.data.estree.body[0];g1(z.type==="ExpressionStatement"),Q=$.evaluater.evaluateExpression(z.expression)}else oB($,Z.position);else Q=B.value===null?!0:B.value;H[J]=Q}return H}function cL($,Z){let H=[],B=-1,J=$.passKeys?new Map:_10;while(++B<Z.children.length){let Q=Z.children[B],X;if($.passKeys){let G=Q.type==="element"?Q.tagName:Q.type==="mdxJsxFlowElement"||Q.type==="mdxJsxTextElement"?Q.name:void 0;if(G){let F=J.get(G)||0;X=G+"-"+F,J.set(G,F+1)}}let z=mR($,Q,X);if(z!==void 0)H.push(z)}return H}function x10($,Z,H){let B=hL($.schema,Z);if(H===null||H===void 0||typeof H==="number"&&Number.isNaN(H))return;if(Array.isArray(H))H=B.commaSeparated?NR(H):PR(H);if(B.property==="style"){let J=typeof H==="object"?H:v10($,String(H));if($.stylePropertyNameCase==="css")J=g10(J);return["style",J]}return[$.elementAttributeNameCase==="react"&&B.space?yL[B.property]||B.property:B.attribute,H]}function v10($,Z){try{return gR.default(Z,{reactCompat:!0})}catch(H){if($.ignoreInvalidStyle)return{};let B=H,J=new t5("Cannot parse `style` attribute",{ancestors:$.ancestors,cause:B,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw J.file=$.filePath||void 0,J.url=fR+"#cannot-parse-style-attribute",J}}function uR($,Z,H){let B;if(!H)B={type:"Literal",value:Z};else if(Z.includes(".")){let J=Z.split("."),Q=-1,X;while(++Q<J.length){let z=hF(J[Q])?{type:"Identifier",name:J[Q]}:{type:"Literal",value:J[Q]};X=X?{type:"MemberExpression",object:X,property:z,computed:Boolean(Q&&z.type==="Literal"),optional:!1}:z}g1(X,"always a result"),B=X}else B=hF(Z)&&!/^[a-z]/.test(Z)?{type:"Identifier",name:Z}:{type:"Literal",value:Z};if(B.type==="Literal"){let J=B.value;return mL.call($.components,J)?$.components[J]:J}if($.evaluater)return $.evaluater.evaluateExpression(B);oB($)}function oB($,Z){let H=new t5("Cannot handle MDX estrees without `createEvaluater`",{ancestors:$.ancestors,place:Z,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw H.file=$.filePath||void 0,H.url=fR+"#cannot-handle-mdx-estrees-without-createevaluater",H}function g10($){let Z={},H;for(H in $)if(mL.call($,H))Z[f10(H)]=$[H];return Z}function f10($){let Z=$.replace(O10,m10);if(Z.slice(0,3)==="ms-")Z="-"+Z;return Z}function m10($){return"-"+$.toLowerCase()}var sB={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var MZ=O(c(),1),Yb=O(g(),1);var p10={};function K7($,Z){let H=Z||p10,B=typeof H.includeImageAlt==="boolean"?H.includeImageAlt:!0,J=typeof H.includeHtml==="boolean"?H.includeHtml:!0;return dR($,B,J)}function dR($,Z,H){if(u10($)){if("value"in $)return $.type==="html"&&!H?"":$.value;if(Z&&"alt"in $&&$.alt)return $.alt;if("children"in $)return cR($.children,Z,H)}if(Array.isArray($))return cR($,Z,H);return""}function cR($,Z,H){let B=[],J=-1;while(++J<$.length)B[J]=dR($[J],Z,H);return B.join("")}function u10($){return Boolean($&&typeof $==="object")}var lR=document.createElement("i");function WZ($){let Z="&"+$+";";lR.innerHTML=Z;let H=lR.textContent;if(H.charCodeAt(H.length-1)===59&&$!=="semi")return!1;return H===Z?!1:H}function d5($,Z,H,B){let J=$.length,Q=0,X;if(Z<0)Z=-Z>J?0:J+Z;else Z=Z>J?J:Z;if(H=H>0?H:0,B.length<1e4)X=Array.from(B),X.unshift(Z,H),$.splice(...X);else{if(H)$.splice(Z,H);while(Q<B.length)X=B.slice(Q,Q+1e4),X.unshift(Z,0),$.splice(...X),Q+=1e4,Z+=1e4}}function Z4($,Z){if($.length>0)return d5($,$.length,0,Z),$;return Z}var iR={}.hasOwnProperty;function pF($){let Z={},H=-1;while(++H<$.length)c10(Z,$[H]);return Z}function c10($,Z){let H;for(H in Z){let J=(iR.call($,H)?$[H]:void 0)||($[H]={}),Q=Z[H],X;if(Q)for(X in Q){if(!iR.call(J,X))J[X]=[];let z=Q[X];d10(J[X],Array.isArray(z)?z:z?[z]:[])}}}function d10($,Z){let H=-1,B=[];while(++H<Z.length)(Z[H].add==="after"?$:B).push(Z[H]);d5($,0,0,B)}function uF($,Z){let H=Number.parseInt($,Z);if(H<9||H===11||H>13&&H<32||H>126&&H<160||H>55295&&H<57344||H>64975&&H<65008||(H&65535)===65535||(H&65535)===65534||H>1114111)return"�";return String.fromCodePoint(H)}function m2($){return $.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var X2=d3(/[A-Za-z]/),m5=d3(/[\dA-Za-z]/),rR=d3(/[#-'*+\--9=?A-Z^-~]/);function W7($){return $!==null&&($<32||$===127)}var tB=d3(/\d/),aR=d3(/[\dA-Fa-f]/),nR=d3(/[!-/:-@[-`{-~]/);function h0($){return $!==null&&$<-2}function O1($){return $!==null&&($<0||$===32)}function o0($){return $===-2||$===-1||$===32}var N7=d3(/\p{P}|\p{S}/u),N9=d3(/\s/);function d3($){return Z;function Z(H){return H!==null&&H>-1&&$.test(String.fromCharCode(H))}}function z8($){let Z=[],H=-1,B=0,J=0;while(++H<$.length){let Q=$.charCodeAt(H),X="";if(Q===37&&m5($.charCodeAt(H+1))&&m5($.charCodeAt(H+2)))J=2;else if(Q<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(Q)))X=String.fromCharCode(Q)}else if(Q>55295&&Q<57344){let z=$.charCodeAt(H+1);if(Q<56320&&z>56319&&z<57344)X=String.fromCharCode(Q,z),J=1;else X="�"}else X=String.fromCharCode(Q);if(X)Z.push($.slice(B,H),encodeURIComponent(X)),B=H+J+1,X="";if(J)H+=J,J=0}return Z.join("")+$.slice(B)}function a0($,Z,H,B){let J=B?B-1:Number.POSITIVE_INFINITY,Q=0;return X;function X(G){if(o0(G))return $.enter(H),z(G);return Z(G)}function z(G){if(o0(G)&&Q++<J)return $.consume(G),z;return $.exit(H),Z(G)}}var oR={tokenize:l10};function l10($){let Z=$.attempt(this.parser.constructs.contentInitial,B,J),H;return Z;function B(z){if(z===null){$.consume(z);return}return $.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),a0($,Z,"linePrefix")}function J(z){return $.enter("paragraph"),Q(z)}function Q(z){let G=$.enter("chunkText",{contentType:"text",previous:H});if(H)H.next=G;return H=G,X(z)}function X(z){if(z===null){$.exit("chunkText"),$.exit("paragraph"),$.consume(z);return}if(h0(z))return $.consume(z),$.exit("chunkText"),Q;return $.consume(z),X}}var tR={tokenize:i10},sR={tokenize:r10};function i10($){let Z=this,H=[],B=0,J,Q,X;return z;function z(q){if(B<H.length){let _=H[B];return Z.containerState=_[1],$.attempt(_[0].continuation,G,F)(q)}return F(q)}function G(q){if(B++,Z.containerState._closeFlow){if(Z.containerState._closeFlow=void 0,J)D();let _=Z.events.length,M=_,P;while(M--)if(Z.events[M][0]==="exit"&&Z.events[M][1].type==="chunkFlow"){P=Z.events[M][1].end;break}A(B);let T=_;while(T<Z.events.length)Z.events[T][1].end={...P},T++;return d5(Z.events,M+1,0,Z.events.slice(_)),Z.events.length=T,F(q)}return z(q)}function F(q){if(B===H.length){if(!J)return K(q);if(J.currentConstruct&&J.currentConstruct.concrete)return N(q);Z.interrupt=Boolean(J.currentConstruct&&!J._gfmTableDynamicInterruptHack)}return Z.containerState={},$.check(sR,U,Y)(q)}function U(q){if(J)D();return A(B),K(q)}function Y(q){return Z.parser.lazy[Z.now().line]=B!==H.length,X=Z.now().offset,N(q)}function K(q){return Z.containerState={},$.attempt(sR,W,N)(q)}function W(q){return B++,H.push([Z.currentConstruct,Z.containerState]),K(q)}function N(q){if(q===null){if(J)D();A(0),$.consume(q);return}return J=J||Z.parser.flow(Z.now()),$.enter("chunkFlow",{_tokenizer:J,contentType:"flow",previous:Q}),L(q)}function L(q){if(q===null){V($.exit("chunkFlow"),!0),A(0),$.consume(q);return}if(h0(q))return $.consume(q),V($.exit("chunkFlow")),B=0,Z.interrupt=void 0,z;return $.consume(q),L}function V(q,_){let M=Z.sliceStream(q);if(_)M.push(null);if(q.previous=Q,Q)Q.next=q;if(Q=q,J.defineSkip(q.start),J.write(M),Z.parser.lazy[q.start.line]){let P=J.events.length;while(P--)if(J.events[P][1].start.offset<X&&(!J.events[P][1].end||J.events[P][1].end.offset>X))return;let T=Z.events.length,R=T,y,w;while(R--)if(Z.events[R][0]==="exit"&&Z.events[R][1].type==="chunkFlow"){if(y){w=Z.events[R][1].end;break}y=!0}A(B),P=T;while(P<Z.events.length)Z.events[P][1].end={...w},P++;d5(Z.events,R+1,0,Z.events.slice(T)),Z.events.length=P}}function A(q){let _=H.length;while(_-- >q){let M=H[_];Z.containerState=M[1],M[0].exit.call(Z,$)}H.length=q}function D(){J.write([null]),Q=void 0,J=void 0,Z.containerState._closeFlow=void 0}}function r10($,Z,H){return a0($,$.attempt(this.parser.constructs.document,Z,H),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function f9($){if($===null||O1($)||N9($))return 1;if(N7($))return 2}function l3($,Z,H){let B=[],J=-1;while(++J<$.length){let Q=$[J].resolveAll;if(Q&&!B.includes(Q))Z=Q(Z,H),B.push(Q)}return Z}var eB={name:"attention",resolveAll:a10,tokenize:n10};function a10($,Z){let H=-1,B,J,Q,X,z,G,F,U;while(++H<$.length)if($[H][0]==="enter"&&$[H][1].type==="attentionSequence"&&$[H][1]._close){B=H;while(B--)if($[B][0]==="exit"&&$[B][1].type==="attentionSequence"&&$[B][1]._open&&Z.sliceSerialize($[B][1]).charCodeAt(0)===Z.sliceSerialize($[H][1]).charCodeAt(0)){if(($[B][1]._close||$[H][1]._open)&&($[H][1].end.offset-$[H][1].start.offset)%3&&!(($[B][1].end.offset-$[B][1].start.offset+$[H][1].end.offset-$[H][1].start.offset)%3))continue;G=$[B][1].end.offset-$[B][1].start.offset>1&&$[H][1].end.offset-$[H][1].start.offset>1?2:1;let Y={...$[B][1].end},K={...$[H][1].start};if(eR(Y,-G),eR(K,G),X={type:G>1?"strongSequence":"emphasisSequence",start:Y,end:{...$[B][1].end}},z={type:G>1?"strongSequence":"emphasisSequence",start:{...$[H][1].start},end:K},Q={type:G>1?"strongText":"emphasisText",start:{...$[B][1].end},end:{...$[H][1].start}},J={type:G>1?"strong":"emphasis",start:{...X.start},end:{...z.end}},$[B][1].end={...X.start},$[H][1].start={...z.end},F=[],$[B][1].end.offset-$[B][1].start.offset)F=Z4(F,[["enter",$[B][1],Z],["exit",$[B][1],Z]]);if(F=Z4(F,[["enter",J,Z],["enter",X,Z],["exit",X,Z],["enter",Q,Z]]),F=Z4(F,l3(Z.parser.constructs.insideSpan.null,$.slice(B+1,H),Z)),F=Z4(F,[["exit",Q,Z],["enter",z,Z],["exit",z,Z],["exit",J,Z]]),$[H][1].end.offset-$[H][1].start.offset)U=2,F=Z4(F,[["enter",$[H][1],Z],["exit",$[H][1],Z]]);else U=0;d5($,B-1,H-B+3,F),H=B+F.length-U-2;break}}H=-1;while(++H<$.length)if($[H][1].type==="attentionSequence")$[H][1].type="data";return $}function n10($,Z){let H=this.parser.constructs.attentionMarkers.null,B=this.previous,J=f9(B),Q;return X;function X(G){return Q=G,$.enter("attentionSequence"),z(G)}function z(G){if(G===Q)return $.consume(G),z;let F=$.exit("attentionSequence"),U=f9(G),Y=!U||U===2&&J||H.includes(G),K=!J||J===2&&U||H.includes(B);return F._open=Boolean(Q===42?Y:Y&&(J||!K)),F._close=Boolean(Q===42?K:K&&(U||!Y)),Z(G)}}function eR($,Z){$.column+=Z,$.offset+=Z,$._bufferIndex+=Z}var dL={name:"autolink",tokenize:o10};function o10($,Z,H){let B=0;return J;function J(W){return $.enter("autolink"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.enter("autolinkProtocol"),Q}function Q(W){if(X2(W))return $.consume(W),X;if(W===64)return H(W);return F(W)}function X(W){if(W===43||W===45||W===46||m5(W))return B=1,z(W);return F(W)}function z(W){if(W===58)return $.consume(W),B=0,G;if((W===43||W===45||W===46||m5(W))&&B++<32)return $.consume(W),z;return B=0,F(W)}function G(W){if(W===62)return $.exit("autolinkProtocol"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),Z;if(W===null||W===32||W===60||W7(W))return H(W);return $.consume(W),G}function F(W){if(W===64)return $.consume(W),U;if(rR(W))return $.consume(W),F;return H(W)}function U(W){return m5(W)?Y(W):H(W)}function Y(W){if(W===46)return $.consume(W),B=0,U;if(W===62)return $.exit("autolinkProtocol").type="autolinkEmail",$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),Z;return K(W)}function K(W){if((W===45||m5(W))&&B++<63){let N=W===45?K:Y;return $.consume(W),N}return H(W)}}var L9={partial:!0,tokenize:s10};function s10($,Z,H){return B;function B(Q){return o0(Q)?a0($,J,"linePrefix")(Q):J(Q)}function J(Q){return Q===null||h0(Q)?Z(Q):H(Q)}}var cF={continuation:{tokenize:e10},exit:$50,name:"blockQuote",tokenize:t10};function t10($,Z,H){let B=this;return J;function J(X){if(X===62){let z=B.containerState;if(!z.open)$.enter("blockQuote",{_container:!0}),z.open=!0;return $.enter("blockQuotePrefix"),$.enter("blockQuoteMarker"),$.consume(X),$.exit("blockQuoteMarker"),Q}return H(X)}function Q(X){if(o0(X))return $.enter("blockQuotePrefixWhitespace"),$.consume(X),$.exit("blockQuotePrefixWhitespace"),$.exit("blockQuotePrefix"),Z;return $.exit("blockQuotePrefix"),Z(X)}}function e10($,Z,H){let B=this;return J;function J(X){if(o0(X))return a0($,Q,"linePrefix",B.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X);return Q(X)}function Q(X){return $.attempt(cF,Z,H)(X)}}function $50($){$.exit("blockQuote")}var dF={name:"characterEscape",tokenize:Z50};function Z50($,Z,H){return B;function B(Q){return $.enter("characterEscape"),$.enter("escapeMarker"),$.consume(Q),$.exit("escapeMarker"),J}function J(Q){if(nR(Q))return $.enter("characterEscapeValue"),$.consume(Q),$.exit("characterEscapeValue"),$.exit("characterEscape"),Z;return H(Q)}}var lF={name:"characterReference",tokenize:H50};function H50($,Z,H){let B=this,J=0,Q,X;return z;function z(Y){return $.enter("characterReference"),$.enter("characterReferenceMarker"),$.consume(Y),$.exit("characterReferenceMarker"),G}function G(Y){if(Y===35)return $.enter("characterReferenceMarkerNumeric"),$.consume(Y),$.exit("characterReferenceMarkerNumeric"),F;return $.enter("characterReferenceValue"),Q=31,X=m5,U(Y)}function F(Y){if(Y===88||Y===120)return $.enter("characterReferenceMarkerHexadecimal"),$.consume(Y),$.exit("characterReferenceMarkerHexadecimal"),$.enter("characterReferenceValue"),Q=6,X=aR,U;return $.enter("characterReferenceValue"),Q=7,X=tB,U(Y)}function U(Y){if(Y===59&&J){let K=$.exit("characterReferenceValue");if(X===m5&&!WZ(B.sliceSerialize(K)))return H(Y);return $.enter("characterReferenceMarker"),$.consume(Y),$.exit("characterReferenceMarker"),$.exit("characterReference"),Z}if(X(Y)&&J++<Q)return $.consume(Y),U;return H(Y)}}var $k={partial:!0,tokenize:J50},iF={concrete:!0,name:"codeFenced",tokenize:B50};function B50($,Z,H){let B=this,J={partial:!0,tokenize:M},Q=0,X=0,z;return G;function G(P){return F(P)}function F(P){let T=B.events[B.events.length-1];return Q=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,z=P,$.enter("codeFenced"),$.enter("codeFencedFence"),$.enter("codeFencedFenceSequence"),U(P)}function U(P){if(P===z)return X++,$.consume(P),U;if(X<3)return H(P);return $.exit("codeFencedFenceSequence"),o0(P)?a0($,Y,"whitespace")(P):Y(P)}function Y(P){if(P===null||h0(P))return $.exit("codeFencedFence"),B.interrupt?Z(P):$.check($k,L,_)(P);return $.enter("codeFencedFenceInfo"),$.enter("chunkString",{contentType:"string"}),K(P)}function K(P){if(P===null||h0(P))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),Y(P);if(o0(P))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),a0($,W,"whitespace")(P);if(P===96&&P===z)return H(P);return $.consume(P),K}function W(P){if(P===null||h0(P))return Y(P);return $.enter("codeFencedFenceMeta"),$.enter("chunkString",{contentType:"string"}),N(P)}function N(P){if(P===null||h0(P))return $.exit("chunkString"),$.exit("codeFencedFenceMeta"),Y(P);if(P===96&&P===z)return H(P);return $.consume(P),N}function L(P){return $.attempt(J,_,V)(P)}function V(P){return $.enter("lineEnding"),$.consume(P),$.exit("lineEnding"),A}function A(P){return Q>0&&o0(P)?a0($,D,"linePrefix",Q+1)(P):D(P)}function D(P){if(P===null||h0(P))return $.check($k,L,_)(P);return $.enter("codeFlowValue"),q(P)}function q(P){if(P===null||h0(P))return $.exit("codeFlowValue"),D(P);return $.consume(P),q}function _(P){return $.exit("codeFenced"),Z(P)}function M(P,T,R){let y=0;return w;function w(S){return P.enter("lineEnding"),P.consume(S),P.exit("lineEnding"),h}function h(S){return P.enter("codeFencedFence"),o0(S)?a0(P,E,"linePrefix",B.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):E(S)}function E(S){if(S===z)return P.enter("codeFencedFenceSequence"),I(S);return R(S)}function I(S){if(S===z)return y++,P.consume(S),I;if(y>=X)return P.exit("codeFencedFenceSequence"),o0(S)?a0(P,j,"whitespace")(S):j(S);return R(S)}function j(S){if(S===null||h0(S))return P.exit("codeFencedFence"),T(S);return R(S)}}}function J50($,Z,H){let B=this;return J;function J(X){if(X===null)return H(X);return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Q}function Q(X){return B.parser.lazy[B.now().line]?H(X):Z(X)}}var $J={name:"codeIndented",tokenize:X50},Q50={partial:!0,tokenize:z50};function X50($,Z,H){let B=this;return J;function J(F){return $.enter("codeIndented"),a0($,Q,"linePrefix",5)(F)}function Q(F){let U=B.events[B.events.length-1];return U&&U[1].type==="linePrefix"&&U[2].sliceSerialize(U[1],!0).length>=4?X(F):H(F)}function X(F){if(F===null)return G(F);if(h0(F))return $.attempt(Q50,X,G)(F);return $.enter("codeFlowValue"),z(F)}function z(F){if(F===null||h0(F))return $.exit("codeFlowValue"),X(F);return $.consume(F),z}function G(F){return $.exit("codeIndented"),Z(F)}}function z50($,Z,H){let B=this;return J;function J(X){if(B.parser.lazy[B.now().line])return H(X);if(h0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),J;return a0($,Q,"linePrefix",5)(X)}function Q(X){let z=B.events[B.events.length-1];return z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4?Z(X):h0(X)?J(X):H(X)}}var lL={name:"codeText",previous:F50,resolve:G50,tokenize:U50};function G50($){let Z=$.length-4,H=3,B,J;if(($[H][1].type==="lineEnding"||$[H][1].type==="space")&&($[Z][1].type==="lineEnding"||$[Z][1].type==="space")){B=H;while(++B<Z)if($[B][1].type==="codeTextData"){$[H][1].type="codeTextPadding",$[Z][1].type="codeTextPadding",H+=2,Z-=2;break}}B=H-1,Z++;while(++B<=Z)if(J===void 0){if(B!==Z&&$[B][1].type!=="lineEnding")J=B}else if(B===Z||$[B][1].type==="lineEnding"){if($[J][1].type="codeTextData",B!==J+2)$[J][1].end=$[B-1][1].end,$.splice(J+2,B-J-2),Z-=B-J-2,B=J+2;J=void 0}return $}function F50($){return $!==96||this.events[this.events.length-1][1].type==="characterEscape"}function U50($,Z,H){let B=this,J=0,Q,X;return z;function z(K){return $.enter("codeText"),$.enter("codeTextSequence"),G(K)}function G(K){if(K===96)return $.consume(K),J++,G;return $.exit("codeTextSequence"),F(K)}function F(K){if(K===null)return H(K);if(K===32)return $.enter("space"),$.consume(K),$.exit("space"),F;if(K===96)return X=$.enter("codeTextSequence"),Q=0,Y(K);if(h0(K))return $.enter("lineEnding"),$.consume(K),$.exit("lineEnding"),F;return $.enter("codeTextData"),U(K)}function U(K){if(K===null||K===32||K===96||h0(K))return $.exit("codeTextData"),F(K);return $.consume(K),U}function Y(K){if(K===96)return $.consume(K),Q++,Y;if(Q===J)return $.exit("codeTextSequence"),$.exit("codeText"),Z(K);return X.type="codeTextData",U(K)}}class iL{constructor($){this.left=$?[...$]:[],this.right=[]}get($){if($<0||$>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+$+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if($<this.left.length)return this.left[$];return this.right[this.right.length-$+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice($,Z){let H=Z===null||Z===void 0?Number.POSITIVE_INFINITY:Z;if(H<this.left.length)return this.left.slice($,H);if($>this.left.length)return this.right.slice(this.right.length-H+this.left.length,this.right.length-$+this.left.length).reverse();return this.left.slice($).concat(this.right.slice(this.right.length-H+this.left.length).reverse())}splice($,Z,H){let B=Z||0;this.setCursor(Math.trunc($));let J=this.right.splice(this.right.length-B,Number.POSITIVE_INFINITY);if(H)ZJ(this.left,H);return J.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push($){this.setCursor(Number.POSITIVE_INFINITY),this.left.push($)}pushMany($){this.setCursor(Number.POSITIVE_INFINITY),ZJ(this.left,$)}unshift($){this.setCursor(0),this.right.push($)}unshiftMany($){this.setCursor(0),ZJ(this.right,$.reverse())}setCursor($){if($===this.left.length||$>this.left.length&&this.right.length===0||$<0&&this.left.length===0)return;if($<this.left.length){let Z=this.left.splice($,Number.POSITIVE_INFINITY);ZJ(this.right,Z.reverse())}else{let Z=this.right.splice(this.left.length+this.right.length-$,Number.POSITIVE_INFINITY);ZJ(this.left,Z.reverse())}}}function ZJ($,Z){let H=0;if(Z.length<1e4)$.push(...Z);else while(H<Z.length)$.push(...Z.slice(H,H+1e4)),H+=1e4}function rF($){let Z={},H=-1,B,J,Q,X,z,G,F,U=new iL($);while(++H<U.length){while(H in Z)H=Z[H];if(B=U.get(H),H&&B[1].type==="chunkFlow"&&U.get(H-1)[1].type==="listItemPrefix"){if(G=B[1]._tokenizer.events,Q=0,Q<G.length&&G[Q][1].type==="lineEndingBlank")Q+=2;if(Q<G.length&&G[Q][1].type==="content")while(++Q<G.length){if(G[Q][1].type==="content")break;if(G[Q][1].type==="chunkText")G[Q][1]._isInFirstContentOfListItem=!0,Q++}}if(B[0]==="enter"){if(B[1].contentType)Object.assign(Z,Y50(U,H)),H=Z[H],F=!0}else if(B[1]._container){Q=H,J=void 0;while(Q--)if(X=U.get(Q),X[1].type==="lineEnding"||X[1].type==="lineEndingBlank"){if(X[0]==="enter"){if(J)U.get(J)[1].type="lineEndingBlank";X[1].type="lineEnding",J=Q}}else if(X[1].type==="linePrefix"||X[1].type==="listItemIndent");else break;if(J)B[1].end={...U.get(J)[1].start},z=U.slice(J,H),z.unshift(B),U.splice(J,H-J+1,z)}}return d5($,0,Number.POSITIVE_INFINITY,U.slice(0)),!F}function Y50($,Z){let H=$.get(Z)[1],B=$.get(Z)[2],J=Z-1,Q=[],X=H._tokenizer;if(!X){if(X=B.parser[H.contentType](H.start),H._contentTypeTextTrailing)X._contentTypeTextTrailing=!0}let z=X.events,G=[],F={},U,Y,K=-1,W=H,N=0,L=0,V=[L];while(W){while($.get(++J)[1]!==W);if(Q.push(J),!W._tokenizer){if(U=B.sliceStream(W),!W.next)U.push(null);if(Y)X.defineSkip(W.start);if(W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=!0;if(X.write(U),W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=void 0}Y=W,W=W.next}W=H;while(++K<z.length)if(z[K][0]==="exit"&&z[K-1][0]==="enter"&&z[K][1].type===z[K-1][1].type&&z[K][1].start.line!==z[K][1].end.line)L=K+1,V.push(L),W._tokenizer=void 0,W.previous=void 0,W=W.next;if(X.events=[],W)W._tokenizer=void 0,W.previous=void 0;else V.pop();K=V.length;while(K--){let A=z.slice(V[K],V[K+1]),D=Q.pop();G.push([D,D+A.length-1]),$.splice(D,2,A)}G.reverse(),K=-1;while(++K<G.length)F[N+G[K][0]]=N+G[K][1],N+=G[K][1]-G[K][0]-1;return F}var rL={resolve:W50,tokenize:N50},K50={partial:!0,tokenize:L50};function W50($){return rF($),$}function N50($,Z){let H;return B;function B(z){return $.enter("content"),H=$.enter("chunkContent",{contentType:"content"}),J(z)}function J(z){if(z===null)return Q(z);if(h0(z))return $.check(K50,X,Q)(z);return $.consume(z),J}function Q(z){return $.exit("chunkContent"),$.exit("content"),Z(z)}function X(z){return $.consume(z),$.exit("chunkContent"),H.next=$.enter("chunkContent",{contentType:"content",previous:H}),H=H.next,J}}function L50($,Z,H){let B=this;return J;function J(X){return $.exit("chunkContent"),$.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),a0($,Q,"linePrefix")}function Q(X){if(X===null||h0(X))return H(X);let z=B.events[B.events.length-1];if(!B.parser.constructs.disable.null.includes("codeIndented")&&z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4)return Z(X);return $.interrupt(B.parser.constructs.flow,H,Z)(X)}}function aF($,Z,H,B,J,Q,X,z,G){let F=G||Number.POSITIVE_INFINITY,U=0;return Y;function Y(A){if(A===60)return $.enter(B),$.enter(J),$.enter(Q),$.consume(A),$.exit(Q),K;if(A===null||A===32||A===41||W7(A))return H(A);return $.enter(B),$.enter(X),$.enter(z),$.enter("chunkString",{contentType:"string"}),L(A)}function K(A){if(A===62)return $.enter(Q),$.consume(A),$.exit(Q),$.exit(J),$.exit(B),Z;return $.enter(z),$.enter("chunkString",{contentType:"string"}),W(A)}function W(A){if(A===62)return $.exit("chunkString"),$.exit(z),K(A);if(A===null||A===60||h0(A))return H(A);return $.consume(A),A===92?N:W}function N(A){if(A===60||A===62||A===92)return $.consume(A),W;return W(A)}function L(A){if(!U&&(A===null||A===41||O1(A)))return $.exit("chunkString"),$.exit(z),$.exit(X),$.exit(B),Z(A);if(U<F&&A===40)return $.consume(A),U++,L;if(A===41)return $.consume(A),U--,L;if(A===null||A===32||A===40||W7(A))return H(A);return $.consume(A),A===92?V:L}function V(A){if(A===40||A===41||A===92)return $.consume(A),L;return L(A)}}function nF($,Z,H,B,J,Q){let X=this,z=0,G;return F;function F(W){return $.enter(B),$.enter(J),$.consume(W),$.exit(J),$.enter(Q),U}function U(W){if(z>999||W===null||W===91||W===93&&!G||W===94&&!z&&"_hiddenFootnoteSupport"in X.parser.constructs)return H(W);if(W===93)return $.exit(Q),$.enter(J),$.consume(W),$.exit(J),$.exit(B),Z;if(h0(W))return $.enter("lineEnding"),$.consume(W),$.exit("lineEnding"),U;return $.enter("chunkString",{contentType:"string"}),Y(W)}function Y(W){if(W===null||W===91||W===93||h0(W)||z++>999)return $.exit("chunkString"),U(W);if($.consume(W),!G)G=!o0(W);return W===92?K:Y}function K(W){if(W===91||W===92||W===93)return $.consume(W),z++,Y;return Y(W)}}function oF($,Z,H,B,J,Q){let X;return z;function z(K){if(K===34||K===39||K===40)return $.enter(B),$.enter(J),$.consume(K),$.exit(J),X=K===40?41:K,G;return H(K)}function G(K){if(K===X)return $.enter(J),$.consume(K),$.exit(J),$.exit(B),Z;return $.enter(Q),F(K)}function F(K){if(K===X)return $.exit(Q),G(X);if(K===null)return H(K);if(h0(K))return $.enter("lineEnding"),$.consume(K),$.exit("lineEnding"),a0($,F,"linePrefix");return $.enter("chunkString",{contentType:"string"}),U(K)}function U(K){if(K===X||K===null||h0(K))return $.exit("chunkString"),F(K);return $.consume(K),K===92?Y:U}function Y(K){if(K===X||K===92)return $.consume(K),U;return U(K)}}function L7($,Z){let H;return B;function B(J){if(h0(J))return $.enter("lineEnding"),$.consume(J),$.exit("lineEnding"),H=!0,B;if(o0(J))return a0($,B,H?"linePrefix":"lineSuffix")(J);return Z(J)}}var aL={name:"definition",tokenize:V50},A50={partial:!0,tokenize:D50};function V50($,Z,H){let B=this,J;return Q;function Q(W){return $.enter("definition"),X(W)}function X(W){return nF.call(B,$,z,H,"definitionLabel","definitionLabelMarker","definitionLabelString")(W)}function z(W){if(J=m2(B.sliceSerialize(B.events[B.events.length-1][1]).slice(1,-1)),W===58)return $.enter("definitionMarker"),$.consume(W),$.exit("definitionMarker"),G;return H(W)}function G(W){return O1(W)?L7($,F)(W):F(W)}function F(W){return aF($,U,H,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(W)}function U(W){return $.attempt(A50,Y,Y)(W)}function Y(W){return o0(W)?a0($,K,"whitespace")(W):K(W)}function K(W){if(W===null||h0(W))return $.exit("definition"),B.parser.defined.push(J),Z(W);return H(W)}}function D50($,Z,H){return B;function B(z){return O1(z)?L7($,J)(z):H(z)}function J(z){return oF($,Q,H,"definitionTitle","definitionTitleMarker","definitionTitleString")(z)}function Q(z){return o0(z)?a0($,X,"whitespace")(z):X(z)}function X(z){return z===null||h0(z)?Z(z):H(z)}}var nL={name:"hardBreakEscape",tokenize:q50};function q50($,Z,H){return B;function B(Q){return $.enter("hardBreakEscape"),$.consume(Q),J}function J(Q){if(h0(Q))return $.exit("hardBreakEscape"),Z(Q);return H(Q)}}var oL={name:"headingAtx",resolve:M50,tokenize:P50};function M50($,Z){let H=$.length-2,B=3,J,Q;if($[B][1].type==="whitespace")B+=2;if(H-2>B&&$[H][1].type==="whitespace")H-=2;if($[H][1].type==="atxHeadingSequence"&&(B===H-1||H-4>B&&$[H-2][1].type==="whitespace"))H-=B+1===H?2:4;if(H>B)J={type:"atxHeadingText",start:$[B][1].start,end:$[H][1].end},Q={type:"chunkText",start:$[B][1].start,end:$[H][1].end,contentType:"text"},d5($,B,H-B+1,[["enter",J,Z],["enter",Q,Z],["exit",Q,Z],["exit",J,Z]]);return $}function P50($,Z,H){let B=0;return J;function J(U){return $.enter("atxHeading"),Q(U)}function Q(U){return $.enter("atxHeadingSequence"),X(U)}function X(U){if(U===35&&B++<6)return $.consume(U),X;if(U===null||O1(U))return $.exit("atxHeadingSequence"),z(U);return H(U)}function z(U){if(U===35)return $.enter("atxHeadingSequence"),G(U);if(U===null||h0(U))return $.exit("atxHeading"),Z(U);if(o0(U))return a0($,z,"whitespace")(U);return $.enter("atxHeadingText"),F(U)}function G(U){if(U===35)return $.consume(U),G;return $.exit("atxHeadingSequence"),z(U)}function F(U){if(U===null||U===35||O1(U))return $.exit("atxHeadingText"),z(U);return $.consume(U),F}}var Zk=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],sL=["pre","script","style","textarea"];var tL={concrete:!0,name:"htmlFlow",resolveTo:j50,tokenize:T50},_50={partial:!0,tokenize:w50},O50={partial:!0,tokenize:C50};function j50($){let Z=$.length;while(Z--)if($[Z][0]==="enter"&&$[Z][1].type==="htmlFlow")break;if(Z>1&&$[Z-2][1].type==="linePrefix")$[Z][1].start=$[Z-2][1].start,$[Z+1][1].start=$[Z-2][1].start,$.splice(Z-2,2);return $}function T50($,Z,H){let B=this,J,Q,X,z,G;return F;function F(x){return U(x)}function U(x){return $.enter("htmlFlow"),$.enter("htmlFlowData"),$.consume(x),Y}function Y(x){if(x===33)return $.consume(x),K;if(x===47)return $.consume(x),Q=!0,L;if(x===63)return $.consume(x),J=3,B.interrupt?Z:C;if(X2(x))return $.consume(x),X=String.fromCharCode(x),V;return H(x)}function K(x){if(x===45)return $.consume(x),J=2,W;if(x===91)return $.consume(x),J=5,z=0,N;if(X2(x))return $.consume(x),J=4,B.interrupt?Z:C;return H(x)}function W(x){if(x===45)return $.consume(x),B.interrupt?Z:C;return H(x)}function N(x){if(x==="CDATA[".charCodeAt(z++)){if($.consume(x),z===6)return B.interrupt?Z:E;return N}return H(x)}function L(x){if(X2(x))return $.consume(x),X=String.fromCharCode(x),V;return H(x)}function V(x){if(x===null||x===47||x===62||O1(x)){let e=x===47,L0=X.toLowerCase();if(!e&&!Q&&sL.includes(L0))return J=1,B.interrupt?Z(x):E(x);if(Zk.includes(X.toLowerCase())){if(J=6,e)return $.consume(x),A;return B.interrupt?Z(x):E(x)}return J=7,B.interrupt&&!B.parser.lazy[B.now().line]?H(x):Q?D(x):q(x)}if(x===45||m5(x))return $.consume(x),X+=String.fromCharCode(x),V;return H(x)}function A(x){if(x===62)return $.consume(x),B.interrupt?Z:E;return H(x)}function D(x){if(o0(x))return $.consume(x),D;return w(x)}function q(x){if(x===47)return $.consume(x),w;if(x===58||x===95||X2(x))return $.consume(x),_;if(o0(x))return $.consume(x),q;return w(x)}function _(x){if(x===45||x===46||x===58||x===95||m5(x))return $.consume(x),_;return M(x)}function M(x){if(x===61)return $.consume(x),P;if(o0(x))return $.consume(x),M;return q(x)}function P(x){if(x===null||x===60||x===61||x===62||x===96)return H(x);if(x===34||x===39)return $.consume(x),G=x,T;if(o0(x))return $.consume(x),P;return R(x)}function T(x){if(x===G)return $.consume(x),G=null,y;if(x===null||h0(x))return H(x);return $.consume(x),T}function R(x){if(x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||O1(x))return M(x);return $.consume(x),R}function y(x){if(x===47||x===62||o0(x))return q(x);return H(x)}function w(x){if(x===62)return $.consume(x),h;return H(x)}function h(x){if(x===null||h0(x))return E(x);if(o0(x))return $.consume(x),h;return H(x)}function E(x){if(x===45&&J===2)return $.consume(x),k;if(x===60&&J===1)return $.consume(x),b;if(x===62&&J===4)return $.consume(x),t;if(x===63&&J===3)return $.consume(x),C;if(x===93&&J===5)return $.consume(x),u;if(h0(x)&&(J===6||J===7))return $.exit("htmlFlowData"),$.check(_50,H0,I)(x);if(x===null||h0(x))return $.exit("htmlFlowData"),I(x);return $.consume(x),E}function I(x){return $.check(O50,j,H0)(x)}function j(x){return $.enter("lineEnding"),$.consume(x),$.exit("lineEnding"),S}function S(x){if(x===null||h0(x))return I(x);return $.enter("htmlFlowData"),E(x)}function k(x){if(x===45)return $.consume(x),C;return E(x)}function b(x){if(x===47)return $.consume(x),X="",v;return E(x)}function v(x){if(x===62){let e=X.toLowerCase();if(sL.includes(e))return $.consume(x),t;return E(x)}if(X2(x)&&X.length<8)return $.consume(x),X+=String.fromCharCode(x),v;return E(x)}function u(x){if(x===93)return $.consume(x),C;return E(x)}function C(x){if(x===62)return $.consume(x),t;if(x===45&&J===2)return $.consume(x),C;return E(x)}function t(x){if(x===null||h0(x))return $.exit("htmlFlowData"),H0(x);return $.consume(x),t}function H0(x){return $.exit("htmlFlow"),Z(x)}}function C50($,Z,H){let B=this;return J;function J(X){if(h0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Q;return H(X)}function Q(X){return B.parser.lazy[B.now().line]?H(X):Z(X)}}function w50($,Z,H){return B;function B(J){return $.enter("lineEnding"),$.consume(J),$.exit("lineEnding"),$.attempt(L9,Z,H)}}var eL={name:"htmlText",tokenize:E50};function E50($,Z,H){let B=this,J,Q,X;return z;function z(C){return $.enter("htmlText"),$.enter("htmlTextData"),$.consume(C),G}function G(C){if(C===33)return $.consume(C),F;if(C===47)return $.consume(C),M;if(C===63)return $.consume(C),q;if(X2(C))return $.consume(C),R;return H(C)}function F(C){if(C===45)return $.consume(C),U;if(C===91)return $.consume(C),Q=0,N;if(X2(C))return $.consume(C),D;return H(C)}function U(C){if(C===45)return $.consume(C),W;return H(C)}function Y(C){if(C===null)return H(C);if(C===45)return $.consume(C),K;if(h0(C))return X=Y,b(C);return $.consume(C),Y}function K(C){if(C===45)return $.consume(C),W;return Y(C)}function W(C){return C===62?k(C):C===45?K(C):Y(C)}function N(C){if(C==="CDATA[".charCodeAt(Q++))return $.consume(C),Q===6?L:N;return H(C)}function L(C){if(C===null)return H(C);if(C===93)return $.consume(C),V;if(h0(C))return X=L,b(C);return $.consume(C),L}function V(C){if(C===93)return $.consume(C),A;return L(C)}function A(C){if(C===62)return k(C);if(C===93)return $.consume(C),A;return L(C)}function D(C){if(C===null||C===62)return k(C);if(h0(C))return X=D,b(C);return $.consume(C),D}function q(C){if(C===null)return H(C);if(C===63)return $.consume(C),_;if(h0(C))return X=q,b(C);return $.consume(C),q}function _(C){return C===62?k(C):q(C)}function M(C){if(X2(C))return $.consume(C),P;return H(C)}function P(C){if(C===45||m5(C))return $.consume(C),P;return T(C)}function T(C){if(h0(C))return X=T,b(C);if(o0(C))return $.consume(C),T;return k(C)}function R(C){if(C===45||m5(C))return $.consume(C),R;if(C===47||C===62||O1(C))return y(C);return H(C)}function y(C){if(C===47)return $.consume(C),k;if(C===58||C===95||X2(C))return $.consume(C),w;if(h0(C))return X=y,b(C);if(o0(C))return $.consume(C),y;return k(C)}function w(C){if(C===45||C===46||C===58||C===95||m5(C))return $.consume(C),w;return h(C)}function h(C){if(C===61)return $.consume(C),E;if(h0(C))return X=h,b(C);if(o0(C))return $.consume(C),h;return y(C)}function E(C){if(C===null||C===60||C===61||C===62||C===96)return H(C);if(C===34||C===39)return $.consume(C),J=C,I;if(h0(C))return X=E,b(C);if(o0(C))return $.consume(C),E;return $.consume(C),j}function I(C){if(C===J)return $.consume(C),J=void 0,S;if(C===null)return H(C);if(h0(C))return X=I,b(C);return $.consume(C),I}function j(C){if(C===null||C===34||C===39||C===60||C===61||C===96)return H(C);if(C===47||C===62||O1(C))return y(C);return $.consume(C),j}function S(C){if(C===47||C===62||O1(C))return y(C);return H(C)}function k(C){if(C===62)return $.consume(C),$.exit("htmlTextData"),$.exit("htmlText"),Z;return H(C)}function b(C){return $.exit("htmlTextData"),$.enter("lineEnding"),$.consume(C),$.exit("lineEnding"),v}function v(C){return o0(C)?a0($,u,"linePrefix",B.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):u(C)}function u(C){return $.enter("htmlTextData"),X(C)}}var A7={name:"labelEnd",resolveAll:k50,resolveTo:b50,tokenize:y50},S50={tokenize:h50},I50={tokenize:x50},R50={tokenize:v50};function k50($){let Z=-1,H=[];while(++Z<$.length){let B=$[Z][1];if(H.push($[Z]),B.type==="labelImage"||B.type==="labelLink"||B.type==="labelEnd"){let J=B.type==="labelImage"?4:2;B.type="data",Z+=J}}if($.length!==H.length)d5($,0,$.length,H);return $}function b50($,Z){let H=$.length,B=0,J,Q,X,z;while(H--)if(J=$[H][1],Q){if(J.type==="link"||J.type==="labelLink"&&J._inactive)break;if($[H][0]==="enter"&&J.type==="labelLink")J._inactive=!0}else if(X){if($[H][0]==="enter"&&(J.type==="labelImage"||J.type==="labelLink")&&!J._balanced){if(Q=H,J.type!=="labelLink"){B=2;break}}}else if(J.type==="labelEnd")X=H;let G={type:$[Q][1].type==="labelLink"?"link":"image",start:{...$[Q][1].start},end:{...$[$.length-1][1].end}},F={type:"label",start:{...$[Q][1].start},end:{...$[X][1].end}},U={type:"labelText",start:{...$[Q+B+2][1].end},end:{...$[X-2][1].start}};return z=[["enter",G,Z],["enter",F,Z]],z=Z4(z,$.slice(Q+1,Q+B+3)),z=Z4(z,[["enter",U,Z]]),z=Z4(z,l3(Z.parser.constructs.insideSpan.null,$.slice(Q+B+4,X-3),Z)),z=Z4(z,[["exit",U,Z],$[X-2],$[X-1],["exit",F,Z]]),z=Z4(z,$.slice(X+1)),z=Z4(z,[["exit",G,Z]]),d5($,Q,$.length,z),$}function y50($,Z,H){let B=this,J=B.events.length,Q,X;while(J--)if((B.events[J][1].type==="labelImage"||B.events[J][1].type==="labelLink")&&!B.events[J][1]._balanced){Q=B.events[J][1];break}return z;function z(K){if(!Q)return H(K);if(Q._inactive)return Y(K);return X=B.parser.defined.includes(m2(B.sliceSerialize({start:Q.end,end:B.now()}))),$.enter("labelEnd"),$.enter("labelMarker"),$.consume(K),$.exit("labelMarker"),$.exit("labelEnd"),G}function G(K){if(K===40)return $.attempt(S50,U,X?U:Y)(K);if(K===91)return $.attempt(I50,U,X?F:Y)(K);return X?U(K):Y(K)}function F(K){return $.attempt(R50,U,Y)(K)}function U(K){return Z(K)}function Y(K){return Q._balanced=!0,H(K)}}function h50($,Z,H){return B;function B(Y){return $.enter("resource"),$.enter("resourceMarker"),$.consume(Y),$.exit("resourceMarker"),J}function J(Y){return O1(Y)?L7($,Q)(Y):Q(Y)}function Q(Y){if(Y===41)return U(Y);return aF($,X,z,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(Y)}function X(Y){return O1(Y)?L7($,G)(Y):U(Y)}function z(Y){return H(Y)}function G(Y){if(Y===34||Y===39||Y===40)return oF($,F,H,"resourceTitle","resourceTitleMarker","resourceTitleString")(Y);return U(Y)}function F(Y){return O1(Y)?L7($,U)(Y):U(Y)}function U(Y){if(Y===41)return $.enter("resourceMarker"),$.consume(Y),$.exit("resourceMarker"),$.exit("resource"),Z;return H(Y)}}function x50($,Z,H){let B=this;return J;function J(z){return nF.call(B,$,Q,X,"reference","referenceMarker","referenceString")(z)}function Q(z){return B.parser.defined.includes(m2(B.sliceSerialize(B.events[B.events.length-1][1]).slice(1,-1)))?Z(z):H(z)}function X(z){return H(z)}}function v50($,Z,H){return B;function B(Q){return $.enter("reference"),$.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),J}function J(Q){if(Q===93)return $.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),$.exit("reference"),Z;return H(Q)}}var $A={name:"labelStartImage",resolveAll:A7.resolveAll,tokenize:g50};function g50($,Z,H){let B=this;return J;function J(z){return $.enter("labelImage"),$.enter("labelImageMarker"),$.consume(z),$.exit("labelImageMarker"),Q}function Q(z){if(z===91)return $.enter("labelMarker"),$.consume(z),$.exit("labelMarker"),$.exit("labelImage"),X;return H(z)}function X(z){return z===94&&"_hiddenFootnoteSupport"in B.parser.constructs?H(z):Z(z)}}var ZA={name:"labelStartLink",resolveAll:A7.resolveAll,tokenize:f50};function f50($,Z,H){let B=this;return J;function J(X){return $.enter("labelLink"),$.enter("labelMarker"),$.consume(X),$.exit("labelMarker"),$.exit("labelLink"),Q}function Q(X){return X===94&&"_hiddenFootnoteSupport"in B.parser.constructs?H(X):Z(X)}}var HJ={name:"lineEnding",tokenize:m50};function m50($,Z){return H;function H(B){return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),a0($,Z,"linePrefix")}}var V7={name:"thematicBreak",tokenize:p50};function p50($,Z,H){let B=0,J;return Q;function Q(F){return $.enter("thematicBreak"),X(F)}function X(F){return J=F,z(F)}function z(F){if(F===J)return $.enter("thematicBreakSequence"),G(F);if(B>=3&&(F===null||h0(F)))return $.exit("thematicBreak"),Z(F);return H(F)}function G(F){if(F===J)return $.consume(F),B++,G;return $.exit("thematicBreakSequence"),o0(F)?a0($,z,"whitespace")(F):z(F)}}var p2={continuation:{tokenize:l50},exit:r50,name:"list",tokenize:d50},u50={partial:!0,tokenize:a50},c50={partial:!0,tokenize:i50};function d50($,Z,H){let B=this,J=B.events[B.events.length-1],Q=J&&J[1].type==="linePrefix"?J[2].sliceSerialize(J[1],!0).length:0,X=0;return z;function z(W){let N=B.containerState.type||(W===42||W===43||W===45?"listUnordered":"listOrdered");if(N==="listUnordered"?!B.containerState.marker||W===B.containerState.marker:tB(W)){if(!B.containerState.type)B.containerState.type=N,$.enter(N,{_container:!0});if(N==="listUnordered")return $.enter("listItemPrefix"),W===42||W===45?$.check(V7,H,F)(W):F(W);if(!B.interrupt||W===49)return $.enter("listItemPrefix"),$.enter("listItemValue"),G(W)}return H(W)}function G(W){if(tB(W)&&++X<10)return $.consume(W),G;if((!B.interrupt||X<2)&&(B.containerState.marker?W===B.containerState.marker:W===41||W===46))return $.exit("listItemValue"),F(W);return H(W)}function F(W){return $.enter("listItemMarker"),$.consume(W),$.exit("listItemMarker"),B.containerState.marker=B.containerState.marker||W,$.check(L9,B.interrupt?H:U,$.attempt(u50,K,Y))}function U(W){return B.containerState.initialBlankLine=!0,Q++,K(W)}function Y(W){if(o0(W))return $.enter("listItemPrefixWhitespace"),$.consume(W),$.exit("listItemPrefixWhitespace"),K;return H(W)}function K(W){return B.containerState.size=Q+B.sliceSerialize($.exit("listItemPrefix"),!0).length,Z(W)}}function l50($,Z,H){let B=this;return B.containerState._closeFlow=void 0,$.check(L9,J,Q);function J(z){return B.containerState.furtherBlankLines=B.containerState.furtherBlankLines||B.containerState.initialBlankLine,a0($,Z,"listItemIndent",B.containerState.size+1)(z)}function Q(z){if(B.containerState.furtherBlankLines||!o0(z))return B.containerState.furtherBlankLines=void 0,B.containerState.initialBlankLine=void 0,X(z);return B.containerState.furtherBlankLines=void 0,B.containerState.initialBlankLine=void 0,$.attempt(c50,Z,X)(z)}function X(z){return B.containerState._closeFlow=!0,B.interrupt=void 0,a0($,$.attempt(p2,Z,H),"linePrefix",B.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z)}}function i50($,Z,H){let B=this;return a0($,J,"listItemIndent",B.containerState.size+1);function J(Q){let X=B.events[B.events.length-1];return X&&X[1].type==="listItemIndent"&&X[2].sliceSerialize(X[1],!0).length===B.containerState.size?Z(Q):H(Q)}}function r50($){$.exit(this.containerState.type)}function a50($,Z,H){let B=this;return a0($,J,"listItemPrefixWhitespace",B.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function J(Q){let X=B.events[B.events.length-1];return!o0(Q)&&X&&X[1].type==="listItemPrefixWhitespace"?Z(Q):H(Q)}}var sF={name:"setextUnderline",resolveTo:n50,tokenize:o50};function n50($,Z){let H=$.length,B,J,Q;while(H--)if($[H][0]==="enter"){if($[H][1].type==="content"){B=H;break}if($[H][1].type==="paragraph")J=H}else{if($[H][1].type==="content")$.splice(H,1);if(!Q&&$[H][1].type==="definition")Q=H}let X={type:"setextHeading",start:{...$[B][1].start},end:{...$[$.length-1][1].end}};if($[J][1].type="setextHeadingText",Q)$.splice(J,0,["enter",X,Z]),$.splice(Q+1,0,["exit",$[B][1],Z]),$[B][1].end={...$[Q][1].end};else $[B][1]=X;return $.push(["exit",X,Z]),$}function o50($,Z,H){let B=this,J;return Q;function Q(F){let U=B.events.length,Y;while(U--)if(B.events[U][1].type!=="lineEnding"&&B.events[U][1].type!=="linePrefix"&&B.events[U][1].type!=="content"){Y=B.events[U][1].type==="paragraph";break}if(!B.parser.lazy[B.now().line]&&(B.interrupt||Y))return $.enter("setextHeadingLine"),J=F,X(F);return H(F)}function X(F){return $.enter("setextHeadingLineSequence"),z(F)}function z(F){if(F===J)return $.consume(F),z;return $.exit("setextHeadingLineSequence"),o0(F)?a0($,G,"lineSuffix")(F):G(F)}function G(F){if(F===null||h0(F))return $.exit("setextHeadingLine"),Z(F);return H(F)}}var Hk={tokenize:s50};function s50($){let Z=this,H=$.attempt(L9,B,$.attempt(this.parser.constructs.flowInitial,J,a0($,$.attempt(this.parser.constructs.flow,J,$.attempt(rL,J)),"linePrefix")));return H;function B(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEndingBlank"),$.consume(Q),$.exit("lineEndingBlank"),Z.currentConstruct=void 0,H}function J(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEnding"),$.consume(Q),$.exit("lineEnding"),Z.currentConstruct=void 0,H}}var Bk={resolveAll:zk()},Jk=Xk("string"),Qk=Xk("text");function Xk($){return{resolveAll:zk($==="text"?t50:void 0),tokenize:Z};function Z(H){let B=this,J=this.parser.constructs[$],Q=H.attempt(J,X,z);return X;function X(U){return F(U)?Q(U):z(U)}function z(U){if(U===null){H.consume(U);return}return H.enter("data"),H.consume(U),G}function G(U){if(F(U))return H.exit("data"),Q(U);return H.consume(U),G}function F(U){if(U===null)return!0;let Y=J[U],K=-1;if(Y)while(++K<Y.length){let W=Y[K];if(!W.previous||W.previous.call(B,B.previous))return!0}return!1}}}function zk($){return Z;function Z(H,B){let J=-1,Q;while(++J<=H.length)if(Q===void 0){if(H[J]&&H[J][1].type==="data")Q=J,J++}else if(!H[J]||H[J][1].type!=="data"){if(J!==Q+2)H[Q][1].end=H[J-1][1].end,H.splice(Q+2,J-Q-2),J=Q+2;Q=void 0}return $?$(H,B):H}}function t50($,Z){let H=0;while(++H<=$.length)if((H===$.length||$[H][1].type==="lineEnding")&&$[H-1][1].type==="data"){let B=$[H-1][1],J=Z.sliceStream(B),Q=J.length,X=-1,z=0,G;while(Q--){let F=J[Q];if(typeof F==="string"){X=F.length;while(F.charCodeAt(X-1)===32)z++,X--;if(X)break;X=-1}else if(F===-2)G=!0,z++;else if(F===-1);else{Q++;break}}if(Z._contentTypeTextTrailing&&H===$.length)z=0;if(z){let F={type:H===$.length||G||z<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:Q?X:B.start._bufferIndex+X,_index:B.start._index+Q,line:B.end.line,column:B.end.column-z,offset:B.end.offset-z},end:{...B.end}};if(B.end={...F.start},B.start.offset===B.end.offset)Object.assign(B,F);else $.splice(H,0,["enter",F,Z],["exit",F,Z]),H+=2}H++}return $}var HA={};O4(HA,{text:()=>J20,string:()=>B20,insideSpan:()=>Q20,flowInitial:()=>Z20,flow:()=>H20,document:()=>e50,disable:()=>z20,contentInitial:()=>$20,attentionMarkers:()=>X20});var e50={[42]:p2,[43]:p2,[45]:p2,[48]:p2,[49]:p2,[50]:p2,[51]:p2,[52]:p2,[53]:p2,[54]:p2,[55]:p2,[56]:p2,[57]:p2,[62]:cF},$20={[91]:aL},Z20={[-2]:$J,[-1]:$J,[32]:$J},H20={[35]:oL,[42]:V7,[45]:[sF,V7],[60]:tL,[61]:sF,[95]:V7,[96]:iF,[126]:iF},B20={[38]:lF,[92]:dF},J20={[-5]:HJ,[-4]:HJ,[-3]:HJ,[33]:$A,[38]:lF,[42]:eB,[60]:[dL,eL],[91]:ZA,[92]:[nL,dF],[93]:A7,[95]:eB,[96]:lL},Q20={null:[eB,Bk]},X20={null:[42,95]},z20={null:[]};function Gk($,Z,H){let B={_bufferIndex:-1,_index:0,line:H&&H.line||1,column:H&&H.column||1,offset:H&&H.offset||0},J={},Q=[],X=[],z=[],G=!0,F={attempt:y(T),check:y(R),consume:_,enter:M,exit:P,interrupt:y(R,{interrupt:!0})},U={code:null,containerState:{},defineSkip:A,events:[],now:V,parser:$,previous:null,sliceSerialize:N,sliceStream:L,write:W},Y=Z.tokenize.call(U,F),K;if(Z.resolveAll)Q.push(Z);return U;function W(I){if(X=Z4(X,I),D(),X[X.length-1]!==null)return[];return w(Z,0),U.events=l3(Q,U.events,U),U.events}function N(I,j){return F20(L(I),j)}function L(I){return G20(X,I)}function V(){let{_bufferIndex:I,_index:j,line:S,column:k,offset:b}=B;return{_bufferIndex:I,_index:j,line:S,column:k,offset:b}}function A(I){J[I.line]=I.column,E()}function D(){let I;while(B._index<X.length){let j=X[B._index];if(typeof j==="string"){if(I=B._index,B._bufferIndex<0)B._bufferIndex=0;while(B._index===I&&B._bufferIndex<j.length)q(j.charCodeAt(B._bufferIndex))}else q(j)}}function q(I){G=void 0,K=I,Y=Y(I)}function _(I){if(h0(I))B.line++,B.column=1,B.offset+=I===-3?2:1,E();else if(I!==-1)B.column++,B.offset++;if(B._bufferIndex<0)B._index++;else if(B._bufferIndex++,B._bufferIndex===X[B._index].length)B._bufferIndex=-1,B._index++;U.previous=I,G=!0}function M(I,j){let S=j||{};return S.type=I,S.start=V(),U.events.push(["enter",S,U]),z.push(S),S}function P(I){let j=z.pop();return j.end=V(),U.events.push(["exit",j,U]),j}function T(I,j){w(I,j.from)}function R(I,j){j.restore()}function y(I,j){return S;function S(k,b,v){let u,C,t,H0;return Array.isArray(k)?e(k):("tokenize"in k)?e([k]):x(k);function x(K0){return Q0;function Q0(z0){let A0=z0!==null&&K0[z0],i=z0!==null&&K0.null,B0=[...Array.isArray(A0)?A0:A0?[A0]:[],...Array.isArray(i)?i:i?[i]:[]];return e(B0)(z0)}}function e(K0){if(u=K0,C=0,K0.length===0)return v;return L0(K0[C])}function L0(K0){return Q0;function Q0(z0){if(H0=h(),t=K0,!K0.partial)U.currentConstruct=K0;if(K0.name&&U.parser.constructs.disable.null.includes(K0.name))return X0(z0);return K0.tokenize.call(j?Object.assign(Object.create(U),j):U,F,d,X0)(z0)}}function d(K0){return G=!0,I(t,H0),b}function X0(K0){if(G=!0,H0.restore(),++C<u.length)return L0(u[C]);return v}}}function w(I,j){if(I.resolveAll&&!Q.includes(I))Q.push(I);if(I.resolve)d5(U.events,j,U.events.length-j,I.resolve(U.events.slice(j),U));if(I.resolveTo)U.events=I.resolveTo(U.events,U)}function h(){let I=V(),j=U.previous,S=U.currentConstruct,k=U.events.length,b=Array.from(z);return{from:k,restore:v};function v(){B=I,U.previous=j,U.currentConstruct=S,U.events.length=k,z=b,E()}}function E(){if(B.line in J&&B.column<2)B.column=J[B.line],B.offset+=J[B.line]-1}}function G20($,Z){let H=Z.start._index,B=Z.start._bufferIndex,J=Z.end._index,Q=Z.end._bufferIndex,X;if(H===J)X=[$[H].slice(B,Q)];else{if(X=$.slice(H,J),B>-1){let z=X[0];if(typeof z==="string")X[0]=z.slice(B);else X.shift()}if(Q>0)X.push($[J].slice(0,Q))}return X}function F20($,Z){let H=-1,B=[],J;while(++H<$.length){let Q=$[H],X;if(typeof Q==="string")X=Q;else switch(Q){case-5:{X="\r";break}case-4:{X=`
|
|
32
|
+
`;break}case-3:{X=`\r
|
|
33
|
+
`;break}case-2:{X=Z?" ":"\t";break}case-1:{if(!Z&&J)continue;X=" ";break}default:X=String.fromCharCode(Q)}J=Q===-2,B.push(X)}return B.join("")}function BA($){let B={constructs:pF([HA,...($||{}).extensions||[]]),content:J(oR),defined:[],document:J(tR),flow:J(Hk),lazy:{},string:J(Jk),text:J(Qk)};return B;function J(Q){return X;function X(z){return Gk(B,Q,z)}}}function JA($){while(!rF($));return $}var Fk=/[\0\t\n\r]/g;function QA(){let $=1,Z="",H=!0,B;return J;function J(Q,X,z){let G=[],F,U,Y,K,W;if(Q=Z+(typeof Q==="string"?Q.toString():new TextDecoder(X||void 0).decode(Q)),Y=0,Z="",H){if(Q.charCodeAt(0)===65279)Y++;H=void 0}while(Y<Q.length){if(Fk.lastIndex=Y,F=Fk.exec(Q),K=F&&F.index!==void 0?F.index:Q.length,W=Q.charCodeAt(K),!F){Z=Q.slice(Y);break}if(W===10&&Y===K&&B)G.push(-3),B=void 0;else{if(B)G.push(-5),B=void 0;if(Y<K)G.push(Q.slice(Y,K)),$+=K-Y;switch(W){case 0:{G.push(65533),$++;break}case 9:{U=Math.ceil($/4)*4,G.push(-2);while($++<U)G.push(-1);break}case 10:{G.push(-4),$=1;break}default:B=!0,$=1}}Y=K+1}if(z){if(B)G.push(-5);if(Z)G.push(Z);G.push(null)}return G}}var U20=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Uk($){return $.replace(U20,Y20)}function Y20($,Z,H){if(Z)return Z;if(H.charCodeAt(0)===35){let J=H.charCodeAt(1),Q=J===120||J===88;return uF(H.slice(Q?2:1),Q?16:10)}return WZ(H)||$}var Kk={}.hasOwnProperty;function XA($,Z,H){if(Z&&typeof Z==="object")H=Z,Z=void 0;return K20(H)(JA(BA(H).document().write(QA()($,Z,!0))))}function K20($){let Z={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:Q(m),autolinkProtocol:y,autolinkEmail:y,atxHeading:Q(J0),blockQuote:Q(z0),characterEscape:y,characterReference:y,codeFenced:Q(A0),codeFencedFenceInfo:X,codeFencedFenceMeta:X,codeIndented:Q(A0,X),codeText:Q(i,X),codeTextData:y,data:y,codeFlowValue:y,definition:Q(B0),definitionDestinationString:X,definitionLabelString:X,definitionTitleString:X,emphasis:Q($0),hardBreakEscape:Q(n),hardBreakTrailing:Q(n),htmlFlow:Q(f,X),htmlFlowData:y,htmlText:Q(f,X),htmlTextData:y,image:Q(l),label:X,link:Q(m),listItem:Q(o),listItemValue:K,listOrdered:Q(a,Y),listUnordered:Q(a),paragraph:Q(D0),reference:x,referenceString:X,resourceDestinationString:X,resourceTitleString:X,setextHeading:Q(J0),strong:Q(O0),thematicBreak:Q(r0)},exit:{atxHeading:G(),atxHeadingSequence:M,autolink:G(),autolinkEmail:Q0,autolinkProtocol:K0,blockQuote:G(),characterEscapeValue:w,characterReferenceMarkerHexadecimal:L0,characterReferenceMarkerNumeric:L0,characterReferenceValue:d,characterReference:X0,codeFenced:G(V),codeFencedFence:L,codeFencedFenceInfo:W,codeFencedFenceMeta:N,codeFlowValue:w,codeIndented:G(A),codeText:G(S),codeTextData:w,data:w,definition:G(),definitionDestinationString:_,definitionLabelString:D,definitionTitleString:q,emphasis:G(),hardBreakEscape:G(E),hardBreakTrailing:G(E),htmlFlow:G(I),htmlFlowData:w,htmlText:G(j),htmlTextData:w,image:G(b),label:u,labelText:v,lineEnding:h,link:G(k),listItem:G(),listOrdered:G(),listUnordered:G(),paragraph:G(),referenceString:e,resourceDestinationString:C,resourceTitleString:t,resource:H0,setextHeading:G(R),setextHeadingLineSequence:T,setextHeadingText:P,strong:G(),thematicBreak:G()}};Wk(Z,($||{}).mdastExtensions||[]);let H={};return B;function B(p){let r={type:"root",children:[]},Z0={stack:[r],tokenStack:[],config:Z,enter:z,exit:F,buffer:X,resume:U,data:H},V0=[],j0=-1;while(++j0<p.length)if(p[j0][1].type==="listOrdered"||p[j0][1].type==="listUnordered")if(p[j0][0]==="enter")V0.push(j0);else{let v0=V0.pop();j0=J(p,v0,j0)}j0=-1;while(++j0<p.length){let v0=Z[p[j0][0]];if(Kk.call(v0,p[j0][1].type))v0[p[j0][1].type].call(Object.assign({sliceSerialize:p[j0][2].sliceSerialize},Z0),p[j0][1])}if(Z0.tokenStack.length>0){let v0=Z0.tokenStack[Z0.tokenStack.length-1];(v0[1]||Yk).call(Z0,void 0,v0[0])}r.position={start:i3(p.length>0?p[0][1].start:{line:1,column:1,offset:0}),end:i3(p.length>0?p[p.length-2][1].end:{line:1,column:1,offset:0})},j0=-1;while(++j0<Z.transforms.length)r=Z.transforms[j0](r)||r;return r}function J(p,r,Z0){let V0=r-1,j0=-1,v0=!1,z1,Y1,c0,R0;while(++V0<=Z0){let d0=p[V0];switch(d0[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(d0[0]==="enter")j0++;else j0--;R0=void 0;break}case"lineEndingBlank":{if(d0[0]==="enter"){if(z1&&!R0&&!j0&&!c0)c0=V0;R0=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:R0=void 0}if(!j0&&d0[0]==="enter"&&d0[1].type==="listItemPrefix"||j0===-1&&d0[0]==="exit"&&(d0[1].type==="listUnordered"||d0[1].type==="listOrdered")){if(z1){let p0=V0;Y1=void 0;while(p0--){let s0=p[p0];if(s0[1].type==="lineEnding"||s0[1].type==="lineEndingBlank"){if(s0[0]==="exit")continue;if(Y1)p[Y1][1].type="lineEndingBlank",v0=!0;s0[1].type="lineEnding",Y1=p0}else if(s0[1].type==="linePrefix"||s0[1].type==="blockQuotePrefix"||s0[1].type==="blockQuotePrefixWhitespace"||s0[1].type==="blockQuoteMarker"||s0[1].type==="listItemIndent");else break}if(c0&&(!Y1||c0<Y1))z1._spread=!0;z1.end=Object.assign({},Y1?p[Y1][1].start:d0[1].end),p.splice(Y1||V0,0,["exit",z1,d0[2]]),V0++,Z0++}if(d0[1].type==="listItemPrefix"){let p0={type:"listItem",_spread:!1,start:Object.assign({},d0[1].start),end:void 0};z1=p0,p.splice(V0,0,["enter",p0,d0[2]]),V0++,Z0++,c0=void 0,R0=!0}}}return p[r][1]._spread=v0,Z0}function Q(p,r){return Z0;function Z0(V0){if(z.call(this,p(V0),V0),r)r.call(this,V0)}}function X(){this.stack.push({type:"fragment",children:[]})}function z(p,r,Z0){this.stack[this.stack.length-1].children.push(p),this.stack.push(p),this.tokenStack.push([r,Z0||void 0]),p.position={start:i3(r.start),end:void 0}}function G(p){return r;function r(Z0){if(p)p.call(this,Z0);F.call(this,Z0)}}function F(p,r){let Z0=this.stack.pop(),V0=this.tokenStack.pop();if(!V0)throw Error("Cannot close `"+p.type+"` ("+c3({start:p.start,end:p.end})+"): it’s not open");else if(V0[0].type!==p.type)if(r)r.call(this,p,V0[0]);else(V0[1]||Yk).call(this,p,V0[0]);Z0.position.end=i3(p.end)}function U(){return K7(this.stack.pop())}function Y(){this.data.expectingFirstListItemValue=!0}function K(p){if(this.data.expectingFirstListItemValue){let r=this.stack[this.stack.length-2];r.start=Number.parseInt(this.sliceSerialize(p),10),this.data.expectingFirstListItemValue=void 0}}function W(){let p=this.resume(),r=this.stack[this.stack.length-1];r.lang=p}function N(){let p=this.resume(),r=this.stack[this.stack.length-1];r.meta=p}function L(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function V(){let p=this.resume(),r=this.stack[this.stack.length-1];r.value=p.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){let p=this.resume(),r=this.stack[this.stack.length-1];r.value=p.replace(/(\r?\n|\r)$/g,"")}function D(p){let r=this.resume(),Z0=this.stack[this.stack.length-1];Z0.label=r,Z0.identifier=m2(this.sliceSerialize(p)).toLowerCase()}function q(){let p=this.resume(),r=this.stack[this.stack.length-1];r.title=p}function _(){let p=this.resume(),r=this.stack[this.stack.length-1];r.url=p}function M(p){let r=this.stack[this.stack.length-1];if(!r.depth){let Z0=this.sliceSerialize(p).length;r.depth=Z0}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function T(p){let r=this.stack[this.stack.length-1];r.depth=this.sliceSerialize(p).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function y(p){let Z0=this.stack[this.stack.length-1].children,V0=Z0[Z0.length-1];if(!V0||V0.type!=="text")V0=k0(),V0.position={start:i3(p.start),end:void 0},Z0.push(V0);this.stack.push(V0)}function w(p){let r=this.stack.pop();r.value+=this.sliceSerialize(p),r.position.end=i3(p.end)}function h(p){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){let Z0=r.children[r.children.length-1];Z0.position.end=i3(p.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&Z.canContainEols.includes(r.type))y.call(this,p),w.call(this,p)}function E(){this.data.atHardBreak=!0}function I(){let p=this.resume(),r=this.stack[this.stack.length-1];r.value=p}function j(){let p=this.resume(),r=this.stack[this.stack.length-1];r.value=p}function S(){let p=this.resume(),r=this.stack[this.stack.length-1];r.value=p}function k(){let p=this.stack[this.stack.length-1];if(this.data.inReference){let r=this.data.referenceType||"shortcut";p.type+="Reference",p.referenceType=r,delete p.url,delete p.title}else delete p.identifier,delete p.label;this.data.referenceType=void 0}function b(){let p=this.stack[this.stack.length-1];if(this.data.inReference){let r=this.data.referenceType||"shortcut";p.type+="Reference",p.referenceType=r,delete p.url,delete p.title}else delete p.identifier,delete p.label;this.data.referenceType=void 0}function v(p){let r=this.sliceSerialize(p),Z0=this.stack[this.stack.length-2];Z0.label=Uk(r),Z0.identifier=m2(r).toLowerCase()}function u(){let p=this.stack[this.stack.length-1],r=this.resume(),Z0=this.stack[this.stack.length-1];if(this.data.inReference=!0,Z0.type==="link"){let V0=p.children;Z0.children=V0}else Z0.alt=r}function C(){let p=this.resume(),r=this.stack[this.stack.length-1];r.url=p}function t(){let p=this.resume(),r=this.stack[this.stack.length-1];r.title=p}function H0(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function e(p){let r=this.resume(),Z0=this.stack[this.stack.length-1];Z0.label=r,Z0.identifier=m2(this.sliceSerialize(p)).toLowerCase(),this.data.referenceType="full"}function L0(p){this.data.characterReferenceType=p.type}function d(p){let r=this.sliceSerialize(p),Z0=this.data.characterReferenceType,V0;if(Z0)V0=uF(r,Z0==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else V0=WZ(r);let j0=this.stack[this.stack.length-1];j0.value+=V0}function X0(p){let r=this.stack.pop();r.position.end=i3(p.end)}function K0(p){w.call(this,p);let r=this.stack[this.stack.length-1];r.url=this.sliceSerialize(p)}function Q0(p){w.call(this,p);let r=this.stack[this.stack.length-1];r.url="mailto:"+this.sliceSerialize(p)}function z0(){return{type:"blockquote",children:[]}}function A0(){return{type:"code",lang:null,meta:null,value:""}}function i(){return{type:"inlineCode",value:""}}function B0(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $0(){return{type:"emphasis",children:[]}}function J0(){return{type:"heading",depth:0,children:[]}}function n(){return{type:"break"}}function f(){return{type:"html",value:""}}function l(){return{type:"image",title:null,url:"",alt:null}}function m(){return{type:"link",title:null,url:"",children:[]}}function a(p){return{type:"list",ordered:p.type==="listOrdered",start:null,spread:p._spread,children:[]}}function o(p){return{type:"listItem",spread:p._spread,checked:null,children:[]}}function D0(){return{type:"paragraph",children:[]}}function O0(){return{type:"strong",children:[]}}function k0(){return{type:"text",value:""}}function r0(){return{type:"thematicBreak"}}}function i3($){return{line:$.line,column:$.column,offset:$.offset}}function Wk($,Z){let H=-1;while(++H<Z.length){let B=Z[H];if(Array.isArray(B))Wk($,B);else W20($,B)}}function W20($,Z){let H;for(H in Z)if(Kk.call(Z,H))switch(H){case"canContainEols":{let B=Z[H];if(B)$[H].push(...B);break}case"transforms":{let B=Z[H];if(B)$[H].push(...B);break}case"enter":case"exit":{let B=Z[H];if(B)Object.assign($[H],B);break}}}function Yk($,Z){if($)throw Error("Cannot close `"+$.type+"` ("+c3({start:$.start,end:$.end})+"): a different token (`"+Z.type+"`, "+c3({start:Z.start,end:Z.end})+") is open");else throw Error("Cannot close document, a token (`"+Z.type+"`, "+c3({start:Z.start,end:Z.end})+") is still open")}function tF($){let Z=this;Z.parser=H;function H(B){return XA(B,{...Z.data("settings"),...$,extensions:Z.data("micromarkExtensions")||[],mdastExtensions:Z.data("fromMarkdownExtensions")||[]})}}var eF=-1,NZ=0,D7=1,LZ=2,BJ=3,JJ=4,QJ=5,XJ=6,$U=7,ZU=8;var Nk=typeof self==="object"?self:globalThis,N20=($,Z)=>{let H=(J,Q)=>{return $.set(Q,J),J},B=(J)=>{if($.has(J))return $.get(J);let[Q,X]=Z[J];switch(Q){case NZ:case eF:return H(X,J);case D7:{let z=H([],J);for(let G of X)z.push(B(G));return z}case LZ:{let z=H({},J);for(let[G,F]of X)z[B(G)]=B(F);return z}case BJ:return H(new Date(X),J);case JJ:{let{source:z,flags:G}=X;return H(new RegExp(z,G),J)}case QJ:{let z=H(new Map,J);for(let[G,F]of X)z.set(B(G),B(F));return z}case XJ:{let z=H(new Set,J);for(let G of X)z.add(B(G));return z}case $U:{let{name:z,message:G}=X;return H(new Nk[z](G),J)}case ZU:return H(BigInt(X),J);case"BigInt":return H(Object(BigInt(X)),J);case"ArrayBuffer":return H(new Uint8Array(X).buffer,X);case"DataView":{let{buffer:z}=new Uint8Array(X);return H(new DataView(z),X)}}return H(new Nk[Q](X),J)};return B},zA=($)=>N20(new Map,$)(0);var AZ="",{toString:L20}={},{keys:A20}=Object,zJ=($)=>{let Z=typeof $;if(Z!=="object"||!$)return[NZ,Z];let H=L20.call($).slice(8,-1);switch(H){case"Array":return[D7,AZ];case"Object":return[LZ,AZ];case"Date":return[BJ,AZ];case"RegExp":return[JJ,AZ];case"Map":return[QJ,AZ];case"Set":return[XJ,AZ];case"DataView":return[D7,H]}if(H.includes("Array"))return[D7,H];if(H.includes("Error"))return[$U,H];return[LZ,H]},HU=([$,Z])=>$===NZ&&(Z==="function"||Z==="symbol"),V20=($,Z,H,B)=>{let J=(X,z)=>{let G=B.push(X)-1;return H.set(z,G),G},Q=(X)=>{if(H.has(X))return H.get(X);let[z,G]=zJ(X);switch(z){case NZ:{let U=X;switch(G){case"bigint":z=ZU,U=X.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+G);U=null;break;case"undefined":return J([eF],X)}return J([z,U],X)}case D7:{if(G){let K=X;if(G==="DataView")K=new Uint8Array(X.buffer);else if(G==="ArrayBuffer")K=new Uint8Array(X);return J([G,[...K]],X)}let U=[],Y=J([z,U],X);for(let K of X)U.push(Q(K));return Y}case LZ:{if(G)switch(G){case"BigInt":return J([G,X.toString()],X);case"Boolean":case"Number":case"String":return J([G,X.valueOf()],X)}if(Z&&"toJSON"in X)return Q(X.toJSON());let U=[],Y=J([z,U],X);for(let K of A20(X))if($||!HU(zJ(X[K])))U.push([Q(K),Q(X[K])]);return Y}case BJ:return J([z,X.toISOString()],X);case JJ:{let{source:U,flags:Y}=X;return J([z,{source:U,flags:Y}],X)}case QJ:{let U=[],Y=J([z,U],X);for(let[K,W]of X)if($||!(HU(zJ(K))||HU(zJ(W))))U.push([Q(K),Q(W)]);return Y}case XJ:{let U=[],Y=J([z,U],X);for(let K of X)if($||!HU(zJ(K)))U.push(Q(K));return Y}}let{message:F}=X;return J([z,{name:G,message:F}],X)};return Q},GA=($,{json:Z,lossy:H}={})=>{let B=[];return V20(!(Z||H),!!Z,new Map,B)($),B};var VZ=typeof structuredClone==="function"?($,Z)=>Z&&(("json"in Z)||("lossy"in Z))?zA(GA($,Z)):structuredClone($):($,Z)=>zA(GA($,Z));function D20($,Z){let H=[{type:"text",value:"↩"}];if(Z>1)H.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(Z)}]});return H}function q20($,Z){return"Back to reference "+($+1)+(Z>1?"-"+Z:"")}function Lk($){let Z=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",H=$.options.footnoteBackContent||D20,B=$.options.footnoteBackLabel||q20,J=$.options.footnoteLabel||"Footnotes",Q=$.options.footnoteLabelTagName||"h2",X=$.options.footnoteLabelProperties||{className:["sr-only"]},z=[],G=-1;while(++G<$.footnoteOrder.length){let F=$.footnoteById.get($.footnoteOrder[G]);if(!F)continue;let U=$.all(F),Y=String(F.identifier).toUpperCase(),K=z8(Y.toLowerCase()),W=0,N=[],L=$.footnoteCounts.get(Y);while(L!==void 0&&++W<=L){if(N.length>0)N.push({type:"text",value:" "});let D=typeof H==="string"?H:H(G,W);if(typeof D==="string")D={type:"text",value:D};N.push({type:"element",tagName:"a",properties:{href:"#"+Z+"fnref-"+K+(W>1?"-"+W:""),dataFootnoteBackref:"",ariaLabel:typeof B==="string"?B:B(G,W),className:["data-footnote-backref"]},children:Array.isArray(D)?D:[D]})}let V=U[U.length-1];if(V&&V.type==="element"&&V.tagName==="p"){let D=V.children[V.children.length-1];if(D&&D.type==="text")D.value+=" ";else V.children.push({type:"text",value:" "});V.children.push(...N)}else U.push(...N);let A={type:"element",tagName:"li",properties:{id:Z+"fn-"+K},children:$.wrap(U,!0)};$.patch(F,A),z.push(A)}if(z.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:Q,properties:{...VZ(X),id:"footnote-label"},children:[{type:"text",value:J}]},{type:"text",value:`
|
|
34
|
+
`},{type:"element",tagName:"ol",properties:{},children:$.wrap(z,!0)},{type:"text",value:`
|
|
35
|
+
`}]}}var A9=function($){if($===null||$===void 0)return O20;if(typeof $==="function")return BU($);if(typeof $==="object")return Array.isArray($)?M20($):P20($);if(typeof $==="string")return _20($);throw Error("Expected function, string, or object as test")};function M20($){let Z=[],H=-1;while(++H<$.length)Z[H]=A9($[H]);return BU(B);function B(...J){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,J))return!0;return!1}}function P20($){let Z=$;return BU(H);function H(B){let J=B,Q;for(Q in $)if(J[Q]!==Z[Q])return!1;return!0}}function _20($){return BU(Z);function Z(H){return H&&H.type===$}}function BU($){return Z;function Z(H,B,J){return Boolean(j20(H)&&$.call(this,H,typeof B==="number"?B:void 0,J||void 0))}}function O20(){return!0}function j20($){return $!==null&&typeof $==="object"&&"type"in $}function Ak($){return $}var Vk=[],JU=!0,q7=!1,QU="skip";function GJ($,Z,H,B){let J;if(typeof Z==="function"&&typeof H!=="function")B=H,H=Z;else J=Z;let Q=A9(J),X=B?-1:1;z($,void 0,[])();function z(G,F,U){let Y=G&&typeof G==="object"?G:{};if(typeof Y.type==="string"){let W=typeof Y.tagName==="string"?Y.tagName:typeof Y.name==="string"?Y.name:void 0;Object.defineProperty(K,"name",{value:"node ("+Ak(G.type+(W?"<"+W+">":""))+")"})}return K;function K(){let W=Vk,N,L,V;if(!Z||Q(G,F,U[U.length-1]||void 0)){if(W=T20(H(G,U)),W[0]===q7)return W}if("children"in G&&G.children){let A=G;if(A.children&&W[0]!==QU){L=(B?A.children.length:-1)+X,V=U.concat(A);while(L>-1&&L<A.children.length){let D=A.children[L];if(N=z(D,L,V)(),N[0]===q7)return N;L=typeof N[1]==="number"?N[1]:L+X}}}return W}}}function T20($){if(Array.isArray($))return $;if(typeof $==="number")return[JU,$];return $===null||$===void 0?Vk:[$]}function m9($,Z,H,B){let J,Q,X;if(typeof Z==="function"&&typeof H!=="function")Q=void 0,X=Z,J=H;else Q=Z,X=H,J=B;GJ($,Q,z,J);function z(G,F){let U=F[F.length-1],Y=U?U.children.indexOf(G):void 0;return X(G,Y,U)}}function Dk($,Z){let H={type:"element",tagName:"blockquote",properties:{},children:$.wrap($.all(Z),!0)};return $.patch(Z,H),$.applyData(Z,H)}function qk($,Z){let H={type:"element",tagName:"br",properties:{},children:[]};return $.patch(Z,H),[$.applyData(Z,H),{type:"text",value:`
|
|
36
|
+
`}]}function Mk($,Z){let H=Z.value?Z.value+`
|
|
37
|
+
`:"",B={},J=Z.lang?Z.lang.split(/\s+/):[];if(J.length>0)B.className=["language-"+J[0]];let Q={type:"element",tagName:"code",properties:B,children:[{type:"text",value:H}]};if(Z.meta)Q.data={meta:Z.meta};return $.patch(Z,Q),Q=$.applyData(Z,Q),Q={type:"element",tagName:"pre",properties:{},children:[Q]},$.patch(Z,Q),Q}function Pk($,Z){let H={type:"element",tagName:"del",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function _k($,Z){let H={type:"element",tagName:"em",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function Ok($,Z){let H=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",B=String(Z.identifier).toUpperCase(),J=z8(B.toLowerCase()),Q=$.footnoteOrder.indexOf(B),X,z=$.footnoteCounts.get(B);if(z===void 0)z=0,$.footnoteOrder.push(B),X=$.footnoteOrder.length;else X=Q+1;z+=1,$.footnoteCounts.set(B,z);let G={type:"element",tagName:"a",properties:{href:"#"+H+"fn-"+J,id:H+"fnref-"+J+(z>1?"-"+z:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(X)}]};$.patch(Z,G);let F={type:"element",tagName:"sup",properties:{},children:[G]};return $.patch(Z,F),$.applyData(Z,F)}function jk($,Z){let H={type:"element",tagName:"h"+Z.depth,properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function Tk($,Z){if($.options.allowDangerousHtml){let H={type:"raw",value:Z.value};return $.patch(Z,H),$.applyData(Z,H)}return}function XU($,Z){let H=Z.referenceType,B="]";if(H==="collapsed")B+="[]";else if(H==="full")B+="["+(Z.label||Z.identifier)+"]";if(Z.type==="imageReference")return[{type:"text",value:"!["+Z.alt+B}];let J=$.all(Z),Q=J[0];if(Q&&Q.type==="text")Q.value="["+Q.value;else J.unshift({type:"text",value:"["});let X=J[J.length-1];if(X&&X.type==="text")X.value+=B;else J.push({type:"text",value:B});return J}function Ck($,Z){let H=String(Z.identifier).toUpperCase(),B=$.definitionById.get(H);if(!B)return XU($,Z);let J={src:z8(B.url||""),alt:Z.alt};if(B.title!==null&&B.title!==void 0)J.title=B.title;let Q={type:"element",tagName:"img",properties:J,children:[]};return $.patch(Z,Q),$.applyData(Z,Q)}function wk($,Z){let H={src:z8(Z.url)};if(Z.alt!==null&&Z.alt!==void 0)H.alt=Z.alt;if(Z.title!==null&&Z.title!==void 0)H.title=Z.title;let B={type:"element",tagName:"img",properties:H,children:[]};return $.patch(Z,B),$.applyData(Z,B)}function Ek($,Z){let H={type:"text",value:Z.value.replace(/\r?\n|\r/g," ")};$.patch(Z,H);let B={type:"element",tagName:"code",properties:{},children:[H]};return $.patch(Z,B),$.applyData(Z,B)}function Sk($,Z){let H=String(Z.identifier).toUpperCase(),B=$.definitionById.get(H);if(!B)return XU($,Z);let J={href:z8(B.url||"")};if(B.title!==null&&B.title!==void 0)J.title=B.title;let Q={type:"element",tagName:"a",properties:J,children:$.all(Z)};return $.patch(Z,Q),$.applyData(Z,Q)}function Ik($,Z){let H={href:z8(Z.url)};if(Z.title!==null&&Z.title!==void 0)H.title=Z.title;let B={type:"element",tagName:"a",properties:H,children:$.all(Z)};return $.patch(Z,B),$.applyData(Z,B)}function Rk($,Z,H){let B=$.all(Z),J=H?C20(H):kk(Z),Q={},X=[];if(typeof Z.checked==="boolean"){let U=B[0],Y;if(U&&U.type==="element"&&U.tagName==="p")Y=U;else Y={type:"element",tagName:"p",properties:{},children:[]},B.unshift(Y);if(Y.children.length>0)Y.children.unshift({type:"text",value:" "});Y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:Z.checked,disabled:!0},children:[]}),Q.className=["task-list-item"]}let z=-1;while(++z<B.length){let U=B[z];if(J||z!==0||U.type!=="element"||U.tagName!=="p")X.push({type:"text",value:`
|
|
38
|
+
`});if(U.type==="element"&&U.tagName==="p"&&!J)X.push(...U.children);else X.push(U)}let G=B[B.length-1];if(G&&(J||G.type!=="element"||G.tagName!=="p"))X.push({type:"text",value:`
|
|
39
|
+
`});let F={type:"element",tagName:"li",properties:Q,children:X};return $.patch(Z,F),$.applyData(Z,F)}function C20($){let Z=!1;if($.type==="list"){Z=$.spread||!1;let H=$.children,B=-1;while(!Z&&++B<H.length)Z=kk(H[B])}return Z}function kk($){let Z=$.spread;return Z===null||Z===void 0?$.children.length>1:Z}function bk($,Z){let H={},B=$.all(Z),J=-1;if(typeof Z.start==="number"&&Z.start!==1)H.start=Z.start;while(++J<B.length){let X=B[J];if(X.type==="element"&&X.tagName==="li"&&X.properties&&Array.isArray(X.properties.className)&&X.properties.className.includes("task-list-item")){H.className=["contains-task-list"];break}}let Q={type:"element",tagName:Z.ordered?"ol":"ul",properties:H,children:$.wrap(B,!0)};return $.patch(Z,Q),$.applyData(Z,Q)}function yk($,Z){let H={type:"element",tagName:"p",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function hk($,Z){let H={type:"root",children:$.wrap($.all(Z))};return $.patch(Z,H),$.applyData(Z,H)}function xk($,Z){let H={type:"element",tagName:"strong",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function vk($,Z){let H=$.all(Z),B=H.shift(),J=[];if(B){let X={type:"element",tagName:"thead",properties:{},children:$.wrap([B],!0)};$.patch(Z.children[0],X),J.push(X)}if(H.length>0){let X={type:"element",tagName:"tbody",properties:{},children:$.wrap(H,!0)},z=KZ(Z.children[1]),G=mF(Z.children[Z.children.length-1]);if(z&&G)X.position={start:z,end:G};J.push(X)}let Q={type:"element",tagName:"table",properties:{},children:$.wrap(J,!0)};return $.patch(Z,Q),$.applyData(Z,Q)}function gk($,Z,H){let B=H?H.children:void 0,Q=(B?B.indexOf(Z):1)===0?"th":"td",X=H&&H.type==="table"?H.align:void 0,z=X?X.length:Z.children.length,G=-1,F=[];while(++G<z){let Y=Z.children[G],K={},W=X?X[G]:void 0;if(W)K.align=W;let N={type:"element",tagName:Q,properties:K,children:[]};if(Y)N.children=$.all(Y),$.patch(Y,N),N=$.applyData(Y,N);F.push(N)}let U={type:"element",tagName:"tr",properties:{},children:$.wrap(F,!0)};return $.patch(Z,U),$.applyData(Z,U)}function fk($,Z){let H={type:"element",tagName:"td",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function pk($){let Z=String($),H=/\r?\n|\r/g,B=H.exec(Z),J=0,Q=[];while(B)Q.push(mk(Z.slice(J,B.index),J>0,!0),B[0]),J=B.index+B[0].length,B=H.exec(Z);return Q.push(mk(Z.slice(J),J>0,!1)),Q.join("")}function mk($,Z,H){let B=0,J=$.length;if(Z){let Q=$.codePointAt(B);while(Q===9||Q===32)B++,Q=$.codePointAt(B)}if(H){let Q=$.codePointAt(J-1);while(Q===9||Q===32)J--,Q=$.codePointAt(J-1)}return J>B?$.slice(B,J):""}function uk($,Z){let H={type:"text",value:pk(String(Z.value))};return $.patch(Z,H),$.applyData(Z,H)}function ck($,Z){let H={type:"element",tagName:"hr",properties:{},children:[]};return $.patch(Z,H),$.applyData(Z,H)}var dk={blockquote:Dk,break:qk,code:Mk,delete:Pk,emphasis:_k,footnoteReference:Ok,heading:jk,html:Tk,imageReference:Ck,image:wk,inlineCode:Ek,linkReference:Sk,link:Ik,listItem:Rk,list:bk,paragraph:yk,root:hk,strong:xk,table:vk,tableCell:fk,tableRow:gk,text:uk,thematicBreak:ck,toml:zU,yaml:zU,definition:zU,footnoteDefinition:zU};function zU(){return}var FA={}.hasOwnProperty,w20={};function ik($,Z){let H=Z||w20,B=new Map,J=new Map,Q=new Map,X={...dk,...H.handlers},z={all:F,applyData:S20,definitionById:B,footnoteById:J,footnoteCounts:Q,footnoteOrder:[],handlers:X,one:G,options:H,patch:E20,wrap:R20};return m9($,function(U){if(U.type==="definition"||U.type==="footnoteDefinition"){let Y=U.type==="definition"?B:J,K=String(U.identifier).toUpperCase();if(!Y.has(K))Y.set(K,U)}}),z;function G(U,Y){let K=U.type,W=z.handlers[K];if(FA.call(z.handlers,K)&&W)return W(z,U,Y);if(z.options.passThrough&&z.options.passThrough.includes(K)){if("children"in U){let{children:L,...V}=U,A=VZ(V);return A.children=z.all(U),A}return VZ(U)}return(z.options.unknownHandler||I20)(z,U,Y)}function F(U){let Y=[];if("children"in U){let K=U.children,W=-1;while(++W<K.length){let N=z.one(K[W],U);if(N){if(W&&K[W-1].type==="break"){if(!Array.isArray(N)&&N.type==="text")N.value=lk(N.value);if(!Array.isArray(N)&&N.type==="element"){let L=N.children[0];if(L&&L.type==="text")L.value=lk(L.value)}}if(Array.isArray(N))Y.push(...N);else Y.push(N)}}}return Y}}function E20($,Z){if($.position)Z.position=gL($)}function S20($,Z){let H=Z;if($&&$.data){let B=$.data.hName,J=$.data.hChildren,Q=$.data.hProperties;if(typeof B==="string")if(H.type==="element")H.tagName=B;else{let X="children"in H?H.children:[H];H={type:"element",tagName:B,properties:{},children:X}}if(H.type==="element"&&Q)Object.assign(H.properties,VZ(Q));if("children"in H&&H.children&&J!==null&&J!==void 0)H.children=J}return H}function I20($,Z){let H=Z.data||{},B="value"in Z&&!(FA.call(H,"hProperties")||FA.call(H,"hChildren"))?{type:"text",value:Z.value}:{type:"element",tagName:"div",properties:{},children:$.all(Z)};return $.patch(Z,B),$.applyData(Z,B)}function R20($,Z){let H=[],B=-1;if(Z)H.push({type:"text",value:`
|
|
40
|
+
`});while(++B<$.length){if(B)H.push({type:"text",value:`
|
|
41
|
+
`});H.push($[B])}if(Z&&$.length>0)H.push({type:"text",value:`
|
|
42
|
+
`});return H}function lk($){let Z=0,H=$.charCodeAt(Z);while(H===9||H===32)Z++,H=$.charCodeAt(Z);return $.slice(Z)}function GU($,Z){let H=ik($,Z),B=H.one($,void 0),J=Lk(H),Q=Array.isArray(B)?{type:"root",children:B}:B||{type:"root",children:[]};if(J)g1("children"in Q),Q.children.push({type:"text",value:`
|
|
43
|
+
`},J);return Q}function FU($,Z){if($&&"run"in $)return async function(H,B){let J=GU(H,{file:B,...Z});await $.run(J,B)};return function(H,B){return GU(H,{file:B,...$||Z})}}function UA($){if($)throw $}var KU=O(Zb(),1);function FJ($){if(typeof $!=="object"||$===null)return!1;let Z=Object.getPrototypeOf($);return(Z===null||Z===Object.prototype||Object.getPrototypeOf(Z)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}function YA(){let $=[],Z={run:H,use:B};return Z;function H(...J){let Q=-1,X=J.pop();if(typeof X!=="function")throw TypeError("Expected function as last argument, not "+X);z(null,...J);function z(G,...F){let U=$[++Q],Y=-1;if(G){X(G);return}while(++Y<J.length)if(F[Y]===null||F[Y]===void 0)F[Y]=J[Y];if(J=F,U)Hb(U,z)(...F);else X(null,...F)}}function B(J){if(typeof J!=="function")throw TypeError("Expected `middelware` to be a function, not "+J);return $.push(J),Z}}function Hb($,Z){let H;return B;function B(...X){let z=$.length>X.length,G;if(z)X.push(J);try{G=$.apply(this,X)}catch(F){let U=F;if(z&&H)throw U;return J(U)}if(!z)if(G&&G.then&&typeof G.then==="function")G.then(Q,J);else if(G instanceof Error)J(G);else Q(G)}function J(X,...z){if(!H)H=!0,Z(X,...z)}function Q(X){J(null,X)}}var T8={basename:k20,dirname:b20,extname:y20,join:h20,sep:"/"};function k20($,Z){if(Z!==void 0&&typeof Z!=="string")throw TypeError('"ext" argument must be a string');UJ($);let H=0,B=-1,J=$.length,Q;if(Z===void 0||Z.length===0||Z.length>$.length){while(J--)if($.codePointAt(J)===47){if(Q){H=J+1;break}}else if(B<0)Q=!0,B=J+1;return B<0?"":$.slice(H,B)}if(Z===$)return"";let X=-1,z=Z.length-1;while(J--)if($.codePointAt(J)===47){if(Q){H=J+1;break}}else{if(X<0)Q=!0,X=J+1;if(z>-1)if($.codePointAt(J)===Z.codePointAt(z--)){if(z<0)B=J}else z=-1,B=X}if(H===B)B=X;else if(B<0)B=$.length;return $.slice(H,B)}function b20($){if(UJ($),$.length===0)return".";let Z=-1,H=$.length,B;while(--H)if($.codePointAt(H)===47){if(B){Z=H;break}}else if(!B)B=!0;return Z<0?$.codePointAt(0)===47?"/":".":Z===1&&$.codePointAt(0)===47?"//":$.slice(0,Z)}function y20($){UJ($);let Z=$.length,H=-1,B=0,J=-1,Q=0,X;while(Z--){let z=$.codePointAt(Z);if(z===47){if(X){B=Z+1;break}continue}if(H<0)X=!0,H=Z+1;if(z===46){if(J<0)J=Z;else if(Q!==1)Q=1}else if(J>-1)Q=-1}if(J<0||H<0||Q===0||Q===1&&J===H-1&&J===B+1)return"";return $.slice(J,H)}function h20(...$){let Z=-1,H;while(++Z<$.length)if(UJ($[Z]),$[Z])H=H===void 0?$[Z]:H+"/"+$[Z];return H===void 0?".":x20(H)}function x20($){UJ($);let Z=$.codePointAt(0)===47,H=v20($,!Z);if(H.length===0&&!Z)H=".";if(H.length>0&&$.codePointAt($.length-1)===47)H+="/";return Z?"/"+H:H}function v20($,Z){let H="",B=0,J=-1,Q=0,X=-1,z,G;while(++X<=$.length){if(X<$.length)z=$.codePointAt(X);else if(z===47)break;else z=47;if(z===47){if(J===X-1||Q===1);else if(J!==X-1&&Q===2){if(H.length<2||B!==2||H.codePointAt(H.length-1)!==46||H.codePointAt(H.length-2)!==46){if(H.length>2){if(G=H.lastIndexOf("/"),G!==H.length-1){if(G<0)H="",B=0;else H=H.slice(0,G),B=H.length-1-H.lastIndexOf("/");J=X,Q=0;continue}}else if(H.length>0){H="",B=0,J=X,Q=0;continue}}if(Z)H=H.length>0?H+"/..":"..",B=2}else{if(H.length>0)H+="/"+$.slice(J+1,X);else H=$.slice(J+1,X);B=X-J-1}J=X,Q=0}else if(z===46&&Q>-1)Q++;else Q=-1}return H}function UJ($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}var Bb={cwd:g20};function g20(){return"/"}function DZ($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}function Jb($){if(typeof $==="string")$=new URL($);else if(!DZ($)){let Z=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+$+"`");throw Z.code="ERR_INVALID_ARG_TYPE",Z}if($.protocol!=="file:"){let Z=TypeError("The URL must be of scheme file");throw Z.code="ERR_INVALID_URL_SCHEME",Z}return f20($)}function f20($){if($.hostname!==""){let B=TypeError('File URL host must be "localhost" or empty on darwin');throw B.code="ERR_INVALID_FILE_URL_HOST",B}let Z=$.pathname,H=-1;while(++H<Z.length)if(Z.codePointAt(H)===37&&Z.codePointAt(H+1)===50){let B=Z.codePointAt(H+2);if(B===70||B===102){let J=TypeError("File URL path must not include encoded / characters");throw J.code="ERR_INVALID_FILE_URL_PATH",J}}return decodeURIComponent(Z)}var KA=["history","path","basename","stem","extname","dirname"];class qZ{constructor($){let Z;if(!$)Z={};else if(DZ($))Z={path:$};else if(typeof $==="string"||m20($))Z={value:$};else Z=$;this.cwd="cwd"in Z?"":Bb.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let H=-1;while(++H<KA.length){let J=KA[H];if(J in Z&&Z[J]!==void 0&&Z[J]!==null)this[J]=J==="history"?[...Z[J]]:Z[J]}let B;for(B in Z)if(!KA.includes(B))this[B]=Z[B]}get basename(){return typeof this.path==="string"?T8.basename(this.path):void 0}set basename($){NA($,"basename"),WA($,"basename"),this.path=T8.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?T8.dirname(this.path):void 0}set dirname($){Qb(this.basename,"dirname"),this.path=T8.join($||"",this.basename)}get extname(){return typeof this.path==="string"?T8.extname(this.path):void 0}set extname($){if(WA($,"extname"),Qb(this.dirname,"extname"),$){if($.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if($.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=T8.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(DZ($))$=Jb($);if(NA($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?T8.basename(this.path,this.extname):void 0}set stem($){NA($,"stem"),WA($,"stem"),this.path=T8.join(this.dirname||"",$+(this.extname||""))}fail($,Z,H){let B=this.message($,Z,H);throw B.fatal=!0,B}info($,Z,H){let B=this.message($,Z,H);return B.fatal=void 0,B}message($,Z,H){let B=new t5($,Z,H);if(this.path)B.name=this.path+":"+B.name,B.file=this.path;return B.fatal=!1,this.messages.push(B),B}toString($){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder($||void 0).decode(this.value)}}function WA($,Z){if($&&$.includes(T8.sep))throw Error("`"+Z+"` cannot be a path: did not expect `"+T8.sep+"`")}function NA($,Z){if(!$)throw Error("`"+Z+"` cannot be empty")}function Qb($,Z){if(!$)throw Error("Setting `"+Z+"` requires `path` to be set too")}function m20($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var Xb=function($){let B=this.constructor.prototype,J=B[$],Q=function(){return J.apply(Q,arguments)};return Object.setPrototypeOf(Q,B),Q};var p20={}.hasOwnProperty;class DA extends Xb{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=YA()}copy(){let $=new DA,Z=-1;while(++Z<this.attachers.length){let H=this.attachers[Z];$.use(...H)}return $.data(KU.default(!0,{},this.namespace)),$}data($,Z){if(typeof $==="string"){if(arguments.length===2)return VA("data",this.frozen),this.namespace[$]=Z,this;return p20.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return VA("data",this.frozen),this.namespace=$,this;return this.namespace}freeze(){if(this.frozen)return this;let $=this;while(++this.freezeIndex<this.attachers.length){let[Z,...H]=this.attachers[this.freezeIndex];if(H[0]===!1)continue;if(H[0]===!0)H[0]=void 0;let B=Z.call($,...H);if(typeof B==="function")this.transformers.use(B)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse($){this.freeze();let Z=YU($),H=this.parser||this.Parser;return LA("parse",H),H(String(Z),Z)}process($,Z){let H=this;return this.freeze(),LA("process",this.parser||this.Parser),AA("process",this.compiler||this.Compiler),Z?B(void 0,Z):new Promise(B);function B(J,Q){let X=YU($),z=H.parse(X);H.run(z,X,function(F,U,Y){if(F||!U||!Y)return G(F);let K=U,W=H.stringify(K,Y);if(c20(W))Y.value=W;else Y.result=W;G(F,Y)});function G(F,U){if(F||!U)Q(F);else if(J)J(U);else g1(Z,"`done` is defined if `resolve` is not"),Z(void 0,U)}}}processSync($){let Z=!1,H;return this.freeze(),LA("processSync",this.parser||this.Parser),AA("processSync",this.compiler||this.Compiler),this.process($,B),Gb("processSync","process",Z),g1(H,"we either bailed on an error or have a tree"),H;function B(J,Q){Z=!0,UA(J),H=Q}}run($,Z,H){zb($),this.freeze();let B=this.transformers;if(!H&&typeof Z==="function")H=Z,Z=void 0;return H?J(void 0,H):new Promise(J);function J(Q,X){g1(typeof Z!=="function","`file` can’t be a `done` anymore, we checked");let z=YU(Z);B.run($,z,G);function G(F,U,Y){let K=U||$;if(F)X(F);else if(Q)Q(K);else g1(H,"`done` is defined if `resolve` is not"),H(void 0,K,Y)}}}runSync($,Z){let H=!1,B;return this.run($,Z,J),Gb("runSync","run",H),g1(B,"we either bailed on an error or have a tree"),B;function J(Q,X){UA(Q),B=X,H=!0}}stringify($,Z){this.freeze();let H=YU(Z),B=this.compiler||this.Compiler;return AA("stringify",B),zb($),B($,H)}use($,...Z){let H=this.attachers,B=this.namespace;if(VA("use",this.frozen),$===null||$===void 0);else if(typeof $==="function")z($,Z);else if(typeof $==="object")if(Array.isArray($))X($);else Q($);else throw TypeError("Expected usable value, not `"+$+"`");return this;function J(G){if(typeof G==="function")z(G,[]);else if(typeof G==="object")if(Array.isArray(G)){let[F,...U]=G;z(F,U)}else Q(G);else throw TypeError("Expected usable value, not `"+G+"`")}function Q(G){if(!("plugins"in G)&&!("settings"in G))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(X(G.plugins),G.settings)B.settings=KU.default(!0,B.settings,G.settings)}function X(G){let F=-1;if(G===null||G===void 0);else if(Array.isArray(G))while(++F<G.length){let U=G[F];J(U)}else throw TypeError("Expected a list of plugins, not `"+G+"`")}function z(G,F){let U=-1,Y=-1;while(++U<H.length)if(H[U][0]===G){Y=U;break}if(Y===-1)H.push([G,...F]);else if(F.length>0){let[K,...W]=F,N=H[Y][1];if(FJ(N)&&FJ(K))K=KU.default(!0,N,K);H[Y]=[G,K,...W]}}}}var qA=new DA().freeze();function LA($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function AA($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function VA($,Z){if(Z)throw Error("Cannot call `"+$+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zb($){if(!FJ($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function Gb($,Z,H){if(!H)throw Error("`"+$+"` finished async. Use `"+Z+"` instead")}function YU($){return u20($)?$:new qZ($)}function u20($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function c20($){return typeof $==="string"||d20($)}function d20($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var l20="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Fb=[],Ub={allowDangerousHtml:!0},i20=/^(https?|ircs?|mailto|xmpp)$/i,r20=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function WU($){let Z=a20($),H=n20($);return o20(Z.runSync(Z.parse(H),H),$)}function a20($){let Z=$.rehypePlugins||Fb,H=$.remarkPlugins||Fb,B=$.remarkRehypeOptions?{...$.remarkRehypeOptions,...Ub}:Ub;return qA().use(tF).use(H).use(FU,B).use(Z)}function n20($){let Z=$.children||"",H=new qZ;if(typeof Z==="string")H.value=Z;else yF("Unexpected value `"+Z+"` for `children` prop, expected `string`");return H}function o20($,Z){let{allowedElements:H,allowElement:B,components:J,disallowedElements:Q,skipHtml:X,unwrapDisallowed:z}=Z,G=Z.urlTransform||Kb;for(let U of r20)if(Object.hasOwn(Z,U.from))yF("Unexpected `"+U.from+"` prop, "+(U.to?"use `"+U.to+"` instead":"remove it")+" (see <"+l20+"#"+U.id+"> for more info)");if(H&&Q)yF("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return m9($,F),pL($,{Fragment:MZ.Fragment,components:J,ignoreInvalidStyle:!0,jsx:MZ.jsx,jsxs:MZ.jsxs,passKeys:!0,passNode:!0});function F(U,Y,K){if(U.type==="raw"&&K&&typeof Y==="number"){if(X)K.children.splice(Y,1);else K.children[Y]={type:"text",value:U.value};return Y}if(U.type==="element"){let W;for(W in sB)if(Object.hasOwn(sB,W)&&Object.hasOwn(U.properties,W)){let N=U.properties[W],L=sB[W];if(L===null||L.includes(U.tagName))U.properties[W]=G(String(N||""),W,U)}}if(U.type==="element"){let W=H?!H.includes(U.tagName):Q?Q.includes(U.tagName):!1;if(!W&&B&&typeof Y==="number")W=!B(U,Y,K);if(W&&K&&typeof Y==="number"){if(z&&U.children)K.children.splice(Y,1,...U.children);else K.children.splice(Y,1);return Y}}}}function Kb($){let Z=$.indexOf(":"),H=$.indexOf("?"),B=$.indexOf("#"),J=$.indexOf("/");if(Z===-1||J!==-1&&Z>J||H!==-1&&Z>H||B!==-1&&Z>B||i20.test($.slice(0,Z)))return $;return""}var NU=function($,Z,H){let B=A9(H);if(!$||!$.type||!$.children)throw Error("Expected parent node");if(typeof Z==="number"){if(Z<0||Z===Number.POSITIVE_INFINITY)throw Error("Expected positive finite number as index")}else if(Z=$.children.indexOf(Z),Z<0)throw Error("Expected child node or index");while(++Z<$.children.length)if(B($.children[Z],Z,$))return $.children[Z];return};var p9=function($){if($===null||$===void 0)return e20;if(typeof $==="string")return t20($);if(typeof $==="object")return s20($);if(typeof $==="function")return MA($);throw Error("Expected function, string, or array as `test`")};function s20($){let Z=[],H=-1;while(++H<$.length)Z[H]=p9($[H]);return MA(B);function B(...J){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,J))return!0;return!1}}function t20($){return MA(Z);function Z(H){return H.tagName===$}}function MA($){return Z;function Z(H,B,J){return Boolean($40(H)&&$.call(this,H,typeof B==="number"?B:void 0,J||void 0))}}function e20($){return Boolean($&&typeof $==="object"&&"type"in $&&$.type==="element"&&"tagName"in $&&typeof $.tagName==="string")}function $40($){return $!==null&&typeof $==="object"&&"type"in $&&"tagName"in $}var Wb=/\n/g,Nb=/[\t ]+/g,PA=p9("br"),Lb=p9(z40),Z40=p9("p"),Ab=p9("tr"),H40=p9(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",X40,G40]),Vb=p9(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function _A($,Z){let H=Z||{},B="children"in $?$.children:[],J=Vb($),Q=Mb($,{whitespace:H.whitespace||"normal",breakBefore:!1,breakAfter:!1}),X=[];if($.type==="text"||$.type==="comment")X.push(...qb($,{whitespace:Q,breakBefore:!0,breakAfter:!0}));let z=-1;while(++z<B.length)X.push(...Db(B[z],$,{whitespace:Q,breakBefore:z?void 0:J,breakAfter:z<B.length-1?PA(B[z+1]):J}));let G=[],F;z=-1;while(++z<X.length){let U=X[z];if(typeof U==="number"){if(F!==void 0&&U>F)F=U}else if(U){if(F!==void 0&&F>-1)G.push(`
|
|
44
|
+
`.repeat(F)||" ");F=-1,G.push(U)}}return G.join("")}function Db($,Z,H){if($.type==="element")return B40($,Z,H);if($.type==="text")return H.whitespace==="normal"?qb($,H):J40($);return[]}function B40($,Z,H){let B=Mb($,H),J=$.children||[],Q=-1,X=[];if(H40($))return X;let z,G;if(PA($))G=`
|
|
45
|
+
`;else if(Ab($)&&NU(Z,$,Ab))G=`
|
|
46
|
+
`;else if(Z40($))z=2,G=2;else if(Vb($))z=1,G=1;while(++Q<J.length)X=X.concat(Db(J[Q],$,{whitespace:B,breakBefore:Q?void 0:z,breakAfter:Q<J.length-1?PA(J[Q+1]):G}));if(Lb($)&&NU(Z,$,Lb))X.push("\t");if(z)X.unshift(z);if(G)X.push(G);return X}function qb($,Z){let H=String($.value),B=[],J=[],Q=0;while(Q<=H.length){Wb.lastIndex=Q;let G=Wb.exec(H),F=G&&"index"in G?G.index:H.length;B.push(Q40(H.slice(Q,F).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),Q===0?Z.breakBefore:!0,F===H.length?Z.breakAfter:!0)),Q=F+1}let X=-1,z;while(++X<B.length)if(B[X].charCodeAt(B[X].length-1)===8203||X<B.length-1&&B[X+1].charCodeAt(0)===8203)J.push(B[X]),z=void 0;else if(B[X]){if(typeof z==="number")J.push(z);J.push(B[X]),z=0}else if(X===0||X===B.length-1)J.push(0);return J}function J40($){return[String($.value)]}function Q40($,Z,H){let B=[],J=0,Q;while(J<$.length){Nb.lastIndex=J;let X=Nb.exec($);if(Q=X?X.index:$.length,!J&&!Q&&X&&!Z)B.push("");if(J!==Q)B.push($.slice(J,Q));J=X?Q+X[0].length:Q}if(J!==Q&&!H)B.push("");return B.join(" ")}function Mb($,Z){if($.type==="element"){let H=$.properties||{};switch($.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return H.wrap?"pre-wrap":"pre";case"td":case"th":return H.noWrap?"nowrap":Z.whitespace;case"textarea":return"pre-wrap";default:}}return Z.whitespace}function X40($){return Boolean(($.properties||{}).hidden)}function z40($){return $.tagName==="td"||$.tagName==="th"}function G40($){return $.tagName==="dialog"&&!($.properties||{}).open}function F40($){let Z=$.regex,H=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),B="decltype\\(auto\\)",J="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",F={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},U={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},Y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(F,{className:"string"}),{className:"string",begin:/<.*?>/},H,$.C_BLOCK_COMMENT_MODE]},K={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",N=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],L=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],V=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:L,keyword:N,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:V},M={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},P=[M,Y,z,H,$.C_BLOCK_COMMENT_MODE,U,F],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:P.concat([{begin:/\(/,end:/\)/,keywords:_,contains:P.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:_,relevance:0},{begin:W,returnBegin:!0,contains:[K],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[F,U]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[H,$.C_BLOCK_COMMENT_MODE,F,U,z,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",H,$.C_BLOCK_COMMENT_MODE,F,U,z]}]},z,H,$.C_BLOCK_COMMENT_MODE,Y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,R,M,P,[Y,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Pb($){let Z={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},H=F40($),B=H.keywords;return B.type=[...B.type,...Z.type],B.literal=[...B.literal,...Z.literal],B.built_in=[...B.built_in,...Z.built_in],B._hints=Z._hints,H.name="Arduino",H.aliases=["ino"],H.supersetOf="cpp",H}function _b($){let Z=$.regex,H={},B={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[H]}]};Object.assign(H,{className:"variable",variants:[{begin:Z.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},B]});let J={className:"subst",begin:/\$\(/,end:/\)/,contains:[$.BACKSLASH_ESCAPE]},Q=$.inherit($.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),X={begin:/<<-?\s*(?=\w+)/,starts:{contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},z={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,H,J]};J.contains.push(z);let G={match:/\\"/},F={className:"string",begin:/'/,end:/'/},U={match:/\\'/},Y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},$.NUMBER_MODE,H]},K=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],W=$.SHEBANG({binary:`(${K.join("|")})`,relevance:10}),N={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[$.inherit($.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},L=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],V=["true","false"],A={match:/(\/[a-z._-]+)+/},D=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],q=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],M=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:L,literal:V,built_in:[...D,...q,"set","shopt",..._,...M]},contains:[W,$.SHEBANG(),N,Y,Q,X,A,z,G,F,U,H]}}function Ob($){let Z=$.regex,H=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),B="decltype\\(auto\\)",J="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",F={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},U={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},Y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(F,{className:"string"}),{className:"string",begin:/<.*?>/},H,$.C_BLOCK_COMMENT_MODE]},K={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",V={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},A=[Y,z,H,$.C_BLOCK_COMMENT_MODE,U,F],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:V,contains:A.concat([{begin:/\(/,end:/\)/,keywords:V,contains:A.concat(["self"]),relevance:0}]),relevance:0},q={begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:V,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:V,relevance:0},{begin:W,returnBegin:!0,contains:[$.inherit(K,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:V,relevance:0,contains:[H,$.C_BLOCK_COMMENT_MODE,F,U,z,{begin:/\(/,end:/\)/,keywords:V,relevance:0,contains:["self",H,$.C_BLOCK_COMMENT_MODE,F,U,z]}]},z,H,$.C_BLOCK_COMMENT_MODE,Y]};return{name:"C",aliases:["h"],keywords:V,disableAutodetect:!0,illegal:"</",contains:[].concat(D,q,A,[Y,{begin:$.IDENT_RE+"::",keywords:V},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},$.TITLE_MODE]}]),exports:{preprocessor:Y,strings:F,keywords:V}}}function jb($){let Z=$.regex,H=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),B="decltype\\(auto\\)",J="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",F={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},U={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},Y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(F,{className:"string"}),{className:"string",begin:/<.*?>/},H,$.C_BLOCK_COMMENT_MODE]},K={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",N=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],L=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],V=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:L,keyword:N,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:V},M={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},P=[M,Y,z,H,$.C_BLOCK_COMMENT_MODE,U,F],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:P.concat([{begin:/\(/,end:/\)/,keywords:_,contains:P.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:_,relevance:0},{begin:W,returnBegin:!0,contains:[K],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[F,U]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[H,$.C_BLOCK_COMMENT_MODE,F,U,z,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",H,$.C_BLOCK_COMMENT_MODE,F,U,z]}]},z,H,$.C_BLOCK_COMMENT_MODE,Y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,R,M,P,[Y,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Tb($){let Z=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],H=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],B=["default","false","null","true"],J=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],Q=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],X={keyword:J.concat(Q),built_in:Z,literal:B},z=$.inherit($.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),G={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},F={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},U={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},Y=$.inherit(U,{illegal:/\n/}),K={className:"subst",begin:/\{/,end:/\}/,keywords:X},W=$.inherit(K,{illegal:/\n/}),N={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},$.BACKSLASH_ESCAPE,W]},L={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},K]},V=$.inherit(L,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},W]});K.contains=[L,N,U,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.C_BLOCK_COMMENT_MODE],W.contains=[V,N,Y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.inherit($.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let A={variants:[F,L,N,U,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},D={begin:"<",end:">",contains:[{beginKeywords:"in out"},z]},q=$.IDENT_RE+"(<"+$.IDENT_RE+"(\\s*,\\s*"+$.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+$.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:X,illegal:/::/,contains:[$.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},A,G,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},z,D,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[z,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[z,D,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+q+"\\s+)+"+$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:X,contains:[{beginKeywords:H.join(" "),relevance:0},{begin:$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[$.TITLE_MODE,D],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:X,relevance:0,contains:[A,G,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},_]}}var U40=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},Y40=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],K40=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],W40=[...Y40,...K40],N40=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),L40=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),A40=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),V40=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Cb($){let Z=$.regex,H=U40($),B={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},J="and or not only",Q=/@-?\w[\w]*(-\w+)*/,X="[a-zA-Z-][a-zA-Z0-9_-]*",z=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[H.BLOCK_COMMENT,B,H.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},H.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+L40.join("|")+")"},{begin:":(:)?("+A40.join("|")+")"}]},H.CSS_VARIABLE,{className:"attribute",begin:"\\b("+V40.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[H.BLOCK_COMMENT,H.HEXCOLOR,H.IMPORTANT,H.CSS_NUMBER_MODE,...z,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...z,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},H.FUNCTION_DISPATCH]},{begin:Z.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:Q},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:N40.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...z,H.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+W40.join("|")+")\\b"}]}}function wb($){let Z=$.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:Z.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:Z.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Eb($){let Q={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:Q,illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"string",variants:[$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[$.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Q,illegal:/["']/}]}]}}function Sb($){let Z=$.regex,H=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[$.HASH_COMMENT_MODE,$.QUOTE_STRING_MODE,$.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:Z.concat(H,Z.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function Ib($){let Z=$.regex,H={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:$.NUMBER_RE}]},B=$.COMMENT();B.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let J={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},Q={className:"literal",begin:/\bon|off|true|false|yes|no\b/},X={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},z={begin:/\[/,end:/\]/,contains:[B,Q,J,X,H,"self"],relevance:0},G=/[A-Za-z0-9_-]+/,F=/"(\\"|[^"])*"/,U=/'[^']*'/,Y=Z.either(G,F,U),K=Z.concat(Y,"(\\s*\\.\\s*",Y,")*",Z.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[B,{className:"section",begin:/\[+/,end:/\]+/},{begin:K,className:"attr",starts:{end:/$/,contains:[B,z,Q,J,X,H]}}]}}var PZ="[0-9](_*[0-9])*",LU=`\\.(${PZ})`,AU="[0-9a-fA-F](_*[0-9a-fA-F])*",Rb={className:"number",variants:[{begin:`(\\b(${PZ})((${LU})|\\.)?|(${LU}))[eE][+-]?(${PZ})[fFdD]?\\b`},{begin:`\\b(${PZ})((${LU})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${LU})[fFdD]?\\b`},{begin:`\\b(${PZ})[fFdD]\\b`},{begin:`\\b0[xX]((${AU})\\.?|(${AU})?\\.(${AU}))[pP][+-]?(${PZ})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${AU})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function kb($,Z,H){if(H===-1)return"";return $.replace(Z,(B)=>{return kb($,Z,H-1)})}function bb($){let Z=$.regex,H="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",B="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+kb("(?:<"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~(?:\\s*,\\s*"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~)*>)?",/~~~/g,2),G={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},F={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},U={className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[$.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:G,illegal:/<\/|#/,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[$.BACKSLASH_ESCAPE]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[Z.concat(/(?!else)/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"),/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"},contains:[U,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+B+"\\s+)",$.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:G,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[F,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,Rb,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},Rb,F]}}var D40=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],q40=["true","false","null","undefined","NaN","Infinity"],yb=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],hb=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],xb=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],M40=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],P40=[].concat(xb,yb,hb);function vb($){let Z=$.regex,H=(v,{after:u})=>{let C="</"+v[0].slice(1);return v.input.indexOf(C,u)!==-1},B="[A-Za-z$_][0-9A-Za-z$_]*",J={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,u)=>{let C=v[0].length+v.index,t=v.input[C];if(t==="<"||t===","){u.ignoreMatch();return}if(t===">"){if(!H(v,{after:C}))u.ignoreMatch()}let H0,x=v.input.substring(C);if(H0=x.match(/^\s*=/)){u.ignoreMatch();return}if(H0=x.match(/^\s+extends\s+/)){if(H0.index===0){u.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:D40,literal:q40,built_in:P40,"variable.language":M40},G="[0-9](_?[0-9])*",F="\\.([0-9](_?[0-9])*)",U="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",Y={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},K={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"xml"}},N={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"graphql"}},V={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,K]},D={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},q=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,N,L,V,{match:/\$\d+/},Y];K.contains=q.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(q)});let _=[].concat(D,K.contains),M=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(_)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M},T={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...yb,...hb]}},y={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},w={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},h={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function E(v){return Z.concat("(?!",v.join("|"),")")}let I={match:Z.concat(/\b/,E([...xb,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},S={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},k="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",b={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(k)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,N,L,V,D,{match:/\$\d+/},Y,R,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},b,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,$.REGEXP_MODE,{className:"function",begin:k,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:$.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:J.begin,end:J.end},{match:Q},{begin:X.begin,"on:begin":X.isTrulyOpeningTag,end:X.end}],subLanguage:"xml",contains:[{begin:X.begin,end:X.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},j,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},I,h,T,S,{match:/\$[(.]/}]}}function gb($){let Z={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},H={match:/[{}[\],:]/,className:"punctuation",relevance:0},B=["true","false","null"],J={scope:"literal",beginKeywords:B.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:B},contains:[Z,H,$.QUOTE_STRING_MODE,J,$.C_NUMBER_MODE,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var _Z="[0-9](_*[0-9])*",VU=`\\.(${_Z})`,DU="[0-9a-fA-F](_*[0-9a-fA-F])*",_40={className:"number",variants:[{begin:`(\\b(${_Z})((${VU})|\\.)?|(${VU}))[eE][+-]?(${_Z})[fFdD]?\\b`},{begin:`\\b(${_Z})((${VU})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${VU})[fFdD]?\\b`},{begin:`\\b(${_Z})[fFdD]\\b`},{begin:`\\b0[xX]((${DU})\\.?|(${DU})?\\.(${DU}))[pP][+-]?(${_Z})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${DU})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function fb($){let Z={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},H={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},B={className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"@"},J={className:"subst",begin:/\$\{/,end:/\}/,contains:[$.C_NUMBER_MODE]},Q={className:"variable",begin:"\\$"+$.UNDERSCORE_IDENT_RE},X={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[Q,J]},{begin:"'",end:"'",illegal:/\n/,contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[$.BACKSLASH_ESCAPE,Q,J]}]};J.contains.push(X);let z={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+$.UNDERSCORE_IDENT_RE+")?"},G={className:"meta",begin:"@"+$.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[$.inherit(X,{className:"string"}),"self"]}]},F=_40,U=$.COMMENT("/\\*","\\*/",{contains:[$.C_BLOCK_COMMENT_MODE]}),Y={variants:[{className:"type",begin:$.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},K=Y;return K.variants[1].contains=[Y],Y.variants[1].contains=[K],{name:"Kotlin",aliases:["kt","kts"],keywords:Z,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),$.C_LINE_COMMENT_MODE,U,H,B,z,G,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:Z,relevance:5,contains:[{begin:$.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[$.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Z,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[Y,$.C_LINE_COMMENT_MODE,U],relevance:0},$.C_LINE_COMMENT_MODE,U,z,G,X,$.C_NUMBER_MODE]},U]},{begin:[/class|interface|trait/,/\s+/,$.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},$.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},z,G]},X,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
47
|
+
`},F]}}var O40=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},j40=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],T40=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],C40=[...j40,...T40],w40=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),mb=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),pb=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),E40=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),S40=mb.concat(pb).sort().reverse();function ub($){let Z=O40($),H=S40,B="and or not only",J="[\\w-]+",Q="([\\w-]+|@\\{[\\w-]+\\})",X=[],z=[],G=function(q){return{className:"string",begin:"~?"+q+".*?"+q}},F=function(q,_,M){return{className:q,begin:_,relevance:M}},U={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:w40.join(" ")},Y={begin:"\\(",end:"\\)",contains:z,keywords:U,relevance:0};z.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,G("'"),G('"'),Z.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},Z.HEXCOLOR,Y,F("variable","@@?[\\w-]+",10),F("variable","@\\{[\\w-]+\\}"),F("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},Z.IMPORTANT,{beginKeywords:"and not"},Z.FUNCTION_DISPATCH);let K=z.concat({begin:/\{/,end:/\}/,contains:X}),W={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(z)},N={begin:Q+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+E40.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:z}}]},L={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:U,returnEnd:!0,contains:z,relevance:0}},V={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:K}},A={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:Q,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,W,F("keyword","all\\b"),F("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+C40.join("|")+")\\b",className:"selector-tag"},Z.CSS_NUMBER_MODE,F("selector-tag",Q,0),F("selector-id","#"+Q),F("selector-class","\\."+Q,0),F("selector-tag","&",0),Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+mb.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+pb.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:K},{begin:"!important"},Z.FUNCTION_DISPATCH]},D={begin:`[\\w-]+:(:)?(${H.join("|")})`,returnBegin:!0,contains:[A]};return X.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,L,V,D,N,A,W,Z.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:X}}function cb($){let B={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},J=[$.COMMENT("--(?!\\[=*\\[)","$"),$.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[B],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:$.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:J.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[$.inherit($.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:J}].concat(J)},$.C_NUMBER_MODE,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[B],relevance:5}])}}function db($){let Z={className:"variable",variants:[{begin:"\\$\\("+$.UNDERSCORE_IDENT_RE+"\\)",contains:[$.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},H={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,Z]},B={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[Z,H]},J={begin:"^"+$.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},Q={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},X={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[Z]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[$.HASH_COMMENT_MODE,Z,H,B,J,Q,X]}}function lb($){let Z=$.regex,H={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},B={begin:"^[-\\*]{3,}",end:"$"},J={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},Q={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},X={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},z=/[A-Za-z][A-Za-z0-9+.-]*/,G={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:Z.concat(/\[.+?\]\(/,z,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},F={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},U={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},Y=$.inherit(F,{contains:[]}),K=$.inherit(U,{contains:[]});F.contains.push(K),U.contains.push(Y);let W=[H,G];return[F,U,Y,K].forEach((A)=>{A.contains=A.contains.concat(W)}),W=W.concat(F,U),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:W},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:W}]}]},H,Q,F,U,{className:"quote",begin:"^>\\s+",contains:W,end:"$"},J,B,G,X,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ib($){let Z={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},H=/[a-zA-Z@][a-zA-Z0-9_]*/,z={"variable.language":["this","super"],$pattern:H,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},G={$pattern:H,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:z,illegal:"</",contains:[Z,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,$.C_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit($.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+G.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:G,contains:[$.UNDERSCORE_TITLE_MODE]},{begin:"\\."+$.UNDERSCORE_IDENT_RE,relevance:0}]}}function rb($){let Z=$.regex,H=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],B=/[dualxmsipngr]{0,12}/,J={$pattern:/[\w.]+/,keyword:H.join(" ")},Q={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:J},X={begin:/->\{/,end:/\}/},z={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},G={scope:"variable",variants:[{begin:/\$\d/},{begin:Z.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[z]},F={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},U=[$.BACKSLASH_ESCAPE,Q,G],Y=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],K=(L,V,A="\\1")=>{let D=A==="\\1"?A:Z.concat(A,V);return Z.concat(Z.concat("(?:",L,")"),V,/(?:\\.|[^\\\/])*?/,D,/(?:\\.|[^\\\/])*?/,A,B)},W=(L,V,A)=>{return Z.concat(Z.concat("(?:",L,")"),V,/(?:\\.|[^\\\/])*?/,A,B)},N=[G,$.HASH_COMMENT_MODE,$.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),X,{className:"string",contains:U,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},F,{begin:"(\\/\\/|"+$.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[$.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:K("s|tr|y",Z.either(...Y,{capture:!0}))},{begin:K("s|tr|y","\\(","\\)")},{begin:K("s|tr|y","\\[","\\]")},{begin:K("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:W("(?:m|qr)?",/\//,/\//)},{begin:W("m|qr",Z.either(...Y,{capture:!0}),/\1/)},{begin:W("m|qr",/\(/,/\)/)},{begin:W("m|qr",/\[/,/\]/)},{begin:W("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,z]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,z,F]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return Q.contains=N,X.contains=N,{name:"Perl",aliases:["pl","pm"],keywords:J,contains:N}}function ab($){let Z=$.regex,H=/(?![A-Za-z0-9])(?![$])/,B=Z.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,H),J=Z.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,H),Q=Z.concat(/[A-Z]+/,H),X={scope:"variable",match:"\\$+"+B},z={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},G={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},F=$.inherit($.APOS_STRING_MODE,{illegal:null}),U=$.inherit($.QUOTE_STRING_MODE,{illegal:null,contains:$.QUOTE_STRING_MODE.contains.concat(G)}),Y={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:$.QUOTE_STRING_MODE.contains.concat(G),"on:begin":(j,S)=>{S.data._beginMatch=j[1]||j[2]},"on:end":(j,S)=>{if(S.data._beginMatch!==j[1])S.ignoreMatch()}},K=$.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),W=`[
|
|
48
|
+
]`,N={scope:"string",variants:[U,F,Y,K]},L={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},V=["false","null","true"],A=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],D=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],_={keyword:A,literal:((j)=>{let S=[];return j.forEach((k)=>{if(S.push(k),k.toLowerCase()===k)S.push(k.toUpperCase());else S.push(k.toLowerCase())}),S})(V),built_in:D},M=(j)=>{return j.map((S)=>{return S.replace(/\|\d+$/,"")})},P={variants:[{match:[/new/,Z.concat(`[
|
|
49
|
+
]`,"+"),Z.concat("(?!",M(D).join("\\b|"),"\\b)"),J],scope:{1:"keyword",4:"title.class"}}]},T=Z.concat(B,"\\b(?!\\()"),R={variants:[{match:[Z.concat(/::/,Z.lookahead(/(?!class\b)/)),T],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[J,Z.concat(/::/,Z.lookahead(/(?!class\b)/)),T],scope:{1:"title.class",3:"variable.constant"}},{match:[J,Z.concat("::",Z.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[J,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},y={scope:"attr",match:Z.concat(B,Z.lookahead(":"),Z.lookahead(/(?!::)/))},w={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[y,X,R,$.C_BLOCK_COMMENT_MODE,N,L,P]},h={relevance:0,match:[/\b/,Z.concat("(?!fn\\b|function\\b|",M(A).join("\\b|"),"|",M(D).join("\\b|"),"\\b)"),B,Z.concat(`[
|
|
50
|
+
]`,"*"),Z.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(h);let E=[y,R,$.C_BLOCK_COMMENT_MODE,N,L,P],I={begin:Z.concat(/#\[\s*\\?/,Z.either(J,Q)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:V,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:V,keyword:["new","array"]},contains:["self",...E]},...E,{scope:"meta",variants:[{match:J},{match:Q}]}]};return{case_insensitive:!1,keywords:_,contains:[I,$.HASH_COMMENT_MODE,$.COMMENT("//","$"),$.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:$.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},z,{scope:"variable.language",match:/\$this\b/},X,h,R,{match:[/const/,/\s/,B],scope:{1:"keyword",3:"variable.constant"}},P,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},$.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",I,X,R,$.C_BLOCK_COMMENT_MODE,N,L]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},$.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[$.inherit($.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},$.UNDERSCORE_TITLE_MODE]},N,L]}}function nb($){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},$.inherit($.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),$.inherit($.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function ob($){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function sb($){let Z=$.regex,H=/[\p{XID_Start}_]\p{XID_Continue}*/u,B=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],z={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:B,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},G={className:"meta",begin:/^(>>>|\.\.\.) /},F={className:"subst",begin:/\{/,end:/\}/,keywords:z,illegal:/#/},U={begin:/\{\{/,relevance:0},Y={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,G],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,G,U,F]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G,U,F]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[$.BACKSLASH_ESCAPE,U,F]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,U,F]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},K="[0-9](_?[0-9])*",W="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",N=`\\b|${B.join("|")}`,L={className:"number",relevance:0,variants:[{begin:`(\\b([0-9](_?[0-9])*)|((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.))[eE][+-]?([0-9](_?[0-9])*)[jJ]?(?=${N})`},{begin:"((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.)[jJ]?"},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${N})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${N})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${N})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${N})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${N})`}]},V={className:"comment",begin:Z.lookahead(/# type:/),end:/$/,keywords:z,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:["self",G,L,Y,$.HASH_COMMENT_MODE]}]};return F.contains=[Y,L,G],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:z,illegal:/(<\/|\?)|=>/,contains:[G,L,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},Y,V,$.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,H],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,H,/\s*/,/\(\s*/,H,/\s*\)/]},{match:[/\bclass/,/\s+/,H]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[L,A,Y]}]}}function tb($){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function eb($){let Z=$.regex,H=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,B=Z.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),J=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,Q=Z.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:H,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[$.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:Z.lookahead(Z.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:H},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),$.HASH_COMMENT_MODE,{scope:"string",contains:[$.BACKSLASH_ESCAPE],variants:[$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[J,B]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,B]},{scope:{1:"punctuation",2:"number"},match:[Q,B]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,B]}]},{scope:{3:"operator"},match:[H,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:J},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:Q},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function $y($){let Z=$.regex,H="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",B=Z.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),J=Z.concat(B,/(::\w+)*/),X={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},z={className:"doctag",begin:"@[A-Za-z]+"},G={begin:"#<",end:">"},F=[$.COMMENT("#","$",{contains:[z]}),$.COMMENT("^=begin","^=end",{contains:[z],relevance:10}),$.COMMENT("^__END__",$.MATCH_NOTHING_RE)],U={className:"subst",begin:/#\{/,end:/\}/,keywords:X},Y={className:"string",contains:[$.BACKSLASH_ESCAPE,U],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:Z.concat(/<<[-~]?'?/,Z.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[$.BACKSLASH_ESCAPE,U]})]}]},K="[1-9](_?[0-9])*|0",W="[0-9](_?[0-9])*",N={className:"number",relevance:0,variants:[{begin:"\\b([1-9](_?[0-9])*|0)(\\.([0-9](_?[0-9])*))?([eE][+-]?([0-9](_?[0-9])*)|r)?i?\\b"},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},L={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:X}]},P=[Y,{variants:[{match:[/class\s+/,J,/\s+<\s+/,J]},{match:[/\b(class|module)\s+/,J]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:X},{match:[/(include|extend)\s+/,J],scope:{2:"title.class"},keywords:X},{relevance:0,match:[J,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:B,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[L]},{begin:$.IDENT_RE+"::"},{className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[Y,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},N,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:X},{begin:"("+$.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[$.BACKSLASH_ESCAPE,U],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(G,F),relevance:0}].concat(G,F);U.contains=P,L.contains=P;let T="[>?]>",R="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",y="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",w=[{begin:/^\s*=>/,starts:{end:"$",contains:P}},{className:"meta.prompt",begin:"^("+T+"|"+R+"|"+y+")(?=[ ])",starts:{end:"$",keywords:X,contains:P}}];return F.unshift(G),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:X,illegal:/\/\*/,contains:[$.SHEBANG({binary:"ruby"})].concat(w).concat(F).concat(P)}}function Zy($){let Z=$.regex,H=/(r#)?/,B=Z.concat(H,$.UNDERSCORE_IDENT_RE),J=Z.concat(H,$.IDENT_RE),Q={className:"title.function.invoke",relevance:0,begin:Z.concat(/\b/,/(?!let|for|while|if|else|match\b)/,J,Z.lookahead(/\s*\(/))},X="([ui](8|16|32|64|128|size)|f(32|64))?",z=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],G=["true","false","Some","None","Ok","Err"],F=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],U=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:$.IDENT_RE+"!?",type:U,keyword:z,literal:G,built_in:F},illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.COMMENT("/\\*","\\*/",{contains:["self"]}),$.inherit($.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?"}],relevance:0},{begin:[/fn/,/\s+/,B],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,B],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,B,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,B],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,B],className:{1:"keyword",3:"title.class"}},{begin:$.IDENT_RE+"::",keywords:{keyword:"Self",built_in:F,type:U}},{className:"punctuation",begin:"->"},Q]}}var I40=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},R40=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],k40=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],b40=[...R40,...k40],y40=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),h40=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),x40=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),v40=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Hy($){let Z=I40($),H=x40,B=h40,J="@[a-z-]+",Q="and or not only",X="[a-zA-Z-][a-zA-Z0-9_-]*",z={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,Z.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+b40.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+B.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+H.join("|")+")"},z,{begin:/\(/,end:/\)/,contains:[Z.CSS_NUMBER_MODE]},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+v40.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[Z.BLOCK_COMMENT,z,Z.HEXCOLOR,Z.CSS_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.IMPORTANT,Z.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:"@[a-z-]+",keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:y40.join(" ")},contains:[{begin:"@[a-z-]+",className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},z,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.HEXCOLOR,Z.CSS_NUMBER_MODE]},Z.FUNCTION_DISPATCH]}}function By($){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Jy($){let Z=$.regex,H=$.COMMENT("--","$"),B={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},J={begin:/"/,end:/"/,contains:[{match:/""/}]},Q=["true","false","unknown"],X=["double precision","large object","with timezone","without timezone"],z=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],G=["add","asc","collation","desc","final","first","last","view"],F=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],U=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],Y=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],K=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],W=U,N=[...F,...G].filter((M)=>{return!U.includes(M)}),L={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},V={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:Z.concat(/\b/,Z.either(...W),/\s*\(/),relevance:0,keywords:{built_in:W}};function D(M){return Z.concat(/\b/,Z.either(...M.map((P)=>{return P.replace(/\s+/,"\\s+")})),/\b/)}let q={scope:"keyword",match:D(K),relevance:0};function _(M,{exceptions:P,when:T}={}){let R=T;return P=P||[],M.map((y)=>{if(y.match(/\|\d+$/)||P.includes(y))return y;else if(R(y))return`${y}|0`;else return y})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(N,{when:(M)=>M.length<3}),literal:Q,type:z,built_in:Y},contains:[{scope:"type",match:D(X)},q,A,L,B,J,$.C_NUMBER_MODE,$.C_BLOCK_COMMENT_MODE,H,V]}}function Gy($){if(!$)return null;if(typeof $==="string")return $;return $.source}function YJ($){return X5("(?=",$,")")}function X5(...$){return $.map((H)=>Gy(H)).join("")}function g40($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function H4(...$){return"("+(g40($).capture?"":"?:")+$.map((B)=>Gy(B)).join("|")+")"}var TA=($)=>X5(/\b/,$,/\w$/.test($)?/\b/:/\B/),f40=["Protocol","Type"].map(TA),Qy=["init","self"].map(TA),m40=["Any","Self"],OA=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Xy=["false","nil","true"],p40=["assignment","associativity","higherThan","left","lowerThan","none","right"],u40=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],zy=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Fy=H4(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Uy=H4(Fy,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),jA=X5(Fy,Uy,"*"),Yy=H4(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),MU=H4(Yy,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),V9=X5(Yy,MU,"*"),qU=X5(/[A-Z]/,MU,"*"),c40=["attached","autoclosure",X5(/convention\(/,H4("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",X5(/objc\(/,V9,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],d40=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Ky($){let Z={match:/\s+/,relevance:0},H=$.COMMENT("/\\*","\\*/",{contains:["self"]}),B=[$.C_LINE_COMMENT_MODE,H],J={match:[/\./,H4(...f40,...Qy)],className:{2:"keyword"}},Q={match:X5(/\./,H4(...OA)),relevance:0},X=OA.filter((n)=>typeof n==="string").concat(["_|0"]),z=OA.filter((n)=>typeof n!=="string").concat(m40).map(TA),G={variants:[{className:"keyword",match:H4(...z,...Qy)}]},F={$pattern:H4(/\b\w+/,/#\w+/),keyword:X.concat(u40),literal:Xy},U=[J,Q,G],Y={match:X5(/\./,H4(...zy)),relevance:0},K={className:"built_in",match:X5(/\b/,H4(...zy),/(?=\()/)},W=[Y,K],N={match:/->/,relevance:0},L={className:"operator",relevance:0,variants:[{match:jA},{match:`\\.(\\.|${Uy})+`}]},V=[N,L],A="([0-9]_*)+",D="([0-9a-fA-F]_*)+",q={className:"number",relevance:0,variants:[{match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{match:"\\b0x(([0-9a-fA-F]_*)+)(\\.(([0-9a-fA-F]_*)+))?([pP][+-]?(([0-9]_*)+))?\\b"},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(n="")=>({className:"subst",variants:[{match:X5(/\\/,n,/[0\\tnr"']/)},{match:X5(/\\/,n,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(n="")=>({className:"subst",match:X5(/\\/,n,/[\t ]*(?:[\r\n]|\r\n)/)}),P=(n="")=>({className:"subst",label:"interpol",begin:X5(/\\/,n,/\(/),end:/\)/}),T=(n="")=>({begin:X5(n,/"""/),end:X5(/"""/,n),contains:[_(n),M(n),P(n)]}),R=(n="")=>({begin:X5(n,/"/),end:X5(/"/,n),contains:[_(n),P(n)]}),y={className:"string",variants:[T(),T("#"),T("##"),T("###"),R(),R("#"),R("##"),R("###")]},w=[$.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[$.BACKSLASH_ESCAPE]}],h={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:w},E=(n)=>{let f=X5(n,/\//),l=X5(/\//,n);return{begin:f,end:l,contains:[...w,{scope:"comment",begin:`#(?!.*${l})`,end:/$/}]}},I={scope:"regexp",variants:[E("###"),E("##"),E("#"),h]},j={match:X5(/`/,V9,/`/)},S={className:"variable",match:/\$\d+/},k={className:"variable",match:`\\$${MU}+`},b=[j,S,k],v={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:d40,contains:[...V,q,y]}]}},u={scope:"keyword",match:X5(/@/,H4(...c40),YJ(H4(/\(/,/\s+/)))},C={scope:"meta",match:X5(/@/,V9)},t=[v,u,C],H0={match:YJ(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:X5(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,MU,"+")},{className:"type",match:qU,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:X5(/\s+&\s+/,YJ(qU)),relevance:0}]},x={begin:/</,end:/>/,keywords:F,contains:[...B,...U,...t,N,H0]};H0.contains.push(x);let e={match:X5(V9,/\s*:/),keywords:"_|0",relevance:0},L0={begin:/\(/,end:/\)/,relevance:0,keywords:F,contains:["self",e,...B,I,...U,...W,...V,q,y,...b,...t,H0]},d={begin:/</,end:/>/,keywords:"repeat each",contains:[...B,H0]},X0={begin:H4(YJ(X5(V9,/\s*:/)),YJ(X5(V9,/\s+/,V9,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:V9}]},K0={begin:/\(/,end:/\)/,keywords:F,contains:[X0,...B,...U,...V,q,y,...t,H0,L0],endsParent:!0,illegal:/["']/},Q0={match:[/(func|macro)/,/\s+/,H4(j.match,V9,jA)],className:{1:"keyword",3:"title.function"},contains:[d,K0,Z],illegal:[/\[/,/%/]},z0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[d,K0,Z],illegal:/\[|%/},A0={match:[/operator/,/\s+/,jA],className:{1:"keyword",3:"title"}},i={begin:[/precedencegroup/,/\s+/,qU],className:{1:"keyword",3:"title"},contains:[H0],keywords:[...p40,...Xy],end:/}/},B0={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},$0={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},J0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,V9,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:F,contains:[d,...U,{begin:/:/,end:/\{/,keywords:F,contains:[{scope:"title.class.inherited",match:qU},...U],relevance:0}]};for(let n of y.variants){let f=n.contains.find((m)=>m.label==="interpol");f.keywords=F;let l=[...U,...W,...V,q,y,...b];f.contains=[...l,{begin:/\(/,end:/\)/,contains:["self",...l]}]}return{name:"Swift",keywords:F,contains:[...B,Q0,z0,B0,$0,J0,A0,i,{beginKeywords:"import",end:/$/,contains:[...B],relevance:0},I,...U,...W,...V,q,y,...b,...t,H0,L0]}}var Wy=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Ny=["true","false","null","undefined","NaN","Infinity"],Ly=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Ay=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Vy=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Dy=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],qy=[].concat(Vy,Ly,Ay);function l40($){let Z=$.regex,H=(v,{after:u})=>{let C="</"+v[0].slice(1);return v.input.indexOf(C,u)!==-1},B="[A-Za-z$_][0-9A-Za-z$_]*",J={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,u)=>{let C=v[0].length+v.index,t=v.input[C];if(t==="<"||t===","){u.ignoreMatch();return}if(t===">"){if(!H(v,{after:C}))u.ignoreMatch()}let H0,x=v.input.substring(C);if(H0=x.match(/^\s*=/)){u.ignoreMatch();return}if(H0=x.match(/^\s+extends\s+/)){if(H0.index===0){u.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Wy,literal:Ny,built_in:qy,"variable.language":Dy},G="[0-9](_?[0-9])*",F="\\.([0-9](_?[0-9])*)",U="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",Y={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},K={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"xml"}},N={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"graphql"}},V={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,K]},D={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},q=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,N,L,V,{match:/\$\d+/},Y];K.contains=q.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(q)});let _=[].concat(D,K.contains),M=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(_)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M},T={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ly,...Ay]}},y={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},w={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},h={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function E(v){return Z.concat("(?!",v.join("|"),")")}let I={match:Z.concat(/\b/,E([...Vy,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},S={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},k="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",b={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(k)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,N,L,V,D,{match:/\$\d+/},Y,R,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},b,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,$.REGEXP_MODE,{className:"function",begin:k,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:$.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:J.begin,end:J.end},{match:Q},{begin:X.begin,"on:begin":X.isTrulyOpeningTag,end:X.end}],subLanguage:"xml",contains:[{begin:X.begin,end:X.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},j,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},I,h,T,S,{match:/\$[(.]/}]}}function My($){let Z=$.regex,H=l40($),B="[A-Za-z$_][0-9A-Za-z$_]*",J=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],Q={begin:[/namespace/,/\s+/,$.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},X={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:J},contains:[H.exports.CLASS_REFERENCE]},z={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},G=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],F={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Wy.concat(G),literal:Ny,built_in:qy.concat(J),"variable.language":Dy},U={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},Y=(L,V,A)=>{let D=L.contains.findIndex((q)=>q.label===V);if(D===-1)throw Error("can not find mode to replace");L.contains.splice(D,1,A)};Object.assign(H.keywords,F),H.exports.PARAMS_CONTAINS.push(U);let K=H.contains.find((L)=>L.scope==="attr"),W=Object.assign({},K,{match:Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\?:/))});H.exports.PARAMS_CONTAINS.push([H.exports.CLASS_REFERENCE,K,W]),H.contains=H.contains.concat([U,Q,X,W]),Y(H,"shebang",$.SHEBANG()),Y(H,"use_strict",z);let N=H.contains.find((L)=>L.label==="func.def");return N.relevance=0,Object.assign(H,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),H}function Py($){let Z=$.regex,H={className:"string",begin:/"(""|[^/n])"C\b/},B={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},J=/\d{1,2}\/\d{1,2}\/\d{4}/,Q=/\d{4}-\d{1,2}-\d{1,2}/,X=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,z=/\d{1,2}(:\d{1,2}){1,2}/,G={className:"literal",variants:[{begin:Z.concat(/# */,Z.either(Q,J),/ *#/)},{begin:Z.concat(/# */,z,/ *#/)},{begin:Z.concat(/# */,X,/ *#/)},{begin:Z.concat(/# */,Z.either(Q,J),/ +/,Z.either(X,z),/ *#/)}]},F={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},U={className:"label",begin:/^\w+:/},Y=$.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),K=$.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[H,B,G,F,U,Y,K,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[K]}]}}function _y($){$.regex;let Z=$.COMMENT(/\(;/,/;\)/);Z.contains.push("self");let H=$.COMMENT(/;;/,/$/),B=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],J={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},Q={className:"variable",begin:/\$[\w_]+/},X={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},z={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},G={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},F={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:B},contains:[H,Z,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},Q,X,J,$.QUOTE_STRING_MODE,G,F,z]}}function Oy($){let Z=$.regex,H=Z.concat(/[\p{L}_]/u,Z.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),B=/[\p{L}0-9._:-]+/u,J={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},Q={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},X=$.inherit(Q,{begin:/\(/,end:/\)/}),z=$.inherit($.APOS_STRING_MODE,{className:"string"}),G=$.inherit($.QUOTE_STRING_MODE,{className:"string"}),F={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:B,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[J]},{begin:/'/,end:/'/,contains:[J]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[Q,G,z,X,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[Q,X,G,z]}]}]},$.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},J,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[G]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[F],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[F],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:Z.concat(/</,Z.lookahead(Z.concat(H,Z.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:H,relevance:0,starts:F}]},{className:"tag",begin:Z.concat(/<\//,Z.lookahead(Z.concat(H,/>/))),contains:[{className:"name",begin:H,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function jy($){let B={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},J={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},Q={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},X={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[$.BACKSLASH_ESCAPE,J]},z=$.inherit(X,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),G="[0-9]{4}(-[0-9][0-9]){0,2}",F="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",U="(\\.[0-9]*)?",Y="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",K={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},W={end:",",endsWithParent:!0,excludeEnd:!0,keywords:"true false yes no null",relevance:0},N={begin:/\{/,end:/\}/,contains:[W],illegal:"\\n",relevance:0},L={begin:"\\[",end:"\\]",contains:[W],illegal:"\\n",relevance:0},V=[B,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!<[\\w#;/?:@&=+$,.~*'()[\\]]+>"},{className:"type",begin:"![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"meta",begin:"&"+$.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+$.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},$.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},K,{className:"number",begin:$.C_NUMBER_RE+"\\b",relevance:0},N,L,Q,X],A=[...V];return A.pop(),A.push(z),W.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:V}}var CA={arduino:Pb,bash:_b,c:Ob,cpp:jb,csharp:Tb,css:Cb,diff:wb,go:Eb,graphql:Sb,ini:Ib,java:bb,javascript:vb,json:gb,kotlin:fb,less:ub,lua:cb,makefile:db,markdown:lb,objectivec:ib,perl:rb,php:ab,"php-template":nb,plaintext:ob,python:sb,"python-repl":tb,r:eb,ruby:$y,rust:Zy,scss:Hy,shell:By,sql:Jy,swift:Ky,typescript:My,vbnet:Py,wasm:_y,xml:Oy,yaml:jy};var ay=O(ry(),1);var ny=ay.default;var oy={},h80="hljs-";function bA($){let Z=ny.newInstance();if($)Q($);return{highlight:H,highlightAuto:B,listLanguages:J,register:Q,registerAlias:X,registered:z};function H(G,F,U){g1(typeof G==="string","expected `string` as `name`"),g1(typeof F==="string","expected `string` as `value`");let Y=U||oy,K=typeof Y.prefix==="string"?Y.prefix:h80;if(!Z.getLanguage(G))throw Error("Unknown language: `"+G+"` is not registered");Z.configure({__emitter:sy,classPrefix:K});let W=Z.highlight(F,{ignoreIllegals:!0,language:G});if(W.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:W.errorRaised});let N=W._emitter.root,L=N.data;return L.language=W.language,L.relevance=W.relevance,N}function B(G,F){g1(typeof G==="string","expected `string` as `value`");let Y=(F||oy).subset||J(),K=-1,W=0,N;while(++K<Y.length){let L=Y[K];if(!Z.getLanguage(L))continue;let V=H(L,G,F);if(V.data&&V.data.relevance!==void 0&&V.data.relevance>W)W=V.data.relevance,N=V}return N||{type:"root",children:[],data:{language:void 0,relevance:W}}}function J(){return Z.listLanguages()}function Q(G,F){if(typeof G==="string")g1(F!==void 0,"expected `grammar`"),Z.registerLanguage(G,F);else{let U;for(U in G)if(Object.hasOwn(G,U))Z.registerLanguage(U,G[U])}}function X(G,F){if(typeof G==="string")g1(F!==void 0),Z.registerAliases(typeof F==="string"?F:[...F],{languageName:G});else{let U;for(U in G)if(Object.hasOwn(G,U)){let Y=G[U];Z.registerAliases(typeof Y==="string"?Y:[...Y],{languageName:U})}}}function z(G){return Boolean(Z.getLanguage(G))}}class sy{constructor($){this.options=$,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText($){if($==="")return;let Z=this.stack[this.stack.length-1],H=Z.children[Z.children.length-1];if(H&&H.type==="text")H.value+=$;else Z.children.push({type:"text",value:$})}startScope($){this.openNode(String($))}endScope(){this.closeNode()}__addSublanguage($,Z){let H=this.stack[this.stack.length-1],B=$.root.children;if(Z)H.children.push({type:"element",tagName:"span",properties:{className:[Z]},children:B});else H.children.push(...B)}openNode($){let Z=this,H=$.split(".").map(function(Q,X){return X?Q+"_".repeat(X):Z.options.classPrefix+Q}),B=this.stack[this.stack.length-1],J={type:"element",tagName:"span",properties:{className:H},children:[]};B.children.push(J),this.stack.push(J)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var x80={};function jU($){let Z=$||x80,H=Z.aliases,B=Z.detect||!1,J=Z.languages||CA,Q=Z.plainText,X=Z.prefix,z=Z.subset,G="hljs",F=bA(J);if(H)F.registerAlias(H);if(X){let U=X.indexOf("-");G=U===-1?X:X.slice(0,U)}return function(U,Y){m9(U,"element",function(K,W,N){if(K.tagName!=="code"||!N||N.type!=="element"||N.tagName!=="pre")return;let L=v80(K);if(L===!1||!L&&!B||L&&Q&&Q.includes(L))return;if(!Array.isArray(K.properties.className))K.properties.className=[];if(!K.properties.className.includes(G))K.properties.className.unshift(G);let V=_A(K,{whitespace:"pre"}),A;try{A=L?F.highlight(L,V,{prefix:X}):F.highlightAuto(V,{prefix:X,subset:z})}catch(D){let q=D;if(L&&/Unknown language/.test(q.message)){Y.message("Cannot highlight as `"+L+"`, it’s not registered",{ancestors:[N,K],cause:q,place:K.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw q}if(!L&&A.data&&A.data.language)K.properties.className.push("language-"+A.data.language);if(A.children.length>0)K.children=A.children})}}function v80($){let Z=$.properties.className,H=-1;if(!Array.isArray(Z))return;let B;while(++H<Z.length){let J=String(Z[H]);if(J==="no-highlight"||J==="nohighlight")return!1;if(!B&&J.slice(0,5)==="lang-")B=J.slice(5);if(!B&&J.slice(0,9)==="language-")B=J.slice(9)}return B}function yA($,Z){let H=String($);if(typeof Z!=="string")throw TypeError("Expected character");let B=0,J=H.indexOf(Z);while(J!==-1)B++,J=H.indexOf(Z,J+Z.length);return B}function hA($){if(typeof $!=="string")throw TypeError("Expected a string");return $.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function xA($,Z,H){let J=A9((H||{}).ignore||[]),Q=g80(Z),X=-1;while(++X<Q.length)GJ($,"text",z);function z(F,U){let Y=-1,K;while(++Y<U.length){let W=U[Y],N=K?K.children:void 0;if(J(W,N?N.indexOf(W):void 0,K))return;K=W}if(K)return G(F,U)}function G(F,U){let Y=U[U.length-1],K=Q[X][0],W=Q[X][1],N=0,V=Y.children.indexOf(F),A=!1,D=[];K.lastIndex=0;let q=K.exec(F.value);while(q){let _=q.index,M={index:q.index,input:q.input,stack:[...U,F]},P=W(...q,M);if(typeof P==="string")P=P.length>0?{type:"text",value:P}:void 0;if(P===!1)K.lastIndex=_+1;else{if(N!==_)D.push({type:"text",value:F.value.slice(N,_)});if(Array.isArray(P))D.push(...P);else if(P)D.push(P);N=_+q[0].length,A=!0}if(!K.global)break;q=K.exec(F.value)}if(A){if(N<F.value.length)D.push({type:"text",value:F.value.slice(N)});Y.children.splice(V,1,...D)}else D=[F];return V+D.length}}function g80($){let Z=[];if(!Array.isArray($))throw TypeError("Expected find and replace tuple or list of tuples");let H=!$[0]||Array.isArray($[0])?$:[$],B=-1;while(++B<H.length){let J=H[B];Z.push([f80(J[0]),m80(J[1])])}return Z}function f80($){return typeof $==="string"?new RegExp(hA($),"g"):$}function m80($){return typeof $==="function"?$:function(){return $}}var vA="phrasing",gA=["autolink","link","image","label"];function mA(){return{transforms:[i80],enter:{literalAutolink:p80,literalAutolinkEmail:fA,literalAutolinkHttp:fA,literalAutolinkWww:fA},exit:{literalAutolink:l80,literalAutolinkEmail:d80,literalAutolinkHttp:u80,literalAutolinkWww:c80}}}function pA(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:vA,notInConstruct:gA},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:vA,notInConstruct:gA},{character:":",before:"[ps]",after:"\\/",inConstruct:vA,notInConstruct:gA}]}}function p80($){this.enter({type:"link",title:null,url:"",children:[]},$)}function fA($){this.config.enter.autolinkProtocol.call(this,$)}function u80($){this.config.exit.autolinkProtocol.call(this,$)}function c80($){this.config.exit.data.call(this,$);let Z=this.stack[this.stack.length-1];g1(Z.type==="link"),Z.url="http://"+this.sliceSerialize($)}function d80($){this.config.exit.autolinkEmail.call(this,$)}function l80($){this.exit($)}function i80($){xA($,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,r80],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,a80]],{ignore:["link","linkReference"]})}function r80($,Z,H,B,J){let Q="";if(!ty(J))return!1;if(/^w/i.test(Z))H=Z+H,Z="",Q="http://";if(!n80(H))return!1;let X=o80(H+B);if(!X[0])return!1;let z={type:"link",title:null,url:Q+Z+X[0],children:[{type:"text",value:Z+X[0]}]};if(X[1])return[z,{type:"text",value:X[1]}];return z}function a80($,Z,H,B){if(!ty(B,!0)||/[-\d_]$/.test(H))return!1;return{type:"link",title:null,url:"mailto:"+Z+"@"+H,children:[{type:"text",value:Z+"@"+H}]}}function n80($){let Z=$.split(".");if(Z.length<2||Z[Z.length-1]&&(/_/.test(Z[Z.length-1])||!/[a-zA-Z\d]/.test(Z[Z.length-1]))||Z[Z.length-2]&&(/_/.test(Z[Z.length-2])||!/[a-zA-Z\d]/.test(Z[Z.length-2])))return!1;return!0}function o80($){let Z=/[!"&'),.:;<>?\]}]+$/.exec($);if(!Z)return[$,void 0];$=$.slice(0,Z.index);let H=Z[0],B=H.indexOf(")"),J=yA($,"("),Q=yA($,")");while(B!==-1&&J>Q)$+=H.slice(0,B+1),H=H.slice(B+1),B=H.indexOf(")"),Q++;return[$,H]}function ty($,Z){let H=$.input.charCodeAt($.index-1);return($.index===0||N9(H)||N7(H))&&(!Z||H!==47)}ey.peek=Q90;function s80(){this.buffer()}function t80($){this.enter({type:"footnoteReference",identifier:"",label:""},$)}function e80(){this.buffer()}function $90($){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},$)}function Z90($){let Z=this.resume(),H=this.stack[this.stack.length-1];g1(H.type==="footnoteReference"),H.identifier=m2(this.sliceSerialize($)).toLowerCase(),H.label=Z}function H90($){this.exit($)}function B90($){let Z=this.resume(),H=this.stack[this.stack.length-1];g1(H.type==="footnoteDefinition"),H.identifier=m2(this.sliceSerialize($)).toLowerCase(),H.label=Z}function J90($){this.exit($)}function Q90(){return"["}function ey($,Z,H,B){let J=H.createTracker(B),Q=J.move("[^"),X=H.enter("footnoteReference"),z=H.enter("reference");return Q+=J.move(H.safe(H.associationId($),{after:"]",before:Q})),z(),X(),Q+=J.move("]"),Q}function uA(){return{enter:{gfmFootnoteCallString:s80,gfmFootnoteCall:t80,gfmFootnoteDefinitionLabelString:e80,gfmFootnoteDefinition:$90},exit:{gfmFootnoteCallString:Z90,gfmFootnoteCall:H90,gfmFootnoteDefinitionLabelString:B90,gfmFootnoteDefinition:J90}}}function cA($){let Z=!1;if($&&$.firstLineBlank)Z=!0;return{handlers:{footnoteDefinition:H,footnoteReference:ey},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function H(B,J,Q,X){let z=Q.createTracker(X),G=z.move("[^"),F=Q.enter("footnoteDefinition"),U=Q.enter("label");if(G+=z.move(Q.safe(Q.associationId(B),{before:G,after:"]"})),U(),G+=z.move("]:"),B.children&&B.children.length>0)z.shift(4),G+=z.move((Z?`
|
|
51
|
+
`:" ")+Q.indentLines(Q.containerFlow(B,z.current()),Z?$h:X90));return F(),G}}function X90($,Z,H){return Z===0?$:$h($,Z,H)}function $h($,Z,H){return(H?"":" ")+$}var z90=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Zh.peek=U90;function dA(){return{canContainEols:["delete"],enter:{strikethrough:G90},exit:{strikethrough:F90}}}function lA(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:z90}],handlers:{delete:Zh}}}function G90($){this.enter({type:"delete",children:[]},$)}function F90($){this.exit($)}function Zh($,Z,H,B){let J=H.createTracker(B),Q=H.enter("strikethrough"),X=J.move("~~");return X+=H.containerPhrasing($,{...J.current(),before:X,after:"~"}),X+=J.move("~~"),Q(),X}function U90(){return"~"}function Y90($){return $.length}function Bh($,Z){let H=Z||{},B=(H.align||[]).concat(),J=H.stringLength||Y90,Q=[],X=[],z=[],G=[],F=0,U=-1;while(++U<$.length){let L=[],V=[],A=-1;if($[U].length>F)F=$[U].length;while(++A<$[U].length){let D=K90($[U][A]);if(H.alignDelimiters!==!1){let q=J(D);if(V[A]=q,G[A]===void 0||q>G[A])G[A]=q}L.push(D)}X[U]=L,z[U]=V}let Y=-1;if(typeof B==="object"&&"length"in B)while(++Y<F)Q[Y]=Hh(B[Y]);else{let L=Hh(B);while(++Y<F)Q[Y]=L}Y=-1;let K=[],W=[];while(++Y<F){let L=Q[Y],V="",A="";if(L===99)V=":",A=":";else if(L===108)V=":";else if(L===114)A=":";let D=H.alignDelimiters===!1?1:Math.max(1,G[Y]-V.length-A.length),q=V+"-".repeat(D)+A;if(H.alignDelimiters!==!1){if(D=V.length+D+A.length,D>G[Y])G[Y]=D;W[Y]=D}K[Y]=q}X.splice(1,0,K),z.splice(1,0,W),U=-1;let N=[];while(++U<X.length){let L=X[U],V=z[U];Y=-1;let A=[];while(++Y<F){let D=L[Y]||"",q="",_="";if(H.alignDelimiters!==!1){let M=G[Y]-(V[Y]||0),P=Q[Y];if(P===114)q=" ".repeat(M);else if(P===99)if(M%2)q=" ".repeat(M/2+0.5),_=" ".repeat(M/2-0.5);else q=" ".repeat(M/2),_=q;else _=" ".repeat(M)}if(H.delimiterStart!==!1&&!Y)A.push("|");if(H.padding!==!1&&!(H.alignDelimiters===!1&&D==="")&&(H.delimiterStart!==!1||Y))A.push(" ");if(H.alignDelimiters!==!1)A.push(q);if(A.push(D),H.alignDelimiters!==!1)A.push(_);if(H.padding!==!1)A.push(" ");if(H.delimiterEnd!==!1||Y!==F-1)A.push("|")}N.push(H.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return N.join(`
|
|
52
|
+
`)}function K90($){return $===null||$===void 0?"":String($)}function Hh($){let Z=typeof $==="string"?$.codePointAt(0):0;return Z===67||Z===99?99:Z===76||Z===108?108:Z===82||Z===114?114:0}function Jh($,Z,H,B){let J=H.enter("blockquote"),Q=H.createTracker(B);Q.move("> "),Q.shift(2);let X=H.indentLines(H.containerFlow($,Q.current()),W90);return J(),X}function W90($,Z,H){return">"+(H?"":" ")+$}function Xh($,Z){return Qh($,Z.inConstruct,!0)&&!Qh($,Z.notInConstruct,!1)}function Qh($,Z,H){if(typeof Z==="string")Z=[Z];if(!Z||Z.length===0)return H;let B=-1;while(++B<Z.length)if($.includes(Z[B]))return!0;return!1}function iA($,Z,H,B){let J=-1;while(++J<H.unsafe.length)if(H.unsafe[J].character===`
|
|
53
|
+
`&&Xh(H.stack,H.unsafe[J]))return/[ \t]/.test(B.before)?"":" ";return"\\\n"}function zh($,Z){let H=String($),B=H.indexOf(Z),J=B,Q=0,X=0;if(typeof Z!=="string")throw TypeError("Expected substring");while(B!==-1){if(B===J){if(++Q>X)X=Q}else Q=1;J=B+Z.length,B=H.indexOf(Z,J)}return X}function Gh($,Z){return Boolean(Z.options.fences===!1&&$.value&&!$.lang&&/[^ \r\n]/.test($.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test($.value))}function Fh($){let Z=$.options.fence||"`";if(Z!=="`"&&Z!=="~")throw Error("Cannot serialize code with `"+Z+"` for `options.fence`, expected `` ` `` or `~`");return Z}function Uh($,Z,H,B){let J=Fh(H),Q=$.value||"",X=J==="`"?"GraveAccent":"Tilde";if(Gh($,H)){let Y=H.enter("codeIndented"),K=H.indentLines(Q,N90);return Y(),K}let z=H.createTracker(B),G=J.repeat(Math.max(zh(Q,J)+1,3)),F=H.enter("codeFenced"),U=z.move(G);if($.lang){let Y=H.enter(`codeFencedLang${X}`);U+=z.move(H.safe($.lang,{before:U,after:" ",encode:["`"],...z.current()})),Y()}if($.lang&&$.meta){let Y=H.enter(`codeFencedMeta${X}`);U+=z.move(" "),U+=z.move(H.safe($.meta,{before:U,after:`
|
|
54
|
+
`,encode:["`"],...z.current()})),Y()}if(U+=z.move(`
|
|
55
|
+
`),Q)U+=z.move(Q+`
|
|
56
|
+
`);return U+=z.move(G),F(),U}function N90($,Z,H){return(H?"":" ")+$}function TZ($){let Z=$.options.quote||'"';if(Z!=='"'&&Z!=="'")throw Error("Cannot serialize title with `"+Z+"` for `options.quote`, expected `\"`, or `'`");return Z}function Yh($,Z,H,B){let J=TZ(H),Q=J==='"'?"Quote":"Apostrophe",X=H.enter("definition"),z=H.enter("label"),G=H.createTracker(B),F=G.move("[");if(F+=G.move(H.safe(H.associationId($),{before:F,after:"]",...G.current()})),F+=G.move("]: "),z(),!$.url||/[\0- \u007F]/.test($.url))z=H.enter("destinationLiteral"),F+=G.move("<"),F+=G.move(H.safe($.url,{before:F,after:">",...G.current()})),F+=G.move(">");else z=H.enter("destinationRaw"),F+=G.move(H.safe($.url,{before:F,after:$.title?" ":`
|
|
57
|
+
`,...G.current()}));if(z(),$.title)z=H.enter(`title${Q}`),F+=G.move(" "+J),F+=G.move(H.safe($.title,{before:F,after:J,...G.current()})),F+=G.move(J),z();return X(),F}function Kh($){let Z=$.options.emphasis||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize emphasis with `"+Z+"` for `options.emphasis`, expected `*`, or `_`");return Z}function a3($){return"&#x"+$.toString(16).toUpperCase()+";"}function CZ($,Z,H){let B=f9($),J=f9(Z);if(B===void 0)return J===void 0?H==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:J===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(B===1)return J===void 0?{inside:!1,outside:!1}:J===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return J===void 0?{inside:!1,outside:!1}:J===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}rA.peek=L90;function rA($,Z,H,B){let J=Kh(H),Q=H.enter("emphasis"),X=H.createTracker(B),z=X.move(J),G=X.move(H.containerPhrasing($,{after:J,before:z,...X.current()})),F=G.charCodeAt(0),U=CZ(B.before.charCodeAt(B.before.length-1),F,J);if(U.inside)G=a3(F)+G.slice(1);let Y=G.charCodeAt(G.length-1),K=CZ(B.after.charCodeAt(0),Y,J);if(K.inside)G=G.slice(0,-1)+a3(Y);let W=X.move(J);return Q(),H.attentionEncodeSurroundingInfo={after:K.outside,before:U.outside},z+G+W}function L90($,Z,H){return H.options.emphasis||"*"}function Wh($,Z){let H=!1;return m9($,function(B){if("value"in B&&/\r?\n|\r/.test(B.value)||B.type==="break")return H=!0,q7}),Boolean((!$.depth||$.depth<3)&&K7($)&&(Z.options.setext||H))}function Nh($,Z,H,B){let J=Math.max(Math.min(6,$.depth||1),1),Q=H.createTracker(B);if(Wh($,H)){let U=H.enter("headingSetext"),Y=H.enter("phrasing"),K=H.containerPhrasing($,{...Q.current(),before:`
|
|
58
|
+
`,after:`
|
|
59
|
+
`});return Y(),U(),K+`
|
|
60
|
+
`+(J===1?"=":"-").repeat(K.length-(Math.max(K.lastIndexOf("\r"),K.lastIndexOf(`
|
|
61
|
+
`))+1))}let X="#".repeat(J),z=H.enter("headingAtx"),G=H.enter("phrasing");Q.move(X+" ");let F=H.containerPhrasing($,{before:"# ",after:`
|
|
62
|
+
`,...Q.current()});if(/^[\t ]/.test(F))F=a3(F.charCodeAt(0))+F.slice(1);if(F=F?X+" "+F:X,H.options.closeAtx)F+=" "+X;return G(),z(),F}aA.peek=A90;function aA($){return $.value||""}function A90(){return"<"}nA.peek=V90;function nA($,Z,H,B){let J=TZ(H),Q=J==='"'?"Quote":"Apostrophe",X=H.enter("image"),z=H.enter("label"),G=H.createTracker(B),F=G.move("![");if(F+=G.move(H.safe($.alt,{before:F,after:"]",...G.current()})),F+=G.move("]("),z(),!$.url&&$.title||/[\0- \u007F]/.test($.url))z=H.enter("destinationLiteral"),F+=G.move("<"),F+=G.move(H.safe($.url,{before:F,after:">",...G.current()})),F+=G.move(">");else z=H.enter("destinationRaw"),F+=G.move(H.safe($.url,{before:F,after:$.title?" ":")",...G.current()}));if(z(),$.title)z=H.enter(`title${Q}`),F+=G.move(" "+J),F+=G.move(H.safe($.title,{before:F,after:J,...G.current()})),F+=G.move(J),z();return F+=G.move(")"),X(),F}function V90(){return"!"}oA.peek=D90;function oA($,Z,H,B){let J=$.referenceType,Q=H.enter("imageReference"),X=H.enter("label"),z=H.createTracker(B),G=z.move("!["),F=H.safe($.alt,{before:G,after:"]",...z.current()});G+=z.move(F+"]["),X();let U=H.stack;H.stack=[],X=H.enter("reference");let Y=H.safe(H.associationId($),{before:G,after:"]",...z.current()});if(X(),H.stack=U,Q(),J==="full"||!F||F!==Y)G+=z.move(Y+"]");else if(J==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function D90(){return"!"}sA.peek=q90;function sA($,Z,H){let B=$.value||"",J="`",Q=-1;while(new RegExp("(^|[^`])"+J+"([^`]|$)").test(B))J+="`";if(/[^ \r\n]/.test(B)&&(/^[ \r\n]/.test(B)&&/[ \r\n]$/.test(B)||/^`|`$/.test(B)))B=" "+B+" ";while(++Q<H.unsafe.length){let X=H.unsafe[Q],z=H.compilePattern(X),G;if(!X.atBreak)continue;while(G=z.exec(B)){let F=G.index;if(B.charCodeAt(F)===10&&B.charCodeAt(F-1)===13)F--;B=B.slice(0,F)+" "+B.slice(G.index+1)}}return J+B+J}function q90(){return"`"}function tA($,Z){let H=K7($);return Boolean(!Z.options.resourceLink&&$.url&&!$.title&&$.children&&$.children.length===1&&$.children[0].type==="text"&&(H===$.url||"mailto:"+H===$.url)&&/^[a-z][a-z+.-]+:/i.test($.url)&&!/[\0- <>\u007F]/.test($.url))}eA.peek=M90;function eA($,Z,H,B){let J=TZ(H),Q=J==='"'?"Quote":"Apostrophe",X=H.createTracker(B),z,G;if(tA($,H)){let U=H.stack;H.stack=[],z=H.enter("autolink");let Y=X.move("<");return Y+=X.move(H.containerPhrasing($,{before:Y,after:">",...X.current()})),Y+=X.move(">"),z(),H.stack=U,Y}z=H.enter("link"),G=H.enter("label");let F=X.move("[");if(F+=X.move(H.containerPhrasing($,{before:F,after:"](",...X.current()})),F+=X.move("]("),G(),!$.url&&$.title||/[\0- \u007F]/.test($.url))G=H.enter("destinationLiteral"),F+=X.move("<"),F+=X.move(H.safe($.url,{before:F,after:">",...X.current()})),F+=X.move(">");else G=H.enter("destinationRaw"),F+=X.move(H.safe($.url,{before:F,after:$.title?" ":")",...X.current()}));if(G(),$.title)G=H.enter(`title${Q}`),F+=X.move(" "+J),F+=X.move(H.safe($.title,{before:F,after:J,...X.current()})),F+=X.move(J),G();return F+=X.move(")"),z(),F}function M90($,Z,H){return tA($,H)?"<":"["}$V.peek=P90;function $V($,Z,H,B){let J=$.referenceType,Q=H.enter("linkReference"),X=H.enter("label"),z=H.createTracker(B),G=z.move("["),F=H.containerPhrasing($,{before:G,after:"]",...z.current()});G+=z.move(F+"]["),X();let U=H.stack;H.stack=[],X=H.enter("reference");let Y=H.safe(H.associationId($),{before:G,after:"]",...z.current()});if(X(),H.stack=U,Q(),J==="full"||!F||F!==Y)G+=z.move(Y+"]");else if(J==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function P90(){return"["}function wZ($){let Z=$.options.bullet||"*";if(Z!=="*"&&Z!=="+"&&Z!=="-")throw Error("Cannot serialize items with `"+Z+"` for `options.bullet`, expected `*`, `+`, or `-`");return Z}function Lh($){let Z=wZ($),H=$.options.bulletOther;if(!H)return Z==="*"?"-":"*";if(H!=="*"&&H!=="+"&&H!=="-")throw Error("Cannot serialize items with `"+H+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(H===Z)throw Error("Expected `bullet` (`"+Z+"`) and `bulletOther` (`"+H+"`) to be different");return H}function Ah($){let Z=$.options.bulletOrdered||".";if(Z!=="."&&Z!==")")throw Error("Cannot serialize items with `"+Z+"` for `options.bulletOrdered`, expected `.` or `)`");return Z}function TU($){let Z=$.options.rule||"*";if(Z!=="*"&&Z!=="-"&&Z!=="_")throw Error("Cannot serialize rules with `"+Z+"` for `options.rule`, expected `*`, `-`, or `_`");return Z}function Vh($,Z,H,B){let J=H.enter("list"),Q=H.bulletCurrent,X=$.ordered?Ah(H):wZ(H),z=$.ordered?X==="."?")":".":Lh(H),G=Z&&H.bulletLastUsed?X===H.bulletLastUsed:!1;if(!$.ordered){let U=$.children?$.children[0]:void 0;if((X==="*"||X==="-")&&U&&(!U.children||!U.children[0])&&H.stack[H.stack.length-1]==="list"&&H.stack[H.stack.length-2]==="listItem"&&H.stack[H.stack.length-3]==="list"&&H.stack[H.stack.length-4]==="listItem"&&H.indexStack[H.indexStack.length-1]===0&&H.indexStack[H.indexStack.length-2]===0&&H.indexStack[H.indexStack.length-3]===0)G=!0;if(TU(H)===X&&U){let Y=-1;while(++Y<$.children.length){let K=$.children[Y];if(K&&K.type==="listItem"&&K.children&&K.children[0]&&K.children[0].type==="thematicBreak"){G=!0;break}}}}if(G)X=z;H.bulletCurrent=X;let F=H.containerFlow($,B);return H.bulletLastUsed=X,H.bulletCurrent=Q,J(),F}function Dh($){let Z=$.options.listItemIndent||"one";if(Z!=="tab"&&Z!=="one"&&Z!=="mixed")throw Error("Cannot serialize items with `"+Z+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return Z}function qh($,Z,H,B){let J=Dh(H),Q=H.bulletCurrent||wZ(H);if(Z&&Z.type==="list"&&Z.ordered)Q=(typeof Z.start==="number"&&Z.start>-1?Z.start:1)+(H.options.incrementListMarker===!1?0:Z.children.indexOf($))+Q;let X=Q.length+1;if(J==="tab"||J==="mixed"&&(Z&&Z.type==="list"&&Z.spread||$.spread))X=Math.ceil(X/4)*4;let z=H.createTracker(B);z.move(Q+" ".repeat(X-Q.length)),z.shift(X);let G=H.enter("listItem"),F=H.indentLines(H.containerFlow($,z.current()),U);return G(),F;function U(Y,K,W){if(K)return(W?"":" ".repeat(X))+Y;return(W?Q:Q+" ".repeat(X-Q.length))+Y}}function Mh($,Z,H,B){let J=H.enter("paragraph"),Q=H.enter("phrasing"),X=H.containerPhrasing($,B);return Q(),J(),X}var ZV=A9(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Ph($,Z,H,B){return($.children.some(function(X){return ZV(X)})?H.containerPhrasing:H.containerFlow).call(H,$,B)}function _h($){let Z=$.options.strong||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize strong with `"+Z+"` for `options.strong`, expected `*`, or `_`");return Z}HV.peek=_90;function HV($,Z,H,B){let J=_h(H),Q=H.enter("strong"),X=H.createTracker(B),z=X.move(J+J),G=X.move(H.containerPhrasing($,{after:J,before:z,...X.current()})),F=G.charCodeAt(0),U=CZ(B.before.charCodeAt(B.before.length-1),F,J);if(U.inside)G=a3(F)+G.slice(1);let Y=G.charCodeAt(G.length-1),K=CZ(B.after.charCodeAt(0),Y,J);if(K.inside)G=G.slice(0,-1)+a3(Y);let W=X.move(J+J);return Q(),H.attentionEncodeSurroundingInfo={after:K.outside,before:U.outside},z+G+W}function _90($,Z,H){return H.options.strong||"*"}function Oh($,Z,H,B){return H.safe($.value,B)}function jh($){let Z=$.options.ruleRepetition||3;if(Z<3)throw Error("Cannot serialize rules with repetition `"+Z+"` for `options.ruleRepetition`, expected `3` or more");return Z}function Th($,Z,H){let B=(TU(H)+(H.options.ruleSpaces?" ":"")).repeat(jh(H));return H.options.ruleSpaces?B.slice(0,-1):B}var NJ={blockquote:Jh,break:iA,code:Uh,definition:Yh,emphasis:rA,hardBreak:iA,heading:Nh,html:aA,image:nA,imageReference:oA,inlineCode:sA,link:eA,linkReference:$V,list:Vh,listItem:qh,paragraph:Mh,root:Ph,strong:HV,text:Oh,thematicBreak:Th};function JV(){return{enter:{table:O90,tableData:Ch,tableHeader:Ch,tableRow:T90},exit:{codeText:C90,table:j90,tableData:BV,tableHeader:BV,tableRow:BV}}}function O90($){let Z=$._align;g1(Z,"expected `_align` on table"),this.enter({type:"table",align:Z.map(function(H){return H==="none"?null:H}),children:[]},$),this.data.inTable=!0}function j90($){this.exit($),this.data.inTable=void 0}function T90($){this.enter({type:"tableRow",children:[]},$)}function BV($){this.exit($)}function Ch($){this.enter({type:"tableCell",children:[]},$)}function C90($){let Z=this.resume();if(this.data.inTable)Z=Z.replace(/\\([\\|])/g,w90);let H=this.stack[this.stack.length-1];g1(H.type==="inlineCode"),H.value=Z,this.exit($)}function w90($,Z){return Z==="|"?Z:$}function QV($){let Z=$||{},H=Z.tableCellPadding,B=Z.tablePipeAlign,J=Z.stringLength,Q=H?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
63
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:K,table:X,tableCell:G,tableRow:z}};function X(W,N,L,V){return F(U(W,L,V),W.align)}function z(W,N,L,V){let A=Y(W,L,V),D=F([A]);return D.slice(0,D.indexOf(`
|
|
64
|
+
`))}function G(W,N,L,V){let A=L.enter("tableCell"),D=L.enter("phrasing"),q=L.containerPhrasing(W,{...V,before:Q,after:Q});return D(),A(),q}function F(W,N){return Bh(W,{align:N,alignDelimiters:B,padding:H,stringLength:J})}function U(W,N,L){let V=W.children,A=-1,D=[],q=N.enter("table");while(++A<V.length)D[A]=Y(V[A],N,L);return q(),D}function Y(W,N,L){let V=W.children,A=-1,D=[],q=N.enter("tableRow");while(++A<V.length)D[A]=G(V[A],W,N,L);return q(),D}function K(W,N,L){let V=NJ.inlineCode(W,N,L);if(L.stack.includes("tableCell"))V=V.replace(/\|/g,"\\$&");return V}}function XV(){return{exit:{taskListCheckValueChecked:wh,taskListCheckValueUnchecked:wh,paragraph:E90}}}function zV(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:S90}}}function wh($){let Z=this.stack[this.stack.length-2];g1(Z.type==="listItem"),Z.checked=$.type==="taskListCheckValueChecked"}function E90($){let Z=this.stack[this.stack.length-2];if(Z&&Z.type==="listItem"&&typeof Z.checked==="boolean"){let H=this.stack[this.stack.length-1];g1(H.type==="paragraph");let B=H.children[0];if(B&&B.type==="text"){let J=Z.children,Q=-1,X;while(++Q<J.length){let z=J[Q];if(z.type==="paragraph"){X=z;break}}if(X===H){if(B.value=B.value.slice(1),B.value.length===0)H.children.shift();else if(H.position&&B.position&&typeof B.position.start.offset==="number")B.position.start.column++,B.position.start.offset++,H.position.start=Object.assign({},B.position.start)}}}this.exit($)}function S90($,Z,H,B){let J=$.children[0],Q=typeof $.checked==="boolean"&&J&&J.type==="paragraph",X="["+($.checked?"x":" ")+"] ",z=H.createTracker(B);if(Q)z.move(X);let G=NJ.listItem($,Z,H,{...B,...z.current()});if(Q)G=G.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,F);return G;function F(U){return U+X}}function GV(){return[mA(),uA(),dA(),JV(),XV()]}function FV($){return{extensions:[pA(),cA($),lA(),QV($),zV()]}}var I90={tokenize:h90,partial:!0},Eh={tokenize:x90,partial:!0},Sh={tokenize:v90,partial:!0},Ih={tokenize:g90,partial:!0},R90={tokenize:f90,partial:!0},Rh={name:"wwwAutolink",tokenize:b90,previous:bh},kh={name:"protocolAutolink",tokenize:y90,previous:yh},u9={name:"emailAutolink",tokenize:k90,previous:hh},D9={};function YV(){return{text:D9}}var _7=48;while(_7<123)if(D9[_7]=u9,_7++,_7===58)_7=65;else if(_7===91)_7=97;D9[43]=u9;D9[45]=u9;D9[46]=u9;D9[95]=u9;D9[72]=[u9,kh];D9[104]=[u9,kh];D9[87]=[u9,Rh];D9[119]=[u9,Rh];function k90($,Z,H){let B=this,J,Q;return X;function X(Y){if(!UV(Y)||!hh.call(B,B.previous)||KV(B.events))return H(Y);return $.enter("literalAutolink"),$.enter("literalAutolinkEmail"),z(Y)}function z(Y){if(UV(Y))return $.consume(Y),z;if(Y===64)return $.consume(Y),G;return H(Y)}function G(Y){if(Y===46)return $.check(R90,U,F)(Y);if(Y===45||Y===95||m5(Y))return Q=!0,$.consume(Y),G;return U(Y)}function F(Y){return $.consume(Y),J=!0,G}function U(Y){if(Q&&J&&X2(B.previous))return $.exit("literalAutolinkEmail"),$.exit("literalAutolink"),Z(Y);return H(Y)}}function b90($,Z,H){let B=this;return J;function J(X){if(X!==87&&X!==119||!bh.call(B,B.previous)||KV(B.events))return H(X);return $.enter("literalAutolink"),$.enter("literalAutolinkWww"),$.check(I90,$.attempt(Eh,$.attempt(Sh,Q),H),H)(X)}function Q(X){return $.exit("literalAutolinkWww"),$.exit("literalAutolink"),Z(X)}}function y90($,Z,H){let B=this,J="",Q=!1;return X;function X(Y){if((Y===72||Y===104)&&yh.call(B,B.previous)&&!KV(B.events))return $.enter("literalAutolink"),$.enter("literalAutolinkHttp"),J+=String.fromCodePoint(Y),$.consume(Y),z;return H(Y)}function z(Y){if(X2(Y)&&J.length<5)return J+=String.fromCodePoint(Y),$.consume(Y),z;if(Y===58){let K=J.toLowerCase();if(K==="http"||K==="https")return $.consume(Y),G}return H(Y)}function G(Y){if(Y===47){if($.consume(Y),Q)return F;return Q=!0,G}return H(Y)}function F(Y){return Y===null||W7(Y)||O1(Y)||N9(Y)||N7(Y)?H(Y):$.attempt(Eh,$.attempt(Sh,U),H)(Y)}function U(Y){return $.exit("literalAutolinkHttp"),$.exit("literalAutolink"),Z(Y)}}function h90($,Z,H){let B=0;return J;function J(X){if((X===87||X===119)&&B<3)return B++,$.consume(X),J;if(X===46&&B===3)return $.consume(X),Q;return H(X)}function Q(X){return X===null?H(X):Z(X)}}function x90($,Z,H){let B,J,Q;return X;function X(F){if(F===46||F===95)return $.check(Ih,G,z)(F);if(F===null||O1(F)||N9(F)||F!==45&&N7(F))return G(F);return Q=!0,$.consume(F),X}function z(F){if(F===95)B=!0;else J=B,B=void 0;return $.consume(F),X}function G(F){if(J||B||!Q)return H(F);return Z(F)}}function v90($,Z){let H=0,B=0;return J;function J(X){if(X===40)return H++,$.consume(X),J;if(X===41&&B<H)return Q(X);if(X===33||X===34||X===38||X===39||X===41||X===42||X===44||X===46||X===58||X===59||X===60||X===63||X===93||X===95||X===126)return $.check(Ih,Z,Q)(X);if(X===null||O1(X)||N9(X))return Z(X);return $.consume(X),J}function Q(X){if(X===41)B++;return $.consume(X),J}}function g90($,Z,H){return B;function B(z){if(z===33||z===34||z===39||z===41||z===42||z===44||z===46||z===58||z===59||z===63||z===95||z===126)return $.consume(z),B;if(z===38)return $.consume(z),Q;if(z===93)return $.consume(z),J;if(z===60||z===null||O1(z)||N9(z))return Z(z);return H(z)}function J(z){if(z===null||z===40||z===91||O1(z)||N9(z))return Z(z);return B(z)}function Q(z){return X2(z)?X(z):H(z)}function X(z){if(z===59)return $.consume(z),B;if(X2(z))return $.consume(z),X;return H(z)}}function f90($,Z,H){return B;function B(Q){return $.consume(Q),J}function J(Q){return m5(Q)?H(Q):Z(Q)}}function bh($){return $===null||$===40||$===42||$===95||$===91||$===93||$===126||O1($)}function yh($){return!X2($)}function hh($){return!($===47||UV($))}function UV($){return $===43||$===45||$===46||$===95||m5($)}function KV($){let Z=$.length,H=!1;while(Z--){let B=$[Z][1];if((B.type==="labelLink"||B.type==="labelImage")&&!B._balanced){H=!0;break}if(B._gfmAutolinkLiteralWalkedInto){H=!1;break}}if($.length>0&&!H)$[$.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return H}var m90={tokenize:r90,partial:!0};function WV(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:d90,continuation:{tokenize:l90},exit:i90}},text:{[91]:{name:"gfmFootnoteCall",tokenize:c90},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:p90,resolveTo:u90}}}}function p90($,Z,H){let B=this,J=B.events.length,Q=B.parser.gfmFootnotes||(B.parser.gfmFootnotes=[]),X;while(J--){let G=B.events[J][1];if(G.type==="labelImage"){X=G;break}if(G.type==="gfmFootnoteCall"||G.type==="labelLink"||G.type==="label"||G.type==="image"||G.type==="link")break}return z;function z(G){if(!X||!X._balanced)return H(G);let F=m2(B.sliceSerialize({start:X.end,end:B.now()}));if(F.codePointAt(0)!==94||!Q.includes(F.slice(1)))return H(G);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(G),$.exit("gfmFootnoteCallLabelMarker"),Z(G)}}function u90($,Z){let H=$.length,B;while(H--)if($[H][1].type==="labelImage"&&$[H][0]==="enter"){B=$[H][1];break}$[H+1][1].type="data",$[H+3][1].type="gfmFootnoteCallLabelMarker";let J={type:"gfmFootnoteCall",start:Object.assign({},$[H+3][1].start),end:Object.assign({},$[$.length-1][1].end)},Q={type:"gfmFootnoteCallMarker",start:Object.assign({},$[H+3][1].end),end:Object.assign({},$[H+3][1].end)};Q.end.column++,Q.end.offset++,Q.end._bufferIndex++;let X={type:"gfmFootnoteCallString",start:Object.assign({},Q.end),end:Object.assign({},$[$.length-1][1].start)},z={type:"chunkString",contentType:"string",start:Object.assign({},X.start),end:Object.assign({},X.end)},G=[$[H+1],$[H+2],["enter",J,Z],$[H+3],$[H+4],["enter",Q,Z],["exit",Q,Z],["enter",X,Z],["enter",z,Z],["exit",z,Z],["exit",X,Z],$[$.length-2],$[$.length-1],["exit",J,Z]];return $.splice(H,$.length-H+1,...G),$}function c90($,Z,H){let B=this,J=B.parser.gfmFootnotes||(B.parser.gfmFootnotes=[]),Q=0,X;return z;function z(Y){return $.enter("gfmFootnoteCall"),$.enter("gfmFootnoteCallLabelMarker"),$.consume(Y),$.exit("gfmFootnoteCallLabelMarker"),G}function G(Y){if(Y!==94)return H(Y);return $.enter("gfmFootnoteCallMarker"),$.consume(Y),$.exit("gfmFootnoteCallMarker"),$.enter("gfmFootnoteCallString"),$.enter("chunkString").contentType="string",F}function F(Y){if(Q>999||Y===93&&!X||Y===null||Y===91||O1(Y))return H(Y);if(Y===93){$.exit("chunkString");let K=$.exit("gfmFootnoteCallString");if(!J.includes(m2(B.sliceSerialize(K))))return H(Y);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(Y),$.exit("gfmFootnoteCallLabelMarker"),$.exit("gfmFootnoteCall"),Z}if(!O1(Y))X=!0;return Q++,$.consume(Y),Y===92?U:F}function U(Y){if(Y===91||Y===92||Y===93)return $.consume(Y),Q++,F;return F(Y)}}function d90($,Z,H){let B=this,J=B.parser.gfmFootnotes||(B.parser.gfmFootnotes=[]),Q,X=0,z;return G;function G(N){return $.enter("gfmFootnoteDefinition")._container=!0,$.enter("gfmFootnoteDefinitionLabel"),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(N),$.exit("gfmFootnoteDefinitionLabelMarker"),F}function F(N){if(N===94)return $.enter("gfmFootnoteDefinitionMarker"),$.consume(N),$.exit("gfmFootnoteDefinitionMarker"),$.enter("gfmFootnoteDefinitionLabelString"),$.enter("chunkString").contentType="string",U;return H(N)}function U(N){if(X>999||N===93&&!z||N===null||N===91||O1(N))return H(N);if(N===93){$.exit("chunkString");let L=$.exit("gfmFootnoteDefinitionLabelString");return Q=m2(B.sliceSerialize(L)),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(N),$.exit("gfmFootnoteDefinitionLabelMarker"),$.exit("gfmFootnoteDefinitionLabel"),K}if(!O1(N))z=!0;return X++,$.consume(N),N===92?Y:U}function Y(N){if(N===91||N===92||N===93)return $.consume(N),X++,U;return U(N)}function K(N){if(N===58){if($.enter("definitionMarker"),$.consume(N),$.exit("definitionMarker"),!J.includes(Q))J.push(Q);return a0($,W,"gfmFootnoteDefinitionWhitespace")}return H(N)}function W(N){return Z(N)}}function l90($,Z,H){return $.check(L9,Z,$.attempt(m90,Z,H))}function i90($){$.exit("gfmFootnoteDefinition")}function r90($,Z,H){let B=this;return a0($,J,"gfmFootnoteDefinitionIndent",5);function J(Q){let X=B.events[B.events.length-1];return X&&X[1].type==="gfmFootnoteDefinitionIndent"&&X[2].sliceSerialize(X[1],!0).length===4?Z(Q):H(Q)}}function NV($){let H=($||{}).singleTilde,B={name:"strikethrough",tokenize:Q,resolveAll:J};if(H===null||H===void 0)H=!0;return{text:{[126]:B},insideSpan:{null:[B]},attentionMarkers:{null:[126]}};function J(X,z){let G=-1;while(++G<X.length)if(X[G][0]==="enter"&&X[G][1].type==="strikethroughSequenceTemporary"&&X[G][1]._close){let F=G;while(F--)if(X[F][0]==="exit"&&X[F][1].type==="strikethroughSequenceTemporary"&&X[F][1]._open&&X[G][1].end.offset-X[G][1].start.offset===X[F][1].end.offset-X[F][1].start.offset){X[G][1].type="strikethroughSequence",X[F][1].type="strikethroughSequence";let U={type:"strikethrough",start:Object.assign({},X[F][1].start),end:Object.assign({},X[G][1].end)},Y={type:"strikethroughText",start:Object.assign({},X[F][1].end),end:Object.assign({},X[G][1].start)},K=[["enter",U,z],["enter",X[F][1],z],["exit",X[F][1],z],["enter",Y,z]],W=z.parser.constructs.insideSpan.null;if(W)d5(K,K.length,0,l3(W,X.slice(F+1,G),z));d5(K,K.length,0,[["exit",Y,z],["enter",X[G][1],z],["exit",X[G][1],z],["exit",U,z]]),d5(X,F-1,G-F+3,K),G=F+K.length-2;break}}G=-1;while(++G<X.length)if(X[G][1].type==="strikethroughSequenceTemporary")X[G][1].type="data";return X}function Q(X,z,G){let F=this.previous,U=this.events,Y=0;return K;function K(N){if(F===126&&U[U.length-1][1].type!=="characterEscape")return G(N);return X.enter("strikethroughSequenceTemporary"),W(N)}function W(N){let L=f9(F);if(N===126){if(Y>1)return G(N);return X.consume(N),Y++,W}if(Y<2&&!H)return G(N);let V=X.exit("strikethroughSequenceTemporary"),A=f9(N);return V._open=!A||A===2&&Boolean(L),V._close=!L||L===2&&Boolean(A),z(N)}}}class LV{constructor(){this.map=[]}add($,Z,H){a90(this,$,Z,H)}consume($){if(this.map.sort(function(J,Q){return J[0]-Q[0]}),this.map.length===0)return;let Z=this.map.length,H=[];while(Z>0)Z-=1,H.push($.slice(this.map[Z][0]+this.map[Z][1]),this.map[Z][2]),$.length=this.map[Z][0];H.push($.slice()),$.length=0;let B=H.pop();while(B){for(let J of B)$.push(J);B=H.pop()}this.map.length=0}}function a90($,Z,H,B){let J=0;if(H===0&&B.length===0)return;while(J<$.map.length){if($.map[J][0]===Z){$.map[J][1]+=H,$.map[J][2].push(...B);return}J+=1}$.map.push([Z,H,B])}function xh($,Z){let H=!1,B=[];while(Z<$.length){let J=$[Z];if(H){if(J[0]==="enter"){if(J[1].type==="tableContent")B.push($[Z+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(J[1].type==="tableContent"){if($[Z-1][1].type==="tableDelimiterMarker"){let Q=B.length-1;B[Q]=B[Q]==="left"?"center":"right"}}else if(J[1].type==="tableDelimiterRow")break}else if(J[0]==="enter"&&J[1].type==="tableDelimiterRow")H=!0;Z+=1}return B}function AV(){return{flow:{null:{name:"table",tokenize:n90,resolveAll:o90}}}}function n90($,Z,H){let B=this,J=0,Q=0,X;return z;function z(w){let h=B.events.length-1;while(h>-1){let j=B.events[h][1].type;if(j==="lineEnding"||j==="linePrefix")h--;else break}let E=h>-1?B.events[h][1].type:null,I=E==="tableHead"||E==="tableRow"?P:G;if(I===P&&B.parser.lazy[B.now().line])return H(w);return I(w)}function G(w){return $.enter("tableHead"),$.enter("tableRow"),F(w)}function F(w){if(w===124)return U(w);return X=!0,Q+=1,U(w)}function U(w){if(w===null)return H(w);if(h0(w)){if(Q>1)return Q=0,B.interrupt=!0,$.exit("tableRow"),$.enter("lineEnding"),$.consume(w),$.exit("lineEnding"),W;return H(w)}if(o0(w))return a0($,U,"whitespace")(w);if(Q+=1,X)X=!1,J+=1;if(w===124)return $.enter("tableCellDivider"),$.consume(w),$.exit("tableCellDivider"),X=!0,U;return $.enter("data"),Y(w)}function Y(w){if(w===null||w===124||O1(w))return $.exit("data"),U(w);return $.consume(w),w===92?K:Y}function K(w){if(w===92||w===124)return $.consume(w),Y;return Y(w)}function W(w){if(B.interrupt=!1,B.parser.lazy[B.now().line])return H(w);if($.enter("tableDelimiterRow"),X=!1,o0(w))return a0($,N,"linePrefix",B.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w);return N(w)}function N(w){if(w===45||w===58)return V(w);if(w===124)return X=!0,$.enter("tableCellDivider"),$.consume(w),$.exit("tableCellDivider"),L;return M(w)}function L(w){if(o0(w))return a0($,V,"whitespace")(w);return V(w)}function V(w){if(w===58)return Q+=1,X=!0,$.enter("tableDelimiterMarker"),$.consume(w),$.exit("tableDelimiterMarker"),A;if(w===45)return Q+=1,A(w);if(w===null||h0(w))return _(w);return M(w)}function A(w){if(w===45)return $.enter("tableDelimiterFiller"),D(w);return M(w)}function D(w){if(w===45)return $.consume(w),D;if(w===58)return X=!0,$.exit("tableDelimiterFiller"),$.enter("tableDelimiterMarker"),$.consume(w),$.exit("tableDelimiterMarker"),q;return $.exit("tableDelimiterFiller"),q(w)}function q(w){if(o0(w))return a0($,_,"whitespace")(w);return _(w)}function _(w){if(w===124)return N(w);if(w===null||h0(w)){if(!X||J!==Q)return M(w);return $.exit("tableDelimiterRow"),$.exit("tableHead"),Z(w)}return M(w)}function M(w){return H(w)}function P(w){return $.enter("tableRow"),T(w)}function T(w){if(w===124)return $.enter("tableCellDivider"),$.consume(w),$.exit("tableCellDivider"),T;if(w===null||h0(w))return $.exit("tableRow"),Z(w);if(o0(w))return a0($,T,"whitespace")(w);return $.enter("data"),R(w)}function R(w){if(w===null||w===124||O1(w))return $.exit("data"),T(w);return $.consume(w),w===92?y:R}function y(w){if(w===92||w===124)return $.consume(w),R;return R(w)}}function o90($,Z){let H=-1,B=!0,J=0,Q=[0,0,0,0],X=[0,0,0,0],z=!1,G=0,F,U,Y,K=new LV;while(++H<$.length){let W=$[H],N=W[1];if(W[0]==="enter"){if(N.type==="tableHead"){if(z=!1,G!==0)vh(K,Z,G,F,U),U=void 0,G=0;F={type:"table",start:Object.assign({},N.start),end:Object.assign({},N.end)},K.add(H,0,[["enter",F,Z]])}else if(N.type==="tableRow"||N.type==="tableDelimiterRow"){if(B=!0,Y=void 0,Q=[0,0,0,0],X=[0,H+1,0,0],z)z=!1,U={type:"tableBody",start:Object.assign({},N.start),end:Object.assign({},N.end)},K.add(H,0,[["enter",U,Z]]);J=N.type==="tableDelimiterRow"?2:U?3:1}else if(J&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")){if(B=!1,X[2]===0){if(Q[1]!==0)X[0]=X[1],Y=CU(K,Z,Q,J,void 0,Y),Q=[0,0,0,0];X[2]=H}}else if(N.type==="tableCellDivider")if(B)B=!1;else{if(Q[1]!==0)X[0]=X[1],Y=CU(K,Z,Q,J,void 0,Y);Q=X,X=[Q[1],H,0,0]}}else if(N.type==="tableHead")z=!0,G=H;else if(N.type==="tableRow"||N.type==="tableDelimiterRow"){if(G=H,Q[1]!==0)X[0]=X[1],Y=CU(K,Z,Q,J,H,Y);else if(X[1]!==0)Y=CU(K,Z,X,J,H,Y);J=0}else if(J&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller"))X[3]=H}if(G!==0)vh(K,Z,G,F,U);K.consume(Z.events),H=-1;while(++H<Z.events.length){let W=Z.events[H];if(W[0]==="enter"&&W[1].type==="table")W[1]._align=xh(Z.events,H)}return $}function CU($,Z,H,B,J,Q){let X=B===1?"tableHeader":B===2?"tableDelimiter":"tableData",z="tableContent";if(H[0]!==0)Q.end=Object.assign({},EZ(Z.events,H[0])),$.add(H[0],0,[["exit",Q,Z]]);let G=EZ(Z.events,H[1]);if(Q={type:X,start:Object.assign({},G),end:Object.assign({},G)},$.add(H[1],0,[["enter",Q,Z]]),H[2]!==0){let F=EZ(Z.events,H[2]),U=EZ(Z.events,H[3]),Y={type:"tableContent",start:Object.assign({},F),end:Object.assign({},U)};if($.add(H[2],0,[["enter",Y,Z]]),B!==2){let K=Z.events[H[2]],W=Z.events[H[3]];if(K[1].end=Object.assign({},W[1].end),K[1].type="chunkText",K[1].contentType="text",H[3]>H[2]+1){let N=H[2]+1,L=H[3]-H[2]-1;$.add(N,L,[])}}$.add(H[3]+1,0,[["exit",Y,Z]])}if(J!==void 0)Q.end=Object.assign({},EZ(Z.events,J)),$.add(J,0,[["exit",Q,Z]]),Q=void 0;return Q}function vh($,Z,H,B,J){let Q=[],X=EZ(Z.events,H);if(J)J.end=Object.assign({},X),Q.push(["exit",J,Z]);B.end=Object.assign({},X),Q.push(["exit",B,Z]),$.add(H+1,0,Q)}function EZ($,Z){let H=$[Z],B=H[0]==="enter"?"start":"end";return H[1][B]}var s90={name:"tasklistCheck",tokenize:t90};function VV(){return{text:{[91]:s90}}}function t90($,Z,H){let B=this;return J;function J(G){if(B.previous!==null||!B._gfmTasklistFirstContentOfListItem)return H(G);return $.enter("taskListCheck"),$.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),Q}function Q(G){if(O1(G))return $.enter("taskListCheckValueUnchecked"),$.consume(G),$.exit("taskListCheckValueUnchecked"),X;if(G===88||G===120)return $.enter("taskListCheckValueChecked"),$.consume(G),$.exit("taskListCheckValueChecked"),X;return H(G)}function X(G){if(G===93)return $.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),$.exit("taskListCheck"),z;return H(G)}function z(G){if(h0(G))return Z(G);if(o0(G))return $.check({tokenize:e90},Z,H)(G);return H(G)}}function e90($,Z,H){return a0($,B,"whitespace");function B(J){return J===null?H(J):Z(J)}}function gh($){return pF([YV(),WV(),NV($),AV(),VV()])}var $30={};function wU($){let Z=this,H=$||$30,B=Z.data(),J=B.micromarkExtensions||(B.micromarkExtensions=[]),Q=B.fromMarkdownExtensions||(B.fromMarkdownExtensions=[]),X=B.toMarkdownExtensions||(B.toMarkdownExtensions=[]);J.push(gh(H)),Q.push(GV()),X.push(FV(H))}var O7=O(c(),1),Z30=[wU],H30=[jU],B30={code({node:$,className:Z,children:H,...B}){return O7.jsx("code",{className:s("rounded-xs bg-accent px-1 py-0.5 font-mono font-normal before:content-none after:content-none",Z),...B,children:H})},pre({children:$}){return O7.jsx("div",{className:"not-prose my-2 rounded-lg border border-border bg-accent px-3 py-2.5",children:O7.jsx("pre",{className:"overflow-auto font-mono text-xs leading-relaxed whitespace-pre text-foreground [&>code]:rounded-none [&>code]:bg-transparent [&>code]:p-0",children:$})})}};function fh({size:$="sm",content:Z}){return O7.jsx("div",{className:s("prose max-w-full min-w-0 wrap-anywhere prose-inherit",$==="sm"&&"prose-sm"),children:O7.jsx(WU,{remarkPlugins:Z30,rehypePlugins:H30,components:B30,children:Z})})}function mh({content:$}){return O7.jsx(WU,{allowedElements:[],skipHtml:!0,unwrapDisallowed:!0,children:$})}var mV=O(g(),1);var ph="/agentation-4s0nn45p.png";var uh="/airtable-hsa66v6q.png";var ch="/apollo-2ed5dy2d.png";var dh="/asana-tvgtwbx2.png";var lh="/atlassian-b3tq39hs.png";var ih="/box-w3n36t5g.png";var DV="/chrome-tspm94rw.svg";var rh="/clickup-qqrqqvqb.png";var ah="/cloudflare-j9p931v6.png";var nh="/context7-8ht0xjfy.png";var oh="/datadog-70ne3yzt.png";var sh="/discord-vejhptwx.png";var th="/dropbox-4m5s9mgr.png";var eh="/elevenlabs-2nzzej1t.png";var $x="/exa-qqj3vr0x.png";var Zx="/figma-y9898rry.png";var Hx="/firecrawl-w2t8nehx.png";var Bx="/github-av5r5y3e.png";var Jx="/gitlab-4pv5vm6b.png";var Qx="/gmail-sg6a5v3x.png";var Xx="/googlecalendar-nqhh2v7r.png";var zx="/googledrive-6s8xyab7.png";var Gx="/grafana-1yfsnwr6.png";var Fx="/granola-7j3b0nk2.png";var Ux="/hubspot-hghcmc2t.png";var Yx="/huggingface-kxzaxj83.png";var Kx="/intercom-td763jt8.png";var Wx="/linear-v9s3az2d.png";var Nx="/monday-jdbs4wwf.png";var Lx="/mongodb-emzxvhd5.png";var Ax="/neon-zj4qar44.png";var Vx="/notion-w034c0b8.png";var Dx="/paper-zbt34fab.png";var qx="/paypal-kwwf7xsc.png";var Mx="/perplexity-4y63rxvj.png";var Px="/postgresql-qsspbsr1.png";var _x="/posthog-sphppc4w.png";var Ox="/puppeteer-2xjt1a9b.png";var jx="/railway-834de8d2.png";var Tx="/redis-spm6w2m1.png";var Cx="/salesforce-1mk56v4z.png";var wx="/sentry-hdwpmvek.png";var Ex="/shopify-90dadaav.png";var Sx="/slack-1c1wj62s.png";var Ix="/snowflake-hfpykpgy.png";var Rx="/stripe-zrfaqbj3.png";var kx="/supabase-4vg33zf2.png";var bx="/telegram-v6tjyrs7.png";var yx="/twilio-dpyjdwpj.png";var hx="/vercel-7d0ssw28.png";var xx="/zapier-p67qfch0.png";var Z60={agentation:ph,airtable:uh,apollo:ch,asana:dh,atlassian:lh,box:ih,chrome:DV,"chrome-devtools":DV,clickup:rh,cloudflare:ah,context7:nh,datadog:oh,discord:sh,dropbox:th,elevenlabs:eh,exa:$x,figma:Zx,firecrawl:Hx,github:Bx,gitlab:Jx,gmail:Qx,googlecalendar:Xx,googledrive:zx,grafana:Gx,granola:Fx,hubspot:Ux,huggingface:Yx,intercom:Kx,linear:Wx,monday:Nx,mongodb:Lx,neon:Ax,notion:Vx,paper:Dx,paypal:qx,perplexity:Mx,postgresql:Px,posthog:_x,puppeteer:Ox,railway:jx,redis:Tx,salesforce:Cx,sentry:wx,shopify:Ex,slack:Sx,snowflake:Ix,stripe:Rx,supabase:kx,telegram:bx,twilio:yx,vercel:hx,zapier:xx},H60={"google drive":"googledrive","google calendar":"googlecalendar",gcal:"googlecalendar",gdrive:"googledrive","apollo.io":"apollo","paper-desktop":"paper","granola-mcp":"granola","claude-in-chrome":"chrome",postgres:"postgresql","hugging face":"huggingface",jira:"atlassian",confluence:"atlassian"};function vx($){let Z=$.match(/^claude[._]ai[._\s]+(.+)$/i);if(!Z)return $;return Z[1].replace(/_/g," ")}function EU($){return $.toLowerCase().replace(/[\s._-]+/g,"")}var B60=new Map(Object.entries(Z60).map(([$,Z])=>[EU($),Z])),J60=new Map(Object.entries(H60).map(([$,Z])=>[EU($),EU(Z)]));function SU($){let Z=EU(vx($));return B60.get(J60.get(Z)??Z)}function IU($){return vx($).split(/[\s._-]+/).filter(Boolean).map((Z)=>Z[0].toUpperCase()+Z.slice(1)).join(" ")}var qV=O(c(),1);function LJ({open:$,children:Z}){return qV.jsx(e2,{initial:!1,children:$&&qV.jsx(B5.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"spring",duration:0.25,bounce:0.1},className:"overflow-hidden",children:Z},"content")})}var gx=O(g(),1);var px=O(c(),1),Q60=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function fx($,Z){if($.name!=="Read"||!Z)return null;let H=$.input,B=typeof H.file_path==="string"?H.file_path:null;if(!B||!Q60.test(B))return null;let J=Z.endsWith("/")?Z:`${Z}/`;if(!B.startsWith(J))return null;return B.slice(J.length)}function mx({relPath:$}){let Z=H5(),[H,B]=gx.useState(!1);if(H)return null;let J=`/api/workspaces/${Z}/preview/${$.split("/").map(encodeURIComponent).join("/")}`;return px.jsx("img",{src:J,alt:$,loading:"lazy",onError:()=>B(!0),className:"max-h-64 max-w-full self-start rounded-lg border border-border object-contain"})}var qJ=O(g(),1);var cx=O(c(),1),X60=s("animate-[text-shimmer_2s_ease-in-out_infinite]","bg-clip-text text-transparent","bg-[length:200%_auto]","bg-[linear-gradient(90deg,var(--muted-foreground)_0%,var(--muted-foreground)_40%,var(--foreground)_50%,var(--muted-foreground)_60%,var(--muted-foreground)_100%)]");function ux({children:$,active:Z=!0,className:H}){return cx.jsx("span",{className:s(H,Z&&X60),children:$})}var AJ=O(c(),1);function RU({className:$}){return AJ.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:$,"aria-hidden":"true",children:[AJ.jsx("path",{d:"M3.49994 11.7501L11.6717 3.57855C12.7762 2.47398 14.5672 2.47398 15.6717 3.57855C16.7762 4.68312 16.7762 6.47398 15.6717 7.57855M15.6717 7.57855L9.49994 13.7501M15.6717 7.57855C16.7762 6.47398 18.5672 6.47398 19.6717 7.57855C20.7762 8.68312 20.7762 10.474 19.6717 11.5785L12.7072 18.543C12.3167 18.9335 12.3167 19.5667 12.7072 19.9572L13.9999 21.2499"}),AJ.jsx("path",{d:"M17.4999 9.74921L11.3282 15.921C10.2238 17.0255 8.43275 17.0255 7.32825 15.921C6.22376 14.8164 6.22376 13.0255 7.32825 11.921L13.4999 5.74939"})]})}var z2=O(c(),1),kU="group/row flex w-full items-center gap-2 py-1.5 text-left select-none";function IZ({isFirst:$,isLast:Z,marker:H,loading:B=!1,isError:J=!1,children:Q}){let X=H!=null||B;return z2.jsxs("div",{className:"relative flex gap-2.5",children:[z2.jsxs("div",{className:"relative w-[13px] shrink-0",children:[!$&&z2.jsx("span",{className:s("absolute top-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"h-1":"h-2.5")}),!Z&&z2.jsx("span",{className:s("absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"top-[26px]":"top-5")}),H?z2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2",children:H}):B?z2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 p-0.5",children:z2.jsx(I5,{size:12,stroke:1.75,className:"animate-spin text-muted-foreground"})}):z2.jsx("span",{className:s("absolute top-[15px] left-1/2 z-10 size-[5px] -translate-x-1/2 -translate-y-1/2 rounded-full",J?"bg-destructive":"bg-border")})]}),Q]})}function VJ({open:$}){return z2.jsx(B5.span,{animate:{rotate:$?90:0},transition:{type:"spring",duration:0.2,bounce:0.1},className:s("flex shrink-0",$?"opacity-100":"opacity-0 group-hover/row:opacity-100"),children:z2.jsx(H7,{size:12,stroke:1.75})})}function SZ({children:$,className:Z}){return z2.jsx("span",{className:s("flex size-4 items-center justify-center overflow-hidden rounded-xs bg-muted",Z),children:$})}function dx({icon:$,size:Z=12,stroke:H=1.75}){return z2.jsx(SZ,{children:z2.jsx($,{size:Z,stroke:H,className:"text-muted-foreground"})})}function lx({src:$}){if(!$)return z2.jsx(SZ,{children:z2.jsx(RU,{className:"size-3 text-muted-foreground"})});return z2.jsx(SZ,{children:z2.jsx("img",{src:$,alt:"",className:"size-full object-cover"})})}var V60=ax(),MV=Zv();function D60($){if(!$)return"$";return/^[A-Za-z_][A-Za-z0-9_]*$/.test($)?`$${$}`:`\${${$}}`}function q60($){try{return MV($,D60)}catch{return null}}function Hv($){return $.split("/").pop()??$}var M60=new Set(["bash","sh","zsh","fish","dash","ash","ksh","mksh","csh","tcsh","nu","pwsh","powershell"]),P60=new Set(["-o","+o","-O","+O","--rcfile","--init-file"]),_60=/^[A-Za-z_][A-Za-z0-9_]*=/;function O60($){if(/^-[a-zA-Z]*c$/.test($))return!0;let Z=$.toLowerCase();return Z==="--command"||Z==="-command"}function j60($){let Z=q60($);if(!Z||Z.length<3)return null;let H=(Q)=>{let X=Z[Q];return typeof X==="string"?X:null},B=0,J=()=>{while(_60.test(H(B)??""))B++};if(J(),Hv(H(B)??"")==="env")B++,J();if(!M60.has(Hv(H(B)??"")))return null;B++;while(B<Z.length){let Q=H(B);if(Q===null)return null;if(O60(Q)){if(B+2!==Z.length)return null;return H(B+1)?.trim()||null}if(!Q.startsWith("-")&&!Q.startsWith("+"))return null;B+=P60.has(Q)?2:1}return null}function T60($){let Z=$;for(let H=0;H<3;H++){let B=j60(Z);if(B===null)return Z;Z=B}return Z}function C60($){return $.replace(/\\\r?\n[ \t]*/g," ").replace(/[ \t]*\r?\n[ \t]*/g," ").replace(/[ \t]{2,}/g," ").trim()}function T7($){return C60(T60($))}function RZ($,Z){let H=T7($);return H?Z(`$ ${H}`):""}var w60=/^[A-Za-z]:\//;function E60($=""){if(!$)return $;return $.replace(/\\/g,"/").replace(w60,(Z)=>Z.toUpperCase())}var S60=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var Bv=/^\/([A-Za-z]:)?$/;function I60(){if(typeof process<"u"&&typeof process.cwd==="function")return process.cwd().replace(/\\/g,"/");return"/"}var PV=function(...$){$=$.map((B)=>E60(B));let Z="",H=!1;for(let B=$.length-1;B>=-1&&!H;B--){let J=B>=0?$[B]:I60();if(!J||J.length===0)continue;Z=`${J}/${Z}`,H=_V(J)}if(Z=Jv(Z,!H),H&&!_V(Z))return`/${Z}`;return Z.length>0?Z:"."};function Jv($,Z){let H="",B=0,J=-1,Q=0,X=null;for(let z=0;z<=$.length;++z){if(z<$.length)X=$[z];else if(X==="/")break;else X="/";if(X==="/"){if(J===z-1||Q===1);else if(Q===2){if(H.length<2||B!==2||H[H.length-1]!=="."||H[H.length-2]!=="."){if(H.length>2){let G=H.lastIndexOf("/");if(G===-1)H="",B=0;else H=H.slice(0,G),B=H.length-1-H.lastIndexOf("/");J=z,Q=0;continue}else if(H.length>0){H="",B=0,J=z,Q=0;continue}}if(Z)H+=H.length>0?"/..":"..",B=2}else{if(H.length>0)H+=`/${$.slice(J+1,z)}`;else H=$.slice(J+1,z);B=z-J-1}J=z,Q=0}else if(X==="."&&Q!==-1)++Q;else Q=-1}return H}var _V=function($){return S60.test($)};var OV=function($,Z){let H=PV($).replace(Bv,"$1").split("/"),B=PV(Z).replace(Bv,"$1").split("/");if(B[0][1]===":"&&H[0][1]===":"&&H[0]!==B[0])return B.join("/");let J=[...H];for(let Q of J){if(B[0]!==Q)break;H.shift(),B.shift()}return[...H.map(()=>".."),...B].join("/")};function kZ($){return $.input??{}}function G1($,Z){let H=$[Z];return typeof H==="string"?H:""}function Qv($){return(Z)=>Z.replace(/\/[^\s"']+/g,(H)=>{if(!$)return H;let B=OV($,H);return B.startsWith("..")?H:B})}function C7($){let Z=Math.max(1,Math.round($/1000));if(Z<60)return`${Z}s`;let H=Math.floor(Z/60),B=Z%60;return B?`${H}m ${B}s`:`${H}m`}var R60={ToolSearch:"Tool search",WebSearch:"Web search",WebFetch:"Web fetch"};function k60($){if(!$.startsWith("mcp__"))return $;let Z=$.slice(5).split("__");return Z.length>=2?Z.slice(1).join("__"):Z[0]}function b60($,Z){let H=$.name,B=kZ($);if(H==="Bash")return RZ(G1(B,"command"),Z);if(H==="Read"||H==="Write"||H==="Edit")return Z(G1(B,"file_path"));if(H==="Glob")return Z(G1(B,"pattern"));if(H==="Grep")return`/${G1(B,"pattern")}/ ${Z(G1(B,"path"))}`;if(H==="WebSearch")return G1(B,"query");if(H==="WebFetch")return G1(B,"url");if(H==="ToolSearch"){let J=G1(B,"query");if(J.startsWith("select:"))return J.slice(7).split(",").map(k60).join(", ");return J}return""}var DJ={displayName:($)=>R60[$.name]??$.name,brief:b60};var jV={exec:"Bash",apply_patch:"Edit",web_search:"Web search",update_plan:"Update plan",subagent:"Run sub-agent",subagent_activity:"Sub-agent",review:"Review",view_image:"View image",generate_image:"Generate image",list_mcp_resources:"List MCP resources",list_mcp_resource_templates:"List MCP templates",read_mcp_resource:"Read MCP resource"},zv={read:"Read",listFiles:"List files",search:"Search"};function Gv($){let Z=$?.commandActions;if(!Array.isArray(Z)||Z.length===0)return null;let H=Z[0],B=H?.type;if(!B||!(B in zv))return null;if(Z.some((J)=>J?.type!==B))return null;return H}var Xv={spawn_agent:"Run sub-agent",send_input:"Message the agent",resume_agent:"Resume the agent",close_agent:"Stopping the agent"};function y60($){if($.name==="exec"){let Z=Gv($.input);if(Z?.type)return zv[Z.type]}if($.name==="subagent"){let Z=$.input?.action;if(typeof Z==="string"&&Z in Xv)return Xv[Z]}return jV[$.name]??$.name}function h60($,Z){let H=$.name,B=kZ($);if(H==="exec"){let J=Gv(B);if(J?.type==="read")return Z(J.path||J.name||"");if(J?.type==="search")return[J.query&&`/${J.query}/`,J.path&&Z(J.path)].filter(Boolean).join(" ");if(J?.type==="listFiles")return J.path?Z(J.path):"";return RZ(G1(B,"command"),Z)}if(H==="apply_patch"){let J=B.changes;if(Array.isArray(J))return J.map((X)=>X&&typeof X==="object"?X.path:void 0).filter((X)=>typeof X==="string").map(Z).join(", ");return""}if(H==="web_search"){let J=B.queries;if(Array.isArray(J)&&J.length>0)return J.filter((Q)=>typeof Q==="string").join(" · ");return G1(B,"query")}if(H==="update_plan"){let J=B.plan;return typeof J==="string"?J.split(`
|
|
65
|
+
`)[0]:""}if(H==="subagent"){if(G1(B,"action")==="close_agent")return"";return G1(B,"prompt")}if(H==="subagent_activity")return G1(B,"kind");if(H==="generate_image")return G1(B,"prompt").split(`
|
|
66
|
+
`)[0];if(H==="read_mcp_resource")return G1(B,"uri");if(H==="list_mcp_resources"||H==="list_mcp_resource_templates")return G1(B,"server");return""}var Fv={displayName:y60,brief:h60};function Uv($){let Z=$.indexOf(":"),H=(Z>0?$.slice(0,Z):$).trim(),B=Z>0?$.slice(Z+1).trim():"",J=H.match(/^(.*?)\s*\(([^)]*)\)$/);if(!J)return{action:H,qualifier:"",detail:B};return{action:J[1].trim(),qualifier:J[2].trim(),detail:B}}var x60={terminal:"Run command",read:"Read",write:"Write",edit:"Edit",patch:"Edit",search:"Search",extract:"Fetch webpage","web extract":"Fetch webpage","web search":"Web search",delegate:"Delegate task","delegate batch":"Delegate tasks",todo:"Update TODO",python:"Run Python","process wait":"Wait for process","session search":"Search sessions","skills list":"List skills","skill view":"View skill"};function v60($){let{action:Z}=Uv($.name),H=x60[Z];if(H)return H;let B=Z.replace(/_/g," ");return B.charAt(0).toUpperCase()+B.slice(1)}function g60($,Z){let{action:H,qualifier:B,detail:J}=Uv($.name),Q=J||B;if(!Q)return"";return H==="terminal"?`$ ${T7(Q)}`:Z(Q)}var Yv={displayName:v60,brief:g60};var f60={read:"Read file",write:"Write file",edit:"Edit file",apply_patch:"Edit",exec:"Bash",bash:"Bash",ls:"List files",find:"Find files",grep:"Search",process:"Manage process",web_search:"Web search",web_fetch:"Fetch",sessions_list:"List sessions",sessions_history:"Recall session",sessions_yield:"Yield to session",sessions_send:"Send to session",sessions_spawn:"Spawn session",subagents:"Run sub-agent",agents_list:"List agents",session_status:"Session status",image:"Analyze image",image_generate:"Generate image",memory_get:"Read memory",memory_search:"Search memory",update_plan:"Update plan",message:"Send message",browser:"Browser",canvas:"Canvas",cron:"Cron",gateway:"Gateway",code_execution:"Run Python",tts:"Text-to-speech",music_generate:"Generate music",video_generate:"Generate video",x_search:"Search X"};function m60($,Z){let H=$.name,B=kZ($);if(H==="read"||H==="write"||H==="edit")return Z(G1(B,"path"));if(H==="apply_patch"){let J=B.changes;if(Array.isArray(J)&&J.length>0){let z=J.map((G)=>G&&typeof G==="object"?G1(G,"path"):"").filter(Boolean);if(z.length===1)return Z(z[0]);if(z.length>1)return`${z.length} files`}let Q=G1(B,"patch")||G1(B,"input"),X=Q.split(`
|
|
67
|
+
`).find((z)=>z.startsWith("*** "))??Q.split(`
|
|
68
|
+
`)[0];return Z(X??"")}if(H==="exec"||H==="bash"){let J=G1(B,"command")||G1(B,"code");return RZ(J,Z)}if(H==="ls"||H==="find"||H==="grep")return Z(G1(B,"path")||G1(B,"pattern"));if(H==="process"){let J=G1(B,"action"),Q=G1(B,"name");return[J,Q].filter(Boolean).join(" ")||Z(T7(G1(B,"command")))}if(H==="web_search"||H==="x_search")return G1(B,"query");if(H==="web_fetch")return G1(B,"url");if(H==="memory_search")return G1(B,"query");if(H==="memory_get")return G1(B,"key")||G1(B,"name");if(H==="sessions_history"||H==="sessions_send"||H==="sessions_yield")return G1(B,"sessionKey")||G1(B,"agentId");if(H==="sessions_list"||H==="agents_list")return G1(B,"agentId");if(H==="subagents"||H==="sessions_spawn")return G1(B,"task")||G1(B,"agentId");if(H==="image"||H==="image_generate")return G1(B,"prompt")||Z(G1(B,"path"));if(H==="message")return G1(B,"recipient")||G1(B,"to");if(H==="update_plan"){let J=B.plan;if(Array.isArray(J)){let X=J.find((z)=>!!z&&typeof z==="object"&&z.status==="in_progress")?.step??J[0]?.step;if(typeof X==="string")return X}return""}return""}var Kv={displayName:($)=>f60[$.name]??DJ.displayName($),brief:($,Z)=>m60($,Z)||DJ.brief($,Z)};function TV($){if(!($.name==="Bash"||$.name==="exec"||$.name==="bash"))return null;let H=$.input??{},B=typeof H.command==="string"?H.command:"";if(!B)return null;let Q=T7(B).match(/(?:^|\s|\$\()mcporter(?:\)?)\s+call\s+([A-Za-z0-9_-]+)\.([A-Za-z0-9_-]+)((?:\s+(?!&&|\|\||;|\|)\S+)*)/);if(!Q)return null;return{server:Q[1],tool:Q[2],rest:(Q[3]??"").trim()}}function CV($){let Z=$.name;if(!Z.startsWith("mcp__"))return null;let H=Z.slice(5),B=H.indexOf("__");if(B<=0)return null;return{server:H.slice(0,B),tool:H.slice(B+2),rest:""}}function wV($){if($.provider!=="codex"||!$.mcpServer)return null;if($.name in jV)return null;if($.mcpServer==="codex")return null;let Z=$.name.indexOf(".");if(Z>0)return{server:$.name.slice(0,Z),tool:$.name.slice(Z+1),rest:""};return{server:$.mcpServer,tool:$.name,rest:""}}function EV($,Z){let H=Z.toLowerCase();return["-","_","."].find((J)=>H.startsWith($.toLowerCase()+J))?Z.slice($.length+1):Z}var p60={"claude-code":DJ,openclaw:Kv,codex:Fv,hermes:Yv};function Wv($){return p60[$.provider??"claude-code"]}function Nv($){return Wv($).displayName($)}function Lv($,Z){return Wv($).brief($,Qv(Z))}var l5=O(c(),1),Av=[Vv,Dv,SV];function u60(){let[$,Z]=qJ.useState(0);qJ.useEffect(()=>{let B=setInterval(()=>Z((J)=>(J+1)%Av.length),600);return()=>clearInterval(B)},[]);let H=Av[$];return l5.jsx(SZ,{className:"size-5",children:l5.jsx(H,{size:16,stroke:1.75,className:"text-foreground"})})}function qv({call:$,cwd:Z,isFirst:H,isLast:B,renderNestedParts:J}){let[Q,X]=qJ.useState(!1),z=$.subagent,G=$.input??{},F=z?.description??G.description??"Subtask",U=z?.status,Y=$.state==="error"||U==="failed",K=$.state==="running"||U==="running",W=z?.usage?.toolUses,N=z?.usage?.durationMs,V=(K&&z?.progress?.length?z.progress[z.progress.length-1]:null)??(W!=null?`Took ${W} step${W===1?"":"s"}`:null),A=(z?.transcript??[]).flatMap((_)=>_.parts),D=typeof $.output==="string"?$.output:"",q=A.length>0||!!D;return l5.jsx(IZ,{isFirst:H,isLast:B,marker:K?l5.jsx(u60,{}):l5.jsx(SZ,{className:"size-5",children:l5.jsx(SV,{size:16,stroke:1.75,className:"text-foreground"})}),isError:Y,children:l5.jsxs("div",{className:"min-w-0 flex-1",children:[l5.jsxs("button",{type:"button",title:`Agent: ${F}`,onClick:()=>q&&X((_)=>!_),className:s("group/row flex w-full flex-col items-start gap-0.5 py-1.5 text-left select-none",q?"cursor-pointer":"cursor-default"),children:[l5.jsxs("span",{className:"flex w-full items-center gap-2",children:[l5.jsxs(ux,{active:K,className:"min-w-0 flex-1 truncate text-xs font-medium",children:["Agent: ",F]}),!K&&N!=null&&l5.jsx("span",{className:"shrink-0 rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground tabular-nums",children:C7(N)}),U==="failed"&&l5.jsx("span",{className:"shrink-0 text-xs text-destructive",children:"✗"}),U==="stopped"&&l5.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"✗"}),q&&l5.jsx(VJ,{open:Q})]}),V&&l5.jsx("span",{className:"w-full truncate text-xs text-muted-foreground",children:V})]}),q&&l5.jsx(LJ,{open:Q,children:l5.jsxs("div",{className:"mt-1 mb-1 overflow-hidden rounded-lg border border-border",children:[A.length>0&&l5.jsx("div",{className:"py-1.5 pr-2 pl-3",children:J(A,Z)}),D&&l5.jsx("div",{className:s("bg-muted/30 px-3.5 py-3 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",A.length>0&&"border-t border-border"),children:D})]})})]})})}var w7=O(g(),1);var Sv=O(g(),1);var kV=new Set(["<",">","{","}","[","]"]),xV=new Set(["for","do","while","if","else","return","function","var","let","const","true","false","undefined","this","new","delete","typeof","in","instanceof","void","break","continue","switch","case","default","throw","try","catch","finally","debugger","with","yield","async","await","class","extends","super","import","export","from","static"]),c60=new Set([...xV,"type","interface","enum","implements","readonly","abstract","declare","namespace","module","private","protected","public","override","keyof","infer","is","asserts","satisfies","as","unknown","never","any","number","string","boolean","bigint","symbol","object"]),Ov=new Set(["+","-","*","/","%","=","!","&","|","^","~","!","?",":",".",",",";","'",'"',".","(",")","[","]","#","@","\\",...kV]),d60={keywords:xV,onCommentStart:wv,onCommentEnd:e60};function l60($){let Z=0;if(/\binterface\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\btype\s+[A-Za-z_$][\w$]*\s*=/.test($))Z+=2;if(/\benum\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test($))Z+=2;if(/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test($))Z+=1;if(/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test($))Z+=1;if(/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test($))Z+=1;return Z>=2}function i60($,Z){if($[Z]!=="<")return!1;let H=0,B=!1;for(let J=Z;J<$.length;J++){let Q=$[J];if(Q==="<"){H++;continue}if(Q===">"){if(H--,H===0){let X=J+1;while(X<$.length&&/\s/.test($[X]))X++;if(!(B&&$[X]==="("))return!1;let z=$.slice(X,X+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(z)}continue}if(H===0)continue;if(/[$A-Za-z_]/.test(Q)){B=!0;continue}if(/[\s,\.\=\?\:\|\&\[\]]/.test(Q))continue;return!1}return!1}var hU=["identifier","keyword","string","class","property","entity","jsxliterals","sign","comment","break","space"],[bZ,r60,n3,IV,RV,a60,n60,q9,Mv,bV,Pv]=hU.map(($,Z)=>Z);function MJ($){return/^[^\S\r\n]+$/g.test($)}function o60($){return Ov.has($)}function s60($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function xU($){return/^[\w_]+$/.test($)||jv($)}function _v($){let Z=$[0];return xU(Z)&&Z===Z.toUpperCase()||$==="null"}function jv($){return/[^\u0000-\u007f]/.test($)}function Tv($){return/^[a-zA-Z]$/.test($)}function Cv($){return Tv($)||jv($)}function yZ($){return Cv($[0])&&($.length===1||xU($.slice(1)))}function yV($){return $==="`"}function hV($){return $==='"'||$==="'"}function t60($){return hV($)||yV($)}function wv($,Z){let H=$+Z;if(H==="/*")return 2;return H==="//"?1:0}function e60($,Z){return $+Z==="*/"?2:Z===`
|
|
69
|
+
`?1:0}function $70($){return $[0]==="/"&&!wv($[0],$[1])}function Z70($,Z){let H={...d60,...Z},B=!!(Z&&Z.keywords instanceof Set),J=l60($),Q=B?H.keywords:J?c60:xV,{onCommentStart:X,onCommentEnd:z}=H,G=H.typeKeywords instanceof Set?H.typeKeywords:null,F="",U=-1,Y=[-1,""],K=[-2,""],W=[],N=!1,L=0,V=!1,A=0,D=()=>N&&!V&&!L,q=()=>L&&!D(),_=()=>!L&&D()&&!V&&A>0,M=null,P=!1,T=0,R=0,y=()=>M!==null,w=()=>P,h=()=>R>T,E=()=>R>0&&R===T,I=()=>y()||h();function j(k){let b=k===`
|
|
70
|
+
`;if(q()){if(y())return n3;let[,u]=Y;if(yZ(k)){if(u==="<"||u==="</")return a60}}if(_())return n60;if(y()||h())return n3;else if(G&&G.has(k))return Y[1]==="."?bZ:IV;else if(Q.has(k))return Y[1]==="."?bZ:r60;else if(b)return bV;else if(MJ(k))return Pv;else if(k.split("").every(o60))return q9;else if(_v(k))return q()?bZ:IV;else{if(yZ(k)){let u=Y[1]==="."&&yZ(K[1]);if(!I()&&!u)return bZ;if(u)return RV}return n3}}let S=(k,b)=>{if(b)F=b;if(F){U=typeof k==="number"?k:j(F);let v=[U,F];if(U!==Pv&&U!==bV)K=Y,Y=v;W.push(v)}F=""};for(let k=0;k<$.length;k++){let b=$[k],v=$[k-1],u=$[k+1],C=v+b,t=b+u;if(typeof H.onQuote==="function"&&b==="'"&&!y()&&!_()&&!h()){let d=H.onQuote(b,k,$);if(typeof d==="number"&&d>=1&&!Number.isNaN(d)){let X0=Math.min(d,$.length-k),K0=k+X0;S(),F=$.slice(k,K0),S(bZ),k=K0-1;continue}}if(hV(b)&&!_()&&!h()){if(S(),v!=="\\"){if(M&&b===M)M=null;else if(!M)M=b}S(n3,b);continue}if(!h()){if(v!=="\\n"&&yV(b)){S(),S(n3,b),R++;continue}}if(h()){if(v!=="\\n"&&yV(b)){if(R>0){S(),R--,S(n3,b);continue}}if(t==="${"){T++,S(n3),S(q9,t),k++;continue}}if(E()&&b==="}"){S(),T--,S(q9,b);continue}if(D()){if(b==="{"){S(),S(q9,b),V=!0;continue}}if(N){if(!L&&b==="<"){if(S(),u==="/")L=2,F=t,k++;else L=1,F=b;S(q9);continue}if(L){if(b===">"&&!"/=".includes(v)){if(S(),L===1)L=0,A++;else L=0,N=!1;S(q9,b);continue}if(t==="/>"||t==="</"){if(F!=="<"&&F!=="/")S();if(t==="/>")L=0;else A--;if(!A)N=!1;F=t,k++,S(q9);continue}if(b==="<"){S(),F=b,S(q9);continue}if(u==="-"&&!I()&&!_()){if(F){S(RV,F+b+u),k++;continue}}if(u==="="&&!I()){if(!MJ(b)){if(MJ(F))S();let d=F+b;if(yZ(d)){S(RV,d);continue}}}}}if(!L&&(b==="<"&&Cv(u)||t==="</")){let d=k-1;while(d>=0&&/\s/.test($[d]))d--;let X0=d>=0?$[d]:"",[K0,Q0]=Y,z0=!1,A0=!1;if(F&&!MJ(F)){let $0=F;if(_v($0)||$0==="true"||$0==="false")z0=!0;else if(Q.has($0)&&yZ($0))A0=!0;else if(yZ($0))z0=!0}let i=b==="<"&&/[$\w\]\)]/.test(X0)&&(z0||!A0&&(K0===bZ||K0===IV||K0===q9&&(Q0===")"||Q0==="]"))),B0=b==="<"&&i60($,k);if(!i&&!B0)L=u==="/"?2:1;if(b==="<"&&(u==="/"||Tv(u))){if(!i&&!B0&&!I()&&!_()&&!w())N=!0}}let H0=t60(b),x=h(),e=!N&&$70(t),L0=_();if(H0||x||hV(M))F+=b;else if(e){S();let[d,X0]=Y;if(e&&d!==-1&&!(d===q9&&X0!==")"||d===Mv)){F=b,S();continue}P=!0;let K0=k++,Q0=()=>k>=$.length,z0=()=>Q0()||$[k]===`
|
|
71
|
+
`,A0=!1,i=!1;for(;!z0();k++){let B0=$[k],$0=$[k-1]==="\\";if(!$0&&B0==="[")i=!0;if(!$0&&B0==="]")i=!1;if(B0==="/"&&!i&&!$0){A0=!0;while(K0!==k&&/^[a-z]$/.test($[k+1])&&!z0())k++;break}}if(P=!1,K0!==k&&A0)F=$.slice(K0,k+1),S(n3);else F=b,S(),k=K0}else if(X(b,u)){S();let d=k,X0=X(b,u);if(X0){for(;k<$.length;k++)if(z($[k-1],$[k])==X0)break}F=$.slice(d,k+1),S(Mv)}else if(b===" "||b===`
|
|
72
|
+
`)if(b===" "&&(MJ(F)||!F||L0)){if(F+=b,u==="<")S()}else S(),F=b,S();else if(V&&b==="}")S(),F=b,S(),V=!1;else if(L0&&!kV.has(b)||h()||(xU(b)===xU(F[F.length-1])||D())&&!Ov.has(b))F+=b;else{if(C==="</")F=C;if(S(),C!=="</")F=b;if(t==="</"||t==="/>")F=t,S(),k++;else if(kV.has(b))S()}}return S(),W}function H70($,Z){let H=[],B=Z&&typeof Z.lineClassName==="function"?Z.lineClassName:null,J=0,Q=(F,U)=>{let Y=B?B(U,J):"";return J++,{type:"element",tagName:"span",children:F,properties:{className:Y?`sh__line ${Y}`:"sh__line"}}};function X(F){let U=F.map(([,K])=>K).join(""),Y=F.map(([K,W])=>{let N=hU[K];return{type:"element",tagName:"span",children:[{type:"text",value:W}],properties:{className:`sh__token--${N}`,style:{color:`var(--sh-${N})`}}}});H.push(Q(Y,U))}let z=[],G=!1;for(let F=0;F<$.length;F++){let U=$[F],[Y,K]=U,W=F===$.length-1;if(Y!==bV){if(K.includes(`
|
|
73
|
+
`)){let N=K.split(`
|
|
74
|
+
`);for(let L=0;L<N.length;L++)if(z.push([Y,N[L]]),L<N.length-1)X(z),z.length=0}else z.push(U);G=!1}else{if(G)X([]);else X(z),z.length=0;if(W)X([]);G=!0}}if(z.length)X(z);return H}var B70=($)=>{let Z=`class="${$.className}"`;if($.style){let H=Object.entries($.style).map(([B,J])=>`${B}:${J}`).join(";");Z+=` style="${H}"`}return Z};function J70($){return $.map((Z)=>{let{tagName:H}=Z,B=Z.children.map((J)=>{let{tagName:Q,children:X,properties:z}=J;return`<${Q} ${B70(z)}>${s60(X[0].value)}</${Q}>`}).join("");return`<${H} class="${Z.properties.className}">${B}</${H}>`}).join(`
|
|
75
|
+
`)}function Ev($,Z){let H=Z70($,Z),B=H70(H,Z);return J70(B)}var CZ1={TokenTypes:hU,TokenMap:new Map(hU.map(($,Z)=>[$,Z]))};var vV=O(c(),1),Q70=s("[--sh-identifier:#1f2937]","[--sh-keyword:#cf222e]","[--sh-string:#16a34a]","[--sh-class:#2d6e7e]","[--sh-property:#0550ae]","[--sh-entity:#6f42c1]","[--sh-jsxliterals:#6f42c1]","[--sh-sign:#8b949e]","[--sh-comment:#9ca3af]");function Iv({code:$,className:Z}){let H=Sv.useMemo(()=>Ev($),[$]);return vV.jsx("pre",{className:s("overflow-auto font-mono text-xs leading-relaxed whitespace-pre",Q70,Z),children:vV.jsx("code",{className:"font-mono",dangerouslySetInnerHTML:{__html:H}})})}var X70={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",json:"json",md:"md",mdx:"mdx",css:"css",scss:"scss",html:"html",py:"py",rb:"rb",go:"go",rs:"rs",java:"java",c:"c",h:"c",cpp:"cpp",sh:"sh",bash:"sh",yml:"yaml",yaml:"yaml",toml:"toml",sql:"sql",php:"php",swift:"swift",kt:"kt"};function z70($){let Z=$.split(/[\\/]/).pop()??"",H=Z.lastIndexOf("."),B=H>0?Z.slice(H+1).toLowerCase():"";return X70[B]??null}function G70($){let Z=$.trim();if(Z.length<2||!(Z.startsWith("{")||Z.startsWith("[")))return null;try{return JSON.stringify(JSON.parse(Z),null,2)}catch{return null}}function F70($){let Z=$.split(`
|
|
76
|
+
`);if(!Z.some((H)=>/^\s*\d+\t/.test(H)))return $;return Z.map((H)=>H.replace(/^\s*\d+\t/,"")).join(`
|
|
77
|
+
`)}function Rv($,Z){let H=$.input??{},B=typeof H.file_path==="string"?H.file_path:typeof H.path==="string"?H.path:"",J=B?z70(B):null,Q=$.name==="Read"||$.name==="read",X=$.name==="Write"||$.name==="write";if(J&&Q&&Z)return{kind:"highlight",code:F70(Z),label:J};if(J&&X&&typeof H.content==="string"&&H.content)return{kind:"highlight",code:H.content,label:J};let z=G70(Z);if(z)return{kind:"highlight",code:z,label:"json"};return{kind:"plain"}}var B4=O(c(),1),gV="max-h-[280px] overflow-auto px-3 py-2.5 font-mono text-xs leading-relaxed";function kv({call:$,output:Z,isError:H}){let[B,J]=w7.useState(!1),Q=w7.useMemo(()=>H?{kind:"plain"}:Rv($,Z),[$,Z,H]);if(Q.kind==="plain")return B4.jsx("div",{className:s("rounded-lg border",H?"border-destructive/30 bg-destructive/10":"border-border bg-muted"),children:B4.jsx("pre",{className:s(gV,"break-all whitespace-pre-wrap",H?"text-destructive":"text-muted-foreground"),children:Z||"(empty)"})});return B4.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-muted",children:[B4.jsx(U70,{raw:B,onRaw:J,label:Q.label,copyText:B?Z:Q.code}),B?B4.jsx("pre",{className:s(gV,"break-all whitespace-pre-wrap text-muted-foreground"),children:Z||"(empty)"}):B4.jsx(Iv,{code:Q.code,className:s(gV,"text-muted-foreground")})]})}function U70({raw:$,onRaw:Z,label:H,copyText:B}){return B4.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2",children:[[[!1,H],[!0,"raw"]].map(([Q,X])=>B4.jsx(C0,{type:"button",variant:$===Q?"outline":"ghost",size:"sm",onClick:()=>Z(Q),className:"rounded-full text-xs uppercase",children:X},X)),B4.jsx("div",{className:"flex-1"}),B4.jsx(Y70,{text:B})]})}function Y70({text:$}){let[Z,H]=w7.useState(!1);return w7.useEffect(()=>{if(!Z)return;let J=setTimeout(()=>H(!1),1500);return()=>clearTimeout(J)},[Z]),B4.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard?.writeText($).then(()=>H(!0)).catch(()=>{})},"aria-label":Z?"Copied":"Copy",children:Z?B4.jsx(L3,{stroke:1.75}):B4.jsx(oX,{stroke:1.75})})}var S1=O(c(),1);function vU({parts:$,cwd:Z=null,processing:H=!1}){let B=$.filter((J)=>J.type==="reasoning"||J.type==="tool-call");return S1.jsx("div",{className:"flex flex-col",children:B.map((J,Q)=>{let X=Q===B.length-1,z={isFirst:Q===0,isLast:X};if(J.type==="reasoning")return S1.jsx(K70,{text:J.text,durationMs:J.durationMs,inProgress:H&&X,...z},Q);return S1.jsx(W70,{call:J.call,cwd:Z,...z},J.call.toolCallId||Q)})})}function fV({isFirst:$,isLast:Z,call:H,leading:B,marker:J,name:Q,brief:X,preview:z}){let[G,F]=mV.useState(!1),U=H.state==="error",Y=H.state==="running"||H.state==="pending",K=U?H.errorText??"":typeof H.output==="string"?H.output:"",W=!!(K||U||z),N=X?`${Q}: ${X}`:Q;return S1.jsx(IZ,{isFirst:$,isLast:Z,marker:J,loading:Y,isError:U,children:S1.jsxs("div",{className:"min-w-0 flex-1",children:[S1.jsxs("button",{type:"button",title:N,onClick:()=>W&&F((L)=>!L),className:s(kU,W?"cursor-pointer":"cursor-default"),children:[B,S1.jsx("span",{className:"shrink-0 text-xs font-medium whitespace-nowrap",children:Q}),X&&S1.jsx("span",{className:"min-w-0 self-baseline truncate text-[12px] text-muted-foreground",children:X}),Y&&J&&S1.jsx(I5,{size:12,stroke:1.75,className:"shrink-0 animate-spin text-muted-foreground"}),W&&S1.jsx(VJ,{open:G})]}),W&&S1.jsx(LJ,{open:G,children:S1.jsxs("div",{className:"mt-1 mb-1 flex flex-col gap-1.5",children:[z,(K||U)&&S1.jsx(kv,{call:H,output:K,isError:U})]})})]})})}function K70({isFirst:$,isLast:Z,text:H,inProgress:B=!1,durationMs:J}){let[Q,X]=mV.useState(!1);if(!H){let F=J===void 0?"Thought":`Thought for ${C7(J)}`;return S1.jsx(IZ,{isFirst:$,isLast:Z,loading:B,children:S1.jsx("div",{className:s(kU,"min-w-0 flex-1 cursor-default"),children:S1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:B?"Thinking":F})})})}let z=B?"Thinking":"Thought",G=B||Q;return S1.jsx(IZ,{isFirst:$,isLast:Z,loading:B,children:S1.jsxs("div",{className:"min-w-0 flex-1",children:[S1.jsxs("button",{type:"button","aria-expanded":G,onClick:()=>X((F)=>!F),className:s(kU,"cursor-pointer"),children:[S1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:z}),S1.jsx(VJ,{open:G})]}),S1.jsx(LJ,{open:G,children:S1.jsx("div",{className:"mt-1 mb-1 pr-2 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",children:S1.jsx(mh,{content:H})})})]})})}function W70({call:$,cwd:Z,isFirst:H,isLast:B}){if($.caller==="subagent")return S1.jsx(qv,{call:$,cwd:Z,isFirst:H,isLast:B,renderNestedParts:(X,z)=>S1.jsx(vU,{parts:X,cwd:z})});if($.name==="Skill"&&$.skill){let X=$.state==="success";return S1.jsx(fV,{isFirst:H,isLast:B,call:$,marker:X?S1.jsx(dx,{icon:bv,size:16,stroke:1.75}):void 0,name:"Loading skill",brief:$.skill.skillName})}let J=TV($)??CV($)??wV($);if(J){let X=EV(J.server,J.tool);return S1.jsx(fV,{isFirst:H,isLast:B,call:$,marker:S1.jsx(lx,{src:SU(J.server)}),name:IU(J.server),brief:J.rest?`${X} ${J.rest}`:X})}let Q=$.state==="error"?null:fx($,Z);return S1.jsx(fV,{isFirst:H,isLast:B,call:$,leading:S1.jsx(N70,{call:$}),name:Nv($),brief:Lv($,Z),preview:Q?S1.jsx(mx,{relPath:Q}):void 0})}function N70({call:$}){if($.caller!=="mcp"&&$.caller!=="server-tool")return null;let Z=$.caller==="mcp"?`mcp${$.mcpServer?`:${$.mcpServer.slice(0,8)}`:""}`:"server";return S1.jsx("span",{className:"shrink-0 rounded border border-border px-1 text-[9px] text-muted-foreground uppercase",children:Z})}var I1=O(c(),1);function xv($){if($.type==="reasoning")return!0;if($.type==="tool-call")return!0;return!1}function L70($){let Z=[];for(let H of $)if(xv(H)){let B=Z[Z.length-1];if(B&&B.kind==="run")B.parts.push(H);else Z.push({kind:"run",parts:[H]})}else Z.push({kind:"single",part:H});return Z}function gU({parts:$,cwd:Z,processing:H=!1}){let B=L70($);return I1.jsx("div",{className:"flex flex-col",children:B.map((J,Q)=>{let X=Q===0?"":"mt-3",z=Q===B.length-1;return I1.jsx("div",{className:X,children:J.kind==="run"?I1.jsx(vU,{parts:J.parts,cwd:Z,processing:H&&z}):I1.jsx(M70,{part:J.part})},Q)})})}function A70($){return $.some((Z)=>Z.type!=="text"||Z.text.trim().length>0)}function V70($){let Z=-1;for(let B=$.length-1;B>=0;B--)if(xv($[B])){Z=B;break}if(Z<0)return null;let H=$.slice(Z+1);if(!A70(H))return null;return{work:$.slice(0,Z+1),response:H}}function D70({parts:$,cwd:Z,durationMs:H,defaultOpen:B}){let J=H===void 0?"Worked":`Worked for ${C7(H)}`;return I1.jsxs(Dz,{defaultOpen:B,className:"group/collapsible",children:[I1.jsxs(qz,{className:"flex w-fit items-center gap-1 rounded-sm py-1 text-left text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[I1.jsx("span",{children:J}),I1.jsx(H7,{size:16,stroke:1.5,className:"shrink-0 transition-transform group-data-open/collapsible:rotate-90"})]}),I1.jsx(Mz,{className:"overflow-hidden pt-2",children:I1.jsx(gU,{parts:$,cwd:Z})})]})}function q70({parts:$,cwd:Z,processing:H=!1,durationMs:B}){let J=H?null:V70($);return I1.jsx("div",{className:"w-full min-w-0",children:H?I1.jsx(gU,{parts:$,cwd:Z,processing:!0}):J?I1.jsxs("div",{className:"flex flex-col gap-3",children:[I1.jsx(D70,{parts:J.work,cwd:Z,durationMs:B}),I1.jsx(gU,{parts:J.response,cwd:Z})]}):I1.jsx(gU,{parts:$,cwd:Z})})}var vv=hv.memo(function({turn:Z,processing:H=!1}){let B=K5().cwd;if(Z.role==="user"&&Z.origin.kind==="user-input"){let J=Z.parts.filter((X)=>X.type==="file"),Q=Z.parts.filter((X)=>X.type==="text").map((X)=>X.type==="text"?X.text:"").join(`
|
|
78
|
+
`);if(!Q&&J.length===0)return null;return I1.jsxs("div",{className:"flex w-full min-w-0 flex-col items-end gap-1.5 pl-8",children:[J.map((X,z)=>I1.jsx(gv,{mediaType:X.mediaType,url:X.url,filename:X.filename},z)),Q&&I1.jsx("p",{className:s("max-w-full min-w-0 rounded-lg bg-primary px-3 py-2 text-sm leading-normal wrap-anywhere whitespace-pre-wrap text-primary-foreground","inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)]"),children:Q})]})}return I1.jsx(q70,{parts:Z.parts,cwd:B,processing:H,durationMs:Z.meta?.durationMs})});function M70({part:$}){switch($.type){case"text":return I1.jsx(fh,{content:$.text});case"tool-call":return I1.jsx(vU,{parts:[$],cwd:null});case"file":return I1.jsx(gv,{mediaType:$.mediaType,url:$.url,filename:$.filename});case"source-url":return I1.jsx(yv,{url:$.url,title:$.title});case"source-document":return I1.jsx(yv,{url:"#",title:$.title});case"data":return I1.jsx(P70,{name:$.name,data:$.data});case"reasoning":return null}}function gv({mediaType:$,url:Z,filename:H}){if($.startsWith("image/")&&Z)return I1.jsx("img",{src:Z,alt:H??"attachment",className:"max-h-64 max-w-full rounded-lg border border-border object-contain"});return I1.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-border bg-accent px-2.5 py-1.5 text-xs text-accent-foreground",children:[I1.jsx(UZ,{size:16,stroke:1.75}),I1.jsx("span",{className:"truncate",children:H??$})]})}function yv({url:$,title:Z}){return I1.jsx("a",{href:$,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:Z??$})}function P70({name:$,data:Z}){return I1.jsxs("details",{children:[I1.jsxs("summary",{className:"cursor-pointer text-xs text-muted-foreground",children:["data:",$]}),I1.jsx("pre",{className:"mt-1 overflow-auto rounded bg-muted p-2 font-mono text-xs text-muted-foreground",children:JSON.stringify(Z,null,2)})]})}var U5=O(c(),1),_70=[],O70=[];function fU({agent:$,active:Z=!0,focusRequest:H=0,docked:B=!1,chatLoaded:J,hasWorkspaceApplets:Q,view:X,previewTurn:z,sessionId:G,processing:F,composerBanner:U,composerAvailability:Y,annotation:K,send:W,stop:N,onNavigateFromWelcome:L,onClose:V,builderDraft:A}){let D=H5(),q=h4.useRef(null),_=h4.useRef(null),M=A?.sessionId??G??null,P=A?null:G??null,T=A?_70:X.turns,R=j5((L0)=>L0.hasSentMessageFromMoi),y=j5((L0)=>(L0.workspaceIdsPendingAnalysis??[]).includes(D)),w=t2((L0)=>(L0.attachments[s2(D,M)]??[]).some((d)=>d.status==="uploading")),h=!RB(!0,w,Y),E=A?null:z,I=A?O70:X.notices,j=h4.useMemo(()=>SE(E?[...T,E]:T),[T,E]),S=h4.useMemo(()=>RE(j,I),[j,I]),k=j.length>0?j[j.length-1].id:null,b=A?!1:F,v=!!A||J&&S.length===0&&!b,u=zR({isViewBuilderDraft:!!A,hasSentMessageFromMoi:R,isWorkspacePendingAnalysis:y}),{atBottom:C,scrollToBottom:t,scrollToTop:H0}=EE(_,M);h4.useLayoutEffect(()=>{if(v&&u!=="empty")H0()},[v,u,H0]),h4.useEffect(()=>{if(Z)pN(q.current)},[Z,H]);let x=h4.useCallback(async(L0,d)=>{if(A)await A.onSubmit(L0);else W(L0,d);t()},[A,W,t]),e=h4.useCallback((L0)=>{if(h)return;x(L0.prompt,{directives:L0.context})},[x,h]);return U5.jsxs("div",{className:"flex min-h-0 flex-1 flex-col pt-2 pb-3",children:[U5.jsxs("header",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+40px)] items-center justify-between pr-2 pb-2 pl-2",children:[U5.jsx(WR,{isViewBuilder:!!A}),V&&B&&U5.jsxs(r1,{children:[U5.jsx(a1,{render:U5.jsx(C0,{variant:"ghost",size:"icon-sm",onClick:V,"aria-label":"Undock agent",children:U5.jsx(fv,{className:"size-5! text-muted-foreground",stroke:1.5})})}),U5.jsx(n1,{children:"Undock agent"})]}),!A&&V&&!B&&U5.jsx(C0,{variant:"ghost",size:"icon-sm",onClick:V,"aria-label":"Close chat",children:U5.jsx(S5,{stroke:2})})]}),U5.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[U5.jsx("div",{ref:_,className:"flex scrollbar-thin flex-1 scroll-fade flex-col overflow-y-auto overscroll-contain px-5 pt-4 pb-8 [--scroll-fade-reveal:8px]",children:U5.jsxs("div",{className:"mx-auto flex w-full max-w-(--chat-max-container) flex-1 flex-col gap-6",children:[v&&U5.jsx(GR,{agent:$,kind:u,hasWorkspaceApplets:Q,disabled:h,onSelectPrompt:e,onNavigate:L}),S.map((L0)=>L0.kind==="notice"?U5.jsx(j70,{notice:L0.notice},`notice:${L0.notice.id}`):U5.jsx(vv,{turn:L0.turn,processing:b&&L0.turn.id===k},L0.turn.id)),!v&&U5.jsx("div",{className:"mt-auto -ml-3 pt-2",children:U5.jsx(k3,{preset:$,color:"primary",size:64,animated:b,expression:b?"thinking":void 0})})]})}),!C&&T.length>0&&U5.jsx(C0,{type:"button",variant:"outline",size:"icon",onClick:()=>t("smooth"),"aria-label":"Jump to latest",className:"absolute bottom-3 left-1/2 -translate-x-1/2 animate-in rounded-full fade-in slide-in-from-bottom-1",children:U5.jsx(bF,{stroke:1.5})})]}),U5.jsx("div",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+24px)] flex-col px-3",children:U5.jsxs("div",{className:s("@container flex w-full flex-col transition-[padding]",U&&"gap-2 rounded-t-lg rounded-b-2xl p-2",U?.tone==="default"&&"bg-accent",U?.tone==="error"&&"bg-destructive/10"),children:[U?.content,U5.jsx(HR,{composerRef:q,onSend:x,onStop:N,processing:b,sessionId:M,modelSessionId:P,availability:Y,annotation:A?void 0:K,onRemoveDrawing:A?.onRemoveDrawing??K?.onRemove,allowFiles:!A,placeholder:A?"Drop in the details":void 0,draft:A?{id:A.builderId,initialValue:A.initialValue,onChange:A.onChange}:void 0})]})})]})}function j70({notice:$}){let Z=aN($);if(!Z)return null;return U5.jsx("div",{className:"flex justify-center",children:U5.jsx("span",{className:"max-w-full truncate text-xs text-muted-foreground",children:Z})})}var c9=O(c(),1);function mv({agent:$,loading:Z,open:H,onOpenChange:B,onOpenChangeComplete:J,children:Q}){let X=()=>B(!1);return c9.jsxs(AF,{open:H,onOpenChange:(G,F)=>{if(!G&&F.reason==="outside-press"){F.cancel();return}B(G)},onOpenChangeComplete:J,children:[c9.jsx(VF,{render:c9.jsx("div",{className:"fixed right-4 bottom-4 sm:right-4 sm:bottom-4",children:c9.jsx(B5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"},invisible:{opacity:0,scale:1,filter:"blur(4px)"}},initial:"from",animate:H?"invisible":"to",transition:{type:"spring",duration:0.3,delay:0.2,bounce:0},children:c9.jsx("button",{type:"button",className:"group block cursor-pointer rounded-xl p-0 outline-none focus-visible:ring-3 focus-visible:ring-ring/50","aria-label":"Agent",children:c9.jsx(k3,{preset:$,color:"primary",size:56,animated:Z,expression:Z?"thinking":void 0,className:s("drop-shadow-md drop-shadow-primary/30","group-hover:drop-shadow-lg group-hover:drop-shadow-primary/40","transition-[filter] duration-400 ease-in-out motion-reduce:transition-none")})})})})}),c9.jsx(DF,{positionMethod:"fixed",side:"top",sideOffset:-56,align:"end",className:"flex h-[calc(100vh-2rem)] w-[min(440px,calc(100vw-1rem))] flex-col gap-0 rounded-3xl p-0 sm:h-[calc(100vh-8rem)] sm:w-[min(440px,calc(100vw-2rem))] sm:p-1",keepMounted:!0,children:Q(X)})]})}var o3=O(c(),1);function mU({className:$,title:Z,children:H,onClose:B,ref:J}){return o3.jsxs(B5.div,{ref:J,className:s("absolute inset-x-4 bottom-4 no-scrollbar flex max-h-full flex-col gap-4 overflow-y-auto rounded-2xl bg-card text-card-foreground shadow-md","mx-auto max-w-[calc(var(--chat-max-container)+var(--page-pad)*2)] p-(--page-pad) pb-0",$),variants:{hidden:{opacity:0,y:40,filter:"blur(4px)"},visible:{opacity:1,y:0,filter:"blur(0px)"}},initial:"hidden",animate:"visible",exit:"hidden",transition:{type:"spring",duration:0.25,bounce:0},children:[o3.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[o3.jsx("p",{className:"text-sm font-medium",children:Z}),o3.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:B,"aria-label":"Close panel",children:o3.jsx(S5,{stroke:1.75})})]}),o3.jsx("div",{className:"flex-1 pb-(--page-pad)",children:H})]})}var $5=O(c(),1),T70=Object.entries(Z7),C70=Object.entries(CB),w70=Object.entries(HG),E70=Object.entries(BG),S70="relative w-full rounded-lg bg-card text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50";function pU({children:$,className:Z,gridClassName:H,label:B}){return $5.jsxs("div",{className:s("flex flex-col gap-2",Z),children:[$5.jsx("p",{className:"text-xs font-medium",children:B}),$5.jsx("div",{role:"group","aria-label":B,className:s("grid grid-cols-4 gap-2 @4xl/workspace:grid-cols-2",H),children:$})]})}function uU({active:$,children:Z,className:H,onSelect:B,style:J}){return $5.jsxs("button",{type:"button","aria-pressed":$,onClick:B,className:s(S70,"flex items-center gap-2 p-3",H,!$&&"cursor-pointer pr-9 opacity-70 hover:opacity-100"),style:J,children:[$5.jsx("div",{className:"flex flex-1 flex-col justify-center",children:Z}),$&&$5.jsx(sX,{size:20,stroke:1.5,"aria-hidden":"true"})]})}function pv({onClose:$,ref:Z}){QG();let{layout:H,setLayout:B}=K5(),J=h9(H.theme);function Q(X){B({theme:{...J,...X}})}return $5.jsx(mU,{ref:Z,title:"Customize",onClose:$,className:"@4xl/workspace:max-w-5xl",children:$5.jsxs("div",{className:"grid grid-cols-1 gap-4 @4xl/workspace:grid-cols-[repeat(2,minmax(0,1fr))_0.5rem_repeat(2,minmax(0,1fr))_0.5rem_minmax(0,1fr)_0.5rem_minmax(0,1fr)] @4xl/workspace:gap-x-2",children:[$5.jsx(pU,{label:"Font",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-1",children:T70.map(([X,z])=>$5.jsx(uU,{active:X===J.font,onSelect:()=>Q({font:X}),style:{fontFamily:z.sans},children:$5.jsx("span",{className:"text-sm font-medium",children:z.label})},X))}),$5.jsx(pU,{label:"Colors",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-4",children:C70.map(([X,z])=>$5.jsx(uU,{active:X===J.color,className:z.primary&&"bg-background text-foreground",onSelect:()=>Q({color:X}),style:z9({...J,color:X}),children:$5.jsxs("div",{className:"flex gap-2",children:[$5.jsx("span",{className:s("flex size-5 shrink-0 items-center justify-center rounded-sm text-[9px] leading-none font-bold",z.primary?"bg-primary text-primary-foreground":"bg-foreground text-background"),children:"Aa"}),$5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),$5.jsx(pU,{label:"Radius",className:"@4xl/workspace:col-start-7",gridClassName:"@4xl/workspace:grid-cols-1",children:w70.map(([X,z])=>$5.jsx(uU,{active:X===J.radius,onSelect:()=>Q({radius:X}),style:z9({...J,radius:X}),children:$5.jsxs("div",{className:"flex items-center gap-2",children:[$5.jsx("span",{className:"size-5 shrink-0 rounded-sm bg-card texture-checker-2.5 shadow-xs","aria-hidden":"true"}),$5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),$5.jsx(pU,{label:"Agent",className:"@4xl/workspace:col-start-9",gridClassName:"@4xl/workspace:grid-cols-1",children:E70.map(([X,z])=>$5.jsx(uU,{active:X===J.agent,onSelect:()=>Q({agent:X}),children:$5.jsxs("div",{className:"flex items-center gap-2",children:[$5.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:$5.jsx(k3,{preset:X,color:"primary",size:32})}),$5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))})]})})}var FY=O(g(),1);var hZ=O(g(),1);function uv($){return o1({queryKey:w0.appletThumbnails($),queryFn:async()=>(await V1(`/api/workspaces/${$}/applet-thumbnails`)).thumbnails,...b4})}function cv($){let Z=$1();return s1({mutationFn:(H)=>E4(`/api/workspaces/${$}/applet-thumbnails`,n5("PUT",H),"Failed to save applet thumbnails"),onSuccess:()=>{Z.invalidateQueries({queryKey:w0.appletThumbnails($)}),Z.invalidateQueries({queryKey:w0.preview($)})}})}var I70=1000,R70=3,k70=10800000,b70=1000,y70="1000px-3x-webp-q80-v1",h70=5000,x70=1000,v70=1e4;function g70($){return Math.min(R70,I70/Math.max($.offsetWidth,$.offsetHeight))}function f70($){return`${y70}:${$??""}`}function m70($,Z,H=Date.now()){if(!$||$.revision!==Z)return!0;let B=Date.parse($.capturedAt);return!Number.isFinite(B)||H-B>=k70}function p70($,Z){return $!==void 0&&$.revision===Z&&$.captureMs!==void 0&&$.captureMs>=b70}var u70=($)=>new Promise((Z)=>{setTimeout(()=>Z(null),$)});async function c70($,Z){let{createContext:H,destroyContext:B,domToDataUrl:J}=await import("/chunk-0pcdwjkp.js"),Q=async()=>{let X=await H($,{scale:g70($),type:"image/webp",quality:0.8,backgroundColor:"#ffffff",timeout:x70,...Z&&{onCreateForeignObjectSvg:(z)=>{let G=document.createElement("style");G.textContent="[data-widget-chrome] { border-radius: 0 !important; box-shadow: none !important; }[data-widget-chrome]::after { display: none !important; }",z.append(G)}}});try{return await J(X)}finally{B(X)}};return Promise.race([Q(),u70(v70)])}async function d70($,Z,H,B,J=c70,Q=Date.now()){let X=[];for(let z of H){if(B())return null;let G=f70(z.revision),F=Z.find((W)=>W.kind===$&&W.id===z.id);if(!m70(F,G,Q)){X.push({id:z.id,revision:G});continue}if(p70(F,G)){X.push({id:z.id,revision:G});continue}if(!z.element){X.push({id:z.id,revision:G,image:null});continue}let U=performance.now(),Y=await J(z.element,$==="widget").catch(()=>null),K=Math.round(performance.now()-U);if(B())return null;X.push({id:z.id,revision:G,image:Y,captureMs:K})}return X}function cU({kind:$,enabled:Z,targets:H}){let B=H5(),J=uv(B).data,Q=cv(B),X=hZ.useRef(H);X.current=H;let z=hZ.useRef(J??[]);z.current=J??[];let G=hZ.useRef(Q.mutate);G.current=Q.mutate;let F=H.map((Y)=>`${Y.id}@${Y.revision??""}`).join(`
|
|
79
|
+
`),U=J!==void 0;hZ.useEffect(()=>{if(!Z||!U||F==="")return;let Y=!1,K=0,W,N=()=>{K+=1;let L=K;if(W!==void 0)clearTimeout(W);if(document.visibilityState!=="visible")return;W=setTimeout(async()=>{W=void 0;let V=await d70($,z.current,X.current.map((A)=>({...A,element:document.querySelector(`[data-applet-thumbnail="${CSS.escape(`${$}:${A.id}`)}"]`)})),()=>Y||K!==L||document.visibilityState!=="visible");if(!V||Y||document.visibilityState!=="visible")return;G.current({kind:$,thumbnails:V})},h70)};return document.addEventListener("visibilitychange",N),N(),()=>{if(Y=!0,W!==void 0)clearTimeout(W);document.removeEventListener("visibilitychange",N)}},[Z,$,U,F])}function PJ($,Z,H,B){let J=$.reduce((Q,X)=>Math.max(Q,X.y+X.h),0);for(let Q=0;Q<=J+H;Q++)for(let X=0;X<=B-Z;X++)if(!$.some((G)=>!(X+Z<=G.x||G.x+G.w<=X||Q+H<=G.y||G.y+G.h<=Q)))return{x:X,y:Q};return{x:0,y:J}}function _J($,Z=[],H=4){let B=[];for(let J of $){let{x:Q,y:X}=J.x!==void 0&&J.y!==void 0?{x:J.x,y:J.y}:PJ([...Z,...B],J.w,J.h,H);B.push({i:J.id,x:Q,y:X,w:J.w,h:J.h})}return B}var pV=O(g(),1),dU=new Map;function l70($){let Z=window.__moiAppletCss?.get($)??"",H=dU.get($);if(!H){let Q=document.createElement("style");Q.dataset.appletStyle=$,document.head.appendChild(Q),H={el:Q,refs:0},dU.set($,H)}if(H.el.textContent!==Z)H.el.textContent=Z;H.refs++;let B=H,J=!1;return()=>{if(J)return;if(J=!0,B.refs--,B.refs<=0)B.el.remove(),dU.delete($)}}function i70($){let Z=dU.get($);if(!Z||Z.el===document.head.lastElementChild)return;document.head.appendChild(Z.el)}function lU($,Z,H=!1){pV.useInsertionEffect(()=>l70($),[$,Z]),pV.useInsertionEffect(()=>{if(H)i70($)},[$,H,Z])}var lv=O(c(),1);function dv({segment:$,name:Z,version:H,children:B}){let J=H5();return lU(WG($,J,Z),H),lv.jsx("div",{"data-applet":NG($,Z),className:"size-full",children:B})}var iv=O(g(),1);var xZ=O(c(),1);class OJ extends iv.Component{state={error:null};static getDerivedStateFromError($){return{error:$}}componentDidCatch($,Z){console.error(`[widget:${this.props.name}]`,$,Z.componentStack),D8(this.props.workspaceId,{source:"render",kind:this.props.kind,name:this.props.name,message:$.message||String($),stack:[$.stack,Z.componentStack].filter(Boolean).join(`
|
|
80
|
+
`)})}componentDidUpdate($){if($.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}render(){if(this.state.error)return xZ.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[xZ.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[xZ.jsx(YX,{size:16,stroke:1.75}),"Widget crashed"]}),xZ.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var s3=O(c(),1);function rv({name:$}){let Z=H5(),H=Mw($);return s3.jsxs(e2,{mode:"wait",initial:!1,children:[H.status==="ready"&&s3.jsx(B5.div,{className:"absolute inset-0",initial:{opacity:0,filter:"blur(4px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(4px)"},transition:{duration:0.45,ease:"easeInOut"},children:s3.jsx(OJ,{name:$,kind:"widget",workspaceId:Z,resetKey:H.version,children:s3.jsx(dv,{segment:"widgets",name:$,version:H.version,children:s3.jsx(H.Component,{})})})},H.version),H.status==="error"&&s3.jsx(B5.p,{className:"absolute inset-0 p-4 text-xs text-destructive",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:0.45,ease:"easeInOut"},children:H.error},`err-${H.version}`)]})}var av=O(c(),1);function vZ({className:$,...Z}){return av.jsx("div",{"data-slot":"skeleton",className:s("animate-pulse rounded-lg bg-muted",$),...Z})}var ov=O(g(),1);var t3=O(c(),1);function iU({editing:$,hidden:Z,onRemove:H,children:B}){let J=Rw();return t3.jsxs(B5.div,{variants:{idle:{rotate:0},wiggle:{rotate:[0.5,-0.5],transition:{rotate:{repeat:1/0,repeatType:"reverse",duration:0.15,ease:"easeInOut"}}}},animate:$?"wiggle":"idle",transition:{type:"spring",duration:0.35,bounce:0},className:"group/widget relative size-full",children:[t3.jsx("div",{"data-widget-chrome":!0,"data-vivid":!0,style:z9(J,"widget"),className:s("absolute inset-0 overflow-hidden rounded-2xl text-foreground [corner-shape:superellipse(1.2)]","shadow-[0_1px_2px_-1px_rgba(0,0,0,0.08),0_2px_4px_0_rgba(0,0,0,0.03)]","after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit]","after:content-[''] after:[corner-shape:inherit]","after:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.05)]",$&&"pointer-events-none"),children:B}),$&&H&&t3.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:t3.jsx(C0,{size:"icon-sm",variant:"outline",className:"rounded-full",onClick:H,children:Z?t3.jsx(K4,{stroke:1.75}):t3.jsx(nv,{stroke:1.75})})})]})}var gZ=O(c(),1),r70={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},a70={0:"row-start-1",1:"row-start-2",2:"row-start-3",3:"row-start-4",4:"row-start-5",5:"row-start-6",6:"row-start-7",7:"row-start-8"},n70={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},o70={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function sv({items:$,renderItem:Z,onClose:H,onRestore:B,ref:J}){let Q=ov.useMemo(()=>_J($),[$]);return gZ.jsx(mU,{ref:J,title:"Hidden widgets",onClose:H,className:"max-h-[60vh]",children:gZ.jsx("div",{className:"grid auto-rows-[160px] grid-cols-4 gap-2",children:gZ.jsx(e2,{children:Q.map((X)=>gZ.jsx(B5.div,{layoutId:X.i,className:s(r70[X.x],a70[X.y],n70[X.w],o70[X.h]),transition:{type:"spring",duration:0.35,bounce:0},children:gZ.jsx(iU,{editing:!0,onRemove:()=>B(X.i),hidden:!0,children:Z(X.i)})},X.i))})})})}var vJ=O(g(),1);function $6($){let{margin:Z,containerPadding:H,containerWidth:B,cols:J}=$;return(B-Z[0]*(J-1)-H[0]*2)/J}function C8($,Z,H){if(!Number.isFinite($))return $;return Math.round(Z*$+Math.max(0,$-1)*H)}function TJ($,Z,H,B,J,Q,X){let{margin:z,containerPadding:G,rowHeight:F}=$,U=$6($),Y,K,W,N;if(X)Y=Math.round(X.width),K=Math.round(X.height);else Y=C8(B,U,z[0]),K=C8(J,F,z[1]);if(Q)W=Math.round(Q.top),N=Math.round(Q.left);else if(X)W=Math.round(X.top),N=Math.round(X.left);else W=Math.round((F+z[1])*H+G[1]),N=Math.round((U+z[0])*Z+G[0]);if(!Q&&!X){if(Number.isFinite(B)){let V=Math.round((U+z[0])*(Z+B)+G[0])-N-Y;if(V!==z[0])Y+=V-z[0]}if(Number.isFinite(J)){let V=Math.round((F+z[1])*(H+J)+G[1])-W-K;if(V!==z[1])K+=V-z[1]}}return{top:W,left:N,width:Y,height:K}}function ev($,Z,H,B,J){let{margin:Q,containerPadding:X,cols:z,rowHeight:G,maxRows:F}=$,U=$6($),Y=Math.round((H-X[0])/(U+Q[0])),K=Math.round((Z-X[1])/(G+Q[1]));return Y=jJ(Y,0,z-B),K=jJ(K,0,F-J),{x:Y,y:K}}function CJ($,Z,H){let{margin:B,containerPadding:J,rowHeight:Q}=$,X=$6($),z=Math.round((H-J[0])/(X+B[0])),G=Math.round((Z-J[1])/(Q+B[1]));return{x:z,y:G}}function $g($,Z,H){let{margin:B,rowHeight:J}=$,Q=$6($),X=Math.max(1,Math.round((Z+B[0])/(Q+B[0]))),z=Math.max(1,Math.round((H+B[1])/(J+B[1])));return{w:X,h:z}}function jJ($,Z,H){return Math.max(Math.min($,H),Z)}function aU($,Z){if($.i===Z.i)return!1;if($.x+$.w<=Z.x)return!1;if($.x>=Z.x+Z.w)return!1;if($.y+$.h<=Z.y)return!1;if($.y>=Z.y+Z.h)return!1;return!0}function Z6($,Z){for(let H=0;H<$.length;H++){let B=$[H];if(B!==void 0&&aU(B,Z))return B}return}function uV($,Z){return $.filter((H)=>aU(H,Z))}function s70($,Z){if(Z==="horizontal")return cV($);if(Z==="vertical")return rU($);if(Z==="wrap")return rU($);return[...$]}function rU($){return[...$].sort((Z,H)=>{if(Z.y!==H.y)return Z.y-H.y;return Z.x-H.x})}function cV($){return[...$].sort((Z,H)=>{if(Z.x!==H.x)return Z.x-H.x;return Z.y-H.y})}function wJ($){let Z=0;for(let H=0;H<$.length;H++){let B=$[H];if(B!==void 0){let J=B.y+B.h;if(J>Z)Z=J}}return Z}function H6($,Z){for(let H=0;H<$.length;H++){let B=$[H];if(B!==void 0&&B.i===Z)return B}return}function EJ($){return $.filter((Z)=>Z.static===!0)}function d9($){return{i:$.i,x:$.x,y:$.y,w:$.w,h:$.h,minW:$.minW,maxW:$.maxW,minH:$.minH,maxH:$.maxH,moved:Boolean($.moved),static:Boolean($.static),isDraggable:$.isDraggable,isResizable:$.isResizable,resizeHandles:$.resizeHandles,constraints:$.constraints,isBounded:$.isBounded}}function fZ($){let Z=Array($.length);for(let H=0;H<$.length;H++){let B=$[H];if(B!==void 0)Z[H]=d9(B)}return Z}function t70($,Z){let H=Array($.length);for(let B=0;B<$.length;B++){let J=$[B];if(J!==void 0)if(Z.i===J.i)H[B]=Z;else H[B]=J}return H}function Zg($,Z,H){let B=H6($,Z);if(!B)return[[...$],null];return B=H(d9(B)),[t70($,B),B]}function dV($,Z){let H=EJ($);for(let B=0;B<$.length;B++){let J=$[B];if(J===void 0)continue;if(J.x+J.w>Z.cols)J.x=Z.cols-J.w;if(J.x<0)J.x=0,J.w=Z.cols;if(!J.static)H.push(J);else while(Z6(H,J))J.y++}return $}function e3($,Z,H,B,J,Q,X,z,G){if(Z.static&&Z.isDraggable!==!0)return[...$];if(Z.y===B&&Z.x===H)return[...$];let{x:F,y:U}=Z;if(typeof H==="number")Z.x=H;if(typeof B==="number")Z.y=B;Z.moved=!0;let Y=s70($,X);if(X==="vertical"&&typeof B==="number"?U>=B:X==="horizontal"&&typeof H==="number"?F>=H:!1)Y=Y.reverse();let W=uV(Y,Z),N=W.length>0;if(N&&G)return fZ($);if(N&&Q)return Z.x=F,Z.y=U,Z.moved=!1,$;let L=[...$];for(let V=0;V<W.length;V++){let A=W[V];if(A===void 0)continue;if(A.moved)continue;if(A.static)L=tv(L,A,Z,J,X);else L=tv(L,Z,A,J,X)}return L}function tv($,Z,H,B,J,Q){let X=J==="horizontal",z=J==="vertical",G=Z.static;if(B){B=!1;let Y={x:X?Math.max(Z.x-H.w,0):H.x,y:z?Math.max(Z.y-H.h,0):H.y,w:H.w,h:H.h,i:"-1"},K=Z6($,Y),W=K!==void 0&&K.y+K.h>Z.y,N=K!==void 0&&Z.x+Z.w>K.x;if(!K)return e3($,H,X?Y.x:void 0,z?Y.y:void 0,B,G,J);if(W&&z)return e3($,H,void 0,H.y+1,B,G,J);if(W&&J===null)return Z.y=H.y,H.y=H.y+H.h,[...$];if(N&&X)return e3($,Z,H.x,void 0,B,G,J)}let F=X?H.x+1:void 0,U=z?H.y+1:void 0;if(F===void 0&&U===void 0)return[...$];return e3($,H,F,U,B,G,J)}function mZ($,Z,H){return Math.max(Z,Math.min(H,$))}var e70={name:"gridBounds",constrainPosition($,Z,H,{cols:B,maxRows:J}){return{x:mZ(Z,0,Math.max(0,B-$.w)),y:mZ(H,0,Math.max(0,J-$.h))}},constrainSize($,Z,H,B,{cols:J,maxRows:Q}){let X=B==="w"||B==="nw"||B==="sw"?$.x+$.w:J-$.x,z=B==="n"||B==="nw"||B==="ne"?$.y+$.h:Q-$.y;return{w:mZ(Z,1,Math.max(1,X)),h:mZ(H,1,Math.max(1,z))}}},$$0={name:"minMaxSize",constrainSize($,Z,H){return{w:mZ(Z,$.minW??1,$.maxW??1/0),h:mZ(H,$.minH??1,$.maxH??1/0)}}};var lV=[e70,$$0];function SJ($,Z,H,B,J){let Q={x:H,y:B};for(let X of $)if(X.constrainPosition)Q=X.constrainPosition(Z,Q.x,Q.y,J);if(Z.constraints){for(let X of Z.constraints)if(X.constrainPosition)Q=X.constrainPosition(Z,Q.x,Q.y,J)}return Q}function Hg($,Z,H,B,J,Q){let X={w:H,h:B};for(let z of $)if(z.constrainSize)X=z.constrainSize(Z,X.w,X.h,J,Q);if(Z.constraints){for(let z of Z.constraints)if(z.constrainSize)X=z.constrainSize(Z,X.w,X.h,J,Q)}return X}function oU({top:$,left:Z,width:H,height:B}){let J=`translate(${Z}px,${$}px)`;return{transform:J,WebkitTransform:J,MozTransform:J,msTransform:J,OTransform:J,width:`${H}px`,height:`${B}px`,position:"absolute"}}function iV({top:$,left:Z,width:H,height:B}){return{top:`${$}px`,left:`${Z}px`,width:`${H}px`,height:`${B}px`,position:"absolute"}}function rV($){return $*100+"%"}function Z$0($,Z,H,B){return $+H>B?Z:H}function Bg($,Z,H){return $<0?Z:H}function H$0($){return Math.max(0,$)}function nU($){return Math.max(0,$)}var aV=($,Z,H)=>{let{left:B,height:J,width:Q}=Z,X=$.top-(J-$.height);return{left:B,width:Q,height:Bg(X,$.height,J),top:nU(X)}},nV=($,Z,H)=>{let{top:B,left:J,height:Q,width:X}=Z;return{top:B,height:Q,width:Z$0($.left,$.width,X,H),left:H$0(J)}},oV=($,Z,H)=>{let{top:B,height:J,width:Q}=Z,X=$.left+$.width-Q;if(X<0)return{height:J,width:$.left+$.width,top:nU(B),left:0};return{height:J,width:Q,top:nU(B),left:X}},sV=($,Z,H)=>{let{top:B,left:J,height:Q,width:X}=Z;return{width:X,left:J,height:Bg(B,$.height,Q),top:nU(B)}},B$0=($,Z,H)=>aV($,nV($,Z,H)),J$0=($,Z,H)=>aV($,oV($,Z)),Q$0=($,Z,H)=>sV($,nV($,Z,H)),X$0=($,Z,H)=>sV($,oV($,Z)),z$0={n:aV,ne:B$0,e:nV,se:Q$0,s:sV,sw:X$0,w:oV,nw:J$0};function Jg($,Z,H,B){let J=z$0[$];if(!J)return H;return J(Z,{...Z,...H},B)}var G$0={type:"transform",scale:1,calcStyle($){return oU($)}};var Qg=G$0,Xg={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},zg={enabled:!0,bounded:!1,threshold:3},Gg={enabled:!0,handles:["se"]},Fg={enabled:!1,defaultItem:{w:1,h:1}};function tV($,Z,H,B,J){let Q=B==="x"?"w":"h";Z[B]+=1;let X=$.findIndex((G)=>G.i===Z.i),z=J??EJ($).length>0;for(let G=X+1;G<$.length;G++){let F=$[G];if(F===void 0)continue;if(F.static)continue;if(!z&&F.y>Z.y+Z.h)break;if(aU(Z,F))tV($,F,H+Z[Q],B,z)}Z[B]=H}function F$0($,Z,H,B){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0),Z.y=Math.min(B,Z.y);while(Z.y>0&&!Z6($,Z))Z.y--;let J;while((J=Z6($,Z))!==void 0)tV(H,Z,J.y+J.h,"y");return Z.y=Math.max(Z.y,0),Z}function U$0($,Z,H,B){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0);while(Z.x>0&&!Z6($,Z))Z.x--;let J;while((J=Z6($,Z))!==void 0)if(tV(B,Z,J.x+J.w,"x"),Z.x+Z.w>H){Z.x=H-Z.w,Z.y++;while(Z.x>0&&!Z6($,Z))Z.x--}return Z.x=Math.max(Z.x,0),Z}var IJ={type:"vertical",allowOverlap:!1,compact($,Z){let H=EJ($),B=wJ(H),J=rU($),Q=Array($.length);for(let X=0;X<J.length;X++){let z=J[X];if(z===void 0)continue;let G=d9(z);if(!G.static)G=F$0(H,G,J,B),B=Math.max(B,G.y+G.h),H.push(G);let F=$.indexOf(z);Q[F]=G,G.moved=!1}return Q}},eV={type:"horizontal",allowOverlap:!1,compact($,Z){let H=EJ($),B=cV($),J=Array($.length);for(let Q=0;Q<B.length;Q++){let X=B[Q];if(X===void 0)continue;let z=d9(X);if(!z.static)z=U$0(H,z,Z,B),H.push(z);let G=$.indexOf(X);J[G]=z,z.moved=!1}return J}},$D={type:null,allowOverlap:!1,compact($,Z){return fZ($)}},Y$0={...IJ,allowOverlap:!0,compact($,Z){return fZ($)}},K$0={...eV,allowOverlap:!0,compact($,Z){return fZ($)}},W$0={...$D,allowOverlap:!0};function ZD($,Z=!1,H=!1){let B;if(Z)if($==="vertical")B=Y$0;else if($==="horizontal")B=K$0;else B=W$0;else if($==="vertical")B=IJ;else if($==="horizontal")B=eV;else B=$D;if(H)return{...B,preventCollision:H};return B}var w8=O(g(),1);function HD($={}){let{measureBeforeMount:Z=!1,initialWidth:H=1280}=$,[B,J]=w8.useState(H),[Q,X]=w8.useState(!Z),z=w8.useRef(null),G=w8.useRef(null),F=w8.useCallback(()=>{let U=z.current;if(U){let Y=U.offsetWidth;if(J(Y),!Q)X(!0)}},[Q]);return w8.useEffect(()=>{let U=z.current;if(!U)return;if(F(),typeof ResizeObserver<"u"){let Y=null;return G.current=new ResizeObserver((K)=>{let W=K[0];if(W){let N=W.contentRect.width;if(Y!==null)cancelAnimationFrame(Y);Y=requestAnimationFrame(()=>{J(N),Y=null})}}),G.current.observe(U),()=>{if(Y!==null)cancelAnimationFrame(Y);if(G.current)G.current.disconnect(),G.current=null}}return()=>{if(G.current)G.current.disconnect(),G.current=null}},[F]),{width:B,mounted:Q,containerRef:z,measureWidth:F}}var y0=O(g(),1),zf=O(QY(),1),Gf=O(Jf(),1);var i9=O(c(),1),E7=O(Yg(),1);function _D($){let{children:Z,cols:H,containerWidth:B,margin:J,containerPadding:Q,rowHeight:X,maxRows:z,isDraggable:G,isResizable:F,isBounded:U,static:Y,useCSSTransforms:K=!0,usePercentages:W=!1,transformScale:N=1,positionStrategy:L,dragThreshold:V=0,droppingPosition:A,className:D="",style:q,handle:_="",cancel:M="",x:P,y:T,w:R,h:y,minW:w=1,maxW:h=1/0,minH:E=1,maxH:I=1/0,i:j,resizeHandles:S,resizeHandle:k,constraints:b=lV,layoutItem:v,layout:u=[],onDragStart:C,onDrag:t,onDragStop:H0,onResizeStart:x,onResize:e,onResizeStop:L0}=$,[d,X0]=y0.useState(!1),[K0,Q0]=y0.useState(!1),z0=y0.useRef(null),A0=y0.useRef({left:0,top:0}),i=y0.useRef({top:0,left:0,width:0,height:0}),B0=y0.useRef(void 0),$0=y0.useRef(u);$0.current=u;let J0=y0.useRef(null),n=y0.useRef(null),f=y0.useRef(!1),l=y0.useRef({x:0,y:0}),m=y0.useRef(!1),a=y0.useMemo(()=>({cols:H,containerPadding:Q,containerWidth:B,margin:J,maxRows:z,rowHeight:X}),[H,Q,B,J,z,X]),o=y0.useMemo(()=>({cols:H,maxRows:z,containerWidth:B,containerHeight:0,rowHeight:X,margin:J,layout:[]}),[H,z,B,X,J]),D0=y0.useCallback(()=>({...o,layout:$0.current}),[o]),O0=y0.useMemo(()=>v??{i:j,x:P,y:T,w:R,h:y,minW:w,maxW:h,minH:E,maxH:I},[v,j,P,T,R,y,w,h,E,I]),k0=y0.useCallback((T0)=>{if(L?.calcStyle)return L.calcStyle(T0);if(K)return oU(T0);let I0=iV(T0);if(W)return{...I0,left:rV(T0.left/B),width:rV(T0.width/B)};return I0},[L,K,W,B]),r0=y0.useCallback((T0,{node:I0})=>{if(!C)return;let{offsetParent:g0}=I0;if(!g0)return;let e0=g0.getBoundingClientRect(),l0=I0.getBoundingClientRect(),L1=l0.left/N,f1=e0.left/N,m1=l0.top/N,M1=e0.top/N,q5;if(L?.calcDragPosition){let Q1=T0;q5=L.calcDragPosition(Q1.clientX,Q1.clientY,Q1.clientX-l0.left,Q1.clientY-l0.top)}else q5={left:L1-f1+g0.scrollLeft,top:m1-M1+g0.scrollTop};if(A0.current=q5,V>0){let Q1=T0;l.current={x:Q1.clientX,y:Q1.clientY},f.current=!0,m.current=!1,X0(!0);return}X0(!0);let p5=CJ(a,q5.top,q5.left),{x:i5,y:x0}=SJ(b,O0,p5.x,p5.y,D0());C(j,i5,x0,{e:T0,node:I0,newPosition:q5})},[C,N,a,L,V,b,O0,D0,j]),p=y0.useCallback((T0,{node:I0,deltaX:g0,deltaY:e0})=>{if(!t||!d)return;let l0=T0;if(f.current&&!m.current){let i5=l0.clientX-l.current.x,x0=l0.clientY-l.current.y;if(Math.hypot(i5,x0)<V)return;if(m.current=!0,f.current=!1,C){let u0=CJ(a,A0.current.top,A0.current.left),{x:A1,y:y1}=SJ(b,O0,u0.x,u0.y,D0());C(j,A1,y1,{e:T0,node:I0,newPosition:A0.current})}}let L1=A0.current.top+e0,f1=A0.current.left+g0;if(U){let{offsetParent:i5}=I0;if(i5){let x0=i5.clientHeight-C8(y,X,J[1]);L1=jJ(L1,0,x0);let Q1=$6(a),u0=B-C8(R,Q1,J[0]);f1=jJ(f1,0,u0)}}let m1={top:L1,left:f1};A0.current=m1;let M1=CJ(a,L1,f1),{x:q5,y:p5}=SJ(b,O0,M1.x,M1.y,D0());t(j,q5,p5,{e:T0,node:I0,newPosition:m1})},[t,C,d,V,U,y,X,J,a,B,R,j,b,O0,D0]),r=y0.useCallback((T0,{node:I0})=>{if(!H0||!d)return;let g0=f.current;if(f.current=!1,m.current=!1,l.current={x:0,y:0},g0){X0(!1),A0.current={left:0,top:0};return}let{left:e0,top:l0}=A0.current,L1={top:l0,left:e0};X0(!1),A0.current={left:0,top:0};let f1=CJ(a,l0,e0),{x:m1,y:M1}=SJ(b,O0,f1.x,f1.y,D0());H0(j,m1,M1,{e:T0,node:I0,newPosition:L1})},[H0,d,a,b,O0,D0,j]);J0.current=r0,n.current=p;let Z0=y0.useCallback((T0,{node:I0,size:g0,handle:e0},l0,L1)=>{let f1=L1==="onResizeStart"?x:L1==="onResize"?e:L0;if(!f1)return;let m1;if(I0)m1=Jg(e0,l0,g0,B);else m1={...g0,top:l0.top,left:l0.left};i.current=m1;let M1=$g(a,m1.width,m1.height),{w:q5,h:p5}=Hg(b,O0,M1.w,M1.h,e0,D0());f1(j,q5,p5,{e:T0.nativeEvent,node:I0,size:m1,handle:e0})},[x,e,L0,B,a,j,b,O0,D0]),V0=y0.useCallback((T0,I0)=>{Q0(!0);let g0=TJ(a,P,T,R,y),e0={...I0,handle:I0.handle};Z0(T0,e0,g0,"onResizeStart")},[Z0,a,P,T,R,y]),j0=y0.useCallback((T0,I0)=>{let g0=TJ(a,P,T,R,y),e0={...I0,handle:I0.handle};Z0(T0,e0,g0,"onResize")},[Z0,a,P,T,R,y]),v0=y0.useCallback((T0,I0)=>{Q0(!1),i.current={top:0,left:0,width:0,height:0};let g0=TJ(a,P,T,R,y),e0={...I0,handle:I0.handle};Z0(T0,e0,g0,"onResizeStop")},[Z0,a,P,T,R,y]);y0.useEffect(()=>{if(!A)return;let T0=z0.current;if(!T0)return;let I0=B0.current||{left:0,top:0},g0=d&&(A.left!==I0.left||A.top!==I0.top);if(!d){let e0={node:T0,deltaX:A.left,deltaY:A.top,lastX:0,lastY:0,x:A.left,y:A.top};J0.current?.(A.e,e0)}else if(g0){let e0=A.left-A0.current.left,l0=A.top-A0.current.top,L1={node:T0,deltaX:e0,deltaY:l0,lastX:A0.current.left,lastY:A0.current.top,x:A.left,y:A.top};n.current?.(A.e,L1)}B0.current=A},[A,d,j]);let z1=TJ(a,P,T,R,y,d?A0.current:null,K0?i.current:null),Y1=y0.default.Children.only(Z),c0=$6(a),R0=[C8(w,c0,J[0]),C8(E,X,J[1])],d0=[C8(h,c0,J[0]),C8(I,X,J[1])],p0=Y1.props,s0=p0.className,N0=p0.style,b0=y0.default.cloneElement(Y1,{ref:z0,className:OD("react-grid-item",s0,D,{static:Y,resizing:K0,"react-draggable":G,"react-draggable-dragging":d,dropping:Boolean(A),cssTransforms:K}),style:{...q,...N0,...k0(z1)}}),K1=k;return b0=i9.jsx(Gf.Resizable,{draggableOpts:{disabled:!F},className:F?void 0:"react-resizable-hide",width:z1.width,height:z1.height,minConstraints:R0,maxConstraints:d0,onResizeStart:V0,onResize:j0,onResizeStop:v0,transformScale:N,resizeHandles:S,handle:K1,children:b0}),b0=i9.jsx(zf.DraggableCore,{disabled:!G,onStart:r0,onDrag:p,onStop:r,handle:_,cancel:".react-resizable-handle"+(M?","+M:""),scale:N,nodeRef:z0,children:b0}),b0}var l9=()=>{},Qf="react-grid-layout",Ff=!1;try{Ff=/firefox/i.test(navigator.userAgent)}catch{}function CH0($,Z){let H=y0.default.Children.toArray($),B=y0.default.Children.toArray(Z);if(H.length!==B.length)return!1;for(let J=0;J<H.length;J++){let Q=H[J],X=B[J];if(Q?.key!==X?.key)return!1}return!0}function Xf($,Z,H,B){let J=[],Q=new Set;y0.default.Children.forEach(Z,(z)=>{if(!y0.default.isValidElement(z)||z.key===null)return;let G=String(z.key);Q.add(G);let F=$.find((U)=>U.i===G);if(F)J.push(d9(F));else{let Y=z.props["data-grid"];if(Y)J.push({i:G,x:Y.x??0,y:Y.y??0,w:Y.w??1,h:Y.h??1,minW:Y.minW,maxW:Y.maxW,minH:Y.minH,maxH:Y.maxH,static:Y.static,isDraggable:Y.isDraggable,isResizable:Y.isResizable,resizeHandles:Y.resizeHandles,isBounded:Y.isBounded});else J.push({i:G,x:0,y:wJ(J),w:1,h:1})}});let X=dV(J,{cols:H});return B.compact(X,H)}function xJ($){let{children:Z,width:H,gridConfig:B,dragConfig:J,resizeConfig:Q,dropConfig:X,positionStrategy:z=Qg,compactor:G,constraints:F=lV,layout:U=[],droppingItem:Y,autoSize:K=!0,className:W="",style:N={},innerRef:L,onLayoutChange:V=l9,onDragStart:A=l9,onDrag:D=l9,onDragStop:q=l9,onResizeStart:_=l9,onResize:M=l9,onResizeStop:P=l9,onDrop:T=l9,onDropDragOver:R=l9}=$,y=y0.useMemo(()=>({...Xg,...B}),[B]),w=y0.useMemo(()=>({...zg,...J}),[J]),h=y0.useMemo(()=>({...Gg,...Q}),[Q]),E=y0.useMemo(()=>({...Fg,...X}),[X]),{cols:I,rowHeight:j,maxRows:S,margin:k,containerPadding:b}=y,{enabled:v,bounded:u,handle:C,cancel:t,threshold:H0}=w,{enabled:x,handles:e,handleComponent:L0}=h,{enabled:d,defaultItem:X0,onDragOver:K0}=E,Q0=G??ZD("vertical"),z0=Q0.type,A0=Q0.allowOverlap,i=Q0.preventCollision??!1,B0=y0.useMemo(()=>Y??{i:"__dropping-elem__",...X0},[Y,X0]),$0=z.type==="transform",J0=z.scale,n=b??k,[f,l]=y0.useState(!1),[m,a]=y0.useState(()=>Xf(U,Z,I,Q0)),[o,D0]=y0.useState(null),[O0,k0]=y0.useState(!1),[r0,p]=y0.useState(null),[r,Z0]=y0.useState(),V0=y0.useRef(null),j0=y0.useRef(null),v0=y0.useRef(null),z1=y0.useRef(0),Y1=y0.useRef(m),c0=y0.useRef(U),R0=y0.useRef(Z),d0=y0.useRef(z0),p0=y0.useRef(m);p0.current=m,y0.useEffect(()=>{if(l(!0),!E7.deepEqual(m,U))V(m)},[]),y0.useEffect(()=>{if(o)return;if(r0)return;let x0=!E7.deepEqual(U,c0.current),Q1=!CH0(Z,R0.current),u0=z0!==d0.current;if(x0||Q1||u0){let y1=Xf(x0?U:m,Z,I,Q0);if(!E7.deepEqual(y1,m))a(y1)}c0.current=U,R0.current=Z,d0.current=z0},[U,Z,I,z0,Q0,o,r0,m]),y0.useEffect(()=>{if(!o&&!E7.deepEqual(m,Y1.current)){Y1.current=m;let x0=m.filter((Q1)=>Q1.i!==B0.i);V(x0)}},[m,o,V,B0.i]);let s0=y0.useMemo(()=>{if(!K)return;let x0=wJ(m),Q1=n[1];return x0*j+(x0-1)*k[1]+Q1*2+"px"},[K,m,j,k,n]),N0=y0.useCallback((x0,Q1,u0,A1)=>{let y1=p0.current,p1=H6(y1,x0);if(!p1)return;let M5={w:p1.w,h:p1.h,x:p1.x,y:p1.y,i:x0};V0.current=d9(p1),v0.current=y1,D0(M5),A(y1,p1,p1,null,A1.e,A1.node)},[A]),b0=y0.useCallback((x0,Q1,u0,A1)=>{let y1=p0.current,p1=V0.current,M5=H6(y1,x0);if(!M5)return;let U2={w:M5.w,h:M5.h,x:M5.x,y:M5.y,i:x0},P5=e3(y1,M5,Q1,u0,!0,i,z0,I,A0);D(P5,p1,M5,U2,A1.e,A1.node),a(Q0.compact(P5,I)),D0(U2)},[i,z0,I,A0,Q0,D]),K1=y0.useCallback((x0,Q1,u0,A1)=>{if(!o)return;let y1=p0.current,p1=V0.current,M5=H6(y1,x0);if(!M5)return;let U2=e3(y1,M5,Q1,u0,!0,i,z0,I,A0),P5=Q0.compact(U2,I);q(P5,p1,M5,null,A1.e,A1.node);let w2=v0.current;if(V0.current=null,v0.current=null,D0(null),a(P5),w2&&!E7.deepEqual(w2,P5))V(P5)},[o,i,z0,I,A0,Q0,q,V]),T0=y0.useCallback((x0,Q1,u0,A1)=>{let y1=p0.current,p1=H6(y1,x0);if(!p1)return;j0.current=d9(p1),v0.current=y1,k0(!0),_(y1,p1,p1,null,A1.e,A1.node)},[_]),I0=y0.useCallback((x0,Q1,u0,A1)=>{let y1=p0.current,p1=j0.current,{handle:M5}=A1,U2=!1,P5,w2,[nJ,C9]=Zg(y1,x0,(C5)=>{if(P5=C5.x,w2=C5.y,["sw","w","nw","n","ne"].includes(M5)){if(["sw","nw","w"].includes(M5))P5=C5.x+(C5.w-Q1),Q1=C5.x!==P5&&P5<0?C5.w:Q1,P5=P5<0?0:P5;if(["ne","n","nw"].includes(M5))w2=C5.y+(C5.h-u0),u0=C5.y!==w2&&w2<0?C5.h:u0,w2=w2<0?0:w2;U2=!0}if(i&&!A0){if(uV(y1,{...C5,w:Q1,h:u0,x:P5??C5.x,y:w2??C5.y}).filter((sJ)=>sJ.i!==C5.i).length>0)w2=C5.y,u0=C5.h,P5=C5.x,Q1=C5.w,U2=!1}return C5.w=Q1,C5.h=u0,C5});if(!C9)return;let BH=nJ;if(U2&&P5!==void 0&&w2!==void 0)BH=e3(nJ,C9,P5,w2,!0,i,z0,I,A0);let oJ={w:C9.w,h:C9.h,x:C9.x,y:C9.y,i:x0,static:!0};M(BH,p1,C9,oJ,A1.e,A1.node),a(Q0.compact(BH,I)),D0(oJ)},[i,z0,I,A0,Q0,M]),g0=y0.useCallback((x0,Q1,u0,A1)=>{let y1=p0.current,p1=j0.current,M5=H6(y1,x0),U2=Q0.compact(y1,I);P(U2,p1,M5??null,null,A1.e,A1.node);let P5=v0.current;if(j0.current=null,v0.current=null,D0(null),k0(!1),a(U2),P5&&!E7.deepEqual(P5,U2))V(U2)},[I,Q0,P,V]),e0=y0.useCallback(()=>{let x0=p0.current;if(!x0.some((A1)=>A1.i===B0.i)){p(null),D0(null),Z0(void 0);return}let u0=Q0.compact(x0.filter((A1)=>A1.i!==B0.i),I);a(u0),p(null),D0(null),Z0(void 0)},[B0.i,I,Q0]),l0=y0.useCallback((x0)=>{if(x0.preventDefault(),x0.stopPropagation(),Ff&&!x0.nativeEvent.target?.classList.contains(Qf))return!1;let Q1=K0?K0(x0.nativeEvent):R(x0);if(Q1===!1){if(r0)e0();return!1}let{dragOffsetX:u0=0,dragOffsetY:A1=0,...y1}=Q1??{},p1={...B0,...y1},M5=x0.currentTarget.getBoundingClientRect(),U2={cols:I,margin:k,maxRows:S,rowHeight:j,containerWidth:H,containerPadding:n},P5=$6(U2),w2=C8(p1.w,P5,k[0]),nJ=C8(p1.h,j,k[1]),C9=w2/2,BH=nJ/2,oJ=x0.clientX-M5.left+u0-C9,C5=x0.clientY-M5.top+A1-BH,xY=Math.max(0,oJ),sJ=Math.max(0,C5),tJ={left:xY/J0,top:sJ/J0,e:x0.nativeEvent};if(!r0){let vY=ev(U2,sJ,xY,p1.w,p1.h);p(i9.jsx("div",{},p1.i)),Z0(tJ);let jc=p0.current.filter((Tc)=>Tc.i!==p1.i);a([...jc,{...p1,x:vY.x,y:vY.y,static:!1,isDraggable:!0}])}else if(r){if(r.left!==tJ.left||r.top!==tJ.top)Z0(tJ)}},[r0,r,B0,K0,R,e0,J0,I,k,S,j,H,n]),L1=y0.useCallback((x0)=>{if(x0.preventDefault(),x0.stopPropagation(),z1.current--,z1.current<0)z1.current=0;if(z1.current===0)e0()},[e0]),f1=y0.useCallback((x0)=>{x0.preventDefault(),x0.stopPropagation(),z1.current++},[]),m1=y0.useCallback((x0)=>{x0.preventDefault(),x0.stopPropagation();let Q1=p0.current,u0=Q1.find((A1)=>A1.i===B0.i);z1.current=0,e0(),T(Q1,u0,x0.nativeEvent)},[B0.i,e0,T]),M1=y0.useCallback((x0,Q1)=>{if(!x0||!x0.key)return null;let u0=H6(m,String(x0.key));if(!u0)return null;let A1=typeof u0.isDraggable==="boolean"?u0.isDraggable:!u0.static&&v,y1=typeof u0.isResizable==="boolean"?u0.isResizable:!u0.static&&x,p1=u0.resizeHandles||[...e],M5=A1&&u&&u0.isBounded!==!1,U2=L0;return i9.jsx(_D,{containerWidth:H,cols:I,margin:k,containerPadding:n,maxRows:S,rowHeight:j,cancel:t,handle:C,onDragStart:N0,onDrag:b0,onDragStop:K1,onResizeStart:T0,onResize:I0,onResizeStop:g0,isDraggable:A1,isResizable:y1,isBounded:M5,useCSSTransforms:$0&&f,usePercentages:!f,transformScale:J0,positionStrategy:z,dragThreshold:H0,w:u0.w,h:u0.h,x:u0.x,y:u0.y,i:u0.i,minH:u0.minH,minW:u0.minW,maxH:u0.maxH,maxW:u0.maxW,static:u0.static,droppingPosition:Q1?r:void 0,resizeHandles:p1,resizeHandle:U2,constraints:F,layoutItem:u0,layout:m,children:x0},u0.i)},[m,H,I,k,n,S,j,t,C,N0,b0,K1,T0,I0,g0,v,x,u,$0,f,J0,z,H0,r,e,L0,F]),q5=()=>{if(!o)return null;return i9.jsx(_D,{w:o.w,h:o.h,x:o.x,y:o.y,i:o.i,className:`react-grid-placeholder ${O0?"placeholder-resizing":""}`,containerWidth:H,cols:I,margin:k,containerPadding:n,maxRows:S,rowHeight:j,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:$0,transformScale:J0,constraints:F,layout:m,children:i9.jsx("div",{})})},p5=OD(Qf,W),i5={height:s0,...N};return i9.jsxs("div",{ref:L,className:p5,style:i5,onDrop:d?m1:void 0,onDragLeave:d?L1:void 0,onDragEnter:d?f1:void 0,onDragOver:d?l0:void 0,children:[y0.default.Children.map(Z,(x0)=>{if(!y0.default.isValidElement(x0))return null;return M1(x0)}),d&&r0&&M1(r0,!0),q5()]})}var S7=O(c(),1);function jD({items:$,editing:Z,renderItem:H,onLayoutChange:B}){let[J,Q]=vJ.useState(()=>_J($,[])),[X,z]=vJ.useState($),{width:G,containerRef:F,mounted:U}=HD({measureBeforeMount:!0});if(X!==$)z($),Q((K)=>{let W=new Map(K.map((A)=>[A.i,A])),N=$.filter((A)=>W.has(A.id)).map((A)=>({...W.get(A.id),w:A.w,h:A.h})),L=new Set(N.map((A)=>A.i)),V=_J($.filter((A)=>!L.has(A.id)),N);return[...N,...V]});let Y=vJ.useCallback((K)=>{Q(K),B?.(K.map((W)=>({id:W.i,w:W.w,h:W.h,x:W.x,y:W.y})))},[B]);return S7.jsx("div",{ref:F,className:"mx-auto w-full max-w-[var(--column-w)]",children:U&&S7.jsx(xJ,{width:G,layout:J,gridConfig:{cols:4,rowHeight:160,margin:[8,8],containerPadding:[0,0]},dragConfig:{enabled:!!Z},resizeConfig:{enabled:!1},compactor:IJ,onLayoutChange:Y,children:J.map((K)=>S7.jsx("div",{children:S7.jsx(B5.div,{layoutId:K.i,"data-applet-thumbnail":`widget:${K.i}`,className:"size-full",transition:{type:"spring",duration:0.35,bounce:0},children:H(K.i)})},K.i))})})}function Uf({items:$,editing:Z,renderItem:H,onLayoutChange:B,onRemove:J}){return S7.jsx(jD,{items:$,editing:Z,onLayoutChange:B,renderItem:(Q)=>S7.jsx(iU,{editing:Z,onRemove:J?()=>J(Q):void 0,children:H(Q)})})}var R1=O(c(),1);function Yf($){return R1.jsx(rv,{name:$})}var EH0=Array.from({length:10},($,Z)=>({id:`empty-widget-${Z}`,w:2,h:1}));function SH0(){return R1.jsx(vZ,{className:"size-full animate-none rounded-2xl texture-checker [corner-shape:superellipse(1.2)]"})}function IH0({onCreateWidget:$}){return R1.jsxs("div",{className:"relative min-h-0 flex-1 pt-7",children:[R1.jsx("div",{"aria-hidden":"true",children:R1.jsx(jD,{items:EH0,renderItem:SH0})}),R1.jsx("div",{className:"absolute inset-0 flex items-center justify-center p-6",children:R1.jsxs("div",{className:"flex h-full w-full max-w-(--column-w) flex-col items-center justify-center gap-4 bg-radial from-background from-30% to-transparent to-80% text-center",children:[R1.jsxs("div",{className:"flex flex-col gap-1.5",children:[R1.jsx("h2",{className:"font-medium",children:"A little empty here"}),R1.jsx("p",{className:"mx-auto max-w-xs text-sm text-muted-foreground",children:"Widgets are small apps that can read data, perform tasks, and surface important information"})]}),R1.jsxs(C0,{type:"button",variant:"secondary",onClick:$,children:[R1.jsx(K4,{"data-icon":"inline-start",stroke:1.5}),"Create widget"]})]})})]})}function RH0({editing:$,onCreateWidget:Z,onEditingChange:H}){return R1.jsxs("div",{className:"mx-auto mb-4 flex w-full max-w-(--column-w) shrink-0 items-center justify-end gap-2",children:[$&&R1.jsxs(C0,{type:"button",variant:"ghost",size:"sm",className:"mr-auto",onClick:Z,children:[R1.jsx(K4,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),R1.jsx(e2,{mode:"popLayout",initial:!1,children:R1.jsx(B5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.3,bounce:0},children:R1.jsx(C0,{type:"button",variant:$?"default":"ghost",size:"sm",className:s(!$&&"text-muted-foreground group-hover/widgets:opacity-100 [@media(hover:hover)]:opacity-0"),onClick:()=>H(!$),children:$?"Done":"Edit widgets"})},$?"done":"edit")})]})}function kH0(){return R1.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3",children:R1.jsx("p",{className:"text-sm text-muted-foreground",children:"No widgets added yet"})})}function bH0(){let[$,Z]=FY.useState(0);return[FY.useCallback((B)=>{if(!B)return;let J=new ResizeObserver(([Q])=>{let X=Q.borderBoxSize?.[0];Z(X?X.blockSize:Q.contentRect.height)});return J.observe(B),()=>J.disconnect()},[]),$]}function Wf({onCreateWidget:$,editing:Z,onEditingChange:H,widgets:B}){let{layout:J,setLayout:Q}=K5(),X=B.length>0,z=new Set(J.widgetGrid.map((L)=>L.i)),G=J.widgetGrid.filter((L)=>B.some((V)=>V.id===L.i)).map((L)=>{let V=B.find((A)=>A.id===L.i);return{id:L.i,w:V.config.colSpan,h:V.config.rowSpan,x:L.x,y:L.y}}),F=B.filter((L)=>!z.has(L.id)).map((L)=>({id:L.id,w:L.config.colSpan,h:L.config.rowSpan})),[U,Y]=bH0(),K=Z&&F.length>0;cU({kind:"widget",enabled:!Z,targets:G.map((L)=>({id:L.id,revision:B.find((V)=>V.id===L.id)?.revision}))});function W(L){Q({widgetGrid:J.widgetGrid.filter((V)=>V.i!==L)})}function N(L){let V=B.find((q)=>q.id===L);if(!V)return;let A=J.widgetGrid.map((q)=>{let _=B.find((M)=>M.id===q.i);return{...q,w:_?.config.colSpan??1,h:_?.config.rowSpan??1}}),D=PJ(A,V.config.colSpan,V.config.rowSpan,4);Q({widgetGrid:[...J.widgetGrid,{i:L,x:D.x,y:D.y}]})}return R1.jsx("div",{className:"group/widgets relative min-h-0 flex-1",children:R1.jsxs(Kf,{children:[R1.jsx("div",{className:s("relative flex h-full flex-col p-4",X?"overflow-y-auto":"overflow-hidden"),children:X?R1.jsxs(R1.Fragment,{children:[R1.jsx(RH0,{editing:Z,onCreateWidget:$,onEditingChange:H}),G.length===0?R1.jsx(B5.div,{className:"mx-auto flex min-h-0 w-full max-w-[var(--column-w)] flex-1 flex-col",animate:{paddingBottom:K?Y:0},transition:{type:"spring",duration:0.3,bounce:0},children:R1.jsx(kH0,{})}):R1.jsx(B5.div,{animate:{marginBottom:K?Y:0},transition:{type:"spring",duration:0.3,bounce:0},children:R1.jsx(Uf,{items:G,editing:Z,renderItem:Yf,onRemove:W,onLayoutChange:(L)=>Q({widgetGrid:L.map((V)=>({i:V.id,x:V.x??0,y:V.y??0}))})})})]}):R1.jsx(IH0,{onCreateWidget:$})}),R1.jsx(e2,{children:X&&Z&&F.length>0&&R1.jsx(sv,{ref:U,items:F,renderItem:Yf,onClose:()=>H(!1),onRestore:N})})]})})}var Lf=O(c(),1);function Nf({children:$}){return Lf.jsx("header",{className:s("@container relative flex shrink-0 items-center gap-2.5 py-2 pr-3 pl-4","after:absolute after:top-full after:left-0 after:h-px after:w-full after:bg-border"),children:$})}var fD=O(g(),1);var q2=O(c(),1);function yH0($){if($==="needs-auth")return"Needs auth";return $[0].toUpperCase()+$.slice(1)}function hH0({name:$,status:Z}){let H=SU($),B="size-full rounded-lg ring-2 ring-background";return q2.jsxs("span",{className:"relative size-10 shrink-0",children:[H?q2.jsx("img",{src:H,alt:"",className:"size-full rounded-lg ring-2 ring-background"}):q2.jsx("span",{className:"flex size-full items-center justify-center rounded-lg bg-muted text-muted-foreground ring-2 ring-background",children:q2.jsx(RU,{className:"size-5"})}),Z!=="connected"&&q2.jsx(Af,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function Vf($){return[...$].sort((Z,H)=>Number(H.status==="connected")-Number(Z.status==="connected"))}function Df({icon:$,children:Z}){return q2.jsxs("div",{className:"flex items-center gap-3 text-card-foreground",children:[$,q2.jsx("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:Z})]})}function qf({server:$}){return q2.jsxs(Df,{icon:q2.jsx(hH0,{name:$.name,status:$.status}),children:[q2.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:IU($.name)}),q2.jsx("span",{className:"text-sm text-muted-foreground",children:yH0($.status)})]})}function Mf(){return q2.jsxs(Df,{icon:q2.jsx(vZ,{className:"size-10 shrink-0 rounded-lg"}),children:[q2.jsx(vZ,{className:"h-4 w-36 max-w-full"}),q2.jsx(vZ,{className:"h-4 w-20"})]})}function TD({children:$}){return q2.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:$})}function Pf($,Z){return o1({queryKey:w0.mcp($),queryFn:()=>V1(`/api/workspaces/${$}/mcp`),enabled:Z,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}var M4=O(c(),1);function lZ({title:$,description:Z,children:H}){return M4.jsxs("div",{className:"flex flex-col gap-6",children:[M4.jsxs("header",{className:"flex flex-col gap-0.5",children:[M4.jsx("h2",{className:"text-lg font-medium tracking-tight",children:$}),Z&&M4.jsx("p",{className:"text-sm text-muted-foreground",children:Z})]}),H]})}function iZ({label:$,children:Z}){return M4.jsxs("section",{className:"flex flex-col gap-2",children:[$&&M4.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:$}),M4.jsx("div",{className:"flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-xl border border-border bg-card text-card-foreground",children:Z})]})}function rZ({title:$,description:Z,control:H}){return M4.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[M4.jsxs("div",{className:"flex min-w-0 flex-col",children:[M4.jsx("span",{className:"text-sm font-medium",children:$}),Z&&M4.jsx("span",{className:"text-xs text-muted-foreground",children:Z})]}),H&&M4.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:H})]})}var c2=O(c(),1),xH0=Array.from({length:4},($,Z)=>Z);function vH0({connectors:$}){if($.isPending)return c2.jsx("div",{role:"status","aria-label":"Loading connectors",children:c2.jsx(TD,{children:xH0.map((Z)=>c2.jsx(Mf,{},Z))})});if($.isError)return c2.jsxs(_f,{children:[c2.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors."}),c2.jsx(C0,{variant:"outline",size:"sm",onClick:()=>$.refetch(),children:"Retry"})]});if($.data.length===0)return c2.jsxs(_f,{children:[c2.jsx(UY,{size:24,stroke:1.5,className:"text-muted-foreground"}),c2.jsx("p",{className:"text-sm text-foreground",children:"No connectors configured."})]});return c2.jsx(TD,{children:Vf($.data).map((Z)=>c2.jsx(qf,{server:Z},Z.name))})}function _f({children:$}){return c2.jsx("div",{className:"flex min-h-48 flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border px-8 py-12 text-center",children:$})}function Of(){let{workspaceId:$}=K5(),Z=Pf($,!0);return c2.jsx(lZ,{title:"Connectors",description:"Connectors available to the agent in this workspace.",children:c2.jsx(vH0,{connectors:Z})})}var ID=O(g(),1);var fJ={};O4(fJ,{Thumb:()=>wf,Root:()=>Tf});var Q6=O(g(),1);var YY=O(g(),1),CD=YY.createContext(void 0);function jf(){let $=YY.useContext(CD);if($===void 0)throw Error(E0(63));return $}var wD=function($){return $.checked="data-checked",$.unchecked="data-unchecked",$.disabled="data-disabled",$.readonly="data-readonly",$.required="data-required",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.filled="data-filled",$.focused="data-focused",$}({});var KY={...h2,checked($){if($)return{[wD.checked]:""};return{[wD.unchecked]:""}}};var gJ=O(c(),1),Tf=Q6.forwardRef(function(Z,H){let{checked:B,className:J,defaultChecked:Q,id:X,inputRef:z,name:G,nativeButton:F=!1,onCheckedChange:U,readOnly:Y=!1,required:K=!1,disabled:W=!1,render:N,uncheckedValue:L,value:V,...A}=Z,{clearErrors:D}=o4(),{state:q,setTouched:_,setDirty:M,validityData:P,setFilled:T,setFocused:R,shouldValidateOnChange:y,validationMode:w,disabled:h,name:E,validation:I}=h5(),{labelId:j}=N2(),S=h||W,k=E??G,b=Y0(U),v=Q6.useRef(null),u=T4(v,z,I.inputRef),C=Q6.useRef(null),t=Z1(),H0=A$({id:X,implicit:!1,controlRef:C}),x=F?void 0:H0,[e,L0]=s4({controlled:B,default:Boolean(Q),name:"Switch",state:"checked"});V$({id:t,commit:I.commit,value:e,controlRef:C,name:k,getValue:()=>e}),U0(()=>{if(v.current)T(v.current.checked)},[v,T]),qF(e,()=>{if(D(k),M(e!==P.initialValue),T(e),y())I.commit(e);else I.commit(e,!0)});let{getButtonProps:d,buttonRef:X0}=u5({disabled:S,native:F}),K0={id:F?H0:t,role:"switch","aria-checked":e,"aria-readonly":Y||void 0,"aria-required":K||void 0,"aria-labelledby":j,onFocus(){if(!S)R(!0)},onBlur(){let i=v.current;if(!i||S)return;if(_(!0),R(!1),w==="onBlur")I.commit(i.checked)},onClick(i){if(Y||S)return;i.preventDefault(),v.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:i.shiftKey,ctrlKey:i.ctrlKey,altKey:i.altKey,metaKey:i.metaKey}))}},Q0=Q6.useMemo(()=>Y4({checked:e,disabled:S,id:x,name:k,required:K,style:k?iM:Y8,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:u,onChange(i){if(i.nativeEvent.defaultPrevented)return;let B0=i.target.checked,$0=M0(G0.none,i.nativeEvent);if(b?.(B0,$0),$0.isCanceled)return;L0(B0)},onFocus(){C.current?.focus()}},I.getInputValidationProps,V!==void 0?{value:V}:b1),[e,S,u,x,k,b,K,L0,I,V]),z0=Q6.useMemo(()=>({...q,checked:e,disabled:S,readOnly:Y,required:K}),[q,e,S,Y,K]),A0=F0("span",Z,{state:z0,ref:[H,C,X0],props:[K0,I.getValidationProps,A,d],stateAttributesMapping:KY});return gJ.jsxs(CD.Provider,{value:z0,children:[A0,!e&&k&&L!==void 0&&gJ.jsx("input",{type:"hidden",name:k,value:L}),gJ.jsx("input",{...Q0})]})});var Cf=O(g(),1);var wf=Cf.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{state:X}=h5(),z=jf(),G={...X,...z};return F0("span",Z,{state:G,ref:H,stateAttributesMapping:KY,props:Q})});var ED=O(c(),1);function Ef({className:$,...Z}){return ED.jsx(fJ.Root,{"data-slot":"switch",className:s("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:bg-primary data-unchecked:bg-input",$),...Z,children:ED.jsx(fJ.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform data-checked:translate-x-4 data-unchecked:translate-x-0.5"})})}var SD=["app-settings"];function Sf(){let $=$1();return B2((Z)=>{if(Z.type==="settings:updated")$.setQueryData(SD,Z.settings)}),o1({queryKey:SD,queryFn:()=>V1("/api/settings"),staleTime:30000})}function If(){let $=$1();return s1({mutationFn:(Z)=>V1("/api/settings",n5("PATCH",Z),"Failed to save settings"),onSuccess:(Z)=>{$.setQueryData(SD,Z)}})}function Rf($){return o1({queryKey:w0.env($),queryFn:()=>V1(`/api/workspaces/${$}/env`),...b4})}function kf($){let Z=$1();return s1({mutationFn:(H)=>V1(`/api/workspaces/${$}/env`,n5("PUT",H)),onSuccess:(H)=>{Z.setQueryData(w0.env($),H)}})}function bf($){let Z=$1();return s1({mutationFn:(H)=>E4(`/api/workspaces/${$}/config`,n5("PUT",{name:H}),"Failed to save name"),onSuccess:()=>{Z.invalidateQueries({queryKey:w0.layout($)}),Z.invalidateQueries({queryKey:w0.all})}})}function yf($){let Z=$1();return s1({scope:{id:`workspace-icon:${$}`},mutationFn:(H)=>V1(`/api/workspaces/${$}/icon`,{method:"PUT",headers:{"Content-Type":H.type||"application/octet-stream"},body:H}),onSuccess:()=>{Z.invalidateQueries({queryKey:w0.layout($)}),Z.invalidateQueries({queryKey:w0.all})}})}function hf($){let Z=$1();return s1({scope:{id:`workspace-icon:${$}`},mutationFn:()=>E4(`/api/workspaces/${$}/icon`,{method:"DELETE"},"Failed to reset icon"),onSuccess:()=>{Z.invalidateQueries({queryKey:w0.layout($)}),Z.invalidateQueries({queryKey:w0.all})}})}function xf($){let Z=$1();return B2((H)=>{if(H.type==="env:updated"&&H.workspaceId===$)Z.invalidateQueries({queryKey:w0.env($)})}),{env:Rf($),update:kf($)}}var k5=O(c(),1),gH0={dotenv:".env",custom:"secret",both:"override"},fH0=/^[A-Za-z_][A-Za-z0-9_]*$/;function gf(){let{workspaceId:$}=K5(),{env:Z,update:H}=xf($),[B,J]=ID.useState(""),[Q,X]=ID.useState(""),z=fH0.test(B),G=z&&Q.length>0&&!H.isPending,F=()=>{if(!G)return;H.mutate({set:{[B]:Q}},{onSuccess:()=>{J(""),X("")}})},U=Z.data?.vars??[],Y=Z.data?.files.reduce((W,N)=>W+N.count,0)??0,K=Z.data?.files.length??0;return k5.jsxs(lZ,{title:"Environment",description:"Secrets injected into widgets and the agent at run time. Values are write-only — they're never shown again once saved.",children:[k5.jsxs(iZ,{label:"Variables",children:[Z.isLoading?k5.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:k5.jsx(I5,{className:"size-4 animate-spin",stroke:1.75})}):U.length===0?k5.jsx("p",{className:"px-3.5 py-4 text-sm text-muted-foreground",children:"No variables yet."}):U.map((W)=>{let N=W.source!=="dotenv";return k5.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[k5.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:W.key}),k5.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),k5.jsx("span",{className:s("rounded-lg px-1.5 py-0.5 text-[11px] font-medium",W.source==="dotenv"?"bg-muted text-muted-foreground":"bg-primary/10 text-primary"),children:gH0[W.source]}),!N&&k5.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),k5.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>H.mutate({remove:[W.key]}),disabled:!N,"aria-label":`Delete ${W.key}`,className:"disabled:invisible",children:k5.jsx(vf,{stroke:1.75})})]},W.key)}),k5.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[k5.jsx(N3,{value:B,onChange:(W)=>J(W.target.value),placeholder:"NEW_KEY","aria-invalid":B.length>0&&!z,className:"h-7 w-40 font-mono text-xs"}),k5.jsx(N3,{value:Q,onChange:(W)=>X(W.target.value),onKeyDown:(W)=>{if(W.key==="Enter")F()},type:"password",placeholder:"value",className:"h-7 flex-1 text-xs"}),k5.jsxs(C0,{variant:"outline",size:"sm",onClick:F,disabled:!G,children:[H.isPending?k5.jsx(I5,{stroke:1.75,className:"animate-spin"}):k5.jsx(K4,{stroke:1.75}),"Add"]})]})]}),k5.jsx(iZ,{label:"From .env files",children:k5.jsx(rZ,{title:"Inherit .env files",description:K>0?`Discovered ${Y} ${Y===1?"key":"keys"} across ${K} ${K===1?"file":"files"} in this space.`:"No .env files found in this space.",control:k5.jsx(Ef,{checked:Z.data?.inheritDotenv??!0,disabled:Z.isLoading,onCheckedChange:(W)=>H.mutate({inheritDotenv:W})})})})]})}var up=O(g(),1);var j2=O(g(),1);var n0=O(g(),1),aZ=O(g(),1),f4=O(g(),1),zm=O(c(),1),NY=O(g(),1),LY=O(g(),1),j1=O(c(),1),mH0=Object.defineProperty,pH0=($,Z)=>{for(var H in Z)mH0($,H,{get:Z[H],enumerable:!0})},r9={};pH0(r9,{ActiveEmoji:()=>Om,Empty:()=>_m,List:()=>qm,Loading:()=>Pm,Root:()=>Km,Search:()=>Wm,SkinTone:()=>jm,SkinToneSelector:()=>Mm,Viewport:()=>Nm});var Zm="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",bD=["none","light","medium-light","medium","medium-dark","dark"];function RD($){return $.charAt(0).toUpperCase()+$.slice(1)}var S8=2,d2=null;function ff($){try{d2??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!d2||(queueMicrotask(()=>{d2&&(d2=null)}),d2.canvas.width=S8,d2.canvas.height=S8,d2.font=`2px ${Zm}`,d2.textBaseline="middle",d2.measureText($).width>=S8*2))return!1;d2.fillStyle="#00f",d2.fillText($,0,0);let Z=d2.getImageData(0,0,S8,S8).data;d2.clearRect(0,0,S8,S8),d2.fillStyle="#f00",d2.fillText($,0,0);let H=d2.getImageData(0,0,S8,S8).data;for(let B=0;B<S8*S8*4;B+=4)if(Z[B]!==H[B]||Z[B+1]!==H[B+1]||Z[B+2]!==H[B+2])return!1;return!0}function mf($,Z,H){try{let B=$.getItem(Z);if(!B)throw Error(`No value found for "${Z}".`);let J=JSON.parse(B);return H(J)}catch{return null}}function Hm($,Z,H){$.setItem(Z,JSON.stringify(H))}function pf($){return(Z)=>Z===void 0?void 0:$(Z)}function uf($){return(Z)=>Z===null?null:$(Z)}function O2($){if(typeof $!="string")throw Error();return $}function WY($){if(typeof $!="number")throw Error();return $}function Bm($){if(typeof $!="boolean")throw Error();return $}function X6($){return(Z)=>{if(typeof Z!="object"||Z===null)throw Error();let H={};for(let B in $){let J=Z[B];J===void 0&&$[B](void 0),H[B]=$[B](J)}return H}}function kD($){return(Z)=>{if(!Array.isArray(Z))throw Error();return Z.length>0&&$(Z[0]),Z}}var Jm=($,Z)=>`${$}/${Z}/data.json`,Qm=($,Z)=>`${$}/${Z}/messages.json`,uH0=["bn","da","de","en-gb","en","es-mx","es","et","fi","fr","hi","hu","it","ja","ko","lt","ms","nb","nl","pl","pt","ru","sv","th","uk","vi","zh-hant","zh"],cf="en",Xm=($)=>`frimousse/data/${$}`,df="frimousse/metadata";async function lf($,Z){try{return(await fetch($,{method:"HEAD",signal:Z})).headers.get("etag")}catch{return null}}async function cH0($,Z,H){let[{emojis:B,emojisEtag:J},{messages:Q,messagesEtag:X}]=await Promise.all([fetch(Jm($,Z),{signal:H}).then(async(z)=>({emojis:await z.json(),emojisEtag:z.headers.get("etag")})),fetch(Qm($,Z),{signal:H}).then(async(z)=>({messages:await z.json(),messagesEtag:z.headers.get("etag")}))]);return{emojis:B,messages:Q,emojisEtag:J,messagesEtag:X}}async function dH0($,Z,H){let[B,J]=await Promise.all([lf(Jm($,Z),H),lf(Qm($,Z),H)]);return{emojisEtag:B,messagesEtag:J}}function lH0($){return $.skins?$.skins.filter((Z)=>typeof Z.tone=="number").reduce((Z,H)=>{let B=bD[H.tone];return Z[B]=H.emoji,Z},{}):void 0}async function rf($,Z,H){let{emojis:B,emojisEtag:J,messages:Q,messagesEtag:X}=await cH0($,Z,H),z=Q.subgroups.find((N)=>N.key==="country-flag"||N.key==="subdivision-flag"),G=Q.groups.filter((N)=>N.key!=="component"),F=B.filter((N)=>("group"in N)),U=G.map((N)=>({index:N.order,label:RD(N.message)})),Y=Q.skinTones.reduce((N,L)=>(N[L.key]=RD(L.message),N),{}),K=F.map((N)=>({emoji:N.emoji,category:N.group,version:N.version,label:RD(N.label),tags:N.tags??[],countryFlag:z&&N.subgroup===z.order||void 0,skins:lH0(N)})),W={locale:Z,emojis:K,categories:U,skinTones:Y};return Hm(localStorage,Xm(Z),{data:W,metadata:{emojisEtag:J,messagesEtag:X}}),W}function iH0($,Z){let H=new Map;for(let X of $)H.has(X.version)||H.set(X.version,X.emoji);let B=[...H.keys()].sort((X,z)=>z-X),J=B[0]??0,Q=ff("\uD83C\uDDEA\uD83C\uDDFA");if(typeof Z=="number")return{emojiVersion:Z,countryFlags:Q};for(let X of B){let z=H.get(X);if(ff(z))return{emojiVersion:X,countryFlags:Q}}return{emojiVersion:J,countryFlags:Q}}var rH0=X6({emojiVersion:WY,countryFlags:Bm}),aH0=X6({data:X6({locale:O2,emojis:kD(X6({emoji:O2,category:WY,label:O2,version:WY,tags:kD(O2),countryFlag:pf(Bm),skins:pf(X6({light:O2,"medium-light":O2,medium:O2,"medium-dark":O2,dark:O2}))})),categories:kD(X6({index:WY,label:O2})),skinTones:X6({light:O2,"medium-light":O2,medium:O2,"medium-dark":O2,dark:O2})}),metadata:X6({emojisEtag:uf(O2),messagesEtag:uf(O2)})});async function nH0({locale:$,emojiVersion:Z,emojibaseUrl:H,signal:B}){let J=typeof H=="string"?H:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof Z=="number"?Math.floor(Z):"latest"}`,Q=mf(sessionStorage,df,rH0),X=mf(localStorage,Xm($),aH0),z;if(!X)z=await rf(J,$,B);else if(Q)z=X.data;else try{let{emojisEtag:F,messagesEtag:U}=await dH0(J,$,B);z=!F||!U||F!==X.metadata.emojisEtag||U!==X.metadata.messagesEtag?await rf(J,$,B):X.data}catch{z=X.data}Q??=iH0(z.emojis,Z),Hm(sessionStorage,df,Q);let G=z.emojis.filter((F)=>{let U=F.version<=Q.emojiVersion;return F.countryFlag?U&&Q.countryFlags:U});return{locale:$,emojis:G,categories:z.categories,skinTones:z.skinTones}}function af($){return uH0.includes($)?$:(console.warn(`Locale "${$}" is not supported, using "${cf}" instead.`),cf)}function nf($){return bD.includes($)?$:(console.warn(`Skin tone "${$}" is not valid, using "none" instead.`),"none")}function oH0($,Z){let H=[];if(Z<=0)return H;for(let B=0,J=$.length;B<J;B+=Z)H.push($.slice(B,B+Z));return H}function sH0($,Z){if(!Z)return $;let H=Z.toLowerCase().trim(),B=new WeakMap;return $.filter((J)=>{let Q=0;J.label.toLowerCase().includes(H)&&(Q+=10);for(let X of J.tags)X.toLowerCase().includes(H)&&(Q+=1);return Q>0?(B.set(J,Q),!0):!1}).sort((J,Q)=>(B.get(Q)??0)-(B.get(J)??0))}function tH0($,Z,H,B){let J=sH0($.emojis,B),Q=[],X=[],z=[],G={},F=0,U=0;for(let Y of J)G[Y.category]||(G[Y.category]=[]),G[Y.category].push({emoji:H&&H!=="none"&&Y.skins?Y.skins[H]:Y.emoji,label:Y.label});for(let Y of $.categories){let K=G[Y.index];if(!K||K.length===0)continue;let W=oH0(Array.from(K),Z).map((N)=>({categoryIndex:F,emojis:N}));Q.push(...W),X.push({label:Y.label,rowsCount:W.length,startRowIndex:U}),z.push(U),F++,U+=W.length}return{count:J.length,categories:X,categoriesStartRowIndices:z,rows:Q,skinTones:$.skinTones}}function eH0($){let Z={},H=null,B=null,J=new Set,Q=()=>{if(H){Z=H,H=null;for(let F of J)F(Z)}B=null},X=()=>H??Z,z=(F)=>{H??=Z,Object.assign(H,typeof F=="function"?F(X()):F),B||(B=requestAnimationFrame(Q))},G=(F)=>(J.add(F),()=>J.delete(F));return Z=$(z,X),{get:X,set:z,subscribe:G}}function $B0($){let[Z]=f4.useState($);return Z}function ZB0($){let Z=f4.createContext(null);return{useStore:()=>{let H=f4.useContext(Z);if(!H)throw Error($);return H},Provider:({store:H,children:B})=>zm.jsx(Z.Provider,{value:H,children:B})}}function g4($,Z,H=Object.is){let[B,J]=f4.useState(()=>Z($.get()));return f4.useEffect(()=>$.subscribe(()=>{let Q=Z($.get());J((X)=>H(X,Q)?X:Q)}),[$,Z,H]),f4.useDebugValue(B),B}function M9($,Z,H){let B=f4.useCallback((J)=>J[Z],[Z]);return g4($,B,H)}var of=2;function HB0($,Z,H,B,J){let Q=0;return eH0((X,z)=>({locale:Z,columns:H,sticky:B,skinTone:J,onEmojiSelect:$,data:null,search:"",interaction:"none",activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:(G)=>{let F=z(),U=G?.data??F.data,Y=G?.categoryHeaderHeight??F.categoryHeaderHeight,K=G?.rowHeight??F.rowHeight,W=G?.viewportHeight??F.viewportHeight;if(!U||U.rows.length===0||!Y||!K||!W)return X({...G,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let N=0,L=0;for(let R of U.categories)if(L++*Y+R.startRowIndex*K<Q)N+=Y;else break;let V=U.categories.length*Y+U.rows.length*K,A=Math.floor(of*K/2),D=Math.ceil(of*K/2),q=Math.min(Q-N-A,V-W),_=q+W+D,M=Math.max(0,Math.floor(q/K)),P=Math.min(U.rows.length-1,Math.ceil(_/K)),T=U.rows[M]?.categoryIndex;return X(T===void 0&&G?G:{...G,viewportStartCategoryIndex:T,viewportStartRowIndex:M,viewportEndRowIndex:P})},onDataChange:(G)=>{z().updateViewportState({data:G,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:(G)=>{X({search:G,interaction:G?"keyboard":"none"})},onActiveEmojiChange:(G,F,U)=>{if(X({interaction:G,activeColumnIndex:F,activeRowIndex:U}),G!=="keyboard")return;let{listRef:Y,viewportRef:K,sticky:W,rowHeight:N,viewportHeight:L,categoryHeaderHeight:V}=z(),A=Y?.current,D=K?.current;if(!A||!D||!N||!V||!L)return;let q=U;q===0&&D.scrollTo({top:0,behavior:"instant"});let _=A.querySelector(`[aria-rowindex="${q}"]`);if(!(_ instanceof HTMLElement))return;let M=_.offsetTop,P=getComputedStyle(_),T=Number.parseFloat(P.scrollMarginTop),R=Number.parseFloat(P.scrollMarginBottom),y=Q+T;W&&M<Q+L/2&&(y+=V);let w=y+L-R;(M<y||M+N>w)&&D.scrollTo({top:Math.max(M<y+V?M-Math.max(W?V:0,T):M-L+N+R,0),behavior:"instant"})},onActiveEmojiReset:()=>{X({interaction:"none",activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:(G)=>{z().updateViewportState({rowHeight:G})},onCategoryHeaderHeightChange:(G)=>{z().updateViewportState({categoryHeaderHeight:G})},onViewportSizeChange:(G,F)=>{z().updateViewportState({viewportWidth:G,viewportHeight:F})},onViewportScroll:(G)=>{Q=G,z().updateViewportState()}}))}var{useStore:P4,Provider:BB0}=ZB0("EmojiPicker.Root is missing.");function JB0($){return $.search}function yD($){return $.interaction==="none"?void 0:$.data?.rows[$.activeRowIndex]?.emojis[$.activeColumnIndex]}function QB0($){return $.data===void 0||typeof $.data?.count=="number"&&$.data.count===0}function XB0($){return $.data===null||$.viewportHeight===null||$.rowHeight===null||$.categoryHeaderHeight===null}function Gm($){return $.data?.rows.length}function zB0($){return $.data?.categories.length}function GB0($){return $.data?.categoriesStartRowIndices}function FB0($){return $.data?.skinTones}function Fm($,Z){return $?.emoji===Z?.emoji}function UB0($,Z){return $?.categoryIndex!==Z?.categoryIndex||$?.emojis.length!==Z?.emojis.length?!1:!!$?.emojis.every((H,B)=>Fm(H,Z?.emojis[B]))}var mJ="",sf=/\p{Emoji_Modifier_Base}/u,YB0=/\uFE0F$/,KB0=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,WB0={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function NB0($,Z){if(!$.split(mJ).some((B)=>sf.test(B)))return $;let H=$.split(mJ).map((B)=>B.replace(KB0,"")).join(mJ);return Z==="none"?H:H.split(mJ).map((B,J,Q)=>{let X=Q.length>1;return!sf.test(B)||X&&B==="\uD83E\uDD1D"?B:B.replace(YB0,"")+WB0[Z]}).join(mJ)}function LB0($){return bD.map((Z)=>({skinTone:Z,emoji:NB0($,Z)}))}function Um(){let $=P4(),Z=g4($,yD,Fm);return aZ.useDeferredValue(Z)}function Ym($="✋"){let Z=P4(),H=M9(Z,"skinTone"),B=aZ.useMemo(()=>LB0($),[$]),J=aZ.useCallback((Q)=>{Z.set({skinTone:Q})},[]);return[H,J,B]}function hD($,Z){if(Object.is($,Z))return!0;if(typeof $!="object"||typeof Z!="object"||$===null||Z===null||Array.isArray($)!==Array.isArray(Z))return!1;let H=Object.keys($),B=Object.keys(Z);return H.length!==B.length?!1:H.every((J)=>(J in Z)&&$[J]===Z[J])}function AB0(...$){}function VB0($,Z){let H=null;if(typeof window.requestIdleCallback=="function")H=window.requestIdleCallback($,Z);else{let B=Date.now();H=window.setTimeout(()=>{$({didTimeout:!1,timeRemaining:()=>Math.max(0,(Z?.timeout??50)-(Date.now()-B))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(H):window.clearTimeout(H)}}var I8=typeof window<"u"?NY.useLayoutEffect:NY.useEffect;function DB0($){let Z=LY.useRef($);return I8(()=>{Z.current=$}),LY.useCallback((...H)=>Z.current(...H),[])}function qB0({emojiVersion:$,emojibaseUrl:Z}){let[H,B]=n0.useState(void 0),J=P4(),Q=M9(J,"locale"),X=M9(J,"columns"),z=M9(J,"skinTone"),G=M9(J,"search");return n0.useEffect(()=>{let F=new AbortController,U=F.signal;return nH0({locale:Q,emojiVersion:$,emojibaseUrl:Z,signal:U}).then((Y)=>{B(Y)}).catch((Y)=>{U.aborted||console.error(Y)}),()=>{F.abort()}},[$,Z,Q]),n0.useEffect(()=>{if(H)return VB0(()=>{J.get().onDataChange(tH0(H,X,z,G))},{timeout:100})},[H,X,z,G]),null}var Km=n0.forwardRef(({locale:$="en",columns:Z=9,skinTone:H="none",onEmojiSelect:B=AB0,emojiVersion:J,emojibaseUrl:Q,onFocusCapture:X,onBlurCapture:z,children:G,style:F,sticky:U=!0,...Y},K)=>{let W=DB0(B),N=$B0(()=>HB0(W,af($),Z,U,nf(H))),[L,V]=n0.useState(!1),A=n0.useRef(null),D=n0.useCallback((M)=>{M&&(A.current=M,N.set({rootRef:A}))},[]);I8(()=>{N.set({locale:af($)})},[$]),I8(()=>{N.set({columns:Z})},[Z]),I8(()=>{N.set({sticky:U})},[U]),I8(()=>{N.set({skinTone:nf(H)})},[H]);let q=n0.useCallback((M)=>{X?.(M);let{searchRef:P,viewportRef:T}=N.get(),R=M.target===P?.current||M.target.hasAttribute("frimousse-search"),y=M.target===T?.current||M.target.hasAttribute("frimousse-viewport");M.isDefaultPrevented()||(V(R||y),M.isDefaultPrevented()||(V(R||y),y?N.get().onActiveEmojiChange("keyboard",0,0):R&&N.get().search===""&&N.set({interaction:"none"})))},[X]),_=n0.useCallback((M)=>{z?.(M),!M.isDefaultPrevented()&&!M.currentTarget.contains(M.relatedTarget)&&V(!1)},[z]);return I8(()=>{L||N.get().onActiveEmojiReset()},[L]),n0.useImperativeHandle(K,()=>A.current),n0.useEffect(()=>{if(!L)return;function M(P){if(P.defaultPrevented||!P.key.startsWith("Arrow")&&P.key!=="Enter")return;let{data:T,onEmojiSelect:R,onActiveEmojiChange:y,interaction:w,activeColumnIndex:h,activeRowIndex:E}=N.get();if(P.key==="Enter"){let I=yD(N.get());I&&(P.preventDefault(),R(I))}if(P.key.startsWith("Arrow")){let I=h,j=E;if(P.preventDefault(),w!=="none"){if(T?.rows&&T.rows.length>0)switch(P.key){case"ArrowLeft":{if(I===0){let S=j-1,k=T.rows[S];k&&(j=S,I=k.emojis.length-1)}else I-=1;break}case"ArrowRight":{if(I===T.rows[j].emojis.length-1){let S=j+1;T.rows[S]&&(j=S,I=0)}else I+=1;break}case"ArrowUp":{let S=T.rows[j-1];S&&(j-=1,S.emojis[I]||(I=S.emojis.length-1));break}case"ArrowDown":{let S=T.rows[j+1];S&&(j+=1,S.emojis[I]||(I=S.emojis.length-1));break}}y("keyboard",I,j)}else y("keyboard",0,0)}}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[L]),I8(()=>{let M=null,P=null,T=null,R=null,y=N.subscribe((j)=>{A.current&&(M!==j.viewportWidth&&(M=j.viewportWidth,A.current.style.setProperty("--frimousse-viewport-width",`${j.viewportWidth}px`)),P!==j.viewportHeight&&(P=j.viewportHeight,A.current.style.setProperty("--frimousse-viewport-height",`${j.viewportHeight}px`)),T!==j.rowHeight&&(T=j.rowHeight,A.current.style.setProperty("--frimousse-row-height",`${j.rowHeight}px`)),R!==j.categoryHeaderHeight&&(R=j.categoryHeaderHeight,A.current.style.setProperty("--frimousse-category-header-height",`${j.categoryHeaderHeight}px`)))}),{viewportWidth:w,viewportHeight:h,rowHeight:E,categoryHeaderHeight:I}=N.get();return w&&A.current.style.setProperty("--frimousse-viewport-width",`${w}px`),h&&A.current.style.setProperty("--frimousse-viewport-height",`${h}px`),E&&A.current.style.setProperty("--frimousse-row-height",`${E}px`),I&&A.current.style.setProperty("--frimousse-category-header-height",`${I}px`),y},[]),j1.jsx("div",{"data-focused":L?"":void 0,"frimousse-root":"",onBlurCapture:_,onFocusCapture:q,...Y,ref:D,style:{"--frimousse-emoji-font":Zm,...F},children:j1.jsxs(BB0,{store:N,children:[j1.jsx(qB0,{emojiVersion:J,emojibaseUrl:Q}),G]})})}),Wm=n0.forwardRef(({value:$,defaultValue:Z,onChange:H,...B},J)=>{let Q=P4(),X=n0.useRef(null),z=n0.useCallback((Y)=>{Y&&(X.current=Y,Q.set({searchRef:X}))},[]),G=typeof $=="string",F=n0.useRef(G);n0.useEffect(()=>{F.current=G},[G]),I8(()=>{Q.set({search:typeof $=="string"?$:typeof Z=="string"?Z:""})},[]),I8(()=>{typeof $=="string"&&Q.get().onSearchChange($)},[$]);let U=n0.useCallback((Y)=>{H?.(Y),Y.isDefaultPrevented()||Q.get().onSearchChange(Y.target.value)},[H]);return n0.useImperativeHandle(J,()=>X.current),j1.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...B,defaultValue:Z,onChange:U,ref:z,value:$})}),MB0=n0.memo(()=>{let $=Um();return $?j1.jsx("div",{"aria-live":"polite",style:{border:0,clip:"rect(0, 0, 0, 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1,wordWrap:"normal"},children:$.label}):null}),Nm=n0.forwardRef(({children:$,onScroll:Z,onKeyDown:H,style:B,...J},Q)=>{let X=P4(),z=n0.useRef(null),G=n0.useCallback((K)=>{K&&(z.current=K,X.set({viewportRef:z}))},[]),F=g4(X,Gm),U=g4(X,zB0),Y=n0.useCallback((K)=>{Z?.(K),X.get().onViewportScroll(K.currentTarget.scrollTop)},[Z]);return I8(()=>{if(!z.current)return;let K=new ResizeObserver(([W])=>{let N=W?.borderBoxSize[0]?.inlineSize??0,L=W?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:V,viewportHeight:A,viewportWidth:D}=X.get();(A!==L||D!==N)&&V(N,L)});return K.observe(z.current),X.get().onViewportSizeChange(z.current.offsetWidth,z.current.clientHeight),()=>{K.disconnect()}},[]),n0.useImperativeHandle(Q,()=>z.current),j1.jsxs("div",{"frimousse-viewport":"",...J,onScroll:Y,ref:G,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof F=="number"&&typeof U=="number"?`var(--frimousse-viewport-width, auto) calc(${F} * var(--frimousse-row-height) + ${U} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...B},children:[j1.jsx(MB0,{}),$]})});function Lm($,Z,H){return{emoji:{...$,isActive:H},role:"gridcell","aria-colindex":Z,"aria-selected":H||void 0,"aria-label":$.label,"data-active":H?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function Am($,Z=!1){return{role:Z?void 0:"row","aria-rowindex":Z?void 0:$,"frimousse-row":"",style:{contain:Z?void 0:"content",height:Z?void 0:"var(--frimousse-row-height)",display:"flex"}}}function Vm($,Z){return{"frimousse-category":"",style:{contain:"content",top:Z?`calc(${$} * var(--frimousse-category-header-height) + ${Z.startRowIndex} * var(--frimousse-row-height))`:void 0,height:Z?`calc(var(--frimousse-category-header-height) + ${Z.rowsCount} * var(--frimousse-row-height))`:void 0,width:"100%",pointerEvents:"none",position:"absolute"}}}function Dm($,Z=!1,H=!0){return{category:$,"frimousse-category-header":"",style:{contain:Z?void 0:"layout paint",height:Z?void 0:"var(--frimousse-category-header-height)",pointerEvents:"auto",position:H?"sticky":void 0,top:0}}}function tf($,Z,H,B){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${$} * var(--frimousse-row-height) + ${Z} * var(--frimousse-category-header-height))`,paddingTop:`calc(${H} * var(--frimousse-row-height) + ${B} * var(--frimousse-category-header-height))`}}}function ef($,Z,H){return{"aria-colcount":$,"aria-rowcount":Z,"frimousse-list":"",style:{"--frimousse-list-columns":$,...H},role:"grid"}}function PB0($){$.preventDefault()}var _B0=n0.memo(({Emoji:$,emoji:Z,columnIndex:H,rowIndex:B})=>{let J=P4(),Q=g4(J,(F)=>yD(F)?.emoji===Z.emoji),X=n0.useCallback(()=>{J.get().onEmojiSelect(Z)},[Z]),z=n0.useCallback(()=>{J.get().onActiveEmojiChange("pointer",H,B)},[H,B]),G=n0.useCallback(()=>{J.get().onActiveEmojiReset()},[]);return j1.jsx($,{...Lm(Z,H,Q),onClick:X,onPointerDown:PB0,onPointerEnter:z,onPointerLeave:G})}),OB0=n0.memo(({Row:$,Emoji:Z,rowIndex:H})=>{let B=P4(),J=g4(B,(Q)=>Q.data?.rows[H],UB0);return J?j1.jsx($,{...Am(H),children:J.emojis.map((Q,X)=>j1.jsx(_B0,{Emoji:Z,columnIndex:X,emoji:Q,rowIndex:H},Q.label))}):null}),jB0=n0.memo(({CategoryHeader:$,categoryIndex:Z})=>{let H=P4(),B=g4(H,(Q)=>Q.data?.categories[Z],hD),J=M9(H,"sticky");return B?j1.jsx("div",{...Vm(Z,B),children:j1.jsx($,{...Dm({label:B.label},!1,J)})}):null}),$m=n0.memo(({CategoryHeader:$,Row:Z,Emoji:H})=>{let B=n0.useRef(null),J=P4(),Q=M9(J,"columns"),X=n0.useMemo(()=>Array(Q).fill({emoji:"\uD83D\uDE42",label:""}),[Q]),z=n0.useMemo(()=>({label:"Category"}),[]),G=n0.useRef(null),F=n0.useRef(null);return I8(()=>{let U=B.current?.parentElement?.parentElement;if(!U||!G.current||!F.current)return;let Y=new ResizeObserver((N)=>{for(let L of N){let V=L.contentRect.height,{onRowHeightChange:A,onCategoryHeaderHeightChange:D,rowHeight:q,categoryHeaderHeight:_}=J.get();L.target===G.current&&q!==V&&A(V),L.target===F.current&&_!==V&&D(V)}});Y.observe(U),Y.observe(G.current),Y.observe(F.current);let{onRowHeightChange:K,onCategoryHeaderHeightChange:W}=J.get();return K(G.current.clientHeight),W(F.current.clientHeight),()=>{Y.disconnect()}},[]),j1.jsxs("div",{"aria-hidden":!0,ref:B,style:{height:0,visibility:"hidden"},children:[j1.jsx("div",{"frimousse-row-sizer":"",ref:G,children:j1.jsx(Z,{...Am(-1,!0),children:X.map((U,Y)=>j1.jsx(H,{...Lm(U,Y,!1)},Y))})}),j1.jsx("div",{...Vm(-1),children:j1.jsx("div",{"frimousse-category-header-sizer":"",ref:F,children:j1.jsx($,{...Dm(z,!0)})})})]})});function TB0({category:$,...Z}){return j1.jsx("div",{...Z,children:$.label})}function CB0({emoji:$,...Z}){return j1.jsx("button",{type:"button",...Z,children:$.emoji})}function wB0({...$}){return j1.jsx("div",{...$})}var qm=n0.forwardRef(({style:$,components:Z,...H},B)=>{let J=P4(),Q=n0.useRef(null),X=n0.useCallback((A)=>{A&&(Q.current=A,J.set({listRef:Q}))},[]),z=Z?.CategoryHeader??TB0,G=Z?.Emoji??CB0,F=Z?.Row??wB0,U=M9(J,"columns"),Y=M9(J,"viewportStartRowIndex"),K=M9(J,"viewportEndRowIndex"),W=g4(J,Gm),N=g4(J,GB0,hD),L=n0.useMemo(()=>N?.filter((A)=>A<Y).length??0,[N,Y]),V=N?.length??0;return n0.useImperativeHandle(B,()=>Q.current),!W||!N||V===0?j1.jsx("div",{...ef(U,0,$),...H,children:j1.jsx("div",{...tf(0,0,0,0),children:j1.jsx($m,{CategoryHeader:z,Emoji:G,Row:F})})}):j1.jsx("div",{...ef(U,W,$),...H,ref:X,children:j1.jsxs("div",{...tf(W,V,Y,L),children:[j1.jsx($m,{CategoryHeader:z,Emoji:G,Row:F}),Array.from({length:K-Y+1},(A,D)=>{let q=Y+D,_=N.indexOf(q);return j1.jsxs(n0.Fragment,{children:[_>=0&&j1.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),j1.jsx(OB0,{Emoji:G,Row:F,rowIndex:q})]},q)}),Array.from({length:V},(A,D)=>j1.jsx(jB0,{CategoryHeader:z,categoryIndex:D},D))]})})}),Mm=n0.forwardRef(({emoji:$,onClick:Z,"aria-label":H="Change skin tone",...B},J)=>{let Q=P4(),X=g4(Q,FB0,hD),[z,G,F]=Ym($),U=n0.useMemo(()=>Math.max(0,F.findIndex((V)=>V.skinTone===z)),[z,F]),Y=F[U],K=F[(U+1)%F.length].skinTone,W=z==="none"?void 0:X?.[z],N=K==="none"?void 0:X?.[K],L=n0.useCallback((V)=>{Z?.(V),V.isDefaultPrevented()||G(K)},[Z,G,K]);return j1.jsx("button",{type:"button",...B,"aria-label":H+(N?` (${N})`:""),"aria-live":"polite","aria-valuetext":W,"frimousse-skin-tone-selector":"",onClick:L,ref:J,children:Y.emoji})});function Pm({children:$,...Z}){let H=P4();return g4(H,XB0)?j1.jsx("span",{"frimousse-loading":"",...Z,children:$}):null}function EB0({children:$}){let Z=P4(),H=g4(Z,JB0);return $({search:H})}function _m({children:$,...Z}){let H=P4();return g4(H,QB0)?j1.jsx("span",{"frimousse-empty":"",...Z,children:typeof $=="function"?j1.jsx(EB0,{children:$}):$}):null}function Om({children:$}){let Z=Um();return $({emoji:Z})}function jm({children:$,emoji:Z}){let[H,B,J]=Ym(Z);return $({skinTone:H,setSkinTone:B,skinToneVariations:J})}Km.displayName="EmojiPicker.Root";Wm.displayName="EmojiPicker.Search";Nm.displayName="EmojiPicker.Viewport";qm.displayName="EmojiPicker.List";Pm.displayName="EmojiPicker.Loading";_m.displayName="EmojiPicker.Empty";Mm.displayName="EmojiPicker.SkinToneSelector";Om.displayName="EmojiPicker.ActiveEmoji";jm.displayName="EmojiPicker.SkinTone";var pJ=["rocket","sparkles","bolt","flame","star","heart","diamond","trophy","target","bulb","brain","robot","wand","atom","flask","cpu","code","terminal","api","database","cube","hexagon","plug","tool","settings","bug","activity","chart","briefcase","folder","file","book","message","mail","bell","paperclip","key","shield","user","home","globe","world","planet","compass","map","calendar","cloud","sun","moon","snowflake","leaf","mountain","feather","ghost","music","piano","camera","photo","palette","gamepad","gift","cart","chef"],SB0=new Set(pJ);function Tm($){return SB0.has($)}var Sp={rocket:Lp,sparkles:qp,bolt:pB,flame:am,star:Mp,heart:$p,diamond:im,trophy:Tp,target:_p,bulb:ym,brain:Rm,robot:Np,wand:wp,atom:Em,flask:nm,cpu:um,code:mm,terminal:Op,api:wm,database:dm,cube:cm,hexagon:Zp,plug:Wp,tool:jp,settings:uJ,bug:bm,activity:Cm,chart:vm,briefcase:km,folder:om,file:UZ,book:Im,message:Xp,mail:Jp,bell:Sm,paperclip:IF,key:AY,shield:Ap,user:Cp,home:Hp,globe:em,world:Ep,planet:Kp,compass:pm,map:Qp,calendar:hm,cloud:fm,sun:Pp,moon:zp,snowflake:Dp,leaf:Bp,mountain:Gp,feather:rm,ghost:sm,music:Fp,piano:RF,camera:xm,photo:Yp,palette:Up,gamepad:lm,gift:tm,cart:Vp,chef:gm},xD=pJ.map(($)=>({id:$,Icon:Sp[$]}));function VY($){return $&&Tm($)?Sp[$]:null}var gD=[{id:"sunrise",gradient:{angle:140,stops:["#FFE29F","#FFA99F","#FF719A"]}},{id:"ocean",gradient:{angle:135,stops:["#67E8F9","#3B82F6","#4F46E5"]}},{id:"meadow",gradient:{angle:135,stops:["#A7F3D0","#34D399","#059669"]}},{id:"dusk",gradient:{angle:120,stops:["#C471F5","#FA71CD"]}},{id:"midnight",gradient:{angle:135,stops:["#30CFD0","#330867"]}}];function vD($,Z,H){let B=H*Math.PI/180,J=Z*Math.cos(B),Q=Z*Math.sin(B),X=($+0.3963377774*J+0.2158037573*Q)**3,z=($-0.1055613458*J-0.0638541728*Q)**3,G=($-0.0894841775*J-1.291485548*Q)**3;return`#${[4.0767416621*X-3.3077115913*z+0.2309699292*G,-1.2684380046*X+2.6097574011*z-0.3413193965*G,-0.0041960863*X-0.7034186147*z+1.707614701*G].map((U)=>{let Y=Math.min(1,Math.max(0,U)),K=Y<=0.0031308?12.92*Y:1.055*Y**0.4166666666666667-0.055;return Math.round(K*255).toString(16).padStart(2,"0")}).join("")}`}function Ip(){let $=Math.random()*360,Z=(35+Math.random()*55)*(Math.random()<0.5?-1:1),H=Math.round(115+Math.random()*55),B=vD(0.83+Math.random()*0.06,0.09+Math.random()*0.06,$),J=vD(0.5+Math.random()*0.14,0.17+Math.random()*0.07,$+Z);if(Math.random()<0.4){let Q=vD(0.7+Math.random()*0.05,0.15,$+Z/2);return{angle:H,stops:[B,Q,J]}}return{angle:H,stops:[B,J]}}var IB0="radial-gradient(120% 100% at 28% 12%, rgba(255,255,255,0.32), rgba(255,255,255,0) 58%)";function DY($){return`${IB0}, linear-gradient(${$.angle}deg, ${$.stops.join(", ")})`}var G2=256;function Rp($,Z){let H=Z.angle*Math.PI/180,B=Math.sin(H),J=-Math.cos(H),Q=G2*(Math.abs(B)+Math.abs(J))/2,X=G2/2,z=$.createLinearGradient(X-B*Q,X-J*Q,X+B*Q,X+J*Q),G=Z.stops.length-1;Z.stops.forEach((U,Y)=>z.addColorStop(G===0?0:Y/G,U)),$.fillStyle=z,$.fillRect(0,0,G2,G2);let F=$.createRadialGradient(G2*0.28,G2*0.12,0,G2*0.28,G2*0.12,G2*1.1);F.addColorStop(0,"rgba(255,255,255,0.32)"),F.addColorStop(0.58,"rgba(255,255,255,0)"),$.fillStyle=F,$.fillRect(0,0,G2,G2)}function kp($){return new Promise((Z,H)=>{$.toBlob((B)=>B?Z(B):H(Error("Canvas is empty")),"image/png")})}function bp(){let $=document.createElement("canvas");$.width=G2,$.height=G2;let Z=$.getContext("2d");if(!Z)throw Error("2D canvas unavailable");return[$,Z]}var RB0=0.92,kB0=0.68;async function yp($,Z){let[H,B]=bp();if(Z)Rp(B,Z);B.textAlign="center",B.textBaseline="middle";let J=Z?kB0:RB0;return B.font=`${Math.round(G2*J)}px "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif`,B.fillText($,G2/2,G2/2+G2*0.04),kp(H)}function bB0($){return new Promise((Z,H)=>{let B=new Image;B.onload=()=>Z(B),B.onerror=()=>H(Error("Failed to load SVG")),B.src=$})}var yB0=0.78,hB0=0.6;async function hp($,Z){let[H,B]=bp();if(Z)Rp(B,Z);let J=Z?"#ffffff":"#18181b",Q=$.replace(/currentColor/g,J),X=await bB0(`data:image/svg+xml;utf8,${encodeURIComponent(Q)}`),z=G2*(Z?hB0:yB0),G=(G2-z)/2;return B.drawImage(X,G,G,z,z),kp(H)}var xp=["\uD83D\uDE80","✨","\uD83D\uDD25","⚡","\uD83D\uDCA1","\uD83E\uDDE0","\uD83E\uDD16","\uD83E\uDE84","\uD83E\uDDEA","⚙️","\uD83D\uDEE0️","\uD83D\uDCBB","\uD83D\uDCE6","\uD83D\uDCCA","\uD83D\uDCC8","\uD83D\uDCDD","\uD83D\uDCDA","\uD83C\uDFAF","\uD83C\uDFC6","\uD83D\uDC8E","\uD83E\uDE90","\uD83C\uDF0D","\uD83E\uDDED","\uD83C\uDFA8","\uD83C\uDFAE","☕"],qY="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var t0=O(c(),1);function xB0({category:$,...Z}){return t0.jsx("div",{className:"bg-background px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",...Z,children:$.label})}function vB0({children:$,...Z}){return t0.jsx("div",{className:"scroll-my-1 px-1.5",...Z,children:$})}function gB0({emoji:$,...Z}){return t0.jsx("button",{className:s("flex size-9 items-center justify-center rounded-xl text-[22px] transition-colors duration-75 data-active:bg-muted",qY),...Z,children:$.emoji})}function pp({icon:$}){let{workspaceId:Z,provider:H}=K5(),{isPending:B,mutateAsync:J}=yf(Z),{isPending:Q,mutate:X}=hf(Z),[z,G]=j2.useState("emoji"),[F,U]=j2.useState({id:"sunrise",gradient:gD[0].gradient}),[Y,K]=j2.useState(null),[W,N]=j2.useState(null),[L,V]=j2.useState(""),[A,D]=j2.useState(null),[q,_]=j2.useState(null),[M,P]=j2.useState(!1),[T,R]=j2.useState(null),y=j2.useRef(null),w=j2.useRef(null),h=j2.useRef(null),E=xD.find((C)=>C.id===A),I=F.gradient!==null,j=B||Q,S=()=>{let C=Ip();K(C),U({id:"shuffle",gradient:C})},k=(C)=>{R(null),h.current=C,G("upload"),_(URL.createObjectURL(C))};j2.useEffect(()=>{let C=!1,t=async()=>{let x;if(z==="upload"){if(!h.current)return;x=h.current}else if(z==="emoji"){if(!W)return;x=await yp(W,F.gradient)}else{let e=w.current?.querySelector("svg");if(!e)return;x=await hp(new XMLSerializer().serializeToString(e),F.gradient)}if(!C)await J(x)};R(null);let H0=window.setTimeout(()=>{t().catch((x)=>{if(!C)R(x instanceof Error?x.message:"Failed to save icon")})},150);return()=>{C=!0,window.clearTimeout(H0)}},[F.gradient,W,z,J,E,q]),j2.useEffect(()=>{return()=>{if(q)URL.revokeObjectURL(q)}},[q]);let b=()=>{h.current=null,N(null),D(null),_(null),R(null),X()},v=z==="emoji"&&W?"emoji":z==="icon"&&E?"glyph":"image",u=z==="upload"&&q?q:$??M8[H??"claude-code"];return t0.jsxs("div",{className:"flex gap-6",children:[t0.jsxs("div",{className:"flex w-24 shrink-0 flex-col items-center gap-2.5",children:[t0.jsx("div",{className:s("flex size-24 items-center justify-center overflow-hidden rounded-xl",v!=="image"&&!I&&"bg-[repeating-conic-gradient(#0000000d_0%_25%,transparent_0%_50%)] bg-size-[16px_16px]"),style:v!=="image"&&F.gradient?{background:DY(F.gradient)}:void 0,children:v==="emoji"?t0.jsx("span",{className:s("leading-none",qY,I?"text-[64px]":"text-[86px]"),children:W}):v==="glyph"&&E?t0.jsx(E.Icon,{stroke:1.5,className:s(I?"size-14 text-white":"size-18 text-foreground")}):t0.jsx("img",{src:u,alt:"",className:"size-full object-cover"})}),t0.jsx("button",{type:"button",onClick:b,disabled:j,className:"text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50",children:"Reset to default"})]}),t0.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[t0.jsx("div",{className:"flex gap-1 self-start rounded-xl bg-muted p-0.5",children:["emoji","icon","upload"].map((C)=>t0.jsx("button",{type:"button",onClick:()=>G(C),className:s("rounded-lg px-3.5 py-1 text-xs font-medium capitalize transition-colors",z===C?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:C},C))}),t0.jsxs("div",{className:s("flex items-center gap-2",z==="upload"&&"pointer-events-none opacity-35"),children:[t0.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Background"}),t0.jsxs("div",{className:"flex items-center gap-2",children:[t0.jsx("button",{type:"button","aria-label":"No background",onClick:()=>U({id:"none",gradient:null}),className:s("flex size-7 items-center justify-center rounded-full bg-muted ring-offset-2 ring-offset-card transition-shadow",F.id==="none"?"ring-2 ring-primary":"ring-1 ring-border hover:ring-muted-foreground/30"),children:t0.jsx(gp,{size:16,stroke:1.75,className:"text-muted-foreground"})}),gD.map((C)=>t0.jsx("button",{type:"button","aria-label":`${C.id} background`,onClick:()=>U({id:C.id,gradient:C.gradient}),style:{background:DY(C.gradient)},className:s("size-7 rounded-full ring-offset-2 ring-offset-card transition-shadow",F.id===C.id?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30")},C.id)),t0.jsx("button",{type:"button","aria-label":"Random background",title:"Surprise me",onClick:S,style:Y?{background:DY(Y)}:void 0,className:s("flex size-7 items-center justify-center rounded-full ring-offset-2 ring-offset-card transition-shadow",Y?"text-white":"bg-muted text-muted-foreground ring-1 ring-border",F.id==="shuffle"?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30"),children:t0.jsx(vp,{size:16,stroke:1.75})})]})]}),z==="emoji"?t0.jsxs(r9.Root,{onEmojiSelect:(C)=>N(C.emoji),emojibaseUrl:"/vendor/emojibase",columns:13,className:"isolate flex h-72 flex-col overflow-hidden rounded-xl border border-border bg-background",children:[t0.jsxs("div",{className:"flex items-center gap-1.5 p-1.5 pb-0",children:[t0.jsx(r9.Search,{placeholder:"Search emoji…",onChange:(C)=>V(C.target.value),className:"h-8 min-w-0 flex-1 appearance-none rounded-lg bg-muted px-2.5 text-sm outline-none placeholder:text-muted-foreground"}),t0.jsx(r9.SkinToneSelector,{className:"size-8 shrink-0 rounded-lg text-lg hover:bg-accent"})]}),t0.jsxs(r9.Viewport,{className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[t0.jsxs(r9.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[t0.jsx(I5,{size:16,stroke:1.75,className:"animate-spin"}),"Loading emoji…"]}),L.trim()===""&&t0.jsxs("div",{className:"border-b border-dashed border-border pb-1.5",children:[t0.jsx("p",{className:"px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",children:"Favorites"}),t0.jsx("div",{className:"grid grid-cols-13 justify-items-start px-1.5",children:xp.map((C)=>t0.jsx("button",{type:"button",onClick:()=>N(C),className:s("flex size-9 items-center justify-center rounded-xl text-[22px] transition-colors duration-75",qY,W===C?"bg-primary/10":"hover:bg-accent"),children:C},C))})]}),t0.jsxs(r9.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[t0.jsx(fp,{size:20,stroke:1.5}),"No emoji found"]}),t0.jsx(r9.List,{className:"pb-1.5 select-none",components:{CategoryHeader:xB0,Row:vB0,Emoji:gB0}})]})]}):z==="icon"?t0.jsx("div",{className:"grid scrollbar-thin h-72 grid-cols-[repeat(auto-fill,minmax(2.25rem,1fr))] content-start gap-1 overflow-y-auto rounded-xl border border-border bg-background p-1.5",children:xD.map(({id:C,Icon:t})=>t0.jsx("button",{type:"button","aria-label":C,onClick:()=>D(C),className:s("flex aspect-square items-center justify-center rounded-xl text-muted-foreground transition-colors [&_svg]:size-5",A===C?"bg-primary/10 text-primary":"hover:bg-accent hover:text-accent-foreground"),children:t0.jsx(t,{stroke:1.5})},C))}):t0.jsxs("button",{type:"button",onClick:()=>y.current?.click(),onDragOver:(C)=>{C.preventDefault(),P(!0)},onDragLeave:()=>P(!1),onDrop:(C)=>{C.preventDefault(),P(!1);let t=C.dataTransfer.files?.[0];if(t)k(t)},className:s("flex h-72 flex-col items-center justify-center gap-2 rounded-xl border border-dashed transition-colors",M?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-muted-foreground/30 hover:text-foreground"),children:[t0.jsx(mp,{size:24,stroke:1.5}),t0.jsx("span",{className:"text-xs font-medium",children:"Click or drop an image"}),t0.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"PNG, JPG, GIF, or WebP"})]}),t0.jsx("div",{className:"min-h-4","aria-live":"polite",children:T?t0.jsx("p",{className:"text-xs text-destructive",children:T}):j?t0.jsx("p",{className:"text-xs text-muted-foreground",children:"Saving…"}):null})]}),t0.jsx("input",{ref:y,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:(C)=>{let t=C.target.files?.[0];if(t)k(t);C.target.value=""}}),t0.jsx("span",{ref:w,"aria-hidden":!0,className:"hidden",children:E&&t0.jsx(E.Icon,{stroke:1.5})})]})}var M2=O(c(),1);function cp(){let{cloudDemo:$}=Z9(),{name:Z,icon:H,cwd:B,workspaceId:J}=K5(),[,Q]=p4(),X=bf(J),z=zO(),[G,F]=up.useState(Z??"");return M2.jsxs(lZ,{title:"General",description:"Basic details for this space.",children:[M2.jsxs(iZ,{children:[M2.jsx(rZ,{title:"Name",description:"Shown in the sidebar and the workspace header.",control:M2.jsx(N3,{value:G,onChange:(K)=>F(K.target.value),onBlur:()=>{let K=G.trim();if(K===(Z??""))return;X.mutate(K===""?null:K)},onKeyDown:(K)=>{if(K.key==="Enter")K.currentTarget.blur()},placeholder:"Space name",className:"w-56"})}),M2.jsx(rZ,{title:"Path",control:M2.jsx(N3,{value:B??"",readOnly:!0,"aria-label":"Workspace path",title:B??void 0,className:"w-56"})}),M2.jsxs("div",{className:"flex flex-col gap-4 px-3.5 py-3.5",children:[M2.jsxs("div",{className:"flex flex-col",children:[M2.jsx("span",{className:"text-sm font-medium",children:"Icon"}),M2.jsx("span",{className:"text-xs text-muted-foreground",children:"Pick an emoji or a glyph on a generated background, or upload an image."})]}),M2.jsx(pp,{icon:H})]})]}),!$&&M2.jsxs(iZ,{label:"Danger zone",children:[M2.jsx(rZ,{title:"Remove space",description:"Remove this space from moi. Its folder and sessions stay on disk.",control:M2.jsxs(C0,{type:"button",variant:"destructive",size:"sm",onClick:()=>{let W=`Remove "${Z??B??"this space"}" from your workspaces?
|
|
81
|
+
|
|
82
|
+
This only removes it from your list. The folder and its sessions stay on disk. You can add it back any time.`;if(!window.confirm(W))return;z.mutate(J,{onSuccess:()=>Q("/")})},disabled:z.isPending,children:[z.isPending&&M2.jsx(I5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})}),z.isError&&M2.jsx("p",{className:"px-3.5 py-3 text-xs text-destructive",children:z.error.message})]})]})}var V5=O(c(),1),fB0=[{id:"general",label:"General",icon:uJ},{id:"connectors",label:"Connectors",icon:UY},{id:"environment",label:"Environment",icon:AY}];function dp(){let[$,Z]=fD.useState(!1),[H,B]=fD.useState("general");return V5.jsxs(V5.Fragment,{children:[V5.jsxs(r1,{children:[V5.jsx(a1,{render:V5.jsx(C0,{variant:"ghost",size:"icon-sm","aria-label":"Settings",onClick:()=>Z(!0),children:V5.jsx(uJ,{stroke:1.75})})}),V5.jsx(n1,{children:"Settings"})]}),V5.jsx(Y3,{open:$,onOpenChange:Z,children:V5.jsxs(N$,{className:"flex h-[min(680px,90vh)] w-[880px] max-w-[94vw]",children:[V5.jsx(K3,{className:"sr-only",children:"Space settings"}),V5.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r border-border bg-muted/30 p-3",children:[V5.jsx("p",{className:"px-2.5 pt-4 pb-2 text-[11px] font-semibold tracking-wider text-muted-foreground/80 uppercase",children:"Settings"}),fB0.map((J)=>V5.jsxs(C0,{type:"button",variant:H===J.id?"secondary":"ghost",size:"sm",onClick:()=>B(J.id),className:"justify-start",children:[V5.jsx(J.icon,{stroke:1.75}),J.label]},J.id))]}),V5.jsxs("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:[V5.jsxs("div",{className:"px-8 py-7",children:[H==="general"&&V5.jsx(cp,{}),H==="connectors"&&V5.jsx(Of,{}),H==="environment"&&V5.jsx(gf,{})]}),V5.jsx(W$,{render:V5.jsx(C0,{variant:"ghost",size:"icon","aria-label":"Close",className:"absolute top-3 right-3",children:V5.jsx(S5,{stroke:1.5})})})]})]})})]})}function mB0($){if($.status==="available")return null;if($.status==="checking")return"this workspace's agent availability has not resolved yet";return"this workspace's agent is unavailable"}function lp({send:$,revealChat:Z,composerAvailability:H}){let B=H5();YG(B,"sendChatMessage",(J)=>{let Q=mB0(H);if(Q){D8(B,{source:"runtime",message:`sendChatMessage("${J.message}") was dropped: ${Q}.`});return}let{message:X,...z}=J;Z(),$(X,{applet:z})})}var z6=O(g(),1);var sp=O(g(),1);function MY($,Z){let H=$??[];if(H.findIndex((J)=>J.id===Z.id)===-1)return[...H,Z];return H.map((J)=>J.id===Z.id&&J.updatedAt<=Z.updatedAt?Z:J)}function PY($){let Z=$1();return B2((H)=>{if(H.type==="view-builder:updated"&&H.workspaceId===$)Z.setQueryData(w0.viewBuilders($),(B)=>MY(B,H.builder));else if(H.type==="view-builder:deleted"&&H.workspaceId===$)Z.setQueryData(w0.viewBuilders($),(B)=>(B??[]).filter((J)=>J.id!==H.builderId))}),o1({queryKey:w0.viewBuilders($),queryFn:async()=>{return(await V1(`/api/workspaces/${$}/view-builders`)).builders},...b4})}function ip($){let Z=$1();return s1({mutationFn:()=>V1(`/api/workspaces/${$}/view-builders`,n5("POST"),"Failed to create view builder"),onSuccess:(H)=>{Z.setQueryData(w0.viewBuilders($),(B)=>MY(B,H))}})}function rp($){let Z=$1();return s1({mutationFn:({builderId:H,requirements:B})=>V1(`/api/workspaces/${$}/view-builders/${H}`,n5("PATCH",{input:{requirements:B}}),"Failed to save view requirements"),onSuccess:(H)=>{Z.setQueryData(w0.viewBuilders($),(B)=>MY(B,H))}})}function ap($){let Z=$1();return s1({mutationFn:({builderId:H,requirements:B,...J})=>V1(`/api/workspaces/${$}/view-builders/${H}/submit`,n5("POST",{input:{requirements:B},availableIcons:pJ,...J}),"Failed to start view builder"),onSuccess:(H)=>{Z.setQueryData(w0.viewBuilders($),(B)=>MY(B,H))}})}function np($){let Z=$1();return s1({mutationFn:(H)=>E4(`/api/workspaces/${$}/view-builders/${H}`,{method:"DELETE"},"Failed to discard view builder"),onSuccess:(H,B)=>{Z.setQueryData(w0.viewBuilders($),(J)=>(J??[]).filter((Q)=>Q.id!==B))}})}var op=new Map;function pB0($){let Z=op.get($)??[];return op.delete($),Z}function uB0($,Z=[]){return[...pB0($),...Z]}function cB0($,Z){if(!$.startsWith("view:"))return;return Object.keys(Z).length>0?Z:void 0}function dB0($,Z,H){if($.startsWith("view:"))return Z?.find((B)=>B.id===$.slice(5))?.config.title||void 0;if($.startsWith("view-builder:"))return H?.find((B)=>B.id===$.slice(13))?.title||void 0;return}function tp({activeTab:$,appletParams:Z}){let H=H5(),B=AG(H).data,J=PY(H).data;return sp.useCallback((Q={})=>{let X=uB0(H,Q.directives??[]),z=cB0($,Z);return{activeTab:$,tabTitle:dB0($,B,J),...z?{tabParams:z}:{},...Q.applet?{applet:Q.applet}:{},...X.length>0?{directives:X}:{}}},[H,$,Z,B,J])}var ep=!0;function $u($,Z=[]){return($.trim()||Z.filter(Boolean).join(", ")).replace(/\s+/gu," ").trim().slice(0,64).trimEnd()}function _Y($){return!$?.applet}function OY($,Z,H){if(!_Y(H))return[];return(E1.getState().attachments[s2($,Z)]??[]).filter((J)=>J.status==="ready"&&J.upload)}function jY($){return $.map((Z)=>{if(Z.upload?.kind==="image"&&Z.previewUrl)return{type:"file",mediaType:Z.mediaType,url:Z.previewUrl,filename:Z.name};return{type:"file",mediaType:Z.mediaType,url:"",filename:Z.name}})}function Zu($,Z){if(!_Y($))return $;let H=[],B=[],J=0;for(let X of Z){if(X.upload?.kind!=="image")continue;if(J+=1,X.kind==="drawing"&&X.purpose==="annotation")H.push(`${J}. ${JSON.stringify(X.sourceTab)}`);if(X.kind==="drawing"&&X.purpose==="sketch")B.push(`${J}. ${JSON.stringify(X.sourceTab)}`)}if(H.length===0&&B.length===0)return $;let Q=[...$?.directives??[]];if(H.length>0)Q.push(`Annotation attachment sources in attachment order: ${H.join("; ")}.`);if(B.length>0)Q.push(`Sketch attachment sources in attachment order: ${B.join("; ")}. Each sketch shows the intended layout of a new view.`);return{...$,directives:Q}}function TY({queryClient:$,workspaceId:Z,sessionId:H,parts:B}){let J=`optimistic:${crypto.randomUUID()}`;return $.setQueryData(w0.events(Z,H),(Q)=>vH(Q??xH(),{kind:"turn",turn:{id:J,role:"user",origin:{kind:"user-input"},parts:B,timestamp:new Date().toISOString()}})),E1.getState().setActivity(Z,H,"running"),E1.getState().setError(Z,H,null),J}function CY({queryClient:$,workspaceId:Z,sessionId:H,text:B,filenames:J=[]}){let Q=$u(B,J);if(!Q)return;$.setQueryData(w0.sessions(Z),(X)=>[{sessionId:H,summary:Q,lastModified:Date.now()},...(X??[]).filter((z)=>z.sessionId!==H)])}function wY($,Z,H,B){let J=$?.models,Q=!Z||!J||J.some((U)=>U.value===Z)?Z:void 0,X=J?.find((U)=>U.value===Q),z=H&&(!X||(X.supportedEffortLevels??[]).includes(H))?H:void 0,G=B===void 0||!X||X.supportsFastMode?B:!1,F=ep&&$?.supportsStreaming?!0:void 0;return{model:Q,effort:z,...G!==void 0?{fastMode:G}:{},stream:F}}function lB0($){return $.filter((Z)=>Z.text.length>0).map((Z)=>Z.kind==="reasoning"?{type:"reasoning",text:Z.text}:{type:"text",text:Z.text})}function Hu($){let Z=lB0($?.blocks??[]);if(Z.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:Z}}var iB0=xH();function Bu($){let Z=H5(),H=$1(),{layout:B}=K5(),[J,Q]=F3(),X=G9(Z).data,z=bG(Z).data,G=Boolean(J)&&z!==void 0&&!z.some((T)=>T.sessionId===J),F=G?null:J??null;z6.useEffect(()=>{if(G)Q(null)},[Q,G]);let U=tp($),Y=t2((T)=>F?T.activity[`${Z}:${F}`]??"idle":"idle"),K=z$(Y),W=t2((T)=>F?T.errors[`${Z}:${F}`]??null:null),N=BS(Z,F),L=N.data??iB0,V=z!==void 0&&(F===null||N.data!==void 0),A=t2((T)=>T.previews),D=z6.useMemo(()=>Hu(c_(A,Z,F).root),[A,Z,F]),q=yG(Z,F).data,_=z6.useCallback((T,R)=>{let y=T.trim(),w=OY(Z,F,R);if(!y&&w.length===0)return;let h=F,E=!1;if(!h)h=crypto.randomUUID(),E=!0,Q(h),CY({queryClient:H,workspaceId:Z,sessionId:h,text:y,filenames:w.map((H0)=>H0.name)});let I=jY(w);if(y)I.push({type:"text",text:y});let j=TY({queryClient:H,workspaceId:Z,sessionId:h,parts:I}),S=q?.model??B.selectedModel,k=q?.effort??B.selectedEffort,b=q?.fastMode??B.selectedFastMode,{model:v,effort:u,fastMode:C,stream:t}=wY(X,S,k,b);if(OX({type:"chat",workspaceId:Z,content:y,sessionId:h,isNew:E,optimisticId:j,model:v,effort:u,fastMode:C,stream:t,context:U(Zu(R,w)),...w.length>0?{attachments:w.map((H0)=>H0.upload.id)}:{}}),j5.getState().markMessageSentFromMoi(Z),E)H.invalidateQueries({queryKey:w0.preview(Z)});if(_Y(R))E1.getState().clearAttachments(Z,F)},[F,Z,H,B.selectedModel,B.selectedEffort,B.selectedFastMode,U,q?.model,q?.effort,q?.fastMode,Q,X]),M=z6.useCallback(()=>{if(!F)return;E1.getState().setError(Z,F,null)},[F,Z]),P=z6.useCallback(()=>{if(!K||!F)return;OX({type:"stop",workspaceId:Z,sessionId:F})},[K,F,Z]);return{view:L,chatLoaded:V,previewTurn:D,sessionId:F,processing:K,error:W,send:_,stop:P,selectSession:Q,dismissError:M}}var Qu=O(g(),1);var F2=O(g(),1);function Ju({active:$,builderId:Z,sessionId:H,sourceTab:B,workspaceId:J,onEditingStart:Q,onContinueInChat:X}){let z=F2.useRef(`sketch:${Z}`),G=F2.useRef(0),F=F2.useRef(null),U=F2.useRef(null),Y=F2.useRef(!0),[K,W]=F2.useState(!1),N=F2.useRef(Q),L=F2.useRef(X);N.current=Q,L.current=X;let V=F2.useCallback((R)=>{if(!Y.current)return;if(!R){G.current+=1,F.current=null,U.current=null,E1.getState().removeAttachment(J,H,z.current);return}PG({workspaceId:J,sessionId:H,localId:z.current,purpose:"sketch",sourceTab:B,blob:R})},[H,B,J]),A=F2.useCallback((R)=>{if(!R)return U.current??Promise.resolve();if(R===F.current){if(E1.getState().attachments[s2(J,H)]?.some((E)=>E.localId===z.current&&(E.status==="ready"||E.status==="uploading")))return U.current??Promise.resolve()}F.current=R;let y=++G.current,w=_G({workspaceId:J,sessionId:H,localId:z.current,purpose:"sketch",sourceTab:B,blob:R,isCurrent:()=>G.current===y});return U.current=w,w},[H,B,J]),D=qG({mode:"sketch",onChange:V,onEditingStart:()=>N.current()}),{controls:q}=D,_=F2.useCallback(async()=>{await A(await q.flush())},[q,A]),M=F2.useCallback(async()=>{await A(await q.deactivate())},[q,A]),P=F2.useCallback(async()=>{if(K)return;W(!0);try{await M(),L.current()}finally{W(!1)}},[K,M]),T=F2.useCallback(async()=>{Y.current=!1,G.current+=1,F.current=null,U.current=null,E1.getState().removeAttachment(J,H,z.current);try{await q.cancel()}finally{Y.current=!0}},[q,H,J]);return F2.useEffect(()=>{if(!$&&q.active)M()},[$,q.active,M]),{...D,continuing:K,continueInChat:P,prepareForSend:_,resetDocument:T}}var W5=O(c(),1);function Xu({ref:$,active:Z,builder:H,chatDocked:B,workspaceId:J,onEditingStart:Q,onContinueInChat:X,onOpenChat:z,onDiscard:G}){let F=Ju({active:Z&&H.status==="draft",builderId:H.id,sessionId:H.sessionId,sourceTab:R3(H.id),workspaceId:J,onEditingStart:Q,onContinueInChat:X});switch(Qu.useImperativeHandle($,()=>({prepareSketchForSend:F.prepareForSend,resetSketch:F.resetDocument}),[F.prepareForSend,F.resetDocument]),H.status){case"ready":return null;case"draft":case"waiting":case"building":return W5.jsx(rB0,{active:Z,chatDocked:B,error:H.error,sketch:F,status:H.status,onDiscard:G,onOpenChat:z})}}function rB0({active:$,chatDocked:Z,error:H,sketch:B,status:J,onDiscard:Q,onOpenChat:X}){let z=J==="draft";return W5.jsxs("div",{className:s("relative min-h-0 flex-1 overflow-hidden bg-background",$?"flex":"hidden"),children:[z&&W5.jsx(aB0,{chatDocked:Z,sketch:B}),W5.jsx("div",{inert:z?void 0:!0,className:s("absolute inset-0",J==="building"&&"pointer-events-none opacity-50",J==="waiting"&&"invisible"),children:W5.jsx(VG,{...B.layerProps,children:z&&W5.jsx(MG,{controls:B.controls,title:"Sketch the view",busy:B.continuing,onComplete:()=>void B.continueInChat()})})}),W5.jsx("div",{"aria-hidden":!0,className:s("pointer-events-none absolute inset-0 transition-shadow duration-500 ease-in-out",J==="building"&&"animate-glow texture-inset-shadow-50% motion-reduce:animate-none")}),J==="building"&&W5.jsx(oB0,{controls:B.controls}),J==="waiting"&&W5.jsx(nB0,{error:H,onDiscard:Q,onOpenChat:X})]})}function aB0({chatDocked:$,sketch:Z}){let{hasStrokes:H}=IB(Z.controls);return W5.jsx("div",{ref:Z.targetRef,className:"absolute inset-0 flex items-center justify-center texture-checker-20",children:!Z.controls.active&&!H&&W5.jsxs("div",{className:s("mb-4 flex h-full flex-col items-center justify-center gap-2 p-12 text-center text-sm text-muted-foreground","bg-radial from-background from-10% to-transparent",$?"w-full":"mr-auto w-[calc(100%-var(--chat-max))]"),children:[W5.jsx(uB,{size:56,stroke:0.5}),W5.jsx("span",{className:"max-w-32",children:"Sketch how the view should look"})]})})}function nB0({error:$,onDiscard:Z,onOpenChat:H}){return W5.jsx(zu,{children:W5.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 bg-radial from-background from-50% to-transparent to-75% p-12 text-center",children:[W5.jsxs("div",{className:"flex flex-col gap-1",children:[W5.jsx("h1",{className:"font-medium",children:"The view needs your attention"}),W5.jsx("p",{className:"text-sm text-muted-foreground",children:$??"Open the chat to answer or ask the agent to continue"})]}),W5.jsxs("div",{className:"flex gap-2",children:[W5.jsx(C0,{onClick:H,children:"Open chat"}),W5.jsx(C0,{variant:"secondary",onClick:Z,children:"Discard view"})]})]})})}function oB0({controls:$}){let{hasStrokes:Z}=IB($);return W5.jsx(zu,{children:!Z&&W5.jsx(S4,{className:"size-6 text-muted-foreground"})})}function zu({children:$,className:Z}){return W5.jsx("div",{className:s("relative flex min-h-0 flex-1 items-center justify-center texture-checker-20",Z),children:$})}var _4=O(g(),1);function Gu($,{activeId:Z,available:H,now:B}){let J=[];if(Z!==null&&H.has(Z))J.push({id:Z,releasedAt:null});for(let Q of $){if(Q.id===Z||!H.has(Q.id))continue;let X=Q.releasedAt??B;if(B-X>=60000)continue;if(J.length>=4)break;J.push({id:Q.id,releasedAt:X})}return J}function Fu($,Z){let H=null;for(let{releasedAt:B}of $){if(B===null)continue;let J=B+60000;if(H===null||J<H)H=J}return H===null?null:Math.max(0,H-Z)}function Uu($,Z){return $.length===Z.length&&$.every((H,B)=>{let J=Z[B];return H.id===J.id&&H.releasedAt===J.releasedAt})}var T2=O(c(),1);function Ku({views:$,activeViewId:Z,params:H}){let B=sB0(Z,$),J=new Set(B.map((Q)=>Q.id));return T2.jsx("div",{className:s("relative min-h-0 flex-1 overflow-hidden",!Z&&"hidden"),children:$.filter((Q)=>J.has(Q.id)).map((Q)=>T2.jsx(tB0,{view:Q,active:Q.id===Z,params:H},Q.id))})}function sB0($,Z){let[H,B]=_4.useState([]),J=_4.useRef(Z);J.current=Z;let Q=Z.map((z)=>z.id).join(`
|
|
83
|
+
`),X=_4.useCallback(()=>{B((z)=>{let G=Gu(z,{activeId:$,available:new Set(J.current.map((F)=>F.id)),now:Date.now()});return Uu(z,G)?z:G})},[$]);return _4.useEffect(()=>{X()},[Q,X]),_4.useEffect(()=>{let z=Fu(H,Date.now());if(z===null)return;let G=setTimeout(X,z);return()=>clearTimeout(G)},[X,H]),H}function tB0({view:$,active:Z,params:H}){let B=H5(),J=Pw($.id),{current:Q,outgoing:X}=$J0(J,Z),[z,G]=_4.useState(H);if(Z&&z!==H)G(H);lU(WG("views",B,$.id),Q?.version??J.version,Z);let F=J.status==="error";return cU({kind:"view",enabled:Z&&Boolean(Q)&&!F,targets:[{id:$.id,revision:$.revision}]}),T2.jsxs(T2.Fragment,{children:[Z&&F&&T2.jsx("p",{className:"absolute inset-0 p-4 text-xs text-destructive",children:J.error}),Z&&!F&&!Q&&T2.jsx(ZJ0,{}),Q&&!F&&T2.jsxs(_4.Activity,{mode:Z?"visible":"hidden",children:[X&&T2.jsx(Yu,{view:$,build:X,params:z},X.version),T2.jsx(Yu,{view:$,build:Q,params:z,entering:X!==null,thumbnailTarget:!0},Q.version)]})]})}function Yu({view:$,build:Z,params:H,entering:B,thumbnailTarget:J}){let Q=H5();return T2.jsx("div",{"data-applet-thumbnail":J?`view:${$.id}`:void 0,"data-applet":NG("views",$.id),className:s("absolute inset-0 isolate overflow-auto",B&&"animate-in duration-200 ease-out blur-in-4 fade-in"),children:T2.jsx(OJ,{name:$.id,kind:"view",workspaceId:Q,resetKey:Z.version,children:T2.jsx(Z.Component,{params:H})})})}var eB0=200;function $J0($,Z){let[H,B]=_4.useState({current:null,outgoing:null});if($.status==="ready"&&H.current?.version!==$.version){let J={Component:$.Component,version:$.version};B((Q)=>({current:J,outgoing:Z?Q.current:null}))}return _4.useEffect(()=>{if(!H.outgoing)return;let J=setTimeout(()=>B((Q)=>({...Q,outgoing:null})),eB0);return()=>clearTimeout(J)},[H.outgoing]),H}function ZJ0(){return T2.jsx("div",{className:"absolute inset-0 flex animate-in items-center justify-center delay-150 duration-200 fill-mode-both fade-in",children:T2.jsx(S4,{className:"text-muted-foreground"})})}function Wu(){let $=$1(),{workspaceId:Z,layout:H}=K5(),[,B]=F3(),J=G9(Z).data,Q=ip(Z),X=rp(Z),z=ap(Z),G=np(Z);return{create:()=>Q.mutateAsync(),save:(W,N)=>X.mutateAsync({builderId:W,requirements:N}),submit:async(W,N)=>{let L=N.trim(),V=OY(Z,W.sessionId);if(!L&&V.length===0)return;CY({queryClient:$,workspaceId:Z,sessionId:W.sessionId,text:L,filenames:V.map((T)=>T.name)});let A=jY(V);if(L)A.push({type:"text",text:L});let D=TY({queryClient:$,workspaceId:Z,sessionId:W.sessionId,parts:A});B(W.sessionId);let{model:q,effort:_,fastMode:M,stream:P}=wY(J,H.selectedModel,H.selectedEffort,H.selectedFastMode);try{await z.mutateAsync({builderId:W.id,requirements:L,optimisticId:D,...V.length>0?{attachments:V.map((T)=>T.upload.id)}:{},model:q,effort:_,fastMode:M,stream:P}),E1.getState().clearAttachments(Z,W.sessionId)}catch(T){throw E1.getState().setActivity(Z,W.sessionId,"idle"),E1.getState().setError(Z,W.sessionId,T instanceof Error?T.message:"Could not start view builder"),T}},discard:(W)=>G.mutateAsync(W)}}var P9=O(g(),1);function Nu({builders:$,onSave:Z}){let H=P9.useRef(new Map),B=P9.useRef($),J=P9.useRef(Z);B.current=$,J.current=Z;let Q=P9.useCallback((z)=>{let G=H.current.get(z);if(G)clearTimeout(G);H.current.delete(z),j5.getState().setViewBuilderDraft(z,null)},[]),X=P9.useCallback((z,G)=>{j5.getState().setViewBuilderDraft(z,G);let F=H.current.get(z);if(F)clearTimeout(F);H.current.set(z,setTimeout(()=>{H.current.delete(z);let U=B.current.find((Y)=>Y.id===z);if(!U||U.status!=="draft")return;J.current(z,G).catch(()=>{r4.add({title:"Couldn’t save view description",type:"error"})})},500))},[]);return P9.useEffect(()=>{for(let z of $)if(z.status!=="draft")Q(z.id)},[$,Q]),P9.useEffect(()=>()=>{for(let z of H.current.values())clearTimeout(z)},[]),{change:X,clear:Q}}var nZ=O(g(),1);function mD($){let Z=document.documentElement,H=getComputedStyle(Z).getPropertyValue($).trim(),B=Number.parseFloat(H);if(!Number.isFinite(B))return 0;return H.endsWith("rem")?B*Number.parseFloat(getComputedStyle(Z).fontSize):B}function Lu(){let $=nZ.useRef(null),[Z,H]=nZ.useState(null);return nZ.useLayoutEffect(()=>{let B=$.current;if(!B)return;let J=(X)=>{let z=mD("--column-w"),G=mD("--chat-min"),F=mD("--chat-max"),U={fits:X-G>=z,workspaceMinWidth:z,chatMinWidth:G,chatMaxWidth:F};H((Y)=>Y?.fits===U.fits&&Y.workspaceMinWidth===U.workspaceMinWidth&&Y.chatMinWidth===U.chatMinWidth&&Y.chatMaxWidth===U.chatMaxWidth?Y:U)};J(B.getBoundingClientRect().width);let Q=()=>J(B.getBoundingClientRect().width);return window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)},[]),{ref:$,fits:Z?.fits??!1,constraints:Z?{workspaceMinWidth:Z.workspaceMinWidth,chatMinWidth:Z.chatMinWidth,chatMaxWidth:Z.chatMaxWidth}:null}}var Au=O(c(),1);function pD({agentUnavailable:$,chatError:Z,skillUpdate:H}){return $??Z??H}function I7({className:$,...Z}){return Au.jsx("div",{...Z,className:s("w-full p-2 text-sm @xl:p-1 @xl:pl-3",$)})}var oZ=O(c(),1);function Vu({error:$,onDismiss:Z}){return oZ.jsxs(I7,{role:"alert",className:"flex items-center gap-2 text-destructive",children:[oZ.jsx("span",{className:"flex-1 wrap-break-word",children:$}),oZ.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,className:"text-destructive hover:text-destructive","aria-label":"Dismiss error",children:oZ.jsx(S5,{stroke:1.75})})]})}var cJ=O(g(),1);var a9=O(c(),1);function qu({availability:$,login:Z,onStartLogin:H}){let[B,J]=cJ.useState("idle"),[Q,X]=cJ.useState(null);cJ.useEffect(()=>{if(Z?.state!=="pending")J("idle")},[Z?.state]);let z=Z?.state==="pending"||B==="waiting",G=Z?.state==="failed"?Z.reason:null,F=z||B==="starting",U=async()=>{let Y=window.open("about:blank","moi-agent-login");if(Y)Y.opener=null;J("starting"),X(null);try{let K=await H();if(K.url){if(!Y)throw Error("Allow pop-ups, then try again");Y.location.href=K.url}else Y?.close();J("waiting")}catch(K){Y?.close(),J("idle"),X(K instanceof Error?K.message:"Could not start sign-in")}};return a9.jsxs(I7,{role:"alert",className:"flex items-center gap-2",children:[a9.jsx(Du,{size:20,stroke:1.5}),a9.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[a9.jsx("div",{className:"wrap-break-word",children:"Log in to your agent to send messages"}),(Q??G)&&a9.jsx("div",{className:"wrap-break-word text-destructive",children:Q??G})]}),$.loginCommand&&a9.jsxs(C0,{type:"button",size:"sm",onClick:()=>void U(),disabled:F,children:[F&&a9.jsx(I5,{stroke:1.75,className:"animate-spin"}),B==="starting"?"Opening browser to sign in…":z?"Waiting for log in…":"Log in"]})]})}var C2=O(c(),1);function Pu({error:$,pendingAction:Z,onUpdate:H,onDismiss:B}){if(!$&&Z==="auto")return C2.jsxs(I7,{role:"status",className:"flex items-center gap-1.5 text-muted-foreground",children:[C2.jsx(I5,{size:20,stroke:1.5,className:"shrink-0 animate-spin"}),C2.jsx("span",{className:"wrap-break-word",children:"Updating moi skills…"})]});let J=Z!==null;return C2.jsxs(I7,{role:$?"alert":"status",className:s("grid grid-cols-[minmax(0,1fr)_auto] gap-x-2 gap-y-2","@xl:flex @xl:items-center",$&&"text-destructive"),children:[C2.jsxs("div",{className:"flex min-w-0 items-start gap-1.5 @xl:order-1 @xl:flex-1 @xl:items-center",children:[C2.jsx(Mu,{size:20,stroke:1.5,className:"shrink-0"}),$?C2.jsx("span",{className:"wrap-break-word",children:`Update failed: ${$}`}):C2.jsx("span",{className:"wrap-break-word",children:"This workspace is using old moi skills"})]}),C2.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:B,className:"col-start-2 row-start-1 -mt-1 -mr-1 text-muted-foreground hover:text-foreground @xl:order-4 @xl:m-0","aria-label":"Dismiss skill update",children:C2.jsx(S5,{stroke:1.75})}),C2.jsxs("div",{className:"col-span-2 flex flex-wrap gap-1.5 @xl:contents",children:[C2.jsxs(C0,{type:"button",variant:"default",size:"sm",onClick:()=>H("auto"),disabled:J,className:"@xl:order-2",children:[Z==="auto"&&C2.jsx(I5,{stroke:1.75,className:"animate-spin"}),Z==="auto"?"Updating…":"Auto-update"]}),C2.jsxs(C0,{type:"button",variant:"secondary",size:"sm",onClick:()=>H("once"),disabled:J,className:"@xl:order-3",children:[Z==="once"&&C2.jsx(I5,{stroke:1.75,className:"animate-spin"}),Z==="once"?"Updating…":"Update once"]})]})]})}var G6=O(g(),1);function uD($){return{workspaceId:$,phase:"idle",pendingAction:null,error:null}}function HJ0($){return $.phase==="active"||$.phase==="idle"&&$.updateAvailable&&!$.autoUpdateEnabled}function BJ0($){return $.updateAvailable&&$.autoUpdateEnabled&&!$.updatePending&&$.phase==="idle"}function _u($){let Z=Tw($),{isPending:H,mutate:B,reset:J}=Cw($),Q=Sf(),{mutate:X}=If(),z=Q.data!==void 0,G=Q.data?.autoUpdateSkills??!1,F=G6.useCallback(()=>X({autoUpdateSkills:!0}),[X]),[U,Y]=G6.useState(()=>uD($)),K=U.workspaceId===$?U:uD($);G6.useEffect(()=>{Y(uD($)),J()},[$,J]);let W=G6.useCallback((V)=>{if(H)return;if(V==="auto")F();Y({workspaceId:$,phase:"active",pendingAction:V,error:null}),B(void 0,{onSuccess:()=>{Y((A)=>A.workspaceId===$?{...A,phase:"dismissed",pendingAction:null,error:null}:A)},onError:(A)=>{Y((D)=>D.workspaceId===$&&D.phase!=="dismissed"?{...D,phase:"active",pendingAction:null,error:A.message}:D)}})},[F,H,B,$]),N=Z.data?.updateAvailable??!1;return G6.useEffect(()=>{if(z&&BJ0({updateAvailable:N,autoUpdateEnabled:G,updatePending:H,phase:K.phase}))W("auto")},[G,K.phase,W,z,N,H]),{bannerProps:z&&HJ0({updateAvailable:N,autoUpdateEnabled:G,phase:K.phase})?{error:K.error,pendingAction:K.pendingAction,onUpdate:W,onDismiss:()=>{Y((V)=>V.workspaceId===$?{...V,phase:"dismissed",pendingAction:null,error:null}:V)}}:null}}var EY=O(c(),1);function Ou($,{chatError:Z,onDismissChatError:H}){let{data:B,error:J}=G9($),Q=B?.availability,{bannerProps:X}=_u($),z=Q?.available===!1?Q:void 0;if(J)z={available:!1,reason:`Could not check agent status: ${J.message}`};let G={status:"checking"};if(z)G={status:"unavailable"};else if(Q)G={status:"available"};let F=z?{tone:"default",content:EY.jsx(qu,{availability:z,login:B?.login,onStartLogin:()=>jw($)})}:void 0,U=Z?{tone:"error",content:EY.jsx(Vu,{error:Z,onDismiss:H})}:void 0,Y=X?{tone:"default",content:EY.jsx(Pu,{...X})}:void 0,K=pD({agentUnavailable:F,chatError:U,skillUpdate:Y}),W=pD({agentUnavailable:F,skillUpdate:Y});return{composerAvailability:G,composerBanner:K,builderComposerBanner:W}}var cD=hN();function SY($){if(!$||!Array.isArray($.open))return cD;let Z=$.open.filter((H,B,J)=>J.indexOf(H)===B);if(Z.length===0)return cD;return{open:Z,active:Z.includes($.active)?$.active:Z[0]}}function dJ($,Z,H){if($==="agent"||$==="widgets"||$==="scratchpad")return!0;let B=B7($);if(B)return H.some((Q)=>Q.id===B);let J=I3($);return J?Z.some((Q)=>Q.id===J):!1}function IY($,Z,H){let B=$.open.filter((J)=>dJ(J,Z,H));return B.length>0?B:cD.open}function ju($){if(!$)return!1;let Z=EB($);return Z===null||I3(Z)!==null}function Tu($,Z,H,B,J){if($!==null&&dJ($,H,B)&&!(J&&$==="agent"))return $;let Q=IY(Z,H,B),X=J?Q.filter((z)=>z!=="agent"):Q;return X.includes(Z.active)?Z.active:X[0]??"agent"}var _9=O(g(),1);function Cu({views:$,builders:Z,split:H}){let{layout:B,setLayout:J,workspaceId:Q}=K5(),[,X]=p4(),z=JK()["*"]??null,G=lq(),F=_9.useMemo(()=>Yw(G),[G]),U=SY(B.tabs),Y=_9.useRef(U);Y.current=U;let K=EB(z),W=Tu(K,U,$,Z,H),N=K!==null&&K===W,L=_9.useCallback((A,D)=>{X(Uw(Q,A),{replace:!0,...D?{state:{appletParams:D}}:{}})},[X,Q]),V=_9.useCallback((A)=>{Y.current=A,J({tabs:A})},[J]);return _9.useEffect(()=>{if(z===W)return;if(ju(z))JJ0(Q,z,W);L(W)},[W,L,z,Q]),_9.useEffect(()=>{if(!N)return;let A=Y.current,D=A.open.includes(W)?A.open:[...A.open,W];if(D===A.open&&A.active===W)return;V({open:D,active:W})},[W,V,N]),{tabsState:U,activeTab:W,appletParams:F,navigateToTab:L,setTabs:V}}function JJ0($,Z,H){let B=EB(Z),J=B?I3(B):null;D8($,{source:"runtime",...J?{kind:"view",name:J}:{},message:`Tab "${Z}" does not exist in this workspace — the URL redirected to "${H}". A link, bookmark, or focusTab call is pointing at a tab that was deleted or renamed.`})}var D5=O(c(),1),QJ0=Eu([u6({variant:"ghost",size:"sm"}),"group/tab min-w-0"],{variants:{active:{true:"bg-accent text-accent-foreground"},dragging:{true:"invisible"},preview:{true:"cursor-grabbing ring-1 ring-border"}},compoundVariants:[{preview:!0}]});function XJ0({items:$}){return D5.jsxs(e$,{children:[D5.jsx($Z,{render:D5.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:D5.jsx(K4,{stroke:1.75})})}),D5.jsx(ZZ,{align:"start",className:"min-w-48",children:D5.jsx(HZ,{children:$.map((Z)=>D5.jsxs(xB,{onClick:Z.onClick,className:"font-medium",children:[D5.jsx(Z.Icon,{stroke:2}),Z.label]},Z.key))})})]})}function wu($){let{tab:Z,active:H}=$,B=$.preview===!0;return D5.jsxs("button",{type:"button","aria-hidden":B||void 0,"aria-label":Z.label,disabled:B,tabIndex:B?-1:void 0,onClick:$.preview?void 0:()=>$.onSelect(Z.key),className:QJ0({active:H,dragging:$.preview?!1:$.state.isDragging,preview:B}),...$.preview?{}:$.state.dragHandleProps,children:[D5.jsxs("div",{className:s("flex items-center gap-1 overflow-hidden select-none",Z.closable&&"group-hover/tab:mr-3"),children:[Z.loading?D5.jsx(S4,{"data-icon":"inline-start"}):D5.jsx(Z.Icon,{"data-icon":"inline-start",stroke:2}),D5.jsx("span",{className:s("truncate",Z.closable&&"group-hover/tab:-mr-3 group-hover/tab:mask-r-from-[calc(100%-24px)] group-hover/tab:mask-r-to-[calc(100%-12px)]"),children:Z.label})]}),Z.closable&&D5.jsx("div",{"aria-label":`Close ${Z.label}`,tabIndex:B?-1:void 0,className:s("absolute right-2 hidden size-3 items-center justify-center text-muted-foreground group-hover/tab:flex hover:text-foreground",B&&"pointer-events-none"),onClick:$.preview?void 0:(J)=>{J.stopPropagation(),$.onClose(Z.key)},children:D5.jsx(S5,{stroke:1.75})})]})}function Su({tabs:$,active:Z,createItems:H,onSelect:B,onClose:J,onReorder:Q}){return D5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[D5.jsx("div",{className:"no-scrollbar min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:D5.jsx(Uz,{items:$,getId:(X)=>X.key,className:"flex w-max items-center gap-1",onReorder:(X)=>Q(X),renderPlaceholder:()=>D5.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-md bg-muted"}),renderOverlay:(X)=>D5.jsx(wu,{tab:X,active:Z===X.key,preview:!0}),renderItem:(X,z)=>D5.jsx(wu,{tab:X,active:Z===X.key,state:z,onSelect:B,onClose:J})})}),D5.jsx("div",{className:"shrink-0",children:D5.jsx(XJ0,{items:H})})]})}var Y6=O(g(),1);var ZH=O(c(),1),q1=O(g(),1);function zJ0($,Z){let H=getComputedStyle($),B=parseFloat(H.fontSize);return Z*B}function GJ0($,Z){let H=getComputedStyle($.ownerDocument.documentElement),B=parseFloat(H.fontSize);return Z*B}function FJ0($){return $/100*window.innerHeight}function UJ0($){return $/100*window.innerWidth}function YJ0($){switch(typeof $){case"number":return[$,"px"];case"string":{let Z=parseFloat($);return $.endsWith("%")?[Z,"%"]:$.endsWith("px")?[Z,"px"]:$.endsWith("rem")?[Z,"rem"]:$.endsWith("em")?[Z,"em"]:$.endsWith("vh")?[Z,"vh"]:$.endsWith("vw")?[Z,"vw"]:[Z,"%"]}}}function lJ({groupSize:$,panelElement:Z,styleProp:H}){let B,[J,Q]=YJ0(H);switch(Q){case"%":{B=J/100*$;break}case"px":{B=J;break}case"rem":{B=GJ0(Z,J);break}case"em":{B=zJ0(Z,J);break}case"vh":{B=FJ0(J);break}case"vw":{B=UJ0(J);break}}return B}function X4($){return parseFloat($.toFixed(3))}function HH({group:$}){let{orientation:Z,panels:H}=$;return H.reduce((B,J)=>(B+=Z==="horizontal"?J.element.offsetWidth:J.element.offsetHeight,B),0)}function lD($){let{panels:Z}=$,H=HH({group:$});return H===0?Z.map((B)=>({groupResizeBehavior:B.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:B.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:B.panelConstraints.disabled,minSize:0,maxSize:100,panelId:B.id})):Z.map((B)=>{let{element:J,panelConstraints:Q}=B,X=0;if(Q.collapsedSize!==void 0){let U=lJ({groupSize:H,panelElement:J,styleProp:Q.collapsedSize});X=X4(U/H*100)}let z;if(Q.defaultSize!==void 0){let U=lJ({groupSize:H,panelElement:J,styleProp:Q.defaultSize});z=X4(U/H*100)}let G=0;if(Q.minSize!==void 0){let U=lJ({groupSize:H,panelElement:J,styleProp:Q.minSize});G=X4(U/H*100)}let F=100;if(Q.maxSize!==void 0){let U=lJ({groupSize:H,panelElement:J,styleProp:Q.maxSize});F=X4(U/H*100)}return{groupResizeBehavior:Q.groupResizeBehavior,collapsedSize:X,collapsible:Q.collapsible===!0,defaultSize:z,disabled:Q.disabled,minSize:G,maxSize:F,panelId:B.id}})}function z5($,Z="Assertion error"){if(!$)throw Error(Z)}function iD($,Z){return Array.from(Z).sort($==="horizontal"?KJ0:WJ0)}function KJ0($,Z){let H=$.element.offsetLeft-Z.element.offsetLeft;return H!==0?H:$.element.offsetWidth-Z.element.offsetWidth}function WJ0($,Z){let H=$.element.offsetTop-Z.element.offsetTop;return H!==0?H:$.element.offsetHeight-Z.element.offsetHeight}function ru($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.ELEMENT_NODE}function au($,Z){return{x:$.x>=Z.left&&$.x<=Z.right?0:Math.min(Math.abs($.x-Z.left),Math.abs($.x-Z.right)),y:$.y>=Z.top&&$.y<=Z.bottom?0:Math.min(Math.abs($.y-Z.top),Math.abs($.y-Z.bottom))}}function NJ0({orientation:$,rects:Z,targetRect:H}){let B={x:H.x+H.width/2,y:H.y+H.height/2},J,Q=Number.MAX_VALUE;for(let X of Z){let{x:z,y:G}=au(B,X),F=$==="horizontal"?z:G;F<Q&&(Q=F,J=X)}return z5(J,"No rect found"),J}var RY;function LJ0(){return RY===void 0&&(typeof matchMedia=="function"?RY=!!matchMedia("(pointer:coarse)").matches:RY=!1),RY}function nu($){let{element:Z,orientation:H,panels:B,separators:J}=$,Q=iD(H,Array.from(Z.children).filter(ru).map((N)=>({element:N}))).map(({element:N})=>N),X=[],z=!1,G=!1,F=-1,U=-1,Y=0,K,W=[];{let N=-1;for(let L of Q)L.hasAttribute("data-panel")&&(N++,L.hasAttribute("data-disabled")||(Y++,F===-1&&(F=N),U=N))}if(Y>1){let N=-1;for(let L of Q)if(L.hasAttribute("data-panel")){N++;let V=B.find((A)=>A.element===L);if(V){if(K){let A=K.element.getBoundingClientRect(),D=L.getBoundingClientRect(),q;if(G){let _=H==="horizontal"?new DOMRect(A.right,A.top,0,A.height):new DOMRect(A.left,A.bottom,A.width,0),M=H==="horizontal"?new DOMRect(D.left,D.top,0,D.height):new DOMRect(D.left,D.top,D.width,0);switch(W.length){case 0:{q=[_,M];break}case 1:{let P=W[0],T=NJ0({orientation:H,rects:[A,D],targetRect:P.element.getBoundingClientRect()});q=[P,T===A?M:_];break}default:{q=W;break}}}else W.length?q=W:q=[H==="horizontal"?new DOMRect(A.right,D.top,D.left-A.right,D.height):new DOMRect(D.left,A.bottom,D.width,D.top-A.bottom)];for(let _ of q){let M="width"in _?_:_.element.getBoundingClientRect(),P=LJ0()?$.resizeTargetMinimumSize.coarse:$.resizeTargetMinimumSize.fine;if(M.width<P){let R=P-M.width;M=new DOMRect(M.x-R/2,M.y,M.width+R,M.height)}if(M.height<P){let R=P-M.height;M=new DOMRect(M.x,M.y-R/2,M.width,M.height+R)}let T=N<=F||N>U;!z&&!T&&X.push({group:$,groupSize:HH({group:$}),panels:[K,V],separator:"width"in _?void 0:_,rect:M}),z=!1}}G=!1,K=V,W=[]}}else if(L.hasAttribute("data-separator")){L.ariaDisabled!==null&&(z=!0);let V=J.find((A)=>A.element===L);V?W.push(V):(K=void 0,W=[])}else G=!0}return X}class rD{#$={};addListener($,Z){let H=this.#$[$];return H===void 0?this.#$[$]=[Z]:H.includes(Z)||H.push(Z),()=>{this.removeListener($,Z)}}emit($,Z){let H=this.#$[$];if(H!==void 0)if(H.length===1)H[0].call(null,Z);else{let B=!1,J=null,Q=Array.from(H);for(let X=0;X<Q.length;X++){let z=Q[X];try{z.call(null,Z)}catch(G){J===null&&(B=!0,J=G)}}if(B)throw J}}removeAllListeners(){this.#$={}}removeListener($,Z){let H=this.#$[$];if(H!==void 0){let B=H.indexOf(Z);B>=0&&H.splice(B,1)}}}var eZ={cursorFlags:0,state:"inactive"},aD=new rD;function k7(){return eZ}function AJ0($){return aD.addListener("change",$)}function VJ0($){let Z=eZ,H={...eZ};H.cursorFlags=$,eZ=H,aD.emit("change",{prev:Z,next:H})}function $H($){let Z=eZ;eZ=$,aD.emit("change",{prev:Z,next:$})}var DJ0=($)=>$,dD=()=>{},ou=1,su=2,tu=4,eu=8,Iu=3,Ru=12,kY;function ku(){return kY===void 0&&(kY=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(kY=!0)),kY}function qJ0({cursorFlags:$,groups:Z,state:H}){let B=0,J=0;switch(H){case"active":case"hover":Z.forEach((Q)=>{if(!Q.mutableState.disableCursor)switch(Q.orientation){case"horizontal":{B++;break}case"vertical":{J++;break}}})}if(!(B===0&&J===0)){switch(H){case"active":{if($&&ku()){let Q=($&ou)!==0,X=($&su)!==0,z=($&tu)!==0,G=($&eu)!==0;if(Q)return z?"se-resize":G?"ne-resize":"e-resize";if(X)return z?"sw-resize":G?"nw-resize":"w-resize";if(z)return"s-resize";if(G)return"n-resize"}break}}return ku()?B>0&&J>0?"move":B>0?"ew-resize":"ns-resize":B>0&&J>0?"grab":B>0?"col-resize":"row-resize"}}var bu=new WeakMap;function nD($){if($.defaultView===null||$.defaultView===void 0)return;let{prevStyle:Z,styleSheet:H}=bu.get($)??{};H===void 0&&(H=new $.defaultView.CSSStyleSheet,$.adoptedStyleSheets&&(Object.isExtensible($.adoptedStyleSheets)?$.adoptedStyleSheets.push(H):$.adoptedStyleSheets=[...$.adoptedStyleSheets,H]));let B=k7();switch(B.state){case"active":case"hover":{let J=qJ0({cursorFlags:B.cursorFlags,groups:B.hitRegions.map((X)=>X.group),state:B.state}),Q=`*, *:hover {cursor: ${J} !important; }`;if(Z===Q)return;Z=Q,J?H.cssRules.length===0?H.insertRule(Q):H.replaceSync(Q):H.cssRules.length===1&&H.deleteRule(0);break}case"inactive":{Z=void 0,H.cssRules.length===1&&H.deleteRule(0);break}}bu.set($,{prevStyle:Z,styleSheet:H})}var j9=new Map,$c=new rD;function MJ0($){j9=new Map(j9),j9.delete($)}function yu($,Z){for(let[H]of j9)if(H.id===$)return H}function F6($,Z){for(let[H,B]of j9)if(H.id===$)return B;if(Z)throw Error(`Could not find data for Group with id ${$}`)}function h7(){return j9}function oD($,Z){return $c.addListener("groupChange",(H)=>{H.group.id===$&&Z(H)})}function n9($,Z,H){let B=j9.get($);j9=new Map(j9),j9.set($,Z),$c.emit("groupChange",{group:$,isUserInteraction:H?.isUserInteraction===!0,prev:B,next:Z})}function Zc($){let Z=k7(),H=!1;switch(Z.state){case"active":$H({cursorFlags:0,state:"inactive"}),Z.hitRegions.length>0&&(nD($),H=!0,Z.hitRegions.forEach((B)=>{let J=F6(B.group.id,!0);n9(B.group,J,{isUserInteraction:!0})}))}return H}function hu($){$.defaultPrevented||Zc($.currentTarget)}function PJ0($,Z,H){let B,J={x:1/0,y:1/0};for(let Q of Z){let X=au(H,Q.rect);switch($){case"horizontal":{X.x<=J.x&&(B=Q,J=X);break}case"vertical":{X.y<=J.y&&(B=Q,J=X);break}}}return B?{distance:J,hitRegion:B}:void 0}function _J0($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function OJ0($,Z){if($===Z)throw Error("Cannot compare node with itself");let H={a:gu($),b:gu(Z)},B;for(;H.a.at(-1)===H.b.at(-1);)B=H.a.pop(),H.b.pop();z5(B,"Stacking order can only be calculated for elements with a common ancestor");let J={a:vu(xu(H.a)),b:vu(xu(H.b))};if(J.a===J.b){let Q=B.childNodes,X={a:H.a.at(-1),b:H.b.at(-1)},z=Q.length;for(;z--;){let G=Q[z];if(G===X.a)return 1;if(G===X.b)return-1}}return Math.sign(J.a-J.b)}var jJ0=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function TJ0($){let Z=getComputedStyle(Hc($)??$).display;return Z==="flex"||Z==="inline-flex"}function CJ0($){let Z=getComputedStyle($);return!!(Z.position==="fixed"||Z.zIndex!=="auto"&&(Z.position!=="static"||TJ0($))||+Z.opacity<1||("transform"in Z)&&Z.transform!=="none"||("webkitTransform"in Z)&&Z.webkitTransform!=="none"||("mixBlendMode"in Z)&&Z.mixBlendMode!=="normal"||("filter"in Z)&&Z.filter!=="none"||("webkitFilter"in Z)&&Z.webkitFilter!=="none"||("isolation"in Z)&&Z.isolation==="isolate"||jJ0.test(Z.willChange)||Z.webkitOverflowScrolling==="touch")}function xu($){let Z=$.length;for(;Z--;){let H=$[Z];if(z5(H,"Missing node"),CJ0(H))return H}return null}function vu($){return $&&Number(getComputedStyle($).zIndex)||0}function gu($){let Z=[];for(;$;)Z.push($),$=Hc($);return Z}function Hc($){let{parentNode:Z}=$;return _J0(Z)?Z.host:Z}function wJ0($,Z){return $.x<Z.x+Z.width&&$.x+$.width>Z.x&&$.y<Z.y+Z.height&&$.y+$.height>Z.y}function EJ0({groupElement:$,hitRegion:Z,pointerEventTarget:H}){if(!ru(H)||H.contains($)||$.contains(H))return!0;if(OJ0(H,$)>0){let B=H;for(;B;){if(B.contains($))return!0;if(wJ0(B.getBoundingClientRect(),Z))return!1;B=B.parentElement}}return!0}function sD($,Z){let H=[];return Z.forEach((B,J)=>{if(J.disabled)return;let Q=nu(J),X=PJ0(J.orientation,Q,{x:$.clientX,y:$.clientY});X&&X.distance.x<=0&&X.distance.y<=0&&EJ0({groupElement:J.element,hitRegion:X.hitRegion.rect,pointerEventTarget:$.target})&&H.push(X.hitRegion)}),H}function SJ0($,Z){if($.length!==Z.length)return!1;for(let H=0;H<$.length;H++)if($[H]!=Z[H])return!1;return!0}function l2($,Z,H=0){return Math.abs(X4($)-X4(Z))<=H}function O9($,Z){return l2($,Z)?0:$>Z?1:-1}function tZ({overrideDisabledPanels:$,panelConstraints:Z,prevSize:H,size:B}){let{collapsedSize:J=0,collapsible:Q,disabled:X,maxSize:z=100,minSize:G=0}=Z;if(X&&!$)return H;if(O9(B,G)<0)if(Q){let F=(J+G)/2;O9(B,F)<0?B=J:B=G}else B=G;return B=Math.min(z,B),B=X4(B),B}function rJ({delta:$,initialLayout:Z,panelConstraints:H,pivotIndices:B,prevLayout:J,trigger:Q}){if(l2($,0))return Z;let X=Q==="imperative-api",z=Object.values(Z),G=Object.values(J),F=[...z],[U,Y]=B;z5(U!=null,"Invalid first pivot index"),z5(Y!=null,"Invalid second pivot index");let K=0;switch(Q){case"keyboard":{{let L=$<0?Y:U,V=H[L];z5(V,`Panel constraints not found for index ${L}`);let{collapsedSize:A=0,collapsible:D,minSize:q=0}=V;if(D){let _=z[L];if(z5(_!=null,`Previous layout not found for panel index ${L}`),l2(_,A)){let M=q-_;O9(M,Math.abs($))>0&&($=$<0?0-M:M)}}}{let L=$<0?U:Y,V=H[L];z5(V,`No panel constraints found for index ${L}`);let{collapsedSize:A=0,collapsible:D,minSize:q=0}=V;if(D){let _=z[L];if(z5(_!=null,`Previous layout not found for panel index ${L}`),l2(_,q)){let M=_-A;O9(M,Math.abs($))>0&&($=$<0?0-M:M)}}}break}default:{let L=$<0?Y:U,V=H[L];z5(V,`Panel constraints not found for index ${L}`);let A=z[L],{collapsible:D,collapsedSize:q,minSize:_}=V;if(D&&O9(A,_)<0)if($>0){let M=_-q,P=M/2,T=A+$;O9(T,_)<0&&($=O9($,P)<=0?0:M)}else{let M=_-q,P=100-M/2,T=A-$;O9(T,_)<0&&($=O9(100+$,P)>0?0:-M)}break}}{let L=$<0?1:-1,V=$<0?Y:U,A=0;for(;;){let q=z[V];z5(q!=null,`Previous layout not found for panel index ${V}`);let _=tZ({overrideDisabledPanels:X,panelConstraints:H[V],prevSize:q,size:100})-q;if(A+=_,V+=L,V<0||V>=H.length)break}let D=Math.min(Math.abs($),Math.abs(A));$=$<0?0-D:D}{let L=$<0?U:Y;for(;L>=0&&L<H.length;){let V=Math.abs($)-Math.abs(K),A=z[L];z5(A!=null,`Previous layout not found for panel index ${L}`);let D=A-V,q=tZ({overrideDisabledPanels:X,panelConstraints:H[L],prevSize:A,size:D});if(!l2(A,q)&&(K+=A-q,F[L]=q,K.toFixed(3).localeCompare(Math.abs($).toFixed(3),void 0,{numeric:!0})>=0))break;$<0?L--:L++}}if(SJ0(G,F))return J;{let L=$<0?Y:U,V=z[L];z5(V!=null,`Previous layout not found for panel index ${L}`);let A=V+K,D=tZ({overrideDisabledPanels:X,panelConstraints:H[L],prevSize:V,size:A});if(F[L]=D,!l2(D,A)){let q=A-D,_=$<0?Y:U;for(;_>=0&&_<H.length;){let M=F[_];z5(M!=null,`Previous layout not found for panel index ${_}`);let P=M+q,T=tZ({overrideDisabledPanels:X,panelConstraints:H[_],prevSize:M,size:P});if(l2(M,T)||(q-=T-M,F[_]=T),l2(q,0))break;$>0?_--:_++}}}let W=Object.values(F).reduce((L,V)=>V+L,0);if(!l2(W,100,0.1))return J;let N=Object.keys(J);return F.reduce((L,V,A)=>(L[N[A]]=V,L),{})}function b7($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let H in $)if(Z[H]===void 0||O9($[H],Z[H])!==0)return!1;return!0}function y7({layout:$,panelConstraints:Z}){let H=Object.values($),B=[...H],J=B.reduce((z,G)=>z+G,0);if(B.length!==Z.length)throw Error(`Invalid ${Z.length} panel layout: ${B.map((z)=>`${z}%`).join(", ")}`);if(!l2(J,100)&&B.length>0)for(let z=0;z<Z.length;z++){let G=B[z];z5(G!=null,`No layout data found for index ${z}`);let F=100/J*G;B[z]=F}let Q=0;for(let z=0;z<Z.length;z++){let G=H[z];z5(G!=null,`No layout data found for index ${z}`);let F=B[z];z5(F!=null,`No layout data found for index ${z}`);let U=tZ({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:F});F!=U&&(Q+=F-U,B[z]=U)}if(!l2(Q,0))for(let z=0;z<Z.length;z++){let G=B[z];z5(G!=null,`No layout data found for index ${z}`);let F=G+Q,U=tZ({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:F});if(G!==U&&(Q-=U-G,B[z]=U,l2(Q,0)))break}let X=Object.keys($);return B.reduce((z,G,F)=>(z[X[F]]=G,z),{})}function Bc({groupId:$,panelId:Z}){let H=()=>{let G=h7();for(let[F,{defaultLayoutDeferred:U,derivedPanelConstraints:Y,layout:K,groupSize:W,separatorToPanels:N}]of G)if(F.id===$)return{defaultLayoutDeferred:U,derivedPanelConstraints:Y,group:F,groupSize:W,layout:K,separatorToPanels:N};throw Error(`Group ${$} not found`)},B=()=>{let G=H().derivedPanelConstraints.find((F)=>F.panelId===Z);if(G!==void 0)return G;throw Error(`Panel constraints not found for Panel ${Z}`)},J=()=>{let G=H().group.panels.find((F)=>F.id===Z);if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},Q=()=>{let G=H().layout[Z];if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},X=({nextSize:G,panels:F,prevLayout:U,derivedPanelConstraints:Y})=>{let K=Q(),W=F.findIndex((V)=>V.id===Z),N=W===0,L=W===F.length-1;if(L&&G<K&&(N||F.slice(0,W).every((V,A)=>{let D=Y[A];return D?.collapsible&&l2(D.collapsedSize,U[D.panelId])}))){let V=F.slice(0,W).reduce((A,D)=>A+U[D.id],0);return{...U,[Z]:X4(100-V)}}return rJ({delta:L?K-G:G-K,initialLayout:U,panelConstraints:Y,pivotIndices:L?[W-1,W]:[W,W+1],prevLayout:U,trigger:"imperative-api"})},z=(G)=>{let F=Q();if(G===F)return;let{defaultLayoutDeferred:U,derivedPanelConstraints:Y,group:K,groupSize:W,layout:N,separatorToPanels:L}=H(),V=X({nextSize:G,panels:K.panels,prevLayout:N,derivedPanelConstraints:Y}),A=y7({layout:V,panelConstraints:Y});b7(N,A)||n9(K,{defaultLayoutDeferred:U,derivedPanelConstraints:Y,groupSize:W,layout:A,separatorToPanels:L})};return{collapse:()=>{let{collapsible:G,collapsedSize:F}=B(),{mutableValues:U}=J(),Y=Q();G&&Y!==F&&(U.expandToSize=Y,z(F))},expand:()=>{let{collapsible:G,collapsedSize:F,minSize:U}=B(),{mutableValues:Y}=J(),K=Q();if(G&&K===F){let W=Y.expandToSize??U;W===0&&(W=1),z(W)}},getSize:()=>{let{group:G}=H(),F=Q(),{element:U}=J(),Y=G.orientation==="horizontal"?U.offsetWidth:U.offsetHeight;return{asPercentage:F,inPixels:Y}},isCollapsed:()=>{let{collapsible:G,collapsedSize:F}=B(),U=Q();return G&&l2(F,U)},resize:(G)=>{let{group:F}=H(),{element:U}=J(),Y=HH({group:F}),K=lJ({groupSize:Y,panelElement:U,styleProp:G}),W=X4(K/Y*100);z(W)}}}function fu($){if($.defaultPrevented)return;let Z=h7();sD($,Z).forEach((H)=>{if(H.separator&&!H.separator.disableDoubleClick){let B=H.panels.find((J)=>J.panelConstraints.defaultSize!==void 0);if(B){let J=B.panelConstraints.defaultSize,Q=Bc({groupId:H.group.id,panelId:B.id});Q&&J!==void 0&&(Q.resize(J),$.preventDefault())}}})}function bY($){let Z=h7();for(let[H]of Z)if(H.separators.some((B)=>B.element===$))return H;throw Error("Could not find parent Group for separator element")}function Jc({groupId:$}){let Z=()=>{let H=h7();for(let[B,J]of H)if(B.id===$)return{group:B,...J};throw Error(`Could not find Group with id "${$}"`)};return{getLayout(){let{defaultLayoutDeferred:H,layout:B}=Z();return H?{}:B},setLayout(H){let{defaultLayoutDeferred:B,derivedPanelConstraints:J,group:Q,groupSize:X,layout:z,separatorToPanels:G}=Z(),F=y7({layout:H,panelConstraints:J});return B?z:(b7(z,F)||n9(Q,{defaultLayoutDeferred:B,derivedPanelConstraints:J,groupSize:X,layout:F,separatorToPanels:G}),F)}}}function R7($,Z){let H=bY($),B=F6(H.id,!0),J=H.separators.find((U)=>U.element===$);z5(J,"Matching separator not found");let Q=B.separatorToPanels.get(J);z5(Q,"Matching panels not found");let X=Q.map((U)=>H.panels.indexOf(U)),z=Jc({groupId:H.id}).getLayout(),G=rJ({delta:Z,initialLayout:z,panelConstraints:B.derivedPanelConstraints,pivotIndices:X,prevLayout:z,trigger:"keyboard"}),F=y7({layout:G,panelConstraints:B.derivedPanelConstraints});b7(z,F)||n9(H,{defaultLayoutDeferred:B.defaultLayoutDeferred,derivedPanelConstraints:B.derivedPanelConstraints,groupSize:B.groupSize,layout:F,separatorToPanels:B.separatorToPanels},{isUserInteraction:!0})}function mu($){if($.defaultPrevented)return;let Z=$.currentTarget,H=bY(Z);if(!H.disabled)switch($.key){case"ArrowDown":{$.preventDefault(),H.orientation==="vertical"&&R7(Z,5);break}case"ArrowLeft":{$.preventDefault(),H.orientation==="horizontal"&&R7(Z,-5);break}case"ArrowRight":{$.preventDefault(),H.orientation==="horizontal"&&R7(Z,5);break}case"ArrowUp":{$.preventDefault(),H.orientation==="vertical"&&R7(Z,-5);break}case"End":{$.preventDefault(),R7(Z,100);break}case"Enter":{$.preventDefault();let B=bY(Z),J=F6(B.id,!0),{derivedPanelConstraints:Q,layout:X,separatorToPanels:z}=J,G=B.separators.find((K)=>K.element===Z);z5(G,"Matching separator not found");let F=z.get(G);z5(F,"Matching panels not found");let U=F[0],Y=Q.find((K)=>K.panelId===U.id);if(z5(Y,"Panel metadata not found"),Y.collapsible){let K=X[U.id],W=Y.collapsedSize===K?B.mutableState.expandedPanelSizes[U.id]??Y.minSize:Y.collapsedSize;R7(Z,W-K)}break}case"F6":{$.preventDefault();let B=bY(Z).separators.map((X)=>X.element),J=Array.from(B).findIndex((X)=>X===$.currentTarget);z5(J!==null,"Index not found");let Q=$.shiftKey?J>0?J-1:B.length-1:J+1<B.length?J+1:0;B[Q].focus({preventScroll:!0});break}case"Home":{$.preventDefault(),R7(Z,-100);break}}}function pu($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;let Z=h7(),H=sD($,Z),B=new Map,J=!1;H.forEach((Q)=>{Q.separator&&(J||(J=!0,Q.separator.element.focus({focusVisible:!1,preventScroll:!0})));let X=Z.get(Q.group);X&&B.set(Q.group,X.layout)}),$H({cursorFlags:0,hitRegions:H,initialLayoutMap:B,pointerDownAtPoint:{x:$.clientX,y:$.clientY},state:"active"}),H.length&&$.preventDefault()}function Qc({document:$,event:Z,hitRegions:H,initialLayoutMap:B,mountedGroups:J,pointerDownAtPoint:Q,prevCursorFlags:X}){let z=0;H.forEach((F)=>{let{group:U,groupSize:Y}=F,{orientation:K,panels:W}=U,{disableCursor:N}=U.mutableState,L=0;Q?K==="horizontal"?L=(Z.clientX-Q.x)/Y*100:L=(Z.clientY-Q.y)/Y*100:K==="horizontal"?L=Z.clientX<0?-100:100:L=Z.clientY<0?-100:100;let V=B.get(U),A=J.get(U);if(!V||!A)return;let{defaultLayoutDeferred:D,derivedPanelConstraints:q,groupSize:_,layout:M,separatorToPanels:P}=A;if(q&&M&&P){let T=rJ({delta:L,initialLayout:V,panelConstraints:q,pivotIndices:F.panels.map((R)=>W.indexOf(R)),prevLayout:M,trigger:"mouse-or-touch"});if(b7(T,M)){if(L!==0&&!N)switch(K){case"horizontal":{z|=L<0?ou:su;break}case"vertical":{z|=L<0?tu:eu;break}}}else n9(F.group,{defaultLayoutDeferred:D,derivedPanelConstraints:q,groupSize:_,layout:T,separatorToPanels:P})}});let G=0;Z.movementX===0?G|=X&Iu:G|=z&Iu,Z.movementY===0?G|=X&Ru:G|=z&Ru,VJ0(G),nD($)}function uu($){let Z=h7(),H=k7();switch(H.state){case"active":Qc({document:$.currentTarget,event:$,hitRegions:H.hitRegions,initialLayoutMap:H.initialLayoutMap,mountedGroups:Z,prevCursorFlags:H.cursorFlags})}}function cu($){if($.defaultPrevented)return;let Z=k7(),H=h7();switch(Z.state){case"active":{if($.buttons===0){$H({cursorFlags:0,state:"inactive"}),Z.hitRegions.forEach((B)=>{let J=F6(B.group.id,!0);n9(B.group,J,{isUserInteraction:!0})});return}for(let B of Z.hitRegions)if(B.separator){let{element:J}=B.separator;J.hasPointerCapture?.($.pointerId)||J.setPointerCapture?.($.pointerId)}Qc({document:$.currentTarget,event:$,hitRegions:Z.hitRegions,initialLayoutMap:Z.initialLayoutMap,mountedGroups:H,pointerDownAtPoint:Z.pointerDownAtPoint,prevCursorFlags:Z.cursorFlags});break}default:{let B=sD($,H);B.length===0?Z.state!=="inactive"&&$H({cursorFlags:0,state:"inactive"}):$H({cursorFlags:0,hitRegions:B,state:"hover"}),nD($.currentTarget);break}}}function du($){if($.relatedTarget instanceof HTMLIFrameElement)switch(k7().state){case"hover":$H({cursorFlags:0,state:"inactive"})}}function lu($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;Zc($.currentTarget)&&$.preventDefault()}function iu($){let Z=0,H=0,B={};for(let Q of $)if(Q.defaultSize!==void 0){Z++;let X=X4(Q.defaultSize);H+=X,B[Q.panelId]=X}else B[Q.panelId]=void 0;let J=$.length-Z;if(J!==0){let Q=X4((100-H)/J);for(let X of $)X.defaultSize===void 0&&(B[X.panelId]=Q)}return B}function IJ0($,Z,H){if(!H[0])return;let B=$.panels.find((G)=>G.element===Z);if(!B||!B.onResize)return;let J=HH({group:$}),Q=$.orientation==="horizontal"?B.element.offsetWidth:B.element.offsetHeight,X=B.mutableValues.prevSize,z={asPercentage:X4(Q/J*100),inPixels:Q};B.mutableValues.prevSize=z,B.onResize(z,B.id,X)}function RJ0($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let H in $)if($[H]!==Z[H])return!1;return!0}function kJ0({group:$,nextGroupSize:Z,prevGroupSize:H,prevLayout:B}){if(H<=0||Z<=0||H===Z)return B;let J=0,Q=0,X=!1,z=new Map,G=[];for(let Y of $.panels){let K=B[Y.id]??0;switch(Y.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{X=!0;let W=K/100*H,N=X4(W/Z*100);z.set(Y.id,N),J+=N;break}case"preserve-relative-size":default:{G.push(Y.id),Q+=K;break}}}if(!X||G.length===0)return B;let F=100-J,U={...B};if(z.forEach((Y,K)=>{U[K]=Y}),Q>0)for(let Y of G){let K=B[Y]??0;U[Y]=X4(K/Q*F)}else{let Y=X4(F/G.length);for(let K of G)U[K]=Y}return U}function bJ0($,Z){let H=$.map((J)=>J.id),B=Object.keys(Z);if(H.length!==B.length)return!1;for(let J of H)if(!B.includes(J))return!1;return!0}var sZ=new Map;function yJ0($){let Z=!0;z5($.element.ownerDocument.defaultView,"Cannot register an unmounted Group");let H=$.element.ownerDocument.defaultView.ResizeObserver,B=new Set,J=new Set,Q=new H((N)=>{for(let L of N){let{borderBoxSize:V,target:A}=L;if(A===$.element){if(Z){let D=HH({group:$});if(D===0)return;let q=F6($.id);if(!q)return;let _=lD($),M=q.defaultLayoutDeferred?iu(_):q.layout,P=kJ0({group:$,nextGroupSize:D,prevGroupSize:q.groupSize,prevLayout:M}),T=y7({layout:P,panelConstraints:_});if(!q.defaultLayoutDeferred&&b7(q.layout,T)&&RJ0(q.derivedPanelConstraints,_)&&q.groupSize===D)return;n9($,{defaultLayoutDeferred:!1,derivedPanelConstraints:_,groupSize:D,layout:T,separatorToPanels:q.separatorToPanels})}}else IJ0($,A,V)}});Q.observe($.element),$.panels.forEach((N)=>{z5(!B.has(N.id),`Panel ids must be unique; id "${N.id}" was used more than once`),B.add(N.id),N.onResize&&Q.observe(N.element)});let X=HH({group:$}),z=lD($),G=$.panels.map(({id:N})=>N).join(","),F=$.mutableState.defaultLayout;F&&(bJ0($.panels,F)||(F=void 0));let U=$.mutableState.layouts[G]??F??iu(z),Y=y7({layout:U,panelConstraints:z}),K=$.element.ownerDocument;sZ.set(K,(sZ.get(K)??0)+1);let W=new Map;return nu($).forEach((N)=>{N.separator&&W.set(N.separator,N.panels)}),n9($,{defaultLayoutDeferred:X===0,derivedPanelConstraints:z,groupSize:X,layout:Y,separatorToPanels:W}),$.separators.forEach((N)=>{z5(!J.has(N.id),`Separator ids must be unique; id "${N.id}" was used more than once`),J.add(N.id),N.element.addEventListener("keydown",mu)}),sZ.get(K)===1&&(K.addEventListener("contextmenu",hu,!0),K.addEventListener("dblclick",fu,!0),K.addEventListener("pointerdown",pu,!0),K.addEventListener("pointerleave",uu),K.addEventListener("pointermove",cu),K.addEventListener("pointerout",du),K.addEventListener("pointerup",lu,!0)),function(){Z=!1,sZ.set(K,Math.max(0,(sZ.get(K)??0)-1)),MJ0($),$.separators.forEach((N)=>{N.element.removeEventListener("keydown",mu)}),sZ.get(K)||(K.removeEventListener("contextmenu",hu,!0),K.removeEventListener("dblclick",fu,!0),K.removeEventListener("pointerdown",pu,!0),K.removeEventListener("pointerleave",uu),K.removeEventListener("pointermove",cu),K.removeEventListener("pointerout",du),K.removeEventListener("pointerup",lu,!0)),Q.disconnect()}}function hJ0(){let[$,Z]=q1.useState({}),H=q1.useCallback(()=>Z({}),[]);return[$,H]}function tD($){let Z=q1.useId();return`${$??Z}`}var x7=typeof window<"u"?q1.useLayoutEffect:q1.useEffect;function iJ($){let Z=q1.useRef($);return x7(()=>{Z.current=$},[$]),q1.useCallback((...H)=>Z.current?.(...H),[Z])}function eD(...$){return iJ((Z)=>{$.forEach((H)=>{if(H)switch(typeof H){case"function":{H(Z);break}case"object":{H.current=Z;break}}})})}function $q($){let Z=q1.useRef({...$});return x7(()=>{for(let H in $)Z.current[H]=$[H]},[$]),Z.current}var Xc=q1.createContext(null);function xJ0($,Z){let H=q1.useRef({getLayout:()=>({}),setLayout:DJ0});q1.useImperativeHandle(Z,()=>H.current,[]),x7(()=>{Object.assign(H.current,Jc({groupId:$}))})}function Zq({children:$,className:Z,defaultLayout:H,disableCursor:B,disabled:J,elementRef:Q,groupRef:X,id:z,onLayoutChange:G,onLayoutChanged:F,orientation:U="horizontal",resizeTargetMinimumSize:Y={coarse:20,fine:10},style:K,...W}){let N=q1.useRef({onLayoutChange:{},onLayoutChanged:{}}),L=iJ((h)=>{b7(N.current.onLayoutChange,h)||(N.current.onLayoutChange=h,G?.(h))}),V=iJ((h,E)=>{b7(N.current.onLayoutChanged,h)||(N.current.onLayoutChanged=h,F?.(h,{isUserInteraction:E}))}),A=tD(z),D=q1.useRef(null),[q,_]=hJ0(),M=q1.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:Y,separators:[]}),P=eD(D,Q);xJ0(A,X);let T=iJ((h,E)=>{let I=k7(),j=yu(h),S=F6(h);if(S){let k=!1;switch(I.state){case"active":{k=I.hitRegions.some((b)=>b.group===j);break}}return{flexGrow:S.layout[E]??1,pointerEvents:k?"none":void 0}}if(H?.[E])return{flexGrow:H?.[E]}}),R=$q({defaultLayout:H,disableCursor:B}),y=q1.useMemo(()=>({get disableCursor(){return!!R.disableCursor},getPanelStyles:T,id:A,orientation:U,registerPanel:(h)=>{let E=M.current;return E.panels=iD(U,[...E.panels,h]),_(),()=>{E.panels=E.panels.filter((I)=>I!==h),_()}},registerSeparator:(h)=>{let E=M.current;return E.separators=iD(U,[...E.separators,h]),_(),()=>{E.separators=E.separators.filter((I)=>I!==h),_()}},updatePanelProps:(h,{disabled:E})=>{let I=M.current.panels.find((k)=>k.id===h);I&&(I.panelConstraints.disabled=E);let j=yu(A),S=F6(A);j&&S&&n9(j,{...S,derivedPanelConstraints:lD(j)})},updateSeparatorProps:(h,{disabled:E,disableDoubleClick:I})=>{let j=M.current.separators.find((S)=>S.id===h);j&&(j.disabled=E,j.disableDoubleClick=I)}}),[T,A,_,U,R]),w=q1.useRef(null);return x7(()=>{let h=D.current;if(h===null)return;let E=M.current,I;if(R.defaultLayout!==void 0&&Object.keys(R.defaultLayout).length===E.panels.length){I={};for(let C of E.panels){let t=R.defaultLayout[C.id];t!==void 0&&(I[C.id]=t)}}let j={disabled:!!J,element:h,id:A,mutableState:{defaultLayout:I,disableCursor:!!R.disableCursor,expandedPanelSizes:M.current.lastExpandedPanelSizes,layouts:M.current.layouts},orientation:U,panels:E.panels,resizeTargetMinimumSize:E.resizeTargetMinimumSize,separators:E.separators};w.current=j;let S=yJ0(j),{defaultLayoutDeferred:k,derivedPanelConstraints:b,layout:v}=F6(j.id,!0);!k&&b.length>0&&(L(v),V(v,!1));let u=oD(A,(C)=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:H0,layout:x}=C.next;if(t||H0.length===0)return;let e=j.panels.map(({id:d})=>d).join(",");j.mutableState.layouts[e]=x,H0.forEach((d)=>{if(d.collapsible){let{layout:X0}=C.prev??{};if(X0){let K0=l2(d.collapsedSize,x[d.panelId]),Q0=l2(d.collapsedSize,X0[d.panelId]);K0&&!Q0&&(j.mutableState.expandedPanelSizes[d.panelId]=X0[d.panelId])}}});let L0=k7().state!=="active";L(x),L0&&V(x,C.isUserInteraction)});return()=>{w.current=null,S(),u()}},[J,A,V,L,U,q,R]),q1.useEffect(()=>{let h=w.current;h&&(h.mutableState.defaultLayout=H,h.mutableState.disableCursor=!!B)}),ZH.jsx(Xc.Provider,{value:y,children:ZH.jsx("div",{...W,className:Z,"data-group":!0,"data-testid":A,id:A,ref:P,style:{height:"100%",width:"100%",overflow:"hidden",...K,display:"flex",flexDirection:U==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:U==="horizontal"?"pan-y":"pan-x"},children:$})})}Zq.displayName="Group";function Hq(){let $=q1.useContext(Xc);return z5($,"Group Context not found; did you render a Panel or Separator outside of a Group?"),$}function vJ0($,Z){let{id:H}=Hq(),B=q1.useRef({collapse:dD,expand:dD,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:dD});q1.useImperativeHandle(Z,()=>B.current,[]),x7(()=>{Object.assign(B.current,Bc({groupId:H,panelId:$}))})}function Bq({children:$,className:Z,collapsedSize:H="0%",collapsible:B=!1,defaultSize:J,disabled:Q,elementRef:X,groupResizeBehavior:z="preserve-relative-size",id:G,maxSize:F="100%",minSize:U="0%",onResize:Y,panelRef:K,style:W,...N}){let L=!!G,V=tD(G),A=$q({disabled:Q}),D=q1.useRef(null),q=eD(D,X),{getPanelStyles:_,id:M,orientation:P,registerPanel:T,updatePanelProps:R}=Hq(),y=Y!==null,w=iJ((j,S,k)=>{Y?.(j,G,k)});x7(()=>{let j=D.current;if(j!==null){let S={element:j,id:V,idIsStable:L,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:y?w:void 0,panelConstraints:{groupResizeBehavior:z,collapsedSize:H,collapsible:B,defaultSize:J,disabled:A.disabled,maxSize:F,minSize:U}};return T(S)}},[z,H,B,J,y,V,L,F,U,w,T,A]),q1.useEffect(()=>{R(V,{disabled:Q})},[Q,V,R]),vJ0(V,K);let h=()=>{let j=_(M,V);if(j)return JSON.stringify(j)},E=q1.useSyncExternalStore((j)=>oD(M,j),h,h),I;return E?I=JSON.parse(E):J!==void 0?I={flexGrow:void 0,flexShrink:void 0,flexBasis:J}:I={flexGrow:1},ZH.jsx("div",{...N,"data-disabled":Q||void 0,"data-panel":!0,"data-testid":V,id:V,ref:q,style:{...gJ0,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...I},children:ZH.jsx("div",{className:Z,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...W,touchAction:P==="horizontal"?"pan-y":"pan-x"},children:$})})}Bq.displayName="Panel";var gJ0={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function fJ0({layout:$,panelConstraints:Z,panelId:H,panelIndex:B}){let J,Q,X=$[H],z=Z.find((G)=>G.panelId===H);if(z){let G=z.maxSize,F=z.collapsible?z.collapsedSize:z.minSize,U=[B,B+1];Q=y7({layout:rJ({delta:F-X,initialLayout:$,panelConstraints:Z,pivotIndices:U,prevLayout:$}),panelConstraints:Z})[H],J=y7({layout:rJ({delta:G-X,initialLayout:$,panelConstraints:Z,pivotIndices:U,prevLayout:$}),panelConstraints:Z})[H]}return{valueControls:H,valueMax:J,valueMin:Q,valueNow:X}}function Jq({children:$,className:Z,disabled:H,disableDoubleClick:B,elementRef:J,id:Q,style:X,...z}){let G=tD(Q),F=$q({disabled:H,disableDoubleClick:B}),[U,Y]=q1.useState({}),[K,W]=q1.useState("inactive"),[N,L]=q1.useState(!1),V=q1.useRef(null),A=eD(V,J),{disableCursor:D,id:q,orientation:_,registerSeparator:M,updateSeparatorProps:P}=Hq(),T=_==="horizontal"?"vertical":"horizontal";x7(()=>{let w=V.current;if(w!==null){let h={disabled:F.disabled,disableDoubleClick:F.disableDoubleClick,element:w,id:G},E=M(h),I=AJ0((S)=>{W(S.next.state!=="inactive"&&S.next.hitRegions.some((k)=>k.separator===h)?S.next.state:"inactive")}),j=oD(q,(S)=>{let{derivedPanelConstraints:k,layout:b,separatorToPanels:v}=S.next,u=v.get(h);if(u){let C=u[0],t=u.indexOf(C);Y(fJ0({layout:b,panelConstraints:k,panelId:C.id,panelIndex:t}))}});return()=>{I(),j(),E()}}},[q,G,M,F]),q1.useEffect(()=>{P(G,{disabled:H,disableDoubleClick:B})},[H,B,G,P]);let R;H&&!D&&(R="not-allowed");let y;if(H)y="disabled";else switch(K){case"active":{y="active";break}default:N?y="focus":y=K}return ZH.jsx("div",{...z,"aria-controls":U.valueControls,"aria-disabled":H||void 0,"aria-orientation":T,"aria-valuemax":U.valueMax,"aria-valuemin":U.valueMin,"aria-valuenow":U.valueNow,children:$,className:Z,"data-separator":y,"data-testid":G,id:G,onBlur:()=>L(!1),onFocus:()=>L(!0),ref:A,role:"separator",style:{flexBasis:"auto",cursor:R,...X,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:H?void 0:0})}Jq.displayName="Separator";var aJ=O(c(),1);function zc({className:$,...Z}){return aJ.jsx(Zq,{"data-slot":"resizable-panel-group",className:s("flex h-full w-full aria-[orientation=vertical]:flex-col",$),...Z})}function Qq({...$}){return aJ.jsx(Bq,{"data-slot":"resizable-panel",...$})}function Gc({withHandle:$,className:Z,...H}){return aJ.jsx(Jq,{"data-slot":"resizable-handle",className:s("relative flex w-0 items-center justify-center ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-0 aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",Z),...H,children:$&&aJ.jsx("div",{className:"flex h-6 w-1 shrink-0 rounded-lg bg-border"})})}var U6=O(c(),1);function Fc({workspace:$,chat:Z,open:H,workspaceMinWidth:B,chatMinWidth:J,chatMaxWidth:Q,chatWidth:X,onCollapse:z,onChatWidthChange:G}){let F=Y6.useRef(null),U=Y6.useRef(null),[Y,K]=Y6.useState(!1),W=Math.min(Math.max(X,J),Q),N=Y6.useRef(H?W:0).current;return Y6.useLayoutEffect(()=>{let L=F.current;if(!L)return;if(H)L.resize(W);else L.collapse()},[W,H]),U6.jsxs(zc,{orientation:"horizontal",className:s("overflow-visible!",Y&&"[&>#chat]:transition-[flex-grow] [&>#chat]:duration-200 [&>#chat]:ease-in-out motion-reduce:[&>#chat]:transition-none!",Y&&"has-[[data-separator=active]]:[&>#chat]:transition-none!"),onLayoutChanged:(L,V)=>{if(!Y&&U.current===null)U.current=requestAnimationFrame(()=>{K(!0)});if(V.isUserInteraction)requestAnimationFrame(()=>{let A=F.current;if(!A)return;let D=A.getSize();if(D.inPixels>0)G(Math.round(D.inPixels))})},children:[U6.jsx(Qq,{id:"workspace",className:"overflow-visible!",minSize:B,children:U6.jsx("div",{"data-slot":"workspace-split-workspace",className:"flex h-full min-h-0 min-w-0 flex-col",children:$})}),U6.jsx(Gc,{"aria-label":"Resize chat",hidden:!H,disabled:!H}),U6.jsx(Qq,{id:"chat","aria-hidden":!H,inert:!H,collapsible:!0,collapsedSize:0,defaultSize:N,minSize:J,maxSize:Q,groupResizeBehavior:"preserve-pixel-size",panelRef:F,onResize:(L,V,A)=>{if(H&&L.inPixels===0&&A&&A.inPixels>0)z()},className:s("overflow-hidden!",Y&&"transition-opacity duration-200 ease-in-out motion-reduce:transition-none",H?"opacity-100":"opacity-0"),children:U6.jsx("div",{"data-slot":"workspace-split-chat",className:"flex h-full min-h-0 min-w-(--chat-min) flex-col",children:Z})})]})}var N1=O(c(),1),pJ0=z4.lazy(()=>import("/chunk-8jh75pjg.js").then(($)=>({default:$.Scratchpad}))),Wc=($)=>$.config.title||$.id,Nc=($)=>VY($.icon)??cB;function Lc($,Z){let H=Z.find((B)=>B.viewId===$.id);return VY($.config.icon)??VY(H?.icon)??cB}function uJ0({onToggleMode:$}){return N1.jsxs(r1,{children:[N1.jsx(a1,{render:N1.jsx(C0,{variant:"ghost",size:"icon-sm",onClick:$,"aria-label":"Dock agent",children:N1.jsx(Yc,{stroke:1.75})})}),N1.jsx(n1,{children:"Dock agent"})]})}function cJ0({active:$,onToggle:Z}){return N1.jsxs(r1,{children:[N1.jsx(a1,{render:N1.jsx(C0,{variant:"ghost",size:"icon-sm","aria-label":"Customize","aria-pressed":$,onClick:Z,className:s($&&"bg-accent"),children:N1.jsx(Kc,{stroke:1.75})})}),N1.jsx(n1,{children:"Customize"})]})}function dJ0($,Z,H,B,J,Q){if($==="agent")return{key:$,Icon:Xq,label:"Agent",closable:B,loading:J};if($==="widgets")return{key:$,Icon:dB,label:"Widgets",closable:B};if($==="scratchpad")return{key:$,Icon:lB,label:"Scratchpad",closable:B};let X=B7($),z=X?H.find((U)=>U.id===X):null;if(z)return{key:$,Icon:Nc(z),label:z.title||z.viewId||"New view",closable:B,loading:Q(z.sessionId)};let G=I3($),F=G?Z.find((U)=>U.id===G):null;return F?{key:$,Icon:Lc(F,H),label:Wc(F),closable:B}:null}function lJ0($,Z,H){let B=new Set(Z),J=0;return $.map((Q)=>B.has(Q)?H[J++]:Q)}function Ac({widgets:$,views:Z,builders:H}){let{layout:B,setLayout:J,name:Q,icon:X,provider:z,workspaceId:G}=K5(),F=h9(B.theme),U=Wu(),{ref:Y,fits:K,constraints:W}=Lu(),[N,L]=z4.useState("idle"),[V,A]=z4.useState(!1),[D,q]=z4.useState(0),_=z4.useRef(new Map),M=j5((N0)=>N0.dockedChatWidth),P=j5((N0)=>N0.setDockedChatWidth),T=t2((N0)=>N0.activity),R=p_(T,G),y=Nu({builders:H,onSave:(N0,b0)=>U.save(N0,b0)});oC(B.theme);let w=IY(SY(B.tabs),Z,H),h=w.filter((N0)=>N0!=="agent"),E=h.length>0,I=$.length>0||Z.length>0,S=B.layoutMode==="split"&&E&&K?"split":"fullscreen",k=S==="split",{tabsState:b,activeTab:v,appletParams:u,navigateToTab:C,setTabs:t}=Cu({views:Z,builders:H,split:k}),{view:H0,chatLoaded:x,previewTurn:e,sessionId:L0,processing:d,error:X0,send:K0,stop:Q0,selectSession:z0,dismissError:A0}=Bu({activeTab:v,appletParams:u}),{composerBanner:i,builderComposerBanner:B0,composerAvailability:$0}=Ou(G,{chatError:X0,onDismissChatError:A0}),J0=new Set(b.open),n=(N0)=>{J({layoutMode:N0})},f=k?h:w,l=w.length>1,m=f.map((N0)=>dJ0(N0,Z,H,l||B7(N0)!==null,R,(b0)=>yH(T,G,b0))).filter((N0)=>Boolean(N0)),a=I3(v),o=a?Z.find((N0)=>N0.id===a):void 0,D0=B7(v),O0=D0?H.find((N0)=>N0.id===D0):void 0,k0=O0?.status==="draft"&&!yH(T,G,O0.sessionId)?O0:void 0,r0=k0?.id,p=N==="idle"&&(v==="widgets"&&$.length>0||o!==void 0),r=uw({workspaceId:G,sessionId:L0,activeTab:v,mode:S,available:p,closePopup:()=>A(!1),openPopup:()=>A(!0)});z4.useEffect(()=>{if(b.open.filter((K1)=>dJ(K1,Z,H)).length===b.open.length)return;let b0=IY(b,Z,H);J({tabs:{open:b0,active:b0.includes(b.active)?b.active:b0[0]}})},[H,J,b,Z]),z4.useEffect(()=>{let N0=new Map;for(let l0 of H){if(l0.status!=="ready"||!l0.viewId)continue;if(!Z.some((L1)=>L1.id===l0.viewId))continue;N0.set(R3(l0.id),GG(l0.viewId))}if(N0.size===0)return;let b0=N0.get(v);if(b0)C(b0);let K1=new Set(N0.values()),T0=new Map([...N0].map(([l0,L1])=>[L1,l0])),I0=[],g0=!1;for(let l0 of b.open){let L1=T0.get(l0);if(K1.has(l0)&&L1&&b.open.includes(L1)){g0=!0;continue}let f1=N0.get(l0),m1=f1??l0;if(f1)g0=!0;if(!I0.includes(m1))I0.push(m1)}if(!g0)return;let e0=N0.get(b.active)??b.active;J({tabs:{open:I0.length>0?I0:["agent"],active:e0}})},[v,H,C,J,b,Z]),z4.useEffect(()=>{if(S!=="fullscreen"||v==="agent")A(!1)},[v,S]),z4.useEffect(()=>{if(!r0)return;if(S==="fullscreen")A(!0);q((N0)=>N0+1)},[r0,S]);let Z0=(N0,b0)=>{if(C(N0,b0),N0==="agent")A(!1),q((K1)=>K1+1)},V0=(N0)=>{if(N0==="views"){let b0=Z[0];if(b0)Z0(GG(b0.id));else U.create().then((K1)=>Z0(R3(K1.id)))}else Z0(N0);A(!1)};YG(G,"focusTab",Z0),B2((N0)=>{if(N0.type==="tab:focus"&&N0.workspaceId===G)Z0(N0.tab,N0.params)});let j0=(N0)=>{let b0=B7(N0),K1=b0?H.find((l0)=>l0.id===b0):void 0;if(!l&&!K1||!J0.has(N0))return;let T0=b.open.filter((l0)=>l0!==N0);if(T0.length===0)T0=["agent"];let I0=f.indexOf(N0),g0=f[I0+1]??f[I0-1]??T0.find((l0)=>dJ(l0,Z,H))??"agent",e0=b.active===N0||!T0.includes(b.active)?g0:b.active;if(t({open:T0,active:e0}),v===N0)C(g0);if(K1?.status==="draft")_.current.get(K1.id)?.resetSketch(),y.clear(K1.id),U.discard(K1.id)},v0=(N0)=>{let b0=R3(N0.id);if(J0.has(b0)){let K1=b.open.filter((T0)=>T0!==b0);if(K1.length===0)K1=["agent"];if(t({open:K1,active:b.active===b0?K1[0]:b.active}),v===b0)C(K1[0])}_.current.get(N0.id)?.resetSketch(),y.clear(N0.id),U.discard(N0.id)},z1=(N0)=>{let b0=lJ0(b.open,f,N0);if(b0===b.open)return;t({open:b0,active:b.active})},Y1=(N0)=>{if(N0!==void 0)j5.getState().setComposerDraft(G,N0);if(S==="fullscreen"&&v!=="agent"){if(A(!0),V)q((b0)=>b0+1);return}q((b0)=>b0+1)};lp({send:K0,revealChat:Y1,composerAvailability:$0});let c0=[...!k&&!J0.has("agent")?[{key:"agent",Icon:Xq,label:"Agent",onClick:()=>Z0("agent")}]:[],...!J0.has("widgets")?[{key:"widgets",Icon:dB,label:"Widgets",onClick:()=>Z0("widgets")}]:[],...!J0.has("scratchpad")?[{key:"scratchpad",Icon:lB,label:"Scratchpad",onClick:()=>Z0("scratchpad")}]:[],...Z.map((N0)=>({view:N0,tab:GG(N0.id)})).filter(({tab:N0})=>!J0.has(N0)).map(({view:N0,tab:b0})=>({key:b0,Icon:Lc(N0,H),label:Wc(N0),onClick:()=>Z0(b0)})),...H.filter((N0)=>N0.status!=="ready").map((N0)=>({builder:N0,tab:R3(N0.id)})).filter(({tab:N0})=>!J0.has(N0)).map(({builder:N0,tab:b0})=>({key:b0,Icon:Nc(N0),label:N0.title||N0.viewId||"New view",onClick:()=>Z0(b0)})),{key:"create-view",Icon:Uc,label:"New view",onClick:()=>{U.create().then((N0)=>Z0(R3(N0.id)))}}],R0=k0?{sessionId:k0.sessionId,builderId:k0.id,initialValue:k0.input.requirements,onChange:(N0)=>y.change(k0.id,N0),onRemoveDrawing:()=>{_.current.get(k0.id)?.resetSketch()},onSubmit:async(N0)=>{await _.current.get(k0.id)?.prepareSketchForSend(),await U.submit(k0,N0),y.clear(k0.id)}}:void 0,d0=N1.jsx(fU,{agent:F.agent,active:S==="split",focusRequest:D,chatLoaded:x,hasWorkspaceApplets:I,view:H0,previewTurn:e,sessionId:L0,processing:d,composerBanner:R0?B0:i,composerAvailability:$0,send:K0,stop:Q0,onNavigateFromWelcome:V0,onClose:()=>n("fullscreen"),annotation:r.docked,builderDraft:R0,docked:!0}),p0=N1.jsx(fU,{agent:F.agent,active:S==="fullscreen"&&v==="agent",focusRequest:D,chatLoaded:x,hasWorkspaceApplets:I,view:H0,previewTurn:e,sessionId:L0,processing:d,composerBanner:i,composerAvailability:$0,send:K0,stop:Q0,onNavigateFromWelcome:V0}),s0=N1.jsxs("div",{className:s("@container/workspace relative flex h-full min-h-0 min-w-0 flex-1 flex-col-reverse overflow-hidden bg-background shadow-md transition-[border-radius,background-color] duration-100 ease-out motion-reduce:transition-none",S==="split"&&"rounded-xl"),children:[N1.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[N1.jsxs("div",{ref:r.targetRef,inert:r.controls.active||void 0,"aria-hidden":r.controls.active||void 0,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background transition-colors duration-100 ease-out motion-reduce:transition-none",children:[v==="agent"?p0:v==="widgets"?N1.jsx(Wf,{editing:N==="editing",onEditingChange:(N0)=>L(N0?"editing":"idle"),widgets:$,onCreateWidget:()=>{z0(null),Y1("Create widget")}}):v==="scratchpad"?N1.jsx(z4.Suspense,{fallback:null,children:N1.jsx(pJ0,{})}):null,H.filter((N0)=>N0.status!=="ready").map((N0)=>N1.jsx(Xu,{ref:(b0)=>{if(b0)_.current.set(N0.id,b0);else _.current.delete(N0.id)},active:O0?.id===N0.id,builder:N0,chatDocked:S==="split",workspaceId:G,onEditingStart:()=>{if(S==="fullscreen")A(!1)},onContinueInChat:Y1,onOpenChat:()=>{z0(N0.sessionId),Y1()},onDiscard:()=>v0(N0)},N0.id)),N1.jsx(Ku,{views:Z,activeViewId:o?.id??null,params:u})]}),N1.jsx(VG,{...r.layerProps,children:N1.jsx(MG,{controls:r.controls,title:"Draw annotation",busy:r.controls.finishing,onComplete:()=>void r.controls.finish()})})]}),N1.jsx(e2,{children:N==="customizing"&&N1.jsx(pv,{onClose:()=>L("idle")})}),N1.jsxs(Nf,{children:[N1.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[N1.jsxs("div",{className:"flex items-center gap-2",children:[N1.jsx("img",{src:X??M8[z??"claude-code"],alt:"",className:"size-5 shrink-0 rounded-xs"}),Q&&N1.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Q})]}),N1.jsx(Su,{tabs:m,active:v,createItems:c0,onSelect:Z0,onClose:j0,onReorder:z1})]}),N1.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[N1.jsx(cJ0,{active:N==="customizing",onToggle:()=>L(N==="customizing"?"idle":"customizing")}),N1.jsx(dp,{}),E&&K&&S==="fullscreen"&&N1.jsx(uJ0,{onToggleMode:()=>n("split")})]})]})]});return N1.jsxs("div",{className:"relative flex h-full min-h-0 flex-col font-sans text-foreground",children:[N1.jsx("div",{ref:Y,className:"flex min-h-0 flex-1",children:E&&K&&W?N1.jsx(Fc,{...W,workspace:s0,chat:d0,open:S==="split",chatWidth:M,onCollapse:()=>n("fullscreen"),onChatWidthChange:P}):s0}),S==="fullscreen"&&v!=="agent"&&E&&N1.jsx(mv,{agent:F.agent,loading:R,open:V,onOpenChange:A,onOpenChangeComplete:(N0)=>{if(N0)q((b0)=>b0+1)},children:(N0)=>N1.jsx(fU,{agent:F.agent,active:V,focusRequest:D,chatLoaded:x,hasWorkspaceApplets:I,view:H0,previewTurn:e,sessionId:L0,processing:d,composerBanner:R0?B0:i,composerAvailability:$0,send:K0,stop:Q0,onNavigateFromWelcome:V0,onClose:N0,annotation:r.popup,builderDraft:R0})})]})}var yY=O(g(),1);function Vc($,Z,H,B){let J=yY.useRef(null);yY.useEffect(()=>{if(!Z)return;let Q=new Map(Z.map((W)=>[W.id,{w:W.config.colSpan,h:W.config.rowSpan}]));if(J.current?.workspaceId!==$){J.current={workspaceId:$,sizes:Q};return}let X=J.current.sizes,z=new Set(H.widgetGrid.map((W)=>W.i)),G=Z.filter((W)=>{if(!X.has(W.id))return!z.has(W.id);if(!z.has(W.id))return!1;let L=X.get(W.id);return L.w!==W.config.colSpan||L.h!==W.config.rowSpan});if(J.current={workspaceId:$,sizes:Q},G.length===0)return;let F=new Map(Z.map((W)=>[W.id,W.config])),U=H.widgetGrid.filter((W)=>!G.some((N)=>N.id===W.i)&&F.has(W.i)).map((W)=>{let N=F.get(W.i);return{i:W.i,x:W.x,y:W.y,w:N.colSpan,h:N.rowSpan}}),Y=U.map(({i:W,x:N,y:L})=>({i:W,x:N,y:L})),K=[...U];for(let W of G){let N=PJ(K,W.config.colSpan,W.config.rowSpan,4);Y.push({i:W.id,x:N.x,y:N.y}),K.push({i:W.id,x:N.x,y:N.y,w:W.config.colSpan,h:W.config.rowSpan})}B({widgetGrid:Y})},[$,Z,H.widgetGrid,B])}var R8=O(c(),1);function qc({id:$}){return R8.jsx(Dc,{id:$,children:R8.jsx(kw,{id:$,children:R8.jsx(iJ0,{id:$})})})}function iJ0({id:$}){let Z=$1(),[H]=F3(),{layout:B,setLayout:J,isLoading:Q}=K5(),X=ww($),z=AG($),G=PY($);Vc($,X.data,B,J),_w(),B2((U)=>{if(U.type==="theme:updated"||U.type==="workspace:updated")Z.invalidateQueries({queryKey:w0.layout($)});else if(U.type==="widget-layout:updated"||U.type==="widget:updated")Z.invalidateQueries({queryKey:w0.widgets($)});else if(U.type==="view-layout:updated"||U.type==="view:updated")Z.invalidateQueries({queryKey:w0.views($)})});let F=Q||H===void 0||X.isLoading||z.isLoading||G.isLoading;return R8.jsx(R8.Fragment,{children:R8.jsx(Yz,{children:F?R8.jsx("div",{className:"flex h-full items-center justify-center",children:R8.jsx(Gw,{sprite:"moi",effect:"chaos"})}):R8.jsx(Ac,{widgets:X.data??[],views:z.data??[],builders:G.data??[]})})})}var T9=O(c(),1),Mc=null;function rJ0(){if(!Mc)return T9.jsx(QM,{to:"/"});return T9.jsx(hY.Suspense,{fallback:null,children:T9.jsx(Mc,{})})}function Pc(){let[,$]=p4();return hY.useEffect(()=>{return GW((Z)=>$(`/workspace/${Z}`)),()=>GW(null)},[$]),T9.jsxs(JM,{children:[T9.jsx(YQ,{path:"/",component:Hw}),T9.jsx(YQ,{path:"/dev/*?",component:rJ0}),T9.jsx(YQ,{path:"/workspace/:id/*?",children:(Z)=>T9.jsx(qc,{id:Z.id},Z.id)})]})}var K6=O(c(),1),Oc=new aY;s_(Oc);v_();function PU1($){function Z(){return K6.jsx(oY,{client:Oc,children:K6.jsxs(qX,{children:[K6.jsx(QK,{children:K6.jsx(Pc,{})}),K6.jsx(Q_,{}),!1]})})}_c.createRoot($).render(K6.jsx(Z,{}))}export{PU1 as mount};
|