moi-computer 0.9.1-next.4 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -58
- package/client/app/shell/SidebarLayout.tsx +114 -69
- package/client/assets/floppy-disk.webp +0 -0
- package/client/assets.d.ts +5 -0
- package/client/components/ui/button.tsx +2 -1
- package/client/features/chat/ChatEmptyState.tsx +70 -34
- package/client/features/chat/ChatPanel.tsx +8 -1
- package/client/features/chat/chat-store.ts +4 -0
- package/client/features/chat/tool-group/format/claude.ts +2 -1
- package/client/features/chat/tool-group/format/codex.ts +2 -1
- package/client/features/chat/tool-group/format/hermes.ts +2 -1
- package/client/features/chat/tool-group/format/mcp.ts +7 -3
- package/client/features/chat/tool-group/format/openclaw.ts +6 -2
- package/client/features/chat/tool-group/format/shell.ts +162 -0
- package/client/features/dev/DevIndexPage.tsx +5 -0
- package/client/features/dev/DevRoutes.tsx +2 -0
- package/client/features/dev/TextureLabPage.tsx +149 -0
- package/client/features/home/HomePage.tsx +5 -5
- package/client/features/home/workspace-setup/CreateWorkspaceDialog.tsx +3 -3
- package/client/features/home/workspace-setup/DemoDialog.tsx +239 -0
- package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +22 -5
- package/client/features/settings/GeneralSettings.tsx +27 -23
- package/client/features/update/Update.tsx +78 -0
- package/client/features/update/api.ts +35 -0
- package/client/features/widgets/WidgetFrame.tsx +1 -0
- package/client/features/workspace/WorkspaceScreen.tsx +15 -0
- package/client/index.css +2 -2
- package/client/runtime/workspace-theme.ts +12 -4
- package/client/theme.css +26 -22
- package/dist/{chunk-zbt8emsw.js → chunk-0set7tmf.js} +2 -2
- package/dist/chunk-4057kxht.css +1 -0
- package/dist/{chunk-zcyvyebg.js → chunk-5t06zksf.js} +2 -2
- package/dist/{chunk-zbeq02yc.js → chunk-97eg9mjn.js} +1 -1
- package/dist/chunk-b5c62p8h.js +1 -0
- package/dist/chunk-dfe7qnrp.js +1 -0
- package/dist/{chunk-b959mdkj.js → chunk-efdyz6xp.js} +1 -1
- package/dist/chunk-f6xmz3tn.js +83 -0
- package/dist/chunk-h2kj1ysj.js +1 -0
- package/dist/{chunk-zfz3b4xg.js → chunk-ht1f95h9.js} +2 -2
- package/dist/chunk-qtc5a8qa.js +10 -0
- package/dist/floppy-disk-wmjs0n85.webp +0 -0
- package/dist/index.html +1 -1
- package/lib/ids.ts +27 -0
- package/lib/themes.ts +12 -12
- package/lib/types.ts +11 -2
- package/lib/update.ts +2 -0
- package/package.json +2 -1
- package/server/api.ts +47 -1
- package/server/app-config.ts +2 -2
- package/server/bundler/build-applet.ts +2 -3
- package/server/cli.ts +30 -7
- package/server/constants.ts +4 -2
- package/server/registry.ts +37 -2
- package/server/update.ts +293 -5
- package/server/web.ts +1 -1
- package/client/features/home/workspace-setup/InstallMoiDialog.tsx +0 -245
- package/dist/chunk-87q78504.js +0 -1
- package/dist/chunk-8s41nd3g.js +0 -1
- package/dist/chunk-cagtq45k.js +0 -1
- package/dist/chunk-ek6zde7t.js +0 -10
- package/dist/chunk-n8tq2494.js +0 -82
- package/dist/chunk-v82nefjq.css +0 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import{$ as gK,$a as XJ,$b as aj,A as _P,Aa as uf,Ab as Nm,Ac as O_,B as OP,Ba as cf,Bb as KI,Bc as j_,C as S$,Ca as df,Cb as Qv,Cc as g_,D as CZ,Da as lf,Db as am,E as jP,Ea as rf,Eb as Lm,Ec as R_,F as mK,Fa as F3,Fb as Vm,Fc as Z5,G as TP,Ga as af,Gb as Am,Gc as wu,H as CP,Ha as CY,Hb as Dm,Hc as f_,I as j4,Ia as $6,Ib as PY,Ic as m_,J as U4,Ja as nx,Jc as t2,K as sE,Ka as pP,Kb as Mm,Kc as _g,L as eG,La as rm,Lb as jY,Lc as r1,M as kP,Ma as nf,Mb as Pm,Mc as Mw,N as a6,Na as of,Nb as Cx,O as uE,Oa as sf,Ob as WV,P as o8,Pa as iX,Pb as wx,Q as zP,Qa as tf,Qb as JF,R as U0,Ra as ef,Rb as _m,S as dM,Sa as $m,Sb as F4,T as nG,Ta as Jm,U as p5,Ua as Zm,Ub as Om,V as ZX,Va as s_,Vb as jm,W as qP,Wa as MI,Wb as gH,X as yK,Xa as gC,Xb as gB,Y as hK,Yb as Tm,Z as xK,Za as Hm,Zb as Cm,_ as vK,_a as FI,_b as pH,aa as fK,ab as Bm,ac as wm,b as c,bb as Qm,bc as Em,c as G4,ca as YA,cb as Sp,d as GH0,da as s,db as tO,dc as Sm,e as R1,ea as vp,eb as Xm,f as E0,fa as g$,fb as OY,fc as Im,g as WQ,ga as C0,gb as zm,gc as WI,h as K0,ha as ux,hb as Gm,hc as Rm,i as F0,ia as hf,ic as km,j as u1,ja as mP,jb as Ym,jc as bm,k as RH,ka as zX,kb as Um,kc as rg,l as k1,la as xf,lc as ym,m as aQ,ma as DI,mb as Fm,n as E2,na as Cw,nb as uP,nc as qI,o as XP,oa as ww,ob as zF,oc as nm,p as j1,pa as sO,pb as mH,pc as hm,q as P5,qa as Iw,qb as Mu,r as YM,ra as im,rb as Km,rc as NI,s as CX,sa as fH,sb as Pu,sc as xm,t as KP,ta as vf,tc as vm,u as n6,ua as gf,ub as E5,uc as w5,v as r6,va as vH,vb as cP,vc as Cg,w as oQ,wa as ff,wb as wp,wc as nj,x as PZ,xa as mf,xb as Wm,xc as QI,y as nK,ya as pf,yb as qm,yc as rX,z as YK,za as Du,zb as eO,zc as GI}from"/chunk-qtc5a8qa.js";import{Nc as N1,Oc as w4,Pc as a5,Rc as $9}from"/chunk-0set7tmf.js";import{Sc as g,Tc as y_,Vc as Z2}from"/chunk-ht1f95h9.js";import{Wc as O,Xc as X5,Yc as _4,Zc as Eq}from"/chunk-97eg9mjn.js";var BQ=X5((Hc)=>{var G8=O(g());function au($,J){return $===J&&($!==0||1/$===1/J)||$!==$&&J!==J}var nu=typeof Object.is==="function"?Object.is:au,ou=G8.useState,su=G8.useEffect,tu=G8.useLayoutEffect,eu=G8.useDebugValue;function $c($,J){var Z=J(),H=ou({inst:{value:Z,getSnapshot:J}}),B=H[0].inst,Q=H[1];return tu(function(){B.value=Z,B.getSnapshot=J,dF(B)&&Q({inst:B})},[$,Z,J]),su(function(){return dF(B)&&Q({inst:B}),$(function(){dF(B)&&Q({inst:B})})},[$]),eu(Z),Z}function dF($){var J=$.getSnapshot;$=$.value;try{var Z=J();return!nu($,Z)}catch(H){return!0}}function Jc($,J){return J()}var Zc=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Jc:$c;Hc.useSyncExternalStore=G8.useSyncExternalStore!==void 0?G8.useSyncExternalStore:Zc});var xI=X5((Ca0,hI)=>{var RI=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,We=/\n/g,qe=/^\s*/,Ne=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Le=/^:\s*/,Ve=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ae=/^[;\s]*/,De=/^\s+|\s+$/g,Me=`
|
|
2
|
+
`,kI="/",bI="*",G6="",Pe="comment",_e="declaration";function Oe($,J){if(typeof $!=="string")throw TypeError("First argument must be a string");if(!$)return[];J=J||{};var Z=1,H=1;function B(q){var N=q.match(We);if(N)Z+=N.length;var V=q.lastIndexOf(Me);H=~V?q.length-V:H+q.length}function Q(){var q={line:Z,column:H};return function(N){return N.position=new X(q),Y(),N}}function X(q){this.start=q,this.end={line:Z,column:H},this.source=J.source}X.prototype.content=$;function z(q){var N=Error(J.source+":"+Z+":"+H+": "+q);if(N.reason=q,N.filename=J.source,N.line=Z,N.column=H,N.source=$,J.silent);else throw N}function G(q){var N=q.exec($);if(!N)return;var V=N[0];return B(V),$=$.slice(V.length),N}function Y(){G(qe)}function U(q){var N;q=q||[];while(N=F())if(N!==!1)q.push(N);return q}function F(){var q=Q();if(kI!=$.charAt(0)||bI!=$.charAt(1))return;var N=2;while(G6!=$.charAt(N)&&(bI!=$.charAt(N)||kI!=$.charAt(N+1)))++N;if(N+=2,G6===$.charAt(N-1))return z("End of comment missing");var V=$.slice(2,N-2);return H+=2,B(V),$=$.slice(N),H+=2,q({type:Pe,comment:V})}function K(){var q=Q(),N=G(Ne);if(!N)return;if(F(),!G(Le))return z("property missing ':'");var V=G(Ve),L=q({type:_e,property:yI(N[0].replace(RI,G6)),value:V?yI(V[0].replace(RI,G6)):G6});return G(Ae),L}function W(){var q=[];U(q);var N;while(N=K())if(N!==!1)q.push(N),U(q);return q}return Y(),W()}function yI($){return $?$.replace(De,G6):G6}hI.exports=Oe});var vI=X5((lH)=>{var je=lH&&lH.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(lH,"__esModule",{value:!0});lH.default=Ce;var Te=je(xI());function Ce($,J){let Z=null;if(!$||typeof $!=="string")return Z;let H=(0,Te.default)($),B=typeof J==="function";return H.forEach((Q)=>{if(Q.type!=="declaration")return;let{property:X,value:z}=Q;if(B)J(X,z,Q);else if(z)Z=Z||{},Z[X]=z}),Z}});var pI=X5((fI)=>{Object.defineProperty(fI,"__esModule",{value:!0});fI.camelCase=void 0;var we=/^--[a-zA-Z0-9_-]+$/,Ee=/-([a-z])/g,Se=/^[^-]+$/,Ie=/^-(webkit|moz|ms|o|khtml)-/,Re=/^-(ms)-/,ke=function($){return!$||Se.test($)||we.test($)},be=function($,J){return J.toUpperCase()},gI=function($,J){return"".concat(J,"-")},ye=function($,J){if(J===void 0)J={};if(ke($))return $;if($=$.toLowerCase(),J.reactCompat)$=$.replace(Re,gI);else $=$.replace(Ie,gI);return $.replace(Ee,be)};fI.camelCase=ye});var cI=X5((PN,uI)=>{var he=PN&&PN.__importDefault||function($){return $&&$.__esModule?$:{default:$}},xe=he(vI()),ve=pI();function MN($,J){var Z={};if(!$||typeof $!=="string")return Z;return(0,xe.default)($,function(H,B){if(H&&B)Z[(0,ve.camelCase)(H,J)]=B}),Z}MN.default=MN;uI.exports=MN});var Uk=X5((V01,Yk)=>{var HU=Object.prototype.hasOwnProperty,Gk=Object.prototype.toString,Zk=Object.defineProperty,Hk=Object.getOwnPropertyDescriptor,Bk=function(J){if(typeof Array.isArray==="function")return Array.isArray(J);return Gk.call(J)==="[object Array]"},Qk=function(J){if(!J||Gk.call(J)!=="[object Object]")return!1;var Z=HU.call(J,"constructor"),H=J.constructor&&J.constructor.prototype&&HU.call(J.constructor.prototype,"isPrototypeOf");if(J.constructor&&!Z&&!H)return!1;var B;for(B in J);return typeof B>"u"||HU.call(J,B)},Xk=function(J,Z){if(Zk&&Z.name==="__proto__")Zk(J,Z.name,{enumerable:!0,configurable:!0,value:Z.newValue,writable:!0});else J[Z.name]=Z.newValue},zk=function(J,Z){if(Z==="__proto__"){if(!HU.call(J,Z))return;else if(Hk)return Hk(J,Z).value}return J[Z]};Yk.exports=function $(){var J,Z,H,B,Q,X,z=arguments[0],G=1,Y=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<Y;++G)if(J=arguments[G],J!=null){for(Z in J)if(H=zk(z,Z),B=zk(J,Z),z!==B){if(U&&B&&(Qk(B)||(Q=Bk(B)))){if(Q)Q=!1,X=H&&Bk(H)?H:[];else X=H&&Qk(H)?H:{};Xk(z,{name:Z,newValue:$(U,X,B)})}else if(typeof B<"u")Xk(z,{name:Z,newValue:B})}}return z}});var Zy=X5((g51,Jy)=>{function mb($){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((J)=>{let Z=$[J],H=typeof Z;if((H==="object"||H==="function")&&!Object.isFrozen(Z))mb(Z)}),$}class KL{constructor($){if($.data===void 0)$.data={};this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function pb($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function d3($,...J){let Z=Object.create(null);for(let H in $)Z[H]=$[H];return J.forEach(function(H){for(let B in H)Z[B]=H[B]}),Z}var G20="</span>",yb=($)=>{return!!$.scope},Y20=($,{prefix:J})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){let Z=$.split(".");return[`${J}${Z.shift()}`,...Z.map((H,B)=>`${H}${"_".repeat(B+1)}`)].join(" ")}return`${J}${$}`};class ub{constructor($,J){this.buffer="",this.classPrefix=J.classPrefix,$.walk(this)}addText($){this.buffer+=pb($)}openNode($){if(!yb($))return;let J=Y20($.scope,{prefix:this.classPrefix});this.span(J)}closeNode($){if(!yb($))return;this.buffer+=G20}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}var hb=($={})=>{let J={children:[]};return Object.assign(J,$),J};class WL{constructor(){this.rootNode=hb(),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 J=hb({scope:$});this.add(J),this.stack.push(J)}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($,J){if(typeof J==="string")$.addText(J);else if(J.children)$.openNode(J),J.children.forEach((Z)=>this._walk($,Z)),$.closeNode(J);return $}static _collapse($){if(typeof $==="string")return;if(!$.children)return;if($.children.every((J)=>typeof J==="string"))$.children=[$.children.join("")];else $.children.forEach((J)=>{WL._collapse(J)})}}class cb extends WL{constructor($){super();this.options=$}addText($){if($==="")return;this.add($)}startScope($){this.openNode($)}endScope(){this.closeNode()}__addSublanguage($,J){let Z=$.root;if(J)Z.scope=`language:${J}`;this.add(Z)}toHTML(){return new ub(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function GB($){if(!$)return null;if(typeof $==="string")return $;return $.source}function db($){return A6("(?=",$,")")}function U20($){return A6("(?:",$,")*")}function F20($){return A6("(?:",$,")?")}function A6(...$){return $.map((Z)=>GB(Z)).join("")}function K20($){let J=$[$.length-1];if(typeof J==="object"&&J.constructor===Object)return $.splice($.length-1,1),J;else return{}}function qL(...$){return"("+(K20($).capture?"":"?:")+$.map((H)=>GB(H)).join("|")+")"}function lb($){return new RegExp($.toString()+"|").exec("").length-1}function W20($,J){let Z=$&&$.exec(J);return Z&&Z.index===0}var q20=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function NL($,{joinWith:J}){let Z=0;return $.map((H)=>{Z+=1;let B=Z,Q=GB(H),X="";while(Q.length>0){let z=q20.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])+B);else if(X+=z[0],z[0]==="(")Z++}return X}).map((H)=>`(${H})`).join(J)}var N20=/\b\B/,ib="[a-zA-Z]\\w*",LL="[a-zA-Z_]\\w*",rb="\\b\\d+(\\.\\d+)?",ab="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",nb="\\b(0b[01]+)",L20="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",V20=($={})=>{let J=/^#![ ]*\//;if($.binary)$.begin=A6(J,/.*\b/,$.binary,/\b.*/);return d3({scope:"meta",begin:J,end:/$/,relevance:0,"on:begin":(Z,H)=>{if(Z.index!==0)H.ignoreMatch()}},$)},YB={begin:"\\\\[\\s\\S]",relevance:0},A20={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[YB]},D20={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[YB]},M20={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/},LU=function($,J,Z={}){let H=d3({scope:"comment",begin:$,end:J,contains:[]},Z);H.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 B=qL("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 H.contains.push({begin:A6(/[ ]+/,"(",B,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),H},P20=LU("//","$"),_20=LU("/\\*","\\*/"),O20=LU("#","$"),j20={scope:"number",begin:rb,relevance:0},T20={scope:"number",begin:ab,relevance:0},C20={scope:"number",begin:nb,relevance:0},w20={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[YB,{begin:/\[/,end:/\]/,relevance:0,contains:[YB]}]},E20={scope:"title",begin:ib,relevance:0},S20={scope:"title",begin:LL,relevance:0},I20={begin:"\\.\\s*"+LL,relevance:0},R20=function($){return Object.assign($,{"on:begin":(J,Z)=>{Z.data._beginMatch=J[1]},"on:end":(J,Z)=>{if(Z.data._beginMatch!==J[1])Z.ignoreMatch()}})},qU=Object.freeze({__proto__:null,APOS_STRING_MODE:A20,BACKSLASH_ESCAPE:YB,BINARY_NUMBER_MODE:C20,BINARY_NUMBER_RE:nb,COMMENT:LU,C_BLOCK_COMMENT_MODE:_20,C_LINE_COMMENT_MODE:P20,C_NUMBER_MODE:T20,C_NUMBER_RE:ab,END_SAME_AS_BEGIN:R20,HASH_COMMENT_MODE:O20,IDENT_RE:ib,MATCH_NOTHING_RE:N20,METHOD_GUARD:I20,NUMBER_MODE:j20,NUMBER_RE:rb,PHRASAL_WORDS_MODE:M20,QUOTE_STRING_MODE:D20,REGEXP_MODE:w20,RE_STARTERS_RE:L20,SHEBANG:V20,TITLE_MODE:E20,UNDERSCORE_IDENT_RE:LL,UNDERSCORE_TITLE_MODE:S20});function k20($,J){if($.input[$.index-1]===".")J.ignoreMatch()}function b20($,J){if($.className!==void 0)$.scope=$.className,delete $.className}function y20($,J){if(!J)return;if(!$.beginKeywords)return;if($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=k20,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0)$.relevance=0}function h20($,J){if(!Array.isArray($.illegal))return;$.illegal=qL(...$.illegal)}function x20($,J){if(!$.match)return;if($.begin||$.end)throw Error("begin & end are not supported with match");$.begin=$.match,delete $.match}function v20($,J){if($.relevance===void 0)$.relevance=1}var g20=($,J)=>{if(!$.beforeMatch)return;if($.starts)throw Error("beforeMatch cannot be used with starts");let Z=Object.assign({},$);Object.keys($).forEach((H)=>{delete $[H]}),$.keywords=Z.keywords,$.begin=A6(Z.beforeMatch,db(Z.begin)),$.starts={relevance:0,contains:[Object.assign(Z,{endsParent:!0})]},$.relevance=0,delete Z.beforeMatch},f20=["of","and","for","in","not","or","if","then","parent","list","value"],m20="keyword";function ob($,J,Z=m20){let H=Object.create(null);if(typeof $==="string")B(Z,$.split(" "));else if(Array.isArray($))B(Z,$);else Object.keys($).forEach(function(Q){Object.assign(H,ob($[Q],J,Q))});return H;function B(Q,X){if(J)X=X.map((z)=>z.toLowerCase());X.forEach(function(z){let G=z.split("|");H[G[0]]=[Q,p20(G[0],G[1])]})}}function p20($,J){if(J)return Number(J);return u20($)?0:1}function u20($){return f20.includes($.toLowerCase())}var xb={},V6=($)=>{console.error($)},vb=($,...J)=>{console.log(`WARN: ${$}`,...J)},DJ=($,J)=>{if(xb[`${$}/${J}`])return;console.log(`Deprecated as of ${$}. ${J}`),xb[`${$}/${J}`]=!0},NU=Error();function sb($,J,{key:Z}){let H=0,B=$[Z],Q={},X={};for(let z=1;z<=J.length;z++)X[z+H]=B[z],Q[z+H]=!0,H+=lb(J[z-1]);$[Z]=X,$[Z]._emit=Q,$[Z]._multi=!0}function c20($){if(!Array.isArray($.begin))return;if($.skip||$.excludeBegin||$.returnBegin)throw V6("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),NU;if(typeof $.beginScope!=="object"||$.beginScope===null)throw V6("beginScope must be object"),NU;sb($,$.begin,{key:"beginScope"}),$.begin=NL($.begin,{joinWith:""})}function d20($){if(!Array.isArray($.end))return;if($.skip||$.excludeEnd||$.returnEnd)throw V6("skip, excludeEnd, returnEnd not compatible with endScope: {}"),NU;if(typeof $.endScope!=="object"||$.endScope===null)throw V6("endScope must be object"),NU;sb($,$.end,{key:"endScope"}),$.end=NL($.end,{joinWith:""})}function l20($){if($.scope&&typeof $.scope==="object"&&$.scope!==null)$.beginScope=$.scope,delete $.scope}function i20($){if(l20($),typeof $.beginScope==="string")$.beginScope={_wrap:$.beginScope};if(typeof $.endScope==="string")$.endScope={_wrap:$.endScope};c20($),d20($)}function r20($){function J(X,z){return new RegExp(GB(X),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(z?"g":""))}class Z{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+=lb(X)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let X=this.regexes.map((z)=>z[1]);this.matcherRe=J(NL(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,F)=>F>0&&U!==void 0),Y=this.matchIndexes[G];return z.splice(0,G),Object.assign(z,Y)}}class H{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 Z;return this.rules.slice(X).forEach(([G,Y])=>z.addRule(G,Y)),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 Y=this.getMatcher(0);Y.lastIndex=this.lastIndex+1,G=Y.exec(X)}if(G){if(this.regexIndex+=G.position+1,this.regexIndex===this.count)this.considerAll()}return G}}function B(X){let z=new H;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;[b20,x20,i20,g20].forEach((U)=>U(X,z)),$.compilerExtensions.forEach((U)=>U(X,z)),X.__beforeBegin=null,[y20,h20,v20].forEach((U)=>U(X,z)),X.isCompiled=!0;let Y=null;if(typeof X.keywords==="object"&&X.keywords.$pattern)X.keywords=Object.assign({},X.keywords),Y=X.keywords.$pattern,delete X.keywords.$pattern;if(Y=Y||/\w+/,X.keywords)X.keywords=ob(X.keywords,$.case_insensitive);if(G.keywordPatternRe=J(Y,!0),z){if(!X.begin)X.begin=/\B|\b/;if(G.beginRe=J(G.begin),!X.end&&!X.endsWithParent)X.end=/\B|\b/;if(X.end)G.endRe=J(G.end);if(G.terminatorEnd=GB(G.end)||"",X.endsWithParent&&z.terminatorEnd)G.terminatorEnd+=(X.end?"|":"")+z.terminatorEnd}if(X.illegal)G.illegalRe=J(X.illegal);if(!X.contains)X.contains=[];if(X.contains=[].concat(...X.contains.map(function(U){return a20(U==="self"?X:U)})),X.contains.forEach(function(U){Q(U,G)}),X.starts)Q(X.starts,z);return G.matcher=B(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=d3($.classNameAliases||{}),Q($)}function tb($){if(!$)return!1;return $.endsWithParent||tb($.starts)}function a20($){if($.variants&&!$.cachedVariants)$.cachedVariants=$.variants.map(function(J){return d3($,{variants:null},J)});if($.cachedVariants)return $.cachedVariants;if(tb($))return d3($,{starts:$.starts?d3($.starts):null});if(Object.isFrozen($))return d3($);return $}var n20="11.11.1";class eb extends Error{constructor($,J){super($);this.name="HTMLInjectionError",this.html=J}}var FL=pb,gb=d3,fb=Symbol("nomatch"),o20=7,$y=function($){let J=Object.create(null),Z=Object.create(null),H=[],B=!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:cb};function G(k){return z.noHighlightRe.test(k)}function Y(k){let y=k.className+" ";y+=k.parentNode?k.parentNode.className:"";let v=z.languageDetectRe.exec(y);if(v){let u=R(v[1]);if(!u)vb(Q.replace("{}",v[1])),vb("Falling back to no-highlight mode for this block.",k);return u?v[1]:"no-highlight"}return y.split(/\s+/).find((u)=>G(u)||R(u))}function U(k,y,v){let u="",T="";if(typeof y==="object")u=k,v=y.ignoreIllegals,T=y.language;else DJ("10.7.0","highlight(lang, code, ...args) has been deprecated."),DJ("10.7.0",`Please use highlight(code, options) instead.
|
|
3
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),T=k,u=y;if(v===void 0)v=!0;let t={code:u,language:T};j("before:highlight",t);let B0=t.result?t.result:F(t.language,t.code,v);return B0.code=t.code,j("after:highlight",B0),B0}function F(k,y,v,u){let T=Object.create(null);function t(f,r){return f.keywords[r]}function B0(){if(!d.keywords){a.addText(o);return}let f=0;d.keywordPatternRe.lastIndex=0;let r=d.keywordPatternRe.exec(o),X0="";while(r){X0+=o.substring(f,r.index);let V0=H0.case_insensitive?r[0].toLowerCase():r[0],j0=t(d,V0);if(j0){let[v0,Q1]=j0;if(a.addText(X0),X0="",T[V0]=(T[V0]||0)+1,T[V0]<=o20)N0+=Q1;if(v0.startsWith("_"))X0+=r[0];else{let U1=H0.classNameAliases[v0]||v0;A0(r[0],U1)}}else X0+=r[0];f=d.keywordPatternRe.lastIndex,r=d.keywordPatternRe.exec(o)}X0+=o.substring(f),a.addText(X0)}function h(){if(o==="")return;let f=null;if(typeof d.subLanguage==="string"){if(!J[d.subLanguage]){a.addText(o);return}f=F(d.subLanguage,o,!0,m[d.subLanguage]),m[d.subLanguage]=f._top}else f=W(o,d.subLanguage.length?d.subLanguage:null);if(d.relevance>0)N0+=f.relevance;a.__addSublanguage(f._emitter,f.language)}function e(){if(d.subLanguage!=null)h();else B0();o=""}function A0(f,r){if(f==="")return;a.startScope(r),a.addText(f),a.endScope()}function l(f,r){let X0=1,V0=r.length-1;while(X0<=V0){if(!f._emit[X0]){X0++;continue}let j0=H0.classNameAliases[f[X0]]||f[X0],v0=r[X0];if(j0)A0(v0,j0);else o=v0,B0(),o="";X0++}}function z0(f,r){if(f.scope&&typeof f.scope==="string")a.openNode(H0.classNameAliases[f.scope]||f.scope);if(f.beginScope){if(f.beginScope._wrap)A0(o,H0.classNameAliases[f.beginScope._wrap]||f.beginScope._wrap),o="";else if(f.beginScope._multi)l(f.beginScope,r),o=""}return d=Object.create(f,{parent:{value:d}}),d}function W0(f,r,X0){let V0=W20(f.endRe,X0);if(V0){if(f["on:end"]){let j0=new KL(f);if(f["on:end"](r,j0),j0.isMatchIgnored)V0=!1}if(V0){while(f.endsParent&&f.parent)f=f.parent;return f}}if(f.endsWithParent)return W0(f.parent,r,X0)}function Q0(f){if(d.matcher.regexIndex===0)return o+=f[0],1;else return p0=!0,0}function G0(f){let r=f[0],X0=f.rule,V0=new KL(X0),j0=[X0.__beforeBegin,X0["on:begin"]];for(let v0 of j0){if(!v0)continue;if(v0(f,V0),V0.isMatchIgnored)return Q0(r)}if(X0.skip)o+=r;else{if(X0.excludeBegin)o+=r;if(e(),!X0.returnBegin&&!X0.excludeBegin)o=r}return z0(X0,f),X0.returnBegin?0:r.length}function L0(f){let r=f[0],X0=y.substring(f.index),V0=W0(d,f,X0);if(!V0)return fb;let j0=d;if(d.endScope&&d.endScope._wrap)e(),A0(r,d.endScope._wrap);else if(d.endScope&&d.endScope._multi)e(),l(d.endScope,f);else if(j0.skip)o+=r;else{if(!(j0.returnEnd||j0.excludeEnd))o+=r;if(e(),j0.excludeEnd)o=r}do{if(d.scope)a.closeNode();if(!d.skip&&!d.subLanguage)N0+=d.relevance;d=d.parent}while(d!==V0.parent);if(V0.starts)z0(V0.starts,f);return j0.returnEnd?0:r.length}function i(){let f=[];for(let r=d;r!==H0;r=r.parent)if(r.scope)f.unshift(r.scope);f.forEach((r)=>a.openNode(r))}let $0={};function J0(f,r){let X0=r&&r[0];if(o+=f,X0==null)return e(),0;if($0.type==="begin"&&r.type==="end"&&$0.index===r.index&&X0===""){if(o+=y.slice(r.index,r.index+1),!B){let V0=Error(`0 width match regex (${k})`);throw V0.languageName=k,V0.badRule=$0.rule,V0}return 1}if($0=r,r.type==="begin")return G0(r);else if(r.type==="illegal"&&!v){let V0=Error('Illegal lexeme "'+X0+'" for mode "'+(d.scope||"<unnamed>")+'"');throw V0.mode=d,V0}else if(r.type==="end"){let V0=L0(r);if(V0!==fb)return V0}if(r.type==="illegal"&&X0==="")return o+=`
|
|
4
|
+
`,1;if(g0>1e5&&g0>r.index*3)throw Error("potential infinite loop, way more iterations than matches");return o+=X0,X0.length}let H0=R(k);if(!H0)throw V6(Q.replace("{}",k)),Error('Unknown language: "'+k+'"');let n=r20(H0),p="",d=u||n,m={},a=new z.__emitter(z);i();let o="",N0=0,O0=0,g0=0,p0=!1;try{if(!H0.__emitTokens){d.matcher.considerAll();for(;;){if(g0++,p0)p0=!1;else d.matcher.considerAll();d.matcher.lastIndex=O0;let f=d.matcher.exec(y);if(!f)break;let r=y.substring(O0,f.index),X0=J0(r,f);O0=f.index+X0}J0(y.substring(O0))}else H0.__emitTokens(y,a);return a.finalize(),p=a.toHTML(),{language:k,value:p,relevance:N0,illegal:!1,_emitter:a,_top:d}}catch(f){if(f.message&&f.message.includes("Illegal"))return{language:k,value:FL(y),illegal:!0,relevance:0,_illegalBy:{message:f.message,index:O0,context:y.slice(O0-100,O0+100),mode:f.mode,resultSoFar:p},_emitter:a};else if(B)return{language:k,value:FL(y),illegal:!1,relevance:0,errorRaised:f,_emitter:a,_top:d};else throw f}}function K(k){let y={value:FL(k),illegal:!1,relevance:0,_top:X,_emitter:new z.__emitter(z)};return y._emitter.addText(k),y}function W(k,y){y=y||z.languages||Object.keys(J);let v=K(k),u=y.filter(R).filter(E).map((e)=>F(e,k,!1));u.unshift(v);let T=u.sort((e,A0)=>{if(e.relevance!==A0.relevance)return A0.relevance-e.relevance;if(e.language&&A0.language){if(R(e.language).supersetOf===A0.language)return 1;else if(R(A0.language).supersetOf===e.language)return-1}return 0}),[t,B0]=T,h=t;return h.secondBest=B0,h}function q(k,y,v){let u=y&&Z[y]||v;k.classList.add("hljs"),k.classList.add(`language-${u}`)}function N(k){let y=null,v=Y(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 eb("One of your code blocks includes unescaped HTML.",k.innerHTML)}y=k;let u=y.textContent,T=v?U(u,{language:v,ignoreIllegals:!0}):W(u);if(k.innerHTML=T.value,k.dataset.highlighted="yes",q(k,v,T.language),k.result={language:T.language,re:T.relevance,relevance:T.relevance},T.secondBest)k.secondBest={language:T.secondBest.language,relevance:T.secondBest.relevance};j("after:highlightElement",{el:k,result:T,text:u})}function V(k){z=gb(z,k)}let L=()=>{_(),DJ("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function A(){_(),DJ("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let M=!1;function _(){function k(){_()}if(document.readyState==="loading"){if(!M)window.addEventListener("DOMContentLoaded",k,!1);M=!0;return}document.querySelectorAll(z.cssSelector).forEach(N)}function P(k,y){let v=null;try{v=y($)}catch(u){if(V6("Language definition for '{}' could not be registered.".replace("{}",k)),!B)throw u;else V6(u);v=X}if(!v.name)v.name=k;if(J[k]=v,v.rawDefinition=y.bind(null,$),v.aliases)b(v.aliases,{languageName:k})}function D(k){delete J[k];for(let y of Object.keys(Z))if(Z[y]===k)delete Z[y]}function w(){return Object.keys(J)}function R(k){return k=(k||"").toLowerCase(),J[k]||J[Z[k]]}function b(k,{languageName:y}){if(typeof k==="string")k=[k];k.forEach((v)=>{Z[v.toLowerCase()]=y})}function E(k){let y=R(k);return y&&!y.disableAutodetect}function x(k){if(k["before:highlightBlock"]&&!k["before:highlightElement"])k["before:highlightElement"]=(y)=>{k["before:highlightBlock"](Object.assign({block:y.el},y))};if(k["after:highlightBlock"]&&!k["after:highlightElement"])k["after:highlightElement"]=(y)=>{k["after:highlightBlock"](Object.assign({block:y.el},y))}}function I(k){x(k),H.push(k)}function S(k){let y=H.indexOf(k);if(y!==-1)H.splice(y,1)}function j(k,y){let v=k;H.forEach(function(u){if(u[v])u[v](y)})}function C(k){return DJ("10.7.0","highlightBlock will be removed entirely in v12.0"),DJ("10.7.0","Please use highlightElement now."),N(k)}Object.assign($,{highlight:U,highlightAuto:W,highlightAll:_,highlightElement:N,highlightBlock:C,configure:V,initHighlighting:L,initHighlightingOnLoad:A,registerLanguage:P,unregisterLanguage:D,listLanguages:w,getLanguage:R,registerAliases:b,autoDetection:E,inherit:gb,addPlugin:I,removePlugin:S}),$.debugMode=function(){B=!1},$.safeMode=function(){B=!0},$.versionString=n20,$.regex={concat:A6,lookahead:db,either:qL,optional:F20,anyNumberOfTimes:U20};for(let k in qU)if(typeof qU[k]==="object")mb(qU[k]);return Object.assign($,qU),$},MJ=$y({});MJ.newInstance=()=>$y({});Jy.exports=MJ;MJ.HighlightJS=MJ;MJ.default=MJ});var Hx=X5((v$1,Zx)=>{var O90=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],Jx=/[\n\r\u2028\u2029]/,j90=/[\s#!"$&'():;<=>@\\^`|]/g;Zx.exports=function(J){return J.map(function(Z){if(Z==="")return"''";if(Z&&typeof Z==="object"){if("op"in Z&&Z.op==="glob"){if(typeof Z.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(Jx.test(Z.pattern))throw TypeError("glob `pattern` must not contain line terminators");return Z.pattern.replace(j90,"\\$&")}if("op"in Z&&typeof Z.op==="string"){if(O90.indexOf(Z.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(Z.op));return Z.op.replace(/[\s\S]/g,"\\$&")}if("comment"in Z&&typeof Z.comment==="string"){if(Jx.test(Z.comment))throw TypeError("`comment` must not contain line terminators");return"#"+Z.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(Z)&&!/'/.test(Z))return"'"+Z.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(Z))return'"'+Z.replace(/(["\\$`!])/g,"\\$1")+'"';return String(Z).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}});var Ux=X5((g$1,Yx)=>{var Gx="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",Bx=new RegExp("^"+Gx+"$"),Qx="|&;()<> \\t",T90="'([^']*?)'",C90='"((\\\\"|[^"])*?)"',w90=/^#$/,Xx="'",zx='"',CU="$",P6="",E90=4294967296;for(wU=0;wU<4;wU++)P6+=(E90*Math.random()).toString(16);var wU,S90=new RegExp("^"+P6);function I90($,J){var Z=J.lastIndex,H=[],B;while(B=J.exec($))if(H[H.length]=B,J.lastIndex===B.index)J.lastIndex+=1;return J.lastIndex=Z,H}function R90($,J,Z){var H=typeof $==="function"?$(Z):$[Z];if(typeof H>"u"&&Z!="")H="";else if(typeof H>"u")H="$";if(typeof H==="object")return J+P6+JSON.stringify(H)+P6;return J+H}function k90($,J,Z){if(!Z)Z={};var H=Z.escape||"\\",B=Z.splitUnquoted===!0?`
|
|
5
|
+
`:typeof Z.splitUnquoted==="string"?Z.splitUnquoted:"",Q="(\\"+H+`['"`+Qx+`]|[^\\s'"`+Qx+"])+",X=new RegExp(["("+Gx+")","("+Q+"|"+C90+"|"+T90+")+"].join("|"),"g"),z=I90($,X);if(z.length===0)return[];if(!J)J={};var G=!1;return z.map(function(Y){var U=Y[0];if(!U||G)return;if(Bx.test(U))return{op:U};var F=!1,K=!1,W="",q=[],N=!1,V=null,L=!1,A;function M(){A+=1;var x,I,S=U.charAt(A);if(S==="{"){if(A+=1,U.charAt(A)==="}")throw Error("Bad substitution: "+U.slice(A-2,A+1));var j=1;x=A;while(j>0&&x<U.length){if(U.charAt(x)==="{"&&U.charAt(x-1)==="$")j+=1;else if(U.charAt(x)==="}")j-=1;x+=1}if(j!==0)throw Error("Bad substitution: "+U.slice(A));x-=1,I=U.slice(A,x),A=x}else if(/[*@#?$!_-]/.test(S))I=S,A+=1;else{var C=U.slice(A);if(x=C.match(/[^\w\d_]/),!x)I=C,A=U.length;else I=C.slice(0,x.index),A+=x.index-1}return R90(J,"",I)}function _(){if(V===null)return;if(V===0){if(W!=="")q[q.length]=W,W=""}else{q[q.length]=W,W="";for(var x=1;x<V;x+=1)q[q.length]=""}V=null}for(A=0;A<U.length;A++){var P=U.charAt(A);if(B&&P!==CU)_();if(L=L||!F&&(P==="*"||P==="?"),K)W+=P,K=!1;else if(F)if(P===F)F=!1;else if(F==Xx)W+=P;else if(P===H)if(A+=1,P=U.charAt(A),P===zx||P===H||P===CU)W+=P;else W+=H+P;else if(P===CU)W+=M();else W+=P;else if(P===zx||P===Xx)F=P,N=!0;else if(Bx.test(P))return{op:U};else if(w90.test(P)){G=!0;var D={comment:$.slice(Y.index+A+1)};if(W.length)return[W,D];return[D]}else if(P===H)K=!0;else if(P===CU){var w=M();if(!B)W+=w;else for(var R=0;R<w.length;R+=1){var b=w.charAt(R);if(B.indexOf(b)<0)_(),W+=b;else if(V===null)V=b===" "||b==="\t"||b===`
|
|
6
|
+
`?0:1;else if(b!==" "&&b!=="\t"&&b!==`
|
|
7
|
+
`)V+=1}}else W+=P}if(L)return{op:"glob",pattern:W};if(B){if(V!==null&&V>0){q[q.length]=W,W="";for(var E=1;E<V;E+=1)q[q.length]=""}if(W!==""||N&&q.length===0)q[q.length]=W;return q}return W}).reduce(function(Y,U){if(typeof U>"u")return Y;return[].concat(U).forEach(function(F){Y[Y.length]=F}),Y},[])}Yx.exports=function(J,Z,H){var B=k90(J,Z,H);if(typeof Z!=="function")return B;return B.reduce(function(Q,X){if(typeof X==="object")return Q[Q.length]=X,Q;var z=X.split(RegExp("("+P6+".*?"+P6+")","g"));if(z.length===1)return Q[Q.length]=z[0],Q;return z.filter(Boolean).forEach(function(G){Q[Q.length]=S90.test(G)?JSON.parse(G.split(P6)[1]):G}),Q},[])}});var Pv=X5((uU,Mv)=>{(function($,J){typeof uU==="object"&&typeof Mv<"u"?J(uU):typeof define==="function"&&define.amd?define(["exports"],J):($=typeof globalThis<"u"?globalThis:$||self,J($["fast-equals"]={}))})(uU,function($){function J(l){return function(W0,Q0,G0,L0,i,$0,J0){return l(W0,Q0,J0)}}function Z(l){return function(W0,Q0,G0,L0){if(!W0||!Q0||typeof W0!=="object"||typeof Q0!=="object")return l(W0,Q0,G0,L0);var i=L0.get(W0),$0=L0.get(Q0);if(i&&$0)return i===Q0&&$0===W0;L0.set(W0,Q0),L0.set(Q0,W0);var J0=l(W0,Q0,G0,L0);return L0.delete(W0),L0.delete(Q0),J0}}function H(l,z0){var W0={};for(var Q0 in l)W0[Q0]=l[Q0];for(var Q0 in z0)W0[Q0]=z0[Q0];return W0}function B(l){return l.constructor===Object||l.constructor==null}function Q(l){return typeof l.then==="function"}function X(l,z0){return l===z0||l!==l&&z0!==z0}var z="[object Arguments]",G="[object Boolean]",Y="[object Date]",U="[object RegExp]",F="[object Map]",K="[object Number]",W="[object Object]",q="[object Set]",N="[object String]",V=Object.prototype.toString;function L(l){var{areArraysEqual:z0,areDatesEqual:W0,areMapsEqual:Q0,areObjectsEqual:G0,areRegExpsEqual:L0,areSetsEqual:i,createIsNestedEqual:$0}=l,J0=$0(H0);function H0(n,p,d){if(n===p)return!0;if(!n||!p||typeof n!=="object"||typeof p!=="object")return n!==n&&p!==p;if(B(n)&&B(p))return G0(n,p,J0,d);var m=Array.isArray(n),a=Array.isArray(p);if(m||a)return m===a&&z0(n,p,J0,d);var o=V.call(n);if(o!==V.call(p))return!1;if(o===Y)return W0(n,p,J0,d);if(o===U)return L0(n,p,J0,d);if(o===F)return Q0(n,p,J0,d);if(o===q)return i(n,p,J0,d);if(o===W||o===z)return Q(n)||Q(p)?!1:G0(n,p,J0,d);if(o===G||o===K||o===N)return X(n.valueOf(),p.valueOf());return!1}return H0}function A(l,z0,W0,Q0){var G0=l.length;if(z0.length!==G0)return!1;while(G0-- >0)if(!W0(l[G0],z0[G0],G0,G0,l,z0,Q0))return!1;return!0}var M=Z(A);function _(l,z0){return X(l.valueOf(),z0.valueOf())}function P(l,z0,W0,Q0){var G0=l.size===z0.size;if(!G0)return!1;if(!l.size)return!0;var L0={},i=0;return l.forEach(function($0,J0){if(!G0)return;var H0=!1,n=0;z0.forEach(function(p,d){if(!H0&&!L0[n]&&(H0=W0(J0,d,i,n,l,z0,Q0)&&W0($0,p,J0,d,l,z0,Q0)))L0[n]=!0;n++}),i++,G0=H0}),G0}var D=Z(P),w="_owner",R=Object.prototype.hasOwnProperty;function b(l,z0,W0,Q0){var G0=Object.keys(l),L0=G0.length;if(Object.keys(z0).length!==L0)return!1;var i;while(L0-- >0){if(i=G0[L0],i===w){var $0=!!l.$$typeof,J0=!!z0.$$typeof;if(($0||J0)&&$0!==J0)return!1}if(!R.call(z0,i)||!W0(l[i],z0[i],i,i,l,z0,Q0))return!1}return!0}var E=Z(b);function x(l,z0){return l.source===z0.source&&l.flags===z0.flags}function I(l,z0,W0,Q0){var G0=l.size===z0.size;if(!G0)return!1;if(!l.size)return!0;var L0={};return l.forEach(function(i,$0){if(!G0)return;var J0=!1,H0=0;z0.forEach(function(n,p){if(!J0&&!L0[H0]&&(J0=W0(i,n,$0,p,l,z0,Q0)))L0[H0]=!0;H0++}),G0=J0}),G0}var S=Z(I),j=Object.freeze({areArraysEqual:A,areDatesEqual:_,areMapsEqual:P,areObjectsEqual:b,areRegExpsEqual:x,areSetsEqual:I,createIsNestedEqual:J}),C=Object.freeze({areArraysEqual:M,areDatesEqual:_,areMapsEqual:D,areObjectsEqual:E,areRegExpsEqual:x,areSetsEqual:S,createIsNestedEqual:J}),k=L(j);function y(l,z0){return k(l,z0,void 0)}var v=L(H(j,{createIsNestedEqual:function(){return X}}));function u(l,z0){return v(l,z0,void 0)}var T=L(C);function t(l,z0){return T(l,z0,new WeakMap)}var B0=L(H(C,{createIsNestedEqual:function(){return X}}));function h(l,z0){return B0(l,z0,new WeakMap)}function e(l){return L(H(j,l(j)))}function A0(l){var z0=L(H(C,l(C)));return function(W0,Q0,G0){if(G0===void 0)G0=new WeakMap;return z0(W0,Q0,G0)}}$.circularDeepEqual=t,$.circularShallowEqual=h,$.createCustomCircularEqual=A0,$.createCustomEqual=e,$.deepEqual=y,$.sameValueZeroEqual=X,$.shallowEqual=u,Object.defineProperty($,"__esModule",{value:!0})})});var Ov=X5((RJ1,_v)=>{var E$0="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";_v.exports=E$0});var wv=X5((kJ1,Cv)=>{var S$0=Ov();function jv(){}function Tv(){}Tv.resetWarningCache=jv;Cv.exports=function(){function $(H,B,Q,X,z,G){if(G===S$0)return;var Y=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 Y.name="Invariant Violation",Y}$.isRequired=$;function J(){return $}var Z={array:$,bigint:$,bool:$,func:$,number:$,object:$,string:$,symbol:$,any:$,arrayOf:J,element:$,elementType:$,instanceOf:J,node:$,objectOf:J,oneOf:J,oneOfType:J,shape:J,exact:J,checkPropTypes:Tv,resetWarningCache:jv};return Z.PropTypes=Z,Z}});var wB=X5((bJ1,Ev)=>{Ev.exports=wv()();var I$0,R$0});var Rv=X5((yJ1,cV)=>{function Iv($){var J,Z,H="";if(typeof $=="string"||typeof $=="number")H+=$;else if(typeof $=="object")if(Array.isArray($)){var B=$.length;for(J=0;J<B;J++)$[J]&&(Z=Iv($[J]))&&(H&&(H+=" "),H+=Z)}else for(Z in $)$[Z]&&(H&&(H+=" "),H+=Z);return H}function Sv(){for(var $,J,Z=0,H="",B=arguments.length;Z<B;Z++)($=arguments[Z])&&(J=Iv($))&&(H&&(H+=" "),H+=J);return H}cV.exports=Sv,cV.exports.clsx=Sv});var EB=X5((kv)=>{Object.defineProperty(kv,"__esModule",{value:!0});kv.dontSetMe=x$0;kv.findInArray=k$0;kv.int=h$0;kv.isFunction=b$0;kv.isNum=y$0;function k$0($,J){for(let Z=0,H=$.length;Z<H;Z++)if(J.apply(J,[$[Z],Z,$]))return $[Z]}function b$0($){return typeof $==="function"||Object.prototype.toString.call($)==="[object Function]"}function y$0($){return typeof $==="number"&&!isNaN($)}function h$0($){return parseInt($,10)}function x$0($,J,Z){if($[J])return Error(`Invalid prop ${J} passed to ${Z} - do not set this, set it on the child.`)}});var vv=X5((hv)=>{Object.defineProperty(hv,"__esModule",{value:!0});hv.browserPrefixToKey=yv;hv.browserPrefixToStyle=u$0;hv.default=void 0;hv.getPrefix=bv;var dV=["Moz","Webkit","O","ms"];function bv(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";let J=window.document?.documentElement?.style;if(!J)return"";if($ in J)return"";for(let Z=0;Z<dV.length;Z++)if(yv($,dV[Z])in J)return dV[Z];return""}function yv($,J){return J?`${J}${c$0($)}`:$}function u$0($,J){return J?`-${J.toLowerCase()}-${$}`:$}function c$0($){let J="",Z=!0;for(let H=0;H<$.length;H++)if(Z)J+=$[H].toUpperCase(),Z=!1;else if($[H]==="-")Z=!0;else J+=$[H];return J}var xJ1=hv.default=bv()});var dU=X5((dv)=>{Object.defineProperty(dv,"__esModule",{value:!0});dv.addClassName=uv;dv.addEvent=a$0;dv.addUserSelectStyles=Q60;dv.createCSSTransform=J60;dv.createSVGTransform=Z60;dv.getTouch=H60;dv.getTouchIdentifier=B60;dv.getTranslation=lV;dv.innerHeight=t$0;dv.innerWidth=e$0;dv.matchesSelector=pv;dv.matchesSelectorAndParentsTo=r$0;dv.offsetXYFromParent=$60;dv.outerHeight=o$0;dv.outerWidth=s$0;dv.removeClassName=cv;dv.removeEvent=n$0;dv.scheduleRemoveUserSelectStyles=X60;var h4=EB(),gv=mv(vv());function mv($,J){if(typeof WeakMap=="function")var Z=new WeakMap,H=new WeakMap;return(mv=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:Z){if(X.has(B))return X.get(B);X.set(B,G)}for(let Y in B)Y!=="default"&&{}.hasOwnProperty.call(B,Y)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,Y))&&(z.get||z.set)?X(G,Y,z):G[Y]=B[Y]);return G})($,J)}var cU="";function pv($,J){if(!cU)cU=(0,h4.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(Z){return(0,h4.isFunction)($[Z])});if(!(0,h4.isFunction)($[cU]))return!1;return $[cU](J)}function r$0($,J,Z){let H=$;do{if(pv(H,J))return!0;if(H===Z)return!1;H=H.parentNode}while(H);return!1}function a$0($,J,Z,H){if(!$)return;let B={capture:!0,...H};if($.addEventListener)$.addEventListener(J,Z,B);else if($.attachEvent)$.attachEvent("on"+J,Z);else $["on"+J]=Z}function n$0($,J,Z,H){if(!$)return;let B={capture:!0,...H};if($.removeEventListener)$.removeEventListener(J,Z,B);else if($.detachEvent)$.detachEvent("on"+J,Z);else $["on"+J]=null}function o$0($){let J=$.clientHeight,Z=$.ownerDocument.defaultView.getComputedStyle($);return J+=(0,h4.int)(Z.borderTopWidth),J+=(0,h4.int)(Z.borderBottomWidth),J}function s$0($){let J=$.clientWidth,Z=$.ownerDocument.defaultView.getComputedStyle($);return J+=(0,h4.int)(Z.borderLeftWidth),J+=(0,h4.int)(Z.borderRightWidth),J}function t$0($){let J=$.clientHeight,Z=$.ownerDocument.defaultView.getComputedStyle($);return J-=(0,h4.int)(Z.paddingTop),J-=(0,h4.int)(Z.paddingBottom),J}function e$0($){let J=$.clientWidth,Z=$.ownerDocument.defaultView.getComputedStyle($);return J-=(0,h4.int)(Z.paddingLeft),J-=(0,h4.int)(Z.paddingRight),J}function $60($,J,Z){let B=J===J.ownerDocument.body?{left:0,top:0}:J.getBoundingClientRect(),Q=($.clientX+J.scrollLeft-B.left)/Z,X=($.clientY+J.scrollTop-B.top)/Z;return{x:Q,y:X}}function J60($,J){let Z=lV($,J,"px");return{[(0,gv.browserPrefixToKey)("transform",gv.default)]:Z}}function Z60($,J){return lV($,J,"")}function lV($,J,Z){let{x:H,y:B}=$,Q=`translate(${H}${Z},${B}${Z})`;if(J){let X=`${typeof J.x==="string"?J.x:J.x+Z}`,z=`${typeof J.y==="string"?J.y:J.y+Z}`;Q=`translate(${X}, ${z})`+Q}return Q}function H60($,J){return $.targetTouches&&(0,h4.findInArray)($.targetTouches,(Z)=>J===Z.identifier)||$.changedTouches&&(0,h4.findInArray)($.changedTouches,(Z)=>J===Z.identifier)}function B60($){if($.targetTouches&&$.targetTouches[0])return $.targetTouches[0].identifier;if($.changedTouches&&$.changedTouches[0])return $.changedTouches[0].identifier}function Q60($){if(!$)return;let J=$.getElementById("react-draggable-style-el");if(!J)J=$.createElement("style"),J.type="text/css",J.id="react-draggable-style-el",J.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
8
|
+
`,J.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
9
|
+
`,$.getElementsByTagName("head")[0].appendChild(J);if($.body)uv($.body,"react-draggable-transparent-selection")}function X60($){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{fv($)});else fv($)}function fv($){if(!$)return;try{if($.body)cv($.body,"react-draggable-transparent-selection");if($.selection)$.selection.empty();else{let J=($.defaultView||window).getSelection();if(J&&J.type!=="Caret")J.removeAllRanges()}}catch(J){}}function uv($,J){if($.classList)$.classList.add(J);else if(!$.className.match(new RegExp(`(?:^|\\s)${J}(?!\\S)`)))$.className+=` ${J}`}function cv($,J){if($.classList)$.classList.remove(J);else $.className=$.className.replace(new RegExp(`(?:^|\\s)${J}(?!\\S)`,"g"),"")}});var rV=X5((lv)=>{Object.defineProperty(lv,"__esModule",{value:!0});lv.canDragX=w60;lv.canDragY=E60;lv.createCoreData=I60;lv.createDraggableData=R60;lv.getBoundPosition=T60;lv.getControlPosition=S60;lv.snapToGrid=C60;var x4=EB(),vJ=dU();function T60($,J,Z){if(!$.props.bounds)return[J,Z];let{bounds:H}=$.props;H=typeof H==="string"?H:k60(H);let B=iV($);if(typeof H==="string"){let{ownerDocument:Q}=B,X=Q.defaultView,z;if(H==="parent")z=B.parentNode;else z=B.getRootNode().querySelector(H);if(!(z instanceof X.HTMLElement))throw Error('Bounds selector "'+H+'" could not find an element.');let G=z,Y=X.getComputedStyle(B),U=X.getComputedStyle(G);H={left:-B.offsetLeft+(0,x4.int)(U.paddingLeft)+(0,x4.int)(Y.marginLeft),top:-B.offsetTop+(0,x4.int)(U.paddingTop)+(0,x4.int)(Y.marginTop),right:(0,vJ.innerWidth)(G)-(0,vJ.outerWidth)(B)-B.offsetLeft+(0,x4.int)(U.paddingRight)-(0,x4.int)(Y.marginRight),bottom:(0,vJ.innerHeight)(G)-(0,vJ.outerHeight)(B)-B.offsetTop+(0,x4.int)(U.paddingBottom)-(0,x4.int)(Y.marginBottom)}}if((0,x4.isNum)(H.right))J=Math.min(J,H.right);if((0,x4.isNum)(H.bottom))Z=Math.min(Z,H.bottom);if((0,x4.isNum)(H.left))J=Math.max(J,H.left);if((0,x4.isNum)(H.top))Z=Math.max(Z,H.top);return[J,Z]}function C60($,J,Z){let H=Math.round(J/$[0])*$[0],B=Math.round(Z/$[1])*$[1];return[H,B]}function w60($){return $.props.axis==="both"||$.props.axis==="x"}function E60($){return $.props.axis==="both"||$.props.axis==="y"}function S60($,J,Z){let H=typeof J==="number"?(0,vJ.getTouch)($,J):null;if(typeof J==="number"&&!H)return null;let B=iV(Z),Q=Z.props.offsetParent||B.offsetParent||B.ownerDocument.body;return(0,vJ.offsetXYFromParent)(H||$,Q,Z.props.scale)}function I60($,J,Z){let H=!(0,x4.isNum)($.lastX),B=iV($);if(H)return{node:B,deltaX:0,deltaY:0,lastX:J,lastY:Z,x:J,y:Z};else return{node:B,deltaX:J-$.lastX,deltaY:Z-$.lastY,lastX:$.lastX,lastY:$.lastY,x:J,y:Z}}function R60($,J){let Z=$.props.scale;return{node:J.node,x:$.state.x+J.deltaX/Z,y:$.state.y+J.deltaY/Z,deltaX:J.deltaX/Z,deltaY:J.deltaY/Z,lastX:$.state.x,lastY:$.state.y}}function k60($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom}}function iV($){let J=$.findDOMNode();if(!J)throw Error("<DraggableCore>: Unmounted during event!");return J}});var aV=X5((iv)=>{Object.defineProperty(iv,"__esModule",{value:!0});iv.default=m60;function m60(){}});var ov=X5((av)=>{var l60=O(g()),i60=O(G4());Object.defineProperty(av,"__esModule",{value:!0});av.default=void 0;var nV=rv(l60),H4=sV(wB()),u60=sV(i60),p2=dU(),$$=rV(),oV=EB(),SB=sV(aV());function sV($){return $&&$.__esModule?$:{default:$}}function rv($,J){if(typeof WeakMap=="function")var Z=new WeakMap,H=new WeakMap;return(rv=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:Z){if(X.has(B))return X.get(B);X.set(B,G)}for(let Y in B)Y!=="default"&&{}.hasOwnProperty.call(B,Y)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,Y))&&(z.get||z.set)?X(G,Y,z):G[Y]=B[Y]);return G})($,J)}function B4($,J,Z){return(J=c60(J))in $?Object.defineProperty($,J,{value:Z,enumerable:!0,configurable:!0,writable:!0}):$[J]=Z,$}function c60($){var J=d60($,"string");return typeof J=="symbol"?J:J+""}function d60($,J){if(typeof $!="object"||!$)return $;var Z=$[Symbol.toPrimitive];if(Z!==void 0){var H=Z.call($,J||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)($)}var w8={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},J$=w8.mouse;class IB extends nV.Component{constructor(){super(...arguments);B4(this,"dragging",!1),B4(this,"lastX",NaN),B4(this,"lastY",NaN),B4(this,"touchIdentifier",null),B4(this,"mounted",!1),B4(this,"handleDragStart",($)=>{if(this.props.onMouseDown($),!this.props.allowAnyClick&&typeof $.button==="number"&&$.button!==0)return!1;let J=this.findDOMNode();if(!J||!J.ownerDocument||!J.ownerDocument.body)throw Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:Z}=J;if(this.props.disabled||!($.target instanceof Z.defaultView.Node)||this.props.handle&&!(0,p2.matchesSelectorAndParentsTo)($.target,this.props.handle,J)||this.props.cancel&&(0,p2.matchesSelectorAndParentsTo)($.target,this.props.cancel,J))return;if($.type==="touchstart"&&!this.props.allowMobileScroll)$.preventDefault();let H=(0,p2.getTouchIdentifier)($);this.touchIdentifier=H;let B=(0,$$.getControlPosition)($,H,this);if(B==null)return;let{x:Q,y:X}=B,z=(0,$$.createCoreData)(this,Q,X);if((0,SB.default)("DraggableCore: handleDragStart: %j",z),(0,SB.default)("calling",this.props.onStart),this.props.onStart($,z)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,p2.addUserSelectStyles)(Z);this.dragging=!0,this.lastX=Q,this.lastY=X,(0,p2.addEvent)(Z,J$.move,this.handleDrag),(0,p2.addEvent)(Z,J$.stop,this.handleDragStop)}),B4(this,"handleDrag",($)=>{let J=(0,$$.getControlPosition)($,this.touchIdentifier,this);if(J==null)return;let{x:Z,y:H}=J;if(Array.isArray(this.props.grid)){let X=Z-this.lastX,z=H-this.lastY;if([X,z]=(0,$$.snapToGrid)(this.props.grid,X,z),!X&&!z)return;Z=this.lastX+X,H=this.lastY+z}let B=(0,$$.createCoreData)(this,Z,H);if((0,SB.default)("DraggableCore: handleDrag: %j",B),this.props.onDrag($,B)===!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=Z,this.lastY=H}),B4(this,"handleDragStop",($)=>{if(!this.dragging)return;let J=(0,$$.getControlPosition)($,this.touchIdentifier,this);if(J==null)return;let{x:Z,y:H}=J;if(Array.isArray(this.props.grid)){let z=Z-this.lastX||0,G=H-this.lastY||0;[z,G]=(0,$$.snapToGrid)(this.props.grid,z,G),Z=this.lastX+z,H=this.lastY+G}let B=(0,$$.createCoreData)(this,Z,H);if(this.props.onStop($,B)===!1||this.mounted===!1)return!1;let X=this.findDOMNode();if(X){if(this.props.enableUserSelectHack)(0,p2.scheduleRemoveUserSelectStyles)(X.ownerDocument)}if((0,SB.default)("DraggableCore: handleDragStop: %j",B),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,X)(0,SB.default)("DraggableCore: Removing handlers"),(0,p2.removeEvent)(X.ownerDocument,J$.move,this.handleDrag),(0,p2.removeEvent)(X.ownerDocument,J$.stop,this.handleDragStop)}),B4(this,"onMouseDown",($)=>{return J$=w8.mouse,this.handleDragStart($)}),B4(this,"onMouseUp",($)=>{return J$=w8.mouse,this.handleDragStop($)}),B4(this,"onTouchStart",($)=>{return J$=w8.touch,this.handleDragStart($)}),B4(this,"onTouchEnd",($)=>{return J$=w8.touch,this.handleDragStop($)})}componentDidMount(){this.mounted=!0;let $=this.findDOMNode();if($)(0,p2.addEvent)($,w8.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let $=this.findDOMNode();if($){let{ownerDocument:J}=$;if((0,p2.removeEvent)(J,w8.mouse.move,this.handleDrag),(0,p2.removeEvent)(J,w8.touch.move,this.handleDrag),(0,p2.removeEvent)(J,w8.mouse.stop,this.handleDragStop),(0,p2.removeEvent)(J,w8.touch.stop,this.handleDragStop),(0,p2.removeEvent)($,w8.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,p2.scheduleRemoveUserSelectStyles)(J)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:u60.default.findDOMNode(this)}render(){return nV.cloneElement(nV.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}av.default=IB;B4(IB,"displayName","DraggableCore");B4(IB,"propTypes",{allowAnyClick:H4.default.bool,allowMobileScroll:H4.default.bool,children:H4.default.node.isRequired,disabled:H4.default.bool,enableUserSelectHack:H4.default.bool,offsetParent:function($,J){if($[J]&&$[J].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:H4.default.arrayOf(H4.default.number),handle:H4.default.string,cancel:H4.default.string,nodeRef:H4.default.object,onStart:H4.default.func,onDrag:H4.default.func,onStop:H4.default.func,onMouseDown:H4.default.func,scale:H4.default.number,className:oV.dontSetMe,style:oV.dontSetMe,transform:oV.dontSetMe});B4(IB,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var $g=X5(($A)=>{var s60=O(g()),t60=O(G4());Object.defineProperty($A,"__esModule",{value:!0});Object.defineProperty($A,"DraggableCore",{enumerable:!0,get:function(){return rU.default}});$A.default=void 0;var lU=tv(s60),N5=aU(wB()),r60=aU(t60),a60=Rv(),sv=dU(),gJ=rV(),tV=EB(),rU=aU(ov()),iU=aU(aV());function aU($){return $&&$.__esModule?$:{default:$}}function tv($,J){if(typeof WeakMap=="function")var Z=new WeakMap,H=new WeakMap;return(tv=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:Z){if(X.has(B))return X.get(B);X.set(B,G)}for(let Y in B)Y!=="default"&&{}.hasOwnProperty.call(B,Y)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,Y))&&(z.get||z.set)?X(G,Y,z):G[Y]=B[Y]);return G})($,J)}function eV(){return eV=Object.assign?Object.assign.bind():function($){for(var J=1;J<arguments.length;J++){var Z=arguments[J];for(var H in Z)({}).hasOwnProperty.call(Z,H)&&($[H]=Z[H])}return $},eV.apply(null,arguments)}function fJ($,J,Z){return(J=n60(J))in $?Object.defineProperty($,J,{value:Z,enumerable:!0,configurable:!0,writable:!0}):$[J]=Z,$}function n60($){var J=o60($,"string");return typeof J=="symbol"?J:J+""}function o60($,J){if(typeof $!="object"||!$)return $;var Z=$[Symbol.toPrimitive];if(Z!==void 0){var H=Z.call($,J||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)($)}class RB extends lU.Component{static getDerivedStateFromProps($,J){let{position:Z}=$,{prevPropsPosition:H}=J;if(Z&&(!H||Z.x!==H.x||Z.y!==H.y))return(0,iU.default)("Draggable: getDerivedStateFromProps %j",{position:Z,prevPropsPosition:H}),{x:Z.x,y:Z.y,prevPropsPosition:{...Z}};return null}constructor($){super($);if(fJ(this,"onDragStart",(J,Z)=>{if((0,iU.default)("Draggable: onDragStart: %j",Z),this.props.onStart(J,(0,gJ.createDraggableData)(this,Z))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),fJ(this,"onDrag",(J,Z)=>{if(!this.state.dragging)return!1;(0,iU.default)("Draggable: onDrag: %j",Z);let H=(0,gJ.createDraggableData)(this,Z),B={x:H.x,y:H.y,slackX:0,slackY:0};if(this.props.bounds){let{x:X,y:z}=B;B.x+=this.state.slackX,B.y+=this.state.slackY;let[G,Y]=(0,gJ.getBoundPosition)(this,B.x,B.y);B.x=G,B.y=Y,B.slackX=this.state.slackX+(X-B.x),B.slackY=this.state.slackY+(z-B.y),H.x=B.x,H.y=B.y,H.deltaX=B.x-this.state.x,H.deltaY=B.y-this.state.y}if(this.props.onDrag(J,H)===!1)return!1;this.setState(B)}),fJ(this,"onDragStop",(J,Z)=>{if(!this.state.dragging)return!1;if(this.props.onStop(J,(0,gJ.createDraggableData)(this,Z))===!1)return!1;(0,iU.default)("Draggable: onDragStop: %j",Z);let B={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){let{x:X,y:z}=this.props.position;B.x=X,B.y=z}this.setState(B)}),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??r60.default.findDOMNode(this)}render(){let{axis:$,bounds:J,children:Z,defaultPosition:H,defaultClassName:B,defaultClassNameDragging:Q,defaultClassNameDragged:X,position:z,positionOffset:G,scale:Y,...U}=this.props,F={},K=null,q=!Boolean(z)||this.state.dragging,N=z||H,V={x:(0,gJ.canDragX)(this)&&q?this.state.x:N.x,y:(0,gJ.canDragY)(this)&&q?this.state.y:N.y};if(this.state.isElementSVG)K=(0,sv.createSVGTransform)(V,G);else F=(0,sv.createCSSTransform)(V,G);let L=(0,a60.clsx)(Z.props.className||"",B,{[Q]:this.state.dragging,[X]:this.state.dragged});return lU.createElement(rU.default,eV({},U,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),lU.cloneElement(lU.Children.only(Z),{className:L,style:{...Z.props.style,...F},transform:K}))}}$A.default=RB;fJ(RB,"displayName","Draggable");fJ(RB,"propTypes",{...rU.default.propTypes,axis:N5.default.oneOf(["both","x","y","none"]),bounds:N5.default.oneOfType([N5.default.shape({left:N5.default.number,right:N5.default.number,top:N5.default.number,bottom:N5.default.number}),N5.default.string,N5.default.oneOf([!1])]),defaultClassName:N5.default.string,defaultClassNameDragging:N5.default.string,defaultClassNameDragged:N5.default.string,defaultPosition:N5.default.shape({x:N5.default.number,y:N5.default.number}),positionOffset:N5.default.shape({x:N5.default.oneOfType([N5.default.number,N5.default.string]),y:N5.default.oneOfType([N5.default.number,N5.default.string])}),position:N5.default.shape({x:N5.default.number,y:N5.default.number}),className:tV.dontSetMe,style:tV.dontSetMe,transform:tV.dontSetMe});fJ(RB,"defaultProps",{...rU.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 oU=X5((cJ1,nU)=>{var{default:Jg,DraggableCore:e60}=$g();nU.exports=Jg;nU.exports.default=Jg;nU.exports.DraggableCore=e60});var Bg=X5((X70)=>{var Y70=O(g());X70.__esModule=!0;X70.cloneElement=Q70;var $70=J70(Y70);function J70($){return $&&$.__esModule?$:{default:$}}function Zg($,J){var Z=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);J&&(H=H.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),Z.push.apply(Z,H)}return Z}function Hg($){for(var J=1;J<arguments.length;J++){var Z=arguments[J]!=null?arguments[J]:{};J%2?Zg(Object(Z),!0).forEach(function(H){Z70($,H,Z[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(Z)):Zg(Object(Z)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(Z,H))})}return $}function Z70($,J,Z){return(J=H70(J))in $?Object.defineProperty($,J,{value:Z,enumerable:!0,configurable:!0,writable:!0}):$[J]=Z,$}function H70($){var J=B70($,"string");return typeof J=="symbol"?J:J+""}function B70($,J){if(typeof $!="object"||!$)return $;var Z=$[Symbol.toPrimitive];if(Z!==void 0){var H=Z.call($,J||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)($)}function Q70($,J){if(J.style&&$.props.style)J.style=Hg(Hg({},$.props.style),J.style);if(J.className&&$.props.className)J.className=`${$.props.className} ${J.className}`;return $70.default.cloneElement($,J)}});var JA=X5((F70)=>{F70.__esModule=!0;F70.resizableProps=void 0;var L1=U70(wB()),lJ1=oU();function U70($){return $&&$.__esModule?$:{default:$}}var iJ1=F70.resizableProps={axis:L1.default.oneOf(["both","x","y","none"]),className:L1.default.string,children:L1.default.element.isRequired,draggableOpts:L1.default.shape({allowAnyClick:L1.default.bool,cancel:L1.default.string,children:L1.default.node,disabled:L1.default.bool,enableUserSelectHack:L1.default.bool,offsetParent:typeof Element<"u"?L1.default.instanceOf(Element):L1.default.any,grid:L1.default.arrayOf(L1.default.number),handle:L1.default.string,nodeRef:L1.default.object,onStart:L1.default.func,onDrag:L1.default.func,onStop:L1.default.func,onMouseDown:L1.default.func,scale:L1.default.number}),height:function(){for(var $=arguments.length,J=Array($),Z=0;Z<$;Z++)J[Z]=arguments[Z];let[H]=J;if(H.axis==="both"||H.axis==="y")return L1.default.number.isRequired(...J);return L1.default.number(...J)},handle:L1.default.oneOfType([L1.default.node,L1.default.func]),handleSize:L1.default.arrayOf(L1.default.number),lockAspectRatio:L1.default.bool,maxConstraints:L1.default.arrayOf(L1.default.number),minConstraints:L1.default.arrayOf(L1.default.number),onResizeStop:L1.default.func,onResizeStart:L1.default.func,onResize:L1.default.func,resizeHandles:L1.default.arrayOf(L1.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:L1.default.number,width:function(){for(var $=arguments.length,J=Array($),Z=0;Z<$;Z++)J[Z]=arguments[Z];let[H]=J;if(H.axis==="both"||H.axis==="x")return L1.default.number.isRequired(...J);return L1.default.number(...J)}}});var BA=X5((_70)=>{var j70=O(g());_70.__esModule=!0;_70.default=void 0;var mJ=zg(j70),W70=oU(),q70=Bg(),N70=JA(),L70=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function zg($,J){if(typeof WeakMap=="function")var Z=new WeakMap,H=new WeakMap;return(zg=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:Z){if(X.has(B))return X.get(B);X.set(B,G)}for(let Y in B)Y!=="default"&&{}.hasOwnProperty.call(B,Y)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,Y))&&(z.get||z.set)?X(G,Y,z):G[Y]=B[Y]);return G})($,J)}function HA(){return HA=Object.assign?Object.assign.bind():function($){for(var J=1;J<arguments.length;J++){var Z=arguments[J];for(var H in Z)({}).hasOwnProperty.call(Z,H)&&($[H]=Z[H])}return $},HA.apply(null,arguments)}function V70($,J){if($==null)return{};var Z,H,B=A70($,J);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);for(H=0;H<Q.length;H++)Z=Q[H],J.indexOf(Z)===-1&&{}.propertyIsEnumerable.call($,Z)&&(B[Z]=$[Z])}return B}function A70($,J){if($==null)return{};var Z={};for(var H in $)if({}.hasOwnProperty.call($,H)){if(J.indexOf(H)!==-1)continue;Z[H]=$[H]}return Z}function Xg($,J){var Z=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);J&&(H=H.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),Z.push.apply(Z,H)}return Z}function ZA($){for(var J=1;J<arguments.length;J++){var Z=arguments[J]!=null?arguments[J]:{};J%2?Xg(Object(Z),!0).forEach(function(H){D70($,H,Z[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(Z)):Xg(Object(Z)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(Z,H))})}return $}function D70($,J,Z){return(J=M70(J))in $?Object.defineProperty($,J,{value:Z,enumerable:!0,configurable:!0,writable:!0}):$[J]=Z,$}function M70($){var J=P70($,"string");return typeof J=="symbol"?J:J+""}function P70($,J){if(typeof $!="object"||!$)return $;var Z=$[Symbol.toPrimitive];if(Z!==void 0){var H=Z.call($,J||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)($)}class sU extends mJ.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($,J){let{minConstraints:Z,maxConstraints:H,lockAspectRatio:B}=this.props;if(!Z&&!H&&!B)return[$,J];if(B){let Y=this.props.width/this.props.height,U=$-this.props.width,F=J-this.props.height;if(Math.abs(U)>Math.abs(F*Y))J=$/Y;else $=J*Y}let[Q,X]=[$,J],[z,G]=this.slack||[0,0];if($+=z,J+=G,Z)$=Math.max(Z[0],$),J=Math.max(Z[1],J);if(H)$=Math.min(H[0],$),J=Math.min(H[1],J);return this.slack=[z+(Q-$),G+(X-J)],[$,J]}resizeHandler($,J){return(Z,H)=>{let{node:B,deltaX:Q,deltaY:X}=H;if($==="onResizeStart")this.resetData();let z=(this.props.axis==="both"||this.props.axis==="x")&&J!=="n"&&J!=="s",G=(this.props.axis==="both"||this.props.axis==="y")&&J!=="e"&&J!=="w";if(!z&&!G)return;let Y=J[0],U=J[J.length-1],F=B.getBoundingClientRect();if(this.lastHandleRect!=null){if(U==="w"){let L=F.left-this.lastHandleRect.left;Q+=L}if(Y==="n"){let L=F.top-this.lastHandleRect.top;X+=L}}if(this.lastHandleRect=F,U==="w")Q=-Q;if(Y==="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 q=K!==this.props.width||W!==this.props.height;if($!=="onResizeStop")this.lastSize={width:K,height:W};let N=typeof this.props[$]==="function"?this.props[$]:null;if(N&&!($==="onResize"&&!q))Z.persist?.(),N(Z,{node:B,size:{width:K,height:W},handle:J});if($==="onResizeStop")this.resetData()}}renderResizeHandle($,J){let{handle:Z}=this.props;if(!Z)return mJ.createElement("span",{className:`react-resizable-handle react-resizable-handle-${$}`,ref:J});if(typeof Z==="function")return Z($,J);let H=typeof Z.type==="string",B=ZA({ref:J},H?{}:{handleAxis:$});return mJ.cloneElement(Z,B)}render(){let $=this.props,{children:J,className:Z,draggableOpts:H,width:B,height:Q,handle:X,handleSize:z,lockAspectRatio:G,axis:Y,minConstraints:U,maxConstraints:F,onResize:K,onResizeStop:W,onResizeStart:q,resizeHandles:N,transformScale:V}=$,L=V70($,L70);return(0,q70.cloneElement)(J,ZA(ZA({},L),{},{className:`${Z?`${Z} `:""}react-resizable`,children:[...mJ.Children.toArray(J.props.children),...N.map((A)=>{let M=this.handleRefs[A]??(this.handleRefs[A]=mJ.createRef());return mJ.createElement(W70.DraggableCore,HA({},H,{nodeRef:M,key:`resizableHandle-${A}`,onStop:this.resizeHandler("onResizeStop",A),onStart:this.resizeHandler("onResizeStart",A),onDrag:this.resizeHandler("onResize",A)}),this.renderResizeHandle(A,M))})]}))}}_70.default=sU;sU.propTypes=N70.resizableProps;sU.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var Wg=X5((y70)=>{var x70=O(g());y70.__esModule=!0;y70.default=void 0;var QA=Fg(x70),T70=Ug(wB()),C70=Ug(BA()),w70=JA(),E70=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Ug($){return $&&$.__esModule?$:{default:$}}function Fg($,J){if(typeof WeakMap=="function")var Z=new WeakMap,H=new WeakMap;return(Fg=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:Z){if(X.has(B))return X.get(B);X.set(B,G)}for(let Y in B)Y!=="default"&&{}.hasOwnProperty.call(B,Y)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,Y))&&(z.get||z.set)?X(G,Y,z):G[Y]=B[Y]);return G})($,J)}function XA(){return XA=Object.assign?Object.assign.bind():function($){for(var J=1;J<arguments.length;J++){var Z=arguments[J];for(var H in Z)({}).hasOwnProperty.call(Z,H)&&($[H]=Z[H])}return $},XA.apply(null,arguments)}function Yg($,J){var Z=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);J&&(H=H.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),Z.push.apply(Z,H)}return Z}function tU($){for(var J=1;J<arguments.length;J++){var Z=arguments[J]!=null?arguments[J]:{};J%2?Yg(Object(Z),!0).forEach(function(H){S70($,H,Z[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(Z)):Yg(Object(Z)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(Z,H))})}return $}function S70($,J,Z){return(J=I70(J))in $?Object.defineProperty($,J,{value:Z,enumerable:!0,configurable:!0,writable:!0}):$[J]=Z,$}function I70($){var J=R70($,"string");return typeof J=="symbol"?J:J+""}function R70($,J){if(typeof $!="object"||!$)return $;var Z=$[Symbol.toPrimitive];if(Z!==void 0){var H=Z.call($,J||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)($)}function k70($,J){if($==null)return{};var Z,H,B=b70($,J);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);for(H=0;H<Q.length;H++)Z=Q[H],J.indexOf(Z)===-1&&{}.propertyIsEnumerable.call($,Z)&&(B[Z]=$[Z])}return B}function b70($,J){if($==null)return{};var Z={};for(var H in $)if({}.hasOwnProperty.call($,H)){if(J.indexOf(H)!==-1)continue;Z[H]=$[H]}return Z}class zA extends QA.Component{constructor(){super(...arguments);this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=($,J)=>{let{size:Z}=J;if(this.props.onResize)$.persist?.(),this.setState(Z,()=>this.props.onResize&&this.props.onResize($,J));else this.setState(Z)}}static getDerivedStateFromProps($,J){if(J.propsWidth!==$.width||J.propsHeight!==$.height)return{width:$.width,height:$.height,propsWidth:$.width,propsHeight:$.height};return null}render(){let $=this.props,{handle:J,handleSize:Z,onResize:H,onResizeStart:B,onResizeStop:Q,draggableOpts:X,minConstraints:z,maxConstraints:G,lockAspectRatio:Y,axis:U,width:F,height:K,resizeHandles:W,style:q,transformScale:N}=$,V=k70($,E70);return QA.createElement(C70.default,{axis:U,draggableOpts:X,handle:J,handleSize:Z,height:this.state.height,lockAspectRatio:Y,maxConstraints:G,minConstraints:z,onResizeStart:B,onResize:this.onResize,onResizeStop:Q,resizeHandles:W,transformScale:N,width:this.state.width},QA.createElement("div",XA({},V,{style:tU(tU({},q),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}y70.default=zA;zA.propTypes=tU(tU({},w70.resizableProps),{},{children:T70.default.element})});var qg=X5((oJ1,eU)=>{eU.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};eU.exports.Resizable=BA().default;eU.exports.ResizableBox=Wg().default});var f4=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 hu=class extends f4{#$;#J;#Z;constructor(){super();this.#Z=($)=>{if(typeof window<"u"&&window.addEventListener){let J=()=>$();return window.addEventListener("visibilitychange",J,!1),()=>{window.removeEventListener("visibilitychange",J)}}return}}onSubscribe(){if(!this.#J)this.setEventListener(this.#Z)}onUnsubscribe(){if(!this.hasListeners())this.#J?.(),this.#J=void 0}setEventListener($){this.#Z=$,this.#J?.(),this.#J=$((J)=>{if(typeof J==="boolean")this.setFocused(J);else this.onFocus()})}setFocused($){if(this.#$!==$)this.#$=$,this.onFocus()}onFocus(){let $=this.isFocused();this.listeners.forEach((J)=>{J($)})}isFocused(){if(typeof this.#$==="boolean")return this.#$;return globalThis.document?.visibilityState!=="hidden"}},y6=new hu;var xu={setTimeout:($,J)=>setTimeout($,J),clearTimeout:($)=>clearTimeout($),setInterval:($,J)=>setInterval($,J),clearInterval:($)=>clearInterval($)},vu=class{#$=xu;#J=!1;setTimeoutProvider($){this.#$=$}setTimeout($,J){return this.#$.setTimeout($,J)}clearTimeout($){this.#$.clearTimeout($)}setInterval($,J){return this.#$.setInterval($,J)}clearInterval($){this.#$.clearInterval($)}},R8=new vu;function iA($){setTimeout($,0)}var IF=typeof window>"u"||"Deno"in globalThis;function k5(){}function nA($,J){return typeof $==="function"?$(J):$}function JZ($){return typeof $==="number"&&$>=0&&$!==1/0}function nB($,J){return Math.max($+(J||0)-Date.now(),0)}function z8($,J){return typeof $==="function"?$(J):$}function l2($,J){return typeof $==="function"?$(J):$}function oB($,J){let{type:Z="all",exact:H,fetchStatus:B,predicate:Q,queryKey:X,stale:z}=$;if(X){if(H){if(J.queryHash!==ZZ(X,J.options))return!1}else if(!Y$(J.queryKey,X))return!1}if(Z!=="all"){let G=J.isActive();if(Z==="active"&&!G)return!1;if(Z==="inactive"&&G)return!1}if(typeof z==="boolean"&&J.isStale()!==z)return!1;if(B&&B!==J.state.fetchStatus)return!1;if(Q&&!Q(J))return!1;return!0}function sB($,J){let{exact:Z,status:H,predicate:B,mutationKey:Q}=$;if(Q){if(!J.options.mutationKey)return!1;if(Z){if(k8(J.options.mutationKey)!==k8(Q))return!1}else if(!Y$(J.options.mutationKey,Q))return!1}if(H&&J.state.status!==H)return!1;if(B&&!B(J))return!1;return!0}function ZZ($,J){return(J?.queryKeyHashFn||k8)($)}function k8($){return JSON.stringify($,(J,Z)=>SF(Z)?Object.keys(Z).sort().reduce((H,B)=>{return H[B]=Z[B],H},{}):Z)}function Y$($,J){if($===J)return!0;if(typeof $!==typeof J)return!1;if($&&J&&typeof $==="object"&&typeof J==="object")return Object.keys(J).every((Z)=>Y$($[Z],J[Z]));return!1}var gu=Object.prototype.hasOwnProperty;function HZ($,J,Z=0){if($===J)return $;if(Z>500)return J;let H=rA($)&&rA(J);if(!H&&!(SF($)&&SF(J)))return J;let Q=(H?$:Object.keys($)).length,X=H?J:Object.keys(J),z=X.length,G=H?Array(z):{},Y=0;for(let U=0;U<z;U++){let F=H?U:X[U],K=$[F],W=J[F];if(K===W){if(G[F]=K,H?U<Q:gu.call($,F))Y++;continue}if(K===null||W===null||typeof K!=="object"||typeof W!=="object"){G[F]=W;continue}let q=HZ(K,W,Z+1);if(G[F]=q,q===K)Y++}return Q===z&&Y===Q?$:G}function h6($,J){if(!J||Object.keys($).length!==Object.keys(J).length)return!1;for(let Z in $)if($[Z]!==J[Z])return!1;return!0}function rA($){return Array.isArray($)&&$.length===Object.keys($).length}function SF($){if(!aA($))return!1;let J=$.constructor;if(J===void 0)return!0;let Z=J.prototype;if(!aA(Z))return!1;if(!Z.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf($)!==Object.prototype)return!1;return!0}function aA($){return Object.prototype.toString.call($)==="[object Object]"}function oA($){return new Promise((J)=>{R8.setTimeout(J,$)})}function BZ($,J,Z){if(typeof Z.structuralSharing==="function")return Z.structuralSharing($,J);else if(Z.structuralSharing!==!1)return HZ($,J);return J}function sA($,J,Z=0){let H=[...$,J];return Z&&H.length>Z?H.slice(1):H}function tA($,J,Z=0){let H=[J,...$];return Z&&H.length>Z?H.slice(0,-1):H}var x6=Symbol();function tB($,J){if(!$.queryFn&&J?.initialPromise)return()=>J.initialPromise;if(!$.queryFn||$.queryFn===x6)return()=>Promise.reject(Error(`Missing queryFn: '${$.queryHash}'`));return $.queryFn}function v6($,J){if(typeof $==="function")return $(...J);return!!$}function eA($,J,Z){let H=!1,B;return Object.defineProperty($,"signal",{enumerable:!0,get:()=>{if(B??=J(),H)return B;if(H=!0,B.aborted)Z();else B.addEventListener("abort",Z,{once:!0});return B}}),$}var b8=(()=>{let $=()=>IF;return{isServer(){return $()},setIsServer(J){$=J}}})();function QZ(){let $,J,Z=new Promise((B,Q)=>{$=B,J=Q});Z.status="pending",Z.catch(()=>{});function H(B){Object.assign(Z,B),delete Z.resolve,delete Z.reject}return Z.resolve=(B)=>{H({status:"fulfilled",value:B}),$(B)},Z.reject=(B)=>{H({status:"rejected",reason:B}),J(B)},Z}var $D=iA;function fu(){let $=[],J=0,Z=(z)=>{z()},H=(z)=>{z()},B=$D,Q=(z)=>{if(J)$.push(z);else B(()=>{Z(z)})},X=()=>{let z=$;if($=[],z.length)B(()=>{H(()=>{z.forEach((G)=>{Z(G)})})})};return{batch:(z)=>{let G;J++;try{G=z()}finally{if(J--,!J)X()}return G},batchCalls:(z)=>{return(...G)=>{Q(()=>{z(...G)})}},schedule:Q,setNotifyFunction:(z)=>{Z=z},setBatchNotifyFunction:(z)=>{H=z},setScheduler:(z)=>{B=z}}}var f1=fu();var mu=class extends f4{#$=!0;#J;#Z;constructor(){super();this.#Z=($)=>{if(typeof window<"u"&&window.addEventListener){let J=()=>$(!0),Z=()=>$(!1);return window.addEventListener("online",J,!1),window.addEventListener("offline",Z,!1),()=>{window.removeEventListener("online",J),window.removeEventListener("offline",Z)}}return}}onSubscribe(){if(!this.#J)this.setEventListener(this.#Z)}onUnsubscribe(){if(!this.hasListeners())this.#J?.(),this.#J=void 0}setEventListener($){this.#Z=$,this.#J?.(),this.#J=$(this.setOnline.bind(this))}setOnline($){if(this.#$!==$)this.#$=$,this.listeners.forEach((Z)=>{Z($)})}isOnline(){return this.#$}},g6=new mu;function pu($){return Math.min(1000*2**$,30000)}function RF($){return($??"online")==="online"?g6.isOnline():!0}var eB=class extends Error{constructor($){super("CancelledError");this.revert=$?.revert,this.silent=$?.silent}};function $Q($){let J=!1,Z=0,H,B=QZ(),Q=()=>B.status!=="pending",X=(N)=>{if(!Q()){let V=new eB(N);K(V),$.onCancel?.(V)}},z=()=>{J=!0},G=()=>{J=!1},Y=()=>y6.isFocused()&&($.networkMode==="always"||g6.isOnline())&&$.canRun(),U=()=>RF($.networkMode)&&$.canRun(),F=(N)=>{if(!Q())H?.(),B.resolve(N)},K=(N)=>{if(!Q())H?.(),B.reject(N)},W=()=>{return new Promise((N)=>{H=(V)=>{if(Q()||Y())N(V)},$.onPause?.()}).then(()=>{if(H=void 0,!Q())$.onContinue?.()})},q=()=>{if(Q())return;let N,V=Z===0?$.initialPromise:void 0;try{N=V??$.fn()}catch(L){N=Promise.reject(L)}Promise.resolve(N).then(F).catch((L)=>{if(Q())return;let A=$.retry??(b8.isServer()?0:3),M=$.retryDelay??pu,_=typeof M==="function"?M(Z,L):M,P=A===!0||typeof A==="number"&&Z<A||typeof A==="function"&&A(Z,L);if(J||!P){K(L);return}Z++,$.onFail?.(Z,L),oA(_).then(()=>{return Y()?void 0:W()}).then(()=>{if(J)K(L);else q()})})};return{promise:B,status:()=>B.status,cancel:X,continue:()=>{return H?.(),B},cancelRetry:z,continueRetry:G,canStart:U,start:()=>{if(U())q();else W().then(q);return B}}}var JQ=class{#$;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),JZ(this.gcTime))this.#$=R8.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime($){this.gcTime=Math.max(this.gcTime||0,$??(b8.isServer()?1/0:300000))}clearGcTimeout(){if(this.#$!==void 0)R8.clearTimeout(this.#$),this.#$=void 0}};var HD=class extends JQ{#$;#J;#Z;#B;#H;#Q;#X;constructor($){super();this.#X=!1,this.#Q=$.defaultOptions,this.setOptions($.options),this.observers=[],this.#B=$.client,this.#Z=this.#B.getQueryCache(),this.queryKey=$.queryKey,this.queryHash=$.queryHash,this.#$=ZD(this.options),this.state=$.state??this.#$,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#H?.promise}setOptions($){if(this.options={...this.#Q,...$},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let J=ZD(this.options);if(J.data!==void 0)this.setState(JD(J.data,J.dataUpdatedAt)),this.#$=J}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#Z.remove(this)}setData($,J){let Z=BZ(this.state.data,$,this.options);return this.#G({data:Z,type:"success",dataUpdatedAt:J?.updatedAt,manual:J?.manual}),Z}setState($,J){this.#G({type:"setState",state:$,setStateOptions:J})}cancel($){let J=this.#H?.promise;return this.#H?.cancel($),J?J.then(k5).catch(k5):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(($)=>l2($.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===x6||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(($)=>z8($.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!nB(this.state.dataUpdatedAt,$)}onFocus(){this.observers.find((J)=>J.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#H?.continue()}onOnline(){this.observers.find((J)=>J.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#H?.continue()}addObserver($){if(!this.observers.includes($))this.observers.push($),this.clearGcTimeout(),this.#Z.notify({type:"observerAdded",query:this,observer:$})}removeObserver($){if(this.observers.includes($)){if(this.observers=this.observers.filter((J)=>J!==$),!this.observers.length){if(this.#H)if(this.#X||this.#z())this.#H.cancel({revert:!0});else this.#H.cancelRetry();this.scheduleGc()}this.#Z.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($,J){if(this.state.fetchStatus!=="idle"&&this.#H?.status()!=="rejected"){if(this.state.data!==void 0&&J?.cancelRefetch)this.cancel({silent:!0});else if(this.#H)return this.#H.continueRetry(),this.#H.promise}if($)this.setOptions($);if(!this.options.queryFn){let z=this.observers.find((G)=>G.options.queryFn);if(z)this.setOptions(z.options)}let Z=new AbortController,H=(z)=>{Object.defineProperty(z,"signal",{enumerable:!0,get:()=>{return this.#X=!0,Z.signal}})},B=()=>{let z=tB(this.options,J),Y=(()=>{let U={client:this.#B,queryKey:this.queryKey,meta:this.meta};return H(U),U})();if(this.#X=!1,this.options.persister)return this.options.persister(z,Y,this);return z(Y)},X=(()=>{let z={fetchOptions:J,options:this.options,queryKey:this.queryKey,client:this.#B,state:this.state,fetchFn:B};return H(z),z})();if(this.options.behavior?.onFetch(X,this),this.#J=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==X.fetchOptions?.meta)this.#G({type:"fetch",meta:X.fetchOptions?.meta});this.#H=$Q({initialPromise:J?.initialPromise,fn:X.fetchFn,onCancel:(z)=>{if(z instanceof eB&&z.revert)this.setState({...this.#J,fetchStatus:"idle"});Z.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.#H.start();if(z===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(z),this.#Z.config.onSuccess?.(z,this),this.#Z.config.onSettled?.(z,this.state.error,this),z}catch(z){if(z instanceof eB){if(z.silent)return this.#H.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.#Z.config.onError?.(z,this),this.#Z.config.onSettled?.(this.state.data,z,this),z}finally{this.scheduleGc()}}#G($){let J=(Z)=>{switch($.type){case"failed":return{...Z,fetchFailureCount:$.failureCount,fetchFailureReason:$.error};case"pause":return{...Z,fetchStatus:"paused"};case"continue":return{...Z,fetchStatus:"fetching"};case"fetch":return{...Z,...kF(Z.data,this.options),fetchMeta:$.meta??null};case"success":let H={...Z,...JD($.data,$.dataUpdatedAt),dataUpdateCount:Z.dataUpdateCount+1,...!$.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#J=$.manual?H:void 0,H;case"error":let B=$.error;return{...Z,error:B,errorUpdateCount:Z.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:Z.fetchFailureCount+1,fetchFailureReason:B,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...Z,isInvalidated:!0};case"setState":return{...Z,...$.state}}};this.state=J(this.state),f1.batch(()=>{this.observers.forEach((Z)=>{Z.onQueryUpdate()}),this.#Z.notify({query:this,type:"updated",action:$})})}};function kF($,J){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:RF(J.networkMode)?"fetching":"paused",...$===void 0&&{error:null,status:"pending"}}}function JD($,J){return{data:$,dataUpdatedAt:J??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ZD($){let J=typeof $.initialData==="function"?$.initialData():$.initialData,Z=J!==void 0,H=Z?typeof $.initialDataUpdatedAt==="function"?$.initialDataUpdatedAt():$.initialDataUpdatedAt:0;return{data:J,dataUpdateCount:0,dataUpdatedAt:Z?H??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:Z?"success":"pending",fetchStatus:"idle"}}var yF=class extends f4{constructor($,J){super();this.options=J,this.#$=$,this.#z=null,this.#X=QZ(),this.bindMethods(),this.setOptions(J)}#$;#J=void 0;#Z=void 0;#B=void 0;#H;#Q;#X;#z;#G;#W;#q;#U;#F;#Y;#N=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#J.addObserver(this),BD(this.#J,this.options))this.#K();else this.updateResult();this.#D()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return bF(this.#J,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bF(this.#J,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#M(),this.#P(),this.#J.removeObserver(this)}setOptions($){let J=this.options,Z=this.#J;if(this.options=this.#$.defaultQueryOptions($),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof l2(this.options.enabled,this.#J)!=="boolean")throw Error("Expected enabled to be a boolean or a callback that returns a boolean");if(this.#_(),this.#J.setOptions(this.options),J._defaulted&&!h6(this.options,J))this.#$.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#J,observer:this});let H=this.hasListeners();if(H&&QD(this.#J,Z,this.options,J))this.#K();if(this.updateResult(),H&&(this.#J!==Z||l2(this.options.enabled,this.#J)!==l2(J.enabled,this.#J)||z8(this.options.staleTime,this.#J)!==z8(J.staleTime,this.#J)))this.#L();let B=this.#V();if(H&&(this.#J!==Z||l2(this.options.enabled,this.#J)!==l2(J.enabled,this.#J)||B!==this.#Y))this.#A(B)}getOptimisticResult($){let J=this.#$.getQueryCache().build(this.#$,$),Z=this.createResult(J,$);if(cu(this,Z))this.#B=Z,this.#Q=this.options,this.#H=this.#J.state;return Z}getCurrentResult(){return this.#B}trackResult($,J){return new Proxy($,{get:(Z,H)=>{if(this.trackProp(H),J?.(H),H==="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(Z,H)}})}trackProp($){this.#N.add($)}getCurrentQuery(){return this.#J}refetch({...$}={}){return this.fetch({...$})}fetchOptimistic($){let J=this.#$.defaultQueryOptions($),Z=this.#$.getQueryCache().build(this.#$,J);return Z.fetch().then(()=>this.createResult(Z,J))}fetch($){return this.#K({...$,cancelRefetch:$.cancelRefetch??!0}).then(()=>{return this.updateResult(),this.#B})}#K($){this.#_();let J=this.#J.fetch(this.options,$);if(!$?.throwOnError)J=J.catch(k5);return J}#L(){this.#M();let $=z8(this.options.staleTime,this.#J);if(b8.isServer()||this.#B.isStale||!JZ($))return;let Z=nB(this.#B.dataUpdatedAt,$)+1;this.#U=R8.setTimeout(()=>{if(!this.#B.isStale)this.updateResult()},Z)}#V(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#J):this.options.refetchInterval)??!1}#A($){if(this.#P(),this.#Y=$,b8.isServer()||l2(this.options.enabled,this.#J)===!1||!JZ(this.#Y)||this.#Y===0)return;this.#F=R8.setInterval(()=>{if(this.options.refetchIntervalInBackground||y6.isFocused())this.#K()},this.#Y)}#D(){this.#L(),this.#A(this.#V())}#M(){if(this.#U!==void 0)R8.clearTimeout(this.#U),this.#U=void 0}#P(){if(this.#F!==void 0)R8.clearInterval(this.#F),this.#F=void 0}createResult($,J){let Z=this.#J,H=this.options,B=this.#B,Q=this.#H,X=this.#Q,G=$!==Z?$.state:this.#Z,{state:Y}=$,U={...Y},F=!1,K;if(J._optimisticResults){let R=this.hasListeners(),b=!R&&BD($,J),E=R&&QD($,Z,J,H);if(b||E)U={...U,...kF(Y.data,$.options)};if(J._optimisticResults==="isRestoring")U.fetchStatus="idle"}let{error:W,errorUpdatedAt:q,status:N}=U;K=U.data;let V=!1;if(J.placeholderData!==void 0&&K===void 0&&N==="pending"){let R;if(B?.isPlaceholderData&&J.placeholderData===X?.placeholderData)R=B.data,V=!0;else R=typeof J.placeholderData==="function"?J.placeholderData(this.#q?.state.data,this.#q):J.placeholderData;if(R!==void 0)N="success",K=BZ(B?.data,R,J),F=!0}if(J.select&&K!==void 0&&!V)if(B&&K===Q?.data&&J.select===this.#G)K=this.#W;else try{this.#G=J.select,K=J.select(K),K=BZ(B?.data,K,J),this.#W=K,this.#z=null}catch(R){this.#z=R}if(this.#z)W=this.#z,K=this.#W,q=Date.now(),N="error";let L=U.fetchStatus==="fetching",A=N==="pending",M=N==="error",_=A&&L,P=K!==void 0,w={status:N,fetchStatus:U.fetchStatus,isPending:A,isSuccess:N==="success",isError:M,isInitialLoading:_,isLoading:_,data:K,dataUpdatedAt:U.dataUpdatedAt,error:W,errorUpdatedAt:q,failureCount:U.fetchFailureCount,failureReason:U.fetchFailureReason,errorUpdateCount:U.errorUpdateCount,isFetched:$.isFetched(),isFetchedAfterMount:U.dataUpdateCount>G.dataUpdateCount||U.errorUpdateCount>G.errorUpdateCount,isFetching:L,isRefetching:L&&!A,isLoadingError:M&&!P,isPaused:U.fetchStatus==="paused",isPlaceholderData:F,isRefetchError:M&&P,isStale:hF($,J),refetch:this.refetch,promise:this.#X,isEnabled:l2(J.enabled,$)!==!1};if(this.options.experimental_prefetchInRender){let R=w.data!==void 0,b=w.status==="error"&&!R,E=(S)=>{if(b)S.reject(w.error);else if(R)S.resolve(w.data)},x=()=>{let S=this.#X=w.promise=QZ();E(S)},I=this.#X;switch(I.status){case"pending":if($.queryHash===Z.queryHash)E(I);break;case"fulfilled":if(b||w.data!==I.value)x();break;case"rejected":if(!b||w.error!==I.reason)x();break}}return w}updateResult(){let $=this.#B,J=this.createResult(this.#J,this.options);if(this.#H=this.#J.state,this.#Q=this.options,this.#H.data!==void 0)this.#q=this.#J;if(h6(J,$))return;this.#B=J;let Z=()=>{if(!$)return!0;let{notifyOnChangeProps:H}=this.options,B=typeof H==="function"?H():H;if(B==="all"||!B&&!this.#N.size)return!0;let Q=new Set(B??this.#N);if(this.options.throwOnError)Q.add("error");return Object.keys(this.#B).some((X)=>{let z=X;return this.#B[z]!==$[z]&&Q.has(z)})};this.#O({listeners:Z()})}#_(){let $=this.#$.getQueryCache().build(this.#$,this.options);if($===this.#J)return;let J=this.#J;if(this.#J=$,this.#Z=$.state,this.hasListeners())J?.removeObserver(this),$.addObserver(this)}onQueryUpdate(){if(this.updateResult(),this.hasListeners())this.#D()}#O($){f1.batch(()=>{if($.listeners)this.listeners.forEach((J)=>{J(this.#B)});this.#$.getQueryCache().notify({query:this.#J,type:"observerResultsUpdated"})})}};function uu($,J){return l2(J.enabled,$)!==!1&&$.state.data===void 0&&!($.state.status==="error"&&l2(J.retryOnMount,$)===!1)}function BD($,J){return uu($,J)||$.state.data!==void 0&&bF($,J,J.refetchOnMount)}function bF($,J,Z){if(l2(J.enabled,$)!==!1&&z8(J.staleTime,$)!=="static"){let H=typeof Z==="function"?Z($):Z;return H==="always"||H!==!1&&hF($,J)}return!1}function QD($,J,Z,H){return($!==J||l2(H.enabled,$)===!1)&&(!Z.suspense||$.state.status!=="error")&&hF($,Z)}function hF($,J){return l2(J.enabled,$)!==!1&&$.isStaleByTime(z8(J.staleTime,$))}function cu($,J){if(!h6($.getCurrentResult(),J))return!0;return!1}function xF($){return{onFetch:(J,Z)=>{let H=J.options,B=J.fetchOptions?.meta?.fetchMore?.direction,Q=J.state.data?.pages||[],X=J.state.data?.pageParams||[],z={pages:[],pageParams:[]},G=0,Y=async()=>{let U=!1,F=(q)=>{eA(q,()=>J.signal,()=>U=!0)},K=tB(J.options,J.fetchOptions),W=async(q,N,V)=>{if(U)return Promise.reject();if(N==null&&q.pages.length)return Promise.resolve(q);let A=(()=>{let D={client:J.client,queryKey:J.queryKey,pageParam:N,direction:V?"backward":"forward",meta:J.options.meta};return F(D),D})(),M=await K(A),{maxPages:_}=J.options,P=V?tA:sA;return{pages:P(q.pages,M,_),pageParams:P(q.pageParams,N,_)}};if(B&&Q.length){let q=B==="backward",N=q?du:XD,V={pages:Q,pageParams:X},L=N(H,V);z=await W(V,L,q)}else{let q=$??Q.length;do{let N=G===0?X[0]??H.initialPageParam:XD(H,z);if(G>0&&N==null)break;z=await W(z,N),G++}while(G<q)}return z};if(J.options.persister)J.fetchFn=()=>{return J.options.persister?.(Y,{client:J.client,queryKey:J.queryKey,meta:J.options.meta,signal:J.signal},Z)};else J.fetchFn=Y}}}function XD($,{pages:J,pageParams:Z}){let H=J.length-1;return J.length>0?$.getNextPageParam(J[H],J,Z[H],Z):void 0}function du($,{pages:J,pageParams:Z}){return J.length>0?$.getPreviousPageParam?.(J[0],J,Z[0],Z):void 0}var zD=class extends JQ{#$;#J;#Z;#B;constructor($){super();this.#$=$.client,this.mutationId=$.mutationId,this.#Z=$.mutationCache,this.#J=[],this.state=$.state||vF(),this.setOptions($.options),this.scheduleGc()}setOptions($){this.options=$,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver($){if(!this.#J.includes($))this.#J.push($),this.clearGcTimeout(),this.#Z.notify({type:"observerAdded",mutation:this,observer:$})}removeObserver($){this.#J=this.#J.filter((J)=>J!==$),this.scheduleGc(),this.#Z.notify({type:"observerRemoved",mutation:this,observer:$})}optionalRemove(){if(!this.#J.length)if(this.state.status==="pending")this.scheduleGc();else this.#Z.remove(this)}continue(){return this.#B?.continue()??this.execute(this.state.variables)}async execute($){let J=()=>{this.#H({type:"continue"})},Z={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#B=$Q({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn($,Z)},onFail:(Q,X)=>{this.#H({type:"failed",failureCount:Q,error:X})},onPause:()=>{this.#H({type:"pause"})},onContinue:J,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#Z.canRun(this)});let H=this.state.status==="pending",B=!this.#B.canStart();try{if(H)J();else{if(this.#H({type:"pending",variables:$,isPaused:B}),this.#Z.config.onMutate)await this.#Z.config.onMutate($,this,Z);let X=await this.options.onMutate?.($,Z);if(X!==this.state.context)this.#H({type:"pending",context:X,variables:$,isPaused:B})}let Q=await this.#B.start();return await this.#Z.config.onSuccess?.(Q,$,this.state.context,this,Z),await this.options.onSuccess?.(Q,$,this.state.context,Z),await this.#Z.config.onSettled?.(Q,null,this.state.variables,this.state.context,this,Z),await this.options.onSettled?.(Q,null,$,this.state.context,Z),this.#H({type:"success",data:Q}),Q}catch(Q){try{await this.#Z.config.onError?.(Q,$,this.state.context,this,Z)}catch(X){Promise.reject(X)}try{await this.options.onError?.(Q,$,this.state.context,Z)}catch(X){Promise.reject(X)}try{await this.#Z.config.onSettled?.(void 0,Q,this.state.variables,this.state.context,this,Z)}catch(X){Promise.reject(X)}try{await this.options.onSettled?.(void 0,Q,$,this.state.context,Z)}catch(X){Promise.reject(X)}throw this.#H({type:"error",error:Q}),Q}finally{this.#Z.runNext(this)}}#H($){let J=(Z)=>{switch($.type){case"failed":return{...Z,failureCount:$.failureCount,failureReason:$.error};case"pause":return{...Z,isPaused:!0};case"continue":return{...Z,isPaused:!1};case"pending":return{...Z,context:$.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:$.isPaused,status:"pending",variables:$.variables,submittedAt:Date.now()};case"success":return{...Z,data:$.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...Z,data:void 0,error:$.error,failureCount:Z.failureCount+1,failureReason:$.error,isPaused:!1,status:"error"}}};this.state=J(this.state),f1.batch(()=>{this.#J.forEach((Z)=>{Z.onMutationUpdate($)}),this.#Z.notify({mutation:this,type:"updated",action:$})})}};function vF(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var GD=class extends f4{constructor($={}){super();this.config=$,this.#$=new Set,this.#J=new Map,this.#Z=0}#$;#J;#Z;build($,J,Z){let H=new zD({client:$,mutationCache:this,mutationId:++this.#Z,options:$.defaultMutationOptions(J),state:Z});return this.add(H),H}add($){this.#$.add($);let J=ZQ($);if(typeof J==="string"){let Z=this.#J.get(J);if(Z)Z.push($);else this.#J.set(J,[$])}this.notify({type:"added",mutation:$})}remove($){if(this.#$.delete($)){let J=ZQ($);if(typeof J==="string"){let Z=this.#J.get(J);if(Z){if(Z.length>1){let H=Z.indexOf($);if(H!==-1)Z.splice(H,1)}else if(Z[0]===$)this.#J.delete(J)}}}this.notify({type:"removed",mutation:$})}canRun($){let J=ZQ($);if(typeof J==="string"){let H=this.#J.get(J)?.find((B)=>B.state.status==="pending");return!H||H===$}else return!0}runNext($){let J=ZQ($);if(typeof J==="string")return this.#J.get(J)?.find((H)=>H!==$&&H.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){f1.batch(()=>{this.#$.forEach(($)=>{this.notify({type:"removed",mutation:$})}),this.#$.clear(),this.#J.clear()})}getAll(){return Array.from(this.#$)}find($){let J={exact:!0,...$};return this.getAll().find((Z)=>sB(J,Z))}findAll($={}){return this.getAll().filter((J)=>sB($,J))}notify($){f1.batch(()=>{this.listeners.forEach((J)=>{J($)})})}resumePausedMutations(){let $=this.getAll().filter((J)=>J.state.isPaused);return f1.batch(()=>Promise.all($.map((J)=>J.continue().catch(k5))))}};function ZQ($){return $.options.scope?.id}var gF=class extends f4{#$;#J=void 0;#Z;#B;constructor($,J){super();this.#$=$,this.setOptions(J),this.bindMethods(),this.#H()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions($){let J=this.options;if(this.options=this.#$.defaultMutationOptions($),!h6(this.options,J))this.#$.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#Z,observer:this});if(J?.mutationKey&&this.options.mutationKey&&k8(J.mutationKey)!==k8(this.options.mutationKey))this.reset();else if(this.#Z?.state.status==="pending")this.#Z.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.removeObserver(this)}onMutationUpdate($){this.#H(),this.#Q($)}getCurrentResult(){return this.#J}reset(){this.#Z?.removeObserver(this),this.#Z=void 0,this.#H(),this.#Q()}mutate($,J){return this.#B=J,this.#Z?.removeObserver(this),this.#Z=this.#$.getMutationCache().build(this.#$,this.options),this.#Z.addObserver(this),this.#Z.execute($)}#H(){let $=this.#Z?.state??vF();this.#J={...$,isPending:$.status==="pending",isSuccess:$.status==="success",isError:$.status==="error",isIdle:$.status==="idle",mutate:this.mutate,reset:this.reset}}#Q($){f1.batch(()=>{if(this.#B&&this.hasListeners()){let J=this.#J.variables,Z=this.#J.context,H={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};if($?.type==="success"){try{this.#B.onSuccess?.($.data,J,Z,H)}catch(B){Promise.reject(B)}try{this.#B.onSettled?.($.data,null,J,Z,H)}catch(B){Promise.reject(B)}}else if($?.type==="error"){try{this.#B.onError?.($.error,J,Z,H)}catch(B){Promise.reject(B)}try{this.#B.onSettled?.(void 0,$.error,J,Z,H)}catch(B){Promise.reject(B)}}}this.listeners.forEach((J)=>{J(this.#J)})})}};var YD=class extends f4{constructor($={}){super();this.config=$,this.#$=new Map}#$;build($,J,Z){let H=J.queryKey,B=J.queryHash??ZZ(H,J),Q=this.get(B);if(!Q)Q=new HD({client:$,queryKey:H,queryHash:B,options:$.defaultQueryOptions(J),state:Z,defaultOptions:$.getQueryDefaults(H)}),this.add(Q);return Q}add($){if(!this.#$.has($.queryHash))this.#$.set($.queryHash,$),this.notify({type:"added",query:$})}remove($){let J=this.#$.get($.queryHash);if(J){if($.destroy(),J===$)this.#$.delete($.queryHash);this.notify({type:"removed",query:$})}}clear(){f1.batch(()=>{this.getAll().forEach(($)=>{this.remove($)})})}get($){return this.#$.get($)}getAll(){return[...this.#$.values()]}find($){let J={exact:!0,...$};return this.getAll().find((Z)=>oB(J,Z))}findAll($={}){let J=this.getAll();return Object.keys($).length>0?J.filter((Z)=>oB($,Z)):J}notify($){f1.batch(()=>{this.listeners.forEach((J)=>{J($)})})}onFocus(){f1.batch(()=>{this.getAll().forEach(($)=>{$.onFocus()})})}onOnline(){f1.batch(()=>{this.getAll().forEach(($)=>{$.onOnline()})})}};var fF=class{#$;#J;#Z;#B;#H;#Q;#X;#z;constructor($={}){this.#$=$.queryCache||new YD,this.#J=$.mutationCache||new GD,this.#Z=$.defaultOptions||{},this.#B=new Map,this.#H=new Map,this.#Q=0}mount(){if(this.#Q++,this.#Q!==1)return;this.#X=y6.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onFocus()}),this.#z=g6.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.#J.findAll({...$,status:"pending"}).length}getQueryData($){let J=this.defaultQueryOptions({queryKey:$});return this.#$.get(J.queryHash)?.state.data}ensureQueryData($){let J=this.defaultQueryOptions($),Z=this.#$.build(this,J),H=Z.state.data;if(H===void 0)return this.fetchQuery($);if($.revalidateIfStale&&Z.isStaleByTime(z8(J.staleTime,Z)))this.prefetchQuery(J);return Promise.resolve(H)}getQueriesData($){return this.#$.findAll($).map(({queryKey:J,state:Z})=>{let H=Z.data;return[J,H]})}setQueryData($,J,Z){let H=this.defaultQueryOptions({queryKey:$}),Q=this.#$.get(H.queryHash)?.state.data,X=nA(J,Q);if(X===void 0)return;return this.#$.build(this,H).setData(X,{...Z,manual:!0})}setQueriesData($,J,Z){return f1.batch(()=>this.#$.findAll($).map(({queryKey:H})=>[H,this.setQueryData(H,J,Z)]))}getQueryState($){let J=this.defaultQueryOptions({queryKey:$});return this.#$.get(J.queryHash)?.state}removeQueries($){let J=this.#$;f1.batch(()=>{J.findAll($).forEach((Z)=>{J.remove(Z)})})}resetQueries($,J){let Z=this.#$;return f1.batch(()=>{return Z.findAll($).forEach((H)=>{H.reset()}),this.refetchQueries({type:"active",...$},J)})}cancelQueries($,J={}){let Z={revert:!0,...J},H=f1.batch(()=>this.#$.findAll($).map((B)=>B.cancel(Z)));return Promise.all(H).then(k5).catch(k5)}invalidateQueries($,J={}){return f1.batch(()=>{if(this.#$.findAll($).forEach((Z)=>{Z.invalidate()}),$?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...$,type:$?.refetchType??$?.type??"active"},J)})}refetchQueries($,J={}){let Z={...J,cancelRefetch:J.cancelRefetch??!0},H=f1.batch(()=>this.#$.findAll($).filter((B)=>!B.isDisabled()&&!B.isStatic()).map((B)=>{let Q=B.fetch(void 0,Z);if(!Z.throwOnError)Q=Q.catch(k5);return B.state.fetchStatus==="paused"?Promise.resolve():Q}));return Promise.all(H).then(k5)}fetchQuery($){let J=this.defaultQueryOptions($);if(J.retry===void 0)J.retry=!1;let Z=this.#$.build(this,J);return Z.isStaleByTime(z8(J.staleTime,Z))?Z.fetch(J):Promise.resolve(Z.state.data)}prefetchQuery($){return this.fetchQuery($).then(k5).catch(k5)}fetchInfiniteQuery($){return $.behavior=xF($.pages),this.fetchQuery($)}prefetchInfiniteQuery($){return this.fetchInfiniteQuery($).then(k5).catch(k5)}ensureInfiniteQueryData($){return $.behavior=xF($.pages),this.ensureQueryData($)}resumePausedMutations(){if(g6.isOnline())return this.#J.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#$}getMutationCache(){return this.#J}getDefaultOptions(){return this.#Z}setDefaultOptions($){this.#Z=$}setQueryDefaults($,J){this.#B.set(k8($),{queryKey:$,defaultOptions:J})}getQueryDefaults($){let J=[...this.#B.values()],Z={};return J.forEach((H)=>{if(Y$($,H.queryKey))Object.assign(Z,H.defaultOptions)}),Z}setMutationDefaults($,J){this.#H.set(k8($),{mutationKey:$,defaultOptions:J})}getMutationDefaults($){let J=[...this.#H.values()],Z={};return J.forEach((H)=>{if(Y$($,H.mutationKey))Object.assign(Z,H.defaultOptions)}),Z}defaultQueryOptions($){if($._defaulted)return $;let J={...this.#Z.queries,...this.getQueryDefaults($.queryKey),...$,_defaulted:!0};if(!J.queryHash)J.queryHash=ZZ(J.queryKey,J);if(J.refetchOnReconnect===void 0)J.refetchOnReconnect=J.networkMode!=="always";if(J.throwOnError===void 0)J.throwOnError=!!J.suspense;if(!J.networkMode&&J.persister)J.networkMode="offlineFirst";if(J.queryFn===x6)J.enabled=!1;return J}defaultMutationOptions($){if($?._defaulted)return $;return{...this.#Z.mutations,...$?.mutationKey&&this.getMutationDefaults($.mutationKey),...$,_defaulted:!0}}clear(){this.#$.clear(),this.#J.clear()}};var i9=O(g(),1);var f6=O(g(),1),UD=O(c(),1),mF=f6.createContext(void 0),s0=($)=>{let J=f6.useContext(mF);if($)return $;if(!J)throw Error("No QueryClient set, use QueryClientProvider to set one");return J},pF=({client:$,children:J})=>{return f6.useEffect(()=>{return $.mount(),()=>{$.unmount()}},[$]),UD.jsx(mF.Provider,{value:$,children:J})};var XZ=O(g(),1),lu=O(c(),1);function iu(){let $=!1;return{clearReset:()=>{$=!1},reset:()=>{$=!0},isReset:()=>{return $}}}var ru=XZ.createContext(iu()),FD=()=>XZ.useContext(ru);var KD=O(g(),1);var WD=($,J,Z)=>{let H=Z?.state.error&&typeof $.throwOnError==="function"?v6($.throwOnError,[Z.state.error,Z]):$.throwOnError;if($.suspense||$.experimental_prefetchInRender||H){if(!J.isReset())$.retryOnMount=!1}},qD=($)=>{KD.useEffect(()=>{$.clearReset()},[$])},ND=({result:$,errorResetBoundary:J,throwOnError:Z,query:H,suspense:B})=>{return $.isError&&!J.isReset()&&!$.isFetching&&H&&(B&&$.data===void 0||v6(Z,[$.error,H]))};var HQ=O(g(),1),LD=HQ.createContext(!1),VD=()=>HQ.useContext(LD),rB0=LD.Provider;var AD=($)=>{if($.suspense){let Z=(B)=>B==="static"?B:Math.max(B??1000,1000),H=$.staleTime;if($.staleTime=typeof H==="function"?(...B)=>Z(H(...B)):Z(H),typeof $.gcTime==="number")$.gcTime=Math.max($.gcTime,1000)}},DD=($,J)=>$.isLoading&&$.isFetching&&!J,MD=($,J)=>$?.suspense&&J.isPending,uF=($,J,Z)=>J.fetchOptimistic($).catch(()=>{Z.clearReset()});function PD($,J,Z){let H=VD(),B=FD(),Q=s0(Z),X=Q.defaultQueryOptions($);Q.getDefaultOptions().queries?._experimental_beforeQuery?.(X);let z=Q.getQueryCache().get(X.queryHash);X._optimisticResults=H?"isRestoring":"optimistic",AD(X),WD(X,B,z),qD(B);let G=!Q.getQueryCache().get(X.queryHash),[Y]=i9.useState(()=>new J(Q,X)),U=Y.getOptimisticResult(X),F=!H&&$.subscribed!==!1;if(i9.useSyncExternalStore(i9.useCallback((K)=>{let W=F?Y.subscribe(f1.batchCalls(K)):k5;return Y.updateResult(),W},[Y,F]),()=>Y.getCurrentResult(),()=>Y.getCurrentResult()),i9.useEffect(()=>{Y.setOptions(X)},[X,Y]),MD(X,U))throw uF(X,Y,B);if(ND({result:U,errorResetBoundary:B,throwOnError:X.throwOnError,query:z,suspense:X.suspense}))throw U.error;if(Q.getDefaultOptions().queries?._experimental_afterQuery?.(X,U),X.experimental_prefetchInRender&&!b8.isServer()&&DD(U,H))(G?uF(X,Y,B):z?.promise)?.catch(k5).finally(()=>{Y.updateResult()});return!X.notifyOnChangeProps?Y.trackResult(U):U}function n1($,J){return PD($,yF,J)}var j9=O(g(),1);function cF($,J){let Z=s0(J);return OD({filters:{...$,status:"pending"}},Z).length}function _D($,J){return $.findAll(J.filters).map((Z)=>J.select?J.select(Z):Z.state)}function OD($={},J){let Z=s0(J).getMutationCache(),H=j9.useRef($),B=j9.useRef(null);if(B.current===null)B.current=_D(Z,$);return j9.useEffect(()=>{H.current=$}),j9.useSyncExternalStore(j9.useCallback((Q)=>Z.subscribe(()=>{let X=HZ(B.current,_D(Z,H.current));if(B.current!==X)B.current=X,f1.schedule(Q)}),[Z]),()=>B.current,()=>B.current)}var T9=O(g(),1);function o1($,J){let Z=s0(J),[H]=T9.useState(()=>new gF(Z,$));T9.useEffect(()=>{H.setOptions($)},[H,$]);let B=T9.useSyncExternalStore(T9.useCallback((X)=>H.subscribe(f1.batchCalls(X)),[H]),()=>H.getCurrentResult(),()=>H.getCurrentResult()),Q=T9.useCallback((X,z)=>{H.mutate(X,z).catch(k5)},[H]);if(B.error&&v6(H.options.throwOnError,[B.error]))throw B.error;return{...B,mutate:Q,mutateAsync:B.mutate}}var Ru=O(GH0(),1);function jD($,J){if($ instanceof RegExp)return{keys:!1,pattern:$};var Z,H,B,Q,X=[],z="",G=$.split("/");G[0]||G.shift();while(B=G.shift())if(Z=B[0],Z==="*")X.push(Z),z+=B[1]==="?"?"(?:/(.*))?":"/(.*)";else if(Z===":"){if(H=B.indexOf("?",1),Q=B.indexOf(".",1),X.push(B.substring(1,~H?H:~Q?Q:B.length)),z+=!!~H&&!~Q?"(?:/([^/]+?))?":"/([^/]+?)",~Q)z+=(~H?"?":"")+"\\"+B.substring(Q)}else z+="/"+B;return{keys:X,pattern:new RegExp("^"+z+(J?"(?=$|/)":"/?$"),"i")}}var U$=O(g(),1),w1=O(g(),1);var QQ=O(BQ(),1);var Qc=U$.useInsertionEffect,Xc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lF=Xc?U$.useLayoutEffect:U$.useEffect,zc=Qc||lF,XQ=($)=>{let J=U$.useRef([$,(...Z)=>J[0](...Z)]).current;return zc(()=>{J[0]=$}),J[1]};var Gc="popstate",iF="pushState",rF="replaceState",Yc="hashchange",TD=[Gc,iF,rF,Yc],Uc=($)=>{for(let J of TD)addEventListener(J,$);return()=>{for(let J of TD)removeEventListener(J,$)}},aF=($,J)=>QQ.useSyncExternalStore(Uc,$,J),CD=()=>location.search,SD=({ssrSearch:$}={})=>aF(CD,$!=null?()=>$:CD),wD=()=>location.pathname,Fc=({ssrPath:$}={})=>aF(wD,$!=null?()=>$:wD),Kc=()=>history.state,ID=()=>aF(Kc,()=>null),Wc=($,{replace:J=!1,state:Z=null}={})=>history[J?rF:iF](Z,"",$),RD=($={})=>[Fc($),Wc],ED=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[ED]>"u"){for(let $ of[iF,rF]){let J=history[$];history[$]=function(){let Z=J.apply(this,arguments),H=new Event($);return H.arguments=arguments,dispatchEvent(H),Z}}Object.defineProperty(window,ED,{value:!0})}var qc=($,J)=>!J.toLowerCase().indexOf($.toLowerCase())?J.slice($.length)||"/":"~"+J,bD=($="")=>$==="/"?"":$,yD=($,J)=>$[0]==="~"?$.slice(1):bD(J)+$,hD=($="",J)=>qc(kD(bD($)),kD(J));var kD=($)=>{try{return decodeURI($)}catch(J){return $}};var vD={hook:RD,searchHook:SD,parser:jD,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:($)=>$,aroundNav:($,J,Z)=>$(J,Z)},gD=w1.createContext(vD),m6=()=>w1.useContext(gD),fD={},mD=w1.createContext(fD),nF=()=>w1.useContext(mD),zZ=($)=>{let[J,Z]=$.hook($);return[hD($.base,J),XQ((H,B)=>$.aroundNav(Z,yD(H,$.base),B))]},m4=()=>zZ(m6());var pD=($,J,Z,H)=>{let{pattern:B,keys:Q}=J instanceof RegExp?{keys:!1,pattern:J}:$(J||"*",H),X=B.exec(Z)||[],[z,...G]=X;return z!==void 0?[!0,(()=>{let Y=Q!==!1?Object.fromEntries(Q.map((F,K)=>[F,G[K]])):X.groups,U={...G};return Y&&Object.assign(U,Y),U})(),...H?[z]:[]]:[!1,null]};var oF=({children:$,...J})=>{let Z=m6(),H=J.hook?vD:Z,B=H,[Q,X=J.ssrSearch??""]=J.ssrPath?.split("?")??[];if(Q)J.ssrSearch=X,J.ssrPath=Q;J.hrefs=J.hrefs??J.hook?.hrefs,J.searchHook=J.searchHook??J.hook?.searchHook;let z=w1.useRef({}),G=z.current,Y=G;for(let U in H){let F=U==="base"?H[U]+(J[U]??""):J[U]??H[U];if(G===Y&&F!==Y[U])z.current=Y={...Y};if(Y[U]=F,F!==H[U]||F!==B[U])B=Y}return w1.createElement(gD.Provider,{value:B,children:$})},xD=({children:$,component:J},Z)=>{if(J)return w1.createElement(J,{params:Z});return typeof $==="function"?$(Z):$},Nc=($)=>{let J=w1.useRef(fD),Z=J.current;return J.current=Object.keys($).length!==Object.keys(Z).length||Object.entries($).some(([H,B])=>B!==Z[H])?$:Z};var zQ=({path:$,nest:J,match:Z,...H})=>{let B=m6(),[Q]=zZ(B),[X,z,G]=Z??pD(B.parser,$,Q,J),Y=Nc({...nF(),...z});if(!X)return null;let U=G?w1.createElement(oF,{base:G},xD(H,Y)):xD(H,Y);return w1.createElement(mD.Provider,{value:Y,children:U})},GZ=w1.forwardRef(($,J)=>{let Z=m6(),[H,B]=zZ(Z),{to:Q="",href:X=Q,onClick:z,asChild:G,children:Y,className:U,replace:F,state:K,transition:W,...q}=$,N=XQ((L)=>{if(L.ctrlKey||L.metaKey||L.altKey||L.shiftKey||L.button!==0)return;if(z?.(L),!L.defaultPrevented)L.preventDefault(),B(X,$)}),V=Z.hrefs(X[0]==="~"?X.slice(1):Z.base+X,Z);return G&&w1.isValidElement(Y)?w1.cloneElement(Y,{onClick:N,href:V}):w1.createElement("a",{...q,onClick:N,href:V,className:U?.call?U(H===X):U,children:Y,ref:J})}),uD=($)=>Array.isArray($)?$.flatMap((J)=>uD(J&&J.type===w1.Fragment?J.props.children:J)):[$],cD=({children:$,location:J})=>{let Z=m6(),[H]=zZ(Z);for(let B of uD($)){let Q=0;if(w1.isValidElement(B)&&(Q=pD(Z.parser,B.props.path,J||H,B.props.nest))[0])return w1.cloneElement(B,{match:Q})}return null},dD=($)=>{let{to:J,href:Z=J}=$,H=m6(),[,B]=zZ(H),Q=XQ(()=>B(J||Z,$)),{ssrContext:X}=H;if(lF(()=>{Q()},[]),X)X.redirectTo=J;return null};var k2={};_4(k2,{useToastManager:()=>gP,createToastManager:()=>fP,Viewport:()=>yM,Title:()=>aM,Root:()=>mM,Provider:()=>SM,Positioner:()=>hP,Portal:()=>PP,Description:()=>iM,Content:()=>pM,Close:()=>nM,Arrow:()=>vP,Action:()=>sM});var wM=O(g(),1);var lD=O(g(),1),Lc=[];function w2($){lD.useEffect($,Lc)}var GQ=O(g(),1),YZ=GQ.createContext(void 0);function r9(){let $=GQ.useContext(YZ);if(!$)throw Error(E0(73));return $}var UQ=Symbol("NOT_FOUND");function Vc($,J=`expected a function, instead received ${typeof $}`){if(typeof $!=="function")throw TypeError(J)}function Ac($,J=`expected an object, instead received ${typeof $}`){if(typeof $!=="object")throw TypeError(J)}function Dc($,J="expected all items to be functions, instead received the following types: "){if(!$.every((Z)=>typeof Z==="function")){let Z=$.map((H)=>typeof H==="function"?`function ${H.name||"unnamed"}()`:typeof H).join(", ");throw TypeError(`${J}[${Z}]`)}}var iD=($)=>{return Array.isArray($)?$:[$]};function Mc($){let J=Array.isArray($[0])?$[0]:$;return Dc(J,"createSelector expects all input-selectors to be functions, but received the following types: "),J}function Pc($,J){let Z=[],{length:H}=$;for(let B=0;B<H;B++)Z.push($[B].apply(null,J));return Z}var rD=0,_c=null,nD=class{revision=rD;_value;_lastValue;_isEqual=sF;constructor($,J=sF){this._value=this._lastValue=$,this._isEqual=J}get value(){return _c?.add(this),this._value}set value($){if(this.value===$)return;this._value=$,this.revision=++rD}};function sF($,J){return $===J}function tF($){if(!($ instanceof nD))console.warn("Not a valid cell! ",$);return $.value}function Oc($,J=sF){return new nD($,J)}var jc=($,J)=>!1;function FQ(){return Oc(null,jc)}var oD=($)=>{let J=$.collectionTag;if(J===null)J=$.collectionTag=FQ();tF(J)};var KX0=Symbol(),sD=0,Tc=Object.getPrototypeOf({}),Cc=class{constructor($){this.value=$,this.value=$,this.tag.value=$}proxy=new Proxy(this,UZ);tag=FQ();tags={};children={};collectionTag=null;id=sD++},UZ={get($,J){function Z(){let{value:B}=$,Q=Reflect.get(B,J);if(typeof J==="symbol")return Q;if(J in Tc)return Q;if(typeof Q==="object"&&Q!==null){let X=$.children[J];if(X===void 0)X=$.children[J]=Sc(Q);if(X.tag)tF(X.tag);return X.proxy}else{let X=$.tags[J];if(X===void 0)X=$.tags[J]=FQ(),X.value=Q;return tF(X),Q}}return Z()},ownKeys($){return oD($),Reflect.ownKeys($.value)},getOwnPropertyDescriptor($,J){return Reflect.getOwnPropertyDescriptor($.value,J)},has($,J){return Reflect.has($.value,J)}},wc=class{constructor($){this.value=$,this.value=$,this.tag.value=$}proxy=new Proxy([this],Ec);tag=FQ();tags={};children={};collectionTag=null;id=sD++},Ec={get([$],J){if(J==="length")oD($);return UZ.get($,J)},ownKeys([$]){return UZ.ownKeys($)},getOwnPropertyDescriptor([$],J){return UZ.getOwnPropertyDescriptor($,J)},has([$],J){return UZ.has($,J)}};function Sc($){if(Array.isArray($))return new wc($);return new Cc($)}function Ic($){let J;return{get(Z){if(J&&$(J.key,Z))return J.value;return UQ},put(Z,H){J={key:Z,value:H}},getEntries(){return J?[J]:[]},clear(){J=void 0}}}function Rc($,J){let Z=[];function H(z){let G=Z.findIndex((Y)=>J(z,Y.key));if(G>-1){let Y=Z[G];if(G>0)Z.splice(G,1),Z.unshift(Y);return Y.value}return UQ}function B(z,G){if(H(z)===UQ){if(Z.unshift({key:z,value:G}),Z.length>$)Z.pop()}}function Q(){return Z}function X(){Z=[]}return{get:H,put:B,getEntries:Q,clear:X}}var kc=($,J)=>$===J;function bc($){return function(Z,H){if(Z===null||H===null||Z.length!==H.length)return!1;let{length:B}=Z;for(let Q=0;Q<B;Q++)if(!$(Z[Q],H[Q]))return!1;return!0}}function tD($,J){let Z=typeof J==="object"?J:{equalityCheck:J},{equalityCheck:H=kc,maxSize:B=1,resultEqualityCheck:Q}=Z,X=bc(H),z=0,G=B<=1?Ic(X):Rc(B,X);function Y(){let U=G.get(arguments);if(U===UQ){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 Y.clearCache=()=>{G.clear(),Y.resetResultsCount()},Y.resultsCount=()=>z,Y.resetResultsCount=()=>{z=0},Y}var yc=class{constructor($){this.value=$}deref(){return this.value}},hc=typeof WeakRef<"u"?WeakRef:yc,xc=0,aD=1;function YQ(){return{s:xc,v:void 0,o:null,p:null}}function eD($,J={}){let Z=YQ(),{resultEqualityCheck:H}=J,B,Q=0;function X(){let z=Z,{length:G}=arguments;for(let F=0,K=G;F<K;F++){let W=arguments[F];if(typeof W==="function"||typeof W==="object"&&W!==null){let q=z.o;if(q===null)z.o=q=new WeakMap;let N=q.get(W);if(N===void 0)z=YQ(),q.set(W,z);else z=N}else{let q=z.p;if(q===null)z.p=q=new Map;let N=q.get(W);if(N===void 0)z=YQ(),q.set(W,z);else z=N}}let Y=z,U;if(z.s===aD)U=z.v;else if(U=$.apply(null,arguments),Q++,H){let F=B?.deref?.()??B;if(F!=null&&H(F,U))U=F,Q!==0&&Q--;B=typeof U==="object"&&U!==null||typeof U==="function"?new hc(U):U}return Y.s=aD,Y.v=U,U}return X.clearCache=()=>{Z=YQ(),X.resetResultsCount()},X.resultsCount=()=>Q,X.resetResultsCount=()=>{Q=0},X}function eF($,...J){let Z=typeof $==="function"?{memoize:$,memoizeOptions:J}:$,H=(...B)=>{let Q=0,X=0,z,G={},Y=B.pop();if(typeof Y==="object")G=Y,Y=B.pop();Vc(Y,`createSelector expects an output function after the inputs, but received: [${typeof Y}]`);let U={...Z,...G},{memoize:F,memoizeOptions:K=[],argsMemoize:W=eD,argsMemoizeOptions:q=[],devModeChecks:N={}}=U,V=iD(K),L=iD(q),A=Mc(B),M=F(function(){return Q++,Y.apply(null,arguments)},...V),_=!0,P=W(function(){X++;let w=Pc(A,arguments);return z=M.apply(null,w),z},...L);return Object.assign(P,{resultFunc:Y,memoizedResultFunc:M,dependencies:A,dependencyRecomputations:()=>X,resetDependencyRecomputations:()=>{X=0},lastResult:()=>z,recomputations:()=>Q,resetRecomputations:()=>{Q=0},memoize:F,argsMemoize:W})};return Object.assign(H,{withTypes:()=>H}),H}var vc=eF(eD),gc=Object.assign(($,J=vc)=>{Ac($,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof $}`);let Z=Object.keys($),H=Z.map((Q)=>$[Q]);return J(H,(...Q)=>{return Q.reduce((X,z,G)=>{return X[Z[G]]=z,X},{})})},{withTypes:()=>gc});var fc=eF({memoize:tD,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),S0=($,J,Z,H,B,Q,...X)=>{if(X.length>0)throw Error(E0(1));let z;if($&&J&&Z&&H&&B&&Q)z=(G,Y,U,F)=>{let K=$(G,Y,U,F),W=J(G,Y,U,F),q=Z(G,Y,U,F),N=H(G,Y,U,F),V=B(G,Y,U,F);return Q(K,W,q,N,V,Y,U,F)};else if($&&J&&Z&&H&&B)z=(G,Y,U,F)=>{let K=$(G,Y,U,F),W=J(G,Y,U,F),q=Z(G,Y,U,F),N=H(G,Y,U,F);return B(K,W,q,N,Y,U,F)};else if($&&J&&Z&&H)z=(G,Y,U,F)=>{let K=$(G,Y,U,F),W=J(G,Y,U,F),q=Z(G,Y,U,F);return H(K,W,q,Y,U,F)};else if($&&J&&Z)z=(G,Y,U,F)=>{let K=$(G,Y,U,F),W=J(G,Y,U,F);return Z(K,W,Y,U,F)};else if($&&J)z=(G,Y,U,F)=>{let K=$(G,Y,U,F);return J(K,Y,U,F)};else if($)z=$;else throw Error("Missing arguments");return z},$M=(...$)=>{let J=new WeakMap,Z=1,H=$[$.length-1],B=$.length-1||1,Q=H.length-B;if(Q>3)throw Error(E0(2));return(z,G,Y,U)=>{let F=z.__cacheKey__;if(!F)F={id:Z},z.__cacheKey__=F,Z+=1;let K=J.get(F);if(!K){let W=$,q=[void 0,void 0,void 0];switch(Q){case 0:break;case 1:{W=[...$.slice(0,-1),()=>q[0],H];break}case 2:{W=[...$.slice(0,-1),()=>q[0],()=>q[1],H];break}case 3:{W=[...$.slice(0,-1),()=>q[0],()=>q[1],()=>q[2],H];break}default:throw Error(E0(2))}K=fc(...W),K.selectorArgs=q,J.set(F,K)}switch(K.selectorArgs[0]=G,K.selectorArgs[1]=Y,K.selectorArgs[2]=U,Q){case 0:return K(z);case 1:return K(z,G);case 2:return K(z,G,Y);case 3:return K(z,G,Y,U);default:throw Error("unreachable")}}};var BM=O(g(),1),HK=O(BQ(),1);var a9=O(g(),1),mc=BQ();function pc($,J){return $===J&&($!==0||1/$===1/J)||$!==$&&J!==J}var uc=typeof Object.is==="function"?Object.is:pc,cc=mc.useSyncExternalStore,dc=a9.useRef,lc=a9.useEffect,ic=a9.useMemo,rc=a9.useDebugValue;var $K=function($,J,Z,H,B){var Q=dc(null);if(Q.current===null){var X={hasValue:!1,value:null};Q.current=X}else X=Q.current;Q=ic(function(){function G(W){if(!Y){if(Y=!0,U=W,W=H(W),B!==void 0&&X.hasValue){var q=X.value;if(B(q,W))return F=q}return F=W}if(q=F,uc(U,W))return q;var N=H(W);if(B!==void 0&&B(q,N))return U=W,q;return U=W,F=N}var Y=!1,U,F,K=Z===void 0?null:Z;return[function(){return G(J())},K===null?void 0:function(){return G(K())}]},[J,Z,H,B]);var z=cc($,Q[0],Q[1]);return lc(function(){X.hasValue=!0,X.value=z},[z]),rc(z),z};var JM=O(g(),1);var JK=[],ZK=void 0;function ZM(){return ZK}function HM($){JK.push($)}function FZ($){let J=(Z,H)=>{let B=R1(ac).current,Q;try{ZK=B;for(let X of JK)X.before(B);Q=$(Z,H);for(let X of JK)X.after(B);B.didInitialize=!0}finally{ZK=void 0}return Q};return J.displayName=$.displayName||$.name,J}function KQ($){return JM.forwardRef(FZ($))}function ac(){return{didInitialize:!1}}var nc=WQ(19),oc=nc?tc:ec;function qQ($,J,Z,H,B){return oc($,J,Z,H,B)}function sc($,J,Z,H,B){let Q=BM.useCallback(()=>J($.getSnapshot(),Z,H,B),[$,J,Z,H,B]);return HK.useSyncExternalStore($.subscribe,Q,Q)}HM({before($){if($.syncIndex=0,!$.didInitialize)$.syncTick=1,$.syncHooks=[],$.didChangeStore=!0,$.getSnapshot=()=>{let J=!1;for(let Z=0;Z<$.syncHooks.length;Z+=1){let H=$.syncHooks[Z],B=H.selector(H.store.state,H.a1,H.a2,H.a3);if(H.didChange||!Object.is(H.value,B))J=!0,H.value=B,H.didChange=!1}if(J)$.syncTick+=1;return $.syncTick}},after($){if($.syncHooks.length>0){if($.didChangeStore)$.didChangeStore=!1,$.subscribe=(J)=>{let Z=new Set;for(let B of $.syncHooks)Z.add(B.store);let H=[];for(let B of Z)H.push(B.subscribe(J));return()=>{for(let B of H)B()}};HK.useSyncExternalStore($.subscribe,$.getSnapshot,$.getSnapshot)}}});function tc($,J,Z,H,B){let Q=ZM();if(!Q)return sc($,J,Z,H,B);let X=Q.syncIndex;Q.syncIndex+=1;let z;if(!Q.didInitialize)z={store:$,selector:J,a1:Z,a2:H,a3:B,value:J($.getSnapshot(),Z,H,B),didChange:!1},Q.syncHooks.push(z);else if(z=Q.syncHooks[X],z.store!==$||z.selector!==J||!Object.is(z.a1,Z)||!Object.is(z.a2,H)||!Object.is(z.a3,B)){if(z.store!==$)Q.didChangeStore=!0;z.store=$,z.selector=J,z.a1=Z,z.a2=H,z.a3=B,z.didChange=!0}return z.value}function ec($,J,Z,H,B){return $K($.subscribe,$.getSnapshot,$.getSnapshot,(Q)=>J(Q,Z,H,B))}class BK{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 J=this.updateTick;for(let Z of this.listeners){if(J!==this.updateTick)return;Z($)}}update($){for(let J in $)if(!Object.is(this.state[J],$[J])){this.setState({...this.state,...$});return}}set($,J){if(!Object.is(this.state[$],J))this.setState({...this.state,[$]:J})}notifyAll(){let $={...this.state};this.setState($)}use($,J,Z,H){return qQ(this,$,J,Z,H)}}var F$=O(g(),1);class i2 extends BK{constructor($,J={},Z){super($);this.context=J,this.selectors=Z}useSyncedValue($,J){F$.useDebugValue($),F0(()=>{if(this.state[$]!==J)this.set($,J)},[$,J])}useSyncedValueWithCleanup($,J){let Z=this;F0(()=>{if(Z.state[$]!==J)Z.set($,J);return()=>{Z.set($,void 0)}},[Z,$,J])}useSyncedValues($){let J=this,Z=Object.values($);F0(()=>{J.update($)},[J,...Z])}useControlledProp($,J){F$.useDebugValue($);let Z=J!==void 0;F0(()=>{if(Z&&!Object.is(this.state[$],J))super.setState({...this.state,[$]:J})},[$,J,Z])}select($,J,Z,H){let B=this.selectors[$];return B(this.state,J,Z,H)}useState($,J,Z,H){return F$.useDebugValue($),qQ(this,this.selectors[$],J,Z,H)}useContextCallback($,J){F$.useDebugValue($);let Z=K0(J??u1);this.context[$]=Z}useStateSetter($){let J=F$.useRef(void 0);if(J.current===void 0)J.current=(Z)=>{this.set($,Z)};return J.current}observe($,J){let Z;if(typeof $==="function")Z=$;else Z=this.selectors[$];let H=Z(this.state);return J(H,H,this),this.subscribe((B)=>{let Q=Z(B);if(!Object.is(H,Q)){let X=H;H=Q,J(Q,X,this)}})}}var NQ=null,gX0=globalThis.requestAnimationFrame;class QM{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=($)=>{this.isScheduled=!1;let J=this.callbacks,Z=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,Z>0)for(let H=0;H<J.length;H+=1)J[H]?.($)};request($){let J=this.nextId;this.nextId+=1,this.callbacks.push($),this.callbacksCount+=1;let Z=!1;if(!this.isScheduled||Z)requestAnimationFrame(this.tick),this.isScheduled=!0;return J}cancel($){let J=$-this.startId;if(J<0||J>=this.callbacks.length)return;this.callbacks[J]=null,this.callbacksCount-=1}}var LQ=new QM;class W5{static create(){return new W5}static request($){return LQ.request($)}static cancel($){return LQ.cancel($)}currentId=NQ;request($){this.cancel(),this.currentId=LQ.request(()=>{this.currentId=NQ,$()})}cancel=()=>{if(this.currentId!==NQ)LQ.cancel(this.currentId),this.currentId=NQ};disposeEffect=()=>{return this.cancel}}function z4(){let $=R1(W5.create).current;return w2($.disposeEffect),$}var KZ=0;class i5{static create(){return new i5}currentId=KZ;start($,J){this.clear(),this.currentId=setTimeout(()=>{this.currentId=KZ,J()},$)}isStarted(){return this.currentId!==KZ}clear=()=>{if(this.currentId!==KZ)clearTimeout(this.currentId),this.currentId=KZ};disposeEffect=()=>{return this.clear}}function M5(){let $=R1(i5.create).current;return w2($.disposeEffect),$}var XM=0;function VQ($){return XM+=1,`${$}-${Math.random().toString(36).slice(2,6)}-${XM}`}function m0($){return $?.ownerDocument||document}function AQ($,J){if(typeof $==="string")return{description:$};if(typeof $==="function"){let Z=$(J);return typeof Z==="string"?{description:Z}:Z}return $}var n9=typeof navigator<"u",QK=$d(),zM=Zd(),DQ=Jd(),MQ=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),PQ=QK.platform==="MacIntel"&&QK.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(QK.platform),rX0=n9&&/firefox/i.test(DQ),_Q=n9&&/apple/i.test(navigator.vendor),aX0=n9&&/Edg/i.test(DQ),OQ=n9&&/android/i.test(zM)||/android/i.test(DQ),GM=n9&&zM.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,jQ=DQ.includes("jsdom/");function $d(){if(!n9)return{platform:"",maxTouchPoints:-1};let $=navigator.userAgentData;if($?.platform)return{platform:$.platform,maxTouchPoints:navigator.maxTouchPoints};return{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Jd(){if(!n9)return"";let $=navigator.userAgentData;if($&&Array.isArray($.brands))return $.brands.map(({brand:J,version:Z})=>`${J}/${Z}`).join(" ");return navigator.userAgent}function Zd(){if(!n9)return"";let $=navigator.userAgentData;if($?.platform)return $.platform;return navigator.platform??""}var WZ="data-base-ui-focusable",XK="active",zK="selected",p6="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",y8="ArrowLeft",h8="ArrowRight",qZ="ArrowUp",K$="ArrowDown";function J5($){let J=$.activeElement;while(J?.shadowRoot?.activeElement!=null)J=J.shadowRoot.activeElement;return J}function f0($,J){if(!$||!J)return!1;let Z=J.getRootNode?.();if($.contains(J))return!0;if(Z&&YM(Z)){let H=J;while(H){if($===H)return!0;H=H.parentNode||H.host}}return!1}function W$($,J){if(!j1($))return!1;let Z=$;if(J.hasElement(Z))return!Z.hasAttribute("data-trigger-disabled");for(let[,H]of J.entries())if(f0(H,Z))return!H.hasAttribute("data-trigger-disabled");return!1}function y1($){if("composedPath"in $)return $.composedPath()[0];return $.target}function p4($,J){if(J==null)return!1;if("composedPath"in $)return $.composedPath().includes(J);let Z=$;return Z.target!=null&&J.contains(Z.target)}function UM($){return $.matches("html,body")}function q$($){return P5($)&&$.matches(p6)}function NZ($){if(!$)return!1;return $.getAttribute("role")==="combobox"&&q$($)}function o9($){if(!$||jQ)return!0;try{return $.matches(":focus-visible")}catch(J){return!0}}function N$($){if(!$)return null;return $.hasAttribute(WZ)?$:$.querySelector(`[${WZ}]`)||$}function x8($,J,Z=!0){return $.filter((B)=>B.parentId===J&&(!Z||B.context?.open)).flatMap((B)=>[B,...x8($,B.id,Z)])}function GK($,J){let Z=[],H=$.find((B)=>B.id===J)?.parentId;while(H){let B=$.find((Q)=>Q.id===H);if(H=B?.parentId,B)Z=Z.concat(B)}return Z}function r5($){$.preventDefault(),$.stopPropagation()}function FM($){return"nativeEvent"in $}function TQ($){if($.pointerType===""&&$.isTrusted)return!0;if(OQ&&$.pointerType)return $.type==="click"&&$.buttons===1;return $.detail===0&&!$.pointerType}function CQ($){if(jQ)return!1;return!OQ&&$.width===0&&$.height===0||OQ&&$.width===1&&$.height===1&&$.pressure===0&&$.detail===0&&$.pointerType==="mouse"||$.width<1&&$.height<1&&$.pressure===0&&$.detail===0&&$.pointerType==="touch"}function u4($,J){let Z=["mouse","pen"];if(!J)Z.push("",void 0);return Z.includes($)}function wQ($){let J=$.type;return J==="click"||J==="mousedown"||J==="keydown"||J==="keyup"}function EQ($,J,Z){return Math.floor($/J)!==Z}function u6($,J){return J<0||J>=$.current.length}function SQ($,J){return M2($,{disabledIndices:J})}function UK($,J){return M2($,{decrement:!0,startingIndex:$.current.length,disabledIndices:J})}function M2($,{startingIndex:J=-1,decrement:Z=!1,disabledIndices:H,amount:B=1}={}){let Q=J;do Q+=Z?-B:B;while(Q>=0&&Q<=$.current.length-1&&c6($,Q,H));return Q}function KM($,{event:J,orientation:Z,loopFocus:H,rtl:B,cols:Q,disabledIndices:X,minIndex:z,maxIndex:G,prevIndex:Y,stopEvent:U=!1}){let F=Y,K=[],W={},q=!1;{let L=null,A=-1;$.current.forEach((M,_)=>{if(M==null)return;let P=M.closest('[role="row"]');if(P)q=!0;if(P!==L||A===-1)L=P,A+=1,K[A]=[];K[A].push(_),W[_]=A})}let N=q&&K.length>0&&K.some((L)=>L.length!==Q);function V(L){if(!N||Y===-1)return;let A=W[Y];if(A==null)return;let M=K[A].indexOf(Y),_=L==="up"?A-1:A+1;if(H){if(_<0)_=K.length-1;else if(_>=K.length)_=0}let P=new Set;while(_>=0&&_<K.length&&!P.has(_)){P.add(_);let D=K[_];if(D.length===0){_=L==="up"?_-1:_+1;continue}let w=Math.min(M,D.length-1);for(let R=w;R>=0;R-=1){let b=D[R];if(!c6($,b,X))return b}if(_=L==="up"?_-1:_+1,H){if(_<0)_=K.length-1;else if(_>=K.length)_=0}}return}if(J.key===qZ){let L=V("up");if(L!==void 0){if(U)r5(J);F=L}else{if(U)r5(J);if(Y===-1)F=G;else if(F=M2($,{startingIndex:F,amount:Q,decrement:!0,disabledIndices:X}),H&&(Y-Q<z||F<0)){let A=Y%Q,M=G%Q,_=G-(M-A);if(M===A)F=G;else F=M>A?_:_-Q}if(u6($,F))F=Y}}if(J.key===K$){let L=V("down");if(L!==void 0){if(U)r5(J);F=L}else{if(U)r5(J);if(Y===-1)F=z;else if(F=M2($,{startingIndex:Y,amount:Q,disabledIndices:X}),H&&Y+Q>G)F=M2($,{startingIndex:Y%Q-Q,amount:Q,disabledIndices:X});if(u6($,F))F=Y}}if(Z==="both"){let L=YK(Y/Q);if(J.key===(B?y8:h8)){if(U)r5(J);if(Y%Q!==Q-1){if(F=M2($,{startingIndex:Y,disabledIndices:X}),H&&EQ(F,Q,L))F=M2($,{startingIndex:Y-Y%Q-1,disabledIndices:X})}else if(H)F=M2($,{startingIndex:Y-Y%Q-1,disabledIndices:X});if(EQ(F,Q,L))F=Y}if(J.key===(B?h8:y8)){if(U)r5(J);if(Y%Q!==0){if(F=M2($,{startingIndex:Y,decrement:!0,disabledIndices:X}),H&&EQ(F,Q,L))F=M2($,{startingIndex:Y+(Q-Y%Q),decrement:!0,disabledIndices:X})}else if(H)F=M2($,{startingIndex:Y+(Q-Y%Q),decrement:!0,disabledIndices:X});if(EQ(F,Q,L))F=Y}let A=YK(G/Q)===L;if(u6($,F))if(H&&A)F=J.key===(B?h8:y8)?G:M2($,{startingIndex:Y-Y%Q-1,disabledIndices:X});else F=Y}return F}function WM($,J,Z){let H=[],B=0;return $.forEach(({width:Q,height:X},z)=>{if(Q>J);let G=!1;if(Z)B=0;while(!G){let Y=[];for(let U=0;U<Q;U+=1)for(let F=0;F<X;F+=1)Y.push(B+U+F*J);if(B%J+Q<=J&&Y.every((U)=>H[U]==null))Y.forEach((U)=>{H[U]=z}),G=!0;else B+=1}}),[...H]}function qM($,J,Z,H,B){if($===-1)return-1;let Q=Z.indexOf($),X=J[$];switch(B){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)*H;case"br":return Z.lastIndexOf($);default:return-1}}function NM($,J){return J.flatMap((Z,H)=>$.includes(Z)?[H]:[])}function c6($,J,Z){if(typeof Z==="function")return Z(J);if(Z)return Z.includes(J);let H=$.current[J];if(!H)return!1;return H.hasAttribute("disabled")||H.getAttribute("aria-disabled")==="true"}/*!
|
|
10
|
+
* tabbable 6.4.0
|
|
11
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
12
|
+
*/var Hd=["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] *)"],IQ=Hd.join(","),VM=typeof Element>"u",d6=VM?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,RQ=!VM&&Element.prototype.getRootNode?function($){var J;return $===null||$===void 0?void 0:(J=$.getRootNode)===null||J===void 0?void 0:J.call($)}:function($){return $===null||$===void 0?void 0:$.ownerDocument},kQ=function(J,Z){var H;if(Z===void 0)Z=!0;var B=J===null||J===void 0?void 0:(H=J.getAttribute)===null||H===void 0?void 0:H.call(J,"inert"),Q=B===""||B==="true",X=Q||Z&&J&&(typeof J.closest==="function"?J.closest("[inert]"):kQ(J.parentNode));return X},Bd=function(J){var Z,H=J===null||J===void 0?void 0:(Z=J.getAttribute)===null||Z===void 0?void 0:Z.call(J,"contenteditable");return H===""||H==="true"},AM=function(J,Z,H){if(kQ(J))return[];var B=Array.prototype.slice.apply(J.querySelectorAll(IQ));if(Z&&d6.call(J,IQ))B.unshift(J);return B=B.filter(H),B},bQ=function(J,Z,H){var B=[],Q=Array.from(J);while(Q.length){var X=Q.shift();if(kQ(X,!1))continue;if(X.tagName==="SLOT"){var z=X.assignedElements(),G=z.length?z:X.children,Y=bQ(G,!0,H);if(H.flatten)B.push.apply(B,Y);else B.push({scopeParent:X,candidates:Y})}else{var U=d6.call(X,IQ);if(U&&H.filter(X)&&(Z||!J.includes(X)))B.push(X);var F=X.shadowRoot||typeof H.getShadowRoot==="function"&&H.getShadowRoot(X),K=!kQ(F,!1)&&(!H.shadowRootFilter||H.shadowRootFilter(X));if(F&&K){var W=bQ(F===!0?X.children:F.children,!0,H);if(H.flatten)B.push.apply(B,W);else B.push({scopeParent:X,candidates:W})}else Q.unshift.apply(Q,X.children)}}return B},DM=function(J){return!isNaN(parseInt(J.getAttribute("tabindex"),10))},MM=function(J){if(!J)throw Error("No node provided");if(J.tabIndex<0){if((/^(AUDIO|VIDEO|DETAILS)$/.test(J.tagName)||Bd(J))&&!DM(J))return 0}return J.tabIndex},Qd=function(J,Z){var H=MM(J);if(H<0&&Z&&!DM(J))return 0;return H},Xd=function(J,Z){return J.tabIndex===Z.tabIndex?J.documentOrder-Z.documentOrder:J.tabIndex-Z.tabIndex},PM=function(J){return J.tagName==="INPUT"},zd=function(J){return PM(J)&&J.type==="hidden"},Gd=function(J){var Z=J.tagName==="DETAILS"&&Array.prototype.slice.apply(J.children).some(function(H){return H.tagName==="SUMMARY"});return Z},Yd=function(J,Z){for(var H=0;H<J.length;H++)if(J[H].checked&&J[H].form===Z)return J[H]},Ud=function(J){if(!J.name)return!0;var Z=J.form||RQ(J),H=function(z){return Z.querySelectorAll('input[type="radio"][name="'+z+'"]')},B;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape==="function")B=H(window.CSS.escape(J.name));else try{B=H(J.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=Yd(B,J.form);return!Q||Q===J},Fd=function(J){return PM(J)&&J.type==="radio"},Kd=function(J){return Fd(J)&&!Ud(J)},Wd=function(J){var Z,H=J&&RQ(J),B=(Z=H)===null||Z===void 0?void 0:Z.host,Q=!1;if(H&&H!==J){var X,z,G;Q=!!((X=B)!==null&&X!==void 0&&(z=X.ownerDocument)!==null&&z!==void 0&&z.contains(B)||J!==null&&J!==void 0&&(G=J.ownerDocument)!==null&&G!==void 0&&G.contains(J));while(!Q&&B){var Y,U,F;H=RQ(B),B=(Y=H)===null||Y===void 0?void 0:Y.host,Q=!!((U=B)!==null&&U!==void 0&&(F=U.ownerDocument)!==null&&F!==void 0&&F.contains(B))}}return Q},LM=function(J){var Z=J.getBoundingClientRect(),H=Z.width,B=Z.height;return H===0&&B===0},qd=function(J,Z){var{displayCheck:H,getShadowRoot:B}=Z;if(H==="full-native"){if("checkVisibility"in J){var Q=J.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!Q}}if(getComputedStyle(J).visibility==="hidden")return!0;var X=d6.call(J,"details>summary:first-of-type"),z=X?J.parentElement:J;if(d6.call(z,"details:not([open]) *"))return!0;if(!H||H==="full"||H==="full-native"||H==="legacy-full"){if(typeof B==="function"){var G=J;while(J){var Y=J.parentElement,U=RQ(J);if(Y&&!Y.shadowRoot&&B(Y)===!0)return LM(J);else if(J.assignedSlot)J=J.assignedSlot;else if(!Y&&U!==J.ownerDocument)J=U.host;else J=Y}J=G}if(Wd(J))return!J.getClientRects().length;if(H!=="legacy-full")return!0}else if(H==="non-zero-area")return LM(J);return!1},Nd=function(J){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(J.tagName)){var Z=J.parentElement;while(Z){if(Z.tagName==="FIELDSET"&&Z.disabled){for(var H=0;H<Z.children.length;H++){var B=Z.children.item(H);if(B.tagName==="LEGEND")return d6.call(Z,"fieldset[disabled] *")?!0:!B.contains(J)}return!0}Z=Z.parentElement}}return!1},FK=function(J,Z){if(Z.disabled||zd(Z)||qd(Z,J)||Gd(Z)||Nd(Z))return!1;return!0},KK=function(J,Z){if(Kd(Z)||MM(Z)<0||!FK(J,Z))return!1;return!0},Ld=function(J){var Z=parseInt(J.getAttribute("tabindex"),10);if(isNaN(Z)||Z>=0)return!0;return!1},_M=function(J){var Z=[],H=[];return J.forEach(function(B,Q){var X=!!B.scopeParent,z=X?B.scopeParent:B,G=Qd(z,X),Y=X?_M(B.candidates):z;if(G===0)X?Z.push.apply(Z,Y):Z.push(z);else H.push({documentOrder:Q,tabIndex:G,item:B,isScope:X,content:Y})}),H.sort(Xd).reduce(function(B,Q){return Q.isScope?B.push.apply(B,Q.content):B.push(Q.content),B},[]).concat(Z)},L$=function(J,Z){Z=Z||{};var H;if(Z.getShadowRoot)H=bQ([J],Z.includeContainer,{filter:KK.bind(null,Z),flatten:!1,getShadowRoot:Z.getShadowRoot,shadowRootFilter:Ld});else H=AM(J,Z.includeContainer,KK.bind(null,Z));return _M(H)},OM=function(J,Z){Z=Z||{};var H;if(Z.getShadowRoot)H=bQ([J],Z.includeContainer,{filter:FK.bind(null,Z),flatten:!0,getShadowRoot:Z.getShadowRoot});else H=AM(J,Z.includeContainer,FK.bind(null,Z));return H},WK=function(J,Z){if(Z=Z||{},!J)throw Error("No node provided");if(d6.call(J,IQ)===!1)return!1;return KK(Z,J)};var V$=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function jM($,J){let Z=L$($,V$()),H=Z.length;if(H===0)return;let B=J5(m0($)),Q=Z.indexOf(B),X=Q===-1?J===1?0:H-1:Q+J;return Z[X]}function s9($){return jM(m0($).body,1)||$}function yQ($){return jM(m0($).body,-1)||$}function TM($,J){if(!$)return null;let Z=L$(m0($).body,V$()),H=Z.length;if(H===0)return null;let B=Z.indexOf($);if(B===-1)return null;let Q=(B+J+H)%H;return Z[Q]}function hQ($){return TM($,1)}function xQ($){return TM($,-1)}function Y8($,J){let Z=J||$.currentTarget,H=$.relatedTarget;return!H||!f0(Z,H)}function CM($){L$($,V$()).forEach((Z)=>{Z.dataset.tabindex=Z.getAttribute("tabindex")||"",Z.setAttribute("tabindex","-1")})}function qK($){$.querySelectorAll("[data-tabindex]").forEach((Z)=>{let H=Z.dataset.tabindex;if(delete Z.dataset.tabindex,H)Z.setAttribute("tabindex",H);else Z.removeAttribute("tabindex")})}var vQ=$M(($)=>$.toasts,($)=>{let J=new Map,Z=0,H=0;return $.forEach((B,Q)=>{let X=B.transitionStatus==="ending";if(J.set(B.id,{value:B,domIndex:Q,visibleIndex:X?-1:Z,offsetY:H}),H+=B.height||0,!X)Z+=1}),J}),C9={toasts:S0(($)=>$.toasts),isEmpty:S0(($)=>$.toasts.length===0),toast:S0(vQ,($,J)=>$.get(J)?.value),toastIndex:S0(vQ,($,J)=>$.get(J)?.domIndex??-1),toastOffsetY:S0(vQ,($,J)=>$.get(J)?.offsetY??0),toastVisibleIndex:S0(vQ,($,J)=>$.get(J)?.visibleIndex??-1),hovering:S0(($)=>$.hovering),focused:S0(($)=>$.focused),expanded:S0(($)=>$.hovering||$.focused),expandedOrOutOfFocus:S0(($)=>$.hovering||$.focused||!$.isWindowFocused),prevFocusElement:S0(($)=>$.prevFocusElement)};class NK extends i2{timers=new Map;areTimersPaused=!1;constructor($){super($,{},C9)}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 J=C9.toastIndex(this.state,$);if(J===-1)return;this.state.toasts[J]?.onRemove?.();let H=[...this.state.toasts];H.splice(J,1),this.setToasts(H)}addToast=($)=>{let{toasts:J,timeout:Z,limit:H}=this.state,B=$.id||VQ("toast"),Q={...$,id:B,transitionStatus:"starting"},X=[Q,...J],z=X.filter((Y)=>Y.transitionStatus!=="ending");if(z.length>H){let Y=z.length-H,U=z.slice(-Y),F=new Set(U.map((K)=>K.id));this.setToasts(X.map((K)=>{let W=F.has(K.id);if(K.limited!==W)return{...K,limited:W};return K}))}else this.setToasts(X.map((Y)=>Y.limited?{...Y,limited:!1}:Y));let G=Q.timeout??Z;if(Q.type!=="loading"&&G>0)this.scheduleTimer(B,G,()=>this.closeToast(B));if(C9.expandedOrOutOfFocus(this.state))this.pauseTimers();return B};updateToast=($,J)=>{this.updateToastInternal($,J)};updateToastInternal=($,J)=>{let{timeout:Z,toasts:H}=this.state,B=C9.toast(this.state,$)??null;if(!B)return;if(B.transitionStatus==="ending")return;let Q={...B,...J};this.setToasts(H.map((W)=>W.id===$?{...W,...J}:W));let X=Q.timeout??Z,z=B?.timeout??Z,G=Object.hasOwn(J,"timeout"),Y=Q.transitionStatus!=="ending"&&Q.type!=="loading"&&X>0,U=this.timers.has($),F=z!==X,K=B?.type==="loading";if(!Y&&U){this.timers.get($)?.timeout?.clear(),this.timers.delete($);return}if(Y&&(!U||F||G||K)){let W=this.timers.get($);if(W)W.timeout?.clear(),this.timers.delete($);if(this.scheduleTimer($,X,()=>this.closeToast($)),C9.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=($)=>{C9.toast(this.state,$)?.onClose?.();let{limit:Z,toasts:H}=this.state,B=0,Q=H.map((z)=>{if(z.id===$)return{...z,transitionStatus:"ending",height:0};if(z.transitionStatus==="ending")return z;let G=B>=Z;return B+=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=($,J)=>{let Z=AQ(J.loading),H=this.addToast({...Z,type:"loading"}),B=$.then((Q)=>{let X=AQ(J.success,Q);return this.updateToast(H,{...X,type:"success",timeout:X.timeout}),Q}).catch((Q)=>{let X=AQ(J.error,Q);return this.updateToast(H,{...X,type:"error",timeout:X.timeout}),Promise.reject(Q)});if({}.hasOwnProperty.call(J,"setPromise"))J.setPromise(B);return B};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach(($)=>{if($.timeout){$.timeout.clear();let J=Date.now()-$.start,Z=$.delay-J;$.remaining=Z>0?Z:0}})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach(($,J)=>{$.remaining=$.remaining>0?$.remaining:$.delay,$.timeout??=i5.create(),$.timeout.start($.remaining,()=>{this.timers.delete(J),$.callback()}),$.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=($)=>{if($.pointerType!=="touch")return;let J=y1($);if(f0(this.state.viewport,J))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer($,J,Z){let H=Date.now(),B=!C9.expandedOrOutOfFocus(this.state),Q=B?i5.create():void 0;Q?.start(J,()=>{this.timers.delete($),Z()}),this.timers.set($,{timeout:Q,start:B?H:0,delay:J,remaining:J,callback:Z})}setToasts($){let J={toasts:$};if($.length===0)J.hovering=!1,J.focused=!1;this.update(J)}handleFocusManagement($){let J=J5(m0(this.state.viewport));if(!this.state.viewport||!f0(this.state.viewport,J)||!o9(J))return;let Z=C9.toasts(this.state),H=C9.toastIndex(this.state,$),B=null,Q=H+1;while(Q<Z.length){if(Z[Q].transitionStatus!=="ending"){B=Z[Q];break}Q+=1}if(!B){Q=H-1;while(Q>=0){if(Z[Q].transitionStatus!=="ending"){B=Z[Q];break}Q-=1}}if(B)B.ref?.current?.focus();else this.restoreFocusToPrevElement()}}var EM=O(c(),1),SM=function(J){let{children:Z,timeout:H=5000,limit:B=3,toastManager:Q}=J,X=R1(()=>new NK({timeout:H,limit:B,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return w2(X.disposeEffect),wM.useEffect(function(){if(!Q)return;return Q[" subscribe"](({action:Y,options:U})=>{let F=U.id;if(Y==="promise"&&U.promise)X.promiseToast(U.promise,U);else if(Y==="update"&&F)X.updateToast(F,U);else if(Y==="close"&&F)X.closeToast(F);else X.addToast(U)})},[X,H,Q]),X.useSyncedValues({timeout:H,limit:B}),EM.jsx(YZ.Provider,{value:X,children:Z})};var I2=O(g(),1);var IM={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},U8={...IM,position:"fixed",top:0,left:0},RM={...IM,position:"absolute"};var gQ=O(g(),1);var kM=O(c(),1),S2=gQ.forwardRef(function(J,Z){let[H,B]=gQ.useState();return F0(()=>{if(_Q)B("button")},[]),kM.jsx("span",{...J,ref:Z,style:U8,"aria-hidden":H?void 0:!0,...{tabIndex:0,role:H},"data-base-ui-focus-guard":""})});var bM=function($){return $.frontmostHeight="--toast-frontmost-height",$}({});var F8=O(c(),1),yM=I2.forwardRef(function(J,Z){let{render:H,className:B,children:Q,...X}=J,z=r9(),G=M5(),Y=I2.useRef(!1),U=I2.useRef(!1),F=z.useState("isEmpty"),K=z.useState("toasts"),W=z.useState("focused"),q=z.useState("expanded"),N=z.useState("prevFocusElement"),V=K[0]?.height??0,L=I2.useMemo(()=>K.some((I)=>I.transitionStatus==="ending"),[K]);I2.useEffect(()=>{let I=z.state.viewport;if(!I)return;function S(C){if(F)return;if(C.key==="F6"&&C.target!==I)C.preventDefault(),z.setPrevFocusElement(J5(m0(I))),I?.focus({preventScroll:!0}),z.pauseTimers(),z.setFocused(!0)}let j=E2(I);return j.addEventListener("keydown",S),()=>{j.removeEventListener("keydown",S)}},[z,F]),I2.useEffect(()=>{let I=z.state.viewport;if(!I||F)return;let S=E2(I);function j(k){if(k.target!==S)return;z.setIsWindowFocused(!1),z.pauseTimers()}function C(k){if(k.relatedTarget||k.target===S)return;let y=y1(k),v=J5(m0(I));if(!f0(I,y)||!o9(v))z.resumeTimers();G.start(0,()=>z.setIsWindowFocused(!0))}return S.addEventListener("blur",j,!0),S.addEventListener("focus",C,!0),()=>{S.removeEventListener("blur",j,!0),S.removeEventListener("focus",C,!0)}},[z,G,F]),I2.useEffect(()=>{let I=z.state.viewport;if(!I||F)return;let S=m0(I);return S.addEventListener("pointerdown",z.handleDocumentPointerDown,!0),()=>{S.removeEventListener("pointerdown",z.handleDocumentPointerDown,!0)}},[F,z]);function A(I){let S=z.state.viewport;if(!S)return;if(Y.current=!0,I.relatedTarget===S)K[0]?.ref?.current?.focus();else z.restoreFocusToPrevElement()}function M(I){if(I.key==="Tab"&&I.shiftKey&&I.target===z.state.viewport)I.preventDefault(),z.restoreFocusToPrevElement(),z.resumeTimers()}I2.useEffect(()=>{if(!z.state.isWindowFocused||L||!U.current)return;z.resumeTimers(),z.setHovering(!1),U.current=!1},[L,z]);function _(){z.pauseTimers(),z.setHovering(!0),U.current=!1}function P(){if(L)U.current=!0;else z.resumeTimers(),z.setHovering(!1)}function D(){if(Y.current){Y.current=!1;return}if(W)return;if(o9(m0(z.state.viewport).activeElement))z.setFocused(!0),z.pauseTimers()}function w(I){if(!W||f0(z.state.viewport,I.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:P,onFocus:D,onBlur:w,onKeyDown:M,onClick:D},b={expanded:q},E=U0("div",J,{ref:[Z,z.setViewport],state:b,props:[R,{style:{[bM.frontmostHeight]:V?`${V}px`:void 0}},X,{children:F8.jsxs(I2.Fragment,{children:[!F&&N&&F8.jsx(S2,{onFocus:A}),Q,!F&&N&&F8.jsx(S2,{onFocus:A})]})}]}),x=I2.useMemo(()=>K.filter((I)=>I.priority==="high"),[K]);return F8.jsxs(I2.Fragment,{children:[!F&&N&&F8.jsx(S2,{onFocus:A}),E,!W&&x.length>0&&F8.jsx("div",{style:U8,children:x.map((I)=>F8.jsxs("div",{role:"alert","aria-atomic":!0,children:[F8.jsx("div",{children:I.title}),F8.jsx("div",{children:I.description})]},I.id))})]})});var q5=O(g(),1),gM=O(G4(),1);function v8($){if(WQ(19))return $;return $?"true":void 0}var fQ=O(g(),1),LK=fQ.createContext(void 0);function g8(){let $=fQ.useContext(LK);if(!$)throw Error(E0(66));return $}var f8=function($){return $.startingStyle="data-starting-style",$.endingStyle="data-ending-style",$}({}),Vd={[f8.startingStyle]:""},Ad={[f8.endingStyle]:""},c1={transitionStatus($){if($==="starting")return Vd;if($==="ending")return Ad;return null}};var xM=O(g(),1);var hM=O(G4(),1);function K8($){if($==null)return $;return"current"in $?$.current:$}function m8($,J=!1,Z=!0){let H=z4();return K0((B,Q=null)=>{H.cancel();function X(){hM.flushSync(B)}let z=K8($);if(z==null)return;let G=z;if(typeof G.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)B();else{let Y=function(){let F=f8.startingStyle;if(!G.hasAttribute(F)){H.request(U);return}let K=new MutationObserver(()=>{if(!G.hasAttribute(F))K.disconnect(),U()});K.observe(G,{attributes:!0,attributeFilter:[F]}),Q?.addEventListener("abort",()=>K.disconnect(),{once:!0})},U=function(){Promise.all(G.getAnimations().map((F)=>F.finished)).then(()=>{if(Q?.aborted)return;X()}).catch(()=>{let F=G.getAnimations();if(Z){if(Q?.aborted)return;X()}else if(F.length>0&&F.some((K)=>K.pending||K.playState!=="finished"))U()})};if(J){Y();return}H.request(U)}})}function b5($){let{enabled:J=!0,open:Z,ref:H,onComplete:B}=$,Q=K0(B),X=m8(H,Z,!1);xM.useEffect(()=>{if(!J)return;let z=new AbortController;return X(Q,z.signal),()=>{z.abort()}},[J,Z,Q,X])}var p8=function($){return $.index="--toast-index",$.offsetY="--toast-offset-y",$.height="--toast-height",$.swipeMovementX="--toast-swipe-movement-x",$.swipeMovementY="--toast-swipe-movement-y",$}({});var fM=O(c(),1),Dd={...c1,swipeDirection($){return $?{"data-swipe-direction":$}:null}},LZ=40,Md=10,t9=0.5,Pd=1;function vM($,J,Z){switch($){case"up":return-Z;case"down":return Z;case"left":return-J;case"right":return J;default:return 0}}function _d($){let Z=window.getComputedStyle($).transform,H=0,B=0,Q=1;if(Z&&Z!=="none"){let X=Z.match(/matrix(?:3d)?\(([^)]+)\)/);if(X){let z=X[1].split(", ").map(parseFloat);if(z.length===6)H=z[4],B=z[5],Q=Math.sqrt(z[0]*z[0]+z[1]*z[1]);else if(z.length===16)H=z[12],B=z[13],Q=z[0]}}return{x:H,y:B,scale:Q}}var mM=q5.forwardRef(function(J,Z){let{toast:H,render:B,className:Q,swipeDirection:X=["down","right"],...z}=J,G=H.positionerProps?.anchor!==void 0,Y=[];if(!G)Y=Array.isArray(X)?X:[X];let U=Y.length>0,F=r9(),[K,W]=q5.useState(void 0),[q,N]=q5.useState(!1),[V,L]=q5.useState(!1),[A,M]=q5.useState(!1),[_,P]=q5.useState({x:0,y:0}),[D,w]=q5.useState({x:0,y:0,scale:1}),[R,b]=q5.useState(),[E,x]=q5.useState(),[I,S]=q5.useState(null),j=q5.useRef(null),C=q5.useRef({x:0,y:0}),k=q5.useRef({x:0,y:0,scale:1}),y=q5.useRef(void 0),v=q5.useRef(0),u=q5.useRef(!1),T=q5.useRef({x:0,y:0}),t=q5.useRef(!1),B0=F.useState("toastIndex",H.id),h=F.useState("toastVisibleIndex",H.id),e=F.useState("toastOffsetY",H.id),A0=F.useState("focused"),l=F.useState("expanded");b5({open:H.transitionStatus!=="ending",ref:j,onComplete(){if(H.transitionStatus==="ending")F.removeToast(H.id)}});let z0=K0((m=!1)=>{let a=j.current;if(!a)return;let o=a.style.height;a.style.height="auto";let N0=a.offsetHeight;a.style.height=o;function O0(){F.updateToastInternal(H.id,{ref:j,height:N0,...H.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}if(m)gM.flushSync(O0);else O0()});F0(z0,[z0]);function W0(m,a){let o=m,N0=a;if(!Y.includes("left")&&!Y.includes("right"))o=m>0?m**t9:-(Math.abs(m)**t9);else{if(!Y.includes("right")&&m>0)o=m**t9;if(!Y.includes("left")&&m<0)o=-(Math.abs(m)**t9)}if(!Y.includes("up")&&!Y.includes("down"))N0=a>0?a**t9:-(Math.abs(a)**t9);else{if(!Y.includes("down")&&a>0)N0=a**t9;if(!Y.includes("up")&&a<0)N0=-(Math.abs(a)**t9)}return{x:o,y:N0}}function Q0(m){if(m.button!==0)return;if(m.pointerType==="touch")F.pauseTimers();let a=y1(m.nativeEvent);if(a?a.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'):!1)return;if(u.current=!1,y.current=void 0,v.current=0,C.current={x:m.clientX,y:m.clientY},T.current=C.current,j.current){let N0=_d(j.current);k.current=N0,w(N0),P({x:N0.x,y:N0.y})}F.setHovering(!0),N(!0),L(!1),S(null),t.current=!0,j.current?.setPointerCapture(m.pointerId)}function G0(m){if(!q)return;if(m.preventDefault(),t.current)C.current={x:m.clientX,y:m.clientY},t.current=!1;let{clientY:a,clientX:o,movementX:N0,movementY:O0}=m;if(O0<0&&a>T.current.y||O0>0&&a<T.current.y)T.current={x:T.current.x,y:a};if(N0<0&&o>T.current.x||N0>0&&o<T.current.x)T.current={x:o,y:T.current.y};let g0=o-C.current.x,p0=a-C.current.y,f=a-T.current.y,r=o-T.current.x;if(!V){if(Math.sqrt(g0*g0+p0*p0)>=Pd){if(L(!0),I===null){let U1=Y.includes("left")||Y.includes("right"),c0=Y.includes("up")||Y.includes("down");if(U1&&c0){let y0=Math.abs(g0),d0=Math.abs(p0);S(y0>d0?"horizontal":"vertical")}}}}let X0;if(!y.current){if(I==="vertical"){if(p0>0)X0="down";else if(p0<0)X0="up"}else if(I==="horizontal"){if(g0>0)X0="right";else if(g0<0)X0="left"}else if(Math.abs(g0)>=Math.abs(p0))X0=g0>0?"right":"left";else X0=p0>0?"down":"up";if(X0&&Y.includes(X0))y.current=X0,v.current=vM(X0,g0,p0),W(X0)}else{let Q1=y.current,U1=vM(Q1,r,f);if(U1>LZ)u.current=!1,W(Q1);else if(!(Y.includes("left")&&Y.includes("right"))&&!(Y.includes("up")&&Y.includes("down"))&&v.current-U1>=Md)u.current=!0}let V0=W0(g0,p0),j0=k.current.x,v0=k.current.y;if(I==="horizontal"){if(Y.includes("left")||Y.includes("right"))j0+=V0.x}else if(I==="vertical"){if(Y.includes("up")||Y.includes("down"))v0+=V0.y}else{if(Y.includes("left")||Y.includes("right"))j0+=V0.x;if(Y.includes("up")||Y.includes("down"))v0+=V0.y}P({x:j0,y:v0})}function L0(m){if(!q)return;if(N(!1),L(!1),S(null),j.current?.releasePointerCapture(m.pointerId),u.current){P({x:D.x,y:D.y}),W(void 0);return}let a=!1,o=_.x-D.x,N0=_.y-D.y,O0;for(let g0 of Y){switch(g0){case"right":if(o>LZ)a=!0,O0="right";break;case"left":if(o<-LZ)a=!0,O0="left";break;case"down":if(N0>LZ)a=!0,O0="down";break;case"up":if(N0<-LZ)a=!0,O0="up";break;default:break}if(a)break}if(a)W(O0),M(!0),F.closeToast(H.id);else P({x:D.x,y:D.y}),W(void 0)}function i(m){if(m.key==="Escape"){if(!j.current||!f0(j.current,J5(m0(j.current))))return;F.closeToast(H.id)}}q5.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 $0(){if(!q&&_.x===D.x&&_.y===D.y&&!A)return{[p8.swipeMovementX]:"0px",[p8.swipeMovementY]:"0px"};let m=_.x-D.x,a=_.y-D.y;return{transition:q?"none":void 0,transform:q?`translateX(${_.x}px) translateY(${_.y}px) scale(${D.scale})`:void 0,[p8.swipeMovementX]:`${m}px`,[p8.swipeMovementY]:`${a}px`}}let J0=H.priority==="high",H0={role:J0?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":R,"aria-describedby":E,"aria-hidden":J0&&!A0?!0:void 0,onPointerDown:U?Q0:void 0,onPointerMove:U?G0:void 0,onPointerUp:U?L0:void 0,onKeyDown:i,inert:v8(H.limited),style:{...$0(),[p8.index]:H.transitionStatus==="ending"?B0:h,[p8.offsetY]:`${e}px`,[p8.height]:H.height?`${H.height}px`:void 0}},n=q5.useMemo(()=>({rootRef:j,toast:H,titleId:R,setTitleId:b,descriptionId:E,setDescriptionId:x,swiping:q,swipeDirection:K,recalculateHeight:z0,index:B0,visibleIndex:h,expanded:l}),[H,R,E,q,K,z0,B0,h,l]),p={transitionStatus:H.transitionStatus,expanded:l,limited:H.limited||!1,type:H.type,swiping:n.swiping,swipeDirection:n.swipeDirection},d=U0("div",J,{ref:[Z,n.rootRef],state:p,stateAttributesMapping:Dd,props:[H0,z]});return fM.jsx(LK.Provider,{value:n,children:d})});var mQ=O(g(),1);var pM=mQ.forwardRef(function(J,Z){let{render:H,className:B,...Q}=J,{visibleIndex:X,expanded:z,recalculateHeight:G}=g8(),Y=mQ.useRef(null);F0(()=>{let W=Y.current;if(!W)return;if(G(),typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let q=new ResizeObserver(()=>G(!0)),N=new MutationObserver(()=>G(!0));return q.observe(W),N.observe(W,{childList:!0,subtree:!0,characterData:!0}),()=>{q.disconnect(),N.disconnect()}},[G]);let U=X>0;return U0("div",J,{ref:[Z,Y],state:{expanded:z,behind:U},props:Q})});var lM=O(g(),1);var pQ=O(g(),1);var uM=0;function Od($,J="mui"){let[Z,H]=pQ.useState($),B=$||Z;return pQ.useEffect(()=>{if(Z==null)uM+=1,H(`${J}-${uM}`)},[Z,J]),B}var cM=dM.useId;function U2($,J){if(cM!==void 0){let Z=cM();return $??(J?`${J}-${Z}`:Z)}return Od($,J)}var iM=lM.forwardRef(function(J,Z){let{render:H,className:B,id:Q,children:X,...z}=J,{toast:G,setDescriptionId:Y}=g8(),U=X??G.description,F=Boolean(U),K=U2(Q);F0(()=>{if(!F)return;return Y(K),()=>{Y(void 0)}},[F,K,Y]);let W={type:G.type},q=U0("p",J,{ref:Z,state:W,props:{...z,id:K,children:U}});if(!F)return null;return q});var rM=O(g(),1);var aM=rM.forwardRef(function(J,Z){let{render:H,className:B,id:Q,children:X,...z}=J,{toast:G,setTitleId:Y}=g8(),U=X??G.title,F=Boolean(U),K=U2(Q);F0(()=>{if(!F)return;return Y(K),()=>{Y(void 0)}},[F,K,Y]);let W={type:G.type},q=U0("h2",J,{ref:Z,state:W,props:{...z,id:K,children:U}});if(!F)return null;return q});var uQ=O(g(),1);var nM=uQ.forwardRef(function(J,Z){let{render:H,className:B,disabled:Q,nativeButton:X=!0,...z}=J,G=r9(),{toast:Y}=g8(),U=G.useState("expanded"),[F,K]=uQ.useState(!1),{getButtonProps:W,buttonRef:q}=p5({disabled:Q,native:X}),N={type:Y.type};return U0("button",J,{ref:[Z,q],state:N,props:[{"aria-hidden":!U&&!F,onClick(){G.closeToast(Y.id)},onFocus(){K(!0)},onBlur(){K(!1)}},z,W]})});var oM=O(g(),1);var sM=oM.forwardRef(function(J,Z){let{render:H,className:B,disabled:Q,nativeButton:X=!0,...z}=J,{toast:G}=g8(),Y=G.actionProps?.children??z.children,U=Boolean(Y),{getButtonProps:F,buttonRef:K}=p5({disabled:Q,native:X}),W={type:G.type},q=U0("button",J,{ref:[Z,K],state:W,props:[z,G.actionProps,F,{children:Y}]});if(!U)return null;return q});var HX=O(g(),1),DP=O(G4(),1);var Y4=O(g(),1);var lQ=O(g(),1);function T5($){let J=R1(jd,$).current;return J.next=$,F0(J.effect),J}function jd($){let J={current:$,next:$,effect:()=>{J.current=J.next}};return J}var e9=O(g(),1);function cQ(){let $=new Map;return{emit(J,Z){$.get(J)?.forEach((H)=>H(Z))},on(J,Z){if(!$.has(J))$.set(J,new Set);$.get(J).add(Z)},off(J,Z){$.get(J)?.delete(Z)}}}class A${nodesRef={current:[]};events=cQ();addNode($){this.nodesRef.current.push($)}removeNode($){let J=this.nodesRef.current.findIndex((Z)=>Z===$);if(J!==-1)this.nodesRef.current.splice(J,1)}}var VK=O(c(),1),tM=e9.createContext(null),eM=e9.createContext(null),t5=()=>e9.useContext(tM)?.id||null,R2=($)=>{let J=e9.useContext(eM);return $??J};function D$($){let J=U2(),Z=R2($),H=t5();return F0(()=>{if(!J)return;let B={id:J,parentId:H};return Z?.addNode(B),()=>{Z?.removeNode(B)}},[Z,J,H]),J}function VZ($){let{children:J,id:Z}=$,H=t5();return VK.jsx(tM.Provider,{value:e9.useMemo(()=>({id:Z,parentId:H}),[Z,H]),children:J})}function AZ($){let{children:J,externalTree:Z}=$,H=R1(()=>Z??new A$).current;return VK.jsx(eM.Provider,{value:H,children:J})}var Y0={};_4(Y0,{windowResize:()=>Hl,wheel:()=>od,triggerPress:()=>Cd,triggerHover:()=>wd,triggerFocus:()=>Ed,trackPress:()=>hd,swipe:()=>Zl,siblingOpen:()=>ed,scrub:()=>sd,pointer:()=>ad,outsidePress:()=>Sd,none:()=>Td,listNavigation:()=>id,linkPress:()=>kd,keyboard:()=>rd,itemPress:()=>Id,inputPress:()=>ud,inputPaste:()=>pd,inputClear:()=>fd,inputChange:()=>gd,inputBlur:()=>md,incrementPress:()=>xd,imperativeAction:()=>Jl,focusOut:()=>cd,escapeKey:()=>dd,drag:()=>nd,disabled:()=>$l,decrementPress:()=>vd,closeWatcher:()=>ld,closePress:()=>Rd,clearPress:()=>bd,chipRemovePress:()=>yd,cancelOpen:()=>td});var Td="none",Cd="trigger-press",wd="trigger-hover",Ed="trigger-focus",Sd="outside-press",Id="item-press",Rd="close-press",kd="link-press",bd="clear-press",yd="chip-remove-press",hd="track-press",xd="increment-press",vd="decrement-press",gd="input-change",fd="input-clear",md="input-blur",pd="input-paste",ud="input-press",cd="focus-out",dd="escape-key",ld="close-watcher",id="list-navigation",rd="keyboard",ad="pointer",nd="drag",od="wheel",sd="scrub",td="cancel-open",ed="sibling-open",$l="disabled",Jl="imperative-action",Zl="swipe",Hl="window-resize";function M0($,J,Z,H){let B=!1,Q=!1,X=H??k1;return{reason:$,event:J??new Event("base-ui"),cancel(){B=!0},allowPropagation(){Q=!0},get isCanceled(){return B},get isPropagationAllowed(){return Q},trigger:Z,...X}}function dQ($,J,Z){let H=Z??k1;return{reason:$,event:J??new Event("base-ui"),...H}}function O4($){return`data-base-ui-${$}`}var XY0=O4("safe-polygon"),zY0=`button,[role="button"],select,[tabindex]:not([tabindex="-1"]),${p6}`;function l6($,J,Z){if(Z&&!u4(Z))return 0;if(typeof $==="number")return $;if(typeof $==="function"){let H=$();if(typeof H==="number")return H;return H?.[J]}return $?.[J]}var $P=O(c(),1),JP=Y4.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new i5,currentIdRef:{current:null},currentContextRef:{current:null}});function AK($){let{children:J,delay:Z,timeoutMs:H=0}=$,B=Y4.useRef(Z),Q=Y4.useRef(Z),X=Y4.useRef(null),z=Y4.useRef(null),G=M5();return $P.jsx(JP.Provider,{value:Y4.useMemo(()=>({hasProvider:!0,delayRef:B,initialDelayRef:Q,currentIdRef:X,timeoutMs:H,currentContextRef:z,timeout:G}),[H,G]),children:J})}function DK($,J={open:!1}){let Z="rootStore"in $?$.rootStore:$,H=Z.useState("floatingId"),{open:B}=J,Q=Y4.useContext(JP),{currentIdRef:X,delayRef:z,timeoutMs:G,initialDelayRef:Y,currentContextRef:U,hasProvider:F,timeout:K}=Q,[W,q]=Y4.useState(!1);return F0(()=>{function N(){q(!1),U.current?.setIsInstantPhase(!1),X.current=null,U.current=null,z.current=Y.current}if(!X.current)return;if(!B&&X.current===H){if(q(!1),G){let V=H;return K.start(G,()=>{if(Z.select("open")||X.current&&X.current!==V)return;N()}),()=>{K.clear()}}N()}return},[B,H,X,z,G,Y,U,K,Z]),F0(()=>{if(!B)return;let N=U.current,V=X.current;if(K.clear(),U.current={onOpenChange:Z.setOpen,setIsInstantPhase:q},X.current=H,z.current={open:0,close:l6(Y.current,"close")},V!==null&&V!==H)q(!0),N?.setIsInstantPhase(!0),N?.onOpenChange(!1,M0(Y0.none));else q(!1),N?.setIsInstantPhase(!1)},[B,H,Z,X,z,G,Y,U,K]),F0(()=>{return()=>{U.current=null}},[U]),Y4.useMemo(()=>({hasProvider:F,delayRef:z,isInstantPhase:W}),[F,z,W])}var e5=O(g(),1);var ZP=0;function M$($,J={}){let{preventScroll:Z=!1,cancelPrevious:H=!0,sync:B=!1}=J;if(H)cancelAnimationFrame(ZP);let Q=()=>$?.focus({preventScroll:Z});if(B)Q();else ZP=requestAnimationFrame(Q)}var i6={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function HP($){if($==="inert")return i6.inert;if($==="aria-hidden")return i6["aria-hidden"];return i6.none}var iQ=new WeakSet,rQ={},MK=0;var BP=($)=>$&&($.host||BP($.parentNode)),Bl=($,J)=>J.map((Z)=>{if($.contains(Z))return Z;let H=BP(Z);if($.contains(H))return H;return null}).filter((Z)=>Z!=null);function Ql($,J,Z,H){let Q=H?"inert":Z?"aria-hidden":null,X=Bl(J,$),z=new Set,G=new Set(X),Y=[];if(!rQ["data-base-ui-inert"])rQ["data-base-ui-inert"]=new WeakMap;let U=rQ["data-base-ui-inert"];X.forEach(F),K(J),z.clear();function F(W){if(!W||z.has(W))return;if(z.add(W),W.parentNode)F(W.parentNode)}function K(W){if(!W||G.has(W))return;[].forEach.call(W.children,(q)=>{if(aQ(q)==="script")return;if(z.has(q))K(q);else{let N=Q?q.getAttribute(Q):null,V=N!==null&&N!=="false",L=HP(Q),A=(L.get(q)||0)+1,M=(U.get(q)||0)+1;if(L.set(q,A),U.set(q,M),Y.push(q),A===1&&V)iQ.add(q);if(M===1)q.setAttribute("data-base-ui-inert","");if(!V&&Q)q.setAttribute(Q,Q==="inert"?"":"true")}})}return MK+=1,()=>{if(Y.forEach((W)=>{let q=HP(Q),V=(q.get(W)||0)-1,L=(U.get(W)||0)-1;if(q.set(W,V),U.set(W,L),!V){if(!iQ.has(W)&&Q)W.removeAttribute(Q);iQ.delete(W)}if(!L)W.removeAttribute("data-base-ui-inert")}),MK-=1,!MK)i6.inert=new WeakMap,i6["aria-hidden"]=new WeakMap,i6.none=new WeakMap,iQ=new WeakSet,rQ={}}}function QP($,J=!1,Z=!1){let H=m0($[0]).body;return Ql($.concat(Array.from(H.querySelectorAll("[aria-live]"))),H,J,Z)}var C5=O(g(),1),PK=O(G4(),1);var P$=O(c(),1),GP=C5.createContext(null),_K=()=>C5.useContext(GP),Xl=O4("portal");function nQ($={}){let{ref:J,container:Z,componentProps:H=k1,elementProps:B}=$,Q=U2(),z=_K()?.portalNode,[G,Y]=C5.useState(null),[U,F]=C5.useState(null),K=K0((V)=>{if(V!==null)F(V)}),W=C5.useRef(null);F0(()=>{if(Z===null){if(W.current)W.current=null,F(null),Y(null);return}if(Q==null)return;let V=(Z&&(XP(Z)?Z:Z.current))??z??document.body;if(V==null){if(W.current)W.current=null,F(null),Y(null);return}if(W.current!==V)W.current=V,F(null),Y(V)},[Z,z,Q]);let q=U0("div",H,{ref:[J,K],props:[{id:Q,[Xl]:""},B]});return{portalNode:U,portalSubtree:G&&q?PK.createPortal(q,G):null}}var _$=C5.forwardRef(function(J,Z){let{children:H,container:B,className:Q,render:X,renderGuards:z,...G}=J,{portalNode:Y,portalSubtree:U}=nQ({container:B,ref:Z,componentProps:J,elementProps:G}),F=C5.useRef(null),K=C5.useRef(null),W=C5.useRef(null),q=C5.useRef(null),[N,V]=C5.useState(null),L=N?.modal,A=N?.open,M=typeof z==="boolean"?z:!!N&&!N.modal&&N.open&&!!Y;C5.useEffect(()=>{if(!Y||L)return;function P(D){if(Y&&D.relatedTarget&&Y8(D))(D.type==="focusin"?qK:CM)(Y)}return Y.addEventListener("focusin",P,!0),Y.addEventListener("focusout",P,!0),()=>{Y.removeEventListener("focusin",P,!0),Y.removeEventListener("focusout",P,!0)}},[Y,L]),C5.useEffect(()=>{if(!Y||A)return;qK(Y)},[A,Y]);let _=C5.useMemo(()=>({beforeOutsideRef:F,afterOutsideRef:K,beforeInsideRef:W,afterInsideRef:q,portalNode:Y,setFocusManagerState:V}),[Y]);return P$.jsxs(C5.Fragment,{children:[U,P$.jsxs(GP.Provider,{value:_,children:[M&&Y&&P$.jsx(S2,{"data-type":"outside",ref:F,onFocus:(P)=>{if(Y8(P,Y))W.current?.focus();else{let D=N?N.domReference:null;yQ(D)?.focus()}}}),M&&Y&&P$.jsx("span",{"aria-owns":Y.id,style:zP}),Y&&PK.createPortal(H,Y),M&&Y&&P$.jsx(S2,{"data-type":"outside",ref:K,onFocus:(P)=>{if(Y8(P,Y))q.current?.focus();else{let D=N?N.domReference:null;if(s9(D)?.focus(),N?.closeOnFocusOut)N?.onOpenChange(!1,M0(Y0.focusOut,P.nativeEvent))}}})]})]})});var DZ=O(c(),1);function zl($,J){let Z=E2($.target);if($ instanceof Z.KeyboardEvent)return"keyboard";if($ instanceof Z.FocusEvent)return J||"keyboard";if("pointerType"in $)return $.pointerType||"keyboard";if("touches"in $)return"touch";if($ instanceof Z.MouseEvent)return J||($.detail===0?"keyboard":"mouse");return""}var YP=20,$3=[];function jK(){$3=$3.filter(($)=>{return $.deref()?.isConnected})}function Gl($){if(jK(),$&&aQ($)!=="body"){if($3.push(new WeakRef($)),$3.length>YP)$3=$3.slice(-YP)}}function OK(){return jK(),$3[$3.length-1]?.deref()}function Yl($){if(!$)return null;let J=V$();if(WK($,J))return $;return L$($,J)[0]||$}function Ul($){if(!$||!$.isConnected)return!1;if(typeof $.checkVisibility==="function")return $.checkVisibility();return r6($).display!=="none"}function UP($,J){if(!J.current.includes("floating")&&!$.getAttribute("role")?.includes("dialog"))return;let Z=V$(),B=OM($,Z).filter((X)=>{let z=X.getAttribute("data-tabindex")||"";return WK(X,Z)||X.hasAttribute("data-tabindex")&&!z.startsWith("-")}),Q=$.getAttribute("tabindex");if(J.current.includes("floating")||B.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 O$($){let{context:J,children:Z,disabled:H=!1,initialFocus:B=!0,returnFocus:Q=!0,restoreFocus:X=!1,modal:z=!0,closeOnFocusOut:G=!0,openInteractionType:Y="",nextFocusableElement:U,previousFocusableElement:F,beforeContentFocusGuardRef:K,externalTree:W}=$,q="rootStore"in J?J.rootStore:J,N=q.useState("open"),V=q.useState("domReferenceElement"),L=q.useState("floatingElement"),{events:A,dataRef:M}=q.context,_=K0(()=>M.current.floatingContext?.nodeId),P=B===!1,D=NZ(V)&&P,w=e5.useRef(["content"]),R=T5(B),b=T5(Q),E=T5(Y),x=R2(W),I=_K(),S=e5.useRef(null),j=e5.useRef(null),C=e5.useRef(!1),k=e5.useRef(!1),y=e5.useRef(!1),v=e5.useRef(-1),u=e5.useRef(""),T=e5.useRef(""),t=e5.useRef(null),B0=e5.useRef(null),h=j4(t,K,I?.beforeInsideRef),e=j4(B0,I?.afterInsideRef),A0=M5(),l=M5(),z0=z4(),W0=I!=null,Q0=N$(L),G0=K0(($0=Q0)=>{return $0?L$($0,V$()):[]}),L0=K0(($0)=>{let J0=G0($0);return w.current.map(()=>J0).filter(Boolean).flat()});e5.useEffect(()=>{if(H||!z)return;function $0(H0){if(H0.key==="Tab"){if(f0(Q0,J5(m0(Q0)))&&G0().length===0&&!D)r5(H0)}}let J0=m0(Q0);return J0.addEventListener("keydown",$0),()=>{J0.removeEventListener("keydown",$0)}},[H,V,Q0,z,w,D,G0,L0]),e5.useEffect(()=>{if(H||!N)return;let $0=m0(Q0);function J0(){y.current=!1}function H0(p){let d=y1(p),m=f0(L,d)||f0(V,d)||f0(I?.portalNode,d);if(y.current=!m,T.current=p.pointerType||"keyboard",d?.closest(`[${a6}]`))k.current=!0}function n(){T.current="keyboard"}return $0.addEventListener("pointerdown",H0,!0),$0.addEventListener("pointerup",J0,!0),$0.addEventListener("pointercancel",J0,!0),$0.addEventListener("keydown",n,!0),()=>{$0.removeEventListener("pointerdown",H0,!0),$0.removeEventListener("pointerup",J0,!0),$0.removeEventListener("pointercancel",J0,!0),$0.removeEventListener("keydown",n,!0)}},[H,L,V,Q0,N,I]),e5.useEffect(()=>{if(H||!G)return;let $0=m0(Q0);function J0(){k.current=!0,l.start(0,()=>{k.current=!1})}function H0(a){let o=y1(a),O0=G0().indexOf(o);if(O0!==-1)v.current=O0}function n(a){let{relatedTarget:o,currentTarget:N0}=a,O0=y1(a);queueMicrotask(()=>{let g0=_(),p0=q.context.triggerElements,f=o?.hasAttribute(O4("focus-guard"))&&[t.current,B0.current,I?.beforeInsideRef.current,I?.afterInsideRef.current,I?.beforeOutsideRef.current,I?.afterOutsideRef.current,K8(F),K8(U)].includes(o),r=!(f0(V,o)||f0(L,o)||f0(o,L)||f0(I?.portalNode,o)||o!=null&&p0.hasElement(o)||p0.hasMatchingElement((X0)=>f0(X0,o))||f||x&&(x8(x.nodesRef.current,g0).find((X0)=>f0(X0.context?.elements.floating,o)||f0(X0.context?.elements.domReference,o))||GK(x.nodesRef.current,g0).find((X0)=>[X0.context?.elements.floating,N$(X0.context?.elements.floating)].includes(o)||X0.context?.elements.domReference===o)));if(N0===V&&Q0)UP(Q0,w);if(X&&N0!==V&&!Ul(O0)&&J5($0)===$0.body){if(P5(Q0)){if(Q0.focus(),X==="popup"){z0.request(()=>{Q0.focus()});return}}let X0=v.current,V0=G0(),j0=V0[X0]||V0[V0.length-1]||Q0;if(P5(j0))j0.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}if((D?!0:!z)&&o&&r&&!k.current&&(D||o!==OK()))C.current=!0,q.setOpen(!1,M0(Y0.focusOut,a))})}function p(){if(y.current)return;M.current.insideReactTree=!0,A0.start(0,()=>{M.current.insideReactTree=!1})}let d=P5(V)?V:null,m=[];if(!L&&!d)return;if(d)d.addEventListener("focusout",n),d.addEventListener("pointerdown",J0),m.push(()=>{d.removeEventListener("focusout",n),d.removeEventListener("pointerdown",J0)});if(L){if(L.addEventListener("focusin",H0),L.addEventListener("focusout",n),I)L.addEventListener("focusout",p,!0),m.push(()=>{L.removeEventListener("focusout",p,!0)});m.push(()=>{L.removeEventListener("focusin",H0),L.removeEventListener("focusout",n)})}return()=>{m.forEach((a)=>{a()})}},[H,V,L,Q0,z,x,I,q,G,X,G0,D,_,w,M,A0,l,z0,U,F]),e5.useEffect(()=>{if(H||!L||!N)return;let $0=Array.from(I?.portalNode?.querySelectorAll(`[${O4("portal")}]`)||[]),H0=(x?GK(x.nodesRef.current,_()):[]).find((p)=>NZ(p.context?.elements.domReference||null))?.context?.elements.domReference,n=[L,H0,...$0,S.current,j.current,t.current,B0.current,I?.beforeOutsideRef.current,I?.afterOutsideRef.current,K8(F),K8(U),D?V:null].filter((p)=>p!=null);return QP(n,z||D)},[N,H,V,L,z,w,I,D,x,_,U,F]),F0(()=>{if(!N||H||!P5(Q0))return;let $0=m0(Q0),J0=J5($0);queueMicrotask(()=>{let H0=L0(Q0),n=R.current,p=typeof n==="function"?n(E.current||""):n;if(p===void 0||p===!1)return;let d;if(p===!0||p===null)d=H0[0]||Q0;else d=K8(p);if(d=d||H0[0]||Q0,f0(Q0,J0))return;M$(d,{preventScroll:d===Q0})})},[H,N,Q0,P,L0,R,E]),F0(()=>{if(H||!Q0)return;let $0=m0(Q0),J0=J5($0);Gl(J0);function H0(d){if(!d.open)u.current=zl(d.nativeEvent,T.current);if(d.reason===Y0.triggerHover&&d.nativeEvent.type==="mouseleave")C.current=!0;if(d.reason!==Y0.outsidePress)return;if(d.nested)C.current=!1;else if(TQ(d.nativeEvent)||CQ(d.nativeEvent))C.current=!1;else{let m=!1;if(document.createElement("div").focus({get preventScroll(){return m=!0,!1}}),m)C.current=!1;else C.current=!0}}A.on("openchange",H0);let n=$0.createElement("span");if(n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),Object.assign(n.style,U8),W0&&V)V.insertAdjacentElement("afterend",n);function p(){let d=b.current,m=typeof d==="function"?d(u.current):d;if(m===void 0||m===!1)return null;if(m===null)m=!0;if(typeof m==="boolean"){let o=V||OK();return o&&o.isConnected?o:n}let a=V||OK()||n;return K8(m)||a}return()=>{A.off("openchange",H0);let d=J5($0),m=f0(L,d)||x&&x8(x.nodesRef.current,_(),!1).some((o)=>f0(o.context?.elements.floating,d)),a=p();queueMicrotask(()=>{let o=Yl(a),N0=typeof b.current!=="boolean";if(b.current&&!C.current&&P5(o)&&(!N0&&o!==d&&d!==$0.body?m:!0))o.focus({preventScroll:!0});n.remove(),C.current=!1})}},[H,L,Q0,b,M,A,x,W0,V,_]),F0(()=>{if(!MQ||N||!L)return;let $0=J5(m0(L));if(!P5($0)||!q$($0))return;if(f0(L,$0))$0.blur()},[N,L]),F0(()=>{if(H||!I)return;return I.setFocusManagerState({modal:z,closeOnFocusOut:G,open:N,onOpenChange:q.setOpen,domReference:V}),()=>{I.setFocusManagerState(null)}},[H,I,z,N,q,G,V]),F0(()=>{if(H||!Q0)return;return UP(Q0,w),()=>{queueMicrotask(jK)}},[H,Q0,w]);let i=!H&&(z?!D:!0)&&(W0||z);return DZ.jsxs(e5.Fragment,{children:[i&&DZ.jsx(S2,{"data-type":"inside",ref:h,onFocus:($0)=>{if(z){let J0=L0();M$(J0[J0.length-1])}else if(I?.portalNode)if(C.current=!1,Y8($0,I.portalNode))s9(V)?.focus();else K8(F??I.beforeOutsideRef)?.focus()}}),Z,i&&DZ.jsx(S2,{"data-type":"inside",ref:e,onFocus:($0)=>{if(z)M$(L0()[0]);else if(I?.portalNode){if(G)C.current=!0;if(Y8($0,I.portalNode))yQ(V)?.focus();else K8(U??I.afterOutsideRef)?.focus()}}})]})}var MZ=O(g(),1);function w9($,J={}){let Z="rootStore"in $?$.rootStore:$,H=Z.context.dataRef,{enabled:B=!0,event:Q="click",toggle:X=!0,ignoreMouse:z=!1,stickIfOpen:G=!0,touchOpenDelay:Y=0,reason:U=Y0.triggerPress}=J,F=MZ.useRef(void 0),K=z4(),W=M5(),q=MZ.useMemo(()=>({onPointerDown(N){F.current=N.pointerType},onMouseDown(N){let V=F.current,L=N.nativeEvent,A=Z.select("open");if(N.button!==0||Q==="click"||u4(V,!0)&&z)return;let M=H.current.openEvent,_=M?.type,P=Z.select("domReferenceElement")!==N.currentTarget,D=A&&P||!(A&&X&&(M&&G?_==="click"||_==="mousedown":!0));if(q$(L.target)){let R=M0(U,L,L.target);if(D&&V==="touch"&&Y>0)W.start(Y,()=>{Z.setOpen(!0,R)});else Z.setOpen(D,R);return}let w=N.currentTarget;K.request(()=>{let R=M0(U,L,w);if(D&&V==="touch"&&Y>0)W.start(Y,()=>{Z.setOpen(!0,R)});else Z.setOpen(D,R)})},onClick(N){if(Q==="mousedown-only")return;let V=F.current;if(Q==="mousedown"&&V){F.current=void 0;return}if(u4(V,!0)&&z)return;let L=Z.select("open"),A=H.current.openEvent,M=Z.select("domReferenceElement")!==N.currentTarget,_=L&&M||!(L&&X&&(A&&G?wQ(A):!0)),P=M0(U,N.nativeEvent,N.currentTarget);if(_&&V==="touch"&&Y>0)W.start(Y,()=>{Z.setOpen(!0,P)});else Z.setOpen(_,P)},onKeyDown(){F.current=void 0}}),[H,Q,z,Z,G,X,K,W,Y,U]);return MZ.useMemo(()=>B?{reference:q}:k1,[B,q])}var r2=O(g(),1);function Fl($,J){let Z=null,H=null,B=!1;return{contextElement:$||void 0,getBoundingClientRect(){let Q=$?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},X=J.axis==="x"||J.axis==="both",z=J.axis==="y"||J.axis==="both",G=["mouseenter","mousemove"].includes(J.dataRef.current.openEvent?.type||"")&&J.pointerType!=="touch",Y=Q.width,U=Q.height,F=Q.x,K=Q.y;if(Z==null&&J.x&&X)Z=Q.x-J.x;if(H==null&&J.y&&z)H=Q.y-J.y;if(F-=Z||0,K-=H||0,Y=0,U=0,!B||G)Y=J.axis==="y"?Q.width:0,U=J.axis==="x"?Q.height:0,F=X&&J.x!=null?J.x:F,K=z&&J.y!=null?J.y:K;else if(B&&!G)U=J.axis==="x"?Q.height:U,Y=J.axis==="y"?Q.width:Y;return B=!0,{width:Y,height:U,x:F,y:K,top:K,right:F+Y,bottom:K+U,left:F}}}}function FP($){return $!=null&&$.clientX!=null}function TK($,J={}){let Z="rootStore"in $?$.rootStore:$,H=Z.useState("open"),B=Z.useState("floatingElement"),Q=Z.useState("domReferenceElement"),X=Z.context.dataRef,{enabled:z=!0,axis:G="both"}=J,Y=r2.useRef(!1),U=r2.useRef(null),[F,K]=r2.useState(),[W,q]=r2.useState([]),N=K0((_,P,D)=>{if(Y.current)return;if(X.current.openEvent&&!FP(X.current.openEvent))return;Z.set("positionReference",Fl(D??Q,{x:_,y:P,axis:G,dataRef:X,pointerType:F}))}),V=K0((_)=>{if(!H)N(_.clientX,_.clientY,_.currentTarget);else if(!U.current)q([])}),L=u4(F)?B:H,A=r2.useCallback(()=>{if(!L||!z)return;let _=E2(B);function P(D){let w=y1(D);if(!f0(B,w))N(D.clientX,D.clientY);else _.removeEventListener("mousemove",P),U.current=null}if(!X.current.openEvent||FP(X.current.openEvent)){_.addEventListener("mousemove",P);let D=()=>{_.removeEventListener("mousemove",P),U.current=null};return U.current=D,D}Z.set("positionReference",Q);return},[L,z,B,X,Q,Z,N]);r2.useEffect(()=>{return A()},[A,W]),r2.useEffect(()=>{if(z&&!B)Y.current=!1},[z,B]),r2.useEffect(()=>{if(!z&&H)Y.current=!0},[z,H]);let M=r2.useMemo(()=>{function _(P){K(P.pointerType)}return{onPointerDown:_,onPointerEnter:_,onMouseMove:V,onMouseEnter:V}},[V]);return r2.useMemo(()=>z?{reference:M,trigger:M}:{},[z,M])}var c4=O(g(),1);var Kl={intentional:"onClick",sloppy:"onPointerDown"};function Wl($){return{escapeKey:typeof $==="boolean"?$:$?.escapeKey??!1,outsidePress:typeof $==="boolean"?$:$?.outsidePress??!0}}function W8($,J={}){let Z="rootStore"in $?$.rootStore:$,H=Z.useState("open"),B=Z.useState("floatingElement"),Q=Z.useState("referenceElement"),X=Z.useState("domReferenceElement"),{onOpenChange:z,dataRef:G}=Z.context,{enabled:Y=!0,escapeKey:U=!0,outsidePress:F=!0,outsidePressEvent:K="sloppy",referencePress:W=!1,referencePressEvent:q="sloppy",ancestorScroll:N=!1,bubbles:V,externalTree:L}=J,A=R2(L),M=K0(typeof F==="function"?F:()=>!1),_=typeof F==="function"?M:F,P=c4.useRef(!1),{escapeKey:D,outsidePress:w}=Wl(V),R=c4.useRef(null),b=M5(),E=M5(),x=K0(()=>{E.clear(),G.current.insideReactTree=!1}),I=c4.useRef(!1),S=c4.useRef(""),j=K0((i)=>{S.current=i.pointerType}),C=K0(()=>{let i=S.current,$0=i==="pen"||!i?"mouse":i,J0=typeof K==="function"?K():K;if(typeof J0==="string")return J0;return J0[$0]}),k=K0((i)=>{if(!H||!Y||!U||i.key!=="Escape")return;if(I.current)return;let $0=G.current.floatingContext?.nodeId,J0=A?x8(A.nodesRef.current,$0):[];if(!D){if(J0.length>0){let p=!0;if(J0.forEach((d)=>{if(d.context?.open&&!d.context.dataRef.current.__escapeKeyBubbles)p=!1}),!p)return}}let H0=FM(i)?i.nativeEvent:i,n=M0(Y0.escapeKey,H0);if(Z.setOpen(!1,n),!D&&!n.isPropagationAllowed)i.stopPropagation()}),y=K0((i)=>{let $0=C();return $0==="intentional"&&i.type!=="click"||$0==="sloppy"&&i.type==="click"}),v=K0(()=>{G.current.insideReactTree=!0,E.start(0,x)}),u=K0((i,$0=!1)=>{if(y(i)){x();return}if(G.current.insideReactTree){x();return}if(C()==="intentional"&&$0)return;if(typeof _==="function"&&!_(i))return;let J0=y1(i),H0=`[${O4("inert")}]`,n=m0(Z.select("floatingElement")).querySelectorAll(H0),p=Z.context.triggerElements;if(J0&&(p.hasElement(J0)||p.hasMatchingElement((N0)=>f0(N0,J0))))return;let d=j1(J0)?J0:null;while(d&&!n6(d)){let N0=oQ(d);if(n6(N0)||!j1(N0))break;d=N0}if(n.length&&j1(J0)&&!UM(J0)&&!f0(J0,Z.select("floatingElement"))&&Array.from(n).every((N0)=>!f0(d,N0)))return;if(P5(J0)&&!("touches"in i)){let N0=n6(J0),O0=r6(J0),g0=/auto|scroll/,p0=N0||g0.test(O0.overflowX),f=N0||g0.test(O0.overflowY),r=p0&&J0.clientWidth>0&&J0.scrollWidth>J0.clientWidth,X0=f&&J0.clientHeight>0&&J0.scrollHeight>J0.clientHeight,V0=O0.direction==="rtl",j0=X0&&(V0?i.offsetX<=J0.offsetWidth-J0.clientWidth:i.offsetX>J0.clientWidth),v0=r&&i.offsetY>J0.clientHeight;if(j0||v0)return}let m=G.current.floatingContext?.nodeId,a=A&&x8(A.nodesRef.current,m).some((N0)=>p4(i,N0.context?.elements.floating));if(p4(i,Z.select("floatingElement"))||p4(i,Z.select("domReferenceElement"))||a)return;let o=A?x8(A.nodesRef.current,m):[];if(o.length>0){let N0=!0;if(o.forEach((O0)=>{if(O0.context?.open&&!O0.context.dataRef.current.__outsidePressBubbles)N0=!1}),!N0)return}Z.setOpen(!1,M0(Y0.outsidePress,i)),x()}),T=K0((i)=>{if(C()!=="sloppy"||i.pointerType==="touch"||!Z.select("open")||!Y||p4(i,Z.select("floatingElement"))||p4(i,Z.select("domReferenceElement")))return;u(i)}),t=K0((i)=>{if(C()!=="sloppy"||!Z.select("open")||!Y||p4(i,Z.select("floatingElement"))||p4(i,Z.select("domReferenceElement")))return;let $0=i.touches[0];if($0)R.current={startTime:Date.now(),startX:$0.clientX,startY:$0.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},b.start(1000,()=>{if(R.current)R.current.dismissOnTouchEnd=!1,R.current.dismissOnMouseDown=!1})}),B0=K0((i)=>{let $0=y1(i);function J0(){t(i),$0?.removeEventListener(i.type,J0)}$0?.addEventListener(i.type,J0)}),h=K0((i)=>{let $0=P.current;if(P.current=!1,b.clear(),i.type==="mousedown"&&R.current&&!R.current.dismissOnMouseDown)return;let J0=y1(i);function H0(){if(i.type==="pointerdown")T(i);else u(i,$0);J0?.removeEventListener(i.type,H0)}J0?.addEventListener(i.type,H0)}),e=K0((i)=>{if(C()!=="sloppy"||!R.current||p4(i,Z.select("floatingElement"))||p4(i,Z.select("domReferenceElement")))return;let $0=i.touches[0];if(!$0)return;let J0=Math.abs($0.clientX-R.current.startX),H0=Math.abs($0.clientY-R.current.startY),n=Math.sqrt(J0*J0+H0*H0);if(n>5)R.current.dismissOnTouchEnd=!0;if(n>10)u(i),b.clear(),R.current=null}),A0=K0((i)=>{let $0=y1(i);function J0(){e(i),$0?.removeEventListener(i.type,J0)}$0?.addEventListener(i.type,J0)}),l=K0((i)=>{if(C()!=="sloppy"||!R.current||p4(i,Z.select("floatingElement"))||p4(i,Z.select("domReferenceElement")))return;if(R.current.dismissOnTouchEnd)u(i);b.clear(),R.current=null}),z0=K0((i)=>{let $0=y1(i);function J0(){l(i),$0?.removeEventListener(i.type,J0)}$0?.addEventListener(i.type,J0)});c4.useEffect(()=>{if(!H||!Y)return;G.current.__escapeKeyBubbles=D,G.current.__outsidePressBubbles=w;let i=new i5;function $0(d){Z.setOpen(!1,M0(Y0.none,d))}function J0(){i.clear(),I.current=!0}function H0(){i.start(KP()?5:0,()=>{I.current=!1})}let n=m0(B);if(n.addEventListener("pointerdown",j,!0),U)n.addEventListener("keydown",k),n.addEventListener("compositionstart",J0),n.addEventListener("compositionend",H0);if(_)n.addEventListener("click",h,!0),n.addEventListener("pointerdown",h,!0),n.addEventListener("touchstart",B0,!0),n.addEventListener("touchmove",A0,!0),n.addEventListener("touchend",z0,!0),n.addEventListener("mousedown",h,!0);let p=[];if(N){if(j1(X))p=PZ(X);if(j1(B))p=p.concat(PZ(B));if(!j1(Q)&&Q&&Q.contextElement)p=p.concat(PZ(Q.contextElement))}return p=p.filter((d)=>d!==n.defaultView?.visualViewport),p.forEach((d)=>{d.addEventListener("scroll",$0,{passive:!0})}),()=>{if(n.removeEventListener("pointerdown",j,!0),U)n.removeEventListener("keydown",k),n.removeEventListener("compositionstart",J0),n.removeEventListener("compositionend",H0);if(_)n.removeEventListener("click",h,!0),n.removeEventListener("pointerdown",h,!0),n.removeEventListener("touchstart",B0,!0),n.removeEventListener("touchmove",A0,!0),n.removeEventListener("touchend",z0,!0),n.removeEventListener("mousedown",h,!0);p.forEach((d)=>{d.removeEventListener("scroll",$0)}),i.clear(),P.current=!1}},[G,B,Q,X,U,_,H,z,N,Y,D,w,k,u,h,T,B0,A0,z0,j,Z]),c4.useEffect(x,[_,x]);let W0=c4.useMemo(()=>({onKeyDown:k,...W&&{[Kl[q]]:(i)=>{Z.setOpen(!1,M0(Y0.triggerPress,i.nativeEvent))},...q!=="intentional"&&{onClick(i){Z.setOpen(!1,M0(Y0.triggerPress,i.nativeEvent))}}}}),[k,Z,W,q]),Q0=K0((i)=>{let $0=y1(i.nativeEvent);if(!f0(Z.select("floatingElement"),$0)||i.button!==0)return;P.current=!0}),G0=K0((i)=>{if(!H||!Y||i.button!==0)return;P.current=!0}),L0=c4.useMemo(()=>({onKeyDown:k,onPointerDown:Q0,onMouseDown:Q0,onMouseUp:Q0,onClickCapture:v,onMouseDownCapture(i){v(),G0(i)},onPointerDownCapture(i){v(),G0(i)},onMouseUpCapture:v,onTouchEndCapture:v,onTouchMoveCapture:v}),[k,Q0,v,G0]);return c4.useMemo(()=>Y?{reference:W0,floating:L0,trigger:W0}:{},[Y,W0,L0])}var n2=O(g(),1);var ql={open:S0(($)=>$.open),domReferenceElement:S0(($)=>$.domReferenceElement),referenceElement:S0(($)=>$.positionReference??$.referenceElement),floatingElement:S0(($)=>$.floatingElement),floatingId:S0(($)=>$.floatingId)};class j$ extends i2{constructor($){let{nested:J,noEmit:Z,onOpenChange:H,triggerElements:B,...Q}=$;super({...Q,positionReference:Q.referenceElement,domReferenceElement:Q.referenceElement},{onOpenChange:H,dataRef:{current:{}},events:cQ(),nested:J,noEmit:Z,triggerElements:B},ql)}setOpen=($,J)=>{if(!$||!this.state.open||wQ(J.event))this.context.dataRef.current.openEvent=$?J.event:void 0;if(!this.context.noEmit){let Z={open:$,reason:J.reason,nativeEvent:J.event,nested:this.context.nested,triggerElement:J.trigger};this.context.events.emit("openchange",Z)}this.context.onOpenChange?.($,J)}}var OZ=O(g(),1);var _Z=O(g(),1);function d4($,J=!1,Z=!1){let[H,B]=_Z.useState($&&J?"idle":void 0),[Q,X]=_Z.useState($);if($&&!Q)X(!0),B("starting");if(!$&&Q&&H!=="ending"&&!Z)B("ending");if(!$&&!Q&&H==="ending")B(void 0);return F0(()=>{if(!$&&Q&&H!=="ending"&&Z){let z=W5.request(()=>{B("ending")});return()=>{W5.cancel(z)}}return},[$,Q,H,Z]),F0(()=>{if(!$||J)return;let z=W5.request(()=>{B(void 0)});return()=>{W5.cancel(z)}},[J,$]),F0(()=>{if(!$||!J)return;if($&&Q&&H!=="idle")B("starting");let z=W5.request(()=>{B("idle")});return()=>{W5.cancel(z)}},[J,$,Q,B,H]),_Z.useMemo(()=>({mounted:Q,setMounted:X,transitionStatus:H}),[Q,H])}function CK($,J){let Z=OZ.useRef(null),H=OZ.useRef(null);return OZ.useCallback((B)=>{if($===void 0)return;if(Z.current!==null){let Q=Z.current,X=H.current,z=J.context.triggerElements.getById(Q);if(X&&z===X)J.context.triggerElements.delete(Q);Z.current=null,H.current=null}if(B!==null)Z.current=$,H.current=B,J.context.triggerElements.add($,B)},[J,$])}function u8($,J,Z,H){let B=Z.useState("isMountedByTrigger",$),Q=CK($,Z),X=K0((z)=>{if(Q(z),!z||!Z.select("open"))return;let G=Z.select("activeTriggerId");if(G===$){Z.update({activeTriggerElement:z,...H});return}if(G==null)Z.update({activeTriggerId:$,activeTriggerElement:z,...H})});return F0(()=>{if(B)Z.update({activeTriggerElement:J.current,...H})},[B,Z,J,...Object.values(H)]),{registerTrigger:X,isMountedByThisTrigger:B}}function c8($){let J=$.useState("open");F0(()=>{if(J&&!$.select("activeTriggerId")&&$.context.triggerElements.size===1){let Z=$.context.triggerElements.entries().next();if(!Z.done){let[H,B]=Z.value;$.update({activeTriggerId:H,activeTriggerElement:B})}}},[J,$])}function d8($,J,Z){let{mounted:H,setMounted:B,transitionStatus:Q}=d4($);J.useSyncedValues({mounted:H,transitionStatus:Q});let X=K0(()=>{B(!1),J.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),Z?.(),J.context.onOpenChangeComplete?.(!1)}),z=J.useState("preventUnmountingOnClose");return b5({enabled:!z,open:$,ref:J.context.popupRef,onComplete(){if(!$)X()}}),{forceUnmount:X,transitionStatus:Q}}class a2{constructor(){this.elementsSet=new Set,this.idMap=new Map}add($,J){let Z=this.idMap.get($);if(Z===J)return;if(Z!==void 0)this.elementsSet.delete(Z);this.elementsSet.add(J),this.idMap.set($,J)}delete($){let J=this.idMap.get($);if(J)this.elementsSet.delete(J),this.idMap.delete($)}hasElement($){return this.elementsSet.has($)}hasMatchingElement($){for(let J of this.elementsSet)if($(J))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 WP(){return new j$({open:!1,floatingElement:null,referenceElement:null,triggerElements:new a2,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function l8(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:WP(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:k1,inactiveTriggerProps:k1,popupProps:k1}}var sQ=S0(($)=>$.triggerIdProp??$.activeTriggerId),i8={open:S0(($)=>$.openProp??$.open),mounted:S0(($)=>$.mounted),transitionStatus:S0(($)=>$.transitionStatus),floatingRootContext:S0(($)=>$.floatingRootContext),preventUnmountingOnClose:S0(($)=>$.preventUnmountingOnClose),payload:S0(($)=>$.payload),activeTriggerId:sQ,activeTriggerElement:S0(($)=>$.mounted?$.activeTriggerElement:null),isTriggerActive:S0(($,J)=>J!==void 0&&sQ($)===J),isOpenedByTrigger:S0(($,J)=>J!==void 0&&sQ($)===J&&$.open),isMountedByTrigger:S0(($,J)=>J!==void 0&&sQ($)===J&&$.mounted),triggerProps:S0(($,J)=>J?$.activeTriggerProps:$.inactiveTriggerProps),popupProps:S0(($)=>$.popupProps),popupElement:S0(($)=>$.popupElement),positionerElement:S0(($)=>$.positionerElement)};function jZ($){let{open:J=!1,onOpenChange:Z,elements:H={}}=$,B=U2(),Q=t5()!=null,X=R1(()=>new j$({open:J,onOpenChange:Z,referenceElement:H.reference??null,floatingElement:H.floating??null,triggerElements:new a2,floatingId:B,nested:Q,noEmit:!1})).current;return F0(()=>{let z={open:J,floatingId:B};if(H.reference!==void 0)z.referenceElement=H.reference,z.domReferenceElement=j1(H.reference)?H.reference:null;if(H.floating!==void 0)z.floatingElement=H.floating;X.update(z)},[J,B,H.reference,H.floating,X]),X.context.onOpenChange=Z,X.context.nested=Q,X.context.noEmit=!1,X}function wK($={}){let{nodeId:J,externalTree:Z}=$,H=jZ($),B=$.rootContext||H,Q={reference:B.useState("referenceElement"),floating:B.useState("floatingElement"),domReference:B.useState("domReferenceElement")},[X,z]=n2.useState(null),G=n2.useRef(null),Y=R2(Z);F0(()=>{if(Q.domReference)G.current=Q.domReference},[Q.domReference]);let U=qP({...$,elements:{...Q,...X&&{reference:X}}}),F=n2.useCallback((w)=>{let R=j1(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;z(R),U.refs.setReference(R)},[U.refs]),[K,W]=n2.useState(null),[q,N]=n2.useState(null);B.useSyncedValue("referenceElement",K),B.useSyncedValue("domReferenceElement",j1(K)?K:null),B.useSyncedValue("floatingElement",q);let V=n2.useCallback((w)=>{if(j1(w)||w===null)G.current=w,W(w);if(j1(U.refs.reference.current)||U.refs.reference.current===null||w!==null&&!j1(w))U.refs.setReference(w)},[U.refs,W]),L=n2.useCallback((w)=>{N(w),U.refs.setFloating(w)},[U.refs]),A=n2.useMemo(()=>({...U.refs,setReference:V,setFloating:L,setPositionReference:F,domReference:G}),[U.refs,V,L,F]),M=n2.useMemo(()=>({...U.elements,domReference:Q.domReference}),[U.elements,Q.domReference]),_=B.useState("open"),P=B.useState("floatingId"),D=n2.useMemo(()=>({...U,dataRef:B.context.dataRef,open:_,onOpenChange:B.setOpen,events:B.context.events,floatingId:P,refs:A,elements:M,nodeId:J,rootStore:B}),[U,A,M,J,B,_,P]);return F0(()=>{B.context.dataRef.current.floatingContext=D;let w=Y?.nodesRef.current.find((R)=>R.id===J);if(w)w.context=D}),n2.useMemo(()=>({...U,context:D,refs:A,elements:M,rootStore:B}),[U,A,M,D,B])}function q8($){let{popupStore:J,noEmit:Z=!1,treatPopupAsFloatingElement:H=!1,onOpenChange:B}=$,Q=U2(),X=t5()!=null,z=J.useState("open"),G=J.useState("activeTriggerElement"),Y=J.useState(H?"popupElement":"positionerElement"),U=J.context.triggerElements,F=R1(()=>new j$({open:z,referenceElement:G,floatingElement:Y,triggerElements:U,onOpenChange:B,floatingId:Q,nested:X,noEmit:Z})).current;return F0(()=>{let K={open:z,floatingId:Q,referenceElement:G,floatingElement:Y};if(j1(G))K.domReferenceElement=G;if(F.state.positionReference===F.state.referenceElement)K.positionReference=G;F.update(K)},[z,Q,G,Y,F]),F.context.onOpenChange=B,F.context.nested=X,F.context.noEmit=Z,F}var r8=O(g(),1);var EK=GM&&_Q;function T$($,J={}){let Z="rootStore"in $?$.rootStore:$,{events:H,dataRef:B}=Z.context,{enabled:Q=!0,delay:X}=J,z=r8.useRef(!1),G=r8.useRef(null),Y=M5(),U=r8.useRef(!0);r8.useEffect(()=>{let K=Z.select("domReferenceElement");if(!Q)return;let W=E2(K);function q(){let L=Z.select("domReferenceElement");if(!Z.select("open")&&P5(L)&&L===J5(m0(L)))z.current=!0}function N(){U.current=!0}function V(){U.current=!1}if(W.addEventListener("blur",q),EK)W.addEventListener("keydown",N,!0),W.addEventListener("pointerdown",V,!0);return()=>{if(W.removeEventListener("blur",q),EK)W.removeEventListener("keydown",N,!0),W.removeEventListener("pointerdown",V,!0)}},[Z,Q]),r8.useEffect(()=>{if(!Q)return;function K(W){if(W.reason===Y0.triggerPress||W.reason===Y0.escapeKey){let q=Z.select("domReferenceElement");if(j1(q))G.current=q,z.current=!0}}return H.on("openchange",K),()=>{H.off("openchange",K)}},[H,Q,Z]);let F=r8.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 q=y1(K.nativeEvent);if(j1(q)){if(EK&&!K.relatedTarget){if(!U.current&&!q$(q))return}else if(!o9(q))return}let N=W$(K.relatedTarget,Z.context.triggerElements),{nativeEvent:V,currentTarget:L}=K,A=typeof X==="function"?X():X;if(Z.select("open")&&N||A===0||A===void 0){Z.setOpen(!0,M0(Y0.triggerFocus,V,L));return}Y.start(A,()=>{if(z.current)return;Z.setOpen(!0,M0(Y0.triggerFocus,V,L))})},onBlur(K){z.current=!1,G.current=null;let{relatedTarget:W,nativeEvent:q}=K,N=j1(W)&&W.hasAttribute(O4("focus-guard"))&&W.getAttribute("data-type")==="outside";Y.start(0,()=>{let V=Z.select("domReferenceElement"),L=J5(V?V.ownerDocument:document);if(!W&&L===V)return;if(f0(B.current.floatingContext?.refs.floating.current,L)||f0(V,L)||N)return;if(W$(W??L,Z.context.triggerElements))return;Z.setOpen(!1,M0(Y0.triggerFocus,q))})}}),[B,Z,Y,X]);return r8.useMemo(()=>Q?{reference:F,trigger:F}:{},[Q,F])}var o6=O(g(),1);var TZ=O4("safe-polygon"),Nl=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${p6}`;function NP($){return $?Boolean($.closest(Nl)):!1}class SK{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 i5,this.restTimeout=new i5,this.handleCloseOptions=void 0}static create(){return new SK}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>{return this.dispose}}function tQ($){let J=R1(SK.create).current,Z=$.context.dataRef.current;if(!Z.hoverInteractionState)Z.hoverInteractionState=J;return w2(Z.hoverInteractionState.disposeEffect),Z.hoverInteractionState}var Ll=new Set(["click","mousedown"]);function E9($,J={}){let Z="rootStore"in $?$.rootStore:$,H=Z.useState("open"),B=Z.useState("floatingElement"),Q=Z.useState("domReferenceElement"),{dataRef:X}=Z.context,{enabled:z=!0,closeDelay:G=0}=J,Y=tQ(Z),U=R2(),F=t5(),K=K0(()=>{if(Y.interactedInside)return!0;return X.current.openEvent?Ll.has(X.current.openEvent.type):!1}),W=K0(()=>{let M=X.current.openEvent?.type;return M?.includes("mouse")&&M!=="mousedown"}),q=K0((M)=>{return W$(M,Z.context.triggerElements)}),N=o6.useCallback((M,_=!0)=>{let P=Vl(G,Y.pointerType);if(P&&!Y.handler)Y.openChangeTimeout.start(P,()=>Z.setOpen(!1,M0(Y0.triggerHover,M)));else if(_)Y.openChangeTimeout.clear(),Z.setOpen(!1,M0(Y0.triggerHover,M))},[G,Z,Y]),V=K0(()=>{Y.unbindMouseMove(),Y.handler=void 0}),L=K0(()=>{if(Y.performedPointerEventsMutation){let M=m0(B).body;M.style.pointerEvents="",M.removeAttribute(TZ),Y.performedPointerEventsMutation=!1}}),A=K0((M)=>{let _=y1(M);if(!NP(_)){Y.interactedInside=!1;return}Y.interactedInside=!0});F0(()=>{if(!H)Y.pointerType=void 0,Y.restTimeoutPending=!1,Y.interactedInside=!1,V(),L()},[H,Y,V,L]),o6.useEffect(()=>{return()=>{V()}},[V]),o6.useEffect(()=>{return L},[L]),F0(()=>{if(!z)return;if(H&&Y.handleCloseOptions?.blockPointerEvents&&W()&&j1(Q)&&B){Y.performedPointerEventsMutation=!0;let M=m0(B).body;M.setAttribute(TZ,"");let _=Q,P=B,D=U?.nodesRef.current.find((w)=>w.id===F)?.context?.elements.floating;if(D)D.style.pointerEvents="";return M.style.pointerEvents="none",_.style.pointerEvents="auto",P.style.pointerEvents="auto",()=>{M.style.pointerEvents="",_.style.pointerEvents="",P.style.pointerEvents=""}}return},[z,H,Q,B,Y,W,U,F]),o6.useEffect(()=>{if(!z)return;function M(w){if(K()||!X.current.floatingContext||!Z.select("open"))return;if(q(w.relatedTarget))return;if(L(),V(),!K())N(w)}function _(w){Y.openChangeTimeout.clear(),L(),Y.handler?.(w),V()}function P(w){if(!K())N(w,!1)}let D=B;if(D)D.addEventListener("mouseleave",M),D.addEventListener("mouseenter",_),D.addEventListener("mouseleave",P),D.addEventListener("pointerdown",A,!0);return()=>{if(D)D.removeEventListener("mouseleave",M),D.removeEventListener("mouseenter",_),D.removeEventListener("mouseleave",P),D.removeEventListener("pointerdown",A,!0)}},[z,B,Z,X,K,q,N,L,V,A,Y])}function Vl($,J){if(J&&!u4(J))return 0;if(typeof $==="function")return $();return $}var C$=O(g(),1),LP=O(G4(),1);function IK($){if(typeof $==="function")return $();return $}var Al={current:null};function N8($,J={}){let Z="rootStore"in $?$.rootStore:$,{dataRef:H,events:B}=Z.context,{enabled:Q=!0,delay:X=0,handleClose:z=null,mouseOnly:G=!1,restMs:Y=0,move:U=!0,triggerElementRef:F=Al,externalTree:K,isActiveTrigger:W=!0}=J,q=R2(K),N=tQ(Z),V=T5(z),L=T5(X),A=T5(Y),M=T5(Q);if(W)N.handleCloseOptions=V.current?.__options;let _=K0(()=>{if(N.interactedInside)return!0;return H.current.openEvent?["click","mousedown"].includes(H.current.openEvent.type):!1}),P=K0((E)=>{return W$(E,Z.context.triggerElements)}),D=C$.useCallback((E,x=!0)=>{let I=l6(L.current,"close",N.pointerType);if(I&&!N.handler)N.openChangeTimeout.start(I,()=>Z.setOpen(!1,M0(Y0.triggerHover,E)));else if(x)N.openChangeTimeout.clear(),Z.setOpen(!1,M0(Y0.triggerHover,E))},[L,Z,N]),w=K0(()=>{N.unbindMouseMove(),N.handler=void 0}),R=K0(()=>{if(N.performedPointerEventsMutation){let E=m0(Z.select("domReferenceElement")).body;E.style.pointerEvents="",E.removeAttribute(TZ),N.performedPointerEventsMutation=!1}});C$.useEffect(()=>{if(!Q)return;function E(x){if(!x.open)N.openChangeTimeout.clear(),N.restTimeout.clear(),N.blockMouseMove=!0,N.restTimeoutPending=!1}return B.on("openchange",E),()=>{B.off("openchange",E)}},[Q,B,N]);let b=K0((E)=>{if(_())return;if(!H.current.floatingContext)return;if(P(E.relatedTarget))return;let x=F.current;V.current?.({...H.current.floatingContext,tree:q,x:E.clientX,y:E.clientY,onClose(){if(R(),w(),!_()&&x===Z.select("domReferenceElement"))D(E)}})(E)});return C$.useEffect(()=>{if(!Q)return;let E=F.current??(W?Z.select("domReferenceElement"):null);if(!j1(E))return;function x(j){if(N.openChangeTimeout.clear(),N.blockMouseMove=!1,G&&!u4(N.pointerType))return;if(IK(A.current)>0&&!l6(L.current,"open"))return;let C=l6(L.current,"open",N.pointerType),k=Z.select("domReferenceElement"),y=Z.context.triggerElements,v=(y.hasElement(j.target)||y.hasMatchingElement((B0)=>f0(B0,j.target)))&&(!k||!f0(k,j.target)),u=j.currentTarget??null,T=Z.select("open"),t=!T||v;if(v&&T)Z.setOpen(!0,M0(Y0.triggerHover,j,u));else if(C)N.openChangeTimeout.start(C,()=>{if(t)Z.setOpen(!0,M0(Y0.triggerHover,j,u))});else if(t)Z.setOpen(!0,M0(Y0.triggerHover,j,u))}function I(j){if(_()){R();return}N.unbindMouseMove();let C=Z.select("domReferenceElement"),k=m0(C);if(N.restTimeout.clear(),N.restTimeoutPending=!1,P(j.relatedTarget))return;if(V.current&&H.current.floatingContext){if(!Z.select("open"))N.openChangeTimeout.clear();let v=F.current;N.handler=V.current({...H.current.floatingContext,tree:q,x:j.clientX,y:j.clientY,onClose(){if(R(),w(),M.current&&!_()&&v===Z.select("domReferenceElement"))D(j,!0)}});let u=N.handler;u(j),k.addEventListener("mousemove",u),N.unbindMouseMove=()=>{k.removeEventListener("mousemove",u)};return}if(N.pointerType==="touch"?!f0(Z.select("floatingElement"),j.relatedTarget):!0)D(j)}function S(j){b(j)}if(Z.select("open"))E.addEventListener("mouseleave",S);if(U)E.addEventListener("mousemove",x,{once:!0});return E.addEventListener("mouseenter",x),E.addEventListener("mouseleave",I),()=>{if(E.removeEventListener("mouseleave",S),U)E.removeEventListener("mousemove",x);E.removeEventListener("mouseenter",x),E.removeEventListener("mouseleave",I)}},[w,R,H,L,D,Z,Q,V,b,N,W,_,P,G,U,A,F,q,M]),C$.useMemo(()=>{if(!Q)return;function E(x){N.pointerType=x.pointerType}return{onPointerDown:E,onPointerEnter:E,onMouseMove(x){let{nativeEvent:I}=x,S=x.currentTarget,j=Z.select("domReferenceElement"),C=Z.context.triggerElements,k=Z.select("open"),y=(C.hasElement(x.target)||C.hasMatchingElement((u)=>f0(u,x.target)))&&(!j||!f0(j,x.target));if(G&&!u4(N.pointerType))return;if(k&&!y||IK(A.current)===0)return;if(!y&&N.restTimeoutPending&&x.movementX**2+x.movementY**2<2)return;N.restTimeout.clear();function v(){if(N.restTimeoutPending=!1,_())return;let u=Z.select("open");if(!N.blockMouseMove&&(!u||y))Z.setOpen(!0,M0(Y0.triggerHover,I,S))}if(N.pointerType==="touch")LP.flushSync(()=>{v()});else if(y&&k)v();else N.restTimeoutPending=!0,N.restTimeout.start(IK(A.current),v)}}},[Q,N,_,G,Z,A])}var w$=O(g(),1);function $2($=[]){let J=$.map((Y)=>Y?.reference),Z=$.map((Y)=>Y?.floating),H=$.map((Y)=>Y?.item),B=$.map((Y)=>Y?.trigger),Q=w$.useCallback((Y)=>eQ(Y,$,"reference"),J),X=w$.useCallback((Y)=>eQ(Y,$,"floating"),Z),z=w$.useCallback((Y)=>eQ(Y,$,"item"),H),G=w$.useCallback((Y)=>eQ(Y,$,"trigger"),B);return w$.useMemo(()=>({getReferenceProps:Q,getFloatingProps:X,getItemProps:z,getTriggerProps:G}),[Q,X,z,G])}function eQ($,J,Z){let H=new Map,B=Z==="item",Q={};if(Z==="floating")Q.tabIndex=-1,Q[WZ]="";for(let X in $){if(B&&$){if(X===XK||X===zK)continue}Q[X]=$[X]}for(let X=0;X<J.length;X+=1){let z,G=J[X]?.[Z];if(typeof G==="function")z=$?G($):null;else z=G;if(!z)continue;VP(Q,z,B,H)}return VP(Q,$,B,H),Q}function VP($,J,Z,H){for(let B in J){let Q=J[B];if(Z&&(B===XK||B===zK))continue;if(!B.startsWith("on"))$[B]=Q;else{if(!H.has(B))H.set(B,[]);if(typeof Q==="function")H.get(B)?.push(Q),$[B]=(...X)=>{return H.get(B)?.map((z)=>z(...X)).find((z)=>z!==void 0)}}}}var J2=O(g(),1);var Dl="Escape";function JX($,J,Z){switch($){case"vertical":return J;case"horizontal":return Z;default:return J||Z}}function $X($,J){return JX(J,$===qZ||$===K$,$===y8||$===h8)}function RK($,J,Z){return JX(J,$===K$,Z?$===y8:$===h8)||$==="Enter"||$===" "||$===""}function Ml($,J,Z){return JX(J,Z?$===y8:$===h8,$===K$)}function Pl($,J,Z,H){let B=Z?$===h8:$===y8,Q=$===qZ;if(J==="both"||J==="horizontal"&&H&&H>1)return $===Dl;return JX(J,B,Q)}function kK($,J){let Z="rootStore"in $?$.rootStore:$,H=Z.useState("open"),B=Z.useState("floatingElement"),Q=Z.useState("domReferenceElement"),X=Z.context.dataRef,{listRef:z,activeIndex:G,onNavigate:Y=()=>{},enabled:U=!0,selectedIndex:F=null,allowEscape:K=!1,loopFocus:W=!1,nested:q=!1,rtl:N=!1,virtual:V=!1,focusItemOnOpen:L="auto",focusItemOnHover:A=!0,openOnArrowKeyDown:M=!0,disabledIndices:_=void 0,orientation:P="vertical",parentOrientation:D,cols:w=1,id:R,resetOnPointerLeave:b=!0,externalTree:E}=J,x=N$(B),I=T5(x),S=t5(),j=R2(E);F0(()=>{X.current.orientation=P},[X,P]);let C=NZ(Q),k=J2.useRef(L),y=J2.useRef(F??-1),v=J2.useRef(null),u=J2.useRef(!0),T=K0((m)=>{Y(y.current===-1?null:y.current,m)}),t=J2.useRef(T),B0=J2.useRef(!!B),h=J2.useRef(H),e=J2.useRef(!1),A0=J2.useRef(!1),l=T5(_),z0=T5(H),W0=T5(F),Q0=T5(b),G0=K0(()=>{function m(O0){if(V)j?.events.emit("virtualfocus",O0);else M$(O0,{sync:e.current,preventScroll:!0})}let a=z.current[y.current],o=A0.current;if(a)m(a);(e.current?(O0)=>O0():requestAnimationFrame)(()=>{let O0=z.current[y.current]||a;if(!O0)return;if(!a)m(O0);if(i&&(o||!u.current))O0.scrollIntoView?.({block:"nearest",inline:"nearest"})})});F0(()=>{if(!U)return;if(H&&B){if(y.current=F??-1,k.current&&F!=null)A0.current=!0,T()}else if(B0.current)y.current=-1,t.current()},[U,H,B,F,T]),F0(()=>{if(!U)return;if(!H){e.current=!1;return}if(!B)return;if(G==null){if(e.current=!1,W0.current!=null)return;if(B0.current)y.current=-1,G0();if((!h.current||!B0.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 y.current=v.current==null||RK(v.current,P,N)||q?SQ(z):UK(z),v.current=null,T()};a()}}else if(!u6(z,G))y.current=G,G0(),A0.current=!1},[U,H,B,G,W0,q,z,P,N,T,G0,l]),F0(()=>{if(!U||B||!j||V||!B0.current)return;let m=j.nodesRef.current,a=m.find((O0)=>O0.id===S)?.context?.elements.floating,o=J5(m0(B)),N0=m.some((O0)=>O0.context&&f0(O0.context.elements.floating,o));if(a&&!N0&&u.current)a.focus({preventScroll:!0})},[U,B,j,S,V]),F0(()=>{t.current=T,h.current=H,B0.current=!!B}),F0(()=>{if(!H)v.current=null,k.current=L},[H,L]);let L0=G!=null,i=J2.useMemo(()=>{function m(o){if(!z0.current)return;let N0=z.current.indexOf(o.currentTarget);if(N0!==-1&&y.current!==N0)y.current=N0,T(o)}return{onFocus(o){e.current=!0,m(o)},onClick:({currentTarget:o})=>o.focus({preventScroll:!0}),onMouseMove(o){if(e.current=!0,A0.current=!1,A)m(o)},onPointerLeave(o){if(!z0.current||!u.current||o.pointerType==="touch")return;e.current=!0;let N0=o.relatedTarget;if(!A||z.current.includes(N0))return;if(!Q0.current)return;if(M$(null,{sync:!0}),y.current=-1,T(o),!V)I.current?.focus({preventScroll:!0})}}},[z0,I,A,z,T,Q0,V]),$0=J2.useCallback(()=>{return D??j?.nodesRef.current.find((m)=>m.id===S)?.context?.dataRef?.current.orientation},[S,j,D]),J0=K0((m)=>{if(u.current=!1,e.current=!0,m.which===229)return;if(!z0.current&&m.currentTarget===I.current)return;if(q&&Pl(m.key,P,N,w)){if(!$X(m.key,$0()))r5(m);if(Z.setOpen(!1,M0(Y0.listNavigation,m.nativeEvent)),P5(Q))if(V)j?.events.emit("virtualfocus",Q);else Q.focus();return}let a=y.current,o=SQ(z,_),N0=UK(z,_);if(!C){if(m.key==="Home")r5(m),y.current=o,T(m);if(m.key==="End")r5(m),y.current=N0,T(m)}if(w>1){let O0=Array.from({length:z.current.length},()=>({width:1,height:1})),g0=WM(O0,w,!1),p0=g0.findIndex((X0)=>X0!=null&&!c6(z,X0,_)),f=g0.reduce((X0,V0,j0)=>V0!=null&&!c6(z,V0,_)?j0:X0,-1),r=g0[KM({current:g0.map((X0)=>X0!=null?z.current[X0]:null)},{event:m,orientation:P,loopFocus:W,rtl:N,cols:w,disabledIndices:NM([...(typeof _!=="function"?_:null)||z.current.map((X0,V0)=>c6(z,V0,_)?V0:void 0),void 0],g0),minIndex:p0,maxIndex:f,prevIndex:qM(y.current>N0?o:y.current,O0,g0,w,m.key===K$?"bl":m.key===(N?y8:h8)?"tr":"tl"),stopEvent:!0})];if(r!=null)y.current=r,T(m);if(P==="both")return}if($X(m.key,P)){if(r5(m),H&&!V&&J5(m.currentTarget.ownerDocument)===m.currentTarget){y.current=RK(m.key,P,N)?o:N0,T(m);return}if(RK(m.key,P,N))if(W)if(a>=N0)if(K&&a!==z.current.length)y.current=-1;else e.current=!1,y.current=o;else y.current=M2(z,{startingIndex:a,disabledIndices:_});else y.current=Math.min(N0,M2(z,{startingIndex:a,disabledIndices:_}));else if(W)if(a<=o)if(K&&a!==-1)y.current=z.current.length;else e.current=!1,y.current=N0;else y.current=M2(z,{startingIndex:a,decrement:!0,disabledIndices:_});else y.current=Math.max(o,M2(z,{startingIndex:a,decrement:!0,disabledIndices:_}));if(u6(z,y.current))y.current=-1;T(m)}}),H0=J2.useMemo(()=>{return V&&H&&L0&&{"aria-activedescendant":`${R}-${G}`}},[V,H,L0,R,G]),n=J2.useMemo(()=>{return{"aria-orientation":P==="both"?void 0:P,...!C?H0:{},onKeyDown(m){if(m.key==="Tab"&&m.shiftKey&&H&&!V){let a=y1(m.nativeEvent);if(a&&!f0(I.current,a))return;if(r5(m),Z.setOpen(!1,M0(Y0.focusOut,m.nativeEvent)),P5(Q))Q.focus();return}J0(m)},onPointerMove(){u.current=!0}}},[H0,J0,I,P,C,Z,H,V,Q]),p=J2.useMemo(()=>{function m(o){if(L==="auto"&&TQ(o.nativeEvent))k.current=!V}function a(o){if(k.current=L,L==="auto"&&CQ(o.nativeEvent))k.current=!0}return{onKeyDown(o){let N0=Z.select("open");u.current=!1;let O0=o.key.startsWith("Arrow"),g0=Ml(o.key,$0(),N),p0=$X(o.key,P),f=(q?g0:p0)||o.key==="Enter"||o.key.trim()==="";if(V&&N0)return J0(o);if(!N0&&!M&&O0)return;if(f){let r=$X(o.key,$0());v.current=q&&r?null:o.key}if(q){if(g0)if(r5(o),N0)y.current=SQ(z,l.current),T(o);else Z.setOpen(!0,M0(Y0.listNavigation,o.nativeEvent,o.currentTarget));return}if(p0){if(W0.current!=null)y.current=W0.current;if(r5(o),!N0&&M)Z.setOpen(!0,M0(Y0.listNavigation,o.nativeEvent,o.currentTarget));else J0(o);if(N0)T(o)}return},onFocus(o){if(Z.select("open")&&!V)y.current=-1,T(o)},onPointerDown:a,onPointerEnter:a,onMouseDown:m,onClick:m}},[J0,l,L,z,q,T,Z,M,P,$0,N,W0,V]),d=J2.useMemo(()=>{return{...H0,...p}},[H0,p]);return J2.useMemo(()=>U?{reference:d,floating:n,item:i,trigger:p}:{},[U,d,n,p,i])}var J3=O(g(),1);var _l=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function E$($,J={}){let Z="rootStore"in $?$.rootStore:$,H=Z.useState("open"),B=Z.useState("floatingId"),Q=Z.useState("domReferenceElement"),X=Z.useState("floatingElement"),{role:z="dialog"}=J,G=U2(),Y=Q?.id||G,U=J3.useMemo(()=>N$(X)?.id||B,[X,B]),F=_l.get(z)??z,W=t5()!=null,q=J3.useMemo(()=>{if(F==="tooltip"||z==="label")return k1;return{"aria-haspopup":F==="alertdialog"?"dialog":F,"aria-expanded":"false",...F==="listbox"&&{role:"combobox"},...F==="menu"&&W&&{role:"menuitem"},...z==="select"&&{"aria-autocomplete":"none"},...z==="combobox"&&{"aria-autocomplete":"list"}}},[F,W,z]),N=J3.useMemo(()=>{if(F==="tooltip"||z==="label")return{[`aria-${z==="label"?"labelledby":"describedby"}`]:H?U:void 0};return{...q,"aria-expanded":H?"true":"false","aria-controls":H?U:void 0,...F==="menu"&&{id:Y}}},[F,U,H,Y,z,q]),V=J3.useMemo(()=>{let A={id:U,...F&&{role:F}};if(F==="tooltip"||z==="label")return A;return{...A,...F==="menu"&&{"aria-labelledby":Y}}},[F,U,Y,z]),L=J3.useCallback(({active:A,selected:M})=>{let _={role:"option",...A&&{id:`${U}-fui-option`}};switch(z){case"select":case"combobox":return{..._,"aria-selected":M};default:}return{}},[U,z]);return J3.useMemo(()=>({reference:N,floating:V,item:L,trigger:q}),[N,V,q,L])}var Z3=O(g(),1);function bK($,J){let Z="rootStore"in $?$.rootStore:$,H=Z.context.dataRef,B=Z.useState("open"),{listRef:Q,activeIndex:X,onMatch:z,onTypingChange:G,enabled:Y=!0,resetMs:U=750,selectedIndex:F=null}=J,K=M5(),W=Z3.useRef(""),q=Z3.useRef(F??X??-1),N=Z3.useRef(null);F0(()=>{if(!B&&F!==null)return;if(K.clear(),N.current=null,W.current!=="")W.current=""},[B,F,K]),F0(()=>{if(B&&W.current==="")q.current=F??X??-1},[B,F,X]);let V=K0((P)=>{if(P){if(!H.current.typing)H.current.typing=P,G?.(P)}else if(H.current.typing)H.current.typing=P,G?.(P)}),L=K0((P)=>{function D(I,S,j){let C=S.find((k)=>k?.toLocaleLowerCase().indexOf(j.toLocaleLowerCase())===0);return C?I.indexOf(C):-1}let w=Q.current;if(W.current.length>0&&W.current[0]!==" "){if(D(w,w,W.current)===-1)V(!1);else if(P.key===" ")r5(P)}if(w==null||P.key.length!==1||P.ctrlKey||P.metaKey||P.altKey)return;if(B&&P.key!==" ")r5(P),V(!0);let R=W.current==="";if(R)q.current=F??X??-1;if(w.every((I)=>I?I[0]?.toLocaleLowerCase()!==I[1]?.toLocaleLowerCase():!0)&&W.current===P.key)W.current="",q.current=N.current;W.current+=P.key,K.start(U,()=>{W.current="",q.current=N.current,V(!1)});let E=R?F??X??-1:q.current,x=D(w,[...w.slice((E||0)+1),...w.slice(0,(E||0)+1)],W.current);if(x!==-1)z?.(x),N.current=x;else if(P.key!==" ")W.current="",V(!1)}),A=K0((P)=>{let D=P.relatedTarget,w=Z.select("domReferenceElement"),R=Z.select("floatingElement"),b=f0(w,D),E=f0(R,D);if(b||E)return;K.clear(),W.current="",q.current=N.current,V(!1)}),M=Z3.useMemo(()=>({onKeyDown:L,onBlur:A}),[L,A]),_=Z3.useMemo(()=>{return{onKeyDown:L,onKeyUp(P){if(P.key===" ")V(!1)},onBlur:A}},[L,A,V]);return Z3.useMemo(()=>Y?{reference:M,floating:_}:{},[Y,M,_])}function AP($,J){let[Z,H]=$,B=!1,Q=J.length;for(let X=0,z=Q-1;X<Q;z=X++){let[G,Y]=J[X]||[0,0],[U,F]=J[z]||[0,0];if(Y>=H!==F>=H&&Z<=(U-G)*(H-Y)/(F-Y)+G)B=!B}return B}function Ol($,J){return $[0]>=J.x&&$[0]<=J.x+J.width&&$[1]>=J.y&&$[1]<=J.y+J.height}function L8($={}){let{buffer:J=0.5,blockPointerEvents:Z=!1,requireIntent:H=!0}=$,B=new i5,Q=!1,X=null,z=null,G=typeof performance<"u"?performance.now():0;function Y(F,K){let W=performance.now(),q=W-G;if(X===null||z===null||q===0)return X=F,z=K,G=W,null;let N=F-X,V=K-z,A=Math.sqrt(N*N+V*V)/q;return X=F,z=K,G=W,A}let U=({x:F,y:K,placement:W,elements:q,onClose:N,nodeId:V,tree:L})=>{return function(M){function _(){B.clear(),N()}if(B.clear(),!q.domReference||!q.floating||W==null||F==null||K==null)return;let{clientX:P,clientY:D}=M,w=[P,D],R=y1(M),b=M.type==="mouseleave",E=f0(q.floating,R),x=f0(q.domReference,R),I=q.domReference.getBoundingClientRect(),S=q.floating.getBoundingClientRect(),j=W.split("-")[0],C=F>S.right-S.width/2,k=K>S.bottom-S.height/2,y=Ol(w,I),v=S.width>I.width,u=S.height>I.height,T=(v?I:S).left,t=(v?I:S).right,B0=(u?I:S).top,h=(u?I:S).bottom;if(E){if(Q=!0,!b)return}if(x)Q=!1;if(x&&!b){Q=!0;return}if(b&&j1(M.relatedTarget)&&f0(q.floating,M.relatedTarget))return;if(L&&x8(L.nodesRef.current,V).some(({context:l})=>l?.open))return;if(j==="top"&&K>=I.bottom-1||j==="bottom"&&K<=I.top+1||j==="left"&&F>=I.right-1||j==="right"&&F<=I.left+1)return _();let e=[];switch(j){case"top":e=[[T,I.top+1],[T,S.bottom-1],[t,S.bottom-1],[t,I.top+1]];break;case"bottom":e=[[T,S.top+1],[T,I.bottom-1],[t,I.bottom-1],[t,S.top+1]];break;case"left":e=[[S.right-1,h],[S.right-1,B0],[I.left+1,B0],[I.left+1,h]];break;case"right":e=[[I.right-1,h],[I.right-1,B0],[S.left+1,B0],[S.left+1,h]];break;default:}function A0([l,z0]){switch(j){case"top":{let W0=[v?l+J/2:C?l+J*4:l-J*4,z0+J+1],Q0=[v?l-J/2:C?l+J*4:l-J*4,z0+J+1],G0=[[S.left,C?S.bottom-J:v?S.bottom-J:S.top],[S.right,C?v?S.bottom-J:S.top:S.bottom-J]];return[W0,Q0,...G0]}case"bottom":{let W0=[v?l+J/2:C?l+J*4:l-J*4,z0-J],Q0=[v?l-J/2:C?l+J*4:l-J*4,z0-J],G0=[[S.left,C?S.top+J:v?S.top+J:S.bottom],[S.right,C?v?S.top+J:S.bottom:S.top+J]];return[W0,Q0,...G0]}case"left":{let W0=[l+J+1,u?z0+J/2:k?z0+J*4:z0-J*4],Q0=[l+J+1,u?z0-J/2:k?z0+J*4:z0-J*4];return[...[[k?S.right-J:u?S.right-J:S.left,S.top],[k?u?S.right-J:S.left:S.right-J,S.bottom]],W0,Q0]}case"right":{let W0=[l-J,u?z0+J/2:k?z0+J*4:z0-J*4],Q0=[l-J,u?z0-J/2:k?z0+J*4:z0-J*4],G0=[[k?S.left+J:u?S.left+J:S.right,S.top],[k?u?S.left+J:S.right:S.left+J,S.bottom]];return[W0,Q0,...G0]}default:return[]}}if(AP([P,D],e))return;if(Q&&!y)return _();if(!b&&H){let l=Y(M.clientX,M.clientY),z0=0.1;if(l!==null&&l<0.1)return _()}if(!AP([P,D],A0([F,K])))_();else if(!Q&&H)B.start(40,_);return}};return U.__options={blockPointerEvents:Z},U}var MP=O(c(),1),s6=HX.forwardRef(function(J,Z){let{children:H,container:B,className:Q,render:X,...z}=J,{portalNode:G,portalSubtree:Y}=nQ({container:B,ref:Z,componentProps:J,elementProps:z});if(!Y&&!G)return null;return MP.jsxs(HX.Fragment,{children:[Y,G&&DP.createPortal(H,G)]})});var PP=s6;var H3=O(g(),1);var T4=O(g(),1);var BX=O(g(),1),jl=BX.createContext(void 0);function l4(){return BX.useContext(jl)?.direction??"ltr"}var Tl=($)=>({name:"arrow",options:$,async fn(J){let{x:Z,y:H,placement:B,rects:Q,platform:X,elements:z,middlewareData:G}=J,{element:Y,padding:U=0,offsetParent:F="real"}=OP($,J)||{};if(Y==null)return{};let K=CP(U),W={x:Z,y:H},q=TP(B),N=jP(q),V=await X.getDimensions(Y),L=q==="y",A=L?"top":"left",M=L?"bottom":"right",_=L?"clientHeight":"clientWidth",P=Q.reference[N]+Q.reference[q]-W[q]-Q.floating[N],D=W[q]-Q.reference[q],w=F==="real"?await X.getOffsetParent?.(Y):z.floating,R=z.floating[_]||Q.floating[N];if(!R||!await X.isElement?.(w))R=z.floating[_]||Q.floating[N];let b=P/2-D/2,E=R/2-V[N]/2-1,x=Math.min(K[A],E),I=Math.min(K[M],E),S=x,j=R-V[N]-I,C=R/2-V[N]/2+b,k=_P(S,C,j),y=!G.arrow&&CZ(B)!=null&&C!==k&&Q.reference[N]/2-(C<S?x:I)-V[N]/2<0,v=y?C<S?C-S:C-j:0;return{[q]:W[q]+v,data:{[q]:k,centerOffset:C-k-v,...y&&{alignmentOffset:v}},reset:y}}}),wP=($,J)=>({...Tl($),options:[$,J]});var EP={name:"hide",async fn($){let{width:J,height:Z,x:H,y:B}=$.rects.reference,Q=J===0&&Z===0&&H===0&&B===0;return{data:{referenceHidden:(await fK().fn($)).data?.referenceHidden||Q}}}};var wZ={sideX:"left",sideY:"top"},t6={name:"adaptiveOrigin",async fn($){let{x:J,y:Z,rects:{floating:H},elements:{floating:B},platform:Q,strategy:X,placement:z}=$,G=E2(B),Y=G.getComputedStyle(B);if(!(Y.transitionDuration!=="0s"&&Y.transitionDuration!==""))return{x:J,y:Z,data:wZ};let F=await Q.getOffsetParent?.(B),K={width:0,height:0};if(X==="fixed"&&G?.visualViewport)K={width:G.visualViewport.width,height:G.visualViewport.height};else if(F===G){let A=m0(B);K={width:A.documentElement.clientWidth,height:A.documentElement.clientHeight}}else if(await Q.isElement?.(F))K=await Q.getDimensions(F);let W=S$(z),q=J,N=Z;if(W==="left")q=K.width-(J+H.width);if(W==="top")N=K.height-(Z+H.height);let V=W==="left"?"right":wZ.sideX,L=W==="top"?"bottom":wZ.sideY;return{x:q,y:N,data:{sideX:V,sideY:L}}}};function RP($,J,Z){let H=$==="inline-start"||$==="inline-end";return{top:"top",right:H?Z?"inline-start":"inline-end":"right",bottom:"bottom",left:H?Z?"inline-end":"inline-start":"left"}[J]}function SP($,J,Z){let{rects:H,placement:B}=$;return{side:RP(J,S$(B),Z),align:CZ(B)||"center",anchor:{width:H.reference.width,height:H.reference.height},positioner:{width:H.floating.width,height:H.floating.height}}}function a8($){let{anchor:J,positionMethod:Z="absolute",side:H="bottom",sideOffset:B=0,align:Q="center",alignOffset:X=0,collisionBoundary:z,collisionPadding:G=5,sticky:Y=!1,arrowPadding:U=5,disableAnchorTracking:F=!1,keepMounted:K=!1,floatingRootContext:W,mounted:q,collisionAvoidance:N,shiftCrossAxis:V=!1,nodeId:L,adaptiveOrigin:A,lazyFlip:M=!1,externalTree:_}=$,[P,D]=T4.useState(null);if(!q&&P!==null)D(null);let w=N.side||"flip",R=N.align||"flip",b=N.fallbackAxisSide||"end",E=typeof J==="function"?J:void 0,x=K0(E),I=E?x:J,S=T5(J),C=l4()==="rtl",k=P||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":C?"left":"right","inline-start":C?"right":"left"}[H],y=Q==="center"?k:`${k}-${Q}`,v=G,u=1,T=H==="bottom"?u:0,t=H==="top"?u:0,B0=H==="right"?u:0,h=H==="left"?u:0;if(typeof v==="number")v={top:v+T,right:v+h,bottom:v+t,left:v+B0};else if(v)v={top:(v.top||0)+T,right:(v.right||0)+h,bottom:(v.bottom||0)+t,left:(v.left||0)+B0};let e={boundary:z==="clipping-ancestors"?"clippingAncestors":z,padding:v},A0=T4.useRef(null),l=T5(B),z0=T5(X),G0=[yK((Z0)=>{let T0=SP(Z0,H,C),H1=typeof l.current==="function"?l.current(T0):l.current,G1=typeof z0.current==="function"?z0.current(T0):z0.current;return{mainAxis:H1,crossAxis:G1,alignmentAxis:G1}},[typeof B!=="function"?B:0,typeof X!=="function"?X:0,C,H])],L0=R==="none"&&w!=="shift",i=!L0&&(Y||V||w==="shift"),$0=w==="none"?null:vK({...e,padding:{top:v.top+u,right:v.right+u,bottom:v.bottom+u,left:v.left+u},mainAxis:!V&&w==="flip",crossAxis:R==="flip"?"alignment":!1,fallbackAxisSideDirection:b}),J0=L0?null:hK((Z0)=>{let T0=m0(Z0.elements.floating).documentElement;return{...e,rootBoundary:V?{x:0,y:0,width:T0.clientWidth,height:T0.clientHeight}:void 0,mainAxis:R!=="none",crossAxis:i,limiter:Y||V?void 0:xK((H1)=>{if(!A0.current)return{};let{width:G1,height:a1}=A0.current.getBoundingClientRect(),I0=mK(S$(H1.placement)),k0=I0==="y"?G1:a1,R0=I0==="y"?v.left+v.right:v.top+v.bottom;return{offset:k0/2+R0/2}})}},[e,Y,V,v,R]);if(w==="shift"||R==="shift"||Q==="center")G0.push(J0,$0);else G0.push($0,J0);G0.push(gK({...e,apply({elements:{floating:Z0},rects:{reference:T0},availableWidth:H1,availableHeight:G1}){let a1=Z0.style;a1.setProperty("--available-width",`${H1}px`),a1.setProperty("--available-height",`${G1}px`),a1.setProperty("--anchor-width",`${T0.width}px`),a1.setProperty("--anchor-height",`${T0.height}px`)}}),wP(()=>({element:A0.current||document.createElement("div"),padding:U,offsetParent:"floating"}),[U]),{name:"transformOrigin",fn(Z0){let{elements:T0,middlewareData:H1,placement:G1,rects:a1,y:I0}=Z0,k0=S$(G1),R0=mK(k0),n0=A0.current,F1=H1.arrow?.x||0,C1=H1.arrow?.y||0,e1=n0?.clientWidth||0,$5=n0?.clientHeight||0,A1=F1+e1/2,V5=C1+$5/2,m5=Math.abs(H1.shift?.y||0),l5=a1.reference.height/2,x0=typeof B==="function"?B(SP(Z0,H,C)):B,Z1=m5>x0,u0={top:`${A1}px calc(100% + ${x0}px)`,bottom:`${A1}px ${-x0}px`,left:`calc(100% + ${x0}px) ${V5}px`,right:`${-x0}px ${V5}px`}[k0],q1=`${A1}px ${a1.reference.y+l5-I0}px`;return T0.floating.style.setProperty("--transform-origin",i&&R0==="y"&&Z1?q1:u0),{}}},EP,A),F0(()=>{if(!q&&W)W.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[q,W]);let H0=T4.useMemo(()=>({elementResize:!F&&typeof ResizeObserver<"u",layoutShift:!F&&typeof IntersectionObserver<"u"}),[F]),{refs:n,elements:p,x:d,y:m,middlewareData:a,update:o,placement:N0,context:O0,isPositioned:g0,floatingStyles:p0}=wK({rootContext:W,placement:y,middleware:G0,strategy:Z,whileElementsMounted:K?void 0:(...Z0)=>ZX(...Z0,H0),nodeId:L,externalTree:_}),{sideX:f,sideY:r}=a.adaptiveOrigin||wZ,X0=g0?Z:"fixed",V0=T4.useMemo(()=>{let Z0=A?{position:X0,[f]:d,[r]:m}:{position:X0,...p0};if(!g0)Z0.opacity=0;return Z0},[A,X0,f,d,r,m,p0,g0]),j0=T4.useRef(null);F0(()=>{if(!q)return;let Z0=S.current,T0=typeof Z0==="function"?Z0():Z0,G1=(IP(T0)?T0.current:T0)||null||null;if(G1!==j0.current)n.setPositionReference(G1),j0.current=G1},[q,n,I,S]),T4.useEffect(()=>{if(!q)return;let Z0=S.current;if(typeof Z0==="function")return;if(IP(Z0)&&Z0.current!==j0.current)n.setPositionReference(Z0.current),j0.current=Z0.current},[q,n,I,S]),T4.useEffect(()=>{if(K&&q&&p.domReference&&p.floating)return ZX(p.domReference,p.floating,o,H0);return},[K,q,p,o,H0]);let v0=S$(N0),Q1=RP(H,v0,C),U1=CZ(N0)||"center",c0=Boolean(a.hide?.referenceHidden);F0(()=>{if(M&&q&&g0)D(v0)},[M,q,g0,v0]);let y0=T4.useMemo(()=>({position:"absolute",top:a.arrow?.y,left:a.arrow?.x}),[a.arrow]),d0=a.arrow?.centerOffset!==0;return T4.useMemo(()=>({positionerStyles:V0,arrowStyles:y0,arrowRef:A0,arrowUncentered:d0,side:Q1,align:U1,physicalSide:v0,anchorHidden:c0,refs:n,context:O0,isPositioned:g0,update:o}),[V0,y0,A0,d0,Q1,U1,v0,c0,n,O0,g0,o])}function IP($){return $!=null&&"current"in $}var C4=function($){return $.open="data-open",$.closed="data-closed",$[$.startingStyle=f8.startingStyle]="startingStyle",$[$.endingStyle=f8.endingStyle]="endingStyle",$.anchorHidden="data-anchor-hidden",$.side="data-side",$.align="data-align",$}({}),EZ=function($){return $.popupOpen="data-popup-open",$.pressed="data-pressed",$}({}),Cl={[EZ.popupOpen]:""},wl={[EZ.popupOpen]:"",[EZ.pressed]:""},El={[C4.open]:""},Sl={[C4.closed]:""},Il={[C4.anchorHidden]:""},n8={open($){if($)return Cl;return null}},SZ={open($){if($)return wl;return null}},D1={open($){if($)return El;return Sl},anchorHidden($){if($)return Il;return null}};function F2($){return $==="starting"?kP:k1}var QX=O(g(),1),pK=QX.createContext(void 0);function bP(){let $=QX.useContext(pK);if($===void 0)throw Error(E0(84));return $}var yP=O(c(),1),hP=H3.forwardRef(function(J,Z){let{toast:H,...B}=J,Q=r9(),X=H.positionerProps??k1,{render:z,className:G,anchor:Y=X.anchor,positionMethod:U=X.positionMethod??"absolute",side:F=X.side??"top",align:K=X.align??"center",sideOffset:W=X.sideOffset??0,alignOffset:q=X.alignOffset??0,collisionBoundary:N=X.collisionBoundary??"clipping-ancestors",collisionPadding:V=X.collisionPadding??5,arrowPadding:L=X.arrowPadding??5,sticky:A=X.sticky??!1,disableAnchorTracking:M=X.disableAnchorTracking??!1,collisionAvoidance:_=X.collisionAvoidance??o8,...P}=B,[D,w]=H3.useState(null),R=Q.useState("toastIndex",H.id),b=Q.useState("toastVisibleIndex",H.id),E=j1(Y)?Y:null,x=jZ({open:!0,onOpenChange:u1,elements:{floating:D,reference:E}}),I=a8({anchor:E,positionMethod:U,floatingRootContext:x,mounted:!0,side:F,sideOffset:W,align:K,alignOffset:q,collisionBoundary:N,collisionPadding:V,sticky:A,arrowPadding:L,disableAnchorTracking:M,keepMounted:!0,collisionAvoidance:_}),S=H3.useMemo(()=>{let y={};return{role:"presentation",style:{...I.positionerStyles,...y,[p8.index]:H.transitionStatus==="ending"?R:b}}},[I.positionerStyles,H.transitionStatus,R,b]),j=H3.useMemo(()=>({side:I.side,align:I.align,anchorHidden:I.anchorHidden}),[I.side,I.align,I.anchorHidden]),C=H3.useMemo(()=>({...j,arrowRef:I.arrowRef,arrowStyles:I.arrowStyles,arrowUncentered:I.arrowUncentered}),[j,I.arrowRef,I.arrowStyles,I.arrowUncentered]),k=U0("div",J,{state:j,props:[S,F2(H.transitionStatus),P],ref:[Z,w],stateAttributesMapping:D1});return yP.jsx(pK.Provider,{value:C,children:k})});var xP=O(g(),1);var vP=xP.forwardRef(function(J,Z){let{className:H,render:B,...Q}=J,{arrowRef:X,side:z,align:G,arrowUncentered:Y,arrowStyles:U}=bP();return U0("div",J,{state:{side:z,align:G,uncentered:Y},ref:[Z,X],props:[{style:U,"aria-hidden":!0},Q]})});var XX=O(g(),1);function gP(){let $=XX.useContext(YZ);if(!$)throw Error(E0(73));let J=$.useState("toasts");return XX.useMemo(()=>({toasts:J,add:$.addToast,close:$.closeToast,update:$.updateToast,promise:$.promiseToast}),[J,$])}function fP(){let $=new Set;function J(Z){$.forEach((H)=>H(Z))}return{" subscribe":function(H){return $.add(H),()=>{$.delete(H)}},add(Z){let H=Z.id||VQ("toast"),B={...Z,id:H,transitionStatus:"starting"};return J({action:"add",options:B}),H},close(Z){J({action:"close",options:{id:Z}})},update(Z,H){J({action:"update",options:{...H,id:Z}})},promise(Z,H){let B=Z;return J({action:"promise",options:{...H,promise:Z,setPromise(Q){B=Q}}}),B}}}var h1=O(c(),1),i4=k2.createToastManager();function Rl({...$}){return h1.jsx(k2.Provider,{...$})}function kl({...$}){return h1.jsx(k2.Portal,{"data-slot":"toast-portal",...$})}function bl({className:$,...J}){return h1.jsx(k2.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",$),...J})}function yl({className:$,...J}){return h1.jsx(k2.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%))]",$),...J})}function hl({className:$,...J}){return h1.jsx(k2.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",$),...J})}function xl({className:$,...J}){return h1.jsx(k2.Title,{"data-slot":"toast-title",className:s("text-sm font-medium",$),...J})}function vl({className:$,...J}){return h1.jsx(k2.Description,{"data-slot":"toast-description",className:s("text-sm text-muted-foreground",$),...J})}function gl({className:$,render:J=h1.jsx(C0,{variant:"outline",size:"sm"}),...Z}){return h1.jsx(k2.Action,{"data-slot":"toast-action",render:J,className:s("shrink-0",$),...Z})}function fl({className:$,children:J,render:Z=h1.jsx(C0,{variant:"ghost",size:"icon-sm"}),...H}){return h1.jsx(k2.Close,{"data-slot":"toast-close","aria-label":"Close toast",render:Z,className:s("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",$),...H,children:J??h1.jsx(w5,{"aria-hidden":"true",stroke:1.75})})}function ml({type:$}){let J=null;if($==="success")J=h1.jsx(pP,{"aria-hidden":"true",stroke:1.75});if($==="info")J=h1.jsx(uP,{"aria-hidden":"true",stroke:1.75});if($==="warning")J=h1.jsx(zX,{"aria-hidden":"true",stroke:1.75});if($==="error")J=h1.jsx(mP,{className:"text-destructive","aria-hidden":"true",stroke:1.75});if($==="loading")J=h1.jsx(cP,{className:"animate-spin","aria-hidden":"true",stroke:1.75});if(!J)return null;return h1.jsx("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:J})}function pl(){let{toasts:$}=k2.useToastManager();return $.map((J)=>h1.jsx(yl,{toast:J,children:h1.jsxs(hl,{children:[h1.jsx(ml,{type:J.type}),h1.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[h1.jsx(xl,{}),h1.jsx(vl,{})]}),h1.jsx(gl,{}),h1.jsx(fl,{})]})},J.id))}function dP({children:$,toastManager:J=i4,...Z}){return h1.jsxs(Rl,{toastManager:J,...Z,children:[$,h1.jsx(kl,{children:h1.jsx(bl,{children:h1.jsx(pl,{})})})]})}var Fq0=k2.createToastManager,Kq0=k2.useToastManager;var S9={};_4(S9,{createHandle:()=>D_,Viewport:()=>A_,Trigger:()=>$_,Root:()=>nP,Provider:()=>U_,Positioner:()=>Q_,Portal:()=>H_,Popup:()=>z_,Handle:()=>qX,Arrow:()=>Y_});var t8=O(g(),1);var lP=O(g(),1);function s8($){let J=lP.useRef(!0);if(J.current)J.current=!1,$()}var GX=O(g(),1),uK=GX.createContext(void 0);function r4($){let J=GX.useContext(uK);if(J===void 0&&!$)throw Error(E0(72));return J}var iP=O(g(),1),rP=O(G4(),1);var ul={...i8,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 e6 extends i2{constructor($){super({...cl(),...$},{popupRef:iP.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new a2},ul)}setOpen=($,J)=>{let Z=J.reason,H=Z===Y0.triggerHover,B=$&&Z===Y0.triggerFocus,Q=!$&&(Z===Y0.triggerPress||Z===Y0.escapeKey);if(J.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,J),J.isCanceled)return;let X=()=>{let z={open:$,openChangeReason:Z};if(B)z.instantType="focus";else if(Q)z.instantType="dismiss";else if(Z===Y0.triggerHover)z.instantType=void 0;let G=J.trigger?.id??null;if(G||$)z.activeTriggerId=G,z.activeTriggerElement=J.trigger??null;this.update(z)};if(H)rP.flushSync(X);else X()};static useStore($,J){let Z=R1(()=>{return new e6(J)}).current,H=$??Z,B=q8({popupStore:H,onOpenChange:H.setOpen});return H.state.floatingRootContext=B,H}}function cl(){return{...l8(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}var aP=O(c(),1),nP=FZ(function(J){let{disabled:Z=!1,defaultOpen:H=!1,open:B,disableHoverablePopup:Q=!1,trackCursorAxis:X="none",actionsRef:z,onOpenChange:G,onOpenChangeComplete:Y,handle:U,triggerId:F,defaultTriggerId:K=null,children:W}=J,q=e6.useStore(U?.store,{open:H,openProp:B,activeTriggerId:K,triggerIdProp:F});s8(()=>{if(B===void 0&&q.state.open===!1&&H===!0)q.update({open:!0,activeTriggerId:K})}),q.useControlledProp("openProp",B),q.useControlledProp("triggerIdProp",F),q.useContextCallback("onOpenChange",G),q.useContextCallback("onOpenChangeComplete",Y);let N=q.useState("open"),V=!Z&&N,L=q.useState("activeTriggerId"),A=q.useState("payload");q.useSyncedValues({trackCursorAxis:X,disableHoverablePopup:Q}),F0(()=>{if(N&&Z)q.setOpen(!1,M0(Y0.disabled))},[N,Z,q]),q.useSyncedValue("disabled",Z),c8(q);let{forceUnmount:M,transitionStatus:_}=d8(V,q),P=q.useState("isInstantPhase"),D=q.useState("instantType"),w=q.useState("lastOpenChangeReason"),R=t8.useRef(null);F0(()=>{if(_==="ending"&&w===Y0.none||_!=="ending"&&P){if(D!=="delay")R.current=D;q.set("instantType","delay")}else if(R.current!==null)q.set("instantType",R.current),R.current=null},[_,P,w,D,q]),F0(()=>{if(V){if(L==null)q.set("payload",void 0)}},[q,L,V]);let b=t8.useCallback(()=>{q.setOpen(!1,dl(q,Y0.imperativeAction))},[q]);t8.useImperativeHandle(z,()=>({unmount:M,close:b}),[M,b]);let E=q.useState("floatingRootContext"),x=W8(E,{enabled:!Z,referencePress:!0}),I=TK(E,{enabled:!Z&&X!=="none",axis:X==="none"?void 0:X}),{getReferenceProps:S,getFloatingProps:j,getTriggerProps:C}=$2([x,I]),k=t8.useMemo(()=>S(),[S]),y=t8.useMemo(()=>C(),[C]),v=t8.useMemo(()=>j(),[j]);return q.useSyncedValues({activeTriggerProps:k,inactiveTriggerProps:y,popupProps:v}),aP.jsx(uK.Provider,{value:q,children:typeof W==="function"?W({payload:A}):W})});function dl($,J){let Z=M0(J);return Z.preventUnmountOnClose=()=>{$.set("preventUnmountingOnClose",!0)},Z}var eP=O(g(),1);function t0($){return U2($,"base-ui")}var YX=O(g(),1),cK=YX.createContext(void 0);function oP(){return YX.useContext(cK)}var sP=function($){return $[$.popupOpen=EZ.popupOpen]="popupOpen",$.triggerDisabled="data-trigger-disabled",$}({});var tP=600;var $_=KQ(function(J,Z){let{className:H,render:B,handle:Q,payload:X,disabled:z,delay:G,closeDelay:Y,id:U,...F}=J,K=r4(!0),W=Q?.store??K;if(!W)throw Error(E0(82));let q=t0(U),N=W.useState("isTriggerActive",q),V=W.useState("isOpenedByTrigger",q),L=W.useState("floatingRootContext"),A=eP.useRef(null),M=G??tP,_=Y??0,{registerTrigger:P,isMountedByThisTrigger:D}=u8(q,A,W,{payload:X,closeDelay:_}),w=oP(),{delayRef:R,isInstantPhase:b,hasProvider:E}=DK(L,{open:V});W.useSyncedValue("isInstantPhase",b);let x=W.useState("disabled"),I=z??x,S=W.useState("trackCursorAxis"),j=W.useState("disableHoverablePopup"),C=N8(L,{enabled:!I,mouseOnly:!0,move:!1,handleClose:!j&&S!=="both"?L8():null,restMs(){let T=w?.delay,t=typeof R.current==="object"?R.current.open:void 0,B0=M;if(E)if(t!==0)B0=G??T??M;else B0=0;return B0},delay(){let T=typeof R.current==="object"?R.current.close:void 0,t=_;if(Y==null&&E)t=T;return{close:t}},triggerElementRef:A,isActiveTrigger:N}),k=T$(L,{enabled:!I}).reference,y={open:V},v=W.useState("triggerProps",D);return U0("button",J,{state:y,ref:[Z,P,A],props:[C,k,v,{id:q,[sP.triggerDisabled]:I?"":void 0},F],stateAttributesMapping:n8})});var Z_=O(g(),1);var UX=O(g(),1),dK=UX.createContext(void 0);function J_(){let $=UX.useContext(dK);if($===void 0)throw Error(E0(70));return $}var lK=O(c(),1),H_=Z_.forwardRef(function(J,Z){let{keepMounted:H=!1,...B}=J;if(!(r4().useState("mounted")||H))return null;return lK.jsx(dK.Provider,{value:H,children:lK.jsx(s6,{ref:Z,...B})})});var J7=O(g(),1);var FX=O(g(),1),iK=FX.createContext(void 0);function $7(){let $=FX.useContext(iK);if($===void 0)throw Error(E0(71));return $}var B_=O(c(),1),Q_=J7.forwardRef(function(J,Z){let{render:H,className:B,anchor:Q,positionMethod:X="absolute",side:z="top",align:G="center",sideOffset:Y=0,alignOffset:U=0,collisionBoundary:F="clipping-ancestors",collisionPadding:K=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:V=o8,...L}=J,A=r4(),M=J_(),_=A.useState("open"),P=A.useState("mounted"),D=A.useState("trackCursorAxis"),w=A.useState("disableHoverablePopup"),R=A.useState("floatingRootContext"),b=A.useState("instantType"),E=A.useState("transitionStatus"),x=A.useState("hasViewport"),I=a8({anchor:Q,positionMethod:X,floatingRootContext:R,mounted:P,side:z,sideOffset:Y,align:G,alignOffset:U,collisionBoundary:F,collisionPadding:K,sticky:q,arrowPadding:W,disableAnchorTracking:N,keepMounted:M,collisionAvoidance:V,adaptiveOrigin:x?t6:void 0}),S=J7.useMemo(()=>{let y={};if(!_||D==="both"||w)y.pointerEvents="none";return{role:"presentation",hidden:!P,style:{...I.positionerStyles,...y}}},[_,D,w,P,I.positionerStyles]),j=J7.useMemo(()=>({open:_,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:D!=="none"?"tracking-cursor":b}),[_,I.side,I.align,I.anchorHidden,D,b]),C=J7.useMemo(()=>({...j,arrowRef:I.arrowRef,arrowStyles:I.arrowStyles,arrowUncentered:I.arrowUncentered}),[j,I.arrowRef,I.arrowStyles,I.arrowUncentered]),k=U0("div",J,{state:j,props:[S,F2(E),L],ref:[Z,A.useStateSetter("positionerElement")],stateAttributesMapping:D1});return B_.jsx(iK.Provider,{value:C,children:k})});var X_=O(g(),1);var ll={...D1,...c1},z_=X_.forwardRef(function(J,Z){let{className:H,render:B,...Q}=J,X=r4(),{side:z,align:G}=$7(),Y=X.useState("open"),U=X.useState("instantType"),F=X.useState("transitionStatus"),K=X.useState("popupProps"),W=X.useState("floatingRootContext");b5({open:Y,ref:X.context.popupRef,onComplete(){if(Y)X.context.onOpenChangeComplete?.(!0)}});let q=X.useState("disabled"),N=X.useState("closeDelay");return E9(W,{enabled:!q,closeDelay:N}),U0("div",J,{state:{open:Y,side:z,align:G,instant:U,transitionStatus:F},ref:[Z,X.context.popupRef,X.useStateSetter("popupElement")],props:[K,F2(F),Q],stateAttributesMapping:ll})});var G_=O(g(),1);var Y_=G_.forwardRef(function(J,Z){let{className:H,render:B,...Q}=J,z=r4().useState("instantType"),{open:G,arrowRef:Y,side:U,align:F,arrowUncentered:K,arrowStyles:W}=$7();return U0("div",J,{state:{open:G,side:U,align:F,uncentered:K,instant:z},ref:[Z,Y],props:[{style:W,"aria-hidden":!0},Q],stateAttributesMapping:D1})});var rK=O(g(),1);var aK=O(c(),1),U_=function(J){let{delay:Z,closeDelay:H,timeout:B=400}=J,Q=rK.useMemo(()=>({delay:Z,closeDelay:H}),[Z,H]),X=rK.useMemo(()=>({open:Z,close:H}),[Z,H]);return aK.jsx(cK.Provider,{value:Q,children:aK.jsx(AK,{delay:X,timeoutMs:B,children:J.children})})};var V_=O(g(),1);var F_=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var b2=O(g(),1);var K_=O(g(),1);function W_($){let[J,Z]=K_.useState({current:$,previous:null});if($!==J.current)Z({current:$,previous:J.current});return J.previous}var I$=O(g(),1);function oK($){let J=r6($),Z=parseFloat(J.width)||0,H=parseFloat(J.height)||0,B=P5($),Q=B?$.offsetWidth:Z,X=B?$.offsetHeight:H;if(nK(Z)!==Q||nK(H)!==X)Z=Q,H=X;return{width:Z,height:H}}var il=typeof ResizeObserver<"u",rl=()=>!0;function N_($){let{popupElement:J,positionerElement:Z,content:H,mounted:B,enabled:Q=rl,onMeasureLayout:X,onMeasureLayoutComplete:z,side:G,direction:Y}=$,U=m8(J,!0,!1),F=z4(),K=I$.useRef(null),W=I$.useRef(null),q=I$.useRef(!0),N=I$.useRef(u1),V=K0(X),L=K0(z),A=I$.useMemo(()=>{let M=G==="top",_=G==="left";if(Y==="rtl")M=M||G==="inline-end",_=_||G==="inline-end";else M=M||G==="inline-start",_=_||G==="inline-start";return M?{position:"absolute",[G==="top"?"bottom":"top"]:"0",[_?"right":"left"]:"0"}:k1},[G,Y]);F0(()=>{if(!B||!Q()||!il){N.current=u1,q.current=!0,K.current=null,W.current=null;return}if(!J||!Z)return;N.current=q_(J,A);let M=new ResizeObserver((S)=>{let j=S[0];if(j)W.current={width:Math.ceil(j.borderBoxSize[0].inlineSize),height:Math.ceil(j.borderBoxSize[0].blockSize)}});M.observe(J),KX(J,"auto");let _=WX(J,"position","static"),P=WX(J,"transform","none"),D=WX(J,"scale","1"),w=q_(Z,{"--available-width":"max-content","--available-height":"max-content"});function R(){_(),P(),w()}function b(){R(),D()}if(V?.(),q.current||K.current===null){IZ(Z,"max-content");let S=oK(J);return K.current=S,IZ(Z,S),b(),L?.(null,S),q.current=!1,()=>{M.disconnect(),N.current(),N.current=u1}}KX(J,"auto"),IZ(Z,"max-content");let E=K.current??W.current,x=oK(J);if(K.current=x,!E)return IZ(Z,x),b(),L?.(null,x),()=>{M.disconnect(),F.cancel(),N.current(),N.current=u1};KX(J,E),b(),L?.(E,x),IZ(Z,x);let I=new AbortController;return F.request(()=>{KX(J,x),U(()=>{J.style.setProperty("--popup-width","auto"),J.style.setProperty("--popup-height","auto")},I.signal)}),()=>{M.disconnect(),I.abort(),F.cancel(),N.current(),N.current=u1}},[H,J,Z,U,F,Q,B,V,L,A])}function WX($,J,Z){let H=$.style.getPropertyValue(J);return $.style.setProperty(J,Z),()=>{$.style.setProperty(J,H)}}function q_($,J){let Z=[];for(let[H,B]of Object.entries(J))Z.push(WX($,H,B));return Z.length?()=>{Z.forEach((H)=>H())}:u1}function KX($,J){let Z=J==="auto"?"auto":`${J.width}px`,H=J==="auto"?"auto":`${J.height}px`;$.style.setProperty("--popup-width",Z),$.style.setProperty("--popup-height",H)}function IZ($,J){let Z=J==="max-content"?"max-content":`${J.width}px`,H=J==="max-content"?"max-content":`${J.height}px`;$.style.setProperty("--positioner-width",Z),$.style.setProperty("--positioner-height",H)}var Z7=O(c(),1);function H7($){let{store:J,side:Z,cssVars:H,children:B}=$,Q=l4(),X=J.useState("activeTriggerElement"),z=J.useState("activeTriggerId"),G=J.useState("open"),Y=J.useState("payload"),U=J.useState("mounted"),F=J.useState("popupElement"),K=J.useState("positionerElement"),W=W_(G?X:null),q=ol(z,Y),N=b2.useRef(null),[V,L]=b2.useState(null),[A,M]=b2.useState(null),_=b2.useRef(null),P=b2.useRef(null),D=m8(_,!0,!1),w=z4(),[R,b]=b2.useState(null),[E,x]=b2.useState(!1);F0(()=>{return J.set("hasViewport",!0),()=>{J.set("hasViewport",!1)}},[J]);let I=K0(()=>{_.current?.style.setProperty("animation","none"),_.current?.style.setProperty("transition","none"),P.current?.style.setProperty("display","none")}),S=K0((v)=>{if(_.current?.style.removeProperty("animation"),_.current?.style.removeProperty("transition"),P.current?.style.removeProperty("display"),v)b(v)}),j=b2.useRef(null);F0(()=>{if(X&&W&&X!==W&&j.current!==X&&N.current){L(N.current),x(!0);let v=nl(W,X);M(v),w.request(()=>{w.request(()=>{x(!1),D(()=>{L(null),b(null),N.current=null})})}),j.current=X}},[X,W,V,D,w]),F0(()=>{let v=_.current;if(!v)return;let u=document.createElement("div");for(let T of Array.from(v.childNodes))u.appendChild(T.cloneNode(!0));N.current=u});let C=V!=null,k;if(!C)k=Z7.jsx("div",{"data-current":!0,ref:_,children:B},q);else k=Z7.jsxs(b2.Fragment,{children:[Z7.jsx("div",{"data-previous":!0,inert:v8(!0),ref:P,style:{[H.popupWidth]:`${R?.width}px`,[H.popupHeight]:`${R?.height}px`,position:"absolute"},"data-ending-style":E?void 0:""},"previous"),Z7.jsx("div",{"data-current":!0,ref:_,"data-starting-style":E?"":void 0,children:B},q)]});F0(()=>{let v=P.current;if(!v||!V)return;v.replaceChildren(...Array.from(V.childNodes))},[V]),N_({popupElement:F,positionerElement:K,mounted:U,content:Y,onMeasureLayout:I,onMeasureLayoutComplete:S,side:Z,direction:Q});let y={activationDirection:al(A),transitioning:C};return{children:k,state:y}}function al($){if(!$)return;return`${L_($.horizontal,5,"right","left")} ${L_($.vertical,5,"down","up")}`}function L_($,J,Z,H){if($>J)return Z;if($<-J)return H;return""}function nl($,J){let Z=$.getBoundingClientRect(),H=J.getBoundingClientRect(),B={x:Z.left+Z.width/2,y:Z.top+Z.height/2},Q={x:H.left+H.width/2,y:H.top+H.height/2};return{horizontal:Q.x-B.x,vertical:Q.y-B.y}}function ol($,J){let[Z,H]=b2.useState(0),B=b2.useRef($),Q=b2.useRef(J),X=b2.useRef(!1);return F0(()=>{let z=B.current,G=Q.current,Y=$!==z,U=J!==G;if(Y)H((F)=>F+1),X.current=!U;else if(X.current&&U)H((F)=>F+1),X.current=!1;B.current=$,Q.current=J},[$,J]),`${$??"current"}-${Z}`}var sl={activationDirection:($)=>$?{"data-activation-direction":$}:null},A_=V_.forwardRef(function(J,Z){let{render:H,className:B,children:Q,...X}=J,z=r4(),G=$7(),Y=z.useState("instantType"),{children:U,state:F}=H7({store:z,side:G.side,cssVars:F_,children:Q}),K={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:Y};return U0("div",J,{state:K,ref:Z,props:[X,{children:U}],stateAttributesMapping:sl})});class qX{constructor(){this.store=new e6}open($){let J=$?this.store.context.triggerElements.getById($):void 0;if($&&!J)throw Error(E0(81,$));this.store.setOpen(!0,M0(Y0.imperativeAction,void 0,J))}close(){this.store.setOpen(!1,M0(Y0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function D_(){return new qX}var R$=O(c(),1);function NX({delay:$=100,...J}){return R$.jsx(S9.Provider,{"data-slot":"tooltip-provider",delay:$,...J})}function d1({...$}){return R$.jsx(S9.Root,{"data-slot":"tooltip",...$})}function l1({...$}){return R$.jsx(S9.Trigger,{"data-slot":"tooltip-trigger",...$})}function i1({className:$,side:J="top",sideOffset:Z=6,align:H="center",alignOffset:B=0,children:Q,...X}){return R$.jsx(S9.Portal,{children:R$.jsx(S9.Positioner,{align:H,alignOffset:B,side:J,sideOffset:Z,className:"isolate z-50",children:R$.jsx(S9.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 LX({cooldownMs:$,windowMs:J,maxPerWindow:Z,maxKeys:H=256,now:B=Date.now}){let Q=new Map,X=0,z=0;return{admit(G){let Y=B(),U=Q.get(G);if(U!==void 0&&Y-U<$)return"cooldown";if(Y-X>=J)X=Y,z=0;if(z>=Z)return"window";if(z++,Q.set(G,Y),Q.size>H)for(let F of[...Q.keys()].slice(0,Math.ceil(H/2)))Q.delete(F);return"ok"}}}var tl=LX({cooldownMs:5000,windowMs:60000,maxPerWindow:30});function V8($,J){let Z=[$,J.source,J.kind,J.name,J.message].join("\x00");if(tl.admit(Z)!=="ok")return;fetch(`/api/workspaces/${$}/applet-log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:[J]})}).catch(()=>{})}var el=/\/api\/workspaces\/([^/\s)]+)\/(widgets|views)\/([^/\s)]+)\//;function M_($){if(!$)return null;let J=el.exec($);if(!J)return null;return{workspaceId:J[1],kind:J[2]==="widgets"?"widget":"view",name:J[3]}}var P_=!1;function __(){if(P_)return;P_=!0;let $=(J,Z,H)=>{let B=Z instanceof Error?Z:null,Q=B?.stack??"",X=J??M_(Q);if(!X)return;V8(X.workspaceId,{source:"window",kind:X.kind,name:X.name,message:B?.message||H||String(Z),...Q?{stack:Q}:{}})};window.addEventListener("error",(J)=>$(M_(J.filename),J.error,J.message)),window.addEventListener("unhandledrejection",(J)=>$(null,J.reason))}function B3($,J){return`${$}:${J}`}function B7($){return $==="running"}function T_($){return Object.values($).some(B7)}function RZ($,J,Z){return B7($[B3(J,Z)])}function C_($,J){let Z=`${J}:`;return Object.entries($).some(([H,B])=>H.startsWith(Z)&&B7(B))}function w_($,J,Z){if(!Z)return!1;let H=`${J}:`,B=B3(J,Z);return Object.entries($).some(([Q,X])=>Q.startsWith(H)&&Q!==B&&B7(X))}function o2($,J){return B3($,J??"new")}var E1=O_()(($)=>({activity:{},errors:{},previews:{},attachments:{},setActivity:(J,Z,H)=>$((B)=>({activity:{...B.activity,[B3(J,Z)]:H}})),reconcileActivity:(J)=>$(()=>({activity:Object.fromEntries(J.map((Z)=>[B3(Z.workspaceId,Z.sessionId),Z.activity]))})),setError:(J,Z,H)=>$((B)=>({errors:{...B.errors,[B3(J,Z)]:H}})),setPreview:(J)=>$((Z)=>({previews:{...Z.previews,[J.messageId]:{workspaceId:J.workspaceId,sessionId:J.sessionId,parentToolUseId:J.parentToolUseId,blocks:J.blocks,updatedAt:Date.now()}}})),clearPreview:(J)=>$((Z)=>{if(!(J in Z.previews))return Z;let{[J]:H,...B}=Z.previews;return{previews:B}}),clearPreviewsForSession:(J,Z)=>$((H)=>{let B={},Q=!1;for(let[X,z]of Object.entries(H.previews))if(z.workspaceId===J&&z.sessionId===Z)Q=!0;else B[X]=z;return Q?{previews:B}:H}),clearAllPreviews:()=>$((J)=>Object.keys(J.previews).length?{previews:{}}:J),sweepPreviews:(J,Z)=>$((H)=>{let B={},Q=!1;for(let[X,z]of Object.entries(H.previews))if(Z-z.updatedAt>J)Q=!0;else B[X]=z;return Q?{previews:B}:H}),addAttachments:(J,Z,H)=>$((B)=>{let Q=o2(J,Z);return{attachments:{...B.attachments,[Q]:[...B.attachments[Q]??[],...H]}}}),updateAttachment:(J,Z,H,B)=>$((Q)=>{let X=o2(J,Z),z=Q.attachments[X];if(!z)return{};let G=z.find((Y)=>Y.localId===H);if(G?.previewUrl&&"previewUrl"in B&&B.previewUrl!==G.previewUrl)URL.revokeObjectURL(G.previewUrl);return{attachments:{...Q.attachments,[X]:z.map((Y)=>Y.localId===H?{...Y,...B}:Y)}}}),removeAttachment:(J,Z,H)=>$((B)=>{let Q=o2(J,Z),X=B.attachments[Q];if(!X)return{};let z=X.find((G)=>G.localId===H);if(z?.previewUrl)URL.revokeObjectURL(z.previewUrl);return{attachments:{...B.attachments,[Q]:X.filter((G)=>G.localId!==H)}}}),clearAttachments:(J,Z)=>$((H)=>{let B=o2(J,Z);for(let X of H.attachments[B]??[])if(X.previewUrl)URL.revokeObjectURL(X.previewUrl);let Q={...H.attachments};return delete Q[B],{attachments:Q}}),renameSession:(J,Z,H)=>$((B)=>{let Q=B3(J,Z),X=B3(J,H),z={...B.activity},G={...B.errors};if(Q in z)z[X]=z[Q],delete z[Q];if(Q in G)G[X]=G[Q],delete G[Q];let Y=B.previews,U=!1;for(let[F,K]of Object.entries(B.previews))if(K.workspaceId===J&&K.sessionId===Z){if(!U)Y={...B.previews},U=!0;Y[F]={...K,sessionId:H}}return{activity:z,errors:G,previews:Y}})}));function E_($,J,Z){if(!Z)return{root:null,byParent:{}};let H=null,B={};for(let Q of Object.values($)){if(Q.workspaceId!==J||Q.sessionId!==Z)continue;if(Q.parentToolUseId===null){if(!H||Q.updatedAt>H.updatedAt)H=Q}else{let X=B[Q.parentToolUseId];if(!X||Q.updatedAt>X.updatedAt)B[Q.parentToolUseId]=Q}}return{root:H,byParent:B}}function s2($){return j_(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:($,J)=>["workspaces","events",$,J],sessionConfig:($,J)=>["workspaces","sessionConfig",$,J],mcp:($)=>["workspaces","mcp",$],agent:($)=>["workspaces","agent",$],skills:($)=>["workspaces","skills",$],env:($)=>["workspaces","env",$]};var kZ=O(g(),1);var k$={all:["app-ui"],selectedSession:($)=>["app-ui","selected-session",$]};function $i($){return[...k$.selectedSession($),"save"]}function Ji($,J,Z){let H=k$.selectedSession(J),B=$.getQueryData(H),Q=B?.sessionId??null;if(B&&Q===Z)return null;return $.setQueryData(H,{sessionId:Z}),{sessionId:Z,previousSessionId:Q}}function Zi($,J,Z,H){let B=k$.selectedSession(J),Q=$.getQueryData(B);if(Z.sessionId!==H.sessionId&&Q?.sessionId!==Z.sessionId)return"conflict";if(Q?.sessionId!==H.sessionId&&Q?.sessionId!==H.previousSessionId)return"ignored";return $.setQueryData(B,Z),"applied"}function Hi($,J,Z,H){if(H)return;$.setQueryData(k$.selectedSession(J),{sessionId:Z})}function S_($,J,Z,H){$.setQueryData(k$.selectedSession(J),(B)=>B?.sessionId===Z?{sessionId:H}:B)}function Q3(){let $=Z5(),J=s0(),Z=kZ.useMemo(()=>k$.selectedSession($),[$]),H=kZ.useMemo(()=>$i($),[$]),B=cF({mutationKey:H,exact:!0}),Q=n1({queryKey:Z,queryFn:()=>N1(`/api/workspaces/${$}/selected-session`),staleTime:1/0,gcTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}),{mutate:X}=o1({mutationKey:H,scope:{id:`selected-session:${$}`},mutationFn:(Y)=>N1(`/api/workspaces/${$}/selected-session`,a5("PUT",Y),"Couldn’t save selected chat"),onSuccess:(Y,U)=>{if(Zi(J,$,Y,U)!=="conflict")return;i4.add({title:"Couldn’t save selected chat",type:"error"}),J.invalidateQueries({queryKey:Z})},onError:(Y,U)=>{if(J.getQueryData(Z)?.sessionId!==U.sessionId)return;i4.add({title:"Couldn’t save selected chat",type:"error"}),J.invalidateQueries({queryKey:Z})}}),z=kZ.useCallback((Y)=>{let U=Ji(J,$,Y);if(U)X(U)},[J,X,$]);return Z2((Y)=>{if(Y.type!=="selected-session:updated"||Y.workspaceId!==$)return;Hi(J,$,Y.sessionId,B>0)}),[Q.isLoading?void 0:Q.data?.sessionId??null,z]}function bZ(){return{turns:[],notices:[]}}function yZ($,J){switch(J.kind){case"snapshot":return{...$,snapshot:J.snapshot};case"turn":{let Z=$.turns.findIndex((B)=>B.id===J.turn.id);if(Z>=0)return{...$,turns:$.turns.map((B,Q)=>Q===Z?J.turn:B)};if(J.turn.seq===void 0)return{...$,turns:[...$.turns,J.turn]};let H=$.turns.findIndex((B)=>B.seq!==void 0&&B.seq>J.turn.seq);if(H<0)return{...$,turns:[...$.turns,J.turn]};return{...$,turns:[...$.turns.slice(0,H),J.turn,...$.turns.slice(H)]}}case"notice":{if($.notices.some((Z)=>Z.id===J.notice.id))return{...$,notices:$.notices.map((Z)=>Z.id===J.notice.id?J.notice:Z)};return{...$,notices:[...$.notices,J.notice]}}case"result":return{...$,result:J.result}}}function I_($){return $.reduce(yZ,bZ())}function k_($,J){let{queryClient:Z,sendMessage:H,onWorkspaceSwitch:B}=J,Q=E1.getState();if($.type==="status_snapshot"){Q.reconcileActivity($.sessions??[]);return}if($.type==="status"){let{workspaceId:Y,sessionId:U,activity:F}=$;if(Q.setActivity(Y,U,F),F!=="running")Q.clearPreviewsForSession(Y,U);return}if($.type==="preview"){let Y=$,U=w0.events(Y.workspaceId,Y.sessionId);if(Z?.getQueryData(U)===void 0)return;Q.setPreview({workspaceId:Y.workspaceId,sessionId:Y.sessionId,messageId:Y.messageId,parentToolUseId:Y.parentToolUseId,blocks:Y.blocks});return}if($.type==="session_renamed"){let{workspaceId:Y,from:U,to:F}=$,K=w0.sessions(Y),q=Z?.getQueryData(K)?.find((L)=>L.sessionId===U||L.sessionId===F);if(q)Z?.cancelQueries({queryKey:K});if(Q.renameSession(Y,U,F),Z)S_(Z,Y,U,F);if(q)Z?.setQueryData(K,(L)=>[{...q,sessionId:F},...(L??[]).filter((A)=>A.sessionId!==U&&A.sessionId!==F)]);let N=Z?.getQueryData(w0.events(Y,U));if(N!==void 0)Z?.setQueryData(w0.events(Y,F),N),Z?.removeQueries({queryKey:w0.events(Y,U)});let V=Z?.getQueryData(w0.sessionConfig(Y,U));if(V!==void 0)Z?.setQueryData(w0.sessionConfig(Y,F),V),Z?.removeQueries({queryKey:w0.sessionConfig(Y,U)});if(!q)Z?.invalidateQueries({queryKey:K});Z?.invalidateQueries({queryKey:w0.preview(Y)});return}if($.type==="sessions_changed"){let Y=$.workspaceId,U=w0.sessions(Y);Z?.invalidateQueries({queryKey:U}),Z?.invalidateQueries({queryKey:w0.preview(Y)});return}if($.type==="workspace:switch"){B?.($.workspaceId);return}if($.type==="scratchpad:op"){let Y=R_($.workspaceId);if(!Y)return;let U=$.opId;Y($.op).then((F)=>H({type:"scratchpad:op-result",opId:U,result:F}),(F)=>H({type:"scratchpad:op-result",opId:U,error:F instanceof Error?F.message:String(F)}));return}let{workspaceId:X,sessionId:z}=$;if(!X||!z)return;let G=$.kind;if(G==="snapshot"||G==="turn"||G==="notice"||G==="result"){if(Bi(Z,X,z,$),G==="turn"){let Y=$.turn?.meta?.apiMessageId;if(Y)Q.clearPreview(Y)}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 Bi($,J,Z,H){let B=w0.events(J,Z),Q=$?.getQueryData(B);if(Q===void 0)return;$?.setQueryData(B,yZ(Q,H))}var tK=null,Q7=null,VX=0,AX=null,sK=[],h_=null,b_=null,Qi=15000;function x_($){if(tK=$,!b_)b_=setInterval(()=>E1.getState().sweepPreviews(Qi,Date.now()),5000);if(Q7)return;v_()}function v_(){let $=++VX;if(AX)clearTimeout(AX),AX=null;let J=new WebSocket(y_("/ws"));Q7=J,J.onopen=()=>{if(VX!==$){J.close();return}for(let Z of sK)J.send(JSON.stringify(Z));sK.length=0,tK?.invalidateQueries({queryKey:["workspaces","events"]}),E1.getState().clearAllPreviews()},J.onmessage=(Z)=>{if(VX!==$)return;let H;try{H=JSON.parse(Z.data)}catch{return}Xi(H)},J.onclose=()=>{if(VX!==$)return;Q7=null,AX=setTimeout(v_,1000)},J.onerror=()=>J.close()}function Xi($){k_($,{queryClient:tK,sendMessage:DX,onWorkspaceSwitch:h_})}function DX($){if(Q7&&Q7.readyState===WebSocket.OPEN)Q7.send(JSON.stringify($));else sK.push($)}function eK($){h_=$}var CF=O(g(),1);var zi=($)=>g_()(m_((J)=>({discoveredWorkspacesOpen:!0,hasSentMessageFromMoi:!1,workspaceIdsPendingAnalysis:[],composerDrafts:{},viewBuilderDrafts:{},dockedChatWidth:360,setDiscoveredWorkspacesOpen:(Z)=>J({discoveredWorkspacesOpen:Z}),markWorkspacePendingAnalysis:(Z)=>J((H)=>{let B=H.workspaceIdsPendingAnalysis??[];return{workspaceIdsPendingAnalysis:B.includes(Z)?B:[...B,Z]}}),markMessageSentFromMoi:(Z)=>J((H)=>({hasSentMessageFromMoi:!0,workspaceIdsPendingAnalysis:(H.workspaceIdsPendingAnalysis??[]).filter((B)=>B!==Z)})),setComposerDraft:(Z,H)=>J((B)=>{let Q={...B.composerDrafts??{}};if(H)Q[Z]=H;else delete Q[Z];return{composerDrafts:Q}}),setViewBuilderDraft:(Z,H)=>J((B)=>{let Q=B.viewBuilderDrafts??{};if(H===null){if(!(Z in Q))return B;let X={...Q};return delete X[Z],{viewBuilderDrafts:X}}if(Q[Z]===H)return B;return{viewBuilderDrafts:{...Q,[Z]:H}}}),setDockedChatWidth:(Z)=>J({dockedChatWidth:Z})}),$?{name:"moi:ui",storage:f_(()=>$)}:{name:"moi:ui"})),_5=zi();function p_($,J){let Z=$??[],H=Z.findIndex((B)=>B.id===J.id||B.path===J.path);if(H===-1)return[J,...Z];return Z.map((B,Q)=>Q===H?{...B,...J}:B)}function MX(){return n1({queryKey:w0.all,queryFn:()=>N1("/api/workspaces"),staleTime:1/0,refetchOnMount:"always"})}function PX($){return n1({queryKey:w0.preview($),queryFn:()=>N1(`/api/workspaces/${$}/preview`),staleTime:60000})}function u_(){return n1({queryKey:w0.discover,queryFn:()=>N1("/api/workspaces/discover")})}function c_(){let $=s0();return o1({mutationFn:(J)=>N1("/api/workspaces",a5("POST",J),"Failed to add workspace"),onSuccess:(J,Z)=>{_5.getState().markWorkspacePendingAnalysis(J.id),$.setQueryData(w0.all,(H)=>p_(H,J)),$.setQueryData(w0.discover,(H)=>(H??[]).filter((B)=>B.path!==Z.path))}})}function _X(){return n1({queryKey:w0.setupInfo,queryFn:()=>N1("/api/workspaces/create"),staleTime:30000,refetchOnMount:"always"})}function d_(){let $=s0();return o1({mutationFn:(J)=>N1("/api/workspaces/create",a5("POST",J),"Failed to create workspace"),onSuccess:(J)=>{$.setQueryData(w0.all,(Z)=>p_(Z,J))}})}function l_(){let $=s0();return o1({mutationFn:(J)=>N1("/api/workspaces/order",a5("PUT",{ids:J}),"Failed to reorder spaces"),onMutate:async(J)=>{await $.cancelQueries({queryKey:w0.all,exact:!0});let Z=$.getQueryData(w0.all);if(Z){let H=new Map(Z.map((Q)=>[Q.id,Q])),B=J.map((Q)=>H.get(Q)).filter((Q)=>Boolean(Q));if(B.length===Z.length)$.setQueryData(w0.all,B)}return{previous:Z}},onError:(J,Z,H)=>{if(H?.previous)$.setQueryData(w0.all,H.previous);$.invalidateQueries({queryKey:w0.all,exact:!0})},onSuccess:(J)=>{$.setQueryData(w0.all,J)}})}function i_(){let $=s0();return o1({mutationFn:(J)=>w4(`/api/workspaces/${J}`,{method:"DELETE"},"Failed to remove workspace"),onSuccess:(J,Z)=>{$.setQueryData(w0.all,(H)=>(H??[]).filter((B)=>B.id!==Z)),$.invalidateQueries({queryKey:w0.discover})}})}var t_=O(g(),1);var r_=O(c(),1);function E4({className:$,...J}){return r_.jsx(E5,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:s("size-4 animate-spin",$),stroke:1.75,...J})}var $W="Wait for active agents to finish, or stop them before updating moi";var Gi=["update"],a_=300000,Yi=1000;function n_($){return n1({queryKey:Gi,queryFn:()=>N1("/api/update"),staleTime:a_,refetchInterval:$?Yi:a_,refetchOnWindowFocus:!0,retry:!1})}function o_(){return o1({mutationFn:()=>N1("/api/update",{method:"POST"},"Could not update moi")})}var I9=O(c(),1);function Ui($,J){return!!J&&$?.runningVersion===J}function Fi($,J,Z){let H=J||Z,B=$&&!H;return{busy:H,blocked:B,label:J?"Updating":Z?"Restarting":B?$W:"Update"}}function e_(){let $=o_(),J=n_($.isSuccess),Z=s2((z)=>T_(z.activity)),H=J.data,B=$.data?.installedVersion??null;if(t_.useEffect(()=>{if(Ui(H,B))window.location.reload()},[B,H]),!H?.availableVersion)return null;let Q=$.isSuccess,X=Fi(Z,$.isPending,Q);return I9.jsxs(d1,{children:[I9.jsx(l1,{render:I9.jsx("div",{children:I9.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?I9.jsx(E4,{stroke:1.5}):I9.jsx(s_,{stroke:1.5})})})}),I9.jsx(i1,{side:"right",className:X.blocked?"max-w-56":void 0,children:X.blocked?$W:$.error?.message??X.label})]})}var rZ=O(g(),1);var A8={};_4(A8,{createHandle:()=>SO,Viewport:()=>TO,Trigger:()=>EO,Title:()=>wO,Root:()=>OO,Portal:()=>qO,Popup:()=>UO,Handle:()=>SX,Description:()=>QO,Close:()=>HO,Backdrop:()=>JO});var $O=O(g(),1);var OX=O(g(),1),JW=OX.createContext(void 0);function K2($){let J=OX.useContext(JW);if($===!1&&J===void 0)throw Error(E0(27));return J}var Ki={...D1,...c1},JO=$O.forwardRef(function(J,Z){let{render:H,className:B,forceRender:Q=!1,...X}=J,{store:z}=K2(),G=z.useState("open"),Y=z.useState("nested"),U=z.useState("mounted"),F=z.useState("transitionStatus");return U0("div",J,{state:{open:G,transitionStatus:F},ref:[z.context.backdropRef,Z],stateAttributesMapping:Ki,props:[{role:"presentation",hidden:!U,style:{userSelect:"none",WebkitUserSelect:"none"}},X],enabled:Q||!Y})});var ZO=O(g(),1);var HO=ZO.forwardRef(function(J,Z){let{render:H,className:B,disabled:Q=!1,nativeButton:X=!0,...z}=J,{store:G}=K2(),Y=G.useState("open");function U(q){if(Y)G.setOpen(!1,M0(Y0.closePress,q.nativeEvent))}let{getButtonProps:F,buttonRef:K}=p5({disabled:Q,native:X});return U0("button",J,{state:{disabled:Q},ref:[Z,K],props:[{onClick:U},z,F]})});var BO=O(g(),1);var QO=BO.forwardRef(function(J,Z){let{render:H,className:B,id:Q,...X}=J,{store:z}=K2(),G=t0(Q);return z.useSyncedValueWithCleanup("descriptionElementId",G),U0("p",J,{ref:Z,props:[{id:G},X]})});var GO=O(g(),1);var XO=function($){return $.nestedDialogs="--nested-dialogs",$}({});var zO=function($){return $[$.open=C4.open]="open",$[$.closed=C4.closed]="closed",$[$.startingStyle=C4.startingStyle]="startingStyle",$[$.endingStyle=C4.endingStyle]="endingStyle",$.nested="data-nested",$.nestedDialogOpen="data-nested-dialog-open",$}({});var jX=O(g(),1),ZW=jX.createContext(void 0);function TX(){let $=jX.useContext(ZW);if($===void 0)throw Error(E0(26));return $}var hZ="ArrowUp",xZ="ArrowDown",vZ="ArrowLeft",gZ="ArrowRight",fZ="Home",mZ="End",Wi=new Set([vZ,gZ]);var qi=new Set([hZ,xZ]);var Ni=new Set([...Wi,...qi]),aV0=new Set([...Ni,fZ,mZ]),X3=new Set([hZ,xZ,vZ,gZ,fZ,mZ]);var YO=O(c(),1),Li={...D1,...c1,nestedDialogOpen($){return $?{[zO.nestedDialogOpen]:""}:null}},UO=GO.forwardRef(function(J,Z){let{className:H,finalFocus:B,initialFocus:Q,render:X,...z}=J,{store:G}=K2(),Y=G.useState("descriptionElementId"),U=G.useState("disablePointerDismissal"),F=G.useState("floatingRootContext"),K=G.useState("popupProps"),W=G.useState("modal"),q=G.useState("mounted"),N=G.useState("nested"),V=G.useState("nestedOpenDialogCount"),L=G.useState("open"),A=G.useState("openMethod"),M=G.useState("titleElementId"),_=G.useState("transitionStatus"),P=G.useState("role");TX(),b5({open:L,ref:G.context.popupRef,onComplete(){if(L)G.context.onOpenChangeComplete?.(!0)}});function D(x){if(x==="touch")return G.context.popupRef.current;return!0}let w=Q===void 0?D:Q,R=V>0,E=U0("div",J,{state:{open:L,nested:N,transitionStatus:_,nestedDialogOpen:R},props:[K,{"aria-labelledby":M??void 0,"aria-describedby":Y??void 0,role:P,tabIndex:-1,hidden:!q,onKeyDown(x){if(X3.has(x.key))x.stopPropagation()},style:{[XO.nestedDialogs]:V}},z],ref:[Z,G.context.popupRef,G.useStateSetter("popupElement")],stateAttributesMapping:Li});return YO.jsx(O$,{context:F,openInteractionType:A,disabled:!q,closeOnFocusOut:!U,initialFocus:w,returnFocus:B,modal:W!==!1,restoreFocus:"popup",children:E})});var WO=O(g(),1);var FO=O(g(),1),KO=O(c(),1),X7=FO.forwardRef(function(J,Z){let{cutout:H,...B}=J,Q;if(H){let X=H?.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 KO.jsx("div",{ref:Z,role:"presentation","data-base-ui-inert":"",...B,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:Q}})});var pZ=O(c(),1),qO=WO.forwardRef(function(J,Z){let{keepMounted:H=!1,...B}=J,{store:Q}=K2(),X=Q.useState("mounted"),z=Q.useState("modal"),G=Q.useState("open");if(!(X||H))return null;return pZ.jsx(ZW.Provider,{value:H,children:pZ.jsxs(_$,{ref:Z,...B,children:[X&&z===!0&&pZ.jsx(X7,{ref:Q.context.internalBackdropRef,inert:v8(!G)}),J.children]})})});var PO=O(g(),1);var a4=O(g(),1);var NO={},LO={},VO="";function Vi($){if(typeof document>"u")return!1;let J=m0($);return E2(J).innerWidth-J.documentElement.clientWidth>0}function Ai($){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let Z=m0($),H=Z.documentElement,B=Z.body,Q=CX(H)?H:B,X=Q.style.overflowY,z=H.style.scrollbarGutter;H.style.scrollbarGutter="stable",Q.style.overflowY="scroll";let G=Q.offsetWidth;Q.style.overflowY="hidden";let Y=Q.offsetWidth;return Q.style.overflowY=X,H.style.scrollbarGutter=z,G===Y}function Di($){let J=m0($),Z=J.documentElement,H=J.body,B=CX(Z)?Z:H,Q={overflowY:B.style.overflowY,overflowX:B.style.overflowX};return Object.assign(B.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(B.style,Q)}}function Mi($){let J=m0($),Z=J.documentElement,H=J.body,B=E2(Z),Q=0,X=0,z=!1,G=W5.create();if(MQ&&(B.visualViewport?.scale??1)!==1)return()=>{};function Y(){let K=B.getComputedStyle(Z),W=B.getComputedStyle(H),V=(K.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";Q=Z.scrollTop,X=Z.scrollLeft,NO={scrollbarGutter:Z.style.scrollbarGutter,overflowY:Z.style.overflowY,overflowX:Z.style.overflowX},VO=Z.style.scrollBehavior,LO={position:H.style.position,height:H.style.height,width:H.style.width,boxSizing:H.style.boxSizing,overflowY:H.style.overflowY,overflowX:H.style.overflowX,scrollBehavior:H.style.scrollBehavior};let L=Z.scrollHeight>Z.clientHeight,A=Z.scrollWidth>Z.clientWidth,M=K.overflowY==="scroll"||W.overflowY==="scroll",_=K.overflowX==="scroll"||W.overflowX==="scroll",P=Math.max(0,B.innerWidth-H.clientWidth),D=Math.max(0,B.innerHeight-H.clientHeight),w=parseFloat(W.marginTop)+parseFloat(W.marginBottom),R=parseFloat(W.marginLeft)+parseFloat(W.marginRight),b=CX(Z)?Z:H;if(z=Ai($),z){Z.style.scrollbarGutter=V,b.style.overflowY="hidden",b.style.overflowX="hidden";return}if(Object.assign(Z.style,{scrollbarGutter:V,overflowY:"hidden",overflowX:"hidden"}),L||M)Z.style.overflowY="scroll";if(A||_)Z.style.overflowX="scroll";Object.assign(H.style,{position:"relative",height:w||D?`calc(100dvh - ${w+D}px)`:"100dvh",width:R||P?`calc(100vw - ${R+P}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),H.scrollTop=Q,H.scrollLeft=X,Z.setAttribute("data-base-ui-scroll-locked",""),Z.style.scrollBehavior="unset"}function U(){if(Object.assign(Z.style,NO),Object.assign(H.style,LO),!z)Z.scrollTop=Q,Z.scrollLeft=X,Z.removeAttribute("data-base-ui-scroll-locked"),Z.style.scrollBehavior=VO}function F(){U(),G.request(Y)}return Y(),B.addEventListener("resize",F),()=>{if(G.cancel(),U(),typeof B.removeEventListener==="function")B.removeEventListener("resize",F)}}class AO{lockCount=0;restore=null;timeoutLock=i5.create();timeoutUnlock=i5.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 Z=m0($).documentElement,H=E2(Z).getComputedStyle(Z).overflowY;if(H==="hidden"||H==="clip"){this.restore=u1;return}let B=PQ||!Vi($);this.restore=B?Di($):Mi($)}}var Pi=new AO;function z7($=!0,J=null){F0(()=>{if(!$)return;return Pi.acquire(J)},[$,J])}var G7=O(g(),1);var uZ=O(g(),1);function DO($){let J=uZ.useRef(""),Z=uZ.useCallback((B)=>{if(B.defaultPrevented)return;J.current=B.pointerType,$(B,B.pointerType)},[$]);return{onClick:uZ.useCallback((B)=>{if(B.detail===0){$(B,"keyboard");return}if("pointerType"in B)$(B,B.pointerType);else $(B,J.current);J.current=""},[$]),onPointerDown:Z}}function Y7($){let[J,Z]=G7.useState(null),H=K0((z,G)=>{if(!$)Z(G||(PQ?"touch":""))}),B=G7.useCallback(()=>{Z(null)},[]),{onClick:Q,onPointerDown:X}=DO(H);return G7.useMemo(()=>({openMethod:J,reset:B,triggerProps:{onClick:Q,onPointerDown:X}}),[J,B,Q,X])}function MO($){let{store:J,parentContext:Z,actionsRef:H}=$,B=J.useState("open"),Q=J.useState("disablePointerDismissal"),X=J.useState("modal"),z=J.useState("popupElement"),{openMethod:G,triggerProps:Y,reset:U}=Y7(B);c8(J);let{forceUnmount:F}=d8(B,J,()=>{U()}),K=K0((E)=>{let x=M0(E);return x.preventUnmountOnClose=()=>{J.set("preventUnmountingOnClose",!0)},x}),W=a4.useCallback(()=>{J.setOpen(!1,K(Y0.imperativeAction))},[J,K]);a4.useImperativeHandle(H,()=>({unmount:F,close:W}),[F,W]);let q=q8({popupStore:J,onOpenChange:J.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[N,V]=a4.useState(0),L=N===0,A=E$(q),M=W8(q,{outsidePressEvent(){if(J.context.internalBackdropRef.current||J.context.backdropRef.current)return"intentional";return{mouse:X==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(E){if(!J.context.outsidePressEnabledRef.current)return!1;if("button"in E&&E.button!==0)return!1;if("touches"in E&&E.touches.length!==1)return!1;let x=y1(E);if(L&&!Q){let I=x;if(X)return J.context.internalBackdropRef.current||J.context.backdropRef.current?J.context.internalBackdropRef.current===I||J.context.backdropRef.current===I||f0(I,z)&&!I?.hasAttribute("data-base-ui-portal"):!0;return!0}return!1},escapeKey:L});z7(B&&X===!0,z);let{getReferenceProps:_,getFloatingProps:P,getTriggerProps:D}=$2([A,M]);J.useContextCallback("onNestedDialogOpen",(E)=>{V(E+1)}),J.useContextCallback("onNestedDialogClose",()=>{V(0)}),a4.useEffect(()=>{if(Z?.onNestedDialogOpen&&B)Z.onNestedDialogOpen(N);if(Z?.onNestedDialogClose&&!B)Z.onNestedDialogClose();return()=>{if(Z?.onNestedDialogClose&&B)Z.onNestedDialogClose()}},[B,Z,N]);let w=a4.useMemo(()=>_(Y),[_,Y]),R=a4.useMemo(()=>D(Y),[D,Y]),b=a4.useMemo(()=>P(),[P]);J.useSyncedValues({openMethod:G,activeTriggerProps:w,inactiveTriggerProps:R,popupProps:b,floatingRootContext:q,nestedOpenDialogCount:N})}var wX=O(g(),1);var _i={...i8,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 cZ extends i2{constructor($){super(Oi($),{popupRef:wX.createRef(),backdropRef:wX.createRef(),internalBackdropRef:wX.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new a2,onOpenChange:void 0,onOpenChangeComplete:void 0},_i)}setOpen=($,J)=>{if(J.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!$&&J.trigger==null&&this.state.activeTriggerId!=null)J.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.($,J),J.isCanceled)return;let Z={open:$,nativeEvent:J.event,reason:J.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",Z);let H={open:$},B=J.trigger?.id??null;if(B||$)H.activeTriggerId=B,H.activeTriggerElement=J.trigger??null;this.update(H)}}function Oi($={}){return{...l8(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...$}}var _O=O(c(),1);function OO($){let{children:J,open:Z,defaultOpen:H=!1,onOpenChange:B,onOpenChangeComplete:Q,disablePointerDismissal:X=!1,modal:z=!0,actionsRef:G,handle:Y,triggerId:U,defaultTriggerId:F=null}=$,K=K2(!0),W=Boolean(K),q=R1(()=>{return Y?.store??new cZ({open:H,openProp:Z,activeTriggerId:F,triggerIdProp:U,modal:z,disablePointerDismissal:X,nested:W})}).current;s8(()=>{if(Z===void 0&&q.state.open===!1&&H===!0)q.update({open:!0,activeTriggerId:F})}),q.useControlledProp("openProp",Z),q.useControlledProp("triggerIdProp",U),q.useSyncedValues({disablePointerDismissal:X,nested:W,modal:z}),q.useContextCallback("onOpenChange",B),q.useContextCallback("onOpenChangeComplete",Q);let N=q.useState("payload");MO({store:q,actionsRef:G,parentContext:K?.store.context,onOpenChange:B,triggerIdProp:U});let V=PO.useMemo(()=>({store:q}),[q]);return _O.jsx(JW.Provider,{value:V,children:typeof J==="function"?J({payload:N}):J})}var jO=O(g(),1);var HW=function($){return $[$.open=C4.open]="open",$[$.closed=C4.closed]="closed",$[$.startingStyle=C4.startingStyle]="startingStyle",$[$.endingStyle=C4.endingStyle]="endingStyle",$.nested="data-nested",$.nestedDialogOpen="data-nested-dialog-open",$}({});var ji={...D1,...c1,nested($){return $?{[HW.nested]:""}:null},nestedDialogOpen($){return $?{[HW.nestedDialogOpen]:""}:null}},TO=jO.forwardRef(function(J,Z){let{className:H,render:B,children:Q,...X}=J,z=TX(),{store:G}=K2(),Y=G.useState("open"),U=G.useState("nested"),F=G.useState("transitionStatus"),K=G.useState("nestedOpenDialogCount"),W=G.useState("mounted"),q=K>0;return U0("div",J,{enabled:z||W,state:{open:Y,nested:U,transitionStatus:F,nestedDialogOpen:q},ref:[Z,G.useStateSetter("viewportElement")],stateAttributesMapping:ji,props:[{role:"presentation",hidden:!W,style:{pointerEvents:!Y?"none":void 0},children:Q},X]})});var CO=O(g(),1);var wO=CO.forwardRef(function(J,Z){let{render:H,className:B,id:Q,...X}=J,{store:z}=K2(),G=t0(Q);return z.useSyncedValueWithCleanup("titleElementId",G),U0("h2",J,{ref:Z,props:[{id:G},X]})});var EX=O(g(),1);var EO=EX.forwardRef(function(J,Z){let{render:H,className:B,disabled:Q=!1,nativeButton:X=!0,id:z,payload:G,handle:Y,...U}=J,F=K2(!0),K=Y?.store??F?.store;if(!K)throw Error(E0(79));let W=t0(z),q=K.useState("floatingRootContext"),N=K.useState("isOpenedByTrigger",W),V=EX.useRef(null),{registerTrigger:L,isMountedByThisTrigger:A}=u8(W,V,K,{payload:G}),{getButtonProps:M,buttonRef:_}=p5({disabled:Q,native:X}),P=w9(q,{enabled:q!=null}),D=$2([P]),w={disabled:Q,open:N},R=K.useState("triggerProps",A);return U0("button",J,{state:w,ref:[_,Z,L,V],props:[D.getReferenceProps(),R,{[a6]:"",id:W},U,M],stateAttributesMapping:n8})});class SX{constructor($){this.store=$??new cZ}open($){let J=$?this.store.context.triggerElements.getById($):void 0;this.store.setOpen(!0,M0(Y0.imperativeAction,void 0,J))}openWithPayload($){this.store.set("payload",$),this.store.setOpen(!0,M0(Y0.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,M0(Y0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function SO(){return new SX}var e8=O(c(),1);function z3({...$}){return e8.jsx(A8.Root,{"data-slot":"dialog",...$})}function IX({...$}){return e8.jsx(A8.Trigger,{"data-slot":"dialog-trigger",...$})}function U7({...$}){return e8.jsx(A8.Close,{"data-slot":"dialog-close",...$})}function F7({className:$,children:J,...Z}){return e8.jsxs(A8.Portal,{children:[e8.jsx(A8.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"}),e8.jsx(A8.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",$),...Z,children:J})]})}function G3({className:$,...J}){return e8.jsx(A8.Title,{"data-slot":"dialog-title",className:s("text-lg font-semibold",$),...J})}function K7({className:$,...J}){return e8.jsx(A8.Description,{"data-slot":"dialog-description",className:s("text-sm text-muted-foreground",$),...J})}var lO=O(g(),1);var pX={};_4(pX,{Validity:()=>pO,Root:()=>bO,Label:()=>yO,Item:()=>dO,Error:()=>hO,Description:()=>vO,Control:()=>fO});var q2=O(g(),1);var RX=O(g(),1);var BW=function($){return $.disabled="data-disabled",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.filled="data-filled",$.focused="data-focused",$}({});var b$={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},y2={valid($){if($===null)return null;if($)return{[BW.valid]:""};return{[BW.invalid]:""}}};var QW=RX.createContext({invalid:void 0,name:void 0,validityData:{state:b$,errors:[],error:"",value:"",initialValue:null},setValidityData:u1,disabled:void 0,touched:!1,setTouched:u1,dirty:!1,setDirty:u1,filled:!1,setFilled:u1,focused:!1,setFocused:u1,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:($=k1)=>$,getInputValidationProps:($=k1)=>$,inputRef:{current:null},commit:async()=>{}}});function y5($=!0){let J=RX.useContext(QW);if(J.setValidityData===u1&&!$)throw Error(E0(28));return J}var kX=O(g(),1),Ti=kX.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function IO($=!1){let J=kX.useContext(Ti);if(!J&&!$)throw Error(E0(86));return J}var bX=O(g(),1);var Ci=bX.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:u1,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function n4(){return bX.useContext(Ci)}var Y3=O(g(),1);var yX=O(g(),1);var XW=yX.createContext({controlId:void 0,registerControlId:u1,labelId:void 0,setLabelId:u1,messageIds:[],setMessageIds:u1,getDescriptionProps:($)=>$});function W2(){return yX.useContext(XW)}var RO=O(c(),1),hX=function(J){let Z=t0(),[H,B]=Y3.useState(J.initialControlId===void 0?Z:J.initialControlId),[Q,X]=Y3.useState(void 0),[z,G]=Y3.useState([]),Y=R1(()=>new Map),{messageIds:U}=W2(),F=K0((q,N)=>{let V=Y.current;if(N===void 0){V.delete(q);return}V.set(q,N),B((L)=>{if(V.size===0)return;let A;for(let M of V.values()){if(L!==void 0&&M===L)return L;if(A===void 0)A=M}return A})}),K=Y3.useCallback((q)=>{return U4({"aria-describedby":U.concat(z).join(" ")||void 0},q)},[U,z]),W=Y3.useMemo(()=>({controlId:H,registerControlId:F,labelId:Q,setLabelId:X,messageIds:z,setMessageIds:G,getDescriptionProps:K}),[H,F,Q,X,z,G,K]);return RO.jsx(XW.Provider,{value:W,children:J.children})};var h$=O(g(),1);function y$($,J){return{...$,state:{...$.state,valid:!J&&$.state.valid}}}var xX=Object.keys(b$);function wi($){if(!$||$.valid||!$.valueMissing)return!1;let J=!1;for(let Z of xX){if(Z==="valid")continue;if(Z==="valueMissing")J=$[Z];if($[Z])J=!1}return J}function kO($){let{formRef:J,clearErrors:Z}=n4(),{setValidityData:H,validate:B,validityData:Q,validationDebounceTime:X,invalid:z,markedDirtyRef:G,state:Y,name:U,shouldValidateOnChange:F}=$,{controlId:K,getDescriptionProps:W}=W2(),q=M5(),N=h$.useRef(null),V=K0(async(M,_=!1)=>{let P=N.current;if(!P)return;if(_){if(Y.valid!==!1)return;let S=P.validity;if(!S.valueMissing){let C={value:M,state:{...b$,valid:!0},error:"",errors:[],initialValue:Q.initialValue};if(P.setCustomValidity(""),K){let k=J.current.fields.get(K);if(k)J.current.fields.set(K,{...k,...y$(C,!1)})}H(C);return}let j=xX.reduce((C,k)=>{return C[k]=S[k],C},{});if(!j.valid&&!wi(j))return}function D(S){let j=xX.reduce((k,y)=>{return k[y]=S.validity[y],k},{}),C=!1;for(let k of xX){if(k==="valid")continue;if(k==="valueMissing"&&j[k])C=!0;else if(j[k])return j}if(C&&!G.current)j.valid=!0,j.valueMissing=!1;return j}q.clear();let w=null,R=[],b=D(P),E,x=F();if(P.validationMessage&&!x)E=P.validationMessage,R=[P.validationMessage];else{let S=Array.from(J.current.fields.values()).reduce((C,k)=>{if(k.name)C[k.name]=k.getValue();return C},{}),j=B(M,S);if(typeof j==="object"&&j!==null&&"then"in j)w=await j;else w=j;if(w!==null){if(b.valid=!1,b.customError=!0,Array.isArray(w))R=w,P.setCustomValidity(w.join(`
|
|
24
|
+
`));else if(w)R=[w],P.setCustomValidity(w)}else if(x){if(P.setCustomValidity(""),b.customError=!1,P.validationMessage)E=P.validationMessage,R=[P.validationMessage];else if(P.validity.valid&&!b.valid)b.valid=!0}}let I={value:M,state:b,error:E??(Array.isArray(w)?w[0]:w??""),errors:R,initialValue:Q.initialValue};if(K){let S=J.current.fields.get(K);if(S)J.current.fields.set(K,{...S,...y$(I,z)})}H(I)}),L=h$.useCallback((M={})=>U4(W,Y.valid===!1?{"aria-invalid":!0}:k1,M),[W,Y.valid]),A=h$.useCallback((M={})=>U4({onChange(_){if(_.nativeEvent.defaultPrevented)return;if(Z(U),!F()){V(_.currentTarget.value,!0);return}if(z)return;let P=_.currentTarget;if(P.value===""){V(P.value);return}if(q.clear(),X)q.start(X,()=>{V(P.value)});else V(P.value)}},L(M)),[L,Z,U,q,V,z,X,F]);return h$.useMemo(()=>({getValidationProps:L,getInputValidationProps:A,inputRef:N,commit:V}),[L,A,V])}var vX=O(c(),1),Ei=q2.forwardRef(function(J,Z){let{errors:H,validationMode:B,submitAttemptedRef:Q}=n4(),{render:X,className:z,validate:G,validationDebounceTime:Y=0,validationMode:U=B,name:F,disabled:K=!1,invalid:W,dirty:q,touched:N,actionsRef:V,...L}=J,{disabled:A}=IO(),M=K0(G||(()=>null)),_=A||K,[P,D]=q2.useState(!1),[w,R]=q2.useState(!1),[b,E]=q2.useState(!1),[x,I]=q2.useState(!1),S=q??w,j=N??P,C=q2.useRef(!1),k=K0((W0)=>{if(q!==void 0)return;if(W0)C.current=!0;R(W0)}),y=K0((W0)=>{if(N!==void 0)return;D(W0)}),v=K0(()=>U==="onChange"||U==="onSubmit"&&Q.current),u=Boolean(W||F&&{}.hasOwnProperty.call(H,F)&&H[F]!==void 0),[T,t]=q2.useState({state:b$,error:"",errors:[],value:null,initialValue:null}),B0=!u&&T.state.valid,h=q2.useMemo(()=>({disabled:_,touched:j,dirty:S,valid:B0,filled:b,focused:x}),[_,j,S,B0,b,x]),e=kO({setValidityData:t,validate:M,validityData:T,validationDebounceTime:Y,invalid:u,markedDirtyRef:C,state:h,name:F,shouldValidateOnChange:v}),A0=q2.useCallback(()=>{C.current=!0,e.commit(T.value)},[e,T]);q2.useImperativeHandle(V,()=>({validate:A0}),[A0]);let l=q2.useMemo(()=>({invalid:u,name:F,validityData:T,setValidityData:t,disabled:_,touched:j,setTouched:y,dirty:S,setDirty:k,filled:b,setFilled:E,focused:x,setFocused:I,validate:M,validationMode:U,validationDebounceTime:Y,shouldValidateOnChange:v,state:h,markedDirtyRef:C,validation:e}),[u,F,T,_,j,y,S,k,b,E,x,I,M,U,Y,v,h,e]),z0=U0("div",J,{ref:Z,state:h,props:L,stateAttributesMapping:y2});return vX.jsx(QW.Provider,{value:l,children:z0})}),bO=q2.forwardRef(function(J,Z){return vX.jsx(hX,{children:vX.jsx(Ei,{...J,ref:Z})})});var dZ=O(g(),1);var yO=dZ.forwardRef(function(J,Z){let{render:H,className:B,id:Q,nativeLabel:X=!0,...z}=J,G=y5(!1),{controlId:Y,setLabelId:U,labelId:F}=W2(),K=t0(Q),W=dZ.useRef(null),q=K0((V)=>{if(y1(V.nativeEvent)?.closest("button,input,select,textarea"))return;if(!V.defaultPrevented&&V.detail>1)V.preventDefault();if(X||!Y)return;let A=m0(V.currentTarget).getElementById(Y);if(P5(A))A.focus({focusVisible:!0})});return F0(()=>{if(K)U(K);return()=>{U(void 0)}},[K,U]),U0("label",J,{ref:[Z,W],state:G.state,props:[{id:F},X?{htmlFor:Y??void 0,onMouseDown:q}:{onClick:q,onPointerDown(V){V.preventDefault()}},z],stateAttributesMapping:y2})});var x$=O(g(),1);var zW=O(c(),1),Si={...y2,...c1},hO=x$.forwardRef(function(J,Z){let{render:H,id:B,className:Q,match:X,...z}=J,G=t0(B),{validityData:Y,state:U,name:F}=y5(!1),{setMessageIds:K}=W2(),{errors:W}=n4(),q=F?W[F]:null,N=!1;if(q||X===!0)N=!0;else if(X)N=Boolean(Y.state[X]);else N=Y.state.valid===!1;let{mounted:V,transitionStatus:L,setMounted:A}=d4(N);F0(()=>{if(!N||!G)return;return K((I)=>I.concat(G)),()=>{K((I)=>I.filter((S)=>S!==G))}},[N,G,K]);let M=x$.useRef(null),[_,P]=x$.useState(null),[D,w]=x$.useState(null),R=q||(Y.errors.length>1?zW.jsx("ul",{children:Y.errors.map((I)=>zW.jsx("li",{children:I},I))}):Y.error),b=Y.error;if(q!=null)b=Array.isArray(q)?JSON.stringify(q):q;else if(Y.errors.length>1)b=JSON.stringify(Y.errors);if(N&&b!==D)w(b),P(R);b5({open:N,ref:M,onComplete(){if(!N)A(!1)}});let E={...U,transitionStatus:L},x=U0("div",J,{ref:[Z,M],state:E,props:[{id:G,children:N?R:_},z],stateAttributesMapping:Si,enabled:V});if(!V)return null;return x});var xO=O(g(),1);var vO=xO.forwardRef(function(J,Z){let{render:H,id:B,className:Q,...X}=J,z=t0(B),G=y5(!1),{setMessageIds:Y}=W2();return F0(()=>{if(!z)return;return Y((F)=>F.concat(z)),()=>{Y((F)=>F.filter((K)=>K!==z))}},[z,Y]),U0("p",J,{ref:Z,state:G.state,props:[{id:z},X],stateAttributesMapping:y2})});var gX=O(g(),1);var v$=O(g(),1);function o4({controlled:$,default:J,name:Z,state:H="value"}){let{current:B}=v$.useRef($!==void 0),[Q,X]=v$.useState(J),z=B?$:Q,G=v$.useCallback((Y)=>{if(!B)X(Y)},[]);return[z,G]}var lZ=O(g(),1);function W7($={}){let{id:J,implicit:Z=!1,controlRef:H}=$,{controlId:B,registerControlId:Q}=W2(),X=t0(J),z=Z?B:void 0,G=R1(()=>Symbol("labelable-control")),Y=lZ.useRef(!1),U=lZ.useRef(J!=null),F=K0(()=>{if(!Y.current||Q===u1)return;Y.current=!1,Q(G.current,void 0)});return F0(()=>{if(Q===u1)return;let K;if(Z){let W=H?.current;if(j1(W)&&W.closest("label")!=null)K=J??null;else K=z??X}else if(J!=null)U.current=!0,K=J;else if(U.current)K=X;else{F();return}if(K===void 0){F();return}Y.current=!0,Q(G.current,K);return},[J,H,z,Q,Z,X,G,F]),lZ.useEffect(()=>{return F},[F]),B??X}var gO=O(G4(),1);function q7($){let{enabled:J=!0,value:Z,id:H,name:B,controlRef:Q,commit:X}=$,{formRef:z}=n4(),{invalid:G,markedDirtyRef:Y,validityData:U,setValidityData:F}=y5(),K=K0($.getValue);F0(()=>{if(!J)return;let W=Z;if(W===void 0)W=K();if(U.initialValue===null&&W!==null)F((q)=>({...q,initialValue:W}))},[J,F,Z,U.initialValue,K]),F0(()=>{if(!J||!H)return;z.current.fields.set(H,{getValue:K,name:B,controlRef:Q,validityData:y$(U,G),validate(W=!0){let q=Z;if(q===void 0)q=K();if(Y.current=!0,!W)X(q);else gO.flushSync(()=>X(q))}})},[X,Q,J,z,K,H,G,Y,B,U,Z]),F0(()=>{let W=z.current.fields;return()=>{if(H)W.delete(H)}},[z,H])}var fO=gX.forwardRef(function(J,Z){let{render:H,className:B,id:Q,name:X,value:z,disabled:G=!1,onValueChange:Y,defaultValue:U,autoFocus:F=!1,...K}=J,{state:W,name:q,disabled:N,setTouched:V,setDirty:L,validityData:A,setFocused:M,setFilled:_,validationMode:P,validation:D}=y5(),w=N||G,R=q??X,b={...W,disabled:w},{labelId:E}=W2(),x=W7({id:Q});F0(()=>{let y=z!=null;if(D.inputRef.current?.value||y&&z!=="")_(!0);else if(y&&z==="")_(!1)},[D.inputRef,_,z]);let I=gX.useRef(null);F0(()=>{if(F&&I.current===J5(m0(I.current)))M(!0)},[F,M]);let[S]=o4({controlled:z,default:U,name:"FieldControl",state:"value"}),j=z!==void 0,C=j?S:void 0;return q7({id:x,name:R,commit:D.commit,value:C,getValue:()=>D.inputRef.current?.value,controlRef:D.inputRef}),U0("input",J,{ref:[Z,I],state:b,props:[{id:x,disabled:w,name:R,ref:D.inputRef,"aria-labelledby":E,autoFocus:F,...j?{value:C}:{defaultValue:U},onChange(y){let v=y.currentTarget.value;Y?.(v,M0(Y0.none,y.nativeEvent)),L(v!==A.initialValue),_(v!=="")},onFocus(){M(!0)},onBlur(y){if(V(!0),M(!1),P==="onBlur")D.commit(y.currentTarget.value)},onKeyDown(y){if(y.currentTarget.tagName==="INPUT"&&y.key==="Enter")V(!0),D.commit(y.currentTarget.value)}},D.getInputValidationProps(),K],stateAttributesMapping:y2})});var iZ=O(g(),1);var mO=O(c(),1),pO=function(J){let{children:Z}=J,{validityData:H,invalid:B}=y5(!1),Q=iZ.useMemo(()=>y$(H,B),[H,B]),X=Q.state.valid===!1,{transitionStatus:z}=d4(X),G=iZ.useMemo(()=>{return{...Q,validity:Q.state,transitionStatus:z}},[Q,z]);return mO.jsx(iZ.Fragment,{children:Z(G)})};var mX=O(g(),1);var GW=O(g(),1),uO=GW.createContext({disabled:!1});var fX=O(g(),1),Ii=fX.createContext(void 0);function cO($=!0){let J=fX.useContext(Ii);if(J===void 0&&!$)throw Error(E0(3));return J}var YW=O(c(),1),dO=mX.forwardRef(function(J,Z){let{render:H,className:B,disabled:Q=!1,...X}=J,{state:z,disabled:G}=y5(!1),Y=G||Q,U=cO(),F=U?.parent.id,W=U?.allValues!==void 0?F:void 0,q=mX.useMemo(()=>({disabled:Y}),[Y]),N=U0("div",J,{ref:Z,state:z,props:X,stateAttributesMapping:y2});return YW.jsx(hX,{initialControlId:W,children:YW.jsx(uO.Provider,{value:q,children:N})})});var iO=O(c(),1),UW=lO.forwardRef(function(J,Z){return iO.jsx(pX.Control,{ref:Z,...J})});var rO=O(c(),1);function U3({className:$,type:J,...Z}){return rO.jsx(UW,{type:J,"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",$),...Z})}function aO($){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 N7=["claude-code","codex","openclaw","hermes"];var L7=O(g(),1);var uX="/claude-z2xnay0d.svg";var nO="/floppy-disk-wmjs0n85.webp";var cX="/hermes-pznd63x9.png";var dX="/openai-ep9ht2pq.svg";var lX="/openclaw-a2pyfhpn.svg";var e0=O(c(),1),$j="Set up the moi workspace for this project. Fetch https://moi.computer/INSTALL.md, and follow the steps.";function V7({trigger:$,open:J,onOpenChange:Z}){return e0.jsxs(z3,{open:J,onOpenChange:Z,children:[$&&e0.jsx(IX,{render:$}),e0.jsx(gi,{})]})}var oO=2;function xi({demoInstallUrl:$}){let J=L7.useRef(null);return e0.jsx("div",{className:"relative min-h-56 overflow-hidden md:min-h-full",onMouseMove:(B)=>{if(!J.current)return;let Q=B.currentTarget.getBoundingClientRect(),X=(B.clientX-Q.left)/Q.width-0.5,z=(B.clientY-Q.top)/Q.height-0.5;J.current.style.setProperty("--floppy-x",`${X*-2*oO}px`),J.current.style.setProperty("--floppy-y",`${z*-2*oO}px`)},onMouseLeave:()=>{J.current?.style.removeProperty("--floppy-x"),J.current?.style.removeProperty("--floppy-y")},children:e0.jsxs("a",{ref:J,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:[e0.jsx("img",{src:nO,alt:"",className:"w-full drop-shadow-xl"}),e0.jsxs("div",{className:g$({variant:"outline",className:"absolute -right-3 -bottom-2 -rotate-8"}),children:["About moi",e0.jsx(sO,{"data-icon":"inline-end",stroke:1.5})]})]})})}function vi(){let[$,J]=L7.useState(!1);return L7.useEffect(()=>{if(!$)return;let H=setTimeout(()=>J(!1),1500);return()=>clearTimeout(H)},[$]),{copied:$,copy:()=>{navigator.clipboard?.writeText($j).then(()=>J(!0)).catch(()=>{})}}}function gi(){let{demoInstallUrl:$}=$9(),{copied:J,copy:Z}=vi();return e0.jsxs(F7,{"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:[e0.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))]"}),e0.jsxs("svg",{className:"pointer-events-none absolute inset-0 size-full opacity-30 mix-blend-soft-light","aria-hidden":"true",children:[e0.jsx("filter",{id:"floppy-grain",children:e0.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.8",numOctaves:"2",stitchTiles:"stitch"})}),e0.jsx("rect",{width:"100%",height:"100%",filter:"url(#floppy-grain)"})]}),e0.jsxs("div",{className:"relative grid max-h-[calc(100dvh-2rem)] overflow-y-auto md:grid-cols-[3fr_2fr] md:overflow-visible",children:[e0.jsxs("div",{className:"rounded-xl bg-card p-6 text-card-foreground shadow-sm md:p-8",children:[e0.jsxs("div",{className:"flex flex-col gap-0.5",children:[e0.jsx(G3,{children:"Unlock all features"}),e0.jsx(K7,{className:"mt-1",children:"This is a demo version with sample workspaces. Install moi locally and connect to your agent."})]}),e0.jsxs("ul",{className:"mt-4 flex flex-col gap-3",children:[e0.jsxs("li",{className:"flex items-center gap-3",children:[e0.jsx(tO,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),e0.jsx("span",{className:"text-sm text-foreground",children:"Connect your own data sources and work on existing projects"})]}),e0.jsxs("li",{className:"flex items-center gap-3",children:[e0.jsx(eO,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),e0.jsxs("span",{className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-sm text-foreground",children:[e0.jsx("span",{children:"Build with"}),e0.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[e0.jsx("img",{src:uX,alt:"",className:"size-3.5 object-contain"}),"Claude Code,"]}),e0.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[e0.jsx("img",{src:dX,alt:"",className:"size-3.5 object-contain"}),"Codex,"]}),e0.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[e0.jsx("img",{src:cX,alt:"",className:"size-3.5 object-contain"}),"Hermes,"]}),e0.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[e0.jsx("img",{src:lX,alt:"",className:"size-3.5 object-contain"}),"OpenClaw,"]}),e0.jsx("span",{children:"and more"})]})]})]}),e0.jsxs("div",{className:"mt-8 flex flex-col gap-3 pb-4",children:[e0.jsx("p",{className:"text-sm text-muted-foreground",children:"Give this prompt to your agent:"}),e0.jsxs("div",{className:"relative rounded-lg bg-muted p-4 pb-8 ring-1 ring-border",children:[e0.jsx("code",{className:"block font-mono text-sm leading-relaxed text-foreground",children:$j}),e0.jsxs(C0,{type:"button",onClick:Z,className:"absolute right-4 -bottom-4",children:[J?e0.jsx(F3,{"data-icon":"inline-start",stroke:1.5}):e0.jsx(iX,{"data-icon":"inline-start",stroke:1.5}),J?"Copied":"Copy prompt"]})]})]})]}),e0.jsx(xi,{demoInstallUrl:$})]}),e0.jsx(U7,{render:e0.jsx(C0,{variant:"outline",size:"icon","aria-label":"Close",className:"absolute top-4 right-4",children:e0.jsx(w5,{stroke:1.5})})})]})}var Zj=O(g(),1);var FW=O(c(),1),D8={"claude-code":uX,openclaw:lX,codex:dX,hermes:cX},KW={"claude-code":"Claude Code",openclaw:"OpenClaw",codex:"Codex",hermes:"Hermes"};function Jj({types:$}){let J=$.map((Z)=>KW[Z]).join(", ");return FW.jsx("span",{role:"img","aria-label":J,className:"inline-flex shrink-0 items-center -space-x-0.5",children:$.map((Z)=>FW.jsx("img",{src:D8[Z],alt:"",className:"size-4 shrink-0 rounded-full bg-muted ring-2 ring-muted"},Z))})}function f$($){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 m1=O(c(),1),fi="Choose which agent moi will use to build your workspace",mi={openclaw:"To connect an OpenClaw agent, run",hermes:"To connect a Hermes agent, run"},pi={openclaw:"moi openclaw init",hermes:"moi hermes init"},ui={"claude-code":"Anthropic",codex:"OpenAI",openclaw:"Open-source",hermes:"Nous Research"};function ci({availability:$,detectedTypes:J=[]}){return N7.map((Z)=>{let H=$?.[Z],B=H?.available===!1?H.reason:void 0,Q=!J.includes(Z)?mi[Z]:void 0,X=!J.includes(Z)?pi[Z]:void 0,z=B??Q;return{type:Z,description:ui[Z],disabled:Boolean(z),...z?{disabledReason:z}:{},...!B&&X?{disabledCommand:X}:{}}})}function di($,J){let Z=$.find((H)=>H.type===J);if(Z&&!Z.disabled)return Z.type;return $.find((H)=>!H.disabled)?.type}function aX({title:$,selectedType:J,detectedTypes:Z,availability:H,isPending:B,errorMessage:Q,secondaryAction:X,primaryLabel:z,pendingLabel:G,onTypeChange:Y,onSubmit:U}){let F=_5((V)=>V.hasSentMessageFromMoi),K=ci({availability:H,detectedTypes:Z}),W=di(K,J),q=W!==J,N=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 Zj.useEffect(()=>{if(W&&q)Y(W)},[Y,W,q]),m1.jsxs("div",{className:"flex flex-col gap-5",children:[m1.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[m1.jsx(G3,{children:$}),m1.jsx(K7,{children:fi})]}),m1.jsxs("div",{className:"flex flex-col gap-4",children:[m1.jsx(li,{options:K,selectedType:q?void 0:J,onTypeChange:Y}),!F&&N&&m1.jsx("p",{className:"text-sm text-muted-foreground",children:N})]}),Q&&m1.jsx("p",{role:"alert",className:"text-xs text-destructive",children:Q}),m1.jsxs("div",{className:"flex items-center justify-end gap-2",children:[X,m1.jsx(C0,{onClick:U,disabled:B||q,children:B&&G?G:z})]})]})}function li({options:$,selectedType:J,onTypeChange:Z}){return m1.jsx("div",{role:"group","aria-label":"Agent",className:s("grid gap-2",$.length>2?"grid-cols-4":"grid-cols-2"),children:$.map((H)=>m1.jsx(ii,{option:H,selected:J===H.type,onSelect:Z},H.type))})}function ii({option:$,selected:J,onSelect:Z}){let H=Boolean($.disabledReason),B=m1.jsxs("button",{type:"button",disabled:$.disabled&&!H,"aria-disabled":$.disabled||void 0,"aria-pressed":J,onClick:(Q)=>{if($.disabled){Q.preventDefault();return}Z($.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",!J&&"opacity-70",!J&&!$.disabled&&"cursor-pointer hover:opacity-100",$.disabled&&"cursor-not-allowed"),children:[m1.jsxs("span",{className:"relative inline-flex",children:[m1.jsx(ri,{type:$.type}),J&&m1.jsx(rX,{size:16,stroke:1.75,"aria-hidden":"true",className:"absolute -top-1.5 -right-1.5"})]}),m1.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[m1.jsx("span",{className:"text-sm font-medium text-foreground",children:KW[$.type]}),m1.jsx("span",{className:"text-xs leading-4 text-muted-foreground",children:$.description})]})]});if(!H)return B;return m1.jsxs(d1,{children:[m1.jsx(l1,{render:B}),m1.jsx(i1,{className:s("max-w-64",$.disabledCommand&&"max-w-none leading-5"),children:m1.jsxs("span",{className:"text-center",children:[$.disabledReason,$.disabledCommand&&m1.jsxs(m1.Fragment,{children:[m1.jsx("br",{}),m1.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:$.disabledCommand})]})]})})]})}function ri({type:$}){return m1.jsx("img",{src:D8[$],alt:"",className:"size-8 shrink-0"})}var A7=O(c(),1);function nX({children:$,closeDisabled:J=!1}){return A7.jsxs(F7,{className:"w-[calc(100%-2rem)] max-w-xl p-6",children:[A7.jsx(U7,{render:A7.jsx(C0,{variant:"ghost",size:"icon-sm","aria-label":"Close",className:"absolute top-4 right-4",disabled:J,children:A7.jsx(w5,{stroke:1.75})})}),$]})}var G5=O(c(),1),Hj=N7[0];function aZ({trigger:$}){let[,J]=m4(),Z=$9(),H=_X(),B=d_(),[Q,X]=rZ.useState(!1),[z,G]=rZ.useState("agent"),[Y,U]=rZ.useState(Hj),[F,K]=rZ.useState(""),W=F.trim(),q=W?aO(W):null,N=B.isPending;if(Z.cloudDemo)return G5.jsx(V7,{trigger:$});function V(_){X(!1),J(`/workspace/${_}`)}function L(){G("agent"),U(Hj),K(""),B.reset()}function A(){B.reset(),G("name")}function M(){if(!W||q||N)return;B.reset(),B.mutate({name:W,type:Y},{onSuccess:(_)=>V(_.id)})}return G5.jsxs(z3,{open:Q,onOpenChange:X,onOpenChangeComplete:(_)=>{if(!_)L()},children:[G5.jsx(IX,{render:$}),G5.jsx(nX,{children:z==="agent"?G5.jsx(aX,{title:"Create new workspace",selectedType:Y,availability:H.data?.availability,isPending:!1,secondaryAction:G5.jsx(ni,{}),primaryLabel:"Next",onTypeChange:U,onSubmit:A}):G5.jsx(ai,{name:F,validationError:q,requestError:B.error?.message,isPending:N,onNameChange:K,onSubmit:M})})]})}function ai({name:$,validationError:J,requestError:Z,isPending:H,onNameChange:B,onSubmit:Q}){function X(z){z.preventDefault(),Q()}return G5.jsxs("form",{className:"flex flex-col gap-5",onSubmit:X,children:[G5.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[G5.jsx(G3,{children:"Create new workspace"}),G5.jsx(K7,{children:"Give it a short and recognizable name"})]}),G5.jsxs("div",{className:"flex flex-col gap-2",children:[G5.jsx("label",{htmlFor:"workspace-name",className:"sr-only",children:"Workspace name"}),G5.jsx(U3,{id:"workspace-name",value:$,onChange:(z)=>B(z.target.value),placeholder:"my-workspace",autoFocus:!0,"aria-invalid":Boolean(J),"aria-describedby":J?"workspace-name-error":void 0,autoComplete:"off",spellCheck:!1}),J&&G5.jsx("p",{id:"workspace-name-error",role:"alert",className:"text-xs text-destructive",children:J})]}),Z&&G5.jsx("p",{role:"alert",className:"text-xs text-destructive",children:Z}),G5.jsx("div",{className:"flex items-center justify-end gap-2",children:G5.jsx(C0,{type:"submit",disabled:!$.trim()||Boolean(J)||H,children:H?"Creating…":"Create workspace"})})]})}function ni(){return G5.jsxs(d1,{children:[G5.jsx(l1,{render:G5.jsx(C0,{variant:"secondary","aria-disabled":!0,onClick:(J)=>J.preventDefault(),className:"cursor-not-allowed opacity-50",children:"Use existing folder"})}),G5.jsx(i1,{className:"max-w-64",children:G5.jsxs("span",{className:"text-center",children:["Not supported yet — run"," ",G5.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 W3=O(g(),1);var q0=O(g(),1),d$=O(G4(),1);var n5=O(g(),1);var nZ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function m$($){let J=Object.prototype.toString.call($);return J==="[object Window]"||J==="[object global]"}function oX($){return"nodeType"in $}function h2($){var J,Z;if(!$)return window;if(m$($))return $;if(!oX($))return window;return(J=(Z=$.ownerDocument)==null?void 0:Z.defaultView)!=null?J:window}function sX($){let{Document:J}=h2($);return $ instanceof J}function M7($){if(m$($))return!1;return $ instanceof h2($).HTMLElement}function qW($){return $ instanceof h2($).SVGElement}function p$($){if(!$)return document;if(m$($))return $.document;if(!oX($))return document;if(sX($))return $;if(M7($)||qW($))return $.ownerDocument;return document}var J9=nZ?n5.useLayoutEffect:n5.useEffect;function oZ($){let J=n5.useRef($);return J9(()=>{J.current=$}),n5.useCallback(function(){for(var Z=arguments.length,H=Array(Z),B=0;B<Z;B++)H[B]=arguments[B];return J.current==null?void 0:J.current(...H)},[])}function Qj(){let $=n5.useRef(null),J=n5.useCallback((H,B)=>{$.current=setInterval(H,B)},[]),Z=n5.useCallback(()=>{if($.current!==null)clearInterval($.current),$.current=null},[]);return[J,Z]}function P7($,J){if(J===void 0)J=[$];let Z=n5.useRef($);return J9(()=>{if(Z.current!==$)Z.current=$},J),Z}function _7($,J){let Z=n5.useRef();return n5.useMemo(()=>{let H=$(Z.current);return Z.current=H,H},[...J])}function sZ($){let J=oZ($),Z=n5.useRef(null),H=n5.useCallback((B)=>{if(B!==Z.current)J==null||J(B,Z.current);Z.current=B},[]);return[Z,H]}function tZ($){let J=n5.useRef();return n5.useEffect(()=>{J.current=$},[$]),J.current}var WW={};function eZ($,J){return n5.useMemo(()=>{if(J)return J;let Z=WW[$]==null?0:WW[$]+1;return WW[$]=Z,$+"-"+Z},[$,J])}function Xj($){return function(J){for(var Z=arguments.length,H=Array(Z>1?Z-1:0),B=1;B<Z;B++)H[B-1]=arguments[B];return H.reduce((Q,X)=>{let z=Object.entries(X);for(let[G,Y]of z){let U=Q[G];if(U!=null)Q[G]=U+$*Y}return Q},{...J})}}var u$=Xj(1),$H=Xj(-1);function oi($){return"clientX"in $&&"clientY"in $}function tX($){if(!$)return!1;let{KeyboardEvent:J}=h2($.target);return J&&$ instanceof J}function si($){if(!$)return!1;let{TouchEvent:J}=h2($.target);return J&&$ instanceof J}function JH($){if(si($)){if($.touches&&$.touches.length){let{clientX:J,clientY:Z}=$.touches[0];return{x:J,y:Z}}else if($.changedTouches&&$.changedTouches.length){let{clientX:J,clientY:Z}=$.changedTouches[0];return{x:J,y:Z}}}if(oi($))return{x:$.clientX,y:$.clientY};return null}var D7=Object.freeze({Translate:{toString($){if(!$)return;let{x:J,y:Z}=$;return"translate3d("+(J?Math.round(J):0)+"px, "+(Z?Math.round(Z):0)+"px, 0)"}},Scale:{toString($){if(!$)return;let{scaleX:J,scaleY:Z}=$;return"scaleX("+J+") scaleY("+Z+")"}},Transform:{toString($){if(!$)return;return[D7.Translate.toString($),D7.Scale.toString($)].join(" ")}},Transition:{toString($){let{property:J,duration:Z,easing:H}=$;return J+" "+Z+"ms "+H}}}),Bj="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function zj($){if($.matches(Bj))return $;return $.querySelector(Bj)}var c$=O(g(),1),ti={display:"none"};function Gj($){let{id:J,value:Z}=$;return c$.default.createElement("div",{id:J,style:ti},Z)}function Yj($){let{id:J,announcement:Z,ariaLiveType:H="assertive"}=$,B={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 c$.default.createElement("div",{id:J,style:B,role:"status","aria-live":H,"aria-atomic":!0},Z)}function Uj(){let[$,J]=c$.useState("");return{announce:c$.useCallback((H)=>{if(H!=null)J(H)},[]),announcement:$}}var Oj=q0.createContext(null);function ei($){let J=q0.useContext(Oj);q0.useEffect(()=>{if(!J)throw Error("useDndMonitor must be used within a children of <DndContext>");return J($)},[$,J])}function $r(){let[$]=q0.useState(()=>new Set),J=q0.useCallback((H)=>{return $.add(H),()=>$.delete(H)},[$]);return[q0.useCallback((H)=>{let{type:B,event:Q}=H;$.forEach((X)=>{var z;return(z=X[B])==null?void 0:z.call(X,Q)})},[$]),J]}var Jr={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
|
+
`},Zr={onDragStart($){let{active:J}=$;return"Picked up draggable item "+J.id+"."},onDragOver($){let{active:J,over:Z}=$;if(Z)return"Draggable item "+J.id+" was moved over droppable area "+Z.id+".";return"Draggable item "+J.id+" is no longer over a droppable area."},onDragEnd($){let{active:J,over:Z}=$;if(Z)return"Draggable item "+J.id+" was dropped over droppable area "+Z.id;return"Draggable item "+J.id+" was dropped."},onDragCancel($){let{active:J}=$;return"Dragging was cancelled. Draggable item "+J.id+" was dropped."}};function Hr($){let{announcements:J=Zr,container:Z,hiddenTextDescribedById:H,screenReaderInstructions:B=Jr}=$,{announce:Q,announcement:X}=Uj(),z=eZ("DndLiveRegion"),[G,Y]=q0.useState(!1);if(q0.useEffect(()=>{Y(!0)},[]),ei(q0.useMemo(()=>({onDragStart(F){let{active:K}=F;Q(J.onDragStart({active:K}))},onDragMove(F){let{active:K,over:W}=F;if(J.onDragMove)Q(J.onDragMove({active:K,over:W}))},onDragOver(F){let{active:K,over:W}=F;Q(J.onDragOver({active:K,over:W}))},onDragEnd(F){let{active:K,over:W}=F;Q(J.onDragEnd({active:K,over:W}))},onDragCancel(F){let{active:K,over:W}=F;Q(J.onDragCancel({active:K,over:W}))}}),[Q,J])),!G)return null;let U=q0.default.createElement(q0.default.Fragment,null,q0.default.createElement(Gj,{id:H,value:B.draggable}),q0.default.createElement(Yj,{id:z,announcement:X}));return Z?d$.createPortal(U,Z):U}var H2;(function($){$.DragStart="dragStart",$.DragMove="dragMove",$.DragEnd="dragEnd",$.DragCancel="dragCancel",$.DragOver="dragOver",$.RegisterDroppable="registerDroppable",$.SetDroppableDisabled="setDroppableDisabled",$.UnregisterDroppable="unregisterDroppable"})(H2||(H2={}));function $z(){}function PW($,J){return q0.useMemo(()=>({sensor:$,options:J!=null?J:{}}),[$,J])}function jj(){for(var $=arguments.length,J=Array($),Z=0;Z<$;Z++)J[Z]=arguments[Z];return q0.useMemo(()=>[...J].filter((H)=>H!=null),[...J])}var M8=Object.freeze({x:0,y:0});function Br($,J){return Math.sqrt(Math.pow($.x-J.x,2)+Math.pow($.y-J.y,2))}function Qr($,J){let Z=JH($);if(!Z)return"0 0";let H={x:(Z.x-J.left)/J.width*100,y:(Z.y-J.top)/J.height*100};return H.x+"% "+H.y+"%"}function Xr($,J){let{data:{value:Z}}=$,{data:{value:H}}=J;return Z-H}function zr($,J){let{data:{value:Z}}=$,{data:{value:H}}=J;return H-Z}function Gr($,J){if(!$||$.length===0)return null;let[Z]=$;return J?Z[J]:Z}function Fj($,J,Z){if(J===void 0)J=$.left;if(Z===void 0)Z=$.top;return{x:J+$.width*0.5,y:Z+$.height*0.5}}var Tj=($)=>{let{collisionRect:J,droppableRects:Z,droppableContainers:H}=$,B=Fj(J,J.left,J.top),Q=[];for(let X of H){let{id:z}=X,G=Z.get(z);if(G){let Y=Br(Fj(G),B);Q.push({id:z,data:{droppableContainer:X,value:Y}})}}return Q.sort(Xr)};function Yr($,J){let Z=Math.max(J.top,$.top),H=Math.max(J.left,$.left),B=Math.min(J.left+J.width,$.left+$.width),Q=Math.min(J.top+J.height,$.top+$.height),X=B-H,z=Q-Z;if(H<B&&Z<Q){let G=J.width*J.height,Y=$.width*$.height,U=X*z,F=U/(G+Y-U);return Number(F.toFixed(4))}return 0}var Ur=($)=>{let{collisionRect:J,droppableRects:Z,droppableContainers:H}=$,B=[];for(let Q of H){let{id:X}=Q,z=Z.get(X);if(z){let G=Yr(z,J);if(G>0)B.push({id:X,data:{droppableContainer:Q,value:G}})}}return B.sort(zr)};function Fr($,J,Z){return{...$,scaleX:J&&Z?J.width/Z.width:1,scaleY:J&&Z?J.height/Z.height:1}}function Cj($,J){return $&&J?{x:$.left-J.left,y:$.top-J.top}:M8}function Kr($){return function(Z){for(var H=arguments.length,B=Array(H>1?H-1:0),Q=1;Q<H;Q++)B[Q-1]=arguments[Q];return B.reduce((X,z)=>({...X,top:X.top+$*z.y,bottom:X.bottom+$*z.y,left:X.left+$*z.x,right:X.right+$*z.x}),{...Z})}}var Wr=Kr(1);function wj($){if($.startsWith("matrix3d(")){let J=$.slice(9,-1).split(/, /);return{x:+J[12],y:+J[13],scaleX:+J[0],scaleY:+J[5]}}else if($.startsWith("matrix(")){let J=$.slice(7,-1).split(/, /);return{x:+J[4],y:+J[5],scaleX:+J[0],scaleY:+J[3]}}return null}function qr($,J,Z){let H=wj(J);if(!H)return $;let{scaleX:B,scaleY:Q,x:X,y:z}=H,G=$.left-X-(1-B)*parseFloat(Z),Y=$.top-z-(1-Q)*parseFloat(Z.slice(Z.indexOf(" ")+1)),U=B?$.width/B:$.width,F=Q?$.height/Q:$.height;return{width:U,height:F,top:Y,right:G+U,bottom:Y+F,left:G}}var Nr={ignoreTransform:!1};function BH($,J){if(J===void 0)J=Nr;let Z=$.getBoundingClientRect();if(J.ignoreTransform){let{transform:Y,transformOrigin:U}=h2($).getComputedStyle($);if(Y)Z=qr(Z,Y,U)}let{top:H,left:B,width:Q,height:X,bottom:z,right:G}=Z;return{top:H,left:B,width:Q,height:X,bottom:z,right:G}}function Kj($){return BH($,{ignoreTransform:!0})}function Lr($){let{innerWidth:J,innerHeight:Z}=$;return{top:0,left:0,right:J,bottom:Z,width:J,height:Z}}function Vr($,J){if(J===void 0)J=h2($).getComputedStyle($);return J.position==="fixed"}function Ar($,J){if(J===void 0)J=h2($).getComputedStyle($);let Z=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((B)=>{let Q=J[B];return typeof Q==="string"?Z.test(Q):!1})}function _W($,J){let Z=[];function H(B){if(J!=null&&Z.length>=J)return Z;if(!B)return Z;if(sX(B)&&B.scrollingElement!=null&&!Z.includes(B.scrollingElement))return Z.push(B.scrollingElement),Z;if(!M7(B)||qW(B))return Z;if(Z.includes(B))return Z;let Q=h2($).getComputedStyle(B);if(B!==$){if(Ar(B,Q))Z.push(B)}if(Vr(B,Q))return Z;return H(B.parentNode)}if(!$)return Z;return H($)}function Ej($){let[J]=_W($,1);return J!=null?J:null}function NW($){if(!nZ||!$)return null;if(m$($))return $;if(!oX($))return null;if(sX($)||$===p$($).scrollingElement)return window;if(M7($))return $;return null}function Sj($){if(m$($))return $.scrollX;return $.scrollLeft}function Ij($){if(m$($))return $.scrollY;return $.scrollTop}function AW($){return{x:Sj($),y:Ij($)}}var N2;(function($){$[$.Forward=1]="Forward",$[$.Backward=-1]="Backward"})(N2||(N2={}));function Rj($){if(!nZ||!$)return!1;return $===document.scrollingElement}function kj($){let J={x:0,y:0},Z=Rj($)?{height:window.innerHeight,width:window.innerWidth}:{height:$.clientHeight,width:$.clientWidth},H={x:$.scrollWidth-Z.width,y:$.scrollHeight-Z.height},B=$.scrollTop<=J.y,Q=$.scrollLeft<=J.x,X=$.scrollTop>=H.y,z=$.scrollLeft>=H.x;return{isTop:B,isLeft:Q,isBottom:X,isRight:z,maxScroll:H,minScroll:J}}var Dr={x:0.2,y:0.2};function Mr($,J,Z,H,B){let{top:Q,left:X,right:z,bottom:G}=Z;if(H===void 0)H=10;if(B===void 0)B=Dr;let{isTop:Y,isBottom:U,isLeft:F,isRight:K}=kj($),W={x:0,y:0},q={x:0,y:0},N={height:J.height*B.y,width:J.width*B.x};if(!Y&&Q<=J.top+N.height)W.y=N2.Backward,q.y=H*Math.abs((J.top+N.height-Q)/N.height);else if(!U&&G>=J.bottom-N.height)W.y=N2.Forward,q.y=H*Math.abs((J.bottom-N.height-G)/N.height);if(!K&&z>=J.right-N.width)W.x=N2.Forward,q.x=H*Math.abs((J.right-N.width-z)/N.width);else if(!F&&X<=J.left+N.width)W.x=N2.Backward,q.x=H*Math.abs((J.left+N.width-X)/N.width);return{direction:W,speed:q}}function Pr($){if($===document.scrollingElement){let{innerWidth:Q,innerHeight:X}=window;return{top:0,left:0,right:Q,bottom:X,width:Q,height:X}}let{top:J,left:Z,right:H,bottom:B}=$.getBoundingClientRect();return{top:J,left:Z,right:H,bottom:B,width:$.clientWidth,height:$.clientHeight}}function bj($){return $.reduce((J,Z)=>{return u$(J,AW(Z))},M8)}function _r($){return $.reduce((J,Z)=>{return J+Sj(Z)},0)}function Or($){return $.reduce((J,Z)=>{return J+Ij(Z)},0)}function yj($,J){if(J===void 0)J=BH;if(!$)return;let{top:Z,left:H,bottom:B,right:Q}=J($);if(!Ej($))return;if(B<=0||Q<=0||Z>=window.innerHeight||H>=window.innerWidth)$.scrollIntoView({block:"center",inline:"center"})}var jr=[["x",["left","right"],_r],["y",["top","bottom"],Or]];class Zz{constructor($,J){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 Z=_W(J),H=bj(Z);this.rect={...$},this.width=$.width,this.height=$.height;for(let[B,Q,X]of jr)for(let z of Q)Object.defineProperty(this,z,{get:()=>{let G=X(Z),Y=H[B]-G;return this.rect[z]+Y},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class O7{constructor($){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((J)=>{var Z;return(Z=this.target)==null?void 0:Z.removeEventListener(...J)})},this.target=$}add($,J,Z){var H;(H=this.target)==null||H.addEventListener($,J,Z),this.listeners.push([$,J,Z])}}function Tr($){let{EventTarget:J}=h2($);return $ instanceof J?$:p$($)}function LW($,J){let Z=Math.abs($.x),H=Math.abs($.y);if(typeof J==="number")return Math.sqrt(Z**2+H**2)>J;if("x"in J&&"y"in J)return Z>J.x&&H>J.y;if("x"in J)return Z>J.x;if("y"in J)return H>J.y;return!1}var s4;(function($){$.Click="click",$.DragStart="dragstart",$.Keydown="keydown",$.ContextMenu="contextmenu",$.Resize="resize",$.SelectionChange="selectionchange",$.VisibilityChange="visibilitychange"})(s4||(s4={}));function Wj($){$.preventDefault()}function Cr($){$.stopPropagation()}var x1;(function($){$.Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter",$.Tab="Tab"})(x1||(x1={}));var hj={start:[x1.Space,x1.Enter],cancel:[x1.Esc],end:[x1.Space,x1.Enter,x1.Tab]},wr=($,J)=>{let{currentCoordinates:Z}=J;switch($.code){case x1.Right:return{...Z,x:Z.x+25};case x1.Left:return{...Z,x:Z.x-25};case x1.Down:return{...Z,y:Z.y+25};case x1.Up:return{...Z,y:Z.y-25}}return};class QH{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:J}}=$;this.props=$,this.listeners=new O7(p$(J)),this.windowListeners=new O7(h2(J)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(s4.Resize,this.handleCancel),this.windowListeners.add(s4.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(s4.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:$,onStart:J}=this.props,Z=$.node.current;if(Z)yj(Z);J(M8)}handleKeyDown($){if(tX($)){let{active:J,context:Z,options:H}=this.props,{keyboardCodes:B=hj,coordinateGetter:Q=wr,scrollBehavior:X="smooth"}=H,{code:z}=$;if(B.end.includes(z)){this.handleEnd($);return}if(B.cancel.includes(z)){this.handleCancel($);return}let{collisionRect:G}=Z.current,Y=G?{x:G.left,y:G.top}:M8;if(!this.referenceCoordinates)this.referenceCoordinates=Y;let U=Q($,{active:J,context:Z.current,currentCoordinates:Y});if(U){let F=$H(U,Y),K={x:0,y:0},{scrollableAncestors:W}=Z.current;for(let q of W){let N=$.code,{isTop:V,isRight:L,isLeft:A,isBottom:M,maxScroll:_,minScroll:P}=kj(q),D=Pr(q),w={x:Math.min(N===x1.Right?D.right-D.width/2:D.right,Math.max(N===x1.Right?D.left:D.left+D.width/2,U.x)),y:Math.min(N===x1.Down?D.bottom-D.height/2:D.bottom,Math.max(N===x1.Down?D.top:D.top+D.height/2,U.y))},R=N===x1.Right&&!L||N===x1.Left&&!A,b=N===x1.Down&&!M||N===x1.Up&&!V;if(R&&w.x!==U.x){let E=q.scrollLeft+F.x,x=N===x1.Right&&E<=_.x||N===x1.Left&&E>=P.x;if(x&&!F.y){q.scrollTo({left:E,behavior:X});return}if(x)K.x=q.scrollLeft-E;else K.x=N===x1.Right?q.scrollLeft-_.x:q.scrollLeft-P.x;if(K.x)q.scrollBy({left:-K.x,behavior:X});break}else if(b&&w.y!==U.y){let E=q.scrollTop+F.y,x=N===x1.Down&&E<=_.y||N===x1.Up&&E>=P.y;if(x&&!F.x){q.scrollTo({top:E,behavior:X});return}if(x)K.y=q.scrollTop-E;else K.y=N===x1.Down?q.scrollTop-_.y:q.scrollTop-P.y;if(K.y)q.scrollBy({top:-K.y,behavior:X});break}}this.handleMove($,u$($H(U,this.referenceCoordinates),K))}}}handleMove($,J){let{onMove:Z}=this.props;$.preventDefault(),Z(J)}handleEnd($){let{onEnd:J}=this.props;$.preventDefault(),this.detach(),J()}handleCancel($){let{onCancel:J}=this.props;$.preventDefault(),this.detach(),J()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}QH.activators=[{eventName:"onKeyDown",handler:($,J,Z)=>{let{keyboardCodes:H=hj,onActivation:B}=J,{active:Q}=Z,{code:X}=$.nativeEvent;if(H.start.includes(X)){let z=Q.activatorNode.current;if(z&&$.target!==z)return!1;return $.preventDefault(),B==null||B({event:$.nativeEvent}),!0}return!1}}];function qj($){return Boolean($&&"distance"in $)}function Nj($){return Boolean($&&"delay"in $)}class Hz{constructor($,J,Z){var H;if(Z===void 0)Z=Tr($.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=J;let{event:B}=$,{target:Q}=B;this.props=$,this.events=J,this.document=p$(Q),this.documentListeners=new O7(this.document),this.listeners=new O7(Z),this.windowListeners=new O7(h2(Q)),this.initialCoordinates=(H=JH(B))!=null?H:M8,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:J,bypassActivationConstraint:Z}}}=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(s4.Resize,this.handleCancel),this.windowListeners.add(s4.DragStart,Wj),this.windowListeners.add(s4.VisibilityChange,this.handleCancel),this.windowListeners.add(s4.ContextMenu,Wj),this.documentListeners.add(s4.Keydown,this.handleKeydown),J){if(Z!=null&&Z({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Nj(J)){this.timeoutId=setTimeout(this.handleStart,J.delay),this.handlePending(J);return}if(qj(J)){this.handlePending(J);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($,J){let{active:Z,onPending:H}=this.props;H(Z,$,this.initialCoordinates,J)}handleStart(){let{initialCoordinates:$}=this,{onStart:J}=this.props;if($)this.activated=!0,this.documentListeners.add(s4.Click,Cr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(s4.SelectionChange,this.removeTextSelection),J($)}handleMove($){var J;let{activated:Z,initialCoordinates:H,props:B}=this,{onMove:Q,options:{activationConstraint:X}}=B;if(!H)return;let z=(J=JH($))!=null?J:M8,G=$H(H,z);if(!Z&&X){if(qj(X)){if(X.tolerance!=null&&LW(G,X.tolerance))return this.handleCancel();if(LW(G,X.distance))return this.handleStart()}if(Nj(X)){if(LW(G,X.tolerance))return this.handleCancel()}this.handlePending(X,G);return}if($.cancelable)$.preventDefault();Q(z)}handleEnd(){let{onAbort:$,onEnd:J}=this.props;if(this.detach(),!this.activated)$(this.props.active);J()}handleCancel(){let{onAbort:$,onCancel:J}=this.props;if(this.detach(),!this.activated)$(this.props.active);J()}handleKeydown($){if($.code===x1.Esc)this.handleCancel()}removeTextSelection(){var $;($=this.document.getSelection())==null||$.removeAllRanges()}}var Er={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class XH extends Hz{constructor($){let{event:J}=$,Z=p$(J.target);super($,Er,Z)}}XH.activators=[{eventName:"onPointerDown",handler:($,J)=>{let{nativeEvent:Z}=$,{onActivation:H}=J;if(!Z.isPrimary||Z.button!==0)return!1;return H==null||H({event:Z}),!0}}];var Sr={move:{name:"mousemove"},end:{name:"mouseup"}},DW;(function($){$[$.RightClick=2]="RightClick"})(DW||(DW={}));class xj extends Hz{constructor($){super($,Sr,p$($.event.target))}}xj.activators=[{eventName:"onMouseDown",handler:($,J)=>{let{nativeEvent:Z}=$,{onActivation:H}=J;if(Z.button===DW.RightClick)return!1;return H==null||H({event:Z}),!0}}];var VW={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class vj extends Hz{constructor($){super($,VW)}static setup(){return window.addEventListener(VW.move.name,$,{capture:!1,passive:!1}),function(){window.removeEventListener(VW.move.name,$)};function $(){}}}vj.activators=[{eventName:"onTouchStart",handler:($,J)=>{let{nativeEvent:Z}=$,{onActivation:H}=J,{touches:B}=Z;if(B.length>1)return!1;return H==null||H({event:Z}),!0}}];var ZH;(function($){$[$.Pointer=0]="Pointer",$[$.DraggableRect=1]="DraggableRect"})(ZH||(ZH={}));var Jz;(function($){$[$.TreeOrder=0]="TreeOrder",$[$.ReversedTreeOrder=1]="ReversedTreeOrder"})(Jz||(Jz={}));function Ir($){let{acceleration:J,activator:Z=ZH.Pointer,canScroll:H,draggingRect:B,enabled:Q,interval:X=5,order:z=Jz.TreeOrder,pointerCoordinates:G,scrollableAncestors:Y,scrollableAncestorRects:U,delta:F,threshold:K}=$,W=kr({delta:F,disabled:!Q}),[q,N]=Qj(),V=q0.useRef({x:0,y:0}),L=q0.useRef({x:0,y:0}),A=q0.useMemo(()=>{switch(Z){case ZH.Pointer:return G?{top:G.y,bottom:G.y,left:G.x,right:G.x}:null;case ZH.DraggableRect:return B}},[Z,B,G]),M=q0.useRef(null),_=q0.useCallback(()=>{let D=M.current;if(!D)return;let w=V.current.x*L.current.x,R=V.current.y*L.current.y;D.scrollBy(w,R)},[]),P=q0.useMemo(()=>z===Jz.TreeOrder?[...Y].reverse():Y,[z,Y]);q0.useEffect(()=>{if(!Q||!Y.length||!A){N();return}for(let D of P){if((H==null?void 0:H(D))===!1)continue;let w=Y.indexOf(D),R=U[w];if(!R)continue;let{direction:b,speed:E}=Mr(D,R,A,J,K);for(let x of["x","y"])if(!W[x][b[x]])E[x]=0,b[x]=0;if(E.x>0||E.y>0){N(),M.current=D,q(_,X),V.current=E,L.current=b;return}}V.current={x:0,y:0},L.current={x:0,y:0},N()},[J,_,H,N,Q,X,JSON.stringify(A),JSON.stringify(W),q,Y,P,U,JSON.stringify(K)])}var Rr={x:{[N2.Backward]:!1,[N2.Forward]:!1},y:{[N2.Backward]:!1,[N2.Forward]:!1}};function kr($){let{delta:J,disabled:Z}=$,H=tZ(J);return _7((B)=>{if(Z||!H||!B)return Rr;let Q={x:Math.sign(J.x-H.x),y:Math.sign(J.y-H.y)};return{x:{[N2.Backward]:B.x[N2.Backward]||Q.x===-1,[N2.Forward]:B.x[N2.Forward]||Q.x===1},y:{[N2.Backward]:B.y[N2.Backward]||Q.y===-1,[N2.Forward]:B.y[N2.Forward]||Q.y===1}}},[Z,J,H])}function br($,J){let Z=J!=null?$.get(J):void 0,H=Z?Z.node.current:null;return _7((B)=>{var Q;if(J==null)return null;return(Q=H!=null?H:B)!=null?Q:null},[H,J])}function yr($,J){return q0.useMemo(()=>$.reduce((Z,H)=>{let{sensor:B}=H,Q=B.activators.map((X)=>({eventName:X.eventName,handler:J(X.handler,H)}));return[...Z,...Q]},[]),[$,J])}var HH;(function($){$[$.Always=0]="Always",$[$.BeforeDragging=1]="BeforeDragging",$[$.WhileDragging=2]="WhileDragging"})(HH||(HH={}));var MW;(function($){$.Optimized="optimized"})(MW||(MW={}));var Lj=new Map;function hr($,J){let{dragging:Z,dependencies:H,config:B}=J,[Q,X]=q0.useState(null),{frequency:z,measure:G,strategy:Y}=B,U=q0.useRef($),F=V(),K=P7(F),W=q0.useCallback(function(L){if(L===void 0)L=[];if(K.current)return;X((A)=>{if(A===null)return L;return A.concat(L.filter((M)=>!A.includes(M)))})},[K]),q=q0.useRef(null),N=_7((L)=>{if(F&&!Z)return Lj;if(!L||L===Lj||U.current!==$||Q!=null){let A=new Map;for(let M of $){if(!M)continue;if(Q&&Q.length>0&&!Q.includes(M.id)&&M.rect.current){A.set(M.id,M.rect.current);continue}let _=M.node.current,P=_?new Zz(G(_),_):null;if(M.rect.current=P,P)A.set(M.id,P)}return A}return L},[$,Q,Z,F,G]);return q0.useEffect(()=>{U.current=$},[$]),q0.useEffect(()=>{if(F)return;W()},[Z,F]),q0.useEffect(()=>{if(Q&&Q.length>0)X(null)},[JSON.stringify(Q)]),q0.useEffect(()=>{if(F||typeof z!=="number"||q.current!==null)return;q.current=setTimeout(()=>{W(),q.current=null},z)},[z,F,W,...H]),{droppableRects:N,measureDroppableContainers:W,measuringScheduled:Q!=null};function V(){switch(Y){case HH.Always:return!1;case HH.BeforeDragging:return Z;default:return!Z}}}function OW($,J){return _7((Z)=>{if(!$)return null;if(Z)return Z;return typeof J==="function"?J($):$},[J,$])}function xr($,J){return OW($,J)}function vr($){let{callback:J,disabled:Z}=$,H=oZ(J),B=q0.useMemo(()=>{if(Z||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:Q}=window;return new Q(H)},[H,Z]);return q0.useEffect(()=>{return()=>B==null?void 0:B.disconnect()},[B]),B}function Bz($){let{callback:J,disabled:Z}=$,H=oZ(J),B=q0.useMemo(()=>{if(Z||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:Q}=window;return new Q(H)},[Z]);return q0.useEffect(()=>{return()=>B==null?void 0:B.disconnect()},[B]),B}function gr($){return new Zz(BH($),$)}function Vj($,J,Z){if(J===void 0)J=gr;let[H,B]=q0.useState(null);function Q(){B((G)=>{if(!$)return null;if($.isConnected===!1){var Y;return(Y=G!=null?G:Z)!=null?Y:null}let U=J($);if(JSON.stringify(G)===JSON.stringify(U))return G;return U})}let X=vr({callback(G){if(!$)return;for(let Y of G){let{type:U,target:F}=Y;if(U==="childList"&&F instanceof HTMLElement&&F.contains($)){Q();break}}}}),z=Bz({callback:Q});return J9(()=>{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()},[$]),H}function fr($){let J=OW($);return Cj($,J)}var Aj=[];function mr($){let J=q0.useRef($),Z=_7((H)=>{if(!$)return Aj;if(H&&H!==Aj&&$&&J.current&&$.parentNode===J.current.parentNode)return H;return _W($)},[$]);return q0.useEffect(()=>{J.current=$},[$]),Z}function pr($){let[J,Z]=q0.useState(null),H=q0.useRef($),B=q0.useCallback((Q)=>{let X=NW(Q.target);if(!X)return;Z((z)=>{if(!z)return null;return z.set(X,AW(X)),new Map(z)})},[]);return q0.useEffect(()=>{let Q=H.current;if($!==Q){X(Q);let z=$.map((G)=>{let Y=NW(G);if(Y)return Y.addEventListener("scroll",B,{passive:!0}),[Y,AW(Y)];return null}).filter((G)=>G!=null);Z(z.length?new Map(z):null),H.current=$}return()=>{X($),X(Q)};function X(z){z.forEach((G)=>{let Y=NW(G);Y==null||Y.removeEventListener("scroll",B)})}},[B,$]),q0.useMemo(()=>{if($.length)return J?Array.from(J.values()).reduce((Q,X)=>u$(Q,X),M8):bj($);return M8},[$,J])}function Dj($,J){if(J===void 0)J=[];let Z=q0.useRef(null);return q0.useEffect(()=>{Z.current=null},J),q0.useEffect(()=>{let H=$!==M8;if(H&&!Z.current)Z.current=$;if(!H&&Z.current)Z.current=null},[$]),Z.current?$H($,Z.current):M8}function ur($){q0.useEffect(()=>{if(!nZ)return;let J=$.map((Z)=>{let{sensor:H}=Z;return H.setup==null?void 0:H.setup()});return()=>{for(let Z of J)Z==null||Z()}},$.map((J)=>{let{sensor:Z}=J;return Z}))}function cr($,J){return q0.useMemo(()=>{return $.reduce((Z,H)=>{let{eventName:B,handler:Q}=H;return Z[B]=(X)=>{Q(X,J)},Z},{})},[$,J])}function gj($){return q0.useMemo(()=>$?Lr($):null,[$])}var Mj=[];function dr($,J){if(J===void 0)J=BH;let[Z]=$,H=gj(Z?h2(Z):null),[B,Q]=q0.useState(Mj);function X(){Q(()=>{if(!$.length)return Mj;return $.map((G)=>Rj(G)?H:new Zz(J(G),G))})}let z=Bz({callback:X});return J9(()=>{z==null||z.disconnect(),X(),$.forEach((G)=>z==null?void 0:z.observe(G))},[$]),B}function fj($){if(!$)return null;if($.children.length>1)return $;let J=$.children[0];return M7(J)?J:$}function lr($){let{measure:J}=$,[Z,H]=q0.useState(null),B=q0.useCallback((Y)=>{for(let{target:U}of Y)if(M7(U)){H((F)=>{let K=J(U);return F?{...F,width:K.width,height:K.height}:K});break}},[J]),Q=Bz({callback:B}),X=q0.useCallback((Y)=>{let U=fj(Y);if(Q==null||Q.disconnect(),U)Q==null||Q.observe(U);H(U?J(U):null)},[J,Q]),[z,G]=sZ(X);return q0.useMemo(()=>({nodeRef:z,rect:Z,setRef:G}),[Z,z,G])}var ir=[{sensor:XH,options:{}},{sensor:QH,options:{}}],rr={current:{}},eX={draggable:{measure:Kj},droppable:{measure:Kj,strategy:HH.WhileDragging,frequency:MW.Optimized},dragOverlay:{measure:BH}};class j7 extends Map{get($){var J;return $!=null?(J=super.get($))!=null?J:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(($)=>{let{disabled:J}=$;return!J})}getNodeFor($){var J,Z;return(J=(Z=this.get($))==null?void 0:Z.node.current)!=null?J:void 0}}var ar={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new j7,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:$z},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:eX,measureDroppableContainers:$z,windowRect:null,measuringScheduled:!1},mj={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:$z,draggableNodes:new Map,over:null,measureDroppableContainers:$z},zH=q0.createContext(mj),pj=q0.createContext(ar);function nr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new j7}}}function or($,J){switch(J.type){case H2.DragStart:return{...$,draggable:{...$.draggable,initialCoordinates:J.initialCoordinates,active:J.active}};case H2.DragMove:if($.draggable.active==null)return $;return{...$,draggable:{...$.draggable,translate:{x:J.coordinates.x-$.draggable.initialCoordinates.x,y:J.coordinates.y-$.draggable.initialCoordinates.y}}};case H2.DragEnd:case H2.DragCancel:return{...$,draggable:{...$.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case H2.RegisterDroppable:{let{element:Z}=J,{id:H}=Z,B=new j7($.droppable.containers);return B.set(H,Z),{...$,droppable:{...$.droppable,containers:B}}}case H2.SetDroppableDisabled:{let{id:Z,key:H,disabled:B}=J,Q=$.droppable.containers.get(Z);if(!Q||H!==Q.key)return $;let X=new j7($.droppable.containers);return X.set(Z,{...Q,disabled:B}),{...$,droppable:{...$.droppable,containers:X}}}case H2.UnregisterDroppable:{let{id:Z,key:H}=J,B=$.droppable.containers.get(Z);if(!B||H!==B.key)return $;let Q=new j7($.droppable.containers);return Q.delete(Z),{...$,droppable:{...$.droppable,containers:Q}}}default:return $}}function sr($){let{disabled:J}=$,{active:Z,activatorEvent:H,draggableNodes:B}=q0.useContext(zH),Q=tZ(H),X=tZ(Z==null?void 0:Z.id);return q0.useEffect(()=>{if(J)return;if(!H&&Q&&X!=null){if(!tX(Q))return;if(document.activeElement===Q.target)return;let z=B.get(X);if(!z)return;let{activatorNode:G,node:Y}=z;if(!G.current&&!Y.current)return;requestAnimationFrame(()=>{for(let U of[G.current,Y.current]){if(!U)continue;let F=zj(U);if(F){F.focus();break}}})}},[H,J,B,X,Q]),null}function uj($,J){let{transform:Z,...H}=J;return $!=null&&$.length?$.reduce((B,Q)=>{return Q({transform:B,...H})},Z):Z}function tr($){return q0.useMemo(()=>({draggable:{...eX.draggable,...$==null?void 0:$.draggable},droppable:{...eX.droppable,...$==null?void 0:$.droppable},dragOverlay:{...eX.dragOverlay,...$==null?void 0:$.dragOverlay}}),[$==null?void 0:$.draggable,$==null?void 0:$.droppable,$==null?void 0:$.dragOverlay])}function er($){let{activeNode:J,measure:Z,initialRect:H,config:B=!0}=$,Q=q0.useRef(!1),{x:X,y:z}=typeof B==="boolean"?{x:B,y:B}:B;J9(()=>{if(!X&&!z||!J){Q.current=!1;return}if(Q.current||!H)return;let Y=J==null?void 0:J.node.current;if(!Y||Y.isConnected===!1)return;let U=Z(Y),F=Cj(U,H);if(!X)F.x=0;if(!z)F.y=0;if(Q.current=!0,Math.abs(F.x)>0||Math.abs(F.y)>0){let K=Ej(Y);if(K)K.scrollBy({top:F.y,left:F.x})}},[J,X,z,H,Z])}var Qz=q0.createContext({...M8,scaleX:1,scaleY:1}),K3;(function($){$[$.Uninitialized=0]="Uninitialized",$[$.Initializing=1]="Initializing",$[$.Initialized=2]="Initialized"})(K3||(K3={}));var cj=q0.memo(function(J){var Z,H,B,Q;let{id:X,accessibility:z,autoScroll:G=!0,children:Y,sensors:U=ir,collisionDetection:F=Ur,measuring:K,modifiers:W,...q}=J,N=q0.useReducer(or,void 0,nr),[V,L]=N,[A,M]=$r(),[_,P]=q0.useState(K3.Uninitialized),D=_===K3.Initialized,{draggable:{active:w,nodes:R,translate:b},droppable:{containers:E}}=V,x=w!=null?R.get(w):null,I=q0.useRef({initial:null,translated:null}),S=q0.useMemo(()=>{var I0;return w!=null?{id:w,data:(I0=x==null?void 0:x.data)!=null?I0:rr,rect:I}:null},[w,x]),j=q0.useRef(null),[C,k]=q0.useState(null),[y,v]=q0.useState(null),u=P7(q,Object.values(q)),T=eZ("DndDescribedBy",X),t=q0.useMemo(()=>E.getEnabled(),[E]),B0=tr(K),{droppableRects:h,measureDroppableContainers:e,measuringScheduled:A0}=hr(t,{dragging:D,dependencies:[b.x,b.y],config:B0.droppable}),l=br(R,w),z0=q0.useMemo(()=>y?JH(y):null,[y]),W0=a1(),Q0=xr(l,B0.draggable.measure);er({activeNode:w!=null?R.get(w):null,config:W0.layoutShiftCompensation,initialRect:Q0,measure:B0.draggable.measure});let G0=Vj(l,B0.draggable.measure,Q0),L0=Vj(l?l.parentElement:null),i=q0.useRef({activatorEvent:null,active:null,activeNode:l,collisionRect:null,collisions:null,droppableRects:h,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),$0=E.getNodeFor((Z=i.current.over)==null?void 0:Z.id),J0=lr({measure:B0.dragOverlay.measure}),H0=(H=J0.nodeRef.current)!=null?H:l,n=D?(B=J0.rect)!=null?B:G0:null,p=Boolean(J0.nodeRef.current&&J0.rect),d=fr(p?null:G0),m=gj(H0?h2(H0):null),a=mr(D?$0!=null?$0:l:null),o=dr(a),N0=uj(W,{transform:{x:b.x-d.x,y:b.y-d.y,scaleX:1,scaleY:1},activatorEvent:y,active:S,activeNodeRect:G0,containerNodeRect:L0,draggingNodeRect:n,over:i.current.over,overlayNodeRect:J0.rect,scrollableAncestors:a,scrollableAncestorRects:o,windowRect:m}),O0=z0?u$(z0,b):null,g0=pr(a),p0=Dj(g0),f=Dj(g0,[G0]),r=u$(N0,p0),X0=n?Wr(n,N0):null,V0=S&&X0?F({active:S,collisionRect:X0,droppableRects:h,droppableContainers:t,pointerCoordinates:O0}):null,j0=Gr(V0,"id"),[v0,Q1]=q0.useState(null),U1=p?N0:u$(N0,f),c0=Fr(U1,(Q=v0==null?void 0:v0.rect)!=null?Q:null,G0),y0=q0.useRef(null),d0=q0.useCallback((I0,k0)=>{let{sensor:R0,options:n0}=k0;if(j.current==null)return;let F1=R.get(j.current);if(!F1)return;let C1=I0.nativeEvent,e1=new R0({active:j.current,activeNode:F1,event:C1,options:n0,context:i,onAbort(A1){if(!R.get(A1))return;let{onDragAbort:m5}=u.current,l5={id:A1};m5==null||m5(l5),A({type:"onDragAbort",event:l5})},onPending(A1,V5,m5,l5){if(!R.get(A1))return;let{onDragPending:Z1}=u.current,u0={id:A1,constraint:V5,initialCoordinates:m5,offset:l5};Z1==null||Z1(u0),A({type:"onDragPending",event:u0})},onStart(A1){let V5=j.current;if(V5==null)return;let m5=R.get(V5);if(!m5)return;let{onDragStart:l5}=u.current,x0={activatorEvent:C1,active:{id:V5,data:m5.data,rect:I}};d$.unstable_batchedUpdates(()=>{l5==null||l5(x0),P(K3.Initializing),L({type:H2.DragStart,initialCoordinates:A1,active:V5}),A({type:"onDragStart",event:x0}),k(y0.current),v(C1)})},onMove(A1){L({type:H2.DragMove,coordinates:A1})},onEnd:$5(H2.DragEnd),onCancel:$5(H2.DragCancel)});y0.current=e1;function $5(A1){return async function(){let{active:m5,collisions:l5,over:x0,scrollAdjustedTranslate:Z1}=i.current,u0=null;if(m5&&Z1){let{cancelDrop:q1}=u.current;if(u0={activatorEvent:C1,active:m5,collisions:l5,delta:Z1,over:x0},A1===H2.DragEnd&&typeof q1==="function"){if(await Promise.resolve(q1(u0)))A1=H2.DragCancel}}j.current=null,d$.unstable_batchedUpdates(()=>{L({type:A1}),P(K3.Uninitialized),Q1(null),k(null),v(null),y0.current=null;let q1=A1===H2.DragEnd?"onDragEnd":"onDragCancel";if(u0){let b1=u.current[q1];b1==null||b1(u0),A({type:q1,event:u0})}})}}},[R]),Z0=q0.useCallback((I0,k0)=>{return(R0,n0)=>{let F1=R0.nativeEvent,C1=R.get(n0);if(j.current!==null||!C1||F1.dndKit||F1.defaultPrevented)return;let e1={active:C1};if(I0(R0,k0.options,e1)===!0)F1.dndKit={capturedBy:k0.sensor},j.current=n0,d0(R0,k0)}},[R,d0]),T0=yr(U,Z0);ur(U),J9(()=>{if(G0&&_===K3.Initializing)P(K3.Initialized)},[G0,_]),q0.useEffect(()=>{let{onDragMove:I0}=u.current,{active:k0,activatorEvent:R0,collisions:n0,over:F1}=i.current;if(!k0||!R0)return;let C1={active:k0,activatorEvent:R0,collisions:n0,delta:{x:r.x,y:r.y},over:F1};d$.unstable_batchedUpdates(()=>{I0==null||I0(C1),A({type:"onDragMove",event:C1})})},[r.x,r.y]),q0.useEffect(()=>{let{active:I0,activatorEvent:k0,collisions:R0,droppableContainers:n0,scrollAdjustedTranslate:F1}=i.current;if(!I0||j.current==null||!k0||!F1)return;let{onDragOver:C1}=u.current,e1=n0.get(j0),$5=e1&&e1.rect.current?{id:e1.id,rect:e1.rect.current,data:e1.data,disabled:e1.disabled}:null,A1={active:I0,activatorEvent:k0,collisions:R0,delta:{x:F1.x,y:F1.y},over:$5};d$.unstable_batchedUpdates(()=>{Q1($5),C1==null||C1(A1),A({type:"onDragOver",event:A1})})},[j0]),J9(()=>{i.current={activatorEvent:y,active:S,activeNode:l,collisionRect:X0,collisions:V0,droppableRects:h,draggableNodes:R,draggingNode:H0,draggingNodeRect:n,droppableContainers:E,over:v0,scrollableAncestors:a,scrollAdjustedTranslate:r},I.current={initial:n,translated:X0}},[S,l,V0,X0,R,H0,n,h,E,v0,a,r]),Ir({...W0,delta:b,draggingRect:X0,pointerCoordinates:O0,scrollableAncestors:a,scrollableAncestorRects:o});let H1=q0.useMemo(()=>{return{active:S,activeNode:l,activeNodeRect:G0,activatorEvent:y,collisions:V0,containerNodeRect:L0,dragOverlay:J0,draggableNodes:R,droppableContainers:E,droppableRects:h,over:v0,measureDroppableContainers:e,scrollableAncestors:a,scrollableAncestorRects:o,measuringConfiguration:B0,measuringScheduled:A0,windowRect:m}},[S,l,G0,y,V0,L0,J0,R,E,h,v0,e,a,o,B0,A0,m]),G1=q0.useMemo(()=>{return{activatorEvent:y,activators:T0,active:S,activeNodeRect:G0,ariaDescribedById:{draggable:T},dispatch:L,draggableNodes:R,over:v0,measureDroppableContainers:e}},[y,T0,S,G0,L,T,R,v0,e]);return q0.default.createElement(Oj.Provider,{value:M},q0.default.createElement(zH.Provider,{value:G1},q0.default.createElement(pj.Provider,{value:H1},q0.default.createElement(Qz.Provider,{value:c0},Y)),q0.default.createElement(sr,{disabled:(z==null?void 0:z.restoreFocus)===!1})),q0.default.createElement(Hr,{...z,hiddenTextDescribedById:T}));function a1(){let I0=(C==null?void 0:C.autoScrollEnabled)===!1,k0=typeof G==="object"?G.enabled===!1:G===!1,R0=D&&!I0&&!k0;if(typeof G==="object")return{...G,enabled:R0};return{enabled:R0}}}),$a=q0.createContext(null),Pj="button",Ja="Draggable";function dj($){let{id:J,data:Z,disabled:H=!1,attributes:B}=$,Q=eZ(Ja),{activators:X,activatorEvent:z,active:G,activeNodeRect:Y,ariaDescribedById:U,draggableNodes:F,over:K}=q0.useContext(zH),{role:W=Pj,roleDescription:q="draggable",tabIndex:N=0}=B!=null?B:{},V=(G==null?void 0:G.id)===J,L=q0.useContext(V?Qz:$a),[A,M]=sZ(),[_,P]=sZ(),D=cr(X,J),w=P7(Z);J9(()=>{return F.set(J,{id:J,key:Q,node:A,activatorNode:_,data:w}),()=>{let b=F.get(J);if(b&&b.key===Q)F.delete(J)}},[F,J]);let R=q0.useMemo(()=>({role:W,tabIndex:N,"aria-disabled":H,"aria-pressed":V&&W===Pj?!0:void 0,"aria-roledescription":q,"aria-describedby":U.draggable}),[H,W,N,V,q,U.draggable]);return{active:G,activatorEvent:z,activeNodeRect:Y,attributes:R,isDragging:V,listeners:H?void 0:D,node:A,over:K,setNodeRef:M,setActivatorNodeRef:P,transform:L}}function Za(){return q0.useContext(pj)}var Ha="Droppable",Ba={timeout:25};function lj($){let{data:J,disabled:Z=!1,id:H,resizeObserverConfig:B}=$,Q=eZ(Ha),{active:X,dispatch:z,over:G,measureDroppableContainers:Y}=q0.useContext(zH),U=q0.useRef({disabled:Z}),F=q0.useRef(!1),K=q0.useRef(null),W=q0.useRef(null),{disabled:q,updateMeasurementsFor:N,timeout:V}={...Ba,...B},L=P7(N!=null?N:H),A=q0.useCallback(()=>{if(!F.current){F.current=!0;return}if(W.current!=null)clearTimeout(W.current);W.current=setTimeout(()=>{Y(Array.isArray(L.current)?L.current:[L.current]),W.current=null},V)},[V]),M=Bz({callback:A,disabled:q||!X}),_=q0.useCallback((R,b)=>{if(!M)return;if(b)M.unobserve(b),F.current=!1;if(R)M.observe(R)},[M]),[P,D]=sZ(_),w=P7(J);return q0.useEffect(()=>{if(!M||!P.current)return;M.disconnect(),F.current=!1,M.observe(P.current)},[P,M]),q0.useEffect(()=>{return z({type:H2.RegisterDroppable,element:{id:H,key:Q,disabled:Z,node:P,rect:K,data:w}}),()=>z({type:H2.UnregisterDroppable,key:Q,id:H})},[H]),q0.useEffect(()=>{if(Z!==U.current.disabled)z({type:H2.SetDroppableDisabled,id:H,key:Q,disabled:Z}),U.current.disabled=Z},[H,Q,Z,z]),{active:X,rect:K,isOver:(G==null?void 0:G.id)===H,node:P,over:G,setNodeRef:D}}function Qa($){let{animation:J,children:Z}=$,[H,B]=q0.useState(null),[Q,X]=q0.useState(null),z=tZ(Z);if(!Z&&!H&&z)B(z);return J9(()=>{if(!Q)return;let G=H==null?void 0:H.key,Y=H==null?void 0:H.props.id;if(G==null||Y==null){B(null);return}Promise.resolve(J(Y,Q)).then(()=>{B(null)})},[J,H,Q]),q0.default.createElement(q0.default.Fragment,null,Z,H?q0.cloneElement(H,{ref:X}):null)}var Xa={x:0,y:0,scaleX:1,scaleY:1};function za($){let{children:J}=$;return q0.default.createElement(zH.Provider,{value:mj},q0.default.createElement(Qz.Provider,{value:Xa},J))}var Ga={position:"fixed",touchAction:"none"},Ya=($)=>{return tX($)?"transform 250ms ease":void 0},Ua=q0.forwardRef(($,J)=>{let{as:Z,activatorEvent:H,adjustScale:B,children:Q,className:X,rect:z,style:G,transform:Y,transition:U=Ya}=$;if(!z)return null;let F=B?Y:{...Y,scaleX:1,scaleY:1},K={...Ga,width:z.width,height:z.height,top:z.top,left:z.left,transform:D7.Transform.toString(F),transformOrigin:B&&H?Qr(H,z):void 0,transition:typeof U==="function"?U(H):U,...G};return q0.default.createElement(Z,{className:X,style:K,ref:J},Q)}),Fa=($)=>(J)=>{let{active:Z,dragOverlay:H}=J,B={},{styles:Q,className:X}=$;if(Q!=null&&Q.active)for(let[z,G]of Object.entries(Q.active)){if(G===void 0)continue;B[z]=Z.node.style.getPropertyValue(z),Z.node.style.setProperty(z,G)}if(Q!=null&&Q.dragOverlay)for(let[z,G]of Object.entries(Q.dragOverlay)){if(G===void 0)continue;H.node.style.setProperty(z,G)}if(X!=null&&X.active)Z.node.classList.add(X.active);if(X!=null&&X.dragOverlay)H.node.classList.add(X.dragOverlay);return function(){for(let[G,Y]of Object.entries(B))Z.node.style.setProperty(G,Y);if(X!=null&&X.active)Z.node.classList.remove(X.active)}},Ka=($)=>{let{transform:{initial:J,final:Z}}=$;return[{transform:D7.Transform.toString(J)},{transform:D7.Transform.toString(Z)}]},Wa={duration:250,easing:"ease",keyframes:Ka,sideEffects:Fa({styles:{active:{opacity:"0"}}})};function qa($){let{config:J,draggableNodes:Z,droppableContainers:H,measuringConfiguration:B}=$;return oZ((Q,X)=>{if(J===null)return;let z=Z.get(Q);if(!z)return;let G=z.node.current;if(!G)return;let Y=fj(X);if(!Y)return;let{transform:U}=h2(X).getComputedStyle(X),F=wj(U);if(!F)return;let K=typeof J==="function"?J:Na(J);return yj(G,B.draggable.measure),K({active:{id:Q,data:z.data,node:G,rect:B.draggable.measure(G)},draggableNodes:Z,dragOverlay:{node:X,rect:B.dragOverlay.measure(Y)},droppableContainers:H,measuringConfiguration:B,transform:F})})}function Na($){let{duration:J,easing:Z,sideEffects:H,keyframes:B}={...Wa,...$};return(Q)=>{let{active:X,dragOverlay:z,transform:G,...Y}=Q;if(!J)return;let U={x:z.rect.left-X.rect.left,y:z.rect.top-X.rect.top},F={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,...F},W=B({...Y,active:X,dragOverlay:z,transform:{initial:G,final:K}}),[q]=W,N=W[W.length-1];if(JSON.stringify(q)===JSON.stringify(N))return;let V=H==null?void 0:H({active:X,dragOverlay:z,...Y}),L=z.node.animate(W,{duration:J,easing:Z,fill:"forwards"});return new Promise((A)=>{L.onfinish=()=>{V==null||V(),A()}})}}var _j=0;function La($){return q0.useMemo(()=>{if($==null)return;return _j++,_j},[$])}var ij=q0.default.memo(($)=>{let{adjustScale:J=!1,children:Z,dropAnimation:H,style:B,transition:Q,modifiers:X,wrapperElement:z="div",className:G,zIndex:Y=999}=$,{activatorEvent:U,active:F,activeNodeRect:K,containerNodeRect:W,draggableNodes:q,droppableContainers:N,dragOverlay:V,over:L,measuringConfiguration:A,scrollableAncestors:M,scrollableAncestorRects:_,windowRect:P}=Za(),D=q0.useContext(Qz),w=La(F==null?void 0:F.id),R=uj(X,{activatorEvent:U,active:F,activeNodeRect:K,containerNodeRect:W,draggingNodeRect:V.rect,over:L,overlayNodeRect:V.rect,scrollableAncestors:M,scrollableAncestorRects:_,transform:D,windowRect:P}),b=OW(K),E=qa({config:H,draggableNodes:q,droppableContainers:N,measuringConfiguration:A}),x=b?V.setRef:void 0;return q0.default.createElement(za,null,q0.default.createElement(Qa,{animation:E},F&&w?q0.default.createElement(Ua,{key:w,id:F.id,ref:x,as:z,activatorEvent:U,adjustScale:J,className:G,transition:Q,rect:b,style:{zIndex:Y,...B},transform:R},Z):null))});var l$=O(c(),1),Va={start:[x1.Space],cancel:[x1.Esc],end:[x1.Space,x1.Tab]};function Aa($,J,Z){let H=$.indexOf(J),B=$.indexOf(Z);if(H<0||B<0||H===B)return $;let Q=[...$],[X]=Q.splice(H,1);return Q.splice(B,0,X),Q}function Xz({items:$,getId:J,className:Z,itemClassName:H,dragDisabled:B=!1,onReorder:Q,renderItem:X,renderPlaceholder:z,renderOverlay:G}){let Y=jj(PW(XH,{activationConstraint:{distance:4}}),PW(QH,{keyboardCodes:Va})),[U,F]=W3.useState(null),[K,W]=W3.useState(null),q=W3.useRef(null),N=W3.useMemo(()=>$.map(J),[$,J]),V=W3.useMemo(()=>new Map($.map((w)=>[J(w),w])),[$,J]),A=(U&&K?K:N).map((w)=>V.get(w)).filter((w)=>Boolean(w)),M=U?V.get(U):void 0,_=B||$.length<2;return l$.jsxs(cj,{sensors:Y,collisionDetection:Tj,onDragStart:(w)=>{let R=$.map(J);F(String(w.active.id)),q.current=R,W(R)},onDragOver:(w)=>{let R=String(w.active.id),b=w.over?String(w.over.id):void 0,E=q.current;if(!b||b===R||!E)return;let x=Aa(E,R,b);if(x===E)return;q.current=x,W(x)},onDragCancel:()=>{q.current=null,F(null),W(null)},onDragEnd:(w)=>{let R=String(w.active.id),b=q.current;if(q.current=null,F(null),W(null),!b||b.join("|")===N.join("|"))return;if(!b.includes(R))return;Q(b)},children:[l$.jsx("div",{className:Z,children:A.map((w)=>l$.jsx(Da,{id:J(w),item:w,disabled:_,itemClassName:H,renderItem:X,renderPlaceholder:z},J(w)))}),l$.jsx(ij,{dropAnimation:null,children:M&&G?G(M):null})]})}function Da({id:$,item:J,disabled:Z,itemClassName:H,renderItem:B,renderPlaceholder:Q}){let{setNodeRef:X,isOver:z}=lj({id:$,disabled:Z}),{attributes:G,listeners:Y,setNodeRef:U,isDragging:F}=dj({id:$,disabled:Z,attributes:{roleDescription:"sortable item"}}),K=(q)=>{X(q),U(q)},W={isDragging:F,isOver:z,dragDisabled:Z,dragHandleProps:Z?{}:{...G,...Y}};return l$.jsxs(r1.div,{layout:!0,ref:K,className:s("relative",H?.(J,W)),transition:{type:"spring",duration:0.25,bounce:0},children:[F&&Q?.(J),B(J,W)]})}var K1=O(c(),1);function Ma($){return s(g$({variant:"ghost",size:"icon"}),$&&"bg-accent text-accent-foreground")}function zz({children:$,showWorkspaces:J=!0}){let{data:Z}=MX(),H=s0();return Z2((B)=>{if(B.type==="workspace:updated"||B.type==="workspaces-list:updated")H.invalidateQueries({queryKey:w0.all,exact:!0})}),K1.jsxs("div",{className:s("flex h-dvh bg-muted"),children:[K1.jsx(Pa,{workspaces:J?Z??[]:[]}),K1.jsx("main",{className:"flex min-w-0 flex-1 flex-col",children:$})]})}function Pa({workspaces:$}){let J=l_(),{cloudDemo:Z}=$9();return K1.jsx(NX,{delay:500,children:K1.jsxs("aside",{className:"flex h-full shrink-0 flex-col items-center gap-4 px-2 py-5 [font-family:var(--default-sans)]",children:[K1.jsxs(d1,{children:[K1.jsx(l1,{render:K1.jsx(GZ,{href:"/","aria-label":"Home",className:Ma,children:K1.jsx(aj,{stroke:1.5})})}),K1.jsx(i1,{side:"right",children:"Home"})]}),K1.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&&K1.jsxs(K1.Fragment,{children:[K1.jsx("div",{className:"no-scrollbar min-h-0 scroll-fade overflow-y-auto [--scroll-fade-reveal:16px]",children:K1.jsx(Xz,{items:$,getId:(H)=>H.id,className:"flex flex-col gap-4",onReorder:(H)=>J.mutate(H),renderPlaceholder:()=>K1.jsx("div",{className:"pointer-events-none absolute top-0 left-1 size-10 rounded-xl bg-accent"}),renderOverlay:(H)=>K1.jsx(rj,{workspace:H,dragOverlay:!0}),renderItem:(H,B)=>K1.jsx(rj,{workspace:H,dragState:B})})}),K1.jsx("div",{className:"shrink-0",children:K1.jsxs(d1,{children:[K1.jsx(aZ,{trigger:K1.jsx(l1,{render:K1.jsx(C0,{type:"button",variant:"ghost",size:"icon-lg","aria-label":"Create new workspace",className:"text-muted-foreground hover:text-foreground",children:K1.jsx(F4,{"data-icon":"inline-start",stroke:1.5})})})}),K1.jsx(i1,{side:"right",children:"Create new workspace"})]})})]})}),K1.jsx("div",{className:"size-8 shrink-0",children:Z?K1.jsx(V7,{trigger:K1.jsx(C0,{size:"icon","aria-label":"Unlock all features",title:"Unlock all features",children:K1.jsx(nj,{stroke:1.5})})}):K1.jsx(e_,{})})]})})}function rj({workspace:$,dragOverlay:J=!1,dragState:Z}){let[H]=m4(),B=`/workspace/${$.id}`,Q=f$($),X=H===B||H.startsWith(`${B}/`),z=K1.jsx("div",{className:s(g$({variant:"ghost",size:"icon-lg"}),"pointer-events-none size-12",J?"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&&!J&&"bg-accent text-accent-foreground"),children:K1.jsx("img",{src:$.icon??D8[$.type??"claude-code"],alt:"",className:"size-7 shrink-0 rounded-xs"})}),G=K1.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(J)return K1.jsxs("span",{className:"flex w-14 flex-col items-center",children:[z,G]});return K1.jsxs(GZ,{href:B,"aria-label":Q,onClick:(Y)=>{if(Z?.isDragging)Y.preventDefault()},className:s("group flex w-14 flex-col items-center rounded-lg outline-none",Z?.isDragging&&"invisible"),...Z?.dragHandleProps,children:[z,K1.jsxs(d1,{children:[K1.jsx(l1,{render:G}),K1.jsx(i1,{side:"right",children:Q})]})]})}var fC=O(g(),1);var oj=O(g(),1);var T7=O(c(),1);function _a({choice:$,availability:J,isPending:Z,errorMessage:H,onTypeChange:B,onCancel:Q,onSubmit:X}){return T7.jsx(aX,{title:`Import ${f$($.workspace)}`,selectedType:$.selectedType,detectedTypes:$.workspace.types,availability:J,isPending:Z,errorMessage:H,secondaryAction:T7.jsx(C0,{variant:"secondary",onClick:Q,disabled:Z,children:"Cancel"}),primaryLabel:"Add workspace",pendingLabel:"Adding…",onTypeChange:B,onSubmit:X})}function sj({choice:$,availability:J,isPending:Z,errorMessage:H,onTypeChange:B,onSubmit:Q,onReset:X}){let[z,G]=oj.useState(!0);function Y(F){if(!F&&Z)return;G(F)}function U(F){if(!F)X()}return T7.jsx(z3,{open:z,onOpenChange:Y,onOpenChangeComplete:U,children:T7.jsx(nX,{closeDisabled:Z,children:T7.jsx(_a,{choice:$,availability:J,isPending:Z,errorMessage:H,onTypeChange:B,onCancel:()=>G(!1),onSubmit:Q})})})}var tj=O(g(),1);function Oa($){return $.types[0]??N7[0]}function ej({onSuccess:$}){let J=c_(),[Z,H]=tj.useState(null);function B(G){J.reset(),H({workspace:G,selectedType:Oa(G)})}function Q(G){H((Y)=>Y?{...Y,selectedType:G}:Y)}function X(){if(!Z||J.isPending)return;J.mutate({path:Z.workspace.path,type:Z.selectedType},{onSuccess:$})}function z(){H(null),J.reset()}return{choice:Z,isPending:J.isPending,error:J.error,startImport:B,selectType:Q,submit:X,reset:z}}var YH=O(g(),1);var UH=O(c(),1),ja=[["OOOOO","O.O.O","O.O.O"],["OOO","O.O","OOO"],["O","O","O"]],q3=10,Gz=3,Ta=2.5,Ca={O:1,o:0.5,".":0},wa=3000,Ea=2,$T=3,N3=3,JT=0.001,i$={courantSquared:0.14,damping:0.976,driveAmplitude:1.4,driveFrequency:0.027,gain:0.65,fadeIn:0.36,fadeOut:0.1};function Sa($){let J=Math.max(...$.map((Q)=>Q.length)),Z=J*q3+(J-1)*Gz,H=$.length*q3+($.length-1)*Gz,B=[];return $.forEach((Q,X)=>{Array.from(Q).forEach((z,G)=>{let Y=Ca[z];if(Y===void 0)return;let U=G*(q3+Gz),F=X*(q3+Gz);B.push({x:U,y:F,centerX:U+q3/2,centerY:F+q3/2,targetOpacity:Y})})}),{width:Z,height:H,fieldColumns:Math.round(Z/N3)+1,fieldRows:Math.round(H/N3)+1,pixels:B}}var Ia=ja.map(Sa);function GH($,J,Z){return $<J?J:$>Z?Z:$}function Ra($){return $<0.5?2*$*$:1-(-2*$+2)**2/2}class ZT{rects;svg;geometry;animationFrame=0;running=!1;intro=!0;introStartedAt=-1;field;previousField;nextField;pointerActive=!1;pointerX=0;pointerY=0;activation=0;constructor($,J,Z){this.rects=$,this.svg=J,this.geometry=Z;let H=Z.fieldColumns*Z.fieldRows;this.field=new Float32Array(H),this.previousField=new Float32Array(H),this.nextField=new Float32Array(H)}start(){this.seedImpulse(),this.activation=1,this.resume()}stop(){cancelAnimationFrame(this.animationFrame),this.running=!1}handlePointerMove=($)=>{let J=this.svg.getBoundingClientRect();if(!J.width||!J.height)return;if(this.pointerActive=$.clientX>=J.left&&$.clientX<=J.right&&$.clientY>=J.top&&$.clientY<=J.bottom,this.pointerActive)this.pointerX=($.clientX-J.left)/J.width*this.geometry.width,this.pointerY=($.clientY-J.top)/J.height*this.geometry.height,this.resume()};seedImpulse(){let $=Math.round(this.geometry.width/2/N3),J=Math.round(this.geometry.height/2/N3),Z=2*$T*$T;for(let H=0;H<this.geometry.fieldRows;H++)for(let B=0;B<this.geometry.fieldColumns;B++){let Q=(B-$)**2+(H-J)**2,X=Ea*Math.exp(-Q/Z),z=H*this.geometry.fieldColumns+B;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 Z=($-this.introStartedAt)/wa;if(this.activation=1-Ra(Math.min(1,Z)),Z>=1)this.intro=!1}else{this.intro=!1;let Z=this.pointerActive?1:0,H=this.pointerActive?i$.fadeIn:i$.fadeOut;this.activation+=(Z-this.activation)*H}let J=this.renderWave();if(this.intro||this.pointerActive||this.activation>JT||J>JT){this.animationFrame=requestAnimationFrame(this.animate);return}this.running=!1,this.activation=0,this.renderTargets()};stepWave(){let{fieldColumns:$,fieldRows:J}=this.geometry;for(let H=1;H<J-1;H++)for(let B=1;B<$-1;B++){let Q=H*$+B,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]+i$.courantSquared*X)*i$.damping}let Z=this.previousField;this.previousField=this.field,this.field=this.nextField,this.nextField=Z}driveWave($){let J=GH(Math.round(this.pointerX/N3),1,this.geometry.fieldColumns-2),Z=GH(Math.round(this.pointerY/N3),1,this.geometry.fieldRows-2);this.field[Z*this.geometry.fieldColumns+J]=i$.driveAmplitude*Math.sin($*i$.driveFrequency)}sampleField($,J){let Z=GH($/N3,0,this.geometry.fieldColumns-1),H=GH(J/N3,0,this.geometry.fieldRows-1),B=Math.floor(Z),Q=Math.floor(H),X=Math.min(B+1,this.geometry.fieldColumns-1),z=Math.min(Q+1,this.geometry.fieldRows-1),G=Z-B,Y=H-Q,{fieldColumns:U}=this.geometry,F=this.field[Q*U+B],K=this.field[Q*U+X],W=this.field[z*U+B],q=this.field[z*U+X];return(F*(1-G)+K*G)*(1-Y)+(W*(1-G)+q*G)*Y}renderWave(){let $=0;return this.geometry.pixels.forEach((J,Z)=>{let H=this.rects[Z];if(!H)return;let B=this.sampleField(J.centerX,J.centerY);$=Math.max($,Math.abs(B));let Q=GH(0.5+B*i$.gain,0,1),X=J.targetOpacity*(1-this.activation)+Q*this.activation;H.setAttribute("opacity",X.toFixed(3))}),$}renderTargets(){this.geometry.pixels.forEach(($,J)=>{this.rects[J]?.setAttribute("opacity",String($.targetOpacity))})}}function ka({geometry:$}){let J=YH.useRef([]),Z=YH.useRef(null);return YH.useEffect(()=>{let H=Z.current;if(!H||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let B=new ZT(J.current,H,$);return B.start(),window.addEventListener("pointermove",B.handlePointerMove),()=>{B.stop(),window.removeEventListener("pointermove",B.handlePointerMove)}},[$]),UH.jsx("svg",{ref:Z,className:"h-8 w-auto",viewBox:`0 0 ${$.width} ${$.height}`,fill:"currentColor","aria-hidden":"true",children:$.pixels.map((H,B)=>UH.jsx("rect",{ref:(Q)=>{J.current[B]=Q},x:H.x,y:H.y,width:q3,height:q3,rx:Ta,opacity:H.targetOpacity},`${H.x}-${H.y}`))})}function HT({className:$}){return UH.jsx("div",{role:"img","aria-label":"moi",className:s("flex items-center gap-2 text-accent",$),children:Ia.map((J,Z)=>UH.jsx(ka,{geometry:J},Z))})}var C7={};_4(C7,{Trigger:()=>UT,Root:()=>YT,Panel:()=>WT});var FH=O(g(),1);var S4=O(g(),1);function BT($){let{open:J,defaultOpen:Z,onOpenChange:H,disabled:B}=$,Q=J!==void 0,[X,z]=o4({controlled:J,default:Z,name:"Collapsible",state:"open"}),{mounted:G,setMounted:Y,transitionStatus:U}=d4(X,!0,!0),[F,K]=S4.useState(X),[{height:W,width:q},N]=S4.useState({height:void 0,width:void 0}),V=t0(),[L,A]=S4.useState(),M=L??V,[_,P]=S4.useState(!1),[D,w]=S4.useState(!1),R=S4.useRef(null),b=S4.useRef(null),E=S4.useRef(null),x=S4.useRef(null),I=m8(x,!1),S=K0((j)=>{let C=!X,k=M0(Y0.triggerPress,j.nativeEvent);if(H(C,k),k.isCanceled)return;let y=x.current;if(b.current==="css-animation"&&y!=null)y.style.removeProperty("animation-name");if(!_&&!D){if(b.current!=null&&b.current!=="css-animation"){if(!G&&C)Y(!0)}if(b.current==="css-animation"){if(!F&&C)K(!0);if(!G&&C)Y(!0)}}if(z(C),b.current==="none"&&G&&!C)Y(!1)});return F0(()=>{if(Q&&b.current==="none"&&!D&&!X)Y(!1)},[Q,D,X,J,Y]),S4.useMemo(()=>({abortControllerRef:R,animationTypeRef:b,disabled:B,handleTrigger:S,height:W,mounted:G,open:X,panelId:M,panelRef:x,runOnceAnimationsFinish:I,setDimensions:N,setHiddenUntilFound:P,setKeepMounted:w,setMounted:Y,setOpen:z,setPanelIdState:A,setVisible:K,transitionDimensionRef:E,transitionStatus:U,visible:F,width:q}),[R,b,B,S,W,G,X,M,x,I,N,P,w,Y,z,K,E,U,F,q])}var Yz=O(g(),1),jW=Yz.createContext(void 0);function Uz(){let $=Yz.useContext(jW);if($===void 0)throw Error(E0(15));return $}var r$=function($){return $.open="data-open",$.closed="data-closed",$[$.startingStyle=f8.startingStyle]="startingStyle",$[$.endingStyle=f8.endingStyle]="endingStyle",$}({});var QT=function($){return $.panelOpen="data-panel-open",$}({});var ba={[r$.open]:""},ya={[r$.closed]:""},XT={open($){if($)return{[QT.panelOpen]:""};return null}},zT={open($){if($)return ba;return ya}};var Fz={...zT,...c1};var GT=O(c(),1),YT=FH.forwardRef(function(J,Z){let{render:H,className:B,defaultOpen:Q=!1,disabled:X=!1,onOpenChange:z,open:G,...Y}=J,U=K0(z),F=BT({open:G,defaultOpen:Q,onOpenChange:U,disabled:X}),K=FH.useMemo(()=>({open:F.open,disabled:F.disabled,transitionStatus:F.transitionStatus}),[F.open,F.disabled,F.transitionStatus]),W=FH.useMemo(()=>({...F,onOpenChange:U,state:K}),[F,U,K]),q=U0("div",J,{state:K,ref:Z,props:Y,stateAttributesMapping:Fz});return GT.jsx(jW.Provider,{value:W,children:q})});var Kz=O(g(),1);var ha={...XT,...c1},UT=Kz.forwardRef(function(J,Z){let{panelId:H,open:B,handleTrigger:Q,state:X,disabled:z}=Uz(),{className:G,disabled:Y=z,id:U,render:F,nativeButton:K=!0,...W}=J,{getButtonProps:q,buttonRef:N}=p5({disabled:Y,focusableWhenDisabled:!0,native:K}),V=Kz.useMemo(()=>({"aria-controls":B?H:void 0,"aria-expanded":B,onClick:Q}),[H,B,Q]);return U0("button",J,{state:X,ref:[Z,N],props:[V,W,q],stateAttributesMapping:ha})});var Wz=O(g(),1);var Z9=O(g(),1);var FT=function($){return $.disabled="data-disabled",$.orientation="data-orientation",$}({});function KT($){let{abortControllerRef:J,animationTypeRef:Z,externalRef:H,height:B,hiddenUntilFound:Q,keepMounted:X,id:z,mounted:G,onOpenChange:Y,open:U,panelRef:F,runOnceAnimationsFinish:K,setDimensions:W,setMounted:q,setOpen:N,setVisible:V,transitionDimensionRef:L,visible:A,width:M}=$,_=Z9.useRef(!1),P=Z9.useRef(null),D=Z9.useRef(U),w=Z9.useRef(U),R=z4(),b=Z9.useMemo(()=>{if(Z.current==="css-animation")return!A;return!U&&!G},[U,G,A,Z]),E=K0((I)=>{if(!I)return;if(Z.current==null||L.current==null){let C=getComputedStyle(I),k=C.animationName!=="none"&&C.animationName!=="",y=C.transitionDuration!=="0s"&&C.transitionDuration!=="";if(k&&y);else if(C.animationName==="none"&&C.transitionDuration!=="0s")Z.current="css-transition";else if(C.animationName!=="none"&&C.transitionDuration==="0s")Z.current="css-animation";else Z.current="none";if(I.getAttribute(FT.orientation)==="horizontal"||C.transitionProperty.indexOf("width")>-1)L.current="width";else L.current="height"}if(Z.current!=="css-transition")return;if(B===void 0||M===void 0){if(W({height:I.scrollHeight,width:I.scrollWidth}),w.current)I.style.setProperty("transition-duration","0s")}let S=-1,j=-1;return S=W5.request(()=>{w.current=!1,j=W5.request(()=>{setTimeout(()=>{I.style.removeProperty("transition-duration")})})}),()=>{W5.cancel(S),W5.cancel(j)}}),x=j4(H,F,E);return F0(()=>{if(Z.current!=="css-transition")return;let I=F.current;if(!I)return;let S=-1;if(J.current!=null)J.current.abort(),J.current=null;if(U){let j={"justify-content":I.style.justifyContent,"align-items":I.style.alignItems,"align-content":I.style.alignContent,"justify-items":I.style.justifyItems};if(Object.keys(j).forEach((C)=>{I.style.setProperty(C,"initial","important")}),!w.current&&!X)I.setAttribute(r$.startingStyle,"");W({height:I.scrollHeight,width:I.scrollWidth}),S=W5.request(()=>{Object.entries(j).forEach(([C,k])=>{if(k==="")I.style.removeProperty(C);else I.style.setProperty(C,k)})})}else{if(I.scrollHeight===0&&I.scrollWidth===0)return;W({height:I.scrollHeight,width:I.scrollWidth});let j=new AbortController;J.current=j;let C=j.signal,k=null,y=r$.endingStyle;return k=new MutationObserver((v)=>{if(v.some((T)=>T.type==="attributes"&&T.attributeName===y))k?.disconnect(),k=null,K(()=>{if(W({height:0,width:0}),I.style.removeProperty("content-visibility"),q(!1),J.current===j)J.current=null},C)}),k.observe(I,{attributes:!0,attributeFilter:[y]}),()=>{if(k?.disconnect(),R.cancel(),J.current===j)j.abort(),J.current=null}}return()=>{W5.cancel(S)}},[J,Z,R,Q,X,G,U,F,K,W,q]),F0(()=>{if(Z.current!=="css-animation")return;let I=F.current;if(!I)return;if(P.current=I.style.animationName||P.current,I.style.setProperty("animation-name","none"),W({height:I.scrollHeight,width:I.scrollWidth}),!D.current&&!_.current)I.style.removeProperty("animation-name");if(U){if(J.current!=null)J.current.abort(),J.current=null;q(!0),V(!0)}else J.current=new AbortController,K(()=>{q(!1),V(!1),J.current=null},J.current.signal)},[J,Z,U,F,K,W,q,V,A]),w2(()=>{let I=W5.request(()=>{D.current=!1});return()=>W5.cancel(I)}),F0(()=>{if(!Q)return;let I=F.current;if(!I)return;let S=-1,j=-1;if(U&&_.current)I.style.transitionDuration="0s",W({height:I.scrollHeight,width:I.scrollWidth}),S=W5.request(()=>{_.current=!1,j=W5.request(()=>{setTimeout(()=>{I.style.removeProperty("transition-duration")})})});return()=>{W5.cancel(S),W5.cancel(j)}},[Q,U,F,W]),F0(()=>{let I=F.current;if(I&&Q&&b){if(I.setAttribute("hidden","until-found"),Z.current==="css-transition")I.setAttribute(r$.startingStyle,"")}},[Q,b,Z,F]),Z9.useEffect(function(){let S=F.current;if(!S)return;function j(C){_.current=!0,N(!0),Y(!0,M0(Y0.none,C))}return S.addEventListener("beforematch",j),()=>{S.removeEventListener("beforematch",j)}},[Y,F,N]),Z9.useMemo(()=>({props:{hidden:b,id:z,ref:x}}),[b,z,x])}var TW=function($){return $.collapsiblePanelHeight="--collapsible-panel-height",$.collapsiblePanelWidth="--collapsible-panel-width",$}({});var WT=Wz.forwardRef(function(J,Z){let{className:H,hiddenUntilFound:B,keepMounted:Q,render:X,id:z,...G}=J,{abortControllerRef:Y,animationTypeRef:U,height:F,mounted:K,onOpenChange:W,open:q,panelId:N,panelRef:V,runOnceAnimationsFinish:L,setDimensions:A,setHiddenUntilFound:M,setKeepMounted:_,setMounted:P,setPanelIdState:D,setOpen:w,setVisible:R,state:b,transitionDimensionRef:E,visible:x,width:I,transitionStatus:S}=Uz(),j=B??!1,C=Q??!1;F0(()=>{if(z)return D(z),()=>{D(void 0)};return},[z,D]),F0(()=>{M(j)},[M,j]),F0(()=>{_(C)},[_,C]);let{props:k}=KT({abortControllerRef:Y,animationTypeRef:U,externalRef:Z,height:F,hiddenUntilFound:j,id:N,keepMounted:C,mounted:K,onOpenChange:W,open:q,panelRef:V,runOnceAnimationsFinish:L,setDimensions:A,setMounted:P,setOpen:w,setVisible:R,transitionDimensionRef:E,visible:x,width:I});b5({open:q&&S==="idle",ref:V,onComplete(){if(!q)return;A({height:void 0,width:void 0})}});let y=Wz.useMemo(()=>({...b,transitionStatus:S}),[b,S]),v=U0("div",J,{state:y,ref:[Z,V],props:[k,{style:{[TW.collapsiblePanelHeight]:F===void 0?"auto":`${F}px`,[TW.collapsiblePanelWidth]:I===void 0?"auto":`${I}px`}},G],stateAttributesMapping:Fz});if(!(C||j||!C&&K))return null;return v});var Vz=O(c(),1);function qz({...$}){return Vz.jsx(C7.Root,{"data-slot":"collapsible",...$})}function Nz({...$}){return Vz.jsx(C7.Trigger,{"data-slot":"collapsible-trigger",...$})}function Lz({...$}){return Vz.jsx(C7.Panel,{"data-slot":"collapsible-content",...$})}var ez=O(g(),1);var xa=($,J)=>{if(typeof $!=="number")return;if(J===3)return{mode:"rgb",r:($>>8&15|$>>4&240)/255,g:($>>4&15|$&240)/255,b:($&15|$<<4&240)/255};if(J===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(J===6)return{mode:"rgb",r:($>>16&255)/255,g:($>>8&255)/255,b:($&255)/255};if(J===8)return{mode:"rgb",r:($>>24&255)/255,g:($>>16&255)/255,b:($>>8&255)/255,alpha:($&255)/255}},Az=xa;var va={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},qT=va;var ga=($)=>{return Az(qT[$.toLowerCase()],6)},NT=ga;var fa=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,ma=($)=>{let J;return(J=$.match(fa))?Az(parseInt(J[1],16),J[1].length):void 0},LT=ma;var Dz="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";var a$="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%";var KH="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var VT="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(deg|grad|rad|turn)|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var L3="\\s*,\\s*";var xj0=new RegExp("^(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)|none)$");var pa=new RegExp(`^rgba?\\(\\s*${Dz}${L3}${Dz}${L3}${Dz}\\s*(?:,\\s*${KH}\\s*)?\\)$`),ua=new RegExp(`^rgba?\\(\\s*${a$}${L3}${a$}${L3}${a$}\\s*(?:,\\s*${KH}\\s*)?\\)$`),ca=($)=>{let J={mode:"rgb"},Z;if(Z=$.match(pa)){if(Z[1]!==void 0)J.r=Z[1]/255;if(Z[2]!==void 0)J.g=Z[2]/255;if(Z[3]!==void 0)J.b=Z[3]/255}else if(Z=$.match(ua)){if(Z[1]!==void 0)J.r=Z[1]/100;if(Z[2]!==void 0)J.g=Z[2]/100;if(Z[3]!==void 0)J.b=Z[3]/100}else return;if(Z[4]!==void 0)J.alpha=Math.max(0,Math.min(1,Z[4]/100));else if(Z[5]!==void 0)J.alpha=Math.max(0,Math.min(1,+Z[5]));return J},AT=ca;var da=($,J)=>$===void 0?void 0:typeof $!=="object"?MT($):$.mode!==void 0?$:J?{...$,mode:J}:void 0,DT=da;var la=($="rgb")=>(J)=>(J=DT(J,$))!==void 0?J.mode===$?J:P8[J.mode][$]?P8[J.mode][$](J):$==="rgb"?P8[J.mode].rgb(J):P8.rgb[$](P8[J.mode].rgb(J)):void 0,Mz=la;var P8={},PT={},WH=[],CW={},ia=($)=>$,p1=($)=>{if(P8[$.mode]={...P8[$.mode],...$.toMode},Object.keys($.fromMode||{}).forEach((J)=>{if(!P8[J])P8[J]={};P8[J][$.mode]=$.fromMode[J]}),!$.ranges)$.ranges={};if(!$.difference)$.difference={};return $.channels.forEach((J)=>{if($.ranges[J]===void 0)$.ranges[J]=[0,1];if(!$.interpolate[J])throw Error(`Missing interpolator for: ${J}`);if(typeof $.interpolate[J]==="function")$.interpolate[J]={use:$.interpolate[J]};if(!$.interpolate[J].fixup)$.interpolate[J].fixup=ia}),PT[$.mode]=$,($.parse||[]).forEach((J)=>{ra(J,$.mode)}),Mz($.mode)},_T=($)=>PT[$],ra=($,J)=>{if(typeof $==="string"){if(!J)throw Error("'mode' required when 'parser' is a string");CW[$]=J}else if(typeof $==="function"){if(WH.indexOf($)<0)WH.push($)}};var wW=/[^\x00-\x7F]|[a-zA-Z_]/,aa=/[^\x00-\x7F]|[-\w]/,D0={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},$1=0;function Pz($){let J=$[$1],Z=$[$1+1];if(J==="-"||J==="+")return/\d/.test(Z)||Z==="."&&/\d/.test($[$1+2]);if(J===".")return/\d/.test(Z);return/\d/.test(J)}function EW($){if($1>=$.length)return!1;let J=$[$1];if(wW.test(J))return!0;if(J==="-"){if($.length-$1<2)return!1;let Z=$[$1+1];if(Z==="-"||wW.test(Z))return!0;return!1}return!1}var na={deg:1,rad:180/Math.PI,grad:0.9,turn:360};function qH($){let J="";if($[$1]==="-"||$[$1]==="+")J+=$[$1++];if(J+=_z($),$[$1]==="."&&/\d/.test($[$1+1]))J+=$[$1++]+_z($);if($[$1]==="e"||$[$1]==="E"){if(($[$1+1]==="-"||$[$1+1]==="+")&&/\d/.test($[$1+2]))J+=$[$1++]+$[$1++]+_z($);else if(/\d/.test($[$1+1]))J+=$[$1++]+_z($)}if(EW($)){let Z=Oz($);if(Z==="deg"||Z==="rad"||Z==="turn"||Z==="grad")return{type:D0.Hue,value:J*na[Z]};return}if($[$1]==="%")return $1++,{type:D0.Percentage,value:+J};return{type:D0.Number,value:+J}}function _z($){let J="";while(/\d/.test($[$1]))J+=$[$1++];return J}function Oz($){let J="";while($1<$.length&&aa.test($[$1]))J+=$[$1++];return J}function oa($){let J=Oz($);if($[$1]==="(")return $1++,{type:D0.Function,value:J};if(J==="none")return{type:D0.None,value:void 0};return{type:D0.Ident,value:J}}function sa($=""){let J=$.trim(),Z=[],H;$1=0;while($1<J.length){if(H=J[$1++],H===`
|
|
29
|
+
`||H==="\t"||H===" "){while($1<J.length&&(J[$1]===`
|
|
30
|
+
`||J[$1]==="\t"||J[$1]===" "))$1++;continue}if(H===",")return;if(H===")"){Z.push({type:D0.ParenClose});continue}if(H==="+"){if($1--,Pz(J)){Z.push(qH(J));continue}return}if(H==="-"){if($1--,Pz(J)){Z.push(qH(J));continue}if(EW(J)){Z.push({type:D0.Ident,value:Oz(J)});continue}return}if(H==="."){if($1--,Pz(J)){Z.push(qH(J));continue}return}if(H==="/"){while($1<J.length&&(J[$1]===`
|
|
31
|
+
`||J[$1]==="\t"||J[$1]===" "))$1++;let B;if(Pz(J)){if(B=qH(J),B.type!==D0.Hue){Z.push({type:D0.Alpha,value:B});continue}}if(EW(J)){if(Oz(J)==="none"){Z.push({type:D0.Alpha,value:{type:D0.None,value:void 0}});continue}}return}if(/\d/.test(H)){$1--,Z.push(qH(J));continue}if(wW.test(H)){$1--,Z.push(oa(J));continue}return}return Z}function ta($){$._i=0;let J=$[$._i++];if(!J||J.type!==D0.Function||J.value!=="color")return;if(J=$[$._i++],J.type!==D0.Ident)return;let Z=CW[J.value];if(!Z)return;let H={mode:Z},B=OT($,!1);if(!B)return;let Q=_T(Z).channels;for(let X=0,z,G;X<Q.length;X++)if(z=B[X],G=Q[X],z.type!==D0.None){if(H[G]=z.type===D0.Number?z.value:z.value/100,G==="alpha")H[G]=Math.max(0,Math.min(1,H[G]))}return H}function OT($,J){let Z=[],H;while($._i<$.length){if(H=$[$._i++],H.type===D0.None||H.type===D0.Number||H.type===D0.Alpha||H.type===D0.Percentage||J&&H.type===D0.Hue){Z.push(H);continue}if(H.type===D0.ParenClose){if($._i<$.length)return;continue}return}if(Z.length<3||Z.length>4)return;if(Z.length===4){if(Z[3].type!==D0.Alpha)return;Z[3]=Z[3].value}if(Z.length===3)Z.push({type:D0.None,value:void 0});return Z.every((B)=>B.type!==D0.Alpha)?Z:void 0}function ea($,J){$._i=0;let Z=$[$._i++];if(!Z||Z.type!==D0.Function)return;let H=OT($,J);if(!H)return;return H.unshift(Z.value),H}var $n=($)=>{if(typeof $!=="string")return;let J=sa($),Z=J?ea(J,!0):void 0,H=void 0,B=0,Q=WH.length;while(B<Q)if((H=WH[B++]($,Z))!==void 0)return H;return J?ta(J):void 0},MT=$n;function Jn($,J){if(!J||J[0]!=="rgb"&&J[0]!=="rgba")return;let Z={mode:"rgb"},[,H,B,Q,X]=J;if(H.type===D0.Hue||B.type===D0.Hue||Q.type===D0.Hue)return;if(H.type!==D0.None)Z.r=H.type===D0.Number?H.value/255:H.value/100;if(B.type!==D0.None)Z.g=B.type===D0.Number?B.value/255:B.value/100;if(Q.type!==D0.None)Z.b=Q.type===D0.Number?Q.value/255:Q.value/100;if(X.type!==D0.None)Z.alpha=Math.min(1,Math.max(0,X.type===D0.Number?X.value:X.value/100));return Z}var jT=Jn;var Zn=($)=>$==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,TT=Zn;var CT=($,J,Z)=>$+Z*(J-$);var Hn=($)=>{let J=[];for(let Z=0;Z<$.length-1;Z++){let H=$[Z],B=$[Z+1];if(H===void 0&&B===void 0)J.push(void 0);else if(H!==void 0&&B!==void 0)J.push([H,B]);else J.push(H!==void 0?[H,H]:[B,B])}return J},wT=($)=>(J)=>{let Z=Hn(J);return(H)=>{let B=H*Z.length,Q=H>=1?Z.length-1:Math.max(Math.floor(B),0),X=Z[Q];return X===void 0?void 0:$(X[0],X[1],B-Q)}};var P0=wT(CT);var M1=($)=>{let J=!1,Z=$.map((H)=>{if(H!==void 0)return J=!0,H;return 1});return J?Z:$};var Bn={mode:"rgb",channels:["r","g","b","alpha"],parse:[jT,LT,AT,NT,TT,"srgb"],serialize:"srgb",interpolate:{r:P0,g:P0,b:P0,alpha:{use:P0,fixup:M1}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},t4=Bn;var SW=($=0)=>Math.pow(Math.abs($),2.19921875)*Math.sign($),Qn=($)=>{let J=SW($.r),Z=SW($.g),H=SW($.b),B={mode:"xyz65",x:0.5766690429101305*J+0.1855582379065463*Z+0.1882286462349947*H,y:0.297344975250536*J+0.6273635662554661*Z+0.0752914584939979*H,z:0.0270313613864123*J+0.0706888525358272*Z+0.9913375368376386*H};if($.alpha!==void 0)B.alpha=$.alpha;return B},IW=Qn;var RW=($)=>Math.pow(Math.abs($),0.4547069271758437)*Math.sign($),Xn=({x:$,y:J,z:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B={mode:"a98",r:RW($*2.0415879038107465-J*0.5650069742788597-0.3447313507783297*Z),g:RW($*-0.9692436362808798+J*1.8759675015077206+0.0415550574071756*Z),b:RW($*0.0134442806320312-J*0.1183623922310184+1.0151749943912058*Z)};if(H!==void 0)B.alpha=H;return B},kW=Xn;var bW=($=0)=>{let J=Math.abs($);if(J<=0.04045)return $/12.92;return(Math.sign($)||1)*Math.pow((J+0.055)/1.055,2.4)},zn=({r:$,g:J,b:Z,alpha:H})=>{let B={mode:"lrgb",r:bW($),g:bW(J),b:bW(Z)};if(H!==void 0)B.alpha=H;return B},e4=zn;var Gn=($)=>{let{r:J,g:Z,b:H,alpha:B}=e4($),Q={mode:"xyz65",x:0.4123907992659593*J+0.357584339383878*Z+0.1804807884018343*H,y:0.2126390058715102*J+0.715168678767756*Z+0.0721923153607337*H,z:0.0193308187155918*J+0.119194779794626*Z+0.9505321522496607*H};if(B!==void 0)Q.alpha=B;return Q},K4=Gn;var yW=($=0)=>{let J=Math.abs($);if(J>0.0031308)return(Math.sign($)||1)*(1.055*Math.pow(J,0.4166666666666667)-0.055);return $*12.92},Yn=({r:$,g:J,b:Z,alpha:H},B="rgb")=>{let Q={mode:B,r:yW($),g:yW(J),b:yW(Z)};if(H!==void 0)Q.alpha=H;return Q},$8=Yn;var Un=({x:$,y:J,z:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=$8({r:$*3.2409699419045226-J*1.537383177570094-0.4986107602930034*Z,g:$*-0.9692436362808796+J*1.8759675015077204+0.0415550574071756*Z,b:$*0.0556300796969936-J*0.2039769588889765+1.0569715142428784*Z});if(H!==void 0)B.alpha=H;return B},W4=Un;var Fn={...t4,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:($)=>kW(K4($)),xyz65:kW},toMode:{rgb:($)=>W4(IW($)),xyz65:IW}},ET=Fn;var Kn=($)=>($=$%360)<0?$+360:$,H5=Kn;var Wn=($,J)=>{return $.map((Z,H,B)=>{if(Z===void 0)return Z;let Q=H5(Z);if(H===0||$[H-1]===void 0)return Q;return J(Q-H5(B[H-1]))}).reduce((Z,H)=>{if(!Z.length||H===void 0||Z[Z.length-1]===void 0)return Z.push(H),Z;return Z.push(H+Z[Z.length-1]),Z},[])},L2=($)=>Wn($,(J)=>Math.abs(J)<=180?J:J-360*Math.sign(J));var o5=[-0.14861,1.78277,-0.29227,-0.90649,1.97294,0],ST=Math.PI/180,IT=180/Math.PI;var RT=o5[3]*o5[4],kT=o5[1]*o5[4],bT=o5[1]*o5[2]-o5[0]*o5[3],qn=({r:$,g:J,b:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=(bT*Z+$*RT-J*kT)/(bT+RT-kT),Q=Z-B,X=(o5[4]*(J-B)-o5[2]*Q)/o5[3],z={mode:"cubehelix",l:B,s:B===0||B===1?void 0:Math.sqrt(Q*Q+X*X)/(o5[4]*B*(1-B))};if(z.s)z.h=Math.atan2(X,Q)*IT-120;if(H!==void 0)z.alpha=H;return z},yT=qn;var Nn=({h:$,s:J,l:Z,alpha:H})=>{let B={mode:"rgb"};if($=($===void 0?0:$+120)*ST,Z===void 0)Z=0;let Q=J===void 0?0:J*Z*(1-Z),X=Math.cos($),z=Math.sin($);if(B.r=Z+Q*(o5[0]*X+o5[1]*z),B.g=Z+Q*(o5[2]*X+o5[3]*z),B.b=Z+Q*(o5[4]*X+o5[5]*z),H!==void 0)B.alpha=H;return B},hT=Nn;var V3=($,J)=>{if($.h===void 0||J.h===void 0||!$.s||!J.s)return 0;let Z=H5($.h),H=H5(J.h),B=Math.sin((H-Z+360)/2*Math.PI/180);return 2*Math.sqrt($.s*J.s)*B},xT=($,J)=>{if($.h===void 0||J.h===void 0)return 0;let Z=H5($.h),H=H5(J.h);if(Math.abs(H-Z)>180)return Z-(H-360*Math.sign(H-Z));return H-Z},A3=($,J)=>{if($.h===void 0||J.h===void 0||!$.c||!J.c)return 0;let Z=H5($.h),H=H5(J.h),B=Math.sin((H-Z+360)/2*Math.PI/180);return 2*Math.sqrt($.c*J.c)*B};var V2=($)=>{let J=$.reduce((H,B)=>{if(B!==void 0){let Q=B*Math.PI/180;H.sin+=Math.sin(Q),H.cos+=Math.cos(Q)}return H},{sin:0,cos:0}),Z=Math.atan2(J.sin,J.cos)*180/Math.PI;return Z<0?360+Z:Z};var Ln={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:yT},toMode:{rgb:hT},interpolate:{h:{use:P0,fixup:L2},s:P0,l:P0,alpha:{use:P0,fixup:M1}},difference:{h:V3},average:{h:V2}},vT=Ln;var Vn=({l:$,a:J,b:Z,alpha:H},B="lch")=>{if(J===void 0)J=0;if(Z===void 0)Z=0;let Q=Math.sqrt(J*J+Z*Z),X={mode:B,l:$,c:Q};if(Q)X.h=H5(Math.atan2(Z,J)*180/Math.PI);if(H!==void 0)X.alpha=H;return X},I4=Vn;var An=({l:$,c:J,h:Z,alpha:H},B="lab")=>{if(Z===void 0)Z=0;let Q={mode:B,l:$,a:J?J*Math.cos(Z/180*Math.PI):0,b:J?J*Math.sin(Z/180*Math.PI):0};if(H!==void 0)Q.alpha=H;return Q},R4=An;var jz=Math.pow(29,3)/Math.pow(3,3),Tz=Math.pow(6,3)/Math.pow(29,3);var O5={X:0.9642956764295677,Y:1,Z:0.8251046025104602},D3={X:0.9504559270516716,Y:1,Z:1.0890577507598784},nT0=Math.pow(29,3)/Math.pow(3,3),oT0=Math.pow(6,3)/Math.pow(29,3);var hW=($)=>Math.pow($,3)>Tz?Math.pow($,3):(116*$-16)/jz,Dn=({l:$,a:J,b:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=($+16)/116,Q=J/500+B,X=B-Z/200,z={mode:"xyz65",x:hW(Q)*D3.X,y:hW(B)*D3.Y,z:hW(X)*D3.Z};if(H!==void 0)z.alpha=H;return z},Cz=Dn;var Mn=($)=>W4(Cz($)),M3=Mn;var xW=($)=>$>Tz?Math.cbrt($):(jz*$+16)/116,Pn=({x:$,y:J,z:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=xW($/D3.X),Q=xW(J/D3.Y),X=xW(Z/D3.Z),z={mode:"lab65",l:116*Q-16,a:500*(B-Q),b:200*(Q-X)};if(H!==void 0)z.alpha=H;return z},wz=Pn;var _n=($)=>{let J=wz(K4($));if($.r===$.b&&$.b===$.g)J.a=J.b=0;return J},P3=_n;var w7=1,Ez=1,n$=0.14444444444444443*Math.PI,E7=Math.cos(n$),S7=Math.sin(n$),Sz=100/Math.log(1.39);var On=({l:$,c:J,h:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B={mode:"lab65",l:(Math.exp($*w7/Sz)-1)/0.0039},Q=(Math.exp(0.0435*J*Ez*w7)-1)/0.075,X=Q*Math.cos(Z/180*Math.PI-n$),z=Q*Math.sin(Z/180*Math.PI-n$);if(B.a=X*E7-z/0.83*S7,B.b=X*S7+z/0.83*E7,H!==void 0)B.alpha=H;return B},NH=On;var jn=({l:$,a:J,b:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=J*E7+Z*S7,Q=0.83*(Z*E7-J*S7),X=Math.sqrt(B*B+Q*Q),z={mode:"dlch",l:Sz/w7*Math.log(1+0.0039*$),c:Math.log(1+0.075*X)/(0.0435*Ez*w7)};if(z.c)z.h=H5((Math.atan2(Q,B)+n$)/Math.PI*180);if(H!==void 0)z.alpha=H;return z},LH=jn;var gT=($)=>NH(I4($,"dlch")),fT=($)=>R4(LH($),"dlab"),Tn={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:gT,rgb:($)=>M3(gT($))},fromMode:{lab65:fT,rgb:($)=>fT(P3($))},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:M1}}},mT=Tn;var Cn={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:NH,dlab:($)=>R4($,"dlab"),rgb:($)=>M3(NH($))},fromMode:{lab65:LH,dlab:($)=>I4($,"dlch"),rgb:($)=>LH(P3($))},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:L2},alpha:{use:P0,fixup:M1}},difference:{h:A3},average:{h:V2}},pT=Cn;function vW({h:$,s:J,i:Z,alpha:H}){if($=H5($!==void 0?$:0),J===void 0)J=0;if(Z===void 0)Z=0;let B=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:Z*(1+J*(3/(2-B)-1)),g:Z*(1+J*(3*(1-B)/(2-B)-1)),b:Z*(1-J)};break;case 1:Q={r:Z*(1+J*(3*(1-B)/(2-B)-1)),g:Z*(1+J*(3/(2-B)-1)),b:Z*(1-J)};break;case 2:Q={r:Z*(1-J),g:Z*(1+J*(3/(2-B)-1)),b:Z*(1+J*(3*(1-B)/(2-B)-1))};break;case 3:Q={r:Z*(1-J),g:Z*(1+J*(3*(1-B)/(2-B)-1)),b:Z*(1+J*(3/(2-B)-1))};break;case 4:Q={r:Z*(1+J*(3*(1-B)/(2-B)-1)),g:Z*(1-J),b:Z*(1+J*(3/(2-B)-1))};break;case 5:Q={r:Z*(1+J*(3/(2-B)-1)),g:Z*(1-J),b:Z*(1+J*(3*(1-B)/(2-B)-1))};break;default:Q={r:Z*(1-J),g:Z*(1-J),b:Z*(1-J)}}if(Q.mode="rgb",H!==void 0)Q.alpha=H;return Q}function gW({r:$,g:J,b:Z,alpha:H}){if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=Math.max($,J,Z),Q=Math.min($,J,Z),X={mode:"hsi",s:$+J+Z===0?0:1-3*Q/($+J+Z),i:($+J+Z)/3};if(B-Q!==0)X.h=(B===$?(J-Z)/(B-Q)+(J<Z)*6:B===J?(Z-$)/(B-Q)+2:($-J)/(B-Q)+4)*60;if(H!==void 0)X.alpha=H;return X}var wn={mode:"hsi",toMode:{rgb:vW},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:gW},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:P0,fixup:L2},s:P0,i:P0,alpha:{use:P0,fixup:M1}},difference:{h:V3},average:{h:V2}},uT=wn;function fW({h:$,s:J,l:Z,alpha:H}){if($=H5($!==void 0?$:0),J===void 0)J=0;if(Z===void 0)Z=0;let B=Z+J*(Z<0.5?Z:1-Z),Q=B-(B-Z)*2*Math.abs($/60%2-1),X;switch(Math.floor($/60)){case 0:X={r:B,g:Q,b:2*Z-B};break;case 1:X={r:Q,g:B,b:2*Z-B};break;case 2:X={r:2*Z-B,g:B,b:Q};break;case 3:X={r:2*Z-B,g:Q,b:B};break;case 4:X={r:Q,g:2*Z-B,b:B};break;case 5:X={r:B,g:2*Z-B,b:Q};break;default:X={r:2*Z-B,g:2*Z-B,b:2*Z-B}}if(X.mode="rgb",H!==void 0)X.alpha=H;return X}function mW({r:$,g:J,b:Z,alpha:H}){if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=Math.max($,J,Z),Q=Math.min($,J,Z),X={mode:"hsl",s:B===Q?0:(B-Q)/(1-Math.abs(B+Q-1)),l:0.5*(B+Q)};if(B-Q!==0)X.h=(B===$?(J-Z)/(B-Q)+(J<Z)*6:B===J?(Z-$)/(B-Q)+2:($-J)/(B-Q)+4)*60;if(H!==void 0)X.alpha=H;return X}var En=($,J)=>{switch(J){case"deg":return+$;case"rad":return $/Math.PI*180;case"grad":return $/10*9;case"turn":return $*360}},cT=En;var Sn=new RegExp(`^hsla?\\(\\s*${VT}${L3}${a$}${L3}${a$}\\s*(?:,\\s*${KH}\\s*)?\\)$`),In=($)=>{let J=$.match(Sn);if(!J)return;let Z={mode:"hsl"};if(J[3]!==void 0)Z.h=+J[3];else if(J[1]!==void 0&&J[2]!==void 0)Z.h=cT(J[1],J[2]);if(J[4]!==void 0)Z.s=Math.min(Math.max(0,J[4]/100),1);if(J[5]!==void 0)Z.l=Math.min(Math.max(0,J[5]/100),1);if(J[6]!==void 0)Z.alpha=Math.max(0,Math.min(1,J[6]/100));else if(J[7]!==void 0)Z.alpha=Math.max(0,Math.min(1,+J[7]));return Z},dT=In;function Rn($,J){if(!J||J[0]!=="hsl"&&J[0]!=="hsla")return;let Z={mode:"hsl"},[,H,B,Q,X]=J;if(H.type!==D0.None){if(H.type===D0.Percentage)return;Z.h=H.value}if(B.type!==D0.None){if(B.type===D0.Hue)return;Z.s=B.value/100}if(Q.type!==D0.None){if(Q.type===D0.Hue)return;Z.l=Q.value/100}if(X.type!==D0.None)Z.alpha=Math.min(1,Math.max(0,X.type===D0.Number?X.value:X.value/100));return Z}var lT=Rn;var kn={mode:"hsl",toMode:{rgb:fW},fromMode:{rgb:mW},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[lT,dT],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:L2},s:P0,l:P0,alpha:{use:P0,fixup:M1}},difference:{h:V3},average:{h:V2}},Iz=kn;function VH({h:$,s:J,v:Z,alpha:H}){if($=H5($!==void 0?$:0),J===void 0)J=0;if(Z===void 0)Z=0;let B=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:Z,g:Z*(1-J*B),b:Z*(1-J)};break;case 1:Q={r:Z*(1-J*B),g:Z,b:Z*(1-J)};break;case 2:Q={r:Z*(1-J),g:Z,b:Z*(1-J*B)};break;case 3:Q={r:Z*(1-J),g:Z*(1-J*B),b:Z};break;case 4:Q={r:Z*(1-J*B),g:Z*(1-J),b:Z};break;case 5:Q={r:Z,g:Z*(1-J),b:Z*(1-J*B)};break;default:Q={r:Z*(1-J),g:Z*(1-J),b:Z*(1-J)}}if(Q.mode="rgb",H!==void 0)Q.alpha=H;return Q}function AH({r:$,g:J,b:Z,alpha:H}){if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=Math.max($,J,Z),Q=Math.min($,J,Z),X={mode:"hsv",s:B===0?0:1-Q/B,v:B};if(B-Q!==0)X.h=(B===$?(J-Z)/(B-Q)+(J<Z)*6:B===J?(Z-$)/(B-Q)+2:($-J)/(B-Q)+4)*60;if(H!==void 0)X.alpha=H;return X}var bn={mode:"hsv",toMode:{rgb:VH},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:AH},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:P0,fixup:L2},s:P0,v:P0,alpha:{use:P0,fixup:M1}},difference:{h:V3},average:{h:V2}},Rz=bn;function pW({h:$,w:J,b:Z,alpha:H}){if(J===void 0)J=0;if(Z===void 0)Z=0;if(J+Z>1){let B=J+Z;J/=B,Z/=B}return VH({h:$,s:Z===1?1:1-J/(1-Z),v:1-Z,alpha:H})}function uW($){let J=AH($);if(J===void 0)return;let Z=J.s!==void 0?J.s:0,H=J.v!==void 0?J.v:0,B={mode:"hwb",w:(1-Z)*H,b:1-H};if(J.h!==void 0)B.h=J.h;if(J.alpha!==void 0)B.alpha=J.alpha;return B}function yn($,J){if(!J||J[0]!=="hwb")return;let Z={mode:"hwb"},[,H,B,Q,X]=J;if(H.type!==D0.None){if(H.type===D0.Percentage)return;Z.h=H.value}if(B.type!==D0.None){if(B.type===D0.Hue)return;Z.w=B.value/100}if(Q.type!==D0.None){if(Q.type===D0.Hue)return;Z.b=Q.value/100}if(X.type!==D0.None)Z.alpha=Math.min(1,Math.max(0,X.type===D0.Number?X.value:X.value/100));return Z}var iT=yn;var hn={mode:"hwb",toMode:{rgb:pW},fromMode:{rgb:uW},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[iT],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:L2},w:P0,b:P0,alpha:{use:P0,fixup:M1}},difference:{h:xT},average:{h:V2}},rT=hn;var kz=203;var bz=0.1593017578125;var yz=0.8359375,hz=18.8515625,xz=18.6875;function vz($){if($<0)return 0;let J=Math.pow($,0.012683313515655966);return 1e4*Math.pow(Math.max(0,J-0.8359375)/(18.8515625-18.6875*J),6.277394636015326)}function gz($){if($<0)return 0;let J=Math.pow($/1e4,0.1593017578125);return Math.pow((0.8359375+18.8515625*J)/(1+18.6875*J),78.84375)}var cW=($)=>Math.max($/kz,0),xn=({i:$,t:J,p:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=vz($+0.008609037037932761*J+0.11102962500302593*Z),Q=vz($-0.00860903703793275*J-0.11102962500302599*Z),X=vz($+0.5600313357106791*J-0.32062717498731885*Z),z={mode:"xyz65",x:cW(2.070152218389422*B-1.3263473389671556*Q+0.2066510476294051*X),y:cW(0.3647385209748074*B+0.680566024947227*Q-0.0453045459220346*X),z:cW(-0.049747207535812*B-0.0492609666966138*Q+1.1880659249923042*X)};if(H!==void 0)z.alpha=H;return z},dW=xn;var lW=($=0)=>Math.max($*kz,0),vn=({x:$,y:J,z:Z,alpha:H})=>{let B=lW($),Q=lW(J),X=lW(Z),z=gz(0.3592832590121217*B+0.6976051147779502*Q-0.0358915932320289*X),G=gz(-0.1920808463704995*B+1.1004767970374323*Q+0.0753748658519118*X),Y=gz(0.0070797844607477*B+0.0748396662186366*Q+0.8433265453898765*X),U=0.5*z+0.5*G,F=1.61376953125*z-3.323486328125*G+1.709716796875*Y,K=4.378173828125*z-4.24560546875*G-0.132568359375*Y,W={mode:"itp",i:U,t:F,p:K};if(H!==void 0)W.alpha=H;return W},iW=vn;var gn={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:dW,rgb:($)=>W4(dW($))},fromMode:{xyz65:iW,rgb:($)=>iW(K4($))},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:M1}}},aT=gn;var fn=134.03437499999998,mn=0.000000000016295499532821565,rW=($)=>{if($<0)return 0;let J=Math.pow($/1e4,bz);return Math.pow((yz+hz*J)/(1+xz*J),fn)},aW=($=0)=>Math.max($*203,0),pn=({x:$,y:J,z:Z,alpha:H})=>{$=aW($),J=aW(J),Z=aW(Z);let B=1.15*$-0.15*Z,Q=0.66*J+0.34*$,X=rW(0.41478972*B+0.579999*Q+0.014648*Z),z=rW(-0.20151*B+1.120649*Q+0.0531008*Z),G=rW(-0.0166008*B+0.2648*Q+0.6684799*Z),Y=(X+z)/2,U={mode:"jab",j:0.44*Y/(1-0.56*Y)-mn,a:3.524*X-4.066708*z+0.542708*G,b:0.199076*X+1.096799*z-1.295875*G};if(H!==void 0)U.alpha=H;return U},fz=pn;var un=134.03437499999998,nT=0.000000000016295499532821565,nW=($)=>{if($<0)return 0;let J=Math.pow($,1/un);return 1e4*Math.pow((yz-J)/(xz*J-hz),1/bz)},oW=($)=>$/203,cn=({j:$,a:J,b:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=($+nT)/(0.44+0.56*($+nT)),Q=nW(B+0.13860504*J+0.058047316*Z),X=nW(B-0.13860504*J-0.058047316*Z),z=nW(B-0.096019242*J-0.8118919*Z),G={mode:"xyz65",x:oW(1.661373024652174*Q-0.914523081304348*X+0.23136208173913045*z),y:oW(-0.3250758611844533*Q+1.571847026732543*X-0.21825383453227928*z),z:oW(-0.090982811*Q-0.31272829*X+1.5227666*z)};if(H!==void 0)G.alpha=H;return G},mz=cn;var dn=($)=>{let J=fz(K4($));if($.r===$.b&&$.b===$.g)J.a=J.b=0;return J},pz=dn;var ln=($)=>W4(mz($)),uz=ln;var rn={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:pz,xyz65:fz},toMode:{rgb:uz,xyz65:mz},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:M1}}},oT=rn;var an=({j:$,a:J,b:Z,alpha:H})=>{if(J===void 0)J=0;if(Z===void 0)Z=0;let B=Math.sqrt(J*J+Z*Z),Q={mode:"jch",j:$,c:B};if(B)Q.h=H5(Math.atan2(Z,J)*180/Math.PI);if(H!==void 0)Q.alpha=H;return Q},sW=an;var nn=({j:$,c:J,h:Z,alpha:H})=>{if(Z===void 0)Z=0;let B={mode:"jab",j:$,a:J?J*Math.cos(Z/180*Math.PI):0,b:J?J*Math.sin(Z/180*Math.PI):0};if(H!==void 0)B.alpha=H;return B},tW=nn;var on={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:tW,rgb:($)=>uz(tW($))},fromMode:{rgb:($)=>sW(pz($)),jab:sW},channels:["j","c","h","alpha"],ranges:{j:[0,0.221],c:[0,0.19],h:[0,360]},interpolate:{h:{use:P0,fixup:L2},c:P0,j:P0,alpha:{use:P0,fixup:M1}},difference:{h:A3},average:{h:V2}},sT=on;var _3=Math.pow(29,3)/Math.pow(3,3),I7=Math.pow(6,3)/Math.pow(29,3);var eW=($)=>Math.pow($,3)>I7?Math.pow($,3):(116*$-16)/_3,sn=({l:$,a:J,b:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=($+16)/116,Q=J/500+B,X=B-Z/200,z={mode:"xyz50",x:eW(Q)*O5.X,y:eW(B)*O5.Y,z:eW(X)*O5.Z};if(H!==void 0)z.alpha=H;return z},R7=sn;var tn=({x:$,y:J,z:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=$8({r:$*3.1341359569958707-J*1.6173863321612538-0.4906619460083532*Z,g:$*-0.978795502912089+J*1.916254567259524+0.03344273116131949*Z,b:$*0.07195537988411677-J*0.2289768264158322+1.405386058324125*Z});if(H!==void 0)B.alpha=H;return B},H9=tn;var en=($)=>H9(R7($)),cz=en;var $o=($)=>{let{r:J,g:Z,b:H,alpha:B}=e4($),Q={mode:"xyz50",x:0.436065742824811*J+0.3851514688337912*Z+0.14307845442264197*H,y:0.22249319175623702*J+0.7168870538238823*Z+0.06061979053616537*H,z:0.013923904500943465*J+0.09708128566574634*Z+0.7140993584005155*H};if(B!==void 0)Q.alpha=B;return Q},B9=$o;var $q=($)=>$>I7?Math.cbrt($):(_3*$+16)/116,Jo=({x:$,y:J,z:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=$q($/O5.X),Q=$q(J/O5.Y),X=$q(Z/O5.Z),z={mode:"lab",l:116*Q-16,a:500*(B-Q),b:200*(Q-X)};if(H!==void 0)z.alpha=H;return z},k7=Jo;var Zo=($)=>{let J=k7(B9($));if($.r===$.b&&$.b===$.g)J.a=J.b=0;return J},dz=Zo;function Ho($,J){if(!J||J[0]!=="lab")return;let Z={mode:"lab"},[,H,B,Q,X]=J;if(H.type===D0.Hue||B.type===D0.Hue||Q.type===D0.Hue)return;if(H.type!==D0.None)Z.l=Math.min(Math.max(0,H.value),100);if(B.type!==D0.None)Z.a=B.type===D0.Number?B.value:B.value*125/100;if(Q.type!==D0.None)Z.b=Q.type===D0.Number?Q.value:Q.value*125/100;if(X.type!==D0.None)Z.alpha=Math.min(1,Math.max(0,X.type===D0.Number?X.value:X.value/100));return Z}var tT=Ho;var Bo={mode:"lab",toMode:{xyz50:R7,rgb:cz},fromMode:{xyz50:k7,rgb:dz},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[tT],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:M1}}},b7=Bo;var Qo={...b7,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:Cz,rgb:M3},fromMode:{xyz65:wz,rgb:P3},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},eT=Qo;function Xo($,J){if(!J||J[0]!=="lch")return;let Z={mode:"lch"},[,H,B,Q,X]=J;if(H.type!==D0.None){if(H.type===D0.Hue)return;Z.l=Math.min(Math.max(0,H.value),100)}if(B.type!==D0.None)Z.c=Math.max(0,B.type===D0.Number?B.value:B.value*150/100);if(Q.type!==D0.None){if(Q.type===D0.Percentage)return;Z.h=Q.value}if(X.type!==D0.None)Z.alpha=Math.min(1,Math.max(0,X.type===D0.Number?X.value:X.value/100));return Z}var $C=Xo;var zo={mode:"lch",toMode:{lab:R4,rgb:($)=>cz(R4($))},fromMode:{rgb:($)=>I4(dz($)),lab:I4},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[$C],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:L2},c:P0,l:P0,alpha:{use:P0,fixup:M1}},difference:{h:A3},average:{h:V2}},y7=zo;var Go={...y7,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:($)=>R4($,"lab65"),rgb:($)=>M3(R4($,"lab65"))},fromMode:{rgb:($)=>I4(P3($),"lch65"),lab65:($)=>I4($,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},JC=Go;var Yo=({l:$,u:J,v:Z,alpha:H})=>{if(J===void 0)J=0;if(Z===void 0)Z=0;let B=Math.sqrt(J*J+Z*Z),Q={mode:"lchuv",l:$,c:B};if(B)Q.h=H5(Math.atan2(Z,J)*180/Math.PI);if(H!==void 0)Q.alpha=H;return Q},Jq=Yo;var Uo=({l:$,c:J,h:Z,alpha:H})=>{if(Z===void 0)Z=0;let B={mode:"luv",l:$,u:J?J*Math.cos(Z/180*Math.PI):0,v:J?J*Math.sin(Z/180*Math.PI):0};if(H!==void 0)B.alpha=H;return B},Zq=Uo;var ZC=($,J,Z)=>4*$/($+15*J+3*Z),HC=($,J,Z)=>9*J/($+15*J+3*Z),Fo=ZC(O5.X,O5.Y,O5.Z),Ko=HC(O5.X,O5.Y,O5.Z),Wo=($)=>$<=I7?_3*$:116*Math.cbrt($)-16,qo=({x:$,y:J,z:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=Wo(J/O5.Y),Q=ZC($,J,Z),X=HC($,J,Z);if(!isFinite(Q)||!isFinite(X))B=Q=X=0;else Q=13*B*(Q-Fo),X=13*B*(X-Ko);let z={mode:"luv",l:B,u:Q,v:X};if(H!==void 0)z.alpha=H;return z},DH=qo;var No=($,J,Z)=>4*$/($+15*J+3*Z),Lo=($,J,Z)=>9*J/($+15*J+3*Z),Vo=No(O5.X,O5.Y,O5.Z),Ao=Lo(O5.X,O5.Y,O5.Z),Do=({l:$,u:J,v:Z,alpha:H})=>{if($===void 0)$=0;if($===0)return{mode:"xyz50",x:0,y:0,z:0};if(J===void 0)J=0;if(Z===void 0)Z=0;let B=J/(13*$)+Vo,Q=Z/(13*$)+Ao,X=O5.Y*($<=8?$/_3:Math.pow(($+16)/116,3)),z=X*(9*B)/(4*Q),G=X*(12-3*B-20*Q)/(4*Q),Y={mode:"xyz50",x:z,y:X,z:G};if(H!==void 0)Y.alpha=H;return Y},MH=Do;var Mo=($)=>Jq(DH(B9($))),Po=($)=>H9(MH(Zq($))),_o={mode:"lchuv",toMode:{luv:Zq,rgb:Po},fromMode:{rgb:Mo,luv:Jq},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:L2},c:P0,l:P0,alpha:{use:P0,fixup:M1}},difference:{h:A3},average:{h:V2}},BC=_o;var Oo={...t4,mode:"lrgb",toMode:{rgb:$8},fromMode:{rgb:e4},parse:["srgb-linear"],serialize:"srgb-linear"},QC=Oo;var jo={mode:"luv",toMode:{xyz50:MH,rgb:($)=>H9(MH($))},fromMode:{xyz50:DH,rgb:($)=>DH(B9($))},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:M1}}},XC=jo;var To=({r:$,g:J,b:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=Math.cbrt(0.412221469470763*$+0.5363325372617348*J+0.0514459932675022*Z),Q=Math.cbrt(0.2119034958178252*$+0.6806995506452344*J+0.1073969535369406*Z),X=Math.cbrt(0.0883024591900564*$+0.2817188391361215*J+0.6299787016738222*Z),z={mode:"oklab",l:0.210454268309314*B+0.7936177747023054*Q-0.0040720430116193*X,a:1.9779985324311684*B-2.42859224204858*Q+0.450593709617411*X,b:0.0259040424655478*B+0.7827717124575296*Q-0.8086757549230774*X};if(H!==void 0)z.alpha=H;return z},lz=To;var Co=($)=>{let J=lz(e4($));if($.r===$.b&&$.b===$.g)J.a=J.b=0;return J},O3=Co;var wo=({l:$,a:J,b:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=Math.pow($+0.3963377773761749*J+0.2158037573099136*Z,3),Q=Math.pow($-0.1055613458156586*J-0.0638541728258133*Z,3),X=Math.pow($-0.0894841775298119*J-1.2914855480194092*Z,3),z={mode:"lrgb",r:4.076741636075957*B-3.3077115392580616*Q+0.2309699031821044*X,g:-1.2684379732850317*B+2.6097573492876887*Q-0.3413193760026573*X,b:-0.0041960761386756*B-0.7034186179359362*Q+1.7076146940746117*X};if(H!==void 0)z.alpha=H;return z},Q9=wo;var Eo=($)=>$8(Q9($)),j3=Eo;function PH($){return 0.5*(1.170873786407767*$-0.206+Math.sqrt((1.170873786407767*$-0.206)*(1.170873786407767*$-0.206)+0.14050485436893204*$))}function o$($){return($*$+0.206*$)/(1.170873786407767*($+0.03))}function So($,J){let Z,H,B,Q,X,z,G,Y;if(-1.88170328*$-0.80936493*J>1)Z=1.19086277,H=1.76576728,B=0.59662641,Q=0.75515197,X=0.56771245,z=4.0767416621,G=-3.3077115913,Y=0.2309699292;else if(1.81444104*$-1.19445276*J>1)Z=0.73956515,H=-0.45954404,B=0.08285427,Q=0.1254107,X=0.14503204,z=-1.2684380046,G=2.6097574011,Y=-0.3413193965;else Z=1.35733652,H=-0.00915799,B=-1.1513021,Q=-0.50559606,X=0.00692167,z=-0.0041960863,G=-0.7034186147,Y=1.707614701;let U=Z+H*$+B*J+Q*$*$+X*$*J,F=0.3963377774*$+0.2158037573*J,K=-0.1055613458*$-0.0638541728*J,W=-0.0894841775*$-1.291485548*J;{let q=1+U*F,N=1+U*K,V=1+U*W,L=q*q*q,A=N*N*N,M=V*V*V,_=3*F*q*q,P=3*K*N*N,D=3*W*V*V,w=6*F*F*q,R=6*K*K*N,b=6*W*W*V,E=z*L+G*A+Y*M,x=z*_+G*P+Y*D,I=z*w+G*R+Y*b;U=U-E*x/(x*x-0.5*E*I)}return U}function Hq($,J){let Z=So($,J),H=Q9({l:1,a:Z*$,b:Z*J}),B=Math.cbrt(1/Math.max(H.r,H.g,H.b)),Q=B*Z;return[B,Q]}function Io($,J,Z,H,B,Q=null){if(!Q)Q=Hq($,J);let X;if((Z-B)*Q[1]-(Q[0]-B)*H<=0)X=Q[1]*B/(H*Q[0]+Q[1]*(B-Z));else{X=Q[1]*(B-1)/(H*(Q[0]-1)+Q[1]*(B-Z));{let z=Z-B,G=H,Y=0.3963377774*$+0.2158037573*J,U=-0.1055613458*$-0.0638541728*J,F=-0.0894841775*$-1.291485548*J,K=z+G*Y,W=z+G*U,q=z+G*F;{let N=B*(1-X)+X*Z,V=X*H,L=N+V*Y,A=N+V*U,M=N+V*F,_=L*L*L,P=A*A*A,D=M*M*M,w=3*K*L*L,R=3*W*A*A,b=3*q*M*M,E=6*K*K*L,x=6*W*W*A,I=6*q*q*M,S=4.0767416621*_-3.3077115913*P+0.2309699292*D-1,j=4.0767416621*w-3.3077115913*R+0.2309699292*b,C=4.0767416621*E-3.3077115913*x+0.2309699292*I,k=j/(j*j-0.5*S*C),y=-S*k,v=-1.2684380046*_+2.6097574011*P-0.3413193965*D-1,u=-1.2684380046*w+2.6097574011*R-0.3413193965*b,T=-1.2684380046*E+2.6097574011*x-0.3413193965*I,t=u/(u*u-0.5*v*T),B0=-v*t,h=-0.0041960863*_-0.7034186147*P+1.707614701*D-1,e=-0.0041960863*w-0.7034186147*R+1.707614701*b,A0=-0.0041960863*E-0.7034186147*x+1.707614701*I,l=e/(e*e-0.5*h*A0),z0=-h*l;y=k>=0?y:1e6,B0=t>=0?B0:1e6,z0=l>=0?z0:1e6,X+=Math.min(y,Math.min(B0,z0))}}}return X}function _H($,J,Z=null){if(!Z)Z=Hq($,J);let H=Z[0],B=Z[1];return[B/H,B/(1-H)]}function iz($,J,Z){let H=Hq(J,Z),B=Io(J,Z,$,1,$,H),Q=_H(J,Z,H),X=0.11516993+1/(7.4477897+4.1590124*Z+J*(-2.19557347+1.75198401*Z+J*(-2.13704948-10.02301043*Z+J*(-4.24894561+5.38770819*Z+4.69891013*J)))),z=0.11239642+1/(1.6132032-0.68124379*Z+J*(0.40370612+0.90148123*Z+J*(-0.27087943+0.6122399*Z+J*(0.00299215-0.45399568*Z-0.14661872*J)))),G=B/Math.min($*Q[0],(1-$)*Q[1]),Y=$*X,U=(1-$)*z,F=0.9*G*Math.sqrt(Math.sqrt(1/(1/(Y*Y*Y*Y)+1/(U*U*U*U))));return Y=$*0.4,U=(1-$)*0.8,[Math.sqrt(1/(1/(Y*Y)+1/(U*U))),F,B]}function rz($){let J=$.l!==void 0?$.l:0,Z=$.a!==void 0?$.a:0,H=$.b!==void 0?$.b:0,B={mode:"okhsl",l:PH(J)};if($.alpha!==void 0)B.alpha=$.alpha;let Q=Math.sqrt(Z*Z+H*H);if(!Q)return B.s=0,B;let[X,z,G]=iz(J,Z/Q,H/Q),Y;if(Q<z){let U=0,F=0.8*X,K=1-F/z;Y=(Q-U)/(F+K*(Q-U))*0.8}else{let U=z,F=0.2*z*z*1.25*1.25/X,K=1-F/(G-z);Y=0.8+0.2*((Q-U)/(F+K*(Q-U)))}if(Y)B.s=Y,B.h=H5(Math.atan2(H,Z)*180/Math.PI);return B}function az($){let J=$.h!==void 0?$.h:0,Z=$.s!==void 0?$.s:0,H=$.l!==void 0?$.l:0,B={mode:"oklab",l:o$(H)};if($.alpha!==void 0)B.alpha=$.alpha;if(!Z||H===1)return B.a=B.b=0,B;let Q=Math.cos(J/180*Math.PI),X=Math.sin(J/180*Math.PI),[z,G,Y]=iz(B.l,Q,X),U,F,K,W;if(Z<0.8)U=1.25*Z,F=0,K=0.8*z,W=1-K/G;else U=5*(Z-0.8),F=G,K=0.2*G*G*1.25*1.25/z,W=1-K/(Y-G);let q=F+U*K/(1-W*U);return B.a=q*Q,B.b=q*X,B}var Ro={...Iz,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:rz,rgb:($)=>rz(O3($))},toMode:{oklab:az,rgb:($)=>j3(az($))}},zC=Ro;function nz($){let J=$.l!==void 0?$.l:0,Z=$.a!==void 0?$.a:0,H=$.b!==void 0?$.b:0,B=Math.sqrt(Z*Z+H*H),Q=B?Z/B:1,X=B?H/B:1,[z,G]=_H(Q,X),Y=0.5,U=1-Y/z,F=G/(B+J*G),K=F*J,W=F*B,q=o$(K),N=W*q/K,V=Q9({l:q,a:Q*N,b:X*N}),L=Math.cbrt(1/Math.max(V.r,V.g,V.b,0));J=J/L,B=B/L*PH(J)/J,J=PH(J);let A={mode:"okhsv",s:B?(Y+G)*W/(G*Y+G*U*W):0,v:J?J/K:0};if(A.s)A.h=H5(Math.atan2(H,Z)*180/Math.PI);if($.alpha!==void 0)A.alpha=$.alpha;return A}function oz($){let J={mode:"oklab"};if($.alpha!==void 0)J.alpha=$.alpha;let Z=$.h!==void 0?$.h:0,H=$.s!==void 0?$.s:0,B=$.v!==void 0?$.v:0,Q=Math.cos(Z/180*Math.PI),X=Math.sin(Z/180*Math.PI),[z,G]=_H(Q,X),Y=0.5,U=1-Y/z,F=1-H*Y/(Y+G-G*U*H),K=H*G*Y/(Y+G-G*U*H),W=o$(F),q=K*W/F,N=Q9({l:W,a:Q*q,b:X*q}),V=Math.cbrt(1/Math.max(N.r,N.g,N.b,0)),L=o$(B*F),A=K*L/F;return J.l=L*V,J.a=A*Q*V,J.b=A*X*V,J}var ko={...Rz,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:nz,rgb:($)=>nz(O3($))},toMode:{oklab:oz,rgb:($)=>j3(oz($))}},GC=ko;function bo($,J){if(!J||J[0]!=="oklab")return;let Z={mode:"oklab"},[,H,B,Q,X]=J;if(H.type===D0.Hue||B.type===D0.Hue||Q.type===D0.Hue)return;if(H.type!==D0.None)Z.l=Math.min(Math.max(0,H.type===D0.Number?H.value:H.value/100),1);if(B.type!==D0.None)Z.a=B.type===D0.Number?B.value:B.value*0.4/100;if(Q.type!==D0.None)Z.b=Q.type===D0.Number?Q.value:Q.value*0.4/100;if(X.type!==D0.None)Z.alpha=Math.min(1,Math.max(0,X.type===D0.Number?X.value:X.value/100));return Z}var YC=bo;var yo={...b7,mode:"oklab",toMode:{lrgb:Q9,rgb:j3},fromMode:{lrgb:lz,rgb:O3},ranges:{l:[0,1],a:[-0.4,0.4],b:[-0.4,0.4]},parse:[YC],serialize:($)=>`oklab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`},UC=yo;function ho($,J){if(!J||J[0]!=="oklch")return;let Z={mode:"oklch"},[,H,B,Q,X]=J;if(H.type!==D0.None){if(H.type===D0.Hue)return;Z.l=Math.min(Math.max(0,H.type===D0.Number?H.value:H.value/100),1)}if(B.type!==D0.None)Z.c=Math.max(0,B.type===D0.Number?B.value:B.value*0.4/100);if(Q.type!==D0.None){if(Q.type===D0.Percentage)return;Z.h=Q.value}if(X.type!==D0.None)Z.alpha=Math.min(1,Math.max(0,X.type===D0.Number?X.value:X.value/100));return Z}var FC=ho;var xo={...y7,mode:"oklch",toMode:{oklab:($)=>R4($,"oklab"),rgb:($)=>j3(R4($,"oklab"))},fromMode:{rgb:($)=>I4(O3($),"oklch"),oklab:($)=>I4($,"oklch")},parse:[FC],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]}},KC=xo;var vo=($)=>{let{r:J,g:Z,b:H,alpha:B}=e4($),Q={mode:"xyz65",x:0.486570948648216*J+0.265667693169093*Z+0.1982172852343625*H,y:0.2289745640697487*J+0.6917385218365062*Z+0.079286914093745*H,z:0*J+0.0451133818589026*Z+1.043944368900976*H};if(B!==void 0)Q.alpha=B;return Q},Bq=vo;var go=({x:$,y:J,z:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=$8({r:$*2.4934969119414263-J*0.9313836179191242-0.402710784450717*Z,g:$*-0.8294889695615749+J*1.7626640603183465+0.0236246858419436*Z,b:$*0.0358458302437845-J*0.0761723892680418+0.9568845240076871*Z},"p3");if(H!==void 0)B.alpha=H;return B},Qq=go;var fo={...t4,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:($)=>Qq(K4($)),xyz65:Qq},toMode:{rgb:($)=>W4(Bq($)),xyz65:Bq}},WC=fo;var Xq=($)=>{let J=Math.abs($);if(J>=0.001953125)return Math.sign($)*Math.pow(J,0.5555555555555556);return 16*$},mo=({x:$,y:J,z:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B={mode:"prophoto",r:Xq($*1.3457868816471585-J*0.2555720873797946-0.0511018649755453*Z),g:Xq($*-0.5446307051249019+J*1.5082477428451466+0.0205274474364214*Z),b:Xq($*0+J*0+1.2119675456389452*Z)};if(H!==void 0)B.alpha=H;return B},zq=mo;var Gq=($=0)=>{let J=Math.abs($);if(J>=0.03125)return Math.sign($)*Math.pow(J,1.8);return $/16},po=($)=>{let J=Gq($.r),Z=Gq($.g),H=Gq($.b),B={mode:"xyz50",x:0.7977666449006423*J+0.1351812974005331*Z+0.0313477341283922*H,y:0.2880748288194013*J+0.7118352342418731*Z+0.0000899369387256*H,z:0*J+0*Z+0.8251046025104602*H};if($.alpha!==void 0)B.alpha=$.alpha;return B},Yq=po;var uo={...t4,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:zq,rgb:($)=>zq(B9($))},toMode:{xyz50:Yq,rgb:($)=>H9(Yq($))}},qC=uo;var Uq=($)=>{let J=Math.abs($);if(J>0.018053968510807)return(Math.sign($)||1)*(1.09929682680944*Math.pow(J,0.45)-0.09929682680944008);return 4.5*$},co=({x:$,y:J,z:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B={mode:"rec2020",r:Uq($*1.7166511879712683-J*0.3556707837763925-0.2533662813736599*Z),g:Uq($*-0.6666843518324893+J*1.6164812366349395+0.0157685458139111*Z),b:Uq($*0.0176398574453108-J*0.0427706132578085+0.9421031212354739*Z)};if(H!==void 0)B.alpha=H;return B},Fq=co;var Kq=($=0)=>{let J=Math.abs($);if(J<0.08124285829863151)return $/4.5;return(Math.sign($)||1)*Math.pow((J+1.09929682680944-1)/1.09929682680944,2.2222222222222223)},lo=($)=>{let J=Kq($.r),Z=Kq($.g),H=Kq($.b),B={mode:"xyz65",x:0.6369580483012911*J+0.1446169035862083*Z+0.1688809751641721*H,y:0.262700212011267*J+0.6779980715188708*Z+0.059301716469862*H,z:0*J+0.0280726930490874*Z+1.0609850577107909*H};if($.alpha!==void 0)B.alpha=$.alpha;return B},Wq=lo;var io={...t4,mode:"rec2020",fromMode:{xyz65:Fq,rgb:($)=>Fq(K4($))},toMode:{xyz65:Wq,rgb:($)=>W4(Wq($))},parse:["rec2020"],serialize:"rec2020"},NC=io;var T3=0.0037930732552754493,sz=Math.cbrt(0.0037930732552754493);var qq=($)=>Math.cbrt($)-sz,ro=($)=>{let{r:J,g:Z,b:H,alpha:B}=e4($),Q=qq(0.3*J+0.622*Z+0.078*H+T3),X=qq(0.23*J+0.692*Z+0.078*H+T3),z=qq(0.2434226892454782*J+0.2047674442449682*Z+0.5518098665095535*H+T3),G={mode:"xyb",x:(Q-X)/2,y:(Q+X)/2,b:z-(Q+X)/2};if(B!==void 0)G.alpha=B;return G},LC=ro;var Nq=($)=>Math.pow($+sz,3),ao=({x:$,y:J,b:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B=Nq($+J)-T3,Q=Nq(J-$)-T3,X=Nq(Z+J)-T3,z=$8({r:11.031566904639861*B-9.866943908131562*Q-0.16462299650829934*X,g:-3.2541473810744237*B+4.418770377582723*Q-0.16462299650829934*X,b:-3.6588512867136815*B+2.7129230459360922*Q+1.9459282407775895*X});if(H!==void 0)z.alpha=H;return z},VC=ao;var no={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:VC},fromMode:{rgb:LC},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:M1}}},AC=no;var oo={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:H9,lab:k7},fromMode:{rgb:B9,lab:R7},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:M1}}},DC=oo;var so=($)=>{let{x:J,y:Z,z:H,alpha:B}=$;if(J===void 0)J=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let Q={mode:"xyz50",x:1.0479298208405488*J+0.0229467933410191*Z-0.0501922295431356*H,y:0.0296278156881593*J+0.990434484573249*Z-0.0170738250293851*H,z:-0.0092430581525912*J+0.0150551448965779*Z+0.7518742899580008*H};if(B!==void 0)Q.alpha=B;return Q},MC=so;var to=($)=>{let{x:J,y:Z,z:H,alpha:B}=$;if(J===void 0)J=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let Q={mode:"xyz65",x:0.9554734527042182*J-0.0230985368742614*Z+0.0632593086610217*H,y:-0.0283697069632081*J+1.0099954580058226*Z+0.021041398966943*H,z:0.0123140016883199*J-0.0205076964334779*Z+1.3303659366080753*H};if(B!==void 0)Q.alpha=B;return Q},PC=to;var eo={mode:"xyz65",toMode:{rgb:W4,xyz50:MC},fromMode:{rgb:K4,xyz50:PC},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:M1}}},_C=eo;var $s=({r:$,g:J,b:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B={mode:"yiq",y:0.29889531*$+0.58662247*J+0.11448223*Z,i:0.59597799*$-0.2741761*J-0.32180189*Z,q:0.21147017*$-0.52261711*J+0.31114694*Z};if(H!==void 0)B.alpha=H;return B},OC=$s;var Js=({y:$,i:J,q:Z,alpha:H})=>{if($===void 0)$=0;if(J===void 0)J=0;if(Z===void 0)Z=0;let B={mode:"rgb",r:$+0.95608445*J+0.6208885*Z,g:$-0.27137664*J-0.6486059*Z,b:$-1.10561724*J+1.70250126*Z};if(H!==void 0)B.alpha=H;return B},jC=Js;var Zs={mode:"yiq",toMode:{rgb:jC},fromMode:{rgb:OC},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:M1}}},TC=Zs;function Lq($){let J=Mz("lrgb")($);return 0.2126*J.r+0.7152*J.g+0.0722*J.b}var lk0=p1(ET),ik0=p1(vT),rk0=p1(mT),ak0=p1(pT),nk0=p1(uT),ok0=p1(Iz),sk0=p1(Rz),tk0=p1(rT),ek0=p1(aT),$b0=p1(oT),Jb0=p1(sT),Zb0=p1(b7),Hb0=p1(eT),Bb0=p1(y7),Qb0=p1(JC),Xb0=p1(BC),zb0=p1(QC),Gb0=p1(XC),Yb0=p1(zC),Ub0=p1(GC),Fb0=p1(UC),Kb0=p1(KC),Wb0=p1(WC),qb0=p1(qC),Nb0=p1(NC),Lb0=p1(t4),Vb0=p1(AC),Ab0=p1(DC),Db0=p1(_C),Mb0=p1(TC);var s$={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"}},tz={squishy:{label:"Squishy",radius:"0.875rem"},soft:{label:"Soft",radius:"0.625rem"},subtle:{label:"Subtle",radius:"0.375rem"},square:{label:"Square",radius:"0"}},wC="oklch(0.205 0 0)";function CC($){return Lq($)>0.3?"oklch(0 0 0)":"oklch(1 0 0)"}var EC={workspace:{primary:($)=>$,primaryForeground:($)=>CC($),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)"},widget:{background:($)=>$,foreground:($)=>CC($),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)"}},Vq=Object.keys(EC.workspace);function SC($,J="workspace"){let Z={},H=EC[J];for(let B of Vq)Z[B]=H[B]($);return Z}var OH={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)"}},t$={font:"sans",color:"default",radius:"soft"};function e$($){return{...t$,...$}}var Aq="moi-fonts",IC="moi-font-previews",Hs=Object.values(s$).map(($)=>$.googleFontsQuery).filter(Boolean).join("&family="),kC=[["sans","--sans"],["mono","--mono"]],bC=Vq.map(($)=>[$,Bs($)]),yC="--radius",RC=[...kC.map(([,$])=>$),...bC.map(([,$])=>$),yC];function Bs($){return`--${$.replace(/[A-Z]/g,(Z)=>`-${Z.toLowerCase()}`)}`}function Qs($){let J={},Z=e$($),H=Z.font===t$.font?void 0:s$[Z.font];for(let[B,Q]of kC)J[Q]=H?.[B];return J}function Dq($,J="workspace"){let Z={},H=e$($),Q=(OH[H.color]??OH[t$.color]).primary??(J==="widget"?wC:void 0),X=Q?SC(Q,J):void 0;for(let[z,G]of bC)Z[G]=X?.[z];return Z}function Xs($){let J={},Z=e$($),H=Z.radius===t$.radius?void 0:tz[Z.radius];return J[yC]=H?.radius,J}function X9($,J="workspace"){return{...Qs($),...Dq($,J),...Xs($)}}function $G(){ez.useEffect(()=>{if(document.getElementById(IC))return;let $=document.createElement("link");return $.id=IC,$.rel="stylesheet",$.crossOrigin="anonymous",$.href=`https://fonts.googleapis.com/css2?family=${Hs}&display=swap`,document.head.appendChild($),()=>{$.remove()}},[])}function zs($){ez.useEffect(()=>{let J=document.documentElement,Z=X9($);for(let H of RC){let B=Z[H];if(B)J.style.setProperty(H,B);else J.style.removeProperty(H)}return()=>{for(let H of RC)J.style.removeProperty(H)}},[$])}function hC($){let{font:J}=e$($);zs($),ez.useEffect(()=>{let Z=s$[J]??s$[t$.font],H=document.getElementById(Aq);if(!Z.googleFontsQuery)H?.remove();else{let B=`https://fonts.googleapis.com/css2?family=${Z.googleFontsQuery}&display=swap`;if(H)H.href=B;else{let Q=document.createElement("link");Q.id=Aq,Q.rel="stylesheet",Q.crossOrigin="anonymous",Q.href=B,document.head.appendChild(Q)}}return()=>{document.getElementById(Aq)?.remove()}},[J])}var h7=O(g(),1);var B2=O(c(),1),jH={width:320,height:180,radius:32,topLeftRadius:18,bodyTop:24,tabEnd:124,shoulder:{width:48,roundness:20}};function Gs($){let{width:J,height:Z,radius:H,topLeftRadius:B,bodyTop:Q,tabEnd:X,shoulder:z}=jH,G=Math.min(J/2,H*$),Y=Math.min(J/2,B*$),U=Math.max(0,z.width),F=X+U,K=Math.max(0,Math.min(z.roundness,U/2));return[`M ${Y} 0`,`H ${X}`,`C ${X+K} 0 ${F-K} ${Q} ${F} ${Q}`,`H ${J-G}`,`Q ${J} ${Q} ${J} ${Q+H}`,`V ${Z-H}`,`Q ${J} ${Z} ${J-G} ${Z}`,`H ${G}`,`Q 0 ${Z} 0 ${Z-H}`,`V ${B}`,`Q 0 0 ${Y} 0`,"Z"].join(" ")}function Ys(){let $=h7.useRef(null),[J,Z]=h7.useState(1);return h7.useLayoutEffect(()=>{let H=$.current;if(!H)return;let B=(z,G)=>{if(z<=0||G<=0)return;let Y=z/jH.width,F=G/jH.height/Y;Z((K)=>Math.abs(K-F)<0.001?K:F)},Q=H.getBoundingClientRect();B(Q.width,Q.height);let X=new ResizeObserver(([z])=>{if(z)B(z.contentRect.width,z.contentRect.height)});return X.observe(H),()=>X.disconnect()},[]),{ref:$,horizontalRadiusScale:J}}var xC=[{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 vC({workspaceId:$}){let J=PX($),Z=J.data?[...J.data.thumbnails].reverse():[],H=xC.slice(xC.length-Z.length),B=J.data?.firstUserMessage,Q=J.data?.theme,{ref:X,horizontalRadiusScale:z}=Ys(),G=Gs(z),Y=`folder-noise-${$}`,U=X9(Q),F=Dq(Q);return B2.jsxs("div",{ref:X,style:F,className:"relative h-45 w-full",children:[B2.jsxs("svg",{viewBox:`0 0 ${jH.width} ${jH.height}`,preserveAspectRatio:"none","aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",children:[B2.jsx("defs",{children:B2.jsxs("filter",{id:Y,x:"0%",y:"0%",width:"100%",height:"100%",colorInterpolationFilters:"sRGB",children:[B2.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",seed:"7",result:"noise"}),B2.jsx("feColorMatrix",{in:"noise",type:"saturate",values:"0",result:"monochromeNoise"}),B2.jsx("feComponentTransfer",{in:"monochromeNoise",result:"faintNoise",children:B2.jsx("feFuncA",{type:"linear",slope:"0.24"})}),B2.jsx("feComposite",{in:"faintNoise",in2:"SourceAlpha",operator:"in",result:"clippedNoise"}),B2.jsx("feBlend",{in:"SourceGraphic",in2:"clippedNoise",mode:"soft-light"})]})}),B2.jsx("path",{d:G,filter:`url(#${Y})`,className:"fill-accent"})]}),Z.map((K,W)=>B2.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",H[W].frame),children:B2.jsx("img",{src:K,alt:"",loading:"lazy",className:s("block h-auto max-h-32 w-auto max-w-full object-contain",H[W].img)})},K)),Z.length===0&&B&&B2.jsx("div",{className:"absolute inset-x-[12%] top-[22%] flex justify-end",children:B2.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:B2.jsx("p",{className:"line-clamp-3 text-sm leading-normal whitespace-normal",children:B})})}),B2.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 B1=O(c(),1);function mC(){$G();let[,$]=m4(),J=MX(),Z=u_(),H=_X(),B=ej({onSuccess:(q)=>$(`/workspace/${q.id}`)}),Q=$9(),[X,z]=fC.useState(!1),G=_5((q)=>q.discoveredWorkspacesOpen),Y=_5((q)=>q.setDiscoveredWorkspacesOpen);if(J.isPending||Z.isPending)return B1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:B1.jsx(E5,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(J.isError||Z.isError)return B1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:B1.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let U=J.data,F=Z.data,K=U.length;function W(q){if(Q.cloudDemo){z(!0);return}B.startImport(q)}return B1.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[B1.jsx(HT,{className:"mb-10"}),K>0?B1.jsxs("section",{className:"mb-12",children:[B1.jsxs("div",{className:"mb-4 flex items-center justify-between gap-2",children:[B1.jsx("h1",{className:"text-sm font-medium text-foreground",children:"My workspaces"}),B1.jsx(aZ,{trigger:B1.jsxs(C0,{variant:"outline",size:"sm",children:[B1.jsx(F4,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),B1.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2 md:grid-cols-3",children:U.map((q)=>B1.jsx(Us,{workspace:q},q.id))})]}):B1.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 pt-8 pb-16 text-center",children:[B1.jsx(gC,{size:32,stroke:1.5,className:"text-muted-foreground"}),B1.jsxs("div",{className:"flex flex-col gap-1.5",children:[B1.jsx("h2",{className:"font-medium",children:"Let’s start with creating your first workspace"}),B1.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."})]}),B1.jsx(aZ,{trigger:B1.jsx(C0,{children:"Create workspace"})})]}),F.length>0&&B1.jsx("section",{children:B1.jsxs(qz,{open:G,onOpenChange:Y,className:"group",children:[B1.jsxs(Nz,{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:[B1.jsx("span",{className:"text-sm font-medium",children:"Import from this computer"}),B1.jsx($6,{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")})]}),B1.jsx(Lz,{children:B1.jsx("ul",{className:"border-t border-border",children:F.map((q)=>B1.jsx(Fs,{suggestion:q,onAdd:W},q.path))})})]})}),B.choice&&B1.jsx(sj,{choice:B.choice,availability:H.data?.availability,isPending:B.isPending,errorMessage:B.error?.message,onTypeChange:B.selectType,onSubmit:B.submit,onReset:B.reset}),B1.jsx(V7,{open:X,onOpenChange:z})]})}function Us({workspace:$}){let J=f$($),Z=PX($.id),H=Z.data?.theme,B=Z.data?.updatedAt??new Date($.addedAt).getTime();return B1.jsxs(GZ,{href:`/workspace/${$.id}`,className:"group flex min-w-0 flex-col gap-3",children:[B1.jsx(vC,{workspaceId:$.id}),B1.jsxs("div",{className:"flex min-w-0 flex-col gap-2 px-2",children:[B1.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 font-sans",style:X9(H),children:[B1.jsx("img",{src:$.icon??D8[$.type??"claude-code"],alt:"",className:"size-4 shrink-0 rounded-xs"}),B1.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:J})]}),B1.jsx("span",{className:"text-xs text-muted-foreground",children:Ks(B)})]})]})}function Fs({suggestion:$,onAdd:J}){let{path:Z,types:H}=$,B=f$($);return B1.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[B1.jsx(Jj,{types:H}),B1.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:B}),B1.jsx("span",{title:Z,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:$.displayPath??Z}),B1.jsxs(C0,{variant:"outline",size:"sm",onClick:()=>J($),children:[B1.jsx(F4,{stroke:1.75}),"Add"]})]})}function Ks($){let J=Date.now()-$,Z=Math.floor(J/60000);if(Z<1)return"Updated just now";if(Z<60)return`Updated ${Z} min${Z===1?"":"s"} ago`;let H=Math.floor(Z/60);if(H<24)return`Updated ${H} hour${H===1?"":"s"} ago`;let B=Math.floor(H/24);if(B<30)return`Updated ${B} day${B===1?"":"s"} ago`;return`Updated ${new Date($).toLocaleDateString()}`}var JG=O(c(),1);function pC(){return JG.jsx(zz,{showWorkspaces:!1,children:JG.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:JG.jsx(mC,{})})})}var ZG=O(g(),1);var Mq=O(c(),1),dC=($)=>$.map((J)=>[...J].map((Z)=>Z==="#"?1:0)),Ws=["####.","#.#.#","#.#.#","#.#.#","#.#.#"],qs=["###.#","#.#.#","#.#.#","#.#.#","###.#"],Ns=dC([".....","####.","#.#.#","#.#.#","#.#.#"]),Ls=dC(Ws.map(($,J)=>`${$}.${qs[J]}`)),Vs={moi:Ns,"moi-full":Ls};function lC($,J,Z){let H=[];for(let B=0;B<J;B++){let Q=[];for(let X=0;X<$;X++)Q.push(Z(X,B));H.push(Q)}return H}function uC($,J,Z){let H=Math.sin($*12.9898+J*78.233+Z*37.719)*43758.5453;return H-Math.floor(H)}function As($,J,Z){return lC(J,Z,(H,B)=>{let Q=uC(H,B,0)*Math.PI*2,X=5+uC(H,B,1)*6,z=0.5+0.5*Math.sin($*X+Q);return z*z})}function Ds($,J,Z){return lC(J,Z,(B,Q)=>0.5+0.5*Math.sin(B*0.5+Q*0.32-$*6.5))}var iC=0.55;function Ms($,J){let Z=$.length,H=$.reduce((G,Y)=>Math.max(G,Y.length),0),B=Math.min(J/iC,1),Q=1-Math.pow(1-B,3),X=Math.round((1-Q)*Z),z=[];for(let G=0;G<Z;G++){let Y=[];for(let U=0;U<H;U++)Y.push($[G-X]?.[U]??0);z.push(Y)}return z}function cC($,J,Z){let H=Vs[$];if(J===void 0)return Ms(H,Z);let B=H.length,Q=H[0]?.length??0;return J==="wave"?Ds(Z,Q,B):As(Z,Q,B)}var Ps=24;function _s($,J,Z){let[H,B]=ZG.useState(()=>cC($,J,0));return ZG.useEffect(()=>{let Q=0,X=null,z=0,G=1000/Z,Y=(U)=>{if(X===null)X=U;let F=(U-X)/1000;if(U-z>=G){if(z=U,B(cC($,J,F)),J===void 0&&F>=iC)return}Q=requestAnimationFrame(Y)};return Q=requestAnimationFrame(Y),()=>cancelAnimationFrame(Q)},[$,J,Z]),H}function Os($){return`rgba(23, 23, 23, ${(0.1+Math.max(0,Math.min(1,$))*0.9).toFixed(3)})`}function rC({sprite:$="moi",effect:J,fps:Z=Ps,pixelSize:H=3,gap:B=1,className:Q}){let X=_s($,J,Z),z=X[0]?.length??0,G=J!==void 0;return Mq.jsx("div",{className:s("grid",Q),style:{gridTemplateColumns:`repeat(${z}, ${H}px)`,gap:`${B}px`},children:X.flatMap((Y,U)=>Y.map((F,K)=>Mq.jsx("div",{className:"rounded-[2px]",style:{width:H,height:H,background:Os(F),boxShadow:G?`0 0 ${(H*(0.4+F)).toFixed(1)}px rgba(23, 23, 23, ${(F*0.35).toFixed(3)})`:void 0}},`${U}-${K}`)))})}var g7=O(g(),1);var QG=O(g(),1);var aC=()=>({emit($,...J){for(let Z=this.events[$]||[],H=0,B=Z.length;H<B;H++)Z[H](...J)},events:{},on($,J){return(this.events[$]||=[]).push(J),()=>{this.events[$]=this.events[$]?.filter((Z)=>J!==Z)}}});function Pq($){return $==="agent"||$==="widgets"||$==="scratchpad"||typeof $==="string"&&(/^view:[^/]+$/.test($)||/^view-builder:[^/]+$/.test($))}function TH($){return Pq($)?$:null}function nC($,J){return`/workspace/${$}/${J}`}var HG=($)=>`view:${$}`,C3=($)=>$.startsWith("view:")?$.slice(5):null,w3=($)=>`view-builder:${$}`,J6=($)=>$.startsWith("view-builder:")?$.slice(13):null;function x7($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function oC($){if(!x7($))return{};let J=$.appletParams;return x7(J)?J:{}}var _q=2000;var js=({kind:$,name:J})=>`${$}:${J}`,sC=1000,Oq={cooldownMs:2000,windowMs:60000,maxPerWindow:10,maxKeys:64};function Ts($){let J=aC(),Z=LX(Oq),H=(Q,X)=>{V8($,{source:"runtime",kind:Q.kind,name:Q.name,message:X})},B=(Q,X,z)=>{let G=Z.admit(`${X}\x00${z}`);if(G==="cooldown")return H(Q,`sendChatMessage("${z}") was dropped: the same message was already sent less than ${Oq.cooldownMs/1000}s ago. Call it from an event handler, not during render.`),!1;if(G==="window")return H(Q,`sendChatMessage("${z}") was dropped: more than ${Oq.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 J.on(Q,X)},connect(Q){let X=!0,z=js(Q);return{bridge:{focusTab(Y,U){if(!X)return;if(!Pq(Y))return;J.emit("focusTab",Y,x7(U)?U:void 0)},sendChatMessage(Y,U){if(!X)return;if(typeof Y!=="string")return;let F=Y.trim();if(!F)return;if(F.length>sC){H(Q,`sendChatMessage() was dropped: the message is ${F.length} characters (max ${sC}). Put long content in the context argument, not the message.`);return}if(!B(Q,z,F))return;J.emit("sendChatMessage",{message:F,source:z,...U!==void 0?{context:Cs(Q,U,H)}:{}})}},dispose:()=>{X=!1}}}}}function Cs($,J,Z){if(!x7(J)){Z($,"sendChatMessage() ignored its context argument: it must be a plain object.");return}let H;try{H=JSON.stringify(J)}catch{Z($,"sendChatMessage() ignored its context argument: it is not JSON-serializable (cycles, functions, or BigInt).");return}if(H.length>_q){Z($,`sendChatMessage() ignored its context argument: ${H.length} characters serialized (max ${_q}). Send an id the agent can look up instead of the whole payload.`);return}return J}var tC=new Map;function eC($){let J=tC.get($);if(!J)J=Ts($),tC.set($,J);return J}function XG($,J,Z){let H=QG.useRef(Z);H.current=Z,QG.useEffect(()=>{let B=(...Q)=>H.current(...Q);return eC($).on(J,B)},[$,J])}var BG=new Map;function $w($,J,Z,H){let B=$.__attachBridge;if(typeof B!=="function")return;BG.get(Z)?.();let{bridge:Q,dispose:X}=eC(J).connect(H);BG.set(Z,X),B(Q)}function jq($){let J=BG.get($);if(!J)return;BG.delete($),J()}function zG($,J,Z){return`${$}/${J}/${Z}`}var v7=new Map,CH=new Map;function ws($,J,Z){return v7.get(zG($,J,Z))??0}var Es="module";function Jw($,J,Z){return`/api/workspaces/${J}/${$}/${Z}/${Es}?v=${ws($,J,Z)}`}function GG($,J,Z){return`/api/workspaces/${J}/${$}/${Z}`}function YG($,J){return`${$==="widgets"?"widget":"view"}:${J}`}function Zw($){return CH.get($)}function Hw($,J){CH.set($,J)}function UG($,J,Z){let H=zG($,J,Z);CH.delete(H),v7.set(H,(v7.get(H)??0)+1),jq(H)}function Tq($){let J=`${$}/`;for(let Z of new Set([...CH.keys(),...v7.keys()]))if(Z.startsWith(J))CH.delete(Z),v7.set(Z,(v7.get(Z)??0)+1),jq(Z)}var Ss={kind:"widget",segment:"widgets",shouldReload:($,J)=>$.type==="widget:updated"&&$.name===J||$.type==="applets:refresh"&&$.only!=="views"},Is={kind:"view",segment:"views",shouldReload:($,J)=>$.type==="view:updated"&&$.name===J||$.type==="applets:refresh"&&$.only!=="widgets"};function Rs($,J,Z){let{segment:H}=$,B=zG(H,J,Z),Q=Zw(B);if(Q)return Q;let X=import(Jw(H,J,Z)).then((z)=>{if(!z.default)throw Error(`"${Z}" has no default export`);return $w(z,J,B,{kind:$.kind,name:Z}),z.default});return Hw(B,X),X}function Bw($,J){let Z=Z5(),[H,B]=g7.useState({status:"loading",version:0}),Q=g7.useCallback(()=>{B((X)=>({status:"loading",version:X.version})),Rs($,Z,J).then((X)=>B((z)=>({status:"ready",Component:X,version:z.version+1}))).catch((X)=>{V8(Z,{source:"load",kind:$.kind,name:J,message:String(X),...X instanceof Error&&X.stack?{stack:X.stack}:{}}),B((z)=>({status:"error",error:String(X),version:z.version+1}))})},[$,Z,J]);return g7.useEffect(()=>{Q()},[Q]),Z2((X)=>{if($.shouldReload(X,J))UG($.segment,Z,J),Q()}),H}function Qw($){return Bw(Ss,$)}function Xw($){return Bw(Is,$)}function zw(){let $=Z5();Z2((J)=>{if(J.type==="view:updated")UG("views",$,J.name);else if(J.type==="widget:updated")UG("widgets",$,J.name);else if(J.type==="applets:refresh"){if(J.only!=="views")Tq("widgets");if(J.only!=="widgets")Tq("views")}})}var J8=O(g(),1);var k4={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function Gw($){return n1({queryKey:w0.layout($),queryFn:()=>N1(`/api/workspaces/${$}`),...k4})}function z9($){let J=s0();return Z2((Z)=>{if(Z.type==="agent:updated"&&Z.workspaceId===$)J.setQueryData(w0.agent($),(H)=>H?{...H,availability:Z.availability,login:Z.login}:H);if(Z.type==="env:updated"&&Z.workspaceId===$)J.invalidateQueries({queryKey:w0.agent($)})}),n1({queryKey:w0.agent($),queryFn:()=>N1(`/api/workspaces/${$}/agent`),staleTime:30000,refetchOnWindowFocus:!0})}function Yw($){return N1(`/api/workspaces/${$}/auth/login`,{method:"POST"},"Could not start sign-in")}function Uw($){return n1({queryKey:w0.skills($),queryFn:()=>N1(`/api/workspaces/${$}/skills`),...k4})}async function ks($){let J=await fetch(`/api/workspaces/${$}/skills/update`,{method:"POST"}),Z=await J.text(),H=null;try{H=JSON.parse(Z)}catch{}if(!J.ok){let B=H&&"error"in H?H.error:Z,Q=Error(B||"Failed to update workspace skill");if(H?.skills)Q.status={skills:H.skills,updateAvailable:H.updateAvailable};throw Q}if(!H)throw Error("Invalid workspace skill update response");return H}function Fw($){let J=s0();return o1({mutationFn:()=>ks($),onSuccess:(Z)=>{J.setQueryData(w0.skills($),Z)},onError:(Z)=>{if(Z.status)J.setQueryData(w0.skills($),Z.status)}})}function Kw($){return n1({queryKey:w0.widgets($),queryFn:async()=>{return(await N1(`/api/workspaces/${$}/widgets`)).widgets},...k4})}function FG($){return n1({queryKey:w0.views($),queryFn:async()=>{return(await N1(`/api/workspaces/${$}/views`)).views},...k4})}function Ww($){let J=s0();return o1({mutationFn:(Z)=>w4(`/api/workspaces/${$}`,a5("PUT",Z),"Failed to save layout"),onSuccess:()=>{J.invalidateQueries({queryKey:w0.preview($)})}})}function Cq(){return{open:["agent","widgets","scratchpad"],active:"agent"}}function qw(){return{version:1,widgetGrid:[],layoutMode:"split",tabs:Cq()}}var Aw=O(c(),1),wq=J8.createContext(null);function Y5(){let $=J8.useContext(wq);if(!$)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return $}function Lw(){return J8.useContext(wq)?.layout.theme}function Nw($){let{cwd:J,name:Z,provider:H,agentId:B,...Q}=$;return Q}function Vw({id:$,children:J}){let Z=s0(),H=Gw($),B=Ww($),Q=J8.useRef(B.mutate);Q.current=B.mutate;let X=J8.useRef(null),z=J8.useCallback((Y)=>{let U=w0.layout($),F=Z.getQueryData(U);if(!F)return;let K={...F,...Y};if(Z.setQueryData(U,K),X.current)clearTimeout(X.current);X.current=setTimeout(()=>{X.current=null,Q.current(Nw(K))},600)},[$,Z]),G=J8.useMemo(()=>({layout:H.data?Nw(H.data):qw(),setLayout:z,name:H.data?.name??null,icon:H.data?.icon??null,cwd:H.data?.cwd??null,provider:H.data?.provider??null,workspaceId:$,isLoading:H.isLoading}),[H.data,H.isLoading,z,$]);return Aw.jsx(wq,{value:G,children:J})}var X4=O(g(),1);var R9=O(c(),1),bs="M5 11a7 7 0 0 1 14 0v7a1.78 1.78 0 0 1 -3.1 1.4a1.65 1.65 0 0 0 -2.6 0a1.65 1.65 0 0 1 -2.6 0a1.65 1.65 0 0 0 -2.6 0a1.78 1.78 0 0 1 -3.1 -1.4v-7",ys=18.85;function E3($){return $.toFixed(3)}function hs($){let J="";for(let Z=0;Z<$.length-1;Z+=1){let H=$[Z-1]??$[Z],B=$[Z],Q=$[Z+1],X=$[Z+2]??Q,z=Z===0?{x:B.x,y:B.y+0.4}:{x:B.x+(Q.x-H.x)/6,y:B.y+(Q.y-H.y)/6},G=Z===$.length-2?{x:Q.x,y:Q.y+0.4}:{x:Q.x-(X.x-B.x)/6,y:Q.y-(X.y-B.y)/6};J+=`C${E3(z.x)} ${E3(z.y)} ${E3(G.x)} ${E3(G.y)} ${E3(Q.x)} ${E3(Q.y)}`}return J}function xs($){let J=$*Math.PI*2,H=(1-Math.abs($*2-1))*1.55,B=ys+H,Q=Array.from({length:13},(z,G)=>{let Y=G/12,U=Math.sin(Math.PI*Y)**0.35,F=B+0.3*U,K=0.55*U*Math.sin(5*Math.PI*Y-J);return{x:5+14*Y,y:F+K}}),X=B-11;return`M5 11a7 7 0 0 1 14 0v${E3(X)}${hs(Q.reverse())}v-${E3(X)}`}var Dw=Array.from({length:17},($,J)=>xs(J/16));function S3({animated:$=!1,color:J="currentColor",size:Z=24,stroke:H=2,title:B,className:Q,children:X,ref:z,...G}){let Y=Mw(),U=$&&!Y;return R9.jsxs("svg",{ref:z,xmlns:"http://www.w3.org/2000/svg",width:Z,height:Z,viewBox:"0 0 24 24",fill:"none",stroke:J,strokeWidth:H,strokeLinecap:"round",strokeLinejoin:"round",className:s("tabler-icon tabler-icon-ghost",Q),...G,children:[B&&R9.jsx("title",{children:B}),U?R9.jsx(r1.path,{d:Dw[0],animate:{d:Dw},transition:{duration:2,ease:"linear",repeat:1/0}}):R9.jsx("path",{d:bs}),R9.jsx("path",{d:"M10 10l.01 0"}),R9.jsx("path",{d:"M14 10l.01 0"}),R9.jsx("path",{d:"M10 14a3.5 3.5 0 0 0 4 0"}),X]})}var WG=O(c(),1);function KG({visible:$,editing:J,canvasRef:Z,width:H,height:B,pointerProps:Q,onKeyDown:X,children:z}){if(!$)return null;return WG.jsxs("div",{className:"absolute inset-0 animate-in duration-100 fade-in",onKeyDown:X,children:[WG.jsx("canvas",{ref:Z,...Q,width:H,height:B,"aria-label":"Drawing area",tabIndex:0,className:"absolute inset-0 size-full cursor-pencil touch-none outline-none"}),J&&z]})}var l0=O(g(),1);function Sq($,J,Z){let H=Math.max($,J);if(H<=0)return 1;return Math.min(Math.max(Z,1),1568/H)}function vs($){return new Promise((J,Z)=>{setTimeout(()=>Z(Error("Annotation capture timed out")),$)})}async function Pw($){let J=$.getBoundingClientRect();if(J.width<=0||J.height<=0)throw Error("Annotation target is not visible");let{createContext:Z,destroyContext:H,domToCanvas:B}=await import("/chunk-efdyz6xp.js"),Q=async()=>{let X=await Z($,{width:Math.round(J.width),height:Math.round(J.height),scale:Sq(J.width,J.height,window.devicePixelRatio),type:"image/png",backgroundColor:getComputedStyle($).backgroundColor,timeout:1000,features:{restoreScrollPosition:!0},style:{overflow:"hidden"}});try{return await B(X)}finally{H(X)}};return Promise.race([Q(),vs(1e4)])}var Iq={past:[],present:[],future:[]};function gs($,J){if(J.type==="commit")return{past:[...$.past,$.present],present:[...$.present,J.stroke],future:[]};if(J.type==="undo"){let Z=$.past.at(-1);if(!Z)return $;return{past:$.past.slice(0,-1),present:Z,future:[$.present,...$.future]}}if(J.type==="redo"){let Z=$.future[0];if(!Z)return $;return{past:[...$.past,$.present],present:Z,future:$.future.slice(1)}}if($.present.length===0)return $;return{past:[...$.past,$.present],present:[],future:[]}}function jw($,J,Z){let H=$.getBoundingClientRect();return{x:(J-H.left)/H.width*$.width,y:(Z-H.top)/H.height*$.height}}function _w($,J){let Z=J.getCoalescedEvents?.()??[];return(Z.length>0?Z:[J]).map((B)=>jw($,B.clientX,B.clientY))}var fs={canUndo:!1,canRedo:!1,hasStrokes:!1};function wH($){return l0.useSyncExternalStore($.subscribeHistory,$.getHistoryState,$.getHistoryState)}function Ow($,J,Z,H){let B=J.points[0];if(!B)return;$.beginPath(),$.lineCap="round",$.lineJoin="round",$.lineWidth=H,$.strokeStyle=Z,$.moveTo(B.x,B.y);for(let Q=1;Q<J.points.length;Q++){let X=J.points[Q];$.lineTo(X.x,X.y)}if(J.points.length===1)$.lineTo(B.x+0.01,B.y+0.01);$.stroke()}function Tw($,J,Z,H,B,Q=null){let X=Math.max(3,Math.min(J,Z)*0.005),z=X+Math.max(2,X*0.75),G=Q?[...B,Q]:B;for(let Y of G)Ow($,Y,H.haloColor,z);for(let Y of G)Ow($,Y,H.strokeColor,X)}function ms($,J,Z,H=null){let B=$.getContext("2d");if(!B)return;B.clearRect(0,0,$.width,$.height),Tw(B,$.width,$.height,J,Z,H)}function ps($,J,Z){let H=$.getContext("2d");if(!H)return;H.clearRect(0,0,$.width,$.height),H.drawImage(J.snapshot,0,0,$.width,$.height),Tw(H,$.width,$.height,J,Z)}function us($){return new Promise((J,Z)=>{$.toBlob((H)=>{if(H)J(H);else Z(Error("Could not export drawing"))},"image/png")})}function cs($,J,Z){let H=$.getBoundingClientRect();if(H.width<=0||H.height<=0)return null;let B=getComputedStyle($),Q=Sq(H.width,H.height,window.devicePixelRatio),X=Math.max(1,Math.round(H.width*Q)),z=Math.max(1,Math.round(H.height*Q)),G=document.createElement("canvas");G.width=X,G.height=z;let Y=B.getPropertyValue("--background").trim()||"#ffffff",U=G.getContext("2d");if(U)U.fillStyle=Y,U.fillRect(0,0,X,z);return J.width=X,J.height=z,{id:Z,snapshot:G,strokeColor:B.getPropertyValue("--primary").trim()||"#2563eb",haloColor:Y,targetWidth:H.width,targetHeight:H.height}}function ds($){return $ instanceof HTMLInputElement||$ instanceof HTMLTextAreaElement||$ instanceof HTMLElement&&$.isContentEditable}function qG({mode:$="annotation",onChange:J,onEditingStart:Z,onFinish:H}={}){let B=l0.useRef(null),Q=l0.useRef(null),[X,z]=l0.useState(null),G=l0.useRef(X),[Y,U]=l0.useState(!1),F=l0.useRef(!1),K=l0.useRef(Iq),W=l0.useRef(fs),q=l0.useRef(new Set),N=l0.useRef(0),V=l0.useRef(null),L=l0.useRef(null),A=l0.useRef(0),M=l0.useRef(0),_=l0.useRef(null),P=l0.useRef(null),[D,w]=l0.useState(!1),R=l0.useRef(!1),[b,E]=l0.useState(!1),x=l0.useRef(!1),I=l0.useRef(J),S=l0.useRef(Z),j=l0.useRef(H);I.current=J,S.current=Z,j.current=H;let C=l0.useCallback(()=>{let p=K.current,d=W.current,m={canUndo:p.past.length>0,canRedo:p.future.length>0,hasStrokes:p.present.length>0};if(m.canUndo===d.canUndo&&m.canRedo===d.canRedo&&m.hasStrokes===d.hasStrokes)return;W.current=m;for(let a of q.current)a()},[]),k=l0.useCallback((p)=>{return q.current.add(p),()=>{q.current.delete(p)}},[]),y=l0.useCallback(()=>W.current,[]),v=l0.useCallback((p,d=null)=>{if(A.current)cancelAnimationFrame(A.current),A.current=0;let m=Q.current,a=G.current;if(m&&a)ms(m,a,p,d)},[]),u=l0.useCallback(()=>{if(A.current)return;A.current=requestAnimationFrame(()=>{A.current=0,v(K.current.present,V.current)})},[v]),T=l0.useCallback((p,d,m)=>{let a=_.current;if(a?.sessionId===p.id&&a.historyVersion===m)return Promise.resolve(a.blob);let o=P.current;if(o?.sessionId===p.id&&o.historyVersion===m)return o.promise;if(d.length===0)return _.current={sessionId:p.id,historyVersion:m,blob:null},I.current?.(null),Promise.resolve(null);let N0=document.createElement("canvas");N0.width=p.snapshot.width,N0.height=p.snapshot.height,ps(N0,p,d);let O0=us(N0).then((g0)=>{if(G.current?.id!==p.id||N.current!==m)return g0;return _.current={sessionId:p.id,historyVersion:m,blob:g0},I.current?.(g0),g0}).catch(()=>{if(G.current?.id===p.id&&N.current===m)i4.add({title:"Couldn’t export the drawing",type:"error"});return null}).finally(()=>{if(P.current?.promise===O0)P.current=null});return P.current={sessionId:p.id,historyVersion:m,promise:O0},O0},[]),t=l0.useCallback(()=>{if(!V.current)return;let p=Q.current,d=L.current;if(p&&d!==null&&p.hasPointerCapture(d))p.releasePointerCapture(d);V.current=null,L.current=null,v(K.current.present)},[v]),B0=l0.useCallback((p)=>{let d=G.current;if(!d||x.current)return;let m=gs(K.current,p);if(m===K.current)return;K.current=m,C(),V.current=null;let a=++N.current;v(m.present),T(d,m.present,a)},[T,C,v]),h=l0.useCallback((p)=>{K.current=Iq,N.current=0,_.current=null,P.current=null,V.current=null,L.current=null,C(),G.current=p,z(p)},[C]),e=l0.useCallback(()=>{if(F.current)return;F.current=!0,U(!0),S.current?.()},[]),A0=l0.useCallback(async()=>{let p=B.current;if(!p||G.current||R.current)return!1;let d=++M.current;R.current=!0,w(!0);try{let m=await Pw(p);if(d!==M.current||B.current!==p)return!1;let a=p.getBoundingClientRect(),o=getComputedStyle(p),N0={id:d,snapshot:m,strokeColor:o.getPropertyValue("--primary").trim()||"#2563eb",haloColor:o.getPropertyValue("--background").trim()||"#ffffff",targetWidth:a.width,targetHeight:a.height};return h(N0),e(),!0}finally{if(d===M.current)R.current=!1,w(!1)}},[e,h]),l=l0.useCallback(()=>{let p=G.current;M.current+=1,R.current=!1,x.current=!1,w(!1),E(!1),F.current=!1,U(!1),t(),z(null),K.current=Iq,C();let d=P.current;if(!p||d?.sessionId!==p.id)return G.current=null,Promise.resolve();return d.promise.then(()=>{if(G.current?.id===p.id)G.current=null})},[t,C]),z0=l0.useCallback(async()=>{let p=G.current;if(!p)return null;return t(),T(p,K.current.present,N.current)},[t,T]),W0=l0.useCallback(async()=>{return F.current=!1,U(!1),z0()},[z0]),Q0=l0.useCallback(async()=>{let p=G.current;if(!p||x.current)return null;x.current=!0,E(!0),t();let d=N.current,m=K.current.present,a=null;if(m.length>0||d>0)a=await T(p,m,d);if(G.current?.id!==p.id)return a;try{await j.current?.(a)}finally{if(G.current?.id===p.id)M.current+=1,F.current=!1,U(!1),G.current=null,z(null),x.current=!1,E(!1)}return a},[t,T]),G0=l0.useCallback(()=>B0({type:"undo"}),[B0]),L0=l0.useCallback(()=>B0({type:"redo"}),[B0]),i=l0.useCallback(()=>B0({type:"clear"}),[B0]),$0=l0.useMemo(()=>({onPointerDown:(p)=>{if(x.current||!p.isPrimary||p.pointerType==="mouse"&&p.button!==0)return;if(!G.current&&$==="sketch"){let d=B.current;if(!d)return;let m=cs(d,p.currentTarget,++M.current);if(!m)return;h(m)}if(!G.current)return;e(),L.current=p.pointerId,p.currentTarget.setPointerCapture(p.pointerId),V.current={points:[jw(p.currentTarget,p.clientX,p.clientY)]},v(K.current.present,V.current)},onPointerMove:(p)=>{if(p.pointerId!==L.current||!V.current)return;V.current.points.push(..._w(p.currentTarget,p.nativeEvent)),u()},onPointerUp:(p)=>{if(p.pointerId!==L.current||!V.current)return;let d=V.current;if(d.points.push(..._w(p.currentTarget,p.nativeEvent)),V.current=null,L.current=null,p.currentTarget.hasPointerCapture(p.pointerId))p.currentTarget.releasePointerCapture(p.pointerId);B0({type:"commit",stroke:d})},onPointerCancel:(p)=>{if(p.pointerId===L.current)t()}}),[B0,e,t,h,$,v,u]),J0=l0.useCallback((p)=>{if(ds(p.target))return;if(p.key==="Escape"&&$==="annotation"){p.preventDefault(),Q0();return}if(!(p.metaKey||p.ctrlKey)||p.key.toLowerCase()!=="z")return;if(p.preventDefault(),p.shiftKey)L0();else G0()},[Q0,$,L0,G0]);l0.useLayoutEffect(()=>{if(!X)return;if(v(K.current.present,V.current),Y)Q.current?.focus()},[Y,v,X]),l0.useEffect(()=>{if(!X||$==="sketch")return;let p=B.current;if(!p){l();return}let d=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)l()});return d.observe(p),()=>d.disconnect()},[l,$,X]),l0.useEffect(()=>()=>{if(M.current+=1,F.current=!1,G.current=null,A.current)cancelAnimationFrame(A.current)},[]);let H0=l0.useMemo(()=>({active:Y,visible:$==="sketch"||X!==null,starting:D,finishing:b,open:A0,undo:G0,redo:L0,clear:i,flush:z0,deactivate:W0,finish:Q0,cancel:l,subscribeHistory:k,getHistoryState:y}),[Y,$,X,D,b,A0,G0,L0,i,z0,W0,Q0,l,k,y]),n=l0.useMemo(()=>({visible:H0.visible,editing:H0.active,canvasRef:Q,width:X?.snapshot.width??1,height:X?.snapshot.height??1,pointerProps:$0,onKeyDown:J0}),[H0.active,H0.visible,X,$0,J0]);return l0.useMemo(()=>({targetRef:B,controls:H0,layerProps:n}),[H0,n])}var u5=O(c(),1);function NG({controls:$,title:J,busy:Z,onComplete:H}){let{canUndo:B,canRedo:Q,hasStrokes:X}=wH($);return u5.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:[u5.jsx("span",{className:"mr-2 ml-2 text-sm font-medium",children:J}),u5.jsxs("div",{className:"flex gap-1",children:[u5.jsxs(d1,{children:[u5.jsx(l1,{render:u5.jsx(C0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.undo,disabled:Z||!B,"aria-label":"Undo",children:u5.jsx(Cw,{stroke:1.75})})}),u5.jsx(i1,{children:"Undo"})]}),u5.jsxs(d1,{children:[u5.jsx(l1,{render:u5.jsx(C0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.redo,disabled:Z||!Q,"aria-label":"Redo",children:u5.jsx(ww,{stroke:1.75})})}),u5.jsx(i1,{children:"Redo"})]}),u5.jsx(C0,{type:"button",variant:"outline",size:"sm",onClick:$.clear,disabled:Z||!X,children:"Clear"})]}),u5.jsx(t2,{mode:"popLayout",initial:!1,children:u5.jsx(r1.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:u5.jsx(C0,{type:"button",variant:X?"default":"ghost",size:"icon-sm",onClick:H,disabled:Z,"aria-label":"Complete",className:s(!X&&"text-muted-foreground"),children:X?u5.jsx(F3,{stroke:1.75}):u5.jsx(w5,{stroke:1.75})})},X?"complete":"cancel")})]})}var h5=O(g(),1);async function Rq($,J){let Z=new FormData;for(let B of J)Z.append("files",B);let H=await fetch(`/api/workspaces/${$}/uploads`,{method:"POST",body:Z});if(!H.ok){let B=await H.text().catch(()=>"");throw Error(B||`Upload failed (${H.status})`)}return H.json()}function Ew({workspaceId:$,sessionId:J},Z){if(Z.length===0)return;let H=Z.map((B)=>({kind:"file",localId:crypto.randomUUID(),name:B.name||"file",mediaType:B.type||"application/octet-stream",previewUrl:B.type.startsWith("image/")?URL.createObjectURL(B):void 0,status:"uploading"}));E1.getState().addAttachments($,J,H),H.forEach((B,Q)=>{Rq($,[Z[Q]]).then(([X])=>{E1.getState().updateAttachment($,J,B.localId,{status:"ready",upload:X,mediaType:X.mediaType})}).catch((X)=>{E1.getState().updateAttachment($,J,B.localId,{status:"error",error:X instanceof Error?X.message:"Upload failed"})})})}function LG({workspaceId:$,sessionId:J,localId:Z,purpose:H,sourceTab:B,blob:Q}){let X=H==="sketch"?"Sketch":"Annotation",z=URL.createObjectURL(Q),G=E1.getState();if(G.attachments[o2($,J)]?.some((U)=>U.localId===Z))G.updateAttachment($,J,Z,{previewUrl:z,status:"draft",upload:void 0,error:void 0});else G.addAttachments($,J,[{kind:"drawing",purpose:H,localId:Z,sourceTab:B,name:`${X}.png`,mediaType:"image/png",previewUrl:z,status:"draft"}])}async function VG({workspaceId:$,sessionId:J,localId:Z,purpose:H,sourceTab:B,blob:Q,isCurrent:X}){let z=H==="sketch"?"Sketch":"Annotation",G=URL.createObjectURL(Q),Y=E1.getState();if(Y.attachments[o2($,J)]?.some((F)=>F.localId===Z))Y.updateAttachment($,J,Z,{previewUrl:G,status:"uploading",upload:void 0,error:void 0});else Y.addAttachments($,J,[{kind:"drawing",purpose:H,localId:Z,sourceTab:B,name:`${z}.png`,mediaType:"image/png",previewUrl:G,status:"uploading"}]);try{let[F]=await Rq($,[new File([Q],`${z}.png`,{type:"image/png"})]);if(!X())return;E1.getState().updateAttachment($,J,Z,{status:"ready",upload:F,mediaType:F.mediaType,error:void 0})}catch{if(!X())return;E1.getState().removeAttachment($,J,Z)}}function Sw({workspaceId:$,sessionId:J,activeTab:Z,mode:H,available:B,closePopup:Q,openPopup:X}){let z=h5.useRef(null),G=h5.useRef(null),Y=h5.useRef(new Map),U=h5.useRef(Q),F=h5.useRef(X);U.current=Q,F.current=X;let K=h5.useCallback((j)=>{let C=z.current;if(!C)return;if(G.current=j,!j){E1.getState().removeAttachment(C.workspaceId,C.sourceSessionId,C.attachmentId);return}LG({workspaceId:C.workspaceId,sessionId:C.sourceSessionId,localId:C.attachmentId,purpose:"annotation",sourceTab:C.sourceTab,blob:j})},[]),W=h5.useCallback((j,C)=>{let k=(Y.current.get(j.attachmentId)??0)+1;return Y.current.set(j.attachmentId,k),VG({workspaceId:j.workspaceId,sessionId:j.sourceSessionId,localId:j.attachmentId,purpose:"annotation",sourceTab:j.sourceTab,blob:C,isCurrent:()=>Y.current.get(j.attachmentId)===k})},[]),q=h5.useCallback(async(j)=>{let C=z.current;if(z.current=null,G.current=null,C&&j)await W(C,j);if(C?.origin==="popup")F.current()},[W]),N=qG({onChange:K,onFinish:q}),{controls:V}=N,{active:L,starting:A,open:M,finish:_,cancel:P}=V,D=h5.useCallback(async(j)=>{if(!B||L||A)return;let C={workspaceId:$,sourceSessionId:J,sourceTab:Z,origin:j,attachmentId:crypto.randomUUID()};z.current=C;try{if(!await M()){if(z.current===C)z.current=null;return}if(j==="popup")U.current()}catch{if(z.current!==C)return;z.current=null,i4.add({title:"Couldn’t capture this page",type:"error"})}},[L,Z,B,M,J,A,$]),w=h5.useCallback(async()=>{let j=z.current;if(await P(),z.current!==j)return;z.current=null;let C=G.current;if(G.current=null,j&&C)W(j,C)},[P,W]),R=h5.useCallback((j)=>{let C=(Y.current.get(j)??0)+1;if(Y.current.set(j,C),E1.getState().removeAttachment($,J,j),z.current?.attachmentId===j)z.current=null,G.current=null,P()},[P,J,$]),b=h5.useCallback(async()=>{if(A){await w();return}await _()},[w,_,A]),E=h5.useCallback(()=>{if(L||A)b();else D("docked")},[L,b,D,A]),x=h5.useCallback(()=>{if(L||A)b();else D("popup")},[L,b,D,A]);h5.useEffect(()=>{let j=z.current;if(!j)return;let C=j.origin==="docked"?"split":"fullscreen";if(j.workspaceId!==$||j.sourceSessionId!==J||j.sourceTab!==Z||H!==C||!B)w()},[Z,B,w,H,J,$]);let I=h5.useMemo(()=>B?{active:L||A,finish:b,onRemove:R,onToggle:E}:void 0,[B,L,A,b,R,E]),S=h5.useMemo(()=>B?{active:L||A,finish:b,onRemove:R,onToggle:x}:void 0,[B,L,A,b,R,x]);return h5.useMemo(()=>({...N,docked:I,popup:S}),[N,I,S])}var y4=O(g(),1);var Z8=O(c(),1);function kq($){if(!$)return;$.focus();let J=$.value.length;$.setSelectionRange(J,J)}function Rw({composerRef:$,className:J,onMouseDown:Z,children:H,...B}){return Z8.jsx("form",{...B,onMouseDown:(Q)=>{if(Z?.(Q),Q.defaultPrevented)return;if(Q.target instanceof Element&&Q.target.closest('button, input, textarea, select, a, [contenteditable="true"]'))return;kq($.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",J),children:H})}function kw({textareaRef:$,className:J,...Z}){return Z8.jsx("textarea",{...Z,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",J)})}function bw({className:$,children:J,...Z}){return Z8.jsx("div",{...Z,className:s("flex items-center justify-end gap-3",$),children:J})}function ls($){if($.status==="checking")return"Checking agent status…";return}function EH($,J,Z){return $&&!J&&Z.status==="available"}function yw({label:$,hasContent:J,busy:Z=!1,loading:H=!1,availability:B}){let Q=EH(J,Z||H,B),X=ls(B),z=Z8.jsx(C0,{type:"submit",size:"icon",disabled:!Q,"aria-label":$,children:H?Z8.jsx(E4,{}):Z8.jsx(Iw,{stroke:1.5})});if(H||!X)return z;return Z8.jsxs(d1,{children:[Z8.jsx(l1,{render:Z8.jsx("span",{className:"inline-flex",children:z})}),Z8.jsx(i1,{className:"max-w-64 text-center",children:X})]})}var b4=O(g(),1),is=48;function hw($,J){let Z=b4.useRef(!0),[H,B]=b4.useState(!0),Q=b4.useCallback((G)=>{Z.current=G,B((Y)=>Y===G?Y:G)},[]),X=b4.useCallback((G="auto")=>{let Y=$.current;if(!Y)return;Q(!0),Y.scrollTo({top:Y.scrollHeight,behavior:G})},[$,Q]),z=b4.useCallback(()=>{let G=$.current;if(!G)return;Q(!1),G.scrollTo({top:0,behavior:"auto"})},[$,Q]);return b4.useEffect(()=>{let G=$.current;if(!G)return;let Y=()=>{let U=G.scrollHeight-G.scrollTop-G.clientHeight;Q(U<=is)};return G.addEventListener("scroll",Y,{passive:!0}),()=>G.removeEventListener("scroll",Y)},[$,Q]),b4.useEffect(()=>{let G=$.current;if(!G)return;let Y=G.firstElementChild??G,U=new ResizeObserver(()=>{if(Z.current)G.scrollTop=G.scrollHeight});return U.observe(Y),()=>U.disconnect()},[$]),b4.useLayoutEffect(()=>{X("auto")},[J,X]),{atBottom:H,scrollToBottom:X,scrollToTop:z}}function rs($){return $.origin.kind!=="replay"&&$.origin.kind!=="synthetic"&&$.origin.kind!=="subagent-prompt"}function as($,J){let Z=$.meta||J.meta?{...$.meta,...J.meta}:void 0;return{...$,parts:[...$.parts,...J.parts],timestamp:J.timestamp??$.timestamp,meta:Z}}function xw($){let J=[];for(let Z of $){if(!rs(Z))continue;if(Z.role!=="assistant"){J.push(Z);continue}let H=J.length>0?J[J.length-1]:null;if(H?.role==="assistant")J[J.length-1]=as(H,Z);else J.push(Z)}return J.map((Z,H)=>{let B=J[H-1];if(Z.role!=="assistant"||B?.role!=="user"||B.origin.kind!=="user-input"||!B.timestamp||!Z.timestamp)return Z;let Q=Date.parse(B.timestamp),X=Date.parse(Z.timestamp);if(!Number.isFinite(Q)||!Number.isFinite(X)||X<Q)return Z;return{...Z,meta:{...Z.meta,durationMs:X-Q}}})}function bq($){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 vw($){if(!$)return;let J=Date.parse($);return Number.isNaN(J)?void 0:J}function gw($,J){let Z=J.filter((G)=>bq(G)!==null);if(Z.length===0)return $.map((G)=>({kind:"turn",turn:G}));let H=[],B=[];for(let G of Z){let Y=vw(G.at);if(Y===void 0)B.push(G);else H.push({notice:G,time:Y})}H.sort((G,Y)=>G.time-Y.time);let Q=[],X=0,z=Number.NEGATIVE_INFINITY;for(let G of $){z=Math.max(z,vw(G.timestamp)??z);while(X<H.length&&H[X].time<=z)Q.push({kind:"notice",notice:H[X].notice}),X+=1;Q.push({kind:"turn",turn:G})}for(;X<H.length;X+=1)Q.push({kind:"notice",notice:H[X].notice});for(let G of B)Q.push({kind:"notice",notice:G});return Q}var QJ=O(g(),1);var R3={};_4(R3,{createHandle:()=>QE,Viewport:()=>BE,Trigger:()=>rw,Root:()=>cw,Positioner:()=>nw,Portal:()=>iw,Popup:()=>sw,Handle:()=>OG,Backdrop:()=>JE,Arrow:()=>ew});var I3=O(g(),1);var AG=O(g(),1),yq=AG.createContext(void 0);function q4($){let J=AG.useContext(yq);if(J===void 0&&!$)throw Error(E0(50));return J}var mw=O(g(),1),pw=O(G4(),1);var fw=600,DG=300;var ns={...i8,instantType:S0(($)=>$.instantType),hasViewport:S0(($)=>$.hasViewport)};class f7 extends i2{constructor($){super({...os(),...$},{popupRef:mw.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new a2,closeDelayRef:{current:DG}},ns)}setOpen=($,J)=>{let Z=J.reason,H=Z===Y0.triggerHover,B=$&&Z===Y0.triggerFocus,Q=!$&&(Z===Y0.triggerPress||Z===Y0.escapeKey);if(J.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,J),J.isCanceled)return;let X=()=>{let z={open:$};if(B)z.instantType="focus";else if(Q)z.instantType="dismiss";else if(Z===Y0.triggerHover)z.instantType=void 0;let G=J.trigger?.id??null;if(G||$)z.activeTriggerId=G,z.activeTriggerElement=J.trigger??null;this.update(z)};if(H)pw.flushSync(X);else X()};static useStore($,J){let Z=R1(()=>{return new f7(J)}).current,H=$??Z,B=q8({popupStore:H,onOpenChange:H.setOpen});return H.state.floatingRootContext=B,H}}function os(){return{...l8(),instantType:void 0,hasViewport:!1}}var uw=O(c(),1);function cw($){let{open:J,defaultOpen:Z=!1,onOpenChange:H,onOpenChangeComplete:B,actionsRef:Q,handle:X,triggerId:z,defaultTriggerId:G=null,children:Y}=$,U=f7.useStore(X?.store,{open:Z,openProp:J,activeTriggerId:G,triggerIdProp:z});s8(()=>{if(J===void 0&&U.state.open===!1&&Z===!0)U.update({open:!0,activeTriggerId:G})}),U.useControlledProp("openProp",J),U.useControlledProp("triggerIdProp",z),U.useContextCallback("onOpenChange",H),U.useContextCallback("onOpenChangeComplete",B);let F=U.useState("open"),K=U.useState("activeTriggerId"),W=U.useState("payload");c8(U);let{forceUnmount:q}=d8(F,U);F0(()=>{if(F){if(K==null)U.set("payload",void 0)}},[U,K,F]);let N=I3.useCallback(()=>{U.setOpen(!1,ss(U,Y0.imperativeAction))},[U]);I3.useImperativeHandle(Q,()=>({unmount:q,close:N}),[q,N]);let V=U.useState("floatingRootContext"),L=W8(V),{getReferenceProps:A,getTriggerProps:M,getFloatingProps:_}=$2([L]),P=I3.useMemo(()=>A(),[A]),D=I3.useMemo(()=>M(),[M]),w=I3.useMemo(()=>_(),[_]);return U.useSyncedValues({activeTriggerProps:P,inactiveTriggerProps:D,popupProps:w}),uw.jsx(yq.Provider,{value:U,children:typeof Y==="function"?Y({payload:W}):Y})}function ss($,J){let Z=M0(J);return Z.preventUnmountOnClose=()=>{$.set("preventUnmountingOnClose",!0)},Z}var lw=O(g(),1);var MG=O(g(),1),hq=MG.createContext(void 0);function dw(){let $=MG.useContext(hq);if($===void 0)throw Error(E0(48));return $}var xq=O(c(),1),iw=lw.forwardRef(function(J,Z){let{keepMounted:H=!1,...B}=J;if(!(q4().useState("mounted")||H))return null;return xq.jsx(hq.Provider,{value:H,children:xq.jsx(s6,{ref:Z,...B})})});var PG=O(g(),1);var rw=PG.forwardRef(function(J,Z){let{render:H,className:B,delay:Q,closeDelay:X,id:z,payload:G,handle:Y,...U}=J,F=q4(!0),K=Y?.store??F;if(!K)throw Error(E0(89));let W=t0(z),q=K.useState("isTriggerActive",W),N=K.useState("isOpenedByTrigger",W),V=K.useState("floatingRootContext"),L=PG.useRef(null),A=Q??fw,M=X??DG,{registerTrigger:_,isMountedByThisTrigger:P}=u8(W,L,K,{payload:G});F0(()=>{if(P)K.context.closeDelayRef.current=M},[K,P,M]);let D=N8(V,{mouseOnly:!0,move:!1,handleClose:L8(),delay:()=>({open:A,close:M}),triggerElementRef:L,isActiveTrigger:q}),w=T$(V,{delay:A}),R={open:N},b=K.useState("triggerProps",P);return U0("a",J,{state:R,ref:[Z,_,L],props:[D,w.reference,b,{id:W},U],stateAttributesMapping:n8})});var SH=O(g(),1);var _G=O(g(),1),vq=_G.createContext(void 0);function m7(){let $=_G.useContext(vq);if($===void 0)throw Error(E0(49));return $}var aw=O(c(),1),nw=SH.forwardRef(function(J,Z){let{render:H,className:B,anchor:Q,positionMethod:X="absolute",side:z="bottom",align:G="center",sideOffset:Y=0,alignOffset:U=0,collisionBoundary:F="clipping-ancestors",collisionPadding:K=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:V=o8,...L}=J,A=q4(),M=dw(),_=A.useState("open"),P=A.useState("mounted"),D=A.useState("floatingRootContext"),w=A.useState("instantType"),R=A.useState("transitionStatus"),b=A.useState("hasViewport"),E=a8({anchor:Q,floatingRootContext:D,positionMethod:X,mounted:P,side:z,sideOffset:Y,align:G,alignOffset:U,arrowPadding:W,collisionBoundary:F,collisionPadding:K,sticky:q,disableAnchorTracking:N,keepMounted:M,collisionAvoidance:V,adaptiveOrigin:b?t6:void 0}),x=SH.useMemo(()=>{let C={};if(!_)C.pointerEvents="none";return{role:"presentation",hidden:!P,style:{...E.positionerStyles,...C}}},[_,P,E.positionerStyles]),I={open:_,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:w},S=SH.useMemo(()=>({side:E.side,align:E.align,arrowRef:E.arrowRef,arrowUncentered:E.arrowUncentered,arrowStyles:E.arrowStyles}),[E.side,E.align,E.arrowRef,E.arrowUncentered,E.arrowStyles]),j=U0("div",J,{state:I,props:[x,F2(R),L],ref:[Z,A.useStateSetter("positionerElement")],stateAttributesMapping:D1});return aw.jsx(vq.Provider,{value:S,children:j})});var ow=O(g(),1);var ts={...D1,...c1},sw=ow.forwardRef(function(J,Z){let{className:H,render:B,...Q}=J,X=q4(),{side:z,align:G}=m7(),Y=X.useState("open"),U=X.useState("instantType"),F=X.useState("transitionStatus"),K=X.useState("popupProps"),W=X.useState("floatingRootContext");b5({open:Y,ref:X.context.popupRef,onComplete(){if(Y)X.context.onOpenChangeComplete?.(!0)}});let q=K0(()=>X.context.closeDelayRef.current);return E9(W,{closeDelay:q}),U0("div",J,{state:{open:Y,side:z,align:G,instant:U,transitionStatus:F},ref:[Z,X.context.popupRef,X.useStateSetter("popupElement")],props:[K,F2(F),Q],stateAttributesMapping:ts})});var tw=O(g(),1);var ew=tw.forwardRef(function(J,Z){let{render:H,className:B,...Q}=J,X=q4(),{arrowRef:z,side:G,align:Y,arrowUncentered:U,arrowStyles:F}=m7(),W={open:X.useState("open"),side:G,align:Y,uncentered:U};return U0("div",J,{state:W,ref:[z,Z],props:[{style:F,"aria-hidden":!0},Q],stateAttributesMapping:D1})});var $E=O(g(),1);var es={...D1,...c1},JE=$E.forwardRef(function(J,Z){let{render:H,className:B,...Q}=J,X=q4(),z=X.useState("open"),G=X.useState("mounted"),Y=X.useState("transitionStatus");return U0("div",J,{state:{open:z,transitionStatus:Y},ref:[Z],props:[{role:"presentation",hidden:!G,style:{pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none"}},Q],stateAttributesMapping:es})});var HE=O(g(),1);var ZE=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var $t={activationDirection:($)=>$?{"data-activation-direction":$}:null},BE=HE.forwardRef(function(J,Z){let{render:H,className:B,children:Q,...X}=J,z=q4(),G=m7(),Y=z.useState("instantType"),{children:U,state:F}=H7({store:z,side:G.side,cssVars:ZE,children:Q}),K={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:Y};return U0("div",J,{state:K,ref:Z,props:[X,{children:U}],stateAttributesMapping:$t})});class OG{constructor(){this.store=new f7}open($){let J=$?this.store.context.triggerElements.getById($):void 0;if($&&!J)throw Error(E0(88,$));this.store.setOpen(!0,M0(Y0.imperativeAction,void 0,J))}close(){this.store.setOpen(!1,M0(Y0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function QE(){return new OG}var p7=O(c(),1);function XE({...$}){return p7.jsx(R3.Root,{"data-slot":"hover-card",...$})}function zE({...$}){return p7.jsx(R3.Trigger,{"data-slot":"hover-card-trigger",...$})}function GE({className:$,side:J="bottom",sideOffset:Z=4,align:H="center",alignOffset:B=0,...Q}){return p7.jsx(R3.Portal,{"data-slot":"hover-card-portal",children:p7.jsx(R3.Positioner,{align:H,alignOffset:B,side:J,sideOffset:Z,className:"isolate z-50",children:p7.jsx(R3.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 BJ=O(g(),1);function jG($){return n1({queryKey:w0.sessions($),queryFn:()=>N1(`/api/workspaces/${$}/sessions`),...k4})}function Jt($,J){return $?.filter((Z)=>Z.sessionId!==J)}function YE($){let J=s0();return o1({mutationFn:(Z)=>w4(`/api/workspaces/${$}/sessions/${Z}/archive`,{method:"POST"},"Couldn’t archive chat"),onSuccess:(Z,H)=>{J.setQueryData(w0.sessions($),(B)=>Jt(B,H)),J.removeQueries({queryKey:w0.events($,H)}),J.removeQueries({queryKey:w0.sessionConfig($,H)}),J.invalidateQueries({queryKey:w0.preview($)})}})}function UE($,J){return n1({queryKey:w0.events($,J??""),queryFn:async()=>{let Z=await fetch(`/api/workspaces/${$}/sessions/${J}/events`),H=Z.ok?await Z.json():[];return I_(H)},enabled:Boolean(J),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function TG($,J){return n1({queryKey:w0.sessionConfig($,J??""),queryFn:()=>N1(`/api/workspaces/${$}/sessions/${J}/config`),enabled:Boolean(J),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function FE($){let J=s0();return o1({mutationFn:({patch:Z,sessionId:H})=>N1(`/api/workspaces/${$}/sessions/${H}/config`,a5("PUT",Z),"Failed to save chat settings"),onSuccess:(Z,{sessionId:H})=>{J.setQueryData(w0.sessionConfig($,H),Z)}})}var Zt=["fable","opus","sonnet","haiku"];function KE($){let J=$.resolvedModel??$.value,Z=Zt.findIndex((H)=>J===H||J.startsWith(`${H}[`)||J.includes(`-${H}-`));return Z===-1?void 0:Z}function Ht($,J){if($===void 0&&J===void 0)return 0;if($===void 0)return-1;if(J===void 0)return 1;return $-J}function Bt($,J){return Ht(KE($),KE(J))}var Qt={"claude-code":Bt};function Xt($,J){return $.map((Z,H)=>({model:Z,index:H})).sort((Z,H)=>J(Z.model,H.model)||Z.index-H.index).map(({model:Z})=>Z)}function gq($,J,Z){if(J&&$.includes(J))return J;if(Z&&$.includes(Z))return Z;if($.includes("high"))return"high";return $[$.length-1]}function WE($,J,Z){let H=gq($,J,Z);return H?$.indexOf(H):-1}function qE($){return $.length>1}function NE($,J){if($.supportsFastMode!==!0)return!1;return J??$.defaultFastMode??!1}function LE($,J){let Z=Qt[J];return Z?Xt($,Z):$}function VE($,J){let Z=[];for(let H of $){let B=H.group??J,Q=Z.find((X)=>X.label===B);if(Q)Q.models.push(H);else Z.push({label:B,models:[H]})}return Z}var e2={};_4(e2,{createHandle:()=>GS,Trigger:()=>BS,SubmenuTrigger:()=>zS,SubmenuRoot:()=>eE,Separator:()=>XS,Root:()=>aG,RadioItemIndicator:()=>oE,RadioItem:()=>nE,RadioGroup:()=>iE,Positioner:()=>cE,Portal:()=>mE,Popup:()=>vE,LinkItem:()=>hE,Item:()=>yE,Handle:()=>$Y,GroupLabel:()=>kE,Group:()=>IE,CheckboxItemIndicator:()=>wE,CheckboxItem:()=>CE,Backdrop:()=>PE,Arrow:()=>DE});var AE=O(g(),1);var CG=O(g(),1),fq=CG.createContext(void 0);function N4($){let J=CG.useContext(fq);if(J===void 0&&!$)throw Error(E0(33));return J}var wG=O(g(),1),mq=wG.createContext(void 0);function z5($){let J=wG.useContext(mq);if(J===void 0&&!$)throw Error(E0(36));return J}var DE=AE.forwardRef(function(J,Z){let{className:H,render:B,...Q}=J,{store:X}=z5(),{arrowRef:z,side:G,align:Y,arrowUncentered:U,arrowStyles:F}=N4(),W={open:X.useState("open"),side:G,align:Y,uncentered:U};return U0("div",J,{ref:[z,Z],stateAttributesMapping:D1,state:W,props:{style:F,"aria-hidden":!0,...Q}})});var ME=O(g(),1);var EG=O(g(),1),zt=EG.createContext(void 0);function G9($=!0){let J=EG.useContext(zt);if(J===void 0&&!$)throw Error(E0(25));return J}var Gt={...D1,...c1},PE=ME.forwardRef(function(J,Z){let{className:H,render:B,...Q}=J,{store:X}=z5(),z=X.useState("open"),G=X.useState("mounted"),Y=X.useState("transitionStatus"),U=X.useState("lastOpenChangeReason"),F=G9(),K={open:z,transitionStatus:Y};return U0("div",J,{ref:F?.backdropRef?[Z,F.backdropRef]:Z,state:K,stateAttributesMapping:Gt,props:[{role:"presentation",hidden:!G,style:{pointerEvents:U===Y0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},Q]})});var kG=O(g(),1);var SG=O(g(),1),pq=SG.createContext(void 0);function _E(){let $=SG.useContext(pq);if($===void 0)throw Error(E0(30));return $}var u7=O(g(),1);var OE=O(g(),1);function IG($){let{closeOnClick:J,highlighted:Z,id:H,nodeId:B,store:Q,itemRef:X,itemMetadata:z}=$,{events:G}=Q.useState("floatingTreeRoot"),Y=G9(!0),U=Y!==void 0;return OE.useMemo(()=>({id:H,role:"menuitem",tabIndex:Z?0:-1,onMouseMove(F){if(!B)return;G.emit("itemhover",{nodeId:B,target:F.currentTarget})},onClick(F){if(J)G.emit("close",{domEvent:F,reason:Y0.itemPress})},onMouseUp(F){if(Y){let K=Y.initialCursorPointRef.current;if(Y.initialCursorPointRef.current=null,U&&K&&Math.abs(F.clientX-K.x)<=1&&Math.abs(F.clientY-K.y)<=1)return}if(X.current&&Q.context.allowMouseUpTriggerRef.current&&(!U||F.button===2)){if(!z||z.type==="regular-item")X.current.click()}}}),[J,Z,H,G,B,Q,X,Y,U,z])}var c7={type:"regular-item"};function k3($){let{closeOnClick:J,disabled:Z=!1,highlighted:H,id:B,store:Q,nativeButton:X,itemMetadata:z,nodeId:G}=$,Y=u7.useRef(null),{getButtonProps:U,buttonRef:F}=p5({disabled:Z,focusableWhenDisabled:!0,native:X}),K=IG({closeOnClick:J,highlighted:H,id:B,nodeId:G,store:Q,itemRef:Y,itemMetadata:z}),W=u7.useCallback((N)=>{return U4(K,{onMouseEnter(){if(z.type!=="submenu-trigger")return;z.setActive()},onKeyUp(V){if(V.key===" "&&Q.context.typingRef.current)V.preventBaseUIHandler()}},N,U)},[K,U,Q,z]),q=j4(Y,F);return u7.useMemo(()=>({getItemProps:W,itemRef:q}),[W,q])}var k9=O(g(),1);var RG=O(g(),1),uq=RG.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>{return()=>{}},elementsRef:{current:[]},nextIndexRef:{current:0}});function jE(){return RG.useContext(uq)}var Yt=function($){return $[$.None=0]="None",$[$.GuessFromOrder=1]="GuessFromOrder",$}({});function L4($={}){let{label:J,metadata:Z,textRef:H,indexGuessBehavior:B,index:Q}=$,{register:X,unregister:z,subscribeMapChange:G,elementsRef:Y,labelsRef:U,nextIndexRef:F}=jE(),K=k9.useRef(-1),[W,q]=k9.useState(Q??(B===Yt.GuessFromOrder?()=>{if(K.current===-1){let L=F.current;F.current+=1,K.current=L}return K.current}:-1)),N=k9.useRef(null),V=k9.useCallback((L)=>{if(N.current=L,W!==-1&&L!==null){if(Y.current[W]=L,U){let A=J!==void 0;U.current[W]=A?J:H?.current?.textContent??L.textContent}}},[W,Y,U,J,H]);return F0(()=>{if(Q!=null)return;let L=N.current;if(L)return X(L,Z),()=>{z(L)};return},[Q,X,z,Z]),F0(()=>{if(Q!=null)return;return G((L)=>{let A=N.current?L.get(N.current)?.index:null;if(A!=null)q(A)})},[Q,G,q]),k9.useMemo(()=>({ref:V,index:W}),[W,V])}var cq=function($){return $.checked="data-checked",$.unchecked="data-unchecked",$.disabled="data-disabled",$.highlighted="data-highlighted",$}({});var b3={checked($){if($)return{[cq.checked]:""};return{[cq.unchecked]:""}},...c1};var TE=O(c(),1),CE=kG.forwardRef(function(J,Z){let{render:H,className:B,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:Y=!1,checked:U,defaultChecked:F,onCheckedChange:K,...W}=J,q=L4({label:X}),N=N4(!0),V=t0(Q),{store:L}=z5(),A=L.useState("isActive",q.index),M=L.useState("itemProps"),[_,P]=o4({controlled:U,default:F??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:D,itemRef:w}=k3({closeOnClick:Y,disabled:G,highlighted:A,id:V,store:L,nativeButton:z,nodeId:N?.nodeId,itemMetadata:c7}),R=kG.useMemo(()=>({disabled:G,highlighted:A,checked:_}),[G,A,_]),b=K0((x)=>{let I={...M0(Y0.itemPress,x.nativeEvent),preventUnmountOnClose:()=>{}};if(K?.(!_,I),I.isCanceled)return;P((S)=>!S)}),E=U0("div",J,{state:R,stateAttributesMapping:b3,props:[M,{role:"menuitemcheckbox","aria-checked":_,onClick:b},W,D],ref:[w,Z,q.ref]});return TE.jsx(pq.Provider,{value:R,children:E})});var bG=O(g(),1);var wE=bG.forwardRef(function(J,Z){let{render:H,className:B,keepMounted:Q=!1,...X}=J,z=_E(),G=bG.useRef(null),{transitionStatus:Y,setMounted:U}=d4(z.checked);b5({open:z.checked,ref:G,onComplete(){if(!z.checked)U(!1)}});let F={checked:z.checked,disabled:z.disabled,highlighted:z.highlighted,transitionStatus:Y};return U0("span",J,{state:F,ref:[Z,G],stateAttributesMapping:b3,props:{"aria-hidden":!0,...X},enabled:Q||z.checked})});var d7=O(g(),1);var yG=O(g(),1),dq=yG.createContext(void 0);function EE(){let $=yG.useContext(dq);if($===void 0)throw Error(E0(31));return $}var SE=O(c(),1),IE=d7.forwardRef(function(J,Z){let{render:H,className:B,...Q}=J,[X,z]=d7.useState(void 0),G=d7.useMemo(()=>({setLabelId:z}),[z]),Y=U0("div",J,{ref:Z,props:{role:"group","aria-labelledby":X,...Q}});return SE.jsx(dq.Provider,{value:G,children:Y})});var RE=O(g(),1);var kE=RE.forwardRef(function(J,Z){let{className:H,render:B,id:Q,...X}=J,z=t0(Q),{setLabelId:G}=EE();return F0(()=>{return G(z),()=>{G(void 0)}},[G,z]),U0("div",J,{ref:Z,props:{id:z,role:"presentation",...X}})});var bE=O(g(),1);var yE=bE.forwardRef(function(J,Z){let{render:H,className:B,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:Y=!0,...U}=J,F=L4({label:X}),K=N4(!0),W=t0(Q),{store:q}=z5(),N=q.useState("isActive",F.index),V=q.useState("itemProps"),{getItemProps:L,itemRef:A}=k3({closeOnClick:Y,disabled:G,highlighted:N,id:W,store:q,nativeButton:z,nodeId:K?.nodeId,itemMetadata:c7});return U0("div",J,{state:{disabled:G,highlighted:N},props:[V,U,L],ref:[A,Z,F.ref]})});var l7=O(g(),1);var hE=l7.forwardRef(function(J,Z){let{render:H,className:B,id:Q,label:X,closeOnClick:z=!1,...G}=J,Y=l7.useRef(null),U=L4({label:X}),K=N4(!0)?.nodeId,W=t0(Q),{store:q}=z5(),N=q.useState("isActive",U.index),V=q.useState("itemProps"),L=IG({closeOnClick:z,highlighted:N,id:W,nodeId:K,store:q,itemRef:Y}),A=l7.useMemo(()=>({highlighted:N}),[N]);return U0("a",J,{state:A,props:[V,G,L],ref:[Y,Z,U.ref]})});var vG=O(g(),1);var hG=O(g(),1),Ut=hG.createContext(void 0);function xG($){let J=hG.useContext(Ut);if(J===void 0&&!$)throw Error(E0(69));return J}var xE=O(c(),1),Ft={...D1,...c1},vE=vG.forwardRef(function(J,Z){let{render:H,className:B,finalFocus:Q,...X}=J,{store:z}=z5(),{side:G,align:Y}=N4(),U=xG(!0)!=null,F=z.useState("open"),K=z.useState("transitionStatus"),W=z.useState("popupProps"),q=z.useState("mounted"),N=z.useState("instantType"),V=z.useState("activeTriggerElement"),L=z.useState("parent"),A=z.useState("lastOpenChangeReason"),M=z.useState("rootId"),_=z.useState("floatingRootContext"),P=z.useState("floatingTreeRoot"),D=z.useState("closeDelay"),w=z.useState("activeTriggerElement"),R=L.type==="context-menu";b5({open:F,ref:z.context.popupRef,onComplete(){if(F)z.context.onOpenChangeComplete?.(!0)}}),vG.useEffect(()=>{function j(C){z.setOpen(!1,M0(C.reason,C.domEvent))}return P.events.on("close",j),()=>{P.events.off("close",j)}},[P.events,z]);let b=z.useState("hoverEnabled"),E=z.useState("disabled");E9(_,{enabled:b&&!E&&!R&&L.type!=="menubar",closeDelay:D});let x={transitionStatus:K,side:G,align:Y,open:F,nested:L.type==="menu",instant:N},I=U0("div",J,{state:x,ref:[Z,z.context.popupRef],stateAttributesMapping:Ft,props:[W,{onKeyDown(j){if(U&&X3.has(j.key))j.stopPropagation()}},F2(K),X,{"data-rootownerid":M}]}),S=L.type===void 0||R;if(V||L.type==="menubar"&&A!==Y0.outsidePress)S=!0;return xE.jsx(O$,{context:_,modal:R,disabled:!q,returnFocus:Q===void 0?S:Q,initialFocus:L.type!=="menu",restoreFocus:!0,externalTree:L.type!=="menubar"?P:void 0,previousFocusableElement:w,nextFocusableElement:L.type===void 0?z.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:L.type===void 0?z.context.beforeContentFocusGuardRef:void 0,children:I})});var fE=O(g(),1);var gG=O(g(),1),lq=gG.createContext(void 0);function gE(){let $=gG.useContext(lq);if($===void 0)throw Error(E0(32));return $}var iq=O(c(),1),mE=fE.forwardRef(function(J,Z){let{keepMounted:H=!1,...B}=J,{store:Q}=z5();if(!(Q.useState("mounted")||H))return null;return iq.jsx(lq.Provider,{value:H,children:iq.jsx(_$,{ref:Z,...B})})});var Y9=O(g(),1);var y3=O(g(),1);var pE=O(c(),1);function fG($){let{children:J,elementsRef:Z,labelsRef:H,onMapChange:B}=$,Q=K0(B),X=y3.useRef(0),z=R1(Wt).current,G=R1(Kt).current,[Y,U]=y3.useState(0),F=y3.useRef(Y),K=K0((L,A)=>{G.set(L,A??null),F.current+=1,U(F.current)}),W=K0((L)=>{G.delete(L),F.current+=1,U(F.current)}),q=y3.useMemo(()=>{Nt(Y);let L=new Map;return Array.from(G.keys()).filter((M)=>M.isConnected).sort(qt).forEach((M,_)=>{let P=G.get(M)??{};L.set(M,{...P,index:_})}),L},[G,Y]);F0(()=>{if(typeof MutationObserver!=="function"||q.size===0)return;let L=new MutationObserver((A)=>{let M=new Set,_=(P)=>M.has(P)?M.delete(P):M.add(P);if(A.forEach((P)=>{P.removedNodes.forEach(_),P.addedNodes.forEach(_)}),M.size===0)F.current+=1,U(F.current)});return q.forEach((A,M)=>{if(M.parentElement)L.observe(M.parentElement,{childList:!0})}),()=>{L.disconnect()}},[q]),F0(()=>{if(F.current===Y){if(Z.current.length!==q.size)Z.current.length=q.size;if(H&&H.current.length!==q.size)H.current.length=q.size;X.current=q.size}Q(q)},[Q,q,Z,H,Y]),F0(()=>{return()=>{Z.current=[]}},[Z]),F0(()=>{return()=>{if(H)H.current=[]}},[H]);let N=K0((L)=>{return z.add(L),()=>{z.delete(L)}});F0(()=>{z.forEach((L)=>L(q))},[z,q]);let V=y3.useMemo(()=>({register:K,unregister:W,subscribeMapChange:N,elementsRef:Z,labelsRef:H,nextIndexRef:X}),[K,W,N,Z,H,X]);return pE.jsx(uq.Provider,{value:V,children:J})}function Kt(){return new Map}function Wt(){return new Set}function qt($,J){let Z=$.compareDocumentPosition(J);if(Z&Node.DOCUMENT_POSITION_FOLLOWING||Z&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(Z&Node.DOCUMENT_POSITION_PRECEDING||Z&Node.DOCUMENT_POSITION_CONTAINS)return 1;return 0}function Nt($){}var i7=O(c(),1),cE=Y9.forwardRef(function(J,Z){let{anchor:H,positionMethod:B="absolute",className:Q,render:X,side:z,align:G,sideOffset:Y=0,alignOffset:U=0,collisionBoundary:F="clipping-ancestors",collisionPadding:K=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:V=uE,...L}=J,{store:A}=z5(),M=gE(),_=G9(!0),P=A.useState("parent"),D=A.useState("floatingRootContext"),w=A.useState("floatingTreeRoot"),R=A.useState("mounted"),b=A.useState("open"),E=A.useState("modal"),x=A.useState("activeTriggerElement"),I=A.useState("transitionStatus"),S=A.useState("lastOpenChangeReason"),j=A.useState("floatingNodeId"),C=A.useState("floatingParentNodeId"),k=H,y=Y,v=U,u=G,T=V;if(P.type==="context-menu"){if(k=H??P.context?.anchor,u=u??"start",!z&&u!=="center")v=J.alignOffset??2,y=J.sideOffset??-5}let t=z,B0=u;if(P.type==="menu")t=t??"inline-end",B0=B0??"start",T=J.collisionAvoidance??o8;else if(P.type==="menubar")t=t??"bottom",B0=B0??"start";let h=P.type==="context-menu",e=a8({anchor:k,floatingRootContext:D,positionMethod:_?"fixed":B,mounted:R,side:t,sideOffset:y,align:B0,alignOffset:v,arrowPadding:h?0:W,collisionBoundary:F,collisionPadding:K,sticky:q,nodeId:j,keepMounted:M,disableAnchorTracking:N,collisionAvoidance:T,shiftCrossAxis:h&&!(("side"in T)&&T.side==="flip"),externalTree:w}),A0=Y9.useMemo(()=>{let L0={};if(!b)L0.pointerEvents="none";return{role:"presentation",hidden:!R,style:{...e.positionerStyles,...L0}}},[b,R,e.positionerStyles]);Y9.useEffect(()=>{function L0(i){if(i.open){if(i.parentNodeId===j)A.set("hoverEnabled",!1);if(i.nodeId!==j&&i.parentNodeId===A.select("floatingParentNodeId"))A.setOpen(!1,M0(Y0.siblingOpen))}}return w.events.on("menuopenchange",L0),()=>{w.events.off("menuopenchange",L0)}},[A,w.events,j]),Y9.useEffect(()=>{if(A.select("floatingParentNodeId")==null)return;function L0(i){if(i.open||i.nodeId!==A.select("floatingParentNodeId"))return;let $0=i.reason??Y0.siblingOpen;A.setOpen(!1,M0($0))}return w.events.on("menuopenchange",L0),()=>{w.events.off("menuopenchange",L0)}},[w.events,A]),Y9.useEffect(()=>{function L0(i){if(!b||i.nodeId!==A.select("floatingParentNodeId"))return;if(i.target&&x&&x!==i.target)A.setOpen(!1,M0(Y0.siblingOpen))}return w.events.on("itemhover",L0),()=>{w.events.off("itemhover",L0)}},[w.events,b,x,A]),Y9.useEffect(()=>{let L0={open:b,nodeId:j,parentNodeId:C,reason:A.select("lastOpenChangeReason")};w.events.emit("menuopenchange",L0)},[w.events,b,A,j,C]);let l={open:b,side:e.side,align:e.align,anchorHidden:e.anchorHidden,nested:P.type==="menu"},z0=Y9.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]),W0=U0("div",J,{state:l,stateAttributesMapping:D1,ref:[Z,A.useStateSetter("positionerElement")],props:[A0,F2(I),L]}),Q0=R&&P.type!=="menu"&&(P.type!=="menubar"&&E&&S!==Y0.triggerHover||P.type==="menubar"&&P.context.modal),G0=null;if(P.type==="menubar")G0=P.context.contentElement;else if(P.type===void 0)G0=x;return i7.jsxs(fq.Provider,{value:z0,children:[Q0&&i7.jsx(X7,{ref:P.type==="context-menu"||P.type==="nested-context-menu"?P.context.internalBackdropRef:null,inert:v8(!b),cutout:G0}),i7.jsx(VZ,{id:j,children:i7.jsx(fG,{elementsRef:A.context.itemDomElements,labelsRef:A.context.itemLabels,children:W0})})]})});var r7=O(g(),1);var mG=O(g(),1),rq=mG.createContext(void 0);function dE(){let $=mG.useContext(rq);if($===void 0)throw Error(E0(34));return $}var lE=O(c(),1),iE=r7.memo(r7.forwardRef(function(J,Z){let{render:H,className:B,value:Q,defaultValue:X,onValueChange:z,disabled:G=!1,...Y}=J,[U,F]=o4({controlled:Q,default:X,name:"MenuRadioGroup"}),K=K0(z),W=K0((L,A)=>{if(K?.(L,A),A.isCanceled)return;F(L)}),N=U0("div",J,{state:{disabled:G},ref:Z,props:{role:"group","aria-disabled":G||void 0,...Y}}),V=r7.useMemo(()=>({value:U,setValue:W,disabled:G}),[U,W,G]);return lE.jsx(rq.Provider,{value:V,children:N})}));var uG=O(g(),1);var pG=O(g(),1),aq=pG.createContext(void 0);function rE(){let $=pG.useContext(aq);if($===void 0)throw Error(E0(35));return $}var aE=O(c(),1),nE=uG.forwardRef(function(J,Z){let{render:H,className:B,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:Y=!1,value:U,...F}=J,K=L4({label:X}),W=N4(!0),q=t0(Q),{store:N}=z5(),V=N.useState("isActive",K.index),L=N.useState("itemProps"),{value:A,setValue:M,disabled:_}=dE(),P=_||G,D=A===U,{getItemProps:w,itemRef:R}=k3({closeOnClick:Y,disabled:P,highlighted:V,id:q,store:N,nativeButton:z,nodeId:W?.nodeId,itemMetadata:c7}),b=uG.useMemo(()=>({disabled:P,highlighted:V,checked:D}),[P,V,D]),E=K0((I)=>{let S={...M0(Y0.itemPress,I.nativeEvent),preventUnmountOnClose:()=>{}};M(U,S)}),x=U0("div",J,{state:b,stateAttributesMapping:b3,props:[L,{role:"menuitemradio","aria-checked":D,onClick:E},F,w],ref:[R,Z,K.ref]});return aE.jsx(aq.Provider,{value:b,children:x})});var cG=O(g(),1);var oE=cG.forwardRef(function(J,Z){let{render:H,className:B,keepMounted:Q=!1,...X}=J,z=rE(),G=cG.useRef(null),{transitionStatus:Y,setMounted:U}=d4(z.checked);b5({open:z.checked,ref:G,onComplete(){if(!z.checked)U(!1)}});let F={checked:z.checked,disabled:z.disabled,highlighted:z.highlighted,transitionStatus:Y};return U0("span",J,{state:F,stateAttributesMapping:b3,ref:[Z,G],props:{"aria-hidden":!0,...X},enabled:Q||z.checked})});var S5=O(g(),1);var dG=O(g(),1),Lt=dG.createContext(null);function lG($){let J=dG.useContext(Lt);if(J===null&&!$)throw Error(E0(5));return J}var IH=O(g(),1);var Vt={...i8,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(($,J)=>$.activeIndex===J),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 a7 extends i2{constructor($){super({...At(),...$},{positionerRef:IH.createRef(),popupRef:IH.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:IH.createRef(),beforeContentFocusGuardRef:IH.createRef(),onOpenChangeComplete:void 0,triggerElements:new a2},Vt);this.unsubscribeParentListener=this.observe("parent",(J)=>{if(this.unsubscribeParentListener?.(),J.type==="menu"){this.unsubscribeParentListener=J.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=J.store.context.allowMouseUpTriggerRef;return}if(J.type!==void 0)this.context.allowMouseUpTriggerRef=J.context.allowMouseUpTriggerRef;this.unsubscribeParentListener=null})}setOpen($,J){this.state.floatingRootContext.context.events.emit("setOpen",{open:$,eventDetails:J})}static useStore($,J){let Z=R1(()=>{return new a7(J)}).current;return $??Z}unsubscribeParentListener=null}function At(){return{...l8(),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 A$,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:k1,keyboardEventRelay:void 0,closeDelay:0}}var iG=O(g(),1),nq=iG.createContext(void 0);function rG(){return iG.useContext(nq)}var oq=O(c(),1),aG=FZ(function(J){let{children:Z,open:H,onOpenChange:B,onOpenChangeComplete:Q,defaultOpen:X=!1,disabled:z=!1,modal:G,loopFocus:Y=!0,orientation:U="vertical",actionsRef:F,closeParentOnEsc:K=!1,handle:W,triggerId:q,defaultTriggerId:N=null,highlightItemOnHover:V=!0}=J,L=G9(!0),A=z5(!0),M=lG(!0),_=rG(),P=S5.useMemo(()=>{if(_&&A)return{type:"menu",store:A.store};if(M)return{type:"menubar",context:M};if(L&&!A)return{type:"context-menu",context:L};return{type:void 0}},[L,A,M,_]),D=a7.useStore(W?.store,{open:X,openProp:H,activeTriggerId:N,triggerIdProp:q,parent:P});s8(()=>{if(H===void 0&&D.state.open===!1&&X===!0)D.update({open:!0,activeTriggerId:N})}),D.useControlledProp("openProp",H),D.useControlledProp("triggerIdProp",q),D.useContextCallback("onOpenChangeComplete",Q);let w=D.useState("floatingTreeRoot"),R=D$(w),b=t5();F0(()=>{if(L&&!A)D.update({parent:{type:"context-menu",context:L},floatingNodeId:R,floatingParentNodeId:b});else if(A)D.update({floatingNodeId:R,floatingParentNodeId:b})},[L,A,R,b,D]);let E=D.useState("open"),x=D.useState("activeTriggerElement"),I=D.useState("positionerElement"),S=D.useState("hoverEnabled"),j=D.useState("modal"),C=D.useState("disabled"),k=D.useState("lastOpenChangeReason"),y=D.useState("parent"),v=D.useState("activeIndex"),u=D.useState("payload"),T=D.useState("floatingParentNodeId"),t=S5.useRef(null),B0=T!=null,h;D.useSyncedValues({disabled:z,modal:y.type===void 0?G:void 0,rootId:U2()});let{openMethod:e,triggerProps:A0,reset:l}=Y7(E);c8(D);let{forceUnmount:z0}=d8(E,D,()=>{D.update({allowMouseEnter:!1,stickIfOpen:!0}),l()}),W0=S5.useRef(y.type!=="context-menu"),Q0=M5();S5.useEffect(()=>{if(!E)t.current=null;if(y.type!=="context-menu")return;if(!E){Q0.clear(),W0.current=!1;return}Q0.start(500,()=>{W0.current=!0})},[Q0,E,y.type]),z7(E&&j&&k!==Y0.triggerHover&&e!=="touch",I),F0(()=>{if(!E&&!S)D.set("hoverEnabled",!0)},[E,S,D]);let G0=S5.useRef(!0),L0=M5(),i=K0((c0,y0)=>{let d0=y0.reason;if(E===c0&&y0.trigger===x&&k===d0)return;if(y0.preventUnmountOnClose=()=>{D.set("preventUnmountingOnClose",!0)},!c0&&y0.trigger==null)y0.trigger=x??void 0;if(B?.(c0,y0),y0.isCanceled)return;let Z0={open:c0,nativeEvent:y0.event,reason:y0.reason,nested:B0};h?.emit("openchange",Z0);let T0=y0.event;if(c0===!1&&T0?.type==="click"&&T0.pointerType==="touch"&&!G0.current)return;if(!c0&&v!==null){let k0=D.context.itemDomElements.current[v];queueMicrotask(()=>{k0?.setAttribute("tabindex","-1")})}if(c0&&d0===Y0.triggerFocus)G0.current=!1,L0.start(300,()=>{G0.current=!0});else G0.current=!0,L0.clear();let H1=(d0===Y0.triggerPress||d0===Y0.itemPress)&&T0.detail===0&&T0?.isTrusted,G1=!c0&&(d0===Y0.escapeKey||d0==null),a1={open:c0,openChangeReason:d0};t.current=y0.event??null;let I0=y0.trigger?.id??null;if(I0||c0)a1.activeTriggerId=I0,a1.activeTriggerElement=y0.trigger??null;if(D.update(a1),y.type==="menubar"&&(d0===Y0.triggerFocus||d0===Y0.focusOut||d0===Y0.triggerHover||d0===Y0.listNavigation||d0===Y0.siblingOpen))D.set("instantType","group");else if(H1||G1)D.set("instantType",H1?"click":"dismiss");else D.set("instantType",void 0)}),$0=S5.useCallback((c0)=>{let y0=M0(c0);return y0.preventUnmountOnClose=()=>{D.set("preventUnmountingOnClose",!0)},y0},[D]),J0=S5.useCallback(()=>{D.setOpen(!1,$0(Y0.imperativeAction))},[D,$0]);S5.useImperativeHandle(F,()=>({unmount:z0,close:J0}),[z0,J0]);let H0;if(y.type==="context-menu")H0=y.context;S5.useImperativeHandle(H0?.positionerRef,()=>I,[I]),S5.useImperativeHandle(H0?.actionsRef,()=>({setOpen:i}),[i]);let n=q8({popupStore:D,onOpenChange:i});h=n.context.events,S5.useEffect(()=>{let c0=({open:y0,eventDetails:d0})=>i(y0,d0);return h.on("setOpen",c0),()=>{h?.off("setOpen",c0)}},[h,i]);let p=W8(n,{enabled:!C,bubbles:{escapeKey:K&&y.type==="menu"},outsidePress(){if(y.type!=="context-menu"||t.current?.type==="contextmenu")return!0;return W0.current},externalTree:B0?w:void 0}),d=E$(n,{role:"menu"}),m=l4(),a=S5.useCallback((c0)=>{if(D.select("activeIndex")===c0)return;D.set("activeIndex",c0)},[D]),o=kK(n,{enabled:!C,listRef:D.context.itemDomElements,activeIndex:v,nested:y.type!==void 0,loopFocus:Y,orientation:U,parentOrientation:y.type==="menubar"?y.context.orientation:void 0,rtl:m==="rtl",disabledIndices:RH,onNavigate:a,openOnArrowKeyDown:y.type!=="context-menu",externalTree:B0?w:void 0,focusItemOnHover:V}),N0=S5.useCallback((c0)=>{D.context.typingRef.current=c0},[D]),O0=bK(n,{listRef:D.context.itemLabels,activeIndex:v,resetMs:sE,onMatch:(c0)=>{if(E&&c0!==v)D.set("activeIndex",c0)},onTypingChange:N0}),{getReferenceProps:g0,getFloatingProps:p0,getItemProps:f,getTriggerProps:r}=$2([p,d,o,O0]),X0=S5.useMemo(()=>{let c0=U4(g0(),{onMouseMove(){D.set("allowMouseEnter",!0)}},A0);return delete c0.role,c0},[g0,D,A0]),V0=S5.useMemo(()=>{let c0=r();if(!c0)return c0;let y0=U4(c0,A0);return delete y0.role,delete y0["aria-controls"],y0},[r,A0]),j0=S5.useMemo(()=>p0({onMouseMove(){if(D.set("allowMouseEnter",!0),y.type==="menu")D.set("hoverEnabled",!1)},onClick(){if(D.select("hoverEnabled"))D.set("hoverEnabled",!1)},onKeyDown(c0){let y0=D.select("keyboardEventRelay");if(y0&&!c0.isPropagationStopped())y0(c0)}}),[p0,y.type,D]),v0=S5.useMemo(()=>f(),[f]);D.useSyncedValues({floatingRootContext:n,activeTriggerProps:X0,inactiveTriggerProps:V0,popupProps:j0,itemProps:v0});let Q1=S5.useMemo(()=>({store:D,parent:P}),[D,P]),U1=oq.jsx(mq.Provider,{value:Q1,children:typeof Z==="function"?Z({payload:u}):Z});if(y.type===void 0||y.type==="context-menu")return oq.jsx(AZ,{externalTree:w,children:U1});return U1});var tE=O(g(),1);var sq=O(c(),1);function eE($){let J=z5().store,Z=tE.useMemo(()=>({parentMenu:J}),[J]);return sq.jsx(nq.Provider,{value:Z,children:sq.jsx(aG,{...$})})}var x2=O(g(),1),eq=O(G4(),1);function $S($){let J=$.getBoundingClientRect(),Z=window.getComputedStyle($,"::before"),H=window.getComputedStyle($,"::after");if(!(Z.content!=="none"||H.content!=="none"))return J;let Q=parseFloat(Z.width)||0,X=parseFloat(Z.height)||0,z=parseFloat(H.width)||0,G=parseFloat(H.height)||0,Y=Math.max(J.width,Q,z),U=Math.max(J.height,X,G),F=Y-J.width,K=U-J.height;return{left:J.left-F/2,right:J.right+F/2,top:J.top-K/2,bottom:J.bottom+K/2}}var oG=O(g(),1);function JS($={}){let{highlightItemOnHover:J,highlightedIndex:Z,onHighlightedIndexChange:H}=nG(),{ref:B,index:Q}=L4($),X=Z===Q,z=oG.useRef(null),G=j4(B,z);return{compositeProps:oG.useMemo(()=>({tabIndex:X?0:-1,onFocus(){H(Q)},onMouseMove(){let U=z.current;if(!J||!U)return;let F=U.hasAttribute("disabled")||U.ariaDisabled==="true";if(!X&&!F)U.focus()}}),[X,H,Q,J]),compositeRef:G,index:Q}}function ZS($){let{render:J,className:Z,state:H=k1,props:B=RH,refs:Q=RH,metadata:X,stateAttributesMapping:z,tag:G="div",...Y}=$,{compositeProps:U,compositeRef:F}=JS({metadata:X});return U0(G,$,{state:H,ref:[...Q,F],props:[U,...B,Y],stateAttributesMapping:z})}function tq($){if(P5($)&&$.hasAttribute("data-rootownerid"))return $.getAttribute("data-rootownerid")??void 0;if(n6($))return;return tq(oQ($))}var sG=O(g(),1);function HS($){let{enabled:J=!0,mouseDownAction:Z,open:H}=$,B=sG.useRef(!1);return sG.useMemo(()=>{if(!J)return k1;return{onMouseDown:(Q)=>{if(Z==="open"&&!H||Z==="close"&&H)B.current=!0,m0(Q.currentTarget).addEventListener("click",()=>{B.current=!1},{once:!0})},onClick:(Q)=>{if(B.current)B.current=!1,Q.preventBaseUIHandler()}}},[J,Z,H])}var h3=O(c(),1),tG=2,BS=KQ(function(J,Z){let{render:H,className:B,disabled:Q=!1,nativeButton:X=!0,id:z,openOnHover:G,delay:Y=100,closeDelay:U=0,handle:F,payload:K,...W}=J,q=z5(!0),N=F?.store??q?.store;if(!N)throw Error(E0(85));let V=t0(z),L=N.useState("isTriggerActive",V),A=N.useState("floatingRootContext"),M=N.useState("isOpenedByTrigger",V),_=x2.useRef(null),P=Mt(),D=nG(!0),w=R2(),R=x2.useMemo(()=>{return w??new A$},[w]),b=D$(R),E=t5(),{registerTrigger:x,isMountedByThisTrigger:I}=u8(V,_,N,{payload:K,closeDelay:U,parent:P,floatingTreeRoot:R,floatingNodeId:b,floatingParentNodeId:E,keyboardEventRelay:D?.relayKeyboardEvent}),S=P.type==="menubar",j=N.useState("disabled"),C=Q||j||S&&P.context.disabled,{getButtonProps:k,buttonRef:y}=p5({disabled:C,native:X});x2.useEffect(()=>{if(!M&&P.type===void 0)N.context.allowMouseUpTriggerRef.current=!1},[N,M,P.type]);let v=x2.useRef(null),u=M5(),T=K0((p)=>{if(!v.current)return;u.clear(),N.context.allowMouseUpTriggerRef.current=!1;let d=p.target;if(f0(v.current,d)||f0(N.select("positionerElement"),d)||d===v.current)return;if(d!=null&&tq(d)===N.select("rootId"))return;let m=$S(v.current);if(p.clientX>=m.left-tG&&p.clientX<=m.right+tG&&p.clientY>=m.top-tG&&p.clientY<=m.bottom+tG)return;R.events.emit("close",{domEvent:p,reason:Y0.cancelOpen})});x2.useEffect(()=>{if(M&&N.select("lastOpenChangeReason")===Y0.triggerHover)m0(v.current).addEventListener("mouseup",T,{once:!0})},[M,T,N]);let t=S&&P.context.hasSubmenuOpen,h=N8(A,{enabled:(G??t)&&!C&&P.type!=="context-menu"&&(!S||t&&!I),handleClose:L8({blockPointerEvents:!S}),mouseOnly:!0,move:!1,restMs:P.type===void 0?Y:void 0,delay:{close:U},triggerElementRef:_,externalTree:R,isActiveTrigger:L}),e=Dt(M,N.select("lastOpenChangeReason")),A0=w9(A,{enabled:!C&&P.type!=="context-menu",event:M&&S?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:P.type===void 0?e:!1}),l=T$(A,{enabled:!C&&t}),z0=HS({open:M,enabled:S,mouseDownAction:"open"}),W0=$2([A0,l]),Q0={disabled:C,open:M},G0=N.useState("triggerProps",I),L0=[v,Z,y,x,_],i=[W0.getReferenceProps(),h??k1,G0,{"aria-haspopup":"menu",id:V,onMouseDown:(p)=>{if(N.select("open"))return;u.start(200,()=>{N.context.allowMouseUpTriggerRef.current=!0}),m0(p.currentTarget).addEventListener("mouseup",T,{once:!0})}},S?{role:"menuitem"}:{},z0,W,k],$0=x2.useRef(null),J0=K0((p)=>{eq.flushSync(()=>{N.setOpen(!1,M0(Y0.focusOut,p.nativeEvent,p.currentTarget))}),xQ($0.current)?.focus()}),H0=K0((p)=>{let d=N.select("positionerElement");if(d&&Y8(p,d))N.context.beforeContentFocusGuardRef.current?.focus();else{eq.flushSync(()=>{N.setOpen(!1,M0(Y0.focusOut,p.nativeEvent,p.currentTarget))});let m=hQ(N.context.triggerFocusTargetRef.current||_.current);while(m!==null&&f0(d,m)){let a=m;if(m=s9(m),m===a)break}m?.focus()}}),n=U0("button",J,{enabled:!S,stateAttributesMapping:SZ,state:Q0,ref:L0,props:i});if(S)return h3.jsx(ZS,{tag:"button",render:H,className:B,state:Q0,refs:L0,props:i,stateAttributesMapping:SZ});if(M)return h3.jsxs(x2.Fragment,{children:[h3.jsx(S2,{ref:$0,onFocus:J0},`${V}-pre-focus-guard`),h3.jsx(x2.Fragment,{children:n},V),h3.jsx(S2,{ref:N.context.triggerFocusTargetRef,onFocus:H0},`${V}-post-focus-guard`)]});return h3.jsx(x2.Fragment,{children:n},V)});function Dt($,J){let Z=M5(),[H,B]=x2.useState(!1);return F0(()=>{if($&&J==="trigger-hover")B(!0),Z.start(eG,()=>{B(!1)});else if(!$)Z.clear(),B(!1)},[$,J,Z]),H}function Mt(){let $=G9(!0),J=z5(!0),Z=lG(!0);return x2.useMemo(()=>{if(Z)return{type:"menubar",context:Z};if($&&!J)return{type:"context-menu",context:$};return{type:void 0}},[$,J,Z])}var QS=O(g(),1);var XS=QS.forwardRef(function(J,Z){let{className:H,render:B,orientation:Q="horizontal",...X}=J;return U0("div",J,{state:{orientation:Q},ref:Z,props:[{role:"separator","aria-orientation":Q},X]})});var b9=O(g(),1);var zS=b9.forwardRef(function(J,Z){let{render:H,className:B,label:Q,id:X,nativeButton:z=!1,openOnHover:G=!0,delay:Y=100,closeDelay:U=0,disabled:F=!1,...K}=J,W=L4(),q=N4(),{store:N}=z5(),V=t0(X),L=N.useState("open"),A=N.useState("floatingRootContext"),M=N.useState("floatingTreeRoot"),_=CK(V,N),P=b9.useCallback((A0)=>{let l=_(A0);if(A0!==null&&N.select("open")&&N.select("activeTriggerId")==null)N.update({activeTriggerId:V,activeTriggerElement:A0,closeDelay:U});return l},[_,U,N,V]),D=b9.useRef(null),w=b9.useCallback((A0)=>{D.current=A0,N.set("activeTriggerElement",A0)},[N]),R=rG();if(!R?.parentMenu)throw Error(E0(37));N.useSyncedValue("closeDelay",U);let b=R.parentMenu,E=b.useState("itemProps"),x=b.useState("isActive",W.index),I=b9.useMemo(()=>({type:"submenu-trigger",setActive(){b.set("activeIndex",W.index)}}),[b,W.index]),S=N.useState("disabled"),j=F||S,{getItemProps:C,itemRef:k}=k3({closeOnClick:!1,disabled:j,highlighted:x,id:V,store:N,nativeButton:z,itemMetadata:I,nodeId:q?.nodeId}),y=N.useState("hoverEnabled"),v=b.useState("allowMouseEnter"),u=N8(A,{enabled:y&&G&&!j,handleClose:L8({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:Y,delay:v?{open:Y,close:U}:0,triggerElementRef:D,externalTree:M}),T=w9(A,{enabled:!j,event:"mousedown",toggle:!G,ignoreMouse:G,stickIfOpen:!1}),t=$2([T]),B0=N.useState("triggerProps",!0);return delete B0.id,U0("div",J,{state:{disabled:j,highlighted:x,open:L},stateAttributesMapping:n8,props:[t.getReferenceProps(),u,B0,E,{tabIndex:L||x?0:-1,onBlur(){if(x)b.set("activeIndex",null)}},K,C],ref:[Z,W.ref,k,P,w]})});class $Y{constructor(){this.store=new a7}open($){let J=$?this.store.context.triggerElements.getById($):void 0;if($&&!J)throw Error(E0(83,$));this.store.setOpen(!0,M0("imperative-action",void 0,J))}close(){this.store.setOpen(!1,M0("imperative-action",void 0,void 0))}get isOpen(){return this.store.state.open}}function GS(){return new $Y}var v2=O(c(),1);function n7({...$}){return v2.jsx(e2.Root,{"data-slot":"dropdown-menu",...$})}function o7({...$}){return v2.jsx(e2.Trigger,{"data-slot":"dropdown-menu-trigger",...$})}function s7({align:$="start",alignOffset:J=0,side:Z="bottom",sideOffset:H=4,className:B,...Q}){return v2.jsx(e2.Portal,{children:v2.jsx(e2.Positioner,{className:"isolate z-50 outline-none",align:$,alignOffset:J,side:Z,sideOffset:H,children:v2.jsx(e2.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",B),...Q})})})}function t7({...$}){return v2.jsx(e2.Group,{"data-slot":"dropdown-menu-group",...$})}function JY({className:$,inset:J,...Z}){return v2.jsx(e2.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":J,className:s("px-2 pt-1.5 pb-0.5 text-xs text-muted-foreground data-inset:pl-7",$),...Z})}function kH({className:$,inset:J,variant:Z="default",...H}){return v2.jsx(e2.Item,{"data-slot":"dropdown-menu-item","data-inset":J,"data-variant":Z,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",$),...H})}function YS({...$}){return v2.jsx(e2.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...$})}function US({className:$,children:J,inset:Z,...H}){return v2.jsxs(e2.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":Z,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",$),...H,children:[v2.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:v2.jsx(e2.RadioItemIndicator,{children:v2.jsx(F3,{stroke:1.75})})}),J]})}function FS({className:$,...J}){return v2.jsx(e2.Separator,{"data-slot":"dropdown-menu-separator",className:s("mx-2 my-1 h-px bg-border",$),...J})}var x3={};_4(x3,{createHandle:()=>xS,Viewport:()=>hS,Trigger:()=>LS,Title:()=>ES,Root:()=>qS,Positioner:()=>MS,Portal:()=>DS,Popup:()=>_S,Handle:()=>XY,Description:()=>IS,Close:()=>kS,Backdrop:()=>CS,Arrow:()=>jS});var H8=O(g(),1);var ZY=O(g(),1),$N=ZY.createContext(void 0);function x5($){let J=ZY.useContext($N);if(J===void 0&&!$)throw Error(E0(47));return J}var e7=O(g(),1),KS=O(G4(),1);function Pt(){return{...l8(),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 _t={...i8,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 $J extends i2{constructor($){let J={...Pt(),...$};if(J.open&&$?.mounted===void 0)J.mounted=!0;super(J,{popupRef:e7.createRef(),backdropRef:e7.createRef(),internalBackdropRef:e7.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:e7.createRef(),beforeContentFocusGuardRef:e7.createRef(),stickIfOpenTimeout:new i5,triggerElements:new a2},_t)}setOpen=($,J)=>{let Z=J.reason===Y0.triggerHover,H=J.reason===Y0.triggerPress&&J.event.detail===0,B=!$&&(J.reason===Y0.escapeKey||J.reason==null);if(J.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,J),J.isCanceled)return;let Q={open:$,nativeEvent:J.event,reason:J.reason,nested:this.state.nested,triggerElement:J.trigger};this.state.floatingRootContext.context.events?.emit("openchange",Q);let z=()=>{let G={open:$,openChangeReason:J.reason},Y=J.trigger?.id??null;if(Y||$)G.activeTriggerId=Y,G.activeTriggerElement=J.trigger??null;this.update(G)};if(Z)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(eG,()=>{this.set("stickIfOpen",!1)}),KS.flushSync(z);else z();if(H||B)this.set("instantType",H?"click":"dismiss");else if(J.reason===Y0.focusOut)this.set("instantType","focus");else this.set("instantType",void 0)};static useStore($,J){let Z=R1(()=>{return new $J(J)}).current,H=$??Z;return w2(Z.disposeEffect),H}disposeEffect=()=>{return this.context.stickIfOpenTimeout.disposeEffect()}}var bH=O(c(),1);function WS({props:$}){let{children:J,open:Z,defaultOpen:H=!1,onOpenChange:B,onOpenChangeComplete:Q,modal:X=!1,handle:z,triggerId:G,defaultTriggerId:Y=null}=$,U=$J.useStore(z?.store,{modal:X,open:H,openProp:Z,activeTriggerId:Y,triggerIdProp:G});s8(()=>{if(Z===void 0&&U.state.open===!1&&H===!0)U.update({open:!0,activeTriggerId:Y})}),U.useControlledProp("openProp",Z),U.useControlledProp("triggerIdProp",G);let F=U.useState("open"),K=U.useState("positionerElement"),W=U.useState("payload"),q=U.useState("openChangeReason");U.useContextCallback("onOpenChange",B),U.useContextCallback("onOpenChangeComplete",Q);let{openMethod:N,triggerProps:V,reset:L}=Y7(F);c8(U);let{forceUnmount:A}=d8(F,U,()=>{U.update({stickIfOpen:!0,openChangeReason:null}),L()});z7(F&&X===!0&&q!==Y0.triggerHover&&N!=="touch",K),H8.useEffect(()=>{if(!F)U.context.stickIfOpenTimeout.clear()},[U,F]);let M=H8.useCallback((C)=>{let k=M0(C);return k.preventUnmountOnClose=()=>{U.set("preventUnmountingOnClose",!0)},k},[U]),_=H8.useCallback(()=>{U.setOpen(!1,M(Y0.imperativeAction))},[U,M]);H8.useImperativeHandle($.actionsRef,()=>({unmount:A,close:_}),[A,_]);let P=q8({popupStore:U,onOpenChange:U.setOpen}),D=W8(P,{outsidePressEvent:{mouse:X==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),w=E$(P),{getReferenceProps:R,getFloatingProps:b,getTriggerProps:E}=$2([D,w]),x=H8.useMemo(()=>{return R(V)},[R,V]),I=H8.useMemo(()=>{return E(V)},[E,V]),S=H8.useMemo(()=>{return b()},[b]);U.useSyncedValues({modal:X,openMethod:N,activeTriggerProps:x,inactiveTriggerProps:I,popupProps:S,floatingRootContext:P,nested:t5()!=null});let j=H8.useMemo(()=>({store:U}),[U]);return bH.jsx($N.Provider,{value:j,children:typeof J==="function"?J({payload:W}):J})}function qS($){if(x5(!0))return bH.jsx(WS,{props:$});return bH.jsx(AZ,{children:bH.jsx(WS,{props:$})})}var _8=O(g(),1),JN=O(G4(),1);var NS=300;var Z6=O(c(),1),LS=_8.forwardRef(function(J,Z){let{render:H,className:B,disabled:Q=!1,nativeButton:X=!0,handle:z,payload:G,openOnHover:Y=!1,delay:U=NS,closeDelay:F=0,id:K,...W}=J,q=x5(!0),N=z?.store??q?.store;if(!N)throw Error(E0(74));let V=t0(K),L=N.useState("isTriggerActive",V),A=N.useState("floatingRootContext"),M=N.useState("isOpenedByTrigger",V),_=_8.useRef(null),{registerTrigger:P,isMountedByThisTrigger:D}=u8(V,_,N,{payload:G,disabled:Q,openOnHover:Y,closeDelay:F}),w=N.useState("openChangeReason"),R=N.useState("stickIfOpen"),b=N.useState("openMethod"),E=N8(A,{enabled:A!=null&&Y&&(b!=="touch"||w!==Y0.triggerPress),mouseOnly:!0,move:!1,handleClose:L8(),restMs:U,delay:{close:F},triggerElementRef:_,isActiveTrigger:L}),x=w9(A,{enabled:A!=null,stickIfOpen:R}),I=$2([x]),S=N.useState("triggerProps",D),j={disabled:Q,open:M},{getButtonProps:C,buttonRef:k}=p5({disabled:Q,native:X}),y=_8.useMemo(()=>({open(B0){if(B0&&w===Y0.triggerPress)return SZ.open(B0);return n8.open(B0)}}),[w]),v=U0("button",J,{state:j,ref:[k,Z,P,_],props:[I.getReferenceProps(),E,S,{[a6]:"",id:V},W,C],stateAttributesMapping:y}),u=_8.useRef(null),T=K0((B0)=>{JN.flushSync(()=>{N.setOpen(!1,M0(Y0.focusOut,B0.nativeEvent,B0.currentTarget))}),xQ(u.current)?.focus()}),t=K0((B0)=>{let h=N.select("positionerElement");if(h&&Y8(B0,h))N.context.beforeContentFocusGuardRef.current?.focus();else{JN.flushSync(()=>{N.setOpen(!1,M0(Y0.focusOut,B0.nativeEvent,B0.currentTarget))});let e=hQ(N.context.triggerFocusTargetRef.current||_.current);while(e!==null&&f0(h,e)){let A0=e;if(e=s9(e),e===A0)break}e?.focus()}});if(L)return Z6.jsxs(_8.Fragment,{children:[Z6.jsx(S2,{ref:u,onFocus:T}),Z6.jsx(_8.Fragment,{children:v},V),Z6.jsx(S2,{ref:N.context.triggerFocusTargetRef,onFocus:t})]});return Z6.jsx(_8.Fragment,{children:v},V)});var AS=O(g(),1);var HY=O(g(),1),ZN=HY.createContext(void 0);function VS(){let $=HY.useContext(ZN);if($===void 0)throw Error(E0(45));return $}var HN=O(c(),1),DS=AS.forwardRef(function(J,Z){let{keepMounted:H=!1,...B}=J,{store:Q}=x5();if(!(Q.useState("mounted")||H))return null;return HN.jsx(ZN.Provider,{value:H,children:HN.jsx(_$,{ref:Z,...B})})});var y9=O(g(),1);var BY=O(g(),1),BN=BY.createContext(void 0);function JJ(){let $=BY.useContext(BN);if(!$)throw Error(E0(46));return $}var yH=O(c(),1),MS=y9.forwardRef(function(J,Z){let{render:H,className:B,anchor:Q,positionMethod:X="absolute",side:z="bottom",align:G="center",sideOffset:Y=0,alignOffset:U=0,collisionBoundary:F="clipping-ancestors",collisionPadding:K=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:V=o8,...L}=J,{store:A}=x5(),M=VS(),_=D$(),P=A.useState("floatingRootContext"),D=A.useState("mounted"),w=A.useState("open"),R=A.useState("openChangeReason"),b=A.useState("activeTriggerElement"),E=A.useState("modal"),x=A.useState("positionerElement"),I=A.useState("instantType"),S=A.useState("transitionStatus"),j=A.useState("hasViewport"),C=y9.useRef(null),k=m8(x,!1,!1),y=a8({anchor:Q,floatingRootContext:P,positionMethod:X,mounted:D,side:z,sideOffset:Y,align:G,alignOffset:U,arrowPadding:W,collisionBoundary:F,collisionPadding:K,sticky:q,disableAnchorTracking:N,keepMounted:M,nodeId:_,collisionAvoidance:V,adaptiveOrigin:j?t6:void 0}),v=y9.useMemo(()=>{let e={};if(!w)e.pointerEvents="none";return{role:"presentation",hidden:!D,style:{...y.positionerStyles,...e}}},[w,D,y.positionerStyles]),u=y9.useMemo(()=>({props:v,...y}),[v,y]),T=P.useState("domReferenceElement");F0(()=>{let e=T,A0=C.current;if(e)C.current=e;if(A0&&e&&e!==A0){A.set("instantType",void 0);let l=new AbortController;return k(()=>{A.set("instantType","trigger-change")},l.signal),()=>{l.abort()}}return},[T,k,A]);let t={open:w,side:u.side,align:u.align,anchorHidden:u.anchorHidden,instant:I},B0=y9.useCallback((e)=>{A.set("positionerElement",e)},[A]),h=U0("div",J,{state:t,props:[u.props,F2(S),L],ref:[Z,B0],stateAttributesMapping:D1});return yH.jsxs(BN.Provider,{value:u,children:[D&&E===!0&&R!==Y0.triggerHover&&yH.jsx(X7,{ref:A.context.internalBackdropRef,inert:v8(!w),cutout:b}),yH.jsx(VZ,{id:_,children:h})]})});var QY=O(g(),1);var PS=O(c(),1),Ot={...D1,...c1},_S=QY.forwardRef(function(J,Z){let{className:H,render:B,initialFocus:Q,finalFocus:X,...z}=J,{store:G}=x5(),Y=JJ(),U=xG(!0)!=null,F=G.useState("open"),K=G.useState("openMethod"),W=G.useState("instantType"),q=G.useState("transitionStatus"),N=G.useState("popupProps"),V=G.useState("titleElementId"),L=G.useState("descriptionElementId"),A=G.useState("modal"),M=G.useState("mounted"),_=G.useState("openChangeReason"),P=G.useState("activeTriggerElement"),D=G.useState("floatingRootContext");b5({open:F,ref:G.context.popupRef,onComplete(){if(F)G.context.onOpenChangeComplete?.(!0)}});let w=G.useState("disabled"),R=G.useState("openOnHover"),b=G.useState("closeDelay");E9(D,{enabled:R&&!w,closeDelay:b});function E(C){if(C==="touch")return G.context.popupRef.current;return!0}let x=Q===void 0?E:Q,I={open:F,side:Y.side,align:Y.align,instant:W,transitionStatus:q},S=QY.useCallback((C)=>{G.set("popupElement",C)},[G]),j=U0("div",J,{state:I,ref:[Z,G.context.popupRef,S],props:[N,{"aria-labelledby":V,"aria-describedby":L,onKeyDown(C){if(U&&X3.has(C.key))C.stopPropagation()}},F2(q),z],stateAttributesMapping:Ot});return PS.jsx(O$,{context:D,openInteractionType:K,modal:A==="trap-focus",disabled:!M||_===Y0.triggerHover,initialFocus:x,returnFocus:X,restoreFocus:"popup",previousFocusableElement:P5(P)?P:void 0,nextFocusableElement:G.context.triggerFocusTargetRef,beforeContentFocusGuardRef:G.context.beforeContentFocusGuardRef,children:j})});var OS=O(g(),1);var jS=OS.forwardRef(function(J,Z){let{className:H,render:B,...Q}=J,{store:X}=x5(),z=X.useState("open"),{arrowRef:G,side:Y,align:U,arrowUncentered:F,arrowStyles:K}=JJ();return U0("div",J,{state:{open:z,side:Y,align:U,uncentered:F},ref:[Z,G],props:[{style:K,"aria-hidden":!0},Q],stateAttributesMapping:D1})});var TS=O(g(),1);var jt={...D1,...c1},CS=TS.forwardRef(function(J,Z){let{className:H,render:B,...Q}=J,{store:X}=x5(),z=X.useState("open"),G=X.useState("mounted"),Y=X.useState("transitionStatus"),U=X.useState("openChangeReason");return U0("div",J,{state:{open:z,transitionStatus:Y},ref:[X.context.backdropRef,Z],props:[{role:"presentation",hidden:!G,style:{pointerEvents:U===Y0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},Q],stateAttributesMapping:jt})});var wS=O(g(),1);var ES=wS.forwardRef(function(J,Z){let{render:H,className:B,...Q}=J,{store:X}=x5(),z=t0(Q.id);return F0(()=>{return X.set("titleElementId",z),()=>{X.set("titleElementId",void 0)}},[X,z]),U0("h2",J,{ref:Z,props:[{id:z},Q]})});var SS=O(g(),1);var IS=SS.forwardRef(function(J,Z){let{render:H,className:B,...Q}=J,{store:X}=x5(),z=t0(Q.id);return F0(()=>{return X.set("descriptionElementId",z),()=>{X.set("descriptionElementId",void 0)}},[X,z]),U0("p",J,{ref:Z,props:[{id:z},Q]})});var RS=O(g(),1);var kS=RS.forwardRef(function(J,Z){let{render:H,className:B,disabled:Q=!1,nativeButton:X=!0,...z}=J,{buttonRef:G,getButtonProps:Y}=p5({disabled:Q,focusableWhenDisabled:!1,native:X}),{store:U}=x5();return U0("button",J,{ref:[Z,G],props:[{onClick(K){U.setOpen(!1,M0(Y0.closePress,K.nativeEvent,K.currentTarget))}},z,Y]})});var yS=O(g(),1);var bS=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var Tt={activationDirection:($)=>$?{"data-activation-direction":$}:null},hS=yS.forwardRef(function(J,Z){let{render:H,className:B,children:Q,...X}=J,{store:z}=x5(),{side:G}=JJ(),Y=z.useState("instantType"),{children:U,state:F}=H7({store:z,side:G,cssVars:bS,children:Q}),K={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:Y};return U0("div",J,{state:K,ref:Z,props:[X,{children:U}],stateAttributesMapping:Tt})});class XY{constructor(){this.store=new $J}open($){let J=$?this.store.context.triggerElements.getById($)??void 0:void 0;if($&&!J)throw Error(E0(80,$));this.store.setOpen(!0,M0(Y0.imperativeAction,void 0,J))}close(){this.store.setOpen(!1,M0(Y0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function xS(){return new XY}var H6=O(c(),1);function zY({...$}){return H6.jsx(x3.Root,{"data-slot":"popover",...$})}function GY({...$}){return H6.jsx(x3.Trigger,{"data-slot":"popover-trigger",...$})}function YY({className:$,align:J="center",alignOffset:Z=0,disableAnchorTracking:H=!1,positionMethod:B="absolute",side:Q="bottom",sideOffset:X=4,keepMounted:z=!1,container:G,...Y}){return H6.jsx(x3.Portal,{keepMounted:z,container:G,children:H6.jsx(x3.Positioner,{align:J,alignOffset:Z,disableAnchorTracking:H,positionMethod:B,side:Q,sideOffset:X,className:"isolate z-50",children:H6.jsx(x3.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",$),...Y})})})}function vS({className:$,...J}){return H6.jsx("div",{"data-slot":"popover-header",className:s("flex flex-col gap-0.5 text-sm",$),...J})}var MY=O(g(),1);var v3={};_4(v3,{Value:()=>uS,Track:()=>iS,Thumb:()=>tS,Root:()=>mS,Indicator:()=>eS,Control:()=>dS});var v5=O(g(),1);var gS=O(g(),1);function UY($,J){let Z=gS.useRef($),H=K0(J);F0(()=>{if(Z.current===$)return;H(Z.current)},[$,H]),F0(()=>{Z.current=$},[$])}function g2($,J=Number.MIN_SAFE_INTEGER,Z=Number.MAX_SAFE_INTEGER){return Math.max(J,Math.min($,Z))}function QN($,J,Z=(H,B)=>H===B){return $.length===J.length&&$.every((H,B)=>Z(H,J[B]))}function FY($,J){return $-J}function fS($,J,Z){let H=$.slice();return H[J]=Z,H.sort(FY)}function KY($,J,Z,H,B,Q){let X=$;if(X=g2(X,Z,H),B)X=fS(Q,J,g2(X,Q[J-1]||-1/0,Q[J+1]||1/0));return X}function WY($,J,Z){if(!Array.isArray($))return!0;let H=$.reduce((B,Q,X,z)=>{if(X===z.length-1)return B;return B.push(Math.abs(Q-z[X+1])),B},[]);return Math.min(...H)>=J*Z}var B8={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...y2};var qY=O(g(),1),XN=qY.createContext(void 0);function U9(){let $=qY.useContext(XN);if($===void 0)throw Error(E0(62));return $}var zN=O(c(),1);function Ct($){return"key"in $?Y0.keyboard:Y0.inputChange}function wt($,J){if(typeof $==="number"&&typeof J==="number")return $===J;if(Array.isArray($)&&Array.isArray(J))return QN($,J);return!1}var mS=v5.forwardRef(function(J,Z){let{"aria-labelledby":H,className:B,defaultValue:Q,disabled:X=!1,id:z,format:G,largeStep:Y=10,locale:U,render:F,max:K=100,min:W=0,minStepsBetweenValues:q=0,name:N,onValueChange:V,onValueCommitted:L,orientation:A="horizontal",step:M=1,thumbCollisionBehavior:_="push",thumbAlignment:P="center",value:D,...w}=J,R=t0(z),b=K0(V),E=K0(L),{clearErrors:x}=n4(),{state:I,disabled:S,name:j,setTouched:C,setDirty:k,validityData:y,shouldValidateOnChange:v,validation:u}=y5(),{labelId:T}=W2(),t=H??T,B0=S||X,h=j??N,[e,A0]=o4({controlled:D,default:Q??W,name:"Slider"}),l=v5.useRef(null),z0=v5.useRef(null),W0=v5.useRef([]),Q0=v5.useRef(null),G0=v5.useRef(null),L0=v5.useRef(-1),i=v5.useRef(null),$0=v5.useRef(null),J0=v5.useRef("none"),H0=T5(G),[n,p]=v5.useState(-1),[d,m]=v5.useState(-1),[a,o]=v5.useState(!1),[N0,O0]=v5.useState(()=>new Map),[g0,p0]=v5.useState([void 0,void 0]),f=K0((y0)=>{if(p(y0),y0!==-1)m(y0)});q7({id:R,commit:u.commit,value:e,controlRef:z0,name:h,getValue:()=>e}),UY(e,()=>{if(x(h),v())u.commit(e);else u.commit(e,!0);let y0=y.initialValue,d0;if(Array.isArray(e)&&Array.isArray(y0))d0=!QN(e,y0);else d0=e!==y0;k(d0)});let r=K0((y0)=>{if(y0)z0.current=y0}),X0=Array.isArray(e),V0=v5.useMemo(()=>{if(!X0)return[g2(e,W,K)];return e.slice().sort(FY)},[K,W,X0,e]),j0=K0((y0,d0)=>{if(Number.isNaN(y0)||wt(y0,e))return;let Z0=d0??M0(Y0.none,void 0,void 0,{activeThumbIndex:-1});J0.current=Z0.reason;let T0=Z0.event,G1=new(T0.constructor??Event)(T0.type,T0);if(Object.defineProperty(G1,"target",{writable:!0,value:{value:y0,name:h}}),Z0.event=G1,$0.current=y0,b(y0,Z0),Z0.isCanceled)return;A0(y0)}),v0=K0((y0,d0,Z0)=>{let T0=KY(y0,d0,W,K,X0,V0);if(WY(T0,M,q)){let H1=Ct(Z0);j0(T0,M0(H1,Z0.nativeEvent,void 0,{activeThumbIndex:d0})),C(!0);let G1=$0.current??T0;E(G1,dQ(H1,Z0.nativeEvent))}});if(F0(()=>{let y0=J5(m0(l.current));if(B0&&y0&&l.current?.contains(y0))y0.blur()},[B0]),B0&&n!==-1)f(-1);let Q1=v5.useMemo(()=>({...I,activeThumbIndex:n,disabled:B0,dragging:a,orientation:A,max:K,min:W,minStepsBetweenValues:q,step:M,values:V0}),[I,n,B0,a,K,W,q,A,M,V0]),U1=v5.useMemo(()=>({active:n,controlRef:z0,disabled:B0,dragging:a,validation:u,formatOptionsRef:H0,handleInputChange:v0,indicatorPosition:g0,inset:P!=="center",labelId:t,largeStep:Y,lastUsedThumbIndex:d,lastChangedValueRef:$0,lastChangeReasonRef:J0,locale:U,max:K,min:W,minStepsBetweenValues:q,name:h,onValueCommitted:E,orientation:A,pressedInputRef:Q0,pressedThumbCenterOffsetRef:G0,pressedThumbIndexRef:L0,pressedValuesRef:i,registerFieldControlRef:r,renderBeforeHydration:P==="edge",setActive:f,setDragging:o,setIndicatorPosition:p0,setValue:j0,state:Q1,step:M,thumbCollisionBehavior:_,thumbMap:N0,thumbRefs:W0,values:V0}),[n,z0,t,B0,a,u,H0,v0,g0,Y,d,$0,J0,U,K,W,q,h,E,A,Q0,G0,L0,i,r,f,o,p0,j0,Q1,M,_,P,N0,W0,V0]),c0=U0("div",J,{state:Q1,ref:[Z,l],props:[{"aria-labelledby":t,id:R,role:"group"},u.getValidationProps,w],stateAttributesMapping:B8});return zN.jsx(XN.Provider,{value:U1,children:zN.jsx(fG,{elementsRef:W0,onMapChange:O0,children:c0})})});var ZJ=O(g(),1);var pS=new Map;function Et($,J){let Z=JSON.stringify({locale:$,options:J}),H=pS.get(Z);if(H)return H;let B=new Intl.NumberFormat($,J);return pS.set(Z,B),B}function B6($,J,Z){if($==null)return"";return Et(J,Z).format($)}var uS=ZJ.forwardRef(function(J,Z){let{"aria-live":H="off",render:B,className:Q,children:X,...z}=J,{thumbMap:G,state:Y,values:U,formatOptionsRef:F,locale:K}=U9(),W=ZJ.useMemo(()=>{let L="";for(let A of G.values())if(A?.inputId)L+=`${A.inputId} `;return L.trim()===""?void 0:L.trim()},[G]),q=ZJ.useMemo(()=>{let L=[];for(let A=0;A<U.length;A+=1)L.push(B6(U[A],K,F.current??void 0));return L},[F,K,U]),N=ZJ.useMemo(()=>{let L=[];for(let A=0;A<U.length;A+=1)L.push(q[A]||U[A]);return L.join(" – ")},[U,q]);return U0("output",J,{state:Y,ref:Z,props:[{"aria-live":H,children:typeof X==="function"?X(q,U):N,htmlFor:W},z],stateAttributesMapping:B8})});var O8=O(g(),1);function NY($){let J=$.getBoundingClientRect();return{x:(J.left+J.right)/2,y:(J.top+J.bottom)/2}}function St($){if(Math.abs($)<1){let Z=$.toExponential().split("e-"),H=Z[0].split(".")[1];return(H?H.length:0)+parseInt(Z[1],10)}let J=$.toString().split(".")[1];return J?J.length:0}function LY($,J,Z){let H=Math.round(($-Z)/J)*J+Z;return Number(H.toFixed(St(J)))}function GN({values:$,index:J,nextValue:Z,min:H,max:B,step:Q,minStepsBetweenValues:X,initialValues:z}){if($.length===0)return[];let G=$.slice(),Y=Q*X,U=G.length-1,F=z??$,K=H+J*Y,W=B-(U-J)*Y;G[J]=g2(Z,K,W);for(let q=J+1;q<=U;q+=1){let N=G[q-1]+Y,V=B-(U-q)*Y,L=F[q]??G[q],A=Math.max(G[q],N);if(L<A)A=Math.max(L,N);G[q]=g2(A,N,V)}for(let q=J-1;q>=0;q-=1){let N=G[q+1]-Y,V=H+q*Y,L=F[q]??G[q],A=Math.min(G[q],N);if(L>A)A=Math.min(L,N);G[q]=g2(A,V,N)}for(let q=0;q<=U;q+=1)G[q]=Number(G[q].toFixed(12));return G}function cS({behavior:$,values:J,currentValues:Z,initialValues:H,pressedIndex:B,nextValue:Q,min:X,max:z,step:G,minStepsBetweenValues:Y}){let U=Z??J,F=H??J;if(!(U.length>1))return{value:Q,thumbIndex:0,didSwap:!1};let W=G*Y;switch($){case"swap":{let q=U[B],N=0.0000001,V=U.slice(),L=V[B-1],A=V[B+1],M=L!=null?L+W:X,_=A!=null?A-W:z,P=g2(Q,M,_),D=Number(P.toFixed(12));V[B]=D;let w=Q>q,R=Q<q,b=w&&A!=null&&Q>=A-0.0000001,E=R&&L!=null&&Q<=L+0.0000001;if(!b&&!E)return{value:V,thumbIndex:B,didSwap:!1};let x=b?B+1:B-1,I=V.map((k,y)=>{if(y===B)return D;let v=F[y];if(v!=null)return v;return U[y]}),S=Q;if(b)S=Math.max(Q,V[x]);else S=Math.min(Q,V[x]);let j=GN({values:V,index:x,nextValue:S,min:X,max:z,step:G,minStepsBetweenValues:Y,initialValues:I}),C=b?x-1:x+1;if(C>=0&&C<j.length){let k=j[C-1],y=j[C+1],v=k!=null?k+W:X;v=Math.max(v,X+C*W);let u=y!=null?y-W:z;u=Math.min(u,z-(j.length-1-C)*W);let T=g2(D,v,u);j[C]=Number(T.toFixed(12))}return{value:j,thumbIndex:x,didSwap:!0}}case"push":return{value:GN({values:U,index:B,nextValue:Q,min:X,max:z,step:G,minStepsBetweenValues:Y}),thumbIndex:B,didSwap:!1};case"none":default:{let q=U.slice(),N=q[B-1],V=q[B+1],L=N!=null?N+W:X,A=V!=null?V-W:z,M=g2(Q,L,A);return q[B]=Number(M.toFixed(12)),{value:q,thumbIndex:B,didSwap:!1}}}}var It=2;function Rt($,J){if(!$)return{start:0,end:0};function Z(Q){let X=Q!=null?parseFloat(Q):0;return Number.isNaN(X)?0:X}let H=!J?"InlineStart":"Top",B=!J?"InlineEnd":"Bottom";return{start:Z($[`border${H}Width`])+Z($[`padding${H}`]),end:Z($[`border${B}Width`])+Z($[`padding${B}`])}}function VY($,J){if(J.current!=null&&$.changedTouches){let Z=$;for(let H=0;H<Z.changedTouches.length;H+=1){let B=Z.changedTouches[H];if(B.identifier===J.current)return{x:B.clientX,y:B.clientY}}return null}return{x:$.clientX,y:$.clientY}}var dS=O8.forwardRef(function(J,Z){let{render:H,className:B,...Q}=J,{disabled:X,dragging:z,validation:G,inset:Y,lastChangedValueRef:U,lastChangeReasonRef:F,max:K,min:W,minStepsBetweenValues:q,onValueCommitted:N,orientation:V,pressedInputRef:L,pressedThumbCenterOffsetRef:A,pressedThumbIndexRef:M,pressedValuesRef:_,registerFieldControlRef:P,renderBeforeHydration:D,setActive:w,setDragging:R,setValue:b,state:E,step:x,thumbCollisionBehavior:I,thumbRefs:S,values:j}=U9(),C=l4(),k=j.length>1,y=V==="vertical",v=O8.useRef(null),u=O8.useRef(null),T=K0((H0)=>{if(H0&&u.current==null){if(u.current==null)u.current=getComputedStyle(H0)}}),t=O8.useRef(null),B0=O8.useRef(0),h=O8.useRef(0),e=T5(j),A0=K0((H0)=>{if(M.current!==H0)M.current=H0;let n=S.current[H0];if(!n){A.current=null,L.current=null;return}L.current=n.querySelector('input[type="range"]')}),l=K0((H0)=>{let n=v.current;if(!n)return null;let{width:p,height:d,bottom:m,left:a,right:o}=n.getBoundingClientRect(),N0=Rt(u.current,y),O0=h.current,g0=(y?d:p)-N0.start-N0.end-O0*2,p0=A.current??0,f=H0.x-p0,r=H0.y-p0,X0=y?m-r-N0.end:(C==="rtl"?o-f:f-a)-N0.start,V0=g2((X0-O0)/g0,0,1),j0=(K-W)*V0+W;if(j0=LY(j0,x,W),j0=g2(j0,W,K),!k)return{value:j0,thumbIndex:0,didSwap:!1};let v0=M.current;if(v0<0)return null;let Q1=cS({behavior:I,values:j,currentValues:e.current??j,initialValues:_.current,pressedIndex:v0,nextValue:j0,min:W,max:K,step:x,minStepsBetweenValues:q});if(I==="swap"&&Q1.didSwap)A0(Q1.thumbIndex);else M.current=Q1.thumbIndex;return Q1}),z0=K0((H0)=>{_.current=k?j.slice():null,e.current=j;let n=M.current,p=n;if(n>-1&&n<j.length){if(j[n]===K){let d=n;while(d>0&&j[d-1]===K)d-=1;p=d}}else{let d=!y?"x":"y",m;p=-1;for(let a=0;a<S.current.length;a+=1){let o=S.current[a];if(j1(o)){let N0=NY(o),O0=Math.abs(H0[d]-N0[d]);if(m===void 0||O0<=m)p=a,m=O0}}}if(p>-1&&p!==n)A0(p);if(Y){let d=S.current[p];if(j1(d)){let m=d.getBoundingClientRect(),a=!y?"width":"height";h.current=m[a]/2}}}),W0=K0((H0)=>{S.current?.[H0]?.querySelector('input[type="range"]')?.focus({preventScroll:!0})}),Q0=K0((H0)=>{let n=VY(H0,t);if(n==null)return;if(B0.current+=1,H0.type==="pointermove"&&H0.buttons===0){G0(H0);return}let p=l(n);if(p==null)return;if(WY(p.value,x,q)){if(!z&&B0.current>It)R(!0);if(b(p.value,M0(Y0.drag,H0,void 0,{activeThumbIndex:p.thumbIndex})),e.current=Array.isArray(p.value)?p.value:[p.value],p.didSwap)W0(p.thumbIndex)}});function G0(H0){w(-1),R(!1),L.current=null,A.current=null;let n=VY(H0,t),p=n!=null?l(n):null;if(p!=null){let d=F.current;G.commit(U.current??p.value),N(U.current??p.value,dQ(d,H0))}if("pointerType"in H0&&v.current?.hasPointerCapture(H0.pointerId))v.current?.releasePointerCapture(H0.pointerId);M.current=-1,t.current=null,_.current=null,i()}let L0=K0((H0)=>{if(X)return;let n=H0.changedTouches[0];if(n!=null)t.current=n.identifier;let p=VY(H0,t);if(p!=null){z0(p);let m=l(p);if(m==null)return;if(W0(m.thumbIndex),b(m.value,M0(Y0.trackPress,H0,void 0,{activeThumbIndex:m.thumbIndex})),e.current=Array.isArray(m.value)?m.value:[m.value],m.didSwap)W0(m.thumbIndex)}B0.current=0;let d=m0(v.current);d.addEventListener("touchmove",Q0,{passive:!0}),d.addEventListener("touchend",G0,{passive:!0})}),i=K0(()=>{let H0=m0(v.current);H0.removeEventListener("pointermove",Q0),H0.removeEventListener("pointerup",G0),H0.removeEventListener("touchmove",Q0),H0.removeEventListener("touchend",G0),_.current=null}),$0=z4();return O8.useEffect(()=>{let H0=v.current;if(!H0)return()=>i();return H0.addEventListener("touchstart",L0,{passive:!0}),()=>{H0.removeEventListener("touchstart",L0),$0.cancel(),i()}},[i,L0,v,$0]),O8.useEffect(()=>{if(X)i()},[X,i]),U0("div",J,{state:E,ref:[Z,P,v,T],props:[{["data-base-ui-slider-control"]:D?"":void 0,onPointerDown(H0){let n=v.current;if(!n||X||H0.defaultPrevented||!j1(H0.target)||H0.button!==0)return;let p=VY(H0,t);if(p!=null){z0(p);let m=l(p);if(m==null)return;if(f0(S.current[m.thumbIndex],J5(m0(n))))H0.preventDefault();else $0.request(()=>{W0(m.thumbIndex)});if(R(!0),A.current==null){if(b(m.value,M0(Y0.trackPress,H0.nativeEvent,void 0,{activeThumbIndex:m.thumbIndex})),e.current=Array.isArray(m.value)?m.value:[m.value],m.didSwap)W0(m.thumbIndex)}}if(H0.nativeEvent.pointerId)n.setPointerCapture(H0.nativeEvent.pointerId);B0.current=0;let d=m0(v.current);d.addEventListener("pointermove",Q0,{passive:!0}),d.addEventListener("pointerup",G0,{once:!0})},tabIndex:-1},Q],stateAttributesMapping:B8})});var lS=O(g(),1);var iS=lS.forwardRef(function(J,Z){let{render:H,className:B,...Q}=J,{state:X}=U9();return U0("div",J,{state:X,ref:Z,props:[{style:{position:"relative"}},Q],stateAttributesMapping:B8})});var V4=O(g(),1);function hH($,J,Z){return($-J)*100/(Z-J)}var AY=O(g(),1),kt=AY.createContext(void 0),bt={disableStyleElements:!1};function rS(){return AY.useContext(kt)??bt}var aS=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 nS='!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 xH=O(c(),1),oS="PageUp",sS="PageDown",yt=new Set([hZ,xZ,vZ,gZ,fZ,mZ,oS,sS]);function ht($,J,Z,H){if(J<0)return;if($.length===2){if(J===0)return`${B6($[J],H,Z)} start range`;return`${B6($[J],H,Z)} end range`}return Z?B6($[J],H,Z):void 0}function HJ($,J,Z,H,B){return Z===1?Math.min($+J,B):Math.max($-J,H)}var tS=V4.forwardRef(function(J,Z){let{render:H,children:B,className:Q,"aria-describedby":X,"aria-label":z,"aria-labelledby":G,disabled:Y=!1,getAriaLabel:U,getAriaValueText:F,id:K,index:W,inputRef:q,onBlur:N,onFocus:V,onKeyDown:L,tabIndex:A,...M}=J,{nonce:_}=rS(),P=t0(K),{active:D,lastUsedThumbIndex:w,controlRef:R,disabled:b,validation:E,formatOptionsRef:x,handleInputChange:I,inset:S,labelId:j,largeStep:C,locale:k,max:y,min:v,minStepsBetweenValues:u,name:T,orientation:t,pressedInputRef:B0,pressedThumbCenterOffsetRef:h,pressedThumbIndexRef:e,renderBeforeHydration:A0,setActive:l,setIndicatorPosition:z0,state:W0,step:Q0,values:G0}=U9(),L0=l4(),i=Y||b,$0=G0.length>1,J0=t==="vertical",H0=L0==="rtl",{setTouched:n,setFocused:p,validationMode:d}=y5(),m=V4.useRef(null),a=V4.useRef(null),o=t0(),N0=W7(),O0=$0?o:N0,g0=V4.useMemo(()=>({inputId:O0}),[O0]),{ref:p0,index:f}=L4({metadata:g0}),r=!$0?0:W??f,X0=r===G0.length-1,V0=G0[r],j0=hH(V0,v,y),[v0,Q1]=V4.useState(!1),[U1,c0]=V4.useState();w2(()=>Q1(!0));let y0=w>=0&&w<G0.length?w:-1,d0=K0(()=>{let I0=R.current,k0=m.current;if(!I0||!k0)return;let R0=k0.getBoundingClientRect(),n0=I0.getBoundingClientRect(),F1=J0?"height":"width",C1=n0[F1]-R0[F1],$5=(R0[F1]/2+C1*j0/100)/n0[F1]*100;if(c0($5),r===0)z0((A1)=>[$5,A1[1]]);else if(X0)z0((A1)=>[A1[0],$5])});F0(()=>{if(S)queueMicrotask(d0)},[d0,S]),F0(()=>{if(S)d0()},[d0,S,j0]);let Z0=V4.useCallback(()=>{let I0=J0?"bottom":"insetInlineStart",k0=J0?"left":"top",R0;if($0){if(D===r)R0=2;else if(y0===r)R0=1}else if(D===r)R0=1;if(!S){if(!Number.isFinite(j0))return U8;return{position:"absolute",[I0]:`${j0}%`,[k0]:"50%",translate:`${(J0||!H0?-1:1)*50}% ${(J0?1:-1)*50}%`,zIndex:R0}}return{["--position"]:`${U1}%`,visibility:A0&&!v0||U1===void 0?"hidden":void 0,position:"absolute",[I0]:"var(--position)",[k0]:"50%",translate:`${(J0||!H0?-1:1)*50}% ${(J0?1:-1)*50}%`,zIndex:R0}},[D,r,S,v0,U1,$0,A0,H0,y0,j0,J0]),T0;if(t==="vertical")T0=H0?"vertical-rl":"vertical-lr";let H1=U4({"aria-label":typeof U==="function"?U(r):z,"aria-labelledby":G??j,"aria-describedby":X,"aria-orientation":t,"aria-valuenow":V0,"aria-valuetext":typeof F==="function"?F(B6(V0,k,x.current??void 0),V0,r):ht(G0,r,x.current??void 0,k),disabled:i,id:O0,max:y,min:v,name:T,onChange(I0){I(I0.target.valueAsNumber,r,I0)},onFocus(){l(r),p(!0)},onBlur(){if(!m.current)return;if(l(-1),n(!0),p(!1),d==="onBlur")E.commit(KY(V0,r,v,y,$0,G0))},onKeyDown(I0){if(!yt.has(I0.key))return;if(X3.has(I0.key))I0.stopPropagation();let k0=null,R0=LY(V0,Q0,v);switch(I0.key){case hZ:k0=HJ(R0,I0.shiftKey?C:Q0,1,v,y);break;case gZ:k0=HJ(R0,I0.shiftKey?C:Q0,H0?-1:1,v,y);break;case xZ:k0=HJ(R0,I0.shiftKey?C:Q0,-1,v,y);break;case vZ:k0=HJ(R0,I0.shiftKey?C:Q0,H0?1:-1,v,y);break;case oS:k0=HJ(R0,C,1,v,y);break;case sS:k0=HJ(R0,C,-1,v,y);break;case mZ:if(k0=y,$0)k0=Number.isFinite(G0[r+1])?G0[r+1]-Q0*u:y;break;case fZ:if(k0=v,$0)k0=Number.isFinite(G0[r-1])?G0[r-1]+Q0*u:v;break;default:break}if(k0!==null)I(k0,r,I0),I0.preventDefault()},step:Q0,style:{...U8,width:"100%",height:"100%",writingMode:T0},tabIndex:A??void 0,type:"range",value:V0??""},E.getInputValidationProps),G1=j4(a,E.inputRef,q);return U0("div",J,{state:W0,ref:[Z,p0,m],props:[{[aS.index]:r,children:xH.jsxs(V4.Fragment,{children:[B,xH.jsx("input",{ref:G1,...H1}),S&&!v0&&A0&&X0&&xH.jsx("script",{nonce:_,dangerouslySetInnerHTML:{__html:nS},suppressHydrationWarning:!0})]}),id:P,onBlur:N,onFocus:V,onPointerDown(I0){if(e.current=r,m.current!=null){let k0=t==="horizontal"?"x":"y",R0=NY(m.current),n0=(t==="horizontal"?I0.clientX:I0.clientY)-R0[k0];h.current=n0}if(a.current!=null&&B0.current!==a.current)B0.current=a.current},style:Z0(),suppressHydrationWarning:A0||void 0,tabIndex:-1},M],stateAttributesMapping:B8})});var DY=O(g(),1);function xt($,J,Z,H,B,Q){let X=Z===void 0||J&&H===void 0?"hidden":void 0,z=$?"bottom":"insetInlineStart",G=$?"height":"width",U={visibility:B&&!Q?"hidden":X,position:$?"absolute":"relative",[$?"width":"height"]:"inherit"};if(U["--start-position"]=`${Z??0}%`,!J)return U[z]=0,U[G]="var(--start-position)",U;return U["--relative-size"]=`${(H??0)-(Z??0)}%`,U[z]="var(--start-position)",U[G]="var(--relative-size)",U}function vt($,J,Z,H){let B=$?"bottom":"insetInlineStart",Q=$?"height":"width",z={position:$?"absolute":"relative",[$?"width":"height"]:"inherit"};if(!J)return z[B]=0,z[Q]=`${Z}%`,z;let G=H-Z;return z[B]=`${Z}%`,z[Q]=`${G}%`,z}var eS=DY.forwardRef(function(J,Z){let{render:H,className:B,...Q}=J,{indicatorPosition:X,inset:z,max:G,min:Y,orientation:U,renderBeforeHydration:F,state:K,values:W}=U9(),[q,N]=DY.useState(!1);w2(()=>N(!0));let V=U==="vertical",L=W.length>1,A=z?xt(V,L,X[0],X[1],F,q):vt(V,L,hH(W[0],Y,G),hH(W[W.length-1],Y,G));return U0("div",J,{state:K,ref:Z,props:[{["data-base-ui-slider-indicator"]:F?"":void 0,style:A,suppressHydrationWarning:F||void 0},Q],stateAttributesMapping:B8})});var Q6=O(c(),1);function $I({children:$,className:J,defaultValue:Z,value:H,min:B=0,max:Q=100,...X}){let[z,G]=MY.useState(!1),Y=Array.isArray(H)?H:Array.isArray(Z)?Z:[B,Q];return MY.useEffect(()=>{let U=requestAnimationFrame(()=>G(!0));return()=>cancelAnimationFrame(U)},[]),Q6.jsx(v3.Root,{className:s("data-horizontal:w-full data-vertical:h-full",J),"data-slot":"slider",defaultValue:Z,value:H,min:B,max:Q,thumbAlignment:"edge",...X,children:Q6.jsxs(v3.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:[Q6.jsx(v3.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:Q6.jsx(v3.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:Y.length},(U,F)=>Q6.jsx(v3.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")},F))]})})}var Y1=O(c(),1);function gt($){return $?.split(/\s*·\s*/)[0]??""}function JI($){return gt($.description)||$.displayName}function ft($){return $.charAt(0).toUpperCase()+$.slice(1)}function mt($){return $==="xhigh"?"Extra":ft($)}function ZI($){return typeof $==="number"?$:$[0]??0}var HI={from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},BI={type:"spring",duration:0.3,delay:0.1,bounce:0};function XI({label:$,leadingIcon:J,className:Z,...H}){return Y1.jsxs(C0,{...H,variant:"ghost",className:s("group/picker max-w-56 min-w-0 px-2 text-muted-foreground hover:text-muted-foreground",Z),children:[J,Y1.jsx("span",{className:"truncate font-normal",children:$})]})}function pt({current:$,model:J,models:Z,onValueChange:H}){let B=JI(J),Q=VE(Z,"Models");return Y1.jsxs(n7,{children:[Y1.jsx(o7,{render:Y1.jsx(XI,{label:B,className:"shrink","aria-label":`Model: ${B}`})}),Y1.jsx(s7,{align:"end",side:"top",className:"w-max max-w-64 min-w-40",children:Y1.jsx(YS,{value:$,onValueChange:H,children:Q.map((X)=>Y1.jsxs(t7,{children:[Y1.jsx(JY,{children:X.label}),X.models.map((z)=>Y1.jsx(US,{value:z.value,closeOnClick:!0,children:JI(z)},z.value))]},X.label))})})]})}function ut({currentEffort:$,effortLevels:J,fastMode:Z,showFastMode:H,onFastModeChange:B,onValueChange:Q}){let X=WE(J,$),[z,G]=BJ.useState(!1),[Y,U]=BJ.useState(X),[F,K]=BJ.useState(!1),q=J[z?Y:X]??$,N=mt(q),V=(A)=>{if(A)U(X);else K(!1);G(A)},L=(A)=>{let M=J[A];if(M&&M!==$)Q(M)};return Y1.jsxs(zY,{open:z,onOpenChange:V,children:[Y1.jsx(GY,{render:Y1.jsx(XI,{label:N,leadingIcon:Z?Y1.jsx(vH,{stroke:1.5}):void 0,"aria-label":`Effort: ${N}`})}),Y1.jsxs(YY,{align:"end",side:"top",className:"w-64",disableAnchorTracking:!0,children:[Y1.jsx(vS,{className:"relative h-5 flex-row items-center",children:Y1.jsx(t2,{mode:"popLayout",initial:!1,children:F?Y1.jsxs(r1.div,{className:"flex h-5 w-full items-center justify-between text-sm text-muted-foreground","aria-hidden":"true",variants:HI,initial:"from",animate:"to",exit:"from",transition:BI,children:[Y1.jsx("span",{children:"Faster"}),Y1.jsx("span",{children:"Smarter"})]},"range"):Y1.jsxs(r1.div,{className:"flex h-5 w-full items-center justify-between gap-2",variants:HI,initial:"from",animate:"to",exit:"from",transition:BI,children:[Y1.jsxs("div",{className:"flex items-center gap-1",children:[Y1.jsx("span",{className:"text-muted-foreground",children:"Effort"}),Y1.jsx("output",{"aria-live":"polite",children:N})]}),H&&Y1.jsxs(d1,{children:[Y1.jsx(l1,{render:Y1.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":Z?"Turn off Fast mode":"Turn on Fast mode","aria-pressed":Z,onClick:()=>B(!Z),className:"-my-1 -mr-1",children:Z?Y1.jsx(QI,{className:"text-primary"}):Y1.jsx(vH,{className:"text-muted-foreground",stroke:1.5})})}),Y1.jsxs(i1,{align:"center",className:"flex-col gap-0",children:[Y1.jsx("span",{children:"Fast mode"}),Y1.jsx("span",{className:"font-normal text-muted-foreground",children:"More usage"})]})]})]},"effort")})}),Y1.jsxs("label",{className:"block",children:[Y1.jsx("span",{className:"sr-only",children:"Reasoning effort"}),Y1.jsx($I,{value:Y,min:0,max:J.length-1,step:1,onPointerDown:(A)=>{if(A.button===0)K(!0)},onPointerCancel:()=>K(!1),onValueChange:(A)=>U(ZI(A)),onValueCommitted:(A)=>{K(!1),L(ZI(A))},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:Y1.jsx("span",{"data-slot":"slider-marks","aria-hidden":"true",className:"absolute inset-x-2 flex items-center justify-between",children:Array.from({length:J.length},(A,M)=>Y1.jsx("span",{className:s("size-1 rounded-full",M<=Y?"bg-primary-foreground/30":"bg-foreground/30")},M))})})]})]})]})}var zI=BJ.memo(function({sessionId:J}){let{workspaceId:Z,layout:H,setLayout:B}=Y5(),{data:Q}=z9(Z),X=Q?.models??[],z=X.find((b)=>b.value==="default"),G=Q?LE(X.filter((b)=>b.value!=="default"),Q.provider):[],Y=TG(Z,J).data,U=FE(Z),F=(J?Y?.model:void 0)??H.selectedModel,K=(J?Y?.effort:void 0)??H.selectedEffort,W=(J?Y?.fastMode:void 0)??H.selectedFastMode,q=(b)=>{if(J)U.mutate({sessionId:J,patch:{model:b}});else B({selectedModel:b})},N=(b)=>{if(J)U.mutate({sessionId:J,patch:{effort:b}});else B({selectedEffort:b})},V=(b)=>{if(J)U.mutate({sessionId:J,patch:{fastMode:b}});else B({selectedFastMode:b})};if(G.length===0)return null;let L=G.some((b)=>b.value===F)?F:void 0,A=G.find((b)=>z?.resolvedModel&&b.resolvedModel===z.resolvedModel)??G[0],M=L??A.value,_=G.find((b)=>b.value===M)??G[0],P=_.supportsEffort?_.supportedEffortLevels??[]:[],D=gq(P,K,_.defaultEffort),w=qE(P)&&D!==void 0,R=NE(_,W);return Y1.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[Y1.jsx(pt,{current:M,model:_,models:G,onValueChange:q}),w&&Y1.jsx(ut,{currentEffort:D,effortLevels:P,fastMode:R,showFastMode:_.supportsFastMode===!0,onFastModeChange:V,onValueChange:N},_.value)]})});var J1=O(c(),1);function YI({composerRef:$,onSend:J,onStop:Z,processing:H,sessionId:B,modelSessionId:Q,availability:X,annotation:z,onRemoveDrawing:G,allowFiles:Y=!0,placeholder:U,draft:F}){let K=QJ.useRef(null),W=Z5(),q=_5((j)=>j.composerDrafts[W]??""),N=_5((j)=>F?(j.viewBuilderDrafts??{})[F.id]:void 0),V=F?N??F.initialValue:q,L=QJ.useRef(V);L.current=V;let A=s2((j)=>j.attachments[o2(W,B)]??ct),[M,_]=QJ.useState(!1),P=A.some((j)=>j.status==="uploading"),D=A.some((j)=>j.status==="ready"||j.status==="draft"),w=V.trim().length>0||D,R=EH(w,P,X),b=(j)=>{if(L.current=j,F)F.onChange(j);else _5.getState().setComposerDraft(W,j)},E=(j)=>{if(Y)Ew({workspaceId:W,sessionId:B},j)},x=QJ.useRef(!1),I=(j)=>{if(j.kind==="drawing"&&G){G(j.localId);return}E1.getState().removeAttachment(W,B,j.localId)},S=async()=>{if(!R||x.current)return;x.current=!0;try{if(await z?.finish(),await J(L.current),!F)L.current="",_5.getState().setComposerDraft(W,"")}finally{x.current=!1}};return J1.jsxs(Rw,{composerRef:$,onSubmit:(j)=>{j.preventDefault(),S()},onDragOver:(j)=>{if(!j.dataTransfer.types.includes("Files"))return;if(j.preventDefault(),Y)_(!0)},onDragLeave:(j)=>{if(!Y)return;if(j.currentTarget.contains(j.relatedTarget))return;_(!1)},onDrop:(j)=>{if(!j.dataTransfer.types.includes("Files"))return;j.preventDefault(),_(!1),E(Array.from(j.dataTransfer.files))},className:s(M&&"ring-2 ring-ring/60"),children:[A.length>0&&J1.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-1",children:A.map((j)=>J1.jsx(dt,{attachment:j,onRemove:()=>I(j)},j.localId))}),J1.jsx(kw,{textareaRef:$,id:"chat-input",name:"message",value:V,onChange:(j)=>b(j.target.value),onKeyDown:(j)=>{if(j.key==="Enter"&&!j.shiftKey)j.preventDefault(),S()},onPaste:(j)=>{let C=Array.from(j.clipboardData?.files??[]);if(C.length===0)return;j.preventDefault(),E(C)},placeholder:H?"Queue a follow-up":U??"Do anything",rows:1}),J1.jsxs(bw,{children:[Y&&J1.jsx("input",{ref:K,type:"file",multiple:!0,hidden:!0,onChange:(j)=>{E(Array.from(j.target.files??[])),j.target.value=""}}),J1.jsxs("div",{className:"mr-auto flex shrink-0 items-center gap-0.5",children:[Y&&J1.jsxs(d1,{children:[J1.jsx(l1,{render:J1.jsx(C0,{type:"button",variant:"ghost",size:"icon",onClick:()=>K.current?.click(),"aria-label":"Attach files",children:J1.jsx(PY,{stroke:1.6,className:"size-4.5!"})})}),J1.jsx(i1,{children:"Attach files"})]}),z&&J1.jsxs(d1,{children:[J1.jsx(l1,{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(gH,{stroke:1.5})})}),J1.jsx(i1,{children:"Draw annotation"})]})]}),J1.jsx(zI,{sessionId:Q}),H?J1.jsxs(d1,{children:[J1.jsx(l1,{render:J1.jsx(C0,{type:"button",size:"icon",onClick:Z,"aria-label":"Stop agent",children:J1.jsx(GI,{})})}),J1.jsx(i1,{children:"Stop answering"})]}):J1.jsx(yw,{label:"Send message",hasContent:w,busy:P,availability:X})]})]})}var ct=[];function dt({attachment:$,onRemove:J}){if($.kind==="drawing")return J1.jsx(lt,{attachment:$,onRemove:J});let{name:Z,previewUrl:H,status:B,error:Q}=$,X=!!H;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",B==="error"&&"border-destructive/50"),title:Q??Z,children:[X?J1.jsx("img",{src:H,alt:Z,className:"size-full object-cover"}):J1.jsxs(J1.Fragment,{children:[J1.jsx(XJ,{size:16,stroke:1.75,className:"shrink-0 text-muted-foreground"}),J1.jsx("span",{className:"truncate text-xs",children:Z})]}),B==="uploading"&&J1.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/70",children:J1.jsx(E5,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),B==="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:J,"aria-label":`Remove ${Z}`,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(w5,{stroke:1.75})})]})}function lt({attachment:$,onRemove:J}){let{previewUrl:Z,purpose:H}=$,B=H==="sketch"?"Sketch":"Annotation";return J1.jsxs(XE,{children:[J1.jsxs(zE,{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:J,"aria-label":`Remove ${B.toLowerCase()}`,className:"size-6 shrink-0 hover:bg-transparent hover:text-current",children:[J1.jsx(gH,{stroke:1.75,className:"group-focus-within:hidden group-hover:hidden"}),J1.jsx(w5,{stroke:1.75,className:"hidden group-focus-within:block group-hover:block"})]}),J1.jsx("span",{children:B})]}),Z&&J1.jsx(GE,{side:"top",align:"start",className:"w-60 max-w-[calc(100vw-2rem)]",children:J1.jsx("img",{src:Z,alt:`${B} preview`,className:"max-h-72 w-full rounded-md object-contain"})})]})}var X6=O(c(),1);function YN({className:$,prompt:J,disabled:Z=!1,onSelect:H}){let B=J.icon;return X6.jsxs(C0,{type:"button",size:"sm",disabled:Z,onClick:()=>H(J),className:s("h-auto items-start justify-start gap-2 rounded-lg p-2 px-3 text-left leading-snug whitespace-normal",$),children:[X6.jsx(B,{stroke:2,"aria-hidden":!0,className:"mt-0.5"}),X6.jsx("span",{children:J.label})]})}function UI({prompts:$,disabled:J=!1,onSelect:Z}){return X6.jsx("div",{className:"row-gap-2 grid w-full grid-cols-1 gap-x-3 gap-y-2 py-2 @md:grid-cols-3",children:$.map((H,B)=>{return X6.jsx(YN,{prompt:H,disabled:J,onSelect:Z,className:s("h-full w-fit @md:w-full",B===0&&"@md:translate-y-3 @md:rotate-3 @md:hover:translate-y-2.5",B===1&&"@md:-rotate-1",B===2&&"@md:translate-y-3 @md:-rotate-4 @md:hover:translate-y-2.5")},H.prompt)})})}var s1=O(c(),1),UN="Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or bundle, test, and runtime-log summaries.",it=[{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.",UN],icon:qI},{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.",UN],icon:NI},{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.",UN],icon:jY}],rt={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:FI};function LI({isViewBuilderDraft:$,hasSentMessageFromMoi:J,isWorkspacePendingAnalysis:Z}){if($)return"view-builder";if(!J)return"chat-welcome";if(Z)return"workspace-welcome";return"empty"}var TY=s("flex flex-1 flex-col items-center justify-center self-center");function VI({kind:$,disabled:J=!1,onSelectPrompt:Z,onNavigate:H}){switch($){case"view-builder":return s1.jsx(at,{});case"chat-welcome":return s1.jsx(nt,{disabled:J,onSelectPrompt:Z,onNavigate:H});case"workspace-welcome":return s1.jsx(ot,{disabled:J,onSelectPrompt:Z});case"empty":return s1.jsx(st,{})}}function at(){return s1.jsxs("div",{className:s(TY,"gap-2 text-center text-muted-foreground"),children:[s1.jsx(WI,{size:56,stroke:0.5}),s1.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 nt({disabled:$=!1,onSelectPrompt:J,onNavigate:Z}){return s1.jsxs("div",{className:s(TY,"@container w-full max-w-md min-w-0"),children:[s1.jsxs("div",{className:"prose prose-sm min-w-0 wrap-anywhere prose-inherit",children:[s1.jsx("p",{children:"moi is the visual workspace for you and your agent. It grows and adapts to the work you're doing."}),s1.jsxs("p",{children:["Ask"," ",s1.jsx(_Y,{Icon:OY,destination:"agent",onNavigate:Z,children:"Agent"})," ","to build"," ",s1.jsx(_Y,{Icon:mH,destination:"widgets",onNavigate:Z,children:"Widgets"})," ","that surface information and quick actions, or entire"," ",s1.jsx(_Y,{Icon:fH,destination:"views",onNavigate:Z,children:"Views"})," ","for more complex tools. Use"," ",s1.jsx(_Y,{Icon:pH,destination:"scratchpad",onNavigate:Z,children:"Scratchpad"})," ","for exploring and shaping ideas with your agent."]}),s1.jsx("p",{children:"Try an example:"})]}),s1.jsx(UI,{prompts:it,disabled:$,onSelect:J})]})}function ot({disabled:$=!1,onSelectPrompt:J}){return s1.jsxs("div",{className:s(TY,"gap-2"),children:[s1.jsxs("div",{className:"prose prose-sm max-w-xs min-w-0 text-center wrap-anywhere prose-inherit",children:[s1.jsx("p",{className:"font-medium text-foreground",children:"Start with what’s already here"}),s1.jsx("p",{className:"text-muted-foreground",children:"Your agent can explore this workspace and suggest useful widgets and views based on its contents."})]}),s1.jsx(YN,{prompt:rt,disabled:$,onSelect:J})]})}function st(){return s1.jsxs("div",{className:s(TY,"gap-2 text-center text-muted-foreground"),children:[s1.jsx(KI,{size:56,stroke:0.5,"aria-hidden":!0}),s1.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 _Y({Icon:$,children:J,destination:Z,onNavigate:H}){return s1.jsxs("button",{type:"button","data-welcome-destination":Z,onClick:()=>H(Z),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:[s1.jsx($,{size:16,stroke:1.75,"aria-hidden":!0}),J]})}var uH=O(g(),1);var T1=O(c(),1);function PI({label:$}){return T1.jsx("div",{className:"flex h-7 items-center px-2.5 text-sm font-medium",children:$})}function tt($){if($.flavor==="cron"||$.flavor==="subagent")return $.flavor;let J=$.origin?.provider.trim().toLowerCase();return J?J:null}function et({active:$,canArchive:J,confirmingArchive:Z,onArchive:H,onRequestArchive:B,onSelect:Q,session:X,workspaceId:z}){let G=uH.useRef(!1),[Y,U]=uH.useState(!1),F=s2((N)=>RZ(N.activity,z,X.sessionId)),K=tt(X);function W(){B(X.sessionId)}async function q(){if(G.current)return;G.current=!0,U(!0);try{await H(X.sessionId)}catch{i4.add({title:"Couldn’t archive chat",type:"error"})}finally{G.current=!1,U(!1)}}return T1.jsxs("div",{className:"group/chat relative",children:[T1.jsx(kH,{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:T1.jsx("div",{className:s("flex min-w-0 flex-1 overflow-hidden",(F||Y)&&"mr-4 mask-r-from-[calc(100%-16px)]",J&&!Z&&"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)]",Z&&"mr-14 mask-r-from-[calc(100%-16px)]"),children:T1.jsxs("span",{className:s("flex min-w-0 items-baseline gap-1.5",(F||Y)&&"-mr-4",Z?"-mr-14":J&&"group-focus-within/chat:-mr-4 group-hover/chat:-mr-4 [@media(hover:none)]:-mr-4"),children:[T1.jsx("span",{className:"min-w-0 truncate",children:X.summary}),K&&T1.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:K})]})})}),F&&T1.jsx(E4,{className:s("pointer-events-none absolute top-1/2 right-1.5 -translate-y-1/2 text-muted-foreground",J&&"group-focus-within/chat:hidden group-hover/chat:hidden [@media(hover:none)]:hidden",(Z||Y)&&"hidden")}),J&&T1.jsx("div",{className:s("absolute top-1/2 right-0 flex -translate-y-1/2 items-center opacity-100 transition-none",!Z&&"group-focus-within/chat:opacity-100 group-hover/chat:opacity-100 [@media(hover:hover)]:opacity-0",Y&&"opacity-100!"),children:Z?T1.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:Y,onClick:q,onPointerDown:(N)=>N.stopPropagation(),children:"Confirm"}):T1.jsxs(d1,{children:[T1.jsx(l1,{render:T1.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:Y,onClick:W,onPointerDown:(N)=>N.stopPropagation(),children:T1.jsx(DI,{stroke:1.75})})}),T1.jsx(i1,{side:"right",children:"Archive chat"})]})})]})}function $e($){return`${$.getFullYear()}-${$.getMonth()}-${$.getDate()}`}function AI($){return Date.UTC($.getFullYear(),$.getMonth(),$.getDate())/86400000}function Je($,J){let Z=AI(J)-AI($);if(Z===0)return"Today";if(Z===1)return"Yesterday";if(Z>=2&&Z<=5)return`${Z} days ago`;return $.toLocaleDateString([],{month:"short",day:"numeric",...$.getFullYear()===J.getFullYear()?{}:{year:"numeric"}})}function Ze($,J=new Date){let Z=new Map;for(let H of $.slice().sort((B,Q)=>Q.lastModified-B.lastModified)){let B=new Date(H.lastModified),Q=$e(B),X=Z.get(Q);if(X){X.sessions.push(H);continue}Z.set(Q,{key:Q,label:Je(B,J),sessions:[H]})}return[...Z.values()]}function _I({isViewBuilder:$=!1}){if($)return T1.jsx(PI,{label:"Build a new view"});return T1.jsx(He,{})}function He(){let $=Z5(),[J,Z]=Q3(),H=J??null,[B,Q]=uH.useState(null),{data:X=[]}=jG($),z=z9($).data?.supportsArchiving===!0,G=YE($),Y=s2((N)=>w_(N.activity,$,H));if(X.length===0)return T1.jsx(PI,{label:"New chat"});let F=X.find((N)=>N.sessionId===H)?.summary??"New chat",K=Ze(X);function W(N){if(!N)Q(null)}async function q(N){Q(null),await G.mutateAsync(N);let V=E1.getState();if(V.clearAttachments($,N),V.clearPreviewsForSession($,N),H===N)Z(null)}return T1.jsxs(n7,{onOpenChange:W,children:[T1.jsx(o7,{render:T1.jsxs(C0,{className:"group",variant:"ghost",size:"sm",children:[T1.jsx("span",{className:"max-w-64 truncate",children:F}),Y?T1.jsx(E4,{className:"size-4!",stroke:2}):T1.jsx(CY,{className:"text-muted-foreground group-hover:text-foreground",stroke:1.75})]})}),T1.jsxs(s7,{align:"start",className:"flex max-h-100 w-max max-w-72 min-w-40 flex-col overflow-hidden",children:[T1.jsxs(kH,{className:"shrink-0 gap-1 font-medium text-muted-foreground! **:text-muted-foreground!",onClick:()=>Z(null),children:[T1.jsx(MI,{size:16,stroke:1.75}),"New chat"]}),K.length>0&&T1.jsxs(T1.Fragment,{children:[T1.jsx(FS,{className:"shrink-0"}),T1.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((N)=>T1.jsxs(t7,{children:[T1.jsx(JY,{children:N.label}),N.sessions.map((V)=>T1.jsx(et,{session:V,active:H===V.sessionId,canArchive:z,confirmingArchive:B===V.sessionId,onSelect:Z,onArchive:q,onRequestArchive:Q,workspaceId:$},V.sessionId))]},N.key))})]})]})]})}var dx=O(g(),1);function v1(){}function wY(){}function OI($,J){let Z=J||{};return($[$.length-1]===""?[...$,""]:$).join((Z.padRight?" ":"")+","+(Z.padLeft===!1?"":" ")).trim()}var Be=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Qe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xe={};function EY($,J){return((J||Xe).jsx?Qe:Be).test($)}var ze=/[ \t\n\f\r]/g;function FN($){return typeof $==="object"?$.type==="text"?jI($.value):!1:jI($)}function jI($){return $.replace(ze,"")===""}class g3{constructor($,J,Z){if(this.normal=J,this.property=$,Z)this.space=Z}}g3.prototype.normal={};g3.prototype.property={};g3.prototype.space=void 0;function KN($,J){let Z={},H={};for(let B of $)Object.assign(Z,B.property),Object.assign(H,B.normal);return new g3(Z,H,J)}function cH($){return $.toLowerCase()}class P2{constructor($,J){this.attribute=J,this.property=$}}P2.prototype.attribute="";P2.prototype.booleanish=!1;P2.prototype.boolean=!1;P2.prototype.commaOrSpaceSeparated=!1;P2.prototype.commaSeparated=!1;P2.prototype.defined=!1;P2.prototype.mustUseProperty=!1;P2.prototype.number=!1;P2.prototype.overloadedBoolean=!1;P2.prototype.property="";P2.prototype.spaceSeparated=!1;P2.prototype.space=void 0;var dH={};_4(dH,{spaceSeparated:()=>t1,overloadedBoolean:()=>SY,number:()=>_0,commaSeparated:()=>f3,commaOrSpaceSeparated:()=>A4,booleanish:()=>g5,boolean:()=>z1});var Ge=0,z1=z6(),g5=z6(),SY=z6(),_0=z6(),t1=z6(),f3=z6(),A4=z6();function z6(){return 2**++Ge}var WN=Object.keys(dH);class zJ extends P2{constructor($,J,Z,H){let B=-1;super($,J);if(TI(this,"space",H),typeof Z==="number")while(++B<WN.length){let Q=WN[B];TI(this,WN[B],(Z&dH[Q])===dH[Q])}}}zJ.prototype.defined=!0;function TI($,J,Z){if(Z)$[J]=Z}function Q8($){let J={},Z={};for(let[H,B]of Object.entries($.properties)){let Q=new zJ(H,$.transform($.attributes||{},H),B,$.space);if($.mustUseProperty&&$.mustUseProperty.includes(H))Q.mustUseProperty=!0;J[H]=Q,Z[cH(H)]=H,Z[cH(Q.attribute)]=H}return new g3(J,Z,$.space)}var qN=Q8({properties:{ariaActiveDescendant:null,ariaAtomic:g5,ariaAutoComplete:null,ariaBusy:g5,ariaChecked:g5,ariaColCount:_0,ariaColIndex:_0,ariaColSpan:_0,ariaControls:t1,ariaCurrent:null,ariaDescribedBy:t1,ariaDetails:null,ariaDisabled:g5,ariaDropEffect:t1,ariaErrorMessage:null,ariaExpanded:g5,ariaFlowTo:t1,ariaGrabbed:g5,ariaHasPopup:null,ariaHidden:g5,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:t1,ariaLevel:_0,ariaLive:null,ariaModal:g5,ariaMultiLine:g5,ariaMultiSelectable:g5,ariaOrientation:null,ariaOwns:t1,ariaPlaceholder:null,ariaPosInSet:_0,ariaPressed:g5,ariaReadOnly:g5,ariaRelevant:null,ariaRequired:g5,ariaRoleDescription:t1,ariaRowCount:_0,ariaRowIndex:_0,ariaRowSpan:_0,ariaSelected:g5,ariaSetSize:_0,ariaSort:null,ariaValueMax:_0,ariaValueMin:_0,ariaValueNow:_0,ariaValueText:null,role:null},transform($,J){return J==="role"?J:"aria-"+J.slice(4).toLowerCase()}});function IY($,J){return J in $?$[J]:J}function RY($,J){return IY($,J.toLowerCase())}var CI=Q8({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:f3,acceptCharset:t1,accessKey:t1,action:null,allow:null,allowFullScreen:z1,allowPaymentRequest:z1,allowUserMedia:z1,alt:null,as:null,async:z1,autoCapitalize:null,autoComplete:t1,autoFocus:z1,autoPlay:z1,blocking:t1,capture:null,charSet:null,checked:z1,cite:null,className:t1,cols:_0,colSpan:null,content:null,contentEditable:g5,controls:z1,controlsList:t1,coords:_0|f3,crossOrigin:null,data:null,dateTime:null,decoding:null,default:z1,defer:z1,dir:null,dirName:null,disabled:z1,download:SY,draggable:g5,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:z1,formTarget:null,headers:t1,height:_0,hidden:SY,high:_0,href:null,hrefLang:null,htmlFor:t1,httpEquiv:t1,id:null,imageSizes:null,imageSrcSet:null,inert:z1,inputMode:null,integrity:null,is:null,isMap:z1,itemId:null,itemProp:t1,itemRef:t1,itemScope:z1,itemType:t1,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:z1,low:_0,manifest:null,max:null,maxLength:_0,media:null,method:null,min:null,minLength:_0,multiple:z1,muted:z1,name:null,nonce:null,noModule:z1,noValidate:z1,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:z1,optimum:_0,pattern:null,ping:t1,placeholder:null,playsInline:z1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:z1,referrerPolicy:null,rel:t1,required:z1,reversed:z1,rows:_0,rowSpan:_0,sandbox:t1,scope:null,scoped:z1,seamless:z1,selected:z1,shadowRootClonable:z1,shadowRootDelegatesFocus:z1,shadowRootMode:null,shape:null,size:_0,sizes:null,slot:null,span:_0,spellCheck:g5,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:z1,useMap:null,value:g5,width:_0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:t1,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:z1,declare:z1,event:null,face:null,frame:null,frameBorder:null,hSpace:_0,leftMargin:_0,link:null,longDesc:null,lowSrc:null,marginHeight:_0,marginWidth:_0,noResize:z1,noHref:z1,noShade:z1,noWrap:z1,object:null,profile:null,prompt:null,rev:null,rightMargin:_0,rules:null,scheme:null,scrolling:g5,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:z1,disableRemotePlayback:z1,prefix:null,property:null,results:_0,security:null,unselectable:null},space:"html",transform:RY});var wI=Q8({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:A4,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:t1,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:z1,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:f3,g2:f3,glyphName:f3,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:A4,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:t1,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_0,pointsAtY:_0,pointsAtZ:_0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:A4,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:A4,rev:A4,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:A4,requiredFeatures:A4,requiredFonts:A4,requiredFormats:A4,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:A4,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:A4,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:A4,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:IY});var NN=Q8({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform($,J){return"xlink:"+J.slice(5).toLowerCase()}});var LN=Q8({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:RY});var VN=Q8({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform($,J){return"xml:"+J.slice(3).toLowerCase()}});var AN={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 Ye=/[A-Z]/g,EI=/-[a-z]/g,Ue=/^data[-\w.:]+$/i;function DN($,J){let Z=cH(J),H=J,B=P2;if(Z in $.normal)return $.property[$.normal[Z]];if(Z.length>4&&Z.slice(0,4)==="data"&&Ue.test(J)){if(J.charAt(4)==="-"){let Q=J.slice(5).replace(EI,Ke);H="data"+Q.charAt(0).toUpperCase()+Q.slice(1)}else{let Q=J.slice(4);if(!EI.test(Q)){let X=Q.replace(Ye,Fe);if(X.charAt(0)!=="-")X="-"+X;J="data"+X}}B=zJ}return new B(H,J)}function Fe($){return"-"+$.toLowerCase()}function Ke($){return $.charAt(1).toUpperCase()}var SI=KN([qN,CI,NN,LN,VN],"html"),kY=KN([qN,wI,NN,LN,VN],"svg");function II($){return $.join(" ").trim()}var rI=O(cI(),1);var bY=dI("end"),GJ=dI("start");function dI($){return J;function J(Z){let H=Z&&Z.position&&Z.position[$]||{};if(typeof H.line==="number"&&H.line>0&&typeof H.column==="number"&&H.column>0)return{line:H.line,column:H.column,offset:typeof H.offset==="number"&&H.offset>-1?H.offset:void 0}}}function _N($){let J=GJ($),Z=bY($);if(J&&Z)return{start:J,end:Z}}function m3($){if(!$||typeof $!=="object")return"";if("position"in $||"type"in $)return lI($.position);if("start"in $||"end"in $)return lI($);if("line"in $||"column"in $)return ON($);return""}function ON($){return iI($&&$.line)+":"+iI($&&$.column)}function lI($){return ON($&&$.start)+"-"+ON($&&$.end)}function iI($){return $&&typeof $==="number"?$:1}class s5 extends Error{constructor($,J,Z){super();if(typeof J==="string")Z=J,J=void 0;let H="",B={},Q=!1;if(J)if("line"in J&&"column"in J)B={place:J};else if("start"in J&&"end"in J)B={place:J};else if("type"in J)B={ancestors:[J],place:J.position};else B={...J};if(typeof $==="string")H=$;else if(!B.cause&&$)Q=!0,H=$.message,B.cause=$;if(!B.ruleId&&!B.source&&typeof Z==="string"){let z=Z.indexOf(":");if(z===-1)B.ruleId=Z;else B.source=Z.slice(0,z),B.ruleId=Z.slice(z+1)}if(!B.place&&B.ancestors&&B.ancestors){let z=B.ancestors[B.ancestors.length-1];if(z)B.place=z.position}let X=B.place&&"start"in B.place?B.place.start:B.place;this.ancestors=B.ancestors||void 0,this.cause=B.cause||void 0,this.column=X?X.column:void 0,this.fatal=void 0,this.file="",this.message=H,this.line=X?X.line:void 0,this.name=m3(B.place)||"1:1",this.place=B.place||void 0,this.reason=this.message,this.ruleId=B.ruleId||void 0,this.source=B.source||void 0,this.stack=Q&&B.cause&&typeof B.cause.stack==="string"?B.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}s5.prototype.file="";s5.prototype.name="";s5.prototype.reason="";s5.prototype.message="";s5.prototype.stack="";s5.prototype.column=void 0;s5.prototype.line=void 0;s5.prototype.ancestors=void 0;s5.prototype.cause=void 0;s5.prototype.fatal=void 0;s5.prototype.place=void 0;s5.prototype.ruleId=void 0;s5.prototype.source=void 0;var jN={}.hasOwnProperty,ge=new Map,fe=/[A-Z]/g,me=new Set(["table","tbody","thead","tfoot","tr"]),pe=new Set(["td","th"]),aI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function TN($,J){if(!J||J.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let Z=J.filePath||void 0,H;if(J.development){if(typeof J.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");H=ne(Z,J.jsxDEV)}else{if(typeof J.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof J.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");H=ae(Z,J.jsx,J.jsxs)}let B={Fragment:J.Fragment,ancestors:[],components:J.components||{},create:H,elementAttributeNameCase:J.elementAttributeNameCase||"react",evaluater:J.createEvaluater?J.createEvaluater():void 0,filePath:Z,ignoreInvalidStyle:J.ignoreInvalidStyle||!1,passKeys:J.passKeys!==!1,passNode:J.passNode||!1,schema:J.space==="svg"?kY:SI,stylePropertyNameCase:J.stylePropertyNameCase||"dom",tableCellAlignToStyle:J.tableCellAlignToStyle!==!1},Q=nI(B,$,void 0);if(Q&&typeof Q!=="string")return Q;return B.create($,B.Fragment,{children:Q||void 0},void 0)}function nI($,J,Z){if(J.type==="element")return ue($,J,Z);if(J.type==="mdxFlowExpression"||J.type==="mdxTextExpression")return ce($,J);if(J.type==="mdxJsxFlowElement"||J.type==="mdxJsxTextElement")return le($,J,Z);if(J.type==="mdxjsEsm")return de($,J);if(J.type==="root")return ie($,J,Z);if(J.type==="text")return re($,J)}function ue($,J,Z){let H=$.schema,B=H;if(J.tagName.toLowerCase()==="svg"&&H.space==="html")B=kY,$.schema=B;$.ancestors.push(J);let Q=sI($,J.tagName,!1),X=oe($,J),z=wN($,J);if(me.has(J.tagName))z=z.filter(function(G){return typeof G==="string"?!FN(G):!0});return oI($,X,Q,J),CN(X,z),$.ancestors.pop(),$.schema=H,$.create(J,Q,X,Z)}function ce($,J){if(J.data&&J.data.estree&&$.evaluater){let H=J.data.estree.body[0];return v1(H.type==="ExpressionStatement"),$.evaluater.evaluateExpression(H.expression)}iH($,J.position)}function de($,J){if(J.data&&J.data.estree&&$.evaluater)return $.evaluater.evaluateProgram(J.data.estree);iH($,J.position)}function le($,J,Z){let H=$.schema,B=H;if(J.name==="svg"&&H.space==="html")B=kY,$.schema=B;$.ancestors.push(J);let Q=J.name===null?$.Fragment:sI($,J.name,!0),X=se($,J),z=wN($,J);return oI($,X,Q,J),CN(X,z),$.ancestors.pop(),$.schema=H,$.create(J,Q,X,Z)}function ie($,J,Z){let H={};return CN(H,wN($,J)),$.create(J,$.Fragment,H,Z)}function re($,J){return J.value}function oI($,J,Z,H){if(typeof Z!=="string"&&Z!==$.Fragment&&$.passNode)J.node=H}function CN($,J){if(J.length>0){let Z=J.length>1?J:J[0];if(Z)$.children=Z}}function ae($,J,Z){return H;function H(B,Q,X,z){let Y=Array.isArray(X.children)?Z:J;return z?Y(Q,X,z):Y(Q,X)}}function ne($,J){return Z;function Z(H,B,Q,X){let z=Array.isArray(Q.children),G=GJ(H);return J(B,Q,X,z,{columnNumber:G?G.column-1:void 0,fileName:$,lineNumber:G?G.line:void 0},void 0)}}function oe($,J){let Z={},H,B;for(B in J.properties)if(B!=="children"&&jN.call(J.properties,B)){let Q=te($,B,J.properties[B]);if(Q){let[X,z]=Q;if($.tableCellAlignToStyle&&X==="align"&&typeof z==="string"&&pe.has(J.tagName))H=z;else Z[X]=z}}if(H){let Q=Z.style||(Z.style={});Q[$.stylePropertyNameCase==="css"?"text-align":"textAlign"]=H}return Z}function se($,J){let Z={};for(let H of J.attributes)if(H.type==="mdxJsxExpressionAttribute")if(H.data&&H.data.estree&&$.evaluater){let Q=H.data.estree.body[0];v1(Q.type==="ExpressionStatement");let X=Q.expression;v1(X.type==="ObjectExpression");let z=X.properties[0];v1(z.type==="SpreadElement"),Object.assign(Z,$.evaluater.evaluateExpression(z.argument))}else iH($,J.position);else{let B=H.name,Q;if(H.value&&typeof H.value==="object")if(H.value.data&&H.value.data.estree&&$.evaluater){let z=H.value.data.estree.body[0];v1(z.type==="ExpressionStatement"),Q=$.evaluater.evaluateExpression(z.expression)}else iH($,J.position);else Q=H.value===null?!0:H.value;Z[B]=Q}return Z}function wN($,J){let Z=[],H=-1,B=$.passKeys?new Map:ge;while(++H<J.children.length){let Q=J.children[H],X;if($.passKeys){let G=Q.type==="element"?Q.tagName:Q.type==="mdxJsxFlowElement"||Q.type==="mdxJsxTextElement"?Q.name:void 0;if(G){let Y=B.get(G)||0;X=G+"-"+Y,B.set(G,Y+1)}}let z=nI($,Q,X);if(z!==void 0)Z.push(z)}return Z}function te($,J,Z){let H=DN($.schema,J);if(Z===null||Z===void 0||typeof Z==="number"&&Number.isNaN(Z))return;if(Array.isArray(Z))Z=H.commaSeparated?OI(Z):II(Z);if(H.property==="style"){let B=typeof Z==="object"?Z:ee($,String(Z));if($.stylePropertyNameCase==="css")B=$00(B);return["style",B]}return[$.elementAttributeNameCase==="react"&&H.space?AN[H.property]||H.property:H.attribute,Z]}function ee($,J){try{return rI.default(J,{reactCompat:!0})}catch(Z){if($.ignoreInvalidStyle)return{};let H=Z,B=new s5("Cannot parse `style` attribute",{ancestors:$.ancestors,cause:H,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw B.file=$.filePath||void 0,B.url=aI+"#cannot-parse-style-attribute",B}}function sI($,J,Z){let H;if(!Z)H={type:"Literal",value:J};else if(J.includes(".")){let B=J.split("."),Q=-1,X;while(++Q<B.length){let z=EY(B[Q])?{type:"Identifier",name:B[Q]}:{type:"Literal",value:B[Q]};X=X?{type:"MemberExpression",object:X,property:z,computed:Boolean(Q&&z.type==="Literal"),optional:!1}:z}v1(X,"always a result"),H=X}else H=EY(J)&&!/^[a-z]/.test(J)?{type:"Identifier",name:J}:{type:"Literal",value:J};if(H.type==="Literal"){let B=H.value;return jN.call($.components,B)?$.components[B]:B}if($.evaluater)return $.evaluater.evaluateExpression(H);iH($)}function iH($,J){let Z=new s5("Cannot handle MDX estrees without `createEvaluater`",{ancestors:$.ancestors,place:J,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw Z.file=$.filePath||void 0,Z.url=aI+"#cannot-handle-mdx-estrees-without-createevaluater",Z}function $00($){let J={},Z;for(Z in $)if(jN.call($,Z))J[J00(Z)]=$[Z];return J}function J00($){let J=$.replace(fe,Z00);if(J.slice(0,3)==="ms-")J="-"+J;return J}function Z00($){return"-"+$.toLowerCase()}var rH={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 LJ=O(c(),1),Mk=O(g(),1);var H00={};function Y6($,J){let Z=J||H00,H=typeof Z.includeImageAlt==="boolean"?Z.includeImageAlt:!0,B=typeof Z.includeHtml==="boolean"?Z.includeHtml:!0;return eI($,H,B)}function eI($,J,Z){if(B00($)){if("value"in $)return $.type==="html"&&!Z?"":$.value;if(J&&"alt"in $&&$.alt)return $.alt;if("children"in $)return tI($.children,J,Z)}if(Array.isArray($))return tI($,J,Z);return""}function tI($,J,Z){let H=[],B=-1;while(++B<$.length)H[B]=eI($[B],J,Z);return H.join("")}function B00($){return Boolean($&&typeof $==="object")}var $R=document.createElement("i");function YJ($){let J="&"+$+";";$R.innerHTML=J;let Z=$R.textContent;if(Z.charCodeAt(Z.length-1)===59&&$!=="semi")return!1;return Z===J?!1:Z}function c5($,J,Z,H){let B=$.length,Q=0,X;if(J<0)J=-J>B?0:B+J;else J=J>B?B:J;if(Z=Z>0?Z:0,H.length<1e4)X=Array.from(H),X.unshift(J,Z),$.splice(...X);else{if(Z)$.splice(J,Z);while(Q<H.length)X=H.slice(Q,Q+1e4),X.unshift(J,0),$.splice(...X),Q+=1e4,J+=1e4}}function $4($,J){if($.length>0)return c5($,$.length,0,J),$;return J}var JR={}.hasOwnProperty;function yY($){let J={},Z=-1;while(++Z<$.length)Q00(J,$[Z]);return J}function Q00($,J){let Z;for(Z in J){let B=(JR.call($,Z)?$[Z]:void 0)||($[Z]={}),Q=J[Z],X;if(Q)for(X in Q){if(!JR.call(B,X))B[X]=[];let z=Q[X];X00(B[X],Array.isArray(z)?z:z?[z]:[])}}}function X00($,J){let Z=-1,H=[];while(++Z<J.length)(J[Z].add==="after"?$:H).push(J[Z]);c5($,0,0,H)}function hY($,J){let Z=Number.parseInt($,J);if(Z<9||Z===11||Z>13&&Z<32||Z>126&&Z<160||Z>55295&&Z<57344||Z>64975&&Z<65008||(Z&65535)===65535||(Z&65535)===65534||Z>1114111)return"�";return String.fromCodePoint(Z)}function f2($){return $.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Q2=p3(/[A-Za-z]/),f5=p3(/[\dA-Za-z]/),ZR=p3(/[#-'*+\--9=?A-Z^-~]/);function U6($){return $!==null&&($<32||$===127)}var aH=p3(/\d/),HR=p3(/[\dA-Fa-f]/),BR=p3(/[!-/:-@[-`{-~]/);function h0($){return $!==null&&$<-2}function P1($){return $!==null&&($<0||$===32)}function a0($){return $===-2||$===-1||$===32}var F6=p3(/\p{P}|\p{S}/u),F9=p3(/\s/);function p3($){return J;function J(Z){return Z!==null&&Z>-1&&$.test(String.fromCharCode(Z))}}function X8($){let J=[],Z=-1,H=0,B=0;while(++Z<$.length){let Q=$.charCodeAt(Z),X="";if(Q===37&&f5($.charCodeAt(Z+1))&&f5($.charCodeAt(Z+2)))B=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(Z+1);if(Q<56320&&z>56319&&z<57344)X=String.fromCharCode(Q,z),B=1;else X="�"}else X=String.fromCharCode(Q);if(X)J.push($.slice(H,Z),encodeURIComponent(X)),H=Z+B+1,X="";if(B)Z+=B,B=0}return J.join("")+$.slice(H)}function i0($,J,Z,H){let B=H?H-1:Number.POSITIVE_INFINITY,Q=0;return X;function X(G){if(a0(G))return $.enter(Z),z(G);return J(G)}function z(G){if(a0(G)&&Q++<B)return $.consume(G),z;return $.exit(Z),J(G)}}var QR={tokenize:z00};function z00($){let J=$.attempt(this.parser.constructs.contentInitial,H,B),Z;return J;function H(z){if(z===null){$.consume(z);return}return $.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),i0($,J,"linePrefix")}function B(z){return $.enter("paragraph"),Q(z)}function Q(z){let G=$.enter("chunkText",{contentType:"text",previous:Z});if(Z)Z.next=G;return Z=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 zR={tokenize:G00},XR={tokenize:Y00};function G00($){let J=this,Z=[],H=0,B,Q,X;return z;function z(M){if(H<Z.length){let _=Z[H];return J.containerState=_[1],$.attempt(_[0].continuation,G,Y)(M)}return Y(M)}function G(M){if(H++,J.containerState._closeFlow){if(J.containerState._closeFlow=void 0,B)A();let _=J.events.length,P=_,D;while(P--)if(J.events[P][0]==="exit"&&J.events[P][1].type==="chunkFlow"){D=J.events[P][1].end;break}L(H);let w=_;while(w<J.events.length)J.events[w][1].end={...D},w++;return c5(J.events,P+1,0,J.events.slice(_)),J.events.length=w,Y(M)}return z(M)}function Y(M){if(H===Z.length){if(!B)return K(M);if(B.currentConstruct&&B.currentConstruct.concrete)return q(M);J.interrupt=Boolean(B.currentConstruct&&!B._gfmTableDynamicInterruptHack)}return J.containerState={},$.check(XR,U,F)(M)}function U(M){if(B)A();return L(H),K(M)}function F(M){return J.parser.lazy[J.now().line]=H!==Z.length,X=J.now().offset,q(M)}function K(M){return J.containerState={},$.attempt(XR,W,q)(M)}function W(M){return H++,Z.push([J.currentConstruct,J.containerState]),K(M)}function q(M){if(M===null){if(B)A();L(0),$.consume(M);return}return B=B||J.parser.flow(J.now()),$.enter("chunkFlow",{_tokenizer:B,contentType:"flow",previous:Q}),N(M)}function N(M){if(M===null){V($.exit("chunkFlow"),!0),L(0),$.consume(M);return}if(h0(M))return $.consume(M),V($.exit("chunkFlow")),H=0,J.interrupt=void 0,z;return $.consume(M),N}function V(M,_){let P=J.sliceStream(M);if(_)P.push(null);if(M.previous=Q,Q)Q.next=M;if(Q=M,B.defineSkip(M.start),B.write(P),J.parser.lazy[M.start.line]){let D=B.events.length;while(D--)if(B.events[D][1].start.offset<X&&(!B.events[D][1].end||B.events[D][1].end.offset>X))return;let w=J.events.length,R=w,b,E;while(R--)if(J.events[R][0]==="exit"&&J.events[R][1].type==="chunkFlow"){if(b){E=J.events[R][1].end;break}b=!0}L(H),D=w;while(D<J.events.length)J.events[D][1].end={...E},D++;c5(J.events,R+1,0,J.events.slice(w)),J.events.length=D}}function L(M){let _=Z.length;while(_-- >M){let P=Z[_];J.containerState=P[1],P[0].exit.call(J,$)}Z.length=M}function A(){B.write([null]),Q=void 0,B=void 0,J.containerState._closeFlow=void 0}}function Y00($,J,Z){return i0($,$.attempt(this.parser.constructs.document,J,Z),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function h9($){if($===null||P1($)||F9($))return 1;if(F6($))return 2}function u3($,J,Z){let H=[],B=-1;while(++B<$.length){let Q=$[B].resolveAll;if(Q&&!H.includes(Q))J=Q(J,Z),H.push(Q)}return J}var nH={name:"attention",resolveAll:U00,tokenize:F00};function U00($,J){let Z=-1,H,B,Q,X,z,G,Y,U;while(++Z<$.length)if($[Z][0]==="enter"&&$[Z][1].type==="attentionSequence"&&$[Z][1]._close){H=Z;while(H--)if($[H][0]==="exit"&&$[H][1].type==="attentionSequence"&&$[H][1]._open&&J.sliceSerialize($[H][1]).charCodeAt(0)===J.sliceSerialize($[Z][1]).charCodeAt(0)){if(($[H][1]._close||$[Z][1]._open)&&($[Z][1].end.offset-$[Z][1].start.offset)%3&&!(($[H][1].end.offset-$[H][1].start.offset+$[Z][1].end.offset-$[Z][1].start.offset)%3))continue;G=$[H][1].end.offset-$[H][1].start.offset>1&&$[Z][1].end.offset-$[Z][1].start.offset>1?2:1;let F={...$[H][1].end},K={...$[Z][1].start};if(GR(F,-G),GR(K,G),X={type:G>1?"strongSequence":"emphasisSequence",start:F,end:{...$[H][1].end}},z={type:G>1?"strongSequence":"emphasisSequence",start:{...$[Z][1].start},end:K},Q={type:G>1?"strongText":"emphasisText",start:{...$[H][1].end},end:{...$[Z][1].start}},B={type:G>1?"strong":"emphasis",start:{...X.start},end:{...z.end}},$[H][1].end={...X.start},$[Z][1].start={...z.end},Y=[],$[H][1].end.offset-$[H][1].start.offset)Y=$4(Y,[["enter",$[H][1],J],["exit",$[H][1],J]]);if(Y=$4(Y,[["enter",B,J],["enter",X,J],["exit",X,J],["enter",Q,J]]),Y=$4(Y,u3(J.parser.constructs.insideSpan.null,$.slice(H+1,Z),J)),Y=$4(Y,[["exit",Q,J],["enter",z,J],["exit",z,J],["exit",B,J]]),$[Z][1].end.offset-$[Z][1].start.offset)U=2,Y=$4(Y,[["enter",$[Z][1],J],["exit",$[Z][1],J]]);else U=0;c5($,H-1,Z-H+3,Y),Z=H+Y.length-U-2;break}}Z=-1;while(++Z<$.length)if($[Z][1].type==="attentionSequence")$[Z][1].type="data";return $}function F00($,J){let Z=this.parser.constructs.attentionMarkers.null,H=this.previous,B=h9(H),Q;return X;function X(G){return Q=G,$.enter("attentionSequence"),z(G)}function z(G){if(G===Q)return $.consume(G),z;let Y=$.exit("attentionSequence"),U=h9(G),F=!U||U===2&&B||Z.includes(G),K=!B||B===2&&U||Z.includes(H);return Y._open=Boolean(Q===42?F:F&&(B||!K)),Y._close=Boolean(Q===42?K:K&&(U||!F)),J(G)}}function GR($,J){$.column+=J,$.offset+=J,$._bufferIndex+=J}var EN={name:"autolink",tokenize:K00};function K00($,J,Z){let H=0;return B;function B(W){return $.enter("autolink"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.enter("autolinkProtocol"),Q}function Q(W){if(Q2(W))return $.consume(W),X;if(W===64)return Z(W);return Y(W)}function X(W){if(W===43||W===45||W===46||f5(W))return H=1,z(W);return Y(W)}function z(W){if(W===58)return $.consume(W),H=0,G;if((W===43||W===45||W===46||f5(W))&&H++<32)return $.consume(W),z;return H=0,Y(W)}function G(W){if(W===62)return $.exit("autolinkProtocol"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),J;if(W===null||W===32||W===60||U6(W))return Z(W);return $.consume(W),G}function Y(W){if(W===64)return $.consume(W),U;if(ZR(W))return $.consume(W),Y;return Z(W)}function U(W){return f5(W)?F(W):Z(W)}function F(W){if(W===46)return $.consume(W),H=0,U;if(W===62)return $.exit("autolinkProtocol").type="autolinkEmail",$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),J;return K(W)}function K(W){if((W===45||f5(W))&&H++<63){let q=W===45?K:F;return $.consume(W),q}return Z(W)}}var K9={partial:!0,tokenize:W00};function W00($,J,Z){return H;function H(Q){return a0(Q)?i0($,B,"linePrefix")(Q):B(Q)}function B(Q){return Q===null||h0(Q)?J(Q):Z(Q)}}var xY={continuation:{tokenize:N00},exit:L00,name:"blockQuote",tokenize:q00};function q00($,J,Z){let H=this;return B;function B(X){if(X===62){let z=H.containerState;if(!z.open)$.enter("blockQuote",{_container:!0}),z.open=!0;return $.enter("blockQuotePrefix"),$.enter("blockQuoteMarker"),$.consume(X),$.exit("blockQuoteMarker"),Q}return Z(X)}function Q(X){if(a0(X))return $.enter("blockQuotePrefixWhitespace"),$.consume(X),$.exit("blockQuotePrefixWhitespace"),$.exit("blockQuotePrefix"),J;return $.exit("blockQuotePrefix"),J(X)}}function N00($,J,Z){let H=this;return B;function B(X){if(a0(X))return i0($,Q,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X);return Q(X)}function Q(X){return $.attempt(xY,J,Z)(X)}}function L00($){$.exit("blockQuote")}var vY={name:"characterEscape",tokenize:V00};function V00($,J,Z){return H;function H(Q){return $.enter("characterEscape"),$.enter("escapeMarker"),$.consume(Q),$.exit("escapeMarker"),B}function B(Q){if(BR(Q))return $.enter("characterEscapeValue"),$.consume(Q),$.exit("characterEscapeValue"),$.exit("characterEscape"),J;return Z(Q)}}var gY={name:"characterReference",tokenize:A00};function A00($,J,Z){let H=this,B=0,Q,X;return z;function z(F){return $.enter("characterReference"),$.enter("characterReferenceMarker"),$.consume(F),$.exit("characterReferenceMarker"),G}function G(F){if(F===35)return $.enter("characterReferenceMarkerNumeric"),$.consume(F),$.exit("characterReferenceMarkerNumeric"),Y;return $.enter("characterReferenceValue"),Q=31,X=f5,U(F)}function Y(F){if(F===88||F===120)return $.enter("characterReferenceMarkerHexadecimal"),$.consume(F),$.exit("characterReferenceMarkerHexadecimal"),$.enter("characterReferenceValue"),Q=6,X=HR,U;return $.enter("characterReferenceValue"),Q=7,X=aH,U(F)}function U(F){if(F===59&&B){let K=$.exit("characterReferenceValue");if(X===f5&&!YJ(H.sliceSerialize(K)))return Z(F);return $.enter("characterReferenceMarker"),$.consume(F),$.exit("characterReferenceMarker"),$.exit("characterReference"),J}if(X(F)&&B++<Q)return $.consume(F),U;return Z(F)}}var YR={partial:!0,tokenize:M00},fY={concrete:!0,name:"codeFenced",tokenize:D00};function D00($,J,Z){let H=this,B={partial:!0,tokenize:P},Q=0,X=0,z;return G;function G(D){return Y(D)}function Y(D){let w=H.events[H.events.length-1];return Q=w&&w[1].type==="linePrefix"?w[2].sliceSerialize(w[1],!0).length:0,z=D,$.enter("codeFenced"),$.enter("codeFencedFence"),$.enter("codeFencedFenceSequence"),U(D)}function U(D){if(D===z)return X++,$.consume(D),U;if(X<3)return Z(D);return $.exit("codeFencedFenceSequence"),a0(D)?i0($,F,"whitespace")(D):F(D)}function F(D){if(D===null||h0(D))return $.exit("codeFencedFence"),H.interrupt?J(D):$.check(YR,N,_)(D);return $.enter("codeFencedFenceInfo"),$.enter("chunkString",{contentType:"string"}),K(D)}function K(D){if(D===null||h0(D))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),F(D);if(a0(D))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),i0($,W,"whitespace")(D);if(D===96&&D===z)return Z(D);return $.consume(D),K}function W(D){if(D===null||h0(D))return F(D);return $.enter("codeFencedFenceMeta"),$.enter("chunkString",{contentType:"string"}),q(D)}function q(D){if(D===null||h0(D))return $.exit("chunkString"),$.exit("codeFencedFenceMeta"),F(D);if(D===96&&D===z)return Z(D);return $.consume(D),q}function N(D){return $.attempt(B,_,V)(D)}function V(D){return $.enter("lineEnding"),$.consume(D),$.exit("lineEnding"),L}function L(D){return Q>0&&a0(D)?i0($,A,"linePrefix",Q+1)(D):A(D)}function A(D){if(D===null||h0(D))return $.check(YR,N,_)(D);return $.enter("codeFlowValue"),M(D)}function M(D){if(D===null||h0(D))return $.exit("codeFlowValue"),A(D);return $.consume(D),M}function _(D){return $.exit("codeFenced"),J(D)}function P(D,w,R){let b=0;return E;function E(C){return D.enter("lineEnding"),D.consume(C),D.exit("lineEnding"),x}function x(C){return D.enter("codeFencedFence"),a0(C)?i0(D,I,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):I(C)}function I(C){if(C===z)return D.enter("codeFencedFenceSequence"),S(C);return R(C)}function S(C){if(C===z)return b++,D.consume(C),S;if(b>=X)return D.exit("codeFencedFenceSequence"),a0(C)?i0(D,j,"whitespace")(C):j(C);return R(C)}function j(C){if(C===null||h0(C))return D.exit("codeFencedFence"),w(C);return R(C)}}}function M00($,J,Z){let H=this;return B;function B(X){if(X===null)return Z(X);return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Q}function Q(X){return H.parser.lazy[H.now().line]?Z(X):J(X)}}var oH={name:"codeIndented",tokenize:_00},P00={partial:!0,tokenize:O00};function _00($,J,Z){let H=this;return B;function B(Y){return $.enter("codeIndented"),i0($,Q,"linePrefix",5)(Y)}function Q(Y){let U=H.events[H.events.length-1];return U&&U[1].type==="linePrefix"&&U[2].sliceSerialize(U[1],!0).length>=4?X(Y):Z(Y)}function X(Y){if(Y===null)return G(Y);if(h0(Y))return $.attempt(P00,X,G)(Y);return $.enter("codeFlowValue"),z(Y)}function z(Y){if(Y===null||h0(Y))return $.exit("codeFlowValue"),X(Y);return $.consume(Y),z}function G(Y){return $.exit("codeIndented"),J(Y)}}function O00($,J,Z){let H=this;return B;function B(X){if(H.parser.lazy[H.now().line])return Z(X);if(h0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),B;return i0($,Q,"linePrefix",5)(X)}function Q(X){let z=H.events[H.events.length-1];return z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4?J(X):h0(X)?B(X):Z(X)}}var SN={name:"codeText",previous:T00,resolve:j00,tokenize:C00};function j00($){let J=$.length-4,Z=3,H,B;if(($[Z][1].type==="lineEnding"||$[Z][1].type==="space")&&($[J][1].type==="lineEnding"||$[J][1].type==="space")){H=Z;while(++H<J)if($[H][1].type==="codeTextData"){$[Z][1].type="codeTextPadding",$[J][1].type="codeTextPadding",Z+=2,J-=2;break}}H=Z-1,J++;while(++H<=J)if(B===void 0){if(H!==J&&$[H][1].type!=="lineEnding")B=H}else if(H===J||$[H][1].type==="lineEnding"){if($[B][1].type="codeTextData",H!==B+2)$[B][1].end=$[H-1][1].end,$.splice(B+2,H-B-2),J-=H-B-2,H=B+2;B=void 0}return $}function T00($){return $!==96||this.events[this.events.length-1][1].type==="characterEscape"}function C00($,J,Z){let H=this,B=0,Q,X;return z;function z(K){return $.enter("codeText"),$.enter("codeTextSequence"),G(K)}function G(K){if(K===96)return $.consume(K),B++,G;return $.exit("codeTextSequence"),Y(K)}function Y(K){if(K===null)return Z(K);if(K===32)return $.enter("space"),$.consume(K),$.exit("space"),Y;if(K===96)return X=$.enter("codeTextSequence"),Q=0,F(K);if(h0(K))return $.enter("lineEnding"),$.consume(K),$.exit("lineEnding"),Y;return $.enter("codeTextData"),U(K)}function U(K){if(K===null||K===32||K===96||h0(K))return $.exit("codeTextData"),Y(K);return $.consume(K),U}function F(K){if(K===96)return $.consume(K),Q++,F;if(Q===B)return $.exit("codeTextSequence"),$.exit("codeText"),J(K);return X.type="codeTextData",U(K)}}class IN{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($,J){let Z=J===null||J===void 0?Number.POSITIVE_INFINITY:J;if(Z<this.left.length)return this.left.slice($,Z);if($>this.left.length)return this.right.slice(this.right.length-Z+this.left.length,this.right.length-$+this.left.length).reverse();return this.left.slice($).concat(this.right.slice(this.right.length-Z+this.left.length).reverse())}splice($,J,Z){let H=J||0;this.setCursor(Math.trunc($));let B=this.right.splice(this.right.length-H,Number.POSITIVE_INFINITY);if(Z)sH(this.left,Z);return B.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),sH(this.left,$)}unshift($){this.setCursor(0),this.right.push($)}unshiftMany($){this.setCursor(0),sH(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 J=this.left.splice($,Number.POSITIVE_INFINITY);sH(this.right,J.reverse())}else{let J=this.right.splice(this.left.length+this.right.length-$,Number.POSITIVE_INFINITY);sH(this.left,J.reverse())}}}function sH($,J){let Z=0;if(J.length<1e4)$.push(...J);else while(Z<J.length)$.push(...J.slice(Z,Z+1e4)),Z+=1e4}function mY($){let J={},Z=-1,H,B,Q,X,z,G,Y,U=new IN($);while(++Z<U.length){while(Z in J)Z=J[Z];if(H=U.get(Z),Z&&H[1].type==="chunkFlow"&&U.get(Z-1)[1].type==="listItemPrefix"){if(G=H[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(H[0]==="enter"){if(H[1].contentType)Object.assign(J,w00(U,Z)),Z=J[Z],Y=!0}else if(H[1]._container){Q=Z,B=void 0;while(Q--)if(X=U.get(Q),X[1].type==="lineEnding"||X[1].type==="lineEndingBlank"){if(X[0]==="enter"){if(B)U.get(B)[1].type="lineEndingBlank";X[1].type="lineEnding",B=Q}}else if(X[1].type==="linePrefix"||X[1].type==="listItemIndent");else break;if(B)H[1].end={...U.get(B)[1].start},z=U.slice(B,Z),z.unshift(H),U.splice(B,Z-B+1,z)}}return c5($,0,Number.POSITIVE_INFINITY,U.slice(0)),!Y}function w00($,J){let Z=$.get(J)[1],H=$.get(J)[2],B=J-1,Q=[],X=Z._tokenizer;if(!X){if(X=H.parser[Z.contentType](Z.start),Z._contentTypeTextTrailing)X._contentTypeTextTrailing=!0}let z=X.events,G=[],Y={},U,F,K=-1,W=Z,q=0,N=0,V=[N];while(W){while($.get(++B)[1]!==W);if(Q.push(B),!W._tokenizer){if(U=H.sliceStream(W),!W.next)U.push(null);if(F)X.defineSkip(W.start);if(W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=!0;if(X.write(U),W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=void 0}F=W,W=W.next}W=Z;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)N=K+1,V.push(N),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 L=z.slice(V[K],V[K+1]),A=Q.pop();G.push([A,A+L.length-1]),$.splice(A,2,L)}G.reverse(),K=-1;while(++K<G.length)Y[q+G[K][0]]=q+G[K][1],q+=G[K][1]-G[K][0]-1;return Y}var RN={resolve:S00,tokenize:I00},E00={partial:!0,tokenize:R00};function S00($){return mY($),$}function I00($,J){let Z;return H;function H(z){return $.enter("content"),Z=$.enter("chunkContent",{contentType:"content"}),B(z)}function B(z){if(z===null)return Q(z);if(h0(z))return $.check(E00,X,Q)(z);return $.consume(z),B}function Q(z){return $.exit("chunkContent"),$.exit("content"),J(z)}function X(z){return $.consume(z),$.exit("chunkContent"),Z.next=$.enter("chunkContent",{contentType:"content",previous:Z}),Z=Z.next,B}}function R00($,J,Z){let H=this;return B;function B(X){return $.exit("chunkContent"),$.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),i0($,Q,"linePrefix")}function Q(X){if(X===null||h0(X))return Z(X);let z=H.events[H.events.length-1];if(!H.parser.constructs.disable.null.includes("codeIndented")&&z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4)return J(X);return $.interrupt(H.parser.constructs.flow,Z,J)(X)}}function pY($,J,Z,H,B,Q,X,z,G){let Y=G||Number.POSITIVE_INFINITY,U=0;return F;function F(L){if(L===60)return $.enter(H),$.enter(B),$.enter(Q),$.consume(L),$.exit(Q),K;if(L===null||L===32||L===41||U6(L))return Z(L);return $.enter(H),$.enter(X),$.enter(z),$.enter("chunkString",{contentType:"string"}),N(L)}function K(L){if(L===62)return $.enter(Q),$.consume(L),$.exit(Q),$.exit(B),$.exit(H),J;return $.enter(z),$.enter("chunkString",{contentType:"string"}),W(L)}function W(L){if(L===62)return $.exit("chunkString"),$.exit(z),K(L);if(L===null||L===60||h0(L))return Z(L);return $.consume(L),L===92?q:W}function q(L){if(L===60||L===62||L===92)return $.consume(L),W;return W(L)}function N(L){if(!U&&(L===null||L===41||P1(L)))return $.exit("chunkString"),$.exit(z),$.exit(X),$.exit(H),J(L);if(U<Y&&L===40)return $.consume(L),U++,N;if(L===41)return $.consume(L),U--,N;if(L===null||L===32||L===40||U6(L))return Z(L);return $.consume(L),L===92?V:N}function V(L){if(L===40||L===41||L===92)return $.consume(L),N;return N(L)}}function uY($,J,Z,H,B,Q){let X=this,z=0,G;return Y;function Y(W){return $.enter(H),$.enter(B),$.consume(W),$.exit(B),$.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 Z(W);if(W===93)return $.exit(Q),$.enter(B),$.consume(W),$.exit(B),$.exit(H),J;if(h0(W))return $.enter("lineEnding"),$.consume(W),$.exit("lineEnding"),U;return $.enter("chunkString",{contentType:"string"}),F(W)}function F(W){if(W===null||W===91||W===93||h0(W)||z++>999)return $.exit("chunkString"),U(W);if($.consume(W),!G)G=!a0(W);return W===92?K:F}function K(W){if(W===91||W===92||W===93)return $.consume(W),z++,F;return F(W)}}function cY($,J,Z,H,B,Q){let X;return z;function z(K){if(K===34||K===39||K===40)return $.enter(H),$.enter(B),$.consume(K),$.exit(B),X=K===40?41:K,G;return Z(K)}function G(K){if(K===X)return $.enter(B),$.consume(K),$.exit(B),$.exit(H),J;return $.enter(Q),Y(K)}function Y(K){if(K===X)return $.exit(Q),G(X);if(K===null)return Z(K);if(h0(K))return $.enter("lineEnding"),$.consume(K),$.exit("lineEnding"),i0($,Y,"linePrefix");return $.enter("chunkString",{contentType:"string"}),U(K)}function U(K){if(K===X||K===null||h0(K))return $.exit("chunkString"),Y(K);return $.consume(K),K===92?F:U}function F(K){if(K===X||K===92)return $.consume(K),U;return U(K)}}function K6($,J){let Z;return H;function H(B){if(h0(B))return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),Z=!0,H;if(a0(B))return i0($,H,Z?"linePrefix":"lineSuffix")(B);return J(B)}}var kN={name:"definition",tokenize:b00},k00={partial:!0,tokenize:y00};function b00($,J,Z){let H=this,B;return Q;function Q(W){return $.enter("definition"),X(W)}function X(W){return uY.call(H,$,z,Z,"definitionLabel","definitionLabelMarker","definitionLabelString")(W)}function z(W){if(B=f2(H.sliceSerialize(H.events[H.events.length-1][1]).slice(1,-1)),W===58)return $.enter("definitionMarker"),$.consume(W),$.exit("definitionMarker"),G;return Z(W)}function G(W){return P1(W)?K6($,Y)(W):Y(W)}function Y(W){return pY($,U,Z,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(W)}function U(W){return $.attempt(k00,F,F)(W)}function F(W){return a0(W)?i0($,K,"whitespace")(W):K(W)}function K(W){if(W===null||h0(W))return $.exit("definition"),H.parser.defined.push(B),J(W);return Z(W)}}function y00($,J,Z){return H;function H(z){return P1(z)?K6($,B)(z):Z(z)}function B(z){return cY($,Q,Z,"definitionTitle","definitionTitleMarker","definitionTitleString")(z)}function Q(z){return a0(z)?i0($,X,"whitespace")(z):X(z)}function X(z){return z===null||h0(z)?J(z):Z(z)}}var bN={name:"hardBreakEscape",tokenize:h00};function h00($,J,Z){return H;function H(Q){return $.enter("hardBreakEscape"),$.consume(Q),B}function B(Q){if(h0(Q))return $.exit("hardBreakEscape"),J(Q);return Z(Q)}}var yN={name:"headingAtx",resolve:x00,tokenize:v00};function x00($,J){let Z=$.length-2,H=3,B,Q;if($[H][1].type==="whitespace")H+=2;if(Z-2>H&&$[Z][1].type==="whitespace")Z-=2;if($[Z][1].type==="atxHeadingSequence"&&(H===Z-1||Z-4>H&&$[Z-2][1].type==="whitespace"))Z-=H+1===Z?2:4;if(Z>H)B={type:"atxHeadingText",start:$[H][1].start,end:$[Z][1].end},Q={type:"chunkText",start:$[H][1].start,end:$[Z][1].end,contentType:"text"},c5($,H,Z-H+1,[["enter",B,J],["enter",Q,J],["exit",Q,J],["exit",B,J]]);return $}function v00($,J,Z){let H=0;return B;function B(U){return $.enter("atxHeading"),Q(U)}function Q(U){return $.enter("atxHeadingSequence"),X(U)}function X(U){if(U===35&&H++<6)return $.consume(U),X;if(U===null||P1(U))return $.exit("atxHeadingSequence"),z(U);return Z(U)}function z(U){if(U===35)return $.enter("atxHeadingSequence"),G(U);if(U===null||h0(U))return $.exit("atxHeading"),J(U);if(a0(U))return i0($,z,"whitespace")(U);return $.enter("atxHeadingText"),Y(U)}function G(U){if(U===35)return $.consume(U),G;return $.exit("atxHeadingSequence"),z(U)}function Y(U){if(U===null||U===35||P1(U))return $.exit("atxHeadingText"),z(U);return $.consume(U),Y}}var UR=["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"],hN=["pre","script","style","textarea"];var xN={concrete:!0,name:"htmlFlow",resolveTo:m00,tokenize:p00},g00={partial:!0,tokenize:c00},f00={partial:!0,tokenize:u00};function m00($){let J=$.length;while(J--)if($[J][0]==="enter"&&$[J][1].type==="htmlFlow")break;if(J>1&&$[J-2][1].type==="linePrefix")$[J][1].start=$[J-2][1].start,$[J+1][1].start=$[J-2][1].start,$.splice(J-2,2);return $}function p00($,J,Z){let H=this,B,Q,X,z,G;return Y;function Y(h){return U(h)}function U(h){return $.enter("htmlFlow"),$.enter("htmlFlowData"),$.consume(h),F}function F(h){if(h===33)return $.consume(h),K;if(h===47)return $.consume(h),Q=!0,N;if(h===63)return $.consume(h),B=3,H.interrupt?J:T;if(Q2(h))return $.consume(h),X=String.fromCharCode(h),V;return Z(h)}function K(h){if(h===45)return $.consume(h),B=2,W;if(h===91)return $.consume(h),B=5,z=0,q;if(Q2(h))return $.consume(h),B=4,H.interrupt?J:T;return Z(h)}function W(h){if(h===45)return $.consume(h),H.interrupt?J:T;return Z(h)}function q(h){if(h==="CDATA[".charCodeAt(z++)){if($.consume(h),z===6)return H.interrupt?J:I;return q}return Z(h)}function N(h){if(Q2(h))return $.consume(h),X=String.fromCharCode(h),V;return Z(h)}function V(h){if(h===null||h===47||h===62||P1(h)){let e=h===47,A0=X.toLowerCase();if(!e&&!Q&&hN.includes(A0))return B=1,H.interrupt?J(h):I(h);if(UR.includes(X.toLowerCase())){if(B=6,e)return $.consume(h),L;return H.interrupt?J(h):I(h)}return B=7,H.interrupt&&!H.parser.lazy[H.now().line]?Z(h):Q?A(h):M(h)}if(h===45||f5(h))return $.consume(h),X+=String.fromCharCode(h),V;return Z(h)}function L(h){if(h===62)return $.consume(h),H.interrupt?J:I;return Z(h)}function A(h){if(a0(h))return $.consume(h),A;return E(h)}function M(h){if(h===47)return $.consume(h),E;if(h===58||h===95||Q2(h))return $.consume(h),_;if(a0(h))return $.consume(h),M;return E(h)}function _(h){if(h===45||h===46||h===58||h===95||f5(h))return $.consume(h),_;return P(h)}function P(h){if(h===61)return $.consume(h),D;if(a0(h))return $.consume(h),P;return M(h)}function D(h){if(h===null||h===60||h===61||h===62||h===96)return Z(h);if(h===34||h===39)return $.consume(h),G=h,w;if(a0(h))return $.consume(h),D;return R(h)}function w(h){if(h===G)return $.consume(h),G=null,b;if(h===null||h0(h))return Z(h);return $.consume(h),w}function R(h){if(h===null||h===34||h===39||h===47||h===60||h===61||h===62||h===96||P1(h))return P(h);return $.consume(h),R}function b(h){if(h===47||h===62||a0(h))return M(h);return Z(h)}function E(h){if(h===62)return $.consume(h),x;return Z(h)}function x(h){if(h===null||h0(h))return I(h);if(a0(h))return $.consume(h),x;return Z(h)}function I(h){if(h===45&&B===2)return $.consume(h),k;if(h===60&&B===1)return $.consume(h),y;if(h===62&&B===4)return $.consume(h),t;if(h===63&&B===3)return $.consume(h),T;if(h===93&&B===5)return $.consume(h),u;if(h0(h)&&(B===6||B===7))return $.exit("htmlFlowData"),$.check(g00,B0,S)(h);if(h===null||h0(h))return $.exit("htmlFlowData"),S(h);return $.consume(h),I}function S(h){return $.check(f00,j,B0)(h)}function j(h){return $.enter("lineEnding"),$.consume(h),$.exit("lineEnding"),C}function C(h){if(h===null||h0(h))return S(h);return $.enter("htmlFlowData"),I(h)}function k(h){if(h===45)return $.consume(h),T;return I(h)}function y(h){if(h===47)return $.consume(h),X="",v;return I(h)}function v(h){if(h===62){let e=X.toLowerCase();if(hN.includes(e))return $.consume(h),t;return I(h)}if(Q2(h)&&X.length<8)return $.consume(h),X+=String.fromCharCode(h),v;return I(h)}function u(h){if(h===93)return $.consume(h),T;return I(h)}function T(h){if(h===62)return $.consume(h),t;if(h===45&&B===2)return $.consume(h),T;return I(h)}function t(h){if(h===null||h0(h))return $.exit("htmlFlowData"),B0(h);return $.consume(h),t}function B0(h){return $.exit("htmlFlow"),J(h)}}function u00($,J,Z){let H=this;return B;function B(X){if(h0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Q;return Z(X)}function Q(X){return H.parser.lazy[H.now().line]?Z(X):J(X)}}function c00($,J,Z){return H;function H(B){return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),$.attempt(K9,J,Z)}}var vN={name:"htmlText",tokenize:d00};function d00($,J,Z){let H=this,B,Q,X;return z;function z(T){return $.enter("htmlText"),$.enter("htmlTextData"),$.consume(T),G}function G(T){if(T===33)return $.consume(T),Y;if(T===47)return $.consume(T),P;if(T===63)return $.consume(T),M;if(Q2(T))return $.consume(T),R;return Z(T)}function Y(T){if(T===45)return $.consume(T),U;if(T===91)return $.consume(T),Q=0,q;if(Q2(T))return $.consume(T),A;return Z(T)}function U(T){if(T===45)return $.consume(T),W;return Z(T)}function F(T){if(T===null)return Z(T);if(T===45)return $.consume(T),K;if(h0(T))return X=F,y(T);return $.consume(T),F}function K(T){if(T===45)return $.consume(T),W;return F(T)}function W(T){return T===62?k(T):T===45?K(T):F(T)}function q(T){if(T==="CDATA[".charCodeAt(Q++))return $.consume(T),Q===6?N:q;return Z(T)}function N(T){if(T===null)return Z(T);if(T===93)return $.consume(T),V;if(h0(T))return X=N,y(T);return $.consume(T),N}function V(T){if(T===93)return $.consume(T),L;return N(T)}function L(T){if(T===62)return k(T);if(T===93)return $.consume(T),L;return N(T)}function A(T){if(T===null||T===62)return k(T);if(h0(T))return X=A,y(T);return $.consume(T),A}function M(T){if(T===null)return Z(T);if(T===63)return $.consume(T),_;if(h0(T))return X=M,y(T);return $.consume(T),M}function _(T){return T===62?k(T):M(T)}function P(T){if(Q2(T))return $.consume(T),D;return Z(T)}function D(T){if(T===45||f5(T))return $.consume(T),D;return w(T)}function w(T){if(h0(T))return X=w,y(T);if(a0(T))return $.consume(T),w;return k(T)}function R(T){if(T===45||f5(T))return $.consume(T),R;if(T===47||T===62||P1(T))return b(T);return Z(T)}function b(T){if(T===47)return $.consume(T),k;if(T===58||T===95||Q2(T))return $.consume(T),E;if(h0(T))return X=b,y(T);if(a0(T))return $.consume(T),b;return k(T)}function E(T){if(T===45||T===46||T===58||T===95||f5(T))return $.consume(T),E;return x(T)}function x(T){if(T===61)return $.consume(T),I;if(h0(T))return X=x,y(T);if(a0(T))return $.consume(T),x;return b(T)}function I(T){if(T===null||T===60||T===61||T===62||T===96)return Z(T);if(T===34||T===39)return $.consume(T),B=T,S;if(h0(T))return X=I,y(T);if(a0(T))return $.consume(T),I;return $.consume(T),j}function S(T){if(T===B)return $.consume(T),B=void 0,C;if(T===null)return Z(T);if(h0(T))return X=S,y(T);return $.consume(T),S}function j(T){if(T===null||T===34||T===39||T===60||T===61||T===96)return Z(T);if(T===47||T===62||P1(T))return b(T);return $.consume(T),j}function C(T){if(T===47||T===62||P1(T))return b(T);return Z(T)}function k(T){if(T===62)return $.consume(T),$.exit("htmlTextData"),$.exit("htmlText"),J;return Z(T)}function y(T){return $.exit("htmlTextData"),$.enter("lineEnding"),$.consume(T),$.exit("lineEnding"),v}function v(T){return a0(T)?i0($,u,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):u(T)}function u(T){return $.enter("htmlTextData"),X(T)}}var W6={name:"labelEnd",resolveAll:a00,resolveTo:n00,tokenize:o00},l00={tokenize:s00},i00={tokenize:t00},r00={tokenize:e00};function a00($){let J=-1,Z=[];while(++J<$.length){let H=$[J][1];if(Z.push($[J]),H.type==="labelImage"||H.type==="labelLink"||H.type==="labelEnd"){let B=H.type==="labelImage"?4:2;H.type="data",J+=B}}if($.length!==Z.length)c5($,0,$.length,Z);return $}function n00($,J){let Z=$.length,H=0,B,Q,X,z;while(Z--)if(B=$[Z][1],Q){if(B.type==="link"||B.type==="labelLink"&&B._inactive)break;if($[Z][0]==="enter"&&B.type==="labelLink")B._inactive=!0}else if(X){if($[Z][0]==="enter"&&(B.type==="labelImage"||B.type==="labelLink")&&!B._balanced){if(Q=Z,B.type!=="labelLink"){H=2;break}}}else if(B.type==="labelEnd")X=Z;let G={type:$[Q][1].type==="labelLink"?"link":"image",start:{...$[Q][1].start},end:{...$[$.length-1][1].end}},Y={type:"label",start:{...$[Q][1].start},end:{...$[X][1].end}},U={type:"labelText",start:{...$[Q+H+2][1].end},end:{...$[X-2][1].start}};return z=[["enter",G,J],["enter",Y,J]],z=$4(z,$.slice(Q+1,Q+H+3)),z=$4(z,[["enter",U,J]]),z=$4(z,u3(J.parser.constructs.insideSpan.null,$.slice(Q+H+4,X-3),J)),z=$4(z,[["exit",U,J],$[X-2],$[X-1],["exit",Y,J]]),z=$4(z,$.slice(X+1)),z=$4(z,[["exit",G,J]]),c5($,Q,$.length,z),$}function o00($,J,Z){let H=this,B=H.events.length,Q,X;while(B--)if((H.events[B][1].type==="labelImage"||H.events[B][1].type==="labelLink")&&!H.events[B][1]._balanced){Q=H.events[B][1];break}return z;function z(K){if(!Q)return Z(K);if(Q._inactive)return F(K);return X=H.parser.defined.includes(f2(H.sliceSerialize({start:Q.end,end:H.now()}))),$.enter("labelEnd"),$.enter("labelMarker"),$.consume(K),$.exit("labelMarker"),$.exit("labelEnd"),G}function G(K){if(K===40)return $.attempt(l00,U,X?U:F)(K);if(K===91)return $.attempt(i00,U,X?Y:F)(K);return X?U(K):F(K)}function Y(K){return $.attempt(r00,U,F)(K)}function U(K){return J(K)}function F(K){return Q._balanced=!0,Z(K)}}function s00($,J,Z){return H;function H(F){return $.enter("resource"),$.enter("resourceMarker"),$.consume(F),$.exit("resourceMarker"),B}function B(F){return P1(F)?K6($,Q)(F):Q(F)}function Q(F){if(F===41)return U(F);return pY($,X,z,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(F)}function X(F){return P1(F)?K6($,G)(F):U(F)}function z(F){return Z(F)}function G(F){if(F===34||F===39||F===40)return cY($,Y,Z,"resourceTitle","resourceTitleMarker","resourceTitleString")(F);return U(F)}function Y(F){return P1(F)?K6($,U)(F):U(F)}function U(F){if(F===41)return $.enter("resourceMarker"),$.consume(F),$.exit("resourceMarker"),$.exit("resource"),J;return Z(F)}}function t00($,J,Z){let H=this;return B;function B(z){return uY.call(H,$,Q,X,"reference","referenceMarker","referenceString")(z)}function Q(z){return H.parser.defined.includes(f2(H.sliceSerialize(H.events[H.events.length-1][1]).slice(1,-1)))?J(z):Z(z)}function X(z){return Z(z)}}function e00($,J,Z){return H;function H(Q){return $.enter("reference"),$.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),B}function B(Q){if(Q===93)return $.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),$.exit("reference"),J;return Z(Q)}}var gN={name:"labelStartImage",resolveAll:W6.resolveAll,tokenize:$10};function $10($,J,Z){let H=this;return B;function B(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 Z(z)}function X(z){return z===94&&"_hiddenFootnoteSupport"in H.parser.constructs?Z(z):J(z)}}var fN={name:"labelStartLink",resolveAll:W6.resolveAll,tokenize:J10};function J10($,J,Z){let H=this;return B;function B(X){return $.enter("labelLink"),$.enter("labelMarker"),$.consume(X),$.exit("labelMarker"),$.exit("labelLink"),Q}function Q(X){return X===94&&"_hiddenFootnoteSupport"in H.parser.constructs?Z(X):J(X)}}var tH={name:"lineEnding",tokenize:Z10};function Z10($,J){return Z;function Z(H){return $.enter("lineEnding"),$.consume(H),$.exit("lineEnding"),i0($,J,"linePrefix")}}var q6={name:"thematicBreak",tokenize:H10};function H10($,J,Z){let H=0,B;return Q;function Q(Y){return $.enter("thematicBreak"),X(Y)}function X(Y){return B=Y,z(Y)}function z(Y){if(Y===B)return $.enter("thematicBreakSequence"),G(Y);if(H>=3&&(Y===null||h0(Y)))return $.exit("thematicBreak"),J(Y);return Z(Y)}function G(Y){if(Y===B)return $.consume(Y),H++,G;return $.exit("thematicBreakSequence"),a0(Y)?i0($,z,"whitespace")(Y):z(Y)}}var m2={continuation:{tokenize:z10},exit:Y10,name:"list",tokenize:X10},B10={partial:!0,tokenize:U10},Q10={partial:!0,tokenize:G10};function X10($,J,Z){let H=this,B=H.events[H.events.length-1],Q=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,X=0;return z;function z(W){let q=H.containerState.type||(W===42||W===43||W===45?"listUnordered":"listOrdered");if(q==="listUnordered"?!H.containerState.marker||W===H.containerState.marker:aH(W)){if(!H.containerState.type)H.containerState.type=q,$.enter(q,{_container:!0});if(q==="listUnordered")return $.enter("listItemPrefix"),W===42||W===45?$.check(q6,Z,Y)(W):Y(W);if(!H.interrupt||W===49)return $.enter("listItemPrefix"),$.enter("listItemValue"),G(W)}return Z(W)}function G(W){if(aH(W)&&++X<10)return $.consume(W),G;if((!H.interrupt||X<2)&&(H.containerState.marker?W===H.containerState.marker:W===41||W===46))return $.exit("listItemValue"),Y(W);return Z(W)}function Y(W){return $.enter("listItemMarker"),$.consume(W),$.exit("listItemMarker"),H.containerState.marker=H.containerState.marker||W,$.check(K9,H.interrupt?Z:U,$.attempt(B10,K,F))}function U(W){return H.containerState.initialBlankLine=!0,Q++,K(W)}function F(W){if(a0(W))return $.enter("listItemPrefixWhitespace"),$.consume(W),$.exit("listItemPrefixWhitespace"),K;return Z(W)}function K(W){return H.containerState.size=Q+H.sliceSerialize($.exit("listItemPrefix"),!0).length,J(W)}}function z10($,J,Z){let H=this;return H.containerState._closeFlow=void 0,$.check(K9,B,Q);function B(z){return H.containerState.furtherBlankLines=H.containerState.furtherBlankLines||H.containerState.initialBlankLine,i0($,J,"listItemIndent",H.containerState.size+1)(z)}function Q(z){if(H.containerState.furtherBlankLines||!a0(z))return H.containerState.furtherBlankLines=void 0,H.containerState.initialBlankLine=void 0,X(z);return H.containerState.furtherBlankLines=void 0,H.containerState.initialBlankLine=void 0,$.attempt(Q10,J,X)(z)}function X(z){return H.containerState._closeFlow=!0,H.interrupt=void 0,i0($,$.attempt(m2,J,Z),"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z)}}function G10($,J,Z){let H=this;return i0($,B,"listItemIndent",H.containerState.size+1);function B(Q){let X=H.events[H.events.length-1];return X&&X[1].type==="listItemIndent"&&X[2].sliceSerialize(X[1],!0).length===H.containerState.size?J(Q):Z(Q)}}function Y10($){$.exit(this.containerState.type)}function U10($,J,Z){let H=this;return i0($,B,"listItemPrefixWhitespace",H.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function B(Q){let X=H.events[H.events.length-1];return!a0(Q)&&X&&X[1].type==="listItemPrefixWhitespace"?J(Q):Z(Q)}}var dY={name:"setextUnderline",resolveTo:F10,tokenize:K10};function F10($,J){let Z=$.length,H,B,Q;while(Z--)if($[Z][0]==="enter"){if($[Z][1].type==="content"){H=Z;break}if($[Z][1].type==="paragraph")B=Z}else{if($[Z][1].type==="content")$.splice(Z,1);if(!Q&&$[Z][1].type==="definition")Q=Z}let X={type:"setextHeading",start:{...$[H][1].start},end:{...$[$.length-1][1].end}};if($[B][1].type="setextHeadingText",Q)$.splice(B,0,["enter",X,J]),$.splice(Q+1,0,["exit",$[H][1],J]),$[H][1].end={...$[Q][1].end};else $[H][1]=X;return $.push(["exit",X,J]),$}function K10($,J,Z){let H=this,B;return Q;function Q(Y){let U=H.events.length,F;while(U--)if(H.events[U][1].type!=="lineEnding"&&H.events[U][1].type!=="linePrefix"&&H.events[U][1].type!=="content"){F=H.events[U][1].type==="paragraph";break}if(!H.parser.lazy[H.now().line]&&(H.interrupt||F))return $.enter("setextHeadingLine"),B=Y,X(Y);return Z(Y)}function X(Y){return $.enter("setextHeadingLineSequence"),z(Y)}function z(Y){if(Y===B)return $.consume(Y),z;return $.exit("setextHeadingLineSequence"),a0(Y)?i0($,G,"lineSuffix")(Y):G(Y)}function G(Y){if(Y===null||h0(Y))return $.exit("setextHeadingLine"),J(Y);return Z(Y)}}var FR={tokenize:W10};function W10($){let J=this,Z=$.attempt(K9,H,$.attempt(this.parser.constructs.flowInitial,B,i0($,$.attempt(this.parser.constructs.flow,B,$.attempt(RN,B)),"linePrefix")));return Z;function H(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEndingBlank"),$.consume(Q),$.exit("lineEndingBlank"),J.currentConstruct=void 0,Z}function B(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEnding"),$.consume(Q),$.exit("lineEnding"),J.currentConstruct=void 0,Z}}var KR={resolveAll:LR()},WR=NR("string"),qR=NR("text");function NR($){return{resolveAll:LR($==="text"?q10:void 0),tokenize:J};function J(Z){let H=this,B=this.parser.constructs[$],Q=Z.attempt(B,X,z);return X;function X(U){return Y(U)?Q(U):z(U)}function z(U){if(U===null){Z.consume(U);return}return Z.enter("data"),Z.consume(U),G}function G(U){if(Y(U))return Z.exit("data"),Q(U);return Z.consume(U),G}function Y(U){if(U===null)return!0;let F=B[U],K=-1;if(F)while(++K<F.length){let W=F[K];if(!W.previous||W.previous.call(H,H.previous))return!0}return!1}}}function LR($){return J;function J(Z,H){let B=-1,Q;while(++B<=Z.length)if(Q===void 0){if(Z[B]&&Z[B][1].type==="data")Q=B,B++}else if(!Z[B]||Z[B][1].type!=="data"){if(B!==Q+2)Z[Q][1].end=Z[B-1][1].end,Z.splice(Q+2,B-Q-2),B=Q+2;Q=void 0}return $?$(Z,H):Z}}function q10($,J){let Z=0;while(++Z<=$.length)if((Z===$.length||$[Z][1].type==="lineEnding")&&$[Z-1][1].type==="data"){let H=$[Z-1][1],B=J.sliceStream(H),Q=B.length,X=-1,z=0,G;while(Q--){let Y=B[Q];if(typeof Y==="string"){X=Y.length;while(Y.charCodeAt(X-1)===32)z++,X--;if(X)break;X=-1}else if(Y===-2)G=!0,z++;else if(Y===-1);else{Q++;break}}if(J._contentTypeTextTrailing&&Z===$.length)z=0;if(z){let Y={type:Z===$.length||G||z<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:Q?X:H.start._bufferIndex+X,_index:H.start._index+Q,line:H.end.line,column:H.end.column-z,offset:H.end.offset-z},end:{...H.end}};if(H.end={...Y.start},H.start.offset===H.end.offset)Object.assign(H,Y);else $.splice(Z,0,["enter",Y,J],["exit",Y,J]),Z+=2}Z++}return $}var mN={};_4(mN,{text:()=>M10,string:()=>D10,insideSpan:()=>P10,flowInitial:()=>V10,flow:()=>A10,document:()=>N10,disable:()=>O10,contentInitial:()=>L10,attentionMarkers:()=>_10});var N10={[42]:m2,[43]:m2,[45]:m2,[48]:m2,[49]:m2,[50]:m2,[51]:m2,[52]:m2,[53]:m2,[54]:m2,[55]:m2,[56]:m2,[57]:m2,[62]:xY},L10={[91]:kN},V10={[-2]:oH,[-1]:oH,[32]:oH},A10={[35]:yN,[42]:q6,[45]:[dY,q6],[60]:xN,[61]:dY,[95]:q6,[96]:fY,[126]:fY},D10={[38]:gY,[92]:vY},M10={[-5]:tH,[-4]:tH,[-3]:tH,[33]:gN,[38]:gY,[42]:nH,[60]:[EN,vN],[91]:fN,[92]:[bN,vY],[93]:W6,[95]:nH,[96]:SN},P10={null:[nH,KR]},_10={null:[42,95]},O10={null:[]};function VR($,J,Z){let H={_bufferIndex:-1,_index:0,line:Z&&Z.line||1,column:Z&&Z.column||1,offset:Z&&Z.offset||0},B={},Q=[],X=[],z=[],G=!0,Y={attempt:b(w),check:b(R),consume:_,enter:P,exit:D,interrupt:b(R,{interrupt:!0})},U={code:null,containerState:{},defineSkip:L,events:[],now:V,parser:$,previous:null,sliceSerialize:q,sliceStream:N,write:W},F=J.tokenize.call(U,Y),K;if(J.resolveAll)Q.push(J);return U;function W(S){if(X=$4(X,S),A(),X[X.length-1]!==null)return[];return E(J,0),U.events=u3(Q,U.events,U),U.events}function q(S,j){return T10(N(S),j)}function N(S){return j10(X,S)}function V(){let{_bufferIndex:S,_index:j,line:C,column:k,offset:y}=H;return{_bufferIndex:S,_index:j,line:C,column:k,offset:y}}function L(S){B[S.line]=S.column,I()}function A(){let S;while(H._index<X.length){let j=X[H._index];if(typeof j==="string"){if(S=H._index,H._bufferIndex<0)H._bufferIndex=0;while(H._index===S&&H._bufferIndex<j.length)M(j.charCodeAt(H._bufferIndex))}else M(j)}}function M(S){G=void 0,K=S,F=F(S)}function _(S){if(h0(S))H.line++,H.column=1,H.offset+=S===-3?2:1,I();else if(S!==-1)H.column++,H.offset++;if(H._bufferIndex<0)H._index++;else if(H._bufferIndex++,H._bufferIndex===X[H._index].length)H._bufferIndex=-1,H._index++;U.previous=S,G=!0}function P(S,j){let C=j||{};return C.type=S,C.start=V(),U.events.push(["enter",C,U]),z.push(C),C}function D(S){let j=z.pop();return j.end=V(),U.events.push(["exit",j,U]),j}function w(S,j){E(S,j.from)}function R(S,j){j.restore()}function b(S,j){return C;function C(k,y,v){let u,T,t,B0;return Array.isArray(k)?e(k):("tokenize"in k)?e([k]):h(k);function h(W0){return Q0;function Q0(G0){let L0=G0!==null&&W0[G0],i=G0!==null&&W0.null,$0=[...Array.isArray(L0)?L0:L0?[L0]:[],...Array.isArray(i)?i:i?[i]:[]];return e($0)(G0)}}function e(W0){if(u=W0,T=0,W0.length===0)return v;return A0(W0[T])}function A0(W0){return Q0;function Q0(G0){if(B0=x(),t=W0,!W0.partial)U.currentConstruct=W0;if(W0.name&&U.parser.constructs.disable.null.includes(W0.name))return z0(G0);return W0.tokenize.call(j?Object.assign(Object.create(U),j):U,Y,l,z0)(G0)}}function l(W0){return G=!0,S(t,B0),y}function z0(W0){if(G=!0,B0.restore(),++T<u.length)return A0(u[T]);return v}}}function E(S,j){if(S.resolveAll&&!Q.includes(S))Q.push(S);if(S.resolve)c5(U.events,j,U.events.length-j,S.resolve(U.events.slice(j),U));if(S.resolveTo)U.events=S.resolveTo(U.events,U)}function x(){let S=V(),j=U.previous,C=U.currentConstruct,k=U.events.length,y=Array.from(z);return{from:k,restore:v};function v(){H=S,U.previous=j,U.currentConstruct=C,U.events.length=k,z=y,I()}}function I(){if(H.line in B&&H.column<2)H.column=B[H.line],H.offset+=B[H.line]-1}}function j10($,J){let Z=J.start._index,H=J.start._bufferIndex,B=J.end._index,Q=J.end._bufferIndex,X;if(Z===B)X=[$[Z].slice(H,Q)];else{if(X=$.slice(Z,B),H>-1){let z=X[0];if(typeof z==="string")X[0]=z.slice(H);else X.shift()}if(Q>0)X.push($[B].slice(0,Q))}return X}function T10($,J){let Z=-1,H=[],B;while(++Z<$.length){let Q=$[Z],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=J?" ":"\t";break}case-1:{if(!J&&B)continue;X=" ";break}default:X=String.fromCharCode(Q)}B=Q===-2,H.push(X)}return H.join("")}function pN($){let H={constructs:yY([mN,...($||{}).extensions||[]]),content:B(QR),defined:[],document:B(zR),flow:B(FR),lazy:{},string:B(WR),text:B(qR)};return H;function B(Q){return X;function X(z){return VR(H,Q,z)}}}function uN($){while(!mY($));return $}var AR=/[\0\t\n\r]/g;function cN(){let $=1,J="",Z=!0,H;return B;function B(Q,X,z){let G=[],Y,U,F,K,W;if(Q=J+(typeof Q==="string"?Q.toString():new TextDecoder(X||void 0).decode(Q)),F=0,J="",Z){if(Q.charCodeAt(0)===65279)F++;Z=void 0}while(F<Q.length){if(AR.lastIndex=F,Y=AR.exec(Q),K=Y&&Y.index!==void 0?Y.index:Q.length,W=Q.charCodeAt(K),!Y){J=Q.slice(F);break}if(W===10&&F===K&&H)G.push(-3),H=void 0;else{if(H)G.push(-5),H=void 0;if(F<K)G.push(Q.slice(F,K)),$+=K-F;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:H=!0,$=1}}F=K+1}if(z){if(H)G.push(-5);if(J)G.push(J);G.push(null)}return G}}var C10=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function DR($){return $.replace(C10,w10)}function w10($,J,Z){if(J)return J;if(Z.charCodeAt(0)===35){let B=Z.charCodeAt(1),Q=B===120||B===88;return hY(Z.slice(Q?2:1),Q?16:10)}return YJ(Z)||$}var PR={}.hasOwnProperty;function dN($,J,Z){if(J&&typeof J==="object")Z=J,J=void 0;return E10(Z)(uN(pN(Z).document().write(cN()($,J,!0))))}function E10($){let J={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:Q(m),autolinkProtocol:b,autolinkEmail:b,atxHeading:Q(H0),blockQuote:Q(G0),characterEscape:b,characterReference:b,codeFenced:Q(L0),codeFencedFenceInfo:X,codeFencedFenceMeta:X,codeIndented:Q(L0,X),codeText:Q(i,X),codeTextData:b,data:b,codeFlowValue:b,definition:Q($0),definitionDestinationString:X,definitionLabelString:X,definitionTitleString:X,emphasis:Q(J0),hardBreakEscape:Q(n),hardBreakTrailing:Q(n),htmlFlow:Q(p,X),htmlFlowData:b,htmlText:Q(p,X),htmlTextData:b,image:Q(d),label:X,link:Q(m),listItem:Q(o),listItemValue:K,listOrdered:Q(a,F),listUnordered:Q(a),paragraph:Q(N0),reference:h,referenceString:X,resourceDestinationString:X,resourceTitleString:X,setextHeading:Q(H0),strong:Q(O0),thematicBreak:Q(p0)},exit:{atxHeading:G(),atxHeadingSequence:P,autolink:G(),autolinkEmail:Q0,autolinkProtocol:W0,blockQuote:G(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:A0,characterReferenceMarkerNumeric:A0,characterReferenceValue:l,characterReference:z0,codeFenced:G(V),codeFencedFence:N,codeFencedFenceInfo:W,codeFencedFenceMeta:q,codeFlowValue:E,codeIndented:G(L),codeText:G(C),codeTextData:E,data:E,definition:G(),definitionDestinationString:_,definitionLabelString:A,definitionTitleString:M,emphasis:G(),hardBreakEscape:G(I),hardBreakTrailing:G(I),htmlFlow:G(S),htmlFlowData:E,htmlText:G(j),htmlTextData:E,image:G(y),label:u,labelText:v,lineEnding:x,link:G(k),listItem:G(),listOrdered:G(),listUnordered:G(),paragraph:G(),referenceString:e,resourceDestinationString:T,resourceTitleString:t,resource:B0,setextHeading:G(R),setextHeadingLineSequence:w,setextHeadingText:D,strong:G(),thematicBreak:G()}};_R(J,($||{}).mdastExtensions||[]);let Z={};return H;function H(f){let r={type:"root",children:[]},X0={stack:[r],tokenStack:[],config:J,enter:z,exit:Y,buffer:X,resume:U,data:Z},V0=[],j0=-1;while(++j0<f.length)if(f[j0][1].type==="listOrdered"||f[j0][1].type==="listUnordered")if(f[j0][0]==="enter")V0.push(j0);else{let v0=V0.pop();j0=B(f,v0,j0)}j0=-1;while(++j0<f.length){let v0=J[f[j0][0]];if(PR.call(v0,f[j0][1].type))v0[f[j0][1].type].call(Object.assign({sliceSerialize:f[j0][2].sliceSerialize},X0),f[j0][1])}if(X0.tokenStack.length>0){let v0=X0.tokenStack[X0.tokenStack.length-1];(v0[1]||MR).call(X0,void 0,v0[0])}r.position={start:c3(f.length>0?f[0][1].start:{line:1,column:1,offset:0}),end:c3(f.length>0?f[f.length-2][1].end:{line:1,column:1,offset:0})},j0=-1;while(++j0<J.transforms.length)r=J.transforms[j0](r)||r;return r}function B(f,r,X0){let V0=r-1,j0=-1,v0=!1,Q1,U1,c0,y0;while(++V0<=X0){let d0=f[V0];switch(d0[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(d0[0]==="enter")j0++;else j0--;y0=void 0;break}case"lineEndingBlank":{if(d0[0]==="enter"){if(Q1&&!y0&&!j0&&!c0)c0=V0;y0=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:y0=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(Q1){let Z0=V0;U1=void 0;while(Z0--){let T0=f[Z0];if(T0[1].type==="lineEnding"||T0[1].type==="lineEndingBlank"){if(T0[0]==="exit")continue;if(U1)f[U1][1].type="lineEndingBlank",v0=!0;T0[1].type="lineEnding",U1=Z0}else if(T0[1].type==="linePrefix"||T0[1].type==="blockQuotePrefix"||T0[1].type==="blockQuotePrefixWhitespace"||T0[1].type==="blockQuoteMarker"||T0[1].type==="listItemIndent");else break}if(c0&&(!U1||c0<U1))Q1._spread=!0;Q1.end=Object.assign({},U1?f[U1][1].start:d0[1].end),f.splice(U1||V0,0,["exit",Q1,d0[2]]),V0++,X0++}if(d0[1].type==="listItemPrefix"){let Z0={type:"listItem",_spread:!1,start:Object.assign({},d0[1].start),end:void 0};Q1=Z0,f.splice(V0,0,["enter",Z0,d0[2]]),V0++,X0++,c0=void 0,y0=!0}}}return f[r][1]._spread=v0,X0}function Q(f,r){return X0;function X0(V0){if(z.call(this,f(V0),V0),r)r.call(this,V0)}}function X(){this.stack.push({type:"fragment",children:[]})}function z(f,r,X0){this.stack[this.stack.length-1].children.push(f),this.stack.push(f),this.tokenStack.push([r,X0||void 0]),f.position={start:c3(r.start),end:void 0}}function G(f){return r;function r(X0){if(f)f.call(this,X0);Y.call(this,X0)}}function Y(f,r){let X0=this.stack.pop(),V0=this.tokenStack.pop();if(!V0)throw Error("Cannot close `"+f.type+"` ("+m3({start:f.start,end:f.end})+"): it’s not open");else if(V0[0].type!==f.type)if(r)r.call(this,f,V0[0]);else(V0[1]||MR).call(this,f,V0[0]);X0.position.end=c3(f.end)}function U(){return Y6(this.stack.pop())}function F(){this.data.expectingFirstListItemValue=!0}function K(f){if(this.data.expectingFirstListItemValue){let r=this.stack[this.stack.length-2];r.start=Number.parseInt(this.sliceSerialize(f),10),this.data.expectingFirstListItemValue=void 0}}function W(){let f=this.resume(),r=this.stack[this.stack.length-1];r.lang=f}function q(){let f=this.resume(),r=this.stack[this.stack.length-1];r.meta=f}function N(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function V(){let f=this.resume(),r=this.stack[this.stack.length-1];r.value=f.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function L(){let f=this.resume(),r=this.stack[this.stack.length-1];r.value=f.replace(/(\r?\n|\r)$/g,"")}function A(f){let r=this.resume(),X0=this.stack[this.stack.length-1];X0.label=r,X0.identifier=f2(this.sliceSerialize(f)).toLowerCase()}function M(){let f=this.resume(),r=this.stack[this.stack.length-1];r.title=f}function _(){let f=this.resume(),r=this.stack[this.stack.length-1];r.url=f}function P(f){let r=this.stack[this.stack.length-1];if(!r.depth){let X0=this.sliceSerialize(f).length;r.depth=X0}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function w(f){let r=this.stack[this.stack.length-1];r.depth=this.sliceSerialize(f).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function b(f){let X0=this.stack[this.stack.length-1].children,V0=X0[X0.length-1];if(!V0||V0.type!=="text")V0=g0(),V0.position={start:c3(f.start),end:void 0},X0.push(V0);this.stack.push(V0)}function E(f){let r=this.stack.pop();r.value+=this.sliceSerialize(f),r.position.end=c3(f.end)}function x(f){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){let X0=r.children[r.children.length-1];X0.position.end=c3(f.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&J.canContainEols.includes(r.type))b.call(this,f),E.call(this,f)}function I(){this.data.atHardBreak=!0}function S(){let f=this.resume(),r=this.stack[this.stack.length-1];r.value=f}function j(){let f=this.resume(),r=this.stack[this.stack.length-1];r.value=f}function C(){let f=this.resume(),r=this.stack[this.stack.length-1];r.value=f}function k(){let f=this.stack[this.stack.length-1];if(this.data.inReference){let r=this.data.referenceType||"shortcut";f.type+="Reference",f.referenceType=r,delete f.url,delete f.title}else delete f.identifier,delete f.label;this.data.referenceType=void 0}function y(){let f=this.stack[this.stack.length-1];if(this.data.inReference){let r=this.data.referenceType||"shortcut";f.type+="Reference",f.referenceType=r,delete f.url,delete f.title}else delete f.identifier,delete f.label;this.data.referenceType=void 0}function v(f){let r=this.sliceSerialize(f),X0=this.stack[this.stack.length-2];X0.label=DR(r),X0.identifier=f2(r).toLowerCase()}function u(){let f=this.stack[this.stack.length-1],r=this.resume(),X0=this.stack[this.stack.length-1];if(this.data.inReference=!0,X0.type==="link"){let V0=f.children;X0.children=V0}else X0.alt=r}function T(){let f=this.resume(),r=this.stack[this.stack.length-1];r.url=f}function t(){let f=this.resume(),r=this.stack[this.stack.length-1];r.title=f}function B0(){this.data.inReference=void 0}function h(){this.data.referenceType="collapsed"}function e(f){let r=this.resume(),X0=this.stack[this.stack.length-1];X0.label=r,X0.identifier=f2(this.sliceSerialize(f)).toLowerCase(),this.data.referenceType="full"}function A0(f){this.data.characterReferenceType=f.type}function l(f){let r=this.sliceSerialize(f),X0=this.data.characterReferenceType,V0;if(X0)V0=hY(r,X0==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else V0=YJ(r);let j0=this.stack[this.stack.length-1];j0.value+=V0}function z0(f){let r=this.stack.pop();r.position.end=c3(f.end)}function W0(f){E.call(this,f);let r=this.stack[this.stack.length-1];r.url=this.sliceSerialize(f)}function Q0(f){E.call(this,f);let r=this.stack[this.stack.length-1];r.url="mailto:"+this.sliceSerialize(f)}function G0(){return{type:"blockquote",children:[]}}function L0(){return{type:"code",lang:null,meta:null,value:""}}function i(){return{type:"inlineCode",value:""}}function $0(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function J0(){return{type:"emphasis",children:[]}}function H0(){return{type:"heading",depth:0,children:[]}}function n(){return{type:"break"}}function p(){return{type:"html",value:""}}function d(){return{type:"image",title:null,url:"",alt:null}}function m(){return{type:"link",title:null,url:"",children:[]}}function a(f){return{type:"list",ordered:f.type==="listOrdered",start:null,spread:f._spread,children:[]}}function o(f){return{type:"listItem",spread:f._spread,checked:null,children:[]}}function N0(){return{type:"paragraph",children:[]}}function O0(){return{type:"strong",children:[]}}function g0(){return{type:"text",value:""}}function p0(){return{type:"thematicBreak"}}}function c3($){return{line:$.line,column:$.column,offset:$.offset}}function _R($,J){let Z=-1;while(++Z<J.length){let H=J[Z];if(Array.isArray(H))_R($,H);else S10($,H)}}function S10($,J){let Z;for(Z in J)if(PR.call(J,Z))switch(Z){case"canContainEols":{let H=J[Z];if(H)$[Z].push(...H);break}case"transforms":{let H=J[Z];if(H)$[Z].push(...H);break}case"enter":case"exit":{let H=J[Z];if(H)Object.assign($[Z],H);break}}}function MR($,J){if($)throw Error("Cannot close `"+$.type+"` ("+m3({start:$.start,end:$.end})+"): a different token (`"+J.type+"`, "+m3({start:J.start,end:J.end})+") is open");else throw Error("Cannot close document, a token (`"+J.type+"`, "+m3({start:J.start,end:J.end})+") is still open")}function lY($){let J=this;J.parser=Z;function Z(H){return dN(H,{...J.data("settings"),...$,extensions:J.data("micromarkExtensions")||[],mdastExtensions:J.data("fromMarkdownExtensions")||[]})}}var iY=-1,UJ=0,N6=1,FJ=2,eH=3,$B=4,JB=5,ZB=6,rY=7,aY=8;var OR=typeof self==="object"?self:globalThis,I10=($,J)=>{let Z=(B,Q)=>{return $.set(Q,B),B},H=(B)=>{if($.has(B))return $.get(B);let[Q,X]=J[B];switch(Q){case UJ:case iY:return Z(X,B);case N6:{let z=Z([],B);for(let G of X)z.push(H(G));return z}case FJ:{let z=Z({},B);for(let[G,Y]of X)z[H(G)]=H(Y);return z}case eH:return Z(new Date(X),B);case $B:{let{source:z,flags:G}=X;return Z(new RegExp(z,G),B)}case JB:{let z=Z(new Map,B);for(let[G,Y]of X)z.set(H(G),H(Y));return z}case ZB:{let z=Z(new Set,B);for(let G of X)z.add(H(G));return z}case rY:{let{name:z,message:G}=X;return Z(new OR[z](G),B)}case aY:return Z(BigInt(X),B);case"BigInt":return Z(Object(BigInt(X)),B);case"ArrayBuffer":return Z(new Uint8Array(X).buffer,X);case"DataView":{let{buffer:z}=new Uint8Array(X);return Z(new DataView(z),X)}}return Z(new OR[Q](X),B)};return H},lN=($)=>I10(new Map,$)(0);var KJ="",{toString:R10}={},{keys:k10}=Object,HB=($)=>{let J=typeof $;if(J!=="object"||!$)return[UJ,J];let Z=R10.call($).slice(8,-1);switch(Z){case"Array":return[N6,KJ];case"Object":return[FJ,KJ];case"Date":return[eH,KJ];case"RegExp":return[$B,KJ];case"Map":return[JB,KJ];case"Set":return[ZB,KJ];case"DataView":return[N6,Z]}if(Z.includes("Array"))return[N6,Z];if(Z.includes("Error"))return[rY,Z];return[FJ,Z]},nY=([$,J])=>$===UJ&&(J==="function"||J==="symbol"),b10=($,J,Z,H)=>{let B=(X,z)=>{let G=H.push(X)-1;return Z.set(z,G),G},Q=(X)=>{if(Z.has(X))return Z.get(X);let[z,G]=HB(X);switch(z){case UJ:{let U=X;switch(G){case"bigint":z=aY,U=X.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+G);U=null;break;case"undefined":return B([iY],X)}return B([z,U],X)}case N6:{if(G){let K=X;if(G==="DataView")K=new Uint8Array(X.buffer);else if(G==="ArrayBuffer")K=new Uint8Array(X);return B([G,[...K]],X)}let U=[],F=B([z,U],X);for(let K of X)U.push(Q(K));return F}case FJ:{if(G)switch(G){case"BigInt":return B([G,X.toString()],X);case"Boolean":case"Number":case"String":return B([G,X.valueOf()],X)}if(J&&"toJSON"in X)return Q(X.toJSON());let U=[],F=B([z,U],X);for(let K of k10(X))if($||!nY(HB(X[K])))U.push([Q(K),Q(X[K])]);return F}case eH:return B([z,X.toISOString()],X);case $B:{let{source:U,flags:F}=X;return B([z,{source:U,flags:F}],X)}case JB:{let U=[],F=B([z,U],X);for(let[K,W]of X)if($||!(nY(HB(K))||nY(HB(W))))U.push([Q(K),Q(W)]);return F}case ZB:{let U=[],F=B([z,U],X);for(let K of X)if($||!nY(HB(K)))U.push(Q(K));return F}}let{message:Y}=X;return B([z,{name:G,message:Y}],X)};return Q},iN=($,{json:J,lossy:Z}={})=>{let H=[];return b10(!(J||Z),!!J,new Map,H)($),H};var WJ=typeof structuredClone==="function"?($,J)=>J&&(("json"in J)||("lossy"in J))?lN(iN($,J)):structuredClone($):($,J)=>lN(iN($,J));function y10($,J){let Z=[{type:"text",value:"↩"}];if(J>1)Z.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(J)}]});return Z}function h10($,J){return"Back to reference "+($+1)+(J>1?"-"+J:"")}function jR($){let J=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",Z=$.options.footnoteBackContent||y10,H=$.options.footnoteBackLabel||h10,B=$.options.footnoteLabel||"Footnotes",Q=$.options.footnoteLabelTagName||"h2",X=$.options.footnoteLabelProperties||{className:["sr-only"]},z=[],G=-1;while(++G<$.footnoteOrder.length){let Y=$.footnoteById.get($.footnoteOrder[G]);if(!Y)continue;let U=$.all(Y),F=String(Y.identifier).toUpperCase(),K=X8(F.toLowerCase()),W=0,q=[],N=$.footnoteCounts.get(F);while(N!==void 0&&++W<=N){if(q.length>0)q.push({type:"text",value:" "});let A=typeof Z==="string"?Z:Z(G,W);if(typeof A==="string")A={type:"text",value:A};q.push({type:"element",tagName:"a",properties:{href:"#"+J+"fnref-"+K+(W>1?"-"+W:""),dataFootnoteBackref:"",ariaLabel:typeof H==="string"?H:H(G,W),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}let V=U[U.length-1];if(V&&V.type==="element"&&V.tagName==="p"){let A=V.children[V.children.length-1];if(A&&A.type==="text")A.value+=" ";else V.children.push({type:"text",value:" "});V.children.push(...q)}else U.push(...q);let L={type:"element",tagName:"li",properties:{id:J+"fn-"+K},children:$.wrap(U,!0)};$.patch(Y,L),z.push(L)}if(z.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:Q,properties:{...WJ(X),id:"footnote-label"},children:[{type:"text",value:B}]},{type:"text",value:`
|
|
34
|
+
`},{type:"element",tagName:"ol",properties:{},children:$.wrap(z,!0)},{type:"text",value:`
|
|
35
|
+
`}]}}var W9=function($){if($===null||$===void 0)return f10;if(typeof $==="function")return oY($);if(typeof $==="object")return Array.isArray($)?x10($):v10($);if(typeof $==="string")return g10($);throw Error("Expected function, string, or object as test")};function x10($){let J=[],Z=-1;while(++Z<$.length)J[Z]=W9($[Z]);return oY(H);function H(...B){let Q=-1;while(++Q<J.length)if(J[Q].apply(this,B))return!0;return!1}}function v10($){let J=$;return oY(Z);function Z(H){let B=H,Q;for(Q in $)if(B[Q]!==J[Q])return!1;return!0}}function g10($){return oY(J);function J(Z){return Z&&Z.type===$}}function oY($){return J;function J(Z,H,B){return Boolean(m10(Z)&&$.call(this,Z,typeof H==="number"?H:void 0,B||void 0))}}function f10(){return!0}function m10($){return $!==null&&typeof $==="object"&&"type"in $}function TR($){return $}var CR=[],sY=!0,L6=!1,tY="skip";function BB($,J,Z,H){let B;if(typeof J==="function"&&typeof Z!=="function")H=Z,Z=J;else B=J;let Q=W9(B),X=H?-1:1;z($,void 0,[])();function z(G,Y,U){let F=G&&typeof G==="object"?G:{};if(typeof F.type==="string"){let W=typeof F.tagName==="string"?F.tagName:typeof F.name==="string"?F.name:void 0;Object.defineProperty(K,"name",{value:"node ("+TR(G.type+(W?"<"+W+">":""))+")"})}return K;function K(){let W=CR,q,N,V;if(!J||Q(G,Y,U[U.length-1]||void 0)){if(W=p10(Z(G,U)),W[0]===L6)return W}if("children"in G&&G.children){let L=G;if(L.children&&W[0]!==tY){N=(H?L.children.length:-1)+X,V=U.concat(L);while(N>-1&&N<L.children.length){let A=L.children[N];if(q=z(A,N,V)(),q[0]===L6)return q;N=typeof q[1]==="number"?q[1]:N+X}}}return W}}}function p10($){if(Array.isArray($))return $;if(typeof $==="number")return[sY,$];return $===null||$===void 0?CR:[$]}function x9($,J,Z,H){let B,Q,X;if(typeof J==="function"&&typeof Z!=="function")Q=void 0,X=J,B=Z;else Q=J,X=Z,B=H;BB($,Q,z,B);function z(G,Y){let U=Y[Y.length-1],F=U?U.children.indexOf(G):void 0;return X(G,F,U)}}function wR($,J){let Z={type:"element",tagName:"blockquote",properties:{},children:$.wrap($.all(J),!0)};return $.patch(J,Z),$.applyData(J,Z)}function ER($,J){let Z={type:"element",tagName:"br",properties:{},children:[]};return $.patch(J,Z),[$.applyData(J,Z),{type:"text",value:`
|
|
36
|
+
`}]}function SR($,J){let Z=J.value?J.value+`
|
|
37
|
+
`:"",H={},B=J.lang?J.lang.split(/\s+/):[];if(B.length>0)H.className=["language-"+B[0]];let Q={type:"element",tagName:"code",properties:H,children:[{type:"text",value:Z}]};if(J.meta)Q.data={meta:J.meta};return $.patch(J,Q),Q=$.applyData(J,Q),Q={type:"element",tagName:"pre",properties:{},children:[Q]},$.patch(J,Q),Q}function IR($,J){let Z={type:"element",tagName:"del",properties:{},children:$.all(J)};return $.patch(J,Z),$.applyData(J,Z)}function RR($,J){let Z={type:"element",tagName:"em",properties:{},children:$.all(J)};return $.patch(J,Z),$.applyData(J,Z)}function kR($,J){let Z=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",H=String(J.identifier).toUpperCase(),B=X8(H.toLowerCase()),Q=$.footnoteOrder.indexOf(H),X,z=$.footnoteCounts.get(H);if(z===void 0)z=0,$.footnoteOrder.push(H),X=$.footnoteOrder.length;else X=Q+1;z+=1,$.footnoteCounts.set(H,z);let G={type:"element",tagName:"a",properties:{href:"#"+Z+"fn-"+B,id:Z+"fnref-"+B+(z>1?"-"+z:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(X)}]};$.patch(J,G);let Y={type:"element",tagName:"sup",properties:{},children:[G]};return $.patch(J,Y),$.applyData(J,Y)}function bR($,J){let Z={type:"element",tagName:"h"+J.depth,properties:{},children:$.all(J)};return $.patch(J,Z),$.applyData(J,Z)}function yR($,J){if($.options.allowDangerousHtml){let Z={type:"raw",value:J.value};return $.patch(J,Z),$.applyData(J,Z)}return}function eY($,J){let Z=J.referenceType,H="]";if(Z==="collapsed")H+="[]";else if(Z==="full")H+="["+(J.label||J.identifier)+"]";if(J.type==="imageReference")return[{type:"text",value:"!["+J.alt+H}];let B=$.all(J),Q=B[0];if(Q&&Q.type==="text")Q.value="["+Q.value;else B.unshift({type:"text",value:"["});let X=B[B.length-1];if(X&&X.type==="text")X.value+=H;else B.push({type:"text",value:H});return B}function hR($,J){let Z=String(J.identifier).toUpperCase(),H=$.definitionById.get(Z);if(!H)return eY($,J);let B={src:X8(H.url||""),alt:J.alt};if(H.title!==null&&H.title!==void 0)B.title=H.title;let Q={type:"element",tagName:"img",properties:B,children:[]};return $.patch(J,Q),$.applyData(J,Q)}function xR($,J){let Z={src:X8(J.url)};if(J.alt!==null&&J.alt!==void 0)Z.alt=J.alt;if(J.title!==null&&J.title!==void 0)Z.title=J.title;let H={type:"element",tagName:"img",properties:Z,children:[]};return $.patch(J,H),$.applyData(J,H)}function vR($,J){let Z={type:"text",value:J.value.replace(/\r?\n|\r/g," ")};$.patch(J,Z);let H={type:"element",tagName:"code",properties:{},children:[Z]};return $.patch(J,H),$.applyData(J,H)}function gR($,J){let Z=String(J.identifier).toUpperCase(),H=$.definitionById.get(Z);if(!H)return eY($,J);let B={href:X8(H.url||"")};if(H.title!==null&&H.title!==void 0)B.title=H.title;let Q={type:"element",tagName:"a",properties:B,children:$.all(J)};return $.patch(J,Q),$.applyData(J,Q)}function fR($,J){let Z={href:X8(J.url)};if(J.title!==null&&J.title!==void 0)Z.title=J.title;let H={type:"element",tagName:"a",properties:Z,children:$.all(J)};return $.patch(J,H),$.applyData(J,H)}function mR($,J,Z){let H=$.all(J),B=Z?u10(Z):pR(J),Q={},X=[];if(typeof J.checked==="boolean"){let U=H[0],F;if(U&&U.type==="element"&&U.tagName==="p")F=U;else F={type:"element",tagName:"p",properties:{},children:[]},H.unshift(F);if(F.children.length>0)F.children.unshift({type:"text",value:" "});F.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:J.checked,disabled:!0},children:[]}),Q.className=["task-list-item"]}let z=-1;while(++z<H.length){let U=H[z];if(B||z!==0||U.type!=="element"||U.tagName!=="p")X.push({type:"text",value:`
|
|
38
|
+
`});if(U.type==="element"&&U.tagName==="p"&&!B)X.push(...U.children);else X.push(U)}let G=H[H.length-1];if(G&&(B||G.type!=="element"||G.tagName!=="p"))X.push({type:"text",value:`
|
|
39
|
+
`});let Y={type:"element",tagName:"li",properties:Q,children:X};return $.patch(J,Y),$.applyData(J,Y)}function u10($){let J=!1;if($.type==="list"){J=$.spread||!1;let Z=$.children,H=-1;while(!J&&++H<Z.length)J=pR(Z[H])}return J}function pR($){let J=$.spread;return J===null||J===void 0?$.children.length>1:J}function uR($,J){let Z={},H=$.all(J),B=-1;if(typeof J.start==="number"&&J.start!==1)Z.start=J.start;while(++B<H.length){let X=H[B];if(X.type==="element"&&X.tagName==="li"&&X.properties&&Array.isArray(X.properties.className)&&X.properties.className.includes("task-list-item")){Z.className=["contains-task-list"];break}}let Q={type:"element",tagName:J.ordered?"ol":"ul",properties:Z,children:$.wrap(H,!0)};return $.patch(J,Q),$.applyData(J,Q)}function cR($,J){let Z={type:"element",tagName:"p",properties:{},children:$.all(J)};return $.patch(J,Z),$.applyData(J,Z)}function dR($,J){let Z={type:"root",children:$.wrap($.all(J))};return $.patch(J,Z),$.applyData(J,Z)}function lR($,J){let Z={type:"element",tagName:"strong",properties:{},children:$.all(J)};return $.patch(J,Z),$.applyData(J,Z)}function iR($,J){let Z=$.all(J),H=Z.shift(),B=[];if(H){let X={type:"element",tagName:"thead",properties:{},children:$.wrap([H],!0)};$.patch(J.children[0],X),B.push(X)}if(Z.length>0){let X={type:"element",tagName:"tbody",properties:{},children:$.wrap(Z,!0)},z=GJ(J.children[1]),G=bY(J.children[J.children.length-1]);if(z&&G)X.position={start:z,end:G};B.push(X)}let Q={type:"element",tagName:"table",properties:{},children:$.wrap(B,!0)};return $.patch(J,Q),$.applyData(J,Q)}function rR($,J,Z){let H=Z?Z.children:void 0,Q=(H?H.indexOf(J):1)===0?"th":"td",X=Z&&Z.type==="table"?Z.align:void 0,z=X?X.length:J.children.length,G=-1,Y=[];while(++G<z){let F=J.children[G],K={},W=X?X[G]:void 0;if(W)K.align=W;let q={type:"element",tagName:Q,properties:K,children:[]};if(F)q.children=$.all(F),$.patch(F,q),q=$.applyData(F,q);Y.push(q)}let U={type:"element",tagName:"tr",properties:{},children:$.wrap(Y,!0)};return $.patch(J,U),$.applyData(J,U)}function aR($,J){let Z={type:"element",tagName:"td",properties:{},children:$.all(J)};return $.patch(J,Z),$.applyData(J,Z)}function oR($){let J=String($),Z=/\r?\n|\r/g,H=Z.exec(J),B=0,Q=[];while(H)Q.push(nR(J.slice(B,H.index),B>0,!0),H[0]),B=H.index+H[0].length,H=Z.exec(J);return Q.push(nR(J.slice(B),B>0,!1)),Q.join("")}function nR($,J,Z){let H=0,B=$.length;if(J){let Q=$.codePointAt(H);while(Q===9||Q===32)H++,Q=$.codePointAt(H)}if(Z){let Q=$.codePointAt(B-1);while(Q===9||Q===32)B--,Q=$.codePointAt(B-1)}return B>H?$.slice(H,B):""}function sR($,J){let Z={type:"text",value:oR(String(J.value))};return $.patch(J,Z),$.applyData(J,Z)}function tR($,J){let Z={type:"element",tagName:"hr",properties:{},children:[]};return $.patch(J,Z),$.applyData(J,Z)}var eR={blockquote:wR,break:ER,code:SR,delete:IR,emphasis:RR,footnoteReference:kR,heading:bR,html:yR,imageReference:hR,image:xR,inlineCode:vR,linkReference:gR,link:fR,listItem:mR,list:uR,paragraph:cR,root:dR,strong:lR,table:iR,tableCell:aR,tableRow:rR,text:sR,thematicBreak:tR,toml:$U,yaml:$U,definition:$U,footnoteDefinition:$U};function $U(){return}var rN={}.hasOwnProperty,c10={};function Jk($,J){let Z=J||c10,H=new Map,B=new Map,Q=new Map,X={...eR,...Z.handlers},z={all:Y,applyData:l10,definitionById:H,footnoteById:B,footnoteCounts:Q,footnoteOrder:[],handlers:X,one:G,options:Z,patch:d10,wrap:r10};return x9($,function(U){if(U.type==="definition"||U.type==="footnoteDefinition"){let F=U.type==="definition"?H:B,K=String(U.identifier).toUpperCase();if(!F.has(K))F.set(K,U)}}),z;function G(U,F){let K=U.type,W=z.handlers[K];if(rN.call(z.handlers,K)&&W)return W(z,U,F);if(z.options.passThrough&&z.options.passThrough.includes(K)){if("children"in U){let{children:N,...V}=U,L=WJ(V);return L.children=z.all(U),L}return WJ(U)}return(z.options.unknownHandler||i10)(z,U,F)}function Y(U){let F=[];if("children"in U){let K=U.children,W=-1;while(++W<K.length){let q=z.one(K[W],U);if(q){if(W&&K[W-1].type==="break"){if(!Array.isArray(q)&&q.type==="text")q.value=$k(q.value);if(!Array.isArray(q)&&q.type==="element"){let N=q.children[0];if(N&&N.type==="text")N.value=$k(N.value)}}if(Array.isArray(q))F.push(...q);else F.push(q)}}}return F}}function d10($,J){if($.position)J.position=_N($)}function l10($,J){let Z=J;if($&&$.data){let H=$.data.hName,B=$.data.hChildren,Q=$.data.hProperties;if(typeof H==="string")if(Z.type==="element")Z.tagName=H;else{let X="children"in Z?Z.children:[Z];Z={type:"element",tagName:H,properties:{},children:X}}if(Z.type==="element"&&Q)Object.assign(Z.properties,WJ(Q));if("children"in Z&&Z.children&&B!==null&&B!==void 0)Z.children=B}return Z}function i10($,J){let Z=J.data||{},H="value"in J&&!(rN.call(Z,"hProperties")||rN.call(Z,"hChildren"))?{type:"text",value:J.value}:{type:"element",tagName:"div",properties:{},children:$.all(J)};return $.patch(J,H),$.applyData(J,H)}function r10($,J){let Z=[],H=-1;if(J)Z.push({type:"text",value:`
|
|
40
|
+
`});while(++H<$.length){if(H)Z.push({type:"text",value:`
|
|
41
|
+
`});Z.push($[H])}if(J&&$.length>0)Z.push({type:"text",value:`
|
|
42
|
+
`});return Z}function $k($){let J=0,Z=$.charCodeAt(J);while(Z===9||Z===32)J++,Z=$.charCodeAt(J);return $.slice(J)}function JU($,J){let Z=Jk($,J),H=Z.one($,void 0),B=jR(Z),Q=Array.isArray(H)?{type:"root",children:H}:H||{type:"root",children:[]};if(B)v1("children"in Q),Q.children.push({type:"text",value:`
|
|
43
|
+
`},B);return Q}function ZU($,J){if($&&"run"in $)return async function(Z,H){let B=JU(Z,{file:H,...J});await $.run(B,H)};return function(Z,H){return JU(Z,{file:H,...$||J})}}function aN($){if($)throw $}var QU=O(Uk(),1);function QB($){if(typeof $!=="object"||$===null)return!1;let J=Object.getPrototypeOf($);return(J===null||J===Object.prototype||Object.getPrototypeOf(J)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}function nN(){let $=[],J={run:Z,use:H};return J;function Z(...B){let Q=-1,X=B.pop();if(typeof X!=="function")throw TypeError("Expected function as last argument, not "+X);z(null,...B);function z(G,...Y){let U=$[++Q],F=-1;if(G){X(G);return}while(++F<B.length)if(Y[F]===null||Y[F]===void 0)Y[F]=B[F];if(B=Y,U)Fk(U,z)(...Y);else X(null,...Y)}}function H(B){if(typeof B!=="function")throw TypeError("Expected `middelware` to be a function, not "+B);return $.push(B),J}}function Fk($,J){let Z;return H;function H(...X){let z=$.length>X.length,G;if(z)X.push(B);try{G=$.apply(this,X)}catch(Y){let U=Y;if(z&&Z)throw U;return B(U)}if(!z)if(G&&G.then&&typeof G.then==="function")G.then(Q,B);else if(G instanceof Error)B(G);else Q(G)}function B(X,...z){if(!Z)Z=!0,J(X,...z)}function Q(X){B(null,X)}}var j8={basename:a10,dirname:n10,extname:o10,join:s10,sep:"/"};function a10($,J){if(J!==void 0&&typeof J!=="string")throw TypeError('"ext" argument must be a string');XB($);let Z=0,H=-1,B=$.length,Q;if(J===void 0||J.length===0||J.length>$.length){while(B--)if($.codePointAt(B)===47){if(Q){Z=B+1;break}}else if(H<0)Q=!0,H=B+1;return H<0?"":$.slice(Z,H)}if(J===$)return"";let X=-1,z=J.length-1;while(B--)if($.codePointAt(B)===47){if(Q){Z=B+1;break}}else{if(X<0)Q=!0,X=B+1;if(z>-1)if($.codePointAt(B)===J.codePointAt(z--)){if(z<0)H=B}else z=-1,H=X}if(Z===H)H=X;else if(H<0)H=$.length;return $.slice(Z,H)}function n10($){if(XB($),$.length===0)return".";let J=-1,Z=$.length,H;while(--Z)if($.codePointAt(Z)===47){if(H){J=Z;break}}else if(!H)H=!0;return J<0?$.codePointAt(0)===47?"/":".":J===1&&$.codePointAt(0)===47?"//":$.slice(0,J)}function o10($){XB($);let J=$.length,Z=-1,H=0,B=-1,Q=0,X;while(J--){let z=$.codePointAt(J);if(z===47){if(X){H=J+1;break}continue}if(Z<0)X=!0,Z=J+1;if(z===46){if(B<0)B=J;else if(Q!==1)Q=1}else if(B>-1)Q=-1}if(B<0||Z<0||Q===0||Q===1&&B===Z-1&&B===H+1)return"";return $.slice(B,Z)}function s10(...$){let J=-1,Z;while(++J<$.length)if(XB($[J]),$[J])Z=Z===void 0?$[J]:Z+"/"+$[J];return Z===void 0?".":t10(Z)}function t10($){XB($);let J=$.codePointAt(0)===47,Z=e10($,!J);if(Z.length===0&&!J)Z=".";if(Z.length>0&&$.codePointAt($.length-1)===47)Z+="/";return J?"/"+Z:Z}function e10($,J){let Z="",H=0,B=-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(B===X-1||Q===1);else if(B!==X-1&&Q===2){if(Z.length<2||H!==2||Z.codePointAt(Z.length-1)!==46||Z.codePointAt(Z.length-2)!==46){if(Z.length>2){if(G=Z.lastIndexOf("/"),G!==Z.length-1){if(G<0)Z="",H=0;else Z=Z.slice(0,G),H=Z.length-1-Z.lastIndexOf("/");B=X,Q=0;continue}}else if(Z.length>0){Z="",H=0,B=X,Q=0;continue}}if(J)Z=Z.length>0?Z+"/..":"..",H=2}else{if(Z.length>0)Z+="/"+$.slice(B+1,X);else Z=$.slice(B+1,X);H=X-B-1}B=X,Q=0}else if(z===46&&Q>-1)Q++;else Q=-1}return Z}function XB($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}var Kk={cwd:$50};function $50(){return"/"}function qJ($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}function Wk($){if(typeof $==="string")$=new URL($);else if(!qJ($)){let J=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+$+"`");throw J.code="ERR_INVALID_ARG_TYPE",J}if($.protocol!=="file:"){let J=TypeError("The URL must be of scheme file");throw J.code="ERR_INVALID_URL_SCHEME",J}return J50($)}function J50($){if($.hostname!==""){let H=TypeError('File URL host must be "localhost" or empty on darwin');throw H.code="ERR_INVALID_FILE_URL_HOST",H}let J=$.pathname,Z=-1;while(++Z<J.length)if(J.codePointAt(Z)===37&&J.codePointAt(Z+1)===50){let H=J.codePointAt(Z+2);if(H===70||H===102){let B=TypeError("File URL path must not include encoded / characters");throw B.code="ERR_INVALID_FILE_URL_PATH",B}}return decodeURIComponent(J)}var oN=["history","path","basename","stem","extname","dirname"];class NJ{constructor($){let J;if(!$)J={};else if(qJ($))J={path:$};else if(typeof $==="string"||Z50($))J={value:$};else J=$;this.cwd="cwd"in J?"":Kk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let Z=-1;while(++Z<oN.length){let B=oN[Z];if(B in J&&J[B]!==void 0&&J[B]!==null)this[B]=B==="history"?[...J[B]]:J[B]}let H;for(H in J)if(!oN.includes(H))this[H]=J[H]}get basename(){return typeof this.path==="string"?j8.basename(this.path):void 0}set basename($){tN($,"basename"),sN($,"basename"),this.path=j8.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?j8.dirname(this.path):void 0}set dirname($){qk(this.basename,"dirname"),this.path=j8.join($||"",this.basename)}get extname(){return typeof this.path==="string"?j8.extname(this.path):void 0}set extname($){if(sN($,"extname"),qk(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=j8.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(qJ($))$=Wk($);if(tN($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?j8.basename(this.path,this.extname):void 0}set stem($){tN($,"stem"),sN($,"stem"),this.path=j8.join(this.dirname||"",$+(this.extname||""))}fail($,J,Z){let H=this.message($,J,Z);throw H.fatal=!0,H}info($,J,Z){let H=this.message($,J,Z);return H.fatal=void 0,H}message($,J,Z){let H=new s5($,J,Z);if(this.path)H.name=this.path+":"+H.name,H.file=this.path;return H.fatal=!1,this.messages.push(H),H}toString($){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder($||void 0).decode(this.value)}}function sN($,J){if($&&$.includes(j8.sep))throw Error("`"+J+"` cannot be a path: did not expect `"+j8.sep+"`")}function tN($,J){if(!$)throw Error("`"+J+"` cannot be empty")}function qk($,J){if(!$)throw Error("Setting `"+J+"` requires `path` to be set too")}function Z50($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var Nk=function($){let H=this.constructor.prototype,B=H[$],Q=function(){return B.apply(Q,arguments)};return Object.setPrototypeOf(Q,H),Q};var H50={}.hasOwnProperty;class ZL extends Nk{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=nN()}copy(){let $=new ZL,J=-1;while(++J<this.attachers.length){let Z=this.attachers[J];$.use(...Z)}return $.data(QU.default(!0,{},this.namespace)),$}data($,J){if(typeof $==="string"){if(arguments.length===2)return JL("data",this.frozen),this.namespace[$]=J,this;return H50.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return JL("data",this.frozen),this.namespace=$,this;return this.namespace}freeze(){if(this.frozen)return this;let $=this;while(++this.freezeIndex<this.attachers.length){let[J,...Z]=this.attachers[this.freezeIndex];if(Z[0]===!1)continue;if(Z[0]===!0)Z[0]=void 0;let H=J.call($,...Z);if(typeof H==="function")this.transformers.use(H)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse($){this.freeze();let J=BU($),Z=this.parser||this.Parser;return eN("parse",Z),Z(String(J),J)}process($,J){let Z=this;return this.freeze(),eN("process",this.parser||this.Parser),$L("process",this.compiler||this.Compiler),J?H(void 0,J):new Promise(H);function H(B,Q){let X=BU($),z=Z.parse(X);Z.run(z,X,function(Y,U,F){if(Y||!U||!F)return G(Y);let K=U,W=Z.stringify(K,F);if(Q50(W))F.value=W;else F.result=W;G(Y,F)});function G(Y,U){if(Y||!U)Q(Y);else if(B)B(U);else v1(J,"`done` is defined if `resolve` is not"),J(void 0,U)}}}processSync($){let J=!1,Z;return this.freeze(),eN("processSync",this.parser||this.Parser),$L("processSync",this.compiler||this.Compiler),this.process($,H),Vk("processSync","process",J),v1(Z,"we either bailed on an error or have a tree"),Z;function H(B,Q){J=!0,aN(B),Z=Q}}run($,J,Z){Lk($),this.freeze();let H=this.transformers;if(!Z&&typeof J==="function")Z=J,J=void 0;return Z?B(void 0,Z):new Promise(B);function B(Q,X){v1(typeof J!=="function","`file` can’t be a `done` anymore, we checked");let z=BU(J);H.run($,z,G);function G(Y,U,F){let K=U||$;if(Y)X(Y);else if(Q)Q(K);else v1(Z,"`done` is defined if `resolve` is not"),Z(void 0,K,F)}}}runSync($,J){let Z=!1,H;return this.run($,J,B),Vk("runSync","run",Z),v1(H,"we either bailed on an error or have a tree"),H;function B(Q,X){aN(Q),H=X,Z=!0}}stringify($,J){this.freeze();let Z=BU(J),H=this.compiler||this.Compiler;return $L("stringify",H),Lk($),H($,Z)}use($,...J){let Z=this.attachers,H=this.namespace;if(JL("use",this.frozen),$===null||$===void 0);else if(typeof $==="function")z($,J);else if(typeof $==="object")if(Array.isArray($))X($);else Q($);else throw TypeError("Expected usable value, not `"+$+"`");return this;function B(G){if(typeof G==="function")z(G,[]);else if(typeof G==="object")if(Array.isArray(G)){let[Y,...U]=G;z(Y,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)H.settings=QU.default(!0,H.settings,G.settings)}function X(G){let Y=-1;if(G===null||G===void 0);else if(Array.isArray(G))while(++Y<G.length){let U=G[Y];B(U)}else throw TypeError("Expected a list of plugins, not `"+G+"`")}function z(G,Y){let U=-1,F=-1;while(++U<Z.length)if(Z[U][0]===G){F=U;break}if(F===-1)Z.push([G,...Y]);else if(Y.length>0){let[K,...W]=Y,q=Z[F][1];if(QB(q)&&QB(K))K=QU.default(!0,q,K);Z[F]=[G,K,...W]}}}}var HL=new ZL().freeze();function eN($,J){if(typeof J!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function $L($,J){if(typeof J!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function JL($,J){if(J)throw Error("Cannot call `"+$+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Lk($){if(!QB($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function Vk($,J,Z){if(!Z)throw Error("`"+$+"` finished async. Use `"+J+"` instead")}function BU($){return B50($)?$:new NJ($)}function B50($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function Q50($){return typeof $==="string"||X50($)}function X50($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var z50="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ak=[],Dk={allowDangerousHtml:!0},G50=/^(https?|ircs?|mailto|xmpp)$/i,Y50=[{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 XU($){let J=U50($),Z=F50($);return K50(J.runSync(J.parse(Z),Z),$)}function U50($){let J=$.rehypePlugins||Ak,Z=$.remarkPlugins||Ak,H=$.remarkRehypeOptions?{...$.remarkRehypeOptions,...Dk}:Dk;return HL().use(lY).use(Z).use(ZU,H).use(J)}function F50($){let J=$.children||"",Z=new NJ;if(typeof J==="string")Z.value=J;else wY("Unexpected value `"+J+"` for `children` prop, expected `string`");return Z}function K50($,J){let{allowedElements:Z,allowElement:H,components:B,disallowedElements:Q,skipHtml:X,unwrapDisallowed:z}=J,G=J.urlTransform||Pk;for(let U of Y50)if(Object.hasOwn(J,U.from))wY("Unexpected `"+U.from+"` prop, "+(U.to?"use `"+U.to+"` instead":"remove it")+" (see <"+z50+"#"+U.id+"> for more info)");if(Z&&Q)wY("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return x9($,Y),TN($,{Fragment:LJ.Fragment,components:B,ignoreInvalidStyle:!0,jsx:LJ.jsx,jsxs:LJ.jsxs,passKeys:!0,passNode:!0});function Y(U,F,K){if(U.type==="raw"&&K&&typeof F==="number"){if(X)K.children.splice(F,1);else K.children[F]={type:"text",value:U.value};return F}if(U.type==="element"){let W;for(W in rH)if(Object.hasOwn(rH,W)&&Object.hasOwn(U.properties,W)){let q=U.properties[W],N=rH[W];if(N===null||N.includes(U.tagName))U.properties[W]=G(String(q||""),W,U)}}if(U.type==="element"){let W=Z?!Z.includes(U.tagName):Q?Q.includes(U.tagName):!1;if(!W&&H&&typeof F==="number")W=!H(U,F,K);if(W&&K&&typeof F==="number"){if(z&&U.children)K.children.splice(F,1,...U.children);else K.children.splice(F,1);return F}}}}function Pk($){let J=$.indexOf(":"),Z=$.indexOf("?"),H=$.indexOf("#"),B=$.indexOf("/");if(J===-1||B!==-1&&J>B||Z!==-1&&J>Z||H!==-1&&J>H||G50.test($.slice(0,J)))return $;return""}var zU=function($,J,Z){let H=W9(Z);if(!$||!$.type||!$.children)throw Error("Expected parent node");if(typeof J==="number"){if(J<0||J===Number.POSITIVE_INFINITY)throw Error("Expected positive finite number as index")}else if(J=$.children.indexOf(J),J<0)throw Error("Expected child node or index");while(++J<$.children.length)if(H($.children[J],J,$))return $.children[J];return};var v9=function($){if($===null||$===void 0)return N50;if(typeof $==="string")return q50($);if(typeof $==="object")return W50($);if(typeof $==="function")return BL($);throw Error("Expected function, string, or array as `test`")};function W50($){let J=[],Z=-1;while(++Z<$.length)J[Z]=v9($[Z]);return BL(H);function H(...B){let Q=-1;while(++Q<J.length)if(J[Q].apply(this,B))return!0;return!1}}function q50($){return BL(J);function J(Z){return Z.tagName===$}}function BL($){return J;function J(Z,H,B){return Boolean(L50(Z)&&$.call(this,Z,typeof H==="number"?H:void 0,B||void 0))}}function N50($){return Boolean($&&typeof $==="object"&&"type"in $&&$.type==="element"&&"tagName"in $&&typeof $.tagName==="string")}function L50($){return $!==null&&typeof $==="object"&&"type"in $&&"tagName"in $}var _k=/\n/g,Ok=/[\t ]+/g,QL=v9("br"),jk=v9(O50),V50=v9("p"),Tk=v9("tr"),A50=v9(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",_50,j50]),Ck=v9(["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 XL($,J){let Z=J||{},H="children"in $?$.children:[],B=Ck($),Q=Sk($,{whitespace:Z.whitespace||"normal",breakBefore:!1,breakAfter:!1}),X=[];if($.type==="text"||$.type==="comment")X.push(...Ek($,{whitespace:Q,breakBefore:!0,breakAfter:!0}));let z=-1;while(++z<H.length)X.push(...wk(H[z],$,{whitespace:Q,breakBefore:z?void 0:B,breakAfter:z<H.length-1?QL(H[z+1]):B}));let G=[],Y;z=-1;while(++z<X.length){let U=X[z];if(typeof U==="number"){if(Y!==void 0&&U>Y)Y=U}else if(U){if(Y!==void 0&&Y>-1)G.push(`
|
|
44
|
+
`.repeat(Y)||" ");Y=-1,G.push(U)}}return G.join("")}function wk($,J,Z){if($.type==="element")return D50($,J,Z);if($.type==="text")return Z.whitespace==="normal"?Ek($,Z):M50($);return[]}function D50($,J,Z){let H=Sk($,Z),B=$.children||[],Q=-1,X=[];if(A50($))return X;let z,G;if(QL($))G=`
|
|
45
|
+
`;else if(Tk($)&&zU(J,$,Tk))G=`
|
|
46
|
+
`;else if(V50($))z=2,G=2;else if(Ck($))z=1,G=1;while(++Q<B.length)X=X.concat(wk(B[Q],$,{whitespace:H,breakBefore:Q?void 0:z,breakAfter:Q<B.length-1?QL(B[Q+1]):G}));if(jk($)&&zU(J,$,jk))X.push("\t");if(z)X.unshift(z);if(G)X.push(G);return X}function Ek($,J){let Z=String($.value),H=[],B=[],Q=0;while(Q<=Z.length){_k.lastIndex=Q;let G=_k.exec(Z),Y=G&&"index"in G?G.index:Z.length;H.push(P50(Z.slice(Q,Y).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),Q===0?J.breakBefore:!0,Y===Z.length?J.breakAfter:!0)),Q=Y+1}let X=-1,z;while(++X<H.length)if(H[X].charCodeAt(H[X].length-1)===8203||X<H.length-1&&H[X+1].charCodeAt(0)===8203)B.push(H[X]),z=void 0;else if(H[X]){if(typeof z==="number")B.push(z);B.push(H[X]),z=0}else if(X===0||X===H.length-1)B.push(0);return B}function M50($){return[String($.value)]}function P50($,J,Z){let H=[],B=0,Q;while(B<$.length){Ok.lastIndex=B;let X=Ok.exec($);if(Q=X?X.index:$.length,!B&&!Q&&X&&!J)H.push("");if(B!==Q)H.push($.slice(B,Q));B=X?Q+X[0].length:Q}if(B!==Q&&!Z)H.push("");return H.join(" ")}function Sk($,J){if($.type==="element"){let Z=$.properties||{};switch($.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return Z.wrap?"pre-wrap":"pre";case"td":case"th":return Z.noWrap?"nowrap":J.whitespace;case"textarea":return"pre-wrap";default:}}return J.whitespace}function _50($){return Boolean(($.properties||{}).hidden)}function O50($){return $.tagName==="td"||$.tagName==="th"}function j50($){return $.tagName==="dialog"&&!($.properties||{}).open}function T50($){let J=$.regex,Z=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(?!struct)(decltype\\(auto\\)|"+J.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+J.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)",Y={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},F={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(Y,{className:"string"}),{className:"string",begin:/<.*?>/},Z,$.C_BLOCK_COMMENT_MODE]},K={className:"title",begin:J.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=J.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",q=["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"],N=["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"],L=["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:N,keyword:q,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:V},P={className:"function.dispatch",relevance:0,keywords:{_hint:L},begin:J.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,J.lookahead(/(<[^<>]+>|)\s*\(/))},D=[P,F,z,Z,$.C_BLOCK_COMMENT_MODE,U,Y],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:D.concat([{begin:/\(/,end:/\)/,keywords:_,contains:D.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:[Y,U]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[Z,$.C_BLOCK_COMMENT_MODE,Y,U,z,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",Z,$.C_BLOCK_COMMENT_MODE,Y,U,z]}]},z,Z,$.C_BLOCK_COMMENT_MODE,F]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(w,R,P,D,[F,{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 Ik($){let J={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"]},Z=T50($),H=Z.keywords;return H.type=[...H.type,...J.type],H.literal=[...H.literal,...J.literal],H.built_in=[...H.built_in,...J.built_in],H._hints=J._hints,Z.name="Arduino",Z.aliases=["ino"],Z.supersetOf="cpp",Z}function Rk($){let J=$.regex,Z={},H={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[Z]}]};Object.assign(Z,{className:"variable",variants:[{begin:J.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},H]});let B={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,Z,B]};B.contains.push(z);let G={match:/\\"/},Y={className:"string",begin:/'/,end:/'/},U={match:/\\'/},F={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},$.NUMBER_MODE,Z]},K=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],W=$.SHEBANG({binary:`(${K.join("|")})`,relevance:10}),q={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[$.inherit($.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},N=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],V=["true","false"],L={match:/(\/[a-z._-]+)+/},A=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],M=["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"],P=["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:N,literal:V,built_in:[...A,...M,"set","shopt",..._,...P]},contains:[W,$.SHEBANG(),q,F,Q,X,L,z,G,Y,U,Z]}}function kk($){let J=$.regex,Z=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(decltype\\(auto\\)|"+J.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+J.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)",Y={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},F={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(Y,{className:"string"}),{className:"string",begin:/<.*?>/},Z,$.C_BLOCK_COMMENT_MODE]},K={className:"title",begin:J.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=J.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"},L=[F,z,Z,$.C_BLOCK_COMMENT_MODE,U,Y],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:V,contains:L.concat([{begin:/\(/,end:/\)/,keywords:V,contains:L.concat(["self"]),relevance:0}]),relevance:0},M={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:[Z,$.C_BLOCK_COMMENT_MODE,Y,U,z,{begin:/\(/,end:/\)/,keywords:V,relevance:0,contains:["self",Z,$.C_BLOCK_COMMENT_MODE,Y,U,z]}]},z,Z,$.C_BLOCK_COMMENT_MODE,F]};return{name:"C",aliases:["h"],keywords:V,disableAutodetect:!0,illegal:"</",contains:[].concat(A,M,L,[F,{begin:$.IDENT_RE+"::",keywords:V},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},$.TITLE_MODE]}]),exports:{preprocessor:F,strings:Y,keywords:V}}}function bk($){let J=$.regex,Z=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(?!struct)(decltype\\(auto\\)|"+J.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+J.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)",Y={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},F={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(Y,{className:"string"}),{className:"string",begin:/<.*?>/},Z,$.C_BLOCK_COMMENT_MODE]},K={className:"title",begin:J.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=J.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",q=["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"],N=["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"],L=["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:N,keyword:q,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:V},P={className:"function.dispatch",relevance:0,keywords:{_hint:L},begin:J.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,J.lookahead(/(<[^<>]+>|)\s*\(/))},D=[P,F,z,Z,$.C_BLOCK_COMMENT_MODE,U,Y],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:D.concat([{begin:/\(/,end:/\)/,keywords:_,contains:D.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:[Y,U]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[Z,$.C_BLOCK_COMMENT_MODE,Y,U,z,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",Z,$.C_BLOCK_COMMENT_MODE,Y,U,z]}]},z,Z,$.C_BLOCK_COMMENT_MODE,F]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(w,R,P,D,[F,{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 yk($){let J=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],Z=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],H=["default","false","null","true"],B=["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:B.concat(Q),built_in:J,literal:H},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},Y={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},U={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},F=$.inherit(U,{illegal:/\n/}),K={className:"subst",begin:/\{/,end:/\}/,keywords:X},W=$.inherit(K,{illegal:/\n/}),q={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},$.BACKSLASH_ESCAPE,W]},N={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},K]},V=$.inherit(N,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},W]});K.contains=[N,q,U,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.C_BLOCK_COMMENT_MODE],W.contains=[V,q,F,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.inherit($.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let L={variants:[Y,N,q,U,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},A={begin:"<",end:">",contains:[{beginKeywords:"in out"},z]},M=$.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"}},L,G,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},z,A,$.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,A,$.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:"("+M+"\\s+)+"+$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:X,contains:[{beginKeywords:Z.join(" "),relevance:0},{begin:$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[$.TITLE_MODE,A],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:X,relevance:0,contains:[L,G,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},_]}}var C50=($)=>{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_-]*/}}},w50=["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"],E50=["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"],S50=[...w50,...E50],I50=["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(),R50=["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(),k50=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),b50=["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 hk($){let J=$.regex,Z=C50($),H={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},B="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:[Z.BLOCK_COMMENT,H,Z.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},Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+R50.join("|")+")"},{begin:":(:)?("+k50.join("|")+")"}]},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+b50.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[Z.BLOCK_COMMENT,Z.HEXCOLOR,Z.IMPORTANT,Z.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}]},Z.FUNCTION_DISPATCH]},{begin:J.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:I50.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...z,Z.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+S50.join("|")+")\\b"}]}}function xk($){let J=$.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:J.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:J.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 vk($){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 gk($){let J=$.regex,Z=/[_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:J.concat(Z,J.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function fk($){let J=$.regex,Z={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:$.NUMBER_RE}]},H=$.COMMENT();H.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let B={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:[H,Q,B,X,Z,"self"],relevance:0},G=/[A-Za-z0-9_-]+/,Y=/"(\\"|[^"])*"/,U=/'[^']*'/,F=J.either(G,Y,U),K=J.concat(F,"(\\s*\\.\\s*",F,")*",J.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[H,{className:"section",begin:/\[+/,end:/\]+/},{begin:K,className:"attr",starts:{end:/$/,contains:[H,z,Q,B,X,Z]}}]}}var VJ="[0-9](_*[0-9])*",GU=`\\.(${VJ})`,YU="[0-9a-fA-F](_*[0-9a-fA-F])*",mk={className:"number",variants:[{begin:`(\\b(${VJ})((${GU})|\\.)?|(${GU}))[eE][+-]?(${VJ})[fFdD]?\\b`},{begin:`\\b(${VJ})((${GU})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${GU})[fFdD]?\\b`},{begin:`\\b(${VJ})[fFdD]\\b`},{begin:`\\b0[xX]((${YU})\\.?|(${YU})?\\.(${YU}))[pP][+-]?(${VJ})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${YU})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function pk($,J,Z){if(Z===-1)return"";return $.replace(J,(H)=>{return pk($,J,Z-1)})}function uk($){let J=$.regex,Z="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",H="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+pk("(?:<"+"[À-ʸ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"]},Y={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:[J.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:["(?:"+H+"\\s+)",$.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:G,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[Y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,mk,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},mk,Y]}}var y50=["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"],h50=["true","false","null","undefined","NaN","Infinity"],ck=["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"],dk=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],lk=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],x50=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],v50=[].concat(lk,ck,dk);function ik($){let J=$.regex,Z=(v,{after:u})=>{let T="</"+v[0].slice(1);return v.input.indexOf(T,u)!==-1},H="[A-Za-z$_][0-9A-Za-z$_]*",B={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,u)=>{let T=v[0].length+v.index,t=v.input[T];if(t==="<"||t===","){u.ignoreMatch();return}if(t===">"){if(!Z(v,{after:T}))u.ignoreMatch()}let B0,h=v.input.substring(T);if(B0=h.match(/^\s*=/)){u.ignoreMatch();return}if(B0=h.match(/^\s+extends\s+/)){if(B0.index===0){u.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:y50,literal:h50,built_in:v50,"variable.language":x50},G="[0-9](_?[0-9])*",Y="\\.([0-9](_?[0-9])*)",U="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",F={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"}},q={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"graphql"}},V={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,K]},A={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]},M=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,V,{match:/\$\d+/},F];K.contains=M.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(M)});let _=[].concat(A,K.contains),P=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(_)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:P},w={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,J.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",J.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:J.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:{_:[...ck,...dk]}},b={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},E={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:[D],illegal:/%/},x={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function I(v){return J.concat("(?!",v.join("|"),")")}let S={match:J.concat(/\b/,I([...lk,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",J.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={begin:J.concat(/\./,J.lookahead(J.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},C={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},k="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",y={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,J.lookahead(k)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),b,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,V,A,{match:/\$\d+/},F,R,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+J.lookahead(":"),relevance:0},y,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,$.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:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:B.begin,end:B.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"]}]}]},E,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,$.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:[D]},S,x,w,C,{match:/\$[(.]/}]}}function rk($){let J={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},Z={match:/[{}[\],:]/,className:"punctuation",relevance:0},H=["true","false","null"],B={scope:"literal",beginKeywords:H.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:H},contains:[J,Z,$.QUOTE_STRING_MODE,B,$.C_NUMBER_MODE,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var AJ="[0-9](_*[0-9])*",UU=`\\.(${AJ})`,FU="[0-9a-fA-F](_*[0-9a-fA-F])*",g50={className:"number",variants:[{begin:`(\\b(${AJ})((${UU})|\\.)?|(${UU}))[eE][+-]?(${AJ})[fFdD]?\\b`},{begin:`\\b(${AJ})((${UU})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${UU})[fFdD]?\\b`},{begin:`\\b(${AJ})[fFdD]\\b`},{begin:`\\b0[xX]((${FU})\\.?|(${FU})?\\.(${FU}))[pP][+-]?(${AJ})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${FU})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function ak($){let J={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"},Z={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},H={className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"@"},B={className:"subst",begin:/\$\{/,end:/\}/,contains:[$.C_NUMBER_MODE]},Q={className:"variable",begin:"\\$"+$.UNDERSCORE_IDENT_RE},X={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[Q,B]},{begin:"'",end:"'",illegal:/\n/,contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[$.BACKSLASH_ESCAPE,Q,B]}]};B.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"]}]},Y=g50,U=$.COMMENT("/\\*","\\*/",{contains:[$.C_BLOCK_COMMENT_MODE]}),F={variants:[{className:"type",begin:$.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},K=F;return K.variants[1].contains=[F],F.variants[1].contains=[K],{name:"Kotlin",aliases:["kt","kts"],keywords:J,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),$.C_LINE_COMMENT_MODE,U,Z,H,z,G,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:J,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:J,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[F,$.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
|
+
`},Y]}}var f50=($)=>{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_-]*/}}},m50=["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"],p50=["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"],u50=[...m50,...p50],c50=["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(),nk=["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(),ok=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d50=["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(),l50=nk.concat(ok).sort().reverse();function sk($){let J=f50($),Z=l50,H="and or not only",B="[\\w-]+",Q="([\\w-]+|@\\{[\\w-]+\\})",X=[],z=[],G=function(M){return{className:"string",begin:"~?"+M+".*?"+M}},Y=function(M,_,P){return{className:M,begin:_,relevance:P}},U={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:c50.join(" ")},F={begin:"\\(",end:"\\)",contains:z,keywords:U,relevance:0};z.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,G("'"),G('"'),J.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},J.HEXCOLOR,F,Y("variable","@@?[\\w-]+",10),Y("variable","@\\{[\\w-]+\\}"),Y("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},J.IMPORTANT,{beginKeywords:"and not"},J.FUNCTION_DISPATCH);let K=z.concat({begin:/\{/,end:/\}/,contains:X}),W={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(z)},q={begin:Q+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d50.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:z}}]},N={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}},L={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:Q,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,W,Y("keyword","all\\b"),Y("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+u50.join("|")+")\\b",className:"selector-tag"},J.CSS_NUMBER_MODE,Y("selector-tag",Q,0),Y("selector-id","#"+Q),Y("selector-class","\\."+Q,0),Y("selector-tag","&",0),J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+nk.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+ok.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:K},{begin:"!important"},J.FUNCTION_DISPATCH]},A={begin:`[\\w-]+:(:)?(${Z.join("|")})`,returnBegin:!0,contains:[L]};return X.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,N,V,A,q,L,W,J.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:X}}function tk($){let H={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},B=[$.COMMENT("--(?!\\[=*\\[)","$"),$.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[H],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:B.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:B}].concat(B)},$.C_NUMBER_MODE,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[H],relevance:5}])}}function ek($){let J={className:"variable",variants:[{begin:"\\$\\("+$.UNDERSCORE_IDENT_RE+"\\)",contains:[$.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},Z={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,J]},H={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:[J,Z]},B={begin:"^"+$.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},Q={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},X={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[J]};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,J,Z,H,B,Q,X]}}function $b($){let J=$.regex,Z={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},H={begin:"^[-\\*]{3,}",end:"$"},B={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:J.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}]},Y={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}]},F=$.inherit(Y,{contains:[]}),K=$.inherit(U,{contains:[]});Y.contains.push(K),U.contains.push(F);let W=[Z,G];return[Y,U,F,K].forEach((L)=>{L.contains=L.contains.concat(W)}),W=W.concat(Y,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}]}]},Z,Q,Y,U,{className:"quote",begin:"^>\\s+",contains:W,end:"$"},B,H,G,X,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Jb($){let J={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+"},Z=/[a-zA-Z@][a-zA-Z0-9_]*/,z={"variable.language":["this","super"],$pattern:Z,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:Z,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:z,illegal:"</",contains:[J,$.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 Zb($){let J=$.regex,Z=["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"],H=/[dualxmsipngr]{0,12}/,B={$pattern:/[\w.]+/,keyword:Z.join(" ")},Q={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:B},X={begin:/->\{/,end:/\}/},z={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},G={scope:"variable",variants:[{begin:/\$\d/},{begin:J.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[z]},Y={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],F=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],K=(N,V,L="\\1")=>{let A=L==="\\1"?L:J.concat(L,V);return J.concat(J.concat("(?:",N,")"),V,/(?:\\.|[^\\\/])*?/,A,/(?:\\.|[^\\\/])*?/,L,H)},W=(N,V,L)=>{return J.concat(J.concat("(?:",N,")"),V,/(?:\\.|[^\\\/])*?/,L,H)},q=[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}]},Y,{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",J.either(...F,{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",J.either(...F,{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,Y]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return Q.contains=q,X.contains=q,{name:"Perl",aliases:["pl","pm"],keywords:B,contains:q}}function Hb($){let J=$.regex,Z=/(?![A-Za-z0-9])(?![$])/,H=J.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,Z),B=J.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,Z),Q=J.concat(/[A-Z]+/,Z),X={scope:"variable",match:"\\$+"+H},z={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},G={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},Y=$.inherit($.APOS_STRING_MODE,{illegal:null}),U=$.inherit($.QUOTE_STRING_MODE,{illegal:null,contains:$.QUOTE_STRING_MODE.contains.concat(G)}),F={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:$.QUOTE_STRING_MODE.contains.concat(G),"on:begin":(j,C)=>{C.data._beginMatch=j[1]||j[2]},"on:end":(j,C)=>{if(C.data._beginMatch!==j[1])C.ignoreMatch()}},K=$.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),W=`[
|
|
48
|
+
]`,q={scope:"string",variants:[U,Y,F,K]},N={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"],L=["__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"],A=["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:L,literal:((j)=>{let C=[];return j.forEach((k)=>{if(C.push(k),k.toLowerCase()===k)C.push(k.toUpperCase());else C.push(k.toLowerCase())}),C})(V),built_in:A},P=(j)=>{return j.map((C)=>{return C.replace(/\|\d+$/,"")})},D={variants:[{match:[/new/,J.concat(`[
|
|
49
|
+
]`,"+"),J.concat("(?!",P(A).join("\\b|"),"\\b)"),B],scope:{1:"keyword",4:"title.class"}}]},w=J.concat(H,"\\b(?!\\()"),R={variants:[{match:[J.concat(/::/,J.lookahead(/(?!class\b)/)),w],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[B,J.concat(/::/,J.lookahead(/(?!class\b)/)),w],scope:{1:"title.class",3:"variable.constant"}},{match:[B,J.concat("::",J.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[B,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},b={scope:"attr",match:J.concat(H,J.lookahead(":"),J.lookahead(/(?!::)/))},E={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[b,X,R,$.C_BLOCK_COMMENT_MODE,q,N,D]},x={relevance:0,match:[/\b/,J.concat("(?!fn\\b|function\\b|",P(L).join("\\b|"),"|",P(A).join("\\b|"),"\\b)"),H,J.concat(`[
|
|
50
|
+
]`,"*"),J.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[E]};E.contains.push(x);let I=[b,R,$.C_BLOCK_COMMENT_MODE,q,N,D],S={begin:J.concat(/#\[\s*\\?/,J.either(B,Q)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:V,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:V,keyword:["new","array"]},contains:["self",...I]},...I,{scope:"meta",variants:[{match:B},{match:Q}]}]};return{case_insensitive:!1,keywords:_,contains:[S,$.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,x,R,{match:[/const/,/\s/,H],scope:{1:"keyword",3:"variable.constant"}},D,{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",S,X,R,$.C_BLOCK_COMMENT_MODE,q,N]}]},{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]},q,N]}}function Bb($){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 Qb($){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Xb($){let J=$.regex,Z=/[\p{XID_Start}_]\p{XID_Continue}*/u,H=["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:H,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:/^(>>>|\.\.\.) /},Y={className:"subst",begin:/\{/,end:/\}/,keywords:z,illegal:/#/},U={begin:/\{\{/,relevance:0},F={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,Y]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G,U,Y]},{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,Y]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,U,Y]},$.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])*)\\.",q=`\\b|${H.join("|")}`,N={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]?(?=${q})`},{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]?(?=${q})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${q})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${q})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${q})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${q})`}]},V={className:"comment",begin:J.lookahead(/# type:/),end:/$/,keywords:z,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},L={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:["self",G,N,F,$.HASH_COMMENT_MODE]}]};return Y.contains=[F,N,G],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:z,illegal:/(<\/|\?)|=>/,contains:[G,N,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},F,V,$.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,Z],scope:{1:"keyword",3:"title.function"},contains:[L]},{variants:[{match:[/\bclass/,/\s+/,Z,/\s*/,/\(\s*/,Z,/\s*\)/]},{match:[/\bclass/,/\s+/,Z]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[N,L,F]}]}}function zb($){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Gb($){let J=$.regex,Z=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,H=J.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]?/),B=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,Q=J.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:Z,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:J.lookahead(J.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:Z},{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:[B,H]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,H]},{scope:{1:"punctuation",2:"number"},match:[Q,H]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,H]}]},{scope:{3:"operator"},match:[Z,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:B},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:Q},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Yb($){let J=$.regex,Z="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",H=J.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),B=J.concat(H,/(::\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:">"},Y=[$.COMMENT("#","$",{contains:[z]}),$.COMMENT("^=begin","^=end",{contains:[z],relevance:10}),$.COMMENT("^__END__",$.MATCH_NOTHING_RE)],U={className:"subst",begin:/#\{/,end:/\}/,keywords:X},F={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:J.concat(/<<[-~]?'?/,J.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])*",q={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"}]},N={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:X}]},D=[F,{variants:[{match:[/class\s+/,B,/\s+<\s+/,B]},{match:[/\b(class|module)\s+/,B]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:X},{match:[/(include|extend)\s+/,B],scope:{2:"title.class"},keywords:X},{relevance:0,match:[B,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:H,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[N]},{begin:$.IDENT_RE+"::"},{className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[F,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},q,{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,Y),relevance:0}].concat(G,Y);U.contains=D,N.contains=D;let w="[>?]>",R="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",b="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",E=[{begin:/^\s*=>/,starts:{end:"$",contains:D}},{className:"meta.prompt",begin:"^("+w+"|"+R+"|"+b+")(?=[ ])",starts:{end:"$",keywords:X,contains:D}}];return Y.unshift(G),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:X,illegal:/\/\*/,contains:[$.SHEBANG({binary:"ruby"})].concat(E).concat(Y).concat(D)}}function Ub($){let J=$.regex,Z=/(r#)?/,H=J.concat(Z,$.UNDERSCORE_IDENT_RE),B=J.concat(Z,$.IDENT_RE),Q={className:"title.function.invoke",relevance:0,begin:J.concat(/\b/,/(?!let|for|while|if|else|match\b)/,B,J.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"],Y=["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:Y},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+/,H],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,H],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,H,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,H],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,H],className:{1:"keyword",3:"title.class"}},{begin:$.IDENT_RE+"::",keywords:{keyword:"Self",built_in:Y,type:U}},{className:"punctuation",begin:"->"},Q]}}var i50=($)=>{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_-]*/}}},r50=["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"],a50=["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"],n50=[...r50,...a50],o50=["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(),s50=["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(),t50=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),e50=["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 Fb($){let J=i50($),Z=t50,H=s50,B="@[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,J.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+n50.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+H.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Z.join("|")+")"},z,{begin:/\(/,end:/\)/,contains:[J.CSS_NUMBER_MODE]},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+e50.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:[J.BLOCK_COMMENT,z,J.HEXCOLOR,J.CSS_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,J.IMPORTANT,J.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:o50.join(" ")},contains:[{begin:"@[a-z-]+",className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},z,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,J.HEXCOLOR,J.CSS_NUMBER_MODE]},J.FUNCTION_DISPATCH]}}function Kb($){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Wb($){let J=$.regex,Z=$.COMMENT("--","$"),H={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},B={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"],Y=["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"],F=["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,q=[...Y,...G].filter((P)=>{return!U.includes(P)}),N={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},V={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},L={match:J.concat(/\b/,J.either(...W),/\s*\(/),relevance:0,keywords:{built_in:W}};function A(P){return J.concat(/\b/,J.either(...P.map((D)=>{return D.replace(/\s+/,"\\s+")})),/\b/)}let M={scope:"keyword",match:A(K),relevance:0};function _(P,{exceptions:D,when:w}={}){let R=w;return D=D||[],P.map((b)=>{if(b.match(/\|\d+$/)||D.includes(b))return b;else if(R(b))return`${b}|0`;else return b})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(q,{when:(P)=>P.length<3}),literal:Q,type:z,built_in:F},contains:[{scope:"type",match:A(X)},M,L,N,H,B,$.C_NUMBER_MODE,$.C_BLOCK_COMMENT_MODE,Z,V]}}function Vb($){if(!$)return null;if(typeof $==="string")return $;return $.source}function zB($){return B5("(?=",$,")")}function B5(...$){return $.map((Z)=>Vb(Z)).join("")}function $20($){let J=$[$.length-1];if(typeof J==="object"&&J.constructor===Object)return $.splice($.length-1,1),J;else return{}}function J4(...$){return"("+($20($).capture?"":"?:")+$.map((H)=>Vb(H)).join("|")+")"}var YL=($)=>B5(/\b/,$,/\w$/.test($)?/\b/:/\B/),J20=["Protocol","Type"].map(YL),qb=["init","self"].map(YL),Z20=["Any","Self"],zL=["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"],Nb=["false","nil","true"],H20=["assignment","associativity","higherThan","left","lowerThan","none","right"],B20=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Lb=["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"],Ab=J4(/[/=\-+!*%<>&|^~?]/,/[\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]/),Db=J4(Ab,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),GL=B5(Ab,Db,"*"),Mb=J4(/[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]/),WU=J4(Mb,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),q9=B5(Mb,WU,"*"),KU=B5(/[A-Z]/,WU,"*"),Q20=["attached","autoclosure",B5(/convention\(/,J4("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",B5(/objc\(/,q9,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],X20=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Pb($){let J={match:/\s+/,relevance:0},Z=$.COMMENT("/\\*","\\*/",{contains:["self"]}),H=[$.C_LINE_COMMENT_MODE,Z],B={match:[/\./,J4(...J20,...qb)],className:{2:"keyword"}},Q={match:B5(/\./,J4(...zL)),relevance:0},X=zL.filter((n)=>typeof n==="string").concat(["_|0"]),z=zL.filter((n)=>typeof n!=="string").concat(Z20).map(YL),G={variants:[{className:"keyword",match:J4(...z,...qb)}]},Y={$pattern:J4(/\b\w+/,/#\w+/),keyword:X.concat(B20),literal:Nb},U=[B,Q,G],F={match:B5(/\./,J4(...Lb)),relevance:0},K={className:"built_in",match:B5(/\b/,J4(...Lb),/(?=\()/)},W=[F,K],q={match:/->/,relevance:0},N={className:"operator",relevance:0,variants:[{match:GL},{match:`\\.(\\.|${Db})+`}]},V=[q,N],L="([0-9]_*)+",A="([0-9a-fA-F]_*)+",M={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:B5(/\\/,n,/[0\\tnr"']/)},{match:B5(/\\/,n,/u\{[0-9a-fA-F]{1,8}\}/)}]}),P=(n="")=>({className:"subst",match:B5(/\\/,n,/[\t ]*(?:[\r\n]|\r\n)/)}),D=(n="")=>({className:"subst",label:"interpol",begin:B5(/\\/,n,/\(/),end:/\)/}),w=(n="")=>({begin:B5(n,/"""/),end:B5(/"""/,n),contains:[_(n),P(n),D(n)]}),R=(n="")=>({begin:B5(n,/"/),end:B5(/"/,n),contains:[_(n),D(n)]}),b={className:"string",variants:[w(),w("#"),w("##"),w("###"),R(),R("#"),R("##"),R("###")]},E=[$.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[$.BACKSLASH_ESCAPE]}],x={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:E},I=(n)=>{let p=B5(n,/\//),d=B5(/\//,n);return{begin:p,end:d,contains:[...E,{scope:"comment",begin:`#(?!.*${d})`,end:/$/}]}},S={scope:"regexp",variants:[I("###"),I("##"),I("#"),x]},j={match:B5(/`/,q9,/`/)},C={className:"variable",match:/\$\d+/},k={className:"variable",match:`\\$${WU}+`},y=[j,C,k],v={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:X20,contains:[...V,M,b]}]}},u={scope:"keyword",match:B5(/@/,J4(...Q20),zB(J4(/\(/,/\s+/)))},T={scope:"meta",match:B5(/@/,q9)},t=[v,u,T],B0={match:zB(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:B5(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,WU,"+")},{className:"type",match:KU,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:B5(/\s+&\s+/,zB(KU)),relevance:0}]},h={begin:/</,end:/>/,keywords:Y,contains:[...H,...U,...t,q,B0]};B0.contains.push(h);let e={match:B5(q9,/\s*:/),keywords:"_|0",relevance:0},A0={begin:/\(/,end:/\)/,relevance:0,keywords:Y,contains:["self",e,...H,S,...U,...W,...V,M,b,...y,...t,B0]},l={begin:/</,end:/>/,keywords:"repeat each",contains:[...H,B0]},z0={begin:J4(zB(B5(q9,/\s*:/)),zB(B5(q9,/\s+/,q9,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:q9}]},W0={begin:/\(/,end:/\)/,keywords:Y,contains:[z0,...H,...U,...V,M,b,...t,B0,A0],endsParent:!0,illegal:/["']/},Q0={match:[/(func|macro)/,/\s+/,J4(j.match,q9,GL)],className:{1:"keyword",3:"title.function"},contains:[l,W0,J],illegal:[/\[/,/%/]},G0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[l,W0,J],illegal:/\[|%/},L0={match:[/operator/,/\s+/,GL],className:{1:"keyword",3:"title"}},i={begin:[/precedencegroup/,/\s+/,KU],className:{1:"keyword",3:"title"},contains:[B0],keywords:[...H20,...Nb],end:/}/},$0={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},J0={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},H0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,q9,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:Y,contains:[l,...U,{begin:/:/,end:/\{/,keywords:Y,contains:[{scope:"title.class.inherited",match:KU},...U],relevance:0}]};for(let n of b.variants){let p=n.contains.find((m)=>m.label==="interpol");p.keywords=Y;let d=[...U,...W,...V,M,b,...y];p.contains=[...d,{begin:/\(/,end:/\)/,contains:["self",...d]}]}return{name:"Swift",keywords:Y,contains:[...H,Q0,G0,$0,J0,H0,L0,i,{beginKeywords:"import",end:/$/,contains:[...H],relevance:0},S,...U,...W,...V,M,b,...y,...t,B0,A0]}}var _b=["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"],Ob=["true","false","null","undefined","NaN","Infinity"],jb=["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"],Tb=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Cb=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],wb=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Eb=[].concat(Cb,jb,Tb);function z20($){let J=$.regex,Z=(v,{after:u})=>{let T="</"+v[0].slice(1);return v.input.indexOf(T,u)!==-1},H="[A-Za-z$_][0-9A-Za-z$_]*",B={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,u)=>{let T=v[0].length+v.index,t=v.input[T];if(t==="<"||t===","){u.ignoreMatch();return}if(t===">"){if(!Z(v,{after:T}))u.ignoreMatch()}let B0,h=v.input.substring(T);if(B0=h.match(/^\s*=/)){u.ignoreMatch();return}if(B0=h.match(/^\s+extends\s+/)){if(B0.index===0){u.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:_b,literal:Ob,built_in:Eb,"variable.language":wb},G="[0-9](_?[0-9])*",Y="\\.([0-9](_?[0-9])*)",U="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",F={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"}},q={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"graphql"}},V={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,K]},A={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]},M=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,V,{match:/\$\d+/},F];K.contains=M.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(M)});let _=[].concat(A,K.contains),P=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(_)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:P},w={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,J.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",J.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:J.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:{_:[...jb,...Tb]}},b={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},E={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:[D],illegal:/%/},x={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function I(v){return J.concat("(?!",v.join("|"),")")}let S={match:J.concat(/\b/,I([...Cb,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",J.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={begin:J.concat(/\./,J.lookahead(J.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},C={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},k="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",y={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,J.lookahead(k)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),b,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,V,A,{match:/\$\d+/},F,R,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+J.lookahead(":"),relevance:0},y,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,$.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:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:B.begin,end:B.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"]}]}]},E,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,$.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:[D]},S,x,w,C,{match:/\$[(.]/}]}}function Sb($){let J=$.regex,Z=z20($),H="[A-Za-z$_][0-9A-Za-z$_]*",B=["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:B},contains:[Z.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"],Y={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:_b.concat(G),literal:Ob,built_in:Eb.concat(B),"variable.language":wb},U={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},F=(N,V,L)=>{let A=N.contains.findIndex((M)=>M.label===V);if(A===-1)throw Error("can not find mode to replace");N.contains.splice(A,1,L)};Object.assign(Z.keywords,Y),Z.exports.PARAMS_CONTAINS.push(U);let K=Z.contains.find((N)=>N.scope==="attr"),W=Object.assign({},K,{match:J.concat("[A-Za-z$_][0-9A-Za-z$_]*",J.lookahead(/\s*\?:/))});Z.exports.PARAMS_CONTAINS.push([Z.exports.CLASS_REFERENCE,K,W]),Z.contains=Z.contains.concat([U,Q,X,W]),F(Z,"shebang",$.SHEBANG()),F(Z,"use_strict",z);let q=Z.contains.find((N)=>N.label==="func.def");return q.relevance=0,Object.assign(Z,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),Z}function Ib($){let J=$.regex,Z={className:"string",begin:/"(""|[^/n])"C\b/},H={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},B=/\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:J.concat(/# */,J.either(Q,B),/ *#/)},{begin:J.concat(/# */,z,/ *#/)},{begin:J.concat(/# */,X,/ *#/)},{begin:J.concat(/# */,J.either(Q,B),/ +/,J.either(X,z),/ *#/)}]},Y={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+:/},F=$.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:[Z,H,G,Y,U,F,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 Rb($){$.regex;let J=$.COMMENT(/\(;/,/;\)/);J.contains.push("self");let Z=$.COMMENT(/;;/,/$/),H=["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"],B={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"},Y={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:H},contains:[Z,J,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},Q,X,B,$.QUOTE_STRING_MODE,G,Y,z]}}function kb($){let J=$.regex,Z=J.concat(/[\p{L}_]/u,J.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),H=/[\p{L}0-9._:-]+/u,B={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"}),Y={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:H,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[B]},{begin:/'/,end:/'/,contains:[B]},{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},B,{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:[Y],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[Y],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:J.concat(/</,J.lookahead(J.concat(Z,J.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:Z,relevance:0,starts:Y}]},{className:"tag",begin:J.concat(/<\//,J.lookahead(J.concat(Z,/>/))),contains:[{className:"name",begin:Z,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function bb($){let H={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},B={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,B]},z=$.inherit(X,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),G="[0-9]{4}(-[0-9][0-9]){0,2}",Y="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",U="(\\.[0-9]*)?",F="([ \\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},q={begin:/\{/,end:/\}/,contains:[W],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[W],illegal:"\\n",relevance:0},V=[H,{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},q,N,Q,X],L=[...V];return L.pop(),L.push(z),W.contains=L,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:V}}var UL={arduino:Ik,bash:Rk,c:kk,cpp:bk,csharp:yk,css:hk,diff:xk,go:vk,graphql:gk,ini:fk,java:uk,javascript:ik,json:rk,kotlin:ak,less:sk,lua:tk,makefile:ek,markdown:$b,objectivec:Jb,perl:Zb,php:Hb,"php-template":Bb,plaintext:Qb,python:Xb,"python-repl":zb,r:Gb,ruby:Yb,rust:Ub,scss:Fb,shell:Kb,sql:Wb,swift:Pb,typescript:Sb,vbnet:Ib,wasm:Rb,xml:kb,yaml:bb};var Hy=O(Zy(),1);var By=Hy.default;var Qy={},s20="hljs-";function VL($){let J=By.newInstance();if($)Q($);return{highlight:Z,highlightAuto:H,listLanguages:B,register:Q,registerAlias:X,registered:z};function Z(G,Y,U){v1(typeof G==="string","expected `string` as `name`"),v1(typeof Y==="string","expected `string` as `value`");let F=U||Qy,K=typeof F.prefix==="string"?F.prefix:s20;if(!J.getLanguage(G))throw Error("Unknown language: `"+G+"` is not registered");J.configure({__emitter:Xy,classPrefix:K});let W=J.highlight(Y,{ignoreIllegals:!0,language:G});if(W.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:W.errorRaised});let q=W._emitter.root,N=q.data;return N.language=W.language,N.relevance=W.relevance,q}function H(G,Y){v1(typeof G==="string","expected `string` as `value`");let F=(Y||Qy).subset||B(),K=-1,W=0,q;while(++K<F.length){let N=F[K];if(!J.getLanguage(N))continue;let V=Z(N,G,Y);if(V.data&&V.data.relevance!==void 0&&V.data.relevance>W)W=V.data.relevance,q=V}return q||{type:"root",children:[],data:{language:void 0,relevance:W}}}function B(){return J.listLanguages()}function Q(G,Y){if(typeof G==="string")v1(Y!==void 0,"expected `grammar`"),J.registerLanguage(G,Y);else{let U;for(U in G)if(Object.hasOwn(G,U))J.registerLanguage(U,G[U])}}function X(G,Y){if(typeof G==="string")v1(Y!==void 0),J.registerAliases(typeof Y==="string"?Y:[...Y],{languageName:G});else{let U;for(U in G)if(Object.hasOwn(G,U)){let F=G[U];J.registerAliases(typeof F==="string"?F:[...F],{languageName:U})}}}function z(G){return Boolean(J.getLanguage(G))}}class Xy{constructor($){this.options=$,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText($){if($==="")return;let J=this.stack[this.stack.length-1],Z=J.children[J.children.length-1];if(Z&&Z.type==="text")Z.value+=$;else J.children.push({type:"text",value:$})}startScope($){this.openNode(String($))}endScope(){this.closeNode()}__addSublanguage($,J){let Z=this.stack[this.stack.length-1],H=$.root.children;if(J)Z.children.push({type:"element",tagName:"span",properties:{className:[J]},children:H});else Z.children.push(...H)}openNode($){let J=this,Z=$.split(".").map(function(Q,X){return X?Q+"_".repeat(X):J.options.classPrefix+Q}),H=this.stack[this.stack.length-1],B={type:"element",tagName:"span",properties:{className:Z},children:[]};H.children.push(B),this.stack.push(B)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var t20={};function VU($){let J=$||t20,Z=J.aliases,H=J.detect||!1,B=J.languages||UL,Q=J.plainText,X=J.prefix,z=J.subset,G="hljs",Y=VL(B);if(Z)Y.registerAlias(Z);if(X){let U=X.indexOf("-");G=U===-1?X:X.slice(0,U)}return function(U,F){x9(U,"element",function(K,W,q){if(K.tagName!=="code"||!q||q.type!=="element"||q.tagName!=="pre")return;let N=e20(K);if(N===!1||!N&&!H||N&&Q&&Q.includes(N))return;if(!Array.isArray(K.properties.className))K.properties.className=[];if(!K.properties.className.includes(G))K.properties.className.unshift(G);let V=XL(K,{whitespace:"pre"}),L;try{L=N?Y.highlight(N,V,{prefix:X}):Y.highlightAuto(V,{prefix:X,subset:z})}catch(A){let M=A;if(N&&/Unknown language/.test(M.message)){F.message("Cannot highlight as `"+N+"`, it’s not registered",{ancestors:[q,K],cause:M,place:K.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw M}if(!N&&L.data&&L.data.language)K.properties.className.push("language-"+L.data.language);if(L.children.length>0)K.children=L.children})}}function e20($){let J=$.properties.className,Z=-1;if(!Array.isArray(J))return;let H;while(++Z<J.length){let B=String(J[Z]);if(B==="no-highlight"||B==="nohighlight")return!1;if(!H&&B.slice(0,5)==="lang-")H=B.slice(5);if(!H&&B.slice(0,9)==="language-")H=B.slice(9)}return H}function AL($,J){let Z=String($);if(typeof J!=="string")throw TypeError("Expected character");let H=0,B=Z.indexOf(J);while(B!==-1)H++,B=Z.indexOf(J,B+J.length);return H}function DL($){if(typeof $!=="string")throw TypeError("Expected a string");return $.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ML($,J,Z){let B=W9((Z||{}).ignore||[]),Q=$40(J),X=-1;while(++X<Q.length)BB($,"text",z);function z(Y,U){let F=-1,K;while(++F<U.length){let W=U[F],q=K?K.children:void 0;if(B(W,q?q.indexOf(W):void 0,K))return;K=W}if(K)return G(Y,U)}function G(Y,U){let F=U[U.length-1],K=Q[X][0],W=Q[X][1],q=0,V=F.children.indexOf(Y),L=!1,A=[];K.lastIndex=0;let M=K.exec(Y.value);while(M){let _=M.index,P={index:M.index,input:M.input,stack:[...U,Y]},D=W(...M,P);if(typeof D==="string")D=D.length>0?{type:"text",value:D}:void 0;if(D===!1)K.lastIndex=_+1;else{if(q!==_)A.push({type:"text",value:Y.value.slice(q,_)});if(Array.isArray(D))A.push(...D);else if(D)A.push(D);q=_+M[0].length,L=!0}if(!K.global)break;M=K.exec(Y.value)}if(L){if(q<Y.value.length)A.push({type:"text",value:Y.value.slice(q)});F.children.splice(V,1,...A)}else A=[Y];return V+A.length}}function $40($){let J=[];if(!Array.isArray($))throw TypeError("Expected find and replace tuple or list of tuples");let Z=!$[0]||Array.isArray($[0])?$:[$],H=-1;while(++H<Z.length){let B=Z[H];J.push([J40(B[0]),Z40(B[1])])}return J}function J40($){return typeof $==="string"?new RegExp(DL($),"g"):$}function Z40($){return typeof $==="function"?$:function(){return $}}var PL="phrasing",_L=["autolink","link","image","label"];function jL(){return{transforms:[G40],enter:{literalAutolink:H40,literalAutolinkEmail:OL,literalAutolinkHttp:OL,literalAutolinkWww:OL},exit:{literalAutolink:z40,literalAutolinkEmail:X40,literalAutolinkHttp:B40,literalAutolinkWww:Q40}}}function TL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:PL,notInConstruct:_L},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:PL,notInConstruct:_L},{character:":",before:"[ps]",after:"\\/",inConstruct:PL,notInConstruct:_L}]}}function H40($){this.enter({type:"link",title:null,url:"",children:[]},$)}function OL($){this.config.enter.autolinkProtocol.call(this,$)}function B40($){this.config.exit.autolinkProtocol.call(this,$)}function Q40($){this.config.exit.data.call(this,$);let J=this.stack[this.stack.length-1];v1(J.type==="link"),J.url="http://"+this.sliceSerialize($)}function X40($){this.config.exit.autolinkEmail.call(this,$)}function z40($){this.exit($)}function G40($){ML($,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Y40],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,U40]],{ignore:["link","linkReference"]})}function Y40($,J,Z,H,B){let Q="";if(!zy(B))return!1;if(/^w/i.test(J))Z=J+Z,J="",Q="http://";if(!F40(Z))return!1;let X=K40(Z+H);if(!X[0])return!1;let z={type:"link",title:null,url:Q+J+X[0],children:[{type:"text",value:J+X[0]}]};if(X[1])return[z,{type:"text",value:X[1]}];return z}function U40($,J,Z,H){if(!zy(H,!0)||/[-\d_]$/.test(Z))return!1;return{type:"link",title:null,url:"mailto:"+J+"@"+Z,children:[{type:"text",value:J+"@"+Z}]}}function F40($){let J=$.split(".");if(J.length<2||J[J.length-1]&&(/_/.test(J[J.length-1])||!/[a-zA-Z\d]/.test(J[J.length-1]))||J[J.length-2]&&(/_/.test(J[J.length-2])||!/[a-zA-Z\d]/.test(J[J.length-2])))return!1;return!0}function K40($){let J=/[!"&'),.:;<>?\]}]+$/.exec($);if(!J)return[$,void 0];$=$.slice(0,J.index);let Z=J[0],H=Z.indexOf(")"),B=AL($,"("),Q=AL($,")");while(H!==-1&&B>Q)$+=Z.slice(0,H+1),Z=Z.slice(H+1),H=Z.indexOf(")"),Q++;return[$,Z]}function zy($,J){let Z=$.input.charCodeAt($.index-1);return($.index===0||F9(Z)||F6(Z))&&(!J||Z!==47)}Gy.peek=P40;function W40(){this.buffer()}function q40($){this.enter({type:"footnoteReference",identifier:"",label:""},$)}function N40(){this.buffer()}function L40($){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},$)}function V40($){let J=this.resume(),Z=this.stack[this.stack.length-1];v1(Z.type==="footnoteReference"),Z.identifier=f2(this.sliceSerialize($)).toLowerCase(),Z.label=J}function A40($){this.exit($)}function D40($){let J=this.resume(),Z=this.stack[this.stack.length-1];v1(Z.type==="footnoteDefinition"),Z.identifier=f2(this.sliceSerialize($)).toLowerCase(),Z.label=J}function M40($){this.exit($)}function P40(){return"["}function Gy($,J,Z,H){let B=Z.createTracker(H),Q=B.move("[^"),X=Z.enter("footnoteReference"),z=Z.enter("reference");return Q+=B.move(Z.safe(Z.associationId($),{after:"]",before:Q})),z(),X(),Q+=B.move("]"),Q}function CL(){return{enter:{gfmFootnoteCallString:W40,gfmFootnoteCall:q40,gfmFootnoteDefinitionLabelString:N40,gfmFootnoteDefinition:L40},exit:{gfmFootnoteCallString:V40,gfmFootnoteCall:A40,gfmFootnoteDefinitionLabelString:D40,gfmFootnoteDefinition:M40}}}function wL($){let J=!1;if($&&$.firstLineBlank)J=!0;return{handlers:{footnoteDefinition:Z,footnoteReference:Gy},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function Z(H,B,Q,X){let z=Q.createTracker(X),G=z.move("[^"),Y=Q.enter("footnoteDefinition"),U=Q.enter("label");if(G+=z.move(Q.safe(Q.associationId(H),{before:G,after:"]"})),U(),G+=z.move("]:"),H.children&&H.children.length>0)z.shift(4),G+=z.move((J?`
|
|
51
|
+
`:" ")+Q.indentLines(Q.containerFlow(H,z.current()),J?Yy:_40));return Y(),G}}function _40($,J,Z){return J===0?$:Yy($,J,Z)}function Yy($,J,Z){return(Z?"":" ")+$}var O40=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Uy.peek=C40;function EL(){return{canContainEols:["delete"],enter:{strikethrough:j40},exit:{strikethrough:T40}}}function SL(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:O40}],handlers:{delete:Uy}}}function j40($){this.enter({type:"delete",children:[]},$)}function T40($){this.exit($)}function Uy($,J,Z,H){let B=Z.createTracker(H),Q=Z.enter("strikethrough"),X=B.move("~~");return X+=Z.containerPhrasing($,{...B.current(),before:X,after:"~"}),X+=B.move("~~"),Q(),X}function C40(){return"~"}function w40($){return $.length}function Ky($,J){let Z=J||{},H=(Z.align||[]).concat(),B=Z.stringLength||w40,Q=[],X=[],z=[],G=[],Y=0,U=-1;while(++U<$.length){let N=[],V=[],L=-1;if($[U].length>Y)Y=$[U].length;while(++L<$[U].length){let A=E40($[U][L]);if(Z.alignDelimiters!==!1){let M=B(A);if(V[L]=M,G[L]===void 0||M>G[L])G[L]=M}N.push(A)}X[U]=N,z[U]=V}let F=-1;if(typeof H==="object"&&"length"in H)while(++F<Y)Q[F]=Fy(H[F]);else{let N=Fy(H);while(++F<Y)Q[F]=N}F=-1;let K=[],W=[];while(++F<Y){let N=Q[F],V="",L="";if(N===99)V=":",L=":";else if(N===108)V=":";else if(N===114)L=":";let A=Z.alignDelimiters===!1?1:Math.max(1,G[F]-V.length-L.length),M=V+"-".repeat(A)+L;if(Z.alignDelimiters!==!1){if(A=V.length+A+L.length,A>G[F])G[F]=A;W[F]=A}K[F]=M}X.splice(1,0,K),z.splice(1,0,W),U=-1;let q=[];while(++U<X.length){let N=X[U],V=z[U];F=-1;let L=[];while(++F<Y){let A=N[F]||"",M="",_="";if(Z.alignDelimiters!==!1){let P=G[F]-(V[F]||0),D=Q[F];if(D===114)M=" ".repeat(P);else if(D===99)if(P%2)M=" ".repeat(P/2+0.5),_=" ".repeat(P/2-0.5);else M=" ".repeat(P/2),_=M;else _=" ".repeat(P)}if(Z.delimiterStart!==!1&&!F)L.push("|");if(Z.padding!==!1&&!(Z.alignDelimiters===!1&&A==="")&&(Z.delimiterStart!==!1||F))L.push(" ");if(Z.alignDelimiters!==!1)L.push(M);if(L.push(A),Z.alignDelimiters!==!1)L.push(_);if(Z.padding!==!1)L.push(" ");if(Z.delimiterEnd!==!1||F!==Y-1)L.push("|")}q.push(Z.delimiterEnd===!1?L.join("").replace(/ +$/,""):L.join(""))}return q.join(`
|
|
52
|
+
`)}function E40($){return $===null||$===void 0?"":String($)}function Fy($){let J=typeof $==="string"?$.codePointAt(0):0;return J===67||J===99?99:J===76||J===108?108:J===82||J===114?114:0}function Wy($,J,Z,H){let B=Z.enter("blockquote"),Q=Z.createTracker(H);Q.move("> "),Q.shift(2);let X=Z.indentLines(Z.containerFlow($,Q.current()),S40);return B(),X}function S40($,J,Z){return">"+(Z?"":" ")+$}function Ny($,J){return qy($,J.inConstruct,!0)&&!qy($,J.notInConstruct,!1)}function qy($,J,Z){if(typeof J==="string")J=[J];if(!J||J.length===0)return Z;let H=-1;while(++H<J.length)if($.includes(J[H]))return!0;return!1}function IL($,J,Z,H){let B=-1;while(++B<Z.unsafe.length)if(Z.unsafe[B].character===`
|
|
53
|
+
`&&Ny(Z.stack,Z.unsafe[B]))return/[ \t]/.test(H.before)?"":" ";return"\\\n"}function Ly($,J){let Z=String($),H=Z.indexOf(J),B=H,Q=0,X=0;if(typeof J!=="string")throw TypeError("Expected substring");while(H!==-1){if(H===B){if(++Q>X)X=Q}else Q=1;B=H+J.length,H=Z.indexOf(J,B)}return X}function Vy($,J){return Boolean(J.options.fences===!1&&$.value&&!$.lang&&/[^ \r\n]/.test($.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test($.value))}function Ay($){let J=$.options.fence||"`";if(J!=="`"&&J!=="~")throw Error("Cannot serialize code with `"+J+"` for `options.fence`, expected `` ` `` or `~`");return J}function Dy($,J,Z,H){let B=Ay(Z),Q=$.value||"",X=B==="`"?"GraveAccent":"Tilde";if(Vy($,Z)){let F=Z.enter("codeIndented"),K=Z.indentLines(Q,I40);return F(),K}let z=Z.createTracker(H),G=B.repeat(Math.max(Ly(Q,B)+1,3)),Y=Z.enter("codeFenced"),U=z.move(G);if($.lang){let F=Z.enter(`codeFencedLang${X}`);U+=z.move(Z.safe($.lang,{before:U,after:" ",encode:["`"],...z.current()})),F()}if($.lang&&$.meta){let F=Z.enter(`codeFencedMeta${X}`);U+=z.move(" "),U+=z.move(Z.safe($.meta,{before:U,after:`
|
|
54
|
+
`,encode:["`"],...z.current()})),F()}if(U+=z.move(`
|
|
55
|
+
`),Q)U+=z.move(Q+`
|
|
56
|
+
`);return U+=z.move(G),Y(),U}function I40($,J,Z){return(Z?"":" ")+$}function PJ($){let J=$.options.quote||'"';if(J!=='"'&&J!=="'")throw Error("Cannot serialize title with `"+J+"` for `options.quote`, expected `\"`, or `'`");return J}function My($,J,Z,H){let B=PJ(Z),Q=B==='"'?"Quote":"Apostrophe",X=Z.enter("definition"),z=Z.enter("label"),G=Z.createTracker(H),Y=G.move("[");if(Y+=G.move(Z.safe(Z.associationId($),{before:Y,after:"]",...G.current()})),Y+=G.move("]: "),z(),!$.url||/[\0- \u007F]/.test($.url))z=Z.enter("destinationLiteral"),Y+=G.move("<"),Y+=G.move(Z.safe($.url,{before:Y,after:">",...G.current()})),Y+=G.move(">");else z=Z.enter("destinationRaw"),Y+=G.move(Z.safe($.url,{before:Y,after:$.title?" ":`
|
|
57
|
+
`,...G.current()}));if(z(),$.title)z=Z.enter(`title${Q}`),Y+=G.move(" "+B),Y+=G.move(Z.safe($.title,{before:Y,after:B,...G.current()})),Y+=G.move(B),z();return X(),Y}function Py($){let J=$.options.emphasis||"*";if(J!=="*"&&J!=="_")throw Error("Cannot serialize emphasis with `"+J+"` for `options.emphasis`, expected `*`, or `_`");return J}function l3($){return"&#x"+$.toString(16).toUpperCase()+";"}function _J($,J,Z){let H=h9($),B=h9(J);if(H===void 0)return B===void 0?Z==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:B===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(H===1)return B===void 0?{inside:!1,outside:!1}:B===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return B===void 0?{inside:!1,outside:!1}:B===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}RL.peek=R40;function RL($,J,Z,H){let B=Py(Z),Q=Z.enter("emphasis"),X=Z.createTracker(H),z=X.move(B),G=X.move(Z.containerPhrasing($,{after:B,before:z,...X.current()})),Y=G.charCodeAt(0),U=_J(H.before.charCodeAt(H.before.length-1),Y,B);if(U.inside)G=l3(Y)+G.slice(1);let F=G.charCodeAt(G.length-1),K=_J(H.after.charCodeAt(0),F,B);if(K.inside)G=G.slice(0,-1)+l3(F);let W=X.move(B);return Q(),Z.attentionEncodeSurroundingInfo={after:K.outside,before:U.outside},z+G+W}function R40($,J,Z){return Z.options.emphasis||"*"}function _y($,J){let Z=!1;return x9($,function(H){if("value"in H&&/\r?\n|\r/.test(H.value)||H.type==="break")return Z=!0,L6}),Boolean((!$.depth||$.depth<3)&&Y6($)&&(J.options.setext||Z))}function Oy($,J,Z,H){let B=Math.max(Math.min(6,$.depth||1),1),Q=Z.createTracker(H);if(_y($,Z)){let U=Z.enter("headingSetext"),F=Z.enter("phrasing"),K=Z.containerPhrasing($,{...Q.current(),before:`
|
|
58
|
+
`,after:`
|
|
59
|
+
`});return F(),U(),K+`
|
|
60
|
+
`+(B===1?"=":"-").repeat(K.length-(Math.max(K.lastIndexOf("\r"),K.lastIndexOf(`
|
|
61
|
+
`))+1))}let X="#".repeat(B),z=Z.enter("headingAtx"),G=Z.enter("phrasing");Q.move(X+" ");let Y=Z.containerPhrasing($,{before:"# ",after:`
|
|
62
|
+
`,...Q.current()});if(/^[\t ]/.test(Y))Y=l3(Y.charCodeAt(0))+Y.slice(1);if(Y=Y?X+" "+Y:X,Z.options.closeAtx)Y+=" "+X;return G(),z(),Y}kL.peek=k40;function kL($){return $.value||""}function k40(){return"<"}bL.peek=b40;function bL($,J,Z,H){let B=PJ(Z),Q=B==='"'?"Quote":"Apostrophe",X=Z.enter("image"),z=Z.enter("label"),G=Z.createTracker(H),Y=G.move("![");if(Y+=G.move(Z.safe($.alt,{before:Y,after:"]",...G.current()})),Y+=G.move("]("),z(),!$.url&&$.title||/[\0- \u007F]/.test($.url))z=Z.enter("destinationLiteral"),Y+=G.move("<"),Y+=G.move(Z.safe($.url,{before:Y,after:">",...G.current()})),Y+=G.move(">");else z=Z.enter("destinationRaw"),Y+=G.move(Z.safe($.url,{before:Y,after:$.title?" ":")",...G.current()}));if(z(),$.title)z=Z.enter(`title${Q}`),Y+=G.move(" "+B),Y+=G.move(Z.safe($.title,{before:Y,after:B,...G.current()})),Y+=G.move(B),z();return Y+=G.move(")"),X(),Y}function b40(){return"!"}yL.peek=y40;function yL($,J,Z,H){let B=$.referenceType,Q=Z.enter("imageReference"),X=Z.enter("label"),z=Z.createTracker(H),G=z.move("!["),Y=Z.safe($.alt,{before:G,after:"]",...z.current()});G+=z.move(Y+"]["),X();let U=Z.stack;Z.stack=[],X=Z.enter("reference");let F=Z.safe(Z.associationId($),{before:G,after:"]",...z.current()});if(X(),Z.stack=U,Q(),B==="full"||!Y||Y!==F)G+=z.move(F+"]");else if(B==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function y40(){return"!"}hL.peek=h40;function hL($,J,Z){let H=$.value||"",B="`",Q=-1;while(new RegExp("(^|[^`])"+B+"([^`]|$)").test(H))B+="`";if(/[^ \r\n]/.test(H)&&(/^[ \r\n]/.test(H)&&/[ \r\n]$/.test(H)||/^`|`$/.test(H)))H=" "+H+" ";while(++Q<Z.unsafe.length){let X=Z.unsafe[Q],z=Z.compilePattern(X),G;if(!X.atBreak)continue;while(G=z.exec(H)){let Y=G.index;if(H.charCodeAt(Y)===10&&H.charCodeAt(Y-1)===13)Y--;H=H.slice(0,Y)+" "+H.slice(G.index+1)}}return B+H+B}function h40(){return"`"}function xL($,J){let Z=Y6($);return Boolean(!J.options.resourceLink&&$.url&&!$.title&&$.children&&$.children.length===1&&$.children[0].type==="text"&&(Z===$.url||"mailto:"+Z===$.url)&&/^[a-z][a-z+.-]+:/i.test($.url)&&!/[\0- <>\u007F]/.test($.url))}vL.peek=x40;function vL($,J,Z,H){let B=PJ(Z),Q=B==='"'?"Quote":"Apostrophe",X=Z.createTracker(H),z,G;if(xL($,Z)){let U=Z.stack;Z.stack=[],z=Z.enter("autolink");let F=X.move("<");return F+=X.move(Z.containerPhrasing($,{before:F,after:">",...X.current()})),F+=X.move(">"),z(),Z.stack=U,F}z=Z.enter("link"),G=Z.enter("label");let Y=X.move("[");if(Y+=X.move(Z.containerPhrasing($,{before:Y,after:"](",...X.current()})),Y+=X.move("]("),G(),!$.url&&$.title||/[\0- \u007F]/.test($.url))G=Z.enter("destinationLiteral"),Y+=X.move("<"),Y+=X.move(Z.safe($.url,{before:Y,after:">",...X.current()})),Y+=X.move(">");else G=Z.enter("destinationRaw"),Y+=X.move(Z.safe($.url,{before:Y,after:$.title?" ":")",...X.current()}));if(G(),$.title)G=Z.enter(`title${Q}`),Y+=X.move(" "+B),Y+=X.move(Z.safe($.title,{before:Y,after:B,...X.current()})),Y+=X.move(B),G();return Y+=X.move(")"),z(),Y}function x40($,J,Z){return xL($,Z)?"<":"["}gL.peek=v40;function gL($,J,Z,H){let B=$.referenceType,Q=Z.enter("linkReference"),X=Z.enter("label"),z=Z.createTracker(H),G=z.move("["),Y=Z.containerPhrasing($,{before:G,after:"]",...z.current()});G+=z.move(Y+"]["),X();let U=Z.stack;Z.stack=[],X=Z.enter("reference");let F=Z.safe(Z.associationId($),{before:G,after:"]",...z.current()});if(X(),Z.stack=U,Q(),B==="full"||!Y||Y!==F)G+=z.move(F+"]");else if(B==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function v40(){return"["}function OJ($){let J=$.options.bullet||"*";if(J!=="*"&&J!=="+"&&J!=="-")throw Error("Cannot serialize items with `"+J+"` for `options.bullet`, expected `*`, `+`, or `-`");return J}function jy($){let J=OJ($),Z=$.options.bulletOther;if(!Z)return J==="*"?"-":"*";if(Z!=="*"&&Z!=="+"&&Z!=="-")throw Error("Cannot serialize items with `"+Z+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(Z===J)throw Error("Expected `bullet` (`"+J+"`) and `bulletOther` (`"+Z+"`) to be different");return Z}function Ty($){let J=$.options.bulletOrdered||".";if(J!=="."&&J!==")")throw Error("Cannot serialize items with `"+J+"` for `options.bulletOrdered`, expected `.` or `)`");return J}function AU($){let J=$.options.rule||"*";if(J!=="*"&&J!=="-"&&J!=="_")throw Error("Cannot serialize rules with `"+J+"` for `options.rule`, expected `*`, `-`, or `_`");return J}function Cy($,J,Z,H){let B=Z.enter("list"),Q=Z.bulletCurrent,X=$.ordered?Ty(Z):OJ(Z),z=$.ordered?X==="."?")":".":jy(Z),G=J&&Z.bulletLastUsed?X===Z.bulletLastUsed:!1;if(!$.ordered){let U=$.children?$.children[0]:void 0;if((X==="*"||X==="-")&&U&&(!U.children||!U.children[0])&&Z.stack[Z.stack.length-1]==="list"&&Z.stack[Z.stack.length-2]==="listItem"&&Z.stack[Z.stack.length-3]==="list"&&Z.stack[Z.stack.length-4]==="listItem"&&Z.indexStack[Z.indexStack.length-1]===0&&Z.indexStack[Z.indexStack.length-2]===0&&Z.indexStack[Z.indexStack.length-3]===0)G=!0;if(AU(Z)===X&&U){let F=-1;while(++F<$.children.length){let K=$.children[F];if(K&&K.type==="listItem"&&K.children&&K.children[0]&&K.children[0].type==="thematicBreak"){G=!0;break}}}}if(G)X=z;Z.bulletCurrent=X;let Y=Z.containerFlow($,H);return Z.bulletLastUsed=X,Z.bulletCurrent=Q,B(),Y}function wy($){let J=$.options.listItemIndent||"one";if(J!=="tab"&&J!=="one"&&J!=="mixed")throw Error("Cannot serialize items with `"+J+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return J}function Ey($,J,Z,H){let B=wy(Z),Q=Z.bulletCurrent||OJ(Z);if(J&&J.type==="list"&&J.ordered)Q=(typeof J.start==="number"&&J.start>-1?J.start:1)+(Z.options.incrementListMarker===!1?0:J.children.indexOf($))+Q;let X=Q.length+1;if(B==="tab"||B==="mixed"&&(J&&J.type==="list"&&J.spread||$.spread))X=Math.ceil(X/4)*4;let z=Z.createTracker(H);z.move(Q+" ".repeat(X-Q.length)),z.shift(X);let G=Z.enter("listItem"),Y=Z.indentLines(Z.containerFlow($,z.current()),U);return G(),Y;function U(F,K,W){if(K)return(W?"":" ".repeat(X))+F;return(W?Q:Q+" ".repeat(X-Q.length))+F}}function Sy($,J,Z,H){let B=Z.enter("paragraph"),Q=Z.enter("phrasing"),X=Z.containerPhrasing($,H);return Q(),B(),X}var fL=W9(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Iy($,J,Z,H){return($.children.some(function(X){return fL(X)})?Z.containerPhrasing:Z.containerFlow).call(Z,$,H)}function Ry($){let J=$.options.strong||"*";if(J!=="*"&&J!=="_")throw Error("Cannot serialize strong with `"+J+"` for `options.strong`, expected `*`, or `_`");return J}mL.peek=g40;function mL($,J,Z,H){let B=Ry(Z),Q=Z.enter("strong"),X=Z.createTracker(H),z=X.move(B+B),G=X.move(Z.containerPhrasing($,{after:B,before:z,...X.current()})),Y=G.charCodeAt(0),U=_J(H.before.charCodeAt(H.before.length-1),Y,B);if(U.inside)G=l3(Y)+G.slice(1);let F=G.charCodeAt(G.length-1),K=_J(H.after.charCodeAt(0),F,B);if(K.inside)G=G.slice(0,-1)+l3(F);let W=X.move(B+B);return Q(),Z.attentionEncodeSurroundingInfo={after:K.outside,before:U.outside},z+G+W}function g40($,J,Z){return Z.options.strong||"*"}function ky($,J,Z,H){return Z.safe($.value,H)}function by($){let J=$.options.ruleRepetition||3;if(J<3)throw Error("Cannot serialize rules with repetition `"+J+"` for `options.ruleRepetition`, expected `3` or more");return J}function yy($,J,Z){let H=(AU(Z)+(Z.options.ruleSpaces?" ":"")).repeat(by(Z));return Z.options.ruleSpaces?H.slice(0,-1):H}var UB={blockquote:Wy,break:IL,code:Dy,definition:My,emphasis:RL,hardBreak:IL,heading:Oy,html:kL,image:bL,imageReference:yL,inlineCode:hL,link:vL,linkReference:gL,list:Cy,listItem:Ey,paragraph:Sy,root:Iy,strong:mL,text:ky,thematicBreak:yy};function uL(){return{enter:{table:f40,tableData:hy,tableHeader:hy,tableRow:p40},exit:{codeText:u40,table:m40,tableData:pL,tableHeader:pL,tableRow:pL}}}function f40($){let J=$._align;v1(J,"expected `_align` on table"),this.enter({type:"table",align:J.map(function(Z){return Z==="none"?null:Z}),children:[]},$),this.data.inTable=!0}function m40($){this.exit($),this.data.inTable=void 0}function p40($){this.enter({type:"tableRow",children:[]},$)}function pL($){this.exit($)}function hy($){this.enter({type:"tableCell",children:[]},$)}function u40($){let J=this.resume();if(this.data.inTable)J=J.replace(/\\([\\|])/g,c40);let Z=this.stack[this.stack.length-1];v1(Z.type==="inlineCode"),Z.value=J,this.exit($)}function c40($,J){return J==="|"?J:$}function cL($){let J=$||{},Z=J.tableCellPadding,H=J.tablePipeAlign,B=J.stringLength,Q=Z?" ":"|";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,q,N,V){return Y(U(W,N,V),W.align)}function z(W,q,N,V){let L=F(W,N,V),A=Y([L]);return A.slice(0,A.indexOf(`
|
|
64
|
+
`))}function G(W,q,N,V){let L=N.enter("tableCell"),A=N.enter("phrasing"),M=N.containerPhrasing(W,{...V,before:Q,after:Q});return A(),L(),M}function Y(W,q){return Ky(W,{align:q,alignDelimiters:H,padding:Z,stringLength:B})}function U(W,q,N){let V=W.children,L=-1,A=[],M=q.enter("table");while(++L<V.length)A[L]=F(V[L],q,N);return M(),A}function F(W,q,N){let V=W.children,L=-1,A=[],M=q.enter("tableRow");while(++L<V.length)A[L]=G(V[L],W,q,N);return M(),A}function K(W,q,N){let V=UB.inlineCode(W,q,N);if(N.stack.includes("tableCell"))V=V.replace(/\|/g,"\\$&");return V}}function dL(){return{exit:{taskListCheckValueChecked:xy,taskListCheckValueUnchecked:xy,paragraph:d40}}}function lL(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:l40}}}function xy($){let J=this.stack[this.stack.length-2];v1(J.type==="listItem"),J.checked=$.type==="taskListCheckValueChecked"}function d40($){let J=this.stack[this.stack.length-2];if(J&&J.type==="listItem"&&typeof J.checked==="boolean"){let Z=this.stack[this.stack.length-1];v1(Z.type==="paragraph");let H=Z.children[0];if(H&&H.type==="text"){let B=J.children,Q=-1,X;while(++Q<B.length){let z=B[Q];if(z.type==="paragraph"){X=z;break}}if(X===Z){if(H.value=H.value.slice(1),H.value.length===0)Z.children.shift();else if(Z.position&&H.position&&typeof H.position.start.offset==="number")H.position.start.column++,H.position.start.offset++,Z.position.start=Object.assign({},H.position.start)}}}this.exit($)}function l40($,J,Z,H){let B=$.children[0],Q=typeof $.checked==="boolean"&&B&&B.type==="paragraph",X="["+($.checked?"x":" ")+"] ",z=Z.createTracker(H);if(Q)z.move(X);let G=UB.listItem($,J,Z,{...H,...z.current()});if(Q)G=G.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,Y);return G;function Y(U){return U+X}}function iL(){return[jL(),CL(),EL(),uL(),dL()]}function rL($){return{extensions:[TL(),wL($),SL(),cL($),lL()]}}var i40={tokenize:s40,partial:!0},vy={tokenize:t40,partial:!0},gy={tokenize:e40,partial:!0},fy={tokenize:$80,partial:!0},r40={tokenize:J80,partial:!0},my={name:"wwwAutolink",tokenize:n40,previous:uy},py={name:"protocolAutolink",tokenize:o40,previous:cy},g9={name:"emailAutolink",tokenize:a40,previous:dy},N9={};function nL(){return{text:N9}}var D6=48;while(D6<123)if(N9[D6]=g9,D6++,D6===58)D6=65;else if(D6===91)D6=97;N9[43]=g9;N9[45]=g9;N9[46]=g9;N9[95]=g9;N9[72]=[g9,py];N9[104]=[g9,py];N9[87]=[g9,my];N9[119]=[g9,my];function a40($,J,Z){let H=this,B,Q;return X;function X(F){if(!aL(F)||!dy.call(H,H.previous)||oL(H.events))return Z(F);return $.enter("literalAutolink"),$.enter("literalAutolinkEmail"),z(F)}function z(F){if(aL(F))return $.consume(F),z;if(F===64)return $.consume(F),G;return Z(F)}function G(F){if(F===46)return $.check(r40,U,Y)(F);if(F===45||F===95||f5(F))return Q=!0,$.consume(F),G;return U(F)}function Y(F){return $.consume(F),B=!0,G}function U(F){if(Q&&B&&Q2(H.previous))return $.exit("literalAutolinkEmail"),$.exit("literalAutolink"),J(F);return Z(F)}}function n40($,J,Z){let H=this;return B;function B(X){if(X!==87&&X!==119||!uy.call(H,H.previous)||oL(H.events))return Z(X);return $.enter("literalAutolink"),$.enter("literalAutolinkWww"),$.check(i40,$.attempt(vy,$.attempt(gy,Q),Z),Z)(X)}function Q(X){return $.exit("literalAutolinkWww"),$.exit("literalAutolink"),J(X)}}function o40($,J,Z){let H=this,B="",Q=!1;return X;function X(F){if((F===72||F===104)&&cy.call(H,H.previous)&&!oL(H.events))return $.enter("literalAutolink"),$.enter("literalAutolinkHttp"),B+=String.fromCodePoint(F),$.consume(F),z;return Z(F)}function z(F){if(Q2(F)&&B.length<5)return B+=String.fromCodePoint(F),$.consume(F),z;if(F===58){let K=B.toLowerCase();if(K==="http"||K==="https")return $.consume(F),G}return Z(F)}function G(F){if(F===47){if($.consume(F),Q)return Y;return Q=!0,G}return Z(F)}function Y(F){return F===null||U6(F)||P1(F)||F9(F)||F6(F)?Z(F):$.attempt(vy,$.attempt(gy,U),Z)(F)}function U(F){return $.exit("literalAutolinkHttp"),$.exit("literalAutolink"),J(F)}}function s40($,J,Z){let H=0;return B;function B(X){if((X===87||X===119)&&H<3)return H++,$.consume(X),B;if(X===46&&H===3)return $.consume(X),Q;return Z(X)}function Q(X){return X===null?Z(X):J(X)}}function t40($,J,Z){let H,B,Q;return X;function X(Y){if(Y===46||Y===95)return $.check(fy,G,z)(Y);if(Y===null||P1(Y)||F9(Y)||Y!==45&&F6(Y))return G(Y);return Q=!0,$.consume(Y),X}function z(Y){if(Y===95)H=!0;else B=H,H=void 0;return $.consume(Y),X}function G(Y){if(B||H||!Q)return Z(Y);return J(Y)}}function e40($,J){let Z=0,H=0;return B;function B(X){if(X===40)return Z++,$.consume(X),B;if(X===41&&H<Z)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(fy,J,Q)(X);if(X===null||P1(X)||F9(X))return J(X);return $.consume(X),B}function Q(X){if(X===41)H++;return $.consume(X),B}}function $80($,J,Z){return H;function H(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),H;if(z===38)return $.consume(z),Q;if(z===93)return $.consume(z),B;if(z===60||z===null||P1(z)||F9(z))return J(z);return Z(z)}function B(z){if(z===null||z===40||z===91||P1(z)||F9(z))return J(z);return H(z)}function Q(z){return Q2(z)?X(z):Z(z)}function X(z){if(z===59)return $.consume(z),H;if(Q2(z))return $.consume(z),X;return Z(z)}}function J80($,J,Z){return H;function H(Q){return $.consume(Q),B}function B(Q){return f5(Q)?Z(Q):J(Q)}}function uy($){return $===null||$===40||$===42||$===95||$===91||$===93||$===126||P1($)}function cy($){return!Q2($)}function dy($){return!($===47||aL($))}function aL($){return $===43||$===45||$===46||$===95||f5($)}function oL($){let J=$.length,Z=!1;while(J--){let H=$[J][1];if((H.type==="labelLink"||H.type==="labelImage")&&!H._balanced){Z=!0;break}if(H._gfmAutolinkLiteralWalkedInto){Z=!1;break}}if($.length>0&&!Z)$[$.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return Z}var Z80={tokenize:Y80,partial:!0};function sL(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:X80,continuation:{tokenize:z80},exit:G80}},text:{[91]:{name:"gfmFootnoteCall",tokenize:Q80},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:H80,resolveTo:B80}}}}function H80($,J,Z){let H=this,B=H.events.length,Q=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),X;while(B--){let G=H.events[B][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 Z(G);let Y=f2(H.sliceSerialize({start:X.end,end:H.now()}));if(Y.codePointAt(0)!==94||!Q.includes(Y.slice(1)))return Z(G);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(G),$.exit("gfmFootnoteCallLabelMarker"),J(G)}}function B80($,J){let Z=$.length,H;while(Z--)if($[Z][1].type==="labelImage"&&$[Z][0]==="enter"){H=$[Z][1];break}$[Z+1][1].type="data",$[Z+3][1].type="gfmFootnoteCallLabelMarker";let B={type:"gfmFootnoteCall",start:Object.assign({},$[Z+3][1].start),end:Object.assign({},$[$.length-1][1].end)},Q={type:"gfmFootnoteCallMarker",start:Object.assign({},$[Z+3][1].end),end:Object.assign({},$[Z+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=[$[Z+1],$[Z+2],["enter",B,J],$[Z+3],$[Z+4],["enter",Q,J],["exit",Q,J],["enter",X,J],["enter",z,J],["exit",z,J],["exit",X,J],$[$.length-2],$[$.length-1],["exit",B,J]];return $.splice(Z,$.length-Z+1,...G),$}function Q80($,J,Z){let H=this,B=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),Q=0,X;return z;function z(F){return $.enter("gfmFootnoteCall"),$.enter("gfmFootnoteCallLabelMarker"),$.consume(F),$.exit("gfmFootnoteCallLabelMarker"),G}function G(F){if(F!==94)return Z(F);return $.enter("gfmFootnoteCallMarker"),$.consume(F),$.exit("gfmFootnoteCallMarker"),$.enter("gfmFootnoteCallString"),$.enter("chunkString").contentType="string",Y}function Y(F){if(Q>999||F===93&&!X||F===null||F===91||P1(F))return Z(F);if(F===93){$.exit("chunkString");let K=$.exit("gfmFootnoteCallString");if(!B.includes(f2(H.sliceSerialize(K))))return Z(F);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(F),$.exit("gfmFootnoteCallLabelMarker"),$.exit("gfmFootnoteCall"),J}if(!P1(F))X=!0;return Q++,$.consume(F),F===92?U:Y}function U(F){if(F===91||F===92||F===93)return $.consume(F),Q++,Y;return Y(F)}}function X80($,J,Z){let H=this,B=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),Q,X=0,z;return G;function G(q){return $.enter("gfmFootnoteDefinition")._container=!0,$.enter("gfmFootnoteDefinitionLabel"),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionLabelMarker"),Y}function Y(q){if(q===94)return $.enter("gfmFootnoteDefinitionMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionMarker"),$.enter("gfmFootnoteDefinitionLabelString"),$.enter("chunkString").contentType="string",U;return Z(q)}function U(q){if(X>999||q===93&&!z||q===null||q===91||P1(q))return Z(q);if(q===93){$.exit("chunkString");let N=$.exit("gfmFootnoteDefinitionLabelString");return Q=f2(H.sliceSerialize(N)),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionLabelMarker"),$.exit("gfmFootnoteDefinitionLabel"),K}if(!P1(q))z=!0;return X++,$.consume(q),q===92?F:U}function F(q){if(q===91||q===92||q===93)return $.consume(q),X++,U;return U(q)}function K(q){if(q===58){if($.enter("definitionMarker"),$.consume(q),$.exit("definitionMarker"),!B.includes(Q))B.push(Q);return i0($,W,"gfmFootnoteDefinitionWhitespace")}return Z(q)}function W(q){return J(q)}}function z80($,J,Z){return $.check(K9,J,$.attempt(Z80,J,Z))}function G80($){$.exit("gfmFootnoteDefinition")}function Y80($,J,Z){let H=this;return i0($,B,"gfmFootnoteDefinitionIndent",5);function B(Q){let X=H.events[H.events.length-1];return X&&X[1].type==="gfmFootnoteDefinitionIndent"&&X[2].sliceSerialize(X[1],!0).length===4?J(Q):Z(Q)}}function tL($){let Z=($||{}).singleTilde,H={name:"strikethrough",tokenize:Q,resolveAll:B};if(Z===null||Z===void 0)Z=!0;return{text:{[126]:H},insideSpan:{null:[H]},attentionMarkers:{null:[126]}};function B(X,z){let G=-1;while(++G<X.length)if(X[G][0]==="enter"&&X[G][1].type==="strikethroughSequenceTemporary"&&X[G][1]._close){let Y=G;while(Y--)if(X[Y][0]==="exit"&&X[Y][1].type==="strikethroughSequenceTemporary"&&X[Y][1]._open&&X[G][1].end.offset-X[G][1].start.offset===X[Y][1].end.offset-X[Y][1].start.offset){X[G][1].type="strikethroughSequence",X[Y][1].type="strikethroughSequence";let U={type:"strikethrough",start:Object.assign({},X[Y][1].start),end:Object.assign({},X[G][1].end)},F={type:"strikethroughText",start:Object.assign({},X[Y][1].end),end:Object.assign({},X[G][1].start)},K=[["enter",U,z],["enter",X[Y][1],z],["exit",X[Y][1],z],["enter",F,z]],W=z.parser.constructs.insideSpan.null;if(W)c5(K,K.length,0,u3(W,X.slice(Y+1,G),z));c5(K,K.length,0,[["exit",F,z],["enter",X[G][1],z],["exit",X[G][1],z],["exit",U,z]]),c5(X,Y-1,G-Y+3,K),G=Y+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 Y=this.previous,U=this.events,F=0;return K;function K(q){if(Y===126&&U[U.length-1][1].type!=="characterEscape")return G(q);return X.enter("strikethroughSequenceTemporary"),W(q)}function W(q){let N=h9(Y);if(q===126){if(F>1)return G(q);return X.consume(q),F++,W}if(F<2&&!Z)return G(q);let V=X.exit("strikethroughSequenceTemporary"),L=h9(q);return V._open=!L||L===2&&Boolean(N),V._close=!N||N===2&&Boolean(L),z(q)}}}class eL{constructor(){this.map=[]}add($,J,Z){U80(this,$,J,Z)}consume($){if(this.map.sort(function(B,Q){return B[0]-Q[0]}),this.map.length===0)return;let J=this.map.length,Z=[];while(J>0)J-=1,Z.push($.slice(this.map[J][0]+this.map[J][1]),this.map[J][2]),$.length=this.map[J][0];Z.push($.slice()),$.length=0;let H=Z.pop();while(H){for(let B of H)$.push(B);H=Z.pop()}this.map.length=0}}function U80($,J,Z,H){let B=0;if(Z===0&&H.length===0)return;while(B<$.map.length){if($.map[B][0]===J){$.map[B][1]+=Z,$.map[B][2].push(...H);return}B+=1}$.map.push([J,Z,H])}function ly($,J){let Z=!1,H=[];while(J<$.length){let B=$[J];if(Z){if(B[0]==="enter"){if(B[1].type==="tableContent")H.push($[J+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(B[1].type==="tableContent"){if($[J-1][1].type==="tableDelimiterMarker"){let Q=H.length-1;H[Q]=H[Q]==="left"?"center":"right"}}else if(B[1].type==="tableDelimiterRow")break}else if(B[0]==="enter"&&B[1].type==="tableDelimiterRow")Z=!0;J+=1}return H}function $V(){return{flow:{null:{name:"table",tokenize:F80,resolveAll:K80}}}}function F80($,J,Z){let H=this,B=0,Q=0,X;return z;function z(E){let x=H.events.length-1;while(x>-1){let j=H.events[x][1].type;if(j==="lineEnding"||j==="linePrefix")x--;else break}let I=x>-1?H.events[x][1].type:null,S=I==="tableHead"||I==="tableRow"?D:G;if(S===D&&H.parser.lazy[H.now().line])return Z(E);return S(E)}function G(E){return $.enter("tableHead"),$.enter("tableRow"),Y(E)}function Y(E){if(E===124)return U(E);return X=!0,Q+=1,U(E)}function U(E){if(E===null)return Z(E);if(h0(E)){if(Q>1)return Q=0,H.interrupt=!0,$.exit("tableRow"),$.enter("lineEnding"),$.consume(E),$.exit("lineEnding"),W;return Z(E)}if(a0(E))return i0($,U,"whitespace")(E);if(Q+=1,X)X=!1,B+=1;if(E===124)return $.enter("tableCellDivider"),$.consume(E),$.exit("tableCellDivider"),X=!0,U;return $.enter("data"),F(E)}function F(E){if(E===null||E===124||P1(E))return $.exit("data"),U(E);return $.consume(E),E===92?K:F}function K(E){if(E===92||E===124)return $.consume(E),F;return F(E)}function W(E){if(H.interrupt=!1,H.parser.lazy[H.now().line])return Z(E);if($.enter("tableDelimiterRow"),X=!1,a0(E))return i0($,q,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E);return q(E)}function q(E){if(E===45||E===58)return V(E);if(E===124)return X=!0,$.enter("tableCellDivider"),$.consume(E),$.exit("tableCellDivider"),N;return P(E)}function N(E){if(a0(E))return i0($,V,"whitespace")(E);return V(E)}function V(E){if(E===58)return Q+=1,X=!0,$.enter("tableDelimiterMarker"),$.consume(E),$.exit("tableDelimiterMarker"),L;if(E===45)return Q+=1,L(E);if(E===null||h0(E))return _(E);return P(E)}function L(E){if(E===45)return $.enter("tableDelimiterFiller"),A(E);return P(E)}function A(E){if(E===45)return $.consume(E),A;if(E===58)return X=!0,$.exit("tableDelimiterFiller"),$.enter("tableDelimiterMarker"),$.consume(E),$.exit("tableDelimiterMarker"),M;return $.exit("tableDelimiterFiller"),M(E)}function M(E){if(a0(E))return i0($,_,"whitespace")(E);return _(E)}function _(E){if(E===124)return q(E);if(E===null||h0(E)){if(!X||B!==Q)return P(E);return $.exit("tableDelimiterRow"),$.exit("tableHead"),J(E)}return P(E)}function P(E){return Z(E)}function D(E){return $.enter("tableRow"),w(E)}function w(E){if(E===124)return $.enter("tableCellDivider"),$.consume(E),$.exit("tableCellDivider"),w;if(E===null||h0(E))return $.exit("tableRow"),J(E);if(a0(E))return i0($,w,"whitespace")(E);return $.enter("data"),R(E)}function R(E){if(E===null||E===124||P1(E))return $.exit("data"),w(E);return $.consume(E),E===92?b:R}function b(E){if(E===92||E===124)return $.consume(E),R;return R(E)}}function K80($,J){let Z=-1,H=!0,B=0,Q=[0,0,0,0],X=[0,0,0,0],z=!1,G=0,Y,U,F,K=new eL;while(++Z<$.length){let W=$[Z],q=W[1];if(W[0]==="enter"){if(q.type==="tableHead"){if(z=!1,G!==0)iy(K,J,G,Y,U),U=void 0,G=0;Y={type:"table",start:Object.assign({},q.start),end:Object.assign({},q.end)},K.add(Z,0,[["enter",Y,J]])}else if(q.type==="tableRow"||q.type==="tableDelimiterRow"){if(H=!0,F=void 0,Q=[0,0,0,0],X=[0,Z+1,0,0],z)z=!1,U={type:"tableBody",start:Object.assign({},q.start),end:Object.assign({},q.end)},K.add(Z,0,[["enter",U,J]]);B=q.type==="tableDelimiterRow"?2:U?3:1}else if(B&&(q.type==="data"||q.type==="tableDelimiterMarker"||q.type==="tableDelimiterFiller")){if(H=!1,X[2]===0){if(Q[1]!==0)X[0]=X[1],F=DU(K,J,Q,B,void 0,F),Q=[0,0,0,0];X[2]=Z}}else if(q.type==="tableCellDivider")if(H)H=!1;else{if(Q[1]!==0)X[0]=X[1],F=DU(K,J,Q,B,void 0,F);Q=X,X=[Q[1],Z,0,0]}}else if(q.type==="tableHead")z=!0,G=Z;else if(q.type==="tableRow"||q.type==="tableDelimiterRow"){if(G=Z,Q[1]!==0)X[0]=X[1],F=DU(K,J,Q,B,Z,F);else if(X[1]!==0)F=DU(K,J,X,B,Z,F);B=0}else if(B&&(q.type==="data"||q.type==="tableDelimiterMarker"||q.type==="tableDelimiterFiller"))X[3]=Z}if(G!==0)iy(K,J,G,Y,U);K.consume(J.events),Z=-1;while(++Z<J.events.length){let W=J.events[Z];if(W[0]==="enter"&&W[1].type==="table")W[1]._align=ly(J.events,Z)}return $}function DU($,J,Z,H,B,Q){let X=H===1?"tableHeader":H===2?"tableDelimiter":"tableData",z="tableContent";if(Z[0]!==0)Q.end=Object.assign({},jJ(J.events,Z[0])),$.add(Z[0],0,[["exit",Q,J]]);let G=jJ(J.events,Z[1]);if(Q={type:X,start:Object.assign({},G),end:Object.assign({},G)},$.add(Z[1],0,[["enter",Q,J]]),Z[2]!==0){let Y=jJ(J.events,Z[2]),U=jJ(J.events,Z[3]),F={type:"tableContent",start:Object.assign({},Y),end:Object.assign({},U)};if($.add(Z[2],0,[["enter",F,J]]),H!==2){let K=J.events[Z[2]],W=J.events[Z[3]];if(K[1].end=Object.assign({},W[1].end),K[1].type="chunkText",K[1].contentType="text",Z[3]>Z[2]+1){let q=Z[2]+1,N=Z[3]-Z[2]-1;$.add(q,N,[])}}$.add(Z[3]+1,0,[["exit",F,J]])}if(B!==void 0)Q.end=Object.assign({},jJ(J.events,B)),$.add(B,0,[["exit",Q,J]]),Q=void 0;return Q}function iy($,J,Z,H,B){let Q=[],X=jJ(J.events,Z);if(B)B.end=Object.assign({},X),Q.push(["exit",B,J]);H.end=Object.assign({},X),Q.push(["exit",H,J]),$.add(Z+1,0,Q)}function jJ($,J){let Z=$[J],H=Z[0]==="enter"?"start":"end";return Z[1][H]}var W80={name:"tasklistCheck",tokenize:q80};function JV(){return{text:{[91]:W80}}}function q80($,J,Z){let H=this;return B;function B(G){if(H.previous!==null||!H._gfmTasklistFirstContentOfListItem)return Z(G);return $.enter("taskListCheck"),$.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),Q}function Q(G){if(P1(G))return $.enter("taskListCheckValueUnchecked"),$.consume(G),$.exit("taskListCheckValueUnchecked"),X;if(G===88||G===120)return $.enter("taskListCheckValueChecked"),$.consume(G),$.exit("taskListCheckValueChecked"),X;return Z(G)}function X(G){if(G===93)return $.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),$.exit("taskListCheck"),z;return Z(G)}function z(G){if(h0(G))return J(G);if(a0(G))return $.check({tokenize:N80},J,Z)(G);return Z(G)}}function N80($,J,Z){return i0($,H,"whitespace");function H(B){return B===null?Z(B):J(B)}}function ry($){return yY([nL(),sL(),tL($),$V(),JV()])}var L80={};function MU($){let J=this,Z=$||L80,H=J.data(),B=H.micromarkExtensions||(H.micromarkExtensions=[]),Q=H.fromMarkdownExtensions||(H.fromMarkdownExtensions=[]),X=H.toMarkdownExtensions||(H.toMarkdownExtensions=[]);B.push(ry(Z)),Q.push(iL()),X.push(rL(Z))}var M6=O(c(),1),V80=[MU],A80=[VU],D80={code({node:$,className:J,children:Z,...H}){return M6.jsx("code",{className:s("rounded-xs bg-accent px-1 py-0.5 font-mono font-normal before:content-none after:content-none",J),...H,children:Z})},pre({children:$}){return M6.jsx("div",{className:"not-prose my-2 rounded-lg border border-border bg-accent px-3 py-2.5",children:M6.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 ay({size:$="sm",content:J}){return M6.jsx("div",{className:s("prose max-w-full min-w-0 wrap-anywhere prose-inherit",$==="sm"&&"prose-sm"),children:M6.jsx(XU,{remarkPlugins:V80,rehypePlugins:A80,components:D80,children:J})})}function ny({content:$}){return M6.jsx(XU,{allowedElements:[],skipHtml:!0,unwrapDisallowed:!0,children:$})}var jV=O(g(),1);var oy="/agentation-4s0nn45p.png";var sy="/airtable-hsa66v6q.png";var ty="/apollo-2ed5dy2d.png";var ey="/asana-tvgtwbx2.png";var $h="/atlassian-b3tq39hs.png";var Jh="/box-w3n36t5g.png";var ZV="/chrome-tspm94rw.svg";var Zh="/clickup-qqrqqvqb.png";var Hh="/cloudflare-j9p931v6.png";var Bh="/context7-8ht0xjfy.png";var Qh="/datadog-70ne3yzt.png";var Xh="/discord-vejhptwx.png";var zh="/dropbox-4m5s9mgr.png";var Gh="/elevenlabs-2nzzej1t.png";var Yh="/exa-qqj3vr0x.png";var Uh="/figma-y9898rry.png";var Fh="/firecrawl-w2t8nehx.png";var Kh="/github-av5r5y3e.png";var Wh="/gitlab-4pv5vm6b.png";var qh="/gmail-sg6a5v3x.png";var Nh="/googlecalendar-nqhh2v7r.png";var Lh="/googledrive-6s8xyab7.png";var Vh="/grafana-1yfsnwr6.png";var Ah="/granola-7j3b0nk2.png";var Dh="/hubspot-hghcmc2t.png";var Mh="/huggingface-kxzaxj83.png";var Ph="/intercom-td763jt8.png";var _h="/linear-v9s3az2d.png";var Oh="/monday-jdbs4wwf.png";var jh="/mongodb-emzxvhd5.png";var Th="/neon-zj4qar44.png";var Ch="/notion-w034c0b8.png";var wh="/paper-zbt34fab.png";var Eh="/paypal-kwwf7xsc.png";var Sh="/perplexity-4y63rxvj.png";var Ih="/postgresql-qsspbsr1.png";var Rh="/posthog-sphppc4w.png";var kh="/puppeteer-2xjt1a9b.png";var bh="/railway-834de8d2.png";var yh="/redis-spm6w2m1.png";var hh="/salesforce-1mk56v4z.png";var xh="/sentry-hdwpmvek.png";var vh="/shopify-90dadaav.png";var gh="/slack-1c1wj62s.png";var fh="/snowflake-hfpykpgy.png";var mh="/stripe-zrfaqbj3.png";var ph="/supabase-4vg33zf2.png";var uh="/telegram-v6tjyrs7.png";var ch="/twilio-dpyjdwpj.png";var dh="/vercel-7d0ssw28.png";var lh="/zapier-p67qfch0.png";var V90={agentation:oy,airtable:sy,apollo:ty,asana:ey,atlassian:$h,box:Jh,chrome:ZV,"chrome-devtools":ZV,clickup:Zh,cloudflare:Hh,context7:Bh,datadog:Qh,discord:Xh,dropbox:zh,elevenlabs:Gh,exa:Yh,figma:Uh,firecrawl:Fh,github:Kh,gitlab:Wh,gmail:qh,googlecalendar:Nh,googledrive:Lh,grafana:Vh,granola:Ah,hubspot:Dh,huggingface:Mh,intercom:Ph,linear:_h,monday:Oh,mongodb:jh,neon:Th,notion:Ch,paper:wh,paypal:Eh,perplexity:Sh,postgresql:Ih,posthog:Rh,puppeteer:kh,railway:bh,redis:yh,salesforce:hh,sentry:xh,shopify:vh,slack:gh,snowflake:fh,stripe:mh,supabase:ph,telegram:uh,twilio:ch,vercel:dh,zapier:lh},A90={"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 ih($){let J=$.match(/^claude[._]ai[._\s]+(.+)$/i);if(!J)return $;return J[1].replace(/_/g," ")}function PU($){return $.toLowerCase().replace(/[\s._-]+/g,"")}var D90=new Map(Object.entries(V90).map(([$,J])=>[PU($),J])),M90=new Map(Object.entries(A90).map(([$,J])=>[PU($),PU(J)]));function _U($){let J=PU(ih($));return D90.get(M90.get(J)??J)}function OU($){return ih($).split(/[\s._-]+/).filter(Boolean).map((J)=>J[0].toUpperCase()+J.slice(1)).join(" ")}var HV=O(c(),1);function FB({open:$,children:J}){return HV.jsx(t2,{initial:!1,children:$&&HV.jsx(r1.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:J},"content")})}var rh=O(g(),1);var oh=O(c(),1),P90=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function ah($,J){if($.name!=="Read"||!J)return null;let Z=$.input,H=typeof Z.file_path==="string"?Z.file_path:null;if(!H||!P90.test(H))return null;let B=J.endsWith("/")?J:`${J}/`;if(!H.startsWith(B))return null;return H.slice(B.length)}function nh({relPath:$}){let J=Z5(),[Z,H]=rh.useState(!1);if(Z)return null;let B=`/api/workspaces/${J}/preview/${$.split("/").map(encodeURIComponent).join("/")}`;return oh.jsx("img",{src:B,alt:$,loading:"lazy",onError:()=>H(!0),className:"max-h-64 max-w-full self-start rounded-lg border border-border object-contain"})}var NB=O(g(),1);var th=O(c(),1),_90=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 sh({children:$,active:J=!0,className:Z}){return th.jsx("span",{className:s(Z,J&&_90),children:$})}var KB=O(c(),1);function jU({className:$}){return KB.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:[KB.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"}),KB.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 X2=O(c(),1),TU="group/row flex w-full items-center gap-2 py-1.5 text-left select-none";function CJ({isFirst:$,isLast:J,marker:Z,loading:H=!1,isError:B=!1,children:Q}){let X=Z!=null||H;return X2.jsxs("div",{className:"relative flex gap-2.5",children:[X2.jsxs("div",{className:"relative w-[13px] shrink-0",children:[!$&&X2.jsx("span",{className:s("absolute top-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"h-1":"h-2.5")}),!J&&X2.jsx("span",{className:s("absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"top-[26px]":"top-5")}),Z?X2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2",children:Z}):H?X2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 p-0.5",children:X2.jsx(E5,{size:12,stroke:1.75,className:"animate-spin text-muted-foreground"})}):X2.jsx("span",{className:s("absolute top-[15px] left-1/2 z-10 size-[5px] -translate-x-1/2 -translate-y-1/2 rounded-full",B?"bg-destructive":"bg-border")})]}),Q]})}function WB({open:$}){return X2.jsx(r1.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:X2.jsx($6,{size:12,stroke:1.75})})}function TJ({children:$,className:J}){return X2.jsx("span",{className:s("flex size-4 items-center justify-center overflow-hidden rounded-xs bg-muted",J),children:$})}function eh({icon:$,size:J=12,stroke:Z=1.75}){return X2.jsx(TJ,{children:X2.jsx($,{size:J,stroke:Z,className:"text-muted-foreground"})})}function $x({src:$}){if(!$)return X2.jsx(TJ,{children:X2.jsx(jU,{className:"size-3 text-muted-foreground"})});return X2.jsx(TJ,{children:X2.jsx("img",{src:$,alt:"",className:"size-full object-cover"})})}var b90=Hx(),BV=Ux();function y90($){if(!$)return"$";return/^[A-Za-z_][A-Za-z0-9_]*$/.test($)?`$${$}`:`\${${$}}`}function h90($){try{return BV($,y90)}catch{return null}}function Fx($){return $.split("/").pop()??$}var x90=new Set(["bash","sh","zsh","fish","dash","ash","ksh","mksh","csh","tcsh","nu","pwsh","powershell"]),v90=new Set(["-o","+o","-O","+O","--rcfile","--init-file"]),g90=/^[A-Za-z_][A-Za-z0-9_]*=/;function f90($){if(/^-[a-zA-Z]*c$/.test($))return!0;let J=$.toLowerCase();return J==="--command"||J==="-command"}function m90($){let J=h90($);if(!J||J.length<3)return null;let Z=(Q)=>{let X=J[Q];return typeof X==="string"?X:null},H=0,B=()=>{while(g90.test(Z(H)??""))H++};if(B(),Fx(Z(H)??"")==="env")H++,B();if(!x90.has(Fx(Z(H)??"")))return null;H++;while(H<J.length){let Q=Z(H);if(Q===null)return null;if(f90(Q)){if(H+2!==J.length)return null;return Z(H+1)?.trim()||null}if(!Q.startsWith("-")&&!Q.startsWith("+"))return null;H+=v90.has(Q)?2:1}return null}function p90($){let J=$;for(let Z=0;Z<3;Z++){let H=m90(J);if(H===null)return J;J=H}return J}function u90($){return $.replace(/\\\r?\n[ \t]*/g," ").replace(/[ \t]*\r?\n[ \t]*/g," ").replace(/[ \t]{2,}/g," ").trim()}function _6($){return u90(p90($))}function wJ($,J){let Z=_6($);return Z?J(`$ ${Z}`):""}var c90=/^[A-Za-z]:\//;function d90($=""){if(!$)return $;return $.replace(/\\/g,"/").replace(c90,(J)=>J.toUpperCase())}var l90=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var Kx=/^\/([A-Za-z]:)?$/;function i90(){if(typeof process<"u"&&typeof process.cwd==="function")return process.cwd().replace(/\\/g,"/");return"/"}var QV=function(...$){$=$.map((H)=>d90(H));let J="",Z=!1;for(let H=$.length-1;H>=-1&&!Z;H--){let B=H>=0?$[H]:i90();if(!B||B.length===0)continue;J=`${B}/${J}`,Z=XV(B)}if(J=Wx(J,!Z),Z&&!XV(J))return`/${J}`;return J.length>0?J:"."};function Wx($,J){let Z="",H=0,B=-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(B===z-1||Q===1);else if(Q===2){if(Z.length<2||H!==2||Z[Z.length-1]!=="."||Z[Z.length-2]!=="."){if(Z.length>2){let G=Z.lastIndexOf("/");if(G===-1)Z="",H=0;else Z=Z.slice(0,G),H=Z.length-1-Z.lastIndexOf("/");B=z,Q=0;continue}else if(Z.length>0){Z="",H=0,B=z,Q=0;continue}}if(J)Z+=Z.length>0?"/..":"..",H=2}else{if(Z.length>0)Z+=`/${$.slice(B+1,z)}`;else Z=$.slice(B+1,z);H=z-B-1}B=z,Q=0}else if(X==="."&&Q!==-1)++Q;else Q=-1}return Z}var XV=function($){return l90.test($)};var zV=function($,J){let Z=QV($).replace(Kx,"$1").split("/"),H=QV(J).replace(Kx,"$1").split("/");if(H[0][1]===":"&&Z[0][1]===":"&&Z[0]!==H[0])return H.join("/");let B=[...Z];for(let Q of B){if(H[0]!==Q)break;Z.shift(),H.shift()}return[...Z.map(()=>".."),...H].join("/")};function EJ($){return $.input??{}}function X1($,J){let Z=$[J];return typeof Z==="string"?Z:""}function qx($){return(J)=>J.replace(/\/[^\s"']+/g,(Z)=>{if(!$)return Z;let H=zV($,Z);return H.startsWith("..")?Z:H})}function O6($){let J=Math.max(1,Math.round($/1000));if(J<60)return`${J}s`;let Z=Math.floor(J/60),H=J%60;return H?`${Z}m ${H}s`:`${Z}m`}var r90={ToolSearch:"Tool search",WebSearch:"Web search",WebFetch:"Web fetch"};function a90($){if(!$.startsWith("mcp__"))return $;let J=$.slice(5).split("__");return J.length>=2?J.slice(1).join("__"):J[0]}function n90($,J){let Z=$.name,H=EJ($);if(Z==="Bash")return wJ(X1(H,"command"),J);if(Z==="Read"||Z==="Write"||Z==="Edit")return J(X1(H,"file_path"));if(Z==="Glob")return J(X1(H,"pattern"));if(Z==="Grep")return`/${X1(H,"pattern")}/ ${J(X1(H,"path"))}`;if(Z==="WebSearch")return X1(H,"query");if(Z==="WebFetch")return X1(H,"url");if(Z==="ToolSearch"){let B=X1(H,"query");if(B.startsWith("select:"))return B.slice(7).split(",").map(a90).join(", ");return B}return""}var qB={displayName:($)=>r90[$.name]??$.name,brief:n90};var GV={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"},Lx={read:"Read",listFiles:"List files",search:"Search"};function Vx($){let J=$?.commandActions;if(!Array.isArray(J)||J.length===0)return null;let Z=J[0],H=Z?.type;if(!H||!(H in Lx))return null;if(J.some((B)=>B?.type!==H))return null;return Z}var Nx={spawn_agent:"Run sub-agent",send_input:"Message the agent",resume_agent:"Resume the agent",close_agent:"Stopping the agent"};function o90($){if($.name==="exec"){let J=Vx($.input);if(J?.type)return Lx[J.type]}if($.name==="subagent"){let J=$.input?.action;if(typeof J==="string"&&J in Nx)return Nx[J]}return GV[$.name]??$.name}function s90($,J){let Z=$.name,H=EJ($);if(Z==="exec"){let B=Vx(H);if(B?.type==="read")return J(B.path||B.name||"");if(B?.type==="search")return[B.query&&`/${B.query}/`,B.path&&J(B.path)].filter(Boolean).join(" ");if(B?.type==="listFiles")return B.path?J(B.path):"";return wJ(X1(H,"command"),J)}if(Z==="apply_patch"){let B=H.changes;if(Array.isArray(B))return B.map((X)=>X&&typeof X==="object"?X.path:void 0).filter((X)=>typeof X==="string").map(J).join(", ");return""}if(Z==="web_search"){let B=H.queries;if(Array.isArray(B)&&B.length>0)return B.filter((Q)=>typeof Q==="string").join(" · ");return X1(H,"query")}if(Z==="update_plan"){let B=H.plan;return typeof B==="string"?B.split(`
|
|
65
|
+
`)[0]:""}if(Z==="subagent"){if(X1(H,"action")==="close_agent")return"";return X1(H,"prompt")}if(Z==="subagent_activity")return X1(H,"kind");if(Z==="generate_image")return X1(H,"prompt").split(`
|
|
66
|
+
`)[0];if(Z==="read_mcp_resource")return X1(H,"uri");if(Z==="list_mcp_resources"||Z==="list_mcp_resource_templates")return X1(H,"server");return""}var Ax={displayName:o90,brief:s90};function Dx($){let J=$.indexOf(":"),Z=(J>0?$.slice(0,J):$).trim(),H=J>0?$.slice(J+1).trim():"",B=Z.match(/^(.*?)\s*\(([^)]*)\)$/);if(!B)return{action:Z,qualifier:"",detail:H};return{action:B[1].trim(),qualifier:B[2].trim(),detail:H}}var t90={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 e90($){let{action:J}=Dx($.name),Z=t90[J];if(Z)return Z;let H=J.replace(/_/g," ");return H.charAt(0).toUpperCase()+H.slice(1)}function $30($,J){let{action:Z,qualifier:H,detail:B}=Dx($.name),Q=B||H;if(!Q)return"";return Z==="terminal"?`$ ${_6(Q)}`:J(Q)}var Mx={displayName:e90,brief:$30};var J30={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 Z30($,J){let Z=$.name,H=EJ($);if(Z==="read"||Z==="write"||Z==="edit")return J(X1(H,"path"));if(Z==="apply_patch"){let B=H.changes;if(Array.isArray(B)&&B.length>0){let z=B.map((G)=>G&&typeof G==="object"?X1(G,"path"):"").filter(Boolean);if(z.length===1)return J(z[0]);if(z.length>1)return`${z.length} files`}let Q=X1(H,"patch")||X1(H,"input"),X=Q.split(`
|
|
67
|
+
`).find((z)=>z.startsWith("*** "))??Q.split(`
|
|
68
|
+
`)[0];return J(X??"")}if(Z==="exec"||Z==="bash"){let B=X1(H,"command")||X1(H,"code");return wJ(B,J)}if(Z==="ls"||Z==="find"||Z==="grep")return J(X1(H,"path")||X1(H,"pattern"));if(Z==="process"){let B=X1(H,"action"),Q=X1(H,"name");return[B,Q].filter(Boolean).join(" ")||J(_6(X1(H,"command")))}if(Z==="web_search"||Z==="x_search")return X1(H,"query");if(Z==="web_fetch")return X1(H,"url");if(Z==="memory_search")return X1(H,"query");if(Z==="memory_get")return X1(H,"key")||X1(H,"name");if(Z==="sessions_history"||Z==="sessions_send"||Z==="sessions_yield")return X1(H,"sessionKey")||X1(H,"agentId");if(Z==="sessions_list"||Z==="agents_list")return X1(H,"agentId");if(Z==="subagents"||Z==="sessions_spawn")return X1(H,"task")||X1(H,"agentId");if(Z==="image"||Z==="image_generate")return X1(H,"prompt")||J(X1(H,"path"));if(Z==="message")return X1(H,"recipient")||X1(H,"to");if(Z==="update_plan"){let B=H.plan;if(Array.isArray(B)){let X=B.find((z)=>!!z&&typeof z==="object"&&z.status==="in_progress")?.step??B[0]?.step;if(typeof X==="string")return X}return""}return""}var Px={displayName:($)=>J30[$.name]??qB.displayName($),brief:($,J)=>Z30($,J)||qB.brief($,J)};function YV($){if(!($.name==="Bash"||$.name==="exec"||$.name==="bash"))return null;let Z=$.input??{},H=typeof Z.command==="string"?Z.command:"";if(!H)return null;let Q=_6(H).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 UV($){let J=$.name;if(!J.startsWith("mcp__"))return null;let Z=J.slice(5),H=Z.indexOf("__");if(H<=0)return null;return{server:Z.slice(0,H),tool:Z.slice(H+2),rest:""}}function FV($){if($.provider!=="codex"||!$.mcpServer)return null;if($.name in GV)return null;if($.mcpServer==="codex")return null;let J=$.name.indexOf(".");if(J>0)return{server:$.name.slice(0,J),tool:$.name.slice(J+1),rest:""};return{server:$.mcpServer,tool:$.name,rest:""}}function KV($,J){let Z=J.toLowerCase();return["-","_","."].find((B)=>Z.startsWith($.toLowerCase()+B))?J.slice($.length+1):J}var H30={"claude-code":qB,openclaw:Px,codex:Ax,hermes:Mx};function _x($){return H30[$.provider??"claude-code"]}function Ox($){return _x($).displayName($)}function jx($,J){return _x($).brief($,qx(J))}var d5=O(c(),1),Tx=[Cx,wx,WV];function B30(){let[$,J]=NB.useState(0);NB.useEffect(()=>{let H=setInterval(()=>J((B)=>(B+1)%Tx.length),600);return()=>clearInterval(H)},[]);let Z=Tx[$];return d5.jsx(TJ,{className:"size-5",children:d5.jsx(Z,{size:16,stroke:1.75,className:"text-foreground"})})}function Ex({call:$,cwd:J,isFirst:Z,isLast:H,renderNestedParts:B}){let[Q,X]=NB.useState(!1),z=$.subagent,G=$.input??{},Y=z?.description??G.description??"Subtask",U=z?.status,F=$.state==="error"||U==="failed",K=$.state==="running"||U==="running",W=z?.usage?.toolUses,q=z?.usage?.durationMs,V=(K&&z?.progress?.length?z.progress[z.progress.length-1]:null)??(W!=null?`Took ${W} step${W===1?"":"s"}`:null),L=(z?.transcript??[]).flatMap((_)=>_.parts),A=typeof $.output==="string"?$.output:"",M=L.length>0||!!A;return d5.jsx(CJ,{isFirst:Z,isLast:H,marker:K?d5.jsx(B30,{}):d5.jsx(TJ,{className:"size-5",children:d5.jsx(WV,{size:16,stroke:1.75,className:"text-foreground"})}),isError:F,children:d5.jsxs("div",{className:"min-w-0 flex-1",children:[d5.jsxs("button",{type:"button",title:`Agent: ${Y}`,onClick:()=>M&&X((_)=>!_),className:s("group/row flex w-full flex-col items-start gap-0.5 py-1.5 text-left select-none",M?"cursor-pointer":"cursor-default"),children:[d5.jsxs("span",{className:"flex w-full items-center gap-2",children:[d5.jsxs(sh,{active:K,className:"min-w-0 flex-1 truncate text-xs font-medium",children:["Agent: ",Y]}),!K&&q!=null&&d5.jsx("span",{className:"shrink-0 rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground tabular-nums",children:O6(q)}),U==="failed"&&d5.jsx("span",{className:"shrink-0 text-xs text-destructive",children:"✗"}),U==="stopped"&&d5.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"✗"}),M&&d5.jsx(WB,{open:Q})]}),V&&d5.jsx("span",{className:"w-full truncate text-xs text-muted-foreground",children:V})]}),M&&d5.jsx(FB,{open:Q,children:d5.jsxs("div",{className:"mt-1 mb-1 overflow-hidden rounded-lg border border-border",children:[L.length>0&&d5.jsx("div",{className:"py-1.5 pr-2 pl-3",children:B(L,J)}),A&&d5.jsx("div",{className:s("bg-muted/30 px-3.5 py-3 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",L.length>0&&"border-t border-border"),children:A})]})})]})})}var j6=O(g(),1);var gx=O(g(),1);var LV=new Set(["<",">","{","}","[","]"]),MV=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"]),Q30=new Set([...MV,"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"]),kx=new Set(["+","-","*","/","%","=","!","&","|","^","~","!","?",":",".",",",";","'",'"',".","(",")","[","]","#","@","\\",...LV]),X30={keywords:MV,onCommentStart:xx,onCommentEnd:N30};function z30($){let J=0;if(/\binterface\s+[A-Za-z_$][\w$]*/.test($))J+=2;if(/\btype\s+[A-Za-z_$][\w$]*\s*=/.test($))J+=2;if(/\benum\s+[A-Za-z_$][\w$]*/.test($))J+=2;if(/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test($))J+=2;if(/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test($))J+=1;if(/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test($))J+=1;if(/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test($))J+=1;return J>=2}function G30($,J){if($[J]!=="<")return!1;let Z=0,H=!1;for(let B=J;B<$.length;B++){let Q=$[B];if(Q==="<"){Z++;continue}if(Q===">"){if(Z--,Z===0){let X=B+1;while(X<$.length&&/\s/.test($[X]))X++;if(!(H&&$[X]==="("))return!1;let z=$.slice(X,X+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(z)}continue}if(Z===0)continue;if(/[$A-Za-z_]/.test(Q)){H=!0;continue}if(/[\s,\.\=\?\:\|\&\[\]]/.test(Q))continue;return!1}return!1}var EU=["identifier","keyword","string","class","property","entity","jsxliterals","sign","comment","break","space"],[SJ,Y30,i3,qV,NV,U30,F30,L9,Sx,VV,Ix]=EU.map(($,J)=>J);function LB($){return/^[^\S\r\n]+$/g.test($)}function K30($){return kx.has($)}function W30($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function SU($){return/^[\w_]+$/.test($)||bx($)}function Rx($){let J=$[0];return SU(J)&&J===J.toUpperCase()||$==="null"}function bx($){return/[^\u0000-\u007f]/.test($)}function yx($){return/^[a-zA-Z]$/.test($)}function hx($){return yx($)||bx($)}function IJ($){return hx($[0])&&($.length===1||SU($.slice(1)))}function AV($){return $==="`"}function DV($){return $==='"'||$==="'"}function q30($){return DV($)||AV($)}function xx($,J){let Z=$+J;if(Z==="/*")return 2;return Z==="//"?1:0}function N30($,J){return $+J==="*/"?2:J===`
|
|
69
|
+
`?1:0}function L30($){return $[0]==="/"&&!xx($[0],$[1])}function V30($,J){let Z={...X30,...J},H=!!(J&&J.keywords instanceof Set),B=z30($),Q=H?Z.keywords:B?Q30:MV,{onCommentStart:X,onCommentEnd:z}=Z,G=Z.typeKeywords instanceof Set?Z.typeKeywords:null,Y="",U=-1,F=[-1,""],K=[-2,""],W=[],q=!1,N=0,V=!1,L=0,A=()=>q&&!V&&!N,M=()=>N&&!A(),_=()=>!N&&A()&&!V&&L>0,P=null,D=!1,w=0,R=0,b=()=>P!==null,E=()=>D,x=()=>R>w,I=()=>R>0&&R===w,S=()=>b()||x();function j(k){let y=k===`
|
|
70
|
+
`;if(M()){if(b())return i3;let[,u]=F;if(IJ(k)){if(u==="<"||u==="</")return U30}}if(_())return F30;if(b()||x())return i3;else if(G&&G.has(k))return F[1]==="."?SJ:qV;else if(Q.has(k))return F[1]==="."?SJ:Y30;else if(y)return VV;else if(LB(k))return Ix;else if(k.split("").every(K30))return L9;else if(Rx(k))return M()?SJ:qV;else{if(IJ(k)){let u=F[1]==="."&&IJ(K[1]);if(!S()&&!u)return SJ;if(u)return NV}return i3}}let C=(k,y)=>{if(y)Y=y;if(Y){U=typeof k==="number"?k:j(Y);let v=[U,Y];if(U!==Ix&&U!==VV)K=F,F=v;W.push(v)}Y=""};for(let k=0;k<$.length;k++){let y=$[k],v=$[k-1],u=$[k+1],T=v+y,t=y+u;if(typeof Z.onQuote==="function"&&y==="'"&&!b()&&!_()&&!x()){let l=Z.onQuote(y,k,$);if(typeof l==="number"&&l>=1&&!Number.isNaN(l)){let z0=Math.min(l,$.length-k),W0=k+z0;C(),Y=$.slice(k,W0),C(SJ),k=W0-1;continue}}if(DV(y)&&!_()&&!x()){if(C(),v!=="\\"){if(P&&y===P)P=null;else if(!P)P=y}C(i3,y);continue}if(!x()){if(v!=="\\n"&&AV(y)){C(),C(i3,y),R++;continue}}if(x()){if(v!=="\\n"&&AV(y)){if(R>0){C(),R--,C(i3,y);continue}}if(t==="${"){w++,C(i3),C(L9,t),k++;continue}}if(I()&&y==="}"){C(),w--,C(L9,y);continue}if(A()){if(y==="{"){C(),C(L9,y),V=!0;continue}}if(q){if(!N&&y==="<"){if(C(),u==="/")N=2,Y=t,k++;else N=1,Y=y;C(L9);continue}if(N){if(y===">"&&!"/=".includes(v)){if(C(),N===1)N=0,L++;else N=0,q=!1;C(L9,y);continue}if(t==="/>"||t==="</"){if(Y!=="<"&&Y!=="/")C();if(t==="/>")N=0;else L--;if(!L)q=!1;Y=t,k++,C(L9);continue}if(y==="<"){C(),Y=y,C(L9);continue}if(u==="-"&&!S()&&!_()){if(Y){C(NV,Y+y+u),k++;continue}}if(u==="="&&!S()){if(!LB(y)){if(LB(Y))C();let l=Y+y;if(IJ(l)){C(NV,l);continue}}}}}if(!N&&(y==="<"&&hx(u)||t==="</")){let l=k-1;while(l>=0&&/\s/.test($[l]))l--;let z0=l>=0?$[l]:"",[W0,Q0]=F,G0=!1,L0=!1;if(Y&&!LB(Y)){let J0=Y;if(Rx(J0)||J0==="true"||J0==="false")G0=!0;else if(Q.has(J0)&&IJ(J0))L0=!0;else if(IJ(J0))G0=!0}let i=y==="<"&&/[$\w\]\)]/.test(z0)&&(G0||!L0&&(W0===SJ||W0===qV||W0===L9&&(Q0===")"||Q0==="]"))),$0=y==="<"&&G30($,k);if(!i&&!$0)N=u==="/"?2:1;if(y==="<"&&(u==="/"||yx(u))){if(!i&&!$0&&!S()&&!_()&&!E())q=!0}}let B0=q30(y),h=x(),e=!q&&L30(t),A0=_();if(B0||h||DV(P))Y+=y;else if(e){C();let[l,z0]=F;if(e&&l!==-1&&!(l===L9&&z0!==")"||l===Sx)){Y=y,C();continue}D=!0;let W0=k++,Q0=()=>k>=$.length,G0=()=>Q0()||$[k]===`
|
|
71
|
+
`,L0=!1,i=!1;for(;!G0();k++){let $0=$[k],J0=$[k-1]==="\\";if(!J0&&$0==="[")i=!0;if(!J0&&$0==="]")i=!1;if($0==="/"&&!i&&!J0){L0=!0;while(W0!==k&&/^[a-z]$/.test($[k+1])&&!G0())k++;break}}if(D=!1,W0!==k&&L0)Y=$.slice(W0,k+1),C(i3);else Y=y,C(),k=W0}else if(X(y,u)){C();let l=k,z0=X(y,u);if(z0){for(;k<$.length;k++)if(z($[k-1],$[k])==z0)break}Y=$.slice(l,k+1),C(Sx)}else if(y===" "||y===`
|
|
72
|
+
`)if(y===" "&&(LB(Y)||!Y||A0)){if(Y+=y,u==="<")C()}else C(),Y=y,C();else if(V&&y==="}")C(),Y=y,C(),V=!1;else if(A0&&!LV.has(y)||x()||(SU(y)===SU(Y[Y.length-1])||A())&&!kx.has(y))Y+=y;else{if(T==="</")Y=T;if(C(),T!=="</")Y=y;if(t==="</"||t==="/>")Y=t,C(),k++;else if(LV.has(y))C()}}return C(),W}function A30($,J){let Z=[],H=J&&typeof J.lineClassName==="function"?J.lineClassName:null,B=0,Q=(Y,U)=>{let F=H?H(U,B):"";return B++,{type:"element",tagName:"span",children:Y,properties:{className:F?`sh__line ${F}`:"sh__line"}}};function X(Y){let U=Y.map(([,K])=>K).join(""),F=Y.map(([K,W])=>{let q=EU[K];return{type:"element",tagName:"span",children:[{type:"text",value:W}],properties:{className:`sh__token--${q}`,style:{color:`var(--sh-${q})`}}}});Z.push(Q(F,U))}let z=[],G=!1;for(let Y=0;Y<$.length;Y++){let U=$[Y],[F,K]=U,W=Y===$.length-1;if(F!==VV){if(K.includes(`
|
|
73
|
+
`)){let q=K.split(`
|
|
74
|
+
`);for(let N=0;N<q.length;N++)if(z.push([F,q[N]]),N<q.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 Z}var D30=($)=>{let J=`class="${$.className}"`;if($.style){let Z=Object.entries($.style).map(([H,B])=>`${H}:${B}`).join(";");J+=` style="${Z}"`}return J};function M30($){return $.map((J)=>{let{tagName:Z}=J,H=J.children.map((B)=>{let{tagName:Q,children:X,properties:z}=B;return`<${Q} ${D30(z)}>${W30(X[0].value)}</${Q}>`}).join("");return`<${Z} class="${J.properties.className}">${H}</${Z}>`}).join(`
|
|
75
|
+
`)}function vx($,J){let Z=V30($,J),H=A30(Z,J);return M30(H)}var b61={TokenTypes:EU,TokenMap:new Map(EU.map(($,J)=>[$,J]))};var PV=O(c(),1),P30=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 fx({code:$,className:J}){let Z=gx.useMemo(()=>vx($),[$]);return PV.jsx("pre",{className:s("overflow-auto font-mono text-xs leading-relaxed whitespace-pre",P30,J),children:PV.jsx("code",{className:"font-mono",dangerouslySetInnerHTML:{__html:Z}})})}var _30={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 O30($){let J=$.split(/[\\/]/).pop()??"",Z=J.lastIndexOf("."),H=Z>0?J.slice(Z+1).toLowerCase():"";return _30[H]??null}function j30($){let J=$.trim();if(J.length<2||!(J.startsWith("{")||J.startsWith("[")))return null;try{return JSON.stringify(JSON.parse(J),null,2)}catch{return null}}function T30($){let J=$.split(`
|
|
76
|
+
`);if(!J.some((Z)=>/^\s*\d+\t/.test(Z)))return $;return J.map((Z)=>Z.replace(/^\s*\d+\t/,"")).join(`
|
|
77
|
+
`)}function mx($,J){let Z=$.input??{},H=typeof Z.file_path==="string"?Z.file_path:typeof Z.path==="string"?Z.path:"",B=H?O30(H):null,Q=$.name==="Read"||$.name==="read",X=$.name==="Write"||$.name==="write";if(B&&Q&&J)return{kind:"highlight",code:T30(J),label:B};if(B&&X&&typeof Z.content==="string"&&Z.content)return{kind:"highlight",code:Z.content,label:B};let z=j30(J);if(z)return{kind:"highlight",code:z,label:"json"};return{kind:"plain"}}var Z4=O(c(),1),_V="max-h-[280px] overflow-auto px-3 py-2.5 font-mono text-xs leading-relaxed";function px({call:$,output:J,isError:Z}){let[H,B]=j6.useState(!1),Q=j6.useMemo(()=>Z?{kind:"plain"}:mx($,J),[$,J,Z]);if(Q.kind==="plain")return Z4.jsx("div",{className:s("rounded-lg border",Z?"border-destructive/30 bg-destructive/10":"border-border bg-muted"),children:Z4.jsx("pre",{className:s(_V,"break-all whitespace-pre-wrap",Z?"text-destructive":"text-muted-foreground"),children:J||"(empty)"})});return Z4.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-muted",children:[Z4.jsx(C30,{raw:H,onRaw:B,label:Q.label,copyText:H?J:Q.code}),H?Z4.jsx("pre",{className:s(_V,"break-all whitespace-pre-wrap text-muted-foreground"),children:J||"(empty)"}):Z4.jsx(fx,{code:Q.code,className:s(_V,"text-muted-foreground")})]})}function C30({raw:$,onRaw:J,label:Z,copyText:H}){return Z4.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2",children:[[[!1,Z],[!0,"raw"]].map(([Q,X])=>Z4.jsx(C0,{type:"button",variant:$===Q?"outline":"ghost",size:"sm",onClick:()=>J(Q),className:"rounded-full text-xs uppercase",children:X},X)),Z4.jsx("div",{className:"flex-1"}),Z4.jsx(w30,{text:H})]})}function w30({text:$}){let[J,Z]=j6.useState(!1);return j6.useEffect(()=>{if(!J)return;let B=setTimeout(()=>Z(!1),1500);return()=>clearTimeout(B)},[J]),Z4.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard?.writeText($).then(()=>Z(!0)).catch(()=>{})},"aria-label":J?"Copied":"Copy",children:J?Z4.jsx(F3,{stroke:1.75}):Z4.jsx(iX,{stroke:1.75})})}var S1=O(c(),1);function IU({parts:$,cwd:J=null,processing:Z=!1}){let H=$.filter((B)=>B.type==="reasoning"||B.type==="tool-call");return S1.jsx("div",{className:"flex flex-col",children:H.map((B,Q)=>{let X=Q===H.length-1,z={isFirst:Q===0,isLast:X};if(B.type==="reasoning")return S1.jsx(E30,{text:B.text,durationMs:B.durationMs,inProgress:Z&&X,...z},Q);return S1.jsx(S30,{call:B.call,cwd:J,...z},B.call.toolCallId||Q)})})}function OV({isFirst:$,isLast:J,call:Z,leading:H,marker:B,name:Q,brief:X,preview:z}){let[G,Y]=jV.useState(!1),U=Z.state==="error",F=Z.state==="running"||Z.state==="pending",K=U?Z.errorText??"":typeof Z.output==="string"?Z.output:"",W=!!(K||U||z),q=X?`${Q}: ${X}`:Q;return S1.jsx(CJ,{isFirst:$,isLast:J,marker:B,loading:F,isError:U,children:S1.jsxs("div",{className:"min-w-0 flex-1",children:[S1.jsxs("button",{type:"button",title:q,onClick:()=>W&&Y((N)=>!N),className:s(TU,W?"cursor-pointer":"cursor-default"),children:[H,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}),F&&B&&S1.jsx(E5,{size:12,stroke:1.75,className:"shrink-0 animate-spin text-muted-foreground"}),W&&S1.jsx(WB,{open:G})]}),W&&S1.jsx(FB,{open:G,children:S1.jsxs("div",{className:"mt-1 mb-1 flex flex-col gap-1.5",children:[z,(K||U)&&S1.jsx(px,{call:Z,output:K,isError:U})]})})]})})}function E30({isFirst:$,isLast:J,text:Z,inProgress:H=!1,durationMs:B}){let[Q,X]=jV.useState(!1);if(!Z){let Y=B===void 0?"Thought":`Thought for ${O6(B)}`;return S1.jsx(CJ,{isFirst:$,isLast:J,loading:H,children:S1.jsx("div",{className:s(TU,"min-w-0 flex-1 cursor-default"),children:S1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:H?"Thinking":Y})})})}let z=H?"Thinking":"Thought",G=H||Q;return S1.jsx(CJ,{isFirst:$,isLast:J,loading:H,children:S1.jsxs("div",{className:"min-w-0 flex-1",children:[S1.jsxs("button",{type:"button","aria-expanded":G,onClick:()=>X((Y)=>!Y),className:s(TU,"cursor-pointer"),children:[S1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:z}),S1.jsx(WB,{open:G})]}),S1.jsx(FB,{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(ny,{content:Z})})})]})})}function S30({call:$,cwd:J,isFirst:Z,isLast:H}){if($.caller==="subagent")return S1.jsx(Ex,{call:$,cwd:J,isFirst:Z,isLast:H,renderNestedParts:(X,z)=>S1.jsx(IU,{parts:X,cwd:z})});if($.name==="Skill"&&$.skill){let X=$.state==="success";return S1.jsx(OV,{isFirst:Z,isLast:H,call:$,marker:X?S1.jsx(eh,{icon:ux,size:16,stroke:1.75}):void 0,name:"Loading skill",brief:$.skill.skillName})}let B=YV($)??UV($)??FV($);if(B){let X=KV(B.server,B.tool);return S1.jsx(OV,{isFirst:Z,isLast:H,call:$,marker:S1.jsx($x,{src:_U(B.server)}),name:OU(B.server),brief:B.rest?`${X} ${B.rest}`:X})}let Q=$.state==="error"?null:ah($,J);return S1.jsx(OV,{isFirst:Z,isLast:H,call:$,leading:S1.jsx(I30,{call:$}),name:Ox($),brief:jx($,J),preview:Q?S1.jsx(nh,{relPath:Q}):void 0})}function I30({call:$}){if($.caller!=="mcp"&&$.caller!=="server-tool")return null;let J=$.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:J})}var _1=O(c(),1);function lx(){return _1.jsx("div",{className:"flex items-center gap-1 px-1 py-3",children:[0,1,2].map(($)=>_1.jsx("span",{className:"block h-1 w-1 rounded-full bg-ring",style:{animation:"pulse-dot 1.4s ease-in-out infinite",animationDelay:`${$*0.2}s`}},$))})}function ix($){if($.type==="reasoning")return!0;if($.type==="tool-call")return!0;return!1}function R30($){let J=[];for(let Z of $)if(ix(Z)){let H=J[J.length-1];if(H&&H.kind==="run")H.parts.push(Z);else J.push({kind:"run",parts:[Z]})}else J.push({kind:"single",part:Z});return J}function RU({parts:$,cwd:J,processing:Z=!1}){let H=R30($);return _1.jsx("div",{className:"flex flex-col",children:H.map((B,Q)=>{let X=Q===0?"":"mt-3",z=Q===H.length-1;return _1.jsx("div",{className:X,children:B.kind==="run"?_1.jsx(IU,{parts:B.parts,cwd:J,processing:Z&&z}):_1.jsx(x30,{part:B.part})},Q)})})}function k30($){return $.some((J)=>J.type!=="text"||J.text.trim().length>0)}function b30($){let J=-1;for(let H=$.length-1;H>=0;H--)if(ix($[H])){J=H;break}if(J<0)return null;let Z=$.slice(J+1);if(!k30(Z))return null;return{work:$.slice(0,J+1),response:Z}}function y30({parts:$,cwd:J,durationMs:Z,defaultOpen:H}){let B=Z===void 0?"Worked":`Worked for ${O6(Z)}`;return _1.jsxs(qz,{defaultOpen:H,className:"group/collapsible",children:[_1.jsxs(Nz,{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:[_1.jsx("span",{children:B}),_1.jsx($6,{size:16,stroke:1.5,className:"shrink-0 transition-transform group-data-open/collapsible:rotate-90"})]}),_1.jsx(Lz,{className:"overflow-hidden pt-2",children:_1.jsx(RU,{parts:$,cwd:J})})]})}function h30({parts:$,cwd:J,processing:Z=!1,durationMs:H}){let B=Z?null:b30($);return _1.jsx("div",{className:"w-full min-w-0",children:Z?_1.jsx(RU,{parts:$,cwd:J,processing:!0}):B?_1.jsxs("div",{className:"flex flex-col gap-3",children:[_1.jsx(y30,{parts:B.work,cwd:J,durationMs:H}),_1.jsx(RU,{parts:B.response,cwd:J})]}):_1.jsx(RU,{parts:$,cwd:J})})}var rx=dx.memo(function({turn:J,processing:Z=!1}){let H=Y5().cwd;if(J.role==="user"&&J.origin.kind==="user-input"){let B=J.parts.filter((X)=>X.type==="file"),Q=J.parts.filter((X)=>X.type==="text").map((X)=>X.type==="text"?X.text:"").join(`
|
|
78
|
+
`);if(!Q&&B.length===0)return null;return _1.jsxs("div",{className:"flex w-full min-w-0 flex-col items-end gap-1.5 pl-8",children:[B.map((X,z)=>_1.jsx(ax,{mediaType:X.mediaType,url:X.url,filename:X.filename},z)),Q&&_1.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 _1.jsx(h30,{parts:J.parts,cwd:H,processing:Z,durationMs:J.meta?.durationMs})});function x30({part:$}){switch($.type){case"text":return _1.jsx(ay,{content:$.text});case"tool-call":return _1.jsx(IU,{parts:[$],cwd:null});case"file":return _1.jsx(ax,{mediaType:$.mediaType,url:$.url,filename:$.filename});case"source-url":return _1.jsx(cx,{url:$.url,title:$.title});case"source-document":return _1.jsx(cx,{url:"#",title:$.title});case"data":return _1.jsx(v30,{name:$.name,data:$.data});case"reasoning":return null}}function ax({mediaType:$,url:J,filename:Z}){if($.startsWith("image/")&&J)return _1.jsx("img",{src:J,alt:Z??"attachment",className:"max-h-64 max-w-full rounded-lg border border-border object-contain"});return _1.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:[_1.jsx(XJ,{size:16,stroke:1.75}),_1.jsx("span",{className:"truncate",children:Z??$})]})}function cx({url:$,title:J}){return _1.jsx("a",{href:$,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:J??$})}function v30({name:$,data:J}){return _1.jsxs("details",{children:[_1.jsxs("summary",{className:"cursor-pointer text-xs text-muted-foreground",children:["data:",$]}),_1.jsx("pre",{className:"mt-1 overflow-auto rounded bg-muted p-2 font-mono text-xs text-muted-foreground",children:JSON.stringify(J,null,2)})]})}var U5=O(c(),1),g30=[],f30=[];function kU({active:$=!0,focusRequest:J=0,docked:Z=!1,chatLoaded:H,view:B,previewTurn:Q,sessionId:X,processing:z,composerBanner:G,composerAvailability:Y,annotation:U,send:F,stop:K,onNavigateFromWelcome:W,onClose:q,builderDraft:N}){let V=Z5(),L=y4.useRef(null),A=y4.useRef(null),M=N?.sessionId??X??null,_=N?null:X??null,P=N?g30:B.turns,D=_5((h)=>h.hasSentMessageFromMoi),w=_5((h)=>(h.workspaceIdsPendingAnalysis??[]).includes(V)),R=s2((h)=>(h.attachments[o2(V,M)]??[]).some((e)=>e.status==="uploading")),b=!EH(!0,R,Y),E=N?null:Q,x=N?f30:B.notices,I=y4.useMemo(()=>xw(E?[...P,E]:P),[P,E]),S=y4.useMemo(()=>gw(I,x),[I,x]),j=I.length>0?I[I.length-1].id:null,C=N?!1:z,k=!!N||H&&S.length===0&&!C,y=LI({isViewBuilderDraft:!!N,hasSentMessageFromMoi:D,isWorkspacePendingAnalysis:w}),{atBottom:v,scrollToBottom:u,scrollToTop:T}=hw(A,M);y4.useLayoutEffect(()=>{if(k&&y!=="empty")T()},[k,y,T]),y4.useEffect(()=>{if($)kq(L.current)},[$,J]);let t=y4.useCallback(async(h,e)=>{if(N)await N.onSubmit(h);else F(h,e);u()},[N,F,u]),B0=y4.useCallback((h)=>{if(b)return;t(h.prompt,{directives:h.context})},[t,b]);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(_I,{isViewBuilder:!!N}),q&&Z&&U5.jsxs(d1,{children:[U5.jsx(l1,{render:U5.jsx(C0,{variant:"ghost",size:"icon-sm",onClick:q,"aria-label":"Undock agent",children:U5.jsx(nx,{className:"size-5! text-muted-foreground",stroke:1.5})})}),U5.jsx(i1,{children:"Undock agent"})]}),!N&&q&&!Z&&U5.jsx(C0,{variant:"ghost",size:"icon-sm",onClick:q,"aria-label":"Close chat",children:U5.jsx(w5,{stroke:2})})]}),U5.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[U5.jsx("div",{ref:A,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:[k&&U5.jsx(VI,{kind:y,disabled:b,onSelectPrompt:B0,onNavigate:W}),S.map((h)=>h.kind==="notice"?U5.jsx(m30,{notice:h.notice},`notice:${h.notice.id}`):U5.jsx(rx,{turn:h.turn,processing:C&&h.turn.id===j},h.turn.id)),C&&!E&&U5.jsx(lx,{})]})}),!v&&P.length>0&&U5.jsx(C0,{type:"button",variant:"outline",size:"icon",onClick:()=>u("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(CY,{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]",G&&"gap-2 rounded-t-lg rounded-b-2xl p-2",G?.tone==="default"&&"bg-accent",G?.tone==="error"&&"bg-destructive/10"),children:[G?.content,U5.jsx(YI,{composerRef:L,onSend:t,onStop:K,processing:C,sessionId:M,modelSessionId:_,availability:Y,annotation:N?void 0:U,onRemoveDrawing:N?.onRemoveDrawing??U?.onRemove,allowFiles:!N,placeholder:N?"Drop in the details":void 0,draft:N?{id:N.builderId,initialValue:N.initialValue,onChange:N.onChange}:void 0})]})})]})}function m30({notice:$}){let J=bq($);if(!J)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:J})})}var f9=O(c(),1);function ox({loading:$,open:J,onOpenChange:Z,onOpenChangeComplete:H,children:B}){let Q=()=>Z(!1);return f9.jsxs(zY,{open:J,onOpenChange:(z,G)=>{if(!z&&G.reason==="outside-press"){G.cancel();return}Z(z)},onOpenChangeComplete:H,children:[f9.jsx(GY,{render:f9.jsx("div",{className:"fixed right-4 bottom-4 sm:right-6 sm:bottom-6",children:f9.jsx(r1.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:J?"invisible":"to",transition:{type:"spring",duration:0.3,delay:0.2,bounce:0},children:f9.jsx(C0,{variant:"outline",size:"icon-lg",className:"bg-card shadow-md hover:shadow-lg","aria-label":"Agent",children:f9.jsx(S3,{animated:$,stroke:1.75})})})})}),f9.jsx(YY,{positionMethod:"fixed",side:"top",sideOffset:-48,align:"end",alignOffset:-8,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:B(Q)})]})}var r3=O(c(),1);function bU({className:$,title:J,children:Z,onClose:H,ref:B}){return r3.jsxs(r1.div,{ref:B,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:[r3.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[r3.jsx("p",{className:"text-sm font-medium",children:J}),r3.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:H,"aria-label":"Close panel",children:r3.jsx(w5,{stroke:1.75})})]}),r3.jsx("div",{className:"flex-1 pb-(--page-pad)",children:Z})]})}var I5=O(c(),1),p30=Object.entries(s$),u30=Object.entries(OH),c30=Object.entries(tz);function TV({children:$,className:J,gridClassName:Z,label:H}){return I5.jsxs("div",{className:s("flex flex-col gap-2",J),children:[I5.jsx("p",{className:"text-xs font-medium",children:H}),I5.jsx("div",{role:"group","aria-label":H,className:s("grid grid-cols-4 gap-2 @4xl/workspace:grid-cols-2",Z),children:$})]})}function CV({active:$,children:J,className:Z,onSelect:H,style:B}){return I5.jsxs("button",{type:"button","aria-pressed":$,onClick:H,className:s("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","flex items-center gap-2 p-3",Z,!$&&"cursor-pointer pr-9 opacity-70 hover:opacity-100"),style:B,children:[I5.jsx("div",{className:"flex flex-1 flex-col justify-center",children:J}),$&&I5.jsx(rX,{size:20,stroke:1.5,"aria-hidden":"true"})]})}function sx({onClose:$,ref:J}){$G();let{layout:Z,setLayout:H}=Y5(),B=e$(Z.theme);function Q(X){H({theme:{...B,...X}})}return I5.jsx(bU,{ref:J,title:"Customize",onClose:$,className:"@4xl/workspace:max-w-4xl",children:I5.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)] @4xl/workspace:gap-x-2",children:[I5.jsx(TV,{label:"Font",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-1",children:p30.map(([X,z])=>I5.jsx(CV,{active:X===B.font,onSelect:()=>Q({font:X}),style:{fontFamily:z.sans},children:I5.jsx("span",{className:"text-sm font-medium",children:z.label})},X))}),I5.jsx(TV,{label:"Colors",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-4",children:u30.map(([X,z])=>I5.jsx(CV,{active:X===B.color,className:z.primary&&"bg-background text-foreground",onSelect:()=>Q({color:X}),style:X9({...B,color:X}),children:I5.jsxs("div",{className:"flex gap-2",children:[I5.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"}),I5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),I5.jsx(TV,{label:"Radius",className:"@4xl/workspace:col-start-7",gridClassName:"@4xl/workspace:grid-cols-1",children:c30.map(([X,z])=>I5.jsx(CV,{active:X===B.radius,onSelect:()=>Q({radius:X}),style:X9({...B,radius:X}),children:I5.jsxs("div",{className:"flex items-center gap-2",children:[I5.jsx("span",{className:"size-5 shrink-0 rounded-sm bg-card texture-checker-2.5 shadow-xs","aria-hidden":"true"}),I5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))})]})})}var $F=O(g(),1);var RJ=O(g(),1);function tx($){return n1({queryKey:w0.appletThumbnails($),queryFn:async()=>(await N1(`/api/workspaces/${$}/applet-thumbnails`)).thumbnails,...k4})}function ex($){let J=s0();return o1({mutationFn:(Z)=>w4(`/api/workspaces/${$}/applet-thumbnails`,a5("PUT",Z),"Failed to save applet thumbnails"),onSuccess:()=>{J.invalidateQueries({queryKey:w0.appletThumbnails($)}),J.invalidateQueries({queryKey:w0.preview($)})}})}var d30=1000,l30=3,i30=10800000,r30=1000,a30="1000px-3x-webp-q80-v1",n30=5000,o30=1000,s30=1e4;function t30($){return Math.min(l30,d30/Math.max($.offsetWidth,$.offsetHeight))}function e30($){return`${a30}:${$??""}`}function $$0($,J,Z=Date.now()){if(!$||$.revision!==J)return!0;let H=Date.parse($.capturedAt);return!Number.isFinite(H)||Z-H>=i30}function J$0($,J){return $!==void 0&&$.revision===J&&$.captureMs!==void 0&&$.captureMs>=r30}var Z$0=($)=>new Promise((J)=>{setTimeout(()=>J(null),$)});async function H$0($,J){let{createContext:Z,destroyContext:H,domToDataUrl:B}=await import("/chunk-efdyz6xp.js"),Q=async()=>{let X=await Z($,{scale:t30($),type:"image/webp",quality:0.8,backgroundColor:"#ffffff",timeout:o30,...J&&{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 B(X)}finally{H(X)}};return Promise.race([Q(),Z$0(s30)])}async function B$0($,J,Z,H,B=H$0,Q=Date.now()){let X=[];for(let z of Z){if(H())return null;let G=e30(z.revision),Y=J.find((W)=>W.kind===$&&W.id===z.id);if(!$$0(Y,G,Q)){X.push({id:z.id,revision:G});continue}if(J$0(Y,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(),F=await B(z.element,$==="widget").catch(()=>null),K=Math.round(performance.now()-U);if(H())return null;X.push({id:z.id,revision:G,image:F,captureMs:K})}return X}function yU({kind:$,enabled:J,targets:Z}){let H=Z5(),B=tx(H).data,Q=ex(H),X=RJ.useRef(Z);X.current=Z;let z=RJ.useRef(B??[]);z.current=B??[];let G=RJ.useRef(Q.mutate);G.current=Q.mutate;let Y=Z.map((F)=>`${F.id}@${F.revision??""}`).join(`
|
|
79
|
+
`),U=B!==void 0;RJ.useEffect(()=>{if(!J||!U||Y==="")return;let F=!1,K=0,W,q=()=>{K+=1;let N=K;if(W!==void 0)clearTimeout(W);if(document.visibilityState!=="visible")return;W=setTimeout(async()=>{W=void 0;let V=await B$0($,z.current,X.current.map((L)=>({...L,element:document.querySelector(`[data-applet-thumbnail="${CSS.escape(`${$}:${L.id}`)}"]`)})),()=>F||K!==N||document.visibilityState!=="visible");if(!V||F||document.visibilityState!=="visible")return;G.current({kind:$,thumbnails:V})},n30)};return document.addEventListener("visibilitychange",q),q(),()=>{if(F=!0,W!==void 0)clearTimeout(W);document.removeEventListener("visibilitychange",q)}},[J,$,U,Y])}function VB($,J,Z,H){let B=$.reduce((Q,X)=>Math.max(Q,X.y+X.h),0);for(let Q=0;Q<=B+Z;Q++)for(let X=0;X<=H-J;X++)if(!$.some((G)=>!(X+J<=G.x||G.x+G.w<=X||Q+Z<=G.y||G.y+G.h<=Q)))return{x:X,y:Q};return{x:0,y:B}}function AB($,J=[],Z=4){let H=[];for(let B of $){let{x:Q,y:X}=B.x!==void 0&&B.y!==void 0?{x:B.x,y:B.y}:VB([...J,...H],B.w,B.h,Z);H.push({i:B.id,x:Q,y:X,w:B.w,h:B.h})}return H}var wV=O(g(),1),hU=new Map;function Q$0($){let J=window.__moiAppletCss?.get($)??"",Z=hU.get($);if(!Z){let Q=document.createElement("style");Q.dataset.appletStyle=$,document.head.appendChild(Q),Z={el:Q,refs:0},hU.set($,Z)}if(Z.el.textContent!==J)Z.el.textContent=J;Z.refs++;let H=Z,B=!1;return()=>{if(B)return;if(B=!0,H.refs--,H.refs<=0)H.el.remove(),hU.delete($)}}function X$0($){let J=hU.get($);if(!J||J.el===document.head.lastElementChild)return;document.head.appendChild(J.el)}function xU($,J,Z=!1){wV.useInsertionEffect(()=>Q$0($),[$,J]),wV.useInsertionEffect(()=>{if(Z)X$0($)},[$,Z,J])}var Jv=O(c(),1);function $v({segment:$,name:J,version:Z,children:H}){let B=Z5();return xU(GG($,B,J),Z),Jv.jsx("div",{"data-applet":YG($,J),className:"size-full",children:H})}var Zv=O(g(),1);var kJ=O(c(),1);class DB extends Zv.Component{state={error:null};static getDerivedStateFromError($){return{error:$}}componentDidCatch($,J){console.error(`[widget:${this.props.name}]`,$,J.componentStack),V8(this.props.workspaceId,{source:"render",kind:this.props.kind,name:this.props.name,message:$.message||String($),stack:[$.stack,J.componentStack].filter(Boolean).join(`
|
|
80
|
+
`)})}componentDidUpdate($){if($.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}render(){if(this.state.error)return kJ.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[kJ.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[kJ.jsx(zX,{size:16,stroke:1.75}),"Widget crashed"]}),kJ.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var a3=O(c(),1);function Hv({name:$}){let J=Z5(),Z=Qw($);return a3.jsxs(t2,{mode:"wait",initial:!1,children:[Z.status==="ready"&&a3.jsx(r1.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:a3.jsx(DB,{name:$,kind:"widget",workspaceId:J,resetKey:Z.version,children:a3.jsx($v,{segment:"widgets",name:$,version:Z.version,children:a3.jsx(Z.Component,{})})})},Z.version),Z.status==="error"&&a3.jsx(r1.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:Z.error},`err-${Z.version}`)]})}var Bv=O(c(),1);function bJ({className:$,...J}){return Bv.jsx("div",{"data-slot":"skeleton",className:s("animate-pulse rounded-lg bg-muted",$),...J})}var Xv=O(g(),1);var n3=O(c(),1);function vU({editing:$,hidden:J,onRemove:Z,children:H}){let B=Lw();return n3.jsxs(r1.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:[n3.jsx("div",{"data-widget-chrome":!0,"data-vivid":!0,style:X9(B,"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:H}),$&&Z&&n3.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:n3.jsx(C0,{size:"icon-sm",variant:"outline",className:"rounded-full",onClick:Z,children:J?n3.jsx(F4,{stroke:1.75}):n3.jsx(Qv,{stroke:1.75})})})]})}var yJ=O(c(),1),z$0={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},G$0={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"},Y$0={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},U$0={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function zv({items:$,renderItem:J,onClose:Z,onRestore:H,ref:B}){let Q=Xv.useMemo(()=>AB($),[$]);return yJ.jsx(bU,{ref:B,title:"Hidden widgets",onClose:Z,className:"max-h-[60vh]",children:yJ.jsx("div",{className:"grid auto-rows-[160px] grid-cols-4 gap-2",children:yJ.jsx(t2,{children:Q.map((X)=>yJ.jsx(r1.div,{layoutId:X.i,className:s(z$0[X.x],G$0[X.y],Y$0[X.w],U$0[X.h]),transition:{type:"spring",duration:0.35,bounce:0},children:yJ.jsx(vU,{editing:!0,onRemove:()=>H(X.i),hidden:!0,children:J(X.i)})},X.i))})})})}var bB=O(g(),1);function s3($){let{margin:J,containerPadding:Z,containerWidth:H,cols:B}=$;return(H-J[0]*(B-1)-Z[0]*2)/B}function T8($,J,Z){if(!Number.isFinite($))return $;return Math.round(J*$+Math.max(0,$-1)*Z)}function PB($,J,Z,H,B,Q,X){let{margin:z,containerPadding:G,rowHeight:Y}=$,U=s3($),F,K,W,q;if(X)F=Math.round(X.width),K=Math.round(X.height);else F=T8(H,U,z[0]),K=T8(B,Y,z[1]);if(Q)W=Math.round(Q.top),q=Math.round(Q.left);else if(X)W=Math.round(X.top),q=Math.round(X.left);else W=Math.round((Y+z[1])*Z+G[1]),q=Math.round((U+z[0])*J+G[0]);if(!Q&&!X){if(Number.isFinite(H)){let V=Math.round((U+z[0])*(J+H)+G[0])-q-F;if(V!==z[0])F+=V-z[0]}if(Number.isFinite(B)){let V=Math.round((Y+z[1])*(Z+B)+G[1])-W-K;if(V!==z[1])K+=V-z[1]}}return{top:W,left:q,width:F,height:K}}function Yv($,J,Z,H,B){let{margin:Q,containerPadding:X,cols:z,rowHeight:G,maxRows:Y}=$,U=s3($),F=Math.round((Z-X[0])/(U+Q[0])),K=Math.round((J-X[1])/(G+Q[1]));return F=MB(F,0,z-H),K=MB(K,0,Y-B),{x:F,y:K}}function _B($,J,Z){let{margin:H,containerPadding:B,rowHeight:Q}=$,X=s3($),z=Math.round((Z-B[0])/(X+H[0])),G=Math.round((J-B[1])/(Q+H[1]));return{x:z,y:G}}function Uv($,J,Z){let{margin:H,rowHeight:B}=$,Q=s3($),X=Math.max(1,Math.round((J+H[0])/(Q+H[0]))),z=Math.max(1,Math.round((Z+H[1])/(B+H[1])));return{w:X,h:z}}function MB($,J,Z){return Math.max(Math.min($,Z),J)}function fU($,J){if($.i===J.i)return!1;if($.x+$.w<=J.x)return!1;if($.x>=J.x+J.w)return!1;if($.y+$.h<=J.y)return!1;if($.y>=J.y+J.h)return!1;return!0}function t3($,J){for(let Z=0;Z<$.length;Z++){let H=$[Z];if(H!==void 0&&fU(H,J))return H}return}function EV($,J){return $.filter((Z)=>fU(Z,J))}function F$0($,J){if(J==="horizontal")return SV($);if(J==="vertical")return gU($);if(J==="wrap")return gU($);return[...$]}function gU($){return[...$].sort((J,Z)=>{if(J.y!==Z.y)return J.y-Z.y;return J.x-Z.x})}function SV($){return[...$].sort((J,Z)=>{if(J.x!==Z.x)return J.x-Z.x;return J.y-Z.y})}function OB($){let J=0;for(let Z=0;Z<$.length;Z++){let H=$[Z];if(H!==void 0){let B=H.y+H.h;if(B>J)J=B}}return J}function e3($,J){for(let Z=0;Z<$.length;Z++){let H=$[Z];if(H!==void 0&&H.i===J)return H}return}function jB($){return $.filter((J)=>J.static===!0)}function m9($){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 hJ($){let J=Array($.length);for(let Z=0;Z<$.length;Z++){let H=$[Z];if(H!==void 0)J[Z]=m9(H)}return J}function K$0($,J){let Z=Array($.length);for(let H=0;H<$.length;H++){let B=$[H];if(B!==void 0)if(J.i===B.i)Z[H]=J;else Z[H]=B}return Z}function Fv($,J,Z){let H=e3($,J);if(!H)return[[...$],null];return H=Z(m9(H)),[K$0($,H),H]}function IV($,J){let Z=jB($);for(let H=0;H<$.length;H++){let B=$[H];if(B===void 0)continue;if(B.x+B.w>J.cols)B.x=J.cols-B.w;if(B.x<0)B.x=0,B.w=J.cols;if(!B.static)Z.push(B);else while(t3(Z,B))B.y++}return $}function o3($,J,Z,H,B,Q,X,z,G){if(J.static&&J.isDraggable!==!0)return[...$];if(J.y===H&&J.x===Z)return[...$];let{x:Y,y:U}=J;if(typeof Z==="number")J.x=Z;if(typeof H==="number")J.y=H;J.moved=!0;let F=F$0($,X);if(X==="vertical"&&typeof H==="number"?U>=H:X==="horizontal"&&typeof Z==="number"?Y>=Z:!1)F=F.reverse();let W=EV(F,J),q=W.length>0;if(q&&G)return hJ($);if(q&&Q)return J.x=Y,J.y=U,J.moved=!1,$;let N=[...$];for(let V=0;V<W.length;V++){let L=W[V];if(L===void 0)continue;if(L.moved)continue;if(L.static)N=Gv(N,L,J,B,X);else N=Gv(N,J,L,B,X)}return N}function Gv($,J,Z,H,B,Q){let X=B==="horizontal",z=B==="vertical",G=J.static;if(H){H=!1;let F={x:X?Math.max(J.x-Z.w,0):Z.x,y:z?Math.max(J.y-Z.h,0):Z.y,w:Z.w,h:Z.h,i:"-1"},K=t3($,F),W=K!==void 0&&K.y+K.h>J.y,q=K!==void 0&&J.x+J.w>K.x;if(!K)return o3($,Z,X?F.x:void 0,z?F.y:void 0,H,G,B);if(W&&z)return o3($,Z,void 0,Z.y+1,H,G,B);if(W&&B===null)return J.y=Z.y,Z.y=Z.y+Z.h,[...$];if(q&&X)return o3($,J,Z.x,void 0,H,G,B)}let Y=X?Z.x+1:void 0,U=z?Z.y+1:void 0;if(Y===void 0&&U===void 0)return[...$];return o3($,Z,Y,U,H,G,B)}function xJ($,J,Z){return Math.max(J,Math.min(Z,$))}var W$0={name:"gridBounds",constrainPosition($,J,Z,{cols:H,maxRows:B}){return{x:xJ(J,0,Math.max(0,H-$.w)),y:xJ(Z,0,Math.max(0,B-$.h))}},constrainSize($,J,Z,H,{cols:B,maxRows:Q}){let X=H==="w"||H==="nw"||H==="sw"?$.x+$.w:B-$.x,z=H==="n"||H==="nw"||H==="ne"?$.y+$.h:Q-$.y;return{w:xJ(J,1,Math.max(1,X)),h:xJ(Z,1,Math.max(1,z))}}},q$0={name:"minMaxSize",constrainSize($,J,Z){return{w:xJ(J,$.minW??1,$.maxW??1/0),h:xJ(Z,$.minH??1,$.maxH??1/0)}}};var RV=[W$0,q$0];function TB($,J,Z,H,B){let Q={x:Z,y:H};for(let X of $)if(X.constrainPosition)Q=X.constrainPosition(J,Q.x,Q.y,B);if(J.constraints){for(let X of J.constraints)if(X.constrainPosition)Q=X.constrainPosition(J,Q.x,Q.y,B)}return Q}function Kv($,J,Z,H,B,Q){let X={w:Z,h:H};for(let z of $)if(z.constrainSize)X=z.constrainSize(J,X.w,X.h,B,Q);if(J.constraints){for(let z of J.constraints)if(z.constrainSize)X=z.constrainSize(J,X.w,X.h,B,Q)}return X}function pU({top:$,left:J,width:Z,height:H}){let B=`translate(${J}px,${$}px)`;return{transform:B,WebkitTransform:B,MozTransform:B,msTransform:B,OTransform:B,width:`${Z}px`,height:`${H}px`,position:"absolute"}}function kV({top:$,left:J,width:Z,height:H}){return{top:`${$}px`,left:`${J}px`,width:`${Z}px`,height:`${H}px`,position:"absolute"}}function bV($){return $*100+"%"}function N$0($,J,Z,H){return $+Z>H?J:Z}function Wv($,J,Z){return $<0?J:Z}function L$0($){return Math.max(0,$)}function mU($){return Math.max(0,$)}var yV=($,J,Z)=>{let{left:H,height:B,width:Q}=J,X=$.top-(B-$.height);return{left:H,width:Q,height:Wv(X,$.height,B),top:mU(X)}},hV=($,J,Z)=>{let{top:H,left:B,height:Q,width:X}=J;return{top:H,height:Q,width:N$0($.left,$.width,X,Z),left:L$0(B)}},xV=($,J,Z)=>{let{top:H,height:B,width:Q}=J,X=$.left+$.width-Q;if(X<0)return{height:B,width:$.left+$.width,top:mU(H),left:0};return{height:B,width:Q,top:mU(H),left:X}},vV=($,J,Z)=>{let{top:H,left:B,height:Q,width:X}=J;return{width:X,left:B,height:Wv(H,$.height,Q),top:mU(H)}},V$0=($,J,Z)=>yV($,hV($,J,Z)),A$0=($,J,Z)=>yV($,xV($,J)),D$0=($,J,Z)=>vV($,hV($,J,Z)),M$0=($,J,Z)=>vV($,xV($,J)),P$0={n:yV,ne:V$0,e:hV,se:D$0,s:vV,sw:M$0,w:xV,nw:A$0};function qv($,J,Z,H){let B=P$0[$];if(!B)return Z;return B(J,{...J,...Z},H)}var _$0={type:"transform",scale:1,calcStyle($){return pU($)}};var Nv=_$0,Lv={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Vv={enabled:!0,bounded:!1,threshold:3},Av={enabled:!0,handles:["se"]},Dv={enabled:!1,defaultItem:{w:1,h:1}};function gV($,J,Z,H,B){let Q=H==="x"?"w":"h";J[H]+=1;let X=$.findIndex((G)=>G.i===J.i),z=B??jB($).length>0;for(let G=X+1;G<$.length;G++){let Y=$[G];if(Y===void 0)continue;if(Y.static)continue;if(!z&&Y.y>J.y+J.h)break;if(fU(J,Y))gV($,Y,Z+J[Q],H,z)}J[H]=Z}function O$0($,J,Z,H){J.x=Math.max(J.x,0),J.y=Math.max(J.y,0),J.y=Math.min(H,J.y);while(J.y>0&&!t3($,J))J.y--;let B;while((B=t3($,J))!==void 0)gV(Z,J,B.y+B.h,"y");return J.y=Math.max(J.y,0),J}function j$0($,J,Z,H){J.x=Math.max(J.x,0),J.y=Math.max(J.y,0);while(J.x>0&&!t3($,J))J.x--;let B;while((B=t3($,J))!==void 0)if(gV(H,J,B.x+B.w,"x"),J.x+J.w>Z){J.x=Z-J.w,J.y++;while(J.x>0&&!t3($,J))J.x--}return J.x=Math.max(J.x,0),J}var CB={type:"vertical",allowOverlap:!1,compact($,J){let Z=jB($),H=OB(Z),B=gU($),Q=Array($.length);for(let X=0;X<B.length;X++){let z=B[X];if(z===void 0)continue;let G=m9(z);if(!G.static)G=O$0(Z,G,B,H),H=Math.max(H,G.y+G.h),Z.push(G);let Y=$.indexOf(z);Q[Y]=G,G.moved=!1}return Q}},fV={type:"horizontal",allowOverlap:!1,compact($,J){let Z=jB($),H=SV($),B=Array($.length);for(let Q=0;Q<H.length;Q++){let X=H[Q];if(X===void 0)continue;let z=m9(X);if(!z.static)z=j$0(Z,z,J,H),Z.push(z);let G=$.indexOf(X);B[G]=z,z.moved=!1}return B}},mV={type:null,allowOverlap:!1,compact($,J){return hJ($)}},T$0={...CB,allowOverlap:!0,compact($,J){return hJ($)}},C$0={...fV,allowOverlap:!0,compact($,J){return hJ($)}},w$0={...mV,allowOverlap:!0};function pV($,J=!1,Z=!1){let H;if(J)if($==="vertical")H=T$0;else if($==="horizontal")H=C$0;else H=w$0;else if($==="vertical")H=CB;else if($==="horizontal")H=fV;else H=mV;if(Z)return{...H,preventCollision:Z};return H}var C8=O(g(),1);function uV($={}){let{measureBeforeMount:J=!1,initialWidth:Z=1280}=$,[H,B]=C8.useState(Z),[Q,X]=C8.useState(!J),z=C8.useRef(null),G=C8.useRef(null),Y=C8.useCallback(()=>{let U=z.current;if(U){let F=U.offsetWidth;if(B(F),!Q)X(!0)}},[Q]);return C8.useEffect(()=>{let U=z.current;if(!U)return;if(Y(),typeof ResizeObserver<"u"){let F=null;return G.current=new ResizeObserver((K)=>{let W=K[0];if(W){let q=W.contentRect.width;if(F!==null)cancelAnimationFrame(F);F=requestAnimationFrame(()=>{B(q),F=null})}}),G.current.observe(U),()=>{if(F!==null)cancelAnimationFrame(F);if(G.current)G.current.disconnect(),G.current=null}}return()=>{if(G.current)G.current.disconnect(),G.current=null}},[Y]),{width:H,mounted:Q,containerRef:z,measureWidth:Y}}var b0=O(g(),1),Vg=O(oU(),1),Ag=O(qg(),1);var u9=O(c(),1),T6=O(Pv(),1);function GA($){let{children:J,cols:Z,containerWidth:H,margin:B,containerPadding:Q,rowHeight:X,maxRows:z,isDraggable:G,isResizable:Y,isBounded:U,static:F,useCSSTransforms:K=!0,usePercentages:W=!1,transformScale:q=1,positionStrategy:N,dragThreshold:V=0,droppingPosition:L,className:A="",style:M,handle:_="",cancel:P="",x:D,y:w,w:R,h:b,minW:E=1,maxW:x=1/0,minH:I=1,maxH:S=1/0,i:j,resizeHandles:C,resizeHandle:k,constraints:y=RV,layoutItem:v,layout:u=[],onDragStart:T,onDrag:t,onDragStop:B0,onResizeStart:h,onResize:e,onResizeStop:A0}=$,[l,z0]=b0.useState(!1),[W0,Q0]=b0.useState(!1),G0=b0.useRef(null),L0=b0.useRef({left:0,top:0}),i=b0.useRef({top:0,left:0,width:0,height:0}),$0=b0.useRef(void 0),J0=b0.useRef(u);J0.current=u;let H0=b0.useRef(null),n=b0.useRef(null),p=b0.useRef(!1),d=b0.useRef({x:0,y:0}),m=b0.useRef(!1),a=b0.useMemo(()=>({cols:Z,containerPadding:Q,containerWidth:H,margin:B,maxRows:z,rowHeight:X}),[Z,Q,H,B,z,X]),o=b0.useMemo(()=>({cols:Z,maxRows:z,containerWidth:H,containerHeight:0,rowHeight:X,margin:B,layout:[]}),[Z,z,H,X,B]),N0=b0.useCallback(()=>({...o,layout:J0.current}),[o]),O0=b0.useMemo(()=>v??{i:j,x:D,y:w,w:R,h:b,minW:E,maxW:x,minH:I,maxH:S},[v,j,D,w,R,b,E,x,I,S]),g0=b0.useCallback((I0)=>{if(N?.calcStyle)return N.calcStyle(I0);if(K)return pU(I0);let k0=kV(I0);if(W)return{...k0,left:bV(I0.left/H),width:bV(I0.width/H)};return k0},[N,K,W,H]),p0=b0.useCallback((I0,{node:k0})=>{if(!T)return;let{offsetParent:R0}=k0;if(!R0)return;let n0=R0.getBoundingClientRect(),F1=k0.getBoundingClientRect(),C1=F1.left/q,e1=n0.left/q,$5=F1.top/q,A1=n0.top/q,V5;if(N?.calcDragPosition){let Z1=I0;V5=N.calcDragPosition(Z1.clientX,Z1.clientY,Z1.clientX-F1.left,Z1.clientY-F1.top)}else V5={left:C1-e1+R0.scrollLeft,top:$5-A1+R0.scrollTop};if(L0.current=V5,V>0){let Z1=I0;d.current={x:Z1.clientX,y:Z1.clientY},p.current=!0,m.current=!1,z0(!0);return}z0(!0);let m5=_B(a,V5.top,V5.left),{x:l5,y:x0}=TB(y,O0,m5.x,m5.y,N0());T(j,l5,x0,{e:I0,node:k0,newPosition:V5})},[T,q,a,N,V,y,O0,N0,j]),f=b0.useCallback((I0,{node:k0,deltaX:R0,deltaY:n0})=>{if(!t||!l)return;let F1=I0;if(p.current&&!m.current){let l5=F1.clientX-d.current.x,x0=F1.clientY-d.current.y;if(Math.hypot(l5,x0)<V)return;if(m.current=!0,p.current=!1,T){let u0=_B(a,L0.current.top,L0.current.left),{x:q1,y:b1}=TB(y,O0,u0.x,u0.y,N0());T(j,q1,b1,{e:I0,node:k0,newPosition:L0.current})}}let C1=L0.current.top+n0,e1=L0.current.left+R0;if(U){let{offsetParent:l5}=k0;if(l5){let x0=l5.clientHeight-T8(b,X,B[1]);C1=MB(C1,0,x0);let Z1=s3(a),u0=H-T8(R,Z1,B[0]);e1=MB(e1,0,u0)}}let $5={top:C1,left:e1};L0.current=$5;let A1=_B(a,C1,e1),{x:V5,y:m5}=TB(y,O0,A1.x,A1.y,N0());t(j,V5,m5,{e:I0,node:k0,newPosition:$5})},[t,T,l,V,U,b,X,B,a,H,R,j,y,O0,N0]),r=b0.useCallback((I0,{node:k0})=>{if(!B0||!l)return;let R0=p.current;if(p.current=!1,m.current=!1,d.current={x:0,y:0},R0){z0(!1),L0.current={left:0,top:0};return}let{left:n0,top:F1}=L0.current,C1={top:F1,left:n0};z0(!1),L0.current={left:0,top:0};let e1=_B(a,F1,n0),{x:$5,y:A1}=TB(y,O0,e1.x,e1.y,N0());B0(j,$5,A1,{e:I0,node:k0,newPosition:C1})},[B0,l,a,y,O0,N0,j]);H0.current=p0,n.current=f;let X0=b0.useCallback((I0,{node:k0,size:R0,handle:n0},F1,C1)=>{let e1=C1==="onResizeStart"?h:C1==="onResize"?e:A0;if(!e1)return;let $5;if(k0)$5=qv(n0,F1,R0,H);else $5={...R0,top:F1.top,left:F1.left};i.current=$5;let A1=Uv(a,$5.width,$5.height),{w:V5,h:m5}=Kv(y,O0,A1.w,A1.h,n0,N0());e1(j,V5,m5,{e:I0.nativeEvent,node:k0,size:$5,handle:n0})},[h,e,A0,H,a,j,y,O0,N0]),V0=b0.useCallback((I0,k0)=>{Q0(!0);let R0=PB(a,D,w,R,b),n0={...k0,handle:k0.handle};X0(I0,n0,R0,"onResizeStart")},[X0,a,D,w,R,b]),j0=b0.useCallback((I0,k0)=>{let R0=PB(a,D,w,R,b),n0={...k0,handle:k0.handle};X0(I0,n0,R0,"onResize")},[X0,a,D,w,R,b]),v0=b0.useCallback((I0,k0)=>{Q0(!1),i.current={top:0,left:0,width:0,height:0};let R0=PB(a,D,w,R,b),n0={...k0,handle:k0.handle};X0(I0,n0,R0,"onResizeStop")},[X0,a,D,w,R,b]);b0.useEffect(()=>{if(!L)return;let I0=G0.current;if(!I0)return;let k0=$0.current||{left:0,top:0},R0=l&&(L.left!==k0.left||L.top!==k0.top);if(!l){let n0={node:I0,deltaX:L.left,deltaY:L.top,lastX:0,lastY:0,x:L.left,y:L.top};H0.current?.(L.e,n0)}else if(R0){let n0=L.left-L0.current.left,F1=L.top-L0.current.top,C1={node:I0,deltaX:n0,deltaY:F1,lastX:L0.current.left,lastY:L0.current.top,x:L.left,y:L.top};n.current?.(L.e,C1)}$0.current=L},[L,l,j]);let Q1=PB(a,D,w,R,b,l?L0.current:null,W0?i.current:null),U1=b0.default.Children.only(J),c0=s3(a),y0=[T8(E,c0,B[0]),T8(I,X,B[1])],d0=[T8(x,c0,B[0]),T8(S,X,B[1])],Z0=U1.props,T0=Z0.className,H1=Z0.style,G1=b0.default.cloneElement(U1,{ref:G0,className:YA("react-grid-item",T0,A,{static:F,resizing:W0,"react-draggable":G,"react-draggable-dragging":l,dropping:Boolean(L),cssTransforms:K}),style:{...M,...H1,...g0(Q1)}}),a1=k;return G1=u9.jsx(Ag.Resizable,{draggableOpts:{disabled:!Y},className:Y?void 0:"react-resizable-hide",width:Q1.width,height:Q1.height,minConstraints:y0,maxConstraints:d0,onResizeStart:V0,onResize:j0,onResizeStop:v0,transformScale:q,resizeHandles:C,handle:a1,children:G1}),G1=u9.jsx(Vg.DraggableCore,{disabled:!G,onStart:p0,onDrag:f,onStop:r,handle:_,cancel:".react-resizable-handle"+(P?","+P:""),scale:q,nodeRef:G0,children:G1}),G1}var p9=()=>{},Ng="react-grid-layout",Dg=!1;try{Dg=/firefox/i.test(navigator.userAgent)}catch{}function m70($,J){let Z=b0.default.Children.toArray($),H=b0.default.Children.toArray(J);if(Z.length!==H.length)return!1;for(let B=0;B<Z.length;B++){let Q=Z[B],X=H[B];if(Q?.key!==X?.key)return!1}return!0}function Lg($,J,Z,H){let B=[],Q=new Set;b0.default.Children.forEach(J,(z)=>{if(!b0.default.isValidElement(z)||z.key===null)return;let G=String(z.key);Q.add(G);let Y=$.find((U)=>U.i===G);if(Y)B.push(m9(Y));else{let F=z.props["data-grid"];if(F)B.push({i:G,x:F.x??0,y:F.y??0,w:F.w??1,h:F.h??1,minW:F.minW,maxW:F.maxW,minH:F.minH,maxH:F.maxH,static:F.static,isDraggable:F.isDraggable,isResizable:F.isResizable,resizeHandles:F.resizeHandles,isBounded:F.isBounded});else B.push({i:G,x:0,y:OB(B),w:1,h:1})}});let X=IV(B,{cols:Z});return H.compact(X,Z)}function kB($){let{children:J,width:Z,gridConfig:H,dragConfig:B,resizeConfig:Q,dropConfig:X,positionStrategy:z=Nv,compactor:G,constraints:Y=RV,layout:U=[],droppingItem:F,autoSize:K=!0,className:W="",style:q={},innerRef:N,onLayoutChange:V=p9,onDragStart:L=p9,onDrag:A=p9,onDragStop:M=p9,onResizeStart:_=p9,onResize:P=p9,onResizeStop:D=p9,onDrop:w=p9,onDropDragOver:R=p9}=$,b=b0.useMemo(()=>({...Lv,...H}),[H]),E=b0.useMemo(()=>({...Vv,...B}),[B]),x=b0.useMemo(()=>({...Av,...Q}),[Q]),I=b0.useMemo(()=>({...Dv,...X}),[X]),{cols:S,rowHeight:j,maxRows:C,margin:k,containerPadding:y}=b,{enabled:v,bounded:u,handle:T,cancel:t,threshold:B0}=E,{enabled:h,handles:e,handleComponent:A0}=x,{enabled:l,defaultItem:z0,onDragOver:W0}=I,Q0=G??pV("vertical"),G0=Q0.type,L0=Q0.allowOverlap,i=Q0.preventCollision??!1,$0=b0.useMemo(()=>F??{i:"__dropping-elem__",...z0},[F,z0]),J0=z.type==="transform",H0=z.scale,n=y??k,[p,d]=b0.useState(!1),[m,a]=b0.useState(()=>Lg(U,J,S,Q0)),[o,N0]=b0.useState(null),[O0,g0]=b0.useState(!1),[p0,f]=b0.useState(null),[r,X0]=b0.useState(),V0=b0.useRef(null),j0=b0.useRef(null),v0=b0.useRef(null),Q1=b0.useRef(0),U1=b0.useRef(m),c0=b0.useRef(U),y0=b0.useRef(J),d0=b0.useRef(G0),Z0=b0.useRef(m);Z0.current=m,b0.useEffect(()=>{if(d(!0),!T6.deepEqual(m,U))V(m)},[]),b0.useEffect(()=>{if(o)return;if(p0)return;let x0=!T6.deepEqual(U,c0.current),Z1=!m70(J,y0.current),u0=G0!==d0.current;if(x0||Z1||u0){let b1=Lg(x0?U:m,J,S,Q0);if(!T6.deepEqual(b1,m))a(b1)}c0.current=U,y0.current=J,d0.current=G0},[U,J,S,G0,Q0,o,p0,m]),b0.useEffect(()=>{if(!o&&!T6.deepEqual(m,U1.current)){U1.current=m;let x0=m.filter((Z1)=>Z1.i!==$0.i);V(x0)}},[m,o,V,$0.i]);let T0=b0.useMemo(()=>{if(!K)return;let x0=OB(m),Z1=n[1];return x0*j+(x0-1)*k[1]+Z1*2+"px"},[K,m,j,k,n]),H1=b0.useCallback((x0,Z1,u0,q1)=>{let b1=Z0.current,g1=e3(b1,x0);if(!g1)return;let A5={w:g1.w,h:g1.h,x:g1.x,y:g1.y,i:x0};V0.current=m9(g1),v0.current=b1,N0(A5),L(b1,g1,g1,null,q1.e,q1.node)},[L]),G1=b0.useCallback((x0,Z1,u0,q1)=>{let b1=Z0.current,g1=V0.current,A5=e3(b1,x0);if(!A5)return;let Y2={w:A5.w,h:A5.h,x:A5.x,y:A5.y,i:x0},D5=o3(b1,A5,Z1,u0,!0,i,G0,S,L0);A(D5,g1,A5,Y2,q1.e,q1.node),a(Q0.compact(D5,S)),N0(Y2)},[i,G0,S,L0,Q0,A]),a1=b0.useCallback((x0,Z1,u0,q1)=>{if(!o)return;let b1=Z0.current,g1=V0.current,A5=e3(b1,x0);if(!A5)return;let Y2=o3(b1,A5,Z1,u0,!0,i,G0,S,L0),D5=Q0.compact(Y2,S);M(D5,g1,A5,null,q1.e,q1.node);let C2=v0.current;if(V0.current=null,v0.current=null,N0(null),a(D5),C2&&!T6.deepEqual(C2,D5))V(D5)},[o,i,G0,S,L0,Q0,M,V]),I0=b0.useCallback((x0,Z1,u0,q1)=>{let b1=Z0.current,g1=e3(b1,x0);if(!g1)return;j0.current=m9(g1),v0.current=b1,g0(!0),_(b1,g1,g1,null,q1.e,q1.node)},[_]),k0=b0.useCallback((x0,Z1,u0,q1)=>{let b1=Z0.current,g1=j0.current,{handle:A5}=q1,Y2=!1,D5,C2,[lB,O9]=Fv(b1,x0,(j5)=>{if(D5=j5.x,C2=j5.y,["sw","w","nw","n","ne"].includes(A5)){if(["sw","nw","w"].includes(A5))D5=j5.x+(j5.w-Z1),Z1=j5.x!==D5&&D5<0?j5.w:Z1,D5=D5<0?0:D5;if(["ne","n","nw"].includes(A5))C2=j5.y+(j5.h-u0),u0=j5.y!==C2&&C2<0?j5.h:u0,C2=C2<0?0:C2;Y2=!0}if(i&&!L0){if(EV(b1,{...j5,w:Z1,h:u0,x:D5??j5.x,y:C2??j5.y}).filter((rB)=>rB.i!==j5.i).length>0)C2=j5.y,u0=j5.h,D5=j5.x,Z1=j5.w,Y2=!1}return j5.w=Z1,j5.h=u0,j5});if(!O9)return;let $Z=lB;if(Y2&&D5!==void 0&&C2!==void 0)$Z=o3(lB,O9,D5,C2,!0,i,G0,S,L0);let iB={w:O9.w,h:O9.h,x:O9.x,y:O9.y,i:x0,static:!0};P($Z,g1,O9,iB,q1.e,q1.node),a(Q0.compact($Z,S)),N0(iB)},[i,G0,S,L0,Q0,P]),R0=b0.useCallback((x0,Z1,u0,q1)=>{let b1=Z0.current,g1=j0.current,A5=e3(b1,x0),Y2=Q0.compact(b1,S);D(Y2,g1,A5??null,null,q1.e,q1.node);let D5=v0.current;if(j0.current=null,v0.current=null,N0(null),g0(!1),a(Y2),D5&&!T6.deepEqual(D5,Y2))V(Y2)},[S,Q0,D,V]),n0=b0.useCallback(()=>{let x0=Z0.current;if(!x0.some((q1)=>q1.i===$0.i)){f(null),N0(null),X0(void 0);return}let u0=Q0.compact(x0.filter((q1)=>q1.i!==$0.i),S);a(u0),f(null),N0(null),X0(void 0)},[$0.i,S,Q0]),F1=b0.useCallback((x0)=>{if(x0.preventDefault(),x0.stopPropagation(),Dg&&!x0.nativeEvent.target?.classList.contains(Ng))return!1;let Z1=W0?W0(x0.nativeEvent):R(x0);if(Z1===!1){if(p0)n0();return!1}let{dragOffsetX:u0=0,dragOffsetY:q1=0,...b1}=Z1??{},g1={...$0,...b1},A5=x0.currentTarget.getBoundingClientRect(),Y2={cols:S,margin:k,maxRows:C,rowHeight:j,containerWidth:Z,containerPadding:n},D5=s3(Y2),C2=T8(g1.w,D5,k[0]),lB=T8(g1.h,j,k[1]),O9=C2/2,$Z=lB/2,iB=x0.clientX-A5.left+u0-O9,j5=x0.clientY-A5.top+q1-$Z,wF=Math.max(0,iB),rB=Math.max(0,j5),aB={left:wF/H0,top:rB/H0,e:x0.nativeEvent};if(!p0){let EF=Yv(Y2,rB,wF,g1.w,g1.h);f(u9.jsx("div",{},g1.i)),X0(aB);let bu=Z0.current.filter((yu)=>yu.i!==g1.i);a([...bu,{...g1,x:EF.x,y:EF.y,static:!1,isDraggable:!0}])}else if(r){if(r.left!==aB.left||r.top!==aB.top)X0(aB)}},[p0,r,$0,W0,R,n0,H0,S,k,C,j,Z,n]),C1=b0.useCallback((x0)=>{if(x0.preventDefault(),x0.stopPropagation(),Q1.current--,Q1.current<0)Q1.current=0;if(Q1.current===0)n0()},[n0]),e1=b0.useCallback((x0)=>{x0.preventDefault(),x0.stopPropagation(),Q1.current++},[]),$5=b0.useCallback((x0)=>{x0.preventDefault(),x0.stopPropagation();let Z1=Z0.current,u0=Z1.find((q1)=>q1.i===$0.i);Q1.current=0,n0(),w(Z1,u0,x0.nativeEvent)},[$0.i,n0,w]),A1=b0.useCallback((x0,Z1)=>{if(!x0||!x0.key)return null;let u0=e3(m,String(x0.key));if(!u0)return null;let q1=typeof u0.isDraggable==="boolean"?u0.isDraggable:!u0.static&&v,b1=typeof u0.isResizable==="boolean"?u0.isResizable:!u0.static&&h,g1=u0.resizeHandles||[...e],A5=q1&&u&&u0.isBounded!==!1,Y2=A0;return u9.jsx(GA,{containerWidth:Z,cols:S,margin:k,containerPadding:n,maxRows:C,rowHeight:j,cancel:t,handle:T,onDragStart:H1,onDrag:G1,onDragStop:a1,onResizeStart:I0,onResize:k0,onResizeStop:R0,isDraggable:q1,isResizable:b1,isBounded:A5,useCSSTransforms:J0&&p,usePercentages:!p,transformScale:H0,positionStrategy:z,dragThreshold:B0,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:Z1?r:void 0,resizeHandles:g1,resizeHandle:Y2,constraints:Y,layoutItem:u0,layout:m,children:x0},u0.i)},[m,Z,S,k,n,C,j,t,T,H1,G1,a1,I0,k0,R0,v,h,u,J0,p,H0,z,B0,r,e,A0,Y]),V5=()=>{if(!o)return null;return u9.jsx(GA,{w:o.w,h:o.h,x:o.x,y:o.y,i:o.i,className:`react-grid-placeholder ${O0?"placeholder-resizing":""}`,containerWidth:Z,cols:S,margin:k,containerPadding:n,maxRows:C,rowHeight:j,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:J0,transformScale:H0,constraints:Y,layout:m,children:u9.jsx("div",{})})},m5=YA(Ng,W),l5={height:T0,...q};return u9.jsxs("div",{ref:N,className:m5,style:l5,onDrop:l?$5:void 0,onDragLeave:l?C1:void 0,onDragEnter:l?e1:void 0,onDragOver:l?F1:void 0,children:[b0.default.Children.map(J,(x0)=>{if(!b0.default.isValidElement(x0))return null;return A1(x0)}),l&&p0&&A1(p0,!0),V5()]})}var C6=O(c(),1);function UA({items:$,editing:J,renderItem:Z,onLayoutChange:H}){let[B,Q]=bB.useState(()=>AB($,[])),[X,z]=bB.useState($),{width:G,containerRef:Y,mounted:U}=uV({measureBeforeMount:!0});if(X!==$)z($),Q((K)=>{let W=new Map(K.map((L)=>[L.i,L])),q=$.filter((L)=>W.has(L.id)).map((L)=>({...W.get(L.id),w:L.w,h:L.h})),N=new Set(q.map((L)=>L.i)),V=AB($.filter((L)=>!N.has(L.id)),q);return[...q,...V]});let F=bB.useCallback((K)=>{Q(K),H?.(K.map((W)=>({id:W.i,w:W.w,h:W.h,x:W.x,y:W.y})))},[H]);return C6.jsx("div",{ref:Y,className:"mx-auto w-full max-w-[var(--column-w)]",children:U&&C6.jsx(kB,{width:G,layout:B,gridConfig:{cols:4,rowHeight:160,margin:[8,8],containerPadding:[0,0]},dragConfig:{enabled:!!J},resizeConfig:{enabled:!1},compactor:CB,onLayoutChange:F,children:B.map((K)=>C6.jsx("div",{children:C6.jsx(r1.div,{layoutId:K.i,"data-applet-thumbnail":`widget:${K.i}`,className:"size-full",transition:{type:"spring",duration:0.35,bounce:0},children:Z(K.i)})},K.i))})})}function Mg({items:$,editing:J,renderItem:Z,onLayoutChange:H,onRemove:B}){return C6.jsx(UA,{items:$,editing:J,onLayoutChange:H,renderItem:(Q)=>C6.jsx(vU,{editing:J,onRemove:B?()=>B(Q):void 0,children:Z(Q)})})}var I1=O(c(),1);function Pg($){return I1.jsx(Hv,{name:$})}var u70=Array.from({length:10},($,J)=>({id:`empty-widget-${J}`,w:2,h:1}));function c70(){return I1.jsx(bJ,{className:"size-full animate-none rounded-2xl texture-checker [corner-shape:superellipse(1.2)]"})}function d70({onCreateWidget:$}){return I1.jsxs("div",{className:"relative min-h-0 flex-1 pt-7",children:[I1.jsx("div",{"aria-hidden":"true",children:I1.jsx(UA,{items:u70,renderItem:c70})}),I1.jsx("div",{className:"absolute inset-0 flex items-center justify-center p-6",children:I1.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:[I1.jsxs("div",{className:"flex flex-col gap-1.5",children:[I1.jsx("h2",{className:"font-medium",children:"A little empty here"}),I1.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"})]}),I1.jsxs(C0,{type:"button",variant:"secondary",onClick:$,children:[I1.jsx(F4,{"data-icon":"inline-start",stroke:1.5}),"Create widget"]})]})})]})}function l70({editing:$,onCreateWidget:J,onEditingChange:Z}){return I1.jsxs("div",{className:"mx-auto mb-4 flex w-full max-w-(--column-w) shrink-0 items-center justify-end gap-2",children:[$&&I1.jsxs(C0,{type:"button",variant:"ghost",size:"sm",className:"mr-auto",onClick:J,children:[I1.jsx(F4,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),I1.jsx(t2,{mode:"popLayout",initial:!1,children:I1.jsx(r1.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:I1.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:()=>Z(!$),children:$?"Done":"Edit widgets"})},$?"done":"edit")})]})}function i70(){return I1.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3",children:I1.jsx("p",{className:"text-sm text-muted-foreground",children:"No widgets added yet"})})}function r70(){let[$,J]=$F.useState(0);return[$F.useCallback((H)=>{if(!H)return;let B=new ResizeObserver(([Q])=>{let X=Q.borderBoxSize?.[0];J(X?X.blockSize:Q.contentRect.height)});return B.observe(H),()=>B.disconnect()},[]),$]}function Og({onCreateWidget:$,editing:J,onEditingChange:Z,widgets:H}){let{layout:B,setLayout:Q}=Y5(),X=H.length>0,z=new Set(B.widgetGrid.map((N)=>N.i)),G=B.widgetGrid.filter((N)=>H.some((V)=>V.id===N.i)).map((N)=>{let V=H.find((L)=>L.id===N.i);return{id:N.i,w:V.config.colSpan,h:V.config.rowSpan,x:N.x,y:N.y}}),Y=H.filter((N)=>!z.has(N.id)).map((N)=>({id:N.id,w:N.config.colSpan,h:N.config.rowSpan})),[U,F]=r70(),K=J&&Y.length>0;yU({kind:"widget",enabled:!J,targets:G.map((N)=>({id:N.id,revision:H.find((V)=>V.id===N.id)?.revision}))});function W(N){Q({widgetGrid:B.widgetGrid.filter((V)=>V.i!==N)})}function q(N){let V=H.find((M)=>M.id===N);if(!V)return;let L=B.widgetGrid.map((M)=>{let _=H.find((P)=>P.id===M.i);return{...M,w:_?.config.colSpan??1,h:_?.config.rowSpan??1}}),A=VB(L,V.config.colSpan,V.config.rowSpan,4);Q({widgetGrid:[...B.widgetGrid,{i:N,x:A.x,y:A.y}]})}return I1.jsx("div",{className:"group/widgets relative min-h-0 flex-1",children:I1.jsxs(_g,{children:[I1.jsx("div",{className:s("relative flex h-full flex-col p-4",X?"overflow-y-auto":"overflow-hidden"),children:X?I1.jsxs(I1.Fragment,{children:[I1.jsx(l70,{editing:J,onCreateWidget:$,onEditingChange:Z}),G.length===0?I1.jsx(r1.div,{className:"mx-auto flex min-h-0 w-full max-w-[var(--column-w)] flex-1 flex-col",animate:{paddingBottom:K?F:0},transition:{type:"spring",duration:0.3,bounce:0},children:I1.jsx(i70,{})}):I1.jsx(r1.div,{animate:{marginBottom:K?F:0},transition:{type:"spring",duration:0.3,bounce:0},children:I1.jsx(Mg,{items:G,editing:J,renderItem:Pg,onRemove:W,onLayoutChange:(N)=>Q({widgetGrid:N.map((V)=>({i:V.id,x:V.x??0,y:V.y??0}))})})})]}):I1.jsx(d70,{onCreateWidget:$})}),I1.jsx(t2,{children:X&&J&&Y.length>0&&I1.jsx(zv,{ref:U,items:Y,renderItem:Pg,onClose:()=>Z(!1),onRestore:q})})]})})}var Tg=O(c(),1);function jg({children:$}){return Tg.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 TA=O(g(),1);var A2=O(c(),1);function a70($){if($==="needs-auth")return"Needs auth";return $[0].toUpperCase()+$.slice(1)}function n70({name:$,status:J}){let Z=_U($),H="size-full rounded-lg ring-2 ring-background";return A2.jsxs("span",{className:"relative size-10 shrink-0",children:[Z?A2.jsx("img",{src:Z,alt:"",className:"size-full rounded-lg ring-2 ring-background"}):A2.jsx("span",{className:"flex size-full items-center justify-center rounded-lg bg-muted text-muted-foreground ring-2 ring-background",children:A2.jsx(jU,{className:"size-5"})}),J!=="connected"&&A2.jsx(Cg,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function wg($){return[...$].sort((J,Z)=>Number(Z.status==="connected")-Number(J.status==="connected"))}function Eg({icon:$,children:J}){return A2.jsxs("div",{className:"flex items-center gap-3 text-card-foreground",children:[$,A2.jsx("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:J})]})}function Sg({server:$}){return A2.jsxs(Eg,{icon:A2.jsx(n70,{name:$.name,status:$.status}),children:[A2.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:OU($.name)}),A2.jsx("span",{className:"text-sm text-muted-foreground",children:a70($.status)})]})}function Ig(){return A2.jsxs(Eg,{icon:A2.jsx(bJ,{className:"size-10 shrink-0 rounded-lg"}),children:[A2.jsx(bJ,{className:"h-4 w-36 max-w-full"}),A2.jsx(bJ,{className:"h-4 w-20"})]})}function FA({children:$}){return A2.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:$})}function Rg($,J){return n1({queryKey:w0.mcp($),queryFn:()=>N1(`/api/workspaces/${$}/mcp`),enabled:J,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}var D4=O(c(),1);function pJ({title:$,description:J,children:Z}){return D4.jsxs("div",{className:"flex flex-col gap-6",children:[D4.jsxs("header",{className:"flex flex-col gap-0.5",children:[D4.jsx("h2",{className:"text-lg font-medium tracking-tight",children:$}),J&&D4.jsx("p",{className:"text-sm text-muted-foreground",children:J})]}),Z]})}function uJ({label:$,children:J}){return D4.jsxs("section",{className:"flex flex-col gap-2",children:[$&&D4.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:$}),D4.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:J})]})}function cJ({title:$,description:J,control:Z}){return D4.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[D4.jsxs("div",{className:"flex min-w-0 flex-col",children:[D4.jsx("span",{className:"text-sm font-medium",children:$}),J&&D4.jsx("span",{className:"text-xs text-muted-foreground",children:J})]}),Z&&D4.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:Z})]})}var u2=O(c(),1),o70=Array.from({length:4},($,J)=>J);function s70({connectors:$}){if($.isPending)return u2.jsx("div",{role:"status","aria-label":"Loading connectors",children:u2.jsx(FA,{children:o70.map((J)=>u2.jsx(Ig,{},J))})});if($.isError)return u2.jsxs(kg,{children:[u2.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors."}),u2.jsx(C0,{variant:"outline",size:"sm",onClick:()=>$.refetch(),children:"Retry"})]});if($.data.length===0)return u2.jsxs(kg,{children:[u2.jsx(JF,{size:24,stroke:1.5,className:"text-muted-foreground"}),u2.jsx("p",{className:"text-sm text-foreground",children:"No connectors configured."})]});return u2.jsx(FA,{children:wg($.data).map((J)=>u2.jsx(Sg,{server:J},J.name))})}function kg({children:$}){return u2.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 bg(){let{workspaceId:$}=Y5(),J=Rg($,!0);return u2.jsx(pJ,{title:"Connectors",description:"Connectors available to the agent in this workspace.",children:u2.jsx(s70,{connectors:J})})}var LA=O(g(),1);var hB={};_4(hB,{Thumb:()=>vg,Root:()=>hg});var Z$=O(g(),1);var ZF=O(g(),1),KA=ZF.createContext(void 0);function yg(){let $=ZF.useContext(KA);if($===void 0)throw Error(E0(63));return $}var WA=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 HF={...y2,checked($){if($)return{[WA.checked]:""};return{[WA.unchecked]:""}}};var yB=O(c(),1),hg=Z$.forwardRef(function(J,Z){let{checked:H,className:B,defaultChecked:Q,id:X,inputRef:z,name:G,nativeButton:Y=!1,onCheckedChange:U,readOnly:F=!1,required:K=!1,disabled:W=!1,render:q,uncheckedValue:N,value:V,...L}=J,{clearErrors:A}=n4(),{state:M,setTouched:_,setDirty:P,validityData:D,setFilled:w,setFocused:R,shouldValidateOnChange:b,validationMode:E,disabled:x,name:I,validation:S}=y5(),{labelId:j}=W2(),C=x||W,k=I??G,y=K0(U),v=Z$.useRef(null),u=j4(v,z,S.inputRef),T=Z$.useRef(null),t=t0(),B0=W7({id:X,implicit:!1,controlRef:T}),h=Y?void 0:B0,[e,A0]=o4({controlled:H,default:Boolean(Q),name:"Switch",state:"checked"});q7({id:t,commit:S.commit,value:e,controlRef:T,name:k,getValue:()=>e}),F0(()=>{if(v.current)w(v.current.checked)},[v,w]),UY(e,()=>{if(A(k),P(e!==D.initialValue),w(e),b())S.commit(e);else S.commit(e,!0)});let{getButtonProps:l,buttonRef:z0}=p5({disabled:C,native:Y}),W0={id:Y?B0:t,role:"switch","aria-checked":e,"aria-readonly":F||void 0,"aria-required":K||void 0,"aria-labelledby":j,onFocus(){if(!C)R(!0)},onBlur(){let i=v.current;if(!i||C)return;if(_(!0),R(!1),E==="onBlur")S.commit(i.checked)},onClick(i){if(F||C)return;i.preventDefault(),v.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:i.shiftKey,ctrlKey:i.ctrlKey,altKey:i.altKey,metaKey:i.metaKey}))}},Q0=Z$.useMemo(()=>U4({checked:e,disabled:C,id:h,name:k,required:K,style:k?RM:U8,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:u,onChange(i){if(i.nativeEvent.defaultPrevented)return;let $0=i.target.checked,J0=M0(Y0.none,i.nativeEvent);if(y?.($0,J0),J0.isCanceled)return;A0($0)},onFocus(){T.current?.focus()}},S.getInputValidationProps,V!==void 0?{value:V}:k1),[e,C,u,h,k,y,K,A0,S,V]),G0=Z$.useMemo(()=>({...M,checked:e,disabled:C,readOnly:F,required:K}),[M,e,C,F,K]),L0=U0("span",J,{state:G0,ref:[Z,T,z0],props:[W0,S.getValidationProps,L,l],stateAttributesMapping:HF});return yB.jsxs(KA.Provider,{value:G0,children:[L0,!e&&k&&N!==void 0&&yB.jsx("input",{type:"hidden",name:k,value:N}),yB.jsx("input",{...Q0})]})});var xg=O(g(),1);var vg=xg.forwardRef(function(J,Z){let{render:H,className:B,...Q}=J,{state:X}=y5(),z=yg(),G={...X,...z};return U0("span",J,{state:G,ref:Z,stateAttributesMapping:HF,props:Q})});var qA=O(c(),1);function gg({className:$,...J}){return qA.jsx(hB.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",$),...J,children:qA.jsx(hB.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 NA=["app-settings"];function fg(){let $=s0();return Z2((J)=>{if(J.type==="settings:updated")$.setQueryData(NA,J.settings)}),n1({queryKey:NA,queryFn:()=>N1("/api/settings"),staleTime:30000})}function mg(){let $=s0();return o1({mutationFn:(J)=>N1("/api/settings",a5("PATCH",J),"Failed to save settings"),onSuccess:(J)=>{$.setQueryData(NA,J)}})}function pg($){return n1({queryKey:w0.env($),queryFn:()=>N1(`/api/workspaces/${$}/env`),...k4})}function ug($){let J=s0();return o1({mutationFn:(Z)=>N1(`/api/workspaces/${$}/env`,a5("PUT",Z)),onSuccess:(Z)=>{J.setQueryData(w0.env($),Z)}})}function cg($){let J=s0();return o1({mutationFn:(Z)=>w4(`/api/workspaces/${$}/config`,a5("PUT",{name:Z}),"Failed to save name"),onSuccess:()=>{J.invalidateQueries({queryKey:w0.layout($)}),J.invalidateQueries({queryKey:w0.all})}})}function dg($){let J=s0();return o1({scope:{id:`workspace-icon:${$}`},mutationFn:(Z)=>N1(`/api/workspaces/${$}/icon`,{method:"PUT",headers:{"Content-Type":Z.type||"application/octet-stream"},body:Z}),onSuccess:()=>{J.invalidateQueries({queryKey:w0.layout($)}),J.invalidateQueries({queryKey:w0.all})}})}function lg($){let J=s0();return o1({scope:{id:`workspace-icon:${$}`},mutationFn:()=>w4(`/api/workspaces/${$}/icon`,{method:"DELETE"},"Failed to reset icon"),onSuccess:()=>{J.invalidateQueries({queryKey:w0.layout($)}),J.invalidateQueries({queryKey:w0.all})}})}function ig($){let J=s0();return Z2((Z)=>{if(Z.type==="env:updated"&&Z.workspaceId===$)J.invalidateQueries({queryKey:w0.env($)})}),{env:pg($),update:ug($)}}var R5=O(c(),1),t70={dotenv:".env",custom:"secret",both:"override"},e70=/^[A-Za-z_][A-Za-z0-9_]*$/;function ag(){let{workspaceId:$}=Y5(),{env:J,update:Z}=ig($),[H,B]=LA.useState(""),[Q,X]=LA.useState(""),z=e70.test(H),G=z&&Q.length>0&&!Z.isPending,Y=()=>{if(!G)return;Z.mutate({set:{[H]:Q}},{onSuccess:()=>{B(""),X("")}})},U=J.data?.vars??[],F=J.data?.files.reduce((W,q)=>W+q.count,0)??0,K=J.data?.files.length??0;return R5.jsxs(pJ,{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:[R5.jsxs(uJ,{label:"Variables",children:[J.isLoading?R5.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:R5.jsx(E5,{className:"size-4 animate-spin",stroke:1.75})}):U.length===0?R5.jsx("p",{className:"px-3.5 py-4 text-sm text-muted-foreground",children:"No variables yet."}):U.map((W)=>{let q=W.source!=="dotenv";return R5.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[R5.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:W.key}),R5.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),R5.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:t70[W.source]}),!q&&R5.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),R5.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>Z.mutate({remove:[W.key]}),disabled:!q,"aria-label":`Delete ${W.key}`,className:"disabled:invisible",children:R5.jsx(rg,{stroke:1.75})})]},W.key)}),R5.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[R5.jsx(U3,{value:H,onChange:(W)=>B(W.target.value),placeholder:"NEW_KEY","aria-invalid":H.length>0&&!z,className:"h-7 w-40 font-mono text-xs"}),R5.jsx(U3,{value:Q,onChange:(W)=>X(W.target.value),onKeyDown:(W)=>{if(W.key==="Enter")Y()},type:"password",placeholder:"value",className:"h-7 flex-1 text-xs"}),R5.jsxs(C0,{variant:"outline",size:"sm",onClick:Y,disabled:!G,children:[Z.isPending?R5.jsx(E5,{stroke:1.75,className:"animate-spin"}):R5.jsx(F4,{stroke:1.75}),"Add"]})]})]}),R5.jsx(uJ,{label:"From .env files",children:R5.jsx(cJ,{title:"Inherit .env files",description:K>0?`Discovered ${F} ${F===1?"key":"keys"} across ${K} ${K===1?"file":"files"} in this space.`:"No .env files found in this space.",control:R5.jsx(gg,{checked:J.data?.inheritDotenv??!0,disabled:J.isLoading,onCheckedChange:(W)=>Z.mutate({inheritDotenv:W})})})})]})}var sm=O(g(),1);var O2=O(g(),1);var r0=O(g(),1),dJ=O(g(),1),g4=O(g(),1),Lf=O(c(),1),QF=O(g(),1),XF=O(g(),1),O1=O(c(),1),$J0=Object.defineProperty,JJ0=($,J)=>{for(var Z in J)$J0($,Z,{get:J[Z],enumerable:!0})},c9={};JJ0(c9,{ActiveEmoji:()=>kf,Empty:()=>Rf,List:()=>Ef,Loading:()=>If,Root:()=>Pf,Search:()=>_f,SkinTone:()=>bf,SkinToneSelector:()=>Sf,Viewport:()=>Of});var Uf="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",DA=["none","light","medium-light","medium","medium-dark","dark"];function VA($){return $.charAt(0).toUpperCase()+$.slice(1)}var E8=2,c2=null;function ng($){try{c2??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!c2||(queueMicrotask(()=>{c2&&(c2=null)}),c2.canvas.width=E8,c2.canvas.height=E8,c2.font=`2px ${Uf}`,c2.textBaseline="middle",c2.measureText($).width>=E8*2))return!1;c2.fillStyle="#00f",c2.fillText($,0,0);let J=c2.getImageData(0,0,E8,E8).data;c2.clearRect(0,0,E8,E8),c2.fillStyle="#f00",c2.fillText($,0,0);let Z=c2.getImageData(0,0,E8,E8).data;for(let H=0;H<E8*E8*4;H+=4)if(J[H]!==Z[H]||J[H+1]!==Z[H+1]||J[H+2]!==Z[H+2])return!1;return!0}function og($,J,Z){try{let H=$.getItem(J);if(!H)throw Error(`No value found for "${J}".`);let B=JSON.parse(H);return Z(B)}catch{return null}}function Ff($,J,Z){$.setItem(J,JSON.stringify(Z))}function sg($){return(J)=>J===void 0?void 0:$(J)}function tg($){return(J)=>J===null?null:$(J)}function _2($){if(typeof $!="string")throw Error();return $}function BF($){if(typeof $!="number")throw Error();return $}function Kf($){if(typeof $!="boolean")throw Error();return $}function H$($){return(J)=>{if(typeof J!="object"||J===null)throw Error();let Z={};for(let H in $){let B=J[H];B===void 0&&$[H](void 0),Z[H]=$[H](B)}return Z}}function AA($){return(J)=>{if(!Array.isArray(J))throw Error();return J.length>0&&$(J[0]),J}}var Wf=($,J)=>`${$}/${J}/data.json`,qf=($,J)=>`${$}/${J}/messages.json`,ZJ0=["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"],eg="en",Nf=($)=>`frimousse/data/${$}`,$f="frimousse/metadata";async function Jf($,J){try{return(await fetch($,{method:"HEAD",signal:J})).headers.get("etag")}catch{return null}}async function HJ0($,J,Z){let[{emojis:H,emojisEtag:B},{messages:Q,messagesEtag:X}]=await Promise.all([fetch(Wf($,J),{signal:Z}).then(async(z)=>({emojis:await z.json(),emojisEtag:z.headers.get("etag")})),fetch(qf($,J),{signal:Z}).then(async(z)=>({messages:await z.json(),messagesEtag:z.headers.get("etag")}))]);return{emojis:H,messages:Q,emojisEtag:B,messagesEtag:X}}async function BJ0($,J,Z){let[H,B]=await Promise.all([Jf(Wf($,J),Z),Jf(qf($,J),Z)]);return{emojisEtag:H,messagesEtag:B}}function QJ0($){return $.skins?$.skins.filter((J)=>typeof J.tone=="number").reduce((J,Z)=>{let H=DA[Z.tone];return J[H]=Z.emoji,J},{}):void 0}async function Zf($,J,Z){let{emojis:H,emojisEtag:B,messages:Q,messagesEtag:X}=await HJ0($,J,Z),z=Q.subgroups.find((q)=>q.key==="country-flag"||q.key==="subdivision-flag"),G=Q.groups.filter((q)=>q.key!=="component"),Y=H.filter((q)=>("group"in q)),U=G.map((q)=>({index:q.order,label:VA(q.message)})),F=Q.skinTones.reduce((q,N)=>(q[N.key]=VA(N.message),q),{}),K=Y.map((q)=>({emoji:q.emoji,category:q.group,version:q.version,label:VA(q.label),tags:q.tags??[],countryFlag:z&&q.subgroup===z.order||void 0,skins:QJ0(q)})),W={locale:J,emojis:K,categories:U,skinTones:F};return Ff(localStorage,Nf(J),{data:W,metadata:{emojisEtag:B,messagesEtag:X}}),W}function XJ0($,J){let Z=new Map;for(let X of $)Z.has(X.version)||Z.set(X.version,X.emoji);let H=[...Z.keys()].sort((X,z)=>z-X),B=H[0]??0,Q=ng("\uD83C\uDDEA\uD83C\uDDFA");if(typeof J=="number")return{emojiVersion:J,countryFlags:Q};for(let X of H){let z=Z.get(X);if(ng(z))return{emojiVersion:X,countryFlags:Q}}return{emojiVersion:B,countryFlags:Q}}var zJ0=H$({emojiVersion:BF,countryFlags:Kf}),GJ0=H$({data:H$({locale:_2,emojis:AA(H$({emoji:_2,category:BF,label:_2,version:BF,tags:AA(_2),countryFlag:sg(Kf),skins:sg(H$({light:_2,"medium-light":_2,medium:_2,"medium-dark":_2,dark:_2}))})),categories:AA(H$({index:BF,label:_2})),skinTones:H$({light:_2,"medium-light":_2,medium:_2,"medium-dark":_2,dark:_2})}),metadata:H$({emojisEtag:tg(_2),messagesEtag:tg(_2)})});async function YJ0({locale:$,emojiVersion:J,emojibaseUrl:Z,signal:H}){let B=typeof Z=="string"?Z:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof J=="number"?Math.floor(J):"latest"}`,Q=og(sessionStorage,$f,zJ0),X=og(localStorage,Nf($),GJ0),z;if(!X)z=await Zf(B,$,H);else if(Q)z=X.data;else try{let{emojisEtag:Y,messagesEtag:U}=await BJ0(B,$,H);z=!Y||!U||Y!==X.metadata.emojisEtag||U!==X.metadata.messagesEtag?await Zf(B,$,H):X.data}catch{z=X.data}Q??=XJ0(z.emojis,J),Ff(sessionStorage,$f,Q);let G=z.emojis.filter((Y)=>{let U=Y.version<=Q.emojiVersion;return Y.countryFlag?U&&Q.countryFlags:U});return{locale:$,emojis:G,categories:z.categories,skinTones:z.skinTones}}function Hf($){return ZJ0.includes($)?$:(console.warn(`Locale "${$}" is not supported, using "${eg}" instead.`),eg)}function Bf($){return DA.includes($)?$:(console.warn(`Skin tone "${$}" is not valid, using "none" instead.`),"none")}function UJ0($,J){let Z=[];if(J<=0)return Z;for(let H=0,B=$.length;H<B;H+=J)Z.push($.slice(H,H+J));return Z}function FJ0($,J){if(!J)return $;let Z=J.toLowerCase().trim(),H=new WeakMap;return $.filter((B)=>{let Q=0;B.label.toLowerCase().includes(Z)&&(Q+=10);for(let X of B.tags)X.toLowerCase().includes(Z)&&(Q+=1);return Q>0?(H.set(B,Q),!0):!1}).sort((B,Q)=>(H.get(Q)??0)-(H.get(B)??0))}function KJ0($,J,Z,H){let B=FJ0($.emojis,H),Q=[],X=[],z=[],G={},Y=0,U=0;for(let F of B)G[F.category]||(G[F.category]=[]),G[F.category].push({emoji:Z&&Z!=="none"&&F.skins?F.skins[Z]:F.emoji,label:F.label});for(let F of $.categories){let K=G[F.index];if(!K||K.length===0)continue;let W=UJ0(Array.from(K),J).map((q)=>({categoryIndex:Y,emojis:q}));Q.push(...W),X.push({label:F.label,rowsCount:W.length,startRowIndex:U}),z.push(U),Y++,U+=W.length}return{count:B.length,categories:X,categoriesStartRowIndices:z,rows:Q,skinTones:$.skinTones}}function WJ0($){let J={},Z=null,H=null,B=new Set,Q=()=>{if(Z){J=Z,Z=null;for(let Y of B)Y(J)}H=null},X=()=>Z??J,z=(Y)=>{Z??=J,Object.assign(Z,typeof Y=="function"?Y(X()):Y),H||(H=requestAnimationFrame(Q))},G=(Y)=>(B.add(Y),()=>B.delete(Y));return J=$(z,X),{get:X,set:z,subscribe:G}}function qJ0($){let[J]=g4.useState($);return J}function NJ0($){let J=g4.createContext(null);return{useStore:()=>{let Z=g4.useContext(J);if(!Z)throw Error($);return Z},Provider:({store:Z,children:H})=>Lf.jsx(J.Provider,{value:Z,children:H})}}function v4($,J,Z=Object.is){let[H,B]=g4.useState(()=>J($.get()));return g4.useEffect(()=>$.subscribe(()=>{let Q=J($.get());B((X)=>Z(X,Q)?X:Q)}),[$,J,Z]),g4.useDebugValue(H),H}function V9($,J,Z){let H=g4.useCallback((B)=>B[J],[J]);return v4($,H,Z)}var Qf=2;function LJ0($,J,Z,H,B){let Q=0;return WJ0((X,z)=>({locale:J,columns:Z,sticky:H,skinTone:B,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 Y=z(),U=G?.data??Y.data,F=G?.categoryHeaderHeight??Y.categoryHeaderHeight,K=G?.rowHeight??Y.rowHeight,W=G?.viewportHeight??Y.viewportHeight;if(!U||U.rows.length===0||!F||!K||!W)return X({...G,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let q=0,N=0;for(let R of U.categories)if(N++*F+R.startRowIndex*K<Q)q+=F;else break;let V=U.categories.length*F+U.rows.length*K,L=Math.floor(Qf*K/2),A=Math.ceil(Qf*K/2),M=Math.min(Q-q-L,V-W),_=M+W+A,P=Math.max(0,Math.floor(M/K)),D=Math.min(U.rows.length-1,Math.ceil(_/K)),w=U.rows[P]?.categoryIndex;return X(w===void 0&&G?G:{...G,viewportStartCategoryIndex:w,viewportStartRowIndex:P,viewportEndRowIndex:D})},onDataChange:(G)=>{z().updateViewportState({data:G,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:(G)=>{X({search:G,interaction:G?"keyboard":"none"})},onActiveEmojiChange:(G,Y,U)=>{if(X({interaction:G,activeColumnIndex:Y,activeRowIndex:U}),G!=="keyboard")return;let{listRef:F,viewportRef:K,sticky:W,rowHeight:q,viewportHeight:N,categoryHeaderHeight:V}=z(),L=F?.current,A=K?.current;if(!L||!A||!q||!V||!N)return;let M=U;M===0&&A.scrollTo({top:0,behavior:"instant"});let _=L.querySelector(`[aria-rowindex="${M}"]`);if(!(_ instanceof HTMLElement))return;let P=_.offsetTop,D=getComputedStyle(_),w=Number.parseFloat(D.scrollMarginTop),R=Number.parseFloat(D.scrollMarginBottom),b=Q+w;W&&P<Q+N/2&&(b+=V);let E=b+N-R;(P<b||P+q>E)&&A.scrollTo({top:Math.max(P<b+V?P-Math.max(W?V:0,w):P-N+q+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,Y)=>{z().updateViewportState({viewportWidth:G,viewportHeight:Y})},onViewportScroll:(G)=>{Q=G,z().updateViewportState()}}))}var{useStore:M4,Provider:VJ0}=NJ0("EmojiPicker.Root is missing.");function AJ0($){return $.search}function MA($){return $.interaction==="none"?void 0:$.data?.rows[$.activeRowIndex]?.emojis[$.activeColumnIndex]}function DJ0($){return $.data===void 0||typeof $.data?.count=="number"&&$.data.count===0}function MJ0($){return $.data===null||$.viewportHeight===null||$.rowHeight===null||$.categoryHeaderHeight===null}function Vf($){return $.data?.rows.length}function PJ0($){return $.data?.categories.length}function _J0($){return $.data?.categoriesStartRowIndices}function OJ0($){return $.data?.skinTones}function Af($,J){return $?.emoji===J?.emoji}function jJ0($,J){return $?.categoryIndex!==J?.categoryIndex||$?.emojis.length!==J?.emojis.length?!1:!!$?.emojis.every((Z,H)=>Af(Z,J?.emojis[H]))}var xB="",Xf=/\p{Emoji_Modifier_Base}/u,TJ0=/\uFE0F$/,CJ0=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,wJ0={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function EJ0($,J){if(!$.split(xB).some((H)=>Xf.test(H)))return $;let Z=$.split(xB).map((H)=>H.replace(CJ0,"")).join(xB);return J==="none"?Z:Z.split(xB).map((H,B,Q)=>{let X=Q.length>1;return!Xf.test(H)||X&&H==="\uD83E\uDD1D"?H:H.replace(TJ0,"")+wJ0[J]}).join(xB)}function SJ0($){return DA.map((J)=>({skinTone:J,emoji:EJ0($,J)}))}function Df(){let $=M4(),J=v4($,MA,Af);return dJ.useDeferredValue(J)}function Mf($="✋"){let J=M4(),Z=V9(J,"skinTone"),H=dJ.useMemo(()=>SJ0($),[$]),B=dJ.useCallback((Q)=>{J.set({skinTone:Q})},[]);return[Z,B,H]}function PA($,J){if(Object.is($,J))return!0;if(typeof $!="object"||typeof J!="object"||$===null||J===null||Array.isArray($)!==Array.isArray(J))return!1;let Z=Object.keys($),H=Object.keys(J);return Z.length!==H.length?!1:Z.every((B)=>(B in J)&&$[B]===J[B])}function IJ0(...$){}function RJ0($,J){let Z=null;if(typeof window.requestIdleCallback=="function")Z=window.requestIdleCallback($,J);else{let H=Date.now();Z=window.setTimeout(()=>{$({didTimeout:!1,timeRemaining:()=>Math.max(0,(J?.timeout??50)-(Date.now()-H))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(Z):window.clearTimeout(Z)}}var S8=typeof window<"u"?QF.useLayoutEffect:QF.useEffect;function kJ0($){let J=XF.useRef($);return S8(()=>{J.current=$}),XF.useCallback((...Z)=>J.current(...Z),[])}function bJ0({emojiVersion:$,emojibaseUrl:J}){let[Z,H]=r0.useState(void 0),B=M4(),Q=V9(B,"locale"),X=V9(B,"columns"),z=V9(B,"skinTone"),G=V9(B,"search");return r0.useEffect(()=>{let Y=new AbortController,U=Y.signal;return YJ0({locale:Q,emojiVersion:$,emojibaseUrl:J,signal:U}).then((F)=>{H(F)}).catch((F)=>{U.aborted||console.error(F)}),()=>{Y.abort()}},[$,J,Q]),r0.useEffect(()=>{if(Z)return RJ0(()=>{B.get().onDataChange(KJ0(Z,X,z,G))},{timeout:100})},[Z,X,z,G]),null}var Pf=r0.forwardRef(({locale:$="en",columns:J=9,skinTone:Z="none",onEmojiSelect:H=IJ0,emojiVersion:B,emojibaseUrl:Q,onFocusCapture:X,onBlurCapture:z,children:G,style:Y,sticky:U=!0,...F},K)=>{let W=kJ0(H),q=qJ0(()=>LJ0(W,Hf($),J,U,Bf(Z))),[N,V]=r0.useState(!1),L=r0.useRef(null),A=r0.useCallback((P)=>{P&&(L.current=P,q.set({rootRef:L}))},[]);S8(()=>{q.set({locale:Hf($)})},[$]),S8(()=>{q.set({columns:J})},[J]),S8(()=>{q.set({sticky:U})},[U]),S8(()=>{q.set({skinTone:Bf(Z)})},[Z]);let M=r0.useCallback((P)=>{X?.(P);let{searchRef:D,viewportRef:w}=q.get(),R=P.target===D?.current||P.target.hasAttribute("frimousse-search"),b=P.target===w?.current||P.target.hasAttribute("frimousse-viewport");P.isDefaultPrevented()||(V(R||b),P.isDefaultPrevented()||(V(R||b),b?q.get().onActiveEmojiChange("keyboard",0,0):R&&q.get().search===""&&q.set({interaction:"none"})))},[X]),_=r0.useCallback((P)=>{z?.(P),!P.isDefaultPrevented()&&!P.currentTarget.contains(P.relatedTarget)&&V(!1)},[z]);return S8(()=>{N||q.get().onActiveEmojiReset()},[N]),r0.useImperativeHandle(K,()=>L.current),r0.useEffect(()=>{if(!N)return;function P(D){if(D.defaultPrevented||!D.key.startsWith("Arrow")&&D.key!=="Enter")return;let{data:w,onEmojiSelect:R,onActiveEmojiChange:b,interaction:E,activeColumnIndex:x,activeRowIndex:I}=q.get();if(D.key==="Enter"){let S=MA(q.get());S&&(D.preventDefault(),R(S))}if(D.key.startsWith("Arrow")){let S=x,j=I;if(D.preventDefault(),E!=="none"){if(w?.rows&&w.rows.length>0)switch(D.key){case"ArrowLeft":{if(S===0){let C=j-1,k=w.rows[C];k&&(j=C,S=k.emojis.length-1)}else S-=1;break}case"ArrowRight":{if(S===w.rows[j].emojis.length-1){let C=j+1;w.rows[C]&&(j=C,S=0)}else S+=1;break}case"ArrowUp":{let C=w.rows[j-1];C&&(j-=1,C.emojis[S]||(S=C.emojis.length-1));break}case"ArrowDown":{let C=w.rows[j+1];C&&(j+=1,C.emojis[S]||(S=C.emojis.length-1));break}}b("keyboard",S,j)}else b("keyboard",0,0)}}return document.addEventListener("keydown",P),()=>{document.removeEventListener("keydown",P)}},[N]),S8(()=>{let P=null,D=null,w=null,R=null,b=q.subscribe((j)=>{L.current&&(P!==j.viewportWidth&&(P=j.viewportWidth,L.current.style.setProperty("--frimousse-viewport-width",`${j.viewportWidth}px`)),D!==j.viewportHeight&&(D=j.viewportHeight,L.current.style.setProperty("--frimousse-viewport-height",`${j.viewportHeight}px`)),w!==j.rowHeight&&(w=j.rowHeight,L.current.style.setProperty("--frimousse-row-height",`${j.rowHeight}px`)),R!==j.categoryHeaderHeight&&(R=j.categoryHeaderHeight,L.current.style.setProperty("--frimousse-category-header-height",`${j.categoryHeaderHeight}px`)))}),{viewportWidth:E,viewportHeight:x,rowHeight:I,categoryHeaderHeight:S}=q.get();return E&&L.current.style.setProperty("--frimousse-viewport-width",`${E}px`),x&&L.current.style.setProperty("--frimousse-viewport-height",`${x}px`),I&&L.current.style.setProperty("--frimousse-row-height",`${I}px`),S&&L.current.style.setProperty("--frimousse-category-header-height",`${S}px`),b},[]),O1.jsx("div",{"data-focused":N?"":void 0,"frimousse-root":"",onBlurCapture:_,onFocusCapture:M,...F,ref:A,style:{"--frimousse-emoji-font":Uf,...Y},children:O1.jsxs(VJ0,{store:q,children:[O1.jsx(bJ0,{emojiVersion:B,emojibaseUrl:Q}),G]})})}),_f=r0.forwardRef(({value:$,defaultValue:J,onChange:Z,...H},B)=>{let Q=M4(),X=r0.useRef(null),z=r0.useCallback((F)=>{F&&(X.current=F,Q.set({searchRef:X}))},[]),G=typeof $=="string",Y=r0.useRef(G);r0.useEffect(()=>{Y.current=G},[G]),S8(()=>{Q.set({search:typeof $=="string"?$:typeof J=="string"?J:""})},[]),S8(()=>{typeof $=="string"&&Q.get().onSearchChange($)},[$]);let U=r0.useCallback((F)=>{Z?.(F),F.isDefaultPrevented()||Q.get().onSearchChange(F.target.value)},[Z]);return r0.useImperativeHandle(B,()=>X.current),O1.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...H,defaultValue:J,onChange:U,ref:z,value:$})}),yJ0=r0.memo(()=>{let $=Df();return $?O1.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}),Of=r0.forwardRef(({children:$,onScroll:J,onKeyDown:Z,style:H,...B},Q)=>{let X=M4(),z=r0.useRef(null),G=r0.useCallback((K)=>{K&&(z.current=K,X.set({viewportRef:z}))},[]),Y=v4(X,Vf),U=v4(X,PJ0),F=r0.useCallback((K)=>{J?.(K),X.get().onViewportScroll(K.currentTarget.scrollTop)},[J]);return S8(()=>{if(!z.current)return;let K=new ResizeObserver(([W])=>{let q=W?.borderBoxSize[0]?.inlineSize??0,N=W?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:V,viewportHeight:L,viewportWidth:A}=X.get();(L!==N||A!==q)&&V(q,N)});return K.observe(z.current),X.get().onViewportSizeChange(z.current.offsetWidth,z.current.clientHeight),()=>{K.disconnect()}},[]),r0.useImperativeHandle(Q,()=>z.current),O1.jsxs("div",{"frimousse-viewport":"",...B,onScroll:F,ref:G,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof Y=="number"&&typeof U=="number"?`var(--frimousse-viewport-width, auto) calc(${Y} * var(--frimousse-row-height) + ${U} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...H},children:[O1.jsx(yJ0,{}),$]})});function jf($,J,Z){return{emoji:{...$,isActive:Z},role:"gridcell","aria-colindex":J,"aria-selected":Z||void 0,"aria-label":$.label,"data-active":Z?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function Tf($,J=!1){return{role:J?void 0:"row","aria-rowindex":J?void 0:$,"frimousse-row":"",style:{contain:J?void 0:"content",height:J?void 0:"var(--frimousse-row-height)",display:"flex"}}}function Cf($,J){return{"frimousse-category":"",style:{contain:"content",top:J?`calc(${$} * var(--frimousse-category-header-height) + ${J.startRowIndex} * var(--frimousse-row-height))`:void 0,height:J?`calc(var(--frimousse-category-header-height) + ${J.rowsCount} * var(--frimousse-row-height))`:void 0,width:"100%",pointerEvents:"none",position:"absolute"}}}function wf($,J=!1,Z=!0){return{category:$,"frimousse-category-header":"",style:{contain:J?void 0:"layout paint",height:J?void 0:"var(--frimousse-category-header-height)",pointerEvents:"auto",position:Z?"sticky":void 0,top:0}}}function zf($,J,Z,H){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${$} * var(--frimousse-row-height) + ${J} * var(--frimousse-category-header-height))`,paddingTop:`calc(${Z} * var(--frimousse-row-height) + ${H} * var(--frimousse-category-header-height))`}}}function Gf($,J,Z){return{"aria-colcount":$,"aria-rowcount":J,"frimousse-list":"",style:{"--frimousse-list-columns":$,...Z},role:"grid"}}function hJ0($){$.preventDefault()}var xJ0=r0.memo(({Emoji:$,emoji:J,columnIndex:Z,rowIndex:H})=>{let B=M4(),Q=v4(B,(Y)=>MA(Y)?.emoji===J.emoji),X=r0.useCallback(()=>{B.get().onEmojiSelect(J)},[J]),z=r0.useCallback(()=>{B.get().onActiveEmojiChange("pointer",Z,H)},[Z,H]),G=r0.useCallback(()=>{B.get().onActiveEmojiReset()},[]);return O1.jsx($,{...jf(J,Z,Q),onClick:X,onPointerDown:hJ0,onPointerEnter:z,onPointerLeave:G})}),vJ0=r0.memo(({Row:$,Emoji:J,rowIndex:Z})=>{let H=M4(),B=v4(H,(Q)=>Q.data?.rows[Z],jJ0);return B?O1.jsx($,{...Tf(Z),children:B.emojis.map((Q,X)=>O1.jsx(xJ0,{Emoji:J,columnIndex:X,emoji:Q,rowIndex:Z},Q.label))}):null}),gJ0=r0.memo(({CategoryHeader:$,categoryIndex:J})=>{let Z=M4(),H=v4(Z,(Q)=>Q.data?.categories[J],PA),B=V9(Z,"sticky");return H?O1.jsx("div",{...Cf(J,H),children:O1.jsx($,{...wf({label:H.label},!1,B)})}):null}),Yf=r0.memo(({CategoryHeader:$,Row:J,Emoji:Z})=>{let H=r0.useRef(null),B=M4(),Q=V9(B,"columns"),X=r0.useMemo(()=>Array(Q).fill({emoji:"\uD83D\uDE42",label:""}),[Q]),z=r0.useMemo(()=>({label:"Category"}),[]),G=r0.useRef(null),Y=r0.useRef(null);return S8(()=>{let U=H.current?.parentElement?.parentElement;if(!U||!G.current||!Y.current)return;let F=new ResizeObserver((q)=>{for(let N of q){let V=N.contentRect.height,{onRowHeightChange:L,onCategoryHeaderHeightChange:A,rowHeight:M,categoryHeaderHeight:_}=B.get();N.target===G.current&&M!==V&&L(V),N.target===Y.current&&_!==V&&A(V)}});F.observe(U),F.observe(G.current),F.observe(Y.current);let{onRowHeightChange:K,onCategoryHeaderHeightChange:W}=B.get();return K(G.current.clientHeight),W(Y.current.clientHeight),()=>{F.disconnect()}},[]),O1.jsxs("div",{"aria-hidden":!0,ref:H,style:{height:0,visibility:"hidden"},children:[O1.jsx("div",{"frimousse-row-sizer":"",ref:G,children:O1.jsx(J,{...Tf(-1,!0),children:X.map((U,F)=>O1.jsx(Z,{...jf(U,F,!1)},F))})}),O1.jsx("div",{...Cf(-1),children:O1.jsx("div",{"frimousse-category-header-sizer":"",ref:Y,children:O1.jsx($,{...wf(z,!0)})})})]})});function fJ0({category:$,...J}){return O1.jsx("div",{...J,children:$.label})}function mJ0({emoji:$,...J}){return O1.jsx("button",{type:"button",...J,children:$.emoji})}function pJ0({...$}){return O1.jsx("div",{...$})}var Ef=r0.forwardRef(({style:$,components:J,...Z},H)=>{let B=M4(),Q=r0.useRef(null),X=r0.useCallback((L)=>{L&&(Q.current=L,B.set({listRef:Q}))},[]),z=J?.CategoryHeader??fJ0,G=J?.Emoji??mJ0,Y=J?.Row??pJ0,U=V9(B,"columns"),F=V9(B,"viewportStartRowIndex"),K=V9(B,"viewportEndRowIndex"),W=v4(B,Vf),q=v4(B,_J0,PA),N=r0.useMemo(()=>q?.filter((L)=>L<F).length??0,[q,F]),V=q?.length??0;return r0.useImperativeHandle(H,()=>Q.current),!W||!q||V===0?O1.jsx("div",{...Gf(U,0,$),...Z,children:O1.jsx("div",{...zf(0,0,0,0),children:O1.jsx(Yf,{CategoryHeader:z,Emoji:G,Row:Y})})}):O1.jsx("div",{...Gf(U,W,$),...Z,ref:X,children:O1.jsxs("div",{...zf(W,V,F,N),children:[O1.jsx(Yf,{CategoryHeader:z,Emoji:G,Row:Y}),Array.from({length:K-F+1},(L,A)=>{let M=F+A,_=q.indexOf(M);return O1.jsxs(r0.Fragment,{children:[_>=0&&O1.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),O1.jsx(vJ0,{Emoji:G,Row:Y,rowIndex:M})]},M)}),Array.from({length:V},(L,A)=>O1.jsx(gJ0,{CategoryHeader:z,categoryIndex:A},A))]})})}),Sf=r0.forwardRef(({emoji:$,onClick:J,"aria-label":Z="Change skin tone",...H},B)=>{let Q=M4(),X=v4(Q,OJ0,PA),[z,G,Y]=Mf($),U=r0.useMemo(()=>Math.max(0,Y.findIndex((V)=>V.skinTone===z)),[z,Y]),F=Y[U],K=Y[(U+1)%Y.length].skinTone,W=z==="none"?void 0:X?.[z],q=K==="none"?void 0:X?.[K],N=r0.useCallback((V)=>{J?.(V),V.isDefaultPrevented()||G(K)},[J,G,K]);return O1.jsx("button",{type:"button",...H,"aria-label":Z+(q?` (${q})`:""),"aria-live":"polite","aria-valuetext":W,"frimousse-skin-tone-selector":"",onClick:N,ref:B,children:F.emoji})});function If({children:$,...J}){let Z=M4();return v4(Z,MJ0)?O1.jsx("span",{"frimousse-loading":"",...J,children:$}):null}function uJ0({children:$}){let J=M4(),Z=v4(J,AJ0);return $({search:Z})}function Rf({children:$,...J}){let Z=M4();return v4(Z,DJ0)?O1.jsx("span",{"frimousse-empty":"",...J,children:typeof $=="function"?O1.jsx(uJ0,{children:$}):$}):null}function kf({children:$}){let J=Df();return $({emoji:J})}function bf({children:$,emoji:J}){let[Z,H,B]=Mf(J);return $({skinTone:Z,setSkinTone:H,skinToneVariations:B})}Pf.displayName="EmojiPicker.Root";_f.displayName="EmojiPicker.Search";Of.displayName="EmojiPicker.Viewport";Ef.displayName="EmojiPicker.List";If.displayName="EmojiPicker.Loading";Rf.displayName="EmojiPicker.Empty";Sf.displayName="EmojiPicker.SkinToneSelector";kf.displayName="EmojiPicker.ActiveEmoji";bf.displayName="EmojiPicker.SkinTone";var vB=["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"],cJ0=new Set(vB);function yf($){return cJ0.has($)}var gm={rocket:jm,sparkles:Em,bolt:vH,flame:Bm,star:Sm,heart:Ym,diamond:Zm,trophy:ym,target:Rm,bulb:cf,brain:mf,robot:Om,wand:xm,atom:vf,flask:Qm,cpu:tf,code:of,terminal:km,api:xf,database:$m,cube:ef,hexagon:Um,plug:_m,tool:bm,settings:gB,bug:uf,activity:hf,chart:rf,briefcase:pf,folder:Xm,file:XJ,book:ff,message:Nm,mail:Wm,bell:gf,paperclip:PY,key:zF,shield:Tm,user:hm,home:Fm,globe:Gm,world:vm,planet:Pm,compass:sf,map:qm,calendar:df,cloud:nf,sun:Im,moon:Lm,snowflake:wm,leaf:Km,mountain:Vm,feather:Hm,ghost:OY,music:Am,piano:jY,camera:lf,photo:Mm,palette:Dm,gamepad:Jm,gift:zm,cart:Cm,chef:af},_A=vB.map(($)=>({id:$,Icon:gm[$]}));function GF($){return $&&yf($)?gm[$]:null}var jA=[{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 OA($,J,Z){let H=Z*Math.PI/180,B=J*Math.cos(H),Q=J*Math.sin(H),X=($+0.3963377774*B+0.2158037573*Q)**3,z=($-0.1055613458*B-0.0638541728*Q)**3,G=($-0.0894841775*B-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 F=Math.min(1,Math.max(0,U)),K=F<=0.0031308?12.92*F:1.055*F**0.4166666666666667-0.055;return Math.round(K*255).toString(16).padStart(2,"0")}).join("")}`}function fm(){let $=Math.random()*360,J=(35+Math.random()*55)*(Math.random()<0.5?-1:1),Z=Math.round(115+Math.random()*55),H=OA(0.83+Math.random()*0.06,0.09+Math.random()*0.06,$),B=OA(0.5+Math.random()*0.14,0.17+Math.random()*0.07,$+J);if(Math.random()<0.4){let Q=OA(0.7+Math.random()*0.05,0.15,$+J/2);return{angle:Z,stops:[H,Q,B]}}return{angle:Z,stops:[H,B]}}var dJ0="radial-gradient(120% 100% at 28% 12%, rgba(255,255,255,0.32), rgba(255,255,255,0) 58%)";function YF($){return`${dJ0}, linear-gradient(${$.angle}deg, ${$.stops.join(", ")})`}var z2=256;function mm($,J){let Z=J.angle*Math.PI/180,H=Math.sin(Z),B=-Math.cos(Z),Q=z2*(Math.abs(H)+Math.abs(B))/2,X=z2/2,z=$.createLinearGradient(X-H*Q,X-B*Q,X+H*Q,X+B*Q),G=J.stops.length-1;J.stops.forEach((U,F)=>z.addColorStop(G===0?0:F/G,U)),$.fillStyle=z,$.fillRect(0,0,z2,z2);let Y=$.createRadialGradient(z2*0.28,z2*0.12,0,z2*0.28,z2*0.12,z2*1.1);Y.addColorStop(0,"rgba(255,255,255,0.32)"),Y.addColorStop(0.58,"rgba(255,255,255,0)"),$.fillStyle=Y,$.fillRect(0,0,z2,z2)}function pm($){return new Promise((J,Z)=>{$.toBlob((H)=>H?J(H):Z(Error("Canvas is empty")),"image/png")})}function um(){let $=document.createElement("canvas");$.width=z2,$.height=z2;let J=$.getContext("2d");if(!J)throw Error("2D canvas unavailable");return[$,J]}var lJ0=0.92,iJ0=0.68;async function cm($,J){let[Z,H]=um();if(J)mm(H,J);H.textAlign="center",H.textBaseline="middle";let B=J?iJ0:lJ0;return H.font=`${Math.round(z2*B)}px "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif`,H.fillText($,z2/2,z2/2+z2*0.04),pm(Z)}function rJ0($){return new Promise((J,Z)=>{let H=new Image;H.onload=()=>J(H),H.onerror=()=>Z(Error("Failed to load SVG")),H.src=$})}var aJ0=0.78,nJ0=0.6;async function dm($,J){let[Z,H]=um();if(J)mm(H,J);let B=J?"#ffffff":"#18181b",Q=$.replace(/currentColor/g,B),X=await rJ0(`data:image/svg+xml;utf8,${encodeURIComponent(Q)}`),z=z2*(J?nJ0:aJ0),G=(z2-z)/2;return H.drawImage(X,G,G,z,z),pm(Z)}var lm=["\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","☕"],UF="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var o0=O(c(),1);function oJ0({category:$,...J}){return o0.jsx("div",{className:"bg-background px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",...J,children:$.label})}function sJ0({children:$,...J}){return o0.jsx("div",{className:"scroll-my-1 px-1.5",...J,children:$})}function tJ0({emoji:$,...J}){return o0.jsx("button",{className:s("flex size-9 items-center justify-center rounded-xl text-[22px] transition-colors duration-75 data-active:bg-muted",UF),...J,children:$.emoji})}function om({icon:$}){let{workspaceId:J,provider:Z}=Y5(),{isPending:H,mutateAsync:B}=dg(J),{isPending:Q,mutate:X}=lg(J),[z,G]=O2.useState("emoji"),[Y,U]=O2.useState({id:"sunrise",gradient:jA[0].gradient}),[F,K]=O2.useState(null),[W,q]=O2.useState(null),[N,V]=O2.useState(""),[L,A]=O2.useState(null),[M,_]=O2.useState(null),[P,D]=O2.useState(!1),[w,R]=O2.useState(null),b=O2.useRef(null),E=O2.useRef(null),x=O2.useRef(null),I=_A.find((T)=>T.id===L),S=Y.gradient!==null,j=H||Q,C=()=>{let T=fm();K(T),U({id:"shuffle",gradient:T})},k=(T)=>{R(null),x.current=T,G("upload"),_(URL.createObjectURL(T))};O2.useEffect(()=>{let T=!1,t=async()=>{let h;if(z==="upload"){if(!x.current)return;h=x.current}else if(z==="emoji"){if(!W)return;h=await cm(W,Y.gradient)}else{let e=E.current?.querySelector("svg");if(!e)return;h=await dm(new XMLSerializer().serializeToString(e),Y.gradient)}if(!T)await B(h)};R(null);let B0=window.setTimeout(()=>{t().catch((h)=>{if(!T)R(h instanceof Error?h.message:"Failed to save icon")})},150);return()=>{T=!0,window.clearTimeout(B0)}},[Y.gradient,W,z,B,I,M]),O2.useEffect(()=>{return()=>{if(M)URL.revokeObjectURL(M)}},[M]);let y=()=>{x.current=null,q(null),A(null),_(null),R(null),X()},v=z==="emoji"&&W?"emoji":z==="icon"&&I?"glyph":"image",u=z==="upload"&&M?M:$??D8[Z??"claude-code"];return o0.jsxs("div",{className:"flex gap-6",children:[o0.jsxs("div",{className:"flex w-24 shrink-0 flex-col items-center gap-2.5",children:[o0.jsx("div",{className:s("flex size-24 items-center justify-center overflow-hidden rounded-xl",v!=="image"&&!S&&"bg-[repeating-conic-gradient(#0000000d_0%_25%,transparent_0%_50%)] bg-size-[16px_16px]"),style:v!=="image"&&Y.gradient?{background:YF(Y.gradient)}:void 0,children:v==="emoji"?o0.jsx("span",{className:s("leading-none",UF,S?"text-[64px]":"text-[86px]"),children:W}):v==="glyph"&&I?o0.jsx(I.Icon,{stroke:1.5,className:s(S?"size-14 text-white":"size-18 text-foreground")}):o0.jsx("img",{src:u,alt:"",className:"size-full object-cover"})}),o0.jsx("button",{type:"button",onClick:y,disabled:j,className:"text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50",children:"Reset to default"})]}),o0.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[o0.jsx("div",{className:"flex gap-1 self-start rounded-xl bg-muted p-0.5",children:["emoji","icon","upload"].map((T)=>o0.jsx("button",{type:"button",onClick:()=>G(T),className:s("rounded-lg px-3.5 py-1 text-xs font-medium capitalize transition-colors",z===T?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:T},T))}),o0.jsxs("div",{className:s("flex items-center gap-2",z==="upload"&&"pointer-events-none opacity-35"),children:[o0.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Background"}),o0.jsxs("div",{className:"flex items-center gap-2",children:[o0.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",Y.id==="none"?"ring-2 ring-primary":"ring-1 ring-border hover:ring-muted-foreground/30"),children:o0.jsx(rm,{size:16,stroke:1.75,className:"text-muted-foreground"})}),jA.map((T)=>o0.jsx("button",{type:"button","aria-label":`${T.id} background`,onClick:()=>U({id:T.id,gradient:T.gradient}),style:{background:YF(T.gradient)},className:s("size-7 rounded-full ring-offset-2 ring-offset-card transition-shadow",Y.id===T.id?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30")},T.id)),o0.jsx("button",{type:"button","aria-label":"Random background",title:"Surprise me",onClick:C,style:F?{background:YF(F)}:void 0,className:s("flex size-7 items-center justify-center rounded-full ring-offset-2 ring-offset-card transition-shadow",F?"text-white":"bg-muted text-muted-foreground ring-1 ring-border",Y.id==="shuffle"?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30"),children:o0.jsx(im,{size:16,stroke:1.75})})]})]}),z==="emoji"?o0.jsxs(c9.Root,{onEmojiSelect:(T)=>q(T.emoji),emojibaseUrl:"/vendor/emojibase",columns:13,className:"isolate flex h-72 flex-col overflow-hidden rounded-xl border border-border bg-background",children:[o0.jsxs("div",{className:"flex items-center gap-1.5 p-1.5 pb-0",children:[o0.jsx(c9.Search,{placeholder:"Search emoji…",onChange:(T)=>V(T.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"}),o0.jsx(c9.SkinToneSelector,{className:"size-8 shrink-0 rounded-lg text-lg hover:bg-accent"})]}),o0.jsxs(c9.Viewport,{className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[o0.jsxs(c9.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[o0.jsx(E5,{size:16,stroke:1.75,className:"animate-spin"}),"Loading emoji…"]}),N.trim()===""&&o0.jsxs("div",{className:"border-b border-dashed border-border pb-1.5",children:[o0.jsx("p",{className:"px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",children:"Favorites"}),o0.jsx("div",{className:"grid grid-cols-13 justify-items-start px-1.5",children:lm.map((T)=>o0.jsx("button",{type:"button",onClick:()=>q(T),className:s("flex size-9 items-center justify-center rounded-xl text-[22px] transition-colors duration-75",UF,W===T?"bg-primary/10":"hover:bg-accent"),children:T},T))})]}),o0.jsxs(c9.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[o0.jsx(am,{size:20,stroke:1.5}),"No emoji found"]}),o0.jsx(c9.List,{className:"pb-1.5 select-none",components:{CategoryHeader:oJ0,Row:sJ0,Emoji:tJ0}})]})]}):z==="icon"?o0.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:_A.map(({id:T,Icon:t})=>o0.jsx("button",{type:"button","aria-label":T,onClick:()=>A(T),className:s("flex aspect-square items-center justify-center rounded-xl text-muted-foreground transition-colors [&_svg]:size-5",L===T?"bg-primary/10 text-primary":"hover:bg-accent hover:text-accent-foreground"),children:o0.jsx(t,{stroke:1.5})},T))}):o0.jsxs("button",{type:"button",onClick:()=>b.current?.click(),onDragOver:(T)=>{T.preventDefault(),D(!0)},onDragLeave:()=>D(!1),onDrop:(T)=>{T.preventDefault(),D(!1);let t=T.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",P?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-muted-foreground/30 hover:text-foreground"),children:[o0.jsx(nm,{size:24,stroke:1.5}),o0.jsx("span",{className:"text-xs font-medium",children:"Click or drop an image"}),o0.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"PNG, JPG, GIF, or WebP"})]}),o0.jsx("div",{className:"min-h-4","aria-live":"polite",children:w?o0.jsx("p",{className:"text-xs text-destructive",children:w}):j?o0.jsx("p",{className:"text-xs text-muted-foreground",children:"Saving…"}):null})]}),o0.jsx("input",{ref:b,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:(T)=>{let t=T.target.files?.[0];if(t)k(t);T.target.value=""}}),o0.jsx("span",{ref:E,"aria-hidden":!0,className:"hidden",children:I&&o0.jsx(I.Icon,{stroke:1.5})})]})}var D2=O(c(),1);function tm(){let{cloudDemo:$}=$9(),{name:J,icon:Z,cwd:H,workspaceId:B}=Y5(),[,Q]=m4(),X=cg(B),z=i_(),[G,Y]=sm.useState(J??"");return D2.jsxs(pJ,{title:"General",description:"Basic details for this space.",children:[D2.jsxs(uJ,{children:[D2.jsx(cJ,{title:"Name",description:"Shown in the sidebar and the workspace header.",control:D2.jsx(U3,{value:G,onChange:(K)=>Y(K.target.value),onBlur:()=>{let K=G.trim();if(K===(J??""))return;X.mutate(K===""?null:K)},onKeyDown:(K)=>{if(K.key==="Enter")K.currentTarget.blur()},placeholder:"Space name",className:"w-56"})}),D2.jsx(cJ,{title:"Path",control:D2.jsx(U3,{value:H??"",readOnly:!0,"aria-label":"Workspace path",title:H??void 0,className:"w-56"})}),D2.jsxs("div",{className:"flex flex-col gap-4 px-3.5 py-3.5",children:[D2.jsxs("div",{className:"flex flex-col",children:[D2.jsx("span",{className:"text-sm font-medium",children:"Icon"}),D2.jsx("span",{className:"text-xs text-muted-foreground",children:"Pick an emoji or a glyph on a generated background, or upload an image."})]}),D2.jsx(om,{icon:Z})]})]}),!$&&D2.jsxs(uJ,{label:"Danger zone",children:[D2.jsx(cJ,{title:"Remove space",description:"Remove this space from moi. Its folder and sessions stay on disk.",control:D2.jsxs(C0,{type:"button",variant:"destructive",size:"sm",onClick:()=>{let W=`Remove "${J??H??"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(B,{onSuccess:()=>Q("/")})},disabled:z.isPending,children:[z.isPending&&D2.jsx(E5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})}),z.isError&&D2.jsx("p",{className:"px-3.5 py-3 text-xs text-destructive",children:z.error.message})]})]})}var L5=O(c(),1),eJ0=[{id:"general",label:"General",icon:gB},{id:"connectors",label:"Connectors",icon:JF},{id:"environment",label:"Environment",icon:zF}];function em(){let[$,J]=TA.useState(!1),[Z,H]=TA.useState("general");return L5.jsxs(L5.Fragment,{children:[L5.jsxs(d1,{children:[L5.jsx(l1,{render:L5.jsx(C0,{variant:"ghost",size:"icon-sm","aria-label":"Settings",onClick:()=>J(!0),children:L5.jsx(gB,{stroke:1.75})})}),L5.jsx(i1,{children:"Settings"})]}),L5.jsx(z3,{open:$,onOpenChange:J,children:L5.jsxs(F7,{className:"flex h-[min(680px,90vh)] w-[880px] max-w-[94vw]",children:[L5.jsx(G3,{className:"sr-only",children:"Space settings"}),L5.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r border-border bg-muted/30 p-3",children:[L5.jsx("p",{className:"px-2.5 pt-4 pb-2 text-[11px] font-semibold tracking-wider text-muted-foreground/80 uppercase",children:"Settings"}),eJ0.map((B)=>L5.jsxs(C0,{type:"button",variant:Z===B.id?"secondary":"ghost",size:"sm",onClick:()=>H(B.id),className:"justify-start",children:[L5.jsx(B.icon,{stroke:1.75}),B.label]},B.id))]}),L5.jsxs("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:[L5.jsxs("div",{className:"px-8 py-7",children:[Z==="general"&&L5.jsx(tm,{}),Z==="connectors"&&L5.jsx(bg,{}),Z==="environment"&&L5.jsx(ag,{})]}),L5.jsx(U7,{render:L5.jsx(C0,{variant:"ghost",size:"icon","aria-label":"Close",className:"absolute top-3 right-3",children:L5.jsx(w5,{stroke:1.5})})})]})]})})]})}function $Z0($){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 $p({send:$,revealChat:J,composerAvailability:Z}){let H=Z5();XG(H,"sendChatMessage",(B)=>{let Q=$Z0(Z);if(Q){V8(H,{source:"runtime",message:`sendChatMessage("${B.message}") was dropped: ${Q}.`});return}let{message:X,...z}=B;J(),$(X,{applet:z})})}var lJ=O(g(),1);var Xp=O(g(),1);function FF($,J){let Z=$??[];if(Z.findIndex((B)=>B.id===J.id)===-1)return[...Z,J];return Z.map((B)=>B.id===J.id&&B.updatedAt<=J.updatedAt?J:B)}function KF($){let J=s0();return Z2((Z)=>{if(Z.type==="view-builder:updated"&&Z.workspaceId===$)J.setQueryData(w0.viewBuilders($),(H)=>FF(H,Z.builder));else if(Z.type==="view-builder:deleted"&&Z.workspaceId===$)J.setQueryData(w0.viewBuilders($),(H)=>(H??[]).filter((B)=>B.id!==Z.builderId))}),n1({queryKey:w0.viewBuilders($),queryFn:async()=>{return(await N1(`/api/workspaces/${$}/view-builders`)).builders},...k4})}function Jp($){let J=s0();return o1({mutationFn:()=>N1(`/api/workspaces/${$}/view-builders`,a5("POST"),"Failed to create view builder"),onSuccess:(Z)=>{J.setQueryData(w0.viewBuilders($),(H)=>FF(H,Z))}})}function Zp($){let J=s0();return o1({mutationFn:({builderId:Z,requirements:H})=>N1(`/api/workspaces/${$}/view-builders/${Z}`,a5("PATCH",{input:{requirements:H}}),"Failed to save view requirements"),onSuccess:(Z)=>{J.setQueryData(w0.viewBuilders($),(H)=>FF(H,Z))}})}function Hp($){let J=s0();return o1({mutationFn:({builderId:Z,requirements:H,...B})=>N1(`/api/workspaces/${$}/view-builders/${Z}/submit`,a5("POST",{input:{requirements:H},availableIcons:vB,...B}),"Failed to start view builder"),onSuccess:(Z)=>{J.setQueryData(w0.viewBuilders($),(H)=>FF(H,Z))}})}function Bp($){let J=s0();return o1({mutationFn:(Z)=>w4(`/api/workspaces/${$}/view-builders/${Z}`,{method:"DELETE"},"Failed to discard view builder"),onSuccess:(Z,H)=>{J.setQueryData(w0.viewBuilders($),(B)=>(B??[]).filter((Q)=>Q.id!==H))}})}var Qp=new Map;function JZ0($){let J=Qp.get($)??[];return Qp.delete($),J}function ZZ0($,J=[]){return[...JZ0($),...J]}function HZ0($,J){if(!$.startsWith("view:"))return;return Object.keys(J).length>0?J:void 0}function BZ0($,J,Z){if($.startsWith("view:"))return J?.find((H)=>H.id===$.slice(5))?.config.title||void 0;if($.startsWith("view-builder:"))return Z?.find((H)=>H.id===$.slice(13))?.title||void 0;return}function zp({activeTab:$,appletParams:J}){let Z=Z5(),H=FG(Z).data,B=KF(Z).data;return Xp.useCallback((Q={})=>{let X=ZZ0(Z,Q.directives??[]),z=HZ0($,J);return{activeTab:$,tabTitle:BZ0($,H,B),...z?{tabParams:z}:{},...Q.applet?{applet:Q.applet}:{},...X.length>0?{directives:X}:{}}},[Z,$,J,H,B])}var Gp=!0;function Yp($,J=[]){return($.trim()||J.filter(Boolean).join(", ")).replace(/\s+/gu," ").trim().slice(0,64).trimEnd()}function WF($){return!$?.applet}function qF($,J,Z){if(!WF(Z))return[];return(E1.getState().attachments[o2($,J)]??[]).filter((B)=>B.status==="ready"&&B.upload)}function NF($){return $.map((J)=>{if(J.upload?.kind==="image"&&J.previewUrl)return{type:"file",mediaType:J.mediaType,url:J.previewUrl,filename:J.name};return{type:"file",mediaType:J.mediaType,url:"",filename:J.name}})}function Up($,J){if(!WF($))return $;let Z=[],H=[],B=0;for(let X of J){if(X.upload?.kind!=="image")continue;if(B+=1,X.kind==="drawing"&&X.purpose==="annotation")Z.push(`${B}. ${JSON.stringify(X.sourceTab)}`);if(X.kind==="drawing"&&X.purpose==="sketch")H.push(`${B}. ${JSON.stringify(X.sourceTab)}`)}if(Z.length===0&&H.length===0)return $;let Q=[...$?.directives??[]];if(Z.length>0)Q.push(`Annotation attachment sources in attachment order: ${Z.join("; ")}.`);if(H.length>0)Q.push(`Sketch attachment sources in attachment order: ${H.join("; ")}. Each sketch shows the intended layout of a new view.`);return{...$,directives:Q}}function LF({queryClient:$,workspaceId:J,sessionId:Z,parts:H}){let B=`optimistic:${crypto.randomUUID()}`;return $.setQueryData(w0.events(J,Z),(Q)=>yZ(Q??bZ(),{kind:"turn",turn:{id:B,role:"user",origin:{kind:"user-input"},parts:H,timestamp:new Date().toISOString()}})),E1.getState().setActivity(J,Z,"running"),E1.getState().setError(J,Z,null),B}function VF({queryClient:$,workspaceId:J,sessionId:Z,text:H,filenames:B=[]}){let Q=Yp(H,B);if(!Q)return;$.setQueryData(w0.sessions(J),(X)=>[{sessionId:Z,summary:Q,lastModified:Date.now()},...(X??[]).filter((z)=>z.sessionId!==Z)])}function AF($,J,Z,H){let B=$?.models,Q=!J||!B||B.some((U)=>U.value===J)?J:void 0,X=B?.find((U)=>U.value===Q),z=Z&&(!X||(X.supportedEffortLevels??[]).includes(Z))?Z:void 0,G=H===void 0||!X||X.supportsFastMode?H:!1,Y=Gp&&$?.supportsStreaming?!0:void 0;return{model:Q,effort:z,...G!==void 0?{fastMode:G}:{},stream:Y}}function QZ0($){return $.filter((J)=>J.text.length>0).map((J)=>J.kind==="reasoning"?{type:"reasoning",text:J.text}:{type:"text",text:J.text})}function Fp($){let J=QZ0($?.blocks??[]);if(J.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:J}}var XZ0=bZ();function Kp($){let J=Z5(),Z=s0(),{layout:H}=Y5(),[B,Q]=Q3(),X=B??null,z=z9(J).data,G=jG(J).data,Y=zp($),U=s2((D)=>X?D.activity[`${J}:${X}`]??"idle":"idle"),F=B7(U),K=s2((D)=>X?D.errors[`${J}:${X}`]??null:null),W=UE(J,X),q=W.data??XZ0,N=G!==void 0&&(X===null||W.data!==void 0),V=s2((D)=>D.previews),L=lJ.useMemo(()=>Fp(E_(V,J,X).root),[V,J,X]),A=TG(J,X).data,M=lJ.useCallback((D,w)=>{let R=D.trim(),b=qF(J,X,w);if(!R&&b.length===0)return;let E=X,x=!1;if(!E)E=crypto.randomUUID(),x=!0,Q(E),VF({queryClient:Z,workspaceId:J,sessionId:E,text:R,filenames:b.map((t)=>t.name)});let I=NF(b);if(R)I.push({type:"text",text:R});let S=LF({queryClient:Z,workspaceId:J,sessionId:E,parts:I}),j=A?.model??H.selectedModel,C=A?.effort??H.selectedEffort,k=A?.fastMode??H.selectedFastMode,{model:y,effort:v,fastMode:u,stream:T}=AF(z,j,C,k);if(DX({type:"chat",workspaceId:J,content:R,sessionId:E,isNew:x,optimisticId:S,model:y,effort:v,fastMode:u,stream:T,context:Y(Up(w,b)),...b.length>0?{attachments:b.map((t)=>t.upload.id)}:{}}),_5.getState().markMessageSentFromMoi(J),x)Z.invalidateQueries({queryKey:w0.preview(J)});if(WF(w))E1.getState().clearAttachments(J,X)},[X,J,Z,H.selectedModel,H.selectedEffort,H.selectedFastMode,Y,A?.model,A?.effort,A?.fastMode,Q,z]),_=lJ.useCallback(()=>{if(!X)return;E1.getState().setError(J,X,null)},[X,J]),P=lJ.useCallback(()=>{if(!F||!X)return;DX({type:"stop",workspaceId:J,sessionId:X})},[F,X,J]);return{view:q,chatLoaded:N,previewTurn:L,sessionId:X,processing:F,error:K,send:M,stop:P,selectSession:Q,dismissError:_}}var qp=O(g(),1);var G2=O(g(),1);function Wp({active:$,builderId:J,sessionId:Z,sourceTab:H,workspaceId:B,onEditingStart:Q,onContinueInChat:X}){let z=G2.useRef(`sketch:${J}`),G=G2.useRef(0),Y=G2.useRef(null),U=G2.useRef(null),F=G2.useRef(!0),[K,W]=G2.useState(!1),q=G2.useRef(Q),N=G2.useRef(X);q.current=Q,N.current=X;let V=G2.useCallback((R)=>{if(!F.current)return;if(!R){G.current+=1,Y.current=null,U.current=null,E1.getState().removeAttachment(B,Z,z.current);return}LG({workspaceId:B,sessionId:Z,localId:z.current,purpose:"sketch",sourceTab:H,blob:R})},[Z,H,B]),L=G2.useCallback((R)=>{if(!R)return U.current??Promise.resolve();if(R===Y.current){if(E1.getState().attachments[o2(B,Z)]?.some((I)=>I.localId===z.current&&(I.status==="ready"||I.status==="uploading")))return U.current??Promise.resolve()}Y.current=R;let b=++G.current,E=VG({workspaceId:B,sessionId:Z,localId:z.current,purpose:"sketch",sourceTab:H,blob:R,isCurrent:()=>G.current===b});return U.current=E,E},[Z,H,B]),A=qG({mode:"sketch",onChange:V,onEditingStart:()=>q.current()}),{controls:M}=A,_=G2.useCallback(async()=>{await L(await M.flush())},[M,L]),P=G2.useCallback(async()=>{await L(await M.deactivate())},[M,L]),D=G2.useCallback(async()=>{if(K)return;W(!0);try{await P(),N.current()}finally{W(!1)}},[K,P]),w=G2.useCallback(async()=>{F.current=!1,G.current+=1,Y.current=null,U.current=null,E1.getState().removeAttachment(B,Z,z.current);try{await M.cancel()}finally{F.current=!0}},[M,Z,B]);return G2.useEffect(()=>{if(!$&&M.active)P()},[$,M.active,P]),{...A,continuing:K,continueInChat:D,prepareForSend:_,resetDocument:w}}var F5=O(c(),1);function Np({ref:$,active:J,builder:Z,chatDocked:H,workspaceId:B,onEditingStart:Q,onContinueInChat:X,onOpenChat:z,onDiscard:G}){let Y=Wp({active:J&&Z.status==="draft",builderId:Z.id,sessionId:Z.sessionId,sourceTab:w3(Z.id),workspaceId:B,onEditingStart:Q,onContinueInChat:X});switch(qp.useImperativeHandle($,()=>({prepareSketchForSend:Y.prepareForSend,resetSketch:Y.resetDocument}),[Y.prepareForSend,Y.resetDocument]),Z.status){case"ready":return null;case"draft":case"waiting":case"building":return F5.jsx(zZ0,{active:J,chatDocked:H,error:Z.error,sketch:Y,status:Z.status,onDiscard:G,onOpenChat:z})}}function zZ0({active:$,chatDocked:J,error:Z,sketch:H,status:B,onDiscard:Q,onOpenChat:X}){let z=B==="draft";return F5.jsxs("div",{className:s("relative min-h-0 flex-1 overflow-hidden bg-background",$?"flex":"hidden"),children:[z&&F5.jsx(GZ0,{chatDocked:J,sketch:H}),F5.jsx("div",{inert:z?void 0:!0,className:s("absolute inset-0",B==="building"&&"pointer-events-none opacity-50",B==="waiting"&&"invisible"),children:F5.jsx(KG,{...H.layerProps,children:z&&F5.jsx(NG,{controls:H.controls,title:"Sketch the view",busy:H.continuing,onComplete:()=>void H.continueInChat()})})}),F5.jsx("div",{"aria-hidden":!0,className:s("pointer-events-none absolute inset-0 transition-shadow duration-500 ease-in-out",B==="building"&&"animate-glow texture-inset-shadow-50% motion-reduce:animate-none")}),B==="building"&&F5.jsx(UZ0,{controls:H.controls}),B==="waiting"&&F5.jsx(YZ0,{error:Z,onDiscard:Q,onOpenChat:X})]})}function GZ0({chatDocked:$,sketch:J}){let{hasStrokes:Z}=wH(J.controls);return F5.jsx("div",{ref:J.targetRef,className:"absolute inset-0 flex items-center justify-center texture-checker-20",children:!J.controls.active&&!Z&&F5.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:[F5.jsx(gH,{size:56,stroke:0.5}),F5.jsx("span",{className:"max-w-32",children:"Sketch how the view should look"})]})})}function YZ0({error:$,onDiscard:J,onOpenChat:Z}){return F5.jsx(Lp,{children:F5.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:[F5.jsxs("div",{className:"flex flex-col gap-1",children:[F5.jsx("h1",{className:"font-medium",children:"The view needs your attention"}),F5.jsx("p",{className:"text-sm text-muted-foreground",children:$??"Open the chat to answer or ask the agent to continue"})]}),F5.jsxs("div",{className:"flex gap-2",children:[F5.jsx(C0,{onClick:Z,children:"Open chat"}),F5.jsx(C0,{variant:"secondary",onClick:J,children:"Discard view"})]})]})})}function UZ0({controls:$}){let{hasStrokes:J}=wH($);return F5.jsx(Lp,{children:!J&&F5.jsx(E4,{className:"size-6 text-muted-foreground"})})}function Lp({children:$,className:J}){return F5.jsx("div",{className:s("relative flex min-h-0 flex-1 items-center justify-center texture-checker-20",J),children:$})}var P4=O(g(),1);function Vp($,{activeId:J,available:Z,now:H}){let B=[];if(J!==null&&Z.has(J))B.push({id:J,releasedAt:null});for(let Q of $){if(Q.id===J||!Z.has(Q.id))continue;let X=Q.releasedAt??H;if(H-X>=60000)continue;if(B.length>=4)break;B.push({id:Q.id,releasedAt:X})}return B}function Ap($,J){let Z=null;for(let{releasedAt:H}of $){if(H===null)continue;let B=H+60000;if(Z===null||B<Z)Z=B}return Z===null?null:Math.max(0,Z-J)}function Dp($,J){return $.length===J.length&&$.every((Z,H)=>{let B=J[H];return Z.id===B.id&&Z.releasedAt===B.releasedAt})}var j2=O(c(),1);function Pp({views:$,activeViewId:J,params:Z}){let H=FZ0(J,$),B=new Set(H.map((Q)=>Q.id));return j2.jsx("div",{className:s("relative min-h-0 flex-1 overflow-hidden",!J&&"hidden"),children:$.filter((Q)=>B.has(Q.id)).map((Q)=>j2.jsx(KZ0,{view:Q,active:Q.id===J,params:Z},Q.id))})}function FZ0($,J){let[Z,H]=P4.useState([]),B=P4.useRef(J);B.current=J;let Q=J.map((z)=>z.id).join(`
|
|
83
|
+
`),X=P4.useCallback(()=>{H((z)=>{let G=Vp(z,{activeId:$,available:new Set(B.current.map((Y)=>Y.id)),now:Date.now()});return Dp(z,G)?z:G})},[$]);return P4.useEffect(()=>{X()},[Q,X]),P4.useEffect(()=>{let z=Ap(Z,Date.now());if(z===null)return;let G=setTimeout(X,z);return()=>clearTimeout(G)},[X,Z]),Z}function KZ0({view:$,active:J,params:Z}){let H=Z5(),B=Xw($.id),{current:Q,outgoing:X}=qZ0(B,J),[z,G]=P4.useState(Z);if(J&&z!==Z)G(Z);xU(GG("views",H,$.id),Q?.version??B.version,J);let Y=B.status==="error";return yU({kind:"view",enabled:J&&Boolean(Q)&&!Y,targets:[{id:$.id,revision:$.revision}]}),j2.jsxs(j2.Fragment,{children:[J&&Y&&j2.jsx("p",{className:"absolute inset-0 p-4 text-xs text-destructive",children:B.error}),J&&!Y&&!Q&&j2.jsx(NZ0,{}),Q&&!Y&&j2.jsxs(P4.Activity,{mode:J?"visible":"hidden",children:[X&&j2.jsx(Mp,{view:$,build:X,params:z},X.version),j2.jsx(Mp,{view:$,build:Q,params:z,entering:X!==null,thumbnailTarget:!0},Q.version)]})]})}function Mp({view:$,build:J,params:Z,entering:H,thumbnailTarget:B}){let Q=Z5();return j2.jsx("div",{"data-applet-thumbnail":B?`view:${$.id}`:void 0,"data-applet":YG("views",$.id),className:s("absolute inset-0 isolate overflow-auto",H&&"animate-in duration-200 ease-out blur-in-4 fade-in"),children:j2.jsx(DB,{name:$.id,kind:"view",workspaceId:Q,resetKey:J.version,children:j2.jsx(J.Component,{params:Z})})})}var WZ0=200;function qZ0($,J){let[Z,H]=P4.useState({current:null,outgoing:null});if($.status==="ready"&&Z.current?.version!==$.version){let B={Component:$.Component,version:$.version};H((Q)=>({current:B,outgoing:J?Q.current:null}))}return P4.useEffect(()=>{if(!Z.outgoing)return;let B=setTimeout(()=>H((Q)=>({...Q,outgoing:null})),WZ0);return()=>clearTimeout(B)},[Z.outgoing]),Z}function NZ0(){return j2.jsx("div",{className:"absolute inset-0 flex animate-in items-center justify-center delay-150 duration-200 fill-mode-both fade-in",children:j2.jsx(E4,{className:"text-muted-foreground"})})}function _p(){let $=s0(),{workspaceId:J,layout:Z}=Y5(),[,H]=Q3(),B=z9(J).data,Q=Jp(J),X=Zp(J),z=Hp(J),G=Bp(J);return{create:()=>Q.mutateAsync(),save:(W,q)=>X.mutateAsync({builderId:W,requirements:q}),submit:async(W,q)=>{let N=q.trim(),V=qF(J,W.sessionId);if(!N&&V.length===0)return;VF({queryClient:$,workspaceId:J,sessionId:W.sessionId,text:N,filenames:V.map((w)=>w.name)});let L=NF(V);if(N)L.push({type:"text",text:N});let A=LF({queryClient:$,workspaceId:J,sessionId:W.sessionId,parts:L});H(W.sessionId);let{model:M,effort:_,fastMode:P,stream:D}=AF(B,Z.selectedModel,Z.selectedEffort,Z.selectedFastMode);try{await z.mutateAsync({builderId:W.id,requirements:N,optimisticId:A,...V.length>0?{attachments:V.map((w)=>w.upload.id)}:{},model:M,effort:_,fastMode:P,stream:D}),E1.getState().clearAttachments(J,W.sessionId)}catch(w){throw E1.getState().setActivity(J,W.sessionId,"idle"),E1.getState().setError(J,W.sessionId,w instanceof Error?w.message:"Could not start view builder"),w}},discard:(W)=>G.mutateAsync(W)}}var A9=O(g(),1);function Op({builders:$,onSave:J}){let Z=A9.useRef(new Map),H=A9.useRef($),B=A9.useRef(J);H.current=$,B.current=J;let Q=A9.useCallback((z)=>{let G=Z.current.get(z);if(G)clearTimeout(G);Z.current.delete(z),_5.getState().setViewBuilderDraft(z,null)},[]),X=A9.useCallback((z,G)=>{_5.getState().setViewBuilderDraft(z,G);let Y=Z.current.get(z);if(Y)clearTimeout(Y);Z.current.set(z,setTimeout(()=>{Z.current.delete(z);let U=H.current.find((F)=>F.id===z);if(!U||U.status!=="draft")return;B.current(z,G).catch(()=>{i4.add({title:"Couldn’t save view description",type:"error"})})},500))},[]);return A9.useEffect(()=>{for(let z of $)if(z.status!=="draft")Q(z.id)},[$,Q]),A9.useEffect(()=>()=>{for(let z of Z.current.values())clearTimeout(z)},[]),{change:X,clear:Q}}var iJ=O(g(),1);function CA($){let J=document.documentElement,Z=getComputedStyle(J).getPropertyValue($).trim(),H=Number.parseFloat(Z);if(!Number.isFinite(H))return 0;return Z.endsWith("rem")?H*Number.parseFloat(getComputedStyle(J).fontSize):H}function jp(){let $=iJ.useRef(null),[J,Z]=iJ.useState(null);return iJ.useLayoutEffect(()=>{let H=$.current;if(!H)return;let B=(X)=>{let z=CA("--column-w"),G=CA("--chat-min"),Y=CA("--chat-max"),U={fits:X-G>=z,workspaceMinWidth:z,chatMinWidth:G,chatMaxWidth:Y};Z((F)=>F?.fits===U.fits&&F.workspaceMinWidth===U.workspaceMinWidth&&F.chatMinWidth===U.chatMinWidth&&F.chatMaxWidth===U.chatMaxWidth?F:U)};B(H.getBoundingClientRect().width);let Q=()=>B(H.getBoundingClientRect().width);return window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)},[]),{ref:$,fits:J?.fits??!1,constraints:J?{workspaceMinWidth:J.workspaceMinWidth,chatMinWidth:J.chatMinWidth,chatMaxWidth:J.chatMaxWidth}:null}}var Tp=O(c(),1);function wA({agentUnavailable:$,chatError:J,skillUpdate:Z}){return $??J??Z}function w6({className:$,...J}){return Tp.jsx("div",{...J,className:s("w-full p-2 text-sm @xl:p-1 @xl:pl-3",$)})}var rJ=O(c(),1);function Cp({error:$,onDismiss:J}){return rJ.jsxs(w6,{role:"alert",className:"flex items-center gap-2 text-destructive",children:[rJ.jsx("span",{className:"flex-1 wrap-break-word",children:$}),rJ.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:J,className:"text-destructive hover:text-destructive","aria-label":"Dismiss error",children:rJ.jsx(w5,{stroke:1.75})})]})}var fB=O(g(),1);var d9=O(c(),1);function Ep({availability:$,login:J,onStartLogin:Z}){let[H,B]=fB.useState("idle"),[Q,X]=fB.useState(null);fB.useEffect(()=>{if(J?.state!=="pending")B("idle")},[J?.state]);let z=J?.state==="pending"||H==="waiting",G=J?.state==="failed"?J.reason:null,Y=z||H==="starting",U=async()=>{let F=window.open("about:blank","moi-agent-login");if(F)F.opener=null;B("starting"),X(null);try{let K=await Z();if(K.url){if(!F)throw Error("Allow pop-ups, then try again");F.location.href=K.url}else F?.close();B("waiting")}catch(K){F?.close(),B("idle"),X(K instanceof Error?K.message:"Could not start sign-in")}};return d9.jsxs(w6,{role:"alert",className:"flex items-center gap-2",children:[d9.jsx(wp,{size:20,stroke:1.5}),d9.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[d9.jsx("div",{className:"wrap-break-word",children:"Log in to your agent to send messages"}),(Q??G)&&d9.jsx("div",{className:"wrap-break-word text-destructive",children:Q??G})]}),$.loginCommand&&d9.jsxs(C0,{type:"button",size:"sm",onClick:()=>void U(),disabled:Y,children:[Y&&d9.jsx(E5,{stroke:1.75,className:"animate-spin"}),H==="starting"?"Opening browser to sign in…":z?"Waiting for log in…":"Log in"]})]})}var T2=O(c(),1);function Ip({error:$,pendingAction:J,onUpdate:Z,onDismiss:H}){if(!$&&J==="auto")return T2.jsxs(w6,{role:"status",className:"flex items-center gap-1.5 text-muted-foreground",children:[T2.jsx(E5,{size:20,stroke:1.5,className:"shrink-0 animate-spin"}),T2.jsx("span",{className:"wrap-break-word",children:"Updating moi skills…"})]});let B=J!==null;return T2.jsxs(w6,{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:[T2.jsxs("div",{className:"flex min-w-0 items-start gap-1.5 @xl:order-1 @xl:flex-1 @xl:items-center",children:[T2.jsx(Sp,{size:20,stroke:1.5,className:"shrink-0"}),$?T2.jsx("span",{className:"wrap-break-word",children:`Update failed: ${$}`}):T2.jsx("span",{className:"wrap-break-word",children:"This workspace is using old moi skills"})]}),T2.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:H,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:T2.jsx(w5,{stroke:1.75})}),T2.jsxs("div",{className:"col-span-2 flex flex-wrap gap-1.5 @xl:contents",children:[T2.jsxs(C0,{type:"button",variant:"default",size:"sm",onClick:()=>Z("auto"),disabled:B,className:"@xl:order-2",children:[J==="auto"&&T2.jsx(E5,{stroke:1.75,className:"animate-spin"}),J==="auto"?"Updating…":"Auto-update"]}),T2.jsxs(C0,{type:"button",variant:"secondary",size:"sm",onClick:()=>Z("once"),disabled:B,className:"@xl:order-3",children:[J==="once"&&T2.jsx(E5,{stroke:1.75,className:"animate-spin"}),J==="once"?"Updating…":"Update once"]})]})]})}var B$=O(g(),1);function EA($){return{workspaceId:$,phase:"idle",pendingAction:null,error:null}}function LZ0($){return $.phase==="active"||$.phase==="idle"&&$.updateAvailable&&!$.autoUpdateEnabled}function VZ0($){return $.updateAvailable&&$.autoUpdateEnabled&&!$.updatePending&&$.phase==="idle"}function Rp($){let J=Uw($),{isPending:Z,mutate:H,reset:B}=Fw($),Q=fg(),{mutate:X}=mg(),z=Q.data!==void 0,G=Q.data?.autoUpdateSkills??!1,Y=B$.useCallback(()=>X({autoUpdateSkills:!0}),[X]),[U,F]=B$.useState(()=>EA($)),K=U.workspaceId===$?U:EA($);B$.useEffect(()=>{F(EA($)),B()},[$,B]);let W=B$.useCallback((V)=>{if(Z)return;if(V==="auto")Y();F({workspaceId:$,phase:"active",pendingAction:V,error:null}),H(void 0,{onSuccess:()=>{F((L)=>L.workspaceId===$?{...L,phase:"dismissed",pendingAction:null,error:null}:L)},onError:(L)=>{F((A)=>A.workspaceId===$&&A.phase!=="dismissed"?{...A,phase:"active",pendingAction:null,error:L.message}:A)}})},[Y,Z,H,$]),q=J.data?.updateAvailable??!1;return B$.useEffect(()=>{if(z&&VZ0({updateAvailable:q,autoUpdateEnabled:G,updatePending:Z,phase:K.phase}))W("auto")},[G,K.phase,W,z,q,Z]),{bannerProps:z&&LZ0({updateAvailable:q,autoUpdateEnabled:G,phase:K.phase})?{error:K.error,pendingAction:K.pendingAction,onUpdate:W,onDismiss:()=>{F((V)=>V.workspaceId===$?{...V,phase:"dismissed",pendingAction:null,error:null}:V)}}:null}}var DF=O(c(),1);function kp($,{chatError:J,onDismissChatError:Z}){let{data:H,error:B}=z9($),Q=H?.availability,{bannerProps:X}=Rp($),z=Q?.available===!1?Q:void 0;if(B)z={available:!1,reason:`Could not check agent status: ${B.message}`};let G={status:"checking"};if(z)G={status:"unavailable"};else if(Q)G={status:"available"};let Y=z?{tone:"default",content:DF.jsx(Ep,{availability:z,login:H?.login,onStartLogin:()=>Yw($)})}:void 0,U=J?{tone:"error",content:DF.jsx(Cp,{error:J,onDismiss:Z})}:void 0,F=X?{tone:"default",content:DF.jsx(Ip,{...X})}:void 0,K=wA({agentUnavailable:Y,chatError:U,skillUpdate:F}),W=wA({agentUnavailable:Y,skillUpdate:F});return{composerAvailability:G,composerBanner:K,builderComposerBanner:W}}var SA=Cq();function MF($){if(!$||!Array.isArray($.open))return SA;let J=$.open.filter((Z,H,B)=>B.indexOf(Z)===H);if(J.length===0)return SA;return{open:J,active:J.includes($.active)?$.active:J[0]}}function mB($,J,Z){if($==="agent"||$==="widgets"||$==="scratchpad")return!0;let H=J6($);if(H)return Z.some((Q)=>Q.id===H);let B=C3($);return B?J.some((Q)=>Q.id===B):!1}function PF($,J,Z){let H=$.open.filter((B)=>mB(B,J,Z));return H.length>0?H:SA.open}function bp($){if(!$)return!1;let J=TH($);return J===null||C3(J)!==null}function yp($,J,Z,H,B){if($!==null&&mB($,Z,H)&&!(B&&$==="agent"))return $;let Q=PF(J,Z,H),X=B?Q.filter((z)=>z!=="agent"):Q;return X.includes(J.active)?J.active:X[0]??"agent"}var D9=O(g(),1);function hp({views:$,builders:J,split:Z}){let{layout:H,setLayout:B,workspaceId:Q}=Y5(),[,X]=m4(),z=nF()["*"]??null,G=ID(),Y=D9.useMemo(()=>oC(G),[G]),U=MF(H.tabs),F=D9.useRef(U);F.current=U;let K=TH(z),W=yp(K,U,$,J,Z),q=K!==null&&K===W,N=D9.useCallback((L,A)=>{X(nC(Q,L),{replace:!0,...A?{state:{appletParams:A}}:{}})},[X,Q]),V=D9.useCallback((L)=>{F.current=L,B({tabs:L})},[B]);return D9.useEffect(()=>{if(z===W)return;if(bp(z))AZ0(Q,z,W);N(W)},[W,N,z,Q]),D9.useEffect(()=>{if(!q)return;let L=F.current,A=L.open.includes(W)?L.open:[...L.open,W];if(A===L.open&&L.active===W)return;V({open:A,active:W})},[W,V,q]),{tabsState:U,activeTab:W,appletParams:Y,navigateToTab:N,setTabs:V}}function AZ0($,J,Z){let H=TH(J),B=H?C3(H):null;V8($,{source:"runtime",...B?{kind:"view",name:B}:{},message:`Tab "${J}" does not exist in this workspace — the URL redirected to "${Z}". A link, bookmark, or focusTab call is pointing at a tab that was deleted or renamed.`})}var K5=O(c(),1),DZ0=vp([g$({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 MZ0({items:$}){return K5.jsxs(n7,{children:[K5.jsx(o7,{render:K5.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:K5.jsx(F4,{stroke:1.75})})}),K5.jsx(s7,{align:"start",className:"min-w-48",children:K5.jsx(t7,{children:$.map(({key:J,Icon:Z,label:H,onClick:B})=>K5.jsxs(kH,{onClick:B,className:"font-medium",children:[K5.jsx(Z,{stroke:2}),H]},J))})})]})}function xp($){let{tab:J,active:Z}=$,H=$.preview===!0;return K5.jsxs("button",{type:"button","aria-hidden":H||void 0,"aria-label":J.label,disabled:H,tabIndex:H?-1:void 0,onClick:$.preview?void 0:()=>$.onSelect(J.key),className:DZ0({active:Z,dragging:$.preview?!1:$.state.isDragging,preview:H}),...$.preview?{}:$.state.dragHandleProps,children:[K5.jsxs("div",{className:s("flex items-center gap-1 overflow-hidden select-none",J.closable&&"group-hover/tab:mr-3"),children:[J.Icon===S3?K5.jsx(S3,{"data-icon":"inline-start",stroke:2,animated:J.loading}):J.loading?K5.jsx(E4,{"data-icon":"inline-start"}):K5.jsx(J.Icon,{"data-icon":"inline-start",stroke:2}),K5.jsx("span",{className:s("truncate",J.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:J.label})]}),J.closable&&K5.jsx("div",{"aria-label":`Close ${J.label}`,tabIndex:H?-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",H&&"pointer-events-none"),onClick:$.preview?void 0:(B)=>{B.stopPropagation(),$.onClose(J.key)},children:K5.jsx(w5,{stroke:1.75})})]})}function gp({tabs:$,active:J,createItems:Z,onSelect:H,onClose:B,onReorder:Q}){return K5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[K5.jsx("div",{className:"no-scrollbar min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:K5.jsx(Xz,{items:$,getId:(X)=>X.key,className:"flex w-max items-center gap-1",onReorder:(X)=>Q(X),renderPlaceholder:()=>K5.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-md bg-muted"}),renderOverlay:(X)=>K5.jsx(xp,{tab:X,active:J===X.key,preview:!0}),renderItem:(X,z)=>K5.jsx(xp,{tab:X,active:J===X.key,state:z,onSelect:H,onClose:B})})}),K5.jsx("div",{className:"shrink-0",children:K5.jsx(MZ0,{items:Z})})]})}var z$=O(g(),1);var tJ=O(c(),1),V1=O(g(),1);function PZ0($,J){let Z=getComputedStyle($),H=parseFloat(Z.fontSize);return J*H}function _Z0($,J){let Z=getComputedStyle($.ownerDocument.documentElement),H=parseFloat(Z.fontSize);return J*H}function OZ0($){return $/100*window.innerHeight}function jZ0($){return $/100*window.innerWidth}function TZ0($){switch(typeof $){case"number":return[$,"px"];case"string":{let J=parseFloat($);return $.endsWith("%")?[J,"%"]:$.endsWith("px")?[J,"px"]:$.endsWith("rem")?[J,"rem"]:$.endsWith("em")?[J,"em"]:$.endsWith("vh")?[J,"vh"]:$.endsWith("vw")?[J,"vw"]:[J,"%"]}}}function pB({groupSize:$,panelElement:J,styleProp:Z}){let H,[B,Q]=TZ0(Z);switch(Q){case"%":{H=B/100*$;break}case"px":{H=B;break}case"rem":{H=_Z0(J,B);break}case"em":{H=PZ0(J,B);break}case"vh":{H=OZ0(B);break}case"vw":{H=jZ0(B);break}}return H}function Q4($){return parseFloat($.toFixed(3))}function eJ({group:$}){let{orientation:J,panels:Z}=$;return Z.reduce((H,B)=>(H+=J==="horizontal"?B.element.offsetWidth:B.element.offsetHeight,H),0)}function RA($){let{panels:J}=$,Z=eJ({group:$});return Z===0?J.map((H)=>({groupResizeBehavior:H.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:H.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:H.panelConstraints.disabled,minSize:0,maxSize:100,panelId:H.id})):J.map((H)=>{let{element:B,panelConstraints:Q}=H,X=0;if(Q.collapsedSize!==void 0){let U=pB({groupSize:Z,panelElement:B,styleProp:Q.collapsedSize});X=Q4(U/Z*100)}let z;if(Q.defaultSize!==void 0){let U=pB({groupSize:Z,panelElement:B,styleProp:Q.defaultSize});z=Q4(U/Z*100)}let G=0;if(Q.minSize!==void 0){let U=pB({groupSize:Z,panelElement:B,styleProp:Q.minSize});G=Q4(U/Z*100)}let Y=100;if(Q.maxSize!==void 0){let U=pB({groupSize:Z,panelElement:B,styleProp:Q.maxSize});Y=Q4(U/Z*100)}return{groupResizeBehavior:Q.groupResizeBehavior,collapsedSize:X,collapsible:Q.collapsible===!0,defaultSize:z,disabled:Q.disabled,minSize:G,maxSize:Y,panelId:H.id}})}function Q5($,J="Assertion error"){if(!$)throw Error(J)}function kA($,J){return Array.from(J).sort($==="horizontal"?CZ0:wZ0)}function CZ0($,J){let Z=$.element.offsetLeft-J.element.offsetLeft;return Z!==0?Z:$.element.offsetWidth-J.element.offsetWidth}function wZ0($,J){let Z=$.element.offsetTop-J.element.offsetTop;return Z!==0?Z:$.element.offsetHeight-J.element.offsetHeight}function Zu($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.ELEMENT_NODE}function Hu($,J){return{x:$.x>=J.left&&$.x<=J.right?0:Math.min(Math.abs($.x-J.left),Math.abs($.x-J.right)),y:$.y>=J.top&&$.y<=J.bottom?0:Math.min(Math.abs($.y-J.top),Math.abs($.y-J.bottom))}}function EZ0({orientation:$,rects:J,targetRect:Z}){let H={x:Z.x+Z.width/2,y:Z.y+Z.height/2},B,Q=Number.MAX_VALUE;for(let X of J){let{x:z,y:G}=Hu(H,X),Y=$==="horizontal"?z:G;Y<Q&&(Q=Y,B=X)}return Q5(B,"No rect found"),B}var _F;function SZ0(){return _F===void 0&&(typeof matchMedia=="function"?_F=!!matchMedia("(pointer:coarse)").matches:_F=!1),_F}function Bu($){let{element:J,orientation:Z,panels:H,separators:B}=$,Q=kA(Z,Array.from(J.children).filter(Zu).map((q)=>({element:q}))).map(({element:q})=>q),X=[],z=!1,G=!1,Y=-1,U=-1,F=0,K,W=[];{let q=-1;for(let N of Q)N.hasAttribute("data-panel")&&(q++,N.hasAttribute("data-disabled")||(F++,Y===-1&&(Y=q),U=q))}if(F>1){let q=-1;for(let N of Q)if(N.hasAttribute("data-panel")){q++;let V=H.find((L)=>L.element===N);if(V){if(K){let L=K.element.getBoundingClientRect(),A=N.getBoundingClientRect(),M;if(G){let _=Z==="horizontal"?new DOMRect(L.right,L.top,0,L.height):new DOMRect(L.left,L.bottom,L.width,0),P=Z==="horizontal"?new DOMRect(A.left,A.top,0,A.height):new DOMRect(A.left,A.top,A.width,0);switch(W.length){case 0:{M=[_,P];break}case 1:{let D=W[0],w=EZ0({orientation:Z,rects:[L,A],targetRect:D.element.getBoundingClientRect()});M=[D,w===L?P:_];break}default:{M=W;break}}}else W.length?M=W:M=[Z==="horizontal"?new DOMRect(L.right,A.top,A.left-L.right,A.height):new DOMRect(A.left,L.bottom,A.width,A.top-L.bottom)];for(let _ of M){let P="width"in _?_:_.element.getBoundingClientRect(),D=SZ0()?$.resizeTargetMinimumSize.coarse:$.resizeTargetMinimumSize.fine;if(P.width<D){let R=D-P.width;P=new DOMRect(P.x-R/2,P.y,P.width+R,P.height)}if(P.height<D){let R=D-P.height;P=new DOMRect(P.x,P.y-R/2,P.width,P.height+R)}let w=q<=Y||q>U;!z&&!w&&X.push({group:$,groupSize:eJ({group:$}),panels:[K,V],separator:"width"in _?void 0:_,rect:P}),z=!1}}G=!1,K=V,W=[]}}else if(N.hasAttribute("data-separator")){N.ariaDisabled!==null&&(z=!0);let V=B.find((L)=>L.element===N);V?W.push(V):(K=void 0,W=[])}else G=!0}return X}class bA{#$={};addListener($,J){let Z=this.#$[$];return Z===void 0?this.#$[$]=[J]:Z.includes(J)||Z.push(J),()=>{this.removeListener($,J)}}emit($,J){let Z=this.#$[$];if(Z!==void 0)if(Z.length===1)Z[0].call(null,J);else{let H=!1,B=null,Q=Array.from(Z);for(let X=0;X<Q.length;X++){let z=Q[X];try{z.call(null,J)}catch(G){B===null&&(H=!0,B=G)}}if(H)throw B}}removeAllListeners(){this.#$={}}removeListener($,J){let Z=this.#$[$];if(Z!==void 0){let H=Z.indexOf(J);H>=0&&Z.splice(H,1)}}}var oJ={cursorFlags:0,state:"inactive"},yA=new bA;function S6(){return oJ}function IZ0($){return yA.addListener("change",$)}function RZ0($){let J=oJ,Z={...oJ};Z.cursorFlags=$,oJ=Z,yA.emit("change",{prev:J,next:Z})}function sJ($){let J=oJ;oJ=$,yA.emit("change",{prev:J,next:$})}var kZ0=($)=>$,IA=()=>{},Qu=1,Xu=2,zu=4,Gu=8,fp=3,mp=12,OF;function pp(){return OF===void 0&&(OF=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(OF=!0)),OF}function bZ0({cursorFlags:$,groups:J,state:Z}){let H=0,B=0;switch(Z){case"active":case"hover":J.forEach((Q)=>{if(!Q.mutableState.disableCursor)switch(Q.orientation){case"horizontal":{H++;break}case"vertical":{B++;break}}})}if(!(H===0&&B===0)){switch(Z){case"active":{if($&&pp()){let Q=($&Qu)!==0,X=($&Xu)!==0,z=($&zu)!==0,G=($&Gu)!==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 pp()?H>0&&B>0?"move":H>0?"ew-resize":"ns-resize":H>0&&B>0?"grab":H>0?"col-resize":"row-resize"}}var up=new WeakMap;function hA($){if($.defaultView===null||$.defaultView===void 0)return;let{prevStyle:J,styleSheet:Z}=up.get($)??{};Z===void 0&&(Z=new $.defaultView.CSSStyleSheet,$.adoptedStyleSheets&&(Object.isExtensible($.adoptedStyleSheets)?$.adoptedStyleSheets.push(Z):$.adoptedStyleSheets=[...$.adoptedStyleSheets,Z]));let H=S6();switch(H.state){case"active":case"hover":{let B=bZ0({cursorFlags:H.cursorFlags,groups:H.hitRegions.map((X)=>X.group),state:H.state}),Q=`*, *:hover {cursor: ${B} !important; }`;if(J===Q)return;J=Q,B?Z.cssRules.length===0?Z.insertRule(Q):Z.replaceSync(Q):Z.cssRules.length===1&&Z.deleteRule(0);break}case"inactive":{J=void 0,Z.cssRules.length===1&&Z.deleteRule(0);break}}up.set($,{prevStyle:J,styleSheet:Z})}var P9=new Map,Yu=new bA;function yZ0($){P9=new Map(P9),P9.delete($)}function cp($,J){for(let[Z]of P9)if(Z.id===$)return Z}function Q$($,J){for(let[Z,H]of P9)if(Z.id===$)return H;if(J)throw Error(`Could not find data for Group with id ${$}`)}function k6(){return P9}function xA($,J){return Yu.addListener("groupChange",(Z)=>{Z.group.id===$&&J(Z)})}function l9($,J,Z){let H=P9.get($);P9=new Map(P9),P9.set($,J),Yu.emit("groupChange",{group:$,isUserInteraction:Z?.isUserInteraction===!0,prev:H,next:J})}function Uu($){let J=S6(),Z=!1;switch(J.state){case"active":sJ({cursorFlags:0,state:"inactive"}),J.hitRegions.length>0&&(hA($),Z=!0,J.hitRegions.forEach((H)=>{let B=Q$(H.group.id,!0);l9(H.group,B,{isUserInteraction:!0})}))}return Z}function dp($){$.defaultPrevented||Uu($.currentTarget)}function hZ0($,J,Z){let H,B={x:1/0,y:1/0};for(let Q of J){let X=Hu(Z,Q.rect);switch($){case"horizontal":{X.x<=B.x&&(H=Q,B=X);break}case"vertical":{X.y<=B.y&&(H=Q,B=X);break}}}return H?{distance:B,hitRegion:H}:void 0}function xZ0($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function vZ0($,J){if($===J)throw Error("Cannot compare node with itself");let Z={a:rp($),b:rp(J)},H;for(;Z.a.at(-1)===Z.b.at(-1);)H=Z.a.pop(),Z.b.pop();Q5(H,"Stacking order can only be calculated for elements with a common ancestor");let B={a:ip(lp(Z.a)),b:ip(lp(Z.b))};if(B.a===B.b){let Q=H.childNodes,X={a:Z.a.at(-1),b:Z.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(B.a-B.b)}var gZ0=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function fZ0($){let J=getComputedStyle(Fu($)??$).display;return J==="flex"||J==="inline-flex"}function mZ0($){let J=getComputedStyle($);return!!(J.position==="fixed"||J.zIndex!=="auto"&&(J.position!=="static"||fZ0($))||+J.opacity<1||("transform"in J)&&J.transform!=="none"||("webkitTransform"in J)&&J.webkitTransform!=="none"||("mixBlendMode"in J)&&J.mixBlendMode!=="normal"||("filter"in J)&&J.filter!=="none"||("webkitFilter"in J)&&J.webkitFilter!=="none"||("isolation"in J)&&J.isolation==="isolate"||gZ0.test(J.willChange)||J.webkitOverflowScrolling==="touch")}function lp($){let J=$.length;for(;J--;){let Z=$[J];if(Q5(Z,"Missing node"),mZ0(Z))return Z}return null}function ip($){return $&&Number(getComputedStyle($).zIndex)||0}function rp($){let J=[];for(;$;)J.push($),$=Fu($);return J}function Fu($){let{parentNode:J}=$;return xZ0(J)?J.host:J}function pZ0($,J){return $.x<J.x+J.width&&$.x+$.width>J.x&&$.y<J.y+J.height&&$.y+$.height>J.y}function uZ0({groupElement:$,hitRegion:J,pointerEventTarget:Z}){if(!Zu(Z)||Z.contains($)||$.contains(Z))return!0;if(vZ0(Z,$)>0){let H=Z;for(;H;){if(H.contains($))return!0;if(pZ0(H.getBoundingClientRect(),J))return!1;H=H.parentElement}}return!0}function vA($,J){let Z=[];return J.forEach((H,B)=>{if(B.disabled)return;let Q=Bu(B),X=hZ0(B.orientation,Q,{x:$.clientX,y:$.clientY});X&&X.distance.x<=0&&X.distance.y<=0&&uZ0({groupElement:B.element,hitRegion:X.hitRegion.rect,pointerEventTarget:$.target})&&Z.push(X.hitRegion)}),Z}function cZ0($,J){if($.length!==J.length)return!1;for(let Z=0;Z<$.length;Z++)if($[Z]!=J[Z])return!1;return!0}function d2($,J,Z=0){return Math.abs(Q4($)-Q4(J))<=Z}function M9($,J){return d2($,J)?0:$>J?1:-1}function nJ({overrideDisabledPanels:$,panelConstraints:J,prevSize:Z,size:H}){let{collapsedSize:B=0,collapsible:Q,disabled:X,maxSize:z=100,minSize:G=0}=J;if(X&&!$)return Z;if(M9(H,G)<0)if(Q){let Y=(B+G)/2;M9(H,Y)<0?H=B:H=G}else H=G;return H=Math.min(z,H),H=Q4(H),H}function cB({delta:$,initialLayout:J,panelConstraints:Z,pivotIndices:H,prevLayout:B,trigger:Q}){if(d2($,0))return J;let X=Q==="imperative-api",z=Object.values(J),G=Object.values(B),Y=[...z],[U,F]=H;Q5(U!=null,"Invalid first pivot index"),Q5(F!=null,"Invalid second pivot index");let K=0;switch(Q){case"keyboard":{{let N=$<0?F:U,V=Z[N];Q5(V,`Panel constraints not found for index ${N}`);let{collapsedSize:L=0,collapsible:A,minSize:M=0}=V;if(A){let _=z[N];if(Q5(_!=null,`Previous layout not found for panel index ${N}`),d2(_,L)){let P=M-_;M9(P,Math.abs($))>0&&($=$<0?0-P:P)}}}{let N=$<0?U:F,V=Z[N];Q5(V,`No panel constraints found for index ${N}`);let{collapsedSize:L=0,collapsible:A,minSize:M=0}=V;if(A){let _=z[N];if(Q5(_!=null,`Previous layout not found for panel index ${N}`),d2(_,M)){let P=_-L;M9(P,Math.abs($))>0&&($=$<0?0-P:P)}}}break}default:{let N=$<0?F:U,V=Z[N];Q5(V,`Panel constraints not found for index ${N}`);let L=z[N],{collapsible:A,collapsedSize:M,minSize:_}=V;if(A&&M9(L,_)<0)if($>0){let P=_-M,D=P/2,w=L+$;M9(w,_)<0&&($=M9($,D)<=0?0:P)}else{let P=_-M,D=100-P/2,w=L-$;M9(w,_)<0&&($=M9(100+$,D)>0?0:-P)}break}}{let N=$<0?1:-1,V=$<0?F:U,L=0;for(;;){let M=z[V];Q5(M!=null,`Previous layout not found for panel index ${V}`);let _=nJ({overrideDisabledPanels:X,panelConstraints:Z[V],prevSize:M,size:100})-M;if(L+=_,V+=N,V<0||V>=Z.length)break}let A=Math.min(Math.abs($),Math.abs(L));$=$<0?0-A:A}{let N=$<0?U:F;for(;N>=0&&N<Z.length;){let V=Math.abs($)-Math.abs(K),L=z[N];Q5(L!=null,`Previous layout not found for panel index ${N}`);let A=L-V,M=nJ({overrideDisabledPanels:X,panelConstraints:Z[N],prevSize:L,size:A});if(!d2(L,M)&&(K+=L-M,Y[N]=M,K.toFixed(3).localeCompare(Math.abs($).toFixed(3),void 0,{numeric:!0})>=0))break;$<0?N--:N++}}if(cZ0(G,Y))return B;{let N=$<0?F:U,V=z[N];Q5(V!=null,`Previous layout not found for panel index ${N}`);let L=V+K,A=nJ({overrideDisabledPanels:X,panelConstraints:Z[N],prevSize:V,size:L});if(Y[N]=A,!d2(A,L)){let M=L-A,_=$<0?F:U;for(;_>=0&&_<Z.length;){let P=Y[_];Q5(P!=null,`Previous layout not found for panel index ${_}`);let D=P+M,w=nJ({overrideDisabledPanels:X,panelConstraints:Z[_],prevSize:P,size:D});if(d2(P,w)||(M-=w-P,Y[_]=w),d2(M,0))break;$>0?_--:_++}}}let W=Object.values(Y).reduce((N,V)=>V+N,0);if(!d2(W,100,0.1))return B;let q=Object.keys(B);return Y.reduce((N,V,L)=>(N[q[L]]=V,N),{})}function I6($,J){if(Object.keys($).length!==Object.keys(J).length)return!1;for(let Z in $)if(J[Z]===void 0||M9($[Z],J[Z])!==0)return!1;return!0}function R6({layout:$,panelConstraints:J}){let Z=Object.values($),H=[...Z],B=H.reduce((z,G)=>z+G,0);if(H.length!==J.length)throw Error(`Invalid ${J.length} panel layout: ${H.map((z)=>`${z}%`).join(", ")}`);if(!d2(B,100)&&H.length>0)for(let z=0;z<J.length;z++){let G=H[z];Q5(G!=null,`No layout data found for index ${z}`);let Y=100/B*G;H[z]=Y}let Q=0;for(let z=0;z<J.length;z++){let G=Z[z];Q5(G!=null,`No layout data found for index ${z}`);let Y=H[z];Q5(Y!=null,`No layout data found for index ${z}`);let U=nJ({overrideDisabledPanels:!0,panelConstraints:J[z],prevSize:G,size:Y});Y!=U&&(Q+=Y-U,H[z]=U)}if(!d2(Q,0))for(let z=0;z<J.length;z++){let G=H[z];Q5(G!=null,`No layout data found for index ${z}`);let Y=G+Q,U=nJ({overrideDisabledPanels:!0,panelConstraints:J[z],prevSize:G,size:Y});if(G!==U&&(Q-=U-G,H[z]=U,d2(Q,0)))break}let X=Object.keys($);return H.reduce((z,G,Y)=>(z[X[Y]]=G,z),{})}function Ku({groupId:$,panelId:J}){let Z=()=>{let G=k6();for(let[Y,{defaultLayoutDeferred:U,derivedPanelConstraints:F,layout:K,groupSize:W,separatorToPanels:q}]of G)if(Y.id===$)return{defaultLayoutDeferred:U,derivedPanelConstraints:F,group:Y,groupSize:W,layout:K,separatorToPanels:q};throw Error(`Group ${$} not found`)},H=()=>{let G=Z().derivedPanelConstraints.find((Y)=>Y.panelId===J);if(G!==void 0)return G;throw Error(`Panel constraints not found for Panel ${J}`)},B=()=>{let G=Z().group.panels.find((Y)=>Y.id===J);if(G!==void 0)return G;throw Error(`Layout not found for Panel ${J}`)},Q=()=>{let G=Z().layout[J];if(G!==void 0)return G;throw Error(`Layout not found for Panel ${J}`)},X=({nextSize:G,panels:Y,prevLayout:U,derivedPanelConstraints:F})=>{let K=Q(),W=Y.findIndex((V)=>V.id===J),q=W===0,N=W===Y.length-1;if(N&&G<K&&(q||Y.slice(0,W).every((V,L)=>{let A=F[L];return A?.collapsible&&d2(A.collapsedSize,U[A.panelId])}))){let V=Y.slice(0,W).reduce((L,A)=>L+U[A.id],0);return{...U,[J]:Q4(100-V)}}return cB({delta:N?K-G:G-K,initialLayout:U,panelConstraints:F,pivotIndices:N?[W-1,W]:[W,W+1],prevLayout:U,trigger:"imperative-api"})},z=(G)=>{let Y=Q();if(G===Y)return;let{defaultLayoutDeferred:U,derivedPanelConstraints:F,group:K,groupSize:W,layout:q,separatorToPanels:N}=Z(),V=X({nextSize:G,panels:K.panels,prevLayout:q,derivedPanelConstraints:F}),L=R6({layout:V,panelConstraints:F});I6(q,L)||l9(K,{defaultLayoutDeferred:U,derivedPanelConstraints:F,groupSize:W,layout:L,separatorToPanels:N})};return{collapse:()=>{let{collapsible:G,collapsedSize:Y}=H(),{mutableValues:U}=B(),F=Q();G&&F!==Y&&(U.expandToSize=F,z(Y))},expand:()=>{let{collapsible:G,collapsedSize:Y,minSize:U}=H(),{mutableValues:F}=B(),K=Q();if(G&&K===Y){let W=F.expandToSize??U;W===0&&(W=1),z(W)}},getSize:()=>{let{group:G}=Z(),Y=Q(),{element:U}=B(),F=G.orientation==="horizontal"?U.offsetWidth:U.offsetHeight;return{asPercentage:Y,inPixels:F}},isCollapsed:()=>{let{collapsible:G,collapsedSize:Y}=H(),U=Q();return G&&d2(Y,U)},resize:(G)=>{let{group:Y}=Z(),{element:U}=B(),F=eJ({group:Y}),K=pB({groupSize:F,panelElement:U,styleProp:G}),W=Q4(K/F*100);z(W)}}}function ap($){if($.defaultPrevented)return;let J=k6();vA($,J).forEach((Z)=>{if(Z.separator&&!Z.separator.disableDoubleClick){let H=Z.panels.find((B)=>B.panelConstraints.defaultSize!==void 0);if(H){let B=H.panelConstraints.defaultSize,Q=Ku({groupId:Z.group.id,panelId:H.id});Q&&B!==void 0&&(Q.resize(B),$.preventDefault())}}})}function jF($){let J=k6();for(let[Z]of J)if(Z.separators.some((H)=>H.element===$))return Z;throw Error("Could not find parent Group for separator element")}function Wu({groupId:$}){let J=()=>{let Z=k6();for(let[H,B]of Z)if(H.id===$)return{group:H,...B};throw Error(`Could not find Group with id "${$}"`)};return{getLayout(){let{defaultLayoutDeferred:Z,layout:H}=J();return Z?{}:H},setLayout(Z){let{defaultLayoutDeferred:H,derivedPanelConstraints:B,group:Q,groupSize:X,layout:z,separatorToPanels:G}=J(),Y=R6({layout:Z,panelConstraints:B});return H?z:(I6(z,Y)||l9(Q,{defaultLayoutDeferred:H,derivedPanelConstraints:B,groupSize:X,layout:Y,separatorToPanels:G}),Y)}}}function E6($,J){let Z=jF($),H=Q$(Z.id,!0),B=Z.separators.find((U)=>U.element===$);Q5(B,"Matching separator not found");let Q=H.separatorToPanels.get(B);Q5(Q,"Matching panels not found");let X=Q.map((U)=>Z.panels.indexOf(U)),z=Wu({groupId:Z.id}).getLayout(),G=cB({delta:J,initialLayout:z,panelConstraints:H.derivedPanelConstraints,pivotIndices:X,prevLayout:z,trigger:"keyboard"}),Y=R6({layout:G,panelConstraints:H.derivedPanelConstraints});I6(z,Y)||l9(Z,{defaultLayoutDeferred:H.defaultLayoutDeferred,derivedPanelConstraints:H.derivedPanelConstraints,groupSize:H.groupSize,layout:Y,separatorToPanels:H.separatorToPanels},{isUserInteraction:!0})}function np($){if($.defaultPrevented)return;let J=$.currentTarget,Z=jF(J);if(!Z.disabled)switch($.key){case"ArrowDown":{$.preventDefault(),Z.orientation==="vertical"&&E6(J,5);break}case"ArrowLeft":{$.preventDefault(),Z.orientation==="horizontal"&&E6(J,-5);break}case"ArrowRight":{$.preventDefault(),Z.orientation==="horizontal"&&E6(J,5);break}case"ArrowUp":{$.preventDefault(),Z.orientation==="vertical"&&E6(J,-5);break}case"End":{$.preventDefault(),E6(J,100);break}case"Enter":{$.preventDefault();let H=jF(J),B=Q$(H.id,!0),{derivedPanelConstraints:Q,layout:X,separatorToPanels:z}=B,G=H.separators.find((K)=>K.element===J);Q5(G,"Matching separator not found");let Y=z.get(G);Q5(Y,"Matching panels not found");let U=Y[0],F=Q.find((K)=>K.panelId===U.id);if(Q5(F,"Panel metadata not found"),F.collapsible){let K=X[U.id],W=F.collapsedSize===K?H.mutableState.expandedPanelSizes[U.id]??F.minSize:F.collapsedSize;E6(J,W-K)}break}case"F6":{$.preventDefault();let H=jF(J).separators.map((X)=>X.element),B=Array.from(H).findIndex((X)=>X===$.currentTarget);Q5(B!==null,"Index not found");let Q=$.shiftKey?B>0?B-1:H.length-1:B+1<H.length?B+1:0;H[Q].focus({preventScroll:!0});break}case"Home":{$.preventDefault(),E6(J,-100);break}}}function op($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;let J=k6(),Z=vA($,J),H=new Map,B=!1;Z.forEach((Q)=>{Q.separator&&(B||(B=!0,Q.separator.element.focus({focusVisible:!1,preventScroll:!0})));let X=J.get(Q.group);X&&H.set(Q.group,X.layout)}),sJ({cursorFlags:0,hitRegions:Z,initialLayoutMap:H,pointerDownAtPoint:{x:$.clientX,y:$.clientY},state:"active"}),Z.length&&$.preventDefault()}function qu({document:$,event:J,hitRegions:Z,initialLayoutMap:H,mountedGroups:B,pointerDownAtPoint:Q,prevCursorFlags:X}){let z=0;Z.forEach((Y)=>{let{group:U,groupSize:F}=Y,{orientation:K,panels:W}=U,{disableCursor:q}=U.mutableState,N=0;Q?K==="horizontal"?N=(J.clientX-Q.x)/F*100:N=(J.clientY-Q.y)/F*100:K==="horizontal"?N=J.clientX<0?-100:100:N=J.clientY<0?-100:100;let V=H.get(U),L=B.get(U);if(!V||!L)return;let{defaultLayoutDeferred:A,derivedPanelConstraints:M,groupSize:_,layout:P,separatorToPanels:D}=L;if(M&&P&&D){let w=cB({delta:N,initialLayout:V,panelConstraints:M,pivotIndices:Y.panels.map((R)=>W.indexOf(R)),prevLayout:P,trigger:"mouse-or-touch"});if(I6(w,P)){if(N!==0&&!q)switch(K){case"horizontal":{z|=N<0?Qu:Xu;break}case"vertical":{z|=N<0?zu:Gu;break}}}else l9(Y.group,{defaultLayoutDeferred:A,derivedPanelConstraints:M,groupSize:_,layout:w,separatorToPanels:D})}});let G=0;J.movementX===0?G|=X&fp:G|=z&fp,J.movementY===0?G|=X&mp:G|=z&mp,RZ0(G),hA($)}function sp($){let J=k6(),Z=S6();switch(Z.state){case"active":qu({document:$.currentTarget,event:$,hitRegions:Z.hitRegions,initialLayoutMap:Z.initialLayoutMap,mountedGroups:J,prevCursorFlags:Z.cursorFlags})}}function tp($){if($.defaultPrevented)return;let J=S6(),Z=k6();switch(J.state){case"active":{if($.buttons===0){sJ({cursorFlags:0,state:"inactive"}),J.hitRegions.forEach((H)=>{let B=Q$(H.group.id,!0);l9(H.group,B,{isUserInteraction:!0})});return}for(let H of J.hitRegions)if(H.separator){let{element:B}=H.separator;B.hasPointerCapture?.($.pointerId)||B.setPointerCapture?.($.pointerId)}qu({document:$.currentTarget,event:$,hitRegions:J.hitRegions,initialLayoutMap:J.initialLayoutMap,mountedGroups:Z,pointerDownAtPoint:J.pointerDownAtPoint,prevCursorFlags:J.cursorFlags});break}default:{let H=vA($,Z);H.length===0?J.state!=="inactive"&&sJ({cursorFlags:0,state:"inactive"}):sJ({cursorFlags:0,hitRegions:H,state:"hover"}),hA($.currentTarget);break}}}function ep($){if($.relatedTarget instanceof HTMLIFrameElement)switch(S6().state){case"hover":sJ({cursorFlags:0,state:"inactive"})}}function $u($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;Uu($.currentTarget)&&$.preventDefault()}function Ju($){let J=0,Z=0,H={};for(let Q of $)if(Q.defaultSize!==void 0){J++;let X=Q4(Q.defaultSize);Z+=X,H[Q.panelId]=X}else H[Q.panelId]=void 0;let B=$.length-J;if(B!==0){let Q=Q4((100-Z)/B);for(let X of $)X.defaultSize===void 0&&(H[X.panelId]=Q)}return H}function dZ0($,J,Z){if(!Z[0])return;let H=$.panels.find((G)=>G.element===J);if(!H||!H.onResize)return;let B=eJ({group:$}),Q=$.orientation==="horizontal"?H.element.offsetWidth:H.element.offsetHeight,X=H.mutableValues.prevSize,z={asPercentage:Q4(Q/B*100),inPixels:Q};H.mutableValues.prevSize=z,H.onResize(z,H.id,X)}function lZ0($,J){if(Object.keys($).length!==Object.keys(J).length)return!1;for(let Z in $)if($[Z]!==J[Z])return!1;return!0}function iZ0({group:$,nextGroupSize:J,prevGroupSize:Z,prevLayout:H}){if(Z<=0||J<=0||Z===J)return H;let B=0,Q=0,X=!1,z=new Map,G=[];for(let F of $.panels){let K=H[F.id]??0;switch(F.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{X=!0;let W=K/100*Z,q=Q4(W/J*100);z.set(F.id,q),B+=q;break}case"preserve-relative-size":default:{G.push(F.id),Q+=K;break}}}if(!X||G.length===0)return H;let Y=100-B,U={...H};if(z.forEach((F,K)=>{U[K]=F}),Q>0)for(let F of G){let K=H[F]??0;U[F]=Q4(K/Q*Y)}else{let F=Q4(Y/G.length);for(let K of G)U[K]=F}return U}function rZ0($,J){let Z=$.map((B)=>B.id),H=Object.keys(J);if(Z.length!==H.length)return!1;for(let B of Z)if(!H.includes(B))return!1;return!0}var aJ=new Map;function aZ0($){let J=!0;Q5($.element.ownerDocument.defaultView,"Cannot register an unmounted Group");let Z=$.element.ownerDocument.defaultView.ResizeObserver,H=new Set,B=new Set,Q=new Z((q)=>{for(let N of q){let{borderBoxSize:V,target:L}=N;if(L===$.element){if(J){let A=eJ({group:$});if(A===0)return;let M=Q$($.id);if(!M)return;let _=RA($),P=M.defaultLayoutDeferred?Ju(_):M.layout,D=iZ0({group:$,nextGroupSize:A,prevGroupSize:M.groupSize,prevLayout:P}),w=R6({layout:D,panelConstraints:_});if(!M.defaultLayoutDeferred&&I6(M.layout,w)&&lZ0(M.derivedPanelConstraints,_)&&M.groupSize===A)return;l9($,{defaultLayoutDeferred:!1,derivedPanelConstraints:_,groupSize:A,layout:w,separatorToPanels:M.separatorToPanels})}}else dZ0($,L,V)}});Q.observe($.element),$.panels.forEach((q)=>{Q5(!H.has(q.id),`Panel ids must be unique; id "${q.id}" was used more than once`),H.add(q.id),q.onResize&&Q.observe(q.element)});let X=eJ({group:$}),z=RA($),G=$.panels.map(({id:q})=>q).join(","),Y=$.mutableState.defaultLayout;Y&&(rZ0($.panels,Y)||(Y=void 0));let U=$.mutableState.layouts[G]??Y??Ju(z),F=R6({layout:U,panelConstraints:z}),K=$.element.ownerDocument;aJ.set(K,(aJ.get(K)??0)+1);let W=new Map;return Bu($).forEach((q)=>{q.separator&&W.set(q.separator,q.panels)}),l9($,{defaultLayoutDeferred:X===0,derivedPanelConstraints:z,groupSize:X,layout:F,separatorToPanels:W}),$.separators.forEach((q)=>{Q5(!B.has(q.id),`Separator ids must be unique; id "${q.id}" was used more than once`),B.add(q.id),q.element.addEventListener("keydown",np)}),aJ.get(K)===1&&(K.addEventListener("contextmenu",dp,!0),K.addEventListener("dblclick",ap,!0),K.addEventListener("pointerdown",op,!0),K.addEventListener("pointerleave",sp),K.addEventListener("pointermove",tp),K.addEventListener("pointerout",ep),K.addEventListener("pointerup",$u,!0)),function(){J=!1,aJ.set(K,Math.max(0,(aJ.get(K)??0)-1)),yZ0($),$.separators.forEach((q)=>{q.element.removeEventListener("keydown",np)}),aJ.get(K)||(K.removeEventListener("contextmenu",dp,!0),K.removeEventListener("dblclick",ap,!0),K.removeEventListener("pointerdown",op,!0),K.removeEventListener("pointerleave",sp),K.removeEventListener("pointermove",tp),K.removeEventListener("pointerout",ep),K.removeEventListener("pointerup",$u,!0)),Q.disconnect()}}function nZ0(){let[$,J]=V1.useState({}),Z=V1.useCallback(()=>J({}),[]);return[$,Z]}function gA($){let J=V1.useId();return`${$??J}`}var b6=typeof window<"u"?V1.useLayoutEffect:V1.useEffect;function uB($){let J=V1.useRef($);return b6(()=>{J.current=$},[$]),V1.useCallback((...Z)=>J.current?.(...Z),[J])}function fA(...$){return uB((J)=>{$.forEach((Z)=>{if(Z)switch(typeof Z){case"function":{Z(J);break}case"object":{Z.current=J;break}}})})}function mA($){let J=V1.useRef({...$});return b6(()=>{for(let Z in $)J.current[Z]=$[Z]},[$]),J.current}var Nu=V1.createContext(null);function oZ0($,J){let Z=V1.useRef({getLayout:()=>({}),setLayout:kZ0});V1.useImperativeHandle(J,()=>Z.current,[]),b6(()=>{Object.assign(Z.current,Wu({groupId:$}))})}function pA({children:$,className:J,defaultLayout:Z,disableCursor:H,disabled:B,elementRef:Q,groupRef:X,id:z,onLayoutChange:G,onLayoutChanged:Y,orientation:U="horizontal",resizeTargetMinimumSize:F={coarse:20,fine:10},style:K,...W}){let q=V1.useRef({onLayoutChange:{},onLayoutChanged:{}}),N=uB((x)=>{I6(q.current.onLayoutChange,x)||(q.current.onLayoutChange=x,G?.(x))}),V=uB((x,I)=>{I6(q.current.onLayoutChanged,x)||(q.current.onLayoutChanged=x,Y?.(x,{isUserInteraction:I}))}),L=gA(z),A=V1.useRef(null),[M,_]=nZ0(),P=V1.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:F,separators:[]}),D=fA(A,Q);oZ0(L,X);let w=uB((x,I)=>{let S=S6(),j=cp(x),C=Q$(x);if(C){let k=!1;switch(S.state){case"active":{k=S.hitRegions.some((y)=>y.group===j);break}}return{flexGrow:C.layout[I]??1,pointerEvents:k?"none":void 0}}if(Z?.[I])return{flexGrow:Z?.[I]}}),R=mA({defaultLayout:Z,disableCursor:H}),b=V1.useMemo(()=>({get disableCursor(){return!!R.disableCursor},getPanelStyles:w,id:L,orientation:U,registerPanel:(x)=>{let I=P.current;return I.panels=kA(U,[...I.panels,x]),_(),()=>{I.panels=I.panels.filter((S)=>S!==x),_()}},registerSeparator:(x)=>{let I=P.current;return I.separators=kA(U,[...I.separators,x]),_(),()=>{I.separators=I.separators.filter((S)=>S!==x),_()}},updatePanelProps:(x,{disabled:I})=>{let S=P.current.panels.find((k)=>k.id===x);S&&(S.panelConstraints.disabled=I);let j=cp(L),C=Q$(L);j&&C&&l9(j,{...C,derivedPanelConstraints:RA(j)})},updateSeparatorProps:(x,{disabled:I,disableDoubleClick:S})=>{let j=P.current.separators.find((C)=>C.id===x);j&&(j.disabled=I,j.disableDoubleClick=S)}}),[w,L,_,U,R]),E=V1.useRef(null);return b6(()=>{let x=A.current;if(x===null)return;let I=P.current,S;if(R.defaultLayout!==void 0&&Object.keys(R.defaultLayout).length===I.panels.length){S={};for(let T of I.panels){let t=R.defaultLayout[T.id];t!==void 0&&(S[T.id]=t)}}let j={disabled:!!B,element:x,id:L,mutableState:{defaultLayout:S,disableCursor:!!R.disableCursor,expandedPanelSizes:P.current.lastExpandedPanelSizes,layouts:P.current.layouts},orientation:U,panels:I.panels,resizeTargetMinimumSize:I.resizeTargetMinimumSize,separators:I.separators};E.current=j;let C=aZ0(j),{defaultLayoutDeferred:k,derivedPanelConstraints:y,layout:v}=Q$(j.id,!0);!k&&y.length>0&&(N(v),V(v,!1));let u=xA(L,(T)=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:B0,layout:h}=T.next;if(t||B0.length===0)return;let e=j.panels.map(({id:l})=>l).join(",");j.mutableState.layouts[e]=h,B0.forEach((l)=>{if(l.collapsible){let{layout:z0}=T.prev??{};if(z0){let W0=d2(l.collapsedSize,h[l.panelId]),Q0=d2(l.collapsedSize,z0[l.panelId]);W0&&!Q0&&(j.mutableState.expandedPanelSizes[l.panelId]=z0[l.panelId])}}});let A0=S6().state!=="active";N(h),A0&&V(h,T.isUserInteraction)});return()=>{E.current=null,C(),u()}},[B,L,V,N,U,M,R]),V1.useEffect(()=>{let x=E.current;x&&(x.mutableState.defaultLayout=Z,x.mutableState.disableCursor=!!H)}),tJ.jsx(Nu.Provider,{value:b,children:tJ.jsx("div",{...W,className:J,"data-group":!0,"data-testid":L,id:L,ref:D,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:$})})}pA.displayName="Group";function uA(){let $=V1.useContext(Nu);return Q5($,"Group Context not found; did you render a Panel or Separator outside of a Group?"),$}function sZ0($,J){let{id:Z}=uA(),H=V1.useRef({collapse:IA,expand:IA,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:IA});V1.useImperativeHandle(J,()=>H.current,[]),b6(()=>{Object.assign(H.current,Ku({groupId:Z,panelId:$}))})}function cA({children:$,className:J,collapsedSize:Z="0%",collapsible:H=!1,defaultSize:B,disabled:Q,elementRef:X,groupResizeBehavior:z="preserve-relative-size",id:G,maxSize:Y="100%",minSize:U="0%",onResize:F,panelRef:K,style:W,...q}){let N=!!G,V=gA(G),L=mA({disabled:Q}),A=V1.useRef(null),M=fA(A,X),{getPanelStyles:_,id:P,orientation:D,registerPanel:w,updatePanelProps:R}=uA(),b=F!==null,E=uB((j,C,k)=>{F?.(j,G,k)});b6(()=>{let j=A.current;if(j!==null){let C={element:j,id:V,idIsStable:N,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:b?E:void 0,panelConstraints:{groupResizeBehavior:z,collapsedSize:Z,collapsible:H,defaultSize:B,disabled:L.disabled,maxSize:Y,minSize:U}};return w(C)}},[z,Z,H,B,b,V,N,Y,U,E,w,L]),V1.useEffect(()=>{R(V,{disabled:Q})},[Q,V,R]),sZ0(V,K);let x=()=>{let j=_(P,V);if(j)return JSON.stringify(j)},I=V1.useSyncExternalStore((j)=>xA(P,j),x,x),S;return I?S=JSON.parse(I):B!==void 0?S={flexGrow:void 0,flexShrink:void 0,flexBasis:B}:S={flexGrow:1},tJ.jsx("div",{...q,"data-disabled":Q||void 0,"data-panel":!0,"data-testid":V,id:V,ref:M,style:{...tZ0,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...S},children:tJ.jsx("div",{className:J,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...W,touchAction:D==="horizontal"?"pan-y":"pan-x"},children:$})})}cA.displayName="Panel";var tZ0={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function eZ0({layout:$,panelConstraints:J,panelId:Z,panelIndex:H}){let B,Q,X=$[Z],z=J.find((G)=>G.panelId===Z);if(z){let G=z.maxSize,Y=z.collapsible?z.collapsedSize:z.minSize,U=[H,H+1];Q=R6({layout:cB({delta:Y-X,initialLayout:$,panelConstraints:J,pivotIndices:U,prevLayout:$}),panelConstraints:J})[Z],B=R6({layout:cB({delta:G-X,initialLayout:$,panelConstraints:J,pivotIndices:U,prevLayout:$}),panelConstraints:J})[Z]}return{valueControls:Z,valueMax:B,valueMin:Q,valueNow:X}}function dA({children:$,className:J,disabled:Z,disableDoubleClick:H,elementRef:B,id:Q,style:X,...z}){let G=gA(Q),Y=mA({disabled:Z,disableDoubleClick:H}),[U,F]=V1.useState({}),[K,W]=V1.useState("inactive"),[q,N]=V1.useState(!1),V=V1.useRef(null),L=fA(V,B),{disableCursor:A,id:M,orientation:_,registerSeparator:P,updateSeparatorProps:D}=uA(),w=_==="horizontal"?"vertical":"horizontal";b6(()=>{let E=V.current;if(E!==null){let x={disabled:Y.disabled,disableDoubleClick:Y.disableDoubleClick,element:E,id:G},I=P(x),S=IZ0((C)=>{W(C.next.state!=="inactive"&&C.next.hitRegions.some((k)=>k.separator===x)?C.next.state:"inactive")}),j=xA(M,(C)=>{let{derivedPanelConstraints:k,layout:y,separatorToPanels:v}=C.next,u=v.get(x);if(u){let T=u[0],t=u.indexOf(T);F(eZ0({layout:y,panelConstraints:k,panelId:T.id,panelIndex:t}))}});return()=>{S(),j(),I()}}},[M,G,P,Y]),V1.useEffect(()=>{D(G,{disabled:Z,disableDoubleClick:H})},[Z,H,G,D]);let R;Z&&!A&&(R="not-allowed");let b;if(Z)b="disabled";else switch(K){case"active":{b="active";break}default:q?b="focus":b=K}return tJ.jsx("div",{...z,"aria-controls":U.valueControls,"aria-disabled":Z||void 0,"aria-orientation":w,"aria-valuemax":U.valueMax,"aria-valuemin":U.valueMin,"aria-valuenow":U.valueNow,children:$,className:J,"data-separator":b,"data-testid":G,id:G,onBlur:()=>N(!1),onFocus:()=>N(!0),ref:L,role:"separator",style:{flexBasis:"auto",cursor:R,...X,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:Z?void 0:0})}dA.displayName="Separator";var dB=O(c(),1);function Lu({className:$,...J}){return dB.jsx(pA,{"data-slot":"resizable-panel-group",className:s("flex h-full w-full aria-[orientation=vertical]:flex-col",$),...J})}function lA({...$}){return dB.jsx(cA,{"data-slot":"resizable-panel",...$})}function Vu({withHandle:$,className:J,...Z}){return dB.jsx(dA,{"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",J),...Z,children:$&&dB.jsx("div",{className:"flex h-6 w-1 shrink-0 rounded-lg bg-border"})})}var X$=O(c(),1);function Au({workspace:$,chat:J,open:Z,workspaceMinWidth:H,chatMinWidth:B,chatMaxWidth:Q,chatWidth:X,onCollapse:z,onChatWidthChange:G}){let Y=z$.useRef(null),U=z$.useRef(null),[F,K]=z$.useState(!1),W=Math.min(Math.max(X,B),Q),q=z$.useRef(Z?W:0).current;return z$.useLayoutEffect(()=>{let N=Y.current;if(!N)return;if(Z)N.resize(W);else N.collapse()},[W,Z]),X$.jsxs(Lu,{orientation:"horizontal",className:s("overflow-visible!",F&&"[&>#chat]:transition-[flex-grow] [&>#chat]:duration-200 [&>#chat]:ease-in-out motion-reduce:[&>#chat]:transition-none!",F&&"has-[[data-separator=active]]:[&>#chat]:transition-none!"),onLayoutChanged:(N,V)=>{if(!F&&U.current===null)U.current=requestAnimationFrame(()=>{K(!0)});if(V.isUserInteraction)requestAnimationFrame(()=>{let L=Y.current;if(!L)return;let A=L.getSize();if(A.inPixels>0)G(Math.round(A.inPixels))})},children:[X$.jsx(lA,{id:"workspace",className:"overflow-visible!",minSize:H,children:X$.jsx("div",{"data-slot":"workspace-split-workspace",className:"flex h-full min-h-0 min-w-0 flex-col",children:$})}),X$.jsx(Vu,{"aria-label":"Resize chat",hidden:!Z,disabled:!Z}),X$.jsx(lA,{id:"chat","aria-hidden":!Z,inert:!Z,collapsible:!0,collapsedSize:0,defaultSize:q,minSize:B,maxSize:Q,groupResizeBehavior:"preserve-pixel-size",panelRef:Y,onResize:(N,V,L)=>{if(Z&&N.inPixels===0&&L&&L.inPixels>0)z()},className:s("overflow-hidden!",F&&"transition-opacity duration-200 ease-in-out motion-reduce:transition-none",Z?"opacity-100":"opacity-0"),children:X$.jsx("div",{"data-slot":"workspace-split-chat",className:"flex h-full min-h-0 min-w-(--chat-min) flex-col",children:J})})]})}var W1=O(c(),1),JH0=X4.lazy(()=>import("/chunk-5t06zksf.js").then(($)=>({default:$.Scratchpad}))),_u=($)=>$.config.title||$.id,Ou=($)=>GF($.icon)??fH;function ju($,J){let Z=J.find((H)=>H.viewId===$.id);return GF($.config.icon)??GF(Z?.icon)??fH}function ZH0({onToggleMode:$}){return W1.jsxs(d1,{children:[W1.jsx(l1,{render:W1.jsx(C0,{variant:"ghost",size:"icon-sm",onClick:$,"aria-label":"Dock agent",children:W1.jsx(Mu,{stroke:1.75})})}),W1.jsx(i1,{children:"Dock agent"})]})}function HH0({active:$,onToggle:J}){return W1.jsxs(d1,{children:[W1.jsx(l1,{render:W1.jsx(C0,{variant:"ghost",size:"icon-sm","aria-label":"Customize","aria-pressed":$,onClick:J,className:s($&&"bg-accent"),children:W1.jsx(Pu,{stroke:1.75})})}),W1.jsx(i1,{children:"Customize"})]})}function BH0($,J,Z,H,B,Q){if($==="agent")return{key:$,Icon:S3,label:"Agent",closable:H,loading:B};if($==="widgets")return{key:$,Icon:mH,label:"Widgets",closable:H};if($==="scratchpad")return{key:$,Icon:pH,label:"Scratchpad",closable:H};let X=J6($),z=X?Z.find((U)=>U.id===X):null;if(z)return{key:$,Icon:Ou(z),label:z.title||z.viewId||"New view",closable:H,loading:Q(z.sessionId)};let G=C3($),Y=G?J.find((U)=>U.id===G):null;return Y?{key:$,Icon:ju(Y,Z),label:_u(Y),closable:H}:null}function QH0($,J,Z){let H=new Set(J),B=0;return $.map((Q)=>H.has(Q)?Z[B++]:Q)}function Tu({widgets:$,views:J,builders:Z}){let{layout:H,setLayout:B,name:Q,icon:X,provider:z,workspaceId:G}=Y5(),Y=_p(),{ref:U,fits:F,constraints:K}=jp(),[W,q]=X4.useState("idle"),[N,V]=X4.useState(!1),[L,A]=X4.useState(0),M=X4.useRef(new Map),_=_5((Z0)=>Z0.dockedChatWidth),P=_5((Z0)=>Z0.setDockedChatWidth),D=s2((Z0)=>Z0.activity),w=C_(D,G),R=Op({builders:Z,onSave:(Z0,T0)=>Y.save(Z0,T0)});hC(H.theme);let b=PF(MF(H.tabs),J,Z),E=b.filter((Z0)=>Z0!=="agent"),x=E.length>0,S=H.layoutMode==="split"&&x&&F?"split":"fullscreen",j=S==="split",{tabsState:C,activeTab:k,appletParams:y,navigateToTab:v,setTabs:u}=hp({views:J,builders:Z,split:j}),{view:T,chatLoaded:t,previewTurn:B0,sessionId:h,processing:e,error:A0,send:l,stop:z0,selectSession:W0,dismissError:Q0}=Kp({activeTab:k,appletParams:y}),{composerBanner:G0,builderComposerBanner:L0,composerAvailability:i}=kp(G,{chatError:A0,onDismissChatError:Q0}),$0=new Set(C.open),J0=(Z0)=>{B({layoutMode:Z0})},H0=j?E:b,n=b.length>1,p=H0.map((Z0)=>BH0(Z0,J,Z,n||J6(Z0)!==null,w,(T0)=>RZ(D,G,T0))).filter((Z0)=>Boolean(Z0)),d=C3(k),m=d?J.find((Z0)=>Z0.id===d):void 0,a=J6(k),o=a?Z.find((Z0)=>Z0.id===a):void 0,N0=o?.status==="draft"&&!RZ(D,G,o.sessionId)?o:void 0,O0=N0?.id,g0=W==="idle"&&(k==="widgets"&&$.length>0||m!==void 0),p0=Sw({workspaceId:G,sessionId:h,activeTab:k,mode:S,available:g0,closePopup:()=>V(!1),openPopup:()=>V(!0)});X4.useEffect(()=>{if(C.open.filter((H1)=>mB(H1,J,Z)).length===C.open.length)return;let T0=PF(C,J,Z);B({tabs:{open:T0,active:T0.includes(C.active)?C.active:T0[0]}})},[Z,B,C,J]),X4.useEffect(()=>{let Z0=new Map;for(let R0 of Z){if(R0.status!=="ready"||!R0.viewId)continue;if(!J.some((n0)=>n0.id===R0.viewId))continue;Z0.set(w3(R0.id),HG(R0.viewId))}if(Z0.size===0)return;let T0=Z0.get(k);if(T0)v(T0);let H1=new Set(Z0.values()),G1=new Map([...Z0].map(([R0,n0])=>[n0,R0])),a1=[],I0=!1;for(let R0 of C.open){let n0=G1.get(R0);if(H1.has(R0)&&n0&&C.open.includes(n0)){I0=!0;continue}let F1=Z0.get(R0),C1=F1??R0;if(F1)I0=!0;if(!a1.includes(C1))a1.push(C1)}if(!I0)return;let k0=Z0.get(C.active)??C.active;B({tabs:{open:a1.length>0?a1:["agent"],active:k0}})},[k,Z,v,B,C,J]),X4.useEffect(()=>{if(S!=="fullscreen"||k==="agent")V(!1)},[k,S]),X4.useEffect(()=>{if(!O0)return;if(S==="fullscreen")V(!0);A((Z0)=>Z0+1)},[O0,S]);let f=(Z0,T0)=>{if(v(Z0,T0),Z0==="agent")V(!1),A((H1)=>H1+1)},r=(Z0)=>{if(Z0==="views"){let T0=J[0];if(T0)f(HG(T0.id));else Y.create().then((H1)=>f(w3(H1.id)))}else f(Z0);V(!1)};XG(G,"focusTab",f),Z2((Z0)=>{if(Z0.type==="tab:focus"&&Z0.workspaceId===G)f(Z0.tab,Z0.params)});let X0=(Z0)=>{let T0=J6(Z0),H1=T0?Z.find((R0)=>R0.id===T0):void 0;if(!n&&!H1||!$0.has(Z0))return;let G1=C.open.filter((R0)=>R0!==Z0);if(G1.length===0)G1=["agent"];let a1=H0.indexOf(Z0),I0=H0[a1+1]??H0[a1-1]??G1.find((R0)=>mB(R0,J,Z))??"agent",k0=C.active===Z0||!G1.includes(C.active)?I0:C.active;if(u({open:G1,active:k0}),k===Z0)v(I0);if(H1?.status==="draft")M.current.get(H1.id)?.resetSketch(),R.clear(H1.id),Y.discard(H1.id)},V0=(Z0)=>{let T0=w3(Z0.id);if($0.has(T0)){let H1=C.open.filter((G1)=>G1!==T0);if(H1.length===0)H1=["agent"];if(u({open:H1,active:C.active===T0?H1[0]:C.active}),k===T0)v(H1[0])}M.current.get(Z0.id)?.resetSketch(),R.clear(Z0.id),Y.discard(Z0.id)},j0=(Z0)=>{let T0=QH0(C.open,H0,Z0);if(T0===C.open)return;u({open:T0,active:C.active})},v0=(Z0)=>{if(Z0!==void 0)_5.getState().setComposerDraft(G,Z0);if(S==="fullscreen"&&k!=="agent"){if(V(!0),N)A((T0)=>T0+1);return}A((T0)=>T0+1)};$p({send:l,revealChat:v0,composerAvailability:i});let Q1=[...!j&&!$0.has("agent")?[{key:"agent",Icon:S3,label:"Agent",onClick:()=>f("agent")}]:[],...!$0.has("widgets")?[{key:"widgets",Icon:mH,label:"Widgets",onClick:()=>f("widgets")}]:[],...!$0.has("scratchpad")?[{key:"scratchpad",Icon:pH,label:"Scratchpad",onClick:()=>f("scratchpad")}]:[],...J.map((Z0)=>({view:Z0,tab:HG(Z0.id)})).filter(({tab:Z0})=>!$0.has(Z0)).map(({view:Z0,tab:T0})=>({key:T0,Icon:ju(Z0,Z),label:_u(Z0),onClick:()=>f(T0)})),...Z.filter((Z0)=>Z0.status!=="ready").map((Z0)=>({builder:Z0,tab:w3(Z0.id)})).filter(({tab:Z0})=>!$0.has(Z0)).map(({builder:Z0,tab:T0})=>({key:T0,Icon:Ou(Z0),label:Z0.title||Z0.viewId||"New view",onClick:()=>f(T0)})),{key:"create-view",Icon:Du,label:"New view",onClick:()=>{Y.create().then((Z0)=>f(w3(Z0.id)))}}],U1=N0?{sessionId:N0.sessionId,builderId:N0.id,initialValue:N0.input.requirements,onChange:(Z0)=>R.change(N0.id,Z0),onRemoveDrawing:()=>{M.current.get(N0.id)?.resetSketch()},onSubmit:async(Z0)=>{await M.current.get(N0.id)?.prepareSketchForSend(),await Y.submit(N0,Z0),R.clear(N0.id)}}:void 0,c0=W1.jsx(kU,{active:S==="split",focusRequest:L,chatLoaded:t,view:T,previewTurn:B0,sessionId:h,processing:e,composerBanner:U1?L0:G0,composerAvailability:i,send:l,stop:z0,onNavigateFromWelcome:r,onClose:()=>J0("fullscreen"),annotation:p0.docked,builderDraft:U1,docked:!0}),y0=W1.jsx(kU,{active:S==="fullscreen"&&k==="agent",focusRequest:L,chatLoaded:t,view:T,previewTurn:B0,sessionId:h,processing:e,composerBanner:G0,composerAvailability:i,send:l,stop:z0,onNavigateFromWelcome:r}),d0=W1.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]",S==="split"&&"rounded-xl"),children:[W1.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[W1.jsxs("div",{ref:p0.targetRef,inert:p0.controls.active||void 0,"aria-hidden":p0.controls.active||void 0,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:[k==="agent"?y0:k==="widgets"?W1.jsx(Og,{editing:W==="editing",onEditingChange:(Z0)=>q(Z0?"editing":"idle"),widgets:$,onCreateWidget:()=>{W0(null),v0("Create widget")}}):k==="scratchpad"?W1.jsx(X4.Suspense,{fallback:null,children:W1.jsx(JH0,{})}):null,Z.filter((Z0)=>Z0.status!=="ready").map((Z0)=>W1.jsx(Np,{ref:(T0)=>{if(T0)M.current.set(Z0.id,T0);else M.current.delete(Z0.id)},active:o?.id===Z0.id,builder:Z0,chatDocked:S==="split",workspaceId:G,onEditingStart:()=>{if(S==="fullscreen")V(!1)},onContinueInChat:v0,onOpenChat:()=>{W0(Z0.sessionId),v0()},onDiscard:()=>V0(Z0)},Z0.id)),W1.jsx(Pp,{views:J,activeViewId:m?.id??null,params:y})]}),W1.jsx(KG,{...p0.layerProps,children:W1.jsx(NG,{controls:p0.controls,title:"Draw annotation",busy:p0.controls.finishing,onComplete:()=>void p0.controls.finish()})})]}),W1.jsx(t2,{children:W==="customizing"&&W1.jsx(sx,{onClose:()=>q("idle")})}),W1.jsxs(jg,{children:[W1.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[W1.jsxs("div",{className:"flex items-center gap-2",children:[W1.jsx("img",{src:X??D8[z??"claude-code"],alt:"",className:"size-5 shrink-0 rounded-xs"}),Q&&W1.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Q})]}),W1.jsx(gp,{tabs:p,active:k,createItems:Q1,onSelect:f,onClose:X0,onReorder:j0})]}),W1.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[W1.jsx(HH0,{active:W==="customizing",onToggle:()=>q(W==="customizing"?"idle":"customizing")}),W1.jsx(em,{}),x&&F&&S==="fullscreen"&&W1.jsx(ZH0,{onToggleMode:()=>J0("split")})]})]})]});return W1.jsxs("div",{className:"relative flex h-full min-h-0 flex-col font-sans text-foreground",children:[W1.jsx("div",{ref:U,className:"flex min-h-0 flex-1",children:x&&F&&K?W1.jsx(Au,{...K,workspace:d0,chat:c0,open:S==="split",chatWidth:_,onCollapse:()=>J0("fullscreen"),onChatWidthChange:P}):d0}),S==="fullscreen"&&k!=="agent"&&x&&W1.jsx(ox,{loading:w,open:N,onOpenChange:V,onOpenChangeComplete:(Z0)=>{if(Z0)A((T0)=>T0+1)},children:(Z0)=>W1.jsx(kU,{active:N,focusRequest:L,chatLoaded:t,view:T,previewTurn:B0,sessionId:h,processing:e,composerBanner:U1?L0:G0,composerAvailability:i,send:l,stop:z0,onNavigateFromWelcome:r,onClose:Z0,annotation:p0.popup,builderDraft:U1})})]})}var TF=O(g(),1);function Cu($,J,Z,H){let B=TF.useRef(null);TF.useEffect(()=>{if(!J)return;let Q=new Map(J.map((W)=>[W.id,{w:W.config.colSpan,h:W.config.rowSpan}]));if(B.current?.workspaceId!==$){B.current={workspaceId:$,sizes:Q};return}let X=B.current.sizes,z=new Set(Z.widgetGrid.map((W)=>W.i)),G=J.filter((W)=>{if(!X.has(W.id))return!z.has(W.id);if(!z.has(W.id))return!1;let N=X.get(W.id);return N.w!==W.config.colSpan||N.h!==W.config.rowSpan});if(B.current={workspaceId:$,sizes:Q},G.length===0)return;let Y=new Map(J.map((W)=>[W.id,W.config])),U=Z.widgetGrid.filter((W)=>!G.some((q)=>q.id===W.i)&&Y.has(W.i)).map((W)=>{let q=Y.get(W.i);return{i:W.i,x:W.x,y:W.y,w:q.colSpan,h:q.rowSpan}}),F=U.map(({i:W,x:q,y:N})=>({i:W,x:q,y:N})),K=[...U];for(let W of G){let q=VB(K,W.config.colSpan,W.config.rowSpan,4);F.push({i:W.id,x:q.x,y:q.y}),K.push({i:W.id,x:q.x,y:q.y,w:W.config.colSpan,h:W.config.rowSpan})}H({widgetGrid:F})},[$,J,Z.widgetGrid,H])}var I8=O(c(),1);function Eu({id:$}){return I8.jsx(wu,{id:$,children:I8.jsx(Vw,{id:$,children:I8.jsx(XH0,{id:$})})})}function XH0({id:$}){let J=s0(),[Z]=Q3(),{layout:H,setLayout:B,isLoading:Q}=Y5(),X=Kw($),z=FG($),G=KF($);Cu($,X.data,H,B),zw(),Z2((U)=>{if(U.type==="theme:updated"||U.type==="workspace:updated")J.invalidateQueries({queryKey:w0.layout($)});else if(U.type==="widget-layout:updated"||U.type==="widget:updated")J.invalidateQueries({queryKey:w0.widgets($)});else if(U.type==="view-layout:updated"||U.type==="view:updated")J.invalidateQueries({queryKey:w0.views($)})});let Y=Q||Z===void 0||X.isLoading||z.isLoading||G.isLoading;return I8.jsx(I8.Fragment,{children:I8.jsx(zz,{children:Y?I8.jsx("div",{className:"flex h-full items-center justify-center",children:I8.jsx(rC,{sprite:"moi",effect:"chaos"})}):I8.jsx(Tu,{widgets:X.data??[],views:z.data??[],builders:G.data??[]})})})}var _9=O(c(),1),Su=null;function zH0(){if(!Su)return _9.jsx(dD,{to:"/"});return _9.jsx(CF.Suspense,{fallback:null,children:_9.jsx(Su,{})})}function Iu(){let[,$]=m4();return CF.useEffect(()=>{return eK((J)=>$(`/workspace/${J}`)),()=>eK(null)},[$]),_9.jsxs(cD,{children:[_9.jsx(zQ,{path:"/",component:pC}),_9.jsx(zQ,{path:"/dev/*?",component:zH0}),_9.jsx(zQ,{path:"/workspace/:id/*?",children:(J)=>_9.jsx(Eu,{id:J.id},J.id)})]})}var G$=O(c(),1),ku=new fF;x_(ku);__();function wG1($){function J(){return G$.jsx(pF,{client:ku,children:G$.jsxs(NX,{children:[G$.jsx(oF,{children:G$.jsx(Iu,{})}),G$.jsx(dP,{}),!1]})})}Ru.createRoot($).render(G$.jsx(J,{}))}export{wG1 as mount};
|