moi-computer 0.3.0-next.2 → 0.3.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.
Files changed (125) hide show
  1. package/README.md +1 -1
  2. package/client/AGENTS.md +2 -2
  3. package/client/api/http.ts +1 -1
  4. package/client/api/workspace-keys.ts +1 -0
  5. package/client/app/AppRouter.tsx +14 -5
  6. package/client/app/routes/HomeRoute.tsx +1 -1
  7. package/client/app/routes/WorkspaceRoute.tsx +8 -2
  8. package/client/app/shell/SidebarLayout.tsx +10 -5
  9. package/client/assets/openai.svg +3 -0
  10. package/client/components/shared/BottomPanel.tsx +2 -2
  11. package/client/components/ui/button.tsx +3 -2
  12. package/client/components/ui/input.tsx +1 -1
  13. package/client/features/applets/AppletMount.tsx +44 -0
  14. package/client/features/applets/WidgetShell.tsx +4 -1
  15. package/client/features/applets/applet-cache.ts +8 -0
  16. package/client/features/applets/applet-styles.ts +61 -0
  17. package/client/features/chat/ChatComposer.tsx +2 -2
  18. package/client/features/chat/ChatPanel.tsx +8 -25
  19. package/client/features/chat/ChatPopup.tsx +3 -3
  20. package/client/features/chat/{ThreadSelector.tsx → ChatSelector.tsx} +4 -4
  21. package/client/features/chat/TurnView.tsx +8 -9
  22. package/client/features/chat/api.ts +1 -1
  23. package/client/features/chat/chat-send.ts +57 -0
  24. package/client/features/chat/tool-group/ToolCallGroup.tsx +2 -1
  25. package/client/features/chat/tool-group/format.ts +117 -0
  26. package/client/features/chat/useChat.ts +10 -34
  27. package/client/features/connectors/McpMenu.tsx +4 -21
  28. package/client/features/dev/DevRoutes.tsx +18 -0
  29. package/client/features/dev/HarnessDebugPage.tsx +468 -0
  30. package/client/{components/playground → features/dev}/PlaygroundPage.tsx +1 -1
  31. package/client/features/home/CreateWorkspaceDialog.tsx +64 -158
  32. package/client/features/home/CreateWorkspaceDialogSteps.tsx +234 -0
  33. package/client/features/home/HomeLogo.tsx +344 -0
  34. package/client/features/home/HomePage.tsx +15 -21
  35. package/client/features/home/WorkspacePreview.tsx +12 -5
  36. package/client/features/home/api.ts +11 -3
  37. package/client/features/home/workspace-presentation.tsx +4 -4
  38. package/client/features/settings/GeneralSettings.tsx +3 -3
  39. package/client/features/settings/IconPicker.tsx +4 -3
  40. package/client/features/settings/icon-picker-options.ts +0 -131
  41. package/client/features/views/ViewBuilderTab.tsx +153 -0
  42. package/client/features/views/api.ts +124 -0
  43. package/client/features/views/useViewBuilderActions.ts +72 -0
  44. package/client/features/widgets/WidgetGrid.tsx +36 -20
  45. package/client/features/widgets/Widgets.tsx +140 -90
  46. package/client/features/workspace/WorkspaceLayoutContext.tsx +3 -9
  47. package/client/features/workspace/WorkspaceScreen.tsx +179 -40
  48. package/client/features/workspace/WorkspaceTabs.tsx +4 -4
  49. package/client/index.css +0 -35
  50. package/client/index.html +1 -1
  51. package/client/lib/app-icon-registry.ts +145 -0
  52. package/client/runtime/useWorkspaceEvents.ts +3 -1
  53. package/client/theme.css +1 -1
  54. package/dist/chunk-4vf1t6v1.js +10 -0
  55. package/dist/chunk-4z52b2av.css +1 -0
  56. package/dist/chunk-6c8cwpzc.js +1 -0
  57. package/dist/chunk-b4b276wx.js +15 -0
  58. package/dist/{chunk-c4j722at.js → chunk-cs8vbert.js} +2 -2
  59. package/dist/chunk-fjksw6xf.js +1 -0
  60. package/dist/chunk-kxmvv1ax.js +48 -0
  61. package/dist/{chunk-p68fnz3q.js → chunk-vkvb3hjm.js} +1 -1
  62. package/dist/chunk-y82s1jxm.js +61 -0
  63. package/dist/chunk-zpxrb1ce.js +2 -0
  64. package/dist/index.html +2 -2
  65. package/dist/openai-h13pza4b.svg +3 -0
  66. package/lib/format.ts +2 -2
  67. package/lib/types.ts +38 -2
  68. package/lib/view-builder-meta.ts +35 -0
  69. package/lib/workspace-layout.ts +14 -0
  70. package/package.json +2 -1
  71. package/server/AGENTS.md +3 -3
  72. package/server/api.ts +165 -51
  73. package/server/applets.ts +1 -1
  74. package/server/bundle-queue.ts +19 -0
  75. package/server/bundler/applet-css.ts +50 -0
  76. package/server/{build-applet.ts → bundler/build-applet.ts} +36 -26
  77. package/server/cli.ts +79 -2
  78. package/server/control.ts +106 -8
  79. package/server/env-apply.ts +2 -2
  80. package/server/harness/README.md +228 -0
  81. package/server/harness/claude-code/NOTES.md +578 -0
  82. package/{lib/claude-adapter.ts → server/harness/claude-code/adapter.ts} +67 -5
  83. package/server/harness/claude-code/index.ts +124 -0
  84. package/server/{mcp.ts → harness/claude-code/mcp.ts} +1 -1
  85. package/server/{cc-session.ts → harness/claude-code/session.ts} +42 -14
  86. package/server/harness/claude-code/sessions.ts +42 -0
  87. package/server/harness/codex/NOTES.md +326 -0
  88. package/server/harness/codex/adapter.ts +414 -0
  89. package/server/harness/codex/client.ts +343 -0
  90. package/server/harness/codex/index.ts +68 -0
  91. package/server/harness/codex/probe.ts +186 -0
  92. package/server/harness/codex/session.ts +617 -0
  93. package/server/harness/debug.ts +57 -0
  94. package/server/harness/openclaw/NOTES.md +316 -0
  95. package/server/{openclaw-adapter.ts → harness/openclaw/adapter.ts} +2 -2
  96. package/server/harness/openclaw/index.ts +93 -0
  97. package/server/{openclaw-session.ts → harness/openclaw/session.ts} +44 -9
  98. package/server/{openclaw-strip.ts → harness/openclaw/strip.ts} +3 -1
  99. package/server/harness/registry.ts +36 -0
  100. package/server/harness/types.ts +87 -0
  101. package/server/layout.ts +6 -12
  102. package/server/moi-scaffold.ts +1 -1
  103. package/server/registry.ts +14 -52
  104. package/server/state.ts +5 -38
  105. package/server/status.ts +7 -46
  106. package/server/vendor.ts +1 -1
  107. package/server/view-builders.ts +428 -0
  108. package/server/views.ts +0 -0
  109. package/server/web.ts +18 -40
  110. package/server/workspace-init.ts +6 -6
  111. package/workspace/.claude/skills/moi-workspace/DESIGN.md +1 -0
  112. package/workspace/.claude/skills/moi-workspace/SKILL.md +28 -7
  113. package/client/assets/hermes-nous.png +0 -0
  114. package/client/hooks/useScrollFade.ts +0 -38
  115. package/dist/chunk-23cgr1tz.css +0 -1
  116. package/dist/chunk-3hy3qy6d.js +0 -10
  117. package/dist/chunk-dyfaffyz.js +0 -119
  118. package/dist/chunk-kpe40hm8.js +0 -1
  119. package/dist/chunk-ty6dvda0.js +0 -1
  120. package/dist/hermes-nous-pznd63x9.png +0 -0
  121. /package/client/{components/playground → features/dev}/PixelPainter.tsx +0 -0
  122. /package/client/{components/playground → features/dev}/ToolCallsPage.tsx +0 -0
  123. /package/server/{agent.ts → harness/claude-code/models.ts} +0 -0
  124. /package/server/{openclaw.ts → harness/openclaw/discovery.ts} +0 -0
  125. /package/server/{openclaw-gateway.ts → harness/openclaw/gateway.ts} +0 -0
@@ -1,119 +0,0 @@
1
- import{$ as zE,$a as hE,A as dk,Aa as PE,Ab as g9,B as GH,Ba as OI,Bb as t3,Ca as sE,Cb as HN,D as Gw,Da as jE,Db as XK,E as rE,Ea as CE,Eb as zN,F as JB,Fa as IE,Fb as KN,G as lk,Ga as JH,Gb as mJ,H as ik,Ha as EX,Hb as pL,I as rk,Ia as TE,Ib as az,J as ak,Ja as kE,Jb as sz,K as sk,Ka as WV,Kb as nz,L as nk,La as aH,Lb as oz,M as ok,Ma as qV,Mb as tz,N as tk,Na as Hw,Nb as ez,O as ek,Oa as J2,P as $E,Pa as EE,Pb as W7,Q as ZE,Qa as t5,R as $J,S as JE,Sa as q7,T as b2,Ta as SE,U as v6,Ua as RE,V as aE,Va as DZ,W as QE,Wa as bE,X as XE,Xa as yE,Y as GE,Z as jV,Za as MA,_ as HE,_a as xE,aa as KE,b as v,ba as YE,bb as vE,c as l,ca as WE,d as I8,db as gE,e as jn,ea as qE,eb as fE,f as WU,fa as y2,fb as mE,ga as BE,gb as uE,h as zU,ha as UE,hb as nT,i as IJ,ia as FE,ib as pE,j as j8,ja as gA,k as AL,ka as VE,kb as nE,l as L1,la as LE,lb as cE,m as b1,ma as NE,n as uV,nb as dE,o as XQ,oa as _E,ob as lE,p as jL,pa as ME,pb as U4,q as a6,qb as pN,r as r6,ra as AE,rb as g8,s as kJ,sa as ZH,sb as mT,t as d3,ta as QB,tb as T1,u as vU,ua as qS,ub as P8,v as cq,va as DE,vb as VS,w as B0,wb as GK,x as IV,xa as l5,xb as Nz,y as ck,ya as wE,yb as XN,z as AI,za as OE,zb as GN}from"/chunk-3hy3qy6d.js";import{Qb as O,Rb as g1,Sb as G4,Tb as Fn}from"/chunk-p68fnz3q.js";var xZ=g1((iS)=>{var Z4=O(v());function vS($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var gS=typeof Object.is==="function"?Object.is:vS,fS=Z4.useState,mS=Z4.useEffect,uS=Z4.useLayoutEffect,pS=Z4.useDebugValue;function cS($,Z){var J=Z(),Q=fS({inst:{value:J,getSnapshot:Z}}),X=Q[0].inst,G=Q[1];return uS(function(){X.value=J,X.getSnapshot=Z,PH(X)&&G({inst:X})},[$,J,Z]),mS(function(){return PH(X)&&G({inst:X}),$(function(){PH(X)&&G({inst:X})})},[$]),pS(J),J}function PH($){var Z=$.getSnapshot;$=$.value;try{var J=Z();return!gS($,J)}catch(Q){return!0}}function dS($,Z){return Z()}var lS=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?dS:cS;iS.useSyncExternalStore=Z4.useSyncExternalStore!==void 0?Z4.useSyncExternalStore:lS});var ww=g1((ZM0,Dw)=>{var Nw=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Qm=/\n/g,Xm=/^\s*/,Gm=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Hm=/^:\s*/,zm=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Km=/^[;\s]*/,Ym=/^\s+|\s+$/g,Wm=`
2
- `,_w="/",Mw="*",X6="",qm="comment",Bm="declaration";function Um($,Z){if(typeof $!=="string")throw TypeError("First argument must be a string");if(!$)return[];Z=Z||{};var J=1,Q=1;function X(F){var V=F.match(Qm);if(V)J+=V.length;var N=F.lastIndexOf(Wm);Q=~N?F.length-N:Q+F.length}function G(){var F={line:J,column:Q};return function(V){return V.position=new H(F),Y(),V}}function H(F){this.start=F,this.end={line:J,column:Q},this.source=Z.source}H.prototype.content=$;function z(F){var V=Error(Z.source+":"+J+":"+Q+": "+F);if(V.reason=F,V.filename=Z.source,V.line=J,V.column=Q,V.source=$,Z.silent);else throw V}function K(F){var V=F.exec($);if(!V)return;var N=V[0];return X(N),$=$.slice(N.length),V}function Y(){K(Xm)}function W(F){var V;F=F||[];while(V=q())if(V!==!1)F.push(V);return F}function q(){var F=G();if(_w!=$.charAt(0)||Mw!=$.charAt(1))return;var V=2;while(X6!=$.charAt(V)&&(Mw!=$.charAt(V)||_w!=$.charAt(V+1)))++V;if(V+=2,X6===$.charAt(V-1))return z("End of comment missing");var N=$.slice(2,V-2);return Q+=2,X(N),$=$.slice(V),Q+=2,F({type:qm,comment:N})}function B(){var F=G(),V=K(Gm);if(!V)return;if(q(),!K(Hm))return z("property missing ':'");var N=K(zm),L=F({type:Bm,property:Aw(V[0].replace(Nw,X6)),value:N?Aw(N[0].replace(Nw,X6)):X6});return K(Km),L}function U(){var F=[];W(F);var V;while(V=B())if(V!==!1)F.push(V),W(F);return F}return Y(),U()}function Aw($){return $?$.replace(Ym,X6):X6}Dw.exports=Um});var Ow=g1((R$)=>{var Fm=R$&&R$.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(R$,"__esModule",{value:!0});R$.default=Lm;var Vm=Fm(ww());function Lm($,Z){let J=null;if(!$||typeof $!=="string")return J;let Q=(0,Vm.default)($),X=typeof Z==="function";return Q.forEach((G)=>{if(G.type!=="declaration")return;let{property:H,value:z}=G;if(X)Z(H,z,G);else if(z)J=J||{},J[H]=z}),J}});var Iw=g1((jw)=>{Object.defineProperty(jw,"__esModule",{value:!0});jw.camelCase=void 0;var Nm=/^--[a-zA-Z0-9_-]+$/,_m=/-([a-z])/g,Mm=/^[^-]+$/,Am=/^-(webkit|moz|ms|o|khtml)-/,Dm=/^-(ms)-/,wm=function($){return!$||Mm.test($)||Nm.test($)},Om=function($,Z){return Z.toUpperCase()},Pw=function($,Z){return"".concat(Z,"-")},Pm=function($,Z){if(Z===void 0)Z={};if(wm($))return $;if($=$.toLowerCase(),Z.reactCompat)$=$.replace(Dm,Pw);else $=$.replace(Am,Pw);return $.replace(_m,Om)};jw.camelCase=Pm});var kw=g1((DY,Tw)=>{var jm=DY&&DY.__importDefault||function($){return $&&$.__esModule?$:{default:$}},Cm=jm(Ow()),Im=Iw();function AY($,Z){var J={};if(!$||typeof $!=="string")return J;return(0,Cm.default)($,function(Q,X){if(Q&&X)J[(0,Im.camelCase)(Q,Z)]=X}),J}AY.default=AY;Tw.exports=AY});var nO=g1((iP0,sO)=>{var KG=Object.prototype.hasOwnProperty,aO=Object.prototype.toString,pO=Object.defineProperty,cO=Object.getOwnPropertyDescriptor,dO=function(Z){if(typeof Array.isArray==="function")return Array.isArray(Z);return aO.call(Z)==="[object Array]"},lO=function(Z){if(!Z||aO.call(Z)!=="[object Object]")return!1;var J=KG.call(Z,"constructor"),Q=Z.constructor&&Z.constructor.prototype&&KG.call(Z.constructor.prototype,"isPrototypeOf");if(Z.constructor&&!J&&!Q)return!1;var X;for(X in Z);return typeof X>"u"||KG.call(Z,X)},iO=function(Z,J){if(pO&&J.name==="__proto__")pO(Z,J.name,{enumerable:!0,configurable:!0,value:J.newValue,writable:!0});else Z[J.name]=J.newValue},rO=function(Z,J){if(J==="__proto__"){if(!KG.call(Z,J))return;else if(cO)return cO(Z,J).value}return Z[J]};sO.exports=function $(){var Z,J,Q,X,G,H,z=arguments[0],K=1,Y=arguments.length,W=!1;if(typeof z==="boolean")W=z,z=arguments[1]||{},K=2;if(z==null||typeof z!=="object"&&typeof z!=="function")z={};for(;K<Y;++K)if(Z=arguments[K],Z!=null){for(J in Z)if(Q=rO(z,J),X=rO(Z,J),z!==X){if(W&&X&&(lO(X)||(G=dO(X)))){if(G)G=!1,H=Q&&dO(Q)?Q:[];else H=Q&&lO(Q)?Q:{};iO(z,{name:J,newValue:$(W,H,X)})}else if(typeof X<"u")iO(z,{name:J,newValue:X})}}return z}});var pj=g1((UI0,uj)=>{function Cj($){if($ instanceof Map)$.clear=$.delete=$.set=function(){throw Error("map is read-only")};else if($ instanceof Set)$.add=$.clear=$.delete=function(){throw Error("set is read-only")};return Object.freeze($),Object.getOwnPropertyNames($).forEach((Z)=>{let J=$[Z],Q=typeof J;if((Q==="object"||Q==="function")&&!Object.isFrozen(J))Cj(J)}),$}class UW{constructor($){if($.data===void 0)$.data={};this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Ij($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Q9($,...Z){let J=Object.create(null);for(let Q in $)J[Q]=$[Q];return Z.forEach(function(Q){for(let X in Q)J[X]=Q[X]}),J}var tc="</span>",Aj=($)=>{return!!$.scope},ec=($,{prefix:Z})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){let J=$.split(".");return[`${Z}${J.shift()}`,...J.map((Q,X)=>`${Q}${"_".repeat(X+1)}`)].join(" ")}return`${Z}${$}`};class Tj{constructor($,Z){this.buffer="",this.classPrefix=Z.classPrefix,$.walk(this)}addText($){this.buffer+=Ij($)}openNode($){if(!Aj($))return;let Z=ec($.scope,{prefix:this.classPrefix});this.span(Z)}closeNode($){if(!Aj($))return;this.buffer+=tc}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}var Dj=($={})=>{let Z={children:[]};return Object.assign(Z,$),Z};class FW{constructor(){this.rootNode=Dj(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add($){this.top.children.push($)}openNode($){let Z=Dj({scope:$});this.add(Z),this.stack.push(Z)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk($){return this.constructor._walk($,this.rootNode)}static _walk($,Z){if(typeof Z==="string")$.addText(Z);else if(Z.children)$.openNode(Z),Z.children.forEach((J)=>this._walk($,J)),$.closeNode(Z);return $}static _collapse($){if(typeof $==="string")return;if(!$.children)return;if($.children.every((Z)=>typeof Z==="string"))$.children=[$.children.join("")];else $.children.forEach((Z)=>{FW._collapse(Z)})}}class kj extends FW{constructor($){super();this.options=$}addText($){if($==="")return;this.add($)}startScope($){this.openNode($)}endScope(){this.closeNode()}__addSublanguage($,Z){let J=$.root;if(Z)J.scope=`language:${Z}`;this.add(J)}toHTML(){return new Tj(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function s$($){if(!$)return null;if(typeof $==="string")return $;return $.source}function Ej($){return F6("(?=",$,")")}function $d($){return F6("(?:",$,")*")}function Zd($){return F6("(?:",$,")?")}function F6(...$){return $.map((J)=>s$(J)).join("")}function Jd($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function VW(...$){return"("+(Jd($).capture?"":"?:")+$.map((Q)=>s$(Q)).join("|")+")"}function Sj($){return new RegExp($.toString()+"|").exec("").length-1}function Qd($,Z){let J=$&&$.exec(Z);return J&&J.index===0}var Xd=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function LW($,{joinWith:Z}){let J=0;return $.map((Q)=>{J+=1;let X=J,G=s$(Q),H="";while(G.length>0){let z=Xd.exec(G);if(!z){H+=G;break}if(H+=G.substring(0,z.index),G=G.substring(z.index+z[0].length),z[0][0]==="\\"&&z[1])H+="\\"+String(Number(z[1])+X);else if(H+=z[0],z[0]==="(")J++}return H}).map((Q)=>`(${Q})`).join(Z)}var Gd=/\b\B/,Rj="[a-zA-Z]\\w*",NW="[a-zA-Z_]\\w*",bj="\\b\\d+(\\.\\d+)?",yj="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",xj="\\b(0b[01]+)",Hd="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",zd=($={})=>{let Z=/^#![ ]*\//;if($.binary)$.begin=F6(Z,/.*\b/,$.binary,/\b.*/);return Q9({scope:"meta",begin:Z,end:/$/,relevance:0,"on:begin":(J,Q)=>{if(J.index!==0)Q.ignoreMatch()}},$)},n$={begin:"\\\\[\\s\\S]",relevance:0},Kd={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[n$]},Yd={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[n$]},Wd={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/},AG=function($,Z,J={}){let Q=Q9({scope:"comment",begin:$,end:Z,contains:[]},J);Q.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 X=VW("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 Q.contains.push({begin:F6(/[ ]+/,"(",X,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Q},qd=AG("//","$"),Bd=AG("/\\*","\\*/"),Ud=AG("#","$"),Fd={scope:"number",begin:bj,relevance:0},Vd={scope:"number",begin:yj,relevance:0},Ld={scope:"number",begin:xj,relevance:0},Nd={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[n$,{begin:/\[/,end:/\]/,relevance:0,contains:[n$]}]},_d={scope:"title",begin:Rj,relevance:0},Md={scope:"title",begin:NW,relevance:0},Ad={begin:"\\.\\s*"+NW,relevance:0},Dd=function($){return Object.assign($,{"on:begin":(Z,J)=>{J.data._beginMatch=Z[1]},"on:end":(Z,J)=>{if(J.data._beginMatch!==Z[1])J.ignoreMatch()}})},_G=Object.freeze({__proto__:null,APOS_STRING_MODE:Kd,BACKSLASH_ESCAPE:n$,BINARY_NUMBER_MODE:Ld,BINARY_NUMBER_RE:xj,COMMENT:AG,C_BLOCK_COMMENT_MODE:Bd,C_LINE_COMMENT_MODE:qd,C_NUMBER_MODE:Vd,C_NUMBER_RE:yj,END_SAME_AS_BEGIN:Dd,HASH_COMMENT_MODE:Ud,IDENT_RE:Rj,MATCH_NOTHING_RE:Gd,METHOD_GUARD:Ad,NUMBER_MODE:Fd,NUMBER_RE:bj,PHRASAL_WORDS_MODE:Wd,QUOTE_STRING_MODE:Yd,REGEXP_MODE:Nd,RE_STARTERS_RE:Hd,SHEBANG:zd,TITLE_MODE:_d,UNDERSCORE_IDENT_RE:NW,UNDERSCORE_TITLE_MODE:Md});function wd($,Z){if($.input[$.index-1]===".")Z.ignoreMatch()}function Od($,Z){if($.className!==void 0)$.scope=$.className,delete $.className}function Pd($,Z){if(!Z)return;if(!$.beginKeywords)return;if($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=wd,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0)$.relevance=0}function jd($,Z){if(!Array.isArray($.illegal))return;$.illegal=VW(...$.illegal)}function Cd($,Z){if(!$.match)return;if($.begin||$.end)throw Error("begin & end are not supported with match");$.begin=$.match,delete $.match}function Id($,Z){if($.relevance===void 0)$.relevance=1}var Td=($,Z)=>{if(!$.beforeMatch)return;if($.starts)throw Error("beforeMatch cannot be used with starts");let J=Object.assign({},$);Object.keys($).forEach((Q)=>{delete $[Q]}),$.keywords=J.keywords,$.begin=F6(J.beforeMatch,Ej(J.begin)),$.starts={relevance:0,contains:[Object.assign(J,{endsParent:!0})]},$.relevance=0,delete J.beforeMatch},kd=["of","and","for","in","not","or","if","then","parent","list","value"],Ed="keyword";function hj($,Z,J=Ed){let Q=Object.create(null);if(typeof $==="string")X(J,$.split(" "));else if(Array.isArray($))X(J,$);else Object.keys($).forEach(function(G){Object.assign(Q,hj($[G],Z,G))});return Q;function X(G,H){if(Z)H=H.map((z)=>z.toLowerCase());H.forEach(function(z){let K=z.split("|");Q[K[0]]=[G,Sd(K[0],K[1])]})}}function Sd($,Z){if(Z)return Number(Z);return Rd($)?0:1}function Rd($){return kd.includes($.toLowerCase())}var wj={},U6=($)=>{console.error($)},Oj=($,...Z)=>{console.log(`WARN: ${$}`,...Z)},r2=($,Z)=>{if(wj[`${$}/${Z}`])return;console.log(`Deprecated as of ${$}. ${Z}`),wj[`${$}/${Z}`]=!0},MG=Error();function vj($,Z,{key:J}){let Q=0,X=$[J],G={},H={};for(let z=1;z<=Z.length;z++)H[z+Q]=X[z],G[z+Q]=!0,Q+=Sj(Z[z-1]);$[J]=H,$[J]._emit=G,$[J]._multi=!0}function bd($){if(!Array.isArray($.begin))return;if($.skip||$.excludeBegin||$.returnBegin)throw U6("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),MG;if(typeof $.beginScope!=="object"||$.beginScope===null)throw U6("beginScope must be object"),MG;vj($,$.begin,{key:"beginScope"}),$.begin=LW($.begin,{joinWith:""})}function yd($){if(!Array.isArray($.end))return;if($.skip||$.excludeEnd||$.returnEnd)throw U6("skip, excludeEnd, returnEnd not compatible with endScope: {}"),MG;if(typeof $.endScope!=="object"||$.endScope===null)throw U6("endScope must be object"),MG;vj($,$.end,{key:"endScope"}),$.end=LW($.end,{joinWith:""})}function xd($){if($.scope&&typeof $.scope==="object"&&$.scope!==null)$.beginScope=$.scope,delete $.scope}function hd($){if(xd($),typeof $.beginScope==="string")$.beginScope={_wrap:$.beginScope};if(typeof $.endScope==="string")$.endScope={_wrap:$.endScope};bd($),yd($)}function vd($){function Z(H,z){return new RegExp(s$(H),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(z?"g":""))}class J{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(H,z){z.position=this.position++,this.matchIndexes[this.matchAt]=z,this.regexes.push([z,H]),this.matchAt+=Sj(H)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let H=this.regexes.map((z)=>z[1]);this.matcherRe=Z(LW(H,{joinWith:"|"}),!0),this.lastIndex=0}exec(H){this.matcherRe.lastIndex=this.lastIndex;let z=this.matcherRe.exec(H);if(!z)return null;let K=z.findIndex((W,q)=>q>0&&W!==void 0),Y=this.matchIndexes[K];return z.splice(0,K),Object.assign(z,Y)}}class Q{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(H){if(this.multiRegexes[H])return this.multiRegexes[H];let z=new J;return this.rules.slice(H).forEach(([K,Y])=>z.addRule(K,Y)),z.compile(),this.multiRegexes[H]=z,z}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(H,z){if(this.rules.push([H,z]),z.type==="begin")this.count++}exec(H){let z=this.getMatcher(this.regexIndex);z.lastIndex=this.lastIndex;let K=z.exec(H);if(this.resumingScanAtSamePosition())if(K&&K.index===this.lastIndex);else{let Y=this.getMatcher(0);Y.lastIndex=this.lastIndex+1,K=Y.exec(H)}if(K){if(this.regexIndex+=K.position+1,this.regexIndex===this.count)this.considerAll()}return K}}function X(H){let z=new Q;if(H.contains.forEach((K)=>z.addRule(K.begin,{rule:K,type:"begin"})),H.terminatorEnd)z.addRule(H.terminatorEnd,{type:"end"});if(H.illegal)z.addRule(H.illegal,{type:"illegal"});return z}function G(H,z){let K=H;if(H.isCompiled)return K;[Od,Cd,hd,Td].forEach((W)=>W(H,z)),$.compilerExtensions.forEach((W)=>W(H,z)),H.__beforeBegin=null,[Pd,jd,Id].forEach((W)=>W(H,z)),H.isCompiled=!0;let Y=null;if(typeof H.keywords==="object"&&H.keywords.$pattern)H.keywords=Object.assign({},H.keywords),Y=H.keywords.$pattern,delete H.keywords.$pattern;if(Y=Y||/\w+/,H.keywords)H.keywords=hj(H.keywords,$.case_insensitive);if(K.keywordPatternRe=Z(Y,!0),z){if(!H.begin)H.begin=/\B|\b/;if(K.beginRe=Z(K.begin),!H.end&&!H.endsWithParent)H.end=/\B|\b/;if(H.end)K.endRe=Z(K.end);if(K.terminatorEnd=s$(K.end)||"",H.endsWithParent&&z.terminatorEnd)K.terminatorEnd+=(H.end?"|":"")+z.terminatorEnd}if(H.illegal)K.illegalRe=Z(H.illegal);if(!H.contains)H.contains=[];if(H.contains=[].concat(...H.contains.map(function(W){return gd(W==="self"?H:W)})),H.contains.forEach(function(W){G(W,K)}),H.starts)G(H.starts,z);return K.matcher=X(K),K}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=Q9($.classNameAliases||{}),G($)}function gj($){if(!$)return!1;return $.endsWithParent||gj($.starts)}function gd($){if($.variants&&!$.cachedVariants)$.cachedVariants=$.variants.map(function(Z){return Q9($,{variants:null},Z)});if($.cachedVariants)return $.cachedVariants;if(gj($))return Q9($,{starts:$.starts?Q9($.starts):null});if(Object.isFrozen($))return Q9($);return $}var fd="11.11.1";class fj extends Error{constructor($,Z){super($);this.name="HTMLInjectionError",this.html=Z}}var BW=Ij,Pj=Q9,jj=Symbol("nomatch"),md=7,mj=function($){let Z=Object.create(null),J=Object.create(null),Q=[],X=!0,G="Could not find the language '{}', did you forget to load/include a language module?",H={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:kj};function K(I){return z.noHighlightRe.test(I)}function Y(I){let S=I.className+" ";S+=I.parentNode?I.parentNode.className:"";let h=z.languageDetectRe.exec(S);if(h){let p=T(h[1]);if(!p)Oj(G.replace("{}",h[1])),Oj("Falling back to no-highlight mode for this block.",I);return p?h[1]:"no-highlight"}return S.split(/\s+/).find((p)=>K(p)||T(p))}function W(I,S,h){let p="",P="";if(typeof S==="object")p=I,h=S.ignoreIllegals,P=S.language;else r2("10.7.0","highlight(lang, code, ...args) has been deprecated."),r2("10.7.0",`Please use highlight(code, options) instead.
3
- https://github.com/highlightjs/highlight.js/issues/2277`),P=I,p=S;if(h===void 0)h=!0;let t={code:p,language:P};x("before:highlight",t);let z0=t.result?t.result:q(t.language,t.code,h);return z0.code=t.code,x("after:highlight",z0),z0}function q(I,S,h,p){let P=Object.create(null);function t(f,d){return f.keywords[d]}function z0(){if(!r.keywords){q0.addText(a);return}let f=0;r.keywordPatternRe.lastIndex=0;let d=r.keywordPatternRe.exec(a),$0="";while(d){$0+=a.substring(f,d.index);let V0=F0.case_insensitive?d[0].toLowerCase():d[0],j0=t(r,V0);if(j0){let[g0,D1]=j0;if(q0.addText($0),$0="",P[V0]=(P[V0]||0)+1,P[V0]<=md)A0+=D1;if(g0.startsWith("_"))$0+=d[0];else{let h1=F0.classNameAliases[g0]||g0;_0(d[0],h1)}}else $0+=d[0];f=r.keywordPatternRe.lastIndex,d=r.keywordPatternRe.exec(a)}$0+=a.substring(f),q0.addText($0)}function y(){if(a==="")return;let f=null;if(typeof r.subLanguage==="string"){if(!Z[r.subLanguage]){q0.addText(a);return}f=q(r.subLanguage,a,!0,e[r.subLanguage]),e[r.subLanguage]=f._top}else f=U(a,r.subLanguage.length?r.subLanguage:null);if(r.relevance>0)A0+=f.relevance;q0.__addSublanguage(f._emitter,f.language)}function n(){if(r.subLanguage!=null)y();else z0();a=""}function _0(f,d){if(f==="")return;q0.startScope(d),q0.addText(f),q0.endScope()}function c(f,d){let $0=1,V0=d.length-1;while($0<=V0){if(!f._emit[$0]){$0++;continue}let j0=F0.classNameAliases[f[$0]]||f[$0],g0=d[$0];if(j0)_0(g0,j0);else a=g0,z0(),a="";$0++}}function X0(f,d){if(f.scope&&typeof f.scope==="string")q0.openNode(F0.classNameAliases[f.scope]||f.scope);if(f.beginScope){if(f.beginScope._wrap)_0(a,F0.classNameAliases[f.beginScope._wrap]||f.beginScope._wrap),a="";else if(f.beginScope._multi)c(f.beginScope,d),a=""}return r=Object.create(f,{parent:{value:r}}),r}function K0(f,d,$0){let V0=Qd(f.endRe,$0);if(V0){if(f["on:end"]){let j0=new UW(f);if(f["on:end"](d,j0),j0.isMatchIgnored)V0=!1}if(V0){while(f.endsParent&&f.parent)f=f.parent;return f}}if(f.endsWithParent)return K0(f.parent,d,$0)}function Z0(f){if(r.matcher.regexIndex===0)return a+=f[0],1;else return z1=!0,0}function G0(f){let d=f[0],$0=f.rule,V0=new UW($0),j0=[$0.__beforeBegin,$0["on:begin"]];for(let g0 of j0){if(!g0)continue;if(g0(f,V0),V0.isMatchIgnored)return Z0(d)}if($0.skip)a+=d;else{if($0.excludeBegin)a+=d;if(n(),!$0.returnBegin&&!$0.excludeBegin)a=d}return X0($0,f),$0.returnBegin?0:d.length}function U0(f){let d=f[0],$0=S.substring(f.index),V0=K0(r,f,$0);if(!V0)return jj;let j0=r;if(r.endScope&&r.endScope._wrap)n(),_0(d,r.endScope._wrap);else if(r.endScope&&r.endScope._multi)n(),c(r.endScope,f);else if(j0.skip)a+=d;else{if(!(j0.returnEnd||j0.excludeEnd))a+=d;if(n(),j0.excludeEnd)a=d}do{if(r.scope)q0.closeNode();if(!r.skip&&!r.subLanguage)A0+=r.relevance;r=r.parent}while(r!==V0.parent);if(V0.starts)X0(V0.starts,f);return j0.returnEnd?0:d.length}function m(){let f=[];for(let d=r;d!==F0;d=d.parent)if(d.scope)f.unshift(d.scope);f.forEach((d)=>q0.openNode(d))}let s={};function u(f,d){let $0=d&&d[0];if(a+=f,$0==null)return n(),0;if(s.type==="begin"&&d.type==="end"&&s.index===d.index&&$0===""){if(a+=S.slice(d.index,d.index+1),!X){let V0=Error(`0 width match regex (${I})`);throw V0.languageName=I,V0.badRule=s.rule,V0}return 1}if(s=d,d.type==="begin")return G0(d);else if(d.type==="illegal"&&!h){let V0=Error('Illegal lexeme "'+$0+'" for mode "'+(r.scope||"<unnamed>")+'"');throw V0.mode=r,V0}else if(d.type==="end"){let V0=U0(d);if(V0!==jj)return V0}if(d.type==="illegal"&&$0==="")return a+=`
4
- `,1;if(i0>1e5&&i0>d.index*3)throw Error("potential infinite loop, way more iterations than matches");return a+=$0,$0.length}let F0=T(I);if(!F0)throw U6(G.replace("{}",I)),Error('Unknown language: "'+I+'"');let i=vd(F0),Y0="",r=p||i,e={},q0=new z.__emitter(z);m();let a="",A0=0,I0=0,i0=0,z1=!1;try{if(!F0.__emitTokens){r.matcher.considerAll();for(;;){if(i0++,z1)z1=!1;else r.matcher.considerAll();r.matcher.lastIndex=I0;let f=r.matcher.exec(S);if(!f)break;let d=S.substring(I0,f.index),$0=u(d,f);I0=f.index+$0}u(S.substring(I0))}else F0.__emitTokens(S,q0);return q0.finalize(),Y0=q0.toHTML(),{language:I,value:Y0,relevance:A0,illegal:!1,_emitter:q0,_top:r}}catch(f){if(f.message&&f.message.includes("Illegal"))return{language:I,value:BW(S),illegal:!0,relevance:0,_illegalBy:{message:f.message,index:I0,context:S.slice(I0-100,I0+100),mode:f.mode,resultSoFar:Y0},_emitter:q0};else if(X)return{language:I,value:BW(S),illegal:!1,relevance:0,errorRaised:f,_emitter:q0,_top:r};else throw f}}function B(I){let S={value:BW(I),illegal:!1,relevance:0,_top:H,_emitter:new z.__emitter(z)};return S._emitter.addText(I),S}function U(I,S){S=S||z.languages||Object.keys(Z);let h=B(I),p=S.filter(T).filter(C).map((n)=>q(n,I,!1));p.unshift(h);let P=p.sort((n,_0)=>{if(n.relevance!==_0.relevance)return _0.relevance-n.relevance;if(n.language&&_0.language){if(T(n.language).supersetOf===_0.language)return 1;else if(T(_0.language).supersetOf===n.language)return-1}return 0}),[t,z0]=P,y=t;return y.secondBest=z0,y}function F(I,S,h){let p=S&&J[S]||h;I.classList.add("hljs"),I.classList.add(`language-${p}`)}function V(I){let S=null,h=Y(I);if(K(h))return;if(x("before:highlightElement",{el:I,language:h}),I.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",I);return}if(I.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(I);if(z.throwUnescapedHTML)throw new fj("One of your code blocks includes unescaped HTML.",I.innerHTML)}S=I;let p=S.textContent,P=h?W(p,{language:h,ignoreIllegals:!0}):U(p);if(I.innerHTML=P.value,I.dataset.highlighted="yes",F(I,h,P.language),I.result={language:P.language,re:P.relevance,relevance:P.relevance},P.secondBest)I.secondBest={language:P.secondBest.language,relevance:P.secondBest.relevance};x("after:highlightElement",{el:I,result:P,text:p})}function N(I){z=Pj(z,I)}let L=()=>{A(),r2("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function _(){A(),r2("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let w=!1;function A(){function I(){A()}if(document.readyState==="loading"){if(!w)window.addEventListener("DOMContentLoaded",I,!1);w=!0;return}document.querySelectorAll(z.cssSelector).forEach(V)}function D(I,S){let h=null;try{h=S($)}catch(p){if(U6("Language definition for '{}' could not be registered.".replace("{}",I)),!X)throw p;else U6(p);h=H}if(!h.name)h.name=I;if(Z[I]=h,h.rawDefinition=S.bind(null,$),h.aliases)E(h.aliases,{languageName:I})}function M(I){delete Z[I];for(let S of Object.keys(J))if(J[S]===I)delete J[S]}function j(){return Object.keys(Z)}function T(I){return I=(I||"").toLowerCase(),Z[I]||Z[J[I]]}function E(I,{languageName:S}){if(typeof I==="string")I=[I];I.forEach((h)=>{J[h.toLowerCase()]=S})}function C(I){let S=T(I);return S&&!S.disableAutodetect}function g(I){if(I["before:highlightBlock"]&&!I["before:highlightElement"])I["before:highlightElement"]=(S)=>{I["before:highlightBlock"](Object.assign({block:S.el},S))};if(I["after:highlightBlock"]&&!I["after:highlightElement"])I["after:highlightElement"]=(S)=>{I["after:highlightBlock"](Object.assign({block:S.el},S))}}function b(I){g(I),Q.push(I)}function k(I){let S=Q.indexOf(I);if(S!==-1)Q.splice(S,1)}function x(I,S){let h=I;Q.forEach(function(p){if(p[h])p[h](S)})}function R(I){return r2("10.7.0","highlightBlock will be removed entirely in v12.0"),r2("10.7.0","Please use highlightElement now."),V(I)}Object.assign($,{highlight:W,highlightAuto:U,highlightAll:A,highlightElement:V,highlightBlock:R,configure:N,initHighlighting:L,initHighlightingOnLoad:_,registerLanguage:D,unregisterLanguage:M,listLanguages:j,getLanguage:T,registerAliases:E,autoDetection:C,inherit:Pj,addPlugin:b,removePlugin:k}),$.debugMode=function(){X=!1},$.safeMode=function(){X=!0},$.versionString=fd,$.regex={concat:F6,lookahead:Ej,either:VW,optional:Zd,anyNumberOfTimes:$d};for(let I in _G)if(typeof _G[I]==="object")Cj(_G[I]);return Object.assign($,_G),$},a2=mj({});a2.newInstance=()=>mj({});uj.exports=a2;a2.HighlightJS=a2;a2.default=a2});var fI=g1((vG,gI)=>{(function($,Z){typeof vG==="object"&&typeof gI<"u"?Z(vG):typeof define==="function"&&define.amd?define(["exports"],Z):($=typeof globalThis<"u"?globalThis:$||self,Z($["fast-equals"]={}))})(vG,function($){function Z(c){return function(K0,Z0,G0,U0,m,s,u){return c(K0,Z0,u)}}function J(c){return function(K0,Z0,G0,U0){if(!K0||!Z0||typeof K0!=="object"||typeof Z0!=="object")return c(K0,Z0,G0,U0);var m=U0.get(K0),s=U0.get(Z0);if(m&&s)return m===Z0&&s===K0;U0.set(K0,Z0),U0.set(Z0,K0);var u=c(K0,Z0,G0,U0);return U0.delete(K0),U0.delete(Z0),u}}function Q(c,X0){var K0={};for(var Z0 in c)K0[Z0]=c[Z0];for(var Z0 in X0)K0[Z0]=X0[Z0];return K0}function X(c){return c.constructor===Object||c.constructor==null}function G(c){return typeof c.then==="function"}function H(c,X0){return c===X0||c!==c&&X0!==X0}var z="[object Arguments]",K="[object Boolean]",Y="[object Date]",W="[object RegExp]",q="[object Map]",B="[object Number]",U="[object Object]",F="[object Set]",V="[object String]",N=Object.prototype.toString;function L(c){var{areArraysEqual:X0,areDatesEqual:K0,areMapsEqual:Z0,areObjectsEqual:G0,areRegExpsEqual:U0,areSetsEqual:m,createIsNestedEqual:s}=c,u=s(F0);function F0(i,Y0,r){if(i===Y0)return!0;if(!i||!Y0||typeof i!=="object"||typeof Y0!=="object")return i!==i&&Y0!==Y0;if(X(i)&&X(Y0))return G0(i,Y0,u,r);var e=Array.isArray(i),q0=Array.isArray(Y0);if(e||q0)return e===q0&&X0(i,Y0,u,r);var a=N.call(i);if(a!==N.call(Y0))return!1;if(a===Y)return K0(i,Y0,u,r);if(a===W)return U0(i,Y0,u,r);if(a===q)return Z0(i,Y0,u,r);if(a===F)return m(i,Y0,u,r);if(a===U||a===z)return G(i)||G(Y0)?!1:G0(i,Y0,u,r);if(a===K||a===B||a===V)return H(i.valueOf(),Y0.valueOf());return!1}return F0}function _(c,X0,K0,Z0){var G0=c.length;if(X0.length!==G0)return!1;while(G0-- >0)if(!K0(c[G0],X0[G0],G0,G0,c,X0,Z0))return!1;return!0}var w=J(_);function A(c,X0){return H(c.valueOf(),X0.valueOf())}function D(c,X0,K0,Z0){var G0=c.size===X0.size;if(!G0)return!1;if(!c.size)return!0;var U0={},m=0;return c.forEach(function(s,u){if(!G0)return;var F0=!1,i=0;X0.forEach(function(Y0,r){if(!F0&&!U0[i]&&(F0=K0(u,r,m,i,c,X0,Z0)&&K0(s,Y0,u,r,c,X0,Z0)))U0[i]=!0;i++}),m++,G0=F0}),G0}var M=J(D),j="_owner",T=Object.prototype.hasOwnProperty;function E(c,X0,K0,Z0){var G0=Object.keys(c),U0=G0.length;if(Object.keys(X0).length!==U0)return!1;var m;while(U0-- >0){if(m=G0[U0],m===j){var s=!!c.$$typeof,u=!!X0.$$typeof;if((s||u)&&s!==u)return!1}if(!T.call(X0,m)||!K0(c[m],X0[m],m,m,c,X0,Z0))return!1}return!0}var C=J(E);function g(c,X0){return c.source===X0.source&&c.flags===X0.flags}function b(c,X0,K0,Z0){var G0=c.size===X0.size;if(!G0)return!1;if(!c.size)return!0;var U0={};return c.forEach(function(m,s){if(!G0)return;var u=!1,F0=0;X0.forEach(function(i,Y0){if(!u&&!U0[F0]&&(u=K0(m,i,s,Y0,c,X0,Z0)))U0[F0]=!0;F0++}),G0=u}),G0}var k=J(b),x=Object.freeze({areArraysEqual:_,areDatesEqual:A,areMapsEqual:D,areObjectsEqual:E,areRegExpsEqual:g,areSetsEqual:b,createIsNestedEqual:Z}),R=Object.freeze({areArraysEqual:w,areDatesEqual:A,areMapsEqual:M,areObjectsEqual:C,areRegExpsEqual:g,areSetsEqual:k,createIsNestedEqual:Z}),I=L(x);function S(c,X0){return I(c,X0,void 0)}var h=L(Q(x,{createIsNestedEqual:function(){return H}}));function p(c,X0){return h(c,X0,void 0)}var P=L(R);function t(c,X0){return P(c,X0,new WeakMap)}var z0=L(Q(R,{createIsNestedEqual:function(){return H}}));function y(c,X0){return z0(c,X0,new WeakMap)}function n(c){return L(Q(x,c(x)))}function _0(c){var X0=L(Q(R,c(R)));return function(K0,Z0,G0){if(G0===void 0)G0=new WeakMap;return X0(K0,Z0,G0)}}$.circularDeepEqual=t,$.circularShallowEqual=y,$.createCustomCircularEqual=_0,$.createCustomEqual=n,$.deepEqual=S,$.sameValueZeroEqual=H,$.shallowEqual=p,Object.defineProperty($,"__esModule",{value:!0})})});var uI=g1((Dy0,mI)=>{var ii="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";mI.exports=ii});var lI=g1((wy0,dI)=>{var ri=uI();function pI(){}function cI(){}cI.resetWarningCache=pI;dI.exports=function(){function $(Q,X,G,H,z,K){if(K===ri)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 Z(){return $}var J={array:$,bigint:$,bool:$,func:$,number:$,object:$,string:$,symbol:$,any:$,arrayOf:Z,element:$,elementType:$,instanceOf:Z,node:$,objectOf:Z,oneOf:Z,oneOfType:Z,shape:Z,exact:Z,checkPropTypes:cI,resetWarningCache:pI};return J.PropTypes=J,J}});var BZ=g1((Oy0,iI)=>{iI.exports=lI()();var ai,si});var sI=g1((Py0,Oq)=>{function aI($){var Z,J,Q="";if(typeof $=="string"||typeof $=="number")Q+=$;else if(typeof $=="object")if(Array.isArray($)){var X=$.length;for(Z=0;Z<X;Z++)$[Z]&&(J=aI($[Z]))&&(Q&&(Q+=" "),Q+=J)}else for(J in $)$[J]&&(Q&&(Q+=" "),Q+=J);return Q}function rI(){for(var $,Z,J=0,Q="",X=arguments.length;J<X;J++)($=arguments[J])&&(Z=aI($))&&(Q&&(Q+=" "),Q+=Z);return Q}Oq.exports=rI,Oq.exports.clsx=rI});var UZ=g1((nI)=>{Object.defineProperty(nI,"__esModule",{value:!0});nI.dontSetMe=$r;nI.findInArray=ni;nI.int=ei;nI.isFunction=oi;nI.isNum=ti;function ni($,Z){for(let J=0,Q=$.length;J<Q;J++)if(Z.apply(Z,[$[J],J,$]))return $[J]}function oi($){return typeof $==="function"||Object.prototype.toString.call($)==="[object Function]"}function ti($){return typeof $==="number"&&!isNaN($)}function ei($){return parseInt($,10)}function $r($,Z,J){if($[Z])return Error(`Invalid prop ${Z} passed to ${J} - do not set this, set it on the child.`)}});var ZT=g1((eI)=>{Object.defineProperty(eI,"__esModule",{value:!0});eI.browserPrefixToKey=tI;eI.browserPrefixToStyle=Hr;eI.default=void 0;eI.getPrefix=oI;var Pq=["Moz","Webkit","O","ms"];function oI(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";let Z=window.document?.documentElement?.style;if(!Z)return"";if($ in Z)return"";for(let J=0;J<Pq.length;J++)if(tI($,Pq[J])in Z)return Pq[J];return""}function tI($,Z){return Z?`${Z}${zr($)}`:$}function Hr($,Z){return Z?`-${Z.toLowerCase()}-${$}`:$}function zr($){let Z="",J=!0;for(let Q=0;Q<$.length;Q++)if(J)Z+=$[Q].toUpperCase(),J=!1;else if($[Q]==="-")J=!0;else Z+=$[Q];return Z}var Cy0=eI.default=oI()});var fG=g1((KT)=>{Object.defineProperty(KT,"__esModule",{value:!0});KT.addClassName=HT;KT.addEvent=Br;KT.addUserSelectStyles=Or;KT.createCSSTransform=Mr;KT.createSVGTransform=Ar;KT.getTouch=Dr;KT.getTouchIdentifier=wr;KT.getTranslation=jq;KT.innerHeight=Lr;KT.innerWidth=Nr;KT.matchesSelector=GT;KT.matchesSelectorAndParentsTo=qr;KT.offsetXYFromParent=_r;KT.outerHeight=Fr;KT.outerWidth=Vr;KT.removeClassName=zT;KT.removeEvent=Ur;KT.scheduleRemoveUserSelectStyles=Pr;var R8=UZ(),JT=XT(ZT());function XT($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(XT=function(X,G){if(!G&&X&&X.__esModule)return X;var H,z,K={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return K;if(H=G?Q:J){if(H.has(X))return H.get(X);H.set(X,K)}for(let Y in X)Y!=="default"&&{}.hasOwnProperty.call(X,Y)&&((z=(H=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,Y))&&(z.get||z.set)?H(K,Y,z):K[Y]=X[Y]);return K})($,Z)}var gG="";function GT($,Z){if(!gG)gG=(0,R8.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(J){return(0,R8.isFunction)($[J])});if(!(0,R8.isFunction)($[gG]))return!1;return $[gG](Z)}function qr($,Z,J){let Q=$;do{if(GT(Q,Z))return!0;if(Q===J)return!1;Q=Q.parentNode}while(Q);return!1}function Br($,Z,J,Q){if(!$)return;let X={capture:!0,...Q};if($.addEventListener)$.addEventListener(Z,J,X);else if($.attachEvent)$.attachEvent("on"+Z,J);else $["on"+Z]=J}function Ur($,Z,J,Q){if(!$)return;let X={capture:!0,...Q};if($.removeEventListener)$.removeEventListener(Z,J,X);else if($.detachEvent)$.detachEvent("on"+Z,J);else $["on"+Z]=null}function Fr($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,R8.int)(J.borderTopWidth),Z+=(0,R8.int)(J.borderBottomWidth),Z}function Vr($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,R8.int)(J.borderLeftWidth),Z+=(0,R8.int)(J.borderRightWidth),Z}function Lr($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,R8.int)(J.paddingTop),Z-=(0,R8.int)(J.paddingBottom),Z}function Nr($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,R8.int)(J.paddingLeft),Z-=(0,R8.int)(J.paddingRight),Z}function _r($,Z,J){let X=Z===Z.ownerDocument.body?{left:0,top:0}:Z.getBoundingClientRect(),G=($.clientX+Z.scrollLeft-X.left)/J,H=($.clientY+Z.scrollTop-X.top)/J;return{x:G,y:H}}function Mr($,Z){let J=jq($,Z,"px");return{[(0,JT.browserPrefixToKey)("transform",JT.default)]:J}}function Ar($,Z){return jq($,Z,"")}function jq($,Z,J){let{x:Q,y:X}=$,G=`translate(${Q}${J},${X}${J})`;if(Z){let H=`${typeof Z.x==="string"?Z.x:Z.x+J}`,z=`${typeof Z.y==="string"?Z.y:Z.y+J}`;G=`translate(${H}, ${z})`+G}return G}function Dr($,Z){return $.targetTouches&&(0,R8.findInArray)($.targetTouches,(J)=>Z===J.identifier)||$.changedTouches&&(0,R8.findInArray)($.changedTouches,(J)=>Z===J.identifier)}function wr($){if($.targetTouches&&$.targetTouches[0])return $.targetTouches[0].identifier;if($.changedTouches&&$.changedTouches[0])return $.changedTouches[0].identifier}function Or($){if(!$)return;let Z=$.getElementById("react-draggable-style-el");if(!Z)Z=$.createElement("style"),Z.type="text/css",Z.id="react-draggable-style-el",Z.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
5
- `,Z.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
6
- `,$.getElementsByTagName("head")[0].appendChild(Z);if($.body)HT($.body,"react-draggable-transparent-selection")}function Pr($){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{QT($)});else QT($)}function QT($){if(!$)return;try{if($.body)zT($.body,"react-draggable-transparent-selection");if($.selection)$.selection.empty();else{let Z=($.defaultView||window).getSelection();if(Z&&Z.type!=="Caret")Z.removeAllRanges()}}catch(Z){}}function HT($,Z){if($.classList)$.classList.add(Z);else if(!$.className.match(new RegExp(`(?:^|\\s)${Z}(?!\\S)`)))$.className+=` ${Z}`}function zT($,Z){if($.classList)$.classList.remove(Z);else $.className=$.className.replace(new RegExp(`(?:^|\\s)${Z}(?!\\S)`,"g"),"")}});var Iq=g1((YT)=>{Object.defineProperty(YT,"__esModule",{value:!0});YT.canDragX=lr;YT.canDragY=ir;YT.createCoreData=ar;YT.createDraggableData=sr;YT.getBoundPosition=cr;YT.getControlPosition=rr;YT.snapToGrid=dr;var b8=UZ(),K3=fG();function cr($,Z,J){if(!$.props.bounds)return[Z,J];let{bounds:Q}=$.props;Q=typeof Q==="string"?Q:nr(Q);let X=Cq($);if(typeof Q==="string"){let{ownerDocument:G}=X,H=G.defaultView,z;if(Q==="parent")z=X.parentNode;else z=X.getRootNode().querySelector(Q);if(!(z instanceof H.HTMLElement))throw Error('Bounds selector "'+Q+'" could not find an element.');let K=z,Y=H.getComputedStyle(X),W=H.getComputedStyle(K);Q={left:-X.offsetLeft+(0,b8.int)(W.paddingLeft)+(0,b8.int)(Y.marginLeft),top:-X.offsetTop+(0,b8.int)(W.paddingTop)+(0,b8.int)(Y.marginTop),right:(0,K3.innerWidth)(K)-(0,K3.outerWidth)(X)-X.offsetLeft+(0,b8.int)(W.paddingRight)-(0,b8.int)(Y.marginRight),bottom:(0,K3.innerHeight)(K)-(0,K3.outerHeight)(X)-X.offsetTop+(0,b8.int)(W.paddingBottom)-(0,b8.int)(Y.marginBottom)}}if((0,b8.isNum)(Q.right))Z=Math.min(Z,Q.right);if((0,b8.isNum)(Q.bottom))J=Math.min(J,Q.bottom);if((0,b8.isNum)(Q.left))Z=Math.max(Z,Q.left);if((0,b8.isNum)(Q.top))J=Math.max(J,Q.top);return[Z,J]}function dr($,Z,J){let Q=Math.round(Z/$[0])*$[0],X=Math.round(J/$[1])*$[1];return[Q,X]}function lr($){return $.props.axis==="both"||$.props.axis==="x"}function ir($){return $.props.axis==="both"||$.props.axis==="y"}function rr($,Z,J){let Q=typeof Z==="number"?(0,K3.getTouch)($,Z):null;if(typeof Z==="number"&&!Q)return null;let X=Cq(J),G=J.props.offsetParent||X.offsetParent||X.ownerDocument.body;return(0,K3.offsetXYFromParent)(Q||$,G,J.props.scale)}function ar($,Z,J){let Q=!(0,b8.isNum)($.lastX),X=Cq($);if(Q)return{node:X,deltaX:0,deltaY:0,lastX:Z,lastY:J,x:Z,y:J};else return{node:X,deltaX:Z-$.lastX,deltaY:J-$.lastY,lastX:$.lastX,lastY:$.lastY,x:Z,y:J}}function sr($,Z){let J=$.props.scale;return{node:Z.node,x:$.state.x+Z.deltaX/J,y:$.state.y+Z.deltaY/J,deltaX:Z.deltaX/J,deltaY:Z.deltaY/J,lastX:$.state.x,lastY:$.state.y}}function nr($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom}}function Cq($){let Z=$.findDOMNode();if(!Z)throw Error("<DraggableCore>: Unmounted during event!");return Z}});var Tq=g1((WT)=>{Object.defineProperty(WT,"__esModule",{value:!0});WT.default=Xa;function Xa(){}});var FT=g1((BT)=>{var Ya=O(v()),Wa=O(I8());Object.defineProperty(BT,"__esModule",{value:!0});BT.default=void 0;var kq=qT(Ya),q8=Sq(BZ()),Ha=Sq(Wa),J8=fG(),B9=Iq(),Eq=UZ(),FZ=Sq(Tq());function Sq($){return $&&$.__esModule?$:{default:$}}function qT($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(qT=function(X,G){if(!G&&X&&X.__esModule)return X;var H,z,K={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return K;if(H=G?Q:J){if(H.has(X))return H.get(X);H.set(X,K)}for(let Y in X)Y!=="default"&&{}.hasOwnProperty.call(X,Y)&&((z=(H=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,Y))&&(z.get||z.set)?H(K,Y,z):K[Y]=X[Y]);return K})($,Z)}function B8($,Z,J){return(Z=za(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function za($){var Z=Ka($,"string");return typeof Z=="symbol"?Z:Z+""}function Ka($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}var M4={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},U9=M4.mouse;class VZ extends kq.Component{constructor(){super(...arguments);B8(this,"dragging",!1),B8(this,"lastX",NaN),B8(this,"lastY",NaN),B8(this,"touchIdentifier",null),B8(this,"mounted",!1),B8(this,"handleDragStart",($)=>{if(this.props.onMouseDown($),!this.props.allowAnyClick&&typeof $.button==="number"&&$.button!==0)return!1;let Z=this.findDOMNode();if(!Z||!Z.ownerDocument||!Z.ownerDocument.body)throw Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:J}=Z;if(this.props.disabled||!($.target instanceof J.defaultView.Node)||this.props.handle&&!(0,J8.matchesSelectorAndParentsTo)($.target,this.props.handle,Z)||this.props.cancel&&(0,J8.matchesSelectorAndParentsTo)($.target,this.props.cancel,Z))return;if($.type==="touchstart"&&!this.props.allowMobileScroll)$.preventDefault();let Q=(0,J8.getTouchIdentifier)($);this.touchIdentifier=Q;let X=(0,B9.getControlPosition)($,Q,this);if(X==null)return;let{x:G,y:H}=X,z=(0,B9.createCoreData)(this,G,H);if((0,FZ.default)("DraggableCore: handleDragStart: %j",z),(0,FZ.default)("calling",this.props.onStart),this.props.onStart($,z)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,J8.addUserSelectStyles)(J);this.dragging=!0,this.lastX=G,this.lastY=H,(0,J8.addEvent)(J,U9.move,this.handleDrag),(0,J8.addEvent)(J,U9.stop,this.handleDragStop)}),B8(this,"handleDrag",($)=>{let Z=(0,B9.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:Q}=Z;if(Array.isArray(this.props.grid)){let H=J-this.lastX,z=Q-this.lastY;if([H,z]=(0,B9.snapToGrid)(this.props.grid,H,z),!H&&!z)return;J=this.lastX+H,Q=this.lastY+z}let X=(0,B9.createCoreData)(this,J,Q);if((0,FZ.default)("DraggableCore: handleDrag: %j",X),this.props.onDrag($,X)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(H){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=J,this.lastY=Q}),B8(this,"handleDragStop",($)=>{if(!this.dragging)return;let Z=(0,B9.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:Q}=Z;if(Array.isArray(this.props.grid)){let z=J-this.lastX||0,K=Q-this.lastY||0;[z,K]=(0,B9.snapToGrid)(this.props.grid,z,K),J=this.lastX+z,Q=this.lastY+K}let X=(0,B9.createCoreData)(this,J,Q);if(this.props.onStop($,X)===!1||this.mounted===!1)return!1;let H=this.findDOMNode();if(H){if(this.props.enableUserSelectHack)(0,J8.scheduleRemoveUserSelectStyles)(H.ownerDocument)}if((0,FZ.default)("DraggableCore: handleDragStop: %j",X),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,H)(0,FZ.default)("DraggableCore: Removing handlers"),(0,J8.removeEvent)(H.ownerDocument,U9.move,this.handleDrag),(0,J8.removeEvent)(H.ownerDocument,U9.stop,this.handleDragStop)}),B8(this,"onMouseDown",($)=>{return U9=M4.mouse,this.handleDragStart($)}),B8(this,"onMouseUp",($)=>{return U9=M4.mouse,this.handleDragStop($)}),B8(this,"onTouchStart",($)=>{return U9=M4.touch,this.handleDragStart($)}),B8(this,"onTouchEnd",($)=>{return U9=M4.touch,this.handleDragStop($)})}componentDidMount(){this.mounted=!0;let $=this.findDOMNode();if($)(0,J8.addEvent)($,M4.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let $=this.findDOMNode();if($){let{ownerDocument:Z}=$;if((0,J8.removeEvent)(Z,M4.mouse.move,this.handleDrag),(0,J8.removeEvent)(Z,M4.touch.move,this.handleDrag),(0,J8.removeEvent)(Z,M4.mouse.stop,this.handleDragStop),(0,J8.removeEvent)(Z,M4.touch.stop,this.handleDragStop),(0,J8.removeEvent)($,M4.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,J8.scheduleRemoveUserSelectStyles)(Z)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:Ha.default.findDOMNode(this)}render(){return kq.cloneElement(kq.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}BT.default=VZ;B8(VZ,"displayName","DraggableCore");B8(VZ,"propTypes",{allowAnyClick:q8.default.bool,allowMobileScroll:q8.default.bool,children:q8.default.node.isRequired,disabled:q8.default.bool,enableUserSelectHack:q8.default.bool,offsetParent:function($,Z){if($[Z]&&$[Z].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:q8.default.arrayOf(q8.default.number),handle:q8.default.string,cancel:q8.default.string,nodeRef:q8.default.object,onStart:q8.default.func,onDrag:q8.default.func,onStop:q8.default.func,onMouseDown:q8.default.func,scale:q8.default.number,className:Eq.dontSetMe,style:Eq.dontSetMe,transform:Eq.dontSetMe});B8(VZ,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var _T=g1((yq)=>{var Va=O(v()),La=O(I8());Object.defineProperty(yq,"__esModule",{value:!0});Object.defineProperty(yq,"DraggableCore",{enumerable:!0,get:function(){return pG.default}});yq.default=void 0;var mG=LT(Va),u1=cG(BZ()),qa=cG(La),Ba=sI(),VT=fG(),Y3=Iq(),Rq=UZ(),pG=cG(FT()),uG=cG(Tq());function cG($){return $&&$.__esModule?$:{default:$}}function LT($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(LT=function(X,G){if(!G&&X&&X.__esModule)return X;var H,z,K={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return K;if(H=G?Q:J){if(H.has(X))return H.get(X);H.set(X,K)}for(let Y in X)Y!=="default"&&{}.hasOwnProperty.call(X,Y)&&((z=(H=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,Y))&&(z.get||z.set)?H(K,Y,z):K[Y]=X[Y]);return K})($,Z)}function bq(){return bq=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var Q in J)({}).hasOwnProperty.call(J,Q)&&($[Q]=J[Q])}return $},bq.apply(null,arguments)}function W3($,Z,J){return(Z=Ua(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function Ua($){var Z=Fa($,"string");return typeof Z=="symbol"?Z:Z+""}function Fa($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class LZ extends mG.Component{static getDerivedStateFromProps($,Z){let{position:J}=$,{prevPropsPosition:Q}=Z;if(J&&(!Q||J.x!==Q.x||J.y!==Q.y))return(0,uG.default)("Draggable: getDerivedStateFromProps %j",{position:J,prevPropsPosition:Q}),{x:J.x,y:J.y,prevPropsPosition:{...J}};return null}constructor($){super($);if(W3(this,"onDragStart",(Z,J)=>{if((0,uG.default)("Draggable: onDragStart: %j",J),this.props.onStart(Z,(0,Y3.createDraggableData)(this,J))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),W3(this,"onDrag",(Z,J)=>{if(!this.state.dragging)return!1;(0,uG.default)("Draggable: onDrag: %j",J);let Q=(0,Y3.createDraggableData)(this,J),X={x:Q.x,y:Q.y,slackX:0,slackY:0};if(this.props.bounds){let{x:H,y:z}=X;X.x+=this.state.slackX,X.y+=this.state.slackY;let[K,Y]=(0,Y3.getBoundPosition)(this,X.x,X.y);X.x=K,X.y=Y,X.slackX=this.state.slackX+(H-X.x),X.slackY=this.state.slackY+(z-X.y),Q.x=X.x,Q.y=X.y,Q.deltaX=X.x-this.state.x,Q.deltaY=X.y-this.state.y}if(this.props.onDrag(Z,Q)===!1)return!1;this.setState(X)}),W3(this,"onDragStop",(Z,J)=>{if(!this.state.dragging)return!1;if(this.props.onStop(Z,(0,Y3.createDraggableData)(this,J))===!1)return!1;(0,uG.default)("Draggable: onDragStop: %j",J);let X={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){let{x:H,y:z}=this.props.position;X.x=H,X.y=z}this.setState(X)}),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??qa.default.findDOMNode(this)}render(){let{axis:$,bounds:Z,children:J,defaultPosition:Q,defaultClassName:X,defaultClassNameDragging:G,defaultClassNameDragged:H,position:z,positionOffset:K,scale:Y,...W}=this.props,q={},B=null,F=!Boolean(z)||this.state.dragging,V=z||Q,N={x:(0,Y3.canDragX)(this)&&F?this.state.x:V.x,y:(0,Y3.canDragY)(this)&&F?this.state.y:V.y};if(this.state.isElementSVG)B=(0,VT.createSVGTransform)(N,K);else q=(0,VT.createCSSTransform)(N,K);let L=(0,Ba.clsx)(J.props.className||"",X,{[G]:this.state.dragging,[H]:this.state.dragged});return mG.createElement(pG.default,bq({},W,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),mG.cloneElement(mG.Children.only(J),{className:L,style:{...J.props.style,...q},transform:B}))}}yq.default=LZ;W3(LZ,"displayName","Draggable");W3(LZ,"propTypes",{...pG.default.propTypes,axis:u1.default.oneOf(["both","x","y","none"]),bounds:u1.default.oneOfType([u1.default.shape({left:u1.default.number,right:u1.default.number,top:u1.default.number,bottom:u1.default.number}),u1.default.string,u1.default.oneOf([!1])]),defaultClassName:u1.default.string,defaultClassNameDragging:u1.default.string,defaultClassNameDragged:u1.default.string,defaultPosition:u1.default.shape({x:u1.default.number,y:u1.default.number}),positionOffset:u1.default.shape({x:u1.default.oneOfType([u1.default.number,u1.default.string]),y:u1.default.oneOfType([u1.default.number,u1.default.string])}),position:u1.default.shape({x:u1.default.number,y:u1.default.number}),className:Rq.dontSetMe,style:Rq.dontSetMe,transform:Rq.dontSetMe});W3(LZ,"defaultProps",{...pG.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 lG=g1((by0,dG)=>{var{default:MT,DraggableCore:Na}=_T();dG.exports=MT;dG.exports.default=MT;dG.exports.DraggableCore=Na});var wT=g1((Pa)=>{var Ia=O(v());Pa.__esModule=!0;Pa.cloneElement=Oa;var _a=Ma(Ia);function Ma($){return $&&$.__esModule?$:{default:$}}function AT($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);Z&&(Q=Q.filter(function(X){return Object.getOwnPropertyDescriptor($,X).enumerable})),J.push.apply(J,Q)}return J}function DT($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?AT(Object(J),!0).forEach(function(Q){Aa($,Q,J[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):AT(Object(J)).forEach(function(Q){Object.defineProperty($,Q,Object.getOwnPropertyDescriptor(J,Q))})}return $}function Aa($,Z,J){return(Z=Da(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function Da($){var Z=wa($,"string");return typeof Z=="symbol"?Z:Z+""}function wa($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function Oa($,Z){if(Z.style&&$.props.style)Z.style=DT(DT({},$.props.style),Z.style);if(Z.className&&$.props.className)Z.className=`${$.props.className} ${Z.className}`;return _a.default.cloneElement($,Z)}});var xq=g1((ka)=>{ka.__esModule=!0;ka.resizableProps=void 0;var n0=Ta(BZ()),xy0=lG();function Ta($){return $&&$.__esModule?$:{default:$}}var hy0=ka.resizableProps={axis:n0.default.oneOf(["both","x","y","none"]),className:n0.default.string,children:n0.default.element.isRequired,draggableOpts:n0.default.shape({allowAnyClick:n0.default.bool,cancel:n0.default.string,children:n0.default.node,disabled:n0.default.bool,enableUserSelectHack:n0.default.bool,offsetParent:typeof Element<"u"?n0.default.instanceOf(Element):n0.default.any,grid:n0.default.arrayOf(n0.default.number),handle:n0.default.string,nodeRef:n0.default.object,onStart:n0.default.func,onDrag:n0.default.func,onStop:n0.default.func,onMouseDown:n0.default.func,scale:n0.default.number}),height:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let[Q]=Z;if(Q.axis==="both"||Q.axis==="y")return n0.default.number.isRequired(...Z);return n0.default.number(...Z)},handle:n0.default.oneOfType([n0.default.node,n0.default.func]),handleSize:n0.default.arrayOf(n0.default.number),lockAspectRatio:n0.default.bool,maxConstraints:n0.default.arrayOf(n0.default.number),minConstraints:n0.default.arrayOf(n0.default.number),onResizeStop:n0.default.func,onResizeStart:n0.default.func,onResize:n0.default.func,resizeHandles:n0.default.arrayOf(n0.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:n0.default.number,width:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let[Q]=Z;if(Q.axis==="both"||Q.axis==="x")return n0.default.number.isRequired(...Z);return n0.default.number(...Z)}}});var gq=g1((ma)=>{var pa=O(v());ma.__esModule=!0;ma.default=void 0;var q3=jT(pa),Sa=lG(),Ra=wT(),ba=xq(),ya=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function jT($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(jT=function(X,G){if(!G&&X&&X.__esModule)return X;var H,z,K={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return K;if(H=G?Q:J){if(H.has(X))return H.get(X);H.set(X,K)}for(let Y in X)Y!=="default"&&{}.hasOwnProperty.call(X,Y)&&((z=(H=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,Y))&&(z.get||z.set)?H(K,Y,z):K[Y]=X[Y]);return K})($,Z)}function vq(){return vq=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var Q in J)({}).hasOwnProperty.call(J,Q)&&($[Q]=J[Q])}return $},vq.apply(null,arguments)}function xa($,Z){if($==null)return{};var J,Q,X=ha($,Z);if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols($);for(Q=0;Q<G.length;Q++)J=G[Q],Z.indexOf(J)===-1&&{}.propertyIsEnumerable.call($,J)&&(X[J]=$[J])}return X}function ha($,Z){if($==null)return{};var J={};for(var Q in $)if({}.hasOwnProperty.call($,Q)){if(Z.indexOf(Q)!==-1)continue;J[Q]=$[Q]}return J}function PT($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);Z&&(Q=Q.filter(function(X){return Object.getOwnPropertyDescriptor($,X).enumerable})),J.push.apply(J,Q)}return J}function hq($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?PT(Object(J),!0).forEach(function(Q){va($,Q,J[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):PT(Object(J)).forEach(function(Q){Object.defineProperty($,Q,Object.getOwnPropertyDescriptor(J,Q))})}return $}function va($,Z,J){return(Z=ga(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function ga($){var Z=fa($,"string");return typeof Z=="symbol"?Z:Z+""}function fa($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class iG extends q3.Component{constructor(){super(...arguments);this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints($,Z){let{minConstraints:J,maxConstraints:Q,lockAspectRatio:X}=this.props;if(!J&&!Q&&!X)return[$,Z];if(X){let Y=this.props.width/this.props.height,W=$-this.props.width,q=Z-this.props.height;if(Math.abs(W)>Math.abs(q*Y))Z=$/Y;else $=Z*Y}let[G,H]=[$,Z],[z,K]=this.slack||[0,0];if($+=z,Z+=K,J)$=Math.max(J[0],$),Z=Math.max(J[1],Z);if(Q)$=Math.min(Q[0],$),Z=Math.min(Q[1],Z);return this.slack=[z+(G-$),K+(H-Z)],[$,Z]}resizeHandler($,Z){return(J,Q)=>{let{node:X,deltaX:G,deltaY:H}=Q;if($==="onResizeStart")this.resetData();let z=(this.props.axis==="both"||this.props.axis==="x")&&Z!=="n"&&Z!=="s",K=(this.props.axis==="both"||this.props.axis==="y")&&Z!=="e"&&Z!=="w";if(!z&&!K)return;let Y=Z[0],W=Z[Z.length-1],q=X.getBoundingClientRect();if(this.lastHandleRect!=null){if(W==="w"){let L=q.left-this.lastHandleRect.left;G+=L}if(Y==="n"){let L=q.top-this.lastHandleRect.top;H+=L}}if(this.lastHandleRect=q,W==="w")G=-G;if(Y==="n")H=-H;let B=this.props.width+(z?G/this.props.transformScale:0),U=this.props.height+(K?H/this.props.transformScale:0);if([B,U]=this.runConstraints(B,U),$==="onResizeStop"&&this.lastSize)({width:B,height:U}=this.lastSize);let F=B!==this.props.width||U!==this.props.height;if($!=="onResizeStop")this.lastSize={width:B,height:U};let V=typeof this.props[$]==="function"?this.props[$]:null;if(V&&!($==="onResize"&&!F))J.persist?.(),V(J,{node:X,size:{width:B,height:U},handle:Z});if($==="onResizeStop")this.resetData()}}renderResizeHandle($,Z){let{handle:J}=this.props;if(!J)return q3.createElement("span",{className:`react-resizable-handle react-resizable-handle-${$}`,ref:Z});if(typeof J==="function")return J($,Z);let Q=typeof J.type==="string",X=hq({ref:Z},Q?{}:{handleAxis:$});return q3.cloneElement(J,X)}render(){let $=this.props,{children:Z,className:J,draggableOpts:Q,width:X,height:G,handle:H,handleSize:z,lockAspectRatio:K,axis:Y,minConstraints:W,maxConstraints:q,onResize:B,onResizeStop:U,onResizeStart:F,resizeHandles:V,transformScale:N}=$,L=xa($,ya);return(0,Ra.cloneElement)(Z,hq(hq({},L),{},{className:`${J?`${J} `:""}react-resizable`,children:[...q3.Children.toArray(Z.props.children),...V.map((_)=>{let w=this.handleRefs[_]??(this.handleRefs[_]=q3.createRef());return q3.createElement(Sa.DraggableCore,vq({},Q,{nodeRef:w,key:`resizableHandle-${_}`,onStop:this.resizeHandler("onResizeStop",_),onStart:this.resizeHandler("onResizeStart",_),onDrag:this.resizeHandler("onResize",_)}),this.renderResizeHandle(_,w))})]}))}}ma.default=iG;iG.propTypes=ba.resizableProps;iG.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var ST=g1((ta)=>{var $s=O(v());ta.__esModule=!0;ta.default=void 0;var fq=kT($s),ca=TT(BZ()),da=TT(gq()),la=xq(),ia=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function TT($){return $&&$.__esModule?$:{default:$}}function kT($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(kT=function(X,G){if(!G&&X&&X.__esModule)return X;var H,z,K={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return K;if(H=G?Q:J){if(H.has(X))return H.get(X);H.set(X,K)}for(let Y in X)Y!=="default"&&{}.hasOwnProperty.call(X,Y)&&((z=(H=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,Y))&&(z.get||z.set)?H(K,Y,z):K[Y]=X[Y]);return K})($,Z)}function mq(){return mq=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var Q in J)({}).hasOwnProperty.call(J,Q)&&($[Q]=J[Q])}return $},mq.apply(null,arguments)}function IT($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);Z&&(Q=Q.filter(function(X){return Object.getOwnPropertyDescriptor($,X).enumerable})),J.push.apply(J,Q)}return J}function rG($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?IT(Object(J),!0).forEach(function(Q){ra($,Q,J[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):IT(Object(J)).forEach(function(Q){Object.defineProperty($,Q,Object.getOwnPropertyDescriptor(J,Q))})}return $}function ra($,Z,J){return(Z=aa(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function aa($){var Z=sa($,"string");return typeof Z=="symbol"?Z:Z+""}function sa($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function na($,Z){if($==null)return{};var J,Q,X=oa($,Z);if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols($);for(Q=0;Q<G.length;Q++)J=G[Q],Z.indexOf(J)===-1&&{}.propertyIsEnumerable.call($,J)&&(X[J]=$[J])}return X}function oa($,Z){if($==null)return{};var J={};for(var Q in $)if({}.hasOwnProperty.call($,Q)){if(Z.indexOf(Q)!==-1)continue;J[Q]=$[Q]}return J}class uq extends fq.Component{constructor(){super(...arguments);this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=($,Z)=>{let{size:J}=Z;if(this.props.onResize)$.persist?.(),this.setState(J,()=>this.props.onResize&&this.props.onResize($,Z));else this.setState(J)}}static getDerivedStateFromProps($,Z){if(Z.propsWidth!==$.width||Z.propsHeight!==$.height)return{width:$.width,height:$.height,propsWidth:$.width,propsHeight:$.height};return null}render(){let $=this.props,{handle:Z,handleSize:J,onResize:Q,onResizeStart:X,onResizeStop:G,draggableOpts:H,minConstraints:z,maxConstraints:K,lockAspectRatio:Y,axis:W,width:q,height:B,resizeHandles:U,style:F,transformScale:V}=$,N=na($,ia);return fq.createElement(da.default,{axis:W,draggableOpts:H,handle:Z,handleSize:J,height:this.state.height,lockAspectRatio:Y,maxConstraints:K,minConstraints:z,onResizeStart:X,onResize:this.onResize,onResizeStop:G,resizeHandles:U,transformScale:V,width:this.state.width},fq.createElement("div",mq({},N,{style:rG(rG({},F),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}ta.default=uq;uq.propTypes=rG(rG({},la.resizableProps),{},{children:ca.default.element})});var RT=g1((my0,aG)=>{aG.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};aG.exports.Resizable=gq().default;aG.exports.ResizableBox=ST().default});var v8=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 PS=class extends v8{#$;#Z;#J;constructor(){super();this.#J=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$();return window.addEventListener("visibilitychange",Z,!1),()=>{window.removeEventListener("visibilitychange",Z)}}return}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#J)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#J=$,this.#Z?.(),this.#Z=$((Z)=>{if(typeof Z==="boolean")this.setFocused(Z);else this.onFocus()})}setFocused($){if(this.#$!==$)this.#$=$,this.onFocus()}onFocus(){let $=this.isFocused();this.listeners.forEach((Z)=>{Z($)})}isFocused(){if(typeof this.#$==="boolean")return this.#$;return globalThis.document?.visibilityState!=="hidden"}},A6=new PS;var jS={setTimeout:($,Z)=>setTimeout($,Z),clearTimeout:($)=>clearTimeout($),setInterval:($,Z)=>setInterval($,Z),clearInterval:($)=>clearInterval($)},CS=class{#$=jS;#Z=!1;setTimeoutProvider($){this.#$=$}setTimeout($,Z){return this.#$.setTimeout($,Z)}clearTimeout($){this.#$.clearTimeout($)}setInterval($,Z){return this.#$.setInterval($,Z)}clearInterval($){this.#$.clearInterval($)}},w4=new CS;function GB($){setTimeout($,0)}var WH=typeof window>"u"||"Deno"in globalThis;function Z5(){}function KB($,Z){return typeof $==="function"?$(Z):$}function _3($){return typeof $==="number"&&$>=0&&$!==1/0}function CZ($,Z){return Math.max($+(Z||0)-Date.now(),0)}function $4($,Z){return typeof $==="function"?$(Z):$}function G8($,Z){return typeof $==="function"?$(Z):$}function IZ($,Z){let{type:J="all",exact:Q,fetchStatus:X,predicate:G,queryKey:H,stale:z}=$;if(H){if(Q){if(Z.queryHash!==M3(H,Z.options))return!1}else if(!V9(Z.queryKey,H))return!1}if(J!=="all"){let K=Z.isActive();if(J==="active"&&!K)return!1;if(J==="inactive"&&K)return!1}if(typeof z==="boolean"&&Z.isStale()!==z)return!1;if(X&&X!==Z.state.fetchStatus)return!1;if(G&&!G(Z))return!1;return!0}function TZ($,Z){let{exact:J,status:Q,predicate:X,mutationKey:G}=$;if(G){if(!Z.options.mutationKey)return!1;if(J){if(O4(Z.options.mutationKey)!==O4(G))return!1}else if(!V9(Z.options.mutationKey,G))return!1}if(Q&&Z.state.status!==Q)return!1;if(X&&!X(Z))return!1;return!0}function M3($,Z){return(Z?.queryKeyHashFn||O4)($)}function O4($){return JSON.stringify($,(Z,J)=>YH(J)?Object.keys(J).sort().reduce((Q,X)=>{return Q[X]=J[X],Q},{}):J)}function V9($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if($&&Z&&typeof $==="object"&&typeof Z==="object")return Object.keys(Z).every((J)=>V9($[J],Z[J]));return!1}var IS=Object.prototype.hasOwnProperty;function qH($,Z,J=0){if($===Z)return $;if(J>500)return Z;let Q=HB($)&&HB(Z);if(!Q&&!(YH($)&&YH(Z)))return Z;let G=(Q?$:Object.keys($)).length,H=Q?Z:Object.keys(Z),z=H.length,K=Q?Array(z):{},Y=0;for(let W=0;W<z;W++){let q=Q?W:H[W],B=$[q],U=Z[q];if(B===U){if(K[q]=B,Q?W<G:IS.call($,q))Y++;continue}if(B===null||U===null||typeof B!=="object"||typeof U!=="object"){K[q]=U;continue}let F=qH(B,U,J+1);if(K[q]=F,F===B)Y++}return G===z&&Y===G?$:K}function D6($,Z){if(!Z||Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if($[J]!==Z[J])return!1;return!0}function HB($){return Array.isArray($)&&$.length===Object.keys($).length}function YH($){if(!zB($))return!1;let Z=$.constructor;if(Z===void 0)return!0;let J=Z.prototype;if(!zB(J))return!1;if(!J.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf($)!==Object.prototype)return!1;return!0}function zB($){return Object.prototype.toString.call($)==="[object Object]"}function YB($){return new Promise((Z)=>{w4.setTimeout(Z,$)})}function A3($,Z,J){if(typeof J.structuralSharing==="function")return J.structuralSharing($,Z);else if(J.structuralSharing!==!1)return qH($,Z);return Z}function WB($,Z,J=0){let Q=[...$,Z];return J&&Q.length>J?Q.slice(1):Q}function qB($,Z,J=0){let Q=[Z,...$];return J&&Q.length>J?Q.slice(0,-1):Q}var w6=Symbol();function kZ($,Z){if(!$.queryFn&&Z?.initialPromise)return()=>Z.initialPromise;if(!$.queryFn||$.queryFn===w6)return()=>Promise.reject(Error(`Missing queryFn: '${$.queryHash}'`));return $.queryFn}function O6($,Z){if(typeof $==="function")return $(...Z);return!!$}function BB($,Z,J){let Q=!1,X;return Object.defineProperty($,"signal",{enumerable:!0,get:()=>{if(X??=Z(),Q)return X;if(Q=!0,X.aborted)J();else X.addEventListener("abort",J,{once:!0});return X}}),$}var P4=(()=>{let $=()=>WH;return{isServer(){return $()},setIsServer(Z){$=Z}}})();function D3(){let $,Z,J=new Promise((X,G)=>{$=X,Z=G});J.status="pending",J.catch(()=>{});function Q(X){Object.assign(J,X),delete J.resolve,delete J.reject}return J.resolve=(X)=>{Q({status:"fulfilled",value:X}),$(X)},J.reject=(X)=>{Q({status:"rejected",reason:X}),Z(X)},J}var UB=GB;function TS(){let $=[],Z=0,J=(z)=>{z()},Q=(z)=>{z()},X=UB,G=(z)=>{if(Z)$.push(z);else X(()=>{J(z)})},H=()=>{let z=$;if($=[],z.length)X(()=>{Q(()=>{z.forEach((K)=>{J(K)})})})};return{batch:(z)=>{let K;Z++;try{K=z()}finally{if(Z--,!Z)H()}return K},batchCalls:(z)=>{return(...K)=>{G(()=>{z(...K)})}},schedule:G,setNotifyFunction:(z)=>{J=z},setBatchNotifyFunction:(z)=>{Q=z},setScheduler:(z)=>{X=z}}}var M1=TS();var kS=class extends v8{#$=!0;#Z;#J;constructor(){super();this.#J=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$(!0),J=()=>$(!1);return window.addEventListener("online",Z,!1),window.addEventListener("offline",J,!1),()=>{window.removeEventListener("online",Z),window.removeEventListener("offline",J)}}return}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#J)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#J=$,this.#Z?.(),this.#Z=$(this.setOnline.bind(this))}setOnline($){if(this.#$!==$)this.#$=$,this.listeners.forEach((J)=>{J($)})}isOnline(){return this.#$}},P6=new kS;function ES($){return Math.min(1000*2**$,30000)}function BH($){return($??"online")==="online"?P6.isOnline():!0}var EZ=class extends Error{constructor($){super("CancelledError");this.revert=$?.revert,this.silent=$?.silent}};function SZ($){let Z=!1,J=0,Q,X=D3(),G=()=>X.status!=="pending",H=(V)=>{if(!G()){let N=new EZ(V);B(N),$.onCancel?.(N)}},z=()=>{Z=!0},K=()=>{Z=!1},Y=()=>A6.isFocused()&&($.networkMode==="always"||P6.isOnline())&&$.canRun(),W=()=>BH($.networkMode)&&$.canRun(),q=(V)=>{if(!G())Q?.(),X.resolve(V)},B=(V)=>{if(!G())Q?.(),X.reject(V)},U=()=>{return new Promise((V)=>{Q=(N)=>{if(G()||Y())V(N)},$.onPause?.()}).then(()=>{if(Q=void 0,!G())$.onContinue?.()})},F=()=>{if(G())return;let V,N=J===0?$.initialPromise:void 0;try{V=N??$.fn()}catch(L){V=Promise.reject(L)}Promise.resolve(V).then(q).catch((L)=>{if(G())return;let _=$.retry??(P4.isServer()?0:3),w=$.retryDelay??ES,A=typeof w==="function"?w(J,L):w,D=_===!0||typeof _==="number"&&J<_||typeof _==="function"&&_(J,L);if(Z||!D){B(L);return}J++,$.onFail?.(J,L),YB(A).then(()=>{return Y()?void 0:U()}).then(()=>{if(Z)B(L);else F()})})};return{promise:X,status:()=>X.status,cancel:H,continue:()=>{return Q?.(),X},cancelRetry:z,continueRetry:K,canStart:W,start:()=>{if(W())F();else U().then(F);return X}}}var RZ=class{#$;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),_3(this.gcTime))this.#$=w4.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime($){this.gcTime=Math.max(this.gcTime||0,$??(P4.isServer()?1/0:300000))}clearGcTimeout(){if(this.#$!==void 0)w4.clearTimeout(this.#$),this.#$=void 0}};var LB=class extends RZ{#$;#Z;#J;#X;#Q;#G;#H;constructor($){super();this.#H=!1,this.#G=$.defaultOptions,this.setOptions($.options),this.observers=[],this.#X=$.client,this.#J=this.#X.getQueryCache(),this.queryKey=$.queryKey,this.queryHash=$.queryHash,this.#$=VB(this.options),this.state=$.state??this.#$,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#Q?.promise}setOptions($){if(this.options={...this.#G,...$},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let Z=VB(this.options);if(Z.data!==void 0)this.setState(FB(Z.data,Z.dataUpdatedAt)),this.#$=Z}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#J.remove(this)}setData($,Z){let J=A3(this.state.data,$,this.options);return this.#K({data:J,type:"success",dataUpdatedAt:Z?.updatedAt,manual:Z?.manual}),J}setState($,Z){this.#K({type:"setState",state:$,setStateOptions:Z})}cancel($){let Z=this.#Q?.promise;return this.#Q?.cancel($),Z?Z.then(Z5).catch(Z5):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(($)=>G8($.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===w6||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(($)=>$4($.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!CZ(this.state.dataUpdatedAt,$)}onFocus(){this.observers.find((Z)=>Z.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#Q?.continue()}onOnline(){this.observers.find((Z)=>Z.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#Q?.continue()}addObserver($){if(!this.observers.includes($))this.observers.push($),this.clearGcTimeout(),this.#J.notify({type:"observerAdded",query:this,observer:$})}removeObserver($){if(this.observers.includes($)){if(this.observers=this.observers.filter((Z)=>Z!==$),!this.observers.length){if(this.#Q)if(this.#H||this.#z())this.#Q.cancel({revert:!0});else this.#Q.cancelRetry();this.scheduleGc()}this.#J.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.#K({type:"invalidate"})}async fetch($,Z){if(this.state.fetchStatus!=="idle"&&this.#Q?.status()!=="rejected"){if(this.state.data!==void 0&&Z?.cancelRefetch)this.cancel({silent:!0});else if(this.#Q)return this.#Q.continueRetry(),this.#Q.promise}if($)this.setOptions($);if(!this.options.queryFn){let z=this.observers.find((K)=>K.options.queryFn);if(z)this.setOptions(z.options)}let J=new AbortController,Q=(z)=>{Object.defineProperty(z,"signal",{enumerable:!0,get:()=>{return this.#H=!0,J.signal}})},X=()=>{let z=kZ(this.options,Z),Y=(()=>{let W={client:this.#X,queryKey:this.queryKey,meta:this.meta};return Q(W),W})();if(this.#H=!1,this.options.persister)return this.options.persister(z,Y,this);return z(Y)},H=(()=>{let z={fetchOptions:Z,options:this.options,queryKey:this.queryKey,client:this.#X,state:this.state,fetchFn:X};return Q(z),z})();if(this.options.behavior?.onFetch(H,this),this.#Z=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==H.fetchOptions?.meta)this.#K({type:"fetch",meta:H.fetchOptions?.meta});this.#Q=SZ({initialPromise:Z?.initialPromise,fn:H.fetchFn,onCancel:(z)=>{if(z instanceof EZ&&z.revert)this.setState({...this.#Z,fetchStatus:"idle"});J.abort()},onFail:(z,K)=>{this.#K({type:"failed",failureCount:z,error:K})},onPause:()=>{this.#K({type:"pause"})},onContinue:()=>{this.#K({type:"continue"})},retry:H.options.retry,retryDelay:H.options.retryDelay,networkMode:H.options.networkMode,canRun:()=>!0});try{let z=await this.#Q.start();if(z===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(z),this.#J.config.onSuccess?.(z,this),this.#J.config.onSettled?.(z,this.state.error,this),z}catch(z){if(z instanceof EZ){if(z.silent)return this.#Q.promise;else if(z.revert){if(this.state.data===void 0)throw z;return this.state.data}}throw this.#K({type:"error",error:z}),this.#J.config.onError?.(z,this),this.#J.config.onSettled?.(this.state.data,z,this),z}finally{this.scheduleGc()}}#K($){let Z=(J)=>{switch($.type){case"failed":return{...J,fetchFailureCount:$.failureCount,fetchFailureReason:$.error};case"pause":return{...J,fetchStatus:"paused"};case"continue":return{...J,fetchStatus:"fetching"};case"fetch":return{...J,...UH(J.data,this.options),fetchMeta:$.meta??null};case"success":let Q={...J,...FB($.data,$.dataUpdatedAt),dataUpdateCount:J.dataUpdateCount+1,...!$.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#Z=$.manual?Q:void 0,Q;case"error":let X=$.error;return{...J,error:X,errorUpdateCount:J.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:J.fetchFailureCount+1,fetchFailureReason:X,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...J,isInvalidated:!0};case"setState":return{...J,...$.state}}};this.state=Z(this.state),M1.batch(()=>{this.observers.forEach((J)=>{J.onQueryUpdate()}),this.#J.notify({query:this,type:"updated",action:$})})}};function UH($,Z){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:BH(Z.networkMode)?"fetching":"paused",...$===void 0&&{error:null,status:"pending"}}}function FB($,Z){return{data:$,dataUpdatedAt:Z??Date.now(),error:null,isInvalidated:!1,status:"success"}}function VB($){let Z=typeof $.initialData==="function"?$.initialData():$.initialData,J=Z!==void 0,Q=J?typeof $.initialDataUpdatedAt==="function"?$.initialDataUpdatedAt():$.initialDataUpdatedAt:0;return{data:Z,dataUpdateCount:0,dataUpdatedAt:J?Q??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:J?"success":"pending",fetchStatus:"idle"}}var VH=class extends v8{constructor($,Z){super();this.options=Z,this.#$=$,this.#z=null,this.#H=D3(),this.bindMethods(),this.setOptions(Z)}#$;#Z=void 0;#J=void 0;#X=void 0;#Q;#G;#H;#z;#K;#U;#F;#W;#q;#Y;#V=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#Z.addObserver(this),NB(this.#Z,this.options))this.#B();else this.updateResult();this.#M()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return FH(this.#Z,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return FH(this.#Z,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#A(),this.#D(),this.#Z.removeObserver(this)}setOptions($){let Z=this.options,J=this.#Z;if(this.options=this.#$.defaultQueryOptions($),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof G8(this.options.enabled,this.#Z)!=="boolean")throw Error("Expected enabled to be a boolean or a callback that returns a boolean");if(this.#w(),this.#Z.setOptions(this.options),Z._defaulted&&!D6(this.options,Z))this.#$.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#Z,observer:this});let Q=this.hasListeners();if(Q&&_B(this.#Z,J,this.options,Z))this.#B();if(this.updateResult(),Q&&(this.#Z!==J||G8(this.options.enabled,this.#Z)!==G8(Z.enabled,this.#Z)||$4(this.options.staleTime,this.#Z)!==$4(Z.staleTime,this.#Z)))this.#L();let X=this.#N();if(Q&&(this.#Z!==J||G8(this.options.enabled,this.#Z)!==G8(Z.enabled,this.#Z)||X!==this.#Y))this.#_(X)}getOptimisticResult($){let Z=this.#$.getQueryCache().build(this.#$,$),J=this.createResult(Z,$);if(RS(this,J))this.#X=J,this.#G=this.options,this.#Q=this.#Z.state;return J}getCurrentResult(){return this.#X}trackResult($,Z){return new Proxy($,{get:(J,Q)=>{if(this.trackProp(Q),Z?.(Q),Q==="promise"){if(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#H.status==="pending")this.#H.reject(Error("experimental_prefetchInRender feature flag is not enabled"))}return Reflect.get(J,Q)}})}trackProp($){this.#V.add($)}getCurrentQuery(){return this.#Z}refetch({...$}={}){return this.fetch({...$})}fetchOptimistic($){let Z=this.#$.defaultQueryOptions($),J=this.#$.getQueryCache().build(this.#$,Z);return J.fetch().then(()=>this.createResult(J,Z))}fetch($){return this.#B({...$,cancelRefetch:$.cancelRefetch??!0}).then(()=>{return this.updateResult(),this.#X})}#B($){this.#w();let Z=this.#Z.fetch(this.options,$);if(!$?.throwOnError)Z=Z.catch(Z5);return Z}#L(){this.#A();let $=$4(this.options.staleTime,this.#Z);if(P4.isServer()||this.#X.isStale||!_3($))return;let J=CZ(this.#X.dataUpdatedAt,$)+1;this.#W=w4.setTimeout(()=>{if(!this.#X.isStale)this.updateResult()},J)}#N(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#Z):this.options.refetchInterval)??!1}#_($){if(this.#D(),this.#Y=$,P4.isServer()||G8(this.options.enabled,this.#Z)===!1||!_3(this.#Y)||this.#Y===0)return;this.#q=w4.setInterval(()=>{if(this.options.refetchIntervalInBackground||A6.isFocused())this.#B()},this.#Y)}#M(){this.#L(),this.#_(this.#N())}#A(){if(this.#W!==void 0)w4.clearTimeout(this.#W),this.#W=void 0}#D(){if(this.#q!==void 0)w4.clearInterval(this.#q),this.#q=void 0}createResult($,Z){let J=this.#Z,Q=this.options,X=this.#X,G=this.#Q,H=this.#G,K=$!==J?$.state:this.#J,{state:Y}=$,W={...Y},q=!1,B;if(Z._optimisticResults){let T=this.hasListeners(),E=!T&&NB($,Z),C=T&&_B($,J,Z,Q);if(E||C)W={...W,...UH(Y.data,$.options)};if(Z._optimisticResults==="isRestoring")W.fetchStatus="idle"}let{error:U,errorUpdatedAt:F,status:V}=W;B=W.data;let N=!1;if(Z.placeholderData!==void 0&&B===void 0&&V==="pending"){let T;if(X?.isPlaceholderData&&Z.placeholderData===H?.placeholderData)T=X.data,N=!0;else T=typeof Z.placeholderData==="function"?Z.placeholderData(this.#F?.state.data,this.#F):Z.placeholderData;if(T!==void 0)V="success",B=A3(X?.data,T,Z),q=!0}if(Z.select&&B!==void 0&&!N)if(X&&B===G?.data&&Z.select===this.#K)B=this.#U;else try{this.#K=Z.select,B=Z.select(B),B=A3(X?.data,B,Z),this.#U=B,this.#z=null}catch(T){this.#z=T}if(this.#z)U=this.#z,B=this.#U,F=Date.now(),V="error";let L=W.fetchStatus==="fetching",_=V==="pending",w=V==="error",A=_&&L,D=B!==void 0,j={status:V,fetchStatus:W.fetchStatus,isPending:_,isSuccess:V==="success",isError:w,isInitialLoading:A,isLoading:A,data:B,dataUpdatedAt:W.dataUpdatedAt,error:U,errorUpdatedAt:F,failureCount:W.fetchFailureCount,failureReason:W.fetchFailureReason,errorUpdateCount:W.errorUpdateCount,isFetched:$.isFetched(),isFetchedAfterMount:W.dataUpdateCount>K.dataUpdateCount||W.errorUpdateCount>K.errorUpdateCount,isFetching:L,isRefetching:L&&!_,isLoadingError:w&&!D,isPaused:W.fetchStatus==="paused",isPlaceholderData:q,isRefetchError:w&&D,isStale:LH($,Z),refetch:this.refetch,promise:this.#H,isEnabled:G8(Z.enabled,$)!==!1};if(this.options.experimental_prefetchInRender){let T=j.data!==void 0,E=j.status==="error"&&!T,C=(k)=>{if(E)k.reject(j.error);else if(T)k.resolve(j.data)},g=()=>{let k=this.#H=j.promise=D3();C(k)},b=this.#H;switch(b.status){case"pending":if($.queryHash===J.queryHash)C(b);break;case"fulfilled":if(E||j.data!==b.value)g();break;case"rejected":if(!E||j.error!==b.reason)g();break}}return j}updateResult(){let $=this.#X,Z=this.createResult(this.#Z,this.options);if(this.#Q=this.#Z.state,this.#G=this.options,this.#Q.data!==void 0)this.#F=this.#Z;if(D6(Z,$))return;this.#X=Z;let J=()=>{if(!$)return!0;let{notifyOnChangeProps:Q}=this.options,X=typeof Q==="function"?Q():Q;if(X==="all"||!X&&!this.#V.size)return!0;let G=new Set(X??this.#V);if(this.options.throwOnError)G.add("error");return Object.keys(this.#X).some((H)=>{let z=H;return this.#X[z]!==$[z]&&G.has(z)})};this.#O({listeners:J()})}#w(){let $=this.#$.getQueryCache().build(this.#$,this.options);if($===this.#Z)return;let Z=this.#Z;if(this.#Z=$,this.#J=$.state,this.hasListeners())Z?.removeObserver(this),$.addObserver(this)}onQueryUpdate(){if(this.updateResult(),this.hasListeners())this.#M()}#O($){M1.batch(()=>{if($.listeners)this.listeners.forEach((Z)=>{Z(this.#X)});this.#$.getQueryCache().notify({query:this.#Z,type:"observerResultsUpdated"})})}};function SS($,Z){return G8(Z.enabled,$)!==!1&&$.state.data===void 0&&!($.state.status==="error"&&G8(Z.retryOnMount,$)===!1)}function NB($,Z){return SS($,Z)||$.state.data!==void 0&&FH($,Z,Z.refetchOnMount)}function FH($,Z,J){if(G8(Z.enabled,$)!==!1&&$4(Z.staleTime,$)!=="static"){let Q=typeof J==="function"?J($):J;return Q==="always"||Q!==!1&&LH($,Z)}return!1}function _B($,Z,J,Q){return($!==Z||G8(Q.enabled,$)===!1)&&(!J.suspense||$.state.status!=="error")&&LH($,J)}function LH($,Z){return G8(Z.enabled,$)!==!1&&$.isStaleByTime($4(Z.staleTime,$))}function RS($,Z){if(!D6($.getCurrentResult(),Z))return!0;return!1}function NH($){return{onFetch:(Z,J)=>{let Q=Z.options,X=Z.fetchOptions?.meta?.fetchMore?.direction,G=Z.state.data?.pages||[],H=Z.state.data?.pageParams||[],z={pages:[],pageParams:[]},K=0,Y=async()=>{let W=!1,q=(F)=>{BB(F,()=>Z.signal,()=>W=!0)},B=kZ(Z.options,Z.fetchOptions),U=async(F,V,N)=>{if(W)return Promise.reject();if(V==null&&F.pages.length)return Promise.resolve(F);let _=(()=>{let M={client:Z.client,queryKey:Z.queryKey,pageParam:V,direction:N?"backward":"forward",meta:Z.options.meta};return q(M),M})(),w=await B(_),{maxPages:A}=Z.options,D=N?qB:WB;return{pages:D(F.pages,w,A),pageParams:D(F.pageParams,V,A)}};if(X&&G.length){let F=X==="backward",V=F?bS:MB,N={pages:G,pageParams:H},L=V(Q,N);z=await U(N,L,F)}else{let F=$??G.length;do{let V=K===0?H[0]??Q.initialPageParam:MB(Q,z);if(K>0&&V==null)break;z=await U(z,V),K++}while(K<F)}return z};if(Z.options.persister)Z.fetchFn=()=>{return Z.options.persister?.(Y,{client:Z.client,queryKey:Z.queryKey,meta:Z.options.meta,signal:Z.signal},J)};else Z.fetchFn=Y}}}function MB($,{pages:Z,pageParams:J}){let Q=Z.length-1;return Z.length>0?$.getNextPageParam(Z[Q],Z,J[Q],J):void 0}function bS($,{pages:Z,pageParams:J}){return Z.length>0?$.getPreviousPageParam?.(Z[0],Z,J[0],J):void 0}var AB=class extends RZ{#$;#Z;#J;#X;constructor($){super();this.#$=$.client,this.mutationId=$.mutationId,this.#J=$.mutationCache,this.#Z=[],this.state=$.state||_H(),this.setOptions($.options),this.scheduleGc()}setOptions($){this.options=$,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver($){if(!this.#Z.includes($))this.#Z.push($),this.clearGcTimeout(),this.#J.notify({type:"observerAdded",mutation:this,observer:$})}removeObserver($){this.#Z=this.#Z.filter((Z)=>Z!==$),this.scheduleGc(),this.#J.notify({type:"observerRemoved",mutation:this,observer:$})}optionalRemove(){if(!this.#Z.length)if(this.state.status==="pending")this.scheduleGc();else this.#J.remove(this)}continue(){return this.#X?.continue()??this.execute(this.state.variables)}async execute($){let Z=()=>{this.#Q({type:"continue"})},J={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#X=SZ({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn($,J)},onFail:(G,H)=>{this.#Q({type:"failed",failureCount:G,error:H})},onPause:()=>{this.#Q({type:"pause"})},onContinue:Z,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#J.canRun(this)});let Q=this.state.status==="pending",X=!this.#X.canStart();try{if(Q)Z();else{if(this.#Q({type:"pending",variables:$,isPaused:X}),this.#J.config.onMutate)await this.#J.config.onMutate($,this,J);let H=await this.options.onMutate?.($,J);if(H!==this.state.context)this.#Q({type:"pending",context:H,variables:$,isPaused:X})}let G=await this.#X.start();return await this.#J.config.onSuccess?.(G,$,this.state.context,this,J),await this.options.onSuccess?.(G,$,this.state.context,J),await this.#J.config.onSettled?.(G,null,this.state.variables,this.state.context,this,J),await this.options.onSettled?.(G,null,$,this.state.context,J),this.#Q({type:"success",data:G}),G}catch(G){try{await this.#J.config.onError?.(G,$,this.state.context,this,J)}catch(H){Promise.reject(H)}try{await this.options.onError?.(G,$,this.state.context,J)}catch(H){Promise.reject(H)}try{await this.#J.config.onSettled?.(void 0,G,this.state.variables,this.state.context,this,J)}catch(H){Promise.reject(H)}try{await this.options.onSettled?.(void 0,G,$,this.state.context,J)}catch(H){Promise.reject(H)}throw this.#Q({type:"error",error:G}),G}finally{this.#J.runNext(this)}}#Q($){let Z=(J)=>{switch($.type){case"failed":return{...J,failureCount:$.failureCount,failureReason:$.error};case"pause":return{...J,isPaused:!0};case"continue":return{...J,isPaused:!1};case"pending":return{...J,context:$.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:$.isPaused,status:"pending",variables:$.variables,submittedAt:Date.now()};case"success":return{...J,data:$.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...J,data:void 0,error:$.error,failureCount:J.failureCount+1,failureReason:$.error,isPaused:!1,status:"error"}}};this.state=Z(this.state),M1.batch(()=>{this.#Z.forEach((J)=>{J.onMutationUpdate($)}),this.#J.notify({mutation:this,type:"updated",action:$})})}};function _H(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var DB=class extends v8{constructor($={}){super();this.config=$,this.#$=new Set,this.#Z=new Map,this.#J=0}#$;#Z;#J;build($,Z,J){let Q=new AB({client:$,mutationCache:this,mutationId:++this.#J,options:$.defaultMutationOptions(Z),state:J});return this.add(Q),Q}add($){this.#$.add($);let Z=bZ($);if(typeof Z==="string"){let J=this.#Z.get(Z);if(J)J.push($);else this.#Z.set(Z,[$])}this.notify({type:"added",mutation:$})}remove($){if(this.#$.delete($)){let Z=bZ($);if(typeof Z==="string"){let J=this.#Z.get(Z);if(J){if(J.length>1){let Q=J.indexOf($);if(Q!==-1)J.splice(Q,1)}else if(J[0]===$)this.#Z.delete(Z)}}}this.notify({type:"removed",mutation:$})}canRun($){let Z=bZ($);if(typeof Z==="string"){let Q=this.#Z.get(Z)?.find((X)=>X.state.status==="pending");return!Q||Q===$}else return!0}runNext($){let Z=bZ($);if(typeof Z==="string")return this.#Z.get(Z)?.find((Q)=>Q!==$&&Q.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){M1.batch(()=>{this.#$.forEach(($)=>{this.notify({type:"removed",mutation:$})}),this.#$.clear(),this.#Z.clear()})}getAll(){return Array.from(this.#$)}find($){let Z={exact:!0,...$};return this.getAll().find((J)=>TZ(Z,J))}findAll($={}){return this.getAll().filter((Z)=>TZ($,Z))}notify($){M1.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}resumePausedMutations(){let $=this.getAll().filter((Z)=>Z.state.isPaused);return M1.batch(()=>Promise.all($.map((Z)=>Z.continue().catch(Z5))))}};function bZ($){return $.options.scope?.id}var MH=class extends v8{#$;#Z=void 0;#J;#X;constructor($,Z){super();this.#$=$,this.setOptions(Z),this.bindMethods(),this.#Q()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions($){let Z=this.options;if(this.options=this.#$.defaultMutationOptions($),!D6(this.options,Z))this.#$.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#J,observer:this});if(Z?.mutationKey&&this.options.mutationKey&&O4(Z.mutationKey)!==O4(this.options.mutationKey))this.reset();else if(this.#J?.state.status==="pending")this.#J.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners())this.#J?.removeObserver(this)}onMutationUpdate($){this.#Q(),this.#G($)}getCurrentResult(){return this.#Z}reset(){this.#J?.removeObserver(this),this.#J=void 0,this.#Q(),this.#G()}mutate($,Z){return this.#X=Z,this.#J?.removeObserver(this),this.#J=this.#$.getMutationCache().build(this.#$,this.options),this.#J.addObserver(this),this.#J.execute($)}#Q(){let $=this.#J?.state??_H();this.#Z={...$,isPending:$.status==="pending",isSuccess:$.status==="success",isError:$.status==="error",isIdle:$.status==="idle",mutate:this.mutate,reset:this.reset}}#G($){M1.batch(()=>{if(this.#X&&this.hasListeners()){let Z=this.#Z.variables,J=this.#Z.context,Q={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};if($?.type==="success"){try{this.#X.onSuccess?.($.data,Z,J,Q)}catch(X){Promise.reject(X)}try{this.#X.onSettled?.($.data,null,Z,J,Q)}catch(X){Promise.reject(X)}}else if($?.type==="error"){try{this.#X.onError?.($.error,Z,J,Q)}catch(X){Promise.reject(X)}try{this.#X.onSettled?.(void 0,$.error,Z,J,Q)}catch(X){Promise.reject(X)}}}this.listeners.forEach((Z)=>{Z(this.#Z)})})}};var wB=class extends v8{constructor($={}){super();this.config=$,this.#$=new Map}#$;build($,Z,J){let Q=Z.queryKey,X=Z.queryHash??M3(Q,Z),G=this.get(X);if(!G)G=new LB({client:$,queryKey:Q,queryHash:X,options:$.defaultQueryOptions(Z),state:J,defaultOptions:$.getQueryDefaults(Q)}),this.add(G);return G}add($){if(!this.#$.has($.queryHash))this.#$.set($.queryHash,$),this.notify({type:"added",query:$})}remove($){let Z=this.#$.get($.queryHash);if(Z){if($.destroy(),Z===$)this.#$.delete($.queryHash);this.notify({type:"removed",query:$})}}clear(){M1.batch(()=>{this.getAll().forEach(($)=>{this.remove($)})})}get($){return this.#$.get($)}getAll(){return[...this.#$.values()]}find($){let Z={exact:!0,...$};return this.getAll().find((J)=>IZ(Z,J))}findAll($={}){let Z=this.getAll();return Object.keys($).length>0?Z.filter((J)=>IZ($,J)):Z}notify($){M1.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}onFocus(){M1.batch(()=>{this.getAll().forEach(($)=>{$.onFocus()})})}onOnline(){M1.batch(()=>{this.getAll().forEach(($)=>{$.onOnline()})})}};var AH=class{#$;#Z;#J;#X;#Q;#G;#H;#z;constructor($={}){this.#$=$.queryCache||new wB,this.#Z=$.mutationCache||new DB,this.#J=$.defaultOptions||{},this.#X=new Map,this.#Q=new Map,this.#G=0}mount(){if(this.#G++,this.#G!==1)return;this.#H=A6.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onFocus()}),this.#z=P6.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onOnline()})}unmount(){if(this.#G--,this.#G!==0)return;this.#H?.(),this.#H=void 0,this.#z?.(),this.#z=void 0}isFetching($){return this.#$.findAll({...$,fetchStatus:"fetching"}).length}isMutating($){return this.#Z.findAll({...$,status:"pending"}).length}getQueryData($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state.data}ensureQueryData($){let Z=this.defaultQueryOptions($),J=this.#$.build(this,Z),Q=J.state.data;if(Q===void 0)return this.fetchQuery($);if($.revalidateIfStale&&J.isStaleByTime($4(Z.staleTime,J)))this.prefetchQuery(Z);return Promise.resolve(Q)}getQueriesData($){return this.#$.findAll($).map(({queryKey:Z,state:J})=>{let Q=J.data;return[Z,Q]})}setQueryData($,Z,J){let Q=this.defaultQueryOptions({queryKey:$}),G=this.#$.get(Q.queryHash)?.state.data,H=KB(Z,G);if(H===void 0)return;return this.#$.build(this,Q).setData(H,{...J,manual:!0})}setQueriesData($,Z,J){return M1.batch(()=>this.#$.findAll($).map(({queryKey:Q})=>[Q,this.setQueryData(Q,Z,J)]))}getQueryState($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state}removeQueries($){let Z=this.#$;M1.batch(()=>{Z.findAll($).forEach((J)=>{Z.remove(J)})})}resetQueries($,Z){let J=this.#$;return M1.batch(()=>{return J.findAll($).forEach((Q)=>{Q.reset()}),this.refetchQueries({type:"active",...$},Z)})}cancelQueries($,Z={}){let J={revert:!0,...Z},Q=M1.batch(()=>this.#$.findAll($).map((X)=>X.cancel(J)));return Promise.all(Q).then(Z5).catch(Z5)}invalidateQueries($,Z={}){return M1.batch(()=>{if(this.#$.findAll($).forEach((J)=>{J.invalidate()}),$?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...$,type:$?.refetchType??$?.type??"active"},Z)})}refetchQueries($,Z={}){let J={...Z,cancelRefetch:Z.cancelRefetch??!0},Q=M1.batch(()=>this.#$.findAll($).filter((X)=>!X.isDisabled()&&!X.isStatic()).map((X)=>{let G=X.fetch(void 0,J);if(!J.throwOnError)G=G.catch(Z5);return X.state.fetchStatus==="paused"?Promise.resolve():G}));return Promise.all(Q).then(Z5)}fetchQuery($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let J=this.#$.build(this,Z);return J.isStaleByTime($4(Z.staleTime,J))?J.fetch(Z):Promise.resolve(J.state.data)}prefetchQuery($){return this.fetchQuery($).then(Z5).catch(Z5)}fetchInfiniteQuery($){return $.behavior=NH($.pages),this.fetchQuery($)}prefetchInfiniteQuery($){return this.fetchInfiniteQuery($).then(Z5).catch(Z5)}ensureInfiniteQueryData($){return $.behavior=NH($.pages),this.ensureQueryData($)}resumePausedMutations(){if(P6.isOnline())return this.#Z.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#$}getMutationCache(){return this.#Z}getDefaultOptions(){return this.#J}setDefaultOptions($){this.#J=$}setQueryDefaults($,Z){this.#X.set(O4($),{queryKey:$,defaultOptions:Z})}getQueryDefaults($){let Z=[...this.#X.values()],J={};return Z.forEach((Q)=>{if(V9($,Q.queryKey))Object.assign(J,Q.defaultOptions)}),J}setMutationDefaults($,Z){this.#Q.set(O4($),{mutationKey:$,defaultOptions:Z})}getMutationDefaults($){let Z=[...this.#Q.values()],J={};return Z.forEach((Q)=>{if(V9($,Q.mutationKey))Object.assign(J,Q.defaultOptions)}),J}defaultQueryOptions($){if($._defaulted)return $;let Z={...this.#J.queries,...this.getQueryDefaults($.queryKey),...$,_defaulted:!0};if(!Z.queryHash)Z.queryHash=M3(Z.queryKey,Z);if(Z.refetchOnReconnect===void 0)Z.refetchOnReconnect=Z.networkMode!=="always";if(Z.throwOnError===void 0)Z.throwOnError=!!Z.suspense;if(!Z.networkMode&&Z.persister)Z.networkMode="offlineFirst";if(Z.queryFn===w6)Z.enabled=!1;return Z}defaultMutationOptions($){if($?._defaulted)return $;return{...this.#J.mutations,...$?.mutationKey&&this.getMutationDefaults($.mutationKey),...$,_defaulted:!0}}clear(){this.#$.clear(),this.#Z.clear()}};var j7=O(v(),1);var j6=O(v(),1),OB=O(l(),1),DH=j6.createContext(void 0),I1=($)=>{let Z=j6.useContext(DH);if($)return $;if(!Z)throw Error("No QueryClient set, use QueryClientProvider to set one");return Z},wH=({client:$,children:Z})=>{return j6.useEffect(()=>{return $.mount(),()=>{$.unmount()}},[$]),OB.jsx(DH.Provider,{value:$,children:Z})};var w3=O(v(),1),yS=O(l(),1);function xS(){let $=!1;return{clearReset:()=>{$=!1},reset:()=>{$=!0},isReset:()=>{return $}}}var hS=w3.createContext(xS()),PB=()=>w3.useContext(hS);var jB=O(v(),1);var CB=($,Z,J)=>{let Q=J?.state.error&&typeof $.throwOnError==="function"?O6($.throwOnError,[J.state.error,J]):$.throwOnError;if($.suspense||$.experimental_prefetchInRender||Q){if(!Z.isReset())$.retryOnMount=!1}},IB=($)=>{jB.useEffect(()=>{$.clearReset()},[$])},TB=({result:$,errorResetBoundary:Z,throwOnError:J,query:Q,suspense:X})=>{return $.isError&&!Z.isReset()&&!$.isFetching&&Q&&(X&&$.data===void 0||O6(J,[$.error,Q]))};var yZ=O(v(),1),kB=yZ.createContext(!1),EB=()=>yZ.useContext(kB),Bt=kB.Provider;var SB=($)=>{if($.suspense){let J=(X)=>X==="static"?X:Math.max(X??1000,1000),Q=$.staleTime;if($.staleTime=typeof Q==="function"?(...X)=>J(Q(...X)):J(Q),typeof $.gcTime==="number")$.gcTime=Math.max($.gcTime,1000)}},RB=($,Z)=>$.isLoading&&$.isFetching&&!Z,bB=($,Z)=>$?.suspense&&Z.isPending,OH=($,Z,J)=>Z.fetchOptimistic($).catch(()=>{J.clearReset()});function yB($,Z,J){let Q=EB(),X=PB(),G=I1(J),H=G.defaultQueryOptions($);G.getDefaultOptions().queries?._experimental_beforeQuery?.(H);let z=G.getQueryCache().get(H.queryHash);H._optimisticResults=Q?"isRestoring":"optimistic",SB(H),CB(H,X,z),IB(X);let K=!G.getQueryCache().get(H.queryHash),[Y]=j7.useState(()=>new Z(G,H)),W=Y.getOptimisticResult(H),q=!Q&&$.subscribed!==!1;if(j7.useSyncExternalStore(j7.useCallback((B)=>{let U=q?Y.subscribe(M1.batchCalls(B)):Z5;return Y.updateResult(),U},[Y,q]),()=>Y.getCurrentResult(),()=>Y.getCurrentResult()),j7.useEffect(()=>{Y.setOptions(H)},[H,Y]),bB(H,W))throw OH(H,Y,X);if(TB({result:W,errorResetBoundary:X,throwOnError:H.throwOnError,query:z,suspense:H.suspense}))throw W.error;if(G.getDefaultOptions().queries?._experimental_afterQuery?.(H,W),H.experimental_prefetchInRender&&!P4.isServer()&&RB(W,Q))(K?OH(H,Y,X):z?.promise)?.catch(Z5).finally(()=>{Y.updateResult()});return!H.notifyOnChangeProps?Y.trackResult(W):W}function F5($,Z){return yB($,VH,Z)}var X7=O(v(),1);function c5($,Z){let J=I1(Z),[Q]=X7.useState(()=>new MH(J,$));X7.useEffect(()=>{Q.setOptions($)},[Q,$]);let X=X7.useSyncExternalStore(X7.useCallback((H)=>Q.subscribe(M1.batchCalls(H)),[Q]),()=>Q.getCurrentResult(),()=>Q.getCurrentResult()),G=X7.useCallback((H,z)=>{Q.mutate(H,z).catch(Z5)},[Q]);if(X.error&&O6(Q.options.throwOnError,[X.error]))throw X.error;return{...X,mutate:G,mutateAsync:X.mutate}}var AS=O(jn(),1);function xB($,Z){if($ instanceof RegExp)return{keys:!1,pattern:$};var J,Q,X,G,H=[],z="",K=$.split("/");K[0]||K.shift();while(X=K.shift())if(J=X[0],J==="*")H.push(J),z+=X[1]==="?"?"(?:/(.*))?":"/(.*)";else if(J===":"){if(Q=X.indexOf("?",1),G=X.indexOf(".",1),H.push(X.substring(1,~Q?Q:~G?G:X.length)),z+=!!~Q&&!~G?"(?:/([^/]+?))?":"/([^/]+?)",~G)z+=(~Q?"?":"")+"\\"+X.substring(G)}else z+="/"+X;return{keys:H,pattern:new RegExp("^"+z+(Z?"(?=$|/)":"/?$"),"i")}}var L9=O(v(),1),G1=O(v(),1);var hZ=O(xZ(),1);var aS=L9.useInsertionEffect,sS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",hB=sS?L9.useLayoutEffect:L9.useEffect,nS=aS||hB,jH=($)=>{let Z=L9.useRef([$,(...J)=>Z[0](...J)]).current;return nS(()=>{Z[0]=$}),Z[1]};var oS="popstate",CH="pushState",IH="replaceState",tS="hashchange",vB=[oS,CH,IH,tS],eS=($)=>{for(let Z of vB)addEventListener(Z,$);return()=>{for(let Z of vB)removeEventListener(Z,$)}},uB=($,Z)=>hZ.useSyncExternalStore(eS,$,Z),gB=()=>location.search,pB=({ssrSearch:$}={})=>uB(gB,$!=null?()=>$:gB),fB=()=>location.pathname,$R=({ssrPath:$}={})=>uB(fB,$!=null?()=>$:fB);var ZR=($,{replace:Z=!1,state:J=null}={})=>history[Z?IH:CH](J,"",$),cB=($={})=>[$R($),ZR],mB=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[mB]>"u"){for(let $ of[CH,IH]){let Z=history[$];history[$]=function(){let J=Z.apply(this,arguments),Q=new Event($);return Q.arguments=arguments,dispatchEvent(Q),J}}Object.defineProperty(window,mB,{value:!0})}var JR=($,Z)=>!Z.toLowerCase().indexOf($.toLowerCase())?Z.slice($.length)||"/":"~"+Z,lB=($="")=>$==="/"?"":$,iB=($,Z)=>$[0]==="~"?$.slice(1):lB(Z)+$,rB=($="",Z)=>JR(dB(lB($)),dB(Z));var dB=($)=>{try{return decodeURI($)}catch(Z){return $}};var sB={hook:cB,searchHook:pB,parser:xB,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:($)=>$,aroundNav:($,Z,J)=>$(Z,J)},nB=G1.createContext(sB),O3=()=>G1.useContext(nB),oB={},tB=G1.createContext(oB),QR=()=>G1.useContext(tB),vZ=($)=>{let[Z,J]=$.hook($);return[rB($.base,Z),jH((Q,X)=>$.aroundNav(J,iB(Q,$.base),X))]},j4=()=>vZ(O3());var eB=($,Z,J,Q)=>{let{pattern:X,keys:G}=Z instanceof RegExp?{keys:!1,pattern:Z}:$(Z||"*",Q),H=X.exec(J)||[],[z,...K]=H;return z!==void 0?[!0,(()=>{let Y=G!==!1?Object.fromEntries(G.map((q,B)=>[q,K[B]])):H.groups,W={...K};return Y&&Object.assign(W,Y),W})(),...Q?[z]:[]]:[!1,null]};var TH=({children:$,...Z})=>{let J=O3(),Q=Z.hook?sB:J,X=Q,[G,H=Z.ssrSearch??""]=Z.ssrPath?.split("?")??[];if(G)Z.ssrSearch=H,Z.ssrPath=G;Z.hrefs=Z.hrefs??Z.hook?.hrefs,Z.searchHook=Z.searchHook??Z.hook?.searchHook;let z=G1.useRef({}),K=z.current,Y=K;for(let W in Q){let q=W==="base"?Q[W]+(Z[W]??""):Z[W]??Q[W];if(K===Y&&q!==Y[W])z.current=Y={...Y};if(Y[W]=q,q!==Q[W]||q!==X[W])X=Y}return G1.createElement(nB.Provider,{value:X,children:$})},aB=({children:$,component:Z},J)=>{if(Z)return G1.createElement(Z,{params:J});return typeof $==="function"?$(J):$},XR=($)=>{let Z=G1.useRef(oB),J=Z.current;return Z.current=Object.keys($).length!==Object.keys(J).length||Object.entries($).some(([Q,X])=>X!==J[Q])?$:J};var C6=({path:$,nest:Z,match:J,...Q})=>{let X=O3(),[G]=vZ(X),[H,z,K]=J??eB(X.parser,$,G,Z),Y=XR({...QR(),...z});if(!H)return null;let W=K?G1.createElement(TH,{base:K},aB(Q,Y)):aB(Q,Y);return G1.createElement(tB.Provider,{value:Y,children:W})},gZ=G1.forwardRef(($,Z)=>{let J=O3(),[Q,X]=vZ(J),{to:G="",href:H=G,onClick:z,asChild:K,children:Y,className:W,replace:q,state:B,transition:U,...F}=$,V=jH((L)=>{if(L.ctrlKey||L.metaKey||L.altKey||L.shiftKey||L.button!==0)return;if(z?.(L),!L.defaultPrevented)L.preventDefault(),X(H,$)}),N=J.hrefs(H[0]==="~"?H.slice(1):J.base+H,J);return K&&G1.isValidElement(Y)?G1.cloneElement(Y,{onClick:V,href:N}):G1.createElement("a",{...F,onClick:V,href:N,className:W?.call?W(Q===H):W,children:Y,ref:Z})}),$U=($)=>Array.isArray($)?$.flatMap((Z)=>$U(Z&&Z.type===G1.Fragment?Z.props.children:Z)):[$],ZU=({children:$,location:Z})=>{let J=O3(),[Q]=vZ(J);for(let X of $U($)){let G=0;if(G1.isValidElement(X)&&(G=eB(J.parser,X.props.path,Z||Q,X.props.nest))[0])return G1.cloneElement(X,{match:G})}return null};var JU=($)=>{let Z,J=new Set,Q=(Y,W)=>{let q=typeof Y==="function"?Y(Z):Y;if(!Object.is(q,Z)){let B=Z;Z=(W!=null?W:typeof q!=="object"||q===null)?q:Object.assign({},Z,q),J.forEach((U)=>U(Z,B))}},X=()=>Z,z={setState:Q,getState:X,getInitialState:()=>K,subscribe:(Y)=>{return J.add(Y),()=>J.delete(Y)}},K=Z=$(Q,X,z);return z},fZ=($)=>$?JU($):JU;var P3=O(v(),1);var GR=($)=>$;function kH($,Z=GR){let J=P3.default.useSyncExternalStore($.subscribe,P3.default.useCallback(()=>Z($.getState()),[$,Z]),P3.default.useCallback(()=>Z($.getInitialState()),[$,Z]));return P3.default.useDebugValue(J),J}var QU=($)=>{let Z=fZ($),J=(Q)=>kH(Z,Q);return Object.assign(J,Z),J},XU=($)=>$?QU($):QU;function I6($,Z){return`${$}:${Z}`}function C4($,Z){return I6($,Z??"new")}var R1=fZ()(($)=>({activeByWorkspace:{},processing:{},errors:{},drafts:{},previews:{},attachments:{},setActive:(Z,J)=>$((Q)=>({activeByWorkspace:{...Q.activeByWorkspace,[Z]:J}})),setProcessing:(Z,J,Q)=>$((X)=>({processing:{...X.processing,[I6(Z,J)]:Q}})),reconcileProcessing:(Z)=>$(()=>({processing:Object.fromEntries(Z.map((J)=>[I6(J.workspaceId,J.sessionId),!0]))})),setError:(Z,J,Q)=>$((X)=>({errors:{...X.errors,[I6(Z,J)]:Q}})),setDraft:(Z,J,Q)=>$((X)=>({drafts:{...X.drafts,[C4(Z,J)]:Q}})),setPreview:(Z)=>$((J)=>({previews:{...J.previews,[Z.messageId]:{workspaceId:Z.workspaceId,sessionId:Z.sessionId,parentToolUseId:Z.parentToolUseId,blocks:Z.blocks,updatedAt:Date.now()}}})),clearPreview:(Z)=>$((J)=>{if(!(Z in J.previews))return J;let{[Z]:Q,...X}=J.previews;return{previews:X}}),clearPreviewsForSession:(Z,J)=>$((Q)=>{let X={},G=!1;for(let[H,z]of Object.entries(Q.previews))if(z.workspaceId===Z&&z.sessionId===J)G=!0;else X[H]=z;return G?{previews:X}:Q}),clearAllPreviews:()=>$((Z)=>Object.keys(Z.previews).length?{previews:{}}:Z),sweepPreviews:(Z,J)=>$((Q)=>{let X={},G=!1;for(let[H,z]of Object.entries(Q.previews))if(J-z.updatedAt>Z)G=!0;else X[H]=z;return G?{previews:X}:Q}),addAttachments:(Z,J,Q)=>$((X)=>{let G=C4(Z,J);return{attachments:{...X.attachments,[G]:[...X.attachments[G]??[],...Q]}}}),updateAttachment:(Z,J,Q,X)=>$((G)=>{let H=C4(Z,J),z=G.attachments[H];if(!z)return{};return{attachments:{...G.attachments,[H]:z.map((K)=>K.localId===Q?{...K,...X}:K)}}}),removeAttachment:(Z,J,Q)=>$((X)=>{let G=C4(Z,J),H=X.attachments[G];if(!H)return{};let z=H.find((K)=>K.localId===Q);if(z?.previewUrl)URL.revokeObjectURL(z.previewUrl);return{attachments:{...X.attachments,[G]:H.filter((K)=>K.localId!==Q)}}}),clearAttachments:(Z,J)=>$((Q)=>{let X=C4(Z,J);for(let H of Q.attachments[X]??[])if(H.previewUrl)URL.revokeObjectURL(H.previewUrl);let G={...Q.attachments};return delete G[X],{attachments:G}}),renameSession:(Z,J,Q)=>$((X)=>{let G=I6(Z,J),H=I6(Z,Q),z={...X.processing},K={...X.errors};if(G in z)z[H]=z[G],delete z[G];if(G in K)K[H]=K[G],delete K[G];let Y=X.activeByWorkspace[Z]===J?{...X.activeByWorkspace,[Z]:Q}:X.activeByWorkspace,W=X.previews,q=!1;for(let[B,U]of Object.entries(X.previews))if(U.workspaceId===Z&&U.sessionId===J){if(!q)W={...X.previews},q=!0;W[B]={...U,sessionId:Q}}return{processing:z,errors:K,activeByWorkspace:Y,previews:W}})}));function GU($,Z,J){if(!J)return{root:null,byParent:{}};let Q=null,X={};for(let G of Object.values($)){if(G.workspaceId!==Z||G.sessionId!==J)continue;if(G.parentToolUseId===null){if(!Q||G.updatedAt>Q.updatedAt)Q=G}else{let H=X[G.parentToolUseId];if(!H||G.updatedAt>H.updatedAt)X[G.parentToolUseId]=G}}return{root:Q,byParent:X}}function O8($){return kH(R1,$)}var T0={all:["workspaces"],discover:["workspaces","discover"],createInfo:["workspaces","create-info"],preview:($)=>["workspaces","preview",$],layout:($)=>["workspaces","layout",$],widgets:($)=>["workspaces","widgets",$],views:($)=>["workspaces","views",$],sessions:($)=>["workspaces","sessions",$],events:($,Z)=>["workspaces","events",$,Z],threadConfig:($,Z)=>["workspaces","threadConfig",$,Z],userMcp:["mcp","user"],mcp:($)=>["workspaces","mcp",$],models:($)=>["workspaces","models",$],env:($)=>["workspaces","env",$]};function mZ(){return{turns:[],notices:[]}}function j3($,Z){switch(Z.kind){case"snapshot":return{...$,snapshot:Z.snapshot};case"turn":{let J=$.turns.findIndex((X)=>X.id===Z.turn.id),Q=J>=0?$.turns.map((X,G)=>G===J?Z.turn:X):[...$.turns,Z.turn];return{...$,turns:Q}}case"notice":{if($.notices.some((J)=>J.id===Z.notice.id))return{...$,notices:$.notices.map((J)=>J.id===Z.notice.id?Z.notice:J)};return{...$,notices:[...$.notices,Z.notice]}}case"result":return{...$,result:Z.result}}}function HU($){return $.reduce(j3,mZ())}function KU($,Z){let{queryClient:J,sendMessage:Q,onWorkspaceSwitch:X}=Z,G=R1.getState();if($.type==="status_snapshot"){G.reconcileProcessing($.running??[]);return}if($.type==="status"){let{workspaceId:Y,sessionId:W,processing:q}=$;if(G.setProcessing(Y,W,q),!q)G.clearPreviewsForSession(Y,W);return}if($.type==="preview"){let Y=$,W=T0.events(Y.workspaceId,Y.sessionId);if(J?.getQueryData(W)===void 0)return;G.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:W,to:q}=$;G.renameSession(Y,W,q);let B=J?.getQueryData(T0.events(Y,W));if(B!==void 0)J?.setQueryData(T0.events(Y,q),B),J?.removeQueries({queryKey:T0.events(Y,W)});let U=J?.getQueryData(T0.threadConfig(Y,W));if(U!==void 0)J?.setQueryData(T0.threadConfig(Y,q),U),J?.removeQueries({queryKey:T0.threadConfig(Y,W)});J?.invalidateQueries({queryKey:T0.sessions(Y)});return}if($.type==="workspace:switch"){X?.($.workspaceId);return}if($.type==="scratchpad:op"){let Y=zU($.workspaceId);if(!Y)return;let W=$.opId;Y($.op).then((q)=>Q({type:"scratchpad:op-result",opId:W,result:q}),(q)=>Q({type:"scratchpad:op-result",opId:W,error:q instanceof Error?q.message:String(q)}));return}let{workspaceId:H,sessionId:z}=$;if(!H||!z)return;let K=$.kind;if(K==="snapshot"||K==="turn"||K==="notice"||K==="result"){if(HR(J,H,z,$),K==="turn"){let Y=$.turn?.meta?.apiMessageId;if(Y)G.clearPreview(Y)}if(K==="result")G.clearPreviewsForSession(H,z)}if(K==="error"&&typeof $.content==="string")G.setError(H,z,$.content),G.clearPreviewsForSession(H,z);if(K==="stopped")G.setProcessing(H,z,!1),G.clearPreviewsForSession(H,z)}function HR($,Z,J,Q){let X=T0.events(Z,J),G=$?.getQueryData(X);if(G===void 0)return;$?.setQueryData(X,j3(G,Q))}var SH=null,T6=null,uZ=0,pZ=null,EH=[],qU=null,YU=null,zR=15000;function BU($){if(SH=$,!YU)YU=setInterval(()=>R1.getState().sweepPreviews(zR,Date.now()),5000);if(T6)return;UU()}function UU(){let $=++uZ;if(pZ)clearTimeout(pZ),pZ=null;let Z=new WebSocket(WU("/ws"));T6=Z,Z.onopen=()=>{if(uZ!==$){Z.close();return}for(let J of EH)Z.send(JSON.stringify(J));EH.length=0,SH?.invalidateQueries({queryKey:["workspaces","events"]}),R1.getState().clearAllPreviews()},Z.onmessage=(J)=>{if(uZ!==$)return;let Q;try{Q=JSON.parse(J.data)}catch{return}KR(Q)},Z.onclose=()=>{if(uZ!==$)return;T6=null,pZ=setTimeout(UU,1000)},Z.onerror=()=>Z.close()}function KR($){KU($,{queryClient:SH,sendMessage:cZ,onWorkspaceSwitch:qU})}function cZ($){if(T6&&T6.readyState===WebSocket.OPEN)T6.send(JSON.stringify($));else EH.push($)}function RH($){qU=$}var _S=O(v(),1);var uH=O(v(),1);var yU=O(v(),1);var E6=O(v(),1);var yH=O(v(),1);var VU=O(v(),1),FU={};function $1($,Z){let J=VU.useRef(FU);if(J.current===FU)J.current=$(Z);return J}var bH=yH[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],YR=bH&&bH!==yH.useLayoutEffect?bH:($)=>$();function H0($){let Z=$1(WR).current;return Z.next=$,YR(Z.effect),Z.trampoline}function WR(){let $={next:void 0,callback:qR,trampoline:(...Z)=>$.callback?.(...Z),effect:()=>{$.callback=$.next}};return $}function qR(){}var BR=O(v(),1),LU={...BR};var NU=O(v(),1),UR=()=>{},Q0=typeof document<"u"?NU.useLayoutEffect:UR;function C3($,Z){if($&&!Z)return $;if(!$&&Z)return Z;if($||Z)return{...$,...Z};return}var T3={};function d5($,Z,J,Q,X){let G={...xH($,T3)};if(Z)G=I3(G,Z);if(J)G=I3(G,J);if(Q)G=I3(G,Q);if(X)G=I3(G,X);return G}function _U($){if($.length===0)return T3;if($.length===1)return xH($[0],T3);let Z={...xH($[0],T3)};for(let J=1;J<$.length;J+=1)Z=I3(Z,$[J]);return Z}function I3($,Z){if(MU(Z))return Z($);return FR($,Z)}function FR($,Z){if(!Z)return $;for(let J in Z){let Q=Z[J];switch(J){case"style":{$[J]=C3($.style,Q);break}case"className":{$[J]=hH($.className,Q);break}default:if(VR(J,Q))$[J]=LR($[J],Q);else $[J]=Q}}return $}function VR($,Z){let J=$.charCodeAt(0),Q=$.charCodeAt(1),X=$.charCodeAt(2);return J===111&&Q===110&&X>=65&&X<=90&&(typeof Z==="function"||typeof Z>"u")}function MU($){return typeof $==="function"}function xH($,Z){if(MU($))return $(Z);return $??T3}function LR($,Z){if(!Z)return $;if(!$)return Z;return(J)=>{if(NR(J)){let X=J;dZ(X);let G=Z(X);if(!X.baseUIHandlerPrevented)$?.(X);return G}let Q=Z(J);return $?.(J),Q}}function dZ($){return $.preventBaseUIHandler=()=>{$.baseUIHandlerPrevented=!0},$}function hH($,Z){if(Z){if($)return Z+" "+$;return Z}return $}function NR($){return $!=null&&typeof $==="object"&&"nativeEvent"in $}function M0($,...Z){let J=new URL("https://base-ui.com/production-error");return J.searchParams.set("code",$.toString()),Z.forEach((Q)=>J.searchParams.append("args[]",Q)),`Base UI error #${$}; visit ${J} for the full message.`}var lZ=O(v(),1),_R=lZ.createContext(void 0);function k6($=!1){let Z=lZ.useContext(_R);if(Z===void 0&&!$)throw Error(M0(16));return Z}var AU=O(v(),1);function DU($){let{focusableWhenDisabled:Z,disabled:J,composite:Q=!1,tabIndex:X=0,isNativeButton:G}=$,H=Q&&Z!==!1,z=Q&&Z===!1;return{props:AU.useMemo(()=>{let Y={onKeyDown(W){if(J&&Z&&W.key!=="Tab")W.preventDefault()}};if(!Q){if(Y.tabIndex=X,!G&&J)Y.tabIndex=Z?X:-1}if(G&&(Z||H)||!G&&J)Y["aria-disabled"]=J;if(G&&(!Z||z))Y.disabled=J;return Y},[Q,J,Z,H,z,G,X])}}function M5($={}){let{disabled:Z=!1,focusableWhenDisabled:J,tabIndex:Q=0,native:X=!0}=$,G=E6.useRef(null),H=k6(!0)!==void 0,z=H0(()=>{let B=G.current;return Boolean(B?.tagName==="A"&&B?.href)}),{props:K}=DU({focusableWhenDisabled:J,disabled:Z,composite:H,tabIndex:Q,isNativeButton:X}),Y=E6.useCallback(()=>{let B=G.current;if(!MR(B))return;if(H&&Z&&K.disabled===void 0&&B.disabled)B.disabled=!1},[Z,K.disabled,H]);Q0(Y,[Y]);let W=E6.useCallback((B={})=>{let{onClick:U,onMouseDown:F,onKeyUp:V,onKeyDown:N,onPointerDown:L,..._}=B;return d5({type:X?"button":void 0,onClick(A){if(Z){A.preventDefault();return}U?.(A)},onMouseDown(A){if(!Z)F?.(A)},onKeyDown(A){if(!Z)dZ(A),N?.(A);if(A.baseUIHandlerPrevented)return;let D=A.target===A.currentTarget&&!X&&!z()&&!Z,M=A.key==="Enter",j=A.key===" ";if(D){if(j||M)A.preventDefault();if(M)U?.(A)}},onKeyUp(A){if(!Z)dZ(A),V?.(A);if(A.baseUIHandlerPrevented)return;if(A.target===A.currentTarget&&!X&&!Z&&A.key===" ")U?.(A)},onPointerDown(A){if(Z){A.preventDefault();return}L?.(A)}},!X?{role:"button"}:void 0,K,_)},[Z,K,X,z]),q=H0((B)=>{G.current=B,Y()});return{getButtonProps:W,buttonRef:q}}function MR($){return b1($)&&$.tagName==="BUTTON"}var I7=O(v(),1);function U8($,Z,J,Q){let X=$1(OU).current;if(AR(X,$,Z,J,Q))PU(X,[$,Z,J,Q]);return X.callback}function wU($){let Z=$1(OU).current;if(DR(Z,$))PU(Z,$);return Z.callback}function OU(){return{callback:null,cleanup:null,refs:[]}}function AR($,Z,J,Q,X){return $.refs[0]!==Z||$.refs[1]!==J||$.refs[2]!==Q||$.refs[3]!==X}function DR($,Z){return $.refs.length!==Z.length||$.refs.some((J,Q)=>J!==Z[Q])}function PU($,Z){if($.refs=Z,Z.every((J)=>J==null)){$.callback=null;return}$.callback=(J)=>{if($.cleanup)$.cleanup(),$.cleanup=null;if(J!=null){let Q=Array(Z.length).fill(null);for(let X=0;X<Z.length;X+=1){let G=Z[X];if(G==null)continue;switch(typeof G){case"function":{let H=G(J);if(typeof H==="function")Q[X]=H;break}case"object":{G.current=J;break}default:}}$.cleanup=()=>{for(let X=0;X<Z.length;X+=1){let G=Z[X];if(G==null)continue;switch(typeof G){case"function":{let H=Q[X];if(typeof H==="function")H();else G(null);break}case"object":{G.current=null;break}default:}}}}}}var CU=O(v(),1);var jU=O(v(),1),wR=parseInt(jU.version,10);function S6($){return wR>=$}function vH($){if(!CU.isValidElement($))return null;let Z=$,J=Z.props;return(S6(19)?J?.ref:Z.ref)??null}function IU($,Z){let J={};for(let Q in $){let X=$[Q];if(Z?.hasOwnProperty(Q)){let G=Z[Q](X);if(G!=null)Object.assign(J,G);continue}if(X===!0)J[`data-${Q.toLowerCase()}`]="";else if(X)J[`data-${Q.toLowerCase()}`]=X.toString()}return J}function TU($,Z){return typeof $==="function"?$(Z):$}function kU($,Z){return typeof $==="function"?$(Z):$}function w1(){}var R6=Object.freeze([]),e0=Object.freeze({});var EU=500,iZ=500,SU={style:{transition:"none"}},b6="data-base-ui-click-trigger",RU={fallbackAxisSide:"none"},C7={fallbackAxisSide:"end"},bU={clipPath:"inset(50%)",position:"fixed",top:0,left:0};var gH=O(v(),1);function W0($,Z,J={}){let Q=Z.render,X=OR(Z,J);if(J.enabled===!1)return null;let G=J.state??e0;return jR($,Q,X,G)}function OR($,Z={}){let{className:J,style:Q,render:X}=$,{state:G=e0,ref:H,props:z,stateAttributesMapping:K,enabled:Y=!0}=Z,W=Y?TU(J,G):void 0,q=Y?kU(Q,G):void 0,B=Y?IU(G,K):e0,U=Y?C3(B,Array.isArray(z)?_U(z):z)??e0:e0;if(typeof document<"u")if(!Y)U8(null,null);else if(Array.isArray(H))U.ref=wU([U.ref,vH(X),...H]);else U.ref=U8(U.ref,vH(X),H);if(!Y)return e0;if(W!==void 0)U.className=hH(U.className,W);if(q!==void 0)U.style=C3(U.style,q);return U}var PR=Symbol.for("react.lazy");function jR($,Z,J,Q){if(Z){if(typeof Z==="function")return Z(J,Q);let X=d5(J,Z.props);X.ref=J.ref;let G=Z;if(G?.$$typeof===PR)G=I7.Children.toArray(Z)[0];return I7.cloneElement(G,X)}if($){if(typeof $==="string")return CR($,J)}throw Error(M0(8))}function CR($,Z){if($==="button")return gH.createElement("button",{type:"button",...Z,key:Z.key});if($==="img")return gH.createElement("img",{alt:"",...Z,key:Z.key});return I7.createElement($,Z)}var fH=yU.forwardRef(function(Z,J){let{render:Q,className:X,disabled:G=!1,focusableWhenDisabled:H=!1,nativeButton:z=!0,...K}=Z,{getButtonProps:Y,buttonRef:W}=M5({disabled:G,focusableWhenDisabled:H,native:z});return W0("button",Z,{state:{disabled:G},ref:[J,W],props:[K,Y]})});var xU=($)=>typeof $==="boolean"?`${$}`:$===0?"0":$,hU=vU,rZ=($,Z)=>(J)=>{var Q;if((Z===null||Z===void 0?void 0:Z.variants)==null)return hU($,J===null||J===void 0?void 0:J.class,J===null||J===void 0?void 0:J.className);let{variants:X,defaultVariants:G}=Z,H=Object.keys(X).map((Y)=>{let W=J===null||J===void 0?void 0:J[Y],q=G===null||G===void 0?void 0:G[Y];if(W===null)return null;let B=xU(W)||xU(q);return X[Y][B]}),z=J&&Object.entries(J).reduce((Y,W)=>{let[q,B]=W;if(B===void 0)return Y;return Y[q]=B,Y},{}),K=Z===null||Z===void 0?void 0:(Q=Z.compoundVariants)===null||Q===void 0?void 0:Q.reduce((Y,W)=>{let{class:q,className:B,...U}=W;return Object.entries(U).every((F)=>{let[V,N]=F;return Array.isArray(N)?N.includes({...G,...z}[V]):{...G,...z}[V]===N})?[...Y,q,B]:Y},[]);return hU($,H,K,J===null||J===void 0?void 0:J.class,J===null||J===void 0?void 0:J.className)};var gU=O(l(),1),y6=rZ("inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-sm text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground disabled:opacity-100",secondary:"bg-muted text-foreground hover:bg-accent hover:text-accent-foreground",outline:"bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20"},size:{sm:"h-7 gap-1.5 rounded-xs px-2.5 text-sm has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg]:size-4",default:"h-8 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5 [&_svg]:size-5",lg:"h-10 rounded-lg px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg]:size-5","icon-sm":"size-7 rounded-xs [&_svg]:size-4",icon:"size-8 [&_svg]:size-5","icon-lg":"size-10 rounded-lg [&_svg]:size-5"}},defaultVariants:{variant:"default",size:"default"}});function C0({className:$,variant:Z="default",size:J="default",...Q}){return gU.jsx(fH,{"data-slot":"button",className:B0(y6({variant:Z,size:J,className:$})),...Q})}var aZ=O(v(),1);var mH=O(l(),1),uU=($)=>$.map((Z)=>[...Z].map((J)=>J==="#"?1:0)),IR=["####.","#.#.#","#.#.#","#.#.#","#.#.#"],TR=["###.#","#.#.#","#.#.#","#.#.#","###.#"],kR=uU([".....","####.","#.#.#","#.#.#","#.#.#"]),ER=uU(IR.map(($,Z)=>`${$}.${TR[Z]}`)),SR={moi:kR,"moi-full":ER};function pU($,Z,J){let Q=[];for(let X=0;X<Z;X++){let G=[];for(let H=0;H<$;H++)G.push(J(H,X));Q.push(G)}return Q}function fU($,Z,J){let Q=Math.sin($*12.9898+Z*78.233+J*37.719)*43758.5453;return Q-Math.floor(Q)}function RR($,Z,J){return pU(Z,J,(Q,X)=>{let G=fU(Q,X,0)*Math.PI*2,H=5+fU(Q,X,1)*6,z=0.5+0.5*Math.sin($*H+G);return z*z})}function bR($,Z,J){return pU(Z,J,(X,G)=>0.5+0.5*Math.sin(X*0.5+G*0.32-$*6.5))}var cU=0.55;function yR($,Z){let J=$.length,Q=$.reduce((K,Y)=>Math.max(K,Y.length),0),X=Math.min(Z/cU,1),G=1-Math.pow(1-X,3),H=Math.round((1-G)*J),z=[];for(let K=0;K<J;K++){let Y=[];for(let W=0;W<Q;W++)Y.push($[K-H]?.[W]??0);z.push(Y)}return z}function mU($,Z,J){let Q=SR[$];if(Z===void 0)return yR(Q,J);let X=Q.length,G=Q[0]?.length??0;return Z==="wave"?bR(J,G,X):RR(J,G,X)}var xR=24;function hR($,Z,J){let[Q,X]=aZ.useState(()=>mU($,Z,0));return aZ.useEffect(()=>{let G=0,H=null,z=0,K=1000/J,Y=(W)=>{if(H===null)H=W;let q=(W-H)/1000;if(W-z>=K){if(z=W,X(mU($,Z,q)),Z===void 0&&q>=cU)return}G=requestAnimationFrame(Y)};return G=requestAnimationFrame(Y),()=>cancelAnimationFrame(G)},[$,Z,J]),Q}function vR($){return`rgba(23, 23, 23, ${(0.1+Math.max(0,Math.min(1,$))*0.9).toFixed(3)})`}function x6({sprite:$="moi",effect:Z,fps:J=xR,pixelSize:Q=3,gap:X=1,className:G}){let H=hR($,Z,J),z=H[0]?.length??0,K=Z!==void 0;return mH.jsx("div",{className:B0("grid",G),style:{gridTemplateColumns:`repeat(${z}, ${Q}px)`,gap:`${X}px`},children:H.flatMap((Y,W)=>Y.map((q,B)=>mH.jsx("div",{className:"rounded-[2px]",style:{width:Q,height:Q,background:vR(q),boxShadow:K?`0 0 ${(Q*(0.4+q)).toFixed(1)}px rgba(23, 23, 23, ${(q*0.35).toFixed(3)})`:void 0}},`${W}-${B}`)))})}var T7=O(v(),1);var I4=O(l(),1),gR=5,fR=5,dU=[".....","####.","#.#.#","#.#.#","#.#.#"];function lU($){return $.map((Z)=>[...Z].map((J)=>J==="#"))}function mR(){return Array.from({length:fR},()=>Array.from({length:gR},()=>!1))}function iU(){let[$,Z]=T7.useState(()=>lU(dU)),[J,Q]=T7.useState(!1),X=T7.useRef(!0),[G,H]=T7.useState(!1);T7.useEffect(()=>{let B=()=>Q(!1);return window.addEventListener("mouseup",B),()=>window.removeEventListener("mouseup",B)},[]);function z(B,U,F){Z((V)=>{if(V[B][U]===F)return V;let N=V.map((L)=>L.slice());return N[B][U]=F,N})}function K(B,U){let F=!$[B][U];X.current=F,Q(!0),z(B,U,F)}function Y(B,U){if(J)z(B,U,X.current)}let W=$.map((B)=>B.map((U)=>U?"#":".").join("")).join(`
7
- `);async function q(){await navigator.clipboard.writeText(W),H(!0),setTimeout(()=>H(!1),1200)}return I4.jsxs("div",{className:"flex flex-col items-center gap-4",children:[I4.jsx("div",{className:"grid w-fit grid-cols-[repeat(5,28px)] gap-px bg-border p-px select-none",children:$.map((B,U)=>B.map((F,V)=>I4.jsx("div",{onMouseDown:()=>K(U,V),onMouseEnter:()=>Y(U,V),className:B0("size-7 cursor-pointer",F?"bg-foreground":"bg-background")},`${U}-${V}`)))}),I4.jsx("pre",{className:"rounded-md border border-border bg-card px-3 py-2 text-center font-mono text-sm leading-snug text-card-foreground",children:W}),I4.jsxs("div",{className:"flex gap-2",children:[I4.jsx(C0,{type:"button",size:"sm",onClick:q,children:G?"Copied!":"Copy"}),I4.jsx(C0,{type:"button",variant:"secondary",size:"sm",onClick:()=>Z(mR()),children:"Clear"}),I4.jsx(C0,{type:"button",variant:"secondary",size:"sm",onClick:()=>Z(lU(dU)),children:"Reset"})]})]})}var J4=O(l(),1),uR=[{value:"moi",label:"M"},{value:"moi-full",label:"MOI"}],pR=[{value:"none",label:"None"},{value:"wave",label:"Wave"},{value:"chaos",label:"Random"}];function rU({options:$,value:Z,onChange:J}){return J4.jsx("div",{className:"flex gap-1 rounded-lg bg-accent p-1",children:$.map((Q)=>J4.jsx(C0,{type:"button",variant:Z===Q.value?"default":"ghost",size:"sm",onClick:()=>J(Q.value),children:Q.label},String(Q.value)))})}function aU(){let[$,Z]=uH.useState("moi"),[J,Q]=uH.useState("none");return J4.jsxs("div",{className:"relative flex min-h-dvh flex-col items-center justify-center gap-8 bg-muted",children:[J4.jsx("span",{className:"absolute top-5 left-5 text-[11px] font-medium tracking-widest text-muted-foreground uppercase",children:"Playground"}),J4.jsx(iU,{}),J4.jsx(x6,{sprite:$,effect:J==="none"?void 0:J,pixelSize:3,gap:0.5}),J4.jsxs("div",{className:"flex flex-col items-center gap-2",children:[J4.jsx(rU,{options:uR,value:$,onChange:Z}),J4.jsx(rU,{options:pR,value:J,onChange:Q})]})]})}var RV=O(v(),1);var Gz=O(v(),1);var sU="/agentation-4s0nn45p.png";var nU="/airtable-hsa66v6q.png";var oU="/apollo-2ed5dy2d.png";var tU="/asana-tvgtwbx2.png";var eU="/atlassian-b3tq39hs.png";var $F="/box-w3n36t5g.png";var pH="/chrome-tspm94rw.svg";var ZF="/clickup-qqrqqvqb.png";var JF="/cloudflare-j9p931v6.png";var QF="/context7-8ht0xjfy.png";var XF="/datadog-70ne3yzt.png";var GF="/discord-vejhptwx.png";var HF="/dropbox-4m5s9mgr.png";var zF="/elevenlabs-2nzzej1t.png";var KF="/exa-qqj3vr0x.png";var YF="/figma-y9898rry.png";var WF="/firecrawl-w2t8nehx.png";var qF="/github-av5r5y3e.png";var BF="/gitlab-4pv5vm6b.png";var UF="/gmail-sg6a5v3x.png";var FF="/googlecalendar-nqhh2v7r.png";var VF="/googledrive-6s8xyab7.png";var LF="/grafana-1yfsnwr6.png";var NF="/granola-7j3b0nk2.png";var _F="/hubspot-hghcmc2t.png";var MF="/huggingface-kxzaxj83.png";var AF="/intercom-td763jt8.png";var DF="/linear-v9s3az2d.png";var wF="/monday-jdbs4wwf.png";var OF="/mongodb-emzxvhd5.png";var PF="/neon-zj4qar44.png";var jF="/notion-w034c0b8.png";var CF="/paper-zbt34fab.png";var IF="/paypal-kwwf7xsc.png";var TF="/perplexity-4y63rxvj.png";var kF="/postgresql-qsspbsr1.png";var EF="/posthog-sphppc4w.png";var SF="/puppeteer-2xjt1a9b.png";var RF="/railway-834de8d2.png";var bF="/redis-spm6w2m1.png";var yF="/salesforce-1mk56v4z.png";var xF="/sentry-hdwpmvek.png";var hF="/shopify-90dadaav.png";var vF="/slack-1c1wj62s.png";var gF="/snowflake-hfpykpgy.png";var fF="/stripe-zrfaqbj3.png";var mF="/supabase-4vg33zf2.png";var uF="/telegram-v6tjyrs7.png";var pF="/twilio-dpyjdwpj.png";var cF="/vercel-7d0ssw28.png";var dF="/zapier-p67qfch0.png";var mb={agentation:sU,airtable:nU,apollo:oU,asana:tU,atlassian:eU,box:$F,chrome:pH,"chrome-devtools":pH,clickup:ZF,cloudflare:JF,context7:QF,datadog:XF,discord:GF,dropbox:HF,elevenlabs:zF,exa:KF,figma:YF,firecrawl:WF,github:qF,gitlab:BF,gmail:UF,googlecalendar:FF,googledrive:VF,grafana:LF,granola:NF,hubspot:_F,huggingface:MF,intercom:AF,linear:DF,monday:wF,mongodb:OF,neon:PF,notion:jF,paper:CF,paypal:IF,perplexity:TF,postgresql:kF,posthog:EF,puppeteer:SF,railway:RF,redis:bF,salesforce:yF,sentry:xF,shopify:hF,slack:vF,snowflake:gF,stripe:fF,supabase:mF,telegram:uF,twilio:pF,vercel:cF,zapier:dF},ub={"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 lF($){let Z=$.match(/^claude[._]ai[._\s]+(.+)$/i);if(!Z)return $;return Z[1].replace(/_/g," ")}function sZ($){return $.toLowerCase().replace(/[\s._-]+/g,"")}var pb=new Map(Object.entries(mb).map(([$,Z])=>[sZ($),Z])),cb=new Map(Object.entries(ub).map(([$,Z])=>[sZ($),sZ(Z)]));function nZ($){let Z=sZ(lF($));return pb.get(cb.get(Z)??Z)}function k3($){return lF($).split(/[\s._-]+/).filter(Boolean).map((Z)=>Z[0].toUpperCase()+Z.slice(1)).join(" ")}var cH=O(l(),1);function E3({open:$,children:Z}){return cH.jsx(g8,{initial:!1,children:$&&cH.jsx(T1.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"spring",duration:0.25,bounce:0.1},className:"overflow-hidden",children:Z},"content")})}var iF=O(v(),1);var sF=O(l(),1),db=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function rF($,Z){if($.name!=="Read"||!Z)return null;let J=$.input,Q=typeof J.file_path==="string"?J.file_path:null;if(!Q||!db.test(Q))return null;let X=Z.endsWith("/")?Z:`${Z}/`;if(!Q.startsWith(X))return null;return Q.slice(X.length)}function aF({relPath:$}){let Z=P8(),[J,Q]=iF.useState(!1);if(J)return null;let X=`/api/workspaces/${Z}/preview/${$.split("/").map(encodeURIComponent).join("/")}`;return sF.jsx("img",{src:X,alt:$,loading:"lazy",onError:()=>Q(!0),className:"max-h-64 max-w-full self-start rounded-md border border-border object-contain"})}var y3=O(v(),1);var oF=O(l(),1),lb=B0("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 nF({children:$,active:Z=!0,className:J}){return oF.jsx("span",{className:B0(J,Z&&lb),children:$})}var S3=O(l(),1);function oZ({className:$}){return S3.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:[S3.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"}),S3.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 A5=O(l(),1),dH="group/row flex w-full items-center gap-2 py-1.5 text-left select-none";function R3({isFirst:$,isLast:Z,marker:J,loading:Q=!1,isError:X=!1,children:G}){return A5.jsxs("div",{className:"relative flex gap-2.5",children:[A5.jsxs("div",{className:"relative w-[13px] shrink-0",children:[!$&&A5.jsx("span",{className:"absolute top-0 left-1/2 h-4 w-px -translate-x-1/2 bg-border"}),!Z&&A5.jsx("span",{className:"absolute top-[15px] bottom-0 left-1/2 w-px -translate-x-1/2 bg-border"}),J?A5.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2",children:J}):Q?A5.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 rounded-full bg-background p-0.5",children:A5.jsx(l5,{size:12,stroke:1.75,className:"animate-spin text-ring"})}):A5.jsx("span",{className:B0("absolute top-[15px] left-1/2 z-10 size-[5px] -translate-x-1/2 -translate-y-1/2 rounded-full ring-3 ring-background",X?"bg-destructive":"bg-border")})]}),G]})}function b3({open:$}){return A5.jsx(T1.span,{animate:{rotate:$?90:0},transition:{type:"spring",duration:0.2,bounce:0.1},className:B0("flex shrink-0",$?"opacity-100":"opacity-0 group-hover/row:opacity-100"),children:A5.jsx(v6,{size:12,stroke:1.75})})}function h6({children:$,className:Z}){return A5.jsx("span",{className:B0("flex size-4 items-center justify-center overflow-hidden rounded-[4px] bg-muted ring-2 ring-background",Z),children:$})}function tF({icon:$,size:Z=12,stroke:J=1.75}){return A5.jsx(h6,{children:A5.jsx($,{size:Z,stroke:J,className:"text-muted-foreground"})})}function eF({src:$}){if(!$)return A5.jsx(h6,{children:A5.jsx(oZ,{className:"size-3 text-muted-foreground"})});return A5.jsx(h6,{children:A5.jsx("img",{src:$,alt:"",className:"size-full object-cover"})})}var ib=/^[A-Za-z]:\//;function rb($=""){if(!$)return $;return $.replace(/\\/g,"/").replace(ib,(Z)=>Z.toUpperCase())}var ab=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var $V=/^\/([A-Za-z]:)?$/;function sb(){if(typeof process<"u"&&typeof process.cwd==="function")return process.cwd().replace(/\\/g,"/");return"/"}var lH=function(...$){$=$.map((Q)=>rb(Q));let Z="",J=!1;for(let Q=$.length-1;Q>=-1&&!J;Q--){let X=Q>=0?$[Q]:sb();if(!X||X.length===0)continue;Z=`${X}/${Z}`,J=iH(X)}if(Z=ZV(Z,!J),J&&!iH(Z))return`/${Z}`;return Z.length>0?Z:"."};function ZV($,Z){let J="",Q=0,X=-1,G=0,H=null;for(let z=0;z<=$.length;++z){if(z<$.length)H=$[z];else if(H==="/")break;else H="/";if(H==="/"){if(X===z-1||G===1);else if(G===2){if(J.length<2||Q!==2||J[J.length-1]!=="."||J[J.length-2]!=="."){if(J.length>2){let K=J.lastIndexOf("/");if(K===-1)J="",Q=0;else J=J.slice(0,K),Q=J.length-1-J.lastIndexOf("/");X=z,G=0;continue}else if(J.length>0){J="",Q=0,X=z,G=0;continue}}if(Z)J+=J.length>0?"/..":"..",Q=2}else{if(J.length>0)J+=`/${$.slice(X+1,z)}`;else J=$.slice(X+1,z);Q=z-X-1}X=z,G=0}else if(H==="."&&G!==-1)++G;else G=-1}return J}var iH=function($){return ab.test($)};var rH=function($,Z){let J=lH($).replace($V,"$1").split("/"),Q=lH(Z).replace($V,"$1").split("/");if(Q[0][1]===":"&&J[0][1]===":"&&J[0]!==Q[0])return Q.join("/");let X=[...J];for(let G of X){if(Q[0]!==G)break;J.shift(),Q.shift()}return[...J.map(()=>".."),...Q].join("/")};function JV($){if(!($.name==="Bash"||$.name==="exec"))return null;let J=$.input??{},Q=typeof J.command==="string"?J.command:"";if(!Q)return null;let X=Q.match(/(?:^|\s|\$\()mcporter(?:\)?)\s+call\s+([A-Za-z0-9_-]+)\.([A-Za-z0-9_-]+)((?:\s+(?!&&|\|\||;|\|)\S+)*)/);if(!X)return null;return{server:X[1],tool:X[2],rest:(X[3]??"").trim()}}function QV($){let Z=$.name;if(!Z.startsWith("mcp__"))return null;let J=Z.slice(5),Q=J.indexOf("__");if(Q<=0)return null;return{server:J.slice(0,Q),tool:J.slice(Q+2),rest:""}}function XV($,Z){let J=Z.toLowerCase();return["-","_","."].find((X)=>J.startsWith($.toLowerCase()+X))?Z.slice($.length+1):Z}function O1($,Z){let J=$[Z];return typeof J==="string"?J:""}function GV($){let Z=new TextEncoder().encode($).length;return Z<1024?`${Z}B`:`${(Z/1024).toFixed(1)}KB`}function HV($){if($<1000)return`${Math.round($)}ms`;let Z=$/1000;if(Z<60)return`${Z<10?Z.toFixed(1):Math.round(Z)}s`;let J=Math.floor(Z/60),Q=Math.round(Z%60);return Q?`${J}m ${Q}s`:`${J}m`}function nb($){return(Z)=>Z.replace(/\/[^\s"']+/g,(J)=>{if(!$)return J;let Q=rH($,J);return Q.startsWith("..")?J:Q})}var ob={read:"Read file",write:"Write file",edit:"Edit file",apply_patch:"Edit",exec:"Bash",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"},tb={ToolSearch:"Tool Search",WebSearch:"Web Search",WebFetch:"Web Fetch"};function zV($){if($.provider==="openclaw")return ob[$.name]??$.name;return tb[$.name]??$.name}function eb($){if(!$.startsWith("mcp__"))return $;let Z=$.slice(5).split("__");return Z.length>=2?Z.slice(1).join("__"):Z[0]}function KV($,Z){let J=$.input??{},Q=nb(Z);if($.provider==="openclaw")return Zy($.name,J,Q);return $y($.name,J,Q)}function $y($,Z,J){if($==="Bash")return J(`$ ${O1(Z,"command")}`);if($==="Read"||$==="Write"||$==="Edit")return J(O1(Z,"file_path"));if($==="Glob")return J(O1(Z,"pattern"));if($==="Grep")return`/${O1(Z,"pattern")}/ ${J(O1(Z,"path"))}`;if($==="WebSearch")return O1(Z,"query");if($==="WebFetch")return O1(Z,"url");if($==="ToolSearch"){let Q=O1(Z,"query");if(Q.startsWith("select:"))return Q.slice(7).split(",").map(eb).join(", ");return Q}return""}function Zy($,Z,J){if($==="read"||$==="write"||$==="edit")return J(O1(Z,"path"));if($==="apply_patch"){let Q=O1(Z,"patch"),X=Q.split(`
8
- `).find((G)=>G.startsWith("*** "))??Q.split(`
9
- `)[0];return J(X??"")}if($==="exec")return J(`$ ${O1(Z,"command")}`);if($==="process"){let Q=O1(Z,"action"),X=O1(Z,"name");return[Q,X].filter(Boolean).join(" ")||J(O1(Z,"command"))}if($==="web_search"||$==="x_search")return O1(Z,"query");if($==="web_fetch")return O1(Z,"url");if($==="memory_search")return O1(Z,"query");if($==="memory_get")return O1(Z,"key")||O1(Z,"name");if($==="sessions_history"||$==="sessions_send"||$==="sessions_yield")return O1(Z,"sessionKey")||O1(Z,"agentId");if($==="sessions_list"||$==="agents_list")return O1(Z,"agentId");if($==="subagents"||$==="sessions_spawn")return O1(Z,"task")||O1(Z,"agentId");if($==="image"||$==="image_generate")return O1(Z,"prompt")||J(O1(Z,"path"));if($==="message")return O1(Z,"recipient")||O1(Z,"to");if($==="update_plan"){let Q=Z.plan;if(Array.isArray(Q)){let G=Q.find((H)=>!!H&&typeof H==="object"&&H.status==="in_progress")?.step??Q[0]?.step;if(typeof G==="string")return G}return""}return""}var K5=O(l(),1),YV=[WV,qV,aH];function Jy(){let[$,Z]=y3.useState(0);y3.useEffect(()=>{let Q=setInterval(()=>Z((X)=>(X+1)%YV.length),600);return()=>clearInterval(Q)},[]);let J=YV[$];return K5.jsx(h6,{className:"size-5",children:K5.jsx(J,{size:16,stroke:1.75,className:"text-foreground"})})}function BV({call:$,cwd:Z,isFirst:J,isLast:Q,renderNestedParts:X}){let[G,H]=y3.useState(!1),z=$.subagent,K=$.input??{},Y=z?.description??K.description??"Subtask",W=z?.status,q=$.state==="error"||W==="failed",B=$.state==="running"||W==="running",U=z?.usage?.toolUses,F=z?.usage?.durationMs,N=(B&&z?.progress?.length?z.progress[z.progress.length-1]:null)??(U!=null?`Took ${U} step${U===1?"":"s"}`:null),L=(z?.transcript??[]).flatMap((A)=>A.parts),_=typeof $.output==="string"?$.output:"",w=L.length>0||!!_;return K5.jsx(R3,{isFirst:J,isLast:Q,marker:B?K5.jsx(Jy,{}):K5.jsx(h6,{className:"size-5",children:K5.jsx(aH,{size:16,stroke:1.75,className:"text-foreground"})}),isError:q,children:K5.jsxs("div",{className:"min-w-0 flex-1",children:[K5.jsxs("button",{type:"button",title:`Agent: ${Y}`,onClick:()=>w&&H((A)=>!A),className:B0("group/row flex w-full flex-col items-start gap-0.5 py-1.5 text-left select-none",w?"cursor-pointer":"cursor-default"),children:[K5.jsxs("span",{className:"flex w-full items-center gap-2",children:[K5.jsxs(nF,{active:B,className:"min-w-0 flex-1 truncate text-xs font-medium",children:["Agent: ",Y]}),!B&&F!=null&&K5.jsx("span",{className:"shrink-0 rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground tabular-nums",children:HV(F)}),W==="failed"&&K5.jsx("span",{className:"shrink-0 text-xs text-destructive",children:"✗"}),W==="stopped"&&K5.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"✗"}),w&&K5.jsx(b3,{open:G})]}),N&&K5.jsx("span",{className:"w-full truncate text-xs text-muted-foreground",children:N})]}),w&&K5.jsx(E3,{open:G,children:K5.jsxs("div",{className:"mt-1 mb-1 overflow-hidden rounded-md border border-border",children:[L.length>0&&K5.jsx("div",{className:"py-1.5 pr-2 pl-3",children:X(L,Z)}),_&&K5.jsx("div",{className:B0("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:_})]})})]})})}var N9=O(v(),1);var wV=O(v(),1);var oH=new Set(["<",">","{","}","[","]"]),Zz=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"]),Qy=new Set([...Zz,"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"]),LV=new Set(["+","-","*","/","%","=","!","&","|","^","~","!","?",":",".",",",";","'",'"',".","(",")","[","]","#","@","\\",...oH]),Xy={keywords:Zz,onCommentStart:AV,onCommentEnd:Uy};function Gy($){let Z=0;if(/\binterface\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\btype\s+[A-Za-z_$][\w$]*\s*=/.test($))Z+=2;if(/\benum\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test($))Z+=2;if(/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test($))Z+=1;if(/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test($))Z+=1;if(/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test($))Z+=1;return Z>=2}function Hy($,Z){if($[Z]!=="<")return!1;let J=0,Q=!1;for(let X=Z;X<$.length;X++){let G=$[X];if(G==="<"){J++;continue}if(G===">"){if(J--,J===0){let H=X+1;while(H<$.length&&/\s/.test($[H]))H++;if(!(Q&&$[H]==="("))return!1;let z=$.slice(H,H+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(z)}continue}if(J===0)continue;if(/[$A-Za-z_]/.test(G)){Q=!0;continue}if(/[\s,\.\=\?\:\|\&\[\]]/.test(G))continue;return!1}return!1}var tZ=["identifier","keyword","string","class","property","entity","jsxliterals","sign","comment","break","space"],[g6,zy,k7,sH,nH,Ky,Yy,T4,UV,tH,FV]=tZ.map(($,Z)=>Z);function x3($){return/^[^\S\r\n]+$/g.test($)}function Wy($){return LV.has($)}function qy($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function eZ($){return/^[\w_]+$/.test($)||NV($)}function VV($){let Z=$[0];return eZ(Z)&&Z===Z.toUpperCase()||$==="null"}function NV($){return/[^\u0000-\u007f]/.test($)}function _V($){return/^[a-zA-Z]$/.test($)}function MV($){return _V($)||NV($)}function f6($){return MV($[0])&&($.length===1||eZ($.slice(1)))}function eH($){return $==="`"}function $z($){return $==='"'||$==="'"}function By($){return $z($)||eH($)}function AV($,Z){let J=$+Z;if(J==="/*")return 2;return J==="//"?1:0}function Uy($,Z){return $+Z==="*/"?2:Z===`
10
- `?1:0}function Fy($){return $[0]==="/"&&!AV($[0],$[1])}function Vy($,Z){let J={...Xy,...Z},Q=!!(Z&&Z.keywords instanceof Set),X=Gy($),G=Q?J.keywords:X?Qy:Zz,{onCommentStart:H,onCommentEnd:z}=J,K=J.typeKeywords instanceof Set?J.typeKeywords:null,Y="",W=-1,q=[-1,""],B=[-2,""],U=[],F=!1,V=0,N=!1,L=0,_=()=>F&&!N&&!V,w=()=>V&&!_(),A=()=>!V&&_()&&!N&&L>0,D=null,M=!1,j=0,T=0,E=()=>D!==null,C=()=>M,g=()=>T>j,b=()=>T>0&&T===j,k=()=>E()||g();function x(I){let S=I===`
11
- `;if(w()){if(E())return k7;let[,p]=q;if(f6(I)){if(p==="<"||p==="</")return Ky}}if(A())return Yy;if(E()||g())return k7;else if(K&&K.has(I))return q[1]==="."?g6:sH;else if(G.has(I))return q[1]==="."?g6:zy;else if(S)return tH;else if(x3(I))return FV;else if(I.split("").every(Wy))return T4;else if(VV(I))return w()?g6:sH;else{if(f6(I)){let p=q[1]==="."&&f6(B[1]);if(!k()&&!p)return g6;if(p)return nH}return k7}}let R=(I,S)=>{if(S)Y=S;if(Y){W=typeof I==="number"?I:x(Y);let h=[W,Y];if(W!==FV&&W!==tH)B=q,q=h;U.push(h)}Y=""};for(let I=0;I<$.length;I++){let S=$[I],h=$[I-1],p=$[I+1],P=h+S,t=S+p;if(typeof J.onQuote==="function"&&S==="'"&&!E()&&!A()&&!g()){let c=J.onQuote(S,I,$);if(typeof c==="number"&&c>=1&&!Number.isNaN(c)){let X0=Math.min(c,$.length-I),K0=I+X0;R(),Y=$.slice(I,K0),R(g6),I=K0-1;continue}}if($z(S)&&!A()&&!g()){if(R(),h!=="\\"){if(D&&S===D)D=null;else if(!D)D=S}R(k7,S);continue}if(!g()){if(h!=="\\n"&&eH(S)){R(),R(k7,S),T++;continue}}if(g()){if(h!=="\\n"&&eH(S)){if(T>0){R(),T--,R(k7,S);continue}}if(t==="${"){j++,R(k7),R(T4,t),I++;continue}}if(b()&&S==="}"){R(),j--,R(T4,S);continue}if(_()){if(S==="{"){R(),R(T4,S),N=!0;continue}}if(F){if(!V&&S==="<"){if(R(),p==="/")V=2,Y=t,I++;else V=1,Y=S;R(T4);continue}if(V){if(S===">"&&!"/=".includes(h)){if(R(),V===1)V=0,L++;else V=0,F=!1;R(T4,S);continue}if(t==="/>"||t==="</"){if(Y!=="<"&&Y!=="/")R();if(t==="/>")V=0;else L--;if(!L)F=!1;Y=t,I++,R(T4);continue}if(S==="<"){R(),Y=S,R(T4);continue}if(p==="-"&&!k()&&!A()){if(Y){R(nH,Y+S+p),I++;continue}}if(p==="="&&!k()){if(!x3(S)){if(x3(Y))R();let c=Y+S;if(f6(c)){R(nH,c);continue}}}}}if(!V&&(S==="<"&&MV(p)||t==="</")){let c=I-1;while(c>=0&&/\s/.test($[c]))c--;let X0=c>=0?$[c]:"",[K0,Z0]=q,G0=!1,U0=!1;if(Y&&!x3(Y)){let u=Y;if(VV(u)||u==="true"||u==="false")G0=!0;else if(G.has(u)&&f6(u))U0=!0;else if(f6(u))G0=!0}let m=S==="<"&&/[$\w\]\)]/.test(X0)&&(G0||!U0&&(K0===g6||K0===sH||K0===T4&&(Z0===")"||Z0==="]"))),s=S==="<"&&Hy($,I);if(!m&&!s)V=p==="/"?2:1;if(S==="<"&&(p==="/"||_V(p))){if(!m&&!s&&!k()&&!A()&&!C())F=!0}}let z0=By(S),y=g(),n=!F&&Fy(t),_0=A();if(z0||y||$z(D))Y+=S;else if(n){R();let[c,X0]=q;if(n&&c!==-1&&!(c===T4&&X0!==")"||c===UV)){Y=S,R();continue}M=!0;let K0=I++,Z0=()=>I>=$.length,G0=()=>Z0()||$[I]===`
12
- `,U0=!1,m=!1;for(;!G0();I++){let s=$[I],u=$[I-1]==="\\";if(!u&&s==="[")m=!0;if(!u&&s==="]")m=!1;if(s==="/"&&!m&&!u){U0=!0;while(K0!==I&&/^[a-z]$/.test($[I+1])&&!G0())I++;break}}if(M=!1,K0!==I&&U0)Y=$.slice(K0,I+1),R(k7);else Y=S,R(),I=K0}else if(H(S,p)){R();let c=I,X0=H(S,p);if(X0){for(;I<$.length;I++)if(z($[I-1],$[I])==X0)break}Y=$.slice(c,I+1),R(UV)}else if(S===" "||S===`
13
- `)if(S===" "&&(x3(Y)||!Y||_0)){if(Y+=S,p==="<")R()}else R(),Y=S,R();else if(N&&S==="}")R(),Y=S,R(),N=!1;else if(_0&&!oH.has(S)||g()||(eZ(S)===eZ(Y[Y.length-1])||_())&&!LV.has(S))Y+=S;else{if(P==="</")Y=P;if(R(),P!=="</")Y=S;if(t==="</"||t==="/>")Y=t,R(),I++;else if(oH.has(S))R()}}return R(),U}function Ly($,Z){let J=[],Q=Z&&typeof Z.lineClassName==="function"?Z.lineClassName:null,X=0,G=(Y,W)=>{let q=Q?Q(W,X):"";return X++,{type:"element",tagName:"span",children:Y,properties:{className:q?`sh__line ${q}`:"sh__line"}}};function H(Y){let W=Y.map(([,B])=>B).join(""),q=Y.map(([B,U])=>{let F=tZ[B];return{type:"element",tagName:"span",children:[{type:"text",value:U}],properties:{className:`sh__token--${F}`,style:{color:`var(--sh-${F})`}}}});J.push(G(q,W))}let z=[],K=!1;for(let Y=0;Y<$.length;Y++){let W=$[Y],[q,B]=W,U=Y===$.length-1;if(q!==tH){if(B.includes(`
14
- `)){let F=B.split(`
15
- `);for(let V=0;V<F.length;V++)if(z.push([q,F[V]]),V<F.length-1)H(z),z.length=0}else z.push(W);K=!1}else{if(K)H([]);else H(z),z.length=0;if(U)H([]);K=!0}}if(z.length)H(z);return J}var Ny=($)=>{let Z=`class="${$.className}"`;if($.style){let J=Object.entries($.style).map(([Q,X])=>`${Q}:${X}`).join(";");Z+=` style="${J}"`}return Z};function _y($){return $.map((Z)=>{let{tagName:J}=Z,Q=Z.children.map((X)=>{let{tagName:G,children:H,properties:z}=X;return`<${G} ${Ny(z)}>${qy(H[0].value)}</${G}>`}).join("");return`<${J} class="${Z.properties.className}">${Q}</${J}>`}).join(`
16
- `)}function DV($,Z){let J=Vy($,Z),Q=Ly(J,Z);return _y(Q)}var C80={TokenTypes:tZ,TokenMap:new Map(tZ.map(($,Z)=>[$,Z]))};var Jz=O(l(),1),My=B0("[--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 OV({code:$,className:Z}){let J=wV.useMemo(()=>DV($),[$]);return Jz.jsx("pre",{className:B0("overflow-auto font-mono text-xs leading-relaxed whitespace-pre",My,Z),children:Jz.jsx("code",{dangerouslySetInnerHTML:{__html:J}})})}var Ay={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 Dy($){let Z=$.split(/[\\/]/).pop()??"",J=Z.lastIndexOf("."),Q=J>0?Z.slice(J+1).toLowerCase():"";return Ay[Q]??null}function wy($){let Z=$.trim();if(Z.length<2||!(Z.startsWith("{")||Z.startsWith("[")))return null;try{return JSON.stringify(JSON.parse(Z),null,2)}catch{return null}}function Oy($){let Z=$.split(`
17
- `);if(!Z.some((J)=>/^\s*\d+\t/.test(J)))return $;return Z.map((J)=>J.replace(/^\s*\d+\t/,"")).join(`
18
- `)}function PV($,Z){let J=$.input??{},Q=typeof J.file_path==="string"?J.file_path:typeof J.path==="string"?J.path:"",X=Q?Dy(Q):null,G=$.name==="Read"||$.name==="read",H=$.name==="Write"||$.name==="write";if(X&&G&&Z)return{kind:"highlight",code:Oy(Z),label:X};if(X&&H&&typeof J.content==="string"&&J.content)return{kind:"highlight",code:J.content,label:X};let z=wy(Z);if(z)return{kind:"highlight",code:z,label:"json"};return{kind:"plain"}}var i5=O(l(),1),Qz="max-h-[280px] overflow-auto px-3 py-2.5 font-mono text-xs leading-relaxed";function CV({call:$,output:Z,isError:J}){let[Q,X]=N9.useState(!1),G=N9.useMemo(()=>J?{kind:"plain"}:PV($,Z),[$,Z,J]);if(G.kind==="plain")return i5.jsx("div",{className:B0("rounded-md border",J?"border-destructive/30 bg-destructive/10":"border-border bg-muted"),children:i5.jsx("pre",{className:B0(Qz,"break-all whitespace-pre-wrap",J?"text-destructive":"text-muted-foreground"),children:Z||"(empty)"})});return i5.jsxs("div",{className:"overflow-hidden rounded-md border border-border bg-muted",children:[i5.jsx(Py,{raw:Q,onRaw:X,label:G.label,size:GV(Z),copyText:Q?Z:G.code}),Q?i5.jsx("pre",{className:B0(Qz,"break-all whitespace-pre-wrap text-muted-foreground"),children:Z||"(empty)"}):i5.jsx(OV,{code:G.code,className:B0(Qz,"text-muted-foreground")})]})}function Py({raw:$,onRaw:Z,label:J,size:Q,copyText:X}){return i5.jsxs("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1",children:[[[!1,J],[!0,"raw"]].map(([H,z])=>i5.jsx(C0,{type:"button",variant:$===H?"outline":"ghost",size:"sm",onClick:()=>Z(H),children:z},z)),i5.jsx("div",{className:"flex-1"}),i5.jsx("span",{className:"text-[10px] font-medium text-muted-foreground tabular-nums",children:Q}),i5.jsx(jy,{text:X})]})}function jy({text:$}){let[Z,J]=N9.useState(!1);return N9.useEffect(()=>{if(!Z)return;let X=setTimeout(()=>J(!1),1500);return()=>clearTimeout(X)},[Z]),i5.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard?.writeText($).then(()=>J(!0)).catch(()=>{})},"aria-label":Z?"Copied":"Copy",children:Z?i5.jsx($J,{stroke:1.75}):i5.jsx(jV,{stroke:1.75})})}var q1=O(l(),1);function _9({parts:$,cwd:Z=null,processing:J=!1}){let Q=$.filter((X)=>X.type==="reasoning"||X.type==="tool-call");return q1.jsx("div",{className:"flex flex-col",children:Q.map((X,G)=>{let H=G===Q.length-1,z={isFirst:G===0,isLast:H};if(X.type==="reasoning")return q1.jsx(Cy,{text:X.text,inProgress:J&&H,...z},G);return q1.jsx(Iy,{call:X.call,cwd:Z,...z},X.call.toolCallId||G)})})}function Xz({isFirst:$,isLast:Z,call:J,leading:Q,marker:X,name:G,brief:H,preview:z}){let[K,Y]=Gz.useState(!1),W=J.state==="error",q=J.state==="running"||J.state==="pending",B=W?J.errorText??"":typeof J.output==="string"?J.output:"",U=!!(B||W||z),F=H?`${G}: ${H}`:G;return q1.jsx(R3,{isFirst:$,isLast:Z,marker:X,loading:q,isError:W,children:q1.jsxs("div",{className:"min-w-0 flex-1",children:[q1.jsxs("button",{type:"button",title:F,onClick:()=>U&&Y((V)=>!V),className:B0(dH,U?"cursor-pointer":"cursor-default"),children:[Q,q1.jsx("span",{className:"shrink-0 text-xs font-medium whitespace-nowrap",children:G}),H&&q1.jsx("span",{className:"min-w-0 self-baseline truncate text-[12px] text-ring",children:H}),q&&X&&q1.jsx(l5,{size:12,stroke:1.75,className:"shrink-0 animate-spin text-ring"}),U&&q1.jsx(b3,{open:K})]}),U&&q1.jsx(E3,{open:K,children:q1.jsxs("div",{className:"mt-1 mb-1 flex flex-col gap-1.5",children:[z,(B||W)&&q1.jsx(CV,{call:J,output:B,isError:W})]})})]})})}function Cy({isFirst:$,isLast:Z,text:J,inProgress:Q=!1}){let[X,G]=Gz.useState(!1),H=Q?"Thinking":"Thought",z=Q||X;return q1.jsx(R3,{isFirst:$,isLast:Z,loading:Q,children:q1.jsxs("div",{className:"min-w-0 flex-1",children:[q1.jsxs("button",{type:"button",title:`${H}: ${J}`,onClick:()=>G((K)=>!K),className:B0(dH,"cursor-pointer"),children:[q1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:H}),q1.jsx(b3,{open:z})]}),q1.jsx(E3,{open:z,children:q1.jsx("div",{className:"mt-1 mb-1 pr-2 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",children:J})})]})})}function Iy({call:$,cwd:Z,isFirst:J,isLast:Q}){if($.caller==="subagent")return q1.jsx(BV,{call:$,cwd:Z,isFirst:J,isLast:Q,renderNestedParts:(H,z)=>q1.jsx(_9,{parts:H,cwd:z})});if($.name==="Skill"&&$.skill){let H=$.state==="success";return q1.jsx(Xz,{isFirst:J,isLast:Q,call:$,marker:H?q1.jsx(tF,{icon:IV,size:16,stroke:1.75}):void 0,name:"Loading Skill",brief:$.skill.skillName})}let X=JV($)??QV($);if(X){let H=XV(X.server,X.tool);return q1.jsx(Xz,{isFirst:J,isLast:Q,call:$,marker:q1.jsx(eF,{src:nZ(X.server)}),name:k3(X.server),brief:X.rest?`${H} ${X.rest}`:H})}let G=$.state==="error"?null:rF($,Z);return q1.jsx(Xz,{isFirst:J,isLast:Q,call:$,leading:q1.jsx(Ty,{call:$}),name:zV($),brief:KV($,Z),preview:G?q1.jsx(aF,{relPath:G}):void 0})}function Ty({call:$}){if($.caller!=="mcp"&&$.caller!=="server-tool")return null;let Z=$.caller==="mcp"?`mcp${$.mcpServer?`:${$.mcpServer.slice(0,8)}`:""}`:"server";return q1.jsx("span",{className:"shrink-0 rounded border border-border px-1 text-[9px] text-muted-foreground uppercase",children:Z})}var zz="/Users/kim/git/confetti",TV={toolCallId:"toolu_fixture_tool_search",name:"ToolSearch",caller:"model",provider:"claude-code",state:"success",input:{query:"select:mcp__notion__notion-search,mcp__notion__notion-get-teams,mcp__notion__notion-get-users",max_results:3},output:`mcp__notion__notion-search
19
- mcp__notion__notion-get-teams
20
- mcp__notion__notion-get-users`},kV={toolCallId:"toolu_fixture_notion_search",name:"mcp__notion__notion-search",caller:"model",provider:"claude-code",state:"success",input:{query:"project notes docs overview",query_type:"internal",page_size:25},output:'{"results":[{"id":"3f1c9a72-0d62-4511-9dc9-5b7f38409a22","title":"Reading List","url":"https://app.notion.com/p/3f1c9a720d6245119dc95b7f38409a22?pvs=1","type":"page","highlight":"Reading List","timestamp":"2024-10-17T13:51:00.000Z"},{"id":"8b2d17aa-6741-4993-88bc-5adf2dabb8da","title":"To-Do","url":"https://app.notion.com/p/8b2d17aa6741499388bc5adf2dabb8da?pvs=1","type":"page","highlight":"canvas-confetti performance notes and particle pooling","timestamp":"2026-06-15T13:14:00.000Z"},{"id":"244536fd-e65b-433f-92bf-aa95efa91f35","title":"Plans & Notes","url":"https://app.notion.com/p/244536fde65b433f92bfaa95efa91f35?pvs=1","type":"database","highlight":"Plans & Notes","timestamp":"2024-02-06T10:02:00.000Z"},{"id":"5a668c31-b678-4035-b58e-d33e3ce86f5e","title":"Animation Research","url":"https://app.notion.com/p/5a668c31b6784035b58ed33e3ce86f5e?pvs=1","type":"page","highlight":"spring easings vs. bezier — generate N particle bursts in parallel and compare frame budgets","timestamp":"2025-11-03T08:07:00.000Z"},{"id":"41c28e19-b678-40df-ade3-dd8cec63de64","title":"Roadmap","url":"https://app.notion.com/p/41c28e19b67840dfade3dd8cec63de64?pvs=1","type":"database","highlight":"Roadmap","timestamp":"2026-06-09T08:00:00.000Z"},{"id":"6d9e2f44-b678-423e-9795-01de5d5f6734","title":"Meeting notes","url":"https://app.notion.com/p/6d9e2f44b678423e979501de5d5f6734?pvs=1","type":"database","highlight":"Meeting notes","timestamp":"2025-11-06T15:22:00.000Z"},{"id":"7fa31c55-b678-401d-948f-c47118e21516","title":"illustrations","url":"https://app.notion.com/p/7fa31c55b678401d948fc47118e21516?pvs=1","type":"page","highlight":"illustrations","timestamp":"2026-06-09T18:01:00.000Z"},{"id":"92e4b5c8-8d50-4938-8808-716a4e89dba6","title":"Weekly Update: March 4","url":"https://app.notion.com/p/92e4b5c88d5049388808716a4e89dba6?pvs=1","type":"page","highlight":"add backlog project for migrating v1 users","timestamp":"2022-07-30T18:34:00.000Z"},{"id":"1c778a02-b678-407b-9340-e1e830e38c50","title":"demo site","url":"https://app.notion.com/p/1c778a02b678407b9340e1e830e38c50?pvs=1","type":"page","highlight":"Interactive playground (CodeSandbox style)","timestamp":"2026-06-15T08:15:00.000Z"},{"id":"e3558d21-b678-406b-9a90-efaac9d864cf","title":"Feature Requests","url":"https://app.notion.com/p/e3558d21b678406b9a90efaac9d864cf?pvs=1","type":"database","highlight":"Feature Requests","timestamp":"2026-03-09T13:03:00.000Z"},{"id":"a91f4c6e-ce16-4002-bcb1-ead4923b9963","title":"Beta feedback","url":"https://app.notion.com/p/a91f4c6ece164002bcb1ead4923b9963?pvs=1","type":"database","highlight":"Beta feedback","timestamp":"2026-04-22T11:56:00.000Z"},{"id":"b0537e88-b678-40f3-8f04-cc7fef16e055","title":"confetti-v2","url":"https://app.notion.com/p/b0537e88b67840f38f04cc7fef16e055?pvs=1","type":"page","highlight":"WebGL renderer spike — offscreen canvas + worker, fall back to 2d context","timestamp":"2026-04-21T09:42:00.000Z"},{"id":"c6b19d34-b678-4145-9023-ffb37c04037d","title":"Physics Notes","url":"https://app.notion.com/p/c6b19d34b67841459023ffb37c04037d?pvs=1","type":"page","highlight":"Physics Notes","timestamp":"2026-04-21T13:07:00.000Z"},{"id":"d84a6f10-b678-41ea-845c-d7cc7c2ad2c4","title":"Docs Outline","url":"https://app.notion.com/p/d84a6f10b67841ea845cd7cc7c2ad2c4?pvs=1","type":"page","highlight":"\uD83D\uDCD8 Getting started — full walkthrough (install, first burst, presets)","timestamp":"2026-06-09T08:44:00.000Z"},{"id":"f2c07b45-b678-402c-a8e7-d897826cf96d","title":"old","url":"https://app.notion.com/p/f2c07b45b678402ca8e7d897826cf96d?pvs=1","type":"page","highlight":"Notes:","timestamp":"2026-03-06T16:31:00.000Z"},{"id":"09d6e2a7-9908-4d54-be46-a974ac5019da","title":"Weekly Update: Jan 28","url":"https://app.notion.com/p/09d6e2a799084d54be46a974ac5019da'},ky={toolCallId:"toolu_fixture_notion_fetch_oss",name:"mcp__notion__notion-fetch",caller:"model",provider:"claude-code",state:"success",input:{id:"55e1c208-1f0f-47cd-9422-bd7dbc54d536"},output:'{"metadata":{"type":"page"},"title":"\uD83D\uDEE5 Open-Source","url":"https://app.notion.com/p/55e1c2081f0f47cd9422bd7dbc54d536","text":"Here is the result of \\"view\\" for the Page with URL https://app.notion.com/p/55e1c2081f0f47cd9422bd7dbc54d536 as of 2026-05-29T13:08:56.275Z:\\n<page url=\\"https://app.notion.com/p/55e1c2081f0f47cd9422bd7dbc54d536\\" icon=\\"\uD83D\uDEE5\\">\\n<ancestor-path></ancestor-path>\\n<properties>\\n{\\"title\\":\\"Open-Source\\"}\\n</properties>\\n<content>\\n<page url=\\"https://app.notion.com/p/71a2b39c6438406fac456aeef33a046d\\">tinyrouter</page>\\n<page url=\\"https://app.notion.com/p/83b4c5de45af40c28a19f635332f9c4c\\">confetti</page>\\n<page url=\\"https://app.notion.com/p/95c6d7f0210d42e0888168401a40345e\\">mdnav</page>\\n<page url=\\"https://app.notion.com/p/07d8e912111a4df295726341c22decbc\\">pixelpad</page>\\n<page url=\\"https://app.notion.com/p/19e0fb3405c743628f0c0b864b4182ee\\">`use-sparkle`</page>\\n<page url=\\"https://app.notion.com/p/2bf21c561e5d4e888f6cdb86e5adcb9d\\">use-hotkey</page>\\n<empty-block/>\\n<empty-block/>\\n</content>\\n</page>"}'},Ey={toolCallId:"toolu_fixture_notion_fetch_confetti",name:"mcp__notion__notion-fetch",caller:"model",provider:"claude-code",state:"success",input:{id:"83b4c5de-45af-40c2-8a19-f635332f9c4c"},output:'{"metadata":{"type":"page"},"title":"confetti","url":"https://app.notion.com/p/83b4c5de45af40c28a19f635332f9c4c","text":"Here is the result of \\"view\\" for the Page with URL https://app.notion.com/p/83b4c5de45af40c28a19f635332f9c4c as of 2024-04-19T10:05:10.098Z:\\n<page url=\\"https://app.notion.com/p/83b4c5de45af40c28a19f635332f9c4c\\">\\n<ancestor-path>\\n<parent-page url=\\"https://app.notion.com/p/55e1c2081f0f47cd9422bd7dbc54d536\\" title=\\"Open-Source\\"/>\\n</ancestor-path>\\n<properties>\\n{\\"title\\":\\"confetti\\"}\\n</properties>\\n<content>\\n- [x] Split the physics step from the render step\\n- [x] Basic React API\\n\\t- [x] Controlled/uncontrolled\\n\\t- [x] SSR: ok! No canvas until mount\\n\\t- [x] Detach on unmount\\n\\t- [x] `asChild` prop\\n\\t- [x] Block elements and `tagName`\\n\\t- [x] Fire on `click`\\n\\t- [x] Pass particle options\\n\\t- [x] asChild types\\n\\t- [x] Reduced-motion fallback\\n- [x] Pause bursts when the tab is hidden (VisibilityObserver)\\n- [x] Default burst has no trail. Needs a wrapper that disables the selector via `:has` — but then how do block elements animate? And `asChild` breaks.\\n- [x] Dark/light theme, none, auto, accent color\\n- [x] Demo: light/dark theme\\n- [x] `useIsomorphicLayoutEffect`\\n- [x] Particle pooling (no per-frame allocs)\\n- [x] Build and package\\n- [x] Publish a canary and dogfood it on the demo site\\n- [x] Fallback for Safari + Firefox: pre-rendered sprite sheet, three layers offset by primes 3, 5, 7 — loop four frames\\n- [x] data-active\\n- [x] pixelRatio for the fallback\\n- [x] How should styles load? Ship them separately.\\n- [x] Simple README\\n- [x] Get the easing curve right\\n- [ ] Use inline style in SSR\\n<empty-block/>\\n```javascript\\n// Default confetti: uncontrolled, light theme, fires on click, creates an\\n// inline <span> wrapper, no trail, does not follow the pointer\\n\\n/**\\n * Elements \\n */\\n<Confetti>Party!</Confetti> // <span>Party!</span>\\n<Confetti className=\\"custom\\">Party!</Confetti>\\n\\n// block elements \\n<Confetti block><img /></Confetti> // <div><img /></div>\\n<Confetti tagName=\\"div\\"><img /></Confetti> // alias\\n\\n// advanced\\n<Confetti asChild><button aria-label=\\"celebrate\\" /></Confetti>\\n\\n/**\\n * Controlled/uncontrolled component \\n */\\n\\n<Confetti /> // fires on click, uncontrolled\\n<Confetti fireOn=\\"click\\" />\\n<Confetti fireOn=\\"hover\\" />\\n<Confetti defaultActive={false} onChange={(value) => change} />\\n\\n// when `active` is provided, it becomes controlled and\\n// `fireOn` and `defaultActive` have no effect \\n<Confetti active={true}>Always bursting</Confetti> // controlled\\n<Confetti active={value} onClick={() => setValue()}</Confetti> // controlled\\n\\n/** \\n * Theming \\n */\\n\\n<Confetti /> // default theme is `light`\\n<Confetti theme=\\"dark\\" />\\n<Confetti theme=\\"auto\\" /> // system-defined\\n<Confetti theme=\\"dark\\" accentColor=\\"red\\" /> // use `colord` here\\n\\n/**\\n * Particle options\\n */\\n<Confetti count={120} gravity={0.8} spread={60}>Boom</Confetti>\\n<Confetti preset=\\"fireworks\\">Boom</Confetti>\\n\\n/** \\n * Styling \\n */\\n\\nimport { Confetti } from \\"confetti\\"\\n\\nimport { Confetti } from \\"confetti/unstyled\\"\\nimport \\"confetti/styles.css\\"\\n```\\n<empty-block/>\\n<empty-block/>\\n<page url=\\"https://app.notion.com/p/3dc43e781e5d4e888f6cdb86e5adcb00\\">Confetti: website</page>\\n</content>\\n</page>"}'},EV={toolCallId:"toolu_fixture_bash_pwd",name:"Bash",caller:"model",provider:"claude-code",state:"success",input:{command:'pwd && echo "---" && ls -la && echo "--- git ---" && git rev-parse --is-inside-work-tree 2>/dev/null && git remote -v 2>/dev/null',description:"Show current directory and git info"},output:`/Users/kim/git/confetti
21
- ---
22
- total 232
23
- drwxr-xr-x 19 kim staff 608 Jun 9 19:41 .
24
- drwxr-xr-x 52 kim staff 1664 Jun 15 10:32 ..
25
- drwx------ 3 kim staff 96 Nov 17 2025 .claude
26
- drwxr-xr-x 15 kim staff 480 May 23 09:30 .git
27
- -rw-r--r-- 1 kim staff 294 May 23 08:52 .gitignore
28
- drwxr-xr-x@ 3 kim staff 96 Jun 9 19:41 .moi
29
- -rw-r--r-- 1 kim staff 95 Nov 13 2025 .prettierrc
30
- -rw-r--r-- 1 kim staff 73126 May 23 09:29 bun.lock
31
- drwxr-xr-x@ 8 kim staff 256 May 23 09:31 esm
32
- -rw-r--r-- 1 kim staff 1210 Nov 13 2025 LICENSE
33
- drwxr-xr-x 160 kim staff 5120 May 23 09:30 node_modules
34
- -rw-r--r-- 1 kim staff 2072 May 23 08:52 package.json
35
- -rw-r--r--@ 1 kim staff 4600 May 5 21:49 README.md
36
- drwxr-xr-x 16 kim staff 512 May 5 21:49 src
37
- -rw-r--r-- 1 kim staff 605 Nov 13 2025 tsconfig.json
38
- -rw-r--r-- 1 kim staff 233 Nov 13 2025 tsconfig.node.json
39
- -rw-r--r-- 1 kim staff 1582 May 23 08:52 vite.config.ts
40
- drwxr-xr-x 11 kim staff 352 May 5 21:49 web
41
- --- git ---
42
- true
43
- origin git@github.com:acme/confetti.git (fetch)
44
- origin git@github.com:acme/confetti.git (push)`},Sy={toolCallId:"toolu_fixture_read_readme",name:"Read",caller:"model",provider:"claude-code",state:"success",input:{file_path:"/Users/kim/git/confetti/docs/open-source/README.md"},output:` 1 # \uD83D\uDEE5 Open-Source
45
- 2
46
- 3 Working notes, specs, and ideas for my open-source projects.
47
- 4
48
- 5 | Project | What it is |
49
- 6 |---------|------------|
50
- 7 | tinyrouter | Minimalist hooks-based router for React |
51
- 8 | confetti | <Confetti> burst effect for React |
52
- `},Ry={toolCallId:"toolu_fixture_github_get_me",name:"mcp__github__get_me",caller:"model",provider:"claude-code",state:"success",input:{},output:'{"login":"octocat","id":583231,"profile_url":"https://github.com/octocat","avatar_url":"https://avatars.githubusercontent.com/u/583231?v=4","details":{"name":"The Octocat","blog":"https://github.blog","location":"San Francisco","hireable":true,"twitter_username":"github","public_repos":8,"public_gists":8,"followers":700,"following":9,"created_at":"2011-01-25T18:44:36Z","updated_at":"2026-06-13T09:04:50Z"}}'},SV={type:"reasoning",text:`The user is greeting me casually with "Hey bro". This is a friendly greeting and they're not asking me to do anything specific yet. I should respond in a friendly, casual way and let them know I'm ready to help with whatever they need.`},by={toolCallId:"toolu_fixture_skill_widgets",name:"Skill",caller:"model",provider:"claude-code",state:"success",input:{skill:"widgets"},skill:{skillName:"widgets"},output:"Launching skill: widgets"},Kz=[{type:"tool-call",call:EV}],Yz=[SV,{type:"tool-call",call:TV},{type:"tool-call",call:by},{type:"tool-call",call:kV},{type:"tool-call",call:ky},{type:"tool-call",call:Sy},{type:"tool-call",call:EV},{type:"tool-call",call:Ey},{type:"tool-call",call:Ry}],yy={toolCallId:"toolu_fixture_running_bash",name:"Bash",caller:"model",provider:"claude-code",state:"running",input:{command:"bun test --coverage",description:"Run the test suite"}},Wz=[SV,{type:"tool-call",call:TV},{type:"tool-call",call:kV},{type:"tool-call",call:yy},{type:"reasoning",text:"The test run is still going. Once it passes I will write the summary into docs/ and open a PR."}],Hz={toolCallId:"toolu_fixture_subagent",name:"Agent",caller:"subagent",provider:"claude-code",state:"running",input:{description:"Explore mdnav-demo repo structure and purpose",subagent_type:"Explore",prompt:"Explore the mdnav-demo repository to understand what it is. Look at the repo structure, what mdnav is, example markdown, and the purpose. Give a comprehensive overview citing specific files."},output:"",subagent:{taskId:"task_explore_mdnav",description:"Explore mdnav-demo repo structure and purpose",status:"running",usage:{totalTokens:18407,toolUses:8,durationMs:10725},progress:["Reading ~/git/mdnav-demo","Reading README.md","Reading package.json","Reading CLAUDE.md","Running ls -la /Users/kim/git/mdnav-demo/","Finding **/*.md","Finding **/*.{js,ts,jsx,tsx}","Running head -100 /Users/kim/git/mdnav-demo/moby-dick.md"],transcript:[{id:"sub-1",role:"assistant",origin:{kind:"user-input"},parts:[{type:"reasoning",text:"Let me map the repo: list the markdown files, read the README, then see what the mdnav binary does."},{type:"tool-call",call:{toolCallId:"sub-glob",name:"Glob",caller:"model",provider:"claude-code",state:"success",input:{pattern:"**/*.md"},output:`README.md
53
- docs/moby-dick.md
54
- docs/sections/01-introduction.md
55
- docs/sections/02-findings.md`}},{type:"tool-call",call:{toolCallId:"sub-bash",name:"Bash",caller:"model",provider:"claude-code",state:"success",input:{command:"mdnav --help"},output:`mdnav — navigate large markdown
56
-
57
- USAGE: mdnav <file> <command>
58
-
59
- COMMANDS:
60
- toc print the table of contents
61
- read read a section (fuzzy/regex/path selector)
62
- search full-text search`}}]},{id:"sub-2",role:"assistant",origin:{kind:"user-input"},parts:[{type:"text",text:`## Comprehensive Overview of mdnav-demo
63
-
64
- **mdnav-demo** showcases **mdnav**, a CLI for large markdown documents, using the full text of Moby-Dick as a large-document fixture.`}]}]}},xy={...Hz,toolCallId:"toolu_fixture_subagent_done",state:"success",output:"mdnav-demo showcases **mdnav**, a CLI for navigating large markdown documents. The repo is a demo harness: a single `moby-dick.md` fixture plus a thin CLI (`toc`/`read`/`search`) that fuzzy-selects sections. README and CLAUDE.md frame it as a worked example, not a library.",subagent:{...Hz.subagent,taskId:"task_explore_mdnav_done",status:"completed"}},qz=[{type:"reasoning",text:"This needs a deeper look — let me spin up an Explore subagent to map the repo while I keep going."},{type:"tool-call",call:Hz}],Bz=[{type:"reasoning",text:"This needs a deeper look — let me spin up an Explore subagent to map the repo while I keep going."},{type:"tool-call",call:xy}];var G7=O(l(),1),hy=[{value:"single",label:"Single"},{value:"multiple",label:"Multiple"},{value:"live",label:"Live"},{value:"subagent",label:"Subagent"},{value:"subagent-done",label:"Subagent done"}];function vy({value:$,onChange:Z}){return G7.jsx("div",{className:"flex gap-1 rounded-lg bg-accent p-1",children:hy.map((J)=>G7.jsx(C0,{type:"button",variant:$===J.value?"default":"ghost",size:"sm",onClick:()=>Z(J.value),children:J.label},J.value))})}var gy={single:Kz,multiple:Yz,live:Wz,subagent:qz,"subagent-done":Bz};function bV(){let[$,Z]=RV.useState("multiple");return G7.jsxs("div",{className:"flex min-h-dvh flex-col items-center gap-6 bg-muted px-4 py-16",children:[G7.jsx("span",{className:"text-[11px] font-medium tracking-widest text-muted-foreground uppercase",children:"Playground / Tool calls"}),G7.jsx(vy,{value:$,onChange:Z}),G7.jsx("div",{className:"w-full max-w-[var(--column-w)] rounded-xl border border-border bg-background p-5 font-sans text-foreground shadow-sm",children:G7.jsx(_9,{parts:gy[$],cwd:zz,processing:$==="live"})})]})}async function yV($,Z){let J=await $.text();return Error(J||Z)}async function f1($,Z,J="Request failed"){let Q=await fetch($,Z);if(!Q.ok)throw await yV(Q,J);return Q.json()}async function M9($,Z,J="Request failed"){let Q=await fetch($,Z);if(!Q.ok)throw await yV(Q,J)}function Q4($,Z){return{method:$,headers:{"Content-Type":"application/json"},body:Z===void 0?void 0:JSON.stringify(Z)}}function xV($,Z){return F5({queryKey:T0.mcp($),queryFn:()=>f1(`/api/workspaces/${$}/mcp`),enabled:Z,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}function hV(){return F5({queryKey:T0.userMcp,queryFn:()=>f1("/api/mcp"),staleTime:30000,gcTime:1/0,refetchOnMount:!0,refetchOnWindowFocus:!0})}var u7={};G4(u7,{createHandle:()=>EN,Viewport:()=>kN,Trigger:()=>QN,Root:()=>oL,Positioner:()=>VN,Portal:()=>JN,Popup:()=>NN,Handle:()=>oJ,Backdrop:()=>DN,Arrow:()=>MN});var v7=O(v(),1);var vV=O(v(),1);function k4($){let Z=vV.useRef(!0);if(Z.current)Z.current=!1,$()}var V8=O(v(),1);var gV=O(v(),1),fy=[];function E4($){gV.useEffect($,fy)}var h3=0;class y5{static create(){return new y5}currentId=h3;start($,Z){this.clear(),this.currentId=setTimeout(()=>{this.currentId=h3,Z()},$)}isStarted(){return this.currentId!==h3}clear=()=>{if(this.currentId!==h3)clearTimeout(this.currentId),this.currentId=h3};disposeEffect=()=>{return this.clear}}function J5(){let $=$1(y5.create).current;return E4($.disposeEffect),$}var DJ=O(v(),1);function D5($){let Z=$1(my,$).current;return Z.next=$,Q0(Z.effect),Z}function my($){let Z={current:$,next:$,effect:()=>{Z.current=Z.next}};return Z}function p0($){return $?.ownerDocument||document}var E7=typeof navigator<"u",Uz=uy(),fV=cy(),ZJ=py(),JJ=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),QJ=Uz.platform==="MacIntel"&&Uz.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Uz.platform),N40=E7&&/firefox/i.test(ZJ),XJ=E7&&/apple/i.test(navigator.vendor),_40=E7&&/Edg/i.test(ZJ),GJ=E7&&/android/i.test(fV)||/android/i.test(ZJ),mV=E7&&fV.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,HJ=ZJ.includes("jsdom/");function uy(){if(!E7)return{platform:"",maxTouchPoints:-1};let $=navigator.userAgentData;if($?.platform)return{platform:$.platform,maxTouchPoints:navigator.maxTouchPoints};return{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function py(){if(!E7)return"";let $=navigator.userAgentData;if($&&Array.isArray($.brands))return $.brands.map(({brand:Z,version:J})=>`${Z}/${J}`).join(" ");return navigator.userAgent}function cy(){if(!E7)return"";let $=navigator.userAgentData;if($?.platform)return $.platform;return navigator.platform??""}var v3="data-base-ui-focusable",Fz="active",Vz="selected",m6="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",S4="ArrowLeft",R4="ArrowRight",g3="ArrowUp",A9="ArrowDown";function x5($){let Z=$.activeElement;while(Z?.shadowRoot?.activeElement!=null)Z=Z.shadowRoot.activeElement;return Z}function S0($,Z){if(!$||!Z)return!1;let J=Z.getRootNode?.();if($.contains(Z))return!0;if(J&&uV(J)){let Q=Z;while(Q){if($===Q)return!0;Q=Q.parentNode||Q.host}}return!1}function D9($,Z){if(!L1($))return!1;let J=$;if(Z.hasElement(J))return!J.hasAttribute("data-trigger-disabled");for(let[,Q]of Z.entries())if(S0(Q,J))return!Q.hasAttribute("data-trigger-disabled");return!1}function y1($){if("composedPath"in $)return $.composedPath()[0];return $.target}function f8($,Z){if(Z==null)return!1;if("composedPath"in $)return $.composedPath().includes(Z);let J=$;return J.target!=null&&Z.contains(J.target)}function pV($){return $.matches("html,body")}function w9($){return b1($)&&$.matches(m6)}function f3($){if(!$)return!1;return $.getAttribute("role")==="combobox"&&w9($)}function cV($){if(!$||HJ)return!0;try{return $.matches(":focus-visible")}catch(Z){return!0}}function O9($){if(!$)return null;return $.hasAttribute(v3)?$:$.querySelector(`[${v3}]`)||$}function b4($,Z,J=!0){return $.filter((X)=>X.parentId===Z&&(!J||X.context?.open)).flatMap((X)=>[X,...b4($,X.id,J)])}function Lz($,Z){let J=[],Q=$.find((X)=>X.id===Z)?.parentId;while(Q){let X=$.find((G)=>G.id===Q);if(Q=X?.parentId,X)J=J.concat(X)}return J}function V5($){$.preventDefault(),$.stopPropagation()}function dV($){return"nativeEvent"in $}function zJ($){if($.pointerType===""&&$.isTrusted)return!0;if(GJ&&$.pointerType)return $.type==="click"&&$.buttons===1;return $.detail===0&&!$.pointerType}function KJ($){if(HJ)return!1;return!GJ&&$.width===0&&$.height===0||GJ&&$.width===1&&$.height===1&&$.pressure===0&&$.detail===0&&$.pointerType==="mouse"||$.width<1&&$.height<1&&$.pressure===0&&$.detail===0&&$.pointerType==="touch"}function m8($,Z){let J=["mouse","pen"];if(!Z)J.push("",void 0);return J.includes($)}function YJ($){let Z=$.type;return Z==="click"||Z==="mousedown"||Z==="keydown"||Z==="keyup"}function WJ($,Z,J){return Math.floor($/Z)!==J}function u6($,Z){return Z<0||Z>=$.current.length}function qJ($,Z){return h5($,{disabledIndices:Z})}function _z($,Z){return h5($,{decrement:!0,startingIndex:$.current.length,disabledIndices:Z})}function h5($,{startingIndex:Z=-1,decrement:J=!1,disabledIndices:Q,amount:X=1}={}){let G=Z;do G+=J?-X:X;while(G>=0&&G<=$.current.length-1&&p6($,G,Q));return G}function lV($,{event:Z,orientation:J,loopFocus:Q,rtl:X,cols:G,disabledIndices:H,minIndex:z,maxIndex:K,prevIndex:Y,stopEvent:W=!1}){let q=Y,B=[],U={},F=!1;{let L=null,_=-1;$.current.forEach((w,A)=>{if(w==null)return;let D=w.closest('[role="row"]');if(D)F=!0;if(D!==L||_===-1)L=D,_+=1,B[_]=[];B[_].push(A),U[A]=_})}let V=F&&B.length>0&&B.some((L)=>L.length!==G);function N(L){if(!V||Y===-1)return;let _=U[Y];if(_==null)return;let w=B[_].indexOf(Y),A=L==="up"?_-1:_+1;if(Q){if(A<0)A=B.length-1;else if(A>=B.length)A=0}let D=new Set;while(A>=0&&A<B.length&&!D.has(A)){D.add(A);let M=B[A];if(M.length===0){A=L==="up"?A-1:A+1;continue}let j=Math.min(w,M.length-1);for(let T=j;T>=0;T-=1){let E=M[T];if(!p6($,E,H))return E}if(A=L==="up"?A-1:A+1,Q){if(A<0)A=B.length-1;else if(A>=B.length)A=0}}return}if(Z.key===g3){let L=N("up");if(L!==void 0){if(W)V5(Z);q=L}else{if(W)V5(Z);if(Y===-1)q=K;else if(q=h5($,{startingIndex:q,amount:G,decrement:!0,disabledIndices:H}),Q&&(Y-G<z||q<0)){let _=Y%G,w=K%G,A=K-(w-_);if(w===_)q=K;else q=w>_?A:A-G}if(u6($,q))q=Y}}if(Z.key===A9){let L=N("down");if(L!==void 0){if(W)V5(Z);q=L}else{if(W)V5(Z);if(Y===-1)q=z;else if(q=h5($,{startingIndex:Y,amount:G,disabledIndices:H}),Q&&Y+G>K)q=h5($,{startingIndex:Y%G-G,amount:G,disabledIndices:H});if(u6($,q))q=Y}}if(J==="both"){let L=Nz(Y/G);if(Z.key===(X?S4:R4)){if(W)V5(Z);if(Y%G!==G-1){if(q=h5($,{startingIndex:Y,disabledIndices:H}),Q&&WJ(q,G,L))q=h5($,{startingIndex:Y-Y%G-1,disabledIndices:H})}else if(Q)q=h5($,{startingIndex:Y-Y%G-1,disabledIndices:H});if(WJ(q,G,L))q=Y}if(Z.key===(X?R4:S4)){if(W)V5(Z);if(Y%G!==0){if(q=h5($,{startingIndex:Y,decrement:!0,disabledIndices:H}),Q&&WJ(q,G,L))q=h5($,{startingIndex:Y+(G-Y%G),decrement:!0,disabledIndices:H})}else if(Q)q=h5($,{startingIndex:Y+(G-Y%G),decrement:!0,disabledIndices:H});if(WJ(q,G,L))q=Y}let _=Nz(K/G)===L;if(u6($,q))if(Q&&_)q=Z.key===(X?R4:S4)?K:h5($,{startingIndex:Y-Y%G-1,disabledIndices:H});else q=Y}return q}function iV($,Z,J){let Q=[],X=0;return $.forEach(({width:G,height:H},z)=>{if(G>Z);let K=!1;if(J)X=0;while(!K){let Y=[];for(let W=0;W<G;W+=1)for(let q=0;q<H;q+=1)Y.push(X+W+q*Z);if(X%Z+G<=Z&&Y.every((W)=>Q[W]==null))Y.forEach((W)=>{Q[W]=z}),K=!0;else X+=1}}),[...Q]}function rV($,Z,J,Q,X){if($===-1)return-1;let G=J.indexOf($),H=Z[$];switch(X){case"tl":return G;case"tr":if(!H)return G;return G+H.width-1;case"bl":if(!H)return G;return G+(H.height-1)*Q;case"br":return J.lastIndexOf($);default:return-1}}function aV($,Z){return Z.flatMap((J,Q)=>$.includes(J)?[Q]:[])}function p6($,Z,J){if(typeof J==="function")return J(Z);if(J)return J.includes(Z);let Q=$.current[Z];if(!Q)return!1;return Q.hasAttribute("disabled")||Q.getAttribute("aria-disabled")==="true"}/*!
65
- * tabbable 6.4.0
66
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
67
- */var dy=["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] *)"],BJ=dy.join(","),nV=typeof Element>"u",c6=nV?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,UJ=!nV&&Element.prototype.getRootNode?function($){var Z;return $===null||$===void 0?void 0:(Z=$.getRootNode)===null||Z===void 0?void 0:Z.call($)}:function($){return $===null||$===void 0?void 0:$.ownerDocument},FJ=function(Z,J){var Q;if(J===void 0)J=!0;var X=Z===null||Z===void 0?void 0:(Q=Z.getAttribute)===null||Q===void 0?void 0:Q.call(Z,"inert"),G=X===""||X==="true",H=G||J&&Z&&(typeof Z.closest==="function"?Z.closest("[inert]"):FJ(Z.parentNode));return H},ly=function(Z){var J,Q=Z===null||Z===void 0?void 0:(J=Z.getAttribute)===null||J===void 0?void 0:J.call(Z,"contenteditable");return Q===""||Q==="true"},oV=function(Z,J,Q){if(FJ(Z))return[];var X=Array.prototype.slice.apply(Z.querySelectorAll(BJ));if(J&&c6.call(Z,BJ))X.unshift(Z);return X=X.filter(Q),X},VJ=function(Z,J,Q){var X=[],G=Array.from(Z);while(G.length){var H=G.shift();if(FJ(H,!1))continue;if(H.tagName==="SLOT"){var z=H.assignedElements(),K=z.length?z:H.children,Y=VJ(K,!0,Q);if(Q.flatten)X.push.apply(X,Y);else X.push({scopeParent:H,candidates:Y})}else{var W=c6.call(H,BJ);if(W&&Q.filter(H)&&(J||!Z.includes(H)))X.push(H);var q=H.shadowRoot||typeof Q.getShadowRoot==="function"&&Q.getShadowRoot(H),B=!FJ(q,!1)&&(!Q.shadowRootFilter||Q.shadowRootFilter(H));if(q&&B){var U=VJ(q===!0?H.children:q.children,!0,Q);if(Q.flatten)X.push.apply(X,U);else X.push({scopeParent:H,candidates:U})}else G.unshift.apply(G,H.children)}}return X},tV=function(Z){return!isNaN(parseInt(Z.getAttribute("tabindex"),10))},eV=function(Z){if(!Z)throw Error("No node provided");if(Z.tabIndex<0){if((/^(AUDIO|VIDEO|DETAILS)$/.test(Z.tagName)||ly(Z))&&!tV(Z))return 0}return Z.tabIndex},iy=function(Z,J){var Q=eV(Z);if(Q<0&&J&&!tV(Z))return 0;return Q},ry=function(Z,J){return Z.tabIndex===J.tabIndex?Z.documentOrder-J.documentOrder:Z.tabIndex-J.tabIndex},$L=function(Z){return Z.tagName==="INPUT"},ay=function(Z){return $L(Z)&&Z.type==="hidden"},sy=function(Z){var J=Z.tagName==="DETAILS"&&Array.prototype.slice.apply(Z.children).some(function(Q){return Q.tagName==="SUMMARY"});return J},ny=function(Z,J){for(var Q=0;Q<Z.length;Q++)if(Z[Q].checked&&Z[Q].form===J)return Z[Q]},oy=function(Z){if(!Z.name)return!0;var J=Z.form||UJ(Z),Q=function(z){return J.querySelectorAll('input[type="radio"][name="'+z+'"]')},X;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape==="function")X=Q(window.CSS.escape(Z.name));else try{X=Q(Z.name)}catch(H){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",H.message),!1}var G=ny(X,Z.form);return!G||G===Z},ty=function(Z){return $L(Z)&&Z.type==="radio"},ey=function(Z){return ty(Z)&&!oy(Z)},$x=function(Z){var J,Q=Z&&UJ(Z),X=(J=Q)===null||J===void 0?void 0:J.host,G=!1;if(Q&&Q!==Z){var H,z,K;G=!!((H=X)!==null&&H!==void 0&&(z=H.ownerDocument)!==null&&z!==void 0&&z.contains(X)||Z!==null&&Z!==void 0&&(K=Z.ownerDocument)!==null&&K!==void 0&&K.contains(Z));while(!G&&X){var Y,W,q;Q=UJ(X),X=(Y=Q)===null||Y===void 0?void 0:Y.host,G=!!((W=X)!==null&&W!==void 0&&(q=W.ownerDocument)!==null&&q!==void 0&&q.contains(X))}}return G},sV=function(Z){var J=Z.getBoundingClientRect(),Q=J.width,X=J.height;return Q===0&&X===0},Zx=function(Z,J){var{displayCheck:Q,getShadowRoot:X}=J;if(Q==="full-native"){if("checkVisibility"in Z){var G=Z.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!G}}if(getComputedStyle(Z).visibility==="hidden")return!0;var H=c6.call(Z,"details>summary:first-of-type"),z=H?Z.parentElement:Z;if(c6.call(z,"details:not([open]) *"))return!0;if(!Q||Q==="full"||Q==="full-native"||Q==="legacy-full"){if(typeof X==="function"){var K=Z;while(Z){var Y=Z.parentElement,W=UJ(Z);if(Y&&!Y.shadowRoot&&X(Y)===!0)return sV(Z);else if(Z.assignedSlot)Z=Z.assignedSlot;else if(!Y&&W!==Z.ownerDocument)Z=W.host;else Z=Y}Z=K}if($x(Z))return!Z.getClientRects().length;if(Q!=="legacy-full")return!0}else if(Q==="non-zero-area")return sV(Z);return!1},Jx=function(Z){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(Z.tagName)){var J=Z.parentElement;while(J){if(J.tagName==="FIELDSET"&&J.disabled){for(var Q=0;Q<J.children.length;Q++){var X=J.children.item(Q);if(X.tagName==="LEGEND")return c6.call(J,"fieldset[disabled] *")?!0:!X.contains(Z)}return!0}J=J.parentElement}}return!1},Mz=function(Z,J){if(J.disabled||ay(J)||Zx(J,Z)||sy(J)||Jx(J))return!1;return!0},Az=function(Z,J){if(ey(J)||eV(J)<0||!Mz(Z,J))return!1;return!0},Qx=function(Z){var J=parseInt(Z.getAttribute("tabindex"),10);if(isNaN(J)||J>=0)return!0;return!1},ZL=function(Z){var J=[],Q=[];return Z.forEach(function(X,G){var H=!!X.scopeParent,z=H?X.scopeParent:X,K=iy(z,H),Y=H?ZL(X.candidates):z;if(K===0)H?J.push.apply(J,Y):J.push(z);else Q.push({documentOrder:G,tabIndex:K,item:X,isScope:H,content:Y})}),Q.sort(ry).reduce(function(X,G){return G.isScope?X.push.apply(X,G.content):X.push(G.content),X},[]).concat(J)},P9=function(Z,J){J=J||{};var Q;if(J.getShadowRoot)Q=VJ([Z],J.includeContainer,{filter:Az.bind(null,J),flatten:!1,getShadowRoot:J.getShadowRoot,shadowRootFilter:Qx});else Q=oV(Z,J.includeContainer,Az.bind(null,J));return ZL(Q)},JL=function(Z,J){J=J||{};var Q;if(J.getShadowRoot)Q=VJ([Z],J.includeContainer,{filter:Mz.bind(null,J),flatten:!0,getShadowRoot:J.getShadowRoot});else Q=oV(Z,J.includeContainer,Mz.bind(null,J));return Q},Dz=function(Z,J){if(J=J||{},!Z)throw Error("No node provided");if(c6.call(Z,BJ)===!1)return!1;return Az(J,Z)};var j9=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function QL($,Z){let J=P9($,j9()),Q=J.length;if(Q===0)return;let X=x5(p0($)),G=J.indexOf(X),H=G===-1?Z===1?0:Q-1:G+Z;return J[H]}function S7($){return QL(p0($).body,1)||$}function LJ($){return QL(p0($).body,-1)||$}function XL($,Z){if(!$)return null;let J=P9(p0($).body,j9()),Q=J.length;if(Q===0)return null;let X=J.indexOf($);if(X===-1)return null;let G=(X+Z+Q)%Q;return J[G]}function NJ($){return XL($,1)}function _J($){return XL($,-1)}function X4($,Z){let J=Z||$.currentTarget,Q=$.relatedTarget;return!Q||!S0(J,Q)}function GL($){P9($,j9()).forEach((J)=>{J.dataset.tabindex=J.getAttribute("tabindex")||"",J.setAttribute("tabindex","-1")})}function wz($){$.querySelectorAll("[data-tabindex]").forEach((J)=>{let Q=J.dataset.tabindex;if(delete J.dataset.tabindex,Q)J.setAttribute("tabindex",Q);else J.removeAttribute("tabindex")})}var R7=O(v(),1);var MJ=O(v(),1);var HL=0;function Xx($,Z="mui"){let[J,Q]=MJ.useState($),X=$||J;return MJ.useEffect(()=>{if(J==null)HL+=1,Q(`${Z}-${HL}`)},[J,Z]),X}var zL=LU.useId;function F8($,Z){if(zL!==void 0){let J=zL();return $??(Z?`${Z}-${J}`:J)}return Xx($,Z)}function AJ(){let $=new Map;return{emit(Z,J){$.get(Z)?.forEach((Q)=>Q(J))},on(Z,J){if(!$.has(Z))$.set(Z,new Set);$.get(Z).add(J)},off(Z,J){$.get(Z)?.delete(J)}}}class C9{nodesRef={current:[]};events=AJ();addNode($){this.nodesRef.current.push($)}removeNode($){let Z=this.nodesRef.current.findIndex((J)=>J===$);if(Z!==-1)this.nodesRef.current.splice(Z,1)}}var Oz=O(l(),1),KL=R7.createContext(null),YL=R7.createContext(null),w5=()=>R7.useContext(KL)?.id||null,r5=($)=>{let Z=R7.useContext(YL);return $??Z};function I9($){let Z=F8(),J=r5($),Q=w5();return Q0(()=>{if(!Z)return;let X={id:Z,parentId:Q};return J?.addNode(X),()=>{J?.removeNode(X)}},[J,Z,Q]),Z}function m3($){let{children:Z,id:J}=$,Q=w5();return Oz.jsx(KL.Provider,{value:R7.useMemo(()=>({id:J,parentId:Q}),[J,Q]),children:Z})}function u3($){let{children:Z,externalTree:J}=$,Q=$1(()=>J??new C9).current;return Oz.jsx(YL.Provider,{value:Q,children:Z})}var o={};G4(o,{windowResize:()=>vx,wheel:()=>Ex,triggerPress:()=>Hx,triggerHover:()=>zx,triggerFocus:()=>Kx,trackPress:()=>Vx,swipe:()=>hx,siblingOpen:()=>bx,scrub:()=>Sx,pointer:()=>Tx,outsidePress:()=>Yx,none:()=>Gx,listNavigation:()=>Cx,linkPress:()=>Bx,keyboard:()=>Ix,itemPress:()=>Wx,inputPress:()=>wx,inputPaste:()=>Dx,inputClear:()=>Mx,inputChange:()=>_x,inputBlur:()=>Ax,incrementPress:()=>Lx,imperativeAction:()=>xx,focusOut:()=>Ox,escapeKey:()=>Px,drag:()=>kx,disabled:()=>yx,decrementPress:()=>Nx,closeWatcher:()=>jx,closePress:()=>qx,clearPress:()=>Ux,chipRemovePress:()=>Fx,cancelOpen:()=>Rx});var Gx="none",Hx="trigger-press",zx="trigger-hover",Kx="trigger-focus",Yx="outside-press",Wx="item-press",qx="close-press",Bx="link-press",Ux="clear-press",Fx="chip-remove-press",Vx="track-press",Lx="increment-press",Nx="decrement-press",_x="input-change",Mx="input-clear",Ax="input-blur",Dx="input-paste",wx="input-press",Ox="focus-out",Px="escape-key",jx="close-watcher",Cx="list-navigation",Ix="keyboard",Tx="pointer",kx="drag",Ex="wheel",Sx="scrub",Rx="cancel-open",bx="sibling-open",yx="disabled",xx="imperative-action",hx="swipe",vx="window-resize";function N0($,Z,J,Q){let X=!1,G=!1,H=Q??e0;return{reason:$,event:Z??new Event("base-ui"),cancel(){X=!0},allowPropagation(){G=!0},get isCanceled(){return X},get isPropagationAllowed(){return G},trigger:J,...H}}function C8($){return`data-base-ui-${$}`}var $70=C8("safe-polygon"),Z70=`button,[role="button"],select,[tabindex]:not([tabindex="-1"]),${m6}`;function d6($,Z,J){if(J&&!m8(J))return 0;if(typeof $==="number")return $;if(typeof $==="function"){let Q=$();if(typeof Q==="number")return Q;return Q?.[Z]}return $?.[Z]}var WL=O(l(),1),qL=V8.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new y5,currentIdRef:{current:null},currentContextRef:{current:null}});function Pz($){let{children:Z,delay:J,timeoutMs:Q=0}=$,X=V8.useRef(J),G=V8.useRef(J),H=V8.useRef(null),z=V8.useRef(null),K=J5();return WL.jsx(qL.Provider,{value:V8.useMemo(()=>({hasProvider:!0,delayRef:X,initialDelayRef:G,currentIdRef:H,timeoutMs:Q,currentContextRef:z,timeout:K}),[Q,K]),children:Z})}function jz($,Z={open:!1}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("floatingId"),{open:X}=Z,G=V8.useContext(qL),{currentIdRef:H,delayRef:z,timeoutMs:K,initialDelayRef:Y,currentContextRef:W,hasProvider:q,timeout:B}=G,[U,F]=V8.useState(!1);return Q0(()=>{function V(){F(!1),W.current?.setIsInstantPhase(!1),H.current=null,W.current=null,z.current=Y.current}if(!H.current)return;if(!X&&H.current===Q){if(F(!1),K){let N=Q;return B.start(K,()=>{if(J.select("open")||H.current&&H.current!==N)return;V()}),()=>{B.clear()}}V()}return},[X,Q,H,z,K,Y,W,B,J]),Q0(()=>{if(!X)return;let V=W.current,N=H.current;if(B.clear(),W.current={onOpenChange:J.setOpen,setIsInstantPhase:F},H.current=Q,z.current={open:0,close:d6(Y.current,"close")},N!==null&&N!==Q)F(!0),V?.setIsInstantPhase(!0),V?.onOpenChange(!1,N0(o.none));else F(!1),V?.setIsInstantPhase(!1)},[X,Q,J,H,z,K,Y,W,B]),Q0(()=>{return()=>{W.current=null}},[W]),V8.useMemo(()=>({hasProvider:q,delayRef:z,isInstantPhase:U}),[q,z,U])}var O5=O(v(),1);var BL={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},l6={...BL,position:"fixed",top:0,left:0},UL={...BL,position:"absolute"};var wJ=null,B70=globalThis.requestAnimationFrame;class FL{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=($)=>{this.isScheduled=!1;let Z=this.callbacks,J=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,J>0)for(let Q=0;Q<Z.length;Q+=1)Z[Q]?.($)};request($){let Z=this.nextId;this.nextId+=1,this.callbacks.push($),this.callbacksCount+=1;let J=!1;if(!this.isScheduled||J)requestAnimationFrame(this.tick),this.isScheduled=!0;return Z}cancel($){let Z=$-this.startId;if(Z<0||Z>=this.callbacks.length)return;this.callbacks[Z]=null,this.callbacksCount-=1}}var OJ=new FL;class m1{static create(){return new m1}static request($){return OJ.request($)}static cancel($){return OJ.cancel($)}currentId=wJ;request($){this.cancel(),this.currentId=OJ.request(()=>{this.currentId=wJ,$()})}cancel=()=>{if(this.currentId!==wJ)OJ.cancel(this.currentId),this.currentId=wJ};disposeEffect=()=>{return this.cancel}}function u8(){let $=$1(m1.create).current;return E4($.disposeEffect),$}var PJ=O(v(),1);var VL=O(l(),1),p8=PJ.forwardRef(function(Z,J){let[Q,X]=PJ.useState();return Q0(()=>{if(XJ)X("button")},[]),VL.jsx("span",{...Z,ref:J,style:l6,"aria-hidden":Q?void 0:!0,...{tabIndex:0,role:Q},"data-base-ui-focus-guard":""})});var LL=0;function T9($,Z={}){let{preventScroll:J=!1,cancelPrevious:Q=!0,sync:X=!1}=Z;if(Q)cancelAnimationFrame(LL);let G=()=>$?.focus({preventScroll:J});if(X)G();else LL=requestAnimationFrame(G)}var i6={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function NL($){if($==="inert")return i6.inert;if($==="aria-hidden")return i6["aria-hidden"];return i6.none}var jJ=new WeakSet,CJ={},Cz=0;var _L=($)=>$&&($.host||_L($.parentNode)),gx=($,Z)=>Z.map((J)=>{if($.contains(J))return J;let Q=_L(J);if($.contains(Q))return Q;return null}).filter((J)=>J!=null);function fx($,Z,J,Q){let G=Q?"inert":J?"aria-hidden":null,H=gx(Z,$),z=new Set,K=new Set(H),Y=[];if(!CJ["data-base-ui-inert"])CJ["data-base-ui-inert"]=new WeakMap;let W=CJ["data-base-ui-inert"];H.forEach(q),B(Z),z.clear();function q(U){if(!U||z.has(U))return;if(z.add(U),U.parentNode)q(U.parentNode)}function B(U){if(!U||K.has(U))return;[].forEach.call(U.children,(F)=>{if(IJ(F)==="script")return;if(z.has(F))B(F);else{let V=G?F.getAttribute(G):null,N=V!==null&&V!=="false",L=NL(G),_=(L.get(F)||0)+1,w=(W.get(F)||0)+1;if(L.set(F,_),W.set(F,w),Y.push(F),_===1&&N)jJ.add(F);if(w===1)F.setAttribute("data-base-ui-inert","");if(!N&&G)F.setAttribute(G,G==="inert"?"":"true")}})}return Cz+=1,()=>{if(Y.forEach((U)=>{let F=NL(G),N=(F.get(U)||0)-1,L=(W.get(U)||0)-1;if(F.set(U,N),W.set(U,L),!N){if(!jJ.has(U)&&G)U.removeAttribute(G);jJ.delete(U)}if(!L)U.removeAttribute("data-base-ui-inert")}),Cz-=1,!Cz)i6.inert=new WeakMap,i6["aria-hidden"]=new WeakMap,i6.none=new WeakMap,jJ=new WeakSet,CJ={}}}function ML($,Z=!1,J=!1){let Q=p0($[0]).body;return fx($.concat(Array.from(Q.querySelectorAll("[aria-live]"))),Q,Z,J)}var n1=O(v(),1),Iz=O(I8(),1);var k9=O(l(),1),DL=n1.createContext(null),Tz=()=>n1.useContext(DL),mx=C8("portal");function TJ($={}){let{ref:Z,container:J,componentProps:Q=e0,elementProps:X}=$,G=F8(),z=Tz()?.portalNode,[K,Y]=n1.useState(null),[W,q]=n1.useState(null),B=H0((N)=>{if(N!==null)q(N)}),U=n1.useRef(null);Q0(()=>{if(J===null){if(U.current)U.current=null,q(null),Y(null);return}if(G==null)return;let N=(J&&(AL(J)?J:J.current))??z??document.body;if(N==null){if(U.current)U.current=null,q(null),Y(null);return}if(U.current!==N)U.current=N,q(null),Y(N)},[J,z,G]);let F=W0("div",Q,{ref:[Z,B],props:[{id:G,[mx]:""},X]});return{portalNode:W,portalSubtree:K&&F?Iz.createPortal(F,K):null}}var E9=n1.forwardRef(function(Z,J){let{children:Q,container:X,className:G,render:H,renderGuards:z,...K}=Z,{portalNode:Y,portalSubtree:W}=TJ({container:X,ref:J,componentProps:Z,elementProps:K}),q=n1.useRef(null),B=n1.useRef(null),U=n1.useRef(null),F=n1.useRef(null),[V,N]=n1.useState(null),L=V?.modal,_=V?.open,w=typeof z==="boolean"?z:!!V&&!V.modal&&V.open&&!!Y;n1.useEffect(()=>{if(!Y||L)return;function D(M){if(Y&&M.relatedTarget&&X4(M))(M.type==="focusin"?wz:GL)(Y)}return Y.addEventListener("focusin",D,!0),Y.addEventListener("focusout",D,!0),()=>{Y.removeEventListener("focusin",D,!0),Y.removeEventListener("focusout",D,!0)}},[Y,L]),n1.useEffect(()=>{if(!Y||_)return;wz(Y)},[_,Y]);let A=n1.useMemo(()=>({beforeOutsideRef:q,afterOutsideRef:B,beforeInsideRef:U,afterInsideRef:F,portalNode:Y,setFocusManagerState:N}),[Y]);return k9.jsxs(n1.Fragment,{children:[W,k9.jsxs(DL.Provider,{value:A,children:[w&&Y&&k9.jsx(p8,{"data-type":"outside",ref:q,onFocus:(D)=>{if(X4(D,Y))U.current?.focus();else{let M=V?V.domReference:null;LJ(M)?.focus()}}}),w&&Y&&k9.jsx("span",{"aria-owns":Y.id,style:bU}),Y&&Iz.createPortal(Q,Y),w&&Y&&k9.jsx(p8,{"data-type":"outside",ref:B,onFocus:(D)=>{if(X4(D,Y))F.current?.focus();else{let M=V?V.domReference:null;if(S7(M)?.focus(),V?.closeOnFocusOut)V?.onOpenChange(!1,N0(o.focusOut,D.nativeEvent))}}})]})]})});function H4($){if($==null)return $;return"current"in $?$.current:$}var p3=O(l(),1);function ux($,Z){let J=j8($.target);if($ instanceof J.KeyboardEvent)return"keyboard";if($ instanceof J.FocusEvent)return Z||"keyboard";if("pointerType"in $)return $.pointerType||"keyboard";if("touches"in $)return"touch";if($ instanceof J.MouseEvent)return Z||($.detail===0?"keyboard":"mouse");return""}var wL=20,b7=[];function Ez(){b7=b7.filter(($)=>{return $.deref()?.isConnected})}function px($){if(Ez(),$&&IJ($)!=="body"){if(b7.push(new WeakRef($)),b7.length>wL)b7=b7.slice(-wL)}}function kz(){return Ez(),b7[b7.length-1]?.deref()}function cx($){if(!$)return null;let Z=j9();if(Dz($,Z))return $;return P9($,Z)[0]||$}function dx($){if(!$||!$.isConnected)return!1;if(typeof $.checkVisibility==="function")return $.checkVisibility();return r6($).display!=="none"}function OL($,Z){if(!Z.current.includes("floating")&&!$.getAttribute("role")?.includes("dialog"))return;let J=j9(),X=JL($,J).filter((H)=>{let z=H.getAttribute("data-tabindex")||"";return Dz(H,J)||H.hasAttribute("data-tabindex")&&!z.startsWith("-")}),G=$.getAttribute("tabindex");if(Z.current.includes("floating")||X.length===0){if(G!=="0")$.setAttribute("tabindex","0")}else if(G!=="-1"||$.hasAttribute("data-tabindex")&&$.getAttribute("data-tabindex")!=="-1")$.setAttribute("tabindex","-1"),$.setAttribute("data-tabindex","-1")}function S9($){let{context:Z,children:J,disabled:Q=!1,initialFocus:X=!0,returnFocus:G=!0,restoreFocus:H=!1,modal:z=!0,closeOnFocusOut:K=!0,openInteractionType:Y="",nextFocusableElement:W,previousFocusableElement:q,beforeContentFocusGuardRef:B,externalTree:U}=$,F="rootStore"in Z?Z.rootStore:Z,V=F.useState("open"),N=F.useState("domReferenceElement"),L=F.useState("floatingElement"),{events:_,dataRef:w}=F.context,A=H0(()=>w.current.floatingContext?.nodeId),D=X===!1,M=f3(N)&&D,j=O5.useRef(["content"]),T=D5(X),E=D5(G),C=D5(Y),g=r5(U),b=Tz(),k=O5.useRef(null),x=O5.useRef(null),R=O5.useRef(!1),I=O5.useRef(!1),S=O5.useRef(!1),h=O5.useRef(-1),p=O5.useRef(""),P=O5.useRef(""),t=O5.useRef(null),z0=O5.useRef(null),y=U8(t,B,b?.beforeInsideRef),n=U8(z0,b?.afterInsideRef),_0=J5(),c=J5(),X0=u8(),K0=b!=null,Z0=O9(L),G0=H0((s=Z0)=>{return s?P9(s,j9()):[]}),U0=H0((s)=>{let u=G0(s);return j.current.map(()=>u).filter(Boolean).flat()});O5.useEffect(()=>{if(Q||!z)return;function s(F0){if(F0.key==="Tab"){if(S0(Z0,x5(p0(Z0)))&&G0().length===0&&!M)V5(F0)}}let u=p0(Z0);return u.addEventListener("keydown",s),()=>{u.removeEventListener("keydown",s)}},[Q,N,Z0,z,j,M,G0,U0]),O5.useEffect(()=>{if(Q||!V)return;let s=p0(Z0);function u(){S.current=!1}function F0(Y0){let r=y1(Y0),e=S0(L,r)||S0(N,r)||S0(b?.portalNode,r);if(S.current=!e,P.current=Y0.pointerType||"keyboard",r?.closest(`[${b6}]`))I.current=!0}function i(){P.current="keyboard"}return s.addEventListener("pointerdown",F0,!0),s.addEventListener("pointerup",u,!0),s.addEventListener("pointercancel",u,!0),s.addEventListener("keydown",i,!0),()=>{s.removeEventListener("pointerdown",F0,!0),s.removeEventListener("pointerup",u,!0),s.removeEventListener("pointercancel",u,!0),s.removeEventListener("keydown",i,!0)}},[Q,L,N,Z0,V,b]),O5.useEffect(()=>{if(Q||!K)return;let s=p0(Z0);function u(){I.current=!0,c.start(0,()=>{I.current=!1})}function F0(q0){let a=y1(q0),I0=G0().indexOf(a);if(I0!==-1)h.current=I0}function i(q0){let{relatedTarget:a,currentTarget:A0}=q0,I0=y1(q0);queueMicrotask(()=>{let i0=A(),z1=F.context.triggerElements,f=a?.hasAttribute(C8("focus-guard"))&&[t.current,z0.current,b?.beforeInsideRef.current,b?.afterInsideRef.current,b?.beforeOutsideRef.current,b?.afterOutsideRef.current,H4(q),H4(W)].includes(a),d=!(S0(N,a)||S0(L,a)||S0(a,L)||S0(b?.portalNode,a)||a!=null&&z1.hasElement(a)||z1.hasMatchingElement(($0)=>S0($0,a))||f||g&&(b4(g.nodesRef.current,i0).find(($0)=>S0($0.context?.elements.floating,a)||S0($0.context?.elements.domReference,a))||Lz(g.nodesRef.current,i0).find(($0)=>[$0.context?.elements.floating,O9($0.context?.elements.floating)].includes(a)||$0.context?.elements.domReference===a)));if(A0===N&&Z0)OL(Z0,j);if(H&&A0!==N&&!dx(I0)&&x5(s)===s.body){if(b1(Z0)){if(Z0.focus(),H==="popup"){X0.request(()=>{Z0.focus()});return}}let $0=h.current,V0=G0(),j0=V0[$0]||V0[V0.length-1]||Z0;if(b1(j0))j0.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}if((M?!0:!z)&&a&&d&&!I.current&&(M||a!==kz()))R.current=!0,F.setOpen(!1,N0(o.focusOut,q0))})}function Y0(){if(S.current)return;w.current.insideReactTree=!0,_0.start(0,()=>{w.current.insideReactTree=!1})}let r=b1(N)?N:null,e=[];if(!L&&!r)return;if(r)r.addEventListener("focusout",i),r.addEventListener("pointerdown",u),e.push(()=>{r.removeEventListener("focusout",i),r.removeEventListener("pointerdown",u)});if(L){if(L.addEventListener("focusin",F0),L.addEventListener("focusout",i),b)L.addEventListener("focusout",Y0,!0),e.push(()=>{L.removeEventListener("focusout",Y0,!0)});e.push(()=>{L.removeEventListener("focusin",F0),L.removeEventListener("focusout",i)})}return()=>{e.forEach((q0)=>{q0()})}},[Q,N,L,Z0,z,g,b,F,K,H,G0,M,A,j,w,_0,c,X0,W,q]),O5.useEffect(()=>{if(Q||!L||!V)return;let s=Array.from(b?.portalNode?.querySelectorAll(`[${C8("portal")}]`)||[]),F0=(g?Lz(g.nodesRef.current,A()):[]).find((Y0)=>f3(Y0.context?.elements.domReference||null))?.context?.elements.domReference,i=[L,F0,...s,k.current,x.current,t.current,z0.current,b?.beforeOutsideRef.current,b?.afterOutsideRef.current,H4(q),H4(W),M?N:null].filter((Y0)=>Y0!=null);return ML(i,z||M)},[V,Q,N,L,z,j,b,M,g,A,W,q]),Q0(()=>{if(!V||Q||!b1(Z0))return;let s=p0(Z0),u=x5(s);queueMicrotask(()=>{let F0=U0(Z0),i=T.current,Y0=typeof i==="function"?i(C.current||""):i;if(Y0===void 0||Y0===!1)return;let r;if(Y0===!0||Y0===null)r=F0[0]||Z0;else r=H4(Y0);if(r=r||F0[0]||Z0,S0(Z0,u))return;T9(r,{preventScroll:r===Z0})})},[Q,V,Z0,D,U0,T,C]),Q0(()=>{if(Q||!Z0)return;let s=p0(Z0),u=x5(s);px(u);function F0(r){if(!r.open)p.current=ux(r.nativeEvent,P.current);if(r.reason===o.triggerHover&&r.nativeEvent.type==="mouseleave")R.current=!0;if(r.reason!==o.outsidePress)return;if(r.nested)R.current=!1;else if(zJ(r.nativeEvent)||KJ(r.nativeEvent))R.current=!1;else{let e=!1;if(document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),e)R.current=!1;else R.current=!0}}_.on("openchange",F0);let i=s.createElement("span");if(i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true"),Object.assign(i.style,l6),K0&&N)N.insertAdjacentElement("afterend",i);function Y0(){let r=E.current,e=typeof r==="function"?r(p.current):r;if(e===void 0||e===!1)return null;if(e===null)e=!0;if(typeof e==="boolean"){let a=N||kz();return a&&a.isConnected?a:i}let q0=N||kz()||i;return H4(e)||q0}return()=>{_.off("openchange",F0);let r=x5(s),e=S0(L,r)||g&&b4(g.nodesRef.current,A(),!1).some((a)=>S0(a.context?.elements.floating,r)),q0=Y0();queueMicrotask(()=>{let a=cx(q0),A0=typeof E.current!=="boolean";if(E.current&&!R.current&&b1(a)&&(!A0&&a!==r&&r!==s.body?e:!0))a.focus({preventScroll:!0});i.remove(),R.current=!1})}},[Q,L,Z0,E,w,_,g,K0,N,A]),Q0(()=>{if(!JJ||V||!L)return;let s=x5(p0(L));if(!b1(s)||!w9(s))return;if(S0(L,s))s.blur()},[V,L]),Q0(()=>{if(Q||!b)return;return b.setFocusManagerState({modal:z,closeOnFocusOut:K,open:V,onOpenChange:F.setOpen,domReference:N}),()=>{b.setFocusManagerState(null)}},[Q,b,z,V,F,K,N]),Q0(()=>{if(Q||!Z0)return;return OL(Z0,j),()=>{queueMicrotask(Ez)}},[Q,Z0,j]);let m=!Q&&(z?!M:!0)&&(K0||z);return p3.jsxs(O5.Fragment,{children:[m&&p3.jsx(p8,{"data-type":"inside",ref:y,onFocus:(s)=>{if(z){let u=U0();T9(u[u.length-1])}else if(b?.portalNode)if(R.current=!1,X4(s,b.portalNode))S7(N)?.focus();else H4(q??b.beforeOutsideRef)?.focus()}}),J,m&&p3.jsx(p8,{"data-type":"inside",ref:n,onFocus:(s)=>{if(z)T9(U0()[0]);else if(b?.portalNode){if(K)R.current=!0;if(X4(s,b.portalNode))LJ(N)?.focus();else H4(W??b.afterOutsideRef)?.focus()}}})]})}var c3=O(v(),1);function H7($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.context.dataRef,{enabled:X=!0,event:G="click",toggle:H=!0,ignoreMouse:z=!1,stickIfOpen:K=!0,touchOpenDelay:Y=0,reason:W=o.triggerPress}=Z,q=c3.useRef(void 0),B=u8(),U=J5(),F=c3.useMemo(()=>({onPointerDown(V){q.current=V.pointerType},onMouseDown(V){let N=q.current,L=V.nativeEvent,_=J.select("open");if(V.button!==0||G==="click"||m8(N,!0)&&z)return;let w=Q.current.openEvent,A=w?.type,D=J.select("domReferenceElement")!==V.currentTarget,M=_&&D||!(_&&H&&(w&&K?A==="click"||A==="mousedown":!0));if(w9(L.target)){let T=N0(W,L,L.target);if(M&&N==="touch"&&Y>0)U.start(Y,()=>{J.setOpen(!0,T)});else J.setOpen(M,T);return}let j=V.currentTarget;B.request(()=>{let T=N0(W,L,j);if(M&&N==="touch"&&Y>0)U.start(Y,()=>{J.setOpen(!0,T)});else J.setOpen(M,T)})},onClick(V){if(G==="mousedown-only")return;let N=q.current;if(G==="mousedown"&&N){q.current=void 0;return}if(m8(N,!0)&&z)return;let L=J.select("open"),_=Q.current.openEvent,w=J.select("domReferenceElement")!==V.currentTarget,A=L&&w||!(L&&H&&(_&&K?YJ(_):!0)),D=N0(W,V.nativeEvent,V.currentTarget);if(A&&N==="touch"&&Y>0)U.start(Y,()=>{J.setOpen(!0,D)});else J.setOpen(A,D)},onKeyDown(){q.current=void 0}}),[Q,G,z,J,K,H,B,U,Y,W]);return c3.useMemo(()=>X?{reference:F}:e0,[X,F])}var H8=O(v(),1);function lx($,Z){let J=null,Q=null,X=!1;return{contextElement:$||void 0,getBoundingClientRect(){let G=$?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},H=Z.axis==="x"||Z.axis==="both",z=Z.axis==="y"||Z.axis==="both",K=["mouseenter","mousemove"].includes(Z.dataRef.current.openEvent?.type||"")&&Z.pointerType!=="touch",Y=G.width,W=G.height,q=G.x,B=G.y;if(J==null&&Z.x&&H)J=G.x-Z.x;if(Q==null&&Z.y&&z)Q=G.y-Z.y;if(q-=J||0,B-=Q||0,Y=0,W=0,!X||K)Y=Z.axis==="y"?G.width:0,W=Z.axis==="x"?G.height:0,q=H&&Z.x!=null?Z.x:q,B=z&&Z.y!=null?Z.y:B;else if(X&&!K)W=Z.axis==="x"?G.height:W,Y=Z.axis==="y"?G.width:Y;return X=!0,{width:Y,height:W,x:q,y:B,top:B,right:q+Y,bottom:B+W,left:q}}}}function PL($){return $!=null&&$.clientX!=null}function Sz($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingElement"),G=J.useState("domReferenceElement"),H=J.context.dataRef,{enabled:z=!0,axis:K="both"}=Z,Y=H8.useRef(!1),W=H8.useRef(null),[q,B]=H8.useState(),[U,F]=H8.useState([]),V=H0((A,D,M)=>{if(Y.current)return;if(H.current.openEvent&&!PL(H.current.openEvent))return;J.set("positionReference",lx(M??G,{x:A,y:D,axis:K,dataRef:H,pointerType:q}))}),N=H0((A)=>{if(!Q)V(A.clientX,A.clientY,A.currentTarget);else if(!W.current)F([])}),L=m8(q)?X:Q,_=H8.useCallback(()=>{if(!L||!z)return;let A=j8(X);function D(M){let j=y1(M);if(!S0(X,j))V(M.clientX,M.clientY);else A.removeEventListener("mousemove",D),W.current=null}if(!H.current.openEvent||PL(H.current.openEvent)){A.addEventListener("mousemove",D);let M=()=>{A.removeEventListener("mousemove",D),W.current=null};return W.current=M,M}J.set("positionReference",G);return},[L,z,X,H,G,J,V]);H8.useEffect(()=>{return _()},[_,U]),H8.useEffect(()=>{if(z&&!X)Y.current=!1},[z,X]),H8.useEffect(()=>{if(!z&&Q)Y.current=!0},[z,Q]);let w=H8.useMemo(()=>{function A(D){B(D.pointerType)}return{onPointerDown:A,onPointerEnter:A,onMouseMove:N,onMouseEnter:N}},[N]);return H8.useMemo(()=>z?{reference:w,trigger:w}:{},[z,w])}var c8=O(v(),1);var ix={intentional:"onClick",sloppy:"onPointerDown"};function rx($){return{escapeKey:typeof $==="boolean"?$:$?.escapeKey??!1,outsidePress:typeof $==="boolean"?$:$?.outsidePress??!0}}function z4($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingElement"),G=J.useState("referenceElement"),H=J.useState("domReferenceElement"),{onOpenChange:z,dataRef:K}=J.context,{enabled:Y=!0,escapeKey:W=!0,outsidePress:q=!0,outsidePressEvent:B="sloppy",referencePress:U=!1,referencePressEvent:F="sloppy",ancestorScroll:V=!1,bubbles:N,externalTree:L}=Z,_=r5(L),w=H0(typeof q==="function"?q:()=>!1),A=typeof q==="function"?w:q,D=c8.useRef(!1),{escapeKey:M,outsidePress:j}=rx(N),T=c8.useRef(null),E=J5(),C=J5(),g=H0(()=>{C.clear(),K.current.insideReactTree=!1}),b=c8.useRef(!1),k=c8.useRef(""),x=H0((m)=>{k.current=m.pointerType}),R=H0(()=>{let m=k.current,s=m==="pen"||!m?"mouse":m,u=typeof B==="function"?B():B;if(typeof u==="string")return u;return u[s]}),I=H0((m)=>{if(!Q||!Y||!W||m.key!=="Escape")return;if(b.current)return;let s=K.current.floatingContext?.nodeId,u=_?b4(_.nodesRef.current,s):[];if(!M){if(u.length>0){let Y0=!0;if(u.forEach((r)=>{if(r.context?.open&&!r.context.dataRef.current.__escapeKeyBubbles)Y0=!1}),!Y0)return}}let F0=dV(m)?m.nativeEvent:m,i=N0(o.escapeKey,F0);if(J.setOpen(!1,i),!M&&!i.isPropagationAllowed)m.stopPropagation()}),S=H0((m)=>{let s=R();return s==="intentional"&&m.type!=="click"||s==="sloppy"&&m.type==="click"}),h=H0(()=>{K.current.insideReactTree=!0,C.start(0,g)}),p=H0((m,s=!1)=>{if(S(m)){g();return}if(K.current.insideReactTree){g();return}if(R()==="intentional"&&s)return;if(typeof A==="function"&&!A(m))return;let u=y1(m),F0=`[${C8("inert")}]`,i=p0(J.select("floatingElement")).querySelectorAll(F0),Y0=J.context.triggerElements;if(u&&(Y0.hasElement(u)||Y0.hasMatchingElement((A0)=>S0(A0,u))))return;let r=L1(u)?u:null;while(r&&!a6(r)){let A0=kJ(r);if(a6(A0)||!L1(A0))break;r=A0}if(i.length&&L1(u)&&!pV(u)&&!S0(u,J.select("floatingElement"))&&Array.from(i).every((A0)=>!S0(r,A0)))return;if(b1(u)&&!("touches"in m)){let A0=a6(u),I0=r6(u),i0=/auto|scroll/,z1=A0||i0.test(I0.overflowX),f=A0||i0.test(I0.overflowY),d=z1&&u.clientWidth>0&&u.scrollWidth>u.clientWidth,$0=f&&u.clientHeight>0&&u.scrollHeight>u.clientHeight,V0=I0.direction==="rtl",j0=$0&&(V0?m.offsetX<=u.offsetWidth-u.clientWidth:m.offsetX>u.clientWidth),g0=d&&m.offsetY>u.clientHeight;if(j0||g0)return}let e=K.current.floatingContext?.nodeId,q0=_&&b4(_.nodesRef.current,e).some((A0)=>f8(m,A0.context?.elements.floating));if(f8(m,J.select("floatingElement"))||f8(m,J.select("domReferenceElement"))||q0)return;let a=_?b4(_.nodesRef.current,e):[];if(a.length>0){let A0=!0;if(a.forEach((I0)=>{if(I0.context?.open&&!I0.context.dataRef.current.__outsidePressBubbles)A0=!1}),!A0)return}J.setOpen(!1,N0(o.outsidePress,m)),g()}),P=H0((m)=>{if(R()!=="sloppy"||m.pointerType==="touch"||!J.select("open")||!Y||f8(m,J.select("floatingElement"))||f8(m,J.select("domReferenceElement")))return;p(m)}),t=H0((m)=>{if(R()!=="sloppy"||!J.select("open")||!Y||f8(m,J.select("floatingElement"))||f8(m,J.select("domReferenceElement")))return;let s=m.touches[0];if(s)T.current={startTime:Date.now(),startX:s.clientX,startY:s.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1000,()=>{if(T.current)T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1})}),z0=H0((m)=>{let s=y1(m);function u(){t(m),s?.removeEventListener(m.type,u)}s?.addEventListener(m.type,u)}),y=H0((m)=>{let s=D.current;if(D.current=!1,E.clear(),m.type==="mousedown"&&T.current&&!T.current.dismissOnMouseDown)return;let u=y1(m);function F0(){if(m.type==="pointerdown")P(m);else p(m,s);u?.removeEventListener(m.type,F0)}u?.addEventListener(m.type,F0)}),n=H0((m)=>{if(R()!=="sloppy"||!T.current||f8(m,J.select("floatingElement"))||f8(m,J.select("domReferenceElement")))return;let s=m.touches[0];if(!s)return;let u=Math.abs(s.clientX-T.current.startX),F0=Math.abs(s.clientY-T.current.startY),i=Math.sqrt(u*u+F0*F0);if(i>5)T.current.dismissOnTouchEnd=!0;if(i>10)p(m),E.clear(),T.current=null}),_0=H0((m)=>{let s=y1(m);function u(){n(m),s?.removeEventListener(m.type,u)}s?.addEventListener(m.type,u)}),c=H0((m)=>{if(R()!=="sloppy"||!T.current||f8(m,J.select("floatingElement"))||f8(m,J.select("domReferenceElement")))return;if(T.current.dismissOnTouchEnd)p(m);E.clear(),T.current=null}),X0=H0((m)=>{let s=y1(m);function u(){c(m),s?.removeEventListener(m.type,u)}s?.addEventListener(m.type,u)});c8.useEffect(()=>{if(!Q||!Y)return;K.current.__escapeKeyBubbles=M,K.current.__outsidePressBubbles=j;let m=new y5;function s(r){J.setOpen(!1,N0(o.none,r))}function u(){m.clear(),b.current=!0}function F0(){m.start(jL()?5:0,()=>{b.current=!1})}let i=p0(X);if(i.addEventListener("pointerdown",x,!0),W)i.addEventListener("keydown",I),i.addEventListener("compositionstart",u),i.addEventListener("compositionend",F0);if(A)i.addEventListener("click",y,!0),i.addEventListener("pointerdown",y,!0),i.addEventListener("touchstart",z0,!0),i.addEventListener("touchmove",_0,!0),i.addEventListener("touchend",X0,!0),i.addEventListener("mousedown",y,!0);let Y0=[];if(V){if(L1(H))Y0=d3(H);if(L1(X))Y0=Y0.concat(d3(X));if(!L1(G)&&G&&G.contextElement)Y0=Y0.concat(d3(G.contextElement))}return Y0=Y0.filter((r)=>r!==i.defaultView?.visualViewport),Y0.forEach((r)=>{r.addEventListener("scroll",s,{passive:!0})}),()=>{if(i.removeEventListener("pointerdown",x,!0),W)i.removeEventListener("keydown",I),i.removeEventListener("compositionstart",u),i.removeEventListener("compositionend",F0);if(A)i.removeEventListener("click",y,!0),i.removeEventListener("pointerdown",y,!0),i.removeEventListener("touchstart",z0,!0),i.removeEventListener("touchmove",_0,!0),i.removeEventListener("touchend",X0,!0),i.removeEventListener("mousedown",y,!0);Y0.forEach((r)=>{r.removeEventListener("scroll",s)}),m.clear(),D.current=!1}},[K,X,G,H,W,A,Q,z,V,Y,M,j,I,p,y,P,z0,_0,X0,x,J]),c8.useEffect(g,[A,g]);let K0=c8.useMemo(()=>({onKeyDown:I,...U&&{[ix[F]]:(m)=>{J.setOpen(!1,N0(o.triggerPress,m.nativeEvent))},...F!=="intentional"&&{onClick(m){J.setOpen(!1,N0(o.triggerPress,m.nativeEvent))}}}}),[I,J,U,F]),Z0=H0((m)=>{let s=y1(m.nativeEvent);if(!S0(J.select("floatingElement"),s)||m.button!==0)return;D.current=!0}),G0=H0((m)=>{if(!Q||!Y||m.button!==0)return;D.current=!0}),U0=c8.useMemo(()=>({onKeyDown:I,onPointerDown:Z0,onMouseDown:Z0,onMouseUp:Z0,onClickCapture:h,onMouseDownCapture(m){h(),G0(m)},onPointerDownCapture(m){h(),G0(m)},onMouseUpCapture:h,onTouchEndCapture:h,onTouchMoveCapture:h}),[I,Z0,h,G0]);return c8.useMemo(()=>Y?{reference:K0,floating:U0,trigger:K0}:{},[Y,K0,U0])}var K8=O(v(),1);var SJ=Symbol("NOT_FOUND");function ax($,Z=`expected a function, instead received ${typeof $}`){if(typeof $!=="function")throw TypeError(Z)}function sx($,Z=`expected an object, instead received ${typeof $}`){if(typeof $!=="object")throw TypeError(Z)}function nx($,Z="expected all items to be functions, instead received the following types: "){if(!$.every((J)=>typeof J==="function")){let J=$.map((Q)=>typeof Q==="function"?`function ${Q.name||"unnamed"}()`:typeof Q).join(", ");throw TypeError(`${Z}[${J}]`)}}var CL=($)=>{return Array.isArray($)?$:[$]};function ox($){let Z=Array.isArray($[0])?$[0]:$;return nx(Z,"createSelector expects all input-selectors to be functions, but received the following types: "),Z}function tx($,Z){let J=[],{length:Q}=$;for(let X=0;X<Q;X++)J.push($[X].apply(null,Z));return J}var IL=0,ex=null,kL=class{revision=IL;_value;_lastValue;_isEqual=Rz;constructor($,Z=Rz){this._value=this._lastValue=$,this._isEqual=Z}get value(){return ex?.add(this),this._value}set value($){if(this.value===$)return;this._value=$,this.revision=++IL}};function Rz($,Z){return $===Z}function bz($){if(!($ instanceof kL))console.warn("Not a valid cell! ",$);return $.value}function $h($,Z=Rz){return new kL($,Z)}var Zh=($,Z)=>!1;function RJ(){return $h(null,Zh)}var EL=($)=>{let Z=$.collectionTag;if(Z===null)Z=$.collectionTag=RJ();bz(Z)};var C90=Symbol(),SL=0,Jh=Object.getPrototypeOf({}),Qh=class{constructor($){this.value=$,this.value=$,this.tag.value=$}proxy=new Proxy(this,l3);tag=RJ();tags={};children={};collectionTag=null;id=SL++},l3={get($,Z){function J(){let{value:X}=$,G=Reflect.get(X,Z);if(typeof Z==="symbol")return G;if(Z in Jh)return G;if(typeof G==="object"&&G!==null){let H=$.children[Z];if(H===void 0)H=$.children[Z]=Hh(G);if(H.tag)bz(H.tag);return H.proxy}else{let H=$.tags[Z];if(H===void 0)H=$.tags[Z]=RJ(),H.value=G;return bz(H),G}}return J()},ownKeys($){return EL($),Reflect.ownKeys($.value)},getOwnPropertyDescriptor($,Z){return Reflect.getOwnPropertyDescriptor($.value,Z)},has($,Z){return Reflect.has($.value,Z)}},Xh=class{constructor($){this.value=$,this.value=$,this.tag.value=$}proxy=new Proxy([this],Gh);tag=RJ();tags={};children={};collectionTag=null;id=SL++},Gh={get([$],Z){if(Z==="length")EL($);return l3.get($,Z)},ownKeys([$]){return l3.ownKeys($)},getOwnPropertyDescriptor([$],Z){return l3.getOwnPropertyDescriptor($,Z)},has([$],Z){return l3.has($,Z)}};function Hh($){if(Array.isArray($))return new Xh($);return new Qh($)}function zh($){let Z;return{get(J){if(Z&&$(Z.key,J))return Z.value;return SJ},put(J,Q){Z={key:J,value:Q}},getEntries(){return Z?[Z]:[]},clear(){Z=void 0}}}function Kh($,Z){let J=[];function Q(z){let K=J.findIndex((Y)=>Z(z,Y.key));if(K>-1){let Y=J[K];if(K>0)J.splice(K,1),J.unshift(Y);return Y.value}return SJ}function X(z,K){if(Q(z)===SJ){if(J.unshift({key:z,value:K}),J.length>$)J.pop()}}function G(){return J}function H(){J=[]}return{get:Q,put:X,getEntries:G,clear:H}}var Yh=($,Z)=>$===Z;function Wh($){return function(J,Q){if(J===null||Q===null||J.length!==Q.length)return!1;let{length:X}=J;for(let G=0;G<X;G++)if(!$(J[G],Q[G]))return!1;return!0}}function RL($,Z){let J=typeof Z==="object"?Z:{equalityCheck:Z},{equalityCheck:Q=Yh,maxSize:X=1,resultEqualityCheck:G}=J,H=Wh(Q),z=0,K=X<=1?zh(H):Kh(X,H);function Y(){let W=K.get(arguments);if(W===SJ){if(W=$.apply(null,arguments),z++,G){let B=K.getEntries().find((U)=>G(U.value,W));if(B)W=B.value,z!==0&&z--}K.put(arguments,W)}return W}return Y.clearCache=()=>{K.clear(),Y.resetResultsCount()},Y.resultsCount=()=>z,Y.resetResultsCount=()=>{z=0},Y}var qh=class{constructor($){this.value=$}deref(){return this.value}},Bh=typeof WeakRef<"u"?WeakRef:qh,Uh=0,TL=1;function EJ(){return{s:Uh,v:void 0,o:null,p:null}}function bL($,Z={}){let J=EJ(),{resultEqualityCheck:Q}=Z,X,G=0;function H(){let z=J,{length:K}=arguments;for(let q=0,B=K;q<B;q++){let U=arguments[q];if(typeof U==="function"||typeof U==="object"&&U!==null){let F=z.o;if(F===null)z.o=F=new WeakMap;let V=F.get(U);if(V===void 0)z=EJ(),F.set(U,z);else z=V}else{let F=z.p;if(F===null)z.p=F=new Map;let V=F.get(U);if(V===void 0)z=EJ(),F.set(U,z);else z=V}}let Y=z,W;if(z.s===TL)W=z.v;else if(W=$.apply(null,arguments),G++,Q){let q=X?.deref?.()??X;if(q!=null&&Q(q,W))W=q,G!==0&&G--;X=typeof W==="object"&&W!==null||typeof W==="function"?new Bh(W):W}return Y.s=TL,Y.v=W,W}return H.clearCache=()=>{J=EJ(),H.resetResultsCount()},H.resultsCount=()=>G,H.resetResultsCount=()=>{G=0},H}function yz($,...Z){let J=typeof $==="function"?{memoize:$,memoizeOptions:Z}:$,Q=(...X)=>{let G=0,H=0,z,K={},Y=X.pop();if(typeof Y==="object")K=Y,Y=X.pop();ax(Y,`createSelector expects an output function after the inputs, but received: [${typeof Y}]`);let W={...J,...K},{memoize:q,memoizeOptions:B=[],argsMemoize:U=bL,argsMemoizeOptions:F=[],devModeChecks:V={}}=W,N=CL(B),L=CL(F),_=ox(X),w=q(function(){return G++,Y.apply(null,arguments)},...N),A=!0,D=U(function(){H++;let j=tx(_,arguments);return z=w.apply(null,j),z},...L);return Object.assign(D,{resultFunc:Y,memoizedResultFunc:w,dependencies:_,dependencyRecomputations:()=>H,resetDependencyRecomputations:()=>{H=0},lastResult:()=>z,recomputations:()=>G,resetRecomputations:()=>{G=0},memoize:q,argsMemoize:U})};return Object.assign(Q,{withTypes:()=>Q}),Q}var Fh=yz(bL),Vh=Object.assign(($,Z=Fh)=>{sx($,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof $}`);let J=Object.keys($),Q=J.map((G)=>$[G]);return Z(Q,(...G)=>{return G.reduce((H,z,K)=>{return H[J[K]]=z,H},{})})},{withTypes:()=>Vh});var y90=yz({memoize:RL,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),w0=($,Z,J,Q,X,G,...H)=>{if(H.length>0)throw Error(M0(1));let z;if($&&Z&&J&&Q&&X&&G)z=(K,Y,W,q)=>{let B=$(K,Y,W,q),U=Z(K,Y,W,q),F=J(K,Y,W,q),V=Q(K,Y,W,q),N=X(K,Y,W,q);return G(B,U,F,V,N,Y,W,q)};else if($&&Z&&J&&Q&&X)z=(K,Y,W,q)=>{let B=$(K,Y,W,q),U=Z(K,Y,W,q),F=J(K,Y,W,q),V=Q(K,Y,W,q);return X(B,U,F,V,Y,W,q)};else if($&&Z&&J&&Q)z=(K,Y,W,q)=>{let B=$(K,Y,W,q),U=Z(K,Y,W,q),F=J(K,Y,W,q);return Q(B,U,F,Y,W,q)};else if($&&Z&&J)z=(K,Y,W,q)=>{let B=$(K,Y,W,q),U=Z(K,Y,W,q);return J(B,U,Y,W,q)};else if($&&Z)z=(K,Y,W,q)=>{let B=$(K,Y,W,q);return Z(B,Y,W,q)};else if($)z=$;else throw Error("Missing arguments");return z};var vL=O(v(),1),gz=O(xZ(),1);var y7=O(v(),1),Lh=xZ();function Nh($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var _h=typeof Object.is==="function"?Object.is:Nh,Mh=Lh.useSyncExternalStore,Ah=y7.useRef,Dh=y7.useEffect,wh=y7.useMemo,Oh=y7.useDebugValue;var xz=function($,Z,J,Q,X){var G=Ah(null);if(G.current===null){var H={hasValue:!1,value:null};G.current=H}else H=G.current;G=wh(function(){function K(U){if(!Y){if(Y=!0,W=U,U=Q(U),X!==void 0&&H.hasValue){var F=H.value;if(X(F,U))return q=F}return q=U}if(F=q,_h(W,U))return F;var V=Q(U);if(X!==void 0&&X(F,V))return W=U,F;return W=U,q=V}var Y=!1,W,q,B=J===void 0?null:J;return[function(){return K(Z())},B===null?void 0:function(){return K(B())}]},[Z,J,Q,X]);var z=Mh($,G[0],G[1]);return Dh(function(){H.hasValue=!0,H.value=z},[z]),Oh(z),z};var yL=O(v(),1);var hz=[],vz=void 0;function xL(){return vz}function hL($){hz.push($)}function i3($){let Z=(J,Q)=>{let X=$1(Ph).current,G;try{vz=X;for(let H of hz)H.before(X);G=$(J,Q);for(let H of hz)H.after(X);X.didInitialize=!0}finally{vz=void 0}return G};return Z.displayName=$.displayName||$.name,Z}function bJ($){return yL.forwardRef(i3($))}function Ph(){return{didInitialize:!1}}var jh=S6(19),Ch=jh?Th:kh;function yJ($,Z,J,Q,X){return Ch($,Z,J,Q,X)}function Ih($,Z,J,Q,X){let G=vL.useCallback(()=>Z($.getSnapshot(),J,Q,X),[$,Z,J,Q,X]);return gz.useSyncExternalStore($.subscribe,G,G)}hL({before($){if($.syncIndex=0,!$.didInitialize)$.syncTick=1,$.syncHooks=[],$.didChangeStore=!0,$.getSnapshot=()=>{let Z=!1;for(let J=0;J<$.syncHooks.length;J+=1){let Q=$.syncHooks[J],X=Q.selector(Q.store.state,Q.a1,Q.a2,Q.a3);if(Q.didChange||!Object.is(Q.value,X))Z=!0,Q.value=X,Q.didChange=!1}if(Z)$.syncTick+=1;return $.syncTick}},after($){if($.syncHooks.length>0){if($.didChangeStore)$.didChangeStore=!1,$.subscribe=(Z)=>{let J=new Set;for(let X of $.syncHooks)J.add(X.store);let Q=[];for(let X of J)Q.push(X.subscribe(Z));return()=>{for(let X of Q)X()}};gz.useSyncExternalStore($.subscribe,$.getSnapshot,$.getSnapshot)}}});function Th($,Z,J,Q,X){let G=xL();if(!G)return Ih($,Z,J,Q,X);let H=G.syncIndex;G.syncIndex+=1;let z;if(!G.didInitialize)z={store:$,selector:Z,a1:J,a2:Q,a3:X,value:Z($.getSnapshot(),J,Q,X),didChange:!1},G.syncHooks.push(z);else if(z=G.syncHooks[H],z.store!==$||z.selector!==Z||!Object.is(z.a1,J)||!Object.is(z.a2,Q)||!Object.is(z.a3,X)){if(z.store!==$)G.didChangeStore=!0;z.store=$,z.selector=Z,z.a1=J,z.a2=Q,z.a3=X,z.didChange=!0}return z.value}function kh($,Z,J,Q,X){return xz($.subscribe,$.getSnapshot,$.getSnapshot,(G)=>Z(G,J,Q,X))}class fz{constructor($){this.state=$,this.listeners=new Set,this.updateTick=0}subscribe=($)=>{return this.listeners.add($),()=>{this.listeners.delete($)}};getSnapshot=()=>{return this.state};setState($){if(this.state===$)return;this.state=$,this.updateTick+=1;let Z=this.updateTick;for(let J of this.listeners){if(Z!==this.updateTick)return;J($)}}update($){for(let Z in $)if(!Object.is(this.state[Z],$[Z])){this.setState({...this.state,...$});return}}set($,Z){if(!Object.is(this.state[$],Z))this.setState({...this.state,[$]:Z})}notifyAll(){let $={...this.state};this.setState($)}use($,Z,J,Q){return yJ(this,$,Z,J,Q)}}var R9=O(v(),1);class T8 extends fz{constructor($,Z={},J){super($);this.context=Z,this.selectors=J}useSyncedValue($,Z){R9.useDebugValue($),Q0(()=>{if(this.state[$]!==Z)this.set($,Z)},[$,Z])}useSyncedValueWithCleanup($,Z){let J=this;Q0(()=>{if(J.state[$]!==Z)J.set($,Z);return()=>{J.set($,void 0)}},[J,$,Z])}useSyncedValues($){let Z=this,J=Object.values($);Q0(()=>{Z.update($)},[Z,...J])}useControlledProp($,Z){R9.useDebugValue($);let J=Z!==void 0;Q0(()=>{if(J&&!Object.is(this.state[$],Z))super.setState({...this.state,[$]:Z})},[$,Z,J])}select($,Z,J,Q){let X=this.selectors[$];return X(this.state,Z,J,Q)}useState($,Z,J,Q){return R9.useDebugValue($),yJ(this,this.selectors[$],Z,J,Q)}useContextCallback($,Z){R9.useDebugValue($);let J=H0(Z??w1);this.context[$]=J}useStateSetter($){let Z=R9.useRef(void 0);if(Z.current===void 0)Z.current=(J)=>{this.set($,J)};return Z.current}observe($,Z){let J;if(typeof $==="function")J=$;else J=this.selectors[$];let Q=J(this.state);return Z(Q,Q,this),this.subscribe((X)=>{let G=J(X);if(!Object.is(Q,G)){let H=Q;Q=G,Z(G,H,this)}})}}var Eh={open:w0(($)=>$.open),domReferenceElement:w0(($)=>$.domReferenceElement),referenceElement:w0(($)=>$.positionReference??$.referenceElement),floatingElement:w0(($)=>$.floatingElement),floatingId:w0(($)=>$.floatingId)};class b9 extends T8{constructor($){let{nested:Z,noEmit:J,onOpenChange:Q,triggerElements:X,...G}=$;super({...G,positionReference:G.referenceElement,domReferenceElement:G.referenceElement},{onOpenChange:Q,dataRef:{current:{}},events:AJ(),nested:Z,noEmit:J,triggerElements:X},Eh)}setOpen=($,Z)=>{if(!$||!this.state.open||YJ(Z.event))this.context.dataRef.current.openEvent=$?Z.event:void 0;if(!this.context.noEmit){let J={open:$,reason:Z.reason,nativeEvent:Z.event,nested:this.context.nested,triggerElement:Z.trigger};this.context.events.emit("openchange",J)}this.context.onOpenChange?.($,Z)}}var a3=O(v(),1);var r3=O(v(),1);function d8($,Z=!1,J=!1){let[Q,X]=r3.useState($&&Z?"idle":void 0),[G,H]=r3.useState($);if($&&!G)H(!0),X("starting");if(!$&&G&&Q!=="ending"&&!J)X("ending");if(!$&&!G&&Q==="ending")X(void 0);return Q0(()=>{if(!$&&G&&Q!=="ending"&&J){let z=m1.request(()=>{X("ending")});return()=>{m1.cancel(z)}}return},[$,G,Q,J]),Q0(()=>{if(!$||Z)return;let z=m1.request(()=>{X(void 0)});return()=>{m1.cancel(z)}},[Z,$]),Q0(()=>{if(!$||!Z)return;if($&&G&&Q!=="idle")X("starting");let z=m1.request(()=>{X("idle")});return()=>{m1.cancel(z)}},[Z,$,G,X,Q]),r3.useMemo(()=>({mounted:G,setMounted:H,transitionStatus:Q}),[G,Q])}var fL=O(v(),1);var gL=O(I8(),1);var y4=function($){return $.startingStyle="data-starting-style",$.endingStyle="data-ending-style",$}({}),Sh={[y4.startingStyle]:""},Rh={[y4.endingStyle]:""},P1={transitionStatus($){if($==="starting")return Sh;if($==="ending")return Rh;return null}};function x4($,Z=!1,J=!0){let Q=u8();return H0((X,G=null)=>{Q.cancel();function H(){gL.flushSync(X)}let z=H4($);if(z==null)return;let K=z;if(typeof K.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)X();else{let Y=function(){let q=y4.startingStyle;if(!K.hasAttribute(q)){Q.request(W);return}let B=new MutationObserver(()=>{if(!K.hasAttribute(q))B.disconnect(),W()});B.observe(K,{attributes:!0,attributeFilter:[q]}),G?.addEventListener("abort",()=>B.disconnect(),{once:!0})},W=function(){Promise.all(K.getAnimations().map((q)=>q.finished)).then(()=>{if(G?.aborted)return;H()}).catch(()=>{let q=K.getAnimations();if(J){if(G?.aborted)return;H()}else if(q.length>0&&q.some((B)=>B.pending||B.playState!=="finished"))W()})};if(Z){Y();return}Q.request(W)}})}function L5($){let{enabled:Z=!0,open:J,ref:Q,onComplete:X}=$,G=H0(X),H=x4(Q,J,!1);fL.useEffect(()=>{if(!Z)return;let z=new AbortController;return H(G,z.signal),()=>{z.abort()}},[Z,J,G,H])}function mz($,Z){let J=a3.useRef(null),Q=a3.useRef(null);return a3.useCallback((X)=>{if($===void 0)return;if(J.current!==null){let G=J.current,H=Q.current,z=Z.context.triggerElements.getById(G);if(H&&z===H)Z.context.triggerElements.delete(G);J.current=null,Q.current=null}if(X!==null)J.current=$,Q.current=X,Z.context.triggerElements.add($,X)},[Z,$])}function h4($,Z,J,Q){let X=J.useState("isMountedByTrigger",$),G=mz($,J),H=H0((z)=>{if(G(z),!z||!J.select("open"))return;let K=J.select("activeTriggerId");if(K===$){J.update({activeTriggerElement:z,...Q});return}if(K==null)J.update({activeTriggerId:$,activeTriggerElement:z,...Q})});return Q0(()=>{if(X)J.update({activeTriggerElement:Z.current,...Q})},[X,J,Z,...Object.values(Q)]),{registerTrigger:H,isMountedByThisTrigger:X}}function v4($){let Z=$.useState("open");Q0(()=>{if(Z&&!$.select("activeTriggerId")&&$.context.triggerElements.size===1){let J=$.context.triggerElements.entries().next();if(!J.done){let[Q,X]=J.value;$.update({activeTriggerId:Q,activeTriggerElement:X})}}},[Z,$])}function g4($,Z,J){let{mounted:Q,setMounted:X,transitionStatus:G}=d8($);Z.useSyncedValues({mounted:Q,transitionStatus:G});let H=H0(()=>{X(!1),Z.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),J?.(),Z.context.onOpenChangeComplete?.(!1)}),z=Z.useState("preventUnmountingOnClose");return L5({enabled:!z,open:$,ref:Z.context.popupRef,onComplete(){if(!$)H()}}),{forceUnmount:H,transitionStatus:G}}class z8{constructor(){this.elementsSet=new Set,this.idMap=new Map}add($,Z){let J=this.idMap.get($);if(J===Z)return;if(J!==void 0)this.elementsSet.delete(J);this.elementsSet.add(Z),this.idMap.set($,Z)}delete($){let Z=this.idMap.get($);if(Z)this.elementsSet.delete(Z),this.idMap.delete($)}hasElement($){return this.elementsSet.has($)}hasMatchingElement($){for(let Z of this.elementsSet)if($(Z))return!0;return!1}getById($){return this.idMap.get($)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function mL(){return new b9({open:!1,floatingElement:null,referenceElement:null,triggerElements:new z8,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function f4(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:mL(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:e0,inactiveTriggerProps:e0,popupProps:e0}}var xJ=w0(($)=>$.triggerIdProp??$.activeTriggerId),m4={open:w0(($)=>$.openProp??$.open),mounted:w0(($)=>$.mounted),transitionStatus:w0(($)=>$.transitionStatus),floatingRootContext:w0(($)=>$.floatingRootContext),preventUnmountingOnClose:w0(($)=>$.preventUnmountingOnClose),payload:w0(($)=>$.payload),activeTriggerId:xJ,activeTriggerElement:w0(($)=>$.mounted?$.activeTriggerElement:null),isTriggerActive:w0(($,Z)=>Z!==void 0&&xJ($)===Z),isOpenedByTrigger:w0(($,Z)=>Z!==void 0&&xJ($)===Z&&$.open),isMountedByTrigger:w0(($,Z)=>Z!==void 0&&xJ($)===Z&&$.mounted),triggerProps:w0(($,Z)=>Z?$.activeTriggerProps:$.inactiveTriggerProps),popupProps:w0(($)=>$.popupProps),popupElement:w0(($)=>$.popupElement),positionerElement:w0(($)=>$.positionerElement)};function uL($){let{open:Z=!1,onOpenChange:J,elements:Q={}}=$,X=F8(),G=w5()!=null,H=$1(()=>new b9({open:Z,onOpenChange:J,referenceElement:Q.reference??null,floatingElement:Q.floating??null,triggerElements:new z8,floatingId:X,nested:G,noEmit:!1})).current;return Q0(()=>{let z={open:Z,floatingId:X};if(Q.reference!==void 0)z.referenceElement=Q.reference,z.domReferenceElement=L1(Q.reference)?Q.reference:null;if(Q.floating!==void 0)z.floatingElement=Q.floating;H.update(z)},[Z,X,Q.reference,Q.floating,H]),H.context.onOpenChange=J,H.context.nested=G,H.context.noEmit=!1,H}function uz($={}){let{nodeId:Z,externalTree:J}=$,Q=uL($),X=$.rootContext||Q,G={reference:X.useState("referenceElement"),floating:X.useState("floatingElement"),domReference:X.useState("domReferenceElement")},[H,z]=K8.useState(null),K=K8.useRef(null),Y=r5(J);Q0(()=>{if(G.domReference)K.current=G.domReference},[G.domReference]);let W=pL({...$,elements:{...G,...H&&{reference:H}}}),q=K8.useCallback((j)=>{let T=L1(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;z(T),W.refs.setReference(T)},[W.refs]),[B,U]=K8.useState(null),[F,V]=K8.useState(null);X.useSyncedValue("referenceElement",B),X.useSyncedValue("domReferenceElement",L1(B)?B:null),X.useSyncedValue("floatingElement",F);let N=K8.useCallback((j)=>{if(L1(j)||j===null)K.current=j,U(j);if(L1(W.refs.reference.current)||W.refs.reference.current===null||j!==null&&!L1(j))W.refs.setReference(j)},[W.refs,U]),L=K8.useCallback((j)=>{V(j),W.refs.setFloating(j)},[W.refs]),_=K8.useMemo(()=>({...W.refs,setReference:N,setFloating:L,setPositionReference:q,domReference:K}),[W.refs,N,L,q]),w=K8.useMemo(()=>({...W.elements,domReference:G.domReference}),[W.elements,G.domReference]),A=X.useState("open"),D=X.useState("floatingId"),M=K8.useMemo(()=>({...W,dataRef:X.context.dataRef,open:A,onOpenChange:X.setOpen,events:X.context.events,floatingId:D,refs:_,elements:w,nodeId:Z,rootStore:X}),[W,_,w,Z,X,A,D]);return Q0(()=>{X.context.dataRef.current.floatingContext=M;let j=Y?.nodesRef.current.find((T)=>T.id===Z);if(j)j.context=M}),K8.useMemo(()=>({...W,context:M,refs:_,elements:w,rootStore:X}),[W,_,w,M,X])}function K4($){let{popupStore:Z,noEmit:J=!1,treatPopupAsFloatingElement:Q=!1,onOpenChange:X}=$,G=F8(),H=w5()!=null,z=Z.useState("open"),K=Z.useState("activeTriggerElement"),Y=Z.useState(Q?"popupElement":"positionerElement"),W=Z.context.triggerElements,q=$1(()=>new b9({open:z,referenceElement:K,floatingElement:Y,triggerElements:W,onOpenChange:X,floatingId:G,nested:H,noEmit:J})).current;return Q0(()=>{let B={open:z,floatingId:G,referenceElement:K,floatingElement:Y};if(L1(K))B.domReferenceElement=K;if(q.state.positionReference===q.state.referenceElement)B.positionReference=K;q.update(B)},[z,G,K,Y,q]),q.context.onOpenChange=X,q.context.nested=H,q.context.noEmit=J,q}var u4=O(v(),1);var pz=mV&&XJ;function y9($,Z={}){let J="rootStore"in $?$.rootStore:$,{events:Q,dataRef:X}=J.context,{enabled:G=!0,delay:H}=Z,z=u4.useRef(!1),K=u4.useRef(null),Y=J5(),W=u4.useRef(!0);u4.useEffect(()=>{let B=J.select("domReferenceElement");if(!G)return;let U=j8(B);function F(){let L=J.select("domReferenceElement");if(!J.select("open")&&b1(L)&&L===x5(p0(L)))z.current=!0}function V(){W.current=!0}function N(){W.current=!1}if(U.addEventListener("blur",F),pz)U.addEventListener("keydown",V,!0),U.addEventListener("pointerdown",N,!0);return()=>{if(U.removeEventListener("blur",F),pz)U.removeEventListener("keydown",V,!0),U.removeEventListener("pointerdown",N,!0)}},[J,G]),u4.useEffect(()=>{if(!G)return;function B(U){if(U.reason===o.triggerPress||U.reason===o.escapeKey){let F=J.select("domReferenceElement");if(L1(F))K.current=F,z.current=!0}}return Q.on("openchange",B),()=>{Q.off("openchange",B)}},[Q,G,J]);let q=u4.useMemo(()=>({onMouseLeave(){z.current=!1,K.current=null},onFocus(B){let U=B.currentTarget;if(z.current){if(K.current===U)return;z.current=!1,K.current=null}let F=y1(B.nativeEvent);if(L1(F)){if(pz&&!B.relatedTarget){if(!W.current&&!w9(F))return}else if(!cV(F))return}let V=D9(B.relatedTarget,J.context.triggerElements),{nativeEvent:N,currentTarget:L}=B,_=typeof H==="function"?H():H;if(J.select("open")&&V||_===0||_===void 0){J.setOpen(!0,N0(o.triggerFocus,N,L));return}Y.start(_,()=>{if(z.current)return;J.setOpen(!0,N0(o.triggerFocus,N,L))})},onBlur(B){z.current=!1,K.current=null;let{relatedTarget:U,nativeEvent:F}=B,V=L1(U)&&U.hasAttribute(C8("focus-guard"))&&U.getAttribute("data-type")==="outside";Y.start(0,()=>{let N=J.select("domReferenceElement"),L=x5(N?N.ownerDocument:document);if(!U&&L===N)return;if(S0(X.current.floatingContext?.refs.floating.current,L)||S0(N,L)||V)return;if(D9(U??L,J.context.triggerElements))return;J.setOpen(!1,N0(o.triggerFocus,F))})}}),[X,J,Y,H]);return u4.useMemo(()=>G?{reference:q,trigger:q}:{},[G,q])}var s6=O(v(),1);var s3=C8("safe-polygon"),bh=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${m6}`;function cL($){return $?Boolean($.closest(bh)):!1}class cz{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 y5,this.restTimeout=new y5,this.handleCloseOptions=void 0}static create(){return new cz}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>{return this.dispose}}function hJ($){let Z=$1(cz.create).current,J=$.context.dataRef.current;if(!J.hoverInteractionState)J.hoverInteractionState=Z;return E4(J.hoverInteractionState.disposeEffect),J.hoverInteractionState}var yh=new Set(["click","mousedown"]);function z7($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingElement"),G=J.useState("domReferenceElement"),{dataRef:H}=J.context,{enabled:z=!0,closeDelay:K=0}=Z,Y=hJ(J),W=r5(),q=w5(),B=H0(()=>{if(Y.interactedInside)return!0;return H.current.openEvent?yh.has(H.current.openEvent.type):!1}),U=H0(()=>{let w=H.current.openEvent?.type;return w?.includes("mouse")&&w!=="mousedown"}),F=H0((w)=>{return D9(w,J.context.triggerElements)}),V=s6.useCallback((w,A=!0)=>{let D=xh(K,Y.pointerType);if(D&&!Y.handler)Y.openChangeTimeout.start(D,()=>J.setOpen(!1,N0(o.triggerHover,w)));else if(A)Y.openChangeTimeout.clear(),J.setOpen(!1,N0(o.triggerHover,w))},[K,J,Y]),N=H0(()=>{Y.unbindMouseMove(),Y.handler=void 0}),L=H0(()=>{if(Y.performedPointerEventsMutation){let w=p0(X).body;w.style.pointerEvents="",w.removeAttribute(s3),Y.performedPointerEventsMutation=!1}}),_=H0((w)=>{let A=y1(w);if(!cL(A)){Y.interactedInside=!1;return}Y.interactedInside=!0});Q0(()=>{if(!Q)Y.pointerType=void 0,Y.restTimeoutPending=!1,Y.interactedInside=!1,N(),L()},[Q,Y,N,L]),s6.useEffect(()=>{return()=>{N()}},[N]),s6.useEffect(()=>{return L},[L]),Q0(()=>{if(!z)return;if(Q&&Y.handleCloseOptions?.blockPointerEvents&&U()&&L1(G)&&X){Y.performedPointerEventsMutation=!0;let w=p0(X).body;w.setAttribute(s3,"");let A=G,D=X,M=W?.nodesRef.current.find((j)=>j.id===q)?.context?.elements.floating;if(M)M.style.pointerEvents="";return w.style.pointerEvents="none",A.style.pointerEvents="auto",D.style.pointerEvents="auto",()=>{w.style.pointerEvents="",A.style.pointerEvents="",D.style.pointerEvents=""}}return},[z,Q,G,X,Y,U,W,q]),s6.useEffect(()=>{if(!z)return;function w(j){if(B()||!H.current.floatingContext||!J.select("open"))return;if(F(j.relatedTarget))return;if(L(),N(),!B())V(j)}function A(j){Y.openChangeTimeout.clear(),L(),Y.handler?.(j),N()}function D(j){if(!B())V(j,!1)}let M=X;if(M)M.addEventListener("mouseleave",w),M.addEventListener("mouseenter",A),M.addEventListener("mouseleave",D),M.addEventListener("pointerdown",_,!0);return()=>{if(M)M.removeEventListener("mouseleave",w),M.removeEventListener("mouseenter",A),M.removeEventListener("mouseleave",D),M.removeEventListener("pointerdown",_,!0)}},[z,X,J,H,B,F,V,L,N,_,Y])}function xh($,Z){if(Z&&!m8(Z))return 0;if(typeof $==="function")return $();return $}var x9=O(v(),1),dL=O(I8(),1);function dz($){if(typeof $==="function")return $();return $}var hh={current:null};function Y4($,Z={}){let J="rootStore"in $?$.rootStore:$,{dataRef:Q,events:X}=J.context,{enabled:G=!0,delay:H=0,handleClose:z=null,mouseOnly:K=!1,restMs:Y=0,move:W=!0,triggerElementRef:q=hh,externalTree:B,isActiveTrigger:U=!0}=Z,F=r5(B),V=hJ(J),N=D5(z),L=D5(H),_=D5(Y),w=D5(G);if(U)V.handleCloseOptions=N.current?.__options;let A=H0(()=>{if(V.interactedInside)return!0;return Q.current.openEvent?["click","mousedown"].includes(Q.current.openEvent.type):!1}),D=H0((C)=>{return D9(C,J.context.triggerElements)}),M=x9.useCallback((C,g=!0)=>{let b=d6(L.current,"close",V.pointerType);if(b&&!V.handler)V.openChangeTimeout.start(b,()=>J.setOpen(!1,N0(o.triggerHover,C)));else if(g)V.openChangeTimeout.clear(),J.setOpen(!1,N0(o.triggerHover,C))},[L,J,V]),j=H0(()=>{V.unbindMouseMove(),V.handler=void 0}),T=H0(()=>{if(V.performedPointerEventsMutation){let C=p0(J.select("domReferenceElement")).body;C.style.pointerEvents="",C.removeAttribute(s3),V.performedPointerEventsMutation=!1}});x9.useEffect(()=>{if(!G)return;function C(g){if(!g.open)V.openChangeTimeout.clear(),V.restTimeout.clear(),V.blockMouseMove=!0,V.restTimeoutPending=!1}return X.on("openchange",C),()=>{X.off("openchange",C)}},[G,X,V]);let E=H0((C)=>{if(A())return;if(!Q.current.floatingContext)return;if(D(C.relatedTarget))return;let g=q.current;N.current?.({...Q.current.floatingContext,tree:F,x:C.clientX,y:C.clientY,onClose(){if(T(),j(),!A()&&g===J.select("domReferenceElement"))M(C)}})(C)});return x9.useEffect(()=>{if(!G)return;let C=q.current??(U?J.select("domReferenceElement"):null);if(!L1(C))return;function g(x){if(V.openChangeTimeout.clear(),V.blockMouseMove=!1,K&&!m8(V.pointerType))return;if(dz(_.current)>0&&!d6(L.current,"open"))return;let R=d6(L.current,"open",V.pointerType),I=J.select("domReferenceElement"),S=J.context.triggerElements,h=(S.hasElement(x.target)||S.hasMatchingElement((z0)=>S0(z0,x.target)))&&(!I||!S0(I,x.target)),p=x.currentTarget??null,P=J.select("open"),t=!P||h;if(h&&P)J.setOpen(!0,N0(o.triggerHover,x,p));else if(R)V.openChangeTimeout.start(R,()=>{if(t)J.setOpen(!0,N0(o.triggerHover,x,p))});else if(t)J.setOpen(!0,N0(o.triggerHover,x,p))}function b(x){if(A()){T();return}V.unbindMouseMove();let R=J.select("domReferenceElement"),I=p0(R);if(V.restTimeout.clear(),V.restTimeoutPending=!1,D(x.relatedTarget))return;if(N.current&&Q.current.floatingContext){if(!J.select("open"))V.openChangeTimeout.clear();let h=q.current;V.handler=N.current({...Q.current.floatingContext,tree:F,x:x.clientX,y:x.clientY,onClose(){if(T(),j(),w.current&&!A()&&h===J.select("domReferenceElement"))M(x,!0)}});let p=V.handler;p(x),I.addEventListener("mousemove",p),V.unbindMouseMove=()=>{I.removeEventListener("mousemove",p)};return}if(V.pointerType==="touch"?!S0(J.select("floatingElement"),x.relatedTarget):!0)M(x)}function k(x){E(x)}if(J.select("open"))C.addEventListener("mouseleave",k);if(W)C.addEventListener("mousemove",g,{once:!0});return C.addEventListener("mouseenter",g),C.addEventListener("mouseleave",b),()=>{if(C.removeEventListener("mouseleave",k),W)C.removeEventListener("mousemove",g);C.removeEventListener("mouseenter",g),C.removeEventListener("mouseleave",b)}},[j,T,Q,L,M,J,G,N,E,V,U,A,D,K,W,_,q,F,w]),x9.useMemo(()=>{if(!G)return;function C(g){V.pointerType=g.pointerType}return{onPointerDown:C,onPointerEnter:C,onMouseMove(g){let{nativeEvent:b}=g,k=g.currentTarget,x=J.select("domReferenceElement"),R=J.context.triggerElements,I=J.select("open"),S=(R.hasElement(g.target)||R.hasMatchingElement((p)=>S0(p,g.target)))&&(!x||!S0(x,g.target));if(K&&!m8(V.pointerType))return;if(I&&!S||dz(_.current)===0)return;if(!S&&V.restTimeoutPending&&g.movementX**2+g.movementY**2<2)return;V.restTimeout.clear();function h(){if(V.restTimeoutPending=!1,A())return;let p=J.select("open");if(!V.blockMouseMove&&(!p||S))J.setOpen(!0,N0(o.triggerHover,b,k))}if(V.pointerType==="touch")dL.flushSync(()=>{h()});else if(S&&I)h();else V.restTimeoutPending=!0,V.restTimeout.start(dz(_.current),h)}}},[G,V,A,K,J,_])}var h9=O(v(),1);function P5($=[]){let Z=$.map((Y)=>Y?.reference),J=$.map((Y)=>Y?.floating),Q=$.map((Y)=>Y?.item),X=$.map((Y)=>Y?.trigger),G=h9.useCallback((Y)=>vJ(Y,$,"reference"),Z),H=h9.useCallback((Y)=>vJ(Y,$,"floating"),J),z=h9.useCallback((Y)=>vJ(Y,$,"item"),Q),K=h9.useCallback((Y)=>vJ(Y,$,"trigger"),X);return h9.useMemo(()=>({getReferenceProps:G,getFloatingProps:H,getItemProps:z,getTriggerProps:K}),[G,H,z,K])}function vJ($,Z,J){let Q=new Map,X=J==="item",G={};if(J==="floating")G.tabIndex=-1,G[v3]="";for(let H in $){if(X&&$){if(H===Fz||H===Vz)continue}G[H]=$[H]}for(let H=0;H<Z.length;H+=1){let z,K=Z[H]?.[J];if(typeof K==="function")z=$?K($):null;else z=K;if(!z)continue;lL(G,z,X,Q)}return lL(G,$,X,Q),G}function lL($,Z,J,Q){for(let X in Z){let G=Z[X];if(J&&(X===Fz||X===Vz))continue;if(!X.startsWith("on"))$[X]=G;else{if(!Q.has(X))Q.set(X,[]);if(typeof G==="function")Q.get(X)?.push(G),$[X]=(...H)=>{return Q.get(X)?.map((z)=>z(...H)).find((z)=>z!==void 0)}}}}var j5=O(v(),1);var vh="Escape";function fJ($,Z,J){switch($){case"vertical":return Z;case"horizontal":return J;default:return Z||J}}function gJ($,Z){return fJ(Z,$===g3||$===A9,$===S4||$===R4)}function lz($,Z,J){return fJ(Z,$===A9,J?$===S4:$===R4)||$==="Enter"||$===" "||$===""}function gh($,Z,J){return fJ(Z,J?$===S4:$===R4,$===A9)}function fh($,Z,J,Q){let X=J?$===R4:$===S4,G=$===g3;if(Z==="both"||Z==="horizontal"&&Q&&Q>1)return $===vh;return fJ(Z,X,G)}function iz($,Z){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingElement"),G=J.useState("domReferenceElement"),H=J.context.dataRef,{listRef:z,activeIndex:K,onNavigate:Y=()=>{},enabled:W=!0,selectedIndex:q=null,allowEscape:B=!1,loopFocus:U=!1,nested:F=!1,rtl:V=!1,virtual:N=!1,focusItemOnOpen:L="auto",focusItemOnHover:_=!0,openOnArrowKeyDown:w=!0,disabledIndices:A=void 0,orientation:D="vertical",parentOrientation:M,cols:j=1,id:T,resetOnPointerLeave:E=!0,externalTree:C}=Z,g=O9(X),b=D5(g),k=w5(),x=r5(C);Q0(()=>{H.current.orientation=D},[H,D]);let R=f3(G),I=j5.useRef(L),S=j5.useRef(q??-1),h=j5.useRef(null),p=j5.useRef(!0),P=H0((e)=>{Y(S.current===-1?null:S.current,e)}),t=j5.useRef(P),z0=j5.useRef(!!X),y=j5.useRef(Q),n=j5.useRef(!1),_0=j5.useRef(!1),c=D5(A),X0=D5(Q),K0=D5(q),Z0=D5(E),G0=H0(()=>{function e(I0){if(N)x?.events.emit("virtualfocus",I0);else T9(I0,{sync:n.current,preventScroll:!0})}let q0=z.current[S.current],a=_0.current;if(q0)e(q0);(n.current?(I0)=>I0():requestAnimationFrame)(()=>{let I0=z.current[S.current]||q0;if(!I0)return;if(!q0)e(I0);if(m&&(a||!p.current))I0.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Q0(()=>{if(!W)return;if(Q&&X){if(S.current=q??-1,I.current&&q!=null)_0.current=!0,P()}else if(z0.current)S.current=-1,t.current()},[W,Q,X,q,P]),Q0(()=>{if(!W)return;if(!Q){n.current=!1;return}if(!X)return;if(K==null){if(n.current=!1,K0.current!=null)return;if(z0.current)S.current=-1,G0();if((!y.current||!z0.current)&&I.current&&(h.current!=null||I.current===!0&&h.current==null)){let e=0,q0=()=>{if(z.current[0]==null){if(e<2)(e?requestAnimationFrame:queueMicrotask)(q0);e+=1}else S.current=h.current==null||lz(h.current,D,V)||F?qJ(z):_z(z),h.current=null,P()};q0()}}else if(!u6(z,K))S.current=K,G0(),_0.current=!1},[W,Q,X,K,K0,F,z,D,V,P,G0,c]),Q0(()=>{if(!W||X||!x||N||!z0.current)return;let e=x.nodesRef.current,q0=e.find((I0)=>I0.id===k)?.context?.elements.floating,a=x5(p0(X)),A0=e.some((I0)=>I0.context&&S0(I0.context.elements.floating,a));if(q0&&!A0&&p.current)q0.focus({preventScroll:!0})},[W,X,x,k,N]),Q0(()=>{t.current=P,y.current=Q,z0.current=!!X}),Q0(()=>{if(!Q)h.current=null,I.current=L},[Q,L]);let U0=K!=null,m=j5.useMemo(()=>{function e(a){if(!X0.current)return;let A0=z.current.indexOf(a.currentTarget);if(A0!==-1&&S.current!==A0)S.current=A0,P(a)}return{onFocus(a){n.current=!0,e(a)},onClick:({currentTarget:a})=>a.focus({preventScroll:!0}),onMouseMove(a){if(n.current=!0,_0.current=!1,_)e(a)},onPointerLeave(a){if(!X0.current||!p.current||a.pointerType==="touch")return;n.current=!0;let A0=a.relatedTarget;if(!_||z.current.includes(A0))return;if(!Z0.current)return;if(T9(null,{sync:!0}),S.current=-1,P(a),!N)b.current?.focus({preventScroll:!0})}}},[X0,b,_,z,P,Z0,N]),s=j5.useCallback(()=>{return M??x?.nodesRef.current.find((e)=>e.id===k)?.context?.dataRef?.current.orientation},[k,x,M]),u=H0((e)=>{if(p.current=!1,n.current=!0,e.which===229)return;if(!X0.current&&e.currentTarget===b.current)return;if(F&&fh(e.key,D,V,j)){if(!gJ(e.key,s()))V5(e);if(J.setOpen(!1,N0(o.listNavigation,e.nativeEvent)),b1(G))if(N)x?.events.emit("virtualfocus",G);else G.focus();return}let q0=S.current,a=qJ(z,A),A0=_z(z,A);if(!R){if(e.key==="Home")V5(e),S.current=a,P(e);if(e.key==="End")V5(e),S.current=A0,P(e)}if(j>1){let I0=Array.from({length:z.current.length},()=>({width:1,height:1})),i0=iV(I0,j,!1),z1=i0.findIndex(($0)=>$0!=null&&!p6(z,$0,A)),f=i0.reduce(($0,V0,j0)=>V0!=null&&!p6(z,V0,A)?j0:$0,-1),d=i0[lV({current:i0.map(($0)=>$0!=null?z.current[$0]:null)},{event:e,orientation:D,loopFocus:U,rtl:V,cols:j,disabledIndices:aV([...(typeof A!=="function"?A:null)||z.current.map(($0,V0)=>p6(z,V0,A)?V0:void 0),void 0],i0),minIndex:z1,maxIndex:f,prevIndex:rV(S.current>A0?a:S.current,I0,i0,j,e.key===A9?"bl":e.key===(V?S4:R4)?"tr":"tl"),stopEvent:!0})];if(d!=null)S.current=d,P(e);if(D==="both")return}if(gJ(e.key,D)){if(V5(e),Q&&!N&&x5(e.currentTarget.ownerDocument)===e.currentTarget){S.current=lz(e.key,D,V)?a:A0,P(e);return}if(lz(e.key,D,V))if(U)if(q0>=A0)if(B&&q0!==z.current.length)S.current=-1;else n.current=!1,S.current=a;else S.current=h5(z,{startingIndex:q0,disabledIndices:A});else S.current=Math.min(A0,h5(z,{startingIndex:q0,disabledIndices:A}));else if(U)if(q0<=a)if(B&&q0!==-1)S.current=z.current.length;else n.current=!1,S.current=A0;else S.current=h5(z,{startingIndex:q0,decrement:!0,disabledIndices:A});else S.current=Math.max(a,h5(z,{startingIndex:q0,decrement:!0,disabledIndices:A}));if(u6(z,S.current))S.current=-1;P(e)}}),F0=j5.useMemo(()=>{return N&&Q&&U0&&{"aria-activedescendant":`${T}-${K}`}},[N,Q,U0,T,K]),i=j5.useMemo(()=>{return{"aria-orientation":D==="both"?void 0:D,...!R?F0:{},onKeyDown(e){if(e.key==="Tab"&&e.shiftKey&&Q&&!N){let q0=y1(e.nativeEvent);if(q0&&!S0(b.current,q0))return;if(V5(e),J.setOpen(!1,N0(o.focusOut,e.nativeEvent)),b1(G))G.focus();return}u(e)},onPointerMove(){p.current=!0}}},[F0,u,b,D,R,J,Q,N,G]),Y0=j5.useMemo(()=>{function e(a){if(L==="auto"&&zJ(a.nativeEvent))I.current=!N}function q0(a){if(I.current=L,L==="auto"&&KJ(a.nativeEvent))I.current=!0}return{onKeyDown(a){let A0=J.select("open");p.current=!1;let I0=a.key.startsWith("Arrow"),i0=gh(a.key,s(),V),z1=gJ(a.key,D),f=(F?i0:z1)||a.key==="Enter"||a.key.trim()==="";if(N&&A0)return u(a);if(!A0&&!w&&I0)return;if(f){let d=gJ(a.key,s());h.current=F&&d?null:a.key}if(F){if(i0)if(V5(a),A0)S.current=qJ(z,c.current),P(a);else J.setOpen(!0,N0(o.listNavigation,a.nativeEvent,a.currentTarget));return}if(z1){if(K0.current!=null)S.current=K0.current;if(V5(a),!A0&&w)J.setOpen(!0,N0(o.listNavigation,a.nativeEvent,a.currentTarget));else u(a);if(A0)P(a)}return},onFocus(a){if(J.select("open")&&!N)S.current=-1,P(a)},onPointerDown:q0,onPointerEnter:q0,onMouseDown:e,onClick:e}},[u,c,L,z,F,P,J,w,D,s,V,K0,N]),r=j5.useMemo(()=>{return{...F0,...Y0}},[F0,Y0]);return j5.useMemo(()=>W?{reference:r,floating:i,item:m,trigger:Y0}:{},[W,r,i,Y0,m])}var x7=O(v(),1);var mh=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function v9($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingId"),G=J.useState("domReferenceElement"),H=J.useState("floatingElement"),{role:z="dialog"}=Z,K=F8(),Y=G?.id||K,W=x7.useMemo(()=>O9(H)?.id||X,[H,X]),q=mh.get(z)??z,U=w5()!=null,F=x7.useMemo(()=>{if(q==="tooltip"||z==="label")return e0;return{"aria-haspopup":q==="alertdialog"?"dialog":q,"aria-expanded":"false",...q==="listbox"&&{role:"combobox"},...q==="menu"&&U&&{role:"menuitem"},...z==="select"&&{"aria-autocomplete":"none"},...z==="combobox"&&{"aria-autocomplete":"list"}}},[q,U,z]),V=x7.useMemo(()=>{if(q==="tooltip"||z==="label")return{[`aria-${z==="label"?"labelledby":"describedby"}`]:Q?W:void 0};return{...F,"aria-expanded":Q?"true":"false","aria-controls":Q?W:void 0,...q==="menu"&&{id:Y}}},[q,W,Q,Y,z,F]),N=x7.useMemo(()=>{let _={id:W,...q&&{role:q}};if(q==="tooltip"||z==="label")return _;return{..._,...q==="menu"&&{"aria-labelledby":Y}}},[q,W,Y,z]),L=x7.useCallback(({active:_,selected:w})=>{let A={role:"option",..._&&{id:`${W}-fui-option`}};switch(z){case"select":case"combobox":return{...A,"aria-selected":w};default:}return{}},[W,z]);return x7.useMemo(()=>({reference:V,floating:N,item:L,trigger:F}),[V,N,F,L])}var h7=O(v(),1);function rz($,Z){let J="rootStore"in $?$.rootStore:$,Q=J.context.dataRef,X=J.useState("open"),{listRef:G,activeIndex:H,onMatch:z,onTypingChange:K,enabled:Y=!0,resetMs:W=750,selectedIndex:q=null}=Z,B=J5(),U=h7.useRef(""),F=h7.useRef(q??H??-1),V=h7.useRef(null);Q0(()=>{if(!X&&q!==null)return;if(B.clear(),V.current=null,U.current!=="")U.current=""},[X,q,B]),Q0(()=>{if(X&&U.current==="")F.current=q??H??-1},[X,q,H]);let N=H0((D)=>{if(D){if(!Q.current.typing)Q.current.typing=D,K?.(D)}else if(Q.current.typing)Q.current.typing=D,K?.(D)}),L=H0((D)=>{function M(b,k,x){let R=k.find((I)=>I?.toLocaleLowerCase().indexOf(x.toLocaleLowerCase())===0);return R?b.indexOf(R):-1}let j=G.current;if(U.current.length>0&&U.current[0]!==" "){if(M(j,j,U.current)===-1)N(!1);else if(D.key===" ")V5(D)}if(j==null||D.key.length!==1||D.ctrlKey||D.metaKey||D.altKey)return;if(X&&D.key!==" ")V5(D),N(!0);let T=U.current==="";if(T)F.current=q??H??-1;if(j.every((b)=>b?b[0]?.toLocaleLowerCase()!==b[1]?.toLocaleLowerCase():!0)&&U.current===D.key)U.current="",F.current=V.current;U.current+=D.key,B.start(W,()=>{U.current="",F.current=V.current,N(!1)});let C=T?q??H??-1:F.current,g=M(j,[...j.slice((C||0)+1),...j.slice(0,(C||0)+1)],U.current);if(g!==-1)z?.(g),V.current=g;else if(D.key!==" ")U.current="",N(!1)}),_=H0((D)=>{let M=D.relatedTarget,j=J.select("domReferenceElement"),T=J.select("floatingElement"),E=S0(j,M),C=S0(T,M);if(E||C)return;B.clear(),U.current="",F.current=V.current,N(!1)}),w=h7.useMemo(()=>({onKeyDown:L,onBlur:_}),[L,_]),A=h7.useMemo(()=>{return{onKeyDown:L,onKeyUp(D){if(D.key===" ")N(!1)},onBlur:_}},[L,_,N]);return h7.useMemo(()=>Y?{reference:w,floating:A}:{},[Y,w,A])}function iL($,Z){let[J,Q]=$,X=!1,G=Z.length;for(let H=0,z=G-1;H<G;z=H++){let[K,Y]=Z[H]||[0,0],[W,q]=Z[z]||[0,0];if(Y>=Q!==q>=Q&&J<=(W-K)*(Q-Y)/(q-Y)+K)X=!X}return X}function uh($,Z){return $[0]>=Z.x&&$[0]<=Z.x+Z.width&&$[1]>=Z.y&&$[1]<=Z.y+Z.height}function W4($={}){let{buffer:Z=0.5,blockPointerEvents:J=!1,requireIntent:Q=!0}=$,X=new y5,G=!1,H=null,z=null,K=typeof performance<"u"?performance.now():0;function Y(q,B){let U=performance.now(),F=U-K;if(H===null||z===null||F===0)return H=q,z=B,K=U,null;let V=q-H,N=B-z,_=Math.sqrt(V*V+N*N)/F;return H=q,z=B,K=U,_}let W=({x:q,y:B,placement:U,elements:F,onClose:V,nodeId:N,tree:L})=>{return function(w){function A(){X.clear(),V()}if(X.clear(),!F.domReference||!F.floating||U==null||q==null||B==null)return;let{clientX:D,clientY:M}=w,j=[D,M],T=y1(w),E=w.type==="mouseleave",C=S0(F.floating,T),g=S0(F.domReference,T),b=F.domReference.getBoundingClientRect(),k=F.floating.getBoundingClientRect(),x=U.split("-")[0],R=q>k.right-k.width/2,I=B>k.bottom-k.height/2,S=uh(j,b),h=k.width>b.width,p=k.height>b.height,P=(h?b:k).left,t=(h?b:k).right,z0=(p?b:k).top,y=(p?b:k).bottom;if(C){if(G=!0,!E)return}if(g)G=!1;if(g&&!E){G=!0;return}if(E&&L1(w.relatedTarget)&&S0(F.floating,w.relatedTarget))return;if(L&&b4(L.nodesRef.current,N).some(({context:c})=>c?.open))return;if(x==="top"&&B>=b.bottom-1||x==="bottom"&&B<=b.top+1||x==="left"&&q>=b.right-1||x==="right"&&q<=b.left+1)return A();let n=[];switch(x){case"top":n=[[P,b.top+1],[P,k.bottom-1],[t,k.bottom-1],[t,b.top+1]];break;case"bottom":n=[[P,k.top+1],[P,b.bottom-1],[t,b.bottom-1],[t,k.top+1]];break;case"left":n=[[k.right-1,y],[k.right-1,z0],[b.left+1,z0],[b.left+1,y]];break;case"right":n=[[b.right-1,y],[b.right-1,z0],[k.left+1,z0],[k.left+1,y]];break;default:}function _0([c,X0]){switch(x){case"top":{let K0=[h?c+Z/2:R?c+Z*4:c-Z*4,X0+Z+1],Z0=[h?c-Z/2:R?c+Z*4:c-Z*4,X0+Z+1],G0=[[k.left,R?k.bottom-Z:h?k.bottom-Z:k.top],[k.right,R?h?k.bottom-Z:k.top:k.bottom-Z]];return[K0,Z0,...G0]}case"bottom":{let K0=[h?c+Z/2:R?c+Z*4:c-Z*4,X0-Z],Z0=[h?c-Z/2:R?c+Z*4:c-Z*4,X0-Z],G0=[[k.left,R?k.top+Z:h?k.top+Z:k.bottom],[k.right,R?h?k.top+Z:k.bottom:k.top+Z]];return[K0,Z0,...G0]}case"left":{let K0=[c+Z+1,p?X0+Z/2:I?X0+Z*4:X0-Z*4],Z0=[c+Z+1,p?X0-Z/2:I?X0+Z*4:X0-Z*4];return[...[[I?k.right-Z:p?k.right-Z:k.left,k.top],[I?p?k.right-Z:k.left:k.right-Z,k.bottom]],K0,Z0]}case"right":{let K0=[c-Z,p?X0+Z/2:I?X0+Z*4:X0-Z*4],Z0=[c-Z,p?X0-Z/2:I?X0+Z*4:X0-Z*4],G0=[[I?k.left+Z:p?k.left+Z:k.right,k.top],[I?p?k.left+Z:k.right:k.left+Z,k.bottom]];return[K0,Z0,...G0]}default:return[]}}if(iL([D,M],n))return;if(G&&!S)return A();if(!E&&Q){let c=Y(w.clientX,w.clientY),X0=0.1;if(c!==null&&c<0.1)return A()}if(!iL([D,M],_0([q,B])))A();else if(!G&&Q)X.start(40,A);return}};return W.__options={blockPointerEvents:J},W}var uJ=O(v(),1),$K=uJ.createContext(void 0);function L8($){let Z=uJ.useContext($K);if(Z===void 0&&!$)throw Error(M0(50));return Z}var aL=O(v(),1),sL=O(I8(),1);var rL=600,pJ=300;var ph={...m4,instantType:w0(($)=>$.instantType),hasViewport:w0(($)=>$.hasViewport)};class n6 extends T8{constructor($){super({...ch(),...$},{popupRef:aL.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new z8,closeDelayRef:{current:pJ}},ph)}setOpen=($,Z)=>{let J=Z.reason,Q=J===o.triggerHover,X=$&&J===o.triggerFocus,G=!$&&(J===o.triggerPress||J===o.escapeKey);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let H=()=>{let z={open:$};if(X)z.instantType="focus";else if(G)z.instantType="dismiss";else if(J===o.triggerHover)z.instantType=void 0;let K=Z.trigger?.id??null;if(K||$)z.activeTriggerId=K,z.activeTriggerElement=Z.trigger??null;this.update(z)};if(Q)sL.flushSync(H);else H()};static useStore($,Z){let J=$1(()=>{return new n6(Z)}).current,Q=$??J,X=K4({popupStore:Q,onOpenChange:Q.setOpen});return Q.state.floatingRootContext=X,Q}}function ch(){return{...f4(),instantType:void 0,hasViewport:!1}}var nL=O(l(),1);function oL($){let{open:Z,defaultOpen:J=!1,onOpenChange:Q,onOpenChangeComplete:X,actionsRef:G,handle:H,triggerId:z,defaultTriggerId:K=null,children:Y}=$,W=n6.useStore(H?.store,{open:J,openProp:Z,activeTriggerId:K,triggerIdProp:z});k4(()=>{if(Z===void 0&&W.state.open===!1&&J===!0)W.update({open:!0,activeTriggerId:K})}),W.useControlledProp("openProp",Z),W.useControlledProp("triggerIdProp",z),W.useContextCallback("onOpenChange",Q),W.useContextCallback("onOpenChangeComplete",X);let q=W.useState("open"),B=W.useState("activeTriggerId"),U=W.useState("payload");v4(W);let{forceUnmount:F}=g4(q,W);Q0(()=>{if(q){if(B==null)W.set("payload",void 0)}},[W,B,q]);let V=v7.useCallback(()=>{W.setOpen(!1,dh(W,o.imperativeAction))},[W]);v7.useImperativeHandle(G,()=>({unmount:F,close:V}),[F,V]);let N=W.useState("floatingRootContext"),L=z4(N),{getReferenceProps:_,getTriggerProps:w,getFloatingProps:A}=P5([L]),D=v7.useMemo(()=>_(),[_]),M=v7.useMemo(()=>w(),[w]),j=v7.useMemo(()=>A(),[A]);return W.useSyncedValues({activeTriggerProps:D,inactiveTriggerProps:M,popupProps:j}),nL.jsx($K.Provider,{value:W,children:typeof Y==="function"?Y({payload:U}):Y})}function dh($,Z){let J=N0(Z);return J.preventUnmountOnClose=()=>{$.set("preventUnmountingOnClose",!0)},J}var ZN=O(v(),1);var cJ=O(v(),1),ZK=cJ.createContext(void 0);function tL(){let $=cJ.useContext(ZK);if($===void 0)throw Error(M0(48));return $}var dJ=O(v(),1),eL=O(I8(),1);var $N=O(l(),1),lJ=dJ.forwardRef(function(Z,J){let{children:Q,container:X,className:G,render:H,...z}=Z,{portalNode:K,portalSubtree:Y}=TJ({container:X,ref:J,componentProps:Z,elementProps:z});if(!Y&&!K)return null;return $N.jsxs(dJ.Fragment,{children:[Y,K&&eL.createPortal(Q,K)]})});var JK=O(l(),1),JN=ZN.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z;if(!(L8().useState("mounted")||Q))return null;return JK.jsx(ZK.Provider,{value:Q,children:JK.jsx(lJ,{ref:J,...X})})});var iJ=O(v(),1);var k8=function($){return $.open="data-open",$.closed="data-closed",$[$.startingStyle=y4.startingStyle]="startingStyle",$[$.endingStyle=y4.endingStyle]="endingStyle",$.anchorHidden="data-anchor-hidden",$.side="data-side",$.align="data-align",$}({}),n3=function($){return $.popupOpen="data-popup-open",$.pressed="data-pressed",$}({}),lh={[n3.popupOpen]:""},ih={[n3.popupOpen]:"",[n3.pressed]:""},rh={[k8.open]:""},ah={[k8.closed]:""},sh={[k8.anchorHidden]:""},p4={open($){if($)return lh;return null}},o3={open($){if($)return ih;return null}},H1={open($){if($)return rh;return ah},anchorHidden($){if($)return sh;return null}};function c0($){return F8($,"base-ui")}var QN=iJ.forwardRef(function(Z,J){let{render:Q,className:X,delay:G,closeDelay:H,id:z,payload:K,handle:Y,...W}=Z,q=L8(!0),B=Y?.store??q;if(!B)throw Error(M0(89));let U=c0(z),F=B.useState("isTriggerActive",U),V=B.useState("isOpenedByTrigger",U),N=B.useState("floatingRootContext"),L=iJ.useRef(null),_=G??rL,w=H??pJ,{registerTrigger:A,isMountedByThisTrigger:D}=h4(U,L,B,{payload:K});Q0(()=>{if(D)B.context.closeDelayRef.current=w},[B,D,w]);let M=Y4(N,{mouseOnly:!0,move:!1,handleClose:W4(),delay:()=>({open:_,close:w}),triggerElementRef:L,isActiveTrigger:F}),j=y9(N,{delay:_}),T={open:V},E=B.useState("triggerProps",D);return W0("a",Z,{state:T,ref:[J,A,L],props:[M,j.reference,E,{id:U},W],stateAttributesMapping:p4})});var $$=O(v(),1);var rJ=O(v(),1),QK=rJ.createContext(void 0);function o6(){let $=rJ.useContext(QK);if($===void 0)throw Error(M0(49));return $}var E8=O(v(),1);var aJ=O(v(),1),nh=aJ.createContext(void 0);function g7(){return aJ.useContext(nh)?.direction??"ltr"}var oh=($)=>({name:"arrow",options:$,async fn(Z){let{x:J,y:Q,placement:X,rects:G,platform:H,elements:z,middlewareData:K}=Z,{element:Y,padding:W=0,offsetParent:q="real"}=GN($,Z)||{};if(Y==null)return{};let B=KN(W),U={x:J,y:Q},F=zN(X),V=HN(F),N=await H.getDimensions(Y),L=F==="y",_=L?"top":"left",w=L?"bottom":"right",A=L?"clientHeight":"clientWidth",D=G.reference[V]+G.reference[F]-U[F]-G.floating[V],M=U[F]-G.reference[F],j=q==="real"?await H.getOffsetParent?.(Y):z.floating,T=z.floating[A]||G.floating[V];if(!T||!await H.isElement?.(j))T=z.floating[A]||G.floating[V];let E=D/2-M/2,C=T/2-N[V]/2-1,g=Math.min(B[_],C),b=Math.min(B[w],C),k=g,x=T-N[V]-b,R=T/2-N[V]/2+E,I=XN(k,R,x),S=!K.arrow&&t3(X)!=null&&R!==I&&G.reference[V]/2-(R<k?g:b)-N[V]/2<0,h=S?R<k?R-k:R-x:0;return{[F]:U[F]+h,data:{[F]:I,centerOffset:R-I-h,...S&&{alignmentOffset:h}},reset:S}}}),YN=($,Z)=>({...oh($),options:[$,Z]});var WN={name:"hide",async fn($){let{width:Z,height:J,x:Q,y:X}=$.rects.reference,G=Z===0&&J===0&&Q===0&&X===0;return{data:{referenceHidden:(await ez().fn($)).data?.referenceHidden||G}}}};var e3={sideX:"left",sideY:"top"},t6={name:"adaptiveOrigin",async fn($){let{x:Z,y:J,rects:{floating:Q},elements:{floating:X},platform:G,strategy:H,placement:z}=$,K=j8(X),Y=K.getComputedStyle(X);if(!(Y.transitionDuration!=="0s"&&Y.transitionDuration!==""))return{x:Z,y:J,data:e3};let q=await G.getOffsetParent?.(X),B={width:0,height:0};if(H==="fixed"&&K?.visualViewport)B={width:K.visualViewport.width,height:K.visualViewport.height};else if(q===K){let _=p0(X);B={width:_.documentElement.clientWidth,height:_.documentElement.clientHeight}}else if(await G.isElement?.(q))B=await G.getDimensions(q);let U=g9(z),F=Z,V=J;if(U==="left")F=B.width-(Z+Q.width);if(U==="top")V=B.height-(J+Q.height);let N=U==="left"?"right":e3.sideX,L=U==="top"?"bottom":e3.sideY;return{x:F,y:V,data:{sideX:N,sideY:L}}}};function UN($,Z,J){let Q=$==="inline-start"||$==="inline-end";return{top:"top",right:Q?J?"inline-start":"inline-end":"right",bottom:"bottom",left:Q?J?"inline-end":"inline-start":"left"}[Z]}function qN($,Z,J){let{rects:Q,placement:X}=$;return{side:UN(Z,g9(X),J),align:t3(X)||"center",anchor:{width:Q.reference.width,height:Q.reference.height},positioner:{width:Q.floating.width,height:Q.floating.height}}}function f7($){let{anchor:Z,positionMethod:J="absolute",side:Q="bottom",sideOffset:X=0,align:G="center",alignOffset:H=0,collisionBoundary:z,collisionPadding:K=5,sticky:Y=!1,arrowPadding:W=5,disableAnchorTracking:q=!1,keepMounted:B=!1,floatingRootContext:U,mounted:F,collisionAvoidance:V,shiftCrossAxis:N=!1,nodeId:L,adaptiveOrigin:_,lazyFlip:w=!1,externalTree:A}=$,[D,M]=E8.useState(null);if(!F&&D!==null)M(null);let j=V.side||"flip",T=V.align||"flip",E=V.fallbackAxisSide||"end",C=typeof Z==="function"?Z:void 0,g=H0(C),b=C?g:Z,k=D5(Z),R=g7()==="rtl",I=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":R?"left":"right","inline-start":R?"right":"left"}[Q],S=G==="center"?I:`${I}-${G}`,h=K,p=1,P=Q==="bottom"?p:0,t=Q==="top"?p:0,z0=Q==="right"?p:0,y=Q==="left"?p:0;if(typeof h==="number")h={top:h+P,right:h+y,bottom:h+t,left:h+z0};else if(h)h={top:(h.top||0)+P,right:(h.right||0)+y,bottom:(h.bottom||0)+t,left:(h.left||0)+z0};let n={boundary:z==="clipping-ancestors"?"clippingAncestors":z,padding:h},_0=E8.useRef(null),c=D5(X),X0=D5(H),G0=[az((m0)=>{let X1=qN(m0,Q,R),q5=typeof c.current==="function"?c.current(X1):c.current,v1=typeof X0.current==="function"?X0.current(X1):X0.current;return{mainAxis:q5,crossAxis:v1,alignmentAxis:v1}},[typeof X!=="function"?X:0,typeof H!=="function"?H:0,R,Q])],U0=T==="none"&&j!=="shift",m=!U0&&(Y||N||j==="shift"),s=j==="none"?null:oz({...n,padding:{top:h.top+p,right:h.right+p,bottom:h.bottom+p,left:h.left+p},mainAxis:!N&&j==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:E}),u=U0?null:sz((m0)=>{let X1=p0(m0.elements.floating).documentElement;return{...n,rootBoundary:N?{x:0,y:0,width:X1.clientWidth,height:X1.clientHeight}:void 0,mainAxis:T!=="none",crossAxis:m,limiter:Y||N?void 0:nz((q5)=>{if(!_0.current)return{};let{width:v1,height:B5}=_0.current.getBoundingClientRect(),E0=XK(g9(q5.placement)),x0=E0==="y"?v1:B5,r0=E0==="y"?h.left+h.right:h.top+h.bottom;return{offset:x0/2+r0/2}})}},[n,Y,N,h,T]);if(j==="shift"||T==="shift"||G==="center")G0.push(u,s);else G0.push(s,u);G0.push(tz({...n,apply({elements:{floating:m0},rects:{reference:X1},availableWidth:q5,availableHeight:v1}){let B5=m0.style;B5.setProperty("--available-width",`${q5}px`),B5.setProperty("--available-height",`${v1}px`),B5.setProperty("--anchor-width",`${X1.width}px`),B5.setProperty("--anchor-height",`${X1.height}px`)}}),YN(()=>({element:_0.current||document.createElement("div"),padding:W,offsetParent:"floating"}),[W]),{name:"transformOrigin",fn(m0){let{elements:X1,middlewareData:q5,placement:v1,rects:B5,y:E0}=m0,x0=g9(v1),r0=XK(x0),a0=_0.current,Y1=q5.arrow?.x||0,F1=q5.arrow?.y||0,C1=a0?.clientWidth||0,p1=a0?.clientHeight||0,K1=Y1+C1/2,c1=F1+p1/2,z5=Math.abs(q5.shift?.y||0),U5=B5.reference.height/2,P0=typeof X==="function"?X(qN(m0,Q,R)):X,u0=z5>P0,k0={top:`${K1}px calc(100% + ${P0}px)`,bottom:`${K1}px ${-P0}px`,left:`calc(100% + ${P0}px) ${c1}px`,right:`${-P0}px ${c1}px`}[x0],s0=`${K1}px ${B5.reference.y+U5-E0}px`;return X1.floating.style.setProperty("--transform-origin",m&&r0==="y"&&u0?s0:k0),{}}},WN,_),Q0(()=>{if(!F&&U)U.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[F,U]);let F0=E8.useMemo(()=>({elementResize:!q&&typeof ResizeObserver<"u",layoutShift:!q&&typeof IntersectionObserver<"u"}),[q]),{refs:i,elements:Y0,x:r,y:e,middlewareData:q0,update:a,placement:A0,context:I0,isPositioned:i0,floatingStyles:z1}=uz({rootContext:U,placement:S,middleware:G0,strategy:J,whileElementsMounted:B?void 0:(...m0)=>mJ(...m0,F0),nodeId:L,externalTree:A}),{sideX:f,sideY:d}=q0.adaptiveOrigin||e3,$0=i0?J:"fixed",V0=E8.useMemo(()=>{let m0=_?{position:$0,[f]:r,[d]:e}:{position:$0,...z1};if(!i0)m0.opacity=0;return m0},[_,$0,f,r,d,e,z1,i0]),j0=E8.useRef(null);Q0(()=>{if(!F)return;let m0=k.current,X1=typeof m0==="function"?m0():m0,v1=(BN(X1)?X1.current:X1)||null||null;if(v1!==j0.current)i.setPositionReference(v1),j0.current=v1},[F,i,b,k]),E8.useEffect(()=>{if(!F)return;let m0=k.current;if(typeof m0==="function")return;if(BN(m0)&&m0.current!==j0.current)i.setPositionReference(m0.current),j0.current=m0.current},[F,i,b,k]),E8.useEffect(()=>{if(B&&F&&Y0.domReference&&Y0.floating)return mJ(Y0.domReference,Y0.floating,a,F0);return},[B,F,Y0,a,F0]);let g0=g9(A0),D1=UN(Q,g0,R),h1=t3(A0)||"center",h0=Boolean(q0.hide?.referenceHidden);Q0(()=>{if(w&&F&&i0)M(g0)},[w,F,i0,g0]);let d0=E8.useMemo(()=>({position:"absolute",top:q0.arrow?.y,left:q0.arrow?.x}),[q0.arrow]),t0=q0.arrow?.centerOffset!==0;return E8.useMemo(()=>({positionerStyles:V0,arrowStyles:d0,arrowRef:_0,arrowUncentered:t0,side:D1,align:h1,physicalSide:g0,anchorHidden:h0,refs:i,context:I0,isPositioned:i0,update:a}),[V0,d0,_0,t0,D1,h1,g0,h0,i,I0,i0,a])}function BN($){return $!=null&&"current"in $}function a5($){return $==="starting"?SU:e0}var FN=O(l(),1),VN=$$.forwardRef(function(Z,J){let{render:Q,className:X,anchor:G,positionMethod:H="absolute",side:z="bottom",align:K="center",sideOffset:Y=0,alignOffset:W=0,collisionBoundary:q="clipping-ancestors",collisionPadding:B=5,arrowPadding:U=5,sticky:F=!1,disableAnchorTracking:V=!1,collisionAvoidance:N=C7,...L}=Z,_=L8(),w=tL(),A=_.useState("open"),D=_.useState("mounted"),M=_.useState("floatingRootContext"),j=_.useState("instantType"),T=_.useState("transitionStatus"),E=_.useState("hasViewport"),C=f7({anchor:G,floatingRootContext:M,positionMethod:H,mounted:D,side:z,sideOffset:Y,align:K,alignOffset:W,arrowPadding:U,collisionBoundary:q,collisionPadding:B,sticky:F,disableAnchorTracking:V,keepMounted:w,collisionAvoidance:N,adaptiveOrigin:E?t6:void 0}),g=$$.useMemo(()=>{let R={};if(!A)R.pointerEvents="none";return{role:"presentation",hidden:!D,style:{...C.positionerStyles,...R}}},[A,D,C.positionerStyles]),b={open:A,side:C.side,align:C.align,anchorHidden:C.anchorHidden,instant:j},k=$$.useMemo(()=>({side:C.side,align:C.align,arrowRef:C.arrowRef,arrowUncentered:C.arrowUncentered,arrowStyles:C.arrowStyles}),[C.side,C.align,C.arrowRef,C.arrowUncentered,C.arrowStyles]),x=W0("div",Z,{state:b,props:[g,a5(T),L],ref:[J,_.useStateSetter("positionerElement")],stateAttributesMapping:H1});return FN.jsx(QK.Provider,{value:k,children:x})});var LN=O(v(),1);var th={...H1,...P1},NN=LN.forwardRef(function(Z,J){let{className:Q,render:X,...G}=Z,H=L8(),{side:z,align:K}=o6(),Y=H.useState("open"),W=H.useState("instantType"),q=H.useState("transitionStatus"),B=H.useState("popupProps"),U=H.useState("floatingRootContext");L5({open:Y,ref:H.context.popupRef,onComplete(){if(Y)H.context.onOpenChangeComplete?.(!0)}});let F=H0(()=>H.context.closeDelayRef.current);return z7(U,{closeDelay:F}),W0("div",Z,{state:{open:Y,side:z,align:K,instant:W,transitionStatus:q},ref:[J,H.context.popupRef,H.useStateSetter("popupElement")],props:[B,a5(q),G],stateAttributesMapping:th})});var _N=O(v(),1);var MN=_N.forwardRef(function(Z,J){let{render:Q,className:X,...G}=Z,H=L8(),{arrowRef:z,side:K,align:Y,arrowUncentered:W,arrowStyles:q}=o6(),U={open:H.useState("open"),side:K,align:Y,uncentered:W};return W0("div",Z,{state:U,ref:[z,J],props:[{style:q,"aria-hidden":!0},G],stateAttributesMapping:H1})});var AN=O(v(),1);var eh={...H1,...P1},DN=AN.forwardRef(function(Z,J){let{render:Q,className:X,...G}=Z,H=L8(),z=H.useState("open"),K=H.useState("mounted"),Y=H.useState("transitionStatus");return W0("div",Z,{state:{open:z,transitionStatus:Y},ref:[J],props:[{role:"presentation",hidden:!K,style:{pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none"}},G],stateAttributesMapping:eh})});var TN=O(v(),1);var wN=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var s5=O(v(),1);function m7($){if(S6(19))return $;return $?"true":void 0}var ON=O(v(),1);function PN($){let[Z,J]=ON.useState({current:$,previous:null});if($!==Z.current)J({current:$,previous:Z.current});return Z.previous}var f9=O(v(),1);function HK($){let Z=r6($),J=parseFloat(Z.width)||0,Q=parseFloat(Z.height)||0,X=b1($),G=X?$.offsetWidth:J,H=X?$.offsetHeight:Q;if(GK(J)!==G||GK(Q)!==H)J=G,Q=H;return{width:J,height:Q}}var $v=typeof ResizeObserver<"u",Zv=()=>!0;function CN($){let{popupElement:Z,positionerElement:J,content:Q,mounted:X,enabled:G=Zv,onMeasureLayout:H,onMeasureLayoutComplete:z,side:K,direction:Y}=$,W=x4(Z,!0,!1),q=u8(),B=f9.useRef(null),U=f9.useRef(null),F=f9.useRef(!0),V=f9.useRef(w1),N=H0(H),L=H0(z),_=f9.useMemo(()=>{let w=K==="top",A=K==="left";if(Y==="rtl")w=w||K==="inline-end",A=A||K==="inline-end";else w=w||K==="inline-start",A=A||K==="inline-start";return w?{position:"absolute",[K==="top"?"bottom":"top"]:"0",[A?"right":"left"]:"0"}:e0},[K,Y]);Q0(()=>{if(!X||!G()||!$v){V.current=w1,F.current=!0,B.current=null,U.current=null;return}if(!Z||!J)return;V.current=jN(Z,_);let w=new ResizeObserver((k)=>{let x=k[0];if(x)U.current={width:Math.ceil(x.borderBoxSize[0].inlineSize),height:Math.ceil(x.borderBoxSize[0].blockSize)}});w.observe(Z),sJ(Z,"auto");let A=nJ(Z,"position","static"),D=nJ(Z,"transform","none"),M=nJ(Z,"scale","1"),j=jN(J,{"--available-width":"max-content","--available-height":"max-content"});function T(){A(),D(),j()}function E(){T(),M()}if(N?.(),F.current||B.current===null){Z$(J,"max-content");let k=HK(Z);return B.current=k,Z$(J,k),E(),L?.(null,k),F.current=!1,()=>{w.disconnect(),V.current(),V.current=w1}}sJ(Z,"auto"),Z$(J,"max-content");let C=B.current??U.current,g=HK(Z);if(B.current=g,!C)return Z$(J,g),E(),L?.(null,g),()=>{w.disconnect(),q.cancel(),V.current(),V.current=w1};sJ(Z,C),E(),L?.(C,g),Z$(J,g);let b=new AbortController;return q.request(()=>{sJ(Z,g),W(()=>{Z.style.setProperty("--popup-width","auto"),Z.style.setProperty("--popup-height","auto")},b.signal)}),()=>{w.disconnect(),b.abort(),q.cancel(),V.current(),V.current=w1}},[Q,Z,J,W,q,G,X,N,L,_])}function nJ($,Z,J){let Q=$.style.getPropertyValue(Z);return $.style.setProperty(Z,J),()=>{$.style.setProperty(Z,Q)}}function jN($,Z){let J=[];for(let[Q,X]of Object.entries(Z))J.push(nJ($,Q,X));return J.length?()=>{J.forEach((Q)=>Q())}:w1}function sJ($,Z){let J=Z==="auto"?"auto":`${Z.width}px`,Q=Z==="auto"?"auto":`${Z.height}px`;$.style.setProperty("--popup-width",J),$.style.setProperty("--popup-height",Q)}function Z$($,Z){let J=Z==="max-content"?"max-content":`${Z.width}px`,Q=Z==="max-content"?"max-content":`${Z.height}px`;$.style.setProperty("--positioner-width",J),$.style.setProperty("--positioner-height",Q)}var e6=O(l(),1);function $2($){let{store:Z,side:J,cssVars:Q,children:X}=$,G=g7(),H=Z.useState("activeTriggerElement"),z=Z.useState("activeTriggerId"),K=Z.useState("open"),Y=Z.useState("payload"),W=Z.useState("mounted"),q=Z.useState("popupElement"),B=Z.useState("positionerElement"),U=PN(K?H:null),F=Xv(z,Y),V=s5.useRef(null),[N,L]=s5.useState(null),[_,w]=s5.useState(null),A=s5.useRef(null),D=s5.useRef(null),M=x4(A,!0,!1),j=u8(),[T,E]=s5.useState(null),[C,g]=s5.useState(!1);Q0(()=>{return Z.set("hasViewport",!0),()=>{Z.set("hasViewport",!1)}},[Z]);let b=H0(()=>{A.current?.style.setProperty("animation","none"),A.current?.style.setProperty("transition","none"),D.current?.style.setProperty("display","none")}),k=H0((h)=>{if(A.current?.style.removeProperty("animation"),A.current?.style.removeProperty("transition"),D.current?.style.removeProperty("display"),h)E(h)}),x=s5.useRef(null);Q0(()=>{if(H&&U&&H!==U&&x.current!==H&&V.current){L(V.current),g(!0);let h=Qv(U,H);w(h),j.request(()=>{j.request(()=>{g(!1),M(()=>{L(null),E(null),V.current=null})})}),x.current=H}},[H,U,N,M,j]),Q0(()=>{let h=A.current;if(!h)return;let p=document.createElement("div");for(let P of Array.from(h.childNodes))p.appendChild(P.cloneNode(!0));V.current=p});let R=N!=null,I;if(!R)I=e6.jsx("div",{"data-current":!0,ref:A,children:X},F);else I=e6.jsxs(s5.Fragment,{children:[e6.jsx("div",{"data-previous":!0,inert:m7(!0),ref:D,style:{[Q.popupWidth]:`${T?.width}px`,[Q.popupHeight]:`${T?.height}px`,position:"absolute"},"data-ending-style":C?void 0:""},"previous"),e6.jsx("div",{"data-current":!0,ref:A,"data-starting-style":C?"":void 0,children:X},F)]});Q0(()=>{let h=D.current;if(!h||!N)return;h.replaceChildren(...Array.from(N.childNodes))},[N]),CN({popupElement:q,positionerElement:B,mounted:W,content:Y,onMeasureLayout:b,onMeasureLayoutComplete:k,side:J,direction:G});let S={activationDirection:Jv(_),transitioning:R};return{children:I,state:S}}function Jv($){if(!$)return;return`${IN($.horizontal,5,"right","left")} ${IN($.vertical,5,"down","up")}`}function IN($,Z,J,Q){if($>Z)return J;if($<-Z)return Q;return""}function Qv($,Z){let J=$.getBoundingClientRect(),Q=Z.getBoundingClientRect(),X={x:J.left+J.width/2,y:J.top+J.height/2},G={x:Q.left+Q.width/2,y:Q.top+Q.height/2};return{horizontal:G.x-X.x,vertical:G.y-X.y}}function Xv($,Z){let[J,Q]=s5.useState(0),X=s5.useRef($),G=s5.useRef(Z),H=s5.useRef(!1);return Q0(()=>{let z=X.current,K=G.current,Y=$!==z,W=Z!==K;if(Y)Q((q)=>q+1),H.current=!W;else if(H.current&&W)Q((q)=>q+1),H.current=!1;X.current=$,G.current=Z},[$,Z]),`${$??"current"}-${J}`}var Gv={activationDirection:($)=>$?{"data-activation-direction":$}:null},kN=TN.forwardRef(function(Z,J){let{render:Q,className:X,children:G,...H}=Z,z=L8(),K=o6(),Y=z.useState("instantType"),{children:W,state:q}=$2({store:z,side:K.side,cssVars:wN,children:G}),B={activationDirection:q.activationDirection,transitioning:q.transitioning,instant:Y};return W0("div",Z,{state:B,ref:J,props:[H,{children:W}],stateAttributesMapping:Gv})});class oJ{constructor(){this.store=new n6}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(M0(88,$));this.store.setOpen(!0,N0(o.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,N0(o.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function EN(){return new oJ}var Z2=O(l(),1);function SN({...$}){return Z2.jsx(u7.Root,{"data-slot":"hover-card",...$})}function RN({...$}){return Z2.jsx(u7.Trigger,{"data-slot":"hover-card-trigger",...$})}function bN({className:$,side:Z="bottom",sideOffset:J=4,align:Q="center",alignOffset:X=4,...G}){return Z2.jsx(u7.Portal,{"data-slot":"hover-card-portal",children:Z2.jsx(u7.Positioner,{align:Q,alignOffset:X,side:Z,sideOffset:J,className:"isolate z-50",children:Z2.jsx(u7.Popup,{"data-slot":"hover-card-content",className:B0("z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-border 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",$),...G})})})}var m9=O(v(),1);function tJ(){let $=m9.useRef(null),[Z,J]=m9.useState(!1),[Q,X]=m9.useState(!1);return m9.useEffect(()=>{let G=$.current;if(!G)return;let H=()=>{let z=G.scrollTop<=1,K=G.scrollTop+G.clientHeight>=G.scrollHeight-1,Y=G.scrollHeight>G.clientHeight+1;J(Y&&!z),X(Y&&!K)};return H(),G.addEventListener("scroll",H,{passive:!0}),window.addEventListener("resize",H),()=>{G.removeEventListener("scroll",H),window.removeEventListener("resize",H)}},[]),{ref:$,showTopFade:Z,showBottomFade:Q}}var q4=O(v(),1);var p7={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function yN($){return F5({queryKey:T0.layout($),queryFn:()=>f1(`/api/workspaces/${$}`),...p7})}function xN($){return F5({queryKey:T0.widgets($),queryFn:async()=>{return(await f1(`/api/workspaces/${$}/widgets`)).widgets},...p7})}function hN($){return F5({queryKey:T0.views($),queryFn:async()=>{return(await f1(`/api/workspaces/${$}/views`)).views},...p7})}function vN($){return c5({mutationFn:(Z)=>M9(`/api/workspaces/${$}`,Q4("PUT",Z),"Failed to save layout")})}var uN=O(l(),1),Hv={version:1,widgetGrid:[],layoutMode:"fullscreen",tabs:{open:["agent"],active:"agent"}},fN=q4.createContext(null);function Q5(){let $=q4.useContext(fN);if(!$)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return $}function gN($){let{cwd:Z,name:J,provider:Q,agentId:X,...G}=$;return G}function mN({id:$,children:Z}){let J=I1(),Q=yN($),X=vN($),G=q4.useRef(X.mutate);G.current=X.mutate;let H=q4.useRef(null),z=q4.useCallback((Y)=>{let W=T0.layout($),q=J.getQueryData(W);if(!q)return;let B={...q,...Y};if(J.setQueryData(W,B),H.current)clearTimeout(H.current);H.current=setTimeout(()=>{H.current=null,G.current(gN(B))},600)},[$,J]),K=q4.useMemo(()=>({layout:Q.data?gN(Q.data):Hv,setLayout:z,name:Q.data?.name??null,icon:Q.data?.icon??null,cwd:Q.data?.cwd??null,provider:Q.data?.provider??null,workspaceId:$,isLoading:Q.isLoading}),[Q.data,Q.isLoading,z,$]);return uN.jsx(fN,{value:K,children:Z})}var x1=O(l(),1);function zv($){if($==="needs-auth")return"Needs auth";return $[0].toUpperCase()+$.slice(1)}function Kv({status:$}){return x1.jsx("span",{className:B0("size-[5px] shrink-0 rounded-full",$==="connected"?"bg-emerald-500":"bg-yellow-500")})}function cN({name:$,status:Z,size:J="sm"}){let Q=nZ($),X=J==="lg",G="size-full rounded-sm ring-2 ring-background";return x1.jsxs("span",{className:B0("relative shrink-0",X?"size-10":"size-5"),children:[Q?x1.jsx("img",{src:Q,alt:"",className:"size-full rounded-sm ring-2 ring-background"}):x1.jsx("span",{className:B0("flex size-full items-center justify-center bg-muted text-muted-foreground ring-2 ring-background",X?"rounded-sm":"rounded"),children:x1.jsx(oZ,{className:X?"size-5":"size-4"})}),X&&Z!=="connected"&&x1.jsx(pN,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function zK($){return[...$].sort((Z,J)=>Number(J.status==="connected")-Number(Z.status==="connected"))}function Yv({server:$}){return x1.jsxs("div",{className:"flex items-center gap-2.5 rounded-xs px-2 py-1 text-foreground hover:bg-accent hover:text-accent-foreground",children:[x1.jsx(cN,{name:$.name,status:$.status}),x1.jsx("span",{className:"flex-1 truncate text-sm",children:k3($.name)}),x1.jsx(Kv,{status:$.status})]})}function dN({server:$}){return x1.jsxs("div",{className:"flex min-h-20 items-center gap-3 rounded-xl border border-border bg-card px-4 py-3 text-card-foreground",children:[x1.jsx(cN,{name:$.name,status:$.status,size:"lg"}),x1.jsxs("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:[x1.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:k3($.name)}),x1.jsx("span",{className:"text-sm text-muted-foreground",children:zv($.status)})]})]})}function Wv({servers:$}){let{ref:Z,showTopFade:J,showBottomFade:Q}=tJ();return x1.jsx("div",{ref:Z,className:B0("scrollbar-none flex max-h-72 flex-col overflow-y-auto overscroll-contain",J&&Q?"mask-fade-y":J?"mask-fade-top":Q?"mask-fade-bottom":void 0),children:$.map((G)=>x1.jsx(Yv,{server:G},G.name))})}function lN(){let $=P8(),{provider:Z,isLoading:J}=Q5(),Q=!J&&Z!=="openclaw"&&Z!=="hermes",{data:X}=xV($,Q);if(!Q)return null;if(!X||X.length===0)return null;let G=x1.jsx(C0,{variant:"ghost",size:"icon-sm","aria-label":"Connectors",title:"Connectors",children:x1.jsx(J2,{stroke:1.75})}),H=zK(X);return x1.jsxs(SN,{children:[x1.jsx(RN,{render:G,delay:0,closeDelay:100}),x1.jsxs(bN,{align:"end",sideOffset:6,className:"w-56 p-1",children:[x1.jsx("div",{className:"px-2 pt-1 pb-1.5 text-xs font-medium text-muted-foreground",children:"Project connectors"}),x1.jsx(Wv,{servers:H})]})]})}function qv($,Z){let J=$??[],Q=J.findIndex((X)=>X.id===Z.id||X.path===Z.path);if(Q===-1)return[...J,Z];return J.map((X,G)=>G===Q?{...X,...Z}:X)}function eJ(){return F5({queryKey:T0.all,queryFn:()=>f1("/api/workspaces"),staleTime:1/0,refetchOnMount:"always"})}function iN($){return F5({queryKey:T0.preview($),queryFn:()=>f1(`/api/workspaces/${$}/preview`),staleTime:60000})}function rN(){return F5({queryKey:T0.discover,queryFn:()=>f1("/api/workspaces/discover")})}function $Q(){let $=I1();return c5({mutationFn:(Z)=>f1("/api/workspaces",Q4("POST",Z),"Failed to add space"),onSuccess:(Z,J)=>{$.setQueryData(T0.all,(Q)=>qv(Q,Z)),$.setQueryData(T0.discover,(Q)=>(Q??[]).filter((X)=>X.path!==J.path))}})}function aN(){return F5({queryKey:T0.createInfo,queryFn:()=>f1("/api/workspaces/create"),staleTime:1/0})}function sN(){return c5({mutationFn:()=>f1("/api/workspaces/choose-folder",{method:"POST"},"Failed to choose folder")})}function nN(){let $=I1();return c5({mutationFn:(Z)=>f1("/api/workspaces/create",Q4("POST",Z),"Failed to create space"),onSuccess:(Z)=>{$.setQueryData(T0.all,(J)=>[...J??[],Z])}})}function oN(){let $=I1();return c5({mutationFn:(Z)=>f1("/api/workspaces/order",Q4("PUT",{ids:Z}),"Failed to reorder spaces"),onMutate:async(Z)=>{await $.cancelQueries({queryKey:T0.all,exact:!0});let J=$.getQueryData(T0.all);if(J){let Q=new Map(J.map((G)=>[G.id,G])),X=Z.map((G)=>Q.get(G)).filter((G)=>Boolean(G));if(X.length===J.length)$.setQueryData(T0.all,X)}return{previous:J}},onError:(Z,J,Q)=>{if(Q?.previous)$.setQueryData(T0.all,Q.previous);$.invalidateQueries({queryKey:T0.all,exact:!0})},onSuccess:(Z)=>{$.setQueryData(T0.all,Z)}})}function tN(){let $=I1();return c5({mutationFn:(Z)=>M9(`/api/workspaces/${Z}`,{method:"DELETE"},"Failed to remove space"),onSuccess:(Z,J)=>{$.setQueryData(T0.all,(Q)=>(Q??[]).filter((X)=>X.id!==J)),$.invalidateQueries({queryKey:T0.discover})}})}var W$=O(v(),1);var B4={};G4(B4,{createHandle:()=>y_,Viewport:()=>E_,Trigger:()=>b_,Title:()=>R_,Root:()=>T_,Portal:()=>M_,Popup:()=>V_,Handle:()=>zQ,Description:()=>X_,Close:()=>J_,Backdrop:()=>$_});var eN=O(v(),1);var ZQ=O(v(),1),KK=ZQ.createContext(void 0);function E5($){let Z=ZQ.useContext(KK);if($===!1&&Z===void 0)throw Error(M0(27));return Z}var Bv={...H1,...P1},$_=eN.forwardRef(function(Z,J){let{render:Q,className:X,forceRender:G=!1,...H}=Z,{store:z}=E5(),K=z.useState("open"),Y=z.useState("nested"),W=z.useState("mounted"),q=z.useState("transitionStatus");return W0("div",Z,{state:{open:K,transitionStatus:q},ref:[z.context.backdropRef,J],stateAttributesMapping:Bv,props:[{role:"presentation",hidden:!W,style:{userSelect:"none",WebkitUserSelect:"none"}},H],enabled:G||!Y})});var Z_=O(v(),1);var J_=Z_.forwardRef(function(Z,J){let{render:Q,className:X,disabled:G=!1,nativeButton:H=!0,...z}=Z,{store:K}=E5(),Y=K.useState("open");function W(F){if(Y)K.setOpen(!1,N0(o.closePress,F.nativeEvent))}let{getButtonProps:q,buttonRef:B}=M5({disabled:G,native:H});return W0("button",Z,{state:{disabled:G},ref:[J,B],props:[{onClick:W},z,q]})});var Q_=O(v(),1);var X_=Q_.forwardRef(function(Z,J){let{render:Q,className:X,id:G,...H}=Z,{store:z}=E5(),K=c0(G);return z.useSyncedValueWithCleanup("descriptionElementId",K),W0("p",Z,{ref:J,props:[{id:K},H]})});var U_=O(v(),1);var G_=function($){return $.nestedDialogs="--nested-dialogs",$}({});var H_=function($){return $[$.open=k8.open]="open",$[$.closed=k8.closed]="closed",$[$.startingStyle=k8.startingStyle]="startingStyle",$[$.endingStyle=k8.endingStyle]="endingStyle",$.nested="data-nested",$.nestedDialogOpen="data-nested-dialog-open",$}({});var JQ=O(v(),1),YK=JQ.createContext(void 0);function QQ(){let $=JQ.useContext(YK);if($===void 0)throw Error(M0(26));return $}var z_="ArrowUp",K_="ArrowDown",Y_="ArrowLeft",W_="ArrowRight",q_="Home",B_="End",Uv=new Set([Y_,W_]);var Fv=new Set([z_,K_]);var Vv=new Set([...Uv,...Fv]),LQ0=new Set([...Vv,q_,B_]),Q2=new Set([z_,K_,Y_,W_,q_,B_]);var F_=O(l(),1),Lv={...H1,...P1,nestedDialogOpen($){return $?{[H_.nestedDialogOpen]:""}:null}},V_=U_.forwardRef(function(Z,J){let{className:Q,finalFocus:X,initialFocus:G,render:H,...z}=Z,{store:K}=E5(),Y=K.useState("descriptionElementId"),W=K.useState("disablePointerDismissal"),q=K.useState("floatingRootContext"),B=K.useState("popupProps"),U=K.useState("modal"),F=K.useState("mounted"),V=K.useState("nested"),N=K.useState("nestedOpenDialogCount"),L=K.useState("open"),_=K.useState("openMethod"),w=K.useState("titleElementId"),A=K.useState("transitionStatus"),D=K.useState("role");QQ(),L5({open:L,ref:K.context.popupRef,onComplete(){if(L)K.context.onOpenChangeComplete?.(!0)}});function M(g){if(g==="touch")return K.context.popupRef.current;return!0}let j=G===void 0?M:G,T=N>0,C=W0("div",Z,{state:{open:L,nested:V,transitionStatus:A,nestedDialogOpen:T},props:[B,{"aria-labelledby":w??void 0,"aria-describedby":Y??void 0,role:D,tabIndex:-1,hidden:!F,onKeyDown(g){if(Q2.has(g.key))g.stopPropagation()},style:{[G_.nestedDialogs]:N}},z],ref:[J,K.context.popupRef,K.useStateSetter("popupElement")],stateAttributesMapping:Lv});return F_.jsx(S9,{context:q,openInteractionType:_,disabled:!F,closeOnFocusOut:!W,initialFocus:j,returnFocus:X,modal:U!==!1,restoreFocus:"popup",children:C})});var __=O(v(),1);var L_=O(v(),1),N_=O(l(),1),X2=L_.forwardRef(function(Z,J){let{cutout:Q,...X}=Z,G;if(Q){let H=Q?.getBoundingClientRect();G=`polygon(
68
- 0% 0%,
69
- 100% 0%,
70
- 100% 100%,
71
- 0% 100%,
72
- 0% 0%,
73
- ${H.left}px ${H.top}px,
74
- ${H.left}px ${H.bottom}px,
75
- ${H.right}px ${H.bottom}px,
76
- ${H.right}px ${H.top}px,
77
- ${H.left}px ${H.top}px
78
- )`}return N_.jsx("div",{ref:J,role:"presentation","data-base-ui-inert":"",...X,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:G}})});var J$=O(l(),1),M_=__.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z,{store:G}=E5(),H=G.useState("mounted"),z=G.useState("modal"),K=G.useState("open");if(!(H||Q))return null;return J$.jsx(YK.Provider,{value:Q,children:J$.jsxs(E9,{ref:J,...X,children:[H&&z===!0&&J$.jsx(X2,{ref:G.context.internalBackdropRef,inert:m7(!K)}),Z.children]})})});var C_=O(v(),1);var l8=O(v(),1);var A_={},D_={},w_="";function Nv($){if(typeof document>"u")return!1;let Z=p0($);return j8(Z).innerWidth-Z.documentElement.clientWidth>0}function _v($){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let J=p0($),Q=J.documentElement,X=J.body,G=XQ(Q)?Q:X,H=G.style.overflowY,z=Q.style.scrollbarGutter;Q.style.scrollbarGutter="stable",G.style.overflowY="scroll";let K=G.offsetWidth;G.style.overflowY="hidden";let Y=G.offsetWidth;return G.style.overflowY=H,Q.style.scrollbarGutter=z,K===Y}function Mv($){let Z=p0($),J=Z.documentElement,Q=Z.body,X=XQ(J)?J:Q,G={overflowY:X.style.overflowY,overflowX:X.style.overflowX};return Object.assign(X.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(X.style,G)}}function Av($){let Z=p0($),J=Z.documentElement,Q=Z.body,X=j8(J),G=0,H=0,z=!1,K=m1.create();if(JJ&&(X.visualViewport?.scale??1)!==1)return()=>{};function Y(){let B=X.getComputedStyle(J),U=X.getComputedStyle(Q),N=(B.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";G=J.scrollTop,H=J.scrollLeft,A_={scrollbarGutter:J.style.scrollbarGutter,overflowY:J.style.overflowY,overflowX:J.style.overflowX},w_=J.style.scrollBehavior,D_={position:Q.style.position,height:Q.style.height,width:Q.style.width,boxSizing:Q.style.boxSizing,overflowY:Q.style.overflowY,overflowX:Q.style.overflowX,scrollBehavior:Q.style.scrollBehavior};let L=J.scrollHeight>J.clientHeight,_=J.scrollWidth>J.clientWidth,w=B.overflowY==="scroll"||U.overflowY==="scroll",A=B.overflowX==="scroll"||U.overflowX==="scroll",D=Math.max(0,X.innerWidth-Q.clientWidth),M=Math.max(0,X.innerHeight-Q.clientHeight),j=parseFloat(U.marginTop)+parseFloat(U.marginBottom),T=parseFloat(U.marginLeft)+parseFloat(U.marginRight),E=XQ(J)?J:Q;if(z=_v($),z){J.style.scrollbarGutter=N,E.style.overflowY="hidden",E.style.overflowX="hidden";return}if(Object.assign(J.style,{scrollbarGutter:N,overflowY:"hidden",overflowX:"hidden"}),L||w)J.style.overflowY="scroll";if(_||A)J.style.overflowX="scroll";Object.assign(Q.style,{position:"relative",height:j||M?`calc(100dvh - ${j+M}px)`:"100dvh",width:T||D?`calc(100vw - ${T+D}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),Q.scrollTop=G,Q.scrollLeft=H,J.setAttribute("data-base-ui-scroll-locked",""),J.style.scrollBehavior="unset"}function W(){if(Object.assign(J.style,A_),Object.assign(Q.style,D_),!z)J.scrollTop=G,J.scrollLeft=H,J.removeAttribute("data-base-ui-scroll-locked"),J.style.scrollBehavior=w_}function q(){W(),K.request(Y)}return Y(),X.addEventListener("resize",q),()=>{if(K.cancel(),W(),typeof X.removeEventListener==="function")X.removeEventListener("resize",q)}}class O_{lockCount=0;restore=null;timeoutLock=y5.create();timeoutUnlock=y5.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 J=p0($).documentElement,Q=j8(J).getComputedStyle(J).overflowY;if(Q==="hidden"||Q==="clip"){this.restore=w1;return}let X=QJ||!Nv($);this.restore=X?Mv($):Av($)}}var Dv=new O_;function G2($=!0,Z=null){Q0(()=>{if(!$)return;return Dv.acquire(Z)},[$,Z])}var H2=O(v(),1);var Q$=O(v(),1);function P_($){let Z=Q$.useRef(""),J=Q$.useCallback((X)=>{if(X.defaultPrevented)return;Z.current=X.pointerType,$(X,X.pointerType)},[$]);return{onClick:Q$.useCallback((X)=>{if(X.detail===0){$(X,"keyboard");return}if("pointerType"in X)$(X,X.pointerType);else $(X,Z.current);Z.current=""},[$]),onPointerDown:J}}function z2($){let[Z,J]=H2.useState(null),Q=H0((z,K)=>{if(!$)J(K||(QJ?"touch":""))}),X=H2.useCallback(()=>{J(null)},[]),{onClick:G,onPointerDown:H}=P_(Q);return H2.useMemo(()=>({openMethod:Z,reset:X,triggerProps:{onClick:G,onPointerDown:H}}),[Z,X,G,H])}function j_($){let{store:Z,parentContext:J,actionsRef:Q}=$,X=Z.useState("open"),G=Z.useState("disablePointerDismissal"),H=Z.useState("modal"),z=Z.useState("popupElement"),{openMethod:K,triggerProps:Y,reset:W}=z2(X);v4(Z);let{forceUnmount:q}=g4(X,Z,()=>{W()}),B=H0((C)=>{let g=N0(C);return g.preventUnmountOnClose=()=>{Z.set("preventUnmountingOnClose",!0)},g}),U=l8.useCallback(()=>{Z.setOpen(!1,B(o.imperativeAction))},[Z,B]);l8.useImperativeHandle(Q,()=>({unmount:q,close:U}),[q,U]);let F=K4({popupStore:Z,onOpenChange:Z.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[V,N]=l8.useState(0),L=V===0,_=v9(F),w=z4(F,{outsidePressEvent(){if(Z.context.internalBackdropRef.current||Z.context.backdropRef.current)return"intentional";return{mouse:H==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(C){if(!Z.context.outsidePressEnabledRef.current)return!1;if("button"in C&&C.button!==0)return!1;if("touches"in C&&C.touches.length!==1)return!1;let g=y1(C);if(L&&!G){let b=g;if(H)return Z.context.internalBackdropRef.current||Z.context.backdropRef.current?Z.context.internalBackdropRef.current===b||Z.context.backdropRef.current===b||S0(b,z)&&!b?.hasAttribute("data-base-ui-portal"):!0;return!0}return!1},escapeKey:L});G2(X&&H===!0,z);let{getReferenceProps:A,getFloatingProps:D,getTriggerProps:M}=P5([_,w]);Z.useContextCallback("onNestedDialogOpen",(C)=>{N(C+1)}),Z.useContextCallback("onNestedDialogClose",()=>{N(0)}),l8.useEffect(()=>{if(J?.onNestedDialogOpen&&X)J.onNestedDialogOpen(V);if(J?.onNestedDialogClose&&!X)J.onNestedDialogClose();return()=>{if(J?.onNestedDialogClose&&X)J.onNestedDialogClose()}},[X,J,V]);let j=l8.useMemo(()=>A(Y),[A,Y]),T=l8.useMemo(()=>M(Y),[M,Y]),E=l8.useMemo(()=>D(),[D]);Z.useSyncedValues({openMethod:K,activeTriggerProps:j,inactiveTriggerProps:T,popupProps:E,floatingRootContext:F,nestedOpenDialogCount:V})}var GQ=O(v(),1);var wv={...m4,modal:w0(($)=>$.modal),nested:w0(($)=>$.nested),nestedOpenDialogCount:w0(($)=>$.nestedOpenDialogCount),disablePointerDismissal:w0(($)=>$.disablePointerDismissal),openMethod:w0(($)=>$.openMethod),descriptionElementId:w0(($)=>$.descriptionElementId),titleElementId:w0(($)=>$.titleElementId),viewportElement:w0(($)=>$.viewportElement),role:w0(($)=>$.role)};class X$ extends T8{constructor($){super(Ov($),{popupRef:GQ.createRef(),backdropRef:GQ.createRef(),internalBackdropRef:GQ.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new z8,onOpenChange:void 0,onOpenChangeComplete:void 0},wv)}setOpen=($,Z)=>{if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!$&&Z.trigger==null&&this.state.activeTriggerId!=null)Z.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.($,Z),Z.isCanceled)return;let J={open:$,nativeEvent:Z.event,reason:Z.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",J);let Q={open:$},X=Z.trigger?.id??null;if(X||$)Q.activeTriggerId=X,Q.activeTriggerElement=Z.trigger??null;this.update(Q)}}function Ov($={}){return{...f4(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...$}}var I_=O(l(),1);function T_($){let{children:Z,open:J,defaultOpen:Q=!1,onOpenChange:X,onOpenChangeComplete:G,disablePointerDismissal:H=!1,modal:z=!0,actionsRef:K,handle:Y,triggerId:W,defaultTriggerId:q=null}=$,B=E5(!0),U=Boolean(B),F=$1(()=>{return Y?.store??new X$({open:Q,openProp:J,activeTriggerId:q,triggerIdProp:W,modal:z,disablePointerDismissal:H,nested:U})}).current;k4(()=>{if(J===void 0&&F.state.open===!1&&Q===!0)F.update({open:!0,activeTriggerId:q})}),F.useControlledProp("openProp",J),F.useControlledProp("triggerIdProp",W),F.useSyncedValues({disablePointerDismissal:H,nested:U,modal:z}),F.useContextCallback("onOpenChange",X),F.useContextCallback("onOpenChangeComplete",G);let V=F.useState("payload");j_({store:F,actionsRef:K,parentContext:B?.store.context,onOpenChange:X,triggerIdProp:W});let N=C_.useMemo(()=>({store:F}),[F]);return I_.jsx(KK.Provider,{value:N,children:typeof Z==="function"?Z({payload:V}):Z})}var k_=O(v(),1);var WK=function($){return $[$.open=k8.open]="open",$[$.closed=k8.closed]="closed",$[$.startingStyle=k8.startingStyle]="startingStyle",$[$.endingStyle=k8.endingStyle]="endingStyle",$.nested="data-nested",$.nestedDialogOpen="data-nested-dialog-open",$}({});var Pv={...H1,...P1,nested($){return $?{[WK.nested]:""}:null},nestedDialogOpen($){return $?{[WK.nestedDialogOpen]:""}:null}},E_=k_.forwardRef(function(Z,J){let{className:Q,render:X,children:G,...H}=Z,z=QQ(),{store:K}=E5(),Y=K.useState("open"),W=K.useState("nested"),q=K.useState("transitionStatus"),B=K.useState("nestedOpenDialogCount"),U=K.useState("mounted"),F=B>0;return W0("div",Z,{enabled:z||U,state:{open:Y,nested:W,transitionStatus:q,nestedDialogOpen:F},ref:[J,K.useStateSetter("viewportElement")],stateAttributesMapping:Pv,props:[{role:"presentation",hidden:!U,style:{pointerEvents:!Y?"none":void 0},children:G},H]})});var S_=O(v(),1);var R_=S_.forwardRef(function(Z,J){let{render:Q,className:X,id:G,...H}=Z,{store:z}=E5(),K=c0(G);return z.useSyncedValueWithCleanup("titleElementId",K),W0("h2",Z,{ref:J,props:[{id:K},H]})});var HQ=O(v(),1);var b_=HQ.forwardRef(function(Z,J){let{render:Q,className:X,disabled:G=!1,nativeButton:H=!0,id:z,payload:K,handle:Y,...W}=Z,q=E5(!0),B=Y?.store??q?.store;if(!B)throw Error(M0(79));let U=c0(z),F=B.useState("floatingRootContext"),V=B.useState("isOpenedByTrigger",U),N=HQ.useRef(null),{registerTrigger:L,isMountedByThisTrigger:_}=h4(U,N,B,{payload:K}),{getButtonProps:w,buttonRef:A}=M5({disabled:G,native:H}),D=H7(F,{enabled:F!=null}),M=P5([D]),j={disabled:G,open:V},T=B.useState("triggerProps",_);return W0("button",Z,{state:j,ref:[A,J,L,N],props:[M.getReferenceProps(),T,{[b6]:"",id:U},W,w],stateAttributesMapping:p4})});class zQ{constructor($){this.store=$??new X$}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;this.store.setOpen(!0,N0(o.imperativeAction,void 0,Z))}openWithPayload($){this.store.set("payload",$),this.store.setOpen(!0,N0(o.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,N0(o.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function y_(){return new zQ}var c4=O(l(),1);function KQ({...$}){return c4.jsx(B4.Root,{"data-slot":"dialog",...$})}function x_({...$}){return c4.jsx(B4.Trigger,{"data-slot":"dialog-trigger",...$})}function YQ({...$}){return c4.jsx(B4.Close,{"data-slot":"dialog-close",...$})}function WQ({className:$,children:Z,...J}){return c4.jsxs(B4.Portal,{children:[c4.jsx(B4.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"}),c4.jsx(B4.Popup,{"data-slot":"dialog-content",className:B0("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 ring-1 ring-border 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",$),...J,children:Z})]})}function G$({className:$,...Z}){return c4.jsx(B4.Title,{"data-slot":"dialog-title",className:B0("text-lg font-semibold",$),...Z})}function h_({className:$,...Z}){return c4.jsx(B4.Description,{"data-slot":"dialog-description",className:B0("text-sm text-muted-foreground",$),...Z})}var t_=O(v(),1);var OQ={};G4(OQ,{Validity:()=>a_,Root:()=>m_,Label:()=>u_,Item:()=>o_,Error:()=>p_,Description:()=>d_,Control:()=>i_});var R5=O(v(),1);var qQ=O(v(),1);var qK=function($){return $.disabled="data-disabled",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.filled="data-filled",$.focused="data-focused",$}({});var u9={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},N8={valid($){if($===null)return null;if($)return{[qK.valid]:""};return{[qK.invalid]:""}}};var BK=qQ.createContext({invalid:void 0,name:void 0,validityData:{state:u9,errors:[],error:"",value:"",initialValue:null},setValidityData:w1,disabled:void 0,touched:!1,setTouched:w1,dirty:!1,setDirty:w1,filled:!1,setFilled:w1,focused:!1,setFocused:w1,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:($=e0)=>$,getInputValidationProps:($=e0)=>$,inputRef:{current:null},commit:async()=>{}}});function S5($=!0){let Z=qQ.useContext(BK);if(Z.setValidityData===w1&&!$)throw Error(M0(28));return Z}var BQ=O(v(),1),jv=BQ.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function v_($=!1){let Z=BQ.useContext(jv);if(!Z&&!$)throw Error(M0(86));return Z}var UQ=O(v(),1);var Cv=UQ.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:w1,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function d4(){return UQ.useContext(Cv)}var c7=O(v(),1);var FQ=O(v(),1);var UK=FQ.createContext({controlId:void 0,registerControlId:w1,labelId:void 0,setLabelId:w1,messageIds:[],setMessageIds:w1,getDescriptionProps:($)=>$});function n5(){return FQ.useContext(UK)}var g_=O(l(),1),VQ=function(Z){let J=c0(),[Q,X]=c7.useState(Z.initialControlId===void 0?J:Z.initialControlId),[G,H]=c7.useState(void 0),[z,K]=c7.useState([]),Y=$1(()=>new Map),{messageIds:W}=n5(),q=H0((F,V)=>{let N=Y.current;if(V===void 0){N.delete(F);return}N.set(F,V),X((L)=>{if(N.size===0)return;let _;for(let w of N.values()){if(L!==void 0&&w===L)return L;if(_===void 0)_=w}return _})}),B=c7.useCallback((F)=>{return d5({"aria-describedby":W.concat(z).join(" ")||void 0},F)},[W,z]),U=c7.useMemo(()=>({controlId:Q,registerControlId:q,labelId:G,setLabelId:H,messageIds:z,setMessageIds:K,getDescriptionProps:B}),[Q,q,G,H,z,K,B]);return g_.jsx(UK.Provider,{value:U,children:Z.children})};var c9=O(v(),1);function p9($,Z){return{...$,state:{...$.state,valid:!Z&&$.state.valid}}}var LQ=Object.keys(u9);function Iv($){if(!$||$.valid||!$.valueMissing)return!1;let Z=!1;for(let J of LQ){if(J==="valid")continue;if(J==="valueMissing")Z=$[J];if($[J])Z=!1}return Z}function f_($){let{formRef:Z,clearErrors:J}=d4(),{setValidityData:Q,validate:X,validityData:G,validationDebounceTime:H,invalid:z,markedDirtyRef:K,state:Y,name:W,shouldValidateOnChange:q}=$,{controlId:B,getDescriptionProps:U}=n5(),F=J5(),V=c9.useRef(null),N=H0(async(w,A=!1)=>{let D=V.current;if(!D)return;if(A){if(Y.valid!==!1)return;let k=D.validity;if(!k.valueMissing){let R={value:w,state:{...u9,valid:!0},error:"",errors:[],initialValue:G.initialValue};if(D.setCustomValidity(""),B){let I=Z.current.fields.get(B);if(I)Z.current.fields.set(B,{...I,...p9(R,!1)})}Q(R);return}let x=LQ.reduce((R,I)=>{return R[I]=k[I],R},{});if(!x.valid&&!Iv(x))return}function M(k){let x=LQ.reduce((I,S)=>{return I[S]=k.validity[S],I},{}),R=!1;for(let I of LQ){if(I==="valid")continue;if(I==="valueMissing"&&x[I])R=!0;else if(x[I])return x}if(R&&!K.current)x.valid=!0,x.valueMissing=!1;return x}F.clear();let j=null,T=[],E=M(D),C,g=q();if(D.validationMessage&&!g)C=D.validationMessage,T=[D.validationMessage];else{let k=Array.from(Z.current.fields.values()).reduce((R,I)=>{if(I.name)R[I.name]=I.getValue();return R},{}),x=X(w,k);if(typeof x==="object"&&x!==null&&"then"in x)j=await x;else j=x;if(j!==null){if(E.valid=!1,E.customError=!0,Array.isArray(j))T=j,D.setCustomValidity(j.join(`
79
- `));else if(j)T=[j],D.setCustomValidity(j)}else if(g){if(D.setCustomValidity(""),E.customError=!1,D.validationMessage)C=D.validationMessage,T=[D.validationMessage];else if(D.validity.valid&&!E.valid)E.valid=!0}}let b={value:w,state:E,error:C??(Array.isArray(j)?j[0]:j??""),errors:T,initialValue:G.initialValue};if(B){let k=Z.current.fields.get(B);if(k)Z.current.fields.set(B,{...k,...p9(b,z)})}Q(b)}),L=c9.useCallback((w={})=>d5(U,Y.valid===!1?{"aria-invalid":!0}:e0,w),[U,Y.valid]),_=c9.useCallback((w={})=>d5({onChange(A){if(A.nativeEvent.defaultPrevented)return;if(J(W),!q()){N(A.currentTarget.value,!0);return}if(z)return;let D=A.currentTarget;if(D.value===""){N(D.value);return}if(F.clear(),H)F.start(H,()=>{N(D.value)});else N(D.value)}},L(w)),[L,J,W,F,N,z,H,q]);return c9.useMemo(()=>({getValidationProps:L,getInputValidationProps:_,inputRef:V,commit:N}),[L,_,N])}var NQ=O(l(),1),Tv=R5.forwardRef(function(Z,J){let{errors:Q,validationMode:X,submitAttemptedRef:G}=d4(),{render:H,className:z,validate:K,validationDebounceTime:Y=0,validationMode:W=X,name:q,disabled:B=!1,invalid:U,dirty:F,touched:V,actionsRef:N,...L}=Z,{disabled:_}=v_(),w=H0(K||(()=>null)),A=_||B,[D,M]=R5.useState(!1),[j,T]=R5.useState(!1),[E,C]=R5.useState(!1),[g,b]=R5.useState(!1),k=F??j,x=V??D,R=R5.useRef(!1),I=H0((K0)=>{if(F!==void 0)return;if(K0)R.current=!0;T(K0)}),S=H0((K0)=>{if(V!==void 0)return;M(K0)}),h=H0(()=>W==="onChange"||W==="onSubmit"&&G.current),p=Boolean(U||q&&{}.hasOwnProperty.call(Q,q)&&Q[q]!==void 0),[P,t]=R5.useState({state:u9,error:"",errors:[],value:null,initialValue:null}),z0=!p&&P.state.valid,y=R5.useMemo(()=>({disabled:A,touched:x,dirty:k,valid:z0,filled:E,focused:g}),[A,x,k,z0,E,g]),n=f_({setValidityData:t,validate:w,validityData:P,validationDebounceTime:Y,invalid:p,markedDirtyRef:R,state:y,name:q,shouldValidateOnChange:h}),_0=R5.useCallback(()=>{R.current=!0,n.commit(P.value)},[n,P]);R5.useImperativeHandle(N,()=>({validate:_0}),[_0]);let c=R5.useMemo(()=>({invalid:p,name:q,validityData:P,setValidityData:t,disabled:A,touched:x,setTouched:S,dirty:k,setDirty:I,filled:E,setFilled:C,focused:g,setFocused:b,validate:w,validationMode:W,validationDebounceTime:Y,shouldValidateOnChange:h,state:y,markedDirtyRef:R,validation:n}),[p,q,P,A,x,S,k,I,E,C,g,b,w,W,Y,h,y,n]),X0=W0("div",Z,{ref:J,state:y,props:L,stateAttributesMapping:N8});return NQ.jsx(BK.Provider,{value:c,children:X0})}),m_=R5.forwardRef(function(Z,J){return NQ.jsx(VQ,{children:NQ.jsx(Tv,{...Z,ref:J})})});var H$=O(v(),1);var u_=H$.forwardRef(function(Z,J){let{render:Q,className:X,id:G,nativeLabel:H=!0,...z}=Z,K=S5(!1),{controlId:Y,setLabelId:W,labelId:q}=n5(),B=c0(G),U=H$.useRef(null),F=H0((N)=>{if(y1(N.nativeEvent)?.closest("button,input,select,textarea"))return;if(!N.defaultPrevented&&N.detail>1)N.preventDefault();if(H||!Y)return;let _=p0(N.currentTarget).getElementById(Y);if(b1(_))_.focus({focusVisible:!0})});return Q0(()=>{if(B)W(B);return()=>{W(void 0)}},[B,W]),W0("label",Z,{ref:[J,U],state:K.state,props:[{id:q},H?{htmlFor:Y??void 0,onMouseDown:F}:{onClick:F,onPointerDown(N){N.preventDefault()}},z],stateAttributesMapping:N8})});var d9=O(v(),1);var FK=O(l(),1),kv={...N8,...P1},p_=d9.forwardRef(function(Z,J){let{render:Q,id:X,className:G,match:H,...z}=Z,K=c0(X),{validityData:Y,state:W,name:q}=S5(!1),{setMessageIds:B}=n5(),{errors:U}=d4(),F=q?U[q]:null,V=!1;if(F||H===!0)V=!0;else if(H)V=Boolean(Y.state[H]);else V=Y.state.valid===!1;let{mounted:N,transitionStatus:L,setMounted:_}=d8(V);Q0(()=>{if(!V||!K)return;return B((b)=>b.concat(K)),()=>{B((b)=>b.filter((k)=>k!==K))}},[V,K,B]);let w=d9.useRef(null),[A,D]=d9.useState(null),[M,j]=d9.useState(null),T=F||(Y.errors.length>1?FK.jsx("ul",{children:Y.errors.map((b)=>FK.jsx("li",{children:b},b))}):Y.error),E=Y.error;if(F!=null)E=Array.isArray(F)?JSON.stringify(F):F;else if(Y.errors.length>1)E=JSON.stringify(Y.errors);if(V&&E!==M)j(E),D(T);L5({open:V,ref:w,onComplete(){if(!V)_(!1)}});let C={...W,transitionStatus:L},g=W0("div",Z,{ref:[J,w],state:C,props:[{id:K,children:V?T:A},z],stateAttributesMapping:kv,enabled:N});if(!N)return null;return g});var c_=O(v(),1);var d_=c_.forwardRef(function(Z,J){let{render:Q,id:X,className:G,...H}=Z,z=c0(X),K=S5(!1),{setMessageIds:Y}=n5();return Q0(()=>{if(!z)return;return Y((q)=>q.concat(z)),()=>{Y((q)=>q.filter((B)=>B!==z))}},[z,Y]),W0("p",Z,{ref:J,state:K.state,props:[{id:z},H],stateAttributesMapping:N8})});var AQ=O(v(),1);var l9=O(v(),1);function l4({controlled:$,default:Z,name:J,state:Q="value"}){let{current:X}=l9.useRef($!==void 0),[G,H]=l9.useState(Z),z=X?$:G,K=l9.useCallback((Y)=>{if(!X)H(Y)},[]);return[z,K]}var z$=O(v(),1);function _Q($={}){let{id:Z,implicit:J=!1,controlRef:Q}=$,{controlId:X,registerControlId:G}=n5(),H=c0(Z),z=J?X:void 0,K=$1(()=>Symbol("labelable-control")),Y=z$.useRef(!1),W=z$.useRef(Z!=null),q=H0(()=>{if(!Y.current||G===w1)return;Y.current=!1,G(K.current,void 0)});return Q0(()=>{if(G===w1)return;let B;if(J){let U=Q?.current;if(L1(U)&&U.closest("label")!=null)B=Z??null;else B=z??H}else if(Z!=null)W.current=!0,B=Z;else if(W.current)B=H;else{q();return}if(B===void 0){q();return}Y.current=!0,G(K.current,B);return},[Z,Q,z,G,J,H,K,q]),z$.useEffect(()=>{return q},[q]),X??H}var l_=O(I8(),1);function MQ($){let{enabled:Z=!0,value:J,id:Q,name:X,controlRef:G,commit:H}=$,{formRef:z}=d4(),{invalid:K,markedDirtyRef:Y,validityData:W,setValidityData:q}=S5(),B=H0($.getValue);Q0(()=>{if(!Z)return;let U=J;if(U===void 0)U=B();if(W.initialValue===null&&U!==null)q((F)=>({...F,initialValue:U}))},[Z,q,J,W.initialValue,B]),Q0(()=>{if(!Z||!Q)return;z.current.fields.set(Q,{getValue:B,name:X,controlRef:G,validityData:p9(W,K),validate(U=!0){let F=J;if(F===void 0)F=B();if(Y.current=!0,!U)H(F);else l_.flushSync(()=>H(F))}})},[H,G,Z,z,B,Q,K,Y,X,W,J]),Q0(()=>{let U=z.current.fields;return()=>{if(Q)U.delete(Q)}},[z,Q])}var i_=AQ.forwardRef(function(Z,J){let{render:Q,className:X,id:G,name:H,value:z,disabled:K=!1,onValueChange:Y,defaultValue:W,autoFocus:q=!1,...B}=Z,{state:U,name:F,disabled:V,setTouched:N,setDirty:L,validityData:_,setFocused:w,setFilled:A,validationMode:D,validation:M}=S5(),j=V||K,T=F??H,E={...U,disabled:j},{labelId:C}=n5(),g=_Q({id:G});Q0(()=>{let S=z!=null;if(M.inputRef.current?.value||S&&z!=="")A(!0);else if(S&&z==="")A(!1)},[M.inputRef,A,z]);let b=AQ.useRef(null);Q0(()=>{if(q&&b.current===x5(p0(b.current)))w(!0)},[q,w]);let[k]=l4({controlled:z,default:W,name:"FieldControl",state:"value"}),x=z!==void 0,R=x?k:void 0;return MQ({id:g,name:T,commit:M.commit,value:R,getValue:()=>M.inputRef.current?.value,controlRef:M.inputRef}),W0("input",Z,{ref:[J,b],state:E,props:[{id:g,disabled:j,name:T,ref:M.inputRef,"aria-labelledby":C,autoFocus:q,...x?{value:R}:{defaultValue:W},onChange(S){let h=S.currentTarget.value;Y?.(h,N0(o.none,S.nativeEvent)),L(h!==_.initialValue),A(h!=="")},onFocus(){w(!0)},onBlur(S){if(N(!0),w(!1),D==="onBlur")M.commit(S.currentTarget.value)},onKeyDown(S){if(S.currentTarget.tagName==="INPUT"&&S.key==="Enter")N(!0),M.commit(S.currentTarget.value)}},M.getInputValidationProps(),B],stateAttributesMapping:N8})});var K$=O(v(),1);var r_=O(l(),1),a_=function(Z){let{children:J}=Z,{validityData:Q,invalid:X}=S5(!1),G=K$.useMemo(()=>p9(Q,X),[Q,X]),H=G.state.valid===!1,{transitionStatus:z}=d8(H),K=K$.useMemo(()=>{return{...G,validity:G.state,transitionStatus:z}},[G,z]);return r_.jsx(K$.Fragment,{children:J(K)})};var wQ=O(v(),1);var VK=O(v(),1),s_=VK.createContext({disabled:!1});var DQ=O(v(),1),Ev=DQ.createContext(void 0);function n_($=!0){let Z=DQ.useContext(Ev);if(Z===void 0&&!$)throw Error(M0(3));return Z}var LK=O(l(),1),o_=wQ.forwardRef(function(Z,J){let{render:Q,className:X,disabled:G=!1,...H}=Z,{state:z,disabled:K}=S5(!1),Y=K||G,W=n_(),q=W?.parent.id,U=W?.allValues!==void 0?q:void 0,F=wQ.useMemo(()=>({disabled:Y}),[Y]),V=W0("div",Z,{ref:J,state:z,props:H,stateAttributesMapping:N8});return LK.jsx(VQ,{initialControlId:U,children:LK.jsx(s_.Provider,{value:F,children:V})})});var e_=O(l(),1),NK=t_.forwardRef(function(Z,J){return e_.jsx(OQ.Control,{ref:J,...Z})});var $M=O(l(),1);function i9({className:$,type:Z,...J}){return $M.jsx(NK,{type:Z,"data-slot":"input",className:B0("h-8 w-full min-w-0 rounded-md 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",$),...J})}var K7={};G4(K7,{createHandle:()=>OM,Viewport:()=>wM,Trigger:()=>YM,Root:()=>XM,Provider:()=>MM,Positioner:()=>FM,Portal:()=>BM,Popup:()=>LM,Handle:()=>TQ,Arrow:()=>_M});var i4=O(v(),1);var PQ=O(v(),1),_K=PQ.createContext(void 0);function i8($){let Z=PQ.useContext(_K);if(Z===void 0&&!$)throw Error(M0(72));return Z}var ZM=O(v(),1),JM=O(I8(),1);var Sv={...m4,disabled:w0(($)=>$.disabled),instantType:w0(($)=>$.instantType),isInstantPhase:w0(($)=>$.isInstantPhase),trackCursorAxis:w0(($)=>$.trackCursorAxis),disableHoverablePopup:w0(($)=>$.disableHoverablePopup),lastOpenChangeReason:w0(($)=>$.openChangeReason),closeDelay:w0(($)=>$.closeDelay),hasViewport:w0(($)=>$.hasViewport)};class K2 extends T8{constructor($){super({...Rv(),...$},{popupRef:ZM.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new z8},Sv)}setOpen=($,Z)=>{let J=Z.reason,Q=J===o.triggerHover,X=$&&J===o.triggerFocus,G=!$&&(J===o.triggerPress||J===o.escapeKey);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let H=()=>{let z={open:$,openChangeReason:J};if(X)z.instantType="focus";else if(G)z.instantType="dismiss";else if(J===o.triggerHover)z.instantType=void 0;let K=Z.trigger?.id??null;if(K||$)z.activeTriggerId=K,z.activeTriggerElement=Z.trigger??null;this.update(z)};if(Q)JM.flushSync(H);else H()};static useStore($,Z){let J=$1(()=>{return new K2(Z)}).current,Q=$??J,X=K4({popupStore:Q,onOpenChange:Q.setOpen});return Q.state.floatingRootContext=X,Q}}function Rv(){return{...f4(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}var QM=O(l(),1),XM=i3(function(Z){let{disabled:J=!1,defaultOpen:Q=!1,open:X,disableHoverablePopup:G=!1,trackCursorAxis:H="none",actionsRef:z,onOpenChange:K,onOpenChangeComplete:Y,handle:W,triggerId:q,defaultTriggerId:B=null,children:U}=Z,F=K2.useStore(W?.store,{open:Q,openProp:X,activeTriggerId:B,triggerIdProp:q});k4(()=>{if(X===void 0&&F.state.open===!1&&Q===!0)F.update({open:!0,activeTriggerId:B})}),F.useControlledProp("openProp",X),F.useControlledProp("triggerIdProp",q),F.useContextCallback("onOpenChange",K),F.useContextCallback("onOpenChangeComplete",Y);let V=F.useState("open"),N=!J&&V,L=F.useState("activeTriggerId"),_=F.useState("payload");F.useSyncedValues({trackCursorAxis:H,disableHoverablePopup:G}),Q0(()=>{if(V&&J)F.setOpen(!1,N0(o.disabled))},[V,J,F]),F.useSyncedValue("disabled",J),v4(F);let{forceUnmount:w,transitionStatus:A}=g4(N,F),D=F.useState("isInstantPhase"),M=F.useState("instantType"),j=F.useState("lastOpenChangeReason"),T=i4.useRef(null);Q0(()=>{if(A==="ending"&&j===o.none||A!=="ending"&&D){if(M!=="delay")T.current=M;F.set("instantType","delay")}else if(T.current!==null)F.set("instantType",T.current),T.current=null},[A,D,j,M,F]),Q0(()=>{if(N){if(L==null)F.set("payload",void 0)}},[F,L,N]);let E=i4.useCallback(()=>{F.setOpen(!1,bv(F,o.imperativeAction))},[F]);i4.useImperativeHandle(z,()=>({unmount:w,close:E}),[w,E]);let C=F.useState("floatingRootContext"),g=z4(C,{enabled:!J,referencePress:!0}),b=Sz(C,{enabled:!J&&H!=="none",axis:H==="none"?void 0:H}),{getReferenceProps:k,getFloatingProps:x,getTriggerProps:R}=P5([g,b]),I=i4.useMemo(()=>k(),[k]),S=i4.useMemo(()=>R(),[R]),h=i4.useMemo(()=>x(),[x]);return F.useSyncedValues({activeTriggerProps:I,inactiveTriggerProps:S,popupProps:h}),QM.jsx(_K.Provider,{value:F,children:typeof U==="function"?U({payload:_}):U})});function bv($,Z){let J=N0(Z);return J.preventUnmountOnClose=()=>{$.set("preventUnmountingOnClose",!0)},J}var KM=O(v(),1);var jQ=O(v(),1),MK=jQ.createContext(void 0);function GM(){return jQ.useContext(MK)}var HM=function($){return $[$.popupOpen=n3.popupOpen]="popupOpen",$.triggerDisabled="data-trigger-disabled",$}({});var zM=600;var YM=bJ(function(Z,J){let{className:Q,render:X,handle:G,payload:H,disabled:z,delay:K,closeDelay:Y,id:W,...q}=Z,B=i8(!0),U=G?.store??B;if(!U)throw Error(M0(82));let F=c0(W),V=U.useState("isTriggerActive",F),N=U.useState("isOpenedByTrigger",F),L=U.useState("floatingRootContext"),_=KM.useRef(null),w=K??zM,A=Y??0,{registerTrigger:D,isMountedByThisTrigger:M}=h4(F,_,U,{payload:H,closeDelay:A}),j=GM(),{delayRef:T,isInstantPhase:E,hasProvider:C}=jz(L,{open:N});U.useSyncedValue("isInstantPhase",E);let g=U.useState("disabled"),b=z??g,k=U.useState("trackCursorAxis"),x=U.useState("disableHoverablePopup"),R=Y4(L,{enabled:!b,mouseOnly:!0,move:!1,handleClose:!x&&k!=="both"?W4():null,restMs(){let P=j?.delay,t=typeof T.current==="object"?T.current.open:void 0,z0=w;if(C)if(t!==0)z0=K??P??w;else z0=0;return z0},delay(){let P=typeof T.current==="object"?T.current.close:void 0,t=A;if(Y==null&&C)t=P;return{close:t}},triggerElementRef:_,isActiveTrigger:V}),I=y9(L,{enabled:!b}).reference,S={open:N},h=U.useState("triggerProps",M);return W0("button",Z,{state:S,ref:[J,D,_],props:[R,I,h,{id:F,[HM.triggerDisabled]:b?"":void 0},q],stateAttributesMapping:p4})});var qM=O(v(),1);var CQ=O(v(),1),AK=CQ.createContext(void 0);function WM(){let $=CQ.useContext(AK);if($===void 0)throw Error(M0(70));return $}var DK=O(l(),1),BM=qM.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z;if(!(i8().useState("mounted")||Q))return null;return DK.jsx(AK.Provider,{value:Q,children:DK.jsx(lJ,{ref:J,...X})})});var W2=O(v(),1);var IQ=O(v(),1),wK=IQ.createContext(void 0);function Y2(){let $=IQ.useContext(wK);if($===void 0)throw Error(M0(71));return $}var UM=O(l(),1),FM=W2.forwardRef(function(Z,J){let{render:Q,className:X,anchor:G,positionMethod:H="absolute",side:z="top",align:K="center",sideOffset:Y=0,alignOffset:W=0,collisionBoundary:q="clipping-ancestors",collisionPadding:B=5,arrowPadding:U=5,sticky:F=!1,disableAnchorTracking:V=!1,collisionAvoidance:N=C7,...L}=Z,_=i8(),w=WM(),A=_.useState("open"),D=_.useState("mounted"),M=_.useState("trackCursorAxis"),j=_.useState("disableHoverablePopup"),T=_.useState("floatingRootContext"),E=_.useState("instantType"),C=_.useState("transitionStatus"),g=_.useState("hasViewport"),b=f7({anchor:G,positionMethod:H,floatingRootContext:T,mounted:D,side:z,sideOffset:Y,align:K,alignOffset:W,collisionBoundary:q,collisionPadding:B,sticky:F,arrowPadding:U,disableAnchorTracking:V,keepMounted:w,collisionAvoidance:N,adaptiveOrigin:g?t6:void 0}),k=W2.useMemo(()=>{let S={};if(!A||M==="both"||j)S.pointerEvents="none";return{role:"presentation",hidden:!D,style:{...b.positionerStyles,...S}}},[A,M,j,D,b.positionerStyles]),x=W2.useMemo(()=>({open:A,side:b.side,align:b.align,anchorHidden:b.anchorHidden,instant:M!=="none"?"tracking-cursor":E}),[A,b.side,b.align,b.anchorHidden,M,E]),R=W2.useMemo(()=>({...x,arrowRef:b.arrowRef,arrowStyles:b.arrowStyles,arrowUncentered:b.arrowUncentered}),[x,b.arrowRef,b.arrowStyles,b.arrowUncentered]),I=W0("div",Z,{state:x,props:[k,a5(C),L],ref:[J,_.useStateSetter("positionerElement")],stateAttributesMapping:H1});return UM.jsx(wK.Provider,{value:R,children:I})});var VM=O(v(),1);var yv={...H1,...P1},LM=VM.forwardRef(function(Z,J){let{className:Q,render:X,...G}=Z,H=i8(),{side:z,align:K}=Y2(),Y=H.useState("open"),W=H.useState("instantType"),q=H.useState("transitionStatus"),B=H.useState("popupProps"),U=H.useState("floatingRootContext");L5({open:Y,ref:H.context.popupRef,onComplete(){if(Y)H.context.onOpenChangeComplete?.(!0)}});let F=H.useState("disabled"),V=H.useState("closeDelay");return z7(U,{enabled:!F,closeDelay:V}),W0("div",Z,{state:{open:Y,side:z,align:K,instant:W,transitionStatus:q},ref:[J,H.context.popupRef,H.useStateSetter("popupElement")],props:[B,a5(q),G],stateAttributesMapping:yv})});var NM=O(v(),1);var _M=NM.forwardRef(function(Z,J){let{className:Q,render:X,...G}=Z,z=i8().useState("instantType"),{open:K,arrowRef:Y,side:W,align:q,arrowUncentered:B,arrowStyles:U}=Y2();return W0("div",Z,{state:{open:K,side:W,align:q,uncentered:B,instant:z},ref:[J,Y],props:[{style:U,"aria-hidden":!0},G],stateAttributesMapping:H1})});var OK=O(v(),1);var PK=O(l(),1),MM=function(Z){let{delay:J,closeDelay:Q,timeout:X=400}=Z,G=OK.useMemo(()=>({delay:J,closeDelay:Q}),[J,Q]),H=OK.useMemo(()=>({open:J,close:Q}),[J,Q]);return PK.jsx(MK.Provider,{value:G,children:PK.jsx(Pz,{delay:H,timeoutMs:X,children:Z.children})})};var DM=O(v(),1);var AM=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var xv={activationDirection:($)=>$?{"data-activation-direction":$}:null},wM=DM.forwardRef(function(Z,J){let{render:Q,className:X,children:G,...H}=Z,z=i8(),K=Y2(),Y=z.useState("instantType"),{children:W,state:q}=$2({store:z,side:K.side,cssVars:AM,children:G}),B={activationDirection:q.activationDirection,transitioning:q.transitioning,instant:Y};return W0("div",Z,{state:B,ref:J,props:[H,{children:W}],stateAttributesMapping:xv})});class TQ{constructor(){this.store=new K2}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(M0(81,$));this.store.setOpen(!0,N0(o.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,N0(o.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function OM(){return new TQ}var r9=O(l(),1);function q2({delay:$,closeDelay:Z,...J}){return r9.jsx(K7.Provider,{delay:$,closeDelay:Z,children:r9.jsx(K7.Root,{"data-slot":"tooltip",...J})})}function B2({...$}){return r9.jsx(K7.Trigger,{"data-slot":"tooltip-trigger",...$})}function U2({className:$,side:Z="top",sideOffset:J=6,align:Q="center",alignOffset:X=0,...G}){return r9.jsx(K7.Portal,{children:r9.jsx(K7.Positioner,{align:Q,alignOffset:X,side:Z,sideOffset:J,className:"isolate z-50",children:r9.jsx(K7.Popup,{"data-slot":"tooltip-content",className:B0("z-50 origin-(--transform-origin) rounded-sm bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md ring-1 ring-border outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 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",$),...G})})})}var PM="/claude-z2xnay0d.svg";var jM="/hermes-nous-pznd63x9.png";var CM="/openclaw-a2pyfhpn.svg";var IM=O(l(),1),Y7={"claude-code":PM,openclaw:CM,hermes:jM},jK={"claude-code":"Claude Code",openclaw:"OpenClaw",hermes:"Hermes"};function kQ({type:$,className:Z}){return IM.jsx("img",{src:Y7[$],alt:"","aria-label":jK[$],className:B0("size-4 shrink-0",Z)})}function Y$($){if($.name)return $.name;if($.type==="openclaw")return $.agentId??"OpenClaw agent";return $.path.split("/").pop()||$.path}function TM($){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 Z1=O(l(),1),fv=[{type:"claude-code",hint:"Powered by the Claude Agent SDK"},{type:"openclaw",hint:"Initialize OpenClaw in the folder manually, then import it from Home",disabled:!0},{type:"hermes",hint:"Coming soon",disabled:!0}];function q$({trigger:$}){let[,Z]=j4(),J=aN(),Q=nN(),X=$Q(),G=sN(),[H,z]=W$.useState(!1),[K,Y]=W$.useState("type"),[W,q]=W$.useState("claude-code"),[B,U]=W$.useState(""),F=B.trim(),V=F?TM(F):null,N=J.data?.canChooseFolder??!0,L=Q.isPending||X.isPending||G.isPending,_=Q.error??X.error??G.error;function w(j){if(z(j),!j)Y("type"),U("")}function A(j){z(!1),Z(`/workspace/${j}`)}async function D(){if(L)return;try{let j=await G.mutateAsync();if("canceled"in j)return;let T=await X.mutateAsync({path:j.path,type:W});A(T.id)}catch{}}function M(){if(!F||V||L)return;Q.mutate({name:F,type:W},{onSuccess:(j)=>A(j.id)})}return Z1.jsxs(KQ,{open:H,onOpenChange:w,children:[Z1.jsx(x_,{render:$}),Z1.jsxs(WQ,{className:"w-[520px] max-w-[92vw] p-6",children:[Z1.jsx(YQ,{render:Z1.jsx(C0,{variant:"ghost",size:"icon-sm","aria-label":"Close",className:"absolute top-4 right-4",children:Z1.jsx(U4,{stroke:1.75})})}),K==="type"?Z1.jsxs(Z1.Fragment,{children:[Z1.jsx(G$,{children:"Create new space"}),Z1.jsx("p",{className:"mt-4 mb-2 text-sm font-medium text-foreground",children:"Space type"}),Z1.jsx("div",{className:"flex flex-col gap-2",children:fv.map((j)=>{let T=W===j.type;return Z1.jsxs("button",{type:"button",disabled:j.disabled,onClick:()=>q(j.type),"aria-pressed":T,className:B0("flex items-center gap-3 rounded-lg border p-3 text-left transition-colors",T?"border-ring bg-muted/50 shadow-[inset_0_0_0_1px_var(--ring)]":"border-border hover:bg-accent",j.disabled&&"cursor-not-allowed opacity-50 hover:bg-transparent"),children:[Z1.jsx(kQ,{type:j.type,className:"size-5"}),Z1.jsxs("span",{className:"flex min-w-0 flex-col",children:[Z1.jsx("span",{className:"text-sm font-medium text-foreground",children:jK[j.type]}),Z1.jsx("span",{className:"text-xs text-muted-foreground",children:j.hint})]})]},j.type)})}),_&&Z1.jsx("p",{className:"mt-4 text-xs text-destructive",children:_.message}),Z1.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2",children:[N?Z1.jsx(C0,{variant:"secondary",onClick:D,disabled:L,children:"Use existing folder"}):Z1.jsxs(q2,{delay:50,children:[Z1.jsx(B2,{render:Z1.jsx(C0,{variant:"secondary","aria-disabled":!0,onClick:(j)=>j.preventDefault(),className:"cursor-not-allowed opacity-50",children:"Use existing folder"})}),Z1.jsxs(U2,{className:"max-w-64 text-center",children:["Run ",Z1.jsx("code",{className:"font-mono",children:"moi init"})," in the folder to add it manually."]})]}),Z1.jsx(C0,{onClick:()=>Y("name"),disabled:L,children:"Next"})]})]}):Z1.jsxs(Z1.Fragment,{children:[Z1.jsx(G$,{children:"Name the space"}),Z1.jsx(h_,{className:"mt-1",children:"Keep it short and recognizable."}),Z1.jsxs("div",{className:"mt-5",children:[Z1.jsx(i9,{value:B,onChange:(j)=>U(j.target.value),onKeyDown:(j)=>{if(j.key==="Enter")M()},placeholder:"my-space",autoFocus:!0,"aria-invalid":!!V,autoComplete:"off",spellCheck:!1}),V&&Z1.jsx("p",{className:"mt-2 text-xs text-destructive",children:V})]}),_&&Z1.jsx("p",{className:"mt-4 text-xs text-destructive",children:_.message}),Z1.jsx("div",{className:"mt-6 flex items-center justify-end gap-2",children:Z1.jsx(C0,{onClick:M,disabled:!F||!!V||L,children:Q.isPending?"Creating…":"Create new space"})})]})]})]})}var l7=O(v(),1);var J0=O(v(),1),t9=O(I8(),1);var N5=O(v(),1);var B$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function a9($){let Z=Object.prototype.toString.call($);return Z==="[object Window]"||Z==="[object global]"}function EQ($){return"nodeType"in $}function o5($){var Z,J;if(!$)return window;if(a9($))return $;if(!EQ($))return window;return(Z=(J=$.ownerDocument)==null?void 0:J.defaultView)!=null?Z:window}function SQ($){let{Document:Z}=o5($);return $ instanceof Z}function V2($){if(a9($))return!1;return $ instanceof o5($).HTMLElement}function IK($){return $ instanceof o5($).SVGElement}function s9($){if(!$)return document;if(a9($))return $.document;if(!EQ($))return document;if(SQ($))return $;if(V2($)||IK($))return $.ownerDocument;return document}var r4=B$?N5.useLayoutEffect:N5.useEffect;function U$($){let Z=N5.useRef($);return r4(()=>{Z.current=$}),N5.useCallback(function(){for(var J=arguments.length,Q=Array(J),X=0;X<J;X++)Q[X]=arguments[X];return Z.current==null?void 0:Z.current(...Q)},[])}function EM(){let $=N5.useRef(null),Z=N5.useCallback((Q,X)=>{$.current=setInterval(Q,X)},[]),J=N5.useCallback(()=>{if($.current!==null)clearInterval($.current),$.current=null},[]);return[Z,J]}function L2($,Z){if(Z===void 0)Z=[$];let J=N5.useRef($);return r4(()=>{if(J.current!==$)J.current=$},Z),J}function N2($,Z){let J=N5.useRef();return N5.useMemo(()=>{let Q=$(J.current);return J.current=Q,Q},[...Z])}function F$($){let Z=U$($),J=N5.useRef(null),Q=N5.useCallback((X)=>{if(X!==J.current)Z==null||Z(X,J.current);J.current=X},[]);return[J,Q]}function V$($){let Z=N5.useRef();return N5.useEffect(()=>{Z.current=$},[$]),Z.current}var CK={};function L$($,Z){return N5.useMemo(()=>{if(Z)return Z;let J=CK[$]==null?0:CK[$]+1;return CK[$]=J,$+"-"+J},[$,Z])}function SM($){return function(Z){for(var J=arguments.length,Q=Array(J>1?J-1:0),X=1;X<J;X++)Q[X-1]=arguments[X];return Q.reduce((G,H)=>{let z=Object.entries(H);for(let[K,Y]of z){let W=G[K];if(W!=null)G[K]=W+$*Y}return G},{...Z})}}var n9=SM(1),N$=SM(-1);function mv($){return"clientX"in $&&"clientY"in $}function RQ($){if(!$)return!1;let{KeyboardEvent:Z}=o5($.target);return Z&&$ instanceof Z}function uv($){if(!$)return!1;let{TouchEvent:Z}=o5($.target);return Z&&$ instanceof Z}function _$($){if(uv($)){if($.touches&&$.touches.length){let{clientX:Z,clientY:J}=$.touches[0];return{x:Z,y:J}}else if($.changedTouches&&$.changedTouches.length){let{clientX:Z,clientY:J}=$.changedTouches[0];return{x:Z,y:J}}}if(mv($))return{x:$.clientX,y:$.clientY};return null}var F2=Object.freeze({Translate:{toString($){if(!$)return;let{x:Z,y:J}=$;return"translate3d("+(Z?Math.round(Z):0)+"px, "+(J?Math.round(J):0)+"px, 0)"}},Scale:{toString($){if(!$)return;let{scaleX:Z,scaleY:J}=$;return"scaleX("+Z+") scaleY("+J+")"}},Transform:{toString($){if(!$)return;return[F2.Translate.toString($),F2.Scale.toString($)].join(" ")}},Transition:{toString($){let{property:Z,duration:J,easing:Q}=$;return Z+" "+J+"ms "+Q}}}),kM="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function RM($){if($.matches(kM))return $;return $.querySelector(kM)}var o9=O(v(),1),pv={display:"none"};function bM($){let{id:Z,value:J}=$;return o9.default.createElement("div",{id:Z,style:pv},J)}function yM($){let{id:Z,announcement:J,ariaLiveType:Q="assertive"}=$,X={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 o9.default.createElement("div",{id:Z,style:X,role:"status","aria-live":Q,"aria-atomic":!0},J)}function xM(){let[$,Z]=o9.useState("");return{announce:o9.useCallback((Q)=>{if(Q!=null)Z(Q)},[]),announcement:$}}var aM=J0.createContext(null);function cv($){let Z=J0.useContext(aM);J0.useEffect(()=>{if(!Z)throw Error("useDndMonitor must be used within a children of <DndContext>");return Z($)},[$,Z])}function dv(){let[$]=J0.useState(()=>new Set),Z=J0.useCallback((Q)=>{return $.add(Q),()=>$.delete(Q)},[$]);return[J0.useCallback((Q)=>{let{type:X,event:G}=Q;$.forEach((H)=>{var z;return(z=H[X])==null?void 0:z.call(H,G)})},[$]),Z]}var lv={draggable:`
80
- To pick up a draggable item, press the space bar.
81
- While dragging, use the arrow keys to move the item.
82
- Press space again to drop the item in its new position, or press escape to cancel.
83
- `},iv={onDragStart($){let{active:Z}=$;return"Picked up draggable item "+Z.id+"."},onDragOver($){let{active:Z,over:J}=$;if(J)return"Draggable item "+Z.id+" was moved over droppable area "+J.id+".";return"Draggable item "+Z.id+" is no longer over a droppable area."},onDragEnd($){let{active:Z,over:J}=$;if(J)return"Draggable item "+Z.id+" was dropped over droppable area "+J.id;return"Draggable item "+Z.id+" was dropped."},onDragCancel($){let{active:Z}=$;return"Dragging was cancelled. Draggable item "+Z.id+" was dropped."}};function rv($){let{announcements:Z=iv,container:J,hiddenTextDescribedById:Q,screenReaderInstructions:X=lv}=$,{announce:G,announcement:H}=xM(),z=L$("DndLiveRegion"),[K,Y]=J0.useState(!1);if(J0.useEffect(()=>{Y(!0)},[]),cv(J0.useMemo(()=>({onDragStart(q){let{active:B}=q;G(Z.onDragStart({active:B}))},onDragMove(q){let{active:B,over:U}=q;if(Z.onDragMove)G(Z.onDragMove({active:B,over:U}))},onDragOver(q){let{active:B,over:U}=q;G(Z.onDragOver({active:B,over:U}))},onDragEnd(q){let{active:B,over:U}=q;G(Z.onDragEnd({active:B,over:U}))},onDragCancel(q){let{active:B,over:U}=q;G(Z.onDragCancel({active:B,over:U}))}}),[G,Z])),!K)return null;let W=J0.default.createElement(J0.default.Fragment,null,J0.default.createElement(bM,{id:Q,value:X.draggable}),J0.default.createElement(yM,{id:z,announcement:H}));return J?t9.createPortal(W,J):W}var C5;(function($){$.DragStart="dragStart",$.DragMove="dragMove",$.DragEnd="dragEnd",$.DragCancel="dragCancel",$.DragOver="dragOver",$.RegisterDroppable="registerDroppable",$.SetDroppableDisabled="setDroppableDisabled",$.UnregisterDroppable="unregisterDroppable"})(C5||(C5={}));function yQ(){}function yK($,Z){return J0.useMemo(()=>({sensor:$,options:Z!=null?Z:{}}),[$,Z])}function sM(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];return J0.useMemo(()=>[...Z].filter((Q)=>Q!=null),[...Z])}var F4=Object.freeze({x:0,y:0});function av($,Z){return Math.sqrt(Math.pow($.x-Z.x,2)+Math.pow($.y-Z.y,2))}function sv($,Z){let J=_$($);if(!J)return"0 0";let Q={x:(J.x-Z.left)/Z.width*100,y:(J.y-Z.top)/Z.height*100};return Q.x+"% "+Q.y+"%"}function nv($,Z){let{data:{value:J}}=$,{data:{value:Q}}=Z;return J-Q}function ov($,Z){let{data:{value:J}}=$,{data:{value:Q}}=Z;return Q-J}function tv($,Z){if(!$||$.length===0)return null;let[J]=$;return Z?J[Z]:J}function hM($,Z,J){if(Z===void 0)Z=$.left;if(J===void 0)J=$.top;return{x:Z+$.width*0.5,y:J+$.height*0.5}}var nM=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:Q}=$,X=hM(Z,Z.left,Z.top),G=[];for(let H of Q){let{id:z}=H,K=J.get(z);if(K){let Y=av(hM(K),X);G.push({id:z,data:{droppableContainer:H,value:Y}})}}return G.sort(nv)};function ev($,Z){let J=Math.max(Z.top,$.top),Q=Math.max(Z.left,$.left),X=Math.min(Z.left+Z.width,$.left+$.width),G=Math.min(Z.top+Z.height,$.top+$.height),H=X-Q,z=G-J;if(Q<X&&J<G){let K=Z.width*Z.height,Y=$.width*$.height,W=H*z,q=W/(K+Y-W);return Number(q.toFixed(4))}return 0}var $g=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:Q}=$,X=[];for(let G of Q){let{id:H}=G,z=J.get(H);if(z){let K=ev(z,Z);if(K>0)X.push({id:H,data:{droppableContainer:G,value:K}})}}return X.sort(ov)};function Zg($,Z,J){return{...$,scaleX:Z&&J?Z.width/J.width:1,scaleY:Z&&J?Z.height/J.height:1}}function oM($,Z){return $&&Z?{x:$.left-Z.left,y:$.top-Z.top}:F4}function Jg($){return function(J){for(var Q=arguments.length,X=Array(Q>1?Q-1:0),G=1;G<Q;G++)X[G-1]=arguments[G];return X.reduce((H,z)=>({...H,top:H.top+$*z.y,bottom:H.bottom+$*z.y,left:H.left+$*z.x,right:H.right+$*z.x}),{...J})}}var Qg=Jg(1);function tM($){if($.startsWith("matrix3d(")){let Z=$.slice(9,-1).split(/, /);return{x:+Z[12],y:+Z[13],scaleX:+Z[0],scaleY:+Z[5]}}else if($.startsWith("matrix(")){let Z=$.slice(7,-1).split(/, /);return{x:+Z[4],y:+Z[5],scaleX:+Z[0],scaleY:+Z[3]}}return null}function Xg($,Z,J){let Q=tM(Z);if(!Q)return $;let{scaleX:X,scaleY:G,x:H,y:z}=Q,K=$.left-H-(1-X)*parseFloat(J),Y=$.top-z-(1-G)*parseFloat(J.slice(J.indexOf(" ")+1)),W=X?$.width/X:$.width,q=G?$.height/G:$.height;return{width:W,height:q,top:Y,right:K+W,bottom:Y+q,left:K}}var Gg={ignoreTransform:!1};function D$($,Z){if(Z===void 0)Z=Gg;let J=$.getBoundingClientRect();if(Z.ignoreTransform){let{transform:Y,transformOrigin:W}=o5($).getComputedStyle($);if(Y)J=Xg(J,Y,W)}let{top:Q,left:X,width:G,height:H,bottom:z,right:K}=J;return{top:Q,left:X,width:G,height:H,bottom:z,right:K}}function vM($){return D$($,{ignoreTransform:!0})}function Hg($){let{innerWidth:Z,innerHeight:J}=$;return{top:0,left:0,right:Z,bottom:J,width:Z,height:J}}function zg($,Z){if(Z===void 0)Z=o5($).getComputedStyle($);return Z.position==="fixed"}function Kg($,Z){if(Z===void 0)Z=o5($).getComputedStyle($);let J=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((X)=>{let G=Z[X];return typeof G==="string"?J.test(G):!1})}function xK($,Z){let J=[];function Q(X){if(Z!=null&&J.length>=Z)return J;if(!X)return J;if(SQ(X)&&X.scrollingElement!=null&&!J.includes(X.scrollingElement))return J.push(X.scrollingElement),J;if(!V2(X)||IK(X))return J;if(J.includes(X))return J;let G=o5($).getComputedStyle(X);if(X!==$){if(Kg(X,G))J.push(X)}if(zg(X,G))return J;return Q(X.parentNode)}if(!$)return J;return Q($)}function eM($){let[Z]=xK($,1);return Z!=null?Z:null}function TK($){if(!B$||!$)return null;if(a9($))return $;if(!EQ($))return null;if(SQ($)||$===s9($).scrollingElement)return window;if(V2($))return $;return null}function $A($){if(a9($))return $.scrollX;return $.scrollLeft}function ZA($){if(a9($))return $.scrollY;return $.scrollTop}function SK($){return{x:$A($),y:ZA($)}}var b5;(function($){$[$.Forward=1]="Forward",$[$.Backward=-1]="Backward"})(b5||(b5={}));function JA($){if(!B$||!$)return!1;return $===document.scrollingElement}function QA($){let Z={x:0,y:0},J=JA($)?{height:window.innerHeight,width:window.innerWidth}:{height:$.clientHeight,width:$.clientWidth},Q={x:$.scrollWidth-J.width,y:$.scrollHeight-J.height},X=$.scrollTop<=Z.y,G=$.scrollLeft<=Z.x,H=$.scrollTop>=Q.y,z=$.scrollLeft>=Q.x;return{isTop:X,isLeft:G,isBottom:H,isRight:z,maxScroll:Q,minScroll:Z}}var Yg={x:0.2,y:0.2};function Wg($,Z,J,Q,X){let{top:G,left:H,right:z,bottom:K}=J;if(Q===void 0)Q=10;if(X===void 0)X=Yg;let{isTop:Y,isBottom:W,isLeft:q,isRight:B}=QA($),U={x:0,y:0},F={x:0,y:0},V={height:Z.height*X.y,width:Z.width*X.x};if(!Y&&G<=Z.top+V.height)U.y=b5.Backward,F.y=Q*Math.abs((Z.top+V.height-G)/V.height);else if(!W&&K>=Z.bottom-V.height)U.y=b5.Forward,F.y=Q*Math.abs((Z.bottom-V.height-K)/V.height);if(!B&&z>=Z.right-V.width)U.x=b5.Forward,F.x=Q*Math.abs((Z.right-V.width-z)/V.width);else if(!q&&H<=Z.left+V.width)U.x=b5.Backward,F.x=Q*Math.abs((Z.left+V.width-H)/V.width);return{direction:U,speed:F}}function qg($){if($===document.scrollingElement){let{innerWidth:G,innerHeight:H}=window;return{top:0,left:0,right:G,bottom:H,width:G,height:H}}let{top:Z,left:J,right:Q,bottom:X}=$.getBoundingClientRect();return{top:Z,left:J,right:Q,bottom:X,width:$.clientWidth,height:$.clientHeight}}function XA($){return $.reduce((Z,J)=>{return n9(Z,SK(J))},F4)}function Bg($){return $.reduce((Z,J)=>{return Z+$A(J)},0)}function Ug($){return $.reduce((Z,J)=>{return Z+ZA(J)},0)}function GA($,Z){if(Z===void 0)Z=D$;if(!$)return;let{top:J,left:Q,bottom:X,right:G}=Z($);if(!eM($))return;if(X<=0||G<=0||J>=window.innerHeight||Q>=window.innerWidth)$.scrollIntoView({block:"center",inline:"center"})}var Fg=[["x",["left","right"],Bg],["y",["top","bottom"],Ug]];class hQ{constructor($,Z){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let J=xK(Z),Q=XA(J);this.rect={...$},this.width=$.width,this.height=$.height;for(let[X,G,H]of Fg)for(let z of G)Object.defineProperty(this,z,{get:()=>{let K=H(J),Y=Q[X]-K;return this.rect[z]+Y},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class _2{constructor($){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((Z)=>{var J;return(J=this.target)==null?void 0:J.removeEventListener(...Z)})},this.target=$}add($,Z,J){var Q;(Q=this.target)==null||Q.addEventListener($,Z,J),this.listeners.push([$,Z,J])}}function Vg($){let{EventTarget:Z}=o5($);return $ instanceof Z?$:s9($)}function kK($,Z){let J=Math.abs($.x),Q=Math.abs($.y);if(typeof Z==="number")return Math.sqrt(J**2+Q**2)>Z;if("x"in Z&&"y"in Z)return J>Z.x&&Q>Z.y;if("x"in Z)return J>Z.x;if("y"in Z)return Q>Z.y;return!1}var r8;(function($){$.Click="click",$.DragStart="dragstart",$.Keydown="keydown",$.ContextMenu="contextmenu",$.Resize="resize",$.SelectionChange="selectionchange",$.VisibilityChange="visibilitychange"})(r8||(r8={}));function gM($){$.preventDefault()}function Lg($){$.stopPropagation()}var B1;(function($){$.Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter",$.Tab="Tab"})(B1||(B1={}));var HA={start:[B1.Space,B1.Enter],cancel:[B1.Esc],end:[B1.Space,B1.Enter,B1.Tab]},Ng=($,Z)=>{let{currentCoordinates:J}=Z;switch($.code){case B1.Right:return{...J,x:J.x+25};case B1.Left:return{...J,x:J.x-25};case B1.Down:return{...J,y:J.y+25};case B1.Up:return{...J,y:J.y-25}}return};class w${constructor($){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=$;let{event:{target:Z}}=$;this.props=$,this.listeners=new _2(s9(Z)),this.windowListeners=new _2(o5(Z)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(r8.Resize,this.handleCancel),this.windowListeners.add(r8.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(r8.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:$,onStart:Z}=this.props,J=$.node.current;if(J)GA(J);Z(F4)}handleKeyDown($){if(RQ($)){let{active:Z,context:J,options:Q}=this.props,{keyboardCodes:X=HA,coordinateGetter:G=Ng,scrollBehavior:H="smooth"}=Q,{code:z}=$;if(X.end.includes(z)){this.handleEnd($);return}if(X.cancel.includes(z)){this.handleCancel($);return}let{collisionRect:K}=J.current,Y=K?{x:K.left,y:K.top}:F4;if(!this.referenceCoordinates)this.referenceCoordinates=Y;let W=G($,{active:Z,context:J.current,currentCoordinates:Y});if(W){let q=N$(W,Y),B={x:0,y:0},{scrollableAncestors:U}=J.current;for(let F of U){let V=$.code,{isTop:N,isRight:L,isLeft:_,isBottom:w,maxScroll:A,minScroll:D}=QA(F),M=qg(F),j={x:Math.min(V===B1.Right?M.right-M.width/2:M.right,Math.max(V===B1.Right?M.left:M.left+M.width/2,W.x)),y:Math.min(V===B1.Down?M.bottom-M.height/2:M.bottom,Math.max(V===B1.Down?M.top:M.top+M.height/2,W.y))},T=V===B1.Right&&!L||V===B1.Left&&!_,E=V===B1.Down&&!w||V===B1.Up&&!N;if(T&&j.x!==W.x){let C=F.scrollLeft+q.x,g=V===B1.Right&&C<=A.x||V===B1.Left&&C>=D.x;if(g&&!q.y){F.scrollTo({left:C,behavior:H});return}if(g)B.x=F.scrollLeft-C;else B.x=V===B1.Right?F.scrollLeft-A.x:F.scrollLeft-D.x;if(B.x)F.scrollBy({left:-B.x,behavior:H});break}else if(E&&j.y!==W.y){let C=F.scrollTop+q.y,g=V===B1.Down&&C<=A.y||V===B1.Up&&C>=D.y;if(g&&!q.x){F.scrollTo({top:C,behavior:H});return}if(g)B.y=F.scrollTop-C;else B.y=V===B1.Down?F.scrollTop-A.y:F.scrollTop-D.y;if(B.y)F.scrollBy({top:-B.y,behavior:H});break}}this.handleMove($,n9(N$(W,this.referenceCoordinates),B))}}}handleMove($,Z){let{onMove:J}=this.props;$.preventDefault(),J(Z)}handleEnd($){let{onEnd:Z}=this.props;$.preventDefault(),this.detach(),Z()}handleCancel($){let{onCancel:Z}=this.props;$.preventDefault(),this.detach(),Z()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}w$.activators=[{eventName:"onKeyDown",handler:($,Z,J)=>{let{keyboardCodes:Q=HA,onActivation:X}=Z,{active:G}=J,{code:H}=$.nativeEvent;if(Q.start.includes(H)){let z=G.activatorNode.current;if(z&&$.target!==z)return!1;return $.preventDefault(),X==null||X({event:$.nativeEvent}),!0}return!1}}];function fM($){return Boolean($&&"distance"in $)}function mM($){return Boolean($&&"delay"in $)}class vQ{constructor($,Z,J){var Q;if(J===void 0)J=Vg($.event.target);this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=$,this.events=Z;let{event:X}=$,{target:G}=X;this.props=$,this.events=Z,this.document=s9(G),this.documentListeners=new _2(this.document),this.listeners=new _2(J),this.windowListeners=new _2(o5(G)),this.initialCoordinates=(Q=_$(X))!=null?Q:F4,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:$,props:{options:{activationConstraint:Z,bypassActivationConstraint:J}}}=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(r8.Resize,this.handleCancel),this.windowListeners.add(r8.DragStart,gM),this.windowListeners.add(r8.VisibilityChange,this.handleCancel),this.windowListeners.add(r8.ContextMenu,gM),this.documentListeners.add(r8.Keydown,this.handleKeydown),Z){if(J!=null&&J({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(mM(Z)){this.timeoutId=setTimeout(this.handleStart,Z.delay),this.handlePending(Z);return}if(fM(Z)){this.handlePending(Z);return}}this.handleStart()}detach(){if(this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null)clearTimeout(this.timeoutId),this.timeoutId=null}handlePending($,Z){let{active:J,onPending:Q}=this.props;Q(J,$,this.initialCoordinates,Z)}handleStart(){let{initialCoordinates:$}=this,{onStart:Z}=this.props;if($)this.activated=!0,this.documentListeners.add(r8.Click,Lg,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(r8.SelectionChange,this.removeTextSelection),Z($)}handleMove($){var Z;let{activated:J,initialCoordinates:Q,props:X}=this,{onMove:G,options:{activationConstraint:H}}=X;if(!Q)return;let z=(Z=_$($))!=null?Z:F4,K=N$(Q,z);if(!J&&H){if(fM(H)){if(H.tolerance!=null&&kK(K,H.tolerance))return this.handleCancel();if(kK(K,H.distance))return this.handleStart()}if(mM(H)){if(kK(K,H.tolerance))return this.handleCancel()}this.handlePending(H,K);return}if($.cancelable)$.preventDefault();G(z)}handleEnd(){let{onAbort:$,onEnd:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleCancel(){let{onAbort:$,onCancel:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleKeydown($){if($.code===B1.Esc)this.handleCancel()}removeTextSelection(){var $;($=this.document.getSelection())==null||$.removeAllRanges()}}var _g={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class O$ extends vQ{constructor($){let{event:Z}=$,J=s9(Z.target);super($,_g,J)}}O$.activators=[{eventName:"onPointerDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:Q}=Z;if(!J.isPrimary||J.button!==0)return!1;return Q==null||Q({event:J}),!0}}];var Mg={move:{name:"mousemove"},end:{name:"mouseup"}},RK;(function($){$[$.RightClick=2]="RightClick"})(RK||(RK={}));class zA extends vQ{constructor($){super($,Mg,s9($.event.target))}}zA.activators=[{eventName:"onMouseDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:Q}=Z;if(J.button===RK.RightClick)return!1;return Q==null||Q({event:J}),!0}}];var EK={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class KA extends vQ{constructor($){super($,EK)}static setup(){return window.addEventListener(EK.move.name,$,{capture:!1,passive:!1}),function(){window.removeEventListener(EK.move.name,$)};function $(){}}}KA.activators=[{eventName:"onTouchStart",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:Q}=Z,{touches:X}=J;if(X.length>1)return!1;return Q==null||Q({event:J}),!0}}];var M$;(function($){$[$.Pointer=0]="Pointer",$[$.DraggableRect=1]="DraggableRect"})(M$||(M$={}));var xQ;(function($){$[$.TreeOrder=0]="TreeOrder",$[$.ReversedTreeOrder=1]="ReversedTreeOrder"})(xQ||(xQ={}));function Ag($){let{acceleration:Z,activator:J=M$.Pointer,canScroll:Q,draggingRect:X,enabled:G,interval:H=5,order:z=xQ.TreeOrder,pointerCoordinates:K,scrollableAncestors:Y,scrollableAncestorRects:W,delta:q,threshold:B}=$,U=wg({delta:q,disabled:!G}),[F,V]=EM(),N=J0.useRef({x:0,y:0}),L=J0.useRef({x:0,y:0}),_=J0.useMemo(()=>{switch(J){case M$.Pointer:return K?{top:K.y,bottom:K.y,left:K.x,right:K.x}:null;case M$.DraggableRect:return X}},[J,X,K]),w=J0.useRef(null),A=J0.useCallback(()=>{let M=w.current;if(!M)return;let j=N.current.x*L.current.x,T=N.current.y*L.current.y;M.scrollBy(j,T)},[]),D=J0.useMemo(()=>z===xQ.TreeOrder?[...Y].reverse():Y,[z,Y]);J0.useEffect(()=>{if(!G||!Y.length||!_){V();return}for(let M of D){if((Q==null?void 0:Q(M))===!1)continue;let j=Y.indexOf(M),T=W[j];if(!T)continue;let{direction:E,speed:C}=Wg(M,T,_,Z,B);for(let g of["x","y"])if(!U[g][E[g]])C[g]=0,E[g]=0;if(C.x>0||C.y>0){V(),w.current=M,F(A,H),N.current=C,L.current=E;return}}N.current={x:0,y:0},L.current={x:0,y:0},V()},[Z,A,Q,V,G,H,JSON.stringify(_),JSON.stringify(U),F,Y,D,W,JSON.stringify(B)])}var Dg={x:{[b5.Backward]:!1,[b5.Forward]:!1},y:{[b5.Backward]:!1,[b5.Forward]:!1}};function wg($){let{delta:Z,disabled:J}=$,Q=V$(Z);return N2((X)=>{if(J||!Q||!X)return Dg;let G={x:Math.sign(Z.x-Q.x),y:Math.sign(Z.y-Q.y)};return{x:{[b5.Backward]:X.x[b5.Backward]||G.x===-1,[b5.Forward]:X.x[b5.Forward]||G.x===1},y:{[b5.Backward]:X.y[b5.Backward]||G.y===-1,[b5.Forward]:X.y[b5.Forward]||G.y===1}}},[J,Z,Q])}function Og($,Z){let J=Z!=null?$.get(Z):void 0,Q=J?J.node.current:null;return N2((X)=>{var G;if(Z==null)return null;return(G=Q!=null?Q:X)!=null?G:null},[Q,Z])}function Pg($,Z){return J0.useMemo(()=>$.reduce((J,Q)=>{let{sensor:X}=Q,G=X.activators.map((H)=>({eventName:H.eventName,handler:Z(H.handler,Q)}));return[...J,...G]},[]),[$,Z])}var A$;(function($){$[$.Always=0]="Always",$[$.BeforeDragging=1]="BeforeDragging",$[$.WhileDragging=2]="WhileDragging"})(A$||(A$={}));var bK;(function($){$.Optimized="optimized"})(bK||(bK={}));var uM=new Map;function jg($,Z){let{dragging:J,dependencies:Q,config:X}=Z,[G,H]=J0.useState(null),{frequency:z,measure:K,strategy:Y}=X,W=J0.useRef($),q=N(),B=L2(q),U=J0.useCallback(function(L){if(L===void 0)L=[];if(B.current)return;H((_)=>{if(_===null)return L;return _.concat(L.filter((w)=>!_.includes(w)))})},[B]),F=J0.useRef(null),V=N2((L)=>{if(q&&!J)return uM;if(!L||L===uM||W.current!==$||G!=null){let _=new Map;for(let w of $){if(!w)continue;if(G&&G.length>0&&!G.includes(w.id)&&w.rect.current){_.set(w.id,w.rect.current);continue}let A=w.node.current,D=A?new hQ(K(A),A):null;if(w.rect.current=D,D)_.set(w.id,D)}return _}return L},[$,G,J,q,K]);return J0.useEffect(()=>{W.current=$},[$]),J0.useEffect(()=>{if(q)return;U()},[J,q]),J0.useEffect(()=>{if(G&&G.length>0)H(null)},[JSON.stringify(G)]),J0.useEffect(()=>{if(q||typeof z!=="number"||F.current!==null)return;F.current=setTimeout(()=>{U(),F.current=null},z)},[z,q,U,...Q]),{droppableRects:V,measureDroppableContainers:U,measuringScheduled:G!=null};function N(){switch(Y){case A$.Always:return!1;case A$.BeforeDragging:return J;default:return!J}}}function hK($,Z){return N2((J)=>{if(!$)return null;if(J)return J;return typeof Z==="function"?Z($):$},[Z,$])}function Cg($,Z){return hK($,Z)}function Ig($){let{callback:Z,disabled:J}=$,Q=U$(Z),X=J0.useMemo(()=>{if(J||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:G}=window;return new G(Q)},[Q,J]);return J0.useEffect(()=>{return()=>X==null?void 0:X.disconnect()},[X]),X}function gQ($){let{callback:Z,disabled:J}=$,Q=U$(Z),X=J0.useMemo(()=>{if(J||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:G}=window;return new G(Q)},[J]);return J0.useEffect(()=>{return()=>X==null?void 0:X.disconnect()},[X]),X}function Tg($){return new hQ(D$($),$)}function pM($,Z,J){if(Z===void 0)Z=Tg;let[Q,X]=J0.useState(null);function G(){X((K)=>{if(!$)return null;if($.isConnected===!1){var Y;return(Y=K!=null?K:J)!=null?Y:null}let W=Z($);if(JSON.stringify(K)===JSON.stringify(W))return K;return W})}let H=Ig({callback(K){if(!$)return;for(let Y of K){let{type:W,target:q}=Y;if(W==="childList"&&q instanceof HTMLElement&&q.contains($)){G();break}}}}),z=gQ({callback:G});return r4(()=>{if(G(),$)z==null||z.observe($),H==null||H.observe(document.body,{childList:!0,subtree:!0});else z==null||z.disconnect(),H==null||H.disconnect()},[$]),Q}function kg($){let Z=hK($);return oM($,Z)}var cM=[];function Eg($){let Z=J0.useRef($),J=N2((Q)=>{if(!$)return cM;if(Q&&Q!==cM&&$&&Z.current&&$.parentNode===Z.current.parentNode)return Q;return xK($)},[$]);return J0.useEffect(()=>{Z.current=$},[$]),J}function Sg($){let[Z,J]=J0.useState(null),Q=J0.useRef($),X=J0.useCallback((G)=>{let H=TK(G.target);if(!H)return;J((z)=>{if(!z)return null;return z.set(H,SK(H)),new Map(z)})},[]);return J0.useEffect(()=>{let G=Q.current;if($!==G){H(G);let z=$.map((K)=>{let Y=TK(K);if(Y)return Y.addEventListener("scroll",X,{passive:!0}),[Y,SK(Y)];return null}).filter((K)=>K!=null);J(z.length?new Map(z):null),Q.current=$}return()=>{H($),H(G)};function H(z){z.forEach((K)=>{let Y=TK(K);Y==null||Y.removeEventListener("scroll",X)})}},[X,$]),J0.useMemo(()=>{if($.length)return Z?Array.from(Z.values()).reduce((G,H)=>n9(G,H),F4):XA($);return F4},[$,Z])}function dM($,Z){if(Z===void 0)Z=[];let J=J0.useRef(null);return J0.useEffect(()=>{J.current=null},Z),J0.useEffect(()=>{let Q=$!==F4;if(Q&&!J.current)J.current=$;if(!Q&&J.current)J.current=null},[$]),J.current?N$($,J.current):F4}function Rg($){J0.useEffect(()=>{if(!B$)return;let Z=$.map((J)=>{let{sensor:Q}=J;return Q.setup==null?void 0:Q.setup()});return()=>{for(let J of Z)J==null||J()}},$.map((Z)=>{let{sensor:J}=Z;return J}))}function bg($,Z){return J0.useMemo(()=>{return $.reduce((J,Q)=>{let{eventName:X,handler:G}=Q;return J[X]=(H)=>{G(H,Z)},J},{})},[$,Z])}function YA($){return J0.useMemo(()=>$?Hg($):null,[$])}var lM=[];function yg($,Z){if(Z===void 0)Z=D$;let[J]=$,Q=YA(J?o5(J):null),[X,G]=J0.useState(lM);function H(){G(()=>{if(!$.length)return lM;return $.map((K)=>JA(K)?Q:new hQ(Z(K),K))})}let z=gQ({callback:H});return r4(()=>{z==null||z.disconnect(),H(),$.forEach((K)=>z==null?void 0:z.observe(K))},[$]),X}function WA($){if(!$)return null;if($.children.length>1)return $;let Z=$.children[0];return V2(Z)?Z:$}function xg($){let{measure:Z}=$,[J,Q]=J0.useState(null),X=J0.useCallback((Y)=>{for(let{target:W}of Y)if(V2(W)){Q((q)=>{let B=Z(W);return q?{...q,width:B.width,height:B.height}:B});break}},[Z]),G=gQ({callback:X}),H=J0.useCallback((Y)=>{let W=WA(Y);if(G==null||G.disconnect(),W)G==null||G.observe(W);Q(W?Z(W):null)},[Z,G]),[z,K]=F$(H);return J0.useMemo(()=>({nodeRef:z,rect:J,setRef:K}),[J,z,K])}var hg=[{sensor:O$,options:{}},{sensor:w$,options:{}}],vg={current:{}},bQ={draggable:{measure:vM},droppable:{measure:vM,strategy:A$.WhileDragging,frequency:bK.Optimized},dragOverlay:{measure:D$}};class M2 extends Map{get($){var Z;return $!=null?(Z=super.get($))!=null?Z:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(($)=>{let{disabled:Z}=$;return!Z})}getNodeFor($){var Z,J;return(Z=(J=this.get($))==null?void 0:J.node.current)!=null?Z:void 0}}var gg={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new M2,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:yQ},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:bQ,measureDroppableContainers:yQ,windowRect:null,measuringScheduled:!1},qA={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yQ,draggableNodes:new Map,over:null,measureDroppableContainers:yQ},P$=J0.createContext(qA),BA=J0.createContext(gg);function fg(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new M2}}}function mg($,Z){switch(Z.type){case C5.DragStart:return{...$,draggable:{...$.draggable,initialCoordinates:Z.initialCoordinates,active:Z.active}};case C5.DragMove:if($.draggable.active==null)return $;return{...$,draggable:{...$.draggable,translate:{x:Z.coordinates.x-$.draggable.initialCoordinates.x,y:Z.coordinates.y-$.draggable.initialCoordinates.y}}};case C5.DragEnd:case C5.DragCancel:return{...$,draggable:{...$.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case C5.RegisterDroppable:{let{element:J}=Z,{id:Q}=J,X=new M2($.droppable.containers);return X.set(Q,J),{...$,droppable:{...$.droppable,containers:X}}}case C5.SetDroppableDisabled:{let{id:J,key:Q,disabled:X}=Z,G=$.droppable.containers.get(J);if(!G||Q!==G.key)return $;let H=new M2($.droppable.containers);return H.set(J,{...G,disabled:X}),{...$,droppable:{...$.droppable,containers:H}}}case C5.UnregisterDroppable:{let{id:J,key:Q}=Z,X=$.droppable.containers.get(J);if(!X||Q!==X.key)return $;let G=new M2($.droppable.containers);return G.delete(J),{...$,droppable:{...$.droppable,containers:G}}}default:return $}}function ug($){let{disabled:Z}=$,{active:J,activatorEvent:Q,draggableNodes:X}=J0.useContext(P$),G=V$(Q),H=V$(J==null?void 0:J.id);return J0.useEffect(()=>{if(Z)return;if(!Q&&G&&H!=null){if(!RQ(G))return;if(document.activeElement===G.target)return;let z=X.get(H);if(!z)return;let{activatorNode:K,node:Y}=z;if(!K.current&&!Y.current)return;requestAnimationFrame(()=>{for(let W of[K.current,Y.current]){if(!W)continue;let q=RM(W);if(q){q.focus();break}}})}},[Q,Z,X,H,G]),null}function UA($,Z){let{transform:J,...Q}=Z;return $!=null&&$.length?$.reduce((X,G)=>{return G({transform:X,...Q})},J):J}function pg($){return J0.useMemo(()=>({draggable:{...bQ.draggable,...$==null?void 0:$.draggable},droppable:{...bQ.droppable,...$==null?void 0:$.droppable},dragOverlay:{...bQ.dragOverlay,...$==null?void 0:$.dragOverlay}}),[$==null?void 0:$.draggable,$==null?void 0:$.droppable,$==null?void 0:$.dragOverlay])}function cg($){let{activeNode:Z,measure:J,initialRect:Q,config:X=!0}=$,G=J0.useRef(!1),{x:H,y:z}=typeof X==="boolean"?{x:X,y:X}:X;r4(()=>{if(!H&&!z||!Z){G.current=!1;return}if(G.current||!Q)return;let Y=Z==null?void 0:Z.node.current;if(!Y||Y.isConnected===!1)return;let W=J(Y),q=oM(W,Q);if(!H)q.x=0;if(!z)q.y=0;if(G.current=!0,Math.abs(q.x)>0||Math.abs(q.y)>0){let B=eM(Y);if(B)B.scrollBy({top:q.y,left:q.x})}},[Z,H,z,Q,J])}var fQ=J0.createContext({...F4,scaleX:1,scaleY:1}),d7;(function($){$[$.Uninitialized=0]="Uninitialized",$[$.Initializing=1]="Initializing",$[$.Initialized=2]="Initialized"})(d7||(d7={}));var FA=J0.memo(function(Z){var J,Q,X,G;let{id:H,accessibility:z,autoScroll:K=!0,children:Y,sensors:W=hg,collisionDetection:q=$g,measuring:B,modifiers:U,...F}=Z,V=J0.useReducer(mg,void 0,fg),[N,L]=V,[_,w]=dv(),[A,D]=J0.useState(d7.Uninitialized),M=A===d7.Initialized,{draggable:{active:j,nodes:T,translate:E},droppable:{containers:C}}=N,g=j!=null?T.get(j):null,b=J0.useRef({initial:null,translated:null}),k=J0.useMemo(()=>{var E0;return j!=null?{id:j,data:(E0=g==null?void 0:g.data)!=null?E0:vg,rect:b}:null},[j,g]),x=J0.useRef(null),[R,I]=J0.useState(null),[S,h]=J0.useState(null),p=L2(F,Object.values(F)),P=L$("DndDescribedBy",H),t=J0.useMemo(()=>C.getEnabled(),[C]),z0=pg(B),{droppableRects:y,measureDroppableContainers:n,measuringScheduled:_0}=jg(t,{dragging:M,dependencies:[E.x,E.y],config:z0.droppable}),c=Og(T,j),X0=J0.useMemo(()=>S?_$(S):null,[S]),K0=B5(),Z0=Cg(c,z0.draggable.measure);cg({activeNode:j!=null?T.get(j):null,config:K0.layoutShiftCompensation,initialRect:Z0,measure:z0.draggable.measure});let G0=pM(c,z0.draggable.measure,Z0),U0=pM(c?c.parentElement:null),m=J0.useRef({activatorEvent:null,active:null,activeNode:c,collisionRect:null,collisions:null,droppableRects:y,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:C,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),s=C.getNodeFor((J=m.current.over)==null?void 0:J.id),u=xg({measure:z0.dragOverlay.measure}),F0=(Q=u.nodeRef.current)!=null?Q:c,i=M?(X=u.rect)!=null?X:G0:null,Y0=Boolean(u.nodeRef.current&&u.rect),r=kg(Y0?null:G0),e=YA(F0?o5(F0):null),q0=Eg(M?s!=null?s:c:null),a=yg(q0),A0=UA(U,{transform:{x:E.x-r.x,y:E.y-r.y,scaleX:1,scaleY:1},activatorEvent:S,active:k,activeNodeRect:G0,containerNodeRect:U0,draggingNodeRect:i,over:m.current.over,overlayNodeRect:u.rect,scrollableAncestors:q0,scrollableAncestorRects:a,windowRect:e}),I0=X0?n9(X0,E):null,i0=Sg(q0),z1=dM(i0),f=dM(i0,[G0]),d=n9(A0,z1),$0=i?Qg(i,A0):null,V0=k&&$0?q({active:k,collisionRect:$0,droppableRects:y,droppableContainers:t,pointerCoordinates:I0}):null,j0=tv(V0,"id"),[g0,D1]=J0.useState(null),h1=Y0?A0:n9(A0,f),h0=Zg(h1,(G=g0==null?void 0:g0.rect)!=null?G:null,G0),d0=J0.useRef(null),t0=J0.useCallback((E0,x0)=>{let{sensor:r0,options:a0}=x0;if(x.current==null)return;let Y1=T.get(x.current);if(!Y1)return;let F1=E0.nativeEvent,C1=new r0({active:x.current,activeNode:Y1,event:F1,options:a0,context:m,onAbort(K1){if(!T.get(K1))return;let{onDragAbort:z5}=p.current,U5={id:K1};z5==null||z5(U5),_({type:"onDragAbort",event:U5})},onPending(K1,c1,z5,U5){if(!T.get(K1))return;let{onDragPending:u0}=p.current,k0={id:K1,constraint:c1,initialCoordinates:z5,offset:U5};u0==null||u0(k0),_({type:"onDragPending",event:k0})},onStart(K1){let c1=x.current;if(c1==null)return;let z5=T.get(c1);if(!z5)return;let{onDragStart:U5}=p.current,P0={activatorEvent:F1,active:{id:c1,data:z5.data,rect:b}};t9.unstable_batchedUpdates(()=>{U5==null||U5(P0),D(d7.Initializing),L({type:C5.DragStart,initialCoordinates:K1,active:c1}),_({type:"onDragStart",event:P0}),I(d0.current),h(F1)})},onMove(K1){L({type:C5.DragMove,coordinates:K1})},onEnd:p1(C5.DragEnd),onCancel:p1(C5.DragCancel)});d0.current=C1;function p1(K1){return async function(){let{active:z5,collisions:U5,over:P0,scrollAdjustedTranslate:u0}=m.current,k0=null;if(z5&&u0){let{cancelDrop:s0}=p.current;if(k0={activatorEvent:F1,active:z5,collisions:U5,delta:u0,over:P0},K1===C5.DragEnd&&typeof s0==="function"){if(await Promise.resolve(s0(k0)))K1=C5.DragCancel}}x.current=null,t9.unstable_batchedUpdates(()=>{L({type:K1}),D(d7.Uninitialized),D1(null),I(null),h(null),d0.current=null;let s0=K1===C5.DragEnd?"onDragEnd":"onDragCancel";if(k0){let W1=p.current[s0];W1==null||W1(k0),_({type:s0,event:k0})}})}}},[T]),m0=J0.useCallback((E0,x0)=>{return(r0,a0)=>{let Y1=r0.nativeEvent,F1=T.get(a0);if(x.current!==null||!F1||Y1.dndKit||Y1.defaultPrevented)return;let C1={active:F1};if(E0(r0,x0.options,C1)===!0)Y1.dndKit={capturedBy:x0.sensor},x.current=a0,t0(r0,x0)}},[T,t0]),X1=Pg(W,m0);Rg(W),r4(()=>{if(G0&&A===d7.Initializing)D(d7.Initialized)},[G0,A]),J0.useEffect(()=>{let{onDragMove:E0}=p.current,{active:x0,activatorEvent:r0,collisions:a0,over:Y1}=m.current;if(!x0||!r0)return;let F1={active:x0,activatorEvent:r0,collisions:a0,delta:{x:d.x,y:d.y},over:Y1};t9.unstable_batchedUpdates(()=>{E0==null||E0(F1),_({type:"onDragMove",event:F1})})},[d.x,d.y]),J0.useEffect(()=>{let{active:E0,activatorEvent:x0,collisions:r0,droppableContainers:a0,scrollAdjustedTranslate:Y1}=m.current;if(!E0||x.current==null||!x0||!Y1)return;let{onDragOver:F1}=p.current,C1=a0.get(j0),p1=C1&&C1.rect.current?{id:C1.id,rect:C1.rect.current,data:C1.data,disabled:C1.disabled}:null,K1={active:E0,activatorEvent:x0,collisions:r0,delta:{x:Y1.x,y:Y1.y},over:p1};t9.unstable_batchedUpdates(()=>{D1(p1),F1==null||F1(K1),_({type:"onDragOver",event:K1})})},[j0]),r4(()=>{m.current={activatorEvent:S,active:k,activeNode:c,collisionRect:$0,collisions:V0,droppableRects:y,draggableNodes:T,draggingNode:F0,draggingNodeRect:i,droppableContainers:C,over:g0,scrollableAncestors:q0,scrollAdjustedTranslate:d},b.current={initial:i,translated:$0}},[k,c,V0,$0,T,F0,i,y,C,g0,q0,d]),Ag({...K0,delta:E,draggingRect:$0,pointerCoordinates:I0,scrollableAncestors:q0,scrollableAncestorRects:a});let q5=J0.useMemo(()=>{return{active:k,activeNode:c,activeNodeRect:G0,activatorEvent:S,collisions:V0,containerNodeRect:U0,dragOverlay:u,draggableNodes:T,droppableContainers:C,droppableRects:y,over:g0,measureDroppableContainers:n,scrollableAncestors:q0,scrollableAncestorRects:a,measuringConfiguration:z0,measuringScheduled:_0,windowRect:e}},[k,c,G0,S,V0,U0,u,T,C,y,g0,n,q0,a,z0,_0,e]),v1=J0.useMemo(()=>{return{activatorEvent:S,activators:X1,active:k,activeNodeRect:G0,ariaDescribedById:{draggable:P},dispatch:L,draggableNodes:T,over:g0,measureDroppableContainers:n}},[S,X1,k,G0,L,P,T,g0,n]);return J0.default.createElement(aM.Provider,{value:w},J0.default.createElement(P$.Provider,{value:v1},J0.default.createElement(BA.Provider,{value:q5},J0.default.createElement(fQ.Provider,{value:h0},Y)),J0.default.createElement(ug,{disabled:(z==null?void 0:z.restoreFocus)===!1})),J0.default.createElement(rv,{...z,hiddenTextDescribedById:P}));function B5(){let E0=(R==null?void 0:R.autoScrollEnabled)===!1,x0=typeof K==="object"?K.enabled===!1:K===!1,r0=M&&!E0&&!x0;if(typeof K==="object")return{...K,enabled:r0};return{enabled:r0}}}),dg=J0.createContext(null),iM="button",lg="Draggable";function VA($){let{id:Z,data:J,disabled:Q=!1,attributes:X}=$,G=L$(lg),{activators:H,activatorEvent:z,active:K,activeNodeRect:Y,ariaDescribedById:W,draggableNodes:q,over:B}=J0.useContext(P$),{role:U=iM,roleDescription:F="draggable",tabIndex:V=0}=X!=null?X:{},N=(K==null?void 0:K.id)===Z,L=J0.useContext(N?fQ:dg),[_,w]=F$(),[A,D]=F$(),M=bg(H,Z),j=L2(J);r4(()=>{return q.set(Z,{id:Z,key:G,node:_,activatorNode:A,data:j}),()=>{let E=q.get(Z);if(E&&E.key===G)q.delete(Z)}},[q,Z]);let T=J0.useMemo(()=>({role:U,tabIndex:V,"aria-disabled":Q,"aria-pressed":N&&U===iM?!0:void 0,"aria-roledescription":F,"aria-describedby":W.draggable}),[Q,U,V,N,F,W.draggable]);return{active:K,activatorEvent:z,activeNodeRect:Y,attributes:T,isDragging:N,listeners:Q?void 0:M,node:_,over:B,setNodeRef:w,setActivatorNodeRef:D,transform:L}}function ig(){return J0.useContext(BA)}var rg="Droppable",ag={timeout:25};function LA($){let{data:Z,disabled:J=!1,id:Q,resizeObserverConfig:X}=$,G=L$(rg),{active:H,dispatch:z,over:K,measureDroppableContainers:Y}=J0.useContext(P$),W=J0.useRef({disabled:J}),q=J0.useRef(!1),B=J0.useRef(null),U=J0.useRef(null),{disabled:F,updateMeasurementsFor:V,timeout:N}={...ag,...X},L=L2(V!=null?V:Q),_=J0.useCallback(()=>{if(!q.current){q.current=!0;return}if(U.current!=null)clearTimeout(U.current);U.current=setTimeout(()=>{Y(Array.isArray(L.current)?L.current:[L.current]),U.current=null},N)},[N]),w=gQ({callback:_,disabled:F||!H}),A=J0.useCallback((T,E)=>{if(!w)return;if(E)w.unobserve(E),q.current=!1;if(T)w.observe(T)},[w]),[D,M]=F$(A),j=L2(Z);return J0.useEffect(()=>{if(!w||!D.current)return;w.disconnect(),q.current=!1,w.observe(D.current)},[D,w]),J0.useEffect(()=>{return z({type:C5.RegisterDroppable,element:{id:Q,key:G,disabled:J,node:D,rect:B,data:j}}),()=>z({type:C5.UnregisterDroppable,key:G,id:Q})},[Q]),J0.useEffect(()=>{if(J!==W.current.disabled)z({type:C5.SetDroppableDisabled,id:Q,key:G,disabled:J}),W.current.disabled=J},[Q,G,J,z]),{active:H,rect:B,isOver:(K==null?void 0:K.id)===Q,node:D,over:K,setNodeRef:M}}function sg($){let{animation:Z,children:J}=$,[Q,X]=J0.useState(null),[G,H]=J0.useState(null),z=V$(J);if(!J&&!Q&&z)X(z);return r4(()=>{if(!G)return;let K=Q==null?void 0:Q.key,Y=Q==null?void 0:Q.props.id;if(K==null||Y==null){X(null);return}Promise.resolve(Z(Y,G)).then(()=>{X(null)})},[Z,Q,G]),J0.default.createElement(J0.default.Fragment,null,J,Q?J0.cloneElement(Q,{ref:H}):null)}var ng={x:0,y:0,scaleX:1,scaleY:1};function og($){let{children:Z}=$;return J0.default.createElement(P$.Provider,{value:qA},J0.default.createElement(fQ.Provider,{value:ng},Z))}var tg={position:"fixed",touchAction:"none"},eg=($)=>{return RQ($)?"transform 250ms ease":void 0},$f=J0.forwardRef(($,Z)=>{let{as:J,activatorEvent:Q,adjustScale:X,children:G,className:H,rect:z,style:K,transform:Y,transition:W=eg}=$;if(!z)return null;let q=X?Y:{...Y,scaleX:1,scaleY:1},B={...tg,width:z.width,height:z.height,top:z.top,left:z.left,transform:F2.Transform.toString(q),transformOrigin:X&&Q?sv(Q,z):void 0,transition:typeof W==="function"?W(Q):W,...K};return J0.default.createElement(J,{className:H,style:B,ref:Z},G)}),Zf=($)=>(Z)=>{let{active:J,dragOverlay:Q}=Z,X={},{styles:G,className:H}=$;if(G!=null&&G.active)for(let[z,K]of Object.entries(G.active)){if(K===void 0)continue;X[z]=J.node.style.getPropertyValue(z),J.node.style.setProperty(z,K)}if(G!=null&&G.dragOverlay)for(let[z,K]of Object.entries(G.dragOverlay)){if(K===void 0)continue;Q.node.style.setProperty(z,K)}if(H!=null&&H.active)J.node.classList.add(H.active);if(H!=null&&H.dragOverlay)Q.node.classList.add(H.dragOverlay);return function(){for(let[K,Y]of Object.entries(X))J.node.style.setProperty(K,Y);if(H!=null&&H.active)J.node.classList.remove(H.active)}},Jf=($)=>{let{transform:{initial:Z,final:J}}=$;return[{transform:F2.Transform.toString(Z)},{transform:F2.Transform.toString(J)}]},Qf={duration:250,easing:"ease",keyframes:Jf,sideEffects:Zf({styles:{active:{opacity:"0"}}})};function Xf($){let{config:Z,draggableNodes:J,droppableContainers:Q,measuringConfiguration:X}=$;return U$((G,H)=>{if(Z===null)return;let z=J.get(G);if(!z)return;let K=z.node.current;if(!K)return;let Y=WA(H);if(!Y)return;let{transform:W}=o5(H).getComputedStyle(H),q=tM(W);if(!q)return;let B=typeof Z==="function"?Z:Gf(Z);return GA(K,X.draggable.measure),B({active:{id:G,data:z.data,node:K,rect:X.draggable.measure(K)},draggableNodes:J,dragOverlay:{node:H,rect:X.dragOverlay.measure(Y)},droppableContainers:Q,measuringConfiguration:X,transform:q})})}function Gf($){let{duration:Z,easing:J,sideEffects:Q,keyframes:X}={...Qf,...$};return(G)=>{let{active:H,dragOverlay:z,transform:K,...Y}=G;if(!Z)return;let W={x:z.rect.left-H.rect.left,y:z.rect.top-H.rect.top},q={scaleX:K.scaleX!==1?H.rect.width*K.scaleX/z.rect.width:1,scaleY:K.scaleY!==1?H.rect.height*K.scaleY/z.rect.height:1},B={x:K.x-W.x,y:K.y-W.y,...q},U=X({...Y,active:H,dragOverlay:z,transform:{initial:K,final:B}}),[F]=U,V=U[U.length-1];if(JSON.stringify(F)===JSON.stringify(V))return;let N=Q==null?void 0:Q({active:H,dragOverlay:z,...Y}),L=z.node.animate(U,{duration:Z,easing:J,fill:"forwards"});return new Promise((_)=>{L.onfinish=()=>{N==null||N(),_()}})}}var rM=0;function Hf($){return J0.useMemo(()=>{if($==null)return;return rM++,rM},[$])}var NA=J0.default.memo(($)=>{let{adjustScale:Z=!1,children:J,dropAnimation:Q,style:X,transition:G,modifiers:H,wrapperElement:z="div",className:K,zIndex:Y=999}=$,{activatorEvent:W,active:q,activeNodeRect:B,containerNodeRect:U,draggableNodes:F,droppableContainers:V,dragOverlay:N,over:L,measuringConfiguration:_,scrollableAncestors:w,scrollableAncestorRects:A,windowRect:D}=ig(),M=J0.useContext(fQ),j=Hf(q==null?void 0:q.id),T=UA(H,{activatorEvent:W,active:q,activeNodeRect:B,containerNodeRect:U,draggingNodeRect:N.rect,over:L,overlayNodeRect:N.rect,scrollableAncestors:w,scrollableAncestorRects:A,transform:M,windowRect:D}),E=hK(B),C=Xf({config:Q,draggableNodes:F,droppableContainers:V,measuringConfiguration:_}),g=E?N.setRef:void 0;return J0.default.createElement(og,null,J0.default.createElement(sg,{animation:C},q&&j?J0.default.createElement($f,{key:j,id:q.id,ref:g,as:z,activatorEvent:W,adjustScale:Z,className:K,transition:G,rect:E,style:{zIndex:Y,...X},transform:T},J):null))});var e9=O(l(),1),zf={start:[B1.Space],cancel:[B1.Esc],end:[B1.Space,B1.Tab]};function Kf($,Z,J){let Q=$.indexOf(Z),X=$.indexOf(J);if(Q<0||X<0||Q===X)return $;let G=[...$],[H]=G.splice(Q,1);return G.splice(X,0,H),G}function mQ({items:$,getId:Z,className:J,itemClassName:Q,dragDisabled:X=!1,onReorder:G,renderItem:H,renderPlaceholder:z,renderOverlay:K}){let Y=sM(yK(O$,{activationConstraint:{distance:4}}),yK(w$,{keyboardCodes:zf})),[W,q]=l7.useState(null),[B,U]=l7.useState(null),F=l7.useRef(null),V=l7.useMemo(()=>$.map(Z),[$,Z]),N=l7.useMemo(()=>new Map($.map((j)=>[Z(j),j])),[$,Z]),_=(W&&B?B:V).map((j)=>N.get(j)).filter((j)=>Boolean(j)),w=W?N.get(W):void 0,A=X||$.length<2;return e9.jsxs(FA,{sensors:Y,collisionDetection:nM,onDragStart:(j)=>{let T=$.map(Z);q(String(j.active.id)),F.current=T,U(T)},onDragOver:(j)=>{let T=String(j.active.id),E=j.over?String(j.over.id):void 0,C=F.current;if(!E||E===T||!C)return;let g=Kf(C,T,E);if(g===C)return;F.current=g,U(g)},onDragCancel:()=>{F.current=null,q(null),U(null)},onDragEnd:(j)=>{let T=String(j.active.id),E=F.current;if(F.current=null,q(null),U(null),!E||E.join("|")===V.join("|"))return;if(!E.includes(T))return;G(E)},children:[e9.jsx("div",{className:J,children:_.map((j)=>e9.jsx(Yf,{id:Z(j),item:j,disabled:A,itemClassName:Q,renderItem:H,renderPlaceholder:z},Z(j)))}),e9.jsx(NA,{dropAnimation:null,children:w&&K?K(w):null})]})}function Yf({id:$,item:Z,disabled:J,itemClassName:Q,renderItem:X,renderPlaceholder:G}){let{setNodeRef:H,isOver:z}=LA({id:$,disabled:J}),{attributes:K,listeners:Y,setNodeRef:W,isDragging:q}=VA({id:$,disabled:J,attributes:{roleDescription:"sortable item"}}),B=(F)=>{H(F),W(F)},U={isDragging:q,isOver:z,dragDisabled:J,dragHandleProps:J?{}:{...K,...Y}};return e9.jsxs(T1.div,{layout:!0,ref:B,className:B0("relative",Q?.(Z,U)),transition:{type:"spring",duration:0.25,bounce:0},children:[q&&G?.(Z),X(Z,U)]})}var N1=O(l(),1);function AA($){return B0(y6({variant:"ghost",size:"icon"}),$&&"bg-accent text-accent-foreground")}function A2({children:$,panel:Z="default"}){let{data:J}=eJ(),Q=I1();return W7((X)=>{if(X.type==="workspace:updated"||X.type==="workspaces-list:updated")Q.invalidateQueries({queryKey:T0.all,exact:!0})}),N1.jsxs("div",{className:"flex h-dvh bg-muted",children:[N1.jsx(Wf,{workspaces:J??[]}),N1.jsx("main",{className:B0("flex min-w-0 flex-1 flex-col overflow-hidden",Z==="default"&&"rounded-l-md border-l border-border bg-background shadow-[1px_0_3px_0_var(--border)]"),children:$})]})}function Wf({workspaces:$}){let Z=oN();return N1.jsxs("aside",{className:"flex h-full shrink-0 flex-col items-center gap-4 px-2 py-5",children:[N1.jsx(gZ,{href:"/","aria-label":"Home",title:"Home",className:AA,children:N1.jsx(MA,{stroke:1.5})}),N1.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&&N1.jsxs(N1.Fragment,{children:[N1.jsx("div",{className:"scrollbar-none min-h-0 scroll-fade overflow-y-auto [--scroll-fade-reveal:16px]",children:N1.jsx(mQ,{items:$,getId:(J)=>J.id,className:"flex flex-col gap-4",onReorder:(J)=>Z.mutate(J),renderPlaceholder:()=>N1.jsx("div",{className:"pointer-events-none absolute top-0 left-1 size-10 rounded-lg bg-accent"}),renderOverlay:(J)=>N1.jsx(_A,{workspace:J,dragOverlay:!0}),renderItem:(J,Q)=>N1.jsx(_A,{workspace:J,dragState:Q})})}),N1.jsx("div",{className:"shrink-0",children:N1.jsx(q$,{trigger:N1.jsx(C0,{type:"button",variant:"ghost",size:"icon-lg","aria-label":"Create new space",title:"Create new space",className:"text-muted-foreground hover:text-foreground",children:N1.jsx(t5,{"data-icon":"inline-start",stroke:1.5})})})})]})}),N1.jsx(qf,{})]})}function qf(){return N1.jsx(gZ,{href:"/connectors","aria-label":"Connectors",title:"Connectors",className:AA,children:N1.jsx(J2,{stroke:1.5})})}function _A({workspace:$,dragOverlay:Z=!1,dragState:J}){let[Q]=j4(),X=`/workspace/${$.id}`,G=Y$($),H=Q===X,z=N1.jsxs(N1.Fragment,{children:[N1.jsx("div",{className:B0(y6({variant:"ghost",size:"icon-lg"}),"pointer-events-none size-12",Z?"bg-background shadow-lg":"group-hover:bg-accent group-hover:text-accent-foreground group-focus-visible:ring-3 group-focus-visible:ring-ring/50",H&&!Z&&"bg-accent text-accent-foreground"),children:N1.jsx("img",{src:$.icon??Y7[$.type??"claude-code"],alt:"",className:"size-7 shrink-0 rounded-[4px]"})}),N1.jsx("span",{className:"mt-0.5 line-clamp-2 w-full text-center text-[11px] leading-snug font-medium text-ellipsis text-foreground",children:G})]});if(Z)return N1.jsx("span",{className:"flex w-14 flex-col items-center",children:z});return N1.jsx(gZ,{href:X,"aria-label":G,title:G,onClick:(K)=>{if(J?.isDragging)K.preventDefault()},className:B0("group flex w-14 flex-col items-center rounded-sm outline-none",J?.isDragging&&"invisible"),...J?.dragHandleProps,children:z})}var DA=O(l(),1);function uQ({className:$,...Z}){return DA.jsx("div",{"data-slot":"skeleton",className:B0("animate-pulse rounded-md bg-muted",$),...Z})}var o1=O(l(),1),Bf=Array.from({length:6},($,Z)=>Z);function wA(){return o1.jsx(A2,{panel:"flat",children:o1.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o1.jsx(Uf,{})})})}function Uf(){let $=hV();return o1.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[o1.jsx("div",{className:"mb-4 flex items-center justify-between gap-2",children:o1.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Connectors"})}),o1.jsx(Ff,{connectorsQuery:$})]})}function Ff({connectorsQuery:$}){if($.isPending)return o1.jsx("div",{role:"status","aria-label":"Loading connectors",className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:Bf.map((J)=>o1.jsxs("div",{className:"flex min-h-20 items-center gap-3 rounded-xl border border-border bg-card px-4 py-3",children:[o1.jsx(uQ,{className:"size-10 shrink-0 rounded-sm"}),o1.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[o1.jsx(uQ,{className:"h-4 w-36"}),o1.jsx(uQ,{className:"h-3 w-20"})]})]},J))});if($.isError)return o1.jsxs("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:[o1.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors."}),o1.jsx(C0,{variant:"outline",size:"sm",onClick:()=>$.refetch(),children:"Retry"})]});let Z=zK($.data);if(Z.length===0)return o1.jsxs("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:[o1.jsx(J2,{size:24,stroke:1.5,className:"text-muted-foreground"}),o1.jsx("p",{className:"mx-auto max-w-md text-sm text-foreground",children:"No user connectors configured."})]});return o1.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:Z.map((J)=>o1.jsx(dN,{server:J},J.name))})}var D2={};G4(D2,{Trigger:()=>kA,Root:()=>TA,Panel:()=>RA});var j$=O(v(),1);var S8=O(v(),1);function OA($){let{open:Z,defaultOpen:J,onOpenChange:Q,disabled:X}=$,G=Z!==void 0,[H,z]=l4({controlled:Z,default:J,name:"Collapsible",state:"open"}),{mounted:K,setMounted:Y,transitionStatus:W}=d8(H,!0,!0),[q,B]=S8.useState(H),[{height:U,width:F},V]=S8.useState({height:void 0,width:void 0}),N=c0(),[L,_]=S8.useState(),w=L??N,[A,D]=S8.useState(!1),[M,j]=S8.useState(!1),T=S8.useRef(null),E=S8.useRef(null),C=S8.useRef(null),g=S8.useRef(null),b=x4(g,!1),k=H0((x)=>{let R=!H,I=N0(o.triggerPress,x.nativeEvent);if(Q(R,I),I.isCanceled)return;let S=g.current;if(E.current==="css-animation"&&S!=null)S.style.removeProperty("animation-name");if(!A&&!M){if(E.current!=null&&E.current!=="css-animation"){if(!K&&R)Y(!0)}if(E.current==="css-animation"){if(!q&&R)B(!0);if(!K&&R)Y(!0)}}if(z(R),E.current==="none"&&K&&!R)Y(!1)});return Q0(()=>{if(G&&E.current==="none"&&!M&&!H)Y(!1)},[G,M,H,Z,Y]),S8.useMemo(()=>({abortControllerRef:T,animationTypeRef:E,disabled:X,handleTrigger:k,height:U,mounted:K,open:H,panelId:w,panelRef:g,runOnceAnimationsFinish:b,setDimensions:V,setHiddenUntilFound:D,setKeepMounted:j,setMounted:Y,setOpen:z,setPanelIdState:_,setVisible:B,transitionDimensionRef:C,transitionStatus:W,visible:q,width:F}),[T,E,X,k,U,K,H,w,g,b,V,D,j,Y,z,B,C,W,q,F])}var pQ=O(v(),1),vK=pQ.createContext(void 0);function cQ(){let $=pQ.useContext(vK);if($===void 0)throw Error(M0(15));return $}var $6=function($){return $.open="data-open",$.closed="data-closed",$[$.startingStyle=y4.startingStyle]="startingStyle",$[$.endingStyle=y4.endingStyle]="endingStyle",$}({});var PA=function($){return $.panelOpen="data-panel-open",$}({});var Vf={[$6.open]:""},Lf={[$6.closed]:""},jA={open($){if($)return{[PA.panelOpen]:""};return null}},CA={open($){if($)return Vf;return Lf}};var dQ={...CA,...P1};var IA=O(l(),1),TA=j$.forwardRef(function(Z,J){let{render:Q,className:X,defaultOpen:G=!1,disabled:H=!1,onOpenChange:z,open:K,...Y}=Z,W=H0(z),q=OA({open:K,defaultOpen:G,onOpenChange:W,disabled:H}),B=j$.useMemo(()=>({open:q.open,disabled:q.disabled,transitionStatus:q.transitionStatus}),[q.open,q.disabled,q.transitionStatus]),U=j$.useMemo(()=>({...q,onOpenChange:W,state:B}),[q,W,B]),F=W0("div",Z,{state:B,ref:J,props:Y,stateAttributesMapping:dQ});return IA.jsx(vK.Provider,{value:U,children:F})});var lQ=O(v(),1);var Nf={...jA,...P1},kA=lQ.forwardRef(function(Z,J){let{panelId:Q,open:X,handleTrigger:G,state:H,disabled:z}=cQ(),{className:K,disabled:Y=z,id:W,render:q,nativeButton:B=!0,...U}=Z,{getButtonProps:F,buttonRef:V}=M5({disabled:Y,focusableWhenDisabled:!0,native:B}),N=lQ.useMemo(()=>({"aria-controls":X?Q:void 0,"aria-expanded":X,onClick:G}),[Q,X,G]);return W0("button",Z,{state:H,ref:[J,V],props:[N,U,F],stateAttributesMapping:Nf})});var iQ=O(v(),1);var a4=O(v(),1);var EA=function($){return $.disabled="data-disabled",$.orientation="data-orientation",$}({});function SA($){let{abortControllerRef:Z,animationTypeRef:J,externalRef:Q,height:X,hiddenUntilFound:G,keepMounted:H,id:z,mounted:K,onOpenChange:Y,open:W,panelRef:q,runOnceAnimationsFinish:B,setDimensions:U,setMounted:F,setOpen:V,setVisible:N,transitionDimensionRef:L,visible:_,width:w}=$,A=a4.useRef(!1),D=a4.useRef(null),M=a4.useRef(W),j=a4.useRef(W),T=u8(),E=a4.useMemo(()=>{if(J.current==="css-animation")return!_;return!W&&!K},[W,K,_,J]),C=H0((b)=>{if(!b)return;if(J.current==null||L.current==null){let R=getComputedStyle(b),I=R.animationName!=="none"&&R.animationName!=="",S=R.transitionDuration!=="0s"&&R.transitionDuration!=="";if(I&&S);else if(R.animationName==="none"&&R.transitionDuration!=="0s")J.current="css-transition";else if(R.animationName!=="none"&&R.transitionDuration==="0s")J.current="css-animation";else J.current="none";if(b.getAttribute(EA.orientation)==="horizontal"||R.transitionProperty.indexOf("width")>-1)L.current="width";else L.current="height"}if(J.current!=="css-transition")return;if(X===void 0||w===void 0){if(U({height:b.scrollHeight,width:b.scrollWidth}),j.current)b.style.setProperty("transition-duration","0s")}let k=-1,x=-1;return k=m1.request(()=>{j.current=!1,x=m1.request(()=>{setTimeout(()=>{b.style.removeProperty("transition-duration")})})}),()=>{m1.cancel(k),m1.cancel(x)}}),g=U8(Q,q,C);return Q0(()=>{if(J.current!=="css-transition")return;let b=q.current;if(!b)return;let k=-1;if(Z.current!=null)Z.current.abort(),Z.current=null;if(W){let x={"justify-content":b.style.justifyContent,"align-items":b.style.alignItems,"align-content":b.style.alignContent,"justify-items":b.style.justifyItems};if(Object.keys(x).forEach((R)=>{b.style.setProperty(R,"initial","important")}),!j.current&&!H)b.setAttribute($6.startingStyle,"");U({height:b.scrollHeight,width:b.scrollWidth}),k=m1.request(()=>{Object.entries(x).forEach(([R,I])=>{if(I==="")b.style.removeProperty(R);else b.style.setProperty(R,I)})})}else{if(b.scrollHeight===0&&b.scrollWidth===0)return;U({height:b.scrollHeight,width:b.scrollWidth});let x=new AbortController;Z.current=x;let R=x.signal,I=null,S=$6.endingStyle;return I=new MutationObserver((h)=>{if(h.some((P)=>P.type==="attributes"&&P.attributeName===S))I?.disconnect(),I=null,B(()=>{if(U({height:0,width:0}),b.style.removeProperty("content-visibility"),F(!1),Z.current===x)Z.current=null},R)}),I.observe(b,{attributes:!0,attributeFilter:[S]}),()=>{if(I?.disconnect(),T.cancel(),Z.current===x)x.abort(),Z.current=null}}return()=>{m1.cancel(k)}},[Z,J,T,G,H,K,W,q,B,U,F]),Q0(()=>{if(J.current!=="css-animation")return;let b=q.current;if(!b)return;if(D.current=b.style.animationName||D.current,b.style.setProperty("animation-name","none"),U({height:b.scrollHeight,width:b.scrollWidth}),!M.current&&!A.current)b.style.removeProperty("animation-name");if(W){if(Z.current!=null)Z.current.abort(),Z.current=null;F(!0),N(!0)}else Z.current=new AbortController,B(()=>{F(!1),N(!1),Z.current=null},Z.current.signal)},[Z,J,W,q,B,U,F,N,_]),E4(()=>{let b=m1.request(()=>{M.current=!1});return()=>m1.cancel(b)}),Q0(()=>{if(!G)return;let b=q.current;if(!b)return;let k=-1,x=-1;if(W&&A.current)b.style.transitionDuration="0s",U({height:b.scrollHeight,width:b.scrollWidth}),k=m1.request(()=>{A.current=!1,x=m1.request(()=>{setTimeout(()=>{b.style.removeProperty("transition-duration")})})});return()=>{m1.cancel(k),m1.cancel(x)}},[G,W,q,U]),Q0(()=>{let b=q.current;if(b&&G&&E){if(b.setAttribute("hidden","until-found"),J.current==="css-transition")b.setAttribute($6.startingStyle,"")}},[G,E,J,q]),a4.useEffect(function(){let k=q.current;if(!k)return;function x(R){A.current=!0,V(!0),Y(!0,N0(o.none,R))}return k.addEventListener("beforematch",x),()=>{k.removeEventListener("beforematch",x)}},[Y,q,V]),a4.useMemo(()=>({props:{hidden:E,id:z,ref:g}}),[E,z,g])}var gK=function($){return $.collapsiblePanelHeight="--collapsible-panel-height",$.collapsiblePanelWidth="--collapsible-panel-width",$}({});var RA=iQ.forwardRef(function(Z,J){let{className:Q,hiddenUntilFound:X,keepMounted:G,render:H,id:z,...K}=Z,{abortControllerRef:Y,animationTypeRef:W,height:q,mounted:B,onOpenChange:U,open:F,panelId:V,panelRef:N,runOnceAnimationsFinish:L,setDimensions:_,setHiddenUntilFound:w,setKeepMounted:A,setMounted:D,setPanelIdState:M,setOpen:j,setVisible:T,state:E,transitionDimensionRef:C,visible:g,width:b,transitionStatus:k}=cQ(),x=X??!1,R=G??!1;Q0(()=>{if(z)return M(z),()=>{M(void 0)};return},[z,M]),Q0(()=>{w(x)},[w,x]),Q0(()=>{A(R)},[A,R]);let{props:I}=SA({abortControllerRef:Y,animationTypeRef:W,externalRef:J,height:q,hiddenUntilFound:x,id:V,keepMounted:R,mounted:B,onOpenChange:U,open:F,panelRef:N,runOnceAnimationsFinish:L,setDimensions:_,setMounted:D,setOpen:j,setVisible:T,transitionDimensionRef:C,visible:g,width:b});L5({open:F&&k==="idle",ref:N,onComplete(){if(!F)return;_({height:void 0,width:void 0})}});let S=iQ.useMemo(()=>({...E,transitionStatus:k}),[E,k]),h=W0("div",Z,{state:S,ref:[J,N],props:[I,{style:{[gK.collapsiblePanelHeight]:q===void 0?"auto":`${q}px`,[gK.collapsiblePanelWidth]:b===void 0?"auto":`${b}px`}},K],stateAttributesMapping:dQ});if(!(R||x||!R&&B))return null;return h});var rQ=O(l(),1);function bA({...$}){return rQ.jsx(D2.Root,{"data-slot":"collapsible",...$})}function yA({...$}){return rQ.jsx(D2.Trigger,{"data-slot":"collapsible-trigger",...$})}function xA({...$}){return rQ.jsx(D2.Panel,{"data-slot":"collapsible-content",...$})}function _f($,Z){let J;try{J=$()}catch(X){return}return{getItem:(X)=>{var G;let H=(K)=>{if(K===null)return null;return JSON.parse(K,Z==null?void 0:Z.reviver)},z=(G=J.getItem(X))!=null?G:null;if(z instanceof Promise)return z.then(H);return H(z)},setItem:(X,G)=>J.setItem(X,JSON.stringify(G,Z==null?void 0:Z.replacer)),removeItem:(X)=>J.removeItem(X)}}var fK=($)=>(Z)=>{try{let J=$(Z);if(J instanceof Promise)return J;return{then(Q){return fK(Q)(J)},catch(Q){return this}}}catch(J){return{then(Q){return this},catch(Q){return fK(Q)(J)}}}},Mf=($,Z)=>(J,Q,X)=>{let G={storage:_f(()=>window.localStorage),partialize:(N)=>N,version:0,merge:(N,L)=>({...L,...N}),...Z},H=!1,z=0,K=new Set,Y=new Set,W=G.storage;if(!W)return $((...N)=>{console.warn(`[zustand persist middleware] Unable to update item '${G.name}', the given storage is currently unavailable.`),J(...N)},Q,X);let q=()=>{let N=G.partialize({...Q()});return W.setItem(G.name,{state:N,version:G.version})},B=X.setState;X.setState=(N,L)=>{return B(N,L),q()};let U=$((...N)=>{return J(...N),q()},Q,X);X.getInitialState=()=>U;let F,V=()=>{var N,L;if(!W)return;let _=++z;H=!1,K.forEach((A)=>{var D;return A((D=Q())!=null?D:U)});let w=((L=G.onRehydrateStorage)==null?void 0:L.call(G,(N=Q())!=null?N:U))||void 0;return fK(W.getItem.bind(W))(G.name).then((A)=>{if(A)if(typeof A.version==="number"&&A.version!==G.version){if(G.migrate){let D=G.migrate(A.state,A.version);if(D instanceof Promise)return D.then((M)=>[!0,M]);return[!0,D]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,A.state];return[!1,void 0]}).then((A)=>{var D;if(_!==z)return;let[M,j]=A;if(F=G.merge(j,(D=Q())!=null?D:U),J(F,!0),M)return q()}).then(()=>{if(_!==z)return;w==null||w(Q(),void 0),F=Q(),H=!0,Y.forEach((A)=>A(F))}).catch((A)=>{if(_!==z)return;w==null||w(void 0,A)})};if(X.persist={setOptions:(N)=>{if(G={...G,...N},N.storage)W=N.storage},clearStorage:()=>{W==null||W.removeItem(G.name)},getOptions:()=>G,rehydrate:()=>V(),hasHydrated:()=>H,onHydrate:(N)=>{return K.add(N),()=>{K.delete(N)}},onFinishHydration:(N)=>{return Y.add(N),()=>{Y.delete(N)}}},!G.skipHydration)V();return F||U},hA=Mf;var mK=XU()(hA(($)=>({sidebarCollapsed:!1,discoveredWorkspacesOpen:!0,toggleSidebar:()=>$((Z)=>({sidebarCollapsed:!Z.sidebarCollapsed})),setSidebarCollapsed:(Z)=>$({sidebarCollapsed:Z}),setDiscoveredWorkspacesOpen:(Z)=>$({discoveredWorkspacesOpen:Z})}),{name:"moi:ui"}));var w2=O(l(),1);function vA({workspaceId:$}){let Z=iN($),J=Z.data?.items??[],Q=Z.data?.cols??4,X=J.length?Math.max(...J.map((z)=>z.y+z.h)):0,G=J.length>0&&X>0,H=Z.data!==void 0&&!G;return w2.jsxs("div",{className:"flex aspect-video w-full items-center justify-center rounded-sm bg-muted p-3",children:[G&&w2.jsx("svg",{viewBox:`0 0 ${Q} ${X}`,preserveAspectRatio:"none",className:"size-full animate-in duration-300 fade-in",children:J.map((z,K)=>w2.jsx("rect",{x:z.x+0.06,y:z.y+0.06,width:z.w-0.12,height:z.h-0.12,rx:0.12,className:"fill-muted-foreground/30"},K))}),H&&w2.jsx(q7,{size:20,stroke:1.5,className:"animate-in text-muted-foreground/40 duration-300 fade-in"})]})}var f0=O(l(),1);function fA(){let[,$]=j4(),Z=eJ(),J=rN(),Q=$Q(),X=mK((q)=>q.discoveredWorkspacesOpen),G=mK((q)=>q.setDiscoveredWorkspacesOpen);if(Z.isPending||J.isPending)return f0.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:f0.jsx(l5,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(Z.isError||J.isError)return f0.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:f0.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let H=Z.data,z=J.data,K=H.length,Y=Q.isPending&&Q.variables?Q.variables.path:null;function W(q){Q.mutate(q,{onSuccess:(B)=>$(`/workspace/${B.id}`)})}return f0.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[f0.jsx("div",{className:"mb-8 flex items-center",children:f0.jsx(x6,{sprite:"moi-full",pixelSize:4,gap:1})}),K>0?f0.jsxs("section",{className:"mb-10",children:[f0.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[f0.jsx("h1",{className:"text-sm font-medium text-foreground",children:"My spaces"}),f0.jsx(q$,{trigger:f0.jsxs(C0,{variant:"outline",size:"sm",children:[f0.jsx(t5,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),f0.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3",children:H.map((q)=>f0.jsx(Af,{workspace:q},q.id))})]}):f0.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 py-16 text-center",children:[f0.jsx(gA,{size:24,stroke:1.5,className:"text-muted-foreground/70"}),f0.jsxs("div",{className:"flex flex-col gap-1.5",children:[f0.jsx("h1",{className:"font-medium",children:"Create your first space"}),f0.jsxs("p",{className:"mx-auto max-w-md text-sm text-muted-foreground",children:["Initialize moi in any folder on your computer with"," ",f0.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-xs",children:"moi init"}),", or add an existing folder where you’ve worked with other agents."]})]}),f0.jsx(q$,{trigger:f0.jsx(C0,{size:"sm",children:"Create a space"})})]}),z.length>0&&f0.jsx("section",{children:f0.jsxs(bA,{open:X,onOpenChange:G,className:"group",children:[f0.jsxs(yA,{className:B0("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:[f0.jsx("span",{className:"text-sm font-medium",children:"Import from this computer"}),f0.jsx(v6,{size:16,stroke:2,className:B0("opacity-0 transition-[opacity,transform]","group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100 group-data-open:rotate-90")})]}),f0.jsxs(xA,{children:[f0.jsx("ul",{className:"border-t border-border",children:z.map((q)=>f0.jsx(Df,{suggestion:q,onAdd:W,loading:Y===q.path},q.path))}),Q.isError&&f0.jsx("p",{className:"mt-3 text-xs text-destructive",children:Q.error.message})]})]})})]})}function Af({workspace:$}){let Z=Y$($),J=wf($.addedAt);return f0.jsxs("a",{href:`/workspace/${$.id}`,className:B0("group flex min-w-0 flex-col gap-4 rounded-xl border border-border bg-card p-2 hover:shadow-sm","transition-colors"),children:[f0.jsx(vA,{workspaceId:$.id}),f0.jsxs("div",{className:"flex min-w-0 flex-col px-2 pb-2",children:[f0.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[f0.jsx("img",{src:$.icon??Y7[$.type??"claude-code"],alt:"",className:"size-4 shrink-0 rounded-[4px]"}),f0.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Z})]}),f0.jsx("div",{title:$.path,className:"mt-2 truncate text-xs text-muted-foreground",children:$.displayPath??$.path}),f0.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:J})]})]})}function Df({suggestion:$,onAdd:Z,loading:J}){let{path:Q,type:X}=$,G=Y$($);return f0.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[f0.jsx(kQ,{type:X}),f0.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:G}),f0.jsx("span",{title:Q,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:$.displayPath??Q}),f0.jsxs(C0,{variant:"outline",size:"sm",onClick:()=>Z($),disabled:J,children:[J?f0.jsx(l5,{stroke:1.75,className:"animate-spin"}):f0.jsx(t5,{stroke:1.75}),"Add"]})]})}function wf($){let Z=Date.now()-new Date($).getTime(),J=Math.floor(Z/60000);if(J<1)return"Added just now";if(J<60)return`Added ${J} min${J===1?"":"s"} ago`;let Q=Math.floor(J/60);if(Q<24)return`Added ${Q} hour${Q===1?"":"s"} ago`;let X=Math.floor(Q/24);if(X<30)return`Added ${X} day${X===1?"":"s"} ago`;return`Added ${new Date($).toLocaleDateString()}`}var aQ=O(l(),1);function mA(){return aQ.jsx(A2,{panel:"flat",children:aQ.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:aQ.jsx(fA,{})})})}var LS=O(v(),1);function sQ($){return F5({queryKey:T0.sessions($),queryFn:()=>f1(`/api/workspaces/${$}/sessions`),...p7})}function uA($,Z){return F5({queryKey:T0.events($,Z??""),queryFn:async()=>{let J=await fetch(`/api/workspaces/${$}/sessions/${Z}/events`),Q=J.ok?await J.json():[];return HU(Q)},enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function nQ($){return F5({queryKey:T0.models($),queryFn:()=>f1(`/api/workspaces/${$}/models`),staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}function oQ($,Z){return F5({queryKey:T0.threadConfig($,Z??""),queryFn:()=>f1(`/api/workspaces/${$}/sessions/${Z}/config`),enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function pA($){let Z=I1();return c5({mutationFn:({patch:J,sessionId:Q})=>f1(`/api/workspaces/${$}/sessions/${Q}/config`,Q4("PUT",J),"Failed to save thread config"),onSuccess:(J,{sessionId:Q})=>{Z.setQueryData(T0.threadConfig($,Q),J)}})}var O2=O(v(),1);function tQ($,Z,J){return`${$}/${Z}/${J}`}var uK=new Map,pK=new Map;function Of($,Z,J){return uK.get(tQ($,Z,J))??0}function cA($,Z,J){return`/api/workspaces/${Z}/${$}/${J}/index.js?v=${Of($,Z,J)}`}function dA($){return pK.get($)}function lA($,Z){pK.set($,Z)}function eQ($,Z,J){let Q=tQ($,Z,J);pK.delete(Q),uK.set(Q,(uK.get(Q)??0)+1)}var Pf={segment:"widgets",shouldReload:($,Z)=>$.type==="widget:updated"&&$.name===Z||$.type==="widgets:refresh"},jf={segment:"views",shouldReload:($,Z)=>$.type==="view:updated"&&$.name===Z};function Cf($,Z,J){let Q=tQ($,Z,J),X=dA(Q);if(X)return X;let G=import(cA($,Z,J)).then((H)=>{if(!H.default)throw Error(`"${J}" has no default export`);return H.default});return lA(Q,G),G}function iA($,Z){let J=P8(),[Q,X]=O2.useState({status:"loading",version:0}),G=O2.useCallback(()=>{X((H)=>({status:"loading",version:H.version})),Cf($.segment,J,Z).then((H)=>X((z)=>({status:"ready",Component:H,version:z.version+1}))).catch((H)=>X((z)=>({status:"error",error:String(H),version:z.version+1})))},[$.segment,J,Z]);return O2.useEffect(()=>{G()},[G]),W7((H)=>{if($.shouldReload(H,Z))eQ($.segment,J,Z),G()}),Q}function rA($){return iA(Pf,$)}function aA($){return iA(jf,$)}function sA(){let $=P8();W7((Z)=>{if(Z.type==="view:updated")eQ("views",$,Z.name);else if(Z.type==="widget:updated")eQ("widgets",$,Z.name)})}var e8=O(v(),1);var G9=O(v(),1);var a8=O(v(),1),If=48;function nA($,Z){let J=a8.useRef(!0),[Q,X]=a8.useState(!0),G=a8.useCallback((z)=>{J.current=z,X((K)=>K===z?K:z)},[]),H=a8.useCallback((z="auto")=>{let K=$.current;if(!K)return;G(!0),K.scrollTo({top:K.scrollHeight,behavior:z})},[$,G]);return a8.useEffect(()=>{let z=$.current;if(!z)return;let K=()=>{let Y=z.scrollHeight-z.scrollTop-z.clientHeight;G(Y<=If)};return z.addEventListener("scroll",K,{passive:!0}),()=>z.removeEventListener("scroll",K)},[$,G]),a8.useEffect(()=>{let z=$.current;if(!z)return;let K=z.firstElementChild??z,Y=new ResizeObserver(()=>{if(J.current)z.scrollTop=z.scrollHeight});return Y.observe(K),()=>Y.disconnect()},[$]),a8.useLayoutEffect(()=>{H("auto")},[Z,H]),{atBottom:Q,scrollToBottom:H}}function Tf($){return $.some((Z)=>Z.type==="text")}function oA($){let Z=[];for(let J of $){if(J.role!=="assistant"){Z.push(J);continue}let Q=Z.length>0?Z[Z.length-1]:null;if(!Tf(J.parts)&&Q!==null&&Q.role==="assistant")Z[Z.length-1]={...Q,parts:[...Q.parts,...J.parts]};else Z.push(J)}return Z}var SX=O(v(),1);async function tA($,Z){let J=new FormData;for(let X of Z)J.append("files",X);let Q=await fetch(`/api/workspaces/${$}/uploads`,{method:"POST",body:J});if(!Q.ok){let X=await Q.text().catch(()=>"");throw Error(X||`Upload failed (${Q.status})`)}return Q.json()}var kX=O(v(),1);var v5={};G4(v5,{createHandle:()=>pD,Trigger:()=>gD,SubmenuTrigger:()=>uD,SubmenuRoot:()=>bD,Separator:()=>mD,Root:()=>DX,RadioItemIndicator:()=>SD,RadioItem:()=>ED,RadioGroup:()=>ID,Positioner:()=>PD,Portal:()=>DD,Popup:()=>_D,LinkItem:()=>LD,Item:()=>VD,Handle:()=>jX,GroupLabel:()=>UD,Group:()=>qD,CheckboxItemIndicator:()=>KD,CheckboxItem:()=>zD,Backdrop:()=>JD,Arrow:()=>$D});var eA=O(v(),1);var $X=O(v(),1),cK=$X.createContext(void 0);function _8($){let Z=$X.useContext(cK);if(Z===void 0&&!$)throw Error(M0(33));return Z}var ZX=O(v(),1),dK=ZX.createContext(void 0);function k1($){let Z=ZX.useContext(dK);if(Z===void 0&&!$)throw Error(M0(36));return Z}var $D=eA.forwardRef(function(Z,J){let{className:Q,render:X,...G}=Z,{store:H}=k1(),{arrowRef:z,side:K,align:Y,arrowUncentered:W,arrowStyles:q}=_8(),U={open:H.useState("open"),side:K,align:Y,uncentered:W};return W0("div",Z,{ref:[z,J],stateAttributesMapping:H1,state:U,props:{style:q,"aria-hidden":!0,...G}})});var ZD=O(v(),1);var JX=O(v(),1),kf=JX.createContext(void 0);function s4($=!0){let Z=JX.useContext(kf);if(Z===void 0&&!$)throw Error(M0(25));return Z}var Ef={...H1,...P1},JD=ZD.forwardRef(function(Z,J){let{className:Q,render:X,...G}=Z,{store:H}=k1(),z=H.useState("open"),K=H.useState("mounted"),Y=H.useState("transitionStatus"),W=H.useState("lastOpenChangeReason"),q=s4(),B={open:z,transitionStatus:Y};return W0("div",Z,{ref:q?.backdropRef?[J,q.backdropRef]:J,state:B,stateAttributesMapping:Ef,props:[{role:"presentation",hidden:!K,style:{pointerEvents:W===o.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},G]})});var HX=O(v(),1);var QX=O(v(),1),lK=QX.createContext(void 0);function QD(){let $=QX.useContext(lK);if($===void 0)throw Error(M0(30));return $}var P2=O(v(),1);var XD=O(v(),1);function XX($){let{closeOnClick:Z,highlighted:J,id:Q,nodeId:X,store:G,itemRef:H,itemMetadata:z}=$,{events:K}=G.useState("floatingTreeRoot"),Y=s4(!0),W=Y!==void 0;return XD.useMemo(()=>({id:Q,role:"menuitem",tabIndex:J?0:-1,onMouseMove(q){if(!X)return;K.emit("itemhover",{nodeId:X,target:q.currentTarget})},onClick(q){if(Z)K.emit("close",{domEvent:q,reason:o.itemPress})},onMouseUp(q){if(Y){let B=Y.initialCursorPointRef.current;if(Y.initialCursorPointRef.current=null,W&&B&&Math.abs(q.clientX-B.x)<=1&&Math.abs(q.clientY-B.y)<=1)return}if(H.current&&G.context.allowMouseUpTriggerRef.current&&(!W||q.button===2)){if(!z||z.type==="regular-item")H.current.click()}}}),[Z,J,Q,K,X,G,H,Y,W,z])}var j2={type:"regular-item"};function i7($){let{closeOnClick:Z,disabled:J=!1,highlighted:Q,id:X,store:G,nativeButton:H,itemMetadata:z,nodeId:K}=$,Y=P2.useRef(null),{getButtonProps:W,buttonRef:q}=M5({disabled:J,focusableWhenDisabled:!0,native:H}),B=XX({closeOnClick:Z,highlighted:Q,id:X,nodeId:K,store:G,itemRef:Y,itemMetadata:z}),U=P2.useCallback((V)=>{return d5(B,{onMouseEnter(){if(z.type!=="submenu-trigger")return;z.setActive()},onKeyUp(N){if(N.key===" "&&G.context.typingRef.current)N.preventBaseUIHandler()}},V,W)},[B,W,G,z]),F=U8(Y,q);return P2.useMemo(()=>({getItemProps:U,itemRef:F}),[U,F])}var B7=O(v(),1);var GX=O(v(),1),iK=GX.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>{return()=>{}},elementsRef:{current:[]},nextIndexRef:{current:0}});function GD(){return GX.useContext(iK)}var Sf=function($){return $[$.None=0]="None",$[$.GuessFromOrder=1]="GuessFromOrder",$}({});function s8($={}){let{label:Z,metadata:J,textRef:Q,indexGuessBehavior:X,index:G}=$,{register:H,unregister:z,subscribeMapChange:K,elementsRef:Y,labelsRef:W,nextIndexRef:q}=GD(),B=B7.useRef(-1),[U,F]=B7.useState(G??(X===Sf.GuessFromOrder?()=>{if(B.current===-1){let L=q.current;q.current+=1,B.current=L}return B.current}:-1)),V=B7.useRef(null),N=B7.useCallback((L)=>{if(V.current=L,U!==-1&&L!==null){if(Y.current[U]=L,W){let _=Z!==void 0;W.current[U]=_?Z:Q?.current?.textContent??L.textContent}}},[U,Y,W,Z,Q]);return Q0(()=>{if(G!=null)return;let L=V.current;if(L)return H(L,J),()=>{z(L)};return},[G,H,z,J]),Q0(()=>{if(G!=null)return;return K((L)=>{let _=V.current?L.get(V.current)?.index:null;if(_!=null)F(_)})},[G,K,F]),B7.useMemo(()=>({ref:N,index:U}),[U,N])}var rK=function($){return $.checked="data-checked",$.unchecked="data-unchecked",$.disabled="data-disabled",$.highlighted="data-highlighted",$}({});var r7={checked($){if($)return{[rK.checked]:""};return{[rK.unchecked]:""}},...P1};var HD=O(l(),1),zD=HX.forwardRef(function(Z,J){let{render:Q,className:X,id:G,label:H,nativeButton:z=!1,disabled:K=!1,closeOnClick:Y=!1,checked:W,defaultChecked:q,onCheckedChange:B,...U}=Z,F=s8({label:H}),V=_8(!0),N=c0(G),{store:L}=k1(),_=L.useState("isActive",F.index),w=L.useState("itemProps"),[A,D]=l4({controlled:W,default:q??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:M,itemRef:j}=i7({closeOnClick:Y,disabled:K,highlighted:_,id:N,store:L,nativeButton:z,nodeId:V?.nodeId,itemMetadata:j2}),T=HX.useMemo(()=>({disabled:K,highlighted:_,checked:A}),[K,_,A]),E=H0((g)=>{let b={...N0(o.itemPress,g.nativeEvent),preventUnmountOnClose:()=>{}};if(B?.(!A,b),b.isCanceled)return;D((k)=>!k)}),C=W0("div",Z,{state:T,stateAttributesMapping:r7,props:[w,{role:"menuitemcheckbox","aria-checked":A,onClick:E},U,M],ref:[j,J,F.ref]});return HD.jsx(lK.Provider,{value:T,children:C})});var zX=O(v(),1);var KD=zX.forwardRef(function(Z,J){let{render:Q,className:X,keepMounted:G=!1,...H}=Z,z=QD(),K=zX.useRef(null),{transitionStatus:Y,setMounted:W}=d8(z.checked);L5({open:z.checked,ref:K,onComplete(){if(!z.checked)W(!1)}});let q={checked:z.checked,disabled:z.disabled,highlighted:z.highlighted,transitionStatus:Y};return W0("span",Z,{state:q,ref:[J,K],stateAttributesMapping:r7,props:{"aria-hidden":!0,...H},enabled:G||z.checked})});var C2=O(v(),1);var KX=O(v(),1),aK=KX.createContext(void 0);function YD(){let $=KX.useContext(aK);if($===void 0)throw Error(M0(31));return $}var WD=O(l(),1),qD=C2.forwardRef(function(Z,J){let{render:Q,className:X,...G}=Z,[H,z]=C2.useState(void 0),K=C2.useMemo(()=>({setLabelId:z}),[z]),Y=W0("div",Z,{ref:J,props:{role:"group","aria-labelledby":H,...G}});return WD.jsx(aK.Provider,{value:K,children:Y})});var BD=O(v(),1);var UD=BD.forwardRef(function(Z,J){let{className:Q,render:X,id:G,...H}=Z,z=c0(G),{setLabelId:K}=YD();return Q0(()=>{return K(z),()=>{K(void 0)}},[K,z]),W0("div",Z,{ref:J,props:{id:z,role:"presentation",...H}})});var FD=O(v(),1);var VD=FD.forwardRef(function(Z,J){let{render:Q,className:X,id:G,label:H,nativeButton:z=!1,disabled:K=!1,closeOnClick:Y=!0,...W}=Z,q=s8({label:H}),B=_8(!0),U=c0(G),{store:F}=k1(),V=F.useState("isActive",q.index),N=F.useState("itemProps"),{getItemProps:L,itemRef:_}=i7({closeOnClick:Y,disabled:K,highlighted:V,id:U,store:F,nativeButton:z,nodeId:B?.nodeId,itemMetadata:j2});return W0("div",Z,{state:{disabled:K,highlighted:V},props:[N,W,L],ref:[_,J,q.ref]})});var I2=O(v(),1);var LD=I2.forwardRef(function(Z,J){let{render:Q,className:X,id:G,label:H,closeOnClick:z=!1,...K}=Z,Y=I2.useRef(null),W=s8({label:H}),B=_8(!0)?.nodeId,U=c0(G),{store:F}=k1(),V=F.useState("isActive",W.index),N=F.useState("itemProps"),L=XX({closeOnClick:z,highlighted:V,id:U,nodeId:B,store:F,itemRef:Y}),_=I2.useMemo(()=>({highlighted:V}),[V]);return W0("a",Z,{state:_,props:[N,K,L],ref:[Y,J,W.ref]})});var qX=O(v(),1);var YX=O(v(),1),Rf=YX.createContext(void 0);function WX($){let Z=YX.useContext(Rf);if(Z===void 0&&!$)throw Error(M0(69));return Z}var ND=O(l(),1),bf={...H1,...P1},_D=qX.forwardRef(function(Z,J){let{render:Q,className:X,finalFocus:G,...H}=Z,{store:z}=k1(),{side:K,align:Y}=_8(),W=WX(!0)!=null,q=z.useState("open"),B=z.useState("transitionStatus"),U=z.useState("popupProps"),F=z.useState("mounted"),V=z.useState("instantType"),N=z.useState("activeTriggerElement"),L=z.useState("parent"),_=z.useState("lastOpenChangeReason"),w=z.useState("rootId"),A=z.useState("floatingRootContext"),D=z.useState("floatingTreeRoot"),M=z.useState("closeDelay"),j=z.useState("activeTriggerElement"),T=L.type==="context-menu";L5({open:q,ref:z.context.popupRef,onComplete(){if(q)z.context.onOpenChangeComplete?.(!0)}}),qX.useEffect(()=>{function x(R){z.setOpen(!1,N0(R.reason,R.domEvent))}return D.events.on("close",x),()=>{D.events.off("close",x)}},[D.events,z]);let E=z.useState("hoverEnabled"),C=z.useState("disabled");z7(A,{enabled:E&&!C&&!T&&L.type!=="menubar",closeDelay:M});let g={transitionStatus:B,side:K,align:Y,open:q,nested:L.type==="menu",instant:V},b=W0("div",Z,{state:g,ref:[J,z.context.popupRef],stateAttributesMapping:bf,props:[U,{onKeyDown(x){if(W&&Q2.has(x.key))x.stopPropagation()}},a5(B),H,{"data-rootownerid":w}]}),k=L.type===void 0||T;if(N||L.type==="menubar"&&_!==o.outsidePress)k=!0;return ND.jsx(S9,{context:A,modal:T,disabled:!F,returnFocus:G===void 0?k:G,initialFocus:L.type!=="menu",restoreFocus:!0,externalTree:L.type!=="menubar"?D:void 0,previousFocusableElement:j,nextFocusableElement:L.type===void 0?z.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:L.type===void 0?z.context.beforeContentFocusGuardRef:void 0,children:b})});var AD=O(v(),1);var BX=O(v(),1),sK=BX.createContext(void 0);function MD(){let $=BX.useContext(sK);if($===void 0)throw Error(M0(32));return $}var nK=O(l(),1),DD=AD.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z,{store:G}=k1();if(!(G.useState("mounted")||Q))return null;return nK.jsx(sK.Provider,{value:Q,children:nK.jsx(E9,{ref:J,...X})})});var n4=O(v(),1);var a7=O(v(),1);var wD=O(l(),1);function OD($){let{children:Z,elementsRef:J,labelsRef:Q,onMapChange:X}=$,G=H0(X),H=a7.useRef(0),z=$1(xf).current,K=$1(yf).current,[Y,W]=a7.useState(0),q=a7.useRef(Y),B=H0((L,_)=>{K.set(L,_??null),q.current+=1,W(q.current)}),U=H0((L)=>{K.delete(L),q.current+=1,W(q.current)}),F=a7.useMemo(()=>{vf(Y);let L=new Map;return Array.from(K.keys()).filter((w)=>w.isConnected).sort(hf).forEach((w,A)=>{let D=K.get(w)??{};L.set(w,{...D,index:A})}),L},[K,Y]);Q0(()=>{if(typeof MutationObserver!=="function"||F.size===0)return;let L=new MutationObserver((_)=>{let w=new Set,A=(D)=>w.has(D)?w.delete(D):w.add(D);if(_.forEach((D)=>{D.removedNodes.forEach(A),D.addedNodes.forEach(A)}),w.size===0)q.current+=1,W(q.current)});return F.forEach((_,w)=>{if(w.parentElement)L.observe(w.parentElement,{childList:!0})}),()=>{L.disconnect()}},[F]),Q0(()=>{if(q.current===Y){if(J.current.length!==F.size)J.current.length=F.size;if(Q&&Q.current.length!==F.size)Q.current.length=F.size;H.current=F.size}G(F)},[G,F,J,Q,Y]),Q0(()=>{return()=>{J.current=[]}},[J]),Q0(()=>{return()=>{if(Q)Q.current=[]}},[Q]);let V=H0((L)=>{return z.add(L),()=>{z.delete(L)}});Q0(()=>{z.forEach((L)=>L(F))},[z,F]);let N=a7.useMemo(()=>({register:B,unregister:U,subscribeMapChange:V,elementsRef:J,labelsRef:Q,nextIndexRef:H}),[B,U,V,J,Q,H]);return wD.jsx(iK.Provider,{value:N,children:Z})}function yf(){return new Map}function xf(){return new Set}function hf($,Z){let J=$.compareDocumentPosition(Z);if(J&Node.DOCUMENT_POSITION_FOLLOWING||J&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(J&Node.DOCUMENT_POSITION_PRECEDING||J&Node.DOCUMENT_POSITION_CONTAINS)return 1;return 0}function vf($){}var T2=O(l(),1),PD=n4.forwardRef(function(Z,J){let{anchor:Q,positionMethod:X="absolute",className:G,render:H,side:z,align:K,sideOffset:Y=0,alignOffset:W=0,collisionBoundary:q="clipping-ancestors",collisionPadding:B=5,arrowPadding:U=5,sticky:F=!1,disableAnchorTracking:V=!1,collisionAvoidance:N=RU,...L}=Z,{store:_}=k1(),w=MD(),A=s4(!0),D=_.useState("parent"),M=_.useState("floatingRootContext"),j=_.useState("floatingTreeRoot"),T=_.useState("mounted"),E=_.useState("open"),C=_.useState("modal"),g=_.useState("activeTriggerElement"),b=_.useState("transitionStatus"),k=_.useState("lastOpenChangeReason"),x=_.useState("floatingNodeId"),R=_.useState("floatingParentNodeId"),I=Q,S=Y,h=W,p=K,P=N;if(D.type==="context-menu"){if(I=Q??D.context?.anchor,p=p??"start",!z&&p!=="center")h=Z.alignOffset??2,S=Z.sideOffset??-5}let t=z,z0=p;if(D.type==="menu")t=t??"inline-end",z0=z0??"start",P=Z.collisionAvoidance??C7;else if(D.type==="menubar")t=t??"bottom",z0=z0??"start";let y=D.type==="context-menu",n=f7({anchor:I,floatingRootContext:M,positionMethod:A?"fixed":X,mounted:T,side:t,sideOffset:S,align:z0,alignOffset:h,arrowPadding:y?0:U,collisionBoundary:q,collisionPadding:B,sticky:F,nodeId:x,keepMounted:w,disableAnchorTracking:V,collisionAvoidance:P,shiftCrossAxis:y&&!(("side"in P)&&P.side==="flip"),externalTree:j}),_0=n4.useMemo(()=>{let U0={};if(!E)U0.pointerEvents="none";return{role:"presentation",hidden:!T,style:{...n.positionerStyles,...U0}}},[E,T,n.positionerStyles]);n4.useEffect(()=>{function U0(m){if(m.open){if(m.parentNodeId===x)_.set("hoverEnabled",!1);if(m.nodeId!==x&&m.parentNodeId===_.select("floatingParentNodeId"))_.setOpen(!1,N0(o.siblingOpen))}}return j.events.on("menuopenchange",U0),()=>{j.events.off("menuopenchange",U0)}},[_,j.events,x]),n4.useEffect(()=>{if(_.select("floatingParentNodeId")==null)return;function U0(m){if(m.open||m.nodeId!==_.select("floatingParentNodeId"))return;let s=m.reason??o.siblingOpen;_.setOpen(!1,N0(s))}return j.events.on("menuopenchange",U0),()=>{j.events.off("menuopenchange",U0)}},[j.events,_]),n4.useEffect(()=>{function U0(m){if(!E||m.nodeId!==_.select("floatingParentNodeId"))return;if(m.target&&g&&g!==m.target)_.setOpen(!1,N0(o.siblingOpen))}return j.events.on("itemhover",U0),()=>{j.events.off("itemhover",U0)}},[j.events,E,g,_]),n4.useEffect(()=>{let U0={open:E,nodeId:x,parentNodeId:R,reason:_.select("lastOpenChangeReason")};j.events.emit("menuopenchange",U0)},[j.events,E,_,x,R]);let c={open:E,side:n.side,align:n.align,anchorHidden:n.anchorHidden,nested:D.type==="menu"},X0=n4.useMemo(()=>({side:n.side,align:n.align,arrowRef:n.arrowRef,arrowUncentered:n.arrowUncentered,arrowStyles:n.arrowStyles,nodeId:n.context.nodeId}),[n.side,n.align,n.arrowRef,n.arrowUncentered,n.arrowStyles,n.context.nodeId]),K0=W0("div",Z,{state:c,stateAttributesMapping:H1,ref:[J,_.useStateSetter("positionerElement")],props:[_0,a5(b),L]}),Z0=T&&D.type!=="menu"&&(D.type!=="menubar"&&C&&k!==o.triggerHover||D.type==="menubar"&&D.context.modal),G0=null;if(D.type==="menubar")G0=D.context.contentElement;else if(D.type===void 0)G0=g;return T2.jsxs(cK.Provider,{value:X0,children:[Z0&&T2.jsx(X2,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:m7(!E),cutout:G0}),T2.jsx(m3,{id:x,children:T2.jsx(OD,{elementsRef:_.context.itemDomElements,labelsRef:_.context.itemLabels,children:K0})})]})});var k2=O(v(),1);var UX=O(v(),1),oK=UX.createContext(void 0);function jD(){let $=UX.useContext(oK);if($===void 0)throw Error(M0(34));return $}var CD=O(l(),1),ID=k2.memo(k2.forwardRef(function(Z,J){let{render:Q,className:X,value:G,defaultValue:H,onValueChange:z,disabled:K=!1,...Y}=Z,[W,q]=l4({controlled:G,default:H,name:"MenuRadioGroup"}),B=H0(z),U=H0((L,_)=>{if(B?.(L,_),_.isCanceled)return;q(L)}),V=W0("div",Z,{state:{disabled:K},ref:J,props:{role:"group","aria-disabled":K||void 0,...Y}}),N=k2.useMemo(()=>({value:W,setValue:U,disabled:K}),[W,U,K]);return CD.jsx(oK.Provider,{value:N,children:V})}));var VX=O(v(),1);var FX=O(v(),1),tK=FX.createContext(void 0);function TD(){let $=FX.useContext(tK);if($===void 0)throw Error(M0(35));return $}var kD=O(l(),1),ED=VX.forwardRef(function(Z,J){let{render:Q,className:X,id:G,label:H,nativeButton:z=!1,disabled:K=!1,closeOnClick:Y=!1,value:W,...q}=Z,B=s8({label:H}),U=_8(!0),F=c0(G),{store:V}=k1(),N=V.useState("isActive",B.index),L=V.useState("itemProps"),{value:_,setValue:w,disabled:A}=jD(),D=A||K,M=_===W,{getItemProps:j,itemRef:T}=i7({closeOnClick:Y,disabled:D,highlighted:N,id:F,store:V,nativeButton:z,nodeId:U?.nodeId,itemMetadata:j2}),E=VX.useMemo(()=>({disabled:D,highlighted:N,checked:M}),[D,N,M]),C=H0((b)=>{let k={...N0(o.itemPress,b.nativeEvent),preventUnmountOnClose:()=>{}};w(W,k)}),g=W0("div",Z,{state:E,stateAttributesMapping:r7,props:[L,{role:"menuitemradio","aria-checked":M,onClick:C},q,j],ref:[T,J,B.ref]});return kD.jsx(tK.Provider,{value:E,children:g})});var LX=O(v(),1);var SD=LX.forwardRef(function(Z,J){let{render:Q,className:X,keepMounted:G=!1,...H}=Z,z=TD(),K=LX.useRef(null),{transitionStatus:Y,setMounted:W}=d8(z.checked);L5({open:z.checked,ref:K,onComplete(){if(!z.checked)W(!1)}});let q={checked:z.checked,disabled:z.disabled,highlighted:z.highlighted,transitionStatus:Y};return W0("span",Z,{state:q,stateAttributesMapping:r7,ref:[J,K],props:{"aria-hidden":!0,...H},enabled:G||z.checked})});var t1=O(v(),1);var NX=O(v(),1),gf=NX.createContext(null);function _X($){let Z=NX.useContext(gf);if(Z===null&&!$)throw Error(M0(5));return Z}var C$=O(v(),1);var ff={...m4,disabled:w0(($)=>$.parent.type==="menubar"?$.parent.context.disabled||$.disabled:$.disabled),modal:w0(($)=>($.parent.type===void 0||$.parent.type==="context-menu")&&($.modal??!0)),allowMouseEnter:w0(($)=>$.allowMouseEnter),stickIfOpen:w0(($)=>$.stickIfOpen),parent:w0(($)=>$.parent),rootId:w0(($)=>{if($.parent.type==="menu")return $.parent.store.select("rootId");return $.parent.type!==void 0?$.parent.context.rootId:$.rootId}),activeIndex:w0(($)=>$.activeIndex),isActive:w0(($,Z)=>$.activeIndex===Z),hoverEnabled:w0(($)=>$.hoverEnabled),instantType:w0(($)=>$.instantType),lastOpenChangeReason:w0(($)=>$.openChangeReason),floatingTreeRoot:w0(($)=>{if($.parent.type==="menu")return $.parent.store.select("floatingTreeRoot");return $.floatingTreeRoot}),floatingNodeId:w0(($)=>$.floatingNodeId),floatingParentNodeId:w0(($)=>$.floatingParentNodeId),itemProps:w0(($)=>$.itemProps),closeDelay:w0(($)=>$.closeDelay),keyboardEventRelay:w0(($)=>{if($.keyboardEventRelay)return $.keyboardEventRelay;if($.parent.type==="menu")return $.parent.store.select("keyboardEventRelay");return})};class E2 extends T8{constructor($){super({...mf(),...$},{positionerRef:C$.createRef(),popupRef:C$.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:C$.createRef(),beforeContentFocusGuardRef:C$.createRef(),onOpenChangeComplete:void 0,triggerElements:new z8},ff);this.unsubscribeParentListener=this.observe("parent",(Z)=>{if(this.unsubscribeParentListener?.(),Z.type==="menu"){this.unsubscribeParentListener=Z.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=Z.store.context.allowMouseUpTriggerRef;return}if(Z.type!==void 0)this.context.allowMouseUpTriggerRef=Z.context.allowMouseUpTriggerRef;this.unsubscribeParentListener=null})}setOpen($,Z){this.state.floatingRootContext.context.events.emit("setOpen",{open:$,eventDetails:Z})}static useStore($,Z){let J=$1(()=>{return new E2(Z)}).current;return $??J}unsubscribeParentListener=null}function mf(){return{...f4(),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 C9,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:e0,keyboardEventRelay:void 0,closeDelay:0}}var MX=O(v(),1),eK=MX.createContext(void 0);function AX(){return MX.useContext(eK)}var $Y=O(l(),1),DX=i3(function(Z){let{children:J,open:Q,onOpenChange:X,onOpenChangeComplete:G,defaultOpen:H=!1,disabled:z=!1,modal:K,loopFocus:Y=!0,orientation:W="vertical",actionsRef:q,closeParentOnEsc:B=!1,handle:U,triggerId:F,defaultTriggerId:V=null,highlightItemOnHover:N=!0}=Z,L=s4(!0),_=k1(!0),w=_X(!0),A=AX(),D=t1.useMemo(()=>{if(A&&_)return{type:"menu",store:_.store};if(w)return{type:"menubar",context:w};if(L&&!_)return{type:"context-menu",context:L};return{type:void 0}},[L,_,w,A]),M=E2.useStore(U?.store,{open:H,openProp:Q,activeTriggerId:V,triggerIdProp:F,parent:D});k4(()=>{if(Q===void 0&&M.state.open===!1&&H===!0)M.update({open:!0,activeTriggerId:V})}),M.useControlledProp("openProp",Q),M.useControlledProp("triggerIdProp",F),M.useContextCallback("onOpenChangeComplete",G);let j=M.useState("floatingTreeRoot"),T=I9(j),E=w5();Q0(()=>{if(L&&!_)M.update({parent:{type:"context-menu",context:L},floatingNodeId:T,floatingParentNodeId:E});else if(_)M.update({floatingNodeId:T,floatingParentNodeId:E})},[L,_,T,E,M]);let C=M.useState("open"),g=M.useState("activeTriggerElement"),b=M.useState("positionerElement"),k=M.useState("hoverEnabled"),x=M.useState("modal"),R=M.useState("disabled"),I=M.useState("lastOpenChangeReason"),S=M.useState("parent"),h=M.useState("activeIndex"),p=M.useState("payload"),P=M.useState("floatingParentNodeId"),t=t1.useRef(null),z0=P!=null,y;M.useSyncedValues({disabled:z,modal:S.type===void 0?K:void 0,rootId:F8()});let{openMethod:n,triggerProps:_0,reset:c}=z2(C);v4(M);let{forceUnmount:X0}=g4(C,M,()=>{M.update({allowMouseEnter:!1,stickIfOpen:!0}),c()}),K0=t1.useRef(S.type!=="context-menu"),Z0=J5();t1.useEffect(()=>{if(!C)t.current=null;if(S.type!=="context-menu")return;if(!C){Z0.clear(),K0.current=!1;return}Z0.start(500,()=>{K0.current=!0})},[Z0,C,S.type]),G2(C&&x&&I!==o.triggerHover&&n!=="touch",b),Q0(()=>{if(!C&&!k)M.set("hoverEnabled",!0)},[C,k,M]);let G0=t1.useRef(!0),U0=J5(),m=H0((h0,d0)=>{let t0=d0.reason;if(C===h0&&d0.trigger===g&&I===t0)return;if(d0.preventUnmountOnClose=()=>{M.set("preventUnmountingOnClose",!0)},!h0&&d0.trigger==null)d0.trigger=g??void 0;if(X?.(h0,d0),d0.isCanceled)return;let m0={open:h0,nativeEvent:d0.event,reason:d0.reason,nested:z0};y?.emit("openchange",m0);let X1=d0.event;if(h0===!1&&X1?.type==="click"&&X1.pointerType==="touch"&&!G0.current)return;if(!h0&&h!==null){let x0=M.context.itemDomElements.current[h];queueMicrotask(()=>{x0?.setAttribute("tabindex","-1")})}if(h0&&t0===o.triggerFocus)G0.current=!1,U0.start(300,()=>{G0.current=!0});else G0.current=!0,U0.clear();let q5=(t0===o.triggerPress||t0===o.itemPress)&&X1.detail===0&&X1?.isTrusted,v1=!h0&&(t0===o.escapeKey||t0==null),B5={open:h0,openChangeReason:t0};t.current=d0.event??null;let E0=d0.trigger?.id??null;if(E0||h0)B5.activeTriggerId=E0,B5.activeTriggerElement=d0.trigger??null;if(M.update(B5),S.type==="menubar"&&(t0===o.triggerFocus||t0===o.focusOut||t0===o.triggerHover||t0===o.listNavigation||t0===o.siblingOpen))M.set("instantType","group");else if(q5||v1)M.set("instantType",q5?"click":"dismiss");else M.set("instantType",void 0)}),s=t1.useCallback((h0)=>{let d0=N0(h0);return d0.preventUnmountOnClose=()=>{M.set("preventUnmountingOnClose",!0)},d0},[M]),u=t1.useCallback(()=>{M.setOpen(!1,s(o.imperativeAction))},[M,s]);t1.useImperativeHandle(q,()=>({unmount:X0,close:u}),[X0,u]);let F0;if(S.type==="context-menu")F0=S.context;t1.useImperativeHandle(F0?.positionerRef,()=>b,[b]),t1.useImperativeHandle(F0?.actionsRef,()=>({setOpen:m}),[m]);let i=K4({popupStore:M,onOpenChange:m});y=i.context.events,t1.useEffect(()=>{let h0=({open:d0,eventDetails:t0})=>m(d0,t0);return y.on("setOpen",h0),()=>{y?.off("setOpen",h0)}},[y,m]);let Y0=z4(i,{enabled:!R,bubbles:{escapeKey:B&&S.type==="menu"},outsidePress(){if(S.type!=="context-menu"||t.current?.type==="contextmenu")return!0;return K0.current},externalTree:z0?j:void 0}),r=v9(i,{role:"menu"}),e=g7(),q0=t1.useCallback((h0)=>{if(M.select("activeIndex")===h0)return;M.set("activeIndex",h0)},[M]),a=iz(i,{enabled:!R,listRef:M.context.itemDomElements,activeIndex:h,nested:S.type!==void 0,loopFocus:Y,orientation:W,parentOrientation:S.type==="menubar"?S.context.orientation:void 0,rtl:e==="rtl",disabledIndices:R6,onNavigate:q0,openOnArrowKeyDown:S.type!=="context-menu",externalTree:z0?j:void 0,focusItemOnHover:N}),A0=t1.useCallback((h0)=>{M.context.typingRef.current=h0},[M]),I0=rz(i,{listRef:M.context.itemLabels,activeIndex:h,resetMs:EU,onMatch:(h0)=>{if(C&&h0!==h)M.set("activeIndex",h0)},onTypingChange:A0}),{getReferenceProps:i0,getFloatingProps:z1,getItemProps:f,getTriggerProps:d}=P5([Y0,r,a,I0]),$0=t1.useMemo(()=>{let h0=d5(i0(),{onMouseMove(){M.set("allowMouseEnter",!0)}},_0);return delete h0.role,h0},[i0,M,_0]),V0=t1.useMemo(()=>{let h0=d();if(!h0)return h0;let d0=d5(h0,_0);return delete d0.role,delete d0["aria-controls"],d0},[d,_0]),j0=t1.useMemo(()=>z1({onMouseMove(){if(M.set("allowMouseEnter",!0),S.type==="menu")M.set("hoverEnabled",!1)},onClick(){if(M.select("hoverEnabled"))M.set("hoverEnabled",!1)},onKeyDown(h0){let d0=M.select("keyboardEventRelay");if(d0&&!h0.isPropagationStopped())d0(h0)}}),[z1,S.type,M]),g0=t1.useMemo(()=>f(),[f]);M.useSyncedValues({floatingRootContext:i,activeTriggerProps:$0,inactiveTriggerProps:V0,popupProps:j0,itemProps:g0});let D1=t1.useMemo(()=>({store:M,parent:D}),[M,D]),h1=$Y.jsx(dK.Provider,{value:D1,children:typeof J==="function"?J({payload:p}):J});if(S.type===void 0||S.type==="context-menu")return $Y.jsx(u3,{externalTree:j,children:h1});return h1});var RD=O(v(),1);var ZY=O(l(),1);function bD($){let Z=k1().store,J=RD.useMemo(()=>({parentMenu:Z}),[Z]);return ZY.jsx(eK.Provider,{value:J,children:ZY.jsx(DX,{...$})})}var e5=O(v(),1),QY=O(I8(),1);function yD($){let Z=$.getBoundingClientRect(),J=window.getComputedStyle($,"::before"),Q=window.getComputedStyle($,"::after");if(!(J.content!=="none"||Q.content!=="none"))return Z;let G=parseFloat(J.width)||0,H=parseFloat(J.height)||0,z=parseFloat(Q.width)||0,K=parseFloat(Q.height)||0,Y=Math.max(Z.width,G,z),W=Math.max(Z.height,H,K),q=Y-Z.width,B=W-Z.height;return{left:Z.left-q/2,right:Z.right+q/2,top:Z.top-B/2,bottom:Z.bottom+B/2}}var wX=O(v(),1);function xD($={}){let{highlightItemOnHover:Z,highlightedIndex:J,onHighlightedIndexChange:Q}=k6(),{ref:X,index:G}=s8($),H=J===G,z=wX.useRef(null),K=U8(X,z);return{compositeProps:wX.useMemo(()=>({tabIndex:H?0:-1,onFocus(){Q(G)},onMouseMove(){let W=z.current;if(!Z||!W)return;let q=W.hasAttribute("disabled")||W.ariaDisabled==="true";if(!H&&!q)W.focus()}}),[H,Q,G,Z]),compositeRef:K,index:G}}function hD($){let{render:Z,className:J,state:Q=e0,props:X=R6,refs:G=R6,metadata:H,stateAttributesMapping:z,tag:K="div",...Y}=$,{compositeProps:W,compositeRef:q}=xD({metadata:H});return W0(K,$,{state:Q,ref:[...G,q],props:[W,...X,Y],stateAttributesMapping:z})}function JY($){if(b1($)&&$.hasAttribute("data-rootownerid"))return $.getAttribute("data-rootownerid")??void 0;if(a6($))return;return JY(kJ($))}var OX=O(v(),1);function vD($){let{enabled:Z=!0,mouseDownAction:J,open:Q}=$,X=OX.useRef(!1);return OX.useMemo(()=>{if(!Z)return e0;return{onMouseDown:(G)=>{if(J==="open"&&!Q||J==="close"&&Q)X.current=!0,p0(G.currentTarget).addEventListener("click",()=>{X.current=!1},{once:!0})},onClick:(G)=>{if(X.current)X.current=!1,G.preventBaseUIHandler()}}},[Z,J,Q])}var s7=O(l(),1),PX=2,gD=bJ(function(Z,J){let{render:Q,className:X,disabled:G=!1,nativeButton:H=!0,id:z,openOnHover:K,delay:Y=100,closeDelay:W=0,handle:q,payload:B,...U}=Z,F=k1(!0),V=q?.store??F?.store;if(!V)throw Error(M0(85));let N=c0(z),L=V.useState("isTriggerActive",N),_=V.useState("floatingRootContext"),w=V.useState("isOpenedByTrigger",N),A=e5.useRef(null),D=pf(),M=k6(!0),j=r5(),T=e5.useMemo(()=>{return j??new C9},[j]),E=I9(T),C=w5(),{registerTrigger:g,isMountedByThisTrigger:b}=h4(N,A,V,{payload:B,closeDelay:W,parent:D,floatingTreeRoot:T,floatingNodeId:E,floatingParentNodeId:C,keyboardEventRelay:M?.relayKeyboardEvent}),k=D.type==="menubar",x=V.useState("disabled"),R=G||x||k&&D.context.disabled,{getButtonProps:I,buttonRef:S}=M5({disabled:R,native:H});e5.useEffect(()=>{if(!w&&D.type===void 0)V.context.allowMouseUpTriggerRef.current=!1},[V,w,D.type]);let h=e5.useRef(null),p=J5(),P=H0((Y0)=>{if(!h.current)return;p.clear(),V.context.allowMouseUpTriggerRef.current=!1;let r=Y0.target;if(S0(h.current,r)||S0(V.select("positionerElement"),r)||r===h.current)return;if(r!=null&&JY(r)===V.select("rootId"))return;let e=yD(h.current);if(Y0.clientX>=e.left-PX&&Y0.clientX<=e.right+PX&&Y0.clientY>=e.top-PX&&Y0.clientY<=e.bottom+PX)return;T.events.emit("close",{domEvent:Y0,reason:o.cancelOpen})});e5.useEffect(()=>{if(w&&V.select("lastOpenChangeReason")===o.triggerHover)p0(h.current).addEventListener("mouseup",P,{once:!0})},[w,P,V]);let t=k&&D.context.hasSubmenuOpen,y=Y4(_,{enabled:(K??t)&&!R&&D.type!=="context-menu"&&(!k||t&&!b),handleClose:W4({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:D.type===void 0?Y:void 0,delay:{close:W},triggerElementRef:A,externalTree:T,isActiveTrigger:L}),n=uf(w,V.select("lastOpenChangeReason")),_0=H7(_,{enabled:!R&&D.type!=="context-menu",event:w&&k?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?n:!1}),c=y9(_,{enabled:!R&&t}),X0=vD({open:w,enabled:k,mouseDownAction:"open"}),K0=P5([_0,c]),Z0={disabled:R,open:w},G0=V.useState("triggerProps",b),U0=[h,J,S,g,A],m=[K0.getReferenceProps(),y??e0,G0,{"aria-haspopup":"menu",id:N,onMouseDown:(Y0)=>{if(V.select("open"))return;p.start(200,()=>{V.context.allowMouseUpTriggerRef.current=!0}),p0(Y0.currentTarget).addEventListener("mouseup",P,{once:!0})}},k?{role:"menuitem"}:{},X0,U,I],s=e5.useRef(null),u=H0((Y0)=>{QY.flushSync(()=>{V.setOpen(!1,N0(o.focusOut,Y0.nativeEvent,Y0.currentTarget))}),_J(s.current)?.focus()}),F0=H0((Y0)=>{let r=V.select("positionerElement");if(r&&X4(Y0,r))V.context.beforeContentFocusGuardRef.current?.focus();else{QY.flushSync(()=>{V.setOpen(!1,N0(o.focusOut,Y0.nativeEvent,Y0.currentTarget))});let e=NJ(V.context.triggerFocusTargetRef.current||A.current);while(e!==null&&S0(r,e)){let q0=e;if(e=S7(e),e===q0)break}e?.focus()}}),i=W0("button",Z,{enabled:!k,stateAttributesMapping:o3,state:Z0,ref:U0,props:m});if(k)return s7.jsx(hD,{tag:"button",render:Q,className:X,state:Z0,refs:U0,props:m,stateAttributesMapping:o3});if(w)return s7.jsxs(e5.Fragment,{children:[s7.jsx(p8,{ref:s,onFocus:u},`${N}-pre-focus-guard`),s7.jsx(e5.Fragment,{children:i},N),s7.jsx(p8,{ref:V.context.triggerFocusTargetRef,onFocus:F0},`${N}-post-focus-guard`)]});return s7.jsx(e5.Fragment,{children:i},N)});function uf($,Z){let J=J5(),[Q,X]=e5.useState(!1);return Q0(()=>{if($&&Z==="trigger-hover")X(!0),J.start(iZ,()=>{X(!1)});else if(!$)J.clear(),X(!1)},[$,Z,J]),Q}function pf(){let $=s4(!0),Z=k1(!0),J=_X(!0);return e5.useMemo(()=>{if(J)return{type:"menubar",context:J};if($&&!Z)return{type:"context-menu",context:$};return{type:void 0}},[$,Z,J])}var fD=O(v(),1);var mD=fD.forwardRef(function(Z,J){let{className:Q,render:X,orientation:G="horizontal",...H}=Z;return W0("div",Z,{state:{orientation:G},ref:J,props:[{role:"separator","aria-orientation":G},H]})});var U7=O(v(),1);var uD=U7.forwardRef(function(Z,J){let{render:Q,className:X,label:G,id:H,nativeButton:z=!1,openOnHover:K=!0,delay:Y=100,closeDelay:W=0,disabled:q=!1,...B}=Z,U=s8(),F=_8(),{store:V}=k1(),N=c0(H),L=V.useState("open"),_=V.useState("floatingRootContext"),w=V.useState("floatingTreeRoot"),A=mz(N,V),D=U7.useCallback((_0)=>{let c=A(_0);if(_0!==null&&V.select("open")&&V.select("activeTriggerId")==null)V.update({activeTriggerId:N,activeTriggerElement:_0,closeDelay:W});return c},[A,W,V,N]),M=U7.useRef(null),j=U7.useCallback((_0)=>{M.current=_0,V.set("activeTriggerElement",_0)},[V]),T=AX();if(!T?.parentMenu)throw Error(M0(37));V.useSyncedValue("closeDelay",W);let E=T.parentMenu,C=E.useState("itemProps"),g=E.useState("isActive",U.index),b=U7.useMemo(()=>({type:"submenu-trigger",setActive(){E.set("activeIndex",U.index)}}),[E,U.index]),k=V.useState("disabled"),x=q||k,{getItemProps:R,itemRef:I}=i7({closeOnClick:!1,disabled:x,highlighted:g,id:N,store:V,nativeButton:z,itemMetadata:b,nodeId:F?.nodeId}),S=V.useState("hoverEnabled"),h=E.useState("allowMouseEnter"),p=Y4(_,{enabled:S&&K&&!x,handleClose:W4({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:Y,delay:h?{open:Y,close:W}:0,triggerElementRef:M,externalTree:w}),P=H7(_,{enabled:!x,event:"mousedown",toggle:!K,ignoreMouse:K,stickIfOpen:!1}),t=P5([P]),z0=V.useState("triggerProps",!0);return delete z0.id,W0("div",Z,{state:{disabled:x,highlighted:g,open:L},stateAttributesMapping:p4,props:[t.getReferenceProps(),p,z0,C,{tabIndex:L||g?0:-1,onBlur(){if(g)E.set("activeIndex",null)}},B,R],ref:[J,U.ref,I,D,j]})});class jX{constructor(){this.store=new E2}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(M0(83,$));this.store.setOpen(!0,N0("imperative-action",void 0,Z))}close(){this.store.setOpen(!1,N0("imperative-action",void 0,void 0))}get isOpen(){return this.store.state.open}}function pD(){return new jX}var Y5=O(l(),1);function S2({...$}){return Y5.jsx(v5.Root,{"data-slot":"dropdown-menu",...$})}function R2({...$}){return Y5.jsx(v5.Trigger,{"data-slot":"dropdown-menu-trigger",...$})}function Z6({align:$="start",alignOffset:Z=0,side:J="bottom",sideOffset:Q=4,className:X,...G}){return Y5.jsx(v5.Portal,{children:Y5.jsx(v5.Positioner,{className:"isolate z-50 outline-none",align:$,alignOffset:Z,side:J,sideOffset:Q,children:Y5.jsx(v5.Popup,{"data-slot":"dropdown-menu-content",className:B0("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-border 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",X),...G})})})}function J6({...$}){return Y5.jsx(v5.Group,{"data-slot":"dropdown-menu-group",...$})}function cD({className:$,inset:Z,...J}){return Y5.jsx(v5.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":Z,className:B0("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",$),...J})}function I$({className:$,inset:Z,variant:J="default",...Q}){return Y5.jsx(v5.Item,{"data-slot":"dropdown-menu-item","data-inset":Z,"data-variant":J,className:B0("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-xs px-1.5 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",$),...Q})}function dD({...$}){return Y5.jsx(v5.SubmenuRoot,{"data-slot":"dropdown-menu-sub",...$})}function lD({className:$,inset:Z,children:J,...Q}){return Y5.jsxs(v5.SubmenuTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":Z,className:B0("flex cursor-default items-center gap-2 rounded-xs px-1.5 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-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",$),...Q,children:[J,Y5.jsx(v6,{className:"cn-rtl-flip ml-auto",stroke:1.75})]})}function iD({align:$="start",alignOffset:Z=-3,side:J="right",sideOffset:Q=0,className:X,...G}){return Y5.jsx(Z6,{"data-slot":"dropdown-menu-sub-content",className:B0("w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-border duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 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),align:$,alignOffset:Z,side:J,sideOffset:Q,...G})}function XY({...$}){return Y5.jsx(v5.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...$})}function GY({className:$,children:Z,inset:J,...Q}){return Y5.jsxs(v5.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":J,className:B0("relative flex cursor-default items-center gap-2 rounded-xs 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",$),...Q,children:[Y5.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:Y5.jsx(v5.RadioItemIndicator,{children:Y5.jsx($J,{stroke:1.75})})}),Z]})}function rD({className:$,...Z}){return Y5.jsx(v5.Separator,{"data-slot":"dropdown-menu-separator",className:B0("-mx-1 my-1 h-px bg-border",$),...Z})}function aD({className:$,...Z}){return Y5.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:B0("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",$),...Z})}var k$={};G4(k$,{Thumb:()=>$w,Root:()=>tD});var n7=O(v(),1);var CX=O(v(),1),HY=CX.createContext(void 0);function sD(){let $=CX.useContext(HY);if($===void 0)throw Error(M0(63));return $}var zY=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 IX={...N8,checked($){if($)return{[zY.checked]:""};return{[zY.unchecked]:""}}};var nD=O(v(),1);function oD($,Z){let J=nD.useRef($),Q=H0(Z);Q0(()=>{if(J.current===$)return;Q(J.current)},[$,Q]),Q0(()=>{J.current=$},[$])}var T$=O(l(),1),tD=n7.forwardRef(function(Z,J){let{checked:Q,className:X,defaultChecked:G,id:H,inputRef:z,name:K,nativeButton:Y=!1,onCheckedChange:W,readOnly:q=!1,required:B=!1,disabled:U=!1,render:F,uncheckedValue:V,value:N,...L}=Z,{clearErrors:_}=d4(),{state:w,setTouched:A,setDirty:D,validityData:M,setFilled:j,setFocused:T,shouldValidateOnChange:E,validationMode:C,disabled:g,name:b,validation:k}=S5(),{labelId:x}=n5(),R=g||U,I=b??K,S=H0(W),h=n7.useRef(null),p=U8(h,z,k.inputRef),P=n7.useRef(null),t=c0(),z0=_Q({id:H,implicit:!1,controlRef:P}),y=Y?void 0:z0,[n,_0]=l4({controlled:Q,default:Boolean(G),name:"Switch",state:"checked"});MQ({id:t,commit:k.commit,value:n,controlRef:P,name:I,getValue:()=>n}),Q0(()=>{if(h.current)j(h.current.checked)},[h,j]),oD(n,()=>{if(_(I),D(n!==M.initialValue),j(n),E())k.commit(n);else k.commit(n,!0)});let{getButtonProps:c,buttonRef:X0}=M5({disabled:R,native:Y}),K0={id:Y?z0:t,role:"switch","aria-checked":n,"aria-readonly":q||void 0,"aria-required":B||void 0,"aria-labelledby":x,onFocus(){if(!R)T(!0)},onBlur(){let m=h.current;if(!m||R)return;if(A(!0),T(!1),C==="onBlur")k.commit(m.checked)},onClick(m){if(q||R)return;m.preventDefault(),h.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:m.shiftKey,ctrlKey:m.ctrlKey,altKey:m.altKey,metaKey:m.metaKey}))}},Z0=n7.useMemo(()=>d5({checked:n,disabled:R,id:y,name:I,required:B,style:I?UL:l6,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:p,onChange(m){if(m.nativeEvent.defaultPrevented)return;let s=m.target.checked,u=N0(o.none,m.nativeEvent);if(S?.(s,u),u.isCanceled)return;_0(s)},onFocus(){P.current?.focus()}},k.getInputValidationProps,N!==void 0?{value:N}:e0),[n,R,p,y,I,S,B,_0,k,N]),G0=n7.useMemo(()=>({...w,checked:n,disabled:R,readOnly:q,required:B}),[w,n,R,q,B]),U0=W0("span",Z,{state:G0,ref:[J,P,X0],props:[K0,k.getValidationProps,L,c],stateAttributesMapping:IX});return T$.jsxs(HY.Provider,{value:G0,children:[U0,!n&&I&&V!==void 0&&T$.jsx("input",{type:"hidden",name:I,value:V}),T$.jsx("input",{...Z0})]})});var eD=O(v(),1);var $w=eD.forwardRef(function(Z,J){let{render:Q,className:X,...G}=Z,{state:H}=S5(),z=sD(),K={...H,...z};return W0("span",Z,{state:K,ref:J,stateAttributesMapping:IX,props:G})});var KY=O(l(),1);function TX({className:$,...Z}){return KY.jsx(k$.Root,{"data-slot":"switch",className:B0("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:bg-primary data-unchecked:bg-input",$),...Z,children:KY.jsx(k$.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 i1=O(l(),1);function Zw($){return $?.split(/\s*·\s*/)[0]??""}function cf($){return $.charAt(0).toUpperCase()+$.slice(1)}function YY($){return $==="xhigh"?"Extra":cf($)}function WY($){let Z=$?.match(/\$\d+(?:\.\d+)?\s*\/\s*\$(\d+(?:\.\d+)?)\s*per Mtok/);return Z?Number(Z[1]):-1}function Jw($){return $.resolvedModel?.replace(/\[[^\]]*\]$/,"")}function Qw($,Z){let J=WY($.description);if(J>=0)return J;let Q=Jw($),X=Z.find((G)=>G!==$&&Jw(G)===Q&&WY(G.description)>=0);return X?WY(X.description):-1}var Xw=kX.memo(function(){let{workspaceId:Z,layout:J,setLayout:Q}=Q5(),{data:X}=nQ(Z),G=X?.models??[],H=G.find((E)=>E.value==="default"),z=G.filter((E)=>E.value!=="default").sort((E,C)=>Qw(C,G)-Qw(E,G)),K=O8((E)=>E.activeByWorkspace[Z]??null),Y=oQ(Z,K).data,W=pA(Z),[q,B]=kX.useState(!1),U=(K?Y?.model:void 0)??J.selectedModel,F=(K?Y?.effort:void 0)??J.selectedEffort,V=(E)=>{if(K)W.mutate({sessionId:K,patch:{model:E}});else Q({selectedModel:E})},N=(E)=>{if(K)W.mutate({sessionId:K,patch:{effort:E}});else Q({selectedEffort:E})};if(z.length===0)return null;let L=z.some((E)=>E.value===U)?U:void 0,_=z.find((E)=>H?.resolvedModel&&E.resolvedModel===H.resolvedModel)??z[0],w=L??_.value,A=z.find((E)=>E.value===w)??z[0],D=A.supportsEffort?A.supportedEffortLevels??[]:[],M=F&&D.includes(F)?F:D[0],j=D.length>0,T=!!A.supportsFastMode;return i1.jsxs(S2,{children:[i1.jsx(R2,{render:i1.jsxs(C0,{variant:"ghost",children:[i1.jsx("span",{className:"font-normal text-foreground",children:Zw(A.description)||A.displayName}),M&&i1.jsx("span",{className:"text-muted-foreground",children:YY(M)}),i1.jsx(b2,{stroke:1.5})]})}),i1.jsxs(Z6,{align:"start",side:"top",className:"min-w-56",children:[i1.jsxs(J6,{children:[i1.jsx(cD,{children:"Models"}),i1.jsx(XY,{value:w,onValueChange:V,children:z.map((E)=>i1.jsx(GY,{value:E.value,closeOnClick:!0,children:Zw(E.description)||E.displayName},E.value))})]}),(j||T)&&i1.jsx(rD,{}),j&&i1.jsxs(dD,{children:[i1.jsx(lD,{children:i1.jsxs("div",{className:"flex flex-1 items-center justify-between",children:["Reasoning",M&&i1.jsx("span",{className:"ml-auto text-muted-foreground",children:YY(M)})]})}),i1.jsx(iD,{children:i1.jsx(XY,{value:M,onValueChange:N,children:D.map((E)=>i1.jsx(GY,{value:E,closeOnClick:!0,children:YY(E)},E))})})]}),T&&i1.jsx(J6,{className:"mt-0.5",children:i1.jsxs("label",{className:"flex cursor-pointer items-center justify-between gap-4 rounded-xs px-2 py-1 text-sm",children:["Fast mode",i1.jsx(TX,{checked:q,onCheckedChange:B})]})})]})]})});var E1=O(l(),1);function zw({composerRef:$,onSend:Z,onStop:J,processing:Q}){let X=SX.useRef(null),G=P8(),H=O8((L)=>L.activeByWorkspace[G]??null),z=O8((L)=>L.drafts[C4(G,H)]??""),K=O8((L)=>L.attachments[C4(G,H)]??df),[Y,W]=SX.useState(!1),q=K.some((L)=>L.status==="uploading"),B=K.some((L)=>L.status==="ready"),U=(z.trim().length>0||B)&&!q,F=(L)=>R1.getState().setDraft(G,H,L),V=(L)=>{if(L.length===0)return;let _=R1.getState(),w=L.map((A)=>({localId:crypto.randomUUID(),name:A.name||"file",mediaType:A.type||"application/octet-stream",previewUrl:A.type.startsWith("image/")?URL.createObjectURL(A):void 0,status:"uploading"}));_.addAttachments(G,H,w),w.forEach((A,D)=>{tA(G,[L[D]]).then(([M])=>R1.getState().updateAttachment(G,H,A.localId,{status:"ready",upload:M,mediaType:M.mediaType})).catch((M)=>R1.getState().updateAttachment(G,H,A.localId,{status:"error",error:M instanceof Error?M.message:"Upload failed"}))})},N=()=>{if(!U)return;Z(z),R1.getState().setDraft(G,H,"")};return E1.jsxs("form",{onSubmit:(L)=>{L.preventDefault(),N()},onMouseDown:(L)=>{if(L.target instanceof HTMLElement&&L.target.closest("button"))return;L.preventDefault(),$.current?.focus()},onDragOver:(L)=>{if(!L.dataTransfer.types.includes("Files"))return;L.preventDefault(),W(!0)},onDragLeave:(L)=>{if(L.currentTarget.contains(L.relatedTarget))return;W(!1)},onDrop:(L)=>{if(!L.dataTransfer.types.includes("Files"))return;L.preventDefault(),W(!1),V(Array.from(L.dataTransfer.files))},className:B0("flex w-full cursor-text flex-col gap-1 rounded-lg bg-card p-2 text-card-foreground shadow-xs transition-[color,box-shadow] outline-none focus-within:shadow-sm",Y&&"ring-2 ring-ring/60"),children:[K.length>0&&E1.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-0.5",children:K.map((L)=>E1.jsx(lf,{attachment:L,onRemove:()=>R1.getState().removeAttachment(G,H,L.localId)},L.localId))}),E1.jsx("textarea",{ref:$,id:"chat-input",name:"message",value:z,onChange:(L)=>F(L.target.value),onKeyDown:(L)=>{if(L.key==="Enter"&&!L.shiftKey)L.preventDefault(),N()},onPaste:(L)=>{let _=Array.from(L.clipboardData?.files??[]);if(_.length===0)return;L.preventDefault(),V(_)},placeholder:Q?"Queue a follow-up...":"Ask anything...",rows:1,className:"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"}),E1.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[E1.jsx("input",{ref:X,type:"file",multiple:!0,hidden:!0,onChange:(L)=>{V(Array.from(L.target.files??[])),L.target.value=""}}),E1.jsx(C0,{type:"button",variant:"ghost",size:"icon",className:"mr-auto",onClick:()=>X.current?.click(),"aria-label":"Attach files",children:E1.jsx(EX,{stroke:1.5})}),E1.jsx(Xw,{}),Q?E1.jsx(C0,{type:"button",size:"icon",onClick:J,"aria-label":"Stop agent",children:E1.jsx(Hw,{stroke:1.5})}):E1.jsx(C0,{type:"submit",size:"icon",disabled:!U,"aria-label":"Send message",children:E1.jsx(Gw,{stroke:1.5})})]})]})}var df=[];function lf({attachment:$,onRemove:Z}){let{name:J,previewUrl:Q,status:X,error:G}=$,H=!!Q;return E1.jsxs("div",{className:B0("group relative flex items-center gap-2 overflow-hidden rounded-md border border-border bg-accent text-accent-foreground",H?"size-14":"h-10 max-w-52 pr-2 pl-2",X==="error"&&"border-destructive/50"),title:G??J,children:[H?E1.jsx("img",{src:Q,alt:J,className:"size-full object-cover"}):E1.jsxs(E1.Fragment,{children:[E1.jsx(y2,{size:16,stroke:1.75,className:"shrink-0 text-muted-foreground"}),E1.jsx("span",{className:"truncate text-xs",children:J})]}),X==="uploading"&&E1.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/70",children:E1.jsx(l5,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),X==="error"&&E1.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-destructive/10 text-[10px] text-destructive",children:"Failed"}),E1.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,"aria-label":`Remove ${J}`,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:E1.jsx(U4,{stroke:1.75})})]})}var M8=O(l(),1);function rf($){let Z=new Date($),J=new Date,Q=Z.toDateString()===J.toDateString(),X=new Date(J);X.setDate(X.getDate()-1);let G=Z.toDateString()===X.toDateString();if(Q)return Z.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});if(G)return"Yesterday";return Z.toLocaleDateString([],{month:"short",day:"numeric"})}function Kw({onSwitch:$}){let Z=P8(),{data:J=[],refetch:Q}=sQ(Z),X=O8((K)=>K.activeByWorkspace[Z]??null),H=J.find((K)=>K.sessionId===X)?.summary??"New thread";function z(K){$(K)}return M8.jsxs(S2,{onOpenChange:(K)=>{if(K)Q()},children:[M8.jsx(R2,{render:M8.jsxs(C0,{variant:"ghost",children:[M8.jsx("span",{className:"max-w-64 truncate",children:H}),M8.jsx(b2,{stroke:1.5})]})}),M8.jsxs(Z6,{align:"start",className:"max-h-80 w-80 overflow-y-auto",children:[M8.jsxs(I$,{className:"text-muted-foreground! **:text-muted-foreground!",onClick:()=>z(null),children:[M8.jsx(t5,{size:16,stroke:1.75}),"New thread"]}),J.length>0&&M8.jsx(J6,{children:J.map((K)=>M8.jsxs(I$,{className:B0(X===K.sessionId&&"bg-accent text-accent-foreground"),onClick:()=>z(K.sessionId),children:[M8.jsx("span",{className:"truncate",children:K.summary}),M8.jsx(aD,{className:"shrink-0 tracking-normal",children:rf(K.lastModified)})]},K.sessionId))})]})]})}var hC=O(v(),1);function U1(){}function RX(){}function Yw($,Z){let J=Z||{};return($[$.length-1]===""?[...$,""]:$).join((J.padRight?" ":"")+","+(J.padLeft===!1?"":" ")).trim()}var af=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sf=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nf={};function bX($,Z){return((Z||nf).jsx?sf:af).test($)}var of=/[ \t\n\f\r]/g;function qY($){return typeof $==="object"?$.type==="text"?Ww($.value):!1:Ww($)}function Ww($){return $.replace(of,"")===""}class o7{constructor($,Z,J){if(this.normal=Z,this.property=$,J)this.space=J}}o7.prototype.normal={};o7.prototype.property={};o7.prototype.space=void 0;function BY($,Z){let J={},Q={};for(let X of $)Object.assign(J,X.property),Object.assign(Q,X.normal);return new o7(J,Q,Z)}function E$($){return $.toLowerCase()}class g5{constructor($,Z){this.attribute=Z,this.property=$}}g5.prototype.attribute="";g5.prototype.booleanish=!1;g5.prototype.boolean=!1;g5.prototype.commaOrSpaceSeparated=!1;g5.prototype.commaSeparated=!1;g5.prototype.defined=!1;g5.prototype.mustUseProperty=!1;g5.prototype.number=!1;g5.prototype.overloadedBoolean=!1;g5.prototype.property="";g5.prototype.spaceSeparated=!1;g5.prototype.space=void 0;var S$={};G4(S$,{spaceSeparated:()=>A1,overloadedBoolean:()=>yX,number:()=>L0,commaSeparated:()=>t7,commaOrSpaceSeparated:()=>A8,booleanish:()=>X5,boolean:()=>l0});var tf=0,l0=Q6(),X5=Q6(),yX=Q6(),L0=Q6(),A1=Q6(),t7=Q6(),A8=Q6();function Q6(){return 2**++tf}var UY=Object.keys(S$);class x2 extends g5{constructor($,Z,J,Q){let X=-1;super($,Z);if(qw(this,"space",Q),typeof J==="number")while(++X<UY.length){let G=UY[X];qw(this,UY[X],(J&S$[G])===S$[G])}}}x2.prototype.defined=!0;function qw($,Z,J){if(J)$[Z]=J}function n8($){let Z={},J={};for(let[Q,X]of Object.entries($.properties)){let G=new x2(Q,$.transform($.attributes||{},Q),X,$.space);if($.mustUseProperty&&$.mustUseProperty.includes(Q))G.mustUseProperty=!0;Z[Q]=G,J[E$(Q)]=Q,J[E$(G.attribute)]=Q}return new o7(Z,J,$.space)}var FY=n8({properties:{ariaActiveDescendant:null,ariaAtomic:X5,ariaAutoComplete:null,ariaBusy:X5,ariaChecked:X5,ariaColCount:L0,ariaColIndex:L0,ariaColSpan:L0,ariaControls:A1,ariaCurrent:null,ariaDescribedBy:A1,ariaDetails:null,ariaDisabled:X5,ariaDropEffect:A1,ariaErrorMessage:null,ariaExpanded:X5,ariaFlowTo:A1,ariaGrabbed:X5,ariaHasPopup:null,ariaHidden:X5,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:A1,ariaLevel:L0,ariaLive:null,ariaModal:X5,ariaMultiLine:X5,ariaMultiSelectable:X5,ariaOrientation:null,ariaOwns:A1,ariaPlaceholder:null,ariaPosInSet:L0,ariaPressed:X5,ariaReadOnly:X5,ariaRelevant:null,ariaRequired:X5,ariaRoleDescription:A1,ariaRowCount:L0,ariaRowIndex:L0,ariaRowSpan:L0,ariaSelected:X5,ariaSetSize:L0,ariaSort:null,ariaValueMax:L0,ariaValueMin:L0,ariaValueNow:L0,ariaValueText:null,role:null},transform($,Z){return Z==="role"?Z:"aria-"+Z.slice(4).toLowerCase()}});function xX($,Z){return Z in $?$[Z]:Z}function hX($,Z){return xX($,Z.toLowerCase())}var Bw=n8({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:t7,acceptCharset:A1,accessKey:A1,action:null,allow:null,allowFullScreen:l0,allowPaymentRequest:l0,allowUserMedia:l0,alt:null,as:null,async:l0,autoCapitalize:null,autoComplete:A1,autoFocus:l0,autoPlay:l0,blocking:A1,capture:null,charSet:null,checked:l0,cite:null,className:A1,cols:L0,colSpan:null,content:null,contentEditable:X5,controls:l0,controlsList:A1,coords:L0|t7,crossOrigin:null,data:null,dateTime:null,decoding:null,default:l0,defer:l0,dir:null,dirName:null,disabled:l0,download:yX,draggable:X5,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:l0,formTarget:null,headers:A1,height:L0,hidden:yX,high:L0,href:null,hrefLang:null,htmlFor:A1,httpEquiv:A1,id:null,imageSizes:null,imageSrcSet:null,inert:l0,inputMode:null,integrity:null,is:null,isMap:l0,itemId:null,itemProp:A1,itemRef:A1,itemScope:l0,itemType:A1,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:l0,low:L0,manifest:null,max:null,maxLength:L0,media:null,method:null,min:null,minLength:L0,multiple:l0,muted:l0,name:null,nonce:null,noModule:l0,noValidate:l0,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:l0,optimum:L0,pattern:null,ping:A1,placeholder:null,playsInline:l0,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:l0,referrerPolicy:null,rel:A1,required:l0,reversed:l0,rows:L0,rowSpan:L0,sandbox:A1,scope:null,scoped:l0,seamless:l0,selected:l0,shadowRootClonable:l0,shadowRootDelegatesFocus:l0,shadowRootMode:null,shape:null,size:L0,sizes:null,slot:null,span:L0,spellCheck:X5,src:null,srcDoc:null,srcLang:null,srcSet:null,start:L0,step:null,style:null,tabIndex:L0,target:null,title:null,translate:null,type:null,typeMustMatch:l0,useMap:null,value:X5,width:L0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:A1,axis:null,background:null,bgColor:null,border:L0,borderColor:null,bottomMargin:L0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:l0,declare:l0,event:null,face:null,frame:null,frameBorder:null,hSpace:L0,leftMargin:L0,link:null,longDesc:null,lowSrc:null,marginHeight:L0,marginWidth:L0,noResize:l0,noHref:l0,noShade:l0,noWrap:l0,object:null,profile:null,prompt:null,rev:null,rightMargin:L0,rules:null,scheme:null,scrolling:X5,standby:null,summary:null,text:null,topMargin:L0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:L0,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:l0,disableRemotePlayback:l0,prefix:null,property:null,results:L0,security:null,unselectable:null},space:"html",transform:hX});var Uw=n8({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:A8,accentHeight:L0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:L0,amplitude:L0,arabicForm:null,ascent:L0,attributeName:null,attributeType:null,azimuth:L0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:L0,by:null,calcMode:null,capHeight:L0,className:A1,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:L0,diffuseConstant:L0,direction:null,display:null,dur:null,divisor:L0,dominantBaseline:null,download:l0,dx:null,dy:null,edgeMode:null,editable:null,elevation:L0,enableBackground:null,end:null,event:null,exponent:L0,externalResourcesRequired:null,fill:null,fillOpacity:L0,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:t7,g2:t7,glyphName:t7,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:L0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:L0,horizOriginX:L0,horizOriginY:L0,id:null,ideographic:L0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:L0,k:L0,k1:L0,k2:L0,k3:L0,k4:L0,kernelMatrix:A8,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:L0,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:L0,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:L0,overlineThickness:L0,paintOrder:null,panose1:null,path:null,pathLength:L0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:A1,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:L0,pointsAtY:L0,pointsAtZ:L0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:A8,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:A8,rev:A8,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:A8,requiredFeatures:A8,requiredFonts:A8,requiredFormats:A8,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:L0,specularExponent:L0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:L0,strikethroughThickness:L0,string:null,stroke:null,strokeDashArray:A8,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:L0,strokeOpacity:L0,strokeWidth:null,style:null,surfaceScale:L0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:A8,tabIndex:L0,tableValues:null,target:null,targetX:L0,targetY:L0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:A8,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:L0,underlineThickness:L0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:L0,values:null,vAlphabetic:L0,vMathematical:L0,vectorEffect:null,vHanging:L0,vIdeographic:L0,version:null,vertAdvY:L0,vertOriginX:L0,vertOriginY:L0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:L0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:xX});var VY=n8({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform($,Z){return"xlink:"+Z.slice(5).toLowerCase()}});var LY=n8({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:hX});var NY=n8({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform($,Z){return"xml:"+Z.slice(3).toLowerCase()}});var _Y={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 ef=/[A-Z]/g,Fw=/-[a-z]/g,$m=/^data[-\w.:]+$/i;function MY($,Z){let J=E$(Z),Q=Z,X=g5;if(J in $.normal)return $.property[$.normal[J]];if(J.length>4&&J.slice(0,4)==="data"&&$m.test(Z)){if(Z.charAt(4)==="-"){let G=Z.slice(5).replace(Fw,Jm);Q="data"+G.charAt(0).toUpperCase()+G.slice(1)}else{let G=Z.slice(4);if(!Fw.test(G)){let H=G.replace(ef,Zm);if(H.charAt(0)!=="-")H="-"+H;Z="data"+H}}X=x2}return new X(Q,Z)}function Zm($){return"-"+$.toLowerCase()}function Jm($){return $.charAt(1).toUpperCase()}var Vw=BY([FY,Bw,VY,LY,NY],"html"),vX=BY([FY,Uw,VY,LY,NY],"svg");function Lw($){return $.join(" ").trim()}var bw=O(kw(),1);var gX=Ew("end"),h2=Ew("start");function Ew($){return Z;function Z(J){let Q=J&&J.position&&J.position[$]||{};if(typeof Q.line==="number"&&Q.line>0&&typeof Q.column==="number"&&Q.column>0)return{line:Q.line,column:Q.column,offset:typeof Q.offset==="number"&&Q.offset>-1?Q.offset:void 0}}}function wY($){let Z=h2($),J=gX($);if(Z&&J)return{start:Z,end:J}}function e7($){if(!$||typeof $!=="object")return"";if("position"in $||"type"in $)return Sw($.position);if("start"in $||"end"in $)return Sw($);if("line"in $||"column"in $)return OY($);return""}function OY($){return Rw($&&$.line)+":"+Rw($&&$.column)}function Sw($){return OY($&&$.start)+"-"+OY($&&$.end)}function Rw($){return $&&typeof $==="number"?$:1}class _5 extends Error{constructor($,Z,J){super();if(typeof Z==="string")J=Z,Z=void 0;let Q="",X={},G=!1;if(Z)if("line"in Z&&"column"in Z)X={place:Z};else if("start"in Z&&"end"in Z)X={place:Z};else if("type"in Z)X={ancestors:[Z],place:Z.position};else X={...Z};if(typeof $==="string")Q=$;else if(!X.cause&&$)G=!0,Q=$.message,X.cause=$;if(!X.ruleId&&!X.source&&typeof J==="string"){let z=J.indexOf(":");if(z===-1)X.ruleId=J;else X.source=J.slice(0,z),X.ruleId=J.slice(z+1)}if(!X.place&&X.ancestors&&X.ancestors){let z=X.ancestors[X.ancestors.length-1];if(z)X.place=z.position}let H=X.place&&"start"in X.place?X.place.start:X.place;this.ancestors=X.ancestors||void 0,this.cause=X.cause||void 0,this.column=H?H.column:void 0,this.fatal=void 0,this.file="",this.message=Q,this.line=H?H.line:void 0,this.name=e7(X.place)||"1:1",this.place=X.place||void 0,this.reason=this.message,this.ruleId=X.ruleId||void 0,this.source=X.source||void 0,this.stack=G&&X.cause&&typeof X.cause.stack==="string"?X.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}_5.prototype.file="";_5.prototype.name="";_5.prototype.reason="";_5.prototype.message="";_5.prototype.stack="";_5.prototype.column=void 0;_5.prototype.line=void 0;_5.prototype.ancestors=void 0;_5.prototype.cause=void 0;_5.prototype.fatal=void 0;_5.prototype.place=void 0;_5.prototype.ruleId=void 0;_5.prototype.source=void 0;var PY={}.hasOwnProperty,Tm=new Map,km=/[A-Z]/g,Em=new Set(["table","tbody","thead","tfoot","tr"]),Sm=new Set(["td","th"]),yw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function jY($,Z){if(!Z||Z.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let J=Z.filePath||void 0,Q;if(Z.development){if(typeof Z.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");Q=fm(J,Z.jsxDEV)}else{if(typeof Z.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof Z.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");Q=gm(J,Z.jsx,Z.jsxs)}let X={Fragment:Z.Fragment,ancestors:[],components:Z.components||{},create:Q,elementAttributeNameCase:Z.elementAttributeNameCase||"react",evaluater:Z.createEvaluater?Z.createEvaluater():void 0,filePath:J,ignoreInvalidStyle:Z.ignoreInvalidStyle||!1,passKeys:Z.passKeys!==!1,passNode:Z.passNode||!1,schema:Z.space==="svg"?vX:Vw,stylePropertyNameCase:Z.stylePropertyNameCase||"dom",tableCellAlignToStyle:Z.tableCellAlignToStyle!==!1},G=xw(X,$,void 0);if(G&&typeof G!=="string")return G;return X.create($,X.Fragment,{children:G||void 0},void 0)}function xw($,Z,J){if(Z.type==="element")return Rm($,Z,J);if(Z.type==="mdxFlowExpression"||Z.type==="mdxTextExpression")return bm($,Z);if(Z.type==="mdxJsxFlowElement"||Z.type==="mdxJsxTextElement")return xm($,Z,J);if(Z.type==="mdxjsEsm")return ym($,Z);if(Z.type==="root")return hm($,Z,J);if(Z.type==="text")return vm($,Z)}function Rm($,Z,J){let Q=$.schema,X=Q;if(Z.tagName.toLowerCase()==="svg"&&Q.space==="html")X=vX,$.schema=X;$.ancestors.push(Z);let G=vw($,Z.tagName,!1),H=mm($,Z),z=IY($,Z);if(Em.has(Z.tagName))z=z.filter(function(K){return typeof K==="string"?!qY(K):!0});return hw($,H,G,Z),CY(H,z),$.ancestors.pop(),$.schema=Q,$.create(Z,G,H,J)}function bm($,Z){if(Z.data&&Z.data.estree&&$.evaluater){let Q=Z.data.estree.body[0];return U1(Q.type==="ExpressionStatement"),$.evaluater.evaluateExpression(Q.expression)}b$($,Z.position)}function ym($,Z){if(Z.data&&Z.data.estree&&$.evaluater)return $.evaluater.evaluateProgram(Z.data.estree);b$($,Z.position)}function xm($,Z,J){let Q=$.schema,X=Q;if(Z.name==="svg"&&Q.space==="html")X=vX,$.schema=X;$.ancestors.push(Z);let G=Z.name===null?$.Fragment:vw($,Z.name,!0),H=um($,Z),z=IY($,Z);return hw($,H,G,Z),CY(H,z),$.ancestors.pop(),$.schema=Q,$.create(Z,G,H,J)}function hm($,Z,J){let Q={};return CY(Q,IY($,Z)),$.create(Z,$.Fragment,Q,J)}function vm($,Z){return Z.value}function hw($,Z,J,Q){if(typeof J!=="string"&&J!==$.Fragment&&$.passNode)Z.node=Q}function CY($,Z){if(Z.length>0){let J=Z.length>1?Z:Z[0];if(J)$.children=J}}function gm($,Z,J){return Q;function Q(X,G,H,z){let Y=Array.isArray(H.children)?J:Z;return z?Y(G,H,z):Y(G,H)}}function fm($,Z){return J;function J(Q,X,G,H){let z=Array.isArray(G.children),K=h2(Q);return Z(X,G,H,z,{columnNumber:K?K.column-1:void 0,fileName:$,lineNumber:K?K.line:void 0},void 0)}}function mm($,Z){let J={},Q,X;for(X in Z.properties)if(X!=="children"&&PY.call(Z.properties,X)){let G=pm($,X,Z.properties[X]);if(G){let[H,z]=G;if($.tableCellAlignToStyle&&H==="align"&&typeof z==="string"&&Sm.has(Z.tagName))Q=z;else J[H]=z}}if(Q){let G=J.style||(J.style={});G[$.stylePropertyNameCase==="css"?"text-align":"textAlign"]=Q}return J}function um($,Z){let J={};for(let Q of Z.attributes)if(Q.type==="mdxJsxExpressionAttribute")if(Q.data&&Q.data.estree&&$.evaluater){let G=Q.data.estree.body[0];U1(G.type==="ExpressionStatement");let H=G.expression;U1(H.type==="ObjectExpression");let z=H.properties[0];U1(z.type==="SpreadElement"),Object.assign(J,$.evaluater.evaluateExpression(z.argument))}else b$($,Z.position);else{let X=Q.name,G;if(Q.value&&typeof Q.value==="object")if(Q.value.data&&Q.value.data.estree&&$.evaluater){let z=Q.value.data.estree.body[0];U1(z.type==="ExpressionStatement"),G=$.evaluater.evaluateExpression(z.expression)}else b$($,Z.position);else G=Q.value===null?!0:Q.value;J[X]=G}return J}function IY($,Z){let J=[],Q=-1,X=$.passKeys?new Map:Tm;while(++Q<Z.children.length){let G=Z.children[Q],H;if($.passKeys){let K=G.type==="element"?G.tagName:G.type==="mdxJsxFlowElement"||G.type==="mdxJsxTextElement"?G.name:void 0;if(K){let Y=X.get(K)||0;H=K+"-"+Y,X.set(K,Y+1)}}let z=xw($,G,H);if(z!==void 0)J.push(z)}return J}function pm($,Z,J){let Q=MY($.schema,Z);if(J===null||J===void 0||typeof J==="number"&&Number.isNaN(J))return;if(Array.isArray(J))J=Q.commaSeparated?Yw(J):Lw(J);if(Q.property==="style"){let X=typeof J==="object"?J:cm($,String(J));if($.stylePropertyNameCase==="css")X=dm(X);return["style",X]}return[$.elementAttributeNameCase==="react"&&Q.space?_Y[Q.property]||Q.property:Q.attribute,J]}function cm($,Z){try{return bw.default(Z,{reactCompat:!0})}catch(J){if($.ignoreInvalidStyle)return{};let Q=J,X=new _5("Cannot parse `style` attribute",{ancestors:$.ancestors,cause:Q,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw X.file=$.filePath||void 0,X.url=yw+"#cannot-parse-style-attribute",X}}function vw($,Z,J){let Q;if(!J)Q={type:"Literal",value:Z};else if(Z.includes(".")){let X=Z.split("."),G=-1,H;while(++G<X.length){let z=bX(X[G])?{type:"Identifier",name:X[G]}:{type:"Literal",value:X[G]};H=H?{type:"MemberExpression",object:H,property:z,computed:Boolean(G&&z.type==="Literal"),optional:!1}:z}U1(H,"always a result"),Q=H}else Q=bX(Z)&&!/^[a-z]/.test(Z)?{type:"Identifier",name:Z}:{type:"Literal",value:Z};if(Q.type==="Literal"){let X=Q.value;return PY.call($.components,X)?$.components[X]:X}if($.evaluater)return $.evaluater.evaluateExpression(Q);b$($)}function b$($,Z){let J=new _5("Cannot handle MDX estrees without `createEvaluater`",{ancestors:$.ancestors,place:Z,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw J.file=$.filePath||void 0,J.url=yw+"#cannot-handle-mdx-estrees-without-createevaluater",J}function dm($){let Z={},J;for(J in $)if(PY.call($,J))Z[lm(J)]=$[J];return Z}function lm($){let Z=$.replace(km,im);if(Z.slice(0,3)==="ms-")Z="-"+Z;return Z}function im($){return"-"+$.toLowerCase()}var y$={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 d2=O(l(),1),HP=O(v(),1);var rm={};function G6($,Z){let J=Z||rm,Q=typeof J.includeImageAlt==="boolean"?J.includeImageAlt:!0,X=typeof J.includeHtml==="boolean"?J.includeHtml:!0;return fw($,Q,X)}function fw($,Z,J){if(am($)){if("value"in $)return $.type==="html"&&!J?"":$.value;if(Z&&"alt"in $&&$.alt)return $.alt;if("children"in $)return gw($.children,Z,J)}if(Array.isArray($))return gw($,Z,J);return""}function gw($,Z,J){let Q=[],X=-1;while(++X<$.length)Q[X]=fw($[X],Z,J);return Q.join("")}function am($){return Boolean($&&typeof $==="object")}var mw=document.createElement("i");function v2($){let Z="&"+$+";";mw.innerHTML=Z;let J=mw.textContent;if(J.charCodeAt(J.length-1)===59&&$!=="semi")return!1;return J===Z?!1:J}function W5($,Z,J,Q){let X=$.length,G=0,H;if(Z<0)Z=-Z>X?0:X+Z;else Z=Z>X?X:Z;if(J=J>0?J:0,Q.length<1e4)H=Array.from(Q),H.unshift(Z,J),$.splice(...H);else{if(J)$.splice(Z,J);while(G<Q.length)H=Q.slice(G,G+1e4),H.unshift(Z,0),$.splice(...H),G+=1e4,Z+=1e4}}function Y8($,Z){if($.length>0)return W5($,$.length,0,Z),$;return Z}var uw={}.hasOwnProperty;function fX($){let Z={},J=-1;while(++J<$.length)sm(Z,$[J]);return Z}function sm($,Z){let J;for(J in Z){let X=(uw.call($,J)?$[J]:void 0)||($[J]={}),G=Z[J],H;if(G)for(H in G){if(!uw.call(X,H))X[H]=[];let z=G[H];nm(X[H],Array.isArray(z)?z:z?[z]:[])}}}function nm($,Z){let J=-1,Q=[];while(++J<Z.length)(Z[J].add==="after"?$:Q).push(Z[J]);W5($,0,0,Q)}function mX($,Z){let J=Number.parseInt($,Z);if(J<9||J===11||J>13&&J<32||J>126&&J<160||J>55295&&J<57344||J>64975&&J<65008||(J&65535)===65535||(J&65535)===65534||J>1114111)return"�";return String.fromCodePoint(J)}function $8($){return $.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var I5=$9(/[A-Za-z]/),G5=$9(/[\dA-Za-z]/),pw=$9(/[#-'*+\--9=?A-Z^-~]/);function H6($){return $!==null&&($<32||$===127)}var x$=$9(/\d/),cw=$9(/[\dA-Fa-f]/),dw=$9(/[!-/:-@[-`{-~]/);function O0($){return $!==null&&$<-2}function J1($){return $!==null&&($<0||$===32)}function y0($){return $===-2||$===-1||$===32}var z6=$9(/\p{P}|\p{S}/u),o4=$9(/\s/);function $9($){return Z;function Z(J){return J!==null&&J>-1&&$.test(String.fromCharCode(J))}}function o8($){let Z=[],J=-1,Q=0,X=0;while(++J<$.length){let G=$.charCodeAt(J),H="";if(G===37&&G5($.charCodeAt(J+1))&&G5($.charCodeAt(J+2)))X=2;else if(G<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(G)))H=String.fromCharCode(G)}else if(G>55295&&G<57344){let z=$.charCodeAt(J+1);if(G<56320&&z>56319&&z<57344)H=String.fromCharCode(G,z),X=1;else H="�"}else H=String.fromCharCode(G);if(H)Z.push($.slice(Q,J),encodeURIComponent(H)),Q=J+X+1,H="";if(X)J+=X,X=0}return Z.join("")+$.slice(Q)}function R0($,Z,J,Q){let X=Q?Q-1:Number.POSITIVE_INFINITY,G=0;return H;function H(K){if(y0(K))return $.enter(J),z(K);return Z(K)}function z(K){if(y0(K)&&G++<X)return $.consume(K),z;return $.exit(J),Z(K)}}var lw={tokenize:om};function om($){let Z=$.attempt(this.parser.constructs.contentInitial,Q,X),J;return Z;function Q(z){if(z===null){$.consume(z);return}return $.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),R0($,Z,"linePrefix")}function X(z){return $.enter("paragraph"),G(z)}function G(z){let K=$.enter("chunkText",{contentType:"text",previous:J});if(J)J.next=K;return J=K,H(z)}function H(z){if(z===null){$.exit("chunkText"),$.exit("paragraph"),$.consume(z);return}if(O0(z))return $.consume(z),$.exit("chunkText"),G;return $.consume(z),H}}var rw={tokenize:tm},iw={tokenize:em};function tm($){let Z=this,J=[],Q=0,X,G,H;return z;function z(w){if(Q<J.length){let A=J[Q];return Z.containerState=A[1],$.attempt(A[0].continuation,K,Y)(w)}return Y(w)}function K(w){if(Q++,Z.containerState._closeFlow){if(Z.containerState._closeFlow=void 0,X)_();let A=Z.events.length,D=A,M;while(D--)if(Z.events[D][0]==="exit"&&Z.events[D][1].type==="chunkFlow"){M=Z.events[D][1].end;break}L(Q);let j=A;while(j<Z.events.length)Z.events[j][1].end={...M},j++;return W5(Z.events,D+1,0,Z.events.slice(A)),Z.events.length=j,Y(w)}return z(w)}function Y(w){if(Q===J.length){if(!X)return B(w);if(X.currentConstruct&&X.currentConstruct.concrete)return F(w);Z.interrupt=Boolean(X.currentConstruct&&!X._gfmTableDynamicInterruptHack)}return Z.containerState={},$.check(iw,W,q)(w)}function W(w){if(X)_();return L(Q),B(w)}function q(w){return Z.parser.lazy[Z.now().line]=Q!==J.length,H=Z.now().offset,F(w)}function B(w){return Z.containerState={},$.attempt(iw,U,F)(w)}function U(w){return Q++,J.push([Z.currentConstruct,Z.containerState]),B(w)}function F(w){if(w===null){if(X)_();L(0),$.consume(w);return}return X=X||Z.parser.flow(Z.now()),$.enter("chunkFlow",{_tokenizer:X,contentType:"flow",previous:G}),V(w)}function V(w){if(w===null){N($.exit("chunkFlow"),!0),L(0),$.consume(w);return}if(O0(w))return $.consume(w),N($.exit("chunkFlow")),Q=0,Z.interrupt=void 0,z;return $.consume(w),V}function N(w,A){let D=Z.sliceStream(w);if(A)D.push(null);if(w.previous=G,G)G.next=w;if(G=w,X.defineSkip(w.start),X.write(D),Z.parser.lazy[w.start.line]){let M=X.events.length;while(M--)if(X.events[M][1].start.offset<H&&(!X.events[M][1].end||X.events[M][1].end.offset>H))return;let j=Z.events.length,T=j,E,C;while(T--)if(Z.events[T][0]==="exit"&&Z.events[T][1].type==="chunkFlow"){if(E){C=Z.events[T][1].end;break}E=!0}L(Q),M=j;while(M<Z.events.length)Z.events[M][1].end={...C},M++;W5(Z.events,T+1,0,Z.events.slice(j)),Z.events.length=M}}function L(w){let A=J.length;while(A-- >w){let D=J[A];Z.containerState=D[1],D[0].exit.call(Z,$)}J.length=w}function _(){X.write([null]),G=void 0,X=void 0,Z.containerState._closeFlow=void 0}}function em($,Z,J){return R0($,$.attempt(this.parser.constructs.document,Z,J),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function F7($){if($===null||J1($)||o4($))return 1;if(z6($))return 2}function Z9($,Z,J){let Q=[],X=-1;while(++X<$.length){let G=$[X].resolveAll;if(G&&!Q.includes(G))Z=G(Z,J),Q.push(G)}return Z}var h$={name:"attention",resolveAll:$u,tokenize:Zu};function $u($,Z){let J=-1,Q,X,G,H,z,K,Y,W;while(++J<$.length)if($[J][0]==="enter"&&$[J][1].type==="attentionSequence"&&$[J][1]._close){Q=J;while(Q--)if($[Q][0]==="exit"&&$[Q][1].type==="attentionSequence"&&$[Q][1]._open&&Z.sliceSerialize($[Q][1]).charCodeAt(0)===Z.sliceSerialize($[J][1]).charCodeAt(0)){if(($[Q][1]._close||$[J][1]._open)&&($[J][1].end.offset-$[J][1].start.offset)%3&&!(($[Q][1].end.offset-$[Q][1].start.offset+$[J][1].end.offset-$[J][1].start.offset)%3))continue;K=$[Q][1].end.offset-$[Q][1].start.offset>1&&$[J][1].end.offset-$[J][1].start.offset>1?2:1;let q={...$[Q][1].end},B={...$[J][1].start};if(aw(q,-K),aw(B,K),H={type:K>1?"strongSequence":"emphasisSequence",start:q,end:{...$[Q][1].end}},z={type:K>1?"strongSequence":"emphasisSequence",start:{...$[J][1].start},end:B},G={type:K>1?"strongText":"emphasisText",start:{...$[Q][1].end},end:{...$[J][1].start}},X={type:K>1?"strong":"emphasis",start:{...H.start},end:{...z.end}},$[Q][1].end={...H.start},$[J][1].start={...z.end},Y=[],$[Q][1].end.offset-$[Q][1].start.offset)Y=Y8(Y,[["enter",$[Q][1],Z],["exit",$[Q][1],Z]]);if(Y=Y8(Y,[["enter",X,Z],["enter",H,Z],["exit",H,Z],["enter",G,Z]]),Y=Y8(Y,Z9(Z.parser.constructs.insideSpan.null,$.slice(Q+1,J),Z)),Y=Y8(Y,[["exit",G,Z],["enter",z,Z],["exit",z,Z],["exit",X,Z]]),$[J][1].end.offset-$[J][1].start.offset)W=2,Y=Y8(Y,[["enter",$[J][1],Z],["exit",$[J][1],Z]]);else W=0;W5($,Q-1,J-Q+3,Y),J=Q+Y.length-W-2;break}}J=-1;while(++J<$.length)if($[J][1].type==="attentionSequence")$[J][1].type="data";return $}function Zu($,Z){let J=this.parser.constructs.attentionMarkers.null,Q=this.previous,X=F7(Q),G;return H;function H(K){return G=K,$.enter("attentionSequence"),z(K)}function z(K){if(K===G)return $.consume(K),z;let Y=$.exit("attentionSequence"),W=F7(K),q=!W||W===2&&X||J.includes(K),B=!X||X===2&&W||J.includes(Q);return Y._open=Boolean(G===42?q:q&&(X||!B)),Y._close=Boolean(G===42?B:B&&(W||!q)),Z(K)}}function aw($,Z){$.column+=Z,$.offset+=Z,$._bufferIndex+=Z}var TY={name:"autolink",tokenize:Ju};function Ju($,Z,J){let Q=0;return X;function X(U){return $.enter("autolink"),$.enter("autolinkMarker"),$.consume(U),$.exit("autolinkMarker"),$.enter("autolinkProtocol"),G}function G(U){if(I5(U))return $.consume(U),H;if(U===64)return J(U);return Y(U)}function H(U){if(U===43||U===45||U===46||G5(U))return Q=1,z(U);return Y(U)}function z(U){if(U===58)return $.consume(U),Q=0,K;if((U===43||U===45||U===46||G5(U))&&Q++<32)return $.consume(U),z;return Q=0,Y(U)}function K(U){if(U===62)return $.exit("autolinkProtocol"),$.enter("autolinkMarker"),$.consume(U),$.exit("autolinkMarker"),$.exit("autolink"),Z;if(U===null||U===32||U===60||H6(U))return J(U);return $.consume(U),K}function Y(U){if(U===64)return $.consume(U),W;if(pw(U))return $.consume(U),Y;return J(U)}function W(U){return G5(U)?q(U):J(U)}function q(U){if(U===46)return $.consume(U),Q=0,W;if(U===62)return $.exit("autolinkProtocol").type="autolinkEmail",$.enter("autolinkMarker"),$.consume(U),$.exit("autolinkMarker"),$.exit("autolink"),Z;return B(U)}function B(U){if((U===45||G5(U))&&Q++<63){let F=U===45?B:q;return $.consume(U),F}return J(U)}}var t4={partial:!0,tokenize:Qu};function Qu($,Z,J){return Q;function Q(G){return y0(G)?R0($,X,"linePrefix")(G):X(G)}function X(G){return G===null||O0(G)?Z(G):J(G)}}var uX={continuation:{tokenize:Gu},exit:Hu,name:"blockQuote",tokenize:Xu};function Xu($,Z,J){let Q=this;return X;function X(H){if(H===62){let z=Q.containerState;if(!z.open)$.enter("blockQuote",{_container:!0}),z.open=!0;return $.enter("blockQuotePrefix"),$.enter("blockQuoteMarker"),$.consume(H),$.exit("blockQuoteMarker"),G}return J(H)}function G(H){if(y0(H))return $.enter("blockQuotePrefixWhitespace"),$.consume(H),$.exit("blockQuotePrefixWhitespace"),$.exit("blockQuotePrefix"),Z;return $.exit("blockQuotePrefix"),Z(H)}}function Gu($,Z,J){let Q=this;return X;function X(H){if(y0(H))return R0($,G,"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H);return G(H)}function G(H){return $.attempt(uX,Z,J)(H)}}function Hu($){$.exit("blockQuote")}var pX={name:"characterEscape",tokenize:zu};function zu($,Z,J){return Q;function Q(G){return $.enter("characterEscape"),$.enter("escapeMarker"),$.consume(G),$.exit("escapeMarker"),X}function X(G){if(dw(G))return $.enter("characterEscapeValue"),$.consume(G),$.exit("characterEscapeValue"),$.exit("characterEscape"),Z;return J(G)}}var cX={name:"characterReference",tokenize:Ku};function Ku($,Z,J){let Q=this,X=0,G,H;return z;function z(q){return $.enter("characterReference"),$.enter("characterReferenceMarker"),$.consume(q),$.exit("characterReferenceMarker"),K}function K(q){if(q===35)return $.enter("characterReferenceMarkerNumeric"),$.consume(q),$.exit("characterReferenceMarkerNumeric"),Y;return $.enter("characterReferenceValue"),G=31,H=G5,W(q)}function Y(q){if(q===88||q===120)return $.enter("characterReferenceMarkerHexadecimal"),$.consume(q),$.exit("characterReferenceMarkerHexadecimal"),$.enter("characterReferenceValue"),G=6,H=cw,W;return $.enter("characterReferenceValue"),G=7,H=x$,W(q)}function W(q){if(q===59&&X){let B=$.exit("characterReferenceValue");if(H===G5&&!v2(Q.sliceSerialize(B)))return J(q);return $.enter("characterReferenceMarker"),$.consume(q),$.exit("characterReferenceMarker"),$.exit("characterReference"),Z}if(H(q)&&X++<G)return $.consume(q),W;return J(q)}}var sw={partial:!0,tokenize:Wu},dX={concrete:!0,name:"codeFenced",tokenize:Yu};function Yu($,Z,J){let Q=this,X={partial:!0,tokenize:D},G=0,H=0,z;return K;function K(M){return Y(M)}function Y(M){let j=Q.events[Q.events.length-1];return G=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,z=M,$.enter("codeFenced"),$.enter("codeFencedFence"),$.enter("codeFencedFenceSequence"),W(M)}function W(M){if(M===z)return H++,$.consume(M),W;if(H<3)return J(M);return $.exit("codeFencedFenceSequence"),y0(M)?R0($,q,"whitespace")(M):q(M)}function q(M){if(M===null||O0(M))return $.exit("codeFencedFence"),Q.interrupt?Z(M):$.check(sw,V,A)(M);return $.enter("codeFencedFenceInfo"),$.enter("chunkString",{contentType:"string"}),B(M)}function B(M){if(M===null||O0(M))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),q(M);if(y0(M))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),R0($,U,"whitespace")(M);if(M===96&&M===z)return J(M);return $.consume(M),B}function U(M){if(M===null||O0(M))return q(M);return $.enter("codeFencedFenceMeta"),$.enter("chunkString",{contentType:"string"}),F(M)}function F(M){if(M===null||O0(M))return $.exit("chunkString"),$.exit("codeFencedFenceMeta"),q(M);if(M===96&&M===z)return J(M);return $.consume(M),F}function V(M){return $.attempt(X,A,N)(M)}function N(M){return $.enter("lineEnding"),$.consume(M),$.exit("lineEnding"),L}function L(M){return G>0&&y0(M)?R0($,_,"linePrefix",G+1)(M):_(M)}function _(M){if(M===null||O0(M))return $.check(sw,V,A)(M);return $.enter("codeFlowValue"),w(M)}function w(M){if(M===null||O0(M))return $.exit("codeFlowValue"),_(M);return $.consume(M),w}function A(M){return $.exit("codeFenced"),Z(M)}function D(M,j,T){let E=0;return C;function C(R){return M.enter("lineEnding"),M.consume(R),M.exit("lineEnding"),g}function g(R){return M.enter("codeFencedFence"),y0(R)?R0(M,b,"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):b(R)}function b(R){if(R===z)return M.enter("codeFencedFenceSequence"),k(R);return T(R)}function k(R){if(R===z)return E++,M.consume(R),k;if(E>=H)return M.exit("codeFencedFenceSequence"),y0(R)?R0(M,x,"whitespace")(R):x(R);return T(R)}function x(R){if(R===null||O0(R))return M.exit("codeFencedFence"),j(R);return T(R)}}}function Wu($,Z,J){let Q=this;return X;function X(H){if(H===null)return J(H);return $.enter("lineEnding"),$.consume(H),$.exit("lineEnding"),G}function G(H){return Q.parser.lazy[Q.now().line]?J(H):Z(H)}}var v$={name:"codeIndented",tokenize:Bu},qu={partial:!0,tokenize:Uu};function Bu($,Z,J){let Q=this;return X;function X(Y){return $.enter("codeIndented"),R0($,G,"linePrefix",5)(Y)}function G(Y){let W=Q.events[Q.events.length-1];return W&&W[1].type==="linePrefix"&&W[2].sliceSerialize(W[1],!0).length>=4?H(Y):J(Y)}function H(Y){if(Y===null)return K(Y);if(O0(Y))return $.attempt(qu,H,K)(Y);return $.enter("codeFlowValue"),z(Y)}function z(Y){if(Y===null||O0(Y))return $.exit("codeFlowValue"),H(Y);return $.consume(Y),z}function K(Y){return $.exit("codeIndented"),Z(Y)}}function Uu($,Z,J){let Q=this;return X;function X(H){if(Q.parser.lazy[Q.now().line])return J(H);if(O0(H))return $.enter("lineEnding"),$.consume(H),$.exit("lineEnding"),X;return R0($,G,"linePrefix",5)(H)}function G(H){let z=Q.events[Q.events.length-1];return z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4?Z(H):O0(H)?X(H):J(H)}}var kY={name:"codeText",previous:Vu,resolve:Fu,tokenize:Lu};function Fu($){let Z=$.length-4,J=3,Q,X;if(($[J][1].type==="lineEnding"||$[J][1].type==="space")&&($[Z][1].type==="lineEnding"||$[Z][1].type==="space")){Q=J;while(++Q<Z)if($[Q][1].type==="codeTextData"){$[J][1].type="codeTextPadding",$[Z][1].type="codeTextPadding",J+=2,Z-=2;break}}Q=J-1,Z++;while(++Q<=Z)if(X===void 0){if(Q!==Z&&$[Q][1].type!=="lineEnding")X=Q}else if(Q===Z||$[Q][1].type==="lineEnding"){if($[X][1].type="codeTextData",Q!==X+2)$[X][1].end=$[Q-1][1].end,$.splice(X+2,Q-X-2),Z-=Q-X-2,Q=X+2;X=void 0}return $}function Vu($){return $!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Lu($,Z,J){let Q=this,X=0,G,H;return z;function z(B){return $.enter("codeText"),$.enter("codeTextSequence"),K(B)}function K(B){if(B===96)return $.consume(B),X++,K;return $.exit("codeTextSequence"),Y(B)}function Y(B){if(B===null)return J(B);if(B===32)return $.enter("space"),$.consume(B),$.exit("space"),Y;if(B===96)return H=$.enter("codeTextSequence"),G=0,q(B);if(O0(B))return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),Y;return $.enter("codeTextData"),W(B)}function W(B){if(B===null||B===32||B===96||O0(B))return $.exit("codeTextData"),Y(B);return $.consume(B),W}function q(B){if(B===96)return $.consume(B),G++,q;if(G===X)return $.exit("codeTextSequence"),$.exit("codeText"),Z(B);return H.type="codeTextData",W(B)}}class EY{constructor($){this.left=$?[...$]:[],this.right=[]}get($){if($<0||$>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+$+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if($<this.left.length)return this.left[$];return this.right[this.right.length-$+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice($,Z){let J=Z===null||Z===void 0?Number.POSITIVE_INFINITY:Z;if(J<this.left.length)return this.left.slice($,J);if($>this.left.length)return this.right.slice(this.right.length-J+this.left.length,this.right.length-$+this.left.length).reverse();return this.left.slice($).concat(this.right.slice(this.right.length-J+this.left.length).reverse())}splice($,Z,J){let Q=Z||0;this.setCursor(Math.trunc($));let X=this.right.splice(this.right.length-Q,Number.POSITIVE_INFINITY);if(J)g$(this.left,J);return X.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),g$(this.left,$)}unshift($){this.setCursor(0),this.right.push($)}unshiftMany($){this.setCursor(0),g$(this.right,$.reverse())}setCursor($){if($===this.left.length||$>this.left.length&&this.right.length===0||$<0&&this.left.length===0)return;if($<this.left.length){let Z=this.left.splice($,Number.POSITIVE_INFINITY);g$(this.right,Z.reverse())}else{let Z=this.right.splice(this.left.length+this.right.length-$,Number.POSITIVE_INFINITY);g$(this.left,Z.reverse())}}}function g$($,Z){let J=0;if(Z.length<1e4)$.push(...Z);else while(J<Z.length)$.push(...Z.slice(J,J+1e4)),J+=1e4}function lX($){let Z={},J=-1,Q,X,G,H,z,K,Y,W=new EY($);while(++J<W.length){while(J in Z)J=Z[J];if(Q=W.get(J),J&&Q[1].type==="chunkFlow"&&W.get(J-1)[1].type==="listItemPrefix"){if(K=Q[1]._tokenizer.events,G=0,G<K.length&&K[G][1].type==="lineEndingBlank")G+=2;if(G<K.length&&K[G][1].type==="content")while(++G<K.length){if(K[G][1].type==="content")break;if(K[G][1].type==="chunkText")K[G][1]._isInFirstContentOfListItem=!0,G++}}if(Q[0]==="enter"){if(Q[1].contentType)Object.assign(Z,Nu(W,J)),J=Z[J],Y=!0}else if(Q[1]._container){G=J,X=void 0;while(G--)if(H=W.get(G),H[1].type==="lineEnding"||H[1].type==="lineEndingBlank"){if(H[0]==="enter"){if(X)W.get(X)[1].type="lineEndingBlank";H[1].type="lineEnding",X=G}}else if(H[1].type==="linePrefix"||H[1].type==="listItemIndent");else break;if(X)Q[1].end={...W.get(X)[1].start},z=W.slice(X,J),z.unshift(Q),W.splice(X,J-X+1,z)}}return W5($,0,Number.POSITIVE_INFINITY,W.slice(0)),!Y}function Nu($,Z){let J=$.get(Z)[1],Q=$.get(Z)[2],X=Z-1,G=[],H=J._tokenizer;if(!H){if(H=Q.parser[J.contentType](J.start),J._contentTypeTextTrailing)H._contentTypeTextTrailing=!0}let z=H.events,K=[],Y={},W,q,B=-1,U=J,F=0,V=0,N=[V];while(U){while($.get(++X)[1]!==U);if(G.push(X),!U._tokenizer){if(W=Q.sliceStream(U),!U.next)W.push(null);if(q)H.defineSkip(U.start);if(U._isInFirstContentOfListItem)H._gfmTasklistFirstContentOfListItem=!0;if(H.write(W),U._isInFirstContentOfListItem)H._gfmTasklistFirstContentOfListItem=void 0}q=U,U=U.next}U=J;while(++B<z.length)if(z[B][0]==="exit"&&z[B-1][0]==="enter"&&z[B][1].type===z[B-1][1].type&&z[B][1].start.line!==z[B][1].end.line)V=B+1,N.push(V),U._tokenizer=void 0,U.previous=void 0,U=U.next;if(H.events=[],U)U._tokenizer=void 0,U.previous=void 0;else N.pop();B=N.length;while(B--){let L=z.slice(N[B],N[B+1]),_=G.pop();K.push([_,_+L.length-1]),$.splice(_,2,L)}K.reverse(),B=-1;while(++B<K.length)Y[F+K[B][0]]=F+K[B][1],F+=K[B][1]-K[B][0]-1;return Y}var SY={resolve:Mu,tokenize:Au},_u={partial:!0,tokenize:Du};function Mu($){return lX($),$}function Au($,Z){let J;return Q;function Q(z){return $.enter("content"),J=$.enter("chunkContent",{contentType:"content"}),X(z)}function X(z){if(z===null)return G(z);if(O0(z))return $.check(_u,H,G)(z);return $.consume(z),X}function G(z){return $.exit("chunkContent"),$.exit("content"),Z(z)}function H(z){return $.consume(z),$.exit("chunkContent"),J.next=$.enter("chunkContent",{contentType:"content",previous:J}),J=J.next,X}}function Du($,Z,J){let Q=this;return X;function X(H){return $.exit("chunkContent"),$.enter("lineEnding"),$.consume(H),$.exit("lineEnding"),R0($,G,"linePrefix")}function G(H){if(H===null||O0(H))return J(H);let z=Q.events[Q.events.length-1];if(!Q.parser.constructs.disable.null.includes("codeIndented")&&z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4)return Z(H);return $.interrupt(Q.parser.constructs.flow,J,Z)(H)}}function iX($,Z,J,Q,X,G,H,z,K){let Y=K||Number.POSITIVE_INFINITY,W=0;return q;function q(L){if(L===60)return $.enter(Q),$.enter(X),$.enter(G),$.consume(L),$.exit(G),B;if(L===null||L===32||L===41||H6(L))return J(L);return $.enter(Q),$.enter(H),$.enter(z),$.enter("chunkString",{contentType:"string"}),V(L)}function B(L){if(L===62)return $.enter(G),$.consume(L),$.exit(G),$.exit(X),$.exit(Q),Z;return $.enter(z),$.enter("chunkString",{contentType:"string"}),U(L)}function U(L){if(L===62)return $.exit("chunkString"),$.exit(z),B(L);if(L===null||L===60||O0(L))return J(L);return $.consume(L),L===92?F:U}function F(L){if(L===60||L===62||L===92)return $.consume(L),U;return U(L)}function V(L){if(!W&&(L===null||L===41||J1(L)))return $.exit("chunkString"),$.exit(z),$.exit(H),$.exit(Q),Z(L);if(W<Y&&L===40)return $.consume(L),W++,V;if(L===41)return $.consume(L),W--,V;if(L===null||L===32||L===40||H6(L))return J(L);return $.consume(L),L===92?N:V}function N(L){if(L===40||L===41||L===92)return $.consume(L),V;return V(L)}}function rX($,Z,J,Q,X,G){let H=this,z=0,K;return Y;function Y(U){return $.enter(Q),$.enter(X),$.consume(U),$.exit(X),$.enter(G),W}function W(U){if(z>999||U===null||U===91||U===93&&!K||U===94&&!z&&"_hiddenFootnoteSupport"in H.parser.constructs)return J(U);if(U===93)return $.exit(G),$.enter(X),$.consume(U),$.exit(X),$.exit(Q),Z;if(O0(U))return $.enter("lineEnding"),$.consume(U),$.exit("lineEnding"),W;return $.enter("chunkString",{contentType:"string"}),q(U)}function q(U){if(U===null||U===91||U===93||O0(U)||z++>999)return $.exit("chunkString"),W(U);if($.consume(U),!K)K=!y0(U);return U===92?B:q}function B(U){if(U===91||U===92||U===93)return $.consume(U),z++,q;return q(U)}}function aX($,Z,J,Q,X,G){let H;return z;function z(B){if(B===34||B===39||B===40)return $.enter(Q),$.enter(X),$.consume(B),$.exit(X),H=B===40?41:B,K;return J(B)}function K(B){if(B===H)return $.enter(X),$.consume(B),$.exit(X),$.exit(Q),Z;return $.enter(G),Y(B)}function Y(B){if(B===H)return $.exit(G),K(H);if(B===null)return J(B);if(O0(B))return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),R0($,Y,"linePrefix");return $.enter("chunkString",{contentType:"string"}),W(B)}function W(B){if(B===H||B===null||O0(B))return $.exit("chunkString"),Y(B);return $.consume(B),B===92?q:W}function q(B){if(B===H||B===92)return $.consume(B),W;return W(B)}}function K6($,Z){let J;return Q;function Q(X){if(O0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),J=!0,Q;if(y0(X))return R0($,Q,J?"linePrefix":"lineSuffix")(X);return Z(X)}}var RY={name:"definition",tokenize:Ou},wu={partial:!0,tokenize:Pu};function Ou($,Z,J){let Q=this,X;return G;function G(U){return $.enter("definition"),H(U)}function H(U){return rX.call(Q,$,z,J,"definitionLabel","definitionLabelMarker","definitionLabelString")(U)}function z(U){if(X=$8(Q.sliceSerialize(Q.events[Q.events.length-1][1]).slice(1,-1)),U===58)return $.enter("definitionMarker"),$.consume(U),$.exit("definitionMarker"),K;return J(U)}function K(U){return J1(U)?K6($,Y)(U):Y(U)}function Y(U){return iX($,W,J,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(U)}function W(U){return $.attempt(wu,q,q)(U)}function q(U){return y0(U)?R0($,B,"whitespace")(U):B(U)}function B(U){if(U===null||O0(U))return $.exit("definition"),Q.parser.defined.push(X),Z(U);return J(U)}}function Pu($,Z,J){return Q;function Q(z){return J1(z)?K6($,X)(z):J(z)}function X(z){return aX($,G,J,"definitionTitle","definitionTitleMarker","definitionTitleString")(z)}function G(z){return y0(z)?R0($,H,"whitespace")(z):H(z)}function H(z){return z===null||O0(z)?Z(z):J(z)}}var bY={name:"hardBreakEscape",tokenize:ju};function ju($,Z,J){return Q;function Q(G){return $.enter("hardBreakEscape"),$.consume(G),X}function X(G){if(O0(G))return $.exit("hardBreakEscape"),Z(G);return J(G)}}var yY={name:"headingAtx",resolve:Cu,tokenize:Iu};function Cu($,Z){let J=$.length-2,Q=3,X,G;if($[Q][1].type==="whitespace")Q+=2;if(J-2>Q&&$[J][1].type==="whitespace")J-=2;if($[J][1].type==="atxHeadingSequence"&&(Q===J-1||J-4>Q&&$[J-2][1].type==="whitespace"))J-=Q+1===J?2:4;if(J>Q)X={type:"atxHeadingText",start:$[Q][1].start,end:$[J][1].end},G={type:"chunkText",start:$[Q][1].start,end:$[J][1].end,contentType:"text"},W5($,Q,J-Q+1,[["enter",X,Z],["enter",G,Z],["exit",G,Z],["exit",X,Z]]);return $}function Iu($,Z,J){let Q=0;return X;function X(W){return $.enter("atxHeading"),G(W)}function G(W){return $.enter("atxHeadingSequence"),H(W)}function H(W){if(W===35&&Q++<6)return $.consume(W),H;if(W===null||J1(W))return $.exit("atxHeadingSequence"),z(W);return J(W)}function z(W){if(W===35)return $.enter("atxHeadingSequence"),K(W);if(W===null||O0(W))return $.exit("atxHeading"),Z(W);if(y0(W))return R0($,z,"whitespace")(W);return $.enter("atxHeadingText"),Y(W)}function K(W){if(W===35)return $.consume(W),K;return $.exit("atxHeadingSequence"),z(W)}function Y(W){if(W===null||W===35||J1(W))return $.exit("atxHeadingText"),z(W);return $.consume(W),Y}}var nw=["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"],xY=["pre","script","style","textarea"];var hY={concrete:!0,name:"htmlFlow",resolveTo:Eu,tokenize:Su},Tu={partial:!0,tokenize:bu},ku={partial:!0,tokenize:Ru};function Eu($){let Z=$.length;while(Z--)if($[Z][0]==="enter"&&$[Z][1].type==="htmlFlow")break;if(Z>1&&$[Z-2][1].type==="linePrefix")$[Z][1].start=$[Z-2][1].start,$[Z+1][1].start=$[Z-2][1].start,$.splice(Z-2,2);return $}function Su($,Z,J){let Q=this,X,G,H,z,K;return Y;function Y(y){return W(y)}function W(y){return $.enter("htmlFlow"),$.enter("htmlFlowData"),$.consume(y),q}function q(y){if(y===33)return $.consume(y),B;if(y===47)return $.consume(y),G=!0,V;if(y===63)return $.consume(y),X=3,Q.interrupt?Z:P;if(I5(y))return $.consume(y),H=String.fromCharCode(y),N;return J(y)}function B(y){if(y===45)return $.consume(y),X=2,U;if(y===91)return $.consume(y),X=5,z=0,F;if(I5(y))return $.consume(y),X=4,Q.interrupt?Z:P;return J(y)}function U(y){if(y===45)return $.consume(y),Q.interrupt?Z:P;return J(y)}function F(y){if(y==="CDATA[".charCodeAt(z++)){if($.consume(y),z===6)return Q.interrupt?Z:b;return F}return J(y)}function V(y){if(I5(y))return $.consume(y),H=String.fromCharCode(y),N;return J(y)}function N(y){if(y===null||y===47||y===62||J1(y)){let n=y===47,_0=H.toLowerCase();if(!n&&!G&&xY.includes(_0))return X=1,Q.interrupt?Z(y):b(y);if(nw.includes(H.toLowerCase())){if(X=6,n)return $.consume(y),L;return Q.interrupt?Z(y):b(y)}return X=7,Q.interrupt&&!Q.parser.lazy[Q.now().line]?J(y):G?_(y):w(y)}if(y===45||G5(y))return $.consume(y),H+=String.fromCharCode(y),N;return J(y)}function L(y){if(y===62)return $.consume(y),Q.interrupt?Z:b;return J(y)}function _(y){if(y0(y))return $.consume(y),_;return C(y)}function w(y){if(y===47)return $.consume(y),C;if(y===58||y===95||I5(y))return $.consume(y),A;if(y0(y))return $.consume(y),w;return C(y)}function A(y){if(y===45||y===46||y===58||y===95||G5(y))return $.consume(y),A;return D(y)}function D(y){if(y===61)return $.consume(y),M;if(y0(y))return $.consume(y),D;return w(y)}function M(y){if(y===null||y===60||y===61||y===62||y===96)return J(y);if(y===34||y===39)return $.consume(y),K=y,j;if(y0(y))return $.consume(y),M;return T(y)}function j(y){if(y===K)return $.consume(y),K=null,E;if(y===null||O0(y))return J(y);return $.consume(y),j}function T(y){if(y===null||y===34||y===39||y===47||y===60||y===61||y===62||y===96||J1(y))return D(y);return $.consume(y),T}function E(y){if(y===47||y===62||y0(y))return w(y);return J(y)}function C(y){if(y===62)return $.consume(y),g;return J(y)}function g(y){if(y===null||O0(y))return b(y);if(y0(y))return $.consume(y),g;return J(y)}function b(y){if(y===45&&X===2)return $.consume(y),I;if(y===60&&X===1)return $.consume(y),S;if(y===62&&X===4)return $.consume(y),t;if(y===63&&X===3)return $.consume(y),P;if(y===93&&X===5)return $.consume(y),p;if(O0(y)&&(X===6||X===7))return $.exit("htmlFlowData"),$.check(Tu,z0,k)(y);if(y===null||O0(y))return $.exit("htmlFlowData"),k(y);return $.consume(y),b}function k(y){return $.check(ku,x,z0)(y)}function x(y){return $.enter("lineEnding"),$.consume(y),$.exit("lineEnding"),R}function R(y){if(y===null||O0(y))return k(y);return $.enter("htmlFlowData"),b(y)}function I(y){if(y===45)return $.consume(y),P;return b(y)}function S(y){if(y===47)return $.consume(y),H="",h;return b(y)}function h(y){if(y===62){let n=H.toLowerCase();if(xY.includes(n))return $.consume(y),t;return b(y)}if(I5(y)&&H.length<8)return $.consume(y),H+=String.fromCharCode(y),h;return b(y)}function p(y){if(y===93)return $.consume(y),P;return b(y)}function P(y){if(y===62)return $.consume(y),t;if(y===45&&X===2)return $.consume(y),P;return b(y)}function t(y){if(y===null||O0(y))return $.exit("htmlFlowData"),z0(y);return $.consume(y),t}function z0(y){return $.exit("htmlFlow"),Z(y)}}function Ru($,Z,J){let Q=this;return X;function X(H){if(O0(H))return $.enter("lineEnding"),$.consume(H),$.exit("lineEnding"),G;return J(H)}function G(H){return Q.parser.lazy[Q.now().line]?J(H):Z(H)}}function bu($,Z,J){return Q;function Q(X){return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),$.attempt(t4,Z,J)}}var vY={name:"htmlText",tokenize:yu};function yu($,Z,J){let Q=this,X,G,H;return z;function z(P){return $.enter("htmlText"),$.enter("htmlTextData"),$.consume(P),K}function K(P){if(P===33)return $.consume(P),Y;if(P===47)return $.consume(P),D;if(P===63)return $.consume(P),w;if(I5(P))return $.consume(P),T;return J(P)}function Y(P){if(P===45)return $.consume(P),W;if(P===91)return $.consume(P),G=0,F;if(I5(P))return $.consume(P),_;return J(P)}function W(P){if(P===45)return $.consume(P),U;return J(P)}function q(P){if(P===null)return J(P);if(P===45)return $.consume(P),B;if(O0(P))return H=q,S(P);return $.consume(P),q}function B(P){if(P===45)return $.consume(P),U;return q(P)}function U(P){return P===62?I(P):P===45?B(P):q(P)}function F(P){if(P==="CDATA[".charCodeAt(G++))return $.consume(P),G===6?V:F;return J(P)}function V(P){if(P===null)return J(P);if(P===93)return $.consume(P),N;if(O0(P))return H=V,S(P);return $.consume(P),V}function N(P){if(P===93)return $.consume(P),L;return V(P)}function L(P){if(P===62)return I(P);if(P===93)return $.consume(P),L;return V(P)}function _(P){if(P===null||P===62)return I(P);if(O0(P))return H=_,S(P);return $.consume(P),_}function w(P){if(P===null)return J(P);if(P===63)return $.consume(P),A;if(O0(P))return H=w,S(P);return $.consume(P),w}function A(P){return P===62?I(P):w(P)}function D(P){if(I5(P))return $.consume(P),M;return J(P)}function M(P){if(P===45||G5(P))return $.consume(P),M;return j(P)}function j(P){if(O0(P))return H=j,S(P);if(y0(P))return $.consume(P),j;return I(P)}function T(P){if(P===45||G5(P))return $.consume(P),T;if(P===47||P===62||J1(P))return E(P);return J(P)}function E(P){if(P===47)return $.consume(P),I;if(P===58||P===95||I5(P))return $.consume(P),C;if(O0(P))return H=E,S(P);if(y0(P))return $.consume(P),E;return I(P)}function C(P){if(P===45||P===46||P===58||P===95||G5(P))return $.consume(P),C;return g(P)}function g(P){if(P===61)return $.consume(P),b;if(O0(P))return H=g,S(P);if(y0(P))return $.consume(P),g;return E(P)}function b(P){if(P===null||P===60||P===61||P===62||P===96)return J(P);if(P===34||P===39)return $.consume(P),X=P,k;if(O0(P))return H=b,S(P);if(y0(P))return $.consume(P),b;return $.consume(P),x}function k(P){if(P===X)return $.consume(P),X=void 0,R;if(P===null)return J(P);if(O0(P))return H=k,S(P);return $.consume(P),k}function x(P){if(P===null||P===34||P===39||P===60||P===61||P===96)return J(P);if(P===47||P===62||J1(P))return E(P);return $.consume(P),x}function R(P){if(P===47||P===62||J1(P))return E(P);return J(P)}function I(P){if(P===62)return $.consume(P),$.exit("htmlTextData"),$.exit("htmlText"),Z;return J(P)}function S(P){return $.exit("htmlTextData"),$.enter("lineEnding"),$.consume(P),$.exit("lineEnding"),h}function h(P){return y0(P)?R0($,p,"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):p(P)}function p(P){return $.enter("htmlTextData"),H(P)}}var Y6={name:"labelEnd",resolveAll:gu,resolveTo:fu,tokenize:mu},xu={tokenize:uu},hu={tokenize:pu},vu={tokenize:cu};function gu($){let Z=-1,J=[];while(++Z<$.length){let Q=$[Z][1];if(J.push($[Z]),Q.type==="labelImage"||Q.type==="labelLink"||Q.type==="labelEnd"){let X=Q.type==="labelImage"?4:2;Q.type="data",Z+=X}}if($.length!==J.length)W5($,0,$.length,J);return $}function fu($,Z){let J=$.length,Q=0,X,G,H,z;while(J--)if(X=$[J][1],G){if(X.type==="link"||X.type==="labelLink"&&X._inactive)break;if($[J][0]==="enter"&&X.type==="labelLink")X._inactive=!0}else if(H){if($[J][0]==="enter"&&(X.type==="labelImage"||X.type==="labelLink")&&!X._balanced){if(G=J,X.type!=="labelLink"){Q=2;break}}}else if(X.type==="labelEnd")H=J;let K={type:$[G][1].type==="labelLink"?"link":"image",start:{...$[G][1].start},end:{...$[$.length-1][1].end}},Y={type:"label",start:{...$[G][1].start},end:{...$[H][1].end}},W={type:"labelText",start:{...$[G+Q+2][1].end},end:{...$[H-2][1].start}};return z=[["enter",K,Z],["enter",Y,Z]],z=Y8(z,$.slice(G+1,G+Q+3)),z=Y8(z,[["enter",W,Z]]),z=Y8(z,Z9(Z.parser.constructs.insideSpan.null,$.slice(G+Q+4,H-3),Z)),z=Y8(z,[["exit",W,Z],$[H-2],$[H-1],["exit",Y,Z]]),z=Y8(z,$.slice(H+1)),z=Y8(z,[["exit",K,Z]]),W5($,G,$.length,z),$}function mu($,Z,J){let Q=this,X=Q.events.length,G,H;while(X--)if((Q.events[X][1].type==="labelImage"||Q.events[X][1].type==="labelLink")&&!Q.events[X][1]._balanced){G=Q.events[X][1];break}return z;function z(B){if(!G)return J(B);if(G._inactive)return q(B);return H=Q.parser.defined.includes($8(Q.sliceSerialize({start:G.end,end:Q.now()}))),$.enter("labelEnd"),$.enter("labelMarker"),$.consume(B),$.exit("labelMarker"),$.exit("labelEnd"),K}function K(B){if(B===40)return $.attempt(xu,W,H?W:q)(B);if(B===91)return $.attempt(hu,W,H?Y:q)(B);return H?W(B):q(B)}function Y(B){return $.attempt(vu,W,q)(B)}function W(B){return Z(B)}function q(B){return G._balanced=!0,J(B)}}function uu($,Z,J){return Q;function Q(q){return $.enter("resource"),$.enter("resourceMarker"),$.consume(q),$.exit("resourceMarker"),X}function X(q){return J1(q)?K6($,G)(q):G(q)}function G(q){if(q===41)return W(q);return iX($,H,z,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(q)}function H(q){return J1(q)?K6($,K)(q):W(q)}function z(q){return J(q)}function K(q){if(q===34||q===39||q===40)return aX($,Y,J,"resourceTitle","resourceTitleMarker","resourceTitleString")(q);return W(q)}function Y(q){return J1(q)?K6($,W)(q):W(q)}function W(q){if(q===41)return $.enter("resourceMarker"),$.consume(q),$.exit("resourceMarker"),$.exit("resource"),Z;return J(q)}}function pu($,Z,J){let Q=this;return X;function X(z){return rX.call(Q,$,G,H,"reference","referenceMarker","referenceString")(z)}function G(z){return Q.parser.defined.includes($8(Q.sliceSerialize(Q.events[Q.events.length-1][1]).slice(1,-1)))?Z(z):J(z)}function H(z){return J(z)}}function cu($,Z,J){return Q;function Q(G){return $.enter("reference"),$.enter("referenceMarker"),$.consume(G),$.exit("referenceMarker"),X}function X(G){if(G===93)return $.enter("referenceMarker"),$.consume(G),$.exit("referenceMarker"),$.exit("reference"),Z;return J(G)}}var gY={name:"labelStartImage",resolveAll:Y6.resolveAll,tokenize:du};function du($,Z,J){let Q=this;return X;function X(z){return $.enter("labelImage"),$.enter("labelImageMarker"),$.consume(z),$.exit("labelImageMarker"),G}function G(z){if(z===91)return $.enter("labelMarker"),$.consume(z),$.exit("labelMarker"),$.exit("labelImage"),H;return J(z)}function H(z){return z===94&&"_hiddenFootnoteSupport"in Q.parser.constructs?J(z):Z(z)}}var fY={name:"labelStartLink",resolveAll:Y6.resolveAll,tokenize:lu};function lu($,Z,J){let Q=this;return X;function X(H){return $.enter("labelLink"),$.enter("labelMarker"),$.consume(H),$.exit("labelMarker"),$.exit("labelLink"),G}function G(H){return H===94&&"_hiddenFootnoteSupport"in Q.parser.constructs?J(H):Z(H)}}var f$={name:"lineEnding",tokenize:iu};function iu($,Z){return J;function J(Q){return $.enter("lineEnding"),$.consume(Q),$.exit("lineEnding"),R0($,Z,"linePrefix")}}var W6={name:"thematicBreak",tokenize:ru};function ru($,Z,J){let Q=0,X;return G;function G(Y){return $.enter("thematicBreak"),H(Y)}function H(Y){return X=Y,z(Y)}function z(Y){if(Y===X)return $.enter("thematicBreakSequence"),K(Y);if(Q>=3&&(Y===null||O0(Y)))return $.exit("thematicBreak"),Z(Y);return J(Y)}function K(Y){if(Y===X)return $.consume(Y),Q++,K;return $.exit("thematicBreakSequence"),y0(Y)?R0($,z,"whitespace")(Y):z(Y)}}var Z8={continuation:{tokenize:ou},exit:eu,name:"list",tokenize:nu},au={partial:!0,tokenize:$p},su={partial:!0,tokenize:tu};function nu($,Z,J){let Q=this,X=Q.events[Q.events.length-1],G=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,H=0;return z;function z(U){let F=Q.containerState.type||(U===42||U===43||U===45?"listUnordered":"listOrdered");if(F==="listUnordered"?!Q.containerState.marker||U===Q.containerState.marker:x$(U)){if(!Q.containerState.type)Q.containerState.type=F,$.enter(F,{_container:!0});if(F==="listUnordered")return $.enter("listItemPrefix"),U===42||U===45?$.check(W6,J,Y)(U):Y(U);if(!Q.interrupt||U===49)return $.enter("listItemPrefix"),$.enter("listItemValue"),K(U)}return J(U)}function K(U){if(x$(U)&&++H<10)return $.consume(U),K;if((!Q.interrupt||H<2)&&(Q.containerState.marker?U===Q.containerState.marker:U===41||U===46))return $.exit("listItemValue"),Y(U);return J(U)}function Y(U){return $.enter("listItemMarker"),$.consume(U),$.exit("listItemMarker"),Q.containerState.marker=Q.containerState.marker||U,$.check(t4,Q.interrupt?J:W,$.attempt(au,B,q))}function W(U){return Q.containerState.initialBlankLine=!0,G++,B(U)}function q(U){if(y0(U))return $.enter("listItemPrefixWhitespace"),$.consume(U),$.exit("listItemPrefixWhitespace"),B;return J(U)}function B(U){return Q.containerState.size=G+Q.sliceSerialize($.exit("listItemPrefix"),!0).length,Z(U)}}function ou($,Z,J){let Q=this;return Q.containerState._closeFlow=void 0,$.check(t4,X,G);function X(z){return Q.containerState.furtherBlankLines=Q.containerState.furtherBlankLines||Q.containerState.initialBlankLine,R0($,Z,"listItemIndent",Q.containerState.size+1)(z)}function G(z){if(Q.containerState.furtherBlankLines||!y0(z))return Q.containerState.furtherBlankLines=void 0,Q.containerState.initialBlankLine=void 0,H(z);return Q.containerState.furtherBlankLines=void 0,Q.containerState.initialBlankLine=void 0,$.attempt(su,Z,H)(z)}function H(z){return Q.containerState._closeFlow=!0,Q.interrupt=void 0,R0($,$.attempt(Z8,Z,J),"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z)}}function tu($,Z,J){let Q=this;return R0($,X,"listItemIndent",Q.containerState.size+1);function X(G){let H=Q.events[Q.events.length-1];return H&&H[1].type==="listItemIndent"&&H[2].sliceSerialize(H[1],!0).length===Q.containerState.size?Z(G):J(G)}}function eu($){$.exit(this.containerState.type)}function $p($,Z,J){let Q=this;return R0($,X,"listItemPrefixWhitespace",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function X(G){let H=Q.events[Q.events.length-1];return!y0(G)&&H&&H[1].type==="listItemPrefixWhitespace"?Z(G):J(G)}}var sX={name:"setextUnderline",resolveTo:Zp,tokenize:Jp};function Zp($,Z){let J=$.length,Q,X,G;while(J--)if($[J][0]==="enter"){if($[J][1].type==="content"){Q=J;break}if($[J][1].type==="paragraph")X=J}else{if($[J][1].type==="content")$.splice(J,1);if(!G&&$[J][1].type==="definition")G=J}let H={type:"setextHeading",start:{...$[Q][1].start},end:{...$[$.length-1][1].end}};if($[X][1].type="setextHeadingText",G)$.splice(X,0,["enter",H,Z]),$.splice(G+1,0,["exit",$[Q][1],Z]),$[Q][1].end={...$[G][1].end};else $[Q][1]=H;return $.push(["exit",H,Z]),$}function Jp($,Z,J){let Q=this,X;return G;function G(Y){let W=Q.events.length,q;while(W--)if(Q.events[W][1].type!=="lineEnding"&&Q.events[W][1].type!=="linePrefix"&&Q.events[W][1].type!=="content"){q=Q.events[W][1].type==="paragraph";break}if(!Q.parser.lazy[Q.now().line]&&(Q.interrupt||q))return $.enter("setextHeadingLine"),X=Y,H(Y);return J(Y)}function H(Y){return $.enter("setextHeadingLineSequence"),z(Y)}function z(Y){if(Y===X)return $.consume(Y),z;return $.exit("setextHeadingLineSequence"),y0(Y)?R0($,K,"lineSuffix")(Y):K(Y)}function K(Y){if(Y===null||O0(Y))return $.exit("setextHeadingLine"),Z(Y);return J(Y)}}var ow={tokenize:Qp};function Qp($){let Z=this,J=$.attempt(t4,Q,$.attempt(this.parser.constructs.flowInitial,X,R0($,$.attempt(this.parser.constructs.flow,X,$.attempt(SY,X)),"linePrefix")));return J;function Q(G){if(G===null){$.consume(G);return}return $.enter("lineEndingBlank"),$.consume(G),$.exit("lineEndingBlank"),Z.currentConstruct=void 0,J}function X(G){if(G===null){$.consume(G);return}return $.enter("lineEnding"),$.consume(G),$.exit("lineEnding"),Z.currentConstruct=void 0,J}}var tw={resolveAll:JO()},ew=ZO("string"),$O=ZO("text");function ZO($){return{resolveAll:JO($==="text"?Xp:void 0),tokenize:Z};function Z(J){let Q=this,X=this.parser.constructs[$],G=J.attempt(X,H,z);return H;function H(W){return Y(W)?G(W):z(W)}function z(W){if(W===null){J.consume(W);return}return J.enter("data"),J.consume(W),K}function K(W){if(Y(W))return J.exit("data"),G(W);return J.consume(W),K}function Y(W){if(W===null)return!0;let q=X[W],B=-1;if(q)while(++B<q.length){let U=q[B];if(!U.previous||U.previous.call(Q,Q.previous))return!0}return!1}}}function JO($){return Z;function Z(J,Q){let X=-1,G;while(++X<=J.length)if(G===void 0){if(J[X]&&J[X][1].type==="data")G=X,X++}else if(!J[X]||J[X][1].type!=="data"){if(X!==G+2)J[G][1].end=J[X-1][1].end,J.splice(G+2,X-G-2),X=G+2;G=void 0}return $?$(J,Q):J}}function Xp($,Z){let J=0;while(++J<=$.length)if((J===$.length||$[J][1].type==="lineEnding")&&$[J-1][1].type==="data"){let Q=$[J-1][1],X=Z.sliceStream(Q),G=X.length,H=-1,z=0,K;while(G--){let Y=X[G];if(typeof Y==="string"){H=Y.length;while(Y.charCodeAt(H-1)===32)z++,H--;if(H)break;H=-1}else if(Y===-2)K=!0,z++;else if(Y===-1);else{G++;break}}if(Z._contentTypeTextTrailing&&J===$.length)z=0;if(z){let Y={type:J===$.length||K||z<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:G?H:Q.start._bufferIndex+H,_index:Q.start._index+G,line:Q.end.line,column:Q.end.column-z,offset:Q.end.offset-z},end:{...Q.end}};if(Q.end={...Y.start},Q.start.offset===Q.end.offset)Object.assign(Q,Y);else $.splice(J,0,["enter",Y,Z],["exit",Y,Z]),J+=2}J++}return $}var mY={};G4(mY,{text:()=>Wp,string:()=>Yp,insideSpan:()=>qp,flowInitial:()=>zp,flow:()=>Kp,document:()=>Gp,disable:()=>Up,contentInitial:()=>Hp,attentionMarkers:()=>Bp});var Gp={[42]:Z8,[43]:Z8,[45]:Z8,[48]:Z8,[49]:Z8,[50]:Z8,[51]:Z8,[52]:Z8,[53]:Z8,[54]:Z8,[55]:Z8,[56]:Z8,[57]:Z8,[62]:uX},Hp={[91]:RY},zp={[-2]:v$,[-1]:v$,[32]:v$},Kp={[35]:yY,[42]:W6,[45]:[sX,W6],[60]:hY,[61]:sX,[95]:W6,[96]:dX,[126]:dX},Yp={[38]:cX,[92]:pX},Wp={[-5]:f$,[-4]:f$,[-3]:f$,[33]:gY,[38]:cX,[42]:h$,[60]:[TY,vY],[91]:fY,[92]:[bY,pX],[93]:Y6,[95]:h$,[96]:kY},qp={null:[h$,tw]},Bp={null:[42,95]},Up={null:[]};function QO($,Z,J){let Q={_bufferIndex:-1,_index:0,line:J&&J.line||1,column:J&&J.column||1,offset:J&&J.offset||0},X={},G=[],H=[],z=[],K=!0,Y={attempt:E(j),check:E(T),consume:A,enter:D,exit:M,interrupt:E(T,{interrupt:!0})},W={code:null,containerState:{},defineSkip:L,events:[],now:N,parser:$,previous:null,sliceSerialize:F,sliceStream:V,write:U},q=Z.tokenize.call(W,Y),B;if(Z.resolveAll)G.push(Z);return W;function U(k){if(H=Y8(H,k),_(),H[H.length-1]!==null)return[];return C(Z,0),W.events=Z9(G,W.events,W),W.events}function F(k,x){return Vp(V(k),x)}function V(k){return Fp(H,k)}function N(){let{_bufferIndex:k,_index:x,line:R,column:I,offset:S}=Q;return{_bufferIndex:k,_index:x,line:R,column:I,offset:S}}function L(k){X[k.line]=k.column,b()}function _(){let k;while(Q._index<H.length){let x=H[Q._index];if(typeof x==="string"){if(k=Q._index,Q._bufferIndex<0)Q._bufferIndex=0;while(Q._index===k&&Q._bufferIndex<x.length)w(x.charCodeAt(Q._bufferIndex))}else w(x)}}function w(k){K=void 0,B=k,q=q(k)}function A(k){if(O0(k))Q.line++,Q.column=1,Q.offset+=k===-3?2:1,b();else if(k!==-1)Q.column++,Q.offset++;if(Q._bufferIndex<0)Q._index++;else if(Q._bufferIndex++,Q._bufferIndex===H[Q._index].length)Q._bufferIndex=-1,Q._index++;W.previous=k,K=!0}function D(k,x){let R=x||{};return R.type=k,R.start=N(),W.events.push(["enter",R,W]),z.push(R),R}function M(k){let x=z.pop();return x.end=N(),W.events.push(["exit",x,W]),x}function j(k,x){C(k,x.from)}function T(k,x){x.restore()}function E(k,x){return R;function R(I,S,h){let p,P,t,z0;return Array.isArray(I)?n(I):("tokenize"in I)?n([I]):y(I);function y(K0){return Z0;function Z0(G0){let U0=G0!==null&&K0[G0],m=G0!==null&&K0.null,s=[...Array.isArray(U0)?U0:U0?[U0]:[],...Array.isArray(m)?m:m?[m]:[]];return n(s)(G0)}}function n(K0){if(p=K0,P=0,K0.length===0)return h;return _0(K0[P])}function _0(K0){return Z0;function Z0(G0){if(z0=g(),t=K0,!K0.partial)W.currentConstruct=K0;if(K0.name&&W.parser.constructs.disable.null.includes(K0.name))return X0(G0);return K0.tokenize.call(x?Object.assign(Object.create(W),x):W,Y,c,X0)(G0)}}function c(K0){return K=!0,k(t,z0),S}function X0(K0){if(K=!0,z0.restore(),++P<p.length)return _0(p[P]);return h}}}function C(k,x){if(k.resolveAll&&!G.includes(k))G.push(k);if(k.resolve)W5(W.events,x,W.events.length-x,k.resolve(W.events.slice(x),W));if(k.resolveTo)W.events=k.resolveTo(W.events,W)}function g(){let k=N(),x=W.previous,R=W.currentConstruct,I=W.events.length,S=Array.from(z);return{from:I,restore:h};function h(){Q=k,W.previous=x,W.currentConstruct=R,W.events.length=I,z=S,b()}}function b(){if(Q.line in X&&Q.column<2)Q.column=X[Q.line],Q.offset+=X[Q.line]-1}}function Fp($,Z){let J=Z.start._index,Q=Z.start._bufferIndex,X=Z.end._index,G=Z.end._bufferIndex,H;if(J===X)H=[$[J].slice(Q,G)];else{if(H=$.slice(J,X),Q>-1){let z=H[0];if(typeof z==="string")H[0]=z.slice(Q);else H.shift()}if(G>0)H.push($[X].slice(0,G))}return H}function Vp($,Z){let J=-1,Q=[],X;while(++J<$.length){let G=$[J],H;if(typeof G==="string")H=G;else switch(G){case-5:{H="\r";break}case-4:{H=`
84
- `;break}case-3:{H=`\r
85
- `;break}case-2:{H=Z?" ":"\t";break}case-1:{if(!Z&&X)continue;H=" ";break}default:H=String.fromCharCode(G)}X=G===-2,Q.push(H)}return Q.join("")}function uY($){let Q={constructs:fX([mY,...($||{}).extensions||[]]),content:X(lw),defined:[],document:X(rw),flow:X(ow),lazy:{},string:X(ew),text:X($O)};return Q;function X(G){return H;function H(z){return QO(Q,G,z)}}}function pY($){while(!lX($));return $}var XO=/[\0\t\n\r]/g;function cY(){let $=1,Z="",J=!0,Q;return X;function X(G,H,z){let K=[],Y,W,q,B,U;if(G=Z+(typeof G==="string"?G.toString():new TextDecoder(H||void 0).decode(G)),q=0,Z="",J){if(G.charCodeAt(0)===65279)q++;J=void 0}while(q<G.length){if(XO.lastIndex=q,Y=XO.exec(G),B=Y&&Y.index!==void 0?Y.index:G.length,U=G.charCodeAt(B),!Y){Z=G.slice(q);break}if(U===10&&q===B&&Q)K.push(-3),Q=void 0;else{if(Q)K.push(-5),Q=void 0;if(q<B)K.push(G.slice(q,B)),$+=B-q;switch(U){case 0:{K.push(65533),$++;break}case 9:{W=Math.ceil($/4)*4,K.push(-2);while($++<W)K.push(-1);break}case 10:{K.push(-4),$=1;break}default:Q=!0,$=1}}q=B+1}if(z){if(Q)K.push(-5);if(Z)K.push(Z);K.push(null)}return K}}var Lp=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function GO($){return $.replace(Lp,Np)}function Np($,Z,J){if(Z)return Z;if(J.charCodeAt(0)===35){let X=J.charCodeAt(1),G=X===120||X===88;return mX(J.slice(G?2:1),G?16:10)}return v2(J)||$}var zO={}.hasOwnProperty;function dY($,Z,J){if(Z&&typeof Z==="object")J=Z,Z=void 0;return _p(J)(pY(uY(J).document().write(cY()($,Z,!0))))}function _p($){let Z={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:G(e),autolinkProtocol:E,autolinkEmail:E,atxHeading:G(F0),blockQuote:G(G0),characterEscape:E,characterReference:E,codeFenced:G(U0),codeFencedFenceInfo:H,codeFencedFenceMeta:H,codeIndented:G(U0,H),codeText:G(m,H),codeTextData:E,data:E,codeFlowValue:E,definition:G(s),definitionDestinationString:H,definitionLabelString:H,definitionTitleString:H,emphasis:G(u),hardBreakEscape:G(i),hardBreakTrailing:G(i),htmlFlow:G(Y0,H),htmlFlowData:E,htmlText:G(Y0,H),htmlTextData:E,image:G(r),label:H,link:G(e),listItem:G(a),listItemValue:B,listOrdered:G(q0,q),listUnordered:G(q0),paragraph:G(A0),reference:y,referenceString:H,resourceDestinationString:H,resourceTitleString:H,setextHeading:G(F0),strong:G(I0),thematicBreak:G(z1)},exit:{atxHeading:K(),atxHeadingSequence:D,autolink:K(),autolinkEmail:Z0,autolinkProtocol:K0,blockQuote:K(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:_0,characterReferenceMarkerNumeric:_0,characterReferenceValue:c,characterReference:X0,codeFenced:K(N),codeFencedFence:V,codeFencedFenceInfo:U,codeFencedFenceMeta:F,codeFlowValue:C,codeIndented:K(L),codeText:K(R),codeTextData:C,data:C,definition:K(),definitionDestinationString:A,definitionLabelString:_,definitionTitleString:w,emphasis:K(),hardBreakEscape:K(b),hardBreakTrailing:K(b),htmlFlow:K(k),htmlFlowData:C,htmlText:K(x),htmlTextData:C,image:K(S),label:p,labelText:h,lineEnding:g,link:K(I),listItem:K(),listOrdered:K(),listUnordered:K(),paragraph:K(),referenceString:n,resourceDestinationString:P,resourceTitleString:t,resource:z0,setextHeading:K(T),setextHeadingLineSequence:j,setextHeadingText:M,strong:K(),thematicBreak:K()}};KO(Z,($||{}).mdastExtensions||[]);let J={};return Q;function Q(f){let d={type:"root",children:[]},$0={stack:[d],tokenStack:[],config:Z,enter:z,exit:Y,buffer:H,resume:W,data:J},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 g0=V0.pop();j0=X(f,g0,j0)}j0=-1;while(++j0<f.length){let g0=Z[f[j0][0]];if(zO.call(g0,f[j0][1].type))g0[f[j0][1].type].call(Object.assign({sliceSerialize:f[j0][2].sliceSerialize},$0),f[j0][1])}if($0.tokenStack.length>0){let g0=$0.tokenStack[$0.tokenStack.length-1];(g0[1]||HO).call($0,void 0,g0[0])}d.position={start:J9(f.length>0?f[0][1].start:{line:1,column:1,offset:0}),end:J9(f.length>0?f[f.length-2][1].end:{line:1,column:1,offset:0})},j0=-1;while(++j0<Z.transforms.length)d=Z.transforms[j0](d)||d;return d}function X(f,d,$0){let V0=d-1,j0=-1,g0=!1,D1,h1,h0,d0;while(++V0<=$0){let t0=f[V0];switch(t0[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(t0[0]==="enter")j0++;else j0--;d0=void 0;break}case"lineEndingBlank":{if(t0[0]==="enter"){if(D1&&!d0&&!j0&&!h0)h0=V0;d0=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:d0=void 0}if(!j0&&t0[0]==="enter"&&t0[1].type==="listItemPrefix"||j0===-1&&t0[0]==="exit"&&(t0[1].type==="listUnordered"||t0[1].type==="listOrdered")){if(D1){let m0=V0;h1=void 0;while(m0--){let X1=f[m0];if(X1[1].type==="lineEnding"||X1[1].type==="lineEndingBlank"){if(X1[0]==="exit")continue;if(h1)f[h1][1].type="lineEndingBlank",g0=!0;X1[1].type="lineEnding",h1=m0}else if(X1[1].type==="linePrefix"||X1[1].type==="blockQuotePrefix"||X1[1].type==="blockQuotePrefixWhitespace"||X1[1].type==="blockQuoteMarker"||X1[1].type==="listItemIndent");else break}if(h0&&(!h1||h0<h1))D1._spread=!0;D1.end=Object.assign({},h1?f[h1][1].start:t0[1].end),f.splice(h1||V0,0,["exit",D1,t0[2]]),V0++,$0++}if(t0[1].type==="listItemPrefix"){let m0={type:"listItem",_spread:!1,start:Object.assign({},t0[1].start),end:void 0};D1=m0,f.splice(V0,0,["enter",m0,t0[2]]),V0++,$0++,h0=void 0,d0=!0}}}return f[d][1]._spread=g0,$0}function G(f,d){return $0;function $0(V0){if(z.call(this,f(V0),V0),d)d.call(this,V0)}}function H(){this.stack.push({type:"fragment",children:[]})}function z(f,d,$0){this.stack[this.stack.length-1].children.push(f),this.stack.push(f),this.tokenStack.push([d,$0||void 0]),f.position={start:J9(d.start),end:void 0}}function K(f){return d;function d($0){if(f)f.call(this,$0);Y.call(this,$0)}}function Y(f,d){let $0=this.stack.pop(),V0=this.tokenStack.pop();if(!V0)throw Error("Cannot close `"+f.type+"` ("+e7({start:f.start,end:f.end})+"): it’s not open");else if(V0[0].type!==f.type)if(d)d.call(this,f,V0[0]);else(V0[1]||HO).call(this,f,V0[0]);$0.position.end=J9(f.end)}function W(){return G6(this.stack.pop())}function q(){this.data.expectingFirstListItemValue=!0}function B(f){if(this.data.expectingFirstListItemValue){let d=this.stack[this.stack.length-2];d.start=Number.parseInt(this.sliceSerialize(f),10),this.data.expectingFirstListItemValue=void 0}}function U(){let f=this.resume(),d=this.stack[this.stack.length-1];d.lang=f}function F(){let f=this.resume(),d=this.stack[this.stack.length-1];d.meta=f}function V(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function N(){let f=this.resume(),d=this.stack[this.stack.length-1];d.value=f.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function L(){let f=this.resume(),d=this.stack[this.stack.length-1];d.value=f.replace(/(\r?\n|\r)$/g,"")}function _(f){let d=this.resume(),$0=this.stack[this.stack.length-1];$0.label=d,$0.identifier=$8(this.sliceSerialize(f)).toLowerCase()}function w(){let f=this.resume(),d=this.stack[this.stack.length-1];d.title=f}function A(){let f=this.resume(),d=this.stack[this.stack.length-1];d.url=f}function D(f){let d=this.stack[this.stack.length-1];if(!d.depth){let $0=this.sliceSerialize(f).length;d.depth=$0}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function j(f){let d=this.stack[this.stack.length-1];d.depth=this.sliceSerialize(f).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(f){let $0=this.stack[this.stack.length-1].children,V0=$0[$0.length-1];if(!V0||V0.type!=="text")V0=i0(),V0.position={start:J9(f.start),end:void 0},$0.push(V0);this.stack.push(V0)}function C(f){let d=this.stack.pop();d.value+=this.sliceSerialize(f),d.position.end=J9(f.end)}function g(f){let d=this.stack[this.stack.length-1];if(this.data.atHardBreak){let $0=d.children[d.children.length-1];$0.position.end=J9(f.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&Z.canContainEols.includes(d.type))E.call(this,f),C.call(this,f)}function b(){this.data.atHardBreak=!0}function k(){let f=this.resume(),d=this.stack[this.stack.length-1];d.value=f}function x(){let f=this.resume(),d=this.stack[this.stack.length-1];d.value=f}function R(){let f=this.resume(),d=this.stack[this.stack.length-1];d.value=f}function I(){let f=this.stack[this.stack.length-1];if(this.data.inReference){let d=this.data.referenceType||"shortcut";f.type+="Reference",f.referenceType=d,delete f.url,delete f.title}else delete f.identifier,delete f.label;this.data.referenceType=void 0}function S(){let f=this.stack[this.stack.length-1];if(this.data.inReference){let d=this.data.referenceType||"shortcut";f.type+="Reference",f.referenceType=d,delete f.url,delete f.title}else delete f.identifier,delete f.label;this.data.referenceType=void 0}function h(f){let d=this.sliceSerialize(f),$0=this.stack[this.stack.length-2];$0.label=GO(d),$0.identifier=$8(d).toLowerCase()}function p(){let f=this.stack[this.stack.length-1],d=this.resume(),$0=this.stack[this.stack.length-1];if(this.data.inReference=!0,$0.type==="link"){let V0=f.children;$0.children=V0}else $0.alt=d}function P(){let f=this.resume(),d=this.stack[this.stack.length-1];d.url=f}function t(){let f=this.resume(),d=this.stack[this.stack.length-1];d.title=f}function z0(){this.data.inReference=void 0}function y(){this.data.referenceType="collapsed"}function n(f){let d=this.resume(),$0=this.stack[this.stack.length-1];$0.label=d,$0.identifier=$8(this.sliceSerialize(f)).toLowerCase(),this.data.referenceType="full"}function _0(f){this.data.characterReferenceType=f.type}function c(f){let d=this.sliceSerialize(f),$0=this.data.characterReferenceType,V0;if($0)V0=mX(d,$0==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else V0=v2(d);let j0=this.stack[this.stack.length-1];j0.value+=V0}function X0(f){let d=this.stack.pop();d.position.end=J9(f.end)}function K0(f){C.call(this,f);let d=this.stack[this.stack.length-1];d.url=this.sliceSerialize(f)}function Z0(f){C.call(this,f);let d=this.stack[this.stack.length-1];d.url="mailto:"+this.sliceSerialize(f)}function G0(){return{type:"blockquote",children:[]}}function U0(){return{type:"code",lang:null,meta:null,value:""}}function m(){return{type:"inlineCode",value:""}}function s(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function u(){return{type:"emphasis",children:[]}}function F0(){return{type:"heading",depth:0,children:[]}}function i(){return{type:"break"}}function Y0(){return{type:"html",value:""}}function r(){return{type:"image",title:null,url:"",alt:null}}function e(){return{type:"link",title:null,url:"",children:[]}}function q0(f){return{type:"list",ordered:f.type==="listOrdered",start:null,spread:f._spread,children:[]}}function a(f){return{type:"listItem",spread:f._spread,checked:null,children:[]}}function A0(){return{type:"paragraph",children:[]}}function I0(){return{type:"strong",children:[]}}function i0(){return{type:"text",value:""}}function z1(){return{type:"thematicBreak"}}}function J9($){return{line:$.line,column:$.column,offset:$.offset}}function KO($,Z){let J=-1;while(++J<Z.length){let Q=Z[J];if(Array.isArray(Q))KO($,Q);else Mp($,Q)}}function Mp($,Z){let J;for(J in Z)if(zO.call(Z,J))switch(J){case"canContainEols":{let Q=Z[J];if(Q)$[J].push(...Q);break}case"transforms":{let Q=Z[J];if(Q)$[J].push(...Q);break}case"enter":case"exit":{let Q=Z[J];if(Q)Object.assign($[J],Q);break}}}function HO($,Z){if($)throw Error("Cannot close `"+$.type+"` ("+e7({start:$.start,end:$.end})+"): a different token (`"+Z.type+"`, "+e7({start:Z.start,end:Z.end})+") is open");else throw Error("Cannot close document, a token (`"+Z.type+"`, "+e7({start:Z.start,end:Z.end})+") is still open")}function nX($){let Z=this;Z.parser=J;function J(Q){return dY(Q,{...Z.data("settings"),...$,extensions:Z.data("micromarkExtensions")||[],mdastExtensions:Z.data("fromMarkdownExtensions")||[]})}}var oX=-1,g2=0,q6=1,f2=2,m$=3,u$=4,p$=5,c$=6,tX=7,eX=8;var YO=typeof self==="object"?self:globalThis,Ap=($,Z)=>{let J=(X,G)=>{return $.set(G,X),X},Q=(X)=>{if($.has(X))return $.get(X);let[G,H]=Z[X];switch(G){case g2:case oX:return J(H,X);case q6:{let z=J([],X);for(let K of H)z.push(Q(K));return z}case f2:{let z=J({},X);for(let[K,Y]of H)z[Q(K)]=Q(Y);return z}case m$:return J(new Date(H),X);case u$:{let{source:z,flags:K}=H;return J(new RegExp(z,K),X)}case p$:{let z=J(new Map,X);for(let[K,Y]of H)z.set(Q(K),Q(Y));return z}case c$:{let z=J(new Set,X);for(let K of H)z.add(Q(K));return z}case tX:{let{name:z,message:K}=H;return J(new YO[z](K),X)}case eX:return J(BigInt(H),X);case"BigInt":return J(Object(BigInt(H)),X);case"ArrayBuffer":return J(new Uint8Array(H).buffer,H);case"DataView":{let{buffer:z}=new Uint8Array(H);return J(new DataView(z),H)}}return J(new YO[G](H),X)};return Q},lY=($)=>Ap(new Map,$)(0);var m2="",{toString:Dp}={},{keys:wp}=Object,d$=($)=>{let Z=typeof $;if(Z!=="object"||!$)return[g2,Z];let J=Dp.call($).slice(8,-1);switch(J){case"Array":return[q6,m2];case"Object":return[f2,m2];case"Date":return[m$,m2];case"RegExp":return[u$,m2];case"Map":return[p$,m2];case"Set":return[c$,m2];case"DataView":return[q6,J]}if(J.includes("Array"))return[q6,J];if(J.includes("Error"))return[tX,J];return[f2,J]},$G=([$,Z])=>$===g2&&(Z==="function"||Z==="symbol"),Op=($,Z,J,Q)=>{let X=(H,z)=>{let K=Q.push(H)-1;return J.set(z,K),K},G=(H)=>{if(J.has(H))return J.get(H);let[z,K]=d$(H);switch(z){case g2:{let W=H;switch(K){case"bigint":z=eX,W=H.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+K);W=null;break;case"undefined":return X([oX],H)}return X([z,W],H)}case q6:{if(K){let B=H;if(K==="DataView")B=new Uint8Array(H.buffer);else if(K==="ArrayBuffer")B=new Uint8Array(H);return X([K,[...B]],H)}let W=[],q=X([z,W],H);for(let B of H)W.push(G(B));return q}case f2:{if(K)switch(K){case"BigInt":return X([K,H.toString()],H);case"Boolean":case"Number":case"String":return X([K,H.valueOf()],H)}if(Z&&"toJSON"in H)return G(H.toJSON());let W=[],q=X([z,W],H);for(let B of wp(H))if($||!$G(d$(H[B])))W.push([G(B),G(H[B])]);return q}case m$:return X([z,H.toISOString()],H);case u$:{let{source:W,flags:q}=H;return X([z,{source:W,flags:q}],H)}case p$:{let W=[],q=X([z,W],H);for(let[B,U]of H)if($||!($G(d$(B))||$G(d$(U))))W.push([G(B),G(U)]);return q}case c$:{let W=[],q=X([z,W],H);for(let B of H)if($||!$G(d$(B)))W.push(G(B));return q}}let{message:Y}=H;return X([z,{name:K,message:Y}],H)};return G},iY=($,{json:Z,lossy:J}={})=>{let Q=[];return Op(!(Z||J),!!Z,new Map,Q)($),Q};var u2=typeof structuredClone==="function"?($,Z)=>Z&&(("json"in Z)||("lossy"in Z))?lY(iY($,Z)):structuredClone($):($,Z)=>lY(iY($,Z));function Pp($,Z){let J=[{type:"text",value:"↩"}];if(Z>1)J.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(Z)}]});return J}function jp($,Z){return"Back to reference "+($+1)+(Z>1?"-"+Z:"")}function WO($){let Z=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",J=$.options.footnoteBackContent||Pp,Q=$.options.footnoteBackLabel||jp,X=$.options.footnoteLabel||"Footnotes",G=$.options.footnoteLabelTagName||"h2",H=$.options.footnoteLabelProperties||{className:["sr-only"]},z=[],K=-1;while(++K<$.footnoteOrder.length){let Y=$.footnoteById.get($.footnoteOrder[K]);if(!Y)continue;let W=$.all(Y),q=String(Y.identifier).toUpperCase(),B=o8(q.toLowerCase()),U=0,F=[],V=$.footnoteCounts.get(q);while(V!==void 0&&++U<=V){if(F.length>0)F.push({type:"text",value:" "});let _=typeof J==="string"?J:J(K,U);if(typeof _==="string")_={type:"text",value:_};F.push({type:"element",tagName:"a",properties:{href:"#"+Z+"fnref-"+B+(U>1?"-"+U:""),dataFootnoteBackref:"",ariaLabel:typeof Q==="string"?Q:Q(K,U),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}let N=W[W.length-1];if(N&&N.type==="element"&&N.tagName==="p"){let _=N.children[N.children.length-1];if(_&&_.type==="text")_.value+=" ";else N.children.push({type:"text",value:" "});N.children.push(...F)}else W.push(...F);let L={type:"element",tagName:"li",properties:{id:Z+"fn-"+B},children:$.wrap(W,!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:G,properties:{...u2(H),id:"footnote-label"},children:[{type:"text",value:X}]},{type:"text",value:`
86
- `},{type:"element",tagName:"ol",properties:{},children:$.wrap(z,!0)},{type:"text",value:`
87
- `}]}}var e4=function($){if($===null||$===void 0)return kp;if(typeof $==="function")return ZG($);if(typeof $==="object")return Array.isArray($)?Cp($):Ip($);if(typeof $==="string")return Tp($);throw Error("Expected function, string, or object as test")};function Cp($){let Z=[],J=-1;while(++J<$.length)Z[J]=e4($[J]);return ZG(Q);function Q(...X){let G=-1;while(++G<Z.length)if(Z[G].apply(this,X))return!0;return!1}}function Ip($){let Z=$;return ZG(J);function J(Q){let X=Q,G;for(G in $)if(X[G]!==Z[G])return!1;return!0}}function Tp($){return ZG(Z);function Z(J){return J&&J.type===$}}function ZG($){return Z;function Z(J,Q,X){return Boolean(Ep(J)&&$.call(this,J,typeof Q==="number"?Q:void 0,X||void 0))}}function kp(){return!0}function Ep($){return $!==null&&typeof $==="object"&&"type"in $}function qO($){return $}var BO=[],JG=!0,B6=!1,QG="skip";function l$($,Z,J,Q){let X;if(typeof Z==="function"&&typeof J!=="function")Q=J,J=Z;else X=Z;let G=e4(X),H=Q?-1:1;z($,void 0,[])();function z(K,Y,W){let q=K&&typeof K==="object"?K:{};if(typeof q.type==="string"){let U=typeof q.tagName==="string"?q.tagName:typeof q.name==="string"?q.name:void 0;Object.defineProperty(B,"name",{value:"node ("+qO(K.type+(U?"<"+U+">":""))+")"})}return B;function B(){let U=BO,F,V,N;if(!Z||G(K,Y,W[W.length-1]||void 0)){if(U=Sp(J(K,W)),U[0]===B6)return U}if("children"in K&&K.children){let L=K;if(L.children&&U[0]!==QG){V=(Q?L.children.length:-1)+H,N=W.concat(L);while(V>-1&&V<L.children.length){let _=L.children[V];if(F=z(_,V,N)(),F[0]===B6)return F;V=typeof F[1]==="number"?F[1]:V+H}}}return U}}}function Sp($){if(Array.isArray($))return $;if(typeof $==="number")return[JG,$];return $===null||$===void 0?BO:[$]}function V7($,Z,J,Q){let X,G,H;if(typeof Z==="function"&&typeof J!=="function")G=void 0,H=Z,X=J;else G=Z,H=J,X=Q;l$($,G,z,X);function z(K,Y){let W=Y[Y.length-1],q=W?W.children.indexOf(K):void 0;return H(K,q,W)}}function UO($,Z){let J={type:"element",tagName:"blockquote",properties:{},children:$.wrap($.all(Z),!0)};return $.patch(Z,J),$.applyData(Z,J)}function FO($,Z){let J={type:"element",tagName:"br",properties:{},children:[]};return $.patch(Z,J),[$.applyData(Z,J),{type:"text",value:`
88
- `}]}function VO($,Z){let J=Z.value?Z.value+`
89
- `:"",Q={},X=Z.lang?Z.lang.split(/\s+/):[];if(X.length>0)Q.className=["language-"+X[0]];let G={type:"element",tagName:"code",properties:Q,children:[{type:"text",value:J}]};if(Z.meta)G.data={meta:Z.meta};return $.patch(Z,G),G=$.applyData(Z,G),G={type:"element",tagName:"pre",properties:{},children:[G]},$.patch(Z,G),G}function LO($,Z){let J={type:"element",tagName:"del",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function NO($,Z){let J={type:"element",tagName:"em",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function _O($,Z){let J=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",Q=String(Z.identifier).toUpperCase(),X=o8(Q.toLowerCase()),G=$.footnoteOrder.indexOf(Q),H,z=$.footnoteCounts.get(Q);if(z===void 0)z=0,$.footnoteOrder.push(Q),H=$.footnoteOrder.length;else H=G+1;z+=1,$.footnoteCounts.set(Q,z);let K={type:"element",tagName:"a",properties:{href:"#"+J+"fn-"+X,id:J+"fnref-"+X+(z>1?"-"+z:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(H)}]};$.patch(Z,K);let Y={type:"element",tagName:"sup",properties:{},children:[K]};return $.patch(Z,Y),$.applyData(Z,Y)}function MO($,Z){let J={type:"element",tagName:"h"+Z.depth,properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function AO($,Z){if($.options.allowDangerousHtml){let J={type:"raw",value:Z.value};return $.patch(Z,J),$.applyData(Z,J)}return}function XG($,Z){let J=Z.referenceType,Q="]";if(J==="collapsed")Q+="[]";else if(J==="full")Q+="["+(Z.label||Z.identifier)+"]";if(Z.type==="imageReference")return[{type:"text",value:"!["+Z.alt+Q}];let X=$.all(Z),G=X[0];if(G&&G.type==="text")G.value="["+G.value;else X.unshift({type:"text",value:"["});let H=X[X.length-1];if(H&&H.type==="text")H.value+=Q;else X.push({type:"text",value:Q});return X}function DO($,Z){let J=String(Z.identifier).toUpperCase(),Q=$.definitionById.get(J);if(!Q)return XG($,Z);let X={src:o8(Q.url||""),alt:Z.alt};if(Q.title!==null&&Q.title!==void 0)X.title=Q.title;let G={type:"element",tagName:"img",properties:X,children:[]};return $.patch(Z,G),$.applyData(Z,G)}function wO($,Z){let J={src:o8(Z.url)};if(Z.alt!==null&&Z.alt!==void 0)J.alt=Z.alt;if(Z.title!==null&&Z.title!==void 0)J.title=Z.title;let Q={type:"element",tagName:"img",properties:J,children:[]};return $.patch(Z,Q),$.applyData(Z,Q)}function OO($,Z){let J={type:"text",value:Z.value.replace(/\r?\n|\r/g," ")};$.patch(Z,J);let Q={type:"element",tagName:"code",properties:{},children:[J]};return $.patch(Z,Q),$.applyData(Z,Q)}function PO($,Z){let J=String(Z.identifier).toUpperCase(),Q=$.definitionById.get(J);if(!Q)return XG($,Z);let X={href:o8(Q.url||"")};if(Q.title!==null&&Q.title!==void 0)X.title=Q.title;let G={type:"element",tagName:"a",properties:X,children:$.all(Z)};return $.patch(Z,G),$.applyData(Z,G)}function jO($,Z){let J={href:o8(Z.url)};if(Z.title!==null&&Z.title!==void 0)J.title=Z.title;let Q={type:"element",tagName:"a",properties:J,children:$.all(Z)};return $.patch(Z,Q),$.applyData(Z,Q)}function CO($,Z,J){let Q=$.all(Z),X=J?Rp(J):IO(Z),G={},H=[];if(typeof Z.checked==="boolean"){let W=Q[0],q;if(W&&W.type==="element"&&W.tagName==="p")q=W;else q={type:"element",tagName:"p",properties:{},children:[]},Q.unshift(q);if(q.children.length>0)q.children.unshift({type:"text",value:" "});q.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:Z.checked,disabled:!0},children:[]}),G.className=["task-list-item"]}let z=-1;while(++z<Q.length){let W=Q[z];if(X||z!==0||W.type!=="element"||W.tagName!=="p")H.push({type:"text",value:`
90
- `});if(W.type==="element"&&W.tagName==="p"&&!X)H.push(...W.children);else H.push(W)}let K=Q[Q.length-1];if(K&&(X||K.type!=="element"||K.tagName!=="p"))H.push({type:"text",value:`
91
- `});let Y={type:"element",tagName:"li",properties:G,children:H};return $.patch(Z,Y),$.applyData(Z,Y)}function Rp($){let Z=!1;if($.type==="list"){Z=$.spread||!1;let J=$.children,Q=-1;while(!Z&&++Q<J.length)Z=IO(J[Q])}return Z}function IO($){let Z=$.spread;return Z===null||Z===void 0?$.children.length>1:Z}function TO($,Z){let J={},Q=$.all(Z),X=-1;if(typeof Z.start==="number"&&Z.start!==1)J.start=Z.start;while(++X<Q.length){let H=Q[X];if(H.type==="element"&&H.tagName==="li"&&H.properties&&Array.isArray(H.properties.className)&&H.properties.className.includes("task-list-item")){J.className=["contains-task-list"];break}}let G={type:"element",tagName:Z.ordered?"ol":"ul",properties:J,children:$.wrap(Q,!0)};return $.patch(Z,G),$.applyData(Z,G)}function kO($,Z){let J={type:"element",tagName:"p",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function EO($,Z){let J={type:"root",children:$.wrap($.all(Z))};return $.patch(Z,J),$.applyData(Z,J)}function SO($,Z){let J={type:"element",tagName:"strong",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function RO($,Z){let J=$.all(Z),Q=J.shift(),X=[];if(Q){let H={type:"element",tagName:"thead",properties:{},children:$.wrap([Q],!0)};$.patch(Z.children[0],H),X.push(H)}if(J.length>0){let H={type:"element",tagName:"tbody",properties:{},children:$.wrap(J,!0)},z=h2(Z.children[1]),K=gX(Z.children[Z.children.length-1]);if(z&&K)H.position={start:z,end:K};X.push(H)}let G={type:"element",tagName:"table",properties:{},children:$.wrap(X,!0)};return $.patch(Z,G),$.applyData(Z,G)}function bO($,Z,J){let Q=J?J.children:void 0,G=(Q?Q.indexOf(Z):1)===0?"th":"td",H=J&&J.type==="table"?J.align:void 0,z=H?H.length:Z.children.length,K=-1,Y=[];while(++K<z){let q=Z.children[K],B={},U=H?H[K]:void 0;if(U)B.align=U;let F={type:"element",tagName:G,properties:B,children:[]};if(q)F.children=$.all(q),$.patch(q,F),F=$.applyData(q,F);Y.push(F)}let W={type:"element",tagName:"tr",properties:{},children:$.wrap(Y,!0)};return $.patch(Z,W),$.applyData(Z,W)}function yO($,Z){let J={type:"element",tagName:"td",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function hO($){let Z=String($),J=/\r?\n|\r/g,Q=J.exec(Z),X=0,G=[];while(Q)G.push(xO(Z.slice(X,Q.index),X>0,!0),Q[0]),X=Q.index+Q[0].length,Q=J.exec(Z);return G.push(xO(Z.slice(X),X>0,!1)),G.join("")}function xO($,Z,J){let Q=0,X=$.length;if(Z){let G=$.codePointAt(Q);while(G===9||G===32)Q++,G=$.codePointAt(Q)}if(J){let G=$.codePointAt(X-1);while(G===9||G===32)X--,G=$.codePointAt(X-1)}return X>Q?$.slice(Q,X):""}function vO($,Z){let J={type:"text",value:hO(String(Z.value))};return $.patch(Z,J),$.applyData(Z,J)}function gO($,Z){let J={type:"element",tagName:"hr",properties:{},children:[]};return $.patch(Z,J),$.applyData(Z,J)}var fO={blockquote:UO,break:FO,code:VO,delete:LO,emphasis:NO,footnoteReference:_O,heading:MO,html:AO,imageReference:DO,image:wO,inlineCode:OO,linkReference:PO,link:jO,listItem:CO,list:TO,paragraph:kO,root:EO,strong:SO,table:RO,tableCell:yO,tableRow:bO,text:vO,thematicBreak:gO,toml:GG,yaml:GG,definition:GG,footnoteDefinition:GG};function GG(){return}var rY={}.hasOwnProperty,bp={};function uO($,Z){let J=Z||bp,Q=new Map,X=new Map,G=new Map,H={...fO,...J.handlers},z={all:Y,applyData:xp,definitionById:Q,footnoteById:X,footnoteCounts:G,footnoteOrder:[],handlers:H,one:K,options:J,patch:yp,wrap:vp};return V7($,function(W){if(W.type==="definition"||W.type==="footnoteDefinition"){let q=W.type==="definition"?Q:X,B=String(W.identifier).toUpperCase();if(!q.has(B))q.set(B,W)}}),z;function K(W,q){let B=W.type,U=z.handlers[B];if(rY.call(z.handlers,B)&&U)return U(z,W,q);if(z.options.passThrough&&z.options.passThrough.includes(B)){if("children"in W){let{children:V,...N}=W,L=u2(N);return L.children=z.all(W),L}return u2(W)}return(z.options.unknownHandler||hp)(z,W,q)}function Y(W){let q=[];if("children"in W){let B=W.children,U=-1;while(++U<B.length){let F=z.one(B[U],W);if(F){if(U&&B[U-1].type==="break"){if(!Array.isArray(F)&&F.type==="text")F.value=mO(F.value);if(!Array.isArray(F)&&F.type==="element"){let V=F.children[0];if(V&&V.type==="text")V.value=mO(V.value)}}if(Array.isArray(F))q.push(...F);else q.push(F)}}}return q}}function yp($,Z){if($.position)Z.position=wY($)}function xp($,Z){let J=Z;if($&&$.data){let Q=$.data.hName,X=$.data.hChildren,G=$.data.hProperties;if(typeof Q==="string")if(J.type==="element")J.tagName=Q;else{let H="children"in J?J.children:[J];J={type:"element",tagName:Q,properties:{},children:H}}if(J.type==="element"&&G)Object.assign(J.properties,u2(G));if("children"in J&&J.children&&X!==null&&X!==void 0)J.children=X}return J}function hp($,Z){let J=Z.data||{},Q="value"in Z&&!(rY.call(J,"hProperties")||rY.call(J,"hChildren"))?{type:"text",value:Z.value}:{type:"element",tagName:"div",properties:{},children:$.all(Z)};return $.patch(Z,Q),$.applyData(Z,Q)}function vp($,Z){let J=[],Q=-1;if(Z)J.push({type:"text",value:`
92
- `});while(++Q<$.length){if(Q)J.push({type:"text",value:`
93
- `});J.push($[Q])}if(Z&&$.length>0)J.push({type:"text",value:`
94
- `});return J}function mO($){let Z=0,J=$.charCodeAt(Z);while(J===9||J===32)Z++,J=$.charCodeAt(Z);return $.slice(Z)}function HG($,Z){let J=uO($,Z),Q=J.one($,void 0),X=WO(J),G=Array.isArray(Q)?{type:"root",children:Q}:Q||{type:"root",children:[]};if(X)U1("children"in G),G.children.push({type:"text",value:`
95
- `},X);return G}function zG($,Z){if($&&"run"in $)return async function(J,Q){let X=HG(J,{file:Q,...Z});await $.run(X,Q)};return function(J,Q){return HG(J,{file:Q,...$||Z})}}function aY($){if($)throw $}var WG=O(nO(),1);function i$($){if(typeof $!=="object"||$===null)return!1;let Z=Object.getPrototypeOf($);return(Z===null||Z===Object.prototype||Object.getPrototypeOf(Z)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}function sY(){let $=[],Z={run:J,use:Q};return Z;function J(...X){let G=-1,H=X.pop();if(typeof H!=="function")throw TypeError("Expected function as last argument, not "+H);z(null,...X);function z(K,...Y){let W=$[++G],q=-1;if(K){H(K);return}while(++q<X.length)if(Y[q]===null||Y[q]===void 0)Y[q]=X[q];if(X=Y,W)oO(W,z)(...Y);else H(null,...Y)}}function Q(X){if(typeof X!=="function")throw TypeError("Expected `middelware` to be a function, not "+X);return $.push(X),Z}}function oO($,Z){let J;return Q;function Q(...H){let z=$.length>H.length,K;if(z)H.push(X);try{K=$.apply(this,H)}catch(Y){let W=Y;if(z&&J)throw W;return X(W)}if(!z)if(K&&K.then&&typeof K.then==="function")K.then(G,X);else if(K instanceof Error)X(K);else G(K)}function X(H,...z){if(!J)J=!0,Z(H,...z)}function G(H){X(null,H)}}var V4={basename:gp,dirname:fp,extname:mp,join:up,sep:"/"};function gp($,Z){if(Z!==void 0&&typeof Z!=="string")throw TypeError('"ext" argument must be a string');r$($);let J=0,Q=-1,X=$.length,G;if(Z===void 0||Z.length===0||Z.length>$.length){while(X--)if($.codePointAt(X)===47){if(G){J=X+1;break}}else if(Q<0)G=!0,Q=X+1;return Q<0?"":$.slice(J,Q)}if(Z===$)return"";let H=-1,z=Z.length-1;while(X--)if($.codePointAt(X)===47){if(G){J=X+1;break}}else{if(H<0)G=!0,H=X+1;if(z>-1)if($.codePointAt(X)===Z.codePointAt(z--)){if(z<0)Q=X}else z=-1,Q=H}if(J===Q)Q=H;else if(Q<0)Q=$.length;return $.slice(J,Q)}function fp($){if(r$($),$.length===0)return".";let Z=-1,J=$.length,Q;while(--J)if($.codePointAt(J)===47){if(Q){Z=J;break}}else if(!Q)Q=!0;return Z<0?$.codePointAt(0)===47?"/":".":Z===1&&$.codePointAt(0)===47?"//":$.slice(0,Z)}function mp($){r$($);let Z=$.length,J=-1,Q=0,X=-1,G=0,H;while(Z--){let z=$.codePointAt(Z);if(z===47){if(H){Q=Z+1;break}continue}if(J<0)H=!0,J=Z+1;if(z===46){if(X<0)X=Z;else if(G!==1)G=1}else if(X>-1)G=-1}if(X<0||J<0||G===0||G===1&&X===J-1&&X===Q+1)return"";return $.slice(X,J)}function up(...$){let Z=-1,J;while(++Z<$.length)if(r$($[Z]),$[Z])J=J===void 0?$[Z]:J+"/"+$[Z];return J===void 0?".":pp(J)}function pp($){r$($);let Z=$.codePointAt(0)===47,J=cp($,!Z);if(J.length===0&&!Z)J=".";if(J.length>0&&$.codePointAt($.length-1)===47)J+="/";return Z?"/"+J:J}function cp($,Z){let J="",Q=0,X=-1,G=0,H=-1,z,K;while(++H<=$.length){if(H<$.length)z=$.codePointAt(H);else if(z===47)break;else z=47;if(z===47){if(X===H-1||G===1);else if(X!==H-1&&G===2){if(J.length<2||Q!==2||J.codePointAt(J.length-1)!==46||J.codePointAt(J.length-2)!==46){if(J.length>2){if(K=J.lastIndexOf("/"),K!==J.length-1){if(K<0)J="",Q=0;else J=J.slice(0,K),Q=J.length-1-J.lastIndexOf("/");X=H,G=0;continue}}else if(J.length>0){J="",Q=0,X=H,G=0;continue}}if(Z)J=J.length>0?J+"/..":"..",Q=2}else{if(J.length>0)J+="/"+$.slice(X+1,H);else J=$.slice(X+1,H);Q=H-X-1}X=H,G=0}else if(z===46&&G>-1)G++;else G=-1}return J}function r$($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}var tO={cwd:dp};function dp(){return"/"}function p2($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}function eO($){if(typeof $==="string")$=new URL($);else if(!p2($)){let Z=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+$+"`");throw Z.code="ERR_INVALID_ARG_TYPE",Z}if($.protocol!=="file:"){let Z=TypeError("The URL must be of scheme file");throw Z.code="ERR_INVALID_URL_SCHEME",Z}return lp($)}function lp($){if($.hostname!==""){let Q=TypeError('File URL host must be "localhost" or empty on darwin');throw Q.code="ERR_INVALID_FILE_URL_HOST",Q}let Z=$.pathname,J=-1;while(++J<Z.length)if(Z.codePointAt(J)===37&&Z.codePointAt(J+1)===50){let Q=Z.codePointAt(J+2);if(Q===70||Q===102){let X=TypeError("File URL path must not include encoded / characters");throw X.code="ERR_INVALID_FILE_URL_PATH",X}}return decodeURIComponent(Z)}var nY=["history","path","basename","stem","extname","dirname"];class c2{constructor($){let Z;if(!$)Z={};else if(p2($))Z={path:$};else if(typeof $==="string"||ip($))Z={value:$};else Z=$;this.cwd="cwd"in Z?"":tO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let J=-1;while(++J<nY.length){let X=nY[J];if(X in Z&&Z[X]!==void 0&&Z[X]!==null)this[X]=X==="history"?[...Z[X]]:Z[X]}let Q;for(Q in Z)if(!nY.includes(Q))this[Q]=Z[Q]}get basename(){return typeof this.path==="string"?V4.basename(this.path):void 0}set basename($){tY($,"basename"),oY($,"basename"),this.path=V4.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?V4.dirname(this.path):void 0}set dirname($){$P(this.basename,"dirname"),this.path=V4.join($||"",this.basename)}get extname(){return typeof this.path==="string"?V4.extname(this.path):void 0}set extname($){if(oY($,"extname"),$P(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=V4.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(p2($))$=eO($);if(tY($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?V4.basename(this.path,this.extname):void 0}set stem($){tY($,"stem"),oY($,"stem"),this.path=V4.join(this.dirname||"",$+(this.extname||""))}fail($,Z,J){let Q=this.message($,Z,J);throw Q.fatal=!0,Q}info($,Z,J){let Q=this.message($,Z,J);return Q.fatal=void 0,Q}message($,Z,J){let Q=new _5($,Z,J);if(this.path)Q.name=this.path+":"+Q.name,Q.file=this.path;return Q.fatal=!1,this.messages.push(Q),Q}toString($){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder($||void 0).decode(this.value)}}function oY($,Z){if($&&$.includes(V4.sep))throw Error("`"+Z+"` cannot be a path: did not expect `"+V4.sep+"`")}function tY($,Z){if(!$)throw Error("`"+Z+"` cannot be empty")}function $P($,Z){if(!$)throw Error("Setting `"+Z+"` requires `path` to be set too")}function ip($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var ZP=function($){let Q=this.constructor.prototype,X=Q[$],G=function(){return X.apply(G,arguments)};return Object.setPrototypeOf(G,Q),G};var rp={}.hasOwnProperty;class JW extends ZP{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=sY()}copy(){let $=new JW,Z=-1;while(++Z<this.attachers.length){let J=this.attachers[Z];$.use(...J)}return $.data(WG.default(!0,{},this.namespace)),$}data($,Z){if(typeof $==="string"){if(arguments.length===2)return ZW("data",this.frozen),this.namespace[$]=Z,this;return rp.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return ZW("data",this.frozen),this.namespace=$,this;return this.namespace}freeze(){if(this.frozen)return this;let $=this;while(++this.freezeIndex<this.attachers.length){let[Z,...J]=this.attachers[this.freezeIndex];if(J[0]===!1)continue;if(J[0]===!0)J[0]=void 0;let Q=Z.call($,...J);if(typeof Q==="function")this.transformers.use(Q)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse($){this.freeze();let Z=YG($),J=this.parser||this.Parser;return eY("parse",J),J(String(Z),Z)}process($,Z){let J=this;return this.freeze(),eY("process",this.parser||this.Parser),$W("process",this.compiler||this.Compiler),Z?Q(void 0,Z):new Promise(Q);function Q(X,G){let H=YG($),z=J.parse(H);J.run(z,H,function(Y,W,q){if(Y||!W||!q)return K(Y);let B=W,U=J.stringify(B,q);if(sp(U))q.value=U;else q.result=U;K(Y,q)});function K(Y,W){if(Y||!W)G(Y);else if(X)X(W);else U1(Z,"`done` is defined if `resolve` is not"),Z(void 0,W)}}}processSync($){let Z=!1,J;return this.freeze(),eY("processSync",this.parser||this.Parser),$W("processSync",this.compiler||this.Compiler),this.process($,Q),QP("processSync","process",Z),U1(J,"we either bailed on an error or have a tree"),J;function Q(X,G){Z=!0,aY(X),J=G}}run($,Z,J){JP($),this.freeze();let Q=this.transformers;if(!J&&typeof Z==="function")J=Z,Z=void 0;return J?X(void 0,J):new Promise(X);function X(G,H){U1(typeof Z!=="function","`file` can’t be a `done` anymore, we checked");let z=YG(Z);Q.run($,z,K);function K(Y,W,q){let B=W||$;if(Y)H(Y);else if(G)G(B);else U1(J,"`done` is defined if `resolve` is not"),J(void 0,B,q)}}}runSync($,Z){let J=!1,Q;return this.run($,Z,X),QP("runSync","run",J),U1(Q,"we either bailed on an error or have a tree"),Q;function X(G,H){aY(G),Q=H,J=!0}}stringify($,Z){this.freeze();let J=YG(Z),Q=this.compiler||this.Compiler;return $W("stringify",Q),JP($),Q($,J)}use($,...Z){let J=this.attachers,Q=this.namespace;if(ZW("use",this.frozen),$===null||$===void 0);else if(typeof $==="function")z($,Z);else if(typeof $==="object")if(Array.isArray($))H($);else G($);else throw TypeError("Expected usable value, not `"+$+"`");return this;function X(K){if(typeof K==="function")z(K,[]);else if(typeof K==="object")if(Array.isArray(K)){let[Y,...W]=K;z(Y,W)}else G(K);else throw TypeError("Expected usable value, not `"+K+"`")}function G(K){if(!("plugins"in K)&&!("settings"in K))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(H(K.plugins),K.settings)Q.settings=WG.default(!0,Q.settings,K.settings)}function H(K){let Y=-1;if(K===null||K===void 0);else if(Array.isArray(K))while(++Y<K.length){let W=K[Y];X(W)}else throw TypeError("Expected a list of plugins, not `"+K+"`")}function z(K,Y){let W=-1,q=-1;while(++W<J.length)if(J[W][0]===K){q=W;break}if(q===-1)J.push([K,...Y]);else if(Y.length>0){let[B,...U]=Y,F=J[q][1];if(i$(F)&&i$(B))B=WG.default(!0,F,B);J[q]=[K,B,...U]}}}}var QW=new JW().freeze();function eY($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function $W($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function ZW($,Z){if(Z)throw Error("Cannot call `"+$+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function JP($){if(!i$($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function QP($,Z,J){if(!J)throw Error("`"+$+"` finished async. Use `"+Z+"` instead")}function YG($){return ap($)?$:new c2($)}function ap($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function sp($){return typeof $==="string"||np($)}function np($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var op="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",XP=[],GP={allowDangerousHtml:!0},tp=/^(https?|ircs?|mailto|xmpp)$/i,ep=[{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 XW($){let Z=$c($),J=Zc($);return Jc(Z.runSync(Z.parse(J),J),$)}function $c($){let Z=$.rehypePlugins||XP,J=$.remarkPlugins||XP,Q=$.remarkRehypeOptions?{...$.remarkRehypeOptions,...GP}:GP;return QW().use(nX).use(J).use(zG,Q).use(Z)}function Zc($){let Z=$.children||"",J=new c2;if(typeof Z==="string")J.value=Z;else RX("Unexpected value `"+Z+"` for `children` prop, expected `string`");return J}function Jc($,Z){let{allowedElements:J,allowElement:Q,components:X,disallowedElements:G,skipHtml:H,unwrapDisallowed:z}=Z,K=Z.urlTransform||zP;for(let W of ep)if(Object.hasOwn(Z,W.from))RX("Unexpected `"+W.from+"` prop, "+(W.to?"use `"+W.to+"` instead":"remove it")+" (see <"+op+"#"+W.id+"> for more info)");if(J&&G)RX("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return V7($,Y),jY($,{Fragment:d2.Fragment,components:X,ignoreInvalidStyle:!0,jsx:d2.jsx,jsxs:d2.jsxs,passKeys:!0,passNode:!0});function Y(W,q,B){if(W.type==="raw"&&B&&typeof q==="number"){if(H)B.children.splice(q,1);else B.children[q]={type:"text",value:W.value};return q}if(W.type==="element"){let U;for(U in y$)if(Object.hasOwn(y$,U)&&Object.hasOwn(W.properties,U)){let F=W.properties[U],V=y$[U];if(V===null||V.includes(W.tagName))W.properties[U]=K(String(F||""),U,W)}}if(W.type==="element"){let U=J?!J.includes(W.tagName):G?G.includes(W.tagName):!1;if(!U&&Q&&typeof q==="number")U=!Q(W,q,B);if(U&&B&&typeof q==="number"){if(z&&W.children)B.children.splice(q,1,...W.children);else B.children.splice(q,1);return q}}}}function zP($){let Z=$.indexOf(":"),J=$.indexOf("?"),Q=$.indexOf("#"),X=$.indexOf("/");if(Z===-1||X!==-1&&Z>X||J!==-1&&Z>J||Q!==-1&&Z>Q||tp.test($.slice(0,Z)))return $;return""}var qG=function($,Z,J){let Q=e4(J);if(!$||!$.type||!$.children)throw Error("Expected parent node");if(typeof Z==="number"){if(Z<0||Z===Number.POSITIVE_INFINITY)throw Error("Expected positive finite number as index")}else if(Z=$.children.indexOf(Z),Z<0)throw Error("Expected child node or index");while(++Z<$.children.length)if(Q($.children[Z],Z,$))return $.children[Z];return};var L7=function($){if($===null||$===void 0)return Gc;if(typeof $==="string")return Xc($);if(typeof $==="object")return Qc($);if(typeof $==="function")return GW($);throw Error("Expected function, string, or array as `test`")};function Qc($){let Z=[],J=-1;while(++J<$.length)Z[J]=L7($[J]);return GW(Q);function Q(...X){let G=-1;while(++G<Z.length)if(Z[G].apply(this,X))return!0;return!1}}function Xc($){return GW(Z);function Z(J){return J.tagName===$}}function GW($){return Z;function Z(J,Q,X){return Boolean(Hc(J)&&$.call(this,J,typeof Q==="number"?Q:void 0,X||void 0))}}function Gc($){return Boolean($&&typeof $==="object"&&"type"in $&&$.type==="element"&&"tagName"in $&&typeof $.tagName==="string")}function Hc($){return $!==null&&typeof $==="object"&&"type"in $&&"tagName"in $}var KP=/\n/g,YP=/[\t ]+/g,HW=L7("br"),WP=L7(Uc),zc=L7("p"),qP=L7("tr"),Kc=L7(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Bc,Fc]),BP=L7(["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 zW($,Z){let J=Z||{},Q="children"in $?$.children:[],X=BP($),G=VP($,{whitespace:J.whitespace||"normal",breakBefore:!1,breakAfter:!1}),H=[];if($.type==="text"||$.type==="comment")H.push(...FP($,{whitespace:G,breakBefore:!0,breakAfter:!0}));let z=-1;while(++z<Q.length)H.push(...UP(Q[z],$,{whitespace:G,breakBefore:z?void 0:X,breakAfter:z<Q.length-1?HW(Q[z+1]):X}));let K=[],Y;z=-1;while(++z<H.length){let W=H[z];if(typeof W==="number"){if(Y!==void 0&&W>Y)Y=W}else if(W){if(Y!==void 0&&Y>-1)K.push(`
96
- `.repeat(Y)||" ");Y=-1,K.push(W)}}return K.join("")}function UP($,Z,J){if($.type==="element")return Yc($,Z,J);if($.type==="text")return J.whitespace==="normal"?FP($,J):Wc($);return[]}function Yc($,Z,J){let Q=VP($,J),X=$.children||[],G=-1,H=[];if(Kc($))return H;let z,K;if(HW($))K=`
97
- `;else if(qP($)&&qG(Z,$,qP))K=`
98
- `;else if(zc($))z=2,K=2;else if(BP($))z=1,K=1;while(++G<X.length)H=H.concat(UP(X[G],$,{whitespace:Q,breakBefore:G?void 0:z,breakAfter:G<X.length-1?HW(X[G+1]):K}));if(WP($)&&qG(Z,$,WP))H.push("\t");if(z)H.unshift(z);if(K)H.push(K);return H}function FP($,Z){let J=String($.value),Q=[],X=[],G=0;while(G<=J.length){KP.lastIndex=G;let K=KP.exec(J),Y=K&&"index"in K?K.index:J.length;Q.push(qc(J.slice(G,Y).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),G===0?Z.breakBefore:!0,Y===J.length?Z.breakAfter:!0)),G=Y+1}let H=-1,z;while(++H<Q.length)if(Q[H].charCodeAt(Q[H].length-1)===8203||H<Q.length-1&&Q[H+1].charCodeAt(0)===8203)X.push(Q[H]),z=void 0;else if(Q[H]){if(typeof z==="number")X.push(z);X.push(Q[H]),z=0}else if(H===0||H===Q.length-1)X.push(0);return X}function Wc($){return[String($.value)]}function qc($,Z,J){let Q=[],X=0,G;while(X<$.length){YP.lastIndex=X;let H=YP.exec($);if(G=H?H.index:$.length,!X&&!G&&H&&!Z)Q.push("");if(X!==G)Q.push($.slice(X,G));X=H?G+H[0].length:G}if(X!==G&&!J)Q.push("");return Q.join(" ")}function VP($,Z){if($.type==="element"){let J=$.properties||{};switch($.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return J.wrap?"pre-wrap":"pre";case"td":case"th":return J.noWrap?"nowrap":Z.whitespace;case"textarea":return"pre-wrap";default:}}return Z.whitespace}function Bc($){return Boolean(($.properties||{}).hidden)}function Uc($){return $.tagName==="td"||$.tagName==="th"}function Fc($){return $.tagName==="dialog"&&!($.properties||{}).open}function Vc($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),Q="decltype\\(auto\\)",X="[a-zA-Z_]\\w*::",G="<[^<>]+>",H="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},K="\\\\(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})"/})]},W={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},q={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:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},B={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},U=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",F=["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"],V=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["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"],A={type:V,keyword:F,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},D={className:"function.dispatch",relevance:0,keywords:{_hint:L},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},M=[D,q,z,J,$.C_BLOCK_COMMENT_MODE,W,Y],j={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:M.concat([{begin:/\(/,end:/\)/,keywords:A,contains:M.concat(["self"]),relevance:0}]),relevance:0},T={className:"function",begin:"("+H+"[\\*&\\s]+)+"+U,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:A,relevance:0},{begin:U,returnBegin:!0,contains:[B],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[Y,W]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,Y,W,z,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,Y,W,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,q]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(j,T,D,M,[q,{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:A,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function LP($){let Z={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},J=Vc($),Q=J.keywords;return Q.type=[...Q.type,...Z.type],Q.literal=[...Q.literal,...Z.literal],Q.built_in=[...Q.built_in,...Z.built_in],Q._hints=Z._hints,J.name="Arduino",J.aliases=["ino"],J.supersetOf="cpp",J}function NP($){let Z=$.regex,J={},Q={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[J]}]};Object.assign(J,{className:"variable",variants:[{begin:Z.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},Q]});let X={className:"subst",begin:/\$\(/,end:/\)/,contains:[$.BACKSLASH_ESCAPE]},G=$.inherit($.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),H={begin:/<<-?\s*(?=\w+)/,starts:{contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},z={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,J,X]};X.contains.push(z);let K={match:/\\"/},Y={className:"string",begin:/'/,end:/'/},W={match:/\\'/},q={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},$.NUMBER_MODE,J]},B=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],U=$.SHEBANG({binary:`(${B.join("|")})`,relevance:10}),F={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[$.inherit($.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},V=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],N=["true","false"],L={match:/(\/[a-z._-]+)+/},_=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["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"],D=["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:V,literal:N,built_in:[..._,...w,"set","shopt",...A,...D]},contains:[U,$.SHEBANG(),F,q,G,H,L,z,K,Y,W,J]}}function _P($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),Q="decltype\\(auto\\)",X="[a-zA-Z_]\\w*::",G="<[^<>]+>",H="(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},K="\\\\(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})"/})]},W={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},q={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:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},B={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},U=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",N={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=[q,z,J,$.C_BLOCK_COMMENT_MODE,W,Y],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:L.concat([{begin:/\(/,end:/\)/,keywords:N,contains:L.concat(["self"]),relevance:0}]),relevance:0},w={begin:"("+H+"[\\*&\\s]+)+"+U,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:N,relevance:0},{begin:U,returnBegin:!0,contains:[$.inherit(B,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,Y,W,z,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,Y,W,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,q]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(_,w,L,[q,{begin:$.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},$.TITLE_MODE]}]),exports:{preprocessor:q,strings:Y,keywords:N}}}function MP($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),Q="decltype\\(auto\\)",X="[a-zA-Z_]\\w*::",G="<[^<>]+>",H="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},K="\\\\(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})"/})]},W={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},q={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:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},B={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},U=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",F=["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"],V=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["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"],A={type:V,keyword:F,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},D={className:"function.dispatch",relevance:0,keywords:{_hint:L},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},M=[D,q,z,J,$.C_BLOCK_COMMENT_MODE,W,Y],j={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:M.concat([{begin:/\(/,end:/\)/,keywords:A,contains:M.concat(["self"]),relevance:0}]),relevance:0},T={className:"function",begin:"("+H+"[\\*&\\s]+)+"+U,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:A,relevance:0},{begin:U,returnBegin:!0,contains:[B],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[Y,W]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,Y,W,z,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,Y,W,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,q]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(j,T,D,M,[q,{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:A,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function AP($){let Z=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],J=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],Q=["default","false","null","true"],X=["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"],G=["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"],H={keyword:X.concat(G),built_in:Z,literal:Q},z=$.inherit($.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),K={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},W={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},q=$.inherit(W,{illegal:/\n/}),B={className:"subst",begin:/\{/,end:/\}/,keywords:H},U=$.inherit(B,{illegal:/\n/}),F={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},$.BACKSLASH_ESCAPE,U]},V={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},B]},N=$.inherit(V,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},U]});B.contains=[V,F,W,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,K,$.C_BLOCK_COMMENT_MODE],U.contains=[N,F,q,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,K,$.inherit($.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let L={variants:[Y,V,F,W,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},_={begin:"<",end:">",contains:[{beginKeywords:"in out"},z]},w=$.IDENT_RE+"(<"+$.IDENT_RE+"(\\s*,\\s*"+$.IDENT_RE+")*>)?(\\[\\])?",A={begin:"@"+$.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:H,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,K,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},z,_,$.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,_,$.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:"("+w+"\\s+)+"+$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:H,contains:[{beginKeywords:J.join(" "),relevance:0},{begin:$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[$.TITLE_MODE,_],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:H,relevance:0,contains:[L,K,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},A]}}var Lc=($)=>{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_-]*/}}},Nc=["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"],_c=["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"],Mc=[...Nc,..._c],Ac=["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(),Dc=["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(),wc=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Oc=["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 DP($){let Z=$.regex,J=Lc($),Q={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},X="and or not only",G=/@-?\w[\w]*(-\w+)*/,H="[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:[J.BLOCK_COMMENT,Q,J.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},J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Dc.join("|")+")"},{begin:":(:)?("+wc.join("|")+")"}]},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Oc.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[J.BLOCK_COMMENT,J.HEXCOLOR,J.IMPORTANT,J.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}]},J.FUNCTION_DISPATCH]},{begin:Z.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:G},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Ac.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...z,J.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Mc.join("|")+")\\b"}]}}function wP($){let Z=$.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:Z.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:Z.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function OP($){let G={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:G,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:G,illegal:/["']/}]}]}}function PP($){let Z=$.regex,J=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[$.HASH_COMMENT_MODE,$.QUOTE_STRING_MODE,$.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:Z.concat(J,Z.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function jP($){let Z=$.regex,J={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:$.NUMBER_RE}]},Q=$.COMMENT();Q.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let X={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},G={className:"literal",begin:/\bon|off|true|false|yes|no\b/},H={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},z={begin:/\[/,end:/\]/,contains:[Q,G,X,H,J,"self"],relevance:0},K=/[A-Za-z0-9_-]+/,Y=/"(\\"|[^"])*"/,W=/'[^']*'/,q=Z.either(K,Y,W),B=Z.concat(q,"(\\s*\\.\\s*",q,")*",Z.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[Q,{className:"section",begin:/\[+/,end:/\]+/},{begin:B,className:"attr",starts:{end:/$/,contains:[Q,z,G,X,H,J]}}]}}var l2="[0-9](_*[0-9])*",BG=`\\.(${l2})`,UG="[0-9a-fA-F](_*[0-9a-fA-F])*",CP={className:"number",variants:[{begin:`(\\b(${l2})((${BG})|\\.)?|(${BG}))[eE][+-]?(${l2})[fFdD]?\\b`},{begin:`\\b(${l2})((${BG})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${BG})[fFdD]?\\b`},{begin:`\\b(${l2})[fFdD]\\b`},{begin:`\\b0[xX]((${UG})\\.?|(${UG})?\\.(${UG}))[pP][+-]?(${l2})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${UG})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function IP($,Z,J){if(J===-1)return"";return $.replace(Z,(Q)=>{return IP($,Z,J-1)})}function TP($){let Z=$.regex,J="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",Q="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+IP("(?:<"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~(?:\\s*,\\s*"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~)*>)?",/~~~/g,2),K={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"]}]},W={className:"params",begin:/\(/,end:/\)/,keywords:K,relevance:0,contains:[$.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:K,illegal:/<\/|#/,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[$.BACKSLASH_ESCAPE]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[Z.concat(/(?!else)/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"),/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"},contains:[W,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+Q+"\\s+)",$.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:K,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:K,relevance:0,contains:[Y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,CP,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},CP,Y]}}var Pc=["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"],jc=["true","false","null","undefined","NaN","Infinity"],kP=["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"],EP=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],SP=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Cc=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ic=[].concat(SP,kP,EP);function RP($){let Z=$.regex,J=(h,{after:p})=>{let P="</"+h[0].slice(1);return h.input.indexOf(P,p)!==-1},Q="[A-Za-z$_][0-9A-Za-z$_]*",X={begin:"<>",end:"</>"},G=/<[A-Za-z0-9\\._:-]+\s*\/>/,H={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(h,p)=>{let P=h[0].length+h.index,t=h.input[P];if(t==="<"||t===","){p.ignoreMatch();return}if(t===">"){if(!J(h,{after:P}))p.ignoreMatch()}let z0,y=h.input.substring(P);if(z0=y.match(/^\s*=/)){p.ignoreMatch();return}if(z0=y.match(/^\s+extends\s+/)){if(z0.index===0){p.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Pc,literal:jc,built_in:Ic,"variable.language":Cc},K="[0-9](_?[0-9])*",Y="\\.([0-9](_?[0-9])*)",W="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",q={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},B={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},U={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,B],subLanguage:"xml"}},F={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,B],subLanguage:"css"}},V={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,B],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,B]},_={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]},w=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,U,F,V,N,{match:/\$\d+/},q];B.contains=w.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(w)});let A=[].concat(_,B.contains),D=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(A)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:D},j={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...kP,...EP]}},E={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={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:[M],illegal:/%/},g={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function b(h){return Z.concat("(?!",h.join("|"),")")}let k={match:Z.concat(/\b/,b([...SP,"super","import"].map((h)=>`${h}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},x={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},R={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),E,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,U,F,V,N,_,{match:/\$\d+/},q,T,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},S,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,$.REGEXP_MODE,{className:"function",begin:I,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:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:X.begin,end:X.end},{match:G},{begin:H.begin,"on:begin":H.isTrulyOpeningTag,end:H.end}],subLanguage:"xml",contains:[{begin:H.begin,end:H.end,skip:!0,contains:["self"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},x,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},k,g,j,R,{match:/\$[(.]/}]}}function bP($){let Z={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},J={match:/[{}[\],:]/,className:"punctuation",relevance:0},Q=["true","false","null"],X={scope:"literal",beginKeywords:Q.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:Q},contains:[Z,J,$.QUOTE_STRING_MODE,X,$.C_NUMBER_MODE,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var i2="[0-9](_*[0-9])*",FG=`\\.(${i2})`,VG="[0-9a-fA-F](_*[0-9a-fA-F])*",Tc={className:"number",variants:[{begin:`(\\b(${i2})((${FG})|\\.)?|(${FG}))[eE][+-]?(${i2})[fFdD]?\\b`},{begin:`\\b(${i2})((${FG})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${FG})[fFdD]?\\b`},{begin:`\\b(${i2})[fFdD]\\b`},{begin:`\\b0[xX]((${VG})\\.?|(${VG})?\\.(${VG}))[pP][+-]?(${i2})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${VG})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function yP($){let Z={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},J={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},Q={className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"@"},X={className:"subst",begin:/\$\{/,end:/\}/,contains:[$.C_NUMBER_MODE]},G={className:"variable",begin:"\\$"+$.UNDERSCORE_IDENT_RE},H={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[G,X]},{begin:"'",end:"'",illegal:/\n/,contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[$.BACKSLASH_ESCAPE,G,X]}]};X.contains.push(H);let z={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+$.UNDERSCORE_IDENT_RE+")?"},K={className:"meta",begin:"@"+$.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[$.inherit(H,{className:"string"}),"self"]}]},Y=Tc,W=$.COMMENT("/\\*","\\*/",{contains:[$.C_BLOCK_COMMENT_MODE]}),q={variants:[{className:"type",begin:$.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},B=q;return B.variants[1].contains=[q],q.variants[1].contains=[B],{name:"Kotlin",aliases:["kt","kts"],keywords:Z,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),$.C_LINE_COMMENT_MODE,W,J,Q,z,K,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:Z,relevance:5,contains:[{begin:$.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[$.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Z,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[q,$.C_LINE_COMMENT_MODE,W],relevance:0},$.C_LINE_COMMENT_MODE,W,z,K,H,$.C_NUMBER_MODE]},W]},{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,K]},H,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
99
- `},Y]}}var kc=($)=>{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_-]*/}}},Ec=["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"],Sc=["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"],Rc=[...Ec,...Sc],bc=["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(),xP=["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(),hP=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),yc=["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(),xc=xP.concat(hP).sort().reverse();function vP($){let Z=kc($),J=xc,Q="and or not only",X="[\\w-]+",G="([\\w-]+|@\\{[\\w-]+\\})",H=[],z=[],K=function(w){return{className:"string",begin:"~?"+w+".*?"+w}},Y=function(w,A,D){return{className:w,begin:A,relevance:D}},W={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:bc.join(" ")},q={begin:"\\(",end:"\\)",contains:z,keywords:W,relevance:0};z.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,K("'"),K('"'),Z.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},Z.HEXCOLOR,q,Y("variable","@@?[\\w-]+",10),Y("variable","@\\{[\\w-]+\\}"),Y("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},Z.IMPORTANT,{beginKeywords:"and not"},Z.FUNCTION_DISPATCH);let B=z.concat({begin:/\{/,end:/\}/,contains:H}),U={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(z)},F={begin:G+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+yc.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:z}}]},V={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:W,returnEnd:!0,contains:z,relevance:0}},N={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:B}},L={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:G,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,U,Y("keyword","all\\b"),Y("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+Rc.join("|")+")\\b",className:"selector-tag"},Z.CSS_NUMBER_MODE,Y("selector-tag",G,0),Y("selector-id","#"+G),Y("selector-class","\\."+G,0),Y("selector-tag","&",0),Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+xP.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+hP.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:B},{begin:"!important"},Z.FUNCTION_DISPATCH]},_={begin:`[\\w-]+:(:)?(${J.join("|")})`,returnBegin:!0,contains:[L]};return H.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,V,N,_,F,L,U,Z.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:H}}function gP($){let Q={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},X=[$.COMMENT("--(?!\\[=*\\[)","$"),$.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[Q],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:X.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:X}].concat(X)},$.C_NUMBER_MODE,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[Q],relevance:5}])}}function fP($){let Z={className:"variable",variants:[{begin:"\\$\\("+$.UNDERSCORE_IDENT_RE+"\\)",contains:[$.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},J={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,Z]},Q={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[Z,J]},X={begin:"^"+$.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},G={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},H={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[Z]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[$.HASH_COMMENT_MODE,Z,J,Q,X,G,H]}}function mP($){let Z=$.regex,J={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},Q={begin:"^[-\\*]{3,}",end:"$"},X={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}]},G={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},H={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+.-]*/,K={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:Z.concat(/\[.+?\]\(/,z,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},Y={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},W={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},q=$.inherit(Y,{contains:[]}),B=$.inherit(W,{contains:[]});Y.contains.push(B),W.contains.push(q);let U=[J,K];return[Y,W,q,B].forEach((L)=>{L.contains=L.contains.concat(U)}),U=U.concat(Y,W),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:U},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:U}]}]},J,G,Y,W,{className:"quote",begin:"^>\\s+",contains:U,end:"$"},X,Q,K,H,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function uP($){let Z={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},J=/[a-zA-Z@][a-zA-Z0-9_]*/,z={"variable.language":["this","super"],$pattern:J,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"]},K={$pattern:J,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:z,illegal:"</",contains:[Z,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,$.C_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit($.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+K.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:K,contains:[$.UNDERSCORE_TITLE_MODE]},{begin:"\\."+$.UNDERSCORE_IDENT_RE,relevance:0}]}}function pP($){let Z=$.regex,J=["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"],Q=/[dualxmsipngr]{0,12}/,X={$pattern:/[\w.]+/,keyword:J.join(" ")},G={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:X},H={begin:/->\{/,end:/\}/},z={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},K={scope:"variable",variants:[{begin:/\$\d/},{begin:Z.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[z]},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},W=[$.BACKSLASH_ESCAPE,G,K],q=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],B=(V,N,L="\\1")=>{let _=L==="\\1"?L:Z.concat(L,N);return Z.concat(Z.concat("(?:",V,")"),N,/(?:\\.|[^\\\/])*?/,_,/(?:\\.|[^\\\/])*?/,L,Q)},U=(V,N,L)=>{return Z.concat(Z.concat("(?:",V,")"),N,/(?:\\.|[^\\\/])*?/,L,Q)},F=[K,$.HASH_COMMENT_MODE,$.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),H,{className:"string",contains:W,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:B("s|tr|y",Z.either(...q,{capture:!0}))},{begin:B("s|tr|y","\\(","\\)")},{begin:B("s|tr|y","\\[","\\]")},{begin:B("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:U("(?:m|qr)?",/\//,/\//)},{begin:U("m|qr",Z.either(...q,{capture:!0}),/\1/)},{begin:U("m|qr",/\(/,/\)/)},{begin:U("m|qr",/\[/,/\]/)},{begin:U("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 G.contains=F,H.contains=F,{name:"Perl",aliases:["pl","pm"],keywords:X,contains:F}}function cP($){let Z=$.regex,J=/(?![A-Za-z0-9])(?![$])/,Q=Z.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,J),X=Z.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,J),G=Z.concat(/[A-Z]+/,J),H={scope:"variable",match:"\\$+"+Q},z={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},K={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},Y=$.inherit($.APOS_STRING_MODE,{illegal:null}),W=$.inherit($.QUOTE_STRING_MODE,{illegal:null,contains:$.QUOTE_STRING_MODE.contains.concat(K)}),q={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:$.QUOTE_STRING_MODE.contains.concat(K),"on:begin":(x,R)=>{R.data._beginMatch=x[1]||x[2]},"on:end":(x,R)=>{if(R.data._beginMatch!==x[1])R.ignoreMatch()}},B=$.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),U=`[
100
- ]`,F={scope:"string",variants:[W,Y,q,B]},V={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},N=["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"],_=["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"],A={keyword:L,literal:((x)=>{let R=[];return x.forEach((I)=>{if(R.push(I),I.toLowerCase()===I)R.push(I.toUpperCase());else R.push(I.toLowerCase())}),R})(N),built_in:_},D=(x)=>{return x.map((R)=>{return R.replace(/\|\d+$/,"")})},M={variants:[{match:[/new/,Z.concat(`[
101
- ]`,"+"),Z.concat("(?!",D(_).join("\\b|"),"\\b)"),X],scope:{1:"keyword",4:"title.class"}}]},j=Z.concat(Q,"\\b(?!\\()"),T={variants:[{match:[Z.concat(/::/,Z.lookahead(/(?!class\b)/)),j],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[X,Z.concat(/::/,Z.lookahead(/(?!class\b)/)),j],scope:{1:"title.class",3:"variable.constant"}},{match:[X,Z.concat("::",Z.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[X,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},E={scope:"attr",match:Z.concat(Q,Z.lookahead(":"),Z.lookahead(/(?!::)/))},C={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[E,H,T,$.C_BLOCK_COMMENT_MODE,F,V,M]},g={relevance:0,match:[/\b/,Z.concat("(?!fn\\b|function\\b|",D(L).join("\\b|"),"|",D(_).join("\\b|"),"\\b)"),Q,Z.concat(`[
102
- ]`,"*"),Z.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[C]};C.contains.push(g);let b=[E,T,$.C_BLOCK_COMMENT_MODE,F,V,M],k={begin:Z.concat(/#\[\s*\\?/,Z.either(X,G)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:N,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:N,keyword:["new","array"]},contains:["self",...b]},...b,{scope:"meta",variants:[{match:X},{match:G}]}]};return{case_insensitive:!1,keywords:A,contains:[k,$.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/},H,g,T,{match:[/const/,/\s/,Q],scope:{1:"keyword",3:"variable.constant"}},M,{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:A,contains:["self",k,H,T,$.C_BLOCK_COMMENT_MODE,F,V]}]},{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]},F,V]}}function dP($){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 lP($){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function iP($){let Z=$.regex,J=/[\p{XID_Start}_]\p{XID_Continue}*/u,Q=["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:Q,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"]},K={className:"meta",begin:/^(>>>|\.\.\.) /},Y={className:"subst",begin:/\{/,end:/\}/,keywords:z,illegal:/#/},W={begin:/\{\{/,relevance:0},q={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,K],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,K],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,K,W,Y]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,K,W,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,W,Y]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,W,Y]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},B="[0-9](_?[0-9])*",U="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",F=`\\b|${Q.join("|")}`,V={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]?(?=${F})`},{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]?(?=${F})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${F})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${F})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${F})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${F})`}]},N={className:"comment",begin:Z.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",K,V,q,$.HASH_COMMENT_MODE]}]};return Y.contains=[q,V,K],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:z,illegal:/(<\/|\?)|=>/,contains:[K,V,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},q,N,$.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,J],scope:{1:"keyword",3:"title.function"},contains:[L]},{variants:[{match:[/\bclass/,/\s+/,J,/\s*/,/\(\s*/,J,/\s*\)/]},{match:[/\bclass/,/\s+/,J]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[V,L,q]}]}}function rP($){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function aP($){let Z=$.regex,J=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,Q=Z.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),X=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,G=Z.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:J,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[$.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:Z.lookahead(Z.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:J},{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:[X,Q]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,Q]},{scope:{1:"punctuation",2:"number"},match:[G,Q]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,Q]}]},{scope:{3:"operator"},match:[J,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:X},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:G},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function sP($){let Z=$.regex,J="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",Q=Z.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),X=Z.concat(Q,/(::\w+)*/),H={"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]+"},K={begin:"#<",end:">"},Y=[$.COMMENT("#","$",{contains:[z]}),$.COMMENT("^=begin","^=end",{contains:[z],relevance:10}),$.COMMENT("^__END__",$.MATCH_NOTHING_RE)],W={className:"subst",begin:/#\{/,end:/\}/,keywords:H},q={className:"string",contains:[$.BACKSLASH_ESCAPE,W],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:Z.concat(/<<[-~]?'?/,Z.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[$.BACKSLASH_ESCAPE,W]})]}]},B="[1-9](_?[0-9])*|0",U="[0-9](_?[0-9])*",F={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"}]},V={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:H}]},M=[q,{variants:[{match:[/class\s+/,X,/\s+<\s+/,X]},{match:[/\b(class|module)\s+/,X]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:H},{match:[/(include|extend)\s+/,X],scope:{2:"title.class"},keywords:H},{relevance:0,match:[X,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:Q,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[V]},{begin:$.IDENT_RE+"::"},{className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[q,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},F,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:H},{begin:"("+$.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[$.BACKSLASH_ESCAPE,W],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(K,Y),relevance:0}].concat(K,Y);W.contains=M,V.contains=M;let j="[>?]>",T="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",E="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",C=[{begin:/^\s*=>/,starts:{end:"$",contains:M}},{className:"meta.prompt",begin:"^("+j+"|"+T+"|"+E+")(?=[ ])",starts:{end:"$",keywords:H,contains:M}}];return Y.unshift(K),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:H,illegal:/\/\*/,contains:[$.SHEBANG({binary:"ruby"})].concat(C).concat(Y).concat(M)}}function nP($){let Z=$.regex,J=/(r#)?/,Q=Z.concat(J,$.UNDERSCORE_IDENT_RE),X=Z.concat(J,$.IDENT_RE),G={className:"title.function.invoke",relevance:0,begin:Z.concat(/\b/,/(?!let|for|while|if|else|match\b)/,X,Z.lookahead(/\s*\(/))},H="([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"],K=["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!"],W=["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:W,keyword:z,literal:K,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+/,Q],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,Q],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,Q,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,Q],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,Q],className:{1:"keyword",3:"title.class"}},{begin:$.IDENT_RE+"::",keywords:{keyword:"Self",built_in:Y,type:W}},{className:"punctuation",begin:"->"},G]}}var hc=($)=>{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_-]*/}}},vc=["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"],gc=["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"],fc=[...vc,...gc],mc=["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(),uc=["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(),pc=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),cc=["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 oP($){let Z=hc($),J=pc,Q=uc,X="@[a-z-]+",G="and or not only",H="[a-zA-Z-][a-zA-Z0-9_-]*",z={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,Z.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+fc.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+Q.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+J.join("|")+")"},z,{begin:/\(/,end:/\)/,contains:[Z.CSS_NUMBER_MODE]},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+cc.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[Z.BLOCK_COMMENT,z,Z.HEXCOLOR,Z.CSS_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.IMPORTANT,Z.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:"@[a-z-]+",keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:mc.join(" ")},contains:[{begin:"@[a-z-]+",className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},z,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.HEXCOLOR,Z.CSS_NUMBER_MODE]},Z.FUNCTION_DISPATCH]}}function tP($){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function eP($){let Z=$.regex,J=$.COMMENT("--","$"),Q={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},X={begin:/"/,end:/"/,contains:[{match:/""/}]},G=["true","false","unknown"],H=["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"],K=["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"],W=["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"],q=["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"],B=["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"],U=W,F=[...Y,...K].filter((D)=>{return!W.includes(D)}),V={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},N={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},L={match:Z.concat(/\b/,Z.either(...U),/\s*\(/),relevance:0,keywords:{built_in:U}};function _(D){return Z.concat(/\b/,Z.either(...D.map((M)=>{return M.replace(/\s+/,"\\s+")})),/\b/)}let w={scope:"keyword",match:_(B),relevance:0};function A(D,{exceptions:M,when:j}={}){let T=j;return M=M||[],D.map((E)=>{if(E.match(/\|\d+$/)||M.includes(E))return E;else if(T(E))return`${E}|0`;else return E})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(F,{when:(D)=>D.length<3}),literal:G,type:z,built_in:q},contains:[{scope:"type",match:_(H)},w,L,V,Q,X,$.C_NUMBER_MODE,$.C_BLOCK_COMMENT_MODE,J,N]}}function Qj($){if(!$)return null;if(typeof $==="string")return $;return $.source}function a$($){return j1("(?=",$,")")}function j1(...$){return $.map((J)=>Qj(J)).join("")}function dc($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function W8(...$){return"("+(dc($).capture?"":"?:")+$.map((Q)=>Qj(Q)).join("|")+")"}var WW=($)=>j1(/\b/,$,/\w$/.test($)?/\b/:/\B/),lc=["Protocol","Type"].map(WW),$j=["init","self"].map(WW),ic=["Any","Self"],KW=["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"],Zj=["false","nil","true"],rc=["assignment","associativity","higherThan","left","lowerThan","none","right"],ac=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Jj=["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"],Xj=W8(/[/=\-+!*%<>&|^~?]/,/[\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]/),Gj=W8(Xj,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),YW=j1(Xj,Gj,"*"),Hj=W8(/[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]/),NG=W8(Hj,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),$7=j1(Hj,NG,"*"),LG=j1(/[A-Z]/,NG,"*"),sc=["attached","autoclosure",j1(/convention\(/,W8("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",j1(/objc\(/,$7,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],nc=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function zj($){let Z={match:/\s+/,relevance:0},J=$.COMMENT("/\\*","\\*/",{contains:["self"]}),Q=[$.C_LINE_COMMENT_MODE,J],X={match:[/\./,W8(...lc,...$j)],className:{2:"keyword"}},G={match:j1(/\./,W8(...KW)),relevance:0},H=KW.filter((i)=>typeof i==="string").concat(["_|0"]),z=KW.filter((i)=>typeof i!=="string").concat(ic).map(WW),K={variants:[{className:"keyword",match:W8(...z,...$j)}]},Y={$pattern:W8(/\b\w+/,/#\w+/),keyword:H.concat(ac),literal:Zj},W=[X,G,K],q={match:j1(/\./,W8(...Jj)),relevance:0},B={className:"built_in",match:j1(/\b/,W8(...Jj),/(?=\()/)},U=[q,B],F={match:/->/,relevance:0},V={className:"operator",relevance:0,variants:[{match:YW},{match:`\\.(\\.|${Gj})+`}]},N=[F,V],L="([0-9]_*)+",_="([0-9a-fA-F]_*)+",w={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/}]},A=(i="")=>({className:"subst",variants:[{match:j1(/\\/,i,/[0\\tnr"']/)},{match:j1(/\\/,i,/u\{[0-9a-fA-F]{1,8}\}/)}]}),D=(i="")=>({className:"subst",match:j1(/\\/,i,/[\t ]*(?:[\r\n]|\r\n)/)}),M=(i="")=>({className:"subst",label:"interpol",begin:j1(/\\/,i,/\(/),end:/\)/}),j=(i="")=>({begin:j1(i,/"""/),end:j1(/"""/,i),contains:[A(i),D(i),M(i)]}),T=(i="")=>({begin:j1(i,/"/),end:j1(/"/,i),contains:[A(i),M(i)]}),E={className:"string",variants:[j(),j("#"),j("##"),j("###"),T(),T("#"),T("##"),T("###")]},C=[$.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[$.BACKSLASH_ESCAPE]}],g={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:C},b=(i)=>{let Y0=j1(i,/\//),r=j1(/\//,i);return{begin:Y0,end:r,contains:[...C,{scope:"comment",begin:`#(?!.*${r})`,end:/$/}]}},k={scope:"regexp",variants:[b("###"),b("##"),b("#"),g]},x={match:j1(/`/,$7,/`/)},R={className:"variable",match:/\$\d+/},I={className:"variable",match:`\\$${NG}+`},S=[x,R,I],h={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:nc,contains:[...N,w,E]}]}},p={scope:"keyword",match:j1(/@/,W8(...sc),a$(W8(/\(/,/\s+/)))},P={scope:"meta",match:j1(/@/,$7)},t=[h,p,P],z0={match:a$(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:j1(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,NG,"+")},{className:"type",match:LG,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:j1(/\s+&\s+/,a$(LG)),relevance:0}]},y={begin:/</,end:/>/,keywords:Y,contains:[...Q,...W,...t,F,z0]};z0.contains.push(y);let n={match:j1($7,/\s*:/),keywords:"_|0",relevance:0},_0={begin:/\(/,end:/\)/,relevance:0,keywords:Y,contains:["self",n,...Q,k,...W,...U,...N,w,E,...S,...t,z0]},c={begin:/</,end:/>/,keywords:"repeat each",contains:[...Q,z0]},X0={begin:W8(a$(j1($7,/\s*:/)),a$(j1($7,/\s+/,$7,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:$7}]},K0={begin:/\(/,end:/\)/,keywords:Y,contains:[X0,...Q,...W,...N,w,E,...t,z0,_0],endsParent:!0,illegal:/["']/},Z0={match:[/(func|macro)/,/\s+/,W8(x.match,$7,YW)],className:{1:"keyword",3:"title.function"},contains:[c,K0,Z],illegal:[/\[/,/%/]},G0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[c,K0,Z],illegal:/\[|%/},U0={match:[/operator/,/\s+/,YW],className:{1:"keyword",3:"title"}},m={begin:[/precedencegroup/,/\s+/,LG],className:{1:"keyword",3:"title"},contains:[z0],keywords:[...rc,...Zj],end:/}/},s={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},u={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},F0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,$7,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:Y,contains:[c,...W,{begin:/:/,end:/\{/,keywords:Y,contains:[{scope:"title.class.inherited",match:LG},...W],relevance:0}]};for(let i of E.variants){let Y0=i.contains.find((e)=>e.label==="interpol");Y0.keywords=Y;let r=[...W,...U,...N,w,E,...S];Y0.contains=[...r,{begin:/\(/,end:/\)/,contains:["self",...r]}]}return{name:"Swift",keywords:Y,contains:[...Q,Z0,G0,s,u,F0,U0,m,{beginKeywords:"import",end:/$/,contains:[...Q],relevance:0},k,...W,...U,...N,w,E,...S,...t,z0,_0]}}var Kj=["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"],Yj=["true","false","null","undefined","NaN","Infinity"],Wj=["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"],qj=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Bj=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Uj=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Fj=[].concat(Bj,Wj,qj);function oc($){let Z=$.regex,J=(h,{after:p})=>{let P="</"+h[0].slice(1);return h.input.indexOf(P,p)!==-1},Q="[A-Za-z$_][0-9A-Za-z$_]*",X={begin:"<>",end:"</>"},G=/<[A-Za-z0-9\\._:-]+\s*\/>/,H={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(h,p)=>{let P=h[0].length+h.index,t=h.input[P];if(t==="<"||t===","){p.ignoreMatch();return}if(t===">"){if(!J(h,{after:P}))p.ignoreMatch()}let z0,y=h.input.substring(P);if(z0=y.match(/^\s*=/)){p.ignoreMatch();return}if(z0=y.match(/^\s+extends\s+/)){if(z0.index===0){p.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Kj,literal:Yj,built_in:Fj,"variable.language":Uj},K="[0-9](_?[0-9])*",Y="\\.([0-9](_?[0-9])*)",W="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",q={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},B={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},U={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,B],subLanguage:"xml"}},F={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,B],subLanguage:"css"}},V={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,B],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,B]},_={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]},w=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,U,F,V,N,{match:/\$\d+/},q];B.contains=w.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(w)});let A=[].concat(_,B.contains),D=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(A)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:D},j={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Wj,...qj]}},E={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={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:[M],illegal:/%/},g={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function b(h){return Z.concat("(?!",h.join("|"),")")}let k={match:Z.concat(/\b/,b([...Bj,"super","import"].map((h)=>`${h}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},x={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},R={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),E,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,U,F,V,N,_,{match:/\$\d+/},q,T,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},S,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,$.REGEXP_MODE,{className:"function",begin:I,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:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:X.begin,end:X.end},{match:G},{begin:H.begin,"on:begin":H.isTrulyOpeningTag,end:H.end}],subLanguage:"xml",contains:[{begin:H.begin,end:H.end,skip:!0,contains:["self"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},x,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},k,g,j,R,{match:/\$[(.]/}]}}function Vj($){let Z=$.regex,J=oc($),Q="[A-Za-z$_][0-9A-Za-z$_]*",X=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],G={begin:[/namespace/,/\s+/,$.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},H={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:X},contains:[J.exports.CLASS_REFERENCE]},z={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},K=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],Y={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Kj.concat(K),literal:Yj,built_in:Fj.concat(X),"variable.language":Uj},W={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},q=(V,N,L)=>{let _=V.contains.findIndex((w)=>w.label===N);if(_===-1)throw Error("can not find mode to replace");V.contains.splice(_,1,L)};Object.assign(J.keywords,Y),J.exports.PARAMS_CONTAINS.push(W);let B=J.contains.find((V)=>V.scope==="attr"),U=Object.assign({},B,{match:Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\?:/))});J.exports.PARAMS_CONTAINS.push([J.exports.CLASS_REFERENCE,B,U]),J.contains=J.contains.concat([W,G,H,U]),q(J,"shebang",$.SHEBANG()),q(J,"use_strict",z);let F=J.contains.find((V)=>V.label==="func.def");return F.relevance=0,Object.assign(J,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),J}function Lj($){let Z=$.regex,J={className:"string",begin:/"(""|[^/n])"C\b/},Q={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},X=/\d{1,2}\/\d{1,2}\/\d{4}/,G=/\d{4}-\d{1,2}-\d{1,2}/,H=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,z=/\d{1,2}(:\d{1,2}){1,2}/,K={className:"literal",variants:[{begin:Z.concat(/# */,Z.either(G,X),/ *#/)},{begin:Z.concat(/# */,z,/ *#/)},{begin:Z.concat(/# */,H,/ *#/)},{begin:Z.concat(/# */,Z.either(G,X),/ +/,Z.either(H,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])|[%&])?/}]},W={className:"label",begin:/^\w+:/},q=$.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),B=$.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:[J,Q,K,Y,W,q,B,{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:[B]}]}}function Nj($){$.regex;let Z=$.COMMENT(/\(;/,/;\)/);Z.contains.push("self");let J=$.COMMENT(/;;/,/$/),Q=["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"],X={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},G={className:"variable",begin:/\$[\w_]+/},H={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/},K={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:Q},contains:[J,Z,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},G,H,X,$.QUOTE_STRING_MODE,K,Y,z]}}function _j($){let Z=$.regex,J=Z.concat(/[\p{L}_]/u,Z.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),Q=/[\p{L}0-9._:-]+/u,X={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},G={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},H=$.inherit(G,{begin:/\(/,end:/\)/}),z=$.inherit($.APOS_STRING_MODE,{className:"string"}),K=$.inherit($.QUOTE_STRING_MODE,{className:"string"}),Y={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:Q,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[X]},{begin:/'/,end:/'/,contains:[X]},{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:[G,K,z,H,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[G,H,K,z]}]}]},$.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},X,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[K]},{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:Z.concat(/</,Z.lookahead(Z.concat(J,Z.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:J,relevance:0,starts:Y}]},{className:"tag",begin:Z.concat(/<\//,Z.lookahead(Z.concat(J,/>/))),contains:[{className:"name",begin:J,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Mj($){let Q={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},X={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},G={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},H={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[$.BACKSLASH_ESCAPE,X]},z=$.inherit(H,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),K="[0-9]{4}(-[0-9][0-9]){0,2}",Y="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",W="(\\.[0-9]*)?",q="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",B={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"},U={end:",",endsWithParent:!0,excludeEnd:!0,keywords:"true false yes no null",relevance:0},F={begin:/\{/,end:/\}/,contains:[U],illegal:"\\n",relevance:0},V={begin:"\\[",end:"\\]",contains:[U],illegal:"\\n",relevance:0},N=[Q,{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"}},B,{className:"number",begin:$.C_NUMBER_RE+"\\b",relevance:0},F,V,G,H],L=[...N];return L.pop(),L.push(z),U.contains=L,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:N}}var qW={arduino:LP,bash:NP,c:_P,cpp:MP,csharp:AP,css:DP,diff:wP,go:OP,graphql:PP,ini:jP,java:TP,javascript:RP,json:bP,kotlin:yP,less:vP,lua:gP,makefile:fP,markdown:mP,objectivec:uP,perl:pP,php:cP,"php-template":dP,plaintext:lP,python:iP,"python-repl":rP,r:aP,ruby:sP,rust:nP,scss:oP,shell:tP,sql:eP,swift:zj,typescript:Vj,vbnet:Lj,wasm:Nj,xml:_j,yaml:Mj};var cj=O(pj(),1);var dj=cj.default;var lj={},ud="hljs-";function _W($){let Z=dj.newInstance();if($)G($);return{highlight:J,highlightAuto:Q,listLanguages:X,register:G,registerAlias:H,registered:z};function J(K,Y,W){U1(typeof K==="string","expected `string` as `name`"),U1(typeof Y==="string","expected `string` as `value`");let q=W||lj,B=typeof q.prefix==="string"?q.prefix:ud;if(!Z.getLanguage(K))throw Error("Unknown language: `"+K+"` is not registered");Z.configure({__emitter:ij,classPrefix:B});let U=Z.highlight(Y,{ignoreIllegals:!0,language:K});if(U.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:U.errorRaised});let F=U._emitter.root,V=F.data;return V.language=U.language,V.relevance=U.relevance,F}function Q(K,Y){U1(typeof K==="string","expected `string` as `value`");let q=(Y||lj).subset||X(),B=-1,U=0,F;while(++B<q.length){let V=q[B];if(!Z.getLanguage(V))continue;let N=J(V,K,Y);if(N.data&&N.data.relevance!==void 0&&N.data.relevance>U)U=N.data.relevance,F=N}return F||{type:"root",children:[],data:{language:void 0,relevance:U}}}function X(){return Z.listLanguages()}function G(K,Y){if(typeof K==="string")U1(Y!==void 0,"expected `grammar`"),Z.registerLanguage(K,Y);else{let W;for(W in K)if(Object.hasOwn(K,W))Z.registerLanguage(W,K[W])}}function H(K,Y){if(typeof K==="string")U1(Y!==void 0),Z.registerAliases(typeof Y==="string"?Y:[...Y],{languageName:K});else{let W;for(W in K)if(Object.hasOwn(K,W)){let q=K[W];Z.registerAliases(typeof q==="string"?q:[...q],{languageName:W})}}}function z(K){return Boolean(Z.getLanguage(K))}}class ij{constructor($){this.options=$,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText($){if($==="")return;let Z=this.stack[this.stack.length-1],J=Z.children[Z.children.length-1];if(J&&J.type==="text")J.value+=$;else Z.children.push({type:"text",value:$})}startScope($){this.openNode(String($))}endScope(){this.closeNode()}__addSublanguage($,Z){let J=this.stack[this.stack.length-1],Q=$.root.children;if(Z)J.children.push({type:"element",tagName:"span",properties:{className:[Z]},children:Q});else J.children.push(...Q)}openNode($){let Z=this,J=$.split(".").map(function(G,H){return H?G+"_".repeat(H):Z.options.classPrefix+G}),Q=this.stack[this.stack.length-1],X={type:"element",tagName:"span",properties:{className:J},children:[]};Q.children.push(X),this.stack.push(X)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var pd={};function DG($){let Z=$||pd,J=Z.aliases,Q=Z.detect||!1,X=Z.languages||qW,G=Z.plainText,H=Z.prefix,z=Z.subset,K="hljs",Y=_W(X);if(J)Y.registerAlias(J);if(H){let W=H.indexOf("-");K=W===-1?H:H.slice(0,W)}return function(W,q){V7(W,"element",function(B,U,F){if(B.tagName!=="code"||!F||F.type!=="element"||F.tagName!=="pre")return;let V=cd(B);if(V===!1||!V&&!Q||V&&G&&G.includes(V))return;if(!Array.isArray(B.properties.className))B.properties.className=[];if(!B.properties.className.includes(K))B.properties.className.unshift(K);let N=zW(B,{whitespace:"pre"}),L;try{L=V?Y.highlight(V,N,{prefix:H}):Y.highlightAuto(N,{prefix:H,subset:z})}catch(_){let w=_;if(V&&/Unknown language/.test(w.message)){q.message("Cannot highlight as `"+V+"`, it’s not registered",{ancestors:[F,B],cause:w,place:B.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw w}if(!V&&L.data&&L.data.language)B.properties.className.push("language-"+L.data.language);if(L.children.length>0)B.children=L.children})}}function cd($){let Z=$.properties.className,J=-1;if(!Array.isArray(Z))return;let Q;while(++J<Z.length){let X=String(Z[J]);if(X==="no-highlight"||X==="nohighlight")return!1;if(!Q&&X.slice(0,5)==="lang-")Q=X.slice(5);if(!Q&&X.slice(0,9)==="language-")Q=X.slice(9)}return Q}function MW($,Z){let J=String($);if(typeof Z!=="string")throw TypeError("Expected character");let Q=0,X=J.indexOf(Z);while(X!==-1)Q++,X=J.indexOf(Z,X+Z.length);return Q}function AW($){if(typeof $!=="string")throw TypeError("Expected a string");return $.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function DW($,Z,J){let X=e4((J||{}).ignore||[]),G=dd(Z),H=-1;while(++H<G.length)l$($,"text",z);function z(Y,W){let q=-1,B;while(++q<W.length){let U=W[q],F=B?B.children:void 0;if(X(U,F?F.indexOf(U):void 0,B))return;B=U}if(B)return K(Y,W)}function K(Y,W){let q=W[W.length-1],B=G[H][0],U=G[H][1],F=0,N=q.children.indexOf(Y),L=!1,_=[];B.lastIndex=0;let w=B.exec(Y.value);while(w){let A=w.index,D={index:w.index,input:w.input,stack:[...W,Y]},M=U(...w,D);if(typeof M==="string")M=M.length>0?{type:"text",value:M}:void 0;if(M===!1)B.lastIndex=A+1;else{if(F!==A)_.push({type:"text",value:Y.value.slice(F,A)});if(Array.isArray(M))_.push(...M);else if(M)_.push(M);F=A+w[0].length,L=!0}if(!B.global)break;w=B.exec(Y.value)}if(L){if(F<Y.value.length)_.push({type:"text",value:Y.value.slice(F)});q.children.splice(N,1,..._)}else _=[Y];return N+_.length}}function dd($){let Z=[];if(!Array.isArray($))throw TypeError("Expected find and replace tuple or list of tuples");let J=!$[0]||Array.isArray($[0])?$:[$],Q=-1;while(++Q<J.length){let X=J[Q];Z.push([ld(X[0]),id(X[1])])}return Z}function ld($){return typeof $==="string"?new RegExp(AW($),"g"):$}function id($){return typeof $==="function"?$:function(){return $}}var wW="phrasing",OW=["autolink","link","image","label"];function jW(){return{transforms:[td],enter:{literalAutolink:rd,literalAutolinkEmail:PW,literalAutolinkHttp:PW,literalAutolinkWww:PW},exit:{literalAutolink:od,literalAutolinkEmail:nd,literalAutolinkHttp:ad,literalAutolinkWww:sd}}}function CW(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:wW,notInConstruct:OW},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:wW,notInConstruct:OW},{character:":",before:"[ps]",after:"\\/",inConstruct:wW,notInConstruct:OW}]}}function rd($){this.enter({type:"link",title:null,url:"",children:[]},$)}function PW($){this.config.enter.autolinkProtocol.call(this,$)}function ad($){this.config.exit.autolinkProtocol.call(this,$)}function sd($){this.config.exit.data.call(this,$);let Z=this.stack[this.stack.length-1];U1(Z.type==="link"),Z.url="http://"+this.sliceSerialize($)}function nd($){this.config.exit.autolinkEmail.call(this,$)}function od($){this.exit($)}function td($){DW($,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ed],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,$l]],{ignore:["link","linkReference"]})}function ed($,Z,J,Q,X){let G="";if(!rj(X))return!1;if(/^w/i.test(Z))J=Z+J,Z="",G="http://";if(!Zl(J))return!1;let H=Jl(J+Q);if(!H[0])return!1;let z={type:"link",title:null,url:G+Z+H[0],children:[{type:"text",value:Z+H[0]}]};if(H[1])return[z,{type:"text",value:H[1]}];return z}function $l($,Z,J,Q){if(!rj(Q,!0)||/[-\d_]$/.test(J))return!1;return{type:"link",title:null,url:"mailto:"+Z+"@"+J,children:[{type:"text",value:Z+"@"+J}]}}function Zl($){let Z=$.split(".");if(Z.length<2||Z[Z.length-1]&&(/_/.test(Z[Z.length-1])||!/[a-zA-Z\d]/.test(Z[Z.length-1]))||Z[Z.length-2]&&(/_/.test(Z[Z.length-2])||!/[a-zA-Z\d]/.test(Z[Z.length-2])))return!1;return!0}function Jl($){let Z=/[!"&'),.:;<>?\]}]+$/.exec($);if(!Z)return[$,void 0];$=$.slice(0,Z.index);let J=Z[0],Q=J.indexOf(")"),X=MW($,"("),G=MW($,")");while(Q!==-1&&X>G)$+=J.slice(0,Q+1),J=J.slice(Q+1),Q=J.indexOf(")"),G++;return[$,J]}function rj($,Z){let J=$.input.charCodeAt($.index-1);return($.index===0||o4(J)||z6(J))&&(!Z||J!==47)}aj.peek=ql;function Ql(){this.buffer()}function Xl($){this.enter({type:"footnoteReference",identifier:"",label:""},$)}function Gl(){this.buffer()}function Hl($){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},$)}function zl($){let Z=this.resume(),J=this.stack[this.stack.length-1];U1(J.type==="footnoteReference"),J.identifier=$8(this.sliceSerialize($)).toLowerCase(),J.label=Z}function Kl($){this.exit($)}function Yl($){let Z=this.resume(),J=this.stack[this.stack.length-1];U1(J.type==="footnoteDefinition"),J.identifier=$8(this.sliceSerialize($)).toLowerCase(),J.label=Z}function Wl($){this.exit($)}function ql(){return"["}function aj($,Z,J,Q){let X=J.createTracker(Q),G=X.move("[^"),H=J.enter("footnoteReference"),z=J.enter("reference");return G+=X.move(J.safe(J.associationId($),{after:"]",before:G})),z(),H(),G+=X.move("]"),G}function IW(){return{enter:{gfmFootnoteCallString:Ql,gfmFootnoteCall:Xl,gfmFootnoteDefinitionLabelString:Gl,gfmFootnoteDefinition:Hl},exit:{gfmFootnoteCallString:zl,gfmFootnoteCall:Kl,gfmFootnoteDefinitionLabelString:Yl,gfmFootnoteDefinition:Wl}}}function TW($){let Z=!1;if($&&$.firstLineBlank)Z=!0;return{handlers:{footnoteDefinition:J,footnoteReference:aj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function J(Q,X,G,H){let z=G.createTracker(H),K=z.move("[^"),Y=G.enter("footnoteDefinition"),W=G.enter("label");if(K+=z.move(G.safe(G.associationId(Q),{before:K,after:"]"})),W(),K+=z.move("]:"),Q.children&&Q.children.length>0)z.shift(4),K+=z.move((Z?`
103
- `:" ")+G.indentLines(G.containerFlow(Q,z.current()),Z?sj:Bl));return Y(),K}}function Bl($,Z,J){return Z===0?$:sj($,Z,J)}function sj($,Z,J){return(J?"":" ")+$}var Ul=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];nj.peek=Ll;function kW(){return{canContainEols:["delete"],enter:{strikethrough:Fl},exit:{strikethrough:Vl}}}function EW(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ul}],handlers:{delete:nj}}}function Fl($){this.enter({type:"delete",children:[]},$)}function Vl($){this.exit($)}function nj($,Z,J,Q){let X=J.createTracker(Q),G=J.enter("strikethrough"),H=X.move("~~");return H+=J.containerPhrasing($,{...X.current(),before:H,after:"~"}),H+=X.move("~~"),G(),H}function Ll(){return"~"}function Nl($){return $.length}function tj($,Z){let J=Z||{},Q=(J.align||[]).concat(),X=J.stringLength||Nl,G=[],H=[],z=[],K=[],Y=0,W=-1;while(++W<$.length){let V=[],N=[],L=-1;if($[W].length>Y)Y=$[W].length;while(++L<$[W].length){let _=_l($[W][L]);if(J.alignDelimiters!==!1){let w=X(_);if(N[L]=w,K[L]===void 0||w>K[L])K[L]=w}V.push(_)}H[W]=V,z[W]=N}let q=-1;if(typeof Q==="object"&&"length"in Q)while(++q<Y)G[q]=oj(Q[q]);else{let V=oj(Q);while(++q<Y)G[q]=V}q=-1;let B=[],U=[];while(++q<Y){let V=G[q],N="",L="";if(V===99)N=":",L=":";else if(V===108)N=":";else if(V===114)L=":";let _=J.alignDelimiters===!1?1:Math.max(1,K[q]-N.length-L.length),w=N+"-".repeat(_)+L;if(J.alignDelimiters!==!1){if(_=N.length+_+L.length,_>K[q])K[q]=_;U[q]=_}B[q]=w}H.splice(1,0,B),z.splice(1,0,U),W=-1;let F=[];while(++W<H.length){let V=H[W],N=z[W];q=-1;let L=[];while(++q<Y){let _=V[q]||"",w="",A="";if(J.alignDelimiters!==!1){let D=K[q]-(N[q]||0),M=G[q];if(M===114)w=" ".repeat(D);else if(M===99)if(D%2)w=" ".repeat(D/2+0.5),A=" ".repeat(D/2-0.5);else w=" ".repeat(D/2),A=w;else A=" ".repeat(D)}if(J.delimiterStart!==!1&&!q)L.push("|");if(J.padding!==!1&&!(J.alignDelimiters===!1&&_==="")&&(J.delimiterStart!==!1||q))L.push(" ");if(J.alignDelimiters!==!1)L.push(w);if(L.push(_),J.alignDelimiters!==!1)L.push(A);if(J.padding!==!1)L.push(" ");if(J.delimiterEnd!==!1||q!==Y-1)L.push("|")}F.push(J.delimiterEnd===!1?L.join("").replace(/ +$/,""):L.join(""))}return F.join(`
104
- `)}function _l($){return $===null||$===void 0?"":String($)}function oj($){let Z=typeof $==="string"?$.codePointAt(0):0;return Z===67||Z===99?99:Z===76||Z===108?108:Z===82||Z===114?114:0}function ej($,Z,J,Q){let X=J.enter("blockquote"),G=J.createTracker(Q);G.move("> "),G.shift(2);let H=J.indentLines(J.containerFlow($,G.current()),Ml);return X(),H}function Ml($,Z,J){return">"+(J?"":" ")+$}function ZC($,Z){return $C($,Z.inConstruct,!0)&&!$C($,Z.notInConstruct,!1)}function $C($,Z,J){if(typeof Z==="string")Z=[Z];if(!Z||Z.length===0)return J;let Q=-1;while(++Q<Z.length)if($.includes(Z[Q]))return!0;return!1}function SW($,Z,J,Q){let X=-1;while(++X<J.unsafe.length)if(J.unsafe[X].character===`
105
- `&&ZC(J.stack,J.unsafe[X]))return/[ \t]/.test(Q.before)?"":" ";return"\\\n"}function JC($,Z){let J=String($),Q=J.indexOf(Z),X=Q,G=0,H=0;if(typeof Z!=="string")throw TypeError("Expected substring");while(Q!==-1){if(Q===X){if(++G>H)H=G}else G=1;X=Q+Z.length,Q=J.indexOf(Z,X)}return H}function QC($,Z){return Boolean(Z.options.fences===!1&&$.value&&!$.lang&&/[^ \r\n]/.test($.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test($.value))}function XC($){let Z=$.options.fence||"`";if(Z!=="`"&&Z!=="~")throw Error("Cannot serialize code with `"+Z+"` for `options.fence`, expected `` ` `` or `~`");return Z}function GC($,Z,J,Q){let X=XC(J),G=$.value||"",H=X==="`"?"GraveAccent":"Tilde";if(QC($,J)){let q=J.enter("codeIndented"),B=J.indentLines(G,Al);return q(),B}let z=J.createTracker(Q),K=X.repeat(Math.max(JC(G,X)+1,3)),Y=J.enter("codeFenced"),W=z.move(K);if($.lang){let q=J.enter(`codeFencedLang${H}`);W+=z.move(J.safe($.lang,{before:W,after:" ",encode:["`"],...z.current()})),q()}if($.lang&&$.meta){let q=J.enter(`codeFencedMeta${H}`);W+=z.move(" "),W+=z.move(J.safe($.meta,{before:W,after:`
106
- `,encode:["`"],...z.current()})),q()}if(W+=z.move(`
107
- `),G)W+=z.move(G+`
108
- `);return W+=z.move(K),Y(),W}function Al($,Z,J){return(J?"":" ")+$}function s2($){let Z=$.options.quote||'"';if(Z!=='"'&&Z!=="'")throw Error("Cannot serialize title with `"+Z+"` for `options.quote`, expected `\"`, or `'`");return Z}function HC($,Z,J,Q){let X=s2(J),G=X==='"'?"Quote":"Apostrophe",H=J.enter("definition"),z=J.enter("label"),K=J.createTracker(Q),Y=K.move("[");if(Y+=K.move(J.safe(J.associationId($),{before:Y,after:"]",...K.current()})),Y+=K.move("]: "),z(),!$.url||/[\0- \u007F]/.test($.url))z=J.enter("destinationLiteral"),Y+=K.move("<"),Y+=K.move(J.safe($.url,{before:Y,after:">",...K.current()})),Y+=K.move(">");else z=J.enter("destinationRaw"),Y+=K.move(J.safe($.url,{before:Y,after:$.title?" ":`
109
- `,...K.current()}));if(z(),$.title)z=J.enter(`title${G}`),Y+=K.move(" "+X),Y+=K.move(J.safe($.title,{before:Y,after:X,...K.current()})),Y+=K.move(X),z();return H(),Y}function zC($){let Z=$.options.emphasis||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize emphasis with `"+Z+"` for `options.emphasis`, expected `*`, or `_`");return Z}function X9($){return"&#x"+$.toString(16).toUpperCase()+";"}function n2($,Z,J){let Q=F7($),X=F7(Z);if(Q===void 0)return X===void 0?J==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:X===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(Q===1)return X===void 0?{inside:!1,outside:!1}:X===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return X===void 0?{inside:!1,outside:!1}:X===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}RW.peek=Dl;function RW($,Z,J,Q){let X=zC(J),G=J.enter("emphasis"),H=J.createTracker(Q),z=H.move(X),K=H.move(J.containerPhrasing($,{after:X,before:z,...H.current()})),Y=K.charCodeAt(0),W=n2(Q.before.charCodeAt(Q.before.length-1),Y,X);if(W.inside)K=X9(Y)+K.slice(1);let q=K.charCodeAt(K.length-1),B=n2(Q.after.charCodeAt(0),q,X);if(B.inside)K=K.slice(0,-1)+X9(q);let U=H.move(X);return G(),J.attentionEncodeSurroundingInfo={after:B.outside,before:W.outside},z+K+U}function Dl($,Z,J){return J.options.emphasis||"*"}function KC($,Z){let J=!1;return V7($,function(Q){if("value"in Q&&/\r?\n|\r/.test(Q.value)||Q.type==="break")return J=!0,B6}),Boolean((!$.depth||$.depth<3)&&G6($)&&(Z.options.setext||J))}function YC($,Z,J,Q){let X=Math.max(Math.min(6,$.depth||1),1),G=J.createTracker(Q);if(KC($,J)){let W=J.enter("headingSetext"),q=J.enter("phrasing"),B=J.containerPhrasing($,{...G.current(),before:`
110
- `,after:`
111
- `});return q(),W(),B+`
112
- `+(X===1?"=":"-").repeat(B.length-(Math.max(B.lastIndexOf("\r"),B.lastIndexOf(`
113
- `))+1))}let H="#".repeat(X),z=J.enter("headingAtx"),K=J.enter("phrasing");G.move(H+" ");let Y=J.containerPhrasing($,{before:"# ",after:`
114
- `,...G.current()});if(/^[\t ]/.test(Y))Y=X9(Y.charCodeAt(0))+Y.slice(1);if(Y=Y?H+" "+Y:H,J.options.closeAtx)Y+=" "+H;return K(),z(),Y}bW.peek=wl;function bW($){return $.value||""}function wl(){return"<"}yW.peek=Ol;function yW($,Z,J,Q){let X=s2(J),G=X==='"'?"Quote":"Apostrophe",H=J.enter("image"),z=J.enter("label"),K=J.createTracker(Q),Y=K.move("![");if(Y+=K.move(J.safe($.alt,{before:Y,after:"]",...K.current()})),Y+=K.move("]("),z(),!$.url&&$.title||/[\0- \u007F]/.test($.url))z=J.enter("destinationLiteral"),Y+=K.move("<"),Y+=K.move(J.safe($.url,{before:Y,after:">",...K.current()})),Y+=K.move(">");else z=J.enter("destinationRaw"),Y+=K.move(J.safe($.url,{before:Y,after:$.title?" ":")",...K.current()}));if(z(),$.title)z=J.enter(`title${G}`),Y+=K.move(" "+X),Y+=K.move(J.safe($.title,{before:Y,after:X,...K.current()})),Y+=K.move(X),z();return Y+=K.move(")"),H(),Y}function Ol(){return"!"}xW.peek=Pl;function xW($,Z,J,Q){let X=$.referenceType,G=J.enter("imageReference"),H=J.enter("label"),z=J.createTracker(Q),K=z.move("!["),Y=J.safe($.alt,{before:K,after:"]",...z.current()});K+=z.move(Y+"]["),H();let W=J.stack;J.stack=[],H=J.enter("reference");let q=J.safe(J.associationId($),{before:K,after:"]",...z.current()});if(H(),J.stack=W,G(),X==="full"||!Y||Y!==q)K+=z.move(q+"]");else if(X==="shortcut")K=K.slice(0,-1);else K+=z.move("]");return K}function Pl(){return"!"}hW.peek=jl;function hW($,Z,J){let Q=$.value||"",X="`",G=-1;while(new RegExp("(^|[^`])"+X+"([^`]|$)").test(Q))X+="`";if(/[^ \r\n]/.test(Q)&&(/^[ \r\n]/.test(Q)&&/[ \r\n]$/.test(Q)||/^`|`$/.test(Q)))Q=" "+Q+" ";while(++G<J.unsafe.length){let H=J.unsafe[G],z=J.compilePattern(H),K;if(!H.atBreak)continue;while(K=z.exec(Q)){let Y=K.index;if(Q.charCodeAt(Y)===10&&Q.charCodeAt(Y-1)===13)Y--;Q=Q.slice(0,Y)+" "+Q.slice(K.index+1)}}return X+Q+X}function jl(){return"`"}function vW($,Z){let J=G6($);return Boolean(!Z.options.resourceLink&&$.url&&!$.title&&$.children&&$.children.length===1&&$.children[0].type==="text"&&(J===$.url||"mailto:"+J===$.url)&&/^[a-z][a-z+.-]+:/i.test($.url)&&!/[\0- <>\u007F]/.test($.url))}gW.peek=Cl;function gW($,Z,J,Q){let X=s2(J),G=X==='"'?"Quote":"Apostrophe",H=J.createTracker(Q),z,K;if(vW($,J)){let W=J.stack;J.stack=[],z=J.enter("autolink");let q=H.move("<");return q+=H.move(J.containerPhrasing($,{before:q,after:">",...H.current()})),q+=H.move(">"),z(),J.stack=W,q}z=J.enter("link"),K=J.enter("label");let Y=H.move("[");if(Y+=H.move(J.containerPhrasing($,{before:Y,after:"](",...H.current()})),Y+=H.move("]("),K(),!$.url&&$.title||/[\0- \u007F]/.test($.url))K=J.enter("destinationLiteral"),Y+=H.move("<"),Y+=H.move(J.safe($.url,{before:Y,after:">",...H.current()})),Y+=H.move(">");else K=J.enter("destinationRaw"),Y+=H.move(J.safe($.url,{before:Y,after:$.title?" ":")",...H.current()}));if(K(),$.title)K=J.enter(`title${G}`),Y+=H.move(" "+X),Y+=H.move(J.safe($.title,{before:Y,after:X,...H.current()})),Y+=H.move(X),K();return Y+=H.move(")"),z(),Y}function Cl($,Z,J){return vW($,J)?"<":"["}fW.peek=Il;function fW($,Z,J,Q){let X=$.referenceType,G=J.enter("linkReference"),H=J.enter("label"),z=J.createTracker(Q),K=z.move("["),Y=J.containerPhrasing($,{before:K,after:"]",...z.current()});K+=z.move(Y+"]["),H();let W=J.stack;J.stack=[],H=J.enter("reference");let q=J.safe(J.associationId($),{before:K,after:"]",...z.current()});if(H(),J.stack=W,G(),X==="full"||!Y||Y!==q)K+=z.move(q+"]");else if(X==="shortcut")K=K.slice(0,-1);else K+=z.move("]");return K}function Il(){return"["}function o2($){let Z=$.options.bullet||"*";if(Z!=="*"&&Z!=="+"&&Z!=="-")throw Error("Cannot serialize items with `"+Z+"` for `options.bullet`, expected `*`, `+`, or `-`");return Z}function WC($){let Z=o2($),J=$.options.bulletOther;if(!J)return Z==="*"?"-":"*";if(J!=="*"&&J!=="+"&&J!=="-")throw Error("Cannot serialize items with `"+J+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(J===Z)throw Error("Expected `bullet` (`"+Z+"`) and `bulletOther` (`"+J+"`) to be different");return J}function qC($){let Z=$.options.bulletOrdered||".";if(Z!=="."&&Z!==")")throw Error("Cannot serialize items with `"+Z+"` for `options.bulletOrdered`, expected `.` or `)`");return Z}function wG($){let Z=$.options.rule||"*";if(Z!=="*"&&Z!=="-"&&Z!=="_")throw Error("Cannot serialize rules with `"+Z+"` for `options.rule`, expected `*`, `-`, or `_`");return Z}function BC($,Z,J,Q){let X=J.enter("list"),G=J.bulletCurrent,H=$.ordered?qC(J):o2(J),z=$.ordered?H==="."?")":".":WC(J),K=Z&&J.bulletLastUsed?H===J.bulletLastUsed:!1;if(!$.ordered){let W=$.children?$.children[0]:void 0;if((H==="*"||H==="-")&&W&&(!W.children||!W.children[0])&&J.stack[J.stack.length-1]==="list"&&J.stack[J.stack.length-2]==="listItem"&&J.stack[J.stack.length-3]==="list"&&J.stack[J.stack.length-4]==="listItem"&&J.indexStack[J.indexStack.length-1]===0&&J.indexStack[J.indexStack.length-2]===0&&J.indexStack[J.indexStack.length-3]===0)K=!0;if(wG(J)===H&&W){let q=-1;while(++q<$.children.length){let B=$.children[q];if(B&&B.type==="listItem"&&B.children&&B.children[0]&&B.children[0].type==="thematicBreak"){K=!0;break}}}}if(K)H=z;J.bulletCurrent=H;let Y=J.containerFlow($,Q);return J.bulletLastUsed=H,J.bulletCurrent=G,X(),Y}function UC($){let Z=$.options.listItemIndent||"one";if(Z!=="tab"&&Z!=="one"&&Z!=="mixed")throw Error("Cannot serialize items with `"+Z+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return Z}function FC($,Z,J,Q){let X=UC(J),G=J.bulletCurrent||o2(J);if(Z&&Z.type==="list"&&Z.ordered)G=(typeof Z.start==="number"&&Z.start>-1?Z.start:1)+(J.options.incrementListMarker===!1?0:Z.children.indexOf($))+G;let H=G.length+1;if(X==="tab"||X==="mixed"&&(Z&&Z.type==="list"&&Z.spread||$.spread))H=Math.ceil(H/4)*4;let z=J.createTracker(Q);z.move(G+" ".repeat(H-G.length)),z.shift(H);let K=J.enter("listItem"),Y=J.indentLines(J.containerFlow($,z.current()),W);return K(),Y;function W(q,B,U){if(B)return(U?"":" ".repeat(H))+q;return(U?G:G+" ".repeat(H-G.length))+q}}function VC($,Z,J,Q){let X=J.enter("paragraph"),G=J.enter("phrasing"),H=J.containerPhrasing($,Q);return G(),X(),H}var mW=e4(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function LC($,Z,J,Q){return($.children.some(function(H){return mW(H)})?J.containerPhrasing:J.containerFlow).call(J,$,Q)}function NC($){let Z=$.options.strong||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize strong with `"+Z+"` for `options.strong`, expected `*`, or `_`");return Z}uW.peek=Tl;function uW($,Z,J,Q){let X=NC(J),G=J.enter("strong"),H=J.createTracker(Q),z=H.move(X+X),K=H.move(J.containerPhrasing($,{after:X,before:z,...H.current()})),Y=K.charCodeAt(0),W=n2(Q.before.charCodeAt(Q.before.length-1),Y,X);if(W.inside)K=X9(Y)+K.slice(1);let q=K.charCodeAt(K.length-1),B=n2(Q.after.charCodeAt(0),q,X);if(B.inside)K=K.slice(0,-1)+X9(q);let U=H.move(X+X);return G(),J.attentionEncodeSurroundingInfo={after:B.outside,before:W.outside},z+K+U}function Tl($,Z,J){return J.options.strong||"*"}function _C($,Z,J,Q){return J.safe($.value,Q)}function MC($){let Z=$.options.ruleRepetition||3;if(Z<3)throw Error("Cannot serialize rules with repetition `"+Z+"` for `options.ruleRepetition`, expected `3` or more");return Z}function AC($,Z,J){let Q=(wG(J)+(J.options.ruleSpaces?" ":"")).repeat(MC(J));return J.options.ruleSpaces?Q.slice(0,-1):Q}var o$={blockquote:ej,break:SW,code:GC,definition:HC,emphasis:RW,hardBreak:SW,heading:YC,html:bW,image:yW,imageReference:xW,inlineCode:hW,link:gW,linkReference:fW,list:BC,listItem:FC,paragraph:VC,root:LC,strong:uW,text:_C,thematicBreak:AC};function cW(){return{enter:{table:kl,tableData:DC,tableHeader:DC,tableRow:Sl},exit:{codeText:Rl,table:El,tableData:pW,tableHeader:pW,tableRow:pW}}}function kl($){let Z=$._align;U1(Z,"expected `_align` on table"),this.enter({type:"table",align:Z.map(function(J){return J==="none"?null:J}),children:[]},$),this.data.inTable=!0}function El($){this.exit($),this.data.inTable=void 0}function Sl($){this.enter({type:"tableRow",children:[]},$)}function pW($){this.exit($)}function DC($){this.enter({type:"tableCell",children:[]},$)}function Rl($){let Z=this.resume();if(this.data.inTable)Z=Z.replace(/\\([\\|])/g,bl);let J=this.stack[this.stack.length-1];U1(J.type==="inlineCode"),J.value=Z,this.exit($)}function bl($,Z){return Z==="|"?Z:$}function dW($){let Z=$||{},J=Z.tableCellPadding,Q=Z.tablePipeAlign,X=Z.stringLength,G=J?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
115
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:B,table:H,tableCell:K,tableRow:z}};function H(U,F,V,N){return Y(W(U,V,N),U.align)}function z(U,F,V,N){let L=q(U,V,N),_=Y([L]);return _.slice(0,_.indexOf(`
116
- `))}function K(U,F,V,N){let L=V.enter("tableCell"),_=V.enter("phrasing"),w=V.containerPhrasing(U,{...N,before:G,after:G});return _(),L(),w}function Y(U,F){return tj(U,{align:F,alignDelimiters:Q,padding:J,stringLength:X})}function W(U,F,V){let N=U.children,L=-1,_=[],w=F.enter("table");while(++L<N.length)_[L]=q(N[L],F,V);return w(),_}function q(U,F,V){let N=U.children,L=-1,_=[],w=F.enter("tableRow");while(++L<N.length)_[L]=K(N[L],U,F,V);return w(),_}function B(U,F,V){let N=o$.inlineCode(U,F,V);if(V.stack.includes("tableCell"))N=N.replace(/\|/g,"\\$&");return N}}function lW(){return{exit:{taskListCheckValueChecked:wC,taskListCheckValueUnchecked:wC,paragraph:yl}}}function iW(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:xl}}}function wC($){let Z=this.stack[this.stack.length-2];U1(Z.type==="listItem"),Z.checked=$.type==="taskListCheckValueChecked"}function yl($){let Z=this.stack[this.stack.length-2];if(Z&&Z.type==="listItem"&&typeof Z.checked==="boolean"){let J=this.stack[this.stack.length-1];U1(J.type==="paragraph");let Q=J.children[0];if(Q&&Q.type==="text"){let X=Z.children,G=-1,H;while(++G<X.length){let z=X[G];if(z.type==="paragraph"){H=z;break}}if(H===J){if(Q.value=Q.value.slice(1),Q.value.length===0)J.children.shift();else if(J.position&&Q.position&&typeof Q.position.start.offset==="number")Q.position.start.column++,Q.position.start.offset++,J.position.start=Object.assign({},Q.position.start)}}}this.exit($)}function xl($,Z,J,Q){let X=$.children[0],G=typeof $.checked==="boolean"&&X&&X.type==="paragraph",H="["+($.checked?"x":" ")+"] ",z=J.createTracker(Q);if(G)z.move(H);let K=o$.listItem($,Z,J,{...Q,...z.current()});if(G)K=K.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,Y);return K;function Y(W){return W+H}}function rW(){return[jW(),IW(),kW(),cW(),lW()]}function aW($){return{extensions:[CW(),TW($),EW(),dW($),iW()]}}var hl={tokenize:ul,partial:!0},OC={tokenize:pl,partial:!0},PC={tokenize:cl,partial:!0},jC={tokenize:dl,partial:!0},vl={tokenize:ll,partial:!0},CC={name:"wwwAutolink",tokenize:fl,previous:TC},IC={name:"protocolAutolink",tokenize:ml,previous:kC},N7={name:"emailAutolink",tokenize:gl,previous:EC},Z7={};function nW(){return{text:Z7}}var V6=48;while(V6<123)if(Z7[V6]=N7,V6++,V6===58)V6=65;else if(V6===91)V6=97;Z7[43]=N7;Z7[45]=N7;Z7[46]=N7;Z7[95]=N7;Z7[72]=[N7,IC];Z7[104]=[N7,IC];Z7[87]=[N7,CC];Z7[119]=[N7,CC];function gl($,Z,J){let Q=this,X,G;return H;function H(q){if(!sW(q)||!EC.call(Q,Q.previous)||oW(Q.events))return J(q);return $.enter("literalAutolink"),$.enter("literalAutolinkEmail"),z(q)}function z(q){if(sW(q))return $.consume(q),z;if(q===64)return $.consume(q),K;return J(q)}function K(q){if(q===46)return $.check(vl,W,Y)(q);if(q===45||q===95||G5(q))return G=!0,$.consume(q),K;return W(q)}function Y(q){return $.consume(q),X=!0,K}function W(q){if(G&&X&&I5(Q.previous))return $.exit("literalAutolinkEmail"),$.exit("literalAutolink"),Z(q);return J(q)}}function fl($,Z,J){let Q=this;return X;function X(H){if(H!==87&&H!==119||!TC.call(Q,Q.previous)||oW(Q.events))return J(H);return $.enter("literalAutolink"),$.enter("literalAutolinkWww"),$.check(hl,$.attempt(OC,$.attempt(PC,G),J),J)(H)}function G(H){return $.exit("literalAutolinkWww"),$.exit("literalAutolink"),Z(H)}}function ml($,Z,J){let Q=this,X="",G=!1;return H;function H(q){if((q===72||q===104)&&kC.call(Q,Q.previous)&&!oW(Q.events))return $.enter("literalAutolink"),$.enter("literalAutolinkHttp"),X+=String.fromCodePoint(q),$.consume(q),z;return J(q)}function z(q){if(I5(q)&&X.length<5)return X+=String.fromCodePoint(q),$.consume(q),z;if(q===58){let B=X.toLowerCase();if(B==="http"||B==="https")return $.consume(q),K}return J(q)}function K(q){if(q===47){if($.consume(q),G)return Y;return G=!0,K}return J(q)}function Y(q){return q===null||H6(q)||J1(q)||o4(q)||z6(q)?J(q):$.attempt(OC,$.attempt(PC,W),J)(q)}function W(q){return $.exit("literalAutolinkHttp"),$.exit("literalAutolink"),Z(q)}}function ul($,Z,J){let Q=0;return X;function X(H){if((H===87||H===119)&&Q<3)return Q++,$.consume(H),X;if(H===46&&Q===3)return $.consume(H),G;return J(H)}function G(H){return H===null?J(H):Z(H)}}function pl($,Z,J){let Q,X,G;return H;function H(Y){if(Y===46||Y===95)return $.check(jC,K,z)(Y);if(Y===null||J1(Y)||o4(Y)||Y!==45&&z6(Y))return K(Y);return G=!0,$.consume(Y),H}function z(Y){if(Y===95)Q=!0;else X=Q,Q=void 0;return $.consume(Y),H}function K(Y){if(X||Q||!G)return J(Y);return Z(Y)}}function cl($,Z){let J=0,Q=0;return X;function X(H){if(H===40)return J++,$.consume(H),X;if(H===41&&Q<J)return G(H);if(H===33||H===34||H===38||H===39||H===41||H===42||H===44||H===46||H===58||H===59||H===60||H===63||H===93||H===95||H===126)return $.check(jC,Z,G)(H);if(H===null||J1(H)||o4(H))return Z(H);return $.consume(H),X}function G(H){if(H===41)Q++;return $.consume(H),X}}function dl($,Z,J){return Q;function Q(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),Q;if(z===38)return $.consume(z),G;if(z===93)return $.consume(z),X;if(z===60||z===null||J1(z)||o4(z))return Z(z);return J(z)}function X(z){if(z===null||z===40||z===91||J1(z)||o4(z))return Z(z);return Q(z)}function G(z){return I5(z)?H(z):J(z)}function H(z){if(z===59)return $.consume(z),Q;if(I5(z))return $.consume(z),H;return J(z)}}function ll($,Z,J){return Q;function Q(G){return $.consume(G),X}function X(G){return G5(G)?J(G):Z(G)}}function TC($){return $===null||$===40||$===42||$===95||$===91||$===93||$===126||J1($)}function kC($){return!I5($)}function EC($){return!($===47||sW($))}function sW($){return $===43||$===45||$===46||$===95||G5($)}function oW($){let Z=$.length,J=!1;while(Z--){let Q=$[Z][1];if((Q.type==="labelLink"||Q.type==="labelImage")&&!Q._balanced){J=!0;break}if(Q._gfmAutolinkLiteralWalkedInto){J=!1;break}}if($.length>0&&!J)$[$.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return J}var il={tokenize:el,partial:!0};function tW(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:nl,continuation:{tokenize:ol},exit:tl}},text:{[91]:{name:"gfmFootnoteCall",tokenize:sl},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rl,resolveTo:al}}}}function rl($,Z,J){let Q=this,X=Q.events.length,G=Q.parser.gfmFootnotes||(Q.parser.gfmFootnotes=[]),H;while(X--){let K=Q.events[X][1];if(K.type==="labelImage"){H=K;break}if(K.type==="gfmFootnoteCall"||K.type==="labelLink"||K.type==="label"||K.type==="image"||K.type==="link")break}return z;function z(K){if(!H||!H._balanced)return J(K);let Y=$8(Q.sliceSerialize({start:H.end,end:Q.now()}));if(Y.codePointAt(0)!==94||!G.includes(Y.slice(1)))return J(K);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(K),$.exit("gfmFootnoteCallLabelMarker"),Z(K)}}function al($,Z){let J=$.length,Q;while(J--)if($[J][1].type==="labelImage"&&$[J][0]==="enter"){Q=$[J][1];break}$[J+1][1].type="data",$[J+3][1].type="gfmFootnoteCallLabelMarker";let X={type:"gfmFootnoteCall",start:Object.assign({},$[J+3][1].start),end:Object.assign({},$[$.length-1][1].end)},G={type:"gfmFootnoteCallMarker",start:Object.assign({},$[J+3][1].end),end:Object.assign({},$[J+3][1].end)};G.end.column++,G.end.offset++,G.end._bufferIndex++;let H={type:"gfmFootnoteCallString",start:Object.assign({},G.end),end:Object.assign({},$[$.length-1][1].start)},z={type:"chunkString",contentType:"string",start:Object.assign({},H.start),end:Object.assign({},H.end)},K=[$[J+1],$[J+2],["enter",X,Z],$[J+3],$[J+4],["enter",G,Z],["exit",G,Z],["enter",H,Z],["enter",z,Z],["exit",z,Z],["exit",H,Z],$[$.length-2],$[$.length-1],["exit",X,Z]];return $.splice(J,$.length-J+1,...K),$}function sl($,Z,J){let Q=this,X=Q.parser.gfmFootnotes||(Q.parser.gfmFootnotes=[]),G=0,H;return z;function z(q){return $.enter("gfmFootnoteCall"),$.enter("gfmFootnoteCallLabelMarker"),$.consume(q),$.exit("gfmFootnoteCallLabelMarker"),K}function K(q){if(q!==94)return J(q);return $.enter("gfmFootnoteCallMarker"),$.consume(q),$.exit("gfmFootnoteCallMarker"),$.enter("gfmFootnoteCallString"),$.enter("chunkString").contentType="string",Y}function Y(q){if(G>999||q===93&&!H||q===null||q===91||J1(q))return J(q);if(q===93){$.exit("chunkString");let B=$.exit("gfmFootnoteCallString");if(!X.includes($8(Q.sliceSerialize(B))))return J(q);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(q),$.exit("gfmFootnoteCallLabelMarker"),$.exit("gfmFootnoteCall"),Z}if(!J1(q))H=!0;return G++,$.consume(q),q===92?W:Y}function W(q){if(q===91||q===92||q===93)return $.consume(q),G++,Y;return Y(q)}}function nl($,Z,J){let Q=this,X=Q.parser.gfmFootnotes||(Q.parser.gfmFootnotes=[]),G,H=0,z;return K;function K(F){return $.enter("gfmFootnoteDefinition")._container=!0,$.enter("gfmFootnoteDefinitionLabel"),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(F),$.exit("gfmFootnoteDefinitionLabelMarker"),Y}function Y(F){if(F===94)return $.enter("gfmFootnoteDefinitionMarker"),$.consume(F),$.exit("gfmFootnoteDefinitionMarker"),$.enter("gfmFootnoteDefinitionLabelString"),$.enter("chunkString").contentType="string",W;return J(F)}function W(F){if(H>999||F===93&&!z||F===null||F===91||J1(F))return J(F);if(F===93){$.exit("chunkString");let V=$.exit("gfmFootnoteDefinitionLabelString");return G=$8(Q.sliceSerialize(V)),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(F),$.exit("gfmFootnoteDefinitionLabelMarker"),$.exit("gfmFootnoteDefinitionLabel"),B}if(!J1(F))z=!0;return H++,$.consume(F),F===92?q:W}function q(F){if(F===91||F===92||F===93)return $.consume(F),H++,W;return W(F)}function B(F){if(F===58){if($.enter("definitionMarker"),$.consume(F),$.exit("definitionMarker"),!X.includes(G))X.push(G);return R0($,U,"gfmFootnoteDefinitionWhitespace")}return J(F)}function U(F){return Z(F)}}function ol($,Z,J){return $.check(t4,Z,$.attempt(il,Z,J))}function tl($){$.exit("gfmFootnoteDefinition")}function el($,Z,J){let Q=this;return R0($,X,"gfmFootnoteDefinitionIndent",5);function X(G){let H=Q.events[Q.events.length-1];return H&&H[1].type==="gfmFootnoteDefinitionIndent"&&H[2].sliceSerialize(H[1],!0).length===4?Z(G):J(G)}}function eW($){let J=($||{}).singleTilde,Q={name:"strikethrough",tokenize:G,resolveAll:X};if(J===null||J===void 0)J=!0;return{text:{[126]:Q},insideSpan:{null:[Q]},attentionMarkers:{null:[126]}};function X(H,z){let K=-1;while(++K<H.length)if(H[K][0]==="enter"&&H[K][1].type==="strikethroughSequenceTemporary"&&H[K][1]._close){let Y=K;while(Y--)if(H[Y][0]==="exit"&&H[Y][1].type==="strikethroughSequenceTemporary"&&H[Y][1]._open&&H[K][1].end.offset-H[K][1].start.offset===H[Y][1].end.offset-H[Y][1].start.offset){H[K][1].type="strikethroughSequence",H[Y][1].type="strikethroughSequence";let W={type:"strikethrough",start:Object.assign({},H[Y][1].start),end:Object.assign({},H[K][1].end)},q={type:"strikethroughText",start:Object.assign({},H[Y][1].end),end:Object.assign({},H[K][1].start)},B=[["enter",W,z],["enter",H[Y][1],z],["exit",H[Y][1],z],["enter",q,z]],U=z.parser.constructs.insideSpan.null;if(U)W5(B,B.length,0,Z9(U,H.slice(Y+1,K),z));W5(B,B.length,0,[["exit",q,z],["enter",H[K][1],z],["exit",H[K][1],z],["exit",W,z]]),W5(H,Y-1,K-Y+3,B),K=Y+B.length-2;break}}K=-1;while(++K<H.length)if(H[K][1].type==="strikethroughSequenceTemporary")H[K][1].type="data";return H}function G(H,z,K){let Y=this.previous,W=this.events,q=0;return B;function B(F){if(Y===126&&W[W.length-1][1].type!=="characterEscape")return K(F);return H.enter("strikethroughSequenceTemporary"),U(F)}function U(F){let V=F7(Y);if(F===126){if(q>1)return K(F);return H.consume(F),q++,U}if(q<2&&!J)return K(F);let N=H.exit("strikethroughSequenceTemporary"),L=F7(F);return N._open=!L||L===2&&Boolean(V),N._close=!V||V===2&&Boolean(L),z(F)}}}class $q{constructor(){this.map=[]}add($,Z,J){$i(this,$,Z,J)}consume($){if(this.map.sort(function(X,G){return X[0]-G[0]}),this.map.length===0)return;let Z=this.map.length,J=[];while(Z>0)Z-=1,J.push($.slice(this.map[Z][0]+this.map[Z][1]),this.map[Z][2]),$.length=this.map[Z][0];J.push($.slice()),$.length=0;let Q=J.pop();while(Q){for(let X of Q)$.push(X);Q=J.pop()}this.map.length=0}}function $i($,Z,J,Q){let X=0;if(J===0&&Q.length===0)return;while(X<$.map.length){if($.map[X][0]===Z){$.map[X][1]+=J,$.map[X][2].push(...Q);return}X+=1}$.map.push([Z,J,Q])}function SC($,Z){let J=!1,Q=[];while(Z<$.length){let X=$[Z];if(J){if(X[0]==="enter"){if(X[1].type==="tableContent")Q.push($[Z+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(X[1].type==="tableContent"){if($[Z-1][1].type==="tableDelimiterMarker"){let G=Q.length-1;Q[G]=Q[G]==="left"?"center":"right"}}else if(X[1].type==="tableDelimiterRow")break}else if(X[0]==="enter"&&X[1].type==="tableDelimiterRow")J=!0;Z+=1}return Q}function Zq(){return{flow:{null:{name:"table",tokenize:Zi,resolveAll:Ji}}}}function Zi($,Z,J){let Q=this,X=0,G=0,H;return z;function z(C){let g=Q.events.length-1;while(g>-1){let x=Q.events[g][1].type;if(x==="lineEnding"||x==="linePrefix")g--;else break}let b=g>-1?Q.events[g][1].type:null,k=b==="tableHead"||b==="tableRow"?M:K;if(k===M&&Q.parser.lazy[Q.now().line])return J(C);return k(C)}function K(C){return $.enter("tableHead"),$.enter("tableRow"),Y(C)}function Y(C){if(C===124)return W(C);return H=!0,G+=1,W(C)}function W(C){if(C===null)return J(C);if(O0(C)){if(G>1)return G=0,Q.interrupt=!0,$.exit("tableRow"),$.enter("lineEnding"),$.consume(C),$.exit("lineEnding"),U;return J(C)}if(y0(C))return R0($,W,"whitespace")(C);if(G+=1,H)H=!1,X+=1;if(C===124)return $.enter("tableCellDivider"),$.consume(C),$.exit("tableCellDivider"),H=!0,W;return $.enter("data"),q(C)}function q(C){if(C===null||C===124||J1(C))return $.exit("data"),W(C);return $.consume(C),C===92?B:q}function B(C){if(C===92||C===124)return $.consume(C),q;return q(C)}function U(C){if(Q.interrupt=!1,Q.parser.lazy[Q.now().line])return J(C);if($.enter("tableDelimiterRow"),H=!1,y0(C))return R0($,F,"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C);return F(C)}function F(C){if(C===45||C===58)return N(C);if(C===124)return H=!0,$.enter("tableCellDivider"),$.consume(C),$.exit("tableCellDivider"),V;return D(C)}function V(C){if(y0(C))return R0($,N,"whitespace")(C);return N(C)}function N(C){if(C===58)return G+=1,H=!0,$.enter("tableDelimiterMarker"),$.consume(C),$.exit("tableDelimiterMarker"),L;if(C===45)return G+=1,L(C);if(C===null||O0(C))return A(C);return D(C)}function L(C){if(C===45)return $.enter("tableDelimiterFiller"),_(C);return D(C)}function _(C){if(C===45)return $.consume(C),_;if(C===58)return H=!0,$.exit("tableDelimiterFiller"),$.enter("tableDelimiterMarker"),$.consume(C),$.exit("tableDelimiterMarker"),w;return $.exit("tableDelimiterFiller"),w(C)}function w(C){if(y0(C))return R0($,A,"whitespace")(C);return A(C)}function A(C){if(C===124)return F(C);if(C===null||O0(C)){if(!H||X!==G)return D(C);return $.exit("tableDelimiterRow"),$.exit("tableHead"),Z(C)}return D(C)}function D(C){return J(C)}function M(C){return $.enter("tableRow"),j(C)}function j(C){if(C===124)return $.enter("tableCellDivider"),$.consume(C),$.exit("tableCellDivider"),j;if(C===null||O0(C))return $.exit("tableRow"),Z(C);if(y0(C))return R0($,j,"whitespace")(C);return $.enter("data"),T(C)}function T(C){if(C===null||C===124||J1(C))return $.exit("data"),j(C);return $.consume(C),C===92?E:T}function E(C){if(C===92||C===124)return $.consume(C),T;return T(C)}}function Ji($,Z){let J=-1,Q=!0,X=0,G=[0,0,0,0],H=[0,0,0,0],z=!1,K=0,Y,W,q,B=new $q;while(++J<$.length){let U=$[J],F=U[1];if(U[0]==="enter"){if(F.type==="tableHead"){if(z=!1,K!==0)RC(B,Z,K,Y,W),W=void 0,K=0;Y={type:"table",start:Object.assign({},F.start),end:Object.assign({},F.end)},B.add(J,0,[["enter",Y,Z]])}else if(F.type==="tableRow"||F.type==="tableDelimiterRow"){if(Q=!0,q=void 0,G=[0,0,0,0],H=[0,J+1,0,0],z)z=!1,W={type:"tableBody",start:Object.assign({},F.start),end:Object.assign({},F.end)},B.add(J,0,[["enter",W,Z]]);X=F.type==="tableDelimiterRow"?2:W?3:1}else if(X&&(F.type==="data"||F.type==="tableDelimiterMarker"||F.type==="tableDelimiterFiller")){if(Q=!1,H[2]===0){if(G[1]!==0)H[0]=H[1],q=OG(B,Z,G,X,void 0,q),G=[0,0,0,0];H[2]=J}}else if(F.type==="tableCellDivider")if(Q)Q=!1;else{if(G[1]!==0)H[0]=H[1],q=OG(B,Z,G,X,void 0,q);G=H,H=[G[1],J,0,0]}}else if(F.type==="tableHead")z=!0,K=J;else if(F.type==="tableRow"||F.type==="tableDelimiterRow"){if(K=J,G[1]!==0)H[0]=H[1],q=OG(B,Z,G,X,J,q);else if(H[1]!==0)q=OG(B,Z,H,X,J,q);X=0}else if(X&&(F.type==="data"||F.type==="tableDelimiterMarker"||F.type==="tableDelimiterFiller"))H[3]=J}if(K!==0)RC(B,Z,K,Y,W);B.consume(Z.events),J=-1;while(++J<Z.events.length){let U=Z.events[J];if(U[0]==="enter"&&U[1].type==="table")U[1]._align=SC(Z.events,J)}return $}function OG($,Z,J,Q,X,G){let H=Q===1?"tableHeader":Q===2?"tableDelimiter":"tableData",z="tableContent";if(J[0]!==0)G.end=Object.assign({},t2(Z.events,J[0])),$.add(J[0],0,[["exit",G,Z]]);let K=t2(Z.events,J[1]);if(G={type:H,start:Object.assign({},K),end:Object.assign({},K)},$.add(J[1],0,[["enter",G,Z]]),J[2]!==0){let Y=t2(Z.events,J[2]),W=t2(Z.events,J[3]),q={type:"tableContent",start:Object.assign({},Y),end:Object.assign({},W)};if($.add(J[2],0,[["enter",q,Z]]),Q!==2){let B=Z.events[J[2]],U=Z.events[J[3]];if(B[1].end=Object.assign({},U[1].end),B[1].type="chunkText",B[1].contentType="text",J[3]>J[2]+1){let F=J[2]+1,V=J[3]-J[2]-1;$.add(F,V,[])}}$.add(J[3]+1,0,[["exit",q,Z]])}if(X!==void 0)G.end=Object.assign({},t2(Z.events,X)),$.add(X,0,[["exit",G,Z]]),G=void 0;return G}function RC($,Z,J,Q,X){let G=[],H=t2(Z.events,J);if(X)X.end=Object.assign({},H),G.push(["exit",X,Z]);Q.end=Object.assign({},H),G.push(["exit",Q,Z]),$.add(J+1,0,G)}function t2($,Z){let J=$[Z],Q=J[0]==="enter"?"start":"end";return J[1][Q]}var Qi={name:"tasklistCheck",tokenize:Xi};function Jq(){return{text:{[91]:Qi}}}function Xi($,Z,J){let Q=this;return X;function X(K){if(Q.previous!==null||!Q._gfmTasklistFirstContentOfListItem)return J(K);return $.enter("taskListCheck"),$.enter("taskListCheckMarker"),$.consume(K),$.exit("taskListCheckMarker"),G}function G(K){if(J1(K))return $.enter("taskListCheckValueUnchecked"),$.consume(K),$.exit("taskListCheckValueUnchecked"),H;if(K===88||K===120)return $.enter("taskListCheckValueChecked"),$.consume(K),$.exit("taskListCheckValueChecked"),H;return J(K)}function H(K){if(K===93)return $.enter("taskListCheckMarker"),$.consume(K),$.exit("taskListCheckMarker"),$.exit("taskListCheck"),z;return J(K)}function z(K){if(O0(K))return Z(K);if(y0(K))return $.check({tokenize:Gi},Z,J)(K);return J(K)}}function Gi($,Z,J){return R0($,Q,"whitespace");function Q(X){return X===null?J(X):Z(X)}}function bC($){return fX([nW(),tW(),eW($),Zq(),Jq()])}var Hi={};function PG($){let Z=this,J=$||Hi,Q=Z.data(),X=Q.micromarkExtensions||(Q.micromarkExtensions=[]),G=Q.fromMarkdownExtensions||(Q.fromMarkdownExtensions=[]),H=Q.toMarkdownExtensions||(Q.toMarkdownExtensions=[]);X.push(bC(J)),G.push(rW()),H.push(aW(J))}var t$=O(l(),1),zi=[PG],Ki=[DG],Yi={pre({children:$}){return t$.jsx("div",{className:"not-prose my-2 rounded-md border border-border bg-muted px-3 py-2.5",children:t$.jsx("pre",{className:"max-h-[300px] overflow-auto font-mono text-xs leading-relaxed whitespace-pre text-foreground",children:$})})}};function yC({size:$="sm",content:Z}){return t$.jsx("div",{className:B0("prose prose-inherit",$==="sm"&&"prose-sm"),children:t$.jsx(XW,{remarkPlugins:zi,rehypePlugins:Ki,components:Yi,children:Z})})}var _1=O(l(),1);function vC(){return _1.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 text-center",children:[_1.jsx("div",{className:"flex size-12 items-center justify-center rounded-xl border border-border bg-muted/40 text-muted-foreground",children:_1.jsx(q7,{size:24,stroke:1.5})}),_1.jsx("p",{className:"text-lg font-medium text-foreground",children:"What do you want to build?"})]})}function gC(){return _1.jsx("div",{className:"flex items-center gap-1.5 px-1 py-3",children:[0,1,2].map(($)=>_1.jsx("span",{className:"block h-1.5 w-1.5 rounded-full bg-ring",style:{animation:"pulse-dot 1.4s ease-in-out infinite",animationDelay:`${$*0.2}s`}},$))})}function Wi($){if($.type==="reasoning")return!0;if($.type==="tool-call")return!0;return!1}function qi($){let Z=[];for(let J of $)if(Wi(J)){let Q=Z[Z.length-1];if(Q&&Q.kind==="run")Q.parts.push(J);else Z.push({kind:"run",parts:[J]})}else Z.push({kind:"single",part:J});return Z}function Bi({parts:$,cwd:Z,processing:J=!1}){let Q=qi($);return _1.jsx("div",{className:"flex flex-col",children:Q.map((X,G)=>{let H=G===0?"":"mt-3",z=G===Q.length-1;return _1.jsx("div",{className:H,children:X.kind==="run"?_1.jsx(_9,{parts:X.parts,cwd:Z,processing:J&&z}):_1.jsx(Ui,{part:X.part})},G)})})}var fC=hC.memo(function({turn:Z,processing:J=!1}){let Q=Q5().cwd;if(Z.origin.kind==="replay")return null;if(Z.origin.kind==="synthetic")return null;if(Z.origin.kind==="subagent-prompt")return null;if(Z.role==="user"&&Z.origin.kind==="user-input"){let X=Z.parts.filter((H)=>H.type==="file"),G=Z.parts.filter((H)=>H.type==="text").map((H)=>H.type==="text"?H.text:"").join(`
117
- `);if(!G&&X.length===0)return null;return _1.jsxs("div",{className:"ml-8 flex flex-col items-end gap-1.5",children:[X.map((H,z)=>_1.jsx(mC,{mediaType:H.mediaType,url:H.url,filename:H.filename},z)),G&&_1.jsx("p",{className:"rounded-md bg-accent px-4 py-2 text-sm leading-normal whitespace-pre-wrap text-accent-foreground",children:G})]})}return _1.jsx(Bi,{parts:Z.parts,cwd:Q,processing:J})});function Ui({part:$}){switch($.type){case"text":return _1.jsx(yC,{content:$.text});case"tool-call":return _1.jsx(_9,{parts:[$],cwd:null});case"file":return _1.jsx(mC,{mediaType:$.mediaType,url:$.url,filename:$.filename});case"source-url":return _1.jsx(xC,{url:$.url,title:$.title});case"source-document":return _1.jsx(xC,{url:"#",title:$.title});case"data":return _1.jsx(Fi,{name:$.name,data:$.data});case"reasoning":return null}}function mC({mediaType:$,url:Z,filename:J}){if($.startsWith("image/")&&Z)return _1.jsx("img",{src:Z,alt:J??"attachment",className:"max-h-64 max-w-full rounded-md border border-border object-contain"});return _1.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-border bg-accent px-2.5 py-1.5 text-xs text-accent-foreground",children:[_1.jsx(y2,{size:16,stroke:1.75}),_1.jsx("span",{className:"truncate",children:J??$})]})}function xC({url:$,title:Z}){return _1.jsx("a",{href:$,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:Z??$})}function Fi({name:$,data:Z}){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 text-xs text-muted-foreground",children:JSON.stringify(Z,null,2)})]})}var e1=O(l(),1);function jG({active:$=!0,focusRequest:Z=0,view:J,previewTurn:Q,sessionId:X,processing:G,error:H,onDismissError:z,send:K,stop:Y,contained:W=!0,onSwitchThread:q,headerLeft:B,headerRight:U,onClose:F}){let V=G9.useRef(null),{ref:N,showTopFade:L,showBottomFade:_}=tJ(),w=J.turns,A=G9.useMemo(()=>oA(Q?[...w,Q]:w),[w,Q]),{atBottom:D,scrollToBottom:M}=nA(N,X);G9.useEffect(()=>{if($)V.current?.focus()},[$,Z]);let j=G9.useCallback((T)=>{K(T),M()},[K,M]);return e1.jsxs("div",{className:"flex min-h-0 flex-1 flex-col pt-2 pb-4",children:[e1.jsxs("header",{className:"flex items-center justify-between pr-2 pb-2 pl-2",children:[e1.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[B,e1.jsx(Kw,{onSwitch:q})]}),e1.jsxs("div",{className:"flex items-center gap-0.5",children:[U,F&&e1.jsx(C0,{variant:"ghost",size:"icon",onClick:F,"aria-label":"Close chat",children:e1.jsx(U4,{stroke:1.5})})]})]}),e1.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[e1.jsx("div",{ref:N,className:B0("flex scrollbar-thin flex-1 flex-col overflow-y-auto overscroll-contain px-5 pt-4 pb-12",L&&_&&"mask-fade-y",L&&!_&&"mask-fade-top",!L&&_&&"mask-fade-bottom"),children:e1.jsxs("div",{className:B0("flex flex-1 flex-col gap-6",W&&"mx-auto w-full max-w-[var(--chat-max-container)]"),children:[w.length===0&&!G&&e1.jsx(vC,{}),A.map((T,E)=>e1.jsx(fC,{turn:T,processing:G&&E===A.length-1},T.id)),G&&!Q&&e1.jsx(gC,{})]})}),!D&&w.length>0&&e1.jsx(C0,{type:"button",variant:"outline",size:"icon",onClick:()=>M("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:e1.jsx(b2,{stroke:1.5})})]}),e1.jsxs("div",{className:B0(W&&"mx-auto w-full max-w-[var(--chat-max-container)] px-3"),children:[H&&e1.jsxs("div",{className:"mb-2 flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:[e1.jsx("span",{className:"flex-1 break-words",children:H}),z&&e1.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:z,className:"-m-1","aria-label":"Dismiss error",children:e1.jsx(U4,{stroke:1.75})})]}),e1.jsx(zw,{composerRef:V,onSend:j,onStop:Y,processing:G})]})]})}var H9={};G4(H9,{createHandle:()=>qI,Viewport:()=>WI,Trigger:()=>lC,Title:()=>QI,Root:()=>cC,Positioner:()=>sC,Portal:()=>aC,Popup:()=>oC,Handle:()=>EG,Description:()=>GI,Close:()=>zI,Backdrop:()=>ZI,Arrow:()=>eC});var t8=O(v(),1);var CG=O(v(),1),Qq=CG.createContext(void 0);function H5($){let Z=CG.useContext(Qq);if(Z===void 0&&!$)throw Error(M0(47));return Z}var e2=O(v(),1),uC=O(I8(),1);function Vi(){return{...f4(),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 Li={...m4,disabled:w0(($)=>$.disabled),instantType:w0(($)=>$.instantType),openMethod:w0(($)=>$.openMethod),openChangeReason:w0(($)=>$.openChangeReason),modal:w0(($)=>$.modal),stickIfOpen:w0(($)=>$.stickIfOpen),titleElementId:w0(($)=>$.titleElementId),descriptionElementId:w0(($)=>$.descriptionElementId),openOnHover:w0(($)=>$.openOnHover),closeDelay:w0(($)=>$.closeDelay),hasViewport:w0(($)=>$.hasViewport)};class $3 extends T8{constructor($){let Z={...Vi(),...$};if(Z.open&&$?.mounted===void 0)Z.mounted=!0;super(Z,{popupRef:e2.createRef(),backdropRef:e2.createRef(),internalBackdropRef:e2.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:e2.createRef(),beforeContentFocusGuardRef:e2.createRef(),stickIfOpenTimeout:new y5,triggerElements:new z8},Li)}setOpen=($,Z)=>{let J=Z.reason===o.triggerHover,Q=Z.reason===o.triggerPress&&Z.event.detail===0,X=!$&&(Z.reason===o.escapeKey||Z.reason==null);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let G={open:$,nativeEvent:Z.event,reason:Z.reason,nested:this.state.nested,triggerElement:Z.trigger};this.state.floatingRootContext.context.events?.emit("openchange",G);let z=()=>{let K={open:$,openChangeReason:Z.reason},Y=Z.trigger?.id??null;if(Y||$)K.activeTriggerId=Y,K.activeTriggerElement=Z.trigger??null;this.update(K)};if(J)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(iZ,()=>{this.set("stickIfOpen",!1)}),uC.flushSync(z);else z();if(Q||X)this.set("instantType",Q?"click":"dismiss");else if(Z.reason===o.focusOut)this.set("instantType","focus");else this.set("instantType",void 0)};static useStore($,Z){let J=$1(()=>{return new $3(Z)}).current,Q=$??J;return E4(J.disposeEffect),Q}disposeEffect=()=>{return this.context.stickIfOpenTimeout.disposeEffect()}}var e$=O(l(),1);function pC({props:$}){let{children:Z,open:J,defaultOpen:Q=!1,onOpenChange:X,onOpenChangeComplete:G,modal:H=!1,handle:z,triggerId:K,defaultTriggerId:Y=null}=$,W=$3.useStore(z?.store,{modal:H,open:Q,openProp:J,activeTriggerId:Y,triggerIdProp:K});k4(()=>{if(J===void 0&&W.state.open===!1&&Q===!0)W.update({open:!0,activeTriggerId:Y})}),W.useControlledProp("openProp",J),W.useControlledProp("triggerIdProp",K);let q=W.useState("open"),B=W.useState("positionerElement"),U=W.useState("payload"),F=W.useState("openChangeReason");W.useContextCallback("onOpenChange",X),W.useContextCallback("onOpenChangeComplete",G);let{openMethod:V,triggerProps:N,reset:L}=z2(q);v4(W);let{forceUnmount:_}=g4(q,W,()=>{W.update({stickIfOpen:!0,openChangeReason:null}),L()});G2(q&&H===!0&&F!==o.triggerHover&&V!=="touch",B),t8.useEffect(()=>{if(!q)W.context.stickIfOpenTimeout.clear()},[W,q]);let w=t8.useCallback((R)=>{let I=N0(R);return I.preventUnmountOnClose=()=>{W.set("preventUnmountingOnClose",!0)},I},[W]),A=t8.useCallback(()=>{W.setOpen(!1,w(o.imperativeAction))},[W,w]);t8.useImperativeHandle($.actionsRef,()=>({unmount:_,close:A}),[_,A]);let D=K4({popupStore:W,onOpenChange:W.setOpen}),M=z4(D,{outsidePressEvent:{mouse:H==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),j=v9(D),{getReferenceProps:T,getFloatingProps:E,getTriggerProps:C}=P5([M,j]),g=t8.useMemo(()=>{return T(N)},[T,N]),b=t8.useMemo(()=>{return C(N)},[C,N]),k=t8.useMemo(()=>{return E()},[E]);W.useSyncedValues({modal:H,openMethod:V,activeTriggerProps:g,inactiveTriggerProps:b,popupProps:k,floatingRootContext:D,nested:w5()!=null});let x=t8.useMemo(()=>({store:W}),[W]);return e$.jsx(Qq.Provider,{value:x,children:typeof Z==="function"?Z({payload:U}):Z})}function cC($){if(H5(!0))return e$.jsx(pC,{props:$});return e$.jsx(u3,{children:e$.jsx(pC,{props:$})})}var L4=O(v(),1),Xq=O(I8(),1);var dC=300;var L6=O(l(),1),lC=L4.forwardRef(function(Z,J){let{render:Q,className:X,disabled:G=!1,nativeButton:H=!0,handle:z,payload:K,openOnHover:Y=!1,delay:W=dC,closeDelay:q=0,id:B,...U}=Z,F=H5(!0),V=z?.store??F?.store;if(!V)throw Error(M0(74));let N=c0(B),L=V.useState("isTriggerActive",N),_=V.useState("floatingRootContext"),w=V.useState("isOpenedByTrigger",N),A=L4.useRef(null),{registerTrigger:D,isMountedByThisTrigger:M}=h4(N,A,V,{payload:K,disabled:G,openOnHover:Y,closeDelay:q}),j=V.useState("openChangeReason"),T=V.useState("stickIfOpen"),E=V.useState("openMethod"),C=Y4(_,{enabled:_!=null&&Y&&(E!=="touch"||j!==o.triggerPress),mouseOnly:!0,move:!1,handleClose:W4(),restMs:W,delay:{close:q},triggerElementRef:A,isActiveTrigger:L}),g=H7(_,{enabled:_!=null,stickIfOpen:T}),b=P5([g]),k=V.useState("triggerProps",M),x={disabled:G,open:w},{getButtonProps:R,buttonRef:I}=M5({disabled:G,native:H}),S=L4.useMemo(()=>({open(z0){if(z0&&j===o.triggerPress)return o3.open(z0);return p4.open(z0)}}),[j]),h=W0("button",Z,{state:x,ref:[I,J,D,A],props:[b.getReferenceProps(),C,k,{[b6]:"",id:N},U,R],stateAttributesMapping:S}),p=L4.useRef(null),P=H0((z0)=>{Xq.flushSync(()=>{V.setOpen(!1,N0(o.focusOut,z0.nativeEvent,z0.currentTarget))}),_J(p.current)?.focus()}),t=H0((z0)=>{let y=V.select("positionerElement");if(y&&X4(z0,y))V.context.beforeContentFocusGuardRef.current?.focus();else{Xq.flushSync(()=>{V.setOpen(!1,N0(o.focusOut,z0.nativeEvent,z0.currentTarget))});let n=NJ(V.context.triggerFocusTargetRef.current||A.current);while(n!==null&&S0(y,n)){let _0=n;if(n=S7(n),n===_0)break}n?.focus()}});if(L)return L6.jsxs(L4.Fragment,{children:[L6.jsx(p8,{ref:p,onFocus:P}),L6.jsx(L4.Fragment,{children:h},N),L6.jsx(p8,{ref:V.context.triggerFocusTargetRef,onFocus:t})]});return L6.jsx(L4.Fragment,{children:h},N)});var rC=O(v(),1);var IG=O(v(),1),Gq=IG.createContext(void 0);function iC(){let $=IG.useContext(Gq);if($===void 0)throw Error(M0(45));return $}var Hq=O(l(),1),aC=rC.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z,{store:G}=H5();if(!(G.useState("mounted")||Q))return null;return Hq.jsx(Gq.Provider,{value:Q,children:Hq.jsx(E9,{ref:J,...X})})});var _7=O(v(),1);var TG=O(v(),1),zq=TG.createContext(void 0);function Z3(){let $=TG.useContext(zq);if(!$)throw Error(M0(46));return $}var $Z=O(l(),1),sC=_7.forwardRef(function(Z,J){let{render:Q,className:X,anchor:G,positionMethod:H="absolute",side:z="bottom",align:K="center",sideOffset:Y=0,alignOffset:W=0,collisionBoundary:q="clipping-ancestors",collisionPadding:B=5,arrowPadding:U=5,sticky:F=!1,disableAnchorTracking:V=!1,collisionAvoidance:N=C7,...L}=Z,{store:_}=H5(),w=iC(),A=I9(),D=_.useState("floatingRootContext"),M=_.useState("mounted"),j=_.useState("open"),T=_.useState("openChangeReason"),E=_.useState("activeTriggerElement"),C=_.useState("modal"),g=_.useState("positionerElement"),b=_.useState("instantType"),k=_.useState("transitionStatus"),x=_.useState("hasViewport"),R=_7.useRef(null),I=x4(g,!1,!1),S=f7({anchor:G,floatingRootContext:D,positionMethod:H,mounted:M,side:z,sideOffset:Y,align:K,alignOffset:W,arrowPadding:U,collisionBoundary:q,collisionPadding:B,sticky:F,disableAnchorTracking:V,keepMounted:w,nodeId:A,collisionAvoidance:N,adaptiveOrigin:x?t6:void 0}),h=_7.useMemo(()=>{let n={};if(!j)n.pointerEvents="none";return{role:"presentation",hidden:!M,style:{...S.positionerStyles,...n}}},[j,M,S.positionerStyles]),p=_7.useMemo(()=>({props:h,...S}),[h,S]),P=D.useState("domReferenceElement");Q0(()=>{let n=P,_0=R.current;if(n)R.current=n;if(_0&&n&&n!==_0){_.set("instantType",void 0);let c=new AbortController;return I(()=>{_.set("instantType","trigger-change")},c.signal),()=>{c.abort()}}return},[P,I,_]);let t={open:j,side:p.side,align:p.align,anchorHidden:p.anchorHidden,instant:b},z0=_7.useCallback((n)=>{_.set("positionerElement",n)},[_]),y=W0("div",Z,{state:t,props:[p.props,a5(k),L],ref:[J,z0],stateAttributesMapping:H1});return $Z.jsxs(zq.Provider,{value:p,children:[M&&C===!0&&T!==o.triggerHover&&$Z.jsx(X2,{ref:_.context.internalBackdropRef,inert:m7(!j),cutout:E}),$Z.jsx(m3,{id:A,children:y})]})});var kG=O(v(),1);var nC=O(l(),1),Ni={...H1,...P1},oC=kG.forwardRef(function(Z,J){let{className:Q,render:X,initialFocus:G,finalFocus:H,...z}=Z,{store:K}=H5(),Y=Z3(),W=WX(!0)!=null,q=K.useState("open"),B=K.useState("openMethod"),U=K.useState("instantType"),F=K.useState("transitionStatus"),V=K.useState("popupProps"),N=K.useState("titleElementId"),L=K.useState("descriptionElementId"),_=K.useState("modal"),w=K.useState("mounted"),A=K.useState("openChangeReason"),D=K.useState("activeTriggerElement"),M=K.useState("floatingRootContext");L5({open:q,ref:K.context.popupRef,onComplete(){if(q)K.context.onOpenChangeComplete?.(!0)}});let j=K.useState("disabled"),T=K.useState("openOnHover"),E=K.useState("closeDelay");z7(M,{enabled:T&&!j,closeDelay:E});function C(R){if(R==="touch")return K.context.popupRef.current;return!0}let g=G===void 0?C:G,b={open:q,side:Y.side,align:Y.align,instant:U,transitionStatus:F},k=kG.useCallback((R)=>{K.set("popupElement",R)},[K]),x=W0("div",Z,{state:b,ref:[J,K.context.popupRef,k],props:[V,{"aria-labelledby":N,"aria-describedby":L,onKeyDown(R){if(W&&Q2.has(R.key))R.stopPropagation()}},a5(F),z],stateAttributesMapping:Ni});return nC.jsx(S9,{context:M,openInteractionType:B,modal:_==="trap-focus",disabled:!w||A===o.triggerHover,initialFocus:g,returnFocus:H,restoreFocus:"popup",previousFocusableElement:b1(D)?D:void 0,nextFocusableElement:K.context.triggerFocusTargetRef,beforeContentFocusGuardRef:K.context.beforeContentFocusGuardRef,children:x})});var tC=O(v(),1);var eC=tC.forwardRef(function(Z,J){let{className:Q,render:X,...G}=Z,{store:H}=H5(),z=H.useState("open"),{arrowRef:K,side:Y,align:W,arrowUncentered:q,arrowStyles:B}=Z3();return W0("div",Z,{state:{open:z,side:Y,align:W,uncentered:q},ref:[J,K],props:[{style:B,"aria-hidden":!0},G],stateAttributesMapping:H1})});var $I=O(v(),1);var _i={...H1,...P1},ZI=$I.forwardRef(function(Z,J){let{className:Q,render:X,...G}=Z,{store:H}=H5(),z=H.useState("open"),K=H.useState("mounted"),Y=H.useState("transitionStatus"),W=H.useState("openChangeReason");return W0("div",Z,{state:{open:z,transitionStatus:Y},ref:[H.context.backdropRef,J],props:[{role:"presentation",hidden:!K,style:{pointerEvents:W===o.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},G],stateAttributesMapping:_i})});var JI=O(v(),1);var QI=JI.forwardRef(function(Z,J){let{render:Q,className:X,...G}=Z,{store:H}=H5(),z=c0(G.id);return Q0(()=>{return H.set("titleElementId",z),()=>{H.set("titleElementId",void 0)}},[H,z]),W0("h2",Z,{ref:J,props:[{id:z},G]})});var XI=O(v(),1);var GI=XI.forwardRef(function(Z,J){let{render:Q,className:X,...G}=Z,{store:H}=H5(),z=c0(G.id);return Q0(()=>{return H.set("descriptionElementId",z),()=>{H.set("descriptionElementId",void 0)}},[H,z]),W0("p",Z,{ref:J,props:[{id:z},G]})});var HI=O(v(),1);var zI=HI.forwardRef(function(Z,J){let{render:Q,className:X,disabled:G=!1,nativeButton:H=!0,...z}=Z,{buttonRef:K,getButtonProps:Y}=M5({disabled:G,focusableWhenDisabled:!1,native:H}),{store:W}=H5();return W0("button",Z,{ref:[J,K],props:[{onClick(B){W.setOpen(!1,N0(o.closePress,B.nativeEvent,B.currentTarget))}},z,Y]})});var YI=O(v(),1);var KI=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var Mi={activationDirection:($)=>$?{"data-activation-direction":$}:null},WI=YI.forwardRef(function(Z,J){let{render:Q,className:X,children:G,...H}=Z,{store:z}=H5(),{side:K}=Z3(),Y=z.useState("instantType"),{children:W,state:q}=$2({store:z,side:K,cssVars:KI,children:G}),B={activationDirection:q.activationDirection,transitioning:q.transitioning,instant:Y};return W0("div",Z,{state:B,ref:J,props:[H,{children:W}],stateAttributesMapping:Mi})});class EG{constructor(){this.store=new $3}open($){let Z=$?this.store.context.triggerElements.getById($)??void 0:void 0;if($&&!Z)throw Error(M0(80,$));this.store.setOpen(!0,N0(o.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,N0(o.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function qI(){return new EG}var J3=O(l(),1);function BI({...$}){return J3.jsx(H9.Root,{"data-slot":"popover",...$})}function UI({...$}){return J3.jsx(H9.Trigger,{"data-slot":"popover-trigger",...$})}function FI({className:$,align:Z="center",alignOffset:J=0,side:Q="bottom",sideOffset:X=4,keepMounted:G=!1,container:H,...z}){return J3.jsx(H9.Portal,{keepMounted:G,container:H,children:J3.jsx(H9.Positioner,{align:Z,alignOffset:J,side:Q,sideOffset:X,className:"isolate z-50",children:J3.jsx(H9.Popup,{"data-slot":"popover-content",className:B0("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-md bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-border 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",$),...z})})})}var M7=O(l(),1);function VI({open:$,onOpenChange:Z,onOpenChangeComplete:J,container:Q,children:X}){let G=()=>Z(!1);return M7.jsxs(BI,{open:$,onOpenChange:Z,onOpenChangeComplete:J,children:[M7.jsx(UI,{render:M7.jsx("div",{className:"fixed right-4 bottom-4 sm:right-6 sm:bottom-6",children:M7.jsx(T1.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:$?"invisible":"to",transition:{type:"spring",duration:0.3,delay:0.2,bounce:0},children:M7.jsx(C0,{variant:"outline",size:"icon-lg",className:"bg-card text-card-foreground hover:bg-card","aria-label":"Agent",children:M7.jsx(q7,{stroke:1.5})})})})}),M7.jsx(FI,{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,container:Q,children:X(G)})]})}var _I=O(v(),1);var ZZ=O(l(),1);function SG({title:$,children:Z,ref:J}){return ZZ.jsxs(T1.div,{ref:J,className:"absolute inset-x-6 bottom-0 z-20 flex max-h-[60vh] flex-col rounded-t-2xl bg-card p-[var(--page-pad)] text-card-foreground shadow-xl",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:[ZZ.jsx("p",{className:"mb-4 shrink-0 text-sm font-medium text-muted-foreground",children:$}),ZZ.jsx("div",{className:"-my-1 [margin-right:calc(var(--page-pad)*-1)] [margin-left:calc(var(--page-pad)*-1)] flex-1 overflow-y-auto px-[var(--page-pad)] py-1",children:Z})]})}var Q3={default:{label:"Default",sans:"system-ui",mono:"JetBrains Mono",feel:"Native OS, zero load",googleFontsQuery:"JetBrains+Mono:wght@400;500"},serif:{label:"Serif",sans:"Libre Baskerville",mono:"JetBrains Mono",feel:"Classic serif, literary",googleFontsQuery:"Libre+Baskerville:wght@400;700&family=JetBrains+Mono:wght@400;500"},mono:{label:"Mono",sans:"JetBrains Mono",mono:"JetBrains Mono",feel:"Full terminal, hacker",googleFontsQuery:"JetBrains+Mono:wght@400;500;600"},bubbly:{label:"Bubbly",sans:"Fredoka",mono:"Azeret Mono",feel:"Very round, toy-like",googleFontsQuery:"Fredoka:wght@400;500;600&family=Azeret+Mono:wght@400;500"},geometric:{label:"Geometric",sans:"Outfit",mono:"DM Mono",feel:"Swiss design, neutral",googleFontsQuery:"Outfit:wght@400;500;600&family=DM+Mono:wght@400;500"},retro:{label:"Retro",sans:"Courier Prime",mono:"Courier Prime",feel:"Typewriter nostalgia",googleFontsQuery:"Courier+Prime:wght@400;700"}},LI={default:{label:"Default",feel:"System neutral"},paper:{label:"Paper",background:"#faf8f5",foreground:"#2c2825",feel:"Warm off-white"},sand:{label:"Sand",background:"#f5f0e8",foreground:"#3d3529",feel:"Beige earth tones"},rose:{label:"Rose",background:"#fdf2f4",foreground:"#3b1c26",feel:"Soft blush"},lavender:{label:"Lavender",background:"#f4f2fb",foreground:"#2b2640",feel:"Cool violet"},mint:{label:"Mint",background:"#f0faf6",foreground:"#1a3028",feel:"Cool green"},sky:{label:"Sky",background:"#f0f6fc",foreground:"#1a2a3b",feel:"Cool blue"}};var f5=O(l(),1),NI="mei-font-previews",Ai=Object.values(Q3).map(($)=>$.googleFontsQuery).filter(Boolean).join("&family=");function Di(){_I.useEffect(()=>{if(document.getElementById(NI))return;let $=document.createElement("link");$.id=NI,$.rel="stylesheet",$.href=`https://fonts.googleapis.com/css2?family=${Ai}&display=swap`,document.head.appendChild($)},[])}var wi=Object.entries(Q3),Oi=Object.entries(LI);function Pi($,Z,J){return($.background??void 0)===Z&&($.foreground??void 0)===J}function MI({ref:$}){Di();let{layout:Z,setLayout:J}=Q5(),Q=Z.theme?.font??"default",X=Z.theme?.background,G=Z.theme?.foreground;function H(z){J({theme:{...Z.theme,font:Q,...z}})}return f5.jsx(SG,{ref:$,title:"Customize",children:f5.jsxs("div",{className:"flex flex-col gap-6",children:[f5.jsxs("div",{className:"flex flex-col gap-2",children:[f5.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Font"}),f5.jsx("div",{className:"grid grid-cols-3 gap-2",children:wi.map(([z,K])=>f5.jsxs("button",{type:"button",onClick:()=>H({font:z}),className:B0("flex flex-col items-start rounded-md px-3 py-2 text-left transition-colors",z===Q?"bg-primary/5 ring-2 ring-primary":"border-transparent hover:bg-accent"),style:{fontFamily:K.sans},children:[f5.jsx("span",{className:"text-sm font-medium",children:K.label}),f5.jsx("span",{className:"text-xs text-muted-foreground",children:K.feel})]},z))})]}),f5.jsxs("div",{className:"flex flex-col gap-2",children:[f5.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Colors"}),f5.jsx("div",{className:"grid grid-cols-3 gap-2",children:Oi.map(([z,K])=>{let Y=Pi(K,X,G);return f5.jsxs("button",{type:"button",onClick:()=>H({background:K.background,foreground:K.foreground}),className:B0("flex items-center gap-2 rounded-md border px-3 py-2 transition-colors",Y?"bg-primary/5 ring-2 ring-primary":"border-transparent hover:bg-accent"),children:[f5.jsx("span",{className:"size-5 shrink-0 rounded-full border border-border",style:{backgroundColor:K.background??"oklch(1 0 0)"},children:f5.jsx("span",{className:"flex size-full items-center justify-center text-[9px] leading-none font-bold",style:{color:K.foreground??"oklch(0.145 0 0)"},children:"A"})}),f5.jsx("span",{className:"text-sm",children:K.label})]},z)})})]})]})})}var DI=O(v(),1);var X3=O(l(),1);class JZ extends DI.Component{state={error:null};static getDerivedStateFromError($){return{error:$}}componentDidCatch($,Z){console.error(`[widget:${this.props.name}]`,$,Z.componentStack)}componentDidUpdate($){if($.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}render(){if(this.state.error)return X3.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[X3.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[X3.jsx(AI,{size:16,stroke:1.75}),"Widget crashed"]}),X3.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var sG=O(v(),1);function QZ($,Z,J,Q){let X=$.reduce((G,H)=>Math.max(G,H.y+H.h),0);for(let G=0;G<=X+J;G++)for(let H=0;H<=Q-Z;H++)if(!$.some((K)=>!(H+Z<=K.x||K.x+K.w<=H||G+J<=K.y||K.y+K.h<=G)))return{x:H,y:G};return{x:0,y:X}}function XZ($,Z=[],J=4){let Q=[];for(let X of $){let{x:G,y:H}=X.x!==void 0&&X.y!==void 0?{x:X.x,y:X.y}:QZ([...Z,...Q],X.w,X.h,J);Q.push({i:X.id,x:G,y:H,w:X.w,h:X.h})}return Q}var N6=O(l(),1);function wI({name:$}){let Z=rA($);return N6.jsxs(g8,{mode:"wait",initial:!1,children:[Z.status==="ready"&&N6.jsx(T1.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:N6.jsx(JZ,{name:$,resetKey:Z.version,children:N6.jsx(Z.Component,{})})},Z.version),Z.status==="error"&&N6.jsx(T1.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 PI=O(v(),1);var z9=O(l(),1);function RG({editing:$,hidden:Z,onRemove:J,children:Q}){return z9.jsxs(T1.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:[z9.jsx("div",{className:B0("dark absolute inset-0 overflow-hidden rounded-2xl [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)]","text-foreground",$&&"pointer-events-none"),children:Q}),$&&J&&z9.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:z9.jsx(C0,{size:"icon-sm",variant:"outline",className:"rounded-full",onClick:J,children:Z?z9.jsx(t5,{stroke:1.75}):z9.jsx(OI,{stroke:1.75})})})]})}var G3=O(l(),1),ji={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},Ci={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"},Ii={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},Ti={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function jI({items:$,renderItem:Z,onRestore:J,ref:Q}){let X=PI.useMemo(()=>XZ($),[$]);return G3.jsx(SG,{ref:Q,title:"Hidden",children:G3.jsx("div",{className:"grid [grid-auto-rows:160px] grid-cols-4 gap-2",children:G3.jsx(g8,{children:X.map((G)=>G3.jsx(T1.div,{layoutId:G.i,className:B0(ji[G.x],Ci[G.y],Ii[G.w],Ti[G.h]),transition:{type:"spring",duration:0.35,bounce:0},children:G3.jsx(RG,{editing:!0,onRemove:()=>J(G.i),hidden:!0,children:Z(G.i)})},G.i))})})})}var _Z=O(v(),1);function Y9($){let{margin:Z,containerPadding:J,containerWidth:Q,cols:X}=$;return(Q-Z[0]*(X-1)-J[0]*2)/X}function N4($,Z,J){if(!Number.isFinite($))return $;return Math.round(Z*$+Math.max(0,$-1)*J)}function HZ($,Z,J,Q,X,G,H){let{margin:z,containerPadding:K,rowHeight:Y}=$,W=Y9($),q,B,U,F;if(H)q=Math.round(H.width),B=Math.round(H.height);else q=N4(Q,W,z[0]),B=N4(X,Y,z[1]);if(G)U=Math.round(G.top),F=Math.round(G.left);else if(H)U=Math.round(H.top),F=Math.round(H.left);else U=Math.round((Y+z[1])*J+K[1]),F=Math.round((W+z[0])*Z+K[0]);if(!G&&!H){if(Number.isFinite(Q)){let N=Math.round((W+z[0])*(Z+Q)+K[0])-F-q;if(N!==z[0])q+=N-z[0]}if(Number.isFinite(X)){let N=Math.round((Y+z[1])*(J+X)+K[1])-U-B;if(N!==z[1])B+=N-z[1]}}return{top:U,left:F,width:q,height:B}}function II($,Z,J,Q,X){let{margin:G,containerPadding:H,cols:z,rowHeight:K,maxRows:Y}=$,W=Y9($),q=Math.round((J-H[0])/(W+G[0])),B=Math.round((Z-H[1])/(K+G[1]));return q=GZ(q,0,z-Q),B=GZ(B,0,Y-X),{x:q,y:B}}function zZ($,Z,J){let{margin:Q,containerPadding:X,rowHeight:G}=$,H=Y9($),z=Math.round((J-X[0])/(H+Q[0])),K=Math.round((Z-X[1])/(G+Q[1]));return{x:z,y:K}}function TI($,Z,J){let{margin:Q,rowHeight:X}=$,G=Y9($),H=Math.max(1,Math.round((Z+Q[0])/(G+Q[0]))),z=Math.max(1,Math.round((J+Q[1])/(X+Q[1])));return{w:H,h:z}}function GZ($,Z,J){return Math.max(Math.min($,J),Z)}function yG($,Z){if($.i===Z.i)return!1;if($.x+$.w<=Z.x)return!1;if($.x>=Z.x+Z.w)return!1;if($.y+$.h<=Z.y)return!1;if($.y>=Z.y+Z.h)return!1;return!0}function W9($,Z){for(let J=0;J<$.length;J++){let Q=$[J];if(Q!==void 0&&yG(Q,Z))return Q}return}function Kq($,Z){return $.filter((J)=>yG(J,Z))}function ki($,Z){if(Z==="horizontal")return Yq($);if(Z==="vertical")return bG($);if(Z==="wrap")return bG($);return[...$]}function bG($){return[...$].sort((Z,J)=>{if(Z.y!==J.y)return Z.y-J.y;return Z.x-J.x})}function Yq($){return[...$].sort((Z,J)=>{if(Z.x!==J.x)return Z.x-J.x;return Z.y-J.y})}function KZ($){let Z=0;for(let J=0;J<$.length;J++){let Q=$[J];if(Q!==void 0){let X=Q.y+Q.h;if(X>Z)Z=X}}return Z}function q9($,Z){for(let J=0;J<$.length;J++){let Q=$[J];if(Q!==void 0&&Q.i===Z)return Q}return}function YZ($){return $.filter((Z)=>Z.static===!0)}function A7($){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 H3($){let Z=Array($.length);for(let J=0;J<$.length;J++){let Q=$[J];if(Q!==void 0)Z[J]=A7(Q)}return Z}function Ei($,Z){let J=Array($.length);for(let Q=0;Q<$.length;Q++){let X=$[Q];if(X!==void 0)if(Z.i===X.i)J[Q]=Z;else J[Q]=X}return J}function kI($,Z,J){let Q=q9($,Z);if(!Q)return[[...$],null];return Q=J(A7(Q)),[Ei($,Q),Q]}function Wq($,Z){let J=YZ($);for(let Q=0;Q<$.length;Q++){let X=$[Q];if(X===void 0)continue;if(X.x+X.w>Z.cols)X.x=Z.cols-X.w;if(X.x<0)X.x=0,X.w=Z.cols;if(!X.static)J.push(X);else while(W9(J,X))X.y++}return $}function K9($,Z,J,Q,X,G,H,z,K){if(Z.static&&Z.isDraggable!==!0)return[...$];if(Z.y===Q&&Z.x===J)return[...$];let{x:Y,y:W}=Z;if(typeof J==="number")Z.x=J;if(typeof Q==="number")Z.y=Q;Z.moved=!0;let q=ki($,H);if(H==="vertical"&&typeof Q==="number"?W>=Q:H==="horizontal"&&typeof J==="number"?Y>=J:!1)q=q.reverse();let U=Kq(q,Z),F=U.length>0;if(F&&K)return H3($);if(F&&G)return Z.x=Y,Z.y=W,Z.moved=!1,$;let V=[...$];for(let N=0;N<U.length;N++){let L=U[N];if(L===void 0)continue;if(L.moved)continue;if(L.static)V=CI(V,L,Z,X,H);else V=CI(V,Z,L,X,H)}return V}function CI($,Z,J,Q,X,G){let H=X==="horizontal",z=X==="vertical",K=Z.static;if(Q){Q=!1;let q={x:H?Math.max(Z.x-J.w,0):J.x,y:z?Math.max(Z.y-J.h,0):J.y,w:J.w,h:J.h,i:"-1"},B=W9($,q),U=B!==void 0&&B.y+B.h>Z.y,F=B!==void 0&&Z.x+Z.w>B.x;if(!B)return K9($,J,H?q.x:void 0,z?q.y:void 0,Q,K,X);if(U&&z)return K9($,J,void 0,J.y+1,Q,K,X);if(U&&X===null)return Z.y=J.y,J.y=J.y+J.h,[...$];if(F&&H)return K9($,Z,J.x,void 0,Q,K,X)}let Y=H?J.x+1:void 0,W=z?J.y+1:void 0;if(Y===void 0&&W===void 0)return[...$];return K9($,J,Y,W,Q,K,X)}function z3($,Z,J){return Math.max(Z,Math.min(J,$))}var Si={name:"gridBounds",constrainPosition($,Z,J,{cols:Q,maxRows:X}){return{x:z3(Z,0,Math.max(0,Q-$.w)),y:z3(J,0,Math.max(0,X-$.h))}},constrainSize($,Z,J,Q,{cols:X,maxRows:G}){let H=Q==="w"||Q==="nw"||Q==="sw"?$.x+$.w:X-$.x,z=Q==="n"||Q==="nw"||Q==="ne"?$.y+$.h:G-$.y;return{w:z3(Z,1,Math.max(1,H)),h:z3(J,1,Math.max(1,z))}}},Ri={name:"minMaxSize",constrainSize($,Z,J){return{w:z3(Z,$.minW??1,$.maxW??1/0),h:z3(J,$.minH??1,$.maxH??1/0)}}};var qq=[Si,Ri];function WZ($,Z,J,Q,X){let G={x:J,y:Q};for(let H of $)if(H.constrainPosition)G=H.constrainPosition(Z,G.x,G.y,X);if(Z.constraints){for(let H of Z.constraints)if(H.constrainPosition)G=H.constrainPosition(Z,G.x,G.y,X)}return G}function EI($,Z,J,Q,X,G){let H={w:J,h:Q};for(let z of $)if(z.constrainSize)H=z.constrainSize(Z,H.w,H.h,X,G);if(Z.constraints){for(let z of Z.constraints)if(z.constrainSize)H=z.constrainSize(Z,H.w,H.h,X,G)}return H}function hG({top:$,left:Z,width:J,height:Q}){let X=`translate(${Z}px,${$}px)`;return{transform:X,WebkitTransform:X,MozTransform:X,msTransform:X,OTransform:X,width:`${J}px`,height:`${Q}px`,position:"absolute"}}function Bq({top:$,left:Z,width:J,height:Q}){return{top:`${$}px`,left:`${Z}px`,width:`${J}px`,height:`${Q}px`,position:"absolute"}}function Uq($){return $*100+"%"}function bi($,Z,J,Q){return $+J>Q?Z:J}function SI($,Z,J){return $<0?Z:J}function yi($){return Math.max(0,$)}function xG($){return Math.max(0,$)}var Fq=($,Z,J)=>{let{left:Q,height:X,width:G}=Z,H=$.top-(X-$.height);return{left:Q,width:G,height:SI(H,$.height,X),top:xG(H)}},Vq=($,Z,J)=>{let{top:Q,left:X,height:G,width:H}=Z;return{top:Q,height:G,width:bi($.left,$.width,H,J),left:yi(X)}},Lq=($,Z,J)=>{let{top:Q,height:X,width:G}=Z,H=$.left+$.width-G;if(H<0)return{height:X,width:$.left+$.width,top:xG(Q),left:0};return{height:X,width:G,top:xG(Q),left:H}},Nq=($,Z,J)=>{let{top:Q,left:X,height:G,width:H}=Z;return{width:H,left:X,height:SI(Q,$.height,G),top:xG(Q)}},xi=($,Z,J)=>Fq($,Vq($,Z,J)),hi=($,Z,J)=>Fq($,Lq($,Z)),vi=($,Z,J)=>Nq($,Vq($,Z,J)),gi=($,Z,J)=>Nq($,Lq($,Z)),fi={n:Fq,ne:xi,e:Vq,se:vi,s:Nq,sw:gi,w:Lq,nw:hi};function RI($,Z,J,Q){let X=fi[$];if(!X)return J;return X(Z,{...Z,...J},Q)}var mi={type:"transform",scale:1,calcStyle($){return hG($)}};var bI=mi,yI={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},xI={enabled:!0,bounded:!1,threshold:3},hI={enabled:!0,handles:["se"]},vI={enabled:!1,defaultItem:{w:1,h:1}};function _q($,Z,J,Q,X){let G=Q==="x"?"w":"h";Z[Q]+=1;let H=$.findIndex((K)=>K.i===Z.i),z=X??YZ($).length>0;for(let K=H+1;K<$.length;K++){let Y=$[K];if(Y===void 0)continue;if(Y.static)continue;if(!z&&Y.y>Z.y+Z.h)break;if(yG(Z,Y))_q($,Y,J+Z[G],Q,z)}Z[Q]=J}function ui($,Z,J,Q){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0),Z.y=Math.min(Q,Z.y);while(Z.y>0&&!W9($,Z))Z.y--;let X;while((X=W9($,Z))!==void 0)_q(J,Z,X.y+X.h,"y");return Z.y=Math.max(Z.y,0),Z}function pi($,Z,J,Q){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0);while(Z.x>0&&!W9($,Z))Z.x--;let X;while((X=W9($,Z))!==void 0)if(_q(Q,Z,X.x+X.w,"x"),Z.x+Z.w>J){Z.x=J-Z.w,Z.y++;while(Z.x>0&&!W9($,Z))Z.x--}return Z.x=Math.max(Z.x,0),Z}var qZ={type:"vertical",allowOverlap:!1,compact($,Z){let J=YZ($),Q=KZ(J),X=bG($),G=Array($.length);for(let H=0;H<X.length;H++){let z=X[H];if(z===void 0)continue;let K=A7(z);if(!K.static)K=ui(J,K,X,Q),Q=Math.max(Q,K.y+K.h),J.push(K);let Y=$.indexOf(z);G[Y]=K,K.moved=!1}return G}},Mq={type:"horizontal",allowOverlap:!1,compact($,Z){let J=YZ($),Q=Yq($),X=Array($.length);for(let G=0;G<Q.length;G++){let H=Q[G];if(H===void 0)continue;let z=A7(H);if(!z.static)z=pi(J,z,Z,Q),J.push(z);let K=$.indexOf(H);X[K]=z,z.moved=!1}return X}},Aq={type:null,allowOverlap:!1,compact($,Z){return H3($)}},ci={...qZ,allowOverlap:!0,compact($,Z){return H3($)}},di={...Mq,allowOverlap:!0,compact($,Z){return H3($)}},li={...Aq,allowOverlap:!0};function Dq($,Z=!1,J=!1){let Q;if(Z)if($==="vertical")Q=ci;else if($==="horizontal")Q=di;else Q=li;else if($==="vertical")Q=qZ;else if($==="horizontal")Q=Mq;else Q=Aq;if(J)return{...Q,preventCollision:J};return Q}var _4=O(v(),1);function wq($={}){let{measureBeforeMount:Z=!1,initialWidth:J=1280}=$,[Q,X]=_4.useState(J),[G,H]=_4.useState(!Z),z=_4.useRef(null),K=_4.useRef(null),Y=_4.useCallback(()=>{let W=z.current;if(W){let q=W.offsetWidth;if(X(q),!G)H(!0)}},[G]);return _4.useEffect(()=>{let W=z.current;if(!W)return;if(Y(),typeof ResizeObserver<"u"){let q=null;return K.current=new ResizeObserver((B)=>{let U=B[0];if(U){let F=U.contentRect.width;if(q!==null)cancelAnimationFrame(q);q=requestAnimationFrame(()=>{X(F),q=null})}}),K.current.observe(W),()=>{if(q!==null)cancelAnimationFrame(q);if(K.current)K.current.disconnect(),K.current=null}}return()=>{if(K.current)K.current.disconnect(),K.current=null}},[Y]),{width:Q,mounted:G,containerRef:z,measureWidth:Y}}var D0=O(v(),1),xT=O(lG(),1),hT=O(RT(),1);var w7=O(l(),1),_6=O(fI(),1);function pq($){let{children:Z,cols:J,containerWidth:Q,margin:X,containerPadding:G,rowHeight:H,maxRows:z,isDraggable:K,isResizable:Y,isBounded:W,static:q,useCSSTransforms:B=!0,usePercentages:U=!1,transformScale:F=1,positionStrategy:V,dragThreshold:N=0,droppingPosition:L,className:_="",style:w,handle:A="",cancel:D="",x:M,y:j,w:T,h:E,minW:C=1,maxW:g=1/0,minH:b=1,maxH:k=1/0,i:x,resizeHandles:R,resizeHandle:I,constraints:S=qq,layoutItem:h,layout:p=[],onDragStart:P,onDrag:t,onDragStop:z0,onResizeStart:y,onResize:n,onResizeStop:_0}=$,[c,X0]=D0.useState(!1),[K0,Z0]=D0.useState(!1),G0=D0.useRef(null),U0=D0.useRef({left:0,top:0}),m=D0.useRef({top:0,left:0,width:0,height:0}),s=D0.useRef(void 0),u=D0.useRef(p);u.current=p;let F0=D0.useRef(null),i=D0.useRef(null),Y0=D0.useRef(!1),r=D0.useRef({x:0,y:0}),e=D0.useRef(!1),q0=D0.useMemo(()=>({cols:J,containerPadding:G,containerWidth:Q,margin:X,maxRows:z,rowHeight:H}),[J,G,Q,X,z,H]),a=D0.useMemo(()=>({cols:J,maxRows:z,containerWidth:Q,containerHeight:0,rowHeight:H,margin:X,layout:[]}),[J,z,Q,H,X]),A0=D0.useCallback(()=>({...a,layout:u.current}),[a]),I0=D0.useMemo(()=>h??{i:x,x:M,y:j,w:T,h:E,minW:C,maxW:g,minH:b,maxH:k},[h,x,M,j,T,E,C,g,b,k]),i0=D0.useCallback((E0)=>{if(V?.calcStyle)return V.calcStyle(E0);if(B)return hG(E0);let x0=Bq(E0);if(U)return{...x0,left:Uq(E0.left/Q),width:Uq(E0.width/Q)};return x0},[V,B,U,Q]),z1=D0.useCallback((E0,{node:x0})=>{if(!P)return;let{offsetParent:r0}=x0;if(!r0)return;let a0=r0.getBoundingClientRect(),Y1=x0.getBoundingClientRect(),F1=Y1.left/F,C1=a0.left/F,p1=Y1.top/F,K1=a0.top/F,c1;if(V?.calcDragPosition){let u0=E0;c1=V.calcDragPosition(u0.clientX,u0.clientY,u0.clientX-Y1.left,u0.clientY-Y1.top)}else c1={left:F1-C1+r0.scrollLeft,top:p1-K1+r0.scrollTop};if(U0.current=c1,N>0){let u0=E0;r.current={x:u0.clientX,y:u0.clientY},Y0.current=!0,e.current=!1,X0(!0);return}X0(!0);let z5=zZ(q0,c1.top,c1.left),{x:U5,y:P0}=WZ(S,I0,z5.x,z5.y,A0());P(x,U5,P0,{e:E0,node:x0,newPosition:c1})},[P,F,q0,V,N,S,I0,A0,x]),f=D0.useCallback((E0,{node:x0,deltaX:r0,deltaY:a0})=>{if(!t||!c)return;let Y1=E0;if(Y0.current&&!e.current){let U5=Y1.clientX-r.current.x,P0=Y1.clientY-r.current.y;if(Math.hypot(U5,P0)<N)return;if(e.current=!0,Y0.current=!1,P){let k0=zZ(q0,U0.current.top,U0.current.left),{x:s0,y:W1}=WZ(S,I0,k0.x,k0.y,A0());P(x,s0,W1,{e:E0,node:x0,newPosition:U0.current})}}let F1=U0.current.top+a0,C1=U0.current.left+r0;if(W){let{offsetParent:U5}=x0;if(U5){let P0=U5.clientHeight-N4(E,H,X[1]);F1=GZ(F1,0,P0);let u0=Y9(q0),k0=Q-N4(T,u0,X[0]);C1=GZ(C1,0,k0)}}let p1={top:F1,left:C1};U0.current=p1;let K1=zZ(q0,F1,C1),{x:c1,y:z5}=WZ(S,I0,K1.x,K1.y,A0());t(x,c1,z5,{e:E0,node:x0,newPosition:p1})},[t,P,c,N,W,E,H,X,q0,Q,T,x,S,I0,A0]),d=D0.useCallback((E0,{node:x0})=>{if(!z0||!c)return;let r0=Y0.current;if(Y0.current=!1,e.current=!1,r.current={x:0,y:0},r0){X0(!1),U0.current={left:0,top:0};return}let{left:a0,top:Y1}=U0.current,F1={top:Y1,left:a0};X0(!1),U0.current={left:0,top:0};let C1=zZ(q0,Y1,a0),{x:p1,y:K1}=WZ(S,I0,C1.x,C1.y,A0());z0(x,p1,K1,{e:E0,node:x0,newPosition:F1})},[z0,c,q0,S,I0,A0,x]);F0.current=z1,i.current=f;let $0=D0.useCallback((E0,{node:x0,size:r0,handle:a0},Y1,F1)=>{let C1=F1==="onResizeStart"?y:F1==="onResize"?n:_0;if(!C1)return;let p1;if(x0)p1=RI(a0,Y1,r0,Q);else p1={...r0,top:Y1.top,left:Y1.left};m.current=p1;let K1=TI(q0,p1.width,p1.height),{w:c1,h:z5}=EI(S,I0,K1.w,K1.h,a0,A0());C1(x,c1,z5,{e:E0.nativeEvent,node:x0,size:p1,handle:a0})},[y,n,_0,Q,q0,x,S,I0,A0]),V0=D0.useCallback((E0,x0)=>{Z0(!0);let r0=HZ(q0,M,j,T,E),a0={...x0,handle:x0.handle};$0(E0,a0,r0,"onResizeStart")},[$0,q0,M,j,T,E]),j0=D0.useCallback((E0,x0)=>{let r0=HZ(q0,M,j,T,E),a0={...x0,handle:x0.handle};$0(E0,a0,r0,"onResize")},[$0,q0,M,j,T,E]),g0=D0.useCallback((E0,x0)=>{Z0(!1),m.current={top:0,left:0,width:0,height:0};let r0=HZ(q0,M,j,T,E),a0={...x0,handle:x0.handle};$0(E0,a0,r0,"onResizeStop")},[$0,q0,M,j,T,E]);D0.useEffect(()=>{if(!L)return;let E0=G0.current;if(!E0)return;let x0=s.current||{left:0,top:0},r0=c&&(L.left!==x0.left||L.top!==x0.top);if(!c){let a0={node:E0,deltaX:L.left,deltaY:L.top,lastX:0,lastY:0,x:L.left,y:L.top};F0.current?.(L.e,a0)}else if(r0){let a0=L.left-U0.current.left,Y1=L.top-U0.current.top,F1={node:E0,deltaX:a0,deltaY:Y1,lastX:U0.current.left,lastY:U0.current.top,x:L.left,y:L.top};i.current?.(L.e,F1)}s.current=L},[L,c,x]);let D1=HZ(q0,M,j,T,E,c?U0.current:null,K0?m.current:null),h1=D0.default.Children.only(Z),h0=Y9(q0),d0=[N4(C,h0,X[0]),N4(b,H,X[1])],t0=[N4(g,h0,X[0]),N4(k,H,X[1])],m0=h1.props,X1=m0.className,q5=m0.style,v1=D0.default.cloneElement(h1,{ref:G0,className:cq("react-grid-item",X1,_,{static:q,resizing:K0,"react-draggable":K,"react-draggable-dragging":c,dropping:Boolean(L),cssTransforms:B}),style:{...w,...q5,...i0(D1)}}),B5=I;return v1=w7.jsx(hT.Resizable,{draggableOpts:{disabled:!Y},className:Y?void 0:"react-resizable-hide",width:D1.width,height:D1.height,minConstraints:d0,maxConstraints:t0,onResizeStart:V0,onResize:j0,onResizeStop:g0,transformScale:F,resizeHandles:R,handle:B5,children:v1}),v1=w7.jsx(xT.DraggableCore,{disabled:!K,onStart:z1,onDrag:f,onStop:d,handle:A,cancel:".react-resizable-handle"+(D?","+D:""),scale:F,nodeRef:G0,children:v1}),v1}var D7=()=>{},bT="react-grid-layout",vT=!1;try{vT=/firefox/i.test(navigator.userAgent)}catch{}function Xs($,Z){let J=D0.default.Children.toArray($),Q=D0.default.Children.toArray(Z);if(J.length!==Q.length)return!1;for(let X=0;X<J.length;X++){let G=J[X],H=Q[X];if(G?.key!==H?.key)return!1}return!0}function yT($,Z,J,Q){let X=[],G=new Set;D0.default.Children.forEach(Z,(z)=>{if(!D0.default.isValidElement(z)||z.key===null)return;let K=String(z.key);G.add(K);let Y=$.find((W)=>W.i===K);if(Y)X.push(A7(Y));else{let q=z.props["data-grid"];if(q)X.push({i:K,x:q.x??0,y:q.y??0,w:q.w??1,h:q.h??1,minW:q.minW,maxW:q.maxW,minH:q.minH,maxH:q.maxH,static:q.static,isDraggable:q.isDraggable,isResizable:q.isResizable,resizeHandles:q.resizeHandles,isBounded:q.isBounded});else X.push({i:K,x:0,y:KZ(X),w:1,h:1})}});let H=Wq(X,{cols:J});return Q.compact(H,J)}function NZ($){let{children:Z,width:J,gridConfig:Q,dragConfig:X,resizeConfig:G,dropConfig:H,positionStrategy:z=bI,compactor:K,constraints:Y=qq,layout:W=[],droppingItem:q,autoSize:B=!0,className:U="",style:F={},innerRef:V,onLayoutChange:N=D7,onDragStart:L=D7,onDrag:_=D7,onDragStop:w=D7,onResizeStart:A=D7,onResize:D=D7,onResizeStop:M=D7,onDrop:j=D7,onDropDragOver:T=D7}=$,E=D0.useMemo(()=>({...yI,...Q}),[Q]),C=D0.useMemo(()=>({...xI,...X}),[X]),g=D0.useMemo(()=>({...hI,...G}),[G]),b=D0.useMemo(()=>({...vI,...H}),[H]),{cols:k,rowHeight:x,maxRows:R,margin:I,containerPadding:S}=E,{enabled:h,bounded:p,handle:P,cancel:t,threshold:z0}=C,{enabled:y,handles:n,handleComponent:_0}=g,{enabled:c,defaultItem:X0,onDragOver:K0}=b,Z0=K??Dq("vertical"),G0=Z0.type,U0=Z0.allowOverlap,m=Z0.preventCollision??!1,s=D0.useMemo(()=>q??{i:"__dropping-elem__",...X0},[q,X0]),u=z.type==="transform",F0=z.scale,i=S??I,[Y0,r]=D0.useState(!1),[e,q0]=D0.useState(()=>yT(W,Z,k,Z0)),[a,A0]=D0.useState(null),[I0,i0]=D0.useState(!1),[z1,f]=D0.useState(null),[d,$0]=D0.useState(),V0=D0.useRef(null),j0=D0.useRef(null),g0=D0.useRef(null),D1=D0.useRef(0),h1=D0.useRef(e),h0=D0.useRef(W),d0=D0.useRef(Z),t0=D0.useRef(G0),m0=D0.useRef(e);m0.current=e,D0.useEffect(()=>{if(r(!0),!_6.deepEqual(e,W))N(e)},[]),D0.useEffect(()=>{if(a)return;if(z1)return;let P0=!_6.deepEqual(W,h0.current),u0=!Xs(Z,d0.current),k0=G0!==t0.current;if(P0||u0||k0){let W1=yT(P0?W:e,Z,k,Z0);if(!_6.deepEqual(W1,e))q0(W1)}h0.current=W,d0.current=Z,t0.current=G0},[W,Z,k,G0,Z0,a,z1,e]),D0.useEffect(()=>{if(!a&&!_6.deepEqual(e,h1.current)){h1.current=e;let P0=e.filter((u0)=>u0.i!==s.i);N(P0)}},[e,a,N,s.i]);let X1=D0.useMemo(()=>{if(!B)return;let P0=KZ(e),u0=i[1];return P0*x+(P0-1)*I[1]+u0*2+"px"},[B,e,x,I,i]),q5=D0.useCallback((P0,u0,k0,s0)=>{let W1=m0.current,V1=q9(W1,P0);if(!V1)return;let d1={w:V1.w,h:V1.h,x:V1.x,y:V1.y,i:P0};V0.current=A7(V1),g0.current=W1,A0(d1),L(W1,V1,V1,null,s0.e,s0.node)},[L]),v1=D0.useCallback((P0,u0,k0,s0)=>{let W1=m0.current,V1=V0.current,d1=q9(W1,P0);if(!d1)return;let k5={w:d1.w,h:d1.h,x:d1.x,y:d1.y,i:P0},l1=K9(W1,d1,u0,k0,!0,m,G0,k,U0);_(l1,V1,d1,k5,s0.e,s0.node),q0(Z0.compact(l1,k)),A0(k5)},[m,G0,k,U0,Z0,_]),B5=D0.useCallback((P0,u0,k0,s0)=>{if(!a)return;let W1=m0.current,V1=V0.current,d1=q9(W1,P0);if(!d1)return;let k5=K9(W1,d1,u0,k0,!0,m,G0,k,U0),l1=Z0.compact(k5,k);w(l1,V1,d1,null,s0.e,s0.node);let p5=g0.current;if(V0.current=null,g0.current=null,A0(null),q0(l1),p5&&!_6.deepEqual(p5,l1))N(l1)},[a,m,G0,k,U0,Z0,w,N]),E0=D0.useCallback((P0,u0,k0,s0)=>{let W1=m0.current,V1=q9(W1,P0);if(!V1)return;j0.current=A7(V1),g0.current=W1,i0(!0),A(W1,V1,V1,null,s0.e,s0.node)},[A]),x0=D0.useCallback((P0,u0,k0,s0)=>{let W1=m0.current,V1=j0.current,{handle:d1}=s0,k5=!1,l1,p5,[wZ,Q7]=kI(W1,P0,(s1)=>{if(l1=s1.x,p5=s1.y,["sw","w","nw","n","ne"].includes(d1)){if(["sw","nw","w"].includes(d1))l1=s1.x+(s1.w-u0),u0=s1.x!==l1&&l1<0?s1.w:u0,l1=l1<0?0:l1;if(["ne","n","nw"].includes(d1))p5=s1.y+(s1.h-k0),k0=s1.y!==p5&&p5<0?s1.h:k0,p5=p5<0?0:p5;k5=!0}if(m&&!U0){if(Kq(W1,{...s1,w:u0,h:k0,x:l1??s1.x,y:p5??s1.y}).filter((PZ)=>PZ.i!==s1.i).length>0)p5=s1.y,k0=s1.h,l1=s1.x,u0=s1.w,k5=!1}return s1.w=u0,s1.h=k0,s1});if(!Q7)return;let N3=wZ;if(k5&&l1!==void 0&&p5!==void 0)N3=K9(wZ,Q7,l1,p5,!0,m,G0,k,U0);let OZ={w:Q7.w,h:Q7.h,x:Q7.x,y:Q7.y,i:P0,static:!0};D(N3,V1,Q7,OZ,s0.e,s0.node),q0(Z0.compact(N3,k)),A0(OZ)},[m,G0,k,U0,Z0,D]),r0=D0.useCallback((P0,u0,k0,s0)=>{let W1=m0.current,V1=j0.current,d1=q9(W1,P0),k5=Z0.compact(W1,k);M(k5,V1,d1??null,null,s0.e,s0.node);let l1=g0.current;if(j0.current=null,g0.current=null,A0(null),i0(!1),q0(k5),l1&&!_6.deepEqual(l1,k5))N(k5)},[k,Z0,M,N]),a0=D0.useCallback(()=>{let P0=m0.current;if(!P0.some((s0)=>s0.i===s.i)){f(null),A0(null),$0(void 0);return}let k0=Z0.compact(P0.filter((s0)=>s0.i!==s.i),k);q0(k0),f(null),A0(null),$0(void 0)},[s.i,k,Z0]),Y1=D0.useCallback((P0)=>{if(P0.preventDefault(),P0.stopPropagation(),vT&&!P0.nativeEvent.target?.classList.contains(bT))return!1;let u0=K0?K0(P0.nativeEvent):T(P0);if(u0===!1){if(z1)a0();return!1}let{dragOffsetX:k0=0,dragOffsetY:s0=0,...W1}=u0??{},V1={...s,...W1},d1=P0.currentTarget.getBoundingClientRect(),k5={cols:k,margin:I,maxRows:R,rowHeight:x,containerWidth:J,containerPadding:i},l1=Y9(k5),p5=N4(V1.w,l1,I[0]),wZ=N4(V1.h,x,I[1]),Q7=p5/2,N3=wZ/2,OZ=P0.clientX-d1.left+k0-Q7,s1=P0.clientY-d1.top+s0-N3,zH=Math.max(0,OZ),PZ=Math.max(0,s1),jZ={left:zH/F0,top:PZ/F0,e:P0.nativeEvent};if(!z1){let KH=II(k5,PZ,zH,V1.w,V1.h);f(w7.jsx("div",{},V1.i)),$0(jZ);let wS=m0.current.filter((OS)=>OS.i!==V1.i);q0([...wS,{...V1,x:KH.x,y:KH.y,static:!1,isDraggable:!0}])}else if(d){if(d.left!==jZ.left||d.top!==jZ.top)$0(jZ)}},[z1,d,s,K0,T,a0,F0,k,I,R,x,J,i]),F1=D0.useCallback((P0)=>{if(P0.preventDefault(),P0.stopPropagation(),D1.current--,D1.current<0)D1.current=0;if(D1.current===0)a0()},[a0]),C1=D0.useCallback((P0)=>{P0.preventDefault(),P0.stopPropagation(),D1.current++},[]),p1=D0.useCallback((P0)=>{P0.preventDefault(),P0.stopPropagation();let u0=m0.current,k0=u0.find((s0)=>s0.i===s.i);D1.current=0,a0(),j(u0,k0,P0.nativeEvent)},[s.i,a0,j]),K1=D0.useCallback((P0,u0)=>{if(!P0||!P0.key)return null;let k0=q9(e,String(P0.key));if(!k0)return null;let s0=typeof k0.isDraggable==="boolean"?k0.isDraggable:!k0.static&&h,W1=typeof k0.isResizable==="boolean"?k0.isResizable:!k0.static&&y,V1=k0.resizeHandles||[...n],d1=s0&&p&&k0.isBounded!==!1,k5=_0;return w7.jsx(pq,{containerWidth:J,cols:k,margin:I,containerPadding:i,maxRows:R,rowHeight:x,cancel:t,handle:P,onDragStart:q5,onDrag:v1,onDragStop:B5,onResizeStart:E0,onResize:x0,onResizeStop:r0,isDraggable:s0,isResizable:W1,isBounded:d1,useCSSTransforms:u&&Y0,usePercentages:!Y0,transformScale:F0,positionStrategy:z,dragThreshold:z0,w:k0.w,h:k0.h,x:k0.x,y:k0.y,i:k0.i,minH:k0.minH,minW:k0.minW,maxH:k0.maxH,maxW:k0.maxW,static:k0.static,droppingPosition:u0?d:void 0,resizeHandles:V1,resizeHandle:k5,constraints:Y,layoutItem:k0,layout:e,children:P0},k0.i)},[e,J,k,I,i,R,x,t,P,q5,v1,B5,E0,x0,r0,h,y,p,u,Y0,F0,z,z0,d,n,_0,Y]),c1=()=>{if(!a)return null;return w7.jsx(pq,{w:a.w,h:a.h,x:a.x,y:a.y,i:a.i,className:`react-grid-placeholder ${I0?"placeholder-resizing":""}`,containerWidth:J,cols:k,margin:I,containerPadding:i,maxRows:R,rowHeight:x,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:u,transformScale:F0,constraints:Y,layout:e,children:w7.jsx("div",{})})},z5=cq(bT,U),U5={height:X1,...F};return w7.jsxs("div",{ref:V,className:z5,style:U5,onDrop:c?p1:void 0,onDragLeave:c?F1:void 0,onDragEnter:c?C1:void 0,onDragOver:c?Y1:void 0,children:[D0.default.Children.map(Z,(P0)=>{if(!D0.default.isValidElement(P0))return null;return K1(P0)}),c&&z1&&K1(z1,!0),c1()]})}var B3=O(l(),1);function gT({cols:$=4,rowHeight:Z=160,gap:J=8,items:Q,editing:X,renderItem:G,onLayoutChange:H,onRemove:z}){let[K,Y]=_Z.useState(()=>XZ(Q,[])),[W,q]=_Z.useState(Q),{width:B,containerRef:U,mounted:F}=wq({measureBeforeMount:!0});if(W!==Q)q(Q),Y((N)=>{let L=new Map(N.map((D)=>[D.i,D])),_=Q.filter((D)=>L.has(D.id)).map((D)=>({...L.get(D.id),w:D.w,h:D.h})),w=new Set(_.map((D)=>D.i)),A=XZ(Q.filter((D)=>!w.has(D.id)),_);return[..._,...A]});let V=_Z.useCallback((N)=>{Y(N),H?.(N.map((L)=>({id:L.i,w:L.w,h:L.h,x:L.x,y:L.y})))},[H]);return B3.jsx("div",{ref:U,children:F&&B3.jsx(NZ,{width:B,layout:K,gridConfig:{cols:$,rowHeight:Z,margin:[J,J],containerPadding:[0,0]},dragConfig:{enabled:!!X},resizeConfig:{enabled:!1},compactor:qZ,onLayoutChange:V,children:K.map((N)=>B3.jsx("div",{children:B3.jsx(T1.div,{layoutId:N.i,className:"size-full",transition:{type:"spring",duration:0.35,bounce:0},children:B3.jsx(RG,{editing:X,onRemove:z?()=>z(N.i):void 0,children:G(N.i)})})},N.i))})})}var S1=O(l(),1);function fT($){return S1.jsx(wI,{name:$})}function Hs({onCreateWidget:$}){return S1.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3",children:[S1.jsx("p",{className:"text-sm text-muted-foreground",children:"No widgets created yet"}),S1.jsxs(C0,{type:"button",variant:"secondary",size:"sm",onClick:$,children:[S1.jsx(t5,{"data-icon":"inline-start",stroke:1.75}),"Create widget"]})]})}function zs(){return S1.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3",children:S1.jsx("p",{className:"text-sm text-muted-foreground",children:"No widgets added yet"})})}function Ks(){let[$,Z]=sG.useState(0);return[sG.useCallback((Q)=>{if(!Q)return;let X=new ResizeObserver(([G])=>{let H=G.borderBoxSize?.[0];Z(H?H.blockSize:G.contentRect.height)});return X.observe(Q),()=>X.disconnect()},[]),$]}function uT({onCreateWidget:$,editing:Z,onEditingChange:J,widgets:Q}){let{layout:X,setLayout:G}=Q5(),H=new Set(X.widgetGrid.map((F)=>F.i)),z=X.widgetGrid.filter((F)=>Q.some((V)=>V.id===F.i)).map((F)=>{let V=Q.find((N)=>N.id===F.i);return{id:F.i,w:V.config.colSpan,h:V.config.rowSpan,x:F.x,y:F.y}}),K=Q.filter((F)=>!H.has(F.id)).map((F)=>({id:F.id,w:F.config.colSpan,h:F.config.rowSpan})),[Y,W]=Ks(),q=Z&&K.length>0;function B(F){G({widgetGrid:X.widgetGrid.filter((V)=>V.i!==F)})}function U(F){let V=Q.find((_)=>_.id===F);if(!V)return;let N=X.widgetGrid.map((_)=>{let w=Q.find((A)=>A.id===_.i);return{..._,w:w?.config.colSpan??1,h:w?.config.rowSpan??1}}),L=QZ(N,V.config.colSpan,V.config.rowSpan,4);G({widgetGrid:[...X.widgetGrid,{i:F,x:L.x,y:L.y}]})}if(Q.length===0)return S1.jsx(Hs,{onCreateWidget:$});return S1.jsx("div",{className:"group/widgets relative min-h-0 flex-1",children:S1.jsxs(mT,{children:[S1.jsxs("div",{className:"flex h-full flex-col overflow-y-auto p-4",children:[S1.jsxs("div",{className:"mx-auto mb-4 flex w-full max-w-[var(--column-w)] shrink-0 items-center justify-end gap-2",children:[Z&&S1.jsxs(C0,{type:"button",variant:"ghost",size:"sm",className:"mr-auto",onClick:$,children:[S1.jsx(t5,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),S1.jsx(g8,{mode:"popLayout",initial:!1,children:Z?S1.jsx(T1.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:S1.jsx(C0,{type:"button",size:"sm",onClick:()=>J(!1),children:"Done"})},"done"):S1.jsx(T1.div,{className:"flex items-center gap-1",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:S1.jsx(C0,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground group-hover/widgets:opacity-100 [@media(hover:hover)]:opacity-0",onClick:()=>J(!0),children:"Edit widgets"})},"actions")})]}),z.length===0?S1.jsx(T1.div,{className:"mx-auto flex min-h-0 w-full max-w-[var(--column-w)] flex-1 flex-col",animate:{paddingBottom:q?W:0},transition:{type:"spring",duration:0.3,bounce:0},children:S1.jsx(zs,{})}):S1.jsx(T1.div,{className:"mx-auto w-full max-w-[var(--column-w)]",animate:{marginBottom:q?W:0},transition:{type:"spring",duration:0.3,bounce:0},children:S1.jsx(gT,{items:z,editing:Z,renderItem:fT,onRemove:B,onLayoutChange:(F)=>G({widgetGrid:F.map((V)=>({i:V.id,x:V.x??0,y:V.y??0}))})})})]}),S1.jsx(g8,{children:Z&&K.length>0&&S1.jsx(jI,{ref:Y,items:K,renderItem:fT,onRestore:U})})]})})}var cT=O(l(),1);function pT({children:$}){return cT.jsx("header",{className:"@container flex h-11 shrink-0 items-center gap-2.5 border-b border-border/75 px-3",children:$})}var eq=O(v(),1);var dq=O(v(),1);var D8=O(l(),1);function nG({title:$,description:Z,children:J}){return D8.jsxs("div",{className:"flex flex-col gap-6",children:[D8.jsxs("header",{className:"flex flex-col gap-1",children:[D8.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:$}),Z&&D8.jsx("p",{className:"text-sm text-muted-foreground",children:Z})]}),J]})}function U3({label:$,children:Z}){return D8.jsxs("section",{className:"flex flex-col gap-2",children:[$&&D8.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:$}),D8.jsx("div",{className:"flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-lg border border-border bg-card text-card-foreground",children:Z})]})}function MZ({title:$,description:Z,control:J}){return D8.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[D8.jsxs("div",{className:"flex min-w-0 flex-col",children:[D8.jsx("span",{className:"text-sm font-medium",children:$}),Z&&D8.jsx("span",{className:"text-xs text-muted-foreground",children:Z})]}),J&&D8.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:J})]})}function dT($){return F5({queryKey:T0.env($),queryFn:()=>f1(`/api/workspaces/${$}/env`),...p7})}function lT($){let Z=I1();return c5({mutationFn:(J)=>f1(`/api/workspaces/${$}/env`,Q4("PUT",J)),onSuccess:(J)=>{Z.setQueryData(T0.env($),J)}})}function iT($){let Z=I1();return c5({mutationFn:(J)=>M9(`/api/workspaces/${$}/config`,Q4("PUT",{name:J}),"Failed to save name"),onSuccess:()=>{Z.invalidateQueries({queryKey:T0.layout($)}),Z.invalidateQueries({queryKey:T0.all})}})}function rT($){let Z=I1();return c5({scope:{id:`workspace-icon:${$}`},mutationFn:(J)=>f1(`/api/workspaces/${$}/icon`,{method:"PUT",headers:{"Content-Type":J.type||"application/octet-stream"},body:J}),onSuccess:()=>{Z.invalidateQueries({queryKey:T0.layout($)}),Z.invalidateQueries({queryKey:T0.all})}})}function aT($){let Z=I1();return c5({scope:{id:`workspace-icon:${$}`},mutationFn:()=>M9(`/api/workspaces/${$}/icon`,{method:"DELETE"},"Failed to reset icon"),onSuccess:()=>{Z.invalidateQueries({queryKey:T0.layout($)}),Z.invalidateQueries({queryKey:T0.all})}})}function sT($){let Z=I1();return W7((J)=>{if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:T0.env($)})}),{env:dT($),update:lT($)}}var $5=O(l(),1),Ys={dotenv:".env",custom:"secret",both:"override"},Ws=/^[A-Za-z_][A-Za-z0-9_]*$/;function oT(){let{workspaceId:$}=Q5(),{env:Z,update:J}=sT($),[Q,X]=dq.useState(""),[G,H]=dq.useState(""),z=Ws.test(Q),K=z&&G.length>0&&!J.isPending,Y=()=>{if(!K)return;J.mutate({set:{[Q]:G}},{onSuccess:()=>{X(""),H("")}})},W=Z.data?.vars??[],q=Z.data?.files.reduce((U,F)=>U+F.count,0)??0,B=Z.data?.files.length??0;return $5.jsxs(nG,{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:[$5.jsxs(U3,{label:"Variables",children:[Z.isLoading?$5.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:$5.jsx(l5,{className:"size-4 animate-spin",stroke:1.75})}):W.length===0?$5.jsx("p",{className:"px-3.5 py-4 text-sm text-muted-foreground",children:"No variables yet."}):W.map((U)=>{let F=U.source!=="dotenv";return $5.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[$5.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:U.key}),$5.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),$5.jsx("span",{className:B0("rounded-sm px-1.5 py-0.5 text-[11px] font-medium",U.source==="dotenv"?"bg-muted text-muted-foreground":"bg-primary/10 text-primary"),children:Ys[U.source]}),!F&&$5.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),$5.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>J.mutate({remove:[U.key]}),disabled:!F,"aria-label":`Delete ${U.key}`,className:"disabled:invisible",children:$5.jsx(nT,{stroke:1.75})})]},U.key)}),$5.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[$5.jsx(i9,{value:Q,onChange:(U)=>X(U.target.value),placeholder:"NEW_KEY","aria-invalid":Q.length>0&&!z,className:"h-7 w-40 font-mono text-xs"}),$5.jsx(i9,{value:G,onChange:(U)=>H(U.target.value),onKeyDown:(U)=>{if(U.key==="Enter")Y()},type:"password",placeholder:"value",className:"h-7 flex-1 text-xs"}),$5.jsxs(C0,{variant:"outline",size:"sm",onClick:Y,disabled:!K,children:[J.isPending?$5.jsx(l5,{stroke:1.75,className:"animate-spin"}):$5.jsx(t5,{stroke:1.75}),"Add"]})]})]}),$5.jsx(U3,{label:"From .env files",children:$5.jsx(MZ,{title:"Inherit .env files",description:B>0?`Discovered ${q} ${q===1?"key":"keys"} across ${B} ${B===1?"file":"files"} in this space.`:"No .env files found in this space.",control:$5.jsx(TX,{checked:Z.data?.inheritDotenv??!0,disabled:Z.isLoading,onCheckedChange:(U)=>J.mutate({inheritDotenv:U})})})})]})}var tE=O(v(),1);var u5=O(v(),1);var b0=O(v(),1),F3=O(v(),1),x8=O(v(),1),Mk=O(l(),1),tG=O(v(),1),eG=O(v(),1),Q1=O(l(),1),qs=Object.defineProperty,Bs=($,Z)=>{for(var J in Z)qs($,J,{get:Z[J],enumerable:!0})},O7={};Bs(O7,{ActiveEmoji:()=>xk,Empty:()=>yk,List:()=>Sk,Loading:()=>bk,Root:()=>Pk,Search:()=>jk,SkinTone:()=>hk,SkinToneSelector:()=>Rk,Viewport:()=>Ck});var Uk="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",rq=["none","light","medium-light","medium","medium-dark","dark"];function lq($){return $.charAt(0).toUpperCase()+$.slice(1)}var A4=2,Q8=null;function tT($){try{Q8??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!Q8||(queueMicrotask(()=>{Q8&&(Q8=null)}),Q8.canvas.width=A4,Q8.canvas.height=A4,Q8.font=`2px ${Uk}`,Q8.textBaseline="middle",Q8.measureText($).width>=A4*2))return!1;Q8.fillStyle="#00f",Q8.fillText($,0,0);let Z=Q8.getImageData(0,0,A4,A4).data;Q8.clearRect(0,0,A4,A4),Q8.fillStyle="#f00",Q8.fillText($,0,0);let J=Q8.getImageData(0,0,A4,A4).data;for(let Q=0;Q<A4*A4*4;Q+=4)if(Z[Q]!==J[Q]||Z[Q+1]!==J[Q+1]||Z[Q+2]!==J[Q+2])return!1;return!0}function eT($,Z,J){try{let Q=$.getItem(Z);if(!Q)throw Error(`No value found for "${Z}".`);let X=JSON.parse(Q);return J(X)}catch{return null}}function Fk($,Z,J){$.setItem(Z,JSON.stringify(J))}function $k($){return(Z)=>Z===void 0?void 0:$(Z)}function Zk($){return(Z)=>Z===null?null:$(Z)}function m5($){if(typeof $!="string")throw Error();return $}function oG($){if(typeof $!="number")throw Error();return $}function Vk($){if(typeof $!="boolean")throw Error();return $}function F9($){return(Z)=>{if(typeof Z!="object"||Z===null)throw Error();let J={};for(let Q in $){let X=Z[Q];X===void 0&&$[Q](void 0),J[Q]=$[Q](X)}return J}}function iq($){return(Z)=>{if(!Array.isArray(Z))throw Error();return Z.length>0&&$(Z[0]),Z}}var Lk=($,Z)=>`${$}/${Z}/data.json`,Nk=($,Z)=>`${$}/${Z}/messages.json`,Us=["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"],Jk="en",_k=($)=>`frimousse/data/${$}`,Qk="frimousse/metadata";async function Xk($,Z){try{return(await fetch($,{method:"HEAD",signal:Z})).headers.get("etag")}catch{return null}}async function Fs($,Z,J){let[{emojis:Q,emojisEtag:X},{messages:G,messagesEtag:H}]=await Promise.all([fetch(Lk($,Z),{signal:J}).then(async(z)=>({emojis:await z.json(),emojisEtag:z.headers.get("etag")})),fetch(Nk($,Z),{signal:J}).then(async(z)=>({messages:await z.json(),messagesEtag:z.headers.get("etag")}))]);return{emojis:Q,messages:G,emojisEtag:X,messagesEtag:H}}async function Vs($,Z,J){let[Q,X]=await Promise.all([Xk(Lk($,Z),J),Xk(Nk($,Z),J)]);return{emojisEtag:Q,messagesEtag:X}}function Ls($){return $.skins?$.skins.filter((Z)=>typeof Z.tone=="number").reduce((Z,J)=>{let Q=rq[J.tone];return Z[Q]=J.emoji,Z},{}):void 0}async function Gk($,Z,J){let{emojis:Q,emojisEtag:X,messages:G,messagesEtag:H}=await Fs($,Z,J),z=G.subgroups.find((F)=>F.key==="country-flag"||F.key==="subdivision-flag"),K=G.groups.filter((F)=>F.key!=="component"),Y=Q.filter((F)=>("group"in F)),W=K.map((F)=>({index:F.order,label:lq(F.message)})),q=G.skinTones.reduce((F,V)=>(F[V.key]=lq(V.message),F),{}),B=Y.map((F)=>({emoji:F.emoji,category:F.group,version:F.version,label:lq(F.label),tags:F.tags??[],countryFlag:z&&F.subgroup===z.order||void 0,skins:Ls(F)})),U={locale:Z,emojis:B,categories:W,skinTones:q};return Fk(localStorage,_k(Z),{data:U,metadata:{emojisEtag:X,messagesEtag:H}}),U}function Ns($,Z){let J=new Map;for(let H of $)J.has(H.version)||J.set(H.version,H.emoji);let Q=[...J.keys()].sort((H,z)=>z-H),X=Q[0]??0,G=tT("\uD83C\uDDEA\uD83C\uDDFA");if(typeof Z=="number")return{emojiVersion:Z,countryFlags:G};for(let H of Q){let z=J.get(H);if(tT(z))return{emojiVersion:H,countryFlags:G}}return{emojiVersion:X,countryFlags:G}}var _s=F9({emojiVersion:oG,countryFlags:Vk}),Ms=F9({data:F9({locale:m5,emojis:iq(F9({emoji:m5,category:oG,label:m5,version:oG,tags:iq(m5),countryFlag:$k(Vk),skins:$k(F9({light:m5,"medium-light":m5,medium:m5,"medium-dark":m5,dark:m5}))})),categories:iq(F9({index:oG,label:m5})),skinTones:F9({light:m5,"medium-light":m5,medium:m5,"medium-dark":m5,dark:m5})}),metadata:F9({emojisEtag:Zk(m5),messagesEtag:Zk(m5)})});async function As({locale:$,emojiVersion:Z,emojibaseUrl:J,signal:Q}){let X=typeof J=="string"?J:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof Z=="number"?Math.floor(Z):"latest"}`,G=eT(sessionStorage,Qk,_s),H=eT(localStorage,_k($),Ms),z;if(!H)z=await Gk(X,$,Q);else if(G)z=H.data;else try{let{emojisEtag:Y,messagesEtag:W}=await Vs(X,$,Q);z=!Y||!W||Y!==H.metadata.emojisEtag||W!==H.metadata.messagesEtag?await Gk(X,$,Q):H.data}catch{z=H.data}G??=Ns(z.emojis,Z),Fk(sessionStorage,Qk,G);let K=z.emojis.filter((Y)=>{let W=Y.version<=G.emojiVersion;return Y.countryFlag?W&&G.countryFlags:W});return{locale:$,emojis:K,categories:z.categories,skinTones:z.skinTones}}function Hk($){return Us.includes($)?$:(console.warn(`Locale "${$}" is not supported, using "${Jk}" instead.`),Jk)}function zk($){return rq.includes($)?$:(console.warn(`Skin tone "${$}" is not valid, using "none" instead.`),"none")}function Ds($,Z){let J=[];if(Z<=0)return J;for(let Q=0,X=$.length;Q<X;Q+=Z)J.push($.slice(Q,Q+Z));return J}function ws($,Z){if(!Z)return $;let J=Z.toLowerCase().trim(),Q=new WeakMap;return $.filter((X)=>{let G=0;X.label.toLowerCase().includes(J)&&(G+=10);for(let H of X.tags)H.toLowerCase().includes(J)&&(G+=1);return G>0?(Q.set(X,G),!0):!1}).sort((X,G)=>(Q.get(G)??0)-(Q.get(X)??0))}function Os($,Z,J,Q){let X=ws($.emojis,Q),G=[],H=[],z=[],K={},Y=0,W=0;for(let q of X)K[q.category]||(K[q.category]=[]),K[q.category].push({emoji:J&&J!=="none"&&q.skins?q.skins[J]:q.emoji,label:q.label});for(let q of $.categories){let B=K[q.index];if(!B||B.length===0)continue;let U=Ds(Array.from(B),Z).map((F)=>({categoryIndex:Y,emojis:F}));G.push(...U),H.push({label:q.label,rowsCount:U.length,startRowIndex:W}),z.push(W),Y++,W+=U.length}return{count:X.length,categories:H,categoriesStartRowIndices:z,rows:G,skinTones:$.skinTones}}function Ps($){let Z={},J=null,Q=null,X=new Set,G=()=>{if(J){Z=J,J=null;for(let Y of X)Y(Z)}Q=null},H=()=>J??Z,z=(Y)=>{J??=Z,Object.assign(J,typeof Y=="function"?Y(H()):Y),Q||(Q=requestAnimationFrame(G))},K=(Y)=>(X.add(Y),()=>X.delete(Y));return Z=$(z,H),{get:H,set:z,subscribe:K}}function js($){let[Z]=x8.useState($);return Z}function Cs($){let Z=x8.createContext(null);return{useStore:()=>{let J=x8.useContext(Z);if(!J)throw Error($);return J},Provider:({store:J,children:Q})=>Mk.jsx(Z.Provider,{value:J,children:Q})}}function y8($,Z,J=Object.is){let[Q,X]=x8.useState(()=>Z($.get()));return x8.useEffect(()=>$.subscribe(()=>{let G=Z($.get());X((H)=>J(H,G)?H:G)}),[$,Z,J]),x8.useDebugValue(Q),Q}function J7($,Z,J){let Q=x8.useCallback((X)=>X[Z],[Z]);return y8($,Q,J)}var Kk=2;function Is($,Z,J,Q,X){let G=0;return Ps((H,z)=>({locale:Z,columns:J,sticky:Q,skinTone:X,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:(K)=>{let Y=z(),W=K?.data??Y.data,q=K?.categoryHeaderHeight??Y.categoryHeaderHeight,B=K?.rowHeight??Y.rowHeight,U=K?.viewportHeight??Y.viewportHeight;if(!W||W.rows.length===0||!q||!B||!U)return H({...K,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let F=0,V=0;for(let T of W.categories)if(V++*q+T.startRowIndex*B<G)F+=q;else break;let N=W.categories.length*q+W.rows.length*B,L=Math.floor(Kk*B/2),_=Math.ceil(Kk*B/2),w=Math.min(G-F-L,N-U),A=w+U+_,D=Math.max(0,Math.floor(w/B)),M=Math.min(W.rows.length-1,Math.ceil(A/B)),j=W.rows[D]?.categoryIndex;return H(j===void 0&&K?K:{...K,viewportStartCategoryIndex:j,viewportStartRowIndex:D,viewportEndRowIndex:M})},onDataChange:(K)=>{z().updateViewportState({data:K,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:(K)=>{H({search:K,interaction:K?"keyboard":"none"})},onActiveEmojiChange:(K,Y,W)=>{if(H({interaction:K,activeColumnIndex:Y,activeRowIndex:W}),K!=="keyboard")return;let{listRef:q,viewportRef:B,sticky:U,rowHeight:F,viewportHeight:V,categoryHeaderHeight:N}=z(),L=q?.current,_=B?.current;if(!L||!_||!F||!N||!V)return;let w=W;w===0&&_.scrollTo({top:0,behavior:"instant"});let A=L.querySelector(`[aria-rowindex="${w}"]`);if(!(A instanceof HTMLElement))return;let D=A.offsetTop,M=getComputedStyle(A),j=Number.parseFloat(M.scrollMarginTop),T=Number.parseFloat(M.scrollMarginBottom),E=G+j;U&&D<G+V/2&&(E+=N);let C=E+V-T;(D<E||D+F>C)&&_.scrollTo({top:Math.max(D<E+N?D-Math.max(U?N:0,j):D-V+F+T,0),behavior:"instant"})},onActiveEmojiReset:()=>{H({interaction:"none",activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:(K)=>{z().updateViewportState({rowHeight:K})},onCategoryHeaderHeightChange:(K)=>{z().updateViewportState({categoryHeaderHeight:K})},onViewportSizeChange:(K,Y)=>{z().updateViewportState({viewportWidth:K,viewportHeight:Y})},onViewportScroll:(K)=>{G=K,z().updateViewportState()}}))}var{useStore:w8,Provider:Ts}=Cs("EmojiPicker.Root is missing.");function ks($){return $.search}function aq($){return $.interaction==="none"?void 0:$.data?.rows[$.activeRowIndex]?.emojis[$.activeColumnIndex]}function Es($){return $.data===void 0||typeof $.data?.count=="number"&&$.data.count===0}function Ss($){return $.data===null||$.viewportHeight===null||$.rowHeight===null||$.categoryHeaderHeight===null}function Ak($){return $.data?.rows.length}function Rs($){return $.data?.categories.length}function bs($){return $.data?.categoriesStartRowIndices}function ys($){return $.data?.skinTones}function Dk($,Z){return $?.emoji===Z?.emoji}function xs($,Z){return $?.categoryIndex!==Z?.categoryIndex||$?.emojis.length!==Z?.emojis.length?!1:!!$?.emojis.every((J,Q)=>Dk(J,Z?.emojis[Q]))}var AZ="‍",Yk=/\p{Emoji_Modifier_Base}/u,hs=/\uFE0F$/,vs=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,gs={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function fs($,Z){if(!$.split(AZ).some((Q)=>Yk.test(Q)))return $;let J=$.split(AZ).map((Q)=>Q.replace(vs,"")).join(AZ);return Z==="none"?J:J.split(AZ).map((Q,X,G)=>{let H=G.length>1;return!Yk.test(Q)||H&&Q==="\uD83E\uDD1D"?Q:Q.replace(hs,"")+gs[Z]}).join(AZ)}function ms($){return rq.map((Z)=>({skinTone:Z,emoji:fs($,Z)}))}function wk(){let $=w8(),Z=y8($,aq,Dk);return F3.useDeferredValue(Z)}function Ok($="✋"){let Z=w8(),J=J7(Z,"skinTone"),Q=F3.useMemo(()=>ms($),[$]),X=F3.useCallback((G)=>{Z.set({skinTone:G})},[]);return[J,X,Q]}function sq($,Z){if(Object.is($,Z))return!0;if(typeof $!="object"||typeof Z!="object"||$===null||Z===null||Array.isArray($)!==Array.isArray(Z))return!1;let J=Object.keys($),Q=Object.keys(Z);return J.length!==Q.length?!1:J.every((X)=>(X in Z)&&$[X]===Z[X])}function us(...$){}function ps($,Z){let J=null;if(typeof window.requestIdleCallback=="function")J=window.requestIdleCallback($,Z);else{let Q=Date.now();J=window.setTimeout(()=>{$({didTimeout:!1,timeRemaining:()=>Math.max(0,(Z?.timeout??50)-(Date.now()-Q))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(J):window.clearTimeout(J)}}var D4=typeof window<"u"?tG.useLayoutEffect:tG.useEffect;function cs($){let Z=eG.useRef($);return D4(()=>{Z.current=$}),eG.useCallback((...J)=>Z.current(...J),[])}function ds({emojiVersion:$,emojibaseUrl:Z}){let[J,Q]=b0.useState(void 0),X=w8(),G=J7(X,"locale"),H=J7(X,"columns"),z=J7(X,"skinTone"),K=J7(X,"search");return b0.useEffect(()=>{let Y=new AbortController,W=Y.signal;return As({locale:G,emojiVersion:$,emojibaseUrl:Z,signal:W}).then((q)=>{Q(q)}).catch((q)=>{W.aborted||console.error(q)}),()=>{Y.abort()}},[$,Z,G]),b0.useEffect(()=>{if(J)return ps(()=>{X.get().onDataChange(Os(J,H,z,K))},{timeout:100})},[J,H,z,K]),null}var Pk=b0.forwardRef(({locale:$="en",columns:Z=9,skinTone:J="none",onEmojiSelect:Q=us,emojiVersion:X,emojibaseUrl:G,onFocusCapture:H,onBlurCapture:z,children:K,style:Y,sticky:W=!0,...q},B)=>{let U=cs(Q),F=js(()=>Is(U,Hk($),Z,W,zk(J))),[V,N]=b0.useState(!1),L=b0.useRef(null),_=b0.useCallback((D)=>{D&&(L.current=D,F.set({rootRef:L}))},[]);D4(()=>{F.set({locale:Hk($)})},[$]),D4(()=>{F.set({columns:Z})},[Z]),D4(()=>{F.set({sticky:W})},[W]),D4(()=>{F.set({skinTone:zk(J)})},[J]);let w=b0.useCallback((D)=>{H?.(D);let{searchRef:M,viewportRef:j}=F.get(),T=D.target===M?.current||D.target.hasAttribute("frimousse-search"),E=D.target===j?.current||D.target.hasAttribute("frimousse-viewport");D.isDefaultPrevented()||(N(T||E),D.isDefaultPrevented()||(N(T||E),E?F.get().onActiveEmojiChange("keyboard",0,0):T&&F.get().search===""&&F.set({interaction:"none"})))},[H]),A=b0.useCallback((D)=>{z?.(D),!D.isDefaultPrevented()&&!D.currentTarget.contains(D.relatedTarget)&&N(!1)},[z]);return D4(()=>{V||F.get().onActiveEmojiReset()},[V]),b0.useImperativeHandle(B,()=>L.current),b0.useEffect(()=>{if(!V)return;function D(M){if(M.defaultPrevented||!M.key.startsWith("Arrow")&&M.key!=="Enter")return;let{data:j,onEmojiSelect:T,onActiveEmojiChange:E,interaction:C,activeColumnIndex:g,activeRowIndex:b}=F.get();if(M.key==="Enter"){let k=aq(F.get());k&&(M.preventDefault(),T(k))}if(M.key.startsWith("Arrow")){let k=g,x=b;if(M.preventDefault(),C!=="none"){if(j?.rows&&j.rows.length>0)switch(M.key){case"ArrowLeft":{if(k===0){let R=x-1,I=j.rows[R];I&&(x=R,k=I.emojis.length-1)}else k-=1;break}case"ArrowRight":{if(k===j.rows[x].emojis.length-1){let R=x+1;j.rows[R]&&(x=R,k=0)}else k+=1;break}case"ArrowUp":{let R=j.rows[x-1];R&&(x-=1,R.emojis[k]||(k=R.emojis.length-1));break}case"ArrowDown":{let R=j.rows[x+1];R&&(x+=1,R.emojis[k]||(k=R.emojis.length-1));break}}E("keyboard",k,x)}else E("keyboard",0,0)}}return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[V]),D4(()=>{let D=null,M=null,j=null,T=null,E=F.subscribe((x)=>{L.current&&(D!==x.viewportWidth&&(D=x.viewportWidth,L.current.style.setProperty("--frimousse-viewport-width",`${x.viewportWidth}px`)),M!==x.viewportHeight&&(M=x.viewportHeight,L.current.style.setProperty("--frimousse-viewport-height",`${x.viewportHeight}px`)),j!==x.rowHeight&&(j=x.rowHeight,L.current.style.setProperty("--frimousse-row-height",`${x.rowHeight}px`)),T!==x.categoryHeaderHeight&&(T=x.categoryHeaderHeight,L.current.style.setProperty("--frimousse-category-header-height",`${x.categoryHeaderHeight}px`)))}),{viewportWidth:C,viewportHeight:g,rowHeight:b,categoryHeaderHeight:k}=F.get();return C&&L.current.style.setProperty("--frimousse-viewport-width",`${C}px`),g&&L.current.style.setProperty("--frimousse-viewport-height",`${g}px`),b&&L.current.style.setProperty("--frimousse-row-height",`${b}px`),k&&L.current.style.setProperty("--frimousse-category-header-height",`${k}px`),E},[]),Q1.jsx("div",{"data-focused":V?"":void 0,"frimousse-root":"",onBlurCapture:A,onFocusCapture:w,...q,ref:_,style:{"--frimousse-emoji-font":Uk,...Y},children:Q1.jsxs(Ts,{store:F,children:[Q1.jsx(ds,{emojiVersion:X,emojibaseUrl:G}),K]})})}),jk=b0.forwardRef(({value:$,defaultValue:Z,onChange:J,...Q},X)=>{let G=w8(),H=b0.useRef(null),z=b0.useCallback((q)=>{q&&(H.current=q,G.set({searchRef:H}))},[]),K=typeof $=="string",Y=b0.useRef(K);b0.useEffect(()=>{Y.current=K},[K]),D4(()=>{G.set({search:typeof $=="string"?$:typeof Z=="string"?Z:""})},[]),D4(()=>{typeof $=="string"&&G.get().onSearchChange($)},[$]);let W=b0.useCallback((q)=>{J?.(q),q.isDefaultPrevented()||G.get().onSearchChange(q.target.value)},[J]);return b0.useImperativeHandle(X,()=>H.current),Q1.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...Q,defaultValue:Z,onChange:W,ref:z,value:$})}),ls=b0.memo(()=>{let $=wk();return $?Q1.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}),Ck=b0.forwardRef(({children:$,onScroll:Z,onKeyDown:J,style:Q,...X},G)=>{let H=w8(),z=b0.useRef(null),K=b0.useCallback((B)=>{B&&(z.current=B,H.set({viewportRef:z}))},[]),Y=y8(H,Ak),W=y8(H,Rs),q=b0.useCallback((B)=>{Z?.(B),H.get().onViewportScroll(B.currentTarget.scrollTop)},[Z]);return D4(()=>{if(!z.current)return;let B=new ResizeObserver(([U])=>{let F=U?.borderBoxSize[0]?.inlineSize??0,V=U?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:N,viewportHeight:L,viewportWidth:_}=H.get();(L!==V||_!==F)&&N(F,V)});return B.observe(z.current),H.get().onViewportSizeChange(z.current.offsetWidth,z.current.clientHeight),()=>{B.disconnect()}},[]),b0.useImperativeHandle(G,()=>z.current),Q1.jsxs("div",{"frimousse-viewport":"",...X,onScroll:q,ref:K,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof Y=="number"&&typeof W=="number"?`var(--frimousse-viewport-width, auto) calc(${Y} * var(--frimousse-row-height) + ${W} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...Q},children:[Q1.jsx(ls,{}),$]})});function Ik($,Z,J){return{emoji:{...$,isActive:J},role:"gridcell","aria-colindex":Z,"aria-selected":J||void 0,"aria-label":$.label,"data-active":J?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function Tk($,Z=!1){return{role:Z?void 0:"row","aria-rowindex":Z?void 0:$,"frimousse-row":"",style:{contain:Z?void 0:"content",height:Z?void 0:"var(--frimousse-row-height)",display:"flex"}}}function kk($,Z){return{"frimousse-category":"",style:{contain:"content",top:Z?`calc(${$} * var(--frimousse-category-header-height) + ${Z.startRowIndex} * var(--frimousse-row-height))`:void 0,height:Z?`calc(var(--frimousse-category-header-height) + ${Z.rowsCount} * var(--frimousse-row-height))`:void 0,width:"100%",pointerEvents:"none",position:"absolute"}}}function Ek($,Z=!1,J=!0){return{category:$,"frimousse-category-header":"",style:{contain:Z?void 0:"layout paint",height:Z?void 0:"var(--frimousse-category-header-height)",pointerEvents:"auto",position:J?"sticky":void 0,top:0}}}function Wk($,Z,J,Q){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${$} * var(--frimousse-row-height) + ${Z} * var(--frimousse-category-header-height))`,paddingTop:`calc(${J} * var(--frimousse-row-height) + ${Q} * var(--frimousse-category-header-height))`}}}function qk($,Z,J){return{"aria-colcount":$,"aria-rowcount":Z,"frimousse-list":"",style:{"--frimousse-list-columns":$,...J},role:"grid"}}function is($){$.preventDefault()}var rs=b0.memo(({Emoji:$,emoji:Z,columnIndex:J,rowIndex:Q})=>{let X=w8(),G=y8(X,(Y)=>aq(Y)?.emoji===Z.emoji),H=b0.useCallback(()=>{X.get().onEmojiSelect(Z)},[Z]),z=b0.useCallback(()=>{X.get().onActiveEmojiChange("pointer",J,Q)},[J,Q]),K=b0.useCallback(()=>{X.get().onActiveEmojiReset()},[]);return Q1.jsx($,{...Ik(Z,J,G),onClick:H,onPointerDown:is,onPointerEnter:z,onPointerLeave:K})}),as=b0.memo(({Row:$,Emoji:Z,rowIndex:J})=>{let Q=w8(),X=y8(Q,(G)=>G.data?.rows[J],xs);return X?Q1.jsx($,{...Tk(J),children:X.emojis.map((G,H)=>Q1.jsx(rs,{Emoji:Z,columnIndex:H,emoji:G,rowIndex:J},G.label))}):null}),ss=b0.memo(({CategoryHeader:$,categoryIndex:Z})=>{let J=w8(),Q=y8(J,(G)=>G.data?.categories[Z],sq),X=J7(J,"sticky");return Q?Q1.jsx("div",{...kk(Z,Q),children:Q1.jsx($,{...Ek({label:Q.label},!1,X)})}):null}),Bk=b0.memo(({CategoryHeader:$,Row:Z,Emoji:J})=>{let Q=b0.useRef(null),X=w8(),G=J7(X,"columns"),H=b0.useMemo(()=>Array(G).fill({emoji:"\uD83D\uDE42",label:""}),[G]),z=b0.useMemo(()=>({label:"Category"}),[]),K=b0.useRef(null),Y=b0.useRef(null);return D4(()=>{let W=Q.current?.parentElement?.parentElement;if(!W||!K.current||!Y.current)return;let q=new ResizeObserver((F)=>{for(let V of F){let N=V.contentRect.height,{onRowHeightChange:L,onCategoryHeaderHeightChange:_,rowHeight:w,categoryHeaderHeight:A}=X.get();V.target===K.current&&w!==N&&L(N),V.target===Y.current&&A!==N&&_(N)}});q.observe(W),q.observe(K.current),q.observe(Y.current);let{onRowHeightChange:B,onCategoryHeaderHeightChange:U}=X.get();return B(K.current.clientHeight),U(Y.current.clientHeight),()=>{q.disconnect()}},[]),Q1.jsxs("div",{"aria-hidden":!0,ref:Q,style:{height:0,visibility:"hidden"},children:[Q1.jsx("div",{"frimousse-row-sizer":"",ref:K,children:Q1.jsx(Z,{...Tk(-1,!0),children:H.map((W,q)=>Q1.jsx(J,{...Ik(W,q,!1)},q))})}),Q1.jsx("div",{...kk(-1),children:Q1.jsx("div",{"frimousse-category-header-sizer":"",ref:Y,children:Q1.jsx($,{...Ek(z,!0)})})})]})});function ns({category:$,...Z}){return Q1.jsx("div",{...Z,children:$.label})}function os({emoji:$,...Z}){return Q1.jsx("button",{type:"button",...Z,children:$.emoji})}function ts({...$}){return Q1.jsx("div",{...$})}var Sk=b0.forwardRef(({style:$,components:Z,...J},Q)=>{let X=w8(),G=b0.useRef(null),H=b0.useCallback((L)=>{L&&(G.current=L,X.set({listRef:G}))},[]),z=Z?.CategoryHeader??ns,K=Z?.Emoji??os,Y=Z?.Row??ts,W=J7(X,"columns"),q=J7(X,"viewportStartRowIndex"),B=J7(X,"viewportEndRowIndex"),U=y8(X,Ak),F=y8(X,bs,sq),V=b0.useMemo(()=>F?.filter((L)=>L<q).length??0,[F,q]),N=F?.length??0;return b0.useImperativeHandle(Q,()=>G.current),!U||!F||N===0?Q1.jsx("div",{...qk(W,0,$),...J,children:Q1.jsx("div",{...Wk(0,0,0,0),children:Q1.jsx(Bk,{CategoryHeader:z,Emoji:K,Row:Y})})}):Q1.jsx("div",{...qk(W,U,$),...J,ref:H,children:Q1.jsxs("div",{...Wk(U,N,q,V),children:[Q1.jsx(Bk,{CategoryHeader:z,Emoji:K,Row:Y}),Array.from({length:B-q+1},(L,_)=>{let w=q+_,A=F.indexOf(w);return Q1.jsxs(b0.Fragment,{children:[A>=0&&Q1.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),Q1.jsx(as,{Emoji:K,Row:Y,rowIndex:w})]},w)}),Array.from({length:N},(L,_)=>Q1.jsx(ss,{CategoryHeader:z,categoryIndex:_},_))]})})}),Rk=b0.forwardRef(({emoji:$,onClick:Z,"aria-label":J="Change skin tone",...Q},X)=>{let G=w8(),H=y8(G,ys,sq),[z,K,Y]=Ok($),W=b0.useMemo(()=>Math.max(0,Y.findIndex((N)=>N.skinTone===z)),[z,Y]),q=Y[W],B=Y[(W+1)%Y.length].skinTone,U=z==="none"?void 0:H?.[z],F=B==="none"?void 0:H?.[B],V=b0.useCallback((N)=>{Z?.(N),N.isDefaultPrevented()||K(B)},[Z,K,B]);return Q1.jsx("button",{type:"button",...Q,"aria-label":J+(F?` (${F})`:""),"aria-live":"polite","aria-valuetext":U,"frimousse-skin-tone-selector":"",onClick:V,ref:X,children:q.emoji})});function bk({children:$,...Z}){let J=w8();return y8(J,Ss)?Q1.jsx("span",{"frimousse-loading":"",...Z,children:$}):null}function es({children:$}){let Z=w8(),J=y8(Z,ks);return $({search:J})}function yk({children:$,...Z}){let J=w8();return y8(J,Es)?Q1.jsx("span",{"frimousse-empty":"",...Z,children:typeof $=="function"?Q1.jsx(es,{children:$}):$}):null}function xk({children:$}){let Z=wk();return $({emoji:Z})}function hk({children:$,emoji:Z}){let[J,Q,X]=Ok(Z);return $({skinTone:J,setSkinTone:Q,skinToneVariations:X})}Pk.displayName="EmojiPicker.Root";jk.displayName="EmojiPicker.Search";Ck.displayName="EmojiPicker.Viewport";Sk.displayName="EmojiPicker.List";bk.displayName="EmojiPicker.Loading";yk.displayName="EmojiPicker.Empty";Rk.displayName="EmojiPicker.SkinToneSelector";xk.displayName="EmojiPicker.ActiveEmoji";hk.displayName="EmojiPicker.SkinTone";var oq=[{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 nq($,Z,J){let Q=J*Math.PI/180,X=Z*Math.cos(Q),G=Z*Math.sin(Q),H=($+0.3963377774*X+0.2158037573*G)**3,z=($-0.1055613458*X-0.0638541728*G)**3,K=($-0.0894841775*X-1.291485548*G)**3;return`#${[4.0767416621*H-3.3077115913*z+0.2309699292*K,-1.2684380046*H+2.6097574011*z-0.3413193965*K,-0.0041960863*H-0.7034186147*z+1.707614701*K].map((W)=>{let q=Math.min(1,Math.max(0,W)),B=q<=0.0031308?12.92*q:1.055*q**0.4166666666666667-0.055;return Math.round(B*255).toString(16).padStart(2,"0")}).join("")}`}function vk(){let $=Math.random()*360,Z=(35+Math.random()*55)*(Math.random()<0.5?-1:1),J=Math.round(115+Math.random()*55),Q=nq(0.83+Math.random()*0.06,0.09+Math.random()*0.06,$),X=nq(0.5+Math.random()*0.14,0.17+Math.random()*0.07,$+Z);if(Math.random()<0.4){let G=nq(0.7+Math.random()*0.05,0.15,$+Z/2);return{angle:J,stops:[Q,G,X]}}return{angle:J,stops:[Q,X]}}var $n="radial-gradient(120% 100% at 28% 12%, rgba(255,255,255,0.32), rgba(255,255,255,0) 58%)";function $H($){return`${$n}, linear-gradient(${$.angle}deg, ${$.stops.join(", ")})`}var T5=256;function gk($,Z){let J=Z.angle*Math.PI/180,Q=Math.sin(J),X=-Math.cos(J),G=T5*(Math.abs(Q)+Math.abs(X))/2,H=T5/2,z=$.createLinearGradient(H-Q*G,H-X*G,H+Q*G,H+X*G),K=Z.stops.length-1;Z.stops.forEach((W,q)=>z.addColorStop(K===0?0:q/K,W)),$.fillStyle=z,$.fillRect(0,0,T5,T5);let Y=$.createRadialGradient(T5*0.28,T5*0.12,0,T5*0.28,T5*0.12,T5*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,T5,T5)}function fk($){return new Promise((Z,J)=>{$.toBlob((Q)=>Q?Z(Q):J(Error("Canvas is empty")),"image/png")})}function mk(){let $=document.createElement("canvas");$.width=T5,$.height=T5;let Z=$.getContext("2d");if(!Z)throw Error("2D canvas unavailable");return[$,Z]}var Zn=0.92,Jn=0.68;async function uk($,Z){let[J,Q]=mk();if(Z)gk(Q,Z);Q.textAlign="center",Q.textBaseline="middle";let X=Z?Jn:Zn;return Q.font=`${Math.round(T5*X)}px "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif`,Q.fillText($,T5/2,T5/2+T5*0.04),fk(J)}function Qn($){return new Promise((Z,J)=>{let Q=new Image;Q.onload=()=>Z(Q),Q.onerror=()=>J(Error("Failed to load SVG")),Q.src=$})}var Xn=0.78,Gn=0.6;async function pk($,Z){let[J,Q]=mk();if(Z)gk(Q,Z);let X=Z?"#ffffff":"#18181b",G=$.replace(/currentColor/g,X),H=await Qn(`data:image/svg+xml;utf8,${encodeURIComponent(G)}`),z=T5*(Z?Gn:Xn),K=(T5-z)/2;return Q.drawImage(H,K,K,z,z),fk(J)}var tq=[{id:"rocket",Icon:RE},{id:"sparkles",Icon:hE},{id:"bolt",Icon:rk},{id:"flame",Icon:BE},{id:"star",Icon:vE},{id:"heart",Icon:_E},{id:"diamond",Icon:WE},{id:"trophy",Icon:pE},{id:"target",Icon:fE},{id:"bulb",Icon:tk},{id:"brain",Icon:sk},{id:"robot",Icon:SE},{id:"wand",Icon:dE},{id:"atom",Icon:lk},{id:"flask",Icon:UE},{id:"cpu",Icon:HE},{id:"code",Icon:XE},{id:"terminal",Icon:mE},{id:"api",Icon:dk},{id:"database",Icon:KE},{id:"cube",Icon:zE},{id:"hexagon",Icon:ME},{id:"plug",Icon:EE},{id:"tool",Icon:uE},{id:"settings",Icon:DZ},{id:"bug",Icon:ok},{id:"activity",Icon:ck},{id:"chart",Icon:ZE},{id:"briefcase",Icon:nk},{id:"folder",Icon:FE},{id:"file",Icon:y2},{id:"book",Icon:ak},{id:"message",Icon:PE},{id:"mail",Icon:wE},{id:"bell",Icon:ik},{id:"paperclip",Icon:EX},{id:"key",Icon:ZH},{id:"shield",Icon:bE},{id:"user",Icon:cE},{id:"home",Icon:AE},{id:"globe",Icon:NE},{id:"world",Icon:lE},{id:"planet",Icon:kE},{id:"compass",Icon:GE},{id:"map",Icon:OE},{id:"calendar",Icon:ek},{id:"cloud",Icon:QE},{id:"sun",Icon:gE},{id:"moon",Icon:jE},{id:"snowflake",Icon:xE},{id:"leaf",Icon:DE},{id:"mountain",Icon:CE},{id:"feather",Icon:qE},{id:"ghost",Icon:VE},{id:"music",Icon:IE},{id:"camera",Icon:$E},{id:"photo",Icon:TE},{id:"palette",Icon:JH},{id:"gamepad",Icon:YE},{id:"gift",Icon:LE},{id:"cart",Icon:yE},{id:"chef",Icon:JE}],iE=["\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","☕"],QH="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var v0=O(l(),1);function Hn({category:$,...Z}){return v0.jsx("div",{className:"bg-background px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",...Z,children:$.label})}function zn({children:$,...Z}){return v0.jsx("div",{className:"scroll-my-1 px-1.5",...Z,children:$})}function Kn({emoji:$,...Z}){return v0.jsx("button",{className:B0("flex size-9 items-center justify-center rounded-lg text-[22px] transition-colors duration-75 data-[active]:bg-muted",QH),...Z,children:$.emoji})}function oE({icon:$}){let{workspaceId:Z,provider:J}=Q5(),{isPending:Q,mutateAsync:X}=rT(Z),{isPending:G,mutate:H}=aT(Z),[z,K]=u5.useState("emoji"),[Y,W]=u5.useState({id:"sunrise",gradient:oq[0].gradient}),[q,B]=u5.useState(null),[U,F]=u5.useState(null),[V,N]=u5.useState(""),[L,_]=u5.useState(null),[w,A]=u5.useState(null),[D,M]=u5.useState(!1),[j,T]=u5.useState(null),E=u5.useRef(null),C=u5.useRef(null),g=u5.useRef(null),b=tq.find((P)=>P.id===L),k=Y.gradient!==null,x=Q||G,R=()=>{let P=vk();B(P),W({id:"shuffle",gradient:P})},I=(P)=>{T(null),g.current=P,K("upload"),A(URL.createObjectURL(P))};u5.useEffect(()=>{let P=!1,t=async()=>{let y;if(z==="upload"){if(!g.current)return;y=g.current}else if(z==="emoji"){if(!U)return;y=await uk(U,Y.gradient)}else{let n=C.current?.querySelector("svg");if(!n)return;y=await pk(new XMLSerializer().serializeToString(n),Y.gradient)}if(!P)await X(y)};T(null);let z0=window.setTimeout(()=>{t().catch((y)=>{if(!P)T(y instanceof Error?y.message:"Failed to save icon")})},150);return()=>{P=!0,window.clearTimeout(z0)}},[Y.gradient,U,z,X,b,w]),u5.useEffect(()=>{return()=>{if(w)URL.revokeObjectURL(w)}},[w]);let S=()=>{g.current=null,F(null),_(null),A(null),T(null),H()},h=z==="emoji"&&U?"emoji":z==="icon"&&b?"glyph":"image",p=z==="upload"&&w?w:$??Y7[J??"claude-code"];return v0.jsxs("div",{className:"flex gap-6",children:[v0.jsxs("div",{className:"flex w-24 shrink-0 flex-col items-center gap-2.5",children:[v0.jsx("div",{className:B0("flex size-24 items-center justify-center overflow-hidden rounded-[24px] shadow-sm ring-1 ring-border",h!=="image"&&!k&&"bg-[repeating-conic-gradient(#0000000d_0%_25%,transparent_0%_50%)] bg-[length:16px_16px]"),style:h!=="image"&&Y.gradient?{background:$H(Y.gradient)}:void 0,children:h==="emoji"?v0.jsx("span",{className:B0("leading-none",QH,k?"text-[64px]":"text-[86px]"),children:U}):h==="glyph"&&b?v0.jsx(b.Icon,{stroke:1.5,className:B0(k?"size-14 text-white":"size-18 text-foreground")}):v0.jsx("img",{src:p,alt:"",className:"size-full object-cover"})}),v0.jsx("button",{type:"button",onClick:S,disabled:x,className:"text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50",children:"Reset to default"})]}),v0.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[v0.jsx("div",{className:"flex gap-1 self-start rounded-lg bg-muted p-0.5",children:["emoji","icon","upload"].map((P)=>v0.jsx("button",{type:"button",onClick:()=>K(P),className:B0("rounded-md px-3.5 py-1 text-xs font-medium capitalize transition-colors",z===P?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:P},P))}),v0.jsxs("div",{className:B0("flex items-center gap-2",z==="upload"&&"pointer-events-none opacity-35"),children:[v0.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Background"}),v0.jsxs("div",{className:"flex items-center gap-2",children:[v0.jsx("button",{type:"button","aria-label":"No background",onClick:()=>W({id:"none",gradient:null}),className:B0("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:v0.jsx(aE,{size:16,stroke:1.75,className:"text-muted-foreground"})}),oq.map((P)=>v0.jsx("button",{type:"button","aria-label":`${P.id} background`,onClick:()=>W({id:P.id,gradient:P.gradient}),style:{background:$H(P.gradient)},className:B0("size-7 rounded-full ring-offset-2 ring-offset-card transition-shadow",Y.id===P.id?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30")},P.id)),v0.jsx("button",{type:"button","aria-label":"Random background",title:"Surprise me",onClick:R,style:q?{background:$H(q)}:void 0,className:B0("flex size-7 items-center justify-center rounded-full ring-offset-2 ring-offset-card transition-shadow",q?"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:v0.jsx(rE,{size:16,stroke:1.75})})]})]}),z==="emoji"?v0.jsxs(O7.Root,{onEmojiSelect:(P)=>F(P.emoji),emojibaseUrl:"/vendor/emojibase",columns:13,className:"isolate flex h-72 flex-col overflow-hidden rounded-lg border border-border bg-background",children:[v0.jsxs("div",{className:"flex items-center gap-1.5 p-1.5 pb-0",children:[v0.jsx(O7.Search,{placeholder:"Search emoji…",onChange:(P)=>N(P.target.value),className:"h-8 min-w-0 flex-1 appearance-none rounded-md bg-muted px-2.5 text-sm outline-none placeholder:text-muted-foreground"}),v0.jsx(O7.SkinToneSelector,{className:"size-8 shrink-0 rounded-md text-lg hover:bg-accent"})]}),v0.jsxs(O7.Viewport,{className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[v0.jsxs(O7.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[v0.jsx(l5,{size:16,stroke:1.75,className:"animate-spin"}),"Loading emoji…"]}),V.trim()===""&&v0.jsxs("div",{className:"border-b border-dashed border-border pb-1.5",children:[v0.jsx("p",{className:"px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",children:"Favorites"}),v0.jsx("div",{className:"grid grid-cols-13 justify-items-start px-1.5",children:iE.map((P)=>v0.jsx("button",{type:"button",onClick:()=>F(P),className:B0("flex size-9 items-center justify-center rounded-lg text-[22px] transition-colors duration-75",QH,U===P?"bg-primary/10":"hover:bg-accent"),children:P},P))})]}),v0.jsxs(O7.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[v0.jsx(sE,{size:20,stroke:1.5}),"No emoji found"]}),v0.jsx(O7.List,{className:"pb-1.5 select-none",components:{CategoryHeader:Hn,Row:zn,Emoji:Kn}})]})]}):z==="icon"?v0.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-lg border border-border bg-background p-1.5",children:tq.map(({id:P,Icon:t})=>v0.jsx("button",{type:"button","aria-label":P,onClick:()=>_(P),className:B0("flex aspect-square items-center justify-center rounded-lg text-muted-foreground transition-colors [&_svg]:size-5",L===P?"bg-primary/10 text-primary":"hover:bg-accent hover:text-accent-foreground"),children:v0.jsx(t,{stroke:1.5})},P))}):v0.jsxs("button",{type:"button",onClick:()=>E.current?.click(),onDragOver:(P)=>{P.preventDefault(),M(!0)},onDragLeave:()=>M(!1),onDrop:(P)=>{P.preventDefault(),M(!1);let t=P.dataTransfer.files?.[0];if(t)I(t)},className:B0("flex h-72 flex-col items-center justify-center gap-2 rounded-lg border border-dashed transition-colors",D?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-muted-foreground/30 hover:text-foreground"),children:[v0.jsx(nE,{size:24,stroke:1.5}),v0.jsx("span",{className:"text-xs font-medium",children:"Click or drop an image"}),v0.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"PNG, JPG, GIF, or WebP"})]}),v0.jsx("div",{className:"min-h-4","aria-live":"polite",children:j?v0.jsx("p",{className:"text-xs text-destructive",children:j}):x?v0.jsx("p",{className:"text-xs text-muted-foreground",children:"Saving…"}):null})]}),v0.jsx("input",{ref:E,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:(P)=>{let t=P.target.files?.[0];if(t)I(t);P.target.value=""}}),v0.jsx("span",{ref:C,"aria-hidden":!0,className:"hidden",children:b&&v0.jsx(b.Icon,{stroke:1.5})})]})}var X8=O(l(),1);function eE(){let{name:$,icon:Z,cwd:J,workspaceId:Q}=Q5(),[,X]=j4(),G=iT(Q),H=tN(),[z,K]=tE.useState($??"");return X8.jsxs(nG,{title:"General",description:"Basic details for this space.",children:[X8.jsxs(U3,{children:[X8.jsx(MZ,{title:"Name",description:"Shown in the sidebar and the space header.",control:X8.jsx(i9,{value:z,onChange:(q)=>K(q.target.value),onBlur:()=>{let q=z.trim();if(q===($??""))return;G.mutate(q===""?null:q)},onKeyDown:(q)=>{if(q.key==="Enter")q.currentTarget.blur()},placeholder:"Space name",className:"w-56"})}),X8.jsxs("div",{className:"flex flex-col gap-4 px-3.5 py-3.5",children:[X8.jsxs("div",{className:"flex flex-col",children:[X8.jsx("span",{className:"text-sm font-medium",children:"Icon"}),X8.jsx("span",{className:"text-xs text-muted-foreground",children:"Pick an emoji or a glyph on a generated background, or upload an image."})]}),X8.jsx(oE,{icon:Z})]})]}),X8.jsxs(U3,{label:"Danger zone",children:[X8.jsx(MZ,{title:"Remove space",description:"Remove this space from Moi. Its folder and sessions stay on disk.",control:X8.jsxs(C0,{type:"button",variant:"destructive",size:"sm",onClick:()=>{let B=`Remove "${$??J??"this space"}" from your spaces?
118
-
119
- 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(B))return;H.mutate(Q,{onSuccess:()=>X("/")})},disabled:H.isPending,children:[H.isPending&&X8.jsx(l5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})}),H.isError&&X8.jsx("p",{className:"px-3.5 py-3 text-xs text-destructive",children:H.error.message})]})]})}var r1=O(l(),1),Yn=[{id:"general",label:"General",icon:DZ},{id:"environment",label:"Environment",icon:ZH}];function $S(){let[$,Z]=eq.useState(!1),[J,Q]=eq.useState("general");return r1.jsxs(r1.Fragment,{children:[r1.jsxs(q2,{delay:50,children:[r1.jsx(B2,{render:r1.jsx(C0,{variant:"ghost",size:"icon-sm","aria-label":"Space settings",onClick:()=>Z(!0),children:r1.jsx(DZ,{stroke:1.75})})}),r1.jsx(U2,{children:"Space settings"})]}),r1.jsx(KQ,{open:$,onOpenChange:Z,children:r1.jsxs(WQ,{className:"flex h-[min(680px,90vh)] w-[880px] max-w-[94vw]",children:[r1.jsx(G$,{className:"sr-only",children:"Space settings"}),r1.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r border-border bg-muted/30 p-3",children:[r1.jsx("p",{className:"px-2.5 pt-4 pb-2 text-[11px] font-semibold tracking-wider text-muted-foreground/80 uppercase",children:"Settings"}),Yn.map((X)=>r1.jsxs(C0,{type:"button",variant:J===X.id?"secondary":"ghost",size:"sm",onClick:()=>Q(X.id),className:"justify-start",children:[r1.jsx(X.icon,{stroke:1.75}),X.label]},X.id))]}),r1.jsxs("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:[r1.jsx(YQ,{render:r1.jsx(C0,{variant:"ghost",size:"icon","aria-label":"Close",className:"absolute top-3 right-3 z-10",children:r1.jsx(U4,{stroke:1.5})})}),r1.jsx("div",{className:"px-8 py-7",children:J==="general"?r1.jsx(eE,{}):r1.jsx(oT,{})})]})]})})]})}var M6=O(v(),1);var ZS=!0;function Wn($){return $.filter((Z)=>Z.text.length>0).map((Z)=>Z.kind==="reasoning"?{type:"reasoning",text:Z.text}:{type:"text",text:Z.text})}function JS($){let Z=Wn($?.blocks??[]);if(Z.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:Z}}var qn=mZ();function QS(){let $=P8(),Z=I1(),{layout:J}=Q5(),Q=nQ($).data,X=Q?.models,G=Q?.supportsStreaming??!1,H=O8((L)=>L.activeByWorkspace[$]??null),z=O8((L)=>H?L.processing[`${$}:${H}`]??!1:!1),K=O8((L)=>H?L.errors[`${$}:${H}`]??null:null),Y=uA($,H).data??qn,W=O8((L)=>L.previews),q=M6.useMemo(()=>JS(GU(W,$,H).root),[W,$,H]),B=oQ($,H).data,U=M6.useCallback((L)=>{let _=L.trim(),A=(R1.getState().attachments[C4($,H)]??[]).filter((I)=>I.status==="ready"&&I.upload);if(!_&&A.length===0)return;let D=H,M=!1;if(!D)D=crypto.randomUUID(),M=!0,R1.getState().setActive($,D);let j=`optimistic:${crypto.randomUUID()}`,T=[];for(let I of A)if(I.upload?.kind==="image"&&I.previewUrl)T.push({type:"file",mediaType:I.mediaType,url:I.previewUrl,filename:I.name});else T.push({type:"file",mediaType:I.mediaType,url:"",filename:I.name});if(_)T.push({type:"text",text:_});Z.setQueryData(T0.events($,D),(I)=>j3(I??mZ(),{kind:"turn",turn:{id:j,role:"user",origin:{kind:"user-input"},parts:T,timestamp:new Date().toISOString()}})),R1.getState().setProcessing($,D,!0),R1.getState().setError($,D,null);let E=B?.model??J.selectedModel,g=!E||!X||X.some((I)=>I.value===E)?E:void 0,b=X?.find((I)=>I.value===g),k=B?.effort??J.selectedEffort,x=k&&(!b||(b.supportedEffortLevels??[]).includes(k))?k:void 0;cZ({type:"chat",workspaceId:$,content:_,sessionId:D,isNew:M,optimisticId:j,model:g,effort:x,stream:ZS&&G?!0:void 0,...A.length>0?{attachments:A.map((I)=>I.upload.id)}:{}}),R1.getState().clearAttachments($,H)},[H,$,Z,J.selectedModel,J.selectedEffort,B?.model,B?.effort,X,G]),F=M6.useCallback(()=>{if(!H)return;R1.getState().setError($,H,null)},[H,$]),V=M6.useCallback(()=>{if(!z||!H)return;cZ({type:"stop",workspaceId:$,sessionId:H})},[z,H,$]),N=M6.useCallback((L)=>{R1.getState().setActive($,L)},[$]);return{view:Y,previewTurn:q,sessionId:H,processing:z,error:K,send:U,stop:V,switchThread:N,dismissError:F}}var V3=O(v(),1);function XS($){let Z=document.documentElement,J=getComputedStyle(Z).getPropertyValue($).trim(),Q=Number.parseFloat(J);if(!Number.isFinite(Q))return 0;return J.endsWith("rem")?Q*Number.parseFloat(getComputedStyle(Z).fontSize):Q}function GS(){let $=V3.useRef(null),[Z,J]=V3.useState(!1);return V3.useLayoutEffect(()=>{let Q=$.current;if(!Q)return;let X=(H)=>{let z=XS("--column-w"),K=XS("--chat-min");J(H-K>=z)};X(Q.getBoundingClientRect().width);let G=new ResizeObserver(([H])=>{if(H)X(H.contentRect.width)});return G.observe(Q),()=>G.disconnect()},[]),{ref:$,fits:Z}}var XH=O(v(),1);var HS=["background","foreground"],$B="mei-fonts";function zS($,Z){let J=$?.font??"default",Q=$?.background,X=$?.foreground;XH.useEffect(()=>{let G=Z.current;if(!G)return;let H=Q3[J]??Q3.default;G.style.setProperty("--font-sans",H.sans),G.style.setProperty("--font-mono",H.mono);let z=document.getElementById($B);if(!H.googleFontsQuery)z?.remove();else{let K=`https://fonts.googleapis.com/css2?family=${H.googleFontsQuery}&display=swap`;if(z)z.href=K;else{let Y=document.createElement("link");Y.id=$B,Y.rel="stylesheet",Y.href=K,document.head.appendChild(Y)}}return()=>{G.style.removeProperty("--font-sans"),G.style.removeProperty("--font-mono")}},[J,Z]),XH.useEffect(()=>{let G=Z.current;if(!G)return;let H={background:Q,foreground:X};for(let z of HS){let K=H[z];if(K)G.style.setProperty(`--${z}`,K);else G.style.removeProperty(`--${z}`)}return()=>{for(let z of HS)G.style.removeProperty(`--${z}`)}},[Q,X,Z]),XH.useEffect(()=>()=>document.getElementById($B)?.remove(),[])}var a1=O(l(),1),Bn=rZ([y6({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 Un({items:$}){return a1.jsxs(S2,{children:[a1.jsx(R2,{render:a1.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:a1.jsx(t5,{stroke:1.75})})}),a1.jsx(Z6,{align:"start",className:"min-w-48",children:a1.jsx(J6,{children:$.map(({key:Z,Icon:J,label:Q,onClick:X})=>a1.jsxs(I$,{onClick:X,children:[a1.jsx(J,{stroke:1.75}),Q]},Z))})})]})}function KS($){let{tab:Z,active:J}=$,Q=$.preview===!0;return a1.jsxs("button",{type:"button","aria-hidden":Q||void 0,"aria-label":Z.label,disabled:Q,tabIndex:Q?-1:void 0,onClick:$.preview?void 0:()=>$.onSelect(Z.key),className:Bn({active:J,dragging:$.preview?!1:$.state.isDragging,preview:Q}),...$.preview?{}:$.state.dragHandleProps,children:[a1.jsxs("div",{className:B0("flex items-center gap-1 overflow-hidden",Z.closable&&"group-hover/tab:mr-3"),children:[a1.jsx(Z.Icon,{"data-icon":"inline-start",stroke:1.75}),a1.jsx("span",{className:B0("truncate",Z.closable&&"group-hover/tab:-mr-3 group-hover/tab:mask-r-from-[calc(100%-24px)] group-hover/tab:mask-r-to-[calc(100%-12px)]"),children:Z.label})]}),Z.closable&&a1.jsx("div",{"aria-label":`Close ${Z.label}`,tabIndex:Q?-1:void 0,className:B0("absolute right-2 hidden size-3 items-center justify-center text-muted-foreground group-hover/tab:flex hover:text-foreground",Q&&"pointer-events-none"),onClick:$.preview?void 0:(X)=>{X.stopPropagation(),$.onClose(Z.key)},children:a1.jsx(U4,{stroke:1.75})})]})}function YS({tabs:$,active:Z,createItems:J,onSelect:Q,onClose:X,onReorder:G}){return a1.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[a1.jsx("div",{className:"scrollbar-none min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:a1.jsx(mQ,{items:$,getId:(H)=>H.key,className:"flex w-max items-center gap-1",onReorder:(H)=>G(H),renderPlaceholder:()=>a1.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-xs bg-muted"}),renderOverlay:(H)=>a1.jsx(KS,{tab:H,active:Z===H.key,preview:!0}),renderItem:(H,z)=>a1.jsx(KS,{tab:H,active:Z===H.key,state:z,onSelect:Q,onClose:X})})}),a1.jsx("div",{className:"shrink-0",children:a1.jsx(Un,{items:J})})]})}var o0=O(l(),1),Vn=e8.lazy(()=>import("/chunk-c4j722at.js").then(($)=>({default:$.Scratchpad}))),BS=($)=>$.config.title||$.id,ZB={open:["agent"],active:"agent"},Ln=($)=>`view:${$}`,XB=($)=>$.startsWith("view:")?$.slice(5):null;function Nn({mode:$,onToggleMode:Z}){return o0.jsx(C0,{variant:"ghost",size:"icon-sm",onClick:Z,"aria-label":$==="fullscreen"?"Switch to split view":"Switch to full-screen view",children:o0.jsx(qS,{stroke:1.75})})}function _n({view:$}){let Z=aA($.id);return o0.jsx("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:o0.jsxs(g8,{mode:"wait",initial:!1,children:[Z.status==="ready"&&o0.jsx(T1.div,{className:"absolute inset-0 overflow-auto",initial:{opacity:0,filter:"blur(4px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(4px)"},transition:{duration:0.3,ease:"easeInOut"},children:o0.jsx(JZ,{name:$.id,resetKey:Z.version,children:o0.jsx(Z.Component,{})})},Z.version),Z.status==="error"&&o0.jsx(T1.p,{className:"absolute inset-0 p-4 text-xs text-destructive",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:0.3,ease:"easeInOut"},children:Z.error},`err-${Z.version}`)]})})}function Mn({active:$,onToggle:Z}){return o0.jsxs(q2,{delay:50,children:[o0.jsx(B2,{render:o0.jsx(C0,{variant:$?"secondary":"ghost",size:"icon-sm","aria-label":"Customize","aria-pressed":$,onClick:Z,children:o0.jsx(JH,{stroke:1.75})})}),o0.jsx(U2,{children:"Customize"})]})}function An($){if(!$||!Array.isArray($.open))return ZB;let Z=$.open.filter((J,Q,X)=>X.indexOf(J)===Q);if(Z.length===0)return ZB;return{open:Z,active:Z.includes($.active)?$.active:Z[0]}}function WS($,Z){if($==="agent"||$==="widgets"||$==="scratchpad")return!0;let J=XB($);return J?Z.some((Q)=>Q.id===J):!1}function Dn($,Z,J){if($==="agent")return{key:$,Icon:q7,label:"Agent",closable:J};if($==="widgets")return{key:$,Icon:QB,label:"Widgets",closable:J};if($==="scratchpad")return{key:$,Icon:JB,label:"Scratchpad",closable:J};let Q=XB($),X=Q?Z.find((G)=>G.id===Q):null;return X?{key:$,Icon:GH,label:BS(X),closable:J}:null}function wn($,Z,J){let Q=new Set(Z),X=0;return $.map((G)=>Q.has(G)?J[X++]:G)}function US({widgets:$,views:Z}){let{view:J,previewTurn:Q,sessionId:X,processing:G,error:H,send:z,stop:K,switchThread:Y,dismissError:W}=QS(),{layout:q,setLayout:B,name:U,icon:F,provider:V,workspaceId:N}=Q5(),{ref:L,fits:_}=GS(),[w,A]=e8.useState("idle"),[D,M]=e8.useState(!1),[j,T]=e8.useState(0),E=e8.useRef(null);zS(q.theme,E);let C=An(q.tabs),g=C.open.filter((u)=>WS(u,Z)),b=g.length>0?g:ZB.open,k=new Set(C.open),x=b.filter((u)=>u!=="agent"),R=x.length>0,S=q.layoutMode==="split"&&R&&_?"split":"fullscreen",h=S==="split",p=(u)=>{if(u==="split"&&C.active==="agent"){B({layoutMode:u,tabs:{open:C.open,active:x[0]??C.active}});return}B({layoutMode:u})},P=h?x:b,t=P.includes(C.active)?C.active:P[0]??"agent",z0=b.length>1,y=P.map((u)=>Dn(u,Z,z0)).filter((u)=>Boolean(u)),n=XB(t),_0=n?Z.find((u)=>u.id===n):void 0;e8.useEffect(()=>{if(S!=="fullscreen"||t==="agent")M(!1)},[t,S]);let c=(u)=>B({tabs:u}),X0=(u)=>{let F0=k.has(u)?C.open:[...C.open,u];if(c({open:F0,active:u}),u==="agent")M(!1),T((i)=>i+1)},K0=(u)=>{if(!z0||!k.has(u))return;let F0=C.open.filter((Y0)=>Y0!==u),i=C.active;if(i===u||!F0.includes(i)){let Y0=P.indexOf(u);i=P[Y0+1]??P[Y0-1]??F0.find((r)=>WS(r,Z))??"agent"}c({open:F0,active:i})},Z0=(u)=>{let F0=wn(C.open,P,u);if(F0===C.open)return;c({open:F0,active:C.active})},G0=(u)=>{if(u!==void 0)R1.getState().setDraft(N,X,u);if(S==="fullscreen"&&t!=="agent"){if(M(!0),D)T((F0)=>F0+1);return}T((F0)=>F0+1)},U0=[...!h&&!k.has("agent")?[{key:"agent",Icon:q7,label:"Agent",onClick:()=>X0("agent")}]:[],...!k.has("widgets")?[{key:"widgets",Icon:QB,label:"Widgets",onClick:()=>X0("widgets")}]:[],...!k.has("scratchpad")?[{key:"scratchpad",Icon:JB,label:"Scratchpad",onClick:()=>X0("scratchpad")}]:[],...Z.map((u)=>({view:u,tab:Ln(u.id)})).filter(({tab:u})=>!k.has(u)).map(({view:u,tab:F0})=>({key:F0,Icon:GH,label:BS(u),onClick:()=>X0(F0)})),{key:"create-view",Icon:GH,label:"View",onClick:()=>G0("Create view")}],m=o0.jsx(jG,{active:S==="split",focusRequest:j,view:J,previewTurn:Q,sessionId:X,processing:G,error:H,onDismissError:W,send:z,stop:K,onSwitchThread:Y}),s=o0.jsx(jG,{active:S==="fullscreen"&&t==="agent",focusRequest:j,view:J,previewTurn:Q,sessionId:X,processing:G,error:H,onDismissError:W,send:z,stop:K,onSwitchThread:Y});return o0.jsxs("div",{ref:E,className:"relative flex h-full min-h-0 flex-col bg-background font-sans text-foreground",children:[o0.jsxs("div",{ref:L,className:"flex min-h-0 flex-1",children:[(S==="fullscreen"||R)&&o0.jsxs("div",{className:B0("flex min-h-0 flex-1 flex-col",S==="split"&&"min-w-[var(--column-w)]"),children:[o0.jsxs(pT,{children:[o0.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[o0.jsxs("div",{className:"flex items-center gap-2",children:[o0.jsx("img",{src:F??Y7[V??"claude-code"],alt:"",className:"size-5 shrink-0 rounded-[4px]"}),U&&o0.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:U})]}),o0.jsx(YS,{tabs:y,active:t,createItems:U0,onSelect:X0,onClose:K0,onReorder:Z0})]}),o0.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[o0.jsx(Mn,{active:w==="customizing",onToggle:()=>A(w==="customizing"?"idle":"customizing")}),o0.jsx(lN,{}),o0.jsx($S,{}),R&&_&&o0.jsx(Nn,{mode:S,onToggleMode:()=>p(S==="fullscreen"?"split":"fullscreen")})]})]}),t==="agent"?s:t==="widgets"?o0.jsx(uT,{editing:w==="editing",onEditingChange:(u)=>A(u?"editing":"idle"),widgets:$,onCreateWidget:()=>G0("Create widget")}):t==="scratchpad"?o0.jsx(e8.Suspense,{fallback:null,children:o0.jsx(Vn,{})}):_0?o0.jsx(_n,{view:_0}):null]}),S==="split"&&o0.jsx("div",{className:B0("flex min-h-0 min-w-[var(--chat-min)] flex-[0_1_var(--chat-max)] flex-col overflow-hidden border-l border-border"),children:m})]}),o0.jsx(g8,{children:w==="customizing"&&o0.jsx(MI,{})}),S==="fullscreen"&&t!=="agent"&&R&&o0.jsx(VI,{open:D,onOpenChange:M,onOpenChangeComplete:(u)=>{if(u)T((F0)=>F0+1)},container:E,children:(u)=>o0.jsx(jG,{active:D,focusRequest:j,view:J,previewTurn:Q,sessionId:X,processing:G,error:H,onDismissError:W,send:z,stop:K,onSwitchThread:Y,onClose:u})})]})}var HH=O(v(),1);function FS($,Z,J,Q){let X=HH.useRef(null);HH.useEffect(()=>{if(!Z)return;let G=new Map(Z.map((U)=>[U.id,{w:U.config.colSpan,h:U.config.rowSpan}]));if(X.current?.workspaceId!==$){X.current={workspaceId:$,sizes:G};return}let H=X.current.sizes,z=new Set(J.widgetGrid.map((U)=>U.i)),K=Z.filter((U)=>{if(!H.has(U.id))return!z.has(U.id);if(!z.has(U.id))return!1;let V=H.get(U.id);return V.w!==U.config.colSpan||V.h!==U.config.rowSpan});if(X.current={workspaceId:$,sizes:G},K.length===0)return;let Y=new Map(Z.map((U)=>[U.id,U.config])),W=J.widgetGrid.filter((U)=>!K.some((F)=>F.id===U.i)&&Y.has(U.i)).map((U)=>{let F=Y.get(U.i);return{i:U.i,x:U.x,y:U.y,w:F.colSpan,h:F.rowSpan}}),q=W.map(({i:U,x:F,y:V})=>({i:U,x:F,y:V})),B=[...W];for(let U of K){let F=QZ(B,U.config.colSpan,U.config.rowSpan,4);q.push({i:U.id,x:F.x,y:F.y}),B.push({i:U.id,x:F.x,y:F.y,w:U.config.colSpan,h:U.config.rowSpan})}Q({widgetGrid:q})},[$,Z,J.widgetGrid,Q])}var h8=O(l(),1);function NS({id:$}){return h8.jsx(VS,{id:$,children:h8.jsx(mN,{id:$,children:h8.jsx(On,{id:$})})})}function On({id:$}){let Z=I1(),{layout:J,setLayout:Q,isLoading:X}=Q5(),G=xN($),H=hN($),z=sQ($);FS($,G.data,J,Q),sA(),W7((Y)=>{if(Y.type==="theme:updated"||Y.type==="workspace:updated")Z.invalidateQueries({queryKey:T0.layout($)});else if(Y.type==="widget-layout:updated")Z.invalidateQueries({queryKey:T0.widgets($)});else if(Y.type==="view-layout:updated")Z.invalidateQueries({queryKey:T0.views($)})});let K=X||G.isLoading;return h8.jsxs(h8.Fragment,{children:[h8.jsx(Pn,{workspaceId:$,sessions:z.data}),h8.jsx(A2,{children:K?h8.jsx("div",{className:"flex h-full items-center justify-center",children:h8.jsx(x6,{sprite:"moi",effect:"chaos"})}):h8.jsx(US,{widgets:G.data??[],views:H.data??[]})})]})}function Pn({workspaceId:$,sessions:Z}){return LS.useEffect(()=>{if(!Z)return;let J=R1.getState().activeByWorkspace[$]??null;if(!(J&&Z.some((X)=>X.sessionId===J)))R1.getState().setActive($,Z[0]?.sessionId??null)},[$,Z]),null}var P7=O(l(),1);function MS(){let[,$]=j4();return _S.useEffect(()=>{return RH((Z)=>$(`/workspace/${Z}`)),()=>RH(null)},[$]),P7.jsxs(ZU,{children:[P7.jsx(C6,{path:"/",component:mA}),P7.jsx(C6,{path:"/connectors",component:wA}),P7.jsx(C6,{path:"/playground/tool-calls",component:bV}),P7.jsx(C6,{path:"/playground",component:aU}),P7.jsx(C6,{path:"/workspace/:id",children:(Z)=>P7.jsx(NS,{id:Z.id},Z.id)})]})}var L3=O(l(),1),DS=new AH;BU(DS);function sv0($){function Z(){return L3.jsxs(wH,{client:DS,children:[L3.jsx(TH,{children:L3.jsx(MS,{})}),!1]})}AS.createRoot($).render(L3.jsx(Z,{}))}export{sv0 as mount};