moi-computer 0.11.1-next.2 → 0.11.1-next.4

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 (222) hide show
  1. package/README.md +2 -2
  2. package/client/app/AppRouter.tsx +2 -2
  3. package/client/app/routes/WorkspaceRoute.tsx +7 -9
  4. package/client/app/shell/SidebarLayout.tsx +18 -15
  5. package/client/components/shared/BottomPanel.tsx +26 -14
  6. package/client/components/shared/PanelHeader.tsx +1 -1
  7. package/client/components/shared/ReorderableList.tsx +7 -2
  8. package/client/components/shared/WorkspaceIcon.tsx +92 -0
  9. package/client/components/ui/alert-dialog.tsx +1 -0
  10. package/client/components/ui/checkbox.tsx +1 -0
  11. package/client/components/ui/inline-input.tsx +84 -0
  12. package/client/components/ui/toast.tsx +2 -2
  13. package/client/features/applets/AppletMount.tsx +1 -1
  14. package/client/features/applets/applet-cache.ts +3 -3
  15. package/client/features/applets/applet-runtime.ts +147 -108
  16. package/client/features/applets/applet-styles.ts +2 -2
  17. package/client/features/applets/applet-thumbnail.ts +6 -8
  18. package/client/features/applets/useApplet.ts +10 -9
  19. package/client/features/chat/ChatPanel.tsx +19 -10
  20. package/client/features/chat/ChatPopup.tsx +7 -2
  21. package/client/features/chat/applet-chat-intents.ts +170 -0
  22. package/client/features/chat/chat-send.ts +103 -62
  23. package/client/features/chat/chat-store.ts +50 -59
  24. package/client/features/chat/composer/ChatComposer.tsx +43 -132
  25. package/client/features/chat/composer/ModelPicker.tsx +3 -16
  26. package/client/features/chat/composer/attachments/AttachmentChip.tsx +99 -0
  27. package/client/features/chat/composer/attachments/DrawingAttachmentChip.tsx +37 -0
  28. package/client/features/chat/composer/attachments/FileAttachmentChip.tsx +22 -0
  29. package/client/features/chat/composer/attachments/TextAttachmentChip.tsx +11 -0
  30. package/client/features/chat/composer/attachments/draft-attachments.ts +168 -0
  31. package/client/features/chat/composer/attachments/types.ts +25 -0
  32. package/client/features/chat/composer/attachments/uploads.ts +26 -0
  33. package/client/features/chat/{chat-connection.ts → connection/chat-connection.ts} +1 -1
  34. package/client/features/chat/{chat-frames.ts → connection/chat-frames.ts} +2 -2
  35. package/client/features/chat/{ChatEmptyState.tsx → messages/ChatEmptyState.tsx} +16 -11
  36. package/client/features/chat/{MarkdownContent.tsx → messages/MarkdownContent.tsx} +16 -1
  37. package/client/features/chat/{TurnView.tsx → messages/TurnView.tsx} +22 -15
  38. package/client/features/chat/{tool-group → messages/tool-group}/SubagentCard.tsx +1 -1
  39. package/client/features/chat/{tool-group → messages/tool-group}/TimelineRow.tsx +2 -2
  40. package/client/features/chat/{tool-group → messages/tool-group}/ToolCallGroup.tsx +1 -1
  41. package/client/features/chat/{ChatSelector.tsx → sessions/ChatSelector.tsx} +3 -3
  42. package/client/features/chat/{api.ts → sessions/api.ts} +1 -1
  43. package/client/features/chat/useChat.ts +32 -15
  44. package/client/features/dev/ChatStatesPage.tsx +5 -6
  45. package/client/features/dev/HarnessDebugPage.tsx +10 -7
  46. package/client/features/dev/ToolCallsPage.tsx +1 -1
  47. package/client/features/dev/UiComponentPreviews.tsx +21 -0
  48. package/client/features/dev/chat-states-fixtures.ts +13 -2
  49. package/client/features/drawings/useChatAnnotation.ts +17 -17
  50. package/client/features/drawings/useDrawingLayer.ts +7 -9
  51. package/client/features/drawings/useViewBuilderSketch.ts +18 -15
  52. package/client/features/home/HomePage.tsx +8 -7
  53. package/client/features/home/WorkspacePreview.tsx +1 -1
  54. package/client/features/home/workspace-presentation.tsx +1 -11
  55. package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +2 -4
  56. package/client/features/overview/HiddenPanel.tsx +109 -0
  57. package/client/features/overview/Overview.tsx +302 -0
  58. package/client/features/overview/WidgetCanvas.tsx +164 -0
  59. package/client/features/{widgets → overview}/WidgetFrame.tsx +24 -16
  60. package/client/features/overview/WorkspaceName.tsx +60 -0
  61. package/client/features/overview/api.ts +30 -0
  62. package/client/features/overview/default/ViewsWidget.tsx +252 -0
  63. package/client/features/overview/default/registry.tsx +36 -0
  64. package/client/features/{widgets → overview}/grid.ts +36 -0
  65. package/client/features/overview/useGridReconcile.ts +94 -0
  66. package/client/features/scratchpad/Scratchpad.tsx +7 -8
  67. package/client/features/scratchpad/ScratchpadControls.tsx +0 -1
  68. package/client/features/scratchpad/useScratchpadSnapshot.tsx +23 -13
  69. package/client/features/settings/GeneralSettings.tsx +55 -58
  70. package/client/features/settings/SettingsLayout.tsx +2 -2
  71. package/client/features/settings/WorkspaceIconPicker.tsx +318 -0
  72. package/client/features/settings/WorkspaceSettingsDialog.tsx +65 -0
  73. package/client/features/settings/api.ts +48 -24
  74. package/client/features/views/ViewBuilder.tsx +5 -4
  75. package/client/features/views/ViewManager.tsx +11 -13
  76. package/client/features/views/api.ts +36 -2
  77. package/client/features/views/useViewBuilderActions.ts +8 -5
  78. package/client/features/views/useViewBuilderDrafts.ts +23 -21
  79. package/client/features/views/view-presentation.ts +13 -0
  80. package/client/features/workspace/{CustomizePanel.tsx → ThemePanel.tsx} +26 -31
  81. package/client/features/workspace/UnavailablePage.tsx +21 -0
  82. package/client/features/workspace/WorkspaceLayoutContext.tsx +4 -7
  83. package/client/features/workspace/WorkspaceScreen.tsx +205 -161
  84. package/client/features/workspace/WorkspaceSplitLayout.tsx +1 -1
  85. package/client/features/workspace/WorkspaceTabs.tsx +2 -0
  86. package/client/features/workspace/api.ts +0 -26
  87. package/client/features/workspace/moi-context.ts +8 -9
  88. package/client/features/workspace/tab-resolution.ts +10 -33
  89. package/client/features/workspace/useWorkspaceNavigation.ts +164 -101
  90. package/client/index.css +1 -1
  91. package/client/lib/app-icon-registry.ts +2 -0
  92. package/client/lib/use-latest-ref.ts +11 -0
  93. package/client/main.tsx +1 -1
  94. package/client/runtime/useWorkspaceEvents.ts +59 -14
  95. package/client/theme.css +5 -5
  96. package/dist/chunk-2gs8jjx4.css +1 -0
  97. package/dist/chunk-7vvg5fyz.js +68 -0
  98. package/dist/chunk-94m3q9ce.js +1 -0
  99. package/dist/{chunk-w482ew2c.js → chunk-brr0zbeh.js} +73 -73
  100. package/dist/chunk-by2wqgak.js +1 -0
  101. package/dist/chunk-m1fvqssh.js +2 -0
  102. package/dist/chunk-p34hvqt3.js +1 -0
  103. package/dist/{chunk-4s15axjs.js → chunk-p83f0jnj.js} +2 -2
  104. package/dist/{chunk-j3wvxjr7.js → chunk-tzz101ea.js} +1 -1
  105. package/dist/chunk-xg01f6pn.js +10 -0
  106. package/dist/{chunk-53a7pxcz.js → chunk-zs4mte79.js} +1 -1
  107. package/dist/index.html +1 -1
  108. package/lib/app-icons.ts +1 -0
  109. package/lib/applet-selector.ts +24 -0
  110. package/lib/chat-title.ts +6 -1
  111. package/lib/default-widgets.ts +32 -0
  112. package/lib/format.ts +12 -1
  113. package/lib/message-attachments.ts +40 -0
  114. package/lib/moi-attachments.ts +204 -0
  115. package/lib/moi-context.ts +20 -35
  116. package/lib/navigation.ts +84 -0
  117. package/lib/types.ts +81 -25
  118. package/lib/workspace-icon.ts +20 -0
  119. package/lib/workspace-layout.ts +22 -2
  120. package/lib/workspace-tabs.ts +9 -33
  121. package/package.json +27 -27
  122. package/registry.json +13 -0
  123. package/server/AGENTS.md +1 -0
  124. package/server/api.ts +114 -37
  125. package/server/applet-typecheck.ts +95 -0
  126. package/server/{bundler → applets}/build-applet.ts +13 -246
  127. package/server/applets/config.ts +226 -0
  128. package/server/applets/dependencies.ts +206 -0
  129. package/server/{applets.ts → applets/index.ts} +15 -161
  130. package/server/applets/runtime/base.ts +4 -0
  131. package/server/applets/runtime/moi.ts +42 -0
  132. package/server/applets/runtime/rpc.ts +17 -0
  133. package/server/applets/view-source.ts +67 -0
  134. package/server/attachment-message.ts +95 -0
  135. package/server/cli.ts +163 -97
  136. package/server/control.ts +63 -42
  137. package/server/harness/README.md +4 -2
  138. package/server/harness/acp/adapter.ts +7 -21
  139. package/server/harness/acp/session.ts +31 -50
  140. package/server/harness/claude-code/NOTES.md +8 -2
  141. package/server/harness/claude-code/adapter.ts +8 -25
  142. package/server/harness/claude-code/index.ts +2 -0
  143. package/server/harness/claude-code/session.ts +42 -47
  144. package/server/harness/claude-code/sessions.ts +9 -4
  145. package/server/harness/codex/adapter.ts +8 -7
  146. package/server/harness/codex/index.ts +1 -0
  147. package/server/harness/codex/permissions.ts +1 -1
  148. package/server/harness/codex/session.ts +20 -47
  149. package/server/harness/hermes/NOTES.md +1 -1
  150. package/server/harness/hermes/index.ts +4 -0
  151. package/server/harness/openclaw/NOTES.md +1 -1
  152. package/server/harness/openclaw/adapter.ts +22 -4
  153. package/server/harness/openclaw/gateway.ts +5 -3
  154. package/server/harness/openclaw/session.ts +27 -27
  155. package/server/harness/types.ts +5 -3
  156. package/server/layout.ts +9 -14
  157. package/server/moi-scaffold.ts +21 -13
  158. package/server/navigation-relay.ts +110 -0
  159. package/server/registry.ts +8 -0
  160. package/server/selected-session.ts +24 -4
  161. package/server/skill-update.ts +5 -3
  162. package/server/skill-version.ts +4 -7
  163. package/server/skills-template.ts +48 -9
  164. package/server/tabs.ts +19 -33
  165. package/server/uploads.ts +0 -0
  166. package/server/view-builders.ts +18 -1
  167. package/server/views.ts +126 -6
  168. package/server/web.ts +35 -9
  169. package/server/widgets.ts +12 -5
  170. package/server/workspace-config.ts +13 -9
  171. package/ui-components/button.tsx +2 -2
  172. package/ui-components/docs/kbd.md +191 -0
  173. package/ui-components/dropdown-menu.tsx +1 -1
  174. package/ui-components/kbd.tsx +32 -0
  175. package/ui-components/slider.tsx +1 -1
  176. package/ui-components/switch.tsx +1 -1
  177. package/ui-components/tabs.tsx +1 -1
  178. package/workspace/.claude/skills/moi-workspace/SKILL.md +284 -228
  179. package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +100 -153
  180. package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +156 -0
  181. package/client/features/chat/attachment-staging.ts +0 -153
  182. package/client/features/chat/uploads.ts +0 -18
  183. package/client/features/chat/useAppletChatMessage.ts +0 -68
  184. package/client/features/settings/IconPicker.tsx +0 -442
  185. package/client/features/settings/WorkspaceSettings.tsx +0 -95
  186. package/client/features/settings/render-icon.ts +0 -173
  187. package/client/features/widgets/HiddenPanel.tsx +0 -80
  188. package/client/features/widgets/WidgetGrid.tsx +0 -123
  189. package/client/features/widgets/Widgets.tsx +0 -262
  190. package/client/features/widgets/useGridReconcile.ts +0 -73
  191. package/dist/chunk-245wt82v.css +0 -1
  192. package/dist/chunk-87thzbtw.js +0 -2
  193. package/dist/chunk-a6jad1a6.js +0 -1
  194. package/dist/chunk-dghwstd2.js +0 -9
  195. package/dist/chunk-eg120aca.js +0 -1
  196. package/dist/chunk-j7hh2ab4.js +0 -70
  197. package/dist/chunk-y8eyahwx.js +0 -1
  198. /package/client/features/chat/{ChatPromptBubbles.tsx → messages/ChatPromptBubbles.tsx} +0 -0
  199. /package/client/features/chat/{ShimmerText.tsx → messages/ShimmerText.tsx} +0 -0
  200. /package/client/features/chat/{group-turns.ts → messages/group-turns.ts} +0 -0
  201. /package/client/features/chat/{interleave-notices.ts → messages/interleave-notices.ts} +0 -0
  202. /package/client/features/chat/{preview-turn.ts → messages/preview-turn.ts} +0 -0
  203. /package/client/features/chat/{tool-group → messages/tool-group}/CodeBlock.tsx +0 -0
  204. /package/client/features/chat/{tool-group → messages/tool-group}/Collapse.tsx +0 -0
  205. /package/client/features/chat/{tool-group → messages/tool-group}/ReadImagePreview.tsx +0 -0
  206. /package/client/features/chat/{tool-group → messages/tool-group}/ToolOutput.tsx +0 -0
  207. /package/client/features/chat/{tool-group → messages/tool-group}/detect.ts +0 -0
  208. /package/client/features/chat/{tool-group → messages/tool-group}/fixtures.ts +0 -0
  209. /package/client/features/chat/{tool-group → messages/tool-group}/format/claude.ts +0 -0
  210. /package/client/features/chat/{tool-group → messages/tool-group}/format/codex.ts +0 -0
  211. /package/client/features/chat/{tool-group → messages/tool-group}/format/hermes.ts +0 -0
  212. /package/client/features/chat/{tool-group → messages/tool-group}/format/index.ts +0 -0
  213. /package/client/features/chat/{tool-group → messages/tool-group}/format/mcp.ts +0 -0
  214. /package/client/features/chat/{tool-group → messages/tool-group}/format/openclaw.ts +0 -0
  215. /package/client/features/chat/{tool-group → messages/tool-group}/format/shared.ts +0 -0
  216. /package/client/features/chat/{tool-group → messages/tool-group}/format/shell.ts +0 -0
  217. /package/client/features/chat/{tool-group → messages/tool-group}/index.ts +0 -0
  218. /package/client/features/chat/{useStickToBottom.ts → messages/useStickToBottom.ts} +0 -0
  219. /package/client/features/chat/{session-view.ts → sessions/session-view.ts} +0 -0
  220. /package/client/features/chat/{useSelectedSession.ts → sessions/useSelectedSession.ts} +0 -0
  221. /package/server/{bundler → applets}/applet-css.ts +0 -0
  222. /package/server/{bundler → applets}/build-worker.ts +0 -0
@@ -0,0 +1,68 @@
1
+ import{$ as Ev,$a as zS,$b as SS,A as N8,Aa as iw,Ab as kG,Ac as rr,B as R2,Ba as SG,Bb as AS,Bc as V5,C as wH,Ca as rw,Cb as kc,D as V8,Da as aw,Db as SM,E as BZ,Ea as ow,Eb as yc,F as TN,Fa as nw,Fb as Ea,G as m0,Ga as sw,Gb as yF,H as b2,Ha as IG,Hb as DS,I as tb,Ia as ME,Ib as h2,J as M2,Ja as MY,K as z0,Ka as Yk,Kb as ir,L as Ni,Lb as LS,M as JJ,Ma as tw,Mb as MS,N as eZ,Na as VY,Nb as tZ,O as O5,Oa as EZ,Ob as Q6,P as uP,Pa as ew,Pb as PS,Q as G0,Qa as $S,Qb as _S,R as AW,Ra as Sa,Rb as nB,S as G1,Sa as Ew,Sb as iR,T as m7,Ta as ZS,Tb as jS,U as j0,Ua as JS,Ub as OS,V as oc,Va as HS,W as Rw,Wa as BS,Wb as TS,X as Ta,Y as HC,Ya as QS,Yb as CS,Z as Ez,Za as XS,Zb as ES,_ as bw,_b as wS,aa as Xy,ab as QC,ac as gF,b as d,ba as Ti,bb as RG,bc as IS,c as a4,ca as zy,cb as AY,d as lY0,da as Cw,db as Po,dc as _v,e as F1,ea as Fy,eb as GS,ec as Ei,f as c2,fa as WJ,fb as vW,fc as RS,g as L1,ga as kw,gb as jy,h as d1,ha as yw,hc as jv,i as H0,ia as iH,ib as b5,ic as bS,j as h0,ja as xw,jb as XC,jc as kS,k as PX,ka as hw,kb as Ca,kc as a5,l as NO,la as vw,lb as KS,lc as Gd,m as U0,ma as Mo,mb as US,mc as rR,n as A2,na as gw,nb as lR,nc as qv,o as I1,oa as fw,ob as ww,oc as AK,p as q3,pa as mw,pb as YS,pc as Lv,q as TO,qa as uw,qb as oB,qc as lC,r as n0,ra as pw,rb as Zl,rc as iC,s as P1,sa as L8,sb as Ci,sc as zE,t as m3,ta as cw,tb as FS,u as EH,ua as LY,ub as WS,uc as $E,v as DT,va as B$,vb as qS,vc as e1,w as Az,wa as Zd,wb as NS,wc as Eo,x as CN,xa as BC,xb as bG,xc as GE,y as LT,ya as dw,yc as KE,z as EN,za as lw,zb as VS,zc as L4}from"/chunk-xg01f6pn.js";import{Cc as q1,Dc as A4,Ec as v5,Gc as I9}from"/chunk-p83f0jnj.js";import{Hc as p,Ic as HE,Jc as K5,Kc as mk,Lc as K2,Mc as xa}from"/chunk-m1fvqssh.js";import{Nc as _,Oc as j5,Pc as I5,Qc as uA}from"/chunk-tzz101ea.js";var i$=j5((Bn)=>{var I8=_(p());function oo($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var no=typeof Object.is==="function"?Object.is:oo,so=I8.useState,to=I8.useEffect,eo=I8.useLayoutEffect,$n=I8.useDebugValue;function Zn($,Z){var J=Z(),H=so({inst:{value:J,getSnapshot:Z}}),B=H[0].inst,Q=H[1];return eo(function(){B.value=J,B.getSnapshot=Z,Vq(B)&&Q({inst:B})},[$,J,Z]),to(function(){return Vq(B)&&Q({inst:B}),$(function(){Vq(B)&&Q({inst:B})})},[$]),$n(J),J}function Vq($){var Z=$.getSnapshot;$=$.value;try{var J=Z();return!no($,J)}catch(H){return!0}}function Jn($,Z){return Z()}var Hn=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Jn:Zn;Bn.useSyncExternalStore=I8.useSyncExternalStore!==void 0?I8.useSyncExternalStore:Hn});var cv=j5((p91,pv)=>{var gv=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,T30=/\n/g,C30=/^\s*/,E30=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,w30=/^:\s*/,S30=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,I30=/^[;\s]*/,R30=/^\s+|\s+$/g,b30=`
2
+ `,fv="/",mv="*",Y$="",k30="comment",y30="declaration";function x30($,Z){if(typeof $!=="string")throw TypeError("First argument must be a string");if(!$)return[];Z=Z||{};var J=1,H=1;function B(q){var N=q.match(T30);if(N)J+=N.length;var A=q.lastIndexOf(b30);H=~A?q.length-A:H+q.length}function Q(){var q={line:J,column:H};return function(N){return N.position=new X(q),K(),N}}function X(q){this.start=q,this.end={line:J,column:H},this.source=Z.source}X.prototype.content=$;function z(q){var N=Error(Z.source+":"+J+":"+H+": "+q);if(N.reason=q,N.filename=Z.source,N.line=J,N.column=H,N.source=$,Z.silent);else throw N}function G(q){var N=q.exec($);if(!N)return;var A=N[0];return B(A),$=$.slice(A.length),N}function K(){G(C30)}function U(q){var N;q=q||[];while(N=Y())if(N!==!1)q.push(N);return q}function Y(){var q=Q();if(fv!=$.charAt(0)||mv!=$.charAt(1))return;var N=2;while(Y$!=$.charAt(N)&&(mv!=$.charAt(N)||fv!=$.charAt(N+1)))++N;if(N+=2,Y$===$.charAt(N-1))return z("End of comment missing");var A=$.slice(2,N-2);return H+=2,B(A),$=$.slice(N),H+=2,q({type:k30,comment:A})}function F(){var q=Q(),N=G(E30);if(!N)return;if(Y(),!G(w30))return z("property missing ':'");var A=G(S30),V=q({type:y30,property:uv(N[0].replace(gv,Y$)),value:A?uv(A[0].replace(gv,Y$)):Y$});return G(I30),V}function W(){var q=[];U(q);var N;while(N=F())if(N!==!1)q.push(N),U(q);return q}return K(),W()}function uv($){return $?$.replace(R30,Y$):Y$}pv.exports=x30});var dv=j5(($Q)=>{var h30=$Q&&$Q.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty($Q,"__esModule",{value:!0});$Q.default=g30;var v30=h30(cv());function g30($,Z){let J=null;if(!$||typeof $!=="string")return J;let H=(0,v30.default)($),B=typeof Z==="function";return H.forEach((Q)=>{if(Q.type!=="declaration")return;let{property:X,value:z}=Q;if(B)Z(X,z,Q);else if(z)J=J||{},J[X]=z}),J}});var av=j5((iv)=>{Object.defineProperty(iv,"__esModule",{value:!0});iv.camelCase=void 0;var f30=/^--[a-zA-Z0-9_-]+$/,m30=/-([a-z])/g,u30=/^[^-]+$/,p30=/^-(webkit|moz|ms|o|khtml)-/,c30=/^-(ms)-/,d30=function($){return!$||u30.test($)||f30.test($)},l30=function($,Z){return Z.toUpperCase()},lv=function($,Z){return"".concat(Z,"-")},i30=function($,Z){if(Z===void 0)Z={};if(d30($))return $;if($=$.toLowerCase(),Z.reactCompat)$=$.replace(c30,lv);else $=$.replace(p30,lv);return $.replace(m30,l30)};iv.camelCase=i30});var nv=j5((vD,ov)=>{var r30=vD&&vD.__importDefault||function($){return $&&$.__esModule?$:{default:$}},a30=r30(dv()),o30=av();function hD($,Z){var J={};if(!$||typeof $!=="string")return J;return(0,a30.default)($,function(H,B){if(H&&B)J[(0,o30.camelCase)(H,Z)]=B}),J}hD.default=hD;ov.exports=hD});var Af=j5((kJ1,Vf)=>{var sY=Object.prototype.hasOwnProperty,Nf=Object.prototype.toString,Kf=Object.defineProperty,Uf=Object.getOwnPropertyDescriptor,Yf=function(Z){if(typeof Array.isArray==="function")return Array.isArray(Z);return Nf.call(Z)==="[object Array]"},Ff=function(Z){if(!Z||Nf.call(Z)!=="[object Object]")return!1;var J=sY.call(Z,"constructor"),H=Z.constructor&&Z.constructor.prototype&&sY.call(Z.constructor.prototype,"isPrototypeOf");if(Z.constructor&&!J&&!H)return!1;var B;for(B in Z);return typeof B>"u"||sY.call(Z,B)},Wf=function(Z,J){if(Kf&&J.name==="__proto__")Kf(Z,J.name,{enumerable:!0,configurable:!0,value:J.newValue,writable:!0});else Z[J.name]=J.newValue},qf=function(Z,J){if(J==="__proto__"){if(!sY.call(Z,J))return;else if(Uf)return Uf(Z,J).value}return Z[J]};Vf.exports=function $(){var Z,J,H,B,Q,X,z=arguments[0],G=1,K=arguments.length,U=!1;if(typeof z==="boolean")U=z,z=arguments[1]||{},G=2;if(z==null||typeof z!=="object"&&typeof z!=="function")z={};for(;G<K;++G)if(Z=arguments[G],Z!=null){for(J in Z)if(H=qf(z,J),B=qf(Z,J),z!==B){if(U&&B&&(Ff(B)||(Q=Yf(B)))){if(Q)Q=!1,X=H&&Yf(H)?H:[];else X=H&&Ff(H)?H:{};Wf(z,{name:J,newValue:$(U,X,B)})}else if(typeof B<"u")Wf(z,{name:J,newValue:B})}}return z}});var Ku=j5(($Q1,Gu)=>{function rm($){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],H=typeof J;if((H==="object"||H==="function")&&!Object.isFrozen(J))rm(J)}),$}class wL{constructor($){if($.data===void 0)$.data={};this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function am($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function c6($,...Z){let J=Object.create(null);for(let H in $)J[H]=$[H];return Z.forEach(function(H){for(let B in H)J[B]=H[B]}),J}var MZ0="</span>",um=($)=>{return!!$.scope},PZ0=($,{prefix:Z})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){let J=$.split(".");return[`${Z}${J.shift()}`,...J.map((H,B)=>`${H}${"_".repeat(B+1)}`)].join(" ")}return`${Z}${$}`};class om{constructor($,Z){this.buffer="",this.classPrefix=Z.classPrefix,$.walk(this)}addText($){this.buffer+=am($)}openNode($){if(!um($))return;let Z=PZ0($.scope,{prefix:this.classPrefix});this.span(Z)}closeNode($){if(!um($))return;this.buffer+=MZ0}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}var pm=($={})=>{let Z={children:[]};return Object.assign(Z,$),Z};class SL{constructor(){this.rootNode=pm(),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=pm({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)=>{SL._collapse(Z)})}}class nm extends SL{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 om(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function AQ($){if(!$)return null;if(typeof $==="string")return $;return $.source}function sm($){return P$("(?=",$,")")}function _Z0($){return P$("(?:",$,")*")}function jZ0($){return P$("(?:",$,")?")}function P$(...$){return $.map((J)=>AQ(J)).join("")}function OZ0($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function IL(...$){return"("+(OZ0($).capture?"":"?:")+$.map((H)=>AQ(H)).join("|")+")"}function tm($){return new RegExp($.toString()+"|").exec("").length-1}function TZ0($,Z){let J=$&&$.exec(Z);return J&&J.index===0}var CZ0=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function RL($,{joinWith:Z}){let J=0;return $.map((H)=>{J+=1;let B=J,Q=AQ(H),X="";while(Q.length>0){let z=CZ0.exec(Q);if(!z){X+=Q;break}if(X+=Q.substring(0,z.index),Q=Q.substring(z.index+z[0].length),z[0][0]==="\\"&&z[1])X+="\\"+String(Number(z[1])+B);else if(X+=z[0],z[0]==="(")J++}return X}).map((H)=>`(${H})`).join(Z)}var EZ0=/\b\B/,em="[a-zA-Z]\\w*",bL="[a-zA-Z_]\\w*",$u="\\b\\d+(\\.\\d+)?",Zu="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ju="\\b(0b[01]+)",wZ0="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SZ0=($={})=>{let Z=/^#![ ]*\//;if($.binary)$.begin=P$(Z,/.*\b/,$.binary,/\b.*/);return c6({scope:"meta",begin:Z,end:/$/,relevance:0,"on:begin":(J,H)=>{if(J.index!==0)H.ignoreMatch()}},$)},DQ={begin:"\\\\[\\s\\S]",relevance:0},IZ0={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[DQ]},RZ0={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[DQ]},bZ0={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/},YF=function($,Z,J={}){let H=c6({scope:"comment",begin:$,end:Z,contains:[]},J);H.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let B=IL("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return H.contains.push({begin:P$(/[ ]+/,"(",B,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),H},kZ0=YF("//","$"),yZ0=YF("/\\*","\\*/"),xZ0=YF("#","$"),hZ0={scope:"number",begin:$u,relevance:0},vZ0={scope:"number",begin:Zu,relevance:0},gZ0={scope:"number",begin:Ju,relevance:0},fZ0={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[DQ,{begin:/\[/,end:/\]/,relevance:0,contains:[DQ]}]},mZ0={scope:"title",begin:em,relevance:0},uZ0={scope:"title",begin:bL,relevance:0},pZ0={begin:"\\.\\s*"+bL,relevance:0},cZ0=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()}})},KF=Object.freeze({__proto__:null,APOS_STRING_MODE:IZ0,BACKSLASH_ESCAPE:DQ,BINARY_NUMBER_MODE:gZ0,BINARY_NUMBER_RE:Ju,COMMENT:YF,C_BLOCK_COMMENT_MODE:yZ0,C_LINE_COMMENT_MODE:kZ0,C_NUMBER_MODE:vZ0,C_NUMBER_RE:Zu,END_SAME_AS_BEGIN:cZ0,HASH_COMMENT_MODE:xZ0,IDENT_RE:em,MATCH_NOTHING_RE:EZ0,METHOD_GUARD:pZ0,NUMBER_MODE:hZ0,NUMBER_RE:$u,PHRASAL_WORDS_MODE:bZ0,QUOTE_STRING_MODE:RZ0,REGEXP_MODE:fZ0,RE_STARTERS_RE:wZ0,SHEBANG:SZ0,TITLE_MODE:mZ0,UNDERSCORE_IDENT_RE:bL,UNDERSCORE_TITLE_MODE:uZ0});function dZ0($,Z){if($.input[$.index-1]===".")Z.ignoreMatch()}function lZ0($,Z){if($.className!==void 0)$.scope=$.className,delete $.className}function iZ0($,Z){if(!Z)return;if(!$.beginKeywords)return;if($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=dZ0,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0)$.relevance=0}function rZ0($,Z){if(!Array.isArray($.illegal))return;$.illegal=IL(...$.illegal)}function aZ0($,Z){if(!$.match)return;if($.begin||$.end)throw Error("begin & end are not supported with match");$.begin=$.match,delete $.match}function oZ0($,Z){if($.relevance===void 0)$.relevance=1}var nZ0=($,Z)=>{if(!$.beforeMatch)return;if($.starts)throw Error("beforeMatch cannot be used with starts");let J=Object.assign({},$);Object.keys($).forEach((H)=>{delete $[H]}),$.keywords=J.keywords,$.begin=P$(J.beforeMatch,sm(J.begin)),$.starts={relevance:0,contains:[Object.assign(J,{endsParent:!0})]},$.relevance=0,delete J.beforeMatch},sZ0=["of","and","for","in","not","or","if","then","parent","list","value"],tZ0="keyword";function Hu($,Z,J=tZ0){let H=Object.create(null);if(typeof $==="string")B(J,$.split(" "));else if(Array.isArray($))B(J,$);else Object.keys($).forEach(function(Q){Object.assign(H,Hu($[Q],Z,Q))});return H;function B(Q,X){if(Z)X=X.map((z)=>z.toLowerCase());X.forEach(function(z){let G=z.split("|");H[G[0]]=[Q,eZ0(G[0],G[1])]})}}function eZ0($,Z){if(Z)return Number(Z);return $J0($)?0:1}function $J0($){return sZ0.includes($.toLowerCase())}var cm={},M$=($)=>{console.error($)},dm=($,...Z)=>{console.log(`WARN: ${$}`,...Z)},CJ=($,Z)=>{if(cm[`${$}/${Z}`])return;console.log(`Deprecated as of ${$}. ${Z}`),cm[`${$}/${Z}`]=!0},UF=Error();function Bu($,Z,{key:J}){let H=0,B=$[J],Q={},X={};for(let z=1;z<=Z.length;z++)X[z+H]=B[z],Q[z+H]=!0,H+=tm(Z[z-1]);$[J]=X,$[J]._emit=Q,$[J]._multi=!0}function ZJ0($){if(!Array.isArray($.begin))return;if($.skip||$.excludeBegin||$.returnBegin)throw M$("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),UF;if(typeof $.beginScope!=="object"||$.beginScope===null)throw M$("beginScope must be object"),UF;Bu($,$.begin,{key:"beginScope"}),$.begin=RL($.begin,{joinWith:""})}function JJ0($){if(!Array.isArray($.end))return;if($.skip||$.excludeEnd||$.returnEnd)throw M$("skip, excludeEnd, returnEnd not compatible with endScope: {}"),UF;if(typeof $.endScope!=="object"||$.endScope===null)throw M$("endScope must be object"),UF;Bu($,$.end,{key:"endScope"}),$.end=RL($.end,{joinWith:""})}function HJ0($){if($.scope&&typeof $.scope==="object"&&$.scope!==null)$.beginScope=$.scope,delete $.scope}function BJ0($){if(HJ0($),typeof $.beginScope==="string")$.beginScope={_wrap:$.beginScope};if(typeof $.endScope==="string")$.endScope={_wrap:$.endScope};ZJ0($),JJ0($)}function QJ0($){function Z(X,z){return new RegExp(AQ(X),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(z?"g":""))}class J{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(X,z){z.position=this.position++,this.matchIndexes[this.matchAt]=z,this.regexes.push([z,X]),this.matchAt+=tm(X)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let X=this.regexes.map((z)=>z[1]);this.matcherRe=Z(RL(X,{joinWith:"|"}),!0),this.lastIndex=0}exec(X){this.matcherRe.lastIndex=this.lastIndex;let z=this.matcherRe.exec(X);if(!z)return null;let G=z.findIndex((U,Y)=>Y>0&&U!==void 0),K=this.matchIndexes[G];return z.splice(0,G),Object.assign(z,K)}}class H{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(X){if(this.multiRegexes[X])return this.multiRegexes[X];let z=new J;return this.rules.slice(X).forEach(([G,K])=>z.addRule(G,K)),z.compile(),this.multiRegexes[X]=z,z}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(X,z){if(this.rules.push([X,z]),z.type==="begin")this.count++}exec(X){let z=this.getMatcher(this.regexIndex);z.lastIndex=this.lastIndex;let G=z.exec(X);if(this.resumingScanAtSamePosition())if(G&&G.index===this.lastIndex);else{let K=this.getMatcher(0);K.lastIndex=this.lastIndex+1,G=K.exec(X)}if(G){if(this.regexIndex+=G.position+1,this.regexIndex===this.count)this.considerAll()}return G}}function B(X){let z=new H;if(X.contains.forEach((G)=>z.addRule(G.begin,{rule:G,type:"begin"})),X.terminatorEnd)z.addRule(X.terminatorEnd,{type:"end"});if(X.illegal)z.addRule(X.illegal,{type:"illegal"});return z}function Q(X,z){let G=X;if(X.isCompiled)return G;[lZ0,aZ0,BJ0,nZ0].forEach((U)=>U(X,z)),$.compilerExtensions.forEach((U)=>U(X,z)),X.__beforeBegin=null,[iZ0,rZ0,oZ0].forEach((U)=>U(X,z)),X.isCompiled=!0;let K=null;if(typeof X.keywords==="object"&&X.keywords.$pattern)X.keywords=Object.assign({},X.keywords),K=X.keywords.$pattern,delete X.keywords.$pattern;if(K=K||/\w+/,X.keywords)X.keywords=Hu(X.keywords,$.case_insensitive);if(G.keywordPatternRe=Z(K,!0),z){if(!X.begin)X.begin=/\B|\b/;if(G.beginRe=Z(G.begin),!X.end&&!X.endsWithParent)X.end=/\B|\b/;if(X.end)G.endRe=Z(G.end);if(G.terminatorEnd=AQ(G.end)||"",X.endsWithParent&&z.terminatorEnd)G.terminatorEnd+=(X.end?"|":"")+z.terminatorEnd}if(X.illegal)G.illegalRe=Z(X.illegal);if(!X.contains)X.contains=[];if(X.contains=[].concat(...X.contains.map(function(U){return XJ0(U==="self"?X:U)})),X.contains.forEach(function(U){Q(U,G)}),X.starts)Q(X.starts,z);return G.matcher=B(G),G}if(!$.compilerExtensions)$.compilerExtensions=[];if($.contains&&$.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return $.classNameAliases=c6($.classNameAliases||{}),Q($)}function Qu($){if(!$)return!1;return $.endsWithParent||Qu($.starts)}function XJ0($){if($.variants&&!$.cachedVariants)$.cachedVariants=$.variants.map(function(Z){return c6($,{variants:null},Z)});if($.cachedVariants)return $.cachedVariants;if(Qu($))return c6($,{starts:$.starts?c6($.starts):null});if(Object.isFrozen($))return c6($);return $}var zJ0="11.11.1";class Xu extends Error{constructor($,Z){super($);this.name="HTMLInjectionError",this.html=Z}}var EL=am,lm=c6,im=Symbol("nomatch"),GJ0=7,zu=function($){let Z=Object.create(null),J=Object.create(null),H=[],B=!0,Q="Could not find the language '{}', did you forget to load/include a language module?",X={disableAutodetect:!0,name:"Plain text",contains:[]},z={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:nm};function G(I){return z.noHighlightRe.test(I)}function K(I){let v=I.className+" ";v+=I.parentNode?I.parentNode.className:"";let h=z.languageDetectRe.exec(v);if(h){let f=C(h[1]);if(!f)dm(Q.replace("{}",h[1])),dm("Falling back to no-highlight mode for this block.",I);return f?h[1]:"no-highlight"}return v.split(/\s+/).find((f)=>G(f)||C(f))}function U(I,v,h){let f="",E="";if(typeof v==="object")f=I,h=v.ignoreIllegals,E=v.language;else CJ("10.7.0","highlight(lang, code, ...args) has been deprecated."),CJ("10.7.0",`Please use highlight(code, options) instead.
3
+ https://github.com/highlightjs/highlight.js/issues/2277`),E=I,f=v;if(h===void 0)h=!0;let i={code:f,language:E};T("before:highlight",i);let r=i.result?i.result:Y(i.language,i.code,h);return r.code=i.code,T("after:highlight",r),r}function Y(I,v,h,f){let E=Object.create(null);function i(g,m){return g.keywords[m]}function r(){if(!a.keywords){$0.addText(B0);return}let g=0;a.keywordPatternRe.lastIndex=0;let m=a.keywordPatternRe.exec(B0),t="";while(m){t+=B0.substring(g,m.index);let W0=N0.case_insensitive?m[0].toLowerCase():m[0],R0=i(a,W0);if(R0){let[c0,f0]=R0;if($0.addText(t),t="",E[W0]=(E[W0]||0)+1,E[W0]<=GJ0)_0+=f0;if(c0.startsWith("_"))t+=m[0];else{let T0=N0.classNameAliases[c0]||c0;o(m[0],T0)}}else t+=m[0];g=a.keywordPatternRe.lastIndex,m=a.keywordPatternRe.exec(B0)}t+=B0.substring(g),$0.addText(t)}function x(){if(B0==="")return;let g=null;if(typeof a.subLanguage==="string"){if(!Z[a.subLanguage]){$0.addText(B0);return}g=Y(a.subLanguage,B0,!0,e[a.subLanguage]),e[a.subLanguage]=g._top}else g=W(B0,a.subLanguage.length?a.subLanguage:null);if(a.relevance>0)_0+=g.relevance;$0.__addSublanguage(g._emitter,g.language)}function l(){if(a.subLanguage!=null)x();else r();B0=""}function o(g,m){if(g==="")return;$0.startScope(m),$0.addText(g),$0.endScope()}function u(g,m){let t=1,W0=m.length-1;while(t<=W0){if(!g._emit[t]){t++;continue}let R0=N0.classNameAliases[g[t]]||g[t],c0=m[t];if(R0)o(c0,R0);else B0=c0,r(),B0="";t++}}function c(g,m){if(g.scope&&typeof g.scope==="string")$0.openNode(N0.classNameAliases[g.scope]||g.scope);if(g.beginScope){if(g.beginScope._wrap)o(B0,N0.classNameAliases[g.beginScope._wrap]||g.beginScope._wrap),B0="";else if(g.beginScope._multi)u(g.beginScope,m),B0=""}return a=Object.create(g,{parent:{value:a}}),a}function n(g,m,t){let W0=TZ0(g.endRe,t);if(W0){if(g["on:end"]){let R0=new wL(g);if(g["on:end"](m,R0),R0.isMatchIgnored)W0=!1}if(W0){while(g.endsParent&&g.parent)g=g.parent;return g}}if(g.endsWithParent)return n(g.parent,m,t)}function Z0(g){if(a.matcher.regexIndex===0)return B0+=g[0],1;else return L0=!0,0}function J0(g){let m=g[0],t=g.rule,W0=new wL(t),R0=[t.__beforeBegin,t["on:begin"]];for(let c0 of R0){if(!c0)continue;if(c0(g,W0),W0.isMatchIgnored)return Z0(m)}if(t.skip)B0+=m;else{if(t.excludeBegin)B0+=m;if(l(),!t.returnBegin&&!t.excludeBegin)B0=m}return c(t,g),t.returnBegin?0:m.length}function X0(g){let m=g[0],t=v.substring(g.index),W0=n(a,g,t);if(!W0)return im;let R0=a;if(a.endScope&&a.endScope._wrap)l(),o(m,a.endScope._wrap);else if(a.endScope&&a.endScope._multi)l(),u(a.endScope,g);else if(R0.skip)B0+=m;else{if(!(R0.returnEnd||R0.excludeEnd))B0+=m;if(l(),R0.excludeEnd)B0=m}do{if(a.scope)$0.closeNode();if(!a.skip&&!a.subLanguage)_0+=a.relevance;a=a.parent}while(a!==W0.parent);if(W0.starts)c(W0.starts,g);return R0.returnEnd?0:m.length}function Q0(){let g=[];for(let m=a;m!==N0;m=m.parent)if(m.scope)g.unshift(m.scope);g.forEach((m)=>$0.openNode(m))}let F0={};function A0(g,m){let t=m&&m[0];if(B0+=g,t==null)return l(),0;if(F0.type==="begin"&&m.type==="end"&&F0.index===m.index&&t===""){if(B0+=v.slice(m.index,m.index+1),!B){let W0=Error(`0 width match regex (${I})`);throw W0.languageName=I,W0.badRule=F0.rule,W0}return 1}if(F0=m,m.type==="begin")return J0(m);else if(m.type==="illegal"&&!h){let W0=Error('Illegal lexeme "'+t+'" for mode "'+(a.scope||"<unnamed>")+'"');throw W0.mode=a,W0}else if(m.type==="end"){let W0=X0(m);if(W0!==im)return W0}if(m.type==="illegal"&&t==="")return B0+=`
4
+ `,1;if(V0>1e5&&V0>m.index*3)throw Error("potential infinite loop, way more iterations than matches");return B0+=t,t.length}let N0=C(I);if(!N0)throw M$(Q.replace("{}",I)),Error('Unknown language: "'+I+'"');let Y0=QJ0(N0),s="",a=f||Y0,e={},$0=new z.__emitter(z);Q0();let B0="",_0=0,M0=0,V0=0,L0=!1;try{if(!N0.__emitTokens){a.matcher.considerAll();for(;;){if(V0++,L0)L0=!1;else a.matcher.considerAll();a.matcher.lastIndex=M0;let g=a.matcher.exec(v);if(!g)break;let m=v.substring(M0,g.index),t=A0(m,g);M0=g.index+t}A0(v.substring(M0))}else N0.__emitTokens(v,$0);return $0.finalize(),s=$0.toHTML(),{language:I,value:s,relevance:_0,illegal:!1,_emitter:$0,_top:a}}catch(g){if(g.message&&g.message.includes("Illegal"))return{language:I,value:EL(v),illegal:!0,relevance:0,_illegalBy:{message:g.message,index:M0,context:v.slice(M0-100,M0+100),mode:g.mode,resultSoFar:s},_emitter:$0};else if(B)return{language:I,value:EL(v),illegal:!1,relevance:0,errorRaised:g,_emitter:$0,_top:a};else throw g}}function F(I){let v={value:EL(I),illegal:!1,relevance:0,_top:X,_emitter:new z.__emitter(z)};return v._emitter.addText(I),v}function W(I,v){v=v||z.languages||Object.keys(Z);let h=F(I),f=v.filter(C).filter(O).map((l)=>Y(l,I,!1));f.unshift(h);let E=f.sort((l,o)=>{if(l.relevance!==o.relevance)return o.relevance-l.relevance;if(l.language&&o.language){if(C(l.language).supersetOf===o.language)return 1;else if(C(o.language).supersetOf===l.language)return-1}return 0}),[i,r]=E,x=i;return x.secondBest=r,x}function q(I,v,h){let f=v&&J[v]||h;I.classList.add("hljs"),I.classList.add(`language-${f}`)}function N(I){let v=null,h=K(I);if(G(h))return;if(T("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 Xu("One of your code blocks includes unescaped HTML.",I.innerHTML)}v=I;let f=v.textContent,E=h?U(f,{language:h,ignoreIllegals:!0}):W(f);if(I.innerHTML=E.value,I.dataset.highlighted="yes",q(I,h,E.language),I.result={language:E.language,re:E.relevance,relevance:E.relevance},E.secondBest)I.secondBest={language:E.secondBest.language,relevance:E.secondBest.relevance};T("after:highlightElement",{el:I,result:E,text:f})}function A(I){z=lm(z,I)}let V=()=>{j(),CJ("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function D(){j(),CJ("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let L=!1;function j(){function I(){j()}if(document.readyState==="loading"){if(!L)window.addEventListener("DOMContentLoaded",I,!1);L=!0;return}document.querySelectorAll(z.cssSelector).forEach(N)}function M(I,v){let h=null;try{h=v($)}catch(f){if(M$("Language definition for '{}' could not be registered.".replace("{}",I)),!B)throw f;else M$(f);h=X}if(!h.name)h.name=I;if(Z[I]=h,h.rawDefinition=v.bind(null,$),h.aliases)R(h.aliases,{languageName:I})}function P(I){delete Z[I];for(let v of Object.keys(J))if(J[v]===I)delete J[v]}function w(){return Object.keys(Z)}function C(I){return I=(I||"").toLowerCase(),Z[I]||Z[J[I]]}function R(I,{languageName:v}){if(typeof I==="string")I=[I];I.forEach((h)=>{J[h.toLowerCase()]=v})}function O(I){let v=C(I);return v&&!v.disableAutodetect}function S(I){if(I["before:highlightBlock"]&&!I["before:highlightElement"])I["before:highlightElement"]=(v)=>{I["before:highlightBlock"](Object.assign({block:v.el},v))};if(I["after:highlightBlock"]&&!I["after:highlightElement"])I["after:highlightElement"]=(v)=>{I["after:highlightBlock"](Object.assign({block:v.el},v))}}function y(I){S(I),H.push(I)}function k(I){let v=H.indexOf(I);if(v!==-1)H.splice(v,1)}function T(I,v){let h=I;H.forEach(function(f){if(f[h])f[h](v)})}function b(I){return CJ("10.7.0","highlightBlock will be removed entirely in v12.0"),CJ("10.7.0","Please use highlightElement now."),N(I)}Object.assign($,{highlight:U,highlightAuto:W,highlightAll:j,highlightElement:N,highlightBlock:b,configure:A,initHighlighting:V,initHighlightingOnLoad:D,registerLanguage:M,unregisterLanguage:P,listLanguages:w,getLanguage:C,registerAliases:R,autoDetection:O,inherit:lm,addPlugin:y,removePlugin:k}),$.debugMode=function(){B=!1},$.safeMode=function(){B=!0},$.versionString=zJ0,$.regex={concat:P$,lookahead:sm,either:IL,optional:jZ0,anyNumberOfTimes:_Z0};for(let I in KF)if(typeof KF[I]==="object")rm(KF[I]);return Object.assign($,KF),$},EJ=zu({});EJ.newInstance=()=>zu({});Gu.exports=EJ;EJ.HighlightJS=EJ;EJ.default=EJ});var Uc=j5((ZY1,Kc)=>{var xB0=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],Gc=/[\n\r\u2028\u2029]/,hB0=/[\s#!"$&'():;<=>@\\^`|]/g;Kc.exports=function(Z){return Z.map(function(J){if(J==="")return"''";if(J&&typeof J==="object"){if("op"in J&&J.op==="glob"){if(typeof J.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(Gc.test(J.pattern))throw TypeError("glob `pattern` must not contain line terminators");return J.pattern.replace(hB0,"\\$&")}if("op"in J&&typeof J.op==="string"){if(xB0.indexOf(J.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(J.op));return J.op.replace(/[\s\S]/g,"\\$&")}if("comment"in J&&typeof J.comment==="string"){if(Gc.test(J.comment))throw TypeError("`comment` must not contain line terminators");return"#"+J.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(J)&&!/'/.test(J))return"'"+J.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(J))return'"'+J.replace(/(["\\$`!])/g,"\\$1")+'"';return String(J).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}});var Ac=j5((JY1,Vc)=>{var Nc="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",Yc=new RegExp("^"+Nc+"$"),Fc="|&;()<> \\t",vB0="'([^']*?)'",gB0='"((\\\\"|[^"])*?)"',fB0=/^#$/,Wc="'",qc='"',PF="$",O$="",mB0=4294967296;for(_F=0;_F<4;_F++)O$+=(mB0*Math.random()).toString(16);var _F,uB0=new RegExp("^"+O$);function pB0($,Z){var J=Z.lastIndex,H=[],B;while(B=Z.exec($))if(H[H.length]=B,Z.lastIndex===B.index)Z.lastIndex+=1;return Z.lastIndex=J,H}function cB0($,Z,J){var H=typeof $==="function"?$(J):$[J];if(typeof H>"u"&&J!="")H="";else if(typeof H>"u")H="$";if(typeof H==="object")return Z+O$+JSON.stringify(H)+O$;return Z+H}function dB0($,Z,J){if(!J)J={};var H=J.escape||"\\",B=J.splitUnquoted===!0?`
5
+ `:typeof J.splitUnquoted==="string"?J.splitUnquoted:"",Q="(\\"+H+`['"`+Fc+`]|[^\\s'"`+Fc+"])+",X=new RegExp(["("+Nc+")","("+Q+"|"+gB0+"|"+vB0+")+"].join("|"),"g"),z=pB0($,X);if(z.length===0)return[];if(!Z)Z={};var G=!1;return z.map(function(K){var U=K[0];if(!U||G)return;if(Yc.test(U))return{op:U};var Y=!1,F=!1,W="",q=[],N=!1,A=null,V=!1,D;function L(){D+=1;var S,y,k=U.charAt(D);if(k==="{"){if(D+=1,U.charAt(D)==="}")throw Error("Bad substitution: "+U.slice(D-2,D+1));var T=1;S=D;while(T>0&&S<U.length){if(U.charAt(S)==="{"&&U.charAt(S-1)==="$")T+=1;else if(U.charAt(S)==="}")T-=1;S+=1}if(T!==0)throw Error("Bad substitution: "+U.slice(D));S-=1,y=U.slice(D,S),D=S}else if(/[*@#?$!_-]/.test(k))y=k,D+=1;else{var b=U.slice(D);if(S=b.match(/[^\w\d_]/),!S)y=b,D=U.length;else y=b.slice(0,S.index),D+=S.index-1}return cB0(Z,"",y)}function j(){if(A===null)return;if(A===0){if(W!=="")q[q.length]=W,W=""}else{q[q.length]=W,W="";for(var S=1;S<A;S+=1)q[q.length]=""}A=null}for(D=0;D<U.length;D++){var M=U.charAt(D);if(B&&M!==PF)j();if(V=V||!Y&&(M==="*"||M==="?"),F)W+=M,F=!1;else if(Y)if(M===Y)Y=!1;else if(Y==Wc)W+=M;else if(M===H)if(D+=1,M=U.charAt(D),M===qc||M===H||M===PF)W+=M;else W+=H+M;else if(M===PF)W+=L();else W+=M;else if(M===qc||M===Wc)Y=M,N=!0;else if(Yc.test(M))return{op:U};else if(fB0.test(M)){G=!0;var P={comment:$.slice(K.index+D+1)};if(W.length)return[W,P];return[P]}else if(M===H)F=!0;else if(M===PF){var w=L();if(!B)W+=w;else for(var C=0;C<w.length;C+=1){var R=w.charAt(C);if(B.indexOf(R)<0)j(),W+=R;else if(A===null)A=R===" "||R==="\t"||R===`
6
+ `?0:1;else if(R!==" "&&R!=="\t"&&R!==`
7
+ `)A+=1}}else W+=M}if(V)return{op:"glob",pattern:W};if(B){if(A!==null&&A>0){q[q.length]=W,W="";for(var O=1;O<A;O+=1)q[q.length]=""}if(W!==""||N&&q.length===0)q[q.length]=W;return q}return W}).reduce(function(K,U){if(typeof U>"u")return K;return[].concat(U).forEach(function(Y){K[K.length]=Y}),K},[])}Vc.exports=function(Z,J,H){var B=dB0(Z,J,H);if(typeof J!=="function")return B;return B.reduce(function(Q,X){if(typeof X==="object")return Q[Q.length]=X,Q;var z=X.split(RegExp("("+O$+".*?"+O$+")","g"));if(z.length===1)return Q[Q.length]=z[0],Q;return z.filter(Boolean).forEach(function(G){Q[Q.length]=uB0.test(G)?JSON.parse(G.split(O$)[1]):G}),Q},[])}});var li=j5((TW,di)=>{(function($,Z){typeof TW==="object"&&typeof di<"u"?Z(TW):typeof define==="function"&&define.amd?define(["exports"],Z):($=typeof globalThis<"u"?globalThis:$||self,Z($["fast-equals"]={}))})(TW,function($){function Z(u){return function(n,Z0,J0,X0,Q0,F0,A0){return u(n,Z0,A0)}}function J(u){return function(n,Z0,J0,X0){if(!n||!Z0||typeof n!=="object"||typeof Z0!=="object")return u(n,Z0,J0,X0);var Q0=X0.get(n),F0=X0.get(Z0);if(Q0&&F0)return Q0===Z0&&F0===n;X0.set(n,Z0),X0.set(Z0,n);var A0=u(n,Z0,J0,X0);return X0.delete(n),X0.delete(Z0),A0}}function H(u,c){var n={};for(var Z0 in u)n[Z0]=u[Z0];for(var Z0 in c)n[Z0]=c[Z0];return n}function B(u){return u.constructor===Object||u.constructor==null}function Q(u){return typeof u.then==="function"}function X(u,c){return u===c||u!==u&&c!==c}var z="[object Arguments]",G="[object Boolean]",K="[object Date]",U="[object RegExp]",Y="[object Map]",F="[object Number]",W="[object Object]",q="[object Set]",N="[object String]",A=Object.prototype.toString;function V(u){var{areArraysEqual:c,areDatesEqual:n,areMapsEqual:Z0,areObjectsEqual:J0,areRegExpsEqual:X0,areSetsEqual:Q0,createIsNestedEqual:F0}=u,A0=F0(N0);function N0(Y0,s,a){if(Y0===s)return!0;if(!Y0||!s||typeof Y0!=="object"||typeof s!=="object")return Y0!==Y0&&s!==s;if(B(Y0)&&B(s))return J0(Y0,s,A0,a);var e=Array.isArray(Y0),$0=Array.isArray(s);if(e||$0)return e===$0&&c(Y0,s,A0,a);var B0=A.call(Y0);if(B0!==A.call(s))return!1;if(B0===K)return n(Y0,s,A0,a);if(B0===U)return X0(Y0,s,A0,a);if(B0===Y)return Z0(Y0,s,A0,a);if(B0===q)return Q0(Y0,s,A0,a);if(B0===W||B0===z)return Q(Y0)||Q(s)?!1:J0(Y0,s,A0,a);if(B0===G||B0===F||B0===N)return X(Y0.valueOf(),s.valueOf());return!1}return N0}function D(u,c,n,Z0){var J0=u.length;if(c.length!==J0)return!1;while(J0-- >0)if(!n(u[J0],c[J0],J0,J0,u,c,Z0))return!1;return!0}var L=J(D);function j(u,c){return X(u.valueOf(),c.valueOf())}function M(u,c,n,Z0){var J0=u.size===c.size;if(!J0)return!1;if(!u.size)return!0;var X0={},Q0=0;return u.forEach(function(F0,A0){if(!J0)return;var N0=!1,Y0=0;c.forEach(function(s,a){if(!N0&&!X0[Y0]&&(N0=n(A0,a,Q0,Y0,u,c,Z0)&&n(F0,s,A0,a,u,c,Z0)))X0[Y0]=!0;Y0++}),Q0++,J0=N0}),J0}var P=J(M),w="_owner",C=Object.prototype.hasOwnProperty;function R(u,c,n,Z0){var J0=Object.keys(u),X0=J0.length;if(Object.keys(c).length!==X0)return!1;var Q0;while(X0-- >0){if(Q0=J0[X0],Q0===w){var F0=!!u.$$typeof,A0=!!c.$$typeof;if((F0||A0)&&F0!==A0)return!1}if(!C.call(c,Q0)||!n(u[Q0],c[Q0],Q0,Q0,u,c,Z0))return!1}return!0}var O=J(R);function S(u,c){return u.source===c.source&&u.flags===c.flags}function y(u,c,n,Z0){var J0=u.size===c.size;if(!J0)return!1;if(!u.size)return!0;var X0={};return u.forEach(function(Q0,F0){if(!J0)return;var A0=!1,N0=0;c.forEach(function(Y0,s){if(!A0&&!X0[N0]&&(A0=n(Q0,Y0,F0,s,u,c,Z0)))X0[N0]=!0;N0++}),J0=A0}),J0}var k=J(y),T=Object.freeze({areArraysEqual:D,areDatesEqual:j,areMapsEqual:M,areObjectsEqual:R,areRegExpsEqual:S,areSetsEqual:y,createIsNestedEqual:Z}),b=Object.freeze({areArraysEqual:L,areDatesEqual:j,areMapsEqual:P,areObjectsEqual:O,areRegExpsEqual:S,areSetsEqual:k,createIsNestedEqual:Z}),I=V(T);function v(u,c){return I(u,c,void 0)}var h=V(H(T,{createIsNestedEqual:function(){return X}}));function f(u,c){return h(u,c,void 0)}var E=V(b);function i(u,c){return E(u,c,new WeakMap)}var r=V(H(b,{createIsNestedEqual:function(){return X}}));function x(u,c){return r(u,c,new WeakMap)}function l(u){return V(H(T,u(T)))}function o(u){var c=V(H(b,u(b)));return function(n,Z0,J0){if(J0===void 0)J0=new WeakMap;return c(n,Z0,J0)}}$.circularDeepEqual=i,$.circularShallowEqual=x,$.createCustomCircularEqual=o,$.createCustomEqual=l,$.deepEqual=v,$.sameValueZeroEqual=X,$.shallowEqual=f,Object.defineProperty($,"__esModule",{value:!0})})});var ri=j5((pL1,ii)=>{var AG0="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";ii.exports=AG0});var si=j5((cL1,ni)=>{var DG0=ri();function ai(){}function oi(){}oi.resetWarningCache=ai;ni.exports=function(){function $(H,B,Q,X,z,G){if(G===DG0)return;var K=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 K.name="Invariant Violation",K}$.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:oi,resetWarningCache:ai};return J.PropTypes=J,J}});var lQ=j5((dL1,ti)=>{ti.exports=si()();var LG0,MG0});var Zr=j5((lL1,PP)=>{function $r($){var Z,J,H="";if(typeof $=="string"||typeof $=="number")H+=$;else if(typeof $=="object")if(Array.isArray($)){var B=$.length;for(Z=0;Z<B;Z++)$[Z]&&(J=$r($[Z]))&&(H&&(H+=" "),H+=J)}else for(J in $)$[J]&&(H&&(H+=" "),H+=J);return H}function ei(){for(var $,Z,J=0,H="",B=arguments.length;J<B;J++)($=arguments[J])&&(Z=$r($))&&(H&&(H+=" "),H+=Z);return H}PP.exports=ei,PP.exports.clsx=ei});var iQ=j5((Jr)=>{Object.defineProperty(Jr,"__esModule",{value:!0});Jr.dontSetMe=TG0;Jr.findInArray=PG0;Jr.int=OG0;Jr.isFunction=_G0;Jr.isNum=jG0;function PG0($,Z){for(let J=0,H=$.length;J<H;J++)if(Z.apply(Z,[$[J],J,$]))return $[J]}function _G0($){return typeof $==="function"||Object.prototype.toString.call($)==="[object Function]"}function jG0($){return typeof $==="number"&&!isNaN($)}function OG0($){return parseInt($,10)}function TG0($,Z,J){if($[Z])return Error(`Invalid prop ${Z} passed to ${J} - do not set this, set it on the child.`)}});var zr=j5((Qr)=>{Object.defineProperty(Qr,"__esModule",{value:!0});Qr.browserPrefixToKey=Br;Qr.browserPrefixToStyle=RG0;Qr.default=void 0;Qr.getPrefix=Hr;var _P=["Moz","Webkit","O","ms"];function Hr(){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<_P.length;J++)if(Br($,_P[J])in Z)return _P[J];return""}function Br($,Z){return Z?`${Z}${bG0($)}`:$}function RG0($,Z){return Z?`-${Z.toLowerCase()}-${$}`:$}function bG0($){let Z="",J=!0;for(let H=0;H<$.length;H++)if(J)Z+=$[H].toUpperCase(),J=!1;else if($[H]==="-")J=!0;else Z+=$[H];return Z}var rL1=Qr.default=Hr()});var EW=j5((qr)=>{Object.defineProperty(qr,"__esModule",{value:!0});qr.addClassName=Fr;qr.addEvent=vG0;qr.addUserSelectStyles=aG0;qr.createCSSTransform=dG0;qr.createSVGTransform=lG0;qr.getTouch=iG0;qr.getTouchIdentifier=rG0;qr.getTranslation=jP;qr.innerHeight=uG0;qr.innerWidth=pG0;qr.matchesSelector=Yr;qr.matchesSelectorAndParentsTo=hG0;qr.offsetXYFromParent=cG0;qr.outerHeight=fG0;qr.outerWidth=mG0;qr.removeClassName=Wr;qr.removeEvent=gG0;qr.scheduleRemoveUserSelectStyles=oG0;var H8=iQ(),Gr=Ur(zr());function Ur($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(Ur=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let K in B)K!=="default"&&{}.hasOwnProperty.call(B,K)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,K))&&(z.get||z.set)?X(G,K,z):G[K]=B[K]);return G})($,Z)}var CW="";function Yr($,Z){if(!CW)CW=(0,H8.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(J){return(0,H8.isFunction)($[J])});if(!(0,H8.isFunction)($[CW]))return!1;return $[CW](Z)}function hG0($,Z,J){let H=$;do{if(Yr(H,Z))return!0;if(H===J)return!1;H=H.parentNode}while(H);return!1}function vG0($,Z,J,H){if(!$)return;let B={capture:!0,...H};if($.addEventListener)$.addEventListener(Z,J,B);else if($.attachEvent)$.attachEvent("on"+Z,J);else $["on"+Z]=J}function gG0($,Z,J,H){if(!$)return;let B={capture:!0,...H};if($.removeEventListener)$.removeEventListener(Z,J,B);else if($.detachEvent)$.detachEvent("on"+Z,J);else $["on"+Z]=null}function fG0($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,H8.int)(J.borderTopWidth),Z+=(0,H8.int)(J.borderBottomWidth),Z}function mG0($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,H8.int)(J.borderLeftWidth),Z+=(0,H8.int)(J.borderRightWidth),Z}function uG0($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,H8.int)(J.paddingTop),Z-=(0,H8.int)(J.paddingBottom),Z}function pG0($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,H8.int)(J.paddingLeft),Z-=(0,H8.int)(J.paddingRight),Z}function cG0($,Z,J){let B=Z===Z.ownerDocument.body?{left:0,top:0}:Z.getBoundingClientRect(),Q=($.clientX+Z.scrollLeft-B.left)/J,X=($.clientY+Z.scrollTop-B.top)/J;return{x:Q,y:X}}function dG0($,Z){let J=jP($,Z,"px");return{[(0,Gr.browserPrefixToKey)("transform",Gr.default)]:J}}function lG0($,Z){return jP($,Z,"")}function jP($,Z,J){let{x:H,y:B}=$,Q=`translate(${H}${J},${B}${J})`;if(Z){let X=`${typeof Z.x==="string"?Z.x:Z.x+J}`,z=`${typeof Z.y==="string"?Z.y:Z.y+J}`;Q=`translate(${X}, ${z})`+Q}return Q}function iG0($,Z){return $.targetTouches&&(0,H8.findInArray)($.targetTouches,(J)=>Z===J.identifier)||$.changedTouches&&(0,H8.findInArray)($.changedTouches,(J)=>Z===J.identifier)}function rG0($){if($.targetTouches&&$.targetTouches[0])return $.targetTouches[0].identifier;if($.changedTouches&&$.changedTouches[0])return $.changedTouches[0].identifier}function aG0($){if(!$)return;let Z=$.getElementById("react-draggable-style-el");if(!Z)Z=$.createElement("style"),Z.type="text/css",Z.id="react-draggable-style-el",Z.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
8
+ `,Z.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
9
+ `,$.getElementsByTagName("head")[0].appendChild(Z);if($.body)Fr($.body,"react-draggable-transparent-selection")}function oG0($){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{Kr($)});else Kr($)}function Kr($){if(!$)return;try{if($.body)Wr($.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 Fr($,Z){if($.classList)$.classList.add(Z);else if(!$.className.match(new RegExp(`(?:^|\\s)${Z}(?!\\S)`)))$.className+=` ${Z}`}function Wr($,Z){if($.classList)$.classList.remove(Z);else $.className=$.className.replace(new RegExp(`(?:^|\\s)${Z}(?!\\S)`,"g"),"")}});var TP=j5((Nr)=>{Object.defineProperty(Nr,"__esModule",{value:!0});Nr.canDragX=VK0;Nr.canDragY=AK0;Nr.createCoreData=LK0;Nr.createDraggableData=MK0;Nr.getBoundPosition=qK0;Nr.getControlPosition=DK0;Nr.snapToGrid=NK0;var B8=iQ(),lJ=EW();function qK0($,Z,J){if(!$.props.bounds)return[Z,J];let{bounds:H}=$.props;H=typeof H==="string"?H:PK0(H);let B=OP($);if(typeof H==="string"){let{ownerDocument:Q}=B,X=Q.defaultView,z;if(H==="parent")z=B.parentNode;else z=B.getRootNode().querySelector(H);if(!(z instanceof X.HTMLElement))throw Error('Bounds selector "'+H+'" could not find an element.');let G=z,K=X.getComputedStyle(B),U=X.getComputedStyle(G);H={left:-B.offsetLeft+(0,B8.int)(U.paddingLeft)+(0,B8.int)(K.marginLeft),top:-B.offsetTop+(0,B8.int)(U.paddingTop)+(0,B8.int)(K.marginTop),right:(0,lJ.innerWidth)(G)-(0,lJ.outerWidth)(B)-B.offsetLeft+(0,B8.int)(U.paddingRight)-(0,B8.int)(K.marginRight),bottom:(0,lJ.innerHeight)(G)-(0,lJ.outerHeight)(B)-B.offsetTop+(0,B8.int)(U.paddingBottom)-(0,B8.int)(K.marginBottom)}}if((0,B8.isNum)(H.right))Z=Math.min(Z,H.right);if((0,B8.isNum)(H.bottom))J=Math.min(J,H.bottom);if((0,B8.isNum)(H.left))Z=Math.max(Z,H.left);if((0,B8.isNum)(H.top))J=Math.max(J,H.top);return[Z,J]}function NK0($,Z,J){let H=Math.round(Z/$[0])*$[0],B=Math.round(J/$[1])*$[1];return[H,B]}function VK0($){return $.props.axis==="both"||$.props.axis==="x"}function AK0($){return $.props.axis==="both"||$.props.axis==="y"}function DK0($,Z,J){let H=typeof Z==="number"?(0,lJ.getTouch)($,Z):null;if(typeof Z==="number"&&!H)return null;let B=OP(J),Q=J.props.offsetParent||B.offsetParent||B.ownerDocument.body;return(0,lJ.offsetXYFromParent)(H||$,Q,J.props.scale)}function LK0($,Z,J){let H=!(0,B8.isNum)($.lastX),B=OP($);if(H)return{node:B,deltaX:0,deltaY:0,lastX:Z,lastY:J,x:Z,y:J};else return{node:B,deltaX:Z-$.lastX,deltaY:J-$.lastY,lastX:$.lastX,lastY:$.lastY,x:Z,y:J}}function MK0($,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 PK0($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom}}function OP($){let Z=$.findDOMNode();if(!Z)throw Error("<DraggableCore>: Unmounted during event!");return Z}});var CP=j5((Vr)=>{Object.defineProperty(Vr,"__esModule",{value:!0});Vr.default=SK0;function SK0(){}});var Mr=j5((Dr)=>{var yK0=_(p()),xK0=_(a4());Object.defineProperty(Dr,"__esModule",{value:!0});Dr.default=void 0;var EP=Ar(yK0),T4=SP(lQ()),RK0=SP(xK0),U4=EW(),$7=TP(),wP=iQ(),rQ=SP(CP());function SP($){return $&&$.__esModule?$:{default:$}}function Ar($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(Ar=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let K in B)K!=="default"&&{}.hasOwnProperty.call(B,K)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,K))&&(z.get||z.set)?X(G,K,z):G[K]=B[K]);return G})($,Z)}function C4($,Z,J){return(Z=bK0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function bK0($){var Z=kK0($,"string");return typeof Z=="symbol"?Z:Z+""}function kK0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}var Q9={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},Z7=Q9.mouse;class aQ extends EP.Component{constructor(){super(...arguments);C4(this,"dragging",!1),C4(this,"lastX",NaN),C4(this,"lastY",NaN),C4(this,"touchIdentifier",null),C4(this,"mounted",!1),C4(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,U4.matchesSelectorAndParentsTo)($.target,this.props.handle,Z)||this.props.cancel&&(0,U4.matchesSelectorAndParentsTo)($.target,this.props.cancel,Z))return;if($.type==="touchstart"&&!this.props.allowMobileScroll)$.preventDefault();let H=(0,U4.getTouchIdentifier)($);this.touchIdentifier=H;let B=(0,$7.getControlPosition)($,H,this);if(B==null)return;let{x:Q,y:X}=B,z=(0,$7.createCoreData)(this,Q,X);if((0,rQ.default)("DraggableCore: handleDragStart: %j",z),(0,rQ.default)("calling",this.props.onStart),this.props.onStart($,z)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,U4.addUserSelectStyles)(J);this.dragging=!0,this.lastX=Q,this.lastY=X,(0,U4.addEvent)(J,Z7.move,this.handleDrag),(0,U4.addEvent)(J,Z7.stop,this.handleDragStop)}),C4(this,"handleDrag",($)=>{let Z=(0,$7.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:H}=Z;if(Array.isArray(this.props.grid)){let X=J-this.lastX,z=H-this.lastY;if([X,z]=(0,$7.snapToGrid)(this.props.grid,X,z),!X&&!z)return;J=this.lastX+X,H=this.lastY+z}let B=(0,$7.createCoreData)(this,J,H);if((0,rQ.default)("DraggableCore: handleDrag: %j",B),this.props.onDrag($,B)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(X){let z=document.createEvent("MouseEvents");z.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(z)}return}this.lastX=J,this.lastY=H}),C4(this,"handleDragStop",($)=>{if(!this.dragging)return;let Z=(0,$7.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:H}=Z;if(Array.isArray(this.props.grid)){let z=J-this.lastX||0,G=H-this.lastY||0;[z,G]=(0,$7.snapToGrid)(this.props.grid,z,G),J=this.lastX+z,H=this.lastY+G}let B=(0,$7.createCoreData)(this,J,H);if(this.props.onStop($,B)===!1||this.mounted===!1)return!1;let X=this.findDOMNode();if(X){if(this.props.enableUserSelectHack)(0,U4.scheduleRemoveUserSelectStyles)(X.ownerDocument)}if((0,rQ.default)("DraggableCore: handleDragStop: %j",B),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,X)(0,rQ.default)("DraggableCore: Removing handlers"),(0,U4.removeEvent)(X.ownerDocument,Z7.move,this.handleDrag),(0,U4.removeEvent)(X.ownerDocument,Z7.stop,this.handleDragStop)}),C4(this,"onMouseDown",($)=>{return Z7=Q9.mouse,this.handleDragStart($)}),C4(this,"onMouseUp",($)=>{return Z7=Q9.mouse,this.handleDragStop($)}),C4(this,"onTouchStart",($)=>{return Z7=Q9.touch,this.handleDragStart($)}),C4(this,"onTouchEnd",($)=>{return Z7=Q9.touch,this.handleDragStop($)})}componentDidMount(){this.mounted=!0;let $=this.findDOMNode();if($)(0,U4.addEvent)($,Q9.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let $=this.findDOMNode();if($){let{ownerDocument:Z}=$;if((0,U4.removeEvent)(Z,Q9.mouse.move,this.handleDrag),(0,U4.removeEvent)(Z,Q9.touch.move,this.handleDrag),(0,U4.removeEvent)(Z,Q9.mouse.stop,this.handleDragStop),(0,U4.removeEvent)(Z,Q9.touch.stop,this.handleDragStop),(0,U4.removeEvent)($,Q9.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,U4.scheduleRemoveUserSelectStyles)(Z)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:RK0.default.findDOMNode(this)}render(){return EP.cloneElement(EP.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}Dr.default=aQ;C4(aQ,"displayName","DraggableCore");C4(aQ,"propTypes",{allowAnyClick:T4.default.bool,allowMobileScroll:T4.default.bool,children:T4.default.node.isRequired,disabled:T4.default.bool,enableUserSelectHack:T4.default.bool,offsetParent:function($,Z){if($[Z]&&$[Z].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:T4.default.arrayOf(T4.default.number),handle:T4.default.string,cancel:T4.default.string,nodeRef:T4.default.object,onStart:T4.default.func,onDrag:T4.default.func,onStop:T4.default.func,onMouseDown:T4.default.func,scale:T4.default.number,className:wP.dontSetMe,style:wP.dontSetMe,transform:wP.dontSetMe});C4(aQ,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var Or=j5((bP)=>{var mK0=_(p()),uK0=_(a4());Object.defineProperty(bP,"__esModule",{value:!0});Object.defineProperty(bP,"DraggableCore",{enumerable:!0,get:function(){return IW.default}});bP.default=void 0;var wW=_r(mK0),k5=RW(lQ()),hK0=RW(uK0),vK0=Zr(),Pr=EW(),iJ=TP(),IP=iQ(),IW=RW(Mr()),SW=RW(CP());function RW($){return $&&$.__esModule?$:{default:$}}function _r($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(_r=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let K in B)K!=="default"&&{}.hasOwnProperty.call(B,K)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,K))&&(z.get||z.set)?X(G,K,z):G[K]=B[K]);return G})($,Z)}function RP(){return RP=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var H in J)({}).hasOwnProperty.call(J,H)&&($[H]=J[H])}return $},RP.apply(null,arguments)}function rJ($,Z,J){return(Z=gK0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function gK0($){var Z=fK0($,"string");return typeof Z=="symbol"?Z:Z+""}function fK0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class oQ extends wW.Component{static getDerivedStateFromProps($,Z){let{position:J}=$,{prevPropsPosition:H}=Z;if(J&&(!H||J.x!==H.x||J.y!==H.y))return(0,SW.default)("Draggable: getDerivedStateFromProps %j",{position:J,prevPropsPosition:H}),{x:J.x,y:J.y,prevPropsPosition:{...J}};return null}constructor($){super($);if(rJ(this,"onDragStart",(Z,J)=>{if((0,SW.default)("Draggable: onDragStart: %j",J),this.props.onStart(Z,(0,iJ.createDraggableData)(this,J))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),rJ(this,"onDrag",(Z,J)=>{if(!this.state.dragging)return!1;(0,SW.default)("Draggable: onDrag: %j",J);let H=(0,iJ.createDraggableData)(this,J),B={x:H.x,y:H.y,slackX:0,slackY:0};if(this.props.bounds){let{x:X,y:z}=B;B.x+=this.state.slackX,B.y+=this.state.slackY;let[G,K]=(0,iJ.getBoundPosition)(this,B.x,B.y);B.x=G,B.y=K,B.slackX=this.state.slackX+(X-B.x),B.slackY=this.state.slackY+(z-B.y),H.x=B.x,H.y=B.y,H.deltaX=B.x-this.state.x,H.deltaY=B.y-this.state.y}if(this.props.onDrag(Z,H)===!1)return!1;this.setState(B)}),rJ(this,"onDragStop",(Z,J)=>{if(!this.state.dragging)return!1;if(this.props.onStop(Z,(0,iJ.createDraggableData)(this,J))===!1)return!1;(0,SW.default)("Draggable: onDragStop: %j",J);let B={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){let{x:X,y:z}=this.props.position;B.x=X,B.y=z}this.setState(B)}),this.state={dragging:!1,dragged:!1,x:$.position?$.position.x:$.defaultPosition.x,y:$.position?$.position.y:$.defaultPosition.y,prevPropsPosition:{...$.position},slackX:0,slackY:0,isElementSVG:!1},$.position&&!($.onDrag||$.onStop))console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){if(typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement)this.setState({isElementSVG:!0})}componentWillUnmount(){if(this.state.dragging)this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??hK0.default.findDOMNode(this)}render(){let{axis:$,bounds:Z,children:J,defaultPosition:H,defaultClassName:B,defaultClassNameDragging:Q,defaultClassNameDragged:X,position:z,positionOffset:G,scale:K,...U}=this.props,Y={},F=null,q=!Boolean(z)||this.state.dragging,N=z||H,A={x:(0,iJ.canDragX)(this)&&q?this.state.x:N.x,y:(0,iJ.canDragY)(this)&&q?this.state.y:N.y};if(this.state.isElementSVG)F=(0,Pr.createSVGTransform)(A,G);else Y=(0,Pr.createCSSTransform)(A,G);let V=(0,vK0.clsx)(J.props.className||"",B,{[Q]:this.state.dragging,[X]:this.state.dragged});return wW.createElement(IW.default,RP({},U,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),wW.cloneElement(wW.Children.only(J),{className:V,style:{...J.props.style,...Y},transform:F}))}}bP.default=oQ;rJ(oQ,"displayName","Draggable");rJ(oQ,"propTypes",{...IW.default.propTypes,axis:k5.default.oneOf(["both","x","y","none"]),bounds:k5.default.oneOfType([k5.default.shape({left:k5.default.number,right:k5.default.number,top:k5.default.number,bottom:k5.default.number}),k5.default.string,k5.default.oneOf([!1])]),defaultClassName:k5.default.string,defaultClassNameDragging:k5.default.string,defaultClassNameDragged:k5.default.string,defaultPosition:k5.default.shape({x:k5.default.number,y:k5.default.number}),positionOffset:k5.default.shape({x:k5.default.oneOfType([k5.default.number,k5.default.string]),y:k5.default.oneOfType([k5.default.number,k5.default.string])}),position:k5.default.shape({x:k5.default.number,y:k5.default.number}),className:IP.dontSetMe,style:IP.dontSetMe,transform:IP.dontSetMe});rJ(oQ,"defaultProps",{...IW.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 kW=j5(($M1,bW)=>{var{default:Tr,DraggableCore:pK0}=Or();bW.exports=Tr;bW.exports.default=Tr;bW.exports.DraggableCore=pK0});var wr=j5((oK0)=>{var tK0=_(p());oK0.__esModule=!0;oK0.cloneElement=aK0;var cK0=dK0(tK0);function dK0($){return $&&$.__esModule?$:{default:$}}function Cr($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);Z&&(H=H.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),J.push.apply(J,H)}return J}function Er($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?Cr(Object(J),!0).forEach(function(H){lK0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Cr(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function lK0($,Z,J){return(Z=iK0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function iK0($){var Z=rK0($,"string");return typeof Z=="symbol"?Z:Z+""}function rK0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function aK0($,Z){if(Z.style&&$.props.style)Z.style=Er(Er({},$.props.style),Z.style);if(Z.className&&$.props.className)Z.className=$.props.className+" "+Z.className;return cK0.default.cloneElement($,Z)}});var kP=j5(($U0)=>{$U0.__esModule=!0;$U0.resizableProps=void 0;var E1=eK0(lQ()),JM1=kW();function eK0($){return $&&$.__esModule?$:{default:$}}var HM1=$U0.resizableProps={axis:E1.default.oneOf(["both","x","y","none"]),className:E1.default.string,children:E1.default.element.isRequired,draggableOpts:E1.default.shape({allowAnyClick:E1.default.bool,cancel:E1.default.string,children:E1.default.node,disabled:E1.default.bool,enableUserSelectHack:E1.default.bool,offsetParent:typeof Element<"u"?E1.default.instanceOf(Element):E1.default.any,grid:E1.default.arrayOf(E1.default.number),handle:E1.default.string,nodeRef:E1.default.object,onStart:E1.default.func,onDrag:E1.default.func,onStop:E1.default.func,onMouseDown:E1.default.func,scale:E1.default.number}),height:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let H=Z[0];if(H.axis==="both"||H.axis==="y")return E1.default.number.isRequired(...Z);return E1.default.number(...Z)},handle:E1.default.oneOfType([E1.default.node,E1.default.func]),handleSize:E1.default.arrayOf(E1.default.number),lockAspectRatio:E1.default.bool,maxConstraints:E1.default.arrayOf(E1.default.number),minConstraints:E1.default.arrayOf(E1.default.number),onResizeStop:E1.default.func,onResizeStart:E1.default.func,onResize:E1.default.func,resizeHandles:E1.default.arrayOf(E1.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:E1.default.number,width:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let H=Z[0];if(H.axis==="both"||H.axis==="x")return E1.default.number.isRequired(...Z);return E1.default.number(...Z)}}});var hP=j5((UU0)=>{var FU0=_(p());UU0.__esModule=!0;UU0.default=void 0;var aJ=Rr(FU0),JU0=kW(),HU0=wr(),BU0=kP(),QU0=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Rr($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(Rr=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let K in B)K!=="default"&&{}.hasOwnProperty.call(B,K)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,K))&&(z.get||z.set)?X(G,K,z):G[K]=B[K]);return G})($,Z)}function xP(){return xP=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var H in J)({}).hasOwnProperty.call(J,H)&&($[H]=J[H])}return $},xP.apply(null,arguments)}function XU0($,Z){if($==null)return{};var J={};for(var H in $)if({}.hasOwnProperty.call($,H)){if(Z.indexOf(H)!==-1)continue;J[H]=$[H]}return J}function Ir($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);Z&&(H=H.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),J.push.apply(J,H)}return J}function yP($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?Ir(Object(J),!0).forEach(function(H){zU0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Ir(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function zU0($,Z,J){return(Z=GU0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function GU0($){var Z=KU0($,"string");return typeof Z=="symbol"?Z:Z+""}function KU0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class yW extends aJ.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 J=this.props,H=J.minConstraints,B=J.maxConstraints,Q=J.lockAspectRatio;if(!H&&!B&&!Q)return[$,Z];if(Q){let Y=this.props.width/this.props.height,F=$-this.props.width,W=Z-this.props.height;if(Math.abs(F)>Math.abs(W*Y))Z=$/Y;else $=Z*Y}let X=$,z=Z,G=this.slack||[0,0],K=G[0],U=G[1];if($+=K,Z+=U,H)$=Math.max(H[0],$),Z=Math.max(H[1],Z);if(B)$=Math.min(B[0],$),Z=Math.min(B[1],Z);return this.slack=[K+(X-$),U+(z-Z)],[$,Z]}resizeHandler($,Z){return(J,H)=>{var B,Q,X,z;let{node:G,deltaX:K,deltaY:U}=H;if($==="onResizeStart")this.resetData();let Y=(this.props.axis==="both"||this.props.axis==="x")&&Z!=="n"&&Z!=="s",F=(this.props.axis==="both"||this.props.axis==="y")&&Z!=="e"&&Z!=="w";if(!Y&&!F)return;let W=Z[0],q=Z[Z.length-1],N=G.getBoundingClientRect();if(this.lastHandleRect!=null){if(q==="w"){let R=N.left-this.lastHandleRect.left;K+=R}if(W==="n"){let R=N.top-this.lastHandleRect.top;U+=R}}if(this.lastHandleRect=N,q==="w")K=-K;if(W==="n")U=-U;let A=(B=(Q=this.lastSize)==null?void 0:Q.width)!=null?B:this.props.width,V=(X=(z=this.lastSize)==null?void 0:z.height)!=null?X:this.props.height,D=A+(Y?K/this.props.transformScale:0),L=V+(F?U/this.props.transformScale:0);var j=this.runConstraints(D,L);if(D=j[0],L=j[1],$==="onResizeStop"&&this.lastSize){var M=this.lastSize;D=M.width,L=M.height}let P=D!==A||L!==V;if($!=="onResizeStop")this.lastSize={width:D,height:L};let w=typeof this.props[$]==="function"?this.props[$]:null;if(w&&!($==="onResize"&&!P))J.persist==null||J.persist(),w(J,{node:G,size:{width:D,height:L},handle:Z});if($==="onResizeStop")this.resetData()}}renderResizeHandle($,Z){let J=this.props.handle;if(!J)return aJ.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+$,ref:Z});if(typeof J==="function")return J($,Z);let H=typeof J.type==="string",B=yP({ref:Z},H?{}:{handleAxis:$});return aJ.cloneElement(J,B)}render(){let $=this.props,Z=$.children,J=$.className,H=$.draggableOpts,B=$.width,Q=$.height,X=$.handle,z=$.handleSize,G=$.lockAspectRatio,K=$.axis,U=$.minConstraints,Y=$.maxConstraints,F=$.onResize,W=$.onResizeStop,q=$.onResizeStart,N=$.resizeHandles,A=$.transformScale,V=XU0($,QU0);return(0,HU0.cloneElement)(Z,yP(yP({},V),{},{className:(J?J+" ":"")+"react-resizable",children:[...aJ.Children.toArray(Z.props.children),...N.map((D)=>{var L;let j=(L=this.handleRefs[D])!=null?L:this.handleRefs[D]=aJ.createRef();return aJ.createElement(JU0.DraggableCore,xP({},H,{nodeRef:j,key:"resizableHandle-"+D,onStop:this.resizeHandler("onResizeStop",D),onStart:this.resizeHandler("onResizeStart",D),onDrag:this.resizeHandler("onResize",D)}),this.renderResizeHandle(D,j))})]}))}}UU0.default=yW;yW.propTypes=BU0.resizableProps;yW.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var vr=j5((PU0)=>{var jU0=_(p());PU0.__esModule=!0;PU0.default=void 0;var vP=xr(jU0),WU0=yr(lQ()),qU0=yr(hP()),NU0=kP(),VU0=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function yr($){return $&&$.__esModule?$:{default:$}}function xr($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(xr=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let K in B)K!=="default"&&{}.hasOwnProperty.call(B,K)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,K))&&(z.get||z.set)?X(G,K,z):G[K]=B[K]);return G})($,Z)}function gP(){return gP=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var H in J)({}).hasOwnProperty.call(J,H)&&($[H]=J[H])}return $},gP.apply(null,arguments)}function kr($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);Z&&(H=H.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),J.push.apply(J,H)}return J}function xW($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?kr(Object(J),!0).forEach(function(H){AU0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):kr(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function AU0($,Z,J){return(Z=DU0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function DU0($){var Z=LU0($,"string");return typeof Z=="symbol"?Z:Z+""}function LU0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function MU0($,Z){if($==null)return{};var J={};for(var H in $)if({}.hasOwnProperty.call($,H)){if(Z.indexOf(H)!==-1)continue;J[H]=$[H]}return J}class fP extends vP.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 J=Z.size;if(this.props.onResize)$.persist==null||$.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,Z=$.handle,J=$.handleSize,H=$.onResize,B=$.onResizeStart,Q=$.onResizeStop,X=$.draggableOpts,z=$.minConstraints,G=$.maxConstraints,K=$.lockAspectRatio,U=$.axis,Y=$.width,F=$.height,W=$.resizeHandles,q=$.style,N=$.transformScale,A=MU0($,VU0);return vP.createElement(qU0.default,{axis:U,draggableOpts:X,handle:Z,handleSize:J,height:this.state.height,lockAspectRatio:K,maxConstraints:G,minConstraints:z,onResizeStart:B,onResize:this.onResize,onResizeStop:Q,resizeHandles:W,transformScale:N,width:this.state.width},vP.createElement("div",gP({},A,{style:xW(xW({},q),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}PU0.default=fP;fP.propTypes=xW(xW({},NU0.resizableProps),{},{children:WU0.default.element})});var gr=j5((zM1,hW)=>{hW.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};hW.exports.Resizable=hP().default;hW.exports.ResizableBox=vr().default});var f$=_(p(),1),Y_=_(d(),1),Jq=f$.createContext(void 0),z1=($)=>{let Z=f$.useContext(Jq);if($)return $;if(!Z)throw Error("No QueryClient set, use QueryClientProvider to set one");return Z},Hq=({client:$,children:Z})=>{return f$.useEffect(()=>{return $.mount(),()=>{$.unmount()}},[$]),Y_.jsx(Jq.Provider,{value:$,children:Z})};var XX=_(p(),1),F_=XX.createContext(!1),W_=()=>XX.useContext(F_),rY0=F_.Provider;var HH=_(p(),1),xo=_(d(),1);function ho(){let $=!1;return{clearReset:()=>{$=!1},reset:()=>{$=!0},isReset:()=>{return $}}}var vo=HH.createContext(ho()),q_=()=>HH.useContext(vo);var y_=_(p(),1);var go={setTimeout:($,Z)=>setTimeout($,Z),clearTimeout:($)=>clearTimeout($),setInterval:($,Z)=>setInterval($,Z),clearInterval:($)=>clearInterval($)},fo=class{#$=go;#Z=!1;setTimeoutProvider($){this.#$=$}setTimeout($,Z){return this.#$.setTimeout($,Z)}clearTimeout($){this.#$.clearTimeout($)}setInterval($,Z){return this.#$.setInterval($,Z)}clearInterval($){this.#$.clearInterval($)}},z9=new fo;function N_($){setTimeout($,0)}var Qq=typeof window>"u"||"Deno"in globalThis;function m5(){}function D_($,Z){return typeof $==="function"?$(Z):$}function zX($){return typeof $==="number"&&$>=0&&$!==1/0}function GX($,Z){return Math.max($+(Z||0)-Date.now(),0)}function S5($,Z){return typeof $==="function"?$(Z):$}function KX($,Z){let{type:J="all",exact:H,fetchStatus:B,predicate:Q,queryKey:X,stale:z}=$;if(X){if(H){if(Z.queryHash!==BH(X,Z.options))return!1}else if(!h3(Z.queryKey,X))return!1}if(J!=="all"){let G=Z.isActive();if(J==="active"&&!G)return!1;if(J==="inactive"&&G)return!1}if(typeof z==="boolean"&&Z.isStale()!==z)return!1;if(B&&B!==Z.state.fetchStatus)return!1;if(Q&&!Q(Z))return!1;return!0}function UX($,Z){let{exact:J,status:H,predicate:B,mutationKey:Q}=$;if(Q){if(!Z.options.mutationKey)return!1;if(J){if(G9(Z.options.mutationKey)!==G9(Q))return!1}else if(!h3(Z.options.mutationKey,Q))return!1}if(H&&Z.state.status!==H)return!1;if(B&&!B(Z))return!1;return!0}function BH($,Z){return(Z?.queryKeyHashFn||G9)($)}function G9($){return JSON.stringify($,(Z,J)=>Bq(J)?Object.keys(J).sort().reduce((H,B)=>{return H[B]=J[B],H},{}):J)}function h3($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if($&&Z&&typeof $==="object"&&typeof Z==="object"){if(Array.isArray($)&&Array.isArray(Z)){for(let H=0;H<Z.length;H++)if(!h3($[H],Z[H]))return!1;return!0}let J=Object.keys(Z);for(let H of J)if(!h3($[H],Z[H]))return!1;return!0}return!1}var mo=Object.prototype.hasOwnProperty;function QH($,Z,J=0){if($===Z)return $;if(J>500)return Z;let H=V_($)&&V_(Z);if(!H&&!(Bq($)&&Bq(Z)))return Z;let B=(H?$:Object.keys($)).length,Q=H?Z:Object.keys(Z),X=Q.length,z=H?Array(X):{},G=0;for(let K=0;K<X;K++){let U=H?K:Q[K],Y=$[U],F=Z[U];if(Y===F){if(z[U]=Y,H?K<B:mo.call($,U))G++;continue}if(Y===null||F===null||typeof Y!=="object"||typeof F!=="object"){z[U]=F;continue}let W=QH(Y,F,J+1);if(z[U]=W,W===Y)G++}return B===X&&G===B?$:z}function m$($,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 V_($){return Array.isArray($)&&$.length===Object.keys($).length}function Bq($){if(!A_($))return!1;let Z=$.constructor;if(Z===void 0)return!0;let J=Z.prototype;if(!A_(J))return!1;if(!J.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf($)!==Object.prototype)return!1;return!0}function A_($){return Object.prototype.toString.call($)==="[object Object]"}function L_($){return new Promise((Z)=>{z9.setTimeout(Z,$)})}function XH($,Z,J){if(typeof J.structuralSharing==="function")return J.structuralSharing($,Z);else if(J.structuralSharing!==!1)return QH($,Z);return Z}function M_($,Z,J=0){let H=[...$,Z];return J&&H.length>J?H.slice(1):H}function P_($,Z,J=0){let H=[Z,...$];return J&&H.length>J?H.slice(0,-1):H}var u$=Symbol();function YX($,Z){if(!$.queryFn&&Z?.initialPromise)return()=>Z.initialPromise;if(!$.queryFn||$.queryFn===u$)return()=>Promise.reject(Error(`Missing queryFn: '${$.queryHash}'`));return $.queryFn}function p$($,Z){if(typeof $==="function")return $(...Z);return!!$}function __($,Z,J){let H=!1,B;return Object.defineProperty($,"signal",{enumerable:!0,get:()=>{if(B??=Z(),H)return B;if(H=!0,B.aborted)J();else B.addEventListener("abort",J,{once:!0});return B}}),$}var uo=()=>Qq,c$=()=>uo();var z8=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 po=class extends z8{#$;#Z;#J;constructor(){super();this.#J=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$();return window.addEventListener("visibilitychange",Z,!1),()=>{window.removeEventListener("visibilitychange",Z)}}}}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"}},d$=new po;var j_=N_;function co(){let $=[],Z=0,J=(z)=>{z()},H=(z)=>{z()},B=j_,Q=(z)=>{if(Z)$.push(z);else B(()=>{J(z)})},X=()=>{let z=$;if($=[],z.length)B(()=>{H(()=>{z.forEach((G)=>{J(G)})})})};return{batch:(z)=>{let G;Z++;try{G=z()}finally{if(Z--,!Z)X()}return G},batchCalls:(z)=>{return(...G)=>{Q(()=>{z(...G)})}},schedule:Q,setNotifyFunction:(z)=>{J=z},setBatchNotifyFunction:(z)=>{H=z},setScheduler:(z)=>{B=z}}}var t1=co();var lo=class extends z8{#$=!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)}}}}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((Z)=>{Z($)})}isOnline(){return this.#$}},l$=new lo;function io($){return Math.min(1000*2**$,30000)}function Xq($){return($??"online")==="online"?l$.isOnline():!0}var FX=class extends Error{constructor($){super("CancelledError");this.revert=$?.revert,this.silent=$?.silent}};function WX($){let Z=!1,J=0,H,B="pending",Q,X,z=new Promise((D,L)=>{Q=D,X=L});z.catch(m5);let G=()=>B!=="pending",K=(D)=>{if(!G()){let L=new FX(D);N(L),$.onCancel?.(L)}},U=()=>{Z=!0},Y=()=>{Z=!1},F=()=>d$.isFocused()&&($.networkMode==="always"||l$.isOnline())&&$.canRun(),W=()=>Xq($.networkMode)&&$.canRun(),q=(D)=>{if(!G())H?.(),B="resolved",Q(D)},N=(D)=>{if(!G())H?.(),B="rejected",X(D)},A=()=>{return new Promise((D)=>{H=(L)=>{if(G()||F())D(L)},$.onPause?.()}).then(()=>{if(H=void 0,!G())$.onContinue?.()})},V=()=>{if(G())return;let D,L=J===0?$.initialPromise:void 0;try{D=L??$.fn()}catch(j){D=Promise.reject(j)}Promise.resolve(D).then(q).catch((j)=>{if(G())return;let M=$.retry??(c$()?0:3),P=$.retryDelay??io,w=typeof P==="function"?P(J,j):P,C=M===!0||typeof M==="number"&&J<M||typeof M==="function"&&M(J,j);if(Z||!C){N(j);return}J++,$.onFail?.(J,j),L_(w).then(()=>{return F()?void 0:A()}).then(()=>{if(Z)N(j);else V()})})};return{promise:z,status:()=>B,cancel:K,continue:()=>{return H?.(),z},cancelRetry:U,continueRetry:Y,canStart:W,start:()=>{if(W())V();else A().then(V);return z}}}var qX=class{#$;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),zX(this.gcTime))this.#$=z9.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime($){this.gcTime=Math.max(this.gcTime||0,$??(c$()?1/0:300000))}clearGcTimeout(){if(this.#$!==void 0)z9.clearTimeout(this.#$),this.#$=void 0}};function T_($){return{onFetch:(Z,J)=>{let H=Z.options,B=Z.fetchOptions?.meta?.fetchMore?.direction,Q=Z.state.data?.pages||[],X=Z.state.data?.pageParams||[],z={pages:[],pageParams:[]},G=0,K=async()=>{let U=!1,Y=(q)=>{__(q,()=>Z.signal,()=>U=!0)},F=YX(Z.options,Z.fetchOptions),W=async(q,N,A)=>{if(U)return Promise.reject(Z.signal.reason);if(N==null&&q.pages.length)return Promise.resolve(q);let D=(()=>{let P={client:Z.client,queryKey:Z.queryKey,pageParam:N,direction:A?"backward":"forward",meta:Z.options.meta};return Y(P),P})(),L=await F(D),{maxPages:j}=Z.options,M=A?P_:M_;return{pages:M(q.pages,L,j),pageParams:M(q.pageParams,N,j)}};if(B&&Q.length){let q=B==="backward",N=q?ro:O_,A={pages:Q,pageParams:X};z=await W(A,N(H,A),q)}else{let q=$??Q.length;do{let N=G===0?X[0]??H.initialPageParam:O_(H,z);if(G>0&&N==null)break;z=await W(z,N),G++}while(G<q)}return z};if(Z.options.persister)Z.fetchFn=()=>{return Z.options.persister?.(K,{client:Z.client,queryKey:Z.queryKey,meta:Z.options.meta,signal:Z.signal},J)};else Z.fetchFn=K}}}function O_($,{pages:Z,pageParams:J}){let H=Z.length-1;return Z.length>0?$.getNextPageParam(Z[H],Z,J[H],J):void 0}function ro($,{pages:Z,pageParams:J}){return Z.length>0?$.getPreviousPageParam?.(Z[0],Z,J[0],J):void 0}var w_=class extends qX{#$;#Z;#J;#H;#Q;#B;#X;#G;constructor($){super();this.#G=!1,this.#X=$.defaultOptions,this.setOptions($.options),this.observers=[],this.#Q=$.client,this.#H=this.#Q.getQueryCache(),this.queryKey=$.queryKey,this.queryHash=$.queryHash,this.#Z=E_(this.options),this.state=$.state??this.#Z,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#$}get promise(){return this.#B?.promise}setOptions($){if(this.options={...this.#X,...$},$?._type)this.#$=$._type;if(this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let Z=E_(this.options);if(Z.data!==void 0)this.setState(C_(Z.data,Z.dataUpdatedAt)),this.#Z=Z}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#H.remove(this)}setData($,Z){let J=XH(this.state.data,$,this.options);return this.#z({data:J,type:"success",dataUpdatedAt:Z?.updatedAt,manual:Z?.manual}),J}setState($){this.#z({type:"setState",state:$})}cancel($){let Z=this.#B?.promise;return this.#B?.cancel($),Z?Z.then(m5).catch(m5):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#Z}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(($)=>S5($.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===u$||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(($)=>S5($.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!GX(this.state.dataUpdatedAt,$)}onFocus(){this.observers.find(($)=>$.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#B?.continue()}onOnline(){this.observers.find(($)=>$.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#B?.continue()}addObserver($){if(!this.observers.includes($))this.observers.push($),this.clearGcTimeout(),this.#H.notify({type:"observerAdded",query:this,observer:$})}removeObserver($){let Z=this.observers.indexOf($);if(Z!==-1){if(this.observers.splice(Z,1),!this.observers.length){if(this.#B)if(this.#G||this.state.fetchStatus==="paused"&&this.state.status==="pending")this.#B.cancel({revert:!0});else this.#B.cancelRetry();this.scheduleGc()}this.#H.notify({type:"observerRemoved",query:this,observer:$})}}getObserversCount(){return this.observers.length}invalidate(){if(!this.state.isInvalidated)this.#z({type:"invalidate"})}async fetch($,Z){if(this.state.fetchStatus!=="idle"&&this.#B?.status()!=="rejected"){if(this.state.data!==void 0&&Z?.cancelRefetch)this.cancel({silent:!0});else if(this.#B)return this.#B.continueRetry(),this.#B.promise}if($)this.setOptions($);if(!this.options.queryFn){let G=this.observers.find((K)=>K.options.queryFn);if(G)this.setOptions(G.options)}let J=new AbortController,H=(G)=>{Object.defineProperty(G,"signal",{enumerable:!0,get:()=>{return this.#G=!0,J.signal}})},B=()=>{let G=YX(this.options,Z),U=(()=>{let Y={client:this.#Q,queryKey:this.queryKey,meta:this.meta};return H(Y),Y})();if(this.#G=!1,this.options.persister)return this.options.persister(G,U,this);return G(U)},X=(()=>{let G={fetchOptions:Z,options:this.options,queryKey:this.queryKey,client:this.#Q,state:this.state,fetchFn:B};return H(G),G})();if((this.#$==="infinite"?T_(this.options.pages):this.options.behavior)?.onFetch(X,this),this.#J=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==X.fetchOptions?.meta)this.#z({type:"fetch",meta:X.fetchOptions?.meta});let z=this.#B=WX({initialPromise:Z?.initialPromise,fn:X.fetchFn,onCancel:(G)=>{if(G instanceof FX&&G.revert)this.setState({...this.#J,fetchStatus:"idle"});J.abort()},onFail:(G,K)=>{this.#z({type:"failed",failureCount:G,error:K})},onPause:()=>{this.#z({type:"pause"})},onContinue:()=>{this.#z({type:"continue"})},retry:X.options.retry,retryDelay:X.options.retryDelay,networkMode:X.options.networkMode,canRun:()=>!0});try{let G=await z.start();if(G===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(G),this.#H.config.onSuccess?.(G,this),this.#H.config.onSettled?.(G,this.state.error,this),G}catch(G){if(G instanceof FX){if(G.silent)return this.#B.promise;else if(G.revert){if(this.state.data===void 0)throw G;return this.state.data}}throw this.#z({type:"error",error:G}),this.#H.config.onError?.(G,this),this.#H.config.onSettled?.(this.state.data,G,this),G}finally{if(this.#B===z)this.#B=void 0;this.scheduleGc()}}#z($){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,...zq(J.data,this.options),fetchMeta:$.meta??null};case"success":let H={...J,...C_($.data,$.dataUpdatedAt),dataUpdateCount:J.dataUpdateCount+1,...!$.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#J=$.manual?H:void 0,H;case"error":let B=$.error;return{...J,error:B,errorUpdateCount:J.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:J.fetchFailureCount+1,fetchFailureReason:B,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...J,isInvalidated:!0};case"setState":return{...J,...$.state}}};this.state=Z(this.state),t1.batch(()=>{this.observers.slice().forEach((J)=>{J.onQueryUpdate()}),this.#H.notify({query:this,type:"updated",action:$})})}};function zq($,Z){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xq(Z.networkMode)?"fetching":"paused",...$===void 0&&{error:null,status:"pending"}}}function C_($,Z){return{data:$,dataUpdatedAt:Z??Date.now(),error:null,isInvalidated:!1,status:"success"}}function E_($){let Z=typeof $.initialData==="function"?$.initialData():$.initialData,J=Z!==void 0,H=J?typeof $.initialDataUpdatedAt==="function"?$.initialDataUpdatedAt():$.initialDataUpdatedAt:0;return{data:Z,dataUpdateCount:0,dataUpdatedAt:J?H??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:J?"success":"pending",fetchStatus:"idle"}}var Kq=class extends z8{#$;#Z=void 0;#J=void 0;#H=void 0;#Q;#B;#X;#G;#z;#W;#U;#Y;#K;#q=new Set;constructor($,Z){super();this.options=Z,this.#$=$,this.#X=null,this.bindMethods(),this.setOptions(Z)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#Z.addObserver(this),S_(this.#Z,this.options))this.#F();else this.updateResult();this.#L()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return Gq(this.#Z,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gq(this.#Z,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#M(),this.#P(),this.#Z.removeObserver(this)}setOptions($){let Z=this.options,J=this.#Z;if(this.options=this.#$.defaultQueryOptions($),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof S5(this.options.enabled,this.#Z)!=="boolean")throw Error("Expected enabled to be a boolean or a callback that returns a boolean");if(this.#_(),this.#Z.setOptions(this.options),Z._defaulted&&!m$(this.options,Z))this.#$.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#Z,observer:this});let H=this.hasListeners();if(H&&I_(this.#Z,J,this.options,Z))this.#F();if(this.updateResult(),H&&(this.#Z!==J||S5(this.options.enabled,this.#Z)!==S5(Z.enabled,this.#Z)||S5(this.options.staleTime,this.#Z)!==S5(Z.staleTime,this.#Z)))this.#V();let B=this.#A();if(H&&(this.#Z!==J||S5(this.options.enabled,this.#Z)!==S5(Z.enabled,this.#Z)||B!==this.#K))this.#D(B)}getOptimisticResult($){let Z=this.#$.getQueryCache().build(this.#$,$),J=this.createResult(Z,$);if(!m$(this.getCurrentResult(),J))this.#H=J,this.#B=this.options,this.#Q=this.#Z.state;return J}getCurrentResult(){return this.#H}trackResult($,Z){return new Proxy($,{get:(J,H)=>{return this.trackProp(H),Z?.(H),Reflect.get(J,H)}})}trackProp($){this.#q.add($)}getCurrentQuery(){return this.#Z}refetch({...$}={}){return this.fetch({...$})}fetchOptimistic($){let Z=this.#$.defaultQueryOptions($),J=this.#$.getQueryCache().build(this.#$,Z),H=()=>{},B,Q=new Promise((X)=>{B=X,H=this.#$.getQueryCache().subscribe((z)=>{if(z.type==="updated"&&z.query.queryHash===J.queryHash&&J.state.data!==void 0)H(),X(this.createResult(J,Z))})});return Promise.race([J.fetch().then(()=>{let X=this.createResult(J,Z);return B?.(X),X}).finally(()=>{H()}),Q])}fetch($){return this.#F({...$,cancelRefetch:$.cancelRefetch??!0}).then(()=>{return this.updateResult(),this.#H})}#F($){this.#_();let Z=this.#Z.fetch(this.options,$);if(!$?.throwOnError)Z=Z.catch(m5);return Z}#N($){return!c$()&&S5(this.options.enabled,this.#Z)!==!1&&zX($)}#V(){this.#M();let $=S5(this.options.staleTime,this.#Z);if(this.#H.isStale||!this.#N($))return;let Z=GX(this.#H.dataUpdatedAt,$)+1;this.#U=z9.setTimeout(()=>{if(!this.#H.isStale)this.updateResult()},Z)}#A(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#Z):this.options.refetchInterval)??!1}#D($){if(this.#P(),this.#K=$,this.#K===0||!this.#N(this.#K))return;this.#Y=z9.setInterval(()=>{if(this.options.refetchIntervalInBackground||d$.isFocused())this.#F()},this.#K)}#L(){this.#V(),this.#D(this.#A())}#M(){if(this.#U!==void 0)z9.clearTimeout(this.#U),this.#U=void 0}#P(){if(this.#Y!==void 0)z9.clearInterval(this.#Y),this.#Y=void 0}createResult($,Z){let J=this.#Z,H=this.options,B=this.#H,Q=this.#Q,X=this.#B,z=$!==J?$.state:this.#J,{state:G}=$,K={...G},U=!1,Y;if(Z._optimisticResults){let M=this.hasListeners(),P=!M&&S_($,Z),w=M&&I_($,J,Z,H);if(P||w)K={...K,...zq(G.data,$.options)};if(Z._optimisticResults==="isRestoring")K.fetchStatus="idle"}let{error:F,errorUpdatedAt:W,status:q}=K;Y=K.data;let N=!1;if(Z.placeholderData!==void 0&&Y===void 0&&q==="pending"){let M;if(B?.isPlaceholderData&&Z.placeholderData===X?.placeholderData)M=B.data,N=!0;else M=typeof Z.placeholderData==="function"?Z.placeholderData(this.#W?.state.data,this.#W):Z.placeholderData;if(M!==void 0)q="success",Y=XH(B?.data,M,Z),U=!0}if(Z.select&&Y!==void 0&&!N)if(B&&Y===Q?.data&&Z.select===this.#G)Y=this.#z;else try{this.#G=Z.select,Y=Z.select(Y),Y=XH(B?.data,Y,Z),this.#z=Y,this.#X=null}catch(M){this.#X=M}else if(Y===void 0)this.#X=null;if(this.#X)F=this.#X,Y=this.#z,W=Date.now(),q="error",U=!1;let A=K.fetchStatus==="fetching",V=q==="pending",D=q==="error",L=V&&A,j=Y!==void 0;return{status:q,fetchStatus:K.fetchStatus,isPending:V,isSuccess:q==="success",isError:D,isInitialLoading:L,isLoading:L,data:Y,dataUpdatedAt:K.dataUpdatedAt,error:F,errorUpdatedAt:W,failureCount:K.fetchFailureCount,failureReason:K.fetchFailureReason,errorUpdateCount:K.errorUpdateCount,isFetched:$.isFetched(),isFetchedAfterMount:K.dataUpdateCount>z.dataUpdateCount||K.errorUpdateCount>z.errorUpdateCount,isFetching:A,isRefetching:A&&!V,isLoadingError:D&&!j,isPaused:K.fetchStatus==="paused",isPlaceholderData:U,isRefetchError:D&&j,isStale:Uq($,Z),refetch:this.refetch,isEnabled:S5(Z.enabled,$)!==!1}}updateResult(){let $=this.#H,Z=this.createResult(this.#Z,this.options);if(this.#Q=this.#Z.state,this.#B=this.options,this.#Q.data!==void 0)this.#W=this.#Z;if(m$(Z,$))return;this.#H=Z;let H=(()=>{if(!$)return!0;let{notifyOnChangeProps:B}=this.options,Q=typeof B==="function"?B():B;if(Q==="all"||!Q&&!this.#q.size)return!0;let X=new Set(Q??this.#q);if(this.options.throwOnError)X.add("error");return Object.keys(this.#H).some((z)=>{let G=z;return this.#H[G]!==$[G]&&X.has(G)})})();t1.batch(()=>{if(H)this.listeners.forEach((B)=>{B(this.#H)});this.#$.getQueryCache().notify({query:this.#Z,type:"observerResultsUpdated"})})}#_(){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.#L()}};function ao($,Z){return S5(Z.enabled,$)!==!1&&$.state.data===void 0&&!($.state.status==="error"&&S5(Z.retryOnMount,$)===!1)}function S_($,Z){return ao($,Z)||$.state.data!==void 0&&Gq($,Z,Z.refetchOnMount)}function Gq($,Z,J){if(S5(Z.enabled,$)!==!1&&S5(Z.staleTime,$)!=="static"){let H=typeof J==="function"?J($):J;return H==="always"||H!==!1&&Uq($,Z)}return!1}function I_($,Z,J,H){return($!==Z||S5(H.enabled,$)===!1)&&(!J.suspense||$.state.status!=="error")&&Uq($,J)}function Uq($,Z){return S5(Z.enabled,$)!==!1&&$.isStaleByTime(S5(Z.staleTime,$))}var R_=class extends qX{#$;#Z;#J;#H;constructor($){super();this.#$=$.client,this.mutationId=$.mutationId,this.#J=$.mutationCache,this.#Z=[],this.state=$.state||Yq(),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.#H?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute($){let Z=()=>{this.#Q({type:"continue"})},J={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey},H=this.#H=WX({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn($,J)},onFail:(X,z)=>{this.#Q({type:"failed",failureCount:X,error:z})},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)}),B=this.state.status==="pending",Q=!H.canStart();try{if(B)Z();else{if(this.#Q({type:"pending",variables:$,isPaused:Q}),this.#J.config.onMutate)await this.#J.config.onMutate($,this,J);let z=await this.options.onMutate?.($,J);if(z!==this.state.context)this.#Q({type:"pending",context:z,variables:$,isPaused:Q})}let X=await H.start();return await this.#J.config.onSuccess?.(X,$,this.state.context,this,J),await this.options.onSuccess?.(X,$,this.state.context,J),await this.#J.config.onSettled?.(X,null,this.state.variables,this.state.context,this,J),await this.options.onSettled?.(X,null,$,this.state.context,J),this.#Q({type:"success",data:X}),X}catch(X){try{await this.#J.config.onError?.(X,$,this.state.context,this,J)}catch(z){Promise.reject(z)}try{await this.options.onError?.(X,$,this.state.context,J)}catch(z){Promise.reject(z)}try{await this.#J.config.onSettled?.(void 0,X,this.state.variables,this.state.context,this,J)}catch(z){Promise.reject(z)}try{await this.options.onSettled?.(void 0,X,$,this.state.context,J)}catch(z){Promise.reject(z)}throw this.#Q({type:"error",error:X}),X}finally{if(this.#H===H)this.#H=void 0;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),t1.batch(()=>{this.#Z.forEach((J)=>{J.onMutationUpdate($)}),this.#J.notify({mutation:this,type:"updated",action:$})})}};function Yq(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var b_=class extends z8{#$;#Z;#J;constructor($={}){super();this.config=$,this.#$=new Set,this.#Z=new Map,this.#J=0}build($,Z,J){let H=new R_({client:$,mutationCache:this,mutationId:++this.#J,options:$.defaultMutationOptions(Z),state:J});return this.add(H),H}add($){this.#$.add($);let Z=NX($);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=NX($);if(typeof Z==="string"){let J=this.#Z.get(Z);if(J){if(J.length>1){let H=J.indexOf($);if(H!==-1)J.splice(H,1)}else if(J[0]===$)this.#Z.delete(Z)}}}this.notify({type:"removed",mutation:$})}canRun($){let Z=NX($);if(typeof Z==="string"){let J=this.#Z.get(Z)?.find((H)=>H.state.status==="pending");return!J||J===$}else return!0}runNext($){let Z=NX($);if(typeof Z==="string")return this.#Z.get(Z)?.find((J)=>J!==$&&J.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){t1.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)=>UX(Z,J))}findAll($={}){return this.getAll().filter((Z)=>UX($,Z))}notify($){t1.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}resumePausedMutations(){let $=this.getAll().filter((Z)=>Z.state.isPaused);return t1.batch(()=>Promise.all($.map((Z)=>Z.continue().catch(m5))))}};function NX($){return $.options.scope?.id}var Fq=class extends z8{#$;#Z=void 0;#J;#H;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($),!m$(this.options,Z))this.#$.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#J,observer:this});if(Z?.mutationKey&&this.options.mutationKey&&G9(Z.mutationKey)!==G9(this.options.mutationKey))this.reset();else if(this.#J?.state.status==="pending")this.#J.setOptions(this.options)}onSubscribe(){if(this.listeners.size===1&&this.#J)this.#J.addObserver(this),this.#Q()}onUnsubscribe(){if(!this.hasListeners())this.#J?.removeObserver(this)}onMutationUpdate($){this.#Q(),this.#B($)}getCurrentResult(){return this.#Z}reset(){this.#J?.removeObserver(this),this.#J=void 0,this.#Q(),this.#B()}mutate($,Z){return this.#H=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??Yq();this.#Z={...$,isPending:$.status==="pending",isSuccess:$.status==="success",isError:$.status==="error",isIdle:$.status==="idle",mutate:this.mutate,reset:this.reset}}#B($){t1.batch(()=>{if(this.#H&&this.hasListeners()){let Z=this.#Z.variables,J=this.#Z.context,H={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};if($?.type==="success"){try{this.#H.onSuccess?.($.data,Z,J,H)}catch(B){Promise.reject(B)}try{this.#H.onSettled?.($.data,null,Z,J,H)}catch(B){Promise.reject(B)}}else if($?.type==="error"){try{this.#H.onError?.($.error,Z,J,H)}catch(B){Promise.reject(B)}try{this.#H.onSettled?.(void 0,$.error,Z,J,H)}catch(B){Promise.reject(B)}}}this.listeners.forEach((Z)=>{Z(this.#Z)})})}};var k_=class extends z8{#$;constructor($={}){super();this.config=$,this.#$=new Map}build($,Z,J){let H=Z.queryKey,B=Z.queryHash??BH(H,Z),Q=this.get(B);if(!Q)Q=new w_({client:$,queryKey:H,queryHash:B,options:$.defaultQueryOptions(Z),state:J,defaultOptions:$.getQueryDefaults(H)}),this.add(Q);return Q}add($){if(!this.#$.has($.queryHash))this.#$.set($.queryHash,$),this.notify({type:"added",query:$})}remove($){let Z=this.#$.get($.queryHash);if(Z){if($.destroy(),Z===$)this.#$.delete($.queryHash);this.notify({type:"removed",query:$})}}clear(){t1.batch(()=>{this.getAll().forEach(($)=>{this.remove($)})})}get($){return this.#$.get($)}getAll(){return[...this.#$.values()]}find($){let Z={exact:!0,...$};return this.getAll().find((J)=>KX(Z,J))}findAll($={}){let Z=this.getAll();return Object.keys($).length>0?Z.filter((J)=>KX($,J)):Z}notify($){t1.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}onFocus(){t1.batch(()=>{this.getAll().forEach(($)=>{$.onFocus()})})}onOnline(){t1.batch(()=>{this.getAll().forEach(($)=>{$.onOnline()})})}};var Wq=class{#$;#Z;#J;#H;#Q;#B;#X;#G;constructor($={}){this.#$=$.queryCache||new k_,this.#Z=$.mutationCache||new b_,this.#J=$.defaultOptions||{},this.#H=new Map,this.#Q=new Map,this.#B=0}mount(){if(this.#B++,this.#B!==1)return;this.#X=d$.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onFocus()}),this.#G=l$.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onOnline()})}unmount(){if(this.#B--,this.#B!==0)return;this.#X?.(),this.#X=void 0,this.#G?.(),this.#G=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),H=J.state.data;if(H===void 0)return this.fetchQuery($);if($.revalidateIfStale&&J.isStaleByTime(S5(Z.staleTime,J)))this.prefetchQuery(Z);return Promise.resolve(H)}getQueriesData($){return this.#$.findAll($).map(({queryKey:Z,state:J})=>{return[Z,J.data]})}setQueryData($,Z,J){let H=this.defaultQueryOptions({queryKey:$}),B=this.#$.get(H.queryHash)?.state.data,Q=D_(Z,B);if(Q===void 0)return;return this.#$.build(this,H).setData(Q,{...J,manual:!0})}setQueriesData($,Z,J){return t1.batch(()=>this.#$.findAll($).map(({queryKey:H})=>[H,this.setQueryData(H,Z,J)]))}getQueryState($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state}removeQueries($){let Z=this.#$;t1.batch(()=>{Z.findAll($).forEach((J)=>{Z.remove(J)})})}resetQueries($,Z){let J=this.#$;return t1.batch(()=>{let H=J.findAll($),B=new Set(H);return H.forEach((Q)=>{Q.reset()}),this.refetchQueries({type:"active",predicate:(Q)=>B.has(Q)},Z)})}cancelQueries($,Z={}){let J={revert:!0,...Z},H=t1.batch(()=>this.#$.findAll($).map((B)=>B.cancel(J)));return Promise.all(H).then(m5).catch(m5)}invalidateQueries($,Z={}){return t1.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},H=t1.batch(()=>this.#$.findAll($).filter((B)=>!B.isDisabled()&&!B.isStatic()).map((B)=>{let Q=B.fetch(void 0,J);if(!J.throwOnError)Q=Q.catch(m5);return B.state.fetchStatus==="paused"?Promise.resolve():Q}));return Promise.all(H).then(m5)}async query($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let J=this.#$.build(this,Z),H=J.isStaleByTime(S5(Z.staleTime,J))?await J.fetch(Z):J.state.data,B=Z.select;if(B)return B(H);return H}fetchQuery($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let J=this.#$.build(this,Z);return J.isStaleByTime(S5(Z.staleTime,J))?J.fetch(Z):Promise.resolve(J.state.data)}prefetchQuery($){return this.fetchQuery($).then(m5).catch(m5)}infiniteQuery($){return $._type="infinite",this.query($)}fetchInfiniteQuery($){return $._type="infinite",this.fetchQuery($)}prefetchInfiniteQuery($){return this.fetchInfiniteQuery($).then(m5).catch(m5)}ensureInfiniteQueryData($){return $._type="infinite",this.ensureQueryData($)}resumePausedMutations(){if(l$.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.#H.set(G9($),{queryKey:$,defaultOptions:Z})}getQueryDefaults($){let Z=[...this.#H.values()],J={};return Z.forEach((H)=>{if(h3($,H.queryKey))Object.assign(J,H.defaultOptions)}),J}setMutationDefaults($,Z){this.#Q.set(G9($),{mutationKey:$,defaultOptions:Z})}getMutationDefaults($){let Z=[...this.#Q.values()],J={};return Z.forEach((H)=>{if(h3($,H.mutationKey))Object.assign(J,H.defaultOptions)}),J}defaultQueryOptions($){if($._defaulted)return $;let Z={...this.#J.queries,...this.getQueryDefaults($.queryKey),...$,_defaulted:!0};if(!Z.queryHash)Z.queryHash=BH(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===u$)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 x_=($,Z,J)=>{let H=J?.state.error&&typeof $.throwOnError==="function"?p$($.throwOnError,[J.state.error,J]):$.throwOnError;if($.suspense||H){if(!Z.isReset())$.retryOnMount=!1}},h_=($)=>{y_.useEffect(()=>{$.clearReset()},[$])},v_=({result:$,errorResetBoundary:Z,throwOnError:J,query:H,suspense:B})=>{return $.isError&&!Z.isReset()&&!$.isFetching&&H&&(B&&$.data===void 0||p$(J,[$.error,H]))};var g_=($)=>{if($.suspense){let J=(B)=>B==="static"?B:Math.max(B??1000,1000),H=$.staleTime;if($.staleTime=typeof H==="function"?(...B)=>J(H(...B)):J(H),typeof $.gcTime==="number")$.gcTime=Math.max($.gcTime,1000)}},f_=($,Z)=>$?.suspense&&Z.isPending,m_=($,Z,J)=>Z.fetchOptimistic($).catch(()=>{J.clearReset()});var v3=_(p(),1);function u_($,Z,J){let H=W_(),B=q_(),Q=z1(J),X=Q.defaultQueryOptions($),z=Q.getQueryCache().get(X.queryHash),G=$.subscribed!==!1;X._optimisticResults=H?"isRestoring":G?"optimistic":void 0,g_(X),x_(X,B,z),h_(B);let[K]=v3.useState(()=>new Z(Q,X)),U=K.getOptimisticResult(X),Y=!H&&G;if(v3.useSyncExternalStore(v3.useCallback((F)=>{let W=Y?K.subscribe(t1.batchCalls(F)):m5;return K.updateResult(),W},[K,Y]),()=>K.getCurrentResult(),()=>K.getCurrentResult()),v3.useEffect(()=>{K.setOptions(X)},[X,K]),f_(X,U))throw m_(X,K,B);if(v_({result:U,errorResetBoundary:B,throwOnError:X.throwOnError,query:z,suspense:X.suspense}))throw U.error;return!X.notifyOnChangeProps?K.trackResult(U):U}function J5($,Z){return u_($,Kq,Z)}function qq($){return $}var Q3=_(p(),1);function Nq($,Z){let J=z1(Z);return c_({filters:{...$,status:"pending"}},J).length}function p_($,Z){return $.findAll(Z.filters).map((J)=>Z.select?Z.select(J):J.state)}function c_($={},Z){let J=z1(Z).getMutationCache(),H=Q3.useRef($),B=Q3.useRef(null);if(B.current===null)B.current=p_(J,$);return Q3.useEffect(()=>{H.current=$}),Q3.useSyncExternalStore(Q3.useCallback((Q)=>J.subscribe(()=>{let X=QH(B.current,p_(J,H.current));if(B.current!==X)B.current=X,t1.schedule(Q)}),[J]),()=>B.current,()=>B.current)}var X3=_(p(),1);function H5($,Z){let J=z1(Z),[H]=X3.useState(()=>new Fq(J,$));X3.useEffect(()=>{H.setOptions($)},[H,$]);let B=X3.useSyncExternalStore(X3.useCallback((X)=>H.subscribe(t1.batchCalls(X)),[H]),()=>H.getCurrentResult(),()=>H.getCurrentResult()),Q=X3.useCallback((...X)=>{H.mutate(X[0],X[1]).catch(m5)},[H]);if(B.error&&p$(H.options.throwOnError,[B.error]))throw B.error;return{...B,mutate:Q,mutateAsync:B.mutate}}var Ro=_(lY0(),1);function d_($,Z){if($ instanceof RegExp)return{keys:!1,pattern:$};var J,H,B,Q,X=[],z="",G=$.split("/");G[0]||G.shift();while(B=G.shift())if(J=B[0],J==="*")X.push(J),z+=B[1]==="?"?"(?:/(.*))?":"/(.*)";else if(J===":"){if(H=B.indexOf("?",1),Q=B.indexOf(".",1),X.push(B.substring(1,~H?H:~Q?Q:B.length)),z+=!!~H&&!~Q?"(?:/([^/]+?))?":"/([^/]+?)",~Q)z+=(~H?"?":"")+"\\"+B.substring(Q)}else z+="/"+B;return{keys:X,pattern:new RegExp("^"+z+(Z?"(?=$|/)":"/?$"),"i")}}var Y7=_(p(),1),f1=_(p(),1);var VX=_(i$(),1);var Xn=Y7.useInsertionEffect,zn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Aq=zn?Y7.useLayoutEffect:Y7.useEffect,Gn=Xn||Aq,AX=($)=>{let Z=Y7.useRef([$,(...J)=>Z[0](...J)]).current;return Gn(()=>{Z[0]=$}),Z[1]};var l_=["popstate","pushState","replaceState","hashchange"],zH=[],i_=()=>zH.forEach(($)=>$()),Kn=($)=>{if(zH.push($)===1)l_.forEach((Z)=>addEventListener(Z,i_));return()=>{if(zH=zH.filter((Z)=>Z!==$),!zH.length)l_.forEach((Z)=>removeEventListener(Z,i_))}},n_=($,Z)=>VX.useSyncExternalStore(Kn,$,Z),r_=()=>location.search,DX=({ssrSearch:$}={})=>n_(r_,$!=null?()=>$:r_),a_=()=>location.pathname,Dq=({ssrPath:$}={})=>n_(a_,$!=null?()=>$:a_);var Un=($,{replace:Z=!1,state:J=null}={})=>history[Z?"replaceState":"pushState"](J,"",$),s_=($)=>[Dq($),Un],o_=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[o_]>"u"){for(let $ of["pushState","replaceState"]){let Z=history[$];history[$]=function(){let J=Z.apply(this,arguments),H=new Event($);return H.arguments=arguments,dispatchEvent(H),J}}Object.defineProperty(window,o_,{value:!0})}var e_=($="")=>$==="/"?"":$,$j=($,Z)=>$[0]==="~"?$.slice(1):e_(Z)+$,Lq=($,Z)=>{return $=t_(e_($)),Z=t_(Z),!$||!Z.toLowerCase().indexOf($.toLowerCase())?Z.slice($.length)||"/":"~"+Z},t_=($)=>{try{return $.includes("%")?decodeURI($):$}catch(Z){return $}};var Zj={hook:s_,searchHook:DX,parser:d_,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:($)=>$,aroundNav:($,Z,J)=>$(Z,J)},Jj=f1.createContext(Zj),G8=()=>f1.useContext(Jj),Hj={},Bj=f1.createContext(Hj),Yn=()=>f1.useContext(Bj),Qj=($,Z=$.base)=>Lq(Z,$.hook($)[0]),Mq=($)=>{let[Z,J]=$.hook($);return[Lq($.base,Z),AX((H,B)=>$.aroundNav(J,$j(H,$.base),B))]},K8=()=>Mq(G8());var Xj=($,Z,J,H)=>{let{pattern:B,keys:Q}=Z instanceof RegExp?{pattern:Z}:$(Z||"*",H),X=B.exec(J);if(!X)return[!1,null];let z={};for(let G=1;G<X.length;G++)z[G-1]=X[G];if(Q)for(let G=0;G<Q.length;G++)z[Q[G]]=X[G+1];else Object.assign(z,X.groups);return H?[!0,z,X[0]]:[!0,z]};var Pq=({children:$,...Z})=>{let J=G8(),H=Z.hook?Zj:J,B=H;if(Z.ssrPath){let[G,K=Z.ssrSearch??""]=Z.ssrPath.split("?");if(G)Z.ssrSearch=K,Z.ssrPath=G}Z.hrefs=Z.hrefs??Z.hook?.hrefs,Z.searchHook=Z.searchHook??Z.hook?.searchHook;let Q=f1.useRef(H),X=Q.current,z=X;for(let G in H){let K=G==="base"?H[G]+(Z[G]??""):Z[G]??H[G];if(K!==z[G]){if(X===z)Q.current=z={...z};z[G]=K}if(K!==H[G]||K!==B[G])B=z}return f1.createElement(Jj.Provider,{value:B},$)},Fn=({children:$,component:Z},J)=>{if(Z)return f1.createElement(Z,{params:J});return typeof $==="function"?$(J):$},Wn=($)=>{let Z=f1.useRef(Hj),J=Z.current,H=Object.keys($);return Z.current=H.length!==Object.keys(J).length||H.some((B)=>$[B]!==J[B])?$:J};var LX=({path:$,nest:Z,match:J,...H})=>{let B=G8(),Q=Qj(B),[X,z,G]=J??Xj(B.parser,$,Q,Z),K=Wn({...Yn(),...z});if(!X)return null;let U=Fn(H,K);return f1.createElement(Bj.Provider,{value:K},G?f1.createElement(Pq,{base:G},U):U)},F7=f1.forwardRef(($,Z)=>{let J=G8(),[H,B]=Mq(J),{to:Q="",href:X=Q,onClick:z,asChild:G,children:K,className:U,replace:Y,state:F,transition:W,...q}=$;if(q.onClick=AX((N)=>{if(N.ctrlKey||N.metaKey||N.altKey||N.shiftKey||N.button!==0)return;if(z?.(N),!N.defaultPrevented)N.preventDefault(),B(X,$)}),q.href=J.hrefs(X[0]==="~"?X.slice(1):J.base+X,J),U!==void 0)q.className=U?.call?U(H===X):U;if(Z)q.ref=Z;return G&&f1.isValidElement(K)?f1.cloneElement(K,q):f1.createElement("a",q,K)}),zj=($,Z=[])=>{if(Array.isArray($))for(let J of $)zj(J&&J.type===f1.Fragment?J.props.children:J,Z);else Z.push($);return Z},Gj=({children:$,location:Z})=>{let J=G8(),H=Qj(J);for(let B of zj($)){let Q=0;if(f1.isValidElement(B)&&(Q=Xj(J.parser,B.props.path,Z||H,B.props.nest))[0])return f1.cloneElement(B,{match:Q})}return null},Kj=($)=>{let{to:Z,href:J=Z}=$,H=G8(),[,B]=Mq(H),Q=AX(()=>B(Z||J,$)),{ssrContext:X}=H;if(Aq(()=>{Q()},[]),X)X.redirectTo=Z;return null};var n2={};I5(n2,{useToastManager:()=>ZC,createToastManager:()=>JC,Viewport:()=>rj,Title:()=>PO,Root:()=>YO,Provider:()=>cj,Positioner:()=>sT,Portal:()=>RO,Description:()=>LO,Content:()=>FO,Close:()=>_O,Arrow:()=>eT,Action:()=>OO});var pj=_(p(),1);var Uj=_(p(),1);function g3($){Uj.useEffect($,c2)}var MX=_(p(),1),_q=MX.createContext(void 0);function K9(){let $=MX.useContext(_q);if(!$)throw Error(h0(73));return $}var qj=_(p(),1),Cq=_(i$(),1);var f3=_(p(),1),qn=i$();function Nn($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var Vn=typeof Object.is==="function"?Object.is:Nn,An=qn.useSyncExternalStore,Dn=f3.useRef,Ln=f3.useEffect,Mn=f3.useMemo,Pn=f3.useDebugValue;var jq=function($,Z,J,H,B){var Q=Dn(null);if(Q.current===null){var X={hasValue:!1,value:null};Q.current=X}else X=Q.current;Q=Mn(function(){function G(W){if(!K){if(K=!0,U=W,W=H(W),B!==void 0&&X.hasValue){var q=X.value;if(B(q,W))return Y=q}return Y=W}if(q=Y,Vn(U,W))return q;var N=H(W);if(B!==void 0&&B(q,N))return U=W,q;return U=W,Y=N}var K=!1,U,Y,F=J===void 0?null:J;return[function(){return G(Z())},F===null?void 0:function(){return G(F())}]},[Z,J,H,B]);var z=An($,Q[0],Q[1]);return Ln(function(){X.hasValue=!0,X.value=z},[z]),Pn(z),z};var Yj=_(p(),1);var Oq=[],Tq=void 0;function Fj(){return Tq}function Wj($){Oq.push($)}function R8($){let Z=(J,H)=>{let B=d1(_n).current,Q;try{Tq=B;for(let X of Oq)X.before(B);Q=$(J,H);for(let X of Oq)X.after(B);B.didInitialize=!0}finally{Tq=void 0}return Q};return Z.displayName=$.displayName||$.name,Z}function U9($){return Yj.forwardRef(R8($))}function _n(){return{didInitialize:!1}}var jn=PX(19),On=jn?Cn:En;function _X($,Z,J,H,B){return On($,Z,J,H,B)}function Tn($,Z,J,H,B){let Q=qj.useCallback(()=>Z($.getSnapshot(),J,H,B),[$,Z,J,H,B]);return Cq.useSyncExternalStore($.subscribe,Q,Q)}Wj({before($){if($.syncIndex=0,!$.didInitialize)$.syncTick=1,$.syncHooks=[],$.didChangeStore=!0,$.getSnapshot=()=>{let Z=!1;for(let J=0;J<$.syncHooks.length;J+=1){let H=$.syncHooks[J],B=H.selector(H.store.state,H.a1,H.a2,H.a3);if(!Object.is(H.value,B))Z=!0,H.value=B}if(Z)$.syncTick+=1;return $.syncTick}},after($){if($.syncHooks.length>0){if($.didChangeStore)$.didChangeStore=!1,$.subscribe=(Z)=>{let J=new Set;for(let B of $.syncHooks)J.add(B.store);let H=[];for(let B of J)H.push(B.subscribe(Z));return()=>{for(let B of H)B()}};Cq.useSyncExternalStore($.subscribe,$.getSnapshot,$.getSnapshot)}}});function Cn($,Z,J,H,B){let Q=Fj();if(!Q)return Tn($,Z,J,H,B);let X=Q.syncIndex;Q.syncIndex+=1;let z;if(!Q.didInitialize)z={store:$,selector:Z,a1:J,a2:H,a3:B,value:Z($.getSnapshot(),J,H,B)},Q.syncHooks.push(z);else if(z=Q.syncHooks[X],z.store!==$||z.selector!==Z||!Object.is(z.a1,J)||!Object.is(z.a2,H)||!Object.is(z.a3,B)){if(z.store!==$)Q.didChangeStore=!0;z.store=$,z.selector=Z,z.a1=J,z.a2=H,z.a3=B,z.value=Z($.getSnapshot(),J,H,B)}return z.value}function En($,Z,J,H,B){return jq($.subscribe,$.getSnapshot,$.getSnapshot,(Q)=>Z(Q,J,H,B))}class Eq{static create($){return new this($)}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,H){return _X(this,$,Z,J,H)}}var W7=_(p(),1);class S2 extends Eq{constructor($,Z={},J){super($);this.context=Z,this.selectors=J}useSyncedValue($,Z){W7.useDebugValue($);let J=this;H0(()=>{if(J.state[$]!==Z)J.set($,Z)},[J,$,Z])}useSyncedValueWithCleanup($,Z){let J=this;H0(()=>{if(J.state[$]!==Z)J.set($,Z);return()=>{J.set($,void 0)}},[J,$,Z])}useSyncedValues($){let Z=this,J=Object.values($);H0(()=>{Z.update($)},[Z,...J])}useControlledProp($,Z){W7.useDebugValue($);let J=this,H=Z!==void 0;H0(()=>{if(H&&!Object.is(J.state[$],Z))J.setState({...J.state,[$]:Z})},[J,$,Z,H])}select($,Z,J,H){let B=this.selectors[$];return B(this.state,Z,J,H)}useState($,Z,J,H){return W7.useDebugValue($),_X(this,this.selectors[$],Z,J,H)}useContextCallback($,Z){W7.useDebugValue($);let J=U0(Z??F1);this.context[$]=J}useStateSetter($){let Z=W7.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 H=J(this.state);return Z(H,H,this),this.subscribe((B)=>{let Q=J(B);if(!Object.is(H,Q)){let X=H;H=Q,Z(Q,X,this)}})}}function N2(...$){return()=>{for(let Z=0;Z<$.length;Z+=1){let J=$[Z];if(J)J()}}}function o0($,Z,J,H){return $.addEventListener(Z,J,H),()=>{$.removeEventListener(Z,J,H)}}var jX=_(p(),1);function Nj(){let[,$]=jX.useState({});return jX.useCallback(()=>{$({})},[])}var OX=null,UN0=globalThis.requestAnimationFrame;class Vj{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 H=0;H<Z.length;H+=1)Z[H]?.($)};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;if(this.callbacks[Z]===null)return;this.callbacks[Z]=null,this.callbacksCount-=1}}var TX=new Vj;class I2{static create(){return new I2}static request($){return TX.request($)}static cancel($){return TX.cancel($)}currentId=OX;request($){this.cancel(),this.currentId=TX.request(()=>{this.currentId=OX,$()})}cancel=()=>{if(this.currentId!==OX)TX.cancel(this.currentId),this.currentId=OX};disposeEffect=()=>{return this.cancel}}function F4(){let $=d1(I2.create).current;return g3($.disposeEffect),$}var GH=0;class p5{static create(){return new p5}currentId=GH;start($,Z){this.clear(),this.currentId=setTimeout(()=>{this.currentId=GH,Z()},$)}isStarted(){return this.currentId!==GH}clear=()=>{if(this.currentId!==GH)clearTimeout(this.currentId),this.currentId=GH};disposeEffect=()=>{return this.clear}}function i1(){let $=d1(p5.create).current;return g3($.disposeEffect),$}var Aj=0;function CX($){return Aj+=1,`${$}-${Math.random().toString(36).slice(2,6)}-${Aj}`}function EX($,Z){if(typeof $==="string")return{description:$};if(typeof $==="function"){let J=$(Z);return typeof J==="string"?{description:J}:J}return $}var r1={};I5(r1,{screenReader:()=>kq,os:()=>Iq,mediaQuery:()=>xq,env:()=>yq,engine:()=>bq});var Iq={};I5(Iq,{windows:()=>Rn,mac:()=>Pj,linux:()=>bn,ios:()=>wq,apple:()=>Sq,android:()=>Mj});function wn(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Sn,platform:In,maxTouchPoints:Dj}=wn(),q7=Sn.toLowerCase(),N7=In.toLowerCase();var wq=/^i(os$|p)/.test(N7)||N7==="macintel"&&Dj>1,Lj="android",Mj=N7===Lj||q7.includes(Lj),Pj=!wq&&N7.startsWith("mac"),Rn=N7.startsWith("win"),bn=!Mj&&/^(linux|chrome os)/.test(N7),Sq=Pj||wq;var bq={};I5(bq,{webkit:()=>Rq,gecko:()=>kn,blink:()=>yn});var Rq=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),kn=!Rq&&q7.includes("firefox"),yn=!Rq&&q7.includes("chrom");var kq={};I5(kq,{voiceOver:()=>xn});var xn=Sq;var yq={};I5(yq,{jsdom:()=>hn});var hn=/jsdom|happydom/.test(q7);var xq={};I5(xq,{iOS:()=>vn});var vn="@supports (-webkit-touch-callout: none)";function p1($){let Z=$.activeElement;while(Z?.shadowRoot?.activeElement!=null)Z=Z.shadowRoot.activeElement;return Z}function b0($,Z){if(!$||!Z)return!1;let J=Z.getRootNode?.();if($.contains(Z))return!0;if(J&&m3(J)){let H=Z;while(H){if($===H)return!0;H=H.parentNode||H.host}}return!1}function M1($){if("composedPath"in $)return $.composedPath()[0]??$.target;return $.target}var KH="data-base-ui-focusable";var hq="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",UH="ArrowLeft",YH="ArrowRight",vq="ArrowUp",wX="ArrowDown";var l4={};I5(l4,{startingStyle:()=>V7,endingStyle:()=>FH});var V7="data-starting-style",FH="data-ending-style";var gn={[V7]:""},fn={[FH]:""},V2={transitionStatus($){if($==="starting")return gn;if($==="ending")return fn;return null}};var A7={};I5(A7,{startingStyle:()=>mn,side:()=>pn,open:()=>gq,endingStyle:()=>un,closed:()=>fq,anchorHidden:()=>mq,align:()=>cn});var gq="data-open",fq="data-closed",mn=V7,un=FH,mq="data-anchor-hidden",pn="data-side",cn="data-align";var IX={};I5(IX,{pressed:()=>uq,popupOpen:()=>SX});var SX="data-popup-open",uq="data-pressed";var dn={[SX]:""},ln={[SX]:"",[uq]:""},rn={[gq]:""},an={[fq]:""},on={[mq]:""},Y9={open($){if($)return dn;return null}},WH={open($){if($)return ln;return null}},i4={open($){if($)return rn;return an},anchorHidden($){if($)return on;return null}},d2={...i4,...V2};var IN0=IX.popupOpen,qH="data-trigger-disabled";function u3($,Z){if(!n0($))return!1;let J=$;if(Z.hasElement(J))return!J.hasAttribute(qH);for(let[,H]of Z.entries())if(b0(H,J))return!H.hasAttribute(qH);return!1}function RX($,Z){if(Z==null)return!1;if("composedPath"in $)return $.composedPath().includes(Z);let J=$;return J.target!=null&&Z.contains(J.target)}function jj($){return $.matches("html,body")}function D7($){return P1($)&&$.matches(hq)}function pq($){return $?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${hq}`)!=null}function NH($){if(!$)return!1;return $.getAttribute("role")==="combobox"&&D7($)}function F9($){if(!$||r1.env.jsdom)return!0;try{return $.matches(":focus-visible")}catch(Z){return!0}}function VH($){if(!$)return null;return $.hasAttribute(KH)?$:$.querySelector(`[${KH}]`)||$}function U8($,Z,J=!0){return $.filter((B)=>B.parentId===Z).flatMap((B)=>[...!J||B.context?.open?[B]:[],...U8($,B.id,J)])}function cq($,Z){let J=[],H=$.find((B)=>B.id===Z)?.parentId;while(H){let B=$.find((Q)=>Q.id===H);if(H=B?.parentId,B)J=J.concat(B)}return J}function S4($){$.preventDefault(),$.stopPropagation()}function Oj($){return"nativeEvent"in $}function r$($){if($.pointerType===""&&$.isTrusted)return!0;if(r1.os.android&&$.pointerType)return $.type==="click"&&$.buttons===1;return $.detail===0&&!$.pointerType}function a$($){if(r1.env.jsdom)return!1;return!r1.os.android&&$.width===0&&$.height===0||r1.os.android&&$.width===1&&$.height===1&&$.pressure===0&&$.detail===0&&$.pointerType==="mouse"||$.width<1&&$.height<1&&$.pressure===0&&$.detail===0&&$.pointerType==="touch"}function r4($,Z){let J=["mouse","pen"];if(!Z)J.push("",void 0);return J.includes($)}function Tj($){let Z=$.type;return Z==="click"||Z==="mousedown"||Z==="keydown"||Z==="keyup"}var{min:p3,max:b8,round:c3,floor:DH}=Math,W9=($)=>({x:$,y:$}),nn={left:"right",right:"left",bottom:"top",top:"bottom"};function kX($,Z,J){return b8($,p3(Z,J))}function q9($,Z){return typeof $==="function"?$(Z):$}function l2($){return $.split("-")[0]}function Y8($){return $.split("-")[1]}function yX($){return $==="x"?"y":"x"}function LH($){return $==="y"?"height":"width"}function I4($){let Z=$[0];return Z==="t"||Z==="b"?"y":"x"}function MH($){return yX(I4($))}function wj($,Z,J){if(J===void 0)J=!1;let H=Y8($),B=MH($),Q=LH(B),X=B==="x"?H===(J?"end":"start")?"right":"left":H==="start"?"bottom":"top";if(Z.reference[Q]>Z.floating[Q])X=AH(X);return[X,AH(X)]}function Sj($){let Z=AH($);return[bX($),Z,bX(Z)]}function bX($){return $.includes("start")?$.replace("start","end"):$.replace("end","start")}var Cj=["left","right"],Ej=["right","left"],sn=["top","bottom"],tn=["bottom","top"];function en($,Z,J){switch($){case"top":case"bottom":if(J)return Z?Ej:Cj;return Z?Cj:Ej;case"left":case"right":return Z?sn:tn;default:return[]}}function Ij($,Z,J,H){let B=Y8($),Q=en(l2($),J==="start",H);if(B){if(Q=Q.map((X)=>X+"-"+B),Z)Q=Q.concat(Q.map(bX))}return Q}function AH($){let Z=l2($);return nn[Z]+$.slice(Z.length)}function $s($){var Z,J,H,B;return{top:(Z=$.top)!=null?Z:0,right:(J=$.right)!=null?J:0,bottom:(H=$.bottom)!=null?H:0,left:(B=$.left)!=null?B:0}}function xX($){return typeof $!=="number"?$s($):{top:$,right:$,bottom:$,left:$}}function L7($){let{x:Z,y:J,width:H,height:B}=$;return{width:H,height:B,top:J,left:Z,right:Z+H,bottom:J+B,x:Z,y:J}}function d3($,Z){return Z<0||Z>=$.length}function M7($,Z){return F8($.current,{disabledIndices:Z})}function o$($,Z){return F8($.current,{decrement:!0,startingIndex:$.current.length,disabledIndices:Z})}function F8($,{startingIndex:Z=-1,decrement:J=!1,disabledIndices:H,amount:B=1}={}){let Q=Z;do Q+=J?-B:B;while(Q>=0&&Q<=$.length-1&&z3($,Q,H));return Q}function z3($,Z,J){if(typeof J==="function"?J(Z):J?.includes(Z)??!1)return!0;let B=$[Z];if(!B)return!1;if(!P7(B))return!0;if(B.matches(":disabled"))return!0;return!J&&(B.hasAttribute("disabled")||B.getAttribute("aria-disabled")==="true")}function Zs($){return $.visibility==="hidden"||$.visibility==="collapse"}function P7($,Z=$?R2($):null){if(!$||!$.isConnected||!Z||Zs(Z))return!1;if(typeof $.checkVisibility==="function")return $.checkVisibility();return Z.display!=="none"&&Z.display!=="contents"}var Js='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Hs($){let Z=$.assignedSlot;if(Z)return Z;if($.parentElement)return $.parentElement;let J=$.getRootNode();return m3(J)?J.host:null}function lq($){for(let Z of Array.from($.children))if(A2(Z)==="summary")return Z;return null}function Bs($,Z){let J=lq(Z);return!!J&&($===J||b0(J,$))}function Rj($){let Z=$?A2($):"";return $!=null&&$.matches(Js)&&(Z!=="summary"||$.parentElement!=null&&A2($.parentElement)==="details"&&lq($.parentElement)===$)&&(Z!=="details"||lq($)==null)&&(Z!=="input"||$.type!=="hidden")}function bj($){if(!Rj($)||!$.isConnected||$.matches(":disabled"))return!1;for(let Z=$;Z;Z=Hs(Z)){let J=Z!==$,H=A2(Z)==="slot";if(Z.hasAttribute("inert"))return!1;if(J&&A2(Z)==="details"&&!Z.open&&!Bs($,Z)||Z.hasAttribute("hidden")||!H&&!Qs(Z,J))return!1}return!0}function Qs($,Z){let J=R2($);if(!Z)return P7($,J);return J.display!=="none"}function kj($){let Z=$.tabIndex;if(Z<0){let J=A2($);if(J==="details"||J==="audio"||J==="video"||P1($)&&$.isContentEditable)return 0}return Z}function dq($){if(A2($)!=="input")return null;let Z=$;return Z.type==="radio"&&Z.name!==""?Z:null}function Xs($,Z){let J=dq($);if(!J)return!0;let H=Z.find((B)=>{let Q=dq(B);return Q?.name===J.name&&Q.form===J.form&&Q.checked});if(H)return H===J;return Z.find((B)=>{let Q=dq(B);return Q?.name===J.name&&Q.form===J.form})===J}function yj($){if(P1($)&&A2($)==="slot"){let Z=$.assignedElements({flatten:!0});if(Z.length>0)return Z}if(P1($)&&$.shadowRoot)return Array.from($.shadowRoot.children);return Array.from($.children)}function xj($,Z){yj($).forEach((J)=>{if(Rj(J))Z.push(J);xj(J,Z)})}function hj($,Z,J){yj($).forEach((H)=>{if(P1(H)&&H.matches(Z))J.push(H);hj(H,Z,J)})}function hX($){return bj($)&&kj($)>=0}function iq($){let Z=[];return xj($,Z),Z.filter(bj)}function n$($){let Z=iq($);return Z.filter((J)=>kj(J)>=0&&Xs(J,Z))}function vj($,Z){let J=n$($),H=J.length;if(H===0)return;let B=p1(m0($)),Q=J.indexOf(B),X=Q===-1?Z===1?0:H-1:Q+Z;return J[X]}function s$($){return vj(m0($).body,1)||$}function vX($){return vj(m0($).body,-1)||$}function gj($,Z){if(!$)return null;let J=n$(m0($).body),H=J.length;if(H===0)return null;let B=J.indexOf($);if(B===-1)return null;let Q=(B+Z+H)%H;return J[Q]}function fj($){return gj($,1)}function mj($){return gj($,-1)}function G3($,Z){let J=Z||$.currentTarget,H=$.relatedTarget;return!H||!b0(J,H)}function uj($){n$($).forEach((J)=>{J.dataset.tabindex=J.getAttribute("tabindex")||"",J.setAttribute("tabindex","-1")})}function rq($){let Z=[];hj($,"[data-tabindex]",Z),Z.forEach((J)=>{let H=J.dataset.tabindex;if(delete J.dataset.tabindex,H)J.setAttribute("tabindex",H);else J.removeAttribute("tabindex")})}function aq($){let Z=new Map,J=0,H=0;return $.forEach((B,Q)=>{let X=B.transitionStatus==="ending";if(Z.set(B.id,{value:B,domIndex:Q,visibleIndex:X?-1:J,offsetY:H}),H+=B.height||0,!X)J+=1}),Z}function oq($,Z){let J=0;return $.map((H)=>{if(H.transitionStatus==="ending")return H;let B=J>=Z;return J+=1,H.limited===B?H:{...H,limited:B}})}var k8={toasts:($)=>$.toasts,isEmpty:($)=>$.toasts.length===0,toast:($,Z)=>$.toastMetadata.get(Z)?.value,toastIndex:($,Z)=>$.toastMetadata.get(Z)?.domIndex??-1,toastOffsetY:($,Z)=>$.toastMetadata.get(Z)?.offsetY??0,toastVisibleIndex:($,Z)=>$.toastMetadata.get(Z)?.visibleIndex??-1,focused:($)=>$.focused,expanded:($)=>$.hovering||$.focused,expandedOrOutOfFocus:($)=>$.hovering||$.focused||!$.isWindowFocused,prevFocusElement:($)=>$.prevFocusElement};class nq extends S2{timers=new Map;areTimersPaused=!1;constructor($){super({...$,toastMetadata:aq($.toasts)},{},k8)}setViewport=($)=>{this.set("viewport",$)};syncProviderProps($,Z){let J=this.state.limit!==Z;if(this.state.timeout===$&&!J)return;let H={timeout:$,limit:Z};if(J){let B=oq(this.state.toasts,Z);H.toasts=B,H.toastMetadata=aq(B)}this.update(H)}disposeEffect=()=>{return()=>{this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear()}};removeToast($,Z=!1){let J=k8.toastIndex(this.state,$);if(J===-1)return;let H=this.state.toasts[J];if(!Z)H?.onRemove?.();let B=[...this.state.toasts];B.splice(J,1),this.setToasts(B)}addToast=($)=>{let{timeout:Z,limit:J}=this.state,H=$.id||CX("toast");if($.id){let z=k8.toast(this.state,$.id);if(z)if(z.transitionStatus==="ending")this.removeToast($.id,!0);else{let{id:G,transitionStatus:K,...U}=$;return this.updateToastInternal($.id,U,!0,!0),$.id}}let B={...$,id:H,updateKey:0,transitionStatus:"starting"},Q=[B,...this.state.toasts];this.setToasts(oq(Q,J));let X=B.timeout??Z;if(B.type!=="loading"&&X>0)this.scheduleTimer(H,X,()=>this.closeToast(H));if(k8.expandedOrOutOfFocus(this.state))this.pauseTimers();return H};updateToast=($,Z)=>{let J=k8.toast(this.state,$);if(!J||J.transitionStatus==="ending")return;this.updateToastInternal($,typeof Z==="function"?Z(J):Z,!1,!0)};updateToastInternal=($,Z,J=!1,H=!1)=>{let{timeout:B,toasts:Q}=this.state,X=k8.toast(this.state,$);if(!X)return;if(X.transitionStatus==="ending")return;let z={...X,...Z,...H&&{updateKey:X.updateKey+1}};this.setToasts(Q.map((N)=>N.id===$?z:N));let G=z.timeout??B,K=X.timeout??B,U=Object.hasOwn(Z,"timeout"),Y=z.transitionStatus!=="ending"&&z.type!=="loading"&&G>0,F=this.timers.has($),W=K!==G,q=X.type==="loading";if(!Y&&F){this.clearTimer($);return}if(Y&&(!F||W||U||q||J)){if(this.clearTimer($),this.scheduleTimer($,G,()=>this.closeToast($)),k8.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=($)=>{let Z=$===void 0,{limit:J,toasts:H}=this.state,B;if(Z)B=H,this.clearTimers();else{let z=k8.toast(this.state,$);if(!z)return;B=[z],this.clearTimer($)}let Q=H.map((z)=>Z||z.id===$?{...z,transitionStatus:"ending",height:0}:z),X=oq(Q,J);this.setToasts(X,!X.some((z)=>z.transitionStatus!=="ending")),B.forEach((z)=>{if(z.transitionStatus!=="ending")z.onClose?.()}),this.handleFocusManagement($)};promiseToast=($,Z)=>{let J=EX(Z.loading),H=this.addToast({...J,type:"loading"}),B=$.then((Q)=>{let X=EX(Z.success,Q);return this.updateToast(H,{...X,type:"success",timeout:X.timeout}),Q}).catch((Q)=>{let X=EX(Z.error,Q);return this.updateToast(H,{...X,type:"error",timeout:X.timeout}),Promise.reject(Q)});if({}.hasOwnProperty.call(Z,"setPromise"))Z.setPromise(B);return B};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach(($)=>{if($.timeout)$.timeout.clear(),$.remaining=Math.max($.remaining-(Date.now()-$.start),0)})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach(($,Z)=>{$.remaining=$.remaining>0?$.remaining:$.delay,$.timeout??=p5.create(),$.timeout.start($.remaining,()=>{this.handleTimerFired(Z),$.callback()}),$.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=($)=>{if($.pointerType!=="touch")return;let Z=M1($);if(b0(this.state.viewport,Z))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer($,Z,J){let H=Date.now(),Q=!k8.expandedOrOutOfFocus(this.state)?p5.create():void 0;Q?.start(Z,()=>{this.handleTimerFired($),J()}),this.timers.set($,{timeout:Q,start:H,delay:Z,remaining:Z,callback:J})}clearTimers(){this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer($){this.timers.get($)?.timeout?.clear(),this.timers.delete($),this.resetPausedStateIfNoTimersRemain()}handleTimerFired($){this.timers.delete($),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){if(this.timers.size===0)this.areTimersPaused=!1}setToasts($,Z=$.length===0){let J={toasts:$,toastMetadata:aq($)};if(Z)J.hovering=!1,J.focused=!1;this.update(J)}handleFocusManagement($){let Z=p1(m0(this.state.viewport));if(!this.state.viewport||!b0(this.state.viewport,Z)||!F9(Z))return;if($===void 0){this.restoreFocusToPrevElement();return}let J=k8.toasts(this.state),H=k8.toastIndex(this.state,$),B=(X,z)=>{for(let G=X;G>=0&&G<J.length;G+=z)if(J[G].transitionStatus!=="ending")return J[G];return null},Q=B(H+1,1)??B(H-1,-1);if(Q)Q.ref?.current?.focus();else this.restoreFocusToPrevElement()}}var gX=_(d(),1),cj=function(Z){let{children:J,timeout:H=5000,limit:B=3,toastManager:Q}=Z,X=d1(()=>new nq({timeout:H,limit:B,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return g3(X.disposeEffect),pj.useEffect(function(){if(!Q)return;return Q[" subscribe"](({action:K,options:U})=>{let Y=U.id;if(K==="promise"&&U.promise)X.promiseToast(U.promise,U);else if(K==="update"&&Y)X.updateToast(Y,U.updates);else if(K==="close")X.closeToast(Y);else X.addToast(U)})},[X,Q]),gX.jsxs(_q.Provider,{value:X,children:[gX.jsx(zs,{store:X,timeout:H,limit:B}),J]})};function zs($){let{store:Z,timeout:J,limit:H}=$;return H0(()=>{Z.syncProviderProps(J,H)},[Z,J,H]),null}var W8=_(p(),1);var dj={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},y8={...dj,position:"fixed",top:0,left:0},fX={...dj,position:"absolute"};var mX=_(p(),1);var lj=_(d(),1),R4=mX.forwardRef(function(Z,J){let[H,B]=mX.useState();return H0(()=>{if(r1.screenReader.voiceOver&&r1.engine.webkit)B("button")},[]),lj.jsx("span",{...Z,ref:J,style:y8,"aria-hidden":H?void 0:!0,...{tabIndex:0,role:H},"data-base-ui-focus-guard":""})});var ij="--toast-frontmost-height";var K3=_(d(),1),rj=W8.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=K9(),K=i1(),U=W8.useRef(!1),Y=W8.useRef(!1),F=W8.useRef(!1),W=G.useState("isEmpty"),q=G.useState("toasts"),N=G.useState("focused"),A=G.useState("expanded"),V=G.useState("prevFocusElement"),D=q[0]?.height,L=q.some((f)=>f.transitionStatus==="ending"),j=q.filter((f)=>f.priority==="high");W8.useEffect(()=>{let f=G.state.viewport;if(!f||W)return;let E=I1(f),i=m0(f);function r(o){if(o.key==="F6"&&M1(o)!==f)o.preventDefault(),G.set("prevFocusElement",p1(i)),f?.focus({preventScroll:!0}),G.pauseTimers(),G.set("focused",!0)}function x(o){if(M1(o)!==E)return;G.set("isWindowFocused",!1),G.pauseTimers()}function l(o){if(o.relatedTarget)return;let u=M1(o),c=p1(m0(f));if(u===E||!b0(f,u)||!F9(c))G.resumeTimers();K.start(0,()=>G.set("isWindowFocused",!0))}return N2(o0(E,"keydown",r),o0(E,"blur",x,!0),o0(E,"focus",l,!0),o0(i,"pointerdown",G.handleDocumentPointerDown,!0))},[G,K,W]);function M(f){U.current=!0;let E=f.relatedTarget===G.state.viewport?q.find((i)=>i.transitionStatus!=="ending"&&!i.limited):void 0;if(E)E.ref?.current?.focus();else G.restoreFocusToPrevElement()}function P(f){if(f.key==="Tab"&&f.shiftKey&&M1(f.nativeEvent)===G.state.viewport)f.preventDefault(),G.restoreFocusToPrevElement()}function w(){if(G.state.toasts.some((E)=>E.transitionStatus==="ending")||F.current||!Y.current)return;if(G.state.isWindowFocused)G.resumeTimers();G.set("hovering",!1),Y.current=!1}W8.useEffect(w,[L,G]);function C(){G.pauseTimers(),G.set("hovering",!0),Y.current=!1}function R(){if(G.state.isWindowFocused)G.resumeTimers()}function O(){Y.current=!0,w()}function S(f){if(f.pointerType==="touch")F.current=!0}function y(f){if(f.pointerType!=="touch")return;F.current=!1,w()}function k(){if(U.current){U.current=!1;return}if(N)return;if(F9(p1(m0(G.state.viewport))))G.set("focused",!0),G.pauseTimers()}function T(f){if(!N||b0(G.state.viewport,f.relatedTarget))return;G.set("focused",!1),R()}let b={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:C,onMouseMove:C,onMouseLeave:O,onFocus:k,onBlur:T,onKeyDown:P,onClick:k,onPointerDown:S,onPointerUp:y,onPointerCancel:y,style:{[ij]:D?`${D}px`:void 0}},I={expanded:A},v=!W&&V&&K3.jsx(R4,{onFocus:M}),h=z0("div",Z,{ref:[J,G.setViewport],state:I,props:[b,z,{children:K3.jsxs(W8.Fragment,{children:[v,X,v]})}]});return K3.jsxs(W8.Fragment,{children:[v,h,!N&&j.length>0&&K3.jsx("div",{style:y8,children:j.map((f)=>K3.jsxs("div",{role:"alert","aria-atomic":!0,children:[K3.jsx("div",{children:f.title}),K3.jsx("div",{children:f.description})]},f.id))})]})});var F5=_(p(),1),KO=_(a4(),1);function q8($){if(PX(19))return $;return $?"true":void 0}var uX=_(p(),1),sq=uX.createContext(void 0);function l3(){let $=uX.useContext(sq);if(!$)throw Error(h0(66));return $}var aj=_(p(),1);var tq=_(a4(),1);function x8($){if($==null)return $;return"current"in $?$.current:$}var pX=null;function Ks($){if(!pX){let Z=[];pX=Z,queueMicrotask(()=>{pX=null,tq.flushSync(()=>{for(let J of Z)J()})})}pX.push($)}function b4($,Z=!1,J=!1){let H=F4();return U0((B,Q=null)=>{H.cancel();let X=x8($);if(X==null)return;let z=X,G=()=>{if(!J){tq.flushSync(B);return}Ks(()=>{if(!Q?.aborted)B()})};if(typeof z.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){B();return}function K(){Promise.all(z.getAnimations().map((U)=>U.finished)).then(()=>{if(!Q?.aborted)G()},()=>{if(Q?.aborted)return;if(z.getAnimations().some((Y)=>Y.pending||Y.playState!=="finished")){K();return}G()})}if(Z){let U=V7;if(!z.hasAttribute(U)){H.request(K);return}let Y=new MutationObserver(()=>{if(!z.hasAttribute(U))Y.disconnect(),K()});Y.observe(z,{attributes:!0,attributeFilter:[U]}),Q?.addEventListener("abort",()=>Y.disconnect(),{once:!0});return}H.request(K)})}function T5($){let{enabled:Z=!0,open:J,ref:H,batch:B=!1,onComplete:Q}=$,X=U0(Q),z=b4(H,J,B);aj.useEffect(()=>{if(!Z)return;let G=new AbortController;return z(X,G.signal),()=>{G.abort()}},[Z,J,X,z])}var oj=500,cX=500,nj={style:{transition:"none"}},t$="data-base-ui-click-trigger";var sj="[data-base-ui-swipe-ignore]",tj="[data-swipe-ignore]",ej={fallbackAxisSide:"none"},N9={fallbackAxisSide:"end"},$O={clipPath:"inset(50%)",position:"fixed",top:0,left:0};var lX=_(p(),1);function D2($,Z=Number.MIN_SAFE_INTEGER,J=Number.MAX_SAFE_INTEGER){return Math.max(Z,Math.min($,J))}function dX($,Z){let J=(Z??I1($).getComputedStyle($)).transform,H=0,B=0,Q=1;if(J&&J!=="none"){let X=J.match(/matrix(?:3d)?\(([^)]+)\)/);if(X){let z=X[1].split(", ").map(parseFloat);if(z.length===6)H=z[4],B=z[5],Q=Math.sqrt(z[0]*z[0]+z[1]*z[1]);else if(z.length===16)H=z[12],B=z[13],Q=z[0]}}return{x:H,y:B,scale:Q}}function iX($,Z,J){switch($){case"up":return-J;case"down":return J;case"left":return-Z;case"right":return Z;default:return 0}}var rX="--toast-index",ZO="--toast-offset-y",JO="--toast-height",HO="--toast-swipe-movement-x",BO="--toast-swipe-movement-y";var XO="data-swipe-direction",cV0=l4.startingStyle,dV0=l4.endingStyle;var UO=_(d(),1),Ys={...V2,swipeDirection($){return $?{[XO]:$}:null}},zO=40,Fs=10,GO=0.5,Ws=1,qs=`${sj},${tj}`,YO=F5.forwardRef(function(Z,J){let{toast:H,render:B,className:Q,swipeDirection:X=["down","right"],style:z,...G}=Z,K=H.positionerProps?.anchor!==void 0,U=[];if(!K)U=Array.isArray(X)?X:[X];let Y=U.length>0,F=K9(),[W,q]=F5.useState(void 0),[N,A]=F5.useState(!1),[V,D]=F5.useState(!1),[L,j]=F5.useState({x:0,y:0}),[M,P]=F5.useState({x:0,y:0,scale:1}),[w,C]=F5.useState(),[R,O]=F5.useState(),[S,y]=F5.useState(null),k=F5.useRef(null),T=F5.useRef(void 0),b=F5.useRef({x:0,y:0}),I=F5.useRef({x:0,y:0,scale:1}),v=F5.useRef(void 0),h=F5.useRef(0),f=F5.useRef(!1),E=F5.useRef({x:0,y:0}),i=F5.useRef(!1),r=F5.useRef({x:0,y:0}),x=F5.useRef(null),l=F5.useRef(null),o=F.useState("toastIndex",H.id),u=F.useState("toastVisibleIndex",H.id),c=F.useState("toastOffsetY",H.id),n=F.useState("focused"),Z0=F.useState("expanded");T5({open:H.transitionStatus!=="ending",ref:k,onComplete(){if(H.transitionStatus==="ending")F.removeToast(H.id)}});let J0=U0((M0=!1)=>{let V0=k.current;if(!V0)return;let L0=V0.style.height;V0.style.height="auto";let g=V0.offsetHeight;V0.style.height=L0;function m(){F.updateToastInternal(H.id,{ref:k,height:g,transitionStatus:void 0})}if(M0)KO.flushSync(m);else m()});H0(()=>{let M0=T.current;if(H.transitionStatus!=="starting"&&M0===H.id)return;if(M0!==void 0)q(void 0),P({x:0,y:0,scale:1}),X0({x:0,y:0});T.current=H.id,J0()},[J0,H.id,H.transitionStatus]);function X0(M0){r.current=M0,j(M0)}H0(()=>{return()=>{l.current?.abort()}},[]);function Q0(M0,V0){let L0=(t)=>t>0?t**GO:-(Math.abs(t)**GO),g=M0>0&&!U.includes("right")||M0<0&&!U.includes("left"),m=V0>0&&!U.includes("down")||V0<0&&!U.includes("up");return{x:g?L0(M0):M0,y:m?L0(V0):V0}}let F0=U0((M0)=>{if(M0.pointerId!==x.current)return;x.current=null,l.current?.abort(),l.current=null,A(!1),D(!1),y(null);let V0=I.current;if(M0.type==="pointercancel"||f.current){X0({x:V0.x,y:V0.y}),q(void 0);return}let L0=r.current,g=L0.x-V0.x,m=L0.y-V0.y,t;for(let W0 of U)if(iX(W0,g,m)>zO){t=W0;break}if(t)q(t),F.closeToast(H.id);else X0({x:V0.x,y:V0.y}),q(void 0)});function A0(M0){if(M0.button!==0)return;if(M0.pointerType==="touch")F.pauseTimers();if(M1(M0.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${qs}`))return;f.current=!1,v.current=void 0,h.current=0,x.current=M0.pointerId,b.current={x:M0.clientX,y:M0.clientY},E.current=b.current;let g=M0.currentTarget,m=dX(g);I.current=m,P(m),X0({x:m.x,y:m.y}),F.set("hovering",!0),A(!0),D(!1),y(null),i.current=!0,l.current?.abort();let t=new AbortController;l.current=t;let W0=m0(g);W0.addEventListener("pointerup",F0,{signal:t.signal}),W0.addEventListener("pointercancel",F0,{signal:t.signal}),g.setPointerCapture?.(M0.pointerId)}function N0(M0){if(M0.pointerId!==x.current)return;if(M0.preventDefault(),i.current)b.current={x:M0.clientX,y:M0.clientY},i.current=!1;let{clientY:V0,clientX:L0,movementX:g,movementY:m}=M0;if(m<0&&V0>E.current.y||m>0&&V0<E.current.y)E.current={x:E.current.x,y:V0};if(g<0&&L0>E.current.x||g>0&&L0<E.current.x)E.current={x:L0,y:E.current.y};let t=L0-b.current.x,W0=V0-b.current.y,R0=V0-E.current.y,c0=L0-E.current.x,f0=S;if(!V){if(Math.sqrt(t*t+W0*W0)>=Ws){D(!0);let B1=U.includes("left")||U.includes("right"),s1=U.includes("up")||U.includes("down");if(B1&&s1){let C0=Math.abs(t),p0=Math.abs(W0);f0=C0>p0?"horizontal":"vertical",y(f0)}}}let T0;if(!v.current){if(f0==="vertical"){if(W0>0)T0="down";else if(W0<0)T0="up"}else if(f0==="horizontal"){if(t>0)T0="right";else if(t<0)T0="left"}else if(Math.abs(t)>=Math.abs(W0))T0=t>0?"right":"left";else T0=W0>0?"down":"up";if(T0&&U.includes(T0))v.current=T0,h.current=iX(T0,t,W0),q(T0)}else{let w1=v.current,B1=iX(w1,c0,R0);if(B1>zO)f.current=!1,q(w1);else if(!(U.includes("left")&&U.includes("right"))&&!(U.includes("up")&&U.includes("down"))&&h.current-B1>=Fs)f.current=!0}let x0=Q0(t,W0),Z1=I.current.x,W1=I.current.y,d0=U.includes("left")||U.includes("right"),v0=U.includes("up")||U.includes("down");if(f0!=="vertical"&&d0)Z1+=x0.x;if(f0!=="horizontal"&&v0)W1+=x0.y;X0({x:Z1,y:W1})}function Y0(M0){if(M0.key==="Escape"){if(!k.current||!b0(k.current,p1(m0(k.current))))return;F.closeToast(H.id)}}F5.useEffect(()=>{let M0=k.current;if(!Y||!M0)return;function V0(L0){if(x.current===null||!b0(M0,M1(L0)))return;L0.preventDefault()}return o0(M0,"touchmove",V0,{passive:!1})},[Y]);function s(){let M0=L.x-M.x,V0=L.y-M.y;return{transition:N?"none":void 0,transform:N?`translateX(${L.x}px) translateY(${L.y}px) scale(${M.scale})`:void 0,[HO]:`${M0}px`,[BO]:`${V0}px`}}let a=H.priority==="high",e={role:a?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":w,"aria-describedby":R,"aria-hidden":a&&!n?!0:void 0,onPointerDown:Y?A0:void 0,onPointerMove:Y?N0:void 0,onPointerUp:Y?F0:void 0,onPointerCancel:Y?F0:void 0,onKeyDown:Y0,inert:q8(H.limited),style:{...s(),[rX]:H.transitionStatus==="ending"?o:u,[ZO]:`${c}px`,[JO]:H.height?`${H.height}px`:void 0}},$0=F5.useMemo(()=>({toast:H,setTitleId:C,setDescriptionId:O,recalculateHeight:J0,visibleIndex:u,expanded:Z0}),[H,C,O,J0,u,Z0]),B0={transitionStatus:H.transitionStatus,expanded:Z0,limited:H.limited||!1,type:H.type,swiping:N,swipeDirection:W},_0=z0("div",Z,{ref:[J,k],state:B0,stateAttributesMapping:Ys,props:[e,G]});return UO.jsx(sq.Provider,{value:$0,children:_0})});var aX=_(p(),1);var FO=aX.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{visibleIndex:z,expanded:G,recalculateHeight:K}=l3(),U=aX.useRef(null);H0(()=>{K();let W=U.current;if(!W||typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let q=new ResizeObserver(()=>K(!0)),N=new MutationObserver(()=>K(!0));return q.observe(W),N.observe(W,{childList:!0,subtree:!0,characterData:!0}),()=>{q.disconnect(),N.disconnect()}},[K]);let Y=z>0;return z0("div",Z,{ref:[J,U],state:{expanded:G,behind:Y},props:X})});var DO=_(p(),1);var oX=_(p(),1);var WO=0;function Ns($,Z="mui"){let[J,H]=oX.useState($),B=$||J;return oX.useEffect(()=>{if(J==null)WO+=1,H(`${Z}-${WO}`)},[J,Z]),B}var qO=NO.useId;function W4($,Z){if(qO!==void 0){let J=qO();return $??(Z?`${Z}-${J}`:J)}return Ns($,Z)}var VO=_(p(),1);function AO($){if($==null||typeof $==="boolean"||$==="")return!1;if(Array.isArray($))return $.some(AO);return!0}function nX($){return VO.isValidElement($)&&AO($.props.children)}function sX($,Z,J){let{toast:H,setTitleId:B,setDescriptionId:Q}=l3(),X=J==="title"?B:Q,z=Z??(J==="title"?H.title:H.description);return{id:W4($),children:z,type:H.type,setId:X}}function tX($,Z,J){let H=nX($);return H0(()=>{if(!H)return;return J(Z),()=>{J((B)=>B===Z?void 0:B)}},[H,Z,J]),H?$:null}var LO=DO.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,children:z,...G}=Z,{id:K,children:U,type:Y,setId:F}=sX(X,z,"description"),q=z0("p",Z,{ref:J,state:{type:Y},props:{...G,id:K,children:U}});return tX(q,K,F)});var MO=_(p(),1);var PO=MO.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,children:z,...G}=Z,{id:K,children:U,type:Y,setId:F}=sX(X,z,"title"),q=z0("h2",Z,{ref:J,state:{type:Y},props:{...G,id:K,children:U}});return tX(q,K,F)});var eX=_(p(),1);var _O=eX.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X,nativeButton:z=!0,...G}=Z,K=K9(),{toast:U,expanded:Y}=l3(),[F,W]=eX.useState(!1),{getButtonProps:q,buttonRef:N}=O5({disabled:X,native:z}),A={type:U.type};return z0("button",Z,{ref:[J,N],state:A,props:[{"aria-hidden":!Y&&!F,onClick(){K.closeToast(U.id)},onFocus(){W(!0)},onBlur(){W(!1)}},G,q]})});var jO=_(p(),1);var OO=jO.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X,nativeButton:z=!0,...G}=Z,{toast:K}=l3(),U=K.actionProps?.children??G.children,{getButtonProps:Y,buttonRef:F}=O5({disabled:X,native:z}),W={type:K.type},q=z0("button",Z,{ref:[J,F],state:W,props:[G,K.actionProps,Y,{children:U}]});return nX(q)?q:null});var SO=_(p(),1);var Jz=_(p(),1),EO=_(a4(),1);var R5=_(p(),1),eq=_(a4(),1);var K0={};I5(K0,{windowResize:()=>ns,wheel:()=>us,triggerPress:()=>As,triggerHover:()=>Ds,triggerFocus:()=>Ls,trackPress:()=>Cs,swipe:()=>os,siblingOpen:()=>ds,scrub:()=>ps,pointer:()=>fs,outsidePress:()=>Ms,none:()=>Vs,missing:()=>is,listNavigation:()=>vs,linkPress:()=>js,keyboard:()=>gs,itemPress:()=>Ps,inputPress:()=>ks,inputPaste:()=>bs,inputClear:()=>Is,inputChange:()=>Ss,inputBlur:()=>Rs,initial:()=>rs,incrementPress:()=>Es,imperativeAction:()=>as,focusOut:()=>ys,escapeKey:()=>xs,drag:()=>ms,disabled:()=>ls,decrementPress:()=>ws,closeWatcher:()=>hs,closePress:()=>_s,clearPress:()=>Os,chipRemovePress:()=>Ts,cancelOpen:()=>cs});var Vs="none",As="trigger-press",Ds="trigger-hover",Ls="trigger-focus",Ms="outside-press",Ps="item-press",_s="close-press",js="link-press",Os="clear-press",Ts="chip-remove-press",Cs="track-press",Es="increment-press",ws="decrement-press",Ss="input-change",Is="input-clear",Rs="input-blur",bs="input-paste",ks="input-press",ys="focus-out",xs="escape-key",hs="close-watcher",vs="list-navigation",gs="keyboard",fs="pointer",ms="drag",us="wheel",ps="scrub",cs="cancel-open",ds="sibling-open",ls="disabled",is="missing",rs="initial",as="imperative-action",os="swipe",ns="window-resize";function I0($,Z,J,H){let B=!1,Q=!1,X=H??L1;return{reason:$,event:Z??new Event("base-ui"),cancel(){B=!0},allowPropagation(){Q=!0},get isCanceled(){return B},get isPropagationAllowed(){return Q},trigger:J,...X}}function $z($,Z,J){let H=J??L1;return{reason:$,event:Z??new Event("base-ui"),...H}}function U3($){return`data-base-ui-${$}`}var _7=_(d(),1),CO=R5.createContext(null),$N=()=>R5.useContext(CO),ss=U3("portal");function Zz($={}){let{ref:Z,container:J,componentProps:H=L1,elementProps:B}=$,Q=W4(),z=$N()?.portalNode,[G,K]=R5.useState(null),[U,Y]=R5.useState(null),F=U0((A)=>{if(A!==null)Y(A)}),W=R5.useRef(null);H0(()=>{if(J===null){if(W.current)W.current=null,Y(null),K(null);return}let A=(J&&(TO(J)?J:J.current))??z??document.body;if(A==null){if(W.current)W.current=null,Y(null),K(null);return}if(W.current!==A)W.current=A,Y(null),K(A)},[J,z]);let q=z0("div",H,{ref:[Z,F],props:[{id:Q,[ss]:""},B]}),N=G&&q?eq.createPortal(q,G):null;return{node:U,nodeId:R5.isValidElement(q)?q.props.id:void 0,subtree:N}}var j7=R5.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,container:z,portalOwnerRole:G,...K}=Z,{node:U,nodeId:Y,subtree:F}=Zz({container:z,ref:J,componentProps:Z,elementProps:K}),W=R5.useRef(null),q=R5.useRef(null),N=R5.useRef(null),A=R5.useRef(null),[V,D]=R5.useState(null),L=R5.useRef(!1),j=V?.modal,M=V?.open,P=!!V&&!V.modal&&V.open&&!!U;R5.useEffect(()=>{if(!U||j)return;function C(R){if(U&&R.relatedTarget&&G3(R))if(R.type==="focusin"){if(L.current)rq(U),L.current=!1}else uj(U),L.current=!0}return N2(o0(U,"focusin",C,!0),o0(U,"focusout",C,!0))},[U,j]),H0(()=>{if(!U||M!==!0||!L.current)return;rq(U),L.current=!1},[M,U]);let w=R5.useMemo(()=>({beforeOutsideRef:W,afterOutsideRef:q,beforeInsideRef:N,afterInsideRef:A,portalNode:U,setFocusManagerState:D}),[U]);return _7.jsxs(R5.Fragment,{children:[F,_7.jsxs(CO.Provider,{value:w,children:[P&&U&&_7.jsx(R4,{"data-type":"outside",ref:W,onFocus:(C)=>{if(G3(C,U))N.current?.focus();else{let R=V?V.domReference:null;vX(R)?.focus()}}}),P&&U&&_7.jsx("span",{role:G,"aria-owns":Y,style:$O}),U&&eq.createPortal(X,U),P&&U&&_7.jsx(R4,{"data-type":"outside",ref:q,onFocus:(C)=>{if(G3(C,U))A.current?.focus();else{let R=V?V.domReference:null;if(s$(R)?.focus(),V?.closeOnFocusOut)V?.onOpenChange(!1,I0(K0.focusOut,C.nativeEvent))}}})]})]})});var wO=_(d(),1),e$=Jz.forwardRef(function(Z,J){let{children:H,container:B,className:Q,render:X,style:z,...G}=Z,{node:K,subtree:U}=Zz({container:B,ref:J,componentProps:Z,elementProps:G});if(!U&&!K)return null;return wO.jsxs(Jz.Fragment,{children:[U,K&&EO.createPortal(H,K)]})});var IO=_(d(),1),RO=SO.forwardRef(function(Z,J){return IO.jsx(e$,{ref:J,...Z})});var Cz=_(p(),1);var o4=_(p(),1);function G5($){let Z=d1(ts,$).current;return Z.next=$,H0(Z.effect),Z}function ts($){let Z={current:$,next:$,effect:()=>{Z.current=Z.next}};return Z}var q4=_(p(),1);function es($,Z){if(Z!=null&&!r4(Z))return 0;if(typeof $==="function")return $();return $}function h8($,Z,J){let H=es($,J);if(typeof H==="number")return H;return H?.[Z]}function ZN($){if(typeof $==="function")return $();return $}function Hz($,Z){return Z||$==="click"||$==="mousedown"}function bO($){return $?.includes("mouse")&&$!=="mousedown"}var kO=_(d(),1),yO=q4.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new p5,currentIdRef:{current:null},currentContextRef:{current:null}});function $t($,Z){$.current=Z.current}function JN($){let{children:Z,delay:J,timeoutMs:H=0}=$,B=q4.useRef(J),Q=q4.useRef(J),X=q4.useRef(null),z=q4.useRef(null),G=i1();return H0(()=>{if(Q.current=J,!X.current){B.current=J;return}B.current={open:h8(B.current,"open"),close:h8(J,"close")}},[J,X,B,Q]),kO.jsx(yO.Provider,{value:q4.useMemo(()=>({hasProvider:!0,delayRef:B,initialDelayRef:Q,currentIdRef:X,timeoutMs:H,currentContextRef:z,timeout:G}),[H,G]),children:Z})}function HN($,Z={open:!1}){let{open:J}=Z,H="rootStore"in $?$.rootStore:$,B=H.useState("floatingId"),Q=q4.useContext(yO),{currentIdRef:X,delayRef:z,timeoutMs:G,initialDelayRef:K,currentContextRef:U,hasProvider:Y,timeout:F}=Q,[W,q]=q4.useState(!1),N=q4.useRef(J);return H0(()=>{N.current=J},[J]),H0(()=>{function A(){U.current?.setIsInstantPhase(!1),X.current=null,U.current=null,z.current=K.current,F.clear()}if(!X.current)return;if(!J&&X.current===B){if(q(!1),G){let V=B;return F.start(G,()=>{if(H.select("open")||X.current&&X.current!==V)return;A()}),()=>{if(N.current||X.current!==V)F.clear()}}A()}return},[J,B,X,z,G,K,U,F,H]),H0(()=>{if(!J)return;let A=U.current,V=X.current;if(F.clear(),U.current={onOpenChange:H.setOpen,setIsInstantPhase:q},X.current=B,z.current={open:0,close:h8(K.current,"close")},V!==null&&V!==B)q(!0),A?.setIsInstantPhase(!0),A?.onOpenChange(!1,I0(K0.none));else q(!1),A?.setIsInstantPhase(!1)},[J,B,H,X,z,K,U,F]),H0(()=>{return()=>{if(X.current===B){if(U.current=null,!N.current)return;X.current=null,$t(z,K),F.clear()}}},[U,X,z,B,K,F]),q4.useMemo(()=>({activeIdRef:X,hasProvider:Y,delayRef:z,isInstantPhase:W}),[X,Y,z,W])}var r2=_(p(),1);var Bz=0;function $Z($,Z={}){let{preventScroll:J=!1,sync:H=!1,shouldFocus:B}=Z;cancelAnimationFrame(Bz);function Q(){if(B&&!B())return;$?.focus({preventScroll:J})}if(H)return Q(),F1;let X=requestAnimationFrame(Q);return Bz=X,()=>{if(Bz===X)cancelAnimationFrame(X),Bz=0}}var BN={inert:new WeakMap,"aria-hidden":new WeakMap},xO="data-base-ui-inert",XN={inert:new WeakSet,"aria-hidden":new WeakSet},PH=new WeakMap,QN=0;function Zt($){return XN[$]}function fO($){if(!$)return null;return m3($)?$.host:fO($.parentNode)}var hO=($,Z)=>Z.map((J)=>{if($.contains(J))return J;let H=fO(J);if($.contains(H))return H;return null}).filter((J)=>J!=null),vO=($)=>{let Z=new Set;return $.forEach((J)=>{let H=J;while(H&&!Z.has(H))Z.add(H),H=H.parentNode}),Z},gO=($,Z,J)=>{let H=[],B=(Q)=>{if(!Q||J.has(Q))return;Array.from(Q.children).forEach((X)=>{if(A2(X)==="script")return;if(Z.has(X))B(X);else H.push(X)})};return B($),H};function Jt($,Z,J,H,{mark:B=!0}){let Q=null;if(H)Q="inert";else if(J)Q="aria-hidden";let X=null,z=null,G=hO(Z,$),K=B?gO(Z,vO(G),new Set(G)):[],U=[],Y=[];if(Q){let F=BN[Q],W=Zt(Q);z=W,X=F;let q=hO(Z,Array.from(Z.querySelectorAll("[aria-live]"))),N=G.concat(q);gO(Z,vO(N),new Set(N)).forEach((V)=>{let D=V.getAttribute(Q),L=D!==null&&D!=="false",j=(F.get(V)||0)+1;if(F.set(V,j),U.push(V),j===1&&L)W.add(V);if(!L)V.setAttribute(Q,Q==="inert"?"":"true")})}if(B)K.forEach((F)=>{let W=(PH.get(F)||0)+1;if(PH.set(F,W),Y.push(F),W===1)F.setAttribute(xO,"")});return QN+=1,()=>{if(X)U.forEach((F)=>{let q=(X.get(F)||0)-1;if(X.set(F,q),!q){if(!z?.has(F)&&Q)F.removeAttribute(Q);z?.delete(F)}});if(B)Y.forEach((F)=>{let W=(PH.get(F)||0)-1;if(PH.set(F,W),!W)F.removeAttribute(xO)});if(QN-=1,!QN)BN.inert=new WeakMap,BN["aria-hidden"]=new WeakMap,XN.inert=new WeakSet,XN["aria-hidden"]=new WeakSet,PH=new WeakMap}}function zN($,Z={}){let{ariaHidden:J=!1,inert:H=!1,mark:B=!0}=Z,Q=m0($[0]).body;return Jt($,Q,J,H,{mark:B})}var i3=_(p(),1);function Qz(){let $=new Map;return{emit(Z,J){$.get(Z)?.forEach((H)=>H(J))},on(Z,J){if(!$.has(Z))$.set(Z,new Set);$.get(Z).add(J)},off(Z,J){$.get(Z)?.delete(J)}}}class O7{nodesRef={current:[]};events=Qz();addNode($){this.nodesRef.current.push($)}removeNode($){let Z=this.nodesRef.current.findIndex((J)=>J===$);if(Z!==-1)this.nodesRef.current.splice(Z,1)}}var GN=_(d(),1),mO=i3.createContext(null),uO=i3.createContext(null),N4=()=>i3.useContext(mO)?.id||null,i2=($)=>{let Z=i3.useContext(uO);return $??Z};function Y3($){let Z=W4(),J=i2($),H=N4();return H0(()=>{if(!Z)return;let B={id:Z,parentId:H};return J?.addNode(B),()=>{J?.removeNode(B)}},[J,Z,H]),Z}function T7($){let{children:Z,id:J}=$,H=N4();return GN.jsx(mO.Provider,{value:i3.useMemo(()=>({id:J,parentId:H}),[J,H]),children:Z})}function C7($){let{children:Z,externalTree:J}=$,H=d1(()=>J??new O7).current;return GN.jsx(uO.Provider,{value:H,children:Z})}var _H=_(d(),1);function Ht($,Z){let J=I1(M1($));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 pO=20,r3=[];function KN(){r3=r3.filter(($)=>{return $.deref()?.isConnected})}function cO($){if(KN(),$&&A2($)!=="body"){if(r3.push(new WeakRef($)),r3.length>pO)r3=r3.slice(-pO)}}function dO(){return KN(),r3[r3.length-1]?.deref()}function Bt($){if(!$)return null;if(hX($))return $;return n$($)[0]||$}function lO($){if($.hasAttribute("tabindex")&&!$.hasAttribute("data-tabindex"))return;if(!$.getAttribute("role")?.includes("dialog"))return;let J=iq($).filter((B)=>{let Q=B.getAttribute("data-tabindex")||"";return hX(B)||B.hasAttribute("data-tabindex")&&!Q.startsWith("-")}),H=$.getAttribute("tabindex");if(J.length===0){if(H!=="0")$.setAttribute("tabindex","0"),$.setAttribute("data-tabindex","0")}else if(H!=="-1"||$.hasAttribute("data-tabindex")&&$.getAttribute("data-tabindex")!=="-1")$.setAttribute("tabindex","-1"),$.setAttribute("data-tabindex","-1")}function E7($){let{context:Z,children:J,disabled:H=!1,initialFocus:B=!0,returnFocus:Q=!0,restoreFocus:X=!1,modal:z=!0,closeOnFocusOut:G=!0,openInteractionType:K="",nextFocusableElement:U,previousFocusableElement:Y,beforeContentFocusGuardRef:F,externalTree:W,getInsideElements:q}=$,N="rootStore"in Z?Z.rootStore:Z,A=N.useState("open"),V=N.useState("domReferenceElement"),D=N.useState("floatingElement"),{events:L,dataRef:j}=N.context,M=U0(()=>j.current.floatingContext?.nodeId),P=B===!1,w=NH(V)&&P,C=G5(B),R=G5(Q),O=G5(K),S=G5(A),y=i2(W),k=$N(),T=r2.useRef(!1),b=r2.useRef(!1),I=r2.useRef(!1),v=r2.useRef(null),h=r2.useRef(""),f=r2.useRef(""),E=r2.useRef(null),i=r2.useRef(null),r=b2(E,F,k?.beforeInsideRef),x=b2(i,k?.afterInsideRef),l=i1(),o=i1(),u=F4(),c=k!=null,n=VH(D),Z0=U0((Q0=n)=>{return Q0?n$(Q0):[]}),J0=U0(()=>q?.().filter((Q0)=>Q0!=null)??[]);r2.useEffect(()=>{if(H||!z)return;function Q0(A0){if(A0.key==="Tab"){if(b0(n,p1(m0(n)))&&Z0().length===0&&!w)S4(A0)}}let F0=m0(n);return o0(F0,"keydown",Q0)},[H,n,z,w,Z0]),r2.useEffect(()=>{if(H||!A)return;let Q0=m0(n);function F0(){I.current=!1}function A0(Y0){let s=M1(Y0),a=J0(),e=b0(D,s)||b0(V,s)||b0(k?.portalNode,s)||a.some(($0)=>$0===s||b0($0,s));if(I.current=!e,f.current=Y0.pointerType||"keyboard",s?.closest(`[${t$}]`))b.current=!0,o.start(0,()=>{b.current=!1})}function N0(){f.current="keyboard"}return N2(o0(Q0,"pointerdown",A0,!0),o0(Q0,"pointerup",F0,!0),o0(Q0,"pointercancel",F0,!0),o0(Q0,"keydown",N0,!0),F0)},[H,D,V,n,A,k,o,J0]),r2.useEffect(()=>{if(H||!G)return;let Q0=m0(n);function F0(){b.current=!0,o.start(0,()=>{b.current=!1})}function A0(a){let e=M1(a);if(hX(e))v.current=e}function N0(a){let{relatedTarget:e,currentTarget:$0}=a,B0=M1(a);if(z&&e==null&&B0!=null&&b0(D,B0))cO(B0);queueMicrotask(()=>{let _0=M(),M0=N.context.triggerElements,V0=J0(),L0=e?.hasAttribute(U3("focus-guard"))&&[E.current,i.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,x8(Y),x8(U)].includes(e),g=!(b0(V,e)||b0(D,e)||b0(e,D)||b0(k?.portalNode,e)||V0.some((m)=>m===e||b0(m,e))||M0.hasMatchingElement((m)=>b0(m,e))||L0||y&&(U8(y.nodesRef.current,_0).find((m)=>b0(m.context?.elements.floating,e)||b0(m.context?.elements.domReference,e))||cq(y.nodesRef.current,_0).find((m)=>[m.context?.elements.floating,VH(m.context?.elements.floating)].includes(e)||m.context?.elements.domReference===e)));if($0===V&&n)lO(n);if(X&&$0!==V&&!P7(B0)&&p1(Q0)===Q0.body){if(P1(n)){if(n.focus(),X==="popup"){u.request(()=>{n.focus()});return}}let m=Z0(),t=v.current,W0=(t&&m.includes(t)?t:null)||m[m.length-1]||n;if(P1(W0))W0.focus()}if(j.current.insideReactTree){j.current.insideReactTree=!1;return}if((w?!0:!z)&&e&&g&&!b.current&&(w||e!==dO()))T.current=!0,N.setOpen(!1,I0(K0.focusOut,a))})}function Y0(){if(I.current)return;j.current.insideReactTree=!0,l.start(0,()=>{j.current.insideReactTree=!1})}let s=P1(V)?V:null;if(!D&&!s)return;return N2(s&&o0(s,"focusout",N0),s&&o0(s,"pointerdown",F0),D&&o0(D,"focusin",A0),D&&o0(D,"focusout",N0),D&&k&&o0(D,"focusout",Y0,!0))},[H,V,D,n,z,y,k,N,G,X,Z0,w,M,j,l,o,u,U,Y,J0]),r2.useEffect(()=>{if(H||!D||!A)return;let Q0=Array.from(k?.portalNode?.querySelectorAll(`[${U3("portal")}]`)||[]),A0=(y?cq(y.nodesRef.current,M()):[]).find(($0)=>NH($0.context?.elements.domReference||null))?.context?.elements.domReference,Y0=[...[D,...Q0,E.current,i.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...J0()],A0,x8(Y),x8(U),w?V:null].filter(($0)=>$0!=null),s=zN(Y0,{ariaHidden:z||w,mark:!1}),a=[D,...Q0].filter(($0)=>$0!=null),e=zN(a);return()=>{e(),s()}},[A,H,V,D,z,k,w,y,M,U,Y,J0]),H0(()=>{if(!A||H||!P1(n))return;h.current="",f.current="";let Q0=m0(n),F0=p1(Q0);queueMicrotask(()=>{let A0=C.current,N0=typeof A0==="function"?A0(O.current||""):A0;if(N0===void 0||N0===!1)return;if(b0(n,F0))return;let s=null,a=()=>{if(s==null)s=Z0(n);return s[0]||n},e;if(N0===!0||N0===null)e=a();else e=x8(N0);e=e||a();let $0=b0(n,p1(Q0));$Z(e,{preventScroll:e===n,shouldFocus(){if(!S.current)return!1;if($0)return!0;let B0=p1(Q0);return!(B0!==e&&b0(n,B0))}})})},[H,A,n,Z0,C,O,S]),H0(()=>{if(H||!n)return;let Q0=m0(n),F0=p1(Q0),A0=O.current==null;cO(F0);function N0(s){if(!s.open)h.current=Ht(s.nativeEvent,f.current);if(s.reason===K0.triggerHover&&s.nativeEvent.type==="mouseleave")T.current=!0;if(s.reason!==K0.outsidePress)return;if(s.nested)T.current=!1;else if(r$(s.nativeEvent)||a$(s.nativeEvent))T.current=!1;else{let a=!1;if(m0(n).createElement("div").focus({get preventScroll(){return a=!0,!1}}),a)T.current=!1;else T.current=!0}}L.on("openchange",N0);function Y0(s){let a=R.current,e=typeof a==="function"?a(s):a;if(e===void 0||e===!1)return null;if(e===null)e=!0;let $0=V?.isConnected?V:null,B0=F0?.isConnected&&A2(F0)!=="body"?F0:null,_0=A0?B0||$0:$0||B0;if(!_0)_0=dO()||null;if(typeof e==="boolean")return _0;return x8(e)||_0||null}return()=>{L.off("openchange",N0);let s=p1(Q0),a=J0(),e=b0(D,s)||a.some((M0)=>M0===s||b0(M0,s))||y&&U8(y.nodesRef.current,M(),!1).some((M0)=>b0(M0.context?.elements.floating,s)),$0=R.current,B0=h.current,_0=Y0(B0);queueMicrotask(()=>{let M0=Bt(_0),V0=typeof $0!=="boolean";if($0&&!T.current&&P1(M0)&&(!V0&&M0!==s&&s!==Q0.body?e:!0)){let L0={preventScroll:!0};if(B0==="keyboard")L0.focusVisible=!0;M0.focus(L0)}T.current=!1})}},[H,D,n,R,O,L,y,V,M,J0]),H0(()=>{if(!r1.engine.webkit||A||!D)return;let Q0=p1(m0(D));if(!P1(Q0)||!D7(Q0))return;if(b0(D,Q0))Q0.blur()},[A,D]),H0(()=>{if(H||!k)return;return k.setFocusManagerState({modal:z,closeOnFocusOut:G,open:A,onOpenChange:N.setOpen,domReference:V}),()=>{k.setFocusManagerState(null)}},[H,k,z,A,N,G,V]),H0(()=>{if(H||!n)return;return lO(n),()=>{queueMicrotask(KN)}},[H,n]);let X0=!H&&(z?!w:!0)&&(c||z);return _H.jsxs(r2.Fragment,{children:[X0&&_H.jsx(R4,{"data-type":"inside",ref:r,onFocus:(Q0)=>{if(z){let F0=Z0();$Z(F0[F0.length-1])}else if(k?.portalNode)if(T.current=!1,G3(Q0,k.portalNode))s$(V)?.focus();else x8(Y??k.beforeOutsideRef)?.focus()}}),J,X0&&_H.jsx(R4,{"data-type":"inside",ref:x,onFocus:(Q0)=>{if(z)$Z(Z0()[0]);else if(k?.portalNode){if(G)T.current=!0;if(G3(Q0,k.portalNode))vX(V)?.focus();else x8(U??k.afterOutsideRef)?.focus()}}})]})}var jH=_(p(),1);function F3($,Z={}){let{enabled:J=!0,event:H="click",toggle:B=!0,ignoreMouse:Q=!1,stickIfOpen:X=!0,touchOpenDelay:z=0,reason:G=K0.triggerPress}=Z,K="rootStore"in $?$.rootStore:$,U=K.context.dataRef,Y=jH.useRef(void 0),F=F4(),W=i1(),q=jH.useMemo(()=>{function N(V,D,L,j){let M=I0(G,D,L);if(V&&j==="touch"&&z>0)W.start(z,()=>{K.setOpen(!0,M)});else K.setOpen(V,M)}function A(V,D,L){let j=U.current.openEvent,M=K.select("domReferenceElement")!==D;if(V&&M)return!0;if(!V)return!0;if(!B)return!0;if(j&&X)return!L(j.type);return!1}return{onPointerDown(V){Y.current=r4(V.pointerType,!0)&&a$(V.nativeEvent)?"virtual":V.pointerType},onMouseDown(V){let D=Y.current,L=V.nativeEvent,j=K.select("open");if(V.button!==0||H==="click"||r4(D,!0)&&Q)return;let M=A(j,V.currentTarget,(C)=>C==="click"||C==="mousedown"),P=M1(L);if(D7(P)){N(M,L,P,D);return}let w=V.currentTarget;F.request(()=>{N(M,L,w,D)})},onClick(V){if(H==="mousedown-only")return;let D=Y.current;if(H==="mousedown"&&D){Y.current=void 0;return}if(r4(D,!0)&&Q)return;let L=K.select("open"),j=A(L,V.currentTarget,(M)=>M==="click"||M==="mousedown"||M==="keydown"||M==="keyup");N(j,V.nativeEvent,V.currentTarget,D)},onKeyDown(){Y.current=void 0}}},[U,H,Q,G,K,X,B,F,W,z]);return jH.useMemo(()=>J?{reference:q}:L1,[J,q])}var k4=_(p(),1);function Qt($,Z){let J=null,H=null,B=!1;return{contextElement:$||void 0,getBoundingClientRect(){let Q=$?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},X=Z.axis==="x"||Z.axis==="both",z=Z.axis==="y"||Z.axis==="both",G=["mouseenter","mousemove"].includes(Z.dataRef.current.openEvent?.type||"")&&Z.pointerType!=="touch",K=Q.width,U=Q.height,Y=Q.x,F=Q.y;if(J==null&&Z.x&&X)J=Q.x-Z.x;if(H==null&&Z.y&&z)H=Q.y-Z.y;if(Y-=J||0,F-=H||0,K=0,U=0,!B||G)K=Z.axis==="y"?Q.width:0,U=Z.axis==="x"?Q.height:0,Y=X&&Z.x!=null?Z.x:Y,F=z&&Z.y!=null?Z.y:F;else if(B&&!G)U=Z.axis==="x"?Q.height:U,K=Z.axis==="y"?Q.width:K;return B=!0,{width:K,height:U,x:Y,y:F,top:F,right:Y+K,bottom:F+U,left:Y}}}}function iO($){return $!=null&&$.clientX!=null}function UN($,Z={}){let{enabled:J=!0,axis:H="both"}=Z,B="rootStore"in $?$.rootStore:$,Q=B.useState("open"),X=B.useState("floatingElement"),z=B.useState("domReferenceElement"),G=B.context.dataRef,K=k4.useRef(!1),U=k4.useRef(null),[Y,F]=k4.useState(),[W,q]=k4.useState([]),N=U0((j)=>{B.set("positionReference",j)}),A=U0((j,M,P)=>{if(K.current)return;if(G.current.openEvent&&!iO(G.current.openEvent))return;B.set("positionReference",Qt(P??z,{x:j,y:M,axis:H,dataRef:G,pointerType:Y}))}),V=U0((j)=>{if(!Q)A(j.clientX,j.clientY,j.currentTarget);else if(!U.current)A(j.clientX,j.clientY,j.currentTarget),q([])}),D=r4(Y)?X:Q;k4.useEffect(()=>{if(!J){N(z);return}if(!D)return;function j(){U.current?.(),U.current=null}let M=I1(X);function P(w){let C=M1(w);if(!b0(X,C))A(w.clientX,w.clientY);else j()}if(!G.current.openEvent||iO(G.current.openEvent))U.current=o0(M,"mousemove",P);else N(z);return j},[D,J,X,G,z,B,A,N,W]),k4.useEffect(()=>()=>{B.set("positionReference",null)},[B]),k4.useEffect(()=>{if(J&&!X)K.current=!1},[J,X]),k4.useEffect(()=>{if(!J&&Q)K.current=!0},[J,Q]);let L=k4.useMemo(()=>{function j(M){F(M.pointerType)}return{onPointerDown:j,onPointerEnter:j,onMouseMove:V,onMouseEnter:V}},[V]);return k4.useMemo(()=>J?{reference:L,trigger:L}:{},[J,L])}var V4=_(p(),1);function Xt(){return!1}function zt($){return{escapeKey:typeof $==="boolean"?$:$?.escapeKey??!1,outsidePress:typeof $==="boolean"?$:$?.outsidePress??!0}}function v8($,Z={}){let{enabled:J=!0,escapeKey:H=!0,outsidePress:B=!0,outsidePressEvent:Q="sloppy",referencePress:X=Xt,bubbles:z,externalTree:G}=Z,K="rootStore"in $?$.rootStore:$,U=K.useState("open"),Y=K.useState("floatingElement"),{dataRef:F,events:W}=K.context,q=i2(G),N=U0(typeof B==="function"?B:()=>!1),A=typeof B==="function"?N:B,V=A!==!1,D=U0(()=>Q),{escapeKey:L,outsidePress:j}=zt(z),M=V4.useRef(!1),P=V4.useRef(!1),w=V4.useRef(!1),C=V4.useRef(!1),R=V4.useRef(!1),O=V4.useRef(""),S=V4.useRef(null),y=i1(),k=i1(),T=U0(()=>{k.clear(),F.current.insideReactTree=!1}),b=U0((l)=>{let o=F.current.floatingContext?.nodeId;return(q?U8(q.nodesRef.current,o):[]).some((c)=>c.context?.open&&!c.context.dataRef.current[l])}),I=U0((l)=>{return RX(l,K.select("floatingElement"))||RX(l,K.select("domReferenceElement"))}),v=U0((l)=>{if(!X())return;K.setOpen(!1,I0(K0.triggerPress,l.nativeEvent))}),h=U0((l)=>{if(!U||!J||!H||l.key!=="Escape")return;if(R.current)return;if(!L&&b("__escapeKeyBubbles"))return;let o=Oj(l)?l.nativeEvent:l,u=I0(K0.escapeKey,o);if(K.setOpen(!1,u),!u.isCanceled)l.preventDefault();if(!L&&!u.isPropagationAllowed)l.stopPropagation()}),f=U0(()=>{F.current.insideReactTree=!0,k.start(0,T)}),E=U0((l)=>{if(!U||!J||l.button!==0)return;let o=M1(l.nativeEvent);if(!b0(K.select("floatingElement"),o))return;if(!M.current)M.current=!0,P.current=!1}),i=U0((l)=>{if(!U||!J)return;if(!(l.defaultPrevented||l.nativeEvent.defaultPrevented))return;if(M.current)P.current=!0});V4.useEffect(()=>{function l(o){if(!o.open)C.current=!1}return W.on("openchange",l),()=>{W.off("openchange",l)}},[W]),V4.useEffect(()=>{if(!U||!J){if(!U)C.current=!1;return T}F.current.__escapeKeyBubbles=L,F.current.__outsidePressBubbles=j;let l=new p5,o=new p5,u=m0(Y);function c(){l.clear(),R.current=!0}function n(){l.start(r1.engine.webkit?5:0,()=>{R.current=!1})}function Z0(){w.current=!0,o.start(0,()=>{w.current=!1})}function J0(){M.current=!1,P.current=!1}function X0(){let g=O.current,m=g==="pen"||!g?"mouse":g,t=D(),W0=typeof t==="function"?t():t;if(typeof W0==="string")return W0;return W0[m]}function Q0(g){let m=X0();return m==="intentional"&&g.type!=="click"||m==="sloppy"&&g.type==="click"}function F0(g){let m=F.current.floatingContext?.nodeId,t=q&&U8(q.nodesRef.current,m).some((W0)=>RX(g,W0.context?.elements.floating));return I(g)||t}function A0(g){if(Q0(g)){if(g.type!=="click"&&!I(g))o.clear(),w.current=!1;T();return}if(F.current.insideReactTree){T();return}let m=M1(g),t=`[${U3("inert")}]`,W0=n0(m)?m.getRootNode():null,R0=Array.from((m3(W0)?W0:m0(K.select("floatingElement"))).querySelectorAll(t)),c0=K.context.triggerElements;if(m&&(c0.hasElement(m)||c0.hasMatchingElement((T0)=>b0(T0,m))))return;let f0=n0(m)?m:null;while(f0&&!N8(f0)){let T0=V8(f0);if(N8(T0)||!n0(T0))break;f0=T0}if(R0.length&&n0(m)&&!jj(m)&&!b0(m,K.select("floatingElement"))&&R0.every((T0)=>!b0(f0,T0)))return;if(P1(m)&&!("touches"in g)){let T0=N8(m),x0=R2(m),Z1=/auto|scroll/,W1=T0||Z1.test(x0.overflowX),d0=T0||Z1.test(x0.overflowY),v0=W1&&m.clientWidth>0&&m.scrollWidth>m.clientWidth,w1=d0&&m.clientHeight>0&&m.scrollHeight>m.clientHeight,B1=x0.direction==="rtl",s1=w1&&(B1?g.offsetX<=m.offsetWidth-m.clientWidth:g.offsetX>m.clientWidth),C0=v0&&g.offsetY>m.clientHeight;if(s1||C0)return}if(F0(g))return;if(X0()==="intentional"){if(g.detail!==0&&!r$(g)&&!C.current)return;if(w.current){o.clear(),w.current=!1;return}}if(typeof A==="function"&&!A(g))return;if(b("__outsidePressBubbles"))return;K.setOpen(!1,I0(K0.outsidePress,g)),T()}function N0(g){if(X0()!=="sloppy"||g.pointerType==="touch"||!K.select("open")||!J||I(g))return;A0(g)}function Y0(g){if(X0()!=="sloppy"||!K.select("open")||!J||I(g))return;let m=g.touches[0];if(m)S.current={startTime:Date.now(),startX:m.clientX,startY:m.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},y.start(1000,()=>{if(S.current)S.current.dismissOnTouchEnd=!1,S.current.dismissOnMouseDown=!1})}function s(g,m){let t=M1(g);if(!t)return;let W0=o0(t,g.type,()=>{m(g),W0()})}function a(g){O.current="touch",s(g,Y0)}function e(g){if(y.clear(),g.type==="pointerdown"){if(g.button===0)C.current=!0;O.current=g.pointerType}if(g.type==="mousedown"&&S.current&&!S.current.dismissOnMouseDown)return;s(g,(m)=>{if(m.type==="pointerdown")N0(m);else A0(m)})}function $0(g){if(g.type==="pointercancel")C.current=!1;if(!M.current)return;let m=P.current;if(J0(),X0()!=="intentional")return;if(g.type==="pointercancel"){if(m)Z0();return}if(F0(g))return;if(m){Z0();return}if(typeof A==="function"&&!A(g))return;o.clear(),w.current=!0,T()}function B0(g){if(X0()!=="sloppy"||!S.current||I(g))return;let m=g.touches[0];if(!m)return;let t=Math.abs(m.clientX-S.current.startX),W0=Math.abs(m.clientY-S.current.startY),R0=Math.sqrt(t*t+W0*W0);if(R0>5)S.current.dismissOnTouchEnd=!0;if(R0>10)A0(g),y.clear(),S.current=null}function _0(g){s(g,B0)}function M0(g){if(X0()!=="sloppy"||!S.current||I(g))return;if(S.current.dismissOnTouchEnd)A0(g);y.clear(),S.current=null}function V0(g){s(g,M0)}let L0=N2(H&&N2(o0(u,"keydown",h),o0(u,"compositionstart",c),o0(u,"compositionend",n)),V&&N2(o0(u,"click",e,!0),o0(u,"pointerdown",e,!0),o0(u,"pointerup",$0,!0),o0(u,"pointercancel",$0,!0),o0(u,"mousedown",e,!0),o0(u,"mouseup",$0,!0),o0(u,"touchstart",a,{capture:!0,passive:!0}),o0(u,"touchmove",_0,{capture:!0,passive:!0}),o0(u,"touchend",V0,{capture:!0,passive:!0})));return()=>{L0(),l.clear(),o.clear(),J0(),w.current=!1,T()}},[F,Y,H,V,A,U,J,L,j,h,T,D,b,I,q,K,y]);let r=V4.useMemo(()=>({onKeyDown:h,onPointerDown:v,onClick:v}),[h,v]),x=V4.useMemo(()=>({onKeyDown:h,onPointerDown:i,onMouseDown:i,onClickCapture:f,onMouseDownCapture(l){f(),E(l)},onPointerDownCapture(l){f(),E(l)},onMouseUpCapture:f,onTouchEndCapture:f,onTouchMoveCapture:f}),[h,f,E,i]);return V4.useMemo(()=>J?{reference:r,floating:x,trigger:r}:{},[J,r,x])}function Xz($,Z,J,H){return{left:$,top:Z,right:J,bottom:H,x:$,y:Z,width:J-$,height:H-Z}}function Gt($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom,width:$.width,height:$.height}}function aO($){let Z=[],J,H=Number.POSITIVE_INFINITY,B=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,X=Number.NEGATIVE_INFINITY;for(let z of Array.from($).sort((G,K)=>G.top-K.top)){if(H=Math.min(H,z.left),B=Math.min(B,z.top),Q=Math.max(Q,z.right),X=Math.max(X,z.bottom),!J||z.top-J.top>J.height/2)Z.push(Gt(z));else{let G=Z[Z.length-1];G.left=Math.min(G.left,z.left),G.right=Math.max(G.right,z.right),G.bottom=Math.max(G.bottom,z.bottom),G.width=G.right-G.left,G.height=G.bottom-G.top}J=z}return{lines:Z,fallback:Xz(H,B,Q,X)}}function oO($,Z,J){return $.findIndex((H)=>Z>H.left-2&&Z<H.right+2&&J>H.top-2&&J<H.bottom+2)}function rO($){return Xz($.left,$.top,$.right,$.bottom)}function Kt($,Z,J){let{lines:H}=aO($.getClientRects());if(H.length<2)return;let B=oO(H,Z,J);return{x:Z,y:J,lineIndex:B===-1?void 0:B,element:$}}function Ut($,Z,J){let{lines:H,fallback:B}=aO($.getClientRects());if(H.length<2)return null;let Q=J?.x,X=J?.y,z=Z[0];if(J?.lineIndex!=null&&H[J.lineIndex])return rO(H[J.lineIndex]);if(Q!=null&&X!=null){let q=oO(H,Q,X);if(q!==-1)return rO(H[q])}if(H.length===2&&H[0].left>H[1].right&&Q!=null&&X!=null)return B;if(z==="t"||z==="b"){let q=H[0],N=H[H.length-1],A=z==="t"?q:N;return Xz(A.left,q.top,A.right,N.bottom)}let G=z==="l",K=H[0].left,U=H[0].right,Y=G?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,F=H[0],W=H[0];for(let q of H){K=Math.min(K,q.left),U=Math.max(U,q.right);let N=G?q.left:q.right;if(G&&N<Y||!G&&N>Y)Y=N,F=q,W=q;else if(N===Y)W=q}return Xz(K,F.top,U,W.bottom)}function Yt($){if("contextElement"in $&&$.contextElement)return $.contextElement;return n0($)?$:void 0}function nO($,Z){function J(B){YN($,B.currentTarget,B.clientX,B.clientY)}function H(B){if(!Z)J(B)}return{onFocus(){$.current=void 0},onMouseEnter:H,onMouseMove:H}}function YN($,Z,J,H){let B=Kt(Z,J,H);return $.current=B,B}function sO($){return{name:"inline",async fn(Z){let J=Z.elements.reference;if(typeof J?.getClientRects!=="function")return{};let H=Yt(J),B=$.current,Q=B?.element===J||B?.element===H?B:void 0,X=Ut(J,Z.placement,Q);if(!X||typeof Z.platform.getElementRects!=="function")return{};let z=await Z.platform.getElementRects({reference:{contextElement:H,getBoundingClientRect(){return X}},floating:Z.elements.floating,strategy:Z.strategy});if(Z.rects.reference.x===z.reference.x&&Z.rects.reference.y===z.reference.y&&Z.rects.reference.width===z.reference.width&&Z.rects.reference.height===z.reference.height)return{};return{reset:{rects:z}}}}}class g8{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor($,Z,J=!0){this.fallbackStore=$,this.componentName=Z,this.throwOnMissingTrigger=J}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore($){return this.storeListeners.add($),()=>{this.storeListeners.delete($)}}attachStore($){return this.attachedStores.push($),this.setActiveStore($),()=>{let Z=this.attachedStores.lastIndexOf($);if(Z!==-1)this.attachedStores.splice(Z,1);this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore($){if(this.attachedStoreValue!==$)this.attachedStoreValue=$,this.storeListeners.forEach((Z)=>{Z()})}openByTrigger($){let Z=this.attachedStore;if(Z===null)return;let J;if($){for(let H=this.attachedStores.length-1;H>=0&&!J;H-=1)J=this.attachedStores[H].context.triggerElements.getById($);J??=this.fallbackStore.context.triggerElements.getById($)}if($&&!J){if(this.throwOnMissingTrigger)throw Error(h0(99,this.componentName,$,this.componentName))}Z.setOpen(!0,I0(K0.imperativeAction,void 0,J))}closePopup(){let $=this.attachedStore;if($===null)return;$.setOpen(!1,I0(K0.imperativeAction))}}var WN=_(p(),1),$T=_(a4(),1);var tO=_(p(),1);var Ft={open:($)=>$.open,transitionStatus:($)=>$.transitionStatus,domReferenceElement:($)=>$.domReferenceElement,referenceElement:($)=>$.positionReference??$.referenceElement,floatingElement:($)=>$.floatingElement,floatingId:($)=>$.floatingId};class w7 extends S2{constructor($){let{syncOnly:Z,nested:J,onOpenChange:H,triggerElements:B,...Q}=$;super({...Q,positionReference:Q.referenceElement,domReferenceElement:Q.referenceElement},{onOpenChange:H,dataRef:{current:{}},events:Qz(),nested:J,triggerElements:B},Ft);this.syncOnly=Z}syncOpenEvent=($,Z)=>{if(!$||!this.state.open||Z!=null&&Tj(Z))this.context.dataRef.current.openEvent=$?Z:void 0};dispatchOpenChange=($,Z)=>{this.syncOpenEvent($,Z.event);let J={open:$,reason:Z.reason,nativeEvent:Z.event,nested:this.context.nested,triggerElement:Z.trigger};this.context.events.emit("openchange",J)};setOpen=($,Z)=>{if(this.syncOnly){this.context.onOpenChange?.($,Z);return}this.dispatchOpenChange($,Z),this.context.onOpenChange?.($,Z)}}function OH($){let{popupStore:Z,treatPopupAsFloatingElement:J=!1,floatingRootContext:H,floatingId:B,nested:Q,onOpenChange:X}=$,z=Z.useState("open"),G=Z.useState("activeTriggerElement"),K=Z.useState(J?"popupElement":"positionerElement"),U=Z.context.triggerElements,Y=X,F=tO.useRef(null);if(H===void 0&&F.current===null)F.current=new w7({open:z,transitionStatus:void 0,referenceElement:G,floatingElement:K,triggerElements:U,onOpenChange:Y,floatingId:B,syncOnly:!0,nested:Q});let W=H??F.current;return Z.useSyncedValue("floatingId",B),H0(()=>{let q={open:z,floatingId:B,referenceElement:G,floatingElement:K};if(n0(G))q.domReferenceElement=G;if(W.state.positionReference===W.state.referenceElement)q.positionReference=G;W.update(q)},[z,B,G,K,W]),W.context.onOpenChange=Y,W.context.nested=Q,W}var FN=_(p(),1);function a2($,Z=!1,J=!1,H=!1){let[B,Q]=FN.useState($&&Z?"idle":void 0),[X,z]=FN.useState($&&!H);if($&&!X)z(!0),Q("starting");if(!$&&X&&B!=="ending"&&!J)Q("ending");if(!$&&!X&&B==="ending")Q(void 0);return H0(()=>{if(!$&&X&&B!=="ending"&&J){let G=I2.request(()=>{Q("ending")});return()=>{I2.cancel(G)}}return},[$,X,B,J]),H0(()=>{if(!$||Z)return;let G=I2.request(()=>{Q(void 0)});return()=>{I2.cancel(G)}},[Z,$]),H0(()=>{if(!$||!Z)return;if($&&X&&B!=="idle")Q("starting");let G=I2.request(()=>{Q("idle")});return()=>{I2.cancel(G)}},[Z,$,X,B]),{mounted:X,setMounted:z,transitionStatus:B}}var V9={tabIndex:-1,[KH]:""};function zz($){return(Z)=>Z==="touch"?$.current:!0}function a3($,Z=!1){let J=W4(),H=N4()!=null,B=d1(()=>$(J,H)).current;return OH({popupStore:B,treatPopupAsFloatingElement:Z,floatingRootContext:B.state.floatingRootContext,floatingId:J,nested:H,onOpenChange:B.setOpen}),B}function A9({handle:$,store:Z}){return H0(()=>{return $.attachStore(Z)},[$,Z]),null}function eO($){let Z=$.context.triggerElements.size;if($.select("open")&&$.state.triggerCount!==Z)$.set("triggerCount",Z)}function qN($,Z){let J=WN.useRef(null);return U0((H)=>{let B=J.current;if(B!==null){if(B.element===H&&B.store===Z&&B.id===$)return;J.current=null;let Q=B.store;if(Q.context.triggerElements.getById(B.id)===B.element)Q.context.triggerElements.delete(B.id),eO(Q)}if(H!==null&&$!==void 0)J.current={store:Z,id:$,element:H},Z.context.triggerElements.add($,H),eO(Z)})}function S7($,Z,J,H=!1){let B=$.preventUnmountingOnClose;if(Z)B=!1;else if(H)B=!0;let Q=J?.id??null,X=$.activeTriggerId,z=$.activeTriggerElement;if(Q||Z)X=Q,z=J??null;return{open:Z,preventUnmountingOnClose:B,activeTriggerId:X,activeTriggerElement:z}}function TH($){let Z=!1;return $.preventUnmountOnClose=()=>{Z=!0},()=>Z}function Gz($,Z,J,H={}){let B=J.reason,Q=B===K0.triggerHover,X=Z&&B===K0.triggerFocus,z=!Z&&(B===K0.triggerPress||B===K0.escapeKey),G=TH(J);if($.context.onOpenChange?.(Z,J),J.isCanceled)return;H.onBeforeDispatch?.(),$.state.floatingRootContext.dispatchOpenChange(Z,J);let K=()=>{let U=S7($.state,Z,J.trigger,G()),Y={...H.extraState,...U};if(X)Y.instantType="focus";else if(z)Y.instantType="dismiss";else if(Q)Y.instantType=void 0;$.update(Y)};if(Q)$T.flushSync(K);else K()}function D9($,Z,J,H){let B=J.useState("isMountedByTrigger",$),Q=qN($,J),X=U0((G)=>{let K=J.select("open"),U=J.select("activeTriggerId");if(U===$){let Y={activeTriggerElement:G,...K?H:null};J.update(Y);return}if(U==null&&K){let Y={activeTriggerId:$??null,activeTriggerElement:G,...H};J.update(Y)}}),z=U0((G)=>{if(Q(G),G)X(G)});return H0(()=>{return z(Z.current),()=>z(null)},[z,Z,J,$]),H0(()=>{if(B){let G={activeTriggerElement:Z.current,...H};J.update(G)}},[B,J,Z,...Object.values(H)]),{registerTrigger:z,isMountedByThisTrigger:B}}function L9($,Z={}){let{closeOnActiveTriggerUnmount:J=!1}=Z,H=WN.useRef(null),B=$.useState("open"),Q=$.useState("triggerCount"),X=$.useState("activeTriggerId"),z=$.useState("activeTriggerElement");H0(()=>{if(!B){if(H.current=null,$.state.triggerCount!==0)$.set("triggerCount",0);return}let G=$.context.triggerElements.size,K={};if($.state.triggerCount!==G)K.triggerCount=G;let U=$.select("activeTriggerId"),Y=null;if(U){let F=$.context.triggerElements.getById(U);if(!F){for(let[W,q]of $.context.triggerElements.entries())if(q===$.state.activeTriggerElement){K.activeTriggerId=W,K.activeTriggerElement=q,H.current=W;break}if(K.activeTriggerId===void 0)if(H.current===U)Y=U;else H.current=null}else if(H.current=U,F!==$.state.activeTriggerElement)K.activeTriggerElement=F}else H.current=null;if(!Y&&!U&&G===1){let F=$.context.triggerElements.entries().next();if(!F.done){let[W,q]=F.value;K.activeTriggerId=W,K.activeTriggerElement=q,H.current=W}}if(K.triggerCount!==void 0||K.activeTriggerId!==void 0||K.activeTriggerElement!==void 0)$.update(K);if(Y){if(J)queueMicrotask(()=>{if($.select("open")&&$.select("activeTriggerId")===Y&&!$.context.triggerElements.getById(Y)){let F=I0(K0.none);if($.setOpen(!1,F),!F.isCanceled)$.update({activeTriggerId:null,activeTriggerElement:null})}})}},[B,$,Q,X,z,J])}function M9($,Z,J,H){let{mounted:B,setMounted:Q,transitionStatus:X}=a2($,!1,!1,H),z=Z.useState("preventUnmountingOnClose"),G=$?!1:z;Z.useSyncedValues({mounted:B,transitionStatus:X,preventUnmountingOnClose:G});let K=U0(()=>{Q(!1),Z.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),J?.(),Z.context.onOpenChangeComplete?.(!1)});return T5({enabled:B&&!$&&!G,open:$,ref:Z.context.popupRef,onComplete(){if(!$)K()}}),{forceUnmount:K,transitionStatus:X}}function P9($,Z){$.useSyncedValues(Z),H0(()=>()=>{$.update({activeTriggerProps:L1,inactiveTriggerProps:L1,popupProps:L1})},[$])}function Kz($,Z){H0(()=>{if(!Z&&$.state.openMethod!==null)$.set("openMethod",null)},[Z,$]),H0(()=>()=>{if($.state.openMethod!==null)$.set("openMethod",null)},[$])}class L2{constructor(){this.idMap=new Map}add($,Z){this.idMap.set($,Z)}delete($){this.idMap.delete($)}hasElement($){for(let Z of this.idMap.values())if(Z===$)return!0;return!1}hasMatchingElement($){for(let Z of this.idMap.values())if($(Z))return!0;return!1}getById($){return this.idMap.get($)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function _9($,Z,J=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new w7({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:$,floatingId:Z,syncOnly:!0,nested:J,onOpenChange:void 0}),floatingId:Z,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:L1,inactiveTriggerProps:L1,popupProps:L1}}var CH=($)=>$.triggerIdProp??$.activeTriggerId,NN=($)=>$.openProp??$.open,ZT=($)=>{return($.popupElement?.id??$.floatingId)||void 0};function JT($,Z){return Z!==void 0&&NN($)&&CH($)===Z}function Wt($,Z){if(JT($,Z))return!0;return Z!==void 0&&NN($)&&CH($)==null&&$.triggerCount===1}var j9={open:NN,mounted:($)=>$.mounted,transitionStatus:($)=>$.transitionStatus,floatingRootContext:($)=>$.floatingRootContext,triggerCount:($)=>$.triggerCount,preventUnmountingOnClose:($)=>$.preventUnmountingOnClose,payload:($)=>$.payload,activeTriggerId:CH,activeTriggerElement:($)=>$.mounted?$.activeTriggerElement:null,popupId:ZT,isTriggerActive:($,Z)=>Z!==void 0&&CH($)===Z,isOpenedByTrigger:($,Z)=>JT($,Z),isMountedByTrigger:($,Z)=>Z!==void 0&&CH($)===Z&&$.mounted,triggerProps:($,Z)=>Z?$.activeTriggerProps:$.inactiveTriggerProps,triggerPopupId:($,Z)=>Wt($,Z)?ZT($):void 0,popupProps:($)=>$.popupProps,popupElement:($)=>$.popupElement,positionerElement:($)=>$.positionerElement};var VN=_(p(),1),HT=_(i$(),1);function O9($){let Z=VN.useCallback((H)=>{if($===void 0)return F1;return $.subscribeStore(H)},[$]),J=VN.useCallback(()=>{return $===void 0?void 0:$.store},[$]);return HT.useSyncExternalStore(Z,J,()=>$?.serverStore)}function AN($){let{open:Z=!1,onOpenChange:J,elements:H={}}=$,B=W4(),Q=N4()!=null,X=d1(()=>new w7({open:Z,transitionStatus:void 0,onOpenChange:J,referenceElement:H.reference??null,floatingElement:H.floating??null,triggerElements:new L2,floatingId:B,syncOnly:!1,nested:Q})).current;return H0(()=>{let z={open:Z,floatingId:B};if(H.reference!==void 0)z.referenceElement=H.reference,z.domReferenceElement=n0(H.reference)?H.reference:null;if(H.floating!==void 0)z.floatingElement=H.floating;X.update(z)},[Z,B,H.reference,H.floating,X]),X.context.onOpenChange=J,X.context.nested=Q,X}var T9=_(p(),1);var DN=r1.os.mac&&r1.engine.webkit;function I7($,Z={}){let{enabled:J=!0,delay:H}=Z,B="rootStore"in $?$.rootStore:$,{events:Q,dataRef:X}=B.context,z=T9.useRef(!1),G=T9.useRef(null),K=T9.useRef(!0),U=i1();T9.useEffect(()=>{let F=B.select("domReferenceElement");if(!J)return;let W=I1(F);function q(){let V=B.select("domReferenceElement");if(!B.select("open")&&P1(V)&&V===p1(m0(V)))z.current=!0,G.current=V}function N(){K.current=!0}function A(){K.current=!1}return N2(o0(W,"blur",q),DN&&o0(W,"keydown",N,!0),DN&&o0(W,"pointerdown",A,!0))},[B,J]),T9.useEffect(()=>{if(!J)return;function F(W){if(W.reason===K0.triggerPress||W.reason===K0.escapeKey){let q=B.select("domReferenceElement");if(n0(q))G.current=q,z.current=!0}}return Q.on("openchange",F),()=>{Q.off("openchange",F)}},[Q,J,B]);let Y=T9.useMemo(()=>{function F(){z.current=!1,G.current=null}return{onMouseLeave(){F()},onFocus(W){let q=W.currentTarget;if(z.current){if(G.current===q)return;F()}let N=M1(W.nativeEvent);if(n0(N)){if(DN&&!W.relatedTarget){if(!K.current&&!D7(N))return}else if(!F9(N))return}let A=u3(W.relatedTarget,B.context.triggerElements),{nativeEvent:V,currentTarget:D}=W,L=typeof H==="function"?H():H;if(B.select("open")&&A||L===0||L===void 0){B.setOpen(!0,I0(K0.triggerFocus,V,D));return}U.start(L,()=>{if(z.current)return;B.setOpen(!0,I0(K0.triggerFocus,V,D))})},onBlur(W){F();let{relatedTarget:q,nativeEvent:N}=W,A=n0(q)&&q.hasAttribute(U3("focus-guard"))&&q.getAttribute("data-type")==="outside";U.start(0,()=>{let V=B.select("domReferenceElement"),D=p1(m0(V));if(!q&&D===V)return;if(b0(X.current.floatingContext?.refs.floating.current,D)||b0(V,D)||A)return;if(u3(q??D,B.context.triggerElements))return;B.setOpen(!1,I0(K0.triggerFocus,N))})}}},[X,H,B,U]);return T9.useMemo(()=>J?{reference:Y,trigger:Y}:{},[J,Y])}var MN=_(p(),1);class LN{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new p5,this.restTimeout=new p5,this.handleCloseOptions=void 0}static create(){return new LN}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>{return this.dispose}}var Uz=new WeakMap;function ZZ($){if(!$.performedPointerEventsMutation)return;let Z=$.pointerEventsScopeElement;if(Z&&Uz.get(Z)===$)$.pointerEventsScopeElement?.style.removeProperty("pointer-events"),$.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),$.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Uz.delete(Z);$.performedPointerEventsMutation=!1,$.pointerEventsScopeElement=null,$.pointerEventsReferenceElement=null,$.pointerEventsFloatingElement=null}function Yz($,Z){let{scopeElement:J,referenceElement:H,floatingElement:B}=Z,Q=Uz.get(J);if(Q&&Q!==$)ZZ(Q);ZZ($),$.performedPointerEventsMutation=!0,$.pointerEventsScopeElement=J,$.pointerEventsReferenceElement=H,$.pointerEventsFloatingElement=B,Uz.set(J,$),J.style.pointerEvents="none",H.style.pointerEvents="auto",B.style.pointerEvents="auto"}function JZ($){let Z=$.context.dataRef.current,J=d1(()=>Z.hoverInteractionState??LN.create()).current;if(!Z.hoverInteractionState)Z.hoverInteractionState=J;return g3(Z.hoverInteractionState.disposeEffect),Z.hoverInteractionState}function W3($,Z={}){let{enabled:J=!0,closeDelay:H=0,nodeId:B}=Z,Q="rootStore"in $?$.rootStore:$,X=Q.useState("open"),z=Q.useState("floatingElement"),G=Q.useState("domReferenceElement"),{dataRef:K}=Q.context,U=i2(),Y=N4(),F=JZ(Q),W=i1(),q=U0(()=>{return Hz(K.current.openEvent?.type,F.interactedInside)}),N=U0(()=>{return bO(K.current.openEvent?.type)}),A=U0(()=>{ZZ(F)});H0(()=>{if(!X)F.pointerType=void 0,F.restTimeoutPending=!1,F.interactedInside=!1,A()},[X,F,A]),MN.useEffect(()=>{return A},[A]),H0(()=>{if(!J)return;if(X&&F.handleCloseOptions?.blockPointerEvents&&N()&&n0(G)&&z){let V=G,D=z,L=m0(z),j=U?.nodesRef.current.find((C)=>C.id===Y)?.context?.elements.floating;if(j)j.style.pointerEvents="";let M=F.pointerEventsScopeElement!==D?F.pointerEventsScopeElement:null,P=j!==D?j:null,w=F.handleCloseOptions?.getScope?.()??M??P??V.closest("[data-rootownerid]")??L.body;return Yz(F,{scopeElement:w,referenceElement:V,floatingElement:D}),()=>{A()}}return},[J,X,G,z,F,N,U,Y,A]),MN.useEffect(()=>{if(!J)return;function V(){return!!(U&&Y&&U8(U.nodesRef.current,Y).length>0)}function D(C){let R=h8(H,"close",F.pointerType),O=()=>{Q.setOpen(!1,I0(K0.triggerHover,C)),U?.events.emit("floating.closed",C)};if(R)F.openChangeTimeout.start(R,O);else F.openChangeTimeout.clear(),O()}function L(C){let R=M1(C);if(!pq(R)){F.interactedInside=!1;return}F.interactedInside=R?.closest("[aria-haspopup]")!=null}function j(){F.openChangeTimeout.clear(),W.clear(),U?.events.off("floating.closed",P),A()}function M(C){if(V()&&U){U.events.on("floating.closed",P);return}if(u3(C.relatedTarget,Q.context.triggerElements))return;let R=K.current.floatingContext?.nodeId??B,O=C.relatedTarget;if(U&&R&&n0(O)&&U8(U.nodesRef.current,R,!1).some((y)=>b0(y.context?.elements.floating,O)))return;if(F.handler){F.handler(C);return}if(A(),N()&&!q())D(C)}function P(C){if(!U||!Y||V())return;W.start(0,()=>{U.events.off("floating.closed",P),Q.setOpen(!1,I0(K0.triggerHover,C)),U.events.emit("floating.closed",C)})}let w=z;return N2(w&&o0(w,"mouseenter",j),w&&o0(w,"mouseleave",M),w&&o0(w,"pointerdown",L,!0),()=>{U?.events.off("floating.closed",P)})},[J,z,Q,K,H,B,N,q,A,F,U,Y,W])}var o3=_(p(),1),BT=_(a4(),1);var qt={current:null};function f8($,Z={}){let{enabled:J=!0,delay:H=0,handleClose:B=null,mouseOnly:Q=!1,restMs:X=0,move:z=!0,triggerElementRef:G=qt,externalTree:K,isActiveTrigger:U=!0,getHandleCloseContext:Y,isClosing:F,shouldOpen:W,guardStaleOpen:q=!1}=Z,N="rootStore"in $?$.rootStore:$,{dataRef:A,events:V}=N.context,D=i2(K),L=JZ(N),j=o3.useRef(!1),M=G5(B),P=G5(H),w=G5(X),C=G5(J),R=G5(W),O=G5(F),S=U0(()=>{return Hz(A.current.openEvent?.type,L.interactedInside)}),y=U0(()=>{return R.current?.()!==!1}),k=U0((I,v,h)=>{let f=N.context.triggerElements;if(f.hasElement(v))return!I||!b0(I,v);if(!n0(h))return!1;let E=h;return f.hasMatchingElement((i)=>b0(i,E))&&(!I||!b0(I,E))}),T=U0(()=>{if(!L.handler)return;m0(N.select("domReferenceElement")).removeEventListener("mousemove",L.handler),L.handler=void 0}),b=U0(()=>{ZZ(L)});if(U)L.handleCloseOptions=B?.__options;return o3.useEffect(()=>T,[T]),o3.useEffect(()=>{if(!J)return;function I(v){if(!v.open)j.current=v.reason===K0.triggerHover,T(),L.openChangeTimeout.clear(),L.restTimeout.clear(),L.blockMouseMove=!0,L.restTimeoutPending=!1;else j.current=!1}return V.on("openchange",I),()=>{V.off("openchange",I)}},[J,V,L,T]),o3.useEffect(()=>{if(!J)return;function I(r,x=!0){let l=h8(P.current,"close",L.pointerType);if(l)L.openChangeTimeout.start(l,()=>{N.setOpen(!1,I0(K0.triggerHover,r)),D?.events.emit("floating.closed",r)});else if(x)L.openChangeTimeout.clear(),N.setOpen(!1,I0(K0.triggerHover,r)),D?.events.emit("floating.closed",r)}let v=G.current??(U?N.select("domReferenceElement"):null);if(!n0(v))return;function h(r){if(L.openChangeTimeout.clear(),L.blockMouseMove=!1,Q&&!r4(L.pointerType))return;let x=ZN(w.current),l=h8(P.current,"open",L.pointerType),o=M1(r),u=r.currentTarget??null,c=N.select("domReferenceElement"),n=u;if(n0(o)&&!N.context.triggerElements.hasElement(o)){for(let s of N.context.triggerElements.elements())if(b0(s,o)){n=s;break}}if(n0(u)&&n0(c)&&!N.context.triggerElements.hasElement(u)&&b0(u,c))n=c;let Z0=n==null?!1:k(c,n,o),J0=N.select("open"),X0=O.current?.()??N.select("transitionStatus")==="ending",Q0=!J0&&X0&&j.current,F0=!Z0&&n0(n)&&n0(c)&&b0(c,n)&&Q0,A0=x>0&&!l,N0=Z0&&(J0||Q0)||F0,Y0=!J0||Z0;if(N0){if(y())N.setOpen(!0,I0(K0.triggerHover,r,n));return}if(A0)return;if(l)L.openChangeTimeout.start(l,()=>{if(Y0&&y())N.setOpen(!0,I0(K0.triggerHover,r,n))});else if(Y0){if(y())N.setOpen(!0,I0(K0.triggerHover,r,n))}}function f(r){if(S()){b();return}T();let x=N.select("domReferenceElement"),l=m0(x);L.restTimeout.clear(),L.restTimeoutPending=!1;let o=A.current.floatingContext??Y?.();if(u3(r.relatedTarget,N.context.triggerElements))return;if(M.current&&o){if(!N.select("open"))L.openChangeTimeout.clear();let c=G.current;L.handler=M.current({...o,tree:D,x:r.clientX,y:r.clientY,onClose(){if(b(),T(),C.current&&!S()&&c===N.select("domReferenceElement"))I(r,!0)}}),l.addEventListener("mousemove",L.handler),L.handler(r);return}if(L.pointerType==="touch"?!b0(N.select("floatingElement"),r.relatedTarget):!0)I(r)}function E(r){if(b0(v,r.relatedTarget))return;L.openChangeTimeout.clear(),L.restTimeout.clear(),L.restTimeoutPending=!1}let i=q?o0(v,"mouseout",E):void 0;if(z)return N2(o0(v,"mousemove",h,{once:!0}),o0(v,"mouseenter",h),o0(v,"mouseleave",f),i);return N2(o0(v,"mouseenter",h),o0(v,"mouseleave",f),i)},[T,b,A,P,N,J,M,L,U,k,S,Q,z,w,G,D,C,Y,O,y,q]),o3.useMemo(()=>{if(!J)return;function I(v){L.pointerType=v.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(v){let{nativeEvent:h}=v,f=v.currentTarget,E=N.select("domReferenceElement"),i=N.select("open"),r=k(E,f,v.target);if(Q&&!r4(L.pointerType))return;if(i&&r&&L.handleCloseOptions?.blockPointerEvents){let o=N.select("floatingElement");if(o){let u=L.handleCloseOptions?.getScope?.()??f.ownerDocument.body;Yz(L,{scopeElement:u,referenceElement:f,floatingElement:o})}}let x=ZN(w.current);if(i&&!r||x===0)return;if(!r&&L.restTimeoutPending&&v.movementX**2+v.movementY**2<2)return;L.restTimeout.clear();function l(){if(L.restTimeoutPending=!1,S())return;let o=N.select("open");if(!L.blockMouseMove&&(!o||r)&&y())N.setOpen(!0,I0(K0.triggerHover,h,f))}if(L.pointerType==="touch")BT.flushSync(()=>{l()});else if(r&&i)l();else L.restTimeoutPending=!0,L.restTimeout.start(x,l)}}},[J,L,S,k,Q,N,w,y])}var k2=_(p(),1);var Nt="Escape";function QT($){return r1.engine.webkit&&$.movementX===0&&$.movementY===0}function Wz($,Z,J){switch($){case"vertical":return Z;case"horizontal":return J;default:return Z||J}}function Fz($,Z){return Wz(Z,$===vq||$===wX,$===UH||$===YH)}function PN($,Z,J){return Wz(Z,$===wX,J?$===UH:$===YH)||$==="Enter"||$===" "||$===""}function Vt($,Z,J){return Wz(Z,J?$===UH:$===YH,$===wX)}function At($,Z,J,H){let B=J?$===YH:$===UH,Q=$===vq;if(Z==="both"||Z==="horizontal"&&H)return $===Nt;return Wz(Z,B,Q)}function _N($,Z){let{listRef:J,activeIndex:H,onNavigate:B=()=>{},enabled:Q=!0,selectedIndex:X=null,allowEscape:z=!1,loopFocus:G=!1,nested:K=!1,rtl:U=!1,virtual:Y=!1,focusItemOnOpen:F="auto",focusItemOnHover:W=!0,openOnArrowKeyDown:q=!0,disabledIndices:N=void 0,orientation:A="vertical",parentOrientation:V,id:D,resetOnPointerLeave:L=!0,externalTree:j,grid:M}=Z,P=M!=null,w="rootStore"in $?$.rootStore:$,C=w.useState("open"),R=w.useState("floatingElement"),O=w.useState("domReferenceElement"),S=w.context.dataRef,y=VH(R),k=NH(O),T=G5(y),b=N4(),I=i2(j),v=k2.useRef(F),h=k2.useRef(X??-1),f=k2.useRef(null),E=k2.useRef(!0),i=U0((V0)=>{B(h.current===-1?null:h.current,V0)}),r=k2.useRef(!!R),x=k2.useRef(C),l=k2.useRef(!1),o=k2.useRef(!1),u=k2.useRef(null),c=G5(N),n=G5(C),Z0=G5(X),J0=G5(L),X0=F4(),Q0=F4(),F0=U0(()=>{function V0(t){if(Y)I?.events.emit("virtualfocus",t);else u.current=$Z(t,{sync:l.current,preventScroll:!0})}let L0=J.current[h.current],g=o.current;if(L0)V0(L0);(l.current?(t)=>t():(t)=>X0.request(t))(()=>{let t=J.current[h.current]||L0;if(!t)return;if(!L0)V0(t);if(e&&(g||!E.current))t.scrollIntoView?.({block:"nearest",inline:"nearest"})})});H0(()=>{S.current.orientation=A},[S,A]),H0(()=>{if(!Q)return;if(C&&R){if(h.current=X??-1,v.current&&X!=null)o.current=!0,i()}else if(r.current)h.current=-1,i()},[Q,C,R,X,i]),H0(()=>{if(!Q)return;if(!C){l.current=!1;return}if(!R)return;if(H==null){if(l.current=!1,Z0.current!=null)return;if(r.current)h.current=-1,F0();if((!x.current||!r.current)&&v.current&&(f.current!=null||v.current===!0&&f.current==null)){let V0=0,L0=()=>{if(J.current[0]==null){if(V0<2)(V0?(m)=>Q0.request(m):queueMicrotask)(L0);V0+=1}else h.current=f.current==null||PN(f.current,A,U)||K?M7(J):o$(J),f.current=null,i()};L0()}}else if(!d3(J.current,H))h.current=H,F0(),o.current=!1},[Q,C,R,H,Z0,K,J,A,U,i,F0,Q0]),H0(()=>{if(!Q||R||!I||Y||!r.current)return;let V0=I.nodesRef.current,L0=V0.find((t)=>t.id===b)?.context?.elements.floating,g=p1(m0(O??L0??null)),m=V0.some((t)=>t.context&&b0(t.context.elements.floating,g));if(L0&&!m&&E.current)L0.focus({preventScroll:!0})},[Q,R,O,I,b,Y]),H0(()=>{x.current=C,r.current=!!R}),H0(()=>{if(!C)f.current=null,v.current=F},[C,F]);let A0=H!=null,N0=U0((V0)=>{if(!n.current)return;let L0=J.current.indexOf(V0.currentTarget);if(L0!==-1&&(h.current!==L0||H!==L0))h.current=L0,i(V0)}),Y0=U0(()=>{return V??I?.nodesRef.current.find((V0)=>V0.id===b)?.context?.dataRef?.current.orientation}),s=U0(()=>{return M7(J,c.current)}),a=U0((V0)=>{if(E.current=!1,l.current=!0,V0.which===229)return;if(!n.current&&V0.currentTarget===T.current)return;if(K&&At(V0.key,A,U,P)){if(!Fz(V0.key,Y0()))S4(V0);if(w.setOpen(!1,I0(K0.listNavigation,V0.nativeEvent)),P1(O))if(Y)I?.events.emit("virtualfocus",O);else O.focus();return}let L0=h.current,g=M7(J,N),m=o$(J,N);if(!k){if(V0.key==="Home")S4(V0),h.current=g,i(V0);if(V0.key==="End")S4(V0),h.current=m,i(V0)}if(M!=null){let t=M(V0,h.current,J,A,G,U,N,g,m);if(t!=null)h.current=t,i(V0);if(A==="both")return}if(Fz(V0.key,A)){if(S4(V0),C&&!Y&&p1(V0.currentTarget.ownerDocument)===V0.currentTarget){h.current=PN(V0.key,A,U)?g:m,i(V0);return}if(PN(V0.key,A,U))if(G)if(L0>=m)if(z&&L0!==J.current.length)h.current=-1;else l.current=!1,h.current=g;else h.current=F8(J.current,{startingIndex:L0,disabledIndices:N});else h.current=Math.min(m,F8(J.current,{startingIndex:L0,disabledIndices:N}));else if(G)if(L0<=g)if(z&&L0!==-1)h.current=J.current.length;else l.current=!1,h.current=m;else h.current=F8(J.current,{startingIndex:L0,decrement:!0,disabledIndices:N});else h.current=Math.max(g,F8(J.current,{startingIndex:L0,decrement:!0,disabledIndices:N}));if(d3(J.current,h.current))h.current=-1;i(V0)}}),e=k2.useMemo(()=>{return{onFocus(L0){l.current=!0,N0(L0)},onClick:({currentTarget:L0})=>L0.focus({preventScroll:!0}),onMouseMove(L0){if(QT(L0))return;if(l.current=!0,o.current=!1,W)N0(L0)},onPointerLeave(L0){if(!n.current||!E.current||L0.pointerType==="touch")return;l.current=!0;let g=L0.relatedTarget;if(!W||J.current.includes(g))return;if(!J0.current)return;if(u.current?.(),u.current=null,h.current=-1,i(L0),!Y){let m=T.current,t=p1(m0(m));if(m&&b0(m,t))m.focus({preventScroll:!0})}}}},[N0,n,T,W,J,i,J0,Y]),$0=k2.useMemo(()=>{return Y&&C&&A0&&{"aria-activedescendant":`${D}-${H}`}},[Y,C,A0,D,H]),B0=k2.useMemo(()=>{return{...!k?$0:{},onKeyDown(V0){if(V0.key==="Tab"&&V0.shiftKey&&C&&!Y){let L0=M1(V0.nativeEvent);if(L0&&!b0(T.current,L0))return;if(S4(V0),w.setOpen(!1,I0(K0.focusOut,V0.nativeEvent)),P1(O))O.focus();return}a(V0)},onPointerMove(V0){if(QT(V0))return;E.current=!0}}},[$0,a,T,k,w,C,Y,O]),_0=k2.useMemo(()=>{function V0(m){w.setOpen(!0,I0(K0.listNavigation,m.nativeEvent,m.currentTarget))}function L0(m){if(F==="auto"&&r$(m.nativeEvent))v.current=!Y}function g(m){if(v.current=F,F==="auto"&&a$(m.nativeEvent))v.current=!0}return{onKeyDown(m){let t=w.select("open");E.current=!1;let W0=m.key.startsWith("Arrow"),R0=Vt(m.key,Y0(),U),c0=Fz(m.key,A),f0=(K?R0:c0)||m.key==="Enter"||m.key.trim()==="";if(Y&&t)return a(m);if(!t&&!q&&W0)return;if(f0){let T0=Fz(m.key,Y0());f.current=K&&T0?null:m.key}if(K){if(R0)if(S4(m),t)h.current=s(),i(m);else V0(m);return}if(c0){if(Z0.current!=null)h.current=Z0.current;if(S4(m),!t&&q)V0(m);else a(m);if(t)i(m)}return},onFocus(m){if(w.select("open")&&!Y)h.current=-1,i(m)},onPointerDown:g,onPointerEnter:g,onMouseDown:L0,onClick:L0}},[a,F,s,K,i,w,q,A,Y0,U,Z0,Y]),M0=k2.useMemo(()=>{return{...$0,..._0}},[$0,_0]);return k2.useMemo(()=>Q?{reference:M0,floating:B0,item:e,trigger:_0}:{},[Q,M0,B0,_0,e])}var R7=_(p(),1);function jN($,Z){let{listRef:J,elementsRef:H,activeIndex:B,onMatch:Q,disabledIndices:X,onTyping:z,enabled:G=!0,resetMs:K=750,selectedIndex:U=null}=Z,Y="rootStore"in $?$.rootStore:$,F=Y.useState("open"),W=i1(),q=R7.useRef(""),N=R7.useRef(U??B??-1),A=R7.useRef(null),V=U0((j)=>{function M(T){return H?.current[T]}function P(T){let b=M(T);if(b&&!P7(b)||b?.matches(":disabled"))return!1;return X==null||!z3(c2,T,X)}function w(T,b,I=0){if(T.length===0)return-1;let v=(I%T.length+T.length)%T.length,h=b.toLowerCase();for(let f=0;f<T.length;f+=1){let E=(v+f)%T.length;if(!T[E]?.toLowerCase().startsWith(h)||!P(E))continue;return E}return-1}let C=J.current;if(q.current.length>0&&j.key===" ")S4(j),z?.(!0);if(q.current.length>0&&q.current[0]!==" "){if(w(C,q.current)===-1&&j.key!==" ")z?.(!1)}if(C==null||j.key.length!==1||j.ctrlKey||j.metaKey||j.altKey)return;if(F&&j.key!==" ")S4(j),z?.(!0);let R=q.current==="";if(R)N.current=U??B??-1;if(C.every((T,b)=>T&&P(b)?T[0]?.toLowerCase()!==T[1]?.toLowerCase():!0)&&q.current===j.key)q.current="",N.current=A.current;q.current+=j.key,W.start(K,()=>{q.current="",N.current=A.current,z?.(!1)});let y=((R?U??B??-1:N.current)??0)+1,k=w(C,q.current,y);if(k!==-1)Q?.(k),A.current=k;else if(j.key!==" ")q.current="",z?.(!1)}),D=U0((j)=>{let M=j.relatedTarget,P=Y.select("domReferenceElement"),w=Y.select("floatingElement");if(b0(P,M)||b0(w,M))return;W.clear(),q.current="",N.current=A.current,z?.(!1)});H0(()=>{if(!F&&U!==null)return;if(W.clear(),A.current=null,q.current!=="")q.current=""},[F,U,W]);let L=R7.useMemo(()=>({onKeyDown:V,onBlur:D}),[V,D]);return R7.useMemo(()=>G?{reference:L,floating:L}:{},[G,L])}var XT=0.1,Dt=XT*XT,W5=0.5;function qz($,Z,J,H,B,Q){return H>=Z!==Q>=Z&&$<=(B-J)*(Z-H)/(Q-H)+J}function Nz($,Z,J,H,B,Q,X,z,G,K){let U=!1;if(qz($,Z,J,H,B,Q))U=!U;if(qz($,Z,B,Q,X,z))U=!U;if(qz($,Z,X,z,G,K))U=!U;if(qz($,Z,G,K,J,H))U=!U;return U}function Lt($,Z,J){return $>=J.x&&$<=J.x+J.width&&Z>=J.y&&Z<=J.y+J.height}function Vz($,Z,J,H,B,Q){let X=Math.min(J,B),z=Math.max(J,B),G=Math.min(H,Q),K=Math.max(H,Q);return $>=X&&$<=z&&Z>=G&&Z<=K}function m8($={}){let{blockPointerEvents:Z=!1}=$,J=new p5,H=({x:B,y:Q,placement:X,elements:z,onClose:G,nodeId:K,tree:U})=>{let Y=X?.split("-")[0],F=!1,W=null,q=null,N=typeof performance<"u"?performance.now():0;function A(D,L){let j=performance.now(),M=j-N;if(W===null||q===null||M===0)return W=D,q=L,N=j,!1;let P=D-W,w=L-q,C=P*P+w*w,R=M*M*Dt;return W=D,q=L,N=j,C<R}function V(){J.clear(),G()}return function(L){J.clear();let{domReference:j,floating:M}=z;if(!j||!M||Y==null||B==null||Q==null)return;let{clientX:P,clientY:w}=L,C=M1(L),R=L.type==="mouseleave",O=b0(M,C),S=b0(j,C);if(O){if(F=!0,!R)return}if(S){if(F=!1,!R){F=!0;return}}if(R&&n0(L.relatedTarget)&&b0(M,L.relatedTarget))return;function y(){return Boolean(U&&U8(U.nodesRef.current,K).length>0)}function k(){if(!y())V()}if(y())return;let T=j.getBoundingClientRect(),b=M.getBoundingClientRect(),I=B>b.right-b.width/2,v=Q>b.bottom-b.height/2,h=b.width>T.width,f=b.height>T.height,E=(h?T:b).left,i=(h?T:b).right,r=(f?T:b).top,x=(f?T:b).bottom;if(Y==="top"&&Q>=T.bottom-1||Y==="bottom"&&Q<=T.top+1||Y==="left"&&B>=T.right-1||Y==="right"&&B<=T.left+1){k();return}let l=!1;switch(Y){case"top":l=Vz(P,w,E,T.top+1,i,b.bottom-1);break;case"bottom":l=Vz(P,w,E,b.top+1,i,T.bottom-1);break;case"left":l=Vz(P,w,b.right-1,x,T.left+1,r);break;case"right":l=Vz(P,w,T.right-1,x,b.left+1,r);break;default:}if(l)return;if(F&&!Lt(P,w,T)){k();return}if(!R&&A(P,w)){k();return}let o=!1;switch(Y){case"top":{let u=h?W5/2:W5*4,c=h?B+u:I?B+u:B-u,n=h?B-u:I?B+u:B-u,Z0=Q+W5+1,J0=I?b.bottom-W5:h?b.bottom-W5:b.top,X0=I?h?b.bottom-W5:b.top:b.bottom-W5;o=Nz(P,w,c,Z0,n,Z0,b.left,J0,b.right,X0);break}case"bottom":{let u=h?W5/2:W5*4,c=h?B+u:I?B+u:B-u,n=h?B-u:I?B+u:B-u,Z0=Q-W5,J0=I?b.top+W5:h?b.top+W5:b.bottom,X0=I?h?b.top+W5:b.bottom:b.top+W5;o=Nz(P,w,c,Z0,n,Z0,b.left,J0,b.right,X0);break}case"left":{let u=f?W5/2:W5*4,c=f?Q+u:v?Q+u:Q-u,n=f?Q-u:v?Q+u:Q-u,Z0=B+W5+1,J0=v?b.right-W5:f?b.right-W5:b.left,X0=v?f?b.right-W5:b.left:b.right-W5;o=Nz(P,w,J0,b.top,X0,b.bottom,Z0,c,Z0,n);break}case"right":{let u=f?W5/2:W5*4,c=f?Q+u:v?Q+u:Q-u,n=f?Q-u:v?Q+u:Q-u,Z0=B-W5,J0=v?b.left+W5:f?b.left+W5:b.right,X0=v?f?b.left+W5:b.right:b.left+W5;o=Nz(P,w,Z0,c,Z0,n,J0,b.top,X0,b.bottom);break}default:}if(!o)k();else if(!F)J.start(40,k);return}};return H.__options={...$,blockPointerEvents:Z},H}function zT($,Z,J){let{reference:H,floating:B}=$,Q=I4(Z),X=MH(Z),z=LH(X),G=l2(Z),K=Q==="y",U=H.x+H.width/2-B.width/2,Y=H.y+H.height/2-B.height/2,F=H[z]/2-B[z]/2,W;switch(G){case"top":W={x:U,y:H.y-B.height};break;case"bottom":W={x:U,y:H.y+H.height};break;case"right":W={x:H.x+H.width,y:Y};break;case"left":W={x:H.x-B.width,y:Y};break;default:W={x:H.x,y:H.y}}let q=Y8(Z);if(q)W[X]+=F*(q==="end"?1:-1)*(J&&K?-1:1);return W}async function GT($,Z){var J;if(Z===void 0)Z={};let{x:H,y:B,platform:Q,rects:X,elements:z,strategy:G}=$,{boundary:K="clippingAncestors",rootBoundary:U="viewport",elementContext:Y="floating",altBoundary:F=!1,padding:W=0}=q9(Z,$),q=xX(W),A=z[F?Y==="floating"?"reference":"floating":Y],V=L7(await Q.getClippingRect({element:((J=await(Q.isElement==null?void 0:Q.isElement(A)))!=null?J:!0)?A:A.contextElement||await(Q.getDocumentElement==null?void 0:Q.getDocumentElement(z.floating)),boundary:K,rootBoundary:U,strategy:G})),D=Y==="floating"?{x:H,y:B,width:X.floating.width,height:X.floating.height}:X.reference,L=await(Q.getOffsetParent==null?void 0:Q.getOffsetParent(z.floating)),j=await(Q.isElement==null?void 0:Q.isElement(L))&&await(Q.getScale==null?void 0:Q.getScale(L))||{x:1,y:1},M=L7(Q.convertOffsetParentRelativeRectToViewportRelativeRect?await Q.convertOffsetParentRelativeRectToViewportRelativeRect({elements:z,rect:D,offsetParent:L,strategy:G}):D);return{top:(V.top-M.top+q.top)/j.y,bottom:(M.bottom-V.bottom+q.bottom)/j.y,left:(V.left-M.left+q.left)/j.x,right:(M.right-V.right+q.right)/j.x}}var Mt=50,KT=async($,Z,J)=>{let{placement:H="bottom",strategy:B="absolute",middleware:Q=[],platform:X}=J,z=X.detectOverflow?X:{...X,detectOverflow:GT},G=await(X.isRTL==null?void 0:X.isRTL(Z)),K=await X.getElementRects({reference:$,floating:Z,strategy:B}),{x:U,y:Y}=zT(K,H,G),F=H,W=0,q={};for(let N=0;N<Q.length;N++){let A=Q[N];if(!A)continue;let{name:V,fn:D}=A,{x:L,y:j,data:M,reset:P}=await D({x:U,y:Y,initialPlacement:H,placement:F,strategy:B,middlewareData:q,rects:K,platform:z,elements:{reference:$,floating:Z}});if(U=L!=null?L:U,Y=j!=null?j:Y,q[V]={...q[V],...M},P&&W<Mt){if(W++,typeof P==="object"){if(P.placement)F=P.placement;if(P.rects)K=P.rects===!0?await X.getElementRects({reference:$,floating:Z,strategy:B}):P.rects;({x:U,y:Y}=zT(K,F,G))}N=-1}}return{x:U,y:Y,placement:F,strategy:B,middlewareData:q}};var UT=function($){if($===void 0)$={};return{name:"flip",options:$,async fn(Z){var J,H;let{placement:B,middlewareData:Q,rects:X,initialPlacement:z,platform:G,elements:K}=Z,{mainAxis:U=!0,crossAxis:Y=!0,fallbackPlacements:F,fallbackStrategy:W="bestFit",fallbackAxisSideDirection:q="none",flipAlignment:N=!0,...A}=q9($,Z);if((J=Q.arrow)!=null&&J.alignmentOffset)return{};let V=l2(B),D=I4(z),L=l2(z)===z,j=await(G.isRTL==null?void 0:G.isRTL(K.floating)),M=F||(L||!N?[AH(z)]:Sj(z)),P=q!=="none";if(!F&&P)M.push(...Ij(z,N,q,j));let w=[z,...M],C=await G.detectOverflow(Z,A),R=[],O=((H=Q.flip)==null?void 0:H.overflows)||[];if(U)R.push(C[V]);if(Y){let T=wj(B,X,j);R.push(C[T[0]],C[T[1]])}if(O=[...O,{placement:B,overflows:R}],!R.every((T)=>T<=0)){var S,y;let T=(((S=Q.flip)==null?void 0:S.index)||0)+1,b=w[T];if(b){if(!(Y==="alignment"?D!==I4(b):!1)||O.every((h)=>I4(h.placement)===D?h.overflows[0]>0:!0))return{data:{index:T,overflows:O},reset:{placement:b}}}let I=(y=O.filter((v)=>v.overflows[0]<=0).sort((v,h)=>v.overflows[1]-h.overflows[1])[0])==null?void 0:y.placement;if(!I)switch(W){case"bestFit":{var k;let v=(k=O.filter((h)=>{if(P){let f=I4(h.placement);return f===D||f==="y"}return!0}).map((h)=>[h.placement,h.overflows.filter((f)=>f>0).reduce((f,E)=>f+E,0)]).sort((h,f)=>h[1]-f[1])[0])==null?void 0:k[0];if(v)I=v;break}case"initialPlacement":I=z;break}if(B!==I)return{reset:{placement:I}}}return{}}}};var YT=new Set(["left","top"]);async function Pt($,Z){let{placement:J,platform:H,elements:B}=$,Q=await(H.isRTL==null?void 0:H.isRTL(B.floating)),X=l2(J),z=Y8(J),G=I4(J)==="y",K=YT.has(X)?-1:1,U=Q&&G?-1:1,Y=q9(Z,$),{mainAxis:F,crossAxis:W,alignmentAxis:q}=typeof Y==="number"?{mainAxis:Y,crossAxis:0,alignmentAxis:null}:{mainAxis:Y.mainAxis||0,crossAxis:Y.crossAxis||0,alignmentAxis:Y.alignmentAxis};if(z&&typeof q==="number")W=z==="end"?q*-1:q;return G?{x:W*U,y:F*K}:{x:F*K,y:W*U}}var FT=function($){if($===void 0)$=0;return{name:"offset",options:$,async fn(Z){var J,H;let{x:B,y:Q,placement:X,middlewareData:z}=Z,G=await Pt(Z,$);if(X===((J=z.offset)==null?void 0:J.placement)&&(H=z.arrow)!=null&&H.alignmentOffset)return{};return{x:B+G.x,y:Q+G.y,data:{...G,placement:X}}}}},WT=function($){if($===void 0)$={};return{name:"shift",options:$,async fn(Z){let{x:J,y:H,placement:B,platform:Q}=Z,{mainAxis:X=!0,crossAxis:z=!1,limiter:G={fn:(D)=>{let{x:L,y:j}=D;return{x:L,y:j}}},...K}=q9($,Z),U={x:J,y:H},Y=await Q.detectOverflow(Z,K),F=I4(B),W=yX(F),q=U[W],N=U[F],A=(D,L)=>kX(L+Y[D==="y"?"top":"left"],L,L-Y[D==="y"?"bottom":"right"]);if(X)q=A(W,q);if(z)N=A(F,N);let V=G.fn({...Z,[W]:q,[F]:N});return{...V,data:{x:V.x-J,y:V.y-H,enabled:{[W]:X,[F]:z}}}}}},qT=function($){if($===void 0)$={};return{options:$,fn(Z){var J,H;let{x:B,y:Q,placement:X,rects:z,middlewareData:G}=Z,{offset:K=0,mainAxis:U=!0,crossAxis:Y=!0}=q9($,Z),F={x:B,y:Q},W=I4(X),q=yX(W),N=F[q],A=F[W],V=q9(K,Z),D=typeof V==="number"?{mainAxis:V,crossAxis:0}:{mainAxis:(J=V.mainAxis)!=null?J:0,crossAxis:(H=V.crossAxis)!=null?H:0};if(U){let M=q==="y"?"height":"width",P=z.reference[q]-z.floating[M]+D.mainAxis,w=z.reference[q]+z.reference[M]-D.mainAxis;if(N<P)N=P;else if(N>w)N=w}if(Y){var L,j;let M=q==="y"?"width":"height",P=YT.has(l2(X)),w=z.reference[W]-z.floating[M]+(P?((L=G.offset)==null?void 0:L[W])||0:0)+(P?0:D.crossAxis),C=z.reference[W]+z.reference[M]+(P?0:((j=G.offset)==null?void 0:j[W])||0)-(P?D.crossAxis:0);if(A<w)A=w;else if(A>C)A=C}return{[q]:N,[W]:A}}}},NT=function($){if($===void 0)$={};return{name:"size",options:$,async fn(Z){let{placement:J,rects:H,platform:B,elements:Q}=Z,{apply:X=()=>{},...z}=q9($,Z),G=await B.detectOverflow(Z,z),K=l2(J),U=Y8(J),Y=I4(J)==="y",{width:F,height:W}=H.floating,q,N;if(K==="top"||K==="bottom")q=K,N=U===(await(B.isRTL==null?void 0:B.isRTL(Q.floating))?"start":"end")?"left":"right";else N=K,q=U==="end"?"top":"bottom";let A=W-G.top-G.bottom,V=F-G.left-G.right,D=p3(W-G[q],A),L=p3(F-G[N],V),j=Z.middlewareData.shift,M=!j,P=D,w=L;if(j!=null&&j.enabled.x)w=V;if(j!=null&&j.enabled.y)P=A;if(M&&!U)if(Y)w=F-2*b8(G.left,G.right);else P=W-2*b8(G.top,G.bottom);await X({...Z,availableWidth:w,availableHeight:P});let C=await B.getDimensions(Q.floating);if(F!==C.width||W!==C.height)return{reset:{rects:!0}};return{}}}};function MT($){let Z=R2($),J=parseFloat(Z.width)||0,H=parseFloat(Z.height)||0,B=P1($),Q=B?$.offsetWidth:J,X=B?$.offsetHeight:H,z=c3(J)!==Q||c3(H)!==X;if(z)J=Q,H=X;return{width:J,height:H,$:z}}function wN($){return!n0($)?$.contextElement:$}function HZ($){let Z=wN($);if(!P1(Z))return W9(1);let J=Z.getBoundingClientRect(),{width:H,height:B,$:Q}=MT(Z),X=(Q?c3(J.width):J.width)/H,z=(Q?c3(J.height):J.height)/B;if(!X||!Number.isFinite(X))X=1;if(!z||!Number.isFinite(z))z=1;return{x:X,y:z}}var _t=W9(0);function PT($){let Z=I1($);if(!EN()||!Z.visualViewport)return _t;return{x:Z.visualViewport.offsetLeft,y:Z.visualViewport.offsetTop}}function jt($,Z,J){if(Z===void 0)Z=!1;return!!J&&Z&&J===I1($)}function b7($,Z,J,H){if(Z===void 0)Z=!1;if(J===void 0)J=!1;let B=$.getBoundingClientRect(),Q=wN($),X=W9(1);if(Z)if(H){if(n0(H))X=HZ(H)}else X=HZ($);let z=jt(Q,J,H)?PT(Q):W9(0),G=(B.left+z.x)/X.x,K=(B.top+z.y)/X.y,U=B.width/X.x,Y=B.height/X.y;if(Q&&H){let F=I1(Q),W=n0(H)?I1(H):H,q=F,N=TN(q);while(N&&W!==q){let A=HZ(N),V=N.getBoundingClientRect(),D=R2(N),L=V.left+(N.clientLeft+parseFloat(D.paddingLeft))*A.x,j=V.top+(N.clientTop+parseFloat(D.paddingTop))*A.y;G*=A.x,K*=A.y,U*=A.x,Y*=A.y,G+=L,K+=j,q=I1(N),N=TN(q)}}return L7({width:U,height:Y,x:G,y:K})}function Dz($,Z){let J=wH($).scrollLeft;if(!Z)return b7(q3($)).left+J;return Z.left+J}function _T($,Z){let J=$.getBoundingClientRect(),H=J.left+Z.scrollLeft-Dz($,J),B=J.top+Z.scrollTop;return{x:H,y:B}}function Ot($){let{elements:Z,rect:J,offsetParent:H,strategy:B}=$,Q=B==="fixed",X=q3(H),z=Z?Az(Z.floating):!1;if(H===X||z&&Q)return J;let G={scrollLeft:0,scrollTop:0},K=W9(1),U=W9(0),Y=P1(H);if(Y||!Q){if(A2(H)!=="body"||EH(X))G=wH(H);if(Y){let W=b7(H);K=HZ(H),U.x=W.x+H.clientLeft,U.y=W.y+H.clientTop}}let F=X&&!Y&&!Q?_T(X,G):W9(0);return{width:J.width*K.x,height:J.height*K.y,x:J.x*K.x-G.scrollLeft*K.x+U.x+F.x,y:J.y*K.y-G.scrollTop*K.y+U.y+F.y}}function Tt($){return $.getClientRects?Array.from($.getClientRects()):[]}function Ct($){let Z=wH($),J=$.ownerDocument.body,H=b8($.scrollWidth,$.clientWidth,J.scrollWidth,J.clientWidth),B=b8($.scrollHeight,$.clientHeight,J.scrollHeight,J.clientHeight),Q=-Z.scrollLeft+Dz($),X=-Z.scrollTop;if(R2(J).direction==="rtl")Q+=b8($.clientWidth,J.clientWidth)-H;return{width:H,height:B,x:Q,y:X}}var Et=25;function wt($,Z,J){if(J===void 0)J="viewport";let H=J==="layoutViewport",B=I1($),Q=q3($),X=B.visualViewport,z=Q.clientWidth,G=Q.clientHeight,K=0,U=0;if(X){let F=!EN()||Z==="fixed";if(H){if(!F)K=-X.offsetLeft,U=-X.offsetTop}else if(z=X.width,G=X.height,F)K=X.offsetLeft,U=X.offsetTop}if(Dz(Q)<=0){let F=Q.ownerDocument,W=F.body,q=getComputedStyle(W),N=F.compatMode==="CSS1Compat"?parseFloat(q.marginLeft)+parseFloat(q.marginRight)||0:0,A=Math.abs(Q.clientWidth-W.clientWidth-N),V=getComputedStyle(Q).scrollbarGutter==="stable both-edges"?A/2:A;if(V<=Et)z-=V}return{width:z,height:G,x:K,y:U}}function St($,Z){let J=b7($,!0,Z==="fixed"),H=J.top+$.clientTop,B=J.left+$.clientLeft,Q=HZ($),X=$.clientWidth*Q.x,z=$.clientHeight*Q.y,G=B*Q.x,K=H*Q.y;return{width:X,height:z,x:G,y:K}}function VT($,Z,J){let H;if(Z==="viewport"||Z==="layoutViewport")H=wt($,J,Z);else if(Z==="document")H=Ct(q3($));else if(n0(Z))H=St(Z,J);else{let B=PT($);H={x:Z.x-B.x,y:Z.y-B.y,width:Z.width,height:Z.height}}return L7(H)}function It($,Z){let J=Z.get($);if(J)return J;let H=BZ($,[],!1).filter((z)=>n0(z)&&A2(z)!=="body"),B=null,Q=R2($).position==="fixed",X=Q?V8($):$;while(n0(X)&&!N8(X)){let z=R2(X),G=CN(X),K=B?B.position:Q?"fixed":"";if(!G&&(K==="fixed"||K==="absolute"&&z.position==="static"))H=H.filter((Y)=>Y!==X);else B=z;X=V8(X)}return Z.set($,H),H}function Rt($){let{element:Z,boundary:J,rootBoundary:H,strategy:B}=$,X=[...J==="clippingAncestors"?Az(Z)?[]:It(Z,this._c):[].concat(J),H],z=VT(Z,X[0],B),G=z.top,K=z.right,U=z.bottom,Y=z.left;for(let F=1;F<X.length;F++){let W=VT(Z,X[F],B);G=b8(W.top,G),K=p3(W.right,K),U=p3(W.bottom,U),Y=b8(W.left,Y)}return{width:K-Y,height:U-G,x:Y,y:G}}function bt($){let{width:Z,height:J}=MT($);return{width:Z,height:J}}function kt($,Z,J){let H=P1(Z),B=q3(Z),Q=J==="fixed",X=b7($,!0,Q,Z),z={scrollLeft:0,scrollTop:0},G=W9(0);if(H||!Q){if(A2(Z)!=="body"||EH(B))z=wH(Z);if(H){let F=b7(Z,!0,Q,Z);G.x=F.x+Z.clientLeft,G.y=F.y+Z.clientTop}}if(!H&&B)G.x=Dz(B);let K=B&&!H&&!Q?_T(B,z):W9(0),U=X.left+z.scrollLeft-G.x-K.x,Y=X.top+z.scrollTop-G.y-K.y;return{x:U,y:Y,width:X.width,height:X.height}}function ON($){return R2($).position==="static"}function AT($,Z){if(!P1($)||R2($).position==="fixed")return null;if(Z)return Z($);let J=$.offsetParent;if(q3($)===J)J=J.ownerDocument.body;return J}function jT($,Z){let J=I1($);if(Az($))return J;if(!P1($)){let B=V8($);while(B&&!N8(B)){if(n0(B)&&!ON(B))return B;B=V8(B)}return J}let H=AT($,Z);while(H&&DT(H)&&ON(H))H=AT(H,Z);if(H&&N8(H)&&ON(H)&&!CN(H))return J;return H||LT($)||J}var yt=async function($){let Z=this.getOffsetParent||jT,J=this.getDimensions,H=await J($.floating);return{reference:kt($.reference,await Z($.floating),$.strategy),floating:{x:0,y:0,width:H.width,height:H.height}}};function xt($){return R2($).direction==="rtl"}var SN={convertOffsetParentRelativeRectToViewportRelativeRect:Ot,getDocumentElement:q3,getClippingRect:Rt,getOffsetParent:jT,getElementRects:yt,getClientRects:Tt,getDimensions:bt,getScale:HZ,isElement:n0,isRTL:xt};function OT($,Z){return $.x===Z.x&&$.y===Z.y&&$.width===Z.width&&$.height===Z.height}function ht($,Z,J){let H=null,B,Q=q3($);function X(){var U;clearTimeout(B),(U=H)==null||U.disconnect(),H=null}function z(U,Y){if(U===void 0)U=!1;if(Y===void 0)Y=1;X();let F=$.getBoundingClientRect(),{left:W,top:q,width:N,height:A}=F;if(!U)Z();if(!N||!A)return;let V=DH(q),D=DH(Q.clientWidth-(W+N)),L=DH(Q.clientHeight-(q+A)),j=DH(W),P={rootMargin:-V+"px "+-D+"px "+-L+"px "+-j+"px",threshold:b8(0,p3(1,Y))||1},w=!0;function C(R){let O=R[0].intersectionRatio;if(!OT(F,$.getBoundingClientRect()))return z();if(O!==Y){if(!w)return z();if(!O)B=setTimeout(()=>{z(!1,0.0000001)},1000);else z(!1,O)}w=!1}try{H=new IntersectionObserver(C,{...P,root:Q.ownerDocument})}catch(R){H=new IntersectionObserver(C,P)}H.observe($)}let G=I1($),K=()=>z(J);return G.addEventListener("resize",K),z(!0),()=>{G.removeEventListener("resize",K),X()}}function SH($,Z,J,H){if(H===void 0)H={};let{ancestorScroll:B=!0,ancestorResize:Q=!0,elementResize:X=typeof ResizeObserver==="function",layoutShift:z=typeof IntersectionObserver==="function",animationFrame:G=!1}=H,K=wN($),U=B||Q?[...K?BZ(K):[],...Z?BZ(Z):[]]:[];U.forEach((V)=>{B&&V.addEventListener("scroll",J),Q&&V.addEventListener("resize",J)});let Y=K&&z?ht(K,J,Q):null,F=-1,W=null;if(X){if(W=new ResizeObserver((V)=>{let[D]=V;if(D&&D.target===K&&W&&Z)W.unobserve(Z),cancelAnimationFrame(F),F=requestAnimationFrame(()=>{var L;(L=W)==null||L.observe(Z)});J()}),K&&!G)W.observe(K);if(Z)W.observe(Z)}let q,N=G?b7($):null;if(G)A();function A(){let V=b7($);if(N&&!OT(N,V))J();N=V,q=requestAnimationFrame(A)}return J(),()=>{var V;if(U.forEach((D)=>{B&&D.removeEventListener("scroll",J),Q&&D.removeEventListener("resize",J)}),Y==null||Y(),(V=W)==null||V.disconnect(),W=null,G)cancelAnimationFrame(q)}}var TT=FT;var CT=WT,ET=UT,wT=NT;var ST=qT,Lz=($,Z,J)=>{let H=new Map,B=J!=null?J:{},Q={...SN,...B.platform,_c:H};return KT($,Z,{...B,platform:Q})};var J2=_(p(),1),RT=_(p(),1),bT=_(a4(),1),gt=typeof document<"u",ft=function(){},Mz=gt?RT.useLayoutEffect:ft;function Pz($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if(typeof $==="function"&&$.toString()===Z.toString())return!0;let J,H,B;if($&&Z&&typeof $==="object"){if(Array.isArray($)){if(J=$.length,J!==Z.length)return!1;for(H=J;H--!==0;)if(!Pz($[H],Z[H]))return!1;return!0}if(B=Object.keys($),J=B.length,J!==Object.keys(Z).length)return!1;for(H=J;H--!==0;)if(!{}.hasOwnProperty.call(Z,B[H]))return!1;for(H=J;H--!==0;){let Q=B[H];if(Q==="_owner"&&$.$$typeof)continue;if(!Pz($[Q],Z[Q]))return!1}return!0}return $!==$&&Z!==Z}function kT($){if(typeof window>"u")return 1;return($.ownerDocument.defaultView||window).devicePixelRatio||1}function IT($,Z){let J=kT($);return Math.round(Z*J)/J}function IN($){let Z=J2.useRef($);return Mz(()=>{Z.current=$}),Z}function yT($){if($===void 0)$={};let{placement:Z="bottom",strategy:J="absolute",middleware:H=[],platform:B,elements:{reference:Q,floating:X}={},transform:z=!0,whileElementsMounted:G,open:K}=$,[U,Y]=J2.useState({x:0,y:0,strategy:J,placement:Z,middlewareData:{},isPositioned:!1}),[F,W]=J2.useState(H);if(!Pz(F,H))W(H);let[q,N]=J2.useState(null),[A,V]=J2.useState(null),D=J2.useCallback((h)=>{if(h!==P.current)P.current=h,N(h)},[]),L=J2.useCallback((h)=>{if(h!==w.current)w.current=h,V(h)},[]),j=Q||q,M=X||A,P=J2.useRef(null),w=J2.useRef(null),C=J2.useRef(U),R=G!=null,O=IN(G),S=IN(B),y=IN(K),k=J2.useCallback(()=>{if(!P.current||!w.current)return;let h={placement:Z,strategy:J,middleware:F};if(S.current)h.platform=S.current;Lz(P.current,w.current,h).then((f)=>{let E={...f,isPositioned:y.current!==!1};if(T.current&&!Pz(C.current,E))C.current=E,bT.flushSync(()=>{Y(E)})})},[F,Z,J,S,y]);Mz(()=>{if(K===!1&&C.current.isPositioned)C.current.isPositioned=!1,Y((h)=>({...h,isPositioned:!1}))},[K]);let T=J2.useRef(!1);Mz(()=>{return T.current=!0,()=>{T.current=!1}},[]),Mz(()=>{if(j)P.current=j;if(M)w.current=M;if(j&&M){if(O.current)return O.current(j,M,k);k()}},[j,M,k,O,R]);let b=J2.useMemo(()=>({reference:P,floating:w,setReference:D,setFloating:L}),[D,L]),I=J2.useMemo(()=>({reference:j,floating:M}),[j,M]),v=J2.useMemo(()=>{let h={position:J,left:0,top:0};if(!I.floating)return h;let f=IT(I.floating,U.x),E=IT(I.floating,U.y);if(z)return{...h,transform:"translate("+f+"px, "+E+"px)",...kT(I.floating)>=1.5&&{willChange:"transform"}};return{position:J,left:f,top:E}},[J,z,I.floating,U.x,U.y]);return J2.useMemo(()=>({...U,update:k,refs:b,elements:I,floatingStyles:v}),[U,k,b,I,v])}var RN=($,Z)=>{let J=TT($);return{name:J.name,fn:J.fn,options:[$,Z]}},bN=($,Z)=>{let J=CT($);return{name:J.name,fn:J.fn,options:[$,Z]}},kN=($,Z)=>{return{fn:ST($).fn,options:[$,Z]}},yN=($,Z)=>{let J=ET($);return{name:J.name,fn:J.fn,options:[$,Z]}},xN=($,Z)=>{let J=wT($);return{name:J.name,fn:J.fn,options:[$,Z]}};var o2=_(p(),1);function xT($){return mt($,$.rootContext)}function mt($,Z){let{nodeId:J,externalTree:H}=$,B=Z.useState("referenceElement"),Q=Z.useState("floatingElement"),X=Z.useState("domReferenceElement"),z=Z.useState("open"),G=Z.useState("floatingId"),[K,U]=o2.useState(null),[Y,F]=o2.useState(void 0),[W,q]=o2.useState(void 0),N=o2.useRef(null),A=i2(H),V=o2.useMemo(()=>({reference:B,floating:Q,domReference:X}),[B,Q,X]),D=yT({...$,elements:{...V,...K&&{reference:K}}}),L=n0(Y)?Y:null,j=W===void 0?Z.state.floatingElement:W;Z.useSyncedValue("referenceElement",Y??null),Z.useSyncedValue("domReferenceElement",Y===void 0?X:L),Z.useSyncedValue("floatingElement",j);let M=o2.useCallback((S)=>{let y=n0(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),getClientRects:()=>S.getClientRects(),contextElement:S}:S;U(y),D.refs.setReference(y)},[D.refs]),P=o2.useCallback((S)=>{if(n0(S)||S===null)N.current=S,F(S);if(n0(D.refs.reference.current)||D.refs.reference.current===null||S!==null&&!n0(S))D.refs.setReference(S)},[D.refs,F]),w=o2.useCallback((S)=>{q(S),D.refs.setFloating(S)},[D.refs]),C=o2.useMemo(()=>({...D.refs,setReference:P,setFloating:w,setPositionReference:M,domReference:N}),[D.refs,P,w,M]),R=o2.useMemo(()=>({...D.elements,domReference:X}),[D.elements,X]),O=o2.useMemo(()=>({...D,dataRef:Z.context.dataRef,open:z,onOpenChange:Z.setOpen,events:Z.context.events,floatingId:G,refs:C,elements:R,nodeId:J,rootStore:Z}),[D,C,R,J,Z,z,G]);return H0(()=>{if(X)N.current=X},[X]),H0(()=>{Z.context.dataRef.current.floatingContext=O;let S=A?.nodesRef.current.find((y)=>y.id===J);if(S)S.context=O}),o2.useMemo(()=>({...D,context:O,refs:C,elements:R,rootStore:Z}),[D,C,R,O,Z])}var _z=_(p(),1),ut=_z.createContext(void 0);function y4(){return _z.useContext(ut)?.direction??"ltr"}var pt=($)=>({name:"arrow",options:$,async fn(Z){let{x:J,y:H,placement:B,rects:Q,platform:X,elements:z,middlewareData:G}=Z,{element:K,padding:U=0,offsetParent:Y="real"}=q9($,Z)||{};if(K==null)return{};let F=xX(U),W={x:J,y:H},q=MH(B),N=LH(q),A=await X.getDimensions(K),V=q==="y",D=V?"top":"left",L=V?"bottom":"right",j=V?"clientHeight":"clientWidth",M=Q.reference[N]+Q.reference[q]-W[q]-Q.floating[N],P=W[q]-Q.reference[q],w=Y==="real"?await X.getOffsetParent?.(K):z.floating,C=z.floating[j]||Q.floating[N];if(!C||!await X.isElement?.(w))C=z.floating[j]||Q.floating[N];let R=M/2-P/2,O=C/2-A[N]/2-1,S=Math.min(F[D],O),y=Math.min(F[L],O),k=S,T=C-A[N]-y,b=C/2-A[N]/2+R,I=kX(k,b,T),v=!G.arrow&&Y8(B)!=null&&b!==I&&Q.reference[N]/2-(b<k?S:y)-A[N]/2<0,h=v?b<k?b-k:b-T:0;return{[q]:W[q]+h,data:{[q]:I,centerOffset:b-I-h,...v&&{alignmentOffset:h}},reset:v}}}),hT=($,Z)=>{let{name:J,fn:H}=pt($);return{name:J,fn:H,options:[$,Z]}};var vT={name:"hide",async fn($){let{width:Z,height:J,x:H,y:B}=$.rects.reference,Q=Z===0&&J===0&&H===0&&B===0,X=await $.platform.detectOverflow($,{elementContext:"reference"});return{data:{referenceHidden:X.top-J>=0||X.right-Z>=0||X.bottom-J>=0||X.left-Z>=0||Q}}}};var QZ={sideX:"left",sideY:"top"};var jz="--available-width",Oz="--available-height",gT="--anchor-width",fT="--anchor-height",mT="--transform-origin",uT="--positioner-width",pT="--positioner-height";var dT=jz,lT=Oz;function aT($,Z,J){let H=$==="inline-start"||$==="inline-end";return{top:"top",right:H?J?"inline-start":"inline-end":"right",bottom:"bottom",left:H?J?"inline-end":"inline-start":"left"}[Z]}function iT($,Z,J){let{rects:H,placement:B}=$;return{side:aT(Z,l2(B),J),align:Y8(B)||"center",anchor:{width:H.reference.width,height:H.reference.height},positioner:{width:H.floating.width,height:H.floating.height}}}function C9($){return ct($,xT)}function ct($,Z){let{anchor:J,positionMethod:H="absolute",side:B="bottom",sideOffset:Q=0,align:X="center",alignOffset:z=0,collisionBoundary:G,collisionPadding:K=5,sticky:U=!1,arrowPadding:Y=5,disableAnchorTracking:F=!1,inline:W,keepMounted:q=!1,floatingRootContext:N,mounted:A,collisionAvoidance:V,shift:D,nodeId:L,adaptiveOrigin:j,lazyFlip:M=!1,externalTree:P}=$,[w,C]=o4.useState(null);if(!A&&w!==null)C(null);let R=V.side||"flip",O=V.align||"flip",S=V.fallbackAxisSide||"end",y=D?.crossAxis??!1,k=D?.rootBoundary,T=typeof J==="function"?J:void 0,b=U0(T),I=T?b:J,v=G5(J),h=G5(A),E=y4()==="rtl",i=w||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":E?"left":"right","inline-start":E?"right":"left"}[B],r=X==="center"?i:`${i}-${X}`,x=K;if(typeof x==="number")x={top:x,right:x,bottom:x,left:x};else if(x)x={top:x.top||0,right:x.right||0,bottom:x.bottom||0,left:x.left||0};let l=1,o=B==="bottom"?l:0,u=B==="top"?l:0,c=B==="right"?l:0,n=B==="left"?l:0,Z0={boundary:G==="clipping-ancestors"?"clippingAncestors":G,padding:x},J0=o4.useRef(null),X0=G5(Q),Q0=G5(z),F0=typeof Q!=="function"?Q:0,A0=typeof z!=="function"?z:0,N0=[];if(W)N0.push(W);N0.push(RN((C0)=>{let p0=iT(C0,B,E),i0=typeof X0.current==="function"?X0.current(p0):X0.current,a0=typeof Q0.current==="function"?Q0.current(p0):Q0.current;return{mainAxis:i0,crossAxis:a0,alignmentAxis:a0}},[F0,A0,E,B]));let Y0=O==="none"&&R!=="shift",s=!Y0&&(U||y||R==="shift"),a=R==="none"?null:yN({...Z0,padding:{top:x.top+l+o,right:x.right+l+n,bottom:x.bottom+l+u,left:x.left+l+c},mainAxis:!y&&R==="flip",crossAxis:O==="flip"?"alignment":!1,fallbackAxisSideDirection:S}),e=Y0?null:bN({...Z0,rootBoundary:k,mainAxis:O!=="none",crossAxis:s,limiter:U||y?void 0:kN((C0)=>{if(!J0.current)return{};let{width:p0,height:i0}=J0.current.getBoundingClientRect(),a0=I4(l2(C0.placement)),A1=a0==="y"?p0:i0,D1=a0==="y"?x.left+x.right:x.top+x.bottom;return{offset:A1/2+D1/2}})},[Z0,U,y,k,x,O]);if(R==="shift"||O==="shift"||X==="center")N0.push(e,a);else N0.push(a,e);N0.push(xN({...Z0,apply({elements:{floating:C0},availableWidth:p0,availableHeight:i0,rects:a0}){if(!h.current)return;let A1=C0.style;A1.setProperty(dT,`${p0}px`),A1.setProperty(lT,`${i0}px`);let D1=I1(C0).devicePixelRatio||1,{x:u1,y:q0,width:P0,height:l0}=a0.reference,Q1=(Math.round((u1+P0)*D1)-Math.round(u1*D1))/D1,j1=(Math.round((q0+l0)*D1)-Math.round(q0*D1))/D1;A1.setProperty(gT,`${Q1}px`),A1.setProperty(fT,`${j1}px`)}}),hT((C0)=>({element:J0.current||m0(C0.elements.floating).createElement("div"),padding:J0.current?Y:0,offsetParent:"floating"}),[Y]),{name:"transformOrigin",fn(C0){let{elements:{floating:p0},middlewareData:i0,placement:a0,platform:A1,rects:D1,y:u1}=C0,q0=l2(a0),P0=Y8(a0),l0=I4(q0)==="y",Q1=J0.current,j1=typeof Q==="function"?Q(iT(C0,B,E)):Q,k0;if(!Q1&&P0&&Math.abs(l0?i0.shift?.x||0:i0.shift?.y||0)<=1)k0=P0==="start"===(l0&&A1.isRTL?.(p0)===!0)?"100%":"0%";else{let y0=l0?i0.arrow?.x||0:i0.arrow?.y||0,X1=l0?Q1?.clientWidth||0:Q1?.clientHeight||0;k0=`${y0+X1/2}px`}let r0=q0==="top"||q0==="left"?`calc(100% + ${j1}px)`:`${-j1}px`;if(s&&l0&&Math.abs(i0.shift?.y||0)>j1)r0=`${D1.reference.y+D1.reference.height/2-u1}px`;return p0.style.setProperty(mT,l0?`${k0} ${r0}`:`${r0} ${k0}`),{}}},vT,j),H0(()=>{if(!A&&N)N.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[A,N]);let $0=o4.useMemo(()=>({ancestorScroll:!F,elementResize:!F&&typeof ResizeObserver<"u",layoutShift:!F&&typeof IntersectionObserver<"u"}),[F]),{refs:B0,elements:_0,x:M0,y:V0,middlewareData:L0,update:g,placement:m,context:t,isPositioned:W0,floatingStyles:R0}=Z({rootContext:N,open:q?A:void 0,placement:r,middleware:N0,strategy:H,whileElementsMounted:q?void 0:(...C0)=>SH(...C0,$0),nodeId:L,externalTree:P}),{sideX:c0,sideY:f0}=L0.adaptiveOrigin||QZ,T0=W0?H:"fixed",x0=o4.useMemo(()=>{let C0;if(!W0)C0={position:T0,top:0,left:0};else if(j)C0={position:T0,[c0]:M0,[f0]:V0};else C0={...R0,position:T0};if(C0[dT]="100vw",C0[lT]="100vh",!W0)C0.opacity=0;return C0},[j,T0,c0,M0,f0,V0,R0,W0]),Z1=o4.useRef(null);H0(()=>{if(!A)return;let C0=v.current,p0=typeof C0==="function"?C0():C0,a0=(rT(p0)?p0.current:p0)||null||null;if(a0!==Z1.current)B0.setPositionReference(a0),Z1.current=a0},[A,B0,I,v]),o4.useEffect(()=>{if(!A)return;let C0=v.current;if(typeof C0==="function")return;if(rT(C0)&&C0.current!==Z1.current)B0.setPositionReference(C0.current),Z1.current=C0.current},[A,B0,I,v]),o4.useEffect(()=>{if(q&&A&&_0.reference&&_0.floating)return SH(_0.reference,_0.floating,g,$0);return},[q,A,_0,g,$0]);let W1=l2(m),d0=aT(B,W1,E),v0=Y8(m)||"center",w1=Boolean(L0.hide?.referenceHidden);H0(()=>{if(M&&A&&W0&&W1!==i)C(W1)},[M,A,W0,W1,i]);let B1=o4.useMemo(()=>({position:"absolute",top:L0.arrow?.y,left:L0.arrow?.x}),[L0.arrow]),s1=L0.arrow?.centerOffset!==0;return o4.useMemo(()=>({positionerStyles:x0,arrowStyles:B1,arrowRef:J0,arrowUncentered:s1,side:d0,align:v0,physicalSide:W1,anchorHidden:w1,refs:B0,context:t,isPositioned:W0,update:g}),[x0,B1,J0,s1,d0,v0,W1,w1,B0,t,W0,g])}function rT($){return $!=null&&"current"in $}var Tz=_(p(),1),hN=Tz.createContext(void 0);function oT(){let $=Tz.useContext(hN);if($===void 0)throw Error(h0(84));return $}function E9($){return $==="starting"?nj:L1}function w9($,Z,{styles:J,transitionStatus:H,props:B,refs:Q,hidden:X,inert:z=!1}){let G={...J};if(z)G.pointerEvents="none";return z0("div",$,{state:Z,ref:Q,props:[{role:"presentation",hidden:X,style:G},E9(H),B],stateAttributesMapping:i4})}var nT=_(d(),1),sT=Cz.forwardRef(function(Z,J){let{toast:H,...B}=Z,Q=K9(),X=H.positionerProps??L1,{render:z,className:G,anchor:K=X.anchor,positionMethod:U=X.positionMethod??"absolute",side:Y=X.side??"top",align:F=X.align??"center",sideOffset:W=X.sideOffset??0,alignOffset:q=X.alignOffset??0,collisionBoundary:N=X.collisionBoundary??"clipping-ancestors",collisionPadding:A=X.collisionPadding??5,arrowPadding:V=X.arrowPadding??5,sticky:D=X.sticky??!1,disableAnchorTracking:L=X.disableAnchorTracking??!1,collisionAvoidance:j=X.collisionAvoidance??N9,style:M,...P}=B,[w,C]=Cz.useState(null),R=Q.useState("toastIndex",H.id),O=Q.useState("toastVisibleIndex",H.id),S=n0(K)?K:null,y=AN({open:!0,onOpenChange:F1,elements:{floating:w,reference:S}}),k=C9({anchor:S,positionMethod:U,floatingRootContext:y,mounted:!0,side:Y,sideOffset:W,align:F,alignOffset:q,collisionBoundary:N,collisionPadding:A,sticky:D,arrowPadding:V,disableAnchorTracking:L,keepMounted:!0,collisionAvoidance:j}),T={side:k.side,align:k.align,anchorHidden:k.anchorHidden},b=w9(Z,T,{styles:{...k.positionerStyles,[rX]:H.transitionStatus==="ending"?R:O},transitionStatus:H.transitionStatus,props:P,refs:[J,C]});return nT.jsx(hN.Provider,{value:k,children:b})});var tT=_(p(),1);var eT=tT.forwardRef(function(Z,J){let{className:H,render:B,style:Q,...X}=Z,{arrowRef:z,side:G,align:K,arrowUncentered:U,arrowStyles:Y}=oT();return z0("div",Z,{state:{side:G,align:K,uncentered:U},ref:[J,z],props:[{style:Y,"aria-hidden":!0},X]})});var $C=_(p(),1);function ZC(){let $=K9(),Z=$.useState("toasts");return $C.useMemo(()=>({toasts:Z,add:$.addToast,close:$.closeToast,update:$.updateToast,promise:$.promiseToast}),[Z,$])}function JC(){let $=new Set;function Z(J){$.forEach((H)=>H(J))}return{" subscribe":function(H){return $.add(H),()=>{$.delete(H)}},add(J){let H=J.id||CX("toast"),B={...J,id:H,transitionStatus:"starting"};return Z({action:"add",options:B}),H},close(J){Z({action:"close",options:{id:J}})},update(J,H){Z({action:"update",options:{id:J,updates:H}})},promise(J,H){let B=J;return Z({action:"promise",options:{...H,promise:J,setPromise(Q){B=Q}}}),B}}}var a1=_(d(),1),q5=n2.createToastManager();function dt({...$}){return a1.jsx(n2.Provider,{...$})}function lt({...$}){return a1.jsx(n2.Portal,{"data-slot":"toast-portal",...$})}function it({className:$,...Z}){return a1.jsx(n2.Viewport,{"data-slot":"toast-viewport",className:G0("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",$),...Z})}function rt({className:$,...Z}){return a1.jsx(n2.Root,{"data-slot":"toast",className:G0("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-xl bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",$),...Z})}function at({className:$,...Z}){return a1.jsx(n2.Content,{"data-slot":"toast-content",className:G0("flex items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",$),...Z})}function ot({className:$,...Z}){return a1.jsx(n2.Title,{"data-slot":"toast-title",className:G0("text-sm font-medium",$),...Z})}function nt({className:$,...Z}){return a1.jsx(n2.Description,{"data-slot":"toast-description",className:G0("text-sm text-muted-foreground",$),...Z})}function st({className:$,render:Z=a1.jsx(j0,{variant:"outline",size:"sm"}),...J}){return a1.jsx(n2.Action,{"data-slot":"toast-action",render:Z,className:G0("shrink-0",$),...J})}function tt({className:$,children:Z,render:J=a1.jsx(j0,{variant:"ghost",size:"icon-sm"}),...H}){return a1.jsx(n2.Close,{"data-slot":"toast-close","aria-label":"Close toast",render:J,className:G0("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",$),...H,children:Z??a1.jsx(a5,{"aria-hidden":"true",stroke:1.75})})}function et({type:$}){let Z=null;if($==="success")Z=a1.jsx(BC,{"aria-hidden":"true",stroke:1.75});if($==="info")Z=a1.jsx(QC,{"aria-hidden":"true",stroke:1.75});if($==="warning")Z=a1.jsx(Ez,{"aria-hidden":"true",stroke:1.75});if($==="error")Z=a1.jsx(HC,{className:"text-destructive","aria-hidden":"true",stroke:1.75});if($==="loading")Z=a1.jsx(XC,{className:"animate-spin","aria-hidden":"true",stroke:1.75});if(!Z)return null;return a1.jsx("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:Z})}function $e(){let{toasts:$}=n2.useToastManager();return $.map((Z)=>a1.jsx(rt,{toast:Z,children:a1.jsxs(at,{children:[a1.jsx(et,{type:Z.type}),a1.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[a1.jsx(ot,{}),a1.jsx(nt,{})]}),a1.jsx(st,{}),a1.jsx(tt,{})]})},Z.id))}function zC({children:$,toastManager:Z=q5,...J}){return a1.jsxs(dt,{toastManager:Z,...J,children:[$,a1.jsx(lt,{children:a1.jsx(it,{children:a1.jsx($e,{})})})]})}var rj0=n2.createToastManager,aj0=n2.useToastManager;var N3={};I5(N3,{createHandle:()=>uC,Viewport:()=>mC,Trigger:()=>DC,Root:()=>WC,Provider:()=>SC,Positioner:()=>jC,Portal:()=>PC,Popup:()=>TC,Handle:()=>hz,Arrow:()=>EC});var XZ=_(p(),1);var wz=_(p(),1),vN=wz.createContext(void 0);function A8($){let Z=wz.useContext(vN);if(Z===void 0&&!$)throw Error(h0(72));return Z}var GC=_(p(),1);class u8 extends S2{setState($){}update($){}set($,Z){}notifyAll(){}}var KC={...j9,disabled:($)=>$.disabled,instantType:($)=>$.instantType,isInstantPhase:($)=>$.isInstantPhase,trackCursorAxis:($)=>$.trackCursorAxis,disableHoverablePopup:($)=>$.disableHoverablePopup,lastOpenChangeReason:($)=>$.openChangeReason,closeOnClick:($)=>$.closeOnClick,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin};class gN extends S2{constructor($,Z,J){let H=new L2;super(YC($,H,Z,J),FC(H),KC)}setOpen=($,Z)=>{Gz(this,$,Z,{extraState:{openChangeReason:Z.reason}})};cancelPendingOpen($){this.state.floatingRootContext.dispatchOpenChange(!1,I0(K0.triggerPress,$))}}function UC(){let $=new L2,Z=new u8(Object.freeze(YC(void 0,$)),Object.freeze(FC($)),KC);return Object.assign(Z,{setOpen:F1,cancelPendingOpen:F1})}function YC($,Z,J,H=!1){return{..._9(Z,J,H),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...$}}function FC($){return{popupRef:GC.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:$}}var IH=_(d(),1),WC=R8(function(Z){let{disabled:J=!1,defaultOpen:H=!1,open:B,disableHoverablePopup:Q=!1,trackCursorAxis:X="none",actionsRef:z,onOpenChange:G,onOpenChangeComplete:K,handle:U,triggerId:Y,defaultTriggerId:F=null,children:W}=Z,q=a3((S,y)=>new gN({open:H,openProp:B,activeTriggerId:F,triggerIdProp:Y},S,y));q.useControlledProp("openProp",B),q.useControlledProp("triggerIdProp",Y),q.useContextCallback("onOpenChange",G),q.useContextCallback("onOpenChangeComplete",K);let N=q.useState("open"),A=!J&&N,V=q.useState("activeTriggerId"),D=q.useState("mounted"),L=q.useState("payload");q.useSyncedValues({trackCursorAxis:X,disableHoverablePopup:Q,disabled:J}),L9(q,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:j,transitionStatus:M}=M9(A,q),P=q.useState("isInstantPhase"),w=q.useState("instantType"),C=q.useState("lastOpenChangeReason"),R=XZ.useRef(null);H0(()=>{if(N&&J)q.setOpen(!1,I0(K0.disabled))},[N,J,q]),H0(()=>{if(M==="ending"&&C===K0.none||M!=="ending"&&P){if(w!=="delay")R.current=w;q.set("instantType","delay")}else if(R.current!==null)q.set("instantType",R.current),R.current=null},[M,P,C,w,q]),H0(()=>{if(A){if(V==null)q.set("payload",void 0)}},[q,V,A]),XZ.useImperativeHandle(z,()=>({unmount:j,close:()=>q.setOpen(!1,I0(K0.imperativeAction))}),[j,q]);let O=A||D||!J&&X!=="none";return IH.jsxs(vN.Provider,{value:q,children:[U&&IH.jsx(A9,{handle:U,store:q}),O&&IH.jsx(Ze,{store:q,disabled:J,trackCursorAxis:X}),typeof W==="function"?W({payload:L}):W]})});function Ze({store:$,disabled:Z,trackCursorAxis:J}){let H=$.useState("floatingRootContext"),B=v8(H,{enabled:!Z,referencePress:()=>$.select("closeOnClick")}),Q=UN(H,{enabled:!Z&&J!=="none",axis:J==="none"?void 0:J}),X=XZ.useMemo(()=>M2(Q.reference,B.reference),[Q.reference,B.reference]);return P9($,{activeTriggerProps:X,inactiveTriggerProps:X,popupProps:B.floating??L1}),null}var Iz=_(p(),1);function s0($){return W4($,"base-ui")}var Sz=_(p(),1),fN=Sz.createContext(void 0);function qC(){return Sz.useContext(fN)}var NC=600;var AC="data-base-ui-tooltip-trigger";function VC($){if("composedPath"in $){let J=$.composedPath();for(let H=0;H<J.length;H+=1){let B=J[H];if(n0(B))return B}}let Z=$.target;if(n0(Z))return Z;return null}function Je($){let Z=$;while(Z){let J=Z.closest(`[${AC}]`);if(J)return J;let H=Z.getRootNode();Z="host"in H&&n0(H.host)?H.host:null}return null}var DC=U9(function(Z,J){let{render:H,className:B,style:Q,handle:X,payload:z,disabled:G,delay:K,closeOnClick:U=!0,closeDelay:Y,id:F,...W}=Z,q=A8(!0),A=O9(X)??q;if(!A)throw Error(h0(82));let V=s0(F),D=A.useState("isTriggerActive",V),L=A.useState("isOpenedByTrigger",V),j=A.useState("floatingRootContext"),M=Iz.useRef(null),P=Y??0,{registerTrigger:w,isMountedByThisTrigger:C}=D9(V,M,A,{payload:z,closeOnClick:U,closeDelay:P}),R=qC(),{activeIdRef:O,delayRef:S,isInstantPhase:y,hasProvider:k}=HN(j,{open:L}),T=JZ(j);A.useSyncedValue("isInstantPhase",y);let b=A.useState("disabled"),I=G??b,v=G5(I),h=A.useState("trackCursorAxis"),f=A.useState("disableHoverablePopup"),E=Iz.useRef(!1),i=i1(),r=Iz.useRef(void 0);function x(){if(k&&O.current!=null)return 0;return K??R??NC}function l(F0){let A0=M.current;if(!A0||!F0)return!1;let N0=Je(F0);return N0!==null&&N0!==A0&&b0(A0,N0)}function o(F0){let A0=l(F0);if(E.current=A0,A0)T.openChangeTimeout.clear(),T.restTimeout.clear(),T.restTimeoutPending=!1,i.clear();return A0}let u=f8(j,{enabled:!I,mouseOnly:!0,move:!1,handleClose:!f&&h!=="both"?m8():null,restMs:x,delay(){if(Y==null&&k)return{close:h8(S.current,"close")};return{close:P}},triggerElementRef:M,isActiveTrigger:D,isClosing:()=>A.select("transitionStatus")==="ending",shouldOpen(){return!E.current}}),c=I7(j,{enabled:!I}).reference,n=(F0)=>{let A0=E.current,N0=VC(F0),Y0=o(N0),s=M.current,a=s&&N0&&b0(s,N0);if(Y0&&A.select("open")&&A.select("lastOpenChangeReason")===K0.triggerHover){A.setOpen(!1,I0(K0.triggerHover,F0));return}if(A0&&!Y0&&a&&!v.current&&!A.select("open")&&s&&r4(r.current)){let e=()=>{if(!E.current&&!v.current&&!A.select("open"))A.setOpen(!0,I0(K0.triggerHover,F0,s))},$0=x();if($0===0)i.clear(),e();else i.start($0,e)}},Z0=A.useState("triggerProps",C);return z0("button",Z,{state:{open:L},ref:[J,w,M],props:[u,c,C||h!=="none"?Z0:void 0,{onMouseOver(F0){n(F0.nativeEvent)},onFocus(F0){if(l(VC(F0.nativeEvent)))F0.preventBaseUIHandler()},onMouseLeave(){E.current=!1,i.clear(),r.current=void 0},onPointerEnter(F0){r.current=F0.pointerType},onPointerDown(F0){if(r.current=F0.pointerType,A.set("closeOnClick",U),U&&!A.select("open"))A.cancelPendingOpen(F0.nativeEvent)},onClick(F0){if(U&&!A.select("open"))A.cancelPendingOpen(F0.nativeEvent)},id:V,[qH]:I?"":void 0,[AC]:I?void 0:""},W],stateAttributesMapping:Y9})});var MC=_(p(),1);var Rz=_(p(),1),mN=Rz.createContext(void 0);function LC(){let $=Rz.useContext(mN);if($===void 0)throw Error(h0(70));return $}var uN=_(d(),1),PC=MC.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z;if(!(A8().useState("mounted")||H))return null;return uN.jsx(mN.Provider,{value:H,children:uN.jsx(e$,{ref:J,...B})})});var kz=_(p(),1);var bz=_(p(),1),pN=bz.createContext(void 0);function zZ(){let $=bz.useContext(pN);if($===void 0)throw Error(h0(71));return $}var _C=_(d(),1),jC=kz.forwardRef(function(Z,J){let{render:H,className:B,anchor:Q,positionMethod:X="absolute",side:z="top",align:G="center",sideOffset:K=0,alignOffset:U=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:F=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:A=N9,style:V,...D}=Z,L=A8(),j=LC(),M=L.useState("open"),P=L.useState("mounted"),w=L.useState("trackCursorAxis"),C=L.useState("disableHoverablePopup"),R=L.useState("floatingRootContext"),O=L.useState("instantType"),S=L.useState("transitionStatus"),y=L.useState("adaptiveOrigin"),k=C9({anchor:Q,positionMethod:X,floatingRootContext:R,mounted:P,side:z,sideOffset:K,align:G,alignOffset:U,collisionBoundary:Y,collisionPadding:F,sticky:q,arrowPadding:W,disableAnchorTracking:N,keepMounted:j,collisionAvoidance:A,adaptiveOrigin:y}),T=kz.useMemo(()=>({open:M,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:w!=="none"?"tracking-cursor":O}),[M,k.side,k.align,k.anchorHidden,w,O]),b=w9(Z,T,{styles:k.positionerStyles,transitionStatus:S,props:D,refs:[J,L.useStateSetter("positionerElement")],hidden:!P,inert:!M||w==="both"||C});return _C.jsx(pN.Provider,{value:k,children:b})});var OC=_(p(),1);var TC=OC.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=A8(),{side:G,align:K}=zZ(),U=z.useState("open"),Y=z.useState("instantType"),F=z.useState("transitionStatus"),W=z.useState("popupProps"),q=z.useState("floatingRootContext"),N=z.useState("disabled"),A=z.useState("closeDelay");T5({open:U,ref:z.context.popupRef,onComplete(){if(U)z.context.onOpenChangeComplete?.(!0)}}),W3(q,{enabled:!N,closeDelay:A});let V=z.useStateSetter("popupElement");return z0("div",Z,{state:{open:U,side:G,align:K,instant:Y,transitionStatus:F},ref:[J,z.context.popupRef,V],props:[V9,W,E9(F),X],stateAttributesMapping:d2})});var CC=_(p(),1);var EC=CC.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=A8(),{arrowRef:G,side:K,align:U,arrowUncentered:Y,arrowStyles:F}=zZ(),W=z.useState("open"),q=z.useState("instantType");return z0("div",Z,{state:{open:W,side:K,align:U,uncentered:Y,instant:q},ref:[J,G],props:[{style:F,"aria-hidden":!0},X],stateAttributesMapping:i4})});var wC=_(p(),1);var cN=_(d(),1),SC=function(Z){let{delay:J,closeDelay:H,timeout:B=400}=Z,Q=wC.useMemo(()=>({open:J,close:H}),[J,H]);return cN.jsx(fN.Provider,{value:J,children:cN.jsx(JN,{delay:Q,timeoutMs:B,children:Z.children})})};var fC=_(p(),1);var y2=_(p(),1),gC=_(a4(),1);var IC=_(p(),1);function RC($){let[Z,J]=IC.useState({current:$,previous:null});if(!Object.is($,Z.current))J({current:$,previous:Z.current});return Z.previous}var KZ=_(p(),1);function GZ($){let Z=R2($),J=parseFloat(Z.width)||0,H=parseFloat(Z.height)||0,B=P1($),Q=B?$.offsetWidth:J,X=B?$.offsetHeight:H;if(c3(J)!==Q||c3(H)!==X)J=Q,H=X;return{width:J,height:H}}var RH="--popup-width",bH="--popup-height";function yC($){let{popupElement:Z,positionerElement:J,content:H,mounted:B,onMeasureLayout:Q,onMeasureLayoutComplete:X,side:z,direction:G}=$,K=b4(Z,!0),U=F4(),Y=KZ.useRef(null),F=KZ.useRef(!0),W=KZ.useRef(F1),q=U0(Q),N=U0(X),A=KZ.useMemo(()=>He(z,G),[z,G]);H0(()=>{if(!B){W.current=F1,F.current=!0,Y.current=null;return}if(!Z||!J)return;W.current=kC(Z,A),dN(Z,"auto");let V=xz(Z,"position","static"),D=xz(Z,"transform","none"),L=xz(Z,"scale","1"),j=kC(J,{[jz]:"max-content",[Oz]:"max-content"});function M(){V(),D(),j()}function P(){M(),L()}if(q?.(),F.current||Y.current===null){yz(J,"max-content");let O=GZ(Z);return Y.current=O,yz(J,O),P(),N?.(null,O),F.current=!1,()=>{W.current(),W.current=F1}}yz(J,"max-content");let w=Y.current,C=GZ(Z);Y.current=C,dN(Z,w),P(),N?.(w,C),yz(J,C);let R=new AbortController;return U.request(()=>{dN(Z,C),K(()=>{Z.style.setProperty(RH,"auto"),Z.style.setProperty(bH,"auto")},R.signal)}),()=>{R.abort(),U.cancel(),W.current(),W.current=F1}},[H,Z,J,K,U,B,q,N,A])}function He($,Z){let J=$==="top",H=$==="left"||$===(Z==="rtl"?"inline-end":"inline-start");if(!J&&!H)return L1;return{position:"absolute",[J?"bottom":"top"]:"0",[H?"right":"left"]:"0"}}function xz($,Z,J){let H=$.style.getPropertyValue(Z);return $.style.setProperty(Z,J),()=>{$.style.setProperty(Z,H)}}function kC($,Z){let J=[];for(let[H,B]of Object.entries(Z))J.push(xz($,H,B));return J.length?()=>{J.forEach((H)=>H())}:F1}function dN($,Z){let J=Z==="auto"?"auto":`${Z.width}px`,H=Z==="auto"?"auto":`${Z.height}px`;$.style.setProperty(RH,J),$.style.setProperty(bH,H)}function yz($,Z){let J=Z==="max-content"?"max-content":`${Z.width}px`,H=Z==="max-content"?"max-content":`${Z.height}px`;$.style.setProperty(uT,J),$.style.setProperty(pT,H)}var xC={name:"adaptiveOrigin",async fn($){let{x:Z,y:J,rects:{floating:H},elements:{floating:B},platform:Q,strategy:X,placement:z}=$,G=I1(B),K=G.getComputedStyle(B);if(!(K.transitionDuration!=="0s"&&K.transitionDuration!==""))return{x:Z,y:J,data:QZ};let Y=await Q.getOffsetParent?.(B),F={width:0,height:0};if(X==="fixed"&&G?.visualViewport)F={width:G.visualViewport.width,height:G.visualViewport.height};else if(Y===G){let D=m0(B);F={width:D.documentElement.clientWidth,height:D.documentElement.clientHeight}}else if(await Q.isElement?.(Y))F=await Q.getDimensions(Y);let W=l2(z),q=Z,N=J;if(W==="left")q=F.width-(Z+H.width);if(W==="top")N=F.height-(J+H.height);let A=W==="left"?"right":QZ.sideX,V=W==="top"?"bottom":QZ.sideY;return{x:q,y:N,data:{sideX:A,sideY:V}}}};var hC="data-activation-direction";var UZ=_(d(),1),n3={activationDirection:($)=>$?{[hC]:$}:null};function s3($){let{store:Z,side:J,children:H}=$,B=y4(),Q=Z.useState("activeTriggerElement"),X=Z.useState("activeTriggerId"),z=Z.useState("open"),G=Z.useState("payload"),K=Z.useState("mounted"),U=Z.useState("popupElement"),Y=Z.useState("positionerElement"),F=RC(z?Q:null),W=ze(X,G),q=y2.useRef(null),[N,A]=y2.useState(null),[V,D]=y2.useState(null),L=y2.useRef(null),j=y2.useRef(null),M=b4(L,!0),P=F4(),w=y2.useRef(null),[C,R]=y2.useState(null),[O,S]=y2.useState(!1);H0(()=>{return Z.set("adaptiveOrigin",xC),()=>{Z.set("adaptiveOrigin",void 0)}},[Z]);let y=U0(()=>{L.current?.style.setProperty("animation","none"),L.current?.style.setProperty("transition","none"),j.current?.style.setProperty("display","none")}),k=U0((f)=>{if(L.current?.style.removeProperty("animation"),L.current?.style.removeProperty("transition"),j.current?.style.removeProperty("display"),f)R(f)}),T=U0(()=>{w.current?.abort();let f=new AbortController;w.current=f,M(()=>{A(null),R(null),q.current=null},f.signal)}),b=y2.useRef(null);H0(()=>{if(!z||!K)b.current=null},[z,K]),H0(()=>{if(Q&&F&&Q!==F&&b.current!==Q&&q.current){A(q.current),S(!0);let f=Xe(F,Q);D(f),b.current=Q}},[Q,F]),H0(()=>{if(N==null)return;w.current?.abort(),S(!0),P.request(()=>{gC.flushSync(()=>{S(!1)}),T()})},[W,N,T,P]),H0(()=>{let f=L.current;if(!f)return;let E=m0(f).createElement("div");for(let i of Array.from(f.childNodes))E.appendChild(i.cloneNode(!0));q.current=E});let I=N!=null,v;if(!I)v=UZ.jsx("div",{"data-current":!0,ref:L,children:H},W);else v=UZ.jsxs(y2.Fragment,{children:[UZ.jsx("div",{"data-previous":!0,inert:q8(!0),ref:j,style:{...C?{[RH]:`${C.width}px`,[bH]:`${C.height}px`}:null,position:"absolute"},"data-ending-style":O?void 0:""},"previous"),UZ.jsx("div",{"data-current":!0,ref:L,"data-starting-style":O?"":void 0,children:H},W)]});H0(()=>{let f=j.current;if(!f||!N)return;f.replaceChildren(...Array.from(N.childNodes))},[N]),yC({popupElement:U,positionerElement:Y,mounted:K,content:G,onMeasureLayout:y,onMeasureLayoutComplete:k,side:J,direction:B});let h={activationDirection:Qe(V),transitioning:I};return{children:v,state:h}}function Qe($){if(!$)return;return`${vC($.horizontal,5,"right","left")} ${vC($.vertical,5,"down","up")}`}function vC($,Z,J,H){if($>Z)return J;if($<-Z)return H;return""}function Xe($,Z){let J=$.getBoundingClientRect(),H=Z.getBoundingClientRect(),B={x:J.left+J.width/2,y:J.top+J.height/2},Q={x:H.left+H.width/2,y:H.top+H.height/2};return{horizontal:Q.x-B.x,vertical:Q.y-B.y}}function ze($,Z){let[J,H]=y2.useState(0),B=y2.useRef($),Q=y2.useRef(Z),X=y2.useRef(!1);return H0(()=>{let z=B.current,G=Q.current,K=$!==z,U=Z!==G;if(K)H((Y)=>Y+1),X.current=!U;else if(X.current&&U)H((Y)=>Y+1),X.current=!1;B.current=$,Q.current=Z},[$,Z]),`${$??"current"}-${J}`}var mC=fC.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=A8(),K=zZ(),U=G.useState("instantType"),{children:Y,state:F}=s3({store:G,side:K.side,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:U};return z0("div",Z,{state:W,ref:J,props:[z,{children:Y}],stateAttributesMapping:n3})});class hz extends g8{constructor(){super(UC(),"Tooltip")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function uC(){return new hz}var vz=_(p(),1),t3=_(d(),1);function D8({portal:$,children:Z,...J}){let[H,B]=vz.useState(void 0),Q=vz.useCallback((X)=>{if(X)B(X.closest("[data-applet]")?.getAttribute("data-applet")??void 0)},[]);return t3.jsxs(t3.Fragment,{children:[t3.jsx("span",{hidden:!0,ref:Q}),t3.jsx($,{...J,children:t3.jsx("div",{"data-applet":H,className:"contents",children:Z})})]})}var k7=_(d(),1);function gz({delay:$=100,...Z}){return k7.jsx(N3.Provider,{"data-slot":"tooltip-provider",delay:$,...Z})}function B5({...$}){return k7.jsx(N3.Root,{"data-slot":"tooltip",...$})}function Q5({...$}){return k7.jsx(N3.Trigger,{"data-slot":"tooltip-trigger",...$})}function X5({className:$,side:Z="top",sideOffset:J=6,align:H="center",alignOffset:B=0,children:Q,...X}){return k7.jsx(D8,{portal:N3.Portal,children:k7.jsx(N3.Positioner,{align:H,alignOffset:B,side:Z,sideOffset:J,className:"isolate z-50",children:k7.jsx(N3.Popup,{"data-slot":"tooltip-content",className:G1("z-50 flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-lg bg-popover px-2.5 py-1.5 text-xs font-medium text-popover-foreground shadow-md has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...X,children:Q})})})}function fz({cooldownMs:$,windowMs:Z,maxPerWindow:J,maxKeys:H=256,now:B=Date.now}){let Q=new Map,X=0,z=0;return{admit(G){let K=B(),U=Q.get(G);if(U!==void 0&&K-U<$)return"cooldown";if(K-X>=Z)X=K,z=0;if(z>=J)return"window";if(z++,Q.set(G,K),Q.size>H)for(let Y of[...Q.keys()].slice(0,Math.ceil(H/2)))Q.delete(Y);return"ok"}}}var Ge=fz({cooldownMs:5000,windowMs:60000,maxPerWindow:30});function n4($,Z){let J=[$,Z.source,Z.kind,Z.name,Z.message].join("\x00");if(Ge.admit(J)!=="ok")return;fetch(`/api/workspaces/${$}/applet-log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:[Z]})}).catch(()=>{})}var Ke=/\/api\/workspaces\/([^/\s)]+)\/(widgets|views)\/([^/\s)]+)\//;function pC($){if(!$)return null;let Z=Ke.exec($);if(!Z)return null;return{workspaceId:Z[1],kind:Z[2]==="widgets"?"widget":"view",name:Z[3]}}var cC=!1;function dC(){if(cC)return;cC=!0;let $=(Z,J,H)=>{let B=J instanceof Error?J:null,Q=B?.stack??"",X=Z??pC(Q);if(!X)return;n4(X.workspaceId,{source:"window",kind:X.kind,name:X.name,message:B?.message||H||String(J),...Q?{stack:Q}:{}})};window.addEventListener("error",(Z)=>$(pC(Z.filename),Z.error,Z.message)),window.addEventListener("unhandledrejection",(Z)=>$(null,Z.reason))}function y7($,Z){return`${$}:${Z}`}function YZ($){return $==="running"}function rC($){return Object.values($).some(YZ)}function kH($,Z,J){return YZ($[y7(Z,J)])}function uz($,Z){let J=`${Z}:`;return Object.entries($).some(([H,B])=>H.startsWith(J)&&YZ(B))}function aC($,Z,J){if(!J)return!1;let H=`${Z}:`,B=y7(Z,J);return Object.entries($).some(([Q,X])=>Q.startsWith(H)&&Q!==B&&YZ(X))}function p8($,Z){return y7($,Z??"new")}function mz($,Z,J){for(let[H,B]of Object.entries($)){if(!H.startsWith(`${Z}:`))continue;let Q=B.find((X)=>X.localId===J);if(Q)return{key:H,attachment:Q}}}var k1=lC()(($)=>({activity:{},errors:{},previews:{},attachments:{},setActivity:(Z,J,H)=>$((B)=>({activity:{...B.activity,[y7(Z,J)]:H}})),reconcileActivity:(Z)=>$(()=>({activity:Object.fromEntries(Z.map((J)=>[y7(J.workspaceId,J.sessionId),J.activity]))})),setError:(Z,J,H)=>$((B)=>({errors:{...B.errors,[y7(Z,J)]:H}})),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]:H,...B}=J.previews;return{previews:B}}),clearPreviewsForSession:(Z,J)=>$((H)=>{let B={},Q=!1;for(let[X,z]of Object.entries(H.previews))if(z.workspaceId===Z&&z.sessionId===J)Q=!0;else B[X]=z;return Q?{previews:B}:H}),clearAllPreviews:()=>$((Z)=>Object.keys(Z.previews).length?{previews:{}}:Z),sweepPreviews:(Z,J)=>$((H)=>{let B={},Q=!1;for(let[X,z]of Object.entries(H.previews))if(J-z.updatedAt>Z)Q=!0;else B[X]=z;return Q?{previews:B}:H}),addAttachments:(Z,J,H)=>$((B)=>{let Q=p8(Z,J);return{attachments:{...B.attachments,[Q]:[...B.attachments[Q]??[],...H]}}}),updateAttachment:(Z,J,H)=>$((B)=>{let Q=mz(B.attachments,Z,J);if(!Q)return{};let{key:X,attachment:z}=Q,G=B.attachments[X];if(z.kind!=="text"&&z.previewUrl&&"previewUrl"in H&&H.previewUrl!==z.previewUrl)URL.revokeObjectURL(z.previewUrl);return{attachments:{...B.attachments,[X]:G.map((K)=>K.localId===J&&K.kind!=="text"?{...K,...H}:K)}}}),removeAttachment:(Z,J)=>$((H)=>{let B=mz(H.attachments,Z,J);if(!B)return{};let{key:Q,attachment:X}=B,z=H.attachments[Q];if(X.kind!=="text"&&X.previewUrl)URL.revokeObjectURL(X.previewUrl);return{attachments:{...H.attachments,[Q]:z.filter((G)=>G.localId!==J)}}}),clearAttachments:(Z,J)=>$((H)=>{let B=p8(Z,J);for(let X of H.attachments[B]??[])if(X.kind!=="text"&&X.previewUrl)URL.revokeObjectURL(X.previewUrl);let Q={...H.attachments};return delete Q[B],{attachments:Q}}),renameSession:(Z,J,H)=>$((B)=>{let Q=p8(Z,J),X=y7(Z,H),z={...B.activity},G={...B.errors};if(Q in z)z[X]=z[Q],delete z[Q];if(Q in G)G[X]=G[Q],delete G[Q];let K=B.previews,U=!1;for(let[F,W]of Object.entries(B.previews))if(W.workspaceId===Z&&W.sessionId===J){if(!U)K={...B.previews},U=!0;K[F]={...W,sessionId:H}}let Y=B.attachments;if(Q!==X&&Y[Q])Y={...Y,[X]:[...Y[X]??[],...Y[Q]]},delete Y[Q];return{activity:z,errors:G,previews:K,attachments:Y}})}));function oC($,Z,J){if(!J)return{root:null,byParent:{}};let H=null,B={};for(let Q of Object.values($)){if(Q.workspaceId!==Z||Q.sessionId!==J)continue;if(Q.parentToolUseId===null){if(!H||Q.updatedAt>H.updatedAt)H=Q}else{let X=B[Q.parentToolUseId];if(!X||Q.updatedAt>X.updatedAt)B[Q.parentToolUseId]=Q}}return{root:H,byParent:B}}function x2($){return iC(k1,$)}var S0={all:["workspaces"],discover:["workspaces","discover"],setupInfo:["workspaces","setup-info"],preview:($)=>["workspaces","preview",$],layout:($)=>["workspaces","layout",$],widgets:($)=>["workspaces","widgets",$],appletThumbnails:($)=>["workspaces","applet-thumbnails",$],views:($)=>["workspaces","views",$],viewBuilders:($)=>["workspaces","view-builders",$],sessions:($)=>["workspaces","sessions",$],events:($,Z)=>["workspaces","events",$,Z],sessionConfig:($,Z)=>["workspaces","sessionConfig",$,Z],mcp:($)=>["workspaces","mcp",$],agent:($)=>["workspaces","agent",$],skills:($)=>["workspaces","skills",$],env:($)=>["workspaces","env",$]};function yH(){return{turns:[],notices:[]}}function pz($,Z){switch(Z.kind){case"snapshot":return{...$,snapshot:Z.snapshot};case"turn":{let J=$.turns.findIndex((B)=>B.id===Z.turn.id);if(J>=0)return{...$,turns:$.turns.map((B,Q)=>Q===J?Z.turn:B)};if(Z.turn.seq===void 0)return{...$,turns:[...$.turns,Z.turn]};let H=$.turns.findIndex((B)=>B.seq!==void 0&&B.seq>Z.turn.seq);if(H<0)return{...$,turns:[...$.turns,Z.turn]};return{...$,turns:[...$.turns.slice(0,H),Z.turn,...$.turns.slice(H)]}}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 nC($){let Z=yH(),J=new Map,H=new Map,B=-1/0;for(let Q of $)switch(Q.kind){case"snapshot":Z.snapshot=Q.snapshot;break;case"turn":{let X=Q.turn,z=X.seq,G=J.get(X.id);if(G!==void 0)Z.turns[G]=X;else{let K=z!==void 0&&z<B?Z.turns.findIndex((U)=>U.seq!==void 0&&U.seq>z):-1;if(K<0)J.set(X.id,Z.turns.length),Z.turns.push(X);else{Z.turns.splice(K,0,X);for(let U=K;U<Z.turns.length;U++)J.set(Z.turns[U].id,U)}}if(z!==void 0)B=Math.max(B,z);break}case"notice":H.set(Q.notice.id,Q.notice);break;case"result":Z.result=Q.result;break}return Z.notices=[...H.values()],Z}var lN=new WeakMap;function sC($,Z,J,H){for(let B of lN.get($)??[])if(B.workspaceId===Z&&B.sessionId===J)B.events.push(H)}function tC($,Z){return qq({queryKey:S0.events($,Z),queryFn:async({client:J,signal:H})=>{let B=lN.get(J)??new Set;lN.set(J,B);let Q={workspaceId:$,sessionId:Z,events:[]};B.add(Q);try{let X=await q1(`/api/workspaces/${$}/sessions/${Z}/events`,{signal:H},"Couldn’t load chat");return nC([...X,...Q.events])}finally{B.delete(Q)}},staleTime:1/0,gcTime:300000})}var xH=_(p(),1);var V3={all:["app-ui"],selectedSession:($)=>["app-ui","selected-session",$]};function Ue($){return[...V3.selectedSession($),"save"]}function Ye($,Z,J){let H=V3.selectedSession(Z),B=$.getQueryData(H),Q=B?.sessionId??null;if(B&&Q===J)return null;return $.setQueryData(H,{sessionId:J}),{sessionId:J,previousSessionId:Q}}function Fe($,Z,J,H){let B=V3.selectedSession(Z),Q=$.getQueryData(B);if(J.sessionId!==H.sessionId&&Q?.sessionId!==J.sessionId)return"conflict";if(Q?.sessionId!==H.sessionId&&Q?.sessionId!==H.previousSessionId)return"ignored";return $.setQueryData(B,J),"applied"}function We($,Z,J,H){if(H)return;$.setQueryData(V3.selectedSession(Z),{sessionId:J})}function eC($,Z,J,H){$.setQueryData(V3.selectedSession(Z),(B)=>B?.sessionId===J?{sessionId:H}:B)}function e3(){let $=e1(),Z=z1(),J=xH.useMemo(()=>V3.selectedSession($),[$]),H=xH.useMemo(()=>Ue($),[$]),B=Nq({mutationKey:H,exact:!0}),Q=J5({queryKey:J,queryFn:()=>q1(`/api/workspaces/${$}/selected-session`),staleTime:1/0,gcTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}),{mutate:X}=H5({mutationKey:H,scope:{id:`selected-session:${$}`},mutationFn:(K)=>q1(`/api/workspaces/${$}/selected-session`,v5("PUT",K),"Couldn’t save selected chat"),onSuccess:(K,U)=>{if(Fe(Z,$,K,U)!=="conflict")return;q5.add({title:"Couldn’t save selected chat",type:"error"}),Z.invalidateQueries({queryKey:J})},onError:(K,U)=>{if(Z.getQueryData(J)?.sessionId!==U.sessionId)return;q5.add({title:"Couldn’t save selected chat",type:"error"}),Z.invalidateQueries({queryKey:J})}}),z=xH.useCallback((K)=>{let U=Ye(Z,$,K);if(U)X(U)},[Z,X,$]);return K2((K)=>{if(K.type!=="selected-session:updated"||K.workspaceId!==$)return;We(Z,$,K.sessionId,B>0)}),[Q.isLoading?void 0:Q.data?.sessionId??null,z]}function ZE($,Z){let{queryClient:J,sendMessage:H,onWorkspaceSwitch:B}=Z,Q=k1.getState();if($.type==="status_snapshot"){Q.reconcileActivity($.sessions??[]);return}if($.type==="status"){let{workspaceId:K,sessionId:U,activity:Y}=$;if(Q.setActivity(K,U,Y),Y!=="running")Q.clearPreviewsForSession(K,U);return}if($.type==="preview"){let K=$,U=S0.events(K.workspaceId,K.sessionId);if(J?.getQueryData(U)===void 0)return;Q.setPreview({workspaceId:K.workspaceId,sessionId:K.sessionId,messageId:K.messageId,parentToolUseId:K.parentToolUseId,blocks:K.blocks});return}if($.type==="session_renamed"){let{workspaceId:K,from:U,to:Y}=$,F=S0.sessions(K),q=J?.getQueryData(F)?.find((V)=>V.sessionId===U||V.sessionId===Y);if(q)J?.cancelQueries({queryKey:F});if(Q.renameSession(K,U,Y),J)eC(J,K,U,Y);if(q)J?.setQueryData(F,(V)=>[{...q,sessionId:Y},...(V??[]).filter((D)=>D.sessionId!==U&&D.sessionId!==Y)]);let N=J?.getQueryData(S0.events(K,U));if(N!==void 0)J?.setQueryData(S0.events(K,Y),N),J?.removeQueries({queryKey:S0.events(K,U)});let A=J?.getQueryData(S0.sessionConfig(K,U));if(A!==void 0)J?.setQueryData(S0.sessionConfig(K,Y),A),J?.removeQueries({queryKey:S0.sessionConfig(K,U)});if(!q)J?.invalidateQueries({queryKey:F});J?.invalidateQueries({queryKey:S0.preview(K)});return}if($.type==="sessions_changed"){let K=$.workspaceId,U=S0.sessions(K);J?.invalidateQueries({queryKey:U}),J?.invalidateQueries({queryKey:S0.preview(K)});return}if($.type==="workspace:switch"){B?.($.workspaceId);return}if($.type==="scratchpad:op"){let K=$E($.workspaceId);if(!K)return;let U=$.opId;K($.op).then((Y)=>H({type:"scratchpad:op-result",opId:U,result:Y}),(Y)=>H({type:"scratchpad:op-result",opId:U,error:Y instanceof Error?Y.message:String(Y)}));return}let{workspaceId:X,sessionId:z}=$;if(!X||!z)return;let G=$.kind;if(G==="snapshot"||G==="turn"||G==="notice"||G==="result"){if(qe(J,X,z,$),G==="turn"){let K=$.turn?.meta?.apiMessageId;if(K)Q.clearPreview(K)}if(G==="result")Q.clearPreviewsForSession(X,z)}if(G==="error"&&typeof $.content==="string"){if(Q.setError(X,z,$.content),$.terminal!==!1)Q.setActivity(X,z,"idle"),Q.clearPreviewsForSession(X,z)}if(G==="stopped")Q.setActivity(X,z,"idle"),Q.clearPreviewsForSession(X,z)}function qe($,Z,J,H){if(!$)return;sC($,Z,J,H);let B=S0.events(Z,J),Q=$.getQueryData(B);if(Q===void 0)return;$.setQueryData(B,pz(Q,H))}var rN=null,FZ=null,cz=0,dz=null,iN=[],BE=null,JE=null,Ne=15000;function QE($){if(rN=$,!JE)JE=setInterval(()=>k1.getState().sweepPreviews(Ne,Date.now()),5000);if(FZ)return;XE()}function XE(){let $=++cz;if(dz)clearTimeout(dz),dz=null;let Z=new WebSocket(HE("/ws"));FZ=Z,Z.onopen=()=>{if(cz!==$){Z.close();return}for(let J of iN)Z.send(JSON.stringify(J));iN.length=0,rN?.invalidateQueries({queryKey:["workspaces","events"]}),k1.getState().clearAllPreviews()},Z.onmessage=(J)=>{if(cz!==$)return;let H;try{H=JSON.parse(J.data)}catch{return}Ve(H)},Z.onclose=()=>{if(cz!==$)return;FZ=null,dz=setTimeout(XE,1000)},Z.onerror=()=>Z.close()}function Ve($){ZE($,{queryClient:rN,sendMessage:lz,onWorkspaceSwitch:BE})}function lz($){if(FZ&&FZ.readyState===WebSocket.OPEN)FZ.send(JSON.stringify($));else iN.push($)}function aN($){BE=$}var eW=_(p(),1);var Ae=($)=>zE()(KE((Z)=>({discoveredWorkspacesOpen:!0,hasSentMessageFromMoi:!1,workspaceIdsPendingAnalysis:[],composerDrafts:{},viewBuilderDrafts:{},dockedChatWidth:360,setDiscoveredWorkspacesOpen:(J)=>Z({discoveredWorkspacesOpen:J}),markWorkspacePendingAnalysis:(J)=>Z((H)=>{let B=H.workspaceIdsPendingAnalysis??[];return{workspaceIdsPendingAnalysis:B.includes(J)?B:[...B,J]}}),markMessageSentFromMoi:(J)=>Z((H)=>({hasSentMessageFromMoi:!0,workspaceIdsPendingAnalysis:(H.workspaceIdsPendingAnalysis??[]).filter((B)=>B!==J)})),setComposerDraft:(J,H)=>Z((B)=>{let Q={...B.composerDrafts??{}};if(H)Q[J]=H;else delete Q[J];return{composerDrafts:Q}}),setViewBuilderDraft:(J,H)=>Z((B)=>{let Q=B.viewBuilderDrafts??{};if(H===null){if(!(J in Q))return B;let X={...Q};return delete X[J],{viewBuilderDrafts:X}}if(Q[J]===H)return B;return{viewBuilderDrafts:{...Q,[J]:H}}}),setDockedChatWidth:(J)=>Z({dockedChatWidth:J})}),$?{name:"moi:ui",storage:GE(()=>$)}:{name:"moi:ui"})),C5=Ae();function UE($,Z){let J=$??[],H=J.findIndex((B)=>B.id===Z.id||B.path===Z.path);if(H===-1)return[Z,...J];return J.map((B,Q)=>Q===H?{...B,...Z}:B)}function iz(){return J5({queryKey:S0.all,queryFn:()=>q1("/api/workspaces"),staleTime:1/0,refetchOnMount:"always"})}function rz($){return J5({queryKey:S0.preview($),queryFn:()=>q1(`/api/workspaces/${$}/preview`),staleTime:60000})}function YE(){return J5({queryKey:S0.discover,queryFn:()=>q1("/api/workspaces/discover")})}function FE(){let $=z1();return H5({mutationFn:(Z)=>q1("/api/workspaces",v5("POST",Z),"Failed to add workspace"),onSuccess:(Z,J)=>{C5.getState().markWorkspacePendingAnalysis(Z.id),$.setQueryData(S0.all,(H)=>UE(H,Z)),$.setQueryData(S0.discover,(H)=>(H??[]).filter((B)=>B.path!==J.path))}})}function az(){return J5({queryKey:S0.setupInfo,queryFn:()=>q1("/api/workspaces/create"),staleTime:30000,refetchOnMount:"always"})}function WE(){let $=z1();return H5({mutationFn:(Z)=>q1("/api/workspaces/create",v5("POST",Z),"Failed to create workspace"),onSuccess:(Z)=>{$.setQueryData(S0.all,(J)=>UE(J,Z))}})}function qE(){let $=z1();return H5({mutationFn:(Z)=>q1("/api/workspaces/order",v5("PUT",{ids:Z}),"Failed to reorder spaces"),onMutate:async(Z)=>{await $.cancelQueries({queryKey:S0.all,exact:!0});let J=$.getQueryData(S0.all);if(J){let H=new Map(J.map((Q)=>[Q.id,Q])),B=Z.map((Q)=>H.get(Q)).filter((Q)=>Boolean(Q));if(B.length===J.length)$.setQueryData(S0.all,B)}return{previous:J}},onError:(Z,J,H)=>{if(H?.previous)$.setQueryData(S0.all,H.previous);$.invalidateQueries({queryKey:S0.all,exact:!0})},onSuccess:(Z)=>{$.setQueryData(S0.all,Z)}})}function NE(){let $=z1();return H5({mutationFn:(Z)=>A4(`/api/workspaces/${Z}`,{method:"DELETE"},"Failed to remove workspace"),onSuccess:(Z,J)=>{$.setQueryData(S0.all,(H)=>(H??[]).filter((B)=>B.id!==J)),$.invalidateQueries({queryKey:S0.discover})}})}var PE=_(p(),1);var VE=_(d(),1);function s4({className:$,...Z}){return VE.jsx(b5,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:G1("size-4 animate-spin",$),stroke:1.75,...Z})}var oN="Wait for active agents to finish, or stop them before updating moi";var De=["update"],AE=300000,Le=1000;function DE($){return J5({queryKey:De,queryFn:()=>q1("/api/update"),staleTime:AE,refetchInterval:$?Le:AE,refetchOnWindowFocus:!0,retry:!1})}function LE(){return H5({mutationFn:()=>q1("/api/update",{method:"POST"},"Could not update moi")})}var A3=_(d(),1);function Me($,Z){return!!Z&&$?.runningVersion===Z}function Pe($,Z,J){let H=Z||J,B=$&&!H;return{busy:H,blocked:B,label:Z?"Updating":J?"Restarting":B?oN:"Update"}}function _E(){let $=LE(),Z=DE($.isSuccess),J=x2((z)=>rC(z.activity)),H=Z.data,B=$.data?.installedVersion??null;if(PE.useEffect(()=>{if(Me(H,B))window.location.reload()},[B,H]),Z.isPending)return{status:"loading"};if(!H?.availableVersion&&!$.isSuccess)return{status:"unavailable"};let Q=$.isSuccess;return{status:"available",button:{...Pe(J,$.isPending,Q),errorMessage:$.error?.message??null,onClick:()=>$.mutate()}}}function jE({busy:$,blocked:Z,label:J,errorMessage:H,onClick:B}){return A3.jsxs(B5,{children:[A3.jsx(Q5,{render:A3.jsx("div",{children:A3.jsx(j0,{type:"button",size:"icon",variant:$?"ghost":"default","aria-label":J,disabled:Z||$,onClick:B,children:$?A3.jsx(s4,{stroke:1.5}):A3.jsx(ME,{stroke:1.5})})})}),A3.jsx(X5,{side:"right",className:Z?"max-w-56":void 0,children:Z?oN:H??J})]})}var GB=_(p(),1);var d8={};I5(d8,{createHandle:()=>$w,Viewport:()=>KG,Trigger:()=>YG,Title:()=>UG,Root:()=>rE,Portal:()=>BG,Popup:()=>HG,Handle:()=>MZ,Description:()=>tz,Close:()=>sz,Backdrop:()=>nz});var OE=_(p(),1);var oz=_(p(),1),nN=oz.createContext(void 0);function P2($){let Z=oz.useContext(nN);if(!$&&Z===void 0)throw Error(h0(27));return Z}var nz=OE.forwardRef(function(Z,J){let{render:H,className:B,style:Q,forceRender:X=!1,...z}=Z,G=P2(),K=G.useState("open"),U=G.useState("nested"),Y=G.useState("mounted"),F=G.useState("transitionStatus");return z0("div",Z,{state:{open:K,transitionStatus:F},ref:[G.context.backdropRef,J],stateAttributesMapping:d2,props:[{role:"presentation",hidden:!Y,style:{userSelect:"none",WebkitUserSelect:"none"}},z],enabled:X||!U})});var TE=_(p(),1);var sz=TE.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,...G}=Z,K=P2(),U=K.useState("open"),{getButtonProps:Y,buttonRef:F}=O5({disabled:X,native:z}),W={disabled:X};function q(N){if(U)K.setOpen(!1,I0(K0.closePress,N.nativeEvent))}return z0("button",Z,{state:W,ref:[J,F],props:[{onClick:q},G,Y]})});var CE=_(p(),1);var tz=CE.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,...z}=Z,G=P2(),K=s0(X);return G.useSyncedValueWithCleanup("descriptionElementId",K),z0("p",Z,{ref:J,props:[{id:K},z]})});var RE=_(p(),1);var ez=_(p(),1),sN=ez.createContext(void 0);function $G(){let $=ez.useContext(sN);if($===void 0)throw Error(h0(26));return $}var WZ="ArrowUp",qZ="ArrowDown",NZ="ArrowLeft",VZ="ArrowRight",AZ="Home",DZ="End",tN="PageUp",eN="PageDown",c8=new Set([WZ,qZ,NZ,VZ,AZ,DZ]),_e="Shift",wE=[_e,"Control","Alt","Meta"];function je($){return P1($)&&$.tagName==="INPUT"}function $V($){if(je($)&&$.selectionStart!=null)return!0;if(P1($)&&$.tagName==="TEXTAREA")return!0;return!1}function ZV($,Z,J,H){if(!$||!Z||!Z.scrollTo)return;let{scrollLeft:B,scrollTop:Q}=$,X=$.clientWidth<$.scrollWidth,z=$.clientHeight<$.scrollHeight;if(X&&H!=="vertical"){let G=EE($,Z,"left"),K=ZG($),U=ZG(Z);if(J==="ltr"){if(G+Z.offsetWidth+U.scrollMarginRight>$.scrollLeft+$.clientWidth-K.scrollPaddingRight)B=G+Z.offsetWidth+U.scrollMarginRight-$.clientWidth+K.scrollPaddingRight;else if(G-U.scrollMarginLeft<$.scrollLeft+K.scrollPaddingLeft)B=G-U.scrollMarginLeft-K.scrollPaddingLeft}if(J==="rtl"){if(G-U.scrollMarginLeft<$.scrollLeft+K.scrollPaddingLeft)B=G-U.scrollMarginLeft-K.scrollPaddingLeft;else if(G+Z.offsetWidth+U.scrollMarginRight>$.scrollLeft+$.clientWidth-K.scrollPaddingRight)B=G+Z.offsetWidth+U.scrollMarginRight-$.clientWidth+K.scrollPaddingRight}}if(z&&H!=="horizontal"){let G=EE($,Z,"top"),K=ZG($),U=ZG(Z);if(G-U.scrollMarginTop<$.scrollTop+K.scrollPaddingTop)Q=G-U.scrollMarginTop-K.scrollPaddingTop;else if(G+Z.offsetHeight+U.scrollMarginBottom>$.scrollTop+$.clientHeight-K.scrollPaddingBottom)Q=G+Z.offsetHeight+U.scrollMarginBottom-$.clientHeight+K.scrollPaddingBottom}$.scrollTo({left:B,top:Q,behavior:"auto"})}function EE($,Z,J){let H=J==="left"?"offsetLeft":"offsetTop",B=0;while(Z.offsetParent){if(B+=Z[H],Z.offsetParent===$)break;Z=Z.offsetParent}return B}function ZG($){let Z=getComputedStyle($);return{scrollMarginTop:parseFloat(Z.scrollMarginTop)||0,scrollMarginRight:parseFloat(Z.scrollMarginRight)||0,scrollMarginBottom:parseFloat(Z.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(Z.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(Z.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(Z.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(Z.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(Z.scrollPaddingLeft)||0}}var SE="--nested-dialogs";var oE0=A7.open,nE0=A7.closed,sE0=A7.startingStyle,tE0=A7.endingStyle;var IE="data-nested-dialog-open";var JG={...i4,...V2,nestedDialogOpen($){return $?{[IE]:""}:null}};var bE=_(d(),1),HG=RE.forwardRef(function(Z,J){let{render:H,className:B,style:Q,finalFocus:X,initialFocus:z,...G}=Z,K=P2(),U=K.useState("descriptionElementId"),Y=K.useState("disablePointerDismissal"),F=K.useState("floatingRootContext"),W=K.useState("popupProps"),q=K.useState("modal"),N=K.useState("mounted"),A=K.useState("nested"),V=K.useState("nestedOpenDialogCount"),D=K.useState("open"),L=K.useState("openMethod"),j=K.useState("titleElementId"),M=K.useState("transitionStatus"),P=K.useState("role"),w=F.useState("floatingId");$G(),T5({open:D,ref:K.context.popupRef,onComplete(){if(D)K.context.onOpenChangeComplete?.(!0)}});let C=z===void 0?zz(K.context.popupRef):z,R=V>0,O=K.useStateSetter("popupElement"),y=z0("div",Z,{state:{open:D,nested:A,transitionStatus:M,nestedDialogOpen:R},props:[W,{id:w,"aria-labelledby":j,"aria-describedby":U,role:P,...V9,hidden:!N,onKeyDown(k){if(c8.has(k.key))k.stopPropagation()},style:{[SE]:V}},G],ref:[J,K.context.popupRef,O],stateAttributesMapping:JG});return bE.jsx(E7,{context:F,openInteractionType:L,disabled:!N,closeOnFocusOut:!Y,initialFocus:C,returnFocus:X,modal:q!==!1,restoreFocus:"popup",children:y})});var xE=_(p(),1);var kE=_(p(),1),yE=_(d(),1),LZ=kE.forwardRef(function(Z,J){let{cutout:H,...B}=Z,Q;if(H){let X=H.getBoundingClientRect();Q=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${X.left}px ${X.top}px,${X.left}px ${X.bottom}px,${X.right}px ${X.bottom}px,${X.right}px ${X.top}px,${X.left}px ${X.top}px)`}return yE.jsx("div",{ref:J,role:"presentation","data-base-ui-inert":"",...B,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:Q}})});var hH=_(d(),1),BG=xE.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z,Q=P2(),X=Q.useState("mounted"),z=Q.useState("modal"),G=Q.useState("open");if(!(X||H))return null;return hH.jsx(sN.Provider,{value:H,children:hH.jsxs(j7,{ref:J,...B,children:[X&&z===!0&&hH.jsx(LZ,{ref:Q.context.internalBackdropRef,inert:q8(!G)}),Z.children]})})});var iE=_(p(),1);var JV=_(p(),1);var hE={},vE={},gE="";function QG($,Z){return EH($)?$:Z}function fE($,Z,J){return/hidden|clip/.test($.getComputedStyle(QG(Z,J)).overflowY)}function Ce($){if(typeof document>"u")return!1;let Z=m0($);return I1(Z).innerWidth-Z.documentElement.clientWidth>0}function Ee($){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let J=m0($),H=J.documentElement,B=J.body,Q=QG(H,B),X=Q.style.overflowY,z=H.style.scrollbarGutter;H.style.scrollbarGutter="stable",Q.style.overflowY="scroll";let G=Q.offsetWidth;Q.style.overflowY="hidden";let K=Q.offsetWidth;return Q.style.overflowY=X,H.style.scrollbarGutter=z,G===K}function we($){let Z=m0($),J=Z.documentElement,H=Z.body,B=QG(J,H),Q={overflowY:B.style.overflowY,overflowX:B.style.overflowX};return Object.assign(B.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(B.style,Q)}}function Se($){let Z=m0($),J=Z.documentElement,H=Z.body,B=I1(J),Q=0,X=0,z=!1,G=I2.create();if(r1.engine.webkit&&(B.visualViewport?.scale??1)!==1)return()=>{};function K(){let W=B.getComputedStyle(J),q=B.getComputedStyle(H),V=(W.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";Q=J.scrollTop,X=J.scrollLeft,hE={scrollbarGutter:J.style.scrollbarGutter,overflowY:J.style.overflowY,overflowX:J.style.overflowX},gE=J.style.scrollBehavior,vE={position:H.style.position,height:H.style.height,width:H.style.width,boxSizing:H.style.boxSizing,overflowY:H.style.overflowY,overflowX:H.style.overflowX,scrollBehavior:H.style.scrollBehavior};let D=J.scrollHeight>J.clientHeight,L=J.scrollWidth>J.clientWidth,j=W.overflowY==="scroll"||q.overflowY==="scroll",M=W.overflowX==="scroll"||q.overflowX==="scroll",P=Math.max(0,B.innerWidth-H.clientWidth),w=Math.max(0,B.innerHeight-H.clientHeight),C=parseFloat(q.marginTop)+parseFloat(q.marginBottom),R=parseFloat(q.marginLeft)+parseFloat(q.marginRight),O=QG(J,H);if(z=Ee($),z){J.style.scrollbarGutter=V,O.style.overflowY="hidden",O.style.overflowX="hidden";return}if(Object.assign(J.style,{scrollbarGutter:V,overflowY:"hidden",overflowX:"hidden"}),D||j)J.style.overflowY="scroll";if(L||M)J.style.overflowX="scroll";Object.assign(H.style,{position:"relative",height:C||w?`calc(100dvh - ${C+w}px)`:"100dvh",width:R||P?`calc(100vw - ${R+P}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),H.scrollTop=Q,H.scrollLeft=X,J.setAttribute("data-base-ui-scroll-locked",""),J.style.scrollBehavior="unset"}function U(){if(Object.assign(J.style,hE),Object.assign(H.style,vE),!z)J.scrollTop=Q,J.scrollLeft=X,J.removeAttribute("data-base-ui-scroll-locked"),J.style.scrollBehavior=gE}function Y(){U(),G.request(K)}K();let F=o0(B,"resize",Y);return()=>{if(G.cancel(),U(),typeof B.removeEventListener==="function")F()}}class mE{lockCount=0;restore=null;timeoutLock=p5.create();timeoutUnlock=p5.create();acquire($){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock($));return this.release}release=()=>{if(this.lockCount-=1,this.lockCount===0&&this.restore)this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{if(this.lockCount===0&&this.restore)this.restore?.(),this.restore=null};lock($){if(this.lockCount===0||this.restore!==null)return;let Z=m0($),J=Z.documentElement,H=Z.body,B=I1(J);if(fE(B,J,H)){let X=new B.MutationObserver(()=>{if(fE(B,J,H))return;X.disconnect(),this.restore=null,this.lock($)}),z={attributes:!0};X.observe(J,z),X.observe(H,z),this.restore=()=>X.disconnect();return}let Q=r1.os.ios||!Ce($);this.restore=Q?we($):Se($)}}var Ie=new mE;function XG($=!0,Z=null){H0(()=>{if(!$)return;return Ie.acquire(Z)},[$,Z])}function uE({store:$,parentContext:Z,isDrawer:J}){let H=$.useState("open"),B=$.useState("disablePointerDismissal"),Q=$.useState("modal"),X=$.useState("popupElement"),z=$.useState("floatingRootContext"),[G,K]=JV.useState(0),[U,Y]=JV.useState(0),F=G===0,W=v8(z,{outsidePressEvent(){if($.context.internalBackdropRef.current||$.context.backdropRef.current)return"intentional";return{mouse:Q==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(q){if(!$.context.outsidePressEnabledRef.current)return!1;if("button"in q&&q.button!==0)return!1;if("touches"in q){if(q.type==="touchend"){if(q.changedTouches.length!==1||q.touches.length!==0)return!1}else if(q.touches.length!==1)return!1}let N=M1(q);if(F&&!B){if(Q){let A=$.context.internalBackdropRef.current,V=$.context.backdropRef.current;return A||V?A===N||V===N||b0(N,X)&&!N?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:F});return XG(H&&Q===!0,X),$.useContextCallback("onNestedDialogOpen",(q,N)=>{K(q),Y(N)}),H0(()=>{if(Z?.onNestedDialogOpen)if(H)Z.onNestedDialogOpen(G+1,U+(J?1:0));else Z.onNestedDialogOpen(0,0);return()=>{if(Z?.onNestedDialogOpen&&H)Z.onNestedDialogOpen(0,0)}},[J,H,G,U,Z]),P9($,{activeTriggerProps:W.reference,inactiveTriggerProps:W.trigger,popupProps:W.floating,nestedOpenDialogCount:G,nestedOpenDrawerCount:U}),null}var zG=_(p(),1);var pE={...j9,modal:($)=>$.modal,nested:($)=>$.nested,nestedOpenDialogCount:($)=>$.nestedOpenDialogCount,nestedOpenDrawerCount:($)=>$.nestedOpenDrawerCount,disablePointerDismissal:($)=>$.disablePointerDismissal,openMethod:($)=>$.openMethod,descriptionElementId:($)=>$.descriptionElementId,titleElementId:($)=>$.titleElementId,viewportElement:($)=>$.viewportElement,role:($)=>$.role};class HV extends S2{constructor($,Z,J){let H=new L2,B=dE($,H,Z,J);super(B,lE(H),pE)}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;this.state.floatingRootContext.dispatchOpenChange($,Z),this.update(S7(this.state,$,Z.trigger))}}function cE(){let $=new L2;return new u8(Object.freeze(dE(void 0,$)),Object.freeze(lE($)),pE)}function dE($,Z,J,H=!1){return{..._9(Z,J,H),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...$}}function lE($){return{popupRef:zG.createRef(),backdropRef:zG.createRef(),internalBackdropRef:zG.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:$,onOpenChange:void 0,onOpenChangeComplete:void 0}}var vH=_(d(),1);function GG($,Z){let{children:J,open:H,defaultOpen:B=!1,onOpenChange:Q,onOpenChangeComplete:X,disablePointerDismissal:z=!1,modal:G=!0,actionsRef:K,handle:U,triggerId:Y,defaultTriggerId:F=null}=Z,W=$==="drawer",q=$==="alert-dialog",N=q?!0:G,A=q||z,V=q?"alertdialog":"dialog",D=P2(!0),L=D!=null,j={modal:N,disablePointerDismissal:A,nested:L,role:V},M=a3((S,y)=>new HV({open:B,openProp:H,activeTriggerId:F,triggerIdProp:Y,...j},S,y),!0);M.useControlledProp("openProp",H),M.useControlledProp("triggerIdProp",Y),M.useSyncedValues(j),M.useContextCallback("onOpenChange",Q),M.useContextCallback("onOpenChangeComplete",X);let P=M.useState("open"),w=M.useState("mounted"),C=M.useState("payload");Kz(M,P),L9(M);let{forceUnmount:R}=M9(P,M);iE.useImperativeHandle(K,()=>({unmount:R,close:()=>M.setOpen(!1,I0(K0.imperativeAction))}),[R,M]);let O=P||w;return vH.jsxs(nN.Provider,{value:M,children:[U&&vH.jsx(A9,{handle:U,store:M}),O&&vH.jsx(uE,{store:M,parentContext:D?.context,isDrawer:W}),typeof J==="function"?J({payload:C}):J]})}var rE=R8(function(Z){return GG("dialog",Z)});var aE=_(p(),1);var KG=aE.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=$G(),K=P2(),U=K.useState("open"),Y=K.useState("nested"),F=K.useState("transitionStatus"),W=K.useState("nestedOpenDialogCount"),q=K.useState("mounted"),N=K.useStateSetter("viewportElement"),A=W>0;return z0("div",Z,{enabled:G||q,state:{open:U,nested:Y,transitionStatus:F,nestedDialogOpen:A},ref:[J,N],stateAttributesMapping:JG,props:[{role:"presentation",hidden:!q,style:{pointerEvents:!U?"none":void 0},children:X},z]})});var oE=_(p(),1);var UG=oE.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,...z}=Z,G=P2(),K=s0(X);return G.useSyncedValueWithCleanup("titleElementId",K),z0("h2",Z,{ref:J,props:[{id:K},z]})});var eE=_(p(),1);var fH=_(p(),1);var gH=_(p(),1);function nE($){let Z=gH.useRef(""),J=gH.useCallback((B)=>{if(B.defaultPrevented)return;Z.current=B.pointerType,$(B,B.pointerType)},[$]);return{onClick:gH.useCallback((B)=>{if(B.detail===0){$(B,"keyboard");return}if("pointerType"in B)$(B,B.pointerType);else $(B,Z.current);Z.current=""},[$]),onPointerDown:J}}var sE=_(p(),1);function S9($,Z){let J=sE.useRef($),H=U0(Z);H0(()=>{if(J.current!==$)H(J.current);J.current=$},[$,H])}function mH($,Z){let J=U0((Q,X)=>{if(!(typeof $==="function"?$():$))Z(X||(r1.os.ios?"touch":""))}),{onClick:H,onPointerDown:B}=nE(J);return fH.useMemo(()=>({onClick:H,onPointerDown:B}),[H,B])}function tE($){let[Z,J]=fH.useState(null),H=mH($,J);return S9($,(B)=>{if(B&&!$)J(null)}),fH.useMemo(()=>({openMethod:Z,triggerProps:H}),[Z,H])}var YG=U9(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,id:G,payload:K,handle:U,...Y}=Z,F=P2(!0),q=O9(U)??F;if(!q)throw Error(h0(79));let N=s0(G),A=q.useState("floatingRootContext"),V=q.useState("isOpenedByTrigger",N),D=q.useState("triggerPopupId",N),L=eE.useRef(null),{registerTrigger:j,isMountedByThisTrigger:M}=D9(N,L,q,{payload:K}),{getButtonProps:P,buttonRef:w}=O5({disabled:X,native:z}),C=F3(A),R=mH(()=>q.select("open"),(y)=>{q.set("openMethod",y)}),O={disabled:X,open:V},S=q.useState("triggerProps",M);return z0("button",Z,{state:O,ref:[w,J,j,L],props:[C.reference,S,R,{[t$]:"",id:N,"aria-haspopup":"dialog","aria-expanded":V,"aria-controls":D},Y,P],stateAttributesMapping:Y9})});class MZ extends g8{constructor(){super(cE(),"Dialog",!1)}open($){this.openByTrigger($)}openWithPayload($){let Z=this.attachedStore;if(Z===null)return;Z.set("payload",$),Z.setOpen(!0,I0(K0.imperativeAction))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function $w(){return new MZ}var s2=_(d(),1);function $6({...$}){return s2.jsx(d8.Root,{"data-slot":"dialog",...$})}function D3({...$}){return s2.jsx(d8.Trigger,{"data-slot":"dialog-trigger",...$})}function Re({...$}){return s2.jsx(D8,{portal:d8.Portal,"data-slot":"dialog-portal",...$})}function uH({...$}){return s2.jsx(d8.Close,{"data-slot":"dialog-close",...$})}function be({className:$,...Z}){return s2.jsx(d8.Backdrop,{"data-slot":"dialog-overlay",className:G1("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",$),...Z})}function PZ({className:$,children:Z,showCloseButton:J=!0,...H}){return s2.jsxs(Re,{children:[s2.jsx(be,{}),s2.jsxs(d8.Popup,{"data-slot":"dialog-content",className:G1("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-sm text-popover-foreground shadow-xl duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...H,children:[Z,J&&s2.jsxs(uH,{render:s2.jsx(j0,{variant:"ghost",size:"icon-sm",className:"absolute top-4 right-4"}),children:[s2.jsx(a5,{stroke:1.75}),s2.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Z6({className:$,...Z}){return s2.jsx(d8.Title,{"data-slot":"dialog-title",className:G1("text-lg font-semibold",$),...Z})}function _Z({className:$,...Z}){return s2.jsx(d8.Description,{"data-slot":"dialog-description",className:G1("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",$),...Z})}var Mw=_(p(),1);var OG={};I5(OG,{Validity:()=>Dw,Root:()=>Uw,Label:()=>Fw,Item:()=>Lw,Error:()=>Ww,Description:()=>Nw,Control:()=>Vw});var j2=_(p(),1);var FG=_(p(),1);var Zw="data-valid",Jw="data-invalid";var x7={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ye={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Hw={disabled:!1,...ye},_2={valid($){if($===null)return null;if($)return{[Zw]:""};return{[Jw]:""}}};var xe={invalid:void 0,name:void 0,validityData:{state:x7,errors:[],error:"",value:"",initialValue:null},setValidityData:F1,disabled:void 0,setTouched:F1,setDirty:F1,setFilled:F1,setFocused:F1,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:Hw,registerFieldControl:F1,validation:{getValidationProps:($,Z=L1)=>Z,inputRef:{current:null},registeredInputs:new Map,registerInput:F1,getInputControl:()=>null,commit:async()=>{},change:F1}},BV=FG.createContext(xe);function c5($=!0){let Z=FG.useContext(BV);if(Z.setValidityData===F1&&!$)throw Error(h0(28));return Z}var WG=_(p(),1),he=WG.createContext(void 0);function Bw($=!1){let Z=WG.useContext(he);if(!Z&&!$)throw Error(h0(86));return Z}var qG=_(p(),1);var ve=qG.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:F1,validationMode:"onSubmit",submitCountRef:{current:0}});function t2(){return qG.useContext(ve)}var J6=_(p(),1);var NG=_(p(),1);var QV=NG.createContext({controlId:void 0,registerControlId:F1,resetControlId:F1,labelId:void 0,setLabelId:F1,messageIds:[],setMessageIds:F1,getDescriptionProps:($)=>$});function d5(){return NG.useContext(QV)}var Qw=_(d(),1),VG=function(Z){let J=s0(),[H,B]=J6.useState(J),[Q,X]=J6.useState(),[z,G]=J6.useState([]),K=H===void 0?J:H,U=d1(()=>new Map),{messageIds:Y}=d5(),F=U0((A,V)=>{let D=U.current;if(V===void 0)D.delete(A);else D.set(A,V);B((L)=>{if(D.size===0)return L;let j;for(let M of D.values()){if(M===L)return L;if(j===void 0)j=M}return j})}),W=U0(()=>{if(U.current.size===0)B(J)}),q=J6.useCallback((A)=>{let V=A["aria-describedby"]?A["aria-describedby"].split(" "):[];return V.push(...Y,...z),{...A,"aria-describedby":Array.from(new Set(V)).join(" ")||void 0}},[Y,z]),N=J6.useMemo(()=>({controlId:K,registerControlId:F,resetControlId:W,labelId:Q,setLabelId:X,messageIds:z,setMessageIds:G,getDescriptionProps:q}),[K,F,W,Q,X,z,G,q]);return Qw.jsx(QV.Provider,{value:N,children:Z.children})};var L3=_(p(),1);function h7($,Z){return{...$,state:{...$.state,valid:!Z&&$.state.valid}}}var XV=Object.keys(x7);function ge($,Z){if($.matches(":disabled"))return!1;if(!Z||$.form===Z)return!0;return $.form===null&&!$.hasAttribute("form")}function Xw($,Z){let J=null;for(let H of $.keys()){if(!ge(H,Z))continue;if(!H.validity.valid)return H;J??=H}return J}function zw($){return{...x7,valid:!$,customError:$}}function zV($){return $&&$.validationMessage?[$.validationMessage]:[]}function Gw($){let{elementRef:Z,formRef:J}=t2(),{setValidityData:H,validate:B,validityData:Q,validationDebounceTime:X,invalid:z,markedDirtyRef:G,state:K,shouldValidateOnChange:U,validationMode:Y,registeredFieldIdRef:F}=$,{controlId:W,getDescriptionProps:q}=d5(),N=i1(),A=L3.useRef(null),V=d1(()=>new Map).current,D=L3.useRef(0),L=L3.useRef(null),j=L3.useCallback((R,O)=>{return V.set(R,O),()=>{V.delete(R)}},[V]),M=U0(()=>{let R=Xw(V,Z.current);return R&&V.get(R)?.controlRef.current||null}),P=U0(async(R,O=!1)=>{D.current+=1;let S=D.current;function y(l,o=z){let u=F.current??W;if(u==null)return;let c=J.current.fields.get(u);if(!c)return;let n=h7(l,o);J.current.fields.set(u,{...c,validityData:n})}function k(l,o){let u=l.valid===!1?o:[];return{value:R,state:l,error:u[0]??"",errors:u,initialValue:Q.initialValue}}function T(l,o){let u=l.validity.customError?l.validationMessage:"",c=o.replace(/\r\n?/g,`
10
+ `);l.setCustomValidity(c),L.current=[l,c,u]}function b(){let l=L.current;if(L.current=null,l&&(!l[0].willValidate||l[0].validationMessage===l[1]))l[0].setCustomValidity(l[2])}function I(l,o,u){let c=k(l,o);y(c,u),H(c)}function v(l){let o=XV.reduce((c,n)=>{return c[n]=l.validity[n],c},{}),u=!1;for(let c of XV){if(c==="valid")continue;if(c==="valueMissing"&&o[c])u=!0;else if(o[c])return o}if(u&&!G.current)o.valid=!0,o.valueMissing=!1;return o}function h(){return V.size>0?Xw(V,Z.current):A.current}let f=h();function E(){return f=h(),f?.willValidate?v(f):zw(!1)}if(O){if(K.valid!==!1||!f)return;if(!f.validity.valueMissing){b();let l=h(),o=l?.validity.customError?zV(l):[];I(zw(o.length>0),o,!1);return}for(let l of XV)if(l!=="valid"&&l!=="valueMissing"&&l!=="customError"&&f.validity[l])return}N.clear(),b();let i=E(),r=zV(f),x=U();if(r.length===0||x){let l=Array.from(J.current.fields.values()).reduce((c,n)=>{if(n.name)c[n.name]=n.getValue();return c},{}),o=B(R,l),u;if(typeof o==="object"&&o!==null&&"then"in o){if(i.valid===!1)I(i,r);else if(Y==="onSubmit"||!Q.state.customError)i.valid=null,I(i,r);if(u=await o,S!==D.current)return;i=E()}else u=o;if(r=u?[].concat(u).filter(Boolean):[],r.length>0){if(i.valid=!1,i.customError=!0,f?.willValidate)T(f,r.join(`
11
+ `))}else r=zV(f)}I(i,r)}),w=U0((R,O=!1)=>{if(N.clear(),D.current+=1,O)return;let S=U();if(S&&R!==""&&X)N.start(X,()=>{P(R)});else P(R,!S)}),C=L3.useCallback((R,O={})=>M2(q(O),K.valid===!1&&!K.disabled&&!R?{"aria-invalid":!0}:L1),[q,K.disabled,K.valid]);return L3.useMemo(()=>({getValidationProps:C,inputRef:A,registeredInputs:V,registerInput:j,getInputControl:M,commit:P,change:w}),[C,V,j,M,P,w])}var AG=_(p(),1);function Kw($){let{change:Z,commit:J,invalid:H,markedDirtyRef:B,name:Q,setRegisteredFieldName:X,registeredFieldIdRef:z,setValidityData:G,validityData:K}=$,{formRef:U}=t2(),Y=AG.useRef(null),F=AG.useRef(null),W=AG.useRef(!1),q=U0(()=>{let M=F.current;if(!M)return;if(M.getValue)return M.getValue();return M.value});function N(M){return M.value===void 0?q():M.value}let A=U0(()=>{let M=F.current;if(B.current=!0,!M){J(K.value);return}J(N(M))});function V(){let M=F.current;if(!M||!M.id)return;U.current.fields.set(M.id,{getValue:q,name:Q??M.name,controlRef:M.controlRef,validityData:h7(K,H),validate:A})}function D(M=F.current?.id){if(M)U.current.fields.delete(M)}function L(M){if(W.current)return;W.current=!0;let P=N(M);G((w)=>w.initialValue===P?w:{...w,initialValue:P})}H0(()=>{let M=F.current;if(!M||!M.id)return;X(Q?void 0:M.name),U.current.fields.set(M.id,{getValue:q,name:Q??M.name,controlRef:M.controlRef,validityData:h7(K,H),validate:A})},[U,q,H,Q,X,A,K]),H0(()=>{let M=U.current.fields;return()=>{let P=F.current?.id;if(P)M.delete(P)}},[U]);let j=U0((M,P)=>{if(!P){if(Y.current===M)Y.current=null,Z(void 0,!0),D(),F.current=null,X(void 0),z.current=void 0;return}let w=F.current?.id,C=Y.current;if(C&&C!==M)Z(void 0,!0);if(Y.current=M,F.current=P,!Q)X(P.name);if(z.current=P.id,w&&w!==P.id)D(w);L(P),V()});return[A,j]}var DG=_(d(),1),fe=j2.forwardRef(function(Z,J){let{errors:H,validationMode:B,submitCountRef:Q}=t2(),{render:X,className:z,validate:G,validationDebounceTime:K=0,validationMode:U=B,name:Y,disabled:F=!1,invalid:W,dirty:q,touched:N,actionsRef:A,style:V,...D}=Z,L=Bw(!0)?.disabled,j=U0(G||(()=>null)),M=L||F,[P,w]=j2.useState(!1),[C,R]=j2.useState(!1),[O,S]=j2.useState(!1),[y,k]=j2.useState(!1),T=q??C,b=N??P,I=j2.useRef(T),v=j2.useRef(void 0),[h,f]=j2.useState(),E=Y??h;H0(()=>{if(q!==void 0)I.current=q},[q]);let i=U0((Y0)=>{if(q!==void 0)return;if(Y0)I.current=!0;R(Y0)}),r=U0((Y0)=>{if(N!==void 0)return;w(Y0)}),x=U0(()=>U==="onChange"||U==="onSubmit"&&Q.current>0),l=E&&Object.hasOwn(H,E)?H[E]:null,o=!!(Array.isArray(l)?l.length:l),u=W===!0||o,[c,n]=j2.useState({state:x7,error:"",errors:[],value:null,initialValue:null}),Z0=!u&&(M?null:c.state.valid),J0=j2.useMemo(()=>({disabled:M,touched:b,dirty:T,valid:Z0,filled:O,focused:y}),[M,b,T,Z0,O,y]),X0=Gw({setValidityData:n,validate:j,validityData:c,validationDebounceTime:K,invalid:u,markedDirtyRef:I,state:J0,shouldValidateOnChange:x,validationMode:U,registeredFieldIdRef:v}),[Q0,F0]=Kw({change:X0.change,commit:X0.commit,invalid:u,markedDirtyRef:I,name:Y,setRegisteredFieldName:f,registeredFieldIdRef:v,setValidityData:n,validityData:c});j2.useImperativeHandle(A,()=>({validate:Q0}),[Q0]);let A0=j2.useMemo(()=>({invalid:u,name:E,validityData:c,setValidityData:n,disabled:M,setTouched:r,setDirty:i,setFilled:S,setFocused:k,validationMode:U,shouldValidateOnChange:x,state:J0,registerFieldControl:F0,validation:X0}),[u,E,c,M,r,i,S,k,U,x,J0,F0,X0]),N0=z0("div",Z,{ref:J,state:J0,props:D,stateAttributesMapping:_2});return DG.jsx(BV.Provider,{value:A0,children:N0})}),Uw=j2.forwardRef(function(Z,J){return DG.jsx(VG,{children:DG.jsx(fe,{...Z,ref:J})})});var pH=_(p(),1);function Yw($,Z){let J=s0($);return H0(()=>{return Z(J),()=>{Z((H)=>H===J?void 0:H)}},[J,Z]),J}function LG($={}){let{id:Z,fallbackControlId:J,native:H=!1,setLabelId:B,focusControl:Q}=$,{controlId:X,setLabelId:z}=d5(),G=U0((W)=>{z(W),B?.(W)}),K=Yw(Z,G),U=X??J;function Y(W){if(Q){Q(W,U);return}if(!U)return;let q=m0(W.currentTarget).getElementById(U);if(P1(q))MG(q)}function F(W){if(M1(W.nativeEvent)?.closest("button,input,select,textarea"))return;if(!W.defaultPrevented&&W.detail>1)W.preventDefault();if(H)return;Y(W)}return H?{id:K,htmlFor:U,onMouseDown:F}:{id:K,onClick:F,onPointerDown(W){W.preventDefault()}}}function MG($){$.focus({focusVisible:!0})}var PG=_(p(),1),GV=PG.createContext({disabled:!1});function jZ(){return PG.useContext(GV)}var Fw=pH.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,nativeLabel:z=!0,...G}=Z,K=c5(!1),U=jZ(),{labelId:Y}=d5(),F={...K.state,disabled:K.disabled||U.disabled},W=pH.useRef(null),q=LG({id:Y??X,native:z});return z0("label",Z,{ref:[J,W],state:F,props:[q,G],stateAttributesMapping:_2})});var v7=_(p(),1);var KV=_(d(),1),me={..._2,...V2},Ww=v7.forwardRef(function(Z,J){let{render:H,id:B,className:Q,match:X,style:z,...G}=Z,K=s0(B),{validityData:U,state:Y,name:F}=c5(!1),{setMessageIds:W}=d5(),{errors:q}=t2(),N=F&&Object.hasOwn(q,F)?q[F]:null,A=!!(Array.isArray(N)?N.length:N),V=typeof X==="string",D=!1;if(X===!0)D=!0;else if(Y.disabled)D=!1;else if(V)D=Boolean(U.state[X]);else D=A||U.state.valid===!1;let{mounted:L,transitionStatus:j,setMounted:M}=a2(D);H0(()=>{if(!D||!K)return;return W((I)=>I.concat(K)),()=>{W((I)=>I.filter((v)=>v!==K))}},[D,K,W]);let P=v7.useRef(null),[w,C]=v7.useState(null),[R,O]=v7.useState(null),S=U.error;if(!V&&A)S=N;else if(U.errors.length>1)S=U.errors;let y=S;if(Array.isArray(S))y=S.length>1?KV.jsx("ul",{children:S.map((I)=>KV.jsx("li",{children:I},I))}):S[0];let k=Array.isArray(S)?JSON.stringify(S):S;if(D&&k!==R)O(k),C(y);T5({open:D,ref:P,onComplete(){if(!D)M(!1)}});let T={...Y,transitionStatus:j},b=z0("div",Z,{ref:[J,P],state:T,props:[{id:K,children:D?y:w},G],stateAttributesMapping:me,enabled:L});if(!L)return null;return b});var qw=_(p(),1);var Nw=qw.forwardRef(function(Z,J){let{render:H,id:B,className:Q,style:X,...z}=Z,G=s0(B),K=c5(!1),U=jZ(),{setMessageIds:Y}=d5(),F={...K.state,disabled:K.disabled||U.disabled};return H0(()=>{if(!G)return;return Y((q)=>q.concat(G)),()=>{Y((q)=>q.filter((N)=>N!==G))}},[G,Y]),z0("p",Z,{ref:J,state:F,props:[{id:G},z],stateAttributesMapping:_2})});var _G=_(p(),1);var g7=_(p(),1);function e2({controlled:$,default:Z,name:J,state:H="value"}){let{current:B}=g7.useRef($!==void 0),[Q,X]=g7.useState(Z),z=B&&$!==void 0?$:Q,G=g7.useCallback((K)=>{if(!B)X(K)},[]);return[z,G]}function H6($,Z,J,H,B=!0,Q){let{registerFieldControl:X}=c5(),z=d1(()=>Symbol());H0(()=>{let G=z.current;if(!B){X(G,void 0);return}X(G,{controlRef:$,getValue:H,id:Z,name:Q,value:J})},[$,B,H,Z,Q,X,z,J]),H0(()=>{let G=z.current;return()=>{X(G,void 0)}},[X,z])}var UV=_(p(),1);function B6($={}){let{id:Z,enabled:J=!0}=$,{controlId:H,registerControlId:B,resetControlId:Q}=d5(),X=s0(),z=d1(()=>Symbol()),G=UV.useRef(!1),K=UV.useRef(!1),U=U0(()=>{if(!G.current||B===F1)return;G.current=!1,B(z.current,void 0)});return H0(()=>{if(!J||B===F1){U();return}let Y;if(Z!==void 0)K.current=!0,Y=Z;else if(K.current)Y=X;else{Q();return}if(Y===void 0){U();return}G.current=!0,B(z.current,Y);return},[Z,J,B,Q,X,z,U]),H0(()=>{return U},[U]),(J?H:void 0)??Z??X}var Vw=_G.forwardRef(function(Z,J){let{render:H,className:B,id:Q,name:X,value:z,disabled:G=!1,onValueChange:K,defaultValue:U,autoFocus:Y=!1,style:F,...W}=Z,{state:q,name:N,disabled:A,setTouched:V,setDirty:D,validityData:L,setFocused:j,setFilled:M,validationMode:P,validation:w}=c5(),{clearErrors:C,elementRef:R,submitCountRef:O}=t2(),S=A||G,y=N??X,k={...q,disabled:S},{labelId:T}=d5(),b=B6({id:Q}),[I]=e2({controlled:z,default:U,name:"FieldControl",state:"value"}),v=z!==void 0,h=v?I:void 0,f=h==null?void 0:String(h),E=U0(()=>w.inputRef.current?.value);H6(w.inputRef,b,f,E,!S,X),H0(()=>{let l=f??w.inputRef.current?.value;if(l!==void 0)M(l!=="")},[f,w.inputRef,M]),S9(f,()=>{if(f===void 0)return;C(y),D(f!==(L.initialValue??"")),w.change(f)});let i=_G.useRef(null),r=i1();return H0(()=>{if(Y&&i.current===p1(m0(i.current)))j(!0)},[Y,j]),z0("input",Z,{ref:[J,i],state:k,props:[{id:b,disabled:S,name:y,ref:w.inputRef,"aria-labelledby":T,autoFocus:Y,...v?{value:h}:{defaultValue:U},onChange(l){let o=l.currentTarget.value,u=I0(K0.none,l.nativeEvent);if(K?.(o,u),v)return;if(D(o!==(L.initialValue??"")),M(o!==""),!l.nativeEvent.defaultPrevented&&!u.isCanceled)C(y),w.change(o)},onFocus(){j(!0)},onBlur(l){if(V(!0),j(!1),P==="onBlur"){let o=l.currentTarget.value;if(w.commit(o),v)queueMicrotask(()=>{let u=w.inputRef.current?.value;if(u!==void 0&&u!==o&&u!==(L.initialValue??""))w.commit(u)})}},onKeyDown(l){if(l.currentTarget.tagName==="INPUT"&&l.key==="Enter"){V(!0);let o=l.currentTarget.value,u=l.currentTarget.form;if(u&&u===R.current&&!l.defaultPrevented){let c=l.currentTarget,n=O.current;r.start(0,()=>{if(O.current===n)w.commit(c.value)})}else w.commit(o)}}},W,(l)=>w.getValidationProps(S,l)],stateAttributesMapping:_2})});var cH=_(p(),1);var Aw=_(d(),1),Dw=function(Z){let{children:J}=Z,{validityData:H,invalid:B}=c5(!1),Q=cH.useMemo(()=>h7(H,B),[H,B]),X=Q.state.valid===!1,{transitionStatus:z}=a2(X),G=cH.useMemo(()=>{return{...Q,validity:Q.state,transitionStatus:z}},[Q,z]);return Aw.jsx(cH.Fragment,{children:J(G)})};var jG=_(p(),1);var YV=_(d(),1),Lw=jG.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,...z}=Z,{state:G,disabled:K}=c5(!1),U=K||X,Y={...G,disabled:U},F=jG.useMemo(()=>({disabled:U}),[U]),W=z0("div",Z,{ref:J,state:Y,props:z,stateAttributesMapping:_2});return YV.jsx(VG,{children:YV.jsx(GV.Provider,{value:F,children:W})})});var Pw=_(d(),1),dH=Mw.forwardRef(function(Z,J){return Pw.jsx(OG.Control,{ref:J,...Z})});var _w=_(d(),1);function f7({className:$,type:Z,...J}){return _w.jsx(dH,{type:Z,"data-slot":"input",className:G1("h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",$),...J})}function jw($){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 OZ=["claude-code","codex","openclaw","hermes"];var TZ=_(p(),1);var TG="/claude-z2xnay0d.svg";var Ow="/floppy-disk-wmjs0n85.webp";var CG="/hermes-pznd63x9.png";var EG="/openai-ep9ht2pq.svg";var wG="/openclaw-a2pyfhpn.svg";var K1=_(d(),1),Sw="Set up the moi workspace for this project. Fetch https://moi.computer/INSTALL.md, and follow the steps.";function CZ({trigger:$,open:Z,onOpenChange:J}){return K1.jsxs($6,{open:Z,onOpenChange:J,children:[$&&K1.jsx(D3,{render:$}),K1.jsx(ae,{})]})}var Tw=2;function ie({demoInstallUrl:$}){let Z=TZ.useRef(null);return K1.jsx("div",{className:"relative min-h-56 overflow-hidden md:min-h-full",onMouseMove:(B)=>{if(!Z.current)return;let Q=B.currentTarget.getBoundingClientRect(),X=(B.clientX-Q.left)/Q.width-0.5,z=(B.clientY-Q.top)/Q.height-0.5;Z.current.style.setProperty("--floppy-x",`${X*-2*Tw}px`),Z.current.style.setProperty("--floppy-y",`${z*-2*Tw}px`)},onMouseLeave:()=>{Z.current?.style.removeProperty("--floppy-x"),Z.current?.style.removeProperty("--floppy-y")},children:K1.jsxs("a",{ref:Z,href:$,target:"_blank",rel:"noreferrer",className:"group absolute top-1/2 left-1/2 w-44 -translate-x-1/2 -translate-y-1/2 rotate-4 [transform:translate3d(var(--floppy-x,0px),var(--floppy-y,0px),0)] rounded-lg transition-transform duration-150 ease-out will-change-transform outline-none focus-visible:ring-3 focus-visible:ring-ring/50 motion-reduce:transform-none motion-reduce:transition-none md:w-40",children:[K1.jsx("img",{src:Ow,alt:"",className:"w-full drop-shadow-xl"}),K1.jsxs("div",{className:m7({variant:"outline",className:"absolute -right-3 -bottom-2 -rotate-8"}),children:["About moi",K1.jsx(Cw,{"data-icon":"inline-end",stroke:1.5})]})]})})}function re(){let[$,Z]=TZ.useState(!1);return TZ.useEffect(()=>{if(!$)return;let H=setTimeout(()=>Z(!1),1500);return()=>clearTimeout(H)},[$]),{copied:$,copy:()=>{navigator.clipboard?.writeText(Sw).then(()=>Z(!0)).catch(()=>{})}}}function ae(){let{demoInstallUrl:$}=I9(),{copied:Z,copy:J}=re();return K1.jsxs(PZ,{"data-vivid":!0,showCloseButton:!1,className:"block w-full max-w-md overflow-hidden rounded-2xl bg-primary texture-checker-16 p-2 text-primary-foreground sm:max-w-md md:max-w-2xl",children:[K1.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(to_right,color-mix(in_oklch,var(--background)_14%,transparent),color-mix(in_oklch,var(--background)_6%,transparent))]"}),K1.jsxs("svg",{className:"pointer-events-none absolute inset-0 size-full opacity-30 mix-blend-soft-light","aria-hidden":"true",children:[K1.jsx("filter",{id:"floppy-grain",children:K1.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.8",numOctaves:"2",stitchTiles:"stitch"})}),K1.jsx("rect",{width:"100%",height:"100%",filter:"url(#floppy-grain)"})]}),K1.jsxs("div",{className:"relative grid max-h-[calc(100dvh-2rem)] overflow-y-auto md:grid-cols-[3fr_2fr] md:overflow-visible",children:[K1.jsxs("div",{className:"rounded-xl bg-background p-6 text-foreground shadow-sm md:p-8",children:[K1.jsxs("div",{className:"flex flex-col gap-0.5",children:[K1.jsx(Z6,{children:"Unlock all features"}),K1.jsx(_Z,{className:"mt-1",children:"This is a demo version with sample workspaces. Install moi locally and connect to your agent."})]}),K1.jsxs("ul",{className:"mt-4 flex flex-col gap-3",children:[K1.jsxs("li",{className:"flex items-center gap-3",children:[K1.jsx(Ew,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),K1.jsx("span",{className:"text-sm text-foreground",children:"Connect your own data sources and work on existing projects"})]}),K1.jsxs("li",{className:"flex items-center gap-3",children:[K1.jsx(ww,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),K1.jsxs("span",{className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-sm text-foreground",children:[K1.jsx("span",{children:"Build with"}),K1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[K1.jsx("img",{src:TG,alt:"",className:"size-3.5 object-contain"}),"Claude Code,"]}),K1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[K1.jsx("img",{src:EG,alt:"",className:"size-3.5 object-contain"}),"Codex,"]}),K1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[K1.jsx("img",{src:CG,alt:"",className:"size-3.5 object-contain"}),"Hermes,"]}),K1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[K1.jsx("img",{src:wG,alt:"",className:"size-3.5 object-contain"}),"OpenClaw,"]}),K1.jsx("span",{children:"and more"})]})]})]}),K1.jsxs("div",{className:"mt-8 flex flex-col gap-3 pb-4",children:[K1.jsx("p",{className:"text-sm text-muted-foreground",children:"Give this prompt to your agent:"}),K1.jsxs("div",{className:"relative rounded-lg bg-muted p-4 pb-8 ring-1 ring-border",children:[K1.jsx("code",{className:"block font-mono text-sm leading-relaxed text-foreground",children:Sw}),K1.jsxs(j0,{type:"button",onClick:J,className:"absolute right-4 -bottom-4",children:[Z?K1.jsx(L8,{"data-icon":"inline-start",stroke:1.5}):K1.jsx(SG,{"data-icon":"inline-start",stroke:1.5}),Z?"Copied":"Copy prompt"]})]})]})]}),K1.jsx(ie,{demoInstallUrl:$})]}),K1.jsx(uH,{render:K1.jsx(j0,{variant:"outline",size:"icon","aria-label":"Close",className:"absolute top-4 right-4",children:K1.jsx(a5,{stroke:1.5})})})]})}var tI=_(p(),1);var nI=_(p(),1);var lH=["rocket","sparkles","bolt","flame","star","heart","diamond","trophy","target","bulb","brain","robot","wand","atom","flask","cpu","code","terminal","api","database","cube","hexagon","plug","tool","settings","dots","bug","activity","chart","briefcase","folder","file","book","message","mail","bell","paperclip","key","shield","user","home","globe","world","planet","compass","map","calendar","cloud","sun","moon","snowflake","leaf","mountain","feather","ghost","music","piano","camera","photo","palette","gamepad","gift","cart","chef"],oe=new Set(lH);function Iw($){return oe.has($)}var yS={rocket:MS,sparkles:OS,bolt:iH,flame:ew,star:TS,heart:QS,diamond:sw,trophy:IS,target:ES,bulb:fw,brain:hw,robot:LS,wand:bS,atom:kw,flask:$S,cpu:rw,code:lw,terminal:wS,api:bw,database:ow,cube:aw,hexagon:XS,plug:DS,tool:SS,settings:Q6,dots:IG,bug:gw,activity:Rw,chart:pw,briefcase:vw,folder:ZS,file:EZ,book:xw,message:YS,mail:KS,bell:yw,paperclip:bG,key:RG,shield:PS,user:RS,home:zS,globe:BS,world:kS,planet:AS,compass:iw,map:US,calendar:mw,cloud:dw,sun:CS,moon:FS,snowflake:jS,leaf:GS,mountain:WS,feather:tw,ghost:JS,music:qS,piano:kG,camera:uw,photo:VS,palette:NS,gamepad:nw,gift:HS,cart:_S,chef:cw},xS=lH.map(($)=>({id:$,Icon:yS[$]}));function u7($){return $&&Iw($)?yS[$]:null}var ne=($,Z)=>{if(typeof $!=="number")return;if(Z===3)return{mode:"rgb",r:($>>8&15|$>>4&240)/255,g:($>>4&15|$&240)/255,b:($&15|$<<4&240)/255};if(Z===4)return{mode:"rgb",r:($>>12&15|$>>8&240)/255,g:($>>8&15|$>>4&240)/255,b:($>>4&15|$&240)/255,alpha:($&15|$<<4&240)/255};if(Z===6)return{mode:"rgb",r:($>>16&255)/255,g:($>>8&255)/255,b:($&255)/255};if(Z===8)return{mode:"rgb",r:($>>24&255)/255,g:($>>16&255)/255,b:($>>8&255)/255,alpha:($&255)/255}},yG=ne;var se={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},hS=se;var te=($)=>{return yG(hS[$.toLowerCase()],6)},vS=te;var ee=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,$00=($)=>{let Z;return(Z=$.match(ee))?yG(parseInt(Z[1],16),Z[1].length):void 0},gS=$00;var xG="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";var p7="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%";var rH="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var fS="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(deg|grad|rad|turn)|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var X6="\\s*,\\s*";var ob0=new RegExp("^(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)|none)$");var Z00=new RegExp(`^rgba?\\(\\s*${xG}${X6}${xG}${X6}${xG}\\s*(?:,\\s*${rH}\\s*)?\\)$`),J00=new RegExp(`^rgba?\\(\\s*${p7}${X6}${p7}${X6}${p7}\\s*(?:,\\s*${rH}\\s*)?\\)$`),H00=($)=>{let Z={mode:"rgb"},J;if(J=$.match(Z00)){if(J[1]!==void 0)Z.r=J[1]/255;if(J[2]!==void 0)Z.g=J[2]/255;if(J[3]!==void 0)Z.b=J[3]/255}else if(J=$.match(J00)){if(J[1]!==void 0)Z.r=J[1]/100;if(J[2]!==void 0)Z.g=J[2]/100;if(J[3]!==void 0)Z.b=J[3]/100}else return;if(J[4]!==void 0)Z.alpha=Math.max(0,Math.min(1,J[4]/100));else if(J[5]!==void 0)Z.alpha=Math.max(0,Math.min(1,+J[5]));return Z},mS=H00;var B00=($,Z)=>$===void 0?void 0:typeof $!=="object"?pS($):$.mode!==void 0?$:Z?{...$,mode:Z}:void 0,uS=B00;var Q00=($="rgb")=>(Z)=>(Z=uS(Z,$))!==void 0?Z.mode===$?Z:l8[Z.mode][$]?l8[Z.mode][$](Z):$==="rgb"?l8[Z.mode].rgb(Z):l8.rgb[$](l8[Z.mode].rgb(Z)):void 0,hG=Q00;var l8={},cS={},aH=[],FV={},X00=($)=>$,$5=($)=>{if(l8[$.mode]={...l8[$.mode],...$.toMode},Object.keys($.fromMode||{}).forEach((Z)=>{if(!l8[Z])l8[Z]={};l8[Z][$.mode]=$.fromMode[Z]}),!$.ranges)$.ranges={};if(!$.difference)$.difference={};return $.channels.forEach((Z)=>{if($.ranges[Z]===void 0)$.ranges[Z]=[0,1];if(!$.interpolate[Z])throw Error(`Missing interpolator for: ${Z}`);if(typeof $.interpolate[Z]==="function")$.interpolate[Z]={use:$.interpolate[Z]};if(!$.interpolate[Z].fixup)$.interpolate[Z].fixup=X00}),cS[$.mode]=$,($.parse||[]).forEach((Z)=>{z00(Z,$.mode)}),hG($.mode)},dS=($)=>cS[$],z00=($,Z)=>{if(typeof $==="string"){if(!Z)throw Error("'mode' required when 'parser' is a string");FV[$]=Z}else if(typeof $==="function"){if(aH.indexOf($)<0)aH.push($)}};var WV=/[^\x00-\x7F]|[a-zA-Z_]/,G00=/[^\x00-\x7F]|[-\w]/,O0={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},U1=0;function vG($){let Z=$[U1],J=$[U1+1];if(Z==="-"||Z==="+")return/\d/.test(J)||J==="."&&/\d/.test($[U1+2]);if(Z===".")return/\d/.test(J);return/\d/.test(Z)}function qV($){if(U1>=$.length)return!1;let Z=$[U1];if(WV.test(Z))return!0;if(Z==="-"){if($.length-U1<2)return!1;let J=$[U1+1];if(J==="-"||WV.test(J))return!0;return!1}return!1}var K00={deg:1,rad:180/Math.PI,grad:0.9,turn:360};function oH($){let Z="";if($[U1]==="-"||$[U1]==="+")Z+=$[U1++];if(Z+=gG($),$[U1]==="."&&/\d/.test($[U1+1]))Z+=$[U1++]+gG($);if($[U1]==="e"||$[U1]==="E"){if(($[U1+1]==="-"||$[U1+1]==="+")&&/\d/.test($[U1+2]))Z+=$[U1++]+$[U1++]+gG($);else if(/\d/.test($[U1+1]))Z+=$[U1++]+gG($)}if(qV($)){let J=fG($);if(J==="deg"||J==="rad"||J==="turn"||J==="grad")return{type:O0.Hue,value:Z*K00[J]};return}if($[U1]==="%")return U1++,{type:O0.Percentage,value:+Z};return{type:O0.Number,value:+Z}}function gG($){let Z="";while(/\d/.test($[U1]))Z+=$[U1++];return Z}function fG($){let Z="";while(U1<$.length&&G00.test($[U1]))Z+=$[U1++];return Z}function U00($){let Z=fG($);if($[U1]==="(")return U1++,{type:O0.Function,value:Z};if(Z==="none")return{type:O0.None,value:void 0};return{type:O0.Ident,value:Z}}function Y00($=""){let Z=$.trim(),J=[],H;U1=0;while(U1<Z.length){if(H=Z[U1++],H===`
12
+ `||H==="\t"||H===" "){while(U1<Z.length&&(Z[U1]===`
13
+ `||Z[U1]==="\t"||Z[U1]===" "))U1++;continue}if(H===",")return;if(H===")"){J.push({type:O0.ParenClose});continue}if(H==="+"){if(U1--,vG(Z)){J.push(oH(Z));continue}return}if(H==="-"){if(U1--,vG(Z)){J.push(oH(Z));continue}if(qV(Z)){J.push({type:O0.Ident,value:fG(Z)});continue}return}if(H==="."){if(U1--,vG(Z)){J.push(oH(Z));continue}return}if(H==="/"){while(U1<Z.length&&(Z[U1]===`
14
+ `||Z[U1]==="\t"||Z[U1]===" "))U1++;let B;if(vG(Z)){if(B=oH(Z),B.type!==O0.Hue){J.push({type:O0.Alpha,value:B});continue}}if(qV(Z)){if(fG(Z)==="none"){J.push({type:O0.Alpha,value:{type:O0.None,value:void 0}});continue}}return}if(/\d/.test(H)){U1--,J.push(oH(Z));continue}if(WV.test(H)){U1--,J.push(U00(Z));continue}return}return J}function F00($){$._i=0;let Z=$[$._i++];if(!Z||Z.type!==O0.Function||Z.value!=="color")return;if(Z=$[$._i++],Z.type!==O0.Ident)return;let J=FV[Z.value];if(!J)return;let H={mode:J},B=lS($,!1);if(!B)return;let Q=dS(J).channels;for(let X=0,z,G;X<Q.length;X++)if(z=B[X],G=Q[X],z.type!==O0.None){if(H[G]=z.type===O0.Number?z.value:z.value/100,G==="alpha")H[G]=Math.max(0,Math.min(1,H[G]))}return H}function lS($,Z){let J=[],H;while($._i<$.length){if(H=$[$._i++],H.type===O0.None||H.type===O0.Number||H.type===O0.Alpha||H.type===O0.Percentage||Z&&H.type===O0.Hue){J.push(H);continue}if(H.type===O0.ParenClose){if($._i<$.length)return;continue}return}if(J.length<3||J.length>4)return;if(J.length===4){if(J[3].type!==O0.Alpha)return;J[3]=J[3].value}if(J.length===3)J.push({type:O0.None,value:void 0});return J.every((B)=>B.type!==O0.Alpha)?J:void 0}function W00($,Z){$._i=0;let J=$[$._i++];if(!J||J.type!==O0.Function)return;let H=lS($,Z);if(!H)return;return H.unshift(J.value),H}var q00=($)=>{if(typeof $!=="string")return;let Z=Y00($),J=Z?W00(Z,!0):void 0,H=void 0,B=0,Q=aH.length;while(B<Q)if((H=aH[B++]($,J))!==void 0)return H;return Z?F00(Z):void 0},pS=q00;function N00($,Z){if(!Z||Z[0]!=="rgb"&&Z[0]!=="rgba")return;let J={mode:"rgb"},[,H,B,Q,X]=Z;if(H.type===O0.Hue||B.type===O0.Hue||Q.type===O0.Hue)return;if(H.type!==O0.None)J.r=H.type===O0.Number?H.value/255:H.value/100;if(B.type!==O0.None)J.g=B.type===O0.Number?B.value/255:B.value/100;if(Q.type!==O0.None)J.b=Q.type===O0.Number?Q.value/255:Q.value/100;if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var iS=N00;var V00=($)=>$==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,rS=V00;var aS=($,Z,J)=>$+J*(Z-$);var A00=($)=>{let Z=[];for(let J=0;J<$.length-1;J++){let H=$[J],B=$[J+1];if(H===void 0&&B===void 0)Z.push(void 0);else if(H!==void 0&&B!==void 0)Z.push([H,B]);else Z.push(H!==void 0?[H,H]:[B,B])}return Z},oS=($)=>(Z)=>{let J=A00(Z);return(H)=>{let B=H*J.length,Q=H>=1?J.length-1:Math.max(Math.floor(B),0),X=J[Q];return X===void 0?void 0:$(X[0],X[1],B-Q)}};var E0=oS(aS);var y1=($)=>{let Z=!1,J=$.map((H)=>{if(H!==void 0)return Z=!0,H;return 1});return Z?J:$};var D00={mode:"rgb",channels:["r","g","b","alpha"],parse:[iS,gS,mS,vS,rS,"srgb"],serialize:"srgb",interpolate:{r:E0,g:E0,b:E0,alpha:{use:E0,fixup:y1}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},M8=D00;var NV=($=0)=>Math.pow(Math.abs($),2.19921875)*Math.sign($),L00=($)=>{let Z=NV($.r),J=NV($.g),H=NV($.b),B={mode:"xyz65",x:0.5766690429101305*Z+0.1855582379065463*J+0.1882286462349947*H,y:0.297344975250536*Z+0.6273635662554661*J+0.0752914584939979*H,z:0.0270313613864123*Z+0.0706888525358272*J+0.9913375368376386*H};if($.alpha!==void 0)B.alpha=$.alpha;return B},VV=L00;var AV=($)=>Math.pow(Math.abs($),0.4547069271758437)*Math.sign($),M00=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"a98",r:AV($*2.0415879038107465-Z*0.5650069742788597-0.3447313507783297*J),g:AV($*-0.9692436362808798+Z*1.8759675015077206+0.0415550574071756*J),b:AV($*0.0134442806320312-Z*0.1183623922310184+1.0151749943912058*J)};if(H!==void 0)B.alpha=H;return B},DV=M00;var LV=($=0)=>{let Z=Math.abs($);if(Z<=0.04045)return $/12.92;return(Math.sign($)||1)*Math.pow((Z+0.055)/1.055,2.4)},P00=({r:$,g:Z,b:J,alpha:H})=>{let B={mode:"lrgb",r:LV($),g:LV(Z),b:LV(J)};if(H!==void 0)B.alpha=H;return B},P8=P00;var _00=($)=>{let{r:Z,g:J,b:H,alpha:B}=P8($),Q={mode:"xyz65",x:0.4123907992659593*Z+0.357584339383878*J+0.1804807884018343*H,y:0.2126390058715102*Z+0.715168678767756*J+0.0721923153607337*H,z:0.0193308187155918*Z+0.119194779794626*J+0.9505321522496607*H};if(B!==void 0)Q.alpha=B;return Q},x4=_00;var MV=($=0)=>{let Z=Math.abs($);if(Z>0.0031308)return(Math.sign($)||1)*(1.055*Math.pow(Z,0.4166666666666667)-0.055);return $*12.92},j00=({r:$,g:Z,b:J,alpha:H},B="rgb")=>{let Q={mode:B,r:MV($),g:MV(Z),b:MV(J)};if(H!==void 0)Q.alpha=H;return Q},_8=j00;var O00=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=_8({r:$*3.2409699419045226-Z*1.537383177570094-0.4986107602930034*J,g:$*-0.9692436362808796+Z*1.8759675015077204+0.0415550574071756*J,b:$*0.0556300796969936-Z*0.2039769588889765+1.0569715142428784*J});if(H!==void 0)B.alpha=H;return B},h4=O00;var T00={...M8,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:($)=>DV(x4($)),xyz65:DV},toMode:{rgb:($)=>h4(VV($)),xyz65:VV}},nS=T00;var C00=($)=>($=$%360)<0?$+360:$,N5=C00;var E00=($,Z)=>{return $.map((J,H,B)=>{if(J===void 0)return J;let Q=N5(J);if(H===0||$[H-1]===void 0)return Q;return Z(Q-N5(B[H-1]))}).reduce((J,H)=>{if(!J.length||H===void 0||J[J.length-1]===void 0)return J.push(H),J;return J.push(H+J[J.length-1]),J},[])},O2=($)=>E00($,(Z)=>Math.abs(Z)<=180?Z:Z-360*Math.sign(Z));var H2=[-0.14861,1.78277,-0.29227,-0.90649,1.97294,0],sS=Math.PI/180,tS=180/Math.PI;var eS=H2[3]*H2[4],$I=H2[1]*H2[4],ZI=H2[1]*H2[2]-H2[0]*H2[3],w00=({r:$,g:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=(ZI*J+$*eS-Z*$I)/(ZI+eS-$I),Q=J-B,X=(H2[4]*(Z-B)-H2[2]*Q)/H2[3],z={mode:"cubehelix",l:B,s:B===0||B===1?void 0:Math.sqrt(Q*Q+X*X)/(H2[4]*B*(1-B))};if(z.s)z.h=Math.atan2(X,Q)*tS-120;if(H!==void 0)z.alpha=H;return z},JI=w00;var S00=({h:$,s:Z,l:J,alpha:H})=>{let B={mode:"rgb"};if($=($===void 0?0:$+120)*sS,J===void 0)J=0;let Q=Z===void 0?0:Z*J*(1-J),X=Math.cos($),z=Math.sin($);if(B.r=J+Q*(H2[0]*X+H2[1]*z),B.g=J+Q*(H2[2]*X+H2[3]*z),B.b=J+Q*(H2[4]*X+H2[5]*z),H!==void 0)B.alpha=H;return B},HI=S00;var z6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.s||!Z.s)return 0;let J=N5($.h),H=N5(Z.h),B=Math.sin((H-J+360)/2*Math.PI/180);return 2*Math.sqrt($.s*Z.s)*B},BI=($,Z)=>{if($.h===void 0||Z.h===void 0)return 0;let J=N5($.h),H=N5(Z.h);if(Math.abs(H-J)>180)return J-(H-360*Math.sign(H-J));return H-J},G6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.c||!Z.c)return 0;let J=N5($.h),H=N5(Z.h),B=Math.sin((H-J+360)/2*Math.PI/180);return 2*Math.sqrt($.c*Z.c)*B};var T2=($)=>{let Z=$.reduce((H,B)=>{if(B!==void 0){let Q=B*Math.PI/180;H.sin+=Math.sin(Q),H.cos+=Math.cos(Q)}return H},{sin:0,cos:0}),J=Math.atan2(Z.sin,Z.cos)*180/Math.PI;return J<0?360+J:J};var I00={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:JI},toMode:{rgb:HI},interpolate:{h:{use:E0,fixup:O2},s:E0,l:E0,alpha:{use:E0,fixup:y1}},difference:{h:z6},average:{h:T2}},QI=I00;var R00=({l:$,a:Z,b:J,alpha:H},B="lch")=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=Math.sqrt(Z*Z+J*J),X={mode:B,l:$,c:Q};if(Q)X.h=N5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)X.alpha=H;return X},t4=R00;var b00=({l:$,c:Z,h:J,alpha:H},B="lab")=>{if(J===void 0)J=0;let Q={mode:B,l:$,a:Z?Z*Math.cos(J/180*Math.PI):0,b:Z?Z*Math.sin(J/180*Math.PI):0};if(H!==void 0)Q.alpha=H;return Q},e4=b00;var mG=Math.pow(29,3)/Math.pow(3,3),uG=Math.pow(6,3)/Math.pow(29,3);var g5={X:0.9642956764295677,Y:1,Z:0.8251046025104602},K6={X:0.9504559270516716,Y:1,Z:1.0890577507598784},Gy0=Math.pow(29,3)/Math.pow(3,3),Ky0=Math.pow(6,3)/Math.pow(29,3);var PV=($)=>Math.pow($,3)>uG?Math.pow($,3):(116*$-16)/mG,k00=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=($+16)/116,Q=Z/500+B,X=B-J/200,z={mode:"xyz65",x:PV(Q)*K6.X,y:PV(B)*K6.Y,z:PV(X)*K6.Z};if(H!==void 0)z.alpha=H;return z},pG=k00;var y00=($)=>h4(pG($)),U6=y00;var _V=($)=>$>uG?Math.cbrt($):(mG*$+16)/116,x00=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=_V($/K6.X),Q=_V(Z/K6.Y),X=_V(J/K6.Z),z={mode:"lab65",l:116*Q-16,a:500*(B-Q),b:200*(Q-X)};if(H!==void 0)z.alpha=H;return z},cG=x00;var h00=($)=>{let Z=cG(x4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},Y6=h00;var wZ=1,dG=1,c7=0.14444444444444443*Math.PI,SZ=Math.cos(c7),IZ=Math.sin(c7),lG=100/Math.log(1.39);var v00=({l:$,c:Z,h:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"lab65",l:(Math.exp($*wZ/lG)-1)/0.0039},Q=(Math.exp(0.0435*Z*dG*wZ)-1)/0.075,X=Q*Math.cos(J/180*Math.PI-c7),z=Q*Math.sin(J/180*Math.PI-c7);if(B.a=X*SZ-z/0.83*IZ,B.b=X*IZ+z/0.83*SZ,H!==void 0)B.alpha=H;return B},nH=v00;var g00=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Z*SZ+J*IZ,Q=0.83*(J*SZ-Z*IZ),X=Math.sqrt(B*B+Q*Q),z={mode:"dlch",l:lG/wZ*Math.log(1+0.0039*$),c:Math.log(1+0.075*X)/(0.0435*dG*wZ)};if(z.c)z.h=N5((Math.atan2(Q,B)+c7)/Math.PI*180);if(H!==void 0)z.alpha=H;return z},sH=g00;var XI=($)=>nH(t4($,"dlch")),zI=($)=>e4(sH($),"dlab"),f00={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:XI,rgb:($)=>U6(XI($))},fromMode:{lab65:zI,rgb:($)=>zI(Y6($))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:E0,a:E0,b:E0,alpha:{use:E0,fixup:y1}}},GI=f00;var m00={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:nH,dlab:($)=>e4($,"dlab"),rgb:($)=>U6(nH($))},fromMode:{lab65:sH,dlab:($)=>t4($,"dlch"),rgb:($)=>sH(Y6($))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:E0,c:E0,h:{use:E0,fixup:O2},alpha:{use:E0,fixup:y1}},difference:{h:G6},average:{h:T2}},KI=m00;function jV({h:$,s:Z,i:J,alpha:H}){if($=N5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:J*(1+Z*(3/(2-B)-1)),g:J*(1+Z*(3*(1-B)/(2-B)-1)),b:J*(1-Z)};break;case 1:Q={r:J*(1+Z*(3*(1-B)/(2-B)-1)),g:J*(1+Z*(3/(2-B)-1)),b:J*(1-Z)};break;case 2:Q={r:J*(1-Z),g:J*(1+Z*(3/(2-B)-1)),b:J*(1+Z*(3*(1-B)/(2-B)-1))};break;case 3:Q={r:J*(1-Z),g:J*(1+Z*(3*(1-B)/(2-B)-1)),b:J*(1+Z*(3/(2-B)-1))};break;case 4:Q={r:J*(1+Z*(3*(1-B)/(2-B)-1)),g:J*(1-Z),b:J*(1+Z*(3/(2-B)-1))};break;case 5:Q={r:J*(1+Z*(3/(2-B)-1)),g:J*(1-Z),b:J*(1+Z*(3*(1-B)/(2-B)-1))};break;default:Q={r:J*(1-Z),g:J*(1-Z),b:J*(1-Z)}}if(Q.mode="rgb",H!==void 0)Q.alpha=H;return Q}function OV({r:$,g:Z,b:J,alpha:H}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.max($,Z,J),Q=Math.min($,Z,J),X={mode:"hsi",s:$+Z+J===0?0:1-3*Q/($+Z+J),i:($+Z+J)/3};if(B-Q!==0)X.h=(B===$?(Z-J)/(B-Q)+(Z<J)*6:B===Z?(J-$)/(B-Q)+2:($-Z)/(B-Q)+4)*60;if(H!==void 0)X.alpha=H;return X}var u00={mode:"hsi",toMode:{rgb:jV},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:OV},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:E0,fixup:O2},s:E0,i:E0,alpha:{use:E0,fixup:y1}},difference:{h:z6},average:{h:T2}},UI=u00;function TV({h:$,s:Z,l:J,alpha:H}){if($=N5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let B=J+Z*(J<0.5?J:1-J),Q=B-(B-J)*2*Math.abs($/60%2-1),X;switch(Math.floor($/60)){case 0:X={r:B,g:Q,b:2*J-B};break;case 1:X={r:Q,g:B,b:2*J-B};break;case 2:X={r:2*J-B,g:B,b:Q};break;case 3:X={r:2*J-B,g:Q,b:B};break;case 4:X={r:Q,g:2*J-B,b:B};break;case 5:X={r:B,g:2*J-B,b:Q};break;default:X={r:2*J-B,g:2*J-B,b:2*J-B}}if(X.mode="rgb",H!==void 0)X.alpha=H;return X}function CV({r:$,g:Z,b:J,alpha:H}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.max($,Z,J),Q=Math.min($,Z,J),X={mode:"hsl",s:B===Q?0:(B-Q)/(1-Math.abs(B+Q-1)),l:0.5*(B+Q)};if(B-Q!==0)X.h=(B===$?(Z-J)/(B-Q)+(Z<J)*6:B===Z?(J-$)/(B-Q)+2:($-Z)/(B-Q)+4)*60;if(H!==void 0)X.alpha=H;return X}var p00=($,Z)=>{switch(Z){case"deg":return+$;case"rad":return $/Math.PI*180;case"grad":return $/10*9;case"turn":return $*360}},YI=p00;var c00=new RegExp(`^hsla?\\(\\s*${fS}${X6}${p7}${X6}${p7}\\s*(?:,\\s*${rH}\\s*)?\\)$`),d00=($)=>{let Z=$.match(c00);if(!Z)return;let J={mode:"hsl"};if(Z[3]!==void 0)J.h=+Z[3];else if(Z[1]!==void 0&&Z[2]!==void 0)J.h=YI(Z[1],Z[2]);if(Z[4]!==void 0)J.s=Math.min(Math.max(0,Z[4]/100),1);if(Z[5]!==void 0)J.l=Math.min(Math.max(0,Z[5]/100),1);if(Z[6]!==void 0)J.alpha=Math.max(0,Math.min(1,Z[6]/100));else if(Z[7]!==void 0)J.alpha=Math.max(0,Math.min(1,+Z[7]));return J},FI=d00;function l00($,Z){if(!Z||Z[0]!=="hsl"&&Z[0]!=="hsla")return;let J={mode:"hsl"},[,H,B,Q,X]=Z;if(H.type!==O0.None){if(H.type===O0.Percentage)return;J.h=H.value}if(B.type!==O0.None){if(B.type===O0.Hue)return;J.s=B.value/100}if(Q.type!==O0.None){if(Q.type===O0.Hue)return;J.l=Q.value/100}if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var WI=l00;var i00={mode:"hsl",toMode:{rgb:TV},fromMode:{rgb:CV},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[WI,FI],serialize:($)=>`hsl(${$.h!==void 0?$.h:"none"} ${$.s!==void 0?$.s*100+"%":"none"} ${$.l!==void 0?$.l*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:E0,fixup:O2},s:E0,l:E0,alpha:{use:E0,fixup:y1}},difference:{h:z6},average:{h:T2}},iG=i00;function tH({h:$,s:Z,v:J,alpha:H}){if($=N5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:J,g:J*(1-Z*B),b:J*(1-Z)};break;case 1:Q={r:J*(1-Z*B),g:J,b:J*(1-Z)};break;case 2:Q={r:J*(1-Z),g:J,b:J*(1-Z*B)};break;case 3:Q={r:J*(1-Z),g:J*(1-Z*B),b:J};break;case 4:Q={r:J*(1-Z*B),g:J*(1-Z),b:J};break;case 5:Q={r:J,g:J*(1-Z),b:J*(1-Z*B)};break;default:Q={r:J*(1-Z),g:J*(1-Z),b:J*(1-Z)}}if(Q.mode="rgb",H!==void 0)Q.alpha=H;return Q}function eH({r:$,g:Z,b:J,alpha:H}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.max($,Z,J),Q=Math.min($,Z,J),X={mode:"hsv",s:B===0?0:1-Q/B,v:B};if(B-Q!==0)X.h=(B===$?(Z-J)/(B-Q)+(Z<J)*6:B===Z?(J-$)/(B-Q)+2:($-Z)/(B-Q)+4)*60;if(H!==void 0)X.alpha=H;return X}var r00={mode:"hsv",toMode:{rgb:tH},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:eH},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:E0,fixup:O2},s:E0,v:E0,alpha:{use:E0,fixup:y1}},difference:{h:z6},average:{h:T2}},rG=r00;function EV({h:$,w:Z,b:J,alpha:H}){if(Z===void 0)Z=0;if(J===void 0)J=0;if(Z+J>1){let B=Z+J;Z/=B,J/=B}return tH({h:$,s:J===1?1:1-Z/(1-J),v:1-J,alpha:H})}function wV($){let Z=eH($);if(Z===void 0)return;let J=Z.s!==void 0?Z.s:0,H=Z.v!==void 0?Z.v:0,B={mode:"hwb",w:(1-J)*H,b:1-H};if(Z.h!==void 0)B.h=Z.h;if(Z.alpha!==void 0)B.alpha=Z.alpha;return B}function a00($,Z){if(!Z||Z[0]!=="hwb")return;let J={mode:"hwb"},[,H,B,Q,X]=Z;if(H.type!==O0.None){if(H.type===O0.Percentage)return;J.h=H.value}if(B.type!==O0.None){if(B.type===O0.Hue)return;J.w=B.value/100}if(Q.type!==O0.None){if(Q.type===O0.Hue)return;J.b=Q.value/100}if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var qI=a00;var o00={mode:"hwb",toMode:{rgb:EV},fromMode:{rgb:wV},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[qI],serialize:($)=>`hwb(${$.h!==void 0?$.h:"none"} ${$.w!==void 0?$.w*100+"%":"none"} ${$.b!==void 0?$.b*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:E0,fixup:O2},w:E0,b:E0,alpha:{use:E0,fixup:y1}},difference:{h:BI},average:{h:T2}},NI=o00;var aG=203;var oG=0.1593017578125;var nG=0.8359375,sG=18.8515625,tG=18.6875;function eG($){if($<0)return 0;let Z=Math.pow($,0.012683313515655966);return 1e4*Math.pow(Math.max(0,Z-0.8359375)/(18.8515625-18.6875*Z),6.277394636015326)}function $K($){if($<0)return 0;let Z=Math.pow($/1e4,0.1593017578125);return Math.pow((0.8359375+18.8515625*Z)/(1+18.6875*Z),78.84375)}var SV=($)=>Math.max($/aG,0),n00=({i:$,t:Z,p:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=eG($+0.008609037037932761*Z+0.11102962500302593*J),Q=eG($-0.00860903703793275*Z-0.11102962500302599*J),X=eG($+0.5600313357106791*Z-0.32062717498731885*J),z={mode:"xyz65",x:SV(2.070152218389422*B-1.3263473389671556*Q+0.2066510476294051*X),y:SV(0.3647385209748074*B+0.680566024947227*Q-0.0453045459220346*X),z:SV(-0.049747207535812*B-0.0492609666966138*Q+1.1880659249923042*X)};if(H!==void 0)z.alpha=H;return z},IV=n00;var RV=($=0)=>Math.max($*aG,0),s00=({x:$,y:Z,z:J,alpha:H})=>{let B=RV($),Q=RV(Z),X=RV(J),z=$K(0.3592832590121217*B+0.6976051147779502*Q-0.0358915932320289*X),G=$K(-0.1920808463704995*B+1.1004767970374323*Q+0.0753748658519118*X),K=$K(0.0070797844607477*B+0.0748396662186366*Q+0.8433265453898765*X),U=0.5*z+0.5*G,Y=1.61376953125*z-3.323486328125*G+1.709716796875*K,F=4.378173828125*z-4.24560546875*G-0.132568359375*K,W={mode:"itp",i:U,t:Y,p:F};if(H!==void 0)W.alpha=H;return W},bV=s00;var t00={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:IV,rgb:($)=>h4(IV($))},fromMode:{xyz65:bV,rgb:($)=>bV(x4($))},ranges:{i:[0,0.581],t:[-0.369,0.272],p:[-0.164,0.331]},interpolate:{i:E0,t:E0,p:E0,alpha:{use:E0,fixup:y1}}},VI=t00;var e00=134.03437499999998,$10=0.000000000016295499532821565,kV=($)=>{if($<0)return 0;let Z=Math.pow($/1e4,oG);return Math.pow((nG+sG*Z)/(1+tG*Z),e00)},yV=($=0)=>Math.max($*203,0),Z10=({x:$,y:Z,z:J,alpha:H})=>{$=yV($),Z=yV(Z),J=yV(J);let B=1.15*$-0.15*J,Q=0.66*Z+0.34*$,X=kV(0.41478972*B+0.579999*Q+0.014648*J),z=kV(-0.20151*B+1.120649*Q+0.0531008*J),G=kV(-0.0166008*B+0.2648*Q+0.6684799*J),K=(X+z)/2,U={mode:"jab",j:0.44*K/(1-0.56*K)-$10,a:3.524*X-4.066708*z+0.542708*G,b:0.199076*X+1.096799*z-1.295875*G};if(H!==void 0)U.alpha=H;return U},ZK=Z10;var J10=134.03437499999998,AI=0.000000000016295499532821565,xV=($)=>{if($<0)return 0;let Z=Math.pow($,1/J10);return 1e4*Math.pow((nG-Z)/(tG*Z-sG),1/oG)},hV=($)=>$/203,H10=({j:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=($+AI)/(0.44+0.56*($+AI)),Q=xV(B+0.13860504*Z+0.058047316*J),X=xV(B-0.13860504*Z-0.058047316*J),z=xV(B-0.096019242*Z-0.8118919*J),G={mode:"xyz65",x:hV(1.661373024652174*Q-0.914523081304348*X+0.23136208173913045*z),y:hV(-0.3250758611844533*Q+1.571847026732543*X-0.21825383453227928*z),z:hV(-0.090982811*Q-0.31272829*X+1.5227666*z)};if(H!==void 0)G.alpha=H;return G},JK=H10;var B10=($)=>{let Z=ZK(x4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},HK=B10;var Q10=($)=>h4(JK($)),BK=Q10;var X10={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:HK,xyz65:ZK},toMode:{rgb:BK,xyz65:JK},ranges:{j:[0,0.222],a:[-0.109,0.129],b:[-0.185,0.134]},interpolate:{j:E0,a:E0,b:E0,alpha:{use:E0,fixup:y1}}},DI=X10;var z10=({j:$,a:Z,b:J,alpha:H})=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.sqrt(Z*Z+J*J),Q={mode:"jch",j:$,c:B};if(B)Q.h=N5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)Q.alpha=H;return Q},vV=z10;var G10=({j:$,c:Z,h:J,alpha:H})=>{if(J===void 0)J=0;let B={mode:"jab",j:$,a:Z?Z*Math.cos(J/180*Math.PI):0,b:Z?Z*Math.sin(J/180*Math.PI):0};if(H!==void 0)B.alpha=H;return B},gV=G10;var K10={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:gV,rgb:($)=>BK(gV($))},fromMode:{rgb:($)=>vV(HK($)),jab:vV},channels:["j","c","h","alpha"],ranges:{j:[0,0.221],c:[0,0.19],h:[0,360]},interpolate:{h:{use:E0,fixup:O2},c:E0,j:E0,alpha:{use:E0,fixup:y1}},difference:{h:G6},average:{h:T2}},LI=K10;var F6=Math.pow(29,3)/Math.pow(3,3),RZ=Math.pow(6,3)/Math.pow(29,3);var fV=($)=>Math.pow($,3)>RZ?Math.pow($,3):(116*$-16)/F6,U10=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=($+16)/116,Q=Z/500+B,X=B-J/200,z={mode:"xyz50",x:fV(Q)*g5.X,y:fV(B)*g5.Y,z:fV(X)*g5.Z};if(H!==void 0)z.alpha=H;return z},bZ=U10;var Y10=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=_8({r:$*3.1341359569958707-Z*1.6173863321612538-0.4906619460083532*J,g:$*-0.978795502912089+Z*1.916254567259524+0.03344273116131949*J,b:$*0.07195537988411677-Z*0.2289768264158322+1.405386058324125*J});if(H!==void 0)B.alpha=H;return B},R9=Y10;var F10=($)=>R9(bZ($)),QK=F10;var W10=($)=>{let{r:Z,g:J,b:H,alpha:B}=P8($),Q={mode:"xyz50",x:0.436065742824811*Z+0.3851514688337912*J+0.14307845442264197*H,y:0.22249319175623702*Z+0.7168870538238823*J+0.06061979053616537*H,z:0.013923904500943465*Z+0.09708128566574634*J+0.7140993584005155*H};if(B!==void 0)Q.alpha=B;return Q},b9=W10;var mV=($)=>$>RZ?Math.cbrt($):(F6*$+16)/116,q10=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=mV($/g5.X),Q=mV(Z/g5.Y),X=mV(J/g5.Z),z={mode:"lab",l:116*Q-16,a:500*(B-Q),b:200*(Q-X)};if(H!==void 0)z.alpha=H;return z},kZ=q10;var N10=($)=>{let Z=kZ(b9($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},XK=N10;function V10($,Z){if(!Z||Z[0]!=="lab")return;let J={mode:"lab"},[,H,B,Q,X]=Z;if(H.type===O0.Hue||B.type===O0.Hue||Q.type===O0.Hue)return;if(H.type!==O0.None)J.l=Math.min(Math.max(0,H.value),100);if(B.type!==O0.None)J.a=B.type===O0.Number?B.value:B.value*125/100;if(Q.type!==O0.None)J.b=Q.type===O0.Number?Q.value:Q.value*125/100;if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var MI=V10;var A10={mode:"lab",toMode:{xyz50:bZ,rgb:QK},fromMode:{xyz50:kZ,rgb:XK},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[MI],serialize:($)=>`lab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{l:E0,a:E0,b:E0,alpha:{use:E0,fixup:y1}}},yZ=A10;var D10={...yZ,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:pG,rgb:U6},fromMode:{xyz65:cG,rgb:Y6},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},PI=D10;function L10($,Z){if(!Z||Z[0]!=="lch")return;let J={mode:"lch"},[,H,B,Q,X]=Z;if(H.type!==O0.None){if(H.type===O0.Hue)return;J.l=Math.min(Math.max(0,H.value),100)}if(B.type!==O0.None)J.c=Math.max(0,B.type===O0.Number?B.value:B.value*150/100);if(Q.type!==O0.None){if(Q.type===O0.Percentage)return;J.h=Q.value}if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var _I=L10;var M10={mode:"lch",toMode:{lab:e4,rgb:($)=>QK(e4($))},fromMode:{rgb:($)=>t4(XK($)),lab:t4},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[_I],serialize:($)=>`lch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:E0,fixup:O2},c:E0,l:E0,alpha:{use:E0,fixup:y1}},difference:{h:G6},average:{h:T2}},xZ=M10;var P10={...xZ,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:($)=>e4($,"lab65"),rgb:($)=>U6(e4($,"lab65"))},fromMode:{rgb:($)=>t4(Y6($),"lch65"),lab65:($)=>t4($,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},jI=P10;var _10=({l:$,u:Z,v:J,alpha:H})=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.sqrt(Z*Z+J*J),Q={mode:"lchuv",l:$,c:B};if(B)Q.h=N5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)Q.alpha=H;return Q},uV=_10;var j10=({l:$,c:Z,h:J,alpha:H})=>{if(J===void 0)J=0;let B={mode:"luv",l:$,u:Z?Z*Math.cos(J/180*Math.PI):0,v:Z?Z*Math.sin(J/180*Math.PI):0};if(H!==void 0)B.alpha=H;return B},pV=j10;var OI=($,Z,J)=>4*$/($+15*Z+3*J),TI=($,Z,J)=>9*Z/($+15*Z+3*J),O10=OI(g5.X,g5.Y,g5.Z),T10=TI(g5.X,g5.Y,g5.Z),C10=($)=>$<=RZ?F6*$:116*Math.cbrt($)-16,E10=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=C10(Z/g5.Y),Q=OI($,Z,J),X=TI($,Z,J);if(!isFinite(Q)||!isFinite(X))B=Q=X=0;else Q=13*B*(Q-O10),X=13*B*(X-T10);let z={mode:"luv",l:B,u:Q,v:X};if(H!==void 0)z.alpha=H;return z},$B=E10;var w10=($,Z,J)=>4*$/($+15*Z+3*J),S10=($,Z,J)=>9*Z/($+15*Z+3*J),I10=w10(g5.X,g5.Y,g5.Z),R10=S10(g5.X,g5.Y,g5.Z),b10=({l:$,u:Z,v:J,alpha:H})=>{if($===void 0)$=0;if($===0)return{mode:"xyz50",x:0,y:0,z:0};if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Z/(13*$)+I10,Q=J/(13*$)+R10,X=g5.Y*($<=8?$/F6:Math.pow(($+16)/116,3)),z=X*(9*B)/(4*Q),G=X*(12-3*B-20*Q)/(4*Q),K={mode:"xyz50",x:z,y:X,z:G};if(H!==void 0)K.alpha=H;return K},ZB=b10;var k10=($)=>uV($B(b9($))),y10=($)=>R9(ZB(pV($))),x10={mode:"lchuv",toMode:{luv:pV,rgb:y10},fromMode:{rgb:k10,luv:uV},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:E0,fixup:O2},c:E0,l:E0,alpha:{use:E0,fixup:y1}},difference:{h:G6},average:{h:T2}},CI=x10;var h10={...M8,mode:"lrgb",toMode:{rgb:_8},fromMode:{rgb:P8},parse:["srgb-linear"],serialize:"srgb-linear"},EI=h10;var v10={mode:"luv",toMode:{xyz50:ZB,rgb:($)=>R9(ZB($))},fromMode:{xyz50:$B,rgb:($)=>$B(b9($))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:E0,u:E0,v:E0,alpha:{use:E0,fixup:y1}}},wI=v10;var g10=({r:$,g:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.cbrt(0.412221469470763*$+0.5363325372617348*Z+0.0514459932675022*J),Q=Math.cbrt(0.2119034958178252*$+0.6806995506452344*Z+0.1073969535369406*J),X=Math.cbrt(0.0883024591900564*$+0.2817188391361215*Z+0.6299787016738222*J),z={mode:"oklab",l:0.210454268309314*B+0.7936177747023054*Q-0.0040720430116193*X,a:1.9779985324311684*B-2.42859224204858*Q+0.450593709617411*X,b:0.0259040424655478*B+0.7827717124575296*Q-0.8086757549230774*X};if(H!==void 0)z.alpha=H;return z},zK=g10;var f10=($)=>{let Z=zK(P8($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},W6=f10;var m10=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.pow($+0.3963377773761749*Z+0.2158037573099136*J,3),Q=Math.pow($-0.1055613458156586*Z-0.0638541728258133*J,3),X=Math.pow($-0.0894841775298119*Z-1.2914855480194092*J,3),z={mode:"lrgb",r:4.076741636075957*B-3.3077115392580616*Q+0.2309699031821044*X,g:-1.2684379732850317*B+2.6097573492876887*Q-0.3413193760026573*X,b:-0.0041960761386756*B-0.7034186179359362*Q+1.7076146940746117*X};if(H!==void 0)z.alpha=H;return z},k9=m10;var u10=($)=>_8(k9($)),q6=u10;function JB($){return 0.5*(1.170873786407767*$-0.206+Math.sqrt((1.170873786407767*$-0.206)*(1.170873786407767*$-0.206)+0.14050485436893204*$))}function d7($){return($*$+0.206*$)/(1.170873786407767*($+0.03))}function p10($,Z){let J,H,B,Q,X,z,G,K;if(-1.88170328*$-0.80936493*Z>1)J=1.19086277,H=1.76576728,B=0.59662641,Q=0.75515197,X=0.56771245,z=4.0767416621,G=-3.3077115913,K=0.2309699292;else if(1.81444104*$-1.19445276*Z>1)J=0.73956515,H=-0.45954404,B=0.08285427,Q=0.1254107,X=0.14503204,z=-1.2684380046,G=2.6097574011,K=-0.3413193965;else J=1.35733652,H=-0.00915799,B=-1.1513021,Q=-0.50559606,X=0.00692167,z=-0.0041960863,G=-0.7034186147,K=1.707614701;let U=J+H*$+B*Z+Q*$*$+X*$*Z,Y=0.3963377774*$+0.2158037573*Z,F=-0.1055613458*$-0.0638541728*Z,W=-0.0894841775*$-1.291485548*Z;{let q=1+U*Y,N=1+U*F,A=1+U*W,V=q*q*q,D=N*N*N,L=A*A*A,j=3*Y*q*q,M=3*F*N*N,P=3*W*A*A,w=6*Y*Y*q,C=6*F*F*N,R=6*W*W*A,O=z*V+G*D+K*L,S=z*j+G*M+K*P,y=z*w+G*C+K*R;U=U-O*S/(S*S-0.5*O*y)}return U}function cV($,Z){let J=p10($,Z),H=k9({l:1,a:J*$,b:J*Z}),B=Math.cbrt(1/Math.max(H.r,H.g,H.b)),Q=B*J;return[B,Q]}function c10($,Z,J,H,B,Q=null){if(!Q)Q=cV($,Z);let X;if((J-B)*Q[1]-(Q[0]-B)*H<=0)X=Q[1]*B/(H*Q[0]+Q[1]*(B-J));else{X=Q[1]*(B-1)/(H*(Q[0]-1)+Q[1]*(B-J));{let z=J-B,G=H,K=0.3963377774*$+0.2158037573*Z,U=-0.1055613458*$-0.0638541728*Z,Y=-0.0894841775*$-1.291485548*Z,F=z+G*K,W=z+G*U,q=z+G*Y;{let N=B*(1-X)+X*J,A=X*H,V=N+A*K,D=N+A*U,L=N+A*Y,j=V*V*V,M=D*D*D,P=L*L*L,w=3*F*V*V,C=3*W*D*D,R=3*q*L*L,O=6*F*F*V,S=6*W*W*D,y=6*q*q*L,k=4.0767416621*j-3.3077115913*M+0.2309699292*P-1,T=4.0767416621*w-3.3077115913*C+0.2309699292*R,b=4.0767416621*O-3.3077115913*S+0.2309699292*y,I=T/(T*T-0.5*k*b),v=-k*I,h=-1.2684380046*j+2.6097574011*M-0.3413193965*P-1,f=-1.2684380046*w+2.6097574011*C-0.3413193965*R,E=-1.2684380046*O+2.6097574011*S-0.3413193965*y,i=f/(f*f-0.5*h*E),r=-h*i,x=-0.0041960863*j-0.7034186147*M+1.707614701*P-1,l=-0.0041960863*w-0.7034186147*C+1.707614701*R,o=-0.0041960863*O-0.7034186147*S+1.707614701*y,u=l/(l*l-0.5*x*o),c=-x*u;v=I>=0?v:1e6,r=i>=0?r:1e6,c=u>=0?c:1e6,X+=Math.min(v,Math.min(r,c))}}}return X}function HB($,Z,J=null){if(!J)J=cV($,Z);let H=J[0],B=J[1];return[B/H,B/(1-H)]}function GK($,Z,J){let H=cV(Z,J),B=c10(Z,J,$,1,$,H),Q=HB(Z,J,H),X=0.11516993+1/(7.4477897+4.1590124*J+Z*(-2.19557347+1.75198401*J+Z*(-2.13704948-10.02301043*J+Z*(-4.24894561+5.38770819*J+4.69891013*Z)))),z=0.11239642+1/(1.6132032-0.68124379*J+Z*(0.40370612+0.90148123*J+Z*(-0.27087943+0.6122399*J+Z*(0.00299215-0.45399568*J-0.14661872*Z)))),G=B/Math.min($*Q[0],(1-$)*Q[1]),K=$*X,U=(1-$)*z,Y=0.9*G*Math.sqrt(Math.sqrt(1/(1/(K*K*K*K)+1/(U*U*U*U))));return K=$*0.4,U=(1-$)*0.8,[Math.sqrt(1/(1/(K*K)+1/(U*U))),Y,B]}function KK($){let Z=$.l!==void 0?$.l:0,J=$.a!==void 0?$.a:0,H=$.b!==void 0?$.b:0,B={mode:"okhsl",l:JB(Z)};if($.alpha!==void 0)B.alpha=$.alpha;let Q=Math.sqrt(J*J+H*H);if(!Q)return B.s=0,B;let[X,z,G]=GK(Z,J/Q,H/Q),K;if(Q<z){let U=0,Y=0.8*X,F=1-Y/z;K=(Q-U)/(Y+F*(Q-U))*0.8}else{let U=z,Y=0.2*z*z*1.25*1.25/X,F=1-Y/(G-z);K=0.8+0.2*((Q-U)/(Y+F*(Q-U)))}if(K)B.s=K,B.h=N5(Math.atan2(H,J)*180/Math.PI);return B}function UK($){let Z=$.h!==void 0?$.h:0,J=$.s!==void 0?$.s:0,H=$.l!==void 0?$.l:0,B={mode:"oklab",l:d7(H)};if($.alpha!==void 0)B.alpha=$.alpha;if(!J||H===1)return B.a=B.b=0,B;let Q=Math.cos(Z/180*Math.PI),X=Math.sin(Z/180*Math.PI),[z,G,K]=GK(B.l,Q,X),U,Y,F,W;if(J<0.8)U=1.25*J,Y=0,F=0.8*z,W=1-F/G;else U=5*(J-0.8),Y=G,F=0.2*G*G*1.25*1.25/z,W=1-F/(K-G);let q=Y+U*F/(1-W*U);return B.a=q*Q,B.b=q*X,B}var d10={...iG,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:KK,rgb:($)=>KK(W6($))},toMode:{oklab:UK,rgb:($)=>q6(UK($))}},SI=d10;function YK($){let Z=$.l!==void 0?$.l:0,J=$.a!==void 0?$.a:0,H=$.b!==void 0?$.b:0,B=Math.sqrt(J*J+H*H),Q=B?J/B:1,X=B?H/B:1,[z,G]=HB(Q,X),K=0.5,U=1-K/z,Y=G/(B+Z*G),F=Y*Z,W=Y*B,q=d7(F),N=W*q/F,A=k9({l:q,a:Q*N,b:X*N}),V=Math.cbrt(1/Math.max(A.r,A.g,A.b,0));Z=Z/V,B=B/V*JB(Z)/Z,Z=JB(Z);let D={mode:"okhsv",s:B?(K+G)*W/(G*K+G*U*W):0,v:Z?Z/F:0};if(D.s)D.h=N5(Math.atan2(H,J)*180/Math.PI);if($.alpha!==void 0)D.alpha=$.alpha;return D}function FK($){let Z={mode:"oklab"};if($.alpha!==void 0)Z.alpha=$.alpha;let J=$.h!==void 0?$.h:0,H=$.s!==void 0?$.s:0,B=$.v!==void 0?$.v:0,Q=Math.cos(J/180*Math.PI),X=Math.sin(J/180*Math.PI),[z,G]=HB(Q,X),K=0.5,U=1-K/z,Y=1-H*K/(K+G-G*U*H),F=H*G*K/(K+G-G*U*H),W=d7(Y),q=F*W/Y,N=k9({l:W,a:Q*q,b:X*q}),A=Math.cbrt(1/Math.max(N.r,N.g,N.b,0)),V=d7(B*Y),D=F*V/Y;return Z.l=V*A,Z.a=D*Q*A,Z.b=D*X*A,Z}var l10={...rG,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:YK,rgb:($)=>YK(W6($))},toMode:{oklab:FK,rgb:($)=>q6(FK($))}},II=l10;function i10($,Z){if(!Z||Z[0]!=="oklab")return;let J={mode:"oklab"},[,H,B,Q,X]=Z;if(H.type===O0.Hue||B.type===O0.Hue||Q.type===O0.Hue)return;if(H.type!==O0.None)J.l=Math.min(Math.max(0,H.type===O0.Number?H.value:H.value/100),1);if(B.type!==O0.None)J.a=B.type===O0.Number?B.value:B.value*0.4/100;if(Q.type!==O0.None)J.b=Q.type===O0.Number?Q.value:Q.value*0.4/100;if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var RI=i10;var r10={...yZ,mode:"oklab",toMode:{lrgb:k9,rgb:q6},fromMode:{lrgb:zK,rgb:W6},ranges:{l:[0,1],a:[-0.4,0.4],b:[-0.4,0.4]},parse:[RI],serialize:($)=>`oklab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`},bI=r10;function a10($,Z){if(!Z||Z[0]!=="oklch")return;let J={mode:"oklch"},[,H,B,Q,X]=Z;if(H.type!==O0.None){if(H.type===O0.Hue)return;J.l=Math.min(Math.max(0,H.type===O0.Number?H.value:H.value/100),1)}if(B.type!==O0.None)J.c=Math.max(0,B.type===O0.Number?B.value:B.value*0.4/100);if(Q.type!==O0.None){if(Q.type===O0.Percentage)return;J.h=Q.value}if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var kI=a10;var o10={...xZ,mode:"oklch",toMode:{oklab:($)=>e4($,"oklab"),rgb:($)=>q6(e4($,"oklab"))},fromMode:{rgb:($)=>t4(W6($),"oklch"),oklab:($)=>t4($,"oklch")},parse:[kI],serialize:($)=>`oklch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,ranges:{l:[0,1],c:[0,0.4],h:[0,360]}},yI=o10;var n10=($)=>{let{r:Z,g:J,b:H,alpha:B}=P8($),Q={mode:"xyz65",x:0.486570948648216*Z+0.265667693169093*J+0.1982172852343625*H,y:0.2289745640697487*Z+0.6917385218365062*J+0.079286914093745*H,z:0*Z+0.0451133818589026*J+1.043944368900976*H};if(B!==void 0)Q.alpha=B;return Q},dV=n10;var s10=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=_8({r:$*2.4934969119414263-Z*0.9313836179191242-0.402710784450717*J,g:$*-0.8294889695615749+Z*1.7626640603183465+0.0236246858419436*J,b:$*0.0358458302437845-Z*0.0761723892680418+0.9568845240076871*J},"p3");if(H!==void 0)B.alpha=H;return B},lV=s10;var t10={...M8,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:($)=>lV(x4($)),xyz65:lV},toMode:{rgb:($)=>h4(dV($)),xyz65:dV}},xI=t10;var iV=($)=>{let Z=Math.abs($);if(Z>=0.001953125)return Math.sign($)*Math.pow(Z,0.5555555555555556);return 16*$},e10=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"prophoto",r:iV($*1.3457868816471585-Z*0.2555720873797946-0.0511018649755453*J),g:iV($*-0.5446307051249019+Z*1.5082477428451466+0.0205274474364214*J),b:iV($*0+Z*0+1.2119675456389452*J)};if(H!==void 0)B.alpha=H;return B},rV=e10;var aV=($=0)=>{let Z=Math.abs($);if(Z>=0.03125)return Math.sign($)*Math.pow(Z,1.8);return $/16},$50=($)=>{let Z=aV($.r),J=aV($.g),H=aV($.b),B={mode:"xyz50",x:0.7977666449006423*Z+0.1351812974005331*J+0.0313477341283922*H,y:0.2880748288194013*Z+0.7118352342418731*J+0.0000899369387256*H,z:0*Z+0*J+0.8251046025104602*H};if($.alpha!==void 0)B.alpha=$.alpha;return B},oV=$50;var Z50={...M8,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:rV,rgb:($)=>rV(b9($))},toMode:{xyz50:oV,rgb:($)=>R9(oV($))}},hI=Z50;var nV=($)=>{let Z=Math.abs($);if(Z>0.018053968510807)return(Math.sign($)||1)*(1.09929682680944*Math.pow(Z,0.45)-0.09929682680944008);return 4.5*$},J50=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"rec2020",r:nV($*1.7166511879712683-Z*0.3556707837763925-0.2533662813736599*J),g:nV($*-0.6666843518324893+Z*1.6164812366349395+0.0157685458139111*J),b:nV($*0.0176398574453108-Z*0.0427706132578085+0.9421031212354739*J)};if(H!==void 0)B.alpha=H;return B},sV=J50;var tV=($=0)=>{let Z=Math.abs($);if(Z<0.08124285829863151)return $/4.5;return(Math.sign($)||1)*Math.pow((Z+1.09929682680944-1)/1.09929682680944,2.2222222222222223)},H50=($)=>{let Z=tV($.r),J=tV($.g),H=tV($.b),B={mode:"xyz65",x:0.6369580483012911*Z+0.1446169035862083*J+0.1688809751641721*H,y:0.262700212011267*Z+0.6779980715188708*J+0.059301716469862*H,z:0*Z+0.0280726930490874*J+1.0609850577107909*H};if($.alpha!==void 0)B.alpha=$.alpha;return B},eV=H50;var B50={...M8,mode:"rec2020",fromMode:{xyz65:sV,rgb:($)=>sV(x4($))},toMode:{xyz65:eV,rgb:($)=>h4(eV($))},parse:["rec2020"],serialize:"rec2020"},vI=B50;var N6=0.0037930732552754493,WK=Math.cbrt(0.0037930732552754493);var $A=($)=>Math.cbrt($)-WK,Q50=($)=>{let{r:Z,g:J,b:H,alpha:B}=P8($),Q=$A(0.3*Z+0.622*J+0.078*H+N6),X=$A(0.23*Z+0.692*J+0.078*H+N6),z=$A(0.2434226892454782*Z+0.2047674442449682*J+0.5518098665095535*H+N6),G={mode:"xyb",x:(Q-X)/2,y:(Q+X)/2,b:z-(Q+X)/2};if(B!==void 0)G.alpha=B;return G},gI=Q50;var ZA=($)=>Math.pow($+WK,3),X50=({x:$,y:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=ZA($+Z)-N6,Q=ZA(Z-$)-N6,X=ZA(J+Z)-N6,z=_8({r:11.031566904639861*B-9.866943908131562*Q-0.16462299650829934*X,g:-3.2541473810744237*B+4.418770377582723*Q-0.16462299650829934*X,b:-3.6588512867136815*B+2.7129230459360922*Q+1.9459282407775895*X});if(H!==void 0)z.alpha=H;return z},fI=X50;var z50={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:fI},fromMode:{rgb:gI},ranges:{x:[-0.0154,0.0281],y:[0,0.8453],b:[-0.2778,0.388]},interpolate:{x:E0,y:E0,b:E0,alpha:{use:E0,fixup:y1}}},mI=z50;var G50={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:R9,lab:kZ},fromMode:{rgb:b9,lab:bZ},channels:["x","y","z","alpha"],ranges:{x:[0,0.964],y:[0,0.999],z:[0,0.825]},interpolate:{x:E0,y:E0,z:E0,alpha:{use:E0,fixup:y1}}},uI=G50;var K50=($)=>{let{x:Z,y:J,z:H,alpha:B}=$;if(Z===void 0)Z=0;if(J===void 0)J=0;if(H===void 0)H=0;let Q={mode:"xyz50",x:1.0479298208405488*Z+0.0229467933410191*J-0.0501922295431356*H,y:0.0296278156881593*Z+0.990434484573249*J-0.0170738250293851*H,z:-0.0092430581525912*Z+0.0150551448965779*J+0.7518742899580008*H};if(B!==void 0)Q.alpha=B;return Q},pI=K50;var U50=($)=>{let{x:Z,y:J,z:H,alpha:B}=$;if(Z===void 0)Z=0;if(J===void 0)J=0;if(H===void 0)H=0;let Q={mode:"xyz65",x:0.9554734527042182*Z-0.0230985368742614*J+0.0632593086610217*H,y:-0.0283697069632081*Z+1.0099954580058226*J+0.021041398966943*H,z:0.0123140016883199*Z-0.0205076964334779*J+1.3303659366080753*H};if(B!==void 0)Q.alpha=B;return Q},cI=U50;var Y50={mode:"xyz65",toMode:{rgb:h4,xyz50:pI},fromMode:{rgb:x4,xyz50:cI},ranges:{x:[0,0.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:E0,y:E0,z:E0,alpha:{use:E0,fixup:y1}}},dI=Y50;var F50=({r:$,g:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"yiq",y:0.29889531*$+0.58662247*Z+0.11448223*J,i:0.59597799*$-0.2741761*Z-0.32180189*J,q:0.21147017*$-0.52261711*Z+0.31114694*J};if(H!==void 0)B.alpha=H;return B},lI=F50;var W50=({y:$,i:Z,q:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"rgb",r:$+0.95608445*Z+0.6208885*J,g:$-0.27137664*Z-0.6486059*J,b:$-1.10561724*Z+1.70250126*J};if(H!==void 0)B.alpha=H;return B},iI=W50;var q50={mode:"yiq",toMode:{rgb:iI},fromMode:{rgb:lI},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-0.595,0.595],q:[-0.522,0.522]},interpolate:{y:E0,i:E0,q:E0,alpha:{use:E0,fixup:y1}}},rI=q50;function JA($){let Z=hG("lrgb")($);return 0.2126*Z.r+0.7152*Z.g+0.0722*Z.b}var Bu0=$5(nS),Qu0=$5(QI),Xu0=$5(GI),zu0=$5(KI),Gu0=$5(UI),Ku0=$5(iG),Uu0=$5(rG),Yu0=$5(NI),Fu0=$5(VI),Wu0=$5(DI),qu0=$5(LI),Nu0=$5(yZ),Vu0=$5(PI),Au0=$5(xZ),Du0=$5(jI),Lu0=$5(CI),Mu0=$5(EI),Pu0=$5(wI),_u0=$5(SI),ju0=$5(II),Ou0=$5(bI),Tu0=$5(yI),Cu0=$5(xI),Eu0=$5(hI),wu0=$5(vI),Su0=$5(M8),Iu0=$5(mI),Ru0=$5(uI),bu0=$5(dI),ku0=$5(rI);var V6={sans:{label:"Sans",sans:"system-ui",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"},serif:{label:"Serif",sans:"Literata",mono:"Geist Mono",googleFontsQuery:"Literata:wght@400;600;700&family=Geist+Mono:wght@400;500"},mono:{label:"Mono",sans:"Geist Mono",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500;600"},geometric:{label:"Geometric",sans:"Manrope",mono:"Geist Mono",googleFontsQuery:"Manrope:wght@400;500;600&family=Geist+Mono:wght@400;500"},rounded:{label:"Rounded",sans:"SN Pro",mono:"Geist Mono",googleFontsQuery:"SN+Pro:wght@400;500;600&family=Geist+Mono:wght@400;500"},blobby:{label:"Blobby",sans:"Sour Gummy",mono:"Azeret Mono",googleFontsQuery:"Sour+Gummy:wght@400;500;600&family=Azeret+Mono:wght@400;500"},awkward:{label:"Awkward",sans:"Averia Sans Libre",mono:"Azeret Mono",googleFontsQuery:"Averia+Sans+Libre:wght@400;500;600&family=Azeret+Mono:wght@400;500"},comic:{label:"Comic",sans:"Comic Sans MS, Comic Sans, cursive",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"}},BB={squishy:{label:"Squishy",radius:"0.875rem"},soft:{label:"Soft",radius:"0.625rem"},subtle:{label:"Subtle",radius:"0.375rem"},square:{label:"Square",radius:"0"}},QB={blob:{label:"Blob",traits:{shape:0.11,"body.r":0.5,"body.ratio":0,"body.n":0.5}},boxy:{label:"Boxy",traits:{shape:0.54,"body.r":1,"body.ratio":0}},pill:{label:"Pill",traits:{shape:0.65,"body.r":1}},dorito:{label:"Dorito",traits:{shape:0.99,"body.r":1,"body.ratio":0,"body.rot":0}}},HA="oklch(0.205 0 0)";function aI($){return JA($)>0.3?"oklch(0 0 0)":"oklch(1 0 0)"}var oI={workspace:{primary:($)=>$,primaryForeground:($)=>aI($),background:()=>"color-mix(in srgb, var(--primary) 2%, oklch(1 0 0) 98%)",foreground:()=>"color-mix(in srgb, var(--primary) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 95%, var(--foreground) 5%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 3%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 7%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"},widget:{background:($)=>$,foreground:($)=>aI($),primary:()=>"color-mix(in srgb, var(--background) 2%, oklch(1 0 0) 98%)",primaryForeground:()=>"color-mix(in srgb, var(--background) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 95%, var(--foreground) 5%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 3%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 15%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"}},BA=Object.keys(oI.workspace);function QA($,Z="workspace"){let J={},H=oI[Z];for(let B of BA)J[B]=H[B]($);return J}var NK={default:{label:"Default"},paper:{label:"Paper",primary:"oklch(0.4328 0.0351 66.67)"},rose:{label:"Rose",primary:"oklch(0.6322 0.2171 26.02)"},tangerine:{label:"Tangerine",primary:"oklch(0.6886 0.22 37.15)"},sand:{label:"Sand",primary:"oklch(0.8334 0.1271 67.80)"},mint:{label:"Tropics",primary:"oklch(0.5774 0.1399 156.06)"},sky:{label:"Sky",primary:"oklch(0.5824 0.1830 253.59)"},lavender:{label:"Lavender",primary:"oklch(0.6025 0.2426 294.58)"}},y9={font:"sans",color:"default",radius:"soft",agent:"boxy"};function qK($,Z,J){return typeof $==="string"&&Object.hasOwn(Z,$)?$:J}function i8($){return{font:qK($?.font,V6,y9.font),color:qK($?.color,NK,y9.color),radius:qK($?.radius,BB,y9.radius),agent:qK($?.agent,QB,y9.agent)}}function VK($,Z="workspace"){let J=i8($),B=NK[J.color].primary??(Z==="widget"?HA:void 0);return B?QA(B,Z):void 0}var XB=_(d(),1),zB={"claude-code":TG,openclaw:wG,codex:EG,hermes:CG};function N50($,Z,J){switch($?.type){case"emoji":return XB.jsx("span",{"aria-hidden":"true",className:G0("flex size-full translate-y-[2cqi] items-center justify-center font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif] leading-none",Z?"text-[60cqi]":"text-[85cqi]"),children:$.value});case"upload":return XB.jsx("img",{src:$.value,alt:"",className:"size-full"});case"glyph":{let H=u7($.value);if(H)return nI.createElement(H,{"aria-hidden":!0,stroke:1.75,className:Z?"size-[70%]":"size-[95%] text-foreground"})}default:return XB.jsx("img",{src:J,alt:"",className:"size-[95%]"})}}function A6({className:$,icon:Z,workspaceType:J,workspaceTheme:H}){let B=Z?.type!=="upload"&&Z?.background==="theme",Q=B?VK(H)??QA(HA):void 0,X=zB[J??"claude-code"];return XB.jsx("span",{className:G0("@container inline-flex shrink-0 items-center justify-center overflow-hidden",B&&"shadow-[inset_0_0_1rem_rgba(255,255,255,0.3)]",$),style:Q?{backgroundColor:Q.primary,color:Q.primaryForeground}:void 0,children:N50(Z,B,X)})}var XA=_(d(),1),zA={"claude-code":"Claude Code",openclaw:"OpenClaw",codex:"Codex",hermes:"Hermes"};function sI({types:$}){let Z=$.map((J)=>zA[J]).join(", ");return XA.jsx("span",{role:"img","aria-label":Z,className:"inline-flex shrink-0 items-center -space-x-0.5",children:$.map((J)=>XA.jsx("img",{src:zB[J],alt:"",className:"size-4 shrink-0 rounded-full bg-muted ring-2 ring-muted"},J))})}function l7($){if("types"in $)return $.path.split("/").pop()||$.path;if($.name)return $.name;if($.type==="openclaw")return $.agentId??"OpenClaw agent";if($.type==="hermes")return $.agentId??"Hermes agent";return $.path.split("/").pop()||$.path}var Z5=_(d(),1),V50="Choose which agent moi will use to build your workspace",A50={openclaw:"To connect an OpenClaw agent, run",hermes:"To connect a Hermes agent, run"},D50={openclaw:"moi openclaw init",hermes:"moi hermes init"},L50={"claude-code":"Anthropic",codex:"OpenAI",openclaw:"Open-source",hermes:"Nous Research"};function M50({availability:$,detectedTypes:Z=[]}){return OZ.map((J)=>{let H=$?.[J],B=H&&H.status!=="available"?H.reason:void 0,Q=!Z.includes(J)?A50[J]:void 0,X=!Z.includes(J)?D50[J]:void 0,z=B??Q;return{type:J,description:L50[J],disabled:Boolean(z),...z?{disabledReason:z}:{},...!B&&X?{disabledCommand:X}:{}}})}function P50($,Z){let J=$.find((H)=>H.type===Z);if(J&&!J.disabled)return J.type;return $.find((H)=>!H.disabled)?.type}function DK({title:$,selectedType:Z,detectedTypes:J,availability:H,isPending:B,errorMessage:Q,secondaryAction:X,primaryLabel:z,pendingLabel:G,onTypeChange:K,onSubmit:U}){let Y=C5((A)=>A.hasSentMessageFromMoi),F=M50({availability:H,detectedTypes:J}),W=P50(F,Z),q=W!==Z,N=W==="claude-code"?"Tip: you can use your existing Claude subscription in moi":W==="codex"?"Tip: you can use your existing ChatGPT subscription in moi":void 0;return tI.useEffect(()=>{if(W&&q)K(W)},[K,W,q]),Z5.jsxs("div",{className:"flex flex-col gap-5",children:[Z5.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[Z5.jsx(Z6,{children:$}),Z5.jsx(_Z,{children:V50})]}),Z5.jsxs("div",{className:"flex flex-col gap-4",children:[Z5.jsx(_50,{options:F,selectedType:q?void 0:Z,onTypeChange:K}),!Y&&N&&Z5.jsx("p",{className:"text-sm text-muted-foreground",children:N})]}),Q&&Z5.jsx("p",{role:"alert",className:"text-xs text-destructive",children:Q}),Z5.jsxs("div",{className:"flex items-center justify-end gap-2",children:[X,Z5.jsx(j0,{onClick:U,disabled:B||q,children:B&&G?G:z})]})]})}function _50({options:$,selectedType:Z,onTypeChange:J}){return Z5.jsx("div",{role:"group","aria-label":"Agent",className:G0("grid gap-2",$.length>2?"grid-cols-4":"grid-cols-2"),children:$.map((H)=>Z5.jsx(j50,{option:H,selected:Z===H.type,onSelect:J},H.type))})}function j50({option:$,selected:Z,onSelect:J}){let H=Boolean($.disabledReason),B=Z5.jsxs("button",{type:"button",disabled:$.disabled&&!H,"aria-disabled":$.disabled||void 0,"aria-pressed":Z,onClick:(Q)=>{if($.disabled){Q.preventDefault();return}J($.type)},className:G0("relative flex w-full flex-col items-start justify-between gap-6 rounded-xl bg-card p-4 text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50",!Z&&"opacity-70",!Z&&!$.disabled&&"cursor-pointer hover:opacity-100",$.disabled&&"cursor-not-allowed"),children:[Z5.jsxs("span",{className:"relative inline-flex",children:[Z5.jsx(O50,{type:$.type}),Z&&Z5.jsx(AK,{size:16,stroke:1.75,"aria-hidden":"true",className:"absolute -top-1.5 -right-1.5"})]}),Z5.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[Z5.jsx("span",{className:"text-sm font-medium text-foreground",children:zA[$.type]}),Z5.jsx("span",{className:"text-xs leading-4 text-muted-foreground",children:$.description})]})]});if(!H)return B;return Z5.jsxs(B5,{children:[Z5.jsx(Q5,{render:B}),Z5.jsx(X5,{className:G0("max-w-64",$.disabledCommand&&"max-w-none leading-5"),children:Z5.jsxs("span",{className:"text-center",children:[$.disabledReason,$.disabledCommand&&Z5.jsxs(Z5.Fragment,{children:[Z5.jsx("br",{}),Z5.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:$.disabledCommand})]})]})})]})}function O50({type:$}){return Z5.jsx("img",{src:zB[$],alt:"",className:"size-8 shrink-0"})}var eI=_(d(),1);function LK({children:$,showCloseButton:Z=!0}){return eI.jsx(PZ,{showCloseButton:Z,className:"block w-[calc(100%-2rem)] max-w-xl overflow-hidden p-6 sm:max-w-xl",children:$})}var E5=_(d(),1),$R=OZ[0];function KB({trigger:$}){let[,Z]=K8(),J=I9(),H=az(),B=WE(),[Q,X]=GB.useState(!1),[z,G]=GB.useState("agent"),[K,U]=GB.useState($R),[Y,F]=GB.useState(""),W=Y.trim(),q=W?jw(W):null,N=B.isPending;if(J.cloudDemo)return E5.jsx(CZ,{trigger:$});function A(j){X(!1),Z(`/workspace/${j}`)}function V(){G("agent"),U($R),F(""),B.reset()}function D(){B.reset(),G("name")}function L(){if(!W||q||N)return;B.reset(),B.mutate({name:W,type:K},{onSuccess:(j)=>A(j.id)})}return E5.jsxs($6,{open:Q,onOpenChange:X,onOpenChangeComplete:(j)=>{if(!j)V()},children:[E5.jsx(D3,{render:$}),E5.jsx(LK,{children:z==="agent"?E5.jsx(DK,{title:"Create new workspace",selectedType:K,availability:H.data?.availability,isPending:!1,secondaryAction:E5.jsx(C50,{}),primaryLabel:"Next",onTypeChange:U,onSubmit:D}):E5.jsx(T50,{name:Y,validationError:q,requestError:B.error?.message,isPending:N,onNameChange:F,onSubmit:L})})]})}function T50({name:$,validationError:Z,requestError:J,isPending:H,onNameChange:B,onSubmit:Q}){function X(z){z.preventDefault(),Q()}return E5.jsxs("form",{className:"flex flex-col gap-5",onSubmit:X,children:[E5.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[E5.jsx(Z6,{children:"Create new workspace"}),E5.jsx(_Z,{children:"Give it a short and recognizable name"})]}),E5.jsxs("div",{className:"flex flex-col gap-2",children:[E5.jsx("label",{htmlFor:"workspace-name",className:"sr-only",children:"Workspace name"}),E5.jsx(f7,{id:"workspace-name",value:$,onChange:(z)=>B(z.target.value),placeholder:"my-workspace",autoFocus:!0,"aria-invalid":Boolean(Z),"aria-describedby":Z?"workspace-name-error":void 0,autoComplete:"off",spellCheck:!1}),Z&&E5.jsx("p",{id:"workspace-name-error",role:"alert",className:"text-xs text-destructive",children:Z})]}),J&&E5.jsx("p",{role:"alert",className:"text-xs text-destructive",children:J}),E5.jsx("div",{className:"flex items-center justify-end gap-2",children:E5.jsx(j0,{type:"submit",disabled:!$.trim()||Boolean(Z)||H,children:H?"Creating…":"Create workspace"})})]})}function C50(){return E5.jsxs(B5,{children:[E5.jsx(Q5,{render:E5.jsx(j0,{variant:"secondary","aria-disabled":!0,onClick:(Z)=>Z.preventDefault(),className:"cursor-not-allowed opacity-50",children:"Use existing folder"})}),E5.jsx(X5,{className:"max-w-64",children:E5.jsxs("span",{className:"text-center",children:["Not supported yet — run"," ",E5.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:"moi init"})," ","in the folder from your console to add it"]})})]})}var L6=_(p(),1);var D0=_(p(),1),n7=_(a4(),1);var B2=_(p(),1);var UB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function i7($){let Z=Object.prototype.toString.call($);return Z==="[object Window]"||Z==="[object global]"}function MK($){return"nodeType"in $}function $4($){var Z,J;if(!$)return window;if(i7($))return $;if(!MK($))return window;return(Z=(J=$.ownerDocument)==null?void 0:J.defaultView)!=null?Z:window}function PK($){let{Document:Z}=$4($);return $ instanceof Z}function vZ($){if(i7($))return!1;return $ instanceof $4($).HTMLElement}function KA($){return $ instanceof $4($).SVGElement}function r7($){if(!$)return document;if(i7($))return $.document;if(!MK($))return document;if(PK($))return $;if(vZ($)||KA($))return $.ownerDocument;return document}var x9=UB?B2.useLayoutEffect:B2.useEffect;function YB($){let Z=B2.useRef($);return x9(()=>{Z.current=$}),B2.useCallback(function(){for(var J=arguments.length,H=Array(J),B=0;B<J;B++)H[B]=arguments[B];return Z.current==null?void 0:Z.current(...H)},[])}function JR(){let $=B2.useRef(null),Z=B2.useCallback((H,B)=>{$.current=setInterval(H,B)},[]),J=B2.useCallback(()=>{if($.current!==null)clearInterval($.current),$.current=null},[]);return[Z,J]}function gZ($,Z){if(Z===void 0)Z=[$];let J=B2.useRef($);return x9(()=>{if(J.current!==$)J.current=$},Z),J}function fZ($,Z){let J=B2.useRef();return B2.useMemo(()=>{let H=$(J.current);return J.current=H,H},[...Z])}function FB($){let Z=YB($),J=B2.useRef(null),H=B2.useCallback((B)=>{if(B!==J.current)Z==null||Z(B,J.current);J.current=B},[]);return[J,H]}function WB($){let Z=B2.useRef();return B2.useEffect(()=>{Z.current=$},[$]),Z.current}var GA={};function qB($,Z){return B2.useMemo(()=>{if(Z)return Z;let J=GA[$]==null?0:GA[$]+1;return GA[$]=J,$+"-"+J},[$,Z])}function HR($){return function(Z){for(var J=arguments.length,H=Array(J>1?J-1:0),B=1;B<J;B++)H[B-1]=arguments[B];return H.reduce((Q,X)=>{let z=Object.entries(X);for(let[G,K]of z){let U=Q[G];if(U!=null)Q[G]=U+$*K}return Q},{...Z})}}var a7=HR(1),NB=HR(-1);function E50($){return"clientX"in $&&"clientY"in $}function _K($){if(!$)return!1;let{KeyboardEvent:Z}=$4($.target);return Z&&$ instanceof Z}function w50($){if(!$)return!1;let{TouchEvent:Z}=$4($.target);return Z&&$ instanceof Z}function VB($){if(w50($)){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(E50($))return{x:$.clientX,y:$.clientY};return null}var hZ=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[hZ.Translate.toString($),hZ.Scale.toString($)].join(" ")}},Transition:{toString($){let{property:Z,duration:J,easing:H}=$;return Z+" "+J+"ms "+H}}}),ZR="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function BR($){if($.matches(ZR))return $;return $.querySelector(ZR)}var o7=_(p(),1),S50={display:"none"};function QR($){let{id:Z,value:J}=$;return o7.default.createElement("div",{id:Z,style:S50},J)}function XR($){let{id:Z,announcement:J,ariaLiveType:H="assertive"}=$,B={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return o7.default.createElement("div",{id:Z,style:B,role:"status","aria-live":H,"aria-atomic":!0},J)}function zR(){let[$,Z]=o7.useState("");return{announce:o7.useCallback((H)=>{if(H!=null)Z(H)},[]),announcement:$}}var MR=D0.createContext(null);function I50($){let Z=D0.useContext(MR);D0.useEffect(()=>{if(!Z)throw Error("useDndMonitor must be used within a children of <DndContext>");return Z($)},[$,Z])}function R50(){let[$]=D0.useState(()=>new Set),Z=D0.useCallback((H)=>{return $.add(H),()=>$.delete(H)},[$]);return[D0.useCallback((H)=>{let{type:B,event:Q}=H;$.forEach((X)=>{var z;return(z=X[B])==null?void 0:z.call(X,Q)})},[$]),Z]}var b50={draggable:`
15
+ To pick up a draggable item, press the space bar.
16
+ While dragging, use the arrow keys to move the item.
17
+ Press space again to drop the item in its new position, or press escape to cancel.
18
+ `},k50={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 y50($){let{announcements:Z=k50,container:J,hiddenTextDescribedById:H,screenReaderInstructions:B=b50}=$,{announce:Q,announcement:X}=zR(),z=qB("DndLiveRegion"),[G,K]=D0.useState(!1);if(D0.useEffect(()=>{K(!0)},[]),I50(D0.useMemo(()=>({onDragStart(Y){let{active:F}=Y;Q(Z.onDragStart({active:F}))},onDragMove(Y){let{active:F,over:W}=Y;if(Z.onDragMove)Q(Z.onDragMove({active:F,over:W}))},onDragOver(Y){let{active:F,over:W}=Y;Q(Z.onDragOver({active:F,over:W}))},onDragEnd(Y){let{active:F,over:W}=Y;Q(Z.onDragEnd({active:F,over:W}))},onDragCancel(Y){let{active:F,over:W}=Y;Q(Z.onDragCancel({active:F,over:W}))}}),[Q,Z])),!G)return null;let U=D0.default.createElement(D0.default.Fragment,null,D0.default.createElement(QR,{id:H,value:B.draggable}),D0.default.createElement(XR,{id:z,announcement:X}));return J?n7.createPortal(U,J):U}var U2;(function($){$.DragStart="dragStart",$.DragMove="dragMove",$.DragEnd="dragEnd",$.DragCancel="dragCancel",$.DragOver="dragOver",$.RegisterDroppable="registerDroppable",$.SetDroppableDisabled="setDroppableDisabled",$.UnregisterDroppable="unregisterDroppable"})(U2||(U2={}));function OK(){}function VA($,Z){return D0.useMemo(()=>({sensor:$,options:Z!=null?Z:{}}),[$,Z])}function PR(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];return D0.useMemo(()=>[...Z].filter((H)=>H!=null),[...Z])}var r8=Object.freeze({x:0,y:0});function x50($,Z){return Math.sqrt(Math.pow($.x-Z.x,2)+Math.pow($.y-Z.y,2))}function h50($,Z){let J=VB($);if(!J)return"0 0";let H={x:(J.x-Z.left)/Z.width*100,y:(J.y-Z.top)/Z.height*100};return H.x+"% "+H.y+"%"}function v50($,Z){let{data:{value:J}}=$,{data:{value:H}}=Z;return J-H}function g50($,Z){let{data:{value:J}}=$,{data:{value:H}}=Z;return H-J}function f50($,Z){if(!$||$.length===0)return null;let[J]=$;return Z?J[Z]:J}function GR($,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 _R=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:H}=$,B=GR(Z,Z.left,Z.top),Q=[];for(let X of H){let{id:z}=X,G=J.get(z);if(G){let K=x50(GR(G),B);Q.push({id:z,data:{droppableContainer:X,value:K}})}}return Q.sort(v50)};function m50($,Z){let J=Math.max(Z.top,$.top),H=Math.max(Z.left,$.left),B=Math.min(Z.left+Z.width,$.left+$.width),Q=Math.min(Z.top+Z.height,$.top+$.height),X=B-H,z=Q-J;if(H<B&&J<Q){let G=Z.width*Z.height,K=$.width*$.height,U=X*z,Y=U/(G+K-U);return Number(Y.toFixed(4))}return 0}var u50=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:H}=$,B=[];for(let Q of H){let{id:X}=Q,z=J.get(X);if(z){let G=m50(z,Z);if(G>0)B.push({id:X,data:{droppableContainer:Q,value:G}})}}return B.sort(g50)};function p50($,Z,J){return{...$,scaleX:Z&&J?Z.width/J.width:1,scaleY:Z&&J?Z.height/J.height:1}}function jR($,Z){return $&&Z?{x:$.left-Z.left,y:$.top-Z.top}:r8}function c50($){return function(J){for(var H=arguments.length,B=Array(H>1?H-1:0),Q=1;Q<H;Q++)B[Q-1]=arguments[Q];return B.reduce((X,z)=>({...X,top:X.top+$*z.y,bottom:X.bottom+$*z.y,left:X.left+$*z.x,right:X.right+$*z.x}),{...J})}}var d50=c50(1);function OR($){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 l50($,Z,J){let H=OR(Z);if(!H)return $;let{scaleX:B,scaleY:Q,x:X,y:z}=H,G=$.left-X-(1-B)*parseFloat(J),K=$.top-z-(1-Q)*parseFloat(J.slice(J.indexOf(" ")+1)),U=B?$.width/B:$.width,Y=Q?$.height/Q:$.height;return{width:U,height:Y,top:K,right:G+U,bottom:K+Y,left:G}}var i50={ignoreTransform:!1};function LB($,Z){if(Z===void 0)Z=i50;let J=$.getBoundingClientRect();if(Z.ignoreTransform){let{transform:K,transformOrigin:U}=$4($).getComputedStyle($);if(K)J=l50(J,K,U)}let{top:H,left:B,width:Q,height:X,bottom:z,right:G}=J;return{top:H,left:B,width:Q,height:X,bottom:z,right:G}}function KR($){return LB($,{ignoreTransform:!0})}function r50($){let{innerWidth:Z,innerHeight:J}=$;return{top:0,left:0,right:Z,bottom:J,width:Z,height:J}}function a50($,Z){if(Z===void 0)Z=$4($).getComputedStyle($);return Z.position==="fixed"}function o50($,Z){if(Z===void 0)Z=$4($).getComputedStyle($);let J=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((B)=>{let Q=Z[B];return typeof Q==="string"?J.test(Q):!1})}function AA($,Z){let J=[];function H(B){if(Z!=null&&J.length>=Z)return J;if(!B)return J;if(PK(B)&&B.scrollingElement!=null&&!J.includes(B.scrollingElement))return J.push(B.scrollingElement),J;if(!vZ(B)||KA(B))return J;if(J.includes(B))return J;let Q=$4($).getComputedStyle(B);if(B!==$){if(o50(B,Q))J.push(B)}if(a50(B,Q))return J;return H(B.parentNode)}if(!$)return J;return H($)}function TR($){let[Z]=AA($,1);return Z!=null?Z:null}function UA($){if(!UB||!$)return null;if(i7($))return $;if(!MK($))return null;if(PK($)||$===r7($).scrollingElement)return window;if(vZ($))return $;return null}function CR($){if(i7($))return $.scrollX;return $.scrollLeft}function ER($){if(i7($))return $.scrollY;return $.scrollTop}function WA($){return{x:CR($),y:ER($)}}var C2;(function($){$[$.Forward=1]="Forward",$[$.Backward=-1]="Backward"})(C2||(C2={}));function wR($){if(!UB||!$)return!1;return $===document.scrollingElement}function SR($){let Z={x:0,y:0},J=wR($)?{height:window.innerHeight,width:window.innerWidth}:{height:$.clientHeight,width:$.clientWidth},H={x:$.scrollWidth-J.width,y:$.scrollHeight-J.height},B=$.scrollTop<=Z.y,Q=$.scrollLeft<=Z.x,X=$.scrollTop>=H.y,z=$.scrollLeft>=H.x;return{isTop:B,isLeft:Q,isBottom:X,isRight:z,maxScroll:H,minScroll:Z}}var n50={x:0.2,y:0.2};function s50($,Z,J,H,B){let{top:Q,left:X,right:z,bottom:G}=J;if(H===void 0)H=10;if(B===void 0)B=n50;let{isTop:K,isBottom:U,isLeft:Y,isRight:F}=SR($),W={x:0,y:0},q={x:0,y:0},N={height:Z.height*B.y,width:Z.width*B.x};if(!K&&Q<=Z.top+N.height)W.y=C2.Backward,q.y=H*Math.abs((Z.top+N.height-Q)/N.height);else if(!U&&G>=Z.bottom-N.height)W.y=C2.Forward,q.y=H*Math.abs((Z.bottom-N.height-G)/N.height);if(!F&&z>=Z.right-N.width)W.x=C2.Forward,q.x=H*Math.abs((Z.right-N.width-z)/N.width);else if(!Y&&X<=Z.left+N.width)W.x=C2.Backward,q.x=H*Math.abs((Z.left+N.width-X)/N.width);return{direction:W,speed:q}}function t50($){if($===document.scrollingElement){let{innerWidth:Q,innerHeight:X}=window;return{top:0,left:0,right:Q,bottom:X,width:Q,height:X}}let{top:Z,left:J,right:H,bottom:B}=$.getBoundingClientRect();return{top:Z,left:J,right:H,bottom:B,width:$.clientWidth,height:$.clientHeight}}function IR($){return $.reduce((Z,J)=>{return a7(Z,WA(J))},r8)}function e50($){return $.reduce((Z,J)=>{return Z+CR(J)},0)}function $20($){return $.reduce((Z,J)=>{return Z+ER(J)},0)}function RR($,Z){if(Z===void 0)Z=LB;if(!$)return;let{top:J,left:H,bottom:B,right:Q}=Z($);if(!TR($))return;if(B<=0||Q<=0||J>=window.innerHeight||H>=window.innerWidth)$.scrollIntoView({block:"center",inline:"center"})}var Z20=[["x",["left","right"],e50],["y",["top","bottom"],$20]];class CK{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=AA(Z),H=IR(J);this.rect={...$},this.width=$.width,this.height=$.height;for(let[B,Q,X]of Z20)for(let z of Q)Object.defineProperty(this,z,{get:()=>{let G=X(J),K=H[B]-G;return this.rect[z]+K},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class mZ{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 H;(H=this.target)==null||H.addEventListener($,Z,J),this.listeners.push([$,Z,J])}}function J20($){let{EventTarget:Z}=$4($);return $ instanceof Z?$:r7($)}function YA($,Z){let J=Math.abs($.x),H=Math.abs($.y);if(typeof Z==="number")return Math.sqrt(J**2+H**2)>Z;if("x"in Z&&"y"in Z)return J>Z.x&&H>Z.y;if("x"in Z)return J>Z.x;if("y"in Z)return H>Z.y;return!1}var j8;(function($){$.Click="click",$.DragStart="dragstart",$.Keydown="keydown",$.ContextMenu="contextmenu",$.Resize="resize",$.SelectionChange="selectionchange",$.VisibilityChange="visibilitychange"})(j8||(j8={}));function UR($){$.preventDefault()}function H20($){$.stopPropagation()}var o1;(function($){$.Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter",$.Tab="Tab"})(o1||(o1={}));var bR={start:[o1.Space,o1.Enter],cancel:[o1.Esc],end:[o1.Space,o1.Enter,o1.Tab]},B20=($,Z)=>{let{currentCoordinates:J}=Z;switch($.code){case o1.Right:return{...J,x:J.x+25};case o1.Left:return{...J,x:J.x-25};case o1.Down:return{...J,y:J.y+25};case o1.Up:return{...J,y:J.y-25}}return};class MB{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 mZ(r7(Z)),this.windowListeners=new mZ($4(Z)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(j8.Resize,this.handleCancel),this.windowListeners.add(j8.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(j8.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:$,onStart:Z}=this.props,J=$.node.current;if(J)RR(J);Z(r8)}handleKeyDown($){if(_K($)){let{active:Z,context:J,options:H}=this.props,{keyboardCodes:B=bR,coordinateGetter:Q=B20,scrollBehavior:X="smooth"}=H,{code:z}=$;if(B.end.includes(z)){this.handleEnd($);return}if(B.cancel.includes(z)){this.handleCancel($);return}let{collisionRect:G}=J.current,K=G?{x:G.left,y:G.top}:r8;if(!this.referenceCoordinates)this.referenceCoordinates=K;let U=Q($,{active:Z,context:J.current,currentCoordinates:K});if(U){let Y=NB(U,K),F={x:0,y:0},{scrollableAncestors:W}=J.current;for(let q of W){let N=$.code,{isTop:A,isRight:V,isLeft:D,isBottom:L,maxScroll:j,minScroll:M}=SR(q),P=t50(q),w={x:Math.min(N===o1.Right?P.right-P.width/2:P.right,Math.max(N===o1.Right?P.left:P.left+P.width/2,U.x)),y:Math.min(N===o1.Down?P.bottom-P.height/2:P.bottom,Math.max(N===o1.Down?P.top:P.top+P.height/2,U.y))},C=N===o1.Right&&!V||N===o1.Left&&!D,R=N===o1.Down&&!L||N===o1.Up&&!A;if(C&&w.x!==U.x){let O=q.scrollLeft+Y.x,S=N===o1.Right&&O<=j.x||N===o1.Left&&O>=M.x;if(S&&!Y.y){q.scrollTo({left:O,behavior:X});return}if(S)F.x=q.scrollLeft-O;else F.x=N===o1.Right?q.scrollLeft-j.x:q.scrollLeft-M.x;if(F.x)q.scrollBy({left:-F.x,behavior:X});break}else if(R&&w.y!==U.y){let O=q.scrollTop+Y.y,S=N===o1.Down&&O<=j.y||N===o1.Up&&O>=M.y;if(S&&!Y.x){q.scrollTo({top:O,behavior:X});return}if(S)F.y=q.scrollTop-O;else F.y=N===o1.Down?q.scrollTop-j.y:q.scrollTop-M.y;if(F.y)q.scrollBy({top:-F.y,behavior:X});break}}this.handleMove($,a7(NB(U,this.referenceCoordinates),F))}}}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()}}MB.activators=[{eventName:"onKeyDown",handler:($,Z,J)=>{let{keyboardCodes:H=bR,onActivation:B}=Z,{active:Q}=J,{code:X}=$.nativeEvent;if(H.start.includes(X)){let z=Q.activatorNode.current;if(z&&$.target!==z)return!1;return $.preventDefault(),B==null||B({event:$.nativeEvent}),!0}return!1}}];function YR($){return Boolean($&&"distance"in $)}function FR($){return Boolean($&&"delay"in $)}class EK{constructor($,Z,J){var H;if(J===void 0)J=J20($.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:B}=$,{target:Q}=B;this.props=$,this.events=Z,this.document=r7(Q),this.documentListeners=new mZ(this.document),this.listeners=new mZ(J),this.windowListeners=new mZ($4(Q)),this.initialCoordinates=(H=VB(B))!=null?H:r8,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(j8.Resize,this.handleCancel),this.windowListeners.add(j8.DragStart,UR),this.windowListeners.add(j8.VisibilityChange,this.handleCancel),this.windowListeners.add(j8.ContextMenu,UR),this.documentListeners.add(j8.Keydown,this.handleKeydown),Z){if(J!=null&&J({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(FR(Z)){this.timeoutId=setTimeout(this.handleStart,Z.delay),this.handlePending(Z);return}if(YR(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:H}=this.props;H(J,$,this.initialCoordinates,Z)}handleStart(){let{initialCoordinates:$}=this,{onStart:Z}=this.props;if($)this.activated=!0,this.documentListeners.add(j8.Click,H20,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(j8.SelectionChange,this.removeTextSelection),Z($)}handleMove($){var Z;let{activated:J,initialCoordinates:H,props:B}=this,{onMove:Q,options:{activationConstraint:X}}=B;if(!H)return;let z=(Z=VB($))!=null?Z:r8,G=NB(H,z);if(!J&&X){if(YR(X)){if(X.tolerance!=null&&YA(G,X.tolerance))return this.handleCancel();if(YA(G,X.distance))return this.handleStart()}if(FR(X)){if(YA(G,X.tolerance))return this.handleCancel()}this.handlePending(X,G);return}if($.cancelable)$.preventDefault();Q(z)}handleEnd(){let{onAbort:$,onEnd:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleCancel(){let{onAbort:$,onCancel:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleKeydown($){if($.code===o1.Esc)this.handleCancel()}removeTextSelection(){var $;($=this.document.getSelection())==null||$.removeAllRanges()}}var Q20={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class PB extends EK{constructor($){let{event:Z}=$,J=r7(Z.target);super($,Q20,J)}}PB.activators=[{eventName:"onPointerDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:H}=Z;if(!J.isPrimary||J.button!==0)return!1;return H==null||H({event:J}),!0}}];var X20={move:{name:"mousemove"},end:{name:"mouseup"}},qA;(function($){$[$.RightClick=2]="RightClick"})(qA||(qA={}));class kR extends EK{constructor($){super($,X20,r7($.event.target))}}kR.activators=[{eventName:"onMouseDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:H}=Z;if(J.button===qA.RightClick)return!1;return H==null||H({event:J}),!0}}];var FA={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class yR extends EK{constructor($){super($,FA)}static setup(){return window.addEventListener(FA.move.name,$,{capture:!1,passive:!1}),function(){window.removeEventListener(FA.move.name,$)};function $(){}}}yR.activators=[{eventName:"onTouchStart",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:H}=Z,{touches:B}=J;if(B.length>1)return!1;return H==null||H({event:J}),!0}}];var AB;(function($){$[$.Pointer=0]="Pointer",$[$.DraggableRect=1]="DraggableRect"})(AB||(AB={}));var TK;(function($){$[$.TreeOrder=0]="TreeOrder",$[$.ReversedTreeOrder=1]="ReversedTreeOrder"})(TK||(TK={}));function z20($){let{acceleration:Z,activator:J=AB.Pointer,canScroll:H,draggingRect:B,enabled:Q,interval:X=5,order:z=TK.TreeOrder,pointerCoordinates:G,scrollableAncestors:K,scrollableAncestorRects:U,delta:Y,threshold:F}=$,W=K20({delta:Y,disabled:!Q}),[q,N]=JR(),A=D0.useRef({x:0,y:0}),V=D0.useRef({x:0,y:0}),D=D0.useMemo(()=>{switch(J){case AB.Pointer:return G?{top:G.y,bottom:G.y,left:G.x,right:G.x}:null;case AB.DraggableRect:return B}},[J,B,G]),L=D0.useRef(null),j=D0.useCallback(()=>{let P=L.current;if(!P)return;let w=A.current.x*V.current.x,C=A.current.y*V.current.y;P.scrollBy(w,C)},[]),M=D0.useMemo(()=>z===TK.TreeOrder?[...K].reverse():K,[z,K]);D0.useEffect(()=>{if(!Q||!K.length||!D){N();return}for(let P of M){if((H==null?void 0:H(P))===!1)continue;let w=K.indexOf(P),C=U[w];if(!C)continue;let{direction:R,speed:O}=s50(P,C,D,Z,F);for(let S of["x","y"])if(!W[S][R[S]])O[S]=0,R[S]=0;if(O.x>0||O.y>0){N(),L.current=P,q(j,X),A.current=O,V.current=R;return}}A.current={x:0,y:0},V.current={x:0,y:0},N()},[Z,j,H,N,Q,X,JSON.stringify(D),JSON.stringify(W),q,K,M,U,JSON.stringify(F)])}var G20={x:{[C2.Backward]:!1,[C2.Forward]:!1},y:{[C2.Backward]:!1,[C2.Forward]:!1}};function K20($){let{delta:Z,disabled:J}=$,H=WB(Z);return fZ((B)=>{if(J||!H||!B)return G20;let Q={x:Math.sign(Z.x-H.x),y:Math.sign(Z.y-H.y)};return{x:{[C2.Backward]:B.x[C2.Backward]||Q.x===-1,[C2.Forward]:B.x[C2.Forward]||Q.x===1},y:{[C2.Backward]:B.y[C2.Backward]||Q.y===-1,[C2.Forward]:B.y[C2.Forward]||Q.y===1}}},[J,Z,H])}function U20($,Z){let J=Z!=null?$.get(Z):void 0,H=J?J.node.current:null;return fZ((B)=>{var Q;if(Z==null)return null;return(Q=H!=null?H:B)!=null?Q:null},[H,Z])}function Y20($,Z){return D0.useMemo(()=>$.reduce((J,H)=>{let{sensor:B}=H,Q=B.activators.map((X)=>({eventName:X.eventName,handler:Z(X.handler,H)}));return[...J,...Q]},[]),[$,Z])}var DB;(function($){$[$.Always=0]="Always",$[$.BeforeDragging=1]="BeforeDragging",$[$.WhileDragging=2]="WhileDragging"})(DB||(DB={}));var NA;(function($){$.Optimized="optimized"})(NA||(NA={}));var WR=new Map;function F20($,Z){let{dragging:J,dependencies:H,config:B}=Z,[Q,X]=D0.useState(null),{frequency:z,measure:G,strategy:K}=B,U=D0.useRef($),Y=A(),F=gZ(Y),W=D0.useCallback(function(V){if(V===void 0)V=[];if(F.current)return;X((D)=>{if(D===null)return V;return D.concat(V.filter((L)=>!D.includes(L)))})},[F]),q=D0.useRef(null),N=fZ((V)=>{if(Y&&!J)return WR;if(!V||V===WR||U.current!==$||Q!=null){let D=new Map;for(let L of $){if(!L)continue;if(Q&&Q.length>0&&!Q.includes(L.id)&&L.rect.current){D.set(L.id,L.rect.current);continue}let j=L.node.current,M=j?new CK(G(j),j):null;if(L.rect.current=M,M)D.set(L.id,M)}return D}return V},[$,Q,J,Y,G]);return D0.useEffect(()=>{U.current=$},[$]),D0.useEffect(()=>{if(Y)return;W()},[J,Y]),D0.useEffect(()=>{if(Q&&Q.length>0)X(null)},[JSON.stringify(Q)]),D0.useEffect(()=>{if(Y||typeof z!=="number"||q.current!==null)return;q.current=setTimeout(()=>{W(),q.current=null},z)},[z,Y,W,...H]),{droppableRects:N,measureDroppableContainers:W,measuringScheduled:Q!=null};function A(){switch(K){case DB.Always:return!1;case DB.BeforeDragging:return J;default:return!J}}}function DA($,Z){return fZ((J)=>{if(!$)return null;if(J)return J;return typeof Z==="function"?Z($):$},[Z,$])}function W20($,Z){return DA($,Z)}function q20($){let{callback:Z,disabled:J}=$,H=YB(Z),B=D0.useMemo(()=>{if(J||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:Q}=window;return new Q(H)},[H,J]);return D0.useEffect(()=>{return()=>B==null?void 0:B.disconnect()},[B]),B}function wK($){let{callback:Z,disabled:J}=$,H=YB(Z),B=D0.useMemo(()=>{if(J||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:Q}=window;return new Q(H)},[J]);return D0.useEffect(()=>{return()=>B==null?void 0:B.disconnect()},[B]),B}function N20($){return new CK(LB($),$)}function qR($,Z,J){if(Z===void 0)Z=N20;let[H,B]=D0.useState(null);function Q(){B((G)=>{if(!$)return null;if($.isConnected===!1){var K;return(K=G!=null?G:J)!=null?K:null}let U=Z($);if(JSON.stringify(G)===JSON.stringify(U))return G;return U})}let X=q20({callback(G){if(!$)return;for(let K of G){let{type:U,target:Y}=K;if(U==="childList"&&Y instanceof HTMLElement&&Y.contains($)){Q();break}}}}),z=wK({callback:Q});return x9(()=>{if(Q(),$)z==null||z.observe($),X==null||X.observe(document.body,{childList:!0,subtree:!0});else z==null||z.disconnect(),X==null||X.disconnect()},[$]),H}function V20($){let Z=DA($);return jR($,Z)}var NR=[];function A20($){let Z=D0.useRef($),J=fZ((H)=>{if(!$)return NR;if(H&&H!==NR&&$&&Z.current&&$.parentNode===Z.current.parentNode)return H;return AA($)},[$]);return D0.useEffect(()=>{Z.current=$},[$]),J}function D20($){let[Z,J]=D0.useState(null),H=D0.useRef($),B=D0.useCallback((Q)=>{let X=UA(Q.target);if(!X)return;J((z)=>{if(!z)return null;return z.set(X,WA(X)),new Map(z)})},[]);return D0.useEffect(()=>{let Q=H.current;if($!==Q){X(Q);let z=$.map((G)=>{let K=UA(G);if(K)return K.addEventListener("scroll",B,{passive:!0}),[K,WA(K)];return null}).filter((G)=>G!=null);J(z.length?new Map(z):null),H.current=$}return()=>{X($),X(Q)};function X(z){z.forEach((G)=>{let K=UA(G);K==null||K.removeEventListener("scroll",B)})}},[B,$]),D0.useMemo(()=>{if($.length)return Z?Array.from(Z.values()).reduce((Q,X)=>a7(Q,X),r8):IR($);return r8},[$,Z])}function VR($,Z){if(Z===void 0)Z=[];let J=D0.useRef(null);return D0.useEffect(()=>{J.current=null},Z),D0.useEffect(()=>{let H=$!==r8;if(H&&!J.current)J.current=$;if(!H&&J.current)J.current=null},[$]),J.current?NB($,J.current):r8}function L20($){D0.useEffect(()=>{if(!UB)return;let Z=$.map((J)=>{let{sensor:H}=J;return H.setup==null?void 0:H.setup()});return()=>{for(let J of Z)J==null||J()}},$.map((Z)=>{let{sensor:J}=Z;return J}))}function M20($,Z){return D0.useMemo(()=>{return $.reduce((J,H)=>{let{eventName:B,handler:Q}=H;return J[B]=(X)=>{Q(X,Z)},J},{})},[$,Z])}function xR($){return D0.useMemo(()=>$?r50($):null,[$])}var AR=[];function P20($,Z){if(Z===void 0)Z=LB;let[J]=$,H=xR(J?$4(J):null),[B,Q]=D0.useState(AR);function X(){Q(()=>{if(!$.length)return AR;return $.map((G)=>wR(G)?H:new CK(Z(G),G))})}let z=wK({callback:X});return x9(()=>{z==null||z.disconnect(),X(),$.forEach((G)=>z==null?void 0:z.observe(G))},[$]),B}function hR($){if(!$)return null;if($.children.length>1)return $;let Z=$.children[0];return vZ(Z)?Z:$}function _20($){let{measure:Z}=$,[J,H]=D0.useState(null),B=D0.useCallback((K)=>{for(let{target:U}of K)if(vZ(U)){H((Y)=>{let F=Z(U);return Y?{...Y,width:F.width,height:F.height}:F});break}},[Z]),Q=wK({callback:B}),X=D0.useCallback((K)=>{let U=hR(K);if(Q==null||Q.disconnect(),U)Q==null||Q.observe(U);H(U?Z(U):null)},[Z,Q]),[z,G]=FB(X);return D0.useMemo(()=>({nodeRef:z,rect:J,setRef:G}),[J,z,G])}var j20=[{sensor:PB,options:{}},{sensor:MB,options:{}}],O20={current:{}},jK={draggable:{measure:KR},droppable:{measure:KR,strategy:DB.WhileDragging,frequency:NA.Optimized},dragOverlay:{measure:LB}};class uZ 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 T20={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new uZ,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:OK},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:jK,measureDroppableContainers:OK,windowRect:null,measuringScheduled:!1},vR={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:OK,draggableNodes:new Map,over:null,measureDroppableContainers:OK},_B=D0.createContext(vR),gR=D0.createContext(T20);function C20(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new uZ}}}function E20($,Z){switch(Z.type){case U2.DragStart:return{...$,draggable:{...$.draggable,initialCoordinates:Z.initialCoordinates,active:Z.active}};case U2.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 U2.DragEnd:case U2.DragCancel:return{...$,draggable:{...$.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case U2.RegisterDroppable:{let{element:J}=Z,{id:H}=J,B=new uZ($.droppable.containers);return B.set(H,J),{...$,droppable:{...$.droppable,containers:B}}}case U2.SetDroppableDisabled:{let{id:J,key:H,disabled:B}=Z,Q=$.droppable.containers.get(J);if(!Q||H!==Q.key)return $;let X=new uZ($.droppable.containers);return X.set(J,{...Q,disabled:B}),{...$,droppable:{...$.droppable,containers:X}}}case U2.UnregisterDroppable:{let{id:J,key:H}=Z,B=$.droppable.containers.get(J);if(!B||H!==B.key)return $;let Q=new uZ($.droppable.containers);return Q.delete(J),{...$,droppable:{...$.droppable,containers:Q}}}default:return $}}function w20($){let{disabled:Z}=$,{active:J,activatorEvent:H,draggableNodes:B}=D0.useContext(_B),Q=WB(H),X=WB(J==null?void 0:J.id);return D0.useEffect(()=>{if(Z)return;if(!H&&Q&&X!=null){if(!_K(Q))return;if(document.activeElement===Q.target)return;let z=B.get(X);if(!z)return;let{activatorNode:G,node:K}=z;if(!G.current&&!K.current)return;requestAnimationFrame(()=>{for(let U of[G.current,K.current]){if(!U)continue;let Y=BR(U);if(Y){Y.focus();break}}})}},[H,Z,B,X,Q]),null}function fR($,Z){let{transform:J,...H}=Z;return $!=null&&$.length?$.reduce((B,Q)=>{return Q({transform:B,...H})},J):J}function S20($){return D0.useMemo(()=>({draggable:{...jK.draggable,...$==null?void 0:$.draggable},droppable:{...jK.droppable,...$==null?void 0:$.droppable},dragOverlay:{...jK.dragOverlay,...$==null?void 0:$.dragOverlay}}),[$==null?void 0:$.draggable,$==null?void 0:$.droppable,$==null?void 0:$.dragOverlay])}function I20($){let{activeNode:Z,measure:J,initialRect:H,config:B=!0}=$,Q=D0.useRef(!1),{x:X,y:z}=typeof B==="boolean"?{x:B,y:B}:B;x9(()=>{if(!X&&!z||!Z){Q.current=!1;return}if(Q.current||!H)return;let K=Z==null?void 0:Z.node.current;if(!K||K.isConnected===!1)return;let U=J(K),Y=jR(U,H);if(!X)Y.x=0;if(!z)Y.y=0;if(Q.current=!0,Math.abs(Y.x)>0||Math.abs(Y.y)>0){let F=TR(K);if(F)F.scrollBy({top:Y.y,left:Y.x})}},[Z,X,z,H,J])}var SK=D0.createContext({...r8,scaleX:1,scaleY:1}),D6;(function($){$[$.Uninitialized=0]="Uninitialized",$[$.Initializing=1]="Initializing",$[$.Initialized=2]="Initialized"})(D6||(D6={}));var mR=D0.memo(function(Z){var J,H,B,Q;let{id:X,accessibility:z,autoScroll:G=!0,children:K,sensors:U=j20,collisionDetection:Y=u50,measuring:F,modifiers:W,...q}=Z,N=D0.useReducer(E20,void 0,C20),[A,V]=N,[D,L]=R50(),[j,M]=D0.useState(D6.Uninitialized),P=j===D6.Initialized,{draggable:{active:w,nodes:C,translate:R},droppable:{containers:O}}=A,S=w!=null?C.get(w):null,y=D0.useRef({initial:null,translated:null}),k=D0.useMemo(()=>{var C0;return w!=null?{id:w,data:(C0=S==null?void 0:S.data)!=null?C0:O20,rect:y}:null},[w,S]),T=D0.useRef(null),[b,I]=D0.useState(null),[v,h]=D0.useState(null),f=gZ(q,Object.values(q)),E=qB("DndDescribedBy",X),i=D0.useMemo(()=>O.getEnabled(),[O]),r=S20(F),{droppableRects:x,measureDroppableContainers:l,measuringScheduled:o}=F20(i,{dragging:P,dependencies:[R.x,R.y],config:r.droppable}),u=U20(C,w),c=D0.useMemo(()=>v?VB(v):null,[v]),n=s1(),Z0=W20(u,r.draggable.measure);I20({activeNode:w!=null?C.get(w):null,config:n.layoutShiftCompensation,initialRect:Z0,measure:r.draggable.measure});let J0=qR(u,r.draggable.measure,Z0),X0=qR(u?u.parentElement:null),Q0=D0.useRef({activatorEvent:null,active:null,activeNode:u,collisionRect:null,collisions:null,droppableRects:x,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),F0=O.getNodeFor((J=Q0.current.over)==null?void 0:J.id),A0=_20({measure:r.dragOverlay.measure}),N0=(H=A0.nodeRef.current)!=null?H:u,Y0=P?(B=A0.rect)!=null?B:J0:null,s=Boolean(A0.nodeRef.current&&A0.rect),a=V20(s?null:J0),e=xR(N0?$4(N0):null),$0=A20(P?F0!=null?F0:u:null),B0=P20($0),_0=fR(W,{transform:{x:R.x-a.x,y:R.y-a.y,scaleX:1,scaleY:1},activatorEvent:v,active:k,activeNodeRect:J0,containerNodeRect:X0,draggingNodeRect:Y0,over:Q0.current.over,overlayNodeRect:A0.rect,scrollableAncestors:$0,scrollableAncestorRects:B0,windowRect:e}),M0=c?a7(c,R):null,V0=D20($0),L0=VR(V0),g=VR(V0,[J0]),m=a7(_0,L0),t=Y0?d50(Y0,_0):null,W0=k&&t?Y({active:k,collisionRect:t,droppableRects:x,droppableContainers:i,pointerCoordinates:M0}):null,R0=f50(W0,"id"),[c0,f0]=D0.useState(null),T0=s?_0:a7(_0,g),x0=p50(T0,(Q=c0==null?void 0:c0.rect)!=null?Q:null,J0),Z1=D0.useRef(null),W1=D0.useCallback((C0,p0)=>{let{sensor:i0,options:a0}=p0;if(T.current==null)return;let A1=C.get(T.current);if(!A1)return;let D1=C0.nativeEvent,u1=new i0({active:T.current,activeNode:A1,event:D1,options:a0,context:Q0,onAbort(P0){if(!C.get(P0))return;let{onDragAbort:Q1}=f.current,j1={id:P0};Q1==null||Q1(j1),D({type:"onDragAbort",event:j1})},onPending(P0,l0,Q1,j1){if(!C.get(P0))return;let{onDragPending:r0}=f.current,y0={id:P0,constraint:l0,initialCoordinates:Q1,offset:j1};r0==null||r0(y0),D({type:"onDragPending",event:y0})},onStart(P0){let l0=T.current;if(l0==null)return;let Q1=C.get(l0);if(!Q1)return;let{onDragStart:j1}=f.current,k0={activatorEvent:D1,active:{id:l0,data:Q1.data,rect:y}};n7.unstable_batchedUpdates(()=>{j1==null||j1(k0),M(D6.Initializing),V({type:U2.DragStart,initialCoordinates:P0,active:l0}),D({type:"onDragStart",event:k0}),I(Z1.current),h(D1)})},onMove(P0){V({type:U2.DragMove,coordinates:P0})},onEnd:q0(U2.DragEnd),onCancel:q0(U2.DragCancel)});Z1.current=u1;function q0(P0){return async function(){let{active:Q1,collisions:j1,over:k0,scrollAdjustedTranslate:r0}=Q0.current,y0=null;if(Q1&&r0){let{cancelDrop:X1}=f.current;if(y0={activatorEvent:D1,active:Q1,collisions:j1,delta:r0,over:k0},P0===U2.DragEnd&&typeof X1==="function"){if(await Promise.resolve(X1(y0)))P0=U2.DragCancel}}T.current=null,n7.unstable_batchedUpdates(()=>{V({type:P0}),M(D6.Uninitialized),f0(null),I(null),h(null),Z1.current=null;let X1=P0===U2.DragEnd?"onDragEnd":"onDragCancel";if(y0){let S1=f.current[X1];S1==null||S1(y0),D({type:X1,event:y0})}})}}},[C]),d0=D0.useCallback((C0,p0)=>{return(i0,a0)=>{let A1=i0.nativeEvent,D1=C.get(a0);if(T.current!==null||!D1||A1.dndKit||A1.defaultPrevented)return;let u1={active:D1};if(C0(i0,p0.options,u1)===!0)A1.dndKit={capturedBy:p0.sensor},T.current=a0,W1(i0,p0)}},[C,W1]),v0=Y20(U,d0);L20(U),x9(()=>{if(J0&&j===D6.Initializing)M(D6.Initialized)},[J0,j]),D0.useEffect(()=>{let{onDragMove:C0}=f.current,{active:p0,activatorEvent:i0,collisions:a0,over:A1}=Q0.current;if(!p0||!i0)return;let D1={active:p0,activatorEvent:i0,collisions:a0,delta:{x:m.x,y:m.y},over:A1};n7.unstable_batchedUpdates(()=>{C0==null||C0(D1),D({type:"onDragMove",event:D1})})},[m.x,m.y]),D0.useEffect(()=>{let{active:C0,activatorEvent:p0,collisions:i0,droppableContainers:a0,scrollAdjustedTranslate:A1}=Q0.current;if(!C0||T.current==null||!p0||!A1)return;let{onDragOver:D1}=f.current,u1=a0.get(R0),q0=u1&&u1.rect.current?{id:u1.id,rect:u1.rect.current,data:u1.data,disabled:u1.disabled}:null,P0={active:C0,activatorEvent:p0,collisions:i0,delta:{x:A1.x,y:A1.y},over:q0};n7.unstable_batchedUpdates(()=>{f0(q0),D1==null||D1(P0),D({type:"onDragOver",event:P0})})},[R0]),x9(()=>{Q0.current={activatorEvent:v,active:k,activeNode:u,collisionRect:t,collisions:W0,droppableRects:x,draggableNodes:C,draggingNode:N0,draggingNodeRect:Y0,droppableContainers:O,over:c0,scrollableAncestors:$0,scrollAdjustedTranslate:m},y.current={initial:Y0,translated:t}},[k,u,W0,t,C,N0,Y0,x,O,c0,$0,m]),z20({...n,delta:R,draggingRect:t,pointerCoordinates:M0,scrollableAncestors:$0,scrollableAncestorRects:B0});let w1=D0.useMemo(()=>{return{active:k,activeNode:u,activeNodeRect:J0,activatorEvent:v,collisions:W0,containerNodeRect:X0,dragOverlay:A0,draggableNodes:C,droppableContainers:O,droppableRects:x,over:c0,measureDroppableContainers:l,scrollableAncestors:$0,scrollableAncestorRects:B0,measuringConfiguration:r,measuringScheduled:o,windowRect:e}},[k,u,J0,v,W0,X0,A0,C,O,x,c0,l,$0,B0,r,o,e]),B1=D0.useMemo(()=>{return{activatorEvent:v,activators:v0,active:k,activeNodeRect:J0,ariaDescribedById:{draggable:E},dispatch:V,draggableNodes:C,over:c0,measureDroppableContainers:l}},[v,v0,k,J0,V,E,C,c0,l]);return D0.default.createElement(MR.Provider,{value:L},D0.default.createElement(_B.Provider,{value:B1},D0.default.createElement(gR.Provider,{value:w1},D0.default.createElement(SK.Provider,{value:x0},K)),D0.default.createElement(w20,{disabled:(z==null?void 0:z.restoreFocus)===!1})),D0.default.createElement(y50,{...z,hiddenTextDescribedById:E}));function s1(){let C0=(b==null?void 0:b.autoScrollEnabled)===!1,p0=typeof G==="object"?G.enabled===!1:G===!1,i0=P&&!C0&&!p0;if(typeof G==="object")return{...G,enabled:i0};return{enabled:i0}}}),R20=D0.createContext(null),DR="button",b20="Draggable";function uR($){let{id:Z,data:J,disabled:H=!1,attributes:B}=$,Q=qB(b20),{activators:X,activatorEvent:z,active:G,activeNodeRect:K,ariaDescribedById:U,draggableNodes:Y,over:F}=D0.useContext(_B),{role:W=DR,roleDescription:q="draggable",tabIndex:N=0}=B!=null?B:{},A=(G==null?void 0:G.id)===Z,V=D0.useContext(A?SK:R20),[D,L]=FB(),[j,M]=FB(),P=M20(X,Z),w=gZ(J);x9(()=>{return Y.set(Z,{id:Z,key:Q,node:D,activatorNode:j,data:w}),()=>{let R=Y.get(Z);if(R&&R.key===Q)Y.delete(Z)}},[Y,Z]);let C=D0.useMemo(()=>({role:W,tabIndex:N,"aria-disabled":H,"aria-pressed":A&&W===DR?!0:void 0,"aria-roledescription":q,"aria-describedby":U.draggable}),[H,W,N,A,q,U.draggable]);return{active:G,activatorEvent:z,activeNodeRect:K,attributes:C,isDragging:A,listeners:H?void 0:P,node:D,over:F,setNodeRef:L,setActivatorNodeRef:M,transform:V}}function k20(){return D0.useContext(gR)}var y20="Droppable",x20={timeout:25};function pR($){let{data:Z,disabled:J=!1,id:H,resizeObserverConfig:B}=$,Q=qB(y20),{active:X,dispatch:z,over:G,measureDroppableContainers:K}=D0.useContext(_B),U=D0.useRef({disabled:J}),Y=D0.useRef(!1),F=D0.useRef(null),W=D0.useRef(null),{disabled:q,updateMeasurementsFor:N,timeout:A}={...x20,...B},V=gZ(N!=null?N:H),D=D0.useCallback(()=>{if(!Y.current){Y.current=!0;return}if(W.current!=null)clearTimeout(W.current);W.current=setTimeout(()=>{K(Array.isArray(V.current)?V.current:[V.current]),W.current=null},A)},[A]),L=wK({callback:D,disabled:q||!X}),j=D0.useCallback((C,R)=>{if(!L)return;if(R)L.unobserve(R),Y.current=!1;if(C)L.observe(C)},[L]),[M,P]=FB(j),w=gZ(Z);return D0.useEffect(()=>{if(!L||!M.current)return;L.disconnect(),Y.current=!1,L.observe(M.current)},[M,L]),D0.useEffect(()=>{return z({type:U2.RegisterDroppable,element:{id:H,key:Q,disabled:J,node:M,rect:F,data:w}}),()=>z({type:U2.UnregisterDroppable,key:Q,id:H})},[H]),D0.useEffect(()=>{if(J!==U.current.disabled)z({type:U2.SetDroppableDisabled,id:H,key:Q,disabled:J}),U.current.disabled=J},[H,Q,J,z]),{active:X,rect:F,isOver:(G==null?void 0:G.id)===H,node:M,over:G,setNodeRef:P}}function h20($){let{animation:Z,children:J}=$,[H,B]=D0.useState(null),[Q,X]=D0.useState(null),z=WB(J);if(!J&&!H&&z)B(z);return x9(()=>{if(!Q)return;let G=H==null?void 0:H.key,K=H==null?void 0:H.props.id;if(G==null||K==null){B(null);return}Promise.resolve(Z(K,Q)).then(()=>{B(null)})},[Z,H,Q]),D0.default.createElement(D0.default.Fragment,null,J,H?D0.cloneElement(H,{ref:X}):null)}var v20={x:0,y:0,scaleX:1,scaleY:1};function g20($){let{children:Z}=$;return D0.default.createElement(_B.Provider,{value:vR},D0.default.createElement(SK.Provider,{value:v20},Z))}var f20={position:"fixed",touchAction:"none"},m20=($)=>{return _K($)?"transform 250ms ease":void 0},u20=D0.forwardRef(($,Z)=>{let{as:J,activatorEvent:H,adjustScale:B,children:Q,className:X,rect:z,style:G,transform:K,transition:U=m20}=$;if(!z)return null;let Y=B?K:{...K,scaleX:1,scaleY:1},F={...f20,width:z.width,height:z.height,top:z.top,left:z.left,transform:hZ.Transform.toString(Y),transformOrigin:B&&H?h50(H,z):void 0,transition:typeof U==="function"?U(H):U,...G};return D0.default.createElement(J,{className:X,style:F,ref:Z},Q)}),p20=($)=>(Z)=>{let{active:J,dragOverlay:H}=Z,B={},{styles:Q,className:X}=$;if(Q!=null&&Q.active)for(let[z,G]of Object.entries(Q.active)){if(G===void 0)continue;B[z]=J.node.style.getPropertyValue(z),J.node.style.setProperty(z,G)}if(Q!=null&&Q.dragOverlay)for(let[z,G]of Object.entries(Q.dragOverlay)){if(G===void 0)continue;H.node.style.setProperty(z,G)}if(X!=null&&X.active)J.node.classList.add(X.active);if(X!=null&&X.dragOverlay)H.node.classList.add(X.dragOverlay);return function(){for(let[G,K]of Object.entries(B))J.node.style.setProperty(G,K);if(X!=null&&X.active)J.node.classList.remove(X.active)}},c20=($)=>{let{transform:{initial:Z,final:J}}=$;return[{transform:hZ.Transform.toString(Z)},{transform:hZ.Transform.toString(J)}]},d20={duration:250,easing:"ease",keyframes:c20,sideEffects:p20({styles:{active:{opacity:"0"}}})};function l20($){let{config:Z,draggableNodes:J,droppableContainers:H,measuringConfiguration:B}=$;return YB((Q,X)=>{if(Z===null)return;let z=J.get(Q);if(!z)return;let G=z.node.current;if(!G)return;let K=hR(X);if(!K)return;let{transform:U}=$4(X).getComputedStyle(X),Y=OR(U);if(!Y)return;let F=typeof Z==="function"?Z:i20(Z);return RR(G,B.draggable.measure),F({active:{id:Q,data:z.data,node:G,rect:B.draggable.measure(G)},draggableNodes:J,dragOverlay:{node:X,rect:B.dragOverlay.measure(K)},droppableContainers:H,measuringConfiguration:B,transform:Y})})}function i20($){let{duration:Z,easing:J,sideEffects:H,keyframes:B}={...d20,...$};return(Q)=>{let{active:X,dragOverlay:z,transform:G,...K}=Q;if(!Z)return;let U={x:z.rect.left-X.rect.left,y:z.rect.top-X.rect.top},Y={scaleX:G.scaleX!==1?X.rect.width*G.scaleX/z.rect.width:1,scaleY:G.scaleY!==1?X.rect.height*G.scaleY/z.rect.height:1},F={x:G.x-U.x,y:G.y-U.y,...Y},W=B({...K,active:X,dragOverlay:z,transform:{initial:G,final:F}}),[q]=W,N=W[W.length-1];if(JSON.stringify(q)===JSON.stringify(N))return;let A=H==null?void 0:H({active:X,dragOverlay:z,...K}),V=z.node.animate(W,{duration:Z,easing:J,fill:"forwards"});return new Promise((D)=>{V.onfinish=()=>{A==null||A(),D()}})}}var LR=0;function r20($){return D0.useMemo(()=>{if($==null)return;return LR++,LR},[$])}var cR=D0.default.memo(($)=>{let{adjustScale:Z=!1,children:J,dropAnimation:H,style:B,transition:Q,modifiers:X,wrapperElement:z="div",className:G,zIndex:K=999}=$,{activatorEvent:U,active:Y,activeNodeRect:F,containerNodeRect:W,draggableNodes:q,droppableContainers:N,dragOverlay:A,over:V,measuringConfiguration:D,scrollableAncestors:L,scrollableAncestorRects:j,windowRect:M}=k20(),P=D0.useContext(SK),w=r20(Y==null?void 0:Y.id),C=fR(X,{activatorEvent:U,active:Y,activeNodeRect:F,containerNodeRect:W,draggingNodeRect:A.rect,over:V,overlayNodeRect:A.rect,scrollableAncestors:L,scrollableAncestorRects:j,transform:P,windowRect:M}),R=DA(F),O=l20({config:H,draggableNodes:q,droppableContainers:N,measuringConfiguration:D}),S=R?A.setRef:void 0;return D0.default.createElement(g20,null,D0.default.createElement(h20,{animation:O},Y&&w?D0.default.createElement(u20,{key:w,id:Y.id,ref:S,as:z,activatorEvent:U,adjustScale:Z,className:G,transition:Q,rect:R,style:{zIndex:K,...B},transform:C},J):null))});var s7=_(d(),1),a20={start:[o1.Space],cancel:[o1.Esc],end:[o1.Space,o1.Tab]};function o20($,Z,J){let H=$.indexOf(Z),B=$.indexOf(J);if(H<0||B<0||H===B)return $;let Q=[...$],[X]=Q.splice(H,1);return Q.splice(B,0,X),Q}function IK({items:$,getId:Z,className:J,itemClassName:H,dragDisabled:B=!1,isItemDragDisabled:Q,onReorder:X,renderItem:z,renderPlaceholder:G,renderOverlay:K}){let U=PR(VA(PB,{activationConstraint:{distance:4}}),VA(MB,{keyboardCodes:a20})),[Y,F]=L6.useState(null),[W,q]=L6.useState(null),N=L6.useRef(null),A=L6.useMemo(()=>$.map(Z),[$,Z]),V=L6.useMemo(()=>new Map($.map((R)=>[Z(R),R])),[$,Z]),L=(Y&&W?W:A).map((R)=>V.get(R)).filter((R)=>Boolean(R)),j=Y?V.get(Y):void 0,M=Q?$.filter((R)=>!Q(R)).length:$.length,P=B||M<2;return s7.jsxs(mR,{sensors:U,collisionDetection:_R,onDragStart:(R)=>{let O=$.map(Z);F(String(R.active.id)),N.current=O,q(O)},onDragOver:(R)=>{let O=String(R.active.id),S=R.over?String(R.over.id):void 0,y=N.current;if(!S||S===O||!y)return;let k=o20(y,O,S);if(k===y)return;N.current=k,q(k)},onDragCancel:()=>{N.current=null,F(null),q(null)},onDragEnd:(R)=>{let O=String(R.active.id),S=N.current;if(N.current=null,F(null),q(null),!S||S.join("|")===A.join("|"))return;if(!S.includes(O))return;X(S)},children:[s7.jsx("div",{className:J,children:L.map((R)=>s7.jsx(n20,{id:Z(R),item:R,disabled:P||Q?.(R)===!0,itemClassName:H,renderItem:z,renderPlaceholder:G},Z(R)))}),s7.jsx(cR,{dropAnimation:null,children:j&&K?K(j):null})]})}function n20({id:$,item:Z,disabled:J,itemClassName:H,renderItem:B,renderPlaceholder:Q}){let{setNodeRef:X,isOver:z}=pR({id:$,disabled:J}),{attributes:G,listeners:K,setNodeRef:U,isDragging:Y}=uR({id:$,disabled:J,attributes:{roleDescription:"sortable item"}}),F=(q)=>{X(q),U(q)},W={isDragging:Y,isOver:z,dragDisabled:J,dragHandleProps:J?{}:{...G,...K}};return s7.jsxs(V5.div,{layout:!0,ref:F,className:G0("relative",H?.(Z,W)),transition:{type:"spring",duration:0.25,bounce:0},children:[Y&&Q?.(Z),B(Z,W)]})}var Y1=_(d(),1),s20="https://mlfrg.notion.site/3c678a44b6788042b734d775dd2e935e?pvs=105";function t20($){return G0(m7({variant:"ghost",size:"icon"}),$&&"bg-accent text-accent-foreground")}function RK({children:$,showWorkspaces:Z=!0}){let{data:J}=iz(),H=z1();return K2((B)=>{if(B.type==="workspace:updated"||B.type==="theme:updated"||B.type==="workspaces-list:updated")H.invalidateQueries({queryKey:S0.all,exact:!0})}),Y1.jsxs("div",{className:"flex h-dvh bg-muted transition-colors duration-100 ease-out motion-reduce:transition-none",children:[Y1.jsx(e20,{workspaces:Z?J??[]:[]}),Y1.jsx("main",{className:"flex min-w-0 flex-1 flex-col",children:$})]})}function e20({workspaces:$}){let Z=qE();return Y1.jsx(gz,{delay:500,children:Y1.jsxs("aside",{className:"flex h-full shrink-0 flex-col items-center gap-4 px-2 py-5 [font-family:var(--default-sans)]",children:[Y1.jsxs(B5,{children:[Y1.jsx(Q5,{render:Y1.jsx(F7,{href:"/","aria-label":"Home",className:t20,children:Y1.jsx(iR,{stroke:1.5})})}),Y1.jsx(X5,{side:"right",children:"Home"})]}),Y1.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&&Y1.jsxs(Y1.Fragment,{children:[Y1.jsx("div",{className:"no-scrollbar min-h-0 scroll-fade overflow-y-auto [--scroll-fade-reveal:16px]",children:Y1.jsx(IK,{items:$,getId:(J)=>J.id,className:"flex flex-col gap-4",onReorder:(J)=>Z.mutate(J),renderPlaceholder:()=>Y1.jsx("div",{className:"pointer-events-none absolute top-0 left-1 size-12 rounded-xl bg-accent"}),renderOverlay:(J)=>Y1.jsx(dR,{workspace:J,dragOverlay:!0}),renderItem:(J,H)=>Y1.jsx(dR,{workspace:J,dragState:H})})}),Y1.jsx("div",{className:"shrink-0",children:Y1.jsxs(B5,{children:[Y1.jsx(KB,{trigger:Y1.jsx(Q5,{render:Y1.jsx(j0,{type:"button",variant:"ghost",size:"icon-lg","aria-label":"Create new workspace",className:"text-muted-foreground hover:text-foreground",children:Y1.jsx(h2,{"data-icon":"inline-start",stroke:1.5})})})}),Y1.jsx(X5,{side:"right",children:"Create new workspace"})]})})]})}),Y1.jsx("div",{className:"size-8 shrink-0",children:Y1.jsx($40,{})})]})})}function $40(){let{cloudDemo:$}=I9(),Z=_E();if($)return Y1.jsx(CZ,{trigger:Y1.jsx(j0,{size:"icon","aria-label":"Unlock all features",title:"Unlock all features",children:Y1.jsx(rR,{stroke:1.5})})});if(Z.status==="loading")return null;if(Z.status==="available")return Y1.jsx(jE,{...Z.button});return Y1.jsx(Z40,{})}function Z40(){return Y1.jsxs(B5,{children:[Y1.jsx(Q5,{render:Y1.jsx(j0,{render:Y1.jsx("a",{href:s20,target:"_blank",rel:"noreferrer"}),variant:"ghost",size:"icon","aria-label":"Leave feedback",className:"text-muted-foreground hover:text-foreground",children:Y1.jsx(lR,{stroke:1.5})})}),Y1.jsx(X5,{side:"right",children:"Leave feedback"})]})}function dR({workspace:$,dragOverlay:Z=!1,dragState:J}){let[H]=K8(),B=`/workspace/${$.id}`,Q=l7($),X=H===B||H.startsWith(`${B}/`),z=Y1.jsx("div",{className:G0(m7({variant:"ghost",size:"icon-lg"}),"pointer-events-none size-12 transition-[border-radius,background-color,color] duration-100 ease-out motion-reduce:transition-none",Z?"bg-background shadow-lg":"group-hover:bg-accent group-hover:text-accent-foreground group-focus-visible:ring-3 group-focus-visible:ring-ring/50",X&&!Z&&"bg-accent text-accent-foreground"),children:Y1.jsx(A6,{icon:$.icon,workspaceType:$.type,workspaceTheme:$.theme,className:"size-7 shrink-0 rounded-md transition-[border-radius] duration-100 ease-out motion-reduce:transition-none"})}),G=Y1.jsx("span",{className:"mt-0.5 line-clamp-2 w-full text-center text-[11px] leading-snug font-medium text-ellipsis text-foreground",children:Q});if(Z)return Y1.jsxs("span",{className:"flex w-14 flex-col items-center",children:[z,G]});return Y1.jsxs(F7,{href:B,"aria-label":Q,onClick:(K)=>{if(J?.isDragging)K.preventDefault()},className:G0("group flex w-14 flex-col items-center rounded-xl outline-none",J?.isDragging&&"invisible"),...J?.dragHandleProps,children:[z,Y1.jsxs(B5,{children:[Y1.jsx(Q5,{render:G}),Y1.jsx(X5,{side:"right",children:Q})]})]})}var Fk=_(p(),1);var aR=_(p(),1);var t7=_(d(),1);function J40({choice:$,availability:Z,isPending:J,errorMessage:H,onTypeChange:B,onSubmit:Q}){return t7.jsx(DK,{title:`Import ${l7($.workspace)}`,selectedType:$.selectedType,detectedTypes:$.workspace.types,availability:Z,isPending:J,errorMessage:H,secondaryAction:t7.jsx(uH,{render:t7.jsx(j0,{variant:"secondary"}),disabled:J,children:"Cancel"}),primaryLabel:"Add workspace",pendingLabel:"Adding…",onTypeChange:B,onSubmit:Q})}function oR({choice:$,availability:Z,isPending:J,errorMessage:H,onTypeChange:B,onSubmit:Q,onReset:X}){let[z,G]=aR.useState(!0);function K(Y){if(!Y&&J)return;G(Y)}function U(Y){if(!Y)X()}return t7.jsx($6,{open:z,onOpenChange:K,onOpenChangeComplete:U,children:t7.jsx(LK,{showCloseButton:!J,children:t7.jsx(J40,{choice:$,availability:Z,isPending:J,errorMessage:H,onTypeChange:B,onSubmit:Q})})})}var nR=_(p(),1);function H40($){return $.types[0]??OZ[0]}function sR({onSuccess:$}){let Z=FE(),[J,H]=nR.useState(null);function B(G){Z.reset(),H({workspace:G,selectedType:H40(G)})}function Q(G){H((K)=>K?{...K,selectedType:G}:K)}function X(){if(!J||Z.isPending)return;Z.mutate({path:J.workspace.path,type:J.selectedType},{onSuccess:$})}function z(){H(null),Z.reset()}return{choice:J,isPending:Z.isPending,error:Z.error,startImport:B,selectType:Q,submit:X,reset:z}}var OB=_(p(),1);var TB=_(d(),1),B40=[["OOOOO","O.O.O","O.O.O"],["OOO","O.O","OOO"],["O","O","O"]],M6=10,bK=3,Q40=2.5,X40={O:1,o:0.5,".":0},z40=3000,G40=2,tR=3,P6=3,eR=0.001,e7={courantSquared:0.14,damping:0.976,driveAmplitude:1.4,driveFrequency:0.027,gain:0.65,fadeIn:0.36,fadeOut:0.1};function K40($){let Z=Math.max(...$.map((Q)=>Q.length)),J=Z*M6+(Z-1)*bK,H=$.length*M6+($.length-1)*bK,B=[];return $.forEach((Q,X)=>{Array.from(Q).forEach((z,G)=>{let K=X40[z];if(K===void 0)return;let U=G*(M6+bK),Y=X*(M6+bK);B.push({x:U,y:Y,centerX:U+M6/2,centerY:Y+M6/2,targetOpacity:K})})}),{width:J,height:H,fieldColumns:Math.round(J/P6)+1,fieldRows:Math.round(H/P6)+1,pixels:B}}var U40=B40.map(K40);function jB($,Z,J){return $<Z?Z:$>J?J:$}function Y40($){return $<0.5?2*$*$:1-(-2*$+2)**2/2}class $b{rects;svg;geometry;animationFrame=0;running=!1;intro=!0;introStartedAt=-1;field;previousField;nextField;pointerActive=!1;pointerX=0;pointerY=0;activation=0;constructor($,Z,J){this.rects=$,this.svg=Z,this.geometry=J;let H=J.fieldColumns*J.fieldRows;this.field=new Float32Array(H),this.previousField=new Float32Array(H),this.nextField=new Float32Array(H)}start(){this.seedImpulse(),this.activation=1,this.resume()}stop(){cancelAnimationFrame(this.animationFrame),this.running=!1}handlePointerMove=($)=>{let Z=this.svg.getBoundingClientRect();if(!Z.width||!Z.height)return;if(this.pointerActive=$.clientX>=Z.left&&$.clientX<=Z.right&&$.clientY>=Z.top&&$.clientY<=Z.bottom,this.pointerActive)this.pointerX=($.clientX-Z.left)/Z.width*this.geometry.width,this.pointerY=($.clientY-Z.top)/Z.height*this.geometry.height,this.resume()};seedImpulse(){let $=Math.round(this.geometry.width/2/P6),Z=Math.round(this.geometry.height/2/P6),J=2*tR*tR;for(let H=0;H<this.geometry.fieldRows;H++)for(let B=0;B<this.geometry.fieldColumns;B++){let Q=(B-$)**2+(H-Z)**2,X=G40*Math.exp(-Q/J),z=H*this.geometry.fieldColumns+B;this.field[z]=X,this.previousField[z]=X}}resume(){if(this.running)return;this.running=!0,this.animationFrame=requestAnimationFrame(this.animate)}animate=($)=>{if(this.stepWave(),this.pointerActive)this.driveWave($);if(this.intro&&!this.pointerActive){if(this.introStartedAt<0)this.introStartedAt=$;let J=($-this.introStartedAt)/z40;if(this.activation=1-Y40(Math.min(1,J)),J>=1)this.intro=!1}else{this.intro=!1;let J=this.pointerActive?1:0,H=this.pointerActive?e7.fadeIn:e7.fadeOut;this.activation+=(J-this.activation)*H}let Z=this.renderWave();if(this.intro||this.pointerActive||this.activation>eR||Z>eR){this.animationFrame=requestAnimationFrame(this.animate);return}this.running=!1,this.activation=0,this.renderTargets()};stepWave(){let{fieldColumns:$,fieldRows:Z}=this.geometry;for(let H=1;H<Z-1;H++)for(let B=1;B<$-1;B++){let Q=H*$+B,X=this.field[Q-1]+this.field[Q+1]+this.field[Q-$]+this.field[Q+$]-4*this.field[Q];this.nextField[Q]=(2*this.field[Q]-this.previousField[Q]+e7.courantSquared*X)*e7.damping}let J=this.previousField;this.previousField=this.field,this.field=this.nextField,this.nextField=J}driveWave($){let Z=jB(Math.round(this.pointerX/P6),1,this.geometry.fieldColumns-2),J=jB(Math.round(this.pointerY/P6),1,this.geometry.fieldRows-2);this.field[J*this.geometry.fieldColumns+Z]=e7.driveAmplitude*Math.sin($*e7.driveFrequency)}sampleField($,Z){let J=jB($/P6,0,this.geometry.fieldColumns-1),H=jB(Z/P6,0,this.geometry.fieldRows-1),B=Math.floor(J),Q=Math.floor(H),X=Math.min(B+1,this.geometry.fieldColumns-1),z=Math.min(Q+1,this.geometry.fieldRows-1),G=J-B,K=H-Q,{fieldColumns:U}=this.geometry,Y=this.field[Q*U+B],F=this.field[Q*U+X],W=this.field[z*U+B],q=this.field[z*U+X];return(Y*(1-G)+F*G)*(1-K)+(W*(1-G)+q*G)*K}renderWave(){let $=0;return this.geometry.pixels.forEach((Z,J)=>{let H=this.rects[J];if(!H)return;let B=this.sampleField(Z.centerX,Z.centerY);$=Math.max($,Math.abs(B));let Q=jB(0.5+B*e7.gain,0,1),X=Z.targetOpacity*(1-this.activation)+Q*this.activation;H.setAttribute("opacity",X.toFixed(3))}),$}renderTargets(){this.geometry.pixels.forEach(($,Z)=>{this.rects[Z]?.setAttribute("opacity",String($.targetOpacity))})}}function F40({geometry:$}){let Z=OB.useRef([]),J=OB.useRef(null);return OB.useEffect(()=>{let H=J.current;if(!H||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let B=new $b(Z.current,H,$);return B.start(),window.addEventListener("pointermove",B.handlePointerMove),()=>{B.stop(),window.removeEventListener("pointermove",B.handlePointerMove)}},[$]),TB.jsx("svg",{ref:J,className:"h-8 w-auto",viewBox:`0 0 ${$.width} ${$.height}`,fill:"currentColor","aria-hidden":"true",children:$.pixels.map((H,B)=>TB.jsx("rect",{ref:(Q)=>{Z.current[B]=Q},x:H.x,y:H.y,width:M6,height:M6,rx:Q40,opacity:H.targetOpacity},`${H.x}-${H.y}`))})}function Zb({className:$}){return TB.jsx("div",{role:"img","aria-label":"moi",className:G0("flex items-center gap-2 text-accent",$),children:U40.map((Z,J)=>TB.jsx(F40,{geometry:Z},J))})}var yK=_(p(),1),$$=_(d(),1),W40=($,Z)=>`mo-root${$==="always"?" mo-always":""}${Z?" mo-expr":""}`;function q40($){let Z=Math.round($.num("motion.blink",3500,6500)),J=Math.round($.num("motion.saccade",4200,7600)),H=$.num("motion.lookX",1,2.2),B=$.num("motion.lookY",0.8,1.7),Q=(X)=>Math.round(X*100)/100;return{phase:Math.round($.num("motion.phase",0,2800)),bob:Math.round($.num("motion.bob",0,3400)),blink:Z,blinkPhase:Math.round($.num("motion.blinkPhase",0,Z)),saccade:J,saccadePhase:Math.round($.num("motion.saccadePhase",0,J)),lookX:Q(H)*($.bool("motion.lookXFlip")?-1:1),lookY:Q(B)*($.bool("motion.lookYFlip")?-1:1),lookMX:Q(H),lookMY:Q(B)}}function N40($){let Z=(H)=>`${-H}ms`,J=q40($);return{"--mo-phase":Z(J.phase),"--mo-bob-phase":Z(J.bob),"--mo-blink":`${J.blink}ms`,"--mo-blink-phase":Z(J.blinkPhase),"--mo-look-x":String(J.lookX),"--mo-look-mx":String(J.lookMX),"--mo-look-y":String(J.lookY),"--mo-look-my":String(J.lookMY),"--mo-saccade":`${J.saccade}ms`,"--mo-saccade-phase":Z(J.saccadePhase)}}function LA({l:$,c:Z,h:J}){let H=J*Math.PI/180,B=Z*Math.cos(H),Q=Z*Math.sin(H),X=$+0.3963377774*B+0.2158037573*Q,z=$-0.1055613458*B-0.0638541728*Q,G=$-0.0894841775*B-1.291485548*Q,K=X*X*X,U=z*z*z,Y=G*G*G;return[4.0767416621*K-3.3077115913*U+0.2309699292*Y,-1.2684380046*K+2.6097574011*U-0.3413193965*Y,-0.0041960863*K-0.7034186147*U+1.707614701*Y]}var Jb=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function Xb($){let Z=LA($);if(!Jb(Z)){let J=0,H=$.c;for(let B=0;B<12;B++){let Q=(J+H)/2;if(Jb(LA({...$,c:Q})))J=Q;else H=Q}Z=LA({...$,c:J})}return Z.map((J)=>Math.min(1,Math.max(0,J)))}function Hb($){let[Z,J,H]=Xb($);return 0.2126*Z+0.7152*J+0.0722*H}function kK($,Z){let J=Hb($),H=Hb(Z);return(Math.max(J,H)+0.05)/(Math.min(J,H)+0.05)}function zb($,Z,J){if(kK($,Z)>=J)return $;let H=$.l>=Z.l?1:-1;for(let X of[H,-H]){let z={...$};for(let G=0;G<60;G++){if(z.l=Math.min(1,Math.max(0,z.l+X*0.02)),kK(z,Z)>=J)return z;if(z.l===0||z.l===1)break}}let B={...$,l:0,c:0},Q={...$,l:1,c:0};return kK(B,Z)>=kK(Q,Z)?B:Q}function V40($){return"#"+Xb($).map((Z)=>{let J=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(J*255).toString(16).padStart(2,"0")}).join("")}var Bb=[[0.2,{l:0.86,c:0.085}],[0.36,{l:0.9,c:0.028}],[0.62,{l:0.73,c:0.135}],[0.8,{l:0.62,c:0.165}],[0.93,{l:0.87,c:0.16}],[1,{l:0.34,c:0.035}]],A40=($)=>Bb.find(([Z])=>$<Z)?.[1]??Bb[0][1],D40={l:0.145,c:0,h:0},L40=1.5,M40=($,Z)=>{let J=A40(Z),H=zb({l:J.l,c:J.c,h:$},D40,L40);return{bg:{l:0.965,c:0.01,h:$},head:H,eye:H.l>=0.5?{l:0.17,c:0.02,h:$}:{l:0.97,c:0.012,h:$}}},P40=[["head","bg",1.25],["eye","head",4.5]];function _40($,Z=!0,J=0){let H=M40($,J);if(Z)for(let[B,Q,X]of P40)H[B]=zb(H[B],H[Q],X);return H}function j40($,Z=!0,J=0){let H=_40($,Z,J),B={};for(let Q in H)B[Q]=V40(H[Q]);return B}var A5=($)=>{let Z=Math.round($*100)/100;return Object.is(Z,-0)?"0":String(Z)};function MA({cx:$,cy:Z,rx:J,ry:H,n:B=4,rot:Q=0}){let X=Math.min(1,(8*Math.pow(2,-1/B)-4)/3),z=J,G=H,K=z*X,U=G*X,Y=[[z,0],[z,U],[K,G],[0,G],[-K,G],[-z,U],[-z,0],[-z,-U],[-K,-G],[0,-G],[K,-G],[z,-U],[z,0]],F=Q*Math.PI/180,W=Math.cos(F),q=Math.sin(F),N=(V)=>{let[D,L]=Y[V];return`${A5($+D*W-L*q)} ${A5(Z+D*q+L*W)}`},A=`M${N(0)}`;for(let V=1;V<13;V+=3)A+=`C${N(V)} ${N(V+1)} ${N(V+2)}`;return A+"Z"}function O40($,Z,J,H,B,Q=0){let X=B.length,z=Q*Math.PI/180,G=B.map((Y,F)=>{let W=z+2*Math.PI*F/X;return[$+J*Y*Math.cos(W),Z+H*Y*Math.sin(W)]}),K=(Y)=>G[(Y%X+X)%X],U=`M${A5(K(0)[0])} ${A5(K(0)[1])}`;for(let Y=0;Y<X;Y++){let[F,W]=K(Y-1),[q,N]=K(Y),[A,V]=K(Y+1),[D,L]=K(Y+2);U+=`C${A5(q+(A-F)/6)} ${A5(N+(V-W)/6)} ${A5(A-(D-q)/6)} ${A5(V-(L-N)/6)} ${A5(A)} ${A5(V)}`}return U+"Z"}function T40({cx:$,cy:Z,rx:J,ry:H,sides:B,round:Q=0.3,rot:X=0}){let z=Q>0?Q<1?Q/2:0.5:0,G=X*Math.PI/180-Math.PI/2,K=Array.from({length:B},(W,q)=>{let N=G+2*Math.PI*q/B;return[$+J*Math.cos(N),Z+H*Math.sin(N)]}),U=(W)=>K[(W%B+B)%B],Y=(W,q)=>{let[N,A]=U(W),[V,D]=U(q);return`${A5(N+(V-N)*z)} ${A5(A+(D-A)*z)}`},F=`M${Y(0,-1)}`;for(let W=0;W<B;W++){let[q,N]=U(W);if(F+=`Q${A5(q)} ${A5(N)} ${Y(W,W+1)}`,z<0.5)F+=`L${Y(W+1,W)}`}return F+"Z"}function C40($,Z,J,H){let B=A5($-J),Q=A5($+J);return`M${B} ${A5(Z-H)}H${Q}V${A5(Z+H)}H${B}Z`}function E40($,Z,J,H,B){let Q=Math.max(1.05,B),X=J*Math.sqrt(1-1/(Q*Q)),z=Z-H/Q,G=Z-Q*H,K=X*0.14,U=z+0.86*(G-z);return`M${A5($-X)} ${A5(z)}L${A5($-K)} ${A5(U)}Q${A5($)} ${A5(G)} ${A5($+K)} ${A5(U)}L${A5($+X)} ${A5(z)}Z`}function PA($,Z){for(let J=0;J<Z.length;J++)$=Math.imul($^Z[J],3432918353),$=$<<13|$>>>19;return $}function w40($){return $=Math.imul($^$>>>16,2246822507),$=Math.imul($^$>>>13,3266489909),($^$>>>16)>>>0}var Gb=new TextEncoder;function S40($){return $.normalize("NFC").trim().toLowerCase()}function I40($,Z=!0){let J=Z?S40($):$;return PA(1779033703^J.length,Gb.encode(J))}function Qb($,Z){return w40(PA(PA($,Uint8Array.of(255)),Gb.encode(Z)))/4294967296}function R40($,Z=!0,J){let H=I40($,Z),B=(Q)=>{let X=J?.[Q],z=Array.isArray(X)?X[Math.floor(Qb(H,Q)*X.length)]:X;return z===void 0?Qb(H,Q):z>0?z<1?z:0.999999:0};return B.num=(Q,X,z)=>X+B(Q)*(z-X),B.int=(Q,X,z)=>X+Math.floor(B(Q)*(z-X+1)),B.pick=(Q,X)=>X[Math.floor(B(Q)*X.length)],B.bool=(Q,X=0.5)=>B(Q)<X,B.jitter=(Q,X)=>(B(Q)*2-1)*X,B}function Kb($,Z,J){let H=Z.expression;if(J||!H)return{l:$,wrap:""};return H.bake($,H.p)}var b40=($,Z)=>Z?.tint?Z.tint($,Z.p):$,Ub=($,Z)=>Z?`<g transform="${Z}">${$}</g>`:$,k40=($)=>$.replace(/[&<>]/g,(Z)=>Z==="&"?"&amp;":Z==="<"?"&lt;":"&gt;");function Yb($,Z){let J=R40($,Z.normalize??!0,Z.traits);return{t:J,palette:{...j40(Z.hue??J.num("hue",0,360),Z.contrast??!0,Z.tone??J("tone")),...Z.palette}}}var y40=($)=>$.title?`<title>${k40($.title)}</title>`:"";function Fb($,Z,J){let H=Z.background??$.background;if(H===!1)return;return{d:H==="square"?"M0 0H100V100H0Z":MA({cx:50,cy:50,rx:50,ry:50,n:H==="circle"?2:6}),fill:J.bg}}var x40=($)=>$?`<path d="${$.d}" fill="${$.fill}"/>`:"";function h40($){return(Z,J={})=>{let{t:H,palette:B}=Yb(Z,J),Q=b40(B,J.expression),X=J.size?` width="${J.size}" height="${J.size}"`:"",z=Kb($.layout(H),J),G=y40(J)+x40(Fb($,J,Q))+Ub($.render(z.l,Q),z.wrap);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"${X}>${G}</svg>`}}function v40($){return(Z,J={},H)=>{let{t:B,palette:Q}=Yb(Z,J),X=H?.(B,Q),z=Kb($.layout(B),J,X);return{cls:X?.cls,bg:Fb($,J,Q),inner:Ub($.render(z.l,Q,!!X),z.wrap),vars:X?.vars}}}var g40=($,Z,J)=>{let H=Z.rx,B=$.num("eye.rx",0.075,0.105)*H,Q=$.num("eye.ratio",1.9,3.2),X=$.num("eye.scale",0.78,1.24),z=$.num("eye.stretch",0.85,1.18),G=$.num("eye.gap",0.1,0.24)*H,K=B*Math.max(1,X),U=B*Q*Math.max(1,X*z),Y=K+H*0.03+G,F=$.jitter("gaze.x",0.09)*J.rx,W=$.num("gaze.y",-0.2,0.08)*J.ry,q=$.jitter("eye.dy",0.04)*J.ry,N=Math.hypot(K,U),A=Math.hypot((Math.abs(F)+Y+N)/J.rx,(Math.abs(W)+Math.abs(q)+N)/J.ry),V=A>0.9?0.9/A:1,D=B*V,L=D*Q,j=Y*V,M=Math.max(0,Math.min(1,G/U)),P=Math.min(12,Math.asin(M)*180/Math.PI),w=$.num("eye.lean",-1,1)*P,C=Math.max(-12,Math.min(12,w+$.jitter("eye.lean2",3.5))),R=J.cx+F*V,O=J.cy+W*V;return[{cx:R-j,cy:O,rx:D,ry:L,n:$.num("eye.n",3.5,6),rot:w},{cx:R+j,cy:O+q*V,rx:D*X,ry:L*X*z,n:$.num("eye.n",3.5,6),rot:C}]};function f40($,Z){let J=(Q)=>($.find(([,X])=>Q<X)??$[$.length-1])[0];function H(Q){let X=J(Q("shape")),z=Q.num("body.r",31,38)*X.core,G={cx:50+Q.jitter("body.x",1.5),cy:50+Q.jitter("body.y",1.5),rx:z,ry:z*Q.num("body.ratio",0.92,1.08),n:Q.num("body.n",1.9,2.5),rot:0,radii:Array.from({length:Q.int("body.pts",6,8)},(Y,F)=>1+Q.jitter(`body.r${F}`,0.16))};X.body?.(Q,G);let K=X.face?.(G)??G,U={petals:[],extra:[]};return X.decorate?.(Q,G,U),{shape:X.name,draw:X.path,body:G,face:K,petals:U.petals,extra:U.extra,eyes:Z(Q,G,K)}}function B(Q,X,z){let G=(Y)=>Math.round(Y*100)/100,K=(Y,F)=>{let W=`<path d="${MA(Y)}"/>`;return z?`<g class="mo-eye" style="--mo-wrap:${F?1:-1};--mo-lean:${G(Y.rot)};transform-origin:${G(Y.cx)}px ${G(Y.cy)}px">${W}</g>`:W},U=`<g fill="${X.head}">`+Q.petals.map((Y)=>`<circle cx="${G(Y.cx)}" cy="${G(Y.cy)}" r="${G(Y.r)}"/>`).join("")+Q.extra.map((Y)=>`<path d="${Y}"/>`).join("")+`<path d="${Q.draw?Q.draw(Q.body):MA(Q.body)}"/></g><g fill="${X.eye}"${z?' class="mo-eyes"':""}>`+Q.eyes.map(K).join("")+"</g>";return z?`<g class="mo-breathe"><g class="mo-bob">${U}</g></g>`:U}return{layout:H,render:B,background:!1}}var Wb=($)=>T40($),qb=($)=>O40($.cx,$.cy,$.rx,$.ry,$.radii,$.rot),_A=($)=>(Z)=>({cx:Z.cx,cy:Z.cy,rx:Z.rx*$,ry:Z.ry*$}),Nb=($)=>_A(Math.min(...$.radii)*0.95)($),m40=($)=>_A(0.84)($),u40={name:"round",core:1},p40={name:"organic",core:0.98,path:qb,face:Nb},c40={name:"boxy",core:0.86,body:($,Z)=>{Z.n=$.num("body.n",3.4,6),Z.rot=$.num("body.rot",-20,20)}},d40={name:"capsule",core:1.02,body:($,Z)=>{Z.ry*=$.num("capsule.squat",0.55,0.68)},face:_A(0.94),decorate:($,Z,J)=>{for(let H of[-1,1])J.petals.push({cx:Z.cx+H*(Z.rx-Z.ry),cy:Z.cy,r:Z.ry})},path:($)=>C40($.cx,$.cy,$.rx-$.ry,$.ry)},l40={name:"nub",core:0.88,decorate:($,Z,J)=>{let H=$.int("nub.n",1,2);for(let B=0;B<H;B++){let Q=$.num(`nub.a${B}`,0,2*Math.PI);J.petals.push({cx:Z.cx+Math.cos(Q)*Z.rx*0.88,cy:Z.cy+Math.sin(Q)*Z.rx*0.88,r:Z.rx*$.num(`nub.r${B}`,0.24,0.4)})}}},i40={name:"cloud",core:0.78,face:Nb,path:qb,decorate:($,Z,J)=>{let H=$.int("cloud.n",4,6);for(let B=0;B<H;B++){let Q=Math.PI+Math.PI*(B+0.5)/H;J.petals.push({cx:Z.cx+Math.cos(Q)*Z.rx*0.8,cy:Z.cy+Math.sin(Q)*Z.rx*0.5,r:Z.rx*$.num(`cloud.r${B}`,0.44,0.62)})}}},r40={name:"droplet",core:0.78,body:($,Z)=>{Z.cy+=0.22*Z.ry,Z.n=2},face:($)=>({cx:$.cx,cy:$.cy+$.ry*0.05,rx:$.rx*0.88,ry:$.ry*0.88}),decorate:($,Z,J)=>{J.extra.push(E40(Z.cx,Z.cy,Z.rx,Z.ry,$.num("droplet.tip",1.4,1.65)))}},a40={name:"hexagon",core:1.05,path:Wb,face:m40,body:($,Z)=>{Z.sides=6,Z.rot=$.num("body.rot",-12,12),Z.round=$.num("poly.round",0.24,0.5)}},o40={name:"sun",core:0.7,decorate:($,Z,J)=>{let H=$.int("sun.n",6,9),B=Z.rx*$.num("sun.dist",1,1.08),Q=Z.rx*$.num("sun.r",0.2,0.26),X=$.num("sun.rot",0,2*Math.PI);for(let z=0;z<H;z++){let G=X+2*Math.PI*z/H;J.petals.push({cx:Z.cx+Math.cos(G)*B,cy:Z.cy+Math.sin(G)*B,r:Q})}}},n40={name:"triangle",core:1.15,path:Wb,body:($,Z)=>{Z.sides=3,Z.rot=$.num("body.rot",-5,5),Z.round=$.num("poly.round",0.24,0.5)},face:($)=>({cx:$.cx,cy:$.cy+$.ry*0.1,rx:$.rx*0.54,ry:$.ry*0.36})},s40=[[u40,0.22],[p40,0.48],[c40,0.6],[d40,0.7],[l40,0.79],[i40,0.86],[r40,0.915],[a40,0.95],[o40,0.98],[n40,1]],Vb=f40(s40,g40),t40=h40(Vb),e40=($,Z)=>(J,H)=>{let B=Z?Z.vars(Z.p):{},Q=Z?.tint?Z.tint(H,Z.p):H;return{cls:W40($,!!Object.keys(B).length||!!Z?.tint),vars:{...N40(J),"--mo-head":Q.head,"--mo-eye":Q.eye,...B}}};function $80($,Z={}){return v40(Vb)($,Z,Z.animate&&e40(Z.animate,Z.expression))}function Z80($,Z){return"data:image/svg+xml,"+t40($,Z).replace(/"/g,"'").replace(/[%#<>{}|\\^[\]`]/g,(J)=>"%"+J.charCodeAt(0).toString(16).toUpperCase()).replace(/\s+/g," ")}function Ab({name:$,size:Z,background:J,palette:H,hue:B,tone:Q,normalize:X,contrast:z,title:G,animate:K,expression:U,traits:Y,...F}){let W={size:Z,background:J,palette:H,hue:B,tone:Q,normalize:X,contrast:z,title:G,expression:U,traits:Y},q=JSON.stringify([$,W,K]),N=yK.useMemo(()=>K?"":Z80($,W),[q]),A=yK.useMemo(()=>K?$80($,{...W,animate:K}):null,[q]),V=yK.useMemo(()=>({__html:A?.inner??""}),[A?.inner]);if(A){let{style:j,...M}=F;return $$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:Z,height:Z,role:G?"img":void 0,"aria-hidden":G?void 0:!0,style:{...A.vars,...j},...M,children:[G?$$.jsx("title",{children:G}):null,A.bg?$$.jsx("path",{d:A.bg.d,fill:A.bg.fill}):null,$$.jsx("g",{className:A.cls,dangerouslySetInnerHTML:V})]})}let{alt:D,...L}=F;return $$.jsx("img",{src:N,width:Z,height:Z,alt:D??G??"",...L})}var Db=Ab;function jA({l:$,c:Z,h:J}){let H=J*Math.PI/180,B=Z*Math.cos(H),Q=Z*Math.sin(H),X=$+0.3963377774*B+0.2158037573*Q,z=$-0.1055613458*B-0.0638541728*Q,G=$-0.0894841775*B-1.291485548*Q,K=X*X*X,U=z*z*z,Y=G*G*G;return[4.0767416621*K-3.3077115913*U+0.2309699292*Y,-1.2684380046*K+2.6097574011*U-0.3413193965*Y,-0.0041960863*K-0.7034186147*U+1.707614701*Y]}var Lb=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function jb($){let Z=jA($);if(!Lb(Z)){let J=0,H=$.c;for(let B=0;B<12;B++){let Q=(J+H)/2;if(Lb(jA({...$,c:Q})))J=Q;else H=Q}Z=jA({...$,c:J})}return Z.map((J)=>Math.min(1,Math.max(0,J)))}function Mb($){let[Z,J,H]=jb($);return 0.2126*Z+0.7152*J+0.0722*H}function CB($,Z){let J=Mb($),H=Mb(Z);return(Math.max(J,H)+0.05)/(Math.min(J,H)+0.05)}function Pb($,Z,J){if(CB($,Z)>=J)return $;let H=$.l>=Z.l?1:-1;for(let X of[H,-H]){let z={...$};for(let G=0;G<60;G++){if(z.l=Math.min(1,Math.max(0,z.l+X*0.02)),CB(z,Z)>=J)return z;if(z.l===0||z.l===1)break}}let B={...$,l:0,c:0},Q={...$,l:1,c:0};return CB(B,Z)>=CB(Q,Z)?B:Q}function xK($){return"#"+jb($).map((Z)=>{let J=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(J*255).toString(16).padStart(2,"0")}).join("")}function pZ($){let Z=parseInt($.slice(1),16),[J,H,B]=[Z>>16&255,Z>>8&255,Z&255].map((U)=>{let Y=U/255;return Y<=0.04045?Y/12.92:Math.pow((Y+0.055)/1.055,2.4)}),Q=Math.cbrt(0.4122214708*J+0.5363325363*H+0.0514459929*B),X=Math.cbrt(0.2119034982*J+0.6806995451*H+0.1073969566*B),z=Math.cbrt(0.0883024619*J+0.2817188376*H+0.6299787005*B),G=1.9779984951*Q-2.428592205*X+0.4505937099*z,K=0.0259040371*Q+0.7827717662*X-0.808675766*z;return{l:0.2104542553*Q+0.793617785*X-0.0040720468*z,c:Math.hypot(G,K),h:Math.atan2(K,G)*180/Math.PI}}function J80($,Z,J){let H=(U)=>U*Math.PI/180,B=$.c*Math.cos(H($.h)),Q=$.c*Math.sin(H($.h)),X=Z.c*Math.cos(H(Z.h)),z=Z.c*Math.sin(H(Z.h)),G=B+(X-B)*J,K=Q+(z-Q)*J;return{l:$.l+(Z.l-$.l)*J,c:Math.hypot(G,K),h:Math.atan2(K,G)*180/Math.PI}}var hK=($,Z,J)=>xK(J80(pZ($),pZ(Z),J));var H80={h:12,l:0.84,pull:0.4,c:0.1};var _b=4.55;function B80($,Z,J){let H=pZ($),B=pZ(Z),Q={l:H.l+(J.l-H.l)*J.pull,c:Math.max(H.c,J.c),h:J.h};Q=Pb(Q,Q80,X80);let X=Pb(B,Q,_b),z=X.l>=Q.l?1:-1,G=xK(Q);for(let K=0;K<40;K++){let U=xK(X),Y=1/0;for(let W=0;W<=10;W++){let q=W/10;Y=Math.min(Y,CB(pZ(hK(Z,U,q)),pZ(hK($,G,q))))}if(Y>=_b)return[G,U];let F=Math.min(1,Math.max(0,X.l+z*0.02));if(F===X.l)return[G,U];X={...X,l:F}}return[G,xK(X)]}var Q80={l:0.145,c:0,h:0},X80=1.5;var OA={esx:1,esy:1,tilt:0,edy:0,edx:0,esx2:0,esy2:0,tilt2:0,edy2:0,lock:0,heat:0,shake:0,rock:0,bdy:0},Ob=($)=>String(Math.round($*1000)/1000);function h9($,Z){return{l:{...$,eyes:$.eyes.map((J,H)=>({...J,cx:J.cx+Z.edx*(H?1:-1),cy:J.cy+Z.edy+(H?Z.edy2:0),rx:J.rx*(Z.esx+(H?Z.esx2:0)),ry:J.ry*(Z.esy+(H?Z.esy2:0)),rot:J.rot*(1-Z.lock)+(Z.tilt+(H?Z.tilt2:0))*(H?1:-1)}))},wrap:Z.bdy!==0?`translate(0 ${Ob(Z.bdy)})`:""}}function v9($){let Z={};for(let J in OA){if(J==="heat")continue;let H=$[J];if(H!==OA[J])Z["--mo-"+J]=Ob(H)}return Z}function z80($,Z,J){let[H,B]=B80($.head,$.eye,J);return{...$,head:hK($.head,H,Z.heat),eye:hK($.eye,B,Z.heat)}}var Tb={p:OA,vars:v9,bake:h9},Cb={p:{esx:1.72,esy:0.3,tilt:8,edy:-1.5,edx:1.5,esx2:0.08,esy2:0.05,tilt2:-16,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-2.2},vars:v9,bake:h9},Eb={p:{esx:0.6,esy:0.56,tilt:26,edy:3.6,edx:1.9,esx2:-0.05,esy2:-0.07,tilt2:-7,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:2.6},vars:v9,bake:h9};var wb={p:{esx:1.34,esy:1.2,tilt:-6,edy:-1.05,edx:0.5,esx2:0.05,esy2:0.07,tilt2:3,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.4},vars:v9,bake:h9},Sb={p:{esx:1.32,esy:0.76,tilt:5,edy:-0.6,edx:0.8,esx2:0.26,esy2:-0.56,tilt2:-11,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.1},vars:v9,bake:h9},Ib={p:{esx:1.14,esy:0.22,tilt:0,edy:2.4,edx:0.3,esx2:-0.04,esy2:0.03,tilt2:4,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:1.2},vars:v9,bake:h9},Rb={p:{esx:1.3,esy:0.42,tilt:18,edy:-0.5,edx:0.5,esx2:0.06,esy2:-0.06,tilt2:-36,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1},vars:v9,bake:h9},bb={p:{esx:0.95,esy:1.02,tilt:4,edy:-0.2,edx:0.3,esx2:0.24,esy2:-0.44,tilt2:-18,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:0},vars:v9,bake:h9};var kb={p:{esx:0.62,esy:0.5,tilt:10,edy:1.4,edx:-0.2,esx2:-0.05,esy2:-0.04,tilt2:-8,edy2:0,lock:1,heat:0.55,shake:0,rock:0,bdy:0.9},vars:v9,bake:h9,tint:($,Z)=>z80($,Z,H80)};var yb={p:{esx:1.15,esy:0.62,tilt:0,edy:4.2,edx:0.4,esx2:0.02,esy2:0.06,tilt2:0,edy2:-8.4,lock:1,heat:0,shake:0,rock:0.8,bdy:-0.4},vars:v9,bake:h9};var xb=_(d(),1),G80="moi-agent",K80={default:{head:"var(--foreground)",eye:"var(--background)"},primary:{head:"var(--primary)",eye:"var(--primary-foreground)"},secondary:{head:"var(--accent)",eye:"var(--accent-foreground)"}},U80={idle:Tb,happy:Cb,sad:Eb,surprised:wb,wink:Sb,sleepy:Ib,smug:Rb,unsure:bb,shy:kb,thinking:yb};function g9({size:$=56,preset:Z=y9.agent,animated:J=!1,color:H="default",expression:B="idle",className:Q}){return xb.jsx(Db,{name:G80,size:$,animate:J?"always":"hover",palette:K80[H],expression:B?U80[B]:void 0,className:G0("shrink-0",Q),traits:QB[Z].traits})}var dZ={};I5(dZ,{Trigger:()=>rb,Root:()=>lb,Panel:()=>eb});var EB=_(p(),1);var vK=_(p(),1);function hb($){let{open:Z,defaultOpen:J=!1,onOpenChange:H,disabled:B}=$,[Q,X]=e2({controlled:Z,default:J,name:"Collapsible",state:"open"}),{mounted:z,setMounted:G,transitionStatus:K}=a2(Q,!0,!0),U=s0(),[Y,F]=vK.useState(),W=Y===null?void 0:Y??U,q=U0((N)=>{let A=!Q,V=I0(K0.triggerPress,N.nativeEvent);if(H(A,V),V.isCanceled)return;X(A)});return vK.useMemo(()=>({defaultPanelId:U,disabled:B,handleTrigger:q,mounted:z,open:Q,panelId:W,setMounted:G,setOpen:X,setPanelIdState:F,transitionStatus:K}),[U,B,q,z,Q,W,G,X,F,K])}var gK=_(p(),1),TA=gK.createContext(void 0);function fK(){let $=gK.useContext(TA);if($===void 0)throw Error(h0(15));return $}var vb="data-open",gb="data-closed",fb=l4.startingStyle,Pc0=l4.endingStyle;var ub="data-panel-open";var F80={[vb]:""},W80={[gb]:""},pb={open($){if($)return{[ub]:""};return null}},cb={open($){if($)return F80;return W80}};var mK={...cb,...V2};var db=_(d(),1),lb=EB.forwardRef(function(Z,J){let{render:H,className:B,defaultOpen:Q=!1,disabled:X=!1,onOpenChange:z,open:G,style:K,...U}=Z,Y=U0(z),F=hb({open:G,defaultOpen:Q,onOpenChange:Y,disabled:X}),W=EB.useMemo(()=>({open:F.open,disabled:F.disabled,transitionStatus:F.transitionStatus}),[F.open,F.disabled,F.transitionStatus]),q=EB.useMemo(()=>({...F,onOpenChange:Y,state:W}),[F,Y,W]),N=z0("div",Z,{state:W,ref:J,props:U,stateAttributesMapping:mK});return db.jsx(TA.Provider,{value:q,children:N})});var ib=_(p(),1);var q80={...pb,...V2},rb=ib.forwardRef(function(Z,J){let{panelId:H,open:B,handleTrigger:Q,state:X,disabled:z}=fK(),{className:G,disabled:K=z,render:U,nativeButton:Y=!0,style:F,...W}=Z,{getButtonProps:q,buttonRef:N}=O5({disabled:K,focusableWhenDisabled:!0,native:Y});return z0("button",Z,{state:X,ref:[J,N],props:[{"aria-controls":B?H:void 0,"aria-expanded":B,onClick:Q},W,q],stateAttributesMapping:q80})});var CA=_(p(),1);var D4=_(p(),1);var wB={height:void 0,width:void 0};function ob($){let{externalRef:Z,hiddenUntilFound:J,id:H,keepMounted:B,mounted:Q,onOpenChange:X,open:z,setMounted:G,setOpen:K,transitionStatus:U}=$,Y=D4.useRef(null),F=D4.useRef(null),[W,q]=D4.useState(wB),N=D4.useRef(wB),A=D4.useRef(!1),V=D4.useRef(z),D=D4.useRef(!1),[L,j]=D4.useState(!1),M=D4.useRef(null),P=b2(Z,Y),w=G5(z),C=b4(Y),R=!z&&!Q,O=L?"idle":U,S=z&&(V.current||D.current),y=!z&&Q&&F.current==="css-animation"&&W.height===void 0&&W.width===void 0?N.current:W,k=J&&R&&F.current!=="css-animation",T=U0((f,E=!0)=>{if(E)N.current=f;q(f)}),b=U0(()=>{M.current?.(),M.current=null}),I=U0((f)=>{b(),M.current=()=>{M.current=null,f()}}),v=U0(()=>{if(z&&Q&&F.current==="css-animation")D.current=!0});H0(()=>{if(!L||U==="starting")return;j(!1)},[L,U]),D4.useEffect(()=>{return()=>{v(),b()}},[v,b]),H0(()=>{let f=Y.current;if(!f)return;if(!z&&M.current)b();let E=N80(f,S);if(F.current=E,z&&U==="idle"&&V.current&&E==="css-animation"){N.current=cZ(f);return}if(z&&U==="starting"){let x=A.current;if(A.current=!1,E==="none"){T(cZ(f)),j(!0);return}if(E==="css-transition"){let u=V80(f);if(T(cZ(f)),!x)return u;let c=uK(f,"transition-duration","0s");return I(c),j(!0),u}T(cZ(f));let l=uK(f,"animation-name","none");if(!x){l();return}let o=uK(f,"animation-duration","0s");l(),I(o),j(!0);return}if(!z&&Q&&(U==="idle"||U==="starting")){if(V.current=!1,D.current=!1,E==="none"){T(wB,!1),G(!1);return}T(cZ(f));return}if(U!=="ending")return;if(E==="none"){G(!1);return}let i=cZ(f);if(!(i.height>0||i.width>0)){G(!1);return}if(T(i),E==="css-animation")uK(f,"animation-name","none")();return},[Q,z,b,T,G,I,S,U]),T5({enabled:z&&Q&&O==="idle",open:!0,ref:Y,onComplete(){if(!z)return;T(wB,!1)}}),D4.useEffect(()=>{if(z||!Q||O!=="ending")return;if(!Y.current)return;let E=new AbortController,i=-1;function r(){if(w.current)return;G(!1),T(wB,!1)}return i=I2.request(()=>{C(r,E.signal)}),()=>{I2.cancel(i),E.abort()}},[w,Q,z,O,C,T,G]),H0(()=>{let f=Y.current;if(!f||!J||!R)return;f.setAttribute("hidden","until-found")},[R,J]),D4.useEffect(function(){let E=Y.current;if(!E)return;function i(r){let x=I0(K0.none,r);if(X(!0,x),x.isCanceled)return;A.current=!0,K(!0)}return o0(E,"beforematch",i)},[X,K]);let h=B||J||Q||z;return{height:y.height,props:{...k?{[fb]:""}:void 0,hidden:R,id:H},ref:P,shouldPreventOpenAnimation:S,shouldRender:h,transitionStatus:O,width:y.width}}function cZ($){return{height:$.scrollHeight,width:$.scrollWidth}}function N80($,Z){let J=I1($).getComputedStyle($),H=(J.animationName.split(",").map((Q)=>Q.trim()).some((Q)=>Q!==""&&Q!=="none")||Z)&&ab(J.animationDuration),B=ab(J.transitionDuration);if(H&&B)return"css-transition";if(B)return"css-transition";if(H)return"css-animation";return"none"}function ab($){return $.split(",").map((Z)=>Z.trim()).some((Z)=>Z!==""&&Number.parseFloat(Z)>0)}function uK($,Z,J){let H=$.style.getPropertyValue(Z),B=$.style.getPropertyPriority(Z);return $.style.setProperty(Z,J),()=>{if(H===""){$.style.removeProperty(Z);return}$.style.setProperty(Z,H,B)}}function V80($){let Z={"justify-content":$.style.justifyContent,"align-items":$.style.alignItems,"align-content":$.style.alignContent,"justify-items":$.style.justifyItems};Object.keys(Z).forEach((B)=>{$.style.setProperty(B,"initial","important")});function J(){Object.entries(Z).forEach(([B,Q])=>{if(Q===""){$.style.removeProperty(B);return}$.style.setProperty(B,Q)})}let H=I2.request(J);return()=>{I2.cancel(H),J()}}var nb="--collapsible-panel-height",sb="--collapsible-panel-width";var eb=CA.forwardRef(function(Z,J){let{className:H,hiddenUntilFound:B,keepMounted:Q,render:X,id:z,style:G,...K}=Z,{defaultPanelId:U,mounted:Y,onOpenChange:F,open:W,setMounted:q,setPanelIdState:N,setOpen:A,state:V,transitionStatus:D}=fK(),L=B??!1,j=Q??!1,M=z||void 0,P=M??U;H0(()=>{return N((v)=>M??(v===null?void 0:v)),()=>{N((v)=>v===M?null:v)}},[M,N]);let{height:w,props:C,ref:R,shouldPreventOpenAnimation:O,shouldRender:S,transitionStatus:y,width:k}=ob({externalRef:J,hiddenUntilFound:L,id:P,keepMounted:j,mounted:Y,onOpenChange:F,open:W,setMounted:q,setOpen:A,transitionStatus:D}),T={...V,transitionStatus:y},b=tb(G,T),I=z0("div",{...Z,style:void 0},{state:T,ref:R,props:[C,{style:{[nb]:w===void 0?"auto":`${w}px`,[sb]:k===void 0?"auto":`${k}px`}},K,b?{style:b}:void 0,O?{style:{animationName:"none"}}:void 0],stateAttributesMapping:mK});if(!S)return null;return I});var lK=_(d(),1);function pK({...$}){return lK.jsx(dZ.Root,{"data-slot":"collapsible",...$})}function cK({...$}){return lK.jsx(dZ.Trigger,{"data-slot":"collapsible-trigger",...$})}function dK({...$}){return lK.jsx(dZ.Panel,{"data-slot":"collapsible-content",...$})}var iK=_(p(),1);var EA="moi-fonts",$k="moi-font-previews",D80=Object.values(V6).map(($)=>$.googleFontsQuery).filter(Boolean).join("&family="),Jk=[["sans","--sans"],["mono","--mono"]],Hk=BA.map(($)=>[$,L80($)]),Bk="--radius",Zk=[...Jk.map(([,$])=>$),...Hk.map(([,$])=>$),Bk];function L80($){return`--${$.replace(/[A-Z]/g,(J)=>`-${J.toLowerCase()}`)}`}function M80($){let Z={},J=i8($),H=J.font===y9.font?void 0:V6[J.font];for(let[B,Q]of Jk)Z[Q]=H?.[B];return Z}function wA($,Z="workspace"){let J={},H=VK($,Z);for(let[B,Q]of Hk)J[Q]=H?.[B];return J}function P80($){let Z={},J=i8($),H=J.radius===y9.radius?void 0:BB[J.radius];return Z[Bk]=H?.radius,Z}function a8($,Z="workspace"){return{...M80($),...wA($,Z),...P80($)}}function rK(){iK.useEffect(()=>{if(document.getElementById($k))return;let $=document.createElement("link");return $.id=$k,$.rel="stylesheet",$.crossOrigin="anonymous",$.href=`https://fonts.googleapis.com/css2?family=${D80}&display=swap`,document.head.appendChild($),()=>{$.remove()}},[])}function _80($){iK.useEffect(()=>{let Z=document.documentElement,J=a8($);for(let H of Zk){let B=J[H];if(B)Z.style.setProperty(H,B);else Z.style.removeProperty(H)}return()=>{for(let H of Zk)Z.style.removeProperty(H)}},[$])}function Qk($){let{font:Z}=i8($);_80($),iK.useEffect(()=>{let J=V6[Z]??V6[y9.font],H=document.getElementById(EA);if(!J.googleFontsQuery)H?.remove();else{let B=`https://fonts.googleapis.com/css2?family=${J.googleFontsQuery}&display=swap`;if(H)H.href=B;else{let Q=document.createElement("link");Q.id=EA,Q.rel="stylesheet",Q.crossOrigin="anonymous",Q.href=B,document.head.appendChild(Q)}}return()=>{document.getElementById(EA)?.remove()}},[Z])}function SB($){return $==="agent"||$==="overview"||$==="scratchpad"||typeof $==="string"&&/^(views|view-builders)\/[a-zA-Z0-9_-]+$/.test($)}var lZ=($)=>`views/${$}`,IB=($)=>$.startsWith("views/")?$.slice(6):null,Z$=($)=>`view-builders/${$}`,J$=($)=>$.startsWith("view-builders/")?$.slice(14):null;function f9($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function SA($){if(typeof $!=="string"||!$.startsWith("moi:/")||$.startsWith("moi://"))throw Error("Expected a workspace address such as moi:/views/events?eventId=123");let Z=$.slice(5).split(/[?#]/,1)[0];if($.includes("#")||/[\s\\]/.test(Z))throw Error("Invalid workspace address");let J=bB(Z);if(!J||J==="agent"||J.startsWith("view-builders/"))throw Error(`Unsupported workspace destination: ${Z}`);let H=$.indexOf("?"),B=H<0?"":RB($.slice(H+1));return{tab:J,search:B}}function RB($){let Z=new URLSearchParams($);Z.sort();let J=Z.toString();return J?`?${J}`:""}function Xk($){let Z=new URLSearchParams($);return Object.fromEntries(Array.from(Z.keys(),(J)=>[J,Z.get(J)]))}function bB($){try{let Z=decodeURIComponent($);return SB(Z)?Z:null}catch{return null}}function zk($){let Z=/^(view|view-builder):(.+)$/.exec($);return Z?bB(`${Z[1]}s/${Z[2]}`):null}function aK($,Z=""){return`${Z.replace(/\/$/,"")}/workspace/${encodeURIComponent($)}`}function _6($,Z,J=""){return`${aK($,J)}/${Z.tab}${Z.search}`}function Gk($,Z){return _6($,{tab:Z,search:""})}function H$($,Z,J=""){if(Z.startsWith("moi:"))return _6($,SA(Z),J);let H=new URL(Z);if(H.protocol!=="https:"&&H.protocol!=="http:")throw Error("Unsupported URL");return H.href}var iZ=_(p(),1);var Y2=_(d(),1),kB={width:320,height:180,radius:32,topLeftRadius:18,bodyTop:24,tabEnd:124,shoulder:{width:48,roundness:20}};function j80($){let{width:Z,height:J,radius:H,topLeftRadius:B,bodyTop:Q,tabEnd:X,shoulder:z}=kB,G=Math.min(Z/2,H*$),K=Math.min(Z/2,B*$),U=Math.max(0,z.width),Y=X+U,F=Math.max(0,Math.min(z.roundness,U/2));return[`M ${K} 0`,`H ${X}`,`C ${X+F} 0 ${Y-F} ${Q} ${Y} ${Q}`,`H ${Z-G}`,`Q ${Z} ${Q} ${Z} ${Q+H}`,`V ${J-H}`,`Q ${Z} ${J} ${Z-G} ${J}`,`H ${G}`,`Q 0 ${J} 0 ${J-H}`,`V ${B}`,`Q 0 0 ${K} 0`,"Z"].join(" ")}function O80(){let $=iZ.useRef(null),[Z,J]=iZ.useState(1);return iZ.useLayoutEffect(()=>{let H=$.current;if(!H)return;let B=(z,G)=>{if(z<=0||G<=0)return;let K=z/kB.width,Y=G/kB.height/K;J((F)=>Math.abs(F-Y)<0.001?F:Y)},Q=H.getBoundingClientRect();B(Q.width,Q.height);let X=new ResizeObserver(([z])=>{if(z)B(z.contentRect.width,z.contentRect.height)});return X.observe(H),()=>X.disconnect()},[]),{ref:$,horizontalRadiusScale:Z}}var Kk=[{frame:G0("-translate-x-3 translate-y-3 -rotate-6","group-focus-within:translate-y-2 group-hover:translate-y-2"),img:"opacity-40"},{frame:G0("translate-x-3 translate-y-2 rotate-5","group-focus-within:translate-y-1 group-hover:translate-y-1"),img:"opacity-50"},{frame:G0("-translate-x-1 translate-y-1 -rotate-2","group-focus-within:-translate-y-2 group-hover:-translate-y-2"),img:"opacity-100"}];function Uk({workspaceId:$}){let Z=rz($),J=Z.data?[...Z.data.thumbnails].reverse():[],H=Kk.slice(Kk.length-J.length),B=Z.data?.firstUserMessage,Q=Z.data?.theme,{ref:X,horizontalRadiusScale:z}=O80(),G=j80(z),K=`folder-noise-${$}`,U=a8(Q),Y=wA(Q);return Y2.jsxs("div",{ref:X,style:Y,className:"relative h-45 w-full",children:[Y2.jsxs("svg",{viewBox:`0 0 ${kB.width} ${kB.height}`,preserveAspectRatio:"none","aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",children:[Y2.jsx("defs",{children:Y2.jsxs("filter",{id:K,x:"0%",y:"0%",width:"100%",height:"100%",colorInterpolationFilters:"sRGB",children:[Y2.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",seed:"7",result:"noise"}),Y2.jsx("feColorMatrix",{in:"noise",type:"saturate",values:"0",result:"monochromeNoise"}),Y2.jsx("feComponentTransfer",{in:"monochromeNoise",result:"faintNoise",children:Y2.jsx("feFuncA",{type:"linear",slope:"0.24"})}),Y2.jsx("feComposite",{in:"faintNoise",in2:"SourceAlpha",operator:"in",result:"clippedNoise"}),Y2.jsx("feBlend",{in:"SourceGraphic",in2:"clippedNoise",mode:"soft-light"})]})}),Y2.jsx("path",{d:G,filter:`url(#${K})`,className:"fill-accent"})]}),J.map((F,W)=>Y2.jsx("div",{className:G0("absolute top-[12%] left-[14%] w-fit max-w-[72%] overflow-hidden rounded-[calc(var(--radius-2xl)*0.4)] bg-background shadow-xs squircle","animate-in duration-300 ease-out fade-in",H[W].frame),children:Y2.jsx("img",{src:F,alt:"",loading:"lazy",className:G0("block h-auto max-h-32 w-auto max-w-full object-contain",H[W].img)})},F)),J.length===0&&B&&Y2.jsx("div",{className:"absolute inset-x-[12%] top-[22%] flex justify-end",children:Y2.jsx("div",{"aria-hidden":"true",style:U,className:G0("w-max max-w-40 origin-center rounded-lg bg-card px-3 py-2 font-sans shadow-xs","animate-in transition-transform duration-300 ease-out fade-in","-translate-x-1 translate-y-1 -rotate-2","group-focus-within:translate-y-0.5 group-hover:translate-y-0.5"),children:Y2.jsx("p",{className:"line-clamp-3 text-sm leading-normal whitespace-normal",children:B})})}),Y2.jsx("div",{className:G0("absolute inset-x-2 top-[40%] bottom-2 rounded-3xl bg-[color-mix(in_oklch,var(--accent),var(--foreground)_5%)]","mask-[linear-gradient(to_bottom,rgba(0,0,0,0.9)_0%,black_50%)] backdrop-blur-lg","inset-shadow-[0_0_12px_color-mix(in_oklab,var(--background)_20%,transparent)]")})]})}var J1=_(d(),1);function Wk(){rK();let[,$]=K8(),Z=iz(),J=YE(),H=az(),B=sR({onSuccess:(q)=>$(`/workspace/${q.id}`)}),Q=I9(),[X,z]=Fk.useState(!1),G=C5((q)=>q.discoveredWorkspacesOpen),K=C5((q)=>q.setDiscoveredWorkspacesOpen);if(Z.isPending||J.isPending)return J1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:J1.jsx(b5,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(Z.isError||J.isError)return J1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:J1.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let U=Z.data,Y=J.data,F=U.length;function W(q){if(Q.cloudDemo){z(!0);return}B.startImport(q)}return J1.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[J1.jsx(Zb,{className:"mb-10"}),F>0?J1.jsxs("section",{className:"mb-12",children:[J1.jsxs("div",{className:"mb-4 flex items-center justify-between gap-2",children:[J1.jsx("h1",{className:"text-sm font-medium text-foreground",children:"My workspaces"}),J1.jsx(KB,{trigger:J1.jsxs(j0,{variant:"outline",size:"sm",children:[J1.jsx(h2,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),J1.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2 md:grid-cols-3",children:U.map((q)=>J1.jsx(T80,{workspace:q},q.id))})]}):J1.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 pt-8 pb-16 text-center",children:[J1.jsx(Yk,{size:32,stroke:1.5,className:"text-muted-foreground"}),J1.jsxs("div",{className:"flex flex-col gap-1.5",children:[J1.jsx("h2",{className:"font-medium",children:"Let’s start with creating your first workspace"}),J1.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Workspace is a place for all the chats, widgets, and views that share the same context. Create a new one or import an existing folder you’ve worked in before."})]}),J1.jsx(KB,{trigger:J1.jsx(j0,{children:"Create workspace"})})]}),Y.length>0&&J1.jsx("section",{children:J1.jsxs(pK,{open:G,onOpenChange:K,className:"group",children:[J1.jsxs(cK,{className:G0("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:[J1.jsx("span",{className:"text-sm font-medium",children:"Import from this computer"}),J1.jsx(B$,{size:16,stroke:2,className:G0("opacity-0 transition-[opacity,transform]","group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100 group-data-open:rotate-90")})]}),J1.jsx(dK,{children:J1.jsx("ul",{className:"border-t border-border",children:Y.map((q)=>J1.jsx(C80,{suggestion:q,onAdd:W},q.path))})})]})}),B.choice&&J1.jsx(oR,{choice:B.choice,availability:H.data?.availability,isPending:B.isPending,errorMessage:B.error?.message,onTypeChange:B.selectType,onSubmit:B.submit,onReset:B.reset}),J1.jsx(CZ,{open:X,onOpenChange:z})]})}function T80({workspace:$}){let Z=l7($),J=rz($.id),H=$.theme??J.data?.theme,B=i8(H).agent,Q=x2((G)=>uz(G.activity,$.id)),X=J.data?.updatedAt??new Date($.addedAt).getTime(),z=`/workspace/${$.id}`;return J1.jsxs("div",{className:"group flex min-w-0 flex-col gap-3",children:[J1.jsxs("div",{className:"relative",children:[J1.jsx(Uk,{workspaceId:$.id}),J1.jsx(F7,{href:z,"aria-label":`Open ${Z}`,className:"absolute inset-0 rounded-2xl outline-none focus-visible:ring-3 focus-visible:ring-ring/50"}),J.data&&J1.jsxs(B5,{children:[J1.jsx(Q5,{render:J1.jsx(F7,{href:Gk($.id,"agent"),"aria-label":`Chat in ${Z}`,style:a8(H),className:"absolute right-3 bottom-3 rounded-lg outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:J1.jsx(g9,{preset:B,color:"primary",animated:Q,expression:Q?"thinking":void 0,size:48,className:"drop-shadow-sm drop-shadow-primary/20"})})}),J1.jsx(X5,{children:"Chat"})]})]}),J1.jsxs(F7,{href:z,className:"flex min-w-0 flex-col gap-2 rounded-lg px-2 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[J1.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 font-sans",style:a8(H),children:[J1.jsx(A6,{icon:$.icon,workspaceType:$.type,workspaceTheme:H,className:"size-4 shrink-0 rounded-xs"}),J1.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Z})]}),J1.jsx("span",{className:"text-xs text-muted-foreground",children:E80(X)})]})]})}function C80({suggestion:$,onAdd:Z}){let{path:J,types:H}=$,B=l7($);return J1.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[J1.jsx(sI,{types:H}),J1.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:B}),J1.jsx("span",{title:J,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:$.displayPath??J}),J1.jsxs(j0,{variant:"outline",size:"sm",onClick:()=>Z($),children:[J1.jsx(h2,{stroke:1.75}),"Add"]})]})}function E80($){let Z=Date.now()-$,J=Math.floor(Z/60000);if(J<1)return"Updated just now";if(J<60)return`Updated ${J} min${J===1?"":"s"} ago`;let H=Math.floor(J/60);if(H<24)return`Updated ${H} hour${H===1?"":"s"} ago`;let B=Math.floor(H/24);if(B<30)return`Updated ${B} day${B===1?"":"s"} ago`;return`Updated ${new Date($).toLocaleDateString()}`}var oK=_(d(),1);function qk(){return oK.jsx(RK,{showWorkspaces:!1,children:oK.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:oK.jsx(Wk,{})})})}var nK=_(p(),1);var IA=_(d(),1),Ak=($)=>$.map((Z)=>[...Z].map((J)=>J==="#"?1:0)),w80=["####.","#.#.#","#.#.#","#.#.#","#.#.#"],S80=["###.#","#.#.#","#.#.#","#.#.#","###.#"],I80=Ak([".....","####.","#.#.#","#.#.#","#.#.#"]),R80=Ak(w80.map(($,Z)=>`${$}.${S80[Z]}`)),b80={moi:I80,"moi-full":R80};function Dk($,Z,J){let H=[];for(let B=0;B<Z;B++){let Q=[];for(let X=0;X<$;X++)Q.push(J(X,B));H.push(Q)}return H}function Nk($,Z,J){let H=Math.sin($*12.9898+Z*78.233+J*37.719)*43758.5453;return H-Math.floor(H)}function k80($,Z,J){return Dk(Z,J,(H,B)=>{let Q=Nk(H,B,0)*Math.PI*2,X=5+Nk(H,B,1)*6,z=0.5+0.5*Math.sin($*X+Q);return z*z})}function y80($,Z,J){return Dk(Z,J,(B,Q)=>0.5+0.5*Math.sin(B*0.5+Q*0.32-$*6.5))}var Lk=0.55;function x80($,Z){let J=$.length,H=$.reduce((G,K)=>Math.max(G,K.length),0),B=Math.min(Z/Lk,1),Q=1-Math.pow(1-B,3),X=Math.round((1-Q)*J),z=[];for(let G=0;G<J;G++){let K=[];for(let U=0;U<H;U++)K.push($[G-X]?.[U]??0);z.push(K)}return z}function Vk($,Z,J){let H=b80[$];if(Z===void 0)return x80(H,J);let B=H.length,Q=H[0]?.length??0;return Z==="wave"?y80(J,Q,B):k80(J,Q,B)}var h80=24;function v80($,Z,J){let[H,B]=nK.useState(()=>Vk($,Z,0));return nK.useEffect(()=>{let Q=0,X=null,z=0,G=1000/J,K=(U)=>{if(X===null)X=U;let Y=(U-X)/1000;if(U-z>=G){if(z=U,B(Vk($,Z,Y)),Z===void 0&&Y>=Lk)return}Q=requestAnimationFrame(K)};return Q=requestAnimationFrame(K),()=>cancelAnimationFrame(Q)},[$,Z,J]),H}function g80($){return`rgba(23, 23, 23, ${(0.1+Math.max(0,Math.min(1,$))*0.9).toFixed(3)})`}function Mk({sprite:$="moi",effect:Z,fps:J=h80,pixelSize:H=3,gap:B=1,className:Q}){let X=v80($,Z,J),z=X[0]?.length??0,G=Z!==void 0;return IA.jsx("div",{className:G0("grid",Q),style:{gridTemplateColumns:`repeat(${z}, ${H}px)`,gap:`${B}px`},children:X.flatMap((K,U)=>K.map((Y,F)=>IA.jsx("div",{className:"rounded-[2px]",style:{width:H,height:H,background:g80(Y),boxShadow:G?`0 0 ${(H*(0.4+Y)).toFixed(1)}px rgba(23, 23, 23, ${(Y*0.35).toFixed(3)})`:void 0}},`${U}-${F}`)))})}var aZ=_(p(),1);var sK=5000,tK=120;var f80="</moi-attachments>";function RA($){if(!f9($)||typeof $.label!=="string")return null;let Z=$.label.trim();if(!Z||Z.length>tK||typeof $.text!=="string"||!$.text.trim()||$.text.length>sK)return null;return{label:Z,text:$.text}}function Pk($){return Array.isArray($)&&$.every((Z)=>f9(Z)&&Z.purpose===void 0&&(Z.source===void 0||typeof Z.source==="string"&&Z.source.length>0)&&RA(Z)!==null)}function _k($){return $==="annotation"||$==="sketch"}function m80($){return Array.isArray($)&&$.every((Z)=>{if(!f9(Z))return!1;if(Z.type==="text")return Pk([Z]);if(Z.type!=="file"&&Z.type!=="image")return!1;if(Z.source!==void 0&&(typeof Z.source!=="string"||!Z.source))return!1;if(typeof Z.mediaType!=="string"||!Z.mediaType)return!1;if(Z.purpose!==void 0&&(!_k(Z.purpose)||!Z.mediaType.startsWith("image/")))return!1;let J=typeof Z.path==="string"&&/^(\/|[A-Za-z]:[\\/])/.test(Z.path)&&!Z.path.includes("\x00");if(Z.type==="file")return J&&Z.label===void 0;return Z.path===void 0&&Z.mediaType.startsWith("image/")&&typeof Z.label==="string"&&Boolean(Z.label.trim())})}function bA($){let Z=[],J=!1,H=$.replace(/<moi-attachments>([^<]*)<\/moi-attachments>/g,(B,Q)=>{try{let X=JSON.parse(Q),z=f9(X)&&X.version===1&&Array.isArray(X.attachments)?X.attachments.map((G)=>f9(G)?{type:"text",source:G.source,label:G.label,text:G.text}:G):X;if(!m80(z))return B;return Z.push(...z),J=!0,""}catch{return B}});return{text:J?H.trim():$,attachments:Z}}function kA($){return $.type==="file"?$.path.split(/[\\/]/).at(-1):$.label}function jk($,Z){let{source:J}=$,H=kA($);if($.type==="text")return{type:"text-attachment",source:$.source,label:H,text:$.text};return{type:"file-attachment",label:H,mediaType:$.mediaType,source:J,...$.purpose?{purpose:$.purpose}:{},previewUrl:Z,path:$.type==="file"?$.path:void 0}}function u80($){return bA($).text}function Ok($){let Z=u80($),J=Z.search(/<moi-attachments>\s*(?:\[|\{"version":1,"attachments":\[)/);return(J<0||Z.includes(f80,J)?Z:Z.slice(0,J)).trimEnd()}var Tk=10;function eK($){return $.length>Tk?`A message can have at most ${Tk} attachments.`:null}var Ck=33554432;function Ek($){return typeof $==="string"&&$.length>0&&!/[\\:\0]/.test($)&&$.split("/").every((Z)=>Z.length>0&&!Z.startsWith("."))}var Rk=_(p(),1);var wk=()=>({emit($,...Z){for(let J=this.events[$]||[],H=0,B=J.length;H<B;H++)J[H](...Z)},events:{},on($,Z){return(this.events[$]||=[]).push(Z),()=>{this.events[$]=this.events[$]?.filter((J)=>Z!==J)}}});var p80=({kind:$,name:Z})=>`${$}:${Z}`,c80=1000,yA={cooldownMs:2000,windowMs:60000,maxPerWindow:10,maxKeys:64};function d80($){let Z=wk(),J=fz(yA),H=(X,z)=>{n4($,{source:"runtime",kind:X.kind,name:X.name,message:z})},B=(X,z,G,K,U)=>{let Y=X.admit(G);if(Y==="ok")return!0;return H(z,Y==="cooldown"?K:U),!1},Q=(X,z,G)=>{return B(J,X,`${z}\x00${G}`,`sendChatMessage() for "${G}" was dropped: the same message was already sent less than ${yA.cooldownMs/1000}s ago. Call it from an event handler, not during render.`,`sendChatMessage() for "${G}" was dropped: more than ${yA.maxPerWindow} messages in a minute from this workspace. Each one starts an agent run, so send only on a real user action.`)};return{on(X,z){return Z.on(X,z)},connect(X,z=""){let G=!0,K=p80(X);return{bridge:{addChatAttachment(Y){if(!G)return;try{let F=Sk(Y,K);Z.emit("addChatAttachment",F)}catch(F){let W=xA(F);q5.add({title:"Couldn’t add attachment",description:W,type:"error"}),H(X,`addChatAttachment() was dropped: ${W}`)}},navigate(Y){if(!G)return;try{if(typeof Y!=="string")throw Error("Navigation needs a URL");H$($,Y,z),Z.emit("navigate",Y)}catch(F){H(X,`navigate() was dropped: ${xA(F)}`)}},resolveHref(Y){if(!G)return"";if(typeof Y!=="string")throw Error("A URL is required");return H$($,Y,z)},sendChatMessage(Y,F){if(!G)return;try{if(typeof Y==="string")Y={message:Y,attachments:F===void 0?[]:[{type:"text",label:"Context",text:JSON.stringify(F)}]};if(!f9(Y)||typeof Y.message!=="string")throw Error("This message uses an unsupported format");if("context"in Y)throw Error("This message uses an outdated format");let W=Y.message.trim();if(!W)throw Error("The message is empty");if(W.length>c80)throw Error("Messages can be up to 1,000 characters");if(Y.attachments!==void 0&&!Array.isArray(Y.attachments))throw Error("The attachments use an unsupported format");let q=Array.from(Y.attachments??[],(N)=>Sk(N,K));if(!Q(X,K,W))return;Z.emit("sendChatMessage",{message:W,source:K,attachments:q})}catch(W){let q=xA(W);q5.add({title:"Couldn’t send message",description:q,type:"error"}),H(X,`sendChatMessage() was dropped: ${q}`)}}},dispose:()=>{G=!1}}}}}function Sk($,Z){if(!f9($))throw Error("This attachment isn’t supported");if($.type==="text"){let J=RA($);if(J)return{type:"text",...J,source:Z};if(typeof $.label!=="string"||!$.label.trim())throw Error("Add a label to this text attachment");if($.label.trim().length>tK)throw Error(`Attachment labels can be up to ${tK} characters`);if(typeof $.text!=="string"||!$.text.trim())throw Error("Add some text to this attachment");if($.text.length>sK)throw Error(`Text attachments can be up to ${sK.toLocaleString("en-US")} characters`)}else if($.type==="file"){if($.file instanceof File&&$.path===void 0){if($.file.size>Ck)throw Error("Files can be up to 32 MB");return{type:"file",file:$.file,source:Z}}if(typeof $.path==="string"&&$.file===void 0){if(!Ek($.path))throw Error("Choose a file from this workspace");return{type:"file",path:$.path,source:Z}}}throw Error("This attachment isn’t supported")}function xA($){return $ instanceof Error?$.message:String($)}var Ik=new Map;function ZU($){let Z=Ik.get($);if(!Z)Z=d80($),Ik.set($,Z);return Z}function JU($,Z,J){let H=K5(J);Rk.useEffect(()=>{let B=(...Q)=>H.current(...Q);return ZU($).on(Z,B)},[$,Z,H])}var $U=new Map;function bk($,Z,J,H,B=""){let Q=$.__attachBridge;if(typeof Q!=="function")return;$U.get(J)?.();let{bridge:X,dispose:z}=ZU(Z).connect(H,B);$U.set(J,z),Q(X)}function hA($){let Z=$U.get($);if(!Z)return;$U.delete($),Z()}function HU($,Z,J){return`${$}/${Z}/${J}`}var rZ=new Map,yB=new Map;function l80($,Z,J){return rZ.get(HU($,Z,J))??0}var i80="module";function kk($,Z,J){return`/api/workspaces/${Z}/${$}/${J}/${i80}?v=${l80($,Z,J)}`}function BU($,Z,J){return`/api/workspaces/${Z}/${$}/${J}`}function QU($,Z){return`${$==="widgets"?"widget":"view"}:${Z}`}function yk($){return yB.get($)}function xk($,Z){yB.set($,Z)}function XU($,Z,J){let H=HU($,Z,J);yB.delete(H),rZ.set(H,(rZ.get(H)??0)+1),hA(H)}function vA($){let Z=`${$}/`;for(let J of new Set([...yB.keys(),...rZ.keys()]))if(J.startsWith(Z))yB.delete(J),rZ.set(J,(rZ.get(J)??0)+1),hA(J)}var r80={kind:"widget",segment:"widgets",shouldReload:($,Z)=>$.type==="widget:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="views"},a80={kind:"view",segment:"views",shouldReload:($,Z)=>$.type==="view:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="widgets"};function o80($,Z,J,H){let{segment:B}=$,Q=HU(B,Z,J),X=yk(Q);if(X)return X;let z=import(kk(B,Z,J)).then((G)=>{if(!G.default)throw Error(`"${J}" has no default export`);return bk(G,Z,Q,{kind:$.kind,name:J},H),G.default});return xk(Q,z),z}function hk($,Z){let J=e1(),{base:H}=G8(),[B,Q]=aZ.useState({status:"loading",version:0}),X=aZ.useCallback(()=>{Q((z)=>({status:"loading",version:z.version})),o80($,J,Z,H).then((z)=>Q((G)=>({status:"ready",Component:z,version:G.version+1}))).catch((z)=>{n4(J,{source:"load",kind:$.kind,name:Z,message:String(z),...z instanceof Error&&z.stack?{stack:z.stack}:{}}),Q((G)=>({status:"error",error:String(z),version:G.version+1}))})},[H,$,J,Z]);return aZ.useEffect(()=>{X()},[X]),K2((z)=>{if($.shouldReload(z,Z))XU($.segment,J,Z),X()}),B}function vk($){return hk(r80,$)}function gk($){return hk(a80,$)}function fk(){let $=e1();K2((Z)=>{if(Z.type==="view:updated")XU("views",$,Z.name);else if(Z.type==="widget:updated")XU("widgets",$,Z.name);else if(Z.type==="applets:refresh"){if(Z.only!=="views")vA("widgets");if(Z.only!=="widgets")vA("views")}})}var o8=_(p(),1);var uk=_(p(),1);var v4={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function pk($){return J5({queryKey:S0.layout($),queryFn:()=>q1(`/api/workspaces/${$}`),...v4})}function m9($){let Z=z1();return uk.useEffect(()=>mk(()=>{Z.invalidateQueries({queryKey:S0.agent($)})}),[Z,$]),K2((J)=>{if(J.type==="agent:updated"&&J.workspaceId===$)Z.setQueryData(S0.agent($),(H)=>H?{...H,availability:J.availability,login:J.login}:H);if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:S0.agent($)})}),J5({queryKey:S0.agent($),queryFn:()=>q1(`/api/workspaces/${$}/agent`),staleTime:30000,refetchOnWindowFocus:!0})}function ck($){return q1(`/api/workspaces/${$}/auth/login`,{method:"POST"},"Could not start sign-in")}function dk($){return J5({queryKey:S0.skills($),queryFn:()=>q1(`/api/workspaces/${$}/skills`),...v4})}async function n80($){let Z=await fetch(`/api/workspaces/${$}/skills/update`,{method:"POST"}),J=await Z.text(),H=null;try{H=JSON.parse(J)}catch{}if(!Z.ok){let B=H&&"error"in H?H.error:J,Q=Error(B||"Failed to update workspace skill");if(H?.skills)Q.status={skills:H.skills,updateAvailable:H.updateAvailable};throw Q}if(!H)throw Error("Invalid workspace skill update response");return H}function lk($){let Z=z1();return H5({mutationFn:()=>n80($),onSuccess:(J)=>{Z.setQueryData(S0.skills($),J)},onError:(J)=>{if(J.status)Z.setQueryData(S0.skills($),J.status)}})}function ik($){let Z=z1();return H5({mutationFn:(J)=>A4(`/api/workspaces/${$}`,v5("PUT",J),"Failed to save layout"),onSuccess:()=>{Z.invalidateQueries({queryKey:S0.preview($)})}})}var gA={id:"_moi_views",config:{colSpan:4,rowSpan:1},defaultPosition:{x:0,y:0}},fA=[gA],s80=new Set(fA.map(($)=>$.id));function u9($){return s80.has($)}function rk($){return[...fA,...$]}function ak(){return fA.map(($)=>({i:$.id,...$.defaultPosition}))}function zU(){return{open:["overview","agent","scratchpad"],active:"overview"}}function ok($){let Z=zU();if(!$||typeof $!=="object")return Z;let J=$,H=Array.isArray(J.open)?J.open.filter(SB).filter((X,z,G)=>G.indexOf(X)===z):[];if(H.length===0)return Z;let B=["overview",...H.filter((X)=>X!=="overview")],Q=SB(J.active)&&B.includes(J.active)?J.active:"overview";return{open:B,active:Q}}function nk(){return{version:1,widgetGrid:ak(),layoutMode:"split",tabs:zU()}}var $y=_(d(),1),mA=o8.createContext(null);function l1(){let $=o8.useContext(mA);if(!$)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return $}function tk(){return o8.useContext(mA)?.layout.theme}function sk($){let{cwd:Z,name:J,provider:H,agentId:B,...Q}=$;return Q}function ek({id:$,children:Z}){let J=z1(),H=pk($),B=ik($),Q=K5(B.mutate),X=o8.useRef(null),z=o8.useCallback((K)=>{let U=S0.layout($),Y=J.getQueryData(U);if(!Y)return;let F={...Y,...K};if(J.setQueryData(U,F),X.current)clearTimeout(X.current);X.current=setTimeout(()=>{X.current=null,Q.current(sk(F))},600)},[$,J,Q]),G=o8.useMemo(()=>({layout:H.data?sk(H.data):nk(),setLayout:z,name:H.data?.name??null,cwd:H.data?.cwd??null,provider:H.data?.provider??null,workspaceId:$,isLoading:H.isLoading}),[H.data,H.isLoading,z,$]);return $y.jsx(mA,{value:G,children:Z})}var G2=_(p(),1);var KU=_(d(),1);function GU({visible:$,editing:Z,canvasRef:J,width:H,height:B,pointerProps:Q,onKeyDown:X,children:z}){if(!$)return null;return KU.jsxs("div",{className:"absolute inset-0 animate-in duration-100 fade-in",onKeyDown:X,children:[KU.jsx("canvas",{ref:J,...Q,width:H,height:B,"aria-label":"Drawing area",tabIndex:0,className:"absolute inset-0 size-full cursor-pencil touch-none outline-none"}),Z&&z]})}var t0=_(p(),1);function pA($,Z,J){let H=Math.max($,Z);if(H<=0)return 1;return Math.min(Math.max(J,1),1568/H)}function t80($){return new Promise((Z,J)=>{setTimeout(()=>J(Error("Annotation capture timed out")),$)})}function e80($){if(!($ instanceof HTMLElement))return;let{overflowX:Z,overflowY:J}=$.style;if(J==="auto"||J==="scroll")$.style.overflowY="hidden";if(Z==="auto"||Z==="scroll")$.style.overflowX="hidden"}async function Zy($){let Z=$.getBoundingClientRect();if(Z.width<=0||Z.height<=0)throw Error("Annotation target is not visible");let{createContext:J,destroyContext:H,domToCanvas:B}=await import("/chunk-zs4mte79.js"),Q=async()=>{let X=await J($,{width:Math.round(Z.width),height:Math.round(Z.height),scale:pA(Z.width,Z.height,window.devicePixelRatio),type:"image/png",backgroundColor:getComputedStyle($).backgroundColor,timeout:1000,features:{restoreScrollPosition:!0},style:{overflow:"hidden"},onCloneEachNode:e80});try{return await B(X)}finally{H(X)}};return Promise.race([Q(),t80(1e4)])}var cA={past:[],present:[],future:[]};function $90($,Z){if(Z.type==="commit")return{past:[...$.past,$.present],present:[...$.present,Z.stroke],future:[]};if(Z.type==="undo"){let J=$.past.at(-1);if(!J)return $;return{past:$.past.slice(0,-1),present:J,future:[$.present,...$.future]}}if(Z.type==="redo"){let J=$.future[0];if(!J)return $;return{past:[...$.past,$.present],present:J,future:$.future.slice(1)}}if($.present.length===0)return $;return{past:[...$.past,$.present],present:[],future:[]}}function By($,Z,J){let H=$.getBoundingClientRect();return{x:(Z-H.left)/H.width*$.width,y:(J-H.top)/H.height*$.height}}function Jy($,Z){let J=Z.getCoalescedEvents?.()??[];return(J.length>0?J:[Z]).map((B)=>By($,B.clientX,B.clientY))}var Z90={canUndo:!1,canRedo:!1,hasStrokes:!1};function xB($){return t0.useSyncExternalStore($.subscribeHistory,$.getHistoryState,$.getHistoryState)}function Hy($,Z,J,H){let B=Z.points[0];if(!B)return;$.beginPath(),$.lineCap="round",$.lineJoin="round",$.lineWidth=H,$.strokeStyle=J,$.moveTo(B.x,B.y);for(let Q=1;Q<Z.points.length;Q++){let X=Z.points[Q];$.lineTo(X.x,X.y)}if(Z.points.length===1)$.lineTo(B.x+0.01,B.y+0.01);$.stroke()}function Qy($,Z,J,H,B,Q=null){let X=Math.max(3,Math.min(Z,J)*0.005),z=X+Math.max(2,X*0.75),G=Q?[...B,Q]:B;for(let K of G)Hy($,K,H.haloColor,z);for(let K of G)Hy($,K,H.strokeColor,X)}function J90($,Z,J,H=null){let B=$.getContext("2d");if(!B)return;B.clearRect(0,0,$.width,$.height),Qy(B,$.width,$.height,Z,J,H)}function H90($,Z,J){let H=$.getContext("2d");if(!H)return;H.clearRect(0,0,$.width,$.height),H.drawImage(Z.snapshot,0,0,$.width,$.height),Qy(H,$.width,$.height,Z,J)}function B90($){return new Promise((Z,J)=>{$.toBlob((H)=>{if(H)Z(H);else J(Error("Could not export drawing"))},"image/png")})}function Q90($,Z,J){let H=$.getBoundingClientRect();if(H.width<=0||H.height<=0)return null;let B=getComputedStyle($),Q=pA(H.width,H.height,window.devicePixelRatio),X=Math.max(1,Math.round(H.width*Q)),z=Math.max(1,Math.round(H.height*Q)),G=document.createElement("canvas");G.width=X,G.height=z;let K=B.getPropertyValue("--background").trim()||"#ffffff",U=G.getContext("2d");if(U)U.fillStyle=K,U.fillRect(0,0,X,z);return Z.width=X,Z.height=z,{id:J,snapshot:G,strokeColor:B.getPropertyValue("--primary").trim()||"#2563eb",haloColor:K,targetWidth:H.width,targetHeight:H.height}}function X90($){return $ instanceof HTMLInputElement||$ instanceof HTMLTextAreaElement||$ instanceof HTMLElement&&$.isContentEditable}function UU({mode:$="annotation",onChange:Z,onEditingStart:J,onFinish:H}={}){let B=t0.useRef(null),Q=t0.useRef(null),[X,z]=t0.useState(null),G=t0.useRef(X),[K,U]=t0.useState(!1),Y=t0.useRef(!1),F=t0.useRef(cA),W=t0.useRef(Z90),q=t0.useRef(new Set),N=t0.useRef(0),A=t0.useRef(null),V=t0.useRef(null),D=t0.useRef(0),L=t0.useRef(0),j=t0.useRef(null),M=t0.useRef(null),[P,w]=t0.useState(!1),C=t0.useRef(!1),[R,O]=t0.useState(!1),S=t0.useRef(!1),y=K5(Z),k=K5(J),T=K5(H),b=t0.useCallback(()=>{let s=F.current,a=W.current,e={canUndo:s.past.length>0,canRedo:s.future.length>0,hasStrokes:s.present.length>0};if(e.canUndo===a.canUndo&&e.canRedo===a.canRedo&&e.hasStrokes===a.hasStrokes)return;W.current=e;for(let $0 of q.current)$0()},[]),I=t0.useCallback((s)=>{return q.current.add(s),()=>{q.current.delete(s)}},[]),v=t0.useCallback(()=>W.current,[]),h=t0.useCallback((s,a=null)=>{if(D.current)cancelAnimationFrame(D.current),D.current=0;let e=Q.current,$0=G.current;if(e&&$0)J90(e,$0,s,a)},[]),f=t0.useCallback(()=>{if(D.current)return;D.current=requestAnimationFrame(()=>{D.current=0,h(F.current.present,A.current)})},[h]),E=t0.useCallback((s,a,e)=>{let $0=j.current;if($0?.sessionId===s.id&&$0.historyVersion===e)return Promise.resolve($0.blob);let B0=M.current;if(B0?.sessionId===s.id&&B0.historyVersion===e)return B0.promise;if(a.length===0)return j.current={sessionId:s.id,historyVersion:e,blob:null},y.current?.(null),Promise.resolve(null);let _0=document.createElement("canvas");_0.width=s.snapshot.width,_0.height=s.snapshot.height,H90(_0,s,a);let M0=B90(_0).then((V0)=>{if(G.current?.id!==s.id||N.current!==e)return V0;return j.current={sessionId:s.id,historyVersion:e,blob:V0},y.current?.(V0),V0}).catch(()=>{if(G.current?.id===s.id&&N.current===e)q5.add({title:"Couldn’t export the drawing",type:"error"});return null}).finally(()=>{if(M.current?.promise===M0)M.current=null});return M.current={sessionId:s.id,historyVersion:e,promise:M0},M0},[y]),i=t0.useCallback(()=>{if(!A.current)return;let s=Q.current,a=V.current;if(s&&a!==null&&s.hasPointerCapture(a))s.releasePointerCapture(a);A.current=null,V.current=null,h(F.current.present)},[h]),r=t0.useCallback((s)=>{let a=G.current;if(!a||S.current)return;let e=$90(F.current,s);if(e===F.current)return;F.current=e,b(),A.current=null;let $0=++N.current;h(e.present),E(a,e.present,$0)},[E,b,h]),x=t0.useCallback((s)=>{F.current=cA,N.current=0,j.current=null,M.current=null,A.current=null,V.current=null,b(),G.current=s,z(s)},[b]),l=t0.useCallback(()=>{if(Y.current)return;Y.current=!0,U(!0),k.current?.()},[k]),o=t0.useCallback(async()=>{let s=B.current;if(!s||G.current||C.current)return!1;let a=++L.current;C.current=!0,w(!0);try{let e=await Zy(s);if(a!==L.current||B.current!==s)return!1;let $0=s.getBoundingClientRect(),B0=getComputedStyle(s),_0={id:a,snapshot:e,strokeColor:B0.getPropertyValue("--primary").trim()||"#2563eb",haloColor:B0.getPropertyValue("--background").trim()||"#ffffff",targetWidth:$0.width,targetHeight:$0.height};return x(_0),l(),!0}finally{if(a===L.current)C.current=!1,w(!1)}},[l,x]),u=t0.useCallback(()=>{let s=G.current;L.current+=1,C.current=!1,S.current=!1,w(!1),O(!1),Y.current=!1,U(!1),i(),z(null),F.current=cA,b();let a=M.current;if(!s||a?.sessionId!==s.id)return G.current=null,Promise.resolve();return a.promise.then(()=>{if(G.current?.id===s.id)G.current=null})},[i,b]),c=t0.useCallback(async()=>{let s=G.current;if(!s)return null;return i(),E(s,F.current.present,N.current)},[i,E]),n=t0.useCallback(async()=>{return Y.current=!1,U(!1),c()},[c]),Z0=t0.useCallback(async()=>{let s=G.current;if(!s||S.current)return null;S.current=!0,O(!0),i();let a=N.current,e=F.current.present,$0=null;if(e.length>0||a>0)$0=await E(s,e,a);if(G.current?.id!==s.id)return $0;try{await T.current?.($0)}finally{if(G.current?.id===s.id)L.current+=1,Y.current=!1,U(!1),G.current=null,z(null),S.current=!1,O(!1)}return $0},[i,E,T]),J0=t0.useCallback(()=>r({type:"undo"}),[r]),X0=t0.useCallback(()=>r({type:"redo"}),[r]),Q0=t0.useCallback(()=>r({type:"clear"}),[r]),F0=t0.useMemo(()=>({onPointerDown:(s)=>{if(S.current||!s.isPrimary||s.pointerType==="mouse"&&s.button!==0)return;if(!G.current&&$==="sketch"){let a=B.current;if(!a)return;let e=Q90(a,s.currentTarget,++L.current);if(!e)return;x(e)}if(!G.current)return;l(),V.current=s.pointerId,s.currentTarget.setPointerCapture(s.pointerId),A.current={points:[By(s.currentTarget,s.clientX,s.clientY)]},h(F.current.present,A.current)},onPointerMove:(s)=>{if(s.pointerId!==V.current||!A.current)return;A.current.points.push(...Jy(s.currentTarget,s.nativeEvent)),f()},onPointerUp:(s)=>{if(s.pointerId!==V.current||!A.current)return;let a=A.current;if(a.points.push(...Jy(s.currentTarget,s.nativeEvent)),A.current=null,V.current=null,s.currentTarget.hasPointerCapture(s.pointerId))s.currentTarget.releasePointerCapture(s.pointerId);r({type:"commit",stroke:a})},onPointerCancel:(s)=>{if(s.pointerId===V.current)i()}}),[r,l,i,x,$,h,f]),A0=t0.useCallback((s)=>{if(X90(s.target))return;if(s.key==="Escape"&&$==="annotation"){s.preventDefault(),Z0();return}if(!(s.metaKey||s.ctrlKey)||s.key.toLowerCase()!=="z")return;if(s.preventDefault(),s.shiftKey)X0();else J0()},[Z0,$,X0,J0]);t0.useLayoutEffect(()=>{if(!X)return;if(h(F.current.present,A.current),K)Q.current?.focus()},[K,h,X]),t0.useEffect(()=>{if(!X||$==="sketch")return;let s=B.current;if(!s){u();return}let a=new ResizeObserver((e)=>{let $0=e[0]?.contentRect;if(!$0)return;if(Math.abs($0.width-X.targetWidth)>1||Math.abs($0.height-X.targetHeight)>1)u()});return a.observe(s),()=>a.disconnect()},[u,$,X]),t0.useEffect(()=>()=>{if(L.current+=1,Y.current=!1,G.current=null,D.current)cancelAnimationFrame(D.current)},[]);let N0=t0.useMemo(()=>({active:K,visible:$==="sketch"||X!==null,starting:P,finishing:R,open:o,undo:J0,redo:X0,clear:Q0,flush:c,deactivate:n,finish:Z0,cancel:u,subscribeHistory:I,getHistoryState:v}),[K,$,X,P,R,o,J0,X0,Q0,c,n,Z0,u,I,v]),Y0=t0.useMemo(()=>({visible:N0.visible,editing:N0.active,canvasRef:Q,width:X?.snapshot.width??1,height:X?.snapshot.height??1,pointerProps:F0,onKeyDown:A0}),[N0.active,N0.visible,X,F0,A0]);return t0.useMemo(()=>({targetRef:B,controls:N0,layerProps:Y0}),[N0,Y0])}var o5=_(d(),1);function YU({controls:$,title:Z,busy:J,onComplete:H}){let{canUndo:B,canRedo:Q,hasStrokes:X}=xB($);return o5.jsxs("div",{className:"absolute bottom-3 left-1/2 flex -translate-x-1/2 items-center gap-2 rounded-lg bg-popover p-1.5 shadow-md",children:[o5.jsx("span",{className:"mr-2 ml-2 text-sm font-medium",children:Z}),o5.jsxs("div",{className:"flex gap-1",children:[o5.jsxs(B5,{children:[o5.jsx(Q5,{render:o5.jsx(j0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.undo,disabled:J||!B,"aria-label":"Undo",children:o5.jsx(Xy,{stroke:1.75})})}),o5.jsx(X5,{children:"Undo"})]}),o5.jsxs(B5,{children:[o5.jsx(Q5,{render:o5.jsx(j0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.redo,disabled:J||!Q,"aria-label":"Redo",children:o5.jsx(zy,{stroke:1.75})})}),o5.jsx(X5,{children:"Redo"})]}),o5.jsx(j0,{type:"button",variant:"outline",size:"sm",onClick:$.clear,disabled:J||!X,children:"Clear"})]}),o5.jsx(L4,{mode:"popLayout",initial:!1,children:o5.jsx(V5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.1,bounce:0},children:o5.jsx(j0,{type:"button",variant:X?"default":"ghost",size:"icon-sm",onClick:H,disabled:J,"aria-label":"Complete",className:G0(!X&&"text-muted-foreground"),children:X?o5.jsx(L8,{stroke:1.75}):o5.jsx(a5,{stroke:1.75})})},X?"complete":"cancel")})]})}var Q2=_(p(),1);async function hB($,Z){let J=`/api/workspaces/${$}/uploads`;if(typeof Z==="string")return q1(`${J}/from-path`,v5("POST",{path:Z}),"The file couldn’t be uploaded");let H=new FormData;H.append("files",Z);let[B]=await q1(J,{method:"POST",body:H},"The file couldn’t be uploaded");if(!B)throw Error("The upload didn’t finish");return B}function Gy($,Z){for(let J of Z)Ky($,J)}async function Ky({workspaceId:$,sessionId:Z},J,H,B){let Q=typeof J==="string"?null:J,X=typeof J==="string"?J.split("/").at(-1):J.name||"file",z=crypto.randomUUID();k1.getState().addAttachments($,Z,[{kind:"file",source:B,localId:z,label:X,mediaType:Q?.type||"application/octet-stream",previewUrl:Q?.type.startsWith("image/")?URL.createObjectURL(Q):void 0,status:"uploading"}]);try{let G=await hB($,J);k1.getState().updateAttachment($,z,{status:"ready",upload:G,label:G.filename,mediaType:G.mediaType,...G.kind==="image"&&!Q?.type.startsWith("image/")?{previewUrl:`/api/workspaces/${$}/uploads/${G.id}`}:{}})}catch(G){let K=G instanceof Error?G.message:"The file couldn’t be uploaded";k1.getState().removeAttachment($,z),q5.add({title:`Couldn’t add ${X}`,description:K,type:"error"}),H?.(K)}}function Uy($,Z){if(Z.type==="text"){let{source:J,label:H,text:B}=Z;return z90($,{source:J,label:H,text:B}),Promise.resolve()}return Ky($,Z.file??Z.path,(J)=>{n4($.workspaceId,{source:"runtime",message:`addChatAttachment() from ${Z.source}: ${J}`})},Z.source)}function vB({workspaceId:$,sessionId:Z,localId:J,purpose:H,source:B,blob:Q}){let X=H==="sketch"?"Sketch":"Annotation",z=URL.createObjectURL(Q),G=k1.getState();if(mz(G.attachments,$,J))G.updateAttachment($,J,{previewUrl:z,status:"draft",upload:void 0});else G.addAttachments($,Z,[{kind:"drawing",purpose:H,localId:J,source:B,label:`${X}.png`,mediaType:"image/png",previewUrl:z,status:"draft"}])}async function FU($){let{workspaceId:Z,localId:J,purpose:H,blob:B,isCurrent:Q}=$,X=H==="sketch"?"Sketch":"Annotation";vB($),k1.getState().updateAttachment(Z,J,{status:"uploading"});try{let z=await hB(Z,new File([B],`${X}.png`,{type:"image/png"}));if(!Q())return;k1.getState().updateAttachment(Z,J,{status:"ready",upload:z,mediaType:z.mediaType})}catch{if(!Q())return;k1.getState().removeAttachment(Z,J)}}function z90({workspaceId:$,sessionId:Z},J){k1.getState().addAttachments($,Z,[{kind:"text",localId:crypto.randomUUID(),...J}])}function Yy({workspaceId:$,sessionId:Z,activeTab:J,mode:H,available:B,closePopup:Q,openPopup:X}){let z=Q2.useRef(null),G=Q2.useRef(null),K=Q2.useRef(new Map),U=K5(Q),Y=K5(X),F=Q2.useCallback((T)=>{let b=z.current;if(!b)return;if(G.current=T,!T){k1.getState().removeAttachment(b.workspaceId,b.attachmentId);return}vB({workspaceId:b.workspaceId,sessionId:b.sourceSessionId,localId:b.attachmentId,purpose:"annotation",source:b.source,blob:T})},[]),W=Q2.useCallback((T,b)=>{let I=(K.current.get(T.attachmentId)??0)+1;return K.current.set(T.attachmentId,I),FU({workspaceId:T.workspaceId,sessionId:T.sourceSessionId,localId:T.attachmentId,purpose:"annotation",source:T.source,blob:b,isCurrent:()=>K.current.get(T.attachmentId)===I})},[]),q=Q2.useCallback(async(T)=>{let b=z.current;if(z.current=null,G.current=null,b&&T)await W(b,T);if(b?.origin==="popup")Y.current()},[Y,W]),N=UU({onChange:F,onFinish:q}),{controls:A}=N,{active:V,starting:D,open:L,finish:j,cancel:M}=A,P=Q2.useCallback(async(T)=>{if(!B||V||D)return;let b={workspaceId:$,sourceSessionId:Z,source:J,origin:T,attachmentId:crypto.randomUUID()};z.current=b;try{if(!await L()){if(z.current===b)z.current=null;return}if(T==="popup")U.current()}catch{if(z.current!==b)return;z.current=null,q5.add({title:"Couldn’t capture this page",type:"error"})}},[V,J,B,U,L,Z,D,$]),w=Q2.useCallback(async()=>{let T=z.current;if(await M(),z.current!==T)return;z.current=null;let b=G.current;if(G.current=null,T&&b)W(T,b)},[M,W]),C=Q2.useCallback((T)=>{let b=(K.current.get(T)??0)+1;if(K.current.set(T,b),k1.getState().removeAttachment($,T),z.current?.attachmentId===T)z.current=null,G.current=null,M()},[M,$]),R=Q2.useCallback(async()=>{if(D){await w();return}await j()},[w,j,D]),O=Q2.useCallback(()=>{if(V||D)R();else P("docked")},[V,R,P,D]),S=Q2.useCallback(()=>{if(V||D)R();else P("popup")},[V,R,P,D]);Q2.useEffect(()=>{let T=z.current;if(!T)return;let b=T.origin==="docked"?"split":"fullscreen";if(T.workspaceId!==$||T.sourceSessionId!==Z||T.source!==J||H!==b||!B)w()},[J,B,w,H,Z,$]);let y=Q2.useMemo(()=>B?{active:V||D,finish:R,onRemove:C,onToggle:O}:void 0,[B,V,D,R,C,O]),k=Q2.useMemo(()=>B?{active:V||D,finish:R,onRemove:C,onToggle:S}:void 0,[B,V,D,R,C,S]);return Q2.useMemo(()=>({...N,docked:y,popup:k}),[N,y,k])}var m4=_(p(),1);var O8=_(d(),1);function dA($){if(!$)return;$.focus();let Z=$.value.length;$.setSelectionRange(Z,Z)}function Wy({composerRef:$,className:Z,onMouseDown:J,children:H,...B}){return O8.jsx("form",{...B,onMouseDown:(Q)=>{if(J?.(Q),Q.defaultPrevented)return;if(Q.target instanceof Element&&Q.target.closest('button, input, textarea, select, a, [contenteditable="true"]'))return;dA($.current)},className:G0("group/composer flex w-full cursor-text flex-col gap-1 rounded-xl bg-card p-2 text-card-foreground shadow-xs transition-[color,box-shadow] outline-none focus-within:shadow-sm",Z),children:H})}function qy({textareaRef:$,className:Z,...J}){return O8.jsx("textarea",{...J,ref:$,className:G0("field-sizing-content max-h-40 w-full resize-none bg-transparent px-2 py-1 text-sm leading-relaxed outline-none placeholder:text-muted-foreground disabled:opacity-50",Z)})}function Ny({className:$,children:Z,...J}){return O8.jsx("div",{...J,className:G0("flex items-center justify-end gap-3",$),children:Z})}function G90($){if($.status==="checking")return"Checking agent status…";return}function gB($,Z,J){return $&&!Z&&J.status==="available"}function Vy({label:$,hasContent:Z,busy:J=!1,loading:H=!1,availability:B}){let Q=gB(Z,J||H,B),X=G90(B),z=O8.jsx(j0,{type:"submit",size:"icon",disabled:!Q,"aria-label":$,children:H?O8.jsx(s4,{}):O8.jsx(Fy,{stroke:1.5})});if(H||!X)return z;return O8.jsxs(B5,{children:[O8.jsx(Q5,{render:O8.jsx("span",{className:"inline-flex",children:z})}),O8.jsx(X5,{className:"max-w-64 text-center",children:X})]})}var $8=_(p(),1),K90=48;function Ay($,Z){let J=$8.useRef(!0),[H,B]=$8.useState(!0),Q=$8.useCallback((G)=>{J.current=G,B((K)=>K===G?K:G)},[]),X=$8.useCallback((G="auto")=>{let K=$.current;if(!K)return;Q(!0),K.scrollTo({top:K.scrollHeight,behavior:G})},[$,Q]),z=$8.useCallback(()=>{let G=$.current;if(!G)return;Q(!1),G.scrollTo({top:0,behavior:"auto"})},[$,Q]);return $8.useEffect(()=>{let G=$.current;if(!G)return;let K=()=>{let U=G.scrollHeight-G.scrollTop-G.clientHeight;Q(U<=K90)};return G.addEventListener("scroll",K,{passive:!0}),()=>G.removeEventListener("scroll",K)},[$,Q]),$8.useEffect(()=>{let G=$.current;if(!G)return;let K=G.firstElementChild??G,U=new ResizeObserver(()=>{if(J.current)G.scrollTop=G.scrollHeight});return U.observe(K),()=>U.disconnect()},[$]),$8.useLayoutEffect(()=>{X("auto")},[Z,X]),{atBottom:H,scrollToBottom:X,scrollToTop:z}}function U90($){return $.origin.kind!=="replay"&&$.origin.kind!=="synthetic"&&$.origin.kind!=="subagent-prompt"}function Dy($,Z){let J=$.meta||Z.meta?{...$.meta,...Z.meta}:void 0;return{...$,parts:[...$.parts,...Z.parts],timestamp:Z.timestamp??$.timestamp,meta:J}}function Ly($,Z){if(!Z)return $;let J=$.at(-1);if(J?.role==="assistant")return[...$.slice(0,-1),Dy(J,Z)];return[...$,Z]}function My($){let Z=[];for(let J of $){if(!U90(J))continue;if(J.role!=="assistant"){Z.push(J);continue}let H=Z.length>0?Z[Z.length-1]:null;if(H?.role==="assistant")Z[Z.length-1]=Dy(H,J);else Z.push(J)}return Z.map((J,H)=>{let B=Z[H-1];if(J.role!=="assistant"||J.meta?.durationMs!==void 0||B?.role!=="user"||B.origin.kind!=="user-input"||!B.timestamp||!J.timestamp)return J;let Q=Date.parse(B.timestamp),X=Date.parse(J.timestamp);if(!Number.isFinite(Q)||!Number.isFinite(X)||X<Q)return J;return{...J,meta:{...J.meta,durationMs:X-Q}}})}function lA($){switch($.kind){case"warning":return $.message;case"compact":return"Context compacted";case"model-change":return $.prev?`Model changed to ${$.model} (was ${$.prev})`:`Model changed to ${$.model}`;case"api-retry":return $.error?`Retrying: ${$.error}`:"Retrying the connection";case"rate-limit":case"hook":case"session-state":case"files-persisted":case"elicitation":default:return null}}function Py($){if(!$)return;let Z=Date.parse($);return Number.isNaN(Z)?void 0:Z}function _y($,Z){let J=Z.filter((G)=>lA(G)!==null);if(J.length===0)return $.map((G)=>({kind:"turn",turn:G}));let H=[],B=[];for(let G of J){let K=Py(G.at);if(K===void 0)B.push(G);else H.push({notice:G,time:K})}H.sort((G,K)=>G.time-K.time);let Q=[],X=0,z=Number.NEGATIVE_INFINITY;for(let G of $){z=Math.max(z,Py(G.timestamp)??z);while(X<H.length&&H[X].time<=z)Q.push({kind:"notice",notice:H[X].notice}),X+=1;Q.push({kind:"turn",turn:G})}for(;X<H.length;X+=1)Q.push({kind:"notice",notice:H[X].notice});for(let G of B)Q.push({kind:"notice",notice:G});return Q}var n5=_(d(),1);function oZ({label:$,icon:Z,onRemove:J,previewUrl:H,loading:B,className:Q,children:X,...z}){return n5.jsxs("div",{...z,className:G0("group relative flex max-w-full min-w-0 cursor-default items-center rounded-md bg-background text-sm whitespace-nowrap text-foreground ring-1 ring-border outline-none focus-visible:ring-3 focus-visible:ring-ring/50",H?"size-14 overflow-hidden":"h-7 pr-2 pl-0.5",Q),children:[B&&n5.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-background/70",children:n5.jsx(b5,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),H?n5.jsx(F90,{label:$,previewUrl:H,onRemove:J}):n5.jsx(Y90,{label:$,icon:Z,onRemove:J}),X]})}function Y90({label:$,icon:Z,onRemove:J}){return n5.jsxs(n5.Fragment,{children:[J?n5.jsxs(j0,{type:"button",variant:"ghost",size:"icon-sm",onClick:J,"aria-label":`Remove ${$}`,className:"size-6 shrink-0 hover:bg-transparent hover:text-current",children:[n5.jsx(Z,{stroke:1.75,className:"group-focus-within:hidden group-hover:hidden"}),n5.jsx(a5,{stroke:1.75,className:"hidden group-focus-within:block group-hover:block"})]}):n5.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center",children:n5.jsx(Z,{size:16,stroke:1.75})}),n5.jsx("span",{className:"truncate",children:$})]})}function F90({label:$,previewUrl:Z,onRemove:J}){return n5.jsxs(n5.Fragment,{children:[n5.jsx("img",{src:Z,alt:$,className:"size-full object-cover"}),J&&n5.jsx(j0,{type:"button",variant:"outline",size:"icon-sm",onClick:J,"aria-label":`Remove ${$}`,className:"absolute top-1 right-1 size-4 rounded-xs border-0 opacity-0 shadow-xs transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 [&_svg]:size-3",children:n5.jsx(a5,{stroke:1.75})})]})}var Oy=_(d(),1);function fB({label:$,onRemove:Z}){return Oy.jsx(oZ,{label:$,icon:jy,onRemove:Z})}var O6={};I5(O6,{createHandle:()=>oy,Viewport:()=>ay,Trigger:()=>gy,Root:()=>ky,Positioner:()=>my,Portal:()=>hy,Popup:()=>py,Handle:()=>AU,Backdrop:()=>iy,Arrow:()=>dy});var by=_(p(),1);var WU=_(p(),1),iA=WU.createContext(void 0);function Z4($){let Z=WU.useContext(iA);if(Z===void 0&&!$)throw Error(h0(50));return Z}var Cy=_(p(),1);var Ty=600,qU=300;var Ey={...j9,instantType:($)=>$.instantType,adaptiveOrigin:($)=>$.adaptiveOrigin,closeDelay:($)=>$.closeDelay};class rA extends S2{constructor($,Z,J){let H=new L2;super(Sy($,H,Z,J),Iy(H),Ey)}setOpen=($,Z)=>{let{inlineRectCoordsRef:J}=this.context;Gz(this,$,Z,{onBeforeDispatch(){let H=Z.event;if($&&Z.reason===K0.triggerHover&&Z.trigger&&"clientX"in H&&"clientY"in H&&J.current?.element!==Z.trigger)YN(J,Z.trigger,H.clientX,H.clientY)}})}}function wy(){let $=new L2;return new u8(Object.freeze(Sy(void 0,$)),Object.freeze(Iy($)),Ey)}function Sy($,Z,J,H=!1){return{..._9(Z,J,H),instantType:void 0,adaptiveOrigin:void 0,closeDelay:qU,...$}}function Iy($){return{popupRef:Cy.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:$,inlineRectCoordsRef:{current:void 0}}}var j6=_(d(),1);function Ry($){let{open:Z,defaultOpen:J=!1,onOpenChange:H,onOpenChangeComplete:B,actionsRef:Q,handle:X,triggerId:z,defaultTriggerId:G=null,children:K}=$,U=a3((V,D)=>new rA({open:J,openProp:Z,activeTriggerId:G,triggerIdProp:z},V,D));U.useControlledProp("openProp",Z),U.useControlledProp("triggerIdProp",z),U.useContextCallback("onOpenChange",H),U.useContextCallback("onOpenChangeComplete",B);let Y=U.useState("open"),F=U.useState("activeTriggerId"),W=U.useState("mounted"),q=U.useState("payload");L9(U,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:N}=M9(Y,U,()=>{U.context.inlineRectCoordsRef.current=void 0});H0(()=>{if(Y){if(F==null)U.set("payload",void 0)}},[U,F,Y]),by.useImperativeHandle(Q,()=>({unmount:N,close:()=>U.setOpen(!1,I0(K0.imperativeAction))}),[N,U]);let A=Y||W;return j6.jsxs(iA.Provider,{value:U,children:[X&&j6.jsx(A9,{handle:X,store:U}),A&&j6.jsx(W90,{store:U}),typeof K==="function"?K({payload:q}):K]})}function W90({store:$}){let Z=$.useState("floatingRootContext"),J=v8(Z);return P9($,{activeTriggerProps:J.reference,inactiveTriggerProps:J.trigger,popupProps:J.floating}),null}var ky=R8(function(Z){if(Z4(!0))return j6.jsx(Ry,{...Z});return j6.jsx(C7,{children:j6.jsx(Ry,{...Z})})});var xy=_(p(),1);var NU=_(p(),1),aA=NU.createContext(void 0);function yy(){let $=NU.useContext(aA);if($===void 0)throw Error(h0(48));return $}var oA=_(d(),1),hy=xy.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z;if(!(Z4().useState("mounted")||H))return null;return oA.jsx(aA.Provider,{value:H,children:oA.jsx(e$,{ref:J,...B})})});var vy=_(p(),1);var gy=U9(function(Z,J){let{render:H,className:B,delay:Q,closeDelay:X,id:z,payload:G,handle:K,style:U,...Y}=Z,F=Z4(!0),q=O9(K)??F;if(!q)throw Error(h0(89));let N=s0(z),A=q.useState("isTriggerActive",N),V=q.useState("isOpenedByTrigger",N),D=q.useState("floatingRootContext"),L=q.context.inlineRectCoordsRef,j=vy.useRef(null),M=Q??Ty,P=X??qU,{registerTrigger:w,isMountedByThisTrigger:C}=D9(N,j,q,{payload:G,closeDelay:P}),R=f8(D,{mouseOnly:!0,move:!1,handleClose:m8(),delay:()=>({open:M,close:P}),triggerElementRef:j,isActiveTrigger:A,isClosing:()=>q.select("transitionStatus")==="ending"}),O=I7(D,{delay:M}),S={open:V},y=q.useState("triggerProps",C),k=nO(L,V);return z0("a",Z,{state:S,ref:[J,w,j],props:[R,O.reference,y,k,{id:N},Y],stateAttributesMapping:Y9})});var fy=_(p(),1);var VU=_(p(),1),nA=VU.createContext(void 0);function nZ(){let $=VU.useContext(nA);if($===void 0)throw Error(h0(49));return $}var sA=_(d(),1),my=fy.forwardRef(function(Z,J){let{render:H,className:B,anchor:Q,positionMethod:X="absolute",side:z="bottom",align:G="center",sideOffset:K=0,alignOffset:U=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:F=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:A=N9,style:V,...D}=Z,L=Z4(),j=yy(),M=Y3(),P=L.useState("open"),w=L.useState("mounted"),C=L.useState("floatingRootContext"),R=L.useState("instantType"),O=L.useState("transitionStatus"),S=L.useState("adaptiveOrigin"),y=L.context.inlineRectCoordsRef,k=C9({anchor:Q,floatingRootContext:C,positionMethod:X,mounted:w,side:z,sideOffset:K,align:G,alignOffset:U,arrowPadding:W,collisionBoundary:Y,collisionPadding:F,sticky:q,disableAnchorTracking:N,keepMounted:j,nodeId:M,collisionAvoidance:A,adaptiveOrigin:S,inline:sO(y)}),T=k.update;H0(()=>{if(P&&w)T()},[P,w,T]);let b={open:P,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:R},I=w9(Z,b,{styles:k.positionerStyles,transitionStatus:O,props:D,refs:[J,L.useStateSetter("positionerElement")],hidden:!w,inert:!P});return sA.jsx(nA.Provider,{value:k,children:sA.jsx(T7,{id:M,children:I})})});var uy=_(p(),1);var py=uy.forwardRef(function(Z,J){let{className:H,render:B,style:Q,...X}=Z,z=Z4(),{side:G,align:K}=nZ(),U=z.useState("open"),Y=z.useState("instantType"),F=z.useState("transitionStatus"),W=z.useState("popupProps"),q=z.useState("floatingRootContext"),N=z.useState("closeDelay");return T5({open:U,ref:z.context.popupRef,onComplete(){if(U)z.context.onOpenChangeComplete?.(!0)}}),W3(q,{closeDelay:N}),z0("div",Z,{state:{open:U,side:G,align:K,instant:Y,transitionStatus:F},ref:[J,z.context.popupRef,z.useStateSetter("popupElement")],props:[V9,W,E9(F),X],stateAttributesMapping:d2})});var cy=_(p(),1);var dy=cy.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=Z4(),{arrowRef:G,side:K,align:U,arrowUncentered:Y,arrowStyles:F}=nZ(),q={open:z.useState("open"),side:K,align:U,uncentered:Y};return z0("div",Z,{state:q,ref:[G,J],props:[{style:F,"aria-hidden":!0},X],stateAttributesMapping:i4})});var ly=_(p(),1);var iy=ly.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=Z4(),G=z.useState("open"),K=z.useState("mounted"),U=z.useState("transitionStatus");return z0("div",Z,{state:{open:G,transitionStatus:U},ref:[J],props:[{role:"presentation",hidden:!K,style:{pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none"}},X],stateAttributesMapping:d2})});var ry=_(p(),1);var ay=ry.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=Z4(),K=nZ(),U=G.useState("instantType"),{children:Y,state:F}=s3({store:G,side:K.side,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:U};return z0("div",Z,{state:W,ref:J,props:[z,{children:Y}],stateAttributesMapping:n3})});class AU extends g8{constructor(){super(wy(),"PreviewCard")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function oy(){return new AU}var sZ=_(d(),1);function ny({...$}){return sZ.jsx(O6.Root,{"data-slot":"hover-card",...$})}function sy({...$}){return sZ.jsx(O6.Trigger,{"data-slot":"hover-card-trigger",...$})}function ty({className:$,side:Z="bottom",sideOffset:J=4,align:H="center",alignOffset:B=0,...Q}){return sZ.jsx(D8,{portal:O6.Portal,"data-slot":"hover-card-portal",children:sZ.jsx(O6.Positioner,{align:H,alignOffset:B,side:Z,sideOffset:J,className:"isolate z-50",children:sZ.jsx(O6.Popup,{"data-slot":"hover-card-content",className:G1("z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-3 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...Q})})})}var Q$=_(d(),1);function ey({attachment:$,onRemove:Z}){let{previewUrl:J,purpose:H}=$,B=H==="sketch"?"Sketch":"Annotation";return Q$.jsxs(ny,{children:[Q$.jsx(sy,{render:Q$.jsx(oZ,{tabIndex:0,label:B,icon:tZ,onRemove:Z})}),J&&Q$.jsx(ty,{side:"top",align:"start",className:"w-60 max-w-[calc(100vw-2rem)] rounded-xl",children:Q$.jsx("img",{src:J,alt:`${B} preview`,className:"max-h-72 w-full rounded-md object-contain"})})]})}var Zx=_(d(),1);function $x({attachment:$,onRemove:Z}){return Zx.jsx(oZ,{label:$.label,icon:EZ,onRemove:Z,previewUrl:$.previewUrl,loading:$.status==="uploading",title:$.label,className:"max-w-52"})}var aB=_(p(),1);var FJ=_(p(),1);function DU($){return J5({queryKey:S0.sessions($),queryFn:()=>q1(`/api/workspaces/${$}/sessions`),...v4})}function q90($,Z){return $?.filter((J)=>J.sessionId!==Z)}function Jx($){let Z=z1();return H5({mutationFn:(J)=>A4(`/api/workspaces/${$}/sessions/${J}/archive`,{method:"POST"},"Couldn’t archive chat"),onSuccess:(J,H)=>{Z.setQueryData(S0.sessions($),(B)=>q90(B,H)),Z.removeQueries({queryKey:S0.events($,H)}),Z.removeQueries({queryKey:S0.sessionConfig($,H)}),Z.invalidateQueries({queryKey:S0.preview($)})}})}function Hx($,Z){return J5({...tC($,Z??""),enabled:Boolean(Z)})}function LU($,Z){return J5({queryKey:S0.sessionConfig($,Z??""),queryFn:()=>q1(`/api/workspaces/${$}/sessions/${Z}/config`),enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function Bx($){let Z=z1();return H5({mutationFn:({patch:J,sessionId:H})=>q1(`/api/workspaces/${$}/sessions/${H}/config`,v5("PUT",J),"Failed to save chat settings"),onSuccess:(J,{sessionId:H})=>{Z.setQueryData(S0.sessionConfig($,H),J)}})}var N90=["fable","opus","sonnet","haiku"];function MU($,Z,J=$.find((H)=>H.value==="default")?.resolvedModel){let H=$.filter((B)=>B.value!=="default");return H.find((B)=>B.value===Z)??H.find((B)=>(B.resolvedModel??B.value)===J)??H[0]}function Qx($){let Z=$.resolvedModel??$.value,J=N90.findIndex((H)=>Z===H||Z.startsWith(`${H}[`)||Z.includes(`-${H}-`));return J===-1?void 0:J}function V90($,Z){if($===void 0&&Z===void 0)return 0;if($===void 0)return-1;if(Z===void 0)return 1;return $-Z}function A90($,Z){return V90(Qx($),Qx(Z))}var D90={"claude-code":A90};function L90($,Z){return $.map((J,H)=>({model:J,index:H})).sort((J,H)=>Z(J.model,H.model)||J.index-H.index).map(({model:J})=>J)}function tA($,Z,J){if(Z&&$.includes(Z))return Z;if(J&&$.includes(J))return J;if($.includes("high"))return"high";return $[$.length-1]}function Xx($,Z,J){let H=tA($,Z,J);return H?$.indexOf(H):-1}function zx($){return $.length>1}function Gx($,Z){if($.supportsFastMode!==!0)return!1;return Z??$.defaultFastMode??!1}function Kx($,Z){let J=D90[Z];return J?L90($,J):$}function Ux($,Z){let J=[];for(let H of $){let B=H.group??Z,Q=J.find((X)=>X.label===B);if(Q)Q.models.push(H);else J.push({label:B,models:[H]})}return J}var M4={};I5(M4,{createHandle:()=>Uh,Viewport:()=>Qh,Trigger:()=>Hh,SubmenuTrigger:()=>Kh,SubmenuRoot:()=>sx,Separator:()=>zh,Root:()=>lU,RadioItemIndicator:()=>lx,RadioItem:()=>dx,RadioGroup:()=>ux,Positioner:()=>fx,Portal:()=>xx,Popup:()=>bx,LinkItem:()=>Ix,Item:()=>Sx,Handle:()=>nU,GroupLabel:()=>Ex,Group:()=>Tx,CheckboxItemIndicator:()=>_x,CheckboxItem:()=>Px,Backdrop:()=>qx,Arrow:()=>Fx});var Yx=_(p(),1);var PU=_(p(),1),eA=PU.createContext(void 0);function J4($){let Z=PU.useContext(eA);if(Z===void 0&&!$)throw Error(h0(33));return Z}var _U=_(p(),1),$D=_U.createContext(void 0);function D5($){let Z=_U.useContext($D);if(Z===void 0&&!$)throw Error(h0(36));return Z}var Fx=Yx.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{store:z}=D5(),{arrowRef:G,side:K,align:U,arrowUncentered:Y,arrowStyles:F}=J4(),q={open:z.useState("open"),side:K,align:U,uncentered:Y};return z0("div",Z,{ref:[G,J],stateAttributesMapping:i4,state:q,props:{style:F,"aria-hidden":!0,...X}})});var Wx=_(p(),1);var jU=_(p(),1),M90=jU.createContext(void 0);function T6($=!0){let Z=jU.useContext(M90);if(Z===void 0&&!$)throw Error(h0(25));return Z}var qx=Wx.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{store:z}=D5(),G=z.useState("open"),K=z.useState("mounted"),U=z.useState("transitionStatus"),Y=z.useState("lastOpenChangeReason"),F=T6(),W={open:G,transitionStatus:U};return z0("div",Z,{ref:F?.backdropRef?[J,F.backdropRef]:J,state:W,stateAttributesMapping:d2,props:[{role:"presentation",hidden:!K,style:{pointerEvents:Y===K0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},X]})});var EU=_(p(),1);var OU=_(p(),1),ZD=OU.createContext(void 0);function Nx(){let $=OU.useContext(ZD);if($===void 0)throw Error(h0(30));return $}var $J=_(p(),1);var Vx=_(p(),1);function TU($){let{closeOnClick:Z,highlighted:J,id:H,nodeId:B,store:Q,typingRef:X,itemRef:z,itemMetadata:G}=$,{events:K}=Q.useState("floatingTreeRoot"),U=Q.useState("open"),Y=T6(!0),F=Y!==void 0;return Vx.useMemo(()=>({id:H,role:"menuitem",tabIndex:U&&J?0:-1,onKeyDown(W){if(W.key===" "&&X?.current)W.preventDefault()},onMouseMove(W){if(!B)return;K.emit("itemhover",{nodeId:B,target:W.currentTarget})},onClick(W){if(Z)K.emit("close",{domEvent:W,reason:K0.itemPress})},onMouseUp(W){if(Y){let q=Y.initialCursorPointRef.current;if(Y.initialCursorPointRef.current=null,F&&q&&Math.abs(W.clientX-q.x)<=1&&Math.abs(W.clientY-q.y)<=1)return;if(F&&!r1.os.mac&&W.button===2)return}if(z.current&&Q.context.allowMouseUpTriggerRef.current&&(!F||W.button===2)){if(G.type==="regular-item")eZ(z.current,W,{detail:1})}}}),[Z,J,H,K,B,U,Q,X,z,Y,F,G])}var C6={type:"regular-item"};function E6($){let{closeOnClick:Z,disabled:J,highlighted:H,id:B,store:Q,typingRef:X=Q.context.typingRef,nativeButton:z,itemMetadata:G,nodeId:K}=$,U=$J.useRef(null),{getButtonProps:Y,buttonRef:F}=O5({disabled:J,focusableWhenDisabled:!0,native:z,composite:!0}),W=TU({closeOnClick:Z,highlighted:H,id:B,nodeId:K,store:Q,typingRef:X,itemRef:U,itemMetadata:G}),q=$J.useCallback((A)=>{return M2(W,{onMouseEnter(){if(G.type!=="submenu-trigger")return;G.setActive()}},A,Y)},[W,Y,G]),N=b2(U,F);return $J.useMemo(()=>({getItemProps:q,itemRef:N}),[q,N])}var X$=_(p(),1);var CU=_(p(),1),JD=CU.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Ax(){return CU.useContext(JD)}function H4($={}){let{guess:Z,label:J,metadata:H,textRef:B,index:Q}=$,{register:X,unregister:z,subscribeMapChange:G,nextIndexRef:K}=Ax(),U=X$.useRef(-1),[Y,F]=X$.useState(Q==null&&Z?()=>{if(U.current===-1){let A=K.current;K.current+=1,U.current=A}return U.current}:-1),W=Q??Y,q=X$.useRef(null),N=X$.useCallback((A)=>{let V=q.current;if(V)z(V);if(q.current=A,A)X(A,{metadata:H??null,index:Q??null,label:J,textRef:B})},[Q,X,z,H,J,B]);return H0(()=>{if(Q!=null)return;return G((A)=>{let V=q.current?A.get(q.current)?.index:null;if(V!=null)F(V)})},[Q,G]),{ref:N,index:W}}var Dx="data-checked",Lx="data-unchecked";var w6={checked($){if($)return{[Dx]:""};return{[Lx]:""}},...V2};var Mx=_(d(),1),Px=EU.forwardRef(function(Z,J){let{render:H,className:B,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:K=!1,checked:U,defaultChecked:Y,onCheckedChange:F,style:W,...q}=Z,N=H4({guess:!0,label:X}),A=J4(!0),V=s0(Q),{store:D}=D5(),L=D.useState("disabled"),j=G||L,M=D.useState("isActive",N.index),P=D.useState("itemProps"),[w,C]=e2({controlled:U,default:Y??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:R,itemRef:O}=E6({closeOnClick:K,disabled:j,highlighted:M,id:V,store:D,nativeButton:z,nodeId:A?.context.nodeId,itemMetadata:C6}),S=EU.useMemo(()=>({disabled:j,highlighted:M,checked:w}),[j,M,w]);function y(T){let b=I0(K0.itemPress,T.nativeEvent,void 0,{preventUnmountOnClose:F1});if(F?.(!w,b),b.isCanceled)return;C((I)=>!I)}let k=z0("div",Z,{state:S,stateAttributesMapping:w6,props:[P,{role:"menuitemcheckbox","aria-checked":w,onClick:y},q,R],ref:[O,J,N.ref]});return Mx.jsx(ZD.Provider,{value:S,children:k})});var wU=_(p(),1);var _x=wU.forwardRef(function(Z,J){let{render:H,className:B,style:Q,keepMounted:X=!1,...z}=Z,G=Nx(),K=wU.useRef(null),{transitionStatus:U,mounted:Y,setMounted:F}=a2(G.checked);T5({batch:!0,enabled:!G.checked,open:G.checked,ref:K,onComplete(){if(!G.checked)F(!1)}});let W={checked:G.checked,disabled:G.disabled,highlighted:G.highlighted,transitionStatus:U};return z0("span",Z,{state:W,ref:[J,K],stateAttributesMapping:w6,props:{"aria-hidden":!0,...z},enabled:X||Y})});var IU=_(p(),1);var SU=_(p(),1),mB=SU.createContext(void 0);function jx(){let $=SU.useContext(mB);if($===void 0)throw Error(h0(31));return $}var Ox=_(d(),1),Tx=IU.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,[z,G]=IU.useState(void 0),K=z0("div",Z,{ref:J,props:{role:"group","aria-labelledby":z,...X}});return Ox.jsx(mB.Provider,{value:G,children:K})});var Cx=_(p(),1);var Ex=Cx.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,...z}=Z,G=s0(X),K=jx();return H0(()=>{return K(G),()=>{K((U)=>U===G?void 0:U)}},[K,G]),z0("div",Z,{ref:J,props:{id:G,"aria-hidden":!0,...z}})});var wx=_(p(),1);var Sx=wx.forwardRef(function(Z,J){let{render:H,className:B,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:K=!0,style:U,...Y}=Z,F=H4({guess:!0,label:X}),W=J4(!0),q=s0(Q),{store:N}=D5(),A=N.useState("disabled"),V=G||A,D=N.useState("isActive",F.index),L=N.useState("itemProps"),{getItemProps:j,itemRef:M}=E6({closeOnClick:K,disabled:V,highlighted:D,id:q,store:N,nativeButton:z,nodeId:W?.context.nodeId,itemMetadata:C6});return z0("div",Z,{state:{disabled:V,highlighted:D},props:[L,Y,j],ref:[M,J,F.ref]})});var RU=_(p(),1);var Ix=RU.forwardRef(function(Z,J){let{render:H,className:B,id:Q,label:X,closeOnClick:z=!1,style:G,...K}=Z,U=RU.useRef(null),Y=H4({guess:!0,label:X}),W=J4(!0)?.context.nodeId,q=s0(Q),{store:N}=D5(),A=N.useState("isActive",Y.index),V=N.useState("itemProps"),D=N.context.typingRef,{getButtonProps:L,buttonRef:j}=O5({native:!1,composite:!0}),M=TU({closeOnClick:z,highlighted:A,id:q,nodeId:W,store:N,typingRef:D,itemRef:U,itemMetadata:C6});function P(C){return M2(M,C,L)}return z0("a",Z,{state:{highlighted:A},props:[V,K,P],ref:[U,j,J,Y.ref]})});var yU=_(p(),1);var bU=_(p(),1),_90=bU.createContext(void 0);function kU($){let Z=bU.useContext(_90);if(Z===void 0&&!$)throw Error(h0(69));return Z}var Rx=_(d(),1),bx=yU.forwardRef(function(Z,J){let{render:H,className:B,style:Q,finalFocus:X,...z}=Z,{store:G}=D5(),{side:K,align:U}=J4(),Y=kU(!0)!=null,F=G.useState("open"),W=G.useState("transitionStatus"),q=G.useState("popupProps"),N=G.useState("mounted"),A=G.useState("instantType"),V=G.useState("activeTriggerElement"),D=G.useState("parent"),L=G.useState("lastOpenChangeReason"),j=G.useState("rootId"),M=G.useState("floatingRootContext"),P=G.useState("floatingTreeRoot"),w=G.useState("closeDelay"),C=G.useState("hoverEnabled"),R=G.useState("disabled"),O=G.useState("openMethod"),S=D.type==="context-menu";T5({open:F,ref:G.context.popupRef,onComplete(){if(F)G.context.onOpenChangeComplete?.(!0)}}),yU.useEffect(()=>{function I(v){G.setOpen(!1,I0(v.reason,v.domEvent))}return P.events.on("close",I),()=>{P.events.off("close",I)}},[P.events,G]),W3(M,{enabled:C&&!R&&!S&&D.type!=="menubar",closeDelay:w});let y=G.useStateSetter("popupElement"),k={transitionStatus:W,side:K,align:U,open:F,nested:D.type==="menu",instant:A},T=z0("div",Z,{state:k,ref:[J,G.context.popupRef,y],stateAttributesMapping:d2,props:[q,{onKeyDown(I){if(Y&&c8.has(I.key))I.stopPropagation()}},E9(W),z,{"data-rootownerid":j}]}),b=D.type===void 0||S;if(V||D.type==="menubar"&&L!==K0.outsidePress)b=!0;return Rx.jsx(E7,{context:M,openInteractionType:O,modal:S,disabled:!N,returnFocus:X===void 0?b:X,initialFocus:D.type!=="menu",restoreFocus:!0,externalTree:D.type!=="menubar"?P:void 0,previousFocusableElement:V,nextFocusableElement:D.type===void 0?G.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:D.type===void 0?G.context.beforeContentFocusGuardRef:void 0,children:T})});var yx=_(p(),1);var xU=_(p(),1),HD=xU.createContext(void 0);function kx(){let $=xU.useContext(HD);if($===void 0)throw Error(h0(32));return $}var BD=_(d(),1),xx=yx.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z,{store:Q,parent:X}=D5();if(!(Q.useState("mounted")||H))return null;let K=X.type==="menu"||X.type==="menubar"?"group":void 0;return BD.jsx(HD.Provider,{value:H,children:BD.jsx(j7,{ref:J,...B,portalOwnerRole:K})})});var p9=_(p(),1);var M3=_(p(),1);var hx=_(d(),1);function S6($){let{children:Z,elementsRef:J,labelsRef:H,onMapChange:B}=$,Q=U0(B),[,X]=M3.useState(!1),z=d1(O90).current,G=d1(j90).current,K=M3.useRef(0),U=M3.useRef(!0),Y=M3.useRef(null),F=M3.useRef(null),W=U0(()=>{if(U.current)return;U.current=!0,X((M)=>!M)}),q=U0((M,P)=>{G.set(M,P),W()}),N=U0((M)=>{G.delete(M),W()}),A=U0((M)=>{let P=new Map;if(J.current.length=0,H)H.current.length=0;return M.forEach((w)=>{if(P.set(w.element,{...w.registration.metadata??{},index:w.index}),J.current[w.index]=w.element,H)H.current[w.index]=w.registration.label!==void 0?w.registration.label:w.registration.textRef?.current?.textContent??w.element.textContent}),K.current=J.current.length,P});function V(M){if(F.current?.disconnect(),F.current=null,typeof MutationObserver!=="function"||M.length<2)return;let P=new MutationObserver((C)=>{if(!E90(C))return;let R=null;for(let O of M){if(!O.isConnected)continue;if(R&&vx(R,O)>0){P.disconnect(),W();return}R=O}});F.current=P;let w=new Set;for(let C=1;C<M.length;C+=1){let R=C90(M[C-1],M[C]);if(R)w.add(R)}w.forEach((C)=>P.observe(C,{childList:!0}))}let D=U0(()=>{let[M,P]=T90(G),w=A(M),C=Y.current,R=!C||C.length!==M.length||M.some((O,S)=>{let y=C[S];return O.index!==y.index||O.element!==y.element||O.registration.index!==y.registration.index||O.registration.metadata!==y.registration.metadata});if(V(P),Y.current=M,U.current=!1,!R)return;z.forEach((O)=>O(w)),Q(w)});H0(()=>{if(!U.current&&Y.current)A(Y.current);return()=>{if(J.current=[],H)H.current=[]}},[J,H,A]),H0(()=>{if(U.current)D()}),H0(()=>{return()=>{F.current?.disconnect(),U.current=!0}},[]);let L=U0((M)=>{return z.add(M),()=>{z.delete(M)}}),j=M3.useMemo(()=>({register:q,unregister:N,subscribeMapChange:L,nextIndexRef:K}),[q,N,L,K]);return hx.jsx(JD.Provider,{value:j,children:Z})}function j90(){return new Map}function O90(){return new Set}function T90($){let Z=new Set,J=[],H=[];$.forEach((Q,X)=>{if(!X.isConnected)return;let z=Q.index,G={index:z??-1,element:X,registration:Q};if(z===null)H.push(G);else if(z>=0)Z.add(z),J.push(G)});let B=0;if(H.sort((Q,X)=>vx(Q.element,X.element)),H.forEach((Q)=>{while(Z.has(B))B+=1;Q.index=B,J.push(Q),B+=1}),Z.size>0)J.sort((Q,X)=>Q.index-X.index);return[J,H.map((Q)=>Q.element)]}function C90($,Z){let J=$.parentElement;while(J&&!J.contains(Z))J=J.parentElement;return J}function E90($){for(let Z of $)for(let J=0;J<Z.removedNodes.length;J+=1)if(Z.removedNodes[J].isConnected)return!0;return!1}function vx($,Z){return $.compareDocumentPosition(Z)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var gx=_(p(),1);var w90=20;function hU($,Z,J,H){let[B,Q]=gx.useState(!1);H0(()=>{if(!$||!Z||J==null){Q(!1);return}let X=m0(J).documentElement.clientWidth,z=J.offsetWidth;Q(X>0&&z>0&&z>=X-w90)},[$,Z,J]),XG($&&(!Z||B),H)}var ZJ=_(d(),1),fx=p9.forwardRef(function(Z,J){let{anchor:H,positionMethod:B="absolute",className:Q,render:X,side:z,align:G,sideOffset:K=0,alignOffset:U=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:F=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:A=ej,style:V,...D}=Z,{store:L}=D5(),j=kx(),M=T6(!0),P=L.useState("parent"),w=L.useState("floatingRootContext"),C=L.useState("floatingTreeRoot"),R=L.useState("mounted"),O=L.useState("open"),S=L.useState("modal"),y=L.useState("openMethod"),k=L.useState("activeTriggerElement"),T=L.useState("transitionStatus"),b=L.useState("positionerElement"),I=L.useState("instantType"),v=L.useState("adaptiveOrigin"),h=L.useState("lastOpenChangeReason"),f=L.useState("floatingNodeId"),E=L.useState("floatingParentNodeId"),i=w.useState("domReferenceElement"),r=p9.useRef(null),x=b4(b),l=H,o=K,u=U,c=G,n=A;if(P.type==="context-menu"){if(l=H??P.context?.anchor,c=c??"start",!z&&c!=="center")u=Z.alignOffset??2,o=Z.sideOffset??-5}let Z0=z,J0=c;if(P.type==="menu")Z0=Z0??"inline-end",J0=J0??"start",n=Z.collisionAvoidance??N9;else if(P.type==="menubar")Z0=Z0??(P.context.orientation==="vertical"?"inline-end":"bottom"),J0=J0??"start";let X0=P.type==="context-menu",Q0=C9({anchor:l,floatingRootContext:w,positionMethod:M?"fixed":B,mounted:R,side:Z0,sideOffset:o,align:J0,alignOffset:u,arrowPadding:X0?0:W,collisionBoundary:Y,collisionPadding:F,sticky:q,nodeId:f,keepMounted:j,disableAnchorTracking:N,collisionAvoidance:n,shift:X0?{crossAxis:!(("side"in n)&&n.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:C,adaptiveOrigin:v});p9.useEffect(()=>{function $0(B0){if(B0.open){if(B0.parentNodeId===f)L.set("hoverEnabled",!1);if(B0.nodeId!==f&&B0.parentNodeId===L.select("floatingParentNodeId"))L.setOpen(!1,I0(K0.siblingOpen))}}return C.events.on("menuopenchange",$0),()=>{C.events.off("menuopenchange",$0)}},[L,C.events,f]),p9.useEffect(()=>{if(L.select("floatingParentNodeId")==null)return;function $0(B0){if(B0.open||B0.nodeId!==L.select("floatingParentNodeId"))return;let _0=B0.reason??K0.siblingOpen;L.setOpen(!1,I0(_0))}return C.events.on("menuopenchange",$0),()=>{C.events.off("menuopenchange",$0)}},[C.events,L]);let F0=i1();p9.useEffect(()=>{if(!O)F0.clear()},[O,F0]),p9.useEffect(()=>{function $0(B0){if(!O||B0.nodeId!==L.select("floatingParentNodeId"))return;if(B0.target&&k&&k!==B0.target){let _0=L.select("closeDelay");if(_0>0){if(!F0.isStarted())F0.start(_0,()=>{L.setOpen(!1,I0(K0.siblingOpen))})}else L.setOpen(!1,I0(K0.siblingOpen))}else F0.clear()}return C.events.on("itemhover",$0),()=>{C.events.off("itemhover",$0)}},[C.events,O,k,L,F0]),p9.useEffect(()=>{let $0={open:O,nodeId:f,parentNodeId:E,reason:L.select("lastOpenChangeReason")};C.events.emit("menuopenchange",$0)},[C.events,O,L,f,E]),H0(()=>{let $0=i,B0=r.current;if($0)r.current=$0;if(B0&&$0&&$0!==B0){L.set("instantType",void 0);let _0=new AbortController;return x(()=>{L.set("instantType","trigger-change")},_0.signal),()=>{_0.abort()}}return},[i,x,L]);let A0={open:O,side:Q0.side,align:Q0.align,anchorHidden:Q0.anchorHidden,nested:P.type==="menu",instant:I},N0=P.type==="menubar"&&P.context.modal,Y0=S&&h!==K0.triggerHover;hU(O&&(N0||Y0),y==="touch",b,k);let s=w9(Z,A0,{styles:Q0.positionerStyles,transitionStatus:T,props:D,refs:[J,L.useStateSetter("positionerElement")],hidden:!R,inert:!O}),a=R&&P.type!=="menu"&&(P.type!=="menubar"&&S&&h!==K0.triggerHover||P.type==="menubar"&&P.context.modal),e=null;if(P.type==="menubar")e=P.context.contentElement;else if(P.type===void 0)e=k;return ZJ.jsxs(eA.Provider,{value:Q0,children:[a&&ZJ.jsx(LZ,{ref:P.type==="context-menu"||P.type==="nested-context-menu"?P.context.internalBackdropRef:null,inert:q8(!O),cutout:e}),ZJ.jsx(T7,{id:f,children:ZJ.jsx(S6,{elementsRef:L.context.itemDomElements,labelsRef:L.context.itemLabels,children:s})})]})});var I6=_(p(),1);var vU=_(p(),1),QD=vU.createContext(void 0);function mx(){let $=vU.useContext(QD);if($===void 0)throw Error(h0(34));return $}var XD=_(d(),1),ux=I6.memo(I6.forwardRef(function(Z,J){let{render:H,className:B,value:Q,defaultValue:X,onValueChange:z,disabled:G=!1,style:K,"aria-labelledby":U,...Y}=Z,[F,W]=I6.useState(void 0),[q,N]=e2({controlled:Q,default:X,name:"MenuRadioGroup"}),A=U0((j,M)=>{if(z?.(j,M),M.isCanceled)return;N(j)}),D=z0("div",Z,{state:{disabled:G},ref:J,props:{role:"group","aria-labelledby":U??F,"aria-disabled":G||void 0,...Y}}),L=I6.useMemo(()=>({value:q,setValue:A,disabled:G}),[q,A,G]);return XD.jsx(mB.Provider,{value:W,children:XD.jsx(QD.Provider,{value:L,children:D})})}));var fU=_(p(),1);var gU=_(p(),1),zD=gU.createContext(void 0);function px(){let $=gU.useContext(zD);if($===void 0)throw Error(h0(35));return $}var cx=_(d(),1),dx=fU.forwardRef(function(Z,J){let{render:H,className:B,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:K=!1,value:U,style:Y,...F}=Z,W=H4({guess:!0,label:X}),q=J4(!0),N=s0(Q),{store:A}=D5(),V=A.useState("isActive",W.index),D=A.useState("itemProps"),{value:L,setValue:j,disabled:M}=mx(),P=A.useState("disabled"),w=G||M||P,C=L===U,{getItemProps:R,itemRef:O}=E6({closeOnClick:K,disabled:w,highlighted:V,id:N,store:A,nativeButton:z,nodeId:q?.context.nodeId,itemMetadata:C6}),S=fU.useMemo(()=>({disabled:w,highlighted:V,checked:C}),[w,V,C]);function y(T){let b=I0(K0.itemPress,T.nativeEvent,void 0,{preventUnmountOnClose:F1});j(U,b)}let k=z0("div",Z,{state:S,stateAttributesMapping:w6,props:[D,{role:"menuitemradio","aria-checked":C,onClick:y},F,R],ref:[O,J,W.ref]});return cx.jsx(zD.Provider,{value:S,children:k})});var mU=_(p(),1);var lx=mU.forwardRef(function(Z,J){let{render:H,className:B,style:Q,keepMounted:X=!1,...z}=Z,G=px(),K=mU.useRef(null),{transitionStatus:U,mounted:Y,setMounted:F}=a2(G.checked);T5({batch:!0,enabled:!G.checked,open:G.checked,ref:K,onComplete(){if(!G.checked)F(!1)}});let W={checked:G.checked,disabled:G.disabled,highlighted:G.highlighted,transitionStatus:U};return z0("span",Z,{state:W,stateAttributesMapping:w6,ref:[J,K],props:{"aria-hidden":!0,...z},enabled:X||Y})});var s5=_(p(),1);var uU=_(p(),1),S90=uU.createContext(null);function pU($){let Z=uU.useContext(S90);if(Z===null&&!$)throw Error(h0(5));return Z}var uB=_(p(),1);var ix={...j9,disabled:($)=>$.parent.type==="menubar"?$.parent.context.disabled||$.disabled:$.disabled,modal:($)=>($.parent.type===void 0||$.parent.type==="context-menu")&&($.modal??!0),openMethod:($)=>$.openMethod,allowMouseEnter:($)=>$.allowMouseEnter,highlightItemOnHover:($)=>$.highlightItemOnHover,parent:($)=>$.parent,rootId:($)=>{if($.parent.type==="menu")return $.parent.store.select("rootId");return $.parent.type!==void 0?$.parent.context.rootId:$.rootId},activeIndex:($)=>$.activeIndex,isActive:($,Z)=>$.activeIndex===Z,hoverEnabled:($)=>$.hoverEnabled,instantType:($)=>$.instantType,lastOpenChangeReason:($)=>$.openChangeReason,floatingTreeRoot:($)=>{if($.parent.type==="menu")return $.parent.store.select("floatingTreeRoot");return $.floatingTreeRoot},floatingNodeId:($)=>$.floatingNodeId,floatingParentNodeId:($)=>$.floatingParentNodeId,itemProps:($)=>$.itemProps,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin,keyboardEventRelay:($)=>{if($.keyboardEventRelay)return $.keyboardEventRelay;if($.parent.type==="menu")return $.parent.store.select("keyboardEventRelay");return}};class GD extends S2{constructor($,Z,J=!1){let H=new L2,B=ox(H,Z,J,$);super(B,ax(H),ix);this.unsubscribeParentListener=this.observe("parent",(Q)=>{if(this.unsubscribeParentListener?.(),Q.type==="menu"){let X=Q.store.select("rootId"),z=Q.store.select("floatingTreeRoot"),G=Q.store.select("keyboardEventRelay");this.unsubscribeParentListener=Q.store.subscribe(()=>{let K=Q.store.select("rootId"),U=Q.store.select("floatingTreeRoot"),Y=Q.store.select("keyboardEventRelay");if(X===K&&z===U&&G===Y)return;X=K,z=U,G=Y,this.notifyAll()}),this.context.allowMouseUpTriggerRef=Q.store.context.allowMouseUpTriggerRef;return}if(Q.type!==void 0)this.context.allowMouseUpTriggerRef=Q.context.allowMouseUpTriggerRef;this.unsubscribeParentListener=null})}setOpen($,Z){this.state.floatingRootContext.context.events.emit("setOpen",{open:$,eventDetails:Z})}unsubscribeParentListener=null}function rx(){let $=new L2,Z=new u8(Object.freeze(ox($)),Object.freeze(ax($)),ix);return Object.assign(Z,{setOpen:F1})}function ax($){return{positionerRef:uB.createRef(),popupRef:uB.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:uB.createRef(),beforeContentFocusGuardRef:uB.createRef(),onOpenChangeComplete:void 0,triggerElements:$}}function ox($,Z,J=!1,H){return{..._9($,Z,J),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new O7,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:L1,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...H}}var cU=_(p(),1),KD=cU.createContext(void 0);function dU(){return cU.useContext(KD)}var pB=_(d(),1),lU=R8(function(Z){let{children:J,open:H,onOpenChange:B,onOpenChangeComplete:Q,defaultOpen:X=!1,disabled:z=!1,modal:G,loopFocus:K=!0,orientation:U="vertical",actionsRef:Y,closeParentOnEsc:F=!1,handle:W,triggerId:q,defaultTriggerId:N=null,highlightItemOnHover:A=!0}=Z,V=T6(!0),D=D5(!0),L=pU(!0),j=dU(),M=s5.useMemo(()=>{if(j&&D)return{type:"menu",store:D.store};if(L)return{type:"menubar",context:L};if(V&&!D)return{type:"context-menu",context:V};return{type:void 0}},[V,D,L,j]),P=W4(),w=W4(),C=N4(),R=M.type==="menu"?M.store:void 0,O=(H??X)&&R?.state.transitionStatus==="starting",S=d1(()=>O?R?.state.instantType:void 0).current,y=I90({open:X,openProp:H,activeTriggerId:N,triggerIdProp:q,parent:M,disabled:z,highlightItemOnHover:A,modal:M.type===void 0?G:void 0,rootId:P,instantType:S},w,C!=null);y.useControlledProp("openProp",H),y.useControlledProp("triggerIdProp",q),y.useContextCallback("onOpenChangeComplete",Q);let k=y.useState("floatingTreeRoot"),T=Y3(k),b=y.useState("open"),I=y.useState("activeTriggerElement"),v=y.useState("positionerElement"),h=y.useState("hoverEnabled"),f=y.useState("disabled"),E=y.useState("lastOpenChangeReason"),i=y.useState("parent"),r=y.useState("activeIndex"),x=y.useState("payload"),l=y.useState("floatingParentNodeId"),o=s5.useRef(null),u=s5.useRef(i.type!=="context-menu"),c=i1(),n=s5.useRef(!0),Z0=i1(),J0=l!=null,{openMethod:X0,triggerProps:Q0}=tE(b);y.useSyncedValues({disabled:z,highlightItemOnHover:A,modal:i.type===void 0?G:void 0,openMethod:X0,rootId:P}),L9(y);let{forceUnmount:F0,transitionStatus:A0}=M9(b,y,()=>{y.set("allowMouseEnter",!1)},O),N0=b4(y.context.popupRef);s5.useEffect(()=>{if(S===void 0)return;let T0=()=>{if(y.state.instantType===S)y.set("instantType",void 0)};if(!b){T0();return}if(A0!==void 0)return;if(y.context.popupRef.current==null){T0();return}let x0=new AbortController;return N0(T0,x0.signal),()=>{x0.abort()}},[S,b,A0,N0,y]),H0(()=>{if(V&&!D)y.update({parent:{type:"context-menu",context:V},floatingNodeId:T,floatingParentNodeId:C});else if(D)y.update({floatingNodeId:T,floatingParentNodeId:C})},[V,D,T,C,y]),s5.useEffect(()=>{if(!b)o.current=null;if(i.type!=="context-menu")return;if(!b){c.clear(),u.current=!1;return}c.start(500,()=>{u.current=!0})},[c,b,i.type]),H0(()=>{if(!b&&!h)y.set("hoverEnabled",!0)},[b,h,y]);let Y0=U0((T0,x0)=>{let Z1=x0.reason;if(!T0&&!y.select("open"))return;if(b===T0&&x0.trigger===I&&E===Z1)return;let W1=TH(x0);if(!T0&&x0.trigger==null)x0.trigger=I??void 0;if(B?.(T0,x0),x0.isCanceled)return;y.state.floatingRootContext.dispatchOpenChange(T0,x0);let d0=x0.event;if(T0===!1&&d0?.type==="click"&&d0.pointerType==="touch"&&!n.current)return;if(T0&&Z1===K0.triggerFocus)n.current=!1,Z0.start(300,()=>{n.current=!0});else n.current=!0,Z0.clear();let v0=(Z1===K0.triggerPress||Z1===K0.itemPress)&&d0.detail===0,w1=!T0&&(Z1===K0.escapeKey||Z1==null);o.current=x0.event;let B1=S7(y.state,T0,x0.trigger,W1());if(B1.openChangeReason=Z1,i.type==="menubar"&&(Z1===K0.triggerFocus||Z1===K0.focusOut||Z1===K0.triggerHover||Z1===K0.listNavigation||Z1===K0.siblingOpen))B1.instantType="group";else if(v0||w1)B1.instantType=v0?"click":"dismiss";else B1.instantType=void 0;y.update(B1)}),s=OH({popupStore:y,floatingRootContext:y.state.floatingRootContext,floatingId:w,nested:C!=null,onOpenChange:Y0}),a=s.context.events;H0(()=>{let T0=({open:x0,eventDetails:Z1})=>Y0(x0,Z1);return a.on("setOpen",T0),()=>{a?.off("setOpen",T0)}},[a,Y0]);let e=s5.useCallback(()=>{y.setOpen(!1,I0(K0.imperativeAction))},[y]);s5.useImperativeHandle(Y,()=>({unmount:F0,close:e}),[F0,e]);let $0;if(i.type==="context-menu")$0=i.context;s5.useImperativeHandle($0?.positionerRef,()=>v,[v]),s5.useImperativeHandle($0?.actionsRef,()=>({setOpen:Y0}),[Y0]);let B0=v8(s,{enabled:!f,bubbles:{escapeKey:F&&i.type==="menu"},outsidePress(){if(i.type!=="context-menu"||o.current?.type==="contextmenu")return!0;return u.current},externalTree:J0?k:void 0}),_0=y4(),M0=s5.useCallback((T0)=>{if(y.select("activeIndex")===T0)return;y.set("activeIndex",T0)},[y]),V0=_N(s,{enabled:!f,listRef:y.context.itemDomElements,activeIndex:r,nested:i.type!==void 0,loopFocus:K,orientation:U,parentOrientation:i.type==="menubar"?i.context.orientation:void 0,rtl:_0==="rtl",disabledIndices:c2,onNavigate:M0,openOnArrowKeyDown:i.type!=="context-menu",externalTree:J0?k:void 0,focusItemOnHover:A}),L0=s5.useCallback((T0)=>{y.context.typingRef.current=T0},[y]),g=jN(s,{enabled:!f,listRef:y.context.itemLabels,elementsRef:y.context.itemDomElements,activeIndex:r,resetMs:oj,onMatch:(T0)=>{if(b&&T0!==r)y.set("activeIndex",T0)},onTyping:L0}),m=s5.useMemo(()=>{let T0=M2(g.reference,V0.reference,B0.reference,{onMouseMove(){y.set("allowMouseEnter",!0)}},Q0);return T0["aria-haspopup"]="menu",T0["aria-expanded"]=b,T0},[y,g.reference,V0.reference,B0.reference,Q0,b]),t=s5.useMemo(()=>{let T0=M2(V0.trigger,B0.trigger,Q0);return T0["aria-haspopup"]="menu",T0["aria-expanded"]=!1,T0},[V0.trigger,B0.trigger,Q0]);d1(()=>{return y.update({inactiveTriggerProps:t}),null});let W0=s5.useMemo(()=>M2(V9,{id:w,role:"menu","aria-orientation":U==="horizontal"?"horizontal":void 0,"aria-labelledby":I?.id,onMouseMove(){if(y.set("allowMouseEnter",!0),i.type==="menu")y.set("hoverEnabled",!1)},onClick(){if(y.select("hoverEnabled"))y.set("hoverEnabled",!1)},onKeyDown(T0){let x0=y.select("keyboardEventRelay");if(x0&&!T0.isPropagationStopped())x0(T0)}},g.floating,V0.floating,B0.floating),[I,w,U,i.type,y,g.floating,V0.floating,B0.floating]),R0=V0.item??L1;P9(y,{floatingRootContext:s,activeTriggerProps:m,inactiveTriggerProps:t,popupProps:W0,itemProps:R0});let c0=s5.useMemo(()=>({store:y,parent:M}),[y,M]),f0=pB.jsxs($D.Provider,{value:c0,children:[W&&pB.jsx(A9,{handle:W,store:y}),typeof J==="function"?J({payload:x}):J]});if(i.type===void 0||i.type==="context-menu")return pB.jsx(C7,{externalTree:k,children:f0});return f0});function I90($,Z,J){return d1(()=>new GD($,Z,J)).current}var nx=_(p(),1);var UD=_(d(),1);function sx($){let Z=D5().store,J=nx.useMemo(()=>({parentMenu:Z}),[Z]);return UD.jsx(KD.Provider,{value:J,children:UD.jsx(lU,{...$})})}var B4=_(p(),1);var iU=5;function tx($,Z){let J=R90(Z);return $.clientX>=J.left-iU&&$.clientX<=J.right+iU&&$.clientY>=J.top-iU&&$.clientY<=J.bottom+iU}function R90($){let Z=$.getBoundingClientRect(),J=I1($);if(r1.env.jsdom)return Z;let H=J.getComputedStyle($,"::before"),B=J.getComputedStyle($,"::after");if(!(H.content!=="none"||B.content!=="none"))return Z;let X=parseFloat(H.width)||0,z=parseFloat(H.height)||0,G=parseFloat(B.width)||0,K=parseFloat(B.height)||0,U=Math.max(Z.width,X,G),Y=Math.max(Z.height,z,K),F=U-Z.width,W=Y-Z.height;return{left:Z.left-F/2,right:Z.right+F/2,top:Z.top-W/2,bottom:Z.bottom+W/2}}var ex=_(p(),1);function rU($={}){let{highlightItemOnHover:Z,highlightedIndex:J,onHighlightedIndexChange:H}=JJ(),{ref:B,index:Q}=H4($),X=J===Q,z=ex.useRef(null),G=b2(B,z);return{compositeProps:{tabIndex:X?0:-1,onFocus(){H(Q)},onMouseMove(){let U=z.current;if(!Z||!U)return;let Y=U.hasAttribute("disabled")||U.ariaDisabled==="true";if(!X&&!Y)U.focus()}},compositeRef:G,index:Q}}function $h($){let{render:Z,className:J,style:H,state:B=L1,props:Q=c2,refs:X=c2,metadata:z,stateAttributesMapping:G,tag:K="div",...U}=$,{compositeProps:Y,compositeRef:F}=rU({metadata:z});return z0(K,$,{state:B,ref:[F,...X],props:[Y,...Q,U],stateAttributesMapping:G})}function YD($){if(P1($)&&$.hasAttribute("data-rootownerid"))return $.getAttribute("data-rootownerid");if(N8($))return;return YD(V8($))}var Zh=_(p(),1),FD=_(a4(),1);function aU($,Z){let J=Zh.useRef(null);function H(Q){FD.flushSync(()=>{$.setOpen(!1,I0(K0.focusOut,Q.nativeEvent,Q.currentTarget))}),mj(J.current)?.focus()}function B(Q){let X=$.select("positionerElement");if(X&&G3(Q,X))$.context.beforeContentFocusGuardRef.current?.focus();else{FD.flushSync(()=>{$.setOpen(!1,I0(K0.focusOut,Q.nativeEvent,Q.currentTarget))});let z=fj($.context.triggerFocusTargetRef.current||Z.current);while(z!==null&&b0(X,z)){let G=z;if(z=s$(z),z===G)break}z?.focus()}}return{preFocusGuardRef:J,handlePreFocusGuardFocus:H,handleFocusTargetFocus:B}}var oU=_(p(),1);function Jh($){let{enabled:Z=!0,mouseDownAction:J,open:H}=$,B=oU.useRef(!1);return oU.useMemo(()=>{if(!Z)return L1;return{onMouseDown:(Q)=>{if(J==="open"&&!H||J==="close"&&H)B.current=!0,m0(Q.currentTarget).addEventListener("click",()=>{B.current=!1},{once:!0})},onClick:(Q)=>{if(B.current)B.current=!1,Q.preventBaseUIHandler()}}},[Z,J,H])}var R6=_(d(),1),Hh=U9(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,id:G,openOnHover:K,delay:U=100,closeDelay:Y=0,handle:F,payload:W,...q}=Z,N=D5(!0),V=O9(F)??N?.store;if(!V)throw Error(h0(85));let D=s0(G),L=V.useState("isTriggerActive",D),j=V.useState("floatingRootContext"),M=V.useState("isOpenedByTrigger",D),P=V.useState("triggerPopupId",D),w=B4.useRef(null),C=k90(),R=JJ(!0),O=i2(),S=B4.useMemo(()=>{return O??new O7},[O]),y=Y3(S),k=N4(),{registerTrigger:T,isMountedByThisTrigger:b}=D9(D,w,V,{payload:W,closeDelay:Y,parent:C,floatingTreeRoot:S,floatingNodeId:y,floatingParentNodeId:k,keyboardEventRelay:R?.relayKeyboardEvent}),I=C.type==="menubar",v=V.useState("disabled"),h=X||v||I&&C.context.disabled,{getButtonProps:f,buttonRef:E}=O5({disabled:h,native:z});B4.useEffect(()=>{if(!M&&C.type===void 0)V.context.allowMouseUpTriggerRef.current=!1},[V,M,C.type]);let i=B4.useRef(null),r=i1(),x=U0(($0)=>{if(!i.current)return;r.clear(),V.context.allowMouseUpTriggerRef.current=!1;let B0=$0.target;if(b0(i.current,B0)||b0(V.select("positionerElement"),B0)||B0===i.current)return;if(B0!=null&&YD(B0)===V.select("rootId"))return;if(tx($0,i.current))return;S.events.emit("close",{domEvent:$0,reason:K0.cancelOpen})});B4.useEffect(()=>{if(M&&V.select("lastOpenChangeReason")===K0.triggerHover)m0(i.current).addEventListener("mouseup",x,{once:!0})},[M,x,V]);let l=I&&C.context.hasSubmenuOpen,u=f8(j,{enabled:(K??l)&&!h&&(!I||l&&!b),handleClose:m8({blockPointerEvents:!I}),mouseOnly:!0,move:!1,restMs:C.type===void 0?U:void 0,delay:{close:Y},triggerElementRef:w,externalTree:S,isActiveTrigger:L,isClosing:()=>V.select("transitionStatus")==="ending"}),c=b90(M,V.select("lastOpenChangeReason")),n=F3(j,{enabled:!h,event:M&&I?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0?c:!1}),Z0=I7(j,{enabled:!h&&l}),J0=Jh({open:M,enabled:I,mouseDownAction:"open"}),X0=B4.useMemo(()=>M2(Z0.reference,n.reference),[Z0.reference,n.reference]),Q0=V.useState("triggerProps",b),{preFocusGuardRef:F0,handlePreFocusGuardFocus:A0,handleFocusTargetFocus:N0}=aU(V,w),Y0={disabled:h,open:M},s=[i,J,E,T,w],a=[X0,u??L1,Q0,{"aria-haspopup":"menu","aria-controls":P,id:D,onMouseDown:($0)=>{if(V.select("open"))return;r.start(200,()=>{V.context.allowMouseUpTriggerRef.current=!0}),m0($0.currentTarget).addEventListener("mouseup",x,{once:!0})}},I?{role:"menuitem"}:{},J0,q,f],e=z0("button",Z,{enabled:!I,stateAttributesMapping:WH,state:Y0,ref:s,props:a});if(I)return R6.jsx($h,{tag:"button",render:H,className:B,style:Q,state:Y0,refs:s,props:a,stateAttributesMapping:WH});if(M)return R6.jsxs(B4.Fragment,{children:[R6.jsx(R4,{ref:F0,onFocus:A0},`${D}-pre-focus-guard`),R6.jsx(B4.Fragment,{children:e},D),R6.jsx(R4,{ref:V.context.triggerFocusTargetRef,onFocus:N0},`${D}-post-focus-guard`)]});return R6.jsx(B4.Fragment,{children:e},D)});function b90($,Z){let J=i1(),[H,B]=B4.useState(!1);return H0(()=>{if($&&Z===K0.triggerHover)B(!0),J.start(cX,()=>{B(!1)});else if(!$)J.clear(),B(!1)},[$,Z,J]),H}function k90(){let $=pU(!0);return B4.useMemo(()=>{if($)return{type:"menubar",context:$};return{type:void 0}},[$])}var Bh=_(p(),1);var Qh=Bh.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,{store:G}=D5(),{side:K}=J4(),U=G.useState("instantType"),{children:Y,state:F}=s3({store:G,side:K,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:U};return z0("div",Z,{state:W,ref:J,props:[z,{children:Y}],stateAttributesMapping:n3})});var Xh=_(p(),1);var zh=Xh.forwardRef(function(Z,J){let{className:H,render:B,orientation:Q="horizontal",style:X,...z}=Z;return z0("div",Z,{state:{orientation:Q},ref:J,props:[{role:"separator","aria-orientation":Q},z]})});var P3=_(p(),1);function Gh($){return $==null||$.hasAttribute("disabled")||$.getAttribute("aria-disabled")==="true"}var y90={"aria-expanded":void 0},Kh=P3.forwardRef(function(Z,J){let{render:H,className:B,style:Q,label:X,id:z,nativeButton:G=!1,openOnHover:K=!0,delay:U=100,closeDelay:Y=0,disabled:F=!1,...W}=Z,q=dU();if(!q?.parentMenu)throw Error(h0(37));let N=H4({guess:!0,label:X}),A=J4(),{store:V}=D5(),D=s0(z),L=V.useState("open"),j=V.useState("floatingRootContext"),M=V.useState("floatingTreeRoot"),P=V.useState("triggerPopupId",D),w=qN(D,V),C=U0((X0)=>{if(w(X0),X0!==null&&V.select("open")&&V.select("activeTriggerId")==null)V.update({activeTriggerId:D??null,activeTriggerElement:X0,closeDelay:Y})}),R=P3.useRef(null),O=P3.useCallback((X0)=>{R.current=X0,V.set("activeTriggerElement",X0)},[V]);H0(()=>{return C(R.current),()=>C(null)},[C,D,V]),V.useSyncedValue("closeDelay",Y);let S=q.parentMenu,y=V.useState("disabled"),k=S.useState("disabled"),T=F||y||k,b=S.useState("itemProps"),I=S.useState("isActive",N.index),v=P3.useMemo(()=>({type:"submenu-trigger",setActive(){if(S.select("highlightItemOnHover"))S.set("activeIndex",N.index)}}),[S,N.index]),{getItemProps:h,itemRef:f}=E6({closeOnClick:!1,disabled:T,highlighted:I,id:D,store:V,typingRef:S.context.typingRef,nativeButton:G,itemMetadata:v,nodeId:A?.context.nodeId}),E=V.useState("hoverEnabled"),i=f8(j,{enabled:E&&K&&!T,handleClose:m8({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:U,delay:{open:U,close:Y},shouldOpen:U>0?()=>S.select("allowMouseEnter"):void 0,triggerElementRef:R,externalTree:M,isClosing:()=>V.select("transitionStatus")==="ending",guardStaleOpen:!0}),x=F3(j,{enabled:!T,event:"mousedown",toggle:!K,ignoreMouse:K,stickIfOpen:!1}).reference??L1,l=V.useState("triggerProps",!0);delete l.id;let o={disabled:T,highlighted:I,open:L},u=V.useState("openMethod"),n=V.useState("lastOpenChangeReason")===K0.listNavigation||u==="keyboard",Z0=L&&n&&r1.screenReader.voiceOver;return z0("div",Z,{state:o,stateAttributesMapping:Y9,props:[x,i,l,b,Z0?y90:void 0,{"aria-controls":P,tabIndex:L||I?0:-1,onBlur(){if(I)S.set("activeIndex",null)}},W,h],ref:[J,N.ref,f,C,O]})});class nU extends g8{constructor(){super(rx(),"Menu")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function Uh(){return new nU}var v2=_(d(),1);function c9({...$}){return v2.jsx(M4.Root,{"data-slot":"dropdown-menu",...$})}function x90({...$}){return v2.jsx(D8,{portal:M4.Portal,"data-slot":"dropdown-menu-portal",...$})}function d9({...$}){return v2.jsx(M4.Trigger,{"data-slot":"dropdown-menu-trigger",...$})}function l9({align:$="start",alignOffset:Z=0,side:J="bottom",sideOffset:H=4,className:B,...Q}){return v2.jsx(x90,{children:v2.jsx(M4.Positioner,{className:"isolate z-50 outline-none",align:$,alignOffset:Z,side:J,sideOffset:H,children:v2.jsx(M4.Popup,{"data-slot":"dropdown-menu-content",className:G1("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rtl:data-[side=inline-end]:slide-in-from-right-2 rtl:data-[side=inline-start]:slide-in-from-left-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",B),...Q})})})}function b6({...$}){return v2.jsx(M4.Group,{"data-slot":"dropdown-menu-group",...$})}function sU({className:$,inset:Z,...J}){return v2.jsx(M4.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":Z,className:G1("px-2 pt-1.5 pb-0.5 text-xs text-muted-foreground data-inset:ps-7",$),...J})}function n8({className:$,inset:Z,variant:J="default",...H}){return v2.jsx(M4.Item,{"data-slot":"dropdown-menu-item","data-inset":Z,"data-variant":J,className:G1("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",$),...H})}function Yh({...$}){return v2.jsx(M4.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...$})}function Fh({className:$,children:Z,inset:J,...H}){return v2.jsxs(M4.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":J,className:G1("relative flex cursor-default items-center gap-2 rounded-md py-1 ps-2 pe-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",$),...H,children:[v2.jsx("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:v2.jsx(M4.RadioItemIndicator,{children:v2.jsx(L8,{stroke:1.75})})}),Z]})}function Wh({className:$,...Z}){return v2.jsx(M4.Separator,{"data-slot":"dropdown-menu-separator",className:G1("mx-2 my-1 h-px bg-border",$),...Z})}var x6={};I5(x6,{createHandle:()=>ch,Viewport:()=>ph,Trigger:()=>_h,Title:()=>hh,Root:()=>Mh,Positioner:()=>Ch,Portal:()=>Th,Popup:()=>Ih,Handle:()=>HY,Description:()=>gh,Close:()=>mh,Backdrop:()=>yh,Arrow:()=>bh});var cB=_(p(),1);var tU=_(p(),1),WD=tU.createContext(void 0);function l5($){let Z=tU.useContext(WD);if(Z===void 0&&!$)throw Error(h0(47));return Z}var eU=_(p(),1),qh=_(a4(),1);var Nh={...j9,disabled:($)=>$.disabled,instantType:($)=>$.instantType,openMethod:($)=>$.openMethod,openChangeReason:($)=>$.openChangeReason,modal:($)=>$.modal,focusManagerModal:($)=>$.focusManagerModal,stickIfOpen:($)=>$.stickIfOpen,titleElementId:($)=>$.titleElementId,descriptionElementId:($)=>$.descriptionElementId,openOnHover:($)=>$.openOnHover,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin};class qD extends S2{constructor($,Z,J){let H=new L2;super(Ah($,H,Z,J),Dh(H),Nh)}setOpen=($,Z)=>{let J=Z.reason===K0.triggerHover,H=Z.reason===K0.triggerPress&&Z.event.detail===0,B=!$&&(Z.reason===K0.escapeKey||Z.reason==null),Q=TH(Z),X=this.select("activeTriggerId");if(!$&&Z.reason===K0.closePress&&Z.trigger==null&&X!=null)Z.trigger=this.context.triggerElements.getById(X)??this.select("activeTriggerElement")??void 0;if(this.context.onOpenChange?.($,Z),Z.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange($,Z);let z=()=>{let K=S7(this.state,$,Z.trigger,Q());K.openChangeReason=Z.reason,this.update(K)};if(J)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(cX,()=>{this.set("stickIfOpen",!1)}),qh.flushSync(z);else z();let G;if(H)G="click";else if(B)G="dismiss";else if(Z.reason===K0.focusOut)G="focus";this.set("instantType",G)}}function Vh(){let $=new L2,Z=new u8(Object.freeze(Ah(void 0,$)),Object.freeze(Dh($)),Nh);return Object.assign(Z,{setOpen:F1})}function Ah($,Z,J,H=!1){let B={..._9(Z,J,H),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...$};if(B.open&&$?.mounted===void 0)B.mounted=!0;return B}function Dh($){return{popupRef:eU.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:eU.createRef(),beforeContentFocusGuardRef:eU.createRef(),stickIfOpenTimeout:new p5,triggerElements:$}}var k6=_(d(),1),Lh=R8(function({props:Z}){let{children:J,open:H,defaultOpen:B=!1,onOpenChange:Q,onOpenChangeComplete:X,modal:z=!1,handle:G,triggerId:K,defaultTriggerId:U=null}=Z,Y=h90(G,{modal:z,open:B,openProp:H,activeTriggerId:U,triggerIdProp:K});Y.useControlledProp("openProp",H),Y.useControlledProp("triggerIdProp",K);let F=Y.useState("open"),W=Y.useState("mounted"),q=Y.useState("payload");Y.useContextCallback("onOpenChange",Q),Y.useContextCallback("onOpenChangeComplete",X),Kz(Y,F),L9(Y);let{forceUnmount:N}=M9(F,Y,()=>{Y.update({stickIfOpen:!0,openChangeReason:null})});Y.useSyncedValues({modal:z}),cB.useEffect(()=>{if(!F)Y.context.stickIfOpenTimeout.clear()},[Y,F]),cB.useImperativeHandle(Z.actionsRef,()=>({unmount:N,close:()=>Y.setOpen(!1,I0(K0.imperativeAction))}),[N,Y]);let A=F||W;return k6.jsxs(WD.Provider,{value:Y,children:[G&&k6.jsx(A9,{handle:G,store:Y}),A&&k6.jsx(v90,{store:Y,modal:z}),typeof J==="function"?J({payload:q}):J]})});function Mh($){if(l5(!0))return k6.jsx(Lh,{props:$});return k6.jsx(C7,{children:k6.jsx(Lh,{props:$})})}function h90($,Z){let J=a3((H,B)=>new qD(Z,H,B));return cB.useEffect(()=>J.context.stickIfOpenTimeout.disposeEffect(),[J]),J}function v90({store:$,modal:Z}){let J=$.useState("floatingRootContext"),H=v8(J,{outsidePressEvent:{mouse:Z==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),B=H.reference,Q=H.floating;return P9($,{activeTriggerProps:B,inactiveTriggerProps:B,popupProps:Q}),null}var dB=_(p(),1);var Ph=300;var HJ=_(d(),1),_h=U9(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,handle:G,payload:K,openOnHover:U=!1,delay:Y=Ph,closeDelay:F=0,id:W,...q}=Z,N=l5(!0),V=O9(G)??N;if(!V)throw Error(h0(74));let D=s0(W),L=V.useState("isTriggerActive",D),j=V.useState("floatingRootContext"),M=V.useState("isOpenedByTrigger",D),P=V.useState("triggerPopupId",D),w=dB.useRef(null),{registerTrigger:C,isMountedByThisTrigger:R}=D9(D,w,V,{payload:K,disabled:X,openOnHover:U,closeDelay:F}),O=V.useState("openChangeReason"),S=V.useState("stickIfOpen"),y=V.useState("openMethod"),k=V.useState("focusManagerModal"),T=f8(j,{enabled:!X&&U&&(y!=="touch"||O!==K0.triggerPress),mouseOnly:!0,move:!1,handleClose:m8(),restMs:Y,delay:{close:F},triggerElementRef:w,isActiveTrigger:L,isClosing:()=>V.select("transitionStatus")==="ending"}),b=F3(j,{stickIfOpen:S}),I=mH(()=>V.select("open"),(c)=>{V.set("openMethod",c)}),v=V.useState("triggerProps",R),{getButtonProps:h,buttonRef:f}=O5({disabled:X,native:z}),E={open(c){if(c&&O===K0.triggerPress)return WH.open(c);return Y9.open(c)}},{preFocusGuardRef:i,handlePreFocusGuardFocus:r,handleFocusTargetFocus:x}=aU(V,w),o=z0("button",Z,{state:{disabled:X,open:M},ref:[f,J,C,w],props:[b.reference,T,v,I,{[t$]:"",id:D,"aria-haspopup":"dialog","aria-expanded":M,"aria-controls":P},q,h],stateAttributesMapping:E}),u=HJ.jsx(dB.Fragment,{children:o},D);if(R&&!k)return HJ.jsxs(dB.Fragment,{children:[HJ.jsx(R4,{ref:i,onFocus:r}),u,HJ.jsx(R4,{ref:V.context.triggerFocusTargetRef,onFocus:x})]});return u});var Oh=_(p(),1);var $Y=_(p(),1),ND=$Y.createContext(void 0);function jh(){let $=$Y.useContext(ND);if($===void 0)throw Error(h0(45));return $}var VD=_(d(),1),Th=Oh.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z;if(!(l5().useState("mounted")||H))return null;return VD.jsx(ND.Provider,{value:H,children:VD.jsx(j7,{ref:J,...B})})});var JY=_(p(),1);var ZY=_(p(),1),AD=ZY.createContext(void 0);function BJ(){let $=ZY.useContext(AD);if(!$)throw Error(h0(46));return $}var lB=_(d(),1),Ch=JY.forwardRef(function(Z,J){let{render:H,className:B,style:Q,anchor:X,positionMethod:z,side:G,align:K,sideOffset:U,alignOffset:Y,collisionBoundary:F="clipping-ancestors",collisionPadding:W,arrowPadding:q,sticky:N,disableAnchorTracking:A=!1,collisionAvoidance:V=N9,...D}=Z,L=l5(),j=jh(),M=Y3(),P=L.useState("floatingRootContext"),w=L.useState("mounted"),C=L.useState("open"),R=L.useState("openChangeReason"),O=L.useState("activeTriggerElement"),S=L.useState("modal"),y=L.useState("openMethod"),k=L.useState("positionerElement"),T=L.useState("instantType"),b=L.useState("transitionStatus"),I=L.useState("adaptiveOrigin"),v=JY.useRef(null),h=b4(k),f=C9({anchor:X,floatingRootContext:P,positionMethod:z,mounted:w,side:G,sideOffset:U,align:K,alignOffset:Y,arrowPadding:q,collisionBoundary:F,collisionPadding:W,sticky:N,disableAnchorTracking:A,keepMounted:j,nodeId:M,collisionAvoidance:V,adaptiveOrigin:I}),E=P.useState("domReferenceElement");H0(()=>{let o=E,u=v.current;if(o)v.current=o;if(u&&o&&o!==u){L.set("instantType",void 0);let c=new AbortController;return h(()=>{L.set("instantType","trigger-change")},c.signal),()=>{c.abort()}}return},[E,h,L]);let i=S===!0&&R!==K0.triggerHover;hU(C&&i,y==="touch",k,O);let r=L.useStateSetter("positionerElement"),x={open:C,side:f.side,align:f.align,anchorHidden:f.anchorHidden,instant:T},l=w9(Z,x,{styles:f.positionerStyles,transitionStatus:b,props:D,refs:[J,r],hidden:!w,inert:!C});return lB.jsxs(AD.Provider,{value:f,children:[w&&i&&lB.jsx(LZ,{inert:q8(!C),cutout:O}),lB.jsx(T7,{id:M,children:l})]})});var Sh=_(p(),1);var y6=_(p(),1);var DD=y6.createContext(void 0);function Eh(){let[$,Z]=y6.useState(0),J=U0(()=>{return Z((B)=>B+1),()=>{Z((B)=>Math.max(0,B-1))}});return{context:y6.useMemo(()=>({register:J}),[J]),hasClosePart:$>0}}function wh(){let $=y6.useContext(DD);H0(()=>{return $?.register()},[$])}var LD=_(d(),1),Ih=Sh.forwardRef(function(Z,J){let{render:H,className:B,style:Q,initialFocus:X,finalFocus:z,...G}=Z,K=l5(),U=BJ(),Y=kU(!0)!=null,{context:F,hasClosePart:W}=Eh(),q=K.useState("open"),N=K.useState("openMethod"),A=K.useState("instantType"),V=K.useState("transitionStatus"),D=K.useState("popupProps"),L=K.useState("titleElementId"),j=K.useState("descriptionElementId"),M=K.useState("modal"),P=K.useState("mounted"),w=K.useState("openChangeReason"),C=K.useState("activeTriggerElement"),R=K.useState("floatingRootContext"),O=R.useState("floatingId"),S=K.useState("disabled"),y=K.useState("openOnHover"),k=K.useState("closeDelay");T5({open:q,ref:K.context.popupRef,onComplete(){if(q)K.context.onOpenChangeComplete?.(!0)}}),W3(R,{enabled:y&&!S,closeDelay:k});let T=X===void 0?zz(K.context.popupRef):X,b=M!==!1&&W;K.useSyncedValue("focusManagerModal",b);let I=K.useStateSetter("popupElement"),v={open:q,side:U.side,align:U.align,instant:A,transitionStatus:V},h=z0("div",Z,{state:v,ref:[J,K.context.popupRef,I],props:[D,{id:O,role:"dialog",...V9,"aria-labelledby":L,"aria-describedby":j,onKeyDown(f){if(Y&&c8.has(f.key))f.stopPropagation()}},E9(V),G],stateAttributesMapping:d2});return LD.jsx(E7,{context:R,openInteractionType:N,modal:b,disabled:!P||w===K0.triggerHover,initialFocus:T,returnFocus:z,restoreFocus:"popup",previousFocusableElement:P1(C)?C:void 0,nextFocusableElement:K.context.triggerFocusTargetRef,beforeContentFocusGuardRef:K.context.beforeContentFocusGuardRef,children:LD.jsx(DD.Provider,{value:F,children:h})})});var Rh=_(p(),1);var bh=Rh.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,G=l5().useState("open"),{arrowRef:K,side:U,align:Y,arrowUncentered:F,arrowStyles:W}=BJ();return z0("div",Z,{state:{open:G,side:U,align:Y,uncentered:F},ref:[J,K],props:[{style:W,"aria-hidden":!0},X],stateAttributesMapping:i4})});var kh=_(p(),1);var yh=kh.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=l5(),G=z.useState("open"),K=z.useState("mounted"),U=z.useState("transitionStatus"),Y=z.useState("openChangeReason");return z0("div",Z,{state:{open:G,transitionStatus:U},ref:J,props:[{role:"presentation",hidden:!K,style:{pointerEvents:Y===K0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},X],stateAttributesMapping:d2})});var xh=_(p(),1);var hh=xh.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=l5(),G=s0(X.id);return z.useSyncedValueWithCleanup("titleElementId",G),z0("h2",Z,{ref:J,props:[{id:G},X]})});var vh=_(p(),1);var gh=vh.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=l5(),G=s0(X.id);return z.useSyncedValueWithCleanup("descriptionElementId",G),z0("p",Z,{ref:J,props:[{id:G},X]})});var fh=_(p(),1);var mh=fh.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,...G}=Z,{buttonRef:K,getButtonProps:U}=O5({disabled:X,focusableWhenDisabled:!1,native:z}),Y=l5();return wh(),z0("button",Z,{ref:[J,K],props:[{onClick(W){Y.setOpen(!1,I0(K0.closePress,W.nativeEvent))}},G,U]})});var uh=_(p(),1);var ph=uh.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=l5(),{side:K}=BJ(),U=G.useState("instantType"),{children:Y,state:F}=s3({store:G,side:K,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:U};return z0("div",Z,{state:W,ref:J,props:[z,{children:Y}],stateAttributesMapping:n3})});class HY extends g8{constructor(){super(Vh(),"Popover")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function ch(){return new HY}var z$=_(d(),1);function QJ({...$}){return z$.jsx(x6.Root,{"data-slot":"popover",...$})}function XJ({...$}){return z$.jsx(x6.Trigger,{"data-slot":"popover-trigger",...$})}function zJ({className:$,align:Z="center",alignOffset:J=0,side:H="bottom",sideOffset:B=4,keepMounted:Q,...X}){return z$.jsx(D8,{portal:x6.Portal,keepMounted:Q,children:z$.jsx(x6.Positioner,{align:Z,alignOffset:J,side:H,sideOffset:B,className:"isolate z-50",children:z$.jsx(x6.Popup,{"data-slot":"popover-content",className:G1("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-3 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...X})})})}function dh({className:$,...Z}){return z$.jsx("div",{"data-slot":"popover-header",className:G1("flex flex-col gap-0.5 text-sm",$),...Z})}var qY=_(p(),1);var h6={};I5(h6,{Value:()=>sh,Track:()=>Zv,Thumb:()=>zv,Root:()=>rh,Label:()=>oh,Indicator:()=>Kv,Control:()=>eh});var t5=_(p(),1);function MD($,Z,J=Object.is){let{length:H}=$;if(H!==Z.length)return!1;for(let B=0;B<H;B+=1)if(!J($[B],Z[B]))return!1;return!0}function lh($){return $==null?void 0:`${$}-label`}function ih($,Z){return $??Z}function BY($,Z){return $-Z}function QY($,Z,J,H,B,Q){let X=D2($,J,H);if(!B)return X;let z=Q.slice();return z[Z]=D2(X,Q[Z-1]??-1/0,Q[Z+1]??1/0),z.sort(BY)}function XY($,Z,J){if(!Array.isArray($))return!0;let H=Z*J;for(let B=0;B<$.length-1;B+=1)if(!(Math.abs($[B]-$[B+1])>=H))return!1;return!0}var GJ=()=>null,g4={activeThumbIndex:GJ,max:GJ,min:GJ,minStepsBetweenValues:GJ,step:GJ,values:GJ,..._2};var zY=_(p(),1),PD=zY.createContext(void 0);function T8(){let $=zY.useContext(PD);if($===void 0)throw Error(h0(62));return $}var _D=_(d(),1);function g90($,Z){return $===Z||Array.isArray($)&&Array.isArray(Z)&&MD($,Z)}var rh=t5.forwardRef(function(Z,J){let{"aria-labelledby":H,className:B,defaultValue:Q,disabled:X=!1,id:z,format:G,largeStep:K=10,locale:U,render:Y,max:F=100,min:W=0,minStepsBetweenValues:q=0,form:N,name:A,onValueChange:V,onValueCommitted:D,orientation:L="horizontal",step:j=1,thumbCollisionBehavior:M="push",thumbAlignment:P="center",value:w,style:C,...R}=Z,O=s0(z),S=lh(O),y=U0(V),k=U0(D),{clearErrors:T}=t2(),{state:b,disabled:I,name:v,setTouched:h,setDirty:f,validityData:E,validation:i}=c5(),{labelId:r}=d5(),[x,l]=t5.useState(),o=H??ih(r,x),u=I||X,c=v??A,[n,Z0]=e2({controlled:w,default:Q??W,name:"Slider"}),J0=t5.useRef(null),X0=t5.useRef(null),Q0=t5.useRef([]),F0=t5.useRef(null),A0=t5.useRef(-1),N0=t5.useRef(null),Y0=t5.useRef(K0.none),[s,a]=t5.useState(-1),[e,$0]=t5.useState(-1),[B0,_0]=t5.useState(!1),[M0,V0]=t5.useState(()=>new Map),[L0,g]=t5.useState([void 0,void 0]),m=U0((d0)=>{if(a(d0),d0!==-1)$0(d0)}),t=U0((d0)=>{if(d0)X0.current=d0}),W0=Array.isArray(n),R0=t5.useMemo(()=>{if(!W0)return[D2(n,W,F)];return n.map((d0)=>D2(d0,W,F)).sort(BY)},[F,W,W0,n]),c0=W0?R0:R0[0];H6(i.inputRef,O,c0,void 0,!u,A),S9(c0,()=>{T(c),i.change(c0);let d0=E.initialValue,v0;if(Array.isArray(c0)&&Array.isArray(d0))v0=!MD(c0,d0);else v0=c0!==d0;f(v0)});let f0=U0((d0,v0)=>{if(Number.isNaN(d0)||g90(d0,n))return!1;let w1=v0.event,s1=new w1.constructor(w1.type,w1);if(Object.defineProperty(s1,"target",{writable:!0,value:{value:d0,name:c}}),v0.event=s1,y(d0,v0),v0.isCanceled)return!1;return Y0.current=v0.reason,Z0(d0),!0}),T0=U0((d0,v0,w1)=>{let B1=QY(d0,v0,W,F,W0,R0);if(XY(B1,j,q)){let s1="key"in w1?K0.keyboard:K0.inputChange,C0=f0(B1,I0(s1,w1.nativeEvent,void 0,{activeThumbIndex:v0}));if(h(!0),C0)k(B1,$z(s1,w1.nativeEvent))}});H0(()=>{if(!u)return;let d0=p1(m0(J0.current));if(b0(J0.current,d0))d0.blur();if(s!==-1)m(-1)},[s,u,m]);let x0=t5.useMemo(()=>({...b,activeThumbIndex:s,disabled:u,dragging:B0,orientation:L,max:F,min:W,minStepsBetweenValues:q,step:j,values:R0}),[b,s,u,B0,F,W,q,L,j,R0]),Z1=t5.useMemo(()=>({active:s,controlRef:X0,disabled:u,dragging:B0,validation:i,format:G,handleInputChange:T0,indicatorPosition:L0,inset:P!=="center",labelId:o,rootLabelId:S,largeStep:K,lastUsedThumbIndex:e,lastChangeReasonRef:Y0,form:N,locale:U,max:F,min:W,minStepsBetweenValues:q,name:c,onValueCommitted:k,orientation:L,pressedThumbCenterOffsetRef:F0,pressedThumbIndexRef:A0,pressedValuesRef:N0,registerFieldControlRef:t,renderBeforeHydration:P==="edge",setActive:m,setDragging:_0,setIndicatorPosition:g,setLabelId:l,setValue:f0,state:x0,step:j,thumbCollisionBehavior:M,thumbMap:M0,thumbRefs:Q0,values:R0}),[s,o,S,u,B0,i,G,T0,L0,K,e,N,U,F,W,q,c,k,L,t,m,f0,x0,j,M,P,M0,R0]),W1=z0("div",Z,{state:x0,ref:[J,J0],props:[{"aria-labelledby":o,id:O,role:"group"},R,(d0)=>i.getValidationProps(u,d0)],stateAttributesMapping:g4});return _D.jsx(PD.Provider,{value:Z1,children:_D.jsx(S6,{elementsRef:Q0,onMapChange:V0,children:W1})})});var ah=_(p(),1);var oh=ah.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=X;delete z.id;let{state:G,setLabelId:K,controlRef:U,rootLabelId:Y}=T8();function F(q,N){if(N){let D=m0(q.currentTarget).getElementById(N);if(P1(D)){MG(D);return}}let A=U.current?.querySelectorAll('input[type="range"]'),V=A?.length===1?A[0]:null;if(P1(V))MG(V)}let W=LG({id:Y,setLabelId:K,focusControl:F});return z0("div",Z,{ref:J,state:G,props:[W,X],stateAttributesMapping:g4})});var GY=_(p(),1);function jD($){if(Array.isArray($))return $.map((Z)=>jD(Z)).join(",");if($==null)return"";return String($)}var nh=new Map;function f90($,Z){let J=JSON.stringify({locale:jD($),options:Z}),H=nh.get(J);if(H)return H;let B=new Intl.NumberFormat($,Z);return nh.set(J,B),B}function KJ($,Z,J){if($==null)return"";return f90(Z,J).format($)}var sh=GY.forwardRef(function(Z,J){let{"aria-live":H="off",render:B,className:Q,children:X,style:z,...G}=Z,{thumbMap:K,state:U,values:Y,format:F,locale:W}=T8(),q=Array.from(K.values(),({inputId:D})=>D).join(" ").trim()||void 0,N=GY.useMemo(()=>Y.map((D)=>KJ(D,W,F)),[F,W,Y]),A=N.join(" – ");return z0("output",Z,{state:U,ref:J,props:[{"aria-live":H,children:typeof X==="function"?X(N,Y):A,htmlFor:q},G],stateAttributesMapping:g4})});var C8=_(p(),1);function KY($,Z){let J=$.getBoundingClientRect();return Z?(J.top+J.bottom)/2:(J.left+J.right)/2}function UJ($){if($===0)return 0;if(Math.abs($)<1){let J=$.toExponential().split("e-"),H=J[0].split(".")[1];return(H?H.length:0)+parseInt(J[1],10)}let Z=$.toString().split(".")[1];return Z?Z.length:0}function UY($,Z,J){let H=Math.round(($-J)/Z)*Z+J;return Number(H.toFixed(Math.max(UJ(Z),UJ(J))))}function OD($,Z,J,H,B,Q,X,z){let G=$.slice(),K=Q*X,U=G.length-1,Y=z??$,F=H+Z*K,W=B-(U-Z)*K;G[Z]=D2(J,F,W);for(let q=Z+1;q<=U;q+=1){let N=G[q-1]+K,A=B-(U-q)*K,V=Y[q],D=Math.max(G[q],N);if(V<D)D=Math.max(V,N);G[q]=D2(D,N,A)}for(let q=Z-1;q>=0;q-=1){let N=G[q+1]-K,A=H+q*K,V=Y[q],D=Math.min(G[q],N);if(V>D)D=Math.min(V,N);G[q]=D2(D,A,N)}for(let q=0;q<=U;q+=1)G[q]=Number(G[q].toFixed(12));return G}function th($,Z,J,H,B,Q,X,z,G,K){let U=J??Z,Y=H??Z;if(!(U.length>1))return{value:Q,thumbIndex:0,didSwap:!1};let W=G*K;if($==="push")return{value:OD(U,B,Q,X,z,G,K),thumbIndex:B,didSwap:!1};let q=U.slice(),N=q[B-1],A=q[B+1],V=N!=null?N+W:X,D=A!=null?A-W:z,L=Number(D2(Q,V,D).toFixed(12));switch(q[B]=L,$){case"swap":{let j=U[B],M=0.0000001,P=Q>j,w=Q<j,C=P&&A!=null&&Q>=A-0.0000001,R=w&&N!=null&&Q<=N+0.0000001;if(!C&&!R)return{value:q,thumbIndex:B,didSwap:!1};let O=C?B+1:B-1,S=q.map((E,i)=>{if(i===B)return L;let r=Y[i];if(r!=null)return r;return U[i]}),y=Q;if(C)y=Math.max(Q,q[O]);else y=Math.min(Q,q[O]);let k=OD(q,O,y,X,z,G,K,S),T=C?O-1:O+1,b=k[T-1],I=k[T+1],v=b!=null?b+W:X;v=Math.max(v,X+T*W);let h=I!=null?I-W:z;h=Math.min(h,z-(k.length-1-T)*W);let f=D2(L,v,h);return k[T]=Number(f.toFixed(12)),{value:k,thumbIndex:O,didSwap:!0}}case"none":default:return{value:q,thumbIndex:B,didSwap:!1}}}var m90=2;function u90($,Z){if(!$)return{start:0,end:0};function J(Q){let X=Q!=null?parseFloat(Q):0;return Number.isNaN(X)?0:X}let H=!Z?"InlineStart":"Top",B=!Z?"InlineEnd":"Bottom";return{start:J($[`border${H}Width`])+J($[`padding${H}`]),end:J($[`border${B}Width`])+J($[`padding${B}`])}}function p90($,Z){if(Z.current!=null&&$.changedTouches){let J=$;for(let H=0;H<J.changedTouches.length;H+=1){let B=J.changedTouches[H];if(B.identifier===Z.current)return{x:B.clientX,y:B.clientY}}return null}return{x:$.clientX,y:$.clientY}}var eh=C8.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{disabled:z,dragging:G,inset:K,lastChangeReasonRef:U,max:Y,min:F,minStepsBetweenValues:W,onValueCommitted:q,orientation:N,pressedThumbCenterOffsetRef:A,pressedThumbIndexRef:V,pressedValuesRef:D,registerFieldControlRef:L,renderBeforeHydration:j,setActive:M,setDragging:P,setValue:w,state:C,step:R,thumbCollisionBehavior:O,thumbRefs:S,values:y}=T8(),k=y4(),T=y.length>1,b=N==="vertical",I=C8.useRef(null),v=C8.useRef(null),h=U0((a)=>{if(a&&v.current==null)v.current=I1(a).getComputedStyle(a)}),f=C8.useRef(null),E=C8.useRef(0),i=C8.useRef(0),r=C8.useRef(null),x=G5(y);function l(a){return a?.querySelector('input[type="range"]')}function o(a){if(V.current=a,!S.current[a])A.current=null}function u(){V.current=-1,A.current=null}function c(a){if(!n0(a))return!1;return S.current.some((e)=>{if(!n0(e)||!b0(e,a))return!1;return l(e)?.disabled===!0})}function n(a){let e=I.current,$0=V.current;if(!e||$0<0||$0>=y.length){if($0>=y.length)r.current=null;return null}let{width:B0,height:_0,bottom:M0,left:V0,right:L0}=e.getBoundingClientRect(),g=u90(v.current,b),m=i.current,t=(b?_0:B0)-g.start-g.end-m*2,W0=A.current??0,R0=a.x-W0,c0=a.y-W0,f0=b?M0-c0-g.end:(k==="rtl"?L0-R0:R0-V0)-g.start,T0=D2((f0-m)/t,0,1),x0=(Y-F)*T0+F;if(x0=UY(x0,R,F),x0=D2(x0,F,Y),!T)return{value:x0,thumbIndex:$0,didSwap:!1};return th(O,y,x.current,D.current,$0,x0,F,Y,R,W)}function Z0(a){D.current=T?y.slice():null,r.current=null,x.current=y;let e=V.current,$0=e;if(e>-1&&e<y.length){if(y[e]===Y){let B0=e;while(B0>0&&y[B0-1]===Y)B0-=1;$0=B0}}else{let B0=!b?"x":"y",_0;$0=-1;for(let M0=0;M0<S.current.length;M0+=1){let V0=S.current[M0];if(n0(V0)&&!l(V0)?.disabled){let L0=KY(V0,b),g=Math.abs(a[B0]-L0);if(_0===void 0||g<=_0)$0=M0,_0=g}}}if($0>-1&&$0!==e)o($0);if(K){let B0=S.current[$0];if(n0(B0)){let _0=B0.getBoundingClientRect(),M0=!b?"width":"height";i.current=_0[M0]/2}}}function J0(a){let e=l(S.current?.[a]);if(!e)return;e.focus({preventScroll:!0,focusVisible:!1})}function X0(a,e,$0){let B0=w(a.value,I0(e,$0,void 0,{activeThumbIndex:a.thumbIndex}));if(B0){if(r.current=a.value,x.current=Array.isArray(a.value)?a.value:[a.value],a.didSwap)o(a.thumbIndex),J0(a.thumbIndex)}return B0}let Q0=U0((a)=>{let e=p90(a,f);if(e==null)return;if(E.current+=1,a.type==="pointermove"&&a.buttons===0){F0(a);return}let $0=n(e);if($0==null)return;if(XY($0.value,R,W)){if(!G&&E.current>m90)P(!0);X0($0,K0.drag,a)}}),F0=U0((a)=>{M(-1),P(!1),A.current=null;let e=r.current;if(Array.isArray(e)&&e.length!==y.length)r.current=null;if(r.current!=null){let $0=U.current;q(r.current,$z($0,a))}if("pointerType"in a&&I.current?.hasPointerCapture(a.pointerId))I.current?.releasePointerCapture(a.pointerId);V.current=-1,f.current=null,N0()}),A0=U0((a)=>{if(z)return;if(c(M1(a))){u();return}let e=a.changedTouches[0];if(e==null)return;f.current=e.identifier;let $0={x:e.clientX,y:e.clientY};Z0($0);let B0=n($0);if(B0==null)return;J0(B0.thumbIndex),X0(B0,K0.trackPress,a),E.current=0;let _0=m0(I.current);_0.addEventListener("touchmove",Q0,{passive:!0}),_0.addEventListener("touchend",F0,{passive:!0})}),N0=U0(()=>{let a=m0(I.current);a.removeEventListener("pointermove",Q0),a.removeEventListener("pointerup",F0),a.removeEventListener("touchmove",Q0),a.removeEventListener("touchend",F0),D.current=null,r.current=null}),Y0=F4();return C8.useEffect(()=>{let a=I.current;if(!a)return()=>N0();let e=o0(a,"touchstart",A0,{passive:!0});return()=>{e(),Y0.cancel(),N0()}},[N0,A0,I,Y0]),C8.useEffect(()=>{if(z)N0()},[z,N0]),z0("div",Z,{state:C,ref:[J,L,I,h],props:[{["data-base-ui-slider-control"]:j?"":void 0,onPointerDown(a){let e=I.current,$0=M1(a.nativeEvent);if(!e||z||a.defaultPrevented||!n0($0)||a.button!==0)return;if(c($0)){u();return}let B0={x:a.clientX,y:a.clientY};Z0(B0);let _0=n(B0);if(_0==null)return;if(b0(S.current[_0.thumbIndex],p1(m0(e))))a.preventDefault();else Y0.request(()=>{J0(_0.thumbIndex)});if(P(!0),A.current==null)X0(_0,K0.trackPress,a.nativeEvent);if(a.nativeEvent.pointerId)e.setPointerCapture(a.nativeEvent.pointerId);E.current=0;let L0=m0(e);L0.addEventListener("pointermove",Q0,{passive:!0}),L0.addEventListener("pointerup",F0,{once:!0})}},X],stateAttributesMapping:g4})});var $v=_(p(),1);var Zv=$v.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{state:z}=T8();return z0("div",Z,{state:z,ref:J,props:[{style:{position:"relative"}},X],stateAttributesMapping:g4})});var E8=_(p(),1);var YY="";var Jv=_(i$(),1);function c90(){return F1}function d90(){return!1}function l90(){return!0}function YJ(){return Jv.useSyncExternalStore(c90,d90,l90)}function iB($,Z,J){return($-Z)*100/(J-Z)}var r21=_(p(),1);var FY=_(p(),1),i90=FY.createContext(void 0),r90={disableStyleElements:!1};function Hv(){return FY.useContext(i90)??r90}var Bv=_(d(),1);function WY($){let{script:Z}=$,{nonce:J}=Hv();if(!YJ())return null;return Bv.jsx("script",{nonce:J,dangerouslySetInnerHTML:{__html:Z},suppressHydrationWarning:!0})}var Qv="data-index";var rB=_(d(),1),Xv,o90=new Set([...c8,tN,eN]);function n90($,Z,J,H){if(Z<0)return;if($.length===2)return`${KJ($[Z],H,J)} ${Z===0?"start":"end"} range`;return J?KJ($[Z],H,J):void 0}function s90($,Z,J,H,B){let Q=$+Z*J,X=Number(Q.toFixed(Math.max(UJ($),UJ(Z),UJ(H))));return D2(X,H,B)}var zv=E8.forwardRef(function(Z,J){let{render:H,children:B,className:Q,"aria-describedby":X,"aria-label":z,"aria-labelledby":G,"aria-valuetext":K,disabled:U=!1,getAriaLabel:Y,getAriaValueText:F,id:W,index:q,inputRef:N,onBlur:A,onFocus:V,onKeyDown:D,tabIndex:L,style:j,...M}=Z,P=s0(W),{active:w,lastUsedThumbIndex:C,controlRef:R,disabled:O,validation:S,format:y,handleInputChange:k,inset:T,labelId:b,largeStep:I,locale:v,max:h,min:f,minStepsBetweenValues:E,form:i,name:r,orientation:x,pressedThumbCenterOffsetRef:l,pressedThumbIndexRef:o,renderBeforeHydration:u,setActive:c,setIndicatorPosition:n,state:Z0,step:J0,thumbRefs:X0,values:Q0}=T8(),F0=y4(),A0=U||O,N0=Q0.length>1,Y0=x==="vertical",s=F0==="rtl",{setTouched:a,setFocused:e,validationMode:$0}=c5(),B0=E8.useRef(null),_0=E8.useRef(null),M0=E8.useRef(!1),V0=U0((P0)=>{if(M0.current)return;V?.(P0)}),L0=U0((P0)=>{if(M0.current)return;A?.(P0)}),g=s0(),m=B6(),t=N0?g:m,W0=E8.useMemo(()=>({inputId:t}),[t]),{ref:R0,index:c0}=H4({metadata:W0}),f0=!N0?0:q??c0,T0=f0===Q0.length-1,x0=Q0[f0],Z1=iB(x0,f,h),[W1,d0]=E8.useState(),v0=YJ(),w1=C>=0&&C<Q0.length?C:-1,B1=U0(()=>{let P0=R.current,l0=B0.current;if(!P0||!l0)return;let Q1=l0.getBoundingClientRect(),j1=P0.getBoundingClientRect(),k0=Y0?"height":"width",r0=j1[k0]-Q1[k0],X1=(Q1[k0]/2+r0*Z1/100)/j1[k0]*100,S1=Number.isFinite(X1)?X1:void 0;if(d0(S1),f0===0)n((b1)=>[S1,b1[1]]);else if(T0)n((b1)=>[b1[0],S1])});H0(()=>{if(T)queueMicrotask(B1)},[B1,T]),H0(()=>{if(T)B1()},[B1,T,Z1]),H0(()=>{if(!T)return;let P0=R.current,l0=B0.current;if(!P0||!l0)return;let Q1=I1(P0).ResizeObserver;if(typeof Q1!=="function")return;let j1=new Q1(B1);return j1.observe(P0),j1.observe(l0),()=>{j1.disconnect()}},[R,B1,T]);let s1=Y0?"bottom":"insetInlineStart",C0=Y0?"left":"top",p0;if(N0){if(w===f0)p0=2;else if(w1===f0)p0=1}else if(w===f0)p0=1;let i0;if(!T&&!Number.isFinite(Z1))i0=y8;else i0={position:"absolute",[s1]:T?"var(--position)":`${Z1}%`,[C0]:"50%",translate:`${(Y0||!s?-1:1)*50}% ${(Y0?1:-1)*50}%`,zIndex:p0,...T&&{["--position"]:`${W1??0}%`,visibility:u&&v0||W1===void 0?"hidden":void 0}};let a0;if(Y0)a0=s?"vertical-rl":"vertical-lr";let A1=typeof Y==="function"?Y(f0):z,D1=M2({"aria-label":A1,"aria-labelledby":G??(A1==null?b:void 0),"aria-describedby":X,"aria-orientation":x,"aria-valuenow":x0,"aria-valuetext":typeof F==="function"?F(KJ(x0,v,y),x0,f0):K??n90(Q0,f0,y,v),disabled:A0,form:i,id:t,max:h,min:f,name:r,onChange(P0){k(P0.currentTarget.valueAsNumber,f0,P0)},onFocus(P0){let l0=M0.current;if(M0.current=!1,c(f0),e(!0),l0)P0.stopPropagation()},onBlur(P0){if(M0.current){P0.stopPropagation();return}if(c(-1),X0.current.some((l0)=>b0(l0,P0.relatedTarget)))return;if(a(!0),e(!1),$0==="onBlur")S.commit(QY(x0,f0,f,h,N0,Q0))},onKeyDown(P0){if(P0.defaultPrevented)return;if(!o90.has(P0.key))return;if(c8.has(P0.key))P0.stopPropagation();let l0=null,Q1=0,j1=P0.shiftKey?I:J0,k0=UY(x0,J0,f);switch(P0.key){case WZ:Q1=1;break;case VZ:Q1=s?-1:1;break;case qZ:Q1=-1;break;case NZ:Q1=s?1:-1;break;case tN:j1=I,Q1=1;break;case eN:j1=I,Q1=-1;break;case DZ:l0=N0&&Number.isFinite(Q0[f0+1])?Q0[f0+1]-J0*E:h;break;case AZ:l0=N0&&Number.isFinite(Q0[f0-1])?Q0[f0-1]+J0*E:f;break;default:break}if(Q1!==0)l0=s90(k0,j1,Q1,f,h);if(l0!==null){let r0=P0.currentTarget;if(!F9(r0))M0.current=!0,r0.blur(),r0.focus({preventScroll:!0,focusVisible:!0});k(l0,f0,P0),P0.preventDefault()}},step:J0,style:{...y8,width:"100%",height:"100%",writingMode:a0},tabIndex:L,type:"range",value:x0??""},(P0)=>S.getValidationProps(A0,P0),{onFocus:V0,onBlur:L0,onKeyDown:D}),u1=b2(_0,S.inputRef,N);return z0("div",Z,{state:Z0,ref:[J,R0,B0],props:[{[Qv]:f0,children:rB.jsxs(E8.Fragment,{children:[B,rB.jsx("input",{ref:u1,...D1,suppressHydrationWarning:!0}),T&&T0&&u&&(Xv||(Xv=rB.jsx(WY,{script:YY})))]}),id:P,onPointerDown(P0){if(A0)return;o.current=f0;let l0=KY(P0.currentTarget,Y0);l.current=(Y0?P0.clientY:P0.clientX)-l0},style:i0,suppressHydrationWarning:u||void 0},M],stateAttributesMapping:g4})});var Gv=_(p(),1);function t90($,Z,J,H,B,Q){let X={visibility:Q||J&&(H===void 0||Z&&B===void 0)?"hidden":void 0,position:$?"absolute":"relative",[$?"width":"height"]:"inherit"},z=`${H??0}%`,G=`${(B??0)-(H??0)}%`;if(J){if(X["--start-position"]=z,z="var(--start-position)",Z)X["--relative-size"]=G,G="var(--relative-size)"}return X[$?"bottom":"insetInlineStart"]=Z?z:0,X[$?"height":"width"]=Z?G:z,X}var Kv=Gv.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{indicatorPosition:z,inset:G,max:K,min:U,orientation:Y,renderBeforeHydration:F,state:W,values:q}=T8(),N=YJ(),A=Y==="vertical",V=q.length>1,D=t90(A,V,G,G?z[0]:iB(q[0],U,K),G?z[1]:iB(q[q.length-1],U,K),G&&F&&N);return z0("div",Z,{state:W,ref:J,props:[{["data-base-ui-slider-indicator"]:F?"":void 0,style:D,suppressHydrationWarning:F||void 0},X],stateAttributesMapping:g4})});var G$=_(d(),1);function Uv({animate:$=!1,children:Z,className:J,defaultValue:H,value:B,min:Q=0,max:X=100,...z}){let[G,K]=qY.useState(!1),U=Array.isArray(B)?B:Array.isArray(H)?H:[Q];return qY.useEffect(()=>{let Y=requestAnimationFrame(()=>K(!0));return()=>cancelAnimationFrame(Y)},[]),G$.jsx(h6.Root,{className:G1("data-horizontal:w-full data-vertical:h-full",J),"data-slot":"slider",defaultValue:H,value:B,min:Q,max:X,thumbAlignment:"edge",...z,children:G$.jsxs(h6.Control,{className:"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",children:[G$.jsx(h6.Track,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-accent select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",children:G$.jsx(h6.Indicator,{"data-slot":"slider-range",className:G1("bg-primary select-none data-horizontal:h-full data-vertical:w-full",$&&G&&"transition-[width,height,inset-inline-start,bottom] duration-100 ease-in-out")})}),Z,Array.from({length:U.length},(Y,F)=>G$.jsx(h6.Thumb,{"data-slot":"slider-thumb",className:G1("relative block size-3 shrink-0 rounded-xs bg-white shadow-xs ring-ring/50 select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50 data-horizontal:cursor-ew-resize data-vertical:cursor-ns-resize",$&&G&&"transition-[inset-inline-start,bottom,color,box-shadow] duration-100 ease-in-out")},F))]})})}var _1=_(d(),1);function e90($){return $.charAt(0).toUpperCase()+$.slice(1)}function $30($){return $==="xhigh"?"Extra":e90($)}function Yv($){return typeof $==="number"?$:$[0]??0}var Fv={from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},Wv={type:"spring",duration:0.3,delay:0.1,bounce:0};function Nv({label:$,leadingIcon:Z,className:J,...H}){return _1.jsxs(j0,{...H,variant:"ghost",className:G0("group/picker max-w-56 min-w-0 px-2 text-muted-foreground hover:text-muted-foreground",J),children:[Z,_1.jsx("span",{className:"truncate font-normal",children:$})]})}function Z30({current:$,model:Z,models:J,onValueChange:H}){let B=Z.displayName,Q=Ux(J,"Models");return _1.jsxs(c9,{children:[_1.jsx(d9,{render:_1.jsx(Nv,{label:B,className:"shrink","aria-label":`Model: ${B}`})}),_1.jsx(l9,{align:"end",side:"top",className:"w-max max-w-64 min-w-40",children:_1.jsx(Yh,{value:$,onValueChange:H,children:Q.map((X)=>_1.jsxs(b6,{children:[_1.jsx(sU,{children:X.label}),X.models.map((z)=>_1.jsx(Fh,{value:z.value,closeOnClick:!0,children:z.displayName},z.value))]},X.label))})})]})}function Vv({fastMode:$,onChange:Z}){return _1.jsxs(B5,{children:[_1.jsx(Q5,{render:_1.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":$?"Turn off fast mode":"Turn on fast mode","aria-pressed":$,onClick:()=>Z(!$),className:"-my-1 -mr-1",children:$?_1.jsx(qv,{className:"text-primary",stroke:1.75}):_1.jsx(iH,{className:"text-muted-foreground",stroke:1.75})})}),_1.jsxs(X5,{align:"center",className:"flex-col gap-0",children:[_1.jsx("span",{children:"Fast mode"}),_1.jsx("span",{className:"font-normal text-muted-foreground",children:"More usage"})]})]})}function J30({currentEffort:$,effortLevels:Z,fastMode:J,showFastMode:H,onFastModeChange:B,onValueChange:Q}){let X=Xx(Z,$),[z,G]=FJ.useState(!1),[K,U]=FJ.useState(X),[Y,F]=FJ.useState(!1),q=Z[z?K:X]??$,N=$30(q),A=(D)=>{if(D)U(X);else F(!1);G(D)},V=(D)=>{let L=Z[D];if(L&&L!==$)Q(L)};return _1.jsxs(QJ,{open:z,onOpenChange:A,children:[_1.jsx(XJ,{render:_1.jsx(Nv,{label:N,leadingIcon:J?_1.jsx(iH,{stroke:1.5}):void 0,"aria-label":`Effort: ${N}`})}),_1.jsxs(zJ,{align:"end",side:"top",className:"w-64",children:[_1.jsx(dh,{className:"relative h-5 flex-row items-center",children:_1.jsx(L4,{mode:"popLayout",initial:!1,children:Y?_1.jsxs(V5.div,{className:"flex h-5 w-full items-center justify-between text-sm text-muted-foreground","aria-hidden":"true",variants:Fv,initial:"from",animate:"to",exit:"from",transition:Wv,children:[_1.jsx("span",{children:"Faster"}),_1.jsx("span",{children:"Smarter"})]},"range"):_1.jsxs(V5.div,{className:"flex h-5 w-full items-center justify-between gap-2",variants:Fv,initial:"from",animate:"to",exit:"from",transition:Wv,children:[_1.jsxs("div",{className:"flex items-center gap-1",children:[_1.jsx("span",{className:"text-muted-foreground",children:"Effort"}),_1.jsx("output",{"aria-live":"polite",children:N})]}),H&&_1.jsx(Vv,{fastMode:J,onChange:B})]},"effort")})}),_1.jsxs("label",{className:"block",children:[_1.jsx("span",{className:"sr-only",children:"Reasoning effort"}),_1.jsx(Uv,{value:[K],min:0,max:Z.length-1,step:1,onPointerDown:(D)=>{if(D.button===0)F(!0)},onPointerCancel:()=>F(!1),onValueChange:(D)=>U(Yv(D)),onValueCommitted:(D)=>{F(!1),V(Yv(D))},className:G0("**:data-[slot=slider-track]:h-6 **:data-[slot=slider-track]:rounded-sm","**:data-[slot=slider-thumb]:h-6 **:data-[slot=slider-thumb]:w-5 **:data-[slot=slider-thumb]:rounded-sm **:data-[slot=slider-thumb]:ring-0"),animate:!0,children:_1.jsx("span",{"data-slot":"slider-marks","aria-hidden":"true",className:"absolute inset-x-2 flex items-center justify-between",children:Array.from({length:Z.length},(D,L)=>_1.jsx("span",{className:G0("size-1 rounded-full",L<=K?"bg-primary-foreground/30":"bg-foreground/30")},L))})})]})]})]})}var Av=FJ.memo(function({sessionId:Z}){let{workspaceId:J,layout:H,setLayout:B}=l1(),{data:Q}=m9(J),X=Q?.models??[],z=X.find((P)=>P.value==="default"),G=Q?Kx(X.filter((P)=>P.value!=="default"),Q.provider):[],K=LU(J,Z).data,U=Bx(J),Y=(Z?K?.model:void 0)??H.selectedModel,F=(Z?K?.effort:void 0)??H.selectedEffort,W=(Z?K?.fastMode:void 0)??H.selectedFastMode,q=(P)=>{if(Z)U.mutate({sessionId:Z,patch:{model:P}});else B({selectedModel:P})},N=(P)=>{if(Z)U.mutate({sessionId:Z,patch:{effort:P}});else B({selectedEffort:P})},A=(P)=>{if(Z)U.mutate({sessionId:Z,patch:{fastMode:P}});else B({selectedFastMode:P})},V=MU(G,Y,z?.resolvedModel);if(!V)return null;let D=V.supportsEffort?V.supportedEffortLevels??[]:[],L=tA(D,F,V.defaultEffort),j=zx(D)&&L!==void 0,M=Gx(V,W);return _1.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[_1.jsx(Z30,{current:V.value,model:V,models:G,onValueChange:q}),!j&&V.supportsFastMode&&_1.jsx(Vv,{fastMode:M,onChange:A}),j&&_1.jsx(J30,{currentEffort:L,effortLevels:D,fastMode:M,showFastMode:V.supportsFastMode===!0,onFastModeChange:A,onValueChange:N},V.value)]})});var L5=_(d(),1);function Mv({composerRef:$,onSend:Z,onStop:J,processing:H,sessionId:B,modelSessionId:Q,availability:X,annotation:z,onRemoveDrawing:G,allowFiles:K=!0,placeholder:U,draft:Y}){let F=aB.useRef(null),W=e1(),q=C5((T)=>T.composerDrafts[W]??""),N=C5((T)=>Y?(T.viewBuilderDrafts??{})[Y.id]:void 0),A=Y?N??Y.initialValue:q,V=K5(A),D=x2((T)=>T.attachments[p8(W,B)]??H30),[L,j]=aB.useState(!1),M=D.some((T)=>T.kind!=="text"&&T.status==="uploading"),P=D.some((T)=>T.kind==="text"||T.status==="ready"||T.status==="draft"),w=A.trim().length>0||P,C=gB(w,M,X),R=(T)=>{if(V.current=T,Y)Y.onChange(T);else C5.getState().setComposerDraft(W,T)},O=(T)=>{if(K)Gy({workspaceId:W,sessionId:B},T)},S=aB.useRef(!1),y=(T)=>{if(T.kind==="drawing"&&G){G(T.localId);return}k1.getState().removeAttachment(W,T.localId)},k=async()=>{if(!C||S.current)return;S.current=!0;try{if(await z?.finish(),await Z(V.current),!Y)V.current="",C5.getState().setComposerDraft(W,"")}finally{S.current=!1}};return L5.jsxs(Wy,{composerRef:$,onSubmit:(T)=>{T.preventDefault(),k()},onDragOver:(T)=>{if(!T.dataTransfer.types.includes("Files"))return;if(T.preventDefault(),K)j(!0)},onDragLeave:(T)=>{if(!K)return;if(T.currentTarget.contains(T.relatedTarget))return;j(!1)},onDrop:(T)=>{if(!T.dataTransfer.types.includes("Files"))return;T.preventDefault(),j(!1),O(Array.from(T.dataTransfer.files))},className:G0(L&&"ring-2 ring-ring/60"),children:[D.length>0&&L5.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-1",children:D.toSorted((T,b)=>Dv[T.kind]-Dv[b.kind]).map((T)=>T.kind==="text"?L5.jsx(fB,{label:T.label,onRemove:()=>y(T)},T.localId):T.kind==="drawing"?L5.jsx(ey,{attachment:T,onRemove:()=>y(T)},T.localId):L5.jsx($x,{attachment:T,onRemove:()=>y(T)},T.localId))}),L5.jsx(qy,{textareaRef:$,id:"chat-input",name:"message",value:A,onChange:(T)=>R(T.target.value),onKeyDown:(T)=>{if(T.key==="Enter"&&!T.shiftKey)T.preventDefault(),k()},onPaste:(T)=>{let b=Array.from(T.clipboardData?.files??[]);if(b.length===0)return;T.preventDefault(),O(b)},placeholder:H?"Queue a follow-up":U??"Do anything",rows:1}),L5.jsxs(Ny,{children:[K&&L5.jsx("input",{ref:F,type:"file",multiple:!0,hidden:!0,onChange:(T)=>{O(Array.from(T.target.files??[])),T.target.value=""}}),L5.jsxs("div",{className:"mr-auto flex shrink-0 items-center gap-0.5",children:[K&&L5.jsxs(B5,{children:[L5.jsx(Q5,{render:L5.jsx(j0,{type:"button",variant:"ghost",size:"icon",onClick:()=>F.current?.click(),"aria-label":"Attach files",children:L5.jsx(bG,{stroke:1.6,className:"size-4.5!"})})}),L5.jsx(X5,{children:"Attach files"})]}),z&&L5.jsxs(B5,{children:[L5.jsx(Q5,{render:L5.jsx(j0,{type:"button",variant:"ghost",size:"icon",onClick:z.onToggle,className:G0(z.active&&"bg-accent"),"aria-label":"Draw annotation","aria-pressed":z.active,children:L5.jsx(tZ,{stroke:1.5})})}),L5.jsx(X5,{children:"Draw annotation"})]})]}),L5.jsx(Av,{sessionId:Q}),H?L5.jsxs(B5,{children:[L5.jsx(Q5,{render:L5.jsx(j0,{type:"button",size:"icon",onClick:J,"aria-label":"Stop agent",children:L5.jsx(Lv,{})})}),L5.jsx(X5,{children:"Stop answering"})]}):L5.jsx(Vy,{label:"Send message",hasContent:w,busy:M,availability:X})]})]})}var H30=[],Dv={file:0,drawing:1,text:2};var K$=_(d(),1);function TD({className:$,prompt:Z,disabled:J=!1,onSelect:H}){let B=Z.icon;return K$.jsxs(j0,{type:"button",size:"sm",disabled:J,onClick:()=>H(Z),className:G0("h-auto items-start justify-start gap-2 rounded-lg p-2 px-3 text-left leading-snug whitespace-normal",$),children:[K$.jsx(B,{stroke:2,"aria-hidden":!0,className:"mt-0.5"}),K$.jsx("span",{children:Z.label})]})}function Pv({prompts:$,disabled:Z=!1,onSelect:J}){return K$.jsx("div",{className:"row-gap-2 grid w-full grid-cols-1 gap-x-3 gap-y-2 @md:grid-cols-3",children:$.map((H,B)=>{return K$.jsx(TD,{prompt:H,disabled:Z,onSelect:J,className:G0("h-full w-fit @md:w-full",B===0&&"@md:translate-y-3 @md:rotate-3 @md:hover:translate-y-2.5",B===1&&"@md:-rotate-1",B===2&&"@md:translate-y-3 @md:-rotate-4 @md:hover:translate-y-2.5")},H.prompt)})})}var z5=_(d(),1),CD="Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or bundle, test, and runtime-log summaries.",B30=[{label:"Check the weather",prompt:"Build me a set of weather widgets that surface current conditions, today's hourly forecast, and a simple weekly outlook at a glance",context:["Build this onboarding example immediately without asking follow-up questions.","Create three separate widgets: current conditions, today's hourly forecast, and a seven-day outlook.","Use one shared Open-Meteo server function with no API key and use Berlin as the default location.","Give each widget an appropriate grid size and a compact, visually distinct layout with loading, error, and last-updated states.","Bundle all three widgets, smoke-test the shared weather function, and check runtime logs before finishing.",CD],icon:_v},{label:"Track my finances",prompt:"Build me a personal finance view for tracking income, expenses, monthly budgets, spending trends, and savings, with an agent action that can add sample transactions",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services or bank connections.","Create a responsive View with a month selector, income, spending, and savings summaries, an income-versus-spending trend, category breakdowns, budget progress, and recent transactions.","Support adding, editing, and deleting income and expense transactions, categories, and monthly category budgets.","Persist transactions, categories, and budgets in a workspace-local SQLite database accessed through server functions. Store monetary amounts as integer cents and seed realistic sample data only when the database is empty.","Add an “Add with agent” action that imports `sendChatMessage` from `moi` and sends a concise request for the agent to generate and insert a realistic batch of sample transactions into the same database.","Provide a small documented workspace script the agent can use to validate and append transactions safely, then refresh the View data after the agent updates the database.","Include loading, empty, and error states, then bundle the View and smoke-test its SQLite persistence and transaction mutations before finishing.",CD],icon:jv},{label:"Build a playful synthesizer",prompt:"Build me a view with a simple, playful synthesizer featuring a keyboard, five sound controls, and the ability to record, save, and load music files from the workspace",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services.","Create a responsive View that uses the browser's audio capabilities, with an onscreen piano and computer-keyboard controls.","Include five clearly labeled sound controls for waveform, attack, release, filter cutoff, and volume.","Let the user record timed note events, play and stop recordings, give them names, and save and load them as JSON music files in a workspace music folder.","Include clear empty and error states, then bundle the View and check runtime logs before finishing.",CD],icon:kG}],Q30={label:"Explore the workspace",prompt:"Explore this workspace and suggest what moi can build based on its content",context:["Explore the existing workspace files before making suggestions.","Briefly explain what the workspace appears to be for and which content informed your ideas.","Propose a focused set of useful widgets or views that fit the work already here.","Wait for me to choose before building anything."],icon:VY};function Ov({isViewBuilderDraft:$,hasSentMessageFromMoi:Z,isWorkspacePendingAnalysis:J}){if($)return"view-builder";if(!Z)return"welcome";if(J)return"explore-workspace";return"empty"}function Tv({agent:$,kind:Z,hasWorkspaceApplets:J,disabled:H=!1,onSelectPrompt:B,onNavigate:Q}){switch(Z){case"view-builder":return z5.jsx(X30,{agent:$});case"welcome":return z5.jsx(z30,{agent:$,disabled:H,showExamples:!J,onSelectPrompt:B,onNavigate:Q});case"explore-workspace":return z5.jsx(G30,{agent:$,disabled:H,onSelectPrompt:B});case"empty":return z5.jsx(K30,{agent:$})}}function DY({agent:$,children:Z,className:J}){return z5.jsxs("div",{className:G0("flex flex-1 flex-col items-center justify-center self-center",J),children:[z5.jsx(g9,{preset:$,color:"secondary",expression:"idle",className:"mb-2",animated:!0}),Z]})}function X30({agent:$}){return z5.jsx(DY,{agent:$,className:"text-center text-muted-foreground",children:z5.jsx("p",{className:"mx-auto max-w-xs px-8 text-sm",children:"Describe the content, data, and key actions you need in the view"})})}function z30({agent:$,disabled:Z=!1,showExamples:J=!0,onSelectPrompt:H,onNavigate:B}){return z5.jsx(DY,{agent:$,className:"@container w-full max-w-md min-w-0",children:z5.jsxs("div",{className:"mt-2 flex flex-col gap-4",children:[z5.jsxs("div",{className:"prose prose-sm min-w-0 wrap-anywhere prose-inherit",children:[z5.jsx("p",{children:"moi is the personal workspace built for you by your agent. It grows and adapts to your needs."}),z5.jsxs("p",{children:["Ask the"," ",z5.jsx(NY,{Icon:oB,destination:"agent",onNavigate:B,children:"Agent"})," ","to build widgets on the"," ",z5.jsx(NY,{Icon:AY,destination:"overview",onNavigate:B,children:"Overview"})," ","page, or more complex tools as separate"," ",z5.jsx(NY,{Icon:WJ,destination:"views",onNavigate:B,children:"Views"}),". Use"," ",z5.jsx(NY,{Icon:nB,destination:"scratchpad",onNavigate:B,children:"Scratchpad"})," ","for exploring and shaping ideas with your agent."]}),J&&z5.jsx("p",{children:"Try an example:"})]}),J&&z5.jsx(Pv,{prompts:B30,disabled:Z,onSelect:H})]})})}function G30({agent:$,disabled:Z=!1,onSelectPrompt:J}){return z5.jsx(DY,{agent:$,children:z5.jsxs("div",{className:"flex flex-col items-center gap-4",children:[z5.jsx("div",{className:"prose prose-sm max-w-xs min-w-0 text-center wrap-anywhere prose-inherit",children:z5.jsx("p",{children:"Your agent can explore this workspace and suggest useful widgets and views based on what’s already here"})}),z5.jsx(TD,{prompt:Q30,disabled:Z,onSelect:J})]})})}function K30({agent:$}){return z5.jsx(DY,{agent:$,className:"text-center text-muted-foreground",children:z5.jsx("p",{className:"mx-auto max-w-sm px-8 text-sm",children:"Chat with your agent, create widgets and views, and manage your workspace context from here"})})}function NY({Icon:$,children:Z,destination:J,onNavigate:H}){return z5.jsxs("button",{type:"button","data-welcome-destination":J,onClick:()=>H(J),className:"inline-flex cursor-pointer items-center gap-0.5 align-bottom font-medium text-foreground",children:[z5.jsx($,{size:16,stroke:1.75,"aria-hidden":!0}),Z]})}var sB=_(p(),1);var g1=_(d(),1);function wv({label:$}){return g1.jsx("div",{className:"flex h-7 items-center px-2.5 text-sm font-medium",children:$})}function U30($){if($.flavor==="cron"||$.flavor==="subagent")return $.flavor;let Z=$.origin?.provider.trim().toLowerCase();return Z?Z:null}function Y30({active:$,canArchive:Z,confirmingArchive:J,onArchive:H,onRequestArchive:B,onSelect:Q,session:X,workspaceId:z}){let G=sB.useRef(!1),[K,U]=sB.useState(!1),Y=x2((N)=>kH(N.activity,z,X.sessionId)),F=U30(X);function W(){B(X.sessionId)}async function q(){if(G.current)return;G.current=!0,U(!0);try{await H(X.sessionId)}catch{q5.add({title:"Couldn’t archive chat",type:"error"})}finally{G.current=!1,U(!1)}}return g1.jsxs("div",{className:"group/chat relative",children:[g1.jsx(n8,{className:G0("font-medium group-hover/chat:bg-accent group-hover/chat:text-accent-foreground",$&&"bg-accent text-accent-foreground"),onClick:()=>Q(X.sessionId),children:g1.jsx("div",{className:G0("flex min-w-0 flex-1 overflow-hidden",(Y||K)&&"mr-4 mask-r-from-[calc(100%-16px)]",Z&&!J&&"group-focus-within/chat:mr-4 group-focus-within/chat:mask-r-from-[calc(100%-16px)] group-hover/chat:mr-4 group-hover/chat:mask-r-from-[calc(100%-16px)] [@media(hover:none)]:mr-4 [@media(hover:none)]:mask-r-from-[calc(100%-16px)]",J&&"mr-14 mask-r-from-[calc(100%-16px)]"),children:g1.jsxs("span",{className:G0("flex min-w-0 items-baseline gap-1.5",(Y||K)&&"-mr-4",J?"-mr-14":Z&&"group-focus-within/chat:-mr-4 group-hover/chat:-mr-4 [@media(hover:none)]:-mr-4"),children:[g1.jsx("span",{className:"min-w-0 truncate",children:X.summary}),F&&g1.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:F})]})})}),Y&&g1.jsx(s4,{className:G0("pointer-events-none absolute top-1/2 right-1.5 -translate-y-1/2 text-muted-foreground",Z&&"group-focus-within/chat:hidden group-hover/chat:hidden [@media(hover:none)]:hidden",(J||K)&&"hidden")}),Z&&g1.jsx("div",{className:G0("absolute top-1/2 right-0 flex -translate-y-1/2 items-center opacity-100 transition-none",!J&&"group-focus-within/chat:opacity-100 group-hover/chat:opacity-100 [@media(hover:hover)]:opacity-0",K&&"opacity-100!"),children:J?g1.jsx(j0,{type:"button",variant:"secondary",size:"sm","aria-label":`Confirm archive ${X.summary}`,tabIndex:-1,className:"mr-1 h-5 rounded-sm px-1.5 text-xs hover:bg-accent",disabled:K,onClick:q,onPointerDown:(N)=>N.stopPropagation(),children:"Confirm"}):g1.jsxs(B5,{children:[g1.jsx(Q5,{render:g1.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Archive ${X.summary}`,tabIndex:-1,className:"text-muted-foreground hover:bg-transparent hover:text-foreground",disabled:K,onClick:W,onPointerDown:(N)=>N.stopPropagation(),children:g1.jsx(Ev,{stroke:1.75})})}),g1.jsx(X5,{side:"right",children:"Archive chat"})]})})]})}function F30($){return`${$.getFullYear()}-${$.getMonth()}-${$.getDate()}`}function Cv($){return Date.UTC($.getFullYear(),$.getMonth(),$.getDate())/86400000}function W30($,Z){let J=Cv(Z)-Cv($);if(J===0)return"Today";if(J===1)return"Yesterday";if(J>=2&&J<=5)return`${J} days ago`;return $.toLocaleDateString([],{month:"short",day:"numeric",...$.getFullYear()===Z.getFullYear()?{}:{year:"numeric"}})}function q30($,Z=new Date){let J=new Map;for(let H of $.slice().sort((B,Q)=>Q.lastModified-B.lastModified)){let B=new Date(H.lastModified),Q=F30(B),X=J.get(Q);if(X){X.sessions.push(H);continue}J.set(Q,{key:Q,label:W30(B,Z),sessions:[H]})}return[...J.values()]}function Sv({isViewBuilder:$=!1}){if($)return g1.jsx(wv,{label:"Build a new view"});return g1.jsx(N30,{})}function N30(){let $=e1(),[Z,J]=e3(),H=Z??null,[B,Q]=sB.useState(null),{data:X=[]}=DU($),z=m9($).data?.supportsArchiving===!0,G=Jx($),K=x2((N)=>aC(N.activity,$,H));if(X.length===0)return g1.jsx(wv,{label:"New chat"});let Y=X.find((N)=>N.sessionId===H)?.summary??"New chat",F=q30(X);function W(N){if(!N)Q(null)}async function q(N){Q(null),await G.mutateAsync(N);let A=k1.getState();if(A.clearAttachments($,N),A.clearPreviewsForSession($,N),H===N)J(null)}return g1.jsxs(c9,{onOpenChange:W,children:[g1.jsx(d9,{render:g1.jsxs(j0,{className:"group max-w-full min-w-0 shrink",variant:"ghost",size:"sm",children:[g1.jsx("span",{className:"max-w-64 min-w-0 truncate",children:Y}),K?g1.jsx(s4,{className:"size-4!",stroke:2}):g1.jsx(LY,{className:"text-muted-foreground group-hover:text-foreground",stroke:1.75})]})}),g1.jsxs(l9,{align:"start",className:"flex max-h-100 w-max max-w-72 min-w-40 flex-col overflow-hidden",children:[g1.jsxs(n8,{className:"shrink-0 gap-1 font-medium text-muted-foreground! **:text-muted-foreground!",onClick:()=>J(null),children:[g1.jsx(MY,{size:16,stroke:1.75}),"New chat"]}),F.length>0&&g1.jsxs(g1.Fragment,{children:[g1.jsx(Wh,{className:"shrink-0"}),g1.jsx("div",{className:"no-scrollbar flex min-h-0 flex-1 scroll-fade flex-col gap-1 overflow-y-auto overscroll-contain [--scroll-fade-reveal:8px]",children:F.map((N)=>g1.jsxs(b6,{children:[g1.jsx(sU,{children:N.label}),N.sessions.map((A)=>g1.jsx(Y30,{session:A,active:H===A.sessionId,canArchive:z,confirmingArchive:B===A.sessionId,onSelect:J,onArchive:q,onRequestArchive:Q,workspaceId:$},A.sessionId))]},N.key))})]})]})]})}var sc=_(p(),1);function n1(){}function PY(){}function Iv($,Z){let J=Z||{};return($[$.length-1]===""?[...$,""]:$).join((J.padRight?" ":"")+","+(J.padLeft===!1?"":" ")).trim()}var V30=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,A30=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,D30={};function _Y($,Z){return((Z||D30).jsx?A30:V30).test($)}var L30=/[ \t\n\f\r]/g;function ED($){return typeof $==="object"?$.type==="text"?Rv($.value):!1:Rv($)}function Rv($){return $.replace(L30,"")===""}class v6{constructor($,Z,J){if(this.normal=Z,this.property=$,J)this.space=J}}v6.prototype.normal={};v6.prototype.property={};v6.prototype.space=void 0;function wD($,Z){let J={},H={};for(let B of $)Object.assign(J,B.property),Object.assign(H,B.normal);return new v6(J,H,Z)}function tB($){return $.toLowerCase()}class g2{constructor($,Z){this.attribute=Z,this.property=$}}g2.prototype.attribute="";g2.prototype.booleanish=!1;g2.prototype.boolean=!1;g2.prototype.commaOrSpaceSeparated=!1;g2.prototype.commaSeparated=!1;g2.prototype.defined=!1;g2.prototype.mustUseProperty=!1;g2.prototype.number=!1;g2.prototype.overloadedBoolean=!1;g2.prototype.property="";g2.prototype.spaceSeparated=!1;g2.prototype.space=void 0;var eB={};I5(eB,{spaceSeparated:()=>U5,overloadedBoolean:()=>jY,number:()=>w0,commaSeparated:()=>g6,commaOrSpaceSeparated:()=>f4,booleanish:()=>i5,boolean:()=>O1});var M30=0,O1=U$(),i5=U$(),jY=U$(),w0=U$(),U5=U$(),g6=U$(),f4=U$();function U$(){return 2**++M30}var SD=Object.keys(eB);class qJ extends g2{constructor($,Z,J,H){let B=-1;super($,Z);if(bv(this,"space",H),typeof J==="number")while(++B<SD.length){let Q=SD[B];bv(this,SD[B],(J&eB[Q])===eB[Q])}}}qJ.prototype.defined=!0;function bv($,Z,J){if(J)$[Z]=J}function w8($){let Z={},J={};for(let[H,B]of Object.entries($.properties)){let Q=new qJ(H,$.transform($.attributes||{},H),B,$.space);if($.mustUseProperty&&$.mustUseProperty.includes(H))Q.mustUseProperty=!0;Z[H]=Q,J[tB(H)]=H,J[tB(Q.attribute)]=H}return new v6(Z,J,$.space)}var ID=w8({properties:{ariaActiveDescendant:null,ariaAtomic:i5,ariaAutoComplete:null,ariaBusy:i5,ariaChecked:i5,ariaColCount:w0,ariaColIndex:w0,ariaColSpan:w0,ariaControls:U5,ariaCurrent:null,ariaDescribedBy:U5,ariaDetails:null,ariaDisabled:i5,ariaDropEffect:U5,ariaErrorMessage:null,ariaExpanded:i5,ariaFlowTo:U5,ariaGrabbed:i5,ariaHasPopup:null,ariaHidden:i5,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:U5,ariaLevel:w0,ariaLive:null,ariaModal:i5,ariaMultiLine:i5,ariaMultiSelectable:i5,ariaOrientation:null,ariaOwns:U5,ariaPlaceholder:null,ariaPosInSet:w0,ariaPressed:i5,ariaReadOnly:i5,ariaRelevant:null,ariaRequired:i5,ariaRoleDescription:U5,ariaRowCount:w0,ariaRowIndex:w0,ariaRowSpan:w0,ariaSelected:i5,ariaSetSize:w0,ariaSort:null,ariaValueMax:w0,ariaValueMin:w0,ariaValueNow:w0,ariaValueText:null,role:null},transform($,Z){return Z==="role"?Z:"aria-"+Z.slice(4).toLowerCase()}});function OY($,Z){return Z in $?$[Z]:Z}function TY($,Z){return OY($,Z.toLowerCase())}var kv=w8({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:g6,acceptCharset:U5,accessKey:U5,action:null,allow:null,allowFullScreen:O1,allowPaymentRequest:O1,allowUserMedia:O1,alt:null,as:null,async:O1,autoCapitalize:null,autoComplete:U5,autoFocus:O1,autoPlay:O1,blocking:U5,capture:null,charSet:null,checked:O1,cite:null,className:U5,cols:w0,colSpan:null,content:null,contentEditable:i5,controls:O1,controlsList:U5,coords:w0|g6,crossOrigin:null,data:null,dateTime:null,decoding:null,default:O1,defer:O1,dir:null,dirName:null,disabled:O1,download:jY,draggable:i5,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:O1,formTarget:null,headers:U5,height:w0,hidden:jY,high:w0,href:null,hrefLang:null,htmlFor:U5,httpEquiv:U5,id:null,imageSizes:null,imageSrcSet:null,inert:O1,inputMode:null,integrity:null,is:null,isMap:O1,itemId:null,itemProp:U5,itemRef:U5,itemScope:O1,itemType:U5,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:O1,low:w0,manifest:null,max:null,maxLength:w0,media:null,method:null,min:null,minLength:w0,multiple:O1,muted:O1,name:null,nonce:null,noModule:O1,noValidate:O1,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:O1,optimum:w0,pattern:null,ping:U5,placeholder:null,playsInline:O1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:O1,referrerPolicy:null,rel:U5,required:O1,reversed:O1,rows:w0,rowSpan:w0,sandbox:U5,scope:null,scoped:O1,seamless:O1,selected:O1,shadowRootClonable:O1,shadowRootDelegatesFocus:O1,shadowRootMode:null,shape:null,size:w0,sizes:null,slot:null,span:w0,spellCheck:i5,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w0,step:null,style:null,tabIndex:w0,target:null,title:null,translate:null,type:null,typeMustMatch:O1,useMap:null,value:i5,width:w0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:U5,axis:null,background:null,bgColor:null,border:w0,borderColor:null,bottomMargin:w0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:O1,declare:O1,event:null,face:null,frame:null,frameBorder:null,hSpace:w0,leftMargin:w0,link:null,longDesc:null,lowSrc:null,marginHeight:w0,marginWidth:w0,noResize:O1,noHref:O1,noShade:O1,noWrap:O1,object:null,profile:null,prompt:null,rev:null,rightMargin:w0,rules:null,scheme:null,scrolling:i5,standby:null,summary:null,text:null,topMargin:w0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w0,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:O1,disableRemotePlayback:O1,prefix:null,property:null,results:w0,security:null,unselectable:null},space:"html",transform:TY});var yv=w8({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:f4,accentHeight:w0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w0,amplitude:w0,arabicForm:null,ascent:w0,attributeName:null,attributeType:null,azimuth:w0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w0,by:null,calcMode:null,capHeight:w0,className:U5,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:w0,diffuseConstant:w0,direction:null,display:null,dur:null,divisor:w0,dominantBaseline:null,download:O1,dx:null,dy:null,edgeMode:null,editable:null,elevation:w0,enableBackground:null,end:null,event:null,exponent:w0,externalResourcesRequired:null,fill:null,fillOpacity:w0,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:g6,g2:g6,glyphName:g6,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:w0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w0,horizOriginX:w0,horizOriginY:w0,id:null,ideographic:w0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w0,k:w0,k1:w0,k2:w0,k3:w0,k4:w0,kernelMatrix:f4,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w0,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:w0,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:w0,overlineThickness:w0,paintOrder:null,panose1:null,path:null,pathLength:w0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:U5,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w0,pointsAtY:w0,pointsAtZ:w0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:f4,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:f4,rev:f4,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:f4,requiredFeatures:f4,requiredFonts:f4,requiredFormats:f4,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:w0,specularExponent:w0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w0,strikethroughThickness:w0,string:null,stroke:null,strokeDashArray:f4,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w0,strokeOpacity:w0,strokeWidth:null,style:null,surfaceScale:w0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:f4,tabIndex:w0,tableValues:null,target:null,targetX:w0,targetY:w0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:f4,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w0,underlineThickness:w0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w0,values:null,vAlphabetic:w0,vMathematical:w0,vectorEffect:null,vHanging:w0,vIdeographic:w0,version:null,vertAdvY:w0,vertOriginX:w0,vertOriginY:w0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:OY});var RD=w8({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 bD=w8({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:TY});var kD=w8({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform($,Z){return"xml:"+Z.slice(3).toLowerCase()}});var yD={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 P30=/[A-Z]/g,xv=/-[a-z]/g,_30=/^data[-\w.:]+$/i;function xD($,Z){let J=tB(Z),H=Z,B=g2;if(J in $.normal)return $.property[$.normal[J]];if(J.length>4&&J.slice(0,4)==="data"&&_30.test(Z)){if(Z.charAt(4)==="-"){let Q=Z.slice(5).replace(xv,O30);H="data"+Q.charAt(0).toUpperCase()+Q.slice(1)}else{let Q=Z.slice(4);if(!xv.test(Q)){let X=Q.replace(P30,j30);if(X.charAt(0)!=="-")X="-"+X;Z="data"+X}}B=qJ}return new B(H,Z)}function j30($){return"-"+$.toLowerCase()}function O30($){return $.charAt(1).toUpperCase()}var hv=wD([ID,kv,RD,bD,kD],"html"),CY=wD([ID,yv,RD,bD,kD],"svg");function vv($){return $.join(" ").trim()}var $g=_(nv(),1);var EY=sv("end"),NJ=sv("start");function sv($){return Z;function Z(J){let H=J&&J.position&&J.position[$]||{};if(typeof H.line==="number"&&H.line>0&&typeof H.column==="number"&&H.column>0)return{line:H.line,column:H.column,offset:typeof H.offset==="number"&&H.offset>-1?H.offset:void 0}}}function gD($){let Z=NJ($),J=EY($);if(Z&&J)return{start:Z,end:J}}function f6($){if(!$||typeof $!=="object")return"";if("position"in $||"type"in $)return tv($.position);if("start"in $||"end"in $)return tv($);if("line"in $||"column"in $)return fD($);return""}function fD($){return ev($&&$.line)+":"+ev($&&$.column)}function tv($){return fD($&&$.start)+"-"+fD($&&$.end)}function ev($){return $&&typeof $==="number"?$:1}class X2 extends Error{constructor($,Z,J){super();if(typeof Z==="string")J=Z,Z=void 0;let H="",B={},Q=!1;if(Z)if("line"in Z&&"column"in Z)B={place:Z};else if("start"in Z&&"end"in Z)B={place:Z};else if("type"in Z)B={ancestors:[Z],place:Z.position};else B={...Z};if(typeof $==="string")H=$;else if(!B.cause&&$)Q=!0,H=$.message,B.cause=$;if(!B.ruleId&&!B.source&&typeof J==="string"){let z=J.indexOf(":");if(z===-1)B.ruleId=J;else B.source=J.slice(0,z),B.ruleId=J.slice(z+1)}if(!B.place&&B.ancestors&&B.ancestors){let z=B.ancestors[B.ancestors.length-1];if(z)B.place=z.position}let X=B.place&&"start"in B.place?B.place.start:B.place;this.ancestors=B.ancestors||void 0,this.cause=B.cause||void 0,this.column=X?X.column:void 0,this.fatal=void 0,this.file="",this.message=H,this.line=X?X.line:void 0,this.name=f6(B.place)||"1:1",this.place=B.place||void 0,this.reason=this.message,this.ruleId=B.ruleId||void 0,this.source=B.source||void 0,this.stack=Q&&B.cause&&typeof B.cause.stack==="string"?B.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}X2.prototype.file="";X2.prototype.name="";X2.prototype.reason="";X2.prototype.message="";X2.prototype.stack="";X2.prototype.column=void 0;X2.prototype.line=void 0;X2.prototype.ancestors=void 0;X2.prototype.cause=void 0;X2.prototype.fatal=void 0;X2.prototype.place=void 0;X2.prototype.ruleId=void 0;X2.prototype.source=void 0;var mD={}.hasOwnProperty,n30=new Map,s30=/[A-Z]/g,t30=new Set(["table","tbody","thead","tfoot","tr"]),e30=new Set(["td","th"]),Zg="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function uD($,Z){if(!Z||Z.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let J=Z.filePath||void 0,H;if(Z.development){if(typeof Z.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");H=z60(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");H=X60(J,Z.jsx,Z.jsxs)}let B={Fragment:Z.Fragment,ancestors:[],components:Z.components||{},create:H,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"?CY:hv,stylePropertyNameCase:Z.stylePropertyNameCase||"dom",tableCellAlignToStyle:Z.tableCellAlignToStyle!==!1},Q=Jg(B,$,void 0);if(Q&&typeof Q!=="string")return Q;return B.create($,B.Fragment,{children:Q||void 0},void 0)}function Jg($,Z,J){if(Z.type==="element")return $60($,Z,J);if(Z.type==="mdxFlowExpression"||Z.type==="mdxTextExpression")return Z60($,Z);if(Z.type==="mdxJsxFlowElement"||Z.type==="mdxJsxTextElement")return H60($,Z,J);if(Z.type==="mdxjsEsm")return J60($,Z);if(Z.type==="root")return B60($,Z,J);if(Z.type==="text")return Q60($,Z)}function $60($,Z,J){let H=$.schema,B=H;if(Z.tagName.toLowerCase()==="svg"&&H.space==="html")B=CY,$.schema=B;$.ancestors.push(Z);let Q=Bg($,Z.tagName,!1),X=G60($,Z),z=cD($,Z);if(t30.has(Z.tagName))z=z.filter(function(G){return typeof G==="string"?!ED(G):!0});return Hg($,X,Q,Z),pD(X,z),$.ancestors.pop(),$.schema=H,$.create(Z,Q,X,J)}function Z60($,Z){if(Z.data&&Z.data.estree&&$.evaluater){let H=Z.data.estree.body[0];return n1(H.type==="ExpressionStatement"),$.evaluater.evaluateExpression(H.expression)}ZQ($,Z.position)}function J60($,Z){if(Z.data&&Z.data.estree&&$.evaluater)return $.evaluater.evaluateProgram(Z.data.estree);ZQ($,Z.position)}function H60($,Z,J){let H=$.schema,B=H;if(Z.name==="svg"&&H.space==="html")B=CY,$.schema=B;$.ancestors.push(Z);let Q=Z.name===null?$.Fragment:Bg($,Z.name,!0),X=K60($,Z),z=cD($,Z);return Hg($,X,Q,Z),pD(X,z),$.ancestors.pop(),$.schema=H,$.create(Z,Q,X,J)}function B60($,Z,J){let H={};return pD(H,cD($,Z)),$.create(Z,$.Fragment,H,J)}function Q60($,Z){return Z.value}function Hg($,Z,J,H){if(typeof J!=="string"&&J!==$.Fragment&&$.passNode)Z.node=H}function pD($,Z){if(Z.length>0){let J=Z.length>1?Z:Z[0];if(J)$.children=J}}function X60($,Z,J){return H;function H(B,Q,X,z){let K=Array.isArray(X.children)?J:Z;return z?K(Q,X,z):K(Q,X)}}function z60($,Z){return J;function J(H,B,Q,X){let z=Array.isArray(Q.children),G=NJ(H);return Z(B,Q,X,z,{columnNumber:G?G.column-1:void 0,fileName:$,lineNumber:G?G.line:void 0},void 0)}}function G60($,Z){let J={},H,B;for(B in Z.properties)if(B!=="children"&&mD.call(Z.properties,B)){let Q=U60($,B,Z.properties[B]);if(Q){let[X,z]=Q;if($.tableCellAlignToStyle&&X==="align"&&typeof z==="string"&&e30.has(Z.tagName))H=z;else J[X]=z}}if(H){let Q=J.style||(J.style={});Q[$.stylePropertyNameCase==="css"?"text-align":"textAlign"]=H}return J}function K60($,Z){let J={};for(let H of Z.attributes)if(H.type==="mdxJsxExpressionAttribute")if(H.data&&H.data.estree&&$.evaluater){let Q=H.data.estree.body[0];n1(Q.type==="ExpressionStatement");let X=Q.expression;n1(X.type==="ObjectExpression");let z=X.properties[0];n1(z.type==="SpreadElement"),Object.assign(J,$.evaluater.evaluateExpression(z.argument))}else ZQ($,Z.position);else{let B=H.name,Q;if(H.value&&typeof H.value==="object")if(H.value.data&&H.value.data.estree&&$.evaluater){let z=H.value.data.estree.body[0];n1(z.type==="ExpressionStatement"),Q=$.evaluater.evaluateExpression(z.expression)}else ZQ($,Z.position);else Q=H.value===null?!0:H.value;J[B]=Q}return J}function cD($,Z){let J=[],H=-1,B=$.passKeys?new Map:n30;while(++H<Z.children.length){let Q=Z.children[H],X;if($.passKeys){let G=Q.type==="element"?Q.tagName:Q.type==="mdxJsxFlowElement"||Q.type==="mdxJsxTextElement"?Q.name:void 0;if(G){let K=B.get(G)||0;X=G+"-"+K,B.set(G,K+1)}}let z=Jg($,Q,X);if(z!==void 0)J.push(z)}return J}function U60($,Z,J){let H=xD($.schema,Z);if(J===null||J===void 0||typeof J==="number"&&Number.isNaN(J))return;if(Array.isArray(J))J=H.commaSeparated?Iv(J):vv(J);if(H.property==="style"){let B=typeof J==="object"?J:Y60($,String(J));if($.stylePropertyNameCase==="css")B=F60(B);return["style",B]}return[$.elementAttributeNameCase==="react"&&H.space?yD[H.property]||H.property:H.attribute,J]}function Y60($,Z){try{return $g.default(Z,{reactCompat:!0})}catch(J){if($.ignoreInvalidStyle)return{};let H=J,B=new X2("Cannot parse `style` attribute",{ancestors:$.ancestors,cause:H,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw B.file=$.filePath||void 0,B.url=Zg+"#cannot-parse-style-attribute",B}}function Bg($,Z,J){let H;if(!J)H={type:"Literal",value:Z};else if(Z.includes(".")){let B=Z.split("."),Q=-1,X;while(++Q<B.length){let z=_Y(B[Q])?{type:"Identifier",name:B[Q]}:{type:"Literal",value:B[Q]};X=X?{type:"MemberExpression",object:X,property:z,computed:Boolean(Q&&z.type==="Literal"),optional:!1}:z}n1(X,"always a result"),H=X}else H=_Y(Z)&&!/^[a-z]/.test(Z)?{type:"Identifier",name:Z}:{type:"Literal",value:Z};if(H.type==="Literal"){let B=H.value;return mD.call($.components,B)?$.components[B]:B}if($.evaluater)return $.evaluater.evaluateExpression(H);ZQ($)}function ZQ($,Z){let J=new X2("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=Zg+"#cannot-handle-mdx-estrees-without-createevaluater",J}function F60($){let Z={},J;for(J in $)if(mD.call($,J))Z[W60(J)]=$[J];return Z}function W60($){let Z=$.replace(s30,q60);if(Z.slice(0,3)==="ms-")Z="-"+Z;return Z}function q60($){return"-"+$.toLowerCase()}var JQ={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 jJ=_(d(),1),Ef=_(p(),1);var N60={};function F$($,Z){let J=Z||N60,H=typeof J.includeImageAlt==="boolean"?J.includeImageAlt:!0,B=typeof J.includeHtml==="boolean"?J.includeHtml:!0;return Xg($,H,B)}function Xg($,Z,J){if(V60($)){if("value"in $)return $.type==="html"&&!J?"":$.value;if(Z&&"alt"in $&&$.alt)return $.alt;if("children"in $)return Qg($.children,Z,J)}if(Array.isArray($))return Qg($,Z,J);return""}function Qg($,Z,J){let H=[],B=-1;while(++B<$.length)H[B]=Xg($[B],Z,J);return H.join("")}function V60($){return Boolean($&&typeof $==="object")}var zg=document.createElement("i");function VJ($){let Z="&"+$+";";zg.innerHTML=Z;let J=zg.textContent;if(J.charCodeAt(J.length-1)===59&&$!=="semi")return!1;return J===Z?!1:J}function e5($,Z,J,H){let B=$.length,Q=0,X;if(Z<0)Z=-Z>B?0:B+Z;else Z=Z>B?B:Z;if(J=J>0?J:0,H.length<1e4)X=Array.from(H),X.unshift(Z,J),$.splice(...X);else{if(J)$.splice(Z,J);while(Q<H.length)X=H.slice(Q,Q+1e4),X.unshift(Z,0),$.splice(...X),Q+=1e4,Z+=1e4}}function P4($,Z){if($.length>0)return e5($,$.length,0,Z),$;return Z}var Gg={}.hasOwnProperty;function wY($){let Z={},J=-1;while(++J<$.length)A60(Z,$[J]);return Z}function A60($,Z){let J;for(J in Z){let B=(Gg.call($,J)?$[J]:void 0)||($[J]={}),Q=Z[J],X;if(Q)for(X in Q){if(!Gg.call(B,X))B[X]=[];let z=Q[X];D60(B[X],Array.isArray(z)?z:z?[z]:[])}}}function D60($,Z){let J=-1,H=[];while(++J<Z.length)(Z[J].add==="after"?$:H).push(Z[J]);e5($,0,0,H)}function SY($,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 Q4($){return $.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var F2=m6(/[A-Za-z]/),r5=m6(/[\dA-Za-z]/),Kg=m6(/[#-'*+\--9=?A-Z^-~]/);function W$($){return $!==null&&($<32||$===127)}var HQ=m6(/\d/),Ug=m6(/[\dA-Fa-f]/),Yg=m6(/[!-/:-@[-`{-~]/);function u0($){return $!==null&&$<-2}function x1($){return $!==null&&($<0||$===32)}function H1($){return $===-2||$===-1||$===32}var q$=m6(/\p{P}|\p{S}/u),i9=m6(/\s/);function m6($){return Z;function Z(J){return J!==null&&J>-1&&$.test(String.fromCharCode(J))}}function S8($){let Z=[],J=-1,H=0,B=0;while(++J<$.length){let Q=$.charCodeAt(J),X="";if(Q===37&&r5($.charCodeAt(J+1))&&r5($.charCodeAt(J+2)))B=2;else if(Q<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(Q)))X=String.fromCharCode(Q)}else if(Q>55295&&Q<57344){let z=$.charCodeAt(J+1);if(Q<56320&&z>56319&&z<57344)X=String.fromCharCode(Q,z),B=1;else X="�"}else X=String.fromCharCode(Q);if(X)Z.push($.slice(H,J),encodeURIComponent(X)),H=J+B+1,X="";if(B)J+=B,B=0}return Z.join("")+$.slice(H)}function e0($,Z,J,H){let B=H?H-1:Number.POSITIVE_INFINITY,Q=0;return X;function X(G){if(H1(G))return $.enter(J),z(G);return Z(G)}function z(G){if(H1(G)&&Q++<B)return $.consume(G),z;return $.exit(J),Z(G)}}var Fg={tokenize:L60};function L60($){let Z=$.attempt(this.parser.constructs.contentInitial,H,B),J;return Z;function H(z){if(z===null){$.consume(z);return}return $.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),e0($,Z,"linePrefix")}function B(z){return $.enter("paragraph"),Q(z)}function Q(z){let G=$.enter("chunkText",{contentType:"text",previous:J});if(J)J.next=G;return J=G,X(z)}function X(z){if(z===null){$.exit("chunkText"),$.exit("paragraph"),$.consume(z);return}if(u0(z))return $.consume(z),$.exit("chunkText"),Q;return $.consume(z),X}}var qg={tokenize:M60},Wg={tokenize:P60};function M60($){let Z=this,J=[],H=0,B,Q,X;return z;function z(L){if(H<J.length){let j=J[H];return Z.containerState=j[1],$.attempt(j[0].continuation,G,K)(L)}return K(L)}function G(L){if(H++,Z.containerState._closeFlow){if(Z.containerState._closeFlow=void 0,B)D();let j=Z.events.length,M=j,P;while(M--)if(Z.events[M][0]==="exit"&&Z.events[M][1].type==="chunkFlow"){P=Z.events[M][1].end;break}V(H);let w=j;while(w<Z.events.length)Z.events[w][1].end={...P},w++;return e5(Z.events,M+1,0,Z.events.slice(j)),Z.events.length=w,K(L)}return z(L)}function K(L){if(H===J.length){if(!B)return F(L);if(B.currentConstruct&&B.currentConstruct.concrete)return q(L);Z.interrupt=Boolean(B.currentConstruct&&!B._gfmTableDynamicInterruptHack)}return Z.containerState={},$.check(Wg,U,Y)(L)}function U(L){if(B)D();return V(H),F(L)}function Y(L){return Z.parser.lazy[Z.now().line]=H!==J.length,X=Z.now().offset,q(L)}function F(L){return Z.containerState={},$.attempt(Wg,W,q)(L)}function W(L){return H++,J.push([Z.currentConstruct,Z.containerState]),F(L)}function q(L){if(L===null){if(B)D();V(0),$.consume(L);return}return B=B||Z.parser.flow(Z.now()),$.enter("chunkFlow",{_tokenizer:B,contentType:"flow",previous:Q}),N(L)}function N(L){if(L===null){A($.exit("chunkFlow"),!0),V(0),$.consume(L);return}if(u0(L))return $.consume(L),A($.exit("chunkFlow")),H=0,Z.interrupt=void 0,z;return $.consume(L),N}function A(L,j){let M=Z.sliceStream(L);if(j)M.push(null);if(L.previous=Q,Q)Q.next=L;if(Q=L,B.defineSkip(L.start),B.write(M),Z.parser.lazy[L.start.line]){let P=B.events.length;while(P--)if(B.events[P][1].start.offset<X&&(!B.events[P][1].end||B.events[P][1].end.offset>X))return;let w=Z.events.length,C=w,R,O;while(C--)if(Z.events[C][0]==="exit"&&Z.events[C][1].type==="chunkFlow"){if(R){O=Z.events[C][1].end;break}R=!0}V(H),P=w;while(P<Z.events.length)Z.events[P][1].end={...O},P++;e5(Z.events,C+1,0,Z.events.slice(w)),Z.events.length=P}}function V(L){let j=J.length;while(j-- >L){let M=J[j];Z.containerState=M[1],M[0].exit.call(Z,$)}J.length=L}function D(){B.write([null]),Q=void 0,B=void 0,Z.containerState._closeFlow=void 0}}function P60($,Z,J){return e0($,$.attempt(this.parser.constructs.document,Z,J),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _3($){if($===null||x1($)||i9($))return 1;if(q$($))return 2}function u6($,Z,J){let H=[],B=-1;while(++B<$.length){let Q=$[B].resolveAll;if(Q&&!H.includes(Q))Z=Q(Z,J),H.push(Q)}return Z}var BQ={name:"attention",resolveAll:_60,tokenize:j60};function _60($,Z){let J=-1,H,B,Q,X,z,G,K,U;while(++J<$.length)if($[J][0]==="enter"&&$[J][1].type==="attentionSequence"&&$[J][1]._close){H=J;while(H--)if($[H][0]==="exit"&&$[H][1].type==="attentionSequence"&&$[H][1]._open&&Z.sliceSerialize($[H][1]).charCodeAt(0)===Z.sliceSerialize($[J][1]).charCodeAt(0)){if(($[H][1]._close||$[J][1]._open)&&($[J][1].end.offset-$[J][1].start.offset)%3&&!(($[H][1].end.offset-$[H][1].start.offset+$[J][1].end.offset-$[J][1].start.offset)%3))continue;G=$[H][1].end.offset-$[H][1].start.offset>1&&$[J][1].end.offset-$[J][1].start.offset>1?2:1;let Y={...$[H][1].end},F={...$[J][1].start};if(Ng(Y,-G),Ng(F,G),X={type:G>1?"strongSequence":"emphasisSequence",start:Y,end:{...$[H][1].end}},z={type:G>1?"strongSequence":"emphasisSequence",start:{...$[J][1].start},end:F},Q={type:G>1?"strongText":"emphasisText",start:{...$[H][1].end},end:{...$[J][1].start}},B={type:G>1?"strong":"emphasis",start:{...X.start},end:{...z.end}},$[H][1].end={...X.start},$[J][1].start={...z.end},K=[],$[H][1].end.offset-$[H][1].start.offset)K=P4(K,[["enter",$[H][1],Z],["exit",$[H][1],Z]]);if(K=P4(K,[["enter",B,Z],["enter",X,Z],["exit",X,Z],["enter",Q,Z]]),K=P4(K,u6(Z.parser.constructs.insideSpan.null,$.slice(H+1,J),Z)),K=P4(K,[["exit",Q,Z],["enter",z,Z],["exit",z,Z],["exit",B,Z]]),$[J][1].end.offset-$[J][1].start.offset)U=2,K=P4(K,[["enter",$[J][1],Z],["exit",$[J][1],Z]]);else U=0;e5($,H-1,J-H+3,K),J=H+K.length-U-2;break}}J=-1;while(++J<$.length)if($[J][1].type==="attentionSequence")$[J][1].type="data";return $}function j60($,Z){let J=this.parser.constructs.attentionMarkers.null,H=this.previous,B=_3(H),Q;return X;function X(G){return Q=G,$.enter("attentionSequence"),z(G)}function z(G){if(G===Q)return $.consume(G),z;let K=$.exit("attentionSequence"),U=_3(G),Y=!U||U===2&&B||J.includes(G),F=!B||B===2&&U||J.includes(H);return K._open=Boolean(Q===42?Y:Y&&(B||!F)),K._close=Boolean(Q===42?F:F&&(U||!Y)),Z(G)}}function Ng($,Z){$.column+=Z,$.offset+=Z,$._bufferIndex+=Z}var dD={name:"autolink",tokenize:O60};function O60($,Z,J){let H=0;return B;function B(W){return $.enter("autolink"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.enter("autolinkProtocol"),Q}function Q(W){if(F2(W))return $.consume(W),X;if(W===64)return J(W);return K(W)}function X(W){if(W===43||W===45||W===46||r5(W))return H=1,z(W);return K(W)}function z(W){if(W===58)return $.consume(W),H=0,G;if((W===43||W===45||W===46||r5(W))&&H++<32)return $.consume(W),z;return H=0,K(W)}function G(W){if(W===62)return $.exit("autolinkProtocol"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),Z;if(W===null||W===32||W===60||W$(W))return J(W);return $.consume(W),G}function K(W){if(W===64)return $.consume(W),U;if(Kg(W))return $.consume(W),K;return J(W)}function U(W){return r5(W)?Y(W):J(W)}function Y(W){if(W===46)return $.consume(W),H=0,U;if(W===62)return $.exit("autolinkProtocol").type="autolinkEmail",$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),Z;return F(W)}function F(W){if((W===45||r5(W))&&H++<63){let q=W===45?F:Y;return $.consume(W),q}return J(W)}}var r9={partial:!0,tokenize:T60};function T60($,Z,J){return H;function H(Q){return H1(Q)?e0($,B,"linePrefix")(Q):B(Q)}function B(Q){return Q===null||u0(Q)?Z(Q):J(Q)}}var IY={continuation:{tokenize:E60},exit:w60,name:"blockQuote",tokenize:C60};function C60($,Z,J){let H=this;return B;function B(X){if(X===62){let z=H.containerState;if(!z.open)$.enter("blockQuote",{_container:!0}),z.open=!0;return $.enter("blockQuotePrefix"),$.enter("blockQuoteMarker"),$.consume(X),$.exit("blockQuoteMarker"),Q}return J(X)}function Q(X){if(H1(X))return $.enter("blockQuotePrefixWhitespace"),$.consume(X),$.exit("blockQuotePrefixWhitespace"),$.exit("blockQuotePrefix"),Z;return $.exit("blockQuotePrefix"),Z(X)}}function E60($,Z,J){let H=this;return B;function B(X){if(H1(X))return e0($,Q,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X);return Q(X)}function Q(X){return $.attempt(IY,Z,J)(X)}}function w60($){$.exit("blockQuote")}var RY={name:"characterEscape",tokenize:S60};function S60($,Z,J){return H;function H(Q){return $.enter("characterEscape"),$.enter("escapeMarker"),$.consume(Q),$.exit("escapeMarker"),B}function B(Q){if(Yg(Q))return $.enter("characterEscapeValue"),$.consume(Q),$.exit("characterEscapeValue"),$.exit("characterEscape"),Z;return J(Q)}}var bY={name:"characterReference",tokenize:I60};function I60($,Z,J){let H=this,B=0,Q,X;return z;function z(Y){return $.enter("characterReference"),$.enter("characterReferenceMarker"),$.consume(Y),$.exit("characterReferenceMarker"),G}function G(Y){if(Y===35)return $.enter("characterReferenceMarkerNumeric"),$.consume(Y),$.exit("characterReferenceMarkerNumeric"),K;return $.enter("characterReferenceValue"),Q=31,X=r5,U(Y)}function K(Y){if(Y===88||Y===120)return $.enter("characterReferenceMarkerHexadecimal"),$.consume(Y),$.exit("characterReferenceMarkerHexadecimal"),$.enter("characterReferenceValue"),Q=6,X=Ug,U;return $.enter("characterReferenceValue"),Q=7,X=HQ,U(Y)}function U(Y){if(Y===59&&B){let F=$.exit("characterReferenceValue");if(X===r5&&!VJ(H.sliceSerialize(F)))return J(Y);return $.enter("characterReferenceMarker"),$.consume(Y),$.exit("characterReferenceMarker"),$.exit("characterReference"),Z}if(X(Y)&&B++<Q)return $.consume(Y),U;return J(Y)}}var Vg={partial:!0,tokenize:b60},kY={concrete:!0,name:"codeFenced",tokenize:R60};function R60($,Z,J){let H=this,B={partial:!0,tokenize:M},Q=0,X=0,z;return G;function G(P){return K(P)}function K(P){let w=H.events[H.events.length-1];return Q=w&&w[1].type==="linePrefix"?w[2].sliceSerialize(w[1],!0).length:0,z=P,$.enter("codeFenced"),$.enter("codeFencedFence"),$.enter("codeFencedFenceSequence"),U(P)}function U(P){if(P===z)return X++,$.consume(P),U;if(X<3)return J(P);return $.exit("codeFencedFenceSequence"),H1(P)?e0($,Y,"whitespace")(P):Y(P)}function Y(P){if(P===null||u0(P))return $.exit("codeFencedFence"),H.interrupt?Z(P):$.check(Vg,N,j)(P);return $.enter("codeFencedFenceInfo"),$.enter("chunkString",{contentType:"string"}),F(P)}function F(P){if(P===null||u0(P))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),Y(P);if(H1(P))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),e0($,W,"whitespace")(P);if(P===96&&P===z)return J(P);return $.consume(P),F}function W(P){if(P===null||u0(P))return Y(P);return $.enter("codeFencedFenceMeta"),$.enter("chunkString",{contentType:"string"}),q(P)}function q(P){if(P===null||u0(P))return $.exit("chunkString"),$.exit("codeFencedFenceMeta"),Y(P);if(P===96&&P===z)return J(P);return $.consume(P),q}function N(P){return $.attempt(B,j,A)(P)}function A(P){return $.enter("lineEnding"),$.consume(P),$.exit("lineEnding"),V}function V(P){return Q>0&&H1(P)?e0($,D,"linePrefix",Q+1)(P):D(P)}function D(P){if(P===null||u0(P))return $.check(Vg,N,j)(P);return $.enter("codeFlowValue"),L(P)}function L(P){if(P===null||u0(P))return $.exit("codeFlowValue"),D(P);return $.consume(P),L}function j(P){return $.exit("codeFenced"),Z(P)}function M(P,w,C){let R=0;return O;function O(b){return P.enter("lineEnding"),P.consume(b),P.exit("lineEnding"),S}function S(b){return P.enter("codeFencedFence"),H1(b)?e0(P,y,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):y(b)}function y(b){if(b===z)return P.enter("codeFencedFenceSequence"),k(b);return C(b)}function k(b){if(b===z)return R++,P.consume(b),k;if(R>=X)return P.exit("codeFencedFenceSequence"),H1(b)?e0(P,T,"whitespace")(b):T(b);return C(b)}function T(b){if(b===null||u0(b))return P.exit("codeFencedFence"),w(b);return C(b)}}}function b60($,Z,J){let H=this;return B;function B(X){if(X===null)return J(X);return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Q}function Q(X){return H.parser.lazy[H.now().line]?J(X):Z(X)}}var QQ={name:"codeIndented",tokenize:y60},k60={partial:!0,tokenize:x60};function y60($,Z,J){let H=this;return B;function B(K){return $.enter("codeIndented"),e0($,Q,"linePrefix",5)(K)}function Q(K){let U=H.events[H.events.length-1];return U&&U[1].type==="linePrefix"&&U[2].sliceSerialize(U[1],!0).length>=4?X(K):J(K)}function X(K){if(K===null)return G(K);if(u0(K))return $.attempt(k60,X,G)(K);return $.enter("codeFlowValue"),z(K)}function z(K){if(K===null||u0(K))return $.exit("codeFlowValue"),X(K);return $.consume(K),z}function G(K){return $.exit("codeIndented"),Z(K)}}function x60($,Z,J){let H=this;return B;function B(X){if(H.parser.lazy[H.now().line])return J(X);if(u0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),B;return e0($,Q,"linePrefix",5)(X)}function Q(X){let z=H.events[H.events.length-1];return z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4?Z(X):u0(X)?B(X):J(X)}}var lD={name:"codeText",previous:v60,resolve:h60,tokenize:g60};function h60($){let Z=$.length-4,J=3,H,B;if(($[J][1].type==="lineEnding"||$[J][1].type==="space")&&($[Z][1].type==="lineEnding"||$[Z][1].type==="space")){H=J;while(++H<Z)if($[H][1].type==="codeTextData"){$[J][1].type="codeTextPadding",$[Z][1].type="codeTextPadding",J+=2,Z-=2;break}}H=J-1,Z++;while(++H<=Z)if(B===void 0){if(H!==Z&&$[H][1].type!=="lineEnding")B=H}else if(H===Z||$[H][1].type==="lineEnding"){if($[B][1].type="codeTextData",H!==B+2)$[B][1].end=$[H-1][1].end,$.splice(B+2,H-B-2),Z-=H-B-2,H=B+2;B=void 0}return $}function v60($){return $!==96||this.events[this.events.length-1][1].type==="characterEscape"}function g60($,Z,J){let H=this,B=0,Q,X;return z;function z(F){return $.enter("codeText"),$.enter("codeTextSequence"),G(F)}function G(F){if(F===96)return $.consume(F),B++,G;return $.exit("codeTextSequence"),K(F)}function K(F){if(F===null)return J(F);if(F===32)return $.enter("space"),$.consume(F),$.exit("space"),K;if(F===96)return X=$.enter("codeTextSequence"),Q=0,Y(F);if(u0(F))return $.enter("lineEnding"),$.consume(F),$.exit("lineEnding"),K;return $.enter("codeTextData"),U(F)}function U(F){if(F===null||F===32||F===96||u0(F))return $.exit("codeTextData"),K(F);return $.consume(F),U}function Y(F){if(F===96)return $.consume(F),Q++,Y;if(Q===B)return $.exit("codeTextSequence"),$.exit("codeText"),Z(F);return X.type="codeTextData",U(F)}}class iD{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 H=Z||0;this.setCursor(Math.trunc($));let B=this.right.splice(this.right.length-H,Number.POSITIVE_INFINITY);if(J)XQ(this.left,J);return B.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push($){this.setCursor(Number.POSITIVE_INFINITY),this.left.push($)}pushMany($){this.setCursor(Number.POSITIVE_INFINITY),XQ(this.left,$)}unshift($){this.setCursor(0),this.right.push($)}unshiftMany($){this.setCursor(0),XQ(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);XQ(this.right,Z.reverse())}else{let Z=this.right.splice(this.left.length+this.right.length-$,Number.POSITIVE_INFINITY);XQ(this.left,Z.reverse())}}}function XQ($,Z){let J=0;if(Z.length<1e4)$.push(...Z);else while(J<Z.length)$.push(...Z.slice(J,J+1e4)),J+=1e4}function yY($){let Z={},J=-1,H,B,Q,X,z,G,K,U=new iD($);while(++J<U.length){while(J in Z)J=Z[J];if(H=U.get(J),J&&H[1].type==="chunkFlow"&&U.get(J-1)[1].type==="listItemPrefix"){if(G=H[1]._tokenizer.events,Q=0,Q<G.length&&G[Q][1].type==="lineEndingBlank")Q+=2;if(Q<G.length&&G[Q][1].type==="content")while(++Q<G.length){if(G[Q][1].type==="content")break;if(G[Q][1].type==="chunkText")G[Q][1]._isInFirstContentOfListItem=!0,Q++}}if(H[0]==="enter"){if(H[1].contentType)Object.assign(Z,f60(U,J)),J=Z[J],K=!0}else if(H[1]._container){Q=J,B=void 0;while(Q--)if(X=U.get(Q),X[1].type==="lineEnding"||X[1].type==="lineEndingBlank"){if(X[0]==="enter"){if(B)U.get(B)[1].type="lineEndingBlank";X[1].type="lineEnding",B=Q}}else if(X[1].type==="linePrefix"||X[1].type==="listItemIndent");else break;if(B)H[1].end={...U.get(B)[1].start},z=U.slice(B,J),z.unshift(H),U.splice(B,J-B+1,z)}}return e5($,0,Number.POSITIVE_INFINITY,U.slice(0)),!K}function f60($,Z){let J=$.get(Z)[1],H=$.get(Z)[2],B=Z-1,Q=[],X=J._tokenizer;if(!X){if(X=H.parser[J.contentType](J.start),J._contentTypeTextTrailing)X._contentTypeTextTrailing=!0}let z=X.events,G=[],K={},U,Y,F=-1,W=J,q=0,N=0,A=[N];while(W){while($.get(++B)[1]!==W);if(Q.push(B),!W._tokenizer){if(U=H.sliceStream(W),!W.next)U.push(null);if(Y)X.defineSkip(W.start);if(W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=!0;if(X.write(U),W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=void 0}Y=W,W=W.next}W=J;while(++F<z.length)if(z[F][0]==="exit"&&z[F-1][0]==="enter"&&z[F][1].type===z[F-1][1].type&&z[F][1].start.line!==z[F][1].end.line)N=F+1,A.push(N),W._tokenizer=void 0,W.previous=void 0,W=W.next;if(X.events=[],W)W._tokenizer=void 0,W.previous=void 0;else A.pop();F=A.length;while(F--){let V=z.slice(A[F],A[F+1]),D=Q.pop();G.push([D,D+V.length-1]),$.splice(D,2,V)}G.reverse(),F=-1;while(++F<G.length)K[q+G[F][0]]=q+G[F][1],q+=G[F][1]-G[F][0]-1;return K}var rD={resolve:u60,tokenize:p60},m60={partial:!0,tokenize:c60};function u60($){return yY($),$}function p60($,Z){let J;return H;function H(z){return $.enter("content"),J=$.enter("chunkContent",{contentType:"content"}),B(z)}function B(z){if(z===null)return Q(z);if(u0(z))return $.check(m60,X,Q)(z);return $.consume(z),B}function Q(z){return $.exit("chunkContent"),$.exit("content"),Z(z)}function X(z){return $.consume(z),$.exit("chunkContent"),J.next=$.enter("chunkContent",{contentType:"content",previous:J}),J=J.next,B}}function c60($,Z,J){let H=this;return B;function B(X){return $.exit("chunkContent"),$.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),e0($,Q,"linePrefix")}function Q(X){if(X===null||u0(X))return J(X);let z=H.events[H.events.length-1];if(!H.parser.constructs.disable.null.includes("codeIndented")&&z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4)return Z(X);return $.interrupt(H.parser.constructs.flow,J,Z)(X)}}function xY($,Z,J,H,B,Q,X,z,G){let K=G||Number.POSITIVE_INFINITY,U=0;return Y;function Y(V){if(V===60)return $.enter(H),$.enter(B),$.enter(Q),$.consume(V),$.exit(Q),F;if(V===null||V===32||V===41||W$(V))return J(V);return $.enter(H),$.enter(X),$.enter(z),$.enter("chunkString",{contentType:"string"}),N(V)}function F(V){if(V===62)return $.enter(Q),$.consume(V),$.exit(Q),$.exit(B),$.exit(H),Z;return $.enter(z),$.enter("chunkString",{contentType:"string"}),W(V)}function W(V){if(V===62)return $.exit("chunkString"),$.exit(z),F(V);if(V===null||V===60||u0(V))return J(V);return $.consume(V),V===92?q:W}function q(V){if(V===60||V===62||V===92)return $.consume(V),W;return W(V)}function N(V){if(!U&&(V===null||V===41||x1(V)))return $.exit("chunkString"),$.exit(z),$.exit(X),$.exit(H),Z(V);if(U<K&&V===40)return $.consume(V),U++,N;if(V===41)return $.consume(V),U--,N;if(V===null||V===32||V===40||W$(V))return J(V);return $.consume(V),V===92?A:N}function A(V){if(V===40||V===41||V===92)return $.consume(V),N;return N(V)}}function hY($,Z,J,H,B,Q){let X=this,z=0,G;return K;function K(W){return $.enter(H),$.enter(B),$.consume(W),$.exit(B),$.enter(Q),U}function U(W){if(z>999||W===null||W===91||W===93&&!G||W===94&&!z&&"_hiddenFootnoteSupport"in X.parser.constructs)return J(W);if(W===93)return $.exit(Q),$.enter(B),$.consume(W),$.exit(B),$.exit(H),Z;if(u0(W))return $.enter("lineEnding"),$.consume(W),$.exit("lineEnding"),U;return $.enter("chunkString",{contentType:"string"}),Y(W)}function Y(W){if(W===null||W===91||W===93||u0(W)||z++>999)return $.exit("chunkString"),U(W);if($.consume(W),!G)G=!H1(W);return W===92?F:Y}function F(W){if(W===91||W===92||W===93)return $.consume(W),z++,Y;return Y(W)}}function vY($,Z,J,H,B,Q){let X;return z;function z(F){if(F===34||F===39||F===40)return $.enter(H),$.enter(B),$.consume(F),$.exit(B),X=F===40?41:F,G;return J(F)}function G(F){if(F===X)return $.enter(B),$.consume(F),$.exit(B),$.exit(H),Z;return $.enter(Q),K(F)}function K(F){if(F===X)return $.exit(Q),G(X);if(F===null)return J(F);if(u0(F))return $.enter("lineEnding"),$.consume(F),$.exit("lineEnding"),e0($,K,"linePrefix");return $.enter("chunkString",{contentType:"string"}),U(F)}function U(F){if(F===X||F===null||u0(F))return $.exit("chunkString"),K(F);return $.consume(F),F===92?Y:U}function Y(F){if(F===X||F===92)return $.consume(F),U;return U(F)}}function N$($,Z){let J;return H;function H(B){if(u0(B))return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),J=!0,H;if(H1(B))return e0($,H,J?"linePrefix":"lineSuffix")(B);return Z(B)}}var aD={name:"definition",tokenize:l60},d60={partial:!0,tokenize:i60};function l60($,Z,J){let H=this,B;return Q;function Q(W){return $.enter("definition"),X(W)}function X(W){return hY.call(H,$,z,J,"definitionLabel","definitionLabelMarker","definitionLabelString")(W)}function z(W){if(B=Q4(H.sliceSerialize(H.events[H.events.length-1][1]).slice(1,-1)),W===58)return $.enter("definitionMarker"),$.consume(W),$.exit("definitionMarker"),G;return J(W)}function G(W){return x1(W)?N$($,K)(W):K(W)}function K(W){return xY($,U,J,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(W)}function U(W){return $.attempt(d60,Y,Y)(W)}function Y(W){return H1(W)?e0($,F,"whitespace")(W):F(W)}function F(W){if(W===null||u0(W))return $.exit("definition"),H.parser.defined.push(B),Z(W);return J(W)}}function i60($,Z,J){return H;function H(z){return x1(z)?N$($,B)(z):J(z)}function B(z){return vY($,Q,J,"definitionTitle","definitionTitleMarker","definitionTitleString")(z)}function Q(z){return H1(z)?e0($,X,"whitespace")(z):X(z)}function X(z){return z===null||u0(z)?Z(z):J(z)}}var oD={name:"hardBreakEscape",tokenize:r60};function r60($,Z,J){return H;function H(Q){return $.enter("hardBreakEscape"),$.consume(Q),B}function B(Q){if(u0(Q))return $.exit("hardBreakEscape"),Z(Q);return J(Q)}}var nD={name:"headingAtx",resolve:a60,tokenize:o60};function a60($,Z){let J=$.length-2,H=3,B,Q;if($[H][1].type==="whitespace")H+=2;if(J-2>H&&$[J][1].type==="whitespace")J-=2;if($[J][1].type==="atxHeadingSequence"&&(H===J-1||J-4>H&&$[J-2][1].type==="whitespace"))J-=H+1===J?2:4;if(J>H)B={type:"atxHeadingText",start:$[H][1].start,end:$[J][1].end},Q={type:"chunkText",start:$[H][1].start,end:$[J][1].end,contentType:"text"},e5($,H,J-H+1,[["enter",B,Z],["enter",Q,Z],["exit",Q,Z],["exit",B,Z]]);return $}function o60($,Z,J){let H=0;return B;function B(U){return $.enter("atxHeading"),Q(U)}function Q(U){return $.enter("atxHeadingSequence"),X(U)}function X(U){if(U===35&&H++<6)return $.consume(U),X;if(U===null||x1(U))return $.exit("atxHeadingSequence"),z(U);return J(U)}function z(U){if(U===35)return $.enter("atxHeadingSequence"),G(U);if(U===null||u0(U))return $.exit("atxHeading"),Z(U);if(H1(U))return e0($,z,"whitespace")(U);return $.enter("atxHeadingText"),K(U)}function G(U){if(U===35)return $.consume(U),G;return $.exit("atxHeadingSequence"),z(U)}function K(U){if(U===null||U===35||x1(U))return $.exit("atxHeadingText"),z(U);return $.consume(U),K}}var Ag=["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"],sD=["pre","script","style","textarea"];var tD={concrete:!0,name:"htmlFlow",resolveTo:t60,tokenize:e60},n60={partial:!0,tokenize:Z70},s60={partial:!0,tokenize:$70};function t60($){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 e60($,Z,J){let H=this,B,Q,X,z,G;return K;function K(x){return U(x)}function U(x){return $.enter("htmlFlow"),$.enter("htmlFlowData"),$.consume(x),Y}function Y(x){if(x===33)return $.consume(x),F;if(x===47)return $.consume(x),Q=!0,N;if(x===63)return $.consume(x),B=3,H.interrupt?Z:E;if(F2(x))return $.consume(x),X=String.fromCharCode(x),A;return J(x)}function F(x){if(x===45)return $.consume(x),B=2,W;if(x===91)return $.consume(x),B=5,z=0,q;if(F2(x))return $.consume(x),B=4,H.interrupt?Z:E;return J(x)}function W(x){if(x===45)return $.consume(x),H.interrupt?Z:E;return J(x)}function q(x){if(x==="CDATA[".charCodeAt(z++)){if($.consume(x),z===6)return H.interrupt?Z:y;return q}return J(x)}function N(x){if(F2(x))return $.consume(x),X=String.fromCharCode(x),A;return J(x)}function A(x){if(x===null||x===47||x===62||x1(x)){let l=x===47,o=X.toLowerCase();if(!l&&!Q&&sD.includes(o))return B=1,H.interrupt?Z(x):y(x);if(Ag.includes(X.toLowerCase())){if(B=6,l)return $.consume(x),V;return H.interrupt?Z(x):y(x)}return B=7,H.interrupt&&!H.parser.lazy[H.now().line]?J(x):Q?D(x):L(x)}if(x===45||r5(x))return $.consume(x),X+=String.fromCharCode(x),A;return J(x)}function V(x){if(x===62)return $.consume(x),H.interrupt?Z:y;return J(x)}function D(x){if(H1(x))return $.consume(x),D;return O(x)}function L(x){if(x===47)return $.consume(x),O;if(x===58||x===95||F2(x))return $.consume(x),j;if(H1(x))return $.consume(x),L;return O(x)}function j(x){if(x===45||x===46||x===58||x===95||r5(x))return $.consume(x),j;return M(x)}function M(x){if(x===61)return $.consume(x),P;if(H1(x))return $.consume(x),M;return L(x)}function P(x){if(x===null||x===60||x===61||x===62||x===96)return J(x);if(x===34||x===39)return $.consume(x),G=x,w;if(H1(x))return $.consume(x),P;return C(x)}function w(x){if(x===G)return $.consume(x),G=null,R;if(x===null||u0(x))return J(x);return $.consume(x),w}function C(x){if(x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||x1(x))return M(x);return $.consume(x),C}function R(x){if(x===47||x===62||H1(x))return L(x);return J(x)}function O(x){if(x===62)return $.consume(x),S;return J(x)}function S(x){if(x===null||u0(x))return y(x);if(H1(x))return $.consume(x),S;return J(x)}function y(x){if(x===45&&B===2)return $.consume(x),I;if(x===60&&B===1)return $.consume(x),v;if(x===62&&B===4)return $.consume(x),i;if(x===63&&B===3)return $.consume(x),E;if(x===93&&B===5)return $.consume(x),f;if(u0(x)&&(B===6||B===7))return $.exit("htmlFlowData"),$.check(n60,r,k)(x);if(x===null||u0(x))return $.exit("htmlFlowData"),k(x);return $.consume(x),y}function k(x){return $.check(s60,T,r)(x)}function T(x){return $.enter("lineEnding"),$.consume(x),$.exit("lineEnding"),b}function b(x){if(x===null||u0(x))return k(x);return $.enter("htmlFlowData"),y(x)}function I(x){if(x===45)return $.consume(x),E;return y(x)}function v(x){if(x===47)return $.consume(x),X="",h;return y(x)}function h(x){if(x===62){let l=X.toLowerCase();if(sD.includes(l))return $.consume(x),i;return y(x)}if(F2(x)&&X.length<8)return $.consume(x),X+=String.fromCharCode(x),h;return y(x)}function f(x){if(x===93)return $.consume(x),E;return y(x)}function E(x){if(x===62)return $.consume(x),i;if(x===45&&B===2)return $.consume(x),E;return y(x)}function i(x){if(x===null||u0(x))return $.exit("htmlFlowData"),r(x);return $.consume(x),i}function r(x){return $.exit("htmlFlow"),Z(x)}}function $70($,Z,J){let H=this;return B;function B(X){if(u0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Q;return J(X)}function Q(X){return H.parser.lazy[H.now().line]?J(X):Z(X)}}function Z70($,Z,J){return H;function H(B){return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),$.attempt(r9,Z,J)}}var eD={name:"htmlText",tokenize:J70};function J70($,Z,J){let H=this,B,Q,X;return z;function z(E){return $.enter("htmlText"),$.enter("htmlTextData"),$.consume(E),G}function G(E){if(E===33)return $.consume(E),K;if(E===47)return $.consume(E),M;if(E===63)return $.consume(E),L;if(F2(E))return $.consume(E),C;return J(E)}function K(E){if(E===45)return $.consume(E),U;if(E===91)return $.consume(E),Q=0,q;if(F2(E))return $.consume(E),D;return J(E)}function U(E){if(E===45)return $.consume(E),W;return J(E)}function Y(E){if(E===null)return J(E);if(E===45)return $.consume(E),F;if(u0(E))return X=Y,v(E);return $.consume(E),Y}function F(E){if(E===45)return $.consume(E),W;return Y(E)}function W(E){return E===62?I(E):E===45?F(E):Y(E)}function q(E){if(E==="CDATA[".charCodeAt(Q++))return $.consume(E),Q===6?N:q;return J(E)}function N(E){if(E===null)return J(E);if(E===93)return $.consume(E),A;if(u0(E))return X=N,v(E);return $.consume(E),N}function A(E){if(E===93)return $.consume(E),V;return N(E)}function V(E){if(E===62)return I(E);if(E===93)return $.consume(E),V;return N(E)}function D(E){if(E===null||E===62)return I(E);if(u0(E))return X=D,v(E);return $.consume(E),D}function L(E){if(E===null)return J(E);if(E===63)return $.consume(E),j;if(u0(E))return X=L,v(E);return $.consume(E),L}function j(E){return E===62?I(E):L(E)}function M(E){if(F2(E))return $.consume(E),P;return J(E)}function P(E){if(E===45||r5(E))return $.consume(E),P;return w(E)}function w(E){if(u0(E))return X=w,v(E);if(H1(E))return $.consume(E),w;return I(E)}function C(E){if(E===45||r5(E))return $.consume(E),C;if(E===47||E===62||x1(E))return R(E);return J(E)}function R(E){if(E===47)return $.consume(E),I;if(E===58||E===95||F2(E))return $.consume(E),O;if(u0(E))return X=R,v(E);if(H1(E))return $.consume(E),R;return I(E)}function O(E){if(E===45||E===46||E===58||E===95||r5(E))return $.consume(E),O;return S(E)}function S(E){if(E===61)return $.consume(E),y;if(u0(E))return X=S,v(E);if(H1(E))return $.consume(E),S;return R(E)}function y(E){if(E===null||E===60||E===61||E===62||E===96)return J(E);if(E===34||E===39)return $.consume(E),B=E,k;if(u0(E))return X=y,v(E);if(H1(E))return $.consume(E),y;return $.consume(E),T}function k(E){if(E===B)return $.consume(E),B=void 0,b;if(E===null)return J(E);if(u0(E))return X=k,v(E);return $.consume(E),k}function T(E){if(E===null||E===34||E===39||E===60||E===61||E===96)return J(E);if(E===47||E===62||x1(E))return R(E);return $.consume(E),T}function b(E){if(E===47||E===62||x1(E))return R(E);return J(E)}function I(E){if(E===62)return $.consume(E),$.exit("htmlTextData"),$.exit("htmlText"),Z;return J(E)}function v(E){return $.exit("htmlTextData"),$.enter("lineEnding"),$.consume(E),$.exit("lineEnding"),h}function h(E){return H1(E)?e0($,f,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):f(E)}function f(E){return $.enter("htmlTextData"),X(E)}}var V$={name:"labelEnd",resolveAll:X70,resolveTo:z70,tokenize:G70},H70={tokenize:K70},B70={tokenize:U70},Q70={tokenize:Y70};function X70($){let Z=-1,J=[];while(++Z<$.length){let H=$[Z][1];if(J.push($[Z]),H.type==="labelImage"||H.type==="labelLink"||H.type==="labelEnd"){let B=H.type==="labelImage"?4:2;H.type="data",Z+=B}}if($.length!==J.length)e5($,0,$.length,J);return $}function z70($,Z){let J=$.length,H=0,B,Q,X,z;while(J--)if(B=$[J][1],Q){if(B.type==="link"||B.type==="labelLink"&&B._inactive)break;if($[J][0]==="enter"&&B.type==="labelLink")B._inactive=!0}else if(X){if($[J][0]==="enter"&&(B.type==="labelImage"||B.type==="labelLink")&&!B._balanced){if(Q=J,B.type!=="labelLink"){H=2;break}}}else if(B.type==="labelEnd")X=J;let G={type:$[Q][1].type==="labelLink"?"link":"image",start:{...$[Q][1].start},end:{...$[$.length-1][1].end}},K={type:"label",start:{...$[Q][1].start},end:{...$[X][1].end}},U={type:"labelText",start:{...$[Q+H+2][1].end},end:{...$[X-2][1].start}};return z=[["enter",G,Z],["enter",K,Z]],z=P4(z,$.slice(Q+1,Q+H+3)),z=P4(z,[["enter",U,Z]]),z=P4(z,u6(Z.parser.constructs.insideSpan.null,$.slice(Q+H+4,X-3),Z)),z=P4(z,[["exit",U,Z],$[X-2],$[X-1],["exit",K,Z]]),z=P4(z,$.slice(X+1)),z=P4(z,[["exit",G,Z]]),e5($,Q,$.length,z),$}function G70($,Z,J){let H=this,B=H.events.length,Q,X;while(B--)if((H.events[B][1].type==="labelImage"||H.events[B][1].type==="labelLink")&&!H.events[B][1]._balanced){Q=H.events[B][1];break}return z;function z(F){if(!Q)return J(F);if(Q._inactive)return Y(F);return X=H.parser.defined.includes(Q4(H.sliceSerialize({start:Q.end,end:H.now()}))),$.enter("labelEnd"),$.enter("labelMarker"),$.consume(F),$.exit("labelMarker"),$.exit("labelEnd"),G}function G(F){if(F===40)return $.attempt(H70,U,X?U:Y)(F);if(F===91)return $.attempt(B70,U,X?K:Y)(F);return X?U(F):Y(F)}function K(F){return $.attempt(Q70,U,Y)(F)}function U(F){return Z(F)}function Y(F){return Q._balanced=!0,J(F)}}function K70($,Z,J){return H;function H(Y){return $.enter("resource"),$.enter("resourceMarker"),$.consume(Y),$.exit("resourceMarker"),B}function B(Y){return x1(Y)?N$($,Q)(Y):Q(Y)}function Q(Y){if(Y===41)return U(Y);return xY($,X,z,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(Y)}function X(Y){return x1(Y)?N$($,G)(Y):U(Y)}function z(Y){return J(Y)}function G(Y){if(Y===34||Y===39||Y===40)return vY($,K,J,"resourceTitle","resourceTitleMarker","resourceTitleString")(Y);return U(Y)}function K(Y){return x1(Y)?N$($,U)(Y):U(Y)}function U(Y){if(Y===41)return $.enter("resourceMarker"),$.consume(Y),$.exit("resourceMarker"),$.exit("resource"),Z;return J(Y)}}function U70($,Z,J){let H=this;return B;function B(z){return hY.call(H,$,Q,X,"reference","referenceMarker","referenceString")(z)}function Q(z){return H.parser.defined.includes(Q4(H.sliceSerialize(H.events[H.events.length-1][1]).slice(1,-1)))?Z(z):J(z)}function X(z){return J(z)}}function Y70($,Z,J){return H;function H(Q){return $.enter("reference"),$.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),B}function B(Q){if(Q===93)return $.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),$.exit("reference"),Z;return J(Q)}}var $L={name:"labelStartImage",resolveAll:V$.resolveAll,tokenize:F70};function F70($,Z,J){let H=this;return B;function B(z){return $.enter("labelImage"),$.enter("labelImageMarker"),$.consume(z),$.exit("labelImageMarker"),Q}function Q(z){if(z===91)return $.enter("labelMarker"),$.consume(z),$.exit("labelMarker"),$.exit("labelImage"),X;return J(z)}function X(z){return z===94&&"_hiddenFootnoteSupport"in H.parser.constructs?J(z):Z(z)}}var ZL={name:"labelStartLink",resolveAll:V$.resolveAll,tokenize:W70};function W70($,Z,J){let H=this;return B;function B(X){return $.enter("labelLink"),$.enter("labelMarker"),$.consume(X),$.exit("labelMarker"),$.exit("labelLink"),Q}function Q(X){return X===94&&"_hiddenFootnoteSupport"in H.parser.constructs?J(X):Z(X)}}var zQ={name:"lineEnding",tokenize:q70};function q70($,Z){return J;function J(H){return $.enter("lineEnding"),$.consume(H),$.exit("lineEnding"),e0($,Z,"linePrefix")}}var A$={name:"thematicBreak",tokenize:N70};function N70($,Z,J){let H=0,B;return Q;function Q(K){return $.enter("thematicBreak"),X(K)}function X(K){return B=K,z(K)}function z(K){if(K===B)return $.enter("thematicBreakSequence"),G(K);if(H>=3&&(K===null||u0(K)))return $.exit("thematicBreak"),Z(K);return J(K)}function G(K){if(K===B)return $.consume(K),H++,G;return $.exit("thematicBreakSequence"),H1(K)?e0($,z,"whitespace")(K):z(K)}}var X4={continuation:{tokenize:L70},exit:P70,name:"list",tokenize:D70},V70={partial:!0,tokenize:_70},A70={partial:!0,tokenize:M70};function D70($,Z,J){let H=this,B=H.events[H.events.length-1],Q=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,X=0;return z;function z(W){let q=H.containerState.type||(W===42||W===43||W===45?"listUnordered":"listOrdered");if(q==="listUnordered"?!H.containerState.marker||W===H.containerState.marker:HQ(W)){if(!H.containerState.type)H.containerState.type=q,$.enter(q,{_container:!0});if(q==="listUnordered")return $.enter("listItemPrefix"),W===42||W===45?$.check(A$,J,K)(W):K(W);if(!H.interrupt||W===49)return $.enter("listItemPrefix"),$.enter("listItemValue"),G(W)}return J(W)}function G(W){if(HQ(W)&&++X<10)return $.consume(W),G;if((!H.interrupt||X<2)&&(H.containerState.marker?W===H.containerState.marker:W===41||W===46))return $.exit("listItemValue"),K(W);return J(W)}function K(W){return $.enter("listItemMarker"),$.consume(W),$.exit("listItemMarker"),H.containerState.marker=H.containerState.marker||W,$.check(r9,H.interrupt?J:U,$.attempt(V70,F,Y))}function U(W){return H.containerState.initialBlankLine=!0,Q++,F(W)}function Y(W){if(H1(W))return $.enter("listItemPrefixWhitespace"),$.consume(W),$.exit("listItemPrefixWhitespace"),F;return J(W)}function F(W){return H.containerState.size=Q+H.sliceSerialize($.exit("listItemPrefix"),!0).length,Z(W)}}function L70($,Z,J){let H=this;return H.containerState._closeFlow=void 0,$.check(r9,B,Q);function B(z){return H.containerState.furtherBlankLines=H.containerState.furtherBlankLines||H.containerState.initialBlankLine,e0($,Z,"listItemIndent",H.containerState.size+1)(z)}function Q(z){if(H.containerState.furtherBlankLines||!H1(z))return H.containerState.furtherBlankLines=void 0,H.containerState.initialBlankLine=void 0,X(z);return H.containerState.furtherBlankLines=void 0,H.containerState.initialBlankLine=void 0,$.attempt(A70,Z,X)(z)}function X(z){return H.containerState._closeFlow=!0,H.interrupt=void 0,e0($,$.attempt(X4,Z,J),"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z)}}function M70($,Z,J){let H=this;return e0($,B,"listItemIndent",H.containerState.size+1);function B(Q){let X=H.events[H.events.length-1];return X&&X[1].type==="listItemIndent"&&X[2].sliceSerialize(X[1],!0).length===H.containerState.size?Z(Q):J(Q)}}function P70($){$.exit(this.containerState.type)}function _70($,Z,J){let H=this;return e0($,B,"listItemPrefixWhitespace",H.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function B(Q){let X=H.events[H.events.length-1];return!H1(Q)&&X&&X[1].type==="listItemPrefixWhitespace"?Z(Q):J(Q)}}var gY={name:"setextUnderline",resolveTo:j70,tokenize:O70};function j70($,Z){let J=$.length,H,B,Q;while(J--)if($[J][0]==="enter"){if($[J][1].type==="content"){H=J;break}if($[J][1].type==="paragraph")B=J}else{if($[J][1].type==="content")$.splice(J,1);if(!Q&&$[J][1].type==="definition")Q=J}let X={type:"setextHeading",start:{...$[H][1].start},end:{...$[$.length-1][1].end}};if($[B][1].type="setextHeadingText",Q)$.splice(B,0,["enter",X,Z]),$.splice(Q+1,0,["exit",$[H][1],Z]),$[H][1].end={...$[Q][1].end};else $[H][1]=X;return $.push(["exit",X,Z]),$}function O70($,Z,J){let H=this,B;return Q;function Q(K){let U=H.events.length,Y;while(U--)if(H.events[U][1].type!=="lineEnding"&&H.events[U][1].type!=="linePrefix"&&H.events[U][1].type!=="content"){Y=H.events[U][1].type==="paragraph";break}if(!H.parser.lazy[H.now().line]&&(H.interrupt||Y))return $.enter("setextHeadingLine"),B=K,X(K);return J(K)}function X(K){return $.enter("setextHeadingLineSequence"),z(K)}function z(K){if(K===B)return $.consume(K),z;return $.exit("setextHeadingLineSequence"),H1(K)?e0($,G,"lineSuffix")(K):G(K)}function G(K){if(K===null||u0(K))return $.exit("setextHeadingLine"),Z(K);return J(K)}}var Dg={tokenize:T70};function T70($){let Z=this,J=$.attempt(r9,H,$.attempt(this.parser.constructs.flowInitial,B,e0($,$.attempt(this.parser.constructs.flow,B,$.attempt(rD,B)),"linePrefix")));return J;function H(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEndingBlank"),$.consume(Q),$.exit("lineEndingBlank"),Z.currentConstruct=void 0,J}function B(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEnding"),$.consume(Q),$.exit("lineEnding"),Z.currentConstruct=void 0,J}}var Lg={resolveAll:jg()},Mg=_g("string"),Pg=_g("text");function _g($){return{resolveAll:jg($==="text"?C70:void 0),tokenize:Z};function Z(J){let H=this,B=this.parser.constructs[$],Q=J.attempt(B,X,z);return X;function X(U){return K(U)?Q(U):z(U)}function z(U){if(U===null){J.consume(U);return}return J.enter("data"),J.consume(U),G}function G(U){if(K(U))return J.exit("data"),Q(U);return J.consume(U),G}function K(U){if(U===null)return!0;let Y=B[U],F=-1;if(Y)while(++F<Y.length){let W=Y[F];if(!W.previous||W.previous.call(H,H.previous))return!0}return!1}}}function jg($){return Z;function Z(J,H){let B=-1,Q;while(++B<=J.length)if(Q===void 0){if(J[B]&&J[B][1].type==="data")Q=B,B++}else if(!J[B]||J[B][1].type!=="data"){if(B!==Q+2)J[Q][1].end=J[B-1][1].end,J.splice(Q+2,B-Q-2),B=Q+2;Q=void 0}return $?$(J,H):J}}function C70($,Z){let J=0;while(++J<=$.length)if((J===$.length||$[J][1].type==="lineEnding")&&$[J-1][1].type==="data"){let H=$[J-1][1],B=Z.sliceStream(H),Q=B.length,X=-1,z=0,G;while(Q--){let K=B[Q];if(typeof K==="string"){X=K.length;while(K.charCodeAt(X-1)===32)z++,X--;if(X)break;X=-1}else if(K===-2)G=!0,z++;else if(K===-1);else{Q++;break}}if(Z._contentTypeTextTrailing&&J===$.length)z=0;if(z){let K={type:J===$.length||G||z<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:Q?X:H.start._bufferIndex+X,_index:H.start._index+Q,line:H.end.line,column:H.end.column-z,offset:H.end.offset-z},end:{...H.end}};if(H.end={...K.start},H.start.offset===H.end.offset)Object.assign(H,K);else $.splice(J,0,["enter",K,Z],["exit",K,Z]),J+=2}J++}return $}var JL={};I5(JL,{text:()=>b70,string:()=>R70,insideSpan:()=>k70,flowInitial:()=>S70,flow:()=>I70,document:()=>E70,disable:()=>x70,contentInitial:()=>w70,attentionMarkers:()=>y70});var E70={[42]:X4,[43]:X4,[45]:X4,[48]:X4,[49]:X4,[50]:X4,[51]:X4,[52]:X4,[53]:X4,[54]:X4,[55]:X4,[56]:X4,[57]:X4,[62]:IY},w70={[91]:aD},S70={[-2]:QQ,[-1]:QQ,[32]:QQ},I70={[35]:nD,[42]:A$,[45]:[gY,A$],[60]:tD,[61]:gY,[95]:A$,[96]:kY,[126]:kY},R70={[38]:bY,[92]:RY},b70={[-5]:zQ,[-4]:zQ,[-3]:zQ,[33]:$L,[38]:bY,[42]:BQ,[60]:[dD,eD],[91]:ZL,[92]:[oD,RY],[93]:V$,[95]:BQ,[96]:lD},k70={null:[BQ,Lg]},y70={null:[42,95]},x70={null:[]};function Og($,Z,J){let H={_bufferIndex:-1,_index:0,line:J&&J.line||1,column:J&&J.column||1,offset:J&&J.offset||0},B={},Q=[],X=[],z=[],G=!0,K={attempt:R(w),check:R(C),consume:j,enter:M,exit:P,interrupt:R(C,{interrupt:!0})},U={code:null,containerState:{},defineSkip:V,events:[],now:A,parser:$,previous:null,sliceSerialize:q,sliceStream:N,write:W},Y=Z.tokenize.call(U,K),F;if(Z.resolveAll)Q.push(Z);return U;function W(k){if(X=P4(X,k),D(),X[X.length-1]!==null)return[];return O(Z,0),U.events=u6(Q,U.events,U),U.events}function q(k,T){return v70(N(k),T)}function N(k){return h70(X,k)}function A(){let{_bufferIndex:k,_index:T,line:b,column:I,offset:v}=H;return{_bufferIndex:k,_index:T,line:b,column:I,offset:v}}function V(k){B[k.line]=k.column,y()}function D(){let k;while(H._index<X.length){let T=X[H._index];if(typeof T==="string"){if(k=H._index,H._bufferIndex<0)H._bufferIndex=0;while(H._index===k&&H._bufferIndex<T.length)L(T.charCodeAt(H._bufferIndex))}else L(T)}}function L(k){G=void 0,F=k,Y=Y(k)}function j(k){if(u0(k))H.line++,H.column=1,H.offset+=k===-3?2:1,y();else if(k!==-1)H.column++,H.offset++;if(H._bufferIndex<0)H._index++;else if(H._bufferIndex++,H._bufferIndex===X[H._index].length)H._bufferIndex=-1,H._index++;U.previous=k,G=!0}function M(k,T){let b=T||{};return b.type=k,b.start=A(),U.events.push(["enter",b,U]),z.push(b),b}function P(k){let T=z.pop();return T.end=A(),U.events.push(["exit",T,U]),T}function w(k,T){O(k,T.from)}function C(k,T){T.restore()}function R(k,T){return b;function b(I,v,h){let f,E,i,r;return Array.isArray(I)?l(I):("tokenize"in I)?l([I]):x(I);function x(n){return Z0;function Z0(J0){let X0=J0!==null&&n[J0],Q0=J0!==null&&n.null,F0=[...Array.isArray(X0)?X0:X0?[X0]:[],...Array.isArray(Q0)?Q0:Q0?[Q0]:[]];return l(F0)(J0)}}function l(n){if(f=n,E=0,n.length===0)return h;return o(n[E])}function o(n){return Z0;function Z0(J0){if(r=S(),i=n,!n.partial)U.currentConstruct=n;if(n.name&&U.parser.constructs.disable.null.includes(n.name))return c(J0);return n.tokenize.call(T?Object.assign(Object.create(U),T):U,K,u,c)(J0)}}function u(n){return G=!0,k(i,r),v}function c(n){if(G=!0,r.restore(),++E<f.length)return o(f[E]);return h}}}function O(k,T){if(k.resolveAll&&!Q.includes(k))Q.push(k);if(k.resolve)e5(U.events,T,U.events.length-T,k.resolve(U.events.slice(T),U));if(k.resolveTo)U.events=k.resolveTo(U.events,U)}function S(){let k=A(),T=U.previous,b=U.currentConstruct,I=U.events.length,v=Array.from(z);return{from:I,restore:h};function h(){H=k,U.previous=T,U.currentConstruct=b,U.events.length=I,z=v,y()}}function y(){if(H.line in B&&H.column<2)H.column=B[H.line],H.offset+=B[H.line]-1}}function h70($,Z){let J=Z.start._index,H=Z.start._bufferIndex,B=Z.end._index,Q=Z.end._bufferIndex,X;if(J===B)X=[$[J].slice(H,Q)];else{if(X=$.slice(J,B),H>-1){let z=X[0];if(typeof z==="string")X[0]=z.slice(H);else X.shift()}if(Q>0)X.push($[B].slice(0,Q))}return X}function v70($,Z){let J=-1,H=[],B;while(++J<$.length){let Q=$[J],X;if(typeof Q==="string")X=Q;else switch(Q){case-5:{X="\r";break}case-4:{X=`
19
+ `;break}case-3:{X=`\r
20
+ `;break}case-2:{X=Z?" ":"\t";break}case-1:{if(!Z&&B)continue;X=" ";break}default:X=String.fromCharCode(Q)}B=Q===-2,H.push(X)}return H.join("")}function HL($){let H={constructs:wY([JL,...($||{}).extensions||[]]),content:B(Fg),defined:[],document:B(qg),flow:B(Dg),lazy:{},string:B(Mg),text:B(Pg)};return H;function B(Q){return X;function X(z){return Og(H,Q,z)}}}function BL($){while(!yY($));return $}var Tg=/[\0\t\n\r]/g;function QL(){let $=1,Z="",J=!0,H;return B;function B(Q,X,z){let G=[],K,U,Y,F,W;if(Q=Z+(typeof Q==="string"?Q.toString():new TextDecoder(X||void 0).decode(Q)),Y=0,Z="",J){if(Q.charCodeAt(0)===65279)Y++;J=void 0}while(Y<Q.length){if(Tg.lastIndex=Y,K=Tg.exec(Q),F=K&&K.index!==void 0?K.index:Q.length,W=Q.charCodeAt(F),!K){Z=Q.slice(Y);break}if(W===10&&Y===F&&H)G.push(-3),H=void 0;else{if(H)G.push(-5),H=void 0;if(Y<F)G.push(Q.slice(Y,F)),$+=F-Y;switch(W){case 0:{G.push(65533),$++;break}case 9:{U=Math.ceil($/4)*4,G.push(-2);while($++<U)G.push(-1);break}case 10:{G.push(-4),$=1;break}default:H=!0,$=1}}Y=F+1}if(z){if(H)G.push(-5);if(Z)G.push(Z);G.push(null)}return G}}var g70=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Cg($){return $.replace(g70,f70)}function f70($,Z,J){if(Z)return Z;if(J.charCodeAt(0)===35){let B=J.charCodeAt(1),Q=B===120||B===88;return SY(J.slice(Q?2:1),Q?16:10)}return VJ(J)||$}var wg={}.hasOwnProperty;function XL($,Z,J){if(Z&&typeof Z==="object")J=Z,Z=void 0;return m70(J)(BL(HL(J).document().write(QL()($,Z,!0))))}function m70($){let Z={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:Q(e),autolinkProtocol:R,autolinkEmail:R,atxHeading:Q(N0),blockQuote:Q(J0),characterEscape:R,characterReference:R,codeFenced:Q(X0),codeFencedFenceInfo:X,codeFencedFenceMeta:X,codeIndented:Q(X0,X),codeText:Q(Q0,X),codeTextData:R,data:R,codeFlowValue:R,definition:Q(F0),definitionDestinationString:X,definitionLabelString:X,definitionTitleString:X,emphasis:Q(A0),hardBreakEscape:Q(Y0),hardBreakTrailing:Q(Y0),htmlFlow:Q(s,X),htmlFlowData:R,htmlText:Q(s,X),htmlTextData:R,image:Q(a),label:X,link:Q(e),listItem:Q(B0),listItemValue:F,listOrdered:Q($0,Y),listUnordered:Q($0),paragraph:Q(_0),reference:x,referenceString:X,resourceDestinationString:X,resourceTitleString:X,setextHeading:Q(N0),strong:Q(M0),thematicBreak:Q(L0)},exit:{atxHeading:G(),atxHeadingSequence:M,autolink:G(),autolinkEmail:Z0,autolinkProtocol:n,blockQuote:G(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:o,characterReferenceMarkerNumeric:o,characterReferenceValue:u,characterReference:c,codeFenced:G(A),codeFencedFence:N,codeFencedFenceInfo:W,codeFencedFenceMeta:q,codeFlowValue:O,codeIndented:G(V),codeText:G(b),codeTextData:O,data:O,definition:G(),definitionDestinationString:j,definitionLabelString:D,definitionTitleString:L,emphasis:G(),hardBreakEscape:G(y),hardBreakTrailing:G(y),htmlFlow:G(k),htmlFlowData:O,htmlText:G(T),htmlTextData:O,image:G(v),label:f,labelText:h,lineEnding:S,link:G(I),listItem:G(),listOrdered:G(),listUnordered:G(),paragraph:G(),referenceString:l,resourceDestinationString:E,resourceTitleString:i,resource:r,setextHeading:G(C),setextHeadingLineSequence:w,setextHeadingText:P,strong:G(),thematicBreak:G()}};Sg(Z,($||{}).mdastExtensions||[]);let J={};return H;function H(g){let m={type:"root",children:[]},t={stack:[m],tokenStack:[],config:Z,enter:z,exit:K,buffer:X,resume:U,data:J},W0=[],R0=-1;while(++R0<g.length)if(g[R0][1].type==="listOrdered"||g[R0][1].type==="listUnordered")if(g[R0][0]==="enter")W0.push(R0);else{let c0=W0.pop();R0=B(g,c0,R0)}R0=-1;while(++R0<g.length){let c0=Z[g[R0][0]];if(wg.call(c0,g[R0][1].type))c0[g[R0][1].type].call(Object.assign({sliceSerialize:g[R0][2].sliceSerialize},t),g[R0][1])}if(t.tokenStack.length>0){let c0=t.tokenStack[t.tokenStack.length-1];(c0[1]||Eg).call(t,void 0,c0[0])}m.position={start:p6(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:p6(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},R0=-1;while(++R0<Z.transforms.length)m=Z.transforms[R0](m)||m;return m}function B(g,m,t){let W0=m-1,R0=-1,c0=!1,f0,T0,x0,Z1;while(++W0<=t){let W1=g[W0];switch(W1[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(W1[0]==="enter")R0++;else R0--;Z1=void 0;break}case"lineEndingBlank":{if(W1[0]==="enter"){if(f0&&!Z1&&!R0&&!x0)x0=W0;Z1=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Z1=void 0}if(!R0&&W1[0]==="enter"&&W1[1].type==="listItemPrefix"||R0===-1&&W1[0]==="exit"&&(W1[1].type==="listUnordered"||W1[1].type==="listOrdered")){if(f0){let d0=W0;T0=void 0;while(d0--){let v0=g[d0];if(v0[1].type==="lineEnding"||v0[1].type==="lineEndingBlank"){if(v0[0]==="exit")continue;if(T0)g[T0][1].type="lineEndingBlank",c0=!0;v0[1].type="lineEnding",T0=d0}else if(v0[1].type==="linePrefix"||v0[1].type==="blockQuotePrefix"||v0[1].type==="blockQuotePrefixWhitespace"||v0[1].type==="blockQuoteMarker"||v0[1].type==="listItemIndent");else break}if(x0&&(!T0||x0<T0))f0._spread=!0;f0.end=Object.assign({},T0?g[T0][1].start:W1[1].end),g.splice(T0||W0,0,["exit",f0,W1[2]]),W0++,t++}if(W1[1].type==="listItemPrefix"){let d0={type:"listItem",_spread:!1,start:Object.assign({},W1[1].start),end:void 0};f0=d0,g.splice(W0,0,["enter",d0,W1[2]]),W0++,t++,x0=void 0,Z1=!0}}}return g[m][1]._spread=c0,t}function Q(g,m){return t;function t(W0){if(z.call(this,g(W0),W0),m)m.call(this,W0)}}function X(){this.stack.push({type:"fragment",children:[]})}function z(g,m,t){this.stack[this.stack.length-1].children.push(g),this.stack.push(g),this.tokenStack.push([m,t||void 0]),g.position={start:p6(m.start),end:void 0}}function G(g){return m;function m(t){if(g)g.call(this,t);K.call(this,t)}}function K(g,m){let t=this.stack.pop(),W0=this.tokenStack.pop();if(!W0)throw Error("Cannot close `"+g.type+"` ("+f6({start:g.start,end:g.end})+"): it’s not open");else if(W0[0].type!==g.type)if(m)m.call(this,g,W0[0]);else(W0[1]||Eg).call(this,g,W0[0]);t.position.end=p6(g.end)}function U(){return F$(this.stack.pop())}function Y(){this.data.expectingFirstListItemValue=!0}function F(g){if(this.data.expectingFirstListItemValue){let m=this.stack[this.stack.length-2];m.start=Number.parseInt(this.sliceSerialize(g),10),this.data.expectingFirstListItemValue=void 0}}function W(){let g=this.resume(),m=this.stack[this.stack.length-1];m.lang=g}function q(){let g=this.resume(),m=this.stack[this.stack.length-1];m.meta=g}function N(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function A(){let g=this.resume(),m=this.stack[this.stack.length-1];m.value=g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function V(){let g=this.resume(),m=this.stack[this.stack.length-1];m.value=g.replace(/(\r?\n|\r)$/g,"")}function D(g){let m=this.resume(),t=this.stack[this.stack.length-1];t.label=m,t.identifier=Q4(this.sliceSerialize(g)).toLowerCase()}function L(){let g=this.resume(),m=this.stack[this.stack.length-1];m.title=g}function j(){let g=this.resume(),m=this.stack[this.stack.length-1];m.url=g}function M(g){let m=this.stack[this.stack.length-1];if(!m.depth){let t=this.sliceSerialize(g).length;m.depth=t}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function w(g){let m=this.stack[this.stack.length-1];m.depth=this.sliceSerialize(g).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function R(g){let t=this.stack[this.stack.length-1].children,W0=t[t.length-1];if(!W0||W0.type!=="text")W0=V0(),W0.position={start:p6(g.start),end:void 0},t.push(W0);this.stack.push(W0)}function O(g){let m=this.stack.pop();m.value+=this.sliceSerialize(g),m.position.end=p6(g.end)}function S(g){let m=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=m.children[m.children.length-1];t.position.end=p6(g.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&Z.canContainEols.includes(m.type))R.call(this,g),O.call(this,g)}function y(){this.data.atHardBreak=!0}function k(){let g=this.resume(),m=this.stack[this.stack.length-1];m.value=g}function T(){let g=this.resume(),m=this.stack[this.stack.length-1];m.value=g}function b(){let g=this.resume(),m=this.stack[this.stack.length-1];m.value=g}function I(){let g=this.stack[this.stack.length-1];if(this.data.inReference){let m=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=m,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function v(){let g=this.stack[this.stack.length-1];if(this.data.inReference){let m=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=m,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function h(g){let m=this.sliceSerialize(g),t=this.stack[this.stack.length-2];t.label=Cg(m),t.identifier=Q4(m).toLowerCase()}function f(){let g=this.stack[this.stack.length-1],m=this.resume(),t=this.stack[this.stack.length-1];if(this.data.inReference=!0,t.type==="link"){let W0=g.children;t.children=W0}else t.alt=m}function E(){let g=this.resume(),m=this.stack[this.stack.length-1];m.url=g}function i(){let g=this.resume(),m=this.stack[this.stack.length-1];m.title=g}function r(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function l(g){let m=this.resume(),t=this.stack[this.stack.length-1];t.label=m,t.identifier=Q4(this.sliceSerialize(g)).toLowerCase(),this.data.referenceType="full"}function o(g){this.data.characterReferenceType=g.type}function u(g){let m=this.sliceSerialize(g),t=this.data.characterReferenceType,W0;if(t)W0=SY(m,t==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else W0=VJ(m);let R0=this.stack[this.stack.length-1];R0.value+=W0}function c(g){let m=this.stack.pop();m.position.end=p6(g.end)}function n(g){O.call(this,g);let m=this.stack[this.stack.length-1];m.url=this.sliceSerialize(g)}function Z0(g){O.call(this,g);let m=this.stack[this.stack.length-1];m.url="mailto:"+this.sliceSerialize(g)}function J0(){return{type:"blockquote",children:[]}}function X0(){return{type:"code",lang:null,meta:null,value:""}}function Q0(){return{type:"inlineCode",value:""}}function F0(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function A0(){return{type:"emphasis",children:[]}}function N0(){return{type:"heading",depth:0,children:[]}}function Y0(){return{type:"break"}}function s(){return{type:"html",value:""}}function a(){return{type:"image",title:null,url:"",alt:null}}function e(){return{type:"link",title:null,url:"",children:[]}}function $0(g){return{type:"list",ordered:g.type==="listOrdered",start:null,spread:g._spread,children:[]}}function B0(g){return{type:"listItem",spread:g._spread,checked:null,children:[]}}function _0(){return{type:"paragraph",children:[]}}function M0(){return{type:"strong",children:[]}}function V0(){return{type:"text",value:""}}function L0(){return{type:"thematicBreak"}}}function p6($){return{line:$.line,column:$.column,offset:$.offset}}function Sg($,Z){let J=-1;while(++J<Z.length){let H=Z[J];if(Array.isArray(H))Sg($,H);else u70($,H)}}function u70($,Z){let J;for(J in Z)if(wg.call(Z,J))switch(J){case"canContainEols":{let H=Z[J];if(H)$[J].push(...H);break}case"transforms":{let H=Z[J];if(H)$[J].push(...H);break}case"enter":case"exit":{let H=Z[J];if(H)Object.assign($[J],H);break}}}function Eg($,Z){if($)throw Error("Cannot close `"+$.type+"` ("+f6({start:$.start,end:$.end})+"): a different token (`"+Z.type+"`, "+f6({start:Z.start,end:Z.end})+") is open");else throw Error("Cannot close document, a token (`"+Z.type+"`, "+f6({start:Z.start,end:Z.end})+") is still open")}function fY($){let Z=this;Z.parser=J;function J(H){return XL(H,{...Z.data("settings"),...$,extensions:Z.data("micromarkExtensions")||[],mdastExtensions:Z.data("fromMarkdownExtensions")||[]})}}var mY=-1,AJ=0,D$=1,DJ=2,GQ=3,KQ=4,UQ=5,YQ=6,uY=7,pY=8;var Ig=typeof self==="object"?self:globalThis,p70=($,Z)=>{let J=(B,Q)=>{return $.set(Q,B),B},H=(B)=>{if($.has(B))return $.get(B);let[Q,X]=Z[B];switch(Q){case AJ:case mY:return J(X,B);case D$:{let z=J([],B);for(let G of X)z.push(H(G));return z}case DJ:{let z=J({},B);for(let[G,K]of X)z[H(G)]=H(K);return z}case GQ:return J(new Date(X),B);case KQ:{let{source:z,flags:G}=X;return J(new RegExp(z,G),B)}case UQ:{let z=J(new Map,B);for(let[G,K]of X)z.set(H(G),H(K));return z}case YQ:{let z=J(new Set,B);for(let G of X)z.add(H(G));return z}case uY:{let{name:z,message:G}=X;return J(new Ig[z](G),B)}case pY:return J(BigInt(X),B);case"BigInt":return J(Object(BigInt(X)),B);case"ArrayBuffer":return J(new Uint8Array(X).buffer,X);case"DataView":{let{buffer:z}=new Uint8Array(X);return J(new DataView(z),X)}}return J(new Ig[Q](X),B)};return H},zL=($)=>p70(new Map,$)(0);var LJ="",{toString:c70}={},{keys:d70}=Object,FQ=($)=>{let Z=typeof $;if(Z!=="object"||!$)return[AJ,Z];let J=c70.call($).slice(8,-1);switch(J){case"Array":return[D$,LJ];case"Object":return[DJ,LJ];case"Date":return[GQ,LJ];case"RegExp":return[KQ,LJ];case"Map":return[UQ,LJ];case"Set":return[YQ,LJ];case"DataView":return[D$,J]}if(J.includes("Array"))return[D$,J];if(J.includes("Error"))return[uY,J];return[DJ,J]},cY=([$,Z])=>$===AJ&&(Z==="function"||Z==="symbol"),l70=($,Z,J,H)=>{let B=(X,z)=>{let G=H.push(X)-1;return J.set(z,G),G},Q=(X)=>{if(J.has(X))return J.get(X);let[z,G]=FQ(X);switch(z){case AJ:{let U=X;switch(G){case"bigint":z=pY,U=X.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+G);U=null;break;case"undefined":return B([mY],X)}return B([z,U],X)}case D$:{if(G){let F=X;if(G==="DataView")F=new Uint8Array(X.buffer);else if(G==="ArrayBuffer")F=new Uint8Array(X);return B([G,[...F]],X)}let U=[],Y=B([z,U],X);for(let F of X)U.push(Q(F));return Y}case DJ:{if(G)switch(G){case"BigInt":return B([G,X.toString()],X);case"Boolean":case"Number":case"String":return B([G,X.valueOf()],X)}if(Z&&"toJSON"in X)return Q(X.toJSON());let U=[],Y=B([z,U],X);for(let F of d70(X))if($||!cY(FQ(X[F])))U.push([Q(F),Q(X[F])]);return Y}case GQ:return B([z,X.toISOString()],X);case KQ:{let{source:U,flags:Y}=X;return B([z,{source:U,flags:Y}],X)}case UQ:{let U=[],Y=B([z,U],X);for(let[F,W]of X)if($||!(cY(FQ(F))||cY(FQ(W))))U.push([Q(F),Q(W)]);return Y}case YQ:{let U=[],Y=B([z,U],X);for(let F of X)if($||!cY(FQ(F)))U.push(Q(F));return Y}}let{message:K}=X;return B([z,{name:G,message:K}],X)};return Q},GL=($,{json:Z,lossy:J}={})=>{let H=[];return l70(!(Z||J),!!Z,new Map,H)($),H};var MJ=typeof structuredClone==="function"?($,Z)=>Z&&(("json"in Z)||("lossy"in Z))?zL(GL($,Z)):structuredClone($):($,Z)=>zL(GL($,Z));function i70($,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 r70($,Z){return"Back to reference "+($+1)+(Z>1?"-"+Z:"")}function Rg($){let Z=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",J=$.options.footnoteBackContent||i70,H=$.options.footnoteBackLabel||r70,B=$.options.footnoteLabel||"Footnotes",Q=$.options.footnoteLabelTagName||"h2",X=$.options.footnoteLabelProperties||{className:["sr-only"]},z=[],G=-1;while(++G<$.footnoteOrder.length){let K=$.footnoteById.get($.footnoteOrder[G]);if(!K)continue;let U=$.all(K),Y=String(K.identifier).toUpperCase(),F=S8(Y.toLowerCase()),W=0,q=[],N=$.footnoteCounts.get(Y);while(N!==void 0&&++W<=N){if(q.length>0)q.push({type:"text",value:" "});let D=typeof J==="string"?J:J(G,W);if(typeof D==="string")D={type:"text",value:D};q.push({type:"element",tagName:"a",properties:{href:"#"+Z+"fnref-"+F+(W>1?"-"+W:""),dataFootnoteBackref:"",ariaLabel:typeof H==="string"?H:H(G,W),className:["data-footnote-backref"]},children:Array.isArray(D)?D:[D]})}let A=U[U.length-1];if(A&&A.type==="element"&&A.tagName==="p"){let D=A.children[A.children.length-1];if(D&&D.type==="text")D.value+=" ";else A.children.push({type:"text",value:" "});A.children.push(...q)}else U.push(...q);let V={type:"element",tagName:"li",properties:{id:Z+"fn-"+F},children:$.wrap(U,!0)};$.patch(K,V),z.push(V)}if(z.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:Q,properties:{...MJ(X),id:"footnote-label"},children:[{type:"text",value:B}]},{type:"text",value:`
21
+ `},{type:"element",tagName:"ol",properties:{},children:$.wrap(z,!0)},{type:"text",value:`
22
+ `}]}}var a9=function($){if($===null||$===void 0)return s70;if(typeof $==="function")return dY($);if(typeof $==="object")return Array.isArray($)?a70($):o70($);if(typeof $==="string")return n70($);throw Error("Expected function, string, or object as test")};function a70($){let Z=[],J=-1;while(++J<$.length)Z[J]=a9($[J]);return dY(H);function H(...B){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,B))return!0;return!1}}function o70($){let Z=$;return dY(J);function J(H){let B=H,Q;for(Q in $)if(B[Q]!==Z[Q])return!1;return!0}}function n70($){return dY(Z);function Z(J){return J&&J.type===$}}function dY($){return Z;function Z(J,H,B){return Boolean(t70(J)&&$.call(this,J,typeof H==="number"?H:void 0,B||void 0))}}function s70(){return!0}function t70($){return $!==null&&typeof $==="object"&&"type"in $}function bg($){return $}var kg=[],lY=!0,L$=!1,iY="skip";function WQ($,Z,J,H){let B;if(typeof Z==="function"&&typeof J!=="function")H=J,J=Z;else B=Z;let Q=a9(B),X=H?-1:1;z($,void 0,[])();function z(G,K,U){let Y=G&&typeof G==="object"?G:{};if(typeof Y.type==="string"){let W=typeof Y.tagName==="string"?Y.tagName:typeof Y.name==="string"?Y.name:void 0;Object.defineProperty(F,"name",{value:"node ("+bg(G.type+(W?"<"+W+">":""))+")"})}return F;function F(){let W=kg,q,N,A;if(!Z||Q(G,K,U[U.length-1]||void 0)){if(W=e70(J(G,U)),W[0]===L$)return W}if("children"in G&&G.children){let V=G;if(V.children&&W[0]!==iY){N=(H?V.children.length:-1)+X,A=U.concat(V);while(N>-1&&N<V.children.length){let D=V.children[N];if(q=z(D,N,A)(),q[0]===L$)return q;N=typeof q[1]==="number"?q[1]:N+X}}}return W}}}function e70($){if(Array.isArray($))return $;if(typeof $==="number")return[lY,$];return $===null||$===void 0?kg:[$]}function j3($,Z,J,H){let B,Q,X;if(typeof Z==="function"&&typeof J!=="function")Q=void 0,X=Z,B=J;else Q=Z,X=J,B=H;WQ($,Q,z,B);function z(G,K){let U=K[K.length-1],Y=U?U.children.indexOf(G):void 0;return X(G,Y,U)}}function yg($,Z){let J={type:"element",tagName:"blockquote",properties:{},children:$.wrap($.all(Z),!0)};return $.patch(Z,J),$.applyData(Z,J)}function xg($,Z){let J={type:"element",tagName:"br",properties:{},children:[]};return $.patch(Z,J),[$.applyData(Z,J),{type:"text",value:`
23
+ `}]}function hg($,Z){let J=Z.value?Z.value+`
24
+ `:"",H={},B=Z.lang?Z.lang.split(/\s+/):[];if(B.length>0)H.className=["language-"+B[0]];let Q={type:"element",tagName:"code",properties:H,children:[{type:"text",value:J}]};if(Z.meta)Q.data={meta:Z.meta};return $.patch(Z,Q),Q=$.applyData(Z,Q),Q={type:"element",tagName:"pre",properties:{},children:[Q]},$.patch(Z,Q),Q}function vg($,Z){let J={type:"element",tagName:"del",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function gg($,Z){let J={type:"element",tagName:"em",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function fg($,Z){let J=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",H=String(Z.identifier).toUpperCase(),B=S8(H.toLowerCase()),Q=$.footnoteOrder.indexOf(H),X,z=$.footnoteCounts.get(H);if(z===void 0)z=0,$.footnoteOrder.push(H),X=$.footnoteOrder.length;else X=Q+1;z+=1,$.footnoteCounts.set(H,z);let G={type:"element",tagName:"a",properties:{href:"#"+J+"fn-"+B,id:J+"fnref-"+B+(z>1?"-"+z:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(X)}]};$.patch(Z,G);let K={type:"element",tagName:"sup",properties:{},children:[G]};return $.patch(Z,K),$.applyData(Z,K)}function mg($,Z){let J={type:"element",tagName:"h"+Z.depth,properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function ug($,Z){if($.options.allowDangerousHtml){let J={type:"raw",value:Z.value};return $.patch(Z,J),$.applyData(Z,J)}return}function rY($,Z){let J=Z.referenceType,H="]";if(J==="collapsed")H+="[]";else if(J==="full")H+="["+(Z.label||Z.identifier)+"]";if(Z.type==="imageReference")return[{type:"text",value:"!["+Z.alt+H}];let B=$.all(Z),Q=B[0];if(Q&&Q.type==="text")Q.value="["+Q.value;else B.unshift({type:"text",value:"["});let X=B[B.length-1];if(X&&X.type==="text")X.value+=H;else B.push({type:"text",value:H});return B}function pg($,Z){let J=String(Z.identifier).toUpperCase(),H=$.definitionById.get(J);if(!H)return rY($,Z);let B={src:S8(H.url||""),alt:Z.alt};if(H.title!==null&&H.title!==void 0)B.title=H.title;let Q={type:"element",tagName:"img",properties:B,children:[]};return $.patch(Z,Q),$.applyData(Z,Q)}function cg($,Z){let J={src:S8(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 H={type:"element",tagName:"img",properties:J,children:[]};return $.patch(Z,H),$.applyData(Z,H)}function dg($,Z){let J={type:"text",value:Z.value.replace(/\r?\n|\r/g," ")};$.patch(Z,J);let H={type:"element",tagName:"code",properties:{},children:[J]};return $.patch(Z,H),$.applyData(Z,H)}function lg($,Z){let J=String(Z.identifier).toUpperCase(),H=$.definitionById.get(J);if(!H)return rY($,Z);let B={href:S8(H.url||"")};if(H.title!==null&&H.title!==void 0)B.title=H.title;let Q={type:"element",tagName:"a",properties:B,children:$.all(Z)};return $.patch(Z,Q),$.applyData(Z,Q)}function ig($,Z){let J={href:S8(Z.url)};if(Z.title!==null&&Z.title!==void 0)J.title=Z.title;let H={type:"element",tagName:"a",properties:J,children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function rg($,Z,J){let H=$.all(Z),B=J?$$0(J):ag(Z),Q={},X=[];if(typeof Z.checked==="boolean"){let U=H[0],Y;if(U&&U.type==="element"&&U.tagName==="p")Y=U;else Y={type:"element",tagName:"p",properties:{},children:[]},H.unshift(Y);if(Y.children.length>0)Y.children.unshift({type:"text",value:" "});Y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:Z.checked,disabled:!0},children:[]}),Q.className=["task-list-item"]}let z=-1;while(++z<H.length){let U=H[z];if(B||z!==0||U.type!=="element"||U.tagName!=="p")X.push({type:"text",value:`
25
+ `});if(U.type==="element"&&U.tagName==="p"&&!B)X.push(...U.children);else X.push(U)}let G=H[H.length-1];if(G&&(B||G.type!=="element"||G.tagName!=="p"))X.push({type:"text",value:`
26
+ `});let K={type:"element",tagName:"li",properties:Q,children:X};return $.patch(Z,K),$.applyData(Z,K)}function $$0($){let Z=!1;if($.type==="list"){Z=$.spread||!1;let J=$.children,H=-1;while(!Z&&++H<J.length)Z=ag(J[H])}return Z}function ag($){let Z=$.spread;return Z===null||Z===void 0?$.children.length>1:Z}function og($,Z){let J={},H=$.all(Z),B=-1;if(typeof Z.start==="number"&&Z.start!==1)J.start=Z.start;while(++B<H.length){let X=H[B];if(X.type==="element"&&X.tagName==="li"&&X.properties&&Array.isArray(X.properties.className)&&X.properties.className.includes("task-list-item")){J.className=["contains-task-list"];break}}let Q={type:"element",tagName:Z.ordered?"ol":"ul",properties:J,children:$.wrap(H,!0)};return $.patch(Z,Q),$.applyData(Z,Q)}function ng($,Z){let J={type:"element",tagName:"p",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function sg($,Z){let J={type:"root",children:$.wrap($.all(Z))};return $.patch(Z,J),$.applyData(Z,J)}function tg($,Z){let J={type:"element",tagName:"strong",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function eg($,Z){let J=$.all(Z),H=J.shift(),B=[];if(H){let X={type:"element",tagName:"thead",properties:{},children:$.wrap([H],!0)};$.patch(Z.children[0],X),B.push(X)}if(J.length>0){let X={type:"element",tagName:"tbody",properties:{},children:$.wrap(J,!0)},z=NJ(Z.children[1]),G=EY(Z.children[Z.children.length-1]);if(z&&G)X.position={start:z,end:G};B.push(X)}let Q={type:"element",tagName:"table",properties:{},children:$.wrap(B,!0)};return $.patch(Z,Q),$.applyData(Z,Q)}function $f($,Z,J){let H=J?J.children:void 0,Q=(H?H.indexOf(Z):1)===0?"th":"td",X=J&&J.type==="table"?J.align:void 0,z=X?X.length:Z.children.length,G=-1,K=[];while(++G<z){let Y=Z.children[G],F={},W=X?X[G]:void 0;if(W)F.align=W;let q={type:"element",tagName:Q,properties:F,children:[]};if(Y)q.children=$.all(Y),$.patch(Y,q),q=$.applyData(Y,q);K.push(q)}let U={type:"element",tagName:"tr",properties:{},children:$.wrap(K,!0)};return $.patch(Z,U),$.applyData(Z,U)}function Zf($,Z){let J={type:"element",tagName:"td",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function Hf($){let Z=String($),J=/\r?\n|\r/g,H=J.exec(Z),B=0,Q=[];while(H)Q.push(Jf(Z.slice(B,H.index),B>0,!0),H[0]),B=H.index+H[0].length,H=J.exec(Z);return Q.push(Jf(Z.slice(B),B>0,!1)),Q.join("")}function Jf($,Z,J){let H=0,B=$.length;if(Z){let Q=$.codePointAt(H);while(Q===9||Q===32)H++,Q=$.codePointAt(H)}if(J){let Q=$.codePointAt(B-1);while(Q===9||Q===32)B--,Q=$.codePointAt(B-1)}return B>H?$.slice(H,B):""}function Bf($,Z){let J={type:"text",value:Hf(String(Z.value))};return $.patch(Z,J),$.applyData(Z,J)}function Qf($,Z){let J={type:"element",tagName:"hr",properties:{},children:[]};return $.patch(Z,J),$.applyData(Z,J)}var Xf={blockquote:yg,break:xg,code:hg,delete:vg,emphasis:gg,footnoteReference:fg,heading:mg,html:ug,imageReference:pg,image:cg,inlineCode:dg,linkReference:lg,link:ig,listItem:rg,list:og,paragraph:ng,root:sg,strong:tg,table:eg,tableCell:Zf,tableRow:$f,text:Bf,thematicBreak:Qf,toml:aY,yaml:aY,definition:aY,footnoteDefinition:aY};function aY(){return}var KL={}.hasOwnProperty,Z$0={};function Gf($,Z){let J=Z||Z$0,H=new Map,B=new Map,Q=new Map,X={...Xf,...J.handlers},z={all:K,applyData:H$0,definitionById:H,footnoteById:B,footnoteCounts:Q,footnoteOrder:[],handlers:X,one:G,options:J,patch:J$0,wrap:Q$0};return j3($,function(U){if(U.type==="definition"||U.type==="footnoteDefinition"){let Y=U.type==="definition"?H:B,F=String(U.identifier).toUpperCase();if(!Y.has(F))Y.set(F,U)}}),z;function G(U,Y){let F=U.type,W=z.handlers[F];if(KL.call(z.handlers,F)&&W)return W(z,U,Y);if(z.options.passThrough&&z.options.passThrough.includes(F)){if("children"in U){let{children:N,...A}=U,V=MJ(A);return V.children=z.all(U),V}return MJ(U)}return(z.options.unknownHandler||B$0)(z,U,Y)}function K(U){let Y=[];if("children"in U){let F=U.children,W=-1;while(++W<F.length){let q=z.one(F[W],U);if(q){if(W&&F[W-1].type==="break"){if(!Array.isArray(q)&&q.type==="text")q.value=zf(q.value);if(!Array.isArray(q)&&q.type==="element"){let N=q.children[0];if(N&&N.type==="text")N.value=zf(N.value)}}if(Array.isArray(q))Y.push(...q);else Y.push(q)}}}return Y}}function J$0($,Z){if($.position)Z.position=gD($)}function H$0($,Z){let J=Z;if($&&$.data){let H=$.data.hName,B=$.data.hChildren,Q=$.data.hProperties;if(typeof H==="string")if(J.type==="element")J.tagName=H;else{let X="children"in J?J.children:[J];J={type:"element",tagName:H,properties:{},children:X}}if(J.type==="element"&&Q)Object.assign(J.properties,MJ(Q));if("children"in J&&J.children&&B!==null&&B!==void 0)J.children=B}return J}function B$0($,Z){let J=Z.data||{},H="value"in Z&&!(KL.call(J,"hProperties")||KL.call(J,"hChildren"))?{type:"text",value:Z.value}:{type:"element",tagName:"div",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function Q$0($,Z){let J=[],H=-1;if(Z)J.push({type:"text",value:`
27
+ `});while(++H<$.length){if(H)J.push({type:"text",value:`
28
+ `});J.push($[H])}if(Z&&$.length>0)J.push({type:"text",value:`
29
+ `});return J}function zf($){let Z=0,J=$.charCodeAt(Z);while(J===9||J===32)Z++,J=$.charCodeAt(Z);return $.slice(Z)}function oY($,Z){let J=Gf($,Z),H=J.one($,void 0),B=Rg(J),Q=Array.isArray(H)?{type:"root",children:H}:H||{type:"root",children:[]};if(B)n1("children"in Q),Q.children.push({type:"text",value:`
30
+ `},B);return Q}function nY($,Z){if($&&"run"in $)return async function(J,H){let B=oY(J,{file:H,...Z});await $.run(B,H)};return function(J,H){return oY(J,{file:H,...$||Z})}}function UL($){if($)throw $}var eY=_(Af(),1);function qQ($){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 YL(){let $=[],Z={run:J,use:H};return Z;function J(...B){let Q=-1,X=B.pop();if(typeof X!=="function")throw TypeError("Expected function as last argument, not "+X);z(null,...B);function z(G,...K){let U=$[++Q],Y=-1;if(G){X(G);return}while(++Y<B.length)if(K[Y]===null||K[Y]===void 0)K[Y]=B[Y];if(B=K,U)Df(U,z)(...K);else X(null,...K)}}function H(B){if(typeof B!=="function")throw TypeError("Expected `middelware` to be a function, not "+B);return $.push(B),Z}}function Df($,Z){let J;return H;function H(...X){let z=$.length>X.length,G;if(z)X.push(B);try{G=$.apply(this,X)}catch(K){let U=K;if(z&&J)throw U;return B(U)}if(!z)if(G&&G.then&&typeof G.then==="function")G.then(Q,B);else if(G instanceof Error)B(G);else Q(G)}function B(X,...z){if(!J)J=!0,Z(X,...z)}function Q(X){B(null,X)}}var s8={basename:X$0,dirname:z$0,extname:G$0,join:K$0,sep:"/"};function X$0($,Z){if(Z!==void 0&&typeof Z!=="string")throw TypeError('"ext" argument must be a string');NQ($);let J=0,H=-1,B=$.length,Q;if(Z===void 0||Z.length===0||Z.length>$.length){while(B--)if($.codePointAt(B)===47){if(Q){J=B+1;break}}else if(H<0)Q=!0,H=B+1;return H<0?"":$.slice(J,H)}if(Z===$)return"";let X=-1,z=Z.length-1;while(B--)if($.codePointAt(B)===47){if(Q){J=B+1;break}}else{if(X<0)Q=!0,X=B+1;if(z>-1)if($.codePointAt(B)===Z.codePointAt(z--)){if(z<0)H=B}else z=-1,H=X}if(J===H)H=X;else if(H<0)H=$.length;return $.slice(J,H)}function z$0($){if(NQ($),$.length===0)return".";let Z=-1,J=$.length,H;while(--J)if($.codePointAt(J)===47){if(H){Z=J;break}}else if(!H)H=!0;return Z<0?$.codePointAt(0)===47?"/":".":Z===1&&$.codePointAt(0)===47?"//":$.slice(0,Z)}function G$0($){NQ($);let Z=$.length,J=-1,H=0,B=-1,Q=0,X;while(Z--){let z=$.codePointAt(Z);if(z===47){if(X){H=Z+1;break}continue}if(J<0)X=!0,J=Z+1;if(z===46){if(B<0)B=Z;else if(Q!==1)Q=1}else if(B>-1)Q=-1}if(B<0||J<0||Q===0||Q===1&&B===J-1&&B===H+1)return"";return $.slice(B,J)}function K$0(...$){let Z=-1,J;while(++Z<$.length)if(NQ($[Z]),$[Z])J=J===void 0?$[Z]:J+"/"+$[Z];return J===void 0?".":U$0(J)}function U$0($){NQ($);let Z=$.codePointAt(0)===47,J=Y$0($,!Z);if(J.length===0&&!Z)J=".";if(J.length>0&&$.codePointAt($.length-1)===47)J+="/";return Z?"/"+J:J}function Y$0($,Z){let J="",H=0,B=-1,Q=0,X=-1,z,G;while(++X<=$.length){if(X<$.length)z=$.codePointAt(X);else if(z===47)break;else z=47;if(z===47){if(B===X-1||Q===1);else if(B!==X-1&&Q===2){if(J.length<2||H!==2||J.codePointAt(J.length-1)!==46||J.codePointAt(J.length-2)!==46){if(J.length>2){if(G=J.lastIndexOf("/"),G!==J.length-1){if(G<0)J="",H=0;else J=J.slice(0,G),H=J.length-1-J.lastIndexOf("/");B=X,Q=0;continue}}else if(J.length>0){J="",H=0,B=X,Q=0;continue}}if(Z)J=J.length>0?J+"/..":"..",H=2}else{if(J.length>0)J+="/"+$.slice(B+1,X);else J=$.slice(B+1,X);H=X-B-1}B=X,Q=0}else if(z===46&&Q>-1)Q++;else Q=-1}return J}function NQ($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}var Lf={cwd:F$0};function F$0(){return"/"}function PJ($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}function Mf($){if(typeof $==="string")$=new URL($);else if(!PJ($)){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 W$0($)}function W$0($){if($.hostname!==""){let H=TypeError('File URL host must be "localhost" or empty on darwin');throw H.code="ERR_INVALID_FILE_URL_HOST",H}let Z=$.pathname,J=-1;while(++J<Z.length)if(Z.codePointAt(J)===37&&Z.codePointAt(J+1)===50){let H=Z.codePointAt(J+2);if(H===70||H===102){let B=TypeError("File URL path must not include encoded / characters");throw B.code="ERR_INVALID_FILE_URL_PATH",B}}return decodeURIComponent(Z)}var FL=["history","path","basename","stem","extname","dirname"];class _J{constructor($){let Z;if(!$)Z={};else if(PJ($))Z={path:$};else if(typeof $==="string"||q$0($))Z={value:$};else Z=$;this.cwd="cwd"in Z?"":Lf.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let J=-1;while(++J<FL.length){let B=FL[J];if(B in Z&&Z[B]!==void 0&&Z[B]!==null)this[B]=B==="history"?[...Z[B]]:Z[B]}let H;for(H in Z)if(!FL.includes(H))this[H]=Z[H]}get basename(){return typeof this.path==="string"?s8.basename(this.path):void 0}set basename($){qL($,"basename"),WL($,"basename"),this.path=s8.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?s8.dirname(this.path):void 0}set dirname($){Pf(this.basename,"dirname"),this.path=s8.join($||"",this.basename)}get extname(){return typeof this.path==="string"?s8.extname(this.path):void 0}set extname($){if(WL($,"extname"),Pf(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=s8.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(PJ($))$=Mf($);if(qL($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?s8.basename(this.path,this.extname):void 0}set stem($){qL($,"stem"),WL($,"stem"),this.path=s8.join(this.dirname||"",$+(this.extname||""))}fail($,Z,J){let H=this.message($,Z,J);throw H.fatal=!0,H}info($,Z,J){let H=this.message($,Z,J);return H.fatal=void 0,H}message($,Z,J){let H=new X2($,Z,J);if(this.path)H.name=this.path+":"+H.name,H.file=this.path;return H.fatal=!1,this.messages.push(H),H}toString($){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder($||void 0).decode(this.value)}}function WL($,Z){if($&&$.includes(s8.sep))throw Error("`"+Z+"` cannot be a path: did not expect `"+s8.sep+"`")}function qL($,Z){if(!$)throw Error("`"+Z+"` cannot be empty")}function Pf($,Z){if(!$)throw Error("Setting `"+Z+"` requires `path` to be set too")}function q$0($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var _f=function($){let H=this.constructor.prototype,B=H[$],Q=function(){return B.apply(Q,arguments)};return Object.setPrototypeOf(Q,H),Q};var N$0={}.hasOwnProperty;class DL extends _f{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=YL()}copy(){let $=new DL,Z=-1;while(++Z<this.attachers.length){let J=this.attachers[Z];$.use(...J)}return $.data(eY.default(!0,{},this.namespace)),$}data($,Z){if(typeof $==="string"){if(arguments.length===2)return AL("data",this.frozen),this.namespace[$]=Z,this;return N$0.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return AL("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 H=Z.call($,...J);if(typeof H==="function")this.transformers.use(H)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse($){this.freeze();let Z=tY($),J=this.parser||this.Parser;return NL("parse",J),J(String(Z),Z)}process($,Z){let J=this;return this.freeze(),NL("process",this.parser||this.Parser),VL("process",this.compiler||this.Compiler),Z?H(void 0,Z):new Promise(H);function H(B,Q){let X=tY($),z=J.parse(X);J.run(z,X,function(K,U,Y){if(K||!U||!Y)return G(K);let F=U,W=J.stringify(F,Y);if(A$0(W))Y.value=W;else Y.result=W;G(K,Y)});function G(K,U){if(K||!U)Q(K);else if(B)B(U);else n1(Z,"`done` is defined if `resolve` is not"),Z(void 0,U)}}}processSync($){let Z=!1,J;return this.freeze(),NL("processSync",this.parser||this.Parser),VL("processSync",this.compiler||this.Compiler),this.process($,H),Of("processSync","process",Z),n1(J,"we either bailed on an error or have a tree"),J;function H(B,Q){Z=!0,UL(B),J=Q}}run($,Z,J){jf($),this.freeze();let H=this.transformers;if(!J&&typeof Z==="function")J=Z,Z=void 0;return J?B(void 0,J):new Promise(B);function B(Q,X){n1(typeof Z!=="function","`file` can’t be a `done` anymore, we checked");let z=tY(Z);H.run($,z,G);function G(K,U,Y){let F=U||$;if(K)X(K);else if(Q)Q(F);else n1(J,"`done` is defined if `resolve` is not"),J(void 0,F,Y)}}}runSync($,Z){let J=!1,H;return this.run($,Z,B),Of("runSync","run",J),n1(H,"we either bailed on an error or have a tree"),H;function B(Q,X){UL(Q),H=X,J=!0}}stringify($,Z){this.freeze();let J=tY(Z),H=this.compiler||this.Compiler;return VL("stringify",H),jf($),H($,J)}use($,...Z){let J=this.attachers,H=this.namespace;if(AL("use",this.frozen),$===null||$===void 0);else if(typeof $==="function")z($,Z);else if(typeof $==="object")if(Array.isArray($))X($);else Q($);else throw TypeError("Expected usable value, not `"+$+"`");return this;function B(G){if(typeof G==="function")z(G,[]);else if(typeof G==="object")if(Array.isArray(G)){let[K,...U]=G;z(K,U)}else Q(G);else throw TypeError("Expected usable value, not `"+G+"`")}function Q(G){if(!("plugins"in G)&&!("settings"in G))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(X(G.plugins),G.settings)H.settings=eY.default(!0,H.settings,G.settings)}function X(G){let K=-1;if(G===null||G===void 0);else if(Array.isArray(G))while(++K<G.length){let U=G[K];B(U)}else throw TypeError("Expected a list of plugins, not `"+G+"`")}function z(G,K){let U=-1,Y=-1;while(++U<J.length)if(J[U][0]===G){Y=U;break}if(Y===-1)J.push([G,...K]);else if(K.length>0){let[F,...W]=K,q=J[Y][1];if(qQ(q)&&qQ(F))F=eY.default(!0,q,F);J[Y]=[G,F,...W]}}}}var LL=new DL().freeze();function NL($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function VL($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function AL($,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 jf($){if(!qQ($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function Of($,Z,J){if(!J)throw Error("`"+$+"` finished async. Use `"+Z+"` instead")}function tY($){return V$0($)?$:new _J($)}function V$0($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function A$0($){return typeof $==="string"||D$0($)}function D$0($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var L$0="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Tf=[],Cf={allowDangerousHtml:!0},M$0=/^(https?|ircs?|mailto|xmpp)$/i,P$0=[{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 $F($){let Z=_$0($),J=j$0($);return O$0(Z.runSync(Z.parse(J),J),$)}function _$0($){let Z=$.rehypePlugins||Tf,J=$.remarkPlugins||Tf,H=$.remarkRehypeOptions?{...$.remarkRehypeOptions,...Cf}:Cf;return LL().use(fY).use(J).use(nY,H).use(Z)}function j$0($){let Z=$.children||"",J=new _J;if(typeof Z==="string")J.value=Z;else PY("Unexpected value `"+Z+"` for `children` prop, expected `string`");return J}function O$0($,Z){let{allowedElements:J,allowElement:H,components:B,disallowedElements:Q,skipHtml:X,unwrapDisallowed:z}=Z,G=Z.urlTransform||ZF;for(let U of P$0)if(Object.hasOwn(Z,U.from))PY("Unexpected `"+U.from+"` prop, "+(U.to?"use `"+U.to+"` instead":"remove it")+" (see <"+L$0+"#"+U.id+"> for more info)");if(J&&Q)PY("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return j3($,K),uD($,{Fragment:jJ.Fragment,components:B,ignoreInvalidStyle:!0,jsx:jJ.jsx,jsxs:jJ.jsxs,passKeys:!0,passNode:!0});function K(U,Y,F){if(U.type==="raw"&&F&&typeof Y==="number"){if(X)F.children.splice(Y,1);else F.children[Y]={type:"text",value:U.value};return Y}if(U.type==="element"){let W;for(W in JQ)if(Object.hasOwn(JQ,W)&&Object.hasOwn(U.properties,W)){let q=U.properties[W],N=JQ[W];if(N===null||N.includes(U.tagName))U.properties[W]=G(String(q||""),W,U)}}if(U.type==="element"){let W=J?!J.includes(U.tagName):Q?Q.includes(U.tagName):!1;if(!W&&H&&typeof Y==="number")W=!H(U,Y,F);if(W&&F&&typeof Y==="number"){if(z&&U.children)F.children.splice(Y,1,...U.children);else F.children.splice(Y,1);return Y}}}}function ZF($){let Z=$.indexOf(":"),J=$.indexOf("?"),H=$.indexOf("#"),B=$.indexOf("/");if(Z===-1||B!==-1&&Z>B||J!==-1&&Z>J||H!==-1&&Z>H||M$0.test($.slice(0,Z)))return $;return""}var JF=function($,Z,J){let H=a9(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(H($.children[Z],Z,$))return $.children[Z];return};var O3=function($){if($===null||$===void 0)return E$0;if(typeof $==="string")return C$0($);if(typeof $==="object")return T$0($);if(typeof $==="function")return ML($);throw Error("Expected function, string, or array as `test`")};function T$0($){let Z=[],J=-1;while(++J<$.length)Z[J]=O3($[J]);return ML(H);function H(...B){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,B))return!0;return!1}}function C$0($){return ML(Z);function Z(J){return J.tagName===$}}function ML($){return Z;function Z(J,H,B){return Boolean(w$0(J)&&$.call(this,J,typeof H==="number"?H:void 0,B||void 0))}}function E$0($){return Boolean($&&typeof $==="object"&&"type"in $&&$.type==="element"&&"tagName"in $&&typeof $.tagName==="string")}function w$0($){return $!==null&&typeof $==="object"&&"type"in $&&"tagName"in $}var wf=/\n/g,Sf=/[\t ]+/g,PL=O3("br"),If=O3(x$0),S$0=O3("p"),Rf=O3("tr"),I$0=O3(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",y$0,h$0]),bf=O3(["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 _L($,Z){let J=Z||{},H="children"in $?$.children:[],B=bf($),Q=xf($,{whitespace:J.whitespace||"normal",breakBefore:!1,breakAfter:!1}),X=[];if($.type==="text"||$.type==="comment")X.push(...yf($,{whitespace:Q,breakBefore:!0,breakAfter:!0}));let z=-1;while(++z<H.length)X.push(...kf(H[z],$,{whitespace:Q,breakBefore:z?void 0:B,breakAfter:z<H.length-1?PL(H[z+1]):B}));let G=[],K;z=-1;while(++z<X.length){let U=X[z];if(typeof U==="number"){if(K!==void 0&&U>K)K=U}else if(U){if(K!==void 0&&K>-1)G.push(`
31
+ `.repeat(K)||" ");K=-1,G.push(U)}}return G.join("")}function kf($,Z,J){if($.type==="element")return R$0($,Z,J);if($.type==="text")return J.whitespace==="normal"?yf($,J):b$0($);return[]}function R$0($,Z,J){let H=xf($,J),B=$.children||[],Q=-1,X=[];if(I$0($))return X;let z,G;if(PL($))G=`
32
+ `;else if(Rf($)&&JF(Z,$,Rf))G=`
33
+ `;else if(S$0($))z=2,G=2;else if(bf($))z=1,G=1;while(++Q<B.length)X=X.concat(kf(B[Q],$,{whitespace:H,breakBefore:Q?void 0:z,breakAfter:Q<B.length-1?PL(B[Q+1]):G}));if(If($)&&JF(Z,$,If))X.push("\t");if(z)X.unshift(z);if(G)X.push(G);return X}function yf($,Z){let J=String($.value),H=[],B=[],Q=0;while(Q<=J.length){wf.lastIndex=Q;let G=wf.exec(J),K=G&&"index"in G?G.index:J.length;H.push(k$0(J.slice(Q,K).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),Q===0?Z.breakBefore:!0,K===J.length?Z.breakAfter:!0)),Q=K+1}let X=-1,z;while(++X<H.length)if(H[X].charCodeAt(H[X].length-1)===8203||X<H.length-1&&H[X+1].charCodeAt(0)===8203)B.push(H[X]),z=void 0;else if(H[X]){if(typeof z==="number")B.push(z);B.push(H[X]),z=0}else if(X===0||X===H.length-1)B.push(0);return B}function b$0($){return[String($.value)]}function k$0($,Z,J){let H=[],B=0,Q;while(B<$.length){Sf.lastIndex=B;let X=Sf.exec($);if(Q=X?X.index:$.length,!B&&!Q&&X&&!Z)H.push("");if(B!==Q)H.push($.slice(B,Q));B=X?Q+X[0].length:Q}if(B!==Q&&!J)H.push("");return H.join(" ")}function xf($,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 y$0($){return Boolean(($.properties||{}).hidden)}function x$0($){return $.tagName==="td"||$.tagName==="th"}function h$0($){return $.tagName==="dialog"&&!($.properties||{}).open}function v$0($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",K={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},U={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},Y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(K,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},F={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",q=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],A=["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"],V=["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"],j={type:N,keyword:q,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:A},M={className:"function.dispatch",relevance:0,keywords:{_hint:V},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},P=[M,Y,z,J,$.C_BLOCK_COMMENT_MODE,U,K],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:P.concat([{begin:/\(/,end:/\)/,keywords:j,contains:P.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:j,relevance:0},{begin:W,returnBegin:!0,contains:[F],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[K,U]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,K,U,z,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,K,U,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,Y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(w,C,M,P,[Y,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:j,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function hf($){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=v$0($),H=J.keywords;return H.type=[...H.type,...Z.type],H.literal=[...H.literal,...Z.literal],H.built_in=[...H.built_in,...Z.built_in],H._hints=Z._hints,J.name="Arduino",J.aliases=["ino"],J.supersetOf="cpp",J}function vf($){let Z=$.regex,J={},H={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[J]}]};Object.assign(J,{className:"variable",variants:[{begin:Z.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},H]});let B={className:"subst",begin:/\$\(/,end:/\)/,contains:[$.BACKSLASH_ESCAPE]},Q=$.inherit($.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),X={begin:/<<-?\s*(?=\w+)/,starts:{contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},z={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,J,B]};B.contains.push(z);let G={match:/\\"/},K={className:"string",begin:/'/,end:/'/},U={match:/\\'/},Y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},$.NUMBER_MODE,J]},F=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],W=$.SHEBANG({binary:`(${F.join("|")})`,relevance:10}),q={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[$.inherit($.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},N=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],A=["true","false"],V={match:/(\/[a-z._-]+)+/},D=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],L=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],j=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],M=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:N,literal:A,built_in:[...D,...L,"set","shopt",...j,...M]},contains:[W,$.SHEBANG(),q,Y,Q,X,V,z,G,K,U,J]}}function gf($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",K={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},U={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},Y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(K,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},F={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",A={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"},V=[Y,z,J,$.C_BLOCK_COMMENT_MODE,U,K],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:V.concat([{begin:/\(/,end:/\)/,keywords:A,contains:V.concat(["self"]),relevance:0}]),relevance:0},L={begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:A,relevance:0},{begin:W,returnBegin:!0,contains:[$.inherit(F,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,K,U,z,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,K,U,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,Y]};return{name:"C",aliases:["h"],keywords:A,disableAutodetect:!0,illegal:"</",contains:[].concat(D,L,V,[Y,{begin:$.IDENT_RE+"::",keywords:A},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},$.TITLE_MODE]}]),exports:{preprocessor:Y,strings:K,keywords:A}}}function ff($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",K={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},U={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},Y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(K,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},F={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",q=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],A=["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"],V=["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"],j={type:N,keyword:q,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:A},M={className:"function.dispatch",relevance:0,keywords:{_hint:V},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},P=[M,Y,z,J,$.C_BLOCK_COMMENT_MODE,U,K],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:P.concat([{begin:/\(/,end:/\)/,keywords:j,contains:P.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:j,relevance:0},{begin:W,returnBegin:!0,contains:[F],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[K,U]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,K,U,z,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,K,U,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,Y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(w,C,M,P,[Y,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:j,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function mf($){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"],H=["default","false","null","true"],B=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],Q=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],X={keyword:B.concat(Q),built_in:Z,literal:H},z=$.inherit($.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),G={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},K={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},U={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},Y=$.inherit(U,{illegal:/\n/}),F={className:"subst",begin:/\{/,end:/\}/,keywords:X},W=$.inherit(F,{illegal:/\n/}),q={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},$.BACKSLASH_ESCAPE,W]},N={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},F]},A=$.inherit(N,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},W]});F.contains=[N,q,U,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.C_BLOCK_COMMENT_MODE],W.contains=[A,q,Y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.inherit($.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let V={variants:[K,N,q,U,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},D={begin:"<",end:">",contains:[{beginKeywords:"in out"},z]},L=$.IDENT_RE+"(<"+$.IDENT_RE+"(\\s*,\\s*"+$.IDENT_RE+")*>)?(\\[\\])?",j={begin:"@"+$.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:X,illegal:/::/,contains:[$.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},V,G,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},z,D,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[z,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[z,D,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+L+"\\s+)+"+$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:X,contains:[{beginKeywords:J.join(" "),relevance:0},{begin:$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[$.TITLE_MODE,D],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:X,relevance:0,contains:[V,G,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},j]}}var g$0=($)=>{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_-]*/}}},f$0=["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"],m$0=["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"],u$0=[...f$0,...m$0],p$0=["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(),c$0=["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(),d$0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),l$0=["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 uf($){let Z=$.regex,J=g$0($),H={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},B="and or not only",Q=/@-?\w[\w]*(-\w+)*/,X="[a-zA-Z-][a-zA-Z0-9_-]*",z=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[J.BLOCK_COMMENT,H,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:":("+c$0.join("|")+")"},{begin:":(:)?("+d$0.join("|")+")"}]},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+l$0.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:Q},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:p$0.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...z,J.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+u$0.join("|")+")\\b"}]}}function pf($){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 cf($){let Q={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:Q,illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"string",variants:[$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[$.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Q,illegal:/["']/}]}]}}function df($){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 lf($){let Z=$.regex,J={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:$.NUMBER_RE}]},H=$.COMMENT();H.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let B={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},Q={className:"literal",begin:/\bon|off|true|false|yes|no\b/},X={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},z={begin:/\[/,end:/\]/,contains:[H,Q,B,X,J,"self"],relevance:0},G=/[A-Za-z0-9_-]+/,K=/"(\\"|[^"])*"/,U=/'[^']*'/,Y=Z.either(G,K,U),F=Z.concat(Y,"(\\s*\\.\\s*",Y,")*",Z.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[H,{className:"section",begin:/\[+/,end:/\]+/},{begin:F,className:"attr",starts:{end:/$/,contains:[H,z,Q,B,X,J]}}]}}var OJ="[0-9](_*[0-9])*",HF=`\\.(${OJ})`,BF="[0-9a-fA-F](_*[0-9a-fA-F])*",rf={className:"number",variants:[{begin:`(\\b(${OJ})((${HF})|\\.)?|(${HF}))[eE][+-]?(${OJ})[fFdD]?\\b`},{begin:`\\b(${OJ})((${HF})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${HF})[fFdD]?\\b`},{begin:`\\b(${OJ})[fFdD]\\b`},{begin:`\\b0[xX]((${BF})\\.?|(${BF})?\\.(${BF}))[pP][+-]?(${OJ})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${BF})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function af($,Z,J){if(J===-1)return"";return $.replace(Z,(H)=>{return af($,Z,J-1)})}function of($){let Z=$.regex,J="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",H="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+af("(?:<"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~(?:\\s*,\\s*"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~)*>)?",/~~~/g,2),G={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},K={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},U={className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[$.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:G,illegal:/<\/|#/,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[$.BACKSLASH_ESCAPE]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[Z.concat(/(?!else)/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"),/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"},contains:[U,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+H+"\\s+)",$.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:G,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[K,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,rf,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},rf,K]}}var i$0=["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"],r$0=["true","false","null","undefined","NaN","Infinity"],nf=["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"],sf=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],tf=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],a$0=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],o$0=[].concat(tf,nf,sf);function ef($){let Z=$.regex,J=(h,{after:f})=>{let E="</"+h[0].slice(1);return h.input.indexOf(E,f)!==-1},H="[A-Za-z$_][0-9A-Za-z$_]*",B={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(h,f)=>{let E=h[0].length+h.index,i=h.input[E];if(i==="<"||i===","){f.ignoreMatch();return}if(i===">"){if(!J(h,{after:E}))f.ignoreMatch()}let r,x=h.input.substring(E);if(r=x.match(/^\s*=/)){f.ignoreMatch();return}if(r=x.match(/^\s+extends\s+/)){if(r.index===0){f.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:i$0,literal:r$0,built_in:o$0,"variable.language":a$0},G="[0-9](_?[0-9])*",K="\\.([0-9](_?[0-9])*)",U="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",Y={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},F={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"xml"}},q={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"graphql"}},A={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,F]},D={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},L=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,A,{match:/\$\d+/},Y];F.contains=L.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(L)});let j=[].concat(D,F.contains),M=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(j)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M},w={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"}}]},C={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:{_:[...nf,...sf]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},S={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function y(h){return Z.concat("(?!",h.join("|"),")")}let k={match:Z.concat(/\b/,y([...tf,"super","import"].map((h)=>`${h}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},T={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},b={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",v={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:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,A,D,{match:/\$\d+/},Y,C,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},v,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,$.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:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:B.begin,end:B.end},{match:Q},{begin:X.begin,"on:begin":X.isTrulyOpeningTag,end:X.end}],subLanguage:"xml",contains:[{begin:X.begin,end:X.end,skip:!0,contains:["self"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},k,S,w,b,{match:/\$[(.]/}]}}function $m($){let Z={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},J={match:/[{}[\],:]/,className:"punctuation",relevance:0},H=["true","false","null"],B={scope:"literal",beginKeywords:H.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:H},contains:[Z,J,$.QUOTE_STRING_MODE,B,$.C_NUMBER_MODE,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var TJ="[0-9](_*[0-9])*",QF=`\\.(${TJ})`,XF="[0-9a-fA-F](_*[0-9a-fA-F])*",n$0={className:"number",variants:[{begin:`(\\b(${TJ})((${QF})|\\.)?|(${QF}))[eE][+-]?(${TJ})[fFdD]?\\b`},{begin:`\\b(${TJ})((${QF})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${QF})[fFdD]?\\b`},{begin:`\\b(${TJ})[fFdD]\\b`},{begin:`\\b0[xX]((${XF})\\.?|(${XF})?\\.(${XF}))[pP][+-]?(${TJ})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${XF})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Zm($){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+/}]}},H={className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"@"},B={className:"subst",begin:/\$\{/,end:/\}/,contains:[$.C_NUMBER_MODE]},Q={className:"variable",begin:"\\$"+$.UNDERSCORE_IDENT_RE},X={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[Q,B]},{begin:"'",end:"'",illegal:/\n/,contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[$.BACKSLASH_ESCAPE,Q,B]}]};B.contains.push(X);let z={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+$.UNDERSCORE_IDENT_RE+")?"},G={className:"meta",begin:"@"+$.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[$.inherit(X,{className:"string"}),"self"]}]},K=n$0,U=$.COMMENT("/\\*","\\*/",{contains:[$.C_BLOCK_COMMENT_MODE]}),Y={variants:[{className:"type",begin:$.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},F=Y;return F.variants[1].contains=[Y],Y.variants[1].contains=[F],{name:"Kotlin",aliases:["kt","kts"],keywords:Z,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),$.C_LINE_COMMENT_MODE,U,J,H,z,G,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:Z,relevance:5,contains:[{begin:$.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[$.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Z,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[Y,$.C_LINE_COMMENT_MODE,U],relevance:0},$.C_LINE_COMMENT_MODE,U,z,G,X,$.C_NUMBER_MODE]},U]},{begin:[/class|interface|trait/,/\s+/,$.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},$.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},z,G]},X,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
34
+ `},K]}}var s$0=($)=>{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_-]*/}}},t$0=["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"],e$0=["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"],$Z0=[...t$0,...e$0],ZZ0=["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(),Jm=["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(),Hm=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),JZ0=["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(),HZ0=Jm.concat(Hm).sort().reverse();function Bm($){let Z=s$0($),J=HZ0,H="and or not only",B="[\\w-]+",Q="([\\w-]+|@\\{[\\w-]+\\})",X=[],z=[],G=function(L){return{className:"string",begin:"~?"+L+".*?"+L}},K=function(L,j,M){return{className:L,begin:j,relevance:M}},U={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:ZZ0.join(" ")},Y={begin:"\\(",end:"\\)",contains:z,keywords:U,relevance:0};z.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,G("'"),G('"'),Z.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},Z.HEXCOLOR,Y,K("variable","@@?[\\w-]+",10),K("variable","@\\{[\\w-]+\\}"),K("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},Z.IMPORTANT,{beginKeywords:"and not"},Z.FUNCTION_DISPATCH);let F=z.concat({begin:/\{/,end:/\}/,contains:X}),W={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(z)},q={begin:Q+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+JZ0.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:z}}]},N={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:U,returnEnd:!0,contains:z,relevance:0}},A={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:F}},V={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:Q,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,W,K("keyword","all\\b"),K("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+$Z0.join("|")+")\\b",className:"selector-tag"},Z.CSS_NUMBER_MODE,K("selector-tag",Q,0),K("selector-id","#"+Q),K("selector-class","\\."+Q,0),K("selector-tag","&",0),Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Jm.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Hm.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:F},{begin:"!important"},Z.FUNCTION_DISPATCH]},D={begin:`[\\w-]+:(:)?(${J.join("|")})`,returnBegin:!0,contains:[V]};return X.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,N,A,D,q,V,W,Z.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:X}}function Qm($){let H={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},B=[$.COMMENT("--(?!\\[=*\\[)","$"),$.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[H],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:$.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:B.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[$.inherit($.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:B}].concat(B)},$.C_NUMBER_MODE,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[H],relevance:5}])}}function Xm($){let Z={className:"variable",variants:[{begin:"\\$\\("+$.UNDERSCORE_IDENT_RE+"\\)",contains:[$.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},J={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,Z]},H={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[Z,J]},B={begin:"^"+$.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},Q={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},X={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[Z]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[$.HASH_COMMENT_MODE,Z,J,H,B,Q,X]}}function zm($){let Z=$.regex,J={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},H={begin:"^[-\\*]{3,}",end:"$"},B={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},Q={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},X={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},z=/[A-Za-z][A-Za-z0-9+.-]*/,G={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin: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}]},K={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},U={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},Y=$.inherit(K,{contains:[]}),F=$.inherit(U,{contains:[]});K.contains.push(F),U.contains.push(Y);let W=[J,G];return[K,U,Y,F].forEach((V)=>{V.contains=V.contains.concat(W)}),W=W.concat(K,U),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:W},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:W}]}]},J,Q,K,U,{className:"quote",begin:"^>\\s+",contains:W,end:"$"},B,H,G,X,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Gm($){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"]},G={$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:"("+G.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:G,contains:[$.UNDERSCORE_TITLE_MODE]},{begin:"\\."+$.UNDERSCORE_IDENT_RE,relevance:0}]}}function Km($){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"],H=/[dualxmsipngr]{0,12}/,B={$pattern:/[\w.]+/,keyword:J.join(" ")},Q={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:B},X={begin:/->\{/,end:/\}/},z={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},G={scope:"variable",variants:[{begin:/\$\d/},{begin:Z.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[z]},K={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},U=[$.BACKSLASH_ESCAPE,Q,G],Y=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],F=(N,A,V="\\1")=>{let D=V==="\\1"?V:Z.concat(V,A);return Z.concat(Z.concat("(?:",N,")"),A,/(?:\\.|[^\\\/])*?/,D,/(?:\\.|[^\\\/])*?/,V,H)},W=(N,A,V)=>{return Z.concat(Z.concat("(?:",N,")"),A,/(?:\\.|[^\\\/])*?/,V,H)},q=[G,$.HASH_COMMENT_MODE,$.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),X,{className:"string",contains:U,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},K,{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:F("s|tr|y",Z.either(...Y,{capture:!0}))},{begin:F("s|tr|y","\\(","\\)")},{begin:F("s|tr|y","\\[","\\]")},{begin:F("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:W("(?:m|qr)?",/\//,/\//)},{begin:W("m|qr",Z.either(...Y,{capture:!0}),/\1/)},{begin:W("m|qr",/\(/,/\)/)},{begin:W("m|qr",/\[/,/\]/)},{begin:W("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,z]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,z,K]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return Q.contains=q,X.contains=q,{name:"Perl",aliases:["pl","pm"],keywords:B,contains:q}}function Um($){let Z=$.regex,J=/(?![A-Za-z0-9])(?![$])/,H=Z.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,J),B=Z.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,J),Q=Z.concat(/[A-Z]+/,J),X={scope:"variable",match:"\\$+"+H},z={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},G={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},K=$.inherit($.APOS_STRING_MODE,{illegal:null}),U=$.inherit($.QUOTE_STRING_MODE,{illegal:null,contains:$.QUOTE_STRING_MODE.contains.concat(G)}),Y={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:$.QUOTE_STRING_MODE.contains.concat(G),"on:begin":(T,b)=>{b.data._beginMatch=T[1]||T[2]},"on:end":(T,b)=>{if(b.data._beginMatch!==T[1])b.ignoreMatch()}},F=$.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),W=`[
35
+ ]`,q={scope:"string",variants:[U,K,Y,F]},N={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},A=["false","null","true"],V=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],D=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],j={keyword:V,literal:((T)=>{let b=[];return T.forEach((I)=>{if(b.push(I),I.toLowerCase()===I)b.push(I.toUpperCase());else b.push(I.toLowerCase())}),b})(A),built_in:D},M=(T)=>{return T.map((b)=>{return b.replace(/\|\d+$/,"")})},P={variants:[{match:[/new/,Z.concat(`[
36
+ ]`,"+"),Z.concat("(?!",M(D).join("\\b|"),"\\b)"),B],scope:{1:"keyword",4:"title.class"}}]},w=Z.concat(H,"\\b(?!\\()"),C={variants:[{match:[Z.concat(/::/,Z.lookahead(/(?!class\b)/)),w],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[B,Z.concat(/::/,Z.lookahead(/(?!class\b)/)),w],scope:{1:"title.class",3:"variable.constant"}},{match:[B,Z.concat("::",Z.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[B,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:Z.concat(H,Z.lookahead(":"),Z.lookahead(/(?!::)/))},O={relevance:0,begin:/\(/,end:/\)/,keywords:j,contains:[R,X,C,$.C_BLOCK_COMMENT_MODE,q,N,P]},S={relevance:0,match:[/\b/,Z.concat("(?!fn\\b|function\\b|",M(V).join("\\b|"),"|",M(D).join("\\b|"),"\\b)"),H,Z.concat(`[
37
+ ]`,"*"),Z.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[O]};O.contains.push(S);let y=[R,C,$.C_BLOCK_COMMENT_MODE,q,N,P],k={begin:Z.concat(/#\[\s*\\?/,Z.either(B,Q)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:A,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:A,keyword:["new","array"]},contains:["self",...y]},...y,{scope:"meta",variants:[{match:B},{match:Q}]}]};return{case_insensitive:!1,keywords:j,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/},X,S,C,{match:[/const/,/\s/,H],scope:{1:"keyword",3:"variable.constant"}},P,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},$.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:j,contains:["self",k,X,C,$.C_BLOCK_COMMENT_MODE,q,N]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},$.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[$.inherit($.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},$.UNDERSCORE_TITLE_MODE]},q,N]}}function Ym($){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 Fm($){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Wm($){let Z=$.regex,J=/[\p{XID_Start}_]\p{XID_Continue}*/u,H=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],z={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:H,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},G={className:"meta",begin:/^(>>>|\.\.\.) /},K={className:"subst",begin:/\{/,end:/\}/,keywords:z,illegal:/#/},U={begin:/\{\{/,relevance:0},Y={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,G],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,G,U,K]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G,U,K]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[$.BACKSLASH_ESCAPE,U,K]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,U,K]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},F="[0-9](_?[0-9])*",W="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",q=`\\b|${H.join("|")}`,N={className:"number",relevance:0,variants:[{begin:`(\\b([0-9](_?[0-9])*)|((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.))[eE][+-]?([0-9](_?[0-9])*)[jJ]?(?=${q})`},{begin:"((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.)[jJ]?"},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${q})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${q})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${q})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${q})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${q})`}]},A={className:"comment",begin:Z.lookahead(/# type:/),end:/$/,keywords:z,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},V={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:["self",G,N,Y,$.HASH_COMMENT_MODE]}]};return K.contains=[Y,N,G],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:z,illegal:/(<\/|\?)|=>/,contains:[G,N,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},Y,A,$.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,J],scope:{1:"keyword",3:"title.function"},contains:[V]},{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:[N,V,Y]}]}}function qm($){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Nm($){let Z=$.regex,J=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,H=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]?/),B=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,Q=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:[B,H]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,H]},{scope:{1:"punctuation",2:"number"},match:[Q,H]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,H]}]},{scope:{3:"operator"},match:[J,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:B},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:Q},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Vm($){let Z=$.regex,J="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",H=Z.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),B=Z.concat(H,/(::\w+)*/),X={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},z={className:"doctag",begin:"@[A-Za-z]+"},G={begin:"#<",end:">"},K=[$.COMMENT("#","$",{contains:[z]}),$.COMMENT("^=begin","^=end",{contains:[z],relevance:10}),$.COMMENT("^__END__",$.MATCH_NOTHING_RE)],U={className:"subst",begin:/#\{/,end:/\}/,keywords:X},Y={className:"string",contains:[$.BACKSLASH_ESCAPE,U],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:Z.concat(/<<[-~]?'?/,Z.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[$.BACKSLASH_ESCAPE,U]})]}]},F="[1-9](_?[0-9])*|0",W="[0-9](_?[0-9])*",q={className:"number",relevance:0,variants:[{begin:"\\b([1-9](_?[0-9])*|0)(\\.([0-9](_?[0-9])*))?([eE][+-]?([0-9](_?[0-9])*)|r)?i?\\b"},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},N={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:X}]},P=[Y,{variants:[{match:[/class\s+/,B,/\s+<\s+/,B]},{match:[/\b(class|module)\s+/,B]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:X},{match:[/(include|extend)\s+/,B],scope:{2:"title.class"},keywords:X},{relevance:0,match:[B,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:H,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[N]},{begin:$.IDENT_RE+"::"},{className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[Y,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},q,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:X},{begin:"("+$.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[$.BACKSLASH_ESCAPE,U],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(G,K),relevance:0}].concat(G,K);U.contains=P,N.contains=P;let w="[>?]>",C="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",R="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",O=[{begin:/^\s*=>/,starts:{end:"$",contains:P}},{className:"meta.prompt",begin:"^("+w+"|"+C+"|"+R+")(?=[ ])",starts:{end:"$",keywords:X,contains:P}}];return K.unshift(G),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:X,illegal:/\/\*/,contains:[$.SHEBANG({binary:"ruby"})].concat(O).concat(K).concat(P)}}function Am($){let Z=$.regex,J=/(r#)?/,H=Z.concat(J,$.UNDERSCORE_IDENT_RE),B=Z.concat(J,$.IDENT_RE),Q={className:"title.function.invoke",relevance:0,begin:Z.concat(/\b/,/(?!let|for|while|if|else|match\b)/,B,Z.lookahead(/\s*\(/))},X="([ui](8|16|32|64|128|size)|f(32|64))?",z=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],G=["true","false","Some","None","Ok","Err"],K=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],U=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:$.IDENT_RE+"!?",type:U,keyword:z,literal:G,built_in:K},illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.COMMENT("/\\*","\\*/",{contains:["self"]}),$.inherit($.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?"}],relevance:0},{begin:[/fn/,/\s+/,H],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,H],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,H,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,H],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,H],className:{1:"keyword",3:"title.class"}},{begin:$.IDENT_RE+"::",keywords:{keyword:"Self",built_in:K,type:U}},{className:"punctuation",begin:"->"},Q]}}var BZ0=($)=>{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_-]*/}}},QZ0=["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"],XZ0=["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"],zZ0=[...QZ0,...XZ0],GZ0=["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(),KZ0=["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(),UZ0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),YZ0=["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 Dm($){let Z=BZ0($),J=UZ0,H=KZ0,B="@[a-z-]+",Q="and or not only",X="[a-zA-Z-][a-zA-Z0-9_-]*",z={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,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("+zZ0.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+H.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+J.join("|")+")"},z,{begin:/\(/,end:/\)/,contains:[Z.CSS_NUMBER_MODE]},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+YZ0.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:GZ0.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 Lm($){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Mm($){let Z=$.regex,J=$.COMMENT("--","$"),H={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},B={begin:/"/,end:/"/,contains:[{match:/""/}]},Q=["true","false","unknown"],X=["double precision","large object","with timezone","without timezone"],z=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],G=["add","asc","collation","desc","final","first","last","view"],K=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],U=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],Y=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],F=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],W=U,q=[...K,...G].filter((M)=>{return!U.includes(M)}),N={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},A={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},V={match:Z.concat(/\b/,Z.either(...W),/\s*\(/),relevance:0,keywords:{built_in:W}};function D(M){return Z.concat(/\b/,Z.either(...M.map((P)=>{return P.replace(/\s+/,"\\s+")})),/\b/)}let L={scope:"keyword",match:D(F),relevance:0};function j(M,{exceptions:P,when:w}={}){let C=w;return P=P||[],M.map((R)=>{if(R.match(/\|\d+$/)||P.includes(R))return R;else if(C(R))return`${R}|0`;else return R})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:j(q,{when:(M)=>M.length<3}),literal:Q,type:z,built_in:Y},contains:[{scope:"type",match:D(X)},L,V,N,H,B,$.C_NUMBER_MODE,$.C_BLOCK_COMMENT_MODE,J,A]}}function Om($){if(!$)return null;if(typeof $==="string")return $;return $.source}function VQ($){return M5("(?=",$,")")}function M5(...$){return $.map((J)=>Om(J)).join("")}function FZ0($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function _4(...$){return"("+(FZ0($).capture?"":"?:")+$.map((H)=>Om(H)).join("|")+")"}var TL=($)=>M5(/\b/,$,/\w$/.test($)?/\b/:/\B/),WZ0=["Protocol","Type"].map(TL),Pm=["init","self"].map(TL),qZ0=["Any","Self"],jL=["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"],_m=["false","nil","true"],NZ0=["assignment","associativity","higherThan","left","lowerThan","none","right"],VZ0=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],jm=["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"],Tm=_4(/[/=\-+!*%<>&|^~?]/,/[\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]/),Cm=_4(Tm,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),OL=M5(Tm,Cm,"*"),Em=_4(/[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]/),GF=_4(Em,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),o9=M5(Em,GF,"*"),zF=M5(/[A-Z]/,GF,"*"),AZ0=["attached","autoclosure",M5(/convention\(/,_4("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",M5(/objc\(/,o9,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],DZ0=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function wm($){let Z={match:/\s+/,relevance:0},J=$.COMMENT("/\\*","\\*/",{contains:["self"]}),H=[$.C_LINE_COMMENT_MODE,J],B={match:[/\./,_4(...WZ0,...Pm)],className:{2:"keyword"}},Q={match:M5(/\./,_4(...jL)),relevance:0},X=jL.filter((Y0)=>typeof Y0==="string").concat(["_|0"]),z=jL.filter((Y0)=>typeof Y0!=="string").concat(qZ0).map(TL),G={variants:[{className:"keyword",match:_4(...z,...Pm)}]},K={$pattern:_4(/\b\w+/,/#\w+/),keyword:X.concat(VZ0),literal:_m},U=[B,Q,G],Y={match:M5(/\./,_4(...jm)),relevance:0},F={className:"built_in",match:M5(/\b/,_4(...jm),/(?=\()/)},W=[Y,F],q={match:/->/,relevance:0},N={className:"operator",relevance:0,variants:[{match:OL},{match:`\\.(\\.|${Cm})+`}]},A=[q,N],V="([0-9]_*)+",D="([0-9a-fA-F]_*)+",L={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/}]},j=(Y0="")=>({className:"subst",variants:[{match:M5(/\\/,Y0,/[0\\tnr"']/)},{match:M5(/\\/,Y0,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(Y0="")=>({className:"subst",match:M5(/\\/,Y0,/[\t ]*(?:[\r\n]|\r\n)/)}),P=(Y0="")=>({className:"subst",label:"interpol",begin:M5(/\\/,Y0,/\(/),end:/\)/}),w=(Y0="")=>({begin:M5(Y0,/"""/),end:M5(/"""/,Y0),contains:[j(Y0),M(Y0),P(Y0)]}),C=(Y0="")=>({begin:M5(Y0,/"/),end:M5(/"/,Y0),contains:[j(Y0),P(Y0)]}),R={className:"string",variants:[w(),w("#"),w("##"),w("###"),C(),C("#"),C("##"),C("###")]},O=[$.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[$.BACKSLASH_ESCAPE]}],S={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:O},y=(Y0)=>{let s=M5(Y0,/\//),a=M5(/\//,Y0);return{begin:s,end:a,contains:[...O,{scope:"comment",begin:`#(?!.*${a})`,end:/$/}]}},k={scope:"regexp",variants:[y("###"),y("##"),y("#"),S]},T={match:M5(/`/,o9,/`/)},b={className:"variable",match:/\$\d+/},I={className:"variable",match:`\\$${GF}+`},v=[T,b,I],h={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:DZ0,contains:[...A,L,R]}]}},f={scope:"keyword",match:M5(/@/,_4(...AZ0),VQ(_4(/\(/,/\s+/)))},E={scope:"meta",match:M5(/@/,o9)},i=[h,f,E],r={match:VQ(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:M5(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,GF,"+")},{className:"type",match:zF,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:M5(/\s+&\s+/,VQ(zF)),relevance:0}]},x={begin:/</,end:/>/,keywords:K,contains:[...H,...U,...i,q,r]};r.contains.push(x);let l={match:M5(o9,/\s*:/),keywords:"_|0",relevance:0},o={begin:/\(/,end:/\)/,relevance:0,keywords:K,contains:["self",l,...H,k,...U,...W,...A,L,R,...v,...i,r]},u={begin:/</,end:/>/,keywords:"repeat each",contains:[...H,r]},c={begin:_4(VQ(M5(o9,/\s*:/)),VQ(M5(o9,/\s+/,o9,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:o9}]},n={begin:/\(/,end:/\)/,keywords:K,contains:[c,...H,...U,...A,L,R,...i,r,o],endsParent:!0,illegal:/["']/},Z0={match:[/(func|macro)/,/\s+/,_4(T.match,o9,OL)],className:{1:"keyword",3:"title.function"},contains:[u,n,Z],illegal:[/\[/,/%/]},J0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[u,n,Z],illegal:/\[|%/},X0={match:[/operator/,/\s+/,OL],className:{1:"keyword",3:"title"}},Q0={begin:[/precedencegroup/,/\s+/,zF],className:{1:"keyword",3:"title"},contains:[r],keywords:[...NZ0,..._m],end:/}/},F0={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},A0={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},N0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,o9,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:K,contains:[u,...U,{begin:/:/,end:/\{/,keywords:K,contains:[{scope:"title.class.inherited",match:zF},...U],relevance:0}]};for(let Y0 of R.variants){let s=Y0.contains.find((e)=>e.label==="interpol");s.keywords=K;let a=[...U,...W,...A,L,R,...v];s.contains=[...a,{begin:/\(/,end:/\)/,contains:["self",...a]}]}return{name:"Swift",keywords:K,contains:[...H,Z0,J0,F0,A0,N0,X0,Q0,{beginKeywords:"import",end:/$/,contains:[...H],relevance:0},k,...U,...W,...A,L,R,...v,...i,r,o]}}var Sm=["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"],Im=["true","false","null","undefined","NaN","Infinity"],Rm=["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"],bm=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],km=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ym=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],xm=[].concat(km,Rm,bm);function LZ0($){let Z=$.regex,J=(h,{after:f})=>{let E="</"+h[0].slice(1);return h.input.indexOf(E,f)!==-1},H="[A-Za-z$_][0-9A-Za-z$_]*",B={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(h,f)=>{let E=h[0].length+h.index,i=h.input[E];if(i==="<"||i===","){f.ignoreMatch();return}if(i===">"){if(!J(h,{after:E}))f.ignoreMatch()}let r,x=h.input.substring(E);if(r=x.match(/^\s*=/)){f.ignoreMatch();return}if(r=x.match(/^\s+extends\s+/)){if(r.index===0){f.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Sm,literal:Im,built_in:xm,"variable.language":ym},G="[0-9](_?[0-9])*",K="\\.([0-9](_?[0-9])*)",U="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",Y={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},F={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"xml"}},q={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"graphql"}},A={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,F]},D={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},L=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,A,{match:/\$\d+/},Y];F.contains=L.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(L)});let j=[].concat(D,F.contains),M=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(j)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M},w={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"}}]},C={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:{_:[...Rm,...bm]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},S={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function y(h){return Z.concat("(?!",h.join("|"),")")}let k={match:Z.concat(/\b/,y([...km,"super","import"].map((h)=>`${h}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},T={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},b={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",v={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:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,A,D,{match:/\$\d+/},Y,C,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},v,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,$.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:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:B.begin,end:B.end},{match:Q},{begin:X.begin,"on:begin":X.isTrulyOpeningTag,end:X.end}],subLanguage:"xml",contains:[{begin:X.begin,end:X.end,skip:!0,contains:["self"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},k,S,w,b,{match:/\$[(.]/}]}}function hm($){let Z=$.regex,J=LZ0($),H="[A-Za-z$_][0-9A-Za-z$_]*",B=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],Q={begin:[/namespace/,/\s+/,$.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},X={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:B},contains:[J.exports.CLASS_REFERENCE]},z={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},G=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],K={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Sm.concat(G),literal:Im,built_in:xm.concat(B),"variable.language":ym},U={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},Y=(N,A,V)=>{let D=N.contains.findIndex((L)=>L.label===A);if(D===-1)throw Error("can not find mode to replace");N.contains.splice(D,1,V)};Object.assign(J.keywords,K),J.exports.PARAMS_CONTAINS.push(U);let F=J.contains.find((N)=>N.scope==="attr"),W=Object.assign({},F,{match:Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\?:/))});J.exports.PARAMS_CONTAINS.push([J.exports.CLASS_REFERENCE,F,W]),J.contains=J.contains.concat([U,Q,X,W]),Y(J,"shebang",$.SHEBANG()),Y(J,"use_strict",z);let q=J.contains.find((N)=>N.label==="func.def");return q.relevance=0,Object.assign(J,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),J}function vm($){let Z=$.regex,J={className:"string",begin:/"(""|[^/n])"C\b/},H={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},B=/\d{1,2}\/\d{1,2}\/\d{4}/,Q=/\d{4}-\d{1,2}-\d{1,2}/,X=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,z=/\d{1,2}(:\d{1,2}){1,2}/,G={className:"literal",variants:[{begin:Z.concat(/# */,Z.either(Q,B),/ *#/)},{begin:Z.concat(/# */,z,/ *#/)},{begin:Z.concat(/# */,X,/ *#/)},{begin:Z.concat(/# */,Z.either(Q,B),/ +/,Z.either(X,z),/ *#/)}]},K={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},U={className:"label",begin:/^\w+:/},Y=$.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),F=$.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,H,G,K,U,Y,F,{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:[F]}]}}function gm($){$.regex;let Z=$.COMMENT(/\(;/,/;\)/);Z.contains.push("self");let J=$.COMMENT(/;;/,/$/),H=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],B={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},Q={className:"variable",begin:/\$[\w_]+/},X={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},z={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},G={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},K={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:H},contains:[J,Z,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},Q,X,B,$.QUOTE_STRING_MODE,G,K,z]}}function fm($){let Z=$.regex,J=Z.concat(/[\p{L}_]/u,Z.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),H=/[\p{L}0-9._:-]+/u,B={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},Q={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},X=$.inherit(Q,{begin:/\(/,end:/\)/}),z=$.inherit($.APOS_STRING_MODE,{className:"string"}),G=$.inherit($.QUOTE_STRING_MODE,{className:"string"}),K={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:H,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[B]},{begin:/'/,end:/'/,contains:[B]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[Q,G,z,X,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[Q,X,G,z]}]}]},$.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},B,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[G]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[K],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[K],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:K}]},{className:"tag",begin:Z.concat(/<\//,Z.lookahead(Z.concat(J,/>/))),contains:[{className:"name",begin:J,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function mm($){let H={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},B={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},Q={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},X={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[$.BACKSLASH_ESCAPE,B]},z=$.inherit(X,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),G="[0-9]{4}(-[0-9][0-9]){0,2}",K="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",U="(\\.[0-9]*)?",Y="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",F={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},W={end:",",endsWithParent:!0,excludeEnd:!0,keywords:"true false yes no null",relevance:0},q={begin:/\{/,end:/\}/,contains:[W],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[W],illegal:"\\n",relevance:0},A=[H,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!<[\\w#;/?:@&=+$,.~*'()[\\]]+>"},{className:"type",begin:"![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"meta",begin:"&"+$.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+$.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},$.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},F,{className:"number",begin:$.C_NUMBER_RE+"\\b",relevance:0},q,N,Q,X],V=[...A];return V.pop(),V.push(z),W.contains=V,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:A}}var CL={arduino:hf,bash:vf,c:gf,cpp:ff,csharp:mf,css:uf,diff:pf,go:cf,graphql:df,ini:lf,java:of,javascript:ef,json:$m,kotlin:Zm,less:Bm,lua:Qm,makefile:Xm,markdown:zm,objectivec:Gm,perl:Km,php:Um,"php-template":Ym,plaintext:Fm,python:Wm,"python-repl":qm,r:Nm,ruby:Vm,rust:Am,scss:Dm,shell:Lm,sql:Mm,swift:wm,typescript:hm,vbnet:vm,wasm:gm,xml:fm,yaml:mm};var Uu=_(Ku(),1);var Yu=Uu.default;var Fu={},KJ0="hljs-";function kL($){let Z=Yu.newInstance();if($)Q($);return{highlight:J,highlightAuto:H,listLanguages:B,register:Q,registerAlias:X,registered:z};function J(G,K,U){n1(typeof G==="string","expected `string` as `name`"),n1(typeof K==="string","expected `string` as `value`");let Y=U||Fu,F=typeof Y.prefix==="string"?Y.prefix:KJ0;if(!Z.getLanguage(G))throw Error("Unknown language: `"+G+"` is not registered");Z.configure({__emitter:Wu,classPrefix:F});let W=Z.highlight(K,{ignoreIllegals:!0,language:G});if(W.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:W.errorRaised});let q=W._emitter.root,N=q.data;return N.language=W.language,N.relevance=W.relevance,q}function H(G,K){n1(typeof G==="string","expected `string` as `value`");let Y=(K||Fu).subset||B(),F=-1,W=0,q;while(++F<Y.length){let N=Y[F];if(!Z.getLanguage(N))continue;let A=J(N,G,K);if(A.data&&A.data.relevance!==void 0&&A.data.relevance>W)W=A.data.relevance,q=A}return q||{type:"root",children:[],data:{language:void 0,relevance:W}}}function B(){return Z.listLanguages()}function Q(G,K){if(typeof G==="string")n1(K!==void 0,"expected `grammar`"),Z.registerLanguage(G,K);else{let U;for(U in G)if(Object.hasOwn(G,U))Z.registerLanguage(U,G[U])}}function X(G,K){if(typeof G==="string")n1(K!==void 0),Z.registerAliases(typeof K==="string"?K:[...K],{languageName:G});else{let U;for(U in G)if(Object.hasOwn(G,U)){let Y=G[U];Z.registerAliases(typeof Y==="string"?Y:[...Y],{languageName:U})}}}function z(G){return Boolean(Z.getLanguage(G))}}class Wu{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],H=$.root.children;if(Z)J.children.push({type:"element",tagName:"span",properties:{className:[Z]},children:H});else J.children.push(...H)}openNode($){let Z=this,J=$.split(".").map(function(Q,X){return X?Q+"_".repeat(X):Z.options.classPrefix+Q}),H=this.stack[this.stack.length-1],B={type:"element",tagName:"span",properties:{className:J},children:[]};H.children.push(B),this.stack.push(B)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var UJ0={};function FF($){let Z=$||UJ0,J=Z.aliases,H=Z.detect||!1,B=Z.languages||CL,Q=Z.plainText,X=Z.prefix,z=Z.subset,G="hljs",K=kL(B);if(J)K.registerAlias(J);if(X){let U=X.indexOf("-");G=U===-1?X:X.slice(0,U)}return function(U,Y){j3(U,"element",function(F,W,q){if(F.tagName!=="code"||!q||q.type!=="element"||q.tagName!=="pre")return;let N=YJ0(F);if(N===!1||!N&&!H||N&&Q&&Q.includes(N))return;if(!Array.isArray(F.properties.className))F.properties.className=[];if(!F.properties.className.includes(G))F.properties.className.unshift(G);let A=_L(F,{whitespace:"pre"}),V;try{V=N?K.highlight(N,A,{prefix:X}):K.highlightAuto(A,{prefix:X,subset:z})}catch(D){let L=D;if(N&&/Unknown language/.test(L.message)){Y.message("Cannot highlight as `"+N+"`, it’s not registered",{ancestors:[q,F],cause:L,place:F.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw L}if(!N&&V.data&&V.data.language)F.properties.className.push("language-"+V.data.language);if(V.children.length>0)F.children=V.children})}}function YJ0($){let Z=$.properties.className,J=-1;if(!Array.isArray(Z))return;let H;while(++J<Z.length){let B=String(Z[J]);if(B==="no-highlight"||B==="nohighlight")return!1;if(!H&&B.slice(0,5)==="lang-")H=B.slice(5);if(!H&&B.slice(0,9)==="language-")H=B.slice(9)}return H}function yL($,Z){let J=String($);if(typeof Z!=="string")throw TypeError("Expected character");let H=0,B=J.indexOf(Z);while(B!==-1)H++,B=J.indexOf(Z,B+Z.length);return H}function xL($){if(typeof $!=="string")throw TypeError("Expected a string");return $.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function hL($,Z,J){let B=a9((J||{}).ignore||[]),Q=FJ0(Z),X=-1;while(++X<Q.length)WQ($,"text",z);function z(K,U){let Y=-1,F;while(++Y<U.length){let W=U[Y],q=F?F.children:void 0;if(B(W,q?q.indexOf(W):void 0,F))return;F=W}if(F)return G(K,U)}function G(K,U){let Y=U[U.length-1],F=Q[X][0],W=Q[X][1],q=0,A=Y.children.indexOf(K),V=!1,D=[];F.lastIndex=0;let L=F.exec(K.value);while(L){let j=L.index,M={index:L.index,input:L.input,stack:[...U,K]},P=W(...L,M);if(typeof P==="string")P=P.length>0?{type:"text",value:P}:void 0;if(P===!1)F.lastIndex=j+1;else{if(q!==j)D.push({type:"text",value:K.value.slice(q,j)});if(Array.isArray(P))D.push(...P);else if(P)D.push(P);q=j+L[0].length,V=!0}if(!F.global)break;L=F.exec(K.value)}if(V){if(q<K.value.length)D.push({type:"text",value:K.value.slice(q)});Y.children.splice(A,1,...D)}else D=[K];return A+D.length}}function FJ0($){let Z=[];if(!Array.isArray($))throw TypeError("Expected find and replace tuple or list of tuples");let J=!$[0]||Array.isArray($[0])?$:[$],H=-1;while(++H<J.length){let B=J[H];Z.push([WJ0(B[0]),qJ0(B[1])])}return Z}function WJ0($){return typeof $==="string"?new RegExp(xL($),"g"):$}function qJ0($){return typeof $==="function"?$:function(){return $}}var vL="phrasing",gL=["autolink","link","image","label"];function mL(){return{transforms:[MJ0],enter:{literalAutolink:NJ0,literalAutolinkEmail:fL,literalAutolinkHttp:fL,literalAutolinkWww:fL},exit:{literalAutolink:LJ0,literalAutolinkEmail:DJ0,literalAutolinkHttp:VJ0,literalAutolinkWww:AJ0}}}function uL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:vL,notInConstruct:gL},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:vL,notInConstruct:gL},{character:":",before:"[ps]",after:"\\/",inConstruct:vL,notInConstruct:gL}]}}function NJ0($){this.enter({type:"link",title:null,url:"",children:[]},$)}function fL($){this.config.enter.autolinkProtocol.call(this,$)}function VJ0($){this.config.exit.autolinkProtocol.call(this,$)}function AJ0($){this.config.exit.data.call(this,$);let Z=this.stack[this.stack.length-1];n1(Z.type==="link"),Z.url="http://"+this.sliceSerialize($)}function DJ0($){this.config.exit.autolinkEmail.call(this,$)}function LJ0($){this.exit($)}function MJ0($){hL($,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,PJ0],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,_J0]],{ignore:["link","linkReference"]})}function PJ0($,Z,J,H,B){let Q="";if(!qu(B))return!1;if(/^w/i.test(Z))J=Z+J,Z="",Q="http://";if(!jJ0(J))return!1;let X=OJ0(J+H);if(!X[0])return!1;let z={type:"link",title:null,url:Q+Z+X[0],children:[{type:"text",value:Z+X[0]}]};if(X[1])return[z,{type:"text",value:X[1]}];return z}function _J0($,Z,J,H){if(!qu(H,!0)||/[-\d_]$/.test(J))return!1;return{type:"link",title:null,url:"mailto:"+Z+"@"+J,children:[{type:"text",value:Z+"@"+J}]}}function jJ0($){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 OJ0($){let Z=/[!"&'),.:;<>?\]}]+$/.exec($);if(!Z)return[$,void 0];$=$.slice(0,Z.index);let J=Z[0],H=J.indexOf(")"),B=yL($,"("),Q=yL($,")");while(H!==-1&&B>Q)$+=J.slice(0,H+1),J=J.slice(H+1),H=J.indexOf(")"),Q++;return[$,J]}function qu($,Z){let J=$.input.charCodeAt($.index-1);return($.index===0||i9(J)||q$(J))&&(!Z||J!==47)}Nu.peek=kJ0;function TJ0(){this.buffer()}function CJ0($){this.enter({type:"footnoteReference",identifier:"",label:""},$)}function EJ0(){this.buffer()}function wJ0($){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},$)}function SJ0($){let Z=this.resume(),J=this.stack[this.stack.length-1];n1(J.type==="footnoteReference"),J.identifier=Q4(this.sliceSerialize($)).toLowerCase(),J.label=Z}function IJ0($){this.exit($)}function RJ0($){let Z=this.resume(),J=this.stack[this.stack.length-1];n1(J.type==="footnoteDefinition"),J.identifier=Q4(this.sliceSerialize($)).toLowerCase(),J.label=Z}function bJ0($){this.exit($)}function kJ0(){return"["}function Nu($,Z,J,H){let B=J.createTracker(H),Q=B.move("[^"),X=J.enter("footnoteReference"),z=J.enter("reference");return Q+=B.move(J.safe(J.associationId($),{after:"]",before:Q})),z(),X(),Q+=B.move("]"),Q}function pL(){return{enter:{gfmFootnoteCallString:TJ0,gfmFootnoteCall:CJ0,gfmFootnoteDefinitionLabelString:EJ0,gfmFootnoteDefinition:wJ0},exit:{gfmFootnoteCallString:SJ0,gfmFootnoteCall:IJ0,gfmFootnoteDefinitionLabelString:RJ0,gfmFootnoteDefinition:bJ0}}}function cL($){let Z=!1;if($&&$.firstLineBlank)Z=!0;return{handlers:{footnoteDefinition:J,footnoteReference:Nu},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function J(H,B,Q,X){let z=Q.createTracker(X),G=z.move("[^"),K=Q.enter("footnoteDefinition"),U=Q.enter("label");if(G+=z.move(Q.safe(Q.associationId(H),{before:G,after:"]"})),U(),G+=z.move("]:"),H.children&&H.children.length>0)z.shift(4),G+=z.move((Z?`
38
+ `:" ")+Q.indentLines(Q.containerFlow(H,z.current()),Z?Vu:yJ0));return K(),G}}function yJ0($,Z,J){return Z===0?$:Vu($,Z,J)}function Vu($,Z,J){return(J?"":" ")+$}var xJ0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Au.peek=gJ0;function dL(){return{canContainEols:["delete"],enter:{strikethrough:hJ0},exit:{strikethrough:vJ0}}}function lL(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xJ0}],handlers:{delete:Au}}}function hJ0($){this.enter({type:"delete",children:[]},$)}function vJ0($){this.exit($)}function Au($,Z,J,H){let B=J.createTracker(H),Q=J.enter("strikethrough"),X=B.move("~~");return X+=J.containerPhrasing($,{...B.current(),before:X,after:"~"}),X+=B.move("~~"),Q(),X}function gJ0(){return"~"}function fJ0($){return $.length}function Lu($,Z){let J=Z||{},H=(J.align||[]).concat(),B=J.stringLength||fJ0,Q=[],X=[],z=[],G=[],K=0,U=-1;while(++U<$.length){let N=[],A=[],V=-1;if($[U].length>K)K=$[U].length;while(++V<$[U].length){let D=mJ0($[U][V]);if(J.alignDelimiters!==!1){let L=B(D);if(A[V]=L,G[V]===void 0||L>G[V])G[V]=L}N.push(D)}X[U]=N,z[U]=A}let Y=-1;if(typeof H==="object"&&"length"in H)while(++Y<K)Q[Y]=Du(H[Y]);else{let N=Du(H);while(++Y<K)Q[Y]=N}Y=-1;let F=[],W=[];while(++Y<K){let N=Q[Y],A="",V="";if(N===99)A=":",V=":";else if(N===108)A=":";else if(N===114)V=":";let D=J.alignDelimiters===!1?1:Math.max(1,G[Y]-A.length-V.length),L=A+"-".repeat(D)+V;if(J.alignDelimiters!==!1){if(D=A.length+D+V.length,D>G[Y])G[Y]=D;W[Y]=D}F[Y]=L}X.splice(1,0,F),z.splice(1,0,W),U=-1;let q=[];while(++U<X.length){let N=X[U],A=z[U];Y=-1;let V=[];while(++Y<K){let D=N[Y]||"",L="",j="";if(J.alignDelimiters!==!1){let M=G[Y]-(A[Y]||0),P=Q[Y];if(P===114)L=" ".repeat(M);else if(P===99)if(M%2)L=" ".repeat(M/2+0.5),j=" ".repeat(M/2-0.5);else L=" ".repeat(M/2),j=L;else j=" ".repeat(M)}if(J.delimiterStart!==!1&&!Y)V.push("|");if(J.padding!==!1&&!(J.alignDelimiters===!1&&D==="")&&(J.delimiterStart!==!1||Y))V.push(" ");if(J.alignDelimiters!==!1)V.push(L);if(V.push(D),J.alignDelimiters!==!1)V.push(j);if(J.padding!==!1)V.push(" ");if(J.delimiterEnd!==!1||Y!==K-1)V.push("|")}q.push(J.delimiterEnd===!1?V.join("").replace(/ +$/,""):V.join(""))}return q.join(`
39
+ `)}function mJ0($){return $===null||$===void 0?"":String($)}function Du($){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 Mu($,Z,J,H){let B=J.enter("blockquote"),Q=J.createTracker(H);Q.move("> "),Q.shift(2);let X=J.indentLines(J.containerFlow($,Q.current()),uJ0);return B(),X}function uJ0($,Z,J){return">"+(J?"":" ")+$}function _u($,Z){return Pu($,Z.inConstruct,!0)&&!Pu($,Z.notInConstruct,!1)}function Pu($,Z,J){if(typeof Z==="string")Z=[Z];if(!Z||Z.length===0)return J;let H=-1;while(++H<Z.length)if($.includes(Z[H]))return!0;return!1}function iL($,Z,J,H){let B=-1;while(++B<J.unsafe.length)if(J.unsafe[B].character===`
40
+ `&&_u(J.stack,J.unsafe[B]))return/[ \t]/.test(H.before)?"":" ";return"\\\n"}function ju($,Z){let J=String($),H=J.indexOf(Z),B=H,Q=0,X=0;if(typeof Z!=="string")throw TypeError("Expected substring");while(H!==-1){if(H===B){if(++Q>X)X=Q}else Q=1;B=H+Z.length,H=J.indexOf(Z,B)}return X}function Ou($,Z){return Boolean(Z.options.fences===!1&&$.value&&!$.lang&&/[^ \r\n]/.test($.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test($.value))}function Tu($){let Z=$.options.fence||"`";if(Z!=="`"&&Z!=="~")throw Error("Cannot serialize code with `"+Z+"` for `options.fence`, expected `` ` `` or `~`");return Z}function Cu($,Z,J,H){let B=Tu(J),Q=$.value||"",X=B==="`"?"GraveAccent":"Tilde";if(Ou($,J)){let Y=J.enter("codeIndented"),F=J.indentLines(Q,pJ0);return Y(),F}let z=J.createTracker(H),G=B.repeat(Math.max(ju(Q,B)+1,3)),K=J.enter("codeFenced"),U=z.move(G);if($.lang){let Y=J.enter(`codeFencedLang${X}`);U+=z.move(J.safe($.lang,{before:U,after:" ",encode:["`"],...z.current()})),Y()}if($.lang&&$.meta){let Y=J.enter(`codeFencedMeta${X}`);U+=z.move(" "),U+=z.move(J.safe($.meta,{before:U,after:`
41
+ `,encode:["`"],...z.current()})),Y()}if(U+=z.move(`
42
+ `),Q)U+=z.move(Q+`
43
+ `);return U+=z.move(G),K(),U}function pJ0($,Z,J){return(J?"":" ")+$}function wJ($){let Z=$.options.quote||'"';if(Z!=='"'&&Z!=="'")throw Error("Cannot serialize title with `"+Z+"` for `options.quote`, expected `\"`, or `'`");return Z}function Eu($,Z,J,H){let B=wJ(J),Q=B==='"'?"Quote":"Apostrophe",X=J.enter("definition"),z=J.enter("label"),G=J.createTracker(H),K=G.move("[");if(K+=G.move(J.safe(J.associationId($),{before:K,after:"]",...G.current()})),K+=G.move("]: "),z(),!$.url||/[\0- \u007F]/.test($.url))z=J.enter("destinationLiteral"),K+=G.move("<"),K+=G.move(J.safe($.url,{before:K,after:">",...G.current()})),K+=G.move(">");else z=J.enter("destinationRaw"),K+=G.move(J.safe($.url,{before:K,after:$.title?" ":`
44
+ `,...G.current()}));if(z(),$.title)z=J.enter(`title${Q}`),K+=G.move(" "+B),K+=G.move(J.safe($.title,{before:K,after:B,...G.current()})),K+=G.move(B),z();return X(),K}function wu($){let Z=$.options.emphasis||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize emphasis with `"+Z+"` for `options.emphasis`, expected `*`, or `_`");return Z}function d6($){return"&#x"+$.toString(16).toUpperCase()+";"}function SJ($,Z,J){let H=_3($),B=_3(Z);if(H===void 0)return B===void 0?J==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:B===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(H===1)return B===void 0?{inside:!1,outside:!1}:B===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return B===void 0?{inside:!1,outside:!1}:B===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}rL.peek=cJ0;function rL($,Z,J,H){let B=wu(J),Q=J.enter("emphasis"),X=J.createTracker(H),z=X.move(B),G=X.move(J.containerPhrasing($,{after:B,before:z,...X.current()})),K=G.charCodeAt(0),U=SJ(H.before.charCodeAt(H.before.length-1),K,B);if(U.inside)G=d6(K)+G.slice(1);let Y=G.charCodeAt(G.length-1),F=SJ(H.after.charCodeAt(0),Y,B);if(F.inside)G=G.slice(0,-1)+d6(Y);let W=X.move(B);return Q(),J.attentionEncodeSurroundingInfo={after:F.outside,before:U.outside},z+G+W}function cJ0($,Z,J){return J.options.emphasis||"*"}function Su($,Z){let J=!1;return j3($,function(H){if("value"in H&&/\r?\n|\r/.test(H.value)||H.type==="break")return J=!0,L$}),Boolean((!$.depth||$.depth<3)&&F$($)&&(Z.options.setext||J))}function Iu($,Z,J,H){let B=Math.max(Math.min(6,$.depth||1),1),Q=J.createTracker(H);if(Su($,J)){let U=J.enter("headingSetext"),Y=J.enter("phrasing"),F=J.containerPhrasing($,{...Q.current(),before:`
45
+ `,after:`
46
+ `});return Y(),U(),F+`
47
+ `+(B===1?"=":"-").repeat(F.length-(Math.max(F.lastIndexOf("\r"),F.lastIndexOf(`
48
+ `))+1))}let X="#".repeat(B),z=J.enter("headingAtx"),G=J.enter("phrasing");Q.move(X+" ");let K=J.containerPhrasing($,{before:"# ",after:`
49
+ `,...Q.current()});if(/^[\t ]/.test(K))K=d6(K.charCodeAt(0))+K.slice(1);if(K=K?X+" "+K:X,J.options.closeAtx)K+=" "+X;return G(),z(),K}aL.peek=dJ0;function aL($){return $.value||""}function dJ0(){return"<"}oL.peek=lJ0;function oL($,Z,J,H){let B=wJ(J),Q=B==='"'?"Quote":"Apostrophe",X=J.enter("image"),z=J.enter("label"),G=J.createTracker(H),K=G.move("![");if(K+=G.move(J.safe($.alt,{before:K,after:"]",...G.current()})),K+=G.move("]("),z(),!$.url&&$.title||/[\0- \u007F]/.test($.url))z=J.enter("destinationLiteral"),K+=G.move("<"),K+=G.move(J.safe($.url,{before:K,after:">",...G.current()})),K+=G.move(">");else z=J.enter("destinationRaw"),K+=G.move(J.safe($.url,{before:K,after:$.title?" ":")",...G.current()}));if(z(),$.title)z=J.enter(`title${Q}`),K+=G.move(" "+B),K+=G.move(J.safe($.title,{before:K,after:B,...G.current()})),K+=G.move(B),z();return K+=G.move(")"),X(),K}function lJ0(){return"!"}nL.peek=iJ0;function nL($,Z,J,H){let B=$.referenceType,Q=J.enter("imageReference"),X=J.enter("label"),z=J.createTracker(H),G=z.move("!["),K=J.safe($.alt,{before:G,after:"]",...z.current()});G+=z.move(K+"]["),X();let U=J.stack;J.stack=[],X=J.enter("reference");let Y=J.safe(J.associationId($),{before:G,after:"]",...z.current()});if(X(),J.stack=U,Q(),B==="full"||!K||K!==Y)G+=z.move(Y+"]");else if(B==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function iJ0(){return"!"}sL.peek=rJ0;function sL($,Z,J){let H=$.value||"",B="`",Q=-1;while(new RegExp("(^|[^`])"+B+"([^`]|$)").test(H))B+="`";if(/[^ \r\n]/.test(H)&&(/^[ \r\n]/.test(H)&&/[ \r\n]$/.test(H)||/^`|`$/.test(H)))H=" "+H+" ";while(++Q<J.unsafe.length){let X=J.unsafe[Q],z=J.compilePattern(X),G;if(!X.atBreak)continue;while(G=z.exec(H)){let K=G.index;if(H.charCodeAt(K)===10&&H.charCodeAt(K-1)===13)K--;H=H.slice(0,K)+" "+H.slice(G.index+1)}}return B+H+B}function rJ0(){return"`"}function tL($,Z){let J=F$($);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))}eL.peek=aJ0;function eL($,Z,J,H){let B=wJ(J),Q=B==='"'?"Quote":"Apostrophe",X=J.createTracker(H),z,G;if(tL($,J)){let U=J.stack;J.stack=[],z=J.enter("autolink");let Y=X.move("<");return Y+=X.move(J.containerPhrasing($,{before:Y,after:">",...X.current()})),Y+=X.move(">"),z(),J.stack=U,Y}z=J.enter("link"),G=J.enter("label");let K=X.move("[");if(K+=X.move(J.containerPhrasing($,{before:K,after:"](",...X.current()})),K+=X.move("]("),G(),!$.url&&$.title||/[\0- \u007F]/.test($.url))G=J.enter("destinationLiteral"),K+=X.move("<"),K+=X.move(J.safe($.url,{before:K,after:">",...X.current()})),K+=X.move(">");else G=J.enter("destinationRaw"),K+=X.move(J.safe($.url,{before:K,after:$.title?" ":")",...X.current()}));if(G(),$.title)G=J.enter(`title${Q}`),K+=X.move(" "+B),K+=X.move(J.safe($.title,{before:K,after:B,...X.current()})),K+=X.move(B),G();return K+=X.move(")"),z(),K}function aJ0($,Z,J){return tL($,J)?"<":"["}$M.peek=oJ0;function $M($,Z,J,H){let B=$.referenceType,Q=J.enter("linkReference"),X=J.enter("label"),z=J.createTracker(H),G=z.move("["),K=J.containerPhrasing($,{before:G,after:"]",...z.current()});G+=z.move(K+"]["),X();let U=J.stack;J.stack=[],X=J.enter("reference");let Y=J.safe(J.associationId($),{before:G,after:"]",...z.current()});if(X(),J.stack=U,Q(),B==="full"||!K||K!==Y)G+=z.move(Y+"]");else if(B==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function oJ0(){return"["}function IJ($){let Z=$.options.bullet||"*";if(Z!=="*"&&Z!=="+"&&Z!=="-")throw Error("Cannot serialize items with `"+Z+"` for `options.bullet`, expected `*`, `+`, or `-`");return Z}function Ru($){let Z=IJ($),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 bu($){let Z=$.options.bulletOrdered||".";if(Z!=="."&&Z!==")")throw Error("Cannot serialize items with `"+Z+"` for `options.bulletOrdered`, expected `.` or `)`");return Z}function WF($){let Z=$.options.rule||"*";if(Z!=="*"&&Z!=="-"&&Z!=="_")throw Error("Cannot serialize rules with `"+Z+"` for `options.rule`, expected `*`, `-`, or `_`");return Z}function ku($,Z,J,H){let B=J.enter("list"),Q=J.bulletCurrent,X=$.ordered?bu(J):IJ(J),z=$.ordered?X==="."?")":".":Ru(J),G=Z&&J.bulletLastUsed?X===J.bulletLastUsed:!1;if(!$.ordered){let U=$.children?$.children[0]:void 0;if((X==="*"||X==="-")&&U&&(!U.children||!U.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)G=!0;if(WF(J)===X&&U){let Y=-1;while(++Y<$.children.length){let F=$.children[Y];if(F&&F.type==="listItem"&&F.children&&F.children[0]&&F.children[0].type==="thematicBreak"){G=!0;break}}}}if(G)X=z;J.bulletCurrent=X;let K=J.containerFlow($,H);return J.bulletLastUsed=X,J.bulletCurrent=Q,B(),K}function yu($){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 xu($,Z,J,H){let B=yu(J),Q=J.bulletCurrent||IJ(J);if(Z&&Z.type==="list"&&Z.ordered)Q=(typeof Z.start==="number"&&Z.start>-1?Z.start:1)+(J.options.incrementListMarker===!1?0:Z.children.indexOf($))+Q;let X=Q.length+1;if(B==="tab"||B==="mixed"&&(Z&&Z.type==="list"&&Z.spread||$.spread))X=Math.ceil(X/4)*4;let z=J.createTracker(H);z.move(Q+" ".repeat(X-Q.length)),z.shift(X);let G=J.enter("listItem"),K=J.indentLines(J.containerFlow($,z.current()),U);return G(),K;function U(Y,F,W){if(F)return(W?"":" ".repeat(X))+Y;return(W?Q:Q+" ".repeat(X-Q.length))+Y}}function hu($,Z,J,H){let B=J.enter("paragraph"),Q=J.enter("phrasing"),X=J.containerPhrasing($,H);return Q(),B(),X}var ZM=a9(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vu($,Z,J,H){return($.children.some(function(X){return ZM(X)})?J.containerPhrasing:J.containerFlow).call(J,$,H)}function gu($){let Z=$.options.strong||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize strong with `"+Z+"` for `options.strong`, expected `*`, or `_`");return Z}JM.peek=nJ0;function JM($,Z,J,H){let B=gu(J),Q=J.enter("strong"),X=J.createTracker(H),z=X.move(B+B),G=X.move(J.containerPhrasing($,{after:B,before:z,...X.current()})),K=G.charCodeAt(0),U=SJ(H.before.charCodeAt(H.before.length-1),K,B);if(U.inside)G=d6(K)+G.slice(1);let Y=G.charCodeAt(G.length-1),F=SJ(H.after.charCodeAt(0),Y,B);if(F.inside)G=G.slice(0,-1)+d6(Y);let W=X.move(B+B);return Q(),J.attentionEncodeSurroundingInfo={after:F.outside,before:U.outside},z+G+W}function nJ0($,Z,J){return J.options.strong||"*"}function fu($,Z,J,H){return J.safe($.value,H)}function mu($){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 uu($,Z,J){let H=(WF(J)+(J.options.ruleSpaces?" ":"")).repeat(mu(J));return J.options.ruleSpaces?H.slice(0,-1):H}var LQ={blockquote:Mu,break:iL,code:Cu,definition:Eu,emphasis:rL,hardBreak:iL,heading:Iu,html:aL,image:oL,imageReference:nL,inlineCode:sL,link:eL,linkReference:$M,list:ku,listItem:xu,paragraph:hu,root:vu,strong:JM,text:fu,thematicBreak:uu};function BM(){return{enter:{table:sJ0,tableData:pu,tableHeader:pu,tableRow:eJ0},exit:{codeText:$H0,table:tJ0,tableData:HM,tableHeader:HM,tableRow:HM}}}function sJ0($){let Z=$._align;n1(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 tJ0($){this.exit($),this.data.inTable=void 0}function eJ0($){this.enter({type:"tableRow",children:[]},$)}function HM($){this.exit($)}function pu($){this.enter({type:"tableCell",children:[]},$)}function $H0($){let Z=this.resume();if(this.data.inTable)Z=Z.replace(/\\([\\|])/g,ZH0);let J=this.stack[this.stack.length-1];n1(J.type==="inlineCode"),J.value=Z,this.exit($)}function ZH0($,Z){return Z==="|"?Z:$}function QM($){let Z=$||{},J=Z.tableCellPadding,H=Z.tablePipeAlign,B=Z.stringLength,Q=J?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
50
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:F,table:X,tableCell:G,tableRow:z}};function X(W,q,N,A){return K(U(W,N,A),W.align)}function z(W,q,N,A){let V=Y(W,N,A),D=K([V]);return D.slice(0,D.indexOf(`
51
+ `))}function G(W,q,N,A){let V=N.enter("tableCell"),D=N.enter("phrasing"),L=N.containerPhrasing(W,{...A,before:Q,after:Q});return D(),V(),L}function K(W,q){return Lu(W,{align:q,alignDelimiters:H,padding:J,stringLength:B})}function U(W,q,N){let A=W.children,V=-1,D=[],L=q.enter("table");while(++V<A.length)D[V]=Y(A[V],q,N);return L(),D}function Y(W,q,N){let A=W.children,V=-1,D=[],L=q.enter("tableRow");while(++V<A.length)D[V]=G(A[V],W,q,N);return L(),D}function F(W,q,N){let A=LQ.inlineCode(W,q,N);if(N.stack.includes("tableCell"))A=A.replace(/\|/g,"\\$&");return A}}function XM(){return{exit:{taskListCheckValueChecked:cu,taskListCheckValueUnchecked:cu,paragraph:JH0}}}function zM(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:HH0}}}function cu($){let Z=this.stack[this.stack.length-2];n1(Z.type==="listItem"),Z.checked=$.type==="taskListCheckValueChecked"}function JH0($){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];n1(J.type==="paragraph");let H=J.children[0];if(H&&H.type==="text"){let B=Z.children,Q=-1,X;while(++Q<B.length){let z=B[Q];if(z.type==="paragraph"){X=z;break}}if(X===J){if(H.value=H.value.slice(1),H.value.length===0)J.children.shift();else if(J.position&&H.position&&typeof H.position.start.offset==="number")H.position.start.column++,H.position.start.offset++,J.position.start=Object.assign({},H.position.start)}}}this.exit($)}function HH0($,Z,J,H){let B=$.children[0],Q=typeof $.checked==="boolean"&&B&&B.type==="paragraph",X="["+($.checked?"x":" ")+"] ",z=J.createTracker(H);if(Q)z.move(X);let G=LQ.listItem($,Z,J,{...H,...z.current()});if(Q)G=G.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,K);return G;function K(U){return U+X}}function GM(){return[mL(),pL(),dL(),BM(),XM()]}function KM($){return{extensions:[uL(),cL($),lL(),QM($),zM()]}}var BH0={tokenize:KH0,partial:!0},du={tokenize:UH0,partial:!0},lu={tokenize:YH0,partial:!0},iu={tokenize:FH0,partial:!0},QH0={tokenize:WH0,partial:!0},ru={name:"wwwAutolink",tokenize:zH0,previous:ou},au={name:"protocolAutolink",tokenize:GH0,previous:nu},T3={name:"emailAutolink",tokenize:XH0,previous:su},n9={};function YM(){return{text:n9}}var _$=48;while(_$<123)if(n9[_$]=T3,_$++,_$===58)_$=65;else if(_$===91)_$=97;n9[43]=T3;n9[45]=T3;n9[46]=T3;n9[95]=T3;n9[72]=[T3,au];n9[104]=[T3,au];n9[87]=[T3,ru];n9[119]=[T3,ru];function XH0($,Z,J){let H=this,B,Q;return X;function X(Y){if(!UM(Y)||!su.call(H,H.previous)||FM(H.events))return J(Y);return $.enter("literalAutolink"),$.enter("literalAutolinkEmail"),z(Y)}function z(Y){if(UM(Y))return $.consume(Y),z;if(Y===64)return $.consume(Y),G;return J(Y)}function G(Y){if(Y===46)return $.check(QH0,U,K)(Y);if(Y===45||Y===95||r5(Y))return Q=!0,$.consume(Y),G;return U(Y)}function K(Y){return $.consume(Y),B=!0,G}function U(Y){if(Q&&B&&F2(H.previous))return $.exit("literalAutolinkEmail"),$.exit("literalAutolink"),Z(Y);return J(Y)}}function zH0($,Z,J){let H=this;return B;function B(X){if(X!==87&&X!==119||!ou.call(H,H.previous)||FM(H.events))return J(X);return $.enter("literalAutolink"),$.enter("literalAutolinkWww"),$.check(BH0,$.attempt(du,$.attempt(lu,Q),J),J)(X)}function Q(X){return $.exit("literalAutolinkWww"),$.exit("literalAutolink"),Z(X)}}function GH0($,Z,J){let H=this,B="",Q=!1;return X;function X(Y){if((Y===72||Y===104)&&nu.call(H,H.previous)&&!FM(H.events))return $.enter("literalAutolink"),$.enter("literalAutolinkHttp"),B+=String.fromCodePoint(Y),$.consume(Y),z;return J(Y)}function z(Y){if(F2(Y)&&B.length<5)return B+=String.fromCodePoint(Y),$.consume(Y),z;if(Y===58){let F=B.toLowerCase();if(F==="http"||F==="https")return $.consume(Y),G}return J(Y)}function G(Y){if(Y===47){if($.consume(Y),Q)return K;return Q=!0,G}return J(Y)}function K(Y){return Y===null||W$(Y)||x1(Y)||i9(Y)||q$(Y)?J(Y):$.attempt(du,$.attempt(lu,U),J)(Y)}function U(Y){return $.exit("literalAutolinkHttp"),$.exit("literalAutolink"),Z(Y)}}function KH0($,Z,J){let H=0;return B;function B(X){if((X===87||X===119)&&H<3)return H++,$.consume(X),B;if(X===46&&H===3)return $.consume(X),Q;return J(X)}function Q(X){return X===null?J(X):Z(X)}}function UH0($,Z,J){let H,B,Q;return X;function X(K){if(K===46||K===95)return $.check(iu,G,z)(K);if(K===null||x1(K)||i9(K)||K!==45&&q$(K))return G(K);return Q=!0,$.consume(K),X}function z(K){if(K===95)H=!0;else B=H,H=void 0;return $.consume(K),X}function G(K){if(B||H||!Q)return J(K);return Z(K)}}function YH0($,Z){let J=0,H=0;return B;function B(X){if(X===40)return J++,$.consume(X),B;if(X===41&&H<J)return Q(X);if(X===33||X===34||X===38||X===39||X===41||X===42||X===44||X===46||X===58||X===59||X===60||X===63||X===93||X===95||X===126)return $.check(iu,Z,Q)(X);if(X===null||x1(X)||i9(X))return Z(X);return $.consume(X),B}function Q(X){if(X===41)H++;return $.consume(X),B}}function FH0($,Z,J){return H;function H(z){if(z===33||z===34||z===39||z===41||z===42||z===44||z===46||z===58||z===59||z===63||z===95||z===126)return $.consume(z),H;if(z===38)return $.consume(z),Q;if(z===93)return $.consume(z),B;if(z===60||z===null||x1(z)||i9(z))return Z(z);return J(z)}function B(z){if(z===null||z===40||z===91||x1(z)||i9(z))return Z(z);return H(z)}function Q(z){return F2(z)?X(z):J(z)}function X(z){if(z===59)return $.consume(z),H;if(F2(z))return $.consume(z),X;return J(z)}}function WH0($,Z,J){return H;function H(Q){return $.consume(Q),B}function B(Q){return r5(Q)?J(Q):Z(Q)}}function ou($){return $===null||$===40||$===42||$===95||$===91||$===93||$===126||x1($)}function nu($){return!F2($)}function su($){return!($===47||UM($))}function UM($){return $===43||$===45||$===46||$===95||r5($)}function FM($){let Z=$.length,J=!1;while(Z--){let H=$[Z][1];if((H.type==="labelLink"||H.type==="labelImage")&&!H._balanced){J=!0;break}if(H._gfmAutolinkLiteralWalkedInto){J=!1;break}}if($.length>0&&!J)$[$.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return J}var qH0={tokenize:PH0,partial:!0};function WM(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:DH0,continuation:{tokenize:LH0},exit:MH0}},text:{[91]:{name:"gfmFootnoteCall",tokenize:AH0},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:NH0,resolveTo:VH0}}}}function NH0($,Z,J){let H=this,B=H.events.length,Q=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),X;while(B--){let G=H.events[B][1];if(G.type==="labelImage"){X=G;break}if(G.type==="gfmFootnoteCall"||G.type==="labelLink"||G.type==="label"||G.type==="image"||G.type==="link")break}return z;function z(G){if(!X||!X._balanced)return J(G);let K=Q4(H.sliceSerialize({start:X.end,end:H.now()}));if(K.codePointAt(0)!==94||!Q.includes(K.slice(1)))return J(G);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(G),$.exit("gfmFootnoteCallLabelMarker"),Z(G)}}function VH0($,Z){let J=$.length,H;while(J--)if($[J][1].type==="labelImage"&&$[J][0]==="enter"){H=$[J][1];break}$[J+1][1].type="data",$[J+3][1].type="gfmFootnoteCallLabelMarker";let B={type:"gfmFootnoteCall",start:Object.assign({},$[J+3][1].start),end:Object.assign({},$[$.length-1][1].end)},Q={type:"gfmFootnoteCallMarker",start:Object.assign({},$[J+3][1].end),end:Object.assign({},$[J+3][1].end)};Q.end.column++,Q.end.offset++,Q.end._bufferIndex++;let X={type:"gfmFootnoteCallString",start:Object.assign({},Q.end),end:Object.assign({},$[$.length-1][1].start)},z={type:"chunkString",contentType:"string",start:Object.assign({},X.start),end:Object.assign({},X.end)},G=[$[J+1],$[J+2],["enter",B,Z],$[J+3],$[J+4],["enter",Q,Z],["exit",Q,Z],["enter",X,Z],["enter",z,Z],["exit",z,Z],["exit",X,Z],$[$.length-2],$[$.length-1],["exit",B,Z]];return $.splice(J,$.length-J+1,...G),$}function AH0($,Z,J){let H=this,B=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),Q=0,X;return z;function z(Y){return $.enter("gfmFootnoteCall"),$.enter("gfmFootnoteCallLabelMarker"),$.consume(Y),$.exit("gfmFootnoteCallLabelMarker"),G}function G(Y){if(Y!==94)return J(Y);return $.enter("gfmFootnoteCallMarker"),$.consume(Y),$.exit("gfmFootnoteCallMarker"),$.enter("gfmFootnoteCallString"),$.enter("chunkString").contentType="string",K}function K(Y){if(Q>999||Y===93&&!X||Y===null||Y===91||x1(Y))return J(Y);if(Y===93){$.exit("chunkString");let F=$.exit("gfmFootnoteCallString");if(!B.includes(Q4(H.sliceSerialize(F))))return J(Y);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(Y),$.exit("gfmFootnoteCallLabelMarker"),$.exit("gfmFootnoteCall"),Z}if(!x1(Y))X=!0;return Q++,$.consume(Y),Y===92?U:K}function U(Y){if(Y===91||Y===92||Y===93)return $.consume(Y),Q++,K;return K(Y)}}function DH0($,Z,J){let H=this,B=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),Q,X=0,z;return G;function G(q){return $.enter("gfmFootnoteDefinition")._container=!0,$.enter("gfmFootnoteDefinitionLabel"),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionLabelMarker"),K}function K(q){if(q===94)return $.enter("gfmFootnoteDefinitionMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionMarker"),$.enter("gfmFootnoteDefinitionLabelString"),$.enter("chunkString").contentType="string",U;return J(q)}function U(q){if(X>999||q===93&&!z||q===null||q===91||x1(q))return J(q);if(q===93){$.exit("chunkString");let N=$.exit("gfmFootnoteDefinitionLabelString");return Q=Q4(H.sliceSerialize(N)),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionLabelMarker"),$.exit("gfmFootnoteDefinitionLabel"),F}if(!x1(q))z=!0;return X++,$.consume(q),q===92?Y:U}function Y(q){if(q===91||q===92||q===93)return $.consume(q),X++,U;return U(q)}function F(q){if(q===58){if($.enter("definitionMarker"),$.consume(q),$.exit("definitionMarker"),!B.includes(Q))B.push(Q);return e0($,W,"gfmFootnoteDefinitionWhitespace")}return J(q)}function W(q){return Z(q)}}function LH0($,Z,J){return $.check(r9,Z,$.attempt(qH0,Z,J))}function MH0($){$.exit("gfmFootnoteDefinition")}function PH0($,Z,J){let H=this;return e0($,B,"gfmFootnoteDefinitionIndent",5);function B(Q){let X=H.events[H.events.length-1];return X&&X[1].type==="gfmFootnoteDefinitionIndent"&&X[2].sliceSerialize(X[1],!0).length===4?Z(Q):J(Q)}}function qM($){let J=($||{}).singleTilde,H={name:"strikethrough",tokenize:Q,resolveAll:B};if(J===null||J===void 0)J=!0;return{text:{[126]:H},insideSpan:{null:[H]},attentionMarkers:{null:[126]}};function B(X,z){let G=-1;while(++G<X.length)if(X[G][0]==="enter"&&X[G][1].type==="strikethroughSequenceTemporary"&&X[G][1]._close){let K=G;while(K--)if(X[K][0]==="exit"&&X[K][1].type==="strikethroughSequenceTemporary"&&X[K][1]._open&&X[G][1].end.offset-X[G][1].start.offset===X[K][1].end.offset-X[K][1].start.offset){X[G][1].type="strikethroughSequence",X[K][1].type="strikethroughSequence";let U={type:"strikethrough",start:Object.assign({},X[K][1].start),end:Object.assign({},X[G][1].end)},Y={type:"strikethroughText",start:Object.assign({},X[K][1].end),end:Object.assign({},X[G][1].start)},F=[["enter",U,z],["enter",X[K][1],z],["exit",X[K][1],z],["enter",Y,z]],W=z.parser.constructs.insideSpan.null;if(W)e5(F,F.length,0,u6(W,X.slice(K+1,G),z));e5(F,F.length,0,[["exit",Y,z],["enter",X[G][1],z],["exit",X[G][1],z],["exit",U,z]]),e5(X,K-1,G-K+3,F),G=K+F.length-2;break}}G=-1;while(++G<X.length)if(X[G][1].type==="strikethroughSequenceTemporary")X[G][1].type="data";return X}function Q(X,z,G){let K=this.previous,U=this.events,Y=0;return F;function F(q){if(K===126&&U[U.length-1][1].type!=="characterEscape")return G(q);return X.enter("strikethroughSequenceTemporary"),W(q)}function W(q){let N=_3(K);if(q===126){if(Y>1)return G(q);return X.consume(q),Y++,W}if(Y<2&&!J)return G(q);let A=X.exit("strikethroughSequenceTemporary"),V=_3(q);return A._open=!V||V===2&&Boolean(N),A._close=!N||N===2&&Boolean(V),z(q)}}}class NM{constructor(){this.map=[]}add($,Z,J){_H0(this,$,Z,J)}consume($){if(this.map.sort(function(B,Q){return B[0]-Q[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 H=J.pop();while(H){for(let B of H)$.push(B);H=J.pop()}this.map.length=0}}function _H0($,Z,J,H){let B=0;if(J===0&&H.length===0)return;while(B<$.map.length){if($.map[B][0]===Z){$.map[B][1]+=J,$.map[B][2].push(...H);return}B+=1}$.map.push([Z,J,H])}function tu($,Z){let J=!1,H=[];while(Z<$.length){let B=$[Z];if(J){if(B[0]==="enter"){if(B[1].type==="tableContent")H.push($[Z+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(B[1].type==="tableContent"){if($[Z-1][1].type==="tableDelimiterMarker"){let Q=H.length-1;H[Q]=H[Q]==="left"?"center":"right"}}else if(B[1].type==="tableDelimiterRow")break}else if(B[0]==="enter"&&B[1].type==="tableDelimiterRow")J=!0;Z+=1}return H}function VM(){return{flow:{null:{name:"table",tokenize:jH0,resolveAll:OH0}}}}function jH0($,Z,J){let H=this,B=0,Q=0,X;return z;function z(O){let S=H.events.length-1;while(S>-1){let T=H.events[S][1].type;if(T==="lineEnding"||T==="linePrefix")S--;else break}let y=S>-1?H.events[S][1].type:null,k=y==="tableHead"||y==="tableRow"?P:G;if(k===P&&H.parser.lazy[H.now().line])return J(O);return k(O)}function G(O){return $.enter("tableHead"),$.enter("tableRow"),K(O)}function K(O){if(O===124)return U(O);return X=!0,Q+=1,U(O)}function U(O){if(O===null)return J(O);if(u0(O)){if(Q>1)return Q=0,H.interrupt=!0,$.exit("tableRow"),$.enter("lineEnding"),$.consume(O),$.exit("lineEnding"),W;return J(O)}if(H1(O))return e0($,U,"whitespace")(O);if(Q+=1,X)X=!1,B+=1;if(O===124)return $.enter("tableCellDivider"),$.consume(O),$.exit("tableCellDivider"),X=!0,U;return $.enter("data"),Y(O)}function Y(O){if(O===null||O===124||x1(O))return $.exit("data"),U(O);return $.consume(O),O===92?F:Y}function F(O){if(O===92||O===124)return $.consume(O),Y;return Y(O)}function W(O){if(H.interrupt=!1,H.parser.lazy[H.now().line])return J(O);if($.enter("tableDelimiterRow"),X=!1,H1(O))return e0($,q,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O);return q(O)}function q(O){if(O===45||O===58)return A(O);if(O===124)return X=!0,$.enter("tableCellDivider"),$.consume(O),$.exit("tableCellDivider"),N;return M(O)}function N(O){if(H1(O))return e0($,A,"whitespace")(O);return A(O)}function A(O){if(O===58)return Q+=1,X=!0,$.enter("tableDelimiterMarker"),$.consume(O),$.exit("tableDelimiterMarker"),V;if(O===45)return Q+=1,V(O);if(O===null||u0(O))return j(O);return M(O)}function V(O){if(O===45)return $.enter("tableDelimiterFiller"),D(O);return M(O)}function D(O){if(O===45)return $.consume(O),D;if(O===58)return X=!0,$.exit("tableDelimiterFiller"),$.enter("tableDelimiterMarker"),$.consume(O),$.exit("tableDelimiterMarker"),L;return $.exit("tableDelimiterFiller"),L(O)}function L(O){if(H1(O))return e0($,j,"whitespace")(O);return j(O)}function j(O){if(O===124)return q(O);if(O===null||u0(O)){if(!X||B!==Q)return M(O);return $.exit("tableDelimiterRow"),$.exit("tableHead"),Z(O)}return M(O)}function M(O){return J(O)}function P(O){return $.enter("tableRow"),w(O)}function w(O){if(O===124)return $.enter("tableCellDivider"),$.consume(O),$.exit("tableCellDivider"),w;if(O===null||u0(O))return $.exit("tableRow"),Z(O);if(H1(O))return e0($,w,"whitespace")(O);return $.enter("data"),C(O)}function C(O){if(O===null||O===124||x1(O))return $.exit("data"),w(O);return $.consume(O),O===92?R:C}function R(O){if(O===92||O===124)return $.consume(O),C;return C(O)}}function OH0($,Z){let J=-1,H=!0,B=0,Q=[0,0,0,0],X=[0,0,0,0],z=!1,G=0,K,U,Y,F=new NM;while(++J<$.length){let W=$[J],q=W[1];if(W[0]==="enter"){if(q.type==="tableHead"){if(z=!1,G!==0)eu(F,Z,G,K,U),U=void 0,G=0;K={type:"table",start:Object.assign({},q.start),end:Object.assign({},q.end)},F.add(J,0,[["enter",K,Z]])}else if(q.type==="tableRow"||q.type==="tableDelimiterRow"){if(H=!0,Y=void 0,Q=[0,0,0,0],X=[0,J+1,0,0],z)z=!1,U={type:"tableBody",start:Object.assign({},q.start),end:Object.assign({},q.end)},F.add(J,0,[["enter",U,Z]]);B=q.type==="tableDelimiterRow"?2:U?3:1}else if(B&&(q.type==="data"||q.type==="tableDelimiterMarker"||q.type==="tableDelimiterFiller")){if(H=!1,X[2]===0){if(Q[1]!==0)X[0]=X[1],Y=qF(F,Z,Q,B,void 0,Y),Q=[0,0,0,0];X[2]=J}}else if(q.type==="tableCellDivider")if(H)H=!1;else{if(Q[1]!==0)X[0]=X[1],Y=qF(F,Z,Q,B,void 0,Y);Q=X,X=[Q[1],J,0,0]}}else if(q.type==="tableHead")z=!0,G=J;else if(q.type==="tableRow"||q.type==="tableDelimiterRow"){if(G=J,Q[1]!==0)X[0]=X[1],Y=qF(F,Z,Q,B,J,Y);else if(X[1]!==0)Y=qF(F,Z,X,B,J,Y);B=0}else if(B&&(q.type==="data"||q.type==="tableDelimiterMarker"||q.type==="tableDelimiterFiller"))X[3]=J}if(G!==0)eu(F,Z,G,K,U);F.consume(Z.events),J=-1;while(++J<Z.events.length){let W=Z.events[J];if(W[0]==="enter"&&W[1].type==="table")W[1]._align=tu(Z.events,J)}return $}function qF($,Z,J,H,B,Q){let X=H===1?"tableHeader":H===2?"tableDelimiter":"tableData",z="tableContent";if(J[0]!==0)Q.end=Object.assign({},RJ(Z.events,J[0])),$.add(J[0],0,[["exit",Q,Z]]);let G=RJ(Z.events,J[1]);if(Q={type:X,start:Object.assign({},G),end:Object.assign({},G)},$.add(J[1],0,[["enter",Q,Z]]),J[2]!==0){let K=RJ(Z.events,J[2]),U=RJ(Z.events,J[3]),Y={type:"tableContent",start:Object.assign({},K),end:Object.assign({},U)};if($.add(J[2],0,[["enter",Y,Z]]),H!==2){let F=Z.events[J[2]],W=Z.events[J[3]];if(F[1].end=Object.assign({},W[1].end),F[1].type="chunkText",F[1].contentType="text",J[3]>J[2]+1){let q=J[2]+1,N=J[3]-J[2]-1;$.add(q,N,[])}}$.add(J[3]+1,0,[["exit",Y,Z]])}if(B!==void 0)Q.end=Object.assign({},RJ(Z.events,B)),$.add(B,0,[["exit",Q,Z]]),Q=void 0;return Q}function eu($,Z,J,H,B){let Q=[],X=RJ(Z.events,J);if(B)B.end=Object.assign({},X),Q.push(["exit",B,Z]);H.end=Object.assign({},X),Q.push(["exit",H,Z]),$.add(J+1,0,Q)}function RJ($,Z){let J=$[Z],H=J[0]==="enter"?"start":"end";return J[1][H]}var TH0={name:"tasklistCheck",tokenize:CH0};function AM(){return{text:{[91]:TH0}}}function CH0($,Z,J){let H=this;return B;function B(G){if(H.previous!==null||!H._gfmTasklistFirstContentOfListItem)return J(G);return $.enter("taskListCheck"),$.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),Q}function Q(G){if(x1(G))return $.enter("taskListCheckValueUnchecked"),$.consume(G),$.exit("taskListCheckValueUnchecked"),X;if(G===88||G===120)return $.enter("taskListCheckValueChecked"),$.consume(G),$.exit("taskListCheckValueChecked"),X;return J(G)}function X(G){if(G===93)return $.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),$.exit("taskListCheck"),z;return J(G)}function z(G){if(u0(G))return Z(G);if(H1(G))return $.check({tokenize:EH0},Z,J)(G);return J(G)}}function EH0($,Z,J){return e0($,H,"whitespace");function H(B){return B===null?J(B):Z(B)}}function $p($){return wY([YM(),WM(),qM($),VM(),AM()])}var wH0={};function NF($){let Z=this,J=$||wH0,H=Z.data(),B=H.micromarkExtensions||(H.micromarkExtensions=[]),Q=H.fromMarkdownExtensions||(H.fromMarkdownExtensions=[]),X=H.toMarkdownExtensions||(H.toMarkdownExtensions=[]);B.push($p(J)),Q.push(GM()),X.push(KM(J))}var j$=_(d(),1),SH0=[NF],IH0=[FF],RH0={code({node:$,className:Z,children:J,...H}){return j$.jsx("code",{className:G0("rounded-xs bg-accent px-1 py-0.5 font-mono font-normal before:content-none after:content-none",Z),...H,children:J})},pre({children:$}){return j$.jsx("div",{className:"not-prose my-2 rounded-lg border border-border bg-accent px-3 py-2.5",children:j$.jsx("pre",{className:"overflow-auto font-mono text-xs leading-relaxed whitespace-pre text-foreground [&>code]:rounded-none [&>code]:bg-transparent [&>code]:p-0",children:$})})}};function Zp({size:$="sm",content:Z}){let J=e1(),{base:H}=G8();return j$.jsx("div",{className:G0("prose max-w-full min-w-0 wrap-anywhere prose-inherit",$==="sm"&&"prose-sm"),children:j$.jsx($F,{remarkPlugins:SH0,rehypePlugins:IH0,components:RH0,urlTransform:(B,Q,X)=>{if(X.tagName==="a"&&Q==="href"&&B.startsWith("moi:"))try{return H$(J,B,H)}catch{return""}return ZF(B)},children:Z})})}function Jp({content:$}){return j$.jsx($F,{allowedElements:[],skipHtml:!0,unwrapDisallowed:!0,children:$})}var fM=_(p(),1);var Hp="/agentation-4s0nn45p.png";var Bp="/airtable-hsa66v6q.png";var Qp="/apollo-2ed5dy2d.png";var Xp="/asana-tvgtwbx2.png";var zp="/atlassian-b3tq39hs.png";var Gp="/box-w3n36t5g.png";var DM="/chrome-tspm94rw.svg";var Kp="/clickup-qqrqqvqb.png";var Up="/cloudflare-j9p931v6.png";var Yp="/context7-8ht0xjfy.png";var Fp="/datadog-70ne3yzt.png";var Wp="/discord-vejhptwx.png";var qp="/dropbox-4m5s9mgr.png";var Np="/elevenlabs-2nzzej1t.png";var Vp="/exa-qqj3vr0x.png";var Ap="/figma-y9898rry.png";var Dp="/firecrawl-w2t8nehx.png";var Lp="/github-av5r5y3e.png";var Mp="/gitlab-4pv5vm6b.png";var Pp="/gmail-sg6a5v3x.png";var _p="/googlecalendar-nqhh2v7r.png";var jp="/googledrive-6s8xyab7.png";var Op="/grafana-1yfsnwr6.png";var Tp="/granola-7j3b0nk2.png";var Cp="/hubspot-hghcmc2t.png";var Ep="/huggingface-kxzaxj83.png";var wp="/intercom-td763jt8.png";var Sp="/linear-v9s3az2d.png";var Ip="/monday-jdbs4wwf.png";var Rp="/mongodb-emzxvhd5.png";var bp="/neon-zj4qar44.png";var kp="/notion-w034c0b8.png";var yp="/paper-zbt34fab.png";var xp="/paypal-kwwf7xsc.png";var hp="/perplexity-4y63rxvj.png";var vp="/postgresql-qsspbsr1.png";var gp="/posthog-sphppc4w.png";var fp="/puppeteer-2xjt1a9b.png";var mp="/railway-834de8d2.png";var up="/redis-spm6w2m1.png";var pp="/salesforce-1mk56v4z.png";var cp="/sentry-hdwpmvek.png";var dp="/shopify-90dadaav.png";var lp="/slack-1c1wj62s.png";var ip="/snowflake-hfpykpgy.png";var rp="/stripe-zrfaqbj3.png";var ap="/supabase-4vg33zf2.png";var op="/telegram-v6tjyrs7.png";var np="/twilio-dpyjdwpj.png";var sp="/vercel-7d0ssw28.png";var tp="/zapier-p67qfch0.png";var SB0={agentation:Hp,airtable:Bp,apollo:Qp,asana:Xp,atlassian:zp,box:Gp,chrome:DM,"chrome-devtools":DM,clickup:Kp,cloudflare:Up,context7:Yp,datadog:Fp,discord:Wp,dropbox:qp,elevenlabs:Np,exa:Vp,figma:Ap,firecrawl:Dp,github:Lp,gitlab:Mp,gmail:Pp,googlecalendar:_p,googledrive:jp,grafana:Op,granola:Tp,hubspot:Cp,huggingface:Ep,intercom:wp,linear:Sp,monday:Ip,mongodb:Rp,neon:bp,notion:kp,paper:yp,paypal:xp,perplexity:hp,postgresql:vp,posthog:gp,puppeteer:fp,railway:mp,redis:up,salesforce:pp,sentry:cp,shopify:dp,slack:lp,snowflake:ip,stripe:rp,supabase:ap,telegram:op,twilio:np,vercel:sp,zapier:tp},IB0={"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 ep($){let Z=$.match(/^claude[._]ai[._\s]+(.+)$/i);if(!Z)return $;return Z[1].replace(/_/g," ")}function VF($){return $.toLowerCase().replace(/[\s._-]+/g,"")}var RB0=new Map(Object.entries(SB0).map(([$,Z])=>[VF($),Z])),bB0=new Map(Object.entries(IB0).map(([$,Z])=>[VF($),VF(Z)]));function AF($){let Z=VF(ep($));return RB0.get(bB0.get(Z)??Z)}function DF($){return ep($).split(/[\s._-]+/).filter(Boolean).map((Z)=>Z[0].toUpperCase()+Z.slice(1)).join(" ")}var LM=_(d(),1);function MQ({open:$,children:Z}){return LM.jsx(L4,{initial:!1,children:$&&LM.jsx(V5.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 $c=_(p(),1);var Hc=_(d(),1),kB0=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function Zc($,Z){if($.name!=="Read"||!Z)return null;let J=$.input,H=typeof J.file_path==="string"?J.file_path:null;if(!H||!kB0.test(H))return null;let B=Z.endsWith("/")?Z:`${Z}/`;if(!H.startsWith(B))return null;return H.slice(B.length)}function Jc({relPath:$}){let Z=e1(),[J,H]=$c.useState(!1);if(J)return null;let B=`/api/workspaces/${Z}/preview/${$.split("/").map(encodeURIComponent).join("/")}`;return Hc.jsx("img",{src:B,alt:$,loading:"lazy",onError:()=>H(!0),className:"max-h-64 max-w-full self-start rounded-lg border border-border object-contain"})}var OQ=_(p(),1);var Qc=_(d(),1),yB0=G0("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 Bc({children:$,active:Z=!0,className:J}){return Qc.jsx("span",{className:G0(J,Z&&yB0),children:$})}var PQ=_(d(),1);function LF({className:$}){return PQ.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:[PQ.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"}),PQ.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 W2=_(d(),1),MF="group/row flex w-full items-center gap-2 py-1.5 text-left select-none";function kJ({isFirst:$,isLast:Z,marker:J,loading:H=!1,isError:B=!1,children:Q}){let X=J!=null||H;return W2.jsxs("div",{className:"relative flex gap-2.5",children:[W2.jsxs("div",{className:"relative w-[13px] shrink-0",children:[!$&&W2.jsx("span",{className:G0("absolute top-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"h-1":"h-2.5")}),!Z&&W2.jsx("span",{className:G0("absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"top-[26px]":"top-5")}),J?W2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2",children:J}):H?W2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 p-0.5",children:W2.jsx(b5,{size:12,stroke:1.75,className:"animate-spin text-muted-foreground"})}):W2.jsx("span",{className:G0("absolute top-[15px] left-1/2 z-10 size-[5px] -translate-x-1/2 -translate-y-1/2 rounded-full",B?"bg-destructive":"bg-border")})]}),Q]})}function _Q({open:$}){return W2.jsx(V5.span,{animate:{rotate:$?90:0},transition:{type:"spring",duration:0.2,bounce:0.1},className:G0("flex shrink-0",$?"opacity-100":"opacity-0 group-hover/row:opacity-100"),children:W2.jsx(B$,{size:12,stroke:1.75})})}function bJ({children:$,className:Z}){return W2.jsx("span",{className:G0("flex size-4 items-center justify-center overflow-hidden rounded-xs bg-muted",Z),children:$})}function Xc({icon:$,size:Z=12,stroke:J=1.75}){return W2.jsx(bJ,{children:W2.jsx($,{size:Z,stroke:J,className:"text-muted-foreground"})})}function zc({src:$}){if(!$)return W2.jsx(bJ,{children:W2.jsx(LF,{className:"size-3 text-muted-foreground"})});return W2.jsx(bJ,{children:W2.jsx("img",{src:$,alt:"",className:"size-full object-cover"})})}var lB0=Uc(),MM=Ac();function iB0($){if(!$)return"$";return/^[A-Za-z_][A-Za-z0-9_]*$/.test($)?`$${$}`:`\${${$}}`}function rB0($){try{return MM($,iB0)}catch{return null}}function Dc($){return $.split("/").pop()??$}var aB0=new Set(["bash","sh","zsh","fish","dash","ash","ksh","mksh","csh","tcsh","nu","pwsh","powershell"]),oB0=new Set(["-o","+o","-O","+O","--rcfile","--init-file"]),nB0=/^[A-Za-z_][A-Za-z0-9_]*=/;function sB0($){if(/^-[a-zA-Z]*c$/.test($))return!0;let Z=$.toLowerCase();return Z==="--command"||Z==="-command"}function tB0($){let Z=rB0($);if(!Z||Z.length<3)return null;let J=(Q)=>{let X=Z[Q];return typeof X==="string"?X:null},H=0,B=()=>{while(nB0.test(J(H)??""))H++};if(B(),Dc(J(H)??"")==="env")H++,B();if(!aB0.has(Dc(J(H)??"")))return null;H++;while(H<Z.length){let Q=J(H);if(Q===null)return null;if(sB0(Q)){if(H+2!==Z.length)return null;return J(H+1)?.trim()||null}if(!Q.startsWith("-")&&!Q.startsWith("+"))return null;H+=oB0.has(Q)?2:1}return null}function eB0($){let Z=$;for(let J=0;J<3;J++){let H=tB0(Z);if(H===null)return Z;Z=H}return Z}function $Q0($){return $.replace(/\\\r?\n[ \t]*/g," ").replace(/[ \t]*\r?\n[ \t]*/g," ").replace(/[ \t]{2,}/g," ").trim()}function T$($){return $Q0(eB0($))}function yJ($,Z){let J=T$($);return J?Z(`$ ${J}`):""}var ZQ0=/^[A-Za-z]:\//;function JQ0($=""){if(!$)return $;return $.replace(/\\/g,"/").replace(ZQ0,(Z)=>Z.toUpperCase())}var HQ0=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var Lc=/^\/([A-Za-z]:)?$/;function BQ0(){if(typeof process<"u"&&typeof process.cwd==="function")return process.cwd().replace(/\\/g,"/");return"/"}var PM=function(...$){$=$.map((H)=>JQ0(H));let Z="",J=!1;for(let H=$.length-1;H>=-1&&!J;H--){let B=H>=0?$[H]:BQ0();if(!B||B.length===0)continue;Z=`${B}/${Z}`,J=_M(B)}if(Z=Mc(Z,!J),J&&!_M(Z))return`/${Z}`;return Z.length>0?Z:"."};function Mc($,Z){let J="",H=0,B=-1,Q=0,X=null;for(let z=0;z<=$.length;++z){if(z<$.length)X=$[z];else if(X==="/")break;else X="/";if(X==="/"){if(B===z-1||Q===1);else if(Q===2){if(J.length<2||H!==2||J[J.length-1]!=="."||J[J.length-2]!=="."){if(J.length>2){let G=J.lastIndexOf("/");if(G===-1)J="",H=0;else J=J.slice(0,G),H=J.length-1-J.lastIndexOf("/");B=z,Q=0;continue}else if(J.length>0){J="",H=0,B=z,Q=0;continue}}if(Z)J+=J.length>0?"/..":"..",H=2}else{if(J.length>0)J+=`/${$.slice(B+1,z)}`;else J=$.slice(B+1,z);H=z-B-1}B=z,Q=0}else if(X==="."&&Q!==-1)++Q;else Q=-1}return J}var _M=function($){return HQ0.test($)};var jM=function($,Z){let J=PM($).replace(Lc,"$1").split("/"),H=PM(Z).replace(Lc,"$1").split("/");if(H[0][1]===":"&&J[0][1]===":"&&J[0]!==H[0])return H.join("/");let B=[...J];for(let Q of B){if(H[0]!==Q)break;J.shift(),H.shift()}return[...J.map(()=>".."),...H].join("/")};function xJ($){return $.input??{}}function N1($,Z){let J=$[Z];return typeof J==="string"?J:""}function Pc($){return(Z)=>Z.replace(/\/[^\s"']+/g,(J)=>{if(!$)return J;let H=jM($,J);return H.startsWith("..")?J:H})}function C$($){let Z=Math.max(1,Math.round($/1000));if(Z<60)return`${Z}s`;let J=Math.floor(Z/60),H=Z%60;return H?`${J}m ${H}s`:`${J}m`}var QQ0={ToolSearch:"Tool search",WebSearch:"Web search",WebFetch:"Web fetch"};function XQ0($){if(!$.startsWith("mcp__"))return $;let Z=$.slice(5).split("__");return Z.length>=2?Z.slice(1).join("__"):Z[0]}function zQ0($,Z){let J=$.name,H=xJ($);if(J==="Bash")return yJ(N1(H,"command"),Z);if(J==="Read"||J==="Write"||J==="Edit")return Z(N1(H,"file_path"));if(J==="Glob")return Z(N1(H,"pattern"));if(J==="Grep")return`/${N1(H,"pattern")}/ ${Z(N1(H,"path"))}`;if(J==="WebSearch")return N1(H,"query");if(J==="WebFetch")return N1(H,"url");if(J==="ToolSearch"){let B=N1(H,"query");if(B.startsWith("select:"))return B.slice(7).split(",").map(XQ0).join(", ");return B}return""}var jQ={displayName:($)=>QQ0[$.name]??$.name,brief:zQ0};var OM={exec:"Bash",apply_patch:"Edit",web_search:"Web search",update_plan:"Update plan",subagent:"Run sub-agent",subagent_activity:"Sub-agent",review:"Review",view_image:"View image",generate_image:"Generate image",list_mcp_resources:"List MCP resources",list_mcp_resource_templates:"List MCP templates",read_mcp_resource:"Read MCP resource"},jc={read:"Read",listFiles:"List files",search:"Search"};function Oc($){let Z=$?.commandActions;if(!Array.isArray(Z)||Z.length===0)return null;let J=Z[0],H=J?.type;if(!H||!(H in jc))return null;if(Z.some((B)=>B?.type!==H))return null;return J}var _c={spawn_agent:"Run sub-agent",send_input:"Message the agent",resume_agent:"Resume the agent",close_agent:"Stopping the agent"};function GQ0($){if($.name==="exec"){let Z=Oc($.input);if(Z?.type)return jc[Z.type]}if($.name==="subagent"){let Z=$.input?.action;if(typeof Z==="string"&&Z in _c)return _c[Z]}return OM[$.name]??$.name}function KQ0($,Z){let J=$.name,H=xJ($);if(J==="exec"){let B=Oc(H);if(B?.type==="read")return Z(B.path||B.name||"");if(B?.type==="search")return[B.query&&`/${B.query}/`,B.path&&Z(B.path)].filter(Boolean).join(" ");if(B?.type==="listFiles")return B.path?Z(B.path):"";return yJ(N1(H,"command"),Z)}if(J==="apply_patch"){let B=H.changes;if(Array.isArray(B))return B.map((X)=>X&&typeof X==="object"?X.path:void 0).filter((X)=>typeof X==="string").map(Z).join(", ");return""}if(J==="web_search"){let B=H.queries;if(Array.isArray(B)&&B.length>0)return B.filter((Q)=>typeof Q==="string").join(" · ");return N1(H,"query")||[N1(H,"url"),N1(H,"pattern")].filter(Boolean).join(" · ")}if(J==="update_plan"){let B=H.plan;return typeof B==="string"?B.split(`
52
+ `)[0]:""}if(J==="subagent"){if(N1(H,"action")==="close_agent")return"";return N1(H,"prompt")}if(J==="subagent_activity")return N1(H,"kind");if(J==="generate_image")return N1(H,"prompt").split(`
53
+ `)[0];if(J==="read_mcp_resource")return N1(H,"uri");if(J==="list_mcp_resources"||J==="list_mcp_resource_templates")return N1(H,"server");return""}var Tc={displayName:GQ0,brief:KQ0};function Cc($){let Z=$.indexOf(":"),J=(Z>0?$.slice(0,Z):$).trim(),H=Z>0?$.slice(Z+1).trim():"",B=J.match(/^(.*?)\s*\(([^)]*)\)$/);if(!B)return{action:J,qualifier:"",detail:H};return{action:B[1].trim(),qualifier:B[2].trim(),detail:H}}var UQ0={terminal:"Run command",read:"Read",write:"Write",edit:"Edit",patch:"Edit",search:"Search",extract:"Fetch webpage","web extract":"Fetch webpage","web search":"Web search",delegate:"Delegate task","delegate batch":"Delegate tasks",todo:"Update TODO",python:"Run Python","process wait":"Wait for process","session search":"Search sessions","skills list":"List skills","skill view":"View skill"};function YQ0($){let{action:Z}=Cc($.name),J=UQ0[Z];if(J)return J;let H=Z.replace(/_/g," ");return H.charAt(0).toUpperCase()+H.slice(1)}function FQ0($,Z){let{action:J,qualifier:H,detail:B}=Cc($.name),Q=B||H;if(!Q)return"";return J==="terminal"?`$ ${T$(Q)}`:Z(Q)}var Ec={displayName:YQ0,brief:FQ0};var WQ0={read:"Read file",write:"Write file",edit:"Edit file",apply_patch:"Edit",exec:"Bash",bash:"Bash",ls:"List files",find:"Find files",grep:"Search",process:"Manage process",web_search:"Web search",web_fetch:"Fetch",sessions_list:"List sessions",sessions_history:"Recall session",sessions_yield:"Yield to session",sessions_send:"Send to session",sessions_spawn:"Spawn session",subagents:"Run sub-agent",agents_list:"List agents",session_status:"Session status",image:"Analyze image",image_generate:"Generate image",memory_get:"Read memory",memory_search:"Search memory",update_plan:"Update plan",message:"Send message",browser:"Browser",canvas:"Canvas",cron:"Cron",gateway:"Gateway",code_execution:"Run Python",tts:"Text-to-speech",music_generate:"Generate music",video_generate:"Generate video",x_search:"Search X"};function qQ0($,Z){let J=$.name,H=xJ($);if(J==="read"||J==="write"||J==="edit")return Z(N1(H,"path"));if(J==="apply_patch"){let B=H.changes;if(Array.isArray(B)&&B.length>0){let z=B.map((G)=>G&&typeof G==="object"?N1(G,"path"):"").filter(Boolean);if(z.length===1)return Z(z[0]);if(z.length>1)return`${z.length} files`}let Q=N1(H,"patch")||N1(H,"input"),X=Q.split(`
54
+ `).find((z)=>z.startsWith("*** "))??Q.split(`
55
+ `)[0];return Z(X??"")}if(J==="exec"||J==="bash"){let B=N1(H,"command")||N1(H,"code");return yJ(B,Z)}if(J==="ls"||J==="find"||J==="grep")return Z(N1(H,"path")||N1(H,"pattern"));if(J==="process"){let B=N1(H,"action"),Q=N1(H,"name");return[B,Q].filter(Boolean).join(" ")||Z(T$(N1(H,"command")))}if(J==="web_search"||J==="x_search")return N1(H,"query");if(J==="web_fetch")return N1(H,"url");if(J==="memory_search")return N1(H,"query");if(J==="memory_get")return N1(H,"key")||N1(H,"name");if(J==="sessions_history"||J==="sessions_send"||J==="sessions_yield")return N1(H,"sessionKey")||N1(H,"agentId");if(J==="sessions_list"||J==="agents_list")return N1(H,"agentId");if(J==="subagents"||J==="sessions_spawn")return N1(H,"task")||N1(H,"agentId");if(J==="image"||J==="image_generate")return N1(H,"prompt")||Z(N1(H,"path"));if(J==="message")return N1(H,"recipient")||N1(H,"to");if(J==="update_plan"){let B=H.plan;if(Array.isArray(B)){let X=B.find((z)=>!!z&&typeof z==="object"&&z.status==="in_progress")?.step??B[0]?.step;if(typeof X==="string")return X}return""}return""}var wc={displayName:($)=>WQ0[$.name]??jQ.displayName($),brief:($,Z)=>qQ0($,Z)||jQ.brief($,Z)};function TM($){if(!($.name==="Bash"||$.name==="exec"||$.name==="bash"))return null;let J=$.input??{},H=typeof J.command==="string"?J.command:"";if(!H)return null;let Q=T$(H).match(/(?:^|\s|\$\()mcporter(?:\)?)\s+call\s+([A-Za-z0-9_-]+)\.([A-Za-z0-9_-]+)((?:\s+(?!&&|\|\||;|\|)\S+)*)/);if(!Q)return null;return{server:Q[1],tool:Q[2],rest:(Q[3]??"").trim()}}function CM($){let Z=$.name;if(!Z.startsWith("mcp__"))return null;let J=Z.slice(5),H=J.indexOf("__");if(H<=0)return null;return{server:J.slice(0,H),tool:J.slice(H+2),rest:""}}function EM($){if($.provider!=="codex"||!$.mcpServer)return null;if($.name in OM)return null;if($.mcpServer==="codex")return null;let Z=$.name.indexOf(".");if(Z>0)return{server:$.name.slice(0,Z),tool:$.name.slice(Z+1),rest:""};return{server:$.mcpServer,tool:$.name,rest:""}}function wM($,Z){let J=Z.toLowerCase();return["-","_","."].find((B)=>J.startsWith($.toLowerCase()+B))?Z.slice($.length+1):Z}var NQ0={"claude-code":jQ,openclaw:wc,codex:Tc,hermes:Ec};function Sc($){return NQ0[$.provider??"claude-code"]}function Ic($){return Sc($).displayName($)}function Rc($,Z){return Sc($).brief($,Pc(Z))}var $2=_(d(),1),bc=[kc,yc,SM];function VQ0(){let[$,Z]=OQ.useState(0);OQ.useEffect(()=>{let H=setInterval(()=>Z((B)=>(B+1)%bc.length),600);return()=>clearInterval(H)},[]);let J=bc[$];return $2.jsx(bJ,{className:"size-5",children:$2.jsx(J,{size:16,stroke:1.75,className:"text-foreground"})})}function xc({call:$,cwd:Z,isFirst:J,isLast:H,renderNestedParts:B}){let[Q,X]=OQ.useState(!1),z=$.subagent,G=$.input??{},K=z?.description??G.description??"Subtask",U=z?.status,Y=$.state==="error"||U==="failed",F=$.state==="running"||U==="running",W=z?.usage?.toolUses,q=z?.usage?.durationMs,A=(F&&z?.progress?.length?z.progress[z.progress.length-1]:null)??(W!=null?`Took ${W} step${W===1?"":"s"}`:null),V=(z?.transcript??[]).flatMap((j)=>j.parts),D=typeof $.output==="string"?$.output:"",L=V.length>0||!!D;return $2.jsx(kJ,{isFirst:J,isLast:H,marker:F?$2.jsx(VQ0,{}):$2.jsx(bJ,{className:"size-5",children:$2.jsx(SM,{size:16,stroke:1.75,className:"text-foreground"})}),isError:Y,children:$2.jsxs("div",{className:"min-w-0 flex-1",children:[$2.jsxs("button",{type:"button",title:`Agent: ${K}`,onClick:()=>L&&X((j)=>!j),className:G0("group/row flex w-full flex-col items-start gap-0.5 py-1.5 text-left select-none",L?"cursor-pointer":"cursor-default"),children:[$2.jsxs("span",{className:"flex w-full items-center gap-2",children:[$2.jsxs(Bc,{active:F,className:"min-w-0 flex-1 truncate text-xs font-medium",children:["Agent: ",K]}),!F&&q!=null&&$2.jsx("span",{className:"shrink-0 rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground tabular-nums",children:C$(q)}),U==="failed"&&$2.jsx("span",{className:"shrink-0 text-xs text-destructive",children:"✗"}),U==="stopped"&&$2.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"✗"}),L&&$2.jsx(_Q,{open:Q})]}),A&&$2.jsx("span",{className:"w-full truncate text-xs text-muted-foreground",children:A})]}),L&&$2.jsx(MQ,{open:Q,children:$2.jsxs("div",{className:"mt-1 mb-1 overflow-hidden rounded-lg border border-border",children:[V.length>0&&$2.jsx("div",{className:"py-1.5 pr-2 pl-3",children:B(V,Z)}),D&&$2.jsx("div",{className:G0("bg-muted/30 px-3.5 py-3 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",V.length>0&&"border-t border-border"),children:D})]})})]})})}var E$=_(p(),1);var lc=_(p(),1);var RM=new Set(["<",">","{","}","[","]"]),xM=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"]),AQ0=new Set([...xM,"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"]),fc=new Set(["+","-","*","/","%","=","!","&","|","^","~","!","?",":",".",",",";","'",'"',".","(",")","[","]","#","@","\\",...RM]),DQ0={keywords:xM,onCommentStart:cc,onCommentEnd:wQ0};function LQ0($){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 MQ0($,Z){if($[Z]!=="<")return!1;let J=0,H=!1;for(let B=Z;B<$.length;B++){let Q=$[B];if(Q==="<"){J++;continue}if(Q===">"){if(J--,J===0){let X=B+1;while(X<$.length&&/\s/.test($[X]))X++;if(!(H&&$[X]==="("))return!1;let z=$.slice(X,X+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(z)}continue}if(J===0)continue;if(/[$A-Za-z_]/.test(Q)){H=!0;continue}if(/[\s,\.\=\?\:\|\&\[\]]/.test(Q))continue;return!1}return!1}var OF=["identifier","keyword","string","class","property","entity","jsxliterals","sign","comment","break","space"],[hJ,PQ0,l6,IM,jF,_Q0,jQ0,s9,hc,bM,vc]=OF.map(($,Z)=>Z);function TQ($){return/^[^\S\r\n]+$/g.test($)}function OQ0($){return fc.has($)}var TQ0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function CQ0($){if(!/[&<>"']/.test($))return $;return $.replace(/[&<>"']/g,(Z)=>TQ0[Z])}function TF($){return/^[\w_]+$/.test($)||mc($)}function gc($){let Z=$[0];return TF(Z)&&Z===Z.toUpperCase()||$==="null"}function mc($){return/[^\u0000-\u007f]/.test($)}function uc($){return/^[a-zA-Z]$/.test($)}function pc($){return uc($)||mc($)}function vJ($){return pc($[0])&&($.length===1||TF($.slice(1)))}function kM($){return $==="`"}function yM($){return $==='"'||$==="'"}function EQ0($){return yM($)||kM($)}function cc($,Z){let J=$+Z;if(J==="/*")return 2;return J==="//"?1:0}function wQ0($,Z){return $+Z==="*/"?2:Z===`
56
+ `?1:0}function SQ0($){return $[0]==="/"&&!cc($[0],$[1])}function IQ0($,Z){let J=Z+1;while(J<$.length&&/\s/.test($[J]))J++;return $[J]===":"}function RQ0($,Z){let J={...DQ0,...Z},H=!!(Z&&Z.keywords instanceof Set),B=LQ0($),Q=H?J.keywords:B?AQ0:xM,{onCommentStart:X,onCommentEnd:z}=J,G=J.typeKeywords instanceof Set?J.typeKeywords:null,K="",U=-1,Y=[-1,""],F=[-2,""],W=[],q=!1,N=0,A=!1,V=0,D=()=>q&&!A&&!N,L=()=>N&&!D(),j=()=>!N&&D()&&!A&&V>0,M=null,P=0,w=!1,C=0,R=0,O=()=>M!==null,S=()=>w,y=()=>R>C,k=()=>R>0&&R===C,T=()=>O()||y();function b(v){let h=v===`
57
+ `;if(L()){if(O())return l6;let[,E]=Y;if(vJ(v)){if(E==="<"||E==="</")return _Q0}}if(j())return jQ0;if(O()||y())return l6;else if(G&&G.has(v))return Y[1]==="."?hJ:IM;else if(Q.has(v))return Y[1]==="."?hJ:PQ0;else if(h)return bM;else if(TQ(v))return vc;else if(v.split("").every(OQ0))return s9;else if(gc(v))return L()?hJ:IM;else{if(vJ(v)){let E=Y[1]==="."&&vJ(F[1]);if(!T()&&!E)return hJ;if(E)return jF}return l6}}let I=(v,h)=>{if(h)K=h;if(K){U=typeof v==="number"?v:b(K);let f=[U,K];if(U!==vc&&U!==bM)F=Y,Y=f;W.push(f)}K=""};for(let v=0;v<$.length;v++){let h=$[v],f=$[v-1],E=$[v+1],i=f+h,r=h+E;if(typeof J.onQuote==="function"&&h==="'"&&!O()&&!j()&&!y()){let c=J.onQuote(h,v,$);if(typeof c==="number"&&c>=1&&!Number.isNaN(c)){let n=Math.min(c,$.length-v),Z0=v+n;I(),K=$.slice(v,Z0),I(hJ),v=Z0-1;continue}}if(yM(h)&&!j()&&!y()){I();let c=!1;if(f!=="\\"){if(M&&h===M)M=null,c=!0;else if(!M)M=h,P=W.length}if(I(l6,h),J.quotedKeys&&c&&IQ0($,v))for(let n=P;n<W.length;n++)W[n][0]=jF;continue}if(!y()){if(f!=="\\n"&&kM(h)){I(),I(l6,h),R++;continue}}if(y()){if(f!=="\\n"&&kM(h)){if(R>0){I(),R--,I(l6,h);continue}}if(r==="${"){C++,I(l6),I(s9,r),v++;continue}}if(k()&&h==="}"){I(),C--,I(s9,h);continue}if(D()){if(h==="{"){I(),I(s9,h),A=!0;continue}}if(q){if(!N&&h==="<"){if(I(),E==="/")N=2,K=r,v++;else N=1,K=h;I(s9);continue}if(N){if(h===">"&&!"/=".includes(f)){if(I(),N===1)N=0,V++;else N=0,q=!1;I(s9,h);continue}if(r==="/>"||r==="</"){if(K!=="<"&&K!=="/")I();if(r==="/>")N=0;else V--;if(!V)q=!1;K=r,v++,I(s9);continue}if(h==="<"){I(),K=h,I(s9);continue}if(E==="-"&&!T()&&!j()){if(K){I(jF,K+h+E),v++;continue}}if(E==="="&&!T()){if(!TQ(h)){if(TQ(K))I();let c=K+h;if(vJ(c)){I(jF,c);continue}}}}}if(!N&&(h==="<"&&pc(E)||r==="</")){let c=v-1;while(c>=0&&/\s/.test($[c]))c--;let n=c>=0?$[c]:"",[Z0,J0]=Y,X0=!1,Q0=!1;if(K&&!TQ(K)){let N0=K;if(gc(N0)||N0==="true"||N0==="false")X0=!0;else if(Q.has(N0)&&vJ(N0))Q0=!0;else if(vJ(N0))X0=!0}let F0=h==="<"&&/[$\w\]\)]/.test(n)&&(X0||!Q0&&(Z0===hJ||Z0===IM||Z0===s9&&(J0===")"||J0==="]"))),A0=h==="<"&&MQ0($,v);if(!F0&&!A0)N=E==="/"?2:1;if(h==="<"&&(E==="/"||uc(E))){if(!F0&&!A0&&!T()&&!j()&&!S())q=!0}}let x=EQ0(h),l=y(),o=!q&&SQ0(r),u=j();if(x||l||yM(M))K+=h;else if(o){I();let[c,n]=Y;if(o&&c!==-1&&!(c===s9&&n!==")"||c===hc)){K=h,I();continue}w=!0;let Z0=v++,J0=()=>v>=$.length,X0=()=>J0()||$[v]===`
58
+ `,Q0=!1,F0=!1;for(;!X0();v++){let A0=$[v],N0=$[v-1]==="\\";if(!N0&&A0==="[")F0=!0;if(!N0&&A0==="]")F0=!1;if(A0==="/"&&!F0&&!N0){Q0=!0;while(Z0!==v&&/^[a-z]$/.test($[v+1])&&!X0())v++;break}}if(w=!1,Z0!==v&&Q0)K=$.slice(Z0,v+1),I(l6);else K=h,I(),v=Z0}else if(X(h,E)){I();let c=v,n=X(h,E);if(n){for(;v<$.length;v++)if(z($[v-1],$[v])==n)break}K=$.slice(c,v+1),I(hc)}else if(h===" "||h===`
59
+ `)if(h===" "&&(TQ(K)||!K||u)){let c=v+1;while($[c]===" ")c++;if(K+=$.slice(v,c),v=c-1,$[c]==="<")I()}else I(),K=h,I();else if(A&&h==="}")I(),K=h,I(),A=!1;else if(u&&!RM.has(h)||y()||(TF(h)===TF(K[K.length-1])||D())&&!fc.has(h))K+=h;else{if(i==="</")K=i;if(I(),i!=="</")K=h;if(r==="</"||r==="/>")K=r,I(),v++;else if(RM.has(h))I()}}return I(),W}function bQ0($,Z){let J=[],H=Z&&typeof Z.lineClassName==="function"?Z.lineClassName:null,B=0,Q=(K,U)=>{let Y=H?H(U,B):"";return B++,{type:"element",tagName:"span",children:K,properties:{className:Y?`sh__line ${Y}`:"sh__line"}}};function X(K){let U=K.map(([,F])=>F).join(""),Y=K.map(([F,W])=>{let q=OF[F];return{type:"element",tagName:"span",children:[{type:"text",value:W}],properties:{className:`sh__token--${q}`,style:{color:`var(--sh-${q})`}}}});J.push(Q(Y,U))}let z=[],G=!1;for(let K=0;K<$.length;K++){let U=$[K],[Y,F]=U,W=K===$.length-1;if(Y!==bM){if(F.includes(`
60
+ `)){let q=F.split(`
61
+ `);for(let N=0;N<q.length;N++)if(z.push([Y,q[N]]),N<q.length-1)X(z),z.length=0}else z.push(U);G=!1}else{if(G)X([]);else X(z),z.length=0;if(W)X([]);G=!0}}if(z.length)X(z);return J}var kQ0=($)=>{let Z=`class="${$.className}"`;if($.style){let J=Object.entries($.style).map(([H,B])=>`${H}:${B}`).join(";");Z+=` style="${J}"`}return Z};function yQ0($){return $.map((Z)=>{let{tagName:J}=Z,H=Z.children.map((B)=>{let{tagName:Q,children:X,properties:z}=B;return`<${Q} ${kQ0(z)}>${CQ0(X[0].value)}</${Q}>`}).join("");return`<${J} class="${Z.properties.className}">${H}</${J}>`}).join(`
62
+ `)}function dc($,Z){let J=RQ0($,Z),H=bQ0(J,Z);return yQ0(H)}var sY1={TokenTypes:OF,TokenMap:new Map(OF.map(($,Z)=>[$,Z]))};var hM=_(d(),1),xQ0=G0("[--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 ic({code:$,className:Z}){let J=lc.useMemo(()=>dc($),[$]);return hM.jsx("pre",{className:G0("overflow-auto font-mono text-xs leading-relaxed whitespace-pre",xQ0,Z),children:hM.jsx("code",{className:"font-mono",dangerouslySetInnerHTML:{__html:J}})})}var hQ0={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 vQ0($){let Z=$.split(/[\\/]/).pop()??"",J=Z.lastIndexOf("."),H=J>0?Z.slice(J+1).toLowerCase():"";return hQ0[H]??null}function gQ0($){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 fQ0($){let Z=$.split(`
63
+ `);if(!Z.some((J)=>/^\s*\d+\t/.test(J)))return $;return Z.map((J)=>J.replace(/^\s*\d+\t/,"")).join(`
64
+ `)}function rc($,Z){let J=$.input??{},H=typeof J.file_path==="string"?J.file_path:typeof J.path==="string"?J.path:"",B=H?vQ0(H):null,Q=$.name==="Read"||$.name==="read",X=$.name==="Write"||$.name==="write";if(B&&Q&&Z)return{kind:"highlight",code:fQ0(Z),label:B};if(B&&X&&typeof J.content==="string"&&J.content)return{kind:"highlight",code:J.content,label:B};let z=gQ0(Z);if(z)return{kind:"highlight",code:z,label:"json"};return{kind:"plain"}}var j4=_(d(),1),vM="max-h-[280px] overflow-auto px-3 py-2.5 font-mono text-xs leading-relaxed";function ac({call:$,output:Z,isError:J}){let[H,B]=E$.useState(!1),Q=E$.useMemo(()=>J?{kind:"plain"}:rc($,Z),[$,Z,J]);if(Q.kind==="plain")return j4.jsx("div",{className:G0("rounded-lg border",J?"border-destructive/30 bg-destructive/10":"border-border bg-muted"),children:j4.jsx("pre",{className:G0(vM,"break-all whitespace-pre-wrap",J?"text-destructive":"text-muted-foreground"),children:Z||"(empty)"})});return j4.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-muted",children:[j4.jsx(mQ0,{raw:H,onRaw:B,label:Q.label,copyText:H?Z:Q.code}),H?j4.jsx("pre",{className:G0(vM,"break-all whitespace-pre-wrap text-muted-foreground"),children:Z||"(empty)"}):j4.jsx(ic,{code:Q.code,className:G0(vM,"text-muted-foreground")})]})}function mQ0({raw:$,onRaw:Z,label:J,copyText:H}){return j4.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2",children:[[[!1,J],[!0,"raw"]].map(([Q,X])=>j4.jsx(j0,{type:"button",variant:$===Q?"outline":"ghost",size:"sm",onClick:()=>Z(Q),className:"rounded-full text-xs uppercase",children:X},X)),j4.jsx("div",{className:"flex-1"}),j4.jsx(uQ0,{text:H})]})}function uQ0({text:$}){let[Z,J]=E$.useState(!1);return E$.useEffect(()=>{if(!Z)return;let B=setTimeout(()=>J(!1),1500);return()=>clearTimeout(B)},[Z]),j4.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard?.writeText($).then(()=>J(!0)).catch(()=>{})},"aria-label":Z?"Copied":"Copy",children:Z?j4.jsx(L8,{stroke:1.75}):j4.jsx(SG,{stroke:1.75})})}var m1=_(d(),1);function CF({parts:$,cwd:Z=null,processing:J=!1}){let H=$.filter((B)=>B.type==="reasoning"||B.type==="tool-call");return m1.jsx("div",{className:"flex flex-col",children:H.map((B,Q)=>{let X=Q===H.length-1,z={isFirst:Q===0,isLast:X};if(B.type==="reasoning")return m1.jsx(pQ0,{text:B.text,durationMs:B.durationMs,inProgress:J&&X,...z},Q);return m1.jsx(cQ0,{call:B.call,cwd:Z,...z},B.call.toolCallId||Q)})})}function gM({isFirst:$,isLast:Z,call:J,leading:H,marker:B,name:Q,brief:X,preview:z}){let[G,K]=fM.useState(!1),U=J.state==="error",Y=J.state==="running"||J.state==="pending",F=U?J.errorText??"":typeof J.output==="string"?J.output:"",W=!!(F||U||z),q=X?`${Q}: ${X}`:Q;return m1.jsx(kJ,{isFirst:$,isLast:Z,marker:B,loading:Y,isError:U,children:m1.jsxs("div",{className:"min-w-0 flex-1",children:[m1.jsxs("button",{type:"button",title:q,onClick:()=>W&&K((N)=>!N),className:G0(MF,W?"cursor-pointer":"cursor-default"),children:[H,m1.jsx("span",{className:"shrink-0 text-xs font-medium whitespace-nowrap",children:Q}),X&&m1.jsx("span",{className:"min-w-0 self-baseline truncate text-[12px] text-muted-foreground",children:X}),Y&&B&&m1.jsx(b5,{size:12,stroke:1.75,className:"shrink-0 animate-spin text-muted-foreground"}),W&&m1.jsx(_Q,{open:G})]}),W&&m1.jsx(MQ,{open:G,children:m1.jsxs("div",{className:"mt-1 mb-1 flex flex-col gap-1.5",children:[z,(F||U)&&m1.jsx(ac,{call:J,output:F,isError:U})]})})]})})}function pQ0({isFirst:$,isLast:Z,text:J,inProgress:H=!1,durationMs:B}){let[Q,X]=fM.useState(!1);if(!J){let K=B===void 0?"Thought":`Thought for ${C$(B)}`;return m1.jsx(kJ,{isFirst:$,isLast:Z,loading:H,children:m1.jsx("div",{className:G0(MF,"min-w-0 flex-1 cursor-default"),children:m1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:H?"Thinking":K})})})}let z=H?"Thinking":"Thought",G=H||Q;return m1.jsx(kJ,{isFirst:$,isLast:Z,loading:H,children:m1.jsxs("div",{className:"min-w-0 flex-1",children:[m1.jsxs("button",{type:"button","aria-expanded":G,onClick:()=>X((K)=>!K),className:G0(MF,"cursor-pointer"),children:[m1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:z}),m1.jsx(_Q,{open:G})]}),m1.jsx(MQ,{open:G,children:m1.jsx("div",{className:"mt-1 mb-1 pr-2 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",children:m1.jsx(Jp,{content:J})})})]})})}function cQ0({call:$,cwd:Z,isFirst:J,isLast:H}){if($.caller==="subagent")return m1.jsx(xc,{call:$,cwd:Z,isFirst:J,isLast:H,renderNestedParts:(X,z)=>m1.jsx(CF,{parts:X,cwd:z})});if($.name==="Skill"&&$.skill){let X=$.state==="success";return m1.jsx(gM,{isFirst:J,isLast:H,call:$,marker:X?m1.jsx(Xc,{icon:oc,size:16,stroke:1.75}):void 0,name:"Loading skill",brief:$.skill.skillName})}let B=TM($)??CM($)??EM($);if(B){let X=wM(B.server,B.tool);return m1.jsx(gM,{isFirst:J,isLast:H,call:$,marker:m1.jsx(zc,{src:AF(B.server)}),name:DF(B.server),brief:B.rest?`${X} ${B.rest}`:X})}let Q=$.state==="error"?null:Zc($,Z);return m1.jsx(gM,{isFirst:J,isLast:H,call:$,leading:m1.jsx(dQ0,{call:$}),name:Ic($),brief:Rc($,Z),preview:Q?m1.jsx(Jc,{relPath:Q}):void 0})}function dQ0({call:$}){if($.caller!=="mcp"&&$.caller!=="server-tool")return null;let Z=$.caller==="mcp"?`mcp${$.mcpServer?`:${$.mcpServer.slice(0,8)}`:""}`:"server";return m1.jsx("span",{className:"shrink-0 rounded border border-border px-1 text-[9px] text-muted-foreground uppercase",children:Z})}var h1=_(d(),1);function tc($){if($.type==="reasoning")return!0;if($.type==="tool-call")return!0;return!1}function lQ0($){let Z=[];for(let J of $)if(tc(J)){let H=Z[Z.length-1];if(H&&H.kind==="run")H.parts.push(J);else Z.push({kind:"run",parts:[J]})}else Z.push({kind:"single",part:J});return Z}function EF({parts:$,cwd:Z,processing:J=!1}){let H=lQ0($);return h1.jsx("div",{className:"flex flex-col",children:H.map((B,Q)=>{let X=Q===0?"":"mt-3",z=Q===H.length-1;return h1.jsx("div",{className:X,children:B.kind==="run"?h1.jsx(CF,{parts:B.parts,cwd:Z,processing:J&&z}):h1.jsx(nQ0,{part:B.part})},Q)})})}function iQ0($){return $.some((Z)=>Z.type!=="text"||Z.text.trim().length>0)}function rQ0($){let Z=-1;for(let H=$.length-1;H>=0;H--)if(tc($[H])){Z=H;break}if(Z<0)return null;let J=$.slice(Z+1);if(!iQ0(J))return null;return{work:$.slice(0,Z+1),response:J}}function aQ0({parts:$,cwd:Z,durationMs:J,defaultOpen:H}){let B=J===void 0?"Worked":`Worked for ${C$(J)}`;return h1.jsxs(pK,{defaultOpen:H,className:"group/collapsible",children:[h1.jsxs(cK,{className:"flex w-fit items-center gap-1 rounded-sm py-1 text-left text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[h1.jsx("span",{children:B}),h1.jsx(B$,{size:16,stroke:1.5,className:"shrink-0 transition-transform group-data-open/collapsible:rotate-90"})]}),h1.jsx(dK,{className:"overflow-hidden pt-2",children:h1.jsx(EF,{parts:$,cwd:Z})})]})}function oQ0({parts:$,cwd:Z,processing:J=!1,durationMs:H}){let B=J?null:rQ0($);return h1.jsx("div",{className:"w-full min-w-0",children:J?h1.jsx(EF,{parts:$,cwd:Z,processing:!0}):B?h1.jsxs("div",{className:"flex flex-col gap-3",children:[h1.jsx(aQ0,{parts:B.work,cwd:Z,durationMs:H}),h1.jsx(EF,{parts:B.response,cwd:Z})]}):h1.jsx(EF,{parts:$,cwd:Z})})}var ec=sc.memo(function({turn:Z,processing:J=!1}){let H=l1().cwd;if(Z.role==="user"&&Z.origin.kind==="user-input"){let B=Z.parts.filter((z)=>z.type==="file-attachment"),Q=Z.parts.filter((z)=>z.type==="text-attachment"),X=Z.parts.filter((z)=>z.type==="text").map((z)=>z.type==="text"?z.text:"").join(`
65
+ `);if(!X&&B.length===0&&Q.length===0)return null;return h1.jsxs("div",{className:"flex w-full min-w-0 flex-col items-end gap-1.5 pl-8",children:[Q.map((z,G)=>h1.jsx(fB,{label:z.label},`text-attachment:${G}`)),B.map((z,G)=>h1.jsx($d,{mediaType:z.mediaType,previewUrl:z.previewUrl,label:z.label},G)),X&&h1.jsx("p",{className:G0("max-w-full min-w-0 rounded-lg bg-primary px-3 py-2 text-sm leading-normal wrap-anywhere whitespace-pre-wrap text-primary-foreground","inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)]"),children:X})]})}return h1.jsx(oQ0,{parts:Z.parts,cwd:H,processing:J,durationMs:Z.meta?.durationMs})});function nQ0({part:$}){switch($.type){case"text-attachment":return h1.jsx(fB,{label:$.label});case"text":return h1.jsx(Zp,{content:$.text});case"tool-call":return h1.jsx(CF,{parts:[$],cwd:null});case"file-attachment":return h1.jsx($d,{mediaType:$.mediaType,previewUrl:$.previewUrl,label:$.label});case"source-url":return h1.jsx(nc,{url:$.url,title:$.title});case"source-document":return h1.jsx(nc,{url:"#",title:$.title});case"data":return h1.jsx(sQ0,{name:$.name,data:$.data});case"reasoning":return null}}function $d({mediaType:$,previewUrl:Z,label:J}){if($.startsWith("image/")&&Z)return h1.jsx("img",{src:Z,alt:J??"attachment",className:"max-h-64 max-w-full rounded-lg border border-border object-contain"});return h1.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-border bg-accent px-2.5 py-1.5 text-xs text-accent-foreground",children:[h1.jsx(EZ,{size:16,stroke:1.75}),h1.jsx("span",{className:"truncate",children:J??$})]})}function nc({url:$,title:Z}){return h1.jsx("a",{href:$,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:Z??$})}function sQ0({name:$,data:Z}){return h1.jsxs("details",{children:[h1.jsxs("summary",{className:"cursor-pointer list-none text-xs text-muted-foreground marker:hidden [&::-webkit-details-marker]:hidden",children:["data:",$]}),h1.jsx("pre",{className:"mt-1 overflow-auto rounded bg-muted p-2 font-mono text-xs text-muted-foreground",children:JSON.stringify(Z,null,2)})]})}var P5=_(d(),1),tQ0=[],eQ0=[];function wF({agent:$,active:Z=!0,focusRequest:J=0,docked:H=!1,chatLoaded:B,hasWorkspaceApplets:Q,view:X,previewTurn:z,sessionId:G,processing:K,composerBanner:U,agentAvailability:Y,annotation:F,send:W,stop:q,onNavigateFromWelcome:N,onClose:A,builderDraft:V}){let D=e1(),L=m4.useRef(null),j=m4.useRef(null),M=V?.sessionId??G??null,P=V?null:G??null,w=V?tQ0:X.turns,C=C5((c)=>c.hasSentMessageFromMoi),R=C5((c)=>(c.workspaceIdsPendingAnalysis??[]).includes(D)),O=x2((c)=>(c.attachments[p8(D,M)]??[]).some((n)=>n.kind!=="text"&&n.status==="uploading")),S=!gB(!0,O,Y),y=V?null:z,k=V?eQ0:X.notices,T=m4.useMemo(()=>My(w),[w]),b=m4.useMemo(()=>Ly(T,y),[T,y]),I=m4.useMemo(()=>_y(b,k),[b,k]),v=b.length>0?b[b.length-1].id:null,h=V?!1:K,f=!!V||B&&I.length===0&&!h,E=B&&!f,i=Ov({isViewBuilderDraft:!!V,hasSentMessageFromMoi:C,isWorkspacePendingAnalysis:R}),{atBottom:r,scrollToBottom:x,scrollToTop:l}=Ay(j,M);m4.useLayoutEffect(()=>{if(f&&i!=="empty")l()},[f,i,l]),m4.useEffect(()=>{if(Z)dA(L.current)},[Z,J]);let o=m4.useCallback(async(c,n)=>{if(V)await V.onSubmit(c);else W(c,n);x()},[V,W,x]),u=m4.useCallback((c)=>{if(S)return;o(c.prompt,{directives:c.context})},[o,S]);return P5.jsxs("div",{className:"flex min-h-0 flex-1 flex-col pt-2 pb-3",children:[P5.jsxs("header",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+40px)] min-w-0 items-center justify-between pr-2 pb-2 pl-2",children:[P5.jsx("div",{className:"min-w-0 flex-1",children:P5.jsx(Sv,{isViewBuilder:!!V})}),A&&H&&P5.jsxs(B5,{children:[P5.jsx(Q5,{render:P5.jsx(j0,{variant:"ghost",size:"icon-sm",onClick:A,"aria-label":"Undock agent",children:P5.jsx(Zd,{className:"size-5! text-muted-foreground",stroke:1.5})})}),P5.jsx(X5,{children:"Undock agent"})]}),!V&&A&&!H&&P5.jsx(j0,{variant:"ghost",size:"icon-sm",onClick:A,"aria-label":"Close chat",children:P5.jsx(a5,{stroke:2})})]}),P5.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[P5.jsx("div",{ref:j,className:"flex scrollbar-thin flex-1 scroll-fade flex-col overflow-y-auto overscroll-contain px-5 pt-4 pb-8 [--scroll-fade-reveal:8px]",children:P5.jsxs("div",{className:"mx-auto flex w-full max-w-(--chat-max-container) flex-1 flex-col gap-6",children:[f&&P5.jsx(Tv,{agent:$,kind:i,hasWorkspaceApplets:Q,disabled:S,onSelectPrompt:u,onNavigate:N}),E&&I.map((c)=>c.kind==="notice"?P5.jsx($X0,{notice:c.notice},`notice:${c.notice.id}`):P5.jsx(ec,{turn:c.turn,processing:h&&c.turn.id===v},c.turn.id)),E&&P5.jsx("div",{className:"mt-auto -ml-3 pt-2",children:P5.jsx(g9,{preset:$,color:"primary",animated:h,expression:h?"thinking":void 0})})]})}),E&&!r&&w.length>0&&P5.jsx(j0,{type:"button",variant:"outline",size:"icon",onClick:()=>x("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:P5.jsx(LY,{stroke:1.5})})]}),P5.jsx("div",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+24px)] flex-col px-3",children:P5.jsxs("div",{className:G0("@container flex w-full flex-col transition-[padding]",U&&"gap-2 rounded-t-lg rounded-b-2xl p-2",U?.tone==="default"&&"bg-accent",U?.tone==="error"&&"bg-destructive/10"),children:[U?.content,P5.jsx(Mv,{composerRef:L,onSend:o,onStop:q,processing:h,sessionId:M,modelSessionId:P,availability:Y,annotation:V?void 0:F,onRemoveDrawing:V?.onRemoveDrawing??F?.onRemove,allowFiles:!V,placeholder:V?"Drop in the details":void 0,draft:V?{id:V.builderId,initialValue:V.initialValue,onChange:V.onChange}:void 0})]})})]})}function $X0({notice:$}){let Z=lA($);if(!Z)return null;return P5.jsx("div",{className:"flex justify-center",children:P5.jsx("span",{className:"max-w-full truncate text-xs text-muted-foreground",children:Z})})}var C3=_(d(),1);function Jd({agent:$,loading:Z,open:J,onOpenChange:H,onOpenChangeComplete:B,children:Q}){let X=()=>H(!1);return C3.jsxs(QJ,{open:J,onOpenChange:(G,K)=>{if(!G&&(K.reason==="outside-press"||K.reason==="focus-out")){K.cancel();return}H(G)},onOpenChangeComplete:B,children:[C3.jsx(XJ,{render:C3.jsx("div",{className:"fixed right-3 bottom-3",children:C3.jsx(V5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"},invisible:{opacity:0,scale:1,filter:"blur(4px)"}},initial:"from",animate:J?"invisible":"to",transition:{type:"spring",duration:0.3,delay:0.2,bounce:0},children:C3.jsx("button",{type:"button",className:"group block cursor-pointer p-0 drop-shadow-[0_0_4px_var(--background)] outline-none focus-visible:ring-3 focus-visible:ring-ring/50","aria-label":"Agent",children:C3.jsx(g9,{preset:$,color:"primary",animated:Z,size:Z?80:64,expression:Z?"thinking":void 0,className:G0("drop-shadow-md drop-shadow-primary/25","group-hover:drop-shadow-lg group-hover:drop-shadow-primary/40","transition-[width,height,filter] duration-300 ease-in-out motion-reduce:transition-none")})})})})}),C3.jsx(zJ,{side:"top",sideOffset:({anchor:G})=>-G.height,align:"end",className:"flex h-[calc(100vh-2rem)] w-[min(440px,calc(100vw-1rem))] flex-col gap-0 rounded-3xl p-0 sm:h-[calc(100vh-8rem)] sm:w-[min(440px,calc(100vw-2rem))] sm:p-1",keepMounted:!0,children:Q(X)})]})}var E3=_(d(),1);function SF({actions:$,className:Z,title:J,children:H,onClose:B,ref:Q}){return E3.jsxs(V5.div,{ref:Q,className:G0("absolute inset-x-4 bottom-4 no-scrollbar flex max-h-full flex-col gap-4 overflow-y-auto rounded-2xl bg-popover text-popover-foreground shadow-md","mx-auto max-w-[calc(var(--chat-max-container)+var(--page-pad)*2)] p-(--page-pad)",H&&"pb-0",Z),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:[E3.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[E3.jsx("p",{className:"text-sm font-medium",children:J}),E3.jsxs("div",{className:"flex items-center gap-2",children:[$,E3.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm",onClick:B,"aria-label":"Close panel",children:E3.jsx(a5,{stroke:1.75})})]})]}),H&&E3.jsx("div",{className:"flex-1 pb-(--page-pad)",children:H})]})}var Y5=_(d(),1),ZX0=Object.entries(V6),JX0=Object.entries(NK),HX0=Object.entries(BB),BX0=Object.entries(QB),QX0="relative w-full rounded-lg text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50";function IF({children:$,className:Z,gridClassName:J,label:H}){return Y5.jsxs("div",{className:G0("flex flex-col gap-2",Z),children:[Y5.jsx("p",{className:"text-xs font-medium",children:H}),Y5.jsx("div",{role:"group","aria-label":H,className:G0("grid grid-cols-4 gap-2 @4xl/workspace:grid-cols-2",J),children:$})]})}function RF({active:$,children:Z,className:J,onSelect:H,style:B}){return Y5.jsxs("button",{type:"button","aria-pressed":$,onClick:H,className:G0(QX0,"flex items-center gap-2 p-3",J,!$&&"cursor-pointer pr-9 opacity-70 hover:opacity-100"),style:B,children:[Y5.jsx("div",{className:"flex flex-1 flex-col justify-center",children:Z}),$&&Y5.jsx(AK,{size:20,stroke:1.5,"aria-hidden":"true"})]})}function Hd({onClose:$,ref:Z}){rK();let{layout:J,setLayout:H}=l1(),B=i8(J.theme);function Q(X){H({theme:{...B,...X}})}return Y5.jsx(SF,{ref:Z,title:"Theme",onClose:$,className:"@4xl/workspace:max-w-5xl",children:Y5.jsxs("div",{className:"grid grid-cols-1 gap-4 @4xl/workspace:grid-cols-[repeat(2,minmax(0,1fr))_0.5rem_repeat(2,minmax(0,1fr))_0.5rem_minmax(0,1fr)_0.5rem_minmax(0,1fr)] @4xl/workspace:gap-x-2",children:[Y5.jsx(IF,{label:"Font",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-1",children:ZX0.map(([X,z])=>Y5.jsx(RF,{active:X===B.font,onSelect:()=>Q({font:X}),style:{fontFamily:z.sans},children:Y5.jsx("span",{className:"text-sm font-medium",children:z.label})},X))}),Y5.jsx(IF,{label:"Colors",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-4",children:JX0.map(([X,z])=>Y5.jsx(RF,{active:X===B.color,className:z.primary&&"bg-background text-foreground",onSelect:()=>Q({color:X}),style:a8({...B,color:X}),children:Y5.jsxs("div",{className:"flex gap-2",children:[Y5.jsx("span",{className:G0("flex size-5 shrink-0 items-center justify-center rounded-sm text-[9px] leading-none font-bold",z.primary?"bg-primary text-primary-foreground":"bg-foreground text-background"),children:"Aa"}),Y5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),Y5.jsx(IF,{label:"Radius",className:"@4xl/workspace:col-start-7",gridClassName:"@4xl/workspace:grid-cols-1",children:HX0.map(([X,z])=>Y5.jsx(RF,{active:X===B.radius,onSelect:()=>Q({radius:X}),style:a8({...B,radius:X}),children:Y5.jsxs("div",{className:"flex items-center gap-2",children:[Y5.jsx("span",{className:"size-5 shrink-0 rounded-sm bg-card texture-checker-2.5 shadow-xs","aria-hidden":"true"}),Y5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),Y5.jsx(IF,{label:"Agent",className:"@4xl/workspace:col-start-9",gridClassName:"@4xl/workspace:grid-cols-1",children:BX0.map(([X,z])=>Y5.jsx(RF,{active:X===B.agent,onSelect:()=>Q({agent:X}),children:Y5.jsxs("div",{className:"flex items-center gap-2",children:[Y5.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:Y5.jsx(g9,{preset:X,color:"primary",size:28})}),Y5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))})]})})}var gW=_(p(),1);var Xd=_(p(),1);function Bd($){return J5({queryKey:S0.appletThumbnails($),queryFn:async()=>(await q1(`/api/workspaces/${$}/applet-thumbnails`)).thumbnails,...v4})}function Qd($){let Z=z1();return H5({mutationFn:(J)=>A4(`/api/workspaces/${$}/applet-thumbnails`,v5("PUT",J),"Failed to save applet thumbnails"),onSuccess:()=>{Z.invalidateQueries({queryKey:S0.appletThumbnails($)}),Z.invalidateQueries({queryKey:S0.preview($)})}})}var XX0=1000,zX0=3,GX0=10800000,KX0=1000,UX0="1000px-3x-webp-q80-v1",YX0=5000,FX0=1000,WX0=1e4,qX0=100,NX0=5000;function VX0($){return Math.min(zX0,XX0/Math.max($.offsetWidth,$.offsetHeight))}function AX0($){return`${UX0}:${$??""}`}function DX0($,Z,J=Date.now()){if(!$||$.revision!==Z)return!0;let H=Date.parse($.capturedAt);return!Number.isFinite(H)||J-H>=GX0}function LX0($,Z){return $!==void 0&&$.revision===Z&&$.captureMs!==void 0&&$.captureMs>=KX0}var MX0=($)=>new Promise((Z)=>{setTimeout(()=>Z(null),$)});function PX0($,Z=qX0){let J=$.getBoundingClientRect(),H=J.top-Z,B=J.bottom+Z,Q=J.left-Z,X=J.right+Z;return(z)=>{if(z.nodeType!==1)return!0;let G=z,K=G.getBoundingClientRect();if(K.width===0&&K.height===0)return G.ownerDocument?.defaultView?.getComputedStyle(G).display!=="none";return K.bottom>H&&K.top<B&&K.right>Q&&K.left<X}}function _X0($,Z,J=NX0){let H=J,B=(Q)=>{for(let X of Q.children){if(!Z(X))continue;if(--H<0)return!0;if(B(X))return!0}return!1};return B($)}async function jX0($,Z){let{createContext:J,destroyContext:H,domToDataUrl:B}=await import("/chunk-zs4mte79.js"),Q=PX0($);if(_X0($,Q))return null;let X=async()=>{let z=await J($,{scale:VX0($),type:"image/webp",quality:0.8,backgroundColor:"#ffffff",timeout:FX0,filter:Q,...Z&&{onCreateForeignObjectSvg:(G)=>{let K=document.createElement("style");K.textContent="[data-widget-chrome] { border-radius: 0 !important; box-shadow: none !important; }[data-widget-chrome]::after { display: none !important; }",G.append(K)}}});try{return await B(z)}finally{H(z)}};return Promise.race([X(),MX0(WX0)])}async function OX0($,Z,J,H,B=jX0,Q=Date.now()){let X=[];for(let z of J){if(H())return null;let G=AX0(z.revision),K=Z.find((W)=>W.kind===$&&W.id===z.id);if(!DX0(K,G,Q)){X.push({id:z.id,revision:G});continue}if(LX0(K,G)){X.push({id:z.id,revision:G});continue}if(!z.element){X.push({id:z.id,revision:G,image:null});continue}let U=performance.now(),Y=await B(z.element,$==="widget").catch(()=>null),F=Math.round(performance.now()-U);if(H())return null;X.push({id:z.id,revision:G,image:Y,captureMs:F})}return X}function bF({kind:$,enabled:Z,targets:J}){let H=e1(),B=Bd(H).data,Q=Qd(H),X=K5(J),z=K5(B??[]),G=K5(Q.mutate),K=J.map((Y)=>`${Y.id}@${Y.revision??""}`).join(`
66
+ `),U=B!==void 0;Xd.useEffect(()=>{if(!Z||!U||K==="")return;let Y=!1,F=0,W,q=()=>{F+=1;let N=F;if(W!==void 0)clearTimeout(W);if(document.visibilityState!=="visible")return;W=setTimeout(async()=>{W=void 0;let A=await OX0($,z.current,X.current.map((V)=>({...V,element:document.querySelector(`[data-applet-thumbnail="${CSS.escape(`${$}:${V.id}`)}"]`)})),()=>Y||F!==N||document.visibilityState!=="visible");if(!A||Y||document.visibilityState!=="visible")return;G.current({kind:$,thumbnails:A})},YX0)};return document.addEventListener("visibilitychange",q),q(),()=>{if(Y=!0,W!==void 0)clearTimeout(W);document.removeEventListener("visibilitychange",q)}},[Z,$,U,z,G,K,X])}var hd=_(p(),1);var zd=_(d(),1);function kF({className:$,...Z}){return zd.jsx("div",{"data-slot":"skeleton",className:G1("animate-pulse rounded-lg bg-accent",$),...Z})}var E2=_(d(),1);function TX0($){if($==="needs-auth")return"Needs auth";return $[0].toUpperCase()+$.slice(1)}function CX0({name:$,status:Z}){let J=AF($),H="size-full rounded-lg ring-2 ring-background";return E2.jsxs("span",{className:"relative size-10 shrink-0",children:[J?E2.jsx("img",{src:J,alt:"",className:"size-full rounded-lg ring-2 ring-background"}):E2.jsx("span",{className:"flex size-full items-center justify-center rounded-lg bg-muted text-muted-foreground ring-2 ring-background",children:E2.jsx(LF,{className:"size-5"})}),Z!=="connected"&&E2.jsx(Gd,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function Kd($){return[...$].sort((Z,J)=>Number(J.status==="connected")-Number(Z.status==="connected"))}function Ud({icon:$,children:Z}){return E2.jsxs("div",{className:"flex items-center gap-3 text-card-foreground",children:[$,E2.jsx("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:Z})]})}function Yd({server:$}){return E2.jsxs(Ud,{icon:E2.jsx(CX0,{name:$.name,status:$.status}),children:[E2.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:DF($.name)}),E2.jsx("span",{className:"text-sm text-muted-foreground",children:TX0($.status)})]})}function Fd(){return E2.jsxs(Ud,{icon:E2.jsx(kF,{className:"size-10 shrink-0 rounded-lg"}),children:[E2.jsx(kF,{className:"h-4 w-36 max-w-full"}),E2.jsx(kF,{className:"h-4 w-20"})]})}function mM({children:$}){return E2.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:$})}function Wd($,Z){return J5({queryKey:S0.mcp($),queryFn:()=>q1(`/api/workspaces/${$}/mcp`),enabled:Z,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}var u4=_(d(),1);function gJ({title:$,description:Z,children:J}){return u4.jsxs("div",{className:"flex flex-col gap-6",children:[u4.jsxs("header",{className:"flex flex-col gap-0.5",children:[u4.jsx("h2",{className:"text-lg font-medium",children:$}),Z&&u4.jsx("p",{className:"text-sm text-muted-foreground",children:Z})]}),J]})}function fJ({label:$,children:Z}){return u4.jsxs("section",{className:"flex flex-col gap-2",children:[$&&u4.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:$}),u4.jsx("div",{className:"flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-xl border",children:Z})]})}function CQ({title:$,description:Z,control:J}){return u4.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[u4.jsxs("div",{className:"flex min-w-0 flex-col",children:[u4.jsx("span",{className:"text-sm font-medium",children:$}),Z&&u4.jsx("span",{className:"text-xs text-muted-foreground",children:Z})]}),J&&u4.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:J})]})}var z4=_(d(),1),EX0=Array.from({length:4},($,Z)=>Z);function wX0({connectors:$}){if($.isPending)return z4.jsx("div",{role:"status","aria-label":"Loading connectors",children:z4.jsx(mM,{children:EX0.map((Z)=>z4.jsx(Fd,{},Z))})});if($.isError)return z4.jsxs(qd,{children:[z4.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors."}),z4.jsx(j0,{variant:"outline",size:"sm",onClick:()=>$.refetch(),children:"Retry"})]});if($.data.length===0)return z4.jsxs(qd,{children:[z4.jsx(yF,{size:24,stroke:1.5,className:"text-muted-foreground"}),z4.jsx("p",{className:"text-sm text-foreground",children:"No connectors configured."})]});return z4.jsx(mM,{children:Kd($.data).map((Z)=>z4.jsx(Yd,{server:Z},Z.name))})}function qd({children:$}){return z4.jsx("div",{className:"flex min-h-48 flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border px-8 py-12 text-center",children:$})}function Nd(){let{workspaceId:$}=l1(),Z=Wd($,!0);return z4.jsx(gJ,{title:"Connectors",description:"Connectors available to the agent in this workspace.",children:z4.jsx(wX0,{connectors:Z})})}var dM=_(p(),1);var wQ={};I5(wQ,{Thumb:()=>_d,Root:()=>Md});var w$=_(p(),1);var xF=_(p(),1),uM=xF.createContext(void 0);function Vd(){let $=xF.useContext(uM);if($===void 0)throw Error(h0(63));return $}var Ad="data-checked",Dd="data-unchecked";var hF={..._2,checked($){if($)return{[Ad]:""};return{[Dd]:""}}};var Ld=_(p(),1);function vF($,Z,J,H=!0,B){let[Q,X]=Ld.useState(),z=s0(B?`${B}-label`:void 0),G=$??Z??Q;return H0(()=>{let K=$||Z||!H?void 0:IX0(J.current,z);if(Q!==K)X(K)}),G}function IX0($,Z){let J=RX0($);if(!J)return;if(!J.id&&Z)J.id=Z;return J.id||void 0}function RX0($){if(!$)return;let Z=$.parentElement;if(Z&&Z.tagName==="LABEL")return Z;let J=$.id;if(J){let B=$.nextElementSibling;if(B&&B.htmlFor===J)return B}let H=$.labels;return H&&H[0]}var EQ=_(d(),1),Md=w$.forwardRef(function(Z,J){let{checked:H,className:B,defaultChecked:Q,"aria-labelledby":X,form:z,id:G,inputRef:K,name:U,nativeButton:Y=!1,onCheckedChange:F,readOnly:W=!1,required:q=!1,disabled:N=!1,render:A,uncheckedValue:V,value:D,style:L,...j}=Z,{clearErrors:M}=t2(),{state:P,setTouched:w,setDirty:C,validityData:R,setFilled:O,setFocused:S,validationMode:y,disabled:k,name:T,validation:b}=c5(),{labelId:I}=d5(),v=k||N,h=T??U,f=w$.useRef(null),E=b2(f,K,b.inputRef),i=w$.useRef(null),r=s0(),x=B6({id:G}),l=Y?void 0:x,[o,u]=e2({controlled:H,default:Boolean(Q),name:"Switch",state:"checked"});H6(i,r,o,void 0,!v,U),H0(()=>{O(o)},[o,O]),S9(o,()=>{M(h),C(o!==R.initialValue),b.change(o)});let{getButtonProps:c,buttonRef:n}=O5({disabled:v,native:Y}),Z0=vF(X,I,f,!Y,l),J0={id:Y?x:r,role:"switch","aria-checked":o,"aria-readonly":W||void 0,"aria-required":q||void 0,"aria-labelledby":Z0,onFocus(){if(!v)S(!0)},onBlur(){let A0=f.current;if(!A0||v)return;if(w(!0),S(!1),y==="onBlur")b.commit(A0.checked)},onClick(A0){if(W||v)return;A0.preventDefault();let N0=f.current;if(!N0)return;eZ(N0,A0)}},X0={...b.getValidationProps(v),checked:o,disabled:v,form:z,id:l,name:h,required:q,style:h?fX:y8,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:E,onChange(A0){if(A0.nativeEvent.defaultPrevented)return;if(W){A0.preventDefault();return}let N0=A0.currentTarget.checked,Y0=I0(K0.none,A0.nativeEvent);if(F?.(N0,Y0),Y0.isCanceled)return;u(N0)},onClick(A0){A0.stopPropagation()},onFocus(){i.current?.focus()},...D!==void 0?{value:D}:L1},Q0=w$.useMemo(()=>({...P,checked:o,disabled:v,readOnly:W,required:q}),[P,o,v,W,q]),F0=z0("span",Z,{state:Q0,ref:[J,i,n],props:[J0,j,c,(A0)=>b.getValidationProps(v,A0)],stateAttributesMapping:hF});return EQ.jsxs(uM.Provider,{value:Q0,children:[F0,!o&&h&&V!==void 0&&EQ.jsx("input",{type:"hidden",form:z,name:h,value:V,disabled:v}),EQ.jsx("input",{...X0,suppressHydrationWarning:!0})]})});var Pd=_(p(),1);var _d=Pd.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=Vd();return z0("span",Z,{state:z,ref:J,stateAttributesMapping:hF,props:X})});var pM=_(d(),1);function jd({className:$,...Z}){return pM.jsx(wQ.Root,{"data-slot":"switch",className:G1('peer relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-sm border border-transparent p-px transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-checked:bg-primary data-unchecked:bg-accent data-disabled:cursor-not-allowed data-disabled:opacity-50 [:where([class~="group/field-label"]:has(:focus-visible))_&]:border-transparent [:where([class~="group/field-label"]:has(:focus-visible))_&]:ring-0',$),...Z,children:pM.jsx(wQ.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block size-4 rounded-xs bg-background shadow-xs ring-0 transition-transform data-checked:translate-x-full data-checked:bg-white data-unchecked:translate-x-0"})})}var cM=["app-settings"];function Od(){let $=z1();return K2((Z)=>{if(Z.type==="settings:updated")$.setQueryData(cM,Z.settings)}),J5({queryKey:cM,queryFn:()=>q1("/api/settings"),staleTime:30000})}function Td(){let $=z1();return H5({mutationFn:(Z)=>q1("/api/settings",v5("PATCH",Z),"Failed to save settings"),onSuccess:(Z)=>{$.setQueryData(cM,Z)}})}function Cd($){return J5({queryKey:S0.env($),queryFn:()=>q1(`/api/workspaces/${$}/env`),...v4})}function Ed($){let Z=z1();return H5({mutationFn:(J)=>q1(`/api/workspaces/${$}/env`,v5("PUT",J)),onSuccess:(J)=>{Z.setQueryData(S0.env($),J)}})}function wd($){let Z=z1();return H5({mutationFn:(J)=>A4(`/api/workspaces/${$}/config`,v5("PUT",{name:J}),"Failed to save name"),onSuccess:()=>{Z.invalidateQueries({queryKey:S0.layout($)}),Z.invalidateQueries({queryKey:S0.all})}})}function Sd($){let Z=z1();return H5({scope:{id:`workspace-icon:${$}`},mutationFn:async(J)=>{if(J.kind==="set"){await A4(`/api/workspaces/${$}/config`,v5("PUT",{icon:J.icon}),"Failed to save icon");return}if(J.kind==="reset"){await A4(`/api/workspaces/${$}/icon`,{method:"DELETE"},"Failed to reset icon");return}await q1(`/api/workspaces/${$}/icon`,{method:"PUT",headers:{"Content-Type":J.file.type||"application/octet-stream"},body:J.file})},onMutate:(J)=>{if(J.kind!=="set")return;let H={icon:J.icon};Z.setQueryData(S0.layout($),(B)=>B?{...B,...H}:B),Z.setQueryData(S0.all,(B)=>B?.map((Q)=>Q.id===$?{...Q,...H}:Q))},onError:(J,H)=>{if(H.kind!=="set")return;Z.invalidateQueries({queryKey:S0.layout($)}),Z.invalidateQueries({queryKey:S0.all,exact:!0})},onSuccess:()=>{Z.invalidateQueries({queryKey:S0.layout($)}),Z.invalidateQueries({queryKey:S0.all})}})}function Id($){let Z=z1();return K2((J)=>{if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:S0.env($)})}),{env:Cd($),update:Ed($)}}var u5=_(d(),1),bX0={dotenv:".env",custom:"secret",both:"override"},kX0=/^[A-Za-z_][A-Za-z0-9_]*$/;function Rd(){let{workspaceId:$}=l1(),{env:Z,update:J}=Id($),[H,B]=dM.useState(""),[Q,X]=dM.useState(""),z=kX0.test(H),G=z&&Q.length>0&&!J.isPending,K=()=>{if(!G)return;J.mutate({set:{[H]:Q}},{onSuccess:()=>{B(""),X("")}})},U=Z.data?.vars??[],Y=Z.data?.files.reduce((W,q)=>W+q.count,0)??0,F=Z.data?.files.length??0;return u5.jsxs(gJ,{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:[u5.jsxs(fJ,{label:"Variables",children:[Z.isLoading?u5.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:u5.jsx(b5,{className:"size-4 animate-spin",stroke:1.75})}):U.length===0?u5.jsx("p",{className:"px-3.5 py-4 text-sm text-muted-foreground",children:"No variables yet."}):U.map((W)=>{let q=W.source!=="dotenv";return u5.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[u5.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:W.key}),u5.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),u5.jsx("span",{className:G0("rounded-lg px-1.5 py-0.5 text-[11px] font-medium",W.source==="dotenv"?"bg-muted text-muted-foreground":"bg-primary/10 text-primary"),children:bX0[W.source]}),!q&&u5.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),u5.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>J.mutate({remove:[W.key]}),disabled:!q,"aria-label":`Delete ${W.key}`,className:"disabled:invisible",children:u5.jsx(gF,{stroke:1.75})})]},W.key)}),u5.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[u5.jsx(f7,{value:H,onChange:(W)=>B(W.target.value),placeholder:"NEW_KEY","aria-invalid":H.length>0&&!z,className:"h-7 w-40 font-mono text-xs"}),u5.jsx(f7,{value:Q,onChange:(W)=>X(W.target.value),onKeyDown:(W)=>{if(W.key==="Enter")K()},type:"password",placeholder:"value",className:"h-7 flex-1 text-xs"}),u5.jsxs(j0,{variant:"outline",size:"sm",onClick:K,disabled:!G,children:[J.isPending?u5.jsx(b5,{stroke:1.75,className:"animate-spin"}):u5.jsx(h2,{stroke:1.75}),"Add"]})]})]}),u5.jsx(fJ,{label:"From .env files",children:u5.jsx(CQ,{title:"Inherit .env files",description:F>0?`Discovered ${Y} ${Y===1?"key":"keys"} across ${F} ${F===1?"file":"files"} in this space.`:"No .env files found in this space.",control:u5.jsx(jd,{checked:Z.data?.inheritDotenv??!0,disabled:Z.isLoading,onCheckedChange:(W)=>J.mutate({inheritDotenv:W})})})})]})}var t8={};I5(t8,{createHandle:()=>yd,Viewport:()=>KG,Trigger:()=>kd,Title:()=>UG,Root:()=>bd,Portal:()=>BG,Popup:()=>HG,Handle:()=>fF,Description:()=>tz,Close:()=>sz,Backdrop:()=>nz});function bd($){return GG("alert-dialog",$)}var kd=YG;class fF extends MZ{}function yd(){return new fF}var G4=_(d(),1);function mF({...$}){return G4.jsx(t8.Root,{"data-slot":"alert-dialog",...$})}function uF({...$}){return G4.jsx(t8.Trigger,{"data-slot":"alert-dialog-trigger",...$})}function yX0({...$}){return G4.jsx(D8,{portal:t8.Portal,"data-slot":"alert-dialog-portal",...$})}function xX0({className:$,...Z}){return G4.jsx(t8.Backdrop,{"data-slot":"alert-dialog-overlay",className:G1("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",$),...Z})}function pF({className:$,size:Z="default",...J}){return G4.jsxs(yX0,{children:[G4.jsx(xX0,{}),G4.jsx(t8.Popup,{"data-slot":"alert-dialog-content","data-size":Z,className:G1("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-sm text-popover-foreground shadow-xl duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm 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})]})}function cF({className:$,...Z}){return G4.jsx("div",{"data-slot":"alert-dialog-header",className:G1("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",$),...Z})}function dF({className:$,...Z}){return G4.jsx("div",{"data-slot":"alert-dialog-footer",className:G1("-mx-6 -mb-6 flex flex-col-reverse gap-2 rounded-b-xl p-6 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",$),...Z})}function lF({className:$,...Z}){return G4.jsx(t8.Title,{"data-slot":"alert-dialog-title",className:G1('text-base font-medium sm:group-data-[size=default]/alert-dialog-content:[:where([class~="group/alert-dialog-content"]):has([data-slot=alert-dialog-media])_&]:col-start-2',$),...Z})}function iF({className:$,...Z}){return G4.jsx(t8.Description,{"data-slot":"alert-dialog-description",className:G1("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",$),...Z})}function rF({className:$,...Z}){return G4.jsx(j0,{"data-slot":"alert-dialog-action",className:G1($),...Z})}function aF({className:$,variant:Z="outline",size:J="default",...H}){return G4.jsx(t8.Close,{"data-slot":"alert-dialog-cancel",className:G1($),render:G4.jsx(j0,{variant:Z,size:J}),...H})}var z2=_(d(),1);function xd(){let{cloudDemo:$}=I9(),{name:Z,cwd:J,workspaceId:H}=l1(),[,B]=K8(),Q=NE(),X=Z??J??"this space",z=()=>{Q.mutate(H,{onSuccess:()=>B("/")})};return z2.jsxs(gJ,{title:"General",description:"Basic details for this space.",children:[z2.jsx(fJ,{children:z2.jsx(CQ,{title:"Path",control:z2.jsx(f7,{value:J??"","aria-label":"Workspace path",title:J??void 0,className:"w-56",readOnly:!0})})}),!$&&z2.jsx(fJ,{label:"Danger zone",children:z2.jsx(CQ,{title:"Remove space",description:"Remove this space from moi. Its folder and sessions stay on disk.",control:z2.jsxs(mF,{children:[z2.jsx(uF,{render:z2.jsx(j0,{type:"button",variant:"destructive",size:"sm"}),disabled:Q.isPending,children:"Remove"}),z2.jsxs(pF,{children:[z2.jsxs(cF,{children:[z2.jsxs(lF,{children:["Remove “",X,"” from your workspaces?"]}),z2.jsx(iF,{children:"This only removes it from your list. The folder and its sessions stay on disk. You can add it back any time."})]}),Q.isError&&z2.jsx("p",{className:"text-xs text-destructive",children:Q.error.message}),z2.jsxs(dF,{children:[z2.jsx(aF,{disabled:Q.isPending,children:"Cancel"}),z2.jsxs(rF,{type:"button",variant:"destructive",onClick:z,disabled:Q.isPending,children:[Q.isPending&&z2.jsx(b5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})]})]})]})})})]})}var p4=_(d(),1),hX0=[{id:"general",label:"General",icon:Q6},{id:"connectors",label:"Connectors",icon:yF},{id:"environment",label:"Environment",icon:RG}];function oF({children:$}){let[Z,J]=hd.useState("general");return p4.jsxs($6,{children:[$,p4.jsxs(PZ,{className:"flex h-[min(680px,90vh)] w-[880px] gap-0 overflow-hidden p-0 sm:max-w-[94vw]",children:[p4.jsx(Z6,{className:"sr-only",children:"Space settings"}),p4.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r bg-muted p-3",children:[p4.jsx("p",{className:"px-2.5 pt-4 pb-2 text-xs text-muted-foreground",children:"Settings"}),hX0.map((H)=>p4.jsxs(j0,{type:"button",variant:Z===H.id?"secondary":"ghost",size:"sm",onClick:()=>J(H.id),className:"justify-start",children:[p4.jsx(H.icon,{stroke:1.75}),H.label]},H.id))]}),p4.jsx("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:p4.jsxs("div",{className:"px-8 py-7",children:[Z==="general"&&p4.jsx(xd,{}),Z==="connectors"&&p4.jsx(Nd,{}),Z==="environment"&&p4.jsx(Rd,{})]})})]})]})}var ld=_(p(),1);var vd=_(p(),1);var gd=_(d(),1);function nF({className:$,onBlur:Z,onFocus:J,onKeyDown:H,onValueChange:B,onValueCommit:Q,selectOnFocus:X,...z}){let G=vd.useRef(null);function K(F){let W=G.current!==null;if(G.current=null,Z?.(F),!F.defaultPrevented&&W)Q?.(F.currentTarget.value)}function U(F){if(G.current=F.currentTarget.value,X){let W=F.currentTarget;W.select(),requestAnimationFrame(()=>{W.scrollLeft=0})}J?.(F)}function Y(F){if(H?.(F),F.defaultPrevented)return;if(F.key==="Enter")F.preventDefault(),F.currentTarget.blur();else if(F.key==="Escape"){F.preventDefault();let W=G.current??F.currentTarget.value;G.current=null,F.currentTarget.value=W,B?.(W),F.currentTarget.blur()}}return gd.jsx(dH,{"data-slot":"inline-input",className:G0("-ml-2 [field-sizing:content] w-auto max-w-full min-w-0 rounded-md bg-transparent px-2 py-0.5 text-sm shadow-none outline-none focus:[field-sizing:fixed] focus:w-full focus-visible:border-ring focus-visible:bg-accent disabled:pointer-events-none",$),onBlur:K,onChange:(F)=>B?.(F.target.value),onFocus:U,onKeyDown:Y,...z})}function sF($){return J5({queryKey:S0.views($),queryFn:async()=>{return(await q1(`/api/workspaces/${$}/views`)).views},...v4})}function fd($){return H5({mutationFn:({viewId:Z,title:J})=>q1(`/api/workspaces/${$}/views/${encodeURIComponent(Z)}`,v5("PATCH",{title:J}),"Failed to rename view")})}function md($){return H5({mutationFn:(Z)=>A4(`/api/workspaces/${$}/views/${encodeURIComponent(Z)}`,{method:"DELETE"},"Failed to delete view")})}function tF($,Z){let J=$??[];if(J.findIndex((B)=>B.id===Z.id)===-1)return[...J,Z];return J.map((B)=>B.id===Z.id&&B.updatedAt<=Z.updatedAt?Z:B)}function eF($){let Z=z1();return K2((J)=>{if(J.type==="view-builder:updated"&&J.workspaceId===$)Z.setQueryData(S0.viewBuilders($),(H)=>tF(H,J.builder));else if(J.type==="view-builder:deleted"&&J.workspaceId===$)Z.setQueryData(S0.viewBuilders($),(H)=>(H??[]).filter((B)=>B.id!==J.builderId))}),J5({queryKey:S0.viewBuilders($),queryFn:async()=>{return(await q1(`/api/workspaces/${$}/view-builders`)).builders},...v4})}function ud($){let Z=z1();return H5({mutationFn:()=>q1(`/api/workspaces/${$}/view-builders`,v5("POST"),"Failed to create view builder"),onSuccess:(J)=>{Z.setQueryData(S0.viewBuilders($),(H)=>tF(H,J))}})}function pd($){let Z=z1();return H5({mutationFn:({builderId:J,requirements:H})=>q1(`/api/workspaces/${$}/view-builders/${J}`,v5("PATCH",{input:{requirements:H}}),"Failed to save view requirements"),onSuccess:(J)=>{Z.setQueryData(S0.viewBuilders($),(H)=>tF(H,J))}})}function cd($){let Z=z1();return H5({mutationFn:({builderId:J,requirements:H,...B})=>q1(`/api/workspaces/${$}/view-builders/${J}/submit`,v5("POST",{input:{requirements:H},availableIcons:lH,...B}),"Failed to start view builder"),onSuccess:(J)=>{Z.setQueryData(S0.viewBuilders($),(H)=>tF(H,J))}})}function dd($){let Z=z1();return H5({mutationFn:(J)=>A4(`/api/workspaces/${$}/view-builders/${J}`,{method:"DELETE"},"Failed to discard view builder"),onSuccess:(J,H)=>{Z.setQueryData(S0.viewBuilders($),(B)=>(B??[]).filter((Q)=>Q.id!==H))}})}function SQ($){return $.config.title||$.id}function IQ($,Z){let J=Z.find((H)=>H.viewId===$.id);return u7($.config.icon)??u7(J?.icon)??WJ}var C1=_(d(),1);function vX0({outlined:$,onClick:Z}){return C1.jsxs("button",{type:"button","aria-label":"Create new view",onClick:Z,className:G0("group flex w-20 shrink-0 cursor-pointer flex-col items-center gap-2 text-sm",$?"text-foreground":"text-muted-foreground"),children:[C1.jsx("div",{className:G0("size-16 rounded-2xl squircle",$&&"shadow-xs transition-shadow duration-300 ease-out group-hover:shadow-2xl"),children:C1.jsx("div",{className:G0("flex size-full items-center justify-center rounded-2xl squircle",$?"bg-background text-foreground":"bg-accent"),children:C1.jsx(h2,{size:32,stroke:1.25})})}),C1.jsx("span",{className:"line-clamp-2 w-full text-xs leading-snug font-medium text-ellipsis",children:"New view"})]})}function gX0({view:$,Icon:Z,onOpen:J}){let{workspaceId:H}=l1(),B=fd(H),Q=md(H),X=SQ($),[z,G]=ld.useState(!1);function K(){G(!0)}function U(Y){let F=Y.trim();if(!F||F===X)return;B.mutate({viewId:$.id,title:F},{onError:(W)=>{q5.add({title:"Couldn’t rename view",description:W.message,type:"error"})}})}return C1.jsxs("div",{className:"group/item relative w-20 shrink-0",children:[C1.jsxs("button",{type:"button","aria-label":`Open ${X}`,onClick:J,className:"group flex w-20 cursor-pointer flex-col items-center gap-2 text-sm text-foreground",children:[C1.jsx("div",{className:"size-16 rounded-2xl transition-shadow duration-300 ease-out squircle group-hover:shadow-xl group-hover/item:shadow-xl",children:C1.jsx("div",{"data-vivid":!0,className:"flex size-full items-center justify-center rounded-2xl bg-primary text-primary-foreground inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)] squircle",children:C1.jsx(Z,{size:32,stroke:1.25})})}),C1.jsx("span",{className:"line-clamp-2 w-full text-xs leading-snug font-medium text-ellipsis",children:z?"":X})]}),z&&C1.jsx(nF,{autoFocus:!0,selectOnFocus:!0,"aria-label":`Rename ${X}`,defaultValue:X,onBlur:()=>G(!1),onValueCommit:U,className:"absolute top-18 left-0 m-0 h-auto w-20 max-w-20 min-w-0 rounded-xs px-1 py-0 text-center text-xs leading-snug font-medium"}),C1.jsxs(mF,{children:[C1.jsxs(c9,{children:[C1.jsx(d9,{render:C1.jsx(j0,{type:"button",variant:"outline",size:"icon-xs","aria-label":`View actions for ${X}`,className:"absolute -top-1 right-1 border-0 opacity-0 shadow-xs transition-opacity group-hover/item:opacity-100 group-hover/item:delay-400 focus-visible:opacity-100 data-popup-open:opacity-100",children:C1.jsx(IG,{stroke:1.75})})}),C1.jsxs(l9,{align:"end",className:"min-w-32",children:[C1.jsxs(n8,{onClick:K,disabled:B.isPending,children:[C1.jsx(MY,{stroke:1.75}),"Rename"]}),C1.jsxs(n8,{nativeButton:!0,render:C1.jsx(uF,{}),disabled:Q.isPending,onClick:()=>Q.reset(),className:"w-full",children:[C1.jsx(gF,{stroke:1.75}),"Delete"]})]})]}),C1.jsxs(pF,{children:[C1.jsxs(cF,{children:[C1.jsxs(lF,{children:["Delete “",X,"”?"]}),C1.jsx(iF,{children:"This deletes the view and its source code. Related data and shared files stay in the workspace."})]}),Q.isError&&C1.jsx("p",{className:"text-xs text-destructive",children:Q.error.message}),C1.jsxs(dF,{children:[C1.jsx(aF,{disabled:Q.isPending,children:"Cancel"}),C1.jsxs(rF,{type:"button",variant:"destructive",disabled:Q.isPending,onClick:()=>Q.mutate($.id),children:[Q.isPending&&C1.jsx(b5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Delete view"]})]})]})]})]})}function id({views:$,builders:Z,onOpenView:J,onCreateView:H,showOnboarding:B}){let Q=$.length===0;return C1.jsxs("div",{className:"relative no-scrollbar flex size-full items-center overflow-hidden bg-muted",children:[Q&&C1.jsx("div",{className:"pointer-events-none absolute inset-0 texture-checker [mask-image:linear-gradient(to_right,transparent_40%,black_80%)]","aria-hidden":!0}),C1.jsx("h2",{className:"relative pr-6 pl-12 text-2xl font-semibold text-foreground",children:"Views"}),C1.jsxs("div",{className:"relative no-scrollbar flex scroll-fade-x gap-2 overflow-x-auto px-6 pt-4 [--scroll-fade-reveal:16px]",children:[$.map((X)=>C1.jsx(gX0,{view:X,Icon:IQ(X,Z),onOpen:()=>J(X.id)},X.id)),C1.jsx(vX0,{outlined:Q,onClick:H})]}),Q&&B&&C1.jsx("p",{className:"relative mr-8 ml-auto max-w-56 text-right text-sm text-muted-foreground",children:"Create new views when you need separate pages for focused tasks"})]})}var ad=_(d(),1),fX0={[gA.id]:($)=>ad.jsx(id,{views:$.views,builders:$.builders,onOpenView:$.onOpenView,onCreateView:$.onCreateView,showOnboarding:$.showOnboarding})};function rd($,Z){if(!u9($))return;return fX0[$](Z)}function od($,Z,J,H){let B=$.reduce((Q,X)=>Math.max(Q,X.y+X.h),0);for(let Q=0;Q<=B+J;Q++)for(let X=0;X<=H-Z;X++)if(!$.some((G)=>!(X+Z<=G.x||G.x+G.w<=X||Q+J<=G.y||G.y+G.h<=Q)))return{x:X,y:Q};return{x:0,y:B}}function RQ($,Z=[],J=4){let H=[];for(let B of $){let{x:Q,y:X}=B.x!==void 0&&B.y!==void 0?{x:B.x,y:B.y}:od([...Z,...H],B.w,B.h,J);H.push({i:B.id,x:Q,y:X,w:B.w,h:B.h})}return H}function $W($,Z,J){return od($,Z,J,4)}function nd($,Z){let J=new Map(Z.map((H)=>[H.id,H]));return $.map((H)=>{let B=J.get(H.i);return B?{...H,x:B.x,y:B.y}:H})}var lM=_(p(),1),ZW=new Map;function mX0($){let Z=window.__moiAppletCss?.get($)??"",J=ZW.get($);if(!J){let Q=document.createElement("style");Q.dataset.appletStyle=$,document.head.appendChild(Q),J={el:Q,refs:0},ZW.set($,J)}if(J.el.textContent!==Z)J.el.textContent=Z;J.refs++;let H=J,B=!1;return()=>{if(B)return;if(B=!0,H.refs--,H.refs<=0)H.el.remove(),ZW.delete($)}}function uX0($){let Z=ZW.get($);if(!Z||Z.el===document.head.lastElementChild)return;document.head.appendChild(Z.el)}function JW($,Z,J=!1){lM.useInsertionEffect(()=>mX0($),[$,Z]),lM.useInsertionEffect(()=>{if(J)uX0($)},[$,J,Z])}var td=_(d(),1);function sd({segment:$,name:Z,version:J,children:H}){let B=e1();return JW(BU($,B,Z),J),td.jsx("div",{"data-applet":QU($,Z),className:"size-full",children:H})}var ed=_(p(),1);var mJ=_(d(),1);class bQ extends ed.Component{state={error:null};static getDerivedStateFromError($){return{error:$}}componentDidCatch($,Z){console.error(`[widget:${this.props.name}]`,$,Z.componentStack),n4(this.props.workspaceId,{source:"render",kind:this.props.kind,name:this.props.name,message:$.message||String($),stack:[$.stack,Z.componentStack].filter(Boolean).join(`
67
+ `)})}componentDidUpdate($){if($.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}render(){if(this.state.error)return mJ.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[mJ.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[mJ.jsx(Ez,{size:16,stroke:1.75}),"Widget crashed"]}),mJ.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var i6=_(d(),1);function $l({name:$}){let Z=e1(),J=vk($);return i6.jsxs(L4,{mode:"wait",initial:!1,children:[J.status==="ready"&&i6.jsx(V5.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:i6.jsx(bQ,{name:$,kind:"widget",workspaceId:Z,resetKey:J.version,children:i6.jsx(sd,{segment:"widgets",name:$,version:J.version,children:i6.jsx(J.Component,{})})})},J.version),J.status==="error"&&i6.jsx(V5.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:J.error},`err-${J.version}`)]})}var Jl=_(p(),1);var r6=_(d(),1);function HW({customizing:$,hidden:Z,widgetId:J,onRemove:H,children:B}){let Q=tk(),X=!J||!u9(J);return r6.jsxs(V5.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:[r6.jsx("div",{"data-widget-chrome":!0,"data-vivid":X?!0:void 0,style:X?a8(Q,"widget"):void 0,className:G0("absolute inset-0 overflow-hidden rounded-2xl text-foreground squircle",$&&"pointer-events-none"),children:B}),$&&H&&r6.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:r6.jsx(j0,{size:"icon-sm",variant:"outline",className:"rounded-full","aria-label":Z?"Restore widget":"Hide widget",onPointerDown:(z)=>z.stopPropagation(),onClick:H,children:Z?r6.jsx(h2,{stroke:1.75}):r6.jsx(Zl,{stroke:1.75})})})]})}var w3=_(d(),1),pX0={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},cX0={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"},dX0={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},lX0={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function Hl({items:$,renderItem:Z,onCreateWidget:J,onClose:H,onRestore:B,ref:Q}){let X=Jl.useMemo(()=>RQ($),[$]);return w3.jsx(SF,{ref:Q,title:"Widgets",actions:w3.jsxs(j0,{type:"button",variant:"secondary",size:"sm",onClick:J,children:[w3.jsx(h2,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),onClose:H,className:"max-h-[60vh]",children:X.length>0&&w3.jsx("div",{className:"grid auto-rows-[160px] grid-cols-4 gap-2",children:w3.jsx(L4,{children:X.map((z)=>w3.jsx(V5.div,{layoutId:z.i,className:G0(pX0[z.x],cX0[z.y],dX0[z.w],lX0[z.h]),transition:{type:"spring",duration:0.35,bounce:0},children:w3.jsx(HW,{customizing:!0,widgetId:z.i,onRemove:()=>B(z.i),hidden:!0,children:Z(z.i)})},z.i))})})})}var MW=_(p(),1);var O4=_(p(),1);var $1=_(p(),1),uJ=_(p(),1),J8=_(p(),1),Tl=_(d(),1),QW=_(p(),1),XW=_(p(),1),v1=_(d(),1),iX0=Object.defineProperty,rX0=($,Z)=>{for(var J in Z)iX0($,J,{get:Z[J],enumerable:!0})},S3={};rX0(S3,{ActiveEmoji:()=>ul,Empty:()=>ml,List:()=>vl,Loading:()=>fl,Root:()=>Il,Search:()=>Rl,SkinTone:()=>pl,SkinToneSelector:()=>gl,Viewport:()=>bl});var Ll="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",aM=["none","light","medium-light","medium","medium-dark","dark"];function iM($){return $.charAt(0).toUpperCase()+$.slice(1)}var e8=2,K4=null;function Bl($){try{K4??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!K4||(queueMicrotask(()=>{K4&&(K4=null)}),K4.canvas.width=e8,K4.canvas.height=e8,K4.font=`2px ${Ll}`,K4.textBaseline="middle",K4.measureText($).width>=e8*2))return!1;K4.fillStyle="#00f",K4.fillText($,0,0);let Z=K4.getImageData(0,0,e8,e8).data;K4.clearRect(0,0,e8,e8),K4.fillStyle="#f00",K4.fillText($,0,0);let J=K4.getImageData(0,0,e8,e8).data;for(let H=0;H<e8*e8*4;H+=4)if(Z[H]!==J[H]||Z[H+1]!==J[H+1]||Z[H+2]!==J[H+2])return!1;return!0}function Ql($,Z,J){try{let H=$.getItem(Z);if(!H)throw Error(`No value found for "${Z}".`);let B=JSON.parse(H);return J(B)}catch{return null}}function Ml($,Z,J){$.setItem(Z,JSON.stringify(J))}function Xl($){return(Z)=>Z===void 0?void 0:$(Z)}function zl($){return(Z)=>Z===null?null:$(Z)}function f2($){if(typeof $!="string")throw Error();return $}function BW($){if(typeof $!="number")throw Error();return $}function Pl($){if(typeof $!="boolean")throw Error();return $}function a6($){return(Z)=>{if(typeof Z!="object"||Z===null)throw Error();let J={};for(let H in $){let B=Z[H];B===void 0&&$[H](void 0),J[H]=$[H](B)}return J}}function rM($){return(Z)=>{if(!Array.isArray(Z))throw Error();return Z.length>0&&$(Z[0]),Z}}var _l=($,Z)=>`${$}/${Z}/data.json`,jl=($,Z)=>`${$}/${Z}/messages.json`,aX0=["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"],Gl="en",Ol=($)=>`frimousse/data/${$}`,Kl="frimousse/metadata";async function Ul($,Z){try{return(await fetch($,{method:"HEAD",signal:Z})).headers.get("etag")}catch{return null}}async function oX0($,Z,J){let[{emojis:H,emojisEtag:B},{messages:Q,messagesEtag:X}]=await Promise.all([fetch(_l($,Z),{signal:J}).then(async(z)=>({emojis:await z.json(),emojisEtag:z.headers.get("etag")})),fetch(jl($,Z),{signal:J}).then(async(z)=>({messages:await z.json(),messagesEtag:z.headers.get("etag")}))]);return{emojis:H,messages:Q,emojisEtag:B,messagesEtag:X}}async function nX0($,Z,J){let[H,B]=await Promise.all([Ul(_l($,Z),J),Ul(jl($,Z),J)]);return{emojisEtag:H,messagesEtag:B}}function sX0($){return $.skins?$.skins.filter((Z)=>typeof Z.tone=="number").reduce((Z,J)=>{let H=aM[J.tone];return Z[H]=J.emoji,Z},{}):void 0}async function Yl($,Z,J){let{emojis:H,emojisEtag:B,messages:Q,messagesEtag:X}=await oX0($,Z,J),z=Q.subgroups.find((q)=>q.key==="country-flag"||q.key==="subdivision-flag"),G=Q.groups.filter((q)=>q.key!=="component"),K=H.filter((q)=>("group"in q)),U=G.map((q)=>({index:q.order,label:iM(q.message)})),Y=Q.skinTones.reduce((q,N)=>(q[N.key]=iM(N.message),q),{}),F=K.map((q)=>({emoji:q.emoji,category:q.group,version:q.version,label:iM(q.label),tags:q.tags??[],countryFlag:z&&q.subgroup===z.order||void 0,skins:sX0(q)})),W={locale:Z,emojis:F,categories:U,skinTones:Y};return Ml(localStorage,Ol(Z),{data:W,metadata:{emojisEtag:B,messagesEtag:X}}),W}function tX0($,Z){let J=new Map;for(let X of $)J.has(X.version)||J.set(X.version,X.emoji);let H=[...J.keys()].sort((X,z)=>z-X),B=H[0]??0,Q=Bl("\uD83C\uDDEA\uD83C\uDDFA");if(typeof Z=="number")return{emojiVersion:Z,countryFlags:Q};for(let X of H){let z=J.get(X);if(Bl(z))return{emojiVersion:X,countryFlags:Q}}return{emojiVersion:B,countryFlags:Q}}var eX0=a6({emojiVersion:BW,countryFlags:Pl}),$z0=a6({data:a6({locale:f2,emojis:rM(a6({emoji:f2,category:BW,label:f2,version:BW,tags:rM(f2),countryFlag:Xl(Pl),skins:Xl(a6({light:f2,"medium-light":f2,medium:f2,"medium-dark":f2,dark:f2}))})),categories:rM(a6({index:BW,label:f2})),skinTones:a6({light:f2,"medium-light":f2,medium:f2,"medium-dark":f2,dark:f2})}),metadata:a6({emojisEtag:zl(f2),messagesEtag:zl(f2)})});async function Zz0({locale:$,emojiVersion:Z,emojibaseUrl:J,signal:H}){let B=typeof J=="string"?J:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof Z=="number"?Math.floor(Z):"latest"}`,Q=Ql(sessionStorage,Kl,eX0),X=Ql(localStorage,Ol($),$z0),z;if(!X)z=await Yl(B,$,H);else if(Q)z=X.data;else try{let{emojisEtag:K,messagesEtag:U}=await nX0(B,$,H);z=!K||!U||K!==X.metadata.emojisEtag||U!==X.metadata.messagesEtag?await Yl(B,$,H):X.data}catch{z=X.data}Q??=tX0(z.emojis,Z),Ml(sessionStorage,Kl,Q);let G=z.emojis.filter((K)=>{let U=K.version<=Q.emojiVersion;return K.countryFlag?U&&Q.countryFlags:U});return{locale:$,emojis:G,categories:z.categories,skinTones:z.skinTones}}function Fl($){return aX0.includes($)?$:(console.warn(`Locale "${$}" is not supported, using "${Gl}" instead.`),Gl)}function Wl($){return aM.includes($)?$:(console.warn(`Skin tone "${$}" is not valid, using "none" instead.`),"none")}function Jz0($,Z){let J=[];if(Z<=0)return J;for(let H=0,B=$.length;H<B;H+=Z)J.push($.slice(H,H+Z));return J}function Hz0($,Z){if(!Z)return $;let J=Z.toLowerCase().trim(),H=new WeakMap;return $.filter((B)=>{let Q=0;B.label.toLowerCase().includes(J)&&(Q+=10);for(let X of B.tags)X.toLowerCase().includes(J)&&(Q+=1);return Q>0?(H.set(B,Q),!0):!1}).sort((B,Q)=>(H.get(Q)??0)-(H.get(B)??0))}function Bz0($,Z,J,H){let B=Hz0($.emojis,H),Q=[],X=[],z=[],G={},K=0,U=0;for(let Y of B)G[Y.category]||(G[Y.category]=[]),G[Y.category].push({emoji:J&&J!=="none"&&Y.skins?Y.skins[J]:Y.emoji,label:Y.label});for(let Y of $.categories){let F=G[Y.index];if(!F||F.length===0)continue;let W=Jz0(Array.from(F),Z).map((q)=>({categoryIndex:K,emojis:q}));Q.push(...W),X.push({label:Y.label,rowsCount:W.length,startRowIndex:U}),z.push(U),K++,U+=W.length}return{count:B.length,categories:X,categoriesStartRowIndices:z,rows:Q,skinTones:$.skinTones}}function Qz0($){let Z={},J=null,H=null,B=new Set,Q=()=>{if(J){Z=J,J=null;for(let K of B)K(Z)}H=null},X=()=>J??Z,z=(K)=>{J??=Z,Object.assign(J,typeof K=="function"?K(X()):K),H||(H=requestAnimationFrame(Q))},G=(K)=>(B.add(K),()=>B.delete(K));return Z=$(z,X),{get:X,set:z,subscribe:G}}function Xz0($){let[Z]=J8.useState($);return Z}function zz0($){let Z=J8.createContext(null);return{useStore:()=>{let J=J8.useContext(Z);if(!J)throw Error($);return J},Provider:({store:J,children:H})=>Tl.jsx(Z.Provider,{value:J,children:H})}}function Z8($,Z,J=Object.is){let[H,B]=J8.useState(()=>Z($.get()));return J8.useEffect(()=>$.subscribe(()=>{let Q=Z($.get());B((X)=>J(X,Q)?X:Q)}),[$,Z,J]),J8.useDebugValue(H),H}function t9($,Z,J){let H=J8.useCallback((B)=>B[Z],[Z]);return Z8($,H,J)}var ql=2;function Gz0($,Z,J,H,B){let Q=0;return Qz0((X,z)=>({locale:Z,columns:J,sticky:H,skinTone:B,onEmojiSelect:$,data:null,search:"",interaction:"none",activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:(G)=>{let K=z(),U=G?.data??K.data,Y=G?.categoryHeaderHeight??K.categoryHeaderHeight,F=G?.rowHeight??K.rowHeight,W=G?.viewportHeight??K.viewportHeight;if(!U||U.rows.length===0||!Y||!F||!W)return X({...G,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let q=0,N=0;for(let C of U.categories)if(N++*Y+C.startRowIndex*F<Q)q+=Y;else break;let A=U.categories.length*Y+U.rows.length*F,V=Math.floor(ql*F/2),D=Math.ceil(ql*F/2),L=Math.min(Q-q-V,A-W),j=L+W+D,M=Math.max(0,Math.floor(L/F)),P=Math.min(U.rows.length-1,Math.ceil(j/F)),w=U.rows[M]?.categoryIndex;return X(w===void 0&&G?G:{...G,viewportStartCategoryIndex:w,viewportStartRowIndex:M,viewportEndRowIndex:P})},onDataChange:(G)=>{z().updateViewportState({data:G,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:(G)=>{X({search:G,interaction:G?"keyboard":"none"})},onActiveEmojiChange:(G,K,U)=>{if(X({interaction:G,activeColumnIndex:K,activeRowIndex:U}),G!=="keyboard")return;let{listRef:Y,viewportRef:F,sticky:W,rowHeight:q,viewportHeight:N,categoryHeaderHeight:A}=z(),V=Y?.current,D=F?.current;if(!V||!D||!q||!A||!N)return;let L=U;L===0&&D.scrollTo({top:0,behavior:"instant"});let j=V.querySelector(`[aria-rowindex="${L}"]`);if(!(j instanceof HTMLElement))return;let M=j.offsetTop,P=getComputedStyle(j),w=Number.parseFloat(P.scrollMarginTop),C=Number.parseFloat(P.scrollMarginBottom),R=Q+w;W&&M<Q+N/2&&(R+=A);let O=R+N-C;(M<R||M+q>O)&&D.scrollTo({top:Math.max(M<R+A?M-Math.max(W?A:0,w):M-N+q+C,0),behavior:"instant"})},onActiveEmojiReset:()=>{X({interaction:"none",activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:(G)=>{z().updateViewportState({rowHeight:G})},onCategoryHeaderHeightChange:(G)=>{z().updateViewportState({categoryHeaderHeight:G})},onViewportSizeChange:(G,K)=>{z().updateViewportState({viewportWidth:G,viewportHeight:K})},onViewportScroll:(G)=>{Q=G,z().updateViewportState()}}))}var{useStore:c4,Provider:Kz0}=zz0("EmojiPicker.Root is missing.");function Uz0($){return $.search}function oM($){return $.interaction==="none"?void 0:$.data?.rows[$.activeRowIndex]?.emojis[$.activeColumnIndex]}function Yz0($){return $.data===void 0||typeof $.data?.count=="number"&&$.data.count===0}function Fz0($){return $.data===null||$.viewportHeight===null||$.rowHeight===null||$.categoryHeaderHeight===null}function Cl($){return $.data?.rows.length}function Wz0($){return $.data?.categories.length}function qz0($){return $.data?.categoriesStartRowIndices}function Nz0($){return $.data?.skinTones}function El($,Z){return $?.emoji===Z?.emoji}function Vz0($,Z){return $?.categoryIndex!==Z?.categoryIndex||$?.emojis.length!==Z?.emojis.length?!1:!!$?.emojis.every((J,H)=>El(J,Z?.emojis[H]))}var kQ="‍",Nl=/\p{Emoji_Modifier_Base}/u,Az0=/\uFE0F$/,Dz0=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,Lz0={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function Mz0($,Z){if(!$.split(kQ).some((H)=>Nl.test(H)))return $;let J=$.split(kQ).map((H)=>H.replace(Dz0,"")).join(kQ);return Z==="none"?J:J.split(kQ).map((H,B,Q)=>{let X=Q.length>1;return!Nl.test(H)||X&&H==="\uD83E\uDD1D"?H:H.replace(Az0,"")+Lz0[Z]}).join(kQ)}function Pz0($){return aM.map((Z)=>({skinTone:Z,emoji:Mz0($,Z)}))}function wl(){let $=c4(),Z=Z8($,oM,El);return uJ.useDeferredValue(Z)}function Sl($="✋"){let Z=c4(),J=t9(Z,"skinTone"),H=uJ.useMemo(()=>Pz0($),[$]),B=uJ.useCallback((Q)=>{Z.set({skinTone:Q})},[]);return[J,B,H]}function nM($,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($),H=Object.keys(Z);return J.length!==H.length?!1:J.every((B)=>(B in Z)&&$[B]===Z[B])}function _z0(...$){}function jz0($,Z){let J=null;if(typeof window.requestIdleCallback=="function")J=window.requestIdleCallback($,Z);else{let H=Date.now();J=window.setTimeout(()=>{$({didTimeout:!1,timeRemaining:()=>Math.max(0,(Z?.timeout??50)-(Date.now()-H))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(J):window.clearTimeout(J)}}var $9=typeof window<"u"?QW.useLayoutEffect:QW.useEffect;function Oz0($){let Z=XW.useRef($);return $9(()=>{Z.current=$}),XW.useCallback((...J)=>Z.current(...J),[])}function Tz0({emojiVersion:$,emojibaseUrl:Z}){let[J,H]=$1.useState(void 0),B=c4(),Q=t9(B,"locale"),X=t9(B,"columns"),z=t9(B,"skinTone"),G=t9(B,"search");return $1.useEffect(()=>{let K=new AbortController,U=K.signal;return Zz0({locale:Q,emojiVersion:$,emojibaseUrl:Z,signal:U}).then((Y)=>{H(Y)}).catch((Y)=>{U.aborted||console.error(Y)}),()=>{K.abort()}},[$,Z,Q]),$1.useEffect(()=>{if(J)return jz0(()=>{B.get().onDataChange(Bz0(J,X,z,G))},{timeout:100})},[J,X,z,G]),null}var Il=$1.forwardRef(({locale:$="en",columns:Z=9,skinTone:J="none",onEmojiSelect:H=_z0,emojiVersion:B,emojibaseUrl:Q,onFocusCapture:X,onBlurCapture:z,children:G,style:K,sticky:U=!0,...Y},F)=>{let W=Oz0(H),q=Xz0(()=>Gz0(W,Fl($),Z,U,Wl(J))),[N,A]=$1.useState(!1),V=$1.useRef(null),D=$1.useCallback((M)=>{M&&(V.current=M,q.set({rootRef:V}))},[]);$9(()=>{q.set({locale:Fl($)})},[$]),$9(()=>{q.set({columns:Z})},[Z]),$9(()=>{q.set({sticky:U})},[U]),$9(()=>{q.set({skinTone:Wl(J)})},[J]);let L=$1.useCallback((M)=>{X?.(M);let{searchRef:P,viewportRef:w}=q.get(),C=M.target===P?.current||M.target.hasAttribute("frimousse-search"),R=M.target===w?.current||M.target.hasAttribute("frimousse-viewport");M.isDefaultPrevented()||(A(C||R),M.isDefaultPrevented()||(A(C||R),R?q.get().onActiveEmojiChange("keyboard",0,0):C&&q.get().search===""&&q.set({interaction:"none"})))},[X]),j=$1.useCallback((M)=>{z?.(M),!M.isDefaultPrevented()&&!M.currentTarget.contains(M.relatedTarget)&&A(!1)},[z]);return $9(()=>{N||q.get().onActiveEmojiReset()},[N]),$1.useImperativeHandle(F,()=>V.current),$1.useEffect(()=>{if(!N)return;function M(P){if(P.defaultPrevented||!P.key.startsWith("Arrow")&&P.key!=="Enter")return;let{data:w,onEmojiSelect:C,onActiveEmojiChange:R,interaction:O,activeColumnIndex:S,activeRowIndex:y}=q.get();if(P.key==="Enter"){let k=oM(q.get());k&&(P.preventDefault(),C(k))}if(P.key.startsWith("Arrow")){let k=S,T=y;if(P.preventDefault(),O!=="none"){if(w?.rows&&w.rows.length>0)switch(P.key){case"ArrowLeft":{if(k===0){let b=T-1,I=w.rows[b];I&&(T=b,k=I.emojis.length-1)}else k-=1;break}case"ArrowRight":{if(k===w.rows[T].emojis.length-1){let b=T+1;w.rows[b]&&(T=b,k=0)}else k+=1;break}case"ArrowUp":{let b=w.rows[T-1];b&&(T-=1,b.emojis[k]||(k=b.emojis.length-1));break}case"ArrowDown":{let b=w.rows[T+1];b&&(T+=1,b.emojis[k]||(k=b.emojis.length-1));break}}R("keyboard",k,T)}else R("keyboard",0,0)}}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[N]),$9(()=>{let M=null,P=null,w=null,C=null,R=q.subscribe((T)=>{V.current&&(M!==T.viewportWidth&&(M=T.viewportWidth,V.current.style.setProperty("--frimousse-viewport-width",`${T.viewportWidth}px`)),P!==T.viewportHeight&&(P=T.viewportHeight,V.current.style.setProperty("--frimousse-viewport-height",`${T.viewportHeight}px`)),w!==T.rowHeight&&(w=T.rowHeight,V.current.style.setProperty("--frimousse-row-height",`${T.rowHeight}px`)),C!==T.categoryHeaderHeight&&(C=T.categoryHeaderHeight,V.current.style.setProperty("--frimousse-category-header-height",`${T.categoryHeaderHeight}px`)))}),{viewportWidth:O,viewportHeight:S,rowHeight:y,categoryHeaderHeight:k}=q.get();return O&&V.current.style.setProperty("--frimousse-viewport-width",`${O}px`),S&&V.current.style.setProperty("--frimousse-viewport-height",`${S}px`),y&&V.current.style.setProperty("--frimousse-row-height",`${y}px`),k&&V.current.style.setProperty("--frimousse-category-header-height",`${k}px`),R},[]),v1.jsx("div",{"data-focused":N?"":void 0,"frimousse-root":"",onBlurCapture:j,onFocusCapture:L,...Y,ref:D,style:{"--frimousse-emoji-font":Ll,...K},children:v1.jsxs(Kz0,{store:q,children:[v1.jsx(Tz0,{emojiVersion:B,emojibaseUrl:Q}),G]})})}),Rl=$1.forwardRef(({value:$,defaultValue:Z,onChange:J,...H},B)=>{let Q=c4(),X=$1.useRef(null),z=$1.useCallback((Y)=>{Y&&(X.current=Y,Q.set({searchRef:X}))},[]),G=typeof $=="string",K=$1.useRef(G);$1.useEffect(()=>{K.current=G},[G]),$9(()=>{Q.set({search:typeof $=="string"?$:typeof Z=="string"?Z:""})},[]),$9(()=>{typeof $=="string"&&Q.get().onSearchChange($)},[$]);let U=$1.useCallback((Y)=>{J?.(Y),Y.isDefaultPrevented()||Q.get().onSearchChange(Y.target.value)},[J]);return $1.useImperativeHandle(B,()=>X.current),v1.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...H,defaultValue:Z,onChange:U,ref:z,value:$})}),Cz0=$1.memo(()=>{let $=wl();return $?v1.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}),bl=$1.forwardRef(({children:$,onScroll:Z,onKeyDown:J,style:H,...B},Q)=>{let X=c4(),z=$1.useRef(null),G=$1.useCallback((F)=>{F&&(z.current=F,X.set({viewportRef:z}))},[]),K=Z8(X,Cl),U=Z8(X,Wz0),Y=$1.useCallback((F)=>{Z?.(F),X.get().onViewportScroll(F.currentTarget.scrollTop)},[Z]);return $9(()=>{if(!z.current)return;let F=new ResizeObserver(([W])=>{let q=W?.borderBoxSize[0]?.inlineSize??0,N=W?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:A,viewportHeight:V,viewportWidth:D}=X.get();(V!==N||D!==q)&&A(q,N)});return F.observe(z.current),X.get().onViewportSizeChange(z.current.offsetWidth,z.current.clientHeight),()=>{F.disconnect()}},[]),$1.useImperativeHandle(Q,()=>z.current),v1.jsxs("div",{"frimousse-viewport":"",...B,onScroll:Y,ref:G,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof K=="number"&&typeof U=="number"?`var(--frimousse-viewport-width, auto) calc(${K} * var(--frimousse-row-height) + ${U} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...H},children:[v1.jsx(Cz0,{}),$]})});function kl($,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 yl($,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 xl($,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 hl($,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 Vl($,Z,J,H){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) + ${H} * var(--frimousse-category-header-height))`}}}function Al($,Z,J){return{"aria-colcount":$,"aria-rowcount":Z,"frimousse-list":"",style:{"--frimousse-list-columns":$,...J},role:"grid"}}function Ez0($){$.preventDefault()}var wz0=$1.memo(({Emoji:$,emoji:Z,columnIndex:J,rowIndex:H})=>{let B=c4(),Q=Z8(B,(K)=>oM(K)?.emoji===Z.emoji),X=$1.useCallback(()=>{B.get().onEmojiSelect(Z)},[Z]),z=$1.useCallback(()=>{B.get().onActiveEmojiChange("pointer",J,H)},[J,H]),G=$1.useCallback(()=>{B.get().onActiveEmojiReset()},[]);return v1.jsx($,{...kl(Z,J,Q),onClick:X,onPointerDown:Ez0,onPointerEnter:z,onPointerLeave:G})}),Sz0=$1.memo(({Row:$,Emoji:Z,rowIndex:J})=>{let H=c4(),B=Z8(H,(Q)=>Q.data?.rows[J],Vz0);return B?v1.jsx($,{...yl(J),children:B.emojis.map((Q,X)=>v1.jsx(wz0,{Emoji:Z,columnIndex:X,emoji:Q,rowIndex:J},Q.label))}):null}),Iz0=$1.memo(({CategoryHeader:$,categoryIndex:Z})=>{let J=c4(),H=Z8(J,(Q)=>Q.data?.categories[Z],nM),B=t9(J,"sticky");return H?v1.jsx("div",{...xl(Z,H),children:v1.jsx($,{...hl({label:H.label},!1,B)})}):null}),Dl=$1.memo(({CategoryHeader:$,Row:Z,Emoji:J})=>{let H=$1.useRef(null),B=c4(),Q=t9(B,"columns"),X=$1.useMemo(()=>Array(Q).fill({emoji:"\uD83D\uDE42",label:""}),[Q]),z=$1.useMemo(()=>({label:"Category"}),[]),G=$1.useRef(null),K=$1.useRef(null);return $9(()=>{let U=H.current?.parentElement?.parentElement;if(!U||!G.current||!K.current)return;let Y=new ResizeObserver((q)=>{for(let N of q){let A=N.contentRect.height,{onRowHeightChange:V,onCategoryHeaderHeightChange:D,rowHeight:L,categoryHeaderHeight:j}=B.get();N.target===G.current&&L!==A&&V(A),N.target===K.current&&j!==A&&D(A)}});Y.observe(U),Y.observe(G.current),Y.observe(K.current);let{onRowHeightChange:F,onCategoryHeaderHeightChange:W}=B.get();return F(G.current.clientHeight),W(K.current.clientHeight),()=>{Y.disconnect()}},[]),v1.jsxs("div",{"aria-hidden":!0,ref:H,style:{height:0,visibility:"hidden"},children:[v1.jsx("div",{"frimousse-row-sizer":"",ref:G,children:v1.jsx(Z,{...yl(-1,!0),children:X.map((U,Y)=>v1.jsx(J,{...kl(U,Y,!1)},Y))})}),v1.jsx("div",{...xl(-1),children:v1.jsx("div",{"frimousse-category-header-sizer":"",ref:K,children:v1.jsx($,{...hl(z,!0)})})})]})});function Rz0({category:$,...Z}){return v1.jsx("div",{...Z,children:$.label})}function bz0({emoji:$,...Z}){return v1.jsx("button",{type:"button",...Z,children:$.emoji})}function kz0({...$}){return v1.jsx("div",{...$})}var vl=$1.forwardRef(({style:$,components:Z,...J},H)=>{let B=c4(),Q=$1.useRef(null),X=$1.useCallback((V)=>{V&&(Q.current=V,B.set({listRef:Q}))},[]),z=Z?.CategoryHeader??Rz0,G=Z?.Emoji??bz0,K=Z?.Row??kz0,U=t9(B,"columns"),Y=t9(B,"viewportStartRowIndex"),F=t9(B,"viewportEndRowIndex"),W=Z8(B,Cl),q=Z8(B,qz0,nM),N=$1.useMemo(()=>q?.filter((V)=>V<Y).length??0,[q,Y]),A=q?.length??0;return $1.useImperativeHandle(H,()=>Q.current),!W||!q||A===0?v1.jsx("div",{...Al(U,0,$),...J,children:v1.jsx("div",{...Vl(0,0,0,0),children:v1.jsx(Dl,{CategoryHeader:z,Emoji:G,Row:K})})}):v1.jsx("div",{...Al(U,W,$),...J,ref:X,children:v1.jsxs("div",{...Vl(W,A,Y,N),children:[v1.jsx(Dl,{CategoryHeader:z,Emoji:G,Row:K}),Array.from({length:F-Y+1},(V,D)=>{let L=Y+D,j=q.indexOf(L);return v1.jsxs($1.Fragment,{children:[j>=0&&v1.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),v1.jsx(Sz0,{Emoji:G,Row:K,rowIndex:L})]},L)}),Array.from({length:A},(V,D)=>v1.jsx(Iz0,{CategoryHeader:z,categoryIndex:D},D))]})})}),gl=$1.forwardRef(({emoji:$,onClick:Z,"aria-label":J="Change skin tone",...H},B)=>{let Q=c4(),X=Z8(Q,Nz0,nM),[z,G,K]=Sl($),U=$1.useMemo(()=>Math.max(0,K.findIndex((A)=>A.skinTone===z)),[z,K]),Y=K[U],F=K[(U+1)%K.length].skinTone,W=z==="none"?void 0:X?.[z],q=F==="none"?void 0:X?.[F],N=$1.useCallback((A)=>{Z?.(A),A.isDefaultPrevented()||G(F)},[Z,G,F]);return v1.jsx("button",{type:"button",...H,"aria-label":J+(q?` (${q})`:""),"aria-live":"polite","aria-valuetext":W,"frimousse-skin-tone-selector":"",onClick:N,ref:B,children:Y.emoji})});function fl({children:$,...Z}){let J=c4();return Z8(J,Fz0)?v1.jsx("span",{"frimousse-loading":"",...Z,children:$}):null}function yz0({children:$}){let Z=c4(),J=Z8(Z,Uz0);return $({search:J})}function ml({children:$,...Z}){let J=c4();return Z8(J,Yz0)?v1.jsx("span",{"frimousse-empty":"",...Z,children:typeof $=="function"?v1.jsx(yz0,{children:$}):$}):null}function ul({children:$}){let Z=wl();return $({emoji:Z})}function pl({children:$,emoji:Z}){let[J,H,B]=Sl(Z);return $({skinTone:J,setSkinTone:H,skinToneVariations:B})}Il.displayName="EmojiPicker.Root";Rl.displayName="EmojiPicker.Search";bl.displayName="EmojiPicker.Viewport";vl.displayName="EmojiPicker.List";fl.displayName="EmojiPicker.Loading";ml.displayName="EmojiPicker.Empty";gl.displayName="EmojiPicker.SkinToneSelector";ul.displayName="EmojiPicker.ActiveEmoji";pl.displayName="EmojiPicker.SkinTone";var xQ={};I5(xQ,{Root:()=>al,Indicator:()=>ol});var Z9=_(p(),1);function cl($){if(!$)return null;for(let Z of $.elements){let J=Z.tagName;if(J==="BUTTON"||J==="INPUT"){let H=Z;if(H.type==="submit")return H}}return null}var dl="data-checked",ll="data-unchecked";function zW($){return{checked(Z){if($.indeterminate)return{};if(Z)return{[dl]:""};return{[ll]:""}},..._2}}var GW=_(p(),1),hz0=GW.createContext(void 0);function il(){return GW.useContext(hz0)}var KW=_(p(),1),sM=KW.createContext(void 0);function rl(){let $=KW.useContext(sM);if($===void 0)throw Error(h0(14));return $}var yQ=_(d(),1),vz0="data-parent",al=Z9.forwardRef(function(Z,J){let{checked:H,className:B,defaultChecked:Q=!1,"aria-labelledby":X,disabled:z=!1,form:G,id:K,indeterminate:U=!1,inputRef:Y,name:F,onCheckedChange:W,parent:q=!1,readOnly:N=!1,render:A,required:V=!1,uncheckedValue:D,value:L,nativeButton:j=!1,style:M,...P}=Z,{clearErrors:w}=t2(),{disabled:C,name:R,setDirty:O,setFilled:S,setFocused:y,setTouched:k,state:T,validationMode:b,validityData:I,validation:v}=c5(),h=jZ(),{labelId:f,registerControlId:E,getDescriptionProps:i}=d5(),r=il(),x=r?.allValues===void 0?void 0:r.parent,l=x!==void 0,o=C||h.disabled||r?.disabled||z,u=R??F,c=L??u,n=s0(),Z0=r?.registerControlId!==E,J0=B6({id:K||void 0,enabled:Z0}),X0=j?J0:n,Q0={};if(l){if(q)Q0=x.getParentProps();else if(c!==void 0)Q0=x.getChildProps(c)}let{checked:F0=H,indeterminate:A0=U,onCheckedChange:N0,...Y0}=Q0,s=r?.value,a=Z9.useRef(null),{getButtonProps:e,buttonRef:$0}=O5({disabled:o,native:j}),B0=r?.validation??v,[_0,M0]=e2({controlled:c!==void 0&&s!==void 0&&!q?s.includes(c):F0,default:Q,name:"Checkbox",state:"checked"}),V0=l?Boolean(F0):_0,L0=l?A0||U:U;H6(a,n,_0,void 0,!r&&!o,F);let g=x?.registerChildId,m=Z9.useRef(null),t=B0.registerInput,W0=r?c:void 0,R0=Z9.useCallback((v0)=>t(v0,{controlRef:a,value:W0}),[t,W0]),c0=b2(Y,m,q?void 0:R0),f0=vF(X,f,m,!j,J0);H0(()=>{if(m.current)m.current.indeterminate=L0;if(!r)S(_0)},[_0,L0,r,S]),S9(_0,()=>{if(r)return;w(u),O(_0!==I.initialValue),B0.change(_0)});let T0=M2({checked:_0,disabled:o,form:G,name:q?void 0:u,id:j?void 0:J0,required:V,ref:c0,style:u?fX:y8,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(v0){if(v0.nativeEvent.defaultPrevented)return;if(N){v0.preventDefault();return}let w1=v0.currentTarget.checked,B1=I0(K0.none,v0.nativeEvent);if(W?.(w1,B1),B1.isCanceled)return;if(N0?.(w1,B1),B1.isCanceled)return;if(M0(w1),c!==void 0&&r!==void 0&&!q&&!l){let s1=w1?[...r.value,c]:r.value.filter((C0)=>C0!==c);r.setValue(s1,B1)}},onClick(v0){v0.stopPropagation()},onFocus(){a.current?.focus()}},L!==void 0?{value:(r?_0&&L:L)||""}:L1,i,(v0)=>B0.getValidationProps(o,v0));Z9.useEffect(()=>{if(!x||c===void 0)return;let v0=x.disabledStatesRef.current;return v0.set(c,o),()=>{v0.delete(c)}},[x,o,c]);let x0=Z9.useMemo(()=>({...T,checked:V0,disabled:o,readOnly:N,required:V,indeterminate:L0}),[T,V0,o,N,V,L0]),Z1=zW(x0),W1=z0("span",Z,{state:x0,ref:[$0,a,J],props:[{id:X0,role:"checkbox","aria-checked":L0?"mixed":V0,"aria-readonly":N||void 0,"aria-required":V||void 0,"aria-labelledby":f0,[vz0]:q?"":void 0,onFocus(){if(!o)y(!0)},onBlur(){let v0=m.current;if(!v0)return;if(k(!0),y(!1),b==="onBlur")B0.commit(r?s:v0.checked)},onKeyDown(v0){if(v0.key!=="Enter")return;if(v0.preventBaseUIHandler(),v0.defaultPrevented)return;let w1=m.current?.form??null,B1=v0.currentTarget,s1=v0.nativeEvent,C0=v0.preventDefault,p0=s1.preventDefault,i0=!1;v0.preventDefault=()=>{i0=!0,C0.call(v0)},s1.preventDefault=()=>{i0=!0,p0.call(s1)},p0.call(s1),I1(B1).queueMicrotask(()=>{if(v0.preventDefault=C0,s1.preventDefault=p0,!i0)cl(w1)?.click()})},onClick(v0){if(N||o)return;v0.preventDefault();let w1=m.current;if(!w1)return;eZ(w1,v0)}},P,Y0,e,i,(v0)=>B0.getValidationProps(o,v0)],stateAttributesMapping:Z1}),d0=W1.props.id;return H0(()=>{if(!g||q||c===void 0||d0===void 0)return;return g(c,d0)},[g,q,c,d0]),yQ.jsxs(sM.Provider,{value:x0,children:[W1,!_0&&!r&&u&&!q&&D!==void 0&&yQ.jsx("input",{type:"hidden",form:G,name:u,value:D,disabled:o}),yQ.jsx("input",{...T0,suppressHydrationWarning:!0})]})});var UW=_(p(),1);var ol=UW.forwardRef(function(Z,J){let{render:H,className:B,style:Q,keepMounted:X=!1,...z}=Z,G=rl(),K=G.checked||G.indeterminate,{mounted:U,transitionStatus:Y,setMounted:F}=a2(K),W=UW.useRef(null),q={...G,transitionStatus:Y};T5({batch:!0,enabled:!K,open:K,ref:W,onComplete(){if(!K)F(!1)}});let A={...zW(G),...V2},V=X||U,D=z0("span",Z,{ref:[J,W],state:q,stateAttributesMapping:A,props:z});if(!V)return null;return D});var YW=_(d(),1);function nl({className:$,...Z}){return YW.jsx(xQ.Root,{"data-slot":"checkbox",className:G1('peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground [:where([class~="group/field"]):has(:disabled)_&]:opacity-50 [:where([class~="group/field-label"]):has(:focus-visible)_&]:not-data-checked:border-border [:where([class~="group/field-label"]):has(:focus-visible)_&]:data-checked:border-primary [:where([class~="group/field-label"]:has(:focus-visible))_&]:ring-0',$),...Z,children:YW.jsx(xQ.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:YW.jsx(L8,{stroke:2})})})}var I$={};I5(I$,{Tab:()=>$i,Root:()=>el,Panel:()=>Wi,List:()=>Di,Indicator:()=>Yi});var Z2=_(p(),1);var FW=_(p(),1),tM=FW.createContext(void 0);function o6(){let $=FW.useContext(tM);if($===void 0)throw Error(h0(64));return $}var sl="data-activation-direction";var e9={tabActivationDirection:($)=>({[sl]:$})};var eM=_(d(),1),el=Z2.forwardRef(function(Z,J){let{className:H,defaultValue:B=0,onValueChange:Q,orientation:X="horizontal",render:z,value:G,style:K,...U}=Z,Y=Z.defaultValue!==void 0,F=Z2.useRef([]),[W,q]=Z2.useState(()=>new Map),[N,A]=e2({controlled:G,default:B,name:"Tabs",state:"value"}),V=G!==void 0,[D,L]=Z2.useState(()=>new Map),j=Z2.useRef(void 0),M=Z2.useCallback((n)=>$P(D,n),[D]),[P,w]=Z2.useState(()=>({previousValue:N,tabActivationDirection:"none"})),{previousValue:C,tabActivationDirection:R}=P,O=R,S=!1;if(C!==N)O=tl(C,N,X,D),S=C!=null&&N!=null&&M(N)==null;let y=S?C:N,k=C!==y||R!==O;H0(()=>{if(!k)return;w({previousValue:y,tabActivationDirection:O})},[y,k,O]);let T=U0((n,Z0)=>{let J0=tl(N,n,X,D);if(Z0.activationDirection=J0,Q?.(n,Z0),Z0.isCanceled)return;A(n)}),b=U0((n,Z0)=>{Q?.(n,I0(Z0,void 0,void 0,{activationDirection:"none"}))}),I=U0((n,Z0)=>{return q((J0)=>{let X0=new Map(J0);return X0.set(n,Z0),X0}),()=>{q((J0)=>{if(J0.get(n)!==Z0)return J0;let X0=new Map(J0);return X0.delete(n),X0})}}),v=Z2.useCallback((n)=>{return W.get(n)},[W]),h=Z2.useCallback((n)=>{for(let Z0 of D.values())if(n===Z0.value)return Z0.id;return},[D]),f=Z2.useMemo(()=>({getTabElementBySelectedValue:M,getTabIdByPanelValue:h,getTabPanelIdByValue:v,onValueChange:T,orientation:X,registerMountedTabPanel:I,setTabMap:L,tabActivationDirection:O,value:N}),[M,h,v,T,X,I,L,O,N]),E=Z2.useMemo(()=>{for(let n of D.values())if(n.value===N)return n;return},[D,N]),i=Z2.useMemo(()=>{for(let n of D.values())if(!n.disabled)return n.value;return},[D]),r=Z2.useRef(!Y),x=Z2.useRef(B),l=Z2.useRef(Y),o=Z2.useRef(!1);H0(()=>{if(V)return;function n(Q0,F0){A(Q0),w({previousValue:Q0,tabActivationDirection:"none"}),b(Q0,F0),r.current=!1}if(D.size===0){if(o.current&&N!==null&&!j.current?.isConnected)n(null,K0.missing);return}o.current=!0,j.current=D.keys().next().value;let Z0=E?.disabled,J0=E==null&&N!==null;if(!Z0&&N===x.current)l.current=!1;if(l.current&&Z0&&N===x.current)return;let X0=r.current;if(Z0||J0){let Q0=i??null;if(N===Q0){r.current=!1;return}let F0=K0.missing;if(X0)F0=K0.initial;else if(Z0)F0=K0.disabled;n(Q0,F0);return}if(X0&&E!=null)b(N,K0.initial),r.current=!1},[i,V,b,E,A,D,N]);let c=z0("div",Z,{state:{orientation:X,tabActivationDirection:O},ref:J,props:U,stateAttributesMapping:e9});return eM.jsx(tM.Provider,{value:f,children:eM.jsx(S6,{elementsRef:F,children:c})})});function $P($,Z){for(let[J,H]of $.entries())if(Z===H.value)return J;return null}function tl($,Z,J,H){if($==null||Z==null)return"none";let[B,Q,X]=J==="horizontal"?["left","left","right"]:["top","up","down"],z=$P(H,$),G=$P(H,Z);if(z==null||G==null){if(z!==G&&(typeof $==="number"||typeof $==="string")&&typeof $===typeof Z)return Z>$?X:Q;return"none"}let K=z.getBoundingClientRect()[B],U=G.getBoundingClientRect()[B];if(U<K)return Q;if(U>K)return X;return"none"}var I3=_(p(),1);var hQ="data-composite-item-active";var WW=_(p(),1),ZP=WW.createContext(void 0);function qW(){let $=WW.useContext(ZP);if($===void 0)throw Error(h0(65));return $}var $i=I3.forwardRef(function(Z,J){let{className:H,disabled:B=!1,render:Q,value:X,id:z,nativeButton:G=!0,style:K,...U}=Z,{value:Y,getTabPanelIdByValue:F,onValueChange:W,orientation:q,tabActivationDirection:N}=o6(),{activateOnFocus:A,registerTabResizeObserverElement:V,tabsListElement:D}=qW(),{highlightedIndex:L,onHighlightedIndexChange:j}=JJ(),M=s0(z),P=I3.useMemo(()=>({disabled:B,id:M,value:X}),[B,M,X]),{compositeProps:w,compositeRef:C,index:R}=rU({metadata:P}),O=X===Y,S=I3.useRef(!1),y=I3.useRef(null),k=U0((o)=>{y.current?.(),y.current=o?V(o):null});H0(()=>{if(S.current){S.current=!1;return}if(!(O&&R>-1&&L!==R))return;let o=D;if(o!=null){let u=p1(m0(o));if(u&&b0(o,u))return}if(!B)j(R)},[O,R,L,j,B,D]);let{getButtonProps:T,buttonRef:b}=O5({disabled:B,native:G,focusableWhenDisabled:!0}),I=F(X),v=I3.useRef(!1),h=I3.useRef(!1);function f(o){W(X,I0(K0.none,o.nativeEvent,void 0,{activationDirection:"none"}))}function E(o){if(O||B)return;f(o)}function i(o){if(O||B)return;if(A&&(!v.current||h.current))f(o)}function r(o){if(O||B)return;v.current=!0,h.current=o.button===0;let u=m0(o.currentTarget);function c(){v.current=!1,h.current=!1,u.removeEventListener("pointerup",c),u.removeEventListener("pointercancel",c)}u.addEventListener("pointerup",c),u.addEventListener("pointercancel",c)}return z0("button",Z,{state:{disabled:B,active:O,orientation:q,tabActivationDirection:N},ref:[J,b,C,k],props:[w,{role:"tab","aria-controls":I,"aria-selected":O,id:M,onClick:E,onFocus:i,onPointerDown:r,[hQ]:O?"":void 0,onKeyDownCapture(){S.current=!0}},U,T],stateAttributesMapping:e9})});var pJ=_(p(),1);var Zi="--active-tab-left",Ji="--active-tab-right",Hi="--active-tab-top",Bi="--active-tab-bottom",Qi="--active-tab-width",Xi="--active-tab-height";var NW=_(d(),1),zi,mz0={...e9,activeTabPosition:()=>null,activeTabSize:()=>null},Gi=2,Yi=pJ.forwardRef(function(Z,J){let{className:H,render:B,renderBeforeHydration:Q=!1,style:X,...z}=Z,{getTabElementBySelectedValue:G,orientation:K,tabActivationDirection:U,value:Y}=o6(),{tabsListElement:F,registerIndicatorUpdateListener:W}=qW(),q=Nj();pJ.useEffect(()=>{return W(q)},[W,q]);let N=0,A=0,V=0,D=0,L=0,j=0,M=!1;if(Y!=null&&F!=null){let y=G(Y);if(y!=null){M=!0;let{width:k,height:T}=GZ(y),{width:b,height:I}=GZ(F),v=y.getBoundingClientRect(),h=F.getBoundingClientRect(),f=b>0?h.width/b:1,E=I>0?h.height/I:1,i=uz0(y,F);N=i.left,V=i.top;let r=(v.left-h.left)/f+F.scrollLeft-F.clientLeft,x=(v.top-h.top)/E+F.scrollTop-F.clientTop,l=pz0(y);if(Math.abs(r-l.x-N)<=Gi&&Math.abs(x-l.y-V)<=Gi)N=r,V=x;L=k,j=T,A=F.scrollWidth-N-L,D=F.scrollHeight-V-j}}let P=M?{left:N,right:A,top:V,bottom:D}:null,w=M?{width:L,height:j}:null,C=M?{[Zi]:`${N}px`,[Ji]:`${A}px`,[Hi]:`${V}px`,[Bi]:`${D}px`,[Qi]:`${L}px`,[Xi]:`${j}px`}:void 0,R=M&&L>0&&j>0,S=z0("span",Z,{state:{orientation:K,activeTabPosition:P,activeTabSize:w,tabActivationDirection:U},ref:J,props:[{role:"presentation",style:C,hidden:!R},z,{suppressHydrationWarning:!0}],stateAttributesMapping:mz0});if(Y==null)return null;return NW.jsxs(pJ.Fragment,{children:[S,Q&&(zi||(zi=NW.jsx(WY,{script:YY})))]})});function uz0($,Z){let J=Ki($),H=Ki(Z),B=J.left-H.left-Z.clientLeft,Q=J.top-H.top-Z.clientTop,X=V8($);while(P1(X)&&X!==Z&&!N8(X))B-=X.scrollLeft,Q-=X.scrollTop,X=V8(X);return{left:B,top:Q}}function Ki($){let Z=0,J=0,H=$;while(H!=null){Z+=H.offsetLeft,J+=H.offsetTop;let B=H.offsetParent;if(B!=null)Z+=B.clientLeft,J+=B.clientTop;H=B}return{left:Z,top:J}}function pz0($){let Z=I1($).getComputedStyle($),{x:J,y:H}=dX($,Z),B=J,Q=H,{translate:X}=Z;if(X&&X!=="none"){let z=X.split(" ");B+=Ui(z[0],$.offsetWidth),Q+=Ui(z[1],$.offsetHeight)}return{x:B,y:Q}}function Ui($,Z){if(!$)return 0;let J=parseFloat($);if(!Number.isFinite(J))return 0;return $.endsWith("%")?J/100*Z:J}var VW=_(p(),1);var Fi="data-index";var OD1=l4.startingStyle,TD1=l4.endingStyle;var dz0={...e9,...V2},Wi=VW.forwardRef(function(Z,J){let{className:H,value:B,render:Q,keepMounted:X=!1,style:z,...G}=Z,{value:K,getTabIdByPanelValue:U,orientation:Y,tabActivationDirection:F,registerMountedTabPanel:W}=o6(),q=s0(),{ref:N,index:A}=H4(),V=B===K,{mounted:D,transitionStatus:L,setMounted:j}=a2(V),M=!D,P=U(B),w={hidden:M,orientation:Y,tabActivationDirection:F,transitionStatus:L},C=VW.useRef(null),R=z0("div",Z,{state:w,ref:[J,N,C],props:[{"aria-labelledby":P,hidden:M,id:q,role:"tabpanel",tabIndex:V?0:-1,inert:q8(!V),[Fi]:A},G],stateAttributesMapping:dz0});if(T5({open:V,ref:C,onComplete(){if(!V)j(!1)}}),H0(()=>{if(q==null||M&&!X)return;return W(B,q)},[M,X,B,q,W]),!(X||D))return null;return R});var J9=_(p(),1);var Vi=_(p(),1);var S$=_(p(),1);function qi($){let{loopFocus:Z=!0,orientation:J="both",grid:H,onLoop:B,direction:Q,highlightedIndex:X,onHighlightedIndexChange:z,rootRef:G,enableHomeAndEndKeys:K=!1,stopEventPropagation:U,disabledIndices:Y,modifierKeys:F=c2}=$,[W,q]=S$.useState(0),N=H!=null,A=S$.useRef(null),V=b2(A,G),D=S$.useRef([]),L=S$.useRef(!1),j=S$.useRef(null),M=X??W,P=U0((S,y=!1)=>{if(j.current=D.current[S]??null,(z??q)(S),y){let k=D.current[S];ZV(A.current,k,Q,J)}}),w=U0((S)=>{if(S.size===0)return;if(L.current){let b=D.current,I=b.indexOf(j.current);if(I===-1){let v=b[M];if(!v||z3(b,M,Y))P(lz0(b,Y));else j.current=v}else if(I!==M)P(I);return}L.current=!0;let y=Array.from(S.keys()),k=y.find((b)=>b?.hasAttribute(hQ))??null,T=k?S.get(k)?.index??-1:-1;if(T!==-1)P(T);else if(z3(y,M,Y)){let b=F8(y,{disabledIndices:Y});if(!d3(y,b))P(b)}ZV(A.current,k,Q,J)});H0(()=>{if(Y==null||X!=null||!L.current)return;let S=D.current;if(z3(S,M,Y)){let y=F8(S,{disabledIndices:Y});if(!d3(S,y))P(y)}},[Y,X,M,D,P]);let C=U0((S,y,k)=>{if(!B)return k;return B(S,y,k,D)}),R=U0((S)=>{let y=S.key===AZ||S.key===DZ;if(!c8.has(S.key)||!K&&y)return;if(iz0(S,F))return;if(!A.current)return;let T=Q==="rtl",b=T?NZ:VZ,I=T?VZ:NZ,v=J==="vertical"?qZ:b,h=J==="vertical"?WZ:I,f=M1(S.nativeEvent);if(f!=null&&$V(f)&&!Gh(f)){let{selectionStart:o,selectionEnd:u,value:c}=f;if(o==null||S.shiftKey||o!==u)return;if(S.key!==h&&o<c.length)return;if(S.key!==v&&o>0)return}let E=M,i=M7(D,Y),r=o$(D,Y);if(H!=null)E=H({disabledIndices:Y,elementsRef:D,event:S,highlightedIndex:M,loopFocus:Z,maxIndex:r,minIndex:i,onLoop:C,orientation:J,rtl:T});let x=J!=="vertical"&&S.key===b||J!=="horizontal"&&S.key===qZ,l=J!=="vertical"&&S.key===I||J!=="horizontal"&&S.key===WZ;if(K){if(S.key===AZ)E=i;else if(S.key===DZ)E=r}if(E===M&&(x||l))if(Z&&E===r&&x){if(E=i,B)E=B(S,M,E,D)}else if(Z&&E===i&&l){if(E=r,B)E=B(S,M,E,D)}else E=F8(D.current,{startingIndex:E,decrement:l,disabledIndices:Y});if(E!==M&&!d3(D.current,E)){if(U)S.stopPropagation();if(N||y||x||l)S.preventDefault();P(E,!0),queueMicrotask(()=>{D.current[E]?.focus()})}});return{props:{ref:V,onFocus(S){let y=A.current,k=M1(S.nativeEvent);if(!y||k==null||!$V(k))return;k.setSelectionRange(0,k.value.length)},onKeyDown:R},highlightedIndex:M,onHighlightedIndexChange:P,elementsRef:D,onMapChange:w,relayKeyboardEvent:R}}function lz0($,Z){let J=-1;for(let H=0;H<$.length;H+=1){let B=$[H];if(!B||z3($,H,Z))continue;if(B.hasAttribute(hQ))return H;if(J===-1)J=H}return Math.max(J,0)}function iz0($,Z){for(let J of wE){if(Z.includes(J))continue;if($.getModifierState(J))return!0}return!1}var JP=_(d(),1);function Ai($){let{render:Z,className:J,style:H,refs:B=c2,props:Q=c2,state:X=L1,stateAttributesMapping:z,highlightedIndex:G,onHighlightedIndexChange:K,orientation:U,grid:Y,loopFocus:F,onLoop:W,enableHomeAndEndKeys:q,onMapChange:N,stopEventPropagation:A=!0,rootRef:V,disabledIndices:D,modifierKeys:L,highlightItemOnHover:j=!1,tag:M="div",...P}=$,w=y4(),{props:C,highlightedIndex:R,onHighlightedIndexChange:O,elementsRef:S,onMapChange:y,relayKeyboardEvent:k}=qi({grid:Y,loopFocus:F,onLoop:W,orientation:U,highlightedIndex:G,onHighlightedIndexChange:K,rootRef:V,stopEventPropagation:A,enableHomeAndEndKeys:q,direction:w,disabledIndices:D,modifierKeys:L}),T=z0(M,$,{state:X,ref:B,props:[C,...Q,P],stateAttributesMapping:z}),b=Vi.useMemo(()=>({highlightedIndex:R,onHighlightedIndexChange:O,highlightItemOnHover:j,relayKeyboardEvent:k}),[R,O,j,k]);return JP.jsx(Ni.Provider,{value:b,children:JP.jsx(S6,{elementsRef:S,onMapChange:(I)=>{N?.(I),y(I)},children:T})})}var HP=_(d(),1),Di=J9.forwardRef(function(Z,J){let{activateOnFocus:H=!1,className:B,loopFocus:Q=!0,render:X,style:z,...G}=Z,{orientation:K,setTabMap:U,tabActivationDirection:Y}=o6(),[F,W]=J9.useState(0),[q,N]=J9.useState(null),A=J9.useRef(new Set),V=J9.useRef(new Set),D=J9.useRef(null);H0(()=>{if(typeof ResizeObserver>"u")return;let C=new ResizeObserver(()=>{A.current.forEach((R)=>{R()})});if(D.current=C,q)C.observe(q);return V.current.forEach((R)=>{C.observe(R)}),()=>{C.disconnect(),D.current=null}},[q]);let L=U0((C)=>{return A.current.add(C),()=>{A.current.delete(C)}}),j=U0((C)=>{return V.current.add(C),D.current?.observe(C),()=>{V.current.delete(C),D.current?.unobserve(C)}}),M={orientation:K,tabActivationDirection:Y},P={"aria-orientation":K==="vertical"?"vertical":void 0,role:"tablist"},w=J9.useMemo(()=>({activateOnFocus:H,registerIndicatorUpdateListener:L,registerTabResizeObserverElement:j,tabsListElement:q}),[H,L,j,q]);return HP.jsx(ZP.Provider,{value:w,children:HP.jsx(Ai,{render:X,className:B,style:z,state:M,refs:[J,N],props:[P,G],stateAttributesMapping:e9,highlightedIndex:F,enableHomeAndEndKeys:!0,loopFocus:Q,orientation:K,onHighlightedIndexChange:W,onMapChange:U,disabledIndices:c2})})});var vQ=_(d(),1);function Li({className:$,orientation:Z="horizontal",...J}){return vQ.jsx(I$.Root,{"data-slot":"tabs","data-orientation":Z,orientation:Z,className:G1("group/tabs flex gap-2 data-horizontal:flex-col",$),...J})}var rz0=AW("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-accent",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Mi({className:$,variant:Z="default",...J}){return vQ.jsx(I$.List,{"data-slot":"tabs-list","data-variant":Z,className:G1(rz0({variant:Z}),$),...J})}function DW({className:$,...Z}){return vQ.jsx(I$.Tab,{"data-slot":"tabs-trigger",className:G1("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-muted-foreground transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground data-active:ring-1 data-active:ring-border","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",$),...Z})}function LW({className:$,...Z}){return vQ.jsx(I$.Panel,{"data-slot":"tabs-content",className:G1("flex-1 text-sm outline-none",$),...Z})}var Pi=["\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","☕"],BP="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var V1=_(d(),1),az0=32,_i=4,oz0=12,wi="flex pt-4 pb-2 items-center bg-background px-3 text-xs font-medium text-muted-foreground",Si=O4.createContext(null);function ji($,Z){if(Z)return{...$,background:"theme"};if($.type==="emoji")return{type:"emoji",value:$.value};return{type:"glyph",value:$.value}}function nz0({category:$,className:Z,...J}){return V1.jsx("div",{...J,className:G0(wi,Z),children:$.label})}function Oi({className:$,...Z}){return V1.jsx("div",{className:G0("flex flex-wrap content-start gap-1",$),...Z})}function QP({className:$,selected:Z=!1,...J}){return V1.jsx(j0,{type:"button",variant:"ghost",size:"icon","aria-pressed":Z,className:G0("shrink-0 data-active:bg-accent",Z&&"bg-accent",$),...J})}function sz0({children:$,className:Z,...J}){return V1.jsx("div",{...J,className:G0("flex h-8 gap-1 px-1.5",Z),children:$})}function tz0({emoji:$,...Z}){let J=O4.useContext(Si);return V1.jsx(QP,{selected:J===$.emoji,className:BP,...Z,children:V1.jsx("span",{className:"text-xl leading-none",children:$.emoji})})}function Ii(){let{layout:$,workspaceId:Z}=l1(),{icon:J}=$,H=Sd(Z),[B,Q]=O4.useState(J?.type??"glyph"),[X,z]=O4.useState(!J||J.type!=="upload"&&J.background==="theme"),G=J?.type==="upload"?void 0:J,[K,U]=O4.useState(""),[Y,F]=O4.useState(13),[W,q]=O4.useState(null),[N,A]=O4.useState(!1),V=O4.useRef(null),D=(M)=>{let P=ji(M,X);H.mutate({kind:"set",icon:P})},L=(M)=>{H.mutate({kind:"upload",file:M})},j=(M)=>{if(z(M),G){let P=ji(G,M);H.mutate({kind:"set",icon:P})}};return O4.useEffect(()=>{if(!W)return;let M=(w)=>{let C=Math.max(1,Math.floor((w-oz0+_i)/(az0+_i)));F((R)=>R===C?R:C)};M(W.clientWidth);let P=new ResizeObserver(([w])=>{M(w?.contentRect.width??W.clientWidth)});return P.observe(W),()=>P.disconnect()},[W]),V1.jsxs(Li,{value:B,onValueChange:(M)=>Q(M),className:"min-w-0 gap-4",children:[V1.jsxs("div",{className:"flex items-center justify-between gap-4",children:[V1.jsxs(Mi,{"aria-label":"Icon source",children:[V1.jsx(DW,{value:"glyph",children:"Icon"}),V1.jsx(DW,{value:"emoji",children:"Emoji"}),V1.jsx(DW,{value:"upload",children:"Upload"})]}),J&&V1.jsxs(j0,{type:"button",variant:"ghost",onClick:()=>{z(!0),H.mutate({kind:"reset"})},className:"text-muted-foreground",children:[V1.jsx(Ti,{"data-icon":"inline-start",stroke:1.5}),"Reset"]})]}),V1.jsx(LW,{value:"emoji",className:"flex-none",children:V1.jsx(Si,{value:G?.type==="emoji"?G.value:null,children:V1.jsxs(S3.Root,{onEmojiSelect:(M)=>D({type:"emoji",value:M.emoji}),emojibaseUrl:"/vendor/emojibase",columns:Y,className:"isolate flex h-72 flex-col overflow-hidden rounded-xl border border-border bg-background",children:[V1.jsxs("div",{className:"flex items-center gap-1.5 p-1.5 pb-0",children:[V1.jsx(S3.Search,{placeholder:"Search emoji",onChange:(M)=>U(M.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"}),V1.jsx(S3.SkinToneSelector,{className:"size-8 shrink-0 rounded-lg text-lg hover:bg-accent"})]}),V1.jsxs(S3.Viewport,{ref:q,className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[V1.jsxs(S3.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[V1.jsx(b5,{size:16,stroke:1.75,className:"animate-spin"}),"Loading emoji…"]}),K.trim()===""&&V1.jsxs("div",{className:"border-b border-dashed border-border",children:[V1.jsx("p",{className:G0("sticky top-0",wi),children:"Favorites"}),V1.jsx(Oi,{className:"px-1.5 pb-1.5",children:Pi.map((M)=>V1.jsx(QP,{onClick:()=>D({type:"emoji",value:M}),selected:G?.type==="emoji"&&G.value===M,className:BP,children:V1.jsx("span",{className:"text-xl leading-none",children:M})},M))})]}),V1.jsxs(S3.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[V1.jsx(Ci,{size:20,stroke:1.5}),"No emoji found"]}),V1.jsx(S3.List,{className:"select-none",components:{CategoryHeader:nz0,Row:sz0,Emoji:tz0}})]})]})})}),V1.jsx(LW,{value:"glyph",className:"scrollbar-thin h-72 overflow-y-auto rounded-xl border border-border bg-background p-1.5",children:V1.jsx(Oi,{children:xS.map(({id:M,Icon:P})=>V1.jsx(QP,{"aria-label":M,onClick:()=>D({type:"glyph",value:M}),selected:G?.type==="glyph"&&G.value===M,className:"text-muted-foreground aria-pressed:text-accent-foreground",children:V1.jsx(P,{stroke:1.75})},M))})}),V1.jsx(LW,{value:"upload",className:"flex-none",children:V1.jsxs("button",{type:"button",onClick:()=>V.current?.click(),onDragOver:(M)=>{M.preventDefault(),A(!0)},onDragLeave:()=>A(!1),onDrop:(M)=>{M.preventDefault(),A(!1);let P=M.dataTransfer.files?.[0];if(P)L(P)},className:G0("flex h-72 w-full flex-col items-center justify-center gap-2 rounded-xl border border-dashed transition-colors",N?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-muted-foreground/30 hover:text-foreground"),children:[V1.jsx(Ei,{size:24,stroke:1.5}),V1.jsx("span",{className:"text-xs font-medium",children:"Click or drop an image"}),V1.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"PNG, JPG, GIF, or WebP"})]})}),B!=="upload"&&V1.jsxs("label",{htmlFor:"workspace-icon-theme-background",className:"flex w-fit cursor-pointer items-center gap-2 text-sm font-medium",children:[V1.jsx(nl,{id:"workspace-icon-theme-background",checked:X,onCheckedChange:j}),"Use theme background"]}),H.error&&V1.jsx("p",{className:"text-xs text-destructive","aria-live":"polite",children:H.error.message}),V1.jsx("input",{ref:V,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:(M)=>{let P=M.target.files?.[0];if(P)L(P);M.target.value=""}})]})}var $3=_(d(),1);function Ri(){let{layout:$,name:Z,provider:J,workspaceId:H}=l1(),B=Z??"Workspace",Q=wd(H),[X,z]=MW.useState(B);MW.useEffect(()=>z(B),[B]);function G(K){let U=K.trim();if(z(U),U!==B)Q.mutate(U===""?null:U)}return $3.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[$3.jsxs(QJ,{children:[$3.jsx(XJ,{render:$3.jsx("button",{type:"button","aria-label":"Change workspace icon",className:"group inline-flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-lg p-0 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:$3.jsx(A6,{icon:$.icon,workspaceType:J,workspaceTheme:$.theme,className:"size-full rounded-lg"})})}),$3.jsx(zJ,{align:"start",sideOffset:8,className:"w-[min(32rem,calc(100vw-2rem))] gap-4 rounded-2xl p-6",children:$3.jsx(Ii,{})})]}),$3.jsx(nF,{"aria-label":"Workspace name",value:X,onValueChange:z,onValueCommit:G,className:"min-w-0 truncate text-3xl font-semibold md:text-3xl"})]})}var sQ=_(p(),1);function s6($){let{margin:Z,containerPadding:J,containerWidth:H,cols:B}=$;return(H-Z[0]*(B-1)-J[0]*2)/B}function H9($,Z,J){if(!Number.isFinite($))return $;return Math.round(Z*$+Math.max(0,$-1)*J)}function fQ($,Z,J,H,B,Q,X){let{margin:z,containerPadding:G,rowHeight:K}=$,U=s6($),Y,F,W,q;if(X)Y=Math.round(X.width),F=Math.round(X.height);else Y=H9(H,U,z[0]),F=H9(B,K,z[1]);if(Q)W=Math.round(Q.top),q=Math.round(Q.left);else if(X)W=Math.round(X.top),q=Math.round(X.left);else W=Math.round((K+z[1])*J+G[1]),q=Math.round((U+z[0])*Z+G[0]);if(!Q&&!X){if(Number.isFinite(H)){let A=Math.round((U+z[0])*(Z+H)+G[0])-q-Y;if(A!==z[0])Y+=A-z[0]}if(Number.isFinite(B)){let A=Math.round((K+z[1])*(J+B)+G[1])-W-F;if(A!==z[1])F+=A-z[1]}}return{top:W,left:q,width:Y,height:F}}function ki($,Z,J,H,B){let{margin:Q,containerPadding:X,cols:z,rowHeight:G,maxRows:K}=$,U=s6($),Y=Math.round((J-X[0])/(U+Q[0])),F=Math.round((Z-X[1])/(G+Q[1]));return Y=gQ(Y,0,z-H),F=gQ(F,0,K-B),{x:Y,y:F}}function mQ($,Z,J){let{margin:H,containerPadding:B,rowHeight:Q}=$,X=s6($),z=Math.round((J-B[0])/(X+H[0])),G=Math.round((Z-B[1])/(Q+H[1]));return{x:z,y:G}}function yi($,Z,J){let{margin:H,rowHeight:B}=$,Q=s6($),X=Math.max(1,Math.round((Z+H[0])/(Q+H[0]))),z=Math.max(1,Math.round((J+H[1])/(B+H[1])));return{w:X,h:z}}function gQ($,Z,J){return Math.max(Math.min($,J),Z)}function _W($,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 t6($,Z){for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0&&_W(H,Z))return H}return}function XP($,Z){return $.filter((J)=>_W(J,Z))}function ez0($,Z){if(Z==="horizontal")return zP($);if(Z==="vertical")return PW($);if(Z==="wrap")return PW($);return[...$]}function PW($){return[...$].sort((Z,J)=>{if(Z.y!==J.y)return Z.y-J.y;return Z.x-J.x})}function zP($){return[...$].sort((Z,J)=>{if(Z.x!==J.x)return Z.x-J.x;return Z.y-J.y})}function uQ($){let Z=0;for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0){let B=H.y+H.h;if(B>Z)Z=B}}return Z}function e6($,Z){for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0&&H.i===Z)return H}return}function pQ($){return $.filter((Z)=>Z.static===!0)}function R3($){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 cJ($){let Z=Array($.length);for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0)Z[J]=R3(H)}return Z}function $G0($,Z){let J=Array($.length);for(let H=0;H<$.length;H++){let B=$[H];if(B!==void 0)if(Z.i===B.i)J[H]=Z;else J[H]=B}return J}function xi($,Z,J){let H=e6($,Z);if(!H)return[[...$],null];return H=J(R3(H)),[$G0($,H),H]}function GP($,Z){let J=pQ($);for(let H=0;H<$.length;H++){let B=$[H];if(B===void 0)continue;if(B.x+B.w>Z.cols)B.x=Z.cols-B.w;if(B.x<0)B.x=0,B.w=Z.cols;if(!B.static)J.push(B);else while(t6(J,B))B.y++}return $}function n6($,Z,J,H,B,Q,X,z,G){if(Z.static&&Z.isDraggable!==!0)return[...$];if(Z.y===H&&Z.x===J)return[...$];let{x:K,y:U}=Z;if(typeof J==="number")Z.x=J;if(typeof H==="number")Z.y=H;Z.moved=!0;let Y=ez0($,X);if(X==="vertical"&&typeof H==="number"?U>=H:X==="horizontal"&&typeof J==="number"?K>=J:!1)Y=Y.reverse();let W=XP(Y,Z),q=W.length>0;if(q&&G)return cJ($);if(q&&Q)return Z.x=K,Z.y=U,Z.moved=!1,$;let N=[...$];for(let A=0;A<W.length;A++){let V=W[A];if(V===void 0)continue;if(V.moved)continue;if(V.static)N=bi(N,V,Z,B,X);else N=bi(N,Z,V,B,X)}return N}function bi($,Z,J,H,B,Q){let X=B==="horizontal",z=B==="vertical",G=Z.static;if(H){H=!1;let Y={x:X?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"},F=t6($,Y),W=F!==void 0&&F.y+F.h>Z.y,q=F!==void 0&&Z.x+Z.w>F.x;if(!F)return n6($,J,X?Y.x:void 0,z?Y.y:void 0,H,G,B);if(W&&z)return n6($,J,void 0,J.y+1,H,G,B);if(W&&B===null)return Z.y=J.y,J.y=J.y+J.h,[...$];if(q&&X)return n6($,Z,J.x,void 0,H,G,B)}let K=X?J.x+1:void 0,U=z?J.y+1:void 0;if(K===void 0&&U===void 0)return[...$];return n6($,J,K,U,H,G,B)}function dJ($,Z,J){return Math.max(Z,Math.min(J,$))}var ZG0={name:"gridBounds",constrainPosition($,Z,J,{cols:H,maxRows:B}){return{x:dJ(Z,0,Math.max(0,H-$.w)),y:dJ(J,0,Math.max(0,B-$.h))}},constrainSize($,Z,J,H,{cols:B,maxRows:Q}){let X=H==="w"||H==="nw"||H==="sw"?$.x+$.w:B-$.x,z=H==="n"||H==="nw"||H==="ne"?$.y+$.h:Q-$.y;return{w:dJ(Z,1,Math.max(1,X)),h:dJ(J,1,Math.max(1,z))}}},JG0={name:"minMaxSize",constrainSize($,Z,J){return{w:dJ(Z,$.minW??1,$.maxW??1/0),h:dJ(J,$.minH??1,$.maxH??1/0)}}};var KP=[ZG0,JG0];function cQ($,Z,J,H,B){let Q={x:J,y:H};for(let X of $)if(X.constrainPosition)Q=X.constrainPosition(Z,Q.x,Q.y,B);if(Z.constraints){for(let X of Z.constraints)if(X.constrainPosition)Q=X.constrainPosition(Z,Q.x,Q.y,B)}return Q}function hi($,Z,J,H,B,Q){let X={w:J,h:H};for(let z of $)if(z.constrainSize)X=z.constrainSize(Z,X.w,X.h,B,Q);if(Z.constraints){for(let z of Z.constraints)if(z.constrainSize)X=z.constrainSize(Z,X.w,X.h,B,Q)}return X}function OW({top:$,left:Z,width:J,height:H}){let B=`translate(${Z}px,${$}px)`;return{transform:B,WebkitTransform:B,MozTransform:B,msTransform:B,OTransform:B,width:`${J}px`,height:`${H}px`,position:"absolute"}}function UP({top:$,left:Z,width:J,height:H}){return{top:`${$}px`,left:`${Z}px`,width:`${J}px`,height:`${H}px`,position:"absolute"}}function YP($){return $*100+"%"}function HG0($,Z,J,H){return $+J>H?Z:J}function vi($,Z,J){return $<0?Z:J}function BG0($){return Math.max(0,$)}function jW($){return Math.max(0,$)}var FP=($,Z,J)=>{let{left:H,height:B,width:Q}=Z,X=$.top-(B-$.height);return{left:H,width:Q,height:vi(X,$.height,B),top:jW(X)}},WP=($,Z,J)=>{let{top:H,left:B,height:Q,width:X}=Z;return{top:H,height:Q,width:HG0($.left,$.width,X,J),left:BG0(B)}},qP=($,Z,J)=>{let{top:H,height:B,width:Q}=Z,X=$.left+$.width-Q;if(X<0)return{height:B,width:$.left+$.width,top:jW(H),left:0};return{height:B,width:Q,top:jW(H),left:X}},NP=($,Z,J)=>{let{top:H,left:B,height:Q,width:X}=Z;return{width:X,left:B,height:vi(H,$.height,Q),top:jW(H)}},QG0=($,Z,J)=>FP($,WP($,Z,J)),XG0=($,Z,J)=>FP($,qP($,Z)),zG0=($,Z,J)=>NP($,WP($,Z,J)),GG0=($,Z,J)=>NP($,qP($,Z)),KG0={n:FP,ne:QG0,e:WP,se:zG0,s:NP,sw:GG0,w:qP,nw:XG0};function gi($,Z,J,H){let B=KG0[$];if(!B)return J;return B(Z,{...Z,...J},H)}var UG0={type:"transform",scale:1,calcStyle($){return OW($)}};var fi=UG0,mi={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},ui={enabled:!0,bounded:!1,threshold:3},pi={enabled:!0,handles:["se"]},ci={enabled:!1,defaultItem:{w:1,h:1}};function VP($,Z,J,H,B){let Q=H==="x"?"w":"h";Z[H]+=1;let X=$.findIndex((G)=>G.i===Z.i),z=B??pQ($).length>0;for(let G=X+1;G<$.length;G++){let K=$[G];if(K===void 0)continue;if(K.static)continue;if(!z&&K.y>Z.y+Z.h)break;if(_W(Z,K))VP($,K,J+Z[Q],H,z)}Z[H]=J}function YG0($,Z,J,H){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0),Z.y=Math.min(H,Z.y);while(Z.y>0&&!t6($,Z))Z.y--;let B;while((B=t6($,Z))!==void 0)VP(J,Z,B.y+B.h,"y");return Z.y=Math.max(Z.y,0),Z}function FG0($,Z,J,H){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0);while(Z.x>0&&!t6($,Z))Z.x--;let B;while((B=t6($,Z))!==void 0)if(VP(H,Z,B.x+B.w,"x"),Z.x+Z.w>J){Z.x=J-Z.w,Z.y++;while(Z.x>0&&!t6($,Z))Z.x--}return Z.x=Math.max(Z.x,0),Z}var dQ={type:"vertical",allowOverlap:!1,compact($,Z){let J=pQ($),H=uQ(J),B=PW($),Q=Array($.length);for(let X=0;X<B.length;X++){let z=B[X];if(z===void 0)continue;let G=R3(z);if(!G.static)G=YG0(J,G,B,H),H=Math.max(H,G.y+G.h),J.push(G);let K=$.indexOf(z);Q[K]=G,G.moved=!1}return Q}},AP={type:"horizontal",allowOverlap:!1,compact($,Z){let J=pQ($),H=zP($),B=Array($.length);for(let Q=0;Q<H.length;Q++){let X=H[Q];if(X===void 0)continue;let z=R3(X);if(!z.static)z=FG0(J,z,Z,H),J.push(z);let G=$.indexOf(X);B[G]=z,z.moved=!1}return B}},DP={type:null,allowOverlap:!1,compact($,Z){return cJ($)}},WG0={...dQ,allowOverlap:!0,compact($,Z){return cJ($)}},qG0={...AP,allowOverlap:!0,compact($,Z){return cJ($)}},NG0={...DP,allowOverlap:!0};function LP($,Z=!1,J=!1){let H;if(Z)if($==="vertical")H=WG0;else if($==="horizontal")H=qG0;else H=NG0;else if($==="vertical")H=dQ;else if($==="horizontal")H=AP;else H=DP;if(J)return{...H,preventCollision:J};return H}var B9=_(p(),1);function VG0($){let Z=typeof globalThis.getComputedStyle==="function"?globalThis.getComputedStyle($):null;if(!Z)return $.clientWidth;let J=(B)=>{let Q=Number.parseFloat(B);return Number.isFinite(Q)?Q:0},H=Number.parseFloat(Z.width);if(Number.isFinite(H))return Math.max(0,H);return Math.max(0,$.clientWidth-J(Z.paddingLeft)-J(Z.paddingRight))}function MP($={}){let{measureBeforeMount:Z=!1,initialWidth:J=1280}=$,[H,B]=B9.useState(J),[Q,X]=B9.useState(!Z),z=B9.useRef(null),G=B9.useRef(null),K=B9.useCallback(()=>{let U=z.current;if(U){let Y=Math.round(VG0(U));if(B((F)=>F===Y?F:Y),!Q)X(!0)}},[Q]);return B9.useEffect(()=>{let U=z.current;if(!U)return;if(K(),typeof ResizeObserver<"u"){let Y=null;return G.current=new ResizeObserver((F)=>{let W=F[0];if(W){let q=Math.round(W.contentRect.width);if(Y!==null)cancelAnimationFrame(Y);Y=requestAnimationFrame(()=>{B((N)=>N===q?N:q),Y=null})}}),G.current.observe(U),()=>{if(Y!==null)cancelAnimationFrame(Y);if(G.current)G.current.disconnect(),G.current=null}}return()=>{if(G.current)G.current.disconnect(),G.current=null}},[K]),{width:H,mounted:Q,containerRef:z,measureWidth:K}}var g0=_(p(),1),ur=_(kW(),1),pr=_(gr(),1);var k3=_(d(),1),R$=_(li(),1);function mP($){let{children:Z,cols:J,containerWidth:H,margin:B,containerPadding:Q,rowHeight:X,maxRows:z,isDraggable:G,isResizable:K,isBounded:U,static:Y,useCSSTransforms:F=!0,usePercentages:W=!1,transformScale:q=1,positionStrategy:N,dragThreshold:A=0,droppingPosition:V,className:D="",style:L,handle:j="",cancel:M="",x:P,y:w,w:C,h:R,minW:O=1,maxW:S=1/0,minH:y=1,maxH:k=1/0,i:T,resizeHandles:b,resizeHandle:I,constraints:v=KP,layoutItem:h,layout:f=[],onDragStart:E,onDrag:i,onDragStop:r,onResizeStart:x,onResize:l,onResizeStop:o}=$,[u,c]=g0.useState(!1),[n,Z0]=g0.useState(!1),J0=g0.useRef(null),X0=g0.useRef({left:0,top:0}),Q0=g0.useRef({top:0,left:0,width:0,height:0}),F0=g0.useRef(void 0),A0=g0.useRef(f);A0.current=f;let N0=g0.useRef(null),Y0=g0.useRef(null),s=g0.useRef(!1),a=g0.useRef({x:0,y:0}),e=g0.useRef(!1),$0=g0.useMemo(()=>({cols:J,containerPadding:Q,containerWidth:H,margin:B,maxRows:z,rowHeight:X}),[J,Q,H,B,z,X]),B0=g0.useMemo(()=>({cols:J,maxRows:z,containerWidth:H,containerHeight:0,rowHeight:X,margin:B,layout:[]}),[J,z,H,X,B]),_0=g0.useCallback(()=>({...B0,layout:A0.current}),[B0]),M0=g0.useMemo(()=>h??{i:T,x:P,y:w,w:C,h:R,minW:O,maxW:S,minH:y,maxH:k},[h,T,P,w,C,R,O,S,y,k]),V0=g0.useCallback((C0)=>{if(N?.calcStyle)return N.calcStyle(C0);if(F)return OW(C0);let p0=UP(C0);if(W)return{...p0,left:YP(C0.left/H),width:YP(C0.width/H)};return p0},[N,F,W,H]),L0=g0.useCallback((C0,{node:p0})=>{if(!E)return;let{offsetParent:i0}=p0;if(!i0)return;let a0=i0.getBoundingClientRect(),A1=p0.getBoundingClientRect(),D1=A1.left/q,u1=a0.left/q,q0=A1.top/q,P0=a0.top/q,l0;if(N?.calcDragPosition){let r0=C0;l0=N.calcDragPosition(r0.clientX,r0.clientY,r0.clientX-A1.left,r0.clientY-A1.top)}else l0={left:D1-u1+i0.scrollLeft,top:q0-P0+i0.scrollTop};if(X0.current=l0,A>0){let r0=C0;a.current={x:r0.clientX,y:r0.clientY},s.current=!0,e.current=!1,c(!0);return}c(!0);let Q1=mQ($0,l0.top,l0.left),{x:j1,y:k0}=cQ(v,M0,Q1.x,Q1.y,_0());E(T,j1,k0,{e:C0,node:p0,newPosition:l0})},[E,q,$0,N,A,v,M0,_0,T]),g=g0.useCallback((C0,{node:p0,deltaX:i0,deltaY:a0})=>{if(!i||!u)return;let A1=C0;if(s.current&&!e.current){let j1=A1.clientX-a.current.x,k0=A1.clientY-a.current.y;if(Math.hypot(j1,k0)<A)return;if(e.current=!0,s.current=!1,E){let y0=mQ($0,X0.current.top,X0.current.left),{x:X1,y:S1}=cQ(v,M0,y0.x,y0.y,_0());E(T,X1,S1,{e:C0,node:p0,newPosition:X0.current})}}let D1=X0.current.top+a0,u1=X0.current.left+i0;if(U){let{offsetParent:j1}=p0;if(j1){let k0=j1.clientHeight-H9(R,X,B[1]);D1=gQ(D1,0,k0);let r0=s6($0),y0=H-H9(C,r0,B[0]);u1=gQ(u1,0,y0)}}let q0={top:D1,left:u1};X0.current=q0;let P0=mQ($0,D1,u1),{x:l0,y:Q1}=cQ(v,M0,P0.x,P0.y,_0());i(T,l0,Q1,{e:C0,node:p0,newPosition:q0})},[i,E,u,A,U,R,X,B,$0,H,C,T,v,M0,_0]),m=g0.useCallback((C0,{node:p0})=>{if(!r||!u)return;let i0=s.current;if(s.current=!1,e.current=!1,a.current={x:0,y:0},i0){c(!1),X0.current={left:0,top:0};return}let{left:a0,top:A1}=X0.current,D1={top:A1,left:a0};c(!1),X0.current={left:0,top:0};let u1=mQ($0,A1,a0),{x:q0,y:P0}=cQ(v,M0,u1.x,u1.y,_0());r(T,q0,P0,{e:C0,node:p0,newPosition:D1})},[r,u,$0,v,M0,_0,T]);N0.current=L0,Y0.current=g;let t=g0.useCallback((C0,{node:p0,size:i0,handle:a0},A1,D1)=>{let u1=D1==="onResizeStart"?x:D1==="onResize"?l:o;if(!u1)return;let q0;if(p0)q0=gi(a0,A1,i0,H);else q0={...i0,top:A1.top,left:A1.left};Q0.current=q0;let P0=yi($0,q0.width,q0.height),{w:l0,h:Q1}=hi(v,M0,P0.w,P0.h,a0,_0());u1(T,l0,Q1,{e:C0.nativeEvent??C0,node:p0,size:q0,handle:a0})},[x,l,o,H,$0,T,v,M0,_0]),W0=g0.useCallback((C0,p0)=>{Z0(!0);let i0=fQ($0,P,w,C,R),a0={...p0,handle:p0.handle};t(C0,a0,i0,"onResizeStart")},[t,$0,P,w,C,R]),R0=g0.useCallback((C0,p0)=>{let i0=fQ($0,P,w,C,R),a0={...p0,handle:p0.handle};t(C0,a0,i0,"onResize")},[t,$0,P,w,C,R]),c0=g0.useCallback((C0,p0)=>{Z0(!1),Q0.current={top:0,left:0,width:0,height:0};let i0=fQ($0,P,w,C,R),a0={...p0,handle:p0.handle};t(C0,a0,i0,"onResizeStop")},[t,$0,P,w,C,R]);g0.useEffect(()=>{if(!V)return;let C0=J0.current;if(!C0)return;let p0=F0.current||{left:0,top:0},i0=u&&(V.left!==p0.left||V.top!==p0.top);if(!u){let a0={node:C0,deltaX:V.left,deltaY:V.top,lastX:0,lastY:0,x:V.left,y:V.top};N0.current?.(V.e,a0)}else if(i0){let a0=V.left-X0.current.left,A1=V.top-X0.current.top,D1={node:C0,deltaX:a0,deltaY:A1,lastX:X0.current.left,lastY:X0.current.top,x:V.left,y:V.top};Y0.current?.(V.e,D1)}F0.current=V},[V,u,T]);let f0=fQ($0,P,w,C,R,u?X0.current:null,n?Q0.current:null),T0=g0.default.Children.only(Z),x0=s6($0),Z1=[H9(O,x0,B[0]),H9(y,X,B[1])],W1=[H9(S,x0,B[0]),H9(k,X,B[1])],d0=T0.props,v0=d0.className,w1=d0.style,B1=g0.default.cloneElement(T0,{ref:J0,className:uP("react-grid-item",v0,D,{static:Y,resizing:n,"react-draggable":G,"react-draggable-dragging":u,dropping:Boolean(V),cssTransforms:F}),style:{...L,...w1,...V0(f0)}}),s1=I;return B1=k3.jsx(pr.Resizable,{draggableOpts:{disabled:!K},className:K?void 0:"react-resizable-hide",width:f0.width,height:f0.height,minConstraints:Z1,maxConstraints:W1,onResizeStart:W0,onResize:R0,onResizeStop:c0,transformScale:q,resizeHandles:b,handle:s1,children:B1}),B1=k3.jsx(ur.DraggableCore,{disabled:!G,onStart:L0,onDrag:g,onStop:m,handle:j,cancel:".react-resizable-handle"+(M?","+M:""),scale:q,nodeRef:J0,children:B1}),B1}var b3=()=>{},fr="react-grid-layout",cr=!1;try{cr=/firefox/i.test(navigator.userAgent)}catch{}function EU0($,Z){let J=g0.default.Children.toArray($),H=g0.default.Children.toArray(Z);if(J.length!==H.length)return!1;for(let B=0;B<J.length;B++){let Q=J[B],X=H[B];if(Q?.key!==X?.key)return!1}return!0}function mr($,Z,J,H){let B=[],Q=new Set;g0.default.Children.forEach(Z,(z)=>{if(!g0.default.isValidElement(z)||z.key===null)return;let G=String(z.key);Q.add(G);let K=$.find((U)=>U.i===G);if(K)B.push(R3(K));else{let Y=z.props["data-grid"];if(Y)B.push({i:G,x:Y.x??0,y:Y.y??0,w:Y.w??1,h:Y.h??1,minW:Y.minW,maxW:Y.maxW,minH:Y.minH,maxH:Y.maxH,static:Y.static,isDraggable:Y.isDraggable,isResizable:Y.isResizable,resizeHandles:Y.resizeHandles,isBounded:Y.isBounded});else B.push({i:G,x:0,y:uQ(B),w:1,h:1})}});let X=GP(B,{cols:J});return H.compact(X,J)}function nQ($){let{children:Z,width:J,gridConfig:H,dragConfig:B,resizeConfig:Q,dropConfig:X,positionStrategy:z=fi,compactor:G,constraints:K=KP,layout:U=[],droppingItem:Y,autoSize:F=!0,className:W="",style:q={},innerRef:N,onLayoutChange:A=b3,onDragStart:V=b3,onDrag:D=b3,onDragStop:L=b3,onResizeStart:j=b3,onResize:M=b3,onResizeStop:P=b3,onDrop:w=b3,onDropDragOver:C=b3}=$,R=g0.useMemo(()=>({...mi,...H}),[H]),O=g0.useMemo(()=>({...ui,...B}),[B]),S=g0.useMemo(()=>({...pi,...Q}),[Q]),y=g0.useMemo(()=>({...ci,...X}),[X]),{cols:k,rowHeight:T,maxRows:b,margin:I,containerPadding:v}=R,{enabled:h,bounded:f,handle:E,cancel:i,threshold:r}=O,{enabled:x,handles:l,handleComponent:o}=S,{enabled:u,defaultItem:c,onDragOver:n}=y,Z0=G??LP("vertical"),J0=Z0.type,X0=Z0.allowOverlap,Q0=Z0.preventCollision??!1,F0=g0.useMemo(()=>Y??{i:"__dropping-elem__",...c},[Y,c]),A0=z.type==="transform",N0=z.scale,Y0=v??I,[s,a]=g0.useState(!1),[e,$0]=g0.useState(()=>mr(U,Z,k,Z0)),[B0,_0]=g0.useState(null),[M0,V0]=g0.useState(!1),[L0,g]=g0.useState(null),[m,t]=g0.useState(),W0=g0.useRef(null),R0=g0.useRef(null),c0=g0.useRef(null),f0=g0.useRef(0),T0=g0.useRef(e),x0=g0.useRef(U),Z1=g0.useRef(Z),W1=g0.useRef(J0),d0=g0.useRef(e);d0.current=e,g0.useEffect(()=>{if(a(!0),!R$.deepEqual(e,U))A(e)},[]),g0.useEffect(()=>{if(B0)return;if(L0)return;let k0=!R$.deepEqual(U,x0.current),r0=!EU0(Z,Z1.current),y0=J0!==W1.current;if(k0||r0||y0){let S1=mr(k0?U:e,Z,k,Z0);if(!R$.deepEqual(S1,e))$0(S1)}x0.current=U,Z1.current=Z,W1.current=J0},[U,Z,k,J0,Z0,B0,L0,e]),g0.useEffect(()=>{if(!B0&&!R$.deepEqual(e,T0.current)){T0.current=e;let k0=e.filter((r0)=>r0.i!==F0.i);A(k0)}},[e,B0,A,F0.i]);let v0=g0.useMemo(()=>{if(!F)return;let k0=uQ(e),r0=Y0[1];return k0*T+(k0-1)*I[1]+r0*2+"px"},[F,e,T,I,Y0]),w1=g0.useCallback((k0,r0,y0,X1)=>{let S1=d0.current,b1=e6(S1,k0);if(!b1)return;let x5={w:b1.w,h:b1.h,x:b1.x,y:b1.y,i:k0};W0.current=R3(b1),c0.current=S1,_0(x5),V(S1,b1,b1,null,X1.e,X1.node)},[V]),B1=g0.useCallback((k0,r0,y0,X1)=>{let S1=d0.current,b1=W0.current,x5=e6(S1,k0);if(!x5)return;let q2={w:x5.w,h:x5.h,x:x5.x,y:x5.y,i:k0},h5=n6(S1,x5,r0,y0,!0,Q0,J0,k,X0);D(h5,b1,x5,q2,X1.e,X1.node),$0(Z0.compact(h5,k)),_0(q2)},[Q0,J0,k,X0,Z0,D]),s1=g0.useCallback((k0,r0,y0,X1)=>{if(!B0)return;let S1=d0.current,b1=W0.current,x5=e6(S1,k0);if(!x5)return;let q2=n6(S1,x5,r0,y0,!0,Q0,J0,k,X0),h5=Z0.compact(q2,k);L(h5,b1,x5,null,X1.e,X1.node);let p2=c0.current;if(W0.current=null,c0.current=null,_0(null),$0(h5),p2&&!R$.deepEqual(p2,h5))A(h5)},[B0,Q0,J0,k,X0,Z0,L,A]),C0=g0.useCallback((k0,r0,y0,X1)=>{let S1=d0.current,b1=e6(S1,k0);if(!b1)return;R0.current=R3(b1),c0.current=S1,V0(!0),j(S1,b1,b1,null,X1.e,X1.node)},[j]),p0=g0.useCallback((k0,r0,y0,X1)=>{let S1=d0.current,b1=R0.current,{handle:x5}=X1,q2=!1,h5,p2,[JX,B3]=xi(S1,k0,(f5)=>{if(h5=f5.x,p2=f5.y,["sw","w","nw","n","ne"].includes(x5)){if(["sw","nw","w"].includes(x5))h5=f5.x+(f5.w-r0),r0=f5.x!==h5&&h5<0?f5.w:r0,h5=h5<0?0:h5;if(["ne","n","nw"].includes(x5))p2=f5.y+(f5.h-y0),y0=f5.y!==p2&&p2<0?f5.h:y0,p2=p2<0?0:p2;q2=!0}if(Q0&&!X0){if(XP(S1,{...f5,w:r0,h:y0,x:h5??f5.x,y:p2??f5.y}).filter((BX)=>BX.i!==f5.i).length>0)p2=f5.y,y0=f5.h,h5=f5.x,r0=f5.w,q2=!1}return f5.w=r0,f5.h=y0,f5});if(!B3)return;let JH=JX;if(q2&&h5!==void 0&&p2!==void 0)JH=n6(JX,B3,h5,p2,!0,Q0,J0,k,X0);let HX={w:B3.w,h:B3.h,x:B3.x,y:B3.y,i:k0,static:!0};M(JH,b1,B3,HX,X1.e,X1.node),$0(Z0.compact(JH,k)),_0(HX)},[Q0,J0,k,X0,Z0,M]),i0=g0.useCallback((k0,r0,y0,X1)=>{let S1=d0.current,b1=R0.current,x5=e6(S1,k0),q2=Z0.compact(S1,k);P(q2,b1,x5??null,null,X1.e,X1.node);let h5=c0.current;if(R0.current=null,c0.current=null,_0(null),V0(!1),$0(q2),h5&&!R$.deepEqual(h5,q2))A(q2)},[k,Z0,P,A]),a0=g0.useCallback(()=>{let k0=d0.current;if(!k0.some((X1)=>X1.i===F0.i)){g(null),_0(null),t(void 0);return}let y0=Z0.compact(k0.filter((X1)=>X1.i!==F0.i),k);$0(y0),g(null),_0(null),t(void 0)},[F0.i,k,Z0]),A1=g0.useCallback((k0)=>{if(k0.preventDefault(),k0.stopPropagation(),cr&&!k0.nativeEvent.target?.classList.contains(fr))return!1;let r0=n?n(k0.nativeEvent):C(k0);if(r0===!1){if(L0)a0();return!1}let{dragOffsetX:y0=0,dragOffsetY:X1=0,...S1}=r0??{},b1={...F0,...S1},x5=k0.currentTarget.getBoundingClientRect(),q2={cols:k,margin:I,maxRows:b,rowHeight:T,containerWidth:J,containerPadding:Y0},h5=s6(q2),p2=H9(b1.w,h5,I[0]),JX=H9(b1.h,T,I[1]),B3=p2/2,JH=JX/2,HX=k0.clientX-x5.left+y0-B3,f5=k0.clientY-x5.top+X1-JH,$q=Math.max(0,HX),BX=Math.max(0,f5),QX={left:$q/N0,top:BX/N0,e:k0.nativeEvent};if(!L0){let Zq=ki(q2,BX,$q,b1.w,b1.h);g(k3.jsx("div",{},b1.i)),t(QX);let ko=d0.current.filter((yo)=>yo.i!==b1.i);$0([...ko,{...b1,x:Zq.x,y:Zq.y,static:!1,isDraggable:!0}])}else if(m){if(m.left!==QX.left||m.top!==QX.top)t(QX)}},[L0,m,F0,n,C,a0,N0,k,I,b,T,J,Y0]),D1=g0.useCallback((k0)=>{if(k0.preventDefault(),k0.stopPropagation(),f0.current--,f0.current<0)f0.current=0;if(f0.current===0)a0()},[a0]),u1=g0.useCallback((k0)=>{k0.preventDefault(),k0.stopPropagation(),f0.current++},[]),q0=g0.useCallback((k0)=>{k0.preventDefault(),k0.stopPropagation();let r0=d0.current,y0=r0.find((X1)=>X1.i===F0.i);f0.current=0,a0(),w(r0,y0,k0.nativeEvent)},[F0.i,a0,w]),P0=g0.useCallback((k0,r0)=>{if(!k0||!k0.key)return null;let y0=e6(e,String(k0.key));if(!y0)return null;let X1=typeof y0.isDraggable==="boolean"?y0.isDraggable:!y0.static&&h,S1=typeof y0.isResizable==="boolean"?y0.isResizable:!y0.static&&x,b1=y0.resizeHandles||[...l],x5=X1&&f&&y0.isBounded!==!1,q2=o;return k3.jsx(mP,{containerWidth:J,cols:k,margin:I,containerPadding:Y0,maxRows:b,rowHeight:T,cancel:i,handle:E,onDragStart:w1,onDrag:B1,onDragStop:s1,onResizeStart:C0,onResize:p0,onResizeStop:i0,isDraggable:X1,isResizable:S1,isBounded:x5,useCSSTransforms:A0&&s,usePercentages:!s,transformScale:N0,positionStrategy:z,dragThreshold:r,w:y0.w,h:y0.h,x:y0.x,y:y0.y,i:y0.i,minH:y0.minH,minW:y0.minW,maxH:y0.maxH,maxW:y0.maxW,static:y0.static,droppingPosition:r0?m:void 0,resizeHandles:b1,resizeHandle:q2,constraints:K,layoutItem:y0,layout:e,children:k0},y0.i)},[e,J,k,I,Y0,b,T,i,E,w1,B1,s1,C0,p0,i0,h,x,f,A0,s,N0,z,r,m,l,o,K]),l0=()=>{if(!B0)return null;return k3.jsx(mP,{w:B0.w,h:B0.h,x:B0.x,y:B0.y,i:B0.i,className:`react-grid-placeholder ${M0?"placeholder-resizing":""}`,containerWidth:J,cols:k,margin:I,containerPadding:Y0,maxRows:b,rowHeight:T,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:A0,transformScale:N0,constraints:K,layout:e,children:k3.jsx("div",{})})},Q1=uP(fr,W),j1={height:v0,...q};return k3.jsxs("div",{ref:N,className:Q1,style:j1,onDrop:u?q0:void 0,onDragLeave:u?D1:void 0,onDragEnter:u?u1:void 0,onDragOver:u?A1:void 0,children:[g0.default.Children.map(Z,(k0)=>{if(!g0.default.isValidElement(k0))return null;return P0(k0)}),u&&L0&&P0(L0,!0),l0()]})}var Q8=_(d(),1),pP="moi:empty-state",dr={type:"spring",duration:0.35,bounce:0};function SU0({items:$,customizing:Z,emptyState:J,renderItem:H,onMove:B,onRemove:Q}){let[X,z]=sQ.useState(()=>RQ($)),[G,K]=sQ.useState($),{width:U,containerRef:Y,mounted:F}=MP({measureBeforeMount:!0});if(G!==$)K($),z((N)=>{let A=new Map(N.map((L)=>[L.i,L])),V=$.filter((L)=>A.has(L.id)).map((L)=>({...A.get(L.id),w:L.w,h:L.h})),D=new Set(V.map((L)=>L.i));return[...V,...RQ($.filter((L)=>!D.has(L.id)),V)]});let W=J?[...X,{i:pP,x:0,y:X.reduce((N,A)=>Math.max(N,A.y+A.h),0),w:4,h:2,static:!0}]:X,q=sQ.useCallback((N)=>{let A=N.filter((V)=>V.i!==pP);z(A),B?.(A.map((V)=>({id:V.i,x:V.x,y:V.y})))},[B]);return Q8.jsx("div",{ref:Y,className:"w-full",children:F&&Q8.jsxs(nQ,{width:U,layout:W,gridConfig:{cols:4,rowHeight:160,margin:[8,8],containerPadding:[0,0]},dragConfig:{enabled:!!Z},resizeConfig:{enabled:!1},compactor:dQ,onLayoutChange:q,children:[X.map((N)=>Q8.jsx("div",{children:Q8.jsx(V5.div,{layoutId:N.i,"data-applet-thumbnail":`widget:${N.i}`,className:"size-full",transition:dr,children:Q8.jsx(HW,{customizing:Z,widgetId:N.i,onRemove:Q?()=>Q(N.i):void 0,children:H(N.i)})})},N.i)),J&&Q8.jsx("div",{children:Q8.jsx(V5.div,{layout:!0,className:"size-full",transition:dr,children:J})},pP)]})})}function lr({items:$,customizing:Z,header:J,emptyState:H,bottomInset:B=0,renderItem:Q,onMove:X,onRemove:z}){return Q8.jsxs("div",{className:"size-full overflow-y-auto p-4",children:[Q8.jsx("div",{className:"mx-auto h-32 w-full max-w-(--column-w)",children:J}),Q8.jsx(V5.div,{className:"mx-auto flex min-h-0 w-full max-w-(--column-w) flex-col gap-2",animate:{marginBottom:B},transition:{type:"spring",duration:0.3,bounce:0},children:($.length>0||H)&&Q8.jsx(SU0,{items:$,customizing:Z,emptyState:H,renderItem:Q,onMove:X,onRemove:z})})]})}var c1=_(d(),1);function IU0({onCreateWidget:$,showOnboarding:Z}){return c1.jsxs("div",{className:"relative grid size-full grid-cols-4 grid-rows-2 gap-2 overflow-hidden",children:[c1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle",children:c1.jsx("div",{className:"flex size-full items-start justify-start bg-radial-[at_top_left] from-muted from-40% to-transparent p-12",children:c1.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Widgets"})})}),c1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle"}),c1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle"}),c1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle",children:Z&&c1.jsx("div",{className:"flex size-full items-end justify-end",children:c1.jsx("span",{className:"m-8 max-w-56 text-right text-sm text-muted-foreground",children:"Widgets can surface information, read data, and perform actions"})})}),c1.jsxs(j0,{type:"button",variant:"outline",className:G0("absolute inset-0 m-auto h-fit w-fit","flex-col gap-1 rounded-2xl border-0 py-4 pr-12 pl-12! text-xs shadow-sm transition-shadow duration-300 ease-out squircle hover:bg-background hover:shadow-lg [&_svg]:size-8"),onClick:$,children:[c1.jsx(h2,{"data-icon":"inline-start",stroke:1}),"New widget"]})]})}function cP({Icon:$,label:Z,active:J,className:H,...B}){return c1.jsx(j0,{type:"button",variant:J?"default":"secondary",className:G0("relative h-16 w-24 rounded-lg px-4 py-0 text-xs [&_svg]:size-5",H),"aria-pressed":J,...B,children:c1.jsx(L4,{mode:"popLayout",initial:!1,children:c1.jsxs(V5.span,{className:"flex flex-col items-center gap-1.5",variants:{from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.2,bounce:0},children:[J?c1.jsx(L8,{stroke:1.5}):c1.jsx($,{stroke:1.5}),c1.jsx("span",{children:J?"Done":Z})]},J?"done":"action")})})}function RU0({customizing:$,theming:Z,onCustomizingChange:J,onThemingChange:H}){return c1.jsxs("div",{className:"flex size-full items-center gap-4",children:[c1.jsx(Ri,{}),c1.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[c1.jsx(cP,{Icon:ir,label:"Customize",active:$,onClick:()=>J(!$)}),c1.jsx(cP,{Icon:vW,label:"Theme",active:Z,onClick:()=>H(!Z)}),c1.jsx(oF,{children:c1.jsx(D3,{render:c1.jsx(cP,{Icon:Q6,label:"Settings"})})})]})]})}function bU0(){let[$,Z]=gW.useState(0);return[gW.useCallback((H)=>{if(!H)return;let B=new ResizeObserver(([Q])=>{let X=Q.borderBoxSize?.[0];Z(X?X.blockSize:Q.contentRect.height)});return B.observe(H),()=>B.disconnect()},[]),$]}function ar({onCreateWidget:$,onCreateView:Z,onOpenView:J,customizing:H,theming:B,onThemingChange:Q,onCustomizingChange:X,widgets:z,views:G,builders:K}){let{layout:U,setLayout:Y}=l1(),F=C5((O)=>O.hasSentMessageFromMoi),W=new Map(z.map((O)=>[O.id,O])),q=new Set(U.widgetGrid.map((O)=>O.i)),N=U.widgetGrid.filter((O)=>W.has(O.i)).map((O)=>{let S=W.get(O.i);return{id:O.i,w:S.config.colSpan,h:S.config.rowSpan,x:O.x,y:O.y}}),A=z.filter((O)=>!q.has(O.id)).map((O)=>({id:O.id,w:O.config.colSpan,h:O.config.rowSpan})),V=!H&&N.every((O)=>u9(O.id)),D=!F&&z.every((O)=>u9(O.id)),[L,j]=bU0(),M=H;bF({kind:"widget",enabled:!H,targets:N.filter((O)=>!u9(O.id)).map((O)=>({id:O.id,revision:W.get(O.id)?.revision}))});function P(O){let S=rd(O,{views:G,builders:K,onOpenView:J,onCreateView:Z,showOnboarding:D});if(S)return S;return c1.jsx($l,{name:O})}function w(O){Y({widgetGrid:U.widgetGrid.filter((S)=>S.i!==O)})}function C(O){let S=W.get(O);if(!S)return;let y=U.widgetGrid.map((T)=>{let b=W.get(T.i);return{...T,w:b?.config.colSpan??1,h:b?.config.rowSpan??1}}),k=$W(y,S.config.colSpan,S.config.rowSpan);Y({widgetGrid:[...U.widgetGrid,{i:O,x:k.x,y:k.y}]})}function R(O){Y({widgetGrid:nd(U.widgetGrid,O)})}return c1.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:c1.jsxs(rr,{children:[c1.jsx(lr,{items:N,customizing:H,header:c1.jsx(RU0,{customizing:H,theming:B,onCustomizingChange:X,onThemingChange:Q}),emptyState:V?c1.jsx(IU0,{onCreateWidget:$,showOnboarding:D}):void 0,bottomInset:M?j:0,renderItem:P,onMove:R,onRemove:w}),c1.jsx(L4,{children:H&&c1.jsx(Hl,{ref:L,items:A,renderItem:P,onCreateWidget:$,onClose:()=>X(!1),onRestore:C})})]})})}var nr=_(d(),1);function or({children:$}){return nr.jsx("header",{className:G0("@container relative flex shrink-0 items-center gap-1 py-2 pr-3 pl-4","after:absolute after:top-full after:left-0 after:h-px after:w-full after:bg-border"),children:$})}var sr=!0;var kU0=64;function tr($,Z=[]){let J=bA($),H=J.attachments.map(kA);return(Ok(J.text).trim()||(H.length?H:Z).filter(Boolean).join(", ")).replace(/\s+/gu," ").trim().slice(0,kU0).trimEnd()}function fW($,Z,J={}){if("id"in $){let X={source:J.source,...$.kind==="image"?{purpose:J.purpose}:{}};return{attachment:{type:"upload",uploadId:$.id,...X},part:{type:"file-attachment",mediaType:$.mediaType,label:$.filename,...X,previewUrl:$.kind==="image"?Z:void 0}}}let{source:H,label:B,text:Q}=$;return{attachment:{type:"text",source:H,label:B,text:Q},part:jk({type:"text",source:H,label:B,text:Q})}}function er($){return{attachments:$.map((Z)=>Z.attachment),parts:$.map((Z)=>Z.part)}}async function $a($,Z){let J=eK(Z);if(J)throw Error(J);return er(await Promise.all(Z.map(async(H)=>{if(H.type==="text")return fW(H);let B=await hB($,H.file??H.path);return fW(B,`/api/workspaces/${$}/uploads/${B.id}`,{source:H.source})})))}function mW($){return er($.flatMap((Z)=>{if(Z.kind==="text")return[fW(Z)];if(!Z.upload)return[];return[fW({...Z.upload,filename:Z.label,mediaType:Z.mediaType},Z.previewUrl,{source:Z.source,purpose:Z.kind==="drawing"?Z.purpose:void 0})]}))}function uW($){return!$?.applet&&!$?.preparedAttachments}function pW($,Z,J){if(!uW(J))return[];return(k1.getState().attachments[p8($,Z)]??[]).filter((B)=>B.kind==="text"||B.status==="ready"&&B.upload)}function cW({queryClient:$,workspaceId:Z,sessionId:J,parts:H}){let B=`optimistic:${crypto.randomUUID()}`;return $.setQueryData(S0.events(Z,J),(Q)=>pz(Q??yH(),{kind:"turn",turn:{id:B,role:"user",origin:{kind:"user-input"},parts:H,timestamp:new Date().toISOString()}})),k1.getState().setActivity(Z,J,"running"),k1.getState().setError(Z,J,null),B}function dW({queryClient:$,workspaceId:Z,sessionId:J,text:H,filenames:B=[]}){let Q=tr(H,B);if(!Q)return;$.setQueryData(S0.sessions(Z),(X)=>[{sessionId:J,summary:Q,lastModified:Date.now()},...(X??[]).filter((z)=>z.sessionId!==J)])}function lW($,Z,J,H){let B=$?.models,Q=!Z||!B||B.some((Y)=>Y.value===Z)?Z:void 0,X=$?.provider==="codex"?MU($.models,Z):B?.find((Y)=>Y.value===(Q??"default")),z=$?.provider==="codex"&&X?X.resolvedModel??X.value:Q,G=J&&(!X||(X.supportedEffortLevels??[]).includes(J))?J:void 0,K=H===void 0||!X||X.supportsFastMode?H:!1,U=sr&&$?.supportsStreaming?!0:void 0;return{model:z,effort:G,...K!==void 0?{fastMode:K}:{},stream:U}}var Ja=_(p(),1);function Za($){if($.status==="available")return null;if($.status==="checking")return"The agent is still connecting";if($.status==="disconnected")return"This workspace is disconnected from moi";if($.status==="login-required")return"Sign in to the agent to send this message";return"The agent is unavailable in this workspace"}function yU0($,Z,J){let H=new Set,B=!1,Q=()=>Z.getQueryData(V3.selectedSession($))?.sessionId??null;async function X(z){if(B)return;let G=(V)=>{q5.add({title:"Couldn’t send message",description:V,type:"error"}),n4($,{source:"runtime",message:`sendChatMessage() from ${z.source}: ${V}`})},K=Za(J().agentAvailability);if(K){G(K);return}let U=Q(),Y=!0,F,W=()=>{if(Y=!1,N(),H.delete(q),F)q5.close(F)},q=()=>{if(!Y)return;W(),q5.add({title:"Message canceled",description:"The active chat changed before attachments were ready",type:"info"})},N=Z.getQueryCache().subscribe(()=>{if(Q()!==U)q()});if(H.add(q),J().sessionId!==U){q();return}J().revealChat();let A;try{if(z.attachments.some((L)=>L.type==="file"))F=q5.add({title:"Preparing attachments…",type:"loading",timeout:0});if(A=await $a($,z.attachments),!Y)return;let V=J(),D=Za(V.agentAvailability);if(D)throw Error(D);if(V.sessionId!==U){q();return}}catch(V){if(Y)W(),G(V instanceof Error?V.message:"Couldn’t prepare the attachments");return}W();try{J().send(z.message,{applet:{source:z.source},preparedAttachments:A})}catch(V){G(V instanceof Error?V.message:"Something went wrong while sending this message")}}return{handle:X,dispose(){B=!0;for(let z of H)z()}}}function Ha($){let Z=e1(),J=z1(),H=K5($);Ja.useLayoutEffect(()=>{let B=yU0(Z,J,()=>H.current),Q=ZU(Z).on("sendChatMessage",(X)=>{B.handle(X)});return()=>{Q(),B.dispose()}},[Z,J,H])}function Ba($,Z){let J=e1();JU(J,"addChatAttachment",(H)=>{Uy({workspaceId:J,sessionId:$},H),Z()})}var y3=_(p(),1);var Xa=_(p(),1);var Qa=new Map;function xU0($){let Z=Qa.get($)??[];return Qa.delete($),Z}function hU0($,Z=[]){return[...xU0($),...Z]}function vU0($,Z){if(!$.startsWith("views/"))return;return Object.keys(Z).length>0?Z:void 0}function gU0($,Z,J){if($.startsWith("views/"))return Z?.find((H)=>H.id===$.slice(6))?.config.title||void 0;if($.startsWith("view-builders/"))return J?.find((H)=>H.id===$.slice(14))?.title||void 0;return}function za({activeTab:$,appletParams:Z}){let J=e1(),H=sF(J).data,B=eF(J).data;return Xa.useCallback((Q={})=>{let X=hU0(J,Q.directives??[]),z=vU0($,Z);return{activeTab:$,tabTitle:gU0($,H,B),...z?{tabParams:z}:{},...Q.applet?{applet:Q.applet}:{},...X.length>0?{directives:X}:{}}},[J,$,Z,H,B])}function fU0($){return $.filter((Z)=>Z.text.length>0).map((Z)=>Z.kind==="reasoning"?{type:"reasoning",text:Z.text}:{type:"text",text:Z.text})}function Ga($){let Z=fU0($?.blocks??[]);if(Z.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:Z}}var mU0=yH();function Ka($){let Z=e1(),J=z1(),{layout:H}=l1(),[B,Q]=e3(),X=m9(Z).data,z=DU(Z).data,G=Boolean(B)&&z!==void 0&&!z.some((R)=>R.sessionId===B),K=G?null:B??null;y3.useEffect(()=>{if(G)Q(null)},[Q,G]);let U=za($),Y=x2((R)=>K?R.activity[`${Z}:${K}`]??"idle":"idle"),F=YZ(Y),W=x2((R)=>K?R.errors[`${Z}:${K}`]??null:null),q=Hx(Z,K),{refetch:N}=q,A=y3.useCallback(()=>void N(),[N]),V=q.data??mU0,D=z!==void 0&&(K===null||q.data!==void 0),L=x2((R)=>oC(R.previews,Z,K).root),j=y3.useMemo(()=>Ga(L),[L]),M=LU(Z,K).data,P=y3.useCallback((R,O)=>{let S=R.trim(),y=pW(Z,K,O);if(!S&&y.length===0&&!O?.preparedAttachments?.attachments.length)return;let k=O?.preparedAttachments??mW(y),T=eK(k.attachments);if(T){q5.add({title:"Couldn’t send message",description:T,type:"error"});return}let b=K,I=!1;if(!b){if(b=crypto.randomUUID(),I=!0,!uW(O))k1.getState().renameSession(Z,K,b);Q(b),dW({queryClient:J,workspaceId:Z,sessionId:b,text:S,filenames:y.map((c)=>c.label)})}let v=[...k.parts];if(S)v.push({type:"text",text:S});let h=cW({queryClient:J,workspaceId:Z,sessionId:b,parts:v}),f=M?.model??H.selectedModel,E=M?.effort??H.selectedEffort,i=M?.fastMode??H.selectedFastMode,{model:r,effort:x,fastMode:l,stream:o}=lW(X,f,E,i),{attachments:u}=k;if(lz({type:"chat",workspaceId:Z,content:S,sessionId:b,isNew:I,optimisticId:h,model:r,effort:x,fastMode:l,stream:o,context:U(O),...u.length>0?{attachments:u}:{}}),C5.getState().markMessageSentFromMoi(Z),I)J.invalidateQueries({queryKey:S0.preview(Z)});if(uW(O))k1.getState().clearAttachments(Z,K)},[K,Z,J,H.selectedModel,H.selectedEffort,H.selectedFastMode,U,M?.model,M?.effort,M?.fastMode,Q,X]),w=y3.useCallback(()=>{if(!K)return;k1.getState().setError(Z,K,null)},[K,Z]),C=y3.useCallback(()=>{if(!F||!K)return;lz({type:"stop",workspaceId:Z,sessionId:K})},[F,K,Z]);return{view:V,chatLoaded:D,previewTurn:j,sessionId:K,processing:F,error:W,loadError:q.error?.message??null,retryLoad:A,send:P,stop:C,selectSession:Q,dismissError:w}}var Ya=_(p(),1);var m2=_(p(),1);function Ua({active:$,builderId:Z,sessionId:J,source:H,workspaceId:B,onEditingStart:Q,onContinueInChat:X}){let z=m2.useRef(`sketch:${Z}`),G=m2.useRef(0),K=m2.useRef(null),U=m2.useRef(null),Y=m2.useRef(!0),[F,W]=m2.useState(!1),q=K5(Q),N=K5(X),A=m2.useCallback((C)=>{if(!Y.current)return;if(!C){G.current+=1,K.current=null,U.current=null,k1.getState().removeAttachment(B,z.current);return}vB({workspaceId:B,sessionId:J,localId:z.current,purpose:"sketch",source:H,blob:C})},[J,H,B]),V=m2.useCallback((C)=>{if(!C)return U.current??Promise.resolve();if(C===K.current){if(k1.getState().attachments[p8(B,J)]?.some((y)=>y.localId===z.current&&y.kind!=="text"&&(y.status==="ready"||y.status==="uploading")))return U.current??Promise.resolve()}K.current=C;let R=++G.current,O=FU({workspaceId:B,sessionId:J,localId:z.current,purpose:"sketch",source:H,blob:C,isCurrent:()=>G.current===R});return U.current=O,O},[J,H,B]),D=UU({mode:"sketch",onChange:A,onEditingStart:()=>q.current()}),{controls:L}=D,j=m2.useCallback(async()=>{await V(await L.flush())},[L,V]),M=m2.useCallback(async()=>{await V(await L.deactivate())},[L,V]),P=m2.useCallback(async()=>{if(F)return;W(!0);try{await M(),N.current()}finally{W(!1)}},[F,M,N]),w=m2.useCallback(async()=>{Y.current=!1,G.current+=1,K.current=null,U.current=null,k1.getState().removeAttachment(B,z.current);try{await L.cancel()}finally{Y.current=!0}},[L,B]);return m2.useEffect(()=>{if(!$&&L.active)M()},[$,L.active,M]),{...D,continuing:F,continueInChat:P,prepareForSend:j,resetDocument:w}}var w5=_(d(),1);function Fa({ref:$,active:Z,builder:J,chatDocked:H,workspaceId:B,onEditingStart:Q,onContinueInChat:X,onOpenChat:z,onDiscard:G}){let K=Ua({active:Z&&J.status==="draft",builderId:J.id,sessionId:J.sessionId,source:Z$(J.id),workspaceId:B,onEditingStart:Q,onContinueInChat:X});switch(Ya.useImperativeHandle($,()=>({prepareSketchForSend:K.prepareForSend,resetSketch:K.resetDocument}),[K.prepareForSend,K.resetDocument]),J.status){case"ready":return null;case"draft":case"waiting":case"building":return w5.jsx(uU0,{active:Z,chatDocked:H,error:J.error,sketch:K,status:J.status,onDiscard:G,onOpenChat:z})}}function uU0({active:$,chatDocked:Z,error:J,sketch:H,status:B,onDiscard:Q,onOpenChat:X}){let z=B==="draft";return w5.jsxs("div",{className:G0("relative min-h-0 flex-1 overflow-hidden bg-background",$?"flex":"hidden"),children:[z&&w5.jsx(pU0,{chatDocked:Z,sketch:H}),w5.jsx("div",{inert:z?void 0:!0,className:G0("absolute inset-0",B==="building"&&"pointer-events-none opacity-50",B==="waiting"&&"invisible"),children:w5.jsx(GU,{...H.layerProps,children:z&&w5.jsx(YU,{controls:H.controls,title:"Sketch the view",busy:H.continuing,onComplete:()=>void H.continueInChat()})})}),w5.jsx("div",{"aria-hidden":!0,className:G0("pointer-events-none absolute inset-0 transition-shadow duration-500 ease-in-out",B==="building"&&"animate-glow texture-inset-shadow-50% motion-reduce:animate-none")}),B==="building"&&w5.jsx(dU0,{controls:H.controls}),B==="waiting"&&w5.jsx(cU0,{error:J,onDiscard:Q,onOpenChat:X})]})}function pU0({chatDocked:$,sketch:Z}){let{controls:J,targetRef:H}=Z,{hasStrokes:B}=xB(J);return w5.jsx("div",{ref:H,className:"absolute inset-0 flex items-center justify-center texture-checker-20",children:!J.active&&!B&&w5.jsxs("div",{className:G0("mb-4 flex h-full flex-col items-center justify-center gap-2 p-12 text-center text-sm text-muted-foreground","bg-radial from-background from-10% to-transparent",$?"w-full":"mr-auto w-[calc(100%-var(--chat-max))]"),children:[w5.jsx(tZ,{size:56,stroke:0.5}),w5.jsx("span",{className:"max-w-32",children:"Sketch how the view should look"})]})})}function cU0({error:$,onDiscard:Z,onOpenChat:J}){return w5.jsx(Wa,{children:w5.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 bg-radial from-background from-50% to-transparent to-75% p-12 text-center",children:[w5.jsxs("div",{className:"flex flex-col gap-1",children:[w5.jsx("h1",{className:"font-medium",children:"The view needs your attention"}),w5.jsx("p",{className:"text-sm text-muted-foreground",children:$??"Open the chat to answer or ask the agent to continue"})]}),w5.jsxs("div",{className:"flex gap-2",children:[w5.jsx(j0,{onClick:J,children:"Open chat"}),w5.jsx(j0,{variant:"secondary",onClick:Z,children:"Discard view"})]})]})})}function dU0({controls:$}){let{hasStrokes:Z}=xB($);return w5.jsx(Wa,{children:!Z&&w5.jsx(s4,{className:"size-6 text-muted-foreground"})})}function Wa({children:$,className:Z}){return w5.jsx("div",{className:G0("relative flex min-h-0 flex-1 items-center justify-center texture-checker-20",Z),children:$})}var d4=_(p(),1);function qa($,{activeId:Z,available:J,now:H}){let B=[];if(Z!==null&&J.has(Z))B.push({id:Z,releasedAt:null});for(let Q of $){if(Q.id===Z||!J.has(Q.id))continue;let X=Q.releasedAt??H;if(H-X>=60000)continue;if(B.length>=4)break;B.push({id:Q.id,releasedAt:X})}return B}function Na($,Z){let J=null;for(let{releasedAt:H}of $){if(H===null)continue;let B=H+60000;if(J===null||B<J)J=B}return J===null?null:Math.max(0,J-Z)}function Va($,Z){return $.length===Z.length&&$.every((J,H)=>{let B=Z[H];return J.id===B.id&&J.releasedAt===B.releasedAt})}var w2=_(d(),1),Da=d4.memo(function({views:Z,activeViewId:J,params:H}){let B=lU0(J,Z),Q=new Set(B.map((X)=>X.id));return w2.jsx("div",{className:G0("relative min-h-0 flex-1 overflow-hidden",!J&&"hidden"),children:Z.filter((X)=>Q.has(X.id)).map((X)=>w2.jsx(iU0,{view:X,active:X.id===J,params:H},X.id))})});function lU0($,Z){let[J,H]=d4.useState([]),B=K5(Z),Q=Z.map((z)=>z.id).join(`
68
+ `),X=d4.useCallback(()=>{H((z)=>{let G=qa(z,{activeId:$,available:new Set(B.current.map((K)=>K.id)),now:Date.now()});return Va(z,G)?z:G})},[$,B]);return d4.useEffect(()=>{X()},[Q,X]),d4.useEffect(()=>{let z=Na(J,Date.now());if(z===null)return;let G=setTimeout(X,z);return()=>clearTimeout(G)},[X,J]),J}function iU0({view:$,active:Z,params:J}){let H=e1(),B=gk($.id),{current:Q,outgoing:X}=aU0(B,Z),[z,G]=d4.useState(J);if(Z&&z!==J)G(J);JW(BU("views",H,$.id),Q?.version??B.version,Z);let K=B.status==="error";return bF({kind:"view",enabled:Z&&Boolean(Q)&&!K,targets:[{id:$.id,revision:$.revision}]}),w2.jsxs(w2.Fragment,{children:[Z&&K&&w2.jsx("p",{className:"absolute inset-0 p-4 text-xs text-destructive",children:B.error}),Z&&!K&&!Q&&w2.jsx(oU0,{}),Q&&!K&&w2.jsxs(d4.Activity,{mode:Z?"visible":"hidden",children:[X&&w2.jsx(Aa,{view:$,build:X,params:z},X.version),w2.jsx(Aa,{view:$,build:Q,params:z,entering:X!==null,thumbnailTarget:!0},Q.version)]})]})}function Aa({view:$,build:Z,params:J,entering:H,thumbnailTarget:B}){let Q=e1();return w2.jsx("div",{"data-applet-thumbnail":B?`view:${$.id}`:void 0,"data-applet":QU("views",$.id),className:G0("absolute inset-0 isolate",H&&"animate-in duration-200 ease-out blur-in-4 fade-in"),children:w2.jsx("div",{className:"size-full overflow-auto",children:w2.jsx(bQ,{name:$.id,kind:"view",workspaceId:Q,resetKey:Z.version,children:w2.jsx(Z.Component,{params:J})})})})}var rU0=200;function aU0($,Z){let[J,H]=d4.useState({current:null,outgoing:null});if($.status==="ready"&&J.current?.version!==$.version){let B={Component:$.Component,version:$.version};H((Q)=>({current:B,outgoing:Z?Q.current:null}))}return d4.useEffect(()=>{if(!J.outgoing)return;let B=setTimeout(()=>H((Q)=>({...Q,outgoing:null})),rU0);return()=>clearTimeout(B)},[J.outgoing]),J}function oU0(){return w2.jsx("div",{className:"absolute inset-0 flex animate-in items-center justify-center delay-150 duration-200 fill-mode-both fade-in",children:w2.jsx(s4,{className:"text-muted-foreground"})})}function La(){let $=z1(),{workspaceId:Z,layout:J}=l1(),[,H]=e3(),B=m9(Z).data,Q=ud(Z),X=pd(Z),z=cd(Z),G=dd(Z);return{create:()=>Q.mutateAsync(),save:(W,q)=>X.mutateAsync({builderId:W,requirements:q}),submit:async(W,q)=>{let N=q.trim(),A=pW(Z,W.sessionId);if(!N&&A.length===0)return;dW({queryClient:$,workspaceId:Z,sessionId:W.sessionId,text:N,filenames:A.map((C)=>C.label)});let V=mW(A),D=[...V.parts];if(N)D.push({type:"text",text:N});let L=cW({queryClient:$,workspaceId:Z,sessionId:W.sessionId,parts:D});H(W.sessionId);let{model:j,effort:M,fastMode:P,stream:w}=lW(B,J.selectedModel,J.selectedEffort,J.selectedFastMode);try{await z.mutateAsync({builderId:W.id,requirements:N,optimisticId:L,...A.length>0?{attachments:V.attachments}:{},model:j,effort:M,fastMode:P,stream:w}),k1.getState().clearAttachments(Z,W.sessionId)}catch(C){throw k1.getState().setActivity(Z,W.sessionId,"idle"),k1.getState().setError(Z,W.sessionId,C instanceof Error?C.message:"Could not start view builder"),C}},discard:(W)=>G.mutateAsync(W)}}var J7=_(p(),1);function Ma({builders:$,onSave:Z}){let J=J7.useRef(new Map),H=K5($),B=K5(Z),Q=J7.useCallback((z)=>{let G=J.current.get(z);if(G)clearTimeout(G);J.current.delete(z),C5.getState().setViewBuilderDraft(z,null)},[]),X=J7.useCallback((z,G)=>{C5.getState().setViewBuilderDraft(z,G);let K=J.current.get(z);if(K)clearTimeout(K);J.current.set(z,setTimeout(()=>{J.current.delete(z);let U=H.current.find((Y)=>Y.id===z);if(!U||U.status!=="draft")return;B.current(z,G).catch(()=>{q5.add({title:"Couldn’t save view description",type:"error"})})},500))},[H,B]);return J7.useEffect(()=>{for(let z of $)if(z.status!=="draft")Q(z.id)},[$,Q]),J7.useEffect(()=>()=>{for(let z of J.current.values())clearTimeout(z)},[]),{change:X,clear:Q}}var oJ=_(p(),1);function dP($){let Z=document.documentElement,J=getComputedStyle(Z).getPropertyValue($).trim(),H=Number.parseFloat(J);if(!Number.isFinite(H))return 0;return J.endsWith("rem")?H*Number.parseFloat(getComputedStyle(Z).fontSize):H}function Pa(){let $=oJ.useRef(null),[Z,J]=oJ.useState(null);return oJ.useLayoutEffect(()=>{let H=$.current;if(!H)return;let B=(X)=>{let z=dP("--column-w"),G=dP("--chat-min"),K=dP("--chat-max"),U={fits:X-G>=z,workspaceMinWidth:z,chatMinWidth:G,chatMaxWidth:K};J((Y)=>Y?.fits===U.fits&&Y.workspaceMinWidth===U.workspaceMinWidth&&Y.chatMinWidth===U.chatMinWidth&&Y.chatMaxWidth===U.chatMaxWidth?Y:U)};B(H.getBoundingClientRect().width);let Q=()=>B(H.getBoundingClientRect().width);return window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)},[]),{ref:$,fits:Z?.fits??!1,constraints:Z?{workspaceMinWidth:Z.workspaceMinWidth,chatMinWidth:Z.chatMinWidth,chatMaxWidth:Z.chatMaxWidth}:null}}function _a($,Z){if(Z)return{status:"disconnected"};return $??{status:"checking"}}var ja=_(d(),1);function lP({agentUnavailable:$,chatError:Z,skillUpdate:J}){return $??Z??J}function H7({className:$,...Z}){return ja.jsx("div",{...Z,className:G0("w-full p-2 text-sm @xl:p-1 @xl:pl-3",$)})}var b$=_(d(),1);function iP({error:$,onDismiss:Z,onRetry:J}){return b$.jsxs(H7,{role:"alert",className:"flex items-center gap-2 text-destructive",children:[b$.jsx("span",{className:"flex-1 wrap-break-word",children:$}),J&&b$.jsx(j0,{type:"button",variant:"ghost",size:"sm",onClick:J,children:"Retry"}),Z&&b$.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,className:"text-destructive hover:text-destructive","aria-label":"Dismiss error",children:b$.jsx(a5,{stroke:1.75})})]})}var rP=_(p(),1);var E4=_(d(),1);function wa({availability:$,login:Z,onStartLogin:J}){switch($.status){case"login-required":return E4.jsx(nU0,{login:Z,onStartLogin:J});case"disconnected":return E4.jsx(Oa,{icon:Ea,children:"Reconnecting to moi…"});case"unavailable":return E4.jsx(Oa,{icon:Ta,children:$.reason})}}function nU0({login:$,onStartLogin:Z}){let[J,H]=rP.useState(!1),[B,Q]=rP.useState(null),X=$?.state==="failed"?$.reason:null,z=B??X,G=async()=>{let K=window.open("about:blank","moi-agent-login");if(K)K.opener=null;H(!0),Q(null);try{let U=await Z();if(U.url){if(!K)throw Error("Allow pop-ups, then try again");K.location.href=U.url}else K?.close()}catch(U){K?.close(),Q(U instanceof Error?U.message:"Could not start sign-in")}finally{H(!1)}};return E4.jsxs(H7,{role:"alert",className:"flex items-center gap-2",children:[E4.jsx(Ca,{size:20,stroke:1.5}),E4.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[E4.jsx("div",{className:"wrap-break-word",children:"Log in to your agent to send messages"}),z&&E4.jsx("div",{className:"wrap-break-word text-destructive",children:z})]}),E4.jsxs(j0,{type:"button",size:"sm",onClick:()=>void G(),disabled:J,children:[J&&E4.jsx(b5,{stroke:1.75,className:"animate-spin"}),"Log in"]})]})}function Oa({icon:$,children:Z}){return E4.jsxs(H7,{role:"alert",className:"flex items-center gap-2",children:[E4.jsx($,{size:20,stroke:1.5}),E4.jsx("div",{className:"min-w-0 flex-1 wrap-break-word",children:Z})]})}var u2=_(d(),1);function Ia({error:$,pendingAction:Z,onUpdate:J,onDismiss:H}){if(!$&&Z==="auto")return u2.jsxs(H7,{role:"status",className:"flex items-center gap-1.5 text-muted-foreground",children:[u2.jsx(b5,{size:20,stroke:1.5,className:"shrink-0 animate-spin"}),u2.jsx("span",{className:"wrap-break-word",children:"Updating moi skills…"})]});let B=Z!==null;return u2.jsxs(H7,{role:$?"alert":"status",className:G0("grid grid-cols-[minmax(0,1fr)_auto] gap-x-2 gap-y-2","@xl:flex @xl:items-center",$&&"text-destructive"),children:[u2.jsxs("div",{className:"flex min-w-0 items-start gap-1.5 @xl:order-1 @xl:flex-1 @xl:items-center",children:[u2.jsx(Sa,{size:20,stroke:1.5,className:"shrink-0"}),$?u2.jsx("span",{className:"wrap-break-word",children:`Update failed: ${$}`}):u2.jsx("span",{className:"wrap-break-word",children:"This workspace is using old moi skills"})]}),u2.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm",onClick:H,className:"col-start-2 row-start-1 -mt-1 -mr-1 text-muted-foreground hover:text-foreground @xl:order-4 @xl:m-0","aria-label":"Dismiss skill update",children:u2.jsx(a5,{stroke:1.75})}),u2.jsxs("div",{className:"col-span-2 flex flex-wrap gap-1.5 @xl:contents",children:[u2.jsxs(j0,{type:"button",variant:"default",size:"sm",onClick:()=>J("auto"),disabled:B,className:"@xl:order-2",children:[Z==="auto"&&u2.jsx(b5,{stroke:1.75,className:"animate-spin"}),Z==="auto"?"Updating…":"Auto-update"]}),u2.jsxs(j0,{type:"button",variant:"secondary",size:"sm",onClick:()=>J("once"),disabled:B,className:"@xl:order-3",children:[Z==="once"&&u2.jsx(b5,{stroke:1.75,className:"animate-spin"}),Z==="once"?"Updating…":"Update once"]})]})]})}var B7=_(p(),1);function aP($){return{workspaceId:$,phase:"idle",pendingAction:null,error:null}}function sU0($){return $.phase==="active"||$.phase==="idle"&&$.updateAvailable&&!$.autoUpdateEnabled}function tU0($){return $.updateAvailable&&$.autoUpdateEnabled&&!$.updatePending&&$.phase==="idle"}function Ra($){let Z=dk($),{isPending:J,mutate:H,reset:B}=lk($),Q=Od(),{mutate:X}=Td(),z=Q.data!==void 0,G=Q.data?.autoUpdateSkills??!1,K=B7.useCallback(()=>X({autoUpdateSkills:!0}),[X]),[U,Y]=B7.useState(()=>aP($)),F=U.workspaceId===$?U:aP($);B7.useEffect(()=>{Y(aP($)),B()},[$,B]);let W=B7.useCallback((A)=>{if(J)return;if(A==="auto")K();Y({workspaceId:$,phase:"active",pendingAction:A,error:null}),H(void 0,{onSuccess:()=>{Y((V)=>V.workspaceId===$?{...V,phase:"dismissed",pendingAction:null,error:null}:V)},onError:(V)=>{Y((D)=>D.workspaceId===$&&D.phase!=="dismissed"?{...D,phase:"active",pendingAction:null,error:V.message}:D)}})},[K,J,H,$]),q=Z.data?.updateAvailable??!1;return B7.useEffect(()=>{if(z&&tU0({updateAvailable:q,autoUpdateEnabled:G,updatePending:J,phase:F.phase}))W("auto")},[G,F.phase,W,z,q,J]),{bannerProps:z&&sU0({updateAvailable:q,autoUpdateEnabled:G,phase:F.phase})?{error:F.error,pendingAction:F.pendingAction,onUpdate:W,onDismiss:()=>{Y((A)=>A.workspaceId===$?{...A,phase:"dismissed",pendingAction:null,error:null}:A)}}:null}}var tQ=_(d(),1);function ba($,{chatError:Z,onDismissChatError:J,chatLoadError:H,onRetryChatLoad:B}){let{data:Q,error:X}=m9($),z=Q?.availability,{bannerProps:G}=Ra($),K=_a(z,Boolean(X)),U=K.status==="checking"||K.status==="available"?void 0:K,Y=U?{tone:"default",content:tQ.jsx(wa,{availability:U,login:Q?.login,onStartLogin:()=>ck($)})}:void 0,F;if(H)F={tone:"error",content:tQ.jsx(iP,{error:H,onRetry:B})};else if(Z)F={tone:"error",content:tQ.jsx(iP,{error:Z,onDismiss:J})};let W=G?{tone:"default",content:tQ.jsx(Ia,{...G})}:void 0,q=lP({agentUnavailable:Y,chatError:F,skillUpdate:W}),N=lP({agentUnavailable:Y,skillUpdate:W});return{agentAvailability:K,composerBanner:q,builderComposerBanner:N}}var eU0=zU();function iW($){return ok($)}function Q7($,Z,J){if($==="agent"||$==="overview"||$==="scratchpad")return!0;let H=J$($);if(H)return J.some((Q)=>Q.id===H);let B=IB($);return B?Z.some((Q)=>Q.id===B):!1}function rW($,Z,J){let H=$.open.filter((B)=>Q7(B,Z,J));return H.length>0?H:eU0.open}function ka($,Z,J,H,B){if($!==null&&!(B&&$==="agent"))return $;let Q=rW(Z,J,H),X=B?Q.filter((z)=>z!=="agent"):Q;return X.includes(Z.active)?Z.active:X[0]??"overview"}var X8=_(p(),1);var ya=new Map;function ha({views:$,builders:Z,split:J}){let{layout:H,setLayout:B,workspaceId:Q}=l1(),[,X]=K8(),z=G8(),{base:G}=z,K=Dq(z).slice(aK(Q,G).length+1),U=RB(DX(z)),Y=X8.useMemo(()=>Xk(U),[U]),F=iW(H.tabs),W=K5(F),q=X8.useMemo(()=>{let O=ya.get(Q);if(!O)ya.set(Q,O=new Map);return O},[Q]),N=bB(K),A=N?null:zk(K),V=ka(N??A,F,$,Z,J),D=Boolean(K)&&!A&&(!N||!Q7(N,$,Z)),L=N===V&&!D,j=X8.useCallback((O)=>{W.current=O,B({tabs:O})},[B,W]),M=X8.useCallback((O,S={})=>{let y=window.location.pathname+RB(window.location.search),k=`${G}${O}`;if(y!==k||window.location.hash)X(O,S)},[G,X]),P=X8.useCallback((O,S={})=>{M(q.get(O)??_6(Q,{tab:O,search:""}),S)},[M,q,Q]),w=X8.useCallback((O)=>{if(!O.startsWith("moi:")){let y=H$(Q,O,G);window.location.assign(y);return}let S=SA(O);if(!Q7(S.tab,$,Z))throw Error("This destination is unavailable in this workspace");M(_6(Q,S))},[G,Z,M,$,Q]),C=X8.useCallback((O)=>{let S=O instanceof Error?O.message:"Navigation failed";q5.add({type:"error",title:"Could not navigate",description:S}),n4(Q,{source:"runtime",message:S})},[Q]);JU(Q,"navigate",(O)=>{try{w(O)}catch(S){C(S)}}),xa(Q,w),X8.useEffect(()=>{if(D)return;if(A)M(_6(Q,{tab:A,search:U}),{replace:!0});else if(!K||N==="agent"&&J)P(V,{replace:!0})},[V,M,A,P,K,N,U,J,D,Q]),X8.useEffect(()=>{if(!L)return;q.set(V,_6(Q,{tab:V,search:U}));let O=W.current,S=O.open.includes(V)?O.open:[...O.open,V];if(S!==O.open||O.active!==V)j({open:S,active:V})},[V,L,q,U,j,W,Q]);let R=X8.useCallback((O)=>{if(O.defaultPrevented||O.button!==0||O.metaKey||O.ctrlKey||O.altKey||O.shiftKey)return;let S=O.target instanceof Element?O.target.closest("a[href]"):null;if(!(S instanceof HTMLAnchorElement)||S.hasAttribute("download")||S.target&&S.target!=="_self")return;let y=new URL(S.href),k=aK(Q,G)+"/";if(y.origin!==window.location.origin||!y.pathname.startsWith(k))return;if(y.hash)return;let T=bB(y.pathname.slice(k.length));if(!T)return;O.preventDefault();try{if(!Q7(T,$,Z))throw Error("This destination is unavailable in this workspace");M(_6(Q,{tab:T,search:RB(y.search)}))}catch(b){C(b)}},[G,Z,M,C,$,Q]);return{tabsState:F,activeTab:V,appletParams:Y,navigateToTab:P,setTabs:j,isUnavailable:D,onNavigationClick:R}}var y5=_(d(),1),$Y0=AW([m7({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 ZY0({items:$}){return y5.jsxs(c9,{children:[y5.jsx(d9,{render:y5.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:y5.jsx(h2,{stroke:1.75})})}),y5.jsx(l9,{align:"start",className:"min-w-48",children:y5.jsx(b6,{children:$.map((Z)=>y5.jsxs(n8,{onClick:Z.onClick,className:"font-medium",children:[y5.jsx(Z.Icon,{stroke:2}),Z.label]},Z.key))})})]})}function va($){let{tab:Z,active:J}=$,H=$.preview===!0;return y5.jsxs("button",{type:"button","aria-hidden":H||void 0,"aria-label":Z.label,disabled:H,tabIndex:H?-1:void 0,onClick:$.preview?void 0:()=>$.onSelect(Z.key),className:$Y0({active:J,dragging:$.preview?!1:$.state.isDragging,preview:H}),...$.preview?{}:$.state.dragHandleProps,children:[y5.jsxs("div",{className:G0("flex items-center gap-1 overflow-hidden select-none",Z.closable&&"group-hover/tab:mr-3"),children:[Z.loading?y5.jsx(s4,{"data-icon":"inline-start"}):y5.jsx(Z.Icon,{"data-icon":"inline-start",stroke:2}),y5.jsx("span",{className:G0("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&&y5.jsx("div",{"aria-label":`Close ${Z.label}`,tabIndex:H?-1:void 0,className:G0("absolute right-2 hidden size-3 items-center justify-center text-muted-foreground group-hover/tab:flex hover:text-foreground",H&&"pointer-events-none"),onClick:$.preview?void 0:(B)=>{B.stopPropagation(),$.onClose(Z.key)},children:y5.jsx(a5,{stroke:1.75})})]})}function ga({tabs:$,active:Z,createItems:J,onSelect:H,onClose:B,onReorder:Q}){return y5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[y5.jsx("div",{className:"no-scrollbar min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:y5.jsx(IK,{items:$,getId:(X)=>X.key,isItemDragDisabled:(X)=>X.reorderable===!1,className:"flex w-max items-center gap-1",onReorder:(X)=>Q(X),renderPlaceholder:()=>y5.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-md bg-muted"}),renderOverlay:(X)=>y5.jsx(va,{tab:X,active:Z===X.key,preview:!0}),renderItem:(X,z)=>y5.jsx(va,{tab:X,active:Z===X.key,state:z,onSelect:H,onClose:B})})}),y5.jsx("div",{className:"shrink-0",children:y5.jsx(ZY0,{items:J})})]})}var K7=_(p(),1);var $H=_(d(),1),R1=_(p(),1);function JY0($,Z){let J=getComputedStyle($),H=parseFloat(J.fontSize);return Z*H}function HY0($,Z){let J=getComputedStyle($.ownerDocument.documentElement),H=parseFloat(J.fontSize);return Z*H}function BY0($){return $/100*window.innerHeight}function QY0($){return $/100*window.innerWidth}function XY0($){switch(typeof $){case"number":return[$,"px"];case"string":{let Z=parseFloat($);return $.endsWith("%")?[Z,"%"]:$.endsWith("px")?[Z,"px"]:$.endsWith("rem")?[Z,"rem"]:$.endsWith("em")?[Z,"em"]:$.endsWith("vh")?[Z,"vh"]:$.endsWith("vw")?[Z,"vw"]:[Z,"%"]}}}function eQ({groupSize:$,panelElement:Z,styleProp:J}){let H,[B,Q]=XY0(J);switch(Q){case"%":{H=B/100*$;break}case"px":{H=B;break}case"rem":{H=HY0(Z,B);break}case"em":{H=JY0(Z,B);break}case"vh":{H=BY0(B);break}case"vw":{H=QY0(B);break}}return H}function w4($){return parseFloat($.toFixed(3))}function ZH({group:$}){let{orientation:Z,panels:J}=$;return J.reduce((H,B)=>(H+=Z==="horizontal"?B.element.offsetWidth:B.element.offsetHeight,H),0)}function nP($){let{panels:Z}=$,J=ZH({group:$});return J===0?Z.map((H)=>({groupResizeBehavior:H.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:H.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:H.panelConstraints.disabled,minSize:0,maxSize:100,panelId:H.id})):Z.map((H)=>{let{element:B,panelConstraints:Q}=H,X=0;if(Q.collapsedSize!==void 0){let U=eQ({groupSize:J,panelElement:B,styleProp:Q.collapsedSize});X=w4(U/J*100)}let z;if(Q.defaultSize!==void 0){let U=eQ({groupSize:J,panelElement:B,styleProp:Q.defaultSize});z=w4(U/J*100)}let G=0;if(Q.minSize!==void 0){let U=eQ({groupSize:J,panelElement:B,styleProp:Q.minSize});G=w4(U/J*100)}let K=100;if(Q.maxSize!==void 0){let U=eQ({groupSize:J,panelElement:B,styleProp:Q.maxSize});K=w4(U/J*100)}return{groupResizeBehavior:Q.groupResizeBehavior,collapsedSize:X,collapsible:Q.collapsible===!0,defaultSize:z,disabled:Q.disabled,minSize:G,maxSize:K,panelId:H.id}})}function _5($,Z="Assertion error"){if(!$)throw Error(Z)}function sP($,Z){return Array.from(Z).sort($==="horizontal"?zY0:GY0)}function zY0($,Z){let J=$.element.offsetLeft-Z.element.offsetLeft;return J!==0?J:$.element.offsetWidth-Z.element.offsetWidth}function GY0($,Z){let J=$.element.offsetTop-Z.element.offsetTop;return J!==0?J:$.element.offsetHeight-Z.element.offsetHeight}function Jo($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.ELEMENT_NODE}function Ho($,Z){return{x:$.x>=Z.left&&$.x<=Z.right?0:Math.min(Math.abs($.x-Z.left),Math.abs($.x-Z.right)),y:$.y>=Z.top&&$.y<=Z.bottom?0:Math.min(Math.abs($.y-Z.top),Math.abs($.y-Z.bottom))}}function KY0({orientation:$,rects:Z,targetRect:J}){let H={x:J.x+J.width/2,y:J.y+J.height/2},B,Q=Number.MAX_VALUE;for(let X of Z){let{x:z,y:G}=Ho(H,X),K=$==="horizontal"?z:G;K<Q&&(Q=K,B=X)}return _5(B,"No rect found"),B}var aW;function UY0(){return aW===void 0&&(typeof matchMedia=="function"?aW=!!matchMedia("(pointer:coarse)").matches:aW=!1),aW}function Bo($){let{element:Z,orientation:J,panels:H,separators:B}=$,Q=sP(J,Array.from(Z.children).filter(Jo).map((q)=>({element:q}))).map(({element:q})=>q),X=[],z=!1,G=!1,K=-1,U=-1,Y=0,F,W=[];{let q=-1;for(let N of Q)N.hasAttribute("data-panel")&&(q++,N.hasAttribute("data-disabled")||(Y++,K===-1&&(K=q),U=q))}if(Y>1){let q=-1;for(let N of Q)if(N.hasAttribute("data-panel")){q++;let A=H.find((V)=>V.element===N);if(A){if(F){let V=F.element.getBoundingClientRect(),D=N.getBoundingClientRect(),L;if(G){let j=J==="horizontal"?new DOMRect(V.right,V.top,0,V.height):new DOMRect(V.left,V.bottom,V.width,0),M=J==="horizontal"?new DOMRect(D.left,D.top,0,D.height):new DOMRect(D.left,D.top,D.width,0);switch(W.length){case 0:{L=[j,M];break}case 1:{let P=W[0],w=KY0({orientation:J,rects:[V,D],targetRect:P.element.getBoundingClientRect()});L=[P,w===V?M:j];break}default:{L=W;break}}}else W.length?L=W:L=[J==="horizontal"?new DOMRect(V.right,D.top,D.left-V.right,D.height):new DOMRect(D.left,V.bottom,D.width,D.top-V.bottom)];for(let j of L){let M="width"in j?j:j.element.getBoundingClientRect(),P=UY0()?$.resizeTargetMinimumSize.coarse:$.resizeTargetMinimumSize.fine;if(M.width<P){let C=P-M.width;M=new DOMRect(M.x-C/2,M.y,M.width+C,M.height)}if(M.height<P){let C=P-M.height;M=new DOMRect(M.x,M.y-C/2,M.width,M.height+C)}let w=q<=K||q>U;!z&&!w&&X.push({group:$,groupSize:ZH({group:$}),panels:[F,A],separator:"width"in j?void 0:j,rect:M}),z=!1}}G=!1,F=A,W=[]}}else if(N.hasAttribute("data-separator")){N.ariaDisabled!==null&&(z=!0);let A=B.find((V)=>V.element===N);A?W.push(A):(F=void 0,W=[])}else G=!0}return X}class tP{#$={};addListener($,Z){let J=this.#$[$];return J===void 0?this.#$[$]=[Z]:J.includes(Z)||J.push(Z),()=>{this.removeListener($,Z)}}emit($,Z){let J=this.#$[$];if(J!==void 0)if(J.length===1)J[0].call(null,Z);else{let H=!1,B=null,Q=Array.from(J);for(let X=0;X<Q.length;X++){let z=Q[X];try{z.call(null,Z)}catch(G){B===null&&(H=!0,B=G)}}if(H)throw B}}removeAllListeners(){this.#$={}}removeListener($,Z){let J=this.#$[$];if(J!==void 0){let H=J.indexOf(Z);H>=0&&J.splice(H,1)}}}var tJ={cursorFlags:0,state:"inactive"},eP=new tP;function y$(){return tJ}function YY0($){return eP.addListener("change",$)}function FY0($){let Z=tJ,J={...tJ};J.cursorFlags=$,tJ=J,eP.emit("change",{prev:Z,next:J})}function eJ($){let Z=tJ;tJ=$,eP.emit("change",{prev:Z,next:$})}var WY0=($)=>$,oP=()=>{},Qo=1,Xo=2,zo=4,Go=8,fa=3,ma=12,oW;function ua(){return oW===void 0&&(oW=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(oW=!0)),oW}function qY0({cursorFlags:$,groups:Z,state:J}){let H=0,B=0;switch(J){case"active":case"hover":Z.forEach((Q)=>{if(!Q.mutableState.disableCursor)switch(Q.orientation){case"horizontal":{H++;break}case"vertical":{B++;break}}})}if(!(H===0&&B===0)){switch(J){case"active":{if($&&ua()){let Q=($&Qo)!==0,X=($&Xo)!==0,z=($&zo)!==0,G=($&Go)!==0;if(Q)return z?"se-resize":G?"ne-resize":"e-resize";if(X)return z?"sw-resize":G?"nw-resize":"w-resize";if(z)return"s-resize";if(G)return"n-resize"}break}}return ua()?H>0&&B>0?"move":H>0?"ew-resize":"ns-resize":H>0&&B>0?"grab":H>0?"col-resize":"row-resize"}}var pa=new WeakMap;function $_($){if(!$.defaultView||!$.adoptedStyleSheets)return;let{prevStyle:Z,styleSheet:J}=pa.get($)??{};J===void 0&&(J=new $.defaultView.CSSStyleSheet,$.adoptedStyleSheets&&(Object.isExtensible($.adoptedStyleSheets)?$.adoptedStyleSheets.push(J):$.adoptedStyleSheets=[...$.adoptedStyleSheets,J]));let H=y$();switch(H.state){case"active":case"hover":{let B=qY0({cursorFlags:H.cursorFlags,groups:H.hitRegions.map((X)=>X.group),state:H.state}),Q=`*, *:hover {cursor: ${B} !important; }`;if(Z===Q)return;Z=Q,B?J.cssRules.length===0?J.insertRule(Q):J.replaceSync(Q):J.cssRules.length===1&&J.deleteRule(0);break}case"inactive":{Z=void 0,J.cssRules.length===1&&J.deleteRule(0);break}}pa.set($,{prevStyle:Z,styleSheet:J})}var J3=new Map,Ko=new tP;function NY0($){J3=new Map(J3),J3.delete($)}function ca($,Z){for(let[J]of J3)if(J.id===$)return J}function X7($,Z){for(let[J,H]of J3)if(J.id===$)return H;if(Z)throw Error(`Could not find data for Group with id ${$}`)}function z7(){return J3}function Z_($,Z){return Ko.addListener("groupChange",(J)=>{J.group.id===$&&Z(J)})}function x3($,Z,J){let H=J3.get($);J3=new Map(J3),J3.set($,Z),Ko.emit("groupChange",{group:$,isUserInteraction:J?.isUserInteraction===!0,prev:H,next:Z})}function Uo($){let Z=y$(),J=z7(),H=!1;switch(Z.state){case"active":eJ({cursorFlags:0,state:"inactive"}),Z.hitRegions.length>0&&($_($),H=!0,Z.hitRegions.forEach((B)=>{if(!J.has(B.group))return;let Q=X7(B.group.id,!0);x3(B.group,Q,{isUserInteraction:!0})}))}return H}function da($){$.defaultPrevented||Uo($.currentTarget)}function VY0($,Z,J){let H,B={x:1/0,y:1/0};for(let Q of Z){let X=Ho(J,Q.rect);switch($){case"horizontal":{X.x<=B.x&&(H=Q,B=X);break}case"vertical":{X.y<=B.y&&(H=Q,B=X);break}}}return H?{distance:B,hitRegion:H}:void 0}function AY0($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function DY0($,Z){if($===Z)throw Error("Cannot compare node with itself");let J={a:ra($),b:ra(Z)},H;for(;J.a.at(-1)===J.b.at(-1);)H=J.a.pop(),J.b.pop();_5(H,"Stacking order can only be calculated for elements with a common ancestor");let B={a:ia(la(J.a)),b:ia(la(J.b))};if(B.a===B.b){let Q=H.childNodes,X={a:J.a.at(-1),b:J.b.at(-1)},z=Q.length;for(;z--;){let G=Q[z];if(G===X.a)return 1;if(G===X.b)return-1}}return Math.sign(B.a-B.b)}var LY0=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function MY0($){let Z=getComputedStyle(Yo($)??$).display;return Z==="flex"||Z==="inline-flex"}function PY0($){let Z=getComputedStyle($);return!!(Z.position==="fixed"||Z.zIndex!=="auto"&&(Z.position!=="static"||MY0($))||+Z.opacity<1||("transform"in Z)&&Z.transform!=="none"||("webkitTransform"in Z)&&Z.webkitTransform!=="none"||("mixBlendMode"in Z)&&Z.mixBlendMode!=="normal"||("filter"in Z)&&Z.filter!=="none"||("webkitFilter"in Z)&&Z.webkitFilter!=="none"||("isolation"in Z)&&Z.isolation==="isolate"||LY0.test(Z.willChange)||Z.webkitOverflowScrolling==="touch")}function la($){let Z=$.length;for(;Z--;){let J=$[Z];if(_5(J,"Missing node"),PY0(J))return J}return null}function ia($){return $&&Number(getComputedStyle($).zIndex)||0}function ra($){let Z=[];for(;$;)Z.push($),$=Yo($);return Z}function Yo($){let{parentNode:Z}=$;return AY0(Z)?Z.host:Z}function _Y0($,Z){return $.x<Z.x+Z.width&&$.x+$.width>Z.x&&$.y<Z.y+Z.height&&$.y+$.height>Z.y}function jY0({groupElement:$,hitRegion:Z,pointerEventTarget:J}){if(!Jo(J)||J.contains($)||$.contains(J))return!0;if(DY0(J,$)>0){let H=J;for(;H;){if(H.contains($))return!0;if(_Y0(H.getBoundingClientRect(),Z))return!1;H=H.parentElement}}return!0}function J_($,Z){let J=[];return Z.forEach((H,B)=>{if(B.disabled)return;let Q=Bo(B),X=VY0(B.orientation,Q,{x:$.clientX,y:$.clientY});X&&X.distance.x<=0&&X.distance.y<=0&&jY0({groupElement:B.element,hitRegion:X.hitRegion.rect,pointerEventTarget:$.target})&&J.push(X.hitRegion)}),J}function OY0($,Z){if($.length!==Z.length)return!1;for(let J=0;J<$.length;J++)if($[J]!=Z[J])return!1;return!0}function Y4($,Z,J=0){return Math.abs(w4($)-w4(Z))<=J}function Z3($,Z){return Y4($,Z)?0:$>Z?1:-1}function sJ({overrideDisabledPanels:$,panelConstraints:Z,prevSize:J,size:H}){let{collapsedSize:B=0,collapsible:Q,disabled:X,maxSize:z=100,minSize:G=0}=Z;if(X&&!$)return J;if(Z3(H,G)<0)if(Q){let K=(B+G)/2;Z3(H,K)<0?H=B:H=G}else H=G;return H=Math.min(z,H),H=w4(H),H}function ZX({delta:$,initialLayout:Z,panelConstraints:J,pivotIndices:H,prevLayout:B,trigger:Q}){if(Y4($,0))return Z;let X=Q==="imperative-api",z=Object.values(Z),G=Object.values(B),K=[...z],[U,Y]=H;_5(U!=null,"Invalid first pivot index"),_5(Y!=null,"Invalid second pivot index");let F=0;switch(Q){case"keyboard":{{let N=$<0?Y:U,A=J[N];_5(A,`Panel constraints not found for index ${N}`);let{collapsedSize:V=0,collapsible:D,minSize:L=0}=A;if(D){let j=z[N];if(_5(j!=null,`Previous layout not found for panel index ${N}`),Y4(j,V)){let M=L-j;Z3(M,Math.abs($))>0&&($=$<0?0-M:M)}}}{let N=$<0?U:Y,A=J[N];_5(A,`No panel constraints found for index ${N}`);let{collapsedSize:V=0,collapsible:D,minSize:L=0}=A;if(D){let j=z[N];if(_5(j!=null,`Previous layout not found for panel index ${N}`),Y4(j,L)){let M=j-V;Z3(M,Math.abs($))>0&&($=$<0?0-M:M)}}}break}default:{let N=$<0?Y:U,A=J[N];_5(A,`Panel constraints not found for index ${N}`);let V=z[N],{collapsible:D,collapsedSize:L,minSize:j}=A;if(D&&Z3(V,j)<0)if($>0){let M=j-L,P=M/2,w=V+$;Z3(w,j)<0&&($=Z3($,P)<=0?0:M)}else{let M=j-L,P=100-M/2,w=V-$;Z3(w,j)<0&&($=Z3(100+$,P)>0?0:-M)}break}}{let N=$<0?1:-1,A=$<0?Y:U,V=0;for(;;){let L=z[A];_5(L!=null,`Previous layout not found for panel index ${A}`);let j=sJ({overrideDisabledPanels:X,panelConstraints:J[A],prevSize:L,size:100})-L;if(V+=j,A+=N,A<0||A>=J.length)break}let D=Math.min(Math.abs($),Math.abs(V));$=$<0?0-D:D}{let N=$<0?U:Y;for(;N>=0&&N<J.length;){let A=Math.abs($)-Math.abs(F),V=z[N];_5(V!=null,`Previous layout not found for panel index ${N}`);let D=V-A,L=sJ({overrideDisabledPanels:X,panelConstraints:J[N],prevSize:V,size:D});if(!Y4(V,L)&&(F+=V-L,K[N]=L,F.toFixed(3).localeCompare(Math.abs($).toFixed(3),void 0,{numeric:!0})>=0))break;$<0?N--:N++}}if(OY0(G,K))return B;{let N=$<0?Y:U,A=z[N];_5(A!=null,`Previous layout not found for panel index ${N}`);let V=A+F,D=sJ({overrideDisabledPanels:X,panelConstraints:J[N],prevSize:A,size:V});if(K[N]=D,!Y4(D,V)){let L=V-D,j=$<0?Y:U;for(;j>=0&&j<J.length;){let M=K[j];_5(M!=null,`Previous layout not found for panel index ${j}`);let P=M+L,w=sJ({overrideDisabledPanels:X,panelConstraints:J[j],prevSize:M,size:P});if(Y4(M,w)||(L-=w-M,K[j]=w),Y4(L,0))break;$>0?j--:j++}}}let W=Object.values(K).reduce((N,A)=>A+N,0);if(!Y4(W,100,0.1))return B;let q=Object.keys(B);return K.reduce((N,A,V)=>(N[q[V]]=A,N),{})}function x$($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if(Z[J]===void 0||Z3($[J],Z[J])!==0)return!1;return!0}function h$({layout:$,panelConstraints:Z}){let J=Object.values($),H=[...J],B=H.reduce((z,G)=>z+G,0);if(H.length!==Z.length)throw Error(`Invalid ${Z.length} panel layout: ${H.map((z)=>`${z}%`).join(", ")}`);if(!Y4(B,100)&&H.length>0)for(let z=0;z<Z.length;z++){let G=H[z];_5(G!=null,`No layout data found for index ${z}`);let K=100/B*G;H[z]=K}let Q=0;for(let z=0;z<Z.length;z++){let G=J[z];_5(G!=null,`No layout data found for index ${z}`);let K=H[z];_5(K!=null,`No layout data found for index ${z}`);let U=sJ({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:K});K!=U&&(Q+=K-U,H[z]=U)}if(!Y4(Q,0))for(let z=0;z<Z.length;z++){let G=H[z];_5(G!=null,`No layout data found for index ${z}`);let K=G+Q,U=sJ({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:K});if(G!==U&&(Q-=U-G,H[z]=U,Y4(Q,0)))break}let X=Object.keys($);return H.reduce((z,G,K)=>(z[X[K]]=G,z),{})}function Fo({groupId:$,panelId:Z}){let J=()=>{let G=z7();for(let[K,{defaultLayoutDeferred:U,derivedPanelConstraints:Y,layout:F,groupSize:W,separatorToPanels:q}]of G)if(K.id===$)return{defaultLayoutDeferred:U,derivedPanelConstraints:Y,group:K,groupSize:W,layout:F,separatorToPanels:q};throw Error(`Group ${$} not found`)},H=()=>{let G=J().derivedPanelConstraints.find((K)=>K.panelId===Z);if(G!==void 0)return G;throw Error(`Panel constraints not found for Panel ${Z}`)},B=()=>{let G=J().group.panels.find((K)=>K.id===Z);if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},Q=()=>{let G=J().layout[Z];if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},X=({nextSize:G,panels:K,prevLayout:U,derivedPanelConstraints:Y})=>{let F=Q(),W=K.findIndex((A)=>A.id===Z),q=W===0,N=W===K.length-1;if(N&&G<F&&(q||K.slice(0,W).every((A,V)=>{let D=Y[V];return D?.collapsible&&Y4(D.collapsedSize,U[D.panelId])}))){let A=K.slice(0,W).reduce((V,D)=>V+U[D.id],0);return{...U,[Z]:w4(100-A)}}return ZX({delta:N?F-G:G-F,initialLayout:U,panelConstraints:Y,pivotIndices:N?[W-1,W]:[W,W+1],prevLayout:U,trigger:"imperative-api"})},z=(G)=>{let K=Q();if(G===K)return;let{defaultLayoutDeferred:U,derivedPanelConstraints:Y,group:F,groupSize:W,layout:q,separatorToPanels:N}=J(),A=X({nextSize:G,panels:F.panels,prevLayout:q,derivedPanelConstraints:Y}),V=h$({layout:A,panelConstraints:Y});x$(q,V)||x3(F,{defaultLayoutDeferred:U,derivedPanelConstraints:Y,groupSize:W,layout:V,separatorToPanels:N})};return{collapse:()=>{let{collapsible:G,collapsedSize:K}=H(),{mutableValues:U}=B(),Y=Q();G&&Y!==K&&(U.expandToSize=Y,z(K))},expand:()=>{let{collapsible:G,collapsedSize:K,minSize:U}=H(),{mutableValues:Y}=B(),F=Q();if(G&&F===K){let W=Y.expandToSize??U;W===0&&(W=1),z(W)}},getSize:()=>{let{group:G}=J(),K=Q(),{element:U}=B(),Y=G.orientation==="horizontal"?U.offsetWidth:U.offsetHeight;return{asPercentage:K,inPixels:Y}},isCollapsed:()=>{let{collapsible:G,collapsedSize:K}=H(),U=Q();return G&&Y4(K,U)},resize:(G)=>{let{group:K}=J(),{element:U}=B(),Y=ZH({group:K}),F=eQ({groupSize:Y,panelElement:U,styleProp:G}),W=w4(F/Y*100);z(W)}}}function aa($){if($.defaultPrevented)return;let Z=z7();J_($,Z).forEach((J)=>{if(J.separator&&!J.separator.disableDoubleClick){let H=J.panels.find((B)=>B.panelConstraints.defaultSize!==void 0);if(H){let B=H.panelConstraints.defaultSize,Q=Fo({groupId:J.group.id,panelId:H.id});Q&&B!==void 0&&(Q.resize(B),$.preventDefault())}}})}function nW($){let Z=z7();for(let[J]of Z)if(J.separators.some((H)=>H.element===$))return J;throw Error("Could not find parent Group for separator element")}function Wo({groupId:$}){let Z=()=>{let J=z7();for(let[H,B]of J)if(H.id===$)return{group:H,...B};throw Error(`Could not find Group with id "${$}"`)};return{getLayout(){let{defaultLayoutDeferred:J,layout:H}=Z();return J?{}:H},setLayout(J){let{defaultLayoutDeferred:H,derivedPanelConstraints:B,group:Q,groupSize:X,layout:z,separatorToPanels:G}=Z(),K=h$({layout:J,panelConstraints:B});return H?z:(x$(z,K)||x3(Q,{defaultLayoutDeferred:H,derivedPanelConstraints:B,groupSize:X,layout:K,separatorToPanels:G}),K)}}}function k$($,Z){let J=nW($),H=X7(J.id,!0),B=J.separators.find((U)=>U.element===$);_5(B,"Matching separator not found");let Q=H.separatorToPanels.get(B);_5(Q,"Matching panels not found");let X=Q.map((U)=>J.panels.indexOf(U)),z=Wo({groupId:J.id}).getLayout(),G=ZX({delta:Z,initialLayout:z,panelConstraints:H.derivedPanelConstraints,pivotIndices:X,prevLayout:z,trigger:"keyboard"}),K=h$({layout:G,panelConstraints:H.derivedPanelConstraints});x$(z,K)||x3(J,{defaultLayoutDeferred:H.defaultLayoutDeferred,derivedPanelConstraints:H.derivedPanelConstraints,groupSize:H.groupSize,layout:K,separatorToPanels:H.separatorToPanels},{isUserInteraction:!0})}function oa($){if($.defaultPrevented)return;let Z=$.currentTarget,J=nW(Z);if(!J.disabled)switch($.key){case"ArrowDown":{$.preventDefault(),J.orientation==="vertical"&&k$(Z,5);break}case"ArrowLeft":{$.preventDefault(),J.orientation==="horizontal"&&k$(Z,-5);break}case"ArrowRight":{$.preventDefault(),J.orientation==="horizontal"&&k$(Z,5);break}case"ArrowUp":{$.preventDefault(),J.orientation==="vertical"&&k$(Z,-5);break}case"End":{$.preventDefault(),k$(Z,100);break}case"Enter":{$.preventDefault();let H=nW(Z),B=X7(H.id,!0),{derivedPanelConstraints:Q,layout:X,separatorToPanels:z}=B,G=H.separators.find((F)=>F.element===Z);_5(G,"Matching separator not found");let K=z.get(G);_5(K,"Matching panels not found");let U=K[0],Y=Q.find((F)=>F.panelId===U.id);if(_5(Y,"Panel metadata not found"),Y.collapsible){let F=X[U.id],W=Y.collapsedSize===F?H.mutableState.expandedPanelSizes[U.id]??Y.minSize:Y.collapsedSize;k$(Z,W-F)}break}case"F6":{$.preventDefault();let H=nW(Z).separators.map((X)=>X.element),B=Array.from(H).findIndex((X)=>X===$.currentTarget);_5(B!==null,"Index not found");let Q=$.shiftKey?B>0?B-1:H.length-1:B+1<H.length?B+1:0;H[Q].focus({preventScroll:!0});break}case"Home":{$.preventDefault(),k$(Z,-100);break}}}function na($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;let Z=z7(),J=J_($,Z),H=new Map,B=!1;J.forEach((Q)=>{Q.separator&&(B||(B=!0,Q.separator.element.focus({focusVisible:!1,preventScroll:!0})));let X=Z.get(Q.group);X&&H.set(Q.group,X.layout)}),eJ({cursorFlags:0,hitRegions:J,initialLayoutMap:H,pointerDownAtPoint:{x:$.clientX,y:$.clientY},state:"active"}),J.length&&$.preventDefault()}function qo({document:$,event:Z,hitRegions:J,initialLayoutMap:H,mountedGroups:B,pointerDownAtPoint:Q,prevCursorFlags:X}){let z=0;J.forEach((K)=>{let{group:U,groupSize:Y}=K,{orientation:F,panels:W}=U,{disableCursor:q}=U.mutableState,N=0;Q?F==="horizontal"?N=(Z.clientX-Q.x)/Y*100:N=(Z.clientY-Q.y)/Y*100:F==="horizontal"?N=Z.clientX<0?-100:100:N=Z.clientY<0?-100:100;let A=H.get(U),V=B.get(U);if(!A||!V)return;let{defaultLayoutDeferred:D,derivedPanelConstraints:L,groupSize:j,layout:M,separatorToPanels:P}=V;if(L&&M&&P){let w=ZX({delta:N,initialLayout:A,panelConstraints:L,pivotIndices:K.panels.map((C)=>W.indexOf(C)),prevLayout:M,trigger:"mouse-or-touch"});if(x$(w,M)){if(N!==0&&!q)switch(F){case"horizontal":{z|=N<0?Qo:Xo;break}case"vertical":{z|=N<0?zo:Go;break}}}else x3(K.group,{defaultLayoutDeferred:D,derivedPanelConstraints:L,groupSize:j,layout:w,separatorToPanels:P})}});let G=0;Z.movementX===0?G|=X&fa:G|=z&fa,Z.movementY===0?G|=X&ma:G|=z&ma,FY0(G),$_($)}function sa($){let Z=z7(),J=y$();switch(J.state){case"active":qo({document:$.currentTarget,event:$,hitRegions:J.hitRegions,initialLayoutMap:J.initialLayoutMap,mountedGroups:Z,prevCursorFlags:J.cursorFlags})}}function ta($){if($.defaultPrevented)return;let Z=y$(),J=z7();switch(Z.state){case"active":{if($.buttons===0){eJ({cursorFlags:0,state:"inactive"}),Z.hitRegions.forEach((H)=>{if(!J.has(H.group))return;let B=X7(H.group.id,!0);x3(H.group,B,{isUserInteraction:!0})});return}for(let H of Z.hitRegions)if(H.separator){let{element:B}=H.separator;B.isConnected&&!B.hasPointerCapture?.($.pointerId)&&B.setPointerCapture?.($.pointerId)}qo({document:$.currentTarget,event:$,hitRegions:Z.hitRegions,initialLayoutMap:Z.initialLayoutMap,mountedGroups:J,pointerDownAtPoint:Z.pointerDownAtPoint,prevCursorFlags:Z.cursorFlags});break}default:{let H=J_($,J);H.length===0?Z.state!=="inactive"&&eJ({cursorFlags:0,state:"inactive"}):eJ({cursorFlags:0,hitRegions:H,state:"hover"}),$_($.currentTarget);break}}}function ea($){if($.relatedTarget instanceof HTMLIFrameElement)switch(y$().state){case"hover":eJ({cursorFlags:0,state:"inactive"})}}function $o($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;Uo($.currentTarget)&&$.preventDefault()}function Zo($){let Z=0,J=0,H={};for(let Q of $)if(Q.defaultSize!==void 0){Z++;let X=w4(Q.defaultSize);J+=X,H[Q.panelId]=X}else H[Q.panelId]=void 0;let B=$.length-Z;if(B!==0){let Q=w4((100-J)/B);for(let X of $)X.defaultSize===void 0&&(H[X.panelId]=Q)}return H}function TY0($,Z,J){if(!J[0])return;let H=$.panels.find((G)=>G.element===Z);if(!H||!H.onResize)return;let B=ZH({group:$}),Q=$.orientation==="horizontal"?H.element.offsetWidth:H.element.offsetHeight,X=H.mutableValues.prevSize,z={asPercentage:w4(Q/B*100),inPixels:Q};H.mutableValues.prevSize=z,H.onResize(z,H.id,X)}function CY0($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if($[J]!==Z[J])return!1;return!0}function EY0($,Z){return $.length!==Z.length?!1:$.every((J,H)=>CY0(J,Z[H]))}function wY0({group:$,nextGroupSize:Z,prevGroupSize:J,prevLayout:H}){if(J<=0||Z<=0||J===Z)return H;let B=0,Q=0,X=!1,z=new Map,G=[];for(let Y of $.panels){let F=H[Y.id]??0;switch(Y.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{X=!0;let W=F/100*J,q=w4(W/Z*100);z.set(Y.id,q),B+=q;break}case"preserve-relative-size":default:{G.push(Y.id),Q+=F;break}}}if(!X||G.length===0)return H;let K=100-B,U={...H};if(z.forEach((Y,F)=>{U[F]=Y}),Q>0)for(let Y of G){let F=H[Y]??0;U[Y]=w4(F/Q*K)}else{let Y=w4(K/G.length);for(let F of G)U[F]=Y}return U}function SY0($,Z){let J=$.map((B)=>B.id),H=Object.keys(Z);if(J.length!==H.length)return!1;for(let B of J)if(!H.includes(B))return!1;return!0}var nJ=new Map;function IY0($){let Z=!0;_5($.element.ownerDocument.defaultView,"Cannot register an unmounted Group");let J=$.element.ownerDocument.defaultView.ResizeObserver,H=new Set,B=new Set,Q=new J((q)=>{for(let N of q){let{borderBoxSize:A,target:V}=N;if(V===$.element){if(Z){let D=ZH({group:$});if(D===0)return;let L=X7($.id);if(!L)return;let j=nP($),M=L.defaultLayoutDeferred?Zo(j):L.layout,P=wY0({group:$,nextGroupSize:D,prevGroupSize:L.groupSize,prevLayout:M}),w=h$({layout:P,panelConstraints:j});if(!L.defaultLayoutDeferred&&x$(L.layout,w)&&EY0(L.derivedPanelConstraints,j)&&L.groupSize===D)continue;x3($,{defaultLayoutDeferred:!1,derivedPanelConstraints:j,groupSize:D,layout:w,separatorToPanels:L.separatorToPanels})}}else TY0($,V,A)}});Q.observe($.element),$.panels.forEach((q)=>{_5(!H.has(q.id),`Panel ids must be unique; id "${q.id}" was used more than once`),H.add(q.id),q.onResize&&Q.observe(q.element)});let X=ZH({group:$}),z=nP($),G=$.panels.map(({id:q})=>q).join(","),K=$.mutableState.defaultLayout;K&&(SY0($.panels,K)||(K=void 0));let U=$.mutableState.layouts[G]??K??Zo(z),Y=h$({layout:U,panelConstraints:z}),F=$.element.ownerDocument;nJ.set(F,(nJ.get(F)??0)+1);let W=new Map;return Bo($).forEach((q)=>{q.separator&&W.set(q.separator,q.panels)}),x3($,{defaultLayoutDeferred:X===0,derivedPanelConstraints:z,groupSize:X,layout:Y,separatorToPanels:W}),$.separators.forEach((q)=>{_5(!B.has(q.id),`Separator ids must be unique; id "${q.id}" was used more than once`),B.add(q.id),q.element.addEventListener("keydown",oa)}),nJ.get(F)===1&&(F.addEventListener("contextmenu",da,!0),F.addEventListener("dblclick",aa,!0),F.addEventListener("pointerdown",na,!0),F.addEventListener("pointerleave",sa),F.addEventListener("pointermove",ta),F.addEventListener("pointerout",ea),F.addEventListener("pointerup",$o,!0)),function(){Z=!1,nJ.set(F,Math.max(0,(nJ.get(F)??0)-1)),NY0($),$.separators.forEach((q)=>{q.element.removeEventListener("keydown",oa)}),nJ.get(F)||(F.removeEventListener("contextmenu",da,!0),F.removeEventListener("dblclick",aa,!0),F.removeEventListener("pointerdown",na,!0),F.removeEventListener("pointerleave",sa),F.removeEventListener("pointermove",ta),F.removeEventListener("pointerout",ea),F.removeEventListener("pointerup",$o,!0)),Q.disconnect()}}function RY0(){let[$,Z]=R1.useState({}),J=R1.useCallback(()=>Z({}),[]);return[$,J]}function H_($){let Z=R1.useId();return`${$??Z}`}var v$=typeof window<"u"?R1.useLayoutEffect:R1.useEffect;function $X($){let Z=R1.useRef($);return v$(()=>{Z.current=$},[$]),R1.useCallback((...J)=>Z.current?.(...J),[Z])}function B_(...$){return $X((Z)=>{$.forEach((J)=>{if(J)switch(typeof J){case"function":{J(Z);break}case"object":{J.current=Z;break}}})})}function Q_($){let Z=R1.useRef({...$});return v$(()=>{for(let J in $)Z.current[J]=$[J]},[$]),Z.current}var No=R1.createContext(null);function bY0($,Z){let J=R1.useRef({getLayout:()=>({}),setLayout:WY0});R1.useImperativeHandle(Z,()=>J.current,[]),v$(()=>{Object.assign(J.current,Wo({groupId:$}))})}function X_({children:$,className:Z,defaultLayout:J,disableCursor:H,disabled:B,elementRef:Q,groupRef:X,id:z,onLayoutChange:G,onLayoutChanged:K,orientation:U="horizontal",resizeTargetMinimumSize:Y={coarse:20,fine:10},style:F,...W}){let q=R1.useRef({onLayoutChange:{},onLayoutChanged:{}}),N=$X((S)=>{x$(q.current.onLayoutChange,S)||(q.current.onLayoutChange=S,G?.(S))}),A=$X((S,y)=>{x$(q.current.onLayoutChanged,S)||(q.current.onLayoutChanged=S,K?.(S,{isUserInteraction:y}))}),V=H_(z),D=R1.useRef(null),[L,j]=RY0(),M=R1.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:Y,separators:[]}),P=B_(D,Q);bY0(V,X);let w=$X((S,y)=>{let k=y$(),T=ca(S),b=X7(S);if(b){let I=!1;switch(k.state){case"active":{I=k.hitRegions.some((v)=>v.group===T);break}}return{flexGrow:b.layout[y]??1,pointerEvents:I?"none":void 0}}if(J?.[y])return{flexGrow:J?.[y]}}),C=Q_({defaultLayout:J,disableCursor:H}),R=R1.useMemo(()=>({get disableCursor(){return!!C.disableCursor},getPanelStyles:w,id:V,orientation:U,registerPanel:(S)=>{let y=M.current;return y.panels=sP(U,[...y.panels,S]),j(),()=>{y.panels=y.panels.filter((k)=>k!==S),j()}},registerSeparator:(S)=>{let y=M.current;return y.separators=sP(U,[...y.separators,S]),j(),()=>{y.separators=y.separators.filter((k)=>k!==S),j()}},updatePanelProps:(S,{disabled:y})=>{let k=M.current.panels.find((I)=>I.id===S);k&&(k.panelConstraints.disabled=y);let T=ca(V),b=X7(V);T&&b&&x3(T,{...b,derivedPanelConstraints:nP(T)})},updateSeparatorProps:(S,{disabled:y,disableDoubleClick:k})=>{let T=M.current.separators.find((b)=>b.id===S);T&&(T.disabled=y,T.disableDoubleClick=k)}}),[w,V,j,U,C]),O=R1.useRef(null);return v$(()=>{let S=D.current;if(S===null)return;let y=M.current,k;if(C.defaultLayout!==void 0&&Object.keys(C.defaultLayout).length===y.panels.length){k={};for(let E of y.panels){let i=C.defaultLayout[E.id];i!==void 0&&(k[E.id]=i)}}let T={disabled:!!B,element:S,id:V,mutableState:{defaultLayout:k,disableCursor:!!C.disableCursor,expandedPanelSizes:M.current.lastExpandedPanelSizes,layouts:M.current.layouts},orientation:U,panels:y.panels,resizeTargetMinimumSize:y.resizeTargetMinimumSize,separators:y.separators};O.current=T;let b=IY0(T),{defaultLayoutDeferred:I,derivedPanelConstraints:v,layout:h}=X7(T.id,!0);!I&&v.length>0&&(N(h),A(h,!1));let f=Z_(V,(E)=>{let{defaultLayoutDeferred:i,derivedPanelConstraints:r,layout:x}=E.next;if(i||r.length===0)return;let l=T.panels.map(({id:u})=>u).join(",");T.mutableState.layouts[l]=x,r.forEach((u)=>{if(u.collapsible){let{layout:c}=E.prev??{};if(c){let n=Y4(u.collapsedSize,x[u.panelId]),Z0=Y4(u.collapsedSize,c[u.panelId]);n&&!Z0&&(T.mutableState.expandedPanelSizes[u.panelId]=c[u.panelId])}}});let o=y$().state!=="active";N(x),o&&A(x,E.isUserInteraction)});return()=>{O.current=null,b(),f()}},[B,V,A,N,U,L,C]),R1.useEffect(()=>{let S=O.current;S&&(S.mutableState.defaultLayout=J,S.mutableState.disableCursor=!!H)}),$H.jsx(No.Provider,{value:R,children:$H.jsx("div",{...W,className:Z,"data-group":!0,"data-testid":V,id:V,ref:P,style:{height:"100%",width:"100%",overflow:"hidden",...F,display:"flex",flexDirection:U==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:U==="horizontal"?"pan-y":"pan-x"},children:$})})}X_.displayName="Group";function z_(){let $=R1.useContext(No);return _5($,"Group Context not found; did you render a Panel or Separator outside of a Group?"),$}function kY0($,Z){let{id:J}=z_(),H=R1.useRef({collapse:oP,expand:oP,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:oP});R1.useImperativeHandle(Z,()=>H.current,[]),v$(()=>{Object.assign(H.current,Fo({groupId:J,panelId:$}))})}function G_({children:$,className:Z,collapsedSize:J="0%",collapsible:H=!1,defaultSize:B,disabled:Q,elementRef:X,groupResizeBehavior:z="preserve-relative-size",id:G,maxSize:K="100%",minSize:U="0%",onResize:Y,panelRef:F,style:W,...q}){let N=!!G,A=H_(G),V=Q_({disabled:Q}),D=R1.useRef(null),L=B_(D,X),{getPanelStyles:j,id:M,orientation:P,registerPanel:w,updatePanelProps:C}=z_(),R=Y!==null,O=$X((T,b,I)=>{Y?.(T,G,I)});v$(()=>{let T=D.current;if(T!==null){let b={element:T,id:A,idIsStable:N,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:R?O:void 0,panelConstraints:{groupResizeBehavior:z,collapsedSize:J,collapsible:H,defaultSize:B,disabled:V.disabled,maxSize:K,minSize:U}};return w(b)}},[z,J,H,B,R,A,N,K,U,O,w,V]),R1.useEffect(()=>{C(A,{disabled:Q})},[Q,A,C]),kY0(A,F);let S=()=>{let T=j(M,A);if(T)return JSON.stringify(T)},y=R1.useSyncExternalStore((T)=>Z_(M,T),S,S),k;return y?k=JSON.parse(y):B!==void 0?k={flexGrow:void 0,flexShrink:void 0,flexBasis:B}:k={flexGrow:1},$H.jsx("div",{...q,"data-disabled":Q||void 0,"data-panel":!0,"data-testid":A,id:A,ref:L,style:{...yY0,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...k},children:$H.jsx("div",{className:Z,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...W,touchAction:P==="horizontal"?"pan-y":"pan-x"},children:$})})}G_.displayName="Panel";var yY0={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function xY0({layout:$,panelConstraints:Z,panelId:J,panelIndex:H}){let B,Q,X=$[J],z=Z.find((G)=>G.panelId===J);if(z){let G=z.maxSize,K=z.collapsible?z.collapsedSize:z.minSize,U=[H,H+1];Q=h$({layout:ZX({delta:K-X,initialLayout:$,panelConstraints:Z,pivotIndices:U,prevLayout:$}),panelConstraints:Z})[J],B=h$({layout:ZX({delta:G-X,initialLayout:$,panelConstraints:Z,pivotIndices:U,prevLayout:$}),panelConstraints:Z})[J]}return{valueControls:J,valueMax:B,valueMin:Q,valueNow:X}}function K_({children:$,className:Z,disabled:J,disableDoubleClick:H,elementRef:B,id:Q,style:X,...z}){let G=H_(Q),K=Q_({disabled:J,disableDoubleClick:H}),[U,Y]=R1.useState({}),[F,W]=R1.useState("inactive"),[q,N]=R1.useState(!1),A=R1.useRef(null),V=B_(A,B),{disableCursor:D,id:L,orientation:j,registerSeparator:M,updateSeparatorProps:P}=z_(),w=j==="horizontal"?"vertical":"horizontal";v$(()=>{let O=A.current;if(O!==null){let S={disabled:K.disabled,disableDoubleClick:K.disableDoubleClick,element:O,id:G},y=M(S),k=YY0((b)=>{W(b.next.state!=="inactive"&&b.next.hitRegions.some((I)=>I.separator===S)?b.next.state:"inactive")}),T=Z_(L,(b)=>{let{derivedPanelConstraints:I,layout:v,separatorToPanels:h}=b.next,f=h.get(S);if(f){let E=f[0],i=I.findIndex((r)=>r.panelId===E.id);Y(xY0({layout:v,panelConstraints:I,panelId:E.id,panelIndex:i}))}});return()=>{k(),T(),y()}}},[L,G,M,K]),R1.useEffect(()=>{P(G,{disabled:J,disableDoubleClick:H})},[J,H,G,P]);let C;J&&!D&&(C="not-allowed");let R;if(J)R="disabled";else switch(F){case"active":{R="active";break}default:q?R="focus":R=F}return $H.jsx("div",{...z,"aria-controls":U.valueControls,"aria-disabled":J||void 0,"aria-orientation":w,"aria-valuemax":U.valueMax,"aria-valuemin":U.valueMin,"aria-valuenow":U.valueNow,children:$,className:Z,"data-separator":R,"data-testid":G,id:G,onBlur:()=>N(!1),onFocus:()=>N(!0),ref:V,role:"separator",style:{flexBasis:"auto",cursor:C,...X,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:J?void 0:0})}K_.displayName="Separator";var sW=_(d(),1);function Vo({className:$,...Z}){return sW.jsx(X_,{"data-slot":"resizable-panel-group",className:G1("flex h-full w-full aria-[orientation=vertical]:flex-col",$),...Z})}function U_({...$}){return sW.jsx(G_,{"data-slot":"resizable-panel",...$})}function Ao({showDivider:$=!0,className:Z,...J}){return sW.jsx(K_,{"data-slot":"resizable-handle",className:G1("relative flex items-center justify-center ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2",$?"w-px bg-border aria-[orientation=horizontal]:h-px":"w-0 aria-[orientation=horizontal]:h-0",Z),...J})}var G7=_(d(),1);function Do({workspace:$,chat:Z,open:J,workspaceMinWidth:H,chatMinWidth:B,chatMaxWidth:Q,chatWidth:X,onCollapse:z,onChatWidthChange:G}){let K=K7.useRef(null),U=K7.useRef(null),[Y,F]=K7.useState(!1),W=Math.min(Math.max(X,B),Q),[q]=K7.useState(()=>J?W:0);return K7.useLayoutEffect(()=>{let N=K.current;if(!N)return;if(J)N.resize(W);else N.collapse()},[W,J]),G7.jsxs(Vo,{orientation:"horizontal",className:G0("overflow-visible!",Y&&"[&>#chat]:transition-[flex-grow] [&>#chat]:duration-200 [&>#chat]:ease-in-out motion-reduce:[&>#chat]:transition-none!",Y&&"has-[[data-separator=active]]:[&>#chat]:transition-none!"),onLayoutChanged:(N,A)=>{if(!Y&&U.current===null)U.current=requestAnimationFrame(()=>{F(!0)});if(A.isUserInteraction)requestAnimationFrame(()=>{let V=K.current;if(!V)return;let D=V.getSize();if(D.inPixels>0)G(Math.round(D.inPixels))})},children:[G7.jsx(U_,{id:"workspace",className:"overflow-visible!",minSize:H,children:G7.jsx("div",{"data-slot":"workspace-split-workspace",className:"flex h-full min-h-0 min-w-0 flex-col",children:$})}),G7.jsx(Ao,{"aria-label":"Resize chat",showDivider:!1,hidden:!J,disabled:!J}),G7.jsx(U_,{id:"chat","aria-hidden":!J,inert:!J,collapsible:!0,collapsedSize:0,defaultSize:q,minSize:B,maxSize:Q,groupResizeBehavior:"preserve-pixel-size",panelRef:K,onResize:(N,A,V)=>{if(J&&N.inPixels===0&&V&&V.inPixels>0)z()},className:G0("overflow-hidden!",Y&&"transition-opacity duration-200 ease-in-out motion-reduce:transition-none",J?"opacity-100":"opacity-0"),children:G7.jsx("div",{"data-slot":"workspace-split-chat",className:"flex h-full min-h-0 min-w-(--chat-min) flex-col",children:Z})})]})}var g$=_(d(),1);function Lo({onOpenOverview:$}){return g$.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[g$.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[g$.jsx(VY,{size:56,stroke:0.5,"aria-hidden":!0}),g$.jsx("p",{className:"text-sm",children:"There's no such page in this workspace"})]}),g$.jsx(j0,{variant:"secondary",onClick:$,children:"Back to overview"})]})}var T1=_(d(),1),vY0=G2.lazy(()=>import("/chunk-brr0zbeh.js").then(($)=>({default:$.Scratchpad}))),_o=($)=>u7($.icon)??WJ;function gY0($,Z,J,H,B,Q){if($==="agent")return{key:$,Icon:oB,label:"Agent",closable:H,loading:B};if($==="overview")return{key:$,Icon:AY,label:"Overview",closable:!1,reorderable:!1};if($==="scratchpad")return{key:$,Icon:nB,label:"Scratchpad",closable:H};let X=J$($),z=X?J.find((U)=>U.id===X):null;if(z)return{key:$,Icon:_o(z),label:z.title||z.viewId||"New view",closable:H,loading:Q(z.sessionId)};let G=IB($),K=G?Z.find((U)=>U.id===G):null;return K?{key:$,Icon:IQ(K,J),label:SQ(K),closable:H}:null}function fY0($,Z,J){let H=new Set(Z),B=0;return $.map((Q)=>H.has(Q)?J[B++]:Q)}function mY0({onOpenTheme:$}){let{layout:Z,name:J,provider:H}=l1(),[B,Q]=G2.useState(!1);return T1.jsx(oF,{children:T1.jsxs(c9,{children:[T1.jsxs(d9,{className:"flex min-w-0 cursor-pointer items-center gap-2 rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50","aria-label":`${J??"Workspace"} menu`,onPointerEnter:()=>Q(!0),onPointerLeave:()=>Q(!1),children:[T1.jsx(A6,{icon:B?{...Z.icon,type:"glyph",value:"dots"}:Z.icon,workspaceType:H,workspaceTheme:Z.theme,className:"size-5 rounded-sm"}),J&&T1.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:J})]}),T1.jsx(l9,{align:"start",sideOffset:6,className:"w-36",children:T1.jsxs(b6,{children:[T1.jsxs(n8,{onClick:$,children:[T1.jsx(vW,{stroke:1.75}),"Theme"]}),T1.jsxs(n8,{nativeButton:!0,render:T1.jsx(D3,{}),className:"w-full",children:[T1.jsx(Q6,{stroke:1.75}),"Settings"]})]})})]})})}function jo({widgets:$,views:Z,builders:J}){let{layout:H,setLayout:B,workspaceId:Q}=l1(),X=i8(H.theme),z=La(),{ref:G,fits:K,constraints:U}=Pa(),[Y,F]=G2.useState("idle"),[W,q]=G2.useState(!1),[N,A]=G2.useState(0),V=G2.useRef(new Map),D=C5((q0)=>q0.dockedChatWidth),L=C5((q0)=>q0.setDockedChatWidth),j=x2((q0)=>q0.activity),M=uz(j,Q),P=Ma({builders:J,onSave:(q0,P0)=>z.save(q0,P0)});Qk(H.theme);let w=rW(iW(H.tabs),Z,J),C=w.filter((q0)=>q0!=="agent"),R=C.length>0,O=$.some((q0)=>!u9(q0.id)),S=O||Z.length>0,k=H.layoutMode==="split"&&R&&K?"split":"fullscreen",T=k==="split",{tabsState:b,activeTab:I,appletParams:v,navigateToTab:h,setTabs:f,isUnavailable:E,onNavigationClick:i}=ha({views:Z,builders:J,split:T}),{view:r,chatLoaded:x,previewTurn:l,sessionId:o,processing:u,error:c,loadError:n,retryLoad:Z0,send:J0,stop:X0,selectSession:Q0,dismissError:F0}=Ka({activeTab:I,appletParams:v}),{composerBanner:A0,builderComposerBanner:N0,agentAvailability:Y0}=ba(Q,{chatError:c,onDismissChatError:F0,chatLoadError:n,onRetryChatLoad:Z0}),s=new Set(b.open),a=(q0)=>{B({layoutMode:q0})},e=T?C:w,$0=w.length>1,B0=e.map((q0)=>gY0(q0,Z,J,$0||J$(q0)!==null,M,(P0)=>kH(j,Q,P0))).filter((q0)=>Boolean(q0)),_0=IB(I),M0=_0?Z.find((q0)=>q0.id===_0):void 0,V0=J$(I),L0=V0?J.find((q0)=>q0.id===V0):void 0,g=L0?.status==="draft"&&!kH(j,Q,L0.sessionId)?L0:void 0,m=g?.id,t=Y==="idle"&&(I==="overview"&&O||M0!==void 0),{controls:W0,docked:R0,layerProps:c0,popup:f0,targetRef:T0}=Yy({workspaceId:Q,sessionId:o,activeTab:I,mode:k,available:t,closePopup:()=>q(!1),openPopup:()=>q(!0)});G2.useEffect(()=>{if(b.open.filter((l0)=>Q7(l0,Z,J)).length===b.open.length)return;let P0=rW(b,Z,J);B({tabs:{open:P0,active:P0.includes(b.active)?b.active:P0[0]}})},[J,B,b,Z]),G2.useEffect(()=>{let q0=new Map;for(let y0 of J){if(y0.status!=="ready"||!y0.viewId)continue;if(!Z.some((X1)=>X1.id===y0.viewId))continue;q0.set(Z$(y0.id),lZ(y0.viewId))}if(q0.size===0)return;let P0=q0.get(I);if(P0)h(P0,{replace:!0});let l0=new Set(q0.values()),Q1=new Map([...q0].map(([y0,X1])=>[X1,y0])),j1=[],k0=!1;for(let y0 of b.open){let X1=Q1.get(y0);if(l0.has(y0)&&X1&&b.open.includes(X1)){k0=!0;continue}let S1=q0.get(y0),b1=S1??y0;if(S1)k0=!0;if(!j1.includes(b1))j1.push(b1)}if(!k0)return;let r0=q0.get(b.active)??b.active;B({tabs:{open:j1.length>0?j1:["overview"],active:r0}})},[I,J,h,B,b,Z]),G2.useEffect(()=>{if(k!=="fullscreen"||I==="agent")q(!1)},[I,k]),G2.useEffect(()=>{if(!m)return;if(k==="fullscreen")q(!0);A((q0)=>q0+1)},[m,k]);let x0=(q0)=>{if(h(q0),q0==="agent")q(!1),A((P0)=>P0+1)},Z1=()=>{z.create().then((q0)=>x0(Z$(q0.id)))},W1=(q0)=>{if(q0==="views"){let P0=Z[0];if(P0)x0(lZ(P0.id));else Z1()}else x0(q0);q(!1)};K2((q0)=>{if(q0.type==="view:deleted"&&q0.workspaceId===Q&&I===lZ(q0.name))x0("overview")});let d0=(q0)=>{if(q0==="overview")return;let P0=J$(q0),l0=P0?J.find((y0)=>y0.id===P0):void 0;if(!$0&&!l0||!s.has(q0))return;let Q1=b.open.filter((y0)=>y0!==q0);if(Q1.length===0)Q1=["overview"];let j1=e.indexOf(q0),k0=e[j1+1]??e[j1-1]??Q1.find((y0)=>Q7(y0,Z,J))??"overview",r0=b.active===q0||!Q1.includes(b.active)?k0:b.active;if(f({open:Q1,active:r0}),I===q0)h(k0);if(l0?.status==="draft")V.current.get(l0.id)?.resetSketch(),P.clear(l0.id),z.discard(l0.id)},v0=(q0)=>{let P0=Z$(q0.id);if(s.has(P0)){let l0=b.open.filter((Q1)=>Q1!==P0);if(l0.length===0)l0=["overview"];if(f({open:l0,active:b.active===P0?l0[0]:b.active}),I===P0)h(l0[0])}V.current.get(q0.id)?.resetSketch(),P.clear(q0.id),z.discard(q0.id)},w1=(q0)=>{let P0=fY0(b.open,e,q0);if(P0===b.open)return;f({open:P0,active:b.active})},B1=(q0)=>{if(q0!==void 0)C5.getState().setComposerDraft(Q,q0);if(k==="fullscreen"&&I!=="agent"){if(q(!0),W)A((P0)=>P0+1);return}A((P0)=>P0+1)};Ha({sessionId:o,send:J0,revealChat:B1,agentAvailability:Y0}),Ba(o,B1);let s1=[...!T&&!s.has("agent")?[{key:"agent",Icon:oB,label:"Agent",onClick:()=>x0("agent")}]:[],...!s.has("scratchpad")?[{key:"scratchpad",Icon:nB,label:"Scratchpad",onClick:()=>x0("scratchpad")}]:[],...Z.map((q0)=>({view:q0,tab:lZ(q0.id)})).filter(({tab:q0})=>!s.has(q0)).map(({view:q0,tab:P0})=>({key:P0,Icon:IQ(q0,J),label:SQ(q0),onClick:()=>x0(P0)})),...J.filter((q0)=>q0.status!=="ready").map((q0)=>({builder:q0,tab:Z$(q0.id)})).filter(({tab:q0})=>!s.has(q0)).map(({builder:q0,tab:P0})=>({key:P0,Icon:_o(q0),label:q0.title||q0.viewId||"New view",onClick:()=>x0(P0)})),{key:"create-view",Icon:Mo,label:"New view",onClick:Z1}],C0=G2.useCallback((q0)=>{if(g)P.change(g.id,q0)},[g,P]),p0=G2.useCallback(()=>{if(g)V.current.get(g.id)?.resetSketch()},[g]),i0=G2.useCallback(async(q0)=>{if(!g)return;await V.current.get(g.id)?.prepareSketchForSend(),await z.submit(g,q0),P.clear(g.id)},[g,z,P]),a0=g?{sessionId:g.sessionId,builderId:g.id,initialValue:g.input.requirements,onChange:C0,onRemoveDrawing:p0,onSubmit:i0}:void 0,A1=T1.jsx(wF,{agent:X.agent,active:k==="split",focusRequest:N,chatLoaded:x,hasWorkspaceApplets:S,view:r,previewTurn:l,sessionId:o,processing:u,composerBanner:g?N0:A0,agentAvailability:Y0,send:J0,stop:X0,onNavigateFromWelcome:W1,onClose:()=>a("fullscreen"),annotation:R0,builderDraft:a0,docked:!0}),D1=T1.jsx(wF,{agent:X.agent,active:k==="fullscreen"&&I==="agent",focusRequest:N,chatLoaded:x,hasWorkspaceApplets:S,view:r,previewTurn:l,sessionId:o,processing:u,composerBanner:A0,agentAvailability:Y0,send:J0,stop:X0,onNavigateFromWelcome:W1}),u1=T1.jsxs("div",{className:G0("@container/workspace relative flex h-full min-h-0 min-w-0 flex-1 flex-col-reverse overflow-hidden bg-background shadow-md transition-[border-radius,background-color] duration-100 ease-out motion-reduce:transition-none",k==="split"&&"rounded-xl"),children:[T1.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[T1.jsxs("div",{ref:T0,inert:W0.active||void 0,"aria-hidden":W0.active||void 0,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background transition-colors duration-100 ease-out motion-reduce:transition-none",children:[E?T1.jsx(Lo,{onOpenOverview:()=>x0("overview")}):I==="agent"?D1:I==="overview"?T1.jsx(ar,{customizing:Y==="customizing",theming:Y==="theming",onThemingChange:(q0)=>F(q0?"theming":"idle"),onCustomizingChange:(q0)=>F(q0?"customizing":"idle"),widgets:$,views:Z,builders:J,onOpenView:(q0)=>x0(lZ(q0)),onCreateView:Z1,onCreateWidget:()=>{Q0(null),B1("Create widget")}}):I==="scratchpad"?T1.jsx(G2.Suspense,{fallback:null,children:T1.jsx(vY0,{})}):null,J.filter((q0)=>q0.status!=="ready").map((q0)=>T1.jsx(Fa,{ref:(P0)=>{if(P0)V.current.set(q0.id,P0);else V.current.delete(q0.id)},active:!E&&L0?.id===q0.id,builder:q0,chatDocked:k==="split",workspaceId:Q,onEditingStart:()=>{if(k==="fullscreen")q(!1)},onContinueInChat:B1,onOpenChat:()=>{Q0(q0.sessionId),B1()},onDiscard:()=>v0(q0)},q0.id)),T1.jsx(Da,{views:Z,activeViewId:E?null:M0?.id??null,params:v})]}),T1.jsx(GU,{...c0,children:T1.jsx(YU,{controls:W0,title:"Draw annotation",busy:W0.finishing,onComplete:()=>void W0.finish()})})]}),T1.jsx(L4,{children:Y==="theming"&&T1.jsx(Hd,{onClose:()=>F("idle")})}),T1.jsxs(or,{children:[T1.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[T1.jsx(mY0,{onOpenTheme:()=>F("theming")}),T1.jsx(ga,{tabs:B0,active:I,createItems:s1,onSelect:x0,onClose:d0,onReorder:w1})]}),R&&K&&k==="fullscreen"&&T1.jsxs(B5,{children:[T1.jsx(Q5,{render:T1.jsx(j0,{variant:"ghost",size:"icon-sm",onClick:()=>a("split"),"aria-label":"Dock agent",className:"text-muted-foreground",children:T1.jsx(Po,{stroke:1.75})})}),T1.jsx(X5,{children:"Dock agent"})]})]})]});return T1.jsxs("div",{onClick:i,className:"relative flex h-full min-h-0 flex-col font-sans text-foreground",children:[T1.jsx("div",{ref:G,className:"flex min-h-0 flex-1",children:R&&K&&U?T1.jsx(Do,{...U,workspace:u1,chat:A1,open:k==="split",chatWidth:D,onCollapse:()=>a("fullscreen"),onChatWidthChange:L}):u1}),k==="fullscreen"&&I!=="agent"&&R&&T1.jsx(Jd,{agent:X.agent,loading:M,open:W,onOpenChange:q,onOpenChangeComplete:(q0)=>{if(q0)A((P0)=>P0+1)},children:(q0)=>T1.jsx(wF,{agent:X.agent,active:W,focusRequest:N,chatLoaded:x,hasWorkspaceApplets:S,view:r,previewTurn:l,sessionId:o,processing:u,composerBanner:g?N0:A0,agentAvailability:Y0,send:J0,stop:X0,onNavigateFromWelcome:W1,onClose:q0,annotation:f0,builderDraft:a0})})]})}var To=_(p(),1);var tW=_(p(),1);function uY0($){return new Map($.map((Z)=>[Z.id,{w:Z.config.colSpan,h:Z.config.rowSpan}]))}function pY0($,Z,J){let H=new Set($.map((U)=>U.i)),B=Z.filter((U)=>{let Y=J.get(U.id);if(!Y)return!H.has(U.id);if(!H.has(U.id))return!1;return Y.w!==U.config.colSpan||Y.h!==U.config.rowSpan});if(B.length===0)return null;let Q=new Set(B.map((U)=>U.id)),X=new Map(Z.map((U)=>[U.id,U.config])),z=$.filter((U)=>!Q.has(U.i)&&X.has(U.i)).map((U)=>{let Y=X.get(U.i);return{...U,w:Y.colSpan,h:Y.rowSpan}}),G=z.map(({i:U,x:Y,y:F})=>({i:U,x:Y,y:F})),K=[...z];for(let U of B){let Y=$W(K,U.config.colSpan,U.config.rowSpan);G.push({i:U.id,...Y}),K.push({i:U.id,...Y,w:U.config.colSpan,h:U.config.rowSpan})}return G}function Oo($,Z,J,H){let B=tW.useRef(null);tW.useEffect(()=>{if(!Z)return;let Q=uY0(Z);if(B.current?.workspaceId!==$){B.current={workspaceId:$,sizes:Q};return}let X=pY0(J.widgetGrid,Z,B.current.sizes);if(B.current={workspaceId:$,sizes:Q},X)H({widgetGrid:X})},[$,Z,J.widgetGrid,H])}function Co($){let{layout:Z,setLayout:J}=l1(),H=J5({queryKey:S0.widgets($),queryFn:async()=>{return(await q1(`/api/workspaces/${$}/widgets`)).widgets},...v4}),B=To.useMemo(()=>rk(H.data??[]),[H.data]);return Oo($,H.data?B:void 0,Z,J),{...H,data:B}}var X9=_(d(),1);function wo({id:$}){return X9.jsx(Eo,{id:$,children:X9.jsx(ek,{id:$,children:X9.jsx(cY0,{id:$})})})}function cY0({id:$}){let Z=z1(),[J]=e3(),{isLoading:H}=l1(),B=Co($),Q=sF($),X=eF($);fk(),K2((G)=>{if(G.type==="theme:updated"||G.type==="workspace:updated")Z.invalidateQueries({queryKey:S0.layout($)});else if(G.type==="widget-layout:updated"||G.type==="widget:updated")Z.invalidateQueries({queryKey:S0.widgets($)});else if(G.type==="view-layout:updated"||G.type==="view:updated")Z.invalidateQueries({queryKey:S0.views($)})});let z=H||J===void 0||B.isLoading||Q.isLoading||X.isLoading;return X9.jsx(X9.Fragment,{children:X9.jsx(RK,{children:z?X9.jsx("div",{className:"flex h-full items-center justify-center",children:X9.jsx(Mk,{sprite:"moi",effect:"chaos"})}):X9.jsx(jo,{widgets:B.data,views:Q.data??[],builders:X.data??[]})})})}var H3=_(d(),1),So=null;function dY0(){if(!So)return H3.jsx(Kj,{to:"/"});return H3.jsx(eW.Suspense,{fallback:null,children:H3.jsx(So,{})})}function Io(){let[,$]=K8();return eW.useEffect(()=>{return aN((Z)=>$(`/workspace/${Z}`)),()=>aN(null)},[$]),H3.jsxs(Gj,{children:[H3.jsx(LX,{path:"/",component:qk}),H3.jsx(LX,{path:"/dev/*?",component:dY0}),H3.jsx(LX,{path:"/workspace/:id/*?",children:(Z)=>H3.jsx(wo,{id:Z.id},Z.id)})]})}var U7=_(d(),1),bo=new Wq;QE(bo);dC();function WT1($){function Z(){return U7.jsx(Hq,{client:bo,children:U7.jsxs(gz,{children:[U7.jsx(Pq,{children:U7.jsx(Io,{})}),U7.jsx(zC,{}),!1]})})}Ro.createRoot($).render(U7.jsx(Z,{}))}export{WT1 as mount};