discord-mana-ui 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/README.md +30 -0
  2. package/dist/blocks.js +2 -2
  3. package/dist/cdn/mana-elements.min.js +1 -1
  4. package/dist/cdn/mana-elements.min.js.map +1 -1
  5. package/dist/chunks/{index-CHySFM5G.js → index-Ddlxo4pD.js} +7 -4
  6. package/dist/chunks/{index-CHySFM5G.js.map → index-Ddlxo4pD.js.map} +1 -1
  7. package/dist/chunks/{index-DXemhxg8.js → index-NOEHpd5T.js} +2 -2
  8. package/dist/chunks/{index-DXemhxg8.js.map → index-NOEHpd5T.js.map} +1 -1
  9. package/dist/chunks/{overlays-DPkXgsLR.js → overlays-Bd04Wxig.js} +2 -2
  10. package/dist/chunks/{overlays-DPkXgsLR.js.map → overlays-Bd04Wxig.js.map} +1 -1
  11. package/dist/core.js +1 -1
  12. package/dist/elements-svelte.d.ts +7 -0
  13. package/dist/elements.js +2 -2
  14. package/dist/index.js +2 -2
  15. package/dist/react.js +2 -2
  16. package/dist/svelte/HeadingLevelProvider.svelte +20 -0
  17. package/dist/svelte/HeadingLevelProvider.svelte.d.ts +8 -0
  18. package/dist/svelte/HiddenVisually.svelte +27 -0
  19. package/dist/svelte/HiddenVisually.svelte.d.ts +10 -0
  20. package/dist/svelte/ManaProvider.svelte +77 -0
  21. package/dist/svelte/ManaProvider.svelte.d.ts +18 -0
  22. package/dist/svelte/ThemeProvider.svelte +47 -0
  23. package/dist/svelte/ThemeProvider.svelte.d.ts +13 -0
  24. package/dist/svelte/actions.d.ts +15 -0
  25. package/dist/svelte/actions.js +108 -0
  26. package/dist/svelte/blocks/AppShell.svelte +100 -0
  27. package/dist/svelte/blocks/AppShell.svelte.d.ts +22 -0
  28. package/dist/svelte/blocks/AppSidebar.svelte +117 -0
  29. package/dist/svelte/blocks/AppSidebar.svelte.d.ts +25 -0
  30. package/dist/svelte/blocks/AppStatusBar.svelte +23 -0
  31. package/dist/svelte/blocks/AppStatusBar.svelte.d.ts +10 -0
  32. package/dist/svelte/blocks/AppTag.svelte +23 -0
  33. package/dist/svelte/blocks/AppTag.svelte.d.ts +8 -0
  34. package/dist/svelte/blocks/AppTopBar.svelte +48 -0
  35. package/dist/svelte/blocks/AppTopBar.svelte.d.ts +13 -0
  36. package/dist/svelte/blocks/ChannelSidebar.svelte +97 -0
  37. package/dist/svelte/blocks/ChannelSidebar.svelte.d.ts +24 -0
  38. package/dist/svelte/blocks/Embed.svelte +111 -0
  39. package/dist/svelte/blocks/Embed.svelte.d.ts +24 -0
  40. package/dist/svelte/blocks/GuildRail.svelte +135 -0
  41. package/dist/svelte/blocks/GuildRail.svelte.d.ts +30 -0
  42. package/dist/svelte/blocks/HeaderBar.svelte +75 -0
  43. package/dist/svelte/blocks/HeaderBar.svelte.d.ts +23 -0
  44. package/dist/svelte/blocks/MemberList.svelte +88 -0
  45. package/dist/svelte/blocks/MemberList.svelte.d.ts +24 -0
  46. package/dist/svelte/blocks/MessageComposer.svelte +79 -0
  47. package/dist/svelte/blocks/MessageComposer.svelte.d.ts +14 -0
  48. package/dist/svelte/blocks/MessageDivider.svelte +41 -0
  49. package/dist/svelte/blocks/MessageDivider.svelte.d.ts +9 -0
  50. package/dist/svelte/blocks/MessageItem.svelte +198 -0
  51. package/dist/svelte/blocks/MessageItem.svelte.d.ts +34 -0
  52. package/dist/svelte/blocks/MessageList.svelte +22 -0
  53. package/dist/svelte/blocks/MessageList.svelte.d.ts +8 -0
  54. package/dist/svelte/blocks/ServerTag.svelte +46 -0
  55. package/dist/svelte/blocks/ServerTag.svelte.d.ts +9 -0
  56. package/dist/svelte/blocks/SettingsModal.svelte +180 -0
  57. package/dist/svelte/blocks/SettingsModal.svelte.d.ts +29 -0
  58. package/dist/svelte/blocks/UserDock.svelte +92 -0
  59. package/dist/svelte/blocks/UserDock.svelte.d.ts +16 -0
  60. package/dist/svelte/blocks/helpers.d.ts +3 -0
  61. package/dist/svelte/blocks/helpers.js +20 -0
  62. package/dist/svelte/blocks/index.d.ts +17 -0
  63. package/dist/svelte/blocks/index.js +17 -0
  64. package/dist/svelte/buttons/Button.svelte +116 -0
  65. package/dist/svelte/buttons/Button.svelte.d.ts +19 -0
  66. package/dist/svelte/buttons/ButtonGroup.svelte +48 -0
  67. package/dist/svelte/buttons/ButtonGroup.svelte.d.ts +15 -0
  68. package/dist/svelte/buttons/CloseButton.svelte +33 -0
  69. package/dist/svelte/buttons/CloseButton.svelte.d.ts +7 -0
  70. package/dist/svelte/buttons/IconButton.svelte +38 -0
  71. package/dist/svelte/buttons/IconButton.svelte.d.ts +12 -0
  72. package/dist/svelte/buttons/TextButton.svelte +34 -0
  73. package/dist/svelte/buttons/TextButton.svelte.d.ts +12 -0
  74. package/dist/svelte/buttons/ToggleButton.svelte +50 -0
  75. package/dist/svelte/buttons/ToggleButton.svelte.d.ts +12 -0
  76. package/dist/svelte/buttons/ToggleIconButton.svelte +50 -0
  77. package/dist/svelte/buttons/ToggleIconButton.svelte.d.ts +14 -0
  78. package/dist/svelte/buttons/Toolbar.svelte +36 -0
  79. package/dist/svelte/buttons/Toolbar.svelte.d.ts +8 -0
  80. package/dist/svelte/buttons/ToolbarGroup.svelte +15 -0
  81. package/dist/svelte/buttons/ToolbarGroup.svelte.d.ts +8 -0
  82. package/dist/svelte/buttons/ToolbarSeparator.svelte +14 -0
  83. package/dist/svelte/buttons/ToolbarSeparator.svelte.d.ts +4 -0
  84. package/dist/svelte/context.d.ts +27 -0
  85. package/dist/svelte/context.js +49 -0
  86. package/dist/svelte/extras/Anchor.svelte +39 -0
  87. package/dist/svelte/extras/Anchor.svelte.d.ts +10 -0
  88. package/dist/svelte/extras/Card.svelte +39 -0
  89. package/dist/svelte/extras/Card.svelte.d.ts +12 -0
  90. package/dist/svelte/extras/Divider.svelte +8 -0
  91. package/dist/svelte/extras/Divider.svelte.d.ts +4 -0
  92. package/dist/svelte/extras/Menu.svelte +123 -0
  93. package/dist/svelte/extras/Menu.svelte.d.ts +25 -0
  94. package/dist/svelte/extras/NumberBadge.svelte +41 -0
  95. package/dist/svelte/extras/NumberBadge.svelte.d.ts +10 -0
  96. package/dist/svelte/extras/ProgressCircle.svelte +67 -0
  97. package/dist/svelte/extras/ProgressCircle.svelte.d.ts +12 -0
  98. package/dist/svelte/extras/Scroller.svelte +31 -0
  99. package/dist/svelte/extras/Scroller.svelte.d.ts +11 -0
  100. package/dist/svelte/extras/Spinner.svelte +74 -0
  101. package/dist/svelte/extras/Spinner.svelte.d.ts +17 -0
  102. package/dist/svelte/extras/Table.svelte +100 -0
  103. package/dist/svelte/extras/Table.svelte.d.ts +38 -0
  104. package/dist/svelte/icons/ManaIcon.svelte +50 -0
  105. package/dist/svelte/icons/ManaIcon.svelte.d.ts +10 -0
  106. package/dist/svelte/icons/generated.d.ts +670 -0
  107. package/dist/svelte/icons/generated.js +669 -0
  108. package/dist/svelte/icons/index.d.ts +3 -0
  109. package/dist/svelte/icons/index.js +3 -0
  110. package/dist/svelte/icons/makeIcon.d.ts +10 -0
  111. package/dist/svelte/icons/makeIcon.js +36 -0
  112. package/dist/svelte/index.d.ts +68 -0
  113. package/dist/svelte/index.js +67 -0
  114. package/dist/svelte/inputs/Checkbox.svelte +76 -0
  115. package/dist/svelte/inputs/Checkbox.svelte.d.ts +12 -0
  116. package/dist/svelte/inputs/CheckboxGroup.svelte +48 -0
  117. package/dist/svelte/inputs/CheckboxGroup.svelte.d.ts +16 -0
  118. package/dist/svelte/inputs/NumberInput.svelte +73 -0
  119. package/dist/svelte/inputs/NumberInput.svelte.d.ts +12 -0
  120. package/dist/svelte/inputs/RadioGroup.svelte +74 -0
  121. package/dist/svelte/inputs/RadioGroup.svelte.d.ts +36 -0
  122. package/dist/svelte/inputs/SearchBar.svelte +66 -0
  123. package/dist/svelte/inputs/SearchBar.svelte.d.ts +10 -0
  124. package/dist/svelte/inputs/Slider.svelte +127 -0
  125. package/dist/svelte/inputs/Slider.svelte.d.ts +15 -0
  126. package/dist/svelte/inputs/Switch.svelte +73 -0
  127. package/dist/svelte/inputs/Switch.svelte.d.ts +11 -0
  128. package/dist/svelte/inputs/TextArea.svelte +50 -0
  129. package/dist/svelte/inputs/TextArea.svelte.d.ts +10 -0
  130. package/dist/svelte/inputs/TextInput.svelte +89 -0
  131. package/dist/svelte/inputs/TextInput.svelte.d.ts +16 -0
  132. package/dist/svelte/overlays/ConfirmModal.svelte +58 -0
  133. package/dist/svelte/overlays/ConfirmModal.svelte.d.ts +15 -0
  134. package/dist/svelte/overlays/Countdown.svelte +68 -0
  135. package/dist/svelte/overlays/Countdown.svelte.d.ts +10 -0
  136. package/dist/svelte/overlays/GlobalBanner.svelte +50 -0
  137. package/dist/svelte/overlays/GlobalBanner.svelte.d.ts +12 -0
  138. package/dist/svelte/overlays/InlineNotice.svelte +66 -0
  139. package/dist/svelte/overlays/InlineNotice.svelte.d.ts +13 -0
  140. package/dist/svelte/overlays/LayerModal.svelte +68 -0
  141. package/dist/svelte/overlays/LayerModal.svelte.d.ts +12 -0
  142. package/dist/svelte/overlays/Modal.svelte +118 -0
  143. package/dist/svelte/overlays/Modal.svelte.d.ts +17 -0
  144. package/dist/svelte/overlays/Popover.svelte +100 -0
  145. package/dist/svelte/overlays/Popover.svelte.d.ts +20 -0
  146. package/dist/svelte/overlays/ProgressBar.svelte +32 -0
  147. package/dist/svelte/overlays/ProgressBar.svelte.d.ts +9 -0
  148. package/dist/svelte/overlays/Toast.svelte +34 -0
  149. package/dist/svelte/overlays/Toast.svelte.d.ts +9 -0
  150. package/dist/svelte/overlays/ToastContainer.svelte +31 -0
  151. package/dist/svelte/overlays/ToastContainer.svelte.d.ts +8 -0
  152. package/dist/svelte/overlays/Tooltip.svelte +51 -0
  153. package/dist/svelte/overlays/Tooltip.svelte.d.ts +12 -0
  154. package/dist/svelte/primitives/Badge.svelte +39 -0
  155. package/dist/svelte/primitives/Badge.svelte.d.ts +11 -0
  156. package/dist/svelte/primitives/Chip.svelte +28 -0
  157. package/dist/svelte/primitives/Chip.svelte.d.ts +10 -0
  158. package/dist/svelte/primitives/Clickable.svelte +45 -0
  159. package/dist/svelte/primitives/Clickable.svelte.d.ts +10 -0
  160. package/dist/svelte/primitives/Field.svelte +70 -0
  161. package/dist/svelte/primitives/Field.svelte.d.ts +16 -0
  162. package/dist/svelte/primitives/FieldSet.svelte +41 -0
  163. package/dist/svelte/primitives/FieldSet.svelte.d.ts +11 -0
  164. package/dist/svelte/primitives/Gradient.svelte +37 -0
  165. package/dist/svelte/primitives/Gradient.svelte.d.ts +10 -0
  166. package/dist/svelte/primitives/Graphic.svelte +30 -0
  167. package/dist/svelte/primitives/Graphic.svelte.d.ts +10 -0
  168. package/dist/svelte/primitives/Heading.svelte +51 -0
  169. package/dist/svelte/primitives/Heading.svelte.d.ts +12 -0
  170. package/dist/svelte/primitives/IndicatorDot.svelte +33 -0
  171. package/dist/svelte/primitives/IndicatorDot.svelte.d.ts +9 -0
  172. package/dist/svelte/primitives/Stack.svelte +50 -0
  173. package/dist/svelte/primitives/Stack.svelte.d.ts +16 -0
  174. package/dist/svelte/primitives/Text.svelte +68 -0
  175. package/dist/svelte/primitives/Text.svelte.d.ts +16 -0
  176. package/dist/svelte/selection/Calendar.svelte +97 -0
  177. package/dist/svelte/selection/Calendar.svelte.d.ts +12 -0
  178. package/dist/svelte/selection/ComboBox.svelte +112 -0
  179. package/dist/svelte/selection/ComboBox.svelte.d.ts +13 -0
  180. package/dist/svelte/selection/DatePicker.svelte +98 -0
  181. package/dist/svelte/selection/DatePicker.svelte.d.ts +12 -0
  182. package/dist/svelte/selection/ListBox.svelte +92 -0
  183. package/dist/svelte/selection/ListBox.svelte.d.ts +18 -0
  184. package/dist/svelte/selection/RangeCalendar.svelte +113 -0
  185. package/dist/svelte/selection/RangeCalendar.svelte.d.ts +15 -0
  186. package/dist/svelte/selection/Select.svelte +131 -0
  187. package/dist/svelte/selection/Select.svelte.d.ts +15 -0
  188. package/dist/svelte/selection/Tabs.svelte +92 -0
  189. package/dist/svelte/selection/Tabs.svelte.d.ts +18 -0
  190. package/dist/svelte/selection/Tag.svelte +75 -0
  191. package/dist/svelte/selection/Tag.svelte.d.ts +14 -0
  192. package/dist/svelte/selection/TagGroup.svelte +54 -0
  193. package/dist/svelte/selection/TagGroup.svelte.d.ts +19 -0
  194. package/dist/svelte/toast.svelte.d.ts +6 -0
  195. package/dist/svelte/toast.svelte.js +20 -0
  196. package/dist/types/core/index.d.ts +2 -1
  197. package/package.json +26 -2
@@ -1,2 +1,2 @@
1
- var Mana=(function(p){"use strict";var Da=Object.defineProperty;var Na=(p,Y,nt)=>Y in p?Da(p,Y,{enumerable:!0,configurable:!0,writable:!0,value:nt}):p[Y]=nt;var d=(p,Y,nt)=>Na(p,typeof Y!="symbol"?Y+"":Y,nt);const Y={ASH:"dark",LIGHT:"light",ONYX:"midnight",DARK:"darker"},nt=["default","compact","cozy"],si={none:0,xs:4,sm:8,md:12,lg:16,xl:24,xxl:32,round:2147483647},ii={SUBTLE_SPRING:{mass:1,stiffness:300,damping:27}},ai=["heading-xs/medium","heading-xs/semibold","heading-sm/medium","heading-sm/semibold","heading-md/medium","heading-md/semibold","heading-lg/medium","heading-lg/semibold","heading-xl/medium","heading-xl/semibold","heading-xxl/medium","heading-xxl/semibold","body-xs/normal","body-xs/medium","body-xs/semibold","body-sm/normal","body-sm/medium","body-sm/semibold","body-md/normal","body-md/medium","body-md/semibold","body-lg/normal","body-lg/medium","body-lg/semibold","footnote/normal","footnote/medium","footnote/semibold","display-xs","display-sm","display-md","display-lg","nitro-xs","nitro-sm","nitro-md","nitro-lg","mono-md/normal","mono-md/bold"];function It(e){return e==="currentColor"?"currentColor":e.startsWith("var(")?e:`var(--${e.toLowerCase().replace(/_/g,"-").replace(/^--/,"")})`}function ut(e){return e.replace(/\//g,"-")}function ni(e){if(e==null)return;const i=e==="dark"||e==="midnight"?"dark":e;return`theme-${i} theme-${e} images-${i}`}function xs(e,i={}){if(!e)return;const t=i.theme??"dark",s=i.density??"default",a=!!i.highContrast,r=!!i.reducedMotion;e.setAttribute("data-theme",t),e.setAttribute("data-density",s),a?e.setAttribute("data-high-contrast","true"):e.removeAttribute("data-high-contrast"),e.classList.remove("theme-dark","theme-light","theme-darker","theme-midnight"),t==="darker"||t==="midnight"?e.classList.add("theme-dark",`theme-${t}`):e.classList.add(`theme-${t}`),e.classList.remove("density-default","density-compact","density-cozy"),e.classList.add(`density-${s}`),e.classList.toggle("high-contrast-mode",a),e.classList.toggle("reduce-motion",r),e.classList.toggle("full-motion",!r),typeof i.saturation=="number"&&e.style.setProperty("--saturation-factor",String(i.saturation))}const ri={CANCEL:"Cancel",BACK:"Back",NEXT:"Next",SUBMIT:"Submit",SPINNER_LOADING_LABEL:"Loading",BUTTON_LOADING_STARTED_LABEL:"Loading",BUTTON_LOADING_FINISHED_LABEL:"Loading",CLOSE_BUTTON_LABEL:"Close",DISMISS_BUTTON_LABEL:"Dismiss",PLAY_BUTTON_LABEL:"Play",PAUSE_BUTTON_LABEL:"Pause",NEW:"New",BETA:"Beta",EARLY_ACCESS:"Early Access",BILLING_TRIAL_FREE_TRIAL_TEXT:"Free Trial",MODAL_DONT_SHOW_AGAIN:"Don't show again",SEARCH:"Search",AUTOCOMPLETE_NO_RESULTS_HEADER:"Nope!",AUTOCOMPLETE_NO_RESULTS_BODY:"Did you make a typo?",LISTBOX_EMPTY_STATE:"No items to show",LISTBOX_EMPTY_STATE_WITH_QUERY:e=>`No results for ‘${e}’`,KEY_CTRL_A11Y_LABEL:"Ctrl",KEY_CMD_A11Y_LABEL:"Cmd",KEY_ALT_A11Y_LABEL:"Alt",KEY_OPTION_A11Y_LABEL:"Option",KEY_SHIFT_A11Y_LABEL:"Shift",KEY_UP_A11Y_LABEL:"Up",KEY_DOWN_A11Y_LABEL:"Down",KEY_LEFT_A11Y_LABEL:"Left",KEY_RIGHT_A11Y_LABEL:"Right",KEY_PAGEUP:"Page Up",KEY_PAGEDOWN:"Page Down",KEY_ANY:"Any",KEY_ENTER:"Enter",KEY_ENTER_A11Y_LABEL:"Enter",KEY_RETURN_A11Y_LABEL:"Return",KEY_ESCAPE:"Escape",KEY_ESCAPE_A11Y_LABEL:"Escape",KEY_BACKSPACE:"Backspace",KEY_BACKSPACE_A11Y_LABEL:"Backspace",KEY_DELETE_A11Y_LABEL:"Delete",KEY_SHIFT:"Shift",DATE_INPUT_OPEN_CALENDAR_LABEL:"Open calendar",CALENDAR_PREVIOUS_MONTH_LABEL:"Previous month",CALENDAR_NEXT_MONTH_LABEL:"Next month",INLINE_NOTICE_GENERIC_ERROR:"Something went wrong. Please try again later.",FEEDBACK_CRITICAL_ICON_A11Y_LABEL:"Error",FEEDBACK_WARNING_ICON_A11Y_LABEL:"Warning",FEEDBACK_INFO_ICON_A11Y_LABEL:"Info",FEEDBACK_POSITIVE_ICON_A11Y_LABEL:"Success",STEP_INDICATOR:(e,i)=>`Step ${e} of ${i}`,SELECT_PLACEHOLDER:"Select...",CLEAR_SELECTION:"Clear",SELECTED_TAGS_HEADING:"Selected",PRESS_DELETE_TO_REMOVE_TAG:"Press Delete to remove tag",PERCENT_COMPLETE:e=>`${e} percent complete`,TEXT_INPUT_CLEAR:"Clear",TEXT_INPUT_VIEW_PASSWORD:"View Password",TEXT_INPUT_HIDE_PASSWORD:"Hide Password",TEXT_INPUT_PASSWORD_VISIBLE:"Password is visible.",TEXT_INPUT_PASSWORD_HIDDEN:"Password is hidden.",CHARACTER_COUNT_LIMIT_REACHED:"Character limit reached",CHARACTER_COUNT_A11Y_LABEL:e=>`${e} characters remaining`,MINIMUM_LENGTH_ERROR:e=>`Must be at least ${e} characters`,MAXIMUM_LENGTH_ERROR:e=>`Must be at most ${e} characters`,MINIMUM_VALUE_ERROR:e=>`Must be at least ${e}`,MAXIMUM_VALUE_ERROR:e=>`Must be at most ${e}`,GLOBAL_BANNER_COUNTDOWN_TIME_LEFT:e=>`${e} left`};class oi{constructor(){d(this,"node",null);d(this,"assertiveLog",null);d(this,"politeLog",null);d(this,"locations",new Map)}ensureDom(){if(typeof document>"u")return!1;if(this.node)return!0;const i=document.createElement("div");i.setAttribute("data-live-announcer","true"),i.style.cssText="border:0;clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;";const t=document.createElement("div");t.setAttribute("role","log"),t.setAttribute("aria-live","assertive"),t.setAttribute("aria-relevant","additions");const s=document.createElement("div");return s.setAttribute("role","log"),s.setAttribute("aria-live","polite"),s.setAttribute("aria-relevant","additions"),i.appendChild(t),i.appendChild(s),document.body.prepend(i),this.node=i,this.assertiveLog=t,this.politeLog=s,!0}announce(i,t="assertive",s=7e3){if(!this.ensureDom())return;const a=t==="polite"?this.politeLog:this.assertiveLog;if(!a)return;const r=document.createElement("div");if(typeof i=="string"){if(i==="")return;r.textContent=i}else r.setAttribute("role","img"),r.setAttribute("aria-labelledby",i["aria-labelledby"]);a.appendChild(r),s>0&&setTimeout(()=>r.remove(),s)}clearAnnouncements(i){this.node&&((!i||i==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!i||i==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}moveTo(i,t){!t||this.locations.has(i)||!this.ensureDom()||!this.node||(this.locations.set(i,t),t.prepend(this.node))}remove(i){if(!this.locations.has(i)||(this.locations.delete(i),!this.node||typeof document>"u"))return;const t=[...this.locations.values()];(t.length>0?t[t.length-1]:document.body)?.prepend(this.node)}}const li=new oi;class ci{constructor(){d(this,"locks",[])}add(i,t){const s=this.current();s&&(s.enabled=!1,s.setEnabled(!1));const a={uid:i,setEnabled:t,enabled:!0};this.locks.push(a),t(!0)}remove(i){const t=this.locks.findIndex(r=>r.uid===i);if(t===-1)return;const[s]=this.locks.splice(t,1);s.enabled=!1,s.setEnabled(!1);const a=this.current();a&&!a.enabled&&(a.enabled=!0,a.setEnabled(!0))}current(){return this.locks[this.locks.length-1]}isActive(){return this.locks.length>0}}const xt=new ci;function di(){return xt.isActive()}function Pt(e){const i=[],t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(a){const r=a;return r.disabled?NodeFilter.FILTER_SKIP:r.getAttribute("aria-hidden")==="true"?NodeFilter.FILTER_REJECT:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=t.nextNode();for(;s;)i.push(s),s=t.nextNode();return i}function ks(e,i=!1){const t=Pt(e);t.length>0?(i?t[t.length-1]:t[0]).focus():e.focus()}const hi={APP:"app",OVERLAY:"overlay",POPOUT:"popout",CALL_TILE_POPOUT:"call-tile-popout"};let Ls=0;const B={app:[],overlay:[],popout:[],"call-tile-popout":[]},Wt=new Set;function mt(e){return e==="overlay"||e==="popout"||e==="call-tile-popout"?e:"app"}function Cs(e){return e==="success"||e===1?"success":e==="critical"||e===2?"critical":"default"}function pt(){const e={app:[...B.app],overlay:[...B.overlay],popout:[...B.popout],"call-tile-popout":[...B["call-tile-popout"]]};for(const i of Wt)i(e)}function ui(e,i="default",t={}){return{id:t.id??`mana-toast-${++Ls}`,toastKey:t.toastKey,text:e,variant:Cs(i),surface:mt(t.surface),duration:t.duration??3e3,icon:t.icon,iconColor:t.iconColor,secondaryIconColor:t.secondaryIconColor,position:t.position??"top",__dangerouslyRenderContent:t.__dangerouslyRenderContent}}function mi(e){const i=mt(e.surface),t={id:e.id??`mana-toast-${++Ls}`,toastKey:e.toastKey,text:e.text??e.message??"",variant:Cs(e.variant??e.type),surface:i,duration:e.duration??3e3,icon:e.icon,iconColor:e.iconColor,secondaryIconColor:e.secondaryIconColor,position:e.position??"top",__dangerouslyRenderContent:e.__dangerouslyRenderContent},s=B[i];if(t.toastKey!=null){const a=s.findIndex(r=>r.toastKey===t.toastKey);if(a!==-1)return s[a]=t,pt(),t.id}return s.push(t),pt(),t.id}function pi(e="app"){const i=mt(e),t=B[i].shift();return t&&pt(),t}function _s(e,i){const t=i?[mt(i)]:["app","overlay","popout","call-tile-popout"];let s=!1;for(const a of t){const r=B[a].findIndex(o=>o.id===e);r!==-1&&(B[a].splice(r,1),s=!0)}return s&&pt(),s}function bi(e){e?B[mt(e)]=[]:(B.app=[],B.overlay=[],B.popout=[],B["call-tile-popout"]=[]),pt()}function Ts(){return{app:[...B.app],overlay:[...B.overlay],popout:[...B.popout],"call-tile-popout":[...B["call-tile-popout"]]}}function Ss(e){return Wt.add(e),e(Ts()),()=>{Wt.delete(e)}}const Ms={ENTERING:0,ENTERED:1,EXITING:2,EXITED:3,HIDDEN:4};let fi=0,U=[];const $t=new Set;function Ht(){const e=[...U];for(const i of $t)i(e)}function gi(e,i={}){const t=i.modalKey??`mana-modal-${++fi}`,s={key:t,render:e,onCloseRequest:i.onCloseRequest,onCloseCallback:i.onCloseCallback,instant:i.instant,transitionState:Ms.ENTERED};return U=[...U.filter(a=>a.key!==t),s],Ht(),t}function vi(e){const i=U.find(t=>t.key===e);i&&(U=U.filter(t=>t.key!==e),Ht(),i.onCloseCallback?.())}function Ai(){const e=U;U=[],Ht();for(const i of e)i.onCloseCallback?.()}function Ds(){return[...U]}function Ei(e){return $t.add(e),e(Ds()),()=>{$t.delete(e)}}const yi=["top","right","bottom","left"],rt=Math.min,Z=Math.max,kt=Math.round,Lt=Math.floor,X=e=>({x:e,y:e}),wi={left:"right",right:"left",bottom:"top",top:"bottom"};function xi(e,i,t){return Z(e,rt(i,t))}function ot(e,i){return typeof e=="function"?e(i):e}function J(e){return e.split("-")[0]}function bt(e){return e.split("-")[1]}function Ns(e){return e==="x"?"y":"x"}function Bs(e){return e==="y"?"height":"width"}function V(e){const i=e[0];return i==="t"||i==="b"?"y":"x"}function Rs(e){return Ns(V(e))}function ki(e,i,t){t===void 0&&(t=!1);const s=bt(e),a=Rs(e),r=Bs(a);let o=a==="x"?s===(t?"end":"start")?"right":"left":s==="start"?"bottom":"top";return i.reference[r]>i.floating[r]&&(o=Ct(o)),[o,Ct(o)]}function Li(e){const i=Ct(e);return[zt(e),i,zt(i)]}function zt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Os=["left","right"],Is=["right","left"],Ci=["top","bottom"],_i=["bottom","top"];function Ti(e,i,t){switch(e){case"top":case"bottom":return t?i?Is:Os:i?Os:Is;case"left":case"right":return i?Ci:_i;default:return[]}}function Si(e,i,t,s){const a=bt(e);let r=Ti(J(e),t==="start",s);return a&&(r=r.map(o=>o+"-"+a),i&&(r=r.concat(r.map(zt)))),r}function Ct(e){const i=J(e);return wi[i]+e.slice(i.length)}function Mi(e){var i,t,s,a;return{top:(i=e.top)!=null?i:0,right:(t=e.right)!=null?t:0,bottom:(s=e.bottom)!=null?s:0,left:(a=e.left)!=null?a:0}}function Di(e){return typeof e!="number"?Mi(e):{top:e,right:e,bottom:e,left:e}}function _t(e){const{x:i,y:t,width:s,height:a}=e;return{width:s,height:a,top:t,left:i,right:i+s,bottom:t+a,x:i,y:t}}function Ps(e,i,t){let{reference:s,floating:a}=e;const r=V(i),o=Rs(i),l=Bs(o),c=J(i),h=r==="y",m=s.x+s.width/2-a.width/2,u=s.y+s.height/2-a.height/2,b=s[l]/2-a[l]/2;let f;switch(c){case"top":f={x:m,y:s.y-a.height};break;case"bottom":f={x:m,y:s.y+s.height};break;case"right":f={x:s.x+s.width,y:u};break;case"left":f={x:s.x-a.width,y:u};break;default:f={x:s.x,y:s.y}}const g=bt(i);return g&&(f[o]+=b*(g==="end"?1:-1)*(t&&h?-1:1)),f}async function Ni(e,i){var t;i===void 0&&(i={});const{x:s,y:a,platform:r,rects:o,elements:l,strategy:c}=e,{boundary:h="clippingAncestors",rootBoundary:m="viewport",elementContext:u="floating",altBoundary:b=!1,padding:f=0}=ot(i,e),g=Di(f),y=l[b?u==="floating"?"reference":"floating":u],w=_t(await r.getClippingRect({element:(t=await(r.isElement==null?void 0:r.isElement(y)))==null||t?y:y.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:h,rootBoundary:m,strategy:c})),x=u==="floating"?{x:s,y:a,width:o.floating.width,height:o.floating.height}:o.reference,L=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),_=await(r.isElement==null?void 0:r.isElement(L))&&await(r.getScale==null?void 0:r.getScale(L))||{x:1,y:1},W=_t(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:L,strategy:c}):x);return{top:(w.top-W.top+g.top)/_.y,bottom:(W.bottom-w.bottom+g.bottom)/_.y,left:(w.left-W.left+g.left)/_.x,right:(W.right-w.right+g.right)/_.x}}const Bi=50,Ri=async(e,i,t)=>{const{placement:s="bottom",strategy:a="absolute",middleware:r=[],platform:o}=t,l=o.detectOverflow?o:{...o,detectOverflow:Ni},c=await(o.isRTL==null?void 0:o.isRTL(i));let h=await o.getElementRects({reference:e,floating:i,strategy:a}),{x:m,y:u}=Ps(h,s,c),b=s,f=0;const g={};for(let A=0;A<r.length;A++){const y=r[A];if(!y)continue;const{name:w,fn:x}=y,{x:L,y:_,data:W,reset:D}=await x({x:m,y:u,initialPlacement:s,placement:b,strategy:a,middlewareData:g,rects:h,platform:l,elements:{reference:e,floating:i}});m=L??m,u=_??u,g[w]={...g[w],...W},D&&f<Bi&&(f++,typeof D=="object"&&(D.placement&&(b=D.placement),D.rects&&(h=D.rects===!0?await o.getElementRects({reference:e,floating:i,strategy:a}):D.rects),{x:m,y:u}=Ps(h,b,c)),A=-1)}return{x:m,y:u,placement:b,strategy:a,middlewareData:g}},Oi=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(i){var t,s;const{placement:a,middlewareData:r,rects:o,initialPlacement:l,platform:c,elements:h}=i,{mainAxis:m=!0,crossAxis:u=!0,fallbackPlacements:b,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:A=!0,...y}=ot(e,i);if((t=r.arrow)!=null&&t.alignmentOffset)return{};const w=J(a),x=V(l),L=J(l)===l,_=await(c.isRTL==null?void 0:c.isRTL(h.floating)),W=b||(L||!A?[Ct(l)]:Li(l)),D=g!=="none";!b&&D&&W.push(...Si(l,A,g,_));const I=[l,...W],M=await c.detectOverflow(i,y),$=[];let R=((s=r.flip)==null?void 0:s.overflows)||[];if(m&&$.push(M[w]),u){const F=ki(a,o,_);$.push(M[F[0]],M[F[1]])}if(R=[...R,{placement:a,overflows:$}],!$.every(F=>F<=0)){var Et,ht;const F=(((Et=r.flip)==null?void 0:Et.index)||0)+1,ws=I[F];if(ws&&(!(u==="alignment"?x!==V(ws):!1)||R.every(H=>V(H.placement)===x?H.overflows[0]>0:!0)))return{data:{index:F,overflows:R},reset:{placement:ws}};let wt=(ht=R.filter(at=>at.overflows[0]<=0).sort((at,H)=>at.overflows[1]-H.overflows[1])[0])==null?void 0:ht.placement;if(!wt)switch(f){case"bestFit":{var yt;const at=(yt=R.filter(H=>{if(D){const Q=V(H.placement);return Q===x||Q==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Q=>Q>0).reduce((Q,Ma)=>Q+Ma,0)]).sort((H,Q)=>H[1]-Q[1])[0])==null?void 0:yt[0];at&&(wt=at);break}case"initialPlacement":wt=l;break}if(a!==wt)return{reset:{placement:wt}}}return{}}}};function Ws(e,i){return{top:e.top-i.height,right:e.right-i.width,bottom:e.bottom-i.height,left:e.left-i.width}}function $s(e){return yi.some(i=>e[i]>=0)}const Ii=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(i){const{rects:t,platform:s}=i,{strategy:a="referenceHidden",...r}=ot(e,i);switch(a){case"referenceHidden":{const o=await s.detectOverflow(i,{...r,elementContext:"reference"}),l=Ws(o,t.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:$s(l)}}}case"escaped":{const o=await s.detectOverflow(i,{...r,altBoundary:!0}),l=Ws(o,t.floating);return{data:{escapedOffsets:l,escaped:$s(l)}}}default:return{}}}}},Pi=new Set(["left","top"]);async function Wi(e,i){const{placement:t,platform:s,elements:a}=e,r=await(s.isRTL==null?void 0:s.isRTL(a.floating)),o=J(t),l=bt(t),c=V(t)==="y",h=Pi.has(o)?-1:1,m=r&&c?-1:1,u=ot(i,e);let{mainAxis:b,crossAxis:f,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof g=="number"&&(f=l==="end"?g*-1:g),c?{x:f*m,y:b*h}:{x:b*h,y:f*m}}const $i=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(i){var t,s;const{x:a,y:r,placement:o,middlewareData:l}=i,c=await Wi(i,e);return o===((t=l.offset)==null?void 0:t.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:a+c.x,y:r+c.y,data:{...c,placement:o}}}}},Hi=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(i){const{x:t,y:s,placement:a,platform:r}=i,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:x=>{let{x:L,y:_}=x;return{x:L,y:_}}},...h}=ot(e,i),m={x:t,y:s},u=await r.detectOverflow(i,h),b=V(a),f=Ns(b);let g=m[f],A=m[b];const y=(x,L)=>xi(L+u[x==="y"?"top":"left"],L,L-u[x==="y"?"bottom":"right"]);o&&(g=y(f,g)),l&&(A=y(b,A));const w=c.fn({...i,[f]:g,[b]:A});return{...w,data:{x:w.x-t,y:w.y-s,enabled:{[f]:o,[b]:l}}}}}},zi=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(i){const{placement:t,rects:s,platform:a,elements:r}=i,{apply:o=()=>{},...l}=ot(e,i),c=await a.detectOverflow(i,l),h=J(t),m=bt(t),u=V(t)==="y",{width:b,height:f}=s.floating;let g,A;h==="top"||h==="bottom"?(g=h,A=m===(await(a.isRTL==null?void 0:a.isRTL(r.floating))?"start":"end")?"left":"right"):(A=h,g=m==="end"?"top":"bottom");const y=f-c.top-c.bottom,w=b-c.left-c.right,x=rt(f-c[g],y),L=rt(b-c[A],w),_=i.middlewareData.shift,W=!_;let D=x,I=L;_!=null&&_.enabled.x&&(I=w),_!=null&&_.enabled.y&&(D=y),W&&!m&&(u?I=b-2*Z(c.left,c.right):D=f-2*Z(c.top,c.bottom)),await o({...i,availableWidth:I,availableHeight:D});const M=await a.getDimensions(r.floating);return b!==M.width||f!==M.height?{reset:{rects:!0}}:{}}}};function Tt(){return typeof window<"u"}function lt(e){return Hs(e)?(e.nodeName||"").toLowerCase():"#document"}function P(e){var i;return(e==null||(i=e.ownerDocument)==null?void 0:i.defaultView)||window}function q(e){var i;return(i=(Hs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:i.documentElement}function Hs(e){return Tt()?e instanceof Node||e instanceof P(e).Node:!1}function z(e){return Tt()?e instanceof Element||e instanceof P(e).Element:!1}function G(e){return Tt()?e instanceof HTMLElement||e instanceof P(e).HTMLElement:!1}function zs(e){return!Tt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof P(e).ShadowRoot}function St(e){const{overflow:i,overflowX:t,overflowY:s,display:a}=K(e);return/auto|scroll|overlay|hidden|clip/.test(i+s+t)&&a!=="inline"&&a!=="contents"}function Ki(e){return/^(table|td|th)$/.test(lt(e))}function Mt(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Fi=/transform|translate|scale|rotate|perspective|filter/,Yi=/paint|layout|strict|content/,tt=e=>!!e&&e!=="none";let Kt;function Ft(e){const i=z(e)?K(e):e;return tt(i.transform)||tt(i.translate)||tt(i.scale)||tt(i.rotate)||tt(i.perspective)||!Yt()&&(tt(i.backdropFilter)||tt(i.filter))||Fi.test(i.willChange||"")||Yi.test(i.contain||"")}function Ui(e){let i=et(e);for(;G(i)&&!ft(i);){if(Ft(i))return i;if(Mt(i))return null;i=et(i)}return null}function Yt(){return Kt==null&&(Kt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Kt}function ft(e){return/^(html|body|#document)$/.test(lt(e))}function K(e){return P(e).getComputedStyle(e)}function Dt(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function et(e){if(lt(e)==="html")return e;const i=e.assignedSlot||e.parentNode||zs(e)&&e.host||q(e);return zs(i)?i.host:i}function Ks(e){const i=et(e);return ft(i)?(e.ownerDocument||e).body:G(i)&&St(i)?i:Ks(i)}function gt(e,i,t){var s;i===void 0&&(i=[]),t===void 0&&(t=!0);const a=Ks(e),r=a===((s=e.ownerDocument)==null?void 0:s.body),o=P(a);if(r){const l=Ut(o);return i.concat(o,o.visualViewport||[],St(a)?a:[],l&&t?gt(l):[])}else return i.concat(a,gt(a,[],t))}function Ut(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fs(e){const i=K(e);let t=parseFloat(i.width)||0,s=parseFloat(i.height)||0;const a=G(e),r=a?e.offsetWidth:t,o=a?e.offsetHeight:s,l=kt(t)!==r||kt(s)!==o;return l&&(t=r,s=o),{width:t,height:s,$:l}}function Zt(e){return z(e)?e:e.contextElement}function ct(e){const i=Zt(e);if(!G(i))return X(1);const t=i.getBoundingClientRect(),{width:s,height:a,$:r}=Fs(i);let o=(r?kt(t.width):t.width)/s,l=(r?kt(t.height):t.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Zi=X(0);function Ys(e){const i=P(e);return!Yt()||!i.visualViewport?Zi:{x:i.visualViewport.offsetLeft,y:i.visualViewport.offsetTop}}function Xi(e,i,t){return i===void 0&&(i=!1),!!t&&i&&t===P(e)}function st(e,i,t,s){i===void 0&&(i=!1),t===void 0&&(t=!1);const a=e.getBoundingClientRect(),r=Zt(e);let o=X(1);i&&(s?z(s)&&(o=ct(s)):o=ct(e));const l=Xi(r,t,s)?Ys(r):X(0);let c=(a.left+l.x)/o.x,h=(a.top+l.y)/o.y,m=a.width/o.x,u=a.height/o.y;if(r&&s){const b=P(r),f=z(s)?P(s):s;let g=b,A=Ut(g);for(;A&&f!==g;){const y=ct(A),w=A.getBoundingClientRect(),x=K(A),L=w.left+(A.clientLeft+parseFloat(x.paddingLeft))*y.x,_=w.top+(A.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,h*=y.y,m*=y.x,u*=y.y,c+=L,h+=_,g=P(A),A=Ut(g)}}return _t({width:m,height:u,x:c,y:h})}function Nt(e,i){const t=Dt(e).scrollLeft;return i?i.left+t:st(q(e)).left+t}function Us(e,i){const t=e.getBoundingClientRect(),s=t.left+i.scrollLeft-Nt(e,t),a=t.top+i.scrollTop;return{x:s,y:a}}function Vi(e){let{elements:i,rect:t,offsetParent:s,strategy:a}=e;const r=a==="fixed",o=q(s),l=i?Mt(i.floating):!1;if(s===o||l&&r)return t;let c={scrollLeft:0,scrollTop:0},h=X(1);const m=X(0),u=G(s);if((u||!r)&&((lt(s)!=="body"||St(o))&&(c=Dt(s)),u)){const f=st(s);h=ct(s),m.x=f.x+s.clientLeft,m.y=f.y+s.clientTop}const b=o&&!u&&!r?Us(o,c):X(0);return{width:t.width*h.x,height:t.height*h.y,x:t.x*h.x-c.scrollLeft*h.x+m.x+b.x,y:t.y*h.y-c.scrollTop*h.y+m.y+b.y}}function qi(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ji(e){const i=Dt(e),t=e.ownerDocument.body,s=Z(e.scrollWidth,e.clientWidth,t.scrollWidth,t.clientWidth),a=Z(e.scrollHeight,e.clientHeight,t.scrollHeight,t.clientHeight);let r=-i.scrollLeft+Nt(e);const o=-i.scrollTop;return K(t).direction==="rtl"&&(r+=Z(e.clientWidth,t.clientWidth)-s),{width:s,height:a,x:r,y:o}}const Gi=25;function Qi(e,i,t){t===void 0&&(t="viewport");const s=t==="layoutViewport",a=P(e),r=q(e),o=a.visualViewport;let l=r.clientWidth,c=r.clientHeight,h=0,m=0;if(o){const b=!Yt()||i==="fixed";s?b||(h=-o.offsetLeft,m=-o.offsetTop):(l=o.width,c=o.height,b&&(h=o.offsetLeft,m=o.offsetTop))}if(Nt(r)<=0){const b=r.ownerDocument,f=b.body,g=getComputedStyle(f),A=b.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,y=Math.abs(r.clientWidth-f.clientWidth-A),w=getComputedStyle(r).scrollbarGutter==="stable both-edges"?y/2:y;w<=Gi&&(l-=w)}return{width:l,height:c,x:h,y:m}}function Ji(e,i){const t=st(e,!0,i==="fixed"),s=t.top+e.clientTop,a=t.left+e.clientLeft,r=ct(e),o=e.clientWidth*r.x,l=e.clientHeight*r.y,c=a*r.x,h=s*r.y;return{width:o,height:l,x:c,y:h}}function Zs(e,i,t){let s;if(i==="viewport"||i==="layoutViewport")s=Qi(e,t,i);else if(i==="document")s=ji(q(e));else if(z(i))s=Ji(i,t);else{const a=Ys(e);s={x:i.x-a.x,y:i.y-a.y,width:i.width,height:i.height}}return _t(s)}function ta(e,i){const t=i.get(e);if(t)return t;let s=gt(e,[],!1).filter(l=>z(l)&&lt(l)!=="body"),a=null;const r=K(e).position==="fixed";let o=r?et(e):e;for(;z(o)&&!ft(o);){const l=K(o),c=Ft(o),h=a?a.position:r?"fixed":"";!c&&(h==="fixed"||h==="absolute"&&l.position==="static")?s=s.filter(u=>u!==o):a=l,o=et(o)}return i.set(e,s),s}function ea(e){let{element:i,boundary:t,rootBoundary:s,strategy:a}=e;const o=[...t==="clippingAncestors"?Mt(i)?[]:ta(i,this._c):[].concat(t),s],l=Zs(i,o[0],a);let c=l.top,h=l.right,m=l.bottom,u=l.left;for(let b=1;b<o.length;b++){const f=Zs(i,o[b],a);c=Z(f.top,c),h=rt(f.right,h),m=rt(f.bottom,m),u=Z(f.left,u)}return{width:h-u,height:m-c,x:u,y:c}}function sa(e){const{width:i,height:t}=Fs(e);return{width:i,height:t}}function ia(e,i,t){const s=G(i),a=q(i),r=t==="fixed",o=st(e,!0,r,i);let l={scrollLeft:0,scrollTop:0};const c=X(0);if((s||!r)&&((lt(i)!=="body"||St(a))&&(l=Dt(i)),s)){const b=st(i,!0,r,i);c.x=b.x+i.clientLeft,c.y=b.y+i.clientTop}!s&&a&&(c.x=Nt(a));const h=a&&!s&&!r?Us(a,l):X(0),m=o.left+l.scrollLeft-c.x-h.x,u=o.top+l.scrollTop-c.y-h.y;return{x:m,y:u,width:o.width,height:o.height}}function Xt(e){return K(e).position==="static"}function Xs(e,i){if(!G(e)||K(e).position==="fixed")return null;if(i)return i(e);let t=e.offsetParent;return q(e)===t&&(t=t.ownerDocument.body),t}function Vs(e,i){const t=P(e);if(Mt(e))return t;if(!G(e)){let a=et(e);for(;a&&!ft(a);){if(z(a)&&!Xt(a))return a;a=et(a)}return t}let s=Xs(e,i);for(;s&&Ki(s)&&Xt(s);)s=Xs(s,i);return s&&ft(s)&&Xt(s)&&!Ft(s)?t:s||Ui(e)||t}const aa=async function(e){const i=this.getOffsetParent||Vs,t=this.getDimensions,s=await t(e.floating);return{reference:ia(e.reference,await i(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function na(e){return K(e).direction==="rtl"}const ra={convertOffsetParentRelativeRectToViewportRelativeRect:Vi,getDocumentElement:q,getClippingRect:ea,getOffsetParent:Vs,getElementRects:aa,getClientRects:qi,getDimensions:sa,getScale:ct,isElement:z,isRTL:na};function qs(e,i){return e.x===i.x&&e.y===i.y&&e.width===i.width&&e.height===i.height}function oa(e,i,t){let s=null,a;const r=q(e);function o(){var m;clearTimeout(a),(m=s)==null||m.disconnect(),s=null}function l(m,u){m===void 0&&(m=!1),u===void 0&&(u=1),o();const b=e.getBoundingClientRect(),{left:f,top:g,width:A,height:y}=b;if(m||i(),!A||!y)return;const w=Lt(g),x=Lt(r.clientWidth-(f+A)),L=Lt(r.clientHeight-(g+y)),_=Lt(f),D={rootMargin:-w+"px "+-x+"px "+-L+"px "+-_+"px",threshold:Z(0,rt(1,u))||1};let I=!0;function M($){const R=$[0].intersectionRatio;if(!qs(b,e.getBoundingClientRect()))return l();if(R!==u){if(!I)return l();R?l(!1,R):a=setTimeout(()=>{l(!1,1e-7)},1e3)}I=!1}try{s=new IntersectionObserver(M,{...D,root:r.ownerDocument})}catch{s=new IntersectionObserver(M,D)}s.observe(e)}const c=P(e),h=()=>l(t);return c.addEventListener("resize",h),l(!0),()=>{c.removeEventListener("resize",h),o()}}function la(e,i,t,s){s===void 0&&(s={});const{ancestorScroll:a=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,h=Zt(e),m=a||r?[...h?gt(h):[],...i?gt(i):[]]:[];m.forEach(w=>{a&&w.addEventListener("scroll",t),r&&w.addEventListener("resize",t)});const u=h&&l?oa(h,t,r):null;let b=-1,f=null;o&&(f=new ResizeObserver(w=>{let[x]=w;x&&x.target===h&&f&&i&&(f.unobserve(i),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var L;(L=f)==null||L.observe(i)})),t()}),h&&!c&&f.observe(h),i&&f.observe(i));let g,A=c?st(e):null;c&&y();function y(){const w=st(e);A&&!qs(A,w)&&t(),A=w,g=requestAnimationFrame(y)}return t(),()=>{var w;m.forEach(x=>{a&&x.removeEventListener("scroll",t),r&&x.removeEventListener("resize",t)}),u?.(),(w=f)==null||w.disconnect(),f=null,c&&cancelAnimationFrame(g)}}const ca=$i,da=Hi,ha=Oi,ua=zi,ma=Ii,pa=(e,i,t)=>{const s=new Map,a=t??{},r={...ra,...a.platform,_c:s};return Ri(e,i,{...a,platform:r})};function Vt(e){return e.split("-")[0]}function ba(e,i){return!i||i==="center"?e:i==="start"||i==="top"||i==="left"?`${e}-start`:`${e}-end`}async function it(e,i,t={}){const{placement:s="bottom",strategy:a="fixed",spacing:r=8,alignmentSpacing:o,autoFlip:l=!0,autoShift:c=!0,viewportPadding:h=8,shiftPadding:m=h,maxHeight:u,matchReferenceWidth:b=!1}=t;let f,g;const A=[ca(o!=null?{mainAxis:r,alignmentAxis:o}:r)];l&&A.push(ha({padding:h})),c&&A.push(da({padding:m})),(u!=null||b)&&A.push(ua({padding:h,apply({availableHeight:w,rects:x,elements:L}){u!=null&&(f=Math.min(u,w)),b&&(g=x.reference.width,L.floating.style.minWidth=`${x.reference.width}px`,L.floating.style.width=`${x.reference.width}px`)}})),A.push(ma());const y=await pa(e,i,{placement:s,strategy:a,middleware:A});return{x:y.x,y:y.y,placement:y.placement,strategy:y.strategy,referenceHidden:!!y.middlewareData.hide?.referenceHidden,availableHeight:f,referenceWidth:g,shift:y.middlewareData.shift?{x:y.middlewareData.shift.x,y:y.middlewareData.shift.y}:void 0}}function vt(){const e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}}function js(e,i){return new Date(e,i,0).getDate()}function Gs(e,i){return new Date(e,i-1,1).getDay()}function dt(e,i){return e.year!==i.year?e.year-i.year:e.month!==i.month?e.month-i.month:e.day-i.day}function Bt(e,i){return!e||!i?!1:e.year===i.year&&e.month===i.month&&e.day===i.day}function At(e,i,t){const s=e*12+(i-1)+t,a=Math.floor(s/12),r=(s%12+12)%12+1;return{year:a,month:r}}function qt(e,i,t="en-US"){return new Intl.DateTimeFormat(t,{month:"long",year:"numeric"}).format(new Date(e,i-1,1))}function Rt(e,i="day"){const t=String(e.month).padStart(2,"0"),s=String(e.day).padStart(2,"0"),a=`${e.year}-${t}-${s}`;if(i==="minute"){const r=String(e.hour??0).padStart(2,"0"),o=String(e.minute??0).padStart(2,"0");return`${a} ${r}:${o}`}return a}function jt(e,i,t){return!!(i&&dt(e,i)<0||t&&dt(e,t)>0)}function Gt(e,i){const t=Gs(e,i),s=js(e,i),a=[];for(let r=0;r<t;r++)a.push(null);for(let r=1;r<=s;r++)a.push({year:e,month:i,day:r});for(;a.length%7!==0;)a.push(null);return a}const Qt=["Su","Mo","Tu","We","Th","Fr","Sa"];function fa(...e){const i=[];for(const t of e)if(t)if(typeof t=="string")i.push(t);else for(const[s,a]of Object.entries(t))a&&i.push(s);return i.join(" ")}function Qs(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/_/g,"-").toLowerCase()}const ga="http://www.w3.org/2000/svg";function n(e,i,t){const s=document.createElement(e);if(i)for(const[a,r]of Object.entries(i))r==null||r===!1||(r===!0?s.setAttribute(a,""):s.setAttribute(a,String(r)));if(t)for(const a of t)a==null||a===!1||s.append(typeof a=="string"||typeof a=="number"?document.createTextNode(String(a)):a);return s}function S(e,i,t){const s=document.createElementNS(ga,e);if(i)for(const[a,r]of Object.entries(i))r!=null&&s.setAttribute(a,String(r));if(t)for(const a of t)a&&s.append(a);return s}function T(e,i=16,t="0 0 24 24",s){return S("svg",{width:i,height:i,viewBox:t,fill:"none","aria-hidden":"true",class:s},e.map(a=>S("path",{d:a,fill:"currentColor"})))}const C={check:["M18.7 7.2a1 1 0 0 1 0 1.4l-8 8a1 1 0 0 1-1.4 0l-4-4a1 1 0 1 1 1.4-1.4L10 14.58l7.3-7.3a1 1 0 0 1 1.4 0Z"],x:["M17.3 18.7a1 1 0 0 0 1.4-1.4L13.42 12l5.3-5.3a1 1 0 0 0-1.42-1.4L12 10.58l-5.3-5.3a1 1 0 0 0-1.4 1.42L10.58 12l-5.3 5.3a1 1 0 1 0 1.42 1.4L12 13.42l5.3 5.3Z"],chevronDown:["M5.3 9.3a1 1 0 0 1 1.4 0l5.3 5.29 5.3-5.3a1 1 0 1 1 1.4 1.42l-6 6a1 1 0 0 1-1.4 0l-6-6a1 1 0 0 1 0-1.42Z"],chevronLeft:["M14.7 5.3a1 1 0 0 1 0 1.4L9.42 12l5.3 5.3a1 1 0 0 1-1.42 1.4l-6-6a1 1 0 0 1 0-1.4l6-6a1 1 0 0 1 1.42 0Z"],chevronRight:["M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z"],search:["M15.62 17.03a9 9 0 1 1 1.41-1.41l4.68 4.67a1 1 0 0 1-1.42 1.42l-4.67-4.68ZM17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"],plus:["M13 5a1 1 0 1 0-2 0v6H5a1 1 0 1 0 0 2h6v6a1 1 0 1 0 2 0v-6h6a1 1 0 1 0 0-2h-6V5Z"],minus:["M5 11a1 1 0 1 0 0 2h14a1 1 0 1 0 0-2H5Z"],info:["M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 4.75a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5ZM11 11a1 1 0 0 1 2 0v6a1 1 0 1 1-2 0v-6Z"],warning:["M10.27 3.87a2 2 0 0 1 3.46 0l8.04 13.86A2 2 0 0 1 20.04 21H3.96a2 2 0 0 1-1.73-3.27L10.27 3.87ZM12 8a1 1 0 0 0-1 1v4a1 1 0 1 0 2 0V9a1 1 0 0 0-1-1Zm0 8.25a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Z"],critical:["M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1 5a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0V7Zm1 9a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Z"],success:["M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm4.7 8.7-5 5a1 1 0 0 1-1.4 0l-2.5-2.5a1 1 0 1 1 1.4-1.4l1.8 1.8 4.3-4.3a1 1 0 1 1 1.4 1.4Z"],hash:["M10.99 3.16a1 1 0 1 0-1.98-.32L8.16 8H4a1 1 0 1 0 0 2h3.84l-.67 4H3a1 1 0 1 0 0 2h3.84l-.83 4.84a1 1 0 1 0 1.98.32L8.84 16h4.99l-.82 4.84a1 1 0 1 0 1.98.32L15.84 16H20a1 1 0 1 0 0-2h-3.84l.67-4H21a1 1 0 1 0 0-2h-3.84l.83-4.84a1 1 0 1 0-1.98-.32L15.16 8h-4.99l.82-4.84ZM14.84 10l-.67 4H9.16l.67-4h5.01Z"],voice:["M12 3a1 1 0 0 0-1-1h-.06a1 1 0 0 0-.74.32L5.92 7H3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h2.92l4.28 4.68a1 1 0 0 0 .74.32H11a1 1 0 0 0 1-1V3ZM15.1 20.75c-.58.14-1.1-.33-1.1-.92v-.03c0-.5.37-.92.85-1.05a7 7 0 0 0 0-13.5A1.11 1.11 0 0 1 14 4.2v-.03c0-.6.52-1.06 1.1-.92a9 9 0 0 1 0 17.5Z"],mic:["M12 2a4 4 0 0 0-4 4v5a4 4 0 0 0 8 0V6a4 4 0 0 0-4-4ZM6 11a1 1 0 1 0-2 0 8 8 0 0 0 7 7.93V21H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2h-3v-2.07A8 8 0 0 0 20 11a1 1 0 1 0-2 0 6 6 0 0 1-12 0Z"],micOff:["M12 2a4 4 0 0 0-4 4v3.17l7.59 7.59A4 4 0 0 0 16 11V6a4 4 0 0 0-4-4ZM3.7 2.3a1 1 0 0 0-1.4 1.4l18 18a1 1 0 0 0 1.4-1.4l-3.04-3.04A7.96 7.96 0 0 0 20 11a1 1 0 1 0-2 0c0 1.77-.77 3.37-2 4.47l-1.44-1.44A5.96 5.96 0 0 1 6 11a1 1 0 1 0-2 0 8 8 0 0 0 7 7.93V21H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2h-3v-2.07c.9-.11 1.75-.38 2.52-.78l1.62 1.62 1.41-1.41L3.7 2.3Z"],headphones:["M12 3a9 9 0 0 0-9 9v7a3 3 0 0 0 3 3h1a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2H5v-2a7 7 0 0 1 14 0v2h-2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h1a3 3 0 0 0 3-3v-7a9 9 0 0 0-9-9Z"],settings:["M10.56 1.1c-.46.05-.7.53-.64.98.18 1.16-.19 2.2-.98 2.53-.8.33-1.79-.15-2.49-1.1-.27-.36-.78-.52-1.14-.24-.77.59-1.45 1.27-2.04 2.04-.28.36-.12.87.24 1.14.96.7 1.43 1.7 1.1 2.49-.33.8-1.37 1.16-2.53.98-.45-.07-.93.18-.99.64a11.1 11.1 0 0 0 0 2.88c.06.46.54.7.99.64 1.16-.18 2.2.19 2.53.98.33.8-.14 1.79-1.1 2.49-.36.27-.52.78-.24 1.14.59.77 1.27 1.45 2.04 2.04.36.28.87.12 1.14-.24.7-.95 1.7-1.43 2.49-1.1.8.33 1.16 1.37.98 2.53-.07.45.18.93.64.99a11.1 11.1 0 0 0 2.88 0c.46-.06.7-.54.64-.99-.18-1.16.19-2.2.98-2.53.8-.33 1.79.14 2.49 1.1.27.36.78.52 1.14.24.77-.59 1.45-1.27 2.04-2.04.28-.36.12-.87-.24-1.14-.96-.7-1.43-1.7-1.1-2.49.33-.8 1.37-1.16 2.53-.98.45.07.93-.18.99-.64a11.1 11.1 0 0 0 0-2.88c-.06-.46-.54-.7-.99-.64-1.16.18-2.2-.19-2.53-.98-.33-.8.14-1.79 1.1-2.49.36-.27.52-.78.24-1.14a11.07 11.07 0 0 0-2.04-2.04c-.36-.28-.87-.11-1.14.24-.7.96-1.7 1.43-2.49 1.1-.8-.33-1.16-1.37-.98-2.53.07-.45-.18-.93-.64-.99a11.1 11.1 0 0 0-2.88 0ZM16 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"],send:["M2.01 21 23 12 2.01 3 2 10l15 2-15 2 .01 7Z"],calendar:["M7 2a1 1 0 0 1 1 1v1h8V3a1 1 0 1 1 2 0v1h1a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h1V3a1 1 0 0 1 1-1Zm12 8H5v9a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-9Z"],folder:["M2 6a3 3 0 0 1 3-3h4.17a3 3 0 0 1 2.12.88l1.12 1.12H19a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6Z"],reactionPlus:["M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8Zm-3.5-8.5A1.5 1.5 0 1 0 7 10a1.5 1.5 0 0 0 1.5 1.5Zm7 0A1.5 1.5 0 1 0 14 10a1.5 1.5 0 0 0 1.5 1.5ZM12 17.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5Z"]};function N(e,i,t){const s=e.getAttribute(i);if(!s)return t;try{return JSON.parse(s)}catch{return t}}function k(e,i,t,s="true"){t?e.setAttribute(i,s):e.removeAttribute(i)}function v(e,i,t){return e.dispatchEvent(new CustomEvent(i,{detail:t,bubbles:!0,composed:!0,cancelable:!0}))}function O(e){return e.key==="Enter"||e.key===" "}let va=0;function Aa(e="mana"){return`${e}-${++va}`}const Ea=typeof HTMLElement<"u"?HTMLElement:class{};class E extends Ea{constructor(){super(...arguments);d(this,"mounted",!1)}connectedCallback(){this.mounted=!0,this.onConnect(),this.render()}disconnectedCallback(){this.mounted=!1,this.onDisconnect()}attributeChangedCallback(){this.mounted&&this.render()}onConnect(){}onDisconnect(){}}const ya={new:"New",beta:"Beta",early_access:"Early Access",free_trial:"Free Trial"};class Jt extends E{render(){const i=this.getAttribute("theme")??"dark",t=this.getAttribute("density")??"default",s=this.hasAttribute("high-contrast")&&this.getAttribute("high-contrast")!=="false",a=this.hasAttribute("reduced-motion")&&this.getAttribute("reduced-motion")!=="false",r=this.getAttribute("saturation"),o=this.hasAttribute("underline-links")&&this.getAttribute("underline-links")!=="false";xs(this,{theme:i,density:t,highContrast:s,reducedMotion:a}),r!=null?this.style.setProperty("--saturation-factor",r):this.style.removeProperty("--saturation-factor"),k(this,"data-discord-underline-links",o)}}d(Jt,"observedAttributes",["theme","density","high-contrast","reduced-motion","saturation","underline-links"]);class te extends E{render(){const i=this.getAttribute("variant")??"body-md/normal",t=this.getAttribute("color"),s=this.getAttribute("line-clamp");this.setAttribute("data-text-variant",i),this.className=[`mana-text-${ut(i)}`,t?"":"mana-text-default-color",this.hasAttribute("selectable")?"mana-text-selectable":"",this.hasAttribute("tabular-numbers")?"mana-text-tabular":"",this.hasAttribute("scale-font-to-user-setting")?"mana-font-scaling":"",s==="1"?"mana-text-clamp-1":s?"mana-text-clamp-multi":""].filter(Boolean).join(" "),s&&s!=="1"?this.style.webkitLineClamp=s:this.style.removeProperty("-webkit-line-clamp"),t&&t!=="none"?this.style.color=It(t):this.style.removeProperty("color")}}d(te,"observedAttributes",["variant","selectable","line-clamp","color","tabular-numbers","scale-font-to-user-setting"]);class ee extends E{render(){const i=this.getAttribute("variant")??"heading-md/semibold",t=Number(this.getAttribute("level")??"2"),s=this.getAttribute("color");this.setAttribute("role","heading"),this.setAttribute("aria-level",String(Math.min(Math.max(1,t),6))),t>6?this.setAttribute("data-excessive-heading-level",String(t)):this.removeAttribute("data-excessive-heading-level"),this.setAttribute("data-text-variant",i),this.className=`mana-text-${ut(i)}${s?"":" mana-heading-default-color"}`,s&&s!=="none"?this.style.color=It(s):this.style.removeProperty("color")}}d(ee,"observedAttributes",["variant","level","color"]);class se extends E{render(){const i=this.getAttribute("type")??"new",t=this.getAttribute("variant")??"secondary",s=this.getAttribute("custom-text")??ya[i]??i;this.setAttribute("data-variant",t),this.setAttribute("data-text-variant","body-xs/semibold"),this.className=`mana-text-body-xs-semibold mana-badge mana-badge--${t}`,(this.hasAttribute("custom-text")||!this.textContent?.trim())&&(this.textContent=s)}}d(se,"observedAttributes",["type","variant","custom-text"]);class ie extends E{render(){const i=this.getAttribute("variant")??"grayLight",t=this.getAttribute("text");this.setAttribute("data-variant",i),this.setAttribute("data-text-variant","body-xs/semibold"),this.className=`mana-text-body-xs-semibold mana-chip mana-chip--${Qs(i)}`,t!=null&&(this.textContent=t)}}d(ie,"observedAttributes",["text","variant"]);class ae extends E{render(){const i=this.getAttribute("variant")??"primary",t=this.getAttribute("size")??"md",s=this.getAttribute("cutout"),a=this.getAttribute("aria-label");this.className=["mana-indicator-dot",`mana-indicator-dot--${i}`,`mana-indicator-dot--${t}`,s?`mana-indicator-dot--cutout-${s}`:""].filter(Boolean).join(" "),a?(this.setAttribute("role","img"),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.setAttribute("aria-hidden","true"))}}d(ae,"observedAttributes",["variant","size","cutout","aria-label"]);class ne extends E{render(){this.classList.add("mana-stack"),this.setAttribute("data-direction",this.getAttribute("direction")??"vertical"),this.setAttribute("data-align",this.getAttribute("align")??"stretch"),this.setAttribute("data-justify",this.getAttribute("justify")??"start"),this.setAttribute("data-wrap",this.getAttribute("wrap")??"false"),this.setAttribute("data-full-width",this.getAttribute("full-width")??"true"),this.style.gap=`var(--space-${this.getAttribute("gap")??"8"})`,this.style.padding=`var(--space-${this.getAttribute("padding")??"0"})`}}d(ne,"observedAttributes",["gap","direction","align","justify","wrap","padding","full-width"]);class re extends E{render(){const i=this.getAttribute("variant")??"purple",t=this.getAttribute("offset-bottom");this.className=`mana-gradient mana-gradient--${i}`,t?this.style.setProperty("--custom-gradient-offset-bottom",t):this.style.removeProperty("--custom-gradient-offset-bottom")}}d(re,"observedAttributes",["variant","offset-bottom"]);class oe extends E{render(){const i=this.getAttribute("src")??"",t=this.getAttribute("alt")??"",s=this.getAttribute("aspect-ratio")??"16-9",a=this.getAttribute("type")??"image";this.className=`mana-graphic mana-graphic--${s}`,this.replaceChildren(),i&&(a==="video"?this.append(n("video",{class:"mana-graphic-video",src:i,autoplay:!0,loop:!0,muted:!0,playsinline:!0})):this.append(n("img",{class:"mana-graphic-image",src:i,alt:t})))}}d(oe,"observedAttributes",["src","alt","aspect-ratio","type"]);class le extends E{constructor(){super(...arguments);d(this,"controlWrap",null);d(this,"labelWrap",null);d(this,"auxWrap",null)}onConnect(){if(!this.controlWrap){const t=Array.from(this.childNodes);this.labelWrap=n("div",{class:"mana-field-label-container"}),this.controlWrap=n("div",{class:"mana-field-control"});for(const s of t)this.controlWrap.append(s);this.auxWrap=n("div",{class:"mana-field-auxiliary"}),this.append(this.labelWrap,this.controlWrap,this.auxWrap)}}render(){const t=this.getAttribute("label"),s=this.getAttribute("description"),a=this.getAttribute("error-message"),r=this.getAttribute("helper-text"),o=this.hasAttribute("required"),l=this.hasAttribute("disabled"),c=this.getAttribute("layout")??"vertical";if(this.classList.add("mana-field-container"),this.setAttribute("data-layout",c),k(this,"data-disabled",l),this.labelWrap){if(this.labelWrap.replaceChildren(),t){const h=n("label",{class:"mana-field-label mana-text-body-sm-semibold mana-heading-default-color"},[t]);o&&h.append(n("span",{style:"color:var(--text-feedback-critical)","aria-hidden":"true"},["*"])),this.labelWrap.append(h)}s&&this.labelWrap.append(n("span",{class:"mana-text-body-xs-normal",style:"color:var(--text-subtle)"},[s])),this.labelWrap.hidden=!t&&!s}this.auxWrap&&(this.auxWrap.replaceChildren(),a?this.auxWrap.append(n("span",{class:"mana-field-status mana-field-status--error mana-text-body-xs-medium",role:"alert"},[a])):r&&this.auxWrap.append(n("span",{class:"mana-field-status mana-field-status--helper mana-text-body-xs-normal"},[r])),this.auxWrap.hidden=!a&&!r)}}d(le,"observedAttributes",["label","description","error-message","helper-text","required","disabled","layout"]);class ce extends E{constructor(){super(...arguments);d(this,"legendEl",null);d(this,"descEl",null);d(this,"bodyEl",null)}onConnect(){if(!this.bodyEl){const t=Array.from(this.childNodes);this.legendEl=n("div",{class:"mana-fieldset-legend mana-text-heading-sm-semibold mana-heading-default-color"}),this.descEl=n("div",{class:"mana-fieldset-description mana-text-body-sm-normal",style:"color:var(--text-subtle)"}),this.bodyEl=n("div",{class:"mana-stack","data-direction":"vertical"}),this.bodyEl.style.gap="var(--space-12)";for(const s of t)this.bodyEl.append(s);this.append(this.legendEl,this.descEl,this.bodyEl)}}render(){const t=this.getAttribute("label"),s=this.getAttribute("description"),a=this.hasAttribute("disabled");this.classList.add("mana-fieldset"),this.setAttribute("role","group"),t&&this.setAttribute("aria-label",t),k(this,"data-disabled",a),this.legendEl&&(this.legendEl.textContent=t??"",this.legendEl.hidden=!t),this.descEl&&(this.descEl.textContent=s??"",this.descEl.hidden=!s)}}d(ce,"observedAttributes",["label","description","disabled"]);class de extends E{render(){this.className=this.hasAttribute("show-on-focus")?"mana-hidden-visually--show-on-focus":"mana-hidden-visually"}}d(de,"observedAttributes",["show-on-focus"]);const wa={xs:"body-xs/medium",sm:"body-sm/medium",md:"body-md/medium"};class he extends E{constructor(){super(...arguments);d(this,"wrapperEl",null);d(this,"childrenEl",null);d(this,"labelSpan",null);d(this,"spinnerWrap",null);d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||this.hasAttribute("loading")||O(t)&&(t.preventDefault(),this.click())})}onConnect(){if(this.addEventListener("keydown",this.onKeyDown),!this.wrapperEl){const t=Array.from(this.childNodes);this.childrenEl=n("span",{class:"mana-button-children"});for(const s of t)this.childrenEl.append(s);this.wrapperEl=n("span",{class:"mana-button-children-wrapper"},[this.childrenEl]),this.append(this.wrapperEl)}}onDisconnect(){this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.getAttribute("variant")??"primary",s=this.getAttribute("size")??"md",a=this.hasAttribute("disabled"),r=this.hasAttribute("loading"),o=this.hasAttribute("full-width"),l=this.hasAttribute("rounded"),c=this.getAttribute("min-width"),h=this.getAttribute("text");if(h!=null&&this.childrenEl){this.labelSpan||(this.labelSpan=n("span"),this.childrenEl.replaceChildren(this.labelSpan));const u=wa[s]??"body-md/medium";this.labelSpan.className=`mana-text-${ut(u)}`,this.labelSpan.setAttribute("data-text-variant",u),this.labelSpan.textContent=h}const m=t!=="icon-only"&&t!=="input-accessory"&&!!(h??this.childrenEl?.textContent?.trim());if(this.setAttribute("data-mana-component","button"),this.setAttribute("data-variant",t),this.setAttribute("data-size",s),k(this,"data-has-text",m),k(this,"data-full-width",o),k(this,"data-rounded",l),this.setAttribute("role","button"),this.setAttribute("tabindex",a||r?"-1":"0"),k(this,"aria-disabled",a||r),k(this,"aria-busy",r),c?this.style.setProperty("--__button-min-width",/^\d+$/.test(c)?`${c}px`:c):this.style.removeProperty("--__button-min-width"),this.wrapperEl)if(r&&!this.spinnerWrap){const u=n("span",{class:"mana-spinner-inner"},[n("span",{class:"mana-spinner-item"}),n("span",{class:"mana-spinner-item"}),n("span",{class:"mana-spinner-item"})]),b=n("span",{class:"mana-spinner","data-type":"pulsingEllipsis","aria-hidden":"true"},[u]);this.spinnerWrap=n("span",{class:"mana-button-spinner-wrapper"},[b]),this.wrapperEl.append(this.spinnerWrap)}else!r&&this.spinnerWrap&&(this.spinnerWrap.remove(),this.spinnerWrap=null)}}d(he,"observedAttributes",["variant","size","disabled","loading","full-width","rounded","min-width","text"]);class ue extends E{render(){const i=this.getAttribute("direction")??"horizontal",t=this.hasAttribute("full-width");this.setAttribute("data-mana-component","button-group"),this.classList.add("mana-stack","mana-button-group"),this.setAttribute("data-direction",i),this.setAttribute("data-align",this.getAttribute("align")??"center"),this.setAttribute("data-justify",this.getAttribute("justify")??"start"),this.setAttribute("data-wrap",this.getAttribute("wrap")??(t?"false":"true")),k(this,"data-full-width",t),this.style.gap=`var(--space-${this.getAttribute("gap")??"8"})`}}d(ue,"observedAttributes",["direction","full-width","gap","align","justify","wrap"]);class me extends E{constructor(){super(...arguments);d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.click())})}onConnect(){this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.getAttribute("variant")??"primary",s=this.getAttribute("text-variant")??"body-md/medium",a=this.hasAttribute("disabled"),r=this.getAttribute("text");this.setAttribute("data-mana-component","text-button"),this.setAttribute("data-variant",t),this.setAttribute("data-text-variant",s),this.className=`mana-text-${ut(s)}`,this.setAttribute("role","button"),this.setAttribute("tabindex",a?"-1":"0"),k(this,"aria-disabled",a),r!=null&&(this.textContent=r)}}d(me,"observedAttributes",["variant","text-variant","disabled","text"]);class pe extends E{constructor(){super(...arguments);d(this,"wrapperEl",null);d(this,"childrenEl",null);d(this,"handleToggle",()=>{this.hasAttribute("disabled")||(this.hasAttribute("pressed")?this.removeAttribute("pressed"):this.setAttribute("pressed",""),v(this,"change",{pressed:this.hasAttribute("pressed")}))});d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.handleToggle())})}onConnect(){if(this.addEventListener("click",this.handleToggle),this.addEventListener("keydown",this.onKeyDown),!this.wrapperEl){const t=Array.from(this.childNodes);this.childrenEl=n("span",{class:"mana-button-children"});for(const s of t)this.childrenEl.append(s);this.wrapperEl=n("span",{class:"mana-button-children-wrapper"},[this.childrenEl]),this.append(this.wrapperEl)}}onDisconnect(){this.removeEventListener("click",this.handleToggle),this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.hasAttribute("pressed"),s=this.getAttribute("size")??"md",a=this.hasAttribute("disabled"),r=this.getAttribute("text");r!=null&&this.childrenEl&&(this.childrenEl.textContent=r),this.setAttribute("data-mana-component","toggle-button"),this.setAttribute("data-size",s),this.setAttribute("role","button"),this.setAttribute("aria-pressed",String(t)),this.setAttribute("tabindex",a?"-1":"0"),k(this,"aria-disabled",a)}}d(pe,"observedAttributes",["pressed","size","disabled","text"]);class be extends E{constructor(){super(...arguments);d(this,"handleToggle",()=>{this.hasAttribute("disabled")||(this.hasAttribute("pressed")?this.removeAttribute("pressed"):this.setAttribute("pressed",""),v(this,"change",{pressed:this.hasAttribute("pressed")}))});d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.handleToggle())})}onConnect(){this.addEventListener("click",this.handleToggle),this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("click",this.handleToggle),this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.hasAttribute("pressed"),s=this.getAttribute("variant")??"secondary",a=this.getAttribute("size")??"md",r=this.hasAttribute("disabled");this.setAttribute("data-mana-component","toggle-icon-button"),this.setAttribute("data-variant",s),this.setAttribute("data-size",a),this.setAttribute("role","button"),this.setAttribute("aria-pressed",String(t)),this.setAttribute("tabindex",r?"-1":"0"),k(this,"aria-disabled",r)}}d(be,"observedAttributes",["pressed","variant","size","disabled"]);class fe extends E{constructor(){super(...arguments);d(this,"wrapperEl",null);d(this,"childrenEl",null);d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.click())})}onConnect(){if(this.addEventListener("keydown",this.onKeyDown),!this.wrapperEl){const t=Array.from(this.childNodes);this.childrenEl=n("span",{class:"mana-button-children"});for(const s of t)this.childrenEl.append(s);this.wrapperEl=n("span",{class:"mana-button-children-wrapper"},[this.childrenEl]),this.append(this.wrapperEl)}}onDisconnect(){this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.getAttribute("variant")??"icon-only",s=this.getAttribute("size")??"sm",a=this.hasAttribute("disabled");this.setAttribute("data-mana-component","button"),this.setAttribute("data-variant",t),this.setAttribute("data-size",s),this.setAttribute("role","button"),this.setAttribute("tabindex",a?"-1":"0"),k(this,"aria-disabled",a)}}d(fe,"observedAttributes",["variant","size","disabled"]);class ge extends E{constructor(){super(...arguments);d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.click())})}onConnect(){this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.getAttribute("size")??"sm",s=this.hasAttribute("disabled");if(this.setAttribute("data-mana-component","button"),this.setAttribute("data-variant","icon-only"),this.setAttribute("data-size",t),this.setAttribute("role","button"),this.setAttribute("tabindex",s?"-1":"0"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Close"),k(this,"aria-disabled",s),!this.querySelector(".mana-button-children-wrapper")){const a=t==="xs"?14:t==="md"?20:16;this.replaceChildren(n("span",{class:"mana-button-children-wrapper"},[n("span",{class:"mana-button-children"},[T([...C.x],a)])]))}}}d(ge,"observedAttributes",["size","disabled","aria-label"]);class ve extends E{render(){this.setAttribute("data-mana-component","toolbar"),this.setAttribute("role","toolbar")}}d(ve,"observedAttributes",["aria-label"]);class Ae extends E{render(){this.setAttribute("data-mana-component","toolbar-group"),this.setAttribute("role","group")}}d(Ae,"observedAttributes",[]);class Ee extends E{render(){this.setAttribute("data-mana-component","toolbar-separator"),this.setAttribute("role","separator"),this.setAttribute("aria-orientation","vertical")}}d(Ee,"observedAttributes",[]);const xa="M7.89561 14.8538L6.30462 13.2629L14.3099 5.25755L15.9009 6.84854L7.89561 14.8538Z",ka="M4.08643 11.0903L5.67742 9.49929L9.4485 13.2704L7.85751 14.8614L4.08643 11.0903Z",La="M5.13231 6.72963L6.7233 5.13864L14.855 13.2704L13.264 14.8614L5.13231 6.72963Z",Ca="M13.2704 5.13864L14.8614 6.72963L6.72963 14.8614L5.13864 13.2704L13.2704 5.13864Z";class ye extends E{constructor(){super(...arguments);d(this,"anim",null);d(this,"boxEl",null);d(this,"labelWrap",null);d(this,"handleToggle",()=>{if(this.hasAttribute("disabled"))return;const t=!this.hasAttribute("checked");this.removeAttribute("indeterminate"),this.anim=t?"in":"out",this.checked=t,v(this,"change",{checked:t,value:this.getAttribute("value")??""})});d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.handleToggle())})}get checked(){return this.hasAttribute("checked")}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}onConnect(){this.addEventListener("click",this.handleToggle),this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("click",this.handleToggle),this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.hasAttribute("checked"),s=this.hasAttribute("indeterminate"),a=this.hasAttribute("disabled"),r=this.getAttribute("label"),o=this.getAttribute("description");if(this.setAttribute("data-mana-component","checkbox"),this.setAttribute("role","checkbox"),this.setAttribute("aria-checked",s?"mixed":String(t)),this.setAttribute("tabindex",a?"-1":"0"),k(this,"data-selected",t||s),k(this,"data-disabled",a),k(this,"aria-disabled",a),this.anim?this.setAttribute("data-anim",this.anim):this.removeAttribute("data-anim"),!this.boxEl){const c=S("svg",{class:"mana-checkbox-dot-svg",viewBox:"0 0 20 20","aria-hidden":"true"},[S("circle",{class:"mana-checkbox-dot",cx:"10",cy:"10",r:"3",fill:"currentColor"})]),h=S("svg",{class:"mana-checkbox-stroke",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[S("path",{d:C.check[0],fill:"currentColor"})]);this.boxEl=n("span",{class:"mana-checkbox-box"},[c,h]),this.prepend(this.boxEl)}const l=this.boxEl.querySelector(".mana-checkbox-stroke path");if(l&&l.setAttribute("d",s?C.minus[0]:C.check[0]),r||o){this.labelWrap||(this.labelWrap=n("span",{class:"mana-stack","data-direction":"vertical"}),this.labelWrap.style.gap="var(--space-4)",this.append(this.labelWrap));const c=[];r&&c.push(n("span",{class:"mana-text-body-md-medium mana-text-default-color"},[r])),o&&c.push(n("span",{class:"mana-text-body-sm-normal",style:"color:var(--text-subtle)"},[o])),this.labelWrap.replaceChildren(...c)}else this.labelWrap&&(this.labelWrap.remove(),this.labelWrap=null)}}d(ye,"observedAttributes",["checked","indeterminate","disabled","label","description","value"]);class we extends E{constructor(){super(...arguments);d(this,"_options",null);d(this,"_values",null)}get options(){return this._options??N(this,"options",[])}set options(t){this._options=t,this.mounted&&this.render()}get values(){return this._values??N(this,"values",[])}set values(t){this._values=t,this.mounted&&this.render()}render(){this.setAttribute("data-mana-component","checkbox-group"),this.setAttribute("role","group");const t=this.hasAttribute("disabled"),s=this.options;if(s.length===0)return;const a=new Set(this.values);this.replaceChildren();for(const r of s){const o=document.createElement("mana-checkbox");o.setAttribute("value",r.value),o.setAttribute("label",r.label),r.description&&o.setAttribute("description",r.description),a.has(r.value)&&o.setAttribute("checked",""),(t||r.disabled)&&o.setAttribute("disabled",""),o.addEventListener("change",l=>{l.stopPropagation();const c=new Set(this.values);o.checked?c.add(r.value):c.delete(r.value),this._values=Array.from(c),v(this,"change",{values:this._values})}),this.append(o)}}}d(we,"observedAttributes",["options","values","disabled"]);class xe extends E{constructor(){super(...arguments);d(this,"_options",null)}get options(){return this._options??N(this,"options",[])}set options(t){this._options=t,this.mounted&&this.render()}get value(){return this.getAttribute("value")??""}set value(t){this.setAttribute("value",t)}render(){this.setAttribute("data-mana-component","BaseRadioGroup"),this.setAttribute("role","radiogroup");const t=this.hasAttribute("disabled"),s=this.value,a=this.options;this.replaceChildren(),a.forEach((r,o)=>{const l=r.value===s,c=t||!!r.disabled,h=n("span",{class:"mana-radio-indicator","data-checked":l?"true":void 0,"aria-hidden":"true"}),m=n("span",{class:"mana-stack","data-direction":"vertical"},[n("span",{class:"mana-text-body-md-medium mana-text-default-color"},[r.name]),r.description?n("span",{class:"mana-text-body-sm-normal",style:"color:var(--text-subtle)"},[r.description]):null]);m.style.gap="var(--space-4)";const u=n("div",{class:"mana-radio-item",role:"radio","aria-checked":String(l),"aria-disabled":c?"true":void 0,"data-selected":l?"true":void 0,"data-disabled":c?"true":void 0,tabindex:c?-1:l||!s&&o===0?0:-1},[h,m]),b=()=>{c||(this.setAttribute("value",r.value),v(this,"change",{value:r.value}))};u.addEventListener("click",b),u.addEventListener("keydown",f=>{if(O(f)){f.preventDefault(),b();return}if(f.key==="ArrowDown"||f.key==="ArrowRight"||f.key==="ArrowUp"||f.key==="ArrowLeft"){f.preventDefault();const g=a.filter(L=>!(t||L.disabled));if(!g.length)return;const A=g.findIndex(L=>L.value===r.value),y=f.key==="ArrowDown"||f.key==="ArrowRight"?1:-1,w=g[(A+y+g.length)%g.length];this.setAttribute("value",w.value),v(this,"change",{value:w.value}),this.querySelector('[role="radio"][aria-checked="true"]')?.focus()}}),this.append(u)})}}d(xe,"observedAttributes",["options","value","disabled","aria-label"]);class ke extends E{constructor(){super(...arguments);d(this,"pressed",!1);d(this,"onPointerDown",()=>{this.hasAttribute("disabled")||(this.pressed=!0,this.syncThumb())});d(this,"onPointerUp",()=>{this.pressed&&(this.pressed=!1,this.syncThumb())});d(this,"handleClick",()=>{this.hasAttribute("disabled")||(this.checked=!this.checked,v(this,"change",{checked:this.checked}))});d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.handleClick())})}get checked(){return this.hasAttribute("checked")}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}onConnect(){this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.onKeyDown),this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointerleave",this.onPointerUp)}onDisconnect(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.onKeyDown),this.removeEventListener("pointerdown",this.onPointerDown),this.removeEventListener("pointerup",this.onPointerUp),this.removeEventListener("pointerleave",this.onPointerUp)}syncThumb(){const t=this.querySelector(".mana-switch-thumb-rect");t&&(t.setAttribute("x",this.pressed?"2":"4"),t.setAttribute("y",this.pressed?"6":"4"),t.setAttribute("width",this.pressed?"20":"16"),t.setAttribute("height",this.pressed?"12":"16"),t.setAttribute("rx",this.pressed?"6":"8"))}render(){const t=this.checked,s=this.hasAttribute("disabled"),a=this.hasAttribute("has-icon");this.setAttribute("data-mana-component","switch"),this.setAttribute("role","switch"),this.setAttribute("tabindex",s?"-1":"0"),this.setAttribute("aria-checked",String(t)),k(this,"data-checked",t),k(this,"data-disabled",s),k(this,"aria-disabled",s);const r=[S("rect",{class:"mana-switch-thumb-rect",x:this.pressed?2:4,y:this.pressed?6:4,width:this.pressed?20:16,height:this.pressed?12:16,rx:this.pressed?6:8})];a&&r.push(S("svg",{viewBox:"0 0 24 24",fill:"none"},[S("g",{transform:"translate(4 4)"},[S("path",{class:"mana-switch-thumb-icon",d:t?xa:La}),S("path",{class:"mana-switch-thumb-icon",d:t?ka:Ca})])])),this.replaceChildren(S("svg",{class:"mana-switch-thumb-svg",viewBox:"0 0 24 24",preserveAspectRatio:"xMidYMin meet","aria-hidden":"true"},r))}}d(ke,"observedAttributes",["checked","disabled","has-icon"]);class Le extends E{constructor(){super(...arguments);d(this,"inputEl",null);d(this,"wrapperEl",null);d(this,"clearBtn",null);d(this,"countEl",null)}get value(){return this.inputEl?this.inputEl.value:this.getAttribute("value")??""}set value(t){this.setAttribute("value",t),this.inputEl&&this.inputEl.value!==t&&(this.inputEl.value=t),this.syncAux()}onConnect(){this.wrapperEl||(this.inputEl=n("input",{class:"mana-text-input-native"}),this.inputEl.addEventListener("input",()=>{const t=this.inputEl.value;this.syncAux(),v(this,"input",{value:t})}),this.inputEl.addEventListener("change",()=>{v(this,"change",{value:this.inputEl.value})}),this.clearBtn=n("button",{type:"button",class:"mana-text-input-icon mana-text-input-clear","aria-label":"Clear"},[T([...C.x],14)]),this.clearBtn.addEventListener("click",()=>{this.inputEl&&(this.inputEl.value="",this.setAttribute("value",""),this.syncAux(),v(this,"input",{value:""}),v(this,"clear",{value:""}),this.inputEl.focus())}),this.wrapperEl=n("div",{class:"mana-input-field-wrapper","data-mana-component":"text-input"},[this.inputEl,this.clearBtn]),this.countEl=n("span",{class:"mana-char-count mana-text-body-xs-normal"}),this.append(this.wrapperEl,this.countEl))}syncAux(){const t=this.inputEl?.value??"",s=this.hasAttribute("clearable")&&!this.hasAttribute("disabled")&&!this.hasAttribute("read-only");this.clearBtn&&(this.clearBtn.hidden=!(s&&t.length>0)),this.wrapperEl&&k(this.wrapperEl,"data-has-trailing",s&&t.length>0);const a=this.getAttribute("max-length"),r=this.hasAttribute("show-character-count")&&a!=null;if(this.countEl&&(this.countEl.hidden=!r,r)){const o=Number(a);this.countEl.textContent=`${t.length} / ${o}`,k(this.countEl,"data-over-limit",t.length>o)}}render(){if(!this.inputEl||!this.wrapperEl)return;const t=this.getAttribute("size")??"md",s=this.hasAttribute("disabled"),a=this.hasAttribute("read-only"),r=this.hasAttribute("error");this.wrapperEl.setAttribute("data-size",t),k(this.wrapperEl,"data-disabled",s),k(this.wrapperEl,"data-read-only",a),k(this.wrapperEl,"data-error",r),this.inputEl.type=this.getAttribute("type")??"text",this.inputEl.placeholder=this.getAttribute("placeholder")??"",this.inputEl.disabled=s,this.inputEl.readOnly=a,this.inputEl.required=this.hasAttribute("required");const o=this.getAttribute("max-length");o!=null?this.inputEl.maxLength=Number(o):this.inputEl.removeAttribute("maxlength");const l=this.getAttribute("aria-label");l&&this.inputEl.setAttribute("aria-label",l);const c=this.getAttribute("value");c!=null&&this.inputEl.value!==c&&(this.inputEl.value=c),this.syncAux()}}d(Le,"observedAttributes",["value","placeholder","type","size","disabled","read-only","required","max-length","clearable","error","show-character-count","aria-label"]);class Ce extends E{constructor(){super(...arguments);d(this,"areaEl",null);d(this,"wrapperEl",null);d(this,"countEl",null)}get value(){return this.areaEl?this.areaEl.value:this.getAttribute("value")??""}set value(t){this.setAttribute("value",t),this.areaEl&&this.areaEl.value!==t&&(this.areaEl.value=t),this.syncCount()}onConnect(){this.wrapperEl||(this.areaEl=n("textarea",{class:"mana-text-area-native"}),this.areaEl.addEventListener("input",()=>{this.syncCount(),v(this,"input",{value:this.areaEl.value})}),this.areaEl.addEventListener("change",()=>{v(this,"change",{value:this.areaEl.value})}),this.wrapperEl=n("div",{class:"mana-input-field-wrapper","data-mana-component":"text-area"},[this.areaEl]),this.countEl=n("span",{class:"mana-char-count mana-text-body-xs-normal"}),this.append(this.wrapperEl,this.countEl))}syncCount(){const t=this.areaEl?.value??"",s=this.getAttribute("max-length"),a=this.hasAttribute("show-character-count")&&s!=null;if(this.countEl&&(this.countEl.hidden=!a,a)){const r=Number(s);this.countEl.textContent=`${t.length} / ${r}`,k(this.countEl,"data-over-limit",t.length>r)}}render(){if(!this.areaEl||!this.wrapperEl)return;const t=this.hasAttribute("disabled"),s=this.hasAttribute("read-only"),a=this.hasAttribute("error");k(this.wrapperEl,"data-disabled",t),k(this.wrapperEl,"data-read-only",s),k(this.wrapperEl,"data-error",a),this.areaEl.rows=Number(this.getAttribute("rows")??"3"),this.areaEl.placeholder=this.getAttribute("placeholder")??"",this.areaEl.disabled=t,this.areaEl.readOnly=s,this.areaEl.required=this.hasAttribute("required");const r=this.getAttribute("max-length");r!=null&&(this.areaEl.maxLength=Number(r));const o=this.getAttribute("aria-label");o&&this.areaEl.setAttribute("aria-label",o);const l=this.getAttribute("value");l!=null&&this.areaEl.value!==l&&(this.areaEl.value=l),this.syncCount()}}d(Ce,"observedAttributes",["value","placeholder","rows","disabled","read-only","required","max-length","error","show-character-count","aria-label"]);class _e extends E{constructor(){super(...arguments);d(this,"inputEl",null);d(this,"wrapperEl",null);d(this,"clearBtn",null)}get value(){return this.inputEl?this.inputEl.value:this.getAttribute("value")??""}set value(t){this.setAttribute("value",t),this.inputEl&&this.inputEl.value!==t&&(this.inputEl.value=t),this.syncClear()}onConnect(){if(!this.wrapperEl){const t=n("span",{class:"mana-text-input-icon","aria-hidden":"true"},[T([...C.search],16)]);this.inputEl=n("input",{type:"search",class:"mana-text-input-native"}),this.inputEl.addEventListener("input",()=>{this.syncClear(),v(this,"input",{value:this.inputEl.value})}),this.inputEl.addEventListener("change",()=>{v(this,"change",{value:this.inputEl.value})}),this.clearBtn=n("button",{type:"button",class:"mana-text-input-icon mana-text-input-clear","aria-label":"Clear search"},[T([...C.x],14)]),this.clearBtn.addEventListener("click",()=>{this.inputEl&&(this.inputEl.value="",this.setAttribute("value",""),this.syncClear(),v(this,"input",{value:""}),v(this,"clear",{value:""}),this.inputEl.focus())}),this.wrapperEl=n("div",{class:"mana-input-field-wrapper","data-mana-component":"text-input","data-has-leading":"true"},[t,this.inputEl,this.clearBtn]),this.append(this.wrapperEl)}}syncClear(){const t=(this.inputEl?.value.length??0)>0&&!this.hasAttribute("disabled");this.clearBtn&&(this.clearBtn.hidden=!t),this.wrapperEl&&k(this.wrapperEl,"data-has-trailing",t)}render(){if(!this.inputEl||!this.wrapperEl)return;const t=this.hasAttribute("disabled");this.wrapperEl.setAttribute("data-size",this.getAttribute("size")??"sm"),k(this.wrapperEl,"data-disabled",t),this.inputEl.disabled=t,this.inputEl.placeholder=this.getAttribute("placeholder")??"Search",this.inputEl.setAttribute("aria-label",this.getAttribute("aria-label")??this.inputEl.placeholder);const s=this.getAttribute("value");s!=null&&this.inputEl.value!==s&&(this.inputEl.value=s),this.syncClear()}}d(_e,"observedAttributes",["value","placeholder","size","disabled","aria-label"]);class Te extends E{constructor(){super(...arguments);d(this,"inputEl",null);d(this,"wrapperEl",null)}get value(){return Number(this.inputEl?.value??this.getAttribute("value")??"0")}set value(t){this.setAttribute("value",String(t))}onConnect(){if(!this.wrapperEl){const t=n("button",{type:"button",class:"mana-text-input-icon mana-text-input-accessory","aria-label":"Decrement"},[T([...C.minus],14)]),s=n("button",{type:"button",class:"mana-text-input-icon mana-text-input-accessory","aria-label":"Increment"},[T([...C.plus],14)]);this.inputEl=n("input",{type:"number",class:"mana-text-input-native"});const a=r=>{if(this.hasAttribute("disabled")||!this.inputEl)return;const o=Number(this.getAttribute("step")??"1"),l=this.hasAttribute("min")?Number(this.getAttribute("min")):-1/0,c=this.hasAttribute("max")?Number(this.getAttribute("max")):1/0,h=Math.min(c,Math.max(l,(Number(this.inputEl.value)||0)+r*o));this.inputEl.value=String(h),this.setAttribute("value",String(h)),v(this,"input",{value:h}),v(this,"change",{value:h})};t.addEventListener("click",()=>a(-1)),s.addEventListener("click",()=>a(1)),this.inputEl.addEventListener("input",()=>v(this,"input",{value:Number(this.inputEl.value)})),this.inputEl.addEventListener("change",()=>v(this,"change",{value:Number(this.inputEl.value)})),this.wrapperEl=n("div",{class:"mana-input-field-wrapper","data-mana-component":"text-input","data-has-leading":"true","data-has-trailing":"true"},[t,this.inputEl,s]),this.append(this.wrapperEl)}}render(){if(!this.inputEl||!this.wrapperEl)return;const t=this.hasAttribute("disabled");this.wrapperEl.setAttribute("data-size",this.getAttribute("size")??"md"),k(this.wrapperEl,"data-disabled",t),this.inputEl.disabled=t,this.hasAttribute("min")&&(this.inputEl.min=this.getAttribute("min")),this.hasAttribute("max")&&(this.inputEl.max=this.getAttribute("max")),this.hasAttribute("step")&&(this.inputEl.step=this.getAttribute("step"));const s=this.getAttribute("value")??"0";this.inputEl.value!==s&&(this.inputEl.value=s);const a=this.getAttribute("aria-label");a&&this.inputEl.setAttribute("aria-label",a)}}d(Te,"observedAttributes",["value","min","max","step","disabled","size","aria-label"]);class Se extends E{constructor(){super(...arguments);d(this,"dragging",!1);d(this,"rootEl",null);d(this,"fillEl",null);d(this,"grabberEl",null);d(this,"bubbleEl",null);d(this,"marksEl",null);d(this,"_marks",null)}get marks(){return this._marks??N(this,"marks",[])}set marks(t){this._marks=t,this.mounted&&this.render()}get value(){return Number(this.getAttribute("value")??this.getAttribute("min")??"0")}set value(t){this.setAttribute("value",String(t))}clampStep(t){const s=Number(this.getAttribute("min")??"0"),a=Number(this.getAttribute("max")??"100"),r=Number(this.getAttribute("step")??"1"),o=Math.round((t-s)/r)*r+s;return Math.min(a,Math.max(s,Number(o.toFixed(6))))}updateFromClientX(t,s=!1){if(!this.rootEl)return;const a=this.rootEl.getBoundingClientRect(),r=Number(this.getAttribute("min")??"0"),o=Number(this.getAttribute("max")??"100"),l=a.width>0?Math.min(1,Math.max(0,(t-a.left)/a.width)):0,c=this.clampStep(r+l*(o-r));this.setAttribute("value",String(c)),v(this,"input",{value:c}),s&&v(this,"change",{value:c})}onConnect(){if(!this.rootEl){this.fillEl=n("div",{class:"mana-slider-bar-fill"});const t=n("div",{class:"mana-slider-bar"},[this.fillEl]);this.bubbleEl=n("div",{class:"mana-slider-bubble"}),this.grabberEl=n("div",{class:"mana-slider-grabber",role:"slider",tabindex:0},[this.bubbleEl]);const s=n("div",{class:"mana-slider-track"},[this.grabberEl]);this.marksEl=n("div",{class:"mana-slider-track-marks"}),this.rootEl=n("div",{class:"mana-slider"},[this.marksEl,t,s]),this.rootEl.addEventListener("pointerdown",a=>{if(this.hasAttribute("disabled"))return;this.dragging=!0,this.rootEl.setAttribute("data-dragging","true"),this.updateFromClientX(a.clientX);const r=l=>this.updateFromClientX(l.clientX),o=l=>{this.dragging=!1,this.rootEl?.removeAttribute("data-dragging"),this.updateFromClientX(l.clientX,!0),window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",o)};window.addEventListener("pointermove",r),window.addEventListener("pointerup",o)}),this.grabberEl.addEventListener("keydown",a=>{if(this.hasAttribute("disabled"))return;const r=Number(this.getAttribute("min")??"0"),o=Number(this.getAttribute("max")??"100"),l=Number(this.getAttribute("step")??"1");let c=null;a.key==="ArrowRight"||a.key==="ArrowUp"?c=this.clampStep(this.value+l):a.key==="ArrowLeft"||a.key==="ArrowDown"?c=this.clampStep(this.value-l):a.key==="PageUp"?c=this.clampStep(this.value+l*10):a.key==="PageDown"?c=this.clampStep(this.value-l*10):a.key==="Home"?c=r:a.key==="End"&&(c=o),c!=null&&(a.preventDefault(),this.setAttribute("value",String(c)),v(this,"input",{value:c}),v(this,"change",{value:c}))}),this.append(this.rootEl)}}render(){if(!this.rootEl||!this.fillEl||!this.grabberEl||!this.bubbleEl||!this.marksEl)return;const t=Number(this.getAttribute("min")??"0"),s=Number(this.getAttribute("max")??"100"),a=this.clampStep(this.value),r=s>t?(a-t)/(s-t)*100:0,o=this.hasAttribute("disabled"),l=this.marks;k(this.rootEl,"data-disabled",o),k(this.rootEl,"data-has-marks",l.length>0),this.fillEl.style.width=`${r}%`,this.grabberEl.style.insetInlineStart=`${r}%`,this.grabberEl.tabIndex=o?-1:0,this.grabberEl.setAttribute("aria-valuemin",String(t)),this.grabberEl.setAttribute("aria-valuemax",String(s)),this.grabberEl.setAttribute("aria-valuenow",String(a)),this.hasAttribute("aria-label")&&this.grabberEl.setAttribute("aria-label",this.getAttribute("aria-label")),k(this.grabberEl,"aria-disabled",o);const c=this.hasAttribute("show-bubble")||this.dragging;this.bubbleEl.hidden=!c,this.bubbleEl.textContent=String(a),this.marksEl.replaceChildren();for(const h of l){const m=s>t?(h-t)/(s-t)*100:0,u=n("div",{class:"mana-slider-mark"},[n("span",{class:"mana-slider-mark-value"},[String(h)]),n("span",{class:"mana-slider-mark-dash"})]);u.style.insetInlineStart=`${m}%`,this.marksEl.append(u)}}}d(Se,"observedAttributes",["value","min","max","step","disabled","marks","show-bubble","aria-label"]);function j(e){if(!e)return null;const i=e.match(/^(\d{4})-(\d{2})-(\d{2})/);return i?{year:Number(i[1]),month:Number(i[2]),day:Number(i[3])}:null}class Me extends E{constructor(){super(...arguments);d(this,"onClick",t=>{if(this.hasAttribute("disabled")||t.target?.closest(".mana-tag-remove"))return;const s=!this.hasAttribute("selected");s?this.setAttribute("selected",""):this.removeAttribute("selected"),v(this,"change",{selected:s,label:this.getAttribute("label")??this.textContent?.trim()??""})});d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||(O(t)?(t.preventDefault(),this.click()):(t.key==="Backspace"||t.key==="Delete")&&this.hasAttribute("removable")&&(t.preventDefault(),v(this,"remove",{label:this.getAttribute("label")??""})))})}onConnect(){this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("click",this.onClick),this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.getAttribute("label"),s=this.getAttribute("variant")??"default",a=this.getAttribute("size")??"sm",r=this.hasAttribute("selected"),o=this.hasAttribute("disabled"),l=this.hasAttribute("removable");if(this.setAttribute("data-mana-component","tag"),this.setAttribute("data-variant",s),this.setAttribute("data-size",a),k(this,"data-selected",r),k(this,"data-disabled",o),this.setAttribute("role","option"),this.setAttribute("aria-selected",String(r)),this.setAttribute("tabindex",o?"-1":"0"),t!=null){const c=[n("span",{class:"mana-text-body-sm-medium"},[t])];if(l){const h=n("button",{type:"button",class:"mana-tag-remove","aria-label":`Remove ${t}`},[T([...C.x],12)]);h.addEventListener("click",m=>{m.stopPropagation(),o||v(this,"remove",{label:t})}),c.push(h)}this.replaceChildren(...c)}}}d(Me,"observedAttributes",["label","variant","size","selected","disabled","removable"]);class De extends E{constructor(){super(...arguments);d(this,"_items",null)}get items(){return this._items??N(this,"items",[])}set items(t){this._items=t,this.mounted&&this.render()}render(){this.setAttribute("data-mana-component","tag-group"),this.setAttribute("role","listbox");const t=this.getAttribute("layout");t&&this.setAttribute("data-layout",t);const s=this.items;if(s.length===0)return;const a=this.getAttribute("size")??"sm",r=this.getAttribute("variant")??"default";this.replaceChildren();for(const o of s){const l=document.createElement("mana-tag");l.setAttribute("label",o.label),l.setAttribute("size",a),l.setAttribute("variant",r),o.selected&&l.setAttribute("selected",""),o.disabled&&l.setAttribute("disabled",""),o.removable&&l.setAttribute("removable",""),l.addEventListener("remove",c=>{c.stopPropagation(),v(this,"remove",{id:o.id,item:o})}),l.addEventListener("change",c=>{c.stopPropagation(),v(this,"change",{id:o.id,selected:l.hasAttribute("selected"),item:o})}),this.append(l)}}}d(De,"observedAttributes",["items","layout","size","variant","aria-label"]);class Ne extends E{constructor(){super(...arguments);d(this,"_items",null);d(this,"activeIndex",-1);d(this,"onKeyDown",t=>{const s=this.items;if(s.length){if(t.key==="ArrowDown"||t.key==="ArrowUp"||t.key==="Home"||t.key==="End"){if(t.preventDefault(),t.key==="Home")this.activeIndex=0;else if(t.key==="End")this.activeIndex=s.length-1;else{const a=t.key==="ArrowDown"?1:-1;this.activeIndex=(this.activeIndex+a+s.length)%s.length}this.render()}else if(O(t)&&this.activeIndex>=0&&s[this.activeIndex]&&!s[this.activeIndex].disabled){t.preventDefault();const a=s[this.activeIndex];this.setAttribute("value",a.value),v(this,"change",{value:a.value,item:a})}}})}get items(){return this._items??N(this,"items",[])}set items(t){this._items=t,this.mounted&&this.render()}get value(){return this.getAttribute("value")??""}set value(t){this.setAttribute("value",t)}onConnect(){this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("keydown",this.onKeyDown)}render(){this.setAttribute("data-mana-component","listbox"),this.setAttribute("role","listbox"),this.setAttribute("tabindex","0"),k(this,"data-scrollable",this.hasAttribute("scrollable"));const t=this.items,s=this.value;if(this.replaceChildren(),t.length===0){this.append(n("div",{class:"mana-listbox-empty mana-text-body-sm-normal"},[this.getAttribute("empty-text")??"No items"]));return}let a;t.forEach((r,o)=>{r.group&&r.group!==a&&(a=r.group,this.append(n("div",{class:"mana-listbox-group-label mana-text-body-xs-semibold"},[r.group])));const l=r.value===s,c=n("div",{class:"mana-listbox-option",role:"option","aria-selected":String(l),"aria-disabled":r.disabled?"true":void 0,"data-focus-visible":o===this.activeIndex?"true":void 0},[n("div",{class:"mana-listbox-option-content"},[n("span",{class:"mana-listbox-option-label mana-text-body-md-medium"},[r.label]),l?n("span",{class:"mana-listbox-selected-icon","aria-hidden":"true"},[T([...C.check],16)]):null])]);c.addEventListener("click",()=>{r.disabled||(this.activeIndex=o,this.setAttribute("value",r.value),v(this,"change",{value:r.value,item:r}))}),this.append(c)})}}d(Ne,"observedAttributes",["items","value","selection-mode","empty-text","scrollable"]);class Be extends E{constructor(){super(...arguments);d(this,"_options",null);d(this,"isOpen",!1);d(this,"dropdownEl",null);d(this,"onOutsideClick",t=>{const s=t.target;s&&(this.contains(s)||this.dropdownEl?.contains(s)||this.closeDropdown())});d(this,"onDocKeyDown",t=>{t.key==="Escape"&&this.closeDropdown()})}get options(){return this._options??N(this,"options",[])}set options(t){this._options=t,this.mounted&&this.render()}get value(){return this.getAttribute("value")??""}set value(t){this.setAttribute("value",t)}onDisconnect(){this.closeDropdown(),document.removeEventListener("pointerdown",this.onOutsideClick),document.removeEventListener("keydown",this.onDocKeyDown)}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.dropdownEl?.remove(),this.dropdownEl=null,document.removeEventListener("pointerdown",this.onOutsideClick),document.removeEventListener("keydown",this.onDocKeyDown),this.mounted&&this.render())}openDropdown(){if(this.hasAttribute("disabled")||this.hasAttribute("read-only"))return;this.isOpen=!0,this.render();const t=this.querySelector('[data-mana-component="select-input-field"]');if(!t)return;const s=document.createElement("mana-listbox");s.items=this.options,s.value=this.value,s.addEventListener("change",a=>{a.stopPropagation();const r=a.detail;this.setAttribute("value",r.value),this.closeDropdown(),v(this,"change",r)}),this.dropdownEl=n("div",{class:"mana-select-dropdown mana-floating-layer"},[s]),this.dropdownEl.style.position="fixed",document.body.append(this.dropdownEl),it(t,this.dropdownEl,{placement:"bottom-start",spacing:4,matchReferenceWidth:!0}).then(a=>{this.dropdownEl&&(this.dropdownEl.style.left=`${a.x}px`,this.dropdownEl.style.top=`${a.y}px`)}),document.addEventListener("pointerdown",this.onOutsideClick),document.addEventListener("keydown",this.onDocKeyDown)}render(){const t=this.hasAttribute("disabled"),s=this.hasAttribute("read-only"),a=this.hasAttribute("clearable"),r=this.hasAttribute("full-width"),o=this.getAttribute("placeholder")??"Select…",l=this.options.find(f=>f.value===this.value);this.setAttribute("data-mana-component","select"),k(this,"data-full-width",r);const c=l?n("span",{class:"mana-select-single-option mana-text-body-md-normal"},[l.label]):n("span",{class:"mana-select-placeholder mana-text-body-md-normal"},[o]),h=n("div",{class:"mana-select-button"},[c]),m=a&&l&&!t&&!s?n("button",{type:"button",class:"mana-select-clear","aria-label":"Clear selection"},[T([...C.x],14)]):null;m&&m.addEventListener("click",f=>{f.stopPropagation(),this.setAttribute("value",""),v(this,"change",{value:"",item:null})});const u=n("span",{class:"mana-select-chevron-btn","aria-hidden":"true"},[T([...C.chevronDown],20,"0 0 24 24",`mana-select-chevron${this.isOpen?" mana-select-chevron--open":""}`)]),b=n("div",{class:"mana-input-field-wrapper","data-mana-component":"select-input-field","data-open":this.isOpen?"true":void 0,"data-disabled":t?"true":void 0,"data-read-only":s?"true":void 0,role:"combobox","aria-expanded":String(this.isOpen),"aria-haspopup":"listbox",tabindex:t?-1:0},[h,m,u]);b.addEventListener("click",()=>{this.isOpen?this.closeDropdown():this.openDropdown()}),b.addEventListener("keydown",f=>{(O(f)||f.key==="ArrowDown")&&(f.preventDefault(),this.isOpen||this.openDropdown())}),this.replaceChildren(b)}}d(Be,"observedAttributes",["options","value","placeholder","disabled","read-only","clearable","full-width"]);class Re extends E{constructor(){super(...arguments);d(this,"_options",null);d(this,"isOpen",!1);d(this,"query","");d(this,"inputEl",null);d(this,"dropdownEl",null);d(this,"onOutsideClick",t=>{const s=t.target;!s||this.contains(s)||this.dropdownEl?.contains(s)||this.closeDropdown()})}get options(){return this._options??N(this,"options",[])}set options(t){this._options=t,this.mounted&&this.renderDropdown()}get value(){return this.getAttribute("value")??""}set value(t){this.setAttribute("value",t)}onDisconnect(){this.closeDropdown(),document.removeEventListener("pointerdown",this.onOutsideClick)}closeDropdown(){this.isOpen=!1,this.dropdownEl?.remove(),this.dropdownEl=null,document.removeEventListener("pointerdown",this.onOutsideClick)}renderDropdown(){if(!this.isOpen||!this.inputEl)return;const t=this.query.trim().toLowerCase(),s=t?this.options.filter(o=>o.label.toLowerCase().includes(t)):this.options;this.dropdownEl||(this.dropdownEl=n("div",{class:"mana-select-dropdown mana-floating-layer"}),this.dropdownEl.style.position="fixed",document.body.append(this.dropdownEl),document.addEventListener("pointerdown",this.onOutsideClick));const a=document.createElement("mana-listbox");a.items=s,a.value=this.value,a.setAttribute("empty-text","No matching options"),a.addEventListener("change",o=>{o.stopPropagation();const l=o.detail;this.query=l.item.label,this.inputEl&&(this.inputEl.value=l.item.label),this.setAttribute("value",l.value),this.closeDropdown(),v(this,"change",l)}),this.dropdownEl.replaceChildren(a);const r=this.querySelector(".mana-input-field-wrapper")??this;it(r,this.dropdownEl,{placement:"bottom-start",spacing:4,matchReferenceWidth:!0}).then(o=>{this.dropdownEl&&(this.dropdownEl.style.left=`${o.x}px`,this.dropdownEl.style.top=`${o.y}px`)})}onConnect(){if(!this.inputEl){this.inputEl=n("input",{type:"text",class:"mana-text-input-native",role:"combobox",autocomplete:"off"}),this.inputEl.addEventListener("focus",()=>{this.hasAttribute("disabled")||(this.isOpen=!0,this.renderDropdown())}),this.inputEl.addEventListener("input",()=>{this.query=this.inputEl.value,this.isOpen=!0,this.renderDropdown()}),this.inputEl.addEventListener("keydown",a=>{a.key==="Escape"&&this.closeDropdown()});const t=n("span",{class:"mana-select-chevron-btn","aria-hidden":"true"},[T([...C.chevronDown],20,"0 0 24 24","mana-select-chevron")]),s=n("div",{class:"mana-input-field-wrapper","data-mana-component":"text-input","data-has-trailing":"true"},[this.inputEl,t]);this.append(s)}}render(){this.setAttribute("data-mana-component","combobox"),k(this,"data-full-width",this.hasAttribute("full-width"));const t=this.hasAttribute("disabled"),s=this.querySelector(".mana-input-field-wrapper");if(s&&k(s,"data-disabled",t),this.inputEl){this.inputEl.disabled=t,this.inputEl.placeholder=this.getAttribute("placeholder")??"Search…";const a=this.options.find(r=>r.value===this.value);a&&!this.isOpen&&(this.inputEl.value=a.label)}}}d(Re,"observedAttributes",["options","value","placeholder","disabled","full-width"]);class Oe extends E{constructor(){super(...arguments);d(this,"_items",null)}get items(){return this._items??N(this,"items",[])}set items(t){this._items=t,this.mounted&&this.render()}get value(){return this.getAttribute("value")??this.items[0]?.id??""}set value(t){this.setAttribute("value",t)}render(){const t=this.items,s=this.value||t[0]?.id||"",a=this.getAttribute("variant")??"default";this.setAttribute("data-mana-component","tabs"),this.setAttribute("data-variant",a);const r=n("div",{class:"mana-tabs-list",role:"tablist"}),o=n("div",{class:"mana-tabs-indicator"}),l=n("div",{class:"mana-tabs-strip"},[n("div",{class:"mana-tabs-rail"}),r,o]);let c=null;t.forEach((u,b)=>{const f=u.id===s,g=n("button",{type:"button",class:"mana-tab-item mana-text-body-md-semibold",role:"tab","aria-selected":String(f),disabled:!!u.disabled,tabindex:f?0:-1},[u.label]);f&&(c=g),g.addEventListener("click",()=>{u.disabled||(this.setAttribute("value",u.id),v(this,"change",{value:u.id,item:u}))}),g.addEventListener("keydown",A=>{if(A.key==="ArrowRight"||A.key==="ArrowLeft"){A.preventDefault();const y=t.filter(_=>!_.disabled);if(!y.length)return;const w=y.findIndex(_=>_.id===u.id),x=y[(w+(A.key==="ArrowRight"?1:-1)+y.length)%y.length];this.setAttribute("value",x.id),v(this,"change",{value:x.id,item:x}),this.querySelector('[role="tab"][aria-selected="true"]')?.focus()}}),r.append(g)});const h=t.find(u=>u.id===s),m=h?.content!=null?n("div",{class:"mana-tab-panel",role:"tabpanel"},[h.content]):null;if(this.replaceChildren(l,...m?[m]:[]),c){const u=c;o.style.width=`${u.offsetWidth||48}px`,o.style.transform=`translateX(${u.offsetLeft||0}px)`}}}d(Oe,"observedAttributes",["items","value","variant"]);class Ie extends E{constructor(){super(...arguments);d(this,"viewYear",vt().year);d(this,"viewMonth",vt().month)}onConnect(){const t=j(this.getAttribute("value"));t&&(this.viewYear=t.year,this.viewMonth=t.month)}render(){const t=j(this.getAttribute("value")),s=j(this.getAttribute("min"))??void 0,a=j(this.getAttribute("max"))??void 0,r=this.hasAttribute("disabled");this.setAttribute("data-mana-component","calendar");const o=n("button",{type:"button",class:"mana-calendar-cell","aria-label":"Previous month",disabled:r},[T([...C.chevronLeft],16)]);o.addEventListener("click",()=>{const m=At(this.viewYear,this.viewMonth,-1);this.viewYear=m.year,this.viewMonth=m.month,this.render()});const l=n("button",{type:"button",class:"mana-calendar-cell","aria-label":"Next month",disabled:r},[T([...C.chevronRight],16)]);l.addEventListener("click",()=>{const m=At(this.viewYear,this.viewMonth,1);this.viewYear=m.year,this.viewMonth=m.month,this.render()});const c=n("div",{class:"mana-calendar-header"},[o,n("span",{class:"mana-text-body-md-semibold mana-heading-default-color"},[qt(this.viewYear,this.viewMonth)]),l]),h=n("div",{class:"mana-calendar-grid",role:"grid"});for(const m of Qt)h.append(n("span",{class:"mana-calendar-weekday mana-text-body-xs-semibold"},[m]));for(const m of Gt(this.viewYear,this.viewMonth)){if(!m){h.append(n("span",{class:"mana-calendar-weekday","aria-hidden":"true"}));continue}const u=Bt(m,t),b=r||jt(m,s,a),f=n("button",{type:"button",class:"mana-calendar-cell","data-selected":u?"true":void 0,"aria-selected":String(u),disabled:b},[String(m.day)]);f.addEventListener("click",()=>{if(b)return;const g=Rt(m);this.setAttribute("value",g),v(this,"change",{value:g,date:m})}),h.append(f)}this.replaceChildren(c,h)}}d(Ie,"observedAttributes",["value","min","max","disabled"]);class Pe extends E{constructor(){super(...arguments);d(this,"viewYear",vt().year);d(this,"viewMonth",vt().month);d(this,"pendingStart",null)}onConnect(){const t=j(this.getAttribute("start"));t&&(this.viewYear=t.year,this.viewMonth=t.month)}render(){const t=this.pendingStart??j(this.getAttribute("start")),s=this.pendingStart?null:j(this.getAttribute("end")),a=j(this.getAttribute("min"))??void 0,r=j(this.getAttribute("max"))??void 0,o=this.hasAttribute("disabled");this.setAttribute("data-mana-component","range-calendar");const l=n("button",{type:"button",class:"mana-calendar-cell","aria-label":"Previous month",disabled:o},[T([...C.chevronLeft],16)]);l.addEventListener("click",()=>{const u=At(this.viewYear,this.viewMonth,-1);this.viewYear=u.year,this.viewMonth=u.month,this.render()});const c=n("button",{type:"button",class:"mana-calendar-cell","aria-label":"Next month",disabled:o},[T([...C.chevronRight],16)]);c.addEventListener("click",()=>{const u=At(this.viewYear,this.viewMonth,1);this.viewYear=u.year,this.viewMonth=u.month,this.render()});const h=n("div",{class:"mana-calendar-header"},[l,n("span",{class:"mana-text-body-md-semibold mana-heading-default-color"},[qt(this.viewYear,this.viewMonth)]),c]),m=n("div",{class:"mana-calendar-grid",role:"grid"});for(const u of Qt)m.append(n("span",{class:"mana-calendar-weekday mana-text-body-xs-semibold"},[u]));for(const u of Gt(this.viewYear,this.viewMonth)){if(!u){m.append(n("span",{class:"mana-calendar-weekday","aria-hidden":"true"}));continue}const b=Bt(u,t),f=Bt(u,s),g=!!(t&&s&&dt(u,t)>=0&&dt(u,s)<=0),A=o||jt(u,a,r),y=n("button",{type:"button",class:"mana-calendar-cell","data-selected":b||f?"true":void 0,"data-in-range":g&&!b&&!f?"true":void 0,"data-selection-start":b?"true":void 0,"data-selection-end":f?"true":void 0,disabled:A},[String(u.day)]);y.addEventListener("click",()=>{if(!A)if(!this.pendingStart)this.pendingStart=u,this.render();else{const w=dt(this.pendingStart,u)<=0?[this.pendingStart,u]:[u,this.pendingStart];this.pendingStart=null;const x=Rt(w[0]),L=Rt(w[1]);this.setAttribute("start",x),this.setAttribute("end",L),v(this,"change",{start:x,end:L})}}),m.append(y)}this.replaceChildren(h,m)}}d(Pe,"observedAttributes",["start","end","min","max","disabled"]);class We extends E{constructor(){super(...arguments);d(this,"isOpen",!1);d(this,"popupEl",null);d(this,"onOutsideClick",t=>{const s=t.target;!s||this.contains(s)||this.popupEl?.contains(s)||this.closePopup()})}onDisconnect(){this.closePopup(),document.removeEventListener("pointerdown",this.onOutsideClick)}closePopup(){this.isOpen=!1,this.popupEl?.remove(),this.popupEl=null,document.removeEventListener("pointerdown",this.onOutsideClick)}openPopup(){if(this.hasAttribute("disabled"))return;this.isOpen=!0;const t=document.createElement("mana-calendar"),s=this.getAttribute("value");s&&t.setAttribute("value",s),this.hasAttribute("min")&&t.setAttribute("min",this.getAttribute("min")),this.hasAttribute("max")&&t.setAttribute("max",this.getAttribute("max")),t.addEventListener("change",a=>{a.stopPropagation();const r=a.detail;this.setAttribute("value",r.value),this.closePopup(),v(this,"change",r)}),this.popupEl=n("div",{class:"mana-datepicker-dialog mana-floating-layer",role:"dialog"},[t]),this.popupEl.style.position="fixed",document.body.append(this.popupEl),it(this,this.popupEl,{placement:"bottom-start",spacing:6}).then(a=>{this.popupEl&&(this.popupEl.style.left=`${a.x}px`,this.popupEl.style.top=`${a.y}px`)}),document.addEventListener("pointerdown",this.onOutsideClick)}render(){const t=this.getAttribute("value")??"",s=this.getAttribute("placeholder")??"YYYY-MM-DD",a=this.hasAttribute("disabled");this.setAttribute("data-mana-component","date-picker");const r=n("input",{type:"text",class:"mana-text-input-native",value:t,placeholder:s,disabled:a,"aria-label":s});r.addEventListener("change",()=>{this.setAttribute("value",r.value),v(this,"change",{value:r.value})});const o=n("button",{type:"button",class:"mana-text-input-icon mana-text-input-accessory","aria-label":"Open calendar",disabled:a},[T([...C.calendar],16)]);o.addEventListener("click",()=>{this.isOpen?this.closePopup():this.openPopup()});const l=n("div",{class:"mana-input-field-wrapper mana-datepicker-input-row","data-disabled":a?"true":void 0},[r,o]);this.replaceChildren(l)}}d(We,"observedAttributes",["value","min","max","placeholder","disabled"]);function _a(e){return S("svg",{class:`mana-popover-caret mana-popover-caret--${e}`,width:16,height:10,viewBox:"0 0 16 10","aria-hidden":"true"},[S("path",{class:"mana-popover-caret-fill",d:"M0 0 L8 9 L16 0 Z"}),S("path",{class:"mana-popover-caret-stroke",d:"M0 0 L8 9 L16 0",fill:"none"})])}class $e extends E{constructor(){super(...arguments);d(this,"lockId",Aa("mana-modal"));d(this,"backdropEl",null);d(this,"bodyNodes",[]);d(this,"footerNodes",[]);d(this,"captured",!1);d(this,"onKeyDown",t=>{if(this.backdropEl){if(t.key==="Escape"&&this.getAttribute("dismissable")!=="false"){t.preventDefault(),this.close();return}if(t.key==="Tab"){const s=this.backdropEl.querySelector('[data-mana-component="modal"]');if(!s)return;const a=Pt(s);if(!a.length){t.preventDefault();return}const r=a[0],o=a[a.length-1];t.shiftKey&&document.activeElement===r?(t.preventDefault(),o.focus()):!t.shiftKey&&document.activeElement===o&&(t.preventDefault(),r.focus())}}})}onConnect(){if(!this.captured){this.captured=!0;for(const t of Array.from(this.childNodes))t instanceof HTMLElement&&t.getAttribute("slot")==="footer"?this.footerNodes.push(t):this.bodyNodes.push(t);this.replaceChildren()}}onDisconnect(){this.teardownModal()}close(){this.removeAttribute("open"),v(this,"close"),v(this,"open-change",{open:!1})}teardownModal(){document.removeEventListener("keydown",this.onKeyDown),xt.remove(this.lockId),this.backdropEl?.remove(),this.backdropEl=null}render(){if(!this.hasAttribute("open")){this.teardownModal();return}const s=this.getAttribute("size")??"md",a=this.getAttribute("title"),r=this.getAttribute("subtitle"),o=this.getAttribute("dismissable")!=="false",l=this.getAttribute("padding-size"),c=[];if(a||r||o){const f=n("div",{class:"mana-modal-header-main"},[a?n("h2",{class:"mana-modal-header-title mana-text-heading-lg-semibold mana-heading-default-color"},[a]):null,r?n("div",{class:"mana-modal-header-subtitle mana-text-body-sm-normal",style:"color:var(--text-subtle)"},[r]):null]),g=o?n("div",{class:"mana-modal-header-trailing"}):null;if(g){const A=document.createElement("mana-close-button");A.addEventListener("click",()=>this.close()),g.append(A)}c.push(n("div",{class:"mana-modal-section mana-modal-header"},[n("div",{class:"mana-modal-header-layout"},[f,g])]))}const h=n("div",{class:"mana-modal-body-inner"});for(const f of this.bodyNodes)h.append(f);if(c.push(n("div",{class:"mana-modal-body"},[h])),this.footerNodes.length>0){const f=n("div",{class:"mana-modal-section mana-modal-action-bar"});for(const g of this.footerNodes)f.append(g);c.push(f)}const m=n("div",{"data-mana-component":"modal","data-size":s,"data-padding-size":l??void 0,role:"dialog","aria-modal":"true","aria-label":a??this.getAttribute("aria-label")??"Dialog",tabindex:-1},c),u=n("div",{class:"mana-modal-outer"},[m]),b=n("div",{class:"mana-modal-backdrop"},[u]);b.addEventListener("click",f=>{o&&(f.target===b||f.target===u)&&this.close()}),this.teardownModal(),this.backdropEl=b,document.body.append(b),document.addEventListener("keydown",this.onKeyDown),xt.add(this.lockId,()=>{}),ks(m)}}d($e,"observedAttributes",["open","size","title","subtitle","dismissable","padding-size"]);class He extends E{constructor(){super(...arguments);d(this,"modalEl",null)}onDisconnect(){this.modalEl?.remove(),this.modalEl=null}render(){if(!this.hasAttribute("open")){this.modalEl?.remove(),this.modalEl=null;return}const s=this.getAttribute("title")??"Confirm",a=this.getAttribute("body")??"",r=this.getAttribute("confirm-text")??"Confirm",o=this.getAttribute("cancel-text")??"Cancel",l=this.getAttribute("variant")==="critical"?"critical-primary":"primary";this.modalEl?.remove();const c=document.createElement("mana-modal");c.setAttribute("open",""),c.setAttribute("size","sm"),c.setAttribute("title",s),a&&c.append(n("p",{class:"mana-text-body-md-normal mana-text-default-color",style:"margin:0"},[a]));const h=document.createElement("mana-button");h.setAttribute("variant","secondary"),h.setAttribute("size","md"),h.textContent=o,h.addEventListener("click",()=>{this.removeAttribute("open"),v(this,"cancel"),v(this,"close")});const m=document.createElement("mana-button");m.setAttribute("variant",l),m.setAttribute("size","md"),m.textContent=r,m.addEventListener("click",()=>{this.removeAttribute("open"),v(this,"confirm"),v(this,"close")});const u=n("div",{class:"mana-modal-action-bar-trailing",slot:"footer"},[h,m]);c.append(u),c.addEventListener("close",()=>{this.removeAttribute("open"),v(this,"cancel"),v(this,"close")}),this.modalEl=c,document.body.append(c)}}d(He,"observedAttributes",["open","title","body","confirm-text","cancel-text","variant"]);class ze extends E{constructor(){super(...arguments);d(this,"backdropEl",null);d(this,"contentNodes",[]);d(this,"captured",!1);d(this,"onKeyDown",t=>{t.key==="Escape"&&this.getAttribute("dismissable")!=="false"&&(this.removeAttribute("open"),v(this,"close"))})}onConnect(){this.captured||(this.captured=!0,this.contentNodes=Array.from(this.childNodes),this.replaceChildren())}onDisconnect(){this.teardown()}teardown(){document.removeEventListener("keydown",this.onKeyDown),this.backdropEl?.remove(),this.backdropEl=null}render(){if(!this.hasAttribute("open")){this.teardown();return}const t=this.getAttribute("dismissable")!=="false",s=n("div",{"data-mana-component":"layer-modal",role:"dialog","aria-modal":"true","aria-label":this.getAttribute("aria-label")??"Dialog",tabindex:-1});for(const o of this.contentNodes)s.append(o);const a=n("div",{class:"mana-modal-outer"},[s]),r=n("div",{class:"mana-modal-backdrop"},[a]);r.addEventListener("click",o=>{t&&(o.target===r||o.target===a)&&(this.removeAttribute("open"),v(this,"close"))}),this.teardown(),this.backdropEl=r,document.body.append(r),document.addEventListener("keydown",this.onKeyDown)}}d(ze,"observedAttributes",["open","dismissable","aria-label"]);class Ke extends E{constructor(){super(...arguments);d(this,"layerEl",null);d(this,"triggerEl",null);d(this,"onTriggerClick",()=>{this.hasAttribute("open")?this.removeAttribute("open"):this.setAttribute("open",""),v(this,"open-change",{open:this.hasAttribute("open")})});d(this,"onOutside",t=>{const s=t.target;!s||this.contains(s)||this.layerEl?.contains(s)||(this.removeAttribute("open"),v(this,"open-change",{open:!1}))});d(this,"onKey",t=>{t.key==="Escape"&&(this.removeAttribute("open"),v(this,"open-change",{open:!1}))})}onConnect(){this.triggerEl=this.querySelector('[slot="trigger"]')??this.firstElementChild,this.triggerEl?.addEventListener("click",this.onTriggerClick)}onDisconnect(){this.triggerEl?.removeEventListener("click",this.onTriggerClick),this.teardown()}teardown(){document.removeEventListener("pointerdown",this.onOutside),document.removeEventListener("keydown",this.onKey),this.layerEl?.remove(),this.layerEl=null}render(){if(!this.hasAttribute("open")){this.teardown();return}const t=this.getAttribute("title"),s=this.getAttribute("body"),a=this.getAttribute("size")??"md",r=this.getAttribute("gradient"),o=this.getAttribute("placement")??"top",l=this.getAttribute("dismissable")!=="false",c=n("div",{"data-mana-component":"popover","data-size":a,"data-gradient":r??void 0,role:"dialog"});if(l){const b=document.createElement("mana-close-button");b.setAttribute("size","xs"),b.className="mana-popover-close",b.addEventListener("click",()=>{this.removeAttribute("open"),v(this,"open-change",{open:!1})}),c.append(b)}(t||s)&&c.append(n("div",{class:"mana-popover-header"},[t?n("div",{class:"mana-popover-title mana-text-heading-md-semibold mana-heading-default-color"},[t]):null,s?n("div",{class:"mana-popover-body mana-text-body-sm-normal"},[s]):null]));const h={top:"bottom",bottom:"top",left:"right",right:"left"};c.append(_a(h[Vt(o)]??"bottom"));const m=n("div",{class:"mana-floating-layer"},[c]);m.style.position="fixed",this.teardown(),this.layerEl=m,document.body.append(m),document.addEventListener("pointerdown",this.onOutside),document.addEventListener("keydown",this.onKey);const u=this.triggerEl??this;it(u,m,{placement:o,spacing:10}).then(b=>{this.layerEl&&(this.layerEl.style.left=`${b.x}px`,this.layerEl.style.top=`${b.y}px`)})}}d(Ke,"observedAttributes",["open","title","body","size","gradient","placement","dismissable"]);class Fe extends E{constructor(){super(...arguments);d(this,"tipEl",null);d(this,"hovered",!1);d(this,"onShow",()=>{this.hovered=!0,this.render()});d(this,"onHide",()=>{this.hovered=!1,this.render()})}onConnect(){this.addEventListener("mouseenter",this.onShow),this.addEventListener("mouseleave",this.onHide),this.addEventListener("focusin",this.onShow),this.addEventListener("focusout",this.onHide)}onDisconnect(){this.removeEventListener("mouseenter",this.onShow),this.removeEventListener("mouseleave",this.onHide),this.removeEventListener("focusin",this.onShow),this.removeEventListener("focusout",this.onHide),this.hideTip()}hideTip(){this.tipEl?.remove(),this.tipEl=null}render(){const t=this.hovered||this.hasAttribute("force-open"),s=this.getAttribute("text");if(!t||!s){this.hideTip();return}const a=this.getAttribute("position")??"top",r=this.getAttribute("shortcut");this.hideTip();const o=n("div",{"data-mana-component":"tooltip","data-position":Vt(a),role:"tooltip"},[n("span",{class:"mana-text-body-sm-medium"},[s]),r?n("kbd",{class:"mana-tooltip-shortcut mana-text-body-xs-semibold"},[r]):null]);o.style.position="fixed",this.tipEl=o,document.body.append(o);const l=this.firstElementChild??this;it(l,o,{placement:a,spacing:8}).then(c=>{this.tipEl&&(this.tipEl.style.left=`${c.x}px`,this.tipEl.style.top=`${c.y}px`)})}}d(Fe,"observedAttributes",["text","shortcut","position","force-open"]);class Ye extends E{render(){const i=this.getAttribute("message")??"",t=this.getAttribute("type")??"info",s=this.hasAttribute("dismissible"),a=this.getAttribute("action-text");this.setAttribute("data-mana-component","global-banner"),this.setAttribute("data-type",t),this.setAttribute("role","status");const r=a?n("div",{class:"mana-global-banner-actions"},[(()=>{const l=document.createElement("mana-button");return l.setAttribute("variant","overlay-secondary"),l.setAttribute("size","xs"),l.textContent=a,l.addEventListener("click",()=>v(this,"action")),l})()]):null,o=s?n("div",{class:"mana-global-banner-dismiss"},[(()=>{const l=document.createElement("mana-close-button");return l.setAttribute("size","xs"),l.addEventListener("click",()=>v(this,"dismiss")),l})()]):null;this.replaceChildren(n("div",{class:"mana-global-banner-content"},[n("div",{class:"mana-global-banner-copy"},[n("span",{class:"mana-text-body-sm-medium"},[i])]),r]),...o?[o]:[])}}d(Ye,"observedAttributes",["message","type","dismissible","action-text"]);class Ue extends E{render(){const i=this.getAttribute("type")??"info",t=this.getAttribute("title"),s=this.getAttribute("message")??"",a=this.hasAttribute("dismissible");this.className="mana-inline-notice",this.setAttribute("data-type",i),this.setAttribute("role",i==="critical"||i==="warning"?"alert":"status");const r=i==="success"?"success":i==="warning"?"warning":i==="critical"?"critical":"info",o=a?(()=>{const l=document.createElement("mana-close-button");return l.setAttribute("size","xs"),l.addEventListener("click",()=>v(this,"dismiss")),l})():null;this.replaceChildren(n("div",{class:"mana-inline-notice-main"},[n("span",{class:"mana-inline-notice-icon","aria-hidden":"true"},[T([...C[r]],18)]),n("div",{class:"mana-inline-notice-copy"},[t?n("span",{class:"mana-text-body-sm-semibold mana-heading-default-color"},[t]):null,s?n("span",{class:"mana-text-body-sm-normal"},[s]):null])]),...o?[o]:[])}}d(Ue,"observedAttributes",["type","title","message","dismissible"]);class Ze extends E{constructor(){super(...arguments);d(this,"timer",null);d(this,"completed",!1)}onConnect(){this.timer=window.setInterval(()=>this.render(),1e3)}onDisconnect(){this.timer!=null&&(window.clearInterval(this.timer),this.timer=null)}render(){const t=this.getAttribute("end-time"),s=t?/^\d+$/.test(t)?Number(t):Date.parse(t):Date.now(),a=Math.max(0,Math.floor((s-Date.now())/1e3)),r=this.getAttribute("variant")??"overlay-secondary",o=this.hasAttribute("show-days");a===0&&!this.completed&&t&&(this.completed=!0,v(this,"complete"));const l=Math.floor(a/86400),c=Math.floor(o?a%86400/3600:a/3600),h=Math.floor(a%3600/60),m=a%60,u=f=>String(f).padStart(2,"0");this.className="mana-countdown mana-text-body-xs-semibold",this.setAttribute("data-variant",r);const b=[];o&&l>0&&b.push(n("span",{},[`${l}d`]),n("span",{class:"mana-countdown-separator","aria-hidden":"true"})),b.push(n("span",{},[u(c)]),n("span",{class:"mana-countdown-separator","aria-hidden":"true"}),n("span",{},[u(h)]),n("span",{class:"mana-countdown-separator","aria-hidden":"true"}),n("span",{},[u(m)])),this.replaceChildren(n("span",{class:"mana-countdown-digits"},b))}}d(Ze,"observedAttributes",["end-time","variant","show-days"]);class Xe extends E{render(){const i=Number(this.getAttribute("value")??"0"),t=Number(this.getAttribute("max")??"100"),s=this.getAttribute("size")??"md",a=t>0?Math.min(100,Math.max(0,i/t*100)):0;this.className="mana-progress-bar",this.setAttribute("data-size",s),this.setAttribute("role","progressbar"),this.setAttribute("aria-valuenow",String(i)),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax",String(t));let r=this.querySelector(".mana-progress-bar-fill");r||(r=n("div",{class:"mana-progress-bar-fill"}),this.append(r)),r.style.width=`${a}%`}}d(Xe,"observedAttributes",["value","max","size","aria-label"]);class Ve extends E{render(){const i=this.getAttribute("text")??"",t=this.getAttribute("variant")??"default";this.className="mana-toast",this.setAttribute("data-variant",t),this.setAttribute("role",t==="critical"?"alert":"status");const s=t==="success"?"success":t==="critical"?"critical":null;this.replaceChildren(n("div",{class:"mana-toast-baselayer","aria-hidden":"true"}),n("div",{class:"mana-toast-content"},[s?T([...C[s]],18):null,n("span",{class:"mana-text-body-sm-medium"},[i])]))}}d(Ve,"observedAttributes",["text","variant"]);class qe extends E{constructor(){super(...arguments);d(this,"unsub",null);d(this,"activeTimers",new Map);d(this,"currentItems",[])}onConnect(){this.unsub=Ss(t=>{const s=this.getAttribute("surface")??"app";this.currentItems=t[s]??[],this.render(),this.scheduleAutoDismiss()})}onDisconnect(){this.unsub?.(),this.unsub=null;for(const t of this.activeTimers.values())window.clearTimeout(t);this.activeTimers.clear()}scheduleAutoDismiss(){const t=this.currentItems[0];if(!(!t||this.activeTimers.has(t.id))&&t.duration>0){const s=window.setTimeout(()=>{this.activeTimers.delete(t.id),_s(t.id,t.surface)},t.duration);this.activeTimers.set(t.id,s)}}render(){const t=this.getAttribute("position")??this.currentItems[0]?.position??"top",s=this.currentItems[0];if(!s){this.replaceChildren();return}const a=document.createElement("mana-toast");a.setAttribute("text",s.text),a.setAttribute("variant",s.variant),this.replaceChildren(n("div",{class:"mana-toast-container","data-position":t},[a]))}}d(qe,"observedAttributes",["surface","position"]);const Ta=/^\/(?!\/|\\)/;class je extends E{render(){const i=this.getAttribute("type")??"wanderingCubes";this.className="mana-spinner",this.setAttribute("data-type",i),this.setAttribute("role","status"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Loading"),k(this,"data-static",this.hasAttribute("static"),"");const t=n("span",{class:"mana-spinner-inner","aria-hidden":"true"});if(i==="spinningCircle"||i==="spinningCircleSimple"){const s=[S("circle",{class:"mana-spinner-path",cx:50,cy:50,r:20})];i==="spinningCircle"&&s.push(S("circle",{class:"mana-spinner-path mana-spinner-path-2",cx:50,cy:50,r:20}),S("circle",{class:"mana-spinner-path mana-spinner-path-3",cx:50,cy:50,r:20})),t.append(S("svg",{class:"mana-spinner-circular",viewBox:"25 25 50 50"},s))}else i==="pulsingEllipsis"||i==="lowMotion"?t.append(n("span",{class:"mana-spinner-item"}),n("span",{class:"mana-spinner-item"}),n("span",{class:"mana-spinner-item"})):t.append(n("span",{class:"mana-spinner-item"}),n("span",{class:"mana-spinner-item"}));this.replaceChildren(t)}}d(je,"observedAttributes",["type","static","aria-label"]);class Ge extends E{render(){this.className="mana-divider",this.setAttribute("role","separator")}}d(Ge,"observedAttributes",[]);class Qe extends E{render(){const i=this.getAttribute("type")??"primary",t=this.getAttribute("padding");this.classList.add("mana-card"),this.setAttribute("data-type",i),k(this,"data-outline",this.hasAttribute("outline"),""),t?this.style.padding=`var(--space-${t})`:this.style.removeProperty("padding")}}d(Qe,"observedAttributes",["type","outline","padding"]);class Je extends E{constructor(){super(...arguments);d(this,"linkEl",null)}onConnect(){if(!this.linkEl){const t=Array.from(this.childNodes);this.linkEl=n("a",{class:"mana-anchor"});for(const s of t)this.linkEl.append(s);this.append(this.linkEl)}}render(){if(!this.linkEl)return;const t=this.getAttribute("href")??"#",s=this.getAttribute("target"),a=this.getAttribute("underline-on-hover")==="false",r=!Ta.test(t)&&!t.startsWith("#");this.linkEl.href=t,this.linkEl.className=a?"mana-anchor mana-anchor-underline":"mana-anchor",s?this.linkEl.target=s:r?this.linkEl.target="_blank":this.linkEl.removeAttribute("target"),r||this.linkEl.target==="_blank"?this.linkEl.rel="noopener noreferrer":this.linkEl.removeAttribute("rel")}}d(Je,"observedAttributes",["href","target","underline-on-hover"]);class ts extends E{render(){const i=Number(this.getAttribute("count")??"0"),t=this.hasAttribute("max")?Number(this.getAttribute("max")):void 0,s=this.getAttribute("shape")??"round",a=this.getAttribute("color")??"var(--background-feedback-notification)",r=t!=null&&i>t?`${t}+`:String(i);this.className="mana-number-badge mana-text-body-xs-bold",this.setAttribute("data-shape",s),this.style.backgroundColor=a,this.style.paddingInline=r.length>1?"4px":"0",this.textContent=r}}d(ts,"observedAttributes",["count","max","shape","color"]);class es extends E{constructor(){super(...arguments);d(this,"overlayNodes",[]);d(this,"captured",!1)}onConnect(){this.captured||(this.captured=!0,this.overlayNodes=Array.from(this.childNodes))}render(){const t=Number(this.getAttribute("value")??"0"),s=Number(this.getAttribute("max")??"100"),a=Number(this.getAttribute("size")??"32"),r=Number(this.getAttribute("stroke-width")??"3"),o=s>0?Math.min(1,Math.max(0,t/s)):0,l=(a-r)/2,c=2*Math.PI*l;this.className="mana-progress-circle",this.setAttribute("role","progressbar"),this.setAttribute("aria-valuenow",String(t)),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax",String(s)),this.style.width=`${a}px`,this.style.height=`${a}px`;const h=S("svg",{class:"mana-progress-circle-svg",width:a,height:a,viewBox:`0 0 ${a} ${a}`},[S("circle",{class:"mana-progress-circle-background",cx:a/2,cy:a/2,r:l,"stroke-width":r}),S("circle",{class:"mana-progress-circle-progress",cx:a/2,cy:a/2,r:l,stroke:"currentColor","stroke-width":r,"stroke-dasharray":String(c),"stroke-dashoffset":String(c*(1-o)),"stroke-linecap":"round",transform:`rotate(-90 ${a/2} ${a/2})`})]),m=n("span",{class:"mana-progress-circle-overlay"});for(const u of this.overlayNodes)m.append(u);this.replaceChildren(h,m)}}d(es,"observedAttributes",["value","max","size","stroke-width"]);class ss extends E{render(){this.classList.add("mana-scroller"),this.setAttribute("data-orientation",this.getAttribute("orientation")??"vertical"),this.setAttribute("data-variant",this.getAttribute("variant")??"thin"),k(this,"data-fade",this.hasAttribute("fade"),"")}}d(ss,"observedAttributes",["orientation","variant","fade"]);class is extends E{constructor(){super(...arguments);d(this,"_columns",null);d(this,"_rows",null);d(this,"sortKey",null);d(this,"sortDir","asc")}get columns(){return this._columns??N(this,"columns",[])}set columns(t){this._columns=t,this.mounted&&this.render()}get rows(){return this._rows??N(this,"rows",[])}set rows(t){this._rows=t,this.mounted&&this.render()}render(){this.classList.add("mana-table-container"),k(this,"data-sticky-header",this.hasAttribute("sticky-header"),"");const t=this.columns;if(t.length===0)return;const s=[...this.rows];if(this.sortKey){const o=this.sortKey,l=this.sortDir==="asc"?1:-1;s.sort((c,h)=>String(c[o]??"").localeCompare(String(h[o]??""),void 0,{numeric:!0})*l)}const a=n("tr",{class:"mana-table-row"});for(const o of t){const l=this.sortKey===o.key,c=n("th",{class:"mana-table-column","data-sorted":l?this.sortDir:void 0});if(o.sortable){const h=n("button",{type:"button",class:"mana-table-sort-button"},[n("span",{class:"mana-table-column-label"},[o.label]),l?n("span",{class:"mana-table-sort-icon"},[this.sortDir==="asc"?"▲":"▼"]):null]);h.addEventListener("click",()=>{this.sortKey===o.key?this.sortDir=this.sortDir==="asc"?"desc":"asc":(this.sortKey=o.key,this.sortDir="asc"),this.render(),v(this,"sort",{key:this.sortKey,direction:this.sortDir})}),c.append(h)}else c.append(n("span",{class:"mana-table-column-label"},[o.label]));a.append(c)}const r=n("tbody",{class:"mana-table-body"});s.forEach((o,l)=>{const c=n("tr",{class:"mana-table-row","data-interactive":""});for(const h of t)c.append(n("td",{class:"mana-table-cell mana-text-body-sm-normal"},[String(o[h.key]??"")]));c.addEventListener("click",()=>v(this,"row-select",{row:o,index:l})),r.append(c)}),this.replaceChildren(n("table",{class:"mana-table"},[n("thead",{class:"mana-table-header"},[a]),r]))}}d(is,"observedAttributes",["columns","rows","sticky-header"]);class as extends E{constructor(){super(...arguments);d(this,"_items",null);d(this,"menuEl",null);d(this,"triggerEl",null);d(this,"onTriggerClick",()=>{this.hasAttribute("open")?this.removeAttribute("open"):this.setAttribute("open",""),v(this,"open-change",{open:this.hasAttribute("open")})});d(this,"onOutside",t=>{const s=t.target;!s||this.contains(s)||this.menuEl?.contains(s)||(this.removeAttribute("open"),v(this,"open-change",{open:!1}))})}get items(){return this._items??N(this,"items",[])}set items(t){this._items=t,this.mounted&&this.render()}onConnect(){this.triggerEl=this.querySelector('[slot="trigger"]')??this.firstElementChild,this.triggerEl?.addEventListener("click",this.onTriggerClick)}onDisconnect(){this.triggerEl?.removeEventListener("click",this.onTriggerClick),this.teardown()}teardown(){document.removeEventListener("pointerdown",this.onOutside),this.menuEl?.remove(),this.menuEl=null}render(){if(!this.hasAttribute("open")){this.teardown();return}const t=this.getAttribute("placement")??"bottom-start",s=n("div",{class:"mana-menu mana-floating-layer",role:"menu","data-placement":t.startsWith("top")?"top":"bottom"});s.style.position="fixed";const a=[];for(const o of this.items){if(o.type==="separator"){s.append(n("div",{class:"mana-menu-separator",role:"separator"}));continue}if(o.type==="group"){s.append(n("div",{class:"mana-menu-group-label"},[o.label??""]));continue}const l=o.type==="checkbox",c=n("div",{class:"mana-menu-item",role:l?"menuitemcheckbox":"menuitem","aria-checked":l?String(!!o.checked):void 0,"aria-disabled":o.disabled?"true":void 0,"data-variant":o.variant==="danger"?"danger":void 0,tabindex:o.disabled?-1:0},[n("span",{class:"mana-menu-item-label"},[n("span",{class:"mana-menu-item-label-text mana-text-body-sm-medium"},[o.label??""]),o.subtext?n("span",{class:"mana-menu-item-subtext mana-text-body-xs-normal"},[o.subtext]):null]),l?n("span",{class:"mana-menu-checkbox","data-checked":o.checked?"":void 0,"aria-hidden":"true"},[o.checked?T([...C.check],14):null]):null]),h=()=>{o.disabled||(l?(o.checked=!o.checked,v(this,"change",{id:o.id,checked:o.checked,item:o}),this.render()):(v(this,"select",{id:o.id,item:o}),this.removeAttribute("open"),v(this,"open-change",{open:!1})))};c.addEventListener("click",h),c.addEventListener("keydown",m=>{if(m.key==="Escape"){this.removeAttribute("open"),v(this,"open-change",{open:!1});return}if(O(m)){m.preventDefault(),h();return}if(m.key==="ArrowDown"||m.key==="ArrowUp"||m.key==="Home"||m.key==="End"){m.preventDefault();const u=a.indexOf(c);if(!a.length)return;let b=u;m.key==="Home"?b=0:m.key==="End"?b=a.length-1:b=(u+(m.key==="ArrowDown"?1:-1)+a.length)%a.length,a[b]?.focus()}}),o.disabled||a.push(c),s.append(c)}this.teardown(),this.menuEl=s,document.body.append(s),document.addEventListener("pointerdown",this.onOutside);const r=this.triggerEl??this;it(r,s,{placement:t,spacing:6}).then(o=>{this.menuEl&&(this.menuEl.style.left=`${o.x}px`,this.menuEl.style.top=`${o.y}px`)}),requestAnimationFrame(()=>a[0]?.focus())}}d(as,"observedAttributes",["open","items","placement"]);function Ot(e){const i=e.trim().split(/\s+/);return i.length===1?i[0].slice(0,2).toUpperCase():i.slice(0,3).map(t=>t[0]).join("").toUpperCase()}function Js(e){const t=`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80"><rect width="80" height="80" fill="hsl(${[...e].reduce((s,a)=>(s*31+a.charCodeAt(0))%360,7)} 55% 45%)"/><text x="40" y="52" font-family="sans-serif" font-size="34" font-weight="700" fill="#fff" text-anchor="middle">${e.slice(0,1).toUpperCase()}</text></svg>`;return`data:image/svg+xml,${encodeURIComponent(t)}`}function Sa(e){const i=[...e].map(s=>s.codePointAt(0).toString(16));return`https://cdn.jsdelivr.net/gh/jdecked/twemoji@latest/assets/svg/${(i.includes("200d")?i:i.filter(s=>s!=="fe0f")).join("-")}.svg`}class ns extends E{constructor(){super(...arguments);d(this,"slots",{"top-bar":[],rail:[],sidebar:[],dock:[],header:[],aside:[],"status-bar":[],default:[]});d(this,"captured",!1)}onConnect(){if(!this.captured){this.captured=!0;for(const t of Array.from(this.childNodes)){const s=t instanceof HTMLElement?t.getAttribute("slot"):null;s&&s in this.slots?this.slots[s].push(t):this.slots.default.push(t)}}}render(){const t=this.getAttribute("surface-style")??"inset",s=this.getAttribute("sidebar-style")??"outer",a=this.hasAttribute("framed"),r=this.getAttribute("height"),o=this.getAttribute("sidebar-width")??"220",l=this.getAttribute("aside-width")??"320",c=this.getAttribute("aside-open")!=="false",h=n("div",{class:"mana-app-shell","data-framed":a?"true":void 0,"data-surface-style":t,"data-has-statusbar":this.slots["status-bar"].length>0?"true":void 0});h.style.setProperty("--mana-sidebar-width",`${o}px`),h.style.setProperty("--mana-aside-width",`${l}px`),r&&(h.style.height=/^\d+$/.test(r)?`${r}px`:r);for(const g of this.slots["top-bar"])h.append(g);const m=n("div",{class:"mana-shell-body"});if(this.slots.rail.length>0||this.slots.sidebar.length>0||this.slots.dock.length>0){const g=n("div",{class:"mana-shell-nav","data-has-rail":this.slots.rail.length>0?"true":"false","data-sidebar-style":s});this.slots.rail.length>0&&g.append(n("div",{class:"mana-shell-nav-rail"},this.slots.rail)),this.slots.sidebar.length>0&&g.append(n("div",{class:"mana-shell-nav-sidebar"},this.slots.sidebar)),this.slots.dock.length>0&&g.append(n("div",{class:"mana-shell-dock-slot"},this.slots.dock)),m.append(g)}const f=[n("div",{class:"mana-shell-primary"},[...this.slots.header,n("main",{class:"mana-shell-content"},this.slots.default)])];this.slots.aside.length>0&&c&&f.push(n("aside",{class:"mana-shell-aside"},this.slots.aside)),m.append(n("div",{class:"mana-shell-surface-wrap"},[n("div",{class:"mana-shell-surface"},f)])),h.append(m);for(const g of this.slots["status-bar"])h.append(g);this.replaceChildren(h)}}d(ns,"observedAttributes",["surface-style","sidebar-style","framed","height","sidebar-width","aside-width","aside-open"]);class rs extends E{constructor(){super(...arguments);d(this,"leadingNodes",[]);d(this,"centerNodes",[]);d(this,"trailingNodes",[]);d(this,"captured",!1)}onConnect(){if(!this.captured){this.captured=!0;for(const t of Array.from(this.childNodes)){const s=t instanceof HTMLElement?t.getAttribute("slot"):null;s==="center"?this.centerNodes.push(t):s==="trailing"?this.trailingNodes.push(t):this.leadingNodes.push(t)}}}render(){const t=n("header",{class:"mana-app-topbar","data-center-align":this.getAttribute("center-align")??"start"},[n("div",{class:"mana-app-topbar-leading"},this.leadingNodes),this.centerNodes.length?n("div",{class:"mana-app-topbar-center"},this.centerNodes):null,n("div",{class:"mana-app-topbar-trailing"},this.trailingNodes)]),s=this.getAttribute("height");s&&(t.style.height=`${s}px`),this.replaceChildren(t)}}d(rs,"observedAttributes",["center-align","height"]);class os extends E{constructor(){super(...arguments);d(this,"leadingNodes",[]);d(this,"trailingNodes",[]);d(this,"captured",!1)}onConnect(){if(!this.captured){this.captured=!0;for(const t of Array.from(this.childNodes))(t instanceof HTMLElement?t.getAttribute("slot"):null)==="trailing"?this.trailingNodes.push(t):this.leadingNodes.push(t)}}render(){this.replaceChildren(n("footer",{class:"mana-app-statusbar"},[n("div",{class:"mana-app-statusbar-leading"},this.leadingNodes),this.trailingNodes.length?n("div",{class:"mana-app-statusbar-trailing"},this.trailingNodes):null]))}}d(os,"observedAttributes",[]);class ls extends E{constructor(){super(...arguments);d(this,"_groups",null);d(this,"collapsed",new Set);d(this,"query","")}get groups(){return this._groups??N(this,"groups",[])}set groups(t){this._groups=t,this.mounted&&this.render()}render(){const t=this.getAttribute("active-id")??"",s=this.hasAttribute("searchable"),a=this.query.trim().toLowerCase(),r=a?this.groups.map(c=>({...c,items:c.items.filter(h=>h.label.toLowerCase().includes(a))})).filter(c=>c.items.length>0):this.groups,o=n("nav",{class:"mana-app-sidebar","aria-label":this.getAttribute("aria-label")??"Navigation"});if(s){const c=document.createElement("mana-search-bar");c.setAttribute("size","sm"),c.setAttribute("placeholder",this.getAttribute("search-placeholder")??"Filter…"),c.setAttribute("value",this.query),c.addEventListener("input",h=>{h.stopPropagation(),this.query=h.detail.value,this.render()}),o.append(n("div",{class:"mana-app-sidebar-search"},[c]))}const l=n("div",{class:"mana-scroller mana-app-sidebar-scroller","data-orientation":"vertical","data-variant":"thin","data-fade":""});for(const c of r){const h=!!(c.collapsible&&this.collapsed.has(c.id)&&!a),m=n("section",{class:"mana-app-sidebar-group","data-collapsed":h?"true":void 0});if(c.label){const u=n("div",{class:"mana-app-sidebar-group-header"});if(c.collapsible){const b=n("button",{type:"button",class:"mana-app-sidebar-group-toggle","aria-expanded":String(!h)},[n("span",{class:"mana-app-sidebar-group-caret","aria-hidden":"true"},[T([...C.chevronDown],12)]),n("span",{class:"mana-text-body-xs-medium"},[c.label])]);b.addEventListener("click",()=>{this.collapsed.has(c.id)?this.collapsed.delete(c.id):this.collapsed.add(c.id),this.render()}),u.append(b)}else u.append(n("span",{class:"mana-app-sidebar-group-label mana-text-body-xs-medium"},[c.label]));m.append(u)}if(!h){const u=n("ul",{class:"mana-app-sidebar-list"});for(const b of c.items){const f=b.id===t,g=n("button",{type:"button",class:"mana-app-sidebar-item",disabled:!!b.disabled,"data-active":f?"true":void 0,"data-variant":b.variant??"default","aria-current":f?"page":void 0},[n("span",{class:"mana-app-sidebar-item-label mana-text-body-sm-medium"},[b.label]),b.badge?n("span",{class:"mana-app-sidebar-item-badge"},[b.badge]):null]);g.addEventListener("click",()=>{b.disabled||(this.setAttribute("active-id",b.id),v(this,"select",{id:b.id,item:b}))}),u.append(n("li",{},[g]))}m.append(u)}l.append(m)}o.append(l),this.replaceChildren(o)}}d(ls,"observedAttributes",["groups","active-id","searchable","search-placeholder","aria-label"]);class cs extends E{constructor(){super(...arguments);d(this,"_actions",null)}get actions(){return this._actions??N(this,"actions",[])}set actions(t){this._actions=t,this.mounted&&this.render()}render(){const t=this.getAttribute("title")??"",s=this.getAttribute("topic"),a=this.hasAttribute("searchable"),r=n("div",{class:"mana-header-bar-leading"},[n("h1",{class:"mana-header-bar-title mana-text-heading-sm-semibold mana-heading-default-color"},[t]),s?n("span",{class:"mana-header-bar-divider","aria-hidden":"true"}):null,s?n("span",{class:"mana-header-bar-topic mana-text-body-sm-normal"},[s]):null]),o=n("div",{class:"mana-header-bar-trailing"});for(const l of this.actions){const c=n("button",{type:"button",class:"mana-header-bar-action","aria-label":l.label,"aria-pressed":l.active!=null?String(l.active):void 0,"data-active":l.active?"true":void 0},[n("span",{class:"mana-text-body-xs-semibold"},[l.label.slice(0,1)]),l.dot?n("span",{class:"mana-header-bar-action-dot","aria-hidden":"true"}):null]);c.addEventListener("click",()=>v(this,"action",{id:l.id,action:l})),o.append(c)}if(a){const l=document.createElement("mana-search-bar");l.setAttribute("size","sm"),l.setAttribute("placeholder",this.getAttribute("search-placeholder")??"Search"),l.addEventListener("input",c=>{c.stopPropagation(),v(this,"search",c.detail)}),o.append(n("div",{class:"mana-header-bar-search"},[l]))}this.replaceChildren(n("header",{class:"mana-header-bar"},[r,o]))}}d(cs,"observedAttributes",["title","topic","searchable","search-placeholder","actions"]);class ds extends E{constructor(){super(...arguments);d(this,"_items",null);d(this,"expandedFolders",new Set)}get items(){return this._items??N(this,"items",[])}set items(t){this._items=t,this.mounted&&this.render()}renderItem(t,s){const a=t.id===s,r=n("button",{type:"button",class:"mana-guild-btn","aria-label":t.name,"aria-current":a?"page":void 0,"data-active":a?"true":void 0,"data-action":t.action?"true":void 0},[t.iconSrc?n("img",{src:t.iconSrc,alt:""}):n("span",{},[t.acronym??Ot(t.name)])]);return t.color&&!a&&(r.style.backgroundColor=t.color,r.style.color="var(--white)"),r.addEventListener("click",()=>{t.action||this.setAttribute("active-id",t.id),v(this,"select",{id:t.id,item:t})}),n("div",{class:"mana-guild-item","data-active":a?"true":void 0,"data-unread":!a&&(t.unread||(t.mentions??0)>0)?"true":void 0},[t.action?null:n("span",{class:"mana-guild-pill","aria-hidden":"true"},[n("span",{class:"mana-guild-pill-bar"})]),r,t.mentions&&t.mentions>0?n("span",{class:"mana-guild-badge","aria-label":`${t.mentions} mentions`},[(()=>{const l=document.createElement("mana-number-badge");return l.setAttribute("count",String(t.mentions)),l})()]):null])}render(){const t=this.getAttribute("active-id")??"",s=n("nav",{class:"mana-guild-rail","aria-label":this.getAttribute("aria-label")??"Servers"}),a=n("div",{class:"mana-guild-rail-scroller"});this.hasAttribute("has-dock")&&(a.style.paddingBottom="72px");for(const r of this.items)if(r.type==="folder"){const o=this.expandedFolders.has(r.id),l=n("div",{class:"mana-guild-folder","data-expanded":o?"true":void 0});r.color&&l.style.setProperty("--mana-folder-color",r.color);const c=n("button",{type:"button",class:"mana-guild-folder-btn","aria-label":r.name,"aria-expanded":String(o)},[o?T([...C.folder],18):n("span",{class:"mana-guild-folder-preview","aria-hidden":"true"},r.items.slice(0,4).map(h=>n("span",{class:"mana-guild-folder-mini"},[(h.acronym??Ot(h.name)).slice(0,2)])))]);c.addEventListener("click",()=>{this.expandedFolders.has(r.id)?this.expandedFolders.delete(r.id):this.expandedFolders.add(r.id),this.render()}),l.append(n("div",{class:"mana-guild-folder-bg","aria-hidden":"true"}),n("div",{class:"mana-guild-item"},[c])),o&&l.append(n("div",{class:"mana-guild-folder-items",role:"group","aria-label":r.name},r.items.map(h=>this.renderItem(h,t)))),a.append(l)}else a.append(this.renderItem(r,t));s.append(a),this.replaceChildren(s)}}d(ds,"observedAttributes",["items","active-id","has-dock","aria-label"]);class hs extends E{constructor(){super(...arguments);d(this,"_categories",null);d(this,"collapsed",new Set)}get categories(){return this._categories??N(this,"categories",[])}set categories(t){this._categories=t,this.mounted&&this.render()}render(){const t=this.getAttribute("title")??"",s=this.getAttribute("active-channel-id")??"",a=n("aside",{class:"mana-channel-sidebar","aria-label":this.getAttribute("aria-label")??"Channels"});a.append(n("div",{class:"mana-channel-sidebar-header"},[n("span",{class:"mana-channel-sidebar-title-wrap"},[n("span",{class:"mana-channel-sidebar-title mana-text-heading-sm-semibold"},[t])])]));const r=n("div",{class:"mana-scroller mana-channel-sidebar-scroller","data-orientation":"vertical","data-variant":"thin","data-fade":""});for(const o of this.categories){const l=this.collapsed.has(o.id),c=n("section",{class:"mana-sidebar-category","data-collapsed":l?"true":void 0}),h=n("button",{type:"button",class:"mana-sidebar-category-toggle","aria-expanded":String(!l)},[n("span",{class:"mana-sidebar-category-caret","aria-hidden":"true"},[T([...C.chevronDown],12)]),n("span",{class:"mana-text-body-xs-semibold"},[o.label])]);h.addEventListener("click",()=>{this.collapsed.has(o.id)?this.collapsed.delete(o.id):this.collapsed.add(o.id),this.render()}),c.append(n("div",{class:"mana-sidebar-category-header"},[h]));const m=l?o.channels.filter(b=>b.id===s||b.unread):o.channels,u=n("ul",{class:"mana-sidebar-channel-list"});for(const b of m){const f=b.id===s,g=b.kind==="voice"?C.voice:C.hash,A=n("button",{type:"button",class:"mana-sidebar-channel","data-active":f?"true":void 0,"data-unread":!f&&b.unread?"true":void 0,"data-muted":b.muted?"true":void 0,"aria-current":f?"page":void 0},[n("span",{class:"mana-sidebar-channel-icon","aria-hidden":"true"},[T([...g],18)]),n("span",{class:"mana-sidebar-channel-name mana-text-body-md-medium"},[b.name])]);A.addEventListener("click",()=>{this.setAttribute("active-channel-id",b.id),v(this,"select",{channelId:b.id,channel:b})}),u.append(n("li",{},[A]))}c.append(u),r.append(c)}a.append(r),this.replaceChildren(a)}}d(hs,"observedAttributes",["title","categories","active-channel-id","aria-label"]);class us extends E{render(){const i=this.getAttribute("name")??"User",t=this.getAttribute("status")??"online",s=this.getAttribute("status-text")??t,a=this.getAttribute("avatar-src"),r=this.hasAttribute("muted"),o=this.hasAttribute("deafened"),l=n("button",{type:"button",class:"mana-user-dock-profile"},[n("span",{class:"mana-user-dock-avatar-wrap"},[n("span",{class:"mana-user-dock-avatar","aria-hidden":"true"},[a?n("img",{src:a,alt:""}):Ot(i)]),n("span",{class:"mana-user-dock-status-dot","data-status":t})]),n("span",{class:"mana-user-dock-identity"},[n("span",{class:"mana-user-dock-name mana-text-body-sm-semibold mana-heading-default-color"},[i]),n("span",{class:"mana-user-dock-subtext mana-text-body-xs-normal"},[s])])]);l.addEventListener("click",()=>v(this,"profile-click"));const c=n("button",{type:"button",class:"mana-user-dock-ctrl-btn","aria-label":r?"Unmute":"Mute","aria-pressed":String(r),"data-active":r?"true":void 0},[T([...r?C.micOff:C.mic],18)]);c.addEventListener("click",()=>{k(this,"muted",!r,""),v(this,"mute-toggle",{muted:!r})});const h=n("button",{type:"button",class:"mana-user-dock-ctrl-btn","aria-label":o?"Undeafen":"Deafen","aria-pressed":String(o),"data-active":o?"true":void 0},[T([...C.headphones],18)]);h.addEventListener("click",()=>{k(this,"deafened",!o,""),v(this,"deafen-toggle",{deafened:!o})});const m=n("button",{type:"button",class:"mana-user-dock-ctrl-btn","aria-label":"User Settings"},[T([...C.settings],18)]);m.addEventListener("click",()=>v(this,"settings-click")),this.replaceChildren(n("section",{class:"mana-user-dock","aria-label":"User area"},[n("div",{class:"mana-user-dock-main"},[l,n("div",{class:"mana-user-dock-controls"},[c,h,m])])]))}}d(us,"observedAttributes",["name","username","status","status-text","avatar-src","muted","deafened"]);class ms extends E{constructor(){super(...arguments);d(this,"_groups",null)}get groups(){return this._groups??N(this,"groups",[])}set groups(t){this._groups=t,this.mounted&&this.render()}render(){const t=n("div",{class:"mana-member-list",role:"region","aria-label":this.getAttribute("aria-label")??"Members"});for(const s of this.groups){const a=n("ul",{class:"mana-member-group-items"});for(const r of s.items){const o=r.status??"online",l=o==="offline",c=n("span",{class:"mana-user-dock-avatar","aria-hidden":"true"},[r.avatarSrc?n("img",{src:r.avatarSrc,alt:""}):r.avatarFallback??Ot(r.name)]);r.avatarColor&&(c.style.backgroundColor=r.avatarColor);const h=n("span",{class:"mana-member-name mana-text-body-sm-medium"},[r.name]);r.nameColor&&(h.style.color=r.nameColor);const m=n("button",{type:"button",class:"mana-member-row","data-offline":l?"true":void 0},[n("span",{class:"mana-user-dock-avatar-wrap"},[c,l?null:n("span",{class:"mana-user-dock-status-dot","data-status":o,"aria-hidden":"true"})]),n("span",{class:"mana-member-info"},[n("span",{class:"mana-member-name-row"},[h]),r.subtitle?n("span",{class:"mana-member-subtext mana-text-body-xs-normal"},[r.subtitle]):null])]);m.addEventListener("click",()=>v(this,"select",{member:r})),a.append(n("li",{},[m]))}t.append(n("section",{class:"mana-member-group","aria-label":s.label},[n("div",{class:"mana-member-group-header"},[`${s.label} — ${s.count??s.items.length}`]),a]))}this.replaceChildren(t)}}d(ms,"observedAttributes",["groups","aria-label"]);class ps extends E{render(){const i=this.getAttribute("label")??"APP",t=this.hasAttribute("verified");this.className="botTag_feVUtO botTagRegular_feVUtO rem_feVUtO botTag_2i8Bfm botTagCozy_2i8Bfm";const s=[];t&&s.push(S("svg",{class:"botTagVerified_feVUtO","aria-label":"Verified App",width:16,height:16,viewBox:"0 0 16 15.2"},[S("path",{d:"M7.4,11.17,4,8.62,5,7.26l2,1.53L10.64,4l1.36,1Z",fill:"currentColor"})])),s.push(n("span",{class:"botText_feVUtO"},[i])),this.replaceChildren(...s)}}d(ps,"observedAttributes",["label","verified"]);class bs extends E{constructor(){super(...arguments);d(this,"onKeyDown",t=>{this.hasAttribute("clickable")&&O(t)&&(t.preventDefault(),this.click())})}onConnect(){this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.getAttribute("label")??"",s=this.getAttribute("icon-src"),a=this.hasAttribute("clickable");this.className=`chipletContainerInner_k8jyN7 chipletContainerInline_k8jyN7 clanTagChiplet_2i8Bfm${a?" clickable_k8jyN7":""}`,a?(this.setAttribute("role","button"),this.setAttribute("tabindex","0")):(this.removeAttribute("role"),this.removeAttribute("tabindex")),this.replaceChildren(n("span",{class:"text_k8jyN7"},[s?n("span",{class:"badge_k8jyN7","aria-hidden":"true"},[n("img",{src:s,alt:"",width:12,height:12})]):null,n("span",{class:"tagText_k8jyN7"},[t])]))}}d(bs,"observedAttributes",["label","icon-src","clickable"]);class fs extends E{render(){const i=this.getAttribute("label"),t=this.hasAttribute("unread"),s=this.getAttribute("unread-label")??"new",a=n("div",{role:"separator",class:["divider_4TfzT5",t?"isUnread_4TfzT5":"",i?"hasContent_4TfzT5":""].filter(Boolean).join(" ")},[i?n("span",{class:"content_4TfzT5"},[i]):null,t?n("span",{class:"unreadPill_4TfzT5 endCap_4TfzT5"},[S("svg",{class:"unreadPillCap_4TfzT5",width:8,height:13,viewBox:"0 0 8 13","aria-hidden":"true"},[S("path",{class:"unreadPillCapStroke_4TfzT5",stroke:"currentColor",fill:"transparent",d:"M8.16639 0.5H9C10.933 0.5 12.5 2.067 12.5 4V9C12.5 10.933 10.933 12.5 9 12.5H8.16639C7.23921 12.5 6.34992 12.1321 5.69373 11.4771L0.707739 6.5L5.69373 1.52292C6.34992 0.86789 7.23921 0.5 8.16639 0.5Z"})]),s]):null]);this.replaceChildren(a)}}d(fs,"observedAttributes",["label","unread","unread-label"]);class gs extends E{constructor(){super(...arguments);d(this,"innerEl",null)}onConnect(){if(!this.innerEl){const t=Array.from(this.childNodes);this.innerEl=n("div",{role:"list",class:"cv-message-list-inner"});for(const s of t)this.innerEl.append(s);this.append(n("div",{class:"cv-message-list",role:"log","aria-label":this.getAttribute("aria-label")??"Messages"},[this.innerEl]))}}render(){const t=this.querySelector(".cv-message-list");t&&t.setAttribute("aria-label",this.getAttribute("aria-label")??"Messages")}}d(gs,"observedAttributes",["aria-label"]);class vs extends E{constructor(){super(...arguments);d(this,"_reactions",null);d(this,"badgeNodes",[]);d(this,"accessoryNodes",[]);d(this,"captured",!1)}get reactions(){return this._reactions??N(this,"reactions",[])}set reactions(t){this._reactions=t,this.mounted&&this.render()}onConnect(){if(!this.captured){this.captured=!0;for(const t of Array.from(this.childNodes)){const s=t instanceof HTMLElement?t.getAttribute("slot"):null;s==="badges"?this.badgeNodes.push(t):s==="accessory"&&this.accessoryNodes.push(t)}}}render(){const t=this.getAttribute("author")??"User",s=this.getAttribute("author-color"),a=this.getAttribute("avatar-src")??Js(t),r=this.getAttribute("timestamp"),o=this.getAttribute("iso-timestamp"),l=this.getAttribute("compact-timestamp")??r,c=this.hasAttribute("grouped"),h=this.hasAttribute("mentioned"),m=this.hasAttribute("selected"),u=this.hasAttribute("edited"),b=this.getAttribute("content")??"",f=this.getAttribute("reply-author"),g=this.getAttribute("reply-preview"),A=this.reactions,y=this.hasAttribute("show-add-reaction"),w=!c||!!f,x=n("div",{class:"contents_2i8Bfm"});if(w){const D=n("img",{src:a,alt:" ","aria-hidden":"true",class:"avatar_2i8Bfm clickable_2i8Bfm"});D.addEventListener("click",()=>v(this,"author-click",{author:t}));const I=n("span",{class:"username_2i8Bfm clickable_2i8Bfm"},[t]);s&&(I.style.color=s),I.addEventListener("click",()=>v(this,"author-click",{author:t}));const M=n("span",{class:"headerText_2i8Bfm"},[I,...this.badgeNodes]),$=n("h3",{class:"header_2i8Bfm"},[M,r?n("span",{class:"timestamp_2i8Bfm timestampInline_2i8Bfm"},[n("time",{datetime:o??void 0},[n("i",{class:"separator_2i8Bfm","aria-hidden":"true"},[" — "]),r])]):null]);x.append(D,$)}else l&&x.append(n("span",{class:"timestamp_2i8Bfm alt_2i8Bfm timestampVisibleOnHover_2i8Bfm","data-slot":"timestamp-alt"},[n("time",{datetime:o??void 0},[n("i",{class:"separator_2i8Bfm","aria-hidden":"true"},["["]),l,n("i",{class:"separator_2i8Bfm","aria-hidden":"true"},["]"])])]));const L=n("div",{class:"markup_ku1OHH messageContent_2i8Bfm"},[b,u?n("span",{class:"timestamp_2i8Bfm timestampInline_2i8Bfm"},[n("time",{},[n("span",{class:"edited_2i8Bfm"},["(edited)"])])]):null]);x.append(L);const _=[];if(f&&_.push(n("div",{class:"repliedMessage_2i8Bfm messageSpine_2i8Bfm"},[n("img",{src:Js(f),alt:" ","aria-hidden":"true",class:"replyAvatar_2i8Bfm"}),n("span",{class:"username_2i8Bfm"},[`@${f}`]),g?n("span",{class:"repliedTextPreview_2i8Bfm"},[n("span",{class:"repliedTextContent_2i8Bfm"},[g])]):null])),_.push(x),this.accessoryNodes.length>0||A.length>0||y){const D=n("div",{class:"container_YUQhib"},this.accessoryNodes);if(A.length>0||y){const I=n("div",{class:"reactions_UNkajC",role:"group","aria-label":"Reactions"});for(const M of A){const $=Math.max(1,Math.ceil(Math.log10(Math.max(1,M.count)+1)))*12,R=n("img",{class:"emoji",src:Sa(M.emoji),alt:M.emoji,draggable:"false"});R.addEventListener("error",()=>R.replaceWith(n("span",{class:"emoji-text"},[M.emoji])));const Et=n("div",{class:"reactionCount_UNkajC"},[String(M.count)]);Et.style.minWidth=`${$}px`;const ht=n("div",{role:"button",tabindex:0,"aria-pressed":String(!!M.active),class:`reaction_UNkajC reactionInner_UNkajC${M.active?" reactionMe_UNkajC":""}`},[R,Et]),yt=()=>v(this,"reaction-click",{reaction:M});ht.addEventListener("click",yt),ht.addEventListener("keydown",F=>{O(F)&&(F.preventDefault(),yt())}),I.append(ht)}if(y){const M=n("div",{role:"button",tabindex:0,"aria-label":"Add Reaction",class:"reactionBtn_UNkajC"},[T([...C.reactionPlus],18,"0 0 24 24","icon_UNkajC")]),$=()=>v(this,"add-reaction");M.addEventListener("click",$),M.addEventListener("keydown",R=>{O(R)&&(R.preventDefault(),$())}),I.append(M)}D.append(I)}_.push(D)}const W=n("div",{role:"listitem",class:"cv-message","data-group-start":w?"true":void 0,"data-mentioned":h?"true":void 0,"data-selected":m?"true":void 0},[n("div",{class:`wrapper_2i8Bfm cozy_2i8Bfm zalgo_2i8Bfm${f?" hasReply_2i8Bfm":""}`,role:"article",tabindex:-1},_)]);this.replaceChildren(W)}}d(vs,"observedAttributes",["author","author-color","avatar-src","timestamp","iso-timestamp","compact-timestamp","grouped","mentioned","selected","edited","content","reply-author","reply-preview","reactions","show-add-reaction"]);class As extends E{constructor(){super(...arguments);d(this,"areaEl",null)}get value(){return this.areaEl?this.areaEl.value:this.getAttribute("value")??""}set value(t){this.setAttribute("value",t),this.areaEl&&(this.areaEl.value=t)}render(){const t=this.getAttribute("value")??"",s=this.getAttribute("placeholder")??"Message…",a=this.hasAttribute("disabled"),r=this.getAttribute("reply-author"),o=this.getAttribute("show-send-button")!=="false",l=n("textarea",{rows:1,class:"mana-composer-input",placeholder:s,"aria-label":s,disabled:a});l.value=t,this.areaEl=l;const c=n("button",{type:"button",class:"mana-composer-btn","aria-label":"Send message",disabled:a||!t.trim()},[T([...C.send],16)]),h=()=>{const u=l.value.trim();!u||a||(v(this,"submit",{value:u}),l.value="",this.setAttribute("value",""),c.disabled=!0)};l.addEventListener("input",()=>{c.disabled=a||!l.value.trim(),v(this,"input",{value:l.value})}),l.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),h())}),c.addEventListener("click",h);const m=[];if(r){const u=n("button",{type:"button",class:"mana-composer-btn","aria-label":"Cancel reply"},[T([...C.x],14)]);u.addEventListener("click",()=>v(this,"reply-cancel")),m.push(n("div",{class:"mana-composer-reply-bar"},[n("span",{class:"mana-text-body-xs-medium"},["Replying to ",n("strong",{},[`@${r}`])]),u]))}m.push(n("div",{class:"mana-composer-row"},[l,n("div",{class:"mana-composer-trailing"},[o?c:null])])),this.replaceChildren(n("div",{class:"mana-composer-wrap"},[n("div",{class:"mana-composer"},m)]))}}d(As,"observedAttributes",["value","placeholder","disabled","reply-author","show-send-button"]);class Es extends E{constructor(){super(...arguments);d(this,"_fields",null)}get fields(){return this._fields??N(this,"fields",[])}set fields(t){this._fields=t,this.mounted&&this.render()}render(){const t=this.getAttribute("title"),s=this.getAttribute("description"),a=this.getAttribute("url"),r=this.getAttribute("color"),o=this.getAttribute("provider"),l=this.getAttribute("author-name"),c=this.getAttribute("author-icon"),h=this.getAttribute("footer"),m=this.getAttribute("footer-icon"),u=this.getAttribute("timestamp"),b=this.getAttribute("thumbnail-src"),f=this.getAttribute("image-src"),g=this.fields,A=n("div",{class:"grid_XyW1ZT"});if(o&&A.append(n("div",{class:"embedProvider_XyW1ZT embedMargin_XyW1ZT"},[o])),l&&A.append(n("div",{class:"embedAuthor_XyW1ZT embedMargin_XyW1ZT"},[c?n("img",{class:"embedAuthorIcon_XyW1ZT",src:c,alt:""}):null,n("span",{class:"embedAuthorName_XyW1ZT"},[l])])),t&&A.append(n("div",{class:"embedTitle_XyW1ZT embedMargin_XyW1ZT"},[a?n("a",{class:"embedTitleLink_XyW1ZT",href:a,target:"_blank",rel:"noopener noreferrer"},[t]):t])),s&&A.append(n("div",{class:"embedDescription_XyW1ZT embedMargin_XyW1ZT"},[s])),g.length>0){const w=n("div",{class:"embedFields_XyW1ZT"});for(const x of g){const L=n("div",{class:"embedField_XyW1ZT"},[n("div",{class:"embedFieldName_XyW1ZT"},[x.name]),n("div",{class:"embedFieldValue_XyW1ZT"},[x.value])]);L.style.gridColumn=x.inline?"span 4":"1 / -1",w.append(L)}A.append(w)}b&&A.append(n("div",{class:"embedThumbnail_XyW1ZT"},[n("img",{src:b,alt:"",style:"max-width:80px;max-height:80px;border-radius:4px"})])),f&&A.append(n("div",{class:"embedMedia_XyW1ZT embedImage_XyW1ZT"},[n("img",{src:f,alt:"",style:"max-width:100%;border-radius:4px"})])),(h||u)&&A.append(n("div",{class:"embedFooter_XyW1ZT embedMargin_XyW1ZT"},[m?n("img",{class:"embedFooterIcon_XyW1ZT",src:m,alt:""}):null,n("span",{class:"embedFooterText_XyW1ZT"},[h??"",h&&u?n("span",{class:"embedFooterSeparator_XyW1ZT"},["•"]):null,u??""])]));const y=n("article",{class:"embedFull_XyW1ZT embed_XyW1ZT markup_ku1OHH"},[n("div",{class:"gridContainer_XyW1ZT"},[A])]);r&&(y.style.borderColor=r),this.replaceChildren(y)}}d(Es,"observedAttributes",["title","description","url","color","provider","author-name","author-icon","footer","footer-icon","timestamp","thumbnail-src","image-src","fields"]);class ys extends E{constructor(){super(...arguments);d(this,"_sections",null);d(this,"query","")}get sections(){return this._sections??N(this,"sections",[])}set sections(t){this._sections=t,this.mounted&&this.render()}render(){const t=this.hasAttribute("inline");if(!(this.hasAttribute("open")||t)){this.replaceChildren();return}const a=this.sections,r=a.flatMap(g=>g.items),o=this.getAttribute("active-id")??r[0]?.id??"",l=r.find(g=>g.id===o),c=this.query.trim().toLowerCase(),h=n("aside",{class:"mana-settings-sidebar"});if(this.hasAttribute("searchable")){const g=document.createElement("mana-search-bar");g.setAttribute("size","sm"),g.setAttribute("placeholder","Search"),g.setAttribute("value",this.query),g.addEventListener("input",A=>{A.stopPropagation(),this.query=A.detail.value,this.render()}),h.append(n("div",{class:"mana-settings-search"},[g]))}const m=n("nav",{class:"mana-settings-nav"});for(const g of a){const A=c?g.items.filter(y=>y.label.toLowerCase().includes(c)):g.items;if(A.length){g.label&&m.append(n("div",{class:"mana-settings-section-label mana-text-body-xs-semibold"},[g.label]));for(const y of A){const w=y.id===o,x=n("button",{type:"button",class:"mana-settings-item","data-active":w?"true":void 0,"aria-current":w?"page":void 0},[n("span",{class:"mana-text-body-md-medium"},[y.label])]);x.addEventListener("click",()=>{this.setAttribute("active-id",y.id),v(this,"section-change",{id:y.id,item:y})}),m.append(x)}}}h.append(m);const u=document.createElement("mana-close-button");u.addEventListener("click",()=>{this.removeAttribute("open"),v(this,"close")});const b=n("div",{class:"mana-settings-content"},[n("div",{class:"mana-settings-content-header"},[n("h2",{class:"mana-text-heading-lg-semibold mana-heading-default-color"},[l?.label??"Settings"]),u]),n("div",{class:"mana-settings-content-body mana-text-body-md-normal"},[l?.content??""])]);if(this.hasAttribute("unsaved")){const g=document.createElement("mana-text-button");g.setAttribute("variant","secondary"),g.textContent="Reset",g.addEventListener("click",()=>v(this,"reset"));const A=document.createElement("mana-button");A.setAttribute("variant","active"),A.setAttribute("size","sm"),A.textContent="Save Changes",A.addEventListener("click",()=>v(this,"save")),b.append(n("div",{class:"mana-settings-save-notice"},[n("div",{class:"mana-settings-save-flex"},[n("span",{class:"mana-settings-save-message mana-text-body-sm-medium"},["Careful — you have unsaved changes!"]),n("div",{class:"mana-settings-save-actions"},[g,A])])]))}const f=n("div",{class:"mana-settings-modal","data-mana-component":"layer-modal",role:"dialog","aria-modal":t?void 0:"true","aria-label":this.getAttribute("aria-label")??"Settings"},[n("div",{class:"mana-settings-layout"},[h,b])]);if(t)this.replaceChildren(f);else{const g=n("div",{class:"mana-modal-backdrop"},[n("div",{class:"mana-modal-outer"},[f])]);g.addEventListener("click",A=>{A.target===g&&(this.removeAttribute("open"),v(this,"close"))}),this.replaceChildren(g)}}}d(ys,"observedAttributes",["open","inline","sections","active-id","searchable","unsaved","aria-label"]);const ti={"mana-provider":Jt,"mana-text":te,"mana-heading":ee,"mana-badge":se,"mana-chip":ie,"mana-indicator-dot":ae,"mana-stack":ne,"mana-gradient":re,"mana-graphic":oe,"mana-field":le,"mana-fieldset":ce,"mana-hidden-visually":de,"mana-button":he,"mana-button-group":ue,"mana-text-button":me,"mana-toggle-button":pe,"mana-toggle-icon-button":be,"mana-icon-button":fe,"mana-close-button":ge,"mana-toolbar":ve,"mana-toolbar-group":Ae,"mana-toolbar-separator":Ee,"mana-checkbox":ye,"mana-checkbox-group":we,"mana-radio-group":xe,"mana-switch":ke,"mana-text-input":Le,"mana-text-area":Ce,"mana-search-bar":_e,"mana-number-input":Te,"mana-slider":Se,"mana-tag":Me,"mana-tag-group":De,"mana-listbox":Ne,"mana-select":Be,"mana-combobox":Re,"mana-tabs":Oe,"mana-calendar":Ie,"mana-range-calendar":Pe,"mana-date-picker":We,"mana-modal":$e,"mana-confirm-modal":He,"mana-layer-modal":ze,"mana-popover":Ke,"mana-tooltip":Fe,"mana-global-banner":Ye,"mana-inline-notice":Ue,"mana-countdown":Ze,"mana-progress-bar":Xe,"mana-toast":Ve,"mana-toast-container":qe,"mana-spinner":je,"mana-divider":Ge,"mana-card":Qe,"mana-anchor":Je,"mana-number-badge":ts,"mana-progress-circle":es,"mana-scroller":ss,"mana-table":is,"mana-menu":as,"mana-app-shell":ns,"mana-app-top-bar":rs,"mana-app-status-bar":os,"mana-app-sidebar":ls,"mana-header-bar":cs,"mana-guild-rail":ds,"mana-channel-sidebar":hs,"mana-user-dock":us,"mana-member-list":ms,"mana-app-tag":ps,"mana-server-tag":bs,"mana-message-divider":fs,"mana-message-list":gs,"mana-message":vs,"mana-message-composer":As,"mana-embed":Es,"mana-settings-modal":ys};function ei(){if(!(typeof customElements>"u"))for(const[e,i]of Object.entries(ti))customElements.get(e)||customElements.define(e,i)}return typeof window<"u"&&typeof customElements<"u"&&ei(),p.Announcer=li,p.DEFAULT_MANA_I18N=ri,p.DENSITIES=nt,p.MANA_ELEMENTS=ti,p.MOTION=ii,p.ManaAnchorElement=Je,p.ManaAppShellElement=ns,p.ManaAppSidebarElement=ls,p.ManaAppStatusBarElement=os,p.ManaAppTagElement=ps,p.ManaAppTopBarElement=rs,p.ManaBadgeElement=se,p.ManaButtonElement=he,p.ManaButtonGroupElement=ue,p.ManaCalendarElement=Ie,p.ManaCardElement=Qe,p.ManaChannelSidebarElement=hs,p.ManaCheckboxElement=ye,p.ManaCheckboxGroupElement=we,p.ManaChipElement=ie,p.ManaCloseButtonElement=ge,p.ManaComboBoxElement=Re,p.ManaConfirmModalElement=He,p.ManaCountdownElement=Ze,p.ManaDatePickerElement=We,p.ManaDividerElement=Ge,p.ManaEmbedElement=Es,p.ManaFieldElement=le,p.ManaFieldSetElement=ce,p.ManaGlobalBannerElement=Ye,p.ManaGradientElement=re,p.ManaGraphicElement=oe,p.ManaGuildRailElement=ds,p.ManaHeaderBarElement=cs,p.ManaHeadingElement=ee,p.ManaHiddenVisuallyElement=de,p.ManaIconButtonElement=fe,p.ManaIndicatorDotElement=ae,p.ManaInlineNoticeElement=Ue,p.ManaLayerModalElement=ze,p.ManaListBoxElement=Ne,p.ManaMemberListElement=ms,p.ManaMenuElement=as,p.ManaMessageComposerElement=As,p.ManaMessageDividerElement=fs,p.ManaMessageElement=vs,p.ManaMessageListElement=gs,p.ManaModalElement=$e,p.ManaNumberBadgeElement=ts,p.ManaNumberInputElement=Te,p.ManaPopoverElement=Ke,p.ManaProgressBarElement=Xe,p.ManaProgressCircleElement=es,p.ManaProviderElement=Jt,p.ManaRadioGroupElement=xe,p.ManaRangeCalendarElement=Pe,p.ManaScrollerElement=ss,p.ManaSearchBarElement=_e,p.ManaSelectElement=Be,p.ManaServerTagElement=bs,p.ManaSettingsModalElement=ys,p.ManaSliderElement=Se,p.ManaSpinnerElement=je,p.ManaStackElement=ne,p.ManaSwitchElement=ke,p.ManaTableElement=is,p.ManaTabsElement=Oe,p.ManaTagElement=Me,p.ManaTagGroupElement=De,p.ManaTextAreaElement=Ce,p.ManaTextButtonElement=me,p.ManaTextElement=te,p.ManaTextInputElement=Le,p.ManaToastContainerElement=qe,p.ManaToastElement=Ve,p.ManaToggleButtonElement=pe,p.ManaToggleIconButtonElement=be,p.ManaToolbarElement=ve,p.ManaToolbarGroupElement=Ae,p.ManaToolbarSeparatorElement=Ee,p.ManaTooltipElement=Fe,p.ManaUserDockElement=us,p.ModalTransitionState=Ms,p.RADII=si,p.THEMES=Y,p.TYPOGRAPHY_VARIANTS=ai,p.ToastContextMap=hi,p.WEEKDAY_LABELS=Qt,p.addMonths=At,p.applyThemeAttributes=xs,p.clearToasts=bi,p.closeAllModals=Ai,p.closeModal=vi,p.compareDates=dt,p.computeFloatingPosition=it,p.createToast=ui,p.cx=fa,p.daysInMonth=js,p.dismissToast=_s,p.firstWeekdayOfMonth=Gs,p.floatingAutoUpdate=la,p.focusFirstOrContainer=ks,p.focusLockStack=xt,p.formatCalendarDate=Rt,p.formatMonthYear=qt,p.getBasePlacement=Vt,p.getModals=Ds,p.getMonthGrid=Gt,p.getTabbableElements=Pt,p.getThemeClasses=ni,p.getToastQueues=Ts,p.isDateOutOfBounds=jt,p.isFocusLockActive=di,p.isSameDate=Bt,p.kebabCase=Qs,p.openModal=gi,p.popToast=pi,p.registerManaElements=ei,p.resolveColorCss=It,p.showToast=mi,p.subscribeModals=Ei,p.subscribeToasts=Ss,p.toFloatingPlacement=ba,p.todayDate=vt,p.variantToSlug=ut,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),p})({});
1
+ var Mana=(function(p){"use strict";var Da=Object.defineProperty;var Na=(p,Y,nt)=>Y in p?Da(p,Y,{enumerable:!0,configurable:!0,writable:!0,value:nt}):p[Y]=nt;var d=(p,Y,nt)=>Na(p,typeof Y!="symbol"?Y+"":Y,nt);const Y={ASH:"dark",LIGHT:"light",ONYX:"midnight",DARK:"darker"},nt=["default","compact","cozy"],ii={none:0,xs:4,sm:8,md:12,lg:16,xl:24,xxl:32,round:2147483647},ai={SUBTLE_SPRING:{mass:1,stiffness:300,damping:27}},ni=["heading-xs/medium","heading-xs/semibold","heading-sm/medium","heading-sm/semibold","heading-md/medium","heading-md/semibold","heading-lg/medium","heading-lg/semibold","heading-xl/medium","heading-xl/semibold","heading-xxl/medium","heading-xxl/semibold","body-xs/normal","body-xs/medium","body-xs/semibold","body-sm/normal","body-sm/medium","body-sm/semibold","body-md/normal","body-md/medium","body-md/semibold","body-lg/normal","body-lg/medium","body-lg/semibold","footnote/normal","footnote/medium","footnote/semibold","display-xs","display-sm","display-md","display-lg","nitro-xs","nitro-sm","nitro-md","nitro-lg","mono-md/normal","mono-md/bold"];function It(e){return e==="currentColor"?"currentColor":e.startsWith("var(")?e:`var(--${e.toLowerCase().replace(/_/g,"-").replace(/^--/,"")})`}function ut(e){return e.replace(/\//g,"-")}function ri(e){if(e==null)return;const i=e==="dark"||e==="midnight"?"dark":e;return`theme-${i} theme-${e} images-${i}`}function xs(e,i={}){if(!e)return;const t=i.theme??"dark",s=i.density??"default",a=!!i.highContrast,r=!!i.reducedMotion;e.setAttribute("data-theme",t),e.setAttribute("data-density",s),a?e.setAttribute("data-high-contrast","true"):e.removeAttribute("data-high-contrast"),e.classList.remove("theme-dark","theme-light","theme-darker","theme-midnight"),t==="darker"||t==="midnight"?e.classList.add("theme-dark",`theme-${t}`):e.classList.add(`theme-${t}`),e.classList.remove("density-default","density-compact","density-cozy"),e.classList.add(`density-${s}`),e.classList.toggle("high-contrast-mode",a),e.classList.toggle("reduce-motion",r),e.classList.toggle("full-motion",!r),typeof i.saturation=="number"&&e.style.setProperty("--saturation-factor",String(i.saturation))}const oi={CANCEL:"Cancel",BACK:"Back",NEXT:"Next",SUBMIT:"Submit",SPINNER_LOADING_LABEL:"Loading",BUTTON_LOADING_STARTED_LABEL:"Loading",BUTTON_LOADING_FINISHED_LABEL:"Loading",CLOSE_BUTTON_LABEL:"Close",DISMISS_BUTTON_LABEL:"Dismiss",PLAY_BUTTON_LABEL:"Play",PAUSE_BUTTON_LABEL:"Pause",NEW:"New",BETA:"Beta",EARLY_ACCESS:"Early Access",BILLING_TRIAL_FREE_TRIAL_TEXT:"Free Trial",MODAL_DONT_SHOW_AGAIN:"Don't show again",SEARCH:"Search",AUTOCOMPLETE_NO_RESULTS_HEADER:"Nope!",AUTOCOMPLETE_NO_RESULTS_BODY:"Did you make a typo?",LISTBOX_EMPTY_STATE:"No items to show",LISTBOX_EMPTY_STATE_WITH_QUERY:e=>`No results for ‘${e}’`,KEY_CTRL_A11Y_LABEL:"Ctrl",KEY_CMD_A11Y_LABEL:"Cmd",KEY_ALT_A11Y_LABEL:"Alt",KEY_OPTION_A11Y_LABEL:"Option",KEY_SHIFT_A11Y_LABEL:"Shift",KEY_UP_A11Y_LABEL:"Up",KEY_DOWN_A11Y_LABEL:"Down",KEY_LEFT_A11Y_LABEL:"Left",KEY_RIGHT_A11Y_LABEL:"Right",KEY_PAGEUP:"Page Up",KEY_PAGEDOWN:"Page Down",KEY_ANY:"Any",KEY_ENTER:"Enter",KEY_ENTER_A11Y_LABEL:"Enter",KEY_RETURN_A11Y_LABEL:"Return",KEY_ESCAPE:"Escape",KEY_ESCAPE_A11Y_LABEL:"Escape",KEY_BACKSPACE:"Backspace",KEY_BACKSPACE_A11Y_LABEL:"Backspace",KEY_DELETE_A11Y_LABEL:"Delete",KEY_SHIFT:"Shift",DATE_INPUT_OPEN_CALENDAR_LABEL:"Open calendar",CALENDAR_PREVIOUS_MONTH_LABEL:"Previous month",CALENDAR_NEXT_MONTH_LABEL:"Next month",INLINE_NOTICE_GENERIC_ERROR:"Something went wrong. Please try again later.",FEEDBACK_CRITICAL_ICON_A11Y_LABEL:"Error",FEEDBACK_WARNING_ICON_A11Y_LABEL:"Warning",FEEDBACK_INFO_ICON_A11Y_LABEL:"Info",FEEDBACK_POSITIVE_ICON_A11Y_LABEL:"Success",STEP_INDICATOR:(e,i)=>`Step ${e} of ${i}`,SELECT_PLACEHOLDER:"Select...",CLEAR_SELECTION:"Clear",SELECTED_TAGS_HEADING:"Selected",PRESS_DELETE_TO_REMOVE_TAG:"Press Delete to remove tag",PERCENT_COMPLETE:e=>`${e} percent complete`,TEXT_INPUT_CLEAR:"Clear",TEXT_INPUT_VIEW_PASSWORD:"View Password",TEXT_INPUT_HIDE_PASSWORD:"Hide Password",TEXT_INPUT_PASSWORD_VISIBLE:"Password is visible.",TEXT_INPUT_PASSWORD_HIDDEN:"Password is hidden.",CHARACTER_COUNT_LIMIT_REACHED:"Character limit reached",CHARACTER_COUNT_A11Y_LABEL:e=>`${e} characters remaining`,MINIMUM_LENGTH_ERROR:e=>`Must be at least ${e} characters`,MAXIMUM_LENGTH_ERROR:e=>`Must be at most ${e} characters`,MINIMUM_VALUE_ERROR:e=>`Must be at least ${e}`,MAXIMUM_VALUE_ERROR:e=>`Must be at most ${e}`,GLOBAL_BANNER_COUNTDOWN_TIME_LEFT:e=>`${e} left`};class li{constructor(){d(this,"node",null);d(this,"assertiveLog",null);d(this,"politeLog",null);d(this,"locations",new Map)}ensureDom(){if(typeof document>"u")return!1;if(this.node)return!0;const i=document.createElement("div");i.setAttribute("data-live-announcer","true"),i.style.cssText="border:0;clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;";const t=document.createElement("div");t.setAttribute("role","log"),t.setAttribute("aria-live","assertive"),t.setAttribute("aria-relevant","additions");const s=document.createElement("div");return s.setAttribute("role","log"),s.setAttribute("aria-live","polite"),s.setAttribute("aria-relevant","additions"),i.appendChild(t),i.appendChild(s),document.body.prepend(i),this.node=i,this.assertiveLog=t,this.politeLog=s,!0}announce(i,t="assertive",s=7e3){if(!this.ensureDom())return;const a=t==="polite"?this.politeLog:this.assertiveLog;if(!a)return;const r=document.createElement("div");if(typeof i=="string"){if(i==="")return;r.textContent=i}else r.setAttribute("role","img"),r.setAttribute("aria-labelledby",i["aria-labelledby"]);a.appendChild(r),s>0&&setTimeout(()=>r.remove(),s)}clearAnnouncements(i){this.node&&((!i||i==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!i||i==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}moveTo(i,t){!t||this.locations.has(i)||!this.ensureDom()||!this.node||(this.locations.set(i,t),t.prepend(this.node))}remove(i){if(!this.locations.has(i)||(this.locations.delete(i),!this.node||typeof document>"u"))return;const t=[...this.locations.values()];(t.length>0?t[t.length-1]:document.body)?.prepend(this.node)}}const ci=new li;class di{constructor(){d(this,"locks",[])}add(i,t){const s=this.current();s&&(s.enabled=!1,s.setEnabled(!1));const a={uid:i,setEnabled:t,enabled:!0};this.locks.push(a),t(!0)}remove(i){const t=this.locks.findIndex(r=>r.uid===i);if(t===-1)return;const[s]=this.locks.splice(t,1);s.enabled=!1,s.setEnabled(!1);const a=this.current();a&&!a.enabled&&(a.enabled=!0,a.setEnabled(!0))}current(){return this.locks[this.locks.length-1]}isActive(){return this.locks.length>0}}const xt=new di;function hi(){return xt.isActive()}function Pt(e){const i=[],t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(a){const r=a;return r.disabled?NodeFilter.FILTER_SKIP:r.getAttribute("aria-hidden")==="true"?NodeFilter.FILTER_REJECT:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=t.nextNode();for(;s;)i.push(s),s=t.nextNode();return i}function ks(e,i=!1){const t=Pt(e);t.length>0?(i?t[t.length-1]:t[0]).focus():e.focus()}const ui={APP:"app",OVERLAY:"overlay",POPOUT:"popout",CALL_TILE_POPOUT:"call-tile-popout"};let Ls=0;const B={app:[],overlay:[],popout:[],"call-tile-popout":[]},Wt=new Set;function mt(e){return e==="overlay"||e==="popout"||e==="call-tile-popout"?e:"app"}function Cs(e){return e==="success"||e===1?"success":e==="critical"||e===2?"critical":"default"}function pt(){const e={app:[...B.app],overlay:[...B.overlay],popout:[...B.popout],"call-tile-popout":[...B["call-tile-popout"]]};for(const i of Wt)i(e)}function mi(e,i="default",t={}){return{id:t.id??`mana-toast-${++Ls}`,toastKey:t.toastKey,text:e,variant:Cs(i),surface:mt(t.surface),duration:t.duration??3e3,icon:t.icon,iconColor:t.iconColor,secondaryIconColor:t.secondaryIconColor,position:t.position??"top",__dangerouslyRenderContent:t.__dangerouslyRenderContent}}function pi(e){const i=mt(e.surface),t={id:e.id??`mana-toast-${++Ls}`,toastKey:e.toastKey,text:e.text??e.message??"",variant:Cs(e.variant??e.type),surface:i,duration:e.duration??3e3,icon:e.icon,iconColor:e.iconColor,secondaryIconColor:e.secondaryIconColor,position:e.position??"top",__dangerouslyRenderContent:e.__dangerouslyRenderContent},s=B[i];if(t.toastKey!=null){const a=s.findIndex(r=>r.toastKey===t.toastKey);if(a!==-1)return s[a]=t,pt(),t.id}return s.push(t),pt(),t.id}function bi(e="app"){const i=mt(e),t=B[i].shift();return t&&pt(),t}function _s(e,i){const t=i?[mt(i)]:["app","overlay","popout","call-tile-popout"];let s=!1;for(const a of t){const r=B[a].findIndex(o=>o.id===e);r!==-1&&(B[a].splice(r,1),s=!0)}return s&&pt(),s}function fi(e){e?B[mt(e)]=[]:(B.app=[],B.overlay=[],B.popout=[],B["call-tile-popout"]=[]),pt()}function Ts(){return{app:[...B.app],overlay:[...B.overlay],popout:[...B.popout],"call-tile-popout":[...B["call-tile-popout"]]}}function Ss(e){return Wt.add(e),e(Ts()),()=>{Wt.delete(e)}}const Ms={ENTERING:0,ENTERED:1,EXITING:2,EXITED:3,HIDDEN:4};let gi=0,U=[];const $t=new Set;function Ht(){const e=[...U];for(const i of $t)i(e)}function vi(e,i={}){const t=i.modalKey??`mana-modal-${++gi}`,s={key:t,render:e,onCloseRequest:i.onCloseRequest,onCloseCallback:i.onCloseCallback,instant:i.instant,transitionState:Ms.ENTERED};return U=[...U.filter(a=>a.key!==t),s],Ht(),t}function Ai(e){const i=U.find(t=>t.key===e);i&&(U=U.filter(t=>t.key!==e),Ht(),i.onCloseCallback?.())}function Ei(){const e=U;U=[],Ht();for(const i of e)i.onCloseCallback?.()}function Ds(){return[...U]}function yi(e){return $t.add(e),e(Ds()),()=>{$t.delete(e)}}const wi=["top","right","bottom","left"],rt=Math.min,Z=Math.max,kt=Math.round,Lt=Math.floor,X=e=>({x:e,y:e}),xi={left:"right",right:"left",bottom:"top",top:"bottom"};function ki(e,i,t){return Z(e,rt(i,t))}function ot(e,i){return typeof e=="function"?e(i):e}function J(e){return e.split("-")[0]}function bt(e){return e.split("-")[1]}function Ns(e){return e==="x"?"y":"x"}function Bs(e){return e==="y"?"height":"width"}function V(e){const i=e[0];return i==="t"||i==="b"?"y":"x"}function Rs(e){return Ns(V(e))}function Li(e,i,t){t===void 0&&(t=!1);const s=bt(e),a=Rs(e),r=Bs(a);let o=a==="x"?s===(t?"end":"start")?"right":"left":s==="start"?"bottom":"top";return i.reference[r]>i.floating[r]&&(o=Ct(o)),[o,Ct(o)]}function Ci(e){const i=Ct(e);return[zt(e),i,zt(i)]}function zt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Os=["left","right"],Is=["right","left"],_i=["top","bottom"],Ti=["bottom","top"];function Si(e,i,t){switch(e){case"top":case"bottom":return t?i?Is:Os:i?Os:Is;case"left":case"right":return i?_i:Ti;default:return[]}}function Mi(e,i,t,s){const a=bt(e);let r=Si(J(e),t==="start",s);return a&&(r=r.map(o=>o+"-"+a),i&&(r=r.concat(r.map(zt)))),r}function Ct(e){const i=J(e);return xi[i]+e.slice(i.length)}function Di(e){var i,t,s,a;return{top:(i=e.top)!=null?i:0,right:(t=e.right)!=null?t:0,bottom:(s=e.bottom)!=null?s:0,left:(a=e.left)!=null?a:0}}function Ni(e){return typeof e!="number"?Di(e):{top:e,right:e,bottom:e,left:e}}function _t(e){const{x:i,y:t,width:s,height:a}=e;return{width:s,height:a,top:t,left:i,right:i+s,bottom:t+a,x:i,y:t}}function Ps(e,i,t){let{reference:s,floating:a}=e;const r=V(i),o=Rs(i),l=Bs(o),c=J(i),h=r==="y",m=s.x+s.width/2-a.width/2,u=s.y+s.height/2-a.height/2,b=s[l]/2-a[l]/2;let f;switch(c){case"top":f={x:m,y:s.y-a.height};break;case"bottom":f={x:m,y:s.y+s.height};break;case"right":f={x:s.x+s.width,y:u};break;case"left":f={x:s.x-a.width,y:u};break;default:f={x:s.x,y:s.y}}const g=bt(i);return g&&(f[o]+=b*(g==="end"?1:-1)*(t&&h?-1:1)),f}async function Bi(e,i){var t;i===void 0&&(i={});const{x:s,y:a,platform:r,rects:o,elements:l,strategy:c}=e,{boundary:h="clippingAncestors",rootBoundary:m="viewport",elementContext:u="floating",altBoundary:b=!1,padding:f=0}=ot(i,e),g=Ni(f),y=l[b?u==="floating"?"reference":"floating":u],w=_t(await r.getClippingRect({element:(t=await(r.isElement==null?void 0:r.isElement(y)))==null||t?y:y.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:h,rootBoundary:m,strategy:c})),x=u==="floating"?{x:s,y:a,width:o.floating.width,height:o.floating.height}:o.reference,L=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),_=await(r.isElement==null?void 0:r.isElement(L))&&await(r.getScale==null?void 0:r.getScale(L))||{x:1,y:1},W=_t(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:L,strategy:c}):x);return{top:(w.top-W.top+g.top)/_.y,bottom:(W.bottom-w.bottom+g.bottom)/_.y,left:(w.left-W.left+g.left)/_.x,right:(W.right-w.right+g.right)/_.x}}const Ri=50,Oi=async(e,i,t)=>{const{placement:s="bottom",strategy:a="absolute",middleware:r=[],platform:o}=t,l=o.detectOverflow?o:{...o,detectOverflow:Bi},c=await(o.isRTL==null?void 0:o.isRTL(i));let h=await o.getElementRects({reference:e,floating:i,strategy:a}),{x:m,y:u}=Ps(h,s,c),b=s,f=0;const g={};for(let A=0;A<r.length;A++){const y=r[A];if(!y)continue;const{name:w,fn:x}=y,{x:L,y:_,data:W,reset:D}=await x({x:m,y:u,initialPlacement:s,placement:b,strategy:a,middlewareData:g,rects:h,platform:l,elements:{reference:e,floating:i}});m=L??m,u=_??u,g[w]={...g[w],...W},D&&f<Ri&&(f++,typeof D=="object"&&(D.placement&&(b=D.placement),D.rects&&(h=D.rects===!0?await o.getElementRects({reference:e,floating:i,strategy:a}):D.rects),{x:m,y:u}=Ps(h,b,c)),A=-1)}return{x:m,y:u,placement:b,strategy:a,middlewareData:g}},Ii=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(i){var t,s;const{placement:a,middlewareData:r,rects:o,initialPlacement:l,platform:c,elements:h}=i,{mainAxis:m=!0,crossAxis:u=!0,fallbackPlacements:b,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:A=!0,...y}=ot(e,i);if((t=r.arrow)!=null&&t.alignmentOffset)return{};const w=J(a),x=V(l),L=J(l)===l,_=await(c.isRTL==null?void 0:c.isRTL(h.floating)),W=b||(L||!A?[Ct(l)]:Ci(l)),D=g!=="none";!b&&D&&W.push(...Mi(l,A,g,_));const I=[l,...W],M=await c.detectOverflow(i,y),$=[];let R=((s=r.flip)==null?void 0:s.overflows)||[];if(m&&$.push(M[w]),u){const F=Li(a,o,_);$.push(M[F[0]],M[F[1]])}if(R=[...R,{placement:a,overflows:$}],!$.every(F=>F<=0)){var Et,ht;const F=(((Et=r.flip)==null?void 0:Et.index)||0)+1,ws=I[F];if(ws&&(!(u==="alignment"?x!==V(ws):!1)||R.every(H=>V(H.placement)===x?H.overflows[0]>0:!0)))return{data:{index:F,overflows:R},reset:{placement:ws}};let wt=(ht=R.filter(at=>at.overflows[0]<=0).sort((at,H)=>at.overflows[1]-H.overflows[1])[0])==null?void 0:ht.placement;if(!wt)switch(f){case"bestFit":{var yt;const at=(yt=R.filter(H=>{if(D){const Q=V(H.placement);return Q===x||Q==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Q=>Q>0).reduce((Q,Ma)=>Q+Ma,0)]).sort((H,Q)=>H[1]-Q[1])[0])==null?void 0:yt[0];at&&(wt=at);break}case"initialPlacement":wt=l;break}if(a!==wt)return{reset:{placement:wt}}}return{}}}};function Ws(e,i){return{top:e.top-i.height,right:e.right-i.width,bottom:e.bottom-i.height,left:e.left-i.width}}function $s(e){return wi.some(i=>e[i]>=0)}const Pi=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(i){const{rects:t,platform:s}=i,{strategy:a="referenceHidden",...r}=ot(e,i);switch(a){case"referenceHidden":{const o=await s.detectOverflow(i,{...r,elementContext:"reference"}),l=Ws(o,t.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:$s(l)}}}case"escaped":{const o=await s.detectOverflow(i,{...r,altBoundary:!0}),l=Ws(o,t.floating);return{data:{escapedOffsets:l,escaped:$s(l)}}}default:return{}}}}},Wi=new Set(["left","top"]);async function $i(e,i){const{placement:t,platform:s,elements:a}=e,r=await(s.isRTL==null?void 0:s.isRTL(a.floating)),o=J(t),l=bt(t),c=V(t)==="y",h=Wi.has(o)?-1:1,m=r&&c?-1:1,u=ot(i,e);let{mainAxis:b,crossAxis:f,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof g=="number"&&(f=l==="end"?g*-1:g),c?{x:f*m,y:b*h}:{x:b*h,y:f*m}}const Hi=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(i){var t,s;const{x:a,y:r,placement:o,middlewareData:l}=i,c=await $i(i,e);return o===((t=l.offset)==null?void 0:t.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:a+c.x,y:r+c.y,data:{...c,placement:o}}}}},zi=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(i){const{x:t,y:s,placement:a,platform:r}=i,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:x=>{let{x:L,y:_}=x;return{x:L,y:_}}},...h}=ot(e,i),m={x:t,y:s},u=await r.detectOverflow(i,h),b=V(a),f=Ns(b);let g=m[f],A=m[b];const y=(x,L)=>ki(L+u[x==="y"?"top":"left"],L,L-u[x==="y"?"bottom":"right"]);o&&(g=y(f,g)),l&&(A=y(b,A));const w=c.fn({...i,[f]:g,[b]:A});return{...w,data:{x:w.x-t,y:w.y-s,enabled:{[f]:o,[b]:l}}}}}},Ki=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(i){const{placement:t,rects:s,platform:a,elements:r}=i,{apply:o=()=>{},...l}=ot(e,i),c=await a.detectOverflow(i,l),h=J(t),m=bt(t),u=V(t)==="y",{width:b,height:f}=s.floating;let g,A;h==="top"||h==="bottom"?(g=h,A=m===(await(a.isRTL==null?void 0:a.isRTL(r.floating))?"start":"end")?"left":"right"):(A=h,g=m==="end"?"top":"bottom");const y=f-c.top-c.bottom,w=b-c.left-c.right,x=rt(f-c[g],y),L=rt(b-c[A],w),_=i.middlewareData.shift,W=!_;let D=x,I=L;_!=null&&_.enabled.x&&(I=w),_!=null&&_.enabled.y&&(D=y),W&&!m&&(u?I=b-2*Z(c.left,c.right):D=f-2*Z(c.top,c.bottom)),await o({...i,availableWidth:I,availableHeight:D});const M=await a.getDimensions(r.floating);return b!==M.width||f!==M.height?{reset:{rects:!0}}:{}}}};function Tt(){return typeof window<"u"}function lt(e){return Hs(e)?(e.nodeName||"").toLowerCase():"#document"}function P(e){var i;return(e==null||(i=e.ownerDocument)==null?void 0:i.defaultView)||window}function q(e){var i;return(i=(Hs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:i.documentElement}function Hs(e){return Tt()?e instanceof Node||e instanceof P(e).Node:!1}function z(e){return Tt()?e instanceof Element||e instanceof P(e).Element:!1}function G(e){return Tt()?e instanceof HTMLElement||e instanceof P(e).HTMLElement:!1}function zs(e){return!Tt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof P(e).ShadowRoot}function St(e){const{overflow:i,overflowX:t,overflowY:s,display:a}=K(e);return/auto|scroll|overlay|hidden|clip/.test(i+s+t)&&a!=="inline"&&a!=="contents"}function Fi(e){return/^(table|td|th)$/.test(lt(e))}function Mt(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Yi=/transform|translate|scale|rotate|perspective|filter/,Ui=/paint|layout|strict|content/,tt=e=>!!e&&e!=="none";let Kt;function Ft(e){const i=z(e)?K(e):e;return tt(i.transform)||tt(i.translate)||tt(i.scale)||tt(i.rotate)||tt(i.perspective)||!Yt()&&(tt(i.backdropFilter)||tt(i.filter))||Yi.test(i.willChange||"")||Ui.test(i.contain||"")}function Zi(e){let i=et(e);for(;G(i)&&!ft(i);){if(Ft(i))return i;if(Mt(i))return null;i=et(i)}return null}function Yt(){return Kt==null&&(Kt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Kt}function ft(e){return/^(html|body|#document)$/.test(lt(e))}function K(e){return P(e).getComputedStyle(e)}function Dt(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function et(e){if(lt(e)==="html")return e;const i=e.assignedSlot||e.parentNode||zs(e)&&e.host||q(e);return zs(i)?i.host:i}function Ks(e){const i=et(e);return ft(i)?(e.ownerDocument||e).body:G(i)&&St(i)?i:Ks(i)}function gt(e,i,t){var s;i===void 0&&(i=[]),t===void 0&&(t=!0);const a=Ks(e),r=a===((s=e.ownerDocument)==null?void 0:s.body),o=P(a);if(r){const l=Ut(o);return i.concat(o,o.visualViewport||[],St(a)?a:[],l&&t?gt(l):[])}else return i.concat(a,gt(a,[],t))}function Ut(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fs(e){const i=K(e);let t=parseFloat(i.width)||0,s=parseFloat(i.height)||0;const a=G(e),r=a?e.offsetWidth:t,o=a?e.offsetHeight:s,l=kt(t)!==r||kt(s)!==o;return l&&(t=r,s=o),{width:t,height:s,$:l}}function Zt(e){return z(e)?e:e.contextElement}function ct(e){const i=Zt(e);if(!G(i))return X(1);const t=i.getBoundingClientRect(),{width:s,height:a,$:r}=Fs(i);let o=(r?kt(t.width):t.width)/s,l=(r?kt(t.height):t.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Xi=X(0);function Ys(e){const i=P(e);return!Yt()||!i.visualViewport?Xi:{x:i.visualViewport.offsetLeft,y:i.visualViewport.offsetTop}}function Vi(e,i,t){return i===void 0&&(i=!1),!!t&&i&&t===P(e)}function st(e,i,t,s){i===void 0&&(i=!1),t===void 0&&(t=!1);const a=e.getBoundingClientRect(),r=Zt(e);let o=X(1);i&&(s?z(s)&&(o=ct(s)):o=ct(e));const l=Vi(r,t,s)?Ys(r):X(0);let c=(a.left+l.x)/o.x,h=(a.top+l.y)/o.y,m=a.width/o.x,u=a.height/o.y;if(r&&s){const b=P(r),f=z(s)?P(s):s;let g=b,A=Ut(g);for(;A&&f!==g;){const y=ct(A),w=A.getBoundingClientRect(),x=K(A),L=w.left+(A.clientLeft+parseFloat(x.paddingLeft))*y.x,_=w.top+(A.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,h*=y.y,m*=y.x,u*=y.y,c+=L,h+=_,g=P(A),A=Ut(g)}}return _t({width:m,height:u,x:c,y:h})}function Nt(e,i){const t=Dt(e).scrollLeft;return i?i.left+t:st(q(e)).left+t}function Us(e,i){const t=e.getBoundingClientRect(),s=t.left+i.scrollLeft-Nt(e,t),a=t.top+i.scrollTop;return{x:s,y:a}}function qi(e){let{elements:i,rect:t,offsetParent:s,strategy:a}=e;const r=a==="fixed",o=q(s),l=i?Mt(i.floating):!1;if(s===o||l&&r)return t;let c={scrollLeft:0,scrollTop:0},h=X(1);const m=X(0),u=G(s);if((u||!r)&&((lt(s)!=="body"||St(o))&&(c=Dt(s)),u)){const f=st(s);h=ct(s),m.x=f.x+s.clientLeft,m.y=f.y+s.clientTop}const b=o&&!u&&!r?Us(o,c):X(0);return{width:t.width*h.x,height:t.height*h.y,x:t.x*h.x-c.scrollLeft*h.x+m.x+b.x,y:t.y*h.y-c.scrollTop*h.y+m.y+b.y}}function ji(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Gi(e){const i=Dt(e),t=e.ownerDocument.body,s=Z(e.scrollWidth,e.clientWidth,t.scrollWidth,t.clientWidth),a=Z(e.scrollHeight,e.clientHeight,t.scrollHeight,t.clientHeight);let r=-i.scrollLeft+Nt(e);const o=-i.scrollTop;return K(t).direction==="rtl"&&(r+=Z(e.clientWidth,t.clientWidth)-s),{width:s,height:a,x:r,y:o}}const Qi=25;function Ji(e,i,t){t===void 0&&(t="viewport");const s=t==="layoutViewport",a=P(e),r=q(e),o=a.visualViewport;let l=r.clientWidth,c=r.clientHeight,h=0,m=0;if(o){const b=!Yt()||i==="fixed";s?b||(h=-o.offsetLeft,m=-o.offsetTop):(l=o.width,c=o.height,b&&(h=o.offsetLeft,m=o.offsetTop))}if(Nt(r)<=0){const b=r.ownerDocument,f=b.body,g=getComputedStyle(f),A=b.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,y=Math.abs(r.clientWidth-f.clientWidth-A),w=getComputedStyle(r).scrollbarGutter==="stable both-edges"?y/2:y;w<=Qi&&(l-=w)}return{width:l,height:c,x:h,y:m}}function ta(e,i){const t=st(e,!0,i==="fixed"),s=t.top+e.clientTop,a=t.left+e.clientLeft,r=ct(e),o=e.clientWidth*r.x,l=e.clientHeight*r.y,c=a*r.x,h=s*r.y;return{width:o,height:l,x:c,y:h}}function Zs(e,i,t){let s;if(i==="viewport"||i==="layoutViewport")s=Ji(e,t,i);else if(i==="document")s=Gi(q(e));else if(z(i))s=ta(i,t);else{const a=Ys(e);s={x:i.x-a.x,y:i.y-a.y,width:i.width,height:i.height}}return _t(s)}function ea(e,i){const t=i.get(e);if(t)return t;let s=gt(e,[],!1).filter(l=>z(l)&&lt(l)!=="body"),a=null;const r=K(e).position==="fixed";let o=r?et(e):e;for(;z(o)&&!ft(o);){const l=K(o),c=Ft(o),h=a?a.position:r?"fixed":"";!c&&(h==="fixed"||h==="absolute"&&l.position==="static")?s=s.filter(u=>u!==o):a=l,o=et(o)}return i.set(e,s),s}function sa(e){let{element:i,boundary:t,rootBoundary:s,strategy:a}=e;const o=[...t==="clippingAncestors"?Mt(i)?[]:ea(i,this._c):[].concat(t),s],l=Zs(i,o[0],a);let c=l.top,h=l.right,m=l.bottom,u=l.left;for(let b=1;b<o.length;b++){const f=Zs(i,o[b],a);c=Z(f.top,c),h=rt(f.right,h),m=rt(f.bottom,m),u=Z(f.left,u)}return{width:h-u,height:m-c,x:u,y:c}}function ia(e){const{width:i,height:t}=Fs(e);return{width:i,height:t}}function aa(e,i,t){const s=G(i),a=q(i),r=t==="fixed",o=st(e,!0,r,i);let l={scrollLeft:0,scrollTop:0};const c=X(0);if((s||!r)&&((lt(i)!=="body"||St(a))&&(l=Dt(i)),s)){const b=st(i,!0,r,i);c.x=b.x+i.clientLeft,c.y=b.y+i.clientTop}!s&&a&&(c.x=Nt(a));const h=a&&!s&&!r?Us(a,l):X(0),m=o.left+l.scrollLeft-c.x-h.x,u=o.top+l.scrollTop-c.y-h.y;return{x:m,y:u,width:o.width,height:o.height}}function Xt(e){return K(e).position==="static"}function Xs(e,i){if(!G(e)||K(e).position==="fixed")return null;if(i)return i(e);let t=e.offsetParent;return q(e)===t&&(t=t.ownerDocument.body),t}function Vs(e,i){const t=P(e);if(Mt(e))return t;if(!G(e)){let a=et(e);for(;a&&!ft(a);){if(z(a)&&!Xt(a))return a;a=et(a)}return t}let s=Xs(e,i);for(;s&&Fi(s)&&Xt(s);)s=Xs(s,i);return s&&ft(s)&&Xt(s)&&!Ft(s)?t:s||Zi(e)||t}const na=async function(e){const i=this.getOffsetParent||Vs,t=this.getDimensions,s=await t(e.floating);return{reference:aa(e.reference,await i(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function ra(e){return K(e).direction==="rtl"}const oa={convertOffsetParentRelativeRectToViewportRelativeRect:qi,getDocumentElement:q,getClippingRect:sa,getOffsetParent:Vs,getElementRects:na,getClientRects:ji,getDimensions:ia,getScale:ct,isElement:z,isRTL:ra};function qs(e,i){return e.x===i.x&&e.y===i.y&&e.width===i.width&&e.height===i.height}function la(e,i,t){let s=null,a;const r=q(e);function o(){var m;clearTimeout(a),(m=s)==null||m.disconnect(),s=null}function l(m,u){m===void 0&&(m=!1),u===void 0&&(u=1),o();const b=e.getBoundingClientRect(),{left:f,top:g,width:A,height:y}=b;if(m||i(),!A||!y)return;const w=Lt(g),x=Lt(r.clientWidth-(f+A)),L=Lt(r.clientHeight-(g+y)),_=Lt(f),D={rootMargin:-w+"px "+-x+"px "+-L+"px "+-_+"px",threshold:Z(0,rt(1,u))||1};let I=!0;function M($){const R=$[0].intersectionRatio;if(!qs(b,e.getBoundingClientRect()))return l();if(R!==u){if(!I)return l();R?l(!1,R):a=setTimeout(()=>{l(!1,1e-7)},1e3)}I=!1}try{s=new IntersectionObserver(M,{...D,root:r.ownerDocument})}catch{s=new IntersectionObserver(M,D)}s.observe(e)}const c=P(e),h=()=>l(t);return c.addEventListener("resize",h),l(!0),()=>{c.removeEventListener("resize",h),o()}}function ca(e,i,t,s){s===void 0&&(s={});const{ancestorScroll:a=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,h=Zt(e),m=a||r?[...h?gt(h):[],...i?gt(i):[]]:[];m.forEach(w=>{a&&w.addEventListener("scroll",t),r&&w.addEventListener("resize",t)});const u=h&&l?la(h,t,r):null;let b=-1,f=null;o&&(f=new ResizeObserver(w=>{let[x]=w;x&&x.target===h&&f&&i&&(f.unobserve(i),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var L;(L=f)==null||L.observe(i)})),t()}),h&&!c&&f.observe(h),i&&f.observe(i));let g,A=c?st(e):null;c&&y();function y(){const w=st(e);A&&!qs(A,w)&&t(),A=w,g=requestAnimationFrame(y)}return t(),()=>{var w;m.forEach(x=>{a&&x.removeEventListener("scroll",t),r&&x.removeEventListener("resize",t)}),u?.(),(w=f)==null||w.disconnect(),f=null,c&&cancelAnimationFrame(g)}}const da=Hi,ha=zi,ua=Ii,ma=Ki,pa=Pi,ba=(e,i,t)=>{const s=new Map,a=t??{},r={...oa,...a.platform,_c:s};return Oi(e,i,{...a,platform:r})};function Vt(e){return e.split("-")[0]}function fa(e,i){return!i||i==="center"?e:i==="start"||i==="top"||i==="left"?`${e}-start`:`${e}-end`}async function it(e,i,t={}){const{placement:s="bottom",strategy:a="fixed",spacing:r=8,alignmentSpacing:o,autoFlip:l=!0,autoShift:c=!0,viewportPadding:h=8,shiftPadding:m=h,maxHeight:u,matchReferenceWidth:b=!1}=t;let f,g;const A=[da(o!=null?{mainAxis:r,alignmentAxis:o}:r)];l&&A.push(ua({padding:h})),c&&A.push(ha({padding:m})),(u!=null||b)&&A.push(ma({padding:h,apply({availableHeight:w,rects:x,elements:L}){u!=null&&(f=Math.min(u,w)),b&&(g=x.reference.width,L.floating.style.minWidth=`${x.reference.width}px`,L.floating.style.width=`${x.reference.width}px`)}})),A.push(pa());const y=await ba(e,i,{placement:s,strategy:a,middleware:A});return{x:y.x,y:y.y,placement:y.placement,strategy:y.strategy,referenceHidden:!!y.middlewareData.hide?.referenceHidden,availableHeight:f,referenceWidth:g,shift:y.middlewareData.shift?{x:y.middlewareData.shift.x,y:y.middlewareData.shift.y}:void 0}}function vt(){const e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}}function js(e,i){return new Date(e,i,0).getDate()}function Gs(e,i){return new Date(e,i-1,1).getDay()}function dt(e,i){return e.year!==i.year?e.year-i.year:e.month!==i.month?e.month-i.month:e.day-i.day}function Bt(e,i){return!e||!i?!1:e.year===i.year&&e.month===i.month&&e.day===i.day}function At(e,i,t){const s=e*12+(i-1)+t,a=Math.floor(s/12),r=(s%12+12)%12+1;return{year:a,month:r}}function qt(e,i,t="en-US"){return new Intl.DateTimeFormat(t,{month:"long",year:"numeric"}).format(new Date(e,i-1,1))}function Rt(e,i="day"){const t=String(e.month).padStart(2,"0"),s=String(e.day).padStart(2,"0"),a=`${e.year}-${t}-${s}`;if(i==="minute"){const r=String(e.hour??0).padStart(2,"0"),o=String(e.minute??0).padStart(2,"0");return`${a} ${r}:${o}`}return a}function jt(e,i,t){return!!(i&&dt(e,i)<0||t&&dt(e,t)>0)}function Gt(e,i){const t=Gs(e,i),s=js(e,i),a=[];for(let r=0;r<t;r++)a.push(null);for(let r=1;r<=s;r++)a.push({year:e,month:i,day:r});for(;a.length%7!==0;)a.push(null);return a}const Qt=["Su","Mo","Tu","We","Th","Fr","Sa"];function Qs(...e){const i=[];for(const t of e)if(!(!t||t===!0))if(typeof t=="string"||typeof t=="number"||typeof t=="bigint")i.push(String(t));else if(Array.isArray(t)){const s=Qs(...t);s&&i.push(s)}else for(const[s,a]of Object.entries(t))a&&i.push(s);return i.join(" ")}function Js(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/_/g,"-").toLowerCase()}const ga="http://www.w3.org/2000/svg";function n(e,i,t){const s=document.createElement(e);if(i)for(const[a,r]of Object.entries(i))r==null||r===!1||(r===!0?s.setAttribute(a,""):s.setAttribute(a,String(r)));if(t)for(const a of t)a==null||a===!1||s.append(typeof a=="string"||typeof a=="number"?document.createTextNode(String(a)):a);return s}function S(e,i,t){const s=document.createElementNS(ga,e);if(i)for(const[a,r]of Object.entries(i))r!=null&&s.setAttribute(a,String(r));if(t)for(const a of t)a&&s.append(a);return s}function T(e,i=16,t="0 0 24 24",s){return S("svg",{width:i,height:i,viewBox:t,fill:"none","aria-hidden":"true",class:s},e.map(a=>S("path",{d:a,fill:"currentColor"})))}const C={check:["M18.7 7.2a1 1 0 0 1 0 1.4l-8 8a1 1 0 0 1-1.4 0l-4-4a1 1 0 1 1 1.4-1.4L10 14.58l7.3-7.3a1 1 0 0 1 1.4 0Z"],x:["M17.3 18.7a1 1 0 0 0 1.4-1.4L13.42 12l5.3-5.3a1 1 0 0 0-1.42-1.4L12 10.58l-5.3-5.3a1 1 0 0 0-1.4 1.42L10.58 12l-5.3 5.3a1 1 0 1 0 1.42 1.4L12 13.42l5.3 5.3Z"],chevronDown:["M5.3 9.3a1 1 0 0 1 1.4 0l5.3 5.29 5.3-5.3a1 1 0 1 1 1.4 1.42l-6 6a1 1 0 0 1-1.4 0l-6-6a1 1 0 0 1 0-1.42Z"],chevronLeft:["M14.7 5.3a1 1 0 0 1 0 1.4L9.42 12l5.3 5.3a1 1 0 0 1-1.42 1.4l-6-6a1 1 0 0 1 0-1.4l6-6a1 1 0 0 1 1.42 0Z"],chevronRight:["M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z"],search:["M15.62 17.03a9 9 0 1 1 1.41-1.41l4.68 4.67a1 1 0 0 1-1.42 1.42l-4.67-4.68ZM17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"],plus:["M13 5a1 1 0 1 0-2 0v6H5a1 1 0 1 0 0 2h6v6a1 1 0 1 0 2 0v-6h6a1 1 0 1 0 0-2h-6V5Z"],minus:["M5 11a1 1 0 1 0 0 2h14a1 1 0 1 0 0-2H5Z"],info:["M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 4.75a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5ZM11 11a1 1 0 0 1 2 0v6a1 1 0 1 1-2 0v-6Z"],warning:["M10.27 3.87a2 2 0 0 1 3.46 0l8.04 13.86A2 2 0 0 1 20.04 21H3.96a2 2 0 0 1-1.73-3.27L10.27 3.87ZM12 8a1 1 0 0 0-1 1v4a1 1 0 1 0 2 0V9a1 1 0 0 0-1-1Zm0 8.25a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Z"],critical:["M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1 5a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0V7Zm1 9a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Z"],success:["M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm4.7 8.7-5 5a1 1 0 0 1-1.4 0l-2.5-2.5a1 1 0 1 1 1.4-1.4l1.8 1.8 4.3-4.3a1 1 0 1 1 1.4 1.4Z"],hash:["M10.99 3.16a1 1 0 1 0-1.98-.32L8.16 8H4a1 1 0 1 0 0 2h3.84l-.67 4H3a1 1 0 1 0 0 2h3.84l-.83 4.84a1 1 0 1 0 1.98.32L8.84 16h4.99l-.82 4.84a1 1 0 1 0 1.98.32L15.84 16H20a1 1 0 1 0 0-2h-3.84l.67-4H21a1 1 0 1 0 0-2h-3.84l.83-4.84a1 1 0 1 0-1.98-.32L15.16 8h-4.99l.82-4.84ZM14.84 10l-.67 4H9.16l.67-4h5.01Z"],voice:["M12 3a1 1 0 0 0-1-1h-.06a1 1 0 0 0-.74.32L5.92 7H3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h2.92l4.28 4.68a1 1 0 0 0 .74.32H11a1 1 0 0 0 1-1V3ZM15.1 20.75c-.58.14-1.1-.33-1.1-.92v-.03c0-.5.37-.92.85-1.05a7 7 0 0 0 0-13.5A1.11 1.11 0 0 1 14 4.2v-.03c0-.6.52-1.06 1.1-.92a9 9 0 0 1 0 17.5Z"],mic:["M12 2a4 4 0 0 0-4 4v5a4 4 0 0 0 8 0V6a4 4 0 0 0-4-4ZM6 11a1 1 0 1 0-2 0 8 8 0 0 0 7 7.93V21H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2h-3v-2.07A8 8 0 0 0 20 11a1 1 0 1 0-2 0 6 6 0 0 1-12 0Z"],micOff:["M12 2a4 4 0 0 0-4 4v3.17l7.59 7.59A4 4 0 0 0 16 11V6a4 4 0 0 0-4-4ZM3.7 2.3a1 1 0 0 0-1.4 1.4l18 18a1 1 0 0 0 1.4-1.4l-3.04-3.04A7.96 7.96 0 0 0 20 11a1 1 0 1 0-2 0c0 1.77-.77 3.37-2 4.47l-1.44-1.44A5.96 5.96 0 0 1 6 11a1 1 0 1 0-2 0 8 8 0 0 0 7 7.93V21H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2h-3v-2.07c.9-.11 1.75-.38 2.52-.78l1.62 1.62 1.41-1.41L3.7 2.3Z"],headphones:["M12 3a9 9 0 0 0-9 9v7a3 3 0 0 0 3 3h1a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2H5v-2a7 7 0 0 1 14 0v2h-2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h1a3 3 0 0 0 3-3v-7a9 9 0 0 0-9-9Z"],settings:["M10.56 1.1c-.46.05-.7.53-.64.98.18 1.16-.19 2.2-.98 2.53-.8.33-1.79-.15-2.49-1.1-.27-.36-.78-.52-1.14-.24-.77.59-1.45 1.27-2.04 2.04-.28.36-.12.87.24 1.14.96.7 1.43 1.7 1.1 2.49-.33.8-1.37 1.16-2.53.98-.45-.07-.93.18-.99.64a11.1 11.1 0 0 0 0 2.88c.06.46.54.7.99.64 1.16-.18 2.2.19 2.53.98.33.8-.14 1.79-1.1 2.49-.36.27-.52.78-.24 1.14.59.77 1.27 1.45 2.04 2.04.36.28.87.12 1.14-.24.7-.95 1.7-1.43 2.49-1.1.8.33 1.16 1.37.98 2.53-.07.45.18.93.64.99a11.1 11.1 0 0 0 2.88 0c.46-.06.7-.54.64-.99-.18-1.16.19-2.2.98-2.53.8-.33 1.79.14 2.49 1.1.27.36.78.52 1.14.24.77-.59 1.45-1.27 2.04-2.04.28-.36.12-.87-.24-1.14-.96-.7-1.43-1.7-1.1-2.49.33-.8 1.37-1.16 2.53-.98.45.07.93-.18.99-.64a11.1 11.1 0 0 0 0-2.88c-.06-.46-.54-.7-.99-.64-1.16.18-2.2-.19-2.53-.98-.33-.8.14-1.79 1.1-2.49.36-.27.52-.78.24-1.14a11.07 11.07 0 0 0-2.04-2.04c-.36-.28-.87-.11-1.14.24-.7.96-1.7 1.43-2.49 1.1-.8-.33-1.16-1.37-.98-2.53.07-.45-.18-.93-.64-.99a11.1 11.1 0 0 0-2.88 0ZM16 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"],send:["M2.01 21 23 12 2.01 3 2 10l15 2-15 2 .01 7Z"],calendar:["M7 2a1 1 0 0 1 1 1v1h8V3a1 1 0 1 1 2 0v1h1a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h1V3a1 1 0 0 1 1-1Zm12 8H5v9a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-9Z"],folder:["M2 6a3 3 0 0 1 3-3h4.17a3 3 0 0 1 2.12.88l1.12 1.12H19a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6Z"],reactionPlus:["M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8Zm-3.5-8.5A1.5 1.5 0 1 0 7 10a1.5 1.5 0 0 0 1.5 1.5Zm7 0A1.5 1.5 0 1 0 14 10a1.5 1.5 0 0 0 1.5 1.5ZM12 17.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5Z"]};function N(e,i,t){const s=e.getAttribute(i);if(!s)return t;try{return JSON.parse(s)}catch{return t}}function k(e,i,t,s="true"){t?e.setAttribute(i,s):e.removeAttribute(i)}function v(e,i,t){return e.dispatchEvent(new CustomEvent(i,{detail:t,bubbles:!0,composed:!0,cancelable:!0}))}function O(e){return e.key==="Enter"||e.key===" "}let va=0;function Aa(e="mana"){return`${e}-${++va}`}const Ea=typeof HTMLElement<"u"?HTMLElement:class{};class E extends Ea{constructor(){super(...arguments);d(this,"mounted",!1)}connectedCallback(){this.mounted=!0,this.onConnect(),this.render()}disconnectedCallback(){this.mounted=!1,this.onDisconnect()}attributeChangedCallback(){this.mounted&&this.render()}onConnect(){}onDisconnect(){}}const ya={new:"New",beta:"Beta",early_access:"Early Access",free_trial:"Free Trial"};class Jt extends E{render(){const i=this.getAttribute("theme")??"dark",t=this.getAttribute("density")??"default",s=this.hasAttribute("high-contrast")&&this.getAttribute("high-contrast")!=="false",a=this.hasAttribute("reduced-motion")&&this.getAttribute("reduced-motion")!=="false",r=this.getAttribute("saturation"),o=this.hasAttribute("underline-links")&&this.getAttribute("underline-links")!=="false";xs(this,{theme:i,density:t,highContrast:s,reducedMotion:a}),r!=null?this.style.setProperty("--saturation-factor",r):this.style.removeProperty("--saturation-factor"),k(this,"data-discord-underline-links",o)}}d(Jt,"observedAttributes",["theme","density","high-contrast","reduced-motion","saturation","underline-links"]);class te extends E{render(){const i=this.getAttribute("variant")??"body-md/normal",t=this.getAttribute("color"),s=this.getAttribute("line-clamp");this.setAttribute("data-text-variant",i),this.className=[`mana-text-${ut(i)}`,t?"":"mana-text-default-color",this.hasAttribute("selectable")?"mana-text-selectable":"",this.hasAttribute("tabular-numbers")?"mana-text-tabular":"",this.hasAttribute("scale-font-to-user-setting")?"mana-font-scaling":"",s==="1"?"mana-text-clamp-1":s?"mana-text-clamp-multi":""].filter(Boolean).join(" "),s&&s!=="1"?this.style.webkitLineClamp=s:this.style.removeProperty("-webkit-line-clamp"),t&&t!=="none"?this.style.color=It(t):this.style.removeProperty("color")}}d(te,"observedAttributes",["variant","selectable","line-clamp","color","tabular-numbers","scale-font-to-user-setting"]);class ee extends E{render(){const i=this.getAttribute("variant")??"heading-md/semibold",t=Number(this.getAttribute("level")??"2"),s=this.getAttribute("color");this.setAttribute("role","heading"),this.setAttribute("aria-level",String(Math.min(Math.max(1,t),6))),t>6?this.setAttribute("data-excessive-heading-level",String(t)):this.removeAttribute("data-excessive-heading-level"),this.setAttribute("data-text-variant",i),this.className=`mana-text-${ut(i)}${s?"":" mana-heading-default-color"}`,s&&s!=="none"?this.style.color=It(s):this.style.removeProperty("color")}}d(ee,"observedAttributes",["variant","level","color"]);class se extends E{render(){const i=this.getAttribute("type")??"new",t=this.getAttribute("variant")??"secondary",s=this.getAttribute("custom-text")??ya[i]??i;this.setAttribute("data-variant",t),this.setAttribute("data-text-variant","body-xs/semibold"),this.className=`mana-text-body-xs-semibold mana-badge mana-badge--${t}`,(this.hasAttribute("custom-text")||!this.textContent?.trim())&&(this.textContent=s)}}d(se,"observedAttributes",["type","variant","custom-text"]);class ie extends E{render(){const i=this.getAttribute("variant")??"grayLight",t=this.getAttribute("text");this.setAttribute("data-variant",i),this.setAttribute("data-text-variant","body-xs/semibold"),this.className=`mana-text-body-xs-semibold mana-chip mana-chip--${Js(i)}`,t!=null&&(this.textContent=t)}}d(ie,"observedAttributes",["text","variant"]);class ae extends E{render(){const i=this.getAttribute("variant")??"primary",t=this.getAttribute("size")??"md",s=this.getAttribute("cutout"),a=this.getAttribute("aria-label");this.className=["mana-indicator-dot",`mana-indicator-dot--${i}`,`mana-indicator-dot--${t}`,s?`mana-indicator-dot--cutout-${s}`:""].filter(Boolean).join(" "),a?(this.setAttribute("role","img"),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.setAttribute("aria-hidden","true"))}}d(ae,"observedAttributes",["variant","size","cutout","aria-label"]);class ne extends E{render(){this.classList.add("mana-stack"),this.setAttribute("data-direction",this.getAttribute("direction")??"vertical"),this.setAttribute("data-align",this.getAttribute("align")??"stretch"),this.setAttribute("data-justify",this.getAttribute("justify")??"start"),this.setAttribute("data-wrap",this.getAttribute("wrap")??"false"),this.setAttribute("data-full-width",this.getAttribute("full-width")??"true"),this.style.gap=`var(--space-${this.getAttribute("gap")??"8"})`,this.style.padding=`var(--space-${this.getAttribute("padding")??"0"})`}}d(ne,"observedAttributes",["gap","direction","align","justify","wrap","padding","full-width"]);class re extends E{render(){const i=this.getAttribute("variant")??"purple",t=this.getAttribute("offset-bottom");this.className=`mana-gradient mana-gradient--${i}`,t?this.style.setProperty("--custom-gradient-offset-bottom",t):this.style.removeProperty("--custom-gradient-offset-bottom")}}d(re,"observedAttributes",["variant","offset-bottom"]);class oe extends E{render(){const i=this.getAttribute("src")??"",t=this.getAttribute("alt")??"",s=this.getAttribute("aspect-ratio")??"16-9",a=this.getAttribute("type")??"image";this.className=`mana-graphic mana-graphic--${s}`,this.replaceChildren(),i&&(a==="video"?this.append(n("video",{class:"mana-graphic-video",src:i,autoplay:!0,loop:!0,muted:!0,playsinline:!0})):this.append(n("img",{class:"mana-graphic-image",src:i,alt:t})))}}d(oe,"observedAttributes",["src","alt","aspect-ratio","type"]);class le extends E{constructor(){super(...arguments);d(this,"controlWrap",null);d(this,"labelWrap",null);d(this,"auxWrap",null)}onConnect(){if(!this.controlWrap){const t=Array.from(this.childNodes);this.labelWrap=n("div",{class:"mana-field-label-container"}),this.controlWrap=n("div",{class:"mana-field-control"});for(const s of t)this.controlWrap.append(s);this.auxWrap=n("div",{class:"mana-field-auxiliary"}),this.append(this.labelWrap,this.controlWrap,this.auxWrap)}}render(){const t=this.getAttribute("label"),s=this.getAttribute("description"),a=this.getAttribute("error-message"),r=this.getAttribute("helper-text"),o=this.hasAttribute("required"),l=this.hasAttribute("disabled"),c=this.getAttribute("layout")??"vertical";if(this.classList.add("mana-field-container"),this.setAttribute("data-layout",c),k(this,"data-disabled",l),this.labelWrap){if(this.labelWrap.replaceChildren(),t){const h=n("label",{class:"mana-field-label mana-text-body-sm-semibold mana-heading-default-color"},[t]);o&&h.append(n("span",{style:"color:var(--text-feedback-critical)","aria-hidden":"true"},["*"])),this.labelWrap.append(h)}s&&this.labelWrap.append(n("span",{class:"mana-text-body-xs-normal",style:"color:var(--text-subtle)"},[s])),this.labelWrap.hidden=!t&&!s}this.auxWrap&&(this.auxWrap.replaceChildren(),a?this.auxWrap.append(n("span",{class:"mana-field-status mana-field-status--error mana-text-body-xs-medium",role:"alert"},[a])):r&&this.auxWrap.append(n("span",{class:"mana-field-status mana-field-status--helper mana-text-body-xs-normal"},[r])),this.auxWrap.hidden=!a&&!r)}}d(le,"observedAttributes",["label","description","error-message","helper-text","required","disabled","layout"]);class ce extends E{constructor(){super(...arguments);d(this,"legendEl",null);d(this,"descEl",null);d(this,"bodyEl",null)}onConnect(){if(!this.bodyEl){const t=Array.from(this.childNodes);this.legendEl=n("div",{class:"mana-fieldset-legend mana-text-heading-sm-semibold mana-heading-default-color"}),this.descEl=n("div",{class:"mana-fieldset-description mana-text-body-sm-normal",style:"color:var(--text-subtle)"}),this.bodyEl=n("div",{class:"mana-stack","data-direction":"vertical"}),this.bodyEl.style.gap="var(--space-12)";for(const s of t)this.bodyEl.append(s);this.append(this.legendEl,this.descEl,this.bodyEl)}}render(){const t=this.getAttribute("label"),s=this.getAttribute("description"),a=this.hasAttribute("disabled");this.classList.add("mana-fieldset"),this.setAttribute("role","group"),t&&this.setAttribute("aria-label",t),k(this,"data-disabled",a),this.legendEl&&(this.legendEl.textContent=t??"",this.legendEl.hidden=!t),this.descEl&&(this.descEl.textContent=s??"",this.descEl.hidden=!s)}}d(ce,"observedAttributes",["label","description","disabled"]);class de extends E{render(){this.className=this.hasAttribute("show-on-focus")?"mana-hidden-visually--show-on-focus":"mana-hidden-visually"}}d(de,"observedAttributes",["show-on-focus"]);const wa={xs:"body-xs/medium",sm:"body-sm/medium",md:"body-md/medium"};class he extends E{constructor(){super(...arguments);d(this,"wrapperEl",null);d(this,"childrenEl",null);d(this,"labelSpan",null);d(this,"spinnerWrap",null);d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||this.hasAttribute("loading")||O(t)&&(t.preventDefault(),this.click())})}onConnect(){if(this.addEventListener("keydown",this.onKeyDown),!this.wrapperEl){const t=Array.from(this.childNodes);this.childrenEl=n("span",{class:"mana-button-children"});for(const s of t)this.childrenEl.append(s);this.wrapperEl=n("span",{class:"mana-button-children-wrapper"},[this.childrenEl]),this.append(this.wrapperEl)}}onDisconnect(){this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.getAttribute("variant")??"primary",s=this.getAttribute("size")??"md",a=this.hasAttribute("disabled"),r=this.hasAttribute("loading"),o=this.hasAttribute("full-width"),l=this.hasAttribute("rounded"),c=this.getAttribute("min-width"),h=this.getAttribute("text");if(h!=null&&this.childrenEl){this.labelSpan||(this.labelSpan=n("span"),this.childrenEl.replaceChildren(this.labelSpan));const u=wa[s]??"body-md/medium";this.labelSpan.className=`mana-text-${ut(u)}`,this.labelSpan.setAttribute("data-text-variant",u),this.labelSpan.textContent=h}const m=t!=="icon-only"&&t!=="input-accessory"&&!!(h??this.childrenEl?.textContent?.trim());if(this.setAttribute("data-mana-component","button"),this.setAttribute("data-variant",t),this.setAttribute("data-size",s),k(this,"data-has-text",m),k(this,"data-full-width",o),k(this,"data-rounded",l),this.setAttribute("role","button"),this.setAttribute("tabindex",a||r?"-1":"0"),k(this,"aria-disabled",a||r),k(this,"aria-busy",r),c?this.style.setProperty("--__button-min-width",/^\d+$/.test(c)?`${c}px`:c):this.style.removeProperty("--__button-min-width"),this.wrapperEl)if(r&&!this.spinnerWrap){const u=n("span",{class:"mana-spinner-inner"},[n("span",{class:"mana-spinner-item"}),n("span",{class:"mana-spinner-item"}),n("span",{class:"mana-spinner-item"})]),b=n("span",{class:"mana-spinner","data-type":"pulsingEllipsis","aria-hidden":"true"},[u]);this.spinnerWrap=n("span",{class:"mana-button-spinner-wrapper"},[b]),this.wrapperEl.append(this.spinnerWrap)}else!r&&this.spinnerWrap&&(this.spinnerWrap.remove(),this.spinnerWrap=null)}}d(he,"observedAttributes",["variant","size","disabled","loading","full-width","rounded","min-width","text"]);class ue extends E{render(){const i=this.getAttribute("direction")??"horizontal",t=this.hasAttribute("full-width");this.setAttribute("data-mana-component","button-group"),this.classList.add("mana-stack","mana-button-group"),this.setAttribute("data-direction",i),this.setAttribute("data-align",this.getAttribute("align")??"center"),this.setAttribute("data-justify",this.getAttribute("justify")??"start"),this.setAttribute("data-wrap",this.getAttribute("wrap")??(t?"false":"true")),k(this,"data-full-width",t),this.style.gap=`var(--space-${this.getAttribute("gap")??"8"})`}}d(ue,"observedAttributes",["direction","full-width","gap","align","justify","wrap"]);class me extends E{constructor(){super(...arguments);d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.click())})}onConnect(){this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.getAttribute("variant")??"primary",s=this.getAttribute("text-variant")??"body-md/medium",a=this.hasAttribute("disabled"),r=this.getAttribute("text");this.setAttribute("data-mana-component","text-button"),this.setAttribute("data-variant",t),this.setAttribute("data-text-variant",s),this.className=`mana-text-${ut(s)}`,this.setAttribute("role","button"),this.setAttribute("tabindex",a?"-1":"0"),k(this,"aria-disabled",a),r!=null&&(this.textContent=r)}}d(me,"observedAttributes",["variant","text-variant","disabled","text"]);class pe extends E{constructor(){super(...arguments);d(this,"wrapperEl",null);d(this,"childrenEl",null);d(this,"handleToggle",()=>{this.hasAttribute("disabled")||(this.hasAttribute("pressed")?this.removeAttribute("pressed"):this.setAttribute("pressed",""),v(this,"change",{pressed:this.hasAttribute("pressed")}))});d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.handleToggle())})}onConnect(){if(this.addEventListener("click",this.handleToggle),this.addEventListener("keydown",this.onKeyDown),!this.wrapperEl){const t=Array.from(this.childNodes);this.childrenEl=n("span",{class:"mana-button-children"});for(const s of t)this.childrenEl.append(s);this.wrapperEl=n("span",{class:"mana-button-children-wrapper"},[this.childrenEl]),this.append(this.wrapperEl)}}onDisconnect(){this.removeEventListener("click",this.handleToggle),this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.hasAttribute("pressed"),s=this.getAttribute("size")??"md",a=this.hasAttribute("disabled"),r=this.getAttribute("text");r!=null&&this.childrenEl&&(this.childrenEl.textContent=r),this.setAttribute("data-mana-component","toggle-button"),this.setAttribute("data-size",s),this.setAttribute("role","button"),this.setAttribute("aria-pressed",String(t)),this.setAttribute("tabindex",a?"-1":"0"),k(this,"aria-disabled",a)}}d(pe,"observedAttributes",["pressed","size","disabled","text"]);class be extends E{constructor(){super(...arguments);d(this,"handleToggle",()=>{this.hasAttribute("disabled")||(this.hasAttribute("pressed")?this.removeAttribute("pressed"):this.setAttribute("pressed",""),v(this,"change",{pressed:this.hasAttribute("pressed")}))});d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.handleToggle())})}onConnect(){this.addEventListener("click",this.handleToggle),this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("click",this.handleToggle),this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.hasAttribute("pressed"),s=this.getAttribute("variant")??"secondary",a=this.getAttribute("size")??"md",r=this.hasAttribute("disabled");this.setAttribute("data-mana-component","toggle-icon-button"),this.setAttribute("data-variant",s),this.setAttribute("data-size",a),this.setAttribute("role","button"),this.setAttribute("aria-pressed",String(t)),this.setAttribute("tabindex",r?"-1":"0"),k(this,"aria-disabled",r)}}d(be,"observedAttributes",["pressed","variant","size","disabled"]);class fe extends E{constructor(){super(...arguments);d(this,"wrapperEl",null);d(this,"childrenEl",null);d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.click())})}onConnect(){if(this.addEventListener("keydown",this.onKeyDown),!this.wrapperEl){const t=Array.from(this.childNodes);this.childrenEl=n("span",{class:"mana-button-children"});for(const s of t)this.childrenEl.append(s);this.wrapperEl=n("span",{class:"mana-button-children-wrapper"},[this.childrenEl]),this.append(this.wrapperEl)}}onDisconnect(){this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.getAttribute("variant")??"icon-only",s=this.getAttribute("size")??"sm",a=this.hasAttribute("disabled");this.setAttribute("data-mana-component","button"),this.setAttribute("data-variant",t),this.setAttribute("data-size",s),this.setAttribute("role","button"),this.setAttribute("tabindex",a?"-1":"0"),k(this,"aria-disabled",a)}}d(fe,"observedAttributes",["variant","size","disabled"]);class ge extends E{constructor(){super(...arguments);d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.click())})}onConnect(){this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.getAttribute("size")??"sm",s=this.hasAttribute("disabled");if(this.setAttribute("data-mana-component","button"),this.setAttribute("data-variant","icon-only"),this.setAttribute("data-size",t),this.setAttribute("role","button"),this.setAttribute("tabindex",s?"-1":"0"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Close"),k(this,"aria-disabled",s),!this.querySelector(".mana-button-children-wrapper")){const a=t==="xs"?14:t==="md"?20:16;this.replaceChildren(n("span",{class:"mana-button-children-wrapper"},[n("span",{class:"mana-button-children"},[T([...C.x],a)])]))}}}d(ge,"observedAttributes",["size","disabled","aria-label"]);class ve extends E{render(){this.setAttribute("data-mana-component","toolbar"),this.setAttribute("role","toolbar")}}d(ve,"observedAttributes",["aria-label"]);class Ae extends E{render(){this.setAttribute("data-mana-component","toolbar-group"),this.setAttribute("role","group")}}d(Ae,"observedAttributes",[]);class Ee extends E{render(){this.setAttribute("data-mana-component","toolbar-separator"),this.setAttribute("role","separator"),this.setAttribute("aria-orientation","vertical")}}d(Ee,"observedAttributes",[]);const xa="M7.89561 14.8538L6.30462 13.2629L14.3099 5.25755L15.9009 6.84854L7.89561 14.8538Z",ka="M4.08643 11.0903L5.67742 9.49929L9.4485 13.2704L7.85751 14.8614L4.08643 11.0903Z",La="M5.13231 6.72963L6.7233 5.13864L14.855 13.2704L13.264 14.8614L5.13231 6.72963Z",Ca="M13.2704 5.13864L14.8614 6.72963L6.72963 14.8614L5.13864 13.2704L13.2704 5.13864Z";class ye extends E{constructor(){super(...arguments);d(this,"anim",null);d(this,"boxEl",null);d(this,"labelWrap",null);d(this,"handleToggle",()=>{if(this.hasAttribute("disabled"))return;const t=!this.hasAttribute("checked");this.removeAttribute("indeterminate"),this.anim=t?"in":"out",this.checked=t,v(this,"change",{checked:t,value:this.getAttribute("value")??""})});d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.handleToggle())})}get checked(){return this.hasAttribute("checked")}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}onConnect(){this.addEventListener("click",this.handleToggle),this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("click",this.handleToggle),this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.hasAttribute("checked"),s=this.hasAttribute("indeterminate"),a=this.hasAttribute("disabled"),r=this.getAttribute("label"),o=this.getAttribute("description");if(this.setAttribute("data-mana-component","checkbox"),this.setAttribute("role","checkbox"),this.setAttribute("aria-checked",s?"mixed":String(t)),this.setAttribute("tabindex",a?"-1":"0"),k(this,"data-selected",t||s),k(this,"data-disabled",a),k(this,"aria-disabled",a),this.anim?this.setAttribute("data-anim",this.anim):this.removeAttribute("data-anim"),!this.boxEl){const c=S("svg",{class:"mana-checkbox-dot-svg",viewBox:"0 0 20 20","aria-hidden":"true"},[S("circle",{class:"mana-checkbox-dot",cx:"10",cy:"10",r:"3",fill:"currentColor"})]),h=S("svg",{class:"mana-checkbox-stroke",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[S("path",{d:C.check[0],fill:"currentColor"})]);this.boxEl=n("span",{class:"mana-checkbox-box"},[c,h]),this.prepend(this.boxEl)}const l=this.boxEl.querySelector(".mana-checkbox-stroke path");if(l&&l.setAttribute("d",s?C.minus[0]:C.check[0]),r||o){this.labelWrap||(this.labelWrap=n("span",{class:"mana-stack","data-direction":"vertical"}),this.labelWrap.style.gap="var(--space-4)",this.append(this.labelWrap));const c=[];r&&c.push(n("span",{class:"mana-text-body-md-medium mana-text-default-color"},[r])),o&&c.push(n("span",{class:"mana-text-body-sm-normal",style:"color:var(--text-subtle)"},[o])),this.labelWrap.replaceChildren(...c)}else this.labelWrap&&(this.labelWrap.remove(),this.labelWrap=null)}}d(ye,"observedAttributes",["checked","indeterminate","disabled","label","description","value"]);class we extends E{constructor(){super(...arguments);d(this,"_options",null);d(this,"_values",null)}get options(){return this._options??N(this,"options",[])}set options(t){this._options=t,this.mounted&&this.render()}get values(){return this._values??N(this,"values",[])}set values(t){this._values=t,this.mounted&&this.render()}render(){this.setAttribute("data-mana-component","checkbox-group"),this.setAttribute("role","group");const t=this.hasAttribute("disabled"),s=this.options;if(s.length===0)return;const a=new Set(this.values);this.replaceChildren();for(const r of s){const o=document.createElement("mana-checkbox");o.setAttribute("value",r.value),o.setAttribute("label",r.label),r.description&&o.setAttribute("description",r.description),a.has(r.value)&&o.setAttribute("checked",""),(t||r.disabled)&&o.setAttribute("disabled",""),o.addEventListener("change",l=>{l.stopPropagation();const c=new Set(this.values);o.checked?c.add(r.value):c.delete(r.value),this._values=Array.from(c),v(this,"change",{values:this._values})}),this.append(o)}}}d(we,"observedAttributes",["options","values","disabled"]);class xe extends E{constructor(){super(...arguments);d(this,"_options",null)}get options(){return this._options??N(this,"options",[])}set options(t){this._options=t,this.mounted&&this.render()}get value(){return this.getAttribute("value")??""}set value(t){this.setAttribute("value",t)}render(){this.setAttribute("data-mana-component","BaseRadioGroup"),this.setAttribute("role","radiogroup");const t=this.hasAttribute("disabled"),s=this.value,a=this.options;this.replaceChildren(),a.forEach((r,o)=>{const l=r.value===s,c=t||!!r.disabled,h=n("span",{class:"mana-radio-indicator","data-checked":l?"true":void 0,"aria-hidden":"true"}),m=n("span",{class:"mana-stack","data-direction":"vertical"},[n("span",{class:"mana-text-body-md-medium mana-text-default-color"},[r.name]),r.description?n("span",{class:"mana-text-body-sm-normal",style:"color:var(--text-subtle)"},[r.description]):null]);m.style.gap="var(--space-4)";const u=n("div",{class:"mana-radio-item",role:"radio","aria-checked":String(l),"aria-disabled":c?"true":void 0,"data-selected":l?"true":void 0,"data-disabled":c?"true":void 0,tabindex:c?-1:l||!s&&o===0?0:-1},[h,m]),b=()=>{c||(this.setAttribute("value",r.value),v(this,"change",{value:r.value}))};u.addEventListener("click",b),u.addEventListener("keydown",f=>{if(O(f)){f.preventDefault(),b();return}if(f.key==="ArrowDown"||f.key==="ArrowRight"||f.key==="ArrowUp"||f.key==="ArrowLeft"){f.preventDefault();const g=a.filter(L=>!(t||L.disabled));if(!g.length)return;const A=g.findIndex(L=>L.value===r.value),y=f.key==="ArrowDown"||f.key==="ArrowRight"?1:-1,w=g[(A+y+g.length)%g.length];this.setAttribute("value",w.value),v(this,"change",{value:w.value}),this.querySelector('[role="radio"][aria-checked="true"]')?.focus()}}),this.append(u)})}}d(xe,"observedAttributes",["options","value","disabled","aria-label"]);class ke extends E{constructor(){super(...arguments);d(this,"pressed",!1);d(this,"onPointerDown",()=>{this.hasAttribute("disabled")||(this.pressed=!0,this.syncThumb())});d(this,"onPointerUp",()=>{this.pressed&&(this.pressed=!1,this.syncThumb())});d(this,"handleClick",()=>{this.hasAttribute("disabled")||(this.checked=!this.checked,v(this,"change",{checked:this.checked}))});d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||O(t)&&(t.preventDefault(),this.handleClick())})}get checked(){return this.hasAttribute("checked")}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}onConnect(){this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.onKeyDown),this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointerleave",this.onPointerUp)}onDisconnect(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.onKeyDown),this.removeEventListener("pointerdown",this.onPointerDown),this.removeEventListener("pointerup",this.onPointerUp),this.removeEventListener("pointerleave",this.onPointerUp)}syncThumb(){const t=this.querySelector(".mana-switch-thumb-rect");t&&(t.setAttribute("x",this.pressed?"2":"4"),t.setAttribute("y",this.pressed?"6":"4"),t.setAttribute("width",this.pressed?"20":"16"),t.setAttribute("height",this.pressed?"12":"16"),t.setAttribute("rx",this.pressed?"6":"8"))}render(){const t=this.checked,s=this.hasAttribute("disabled"),a=this.hasAttribute("has-icon");this.setAttribute("data-mana-component","switch"),this.setAttribute("role","switch"),this.setAttribute("tabindex",s?"-1":"0"),this.setAttribute("aria-checked",String(t)),k(this,"data-checked",t),k(this,"data-disabled",s),k(this,"aria-disabled",s);const r=[S("rect",{class:"mana-switch-thumb-rect",x:this.pressed?2:4,y:this.pressed?6:4,width:this.pressed?20:16,height:this.pressed?12:16,rx:this.pressed?6:8})];a&&r.push(S("svg",{viewBox:"0 0 24 24",fill:"none"},[S("g",{transform:"translate(4 4)"},[S("path",{class:"mana-switch-thumb-icon",d:t?xa:La}),S("path",{class:"mana-switch-thumb-icon",d:t?ka:Ca})])])),this.replaceChildren(S("svg",{class:"mana-switch-thumb-svg",viewBox:"0 0 24 24",preserveAspectRatio:"xMidYMin meet","aria-hidden":"true"},r))}}d(ke,"observedAttributes",["checked","disabled","has-icon"]);class Le extends E{constructor(){super(...arguments);d(this,"inputEl",null);d(this,"wrapperEl",null);d(this,"clearBtn",null);d(this,"countEl",null)}get value(){return this.inputEl?this.inputEl.value:this.getAttribute("value")??""}set value(t){this.setAttribute("value",t),this.inputEl&&this.inputEl.value!==t&&(this.inputEl.value=t),this.syncAux()}onConnect(){this.wrapperEl||(this.inputEl=n("input",{class:"mana-text-input-native"}),this.inputEl.addEventListener("input",()=>{const t=this.inputEl.value;this.syncAux(),v(this,"input",{value:t})}),this.inputEl.addEventListener("change",()=>{v(this,"change",{value:this.inputEl.value})}),this.clearBtn=n("button",{type:"button",class:"mana-text-input-icon mana-text-input-clear","aria-label":"Clear"},[T([...C.x],14)]),this.clearBtn.addEventListener("click",()=>{this.inputEl&&(this.inputEl.value="",this.setAttribute("value",""),this.syncAux(),v(this,"input",{value:""}),v(this,"clear",{value:""}),this.inputEl.focus())}),this.wrapperEl=n("div",{class:"mana-input-field-wrapper","data-mana-component":"text-input"},[this.inputEl,this.clearBtn]),this.countEl=n("span",{class:"mana-char-count mana-text-body-xs-normal"}),this.append(this.wrapperEl,this.countEl))}syncAux(){const t=this.inputEl?.value??"",s=this.hasAttribute("clearable")&&!this.hasAttribute("disabled")&&!this.hasAttribute("read-only");this.clearBtn&&(this.clearBtn.hidden=!(s&&t.length>0)),this.wrapperEl&&k(this.wrapperEl,"data-has-trailing",s&&t.length>0);const a=this.getAttribute("max-length"),r=this.hasAttribute("show-character-count")&&a!=null;if(this.countEl&&(this.countEl.hidden=!r,r)){const o=Number(a);this.countEl.textContent=`${t.length} / ${o}`,k(this.countEl,"data-over-limit",t.length>o)}}render(){if(!this.inputEl||!this.wrapperEl)return;const t=this.getAttribute("size")??"md",s=this.hasAttribute("disabled"),a=this.hasAttribute("read-only"),r=this.hasAttribute("error");this.wrapperEl.setAttribute("data-size",t),k(this.wrapperEl,"data-disabled",s),k(this.wrapperEl,"data-read-only",a),k(this.wrapperEl,"data-error",r),this.inputEl.type=this.getAttribute("type")??"text",this.inputEl.placeholder=this.getAttribute("placeholder")??"",this.inputEl.disabled=s,this.inputEl.readOnly=a,this.inputEl.required=this.hasAttribute("required");const o=this.getAttribute("max-length");o!=null?this.inputEl.maxLength=Number(o):this.inputEl.removeAttribute("maxlength");const l=this.getAttribute("aria-label");l&&this.inputEl.setAttribute("aria-label",l);const c=this.getAttribute("value");c!=null&&this.inputEl.value!==c&&(this.inputEl.value=c),this.syncAux()}}d(Le,"observedAttributes",["value","placeholder","type","size","disabled","read-only","required","max-length","clearable","error","show-character-count","aria-label"]);class Ce extends E{constructor(){super(...arguments);d(this,"areaEl",null);d(this,"wrapperEl",null);d(this,"countEl",null)}get value(){return this.areaEl?this.areaEl.value:this.getAttribute("value")??""}set value(t){this.setAttribute("value",t),this.areaEl&&this.areaEl.value!==t&&(this.areaEl.value=t),this.syncCount()}onConnect(){this.wrapperEl||(this.areaEl=n("textarea",{class:"mana-text-area-native"}),this.areaEl.addEventListener("input",()=>{this.syncCount(),v(this,"input",{value:this.areaEl.value})}),this.areaEl.addEventListener("change",()=>{v(this,"change",{value:this.areaEl.value})}),this.wrapperEl=n("div",{class:"mana-input-field-wrapper","data-mana-component":"text-area"},[this.areaEl]),this.countEl=n("span",{class:"mana-char-count mana-text-body-xs-normal"}),this.append(this.wrapperEl,this.countEl))}syncCount(){const t=this.areaEl?.value??"",s=this.getAttribute("max-length"),a=this.hasAttribute("show-character-count")&&s!=null;if(this.countEl&&(this.countEl.hidden=!a,a)){const r=Number(s);this.countEl.textContent=`${t.length} / ${r}`,k(this.countEl,"data-over-limit",t.length>r)}}render(){if(!this.areaEl||!this.wrapperEl)return;const t=this.hasAttribute("disabled"),s=this.hasAttribute("read-only"),a=this.hasAttribute("error");k(this.wrapperEl,"data-disabled",t),k(this.wrapperEl,"data-read-only",s),k(this.wrapperEl,"data-error",a),this.areaEl.rows=Number(this.getAttribute("rows")??"3"),this.areaEl.placeholder=this.getAttribute("placeholder")??"",this.areaEl.disabled=t,this.areaEl.readOnly=s,this.areaEl.required=this.hasAttribute("required");const r=this.getAttribute("max-length");r!=null&&(this.areaEl.maxLength=Number(r));const o=this.getAttribute("aria-label");o&&this.areaEl.setAttribute("aria-label",o);const l=this.getAttribute("value");l!=null&&this.areaEl.value!==l&&(this.areaEl.value=l),this.syncCount()}}d(Ce,"observedAttributes",["value","placeholder","rows","disabled","read-only","required","max-length","error","show-character-count","aria-label"]);class _e extends E{constructor(){super(...arguments);d(this,"inputEl",null);d(this,"wrapperEl",null);d(this,"clearBtn",null)}get value(){return this.inputEl?this.inputEl.value:this.getAttribute("value")??""}set value(t){this.setAttribute("value",t),this.inputEl&&this.inputEl.value!==t&&(this.inputEl.value=t),this.syncClear()}onConnect(){if(!this.wrapperEl){const t=n("span",{class:"mana-text-input-icon","aria-hidden":"true"},[T([...C.search],16)]);this.inputEl=n("input",{type:"search",class:"mana-text-input-native"}),this.inputEl.addEventListener("input",()=>{this.syncClear(),v(this,"input",{value:this.inputEl.value})}),this.inputEl.addEventListener("change",()=>{v(this,"change",{value:this.inputEl.value})}),this.clearBtn=n("button",{type:"button",class:"mana-text-input-icon mana-text-input-clear","aria-label":"Clear search"},[T([...C.x],14)]),this.clearBtn.addEventListener("click",()=>{this.inputEl&&(this.inputEl.value="",this.setAttribute("value",""),this.syncClear(),v(this,"input",{value:""}),v(this,"clear",{value:""}),this.inputEl.focus())}),this.wrapperEl=n("div",{class:"mana-input-field-wrapper","data-mana-component":"text-input","data-has-leading":"true"},[t,this.inputEl,this.clearBtn]),this.append(this.wrapperEl)}}syncClear(){const t=(this.inputEl?.value.length??0)>0&&!this.hasAttribute("disabled");this.clearBtn&&(this.clearBtn.hidden=!t),this.wrapperEl&&k(this.wrapperEl,"data-has-trailing",t)}render(){if(!this.inputEl||!this.wrapperEl)return;const t=this.hasAttribute("disabled");this.wrapperEl.setAttribute("data-size",this.getAttribute("size")??"sm"),k(this.wrapperEl,"data-disabled",t),this.inputEl.disabled=t,this.inputEl.placeholder=this.getAttribute("placeholder")??"Search",this.inputEl.setAttribute("aria-label",this.getAttribute("aria-label")??this.inputEl.placeholder);const s=this.getAttribute("value");s!=null&&this.inputEl.value!==s&&(this.inputEl.value=s),this.syncClear()}}d(_e,"observedAttributes",["value","placeholder","size","disabled","aria-label"]);class Te extends E{constructor(){super(...arguments);d(this,"inputEl",null);d(this,"wrapperEl",null)}get value(){return Number(this.inputEl?.value??this.getAttribute("value")??"0")}set value(t){this.setAttribute("value",String(t))}onConnect(){if(!this.wrapperEl){const t=n("button",{type:"button",class:"mana-text-input-icon mana-text-input-accessory","aria-label":"Decrement"},[T([...C.minus],14)]),s=n("button",{type:"button",class:"mana-text-input-icon mana-text-input-accessory","aria-label":"Increment"},[T([...C.plus],14)]);this.inputEl=n("input",{type:"number",class:"mana-text-input-native"});const a=r=>{if(this.hasAttribute("disabled")||!this.inputEl)return;const o=Number(this.getAttribute("step")??"1"),l=this.hasAttribute("min")?Number(this.getAttribute("min")):-1/0,c=this.hasAttribute("max")?Number(this.getAttribute("max")):1/0,h=Math.min(c,Math.max(l,(Number(this.inputEl.value)||0)+r*o));this.inputEl.value=String(h),this.setAttribute("value",String(h)),v(this,"input",{value:h}),v(this,"change",{value:h})};t.addEventListener("click",()=>a(-1)),s.addEventListener("click",()=>a(1)),this.inputEl.addEventListener("input",()=>v(this,"input",{value:Number(this.inputEl.value)})),this.inputEl.addEventListener("change",()=>v(this,"change",{value:Number(this.inputEl.value)})),this.wrapperEl=n("div",{class:"mana-input-field-wrapper","data-mana-component":"text-input","data-has-leading":"true","data-has-trailing":"true"},[t,this.inputEl,s]),this.append(this.wrapperEl)}}render(){if(!this.inputEl||!this.wrapperEl)return;const t=this.hasAttribute("disabled");this.wrapperEl.setAttribute("data-size",this.getAttribute("size")??"md"),k(this.wrapperEl,"data-disabled",t),this.inputEl.disabled=t,this.hasAttribute("min")&&(this.inputEl.min=this.getAttribute("min")),this.hasAttribute("max")&&(this.inputEl.max=this.getAttribute("max")),this.hasAttribute("step")&&(this.inputEl.step=this.getAttribute("step"));const s=this.getAttribute("value")??"0";this.inputEl.value!==s&&(this.inputEl.value=s);const a=this.getAttribute("aria-label");a&&this.inputEl.setAttribute("aria-label",a)}}d(Te,"observedAttributes",["value","min","max","step","disabled","size","aria-label"]);class Se extends E{constructor(){super(...arguments);d(this,"dragging",!1);d(this,"rootEl",null);d(this,"fillEl",null);d(this,"grabberEl",null);d(this,"bubbleEl",null);d(this,"marksEl",null);d(this,"_marks",null)}get marks(){return this._marks??N(this,"marks",[])}set marks(t){this._marks=t,this.mounted&&this.render()}get value(){return Number(this.getAttribute("value")??this.getAttribute("min")??"0")}set value(t){this.setAttribute("value",String(t))}clampStep(t){const s=Number(this.getAttribute("min")??"0"),a=Number(this.getAttribute("max")??"100"),r=Number(this.getAttribute("step")??"1"),o=Math.round((t-s)/r)*r+s;return Math.min(a,Math.max(s,Number(o.toFixed(6))))}updateFromClientX(t,s=!1){if(!this.rootEl)return;const a=this.rootEl.getBoundingClientRect(),r=Number(this.getAttribute("min")??"0"),o=Number(this.getAttribute("max")??"100"),l=a.width>0?Math.min(1,Math.max(0,(t-a.left)/a.width)):0,c=this.clampStep(r+l*(o-r));this.setAttribute("value",String(c)),v(this,"input",{value:c}),s&&v(this,"change",{value:c})}onConnect(){if(!this.rootEl){this.fillEl=n("div",{class:"mana-slider-bar-fill"});const t=n("div",{class:"mana-slider-bar"},[this.fillEl]);this.bubbleEl=n("div",{class:"mana-slider-bubble"}),this.grabberEl=n("div",{class:"mana-slider-grabber",role:"slider",tabindex:0},[this.bubbleEl]);const s=n("div",{class:"mana-slider-track"},[this.grabberEl]);this.marksEl=n("div",{class:"mana-slider-track-marks"}),this.rootEl=n("div",{class:"mana-slider"},[this.marksEl,t,s]),this.rootEl.addEventListener("pointerdown",a=>{if(this.hasAttribute("disabled"))return;this.dragging=!0,this.rootEl.setAttribute("data-dragging","true"),this.updateFromClientX(a.clientX);const r=l=>this.updateFromClientX(l.clientX),o=l=>{this.dragging=!1,this.rootEl?.removeAttribute("data-dragging"),this.updateFromClientX(l.clientX,!0),window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",o)};window.addEventListener("pointermove",r),window.addEventListener("pointerup",o)}),this.grabberEl.addEventListener("keydown",a=>{if(this.hasAttribute("disabled"))return;const r=Number(this.getAttribute("min")??"0"),o=Number(this.getAttribute("max")??"100"),l=Number(this.getAttribute("step")??"1");let c=null;a.key==="ArrowRight"||a.key==="ArrowUp"?c=this.clampStep(this.value+l):a.key==="ArrowLeft"||a.key==="ArrowDown"?c=this.clampStep(this.value-l):a.key==="PageUp"?c=this.clampStep(this.value+l*10):a.key==="PageDown"?c=this.clampStep(this.value-l*10):a.key==="Home"?c=r:a.key==="End"&&(c=o),c!=null&&(a.preventDefault(),this.setAttribute("value",String(c)),v(this,"input",{value:c}),v(this,"change",{value:c}))}),this.append(this.rootEl)}}render(){if(!this.rootEl||!this.fillEl||!this.grabberEl||!this.bubbleEl||!this.marksEl)return;const t=Number(this.getAttribute("min")??"0"),s=Number(this.getAttribute("max")??"100"),a=this.clampStep(this.value),r=s>t?(a-t)/(s-t)*100:0,o=this.hasAttribute("disabled"),l=this.marks;k(this.rootEl,"data-disabled",o),k(this.rootEl,"data-has-marks",l.length>0),this.fillEl.style.width=`${r}%`,this.grabberEl.style.insetInlineStart=`${r}%`,this.grabberEl.tabIndex=o?-1:0,this.grabberEl.setAttribute("aria-valuemin",String(t)),this.grabberEl.setAttribute("aria-valuemax",String(s)),this.grabberEl.setAttribute("aria-valuenow",String(a)),this.hasAttribute("aria-label")&&this.grabberEl.setAttribute("aria-label",this.getAttribute("aria-label")),k(this.grabberEl,"aria-disabled",o);const c=this.hasAttribute("show-bubble")||this.dragging;this.bubbleEl.hidden=!c,this.bubbleEl.textContent=String(a),this.marksEl.replaceChildren();for(const h of l){const m=s>t?(h-t)/(s-t)*100:0,u=n("div",{class:"mana-slider-mark"},[n("span",{class:"mana-slider-mark-value"},[String(h)]),n("span",{class:"mana-slider-mark-dash"})]);u.style.insetInlineStart=`${m}%`,this.marksEl.append(u)}}}d(Se,"observedAttributes",["value","min","max","step","disabled","marks","show-bubble","aria-label"]);function j(e){if(!e)return null;const i=e.match(/^(\d{4})-(\d{2})-(\d{2})/);return i?{year:Number(i[1]),month:Number(i[2]),day:Number(i[3])}:null}class Me extends E{constructor(){super(...arguments);d(this,"onClick",t=>{if(this.hasAttribute("disabled")||t.target?.closest(".mana-tag-remove"))return;const s=!this.hasAttribute("selected");s?this.setAttribute("selected",""):this.removeAttribute("selected"),v(this,"change",{selected:s,label:this.getAttribute("label")??this.textContent?.trim()??""})});d(this,"onKeyDown",t=>{this.hasAttribute("disabled")||(O(t)?(t.preventDefault(),this.click()):(t.key==="Backspace"||t.key==="Delete")&&this.hasAttribute("removable")&&(t.preventDefault(),v(this,"remove",{label:this.getAttribute("label")??""})))})}onConnect(){this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("click",this.onClick),this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.getAttribute("label"),s=this.getAttribute("variant")??"default",a=this.getAttribute("size")??"sm",r=this.hasAttribute("selected"),o=this.hasAttribute("disabled"),l=this.hasAttribute("removable");if(this.setAttribute("data-mana-component","tag"),this.setAttribute("data-variant",s),this.setAttribute("data-size",a),k(this,"data-selected",r),k(this,"data-disabled",o),this.setAttribute("role","option"),this.setAttribute("aria-selected",String(r)),this.setAttribute("tabindex",o?"-1":"0"),t!=null){const c=[n("span",{class:"mana-text-body-sm-medium"},[t])];if(l){const h=n("button",{type:"button",class:"mana-tag-remove","aria-label":`Remove ${t}`},[T([...C.x],12)]);h.addEventListener("click",m=>{m.stopPropagation(),o||v(this,"remove",{label:t})}),c.push(h)}this.replaceChildren(...c)}}}d(Me,"observedAttributes",["label","variant","size","selected","disabled","removable"]);class De extends E{constructor(){super(...arguments);d(this,"_items",null)}get items(){return this._items??N(this,"items",[])}set items(t){this._items=t,this.mounted&&this.render()}render(){this.setAttribute("data-mana-component","tag-group"),this.setAttribute("role","listbox");const t=this.getAttribute("layout");t&&this.setAttribute("data-layout",t);const s=this.items;if(s.length===0)return;const a=this.getAttribute("size")??"sm",r=this.getAttribute("variant")??"default";this.replaceChildren();for(const o of s){const l=document.createElement("mana-tag");l.setAttribute("label",o.label),l.setAttribute("size",a),l.setAttribute("variant",r),o.selected&&l.setAttribute("selected",""),o.disabled&&l.setAttribute("disabled",""),o.removable&&l.setAttribute("removable",""),l.addEventListener("remove",c=>{c.stopPropagation(),v(this,"remove",{id:o.id,item:o})}),l.addEventListener("change",c=>{c.stopPropagation(),v(this,"change",{id:o.id,selected:l.hasAttribute("selected"),item:o})}),this.append(l)}}}d(De,"observedAttributes",["items","layout","size","variant","aria-label"]);class Ne extends E{constructor(){super(...arguments);d(this,"_items",null);d(this,"activeIndex",-1);d(this,"onKeyDown",t=>{const s=this.items;if(s.length){if(t.key==="ArrowDown"||t.key==="ArrowUp"||t.key==="Home"||t.key==="End"){if(t.preventDefault(),t.key==="Home")this.activeIndex=0;else if(t.key==="End")this.activeIndex=s.length-1;else{const a=t.key==="ArrowDown"?1:-1;this.activeIndex=(this.activeIndex+a+s.length)%s.length}this.render()}else if(O(t)&&this.activeIndex>=0&&s[this.activeIndex]&&!s[this.activeIndex].disabled){t.preventDefault();const a=s[this.activeIndex];this.setAttribute("value",a.value),v(this,"change",{value:a.value,item:a})}}})}get items(){return this._items??N(this,"items",[])}set items(t){this._items=t,this.mounted&&this.render()}get value(){return this.getAttribute("value")??""}set value(t){this.setAttribute("value",t)}onConnect(){this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("keydown",this.onKeyDown)}render(){this.setAttribute("data-mana-component","listbox"),this.setAttribute("role","listbox"),this.setAttribute("tabindex","0"),k(this,"data-scrollable",this.hasAttribute("scrollable"));const t=this.items,s=this.value;if(this.replaceChildren(),t.length===0){this.append(n("div",{class:"mana-listbox-empty mana-text-body-sm-normal"},[this.getAttribute("empty-text")??"No items"]));return}let a;t.forEach((r,o)=>{r.group&&r.group!==a&&(a=r.group,this.append(n("div",{class:"mana-listbox-group-label mana-text-body-xs-semibold"},[r.group])));const l=r.value===s,c=n("div",{class:"mana-listbox-option",role:"option","aria-selected":String(l),"aria-disabled":r.disabled?"true":void 0,"data-focus-visible":o===this.activeIndex?"true":void 0},[n("div",{class:"mana-listbox-option-content"},[n("span",{class:"mana-listbox-option-label mana-text-body-md-medium"},[r.label]),l?n("span",{class:"mana-listbox-selected-icon","aria-hidden":"true"},[T([...C.check],16)]):null])]);c.addEventListener("click",()=>{r.disabled||(this.activeIndex=o,this.setAttribute("value",r.value),v(this,"change",{value:r.value,item:r}))}),this.append(c)})}}d(Ne,"observedAttributes",["items","value","selection-mode","empty-text","scrollable"]);class Be extends E{constructor(){super(...arguments);d(this,"_options",null);d(this,"isOpen",!1);d(this,"dropdownEl",null);d(this,"onOutsideClick",t=>{const s=t.target;s&&(this.contains(s)||this.dropdownEl?.contains(s)||this.closeDropdown())});d(this,"onDocKeyDown",t=>{t.key==="Escape"&&this.closeDropdown()})}get options(){return this._options??N(this,"options",[])}set options(t){this._options=t,this.mounted&&this.render()}get value(){return this.getAttribute("value")??""}set value(t){this.setAttribute("value",t)}onDisconnect(){this.closeDropdown(),document.removeEventListener("pointerdown",this.onOutsideClick),document.removeEventListener("keydown",this.onDocKeyDown)}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.dropdownEl?.remove(),this.dropdownEl=null,document.removeEventListener("pointerdown",this.onOutsideClick),document.removeEventListener("keydown",this.onDocKeyDown),this.mounted&&this.render())}openDropdown(){if(this.hasAttribute("disabled")||this.hasAttribute("read-only"))return;this.isOpen=!0,this.render();const t=this.querySelector('[data-mana-component="select-input-field"]');if(!t)return;const s=document.createElement("mana-listbox");s.items=this.options,s.value=this.value,s.addEventListener("change",a=>{a.stopPropagation();const r=a.detail;this.setAttribute("value",r.value),this.closeDropdown(),v(this,"change",r)}),this.dropdownEl=n("div",{class:"mana-select-dropdown mana-floating-layer"},[s]),this.dropdownEl.style.position="fixed",document.body.append(this.dropdownEl),it(t,this.dropdownEl,{placement:"bottom-start",spacing:4,matchReferenceWidth:!0}).then(a=>{this.dropdownEl&&(this.dropdownEl.style.left=`${a.x}px`,this.dropdownEl.style.top=`${a.y}px`)}),document.addEventListener("pointerdown",this.onOutsideClick),document.addEventListener("keydown",this.onDocKeyDown)}render(){const t=this.hasAttribute("disabled"),s=this.hasAttribute("read-only"),a=this.hasAttribute("clearable"),r=this.hasAttribute("full-width"),o=this.getAttribute("placeholder")??"Select…",l=this.options.find(f=>f.value===this.value);this.setAttribute("data-mana-component","select"),k(this,"data-full-width",r);const c=l?n("span",{class:"mana-select-single-option mana-text-body-md-normal"},[l.label]):n("span",{class:"mana-select-placeholder mana-text-body-md-normal"},[o]),h=n("div",{class:"mana-select-button"},[c]),m=a&&l&&!t&&!s?n("button",{type:"button",class:"mana-select-clear","aria-label":"Clear selection"},[T([...C.x],14)]):null;m&&m.addEventListener("click",f=>{f.stopPropagation(),this.setAttribute("value",""),v(this,"change",{value:"",item:null})});const u=n("span",{class:"mana-select-chevron-btn","aria-hidden":"true"},[T([...C.chevronDown],20,"0 0 24 24",`mana-select-chevron${this.isOpen?" mana-select-chevron--open":""}`)]),b=n("div",{class:"mana-input-field-wrapper","data-mana-component":"select-input-field","data-open":this.isOpen?"true":void 0,"data-disabled":t?"true":void 0,"data-read-only":s?"true":void 0,role:"combobox","aria-expanded":String(this.isOpen),"aria-haspopup":"listbox",tabindex:t?-1:0},[h,m,u]);b.addEventListener("click",()=>{this.isOpen?this.closeDropdown():this.openDropdown()}),b.addEventListener("keydown",f=>{(O(f)||f.key==="ArrowDown")&&(f.preventDefault(),this.isOpen||this.openDropdown())}),this.replaceChildren(b)}}d(Be,"observedAttributes",["options","value","placeholder","disabled","read-only","clearable","full-width"]);class Re extends E{constructor(){super(...arguments);d(this,"_options",null);d(this,"isOpen",!1);d(this,"query","");d(this,"inputEl",null);d(this,"dropdownEl",null);d(this,"onOutsideClick",t=>{const s=t.target;!s||this.contains(s)||this.dropdownEl?.contains(s)||this.closeDropdown()})}get options(){return this._options??N(this,"options",[])}set options(t){this._options=t,this.mounted&&this.renderDropdown()}get value(){return this.getAttribute("value")??""}set value(t){this.setAttribute("value",t)}onDisconnect(){this.closeDropdown(),document.removeEventListener("pointerdown",this.onOutsideClick)}closeDropdown(){this.isOpen=!1,this.dropdownEl?.remove(),this.dropdownEl=null,document.removeEventListener("pointerdown",this.onOutsideClick)}renderDropdown(){if(!this.isOpen||!this.inputEl)return;const t=this.query.trim().toLowerCase(),s=t?this.options.filter(o=>o.label.toLowerCase().includes(t)):this.options;this.dropdownEl||(this.dropdownEl=n("div",{class:"mana-select-dropdown mana-floating-layer"}),this.dropdownEl.style.position="fixed",document.body.append(this.dropdownEl),document.addEventListener("pointerdown",this.onOutsideClick));const a=document.createElement("mana-listbox");a.items=s,a.value=this.value,a.setAttribute("empty-text","No matching options"),a.addEventListener("change",o=>{o.stopPropagation();const l=o.detail;this.query=l.item.label,this.inputEl&&(this.inputEl.value=l.item.label),this.setAttribute("value",l.value),this.closeDropdown(),v(this,"change",l)}),this.dropdownEl.replaceChildren(a);const r=this.querySelector(".mana-input-field-wrapper")??this;it(r,this.dropdownEl,{placement:"bottom-start",spacing:4,matchReferenceWidth:!0}).then(o=>{this.dropdownEl&&(this.dropdownEl.style.left=`${o.x}px`,this.dropdownEl.style.top=`${o.y}px`)})}onConnect(){if(!this.inputEl){this.inputEl=n("input",{type:"text",class:"mana-text-input-native",role:"combobox",autocomplete:"off"}),this.inputEl.addEventListener("focus",()=>{this.hasAttribute("disabled")||(this.isOpen=!0,this.renderDropdown())}),this.inputEl.addEventListener("input",()=>{this.query=this.inputEl.value,this.isOpen=!0,this.renderDropdown()}),this.inputEl.addEventListener("keydown",a=>{a.key==="Escape"&&this.closeDropdown()});const t=n("span",{class:"mana-select-chevron-btn","aria-hidden":"true"},[T([...C.chevronDown],20,"0 0 24 24","mana-select-chevron")]),s=n("div",{class:"mana-input-field-wrapper","data-mana-component":"text-input","data-has-trailing":"true"},[this.inputEl,t]);this.append(s)}}render(){this.setAttribute("data-mana-component","combobox"),k(this,"data-full-width",this.hasAttribute("full-width"));const t=this.hasAttribute("disabled"),s=this.querySelector(".mana-input-field-wrapper");if(s&&k(s,"data-disabled",t),this.inputEl){this.inputEl.disabled=t,this.inputEl.placeholder=this.getAttribute("placeholder")??"Search…";const a=this.options.find(r=>r.value===this.value);a&&!this.isOpen&&(this.inputEl.value=a.label)}}}d(Re,"observedAttributes",["options","value","placeholder","disabled","full-width"]);class Oe extends E{constructor(){super(...arguments);d(this,"_items",null)}get items(){return this._items??N(this,"items",[])}set items(t){this._items=t,this.mounted&&this.render()}get value(){return this.getAttribute("value")??this.items[0]?.id??""}set value(t){this.setAttribute("value",t)}render(){const t=this.items,s=this.value||t[0]?.id||"",a=this.getAttribute("variant")??"default";this.setAttribute("data-mana-component","tabs"),this.setAttribute("data-variant",a);const r=n("div",{class:"mana-tabs-list",role:"tablist"}),o=n("div",{class:"mana-tabs-indicator"}),l=n("div",{class:"mana-tabs-strip"},[n("div",{class:"mana-tabs-rail"}),r,o]);let c=null;t.forEach((u,b)=>{const f=u.id===s,g=n("button",{type:"button",class:"mana-tab-item mana-text-body-md-semibold",role:"tab","aria-selected":String(f),disabled:!!u.disabled,tabindex:f?0:-1},[u.label]);f&&(c=g),g.addEventListener("click",()=>{u.disabled||(this.setAttribute("value",u.id),v(this,"change",{value:u.id,item:u}))}),g.addEventListener("keydown",A=>{if(A.key==="ArrowRight"||A.key==="ArrowLeft"){A.preventDefault();const y=t.filter(_=>!_.disabled);if(!y.length)return;const w=y.findIndex(_=>_.id===u.id),x=y[(w+(A.key==="ArrowRight"?1:-1)+y.length)%y.length];this.setAttribute("value",x.id),v(this,"change",{value:x.id,item:x}),this.querySelector('[role="tab"][aria-selected="true"]')?.focus()}}),r.append(g)});const h=t.find(u=>u.id===s),m=h?.content!=null?n("div",{class:"mana-tab-panel",role:"tabpanel"},[h.content]):null;if(this.replaceChildren(l,...m?[m]:[]),c){const u=c;o.style.width=`${u.offsetWidth||48}px`,o.style.transform=`translateX(${u.offsetLeft||0}px)`}}}d(Oe,"observedAttributes",["items","value","variant"]);class Ie extends E{constructor(){super(...arguments);d(this,"viewYear",vt().year);d(this,"viewMonth",vt().month)}onConnect(){const t=j(this.getAttribute("value"));t&&(this.viewYear=t.year,this.viewMonth=t.month)}render(){const t=j(this.getAttribute("value")),s=j(this.getAttribute("min"))??void 0,a=j(this.getAttribute("max"))??void 0,r=this.hasAttribute("disabled");this.setAttribute("data-mana-component","calendar");const o=n("button",{type:"button",class:"mana-calendar-cell","aria-label":"Previous month",disabled:r},[T([...C.chevronLeft],16)]);o.addEventListener("click",()=>{const m=At(this.viewYear,this.viewMonth,-1);this.viewYear=m.year,this.viewMonth=m.month,this.render()});const l=n("button",{type:"button",class:"mana-calendar-cell","aria-label":"Next month",disabled:r},[T([...C.chevronRight],16)]);l.addEventListener("click",()=>{const m=At(this.viewYear,this.viewMonth,1);this.viewYear=m.year,this.viewMonth=m.month,this.render()});const c=n("div",{class:"mana-calendar-header"},[o,n("span",{class:"mana-text-body-md-semibold mana-heading-default-color"},[qt(this.viewYear,this.viewMonth)]),l]),h=n("div",{class:"mana-calendar-grid",role:"grid"});for(const m of Qt)h.append(n("span",{class:"mana-calendar-weekday mana-text-body-xs-semibold"},[m]));for(const m of Gt(this.viewYear,this.viewMonth)){if(!m){h.append(n("span",{class:"mana-calendar-weekday","aria-hidden":"true"}));continue}const u=Bt(m,t),b=r||jt(m,s,a),f=n("button",{type:"button",class:"mana-calendar-cell","data-selected":u?"true":void 0,"aria-selected":String(u),disabled:b},[String(m.day)]);f.addEventListener("click",()=>{if(b)return;const g=Rt(m);this.setAttribute("value",g),v(this,"change",{value:g,date:m})}),h.append(f)}this.replaceChildren(c,h)}}d(Ie,"observedAttributes",["value","min","max","disabled"]);class Pe extends E{constructor(){super(...arguments);d(this,"viewYear",vt().year);d(this,"viewMonth",vt().month);d(this,"pendingStart",null)}onConnect(){const t=j(this.getAttribute("start"));t&&(this.viewYear=t.year,this.viewMonth=t.month)}render(){const t=this.pendingStart??j(this.getAttribute("start")),s=this.pendingStart?null:j(this.getAttribute("end")),a=j(this.getAttribute("min"))??void 0,r=j(this.getAttribute("max"))??void 0,o=this.hasAttribute("disabled");this.setAttribute("data-mana-component","range-calendar");const l=n("button",{type:"button",class:"mana-calendar-cell","aria-label":"Previous month",disabled:o},[T([...C.chevronLeft],16)]);l.addEventListener("click",()=>{const u=At(this.viewYear,this.viewMonth,-1);this.viewYear=u.year,this.viewMonth=u.month,this.render()});const c=n("button",{type:"button",class:"mana-calendar-cell","aria-label":"Next month",disabled:o},[T([...C.chevronRight],16)]);c.addEventListener("click",()=>{const u=At(this.viewYear,this.viewMonth,1);this.viewYear=u.year,this.viewMonth=u.month,this.render()});const h=n("div",{class:"mana-calendar-header"},[l,n("span",{class:"mana-text-body-md-semibold mana-heading-default-color"},[qt(this.viewYear,this.viewMonth)]),c]),m=n("div",{class:"mana-calendar-grid",role:"grid"});for(const u of Qt)m.append(n("span",{class:"mana-calendar-weekday mana-text-body-xs-semibold"},[u]));for(const u of Gt(this.viewYear,this.viewMonth)){if(!u){m.append(n("span",{class:"mana-calendar-weekday","aria-hidden":"true"}));continue}const b=Bt(u,t),f=Bt(u,s),g=!!(t&&s&&dt(u,t)>=0&&dt(u,s)<=0),A=o||jt(u,a,r),y=n("button",{type:"button",class:"mana-calendar-cell","data-selected":b||f?"true":void 0,"data-in-range":g&&!b&&!f?"true":void 0,"data-selection-start":b?"true":void 0,"data-selection-end":f?"true":void 0,disabled:A},[String(u.day)]);y.addEventListener("click",()=>{if(!A)if(!this.pendingStart)this.pendingStart=u,this.render();else{const w=dt(this.pendingStart,u)<=0?[this.pendingStart,u]:[u,this.pendingStart];this.pendingStart=null;const x=Rt(w[0]),L=Rt(w[1]);this.setAttribute("start",x),this.setAttribute("end",L),v(this,"change",{start:x,end:L})}}),m.append(y)}this.replaceChildren(h,m)}}d(Pe,"observedAttributes",["start","end","min","max","disabled"]);class We extends E{constructor(){super(...arguments);d(this,"isOpen",!1);d(this,"popupEl",null);d(this,"onOutsideClick",t=>{const s=t.target;!s||this.contains(s)||this.popupEl?.contains(s)||this.closePopup()})}onDisconnect(){this.closePopup(),document.removeEventListener("pointerdown",this.onOutsideClick)}closePopup(){this.isOpen=!1,this.popupEl?.remove(),this.popupEl=null,document.removeEventListener("pointerdown",this.onOutsideClick)}openPopup(){if(this.hasAttribute("disabled"))return;this.isOpen=!0;const t=document.createElement("mana-calendar"),s=this.getAttribute("value");s&&t.setAttribute("value",s),this.hasAttribute("min")&&t.setAttribute("min",this.getAttribute("min")),this.hasAttribute("max")&&t.setAttribute("max",this.getAttribute("max")),t.addEventListener("change",a=>{a.stopPropagation();const r=a.detail;this.setAttribute("value",r.value),this.closePopup(),v(this,"change",r)}),this.popupEl=n("div",{class:"mana-datepicker-dialog mana-floating-layer",role:"dialog"},[t]),this.popupEl.style.position="fixed",document.body.append(this.popupEl),it(this,this.popupEl,{placement:"bottom-start",spacing:6}).then(a=>{this.popupEl&&(this.popupEl.style.left=`${a.x}px`,this.popupEl.style.top=`${a.y}px`)}),document.addEventListener("pointerdown",this.onOutsideClick)}render(){const t=this.getAttribute("value")??"",s=this.getAttribute("placeholder")??"YYYY-MM-DD",a=this.hasAttribute("disabled");this.setAttribute("data-mana-component","date-picker");const r=n("input",{type:"text",class:"mana-text-input-native",value:t,placeholder:s,disabled:a,"aria-label":s});r.addEventListener("change",()=>{this.setAttribute("value",r.value),v(this,"change",{value:r.value})});const o=n("button",{type:"button",class:"mana-text-input-icon mana-text-input-accessory","aria-label":"Open calendar",disabled:a},[T([...C.calendar],16)]);o.addEventListener("click",()=>{this.isOpen?this.closePopup():this.openPopup()});const l=n("div",{class:"mana-input-field-wrapper mana-datepicker-input-row","data-disabled":a?"true":void 0},[r,o]);this.replaceChildren(l)}}d(We,"observedAttributes",["value","min","max","placeholder","disabled"]);function _a(e){return S("svg",{class:`mana-popover-caret mana-popover-caret--${e}`,width:16,height:10,viewBox:"0 0 16 10","aria-hidden":"true"},[S("path",{class:"mana-popover-caret-fill",d:"M0 0 L8 9 L16 0 Z"}),S("path",{class:"mana-popover-caret-stroke",d:"M0 0 L8 9 L16 0",fill:"none"})])}class $e extends E{constructor(){super(...arguments);d(this,"lockId",Aa("mana-modal"));d(this,"backdropEl",null);d(this,"bodyNodes",[]);d(this,"footerNodes",[]);d(this,"captured",!1);d(this,"onKeyDown",t=>{if(this.backdropEl){if(t.key==="Escape"&&this.getAttribute("dismissable")!=="false"){t.preventDefault(),this.close();return}if(t.key==="Tab"){const s=this.backdropEl.querySelector('[data-mana-component="modal"]');if(!s)return;const a=Pt(s);if(!a.length){t.preventDefault();return}const r=a[0],o=a[a.length-1];t.shiftKey&&document.activeElement===r?(t.preventDefault(),o.focus()):!t.shiftKey&&document.activeElement===o&&(t.preventDefault(),r.focus())}}})}onConnect(){if(!this.captured){this.captured=!0;for(const t of Array.from(this.childNodes))t instanceof HTMLElement&&t.getAttribute("slot")==="footer"?this.footerNodes.push(t):this.bodyNodes.push(t);this.replaceChildren()}}onDisconnect(){this.teardownModal()}close(){this.removeAttribute("open"),v(this,"close"),v(this,"open-change",{open:!1})}teardownModal(){document.removeEventListener("keydown",this.onKeyDown),xt.remove(this.lockId),this.backdropEl?.remove(),this.backdropEl=null}render(){if(!this.hasAttribute("open")){this.teardownModal();return}const s=this.getAttribute("size")??"md",a=this.getAttribute("title"),r=this.getAttribute("subtitle"),o=this.getAttribute("dismissable")!=="false",l=this.getAttribute("padding-size"),c=[];if(a||r||o){const f=n("div",{class:"mana-modal-header-main"},[a?n("h2",{class:"mana-modal-header-title mana-text-heading-lg-semibold mana-heading-default-color"},[a]):null,r?n("div",{class:"mana-modal-header-subtitle mana-text-body-sm-normal",style:"color:var(--text-subtle)"},[r]):null]),g=o?n("div",{class:"mana-modal-header-trailing"}):null;if(g){const A=document.createElement("mana-close-button");A.addEventListener("click",()=>this.close()),g.append(A)}c.push(n("div",{class:"mana-modal-section mana-modal-header"},[n("div",{class:"mana-modal-header-layout"},[f,g])]))}const h=n("div",{class:"mana-modal-body-inner"});for(const f of this.bodyNodes)h.append(f);if(c.push(n("div",{class:"mana-modal-body"},[h])),this.footerNodes.length>0){const f=n("div",{class:"mana-modal-section mana-modal-action-bar"});for(const g of this.footerNodes)f.append(g);c.push(f)}const m=n("div",{"data-mana-component":"modal","data-size":s,"data-padding-size":l??void 0,role:"dialog","aria-modal":"true","aria-label":a??this.getAttribute("aria-label")??"Dialog",tabindex:-1},c),u=n("div",{class:"mana-modal-outer"},[m]),b=n("div",{class:"mana-modal-backdrop"},[u]);b.addEventListener("click",f=>{o&&(f.target===b||f.target===u)&&this.close()}),this.teardownModal(),this.backdropEl=b,document.body.append(b),document.addEventListener("keydown",this.onKeyDown),xt.add(this.lockId,()=>{}),ks(m)}}d($e,"observedAttributes",["open","size","title","subtitle","dismissable","padding-size"]);class He extends E{constructor(){super(...arguments);d(this,"modalEl",null)}onDisconnect(){this.modalEl?.remove(),this.modalEl=null}render(){if(!this.hasAttribute("open")){this.modalEl?.remove(),this.modalEl=null;return}const s=this.getAttribute("title")??"Confirm",a=this.getAttribute("body")??"",r=this.getAttribute("confirm-text")??"Confirm",o=this.getAttribute("cancel-text")??"Cancel",l=this.getAttribute("variant")==="critical"?"critical-primary":"primary";this.modalEl?.remove();const c=document.createElement("mana-modal");c.setAttribute("open",""),c.setAttribute("size","sm"),c.setAttribute("title",s),a&&c.append(n("p",{class:"mana-text-body-md-normal mana-text-default-color",style:"margin:0"},[a]));const h=document.createElement("mana-button");h.setAttribute("variant","secondary"),h.setAttribute("size","md"),h.textContent=o,h.addEventListener("click",()=>{this.removeAttribute("open"),v(this,"cancel"),v(this,"close")});const m=document.createElement("mana-button");m.setAttribute("variant",l),m.setAttribute("size","md"),m.textContent=r,m.addEventListener("click",()=>{this.removeAttribute("open"),v(this,"confirm"),v(this,"close")});const u=n("div",{class:"mana-modal-action-bar-trailing",slot:"footer"},[h,m]);c.append(u),c.addEventListener("close",()=>{this.removeAttribute("open"),v(this,"cancel"),v(this,"close")}),this.modalEl=c,document.body.append(c)}}d(He,"observedAttributes",["open","title","body","confirm-text","cancel-text","variant"]);class ze extends E{constructor(){super(...arguments);d(this,"backdropEl",null);d(this,"contentNodes",[]);d(this,"captured",!1);d(this,"onKeyDown",t=>{t.key==="Escape"&&this.getAttribute("dismissable")!=="false"&&(this.removeAttribute("open"),v(this,"close"))})}onConnect(){this.captured||(this.captured=!0,this.contentNodes=Array.from(this.childNodes),this.replaceChildren())}onDisconnect(){this.teardown()}teardown(){document.removeEventListener("keydown",this.onKeyDown),this.backdropEl?.remove(),this.backdropEl=null}render(){if(!this.hasAttribute("open")){this.teardown();return}const t=this.getAttribute("dismissable")!=="false",s=n("div",{"data-mana-component":"layer-modal",role:"dialog","aria-modal":"true","aria-label":this.getAttribute("aria-label")??"Dialog",tabindex:-1});for(const o of this.contentNodes)s.append(o);const a=n("div",{class:"mana-modal-outer"},[s]),r=n("div",{class:"mana-modal-backdrop"},[a]);r.addEventListener("click",o=>{t&&(o.target===r||o.target===a)&&(this.removeAttribute("open"),v(this,"close"))}),this.teardown(),this.backdropEl=r,document.body.append(r),document.addEventListener("keydown",this.onKeyDown)}}d(ze,"observedAttributes",["open","dismissable","aria-label"]);class Ke extends E{constructor(){super(...arguments);d(this,"layerEl",null);d(this,"triggerEl",null);d(this,"onTriggerClick",()=>{this.hasAttribute("open")?this.removeAttribute("open"):this.setAttribute("open",""),v(this,"open-change",{open:this.hasAttribute("open")})});d(this,"onOutside",t=>{const s=t.target;!s||this.contains(s)||this.layerEl?.contains(s)||(this.removeAttribute("open"),v(this,"open-change",{open:!1}))});d(this,"onKey",t=>{t.key==="Escape"&&(this.removeAttribute("open"),v(this,"open-change",{open:!1}))})}onConnect(){this.triggerEl=this.querySelector('[slot="trigger"]')??this.firstElementChild,this.triggerEl?.addEventListener("click",this.onTriggerClick)}onDisconnect(){this.triggerEl?.removeEventListener("click",this.onTriggerClick),this.teardown()}teardown(){document.removeEventListener("pointerdown",this.onOutside),document.removeEventListener("keydown",this.onKey),this.layerEl?.remove(),this.layerEl=null}render(){if(!this.hasAttribute("open")){this.teardown();return}const t=this.getAttribute("title"),s=this.getAttribute("body"),a=this.getAttribute("size")??"md",r=this.getAttribute("gradient"),o=this.getAttribute("placement")??"top",l=this.getAttribute("dismissable")!=="false",c=n("div",{"data-mana-component":"popover","data-size":a,"data-gradient":r??void 0,role:"dialog"});if(l){const b=document.createElement("mana-close-button");b.setAttribute("size","xs"),b.className="mana-popover-close",b.addEventListener("click",()=>{this.removeAttribute("open"),v(this,"open-change",{open:!1})}),c.append(b)}(t||s)&&c.append(n("div",{class:"mana-popover-header"},[t?n("div",{class:"mana-popover-title mana-text-heading-md-semibold mana-heading-default-color"},[t]):null,s?n("div",{class:"mana-popover-body mana-text-body-sm-normal"},[s]):null]));const h={top:"bottom",bottom:"top",left:"right",right:"left"};c.append(_a(h[Vt(o)]??"bottom"));const m=n("div",{class:"mana-floating-layer"},[c]);m.style.position="fixed",this.teardown(),this.layerEl=m,document.body.append(m),document.addEventListener("pointerdown",this.onOutside),document.addEventListener("keydown",this.onKey);const u=this.triggerEl??this;it(u,m,{placement:o,spacing:10}).then(b=>{this.layerEl&&(this.layerEl.style.left=`${b.x}px`,this.layerEl.style.top=`${b.y}px`)})}}d(Ke,"observedAttributes",["open","title","body","size","gradient","placement","dismissable"]);class Fe extends E{constructor(){super(...arguments);d(this,"tipEl",null);d(this,"hovered",!1);d(this,"onShow",()=>{this.hovered=!0,this.render()});d(this,"onHide",()=>{this.hovered=!1,this.render()})}onConnect(){this.addEventListener("mouseenter",this.onShow),this.addEventListener("mouseleave",this.onHide),this.addEventListener("focusin",this.onShow),this.addEventListener("focusout",this.onHide)}onDisconnect(){this.removeEventListener("mouseenter",this.onShow),this.removeEventListener("mouseleave",this.onHide),this.removeEventListener("focusin",this.onShow),this.removeEventListener("focusout",this.onHide),this.hideTip()}hideTip(){this.tipEl?.remove(),this.tipEl=null}render(){const t=this.hovered||this.hasAttribute("force-open"),s=this.getAttribute("text");if(!t||!s){this.hideTip();return}const a=this.getAttribute("position")??"top",r=this.getAttribute("shortcut");this.hideTip();const o=n("div",{"data-mana-component":"tooltip","data-position":Vt(a),role:"tooltip"},[n("span",{class:"mana-text-body-sm-medium"},[s]),r?n("kbd",{class:"mana-tooltip-shortcut mana-text-body-xs-semibold"},[r]):null]);o.style.position="fixed",this.tipEl=o,document.body.append(o);const l=this.firstElementChild??this;it(l,o,{placement:a,spacing:8}).then(c=>{this.tipEl&&(this.tipEl.style.left=`${c.x}px`,this.tipEl.style.top=`${c.y}px`)})}}d(Fe,"observedAttributes",["text","shortcut","position","force-open"]);class Ye extends E{render(){const i=this.getAttribute("message")??"",t=this.getAttribute("type")??"info",s=this.hasAttribute("dismissible"),a=this.getAttribute("action-text");this.setAttribute("data-mana-component","global-banner"),this.setAttribute("data-type",t),this.setAttribute("role","status");const r=a?n("div",{class:"mana-global-banner-actions"},[(()=>{const l=document.createElement("mana-button");return l.setAttribute("variant","overlay-secondary"),l.setAttribute("size","xs"),l.textContent=a,l.addEventListener("click",()=>v(this,"action")),l})()]):null,o=s?n("div",{class:"mana-global-banner-dismiss"},[(()=>{const l=document.createElement("mana-close-button");return l.setAttribute("size","xs"),l.addEventListener("click",()=>v(this,"dismiss")),l})()]):null;this.replaceChildren(n("div",{class:"mana-global-banner-content"},[n("div",{class:"mana-global-banner-copy"},[n("span",{class:"mana-text-body-sm-medium"},[i])]),r]),...o?[o]:[])}}d(Ye,"observedAttributes",["message","type","dismissible","action-text"]);class Ue extends E{render(){const i=this.getAttribute("type")??"info",t=this.getAttribute("title"),s=this.getAttribute("message")??"",a=this.hasAttribute("dismissible");this.className="mana-inline-notice",this.setAttribute("data-type",i),this.setAttribute("role",i==="critical"||i==="warning"?"alert":"status");const r=i==="success"?"success":i==="warning"?"warning":i==="critical"?"critical":"info",o=a?(()=>{const l=document.createElement("mana-close-button");return l.setAttribute("size","xs"),l.addEventListener("click",()=>v(this,"dismiss")),l})():null;this.replaceChildren(n("div",{class:"mana-inline-notice-main"},[n("span",{class:"mana-inline-notice-icon","aria-hidden":"true"},[T([...C[r]],18)]),n("div",{class:"mana-inline-notice-copy"},[t?n("span",{class:"mana-text-body-sm-semibold mana-heading-default-color"},[t]):null,s?n("span",{class:"mana-text-body-sm-normal"},[s]):null])]),...o?[o]:[])}}d(Ue,"observedAttributes",["type","title","message","dismissible"]);class Ze extends E{constructor(){super(...arguments);d(this,"timer",null);d(this,"completed",!1)}onConnect(){this.timer=window.setInterval(()=>this.render(),1e3)}onDisconnect(){this.timer!=null&&(window.clearInterval(this.timer),this.timer=null)}render(){const t=this.getAttribute("end-time"),s=t?/^\d+$/.test(t)?Number(t):Date.parse(t):Date.now(),a=Math.max(0,Math.floor((s-Date.now())/1e3)),r=this.getAttribute("variant")??"overlay-secondary",o=this.hasAttribute("show-days");a===0&&!this.completed&&t&&(this.completed=!0,v(this,"complete"));const l=Math.floor(a/86400),c=Math.floor(o?a%86400/3600:a/3600),h=Math.floor(a%3600/60),m=a%60,u=f=>String(f).padStart(2,"0");this.className="mana-countdown mana-text-body-xs-semibold",this.setAttribute("data-variant",r);const b=[];o&&l>0&&b.push(n("span",{},[`${l}d`]),n("span",{class:"mana-countdown-separator","aria-hidden":"true"})),b.push(n("span",{},[u(c)]),n("span",{class:"mana-countdown-separator","aria-hidden":"true"}),n("span",{},[u(h)]),n("span",{class:"mana-countdown-separator","aria-hidden":"true"}),n("span",{},[u(m)])),this.replaceChildren(n("span",{class:"mana-countdown-digits"},b))}}d(Ze,"observedAttributes",["end-time","variant","show-days"]);class Xe extends E{render(){const i=Number(this.getAttribute("value")??"0"),t=Number(this.getAttribute("max")??"100"),s=this.getAttribute("size")??"md",a=t>0?Math.min(100,Math.max(0,i/t*100)):0;this.className="mana-progress-bar",this.setAttribute("data-size",s),this.setAttribute("role","progressbar"),this.setAttribute("aria-valuenow",String(i)),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax",String(t));let r=this.querySelector(".mana-progress-bar-fill");r||(r=n("div",{class:"mana-progress-bar-fill"}),this.append(r)),r.style.width=`${a}%`}}d(Xe,"observedAttributes",["value","max","size","aria-label"]);class Ve extends E{render(){const i=this.getAttribute("text")??"",t=this.getAttribute("variant")??"default";this.className="mana-toast",this.setAttribute("data-variant",t),this.setAttribute("role",t==="critical"?"alert":"status");const s=t==="success"?"success":t==="critical"?"critical":null;this.replaceChildren(n("div",{class:"mana-toast-baselayer","aria-hidden":"true"}),n("div",{class:"mana-toast-content"},[s?T([...C[s]],18):null,n("span",{class:"mana-text-body-sm-medium"},[i])]))}}d(Ve,"observedAttributes",["text","variant"]);class qe extends E{constructor(){super(...arguments);d(this,"unsub",null);d(this,"activeTimers",new Map);d(this,"currentItems",[])}onConnect(){this.unsub=Ss(t=>{const s=this.getAttribute("surface")??"app";this.currentItems=t[s]??[],this.render(),this.scheduleAutoDismiss()})}onDisconnect(){this.unsub?.(),this.unsub=null;for(const t of this.activeTimers.values())window.clearTimeout(t);this.activeTimers.clear()}scheduleAutoDismiss(){const t=this.currentItems[0];if(!(!t||this.activeTimers.has(t.id))&&t.duration>0){const s=window.setTimeout(()=>{this.activeTimers.delete(t.id),_s(t.id,t.surface)},t.duration);this.activeTimers.set(t.id,s)}}render(){const t=this.getAttribute("position")??this.currentItems[0]?.position??"top",s=this.currentItems[0];if(!s){this.replaceChildren();return}const a=document.createElement("mana-toast");a.setAttribute("text",s.text),a.setAttribute("variant",s.variant),this.replaceChildren(n("div",{class:"mana-toast-container","data-position":t},[a]))}}d(qe,"observedAttributes",["surface","position"]);const Ta=/^\/(?!\/|\\)/;class je extends E{render(){const i=this.getAttribute("type")??"wanderingCubes";this.className="mana-spinner",this.setAttribute("data-type",i),this.setAttribute("role","status"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Loading"),k(this,"data-static",this.hasAttribute("static"),"");const t=n("span",{class:"mana-spinner-inner","aria-hidden":"true"});if(i==="spinningCircle"||i==="spinningCircleSimple"){const s=[S("circle",{class:"mana-spinner-path",cx:50,cy:50,r:20})];i==="spinningCircle"&&s.push(S("circle",{class:"mana-spinner-path mana-spinner-path-2",cx:50,cy:50,r:20}),S("circle",{class:"mana-spinner-path mana-spinner-path-3",cx:50,cy:50,r:20})),t.append(S("svg",{class:"mana-spinner-circular",viewBox:"25 25 50 50"},s))}else i==="pulsingEllipsis"||i==="lowMotion"?t.append(n("span",{class:"mana-spinner-item"}),n("span",{class:"mana-spinner-item"}),n("span",{class:"mana-spinner-item"})):t.append(n("span",{class:"mana-spinner-item"}),n("span",{class:"mana-spinner-item"}));this.replaceChildren(t)}}d(je,"observedAttributes",["type","static","aria-label"]);class Ge extends E{render(){this.className="mana-divider",this.setAttribute("role","separator")}}d(Ge,"observedAttributes",[]);class Qe extends E{render(){const i=this.getAttribute("type")??"primary",t=this.getAttribute("padding");this.classList.add("mana-card"),this.setAttribute("data-type",i),k(this,"data-outline",this.hasAttribute("outline"),""),t?this.style.padding=`var(--space-${t})`:this.style.removeProperty("padding")}}d(Qe,"observedAttributes",["type","outline","padding"]);class Je extends E{constructor(){super(...arguments);d(this,"linkEl",null)}onConnect(){if(!this.linkEl){const t=Array.from(this.childNodes);this.linkEl=n("a",{class:"mana-anchor"});for(const s of t)this.linkEl.append(s);this.append(this.linkEl)}}render(){if(!this.linkEl)return;const t=this.getAttribute("href")??"#",s=this.getAttribute("target"),a=this.getAttribute("underline-on-hover")==="false",r=!Ta.test(t)&&!t.startsWith("#");this.linkEl.href=t,this.linkEl.className=a?"mana-anchor mana-anchor-underline":"mana-anchor",s?this.linkEl.target=s:r?this.linkEl.target="_blank":this.linkEl.removeAttribute("target"),r||this.linkEl.target==="_blank"?this.linkEl.rel="noopener noreferrer":this.linkEl.removeAttribute("rel")}}d(Je,"observedAttributes",["href","target","underline-on-hover"]);class ts extends E{render(){const i=Number(this.getAttribute("count")??"0"),t=this.hasAttribute("max")?Number(this.getAttribute("max")):void 0,s=this.getAttribute("shape")??"round",a=this.getAttribute("color")??"var(--background-feedback-notification)",r=t!=null&&i>t?`${t}+`:String(i);this.className="mana-number-badge mana-text-body-xs-bold",this.setAttribute("data-shape",s),this.style.backgroundColor=a,this.style.paddingInline=r.length>1?"4px":"0",this.textContent=r}}d(ts,"observedAttributes",["count","max","shape","color"]);class es extends E{constructor(){super(...arguments);d(this,"overlayNodes",[]);d(this,"captured",!1)}onConnect(){this.captured||(this.captured=!0,this.overlayNodes=Array.from(this.childNodes))}render(){const t=Number(this.getAttribute("value")??"0"),s=Number(this.getAttribute("max")??"100"),a=Number(this.getAttribute("size")??"32"),r=Number(this.getAttribute("stroke-width")??"3"),o=s>0?Math.min(1,Math.max(0,t/s)):0,l=(a-r)/2,c=2*Math.PI*l;this.className="mana-progress-circle",this.setAttribute("role","progressbar"),this.setAttribute("aria-valuenow",String(t)),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax",String(s)),this.style.width=`${a}px`,this.style.height=`${a}px`;const h=S("svg",{class:"mana-progress-circle-svg",width:a,height:a,viewBox:`0 0 ${a} ${a}`},[S("circle",{class:"mana-progress-circle-background",cx:a/2,cy:a/2,r:l,"stroke-width":r}),S("circle",{class:"mana-progress-circle-progress",cx:a/2,cy:a/2,r:l,stroke:"currentColor","stroke-width":r,"stroke-dasharray":String(c),"stroke-dashoffset":String(c*(1-o)),"stroke-linecap":"round",transform:`rotate(-90 ${a/2} ${a/2})`})]),m=n("span",{class:"mana-progress-circle-overlay"});for(const u of this.overlayNodes)m.append(u);this.replaceChildren(h,m)}}d(es,"observedAttributes",["value","max","size","stroke-width"]);class ss extends E{render(){this.classList.add("mana-scroller"),this.setAttribute("data-orientation",this.getAttribute("orientation")??"vertical"),this.setAttribute("data-variant",this.getAttribute("variant")??"thin"),k(this,"data-fade",this.hasAttribute("fade"),"")}}d(ss,"observedAttributes",["orientation","variant","fade"]);class is extends E{constructor(){super(...arguments);d(this,"_columns",null);d(this,"_rows",null);d(this,"sortKey",null);d(this,"sortDir","asc")}get columns(){return this._columns??N(this,"columns",[])}set columns(t){this._columns=t,this.mounted&&this.render()}get rows(){return this._rows??N(this,"rows",[])}set rows(t){this._rows=t,this.mounted&&this.render()}render(){this.classList.add("mana-table-container"),k(this,"data-sticky-header",this.hasAttribute("sticky-header"),"");const t=this.columns;if(t.length===0)return;const s=[...this.rows];if(this.sortKey){const o=this.sortKey,l=this.sortDir==="asc"?1:-1;s.sort((c,h)=>String(c[o]??"").localeCompare(String(h[o]??""),void 0,{numeric:!0})*l)}const a=n("tr",{class:"mana-table-row"});for(const o of t){const l=this.sortKey===o.key,c=n("th",{class:"mana-table-column","data-sorted":l?this.sortDir:void 0});if(o.sortable){const h=n("button",{type:"button",class:"mana-table-sort-button"},[n("span",{class:"mana-table-column-label"},[o.label]),l?n("span",{class:"mana-table-sort-icon"},[this.sortDir==="asc"?"▲":"▼"]):null]);h.addEventListener("click",()=>{this.sortKey===o.key?this.sortDir=this.sortDir==="asc"?"desc":"asc":(this.sortKey=o.key,this.sortDir="asc"),this.render(),v(this,"sort",{key:this.sortKey,direction:this.sortDir})}),c.append(h)}else c.append(n("span",{class:"mana-table-column-label"},[o.label]));a.append(c)}const r=n("tbody",{class:"mana-table-body"});s.forEach((o,l)=>{const c=n("tr",{class:"mana-table-row","data-interactive":""});for(const h of t)c.append(n("td",{class:"mana-table-cell mana-text-body-sm-normal"},[String(o[h.key]??"")]));c.addEventListener("click",()=>v(this,"row-select",{row:o,index:l})),r.append(c)}),this.replaceChildren(n("table",{class:"mana-table"},[n("thead",{class:"mana-table-header"},[a]),r]))}}d(is,"observedAttributes",["columns","rows","sticky-header"]);class as extends E{constructor(){super(...arguments);d(this,"_items",null);d(this,"menuEl",null);d(this,"triggerEl",null);d(this,"onTriggerClick",()=>{this.hasAttribute("open")?this.removeAttribute("open"):this.setAttribute("open",""),v(this,"open-change",{open:this.hasAttribute("open")})});d(this,"onOutside",t=>{const s=t.target;!s||this.contains(s)||this.menuEl?.contains(s)||(this.removeAttribute("open"),v(this,"open-change",{open:!1}))})}get items(){return this._items??N(this,"items",[])}set items(t){this._items=t,this.mounted&&this.render()}onConnect(){this.triggerEl=this.querySelector('[slot="trigger"]')??this.firstElementChild,this.triggerEl?.addEventListener("click",this.onTriggerClick)}onDisconnect(){this.triggerEl?.removeEventListener("click",this.onTriggerClick),this.teardown()}teardown(){document.removeEventListener("pointerdown",this.onOutside),this.menuEl?.remove(),this.menuEl=null}render(){if(!this.hasAttribute("open")){this.teardown();return}const t=this.getAttribute("placement")??"bottom-start",s=n("div",{class:"mana-menu mana-floating-layer",role:"menu","data-placement":t.startsWith("top")?"top":"bottom"});s.style.position="fixed";const a=[];for(const o of this.items){if(o.type==="separator"){s.append(n("div",{class:"mana-menu-separator",role:"separator"}));continue}if(o.type==="group"){s.append(n("div",{class:"mana-menu-group-label"},[o.label??""]));continue}const l=o.type==="checkbox",c=n("div",{class:"mana-menu-item",role:l?"menuitemcheckbox":"menuitem","aria-checked":l?String(!!o.checked):void 0,"aria-disabled":o.disabled?"true":void 0,"data-variant":o.variant==="danger"?"danger":void 0,tabindex:o.disabled?-1:0},[n("span",{class:"mana-menu-item-label"},[n("span",{class:"mana-menu-item-label-text mana-text-body-sm-medium"},[o.label??""]),o.subtext?n("span",{class:"mana-menu-item-subtext mana-text-body-xs-normal"},[o.subtext]):null]),l?n("span",{class:"mana-menu-checkbox","data-checked":o.checked?"":void 0,"aria-hidden":"true"},[o.checked?T([...C.check],14):null]):null]),h=()=>{o.disabled||(l?(o.checked=!o.checked,v(this,"change",{id:o.id,checked:o.checked,item:o}),this.render()):(v(this,"select",{id:o.id,item:o}),this.removeAttribute("open"),v(this,"open-change",{open:!1})))};c.addEventListener("click",h),c.addEventListener("keydown",m=>{if(m.key==="Escape"){this.removeAttribute("open"),v(this,"open-change",{open:!1});return}if(O(m)){m.preventDefault(),h();return}if(m.key==="ArrowDown"||m.key==="ArrowUp"||m.key==="Home"||m.key==="End"){m.preventDefault();const u=a.indexOf(c);if(!a.length)return;let b=u;m.key==="Home"?b=0:m.key==="End"?b=a.length-1:b=(u+(m.key==="ArrowDown"?1:-1)+a.length)%a.length,a[b]?.focus()}}),o.disabled||a.push(c),s.append(c)}this.teardown(),this.menuEl=s,document.body.append(s),document.addEventListener("pointerdown",this.onOutside);const r=this.triggerEl??this;it(r,s,{placement:t,spacing:6}).then(o=>{this.menuEl&&(this.menuEl.style.left=`${o.x}px`,this.menuEl.style.top=`${o.y}px`)}),requestAnimationFrame(()=>a[0]?.focus())}}d(as,"observedAttributes",["open","items","placement"]);function Ot(e){const i=e.trim().split(/\s+/);return i.length===1?i[0].slice(0,2).toUpperCase():i.slice(0,3).map(t=>t[0]).join("").toUpperCase()}function ti(e){const t=`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80"><rect width="80" height="80" fill="hsl(${[...e].reduce((s,a)=>(s*31+a.charCodeAt(0))%360,7)} 55% 45%)"/><text x="40" y="52" font-family="sans-serif" font-size="34" font-weight="700" fill="#fff" text-anchor="middle">${e.slice(0,1).toUpperCase()}</text></svg>`;return`data:image/svg+xml,${encodeURIComponent(t)}`}function Sa(e){const i=[...e].map(s=>s.codePointAt(0).toString(16));return`https://cdn.jsdelivr.net/gh/jdecked/twemoji@latest/assets/svg/${(i.includes("200d")?i:i.filter(s=>s!=="fe0f")).join("-")}.svg`}class ns extends E{constructor(){super(...arguments);d(this,"slots",{"top-bar":[],rail:[],sidebar:[],dock:[],header:[],aside:[],"status-bar":[],default:[]});d(this,"captured",!1)}onConnect(){if(!this.captured){this.captured=!0;for(const t of Array.from(this.childNodes)){const s=t instanceof HTMLElement?t.getAttribute("slot"):null;s&&s in this.slots?this.slots[s].push(t):this.slots.default.push(t)}}}render(){const t=this.getAttribute("surface-style")??"inset",s=this.getAttribute("sidebar-style")??"outer",a=this.hasAttribute("framed"),r=this.getAttribute("height"),o=this.getAttribute("sidebar-width")??"220",l=this.getAttribute("aside-width")??"320",c=this.getAttribute("aside-open")!=="false",h=n("div",{class:"mana-app-shell","data-framed":a?"true":void 0,"data-surface-style":t,"data-has-statusbar":this.slots["status-bar"].length>0?"true":void 0});h.style.setProperty("--mana-sidebar-width",`${o}px`),h.style.setProperty("--mana-aside-width",`${l}px`),r&&(h.style.height=/^\d+$/.test(r)?`${r}px`:r);for(const g of this.slots["top-bar"])h.append(g);const m=n("div",{class:"mana-shell-body"});if(this.slots.rail.length>0||this.slots.sidebar.length>0||this.slots.dock.length>0){const g=n("div",{class:"mana-shell-nav","data-has-rail":this.slots.rail.length>0?"true":"false","data-sidebar-style":s});this.slots.rail.length>0&&g.append(n("div",{class:"mana-shell-nav-rail"},this.slots.rail)),this.slots.sidebar.length>0&&g.append(n("div",{class:"mana-shell-nav-sidebar"},this.slots.sidebar)),this.slots.dock.length>0&&g.append(n("div",{class:"mana-shell-dock-slot"},this.slots.dock)),m.append(g)}const f=[n("div",{class:"mana-shell-primary"},[...this.slots.header,n("main",{class:"mana-shell-content"},this.slots.default)])];this.slots.aside.length>0&&c&&f.push(n("aside",{class:"mana-shell-aside"},this.slots.aside)),m.append(n("div",{class:"mana-shell-surface-wrap"},[n("div",{class:"mana-shell-surface"},f)])),h.append(m);for(const g of this.slots["status-bar"])h.append(g);this.replaceChildren(h)}}d(ns,"observedAttributes",["surface-style","sidebar-style","framed","height","sidebar-width","aside-width","aside-open"]);class rs extends E{constructor(){super(...arguments);d(this,"leadingNodes",[]);d(this,"centerNodes",[]);d(this,"trailingNodes",[]);d(this,"captured",!1)}onConnect(){if(!this.captured){this.captured=!0;for(const t of Array.from(this.childNodes)){const s=t instanceof HTMLElement?t.getAttribute("slot"):null;s==="center"?this.centerNodes.push(t):s==="trailing"?this.trailingNodes.push(t):this.leadingNodes.push(t)}}}render(){const t=n("header",{class:"mana-app-topbar","data-center-align":this.getAttribute("center-align")??"start"},[n("div",{class:"mana-app-topbar-leading"},this.leadingNodes),this.centerNodes.length?n("div",{class:"mana-app-topbar-center"},this.centerNodes):null,n("div",{class:"mana-app-topbar-trailing"},this.trailingNodes)]),s=this.getAttribute("height");s&&(t.style.height=`${s}px`),this.replaceChildren(t)}}d(rs,"observedAttributes",["center-align","height"]);class os extends E{constructor(){super(...arguments);d(this,"leadingNodes",[]);d(this,"trailingNodes",[]);d(this,"captured",!1)}onConnect(){if(!this.captured){this.captured=!0;for(const t of Array.from(this.childNodes))(t instanceof HTMLElement?t.getAttribute("slot"):null)==="trailing"?this.trailingNodes.push(t):this.leadingNodes.push(t)}}render(){this.replaceChildren(n("footer",{class:"mana-app-statusbar"},[n("div",{class:"mana-app-statusbar-leading"},this.leadingNodes),this.trailingNodes.length?n("div",{class:"mana-app-statusbar-trailing"},this.trailingNodes):null]))}}d(os,"observedAttributes",[]);class ls extends E{constructor(){super(...arguments);d(this,"_groups",null);d(this,"collapsed",new Set);d(this,"query","")}get groups(){return this._groups??N(this,"groups",[])}set groups(t){this._groups=t,this.mounted&&this.render()}render(){const t=this.getAttribute("active-id")??"",s=this.hasAttribute("searchable"),a=this.query.trim().toLowerCase(),r=a?this.groups.map(c=>({...c,items:c.items.filter(h=>h.label.toLowerCase().includes(a))})).filter(c=>c.items.length>0):this.groups,o=n("nav",{class:"mana-app-sidebar","aria-label":this.getAttribute("aria-label")??"Navigation"});if(s){const c=document.createElement("mana-search-bar");c.setAttribute("size","sm"),c.setAttribute("placeholder",this.getAttribute("search-placeholder")??"Filter…"),c.setAttribute("value",this.query),c.addEventListener("input",h=>{h.stopPropagation(),this.query=h.detail.value,this.render()}),o.append(n("div",{class:"mana-app-sidebar-search"},[c]))}const l=n("div",{class:"mana-scroller mana-app-sidebar-scroller","data-orientation":"vertical","data-variant":"thin","data-fade":""});for(const c of r){const h=!!(c.collapsible&&this.collapsed.has(c.id)&&!a),m=n("section",{class:"mana-app-sidebar-group","data-collapsed":h?"true":void 0});if(c.label){const u=n("div",{class:"mana-app-sidebar-group-header"});if(c.collapsible){const b=n("button",{type:"button",class:"mana-app-sidebar-group-toggle","aria-expanded":String(!h)},[n("span",{class:"mana-app-sidebar-group-caret","aria-hidden":"true"},[T([...C.chevronDown],12)]),n("span",{class:"mana-text-body-xs-medium"},[c.label])]);b.addEventListener("click",()=>{this.collapsed.has(c.id)?this.collapsed.delete(c.id):this.collapsed.add(c.id),this.render()}),u.append(b)}else u.append(n("span",{class:"mana-app-sidebar-group-label mana-text-body-xs-medium"},[c.label]));m.append(u)}if(!h){const u=n("ul",{class:"mana-app-sidebar-list"});for(const b of c.items){const f=b.id===t,g=n("button",{type:"button",class:"mana-app-sidebar-item",disabled:!!b.disabled,"data-active":f?"true":void 0,"data-variant":b.variant??"default","aria-current":f?"page":void 0},[n("span",{class:"mana-app-sidebar-item-label mana-text-body-sm-medium"},[b.label]),b.badge?n("span",{class:"mana-app-sidebar-item-badge"},[b.badge]):null]);g.addEventListener("click",()=>{b.disabled||(this.setAttribute("active-id",b.id),v(this,"select",{id:b.id,item:b}))}),u.append(n("li",{},[g]))}m.append(u)}l.append(m)}o.append(l),this.replaceChildren(o)}}d(ls,"observedAttributes",["groups","active-id","searchable","search-placeholder","aria-label"]);class cs extends E{constructor(){super(...arguments);d(this,"_actions",null)}get actions(){return this._actions??N(this,"actions",[])}set actions(t){this._actions=t,this.mounted&&this.render()}render(){const t=this.getAttribute("title")??"",s=this.getAttribute("topic"),a=this.hasAttribute("searchable"),r=n("div",{class:"mana-header-bar-leading"},[n("h1",{class:"mana-header-bar-title mana-text-heading-sm-semibold mana-heading-default-color"},[t]),s?n("span",{class:"mana-header-bar-divider","aria-hidden":"true"}):null,s?n("span",{class:"mana-header-bar-topic mana-text-body-sm-normal"},[s]):null]),o=n("div",{class:"mana-header-bar-trailing"});for(const l of this.actions){const c=n("button",{type:"button",class:"mana-header-bar-action","aria-label":l.label,"aria-pressed":l.active!=null?String(l.active):void 0,"data-active":l.active?"true":void 0},[n("span",{class:"mana-text-body-xs-semibold"},[l.label.slice(0,1)]),l.dot?n("span",{class:"mana-header-bar-action-dot","aria-hidden":"true"}):null]);c.addEventListener("click",()=>v(this,"action",{id:l.id,action:l})),o.append(c)}if(a){const l=document.createElement("mana-search-bar");l.setAttribute("size","sm"),l.setAttribute("placeholder",this.getAttribute("search-placeholder")??"Search"),l.addEventListener("input",c=>{c.stopPropagation(),v(this,"search",c.detail)}),o.append(n("div",{class:"mana-header-bar-search"},[l]))}this.replaceChildren(n("header",{class:"mana-header-bar"},[r,o]))}}d(cs,"observedAttributes",["title","topic","searchable","search-placeholder","actions"]);class ds extends E{constructor(){super(...arguments);d(this,"_items",null);d(this,"expandedFolders",new Set)}get items(){return this._items??N(this,"items",[])}set items(t){this._items=t,this.mounted&&this.render()}renderItem(t,s){const a=t.id===s,r=n("button",{type:"button",class:"mana-guild-btn","aria-label":t.name,"aria-current":a?"page":void 0,"data-active":a?"true":void 0,"data-action":t.action?"true":void 0},[t.iconSrc?n("img",{src:t.iconSrc,alt:""}):n("span",{},[t.acronym??Ot(t.name)])]);return t.color&&!a&&(r.style.backgroundColor=t.color,r.style.color="var(--white)"),r.addEventListener("click",()=>{t.action||this.setAttribute("active-id",t.id),v(this,"select",{id:t.id,item:t})}),n("div",{class:"mana-guild-item","data-active":a?"true":void 0,"data-unread":!a&&(t.unread||(t.mentions??0)>0)?"true":void 0},[t.action?null:n("span",{class:"mana-guild-pill","aria-hidden":"true"},[n("span",{class:"mana-guild-pill-bar"})]),r,t.mentions&&t.mentions>0?n("span",{class:"mana-guild-badge","aria-label":`${t.mentions} mentions`},[(()=>{const l=document.createElement("mana-number-badge");return l.setAttribute("count",String(t.mentions)),l})()]):null])}render(){const t=this.getAttribute("active-id")??"",s=n("nav",{class:"mana-guild-rail","aria-label":this.getAttribute("aria-label")??"Servers"}),a=n("div",{class:"mana-guild-rail-scroller"});this.hasAttribute("has-dock")&&(a.style.paddingBottom="72px");for(const r of this.items)if(r.type==="folder"){const o=this.expandedFolders.has(r.id),l=n("div",{class:"mana-guild-folder","data-expanded":o?"true":void 0});r.color&&l.style.setProperty("--mana-folder-color",r.color);const c=n("button",{type:"button",class:"mana-guild-folder-btn","aria-label":r.name,"aria-expanded":String(o)},[o?T([...C.folder],18):n("span",{class:"mana-guild-folder-preview","aria-hidden":"true"},r.items.slice(0,4).map(h=>n("span",{class:"mana-guild-folder-mini"},[(h.acronym??Ot(h.name)).slice(0,2)])))]);c.addEventListener("click",()=>{this.expandedFolders.has(r.id)?this.expandedFolders.delete(r.id):this.expandedFolders.add(r.id),this.render()}),l.append(n("div",{class:"mana-guild-folder-bg","aria-hidden":"true"}),n("div",{class:"mana-guild-item"},[c])),o&&l.append(n("div",{class:"mana-guild-folder-items",role:"group","aria-label":r.name},r.items.map(h=>this.renderItem(h,t)))),a.append(l)}else a.append(this.renderItem(r,t));s.append(a),this.replaceChildren(s)}}d(ds,"observedAttributes",["items","active-id","has-dock","aria-label"]);class hs extends E{constructor(){super(...arguments);d(this,"_categories",null);d(this,"collapsed",new Set)}get categories(){return this._categories??N(this,"categories",[])}set categories(t){this._categories=t,this.mounted&&this.render()}render(){const t=this.getAttribute("title")??"",s=this.getAttribute("active-channel-id")??"",a=n("aside",{class:"mana-channel-sidebar","aria-label":this.getAttribute("aria-label")??"Channels"});a.append(n("div",{class:"mana-channel-sidebar-header"},[n("span",{class:"mana-channel-sidebar-title-wrap"},[n("span",{class:"mana-channel-sidebar-title mana-text-heading-sm-semibold"},[t])])]));const r=n("div",{class:"mana-scroller mana-channel-sidebar-scroller","data-orientation":"vertical","data-variant":"thin","data-fade":""});for(const o of this.categories){const l=this.collapsed.has(o.id),c=n("section",{class:"mana-sidebar-category","data-collapsed":l?"true":void 0}),h=n("button",{type:"button",class:"mana-sidebar-category-toggle","aria-expanded":String(!l)},[n("span",{class:"mana-sidebar-category-caret","aria-hidden":"true"},[T([...C.chevronDown],12)]),n("span",{class:"mana-text-body-xs-semibold"},[o.label])]);h.addEventListener("click",()=>{this.collapsed.has(o.id)?this.collapsed.delete(o.id):this.collapsed.add(o.id),this.render()}),c.append(n("div",{class:"mana-sidebar-category-header"},[h]));const m=l?o.channels.filter(b=>b.id===s||b.unread):o.channels,u=n("ul",{class:"mana-sidebar-channel-list"});for(const b of m){const f=b.id===s,g=b.kind==="voice"?C.voice:C.hash,A=n("button",{type:"button",class:"mana-sidebar-channel","data-active":f?"true":void 0,"data-unread":!f&&b.unread?"true":void 0,"data-muted":b.muted?"true":void 0,"aria-current":f?"page":void 0},[n("span",{class:"mana-sidebar-channel-icon","aria-hidden":"true"},[T([...g],18)]),n("span",{class:"mana-sidebar-channel-name mana-text-body-md-medium"},[b.name])]);A.addEventListener("click",()=>{this.setAttribute("active-channel-id",b.id),v(this,"select",{channelId:b.id,channel:b})}),u.append(n("li",{},[A]))}c.append(u),r.append(c)}a.append(r),this.replaceChildren(a)}}d(hs,"observedAttributes",["title","categories","active-channel-id","aria-label"]);class us extends E{render(){const i=this.getAttribute("name")??"User",t=this.getAttribute("status")??"online",s=this.getAttribute("status-text")??t,a=this.getAttribute("avatar-src"),r=this.hasAttribute("muted"),o=this.hasAttribute("deafened"),l=n("button",{type:"button",class:"mana-user-dock-profile"},[n("span",{class:"mana-user-dock-avatar-wrap"},[n("span",{class:"mana-user-dock-avatar","aria-hidden":"true"},[a?n("img",{src:a,alt:""}):Ot(i)]),n("span",{class:"mana-user-dock-status-dot","data-status":t})]),n("span",{class:"mana-user-dock-identity"},[n("span",{class:"mana-user-dock-name mana-text-body-sm-semibold mana-heading-default-color"},[i]),n("span",{class:"mana-user-dock-subtext mana-text-body-xs-normal"},[s])])]);l.addEventListener("click",()=>v(this,"profile-click"));const c=n("button",{type:"button",class:"mana-user-dock-ctrl-btn","aria-label":r?"Unmute":"Mute","aria-pressed":String(r),"data-active":r?"true":void 0},[T([...r?C.micOff:C.mic],18)]);c.addEventListener("click",()=>{k(this,"muted",!r,""),v(this,"mute-toggle",{muted:!r})});const h=n("button",{type:"button",class:"mana-user-dock-ctrl-btn","aria-label":o?"Undeafen":"Deafen","aria-pressed":String(o),"data-active":o?"true":void 0},[T([...C.headphones],18)]);h.addEventListener("click",()=>{k(this,"deafened",!o,""),v(this,"deafen-toggle",{deafened:!o})});const m=n("button",{type:"button",class:"mana-user-dock-ctrl-btn","aria-label":"User Settings"},[T([...C.settings],18)]);m.addEventListener("click",()=>v(this,"settings-click")),this.replaceChildren(n("section",{class:"mana-user-dock","aria-label":"User area"},[n("div",{class:"mana-user-dock-main"},[l,n("div",{class:"mana-user-dock-controls"},[c,h,m])])]))}}d(us,"observedAttributes",["name","username","status","status-text","avatar-src","muted","deafened"]);class ms extends E{constructor(){super(...arguments);d(this,"_groups",null)}get groups(){return this._groups??N(this,"groups",[])}set groups(t){this._groups=t,this.mounted&&this.render()}render(){const t=n("div",{class:"mana-member-list",role:"region","aria-label":this.getAttribute("aria-label")??"Members"});for(const s of this.groups){const a=n("ul",{class:"mana-member-group-items"});for(const r of s.items){const o=r.status??"online",l=o==="offline",c=n("span",{class:"mana-user-dock-avatar","aria-hidden":"true"},[r.avatarSrc?n("img",{src:r.avatarSrc,alt:""}):r.avatarFallback??Ot(r.name)]);r.avatarColor&&(c.style.backgroundColor=r.avatarColor);const h=n("span",{class:"mana-member-name mana-text-body-sm-medium"},[r.name]);r.nameColor&&(h.style.color=r.nameColor);const m=n("button",{type:"button",class:"mana-member-row","data-offline":l?"true":void 0},[n("span",{class:"mana-user-dock-avatar-wrap"},[c,l?null:n("span",{class:"mana-user-dock-status-dot","data-status":o,"aria-hidden":"true"})]),n("span",{class:"mana-member-info"},[n("span",{class:"mana-member-name-row"},[h]),r.subtitle?n("span",{class:"mana-member-subtext mana-text-body-xs-normal"},[r.subtitle]):null])]);m.addEventListener("click",()=>v(this,"select",{member:r})),a.append(n("li",{},[m]))}t.append(n("section",{class:"mana-member-group","aria-label":s.label},[n("div",{class:"mana-member-group-header"},[`${s.label} — ${s.count??s.items.length}`]),a]))}this.replaceChildren(t)}}d(ms,"observedAttributes",["groups","aria-label"]);class ps extends E{render(){const i=this.getAttribute("label")??"APP",t=this.hasAttribute("verified");this.className="botTag_feVUtO botTagRegular_feVUtO rem_feVUtO botTag_2i8Bfm botTagCozy_2i8Bfm";const s=[];t&&s.push(S("svg",{class:"botTagVerified_feVUtO","aria-label":"Verified App",width:16,height:16,viewBox:"0 0 16 15.2"},[S("path",{d:"M7.4,11.17,4,8.62,5,7.26l2,1.53L10.64,4l1.36,1Z",fill:"currentColor"})])),s.push(n("span",{class:"botText_feVUtO"},[i])),this.replaceChildren(...s)}}d(ps,"observedAttributes",["label","verified"]);class bs extends E{constructor(){super(...arguments);d(this,"onKeyDown",t=>{this.hasAttribute("clickable")&&O(t)&&(t.preventDefault(),this.click())})}onConnect(){this.addEventListener("keydown",this.onKeyDown)}onDisconnect(){this.removeEventListener("keydown",this.onKeyDown)}render(){const t=this.getAttribute("label")??"",s=this.getAttribute("icon-src"),a=this.hasAttribute("clickable");this.className=`chipletContainerInner_k8jyN7 chipletContainerInline_k8jyN7 clanTagChiplet_2i8Bfm${a?" clickable_k8jyN7":""}`,a?(this.setAttribute("role","button"),this.setAttribute("tabindex","0")):(this.removeAttribute("role"),this.removeAttribute("tabindex")),this.replaceChildren(n("span",{class:"text_k8jyN7"},[s?n("span",{class:"badge_k8jyN7","aria-hidden":"true"},[n("img",{src:s,alt:"",width:12,height:12})]):null,n("span",{class:"tagText_k8jyN7"},[t])]))}}d(bs,"observedAttributes",["label","icon-src","clickable"]);class fs extends E{render(){const i=this.getAttribute("label"),t=this.hasAttribute("unread"),s=this.getAttribute("unread-label")??"new",a=n("div",{role:"separator",class:["divider_4TfzT5",t?"isUnread_4TfzT5":"",i?"hasContent_4TfzT5":""].filter(Boolean).join(" ")},[i?n("span",{class:"content_4TfzT5"},[i]):null,t?n("span",{class:"unreadPill_4TfzT5 endCap_4TfzT5"},[S("svg",{class:"unreadPillCap_4TfzT5",width:8,height:13,viewBox:"0 0 8 13","aria-hidden":"true"},[S("path",{class:"unreadPillCapStroke_4TfzT5",stroke:"currentColor",fill:"transparent",d:"M8.16639 0.5H9C10.933 0.5 12.5 2.067 12.5 4V9C12.5 10.933 10.933 12.5 9 12.5H8.16639C7.23921 12.5 6.34992 12.1321 5.69373 11.4771L0.707739 6.5L5.69373 1.52292C6.34992 0.86789 7.23921 0.5 8.16639 0.5Z"})]),s]):null]);this.replaceChildren(a)}}d(fs,"observedAttributes",["label","unread","unread-label"]);class gs extends E{constructor(){super(...arguments);d(this,"innerEl",null)}onConnect(){if(!this.innerEl){const t=Array.from(this.childNodes);this.innerEl=n("div",{role:"list",class:"cv-message-list-inner"});for(const s of t)this.innerEl.append(s);this.append(n("div",{class:"cv-message-list",role:"log","aria-label":this.getAttribute("aria-label")??"Messages"},[this.innerEl]))}}render(){const t=this.querySelector(".cv-message-list");t&&t.setAttribute("aria-label",this.getAttribute("aria-label")??"Messages")}}d(gs,"observedAttributes",["aria-label"]);class vs extends E{constructor(){super(...arguments);d(this,"_reactions",null);d(this,"badgeNodes",[]);d(this,"accessoryNodes",[]);d(this,"captured",!1)}get reactions(){return this._reactions??N(this,"reactions",[])}set reactions(t){this._reactions=t,this.mounted&&this.render()}onConnect(){if(!this.captured){this.captured=!0;for(const t of Array.from(this.childNodes)){const s=t instanceof HTMLElement?t.getAttribute("slot"):null;s==="badges"?this.badgeNodes.push(t):s==="accessory"&&this.accessoryNodes.push(t)}}}render(){const t=this.getAttribute("author")??"User",s=this.getAttribute("author-color"),a=this.getAttribute("avatar-src")??ti(t),r=this.getAttribute("timestamp"),o=this.getAttribute("iso-timestamp"),l=this.getAttribute("compact-timestamp")??r,c=this.hasAttribute("grouped"),h=this.hasAttribute("mentioned"),m=this.hasAttribute("selected"),u=this.hasAttribute("edited"),b=this.getAttribute("content")??"",f=this.getAttribute("reply-author"),g=this.getAttribute("reply-preview"),A=this.reactions,y=this.hasAttribute("show-add-reaction"),w=!c||!!f,x=n("div",{class:"contents_2i8Bfm"});if(w){const D=n("img",{src:a,alt:" ","aria-hidden":"true",class:"avatar_2i8Bfm clickable_2i8Bfm"});D.addEventListener("click",()=>v(this,"author-click",{author:t}));const I=n("span",{class:"username_2i8Bfm clickable_2i8Bfm"},[t]);s&&(I.style.color=s),I.addEventListener("click",()=>v(this,"author-click",{author:t}));const M=n("span",{class:"headerText_2i8Bfm"},[I,...this.badgeNodes]),$=n("h3",{class:"header_2i8Bfm"},[M,r?n("span",{class:"timestamp_2i8Bfm timestampInline_2i8Bfm"},[n("time",{datetime:o??void 0},[n("i",{class:"separator_2i8Bfm","aria-hidden":"true"},[" — "]),r])]):null]);x.append(D,$)}else l&&x.append(n("span",{class:"timestamp_2i8Bfm alt_2i8Bfm timestampVisibleOnHover_2i8Bfm","data-slot":"timestamp-alt"},[n("time",{datetime:o??void 0},[n("i",{class:"separator_2i8Bfm","aria-hidden":"true"},["["]),l,n("i",{class:"separator_2i8Bfm","aria-hidden":"true"},["]"])])]));const L=n("div",{class:"markup_ku1OHH messageContent_2i8Bfm"},[b,u?n("span",{class:"timestamp_2i8Bfm timestampInline_2i8Bfm"},[n("time",{},[n("span",{class:"edited_2i8Bfm"},["(edited)"])])]):null]);x.append(L);const _=[];if(f&&_.push(n("div",{class:"repliedMessage_2i8Bfm messageSpine_2i8Bfm"},[n("img",{src:ti(f),alt:" ","aria-hidden":"true",class:"replyAvatar_2i8Bfm"}),n("span",{class:"username_2i8Bfm"},[`@${f}`]),g?n("span",{class:"repliedTextPreview_2i8Bfm"},[n("span",{class:"repliedTextContent_2i8Bfm"},[g])]):null])),_.push(x),this.accessoryNodes.length>0||A.length>0||y){const D=n("div",{class:"container_YUQhib"},this.accessoryNodes);if(A.length>0||y){const I=n("div",{class:"reactions_UNkajC",role:"group","aria-label":"Reactions"});for(const M of A){const $=Math.max(1,Math.ceil(Math.log10(Math.max(1,M.count)+1)))*12,R=n("img",{class:"emoji",src:Sa(M.emoji),alt:M.emoji,draggable:"false"});R.addEventListener("error",()=>R.replaceWith(n("span",{class:"emoji-text"},[M.emoji])));const Et=n("div",{class:"reactionCount_UNkajC"},[String(M.count)]);Et.style.minWidth=`${$}px`;const ht=n("div",{role:"button",tabindex:0,"aria-pressed":String(!!M.active),class:`reaction_UNkajC reactionInner_UNkajC${M.active?" reactionMe_UNkajC":""}`},[R,Et]),yt=()=>v(this,"reaction-click",{reaction:M});ht.addEventListener("click",yt),ht.addEventListener("keydown",F=>{O(F)&&(F.preventDefault(),yt())}),I.append(ht)}if(y){const M=n("div",{role:"button",tabindex:0,"aria-label":"Add Reaction",class:"reactionBtn_UNkajC"},[T([...C.reactionPlus],18,"0 0 24 24","icon_UNkajC")]),$=()=>v(this,"add-reaction");M.addEventListener("click",$),M.addEventListener("keydown",R=>{O(R)&&(R.preventDefault(),$())}),I.append(M)}D.append(I)}_.push(D)}const W=n("div",{role:"listitem",class:"cv-message","data-group-start":w?"true":void 0,"data-mentioned":h?"true":void 0,"data-selected":m?"true":void 0},[n("div",{class:`wrapper_2i8Bfm cozy_2i8Bfm zalgo_2i8Bfm${f?" hasReply_2i8Bfm":""}`,role:"article",tabindex:-1},_)]);this.replaceChildren(W)}}d(vs,"observedAttributes",["author","author-color","avatar-src","timestamp","iso-timestamp","compact-timestamp","grouped","mentioned","selected","edited","content","reply-author","reply-preview","reactions","show-add-reaction"]);class As extends E{constructor(){super(...arguments);d(this,"areaEl",null)}get value(){return this.areaEl?this.areaEl.value:this.getAttribute("value")??""}set value(t){this.setAttribute("value",t),this.areaEl&&(this.areaEl.value=t)}render(){const t=this.getAttribute("value")??"",s=this.getAttribute("placeholder")??"Message…",a=this.hasAttribute("disabled"),r=this.getAttribute("reply-author"),o=this.getAttribute("show-send-button")!=="false",l=n("textarea",{rows:1,class:"mana-composer-input",placeholder:s,"aria-label":s,disabled:a});l.value=t,this.areaEl=l;const c=n("button",{type:"button",class:"mana-composer-btn","aria-label":"Send message",disabled:a||!t.trim()},[T([...C.send],16)]),h=()=>{const u=l.value.trim();!u||a||(v(this,"submit",{value:u}),l.value="",this.setAttribute("value",""),c.disabled=!0)};l.addEventListener("input",()=>{c.disabled=a||!l.value.trim(),v(this,"input",{value:l.value})}),l.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),h())}),c.addEventListener("click",h);const m=[];if(r){const u=n("button",{type:"button",class:"mana-composer-btn","aria-label":"Cancel reply"},[T([...C.x],14)]);u.addEventListener("click",()=>v(this,"reply-cancel")),m.push(n("div",{class:"mana-composer-reply-bar"},[n("span",{class:"mana-text-body-xs-medium"},["Replying to ",n("strong",{},[`@${r}`])]),u]))}m.push(n("div",{class:"mana-composer-row"},[l,n("div",{class:"mana-composer-trailing"},[o?c:null])])),this.replaceChildren(n("div",{class:"mana-composer-wrap"},[n("div",{class:"mana-composer"},m)]))}}d(As,"observedAttributes",["value","placeholder","disabled","reply-author","show-send-button"]);class Es extends E{constructor(){super(...arguments);d(this,"_fields",null)}get fields(){return this._fields??N(this,"fields",[])}set fields(t){this._fields=t,this.mounted&&this.render()}render(){const t=this.getAttribute("title"),s=this.getAttribute("description"),a=this.getAttribute("url"),r=this.getAttribute("color"),o=this.getAttribute("provider"),l=this.getAttribute("author-name"),c=this.getAttribute("author-icon"),h=this.getAttribute("footer"),m=this.getAttribute("footer-icon"),u=this.getAttribute("timestamp"),b=this.getAttribute("thumbnail-src"),f=this.getAttribute("image-src"),g=this.fields,A=n("div",{class:"grid_XyW1ZT"});if(o&&A.append(n("div",{class:"embedProvider_XyW1ZT embedMargin_XyW1ZT"},[o])),l&&A.append(n("div",{class:"embedAuthor_XyW1ZT embedMargin_XyW1ZT"},[c?n("img",{class:"embedAuthorIcon_XyW1ZT",src:c,alt:""}):null,n("span",{class:"embedAuthorName_XyW1ZT"},[l])])),t&&A.append(n("div",{class:"embedTitle_XyW1ZT embedMargin_XyW1ZT"},[a?n("a",{class:"embedTitleLink_XyW1ZT",href:a,target:"_blank",rel:"noopener noreferrer"},[t]):t])),s&&A.append(n("div",{class:"embedDescription_XyW1ZT embedMargin_XyW1ZT"},[s])),g.length>0){const w=n("div",{class:"embedFields_XyW1ZT"});for(const x of g){const L=n("div",{class:"embedField_XyW1ZT"},[n("div",{class:"embedFieldName_XyW1ZT"},[x.name]),n("div",{class:"embedFieldValue_XyW1ZT"},[x.value])]);L.style.gridColumn=x.inline?"span 4":"1 / -1",w.append(L)}A.append(w)}b&&A.append(n("div",{class:"embedThumbnail_XyW1ZT"},[n("img",{src:b,alt:"",style:"max-width:80px;max-height:80px;border-radius:4px"})])),f&&A.append(n("div",{class:"embedMedia_XyW1ZT embedImage_XyW1ZT"},[n("img",{src:f,alt:"",style:"max-width:100%;border-radius:4px"})])),(h||u)&&A.append(n("div",{class:"embedFooter_XyW1ZT embedMargin_XyW1ZT"},[m?n("img",{class:"embedFooterIcon_XyW1ZT",src:m,alt:""}):null,n("span",{class:"embedFooterText_XyW1ZT"},[h??"",h&&u?n("span",{class:"embedFooterSeparator_XyW1ZT"},["•"]):null,u??""])]));const y=n("article",{class:"embedFull_XyW1ZT embed_XyW1ZT markup_ku1OHH"},[n("div",{class:"gridContainer_XyW1ZT"},[A])]);r&&(y.style.borderColor=r),this.replaceChildren(y)}}d(Es,"observedAttributes",["title","description","url","color","provider","author-name","author-icon","footer","footer-icon","timestamp","thumbnail-src","image-src","fields"]);class ys extends E{constructor(){super(...arguments);d(this,"_sections",null);d(this,"query","")}get sections(){return this._sections??N(this,"sections",[])}set sections(t){this._sections=t,this.mounted&&this.render()}render(){const t=this.hasAttribute("inline");if(!(this.hasAttribute("open")||t)){this.replaceChildren();return}const a=this.sections,r=a.flatMap(g=>g.items),o=this.getAttribute("active-id")??r[0]?.id??"",l=r.find(g=>g.id===o),c=this.query.trim().toLowerCase(),h=n("aside",{class:"mana-settings-sidebar"});if(this.hasAttribute("searchable")){const g=document.createElement("mana-search-bar");g.setAttribute("size","sm"),g.setAttribute("placeholder","Search"),g.setAttribute("value",this.query),g.addEventListener("input",A=>{A.stopPropagation(),this.query=A.detail.value,this.render()}),h.append(n("div",{class:"mana-settings-search"},[g]))}const m=n("nav",{class:"mana-settings-nav"});for(const g of a){const A=c?g.items.filter(y=>y.label.toLowerCase().includes(c)):g.items;if(A.length){g.label&&m.append(n("div",{class:"mana-settings-section-label mana-text-body-xs-semibold"},[g.label]));for(const y of A){const w=y.id===o,x=n("button",{type:"button",class:"mana-settings-item","data-active":w?"true":void 0,"aria-current":w?"page":void 0},[n("span",{class:"mana-text-body-md-medium"},[y.label])]);x.addEventListener("click",()=>{this.setAttribute("active-id",y.id),v(this,"section-change",{id:y.id,item:y})}),m.append(x)}}}h.append(m);const u=document.createElement("mana-close-button");u.addEventListener("click",()=>{this.removeAttribute("open"),v(this,"close")});const b=n("div",{class:"mana-settings-content"},[n("div",{class:"mana-settings-content-header"},[n("h2",{class:"mana-text-heading-lg-semibold mana-heading-default-color"},[l?.label??"Settings"]),u]),n("div",{class:"mana-settings-content-body mana-text-body-md-normal"},[l?.content??""])]);if(this.hasAttribute("unsaved")){const g=document.createElement("mana-text-button");g.setAttribute("variant","secondary"),g.textContent="Reset",g.addEventListener("click",()=>v(this,"reset"));const A=document.createElement("mana-button");A.setAttribute("variant","active"),A.setAttribute("size","sm"),A.textContent="Save Changes",A.addEventListener("click",()=>v(this,"save")),b.append(n("div",{class:"mana-settings-save-notice"},[n("div",{class:"mana-settings-save-flex"},[n("span",{class:"mana-settings-save-message mana-text-body-sm-medium"},["Careful — you have unsaved changes!"]),n("div",{class:"mana-settings-save-actions"},[g,A])])]))}const f=n("div",{class:"mana-settings-modal","data-mana-component":"layer-modal",role:"dialog","aria-modal":t?void 0:"true","aria-label":this.getAttribute("aria-label")??"Settings"},[n("div",{class:"mana-settings-layout"},[h,b])]);if(t)this.replaceChildren(f);else{const g=n("div",{class:"mana-modal-backdrop"},[n("div",{class:"mana-modal-outer"},[f])]);g.addEventListener("click",A=>{A.target===g&&(this.removeAttribute("open"),v(this,"close"))}),this.replaceChildren(g)}}}d(ys,"observedAttributes",["open","inline","sections","active-id","searchable","unsaved","aria-label"]);const ei={"mana-provider":Jt,"mana-text":te,"mana-heading":ee,"mana-badge":se,"mana-chip":ie,"mana-indicator-dot":ae,"mana-stack":ne,"mana-gradient":re,"mana-graphic":oe,"mana-field":le,"mana-fieldset":ce,"mana-hidden-visually":de,"mana-button":he,"mana-button-group":ue,"mana-text-button":me,"mana-toggle-button":pe,"mana-toggle-icon-button":be,"mana-icon-button":fe,"mana-close-button":ge,"mana-toolbar":ve,"mana-toolbar-group":Ae,"mana-toolbar-separator":Ee,"mana-checkbox":ye,"mana-checkbox-group":we,"mana-radio-group":xe,"mana-switch":ke,"mana-text-input":Le,"mana-text-area":Ce,"mana-search-bar":_e,"mana-number-input":Te,"mana-slider":Se,"mana-tag":Me,"mana-tag-group":De,"mana-listbox":Ne,"mana-select":Be,"mana-combobox":Re,"mana-tabs":Oe,"mana-calendar":Ie,"mana-range-calendar":Pe,"mana-date-picker":We,"mana-modal":$e,"mana-confirm-modal":He,"mana-layer-modal":ze,"mana-popover":Ke,"mana-tooltip":Fe,"mana-global-banner":Ye,"mana-inline-notice":Ue,"mana-countdown":Ze,"mana-progress-bar":Xe,"mana-toast":Ve,"mana-toast-container":qe,"mana-spinner":je,"mana-divider":Ge,"mana-card":Qe,"mana-anchor":Je,"mana-number-badge":ts,"mana-progress-circle":es,"mana-scroller":ss,"mana-table":is,"mana-menu":as,"mana-app-shell":ns,"mana-app-top-bar":rs,"mana-app-status-bar":os,"mana-app-sidebar":ls,"mana-header-bar":cs,"mana-guild-rail":ds,"mana-channel-sidebar":hs,"mana-user-dock":us,"mana-member-list":ms,"mana-app-tag":ps,"mana-server-tag":bs,"mana-message-divider":fs,"mana-message-list":gs,"mana-message":vs,"mana-message-composer":As,"mana-embed":Es,"mana-settings-modal":ys};function si(){if(!(typeof customElements>"u"))for(const[e,i]of Object.entries(ei))customElements.get(e)||customElements.define(e,i)}return typeof window<"u"&&typeof customElements<"u"&&si(),p.Announcer=ci,p.DEFAULT_MANA_I18N=oi,p.DENSITIES=nt,p.MANA_ELEMENTS=ei,p.MOTION=ai,p.ManaAnchorElement=Je,p.ManaAppShellElement=ns,p.ManaAppSidebarElement=ls,p.ManaAppStatusBarElement=os,p.ManaAppTagElement=ps,p.ManaAppTopBarElement=rs,p.ManaBadgeElement=se,p.ManaButtonElement=he,p.ManaButtonGroupElement=ue,p.ManaCalendarElement=Ie,p.ManaCardElement=Qe,p.ManaChannelSidebarElement=hs,p.ManaCheckboxElement=ye,p.ManaCheckboxGroupElement=we,p.ManaChipElement=ie,p.ManaCloseButtonElement=ge,p.ManaComboBoxElement=Re,p.ManaConfirmModalElement=He,p.ManaCountdownElement=Ze,p.ManaDatePickerElement=We,p.ManaDividerElement=Ge,p.ManaEmbedElement=Es,p.ManaFieldElement=le,p.ManaFieldSetElement=ce,p.ManaGlobalBannerElement=Ye,p.ManaGradientElement=re,p.ManaGraphicElement=oe,p.ManaGuildRailElement=ds,p.ManaHeaderBarElement=cs,p.ManaHeadingElement=ee,p.ManaHiddenVisuallyElement=de,p.ManaIconButtonElement=fe,p.ManaIndicatorDotElement=ae,p.ManaInlineNoticeElement=Ue,p.ManaLayerModalElement=ze,p.ManaListBoxElement=Ne,p.ManaMemberListElement=ms,p.ManaMenuElement=as,p.ManaMessageComposerElement=As,p.ManaMessageDividerElement=fs,p.ManaMessageElement=vs,p.ManaMessageListElement=gs,p.ManaModalElement=$e,p.ManaNumberBadgeElement=ts,p.ManaNumberInputElement=Te,p.ManaPopoverElement=Ke,p.ManaProgressBarElement=Xe,p.ManaProgressCircleElement=es,p.ManaProviderElement=Jt,p.ManaRadioGroupElement=xe,p.ManaRangeCalendarElement=Pe,p.ManaScrollerElement=ss,p.ManaSearchBarElement=_e,p.ManaSelectElement=Be,p.ManaServerTagElement=bs,p.ManaSettingsModalElement=ys,p.ManaSliderElement=Se,p.ManaSpinnerElement=je,p.ManaStackElement=ne,p.ManaSwitchElement=ke,p.ManaTableElement=is,p.ManaTabsElement=Oe,p.ManaTagElement=Me,p.ManaTagGroupElement=De,p.ManaTextAreaElement=Ce,p.ManaTextButtonElement=me,p.ManaTextElement=te,p.ManaTextInputElement=Le,p.ManaToastContainerElement=qe,p.ManaToastElement=Ve,p.ManaToggleButtonElement=pe,p.ManaToggleIconButtonElement=be,p.ManaToolbarElement=ve,p.ManaToolbarGroupElement=Ae,p.ManaToolbarSeparatorElement=Ee,p.ManaTooltipElement=Fe,p.ManaUserDockElement=us,p.ModalTransitionState=Ms,p.RADII=ii,p.THEMES=Y,p.TYPOGRAPHY_VARIANTS=ni,p.ToastContextMap=ui,p.WEEKDAY_LABELS=Qt,p.addMonths=At,p.applyThemeAttributes=xs,p.clearToasts=fi,p.closeAllModals=Ei,p.closeModal=Ai,p.compareDates=dt,p.computeFloatingPosition=it,p.createToast=mi,p.cx=Qs,p.daysInMonth=js,p.dismissToast=_s,p.firstWeekdayOfMonth=Gs,p.floatingAutoUpdate=ca,p.focusFirstOrContainer=ks,p.focusLockStack=xt,p.formatCalendarDate=Rt,p.formatMonthYear=qt,p.getBasePlacement=Vt,p.getModals=Ds,p.getMonthGrid=Gt,p.getTabbableElements=Pt,p.getThemeClasses=ri,p.getToastQueues=Ts,p.isDateOutOfBounds=jt,p.isFocusLockActive=hi,p.isSameDate=Bt,p.kebabCase=Js,p.openModal=vi,p.popToast=bi,p.registerManaElements=si,p.resolveColorCss=It,p.showToast=pi,p.subscribeModals=yi,p.subscribeToasts=Ss,p.toFloatingPlacement=fa,p.todayDate=vt,p.variantToSlug=ut,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),p})({});
2
2
  //# sourceMappingURL=mana-elements.min.js.map