@webority/ui-elements 0.161.0 → 0.164.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 (211) hide show
  1. package/README.md +4 -4
  2. package/THIRD-PARTY-NOTICES.txt +1 -1
  3. package/dist/WuiCodeBlock-7O514Hqe.js +1 -0
  4. package/dist/{WuiCommandPalette-Dpz0DXKJ.js → WuiCommandPalette-rVScJ2Hy.js} +2 -2
  5. package/dist/WuiCommentThread-5Uz83s1Y.js +1 -0
  6. package/dist/WuiContextMenu-_ZeequGf.js +1 -0
  7. package/dist/WuiDataTable-Bb5hxTfn.js +1 -0
  8. package/dist/WuiDatePicker-BF_GVNaj.js +31 -0
  9. package/dist/WuiDateRange-B6xh25qZ.js +25 -0
  10. package/dist/WuiDrawer-BGuq6FAZ.js +1 -0
  11. package/dist/WuiDropdown-DVTtANwz.js +1 -0
  12. package/dist/WuiHoverCard-FL38ANLM.js +1 -0
  13. package/dist/WuiInlineEdit-DMK1ESdx.js +1 -0
  14. package/dist/WuiLightbox-BUD0uefB.js +1 -0
  15. package/dist/WuiMarkdown-B7nfQ6tW.js +4 -0
  16. package/dist/WuiMentionInput-Bo9bhe3U.js +1 -0
  17. package/dist/WuiModal-DvSt_466.js +1 -0
  18. package/dist/WuiNavigationMenu-Dlo-n-cL.js +1 -0
  19. package/dist/WuiNotificationCenter-DP-Sf4FQ.js +1 -0
  20. package/dist/WuiOverflow-CV5y5zkM.js +1 -0
  21. package/dist/WuiPhone-BC0MQ6bf.js +16 -0
  22. package/dist/WuiPopover-CQJLfgm_.js +1 -0
  23. package/dist/WuiRelativeTime-CmlKD-97.js +1 -0
  24. package/dist/WuiSavedViews-CdjavvPC.js +1 -0
  25. package/dist/WuiSelect-EquDxkz1.js +9 -0
  26. package/dist/WuiShortcuts-5PhCS5ri.js +1 -0
  27. package/dist/WuiTimePicker-OAP_QRwV.js +9 -0
  28. package/dist/WuiTour-Dxyv9uNz.js +1 -0
  29. package/dist/{WuiTree-JK4JqcBr.js → WuiTree-BPT9EZuw.js} +1 -1
  30. package/dist/{WuiTruncate-C2WV1-NN.js → WuiTruncate-BB4i8wHE.js} +1 -1
  31. package/dist/WuiWhatsNew-B2mM4MHE.js +1 -0
  32. package/dist/anchorOverlay-B8fu8hjz.js +1 -0
  33. package/dist/chips-Dcf6_wuZ.js +2 -0
  34. package/dist/drawerDiscard-BtPeayNT.js +1 -0
  35. package/dist/elements/code-block.js +1 -1
  36. package/dist/elements/command-palette.js +1 -1
  37. package/dist/elements/comment-thread.js +1 -1
  38. package/dist/elements/context-menu.js +1 -1
  39. package/dist/elements/data-table.js +1 -1
  40. package/dist/elements/date-range.js +1 -1
  41. package/dist/elements/datepicker.js +1 -1
  42. package/dist/elements/drawer.js +1 -1
  43. package/dist/elements/dropdown.js +1 -0
  44. package/dist/elements/filter-popover.js +1 -1
  45. package/dist/elements/hover-card.js +1 -1
  46. package/dist/elements/inline-edit.js +1 -1
  47. package/dist/elements/lightbox.js +1 -1
  48. package/dist/elements/markdown.js +1 -1
  49. package/dist/elements/mention-input.js +1 -1
  50. package/dist/elements/modal.js +1 -0
  51. package/dist/elements/navigation-menu.js +1 -1
  52. package/dist/elements/notification-center.js +1 -1
  53. package/dist/elements/overflow.js +1 -1
  54. package/dist/elements/phone.js +1 -1
  55. package/dist/elements/popover.js +1 -0
  56. package/dist/elements/relative-time.js +1 -1
  57. package/dist/elements/saved-views.js +1 -1
  58. package/dist/elements/select.js +1 -1
  59. package/dist/elements/shortcuts.js +1 -1
  60. package/dist/elements/timepicker.js +1 -1
  61. package/dist/elements/tour.js +1 -1
  62. package/dist/elements/tree.js +1 -1
  63. package/dist/elements/truncate.js +1 -1
  64. package/dist/elements/whats-new.js +1 -1
  65. package/dist/fileViewerImage-XsUnEv6Z.js +3 -0
  66. package/dist/fileViewerMedia-DTDM69nT.js +1 -0
  67. package/dist/{fileViewerPdf-CdaDuaRJ.js → fileViewerPdf-vlVCKKyK.js} +3 -3
  68. package/dist/fileViewerUi-CprJdtCB.js +1 -0
  69. package/dist/filterPopover-CYzUbKN0.js +1 -0
  70. package/dist/helpers.js +1 -1
  71. package/dist/imeSafeEnter-DPs9qL3S.js +1 -0
  72. package/dist/inlineEditText-_GFrdJ6F.js +1 -0
  73. package/dist/listboxKeyNav-CF7tMDGG.js +1 -0
  74. package/dist/loader-B7twHKUy.js +1 -0
  75. package/dist/menuKeyNav-COGecOjH.js +1 -0
  76. package/dist/nativeOverlay-BbkCnzFj.js +1 -0
  77. package/dist/{search-DaxGPvdn.js → search-C6r6xpep.js} +1 -1
  78. package/dist/server.js +1 -1
  79. package/dist/themeTransition-Dt7Br1QT.js +1 -0
  80. package/dist/ui-calendar.global.js +1 -1
  81. package/dist/ui-calendar.js +1 -1
  82. package/dist/ui-chart.global.js +1 -1
  83. package/dist/ui-chart.js +1 -1
  84. package/dist/ui-elements/carousel.global.js +1 -1
  85. package/dist/ui-elements/code-block.global.js +1 -1
  86. package/dist/ui-elements/command-palette.global.js +2 -2
  87. package/dist/ui-elements/comment-thread.global.js +1 -1
  88. package/dist/ui-elements/consent-banner.global.js +1 -1
  89. package/dist/ui-elements/context-menu.global.js +1 -1
  90. package/dist/ui-elements/date-range.global.js +10 -10
  91. package/dist/ui-elements/drawer.global.js +1 -1
  92. package/dist/ui-elements/dropdown.global.js +1 -0
  93. package/dist/ui-elements/glyphs.global.js +1 -1
  94. package/dist/ui-elements/image-crop.global.js +1 -1
  95. package/dist/ui-elements/inline-edit.global.js +1 -1
  96. package/dist/ui-elements/kanban.global.js +1 -1
  97. package/dist/ui-elements/lead-popup.global.js +1 -1
  98. package/dist/ui-elements/lightbox.global.js +1 -1
  99. package/dist/ui-elements/markdown.global.js +3 -3
  100. package/dist/ui-elements/modal.global.js +1 -0
  101. package/dist/ui-elements/org-tree.global.js +1 -1
  102. package/dist/ui-elements/phone.global.js +10 -10
  103. package/dist/ui-elements/popover.global.js +1 -0
  104. package/dist/ui-elements/resizable.global.js +1 -1
  105. package/dist/ui-elements/saved-views.global.js +1 -1
  106. package/dist/ui-elements/select-chips.global.js +2 -2
  107. package/dist/ui-elements/select-recents.global.js +1 -1
  108. package/dist/ui-elements/select-search.global.js +1 -1
  109. package/dist/ui-elements/slider.global.js +1 -1
  110. package/dist/ui-elements/sortable.global.js +1 -1
  111. package/dist/ui-elements/status-icon.global.js +1 -1
  112. package/dist/ui-elements/timepicker.global.js +4 -4
  113. package/dist/ui-elements/tour.global.js +1 -1
  114. package/dist/ui-elements/tree.global.js +1 -1
  115. package/dist/ui-elements/wizard.global.js +1 -1
  116. package/dist/ui-elements.global.js +21 -21
  117. package/dist/ui-elements.js +1 -1
  118. package/dist/ui-file-viewer.global.js +10 -10
  119. package/dist/ui-file-viewer.js +1 -1
  120. package/dist/ui-rich-text.global.js +55 -55
  121. package/dist/ui-rich-text.js +55 -55
  122. package/dist/ui-tour.global.js +1 -1
  123. package/package.json +17 -5
  124. package/types/WuiCommandPalette.d.ts +2 -2
  125. package/types/WuiCommentThread.d.ts +1 -2
  126. package/types/WuiContextMenu.d.ts +56 -5
  127. package/types/WuiDatePicker.d.ts +3 -7
  128. package/types/WuiDateRange.d.ts +2 -9
  129. package/types/WuiDrawer.d.ts +9 -12
  130. package/types/WuiDropdown.d.ts +61 -0
  131. package/types/WuiHoverCard.d.ts +15 -1
  132. package/types/WuiInlineEdit.d.ts +2 -1
  133. package/types/WuiLightbox.d.ts +1 -2
  134. package/types/WuiMentionInput.d.ts +0 -4
  135. package/types/WuiModal.d.ts +50 -0
  136. package/types/WuiNavigationMenu.d.ts +8 -3
  137. package/types/WuiNotificationCenter.d.ts +10 -2
  138. package/types/WuiPhone.d.ts +1 -5
  139. package/types/WuiPopover.d.ts +67 -0
  140. package/types/WuiRelativeTime.d.ts +5 -6
  141. package/types/WuiSelect.d.ts +8 -6
  142. package/types/WuiShortcuts.d.ts +6 -1
  143. package/types/WuiSlider.d.ts +3 -3
  144. package/types/WuiTimePicker.d.ts +3 -5
  145. package/types/WuiTour.d.ts +1 -0
  146. package/types/WuiTruncate.d.ts +2 -2
  147. package/types/WuiWhatsNew.d.ts +3 -3
  148. package/types/anchorOverlay.d.ts +24 -8
  149. package/types/codeHighlight.d.ts +1 -1
  150. package/types/elements/dropdown.d.ts +2 -0
  151. package/types/elements/modal.d.ts +2 -0
  152. package/types/elements/popover.d.ts +2 -0
  153. package/types/fileViewerImage.d.ts +2 -0
  154. package/types/fileViewerMedia.d.ts +2 -0
  155. package/types/fileViewerPdf.d.ts +2 -0
  156. package/types/fileViewerUi.d.ts +1 -2
  157. package/types/filterPopover.d.ts +7 -8
  158. package/types/global/core.d.ts +0 -1
  159. package/types/global/shared.d.ts +8 -0
  160. package/types/globals.d.ts +23 -75
  161. package/types/helpers.d.ts +5 -0
  162. package/types/iconGlyphs.g.d.ts +1 -1
  163. package/types/imeSafeEnter.d.ts +10 -0
  164. package/types/index.d.ts +4 -1
  165. package/types/inlineEditText.d.ts +12 -1
  166. package/types/listboxKeyNav.d.ts +3 -3
  167. package/types/menuKeyNav.d.ts +8 -0
  168. package/types/nativeOverlay.d.ts +49 -0
  169. package/types/razor-js/modules/overlays.d.ts +1 -4
  170. package/types/razor-js/modules/serverBridge.d.ts +15 -13
  171. package/types/razor-js/modules/shared.d.ts +0 -7
  172. package/types/razor-js/modules/tables.d.ts +1 -0
  173. package/types/server/remoteModal.d.ts +0 -1
  174. package/types/statusIcons.d.ts +1 -1
  175. package/types/tooltips.d.ts +18 -0
  176. package/dist/WuiCodeBlock-cLLbSBK4.js +0 -1
  177. package/dist/WuiCommentThread-CnwvJUDn.js +0 -1
  178. package/dist/WuiContextMenu-Re2CG8yT.js +0 -1
  179. package/dist/WuiDataTable-8nQDiTHE.js +0 -1
  180. package/dist/WuiDatePicker-DLEsnzqG.js +0 -31
  181. package/dist/WuiDateRange-9Xqs5nvv.js +0 -25
  182. package/dist/WuiDrawer-B3YFmxl2.js +0 -1
  183. package/dist/WuiHoverCard-CE3dHKaM.js +0 -1
  184. package/dist/WuiInlineEdit-BlBuWkHG.js +0 -1
  185. package/dist/WuiLightbox-C2A14vHx.js +0 -1
  186. package/dist/WuiMarkdown-BXY0QKaO.js +0 -4
  187. package/dist/WuiMentionInput-HwsLGhyr.js +0 -1
  188. package/dist/WuiNavigationMenu-CZ3XhFam.js +0 -1
  189. package/dist/WuiNotificationCenter-ClkCTUnp.js +0 -1
  190. package/dist/WuiOverflow-B0wA6aDe.js +0 -1
  191. package/dist/WuiPhone-NdIYg_Gb.js +0 -16
  192. package/dist/WuiRelativeTime-DyeUQOQ8.js +0 -1
  193. package/dist/WuiSavedViews-Br9YKOVU.js +0 -1
  194. package/dist/WuiSelect-UIgerFOg.js +0 -9
  195. package/dist/WuiShortcuts-D3rWkaOm.js +0 -1
  196. package/dist/WuiTimePicker-DOodgU2O.js +0 -9
  197. package/dist/WuiTour-Cx61ijsm.js +0 -1
  198. package/dist/WuiWhatsNew-dLGyA4g1.js +0 -1
  199. package/dist/anchorOverlay-CXnWfezA.js +0 -1
  200. package/dist/chips-xrpDY6TU.js +0 -2
  201. package/dist/drawerDiscard-Cra-QhD5.js +0 -1
  202. package/dist/fileViewerImage-Bt1jeArm.js +0 -3
  203. package/dist/fileViewerMedia-Bp1uHJvC.js +0 -1
  204. package/dist/fileViewerUi-ResPjO1o.js +0 -1
  205. package/dist/filterPopover-CaHWe9V0.js +0 -1
  206. package/dist/inlineEditText-CsLCQbcg.js +0 -1
  207. package/dist/listboxKeyNav-Bxkq7dvu.js +0 -1
  208. package/dist/loader-ByHAB1wi.js +0 -1
  209. package/dist/themeTransition-CfrJtERx.js +0 -1
  210. package/types/overlayRelease.d.ts +0 -12
  211. package/types/razor-js/modules/popovers.d.ts +0 -1
@@ -1,34 +1,34 @@
1
- var WeborityUiElements=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},r=n({defineElement:()=>i});function i(e,t){if(typeof customElements>`u`||customElements.get(e))return;let n=[];if(typeof document<`u`)for(let r of document.querySelectorAll(e))for(let i of Object.keys(r)){let a=Object.getOwnPropertyDescriptor(t.prototype,i);if(a&&(a.set||a.get)&&(n.push([r,i,Reflect.get(r,i)]),!Reflect.deleteProperty(r,i)))throw Error(`defineElement: could not clear the early "${i}" property on <${e}>.`)}customElements.define(e,t);for(let[t,r,i]of n)if(!Reflect.set(t,r,i))throw Error(`defineElement: could not restore the "${r}" property on <${e}>.`)}var a=n({anchorOverlay:()=>d,bindReanchor:()=>f,unbindReanchor:()=>p}),o=4,s=8,c=300,l=400;function u(e,t){let n=t.offsetWidth,r=t.offsetHeight,i=e.right+o+n>window.innerWidth-o,a=i?e.left-o-n:e.right+o;t.style.left=`${Math.max(o,a)}px`,t.style.top=`${Math.max(o,Math.min(e.top,window.innerHeight-r-o))}px`,t.dataset.side=i?`start`:`end`}function d(e,t,n={}){if(!e||!t)return;t.style.position=`fixed`;let r=e.getBoundingClientRect();if(n.beside){u(r,t);return}let i=n.clampHeight?t.scrollTop:0;n.clampHeight&&(t.style.maxHeight=``);let a=t.offsetHeight,d=window.innerHeight-r.bottom,f=!n.below&&d<a+o&&r.top>d;if(t.classList.toggle(`drop-up`,f),t.style.top=f?`${Math.max(o,r.top-a-o)}px`:`${r.bottom+o}px`,n.clampHeight){let e=f?r.top-8:window.innerHeight-r.bottom-8;e<a&&(t.style.maxHeight=`${Math.max(e,0)}px`),t.scrollTop=i}n.matchWidth&&(r.width>=c?(t.style.minWidth=`${r.width}px`,t.style.width=`${r.width}px`,t.style.maxWidth=`${r.width}px`):(t.style.minWidth=`${r.width}px`,t.style.width=`max-content`,t.style.maxWidth=`${Math.min(l,window.innerWidth-8)}px`));let p=t.offsetWidth;if(n.alignEnd){let e=r.right-p,n=e>=s?e:r.left,i=Math.max(s,Math.min(n,window.innerWidth-p-s));t.style.left=`${i}px`}else{let e=Math.min(r.left,window.innerWidth-p-o);t.style.left=`${Math.max(o,e)}px`}}function f(e,t){p(e),e._reanchor=t,e._reanchorScroll=n=>{n.composedPath().includes(e)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function p(e){if(!e?._reanchor)return;window.removeEventListener(`resize`,e._reanchor);let t=e._reanchorScroll;t&&window.removeEventListener(`scroll`,t,!0),e._reanchor=null,e._reanchorScroll=null}var m=n({ElementBase:()=>g,NO_DOM_MESSAGE:()=>h}),h=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(h);var g=HTMLElement;function _(e,t){if(e==null)throw Error(t);return e}function v(e,t,n){if(!(e instanceof t))throw TypeError(n);return e}function y(e,t){return e instanceof Element?e.closest(t):null}var b=`data-wui-shortcuts`,x=`data-shortcut-scope`,S=`wui:shortcut`,C={title:`Keyboard shortcuts`,close:`Close`,help:`Show these shortcuts`},w=[{key:`J`,label:`Next item`},{key:`K`,label:`Previous item`},{key:`Enter`,label:`Open the item`}],ee={key:`X`,label:`Select the item`},T={"/":`slash`,"?":`help`,Escape:`esc`,Esc:`esc`,Enter:`enter`},E={esc:`Esc`,escape:`Esc`,enter:`Enter`,slash:`/`,help:`?`},D={esc:`Escape`,ctrl:`Control`,cmd:`Meta`,option:`Alt`,opt:`Alt`},te=new Set([`checkbox`,`radio`,`button`,`submit`,`reset`,`range`,`color`,`file`,`image`]),O=new Set([`textbox`,`searchbox`,`combobox`]),k=`a[href], button, summary, input, select, textarea, [role="button"], [role="link"], [role="menuitem"], [role="option"], [role="tab"], [role="checkbox"], [role="switch"]`;function ne(e){if(!e||e.ctrlKey||e.metaKey||e.altKey)return null;let t=e.key;return typeof t!=`string`||!t?null:T[t]?T[t]:t.length===1&&t.trim()?t.toLowerCase():null}function re(e){let t=String(e??``).trim();return t.length===1?t.toUpperCase():E[t.toLowerCase()]??t}function ie(e){return String(e??``).trim().split(/\s+/).filter(Boolean).map(e=>D[e.toLowerCase()]??(e.length===1?e.toUpperCase():e)).join(`+`)}function ae(e){if(!e||!oe(e))return!1;if(e instanceof HTMLElement&&e.isContentEditable||e.closest?.(`[contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]`)||e.tagName===`TEXTAREA`||e.tagName===`SELECT`)return!0;if(e.tagName===`INPUT`){let t=e instanceof HTMLInputElement&&e.type?e.type:`text`;return!te.has(t.toLowerCase())}return O.has(e.getAttribute?.(`role`))}function oe(e){return e.nodeType===1}function se(e=typeof document>`u`?null:document){return e?.documentElement?.getAttribute(b)===`off`}function ce(e,t){if(!t||e&&t.contains(e))return!0;let n=t.ownerDocument;return(!e||e===n.body||e===n.documentElement)&&n.querySelector(`[data-shortcut-scope]`)===t}function le(e,t,n=null){let r=e.target instanceof Node?e.target:null;if(!t||e.defaultPrevented||se(r?.ownerDocument??void 0))return!1;let i=ne(e);if(!i||!ce(r,n)||ae(r))return!1;let a=t[i]??(i.length===1?t[i.toUpperCase()]:void 0);return typeof a!=`function`||i===`enter`&&r instanceof Element&&r.closest(k)?!1:(e.preventDefault(),a(e),!0)}function ue(e,t){let n=e[0]?.ownerDocument;if(!n)return null;let r=n.activeElement,i=e.findIndex(e=>e===r||e.contains(r));if(i<0&&r&&r!==n.body){let t=r.closest?.(`li, tr`);t&&(i=e.findIndex(e=>t.contains(e)))}i<0&&(i=e.findIndex(e=>e.getAttribute(`aria-current`)===`true`));let a=_(e[i<0?t>0?0:e.length-1:Math.min(e.length-1,Math.max(0,i+t))],`moveFocus: no item at the clamped index`);return a.focus(),a.scrollIntoView?.({block:`nearest`}),a}var de=2,fe=`wui-filter-popover-pinned`,pe=`.wui-filter-popover-trigger`,me=`.wui-filter-popover-panel`,he=`.wui-filter-popover-head`,A=`input:not([type]),input[type="text"],input[type="search"]`,ge=`a[href],button:not([disabled]),input:not([disabled]):not([type='hidden']),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex='-1'])`;function _e(){try{return sessionStorage.getItem(fe)===`1`}catch{return!1}}function ve(e){try{e?sessionStorage.setItem(fe,`1`):sessionStorage.removeItem(fe)}catch(e){if(!(e instanceof DOMException))throw e}}function ye(e){if(e===null||e instanceof Node)return e;throw TypeError(`event target is not a node`)}function be(e,t){let n=e?.querySelector(t)??null;return n instanceof HTMLElement?n:null}var xe=class extends g{_doc;_timer;_sticky;_inside;_pendingSubmit;_onEnter;_onLeave;_onClick;_onChange;_onListClose;_onFocusOut;_onKeyDown;_onShortcut;_onEscape;_onOutside;constructor(){super(),this._doc=null,this._timer=null,this._sticky=!1,this._inside=!1,this._pendingSubmit=!1,this._onEnter=e=>{e.pointerType!==`touch`&&e.pointerType!==`pen`&&(this._inside=!0,this._schedule(!0))},this._onLeave=e=>{e.pointerType!==`touch`&&e.pointerType!==`pen`&&(this._inside=!1,this._schedule(!1))},this._onClick=e=>{this._trigger?.contains(ye(e.target))&&(this._clear(),this.isOpen&&this._sticky?this._close(!0):this._open(!0,e.detail===0))},this._onChange=e=>{let t=this._pin;if(t&&e.target===t){ve(t.checked),t.checked?this._clear():this._schedule(!1);return}let n=e.target;if(n instanceof Element&&n.closest(`wui-select[mode="multiple"], wui-select[mode="tag"]`)?.querySelector(`[aria-expanded="true"]`)){this._pendingSubmit=!0;return}let r=this.closest(`form.wui-filter-form`);r instanceof HTMLFormElement&&r.requestSubmit()},this._onListClose=()=>{if(!this._pendingSubmit)return;this._pendingSubmit=!1;let e=this.closest(`form.wui-filter-form`);e instanceof HTMLFormElement&&e.requestSubmit()},this._onFocusOut=e=>{this.contains(ye(e.relatedTarget))||this._schedule(!1)},this._onKeyDown=e=>{let t=e.target;if(e.key!==`Enter`||!(t instanceof Element)||!this._panel?.contains(t)||!t.matches(A))return;e.preventDefault();let n=this.closest(`form.wui-filter-form`);n instanceof HTMLFormElement&&n.requestSubmit()},this._onShortcut=e=>{this.ownerDocument.querySelector(`wui-filter-popover`)===this&&le(e,{f:()=>this._open(!0,!0)})},this._onEscape=e=>{e.key===`Escape`&&this.isOpen&&this._close(!0)},this._onOutside=e=>{this.isOpen&&!e.composedPath().includes(this)&&this._close(!1)}}get isOpen(){let e=this._panel;return e?!e.hidden:!1}connectedCallback(){this._doc=this.ownerDocument,this.addEventListener(`pointerenter`,this._onEnter),this.addEventListener(`pointerleave`,this._onLeave),this.addEventListener(`click`,this._onClick),this.addEventListener(`change`,this._onChange),this.addEventListener(`focusout`,this._onFocusOut),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`wui-select:close`,this._onListClose),this._doc.addEventListener(`keydown`,this._onShortcut),_e()&&this._pin&&(this._pin.checked=!0,this._open(!1,!1))}disconnectedCallback(){this._clear(),this.removeEventListener(`pointerenter`,this._onEnter),this.removeEventListener(`pointerleave`,this._onLeave),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`change`,this._onChange),this.removeEventListener(`focusout`,this._onFocusOut),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`wui-select:close`,this._onListClose),this._doc?.removeEventListener(`keydown`,this._onShortcut),this._doc?.removeEventListener(`keydown`,this._onEscape),this._doc?.removeEventListener(`click`,this._onOutside),p(this),this._doc=null}get _trigger(){return be(this,pe)}get _panel(){return be(this,me)}get _pin(){let e=this.querySelector(`${he} input[type="checkbox"]`);return e instanceof HTMLInputElement?e:null}get _pinned(){return this._pin?.checked===!0}_clear(){this._timer!==null&&clearTimeout(this._timer),this._timer=null}_schedule(e){if(this._clear(),e){if(this.isOpen)return;this._timer=setTimeout(()=>{this._timer=null,this._open(!1,!1)},150)}else this.isOpen&&!this._stayOpen()&&(this._timer=setTimeout(()=>{this._timer=null,this._stayOpen()||this._close(!1)},400))}_stayOpen(){let e=this._panel;return e?this._pinned||this._inside||e.contains(this.ownerDocument.activeElement)||e.querySelector(`[aria-expanded="true"]`)!==null:!1}_open(e,t){this._clear();let n=this._panel,r=this._trigger;n&&r&&(this.isOpen?e&&(this._sticky=!0):(n.hidden=!1,r.setAttribute(`aria-expanded`,`true`),this._sticky=e,this._reposition(),f(this,()=>{this._triggerOutOfView()?this._close(!1):this._reposition()}),this._doc?.addEventListener(`keydown`,this._onEscape),this._doc?.addEventListener(`click`,this._onOutside)),t&&(be(n.querySelector(`.wui-filter-popover-grid`),ge)??be(n,ge))?.focus())}_close(e){this._clear();let t=this._panel;if(!t||!this.isOpen)return;let n=t.contains(this.ownerDocument.activeElement);t.hidden=!0,this._trigger?.setAttribute(`aria-expanded`,`false`),this._sticky=!1,p(this),this._doc?.removeEventListener(`keydown`,this._onEscape),this._doc?.removeEventListener(`click`,this._onOutside),e&&n&&this._trigger?.focus()}_reposition(){this.isOpen&&this._trigger&&d(this._trigger,this._panel,{clampHeight:!0,alignEnd:!0})}_triggerOutOfView(){let e=this._trigger;if(!e||!this._doc?.elementFromPoint)return!1;let t=e.getBoundingClientRect();if(!t.width&&!t.height)return!1;let n=this._doc.elementFromPoint(t.left+t.width/2,t.top+t.height/2);return!n||!(e.contains(n)||this._panel?.contains(n))}};function Se(){i(`wui-filter-popover`,xe)}var Ce=`INR`,we=Object.freeze({INR:`₹`,USD:`$`,EUR:`€`,GBP:`£`,JPY:`¥`}),Te=e=>typeof e==`string`&&/^[A-Z]{3}$/.test(e),Ee=(e=`INR`)=>we[e]??`${e} `,De=n({IST_OFFSET_MS:()=>Oe,IST_TIME_ZONE:()=>j,isTimeZone:()=>je,nowIn:()=>Re,todayIn:()=>Le,wallClockOf:()=>Ie,wallToInstant:()=>Pe,zoneOffsetMs:()=>Ne,zoneParts:()=>Me}),j=`Asia/Kolkata`,Oe=198e5,ke=new Map;function Ae(e){let t=ke.get(e);return t||(t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),ke.set(e,t)),t}function je(e){if(typeof e!=`string`||e===``)return!1;try{return Ae(e),!0}catch{return!1}}function Me(e,t=j){if(t===`Asia/Kolkata`){let t=new Date(e+Oe);return{year:t.getUTCFullYear(),month:t.getUTCMonth(),day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds()}}let n=Object.fromEntries(Ae(t).formatToParts(e).map(e=>[e.type,Number(e.value)]));return{year:Number(n.year),month:Number(n.month)-1,day:Number(n.day),hour:Number(n.hour)%24,minute:Number(n.minute),second:Number(n.second)}}function Ne(e,t=j){if(t===`Asia/Kolkata`)return Oe;let n=Me(e,t),r=new Date(0);return r.setUTCFullYear(n.year,n.month,n.day),r.setUTCHours(n.hour,n.minute,n.second,0),r.getTime()-Math.floor(e/1e3)*1e3}function Pe(e,t=j){let n=e-Ne(e,t);return n=e-Ne(n,t),n}var Fe=e=>e instanceof Date?e.getTime():e;function Ie(e,t=j){return new Date(e+Ne(e,t)).toISOString().slice(0,19)}function Le(e=j,t=Date.now()){return Ie(Fe(t),e).slice(0,10)}function Re(e=j,t=Date.now()){let n=Fe(t);return new Date(n+Ne(n,e))}var ze=n({CURRENCIES:()=>Ve,DATE_PATTERNS:()=>We,DURATION_UNITS:()=>Ue,EMPTY_VALUE:()=>`-`,FORMAT_STYLES:()=>Be,IST_OFFSET_MS:()=>Oe,IST_TIME_ZONE:()=>j,MAX_DECIMALS:()=>20,MONEY_UNITS:()=>He,compactFormatOf:()=>xt,formatCompact:()=>pt,formatCurrency:()=>dt,formatDate:()=>M,formatDateTime:()=>St,formatDayShort:()=>yt,formatDuration:()=>gt,formatNumber:()=>ut,formatPercent:()=>mt,formatValue:()=>bt,isMoneyUnit:()=>Ge,istParts:()=>vt,paiseToRupeeText:()=>ot,timeZoneLabel:()=>Tt,toInstant:()=>_t}),Be=[`number`,`currency`,`percent`,`compact`,`duration`,`date`],Ve=[`INR`,`USD`,`EUR`,`GBP`],He=[`rupees`,`paise`],Ue=[`ms`,`s`,`min`,`h`],We=[`day`,`month`,`year`,`datetime`,`time`];function Ge(e){return He.some(t=>t===e)}var Ke=`-`,qe=`−`,Je=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Ye=(e,t)=>_(e[t],`no compact unit at index ${t}`),Xe=[[1e7,`Cr`],[1e5,`L`],[1e3,`K`]],Ze=[[1e9,`B`],[1e6,`M`],[1e3,`K`]],Qe=e=>!e||e===`INR`?`en-IN`:`en-US`,$e=(e,t)=>typeof e==`number`&&Number.isInteger(e)&&e>=0&&e<=20?e:t,et=new Map,tt=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=et.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:e}),et.set(n,r)),r},nt=new Map,rt=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=nt.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:e,maximumFractionDigits:e}),nt.set(n,r)),r},it=e=>typeof e==`number`&&Number.isFinite(e),at=e=>e<0&&!Object.is(Math.abs(e),0)?qe:``;function ot(e){if(!Number.isInteger(e))throw Error(`A paise amount must be a whole number, got ${e}`);let t=BigInt(Math.abs(e)).toString().padStart(3,`0`);return`${e<0?`-`:``}${t.slice(0,-2)}.${t.slice(-2)}`}var st=(e,t)=>t===`paise`?Number(ot(e)):e,ct=2,lt=(e,t,n)=>{let r=Math.min(t,ct),i=10n**BigInt(ct-r),a=(BigInt(ot(e).replace(`.`,``))+i/2n)/i,o=10n**BigInt(r),s=rt(0,n).format(a/o);return t===0?s:`${s}.${(a%o).toString().padStart(r,`0`)}${`0`.repeat(t-r)}`};function ut(e,{decimals:t}={}){if(!it(e))return`-`;let n=tt($e(t,2)).format(Math.abs(e));return n===`0`?`0`:at(e)+n}function dt(e,{unit:t=`rupees`,decimals:n,currency:r=`INR`}={}){if(!it(e))return`-`;let i=$e(n,0),a=Qe(r),o=t===`paise`?lt(Math.abs(e),i,a):rt(i,a).format(Math.abs(e));return(Number(o.replace(/,/g,``))===0?``:at(e))+Ee(r)+o}var ft=e=>e>0&&e<.1?Math.min(20,1-Math.floor(Math.log10(e))):2;function pt(e,{currency:t,unit:n=`rupees`}={}){if(!it(e))return`-`;let r=t?st(e,n):e,i=t?Ee(t):``,a=t?Qe(t):`en-IN`,o=a===`en-IN`?Xe:Ze,s=Math.abs(r),c=o.findIndex(([e])=>s>=e);if(c===-1){let e=tt(ft(s),a).format(s);if(e!==`1,000`)return(e===`0`?``:at(r))+i+e;c=o.length-1}let[l,u]=Ye(o,c),d=s/l,f=d>=100?0:d>=10?1:2,p=Number(d.toFixed(f));return p>=100&&c>0&&(--c,[l,u]=Ye(o,c),d=s/l,f=d>=100?0:d>=10?1:2,p=Number(d.toFixed(f))),`${at(r)}${i}${tt(f,a).format(p)} ${u}`}function mt(e,{decimals:t}={}){return it(e)?`${ut(e*100,{decimals:$e(t,1)})}%`:`-`}var ht={ms:1,s:1e3,min:6e4,h:36e5};function gt(e,{unit:t=`s`}={}){if(!it(e))return`-`;let n=ht[t]??1e3,r=Math.abs(e*n),i=at(e);if(Math.round(r)<1e3)return`${i}${tt(0).format(r)} ms`;let a=r/1e3;if(a<10)return`${i}${tt(1).format(a)}s`;let o=Math.round(a);if(o<60)return`${i}${o}s`;let s=e=>String(e).padStart(2,`0`),c=Math.floor(o/60);if(c<60)return`${i}${c}m ${s(o%60)}s`;let l=Math.floor(c/60);return`${i}${tt(0).format(l)}h ${s(c%60)}m`}function _t(e,t=j){if(e instanceof Date)return e.getTime();if(it(e))return e;if(typeof e!=`string`)return NaN;let n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(n){let[e,r,i]=[Number(n[1]),Number(n[2]),Number(n[3])],a=new Date(Date.UTC(2e3,r-1,i));return a.setUTCFullYear(e),a.getUTCFullYear()===e&&a.getUTCMonth()===r-1&&a.getUTCDate()===i?Pe(a.getTime(),t):NaN}return Date.parse(e)}function vt(e,t=j){let{year:n,month:r,day:i,hour:a,minute:o}=Me(e,t);return{year:n,month:r,day:i,hour:a,minute:o}}function M(e,{pattern:t=`day`,timeZone:n=j}={}){let r=_t(e,n);if(!Number.isFinite(r))return`-`;let i=vt(r,n),a=e=>String(e).padStart(2,`0`),o=`${a(i.day)}-${Je[i.month]}-${i.year}`,s=`${a(i.hour)}:${a(i.minute)}`;switch(t){case`month`:return`${Je[i.month]}-${i.year}`;case`year`:return String(i.year);case`datetime`:return`${o} ${s}`;case`time`:return s;default:return o}}function yt(e,{timeZone:t=j}={}){let n=_t(e,t);if(!Number.isFinite(n))return`-`;let r=vt(n,t);return`${String(r.day).padStart(2,`0`)}-${Je[r.month]}`}function bt(e,t){if(e==null||e===``)return`-`;let n=t?.style;if(n===`date`)return M(e,t);if(typeof e!=`number`)return String(e);switch(n){case`currency`:return dt(e,t);case`percent`:return mt(e,t);case`compact`:return pt(e,t);case`duration`:return gt(e,t);default:return ut(e,t)}}function xt(e){let t=e?.style;return t===`currency`?{style:`compact`,currency:e?.currency??`INR`,unit:e?.unit}:!t||t===`number`?{style:`compact`}:e??{}}function St(e,{timeZone:t=j}={}){let n=_t(e);if(!Number.isFinite(n))return`-`;let r=Object.fromEntries(wt(t).formatToParts(n).map(e=>[e.type,e.value])),i=r.dayPeriod;if(i===void 0)throw Error(`Intl returned no day period for a 12-hour clock`);return`${r.day}-${Je[Number(r.month)-1]}-${r.year}, ${r.hour}:${r.minute} ${i.toUpperCase()}`}var Ct=new Map;function wt(e){let t=Ct.get(e);return t||(t=new Intl.DateTimeFormat(`en-IN`,{day:`2-digit`,month:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`,hour12:!0,timeZone:e}),Ct.set(e,t)),t}function Tt(e=j){return new Intl.DateTimeFormat(`en-IN`,{timeZone:e,timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??e}var Et=n({COLUMN_MAX_WIDTH:()=>Ot,COLUMN_MIN_WIDTH:()=>48,DATA_TABLE_TEXT:()=>N,PIN_AT_VAR:()=>Ht,PIN_SIDES:()=>jt,RESIZE_STEP:()=>10,RESIZE_STEP_LARGE:()=>50,ROW_HEIGHTS:()=>Nt,ROW_MOVE_LIMIT:()=>200,ROW_MOVE_MS:()=>220,ROW_SAVE_ATTR:()=>tn,ROW_SAVE_ERROR_CLASS:()=>nn,ROW_SAVE_STATES:()=>en,VIRTUAL_OVERSCAN:()=>8,clampColumnWidth:()=>Ft,groupCount:()=>Pt,groupItems:()=>It,identityCell:()=>rn,measureRows:()=>Zt,pinAtValue:()=>Ut,pinClasses:()=>Gt,pinOffsetVar:()=>Vt,planPins:()=>Wt,playRowMoves:()=>Qt,readColumnWidths:()=>zt,rowLabel:()=>an,rowOrderChanged:()=>$t,saveOutcomeText:()=>cn,setRowSaveState:()=>on,settledRows:()=>sn,virtualRange:()=>Lt,writeColumnWidths:()=>Bt}),Dt=48,Ot=1200,kt=10,At=50,jt=[`start`,`end`],Mt=8,Nt={comfortable:72,cozy:48,compact:40},N={resize:e=>e?`Resize ${e} column`:`Resize column`,width:e=>`${e} pixels`,rows:e=>`${ut(e,{decimals:0})} ${e===1?`row`:`rows`}`,saved:e=>e?`${e} saved.`:`Row saved.`,savedMany:e=>`${ut(e,{decimals:0})} rows saved.`,notSaved:(e,t)=>`${e?`${e} was not saved.`:`Row was not saved.`}${t?` ${t}`:``}`},Pt=e=>ut(e,{decimals:0}),Ft=e=>Math.min(Ot,Math.max(48,Math.round(Number(e)||0)));function It(e,t,n=[]){let r=new Map(n.map(e=>[e,[]]));return e.forEach((e,n)=>{let i=t(e,n),a=r.get(i);a||(a=[],r.set(i,a)),a.push(e)}),[...r].filter(([,e])=>e.length>0).map(([e,t])=>({key:e,items:t}))}function Lt({scrollTop:e,viewport:t,rowHeight:n,count:r,overscan:i=8}){let a=n>0?n:Nt.comfortable,o=Math.floor(Math.max(0,e)/a),s=Math.max(0,o-i);s-=s%2;let c=Math.min(r,o+Math.ceil(Math.max(0,t)/a)+i),l=Math.min(s,c);return{start:l,end:c,before:l*a,after:Math.max(0,r-c)*a}}var Rt=e=>`wui-widths:${e}`;function zt(e){if(!e)return{};try{let t=JSON.parse(window.localStorage.getItem(Rt(e))||`{}`),n={};if(t&&typeof t==`object`)for(let[e,r]of Object.entries(t))Number.isFinite(r)&&(n[e]=Ft(r));return n}catch{return{}}}function Bt(e,t){if(e)try{Object.keys(t).length?window.localStorage.setItem(Rt(e),JSON.stringify(t)):window.localStorage.removeItem(Rt(e))}catch(e){if(!(e instanceof DOMException))throw e}}var Vt=(e,t)=>`--wui-pin-${e}-${t}`,Ht=`--wui-pin-at`,Ut=(e,t)=>`var(${Vt(e,t)}, 0px)`;function Wt(e){let t=e.map(()=>null),n=-1;e.forEach((e,t)=>{e===`start`&&(n=t)});let r=0;for(let i=0;i<=n;i++)(e[i]===`start`||e[i]===`lead`)&&(t[i]={side:`start`,ordinal:r++,edge:!1});let i=t[n];i&&(i.edge=!0);let a=-1;r=0;for(let n=e.length-1;n>=0;n--)e[n]===`end`&&(t[n]={side:`end`,ordinal:r++,edge:!1},a=n);let o=t[a];return o&&(o.edge=!0),t}var Gt=e=>e?`wui-pin-${e.side}${e.edge?` wui-pin-${e.side}-edge`:``}`:``,Kt=200,qt=220,Jt=`cubic-bezier(0.22, 1, 0.36, 1)`,Yt=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,Xt=e=>e.getAttribute(`data-row-key`)??e;function Zt(e){let t=[...e];if(t.length>200)return null;let n=new Map;for(let e of t)e.hidden||n.set(Xt(e),e.offsetTop);return n}function Qt(e,t){let n=[...e];if(!t||n.length>200||Yt())return 0;let r=0;for(let e of n){if(e.hidden||typeof e.animate!=`function`)continue;let n=t.get(Xt(e));if(n===void 0)continue;let i=n-e.offsetTop;Math.abs(i)<1||(e.animate([{transform:`translateY(${i}px)`},{transform:`translateY(0)`}],{duration:220,easing:Jt}),r++)}return r}function $t(e,t){if(!e||!t)return!1;let n=new Set(t),r=new Set(e),i=e.filter(e=>n.has(e)),a=t.filter(e=>r.has(e));return i.some((e,t)=>e!==a[t])}var en=[`saving`,`error`],tn=`data-wui-save-state`,nn=`wui-row-save-error`,rn=e=>{let t=e.querySelector(`:scope > .wui-name-cell`);return t instanceof HTMLTableCellElement?t:[...e.cells].find(e=>!e.matches(`.wui-select-cell, .wui-expand-cell`))??null};function an(e){let t=rn(e);if(!t)return``;let n=t.querySelector(`.u-name`);if(n)return(n.textContent??``).trim();let r=``;for(let e of t.childNodes)e instanceof Element&&e.classList.contains(`wui-row-save-error`)||(r+=e.textContent??``);return r.replace(/\s+/g,` `).trim()}function on(e,t,n=``){if(t!==null&&!en.includes(t))throw Error(`A row's save state is ${en.join(` or `)} (or null to clear it), not "${t}".`);e.querySelector(`:scope > * > .${nn}`)?.remove(),t===null?e.removeAttribute(tn):e.setAttribute(tn,t),t===`saving`?e.setAttribute(`aria-busy`,`true`):e.removeAttribute(`aria-busy`);let r=t===`error`&&n?rn(e):null;if(r){let t=e.ownerDocument.createElement(`span`);t.className=nn,t.textContent=n,r.append(t)}}function sn(e,t){let n=[];if(!e)return n;for(let[r,i]of e){let e=t.get(r);i.state===`saving`&&e&&e.state!==`saving`&&n.push({label:e.label,ok:e.state!==`error`,message:e.message||``})}return n}function cn(e){let t=e.filter(e=>e.ok),n=[],[r]=t;t.length===1&&r?n.push(N.saved(r.label)):t.length>1&&n.push(N.savedMany(t.length));for(let t of e)t.ok||n.push(N.notSaved(t.label,t.message));return n.join(` `)}var ln=`.wui-col-resize`,un=`.wui-group-row, .wui-virtual-spacer`,dn=`.wui-select-cell, .wui-expand-cell`,fn=`<svg class="wui-icon" data-icon="chevron-down" data-wui="AppIcon" width="16" height="16" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M19.92 8.95l-6.52 6.52c-.77.77-2.03.77-2.8 0L4.08 8.95"></path></svg>`;function P(e){if(e==null)throw TypeError(`Missing DOM node`);return e}function pn(e,t){if(e instanceof t)return e;throw TypeError(`Missing DOM node`)}var mn=e=>{let t=y(e,ln);return t instanceof HTMLElement?t:null},hn=e=>e.hasAttribute(`data-wui-skeleton`)||!!e.querySelector(`:scope > td > .skeleton`),gn=class extends g{_frame;_headDirty;_rowsDirty;_frozenSig;_natural;_widths;_collapsed;_groupOrder;_items;_range;_drag;_userSized;_swallowClick;_mo;_ro;_fonts;_onPointerDown;_onKeyDown;_onClick;_onDblClick;_onScroll;_onFonts;_top=null;_bottom=null;_rowHeight=0;constructor(){super(),this._frame=0,this._headDirty=!0,this._rowsDirty=!0,this._frozenSig=null,this._natural=[],this._widths={},this._collapsed=new Set,this._groupOrder=[],this._items=[],this._range=null,this._drag=null,this._userSized=!1,this._swallowClick=!1,this._mo=null,this._ro=null,this._fonts=null,this._onPointerDown=e=>this._startDrag(e),this._onKeyDown=e=>this._key(e),this._onClick=e=>this._click(e),this._onDblClick=e=>{let t=mn(e.target);t&&this.contains(t)&&this._reset(t.closest(`th`))},this._onScroll=()=>{this.hasAttribute(`virtual`)&&this._schedule()},this._onFonts=()=>{this._userSized||this._drag||this._frozenSig===null||!this.hasAttribute(`resizable`)||(this._frozenSig=null,this._schedule())}}connectedCallback(){this._widths=zt(this.getAttribute(`view-key`)),this.addEventListener(`pointerdown`,this._onPointerDown,!0),this.addEventListener(`keydown`,this._onKeyDown,!0),this.addEventListener(`click`,this._onClick,!0),this.addEventListener(`dblclick`,this._onDblClick),this.addEventListener(`scroll`,this._onScroll,{passive:!0}),this._fonts=this.ownerDocument.fonts??null,this._fonts?.addEventListener(`loadingdone`,this._onFonts),typeof MutationObserver<`u`&&(this._mo=new MutationObserver(e=>this._mutated(e)),this._mo.observe(this,{childList:!0,subtree:!0})),typeof ResizeObserver<`u`&&(this._ro=new ResizeObserver(()=>this._schedule()),this._ro.observe(this)),this._headDirty=!0,this._rowsDirty=!0,this._schedule()}disconnectedCallback(){this.removeEventListener(`pointerdown`,this._onPointerDown,!0),this.removeEventListener(`keydown`,this._onKeyDown,!0),this.removeEventListener(`click`,this._onClick,!0),this.removeEventListener(`dblclick`,this._onDblClick),this.removeEventListener(`scroll`,this._onScroll),this._fonts?.removeEventListener(`loadingdone`,this._onFonts),this._fonts=null,this._mo?.disconnect(),this._ro?.disconnect(),this._mo=null,this._ro=null,this._frame&&cancelAnimationFrame(this._frame),this._frame=0,this._drag=null}refresh(){this._headDirty=!0,this._rowsDirty=!0,this._run()}get _table(){let e=this.querySelector(`:scope > table`);return e instanceof HTMLTableElement?e:null}_headCells(e){let t=e.tHead?.rows[0];return t?[...t.cells]:[]}_schedule(){this._frame||=requestAnimationFrame(()=>{this._frame=0,this._run()})}_mutated(e){for(let t of e){let e=t.target instanceof Element?t.target:t.target.parentElement;e&&((e.closest(`thead`)||e===this._table||e===this)&&(this._headDirty=!0),(e.closest(`tbody, tfoot`)||e===this._table||e===this)&&(this._rowsDirty=!0))}this._schedule()}_run(){let e=this._table;if(!e)return;let t=this._headDirty,n=this._rowsDirty;this._headDirty=!1,this._rowsDirty=!1,n&&this.hasAttribute(`group-by`)&&this._group(e),this._pins(e,t||n),this.hasAttribute(`resizable`)&&(t&&this._handles(e),this._layout(e)),this.hasAttribute(`virtual`)&&this._virtual(e,t||n),this._mo?.takeRecords()}_pins(e,t){let n=this._headCells(e),r=n.map(e=>{let t=e.dataset.pin;return t===`start`||t===`end`?t:e.matches(dn)?`lead`:null});if(!r.some(e=>e===`start`||e===`end`))return;let i=Wt(r);i.forEach((e,t)=>{e&&this._ro?.observe(P(n[t]))});let a=e=>P(n[e]).getBoundingClientRect().width,o=0;i.forEach((t,n)=>{t?.side===`start`&&(this._setVar(e,Vt(`start`,t.ordinal),o),o+=a(n))}),o=0;for(let t=i.length-1;t>=0;t--){let n=i[t];n?.side===`end`&&(this._setVar(e,Vt(`end`,n.ordinal),o),o+=a(t))}if(t)for(let t of e.rows)t.matches(`${un}, .wui-row-expanded`)||t.cells.length!==n.length||i.forEach((e,n)=>{if(!e)return;let r=P(t.cells[n]);r.classList.contains(`wui-pin-${e.side}`)||r.classList.add(`wui-pin-${e.side}`),e.edge&&!r.classList.contains(`wui-pin-${e.side}-edge`)&&r.classList.add(`wui-pin-${e.side}-edge`);let i=Ut(e.side,e.ordinal);r.style.getPropertyValue(`--wui-pin-at`)!==i&&r.style.setProperty(Ht,i)})}_setVar(e,t,n){let r=`${Math.round(n*100)/100}px`;e.style.getPropertyValue(t)!==r&&e.style.setProperty(t,r)}_resizable(e){return e.map((t,n)=>n<e.length-1&&!t.matches(dn))}_handles(e){let t=this._headCells(e),n=this._resizable(t);t.forEach((e,t)=>{if(!n[t]||e.querySelector(ln))return;let r=e.ownerDocument.createElement(`span`);r.className=`wui-col-resize`,r.setAttribute(`role`,`separator`),r.setAttribute(`aria-orientation`,`vertical`),r.setAttribute(`aria-valuemin`,`48`),r.setAttribute(`aria-valuemax`,String(Ot)),r.setAttribute(`tabindex`,`0`);let i=(e.textContent??``).trim();r.setAttribute(`aria-label`,N.resize(i)),i&&!e.hasAttribute(`aria-label`)&&e.setAttribute(`aria-label`,i),e.classList.add(`wui-col-resizable`),e.appendChild(r)})}_hasRows(e){for(let t of e.tBodies)for(let e of t.rows)if(!e.matches(un)&&!hn(e))return!0;return!1}_signature(e){return e.map(e=>e.dataset.key||(e.textContent??``).trim()).join(``)}_layout(e){let t=this._headCells(e),n=this._signature(t);t.length&&n!==this._frozenSig&&(this._hasRows(e)?this._freeze(e,t,n):this._applyRemembered(t))}_applyRemembered(e){for(let t of e){let e=t.dataset.key&&this._widths[t.dataset.key];e&&(t.style.width=`${e}px`);let n=t.querySelector(ln);n&&this._handleValue(n,Ft(e||t.getBoundingClientRect().width))}}_freeze(e,t,n){e.style.tableLayout=``,e.style.width=``,e.removeAttribute(`data-wui-fixed`);for(let e of t)e.hasAttribute(`data-wui-width`)&&(e.style.width=``,e.removeAttribute(`data-wui-width`));this._natural=t.map(e=>e.getBoundingClientRect().width),t.forEach((e,n)=>{if(n===t.length-1||e.matches(dn))return;let r=e.dataset.key&&this._widths[e.dataset.key];this._setWidth(e,r||this._natural[n])}),e.style.tableLayout=`fixed`,e.setAttribute(`data-wui-fixed`,``),this._frozenSig=n,this._fitTable(e,t)}_setWidth(e,t){let n=Ft(t);e.style.width=`${n}px`,e.setAttribute(`data-wui-width`,``);let r=e.querySelector(ln);return r&&this._handleValue(r,n),n}_handleValue(e,t){e.setAttribute(`aria-valuenow`,String(t)),e.setAttribute(`aria-valuetext`,N.width(t))}_fitTable(e,t){let n=t.length-1,r=this._natural[n]||0;for(let e=0;e<n;e++)r+=Number.parseFloat(P(t[e]).style.width)||this._natural[e]||0;e.style.width=`max(100%, ${Math.round(r)}px)`}_ensureFrozen(e){let t=this._headCells(e),n=this._signature(t);return n!==this._frozenSig&&this._freeze(e,t,n),t}_resizeTo(e,t,n){let r=this._table;if(!r)return;let i=this._ensureFrozen(r);this._userSized=!0,this._setWidth(e,t),this._fitTable(r,i),n&&this._remember(e),this._pins(r,!1)}_remember(e){let t=e.dataset.key;t&&(this._widths={...this._widths,[t]:Number.parseFloat(e.style.width)},Bt(this.getAttribute(`view-key`),this._widths))}_reset(e){let t=this._table;if(!e||!t)return;let n=this._ensureFrozen(t);this._userSized=!0;let r=e.dataset.key;if(r&&r in this._widths){let{[r]:e,...t}=this._widths;this._widths=t,Bt(this.getAttribute(`view-key`),this._widths)}this._setWidth(e,this._natural[n.indexOf(e)]||0),this._fitTable(t,n),this._pins(t,!1)}_rtl(){return getComputedStyle(this).direction===`rtl`}_startDrag(e){let t=mn(e.target);if(!t||!this.contains(t)||e.button!==0)return;e.preventDefault(),e.stopPropagation();let n=t.closest(`th`),r=this._table;if(!n||!r)return;this._ensureFrozen(r);let i={th:n,x:e.clientX,from:n.getBoundingClientRect().width,dir:this._rtl()?-1:1,moved:!1};this._drag=i,t.setPointerCapture?.(e.pointerId),t.classList.add(`is-dragging`);let a=e=>{let t=(e.clientX-i.x)*i.dir;Math.abs(t)>1&&(i.moved=!0),this._resizeTo(n,i.from+t,!1)},o=e=>{t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerup`,o),t.removeEventListener(`pointercancel`,o),t.classList.remove(`is-dragging`),this._drag=null,e.type===`pointercancel`?this._resizeTo(n,i.from,!1):i.moved&&this._remember(n),this._swallowClick=!0,setTimeout(()=>{this._swallowClick=!1},0)};t.addEventListener(`pointermove`,a),t.addEventListener(`pointerup`,o),t.addEventListener(`pointercancel`,o)}_key(e){let t=mn(e.target);if(!t||!this.contains(t))return;let n=t.closest(`th`);if(e.key===`Enter`||e.key===` `){e.preventDefault(),e.stopPropagation();return}if(e.key===`Home`){e.preventDefault(),e.stopPropagation(),this._reset(n);return}if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault(),e.stopPropagation();let r=this._table;if(!r)return;this._ensureFrozen(r);let i=P(n),a=e.shiftKey?50:10,o=e.key===`ArrowRight`!==this._rtl(),s=Number.parseFloat(i.style.width)||i.getBoundingClientRect().width;this._resizeTo(i,s+(o?a:-a),!0)}_click(e){let t=e.target instanceof Element&&e.target.closest(ln)!==null;if(this._swallowClick||t){e.stopPropagation(),(t||this._swallowClick)&&e.preventDefault(),this._swallowClick=!1;return}if(!this.hasAttribute(`group-by`))return;let n=y(e.target,`.wui-group-toggle`)?.closest(`.wui-group-row`);if(!(n instanceof HTMLTableRowElement)||!this.contains(n))return;let r=n.dataset.groupKey;this._collapsed.has(r)?this._collapsed.delete(r):this._collapsed.add(r),this._showGroup(n,!this._collapsed.has(r));let i=this._table;i&&this.hasAttribute(`virtual`)&&(this._virtual(i,!0),this._mo?.takeRecords())}_group(e){let t=this.getAttribute(`group-by`),n=this._headCells(e),r=n.findIndex(e=>e.dataset.key===t);if(r<0)throw Error(`<wui-data-table group-by="${t}"> needs a header cell with data-key="${t}".`);let i=e.tBodies[0];if(!i)return;let a=[...i.rows].filter(e=>!e.matches(un));if(a.some(hn))return;let o=this.ownerDocument,s=new Map;for(let e of i.querySelectorAll(`:scope > tr.wui-group-row`))e instanceof HTMLTableRowElement&&s.set(e.dataset.groupKey,e);let c=It(a,e=>e.dataset.group??e.cells[r]?.textContent?.trim()??``,this._groupOrder);this._groupOrder=c.map(e=>e.key);let l=o.createDocumentFragment(),u=c.map(e=>{let t=s.get(e.key)??this._groupRow(o,e.key);return s.delete(e.key),pn(t.querySelector(`.wui-group-cell`),HTMLTableCellElement).colSpan=n.length,pn(t.querySelector(`.wui-group-count`),HTMLElement).textContent=Pt(e.items.length),pn(t.querySelector(`.wui-group-rows`),HTMLElement).textContent=`, ${N.rows(e.items.length)}`,l.append(t,...e.items),[t,e.key]});for(let e of s.values())e.remove();i.insertBefore(l,this._bottom?.parentNode===i?this._bottom:null);for(let[e,t]of u)this._showGroup(e,!this._collapsed.has(t))}_groupRow(e,t){let n=e.createElement(`tr`);n.className=`wui-group-row`,n.dataset.groupKey=t;let r=e.createElement(`th`);r.className=`wui-group-cell`,r.scope=`rowgroup`;let i=e.createElement(`button`);i.type=`button`,i.className=`wui-group-toggle`,i.innerHTML=fn;let a=e.createElement(`span`);a.className=`wui-group-label`,a.textContent=t;let o=e.createElement(`span`);o.className=`wui-group-count`,o.setAttribute(`aria-hidden`,`true`);let s=e.createElement(`span`);return s.className=`visually-hidden wui-group-rows`,i.append(a,o,s),r.append(i),n.append(r),n}_showGroup(e,t){if(e){e.querySelector(`.wui-group-toggle`)?.setAttribute(`aria-expanded`,String(t));for(let n=e.nextElementSibling;n&&!n.matches(un);n=n.nextElementSibling)n instanceof HTMLElement&&(n.hidden=!t)}}_spacer(e,t){if(t?.parentNode===e)return t;let n=e.ownerDocument,r=n.createElement(`tr`);return r.className=`wui-virtual-spacer`,r.setAttribute(`aria-hidden`,`true`),r.append(n.createElement(`td`)),r}_virtual(e,t){let n=e.tBodies[0];if(!n)return;if(t){this._top=this._spacer(n,this._top),this._bottom=this._spacer(n,this._bottom),n.firstElementChild!==this._top&&n.insertBefore(this._top,n.firstChild),n.lastElementChild!==this._bottom&&n.append(this._bottom);let t=Math.max(1,this._headCells(e).length);P(this._top.cells[0]).colSpan=t,P(this._bottom.cells[0]).colSpan=t,this._items=[...n.rows].filter(e=>!e.classList.contains(`wui-virtual-spacer`)&&!e.hidden),this._range=null,e.setAttribute(`aria-rowcount`,String(this._items.length+1)),e.tHead?.rows[0]?.setAttribute(`aria-rowindex`,`1`),this._items.forEach((e,t)=>{e.setAttribute(`aria-rowindex`,String(t+2))}),this._rowHeight>0||(this._rowHeight=this._measureRow(e))}let r=e.tHead?.getBoundingClientRect().height||0,i=Lt({scrollTop:this.scrollTop-r,viewport:this.clientHeight,rowHeight:this._rowHeight,count:this._items.length}),a=this._range;if(a&&a.start===i.start&&a.end===i.end)return;let o=a?Math.min(a.start,i.start):0,s=a?Math.max(a.end,i.end):this._items.length;for(let e=o;e<s;e++){let t=e<i.start||e>=i.end,n=P(this._items[e]);n.classList.contains(`wui-virtual-off`)!==t&&n.classList.toggle(`wui-virtual-off`,t)}this._range=i;let c=P(this._top),l=P(this._bottom);c.hidden=i.before===0,l.hidden=i.after===0,P(c.cells[0]).style.height=`${i.before}px`,P(l.cells[0]).style.height=`${i.after}px`}_measureRow(e){let t=this._items.find(e=>!e.classList.contains(`wui-group-row`)&&!e.classList.contains(`wui-virtual-off`))?.getBoundingClientRect().height??0;return t>0?t:e.classList.contains(`wui-table-compact`)?Nt.compact:e.classList.contains(`wui-table-cozy`)?Nt.cozy:Nt.comfortable}},_n=n({DISPLAY_FORMAT:()=>wn,MONTHS:()=>vn,WEEKDAYS:()=>yn,clampMonth:()=>Dn,daysIn:()=>En,firstWeekday:()=>xn,fmt:()=>Tn,pad:()=>Sn,parseIso:()=>F,toIso:()=>Cn}),vn=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],yn=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],bn=e=>{let t=String(e??``).trim();return/^[0-6]$/.test(t)?Number(t):null},xn=e=>bn(e.getAttribute(`first-day`))??bn(getComputedStyle(e).getPropertyValue(`--wui-first-day`))??1,Sn=e=>String(e).padStart(2,`0`),Cn=(e,t,n)=>`${e}-${Sn(t+1)}-${Sn(n)}`,F=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e||``);if(!t)return null;let[,n,r,i]=t;if(n===void 0||r===void 0||i===void 0)throw Error(`ISO date parts missing`);let a=+n,o=+r,s=+i;return o<1||o>12||s<1||s>En(a,o-1)?null:{y:a,m:o-1,d:s}},wn=`dd-MMM-yyyy`,Tn=(e,t=wn)=>{let n=F(e);if(!n)return``;let r=vn[n.m];if(r===void 0)throw Error(`month out of range`);let i={yyyy:n.y,MMMM:r,MMM:r.slice(0,3),MM:Sn(n.m+1),dd:Sn(n.d),d:n.d};return(t||`dd-MMM-yyyy`).replace(/yyyy|MMMM|MMM|MM|dd|d/g,e=>String(i[e]))},En=(e,t)=>{let n=new Date(0);return n.setFullYear(e,t+1,0),n.getDate()},Dn=(e,t)=>{for(;t<0;)t+=12,--e;for(;t>11;)t-=12,e+=1;return{y:e,m:t}},On=n({BUSY_CLASS:()=>kn,isInert:()=>I,isReadOnly:()=>An,syncFieldState:()=>jn}),kn=`wui-field-busy`,An=e=>e.hasAttribute(`readonly`),I=e=>e.hasAttribute(`disabled`)||e.hasAttribute(`readonly`)||e.hasAttribute(`loading`);function jn(e,t){let n=e.hasAttribute(`loading`);n?e.setAttribute(`aria-busy`,`true`):e.removeAttribute(`aria-busy`),t&&(t.classList.toggle(kn,n),An(e)?t.setAttribute(`aria-readonly`,`true`):t.removeAttribute(`aria-readonly`))}var Mn=n({syncFormMirror:()=>L,syncFormMirrors:()=>In}),Nn=`data-wui-mirror`;function Pn(e,t,n,r){t.name=n,t.value=r==null?``:String(r);for(let n of[...t.attributes])n.name.startsWith(`data-val`)&&!e.hasAttribute(n.name)&&t.removeAttribute(n.name);for(let n of e.attributes)n.name.startsWith(`data-val`)&&t.setAttribute(n.name,n.value);t.disabled=e.hasAttribute(`disabled`)}function Fn(e){let t=document.createElement(`input`);return t.type=`hidden`,t.setAttribute(Nn,``),e.appendChild(t),t}function L(e,t){let n=e.getAttribute(`name`)??``,r=e.querySelector(`:scope > input[${Nn}]`),i=r instanceof HTMLInputElement?r:null;n?(i||=Fn(e),Pn(e,i,n,t)):i?.remove()}function In(e,t){let n=e.getAttribute(`name`)??``,r=[...e.querySelectorAll(`:scope > input[${Nn}]`)].filter(e=>e instanceof HTMLInputElement),i=[...e.attributes].some(e=>e.name.startsWith(`data-val`)),a=n?t.length>0?t:i?[``]:[]:[];for(let e of r.splice(a.length))e.remove();a.forEach((t,i)=>{Pn(e,r[i]??Fn(e),n,t)})}var Ln={add:`<path d="M6 12h12M12 18V6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"alert-circle":`<path d="M12 7.75V13M21.08 8.58v6.84c0 1.12-.6 2.16-1.57 2.73l-5.94 3.43c-.97.56-2.17.56-3.15 0l-5.94-3.43a3.15 3.15 0 0 1-1.57-2.73V8.58c0-1.12.6-2.16 1.57-2.73l5.94-3.43c.97-.56 2.17-.56 3.15 0l5.94 3.43c.97.57 1.57 1.6 1.57 2.73Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 16.2v.1" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>`,"alert-triangle":`<path d="M12 9v5M12 21.41H5.94c-3.47 0-4.92-2.48-3.24-5.51l3.12-5.62L8.76 5c1.78-3.21 4.7-3.21 6.48 0l2.94 5.29 3.12 5.62c1.68 3.03.22 5.51-3.24 5.51H12v-.01Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.995 17h.009" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>`,"arrow-left":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M9.57 5.93L3.5 12l6.07 6.07M20.5 12H3.67"></path>`,"arrow-right":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M14.43 5.93L20.5 12l-6.07 6.07M3.5 12h16.83"></path>`,at:`<path d="M16 12a4 4 0 1 1-8 0 4 4 0 1 1 8 0M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-3.5 7.13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>`,calendar:`<path d="M8 2v3M16 2v3M3.5 9.09h17M21 8.5V17c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5V8.5c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15.695 13.7h.009M15.695 16.7h.009M11.995 13.7h.01M11.995 16.7h.01M8.294 13.7h.01M8.294 16.7h.01" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>`,"calendar-dots":`<path d="M8 2v3M16 2v3M16 3.5c3.33.18 5 1.45 5 6.15v6.18c0 4.12-1 6.18-6 6.18H9c-5 0-6-2.06-6-6.18V9.65c0-4.7 1.67-5.96 5-6.15h8ZM20.75 17.6H3.25" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 8.25c-1.23 0-2.27.67-2.27 1.97 0 .62.29 1.09.73 1.39-.61.36-.96.94-.96 1.62 0 1.24.95 2.01 2.5 2.01 1.54 0 2.5-.77 2.5-2.01 0-.68-.35-1.27-.97-1.62.45-.31.73-.77.73-1.39 0-1.3-1.03-1.97-2.26-1.97Zm0 2.84c-.52 0-.9-.31-.9-.8 0-.5.38-.79.9-.79s.9.29.9.79c0 .49-.38.8-.9.8ZM12 14c-.66 0-1.14-.33-1.14-.93 0-.6.48-.92 1.14-.92.66 0 1.14.33 1.14.92 0 .6-.48.93-1.14.93Z" fill="currentColor"></path>`,chart:`<path d="M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15.5 18.5c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2s-2 .9-2 2v9a2 2 0 0 0 2 2ZM8.5 18.5c1.1 0 2-.9 2-2V13c0-1.1-.9-2-2-2s-2 .9-2 2v3.5a2 2 0 0 0 2 2Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,check:`<path d="m5 12.75 4.5 4.5L19 7.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>`,"check-circle":`<path d="M12 22c5.5 0 10-4.5 10-10S17.5 2 12 2 2 6.5 2 12s4.5 10 10 10Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="m7.75 12 2.83 2.83 5.67-5.66" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"chevron-down":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M19.92 8.95l-6.52 6.52c-.77.77-2.03.77-2.8 0L4.08 8.95"></path>`,"chevron-left":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M15 19.92L8.48 13.4c-.77-.77-.77-2.03 0-2.8L15 4.08"></path>`,"chevron-right":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M8.91 19.92l6.52-6.52c.77-.77.77-2.03 0-2.8L8.91 4.08"></path>`,"chevron-up":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M19.92 15.05L13.4 8.53c-.77-.77-2.03-.77-2.8 0l-6.52 6.52"></path>`,"chevrons-up-down":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M9.01 20.5l-5.02-5.01M9.01 3.5v17M14.99 3.5l5.02 5.01M14.99 20.5v-17"></path>`,circle:`<path d="M11.97 22c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 16.23a4.23 4.23 0 1 0 0-8.46 4.23 4.23 0 0 0 0 8.46Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,clock:`<path d="M22 12c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2s10 4.48 10 10Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="m15.71 15.18-3.1-1.85c-.54-.32-.98-1.09-.98-1.72v-4.1" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,code:`<path d="M9 13c-.66.33-1.21.82-1.62 1.43-.23.35-.23.79 0 1.14.41.61.96 1.1 1.62 1.43M15.21 13c.66.33 1.21.82 1.62 1.43.23.35.23.79 0 1.14-.41.61-.96 1.1-1.62 1.43" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7ZM2.23 8.01 21.45 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,comment:`<path d="M8.5 19H8c-4 0-6-1-6-6V8c0-4 2-6 6-6h8c4 0 6 2 6 6v5c0 4-2 6-6 6h-.5c-.31 0-.61.15-.8.4l-1.5 2c-.66.88-1.74.88-2.4 0l-1.5-2c-.16-.22-.53-.4-.8-.4Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15.996 11h.01M11.995 11h.01M7.995 11h.008" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>`,copy:`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16 12.9v4.2c0 3.5-1.4 4.9-4.9 4.9H6.9C3.4 22 2 20.6 2 17.1v-4.2C2 9.4 3.4 8 6.9 8h4.2c3.5 0 4.9 1.4 4.9 4.9z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M22 6.9v4.2c0 3.5-1.4 4.9-4.9 4.9H16v-3.1C16 9.4 14.6 8 11.1 8H8V6.9C8 3.4 9.4 2 12.9 2h4.2C20.6 2 22 3.4 22 6.9z"></path>`,danger:`<path d="M12 9v5M12 21.41H5.94c-3.47 0-4.92-2.48-3.24-5.51l3.12-5.62L8.76 5c1.78-3.21 4.7-3.21 6.48 0l2.94 5.29 3.12 5.62c1.68 3.03.22 5.51-3.24 5.51H12v-.01Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.995 17h.009" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>`,display:`<path d="M6.44 2h11.11C21.11 2 22 2.89 22 6.44v6.33c0 3.56-.89 4.44-4.44 4.44H6.44C2.89 17.22 2 16.33 2 12.78V6.44C2 2.89 2.89 2 6.44 2ZM12 17.22V22M2 13h20M7.5 22h9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,document:`<path d="M22 10v5c0 5-2 7-7 7H9c-5 0-7-2-7-7V9c0-5 2-7 7-7h5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22 10h-4c-3 0-4-1-4-4V2l8 8Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,download:`<path d="M9 11v6l2-2M9 17l-2-2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22 10v5c0 5-2 7-7 7H9c-5 0-7-2-7-7V9c0-5 2-7 7-7h5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22 10h-4c-3 0-4-1-4-4V2l8 8Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,edit:`<path d="m13.26 3.6-8.21 8.69c-.31.33-.61.98-.67 1.43l-.37 3.24c-.13 1.17.71 1.97 1.87 1.77l3.22-.55c.45-.08 1.08-.41 1.39-.75l8.21-8.69c1.42-1.5 2.06-3.21-.15-5.3-2.2-2.07-3.87-1.34-5.29.16Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.89 5.05a6.126 6.126 0 0 0 5.45 5.15M3 22h18" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,export:`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M9.32 6.5l2.56-2.56 2.56 2.56M11.88 14.18V4.01M4 12c0 4.42 3 8 8 8s8-3.58 8-8"></path>`,"file-text":`<path d="M21 7v10c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5V7c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M14.5 4.5v2c0 1.1.9 2 2 2h2M8 13h4M8 17h8" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,files:`<path d="M17 13.4v3c0 4-1.6 5.6-5.6 5.6H7.6c-4 0-5.6-1.6-5.6-5.6v-3.8C2 8.6 3.6 7 7.6 7h3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17 13.4h-3.2c-2.4 0-3.2-.8-3.2-3.2V7l6.4 6.4ZM11.6 2h4M7 5c0-1.66 1.34-3 3-3h2.62M22 8v6.19c0 1.55-1.26 2.81-2.81 2.81M22 8h-3c-2.25 0-3-.75-3-3V2l6 6Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,filter:`<path d="M5.4 2.1h13.2c1.1 0 2 .9 2 2v2.2c0 .8-.5 1.8-1 2.3l-4.3 3.8c-.6.5-1 1.5-1 2.3V19c0 .6-.4 1.4-.9 1.7l-1.4.9c-1.3.8-3.1-.1-3.1-1.7v-5.3c0-.7-.4-1.6-.8-2.1l-3.8-4c-.5-.5-.9-1.4-.9-2V4.2c0-1.2.9-2.1 2-2.1ZM10.93 2.1 6 10" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,flag:`<path d="M5.15 2v20M5.15 4h11.2c2.7 0 3.3 1.5 1.4 3.4l-1.2 1.2c-.8.8-.8 2.1 0 2.8l1.2 1.2c1.9 1.9 1.2 3.4-1.4 3.4H5.15" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,gauge:`<path d="M19.14 19.5a9.964 9.964 0 0 0 2.86-7c0-5.52-4.48-10-10-10S2 6.98 2 12.5c0 2.72 1.08 5.18 2.84 6.99" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 21.5a3.38 3.38 0 1 0 0-6.76 3.38 3.38 0 0 0 0 6.76ZM15.25 12H16c.82 0 1.5-.67 1.5-1.5 0-.82-.68-1.5-1.5-1.5s-1.5.67-1.5 1.5v.75c0 .41.34.75.75.75Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,grid:`<path d="M22 8.52V3.98C22 2.57 21.36 2 19.77 2h-4.04c-1.59 0-2.23.57-2.23 1.98v4.53c0 1.42.64 1.98 2.23 1.98h4.04c1.59.01 2.23-.56 2.23-1.97ZM22 19.77v-4.04c0-1.59-.64-2.23-2.23-2.23h-4.04c-1.59 0-2.23.64-2.23 2.23v4.04c0 1.59.64 2.23 2.23 2.23h4.04c1.59 0 2.23-.64 2.23-2.23ZM10.5 8.52V3.98C10.5 2.57 9.86 2 8.27 2H4.23C2.64 2 2 2.57 2 3.98v4.53c0 1.42.64 1.98 2.23 1.98h4.04c1.59.01 2.23-.56 2.23-1.97ZM10.5 19.77v-4.04c0-1.59-.64-2.23-2.23-2.23H4.23c-1.59 0-2.23.64-2.23 2.23v4.04C2 21.36 2.64 22 4.23 22h4.04c1.59 0 2.23-.64 2.23-2.23Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,image:`<path d="M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM2.67 18.95l4.93-3.31c.79-.53 1.93-.47 2.64.14l.33.29c.78.67 2.04.67 2.82 0l4.16-3.57c.78-.67 2.04-.67 2.82 0L22 13.9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,info:`<g transform="rotate(180 12 12)"><path d="M12 22c5.5 0 10-4.5 10-10S17.5 2 12 2 2 6.5 2 12s4.5 10 10 10ZM12 8v5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.995 16h.009" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></g>`,key:`<path d="M19.79 14.93a7.575 7.575 0 0 1-7.6 1.87l-4.71 4.7c-.34.35-1.01.56-1.49.49l-2.18-.3c-.72-.1-1.39-.78-1.5-1.5l-.3-2.18c-.07-.48.16-1.15.49-1.49l4.7-4.7c-.8-2.6-.18-5.55 1.88-7.6 2.95-2.95 7.74-2.95 10.7 0 2.96 2.95 2.96 7.76.01 10.71ZM6.89 17.49l2.3 2.3" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M14.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,list:`<path d="M3 4.5h18M3 9.5h9.47M3 14.5h18M3 19.5h9.47" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,lock:`<path d="M6 10V8c0-3.31 1-6 6-6s6 2.69 6 6v2M12 18.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17 22H7c-4 0-5-1-5-5v-2c0-4 1-5 5-5h10c4 0 5 1 5 5v2c0 4-1 5-5 5Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"maximize-4":`<path d="M21 9V3h-6M3 15v6h6M21 3l-7.5 7.5M10.5 13.5 3 21" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,menu:`<path d="M3 7h18M3 12h18M3 17h18" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>`,minus:`<path d="M6 12h12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,monitor:`<path d="M6.44 2h11.11C21.11 2 22 2.89 22 6.44v6.33c0 3.56-.89 4.44-4.44 4.44H6.44C2.89 17.22 2 16.33 2 12.78V6.44C2 2.89 2.89 2 6.44 2ZM12 17.22V22M2 13h20M7.5 22h9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,moon:`<path d="M2.03 12.42c.36 5.15 4.73 9.34 9.96 9.57 3.69.16 6.99-1.56 8.97-4.27.82-1.11.38-1.85-.99-1.6-.67.12-1.36.17-2.08.14C13 16.06 9 11.97 8.98 7.14c-.01-1.3.26-2.53.75-3.65.54-1.24-.11-1.83-1.36-1.3C4.41 3.86 1.7 7.85 2.03 12.42Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,music:`<path d="M6.28 22a3.12 3.12 0 1 0 0-6.24 3.12 3.12 0 0 0 0 6.24Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M20.84 16.8V4.6c0-2.6-1.63-2.96-3.28-2.51l-6.24 1.7C10.18 4.1 9.4 5 9.4 6.3v12.57" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.72 19.92a3.12 3.12 0 1 0 0-6.24 3.12 3.12 0 0 0 0 6.24ZM9.4 9.52 20.84 6.4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,pause:`<path d="M10.65 19.11V4.89c0-1.35-.57-1.89-2.01-1.89H5.01C3.57 3 3 3.54 3 4.89v14.22C3 20.46 3.57 21 5.01 21h3.63c1.44 0 2.01-.54 2.01-1.89ZM21 19.11V4.89C21 3.54 20.43 3 18.99 3h-3.63c-1.43 0-2.01.54-2.01 1.89v14.22c0 1.35.57 1.89 2.01 1.89h3.63c1.44 0 2.01-.54 2.01-1.89Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,people:`<path d="M18 7.16a.605.605 0 0 0-.19 0 2.573 2.573 0 0 1-2.48-2.58c0-1.43 1.15-2.58 2.58-2.58a2.58 2.58 0 0 1 2.58 2.58A2.589 2.589 0 0 1 18 7.16ZM16.97 14.44c1.37.23 2.88-.01 3.94-.72 1.41-.94 1.41-2.48 0-3.42-1.07-.71-2.6-.95-3.97-.71M5.97 7.16c.06-.01.13-.01.19 0a2.573 2.573 0 0 0 2.48-2.58C8.64 3.15 7.49 2 6.06 2a2.58 2.58 0 0 0-2.58 2.58c.01 1.4 1.11 2.53 2.49 2.58ZM7 14.44c-1.37.23-2.88-.01-3.94-.72-1.41-.94-1.41-2.48 0-3.42 1.07-.71 2.6-.95 3.97-.71M12 14.63a.605.605 0 0 0-.19 0 2.573 2.573 0 0 1-2.48-2.58c0-1.43 1.15-2.58 2.58-2.58a2.58 2.58 0 0 1 2.58 2.58c-.01 1.4-1.11 2.54-2.49 2.58ZM9.09 17.78c-1.41.94-1.41 2.48 0 3.42 1.6 1.07 4.22 1.07 5.82 0 1.41-.94 1.41-2.48 0-3.42-1.59-1.06-4.22-1.06-5.82 0Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,phone:`<path d="M21.97 18.33c0 .36-.08.73-.25 1.09-.17.36-.39.7-.68 1.02-.49.54-1.03.93-1.64 1.18-.6.25-1.25.38-1.95.38-1.02 0-2.11-.24-3.26-.73s-2.3-1.15-3.44-1.98a28.75 28.75 0 0 1-3.28-2.8 28.414 28.414 0 0 1-2.79-3.27c-.82-1.14-1.48-2.28-1.96-3.41C2.24 8.67 2 7.58 2 6.54c0-.68.12-1.33.36-1.93.24-.61.62-1.17 1.15-1.67C4.15 2.31 4.85 2 5.59 2c.28 0 .56.06.81.18.26.12.49.3.67.56l2.32 3.27c.18.25.31.48.4.7.09.21.14.42.14.61 0 .24-.07.48-.21.71-.13.23-.32.47-.56.71l-.76.79c-.11.11-.16.24-.16.4 0 .08.01.15.03.23.03.08.06.14.08.2.18.33.49.76.93 1.28.45.52.93 1.05 1.45 1.58.54.53 1.06 1.02 1.59 1.47.52.44.95.74 1.29.92.05.02.11.05.18.08.08.03.16.04.25.04.17 0 .3-.06.41-.17l.76-.75c.25-.25.49-.44.72-.56.23-.14.46-.21.71-.21.19 0 .39.04.61.13.22.09.45.22.7.39l3.31 2.35c.26.18.44.39.55.64.1.25.16.5.16.78Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10"></path>`,play:`<path d="M4 12V8.44c0-4.42 3.13-6.23 6.96-4.02l3.09 1.78 3.09 1.78c3.83 2.21 3.83 5.83 0 8.04l-3.09 1.78-3.09 1.78C7.13 21.79 4 19.98 4 15.56V12Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,printer:`<path d="M7.25 7h9.5V5c0-2-.75-3-3-3h-3.5c-2.25 0-3 1-3 3v2ZM16 15v4c0 2-1 3-3 3h-2c-2 0-3-1-3-3v-4h8Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M21 10v5c0 2-1 3-3 3h-2v-3H8v3H6c-2 0-3-1-3-3v-5c0-2 1-3 3-3h12c2 0 3 1 3 3ZM17 15H7M7 11h3" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,refresh:`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M22 12c0 5.52-4.48 10-10 10s-8.89-5.56-8.89-5.56m0 0h4.52m-4.52 0v5M2 12C2 6.48 6.44 2 12 2c6.67 0 10 5.56 10 5.56m0 0v-5m0 5h-4.44"></path>`,"rotate-ccw":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.11 5.08c.87-.26 1.83-.43 2.89-.43 4.79 0 8.67 3.88 8.67 8.67s-3.88 8.67-8.67 8.67-8.67-3.88-8.67-8.67c0-1.78.54-3.44 1.46-4.82M7.87 5.32L10.76 2M7.87 5.32l3.37 2.46"></path>`,"rotate-cw":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M14.89 5.08c-.87-.26-1.83-.43-2.89-.43-4.79 0-8.67 3.88-8.67 8.67C3.33 18.12 7.21 22 12 22s8.67-3.88 8.67-8.67c0-1.78-.54-3.44-1.46-4.82M16.13 5.32L13.24 2M16.13 5.32l-3.37 2.46"></path>`,search:`<path d="M11.5 21a9.5 9.5 0 1 0 0-19 9.5 9.5 0 0 0 0 19ZM22 22l-2-2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,send:`<path d="m7.4 6.32 8.49-2.83c3.81-1.27 5.88.81 4.62 4.62l-2.83 8.49c-1.9 5.71-5.02 5.71-6.92 0l-.84-2.52-2.52-.84c-5.71-1.9-5.71-5.01 0-6.92ZM10.11 13.65l3.58-3.59" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,server:`<path d="M19.32 10H4.69c-1.48 0-2.68-1.21-2.68-2.68V4.69c0-1.48 1.21-2.68 2.68-2.68h14.63C20.8 2.01 22 3.22 22 4.69v2.63C22 8.79 20.79 10 19.32 10ZM19.32 22H4.69c-1.48 0-2.68-1.21-2.68-2.68v-2.63c0-1.48 1.21-2.68 2.68-2.68h14.63c1.48 0 2.68 1.21 2.68 2.68v2.63c0 1.47-1.21 2.68-2.68 2.68ZM6 5v2M10 5v2M6 17v2M10 17v2M14 6h4M14 18h4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,subtitle:`<path d="M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7ZM17.5 17.08h-1.85M12.97 17.08H6.5M17.5 13.32h-5.53M9.27 13.32H6.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,sun:`<path d="M12 18.5a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="m19.14 19.14-.13-.13m0-14.02.13-.13-.13.13ZM4.86 19.14l.13-.13-.13.13ZM12 2.08V2v.08ZM12 22v-.08.08ZM2.08 12H2h.08ZM22 12h-.08.08ZM4.99 4.99l-.13-.13.13.13Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>`,tag:`<path d="m4.405 15.526 4.53 4.53a4.78 4.78 0 0 0 6.75 0l4.39-4.39a4.78 4.78 0 0 0 0-6.75l-4.54-4.52a4.75 4.75 0 0 0-3.6-1.39l-5 .24c-2 .09-3.59 1.68-3.69 3.67l-.24 5c-.06 1.35.45 2.66 1.4 3.61Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.735 12.226a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path><path d="m13.235 17.226 4-4" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,text:`<path d="M2.67 7.17V5.35c0-1.15.93-2.07 2.07-2.07h14.52c1.15 0 2.07.93 2.07 2.07v1.82M12 20.72V4.11M8.06 20.72h7.88" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"two-page":`<path d="M22 16.74V4.67c0-1.2-.98-2.09-2.17-1.99h-.06c-2.1.18-5.29 1.25-7.07 2.37l-.17.11c-.29.18-.77.18-1.06 0l-.25-.15C9.44 3.9 6.26 2.84 4.16 2.67 2.97 2.57 2 3.47 2 4.66v12.08c0 .96.78 1.86 1.74 1.98l.29.04c2.17.29 5.52 1.39 7.44 2.44l.04.02c.27.15.7.15.96 0 1.92-1.06 5.28-2.17 7.46-2.46l.33-.04c.96-.12 1.74-1.02 1.74-1.98ZM12 5.49v15M7.75 8.49H5.5M8.5 11.49h-3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,user:`<path d="M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10ZM20.59 22c0-3.87-3.85-7-8.59-7s-8.59 3.13-8.59 7" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"volume-high":`<path d="M2 10v4c0 2 1 3 3 3h1.43c.37 0 .74.11 1.06.3l2.92 1.83c2.52 1.58 4.59.43 4.59-2.54V7.41c0-2.98-2.07-4.12-4.59-2.54L7.49 6.7c-.32.19-.69.3-1.06.3H5c-2 0-3 1-3 3Z" stroke="currentColor" stroke-width="1.5"></path><path d="M18 8a6.66 6.66 0 0 1 0 8M19.83 5.5a10.83 10.83 0 0 1 0 13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"volume-mute":`<path d="M15 8.37v-.96c0-2.98-2.07-4.12-4.59-2.54L7.49 6.7c-.32.19-.69.3-1.06.3H5c-2 0-3 1-3 3v4c0 2 1 3 3 3h2M10.41 19.13c2.52 1.58 4.59.43 4.59-2.54v-3.64M18.81 9.42c.9 2.15.63 4.66-.81 6.58M21.15 7.8a10.82 10.82 0 0 1-1.32 10.7M22 2 2 22" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,x:`<path d="M6.4 6.4l11.2 11.2M17.6 6.4 6.4 17.6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>`,"zoom-in":`<path d="M11 20a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM8.5 11h5M11 13.5v-5M18.93 20.69c.53 1.6 1.74 1.76 2.67.36.85-1.28.29-2.33-1.25-2.33-1.14-.01-1.78.88-1.42 1.97Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"zoom-out":`<path d="M9 11.7h5M11.5 21a9.5 9.5 0 1 0 0-19 9.5 9.5 0 0 0 0 19ZM22 22l-2-2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`},Rn=n({devError:()=>R,devWarn:()=>zn});function zn(e,...t){console.warn(e,...t)}function R(e,...t){console.error(e,...t)}var Bn=Object.freeze({carousel:{entries:[`elements/carousel.ts`],tags:[`wui-carousel`]},"code-block":{entries:[`elements/code-block.ts`],tags:[`wui-code-block`]},"command-palette":{entries:[`elements/command-palette.ts`],tags:[`wui-command-palette`]},"comment-thread":{entries:[`elements/comment-thread.ts`],tags:[`wui-mention-input`,`wui-comment-thread`]},"consent-banner":{entries:[`elements/consent-banner.ts`],tags:[`wui-consent-banner`]},"context-menu":{entries:[`elements/context-menu.ts`],tags:[`wui-context-menu`]},"date-range":{entries:[`elements/date-range.ts`],tags:[`wui-date-range`]},drawer:{entries:[`elements/drawer.ts`],tags:[`wui-drawer`]},"image-crop":{entries:[`elements/image-crop.ts`],tags:[`wui-image-crop`]},"inline-edit":{entries:[`elements/inline-edit.ts`],tags:[`wui-inline-edit`]},kanban:{entries:[`elements/kanban.ts`],tags:[`wui-kanban`]},"lead-popup":{entries:[`elements/lead-popup.ts`],tags:[`wui-lead-popup`]},lightbox:{entries:[`elements/lightbox.ts`],tags:[`wui-lightbox`]},"org-tree":{entries:[`elements/org-tree.ts`],tags:[`wui-org-tree`]},markdown:{entries:[`elements/markdown.ts`],tags:[`wui-markdown`]},phone:{entries:[`elements/phone.ts`,`global/parts/select-country.ts`],tags:[`wui-phone`]},resizable:{entries:[`elements/resizable.ts`],tags:[`wui-resizable`]},"saved-views":{entries:[`elements/saved-views.ts`],tags:[`wui-saved-views`]},glyphs:{entries:[`global/parts/glyphs.ts`],tags:[]},"select-chips":{entries:[`global/parts/select-chips.ts`],tags:[]},"select-recents":{entries:[`global/parts/select-recents.ts`],tags:[]},"select-search":{entries:[`global/parts/select-search.ts`],tags:[]},slider:{entries:[`elements/slider.ts`],tags:[`wui-slider`]},sortable:{entries:[`elements/sortable.ts`],tags:[`wui-sortable`]},"status-icon":{entries:[`elements/status-icon.ts`],tags:[`wui-status-icon`]},timepicker:{entries:[`elements/timepicker.ts`],tags:[`wui-timepicker`]},tour:{entries:[`elements/tour.ts`],tags:[`wui-tour`]},tree:{entries:[`elements/tree.ts`],tags:[`wui-tree`]},wizard:{entries:[`elements/wizard.ts`],tags:[`wui-wizard-step`,`wui-wizard`]},chart:{file:`ui-chart.global.js`,tags:[`wui-chart`],selfContained:!0},calendar:{file:`ui-calendar.global.js`,tags:[`wui-calendar`],selfContained:!0},"rich-text":{file:`ui-rich-text.global.js`,tags:[`wui-rich-text`],selfContained:!0},"file-viewer":{file:`ui-file-viewer.global.js`,tags:[`wui-file-viewer`],selfContained:!0}});Object.freeze({anchorOverlay:`anchorOverlay.ts`,buttonClass:`buttonClass.ts`,calendarMath:`calendarMath.ts`,copyText:`copyText.ts`,dataTable:`dataTable.ts`,defineElement:`defineElement.ts`,devWarn:`devWarn.ts`,elementBase:`elementBase.ts`,fieldState:`fieldState.ts`,formatters:`formatters.ts`,formMirror:`formMirror.ts`,glyphs:`global/glyphs.ts`,iconGlyphs:`iconGlyphs.g.ts`,listboxKeyNav:`listboxKeyNav.ts`,loader:`global/loader.ts`,mentionText:`mentionText.ts`,notificationDays:`notificationDays.ts`,optionLabel:`optionLabel.ts`,partRegistry:`select/partRegistry.ts`,selectList:`select/list.ts`,selectRemote:`select/remote.ts`,stepperHeader:`stepperHeader.ts`,tableSelect:`tableSelect.ts`,textMatch:`textMatch.ts`,wuiHttp:`server/wuiHttp.ts`,WuiSelect:`WuiSelect.ts`,zone:`zone.ts`});var Vn=`ui-elements/`;function Hn(e){let t=Bn[e];if(t===void 0)throw Error(`[webority-ui] No on-demand element chunk is named ${e}.`);return t}function Un(e){let t=Hn(e);if(!t.selfContained)return`${Vn+e}.global.js`;if(t.file===void 0)throw Error(`[webority-ui] The self-contained element chunk ${e} names no file.`);return t.file}var Wn=n({CHUNK_DIR:()=>Vn,CHUNK_RETRY_MS:()=>qn,ELEMENTS_DEFINED_EVENT:()=>Gn,ELEMENTS_LOAD_ERROR_EVENT:()=>Kn,assetUrl:()=>or,loadChunk:()=>sr,startElementLoader:()=>rr,stopElementLoader:()=>ir,whenElementsReady:()=>ar}),Gn=`wui-elements:defined`,Kn=`wui-elements:load-error`,qn=1e3,Jn={"ui-elements/carousel.global.js":`38d76438b352`,"ui-elements/code-block.global.js":`992797fc4141`,"ui-elements/command-palette.global.js":`7d4e0d931822`,"ui-elements/comment-thread.global.js":`f3f934a1457d`,"ui-elements/consent-banner.global.js":`bb59549d3925`,"ui-elements/context-menu.global.js":`f3a99af06b38`,"ui-elements/date-range.global.js":`bfd7af737984`,"ui-elements/drawer.global.js":`00de2442c6b8`,"ui-elements/image-crop.global.js":`6f93188d21bf`,"ui-elements/inline-edit.global.js":`605bcc707568`,"ui-elements/kanban.global.js":`4983a76ee85e`,"ui-elements/lead-popup.global.js":`74cb79467e3d`,"ui-elements/lightbox.global.js":`5a497d81a56e`,"ui-elements/org-tree.global.js":`319e3e5b81ad`,"ui-elements/markdown.global.js":`03075184f405`,"ui-elements/phone.global.js":`54d2ec4c3c8e`,"ui-elements/resizable.global.js":`08fb366dcb1c`,"ui-elements/saved-views.global.js":`88942367ea2f`,"ui-elements/glyphs.global.js":`20451595c58f`,"ui-elements/select-chips.global.js":`c2424e4c039e`,"ui-elements/select-recents.global.js":`d7510c7f61dd`,"ui-elements/select-search.global.js":`f986fcc2468a`,"ui-elements/slider.global.js":`648dff021e98`,"ui-elements/sortable.global.js":`4eff9a7db2a2`,"ui-elements/status-icon.global.js":`23ef3f0465fb`,"ui-elements/timepicker.global.js":`9700f91857d6`,"ui-elements/tour.global.js":`dbb4818c0d29`,"ui-elements/tree.global.js":`a66ce1f63163`,"ui-elements/wizard.global.js":`63104af2b906`,"ui-chart.global.js":`c9a3c288aac1`,"ui-calendar.global.js":`a2b2fca6b5a2`,"ui-rich-text.global.js":`5ca9a3b2eaec`,"ui-file-viewer.global.js":`b95f4593a136`,"ui-phone.global.js":`c646775bc1d1`},Yn=new Map;for(let[e,t]of Object.entries(Bn))for(let n of t.tags)Yn.set(n,e);var Xn=[...Yn.keys()].join(`,`),Zn=null,Qn=``,$n=!1,er=null,tr=new Map;function nr(){let e=document.currentScript;return e instanceof HTMLScriptElement?e:null}function rr(e=nr()){$n||($n=!0,Zn=e?.src?e.src:null,Qn=e?.nonce||``,dr(document),er=new MutationObserver(e=>{for(let t of e)for(let e of t.addedNodes)e instanceof Element&&dr(e)}),er.observe(document.documentElement,{childList:!0,subtree:!0}))}function ir(){er?.disconnect(),er=null,$n=!1,Zn=null,Qn=``,tr.clear()}function ar(e=document){return Promise.all([...ur(e)].map(e=>sr(e))).then(()=>void 0)}function or(e){if(Zn===null)throw Error(`The on-demand element files have no address to load from.`);let t=new URL(e,Zn);return t.search=Object.hasOwn(Jn,e)?`?v=${Jn[e]}`:``,t.href}function sr(e){let t=tr.get(e);if(t?.promise)return t.promise;let n=Hn(e),{tags:r}=n,i=Un(e),a=()=>Promise.all(r.map(e=>customElements.whenDefined(e))),o={status:`loading`,promise:null},s=new Promise((t,s)=>{let c=``,l=()=>{er&&Object.keys(Bn).every(e=>tr.get(e)?.status===`loaded`||tr.get(e)?.status===`failed`)&&er.disconnect()},u=()=>{o.status=`loaded`,l(),document.dispatchEvent(new CustomEvent(Gn,{detail:{chunk:e,tags:r}})),t()},d=t=>{o.status=`failed`,l(),R(`[webority-ui] Could not load ${c} for ${r.length?r.join(`, `):e}.${t?` ${t.message}`:``}`),document.dispatchEvent(new CustomEvent(Kn,{detail:{chunk:e,url:c,tags:r}})),s(Error(`[webority-ui] The ${e} elements failed to load.`))},f=(e,t)=>{let i=document.createElement(`script`);i.src=e,i.async=!1,Qn&&(i.nonce=Qn),i.addEventListener(`load`,()=>{!n.selfContained&&!r.every(e=>customElements.get(e))?d(Error(`The file ran but did not define its elements; see the error above.`)):a().then(u)}),i.addEventListener(`error`,()=>{i.remove(),t?d():setTimeout(()=>f(e,!0),qn)}),document.head.append(i)};if([...document.scripts].some(e=>new URL(e.src,location.href).pathname.endsWith(`/${i}`)))a().then(u);else{try{c=or(i)}catch(e){d(e instanceof Error?e:void 0);return}f(c,!1)}});return o.promise=s,tr.set(e,o),s}function cr(e){return Yn.has(e.localName)&&!customElements.get(e.localName)}function lr(e,t){let n=Yn.get(t.localName);n!==void 0&&cr(t)&&e.add(n)}function ur(e){let t=new Set;e instanceof Element&&lr(t,e);for(let n of e.querySelectorAll(Xn))lr(t,n);return t}function dr(e){for(let t of ur(e))Promise.allSettled([sr(t)])}var fr=n({GLYPH_CHUNK:()=>pr,GLYPH_PENDING_ATTRIBUTE:()=>mr,glyphSvg:()=>z,registerGlyphs:()=>Sr}),pr=`glyphs`,mr=`data-wui-glyph-pending`,hr=`svg[${mr}]`,gr=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,_r={...Ln},vr=!1,yr=null;function br(e,t,n,r,i){return`<svg class="${n?`wui-icon ${n}`:`wui-icon`}" data-icon="${e}"${i?` ${mr}`:``} width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" aria-hidden="true">${r}</svg>`}function z(e,{size:t=16,className:n=``}={}){let r=_r[e];return r===void 0?vr||!gr.test(e)?``:(Promise.allSettled([sr(pr)]),br(e,t,n,``,!0)):br(e,t,n,r,!1)}function xr(e){let t=e instanceof Element&&e.matches(hr)?[e]:[];for(let n of[...t,...e.querySelectorAll(hr)]){let e=_r[n.getAttribute(`data-icon`)??``];e===void 0?n.remove():(n.removeAttribute(mr),n.innerHTML=e)}}function Sr(e){Object.assign(_r,e),vr=!0,xr(document),yr===null&&(yr=new MutationObserver(e=>{for(let t of e)for(let e of t.addedNodes)e instanceof Element&&xr(e)}),yr.observe(document.documentElement,{childList:!0,subtree:!0}))}var Cr=n({TRUSTED_HTML:()=>wr,escapeHtml:()=>B,optionLabelHtml:()=>kr,optionText:()=>Mr,stripTags:()=>Ar,withTrustedLabel:()=>Tr}),wr=Symbol(`wui.trustedHtml`),Tr=e=>({...e,[wr]:!0}),B=e=>String(e??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),Er=e=>{if(!e)return``;let t=String(e).toLowerCase().replace(/[^a-z0-9-]/g,``);return t?z(t):``},Dr=e=>`wui-flag wui-flag-${e}`,Or=e=>{let t=String(e??``).toLowerCase();return/^[a-z]{2}$/.test(t)?`<span class="${Dr(t)}" aria-hidden="true"></span>`:``},kr=e=>{if(e==null)return``;let t=e[wr]?String(e.label??``):B(e.label),n=Or(e.flag)+Er(e.icon);return n?`<span class="wui-opt-label">${n}${t}</span>`:t},Ar=e=>String(e??``).replace(/<[^>]*>/g,``),jr=new WeakMap,Mr=e=>{if(e==null)return``;if(!e[wr])return Ar(e.label);let t=jr.get(e);if(t&&t.label===e.label)return t.text;let n=document.createElement(`template`);n.innerHTML=String(e.label??``);let r=n.content.textContent??``;return jr.set(e,{label:e.label,text:r}),r},Nr=class extends g{static formAssociated=!0;static get observedAttributes(){return[`value`,`min`,`max`,`placeholder`,`disabled`,`readonly`,`loading`,`first-day`,`disabled-weekdays`,`display-format`,`size`,`aria-label`,`aria-describedby`,`aria-invalid`]}_internals;_value;_defaultValue;_rendered;_viewY;_viewM;_mode;_focus;_slide;_viewNavigated;_openFn;_closeFn;_bindGlobal;_onKeyBound;_onDocClick;_onDocKey;_onHostKey;get _open(){return _(this._openFn,`open missing`)}get _close(){return _(this._closeFn,`close missing`)}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``;let e=new Date(2e3,0,1);this._viewY=e.getFullYear(),this._viewM=e.getMonth(),this._mode=`days`,this._focus=null,this._slide=``}connectedCallback(){this._rendered?this._bindGlobal?.():this.render()}attributeChangedCallback(e,t,n){if(e===`aria-invalid`)this._syncInvalid();else if(this._rendered){if(e===`value`)this._value=n||``,this._syncFormValue(),this._syncTrigger();else if(e===`display-format`)this._syncTrigger();else if(e===`first-day`){let e=this.querySelector(`.datepicker-pop`);e instanceof HTMLDivElement&&e.hidden||this._renderView()}else this.render()}}_syncInvalid(){let e=this.querySelector(`.datepicker-trigger`);e instanceof HTMLButtonElement&&(this.hasAttribute(`aria-invalid`)?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}formResetCallback(){this.value=this._defaultValue||``}get value(){return this._value}set value(e){this._value=e||``,L(this,this._value),this._syncTrigger()}_firstDay(){return xn(this)}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``,this._value=this._defaultValue||this._value);let e=this.getAttribute(`placeholder`)||`Choose a date`,t=F(this._value);t&&(this._viewY=t.y,this._viewM=t.m);let n=this.getAttribute(`size`),r=n===`sm`?` input-sm`:n===`lg`?` input-lg`:``,i=this.getAttribute(`aria-label`),a=this.getAttribute(`aria-describedby`);this.innerHTML=`
1
+ var WeborityUiElements=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},r=n({defineElement:()=>i});function i(e,t){if(typeof customElements>`u`||customElements.get(e))return;let n=[];if(typeof document<`u`)for(let r of document.querySelectorAll(e))for(let i of Object.keys(r)){let a=Object.getOwnPropertyDescriptor(t.prototype,i);if(a&&(a.set||a.get)&&(n.push([r,i,Reflect.get(r,i)]),!Reflect.deleteProperty(r,i)))throw Error(`defineElement: could not clear the early "${i}" property on <${e}>.`)}customElements.define(e,t);for(let[t,r,i]of n)if(!Reflect.set(t,r,i))throw Error(`defineElement: could not restore the "${r}" property on <${e}>.`)}var a=n({ElementBase:()=>s,NO_DOM_MESSAGE:()=>o}),o=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(o);var s=HTMLElement,c=n({anchorOverlay:()=>x,bindReanchor:()=>S,unbindReanchor:()=>C}),l=4,u=8,d=300,f=400;function p(e,t){let n=t.offsetWidth,r=t.offsetHeight,i=e.right+l+n>window.innerWidth-l,a=i?e.left-l-n:e.right+l;t.style.left=`${Math.max(l,a)}px`,t.style.top=`${Math.max(l,Math.min(e.top,window.innerHeight-r-l))}px`,t.dataset.side=i?`start`:`end`}var m=8,h={top:`bottom`,bottom:`top`,start:`end`,end:`start`},g=[`bottom`,`top`,`end`,`start`];function _(e,t){return e===`bottom`?window.innerHeight-t.bottom:e===`top`?t.top:e===`end`?window.innerWidth-t.right:t.left}function v(e,t,n,r){return e===`start`?t:e===`end`?n-r:t+(n-t-r)/2}function y(e,t,n){return Math.max(m,Math.min(e,t-n-m))}function b(e,t,n,r){let i=r.gap??l,a=r.align??`start`,o=t.offsetWidth,s=t.offsetHeight,c=n===`auto`?g.reduce((t,n)=>_(n,e)>_(t,e)?n:t):n,u=c===`top`||c===`bottom`,d=(u?s:o)+i,f=_(c,e)<d&&_(h[c],e)>_(c,e)?h[c]:c,p,m;if(u){m=f===`bottom`?e.bottom+i:Math.max(l,e.top-s-i);let t=v(a,e.left,e.right,o);r.flipAlign&&a===`start`&&t+o>window.innerWidth-l&&e.right-o>=l?t=e.right-o:r.flipAlign&&a===`end`&&t<l&&e.left+o<=window.innerWidth-l&&(t=e.left),p=Math.max(l,Math.min(t,window.innerWidth-o-l))}else p=Math.max(l,f===`end`?e.right+i:e.left-o-i),m=Math.max(l,Math.min(v(a,e.top,e.bottom,s),window.innerHeight-s-l));t.style.left=`${p}px`,t.style.top=`${m}px`,t.dataset.side=f;let b=r.arrow;if(b){if(u){let t=(e.left+e.right)/2-p-b.offsetWidth/2;b.style.left=`${y(t,o,b.offsetWidth)}px`}else{let t=(e.top+e.bottom)/2-m-b.offsetHeight/2;b.style.top=`${y(t,s,b.offsetHeight)}px`}}}function x(e,t,n={}){if(!e)throw Error(`anchorOverlay: missing trigger`);if(!t)throw Error(`anchorOverlay: missing panel`);t.style.position=`fixed`;let r=e.getBoundingClientRect();if(n.beside){p(r,t);return}if(n.side!==void 0){t.classList.remove(`drop-up`),t.style.maxHeight=``,b(r,t,n.side,n);return}let i=n.clampHeight?t.scrollTop:0;n.clampHeight&&(t.style.maxHeight=``);let a=t.offsetHeight,o=window.innerHeight-r.bottom,s=!n.below&&o<a+l&&r.top>o;if(t.classList.toggle(`drop-up`,s),t.style.top=s?`${Math.max(l,r.top-a-l)}px`:`${r.bottom+l}px`,n.clampHeight){let e=s?r.top-8:window.innerHeight-r.bottom-8;e<a&&(t.style.maxHeight=`${Math.max(e,0)}px`),t.scrollTop=i}n.matchWidth&&(r.width>=d?(t.style.minWidth=`${r.width}px`,t.style.width=`${r.width}px`,t.style.maxWidth=`${r.width}px`):(t.style.minWidth=`${r.width}px`,t.style.width=`max-content`,t.style.maxWidth=`${Math.min(f,window.innerWidth-8)}px`));let c=t.offsetWidth;if(n.alignEnd){let e=r.right-c,n=e>=u?e:r.left,i=Math.max(u,Math.min(n,window.innerWidth-c-u));t.style.left=`${i}px`}else{let e=n.flipAlign&&r.left+c>window.innerWidth-l&&r.right-c>=l,i=Math.min(e?r.right-c:r.left,window.innerWidth-c-l);t.style.left=`${Math.max(l,i)}px`}}function S(e,t){C(e),e._reanchor=t,e._reanchorScroll=n=>{n.composedPath().includes(e)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function C(e){if(!e?._reanchor)return;window.removeEventListener(`resize`,e._reanchor);let t=e._reanchorScroll;t&&window.removeEventListener(`scroll`,t,!0),e._reanchor=null,e._reanchorScroll=null}var w=n({CLOSE_MOTION_LIMIT_MS:()=>400,CLOSING_ATTRIBUTE:()=>D,DISMISS_ATTRIBUTE:()=>E,OPEN_ATTRIBUTE:()=>T,closeAnchoredPopover:()=>j,closeModalDialog:()=>Se,isPopoverOpen:()=>M,onOverlayRootChange:()=>De,openAnchoredPopover:()=>A,openModalDialog:()=>xe,overlayRoot:()=>Ee,raisePopover:()=>we,returnFocus:()=>ve,setPopoverOpen:()=>Ce,wireOpenTriggers:()=>Oe}),T=`data-wui-open`,E=`data-wui-dismiss`,D=`data-wui-closing`,ee=`[${E}]`,O=`[${T}]`,te=`(prefers-reduced-motion: reduce)`,ne=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,re=400,ie=new WeakSet,ae=new Set,oe=new WeakSet,se=new WeakSet,ce=Symbol.for(`webority.ui.modal-stack`),le=new WeakMap,ue=new WeakMap,de=new WeakMap;function fe(e){let t=e.querySelector(`[data-autofocus]`);if(t)return t;let n=null;for(let t of e.querySelectorAll(ne))if(!t.closest(`[hidden],[inert]`)){if(!t.closest(`${ee},.wui-modal-back`))return t;n??=t}return n}function pe(e){return e.localName.includes(`-`)&&`show`in e&&typeof e.show==`function`}function me(e){let t=e;return t[ce]??=[],t[ce]}function he(e){k(e),me(e.ownerDocument).push(e)}function k(e){let t=me(e.ownerDocument),n=t.indexOf(e);n>=0&&t.splice(n,1)}function ge(e){for(let t of ae){if(t.doc!==e)continue;let n=Ee(e);t.last!==n&&(t.last=n,t.listener(n))}}function _e(e){let t=Promise.allSettled(e.getAnimations().map(e=>e.finished));return new Promise(e=>{let n=window.setTimeout(e,400);t.then(()=>{window.clearTimeout(n),e()})})}function ve(e,t){if(!e?.isConnected)return;let n=e.ownerDocument.activeElement;(!n||n===e.ownerDocument.body||t.contains(n))&&e.focus()}function ye(e){let t=e.getBoundingClientRect();return t.bottom<0||t.right<0||t.top>window.innerHeight||t.left>window.innerWidth}function be(e,t){de.get(e)?.();let n=t.ownerDocument,r=0,i=()=>{window.clearTimeout(o),window.clearTimeout(r),n.removeEventListener(`pointerdown`,i,!0),t.removeEventListener(`click`,a,!0),de.delete(e)},a=()=>{t.removeEventListener(`click`,a,!0),r=window.setTimeout(i,0)},o=window.setTimeout(i,re);n.addEventListener(`pointerdown`,i,!0),t.addEventListener(`click`,a,!0),de.set(e,i)}function xe(e,t){let n=t.focus===`first-control`?fe(e):null,r=n??e,i=r===e&&!e.hasAttribute(`tabindex`);i&&e.setAttribute(`tabindex`,`-1`);let a=!t.escape&&!e.hasAttribute(`closedby`);a&&e.setAttribute(`closedby`,`none`),ie.add(e);let o=()=>{if(he(e),!e.hasAttribute(`open`)){let t=n!==null&&!e.querySelector(`[autofocus]`);t&&n.setAttribute(`autofocus`,``);try{e.showModal()}catch(t){throw k(e),t}finally{t&&n.removeAttribute(`autofocus`)}}r.focus(),ge(e.ownerDocument)},s=!1,c=n=>{if(n.key!==`Escape`||n.defaultPrevented||!t.escape)return;let r=e.ownerDocument;Ee(r)===e&&(e.querySelector(`:popover-open`)||r.querySelector(`[popover=""]:popover-open, [popover="auto"]:popover-open`)||(s=!0,window.setTimeout(()=>{s&&(s=!1,ie.has(e)&&e.open&&t.onRequestClose(`escape`))},0)))},l=e=>{s=!1,e.preventDefault(),t.escape&&t.onRequestClose(`escape`)},u=n=>{let r=n.target;if(!(r instanceof Element))return;let i=r.closest(ee);if(i&&i.closest(`dialog`)===e){t.onRequestClose(`dismiss`);return}if(r!==e||!t.backdrop)return;let a=e.getBoundingClientRect();(n.clientX<a.left||n.clientX>a.right||n.clientY<a.top||n.clientY>a.bottom)&&t.onRequestClose(`backdrop`)},d=()=>{let n=s;s=!1,k(e),ie.has(e)?(o(),n&&t.onRequestClose(`escape`)):ge(e.ownerDocument)};return e.addEventListener(`keydown`,c),e.addEventListener(`cancel`,l),e.addEventListener(`click`,u),e.addEventListener(`close`,d),o(),()=>{e.removeEventListener(`keydown`,c),e.removeEventListener(`cancel`,l),e.removeEventListener(`click`,u),e.removeEventListener(`close`,d),ie.delete(e),i&&e.removeAttribute(`tabindex`),a&&e.removeAttribute(`closedby`),k(e),ge(e.ownerDocument)}}async function Se(e){ie.delete(e),e.setAttribute(D,``),!window.matchMedia(te).matches&&typeof e.getAnimations==`function`&&e.getAnimations().length>0&&await _e(e),e.close(),k(e),ge(e.ownerDocument),e.removeAttribute(D)}function A(e,t,n){let r=de.get(t);if(r){r();return}le.get(t)?.(),t.setAttribute(`popover`,n.mode),t.showPopover();let i=()=>x(e,t,n);try{i()}catch(e){throw j(t),e}S(t,()=>{!M(t)||!t.isConnected?ue.get(t)?.():!e.isConnected||!n.keepOffscreen&&ye(e)?j(t):i()});let a=e=>{`newState`in e&&e.newState===`closed`&&ue.get(t)?.()},o=()=>{n.mode===`auto`&&M(t)&&be(t,e)};t.addEventListener(`toggle`,a),e.addEventListener(`pointerdown`,o,!0),le.set(t,()=>{t.removeEventListener(`toggle`,a),e.removeEventListener(`pointerdown`,o,!0),C(t),le.delete(t),ue.delete(t)}),ue.set(t,()=>{le.get(t)?.(),n.onClosed?.()})}function j(e){M(e)&&e.hidePopover(),ue.get(e)?.()}function M(e){return e.matches(`:popover-open`)}function Ce(e,t){Te(e),M(e)!==t&&(t?e.showPopover():e.hidePopover())}function we(e){Te(e),e.hidePopover(),e.showPopover()}function Te(e){if(!e.hasAttribute(`popover`))throw Error(`nativeOverlay: the panel has no popover attribute`)}function Ee(e=document){let t=me(e);for(let e=t.length-1;e>=0;e--){let n=t[e];if(n?.isConnected&&n.hasAttribute(`open`))return n}return e.body}function De(e,t=document){oe.has(t)||(oe.add(t),t.addEventListener(`toggle`,()=>ge(t),!0),t.addEventListener(`close`,()=>ge(t),!0));let n={doc:t,last:Ee(t),listener:e};return ae.add(n),()=>{ae.delete(n)}}function Oe(e){se.has(e)||(se.add(e),e.addEventListener(`click`,t=>{let n=t.target,r=n instanceof Element?n.closest(O):null;if(!(r instanceof HTMLElement))return;let i=(r.getAttribute(`data-wui-open`)??``).replace(/^#/,``),a=e.getElementById(i);if(!a)throw Error(`[data-wui-open] names #${i}, which is not on the page.`);pe(a)&&(t.preventDefault(),a.show(r))}))}function N(e,t){if(e==null)throw Error(t);return e}function ke(e,t,n){if(!(e instanceof t))throw TypeError(n);return e}function P(e,t){return e instanceof Element?e.closest(t):null}var Ae=`data-wui-shortcuts`,je=`data-shortcut-scope`,Me=`wui:shortcut`,Ne={title:`Keyboard shortcuts`,close:`Close`,help:`Show these shortcuts`},Pe=[{key:`J`,label:`Next item`},{key:`K`,label:`Previous item`},{key:`Enter`,label:`Open the item`}],Fe={key:`X`,label:`Select the item`},Ie={"/":`slash`,"?":`help`,Escape:`esc`,Esc:`esc`,Enter:`enter`},Le={esc:`Esc`,escape:`Esc`,enter:`Enter`,slash:`/`,help:`?`},Re={esc:`Escape`,ctrl:`Control`,cmd:`Meta`,option:`Alt`,opt:`Alt`},ze=new Set([`checkbox`,`radio`,`button`,`submit`,`reset`,`range`,`color`,`file`,`image`]),Be=new Set([`textbox`,`searchbox`,`combobox`]),Ve=`a[href], button, summary, input, select, textarea, [role="button"], [role="link"], [role="menuitem"], [role="option"], [role="tab"], [role="checkbox"], [role="switch"]`;function He(e){if(!e||e.ctrlKey||e.metaKey||e.altKey)return null;let t=e.key;return typeof t!=`string`||!t?null:Ie[t]?Ie[t]:t.length===1&&t.trim()?t.toLowerCase():null}function Ue(e){let t=String(e??``).trim();return t.length===1?t.toUpperCase():Le[t.toLowerCase()]??t}function We(e){return String(e??``).trim().split(/\s+/).filter(Boolean).map(e=>Re[e.toLowerCase()]??(e.length===1?e.toUpperCase():e)).join(`+`)}function Ge(e){if(!e||!Ke(e))return!1;if(e instanceof HTMLElement&&e.isContentEditable||e.closest?.(`[contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]`)||e.tagName===`TEXTAREA`||e.tagName===`SELECT`)return!0;if(e.tagName===`INPUT`){let t=e instanceof HTMLInputElement&&e.type?e.type:`text`;return!ze.has(t.toLowerCase())}return Be.has(e.getAttribute?.(`role`))}function Ke(e){return e.nodeType===1}function qe(e=typeof document>`u`?null:document){return e?.documentElement?.getAttribute(Ae)===`off`}function Je(e,t){if(!t||e&&t.contains(e))return!0;let n=t.ownerDocument;return(!e||e===n.body||e===n.documentElement)&&n.querySelector(`[data-shortcut-scope]`)===t}function Ye(e,t,n=null){let r=e.target instanceof Node?e.target:null;if(!t||e.defaultPrevented||qe(r?.ownerDocument??void 0))return!1;let i=He(e);if(!i||!Je(r,n)||Ge(r))return!1;let a=t[i]??(i.length===1?t[i.toUpperCase()]:void 0);return typeof a!=`function`||i===`enter`&&r instanceof Element&&r.closest(Ve)?!1:(e.preventDefault(),a(e),!0)}function Xe(e,t){let n=e[0]?.ownerDocument;if(!n)return null;let r=n.activeElement,i=e.findIndex(e=>e===r||e.contains(r));if(i<0&&r&&r!==n.body){let t=r.closest?.(`li, tr`);t&&(i=e.findIndex(e=>t.contains(e)))}i<0&&(i=e.findIndex(e=>e.getAttribute(`aria-current`)===`true`));let a=N(e[i<0?t>0?0:e.length-1:Math.min(e.length-1,Math.max(0,i+t))],`moveFocus: no item at the clamped index`);return a.focus(),a.scrollIntoView?.({block:`nearest`}),a}var Ze=2,Qe=`wui-filter-popover-pinned`,$e=`.wui-filter-popover-trigger`,et=`.wui-filter-popover-panel`,tt=`.wui-filter-popover-head`,nt=`input:not([type]),input[type="text"],input[type="search"]`,rt=`a[href],button:not([disabled]),input:not([disabled]):not([type='hidden']),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex='-1'])`;function it(){try{return sessionStorage.getItem(Qe)===`1`}catch{return!1}}function at(e){try{e?sessionStorage.setItem(Qe,`1`):sessionStorage.removeItem(Qe)}catch(e){if(!(e instanceof DOMException))throw e}}function ot(e){if(e===null||e instanceof Node)return e;throw TypeError(`event target is not a node`)}function st(e,t){let n=e?.querySelector(t)??null;return n instanceof HTMLElement?n:null}var ct=class extends s{_doc;_timer;_sticky;_closingByCode;_inside;_pendingSubmit;_onEnter;_onLeave;_onClick;_onChange;_onListClose;_onFocusOut;_onKeyDown;_onShortcut;constructor(){super(),this._doc=null,this._timer=null,this._sticky=!1,this._closingByCode=!1,this._inside=!1,this._pendingSubmit=!1,this._onEnter=e=>{e.pointerType!==`touch`&&e.pointerType!==`pen`&&(this._inside=!0,this._schedule(!0))},this._onLeave=e=>{e.pointerType!==`touch`&&e.pointerType!==`pen`&&(this._inside=!1,this._schedule(!1))},this._onClick=e=>{this._trigger?.contains(ot(e.target))&&(this._clear(),this.isOpen&&this._sticky?this._close(!0):this._open(!0,e.detail===0))},this._onChange=e=>{let t=this._pin;if(t&&e.target===t){at(t.checked),t.checked?this._clear():this._schedule(!1);return}let n=e.target;if(n instanceof Element&&n.closest(`wui-select[mode="multiple"], wui-select[mode="tag"]`)?.querySelector(`[aria-expanded="true"]`)){this._pendingSubmit=!0;return}let r=this.closest(`form.wui-filter-form`);r instanceof HTMLFormElement&&r.requestSubmit()},this._onListClose=()=>{if(!this._pendingSubmit)return;this._pendingSubmit=!1;let e=this.closest(`form.wui-filter-form`);e instanceof HTMLFormElement&&e.requestSubmit()},this._onFocusOut=e=>{this.contains(ot(e.relatedTarget))||this._schedule(!1)},this._onKeyDown=e=>{let t=e.target;if(e.key!==`Enter`||!(t instanceof Element)||!this._panel?.contains(t)||!t.matches(nt))return;e.preventDefault();let n=this.closest(`form.wui-filter-form`);n instanceof HTMLFormElement&&n.requestSubmit()},this._onShortcut=e=>{this.ownerDocument.querySelector(`wui-filter-popover`)===this&&Ye(e,{f:()=>this._open(!0,!0)})}}get isOpen(){let e=this._panel;return e?M(e):!1}connectedCallback(){this._doc=this.ownerDocument,this.addEventListener(`pointerenter`,this._onEnter),this.addEventListener(`pointerleave`,this._onLeave),this.addEventListener(`click`,this._onClick),this.addEventListener(`change`,this._onChange),this.addEventListener(`focusout`,this._onFocusOut),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`wui-select:close`,this._onListClose),this._doc.addEventListener(`keydown`,this._onShortcut),it()&&this._pin&&(this._pin.checked=!0,this._open(!1,!1))}disconnectedCallback(){this._clear();let e=this._panel;e&&this._closeByCode(e),this.removeEventListener(`pointerenter`,this._onEnter),this.removeEventListener(`pointerleave`,this._onLeave),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`change`,this._onChange),this.removeEventListener(`focusout`,this._onFocusOut),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`wui-select:close`,this._onListClose),this._doc?.removeEventListener(`keydown`,this._onShortcut),this._doc=null}get _trigger(){return st(this,$e)}get _panel(){return st(this,et)}get _pin(){let e=this.querySelector(`${tt} input[type="checkbox"]`);return e instanceof HTMLInputElement?e:null}get _pinned(){return this._pin?.checked===!0}_clear(){this._timer!==null&&clearTimeout(this._timer),this._timer=null}_schedule(e){if(this._clear(),e){if(this.isOpen)return;this._timer=setTimeout(()=>{this._timer=null,this._open(!1,!1)},150)}else this.isOpen&&!this._stayOpen()&&(this._timer=setTimeout(()=>{this._timer=null,this._stayOpen()||this._close(!1)},400))}_stayOpen(){let e=this._panel;return e?this._pinned||this._inside||e.contains(this.ownerDocument.activeElement)||e.querySelector(`[aria-expanded="true"]`)!==null:!1}_open(e,t){this._clear();let n=this._panel,r=this._trigger;n&&r&&(this.isOpen?e&&(this._sticky=!0):(r.setAttribute(`aria-expanded`,`true`),this._sticky=e,A(r,n,{mode:`auto`,clampHeight:!0,alignEnd:!0,onClosed:()=>this._closed()})),t&&(st(n.querySelector(`.wui-filter-popover-grid`),rt)??st(n,rt))?.focus())}_close(e){this._clear();let t=this._panel;if(!t||!this.isOpen)return;let n=t.contains(this.ownerDocument.activeElement);this._closeByCode(t),e&&n&&this._trigger?.focus()}_closeByCode(e){this._closingByCode=!0;try{j(e)}finally{this._closingByCode=!1}}_closed(){if(this._trigger?.setAttribute(`aria-expanded`,`false`),this._sticky=!1,this._closingByCode)return;let e=this._trigger,t=this._panel,n=this.ownerDocument.activeElement;e&&(n===this.ownerDocument.body||t?.contains(n))&&e.focus()}};function lt(){i(`wui-filter-popover`,ct)}var ut=`INR`,dt=Object.freeze({INR:`₹`,USD:`$`,EUR:`€`,GBP:`£`,JPY:`¥`}),ft=e=>typeof e==`string`&&/^[A-Z]{3}$/.test(e),pt=(e=`INR`)=>dt[e]??`${e} `,mt=n({IST_OFFSET_MS:()=>ht,IST_TIME_ZONE:()=>F,isTimeZone:()=>vt,nowIn:()=>Tt,todayIn:()=>wt,wallClockOf:()=>Ct,wallToInstant:()=>xt,zoneOffsetMs:()=>bt,zoneParts:()=>yt}),F=`Asia/Kolkata`,ht=198e5,gt=new Map;function _t(e){let t=gt.get(e);return t||(t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),gt.set(e,t)),t}function vt(e){if(typeof e!=`string`||e===``)return!1;try{return _t(e),!0}catch{return!1}}function yt(e,t=F){if(t===`Asia/Kolkata`){let t=new Date(e+ht);return{year:t.getUTCFullYear(),month:t.getUTCMonth(),day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds()}}let n=Object.fromEntries(_t(t).formatToParts(e).map(e=>[e.type,Number(e.value)]));return{year:Number(n.year),month:Number(n.month)-1,day:Number(n.day),hour:Number(n.hour)%24,minute:Number(n.minute),second:Number(n.second)}}function bt(e,t=F){if(t===`Asia/Kolkata`)return ht;let n=yt(e,t),r=new Date(0);return r.setUTCFullYear(n.year,n.month,n.day),r.setUTCHours(n.hour,n.minute,n.second,0),r.getTime()-Math.floor(e/1e3)*1e3}function xt(e,t=F){let n=e-bt(e,t);return n=e-bt(n,t),n}var St=e=>e instanceof Date?e.getTime():e;function Ct(e,t=F){return new Date(e+bt(e,t)).toISOString().slice(0,19)}function wt(e=F,t=Date.now()){return Ct(St(t),e).slice(0,10)}function Tt(e=F,t=Date.now()){let n=St(t);return new Date(n+bt(n,e))}var Et=n({CURRENCIES:()=>Ot,DATE_PATTERNS:()=>jt,DURATION_UNITS:()=>At,EMPTY_VALUE:()=>`-`,FORMAT_STYLES:()=>Dt,IST_OFFSET_MS:()=>ht,IST_TIME_ZONE:()=>F,MAX_DECIMALS:()=>20,MONEY_UNITS:()=>kt,compactFormatOf:()=>ln,formatCompact:()=>en,formatCurrency:()=>Qt,formatDate:()=>I,formatDateTime:()=>un,formatDayShort:()=>sn,formatDuration:()=>rn,formatNumber:()=>Zt,formatPercent:()=>tn,formatValue:()=>cn,isMoneyUnit:()=>Mt,istParts:()=>on,paiseToRupeeText:()=>qt,timeZoneLabel:()=>pn,toInstant:()=>an}),Dt=[`number`,`currency`,`percent`,`compact`,`duration`,`date`],Ot=[`INR`,`USD`,`EUR`,`GBP`],kt=[`rupees`,`paise`],At=[`ms`,`s`,`min`,`h`],jt=[`day`,`month`,`year`,`datetime`,`time`];function Mt(e){return kt.some(t=>t===e)}var Nt=`-`,Pt=`−`,Ft=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],It=(e,t)=>N(e[t],`no compact unit at index ${t}`),Lt=[[1e7,`Cr`],[1e5,`L`],[1e3,`K`]],Rt=[[1e9,`B`],[1e6,`M`],[1e3,`K`]],zt=e=>!e||e===`INR`?`en-IN`:`en-US`,Bt=(e,t)=>typeof e==`number`&&Number.isInteger(e)&&e>=0&&e<=20?e:t,Vt=new Map,Ht=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=Vt.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:e}),Vt.set(n,r)),r},Ut=new Map,Wt=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=Ut.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:e,maximumFractionDigits:e}),Ut.set(n,r)),r},Gt=e=>typeof e==`number`&&Number.isFinite(e),Kt=e=>e<0&&!Object.is(Math.abs(e),0)?Pt:``;function qt(e){if(!Number.isInteger(e))throw Error(`A paise amount must be a whole number, got ${e}`);let t=BigInt(Math.abs(e)).toString().padStart(3,`0`);return`${e<0?`-`:``}${t.slice(0,-2)}.${t.slice(-2)}`}var Jt=(e,t)=>t===`paise`?Number(qt(e)):e,Yt=2,Xt=(e,t,n)=>{let r=Math.min(t,Yt),i=10n**BigInt(Yt-r),a=(BigInt(qt(e).replace(`.`,``))+i/2n)/i,o=10n**BigInt(r),s=Wt(0,n).format(a/o);return t===0?s:`${s}.${(a%o).toString().padStart(r,`0`)}${`0`.repeat(t-r)}`};function Zt(e,{decimals:t}={}){if(!Gt(e))return`-`;let n=Ht(Bt(t,2)).format(Math.abs(e));return n===`0`?`0`:Kt(e)+n}function Qt(e,{unit:t=`rupees`,decimals:n,currency:r=`INR`}={}){if(!Gt(e))return`-`;let i=Bt(n,0),a=zt(r),o=t===`paise`?Xt(Math.abs(e),i,a):Wt(i,a).format(Math.abs(e));return(Number(o.replace(/,/g,``))===0?``:Kt(e))+pt(r)+o}var $t=e=>e>0&&e<.1?Math.min(20,1-Math.floor(Math.log10(e))):2;function en(e,{currency:t,unit:n=`rupees`}={}){if(!Gt(e))return`-`;let r=t?Jt(e,n):e,i=t?pt(t):``,a=t?zt(t):`en-IN`,o=a===`en-IN`?Lt:Rt,s=Math.abs(r),c=o.findIndex(([e])=>s>=e);if(c===-1){let e=Ht($t(s),a).format(s);if(e!==`1,000`)return(e===`0`?``:Kt(r))+i+e;c=o.length-1}let[l,u]=It(o,c),d=s/l,f=d>=100?0:d>=10?1:2,p=Number(d.toFixed(f));return p>=100&&c>0&&(--c,[l,u]=It(o,c),d=s/l,f=d>=100?0:d>=10?1:2,p=Number(d.toFixed(f))),`${Kt(r)}${i}${Ht(f,a).format(p)} ${u}`}function tn(e,{decimals:t}={}){return Gt(e)?`${Zt(e*100,{decimals:Bt(t,1)})}%`:`-`}var nn={ms:1,s:1e3,min:6e4,h:36e5};function rn(e,{unit:t=`s`}={}){if(!Gt(e))return`-`;let n=nn[t]??1e3,r=Math.abs(e*n),i=Kt(e);if(Math.round(r)<1e3)return`${i}${Ht(0).format(r)} ms`;let a=r/1e3;if(a<10)return`${i}${Ht(1).format(a)}s`;let o=Math.round(a);if(o<60)return`${i}${o}s`;let s=e=>String(e).padStart(2,`0`),c=Math.floor(o/60);if(c<60)return`${i}${c}m ${s(o%60)}s`;let l=Math.floor(c/60);return`${i}${Ht(0).format(l)}h ${s(c%60)}m`}function an(e,t=F){if(e instanceof Date)return e.getTime();if(Gt(e))return e;if(typeof e!=`string`)return NaN;let n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(n){let[e,r,i]=[Number(n[1]),Number(n[2]),Number(n[3])],a=new Date(Date.UTC(2e3,r-1,i));return a.setUTCFullYear(e),a.getUTCFullYear()===e&&a.getUTCMonth()===r-1&&a.getUTCDate()===i?xt(a.getTime(),t):NaN}return Date.parse(e)}function on(e,t=F){let{year:n,month:r,day:i,hour:a,minute:o}=yt(e,t);return{year:n,month:r,day:i,hour:a,minute:o}}function I(e,{pattern:t=`day`,timeZone:n=F}={}){let r=an(e,n);if(!Number.isFinite(r))return`-`;let i=on(r,n),a=e=>String(e).padStart(2,`0`),o=`${a(i.day)}-${Ft[i.month]}-${i.year}`,s=`${a(i.hour)}:${a(i.minute)}`;switch(t){case`month`:return`${Ft[i.month]}-${i.year}`;case`year`:return String(i.year);case`datetime`:return`${o} ${s}`;case`time`:return s;default:return o}}function sn(e,{timeZone:t=F}={}){let n=an(e,t);if(!Number.isFinite(n))return`-`;let r=on(n,t);return`${String(r.day).padStart(2,`0`)}-${Ft[r.month]}`}function cn(e,t){if(e==null||e===``)return`-`;let n=t?.style;if(n===`date`)return I(e,t);if(typeof e!=`number`)return String(e);switch(n){case`currency`:return Qt(e,t);case`percent`:return tn(e,t);case`compact`:return en(e,t);case`duration`:return rn(e,t);default:return Zt(e,t)}}function ln(e){let t=e?.style;return t===`currency`?{style:`compact`,currency:e?.currency??`INR`,unit:e?.unit}:!t||t===`number`?{style:`compact`}:e??{}}function un(e,{timeZone:t=F}={}){let n=an(e);if(!Number.isFinite(n))return`-`;let r=Object.fromEntries(fn(t).formatToParts(n).map(e=>[e.type,e.value])),i=r.dayPeriod;if(i===void 0)throw Error(`Intl returned no day period for a 12-hour clock`);return`${r.day}-${Ft[Number(r.month)-1]}-${r.year}, ${r.hour}:${r.minute} ${i.toUpperCase()}`}var dn=new Map;function fn(e){let t=dn.get(e);return t||(t=new Intl.DateTimeFormat(`en-IN`,{day:`2-digit`,month:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`,hour12:!0,timeZone:e}),dn.set(e,t)),t}function pn(e=F){return new Intl.DateTimeFormat(`en-IN`,{timeZone:e,timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??e}var mn=n({COLUMN_MAX_WIDTH:()=>gn,COLUMN_MIN_WIDTH:()=>48,DATA_TABLE_TEXT:()=>L,PIN_AT_VAR:()=>An,PIN_SIDES:()=>yn,RESIZE_STEP:()=>10,RESIZE_STEP_LARGE:()=>50,ROW_HEIGHTS:()=>xn,ROW_MOVE_LIMIT:()=>200,ROW_MOVE_MS:()=>220,ROW_SAVE_ATTR:()=>Un,ROW_SAVE_ERROR_CLASS:()=>Wn,ROW_SAVE_STATES:()=>Hn,VIRTUAL_OVERSCAN:()=>8,clampColumnWidth:()=>Cn,groupCount:()=>Sn,groupItems:()=>wn,identityCell:()=>Gn,measureRows:()=>zn,pinAtValue:()=>jn,pinClasses:()=>Nn,pinOffsetVar:()=>kn,planPins:()=>Mn,playRowMoves:()=>Bn,readColumnWidths:()=>Dn,rowLabel:()=>Kn,rowOrderChanged:()=>Vn,saveOutcomeText:()=>Yn,setRowSaveState:()=>qn,settledRows:()=>Jn,virtualRange:()=>Tn,writeColumnWidths:()=>On}),hn=48,gn=1200,_n=10,vn=50,yn=[`start`,`end`],bn=8,xn={comfortable:72,cozy:48,compact:40},L={resize:e=>e?`Resize ${e} column`:`Resize column`,width:e=>`${e} pixels`,rows:e=>`${Zt(e,{decimals:0})} ${e===1?`row`:`rows`}`,saved:e=>e?`${e} saved.`:`Row saved.`,savedMany:e=>`${Zt(e,{decimals:0})} rows saved.`,notSaved:(e,t)=>`${e?`${e} was not saved.`:`Row was not saved.`}${t?` ${t}`:``}`},Sn=e=>Zt(e,{decimals:0}),Cn=e=>Math.min(gn,Math.max(48,Math.round(Number(e)||0)));function wn(e,t,n=[]){let r=new Map(n.map(e=>[e,[]]));return e.forEach((e,n)=>{let i=t(e,n),a=r.get(i);a||(a=[],r.set(i,a)),a.push(e)}),[...r].filter(([,e])=>e.length>0).map(([e,t])=>({key:e,items:t}))}function Tn({scrollTop:e,viewport:t,rowHeight:n,count:r,overscan:i=8}){let a=n>0?n:xn.comfortable,o=Math.floor(Math.max(0,e)/a),s=Math.max(0,o-i);s-=s%2;let c=Math.min(r,o+Math.ceil(Math.max(0,t)/a)+i),l=Math.min(s,c);return{start:l,end:c,before:l*a,after:Math.max(0,r-c)*a}}var En=e=>`wui-widths:${e}`;function Dn(e){if(!e)return{};try{let t=JSON.parse(window.localStorage.getItem(En(e))||`{}`),n={};if(t&&typeof t==`object`)for(let[e,r]of Object.entries(t))Number.isFinite(r)&&(n[e]=Cn(r));return n}catch{return{}}}function On(e,t){if(e)try{Object.keys(t).length?window.localStorage.setItem(En(e),JSON.stringify(t)):window.localStorage.removeItem(En(e))}catch(e){if(!(e instanceof DOMException))throw e}}var kn=(e,t)=>`--wui-pin-${e}-${t}`,An=`--wui-pin-at`,jn=(e,t)=>`var(${kn(e,t)}, 0px)`;function Mn(e){let t=e.map(()=>null),n=-1;e.forEach((e,t)=>{e===`start`&&(n=t)});let r=0;for(let i=0;i<=n;i++)(e[i]===`start`||e[i]===`lead`)&&(t[i]={side:`start`,ordinal:r++,edge:!1});let i=t[n];i&&(i.edge=!0);let a=-1;r=0;for(let n=e.length-1;n>=0;n--)e[n]===`end`&&(t[n]={side:`end`,ordinal:r++,edge:!1},a=n);let o=t[a];return o&&(o.edge=!0),t}var Nn=e=>e?`wui-pin-${e.side}${e.edge?` wui-pin-${e.side}-edge`:``}`:``,Pn=200,Fn=220,In=`cubic-bezier(0.22, 1, 0.36, 1)`,Ln=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,Rn=e=>e.getAttribute(`data-row-key`)??e;function zn(e){let t=[...e];if(t.length>200)return null;let n=new Map;for(let e of t)e.hidden||n.set(Rn(e),e.offsetTop);return n}function Bn(e,t){let n=[...e];if(!t||n.length>200||Ln())return 0;let r=0;for(let e of n){if(e.hidden||typeof e.animate!=`function`)continue;let n=t.get(Rn(e));if(n===void 0)continue;let i=n-e.offsetTop;Math.abs(i)<1||(e.animate([{transform:`translateY(${i}px)`},{transform:`translateY(0)`}],{duration:220,easing:In}),r++)}return r}function Vn(e,t){if(!e||!t)return!1;let n=new Set(t),r=new Set(e),i=e.filter(e=>n.has(e)),a=t.filter(e=>r.has(e));return i.some((e,t)=>e!==a[t])}var Hn=[`saving`,`error`],Un=`data-wui-save-state`,Wn=`wui-row-save-error`,Gn=e=>{let t=e.querySelector(`:scope > .wui-name-cell`);return t instanceof HTMLTableCellElement?t:[...e.cells].find(e=>!e.matches(`.wui-select-cell, .wui-expand-cell`))??null};function Kn(e){let t=Gn(e);if(!t)return``;let n=t.querySelector(`.u-name`);if(n)return(n.textContent??``).trim();let r=``;for(let e of t.childNodes)e instanceof Element&&e.classList.contains(`wui-row-save-error`)||(r+=e.textContent??``);return r.replace(/\s+/g,` `).trim()}function qn(e,t,n=``){if(t!==null&&!Hn.includes(t))throw Error(`A row's save state is ${Hn.join(` or `)} (or null to clear it), not "${t}".`);e.querySelector(`:scope > * > .${Wn}`)?.remove(),t===null?e.removeAttribute(Un):e.setAttribute(Un,t),t===`saving`?e.setAttribute(`aria-busy`,`true`):e.removeAttribute(`aria-busy`);let r=t===`error`&&n?Gn(e):null;if(r){let t=e.ownerDocument.createElement(`span`);t.className=Wn,t.textContent=n,r.append(t)}}function Jn(e,t){let n=[];if(!e)return n;for(let[r,i]of e){let e=t.get(r);i.state===`saving`&&e&&e.state!==`saving`&&n.push({label:e.label,ok:e.state!==`error`,message:e.message||``})}return n}function Yn(e){let t=e.filter(e=>e.ok),n=[],[r]=t;t.length===1&&r?n.push(L.saved(r.label)):t.length>1&&n.push(L.savedMany(t.length));for(let t of e)t.ok||n.push(L.notSaved(t.label,t.message));return n.join(` `)}var Xn=n({isImeSafeEnter:()=>Zn});function Zn(e){return e.key===`Enter`&&e.isComposing!==!0&&e.keyCode!==229}var Qn=`.wui-col-resize`,$n=`.wui-group-row, .wui-virtual-spacer`,er=`.wui-select-cell, .wui-expand-cell`,tr=`<svg class="wui-icon" data-icon="chevron-down" data-wui="AppIcon" width="16" height="16" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M19.92 8.95l-6.52 6.52c-.77.77-2.03.77-2.8 0L4.08 8.95"></path></svg>`;function R(e){if(e==null)throw TypeError(`Missing DOM node`);return e}function nr(e,t){if(e instanceof t)return e;throw TypeError(`Missing DOM node`)}var rr=e=>{let t=P(e,Qn);return t instanceof HTMLElement?t:null},ir=e=>e.hasAttribute(`data-wui-skeleton`)||!!e.querySelector(`:scope > td > .skeleton`),ar=class extends s{_frame;_headDirty;_rowsDirty;_frozenSig;_natural;_widths;_collapsed;_groupOrder;_items;_range;_drag;_userSized;_swallowClick;_mo;_ro;_fonts;_onPointerDown;_onKeyDown;_onClick;_onDblClick;_onScroll;_onFonts;_top=null;_bottom=null;_rowHeight=0;constructor(){super(),this._frame=0,this._headDirty=!0,this._rowsDirty=!0,this._frozenSig=null,this._natural=[],this._widths={},this._collapsed=new Set,this._groupOrder=[],this._items=[],this._range=null,this._drag=null,this._userSized=!1,this._swallowClick=!1,this._mo=null,this._ro=null,this._fonts=null,this._onPointerDown=e=>this._startDrag(e),this._onKeyDown=e=>this._key(e),this._onClick=e=>this._click(e),this._onDblClick=e=>{let t=rr(e.target);t&&this.contains(t)&&this._reset(t.closest(`th`))},this._onScroll=()=>{this.hasAttribute(`virtual`)&&this._schedule()},this._onFonts=()=>{this._userSized||this._drag||this._frozenSig===null||!this.hasAttribute(`resizable`)||(this._frozenSig=null,this._schedule())}}connectedCallback(){this._widths=Dn(this.getAttribute(`view-key`)),this.addEventListener(`pointerdown`,this._onPointerDown,!0),this.addEventListener(`keydown`,this._onKeyDown,!0),this.addEventListener(`click`,this._onClick,!0),this.addEventListener(`dblclick`,this._onDblClick),this.addEventListener(`scroll`,this._onScroll,{passive:!0}),this._fonts=this.ownerDocument.fonts??null,this._fonts?.addEventListener(`loadingdone`,this._onFonts),typeof MutationObserver<`u`&&(this._mo=new MutationObserver(e=>this._mutated(e)),this._mo.observe(this,{childList:!0,subtree:!0})),typeof ResizeObserver<`u`&&(this._ro=new ResizeObserver(()=>this._schedule()),this._ro.observe(this)),this._headDirty=!0,this._rowsDirty=!0,this._schedule()}disconnectedCallback(){this.removeEventListener(`pointerdown`,this._onPointerDown,!0),this.removeEventListener(`keydown`,this._onKeyDown,!0),this.removeEventListener(`click`,this._onClick,!0),this.removeEventListener(`dblclick`,this._onDblClick),this.removeEventListener(`scroll`,this._onScroll),this._fonts?.removeEventListener(`loadingdone`,this._onFonts),this._fonts=null,this._mo?.disconnect(),this._ro?.disconnect(),this._mo=null,this._ro=null,this._frame&&cancelAnimationFrame(this._frame),this._frame=0,this._drag=null}refresh(){this._headDirty=!0,this._rowsDirty=!0,this._run()}get _table(){let e=this.querySelector(`:scope > table`);return e instanceof HTMLTableElement?e:null}_headCells(e){let t=e.tHead?.rows[0];return t?[...t.cells]:[]}_schedule(){this._frame||=requestAnimationFrame(()=>{this._frame=0,this._run()})}_mutated(e){for(let t of e){let e=t.target instanceof Element?t.target:t.target.parentElement;e&&((e.closest(`thead`)||e===this._table||e===this)&&(this._headDirty=!0),(e.closest(`tbody, tfoot`)||e===this._table||e===this)&&(this._rowsDirty=!0))}this._schedule()}_run(){let e=this._table;if(!e)return;let t=this._headDirty,n=this._rowsDirty;this._headDirty=!1,this._rowsDirty=!1,n&&this.hasAttribute(`group-by`)&&this._group(e),this._pins(e,t||n),this.hasAttribute(`resizable`)&&(t&&this._handles(e),this._layout(e)),this.hasAttribute(`virtual`)&&this._virtual(e,t||n),this._mo?.takeRecords()}_pins(e,t){let n=this._headCells(e),r=n.map(e=>{let t=e.dataset.pin;return t===`start`||t===`end`?t:e.matches(er)?`lead`:null});if(!r.some(e=>e===`start`||e===`end`))return;let i=Mn(r);i.forEach((e,t)=>{e&&this._ro?.observe(R(n[t]))});let a=e=>R(n[e]).getBoundingClientRect().width,o=0;i.forEach((t,n)=>{t?.side===`start`&&(this._setVar(e,kn(`start`,t.ordinal),o),o+=a(n))}),o=0;for(let t=i.length-1;t>=0;t--){let n=i[t];n?.side===`end`&&(this._setVar(e,kn(`end`,n.ordinal),o),o+=a(t))}if(t)for(let t of e.rows)t.matches(`${$n}, .wui-row-expanded`)||t.cells.length!==n.length||i.forEach((e,n)=>{if(!e)return;let r=R(t.cells[n]);r.classList.contains(`wui-pin-${e.side}`)||r.classList.add(`wui-pin-${e.side}`),e.edge&&!r.classList.contains(`wui-pin-${e.side}-edge`)&&r.classList.add(`wui-pin-${e.side}-edge`);let i=jn(e.side,e.ordinal);r.style.getPropertyValue(`--wui-pin-at`)!==i&&r.style.setProperty(An,i)})}_setVar(e,t,n){let r=`${Math.round(n*100)/100}px`;e.style.getPropertyValue(t)!==r&&e.style.setProperty(t,r)}_resizable(e){return e.map((t,n)=>n<e.length-1&&!t.matches(er))}_handles(e){let t=this._headCells(e),n=this._resizable(t);t.forEach((e,t)=>{if(!n[t]||e.querySelector(Qn))return;let r=e.ownerDocument.createElement(`span`);r.className=`wui-col-resize`,r.setAttribute(`role`,`separator`),r.setAttribute(`aria-orientation`,`vertical`),r.setAttribute(`aria-valuemin`,`48`),r.setAttribute(`aria-valuemax`,String(gn)),r.setAttribute(`tabindex`,`0`);let i=(e.textContent??``).trim();r.setAttribute(`aria-label`,L.resize(i)),i&&!e.hasAttribute(`aria-label`)&&e.setAttribute(`aria-label`,i),e.classList.add(`wui-col-resizable`),e.appendChild(r)})}_hasRows(e){for(let t of e.tBodies)for(let e of t.rows)if(!e.matches($n)&&!ir(e))return!0;return!1}_signature(e){return e.map(e=>e.dataset.key||(e.textContent??``).trim()).join(``)}_layout(e){let t=this._headCells(e),n=this._signature(t);t.length&&n!==this._frozenSig&&(this._hasRows(e)?this._freeze(e,t,n):this._applyRemembered(t))}_applyRemembered(e){for(let t of e){let e=t.dataset.key&&this._widths[t.dataset.key];e&&(t.style.width=`${e}px`);let n=t.querySelector(Qn);n&&this._handleValue(n,Cn(e||t.getBoundingClientRect().width))}}_freeze(e,t,n){e.style.tableLayout=``,e.style.width=``,e.removeAttribute(`data-wui-fixed`);for(let e of t)e.hasAttribute(`data-wui-width`)&&(e.style.width=``,e.removeAttribute(`data-wui-width`));this._natural=t.map(e=>e.getBoundingClientRect().width),t.forEach((e,n)=>{if(n===t.length-1||e.matches(er))return;let r=e.dataset.key&&this._widths[e.dataset.key];this._setWidth(e,r||this._natural[n])}),e.style.tableLayout=`fixed`,e.setAttribute(`data-wui-fixed`,``),this._frozenSig=n,this._fitTable(e,t)}_setWidth(e,t){let n=Cn(t);e.style.width=`${n}px`,e.setAttribute(`data-wui-width`,``);let r=e.querySelector(Qn);return r&&this._handleValue(r,n),n}_handleValue(e,t){e.setAttribute(`aria-valuenow`,String(t)),e.setAttribute(`aria-valuetext`,L.width(t))}_fitTable(e,t){let n=t.length-1,r=this._natural[n]||0;for(let e=0;e<n;e++)r+=Number.parseFloat(R(t[e]).style.width)||this._natural[e]||0;e.style.width=`max(100%, ${Math.round(r)}px)`}_ensureFrozen(e){let t=this._headCells(e),n=this._signature(t);return n!==this._frozenSig&&this._freeze(e,t,n),t}_resizeTo(e,t,n){let r=this._table;if(!r)return;let i=this._ensureFrozen(r);this._userSized=!0,this._setWidth(e,t),this._fitTable(r,i),n&&this._remember(e),this._pins(r,!1)}_remember(e){let t=e.dataset.key;t&&(this._widths={...this._widths,[t]:Number.parseFloat(e.style.width)},On(this.getAttribute(`view-key`),this._widths))}_reset(e){let t=this._table;if(!e||!t)return;let n=this._ensureFrozen(t);this._userSized=!0;let r=e.dataset.key;if(r&&r in this._widths){let{[r]:e,...t}=this._widths;this._widths=t,On(this.getAttribute(`view-key`),this._widths)}this._setWidth(e,this._natural[n.indexOf(e)]||0),this._fitTable(t,n),this._pins(t,!1)}_rtl(){return getComputedStyle(this).direction===`rtl`}_startDrag(e){let t=rr(e.target);if(!t||!this.contains(t)||e.button!==0)return;e.preventDefault(),e.stopPropagation();let n=t.closest(`th`),r=this._table;if(!n||!r)return;this._ensureFrozen(r);let i={th:n,x:e.clientX,from:n.getBoundingClientRect().width,dir:this._rtl()?-1:1,moved:!1};this._drag=i,t.setPointerCapture?.(e.pointerId),t.classList.add(`is-dragging`);let a=e=>{let t=(e.clientX-i.x)*i.dir;Math.abs(t)>1&&(i.moved=!0),this._resizeTo(n,i.from+t,!1)},o=e=>{t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerup`,o),t.removeEventListener(`pointercancel`,o),t.classList.remove(`is-dragging`),this._drag=null,e.type===`pointercancel`?this._resizeTo(n,i.from,!1):i.moved&&this._remember(n),this._swallowClick=!0,setTimeout(()=>{this._swallowClick=!1},0)};t.addEventListener(`pointermove`,a),t.addEventListener(`pointerup`,o),t.addEventListener(`pointercancel`,o)}_key(e){let t=rr(e.target);if(!t||!this.contains(t))return;let n=t.closest(`th`);if(Zn(e)||e.key===` `){e.preventDefault(),e.stopPropagation();return}if(e.key===`Home`){e.preventDefault(),e.stopPropagation(),this._reset(n);return}if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault(),e.stopPropagation();let r=this._table;if(!r)return;this._ensureFrozen(r);let i=R(n),a=e.shiftKey?50:10,o=e.key===`ArrowRight`!==this._rtl(),s=Number.parseFloat(i.style.width)||i.getBoundingClientRect().width;this._resizeTo(i,s+(o?a:-a),!0)}_click(e){let t=e.target instanceof Element&&e.target.closest(Qn)!==null;if(this._swallowClick||t){e.stopPropagation(),(t||this._swallowClick)&&e.preventDefault(),this._swallowClick=!1;return}if(!this.hasAttribute(`group-by`))return;let n=P(e.target,`.wui-group-toggle`)?.closest(`.wui-group-row`);if(!(n instanceof HTMLTableRowElement)||!this.contains(n))return;let r=n.dataset.groupKey;this._collapsed.has(r)?this._collapsed.delete(r):this._collapsed.add(r),this._showGroup(n,!this._collapsed.has(r));let i=this._table;i&&this.hasAttribute(`virtual`)&&(this._virtual(i,!0),this._mo?.takeRecords())}_group(e){let t=this.getAttribute(`group-by`),n=this._headCells(e),r=n.findIndex(e=>e.dataset.key===t);if(r<0)throw Error(`<wui-data-table group-by="${t}"> needs a header cell with data-key="${t}".`);let i=e.tBodies[0];if(!i)return;let a=[...i.rows].filter(e=>!e.matches($n));if(a.some(ir))return;let o=this.ownerDocument,s=new Map;for(let e of i.querySelectorAll(`:scope > tr.wui-group-row`))e instanceof HTMLTableRowElement&&s.set(e.dataset.groupKey,e);let c=wn(a,e=>e.dataset.group??e.cells[r]?.textContent?.trim()??``,this.closest(`[data-wui-server]`)?[]:this._groupOrder);this._groupOrder=c.map(e=>e.key);let l=o.createDocumentFragment(),u=c.map(e=>{let t=s.get(e.key)??this._groupRow(o,e.key);return s.delete(e.key),nr(t.querySelector(`.wui-group-cell`),HTMLTableCellElement).colSpan=n.length,nr(t.querySelector(`.wui-group-count`),HTMLElement).textContent=Sn(e.items.length),nr(t.querySelector(`.wui-group-rows`),HTMLElement).textContent=`, ${L.rows(e.items.length)}`,l.append(t,...e.items),[t,e.key]});for(let e of s.values())e.remove();i.insertBefore(l,this._bottom?.parentNode===i?this._bottom:null);for(let[e,t]of u)this._showGroup(e,!this._collapsed.has(t))}_groupRow(e,t){let n=e.createElement(`tr`);n.className=`wui-group-row`,n.dataset.groupKey=t;let r=e.createElement(`th`);r.className=`wui-group-cell`,r.scope=`rowgroup`;let i=e.createElement(`button`);i.type=`button`,i.className=`wui-group-toggle`,i.innerHTML=tr;let a=e.createElement(`span`);a.className=`wui-group-label`,a.textContent=t;let o=e.createElement(`span`);o.className=`wui-group-count`,o.setAttribute(`aria-hidden`,`true`);let s=e.createElement(`span`);return s.className=`visually-hidden wui-group-rows`,i.append(a,o,s),r.append(i),n.append(r),n}_showGroup(e,t){if(e){e.querySelector(`.wui-group-toggle`)?.setAttribute(`aria-expanded`,String(t));for(let n=e.nextElementSibling;n&&!n.matches($n);n=n.nextElementSibling)n instanceof HTMLElement&&(n.hidden=!t)}}_spacer(e,t){if(t?.parentNode===e)return t;let n=e.ownerDocument,r=n.createElement(`tr`);return r.className=`wui-virtual-spacer`,r.setAttribute(`aria-hidden`,`true`),r.append(n.createElement(`td`)),r}_virtual(e,t){let n=e.tBodies[0];if(!n)return;if(t){this._top=this._spacer(n,this._top),this._bottom=this._spacer(n,this._bottom),n.firstElementChild!==this._top&&n.insertBefore(this._top,n.firstChild),n.lastElementChild!==this._bottom&&n.append(this._bottom);let t=Math.max(1,this._headCells(e).length);R(this._top.cells[0]).colSpan=t,R(this._bottom.cells[0]).colSpan=t,this._items=[...n.rows].filter(e=>!e.classList.contains(`wui-virtual-spacer`)&&!e.hidden),this._range=null,e.setAttribute(`aria-rowcount`,String(this._items.length+1)),e.tHead?.rows[0]?.setAttribute(`aria-rowindex`,`1`),this._items.forEach((e,t)=>{e.setAttribute(`aria-rowindex`,String(t+2))}),this._rowHeight>0||(this._rowHeight=this._measureRow(e))}let r=e.tHead?.getBoundingClientRect().height||0,i=Tn({scrollTop:this.scrollTop-r,viewport:this.clientHeight,rowHeight:this._rowHeight,count:this._items.length}),a=this._range;if(a&&a.start===i.start&&a.end===i.end)return;let o=a?Math.min(a.start,i.start):0,s=a?Math.max(a.end,i.end):this._items.length;for(let e=o;e<s;e++){let t=e<i.start||e>=i.end,n=R(this._items[e]);n.classList.contains(`wui-virtual-off`)!==t&&n.classList.toggle(`wui-virtual-off`,t)}this._range=i;let c=R(this._top),l=R(this._bottom);c.hidden=i.before===0,l.hidden=i.after===0,R(c.cells[0]).style.height=`${i.before}px`,R(l.cells[0]).style.height=`${i.after}px`}_measureRow(e){let t=this._items.find(e=>!e.classList.contains(`wui-group-row`)&&!e.classList.contains(`wui-virtual-off`))?.getBoundingClientRect().height??0;return t>0?t:e.classList.contains(`wui-table-compact`)?xn.compact:e.classList.contains(`wui-table-cozy`)?xn.cozy:xn.comfortable}},or=n({DISPLAY_FORMAT:()=>pr,MONTHS:()=>sr,WEEKDAYS:()=>cr,clampMonth:()=>gr,daysIn:()=>hr,firstWeekday:()=>ur,fmt:()=>mr,pad:()=>dr,parseIso:()=>z,toIso:()=>fr}),sr=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],cr=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],lr=e=>{let t=String(e??``).trim();return/^[0-6]$/.test(t)?Number(t):null},ur=e=>lr(e.getAttribute(`first-day`))??lr(getComputedStyle(e).getPropertyValue(`--wui-first-day`))??1,dr=e=>String(e).padStart(2,`0`),fr=(e,t,n)=>`${e}-${dr(t+1)}-${dr(n)}`,z=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e||``);if(!t)return null;let[,n,r,i]=t;if(n===void 0||r===void 0||i===void 0)throw Error(`ISO date parts missing`);let a=+n,o=+r,s=+i;return o<1||o>12||s<1||s>hr(a,o-1)?null:{y:a,m:o-1,d:s}},pr=`dd-MMM-yyyy`,mr=(e,t=pr)=>{let n=z(e);if(!n)return``;let r=sr[n.m];if(r===void 0)throw Error(`month out of range`);let i={yyyy:n.y,MMMM:r,MMM:r.slice(0,3),MM:dr(n.m+1),dd:dr(n.d),d:n.d};return(t||`dd-MMM-yyyy`).replace(/yyyy|MMMM|MMM|MM|dd|d/g,e=>String(i[e]))},hr=(e,t)=>{let n=new Date(0);return n.setFullYear(e,t+1,0),n.getDate()},gr=(e,t)=>{for(;t<0;)t+=12,--e;for(;t>11;)t-=12,e+=1;return{y:e,m:t}},_r=n({BUSY_CLASS:()=>vr,isInert:()=>B,isReadOnly:()=>yr,syncFieldState:()=>br}),vr=`wui-field-busy`,yr=e=>e.hasAttribute(`readonly`),B=e=>e.hasAttribute(`disabled`)||e.hasAttribute(`readonly`)||e.hasAttribute(`loading`);function br(e,t){let n=e.hasAttribute(`loading`);n?e.setAttribute(`aria-busy`,`true`):e.removeAttribute(`aria-busy`),t&&(t.classList.toggle(vr,n),yr(e)?t.setAttribute(`aria-readonly`,`true`):t.removeAttribute(`aria-readonly`))}var xr=n({syncFormMirror:()=>V,syncFormMirrors:()=>Tr}),Sr=`data-wui-mirror`;function Cr(e,t,n,r){t.name=n,t.value=r==null?``:String(r);for(let n of[...t.attributes])n.name.startsWith(`data-val`)&&!e.hasAttribute(n.name)&&t.removeAttribute(n.name);for(let n of e.attributes)n.name.startsWith(`data-val`)&&t.setAttribute(n.name,n.value);t.disabled=e.hasAttribute(`disabled`)}function wr(e){let t=document.createElement(`input`);return t.type=`hidden`,t.setAttribute(Sr,``),e.appendChild(t),t}function V(e,t){let n=e.getAttribute(`name`)??``,r=e.querySelector(`:scope > input[${Sr}]`),i=r instanceof HTMLInputElement?r:null;n?(i||=wr(e),Cr(e,i,n,t)):i?.remove()}function Tr(e,t){let n=e.getAttribute(`name`)??``,r=[...e.querySelectorAll(`:scope > input[${Sr}]`)].filter(e=>e instanceof HTMLInputElement),i=[...e.attributes].some(e=>e.name.startsWith(`data-val`)),a=n?t.length>0?t:i?[``]:[]:[];for(let e of r.splice(a.length))e.remove();a.forEach((t,i)=>{Cr(e,r[i]??wr(e),n,t)})}var Er={add:`<path d="M6 12h12M12 18V6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"alert-circle":`<path d="M12 7.75V13M21.08 8.58v6.84c0 1.12-.6 2.16-1.57 2.73l-5.94 3.43c-.97.56-2.17.56-3.15 0l-5.94-3.43a3.15 3.15 0 0 1-1.57-2.73V8.58c0-1.12.6-2.16 1.57-2.73l5.94-3.43c.97-.56 2.17-.56 3.15 0l5.94 3.43c.97.57 1.57 1.6 1.57 2.73Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 16.2v.1" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>`,"alert-triangle":`<path d="M12 9v5M12 21.41H5.94c-3.47 0-4.92-2.48-3.24-5.51l3.12-5.62L8.76 5c1.78-3.21 4.7-3.21 6.48 0l2.94 5.29 3.12 5.62c1.68 3.03.22 5.51-3.24 5.51H12v-.01Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.995 17h.009" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>`,"arrow-left":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M9.57 5.93L3.5 12l6.07 6.07M20.5 12H3.67"></path>`,"arrow-right":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M14.43 5.93L20.5 12l-6.07 6.07M3.5 12h16.83"></path>`,at:`<path d="M16 12a4 4 0 1 1-8 0 4 4 0 1 1 8 0M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-3.5 7.13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>`,calendar:`<path d="M8 2v3M16 2v3M3.5 9.09h17M21 8.5V17c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5V8.5c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15.695 13.7h.009M15.695 16.7h.009M11.995 13.7h.01M11.995 16.7h.01M8.294 13.7h.01M8.294 16.7h.01" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>`,"calendar-dots":`<path d="M8 2v3M16 2v3M16 3.5c3.33.18 5 1.45 5 6.15v6.18c0 4.12-1 6.18-6 6.18H9c-5 0-6-2.06-6-6.18V9.65c0-4.7 1.67-5.96 5-6.15h8ZM20.75 17.6H3.25" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 8.25c-1.23 0-2.27.67-2.27 1.97 0 .62.29 1.09.73 1.39-.61.36-.96.94-.96 1.62 0 1.24.95 2.01 2.5 2.01 1.54 0 2.5-.77 2.5-2.01 0-.68-.35-1.27-.97-1.62.45-.31.73-.77.73-1.39 0-1.3-1.03-1.97-2.26-1.97Zm0 2.84c-.52 0-.9-.31-.9-.8 0-.5.38-.79.9-.79s.9.29.9.79c0 .49-.38.8-.9.8ZM12 14c-.66 0-1.14-.33-1.14-.93 0-.6.48-.92 1.14-.92.66 0 1.14.33 1.14.92 0 .6-.48.93-1.14.93Z" fill="currentColor"></path>`,chart:`<path d="M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15.5 18.5c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2s-2 .9-2 2v9a2 2 0 0 0 2 2ZM8.5 18.5c1.1 0 2-.9 2-2V13c0-1.1-.9-2-2-2s-2 .9-2 2v3.5a2 2 0 0 0 2 2Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,check:`<path d="m5 12.75 4.5 4.5L19 7.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>`,"check-circle":`<path d="M12 22c5.5 0 10-4.5 10-10S17.5 2 12 2 2 6.5 2 12s4.5 10 10 10Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="m7.75 12 2.83 2.83 5.67-5.66" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"chevron-down":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M19.92 8.95l-6.52 6.52c-.77.77-2.03.77-2.8 0L4.08 8.95"></path>`,"chevron-left":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M15 19.92L8.48 13.4c-.77-.77-.77-2.03 0-2.8L15 4.08"></path>`,"chevron-right":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M8.91 19.92l6.52-6.52c.77-.77.77-2.03 0-2.8L8.91 4.08"></path>`,"chevron-up":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M19.92 15.05L13.4 8.53c-.77-.77-2.03-.77-2.8 0l-6.52 6.52"></path>`,"chevrons-up-down":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M9.01 20.5l-5.02-5.01M9.01 3.5v17M14.99 3.5l5.02 5.01M14.99 20.5v-17"></path>`,circle:`<path d="M11.97 22c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 16.23a4.23 4.23 0 1 0 0-8.46 4.23 4.23 0 0 0 0 8.46Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,clock:`<path d="M22 12c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2s10 4.48 10 10Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="m15.71 15.18-3.1-1.85c-.54-.32-.98-1.09-.98-1.72v-4.1" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,code:`<path d="M9 13c-.66.33-1.21.82-1.62 1.43-.23.35-.23.79 0 1.14.41.61.96 1.1 1.62 1.43M15.21 13c.66.33 1.21.82 1.62 1.43.23.35.23.79 0 1.14-.41.61-.96 1.1-1.62 1.43" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7ZM2.23 8.01 21.45 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,comment:`<path d="M8.5 19H8c-4 0-6-1-6-6V8c0-4 2-6 6-6h8c4 0 6 2 6 6v5c0 4-2 6-6 6h-.5c-.31 0-.61.15-.8.4l-1.5 2c-.66.88-1.74.88-2.4 0l-1.5-2c-.16-.22-.53-.4-.8-.4Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15.996 11h.01M11.995 11h.01M7.995 11h.008" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>`,copy:`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16 12.9v4.2c0 3.5-1.4 4.9-4.9 4.9H6.9C3.4 22 2 20.6 2 17.1v-4.2C2 9.4 3.4 8 6.9 8h4.2c3.5 0 4.9 1.4 4.9 4.9z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M22 6.9v4.2c0 3.5-1.4 4.9-4.9 4.9H16v-3.1C16 9.4 14.6 8 11.1 8H8V6.9C8 3.4 9.4 2 12.9 2h4.2C20.6 2 22 3.4 22 6.9z"></path>`,danger:`<path d="M12 9v5M12 21.41H5.94c-3.47 0-4.92-2.48-3.24-5.51l3.12-5.62L8.76 5c1.78-3.21 4.7-3.21 6.48 0l2.94 5.29 3.12 5.62c1.68 3.03.22 5.51-3.24 5.51H12v-.01Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.995 17h.009" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>`,display:`<path d="M6.44 2h11.11C21.11 2 22 2.89 22 6.44v6.33c0 3.56-.89 4.44-4.44 4.44H6.44C2.89 17.22 2 16.33 2 12.78V6.44C2 2.89 2.89 2 6.44 2ZM12 17.22V22M2 13h20M7.5 22h9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,document:`<path d="M22 10v5c0 5-2 7-7 7H9c-5 0-7-2-7-7V9c0-5 2-7 7-7h5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22 10h-4c-3 0-4-1-4-4V2l8 8Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,download:`<path d="M9 11v6l2-2M9 17l-2-2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22 10v5c0 5-2 7-7 7H9c-5 0-7-2-7-7V9c0-5 2-7 7-7h5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22 10h-4c-3 0-4-1-4-4V2l8 8Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,edit:`<path d="m13.26 3.6-8.21 8.69c-.31.33-.61.98-.67 1.43l-.37 3.24c-.13 1.17.71 1.97 1.87 1.77l3.22-.55c.45-.08 1.08-.41 1.39-.75l8.21-8.69c1.42-1.5 2.06-3.21-.15-5.3-2.2-2.07-3.87-1.34-5.29.16Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.89 5.05a6.126 6.126 0 0 0 5.45 5.15M3 22h18" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,export:`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M9.32 6.5l2.56-2.56 2.56 2.56M11.88 14.18V4.01M4 12c0 4.42 3 8 8 8s8-3.58 8-8"></path>`,"file-text":`<path d="M21 7v10c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5V7c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M14.5 4.5v2c0 1.1.9 2 2 2h2M8 13h4M8 17h8" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,files:`<path d="M17 13.4v3c0 4-1.6 5.6-5.6 5.6H7.6c-4 0-5.6-1.6-5.6-5.6v-3.8C2 8.6 3.6 7 7.6 7h3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17 13.4h-3.2c-2.4 0-3.2-.8-3.2-3.2V7l6.4 6.4ZM11.6 2h4M7 5c0-1.66 1.34-3 3-3h2.62M22 8v6.19c0 1.55-1.26 2.81-2.81 2.81M22 8h-3c-2.25 0-3-.75-3-3V2l6 6Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,filter:`<path d="M5.4 2.1h13.2c1.1 0 2 .9 2 2v2.2c0 .8-.5 1.8-1 2.3l-4.3 3.8c-.6.5-1 1.5-1 2.3V19c0 .6-.4 1.4-.9 1.7l-1.4.9c-1.3.8-3.1-.1-3.1-1.7v-5.3c0-.7-.4-1.6-.8-2.1l-3.8-4c-.5-.5-.9-1.4-.9-2V4.2c0-1.2.9-2.1 2-2.1ZM10.93 2.1 6 10" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,flag:`<path d="M5.15 2v20M5.15 4h11.2c2.7 0 3.3 1.5 1.4 3.4l-1.2 1.2c-.8.8-.8 2.1 0 2.8l1.2 1.2c1.9 1.9 1.2 3.4-1.4 3.4H5.15" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,gauge:`<path d="M19.14 19.5a9.964 9.964 0 0 0 2.86-7c0-5.52-4.48-10-10-10S2 6.98 2 12.5c0 2.72 1.08 5.18 2.84 6.99" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 21.5a3.38 3.38 0 1 0 0-6.76 3.38 3.38 0 0 0 0 6.76ZM15.25 12H16c.82 0 1.5-.67 1.5-1.5 0-.82-.68-1.5-1.5-1.5s-1.5.67-1.5 1.5v.75c0 .41.34.75.75.75Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,grid:`<path d="M22 8.52V3.98C22 2.57 21.36 2 19.77 2h-4.04c-1.59 0-2.23.57-2.23 1.98v4.53c0 1.42.64 1.98 2.23 1.98h4.04c1.59.01 2.23-.56 2.23-1.97ZM22 19.77v-4.04c0-1.59-.64-2.23-2.23-2.23h-4.04c-1.59 0-2.23.64-2.23 2.23v4.04c0 1.59.64 2.23 2.23 2.23h4.04c1.59 0 2.23-.64 2.23-2.23ZM10.5 8.52V3.98C10.5 2.57 9.86 2 8.27 2H4.23C2.64 2 2 2.57 2 3.98v4.53c0 1.42.64 1.98 2.23 1.98h4.04c1.59.01 2.23-.56 2.23-1.97ZM10.5 19.77v-4.04c0-1.59-.64-2.23-2.23-2.23H4.23c-1.59 0-2.23.64-2.23 2.23v4.04C2 21.36 2.64 22 4.23 22h4.04c1.59 0 2.23-.64 2.23-2.23Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,image:`<path d="M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM2.67 18.95l4.93-3.31c.79-.53 1.93-.47 2.64.14l.33.29c.78.67 2.04.67 2.82 0l4.16-3.57c.78-.67 2.04-.67 2.82 0L22 13.9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,info:`<g transform="rotate(180 12 12)"><path d="M12 22c5.5 0 10-4.5 10-10S17.5 2 12 2 2 6.5 2 12s4.5 10 10 10ZM12 8v5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.995 16h.009" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></g>`,key:`<path d="M19.79 14.93a7.575 7.575 0 0 1-7.6 1.87l-4.71 4.7c-.34.35-1.01.56-1.49.49l-2.18-.3c-.72-.1-1.39-.78-1.5-1.5l-.3-2.18c-.07-.48.16-1.15.49-1.49l4.7-4.7c-.8-2.6-.18-5.55 1.88-7.6 2.95-2.95 7.74-2.95 10.7 0 2.96 2.95 2.96 7.76.01 10.71ZM6.89 17.49l2.3 2.3" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M14.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,list:`<path d="M3 4.5h18M3 9.5h9.47M3 14.5h18M3 19.5h9.47" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,lock:`<path d="M6 10V8c0-3.31 1-6 6-6s6 2.69 6 6v2M12 18.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17 22H7c-4 0-5-1-5-5v-2c0-4 1-5 5-5h10c4 0 5 1 5 5v2c0 4-1 5-5 5Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"maximize-4":`<path d="M21 9V3h-6M3 15v6h6M21 3l-7.5 7.5M10.5 13.5 3 21" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,menu:`<path d="M3 7h18M3 12h18M3 17h18" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>`,minus:`<path d="M6 12h12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,monitor:`<path d="M6.44 2h11.11C21.11 2 22 2.89 22 6.44v6.33c0 3.56-.89 4.44-4.44 4.44H6.44C2.89 17.22 2 16.33 2 12.78V6.44C2 2.89 2.89 2 6.44 2ZM12 17.22V22M2 13h20M7.5 22h9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,moon:`<path d="M2.03 12.42c.36 5.15 4.73 9.34 9.96 9.57 3.69.16 6.99-1.56 8.97-4.27.82-1.11.38-1.85-.99-1.6-.67.12-1.36.17-2.08.14C13 16.06 9 11.97 8.98 7.14c-.01-1.3.26-2.53.75-3.65.54-1.24-.11-1.83-1.36-1.3C4.41 3.86 1.7 7.85 2.03 12.42Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,music:`<path d="M6.28 22a3.12 3.12 0 1 0 0-6.24 3.12 3.12 0 0 0 0 6.24Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M20.84 16.8V4.6c0-2.6-1.63-2.96-3.28-2.51l-6.24 1.7C10.18 4.1 9.4 5 9.4 6.3v12.57" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.72 19.92a3.12 3.12 0 1 0 0-6.24 3.12 3.12 0 0 0 0 6.24ZM9.4 9.52 20.84 6.4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,pause:`<path d="M10.65 19.11V4.89c0-1.35-.57-1.89-2.01-1.89H5.01C3.57 3 3 3.54 3 4.89v14.22C3 20.46 3.57 21 5.01 21h3.63c1.44 0 2.01-.54 2.01-1.89ZM21 19.11V4.89C21 3.54 20.43 3 18.99 3h-3.63c-1.43 0-2.01.54-2.01 1.89v14.22c0 1.35.57 1.89 2.01 1.89h3.63c1.44 0 2.01-.54 2.01-1.89Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,people:`<path d="M18 7.16a.605.605 0 0 0-.19 0 2.573 2.573 0 0 1-2.48-2.58c0-1.43 1.15-2.58 2.58-2.58a2.58 2.58 0 0 1 2.58 2.58A2.589 2.589 0 0 1 18 7.16ZM16.97 14.44c1.37.23 2.88-.01 3.94-.72 1.41-.94 1.41-2.48 0-3.42-1.07-.71-2.6-.95-3.97-.71M5.97 7.16c.06-.01.13-.01.19 0a2.573 2.573 0 0 0 2.48-2.58C8.64 3.15 7.49 2 6.06 2a2.58 2.58 0 0 0-2.58 2.58c.01 1.4 1.11 2.53 2.49 2.58ZM7 14.44c-1.37.23-2.88-.01-3.94-.72-1.41-.94-1.41-2.48 0-3.42 1.07-.71 2.6-.95 3.97-.71M12 14.63a.605.605 0 0 0-.19 0 2.573 2.573 0 0 1-2.48-2.58c0-1.43 1.15-2.58 2.58-2.58a2.58 2.58 0 0 1 2.58 2.58c-.01 1.4-1.11 2.54-2.49 2.58ZM9.09 17.78c-1.41.94-1.41 2.48 0 3.42 1.6 1.07 4.22 1.07 5.82 0 1.41-.94 1.41-2.48 0-3.42-1.59-1.06-4.22-1.06-5.82 0Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,phone:`<path d="M21.97 18.33c0 .36-.08.73-.25 1.09-.17.36-.39.7-.68 1.02-.49.54-1.03.93-1.64 1.18-.6.25-1.25.38-1.95.38-1.02 0-2.11-.24-3.26-.73s-2.3-1.15-3.44-1.98a28.75 28.75 0 0 1-3.28-2.8 28.414 28.414 0 0 1-2.79-3.27c-.82-1.14-1.48-2.28-1.96-3.41C2.24 8.67 2 7.58 2 6.54c0-.68.12-1.33.36-1.93.24-.61.62-1.17 1.15-1.67C4.15 2.31 4.85 2 5.59 2c.28 0 .56.06.81.18.26.12.49.3.67.56l2.32 3.27c.18.25.31.48.4.7.09.21.14.42.14.61 0 .24-.07.48-.21.71-.13.23-.32.47-.56.71l-.76.79c-.11.11-.16.24-.16.4 0 .08.01.15.03.23.03.08.06.14.08.2.18.33.49.76.93 1.28.45.52.93 1.05 1.45 1.58.54.53 1.06 1.02 1.59 1.47.52.44.95.74 1.29.92.05.02.11.05.18.08.08.03.16.04.25.04.17 0 .3-.06.41-.17l.76-.75c.25-.25.49-.44.72-.56.23-.14.46-.21.71-.21.19 0 .39.04.61.13.22.09.45.22.7.39l3.31 2.35c.26.18.44.39.55.64.1.25.16.5.16.78Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10"></path>`,play:`<path d="M4 12V8.44c0-4.42 3.13-6.23 6.96-4.02l3.09 1.78 3.09 1.78c3.83 2.21 3.83 5.83 0 8.04l-3.09 1.78-3.09 1.78C7.13 21.79 4 19.98 4 15.56V12Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,printer:`<path d="M7.25 7h9.5V5c0-2-.75-3-3-3h-3.5c-2.25 0-3 1-3 3v2ZM16 15v4c0 2-1 3-3 3h-2c-2 0-3-1-3-3v-4h8Z" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M21 10v5c0 2-1 3-3 3h-2v-3H8v3H6c-2 0-3-1-3-3v-5c0-2 1-3 3-3h12c2 0 3 1 3 3ZM17 15H7M7 11h3" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,refresh:`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M22 12c0 5.52-4.48 10-10 10s-8.89-5.56-8.89-5.56m0 0h4.52m-4.52 0v5M2 12C2 6.48 6.44 2 12 2c6.67 0 10 5.56 10 5.56m0 0v-5m0 5h-4.44"></path>`,"rotate-ccw":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.11 5.08c.87-.26 1.83-.43 2.89-.43 4.79 0 8.67 3.88 8.67 8.67s-3.88 8.67-8.67 8.67-8.67-3.88-8.67-8.67c0-1.78.54-3.44 1.46-4.82M7.87 5.32L10.76 2M7.87 5.32l3.37 2.46"></path>`,"rotate-cw":`<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M14.89 5.08c-.87-.26-1.83-.43-2.89-.43-4.79 0-8.67 3.88-8.67 8.67C3.33 18.12 7.21 22 12 22s8.67-3.88 8.67-8.67c0-1.78-.54-3.44-1.46-4.82M16.13 5.32L13.24 2M16.13 5.32l-3.37 2.46"></path>`,search:`<path d="M11.5 21a9.5 9.5 0 1 0 0-19 9.5 9.5 0 0 0 0 19ZM22 22l-2-2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,send:`<path d="m7.4 6.32 8.49-2.83c3.81-1.27 5.88.81 4.62 4.62l-2.83 8.49c-1.9 5.71-5.02 5.71-6.92 0l-.84-2.52-2.52-.84c-5.71-1.9-5.71-5.01 0-6.92ZM10.11 13.65l3.58-3.59" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,server:`<path d="M19.32 10H4.69c-1.48 0-2.68-1.21-2.68-2.68V4.69c0-1.48 1.21-2.68 2.68-2.68h14.63C20.8 2.01 22 3.22 22 4.69v2.63C22 8.79 20.79 10 19.32 10ZM19.32 22H4.69c-1.48 0-2.68-1.21-2.68-2.68v-2.63c0-1.48 1.21-2.68 2.68-2.68h14.63c1.48 0 2.68 1.21 2.68 2.68v2.63c0 1.47-1.21 2.68-2.68 2.68ZM6 5v2M10 5v2M6 17v2M10 17v2M14 6h4M14 18h4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,subtitle:`<path d="M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7ZM17.5 17.08h-1.85M12.97 17.08H6.5M17.5 13.32h-5.53M9.27 13.32H6.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,sun:`<path d="M12 18.5a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="m19.14 19.14-.13-.13m0-14.02.13-.13-.13.13ZM4.86 19.14l.13-.13-.13.13ZM12 2.08V2v.08ZM12 22v-.08.08ZM2.08 12H2h.08ZM22 12h-.08.08ZM4.99 4.99l-.13-.13.13.13Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>`,tag:`<path d="m4.405 15.526 4.53 4.53a4.78 4.78 0 0 0 6.75 0l4.39-4.39a4.78 4.78 0 0 0 0-6.75l-4.54-4.52a4.75 4.75 0 0 0-3.6-1.39l-5 .24c-2 .09-3.59 1.68-3.69 3.67l-.24 5c-.06 1.35.45 2.66 1.4 3.61Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.735 12.226a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path><path d="m13.235 17.226 4-4" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>`,text:`<path d="M2.67 7.17V5.35c0-1.15.93-2.07 2.07-2.07h14.52c1.15 0 2.07.93 2.07 2.07v1.82M12 20.72V4.11M8.06 20.72h7.88" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"two-page":`<path d="M22 16.74V4.67c0-1.2-.98-2.09-2.17-1.99h-.06c-2.1.18-5.29 1.25-7.07 2.37l-.17.11c-.29.18-.77.18-1.06 0l-.25-.15C9.44 3.9 6.26 2.84 4.16 2.67 2.97 2.57 2 3.47 2 4.66v12.08c0 .96.78 1.86 1.74 1.98l.29.04c2.17.29 5.52 1.39 7.44 2.44l.04.02c.27.15.7.15.96 0 1.92-1.06 5.28-2.17 7.46-2.46l.33-.04c.96-.12 1.74-1.02 1.74-1.98ZM12 5.49v15M7.75 8.49H5.5M8.5 11.49h-3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,user:`<path d="M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10ZM20.59 22c0-3.87-3.85-7-8.59-7s-8.59 3.13-8.59 7" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"volume-high":`<path d="M2 10v4c0 2 1 3 3 3h1.43c.37 0 .74.11 1.06.3l2.92 1.83c2.52 1.58 4.59.43 4.59-2.54V7.41c0-2.98-2.07-4.12-4.59-2.54L7.49 6.7c-.32.19-.69.3-1.06.3H5c-2 0-3 1-3 3Z" stroke="currentColor" stroke-width="1.5"></path><path d="M18 8a6.66 6.66 0 0 1 0 8M19.83 5.5a10.83 10.83 0 0 1 0 13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"volume-mute":`<path d="M15 8.37v-.96c0-2.98-2.07-4.12-4.59-2.54L7.49 6.7c-.32.19-.69.3-1.06.3H5c-2 0-3 1-3 3v4c0 2 1 3 3 3h2M10.41 19.13c2.52 1.58 4.59.43 4.59-2.54v-3.64M18.81 9.42c.9 2.15.63 4.66-.81 6.58M21.15 7.8a10.82 10.82 0 0 1-1.32 10.7M22 2 2 22" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,x:`<path d="M6.4 6.4l11.2 11.2M17.6 6.4 6.4 17.6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>`,"zoom-in":`<path d="M11 20a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM8.5 11h5M11 13.5v-5M18.93 20.69c.53 1.6 1.74 1.76 2.67.36.85-1.28.29-2.33-1.25-2.33-1.14-.01-1.78.88-1.42 1.97Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`,"zoom-out":`<path d="M9 11.7h5M11.5 21a9.5 9.5 0 1 0 0-19 9.5 9.5 0 0 0 0 19ZM22 22l-2-2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>`},Dr=n({devError:()=>H,devWarn:()=>Or});function Or(e,...t){console.warn(e,...t)}function H(e,...t){console.error(e,...t)}var kr=Object.freeze({carousel:{entries:[`elements/carousel.ts`],tags:[`wui-carousel`]},"code-block":{entries:[`elements/code-block.ts`],tags:[`wui-code-block`]},"command-palette":{entries:[`elements/command-palette.ts`],tags:[`wui-command-palette`]},"comment-thread":{entries:[`elements/comment-thread.ts`],tags:[`wui-mention-input`,`wui-comment-thread`]},"consent-banner":{entries:[`elements/consent-banner.ts`],tags:[`wui-consent-banner`]},"context-menu":{entries:[`elements/context-menu.ts`],tags:[`wui-context-menu`]},"date-range":{entries:[`elements/date-range.ts`],tags:[`wui-date-range`]},drawer:{entries:[`elements/drawer.ts`],tags:[`wui-drawer`]},dropdown:{entries:[`elements/dropdown.ts`],tags:[`wui-dropdown`]},"image-crop":{entries:[`elements/image-crop.ts`],tags:[`wui-image-crop`]},"inline-edit":{entries:[`elements/inline-edit.ts`],tags:[`wui-inline-edit`]},kanban:{entries:[`elements/kanban.ts`],tags:[`wui-kanban`]},"lead-popup":{entries:[`elements/lead-popup.ts`],tags:[`wui-lead-popup`]},lightbox:{entries:[`elements/lightbox.ts`],tags:[`wui-lightbox`]},"org-tree":{entries:[`elements/org-tree.ts`],tags:[`wui-org-tree`]},markdown:{entries:[`elements/markdown.ts`],tags:[`wui-markdown`]},modal:{entries:[`elements/modal.ts`],tags:[`wui-modal`]},phone:{entries:[`elements/phone.ts`,`global/parts/select-country.ts`],tags:[`wui-phone`]},popover:{entries:[`elements/popover.ts`],tags:[`wui-popover`]},resizable:{entries:[`elements/resizable.ts`],tags:[`wui-resizable`]},"saved-views":{entries:[`elements/saved-views.ts`],tags:[`wui-saved-views`]},glyphs:{entries:[`global/parts/glyphs.ts`],tags:[]},"select-chips":{entries:[`global/parts/select-chips.ts`],tags:[]},"select-recents":{entries:[`global/parts/select-recents.ts`],tags:[]},"select-search":{entries:[`global/parts/select-search.ts`],tags:[]},slider:{entries:[`elements/slider.ts`],tags:[`wui-slider`]},sortable:{entries:[`elements/sortable.ts`],tags:[`wui-sortable`]},"status-icon":{entries:[`elements/status-icon.ts`],tags:[`wui-status-icon`]},timepicker:{entries:[`elements/timepicker.ts`],tags:[`wui-timepicker`]},tour:{entries:[`elements/tour.ts`],tags:[`wui-tour`]},tree:{entries:[`elements/tree.ts`],tags:[`wui-tree`]},wizard:{entries:[`elements/wizard.ts`],tags:[`wui-wizard-step`,`wui-wizard`]},chart:{file:`ui-chart.global.js`,tags:[`wui-chart`],selfContained:!0},calendar:{file:`ui-calendar.global.js`,tags:[`wui-calendar`],selfContained:!0},"rich-text":{file:`ui-rich-text.global.js`,tags:[`wui-rich-text`],selfContained:!0},"file-viewer":{file:`ui-file-viewer.global.js`,tags:[`wui-file-viewer`],selfContained:!0}});Object.freeze({anchorOverlay:`anchorOverlay.ts`,buttonClass:`buttonClass.ts`,calendarMath:`calendarMath.ts`,copyText:`copyText.ts`,dataTable:`dataTable.ts`,defineElement:`defineElement.ts`,devWarn:`devWarn.ts`,elementBase:`elementBase.ts`,fieldState:`fieldState.ts`,formatters:`formatters.ts`,formMirror:`formMirror.ts`,glyphs:`global/glyphs.ts`,iconGlyphs:`iconGlyphs.g.ts`,imeSafeEnter:`imeSafeEnter.ts`,listboxKeyNav:`listboxKeyNav.ts`,loader:`global/loader.ts`,mentionText:`mentionText.ts`,menuKeyNav:`menuKeyNav.ts`,nativeOverlay:`nativeOverlay.ts`,notificationDays:`notificationDays.ts`,optionLabel:`optionLabel.ts`,partRegistry:`select/partRegistry.ts`,selectList:`select/list.ts`,selectRemote:`select/remote.ts`,stepperHeader:`stepperHeader.ts`,tableSelect:`tableSelect.ts`,textMatch:`textMatch.ts`,tooltips:`tooltips.ts`,wuiHttp:`server/wuiHttp.ts`,WuiSelect:`WuiSelect.ts`,zone:`zone.ts`});var Ar=`ui-elements/`;function jr(e){let t=kr[e];if(t===void 0)throw Error(`[webority-ui] No on-demand element chunk is named ${e}.`);return t}function Mr(e){let t=jr(e);if(!t.selfContained)return`${Ar+e}.global.js`;if(t.file===void 0)throw Error(`[webority-ui] The self-contained element chunk ${e} names no file.`);return t.file}var Nr=n({CHUNK_DIR:()=>Ar,CHUNK_RETRY_MS:()=>Ir,ELEMENTS_DEFINED_EVENT:()=>Pr,ELEMENTS_LOAD_ERROR_EVENT:()=>Fr,assetUrl:()=>Yr,loadChunk:()=>Xr,startElementLoader:()=>Kr,stopElementLoader:()=>qr,whenElementsReady:()=>Jr}),Pr=`wui-elements:defined`,Fr=`wui-elements:load-error`,Ir=1e3,Lr={"ui-elements/carousel.global.js":`b14e5b841399`,"ui-elements/code-block.global.js":`b0d6edda0088`,"ui-elements/command-palette.global.js":`fa1acf53e717`,"ui-elements/comment-thread.global.js":`ad5529f24c0a`,"ui-elements/consent-banner.global.js":`36af1bc07df7`,"ui-elements/context-menu.global.js":`dc14561d9fca`,"ui-elements/date-range.global.js":`7ddc3d09d4db`,"ui-elements/drawer.global.js":`4ea169eaf1c3`,"ui-elements/dropdown.global.js":`072432efcb89`,"ui-elements/image-crop.global.js":`e3b298850108`,"ui-elements/inline-edit.global.js":`06c84e7ad28b`,"ui-elements/kanban.global.js":`2bbcb8718f74`,"ui-elements/lead-popup.global.js":`92d5f5761215`,"ui-elements/lightbox.global.js":`de5c2e3c7887`,"ui-elements/org-tree.global.js":`6f2c61fbfb4a`,"ui-elements/markdown.global.js":`55f10a724614`,"ui-elements/modal.global.js":`d20b27db23d8`,"ui-elements/phone.global.js":`d34d2d7ead6c`,"ui-elements/popover.global.js":`e46560883d24`,"ui-elements/resizable.global.js":`74d839cfdb02`,"ui-elements/saved-views.global.js":`2a8f93594897`,"ui-elements/glyphs.global.js":`0e140ff2ade9`,"ui-elements/select-chips.global.js":`52517f4a597e`,"ui-elements/select-recents.global.js":`d7587a42fe42`,"ui-elements/select-search.global.js":`2bffe62eaf5f`,"ui-elements/slider.global.js":`796de12150b0`,"ui-elements/sortable.global.js":`7b7a30ba8b6c`,"ui-elements/status-icon.global.js":`e4c4236433c9`,"ui-elements/timepicker.global.js":`6e52f072ced6`,"ui-elements/tour.global.js":`a3db7c9f6b75`,"ui-elements/tree.global.js":`ed1ed1b2ce43`,"ui-elements/wizard.global.js":`25a15af696a1`,"ui-chart.global.js":`9f65e9d54b5f`,"ui-calendar.global.js":`b17d17688fdd`,"ui-rich-text.global.js":`ad9d154e5576`,"ui-file-viewer.global.js":`2d6cdbab07f3`,"ui-phone.global.js":`c646775bc1d1`},Rr=new Map;for(let[e,t]of Object.entries(kr))for(let n of t.tags)Rr.set(n,e);var zr=[...Rr.keys()].join(`,`),Br=null,Vr=``,Hr=!1,Ur=null,Wr=new Map;function Gr(){let e=document.currentScript;return e instanceof HTMLScriptElement?e:null}function Kr(e=Gr()){Hr||(Hr=!0,Br=e?.src?e.src:null,Vr=e?.nonce||``,ei(document),Ur=new MutationObserver(e=>{for(let t of e)for(let e of t.addedNodes)e instanceof Element&&ei(e)}),Ur.observe(document.documentElement,{childList:!0,subtree:!0}))}function qr(){Ur?.disconnect(),Ur=null,Hr=!1,Br=null,Vr=``,Wr.clear()}function Jr(e=document){return Promise.all([...$r(e)].map(e=>Xr(e))).then(()=>void 0)}function Yr(e){if(Br===null)throw Error(`The on-demand element files have no address to load from.`);let t=new URL(e,Br);return t.search=Object.hasOwn(Lr,e)?`?v=${Lr[e]}`:``,t.href}function Xr(e){let t=Wr.get(e);if(t?.promise)return t.promise;let n=jr(e),{tags:r}=n,i=Mr(e),a=()=>Promise.all(r.map(e=>customElements.whenDefined(e))),o={status:`loading`,promise:null},s=new Promise((t,s)=>{let c=``,l=()=>{Ur&&Object.keys(kr).every(e=>Wr.get(e)?.status===`loaded`||Wr.get(e)?.status===`failed`)&&Ur.disconnect()},u=()=>{o.status=`loaded`,l(),document.dispatchEvent(new CustomEvent(Pr,{detail:{chunk:e,tags:r}})),t()},d=t=>{o.status=`failed`,l(),H(`[webority-ui] Could not load ${c} for ${r.length?r.join(`, `):e}.${t?` ${t.message}`:``}`),document.dispatchEvent(new CustomEvent(Fr,{detail:{chunk:e,url:c,tags:r}})),s(Error(`[webority-ui] The ${e} elements failed to load.`))},f=(e,t)=>{let i=document.createElement(`script`);i.src=e,i.async=!1,Vr&&(i.nonce=Vr),i.addEventListener(`load`,()=>{!n.selfContained&&!r.every(e=>customElements.get(e))?d(Error(`The file ran but did not define its elements; see the error above.`)):a().then(u)}),i.addEventListener(`error`,()=>{i.remove(),t?d():setTimeout(()=>f(e,!0),Ir)}),document.head.append(i)};if([...document.scripts].some(e=>new URL(e.src,location.href).pathname.endsWith(`/${i}`)))a().then(u);else{try{c=Yr(i)}catch(e){d(e instanceof Error?e:void 0);return}f(c,!1)}});return o.promise=s,Wr.set(e,o),s}function Zr(e){return Rr.has(e.localName)&&!customElements.get(e.localName)}function Qr(e,t){let n=Rr.get(t.localName);n!==void 0&&Zr(t)&&e.add(n)}function $r(e){let t=new Set;e instanceof Element&&Qr(t,e);for(let n of e.querySelectorAll(zr))Qr(t,n);return t}function ei(e){for(let t of $r(e))Promise.allSettled([Xr(t)])}var ti=n({GLYPH_CHUNK:()=>ni,GLYPH_PENDING_ATTRIBUTE:()=>ri,glyphSvg:()=>U,registerGlyphs:()=>di}),ni=`glyphs`,ri=`data-wui-glyph-pending`,ii=`svg[${ri}]`,ai=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,oi={...Er},si=!1,ci=null;function li(e,t,n,r,i){return`<svg class="${n?`wui-icon ${n}`:`wui-icon`}" data-icon="${e}"${i?` ${ri}`:``} width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" aria-hidden="true">${r}</svg>`}function U(e,{size:t=16,className:n=``}={}){let r=oi[e];return r===void 0?si||!ai.test(e)?``:(Promise.allSettled([Xr(ni)]),li(e,t,n,``,!0)):li(e,t,n,r,!1)}function ui(e){let t=e instanceof Element&&e.matches(ii)?[e]:[];for(let n of[...t,...e.querySelectorAll(ii)]){let e=oi[n.getAttribute(`data-icon`)??``];e===void 0?n.remove():(n.removeAttribute(ri),n.innerHTML=e)}}function di(e){Object.assign(oi,e),si=!0,ui(document),ci===null&&(ci=new MutationObserver(e=>{for(let t of e)for(let e of t.addedNodes)e instanceof Element&&ui(e)}),ci.observe(document.documentElement,{childList:!0,subtree:!0}))}var fi=n({TRUSTED_HTML:()=>pi,escapeHtml:()=>W,optionLabelHtml:()=>vi,optionText:()=>xi,stripTags:()=>yi,withTrustedLabel:()=>mi}),pi=Symbol(`wui.trustedHtml`),mi=e=>({...e,[pi]:!0}),W=e=>String(e??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),hi=e=>{if(!e)return``;let t=String(e).toLowerCase().replace(/[^a-z0-9-]/g,``);return t?U(t):``},gi=e=>`wui-flag wui-flag-${e}`,_i=e=>{let t=String(e??``).toLowerCase();return/^[a-z]{2}$/.test(t)?`<span class="${gi(t)}" aria-hidden="true"></span>`:``},vi=e=>{if(e==null)return``;let t=e[pi]?String(e.label??``):W(e.label),n=_i(e.flag)+hi(e.icon);return n?`<span class="wui-opt-label">${n}${t}</span>`:t},yi=e=>String(e??``).replace(/<[^>]*>/g,``),bi=new WeakMap,xi=e=>{if(e==null)return``;if(!e[pi])return yi(e.label);let t=bi.get(e);if(t&&t.label===e.label)return t.text;let n=document.createElement(`template`);n.innerHTML=String(e.label??``);let r=n.content.textContent??``;return bi.set(e,{label:e.label,text:r}),r},Si=class extends s{static formAssociated=!0;static get observedAttributes(){return[`value`,`min`,`max`,`placeholder`,`disabled`,`readonly`,`loading`,`first-day`,`disabled-weekdays`,`display-format`,`size`,`aria-label`,`aria-describedby`,`aria-invalid`]}_internals;_value;_defaultValue;_rendered;_viewY;_viewM;_mode;_focus;_slide;_viewNavigated;_openFn;_closeFn;_onKeyBound;_closingQuietly;get _open(){return N(this._openFn,`open missing`)}get _close(){return N(this._closeFn,`close missing`)}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``;let e=new Date(2e3,0,1);this._viewY=e.getFullYear(),this._viewM=e.getMonth(),this._mode=`days`,this._focus=null,this._slide=``}connectedCallback(){this._rendered||this.render()}disconnectedCallback(){this._dropPanel()}attributeChangedCallback(e,t,n){if(e===`aria-invalid`)this._syncInvalid();else if(this._rendered){if(e===`value`)this._value=n||``,this._syncFormValue(),this._syncTrigger();else if(e===`display-format`)this._syncTrigger();else if(e===`first-day`){let e=this.querySelector(`.datepicker-pop`);e instanceof HTMLDivElement&&M(e)&&this._renderView()}else this.render()}}_syncInvalid(){let e=this.querySelector(`.datepicker-trigger`);e instanceof HTMLButtonElement&&(this.hasAttribute(`aria-invalid`)?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}formResetCallback(){this.value=this._defaultValue||``}get value(){return this._value}set value(e){this._value=e||``,V(this,this._value),this._syncTrigger()}_firstDay(){return ur(this)}render(){this._dropPanel(),this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``,this._value=this._defaultValue||this._value);let e=this.getAttribute(`placeholder`)||`Choose a date`,t=z(this._value);t&&(this._viewY=t.y,this._viewM=t.m);let n=this.getAttribute(`size`),r=n===`sm`?` input-sm`:n===`lg`?` input-lg`:``,i=this.getAttribute(`aria-label`),a=this.getAttribute(`aria-describedby`);this.innerHTML=`
2
2
  <div class="datepicker">
3
- <button type="button" class="input datepicker-trigger${r}${t?` has-value`:``}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute(`aria-invalid`)?` aria-invalid="true"`:``}${this.hasAttribute(`disabled`)?` disabled`:``}${i?` aria-label="${B(i)}"`:``}${a?` aria-describedby="${B(a)}"`:``}>
4
- <span data-trigger-label class="${t?``:`wui-select-placeholder`}">${B(t?Tn(this._value,this.getAttribute(`display-format`)):e)}</span>
5
- ${z(`calendar-dots`)}
3
+ <button type="button" class="input datepicker-trigger${r}${t?` has-value`:``}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute(`aria-invalid`)?` aria-invalid="true"`:``}${this.hasAttribute(`disabled`)?` disabled`:``}${i?` aria-label="${W(i)}"`:``}${a?` aria-describedby="${W(a)}"`:``}>
4
+ <span data-trigger-label class="${t?``:`wui-select-placeholder`}">${W(t?mr(this._value,this.getAttribute(`display-format`)):e)}</span>
5
+ ${U(`calendar-dots`)}
6
6
  </button>
7
- <div class="datepicker-pop" role="dialog" aria-modal="false" hidden></div>
8
- </div>`,this._rendered=!0,jn(this,this.querySelector(`.datepicker-trigger`)),L(this,this._value),this._wire()}_syncFormValue(){L(this,this._value)}_syncTrigger(){let e=this.querySelector(`.datepicker-trigger`),t=this.querySelector(`[data-trigger-label]`);if(!(t instanceof HTMLSpanElement))return;let n=F(this._value);t.textContent=n?Tn(this._value,this.getAttribute(`display-format`)):this.getAttribute(`placeholder`)||`Choose a date`,t.classList.toggle(`wui-select-placeholder`,!n),e?.classList.toggle(`has-value`,!!n),jn(this,e)}_limits(){let e=F(this.getAttribute(`min`)),t=F(this.getAttribute(`max`)),n=e?new Date(e.y,e.m,e.d).getTime():-1/0,r=t?new Date(t.y,t.m,t.d).getTime():1/0,i=new Set;for(let e of(this.getAttribute(`disabled-weekdays`)||``).split(`,`)){let t=e.trim();/^[0-6]$/.test(t)&&i.add(Number(t))}return{dayDisabled:(e,t,a)=>{let o=new Date(e,t,a),s=o.getTime();return s<n||s>r||i.has(o.getDay())},monthDisabled:(e,t)=>{let i=new Date(e,t,1).getTime();return new Date(e,t,En(e,t)).getTime()<n||i>r},yearDisabled:e=>{let t=new Date(e,0,1).getTime();return new Date(e,11,31).getTime()<n||t>r}}}_renderView(){let e=this.querySelector(`.datepicker-pop`);e instanceof HTMLDivElement&&(e.innerHTML=this._mode===`months`?this._monthsHtml():this._mode===`years`?this._yearsHtml():this._daysHtml(),this._focusActive())}_daysHtml(){let e=this._firstDay(),t=(new Date(this._viewY,this._viewM,1).getDay()-e+7)%7,n=En(this._viewY,this._viewM),r=F(this._value),i=new Date,{dayDisabled:a}=this._limits(),o=this._focus||r||{y:this._viewY,m:this._viewM,d:1},s=(e,t,n,s)=>{let c=Cn(e,t,n),l=r&&r.y===e&&r.m===t&&r.d===n,u=i.getFullYear()===e&&i.getMonth()===t&&i.getDate()===n,d=o.y===e&&o.m===t&&o.d===n,f=a(e,t,n);return`<button type="button" class="${[`datepicker-day`,s?`is-outside`:``,u?`is-today`:``,l?`is-selected`:``].filter(Boolean).join(` `)}" data-iso="${c}" role="gridcell" tabindex="${d&&!f?`0`:`-1`}"${l?` aria-selected="true"`:``}${f?` disabled aria-disabled="true"`:``}>${n}</button>`},c=``,l=Dn(this._viewY,this._viewM-1),u=En(l.y,l.m);for(let e=t-1;e>=0;e--)c+=s(l.y,l.m,u-e,!0);for(let e=1;e<=n;e++)c+=s(this._viewY,this._viewM,e,!1);let d=Dn(this._viewY,this._viewM+1),f=(7-(t+n)%7)%7;for(let e=1;e<=f;e++)c+=s(d.y,d.m,e,!0);let p=a(i.getFullYear(),i.getMonth(),i.getDate()),m=I(this)?``:`<button type="button" class="datepicker-link" data-clear>Clear</button>`,h=yn.map((t,n)=>yn[(n+e)%7]).map(e=>`<span>${e}</span>`).join(``);return`
7
+ <div class="datepicker-pop" role="dialog" popover="auto"></div>
8
+ </div>`,this._rendered=!0,br(this,this.querySelector(`.datepicker-trigger`)),V(this,this._value),this._wire()}_syncFormValue(){V(this,this._value)}_syncTrigger(){let e=this.querySelector(`.datepicker-trigger`),t=this.querySelector(`[data-trigger-label]`);if(!(t instanceof HTMLSpanElement))return;let n=z(this._value);t.textContent=n?mr(this._value,this.getAttribute(`display-format`)):this.getAttribute(`placeholder`)||`Choose a date`,t.classList.toggle(`wui-select-placeholder`,!n),e?.classList.toggle(`has-value`,!!n),br(this,e)}_limits(){let e=z(this.getAttribute(`min`)),t=z(this.getAttribute(`max`)),n=e?new Date(e.y,e.m,e.d).getTime():-1/0,r=t?new Date(t.y,t.m,t.d).getTime():1/0,i=new Set;for(let e of(this.getAttribute(`disabled-weekdays`)||``).split(`,`)){let t=e.trim();/^[0-6]$/.test(t)&&i.add(Number(t))}return{dayDisabled:(e,t,a)=>{let o=new Date(e,t,a),s=o.getTime();return s<n||s>r||i.has(o.getDay())},monthDisabled:(e,t)=>{let i=new Date(e,t,1).getTime();return new Date(e,t,hr(e,t)).getTime()<n||i>r},yearDisabled:e=>{let t=new Date(e,0,1).getTime();return new Date(e,11,31).getTime()<n||t>r}}}_dropPanel(){let e=this.querySelector(`.datepicker-pop`);if(e instanceof HTMLDivElement){this._closingQuietly=!0;try{j(e)}finally{this._closingQuietly=!1}}}_renderView(){let e=this.querySelector(`.datepicker-pop`);e instanceof HTMLDivElement&&(e.innerHTML=this._mode===`months`?this._monthsHtml():this._mode===`years`?this._yearsHtml():this._daysHtml(),this._focusActive())}_daysHtml(){let e=this._firstDay(),t=(new Date(this._viewY,this._viewM,1).getDay()-e+7)%7,n=hr(this._viewY,this._viewM),r=z(this._value),i=new Date,{dayDisabled:a}=this._limits(),o=this._focus||r||{y:this._viewY,m:this._viewM,d:1},s=(e,t,n,s)=>{let c=fr(e,t,n),l=r&&r.y===e&&r.m===t&&r.d===n,u=i.getFullYear()===e&&i.getMonth()===t&&i.getDate()===n,d=o.y===e&&o.m===t&&o.d===n,f=a(e,t,n);return`<button type="button" class="${[`datepicker-day`,s?`is-outside`:``,u?`is-today`:``,l?`is-selected`:``].filter(Boolean).join(` `)}" data-iso="${c}" role="gridcell" tabindex="${d&&!f?`0`:`-1`}"${l?` aria-selected="true"`:``}${f?` disabled aria-disabled="true"`:``}>${n}</button>`},c=``,l=gr(this._viewY,this._viewM-1),u=hr(l.y,l.m);for(let e=t-1;e>=0;e--)c+=s(l.y,l.m,u-e,!0);for(let e=1;e<=n;e++)c+=s(this._viewY,this._viewM,e,!1);let d=gr(this._viewY,this._viewM+1),f=(7-(t+n)%7)%7;for(let e=1;e<=f;e++)c+=s(d.y,d.m,e,!0);let p=a(i.getFullYear(),i.getMonth(),i.getDate()),m=B(this)?``:`<button type="button" class="datepicker-link" data-clear>Clear</button>`,h=cr.map((t,n)=>cr[(n+e)%7]).map(e=>`<span>${e}</span>`).join(``);return`
9
9
  <div class="datepicker-head">
10
- <button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month">${z(`chevron-left`)}</button>
11
- <button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${vn[this._viewM]} ${this._viewY}</button>
12
- <button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month">${z(`chevron-right`)}</button>
10
+ <button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month">${U(`chevron-left`)}</button>
11
+ <button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${sr[this._viewM]} ${this._viewY}</button>
12
+ <button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month">${U(`chevron-right`)}</button>
13
13
  </div>
14
14
  <div class="datepicker-weekdays">${h}</div>
15
15
  <div class="datepicker-grid${this._slide?` ${this._slide}`:``}" role="grid">${c}</div>
16
16
  <div class="datepicker-foot">
17
17
  <button type="button" class="datepicker-link" data-today${p?` disabled`:``}>Today</button>
18
18
  ${m}
19
- </div>`}_monthsHtml(){let e=F(this._value),t=new Date,{monthDisabled:n}=this._limits(),r=``;for(let i=0;i<12;i++){let a=e&&e.y===this._viewY&&e.m===i,o=t.getFullYear()===this._viewY&&t.getMonth()===i,s=n(this._viewY,i),c=[`datepicker-cell`,o?`is-today`:``,a?`is-selected`:``].filter(Boolean).join(` `),l=vn[i];if(l===void 0)throw Error(`month name missing`);r+=`<button type="button" class="${c}" data-month="${i}"${s?` disabled`:``}>${l.slice(0,3)}</button>`}return`
19
+ </div>`}_monthsHtml(){let e=z(this._value),t=new Date,{monthDisabled:n}=this._limits(),r=``;for(let i=0;i<12;i++){let a=e&&e.y===this._viewY&&e.m===i,o=t.getFullYear()===this._viewY&&t.getMonth()===i,s=n(this._viewY,i),c=[`datepicker-cell`,o?`is-today`:``,a?`is-selected`:``].filter(Boolean).join(` `),l=sr[i];if(l===void 0)throw Error(`month name missing`);r+=`<button type="button" class="${c}" data-month="${i}"${s?` disabled`:``}>${l.slice(0,3)}</button>`}return`
20
20
  <div class="datepicker-head">
21
- <button type="button" class="datepicker-nav-btn" data-nav-year="-1" aria-label="Previous year">${z(`chevron-left`)}</button>
21
+ <button type="button" class="datepicker-nav-btn" data-nav-year="-1" aria-label="Previous year">${U(`chevron-left`)}</button>
22
22
  <button type="button" class="datepicker-month" data-view="years" aria-label="Choose year">${this._viewY}</button>
23
- <button type="button" class="datepicker-nav-btn" data-nav-year="1" aria-label="Next year">${z(`chevron-right`)}</button>
23
+ <button type="button" class="datepicker-nav-btn" data-nav-year="1" aria-label="Next year">${U(`chevron-right`)}</button>
24
24
  </div>
25
- <div class="datepicker-cells">${r}</div>`}_yearsHtml(){let e=F(this._value),t=new Date().getFullYear(),{yearDisabled:n}=this._limits(),r=this._viewY-(this._viewY%10+10)%10-1,i=``;for(let a=0;a<12;a++){let o=r+a,s=e&&e.y===o,c=t===o,l=n(o),u=[`datepicker-cell`,c?`is-today`:``,s?`is-selected`:``].filter(Boolean).join(` `);i+=`<button type="button" class="${u}" data-year="${o}"${l?` disabled`:``}>${o}</button>`}return`
25
+ <div class="datepicker-cells">${r}</div>`}_yearsHtml(){let e=z(this._value),t=new Date().getFullYear(),{yearDisabled:n}=this._limits(),r=this._viewY-(this._viewY%10+10)%10-1,i=``;for(let a=0;a<12;a++){let o=r+a,s=e&&e.y===o,c=t===o,l=n(o),u=[`datepicker-cell`,c?`is-today`:``,s?`is-selected`:``].filter(Boolean).join(` `);i+=`<button type="button" class="${u}" data-year="${o}"${l?` disabled`:``}>${o}</button>`}return`
26
26
  <div class="datepicker-head">
27
- <button type="button" class="datepicker-nav-btn" data-nav-decade="-1" aria-label="Previous decade">${z(`chevron-left`)}</button>
27
+ <button type="button" class="datepicker-nav-btn" data-nav-decade="-1" aria-label="Previous decade">${U(`chevron-left`)}</button>
28
28
  <span class="datepicker-month">${r+1} to ${r+10}</span>
29
- <button type="button" class="datepicker-nav-btn" data-nav-decade="1" aria-label="Next decade">${z(`chevron-right`)}</button>
29
+ <button type="button" class="datepicker-nav-btn" data-nav-decade="1" aria-label="Next decade">${U(`chevron-right`)}</button>
30
30
  </div>
31
- <div class="datepicker-cells">${i}</div>`}_focusActive(){let e=this.querySelector(`.datepicker-pop`);if(!(e instanceof HTMLDivElement))return;let t=e.querySelector(`[tabindex="0"]`)||e.querySelector(`.is-selected`)||e.querySelector(`.datepicker-day:not(:disabled), .datepicker-cell:not(:disabled)`);t instanceof HTMLElement&&e.contains(document.activeElement)&&t.focus()}_position(e,t){d(e,t,{clampHeight:!0})}_setFocus(e,t,n,r){let{y:i,m:a}=Dn(e,t);this._focus={y:i,m:a,d:n};let o=i!==this._viewY||a!==this._viewM;this._viewY=i,this._viewM=a,this._slide=o&&r||``,this._renderView(),this._slide=``;let s=this.querySelector(`.datepicker-day[data-iso="${Cn(i,a,n)}"]`);s instanceof HTMLButtonElement&&s.focus()}_seek(e,t,n,r){let{dayDisabled:i}=this._limits(),a=new Date(e,t,n);for(let e=0;e<400;e++,a.setDate(a.getDate()+r))if(!i(a.getFullYear(),a.getMonth(),a.getDate()))return new Date(a);return null}_onKey(e){if(this._mode!==`days`)return;let t=this._focus||F(this._value)||{y:this._viewY,m:this._viewM,d:1},n=(e,t,n,r,i)=>{let a=this._seek(e,t,n,r);a&&this._setFocus(a.getFullYear(),a.getMonth(),a.getDate(),i)},r=(r,i,a=r<0?-1:1)=>{e.preventDefault(),n(t.y,t.m,t.d+r,a,i)};switch(e.key){case`ArrowLeft`:r(-1,`slide-prev`);break;case`ArrowRight`:r(1,`slide-next`);break;case`ArrowUp`:r(-7,`slide-prev`);break;case`ArrowDown`:r(7,`slide-next`);break;case`Home`:r(-((new Date(t.y,t.m,t.d).getDay()-this._firstDay()+7)%7),`slide-prev`,1);break;case`End`:r(6-(new Date(t.y,t.m,t.d).getDay()-this._firstDay()+7)%7,`slide-next`,-1);break;case`PageUp`:{e.preventDefault();let r=Dn(t.y,t.m-(e.shiftKey?12:1));n(r.y,r.m,Math.min(t.d,En(r.y,r.m)),-1,`slide-prev`);break}case`PageDown`:{e.preventDefault();let r=Dn(t.y,t.m+(e.shiftKey?12:1));n(r.y,r.m,Math.min(t.d,En(r.y,r.m)),1,`slide-next`);break}case`Enter`:case` `:e.preventDefault(),this._limits().dayDisabled(t.y,t.m,t.d)||(this.value=Cn(t.y,t.m,t.d),this.dispatchEvent(new Event(`change`,{bubbles:!0})),this._close());return}}_wire(){this._teardown();let e=this.querySelector(`.datepicker-trigger`),t=this.querySelector(`.datepicker-pop`),n=this.querySelector(`.datepicker`);if(!(e instanceof HTMLButtonElement)||!(t instanceof HTMLDivElement))return;let r=()=>!t.hidden,i=()=>{r()&&this._position(e,t)};this._openFn=()=>{if(I(this))return;let r=new Date,a=F(this._value);(a||!this._viewNavigated)&&(this._viewY=r.getFullYear(),this._viewM=r.getMonth()),this._mode=`days`;let o=r.getFullYear()===this._viewY&&r.getMonth()===this._viewM,s=a&&a.y===this._viewY&&a.m===this._viewM;if(this._focus=s?a:{y:this._viewY,m:this._viewM,d:o?r.getDate():1},this._limits().dayDisabled(this._focus.y,this._focus.m,this._focus.d)){let e=this._focus,t=[1,-1].map(t=>this._seek(e.y,e.m,e.d,t)).find(t=>t&&t.getMonth()===e.m);t&&(this._focus={y:t.getFullYear(),m:t.getMonth(),d:t.getDate()})}this._renderView(),t.hidden=!1,n?.classList.add(`open`),this._position(e,t),f(this,i),e.setAttribute(`aria-expanded`,`true`);let c=t.querySelector(`[tabindex="0"]`);c instanceof HTMLElement&&c.focus()},this._closeFn=()=>{t.hidden=!0,n?.classList.remove(`open`),e.setAttribute(`aria-expanded`,`false`),p(this),e.focus()},e.addEventListener(`click`,()=>r()?this._close():this._open()),t.addEventListener(`click`,e=>{let t=e.target;if(!(t instanceof Element))throw Error(`click target is not an element`);let n=t.closest(`[data-nav]`);if(n instanceof HTMLElement){this._viewNavigated=!0,this._slide=Number(n.dataset.nav)<0?`slide-prev`:`slide-next`;let e=Dn(this._viewY,this._viewM+Number(n.dataset.nav));this._viewY=e.y,this._viewM=e.m,this._focus={y:e.y,m:e.m,d:1},this._renderView(),this._slide=``;return}let r=t.closest(`[data-nav-year]`);if(r instanceof HTMLElement){this._viewY+=Number(r.dataset.navYear),this._renderView();return}let i=t.closest(`[data-nav-decade]`);if(i instanceof HTMLElement){this._viewY+=Number(i.dataset.navDecade)*10,this._renderView();return}let a=t.closest(`[data-view]`);if(a instanceof HTMLElement){this._mode=a.dataset.view,this._renderView();return}let o=t.closest(`[data-month]`);if(o instanceof HTMLButtonElement&&!o.disabled){this._viewNavigated=!0,this._viewM=Number(o.dataset.month),this._mode=`days`,this._focus={y:this._viewY,m:this._viewM,d:1},this._renderView();return}let s=t.closest(`[data-year]`);if(s instanceof HTMLButtonElement&&!s.disabled){this._viewNavigated=!0,this._viewY=Number(s.dataset.year),this._mode=`months`,this._renderView();return}if(t.closest(`[data-today]`)){let e=new Date;if(this._limits().dayDisabled(e.getFullYear(),e.getMonth(),e.getDate()))return;this.value=Cn(e.getFullYear(),e.getMonth(),e.getDate()),this.dispatchEvent(new Event(`change`,{bubbles:!0})),this._close();return}if(t.closest(`[data-clear]`)){this.value=``,this.dispatchEvent(new Event(`change`,{bubbles:!0})),this._close();return}let c=t.closest(`.datepicker-day[data-iso]`);c instanceof HTMLButtonElement&&!c.disabled&&(this.value=c.dataset.iso,this.dispatchEvent(new Event(`change`,{bubbles:!0})),this._close())}),this._onKeyBound=e=>{r()&&this._onKey(e)},t.addEventListener(`keydown`,this._onKeyBound),this._bindGlobal=()=>{this._teardown(),this._onDocClick=e=>{r()&&!e.composedPath().includes(this)&&this._close()},document.addEventListener(`click`,this._onDocClick),this._onDocKey=e=>{r()&&e.key===`Escape`&&this._close()},document.addEventListener(`keydown`,this._onDocKey),this._onHostKey=e=>{r()&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),this._close())},this.addEventListener(`keydown`,this._onHostKey),r()&&f(this,i)},this._bindGlobal(),this._syncFormValue()}_teardown(){this._onDocClick&&=(document.removeEventListener(`click`,this._onDocClick),null),this._onDocKey&&=(document.removeEventListener(`keydown`,this._onDocKey),null),this._onHostKey&&=(this.removeEventListener(`keydown`,this._onHostKey),null),p(this)}disconnectedCallback(){this._teardown()}},Pr=class extends g{_pointerMoveListener;_pointerLeaveListener;_frame;_pointerX;static get observedAttributes(){return[`static`,`max-scale`,`radius`]}constructor(){super(),this._pointerMoveListener=null,this._pointerLeaveListener=null,this._frame=0,this._pointerX=0}connectedCallback(){this._wire()}disconnectedCallback(){this._teardown()}attributeChangedCallback(e,t,n){e===`static`&&this.isConnected&&this._wire()}_maxScale(){return Ir(this.getAttribute(`max-scale`),1.6)}_radius(){return Ir(this.getAttribute(`radius`),100)}_magnifyEnabled(){return!(this.hasAttribute(`static`)||typeof matchMedia==`function`&&(matchMedia(`(pointer: coarse)`).matches||matchMedia(`(prefers-reduced-motion: reduce)`).matches))}_applyMagnification(){this._frame=0;let e=this._maxScale(),t=this._radius();for(let n of this.querySelectorAll(`.dock-item`)){let r=Fr(n),i=r.getBoundingClientRect(),a=Math.abs(this._pointerX-(i.left+i.width/2)),o=Math.max(0,1-a/t),s=1+(e-1)*o;r.style.setProperty(`--wui-dock-mag`,s.toFixed(3))}}_resetMagnification(){this._frame&&=(cancelAnimationFrame(this._frame),0);for(let e of this.querySelectorAll(`.dock-item`))Fr(e).style.removeProperty(`--wui-dock-mag`)}_wire(){this._teardown(),this._magnifyEnabled()&&(this._pointerMoveListener=e=>{this._pointerX=e.clientX,this._frame||=requestAnimationFrame(()=>this._applyMagnification())},this._pointerLeaveListener=()=>this._resetMagnification(),this.addEventListener(`pointermove`,this._pointerMoveListener),this.addEventListener(`pointerleave`,this._pointerLeaveListener))}_teardown(){this._pointerMoveListener&&=(this.removeEventListener(`pointermove`,this._pointerMoveListener),null),this._pointerLeaveListener&&=(this.removeEventListener(`pointerleave`,this._pointerLeaveListener),null),this._resetMagnification()}},Fr=e=>v(e,HTMLElement,`wui-dock item must be an HTML element`),Ir=(e,t)=>{let n=Number.parseFloat(e??``);return Number.isFinite(n)?n:t},Lr=300,Rr=150,zr=`.wui-hover-card-trigger`,Br=`.wui-hover-card-panel`,Vr=`a[href],button,input,select,textarea,[tabindex]`,Hr=0;function Ur(e,t){let n=e.querySelector(t);return n instanceof HTMLElement?n:null}var Wr=class extends g{_doc;_timer;_described;_refocusing;_onOver;_onOut;_onFocusIn;_onFocusOut;_onKeyDown;static get observedAttributes(){return[`open`]}constructor(){super(),this._doc=null,this._timer=null,this._described=null,this._refocusing=!1,this._onOver=e=>{if(e.pointerType===`touch`||e.pointerType===`pen`)return;let t=this._zone(e.target);t===`panel`?this._clear():t===`trigger`&&this._schedule(!0)},this._onOut=e=>{e.pointerType!==`touch`&&e.pointerType!==`pen`&&this._zone(e.target)&&!this._zone(e.relatedTarget)&&this._schedule(!1)},this._onFocusIn=e=>{this._refocusing||(this._zone(e.target)===`trigger`?this._schedule(!0):this._zone(e.target)===`panel`&&this._clear())},this._onFocusOut=e=>{this._zone(e.target)&&!this._zone(e.relatedTarget)&&this._schedule(!1)},this._onKeyDown=e=>{if(e.key!==`Escape`||!this.isOpen||this.hasAttribute(`open`))return;e.stopPropagation();let t=this._panel?.contains(this.ownerDocument.activeElement);this._clear(),this._setOpen(!1),t&&(this._refocusing=!0,this._anchor?.focus(),this._refocusing=!1)}}get isOpen(){return this._panel?.hasAttribute(`data-open`)??!1}connectedCallback(){this._doc=this.ownerDocument,this.addEventListener(`pointerover`,this._onOver),this.addEventListener(`pointerout`,this._onOut),this.addEventListener(`focusin`,this._onFocusIn),this.addEventListener(`focusout`,this._onFocusOut),this._syncOpen()}attributeChangedCallback(){this.isConnected&&this._syncOpen()}disconnectedCallback(){this._clear(),this.removeEventListener(`pointerover`,this._onOver),this.removeEventListener(`pointerout`,this._onOut),this.removeEventListener(`focusin`,this._onFocusIn),this.removeEventListener(`focusout`,this._onFocusOut),this._doc?.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`keydown`,this._onKeyDown),p(this),this._doc=null}get _trigger(){return Ur(this,zr)}get _panel(){return Ur(this,Br)}get _anchor(){let e=this._trigger;return e?Ur(e,Vr)??e:null}_zone(e){if(!(e instanceof Node)||!this.contains(e))return null;let t=e instanceof Element?e:e.parentElement;return this._panel?.contains(t)?`panel`:this._trigger?.contains(t)?`trigger`:null}_delay(e,t){let n=Number(this.getAttribute(e));return this.hasAttribute(e)&&Number.isFinite(n)&&n>=0?n:t}_clear(){this._timer!==null&&clearTimeout(this._timer),this._timer=null}_syncOpen(){this._clear(),this._setOpen(this.hasAttribute(`open`))}_schedule(e){if(!e&&this.hasAttribute(`open`)||(this._clear(),this.isOpen===e))return;let t=e?this._delay(`open-delay`,Lr):this._delay(`close-delay`,Rr);this._timer=setTimeout(()=>{this._timer=null,this._setOpen(e)},t)}_setOpen(e){let t=this._panel;t&&this.isOpen!==e&&(e?(t.setAttribute(`data-open`,``),this._reposition(),f(this,()=>this._reposition()),this._doc?.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`keydown`,this._onKeyDown),this._describe(t)):(t.removeAttribute(`data-open`),p(this),this._doc?.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`keydown`,this._onKeyDown),this._described?.removeAttribute(`aria-describedby`),this._described=null),this.dispatchEvent(new CustomEvent(e?`wui:hover-card:open`:`wui:hover-card:close`,{bubbles:!0})))}_reposition(){this.isOpen&&d(this._trigger,this._panel,{clampHeight:!0})}_describe(e){let t=this._anchor;t&&(e.id||=`wui-hover-card-${++Hr}`,t.setAttribute(`aria-describedby`,e.id),this._described=t)}},Gr=`data-open`,Kr=8,qr=`.wui-nav-menu-link`,Jr=e=>e instanceof Element?e:e instanceof Node?e.parentElement:null,Yr=e=>[...e].filter(e=>e instanceof HTMLElement),Xr=e=>{let t=e.children[0];if(!(t instanceof HTMLElement))throw Error(`Navigation entry has no control.`);return t},Zr=(e,t,n)=>{let r=e[t];if(r===void 0)throw Error(n);return r},Qr=class extends g{constructor(){super(),this._onClick=e=>this._handleClick(e),this._onKeyDown=e=>this._handleKeyDown(e),this._onFocusOut=e=>{let t=this._openItem(),n=e.relatedTarget;t&&n instanceof Node&&!t.contains(n)&&this._set(t,!1)},this._onPointerDown=e=>{let t=this._openItem();t&&!e.composedPath().includes(t)&&this._set(t,!1)},this._onResize=()=>{let e=this._openItem();if(!e)return;let t=_(e.children[1],`Navigation entry has no panel.`);this._align(t)}}connectedCallback(){this._teardown(),this.addEventListener(`click`,this._onClick),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusout`,this._onFocusOut),document.addEventListener(`pointerdown`,this._onPointerDown,!0)}disconnectedCallback(){this._teardown()}open(e){let t=this._items().find(t=>{let n=t.children[0];return n instanceof HTMLElement&&this._isTrigger(n)&&n.dataset.key===e});t&&this._set(t,!0)}close(e=!1){let t=this._openItem();t&&(this._set(t,!1),e&&Xr(t).focus({preventScroll:!0}))}_items(){return Yr(this.querySelectorAll(`.wui-nav-menu-item`))}_openItem(){return this._items().find(e=>e.children[1]?.hasAttribute(Gr))??null}_isTrigger(e){return!!e?.classList.contains(`wui-nav-menu-trigger`)}_entries(){return this._items().map(Xr)}_links(e){let t=e.children[1];return t?Yr(t.querySelectorAll(qr)):[]}_set(e,t){let n=e.children[1];if(!n)return;let r=Xr(e);if(t){let t=this._openItem();t&&t!==e&&this._set(t,!1)}n.hasAttribute(Gr)!==t&&(n.toggleAttribute(Gr,t),r.setAttribute(`aria-expanded`,String(t)),t?(this._align(n),window.addEventListener(`resize`,this._onResize)):(n.removeAttribute(`data-align`),this._openItem()||window.removeEventListener(`resize`,this._onResize)),this.dispatchEvent(new CustomEvent(`wui-navigation-menu:toggle`,{bubbles:!0,detail:{key:r.dataset.key??null,open:t}})))}_align(e){e.removeAttribute(`data-align`),e.getBoundingClientRect().right>window.innerWidth-Kr&&e.setAttribute(`data-align`,`end`)}_handleClick(e){let t=Jr(e.target),n=t?.closest(`.wui-nav-menu-trigger`);if(n&&this.contains(n)){let e=_(n.parentElement,`Navigation trigger has no entry.`),t=_(e.children[1],`Navigation entry has no panel.`);this._set(e,!t.hasAttribute(Gr));return}let r=t?.closest(qr);r&&this.contains(r)&&this.close()}_handleKeyDown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=Jr(e.target)?.closest(`.wui-nav-menu-trigger, .wui-nav-menu-toplink, .wui-nav-menu-link`);if(!(t instanceof HTMLElement)||!this.contains(t))return;let n=this._openItem();if(e.key===`Escape`){if(!n)return;e.preventDefault(),e.stopPropagation();let r=n.contains(t);this._set(n,!1),r&&Xr(n).focus({preventScroll:!0});return}if(t.matches(qr)){this._linkKey(e,t);return}let r=this._entries(),i=r.indexOf(t);if(e.key===`ArrowRight`||e.key===`ArrowLeft`||e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?0:e.key===`End`?r.length-1:(i+(e.key===`ArrowRight`?1:-1)+r.length)%r.length;n&&this._set(n,!1),Zr(r,t,`Navigation has no entry to focus.`).focus({preventScroll:!0})}else if(e.key===`ArrowDown`&&this._isTrigger(t)){e.preventDefault();let n=_(t.parentElement,`Navigation trigger has no entry.`);this._set(n,!0),Zr(this._links(n),0,`Navigation panel has no link to focus.`).focus({preventScroll:!0})}}_linkKey(e,t){let n=_(t.closest(`.wui-nav-menu-item`),`Navigation link has no entry.`),r=this._links(n),i=r.indexOf(t);e.key===`ArrowDown`||e.key===`ArrowUp`?(e.preventDefault(),Zr(r,(i+(e.key===`ArrowDown`?1:-1)+r.length)%r.length,`Navigation panel has no link to focus.`).focus({preventScroll:!0})):e.key===`Home`?(e.preventDefault(),Zr(r,0,`Navigation panel has no link to focus.`).focus({preventScroll:!0})):e.key===`End`&&(e.preventDefault(),Zr(r,r.length-1,`Navigation panel has no link to focus.`).focus({preventScroll:!0}))}_teardown(){let e=this._openItem();e&&this._set(e,!1),window.removeEventListener(`resize`,this._onResize),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`focusout`,this._onFocusOut),document.removeEventListener(`pointerdown`,this._onPointerDown,!0)}},$r=n({NOTIFICATION_COUNT_CAP:()=>99,NOTIFICATION_TEXT:()=>V,groupNotificationsByDay:()=>si,notificationCountText:()=>ni,notificationDayHeading:()=>oi,notificationTime:()=>ai,notificationTriggerLabel:()=>ri,notificationUnreadAnnouncement:()=>ii}),ei=99,ti=864e5,V=Object.freeze({label:`Notifications`,empty:`You are all caught up.`,markAll:`Mark all read`,viewAll:`View all`,unreadPrefix:`Unread: `,today:`Today`,yesterday:`Yesterday`,allRead:`All notifications marked as read.`,noneUnread:`No unread notifications`,failed:Object.freeze({forbidden:`You do not have permission to mark these as read.`,client:`These could not be marked as read. Refresh the page and try again.`,validation:`These could not be marked as read. Refresh the page and try again.`,server:`Something went wrong on our side, so these were not marked as read. Try again in a moment.`,network:`Could not reach the server, so these were not marked as read. Check your connection and try again.`})});function ni(e){return e>99?`99+`:String(e)}function ri(e,t){return t===0?e:`${e}, ${ni(t)} unread`}function ii(e){return e===0?V.noneUnread:`${ni(e)} unread notifications`}function ai(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?``:M(e,{pattern:`time`})}function oi(e,t=Date.now()){let n=M(e);return n===M(t)?V.today:n===M(_t(t)-ti)?V.yesterday:n}function si(e,t=Date.now()){let n=new Map;for(let r of e){if(!Number.isFinite(_t(r.at)))throw Error(`<AppNotificationCenter> item "${r.id}": at must be an ISO date-time with its zone (or a YYYY-MM-DD day), got ${String(r.at)}.`);let e=M(r.at),i=n.get(e);i||(i={key:e,heading:oi(r.at,t),items:[]},n.set(e,i)),i.items.push(r)}return[...n.values()]}var ci=Object.freeze([`POST`,`PUT`,`PATCH`,`DELETE`]),li=e=>(zn(`[@webority/ui-elements] Wui-Toast-Action: ${e}; the toast shows no action.`),null),ui=e=>typeof e==`object`&&!!e;function di(e){if(e==null||e===``)return null;let t;try{t=JSON.parse(e)}catch{return li(`the value is not JSON`)}let n=ui(t)?t:{},r=n.label,i=n.url,a=String(n.method??`POST`).toUpperCase();return typeof r!=`string`||r===``||typeof i!=`string`||i===``?li(`label and url must be non-empty strings`):ci.includes(a)?{label:r,url:i,method:a}:li(`method must be one of ${ci.join(`, `)}`)}var fi=n({CSRF_META_NAME:()=>pi,DEFAULT_CSRF_HEADER:()=>mi,HTTP_KINDS:()=>vi,WUI_HEADERS:()=>H,WUI_REQUEST_HEADER:()=>_i,classifyStatus:()=>Si,configureCsrf:()=>gi,createRequestQueue:()=>Ti,readCsrf:()=>bi,wuiFetch:()=>U}),pi=`wui-csrf`,mi=`RequestVerificationToken`,hi={metaName:pi,header:mi};function gi({metaName:e=pi,header:t=mi}={}){hi={metaName:e,header:t}}var _i=`Wui-Request`,H=Object.freeze({fragment:`Wui-Fragment`,message:`Wui-Message`,redirect:`Wui-Redirect`,result:`Wui-Result`,keepOpen:`Wui-Keep-Open`,toastVariant:`Wui-Toast-Variant`,toastAction:`Wui-Toast-Action`,data:`Wui-Data`,next:`Wui-Next`}),vi=Object.freeze([`ok`,`validation`,`forbidden`,`client`,`server`,`network`,`aborted`,`stale`,`session`]),yi=new Set([`GET`,`HEAD`]);function bi(e=document){let t=[...e.querySelectorAll(`meta`)].find(e=>e.getAttribute(`name`)===hi.metaName),n=t?.getAttribute(`content`);return!t||!n?null:{header:t.getAttribute(`data-header`)||hi.header,token:n}}var xi=e=>{try{return new URL(e,window.location.href).origin===window.location.origin}catch{return!1}};function Si(e){return e>=200&&e<300?`ok`:e===401?`session`:e===403?`forbidden`:e===422?`validation`:e>=400&&e<500?`client`:`server`}var Ci=e=>typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`,wi=e=>{if(e==null||e===``)return null;try{return JSON.parse(e)}catch(e){throw TypeError(`The ${H.data} response header is not JSON: ${e instanceof Error?e.message:String(e)}`,{cause:e})}};async function U(e,t={}){let n=(t.method||`GET`).toUpperCase(),r=t.navigate||(e=>window.location.assign(e)),i={Accept:`text/html`,"X-Requested-With":`XMLHttpRequest`,[_i]:`1`,...t.headers};if(!yi.has(n)&&xi(e)){let e=bi();e&&(i[e.header]=e.token)}let a=e=>{if(e==null)return null;try{return decodeURIComponent(e)}catch{return e}},o=(e,t=null,n=``)=>{let r=e=>t?.headers.get(e)??null;return{kind:e,ok:e===`ok`,status:t?.status??0,html:n,response:t,message:a(r(H.message)),redirect:r(H.redirect),result:r(H.result),keepOpen:r(H.keepOpen)===`1`,toastVariant:r(H.toastVariant),toastAction:di(r(H.toastAction)),fragment:r(H.fragment)===`1`,data:wi(a(r(H.data))),next:r(H.next)}},s;try{s=await fetch(e,{method:n,...t.body===void 0?{}:{body:t.body},headers:i,...t.signal===void 0?{}:{signal:t.signal},credentials:`same-origin`})}catch(e){return o(Ci(e)||t.signal?.aborted?`aborted`:`network`)}let c=Si(s.status);if(c===`ok`&&s.redirected&&s.headers.get(H.fragment)!==`1`&&(c=`session`),c===`session`)return r(s.status===401?s.headers.get(`Location`)||window.location.href:s.url),o(c,s);let l=``;if(c===`ok`||c===`validation`)try{l=await s.text()}catch(e){return o(Ci(e)||t.signal?.aborted?`aborted`:`network`,s)}return o(c,s,l)}function Ti(){let e=null,t=0;return{async run(n,r={}){e?.abort();let i=new AbortController;e=i;let a=++t,o=r.signal;o&&(o.aborted?i.abort():o.addEventListener(`abort`,()=>i.abort(),{once:!0}));let s;try{s=await U(n,{...r,signal:i.signal})}finally{e===i&&(e=null)}return a!==t&&s.kind!==`aborted`?{...s,kind:`stale`,ok:!1}:s},abort(){e?.abort(),e=null}}}var Ei=`.wui-notification-center-trigger`,Di=`.wui-notification-center-panel`,Oi=`.wui-notification-center-count`,ki=`.wui-notification-center-live`,Ai=`.wui-notification-center-markall`,ji=`.wui-notification-center-item`,Mi=`wui-notification-center-item-read`,Ni=`.wui-notification-center-unread-label`,Pi=`.app-tabs`,Fi=`.wui-notification-center-tabs [role='tablist']`,Ii=`.wui-notification-center-tabs [role='tab']`,Li=`.wui-notification-center-empty`,Ri={ArrowDown:1,ArrowUp:-1,Home:`first`,End:`last`},zi=e=>!!e,Bi=e=>Object.hasOwn(V.failed,e),Vi=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},Hi=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),Ui=class extends g{constructor(){super(),this._doc=null,this._unread=0,this._busy=!1,this._onClick=e=>this._click(e),this._onKeyDown=e=>this._key(e),this._onOutside=e=>{e.composedPath().includes(this)||this.close()},this._onFocusOut=e=>{let t=e.relatedTarget;t instanceof Node&&!this.contains(t)&&this.close()}}connectedCallback(){this._doc=this.ownerDocument,this._unread=this._initialUnread(),this.addEventListener(`click`,this._onClick),this.addEventListener(`keydown`,this._onKeyDown),this._doc.addEventListener(`mousedown`,this._onOutside),this.addEventListener(`focusout`,this._onFocusOut),this._syncOpen(),this.isOpen&&this._layoutTabs()}disconnectedCallback(){this.removeEventListener(`click`,this._onClick),this.removeEventListener(`keydown`,this._onKeyDown),this._doc?.removeEventListener(`mousedown`,this._onOutside),this.removeEventListener(`focusout`,this._onFocusOut),this._doc=null}get isOpen(){return this.hasAttribute(`open`)}open(){this.isOpen||(this.setAttribute(`open`,``),this._syncOpen(),this._layoutTabs(),Vi(this,Di)?.focus(),this._announceToggle())}close({restoreFocus:e=!1}={}){this.isOpen&&(this.removeAttribute(`open`),this._syncOpen(),e&&Vi(this,Ei)?.focus(),this._announceToggle())}toggle(){this.isOpen?this.close():this.open()}_announceToggle(){this.dispatchEvent(new CustomEvent(`wui:notification-center:toggle`,{bubbles:!0,detail:{open:this.isOpen}}))}_syncOpen(){this.querySelector(Ei)?.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`)}_initialUnread(){let e=Number.parseInt(this.getAttribute(`unread`)??``,10);return Number.isInteger(e)&&e>=0?e:this.querySelectorAll(`${ji}:not(.${Mi}):not([data-archived="true"])`).length}_click(e){let t=e.target;if(!(t instanceof Element))return;let n=t.closest(Ii);if(n instanceof HTMLElement&&this.contains(n)){if(this.hasAttribute(`controlled`))return;this._pickTab(n);return}let r=t.closest(`${Ei}, ${Ai}, ${ji}`);r instanceof HTMLElement&&this.contains(r)&&(r.matches(Ei)?this.toggle():this.hasAttribute(`controlled`)||(r.matches(Ai)?this._markAll():this._markItem(r)))}_key(e){if(e.key===`Escape`&&this.isOpen){e.preventDefault(),e.stopPropagation(),this.close({restoreFocus:!0});return}if(!this.isOpen)return;let t=e.target;if(!(t instanceof Element))throw Error(`Keyboard event target is not an element.`);if(!this.querySelector(Di)?.contains(t)||t.closest(Pi))return;let n=Ri[e.key];if(n===void 0)return;let r=Hi(this,ji).filter(e=>!e.closest(`[hidden]`));if(r.length===0)return;let i=t.closest(ji),a=i instanceof HTMLElement?r.indexOf(i):-1,o;o=n===`first`?0:n===`last`?r.length-1:a===-1?n===1?0:r.length-1:Math.min(r.length-1,Math.max(0,a+n)),e.preventDefault(),r[o]?.focus()}_markItem(e){e.classList.contains(Mi)||(this._applyRead(e),e.dataset.archived!==`true`&&(this._unread=Math.max(0,this._unread-1)),this._render(),this._say(ii(this._unread)),this._emitRead([e.dataset.id].filter(zi),!1))}async _markAll(){if(this._busy)return;let e=Hi(this,`${ji}:not(.${Mi})`);if(e.length===0&&this._unread===0)return;let t=e.map(e=>e.dataset.id).filter(zi),n=this.getAttribute(`read-action`);if(n){this._setBusy(!0);let e=new URLSearchParams;for(let n of t)e.append(`ids`,n);let r=await U(n,{method:`POST`,body:e});if(this._setBusy(!1),!r.ok){if(r.kind===`session`||r.kind===`aborted`)return;let e=r.kind,t=r.message||(Bi(e)?V.failed[e]:V.failed.server);this._say(t),this.dispatchEvent(new CustomEvent(`wui:notification-center:failed`,{bubbles:!0,detail:{kind:e,message:t}}));return}}for(let t of e)this._applyRead(t);this._unread=0,this._render(),this._say(V.allRead),this._emitRead(t,!0)}_pickTab(e){let t=e.closest(Fi);if(t instanceof HTMLElement){for(let n of Hi(t,Ii)){let t=n===e;n.classList.toggle(`active`,t),n.setAttribute(`aria-selected`,t?`true`:`false`),n.setAttribute(`tabindex`,t?`0`:`-1`)}this._layoutTabs(),this._filterItems(e.dataset.key)}}_layoutTabs(){for(let e of Hi(this,Fi)){let t=Vi(e,`.app-tab.active`);t&&(e.style.setProperty(`--wui-tab-x`,`${t.offsetLeft}px`),e.style.setProperty(`--wui-tab-w`,`${t.offsetWidth}px`)),e.setAttribute(`data-wui-tabs`,``)}}_filterItems(e){let t=!1;for(let n of Hi(this,ji)){let r=n.dataset.archived===`true`,i=n.classList.contains(Mi),a=e===`archived`?r:!r&&(e!==`unread`||!i);a&&(t=!0);let o=n.closest(`li`);o&&(o.hidden=!a)}for(let e of Hi(this,`.wui-notification-center-list section`))e.hidden=[...e.querySelectorAll(`li`)].every(e=>e.hidden);let n=Vi(this,Li);n&&(n.hidden=t)}_applyRead(e){e.classList.add(Mi),e.querySelector(Ni)?.remove()}_setBusy(e){this._busy=e;let t=this.querySelector(Ai);t instanceof HTMLButtonElement&&(t.disabled=e||this._unread===0,e?t.setAttribute(`aria-busy`,`true`):t.removeAttribute(`aria-busy`))}_render(){let e=Vi(this,Oi);e&&(e.textContent=ni(this._unread),e.hidden=this._unread===0),this.querySelector(Ei)?.setAttribute(`aria-label`,ri(this.getAttribute(`label`)||V.label,this._unread));let t=this.querySelector(Ai);t instanceof HTMLButtonElement&&(t.disabled=this._unread===0)}_say(e){let t=this.querySelector(ki);t&&(t.textContent=e)}_emitRead(e,t){this.dispatchEvent(new CustomEvent(`wui:notification-center:read`,{bubbles:!0,detail:{ids:e,all:t}}))}},Wi=`.wui-onboarding-card`,Gi=`.wui-onboarding-steps`,Ki=`.wui-onboarding-toggle`,qi=`.wui-onboarding-dismiss`,Ji=`.wui-onboarding-restore`,Yi=`wui-onboarding:`,Xi=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},Zi=class extends g{constructor(){super(),this._onClick=e=>{let t=e.target instanceof Element?e.target:null;t&&(t.closest(qi)?this.dismiss():t.closest(Ji)?this.restore():t.closest(Ki)&&this.toggle())}}connectedCallback(){this.addEventListener(`click`,this._onClick),this._stored()===`dismissed`&&this._setDismissed(!0)}disconnectedCallback(){this.removeEventListener(`click`,this._onClick)}get dismissed(){return Xi(this,Wi)?.hidden===!0}get collapsed(){return Xi(this,Gi)?.hidden===!0}dismiss(){this.dismissed||(this._setDismissed(!0),this._store(`dismissed`),Xi(this,Ji)?.focus(),this.dispatchEvent(new CustomEvent(`wui:onboarding:dismiss`,{bubbles:!0})))}restore(){this.dismissed&&(this._setDismissed(!1),this._store(null),Xi(this,Ki)?.focus(),this.dispatchEvent(new CustomEvent(`wui:onboarding:restore`,{bubbles:!0})))}toggle(){let e=Xi(this,Gi);if(!e)return;let t=!e.hidden;e.hidden=t,this.querySelector(Ki)?.setAttribute(`aria-expanded`,String(!t)),this.dispatchEvent(new CustomEvent(`wui:onboarding:collapse`,{bubbles:!0,detail:{collapsed:t}}))}_setDismissed(e){let t=Xi(this,Wi),n=Xi(this,Ji);t&&(t.hidden=e),n&&(n.hidden=!e)}_key(){let e=this.getAttribute(`storage-key`);return e?Yi+e:null}_stored(){let e=this._key();if(!e)return null;try{return window.localStorage.getItem(e)}catch{return null}}_store(e){let t=this._key();if(t)try{e?window.localStorage.setItem(t,e):window.localStorage.removeItem(t)}catch(e){if(!(e instanceof DOMException))throw e}}},Qi=/[^0-9]/g,$i=/[^0-9a-zA-Z]/g,ea=class extends g{static formAssociated=!0;static get observedAttributes(){return[`value`,`length`,`mode`,`disabled`,`readonly`,`loading`,`size`,`aria-label`]}get length(){let e=Number.parseInt(this.getAttribute(`length`)??`6`,10);return Number.isFinite(e)&&e>0?e:6}set length(e){this.setAttribute(`length`,String(e))}get mode(){return this.getAttribute(`mode`)===`alphanumeric`?`alphanumeric`:`numeric`}set mode(e){this.setAttribute(`mode`,String(e??`numeric`))}get value(){return this._value??``}set value(e){this._value=this._clean(e),L(this,this._value),this._paint()}_clean(e){return(e==null?``:String(e)).replace(this.mode===`alphanumeric`?$i:Qi,``).slice(0,this.length)}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}}connectedCallback(){this._rendered?this._onSelectionChange&&document.addEventListener(`selectionchange`,this._onSelectionChange):(this._defaultCaptured||=(this._defaultValue=this._value,!0),this.render())}formResetCallback(){this._value=this._defaultValue||``,L(this,this._value),this._paint()}attributeChangedCallback(e,t,n){this._rendered&&(e===`value`?(this._value=this._clean(n),L(this,this._value),this._paint()):this.render())}render(){this._value=this._clean(this.getAttribute(`value`)??this._value);let e=this.length,t=this.mode===`numeric`,n=this.hasAttribute(`disabled`),r=An(this)||this.hasAttribute(`loading`),i=this.getAttribute(`size`),a=i===`sm`||i===`lg`?` otp-${i}`:``,o=Array.from({length:e},()=>`<span class="otp-slot" aria-hidden="true"></span>`).join(``),s=this.getAttribute(`aria-label`),c=s?` aria-label="${s.replace(/"/g,`&quot;`)}"`:``;this.innerHTML=`
31
+ <div class="datepicker-cells">${i}</div>`}_focusActive(){let e=this.querySelector(`.datepicker-pop`);if(!(e instanceof HTMLDivElement))return;let t=e.querySelector(`[tabindex="0"]`)||e.querySelector(`.is-selected`)||e.querySelector(`.datepicker-day:not(:disabled), .datepicker-cell:not(:disabled)`);t instanceof HTMLElement&&e.contains(document.activeElement)&&t.focus()}_setFocus(e,t,n,r){let{y:i,m:a}=gr(e,t);this._focus={y:i,m:a,d:n};let o=i!==this._viewY||a!==this._viewM;this._viewY=i,this._viewM=a,this._slide=o&&r||``,this._renderView(),this._slide=``;let s=this.querySelector(`.datepicker-day[data-iso="${fr(i,a,n)}"]`);s instanceof HTMLButtonElement&&s.focus()}_seek(e,t,n,r){let{dayDisabled:i}=this._limits(),a=new Date(e,t,n);for(let e=0;e<400;e++,a.setDate(a.getDate()+r))if(!i(a.getFullYear(),a.getMonth(),a.getDate()))return new Date(a);return null}_onKey(e){if(this._mode!==`days`)return;let t=this._focus||z(this._value)||{y:this._viewY,m:this._viewM,d:1},n=(e,t,n,r,i)=>{let a=this._seek(e,t,n,r);a&&this._setFocus(a.getFullYear(),a.getMonth(),a.getDate(),i)},r=(r,i,a=r<0?-1:1)=>{e.preventDefault(),n(t.y,t.m,t.d+r,a,i)};switch(e.key){case`ArrowLeft`:r(-1,`slide-prev`);break;case`ArrowRight`:r(1,`slide-next`);break;case`ArrowUp`:r(-7,`slide-prev`);break;case`ArrowDown`:r(7,`slide-next`);break;case`Home`:r(-((new Date(t.y,t.m,t.d).getDay()-this._firstDay()+7)%7),`slide-prev`,1);break;case`End`:r(6-(new Date(t.y,t.m,t.d).getDay()-this._firstDay()+7)%7,`slide-next`,-1);break;case`PageUp`:{e.preventDefault();let r=gr(t.y,t.m-(e.shiftKey?12:1));n(r.y,r.m,Math.min(t.d,hr(r.y,r.m)),-1,`slide-prev`);break}case`PageDown`:{e.preventDefault();let r=gr(t.y,t.m+(e.shiftKey?12:1));n(r.y,r.m,Math.min(t.d,hr(r.y,r.m)),1,`slide-next`);break}case`Enter`:case` `:e.preventDefault(),this._limits().dayDisabled(t.y,t.m,t.d)||(this.value=fr(t.y,t.m,t.d),this.dispatchEvent(new Event(`change`,{bubbles:!0})),this._close());return}}_wire(){let e=this.querySelector(`.datepicker-trigger`),t=this.querySelector(`.datepicker-pop`),n=this.querySelector(`.datepicker`);if(!(e instanceof HTMLButtonElement)||!(t instanceof HTMLDivElement))return;let r=()=>M(t),i=()=>{n?.classList.remove(`open`),e.setAttribute(`aria-expanded`,`false`),this._closingQuietly||e.focus()};this._openFn=()=>{if(B(this))return;let a=new Date,o=z(this._value);(o||!this._viewNavigated)&&(this._viewY=a.getFullYear(),this._viewM=a.getMonth()),this._mode=`days`;let s=a.getFullYear()===this._viewY&&a.getMonth()===this._viewM,c=o&&o.y===this._viewY&&o.m===this._viewM;if(this._focus=c?o:{y:this._viewY,m:this._viewM,d:s?a.getDate():1},this._limits().dayDisabled(this._focus.y,this._focus.m,this._focus.d)){let e=this._focus,t=[1,-1].map(t=>this._seek(e.y,e.m,e.d,t)).find(t=>t&&t.getMonth()===e.m);t&&(this._focus={y:t.getFullYear(),m:t.getMonth(),d:t.getDate()})}if(this._renderView(),A(e,t,{mode:`auto`,clampHeight:!0,onClosed:i}),!r())return;n?.classList.add(`open`),e.setAttribute(`aria-expanded`,`true`);let l=t.querySelector(`[tabindex="0"]`);l instanceof HTMLElement&&l.focus()},this._closeFn=()=>{j(t)},e.addEventListener(`click`,()=>r()?this._close():this._open()),t.addEventListener(`click`,e=>{let t=e.target;if(!(t instanceof Element))throw Error(`click target is not an element`);let n=t.closest(`[data-nav]`);if(n instanceof HTMLElement){this._viewNavigated=!0,this._slide=Number(n.dataset.nav)<0?`slide-prev`:`slide-next`;let e=gr(this._viewY,this._viewM+Number(n.dataset.nav));this._viewY=e.y,this._viewM=e.m,this._focus={y:e.y,m:e.m,d:1},this._renderView(),this._slide=``;return}let r=t.closest(`[data-nav-year]`);if(r instanceof HTMLElement){this._viewY+=Number(r.dataset.navYear),this._renderView();return}let i=t.closest(`[data-nav-decade]`);if(i instanceof HTMLElement){this._viewY+=Number(i.dataset.navDecade)*10,this._renderView();return}let a=t.closest(`[data-view]`);if(a instanceof HTMLElement){this._mode=a.dataset.view,this._renderView();return}let o=t.closest(`[data-month]`);if(o instanceof HTMLButtonElement&&!o.disabled){this._viewNavigated=!0,this._viewM=Number(o.dataset.month),this._mode=`days`,this._focus={y:this._viewY,m:this._viewM,d:1},this._renderView();return}let s=t.closest(`[data-year]`);if(s instanceof HTMLButtonElement&&!s.disabled){this._viewNavigated=!0,this._viewY=Number(s.dataset.year),this._mode=`months`,this._renderView();return}if(t.closest(`[data-today]`)){let e=new Date;if(this._limits().dayDisabled(e.getFullYear(),e.getMonth(),e.getDate()))return;this.value=fr(e.getFullYear(),e.getMonth(),e.getDate()),this.dispatchEvent(new Event(`change`,{bubbles:!0})),this._close();return}if(t.closest(`[data-clear]`)){this.value=``,this.dispatchEvent(new Event(`change`,{bubbles:!0})),this._close();return}let c=t.closest(`.datepicker-day[data-iso]`);c instanceof HTMLButtonElement&&!c.disabled&&(this.value=c.dataset.iso,this.dispatchEvent(new Event(`change`,{bubbles:!0})),this._close())}),this._onKeyBound=e=>{r()&&this._onKey(e)},t.addEventListener(`keydown`,this._onKeyBound),this._syncFormValue()}},Ci=class extends s{_pointerMoveListener;_pointerLeaveListener;_frame;_pointerX;static get observedAttributes(){return[`static`,`max-scale`,`radius`]}constructor(){super(),this._pointerMoveListener=null,this._pointerLeaveListener=null,this._frame=0,this._pointerX=0}connectedCallback(){this._wire()}disconnectedCallback(){this._teardown()}attributeChangedCallback(e,t,n){e===`static`&&this.isConnected&&this._wire()}_maxScale(){return Ti(this.getAttribute(`max-scale`),1.6)}_radius(){return Ti(this.getAttribute(`radius`),100)}_magnifyEnabled(){return!(this.hasAttribute(`static`)||typeof matchMedia==`function`&&(matchMedia(`(pointer: coarse)`).matches||matchMedia(`(prefers-reduced-motion: reduce)`).matches))}_applyMagnification(){this._frame=0;let e=this._maxScale(),t=this._radius();for(let n of this.querySelectorAll(`.dock-item`)){let r=wi(n),i=r.getBoundingClientRect(),a=Math.abs(this._pointerX-(i.left+i.width/2)),o=Math.max(0,1-a/t),s=1+(e-1)*o;r.style.setProperty(`--wui-dock-mag`,s.toFixed(3))}}_resetMagnification(){this._frame&&=(cancelAnimationFrame(this._frame),0);for(let e of this.querySelectorAll(`.dock-item`))wi(e).style.removeProperty(`--wui-dock-mag`)}_wire(){this._teardown(),this._magnifyEnabled()&&(this._pointerMoveListener=e=>{this._pointerX=e.clientX,this._frame||=requestAnimationFrame(()=>this._applyMagnification())},this._pointerLeaveListener=()=>this._resetMagnification(),this.addEventListener(`pointermove`,this._pointerMoveListener),this.addEventListener(`pointerleave`,this._pointerLeaveListener))}_teardown(){this._pointerMoveListener&&=(this.removeEventListener(`pointermove`,this._pointerMoveListener),null),this._pointerLeaveListener&&=(this.removeEventListener(`pointerleave`,this._pointerLeaveListener),null),this._resetMagnification()}},wi=e=>ke(e,HTMLElement,`wui-dock item must be an HTML element`),Ti=(e,t)=>{let n=Number.parseFloat(e??``);return Number.isFinite(n)?n:t},Ei=300,Di=150,Oi=`.wui-hover-card-trigger`,ki=`.wui-hover-card-panel`,Ai=`a[href],button,input,select,textarea,[tabindex]`,ji=0;function Mi(e,t){let n=e.querySelector(t);return n instanceof HTMLElement?n:null}var Ni=class extends s{_doc;_timer;_described;_refocusing;_onOver;_onOut;_onFocusIn;_onFocusOut;_onKeyDown;static get observedAttributes(){return[`open`]}constructor(){super(),this._doc=null,this._timer=null,this._described=null,this._refocusing=!1,this._onOver=e=>{if(e.pointerType===`touch`||e.pointerType===`pen`)return;let t=this._zone(e.target);t===`panel`?this._clear():t===`trigger`&&this._schedule(!0)},this._onOut=e=>{e.pointerType!==`touch`&&e.pointerType!==`pen`&&this._zone(e.target)&&!this._zone(e.relatedTarget)&&this._schedule(!1)},this._onFocusIn=e=>{this._refocusing||(this._zone(e.target)===`trigger`?this._schedule(!0):this._zone(e.target)===`panel`&&this._clear())},this._onFocusOut=e=>{this._zone(e.target)&&!this._zone(e.relatedTarget)&&this._schedule(!1)},this._onKeyDown=e=>{if(e.key!==`Escape`||!this.isOpen||this.hasAttribute(`open`))return;e.preventDefault();let t=this._zone(this.ownerDocument.activeElement)===`panel`;this._clear(),this._setOpen(!1),t&&(this._refocusing=!0,this._anchor?.focus(),this._refocusing=!1)}}get isOpen(){let e=this._panel;return e!==null&&M(e)}connectedCallback(){this._doc=this.ownerDocument,this.addEventListener(`pointerover`,this._onOver),this.addEventListener(`pointerout`,this._onOut),this.addEventListener(`focusin`,this._onFocusIn),this.addEventListener(`focusout`,this._onFocusOut),this._syncOpen()}attributeChangedCallback(){this.isConnected&&this._syncOpen()}disconnectedCallback(){this._clear();let e=this._panel;e&&j(e),this.removeEventListener(`pointerover`,this._onOver),this.removeEventListener(`pointerout`,this._onOut),this.removeEventListener(`focusin`,this._onFocusIn),this.removeEventListener(`focusout`,this._onFocusOut),this._doc=null}get _trigger(){return Mi(this,Oi)}get _panel(){return Mi(this,ki)}get _anchor(){let e=this._trigger;return e?Mi(e,Ai)??e:null}_zone(e){if(!(e instanceof Node)||!this.contains(e))return null;let t=e instanceof Element?e:e.parentElement;return this._panel?.contains(t)?`panel`:this._trigger?.contains(t)?`trigger`:null}_delay(e,t){let n=Number(this.getAttribute(e));return this.hasAttribute(e)&&Number.isFinite(n)&&n>=0?n:t}_clear(){this._timer!==null&&clearTimeout(this._timer),this._timer=null}_syncOpen(){this._clear(),this._setOpen(this.hasAttribute(`open`))}_schedule(e){if(!e&&this.hasAttribute(`open`)||(this._clear(),this.isOpen===e))return;let t=e?this._delay(`open-delay`,Ei):this._delay(`close-delay`,Di);this._timer=setTimeout(()=>{this._timer=null,this._setOpen(e)},t)}_setOpen(e){let t=this._panel;if(!t||this.isOpen===e)return;if(!e){j(t);return}let n=this._trigger;if(!n)throw Error(`wui-hover-card: panel without a trigger`);A(n,t,{mode:`manual`,clampHeight:!0,keepOffscreen:this.hasAttribute(`open`),onClosed:()=>this._closed()}),this._doc?.addEventListener(`keydown`,this._onKeyDown,!0),this._describe(t),this.dispatchEvent(new CustomEvent(`wui:hover-card:open`,{bubbles:!0}))}_closed(){this._doc?.removeEventListener(`keydown`,this._onKeyDown,!0),this._described?.removeAttribute(`aria-describedby`),this._described=null,this.dispatchEvent(new CustomEvent(`wui:hover-card:close`,{bubbles:!0}))}_describe(e){let t=this._anchor;t&&(e.id||=`wui-hover-card-${++ji}`,t.setAttribute(`aria-describedby`,e.id),this._described=t)}},Pi=`.wui-nav-menu-link`,Fi=`(max-width: 767.98px)`,Ii=`data-open`,Li=e=>e instanceof Element?e:e instanceof Node?e.parentElement:null,Ri=e=>[...e].filter(e=>e instanceof HTMLElement),zi=e=>{let t=e.children[0];if(!(t instanceof HTMLElement))throw Error(`Navigation entry has no control.`);return t},Bi=e=>{let t=e.children[1];return t instanceof HTMLElement?t:null},Vi=(e,t,n)=>{let r=e[t];if(r===void 0)throw Error(n);return r},Hi=class extends s{constructor(){super(),this._onClick=e=>this._handleClick(e),this._onKeyDown=e=>this._handleKeyDown(e),this._onFocusOut=e=>{let t=this._openItem(),n=e.relatedTarget;t&&n instanceof Node&&!t.contains(n)&&this._set(t,!1)},this._onPointerDown=()=>{this._pressedOpen=this._openItem()},this._onModeChange=()=>{let e=this._openItem();e&&this._set(e,!1)},this._onOutsidePress=e=>{let t=this._openItem();t&&!e.composedPath().includes(t)&&this._set(t,!1)},this._pressedOpen=null,this._media=null}connectedCallback(){this._teardown(),this.addEventListener(`click`,this._onClick),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusout`,this._onFocusOut),this.addEventListener(`pointerdown`,this._onPointerDown,!0),this._media=window.matchMedia(Fi),this._media.addEventListener(`change`,this._onModeChange)}disconnectedCallback(){this._teardown()}open(e){let t=this._items().find(t=>{let n=t.children[0];return n instanceof HTMLElement&&this._isTrigger(n)&&n.dataset.key===e});t&&this._set(t,!0)}close(e=!1){let t=this._openItem();t&&(this._set(t,!1),e&&zi(t).focus({preventScroll:!0}))}_items(){return Ri(this.querySelectorAll(`.wui-nav-menu-item`))}_openItem(){return this._items().find(e=>{let t=Bi(e);return t!==null&&this._isOpen(t)})??null}_isOpen(e){return e.hasAttribute(Ii)||M(e)}_isTrigger(e){return!!e?.classList.contains(`wui-nav-menu-trigger`)}_entries(){return this._items().map(zi)}_links(e){let t=Bi(e);return t?Ri(t.querySelectorAll(Pi)):[]}_set(e,t){let n=Bi(e);if(!n)return;let r=zi(e);if(t){let t=this._openItem();if(t&&t!==e&&this._set(t,!1),this._isOpen(n))return;r.setAttribute(`aria-expanded`,`true`),window.matchMedia(Fi).matches?(n.setAttribute(Ii,``),document.addEventListener(`pointerdown`,this._onOutsidePress,!0)):A(r,n,{mode:`auto`,below:!0,flipAlign:!0,onClosed:()=>this._settle(e)}),this._emit(r,!0)}else n.removeAttribute(Ii),document.removeEventListener(`pointerdown`,this._onOutsidePress,!0),M(n)&&j(n),this._settle(e)}_settle(e){let t=zi(e);t.getAttribute(`aria-expanded`)!==`false`&&(t.setAttribute(`aria-expanded`,`false`),this._emit(t,!1))}_emit(e,t){this.dispatchEvent(new CustomEvent(`wui-navigation-menu:toggle`,{bubbles:!0,detail:{key:e.dataset.key??null,open:t}}))}_handleClick(e){let t=this._pressedOpen;this._pressedOpen=null;let n=Li(e.target),r=n?.closest(`.wui-nav-menu-trigger`);if(r&&this.contains(r)){let e=N(r.parentElement,`Navigation trigger has no entry.`),n=N(Bi(e),`Navigation entry has no panel.`),i=t===e||this._isOpen(n);this._set(e,!i);return}let i=n?.closest(Pi);i&&this.contains(i)&&this.close()}_handleKeyDown(e){if(this._pressedOpen=null,e.altKey||e.ctrlKey||e.metaKey)return;let t=Li(e.target)?.closest(`.wui-nav-menu-trigger, .wui-nav-menu-toplink, .wui-nav-menu-link`);if(!(t instanceof HTMLElement)||!this.contains(t))return;let n=this._openItem();if(e.key===`Escape`){if(!n||!Bi(n)?.hasAttribute(Ii))return;e.preventDefault(),e.stopPropagation();let r=n.contains(t);this._set(n,!1),r&&zi(n).focus({preventScroll:!0});return}if(t.matches(Pi)){this._linkKey(e,t);return}let r=this._entries(),i=r.indexOf(t);if(e.key===`ArrowRight`||e.key===`ArrowLeft`||e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?0:e.key===`End`?r.length-1:(i+(e.key===`ArrowRight`?1:-1)+r.length)%r.length;n&&this._set(n,!1),Vi(r,t,`Navigation has no entry to focus.`).focus({preventScroll:!0})}else if(e.key===`ArrowDown`&&this._isTrigger(t)){e.preventDefault();let n=N(t.parentElement,`Navigation trigger has no entry.`);this._set(n,!0),Vi(this._links(n),0,`Navigation panel has no link to focus.`).focus({preventScroll:!0})}}_linkKey(e,t){let n=N(t.closest(`.wui-nav-menu-item`),`Navigation link has no entry.`),r=this._links(n),i=r.indexOf(t);e.key===`ArrowDown`||e.key===`ArrowUp`?(e.preventDefault(),Vi(r,(i+(e.key===`ArrowDown`?1:-1)+r.length)%r.length,`Navigation panel has no link to focus.`).focus({preventScroll:!0})):e.key===`Home`?(e.preventDefault(),Vi(r,0,`Navigation panel has no link to focus.`).focus({preventScroll:!0})):e.key===`End`&&(e.preventDefault(),Vi(r,r.length-1,`Navigation panel has no link to focus.`).focus({preventScroll:!0}))}_teardown(){for(let e of this._items()){let t=Bi(e);if(!t)continue;let n=t.hasAttribute(Ii);t.removeAttribute(Ii),j(t),n&&this._settle(e)}this._media?.removeEventListener(`change`,this._onModeChange),this._media=null,document.removeEventListener(`pointerdown`,this._onOutsidePress,!0),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`focusout`,this._onFocusOut),this.removeEventListener(`pointerdown`,this._onPointerDown,!0)}},Ui=n({NOTIFICATION_COUNT_CAP:()=>99,NOTIFICATION_TEXT:()=>Ki,groupNotificationsByDay:()=>Qi,notificationCountText:()=>qi,notificationDayHeading:()=>Zi,notificationTime:()=>Xi,notificationTriggerLabel:()=>Ji,notificationUnreadAnnouncement:()=>Yi}),Wi=99,Gi=864e5,Ki=Object.freeze({label:`Notifications`,empty:`You are all caught up.`,markAll:`Mark all read`,viewAll:`View all`,unreadPrefix:`Unread: `,today:`Today`,yesterday:`Yesterday`,allRead:`All notifications marked as read.`,noneUnread:`No unread notifications`,failed:Object.freeze({forbidden:`You do not have permission to mark these as read.`,client:`These could not be marked as read. Refresh the page and try again.`,validation:`These could not be marked as read. Refresh the page and try again.`,server:`Something went wrong on our side, so these were not marked as read. Try again in a moment.`,network:`Could not reach the server, so these were not marked as read. Check your connection and try again.`})});function qi(e){return e>99?`99+`:String(e)}function Ji(e,t){return t===0?e:`${e}, ${qi(t)} unread`}function Yi(e){return e===0?Ki.noneUnread:`${qi(e)} unread notifications`}function Xi(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?``:I(e,{pattern:`time`})}function Zi(e,t=Date.now()){let n=I(e);return n===I(t)?Ki.today:n===I(an(t)-Gi)?Ki.yesterday:n}function Qi(e,t=Date.now()){let n=new Map;for(let r of e){if(!Number.isFinite(an(r.at)))throw Error(`<AppNotificationCenter> item "${r.id}": at must be an ISO date-time with its zone (or a YYYY-MM-DD day), got ${String(r.at)}.`);let e=I(r.at),i=n.get(e);i||(i={key:e,heading:Zi(r.at,t),items:[]},n.set(e,i)),i.items.push(r)}return[...n.values()]}var $i=Object.freeze([`POST`,`PUT`,`PATCH`,`DELETE`]),ea=e=>(Or(`[@webority/ui-elements] Wui-Toast-Action: ${e}; the toast shows no action.`),null),ta=e=>typeof e==`object`&&!!e;function na(e){if(e==null||e===``)return null;let t;try{t=JSON.parse(e)}catch{return ea(`the value is not JSON`)}let n=ta(t)?t:{},r=n.label,i=n.url,a=String(n.method??`POST`).toUpperCase();return typeof r!=`string`||r===``||typeof i!=`string`||i===``?ea(`label and url must be non-empty strings`):$i.includes(a)?{label:r,url:i,method:a}:ea(`method must be one of ${$i.join(`, `)}`)}var ra=n({CSRF_META_NAME:()=>ia,DEFAULT_CSRF_HEADER:()=>aa,HTTP_KINDS:()=>la,WUI_HEADERS:()=>G,WUI_REQUEST_HEADER:()=>ca,classifyStatus:()=>pa,configureCsrf:()=>sa,createRequestQueue:()=>_a,readCsrf:()=>da,wuiFetch:()=>ga}),ia=`wui-csrf`,aa=`RequestVerificationToken`,oa={metaName:ia,header:aa};function sa({metaName:e=ia,header:t=aa}={}){oa={metaName:e,header:t}}var ca=`Wui-Request`,G=Object.freeze({fragment:`Wui-Fragment`,message:`Wui-Message`,redirect:`Wui-Redirect`,result:`Wui-Result`,keepOpen:`Wui-Keep-Open`,toastVariant:`Wui-Toast-Variant`,toastAction:`Wui-Toast-Action`,data:`Wui-Data`,next:`Wui-Next`}),la=Object.freeze([`ok`,`validation`,`forbidden`,`client`,`server`,`network`,`aborted`,`stale`,`session`]),ua=new Set([`GET`,`HEAD`]);function da(e=document){let t=[...e.querySelectorAll(`meta`)].find(e=>e.getAttribute(`name`)===oa.metaName),n=t?.getAttribute(`content`);return!t||!n?null:{header:t.getAttribute(`data-header`)||oa.header,token:n}}var fa=e=>{try{return new URL(e,window.location.href).origin===window.location.origin}catch{return!1}};function pa(e){return e>=200&&e<300?`ok`:e===401?`session`:e===403?`forbidden`:e===422?`validation`:e>=400&&e<500?`client`:`server`}var ma=e=>typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`,ha=e=>{if(e==null||e===``)return null;try{return JSON.parse(e)}catch(e){throw TypeError(`The ${G.data} response header is not JSON: ${e instanceof Error?e.message:String(e)}`,{cause:e})}};async function ga(e,t={}){let n=(t.method||`GET`).toUpperCase(),r=t.navigate||(e=>window.location.assign(e)),i={Accept:`text/html`,"X-Requested-With":`XMLHttpRequest`,[ca]:`1`,...t.headers};if(!ua.has(n)&&fa(e)){let e=da();e&&(i[e.header]=e.token)}let a=e=>{if(e==null)return null;try{return decodeURIComponent(e)}catch{return e}},o=(e,t=null,n=``)=>{let r=e=>t?.headers.get(e)??null;return{kind:e,ok:e===`ok`,status:t?.status??0,html:n,response:t,message:a(r(G.message)),redirect:r(G.redirect),result:r(G.result),keepOpen:r(G.keepOpen)===`1`,toastVariant:r(G.toastVariant),toastAction:na(r(G.toastAction)),fragment:r(G.fragment)===`1`,data:ha(a(r(G.data))),next:r(G.next)}},s;try{s=await fetch(e,{method:n,...t.body===void 0?{}:{body:t.body},headers:i,...t.signal===void 0?{}:{signal:t.signal},credentials:`same-origin`})}catch(e){return o(ma(e)||t.signal?.aborted?`aborted`:`network`)}let c=pa(s.status);if(c===`ok`&&s.redirected&&s.headers.get(G.fragment)!==`1`&&(c=`session`),c===`session`)return r(s.status===401?s.headers.get(`Location`)||window.location.href:s.url),o(c,s);let l=``;if(c===`ok`||c===`validation`)try{l=await s.text()}catch(e){return o(ma(e)||t.signal?.aborted?`aborted`:`network`,s)}return o(c,s,l)}function _a(){let e=null,t=0;return{async run(n,r={}){e?.abort();let i=new AbortController;e=i;let a=++t,o=r.signal;o&&(o.aborted?i.abort():o.addEventListener(`abort`,()=>i.abort(),{once:!0}));let s;try{s=await ga(n,{...r,signal:i.signal})}finally{e===i&&(e=null)}return a!==t&&s.kind!==`aborted`?{...s,kind:`stale`,ok:!1}:s},abort(){e?.abort(),e=null}}}var va=`.wui-notification-center-trigger`,ya=`.wui-notification-center-panel`,ba=`.wui-notification-center-count`,xa=`.wui-notification-center-live`,Sa=`.wui-notification-center-markall`,Ca=`.wui-notification-center-item`,wa=`wui-notification-center-item-read`,Ta=`.wui-notification-center-unread-label`,Ea=`.app-tabs`,Da=`.wui-notification-center-tabs [role='tablist']`,Oa=`.wui-notification-center-tabs [role='tab']`,ka=`.wui-notification-center-empty`,Aa=`(max-width: 767.98px)`,ja={ArrowDown:1,ArrowUp:-1,Home:`first`,End:`last`},Ma=e=>!!e,Na=e=>Object.hasOwn(Ki.failed,e),K=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},Pa=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),Fa=class extends s{constructor(){super(),this._unread=0,this._busy=!1,this._sheet=!1,this._awaitChildren=null,this._onClick=e=>this._click(e),this._onKeyDown=e=>this._key(e),this._onToggle=e=>{e.type===`toggle`&&`newState`in e&&e.newState===`closed`&&this._closedByBrowser()},this._onFocusOut=e=>{let t=e.relatedTarget;t instanceof Node&&!this.contains(t)&&this.close()}}static get observedAttributes(){return[`open`]}connectedCallback(){this._unread=this._initialUnread(),this.addEventListener(`click`,this._onClick),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusout`,this._onFocusOut),this.addEventListener(`toggle`,this._onToggle,!0),this.isOpen&&(K(this,ya)===null||K(this,va)===null)?(this._awaitChildren=new MutationObserver(()=>this._finishAwaitedOpen()),this._awaitChildren.observe(this,{childList:!0})):(this._syncOpen(),this.isOpen&&this._showPanel())}disconnectedCallback(){this._disarmAwait(),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`focusout`,this._onFocusOut),this.removeEventListener(`toggle`,this._onToggle,!0);let e=K(this,ya);e&&j(e)}attributeChangedCallback(e,t,n){e===`open`&&t!==n&&(this._awaitChildren?n===null&&this._disarmAwait():this.isConnected&&(n===null?this._hidePanel():this._showPanel()))}_finishAwaitedOpen(){K(this,ya)!==null&&K(this,va)!==null&&(this._disarmAwait(),this._syncOpen(),this._showPanel())}_disarmAwait(){this._awaitChildren?.disconnect(),this._awaitChildren=null}_showPanel(){let e=N(K(this,ya),`<wui-notification-center> needs its panel to open.`),t=N(K(this,va),`<wui-notification-center> needs its trigger to open.`);M(e)||(this._sheet=window.matchMedia(Aa).matches,this._sheet?Ce(e,!0):A(t,e,{mode:`auto`,onClosed:()=>this._closedByBrowser()}),M(e)&&this._layoutTabs())}_hidePanel(){let e=K(this,ya);e&&M(e)&&(this._sheet?Ce(e,!1):j(e))}_closedByBrowser(){if(!this.isConnected||!this.hasAttribute(`open`))return;let e=K(this,ya);this.close({restoreFocus:e?.contains(this.ownerDocument.activeElement)??!1})}get isOpen(){return this.hasAttribute(`open`)}open(){this.isOpen||(N(K(this,ya),`<wui-notification-center> needs its panel to open.`),N(K(this,va),`<wui-notification-center> needs its trigger to open.`),this.setAttribute(`open`,``),this._syncOpen(),K(this,ya)?.focus(),this._announceToggle())}close({restoreFocus:e=!1}={}){this.isOpen&&(this.removeAttribute(`open`),this._syncOpen(),e&&K(this,va)?.focus(),this._announceToggle())}toggle(){this.isOpen?this.close():this.open()}_announceToggle(){this.dispatchEvent(new CustomEvent(`wui:notification-center:toggle`,{bubbles:!0,detail:{open:this.isOpen}}))}_syncOpen(){this.querySelector(va)?.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`)}_initialUnread(){let e=Number.parseInt(this.getAttribute(`unread`)??``,10);return Number.isInteger(e)&&e>=0?e:this.querySelectorAll(`${Ca}:not(.${wa}):not([data-archived="true"])`).length}_click(e){let t=e.target;if(!(t instanceof Element))return;let n=t.closest(Oa);if(n instanceof HTMLElement&&this.contains(n)){if(this.hasAttribute(`controlled`))return;this._pickTab(n);return}let r=t.closest(`${va}, ${Sa}, ${Ca}`);r instanceof HTMLElement&&this.contains(r)&&(r.matches(va)?this.toggle():this.hasAttribute(`controlled`)||(r.matches(Sa)?this._markAll():this._markItem(r)))}_key(e){if(!this.isOpen)return;let t=e.target;if(!(t instanceof Element))throw Error(`Keyboard event target is not an element.`);if(!this.querySelector(ya)?.contains(t)||t.closest(Ea))return;let n=ja[e.key];if(n===void 0)return;let r=Pa(this,Ca).filter(e=>!e.closest(`[hidden]`));if(r.length===0)return;let i=t.closest(Ca),a=i instanceof HTMLElement?r.indexOf(i):-1,o;o=n===`first`?0:n===`last`?r.length-1:a===-1?n===1?0:r.length-1:Math.min(r.length-1,Math.max(0,a+n)),e.preventDefault(),r[o]?.focus()}_markItem(e){e.classList.contains(wa)||(this._applyRead(e),e.dataset.archived!==`true`&&(this._unread=Math.max(0,this._unread-1)),this._render(),this._say(Yi(this._unread)),this._emitRead([e.dataset.id].filter(Ma),!1))}async _markAll(){if(this._busy)return;let e=Pa(this,`${Ca}:not(.${wa})`);if(e.length===0&&this._unread===0)return;let t=e.map(e=>e.dataset.id).filter(Ma),n=this.getAttribute(`read-action`);if(n){this._setBusy(!0);let e=new URLSearchParams;for(let n of t)e.append(`ids`,n);let r=await ga(n,{method:`POST`,body:e});if(this._setBusy(!1),!r.ok){if(r.kind===`session`||r.kind===`aborted`)return;let e=r.kind,t=r.message||(Na(e)?Ki.failed[e]:Ki.failed.server);this._say(t),this.dispatchEvent(new CustomEvent(`wui:notification-center:failed`,{bubbles:!0,detail:{kind:e,message:t}}));return}}for(let t of e)this._applyRead(t);this._unread=0,this._render(),this._say(Ki.allRead),this._emitRead(t,!0)}_pickTab(e){let t=e.closest(Da);if(t instanceof HTMLElement){for(let n of Pa(t,Oa)){let t=n===e;n.classList.toggle(`active`,t),n.setAttribute(`aria-selected`,t?`true`:`false`),n.setAttribute(`tabindex`,t?`0`:`-1`)}this._layoutTabs(),this._filterItems(e.dataset.key)}}_layoutTabs(){for(let e of Pa(this,Da)){let t=K(e,`.app-tab.active`);t&&(e.style.setProperty(`--wui-tab-x`,`${t.offsetLeft}px`),e.style.setProperty(`--wui-tab-w`,`${t.offsetWidth}px`)),e.setAttribute(`data-wui-tabs`,``)}}_filterItems(e){let t=!1;for(let n of Pa(this,Ca)){let r=n.dataset.archived===`true`,i=n.classList.contains(wa),a=e===`archived`?r:!r&&(e!==`unread`||!i);a&&(t=!0);let o=n.closest(`li`);o&&(o.hidden=!a)}for(let e of Pa(this,`.wui-notification-center-list section`))e.hidden=[...e.querySelectorAll(`li`)].every(e=>e.hidden);let n=K(this,ka);n&&(n.hidden=t)}_applyRead(e){e.classList.add(wa),e.querySelector(Ta)?.remove()}_setBusy(e){this._busy=e;let t=this.querySelector(Sa);t instanceof HTMLButtonElement&&(t.disabled=e||this._unread===0,e?t.setAttribute(`aria-busy`,`true`):t.removeAttribute(`aria-busy`))}_render(){let e=K(this,ba);e&&(e.textContent=qi(this._unread),e.hidden=this._unread===0),this.querySelector(va)?.setAttribute(`aria-label`,Ji(this.getAttribute(`label`)||Ki.label,this._unread));let t=this.querySelector(Sa);t instanceof HTMLButtonElement&&(t.disabled=this._unread===0)}_say(e){let t=this.querySelector(xa);t&&(t.textContent=e)}_emitRead(e,t){this.dispatchEvent(new CustomEvent(`wui:notification-center:read`,{bubbles:!0,detail:{ids:e,all:t}}))}},Ia=`.wui-onboarding-card`,La=`.wui-onboarding-steps`,Ra=`.wui-onboarding-toggle`,za=`.wui-onboarding-dismiss`,Ba=`.wui-onboarding-restore`,Va=`wui-onboarding:`,Ha=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},Ua=class extends s{constructor(){super(),this._onClick=e=>{let t=e.target instanceof Element?e.target:null;t&&(t.closest(za)?this.dismiss():t.closest(Ba)?this.restore():t.closest(Ra)&&this.toggle())}}connectedCallback(){this.addEventListener(`click`,this._onClick),this._stored()===`dismissed`&&this._setDismissed(!0)}disconnectedCallback(){this.removeEventListener(`click`,this._onClick)}get dismissed(){return Ha(this,Ia)?.hidden===!0}get collapsed(){return Ha(this,La)?.hidden===!0}dismiss(){this.dismissed||(this._setDismissed(!0),this._store(`dismissed`),Ha(this,Ba)?.focus(),this.dispatchEvent(new CustomEvent(`wui:onboarding:dismiss`,{bubbles:!0})))}restore(){this.dismissed&&(this._setDismissed(!1),this._store(null),Ha(this,Ra)?.focus(),this.dispatchEvent(new CustomEvent(`wui:onboarding:restore`,{bubbles:!0})))}toggle(){let e=Ha(this,La);if(!e)return;let t=!e.hidden;e.hidden=t,this.querySelector(Ra)?.setAttribute(`aria-expanded`,String(!t)),this.dispatchEvent(new CustomEvent(`wui:onboarding:collapse`,{bubbles:!0,detail:{collapsed:t}}))}_setDismissed(e){let t=Ha(this,Ia),n=Ha(this,Ba);t&&(t.hidden=e),n&&(n.hidden=!e)}_key(){let e=this.getAttribute(`storage-key`);return e?Va+e:null}_stored(){let e=this._key();if(!e)return null;try{return window.localStorage.getItem(e)}catch{return null}}_store(e){let t=this._key();if(t)try{e?window.localStorage.setItem(t,e):window.localStorage.removeItem(t)}catch(e){if(!(e instanceof DOMException))throw e}}},Wa=/[^0-9]/g,Ga=/[^0-9a-zA-Z]/g,Ka=class extends s{static formAssociated=!0;static get observedAttributes(){return[`value`,`length`,`mode`,`disabled`,`readonly`,`loading`,`size`,`aria-label`]}get length(){let e=Number.parseInt(this.getAttribute(`length`)??`6`,10);return Number.isFinite(e)&&e>0?e:6}set length(e){this.setAttribute(`length`,String(e))}get mode(){return this.getAttribute(`mode`)===`alphanumeric`?`alphanumeric`:`numeric`}set mode(e){this.setAttribute(`mode`,String(e??`numeric`))}get value(){return this._value??``}set value(e){this._value=this._clean(e),V(this,this._value),this._paint()}_clean(e){return(e==null?``:String(e)).replace(this.mode===`alphanumeric`?Ga:Wa,``).slice(0,this.length)}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}}connectedCallback(){this._rendered?this._onSelectionChange&&document.addEventListener(`selectionchange`,this._onSelectionChange):(this._defaultCaptured||=(this._defaultValue=this._value,!0),this.render())}formResetCallback(){this._value=this._defaultValue||``,V(this,this._value),this._paint()}attributeChangedCallback(e,t,n){this._rendered&&(e===`value`?(this._value=this._clean(n),V(this,this._value),this._paint()):this.render())}render(){this._value=this._clean(this.getAttribute(`value`)??this._value);let e=this.length,t=this.mode===`numeric`,n=this.hasAttribute(`disabled`),r=yr(this)||this.hasAttribute(`loading`),i=this.getAttribute(`size`),a=i===`sm`||i===`lg`?` otp-${i}`:``,o=Array.from({length:e},()=>`<span class="otp-slot" aria-hidden="true"></span>`).join(``),s=this.getAttribute(`aria-label`),c=s?` aria-label="${s.replace(/"/g,`&quot;`)}"`:``;this.innerHTML=`
32
32
  <div class="otp${a}">
33
33
  <input
34
34
  class="otp-field"
@@ -41,12 +41,12 @@ var WeborityUiElements=(function(e){Object.defineProperty(e,Symbol.toStringTag,{
41
41
  spellcheck="false"
42
42
  ${n?`disabled`:``}${r?` readonly`:``} />
43
43
  <div class="otp-slots" aria-hidden="true">${o}</div>
44
- </div>`,this._rendered=!0,L(this,this._value),jn(this,this.querySelector(`.otp`)),this._wire(),this._paint()}_refs(){let e=this.querySelector(`.otp-field`);return{input:e instanceof HTMLInputElement?e:null,slots:[...this.querySelectorAll(`.otp-slot`)].filter(e=>e instanceof HTMLElement)}}_paint(){let{input:e,slots:t}=this._refs();if(!e||!t.length)return;e.value!==this._value&&(e.value=this._value);let n=e.selectionStart??this._value.length,r=Math.min(n,t.length-1),i=document.activeElement===e;t.forEach((e,t)=>{e.textContent=this._value[t]??``,e.classList.toggle(`filled`,!!this._value[t]),e.classList.toggle(`active`,i&&t===r)})}_wire(){let{input:e}=this._refs();if(!e)return;let t=e=>{let t=this._clean(e),n=t!==this._value;this._value=t,L(this,this._value),this._paint(),n&&this.dispatchEvent(new Event(`change`,{bubbles:!0})),n&&t.length===this.length&&this.dispatchEvent(new CustomEvent(`complete`,{bubbles:!0,detail:t}))};e.addEventListener(`input`,()=>{let n=e.value;if(this._value.length===this.length&&n.length>this._value.length&&n.startsWith(this._value)){let e=this._clean(n.slice(this._value.length));if(e){t(e);return}}t(n)}),e.addEventListener(`paste`,e=>{if(I(this))return;let n=e.clipboardData?.getData(`text`);n!=null&&(e.preventDefault(),t(n))});for(let t of[`keyup`,`click`,`blur`,`select`])e.addEventListener(t,()=>this._paint());e.addEventListener(`focus`,()=>{this._value.length===this.length&&e.select(),this._paint()}),this._onSelectionChange&&document.removeEventListener(`selectionchange`,this._onSelectionChange),this._onSelectionChange=()=>{document.activeElement===e&&this._paint()},document.addEventListener(`selectionchange`,this._onSelectionChange)}disconnectedCallback(){this._onSelectionChange&&document.removeEventListener(`selectionchange`,this._onSelectionChange)}},ta=`data-wui-overflow-hidden`,na=`[aria-selected="true"], .active`,ra=`.chip-body, input, a[href], button:not(.chip-remove)`,ia=1,aa=0,oa=e=>Number.parseFloat(e)||0,sa=e=>e.nodeType===1,ca=e=>{let t=e.getAttribute(`data-overflow-label`);if(t)return t;let n=[],r=e=>{for(let t of e.childNodes)if(t.nodeType===3){let e=t.textContent?.trim();e&&n.push(e)}else sa(t)&&!t.matches(`svg, img, [aria-hidden='true']`)&&r(t)};return r(e),n.join(` `)},la=e=>{if(e.matches(`button, a[href], label, input`))return e;let t=e.querySelector(ra);return t instanceof HTMLElement?t:null},ua=class extends g{constructor(){super(),this._hiddenKey=``,this._ro=null,this._mo=null,this._observedList=null,this._doc=null,this._onDocDown=e=>{!this._menu.hidden&&!e.composedPath().includes(this)&&this._close(!1)}}connectedCallback(){this.classList.add(`wui-overflow`),this._build(),this._doc=this.ownerDocument,this._doc.addEventListener(`pointerdown`,this._onDocDown,!0),typeof ResizeObserver<`u`&&(this._ro=new ResizeObserver(()=>this.layout()),this._ro.observe(this)),typeof MutationObserver<`u`&&(this._mo=new MutationObserver(()=>this.layout()),this._watch()),this.layout()}disconnectedCallback(){this._ro?.disconnect(),this._mo?.disconnect(),this._ro=null,this._mo=null,this._observedList=null,this._doc?.removeEventListener(`pointerdown`,this._onDocDown,!0),this._doc=null,p(this)}static get observedAttributes(){return[`label`]}attributeChangedCallback(){let e=this._more?.firstChild;e&&(e.textContent=this._label())}_label(){return this.getAttribute(`label`)||`More`}_list(){let e=this.querySelector(`[data-wui-overflow-list]`);return e instanceof HTMLElement?e:null}_items(e){return[...e.children].filter(e=>!e.hasAttribute(`data-wui-overflow-skip`))}_build(){if(this._more)return;let e=`wui-overflow-menu-${++aa}`,t=this.ownerDocument.createElement(`button`);t.type=`button`,t.className=`wui-overflow-more`,t.hidden=!0,t.setAttribute(`aria-haspopup`,`menu`),t.setAttribute(`aria-expanded`,`false`),t.setAttribute(`aria-controls`,e),t.append(this._label());let n=this.ownerDocument.createElement(`div`);n.className=`wui-overflow-menu`,n.id=e,n.setAttribute(`role`,`menu`),n.hidden=!0,this.append(t,n),this._more=t,this._menu=n,t.addEventListener(`click`,()=>this._menu.hidden?this._open(!1):this._close(!0)),t.addEventListener(`keydown`,e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),this._open(!0))}),n.addEventListener(`keydown`,e=>this._onMenuKey(e))}_watch(){let e=this._list();this._mo&&e!==this._observedList&&(this._mo.disconnect(),this._observedList=e,e&&this._mo.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`class`,`aria-selected`,`disabled`,`aria-disabled`,`data-overflow-label`]}))}layout(){let e=this._list();if(this._watch(),!e||!this._more)return;let t=this._items(e);for(let e of t)e.removeAttribute(ta);this._more.hidden=!0;let n=this.clientWidth,r=[];if(t.length&&n<=0&&this.getClientRects().length>0)r=t;else if(n>0&&t.length){let i=getComputedStyle(e),a=oa(i.columnGap),o=oa(i.paddingLeft)+oa(i.paddingRight)+oa(i.borderLeftWidth)+oa(i.borderRightWidth),s=t.map(e=>e.offsetWidth);if(s.reduce((e,t)=>e+t,0)+a*(t.length-1)>n-o+ia){this._more.hidden=!1;let e=n-o-this._more.offsetWidth-oa(getComputedStyle(this).columnGap),i=this.hasAttribute(`keep`)?this.getAttribute(`keep`):na,c=new Set,l=0,u=0,d=i?t.filter(e=>e.matches(i)):[];for(let n of d){let r=l+(s[t.indexOf(n)]??0)+(u?a:0);r>e||(c.add(n),l=r,u+=1)}for(let n=0;n<t.length;n+=1){let r=t[n];if(!r||c.has(r))continue;let i=l+(s[n]??0)+(u?a:0);if(i>e)break;c.add(r),l=i,u+=1}r=t.filter(e=>!c.has(e))}}for(let e of r)e.setAttribute(ta,``);this._more.hidden=r.length===0,r.length?this._menu.hidden||this._fill(r):this._close(!1);let i=r.map(e=>t.indexOf(e)).join(`,`);i!==this._hiddenKey&&(this._hiddenKey=i,this.dispatchEvent(new CustomEvent(`wui-overflow-change`,{bubbles:!0,detail:{hidden:r.length}})))}_hiddenItems(){let e=this._list();return e?this._items(e).filter(e=>e.hasAttribute(ta)):[]}_fill(e){this._menu.replaceChildren();for(let t of e){let e=this.ownerDocument.createElement(`button`);e.type=`button`,e.className=`wui-overflow-item`,e.tabIndex=-1;let n=t.querySelector(`input[type=checkbox], input[type=radio]`);n instanceof HTMLInputElement?(e.setAttribute(`role`,n.type===`radio`?`menuitemradio`:`menuitemcheckbox`),e.setAttribute(`aria-checked`,String(n.checked))):e.setAttribute(`role`,`menuitem`);let r=la(t),i=!r||`disabled`in r&&r.disabled||r.getAttribute(`aria-disabled`)===`true`||t.matches(`.disabled, [aria-disabled='true']`);i&&e.setAttribute(`aria-disabled`,`true`),e.textContent=ca(t),e.addEventListener(`click`,()=>{i||r&&this._choose(t,r)}),this._menu.append(e)}}_choose(e,t){this._close(!1),t.click(),this.layout();let n=!e.hasAttribute(ta)&&e.matches(`button, a[href]`)?e:this._more;n.hidden||n.focus()}_open(e){let t=this._hiddenItems();if(!t.length)return;this._fill(t),this._menu.hidden=!1,this._more.setAttribute(`aria-expanded`,`true`);let n=()=>d(this._more,this._menu);if(n(),f(this,n),e){let e=this._menu.firstElementChild;e instanceof HTMLElement&&e.focus()}}_close(e){this._menu&&!this._menu.hidden&&(this._menu.hidden=!0,this._more.setAttribute(`aria-expanded`,`false`),p(this),e&&this._more.focus())}_onMenuKey(e){let t=[...this._menu.children].filter(e=>e instanceof HTMLElement),n=this.ownerDocument.activeElement,r=n instanceof HTMLElement?t.indexOf(n):-1,i=null;if(e.key===`ArrowDown`)i=t[(r+1)%t.length];else if(e.key===`ArrowUp`)i=t[(r-1+t.length)%t.length];else if(e.key===`Home`)i=t[0];else if(e.key===`End`)i=t[t.length-1];else if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),this._close(!0);return}else if(e.key===`Tab`){this._close(!1);return}else return;e.preventDefault(),i?.focus()}},da=`.wui-rating-star`,fa=`wui-rating-star-preview`,pa=`wui-rating-previewing`,ma=`wui-rating-star-full`,ha=`wui-rating-star-empty`,ga=[ma,`wui-rating-star-half`,ha],_a=e=>[...e.querySelectorAll(da)].filter(e=>e instanceof HTMLElement),va=class extends g{_onChange;_onOver;_onLeave;constructor(){super(),this._onChange=e=>{let t=e.target;t instanceof HTMLInputElement&&t.type===`radio`&&this._fill(Number(t.value))},this._onOver=e=>{if(this.hasAttribute(`disabled`))return;let t=y(e.target,da);t instanceof HTMLElement&&this._preview(Number(t.dataset.value))},this._onLeave=()=>this._preview(0)}connectedCallback(){this.addEventListener(`change`,this._onChange),this.addEventListener(`mouseover`,this._onOver),this.addEventListener(`mouseleave`,this._onLeave)}disconnectedCallback(){this.removeEventListener(`change`,this._onChange),this.removeEventListener(`mouseover`,this._onOver),this.removeEventListener(`mouseleave`,this._onLeave)}_fill(e){for(let t of _a(this))t.classList.remove(...ga),t.classList.add(Number(t.dataset.value)<=e?ma:ha)}_preview(e){this.classList.toggle(pa,e>0);for(let t of _a(this))t.classList.toggle(fa,e>0&&Number(t.dataset.value)<=e)}},ya=class extends g{_doc;_onKeyDown;constructor(){super(),this._doc=null,this._onKeyDown=e=>{this.hasAttribute(`keys`)&&le(e,{j:()=>this._press(`.wui-record-pager-next`),k:()=>this._press(`.wui-record-pager-prev`)},this.closest(`[${x}]`))}}connectedCallback(){this._doc=this.ownerDocument,_(this._doc,`wui-record-pager has no owner document`).addEventListener(`keydown`,this._onKeyDown)}disconnectedCallback(){this._doc?.removeEventListener(`keydown`,this._onKeyDown),this._doc=null}_press(e){let t=this.querySelector(e);!(t instanceof HTMLElement)||t instanceof HTMLButtonElement&&t.disabled||t.getAttribute(`aria-disabled`)===`true`||t.click()}},ba=6e4,xa=60*ba,Sa=24*xa,Ca=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function wa(e,t=Date.now()){let n=_t(e);if(!Number.isFinite(n))return`-`;let r=t-n,i=Math.abs(r);if(i>=7*Sa)return M(n);if(i<ba)return`just now`;let[a,o]=i<xa?[Math.floor(i/ba),`minute`]:i<Sa?[Math.floor(i/xa),`hour`]:[Math.floor(i/Sa),`day`];return r>0?`${Ca(a,o)} ago`:`in ${Ca(a,o)}`}function Ta(e){let t=_t(e);return Number.isFinite(t)?`${M(t,{pattern:`datetime`})} IST`:`-`}var Ea=3e4,Da=new Set,Oa=null,ka=()=>{if(!(typeof document<`u`&&document.hidden))for(let e of Da)e.refresh()},Aa=e=>{Da.add(e),Da.size===1&&(Oa=setInterval(ka,Ea),document.addEventListener(`visibilitychange`,ka))},ja=e=>{Da.delete(e),Da.size===0&&(clearInterval(Oa??void 0),Oa=null,document.removeEventListener(`visibilitychange`,ka))},Ma=class extends g{_observer;constructor(){super(),this._observer=null}connectedCallback(){this.refresh(),Aa(this),this._observer=new MutationObserver(()=>this.refresh()),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`datetime`]})}disconnectedCallback(){ja(this),this._observer?.disconnect(),this._observer=null}refresh(){let e=this.querySelector(`time[datetime]`);if(!(e instanceof HTMLTimeElement))return;let t=wa(e.getAttribute(`datetime`));e.textContent!==t&&(e.textContent=t)}},Na=/^[0-9]$/,Pa=()=>typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,Fa=class extends g{_connected;_signature;_digits;_reels;_roll;_onRollEnd;static get observedAttributes(){return[`value`,`format`,`unit`,`decimals`,`duration`]}constructor(){super(),this._connected=!1,this._signature=null,this._digits=[],this._reels=[],this._roll=null,this._onRollEnd=e=>{e.target instanceof Element&&e.target.classList.contains(`wui-rolling-number-reel`)&&this.removeAttribute(`data-rolling`)}}connectedCallback(){this._connected=!0;let e=this.querySelector(`.wui-rolling-number-roll`);this._roll=e instanceof HTMLElement?e:null,this._roll?.addEventListener(`transitionend`,this._onRollEnd),this._draw(!1)}disconnectedCallback(){this._connected=!1,this._roll?.removeEventListener(`transitionend`,this._onRollEnd)}attributeChangedCallback(){this._connected&&this._draw(!0)}_text(){let e=this.getAttribute(`value`),t=e===null||e.trim()===``?NaN:Number(e);if(!Number.isFinite(t))return null;let n=this.getAttribute(`decimals`);return bt(t,{style:this.getAttribute(`format`)||`number`,unit:this.getAttribute(`unit`)||void 0,decimals:n===null||n===``?void 0:Number(n)})}_showText(e){let t=this.querySelector(`.wui-rolling-number-text`);t instanceof HTMLElement&&t.textContent!==e&&(t.firstChild?t.firstChild.nodeValue=e:t.append(e))}_clear(e){e.replaceChildren(),this.removeAttribute(`data-ready`),this._signature=null,this._digits=[],this._reels=[]}_draw(e){let t=this.querySelector(`.wui-rolling-number-roll`);if(!(t instanceof HTMLElement))return;let n=this._text();if(n===null||(this._showText(n),Pa())){this._clear(t);return}this.toggleAttribute(`data-rolling`,e);let r=Number(this.getAttribute(`duration`));this.getAttribute(`duration`)&&Number.isFinite(r)&&r>=0?this.style.setProperty(`--wui-roll-duration`,`${r}ms`):this.style.removeProperty(`--wui-roll-duration`);let i=[...n],a=i.filter(e=>Na.test(e)).map(Number),o=i.map(e=>Na.test(e)?`#`:e).join(``);if(e&&o===this._signature){this._reels.forEach((e,t)=>{e.style.setProperty(`--wui-roll-digit`,String(a[t]))}),this._digits=a;return}let s=this._digits,c=[],l=[],u=0;for(let t of i){if(!Na.test(t)){let e=document.createElement(`span`);e.className=`wui-rolling-number-char`,e.textContent=t,l.push(e);continue}let n=document.createElement(`span`);n.className=`wui-rolling-number-digit`;let r=document.createElement(`span`);r.className=`wui-rolling-number-reel`;for(let e=0;e<10;e+=1){let t=document.createElement(`span`);t.textContent=String(e),r.append(t)}let i=a.length-1-u,o=e?s[s.length-1-i]??0:a[u];r.style.setProperty(`--wui-roll-digit`,String(o)),n.append(r),l.push(n),c.push(r),u+=1}t.replaceChildren(...l),e&&(t.offsetWidth,c.forEach((e,t)=>{e.style.setProperty(`--wui-roll-digit`,String(a[t]))})),this._signature=o,this._digits=a,this._reels=c,this.setAttribute(`data-ready`,``)}},Ia=e=>{let t=String(e??``).trim();return/^(https?:)?\/\//i.test(t)||/^\/(?!\/)/.test(t)||/^data:image\/(png|jpe?g|gif|webp|avif);/i.test(t)?t:``},La=(e,t=`wui-opt-avatar`)=>{let n=Ia(e.avatar);return!n&&!e.initials?``:`<span class="avatar ${t}" aria-hidden="true"><span class="avatar-face">${B(e.initials??``)}</span>${n?`<img class="avatar-img" src="${Ra(n)}" alt="" />`:``}</span>`},Ra=e=>String(e??``).replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`),za=n({createListboxKeyNav:()=>Va,moveActiveRow:()=>Ha}),Ba=e=>e.target instanceof Element?e.target.tagName:void 0;function Va(e){let{getVisibleOptions:t,getActive:n,setActive:r,onEnter:i,onEscape:a,onTypeahead:o,typeaheadMs:s=500}=e,c=``,l=null,u=()=>{clearTimeout(l??void 0),l=null,c=``};return{handler:e=>{let d=t(),f=n(),p=Ba(e)===`INPUT`||Ba(e)===`TEXTAREA`;if(e.key===`ArrowDown`)e.preventDefault(),r(Math.min(f+1,d.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),r(Math.max(f-1,0));else if(e.key===`Home`&&!p)e.preventDefault(),d.length&&r(0);else if(e.key===`End`&&!p)e.preventDefault(),d.length&&r(d.length-1);else if(e.key===`PageDown`&&!p){if(e.preventDefault(),!d.length)return;r(Math.min(Math.max(0,f)+8,d.length-1))}else if(e.key===`PageUp`&&!p){if(e.preventDefault(),!d.length)return;r(Math.max(Math.max(0,f)-8,0))}else if(e.key===`Enter`)i&&(e.preventDefault(),i(d[f],d));else if(e.key===`Escape`)a&&a();else if(e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&Ba(e)!==`INPUT`&&Ba(e)!==`TEXTAREA`){e.preventDefault(),clearTimeout(l??void 0),c+=e.key.toLowerCase(),l=setTimeout(u,s);let t=d.findIndex(e=>e.textContent.trim().toLowerCase().startsWith(c));t>=0&&(r(t),o&&o(e.key,t,d))}},clearTypeahead:u,teardown:u}}function Ha(e,t){let n=e.querySelector(`.is-active`);n!==t&&(n?.classList.remove(`is-active`),t?.classList.add(`is-active`))}var Ua=n({filterOptions:()=>Wa,renderOptions:()=>Ka});function Wa(e,t){let n=String(t??``).trim().toLowerCase();return n?e.filter(e=>[Mr(e),e.description,e.meta].some(e=>String(e??``).toLowerCase().includes(n))):e}var Ga=new WeakMap;function Ka(e,t,n={}){let{selected:r=[],query:i=``,status:a=`idle`,emptyText:o=`No matches`,searchingText:s=`Searching…`,hintText:c=`Type to search…`,actionRow:l=[],recents:u=null}=n,d=new Set(r.map(String)),f=Wa(t,i),p=e.id,m=0,h=()=>`${p}-opt-${m++}`,g=e=>`<button type="button" role="option" id="${B(h())}" class="wui-select-option wui-select-add" data-value="${B(e.value)}" data-custom="true" aria-selected="false">${B(e.label)}</button>`,_=l.filter(e=>e.position===`top`).map(g).join(``),v=u?.options.length?`<div class="wui-select-group">${B(u.label)}</div>${u.options.map(e=>qa(e,h(),d.has(String(e.value)))).join(``)}<div class="wui-select-sep" aria-hidden="true"></div>`:``,y=``,b=``;for(let e of f)e.group&&e.group!==y&&(b+=`<div class="wui-select-group">${B(e.group)}</div>`),y=e.group??``,b+=qa(e,h(),d.has(String(e.value)));let x=l.filter(e=>e.position===`bottom`).map(g).join(``),S=``;a===`loading`?S=`<div class="wui-select-loading"><span class="wui-select-spinner spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>${B(s)}</div>`:a===`hint`?S=`<div class="wui-select-hint">${B(c)}</div>`:(a===`empty`||f.length===0&&l.length===0)&&(S=`<div class="wui-select-empty">${B(o)}</div>`);let C=_+v+b+x+S;Ga.get(e)!==C&&(Ga.set(e,C),e.innerHTML=C)}function qa(e,t,n){let r=!!e.disabled,i=r&&e.disabledHint?` title="${B(e.disabledHint)}"`:``,a=`id="${B(t)}" role="option" data-value="${B(e.value)}" aria-selected="${n}"${r?` aria-disabled="true"`:``}${i}`,o=`<span class="wui-select-check" aria-hidden="true">${z(`check`)}</span>`;if(!e.description&&!e.meta)return`<button type="button" class="wui-select-option${n?` selected`:``}" ${a}>${La(e)}<span class="wui-select-opt-name">${kr(e)}</span>${o}</button>`;let s=e.description?`<span class="wui-select-opt-desc">${B(e.description)}</span>`:``,c=e.meta?`<span class="wui-select-opt-meta">${B(e.meta)}</span>`:``;return`<div class="wui-select-option wui-select-option-rich${n?` selected`:``}" ${a}>${La(e)}<span class="wui-select-option-text"><span class="wui-opt-label">${kr(e)}</span>${s}</span>${c}${o}</div>`}var Ja=Object.freeze([`single`,`multiple`,`search`,`tag`,`country`]),W=e=>e===`multiple`||e===`tag`,Ya=n({registerSelectPart:()=>Za,selectPart:()=>Qa}),Xa=new Map;function Za(e,t){Xa.set(e,t)}function Qa(e){return Xa.get(e)}var $a={chips:`select-chips`,search:`select-search`,country:`phone`,recents:`select-recents`};function eo(e){let t=Object.hasOwn($a,e)?$a[e]:void 0;if(!t)return Promise.reject(Error(`Unknown <wui-select> part: ${e}.`));let n=Qa(e);return n?Promise.resolve(n):sr(t).then(()=>_(Qa(e),`The ${e} part of <wui-select> did not register.`))}var to=n({searchesRemotely:()=>no}),no=e=>typeof e.loadOptions==`function`||!!e.getAttribute(`source`)||e.hasAttribute(`remote`),ro=n({WuiSelect:()=>io}),io=class extends g{static formAssociated=!0;_internals;_value;_optionsProp;_partOptions;_known;_loadOptionsFn;_validateFn;_declared;_query;_ownsFilter;_active;_status;_error;_nav;_parts;_partSig;_partsMounted;_partToken;_rendered;_searchShown;_defaultValue;_warnedMode;_warnedDensity;_reposition;_hoverTimer;_hoverOpened;_onHoverOver;_onHoverOut;_onDocClick;_bindGlobal=()=>{throw Error(`The select is not wired.`)};_reanchor;_reanchorScroll;static get observedAttributes(){return`mode.value.placeholder.search-placeholder.empty-text.searchable.clearable.disabled.readonly.loading.required.size.density.icon.prefix.open.open-on-hover.aria-label.aria-describedby.aria-invalid.min-chars.debounce.source.remote.allow-custom.add-label.searching-text.hint-text.value-label.value-avatar.value-initials.max-tags.allow-duplicates.separators.pattern.invalid-message.create-label.collapse-chips.selected-text.clear-all-label.countries.suggested.suggested-label.all-countries-label.recents-key.recents-limit.recents-label`.split(`.`)}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``,this._optionsProp=null,this._partOptions=null,this._known=new Map,this._loadOptionsFn=null,this._validateFn=null,this._declared=void 0,this._query=``,this._ownsFilter=!1,this._active=-1,this._status=`idle`,this._error=``,this._nav=null,this._parts=null,this._partSig=``,this._partsMounted=!1,this._partToken=0,this._rendered=!1,this._searchShown=!1,this._defaultValue=void 0,this._warnedMode=null,this._reposition=()=>{this._menuOpen()&&this._place()},this._hoverTimer=null,this._hoverOpened=!1,this._onHoverOver=e=>{e.pointerType===`mouse`&&this._hoverZone(e.target)&&(this._clearHover(),!this._menuOpen()&&this._hoverEligible()&&(this._hoverTimer=setTimeout(()=>{this._hoverTimer=null,!this._menuOpen()&&this._hoverEligible()&&(this._open({focus:!1}),this._hoverOpened=!0)},co)))},this._onHoverOut=e=>{e.pointerType===`mouse`&&this._hoverZone(e.target)&&!this._hoverZone(e.relatedTarget)&&(this._clearHover(),this._menuOpen()&&this.hasAttribute(`open-on-hover`)&&(this._hoverTimer=setTimeout(()=>{this._hoverTimer=null,this._close()},lo)))}}connectedCallback(){this.addEventListener(`pointerover`,this._onHoverOver),this.addEventListener(`pointerout`,this._onHoverOut),this._rendered?this._bindGlobal():this.render(),this._ensureParts(),this._mountParts()}disconnectedCallback(){this.removeEventListener(`pointerover`,this._onHoverOver),this.removeEventListener(`pointerout`,this._onHoverOut),this._clearHover(),this._teardown(),this._teardownParts()}attributeChangedCallback(e,t,n){e===`value`?(this._value=go(n,W(this.mode)),this._applyValue()):e===`aria-invalid`?this._syncInvalid():e===`open`?this._rendered&&(this.hasAttribute(`open`)?this._open({focus:!1}):this._close({force:!0})):e===`open-on-hover`?this.hasAttribute(`open-on-hover`)||this._clearHover():(e===`mode`&&(this._value=go(this._value,W(this.mode)),this._partOptions=null,this._known.clear(),this._ensureParts()),(e===`source`||e===`remote`||e===`recents-key`)&&this._ensureParts(),mo.has(e)?this._rendered&&(this._drawValue(),this.renderList()):po.has(e)?this._remountParts():this._rendered&&this.render())}formResetCallback(){if(this.value=this._defaultValue??``,!this._rendered)return;let e=this._refs();e.input&&(e.input.value=``,e.input.removeAttribute(`aria-invalid`)),e.search&&(e.search.value=``),this.setError(``),this._query!==``&&this._onQueryChange(``)}get mode(){let e=this.getAttribute(`mode`);return e===null?`single`:oo(e)?e:(e!==this._warnedMode&&(this._warnedMode=e,zn(`<wui-select> mode "${e}" is not one of ${Ja.join(`, `)}; it is treated as "single".`)),`single`)}_checkDensity(){let e=this.getAttribute(`density`);e===null||so.includes(e)||e===this._warnedDensity||(this._warnedDensity=e,zn(`<wui-select> density "${e}" is not one of ${so.join(`, `)}; it is treated as "comfortable".`))}set mode(e){this.setAttribute(`mode`,String(e))}get value(){return Array.isArray(this._value)?this._value.slice():this._value}set value(e){this._value=go(e,W(this.mode)),this._applyValue()}get options(){return this._readOptions()}set options(e){this._optionsProp=Array.isArray(e)?e:null,this.mode!==`country`&&(this._partOptions=null);for(let e of this._activePartsList())e.onOptions?.();if(this._rendered){if(this.mode===`single`&&this.getAttribute(`searchable`)===null&&this._autoSearch()!==this._searchShown){this.render();return}this._drawValue(),this.renderList()}}get loadOptions(){return this._loadOptionsFn}set loadOptions(e){this._loadOptionsFn=typeof e==`function`?e:null,this._ensureParts()}get validate(){return this._validateFn}set validate(e){this._validateFn=typeof e==`function`?e:null}commit(e,t={}){this.value=e,this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,detail:{isCustom:!!t.isCustom}}))}setPartOptions(e){this._partOptions=Array.isArray(e)?e:null,this._drawValue(),this.renderList()}setStatus(e){this._status=e,this.renderList()}setError(e){this._error=e?String(e):``,this._syncError()}openMenu(){I(this)||this._open({focus:!1})}closeMenu({focusControl:e=!1}={}){this._close(),e&&this._refs().control?.focus()}renderList(){let e=this._refs();e.list&&(Ka(e.list,this._listOptions(),{selected:this._selectedValues(),query:this._ownsFilter?``:this._query,status:this._status,emptyText:this.getAttribute(`empty-text`)||`No matches`,searchingText:this.getAttribute(`searching-text`)||`Searching…`,hintText:this.getAttribute(`hint-text`)||void 0,actionRow:this._actionRows(),recents:this._recents()}),this._active>=this._visible().length&&(this._active=-1),this._active>=0&&this._setActive(this._active,{reveal:!1}),this._menuOpen()&&this._place())}render(){let e=this._carry();this._teardownParts(),this._snapshotDeclared();let t=this.mode;this._checkDensity();let n=W(t),r=t===`tag`,i=n&&(r||this.hasAttribute(`allow-custom`));this._value=go(this._value,n),this._defaultValue===void 0&&n&&this._value.length===0&&(this._value=this._declaredSelected()),n||this._preselect(),this._defaultValue===void 0&&(this._defaultValue=go(this._value,n));let a=this.getAttribute(`size`),o=a===`sm`?` wui-select-sm`:a===`lg`?` wui-select-lg`:``,s=this.getAttribute(`icon`),c=this.getAttribute(`prefix`),l=this.hasAttribute(`clearable`),u=this.hasAttribute(`disabled`);this.id||=`wui-select-${Math.random().toString(36).slice(2,9)}`;let d=`${this.id}-listbox`,f=`${this.id}-entry-error`,p=this.getAttribute(`aria-describedby`)?.trim(),m=p?`${p} ${f}`:f,h=this.hasAttribute(`aria-invalid`)||this._error?` aria-invalid="true"`:``,g=this.hasAttribute(`required`)&&!i?` aria-required="true"`:``,_=` aria-label="${B(this._accessibleName())}" aria-describedby="${B(m)}"${h}${g}`,v=i?``:` role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${B(d)}"`,y=n?`<div class="input wui-select-control wui-select-multi"${v}${_}${u?` aria-disabled="true"`:r?``:` tabindex="0"`}>`:`<button type="button" class="input wui-select-control"${v}${_}${u?` disabled`:``}>`,b=`${s?z(s,{className:`wui-select-icon`}):``}${c?`<span class="wui-select-prefix">${B(c)}</span>`:``}<span class="wui-select-value" data-label></span>${l?`<span class="wui-select-reset" role="button" aria-label="Clear selection" hidden>${z(`x`)}</span>`:``}${z(`chevron-down`,{className:`wui-select-caret`})}`,x=this.getAttribute(`searchable`),S=x===null?t===`multiple`||t===`country`||this._autoSearch():x!==`false`,C=t===`search`||S&&!i;this._searchShown=C;let w=this.getAttribute(`search-placeholder`)||(t===`country`?`Search countries…`:`Search…`),ee=C?`<div class="wui-select-search">${z(`search`)}<input class="wui-select-input" placeholder="${B(w)}" aria-label="${B(w)}" aria-autocomplete="list" /><button type="button" class="wui-select-clear" aria-label="Clear search" hidden>${z(`x`)}</button></div>`:``;this.innerHTML=`
44
+ </div>`,this._rendered=!0,V(this,this._value),br(this,this.querySelector(`.otp`)),this._wire(),this._paint()}_refs(){let e=this.querySelector(`.otp-field`);return{input:e instanceof HTMLInputElement?e:null,slots:[...this.querySelectorAll(`.otp-slot`)].filter(e=>e instanceof HTMLElement)}}_paint(){let{input:e,slots:t}=this._refs();if(!e||!t.length)return;e.value!==this._value&&(e.value=this._value);let n=e.selectionStart??this._value.length,r=Math.min(n,t.length-1),i=document.activeElement===e;t.forEach((e,t)=>{e.textContent=this._value[t]??``,e.classList.toggle(`filled`,!!this._value[t]),e.classList.toggle(`active`,i&&t===r)})}_wire(){let{input:e}=this._refs();if(!e)return;let t=e=>{let t=this._clean(e),n=t!==this._value;this._value=t,V(this,this._value),this._paint(),n&&this.dispatchEvent(new Event(`change`,{bubbles:!0})),n&&t.length===this.length&&this.dispatchEvent(new CustomEvent(`complete`,{bubbles:!0,detail:t}))};e.addEventListener(`input`,()=>{let n=e.value;if(this._value.length===this.length&&n.length>this._value.length&&n.startsWith(this._value)){let e=this._clean(n.slice(this._value.length));if(e){t(e);return}}t(n)}),e.addEventListener(`paste`,e=>{if(B(this))return;let n=e.clipboardData?.getData(`text`);n!=null&&(e.preventDefault(),t(n))});for(let t of[`keyup`,`click`,`blur`,`select`])e.addEventListener(t,()=>this._paint());e.addEventListener(`focus`,()=>{this._value.length===this.length&&e.select(),this._paint()}),this._onSelectionChange&&document.removeEventListener(`selectionchange`,this._onSelectionChange),this._onSelectionChange=()=>{document.activeElement===e&&this._paint()},document.addEventListener(`selectionchange`,this._onSelectionChange)}disconnectedCallback(){this._onSelectionChange&&document.removeEventListener(`selectionchange`,this._onSelectionChange)}},qa=`data-wui-overflow-hidden`,Ja=`[aria-selected="true"], .active`,Ya=`.chip-body, input, a[href], button:not(.chip-remove)`,Xa=1,Za=`data-wui-overflow-menu`,Qa=`[aria-haspopup], [data-wui-dropdown-trigger]`,$a=0,eo=e=>Number.parseFloat(e)||0,to=e=>e.nodeType===1,no=e=>{let t=e.getAttribute(`data-overflow-label`);if(t)return t;let n=[],r=e=>{for(let t of e.childNodes)if(t.nodeType===3){let e=t.textContent?.trim();e&&n.push(e)}else to(t)&&!t.matches(`svg, img, [aria-hidden='true'], [data-wui-dropdown-menu]`)&&r(t)};if(r(e),n.length)return n.join(` `);let i=ro(e)??e;return i.getAttribute(`aria-label`)||e.getAttribute(`aria-label`)||i.title||e.title},ro=e=>{if(e.matches(`button, a[href], label, input`))return e;let t=e.querySelector(Ya);return t instanceof HTMLElement?t:null},io=e=>{let t=ro(e);return t?.matches(Qa)?t:null},ao=class extends s{constructor(){super(),this._hiddenKey=``,this._ro=null,this._mo=null,this._observedList=null,this._doc=null,this._onDocDown=e=>{!this._menu.hidden&&!e.composedPath().includes(this)&&this._close(!1)}}connectedCallback(){this.classList.add(`wui-overflow`),this._build(),this._doc=this.ownerDocument,this._doc.addEventListener(`pointerdown`,this._onDocDown,!0),typeof ResizeObserver<`u`&&(this._ro=new ResizeObserver(()=>this.layout()),this._ro.observe(this)),typeof MutationObserver<`u`&&(this._mo=new MutationObserver(()=>this.layout()),this._watch()),this.layout()}disconnectedCallback(){this._ro?.disconnect(),this._mo?.disconnect(),this._ro=null,this._mo=null,this._observedList=null,this._doc?.removeEventListener(`pointerdown`,this._onDocDown,!0),this._doc=null,C(this)}static get observedAttributes(){return[`label`]}attributeChangedCallback(){let e=this._more?.firstChild;e&&(e.textContent=this._label())}_label(){return this.getAttribute(`label`)||`More`}_list(){let e=this.querySelector(`[data-wui-overflow-list]`);return e instanceof HTMLElement?e:null}_items(e){return[...e.children].filter(e=>!e.hasAttribute(`data-wui-overflow-skip`))}_build(){if(this._more)return;let e=`wui-overflow-menu-${++$a}`,t=this.ownerDocument.createElement(`button`);t.type=`button`,t.className=`wui-overflow-more`,t.hidden=!0,t.setAttribute(`aria-haspopup`,`menu`),t.setAttribute(`aria-expanded`,`false`),t.setAttribute(`aria-controls`,e),t.append(this._label());let n=this.ownerDocument.createElement(`div`);n.className=`wui-overflow-menu`,n.id=e,n.setAttribute(`role`,`menu`),n.hidden=!0,this.append(t,n),this._more=t,this._menu=n,t.addEventListener(`click`,()=>this._menu.hidden?this._open(!1):this._close(!0)),t.addEventListener(`keydown`,e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),this._open(!0))}),n.addEventListener(`keydown`,e=>this._onMenuKey(e))}_watch(){let e=this._list();this._mo&&e!==this._observedList&&(this._mo.disconnect(),this._observedList=e,e&&this._mo.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`class`,`aria-selected`,`disabled`,`aria-disabled`,`data-overflow-label`]}))}layout(){let e=this._list();if(this._watch(),!e||!this._more)return;let t=this._items(e);for(let e of t)e.removeAttribute(qa),e.removeAttribute(Za);this._more.hidden=!0;let n=this.clientWidth,r=[];if(t.length&&n<=0&&this.getClientRects().length>0)r=t;else if(n>0&&t.length){let i=getComputedStyle(e),a=eo(i.columnGap),o=eo(i.paddingLeft)+eo(i.paddingRight)+eo(i.borderLeftWidth)+eo(i.borderRightWidth),s=t.map(e=>e.offsetWidth);if(s.reduce((e,t)=>e+t,0)+a*(t.length-1)>n-o+Xa){this._more.hidden=!1;let e=n-o-this._more.offsetWidth-eo(getComputedStyle(this).columnGap),i=this.hasAttribute(`keep`)?this.getAttribute(`keep`):Ja,c=new Set,l=0,u=0,d=i?t.filter(e=>e.matches(i)):[];for(let n of d){let r=l+(s[t.indexOf(n)]??0)+(u?a:0);r>e||(c.add(n),l=r,u+=1)}for(let n=0;n<t.length;n+=1){let r=t[n];if(!r||c.has(r))continue;let i=l+(s[n]??0)+(u?a:0);if(i>e)break;c.add(r),l=i,u+=1}r=t.filter(e=>!c.has(e))}}for(let e of r)e.setAttribute(qa,``),io(e)&&e.setAttribute(Za,``);this._more.hidden=r.length===0,r.length?this._menu.hidden||this._fill(r):this._close(!1);let i=r.map(e=>t.indexOf(e)).join(`,`);i!==this._hiddenKey&&(this._hiddenKey=i,this.dispatchEvent(new CustomEvent(`wui-overflow-change`,{bubbles:!0,detail:{hidden:r.length}})))}_hiddenItems(){let e=this._list();return e?this._items(e).filter(e=>e.hasAttribute(qa)):[]}_fill(e){this._menu.replaceChildren();for(let t of e){let e=this.ownerDocument.createElement(`button`);e.type=`button`,e.className=`wui-overflow-item`,e.tabIndex=-1;let n=t.querySelector(`input[type=checkbox], input[type=radio]`);n instanceof HTMLInputElement?(e.setAttribute(`role`,n.type===`radio`?`menuitemradio`:`menuitemcheckbox`),e.setAttribute(`aria-checked`,String(n.checked))):e.setAttribute(`role`,`menuitem`);let r=ro(t),i=!r||`disabled`in r&&r.disabled||r.getAttribute(`aria-disabled`)===`true`||t.matches(`.disabled, [aria-disabled='true']`);i&&e.setAttribute(`aria-disabled`,`true`),e.textContent=no(t),e.addEventListener(`click`,()=>{i||r&&this._choose(t,r)}),this._menu.append(e)}}_choose(e,t){this._close(!1),t.click(),this.layout();let n=io(e)?.isConnected?e.querySelector(`.dropdown-item:not([aria-disabled='true'])`):null;if(n){n.focus();return}let r=!e.hasAttribute(qa)&&e.matches(`button, a[href]`)?e:this._more;r.hidden||r.focus()}_open(e){let t=this._hiddenItems();if(!t.length)return;this._fill(t),this._menu.hidden=!1,this._more.setAttribute(`aria-expanded`,`true`);let n=()=>x(this._more,this._menu);if(n(),S(this,n),e){let e=this._menu.firstElementChild;e instanceof HTMLElement&&e.focus()}}_close(e){this._menu&&!this._menu.hidden&&(this._menu.hidden=!0,this._more.setAttribute(`aria-expanded`,`false`),C(this),e&&this._more.focus())}_onMenuKey(e){let t=[...this._menu.children].filter(e=>e instanceof HTMLElement),n=this.ownerDocument.activeElement,r=n instanceof HTMLElement?t.indexOf(n):-1,i=null;if(e.key===`ArrowDown`)i=t[(r+1)%t.length];else if(e.key===`ArrowUp`)i=t[(r-1+t.length)%t.length];else if(e.key===`Home`)i=t[0];else if(e.key===`End`)i=t[t.length-1];else if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),this._close(!0);return}else if(e.key===`Tab`){this._close(!1);return}else return;e.preventDefault(),i?.focus()}},oo=`.wui-rating-star`,so=`wui-rating-star-preview`,co=`wui-rating-previewing`,lo=`wui-rating-star-full`,uo=`wui-rating-star-empty`,fo=[lo,`wui-rating-star-half`,uo],po=e=>[...e.querySelectorAll(oo)].filter(e=>e instanceof HTMLElement),mo=class extends s{_onChange;_onOver;_onLeave;constructor(){super(),this._onChange=e=>{let t=e.target;t instanceof HTMLInputElement&&t.type===`radio`&&this._fill(Number(t.value))},this._onOver=e=>{if(this.hasAttribute(`disabled`))return;let t=P(e.target,oo);t instanceof HTMLElement&&this._preview(Number(t.dataset.value))},this._onLeave=()=>this._preview(0)}connectedCallback(){this.addEventListener(`change`,this._onChange),this.addEventListener(`mouseover`,this._onOver),this.addEventListener(`mouseleave`,this._onLeave)}disconnectedCallback(){this.removeEventListener(`change`,this._onChange),this.removeEventListener(`mouseover`,this._onOver),this.removeEventListener(`mouseleave`,this._onLeave)}_fill(e){for(let t of po(this))t.classList.remove(...fo),t.classList.add(Number(t.dataset.value)<=e?lo:uo)}_preview(e){this.classList.toggle(co,e>0);for(let t of po(this))t.classList.toggle(so,e>0&&Number(t.dataset.value)<=e)}},ho=class extends s{_doc;_onKeyDown;constructor(){super(),this._doc=null,this._onKeyDown=e=>{this.hasAttribute(`keys`)&&Ye(e,{j:()=>this._press(`.wui-record-pager-next`),k:()=>this._press(`.wui-record-pager-prev`)},this.closest(`[${je}]`))}}connectedCallback(){this._doc=this.ownerDocument,N(this._doc,`wui-record-pager has no owner document`).addEventListener(`keydown`,this._onKeyDown)}disconnectedCallback(){this._doc?.removeEventListener(`keydown`,this._onKeyDown),this._doc=null}_press(e){let t=this.querySelector(e);!(t instanceof HTMLElement)||t instanceof HTMLButtonElement&&t.disabled||t.getAttribute(`aria-disabled`)===`true`||t.click()}},go=6e4,_o=60*go,vo=24*_o,yo=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function bo(e,t=Date.now()){let n=an(e);if(!Number.isFinite(n))return`-`;let r=t-n,i=Math.abs(r);if(i>=7*vo)return I(n);if(i<go)return`just now`;let[a,o]=i<_o?[Math.floor(i/go),`minute`]:i<vo?[Math.floor(i/_o),`hour`]:[Math.floor(i/vo),`day`];return r>0?`${yo(a,o)} ago`:`in ${yo(a,o)}`}function xo(e){let t=an(e);return Number.isFinite(t)?`${I(t,{pattern:`datetime`})} IST`:`-`}var So=3e4,Co=new Set,wo=null,To=()=>{if(!(typeof document<`u`&&document.hidden))for(let e of Co)e.refresh()},Eo=e=>{Co.add(e),Co.size===1&&(wo=setInterval(To,So),document.addEventListener(`visibilitychange`,To))},Do=e=>{Co.delete(e),Co.size===0&&(clearInterval(wo??void 0),wo=null,document.removeEventListener(`visibilitychange`,To))},Oo=class extends s{_observer;constructor(){super(),this._observer=null}connectedCallback(){this.refresh(),Eo(this),this._observer=new MutationObserver(()=>this.refresh()),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`datetime`]})}disconnectedCallback(){Do(this),this._observer?.disconnect(),this._observer=null}refresh(){let e=this.querySelector(`time[datetime]`);if(!(e instanceof HTMLTimeElement))return;let t=e.getAttribute(`datetime`),n=bo(t);e.textContent!==n&&(e.textContent=n);let r=xo(t);this.getAttribute(`data-wui-tooltip`)!==r&&this.setAttribute(`data-wui-tooltip`,r)}},ko=/^[0-9]$/,Ao=()=>typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,jo=class extends s{_connected;_signature;_digits;_reels;_roll;_onRollEnd;static get observedAttributes(){return[`value`,`format`,`unit`,`decimals`,`duration`]}constructor(){super(),this._connected=!1,this._signature=null,this._digits=[],this._reels=[],this._roll=null,this._onRollEnd=e=>{e.target instanceof Element&&e.target.classList.contains(`wui-rolling-number-reel`)&&this.removeAttribute(`data-rolling`)}}connectedCallback(){this._connected=!0;let e=this.querySelector(`.wui-rolling-number-roll`);this._roll=e instanceof HTMLElement?e:null,this._roll?.addEventListener(`transitionend`,this._onRollEnd),this._draw(!1)}disconnectedCallback(){this._connected=!1,this._roll?.removeEventListener(`transitionend`,this._onRollEnd)}attributeChangedCallback(){this._connected&&this._draw(!0)}_text(){let e=this.getAttribute(`value`),t=e===null||e.trim()===``?NaN:Number(e);if(!Number.isFinite(t))return null;let n=this.getAttribute(`decimals`);return cn(t,{style:this.getAttribute(`format`)||`number`,unit:this.getAttribute(`unit`)||void 0,decimals:n===null||n===``?void 0:Number(n)})}_showText(e){let t=this.querySelector(`.wui-rolling-number-text`);t instanceof HTMLElement&&t.textContent!==e&&(t.firstChild?t.firstChild.nodeValue=e:t.append(e))}_clear(e){e.replaceChildren(),this.removeAttribute(`data-ready`),this._signature=null,this._digits=[],this._reels=[]}_draw(e){let t=this.querySelector(`.wui-rolling-number-roll`);if(!(t instanceof HTMLElement))return;let n=this._text();if(n===null||(this._showText(n),Ao())){this._clear(t);return}this.toggleAttribute(`data-rolling`,e);let r=Number(this.getAttribute(`duration`));this.getAttribute(`duration`)&&Number.isFinite(r)&&r>=0?this.style.setProperty(`--wui-roll-duration`,`${r}ms`):this.style.removeProperty(`--wui-roll-duration`);let i=[...n],a=i.filter(e=>ko.test(e)).map(Number),o=i.map(e=>ko.test(e)?`#`:e).join(``);if(e&&o===this._signature){this._reels.forEach((e,t)=>{e.style.setProperty(`--wui-roll-digit`,String(a[t]))}),this._digits=a;return}let s=this._digits,c=[],l=[],u=0;for(let t of i){if(!ko.test(t)){let e=document.createElement(`span`);e.className=`wui-rolling-number-char`,e.textContent=t,l.push(e);continue}let n=document.createElement(`span`);n.className=`wui-rolling-number-digit`;let r=document.createElement(`span`);r.className=`wui-rolling-number-reel`;for(let e=0;e<10;e+=1){let t=document.createElement(`span`);t.textContent=String(e),r.append(t)}let i=a.length-1-u,o=e?s[s.length-1-i]??0:a[u];r.style.setProperty(`--wui-roll-digit`,String(o)),n.append(r),l.push(n),c.push(r),u+=1}t.replaceChildren(...l),e&&(t.offsetWidth,c.forEach((e,t)=>{e.style.setProperty(`--wui-roll-digit`,String(a[t]))})),this._signature=o,this._digits=a,this._reels=c,this.setAttribute(`data-ready`,``)}},Mo=e=>{let t=String(e??``).trim();return/^(https?:)?\/\//i.test(t)||/^\/(?!\/)/.test(t)||/^data:image\/(png|jpe?g|gif|webp|avif);/i.test(t)?t:``},No=(e,t=`wui-opt-avatar`)=>{let n=Mo(e.avatar);return!n&&!e.initials?``:`<span class="avatar ${t}" aria-hidden="true"><span class="avatar-face">${W(e.initials??``)}</span>${n?`<img class="avatar-img" src="${Po(n)}" alt="" />`:``}</span>`},Po=e=>String(e??``).replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`),Fo=n({createListboxKeyNav:()=>Lo,moveActiveRow:()=>Ro}),Io=e=>e.target instanceof Element?e.target.tagName:void 0;function Lo(e){let{getVisibleOptions:t,getActive:n,setActive:r,onEnter:i,onEscape:a,onTypeahead:o,typeaheadMs:s=500}=e,c=``,l=null,u=()=>{clearTimeout(l??void 0),l=null,c=``};return{handler:e=>{let d=t(),f=n(),p=Io(e)===`INPUT`||Io(e)===`TEXTAREA`;if(e.key===`ArrowDown`)e.preventDefault(),r(Math.min(f+1,d.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),r(Math.max(f-1,0));else if(e.key===`Home`&&!p)e.preventDefault(),d.length&&r(0);else if(e.key===`End`&&!p)e.preventDefault(),d.length&&r(d.length-1);else if(e.key===`PageDown`&&!p){if(e.preventDefault(),!d.length)return;r(Math.min(Math.max(0,f)+8,d.length-1))}else if(e.key===`PageUp`&&!p){if(e.preventDefault(),!d.length)return;r(Math.max(Math.max(0,f)-8,0))}else if(Zn(e))i&&(e.preventDefault(),i(d[f],d));else if(e.key===`Escape`)a&&a(e);else if(e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&Io(e)!==`INPUT`&&Io(e)!==`TEXTAREA`){e.preventDefault(),clearTimeout(l??void 0),c+=e.key.toLowerCase(),l=setTimeout(u,s);let t=d.findIndex(e=>e.textContent.trim().toLowerCase().startsWith(c));t>=0&&(r(t),o&&o(e.key,t,d))}},clearTypeahead:u,teardown:u}}function Ro(e,t){let n=e.querySelector(`.is-active`);n!==t&&(n?.classList.remove(`is-active`),t?.classList.add(`is-active`))}var zo=n({filterOptions:()=>Bo,renderOptions:()=>Ho});function Bo(e,t){let n=String(t??``).trim().toLowerCase();return n?e.filter(e=>[xi(e),e.description,e.meta].some(e=>String(e??``).toLowerCase().includes(n))):e}var Vo=new WeakMap;function Ho(e,t,n={}){let{selected:r=[],query:i=``,status:a=`idle`,emptyText:o=`No matches`,searchingText:s=`Searching…`,hintText:c=`Type to search…`,actionRow:l=[],recents:u=null}=n,d=new Set(r.map(String)),f=Bo(t,i),p=e.id,m=0,h=()=>`${p}-opt-${m++}`,g=e=>`<button type="button" role="option" id="${W(h())}" class="wui-select-option wui-select-add" data-value="${W(e.value)}" data-custom="true" aria-selected="false">${W(e.label)}</button>`,_=l.filter(e=>e.position===`top`).map(g).join(``),v=u?.options.length?`<div class="wui-select-group">${W(u.label)}</div>${u.options.map(e=>Uo(e,h(),d.has(String(e.value)))).join(``)}<div class="wui-select-sep" aria-hidden="true"></div>`:``,y=``,b=``;for(let e of f)e.group&&e.group!==y&&(b+=`<div class="wui-select-group">${W(e.group)}</div>`),y=e.group??``,b+=Uo(e,h(),d.has(String(e.value)));let x=l.filter(e=>e.position===`bottom`).map(g).join(``),S=``;a===`loading`?S=`<div class="wui-select-loading"><span class="wui-select-spinner spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>${W(s)}</div>`:a===`hint`?S=`<div class="wui-select-hint">${W(c)}</div>`:(a===`empty`||f.length===0&&l.length===0)&&(S=`<div class="wui-select-empty">${W(o)}</div>`);let C=_+v+b+x+S;Vo.get(e)!==C&&(Vo.set(e,C),e.innerHTML=C)}function Uo(e,t,n){let r=!!e.disabled,i=r&&e.disabledHint?` title="${W(e.disabledHint)}"`:``,a=`id="${W(t)}" role="option" data-value="${W(e.value)}" aria-selected="${n}"${r?` aria-disabled="true"`:``}${i}`,o=`<span class="wui-select-check" aria-hidden="true">${U(`check`)}</span>`;if(!e.description&&!e.meta)return`<button type="button" class="wui-select-option${n?` selected`:``}" ${a}>${No(e)}<span class="wui-select-opt-name">${vi(e)}</span>${o}</button>`;let s=e.description?`<span class="wui-select-opt-desc">${W(e.description)}</span>`:``,c=e.meta?`<span class="wui-select-opt-meta">${W(e.meta)}</span>`:``;return`<div class="wui-select-option wui-select-option-rich${n?` selected`:``}" ${a}>${No(e)}<span class="wui-select-option-text"><span class="wui-opt-label">${vi(e)}</span>${s}</span>${c}${o}</div>`}var Wo=Object.freeze([`single`,`multiple`,`search`,`tag`,`country`]),q=e=>e===`multiple`||e===`tag`,Go=n({registerSelectPart:()=>qo,selectPart:()=>Jo}),Ko=new Map;function qo(e,t){Ko.set(e,t)}function Jo(e){return Ko.get(e)}var Yo={chips:`select-chips`,search:`select-search`,country:`phone`,recents:`select-recents`};function Xo(e){let t=Object.hasOwn(Yo,e)?Yo[e]:void 0;if(!t)return Promise.reject(Error(`Unknown <wui-select> part: ${e}.`));let n=Jo(e);return n?Promise.resolve(n):Xr(t).then(()=>N(Jo(e),`The ${e} part of <wui-select> did not register.`))}var Zo=n({searchesRemotely:()=>Qo}),Qo=e=>typeof e.loadOptions==`function`||!!e.getAttribute(`source`)||e.hasAttribute(`remote`),$o=n({WuiSelect:()=>es}),es=class extends s{static formAssociated=!0;_internals;_value;_optionsProp;_partOptions;_known;_loadOptionsFn;_validateFn;_declared;_query;_ownsFilter;_active;_status;_error;_nav;_parts;_partSig;_partsMounted;_partToken;_rendered;_searchShown;_defaultValue;_warnedMode;_warnedDensity;_hoverTimer;_hoverOpened;_onHoverOver;_onHoverOut;_panelShown;_pressOpen;static get observedAttributes(){return`mode.value.placeholder.search-placeholder.empty-text.searchable.clearable.disabled.readonly.loading.required.size.density.icon.prefix.open.open-on-hover.aria-label.aria-describedby.aria-invalid.min-chars.debounce.source.remote.allow-custom.add-label.searching-text.hint-text.value-label.value-avatar.value-initials.max-tags.allow-duplicates.separators.pattern.invalid-message.create-label.collapse-chips.selected-text.clear-all-label.countries.suggested.suggested-label.all-countries-label.recents-key.recents-limit.recents-label`.split(`.`)}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``,this._optionsProp=null,this._partOptions=null,this._known=new Map,this._loadOptionsFn=null,this._validateFn=null,this._declared=void 0,this._query=``,this._ownsFilter=!1,this._active=-1,this._status=`idle`,this._error=``,this._nav=null,this._parts=null,this._partSig=``,this._partsMounted=!1,this._partToken=0,this._rendered=!1,this._searchShown=!1,this._defaultValue=void 0,this._warnedMode=null,this._hoverTimer=null,this._hoverOpened=!1,this._panelShown=!1,this._pressOpen=null,this._onHoverOver=e=>{e.pointerType===`mouse`&&this._hoverZone(e.target)&&(this._clearHover(),!this._menuOpen()&&this._hoverEligible()&&(this._hoverTimer=setTimeout(()=>{this._hoverTimer=null,!this._menuOpen()&&this._hoverEligible()&&(this._open({focus:!1}),this._hoverOpened=!0)},is)))},this._onHoverOut=e=>{e.pointerType===`mouse`&&this._hoverZone(e.target)&&!this._hoverZone(e.relatedTarget)&&(this._clearHover(),this._menuOpen()&&this.hasAttribute(`open-on-hover`)&&(this._hoverTimer=setTimeout(()=>{this._hoverTimer=null,this._close()},as)))}}connectedCallback(){this.addEventListener(`pointerover`,this._onHoverOver),this.addEventListener(`pointerout`,this._onHoverOut),this._rendered||this.render(),this._ensureParts(),this._mountParts()}disconnectedCallback(){this.removeEventListener(`pointerover`,this._onHoverOver),this.removeEventListener(`pointerout`,this._onHoverOut),this._clearHover(),this._dropMenu(),this._teardown(),this._teardownParts()}attributeChangedCallback(e,t,n){e===`value`?(this._value=ds(n,q(this.mode)),this._applyValue()):e===`aria-invalid`?this._syncInvalid():e===`open`?this._rendered&&(this.hasAttribute(`open`)?this._open({focus:!1}):this._close({force:!0})):e===`open-on-hover`?this.hasAttribute(`open-on-hover`)||this._clearHover():(e===`mode`&&(this._value=ds(this._value,q(this.mode)),this._partOptions=null,this._known.clear(),this._ensureParts()),(e===`source`||e===`remote`||e===`recents-key`)&&this._ensureParts(),ls.has(e)?this._rendered&&(this._drawValue(),this.renderList()):cs.has(e)?this._remountParts():this._rendered&&this.render())}formResetCallback(){if(this.value=this._defaultValue??``,!this._rendered)return;let e=this._refs();e.input&&(e.input.value=``,e.input.removeAttribute(`aria-invalid`)),e.search&&(e.search.value=``),this.setError(``),this._query!==``&&this._onQueryChange(``)}get mode(){let e=this.getAttribute(`mode`);return e===null?`single`:ns(e)?e:(e!==this._warnedMode&&(this._warnedMode=e,Or(`<wui-select> mode "${e}" is not one of ${Wo.join(`, `)}; it is treated as "single".`)),`single`)}_checkDensity(){let e=this.getAttribute(`density`);e===null||rs.includes(e)||e===this._warnedDensity||(this._warnedDensity=e,Or(`<wui-select> density "${e}" is not one of ${rs.join(`, `)}; it is treated as "comfortable".`))}set mode(e){this.setAttribute(`mode`,String(e))}get value(){return Array.isArray(this._value)?this._value.slice():this._value}set value(e){this._value=ds(e,q(this.mode)),this._applyValue()}get options(){return this._readOptions()}set options(e){this._optionsProp=Array.isArray(e)?e:null,this.mode!==`country`&&(this._partOptions=null);for(let e of this._activePartsList())e.onOptions?.();if(this._rendered){if(this.mode===`single`&&this.getAttribute(`searchable`)===null&&this._autoSearch()!==this._searchShown){this.render();return}this._drawValue(),this.renderList()}}get loadOptions(){return this._loadOptionsFn}set loadOptions(e){this._loadOptionsFn=typeof e==`function`?e:null,this._ensureParts()}get validate(){return this._validateFn}set validate(e){this._validateFn=typeof e==`function`?e:null}commit(e,t={}){this.value=e,this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,detail:{isCustom:!!t.isCustom}}))}setPartOptions(e){this._partOptions=Array.isArray(e)?e:null,this._drawValue(),this.renderList()}setStatus(e){this._status=e,this.renderList()}setError(e){this._error=e?String(e):``,this._syncError()}openMenu(){B(this)||this._open({focus:!1})}closeMenu({focusControl:e=!1}={}){this._close(),e&&this._refs().control?.focus()}renderList(){let e=this._refs();e.list&&(Ho(e.list,this._listOptions(),{selected:this._selectedValues(),query:this._ownsFilter?``:this._query,status:this._status,emptyText:this.getAttribute(`empty-text`)||`No matches`,searchingText:this.getAttribute(`searching-text`)||`Searching…`,hintText:this.getAttribute(`hint-text`)||void 0,actionRow:this._actionRows(),recents:this._recents()}),this._active>=this._visible().length&&(this._active=-1),this._active>=0&&this._setActive(this._active,{reveal:!1}),this._anchorMenu())}render(){this._dropMenu();let e=this._carry();this._teardownParts(),this._snapshotDeclared();let t=this.mode;this._checkDensity();let n=q(t),r=t===`tag`,i=n&&(r||this.hasAttribute(`allow-custom`));this._value=ds(this._value,n),this._defaultValue===void 0&&n&&this._value.length===0&&(this._value=this._declaredSelected()),n||this._preselect(),this._defaultValue===void 0&&(this._defaultValue=ds(this._value,n));let a=this.getAttribute(`size`),o=a===`sm`?` wui-select-sm`:a===`lg`?` wui-select-lg`:``,s=this.getAttribute(`icon`),c=this.getAttribute(`prefix`),l=this.hasAttribute(`clearable`),u=this.hasAttribute(`disabled`);this.id||=`wui-select-${Math.random().toString(36).slice(2,9)}`;let d=`${this.id}-listbox`,f=`${this.id}-entry-error`,p=this.getAttribute(`aria-describedby`)?.trim(),m=p?`${p} ${f}`:f,h=this.hasAttribute(`aria-invalid`)||this._error?` aria-invalid="true"`:``,g=this.hasAttribute(`required`)&&!i?` aria-required="true"`:``,_=` aria-label="${W(this._accessibleName())}" aria-describedby="${W(m)}"${h}${g}`,v=i?``:` role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${W(d)}"`,y=n?`<div class="input wui-select-control wui-select-multi"${v}${_}${u?` aria-disabled="true"`:r?``:` tabindex="0"`}>`:`<button type="button" class="input wui-select-control"${v}${_}${u?` disabled`:``}>`,b=`${s?U(s,{className:`wui-select-icon`}):``}${c?`<span class="wui-select-prefix">${W(c)}</span>`:``}<span class="wui-select-value" data-label></span>${l?`<span class="wui-select-reset" role="button" aria-label="Clear selection" hidden>${U(`x`)}</span>`:``}${U(`chevron-down`,{className:`wui-select-caret`})}`,x=this.getAttribute(`searchable`),S=x===null?t===`multiple`||t===`country`||this._autoSearch():x!==`false`,C=t===`search`||S&&!i;this._searchShown=C;let w=this.getAttribute(`search-placeholder`)||(t===`country`?`Search countries…`:`Search…`),T=C?`<div class="wui-select-search">${U(`search`)}<input class="wui-select-input" placeholder="${W(w)}" aria-label="${W(w)}" aria-autocomplete="list" /><button type="button" class="wui-select-clear" aria-label="Clear search" hidden>${U(`x`)}</button></div>`:``;this.innerHTML=`
45
45
  <div class="wui-select${o}">
46
46
  ${y}${b}${n?`</div>`:`</button>`}
47
- <div class="wui-select-menu wui-select-menu-fixed" hidden>
48
- ${ee}
49
- <div class="wui-select-options" role="listbox" id="${B(d)}" tabindex="-1"${n?` aria-multiselectable="true"`:``}></div>
47
+ <div class="wui-select-menu wui-select-menu-fixed" popover="auto">
48
+ ${T}
49
+ <div class="wui-select-options" role="listbox" id="${W(d)}" tabindex="-1"${n?` aria-multiselectable="true"`:``}></div>
50
50
  </div>
51
51
  </div>
52
- <div class="field-error wui-select-error" id="${B(f)}" aria-live="polite"${this._error?``:` hidden`}>${B(this._error)}</div>`,this._rendered=!0,this._syncMirror(),this._syncValidity(),this._drawValue(),this._syncReset(),this.renderList(),this._wire(),jn(this,this.querySelector(`.wui-select-control`)),this._mountParts(e)}_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||`Select`}_snapshotDeclared(){if(this._declared)return;let e=[...this.querySelectorAll(`:scope > wui-option`)];e.length&&(this._declared=e.map(e=>{let t={value:e.getAttribute(`value`)??Co(e).trim(),label:e.innerHTML,[wr]:!0,selected:e.hasAttribute(`selected`)};for(let[n,r]of ho){let i=e.getAttribute(n);i&&(t[r]=i)}return e.hasAttribute(`disabled`)&&(t.disabled=!0),t}))}_readOptions(){return this.mode===`country`?this._partOptions||[]:this._partOptions?this._partOptions:this._optionsProp?this._optionsProp:(this._snapshotDeclared(),this._declared||[])}_listOptions(){let e=this._readOptions(),t=this.getAttribute(`value-label`);if(this.mode!==`search`||!t||this._value===``)return e;let n=String(this._value);return e.some(e=>String(e.value)===n)?e:[...e,{value:n,label:t}]}_declaredSelected(){return this._optionsProp?[]:(this._declared??[]).filter(e=>e.selected).map(e=>String(e.value))}_preselect(){let e=this._readOptions(),t=this._value!==``&&e.find(e=>String(e.value)===this._value)||e.find(e=>`selected`in e&&!!e.selected);t&&(this._value=String(t.value))}_optionFor(e){let t=String(e),n=this._readOptions().find(e=>String(e.value)===t);return n?(this._known.set(t,n),n):this._known.get(t)}_placeholder(){return this.getAttribute(`placeholder`)||fo[this.mode]}_hasValue(){return Array.isArray(this._value)?this._value.length>0:this._value!==``}_selectedValues(){return Array.isArray(this._value)?this._value:this._value===``?this._listOptions().some(e=>String(e.value)===``)?[``]:[]:[this._value]}_applyValue(){this._syncMirror(),this._syncValidity(),this._rendered&&(this._drawValue(),this._syncReset(),this.renderList())}_syncMirror(){W(this.mode)?In(this,this._selectedValues()):L(this,this._value)}_drawValue(){let e=this._refs();if(!e.value)return;let t=W(this.mode),n=t?void 0:this._optionFor(this._value);this._syncTitle(n),this._syncValueAvatar(),this._activePartsList().some(e=>e.renderValue?.()===!0)||(t?(e.value.classList.remove(`wui-select-placeholder`),e.value.textContent=``):(e.value.classList.toggle(`wui-select-placeholder`,!n),e.value.innerHTML=n?kr(n):B(this._placeholder())))}_syncTitle(e){let t=this.querySelector(`.wui-select-control`);if(!t)return;let n=e&&!this.hasAttribute(`title`)?Mr(e).trim():``;n?t.setAttribute(`title`,n):t.removeAttribute(`title`)}_syncValueAvatar(){let e=this.querySelector(`.wui-select-control`);if(!e)return;e.querySelector(`:scope > .wui-select-value-avatar`)?.remove();let t=!W(this.mode)&&this._hasValue()?La({avatar:this.getAttribute(`value-avatar`),initials:this.getAttribute(`value-initials`)},`avatar-xs`):``;e.classList.toggle(`wui-has-value-avatar`,!!t),t&&e.insertAdjacentHTML(`afterbegin`,`<span class="wui-select-value-avatar" aria-hidden="true">${t}</span>`)}_syncValidity(){let e=this._internals;if(typeof e?.setValidity==`function`){if(this.hasAttribute(`required`)&&!this._hasValue()){let t=this.querySelector(`.wui-select-control`);e.setValidity({valueMissing:!0},`Please fill in this field.`,t instanceof HTMLElement?t:void 0)}else e.setValidity({})}}_syncReset(){let e=G(this,`.wui-select-reset`,HTMLElement);e&&(e.hidden=!(this.hasAttribute(`clearable`)&&this._hasValue()&&!I(this)))}_syncInvalid(){let e=this.querySelector(`.wui-select-control`);e&&(this.hasAttribute(`aria-invalid`)||this._error?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}_syncError(){let e=G(this,`.wui-select-error`,HTMLElement);e&&(e.textContent=this._error,e.hidden=!this._error),this._syncInvalid()}_refs(){return{control:G(this,`.wui-select-control`,HTMLElement),value:G(this,`.wui-select-value`,HTMLElement),menu:G(this,`.wui-select-menu`,HTMLElement),list:G(this,`.wui-select-options`,HTMLElement),search:G(this,`.wui-select-search input`,HTMLInputElement),input:G(this,`.wui-select-draft`,HTMLInputElement)}}_menuOpen(){let e=G(this,`.wui-select-menu`,HTMLElement);return e!==null&&!e.hidden}_hoverZone(e){if(!(e instanceof Element))return!1;let t=e.closest(`.wui-select-control, .wui-select-menu`);return t!==null&&this.contains(t)}_hoverEligible(){if(!this.hasAttribute(`open-on-hover`)||I(this)||this.mode===`tag`)return!1;let e=this._refs();return e.search===null&&e.input===null}_clearHover(){this._hoverTimer!==null&&clearTimeout(this._hoverTimer),this._hoverTimer=null}_autoSearch(){return this.mode===`single`&&this.getAttribute(`searchable`)===null&&this._readOptions().length>uo}_visible(){let e=this._refs();return e.list?So(e.list,`.wui-select-option`):[]}_setActive(e,{reveal:t=!0}={}){let n=this._refs();if(!n.list||!n.control)return;let r=this._visible();this._active=e;let i=e>=0?r[e]??null:null;Ha(n.list,i),i?(t&&i.scrollIntoView({block:`nearest`}),n.control.setAttribute(`aria-activedescendant`,i.id)):n.control.removeAttribute(`aria-activedescendant`)}_actionRows(){let e=[];for(let t of this._activePartsList()){let n=t.actionRow?.(this._query);n&&e.push(n)}return e}_recents(){if(this._query.trim()!==``)return null;for(let e of this._activePartsList()){let t=e.recents?.(this._listOptions());if(t)return t}return null}_place(){let e=this._refs();if(!e.control||!e.menu)return;let t=this.hasAttribute(`open`)?{below:!0}:{};if(this.getAttribute(`density`)===`compact`){let n=e.control.getBoundingClientRect();e.menu.style.width=`max-content`,e.menu.style.minWidth=`${n.width}px`,e.menu.style.maxWidth=`280px`,d(e.control,e.menu,t)}else d(e.control,e.menu,{matchWidth:!0,...t})}_open({focus:e=!0}={}){let t=this._refs();if(!t.menu||!t.control)return;let n=!t.menu.hidden;t.menu.hidden=!1,t.control.setAttribute(`aria-expanded`,`true`),t.control.classList.add(`open`),this._query=t.input?t.input.value:``,this._ownsFilter=this._ownsFilter&&this._query!==``;let r=G(this,`.wui-select-search .wui-select-clear`,HTMLElement);if(r&&(r.hidden=!0),t.search&&(t.search.value=``),this.renderList(),f(this,this._reposition),e&&(t.search?.focus(),this._setActive(this._visible().findIndex(e=>e.classList.contains(`selected`)))),!n){this.dispatchEvent(new CustomEvent(`wui-select:open`,{bubbles:!0}));for(let e of this._activePartsList())e.onOpen?.()}}_close({force:e=!1}={}){if(!e&&this.hasAttribute(`open`))return;let t=this._refs();if(!t.menu||!t.control)return;this._hoverOpened=!1;let n=!t.menu.hidden;t.menu.hidden=!0,t.control.setAttribute(`aria-expanded`,`false`),t.control.classList.remove(`open`),this._setActive(-1),this._nav?.clearTypeahead(),p(this),n&&this.dispatchEvent(new CustomEvent(`wui-select:close`,{bubbles:!0}))}_onQueryChange(e){this._query=e,this._setActive(-1);let t=G(this,`.wui-select-search .wui-select-clear`,HTMLElement);t&&(t.hidden=!e);let n=!1;for(let t of this._activePartsList())t.onQuery?.(e)===!0&&(n=!0);this._ownsFilter=n,this.renderList()}_pick(e){if(e.getAttribute(`aria-disabled`)===`true`)return;let t=e.dataset.custom===`true`,n=e.dataset.value??``,r=t?{value:n,label:Co(e).trim()}:this._listOptions().find(e=>String(e.value)===n)??{value:n,label:n},i=this._activePartsList().some(e=>e.onPick?.(r,{isCustom:t})===!0);W(this.mode)||(i||this.commit(n,{isCustom:t}),this._close(),this._refs().control?.focus())}_draftOpens(){return this.mode===`multiple`?this.hasAttribute(`allow-custom`):this.mode===`tag`&&no(this)}_onKeyDown(e){if(!I(this)){for(let t of this._activePartsList())if(t.onKey?.(e)===!0)return;if(!this._menuOpen()){if(e.target instanceof HTMLInputElement){if(e.key!==`ArrowDown`||!this._draftOpens())return;this._open({focus:!1})}else{(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this._open({focus:!0}));return}}e.key===`Escape`&&(e.preventDefault(),e.stopPropagation()),_(this._nav,`Listbox keys are not wired.`).handler(e)}}_wire(){this._teardown();let e=this._refs(),t=e.control,n=e.list;if(!t||!e.menu||!n)return;let r=_(G(this,`.wui-select`,HTMLElement),`The select wrapper is missing.`),i=G(this,`.wui-select-search .wui-select-clear`,HTMLElement),a=G(this,`.wui-select-reset`,HTMLElement);this._nav=Va({getVisibleOptions:()=>this._visible(),getActive:()=>this._active,setActive:e=>this._setActive(e),onEnter:(e,t)=>{if(e)this._pick(e);else if(this._query.trim()!==``){let e=t.find(e=>e.dataset.custom===`true`);if(e)this._pick(e);else if(t.length===1){let e=t[0];e&&this._pick(e)}}},onEscape:()=>{this._nav?.clearTypeahead(),this._close(),t.focus()}}),r.addEventListener(`keydown`,e=>this._onKeyDown(e)),r.addEventListener(`input`,e=>{let t=e.target;if(!(t instanceof HTMLInputElement)||!t.matches(`.wui-select-input, .wui-select-draft`))return;this._onQueryChange(t.value);let n=t.matches(`.wui-select-draft`),r=this._visible().length>0||this._actionRows().length>0;n&&r&&!this._menuOpen()&&!I(this)&&this._draftOpens()&&this._open({focus:!1})}),r.addEventListener(`focusout`,e=>{let t=e.relatedTarget;t instanceof Node&&this.contains(t)||!this._activePartsList().some(e=>e.onBlur?.()===!0)&&t&&this._close()}),i?.addEventListener(`click`,()=>{let t=_(e.search,`The search input is missing.`);t.value=``,this._onQueryChange(``),t.focus()}),t.addEventListener(`click`,e=>{if(!(e.target instanceof Element&&e.target.closest(`[data-remove]`))){if(this.mode===`tag`){if(I(this))return;this._refs().input?.focus(),!this._menuOpen()&&this._draftOpens()&&this._open({focus:!1})}else e.target instanceof HTMLInputElement?!this._menuOpen()&&!I(this)&&this._open({focus:!1}):(this._clearHover(),this._hoverOpened&&this._menuOpen()?(this._hoverOpened=!1,this._open({focus:!0})):this._menuOpen()?this._close():I(this)||this._open({focus:!0}))}}),a?.addEventListener(`click`,e=>{e.stopPropagation(),this.commit(W(this.mode)?[]:``),this._close(),t.focus()}),n.addEventListener(`click`,n=>{let r=xo(n).closest(`.wui-select-option`);if(r instanceof HTMLElement&&(this._pick(r),W(this.mode))){let n=this.querySelector(`.wui-select-draft`);(e.search??(n instanceof HTMLElement?n:t)).focus()}}),n.addEventListener(`mousedown`,e=>{W(this.mode)&&e.target instanceof Element&&e.target.closest(`.wui-select-option`)&&e.preventDefault()}),n.addEventListener(`mousemove`,e=>{let t=xo(e).closest(`.wui-select-option`);t instanceof HTMLElement&&!t.classList.contains(`is-active`)&&this._setActive(this._visible().indexOf(t),{reveal:!1})}),n.addEventListener(`mouseleave`,()=>this._setActive(-1)),n.addEventListener(`error`,e=>{let t=e.target;t instanceof Element&&t.classList.contains(`avatar-img`)&&t.remove()},!0),this._bindGlobal=()=>{this._teardown(),this._onDocClick=e=>{this._menuOpen()&&!e.composedPath().includes(this)&&this._close()},document.addEventListener(`click`,this._onDocClick),this._menuOpen()&&f(this,this._reposition)},this.hasAttribute(`open`)&&this._open({focus:!1}),this._bindGlobal()}_teardown(){this._onDocClick&&=(document.removeEventListener(`click`,this._onDocClick),null),p(this),this._nav?.teardown()}_activePartsList(){return this._partsMounted?_(this._parts,`The mounted parts are missing.`):[]}_ensureParts(){if(!this.isConnected)return;let e=vo(this,this.mode),t=e.join(`,`);if(t===this._partSig)return;this._teardownParts(),this._parts=null,this._partSig=t;let n=++this._partToken;Promise.all(e.map(e=>wo(this,e))).then(e=>{n===this._partToken&&(this._parts=e.filter(e=>e!==null),this._mountParts())})}_mountParts(e={draft:``,query:``}){if(!this._parts||this._partsMounted||!this._rendered||!this.isConnected)return;this._partsMounted=!0;let t=ao(this._refs());for(let n of this._parts)n.mount(this,t,{carry:e});this._drawValue(),this.renderList()}_teardownParts(){let e=this._activePartsList();this._partsMounted=!1;for(let t of e)t.teardown()}_remountParts(){if(!this._partsMounted)return;let e=this._carry();this._teardownParts(),this._mountParts(e)}_carry(){let e=this._refs();return{draft:e.input?.value??``,query:e.search?.value??``}}},ao=e=>{let{control:t,value:n,menu:r,list:i}=e;return{control:_(t,`control missing`),value:_(n,`value missing`),menu:_(r,`menu missing`),list:_(i,`list missing`),search:e.search,input:e.input}},oo=e=>Ja.includes(e),so=[`comfortable`,`compact`],co=150,lo=250,uo=10,fo={single:`Select…`,search:`Select…`,multiple:`Select…`,tag:`Add…`,country:`Select country`},po=new Set([`countries`,`suggested`,`suggested-label`,`all-countries-label`,`max-tags`,`pattern`,`collapse-chips`,`source`,`remote`,`min-chars`]),mo=new Set([`separators`,`allow-duplicates`,`invalid-message`,`create-label`,`add-label`,`selected-text`,`clear-all-label`,`value-label`,`value-avatar`,`value-initials`,`hint-text`,`recents-key`,`recents-limit`,`recents-label`]),ho=[[`icon`,`icon`],[`description`,`description`],[`meta`,`meta`],[`group`,`group`],[`avatar`,`avatar`],[`initials`,`initials`],[`disabled-hint`,`disabledHint`]],go=(e,t)=>t?Array.isArray(e)?e.map(String):e==null||e===``?[]:String(e).split(`,`).map(e=>e.trim()).filter(Boolean):Array.isArray(e)?e.length?String(e[0]):``:e==null?``:String(e),_o=(e,t)=>t===`multiple`?no(e)?[`chips`,`search`]:[`chips`]:t===`search`?[`search`]:t===`country`?[`country`]:t===`tag`?no(e)?[`chips`,`search`]:[`chips`]:[],vo=(e,t)=>e.hasAttribute(`recents-key`)?[`recents`,..._o(e,t)]:_o(e,t),yo=`This control could not load. Reload the page.`,bo=e=>typeof e==`object`&&!!e&&`default`in e&&typeof e.default==`function`,xo=e=>{if(e.target instanceof Element)return e.target;throw Error(`The event target is not an element.`)},G=(e,t,n)=>{let r=e.querySelector(t);return r instanceof n?r:null},So=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),Co=e=>{let t=e.textContent;if(t===null)throw Error(`The element has no text.`);return t},wo=(e,t)=>eo(t).then(e=>{if(!bo(e))throw Error(`The part ${t} has no default export.`);return e.default()}).catch(()=>(document.dispatchEvent(new CustomEvent(Kn,{bubbles:!0,composed:!0,detail:{chunk:t}})),e.setError(yo),null)),To=`wui-shortcuts-open-change`;function Eo(e,t){let n=e.querySelector(t);return n instanceof HTMLElement?n:null}function Do(e,t){return[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement)}var Oo=class extends g{_doc;_onKeyDown;_onClick;_onDocClick;static get observedAttributes(){return[`open`,`no-trigger`]}constructor(){super(),this._doc=null,this._onKeyDown=e=>this._keydown(e),this._onClick=e=>this._click(e),this._onDocClick=e=>{let t=y(e.target,`[data-wui-shortcuts-open]`)?.getAttribute(`data-wui-shortcuts-open`);t&&this.matches(t)?this.setOpen(!0):this.open&&!e.composedPath().includes(this)&&this.setOpen(!1,{focus:!1})}}connectedCallback(){this._doc=this.ownerDocument,this._doc.addEventListener(`keydown`,this._onKeyDown),this._doc.addEventListener(`click`,this._onDocClick),this.addEventListener(`click`,this._onClick),this.hasAttribute(`open`)&&!this.open&&this.setOpen(!0,{focus:!1}),this._place(),this._syncTrigger()}attributeChangedCallback(e,t,n){e===`no-trigger`?this._syncTrigger():this._sheet()&&n!==null!==this.open&&this.setOpen(n!==null)}disconnectedCallback(){this._doc?.removeEventListener(`keydown`,this._onKeyDown),this._doc?.removeEventListener(`click`,this._onDocClick),this.removeEventListener(`click`,this._onClick),this._doc=null}get open(){let e=this._sheet();return!(!e||e.hidden)}set open(e){let t=e===!0||e===``||e===`true`;this._sheet()?t!==this.open&&this.setOpen(t):this.toggleAttribute(`open`,t)}setOpen(e,{focus:t=!0}={}){let n=this._sheet();if(!n)return;let r=n.hidden===e;n.hidden=!e,this.toggleAttribute(`open`,e),e&&this._place();let i=Eo(this,`.wui-shortcut-toggle`);i?.setAttribute(`aria-expanded`,String(e)),r&&this.dispatchEvent(new CustomEvent(To,{bubbles:!0,detail:{open:e}})),t&&(e?Eo(n,`.wui-shortcut-close`)?.focus():i?.focus())}_sheet(){return Eo(this,`.wui-shortcut-sheet`)}_syncTrigger(){let e=Eo(this,`.wui-shortcut-toggle`);e&&(e.hidden=this.hasAttribute(`no-trigger`))}_place(){let e=this._sheet();if(!e||e.hidden)return;e.classList.remove(`wui-shortcut-sheet-below`,`wui-shortcut-sheet-start`);let t=_(this.ownerDocument.defaultView,`WuiShortcuts needs a window to place its sheet`),n={top:0,left:0,right:t.innerWidth,bottom:t.innerHeight};for(let e=this.parentElement;e&&e!==this.ownerDocument.documentElement;e=e.parentElement){let r=t.getComputedStyle(e);if(r.overflowX===`visible`&&r.overflowY===`visible`)continue;let i=e.getBoundingClientRect();n.top=Math.max(n.top,i.top),n.left=Math.max(n.left,i.left),n.right=Math.min(n.right,i.right),n.bottom=Math.min(n.bottom,i.bottom)}let r=e.getBoundingClientRect();r.top<n.top&&e.classList.add(`wui-shortcut-sheet-below`),r.left<n.left&&e.classList.add(`wui-shortcut-sheet-start`)}_scope(){let e=this.closest(`[${x}]`);return e instanceof HTMLElement?e:null}_items(){let e=this.getAttribute(`items`);return e?Do(_(this._scope()??this._doc,`WuiShortcuts used before it was connected`),e):[]}_click(e){let t=e.target;t instanceof Element&&(t.closest(`.wui-shortcut-toggle`)?this.setOpen(!this.open):t.closest(`.wui-shortcut-close`)&&this.setOpen(!1))}_tickFocused(){let e=this._items(),t=_(this._doc,`WuiShortcuts used before it was connected`).activeElement,n=t?.closest?.(`li, tr`),r=e.find(e=>e===t||e.contains(t)||n?.contains(e)),i=(r?.closest(`li, tr`)??r)?.querySelector(`input[type="checkbox"]`);i instanceof HTMLInputElement&&i.click()}_focusSearch(){let e=this.getAttribute(`search`);if(!e)return;let t=_(this._doc,`WuiShortcuts used before it was connected`);(Eo(this._scope()??t,e)??Eo(t,e))?.focus()}_keydown(e){if(e.defaultPrevented)return;let t=ne(e);if(!t)return;if(t===`esc`&&this.open){e.preventDefault(),this.setOpen(!1);return}let n=this._scope(),r={help:()=>this.setOpen(!this.open)};if(this.getAttribute(`items`)&&(r.j=()=>ue(this._items(),1),r.k=()=>ue(this._items(),-1),r.x=()=>this._tickFocused()),this.getAttribute(`search`)&&(r.slash=()=>this._focusSearch()),r[t]){le(e,r,n);return}if(t===`enter`)return;let i=_(this._doc,`WuiShortcuts used before it was connected`),a=e.target instanceof Node?e.target:null;if(se(i)||!ce(a,n)||ae(a))return;let o=re(t),s=Do(this,`.wui-shortcut-keys [data-shortcut]`).find(e=>e.dataset.shortcut===o);if(!s)return;let c=(n??i).querySelector(`[aria-current="true"]`)?.closest(`[data-key]`),l=c instanceof HTMLElement?c.dataset.key??null:null;if(!this.dispatchEvent(new CustomEvent(`wui:shortcut`,{bubbles:!0,cancelable:!0,detail:{key:o,itemKey:l}}))){e.preventDefault();return}let u=s.dataset.target,d=u?Eo(i,u):null;d&&(e.preventDefault(),d.click())}},ko=3,Ao=`Show more`,jo=`Show less`,Mo=class extends g{_width;_observer;_toggle;_onClick;constructor(){super(),this._width=-1,this._observer=null,this._toggle=null,this._onClick=()=>this.toggle()}connectedCallback(){let e=this.querySelector(`.wui-show-more-toggle`);if(this._toggle=e instanceof HTMLButtonElement?e:null,!this._toggle)return;let t=Number.parseInt(this.getAttribute(`lines`)??``,10);this.style.setProperty(`--wui-show-more-lines`,String(t>=1?t:ko)),this._toggle.addEventListener(`click`,this._onClick),this._sync(),this._check(),typeof ResizeObserver<`u`&&(this._observer=new ResizeObserver(()=>{this.clientWidth!==this._width&&this._check()}),this._observer.observe(this))}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._toggle?.removeEventListener(`click`,this._onClick),this._toggle=null}get expanded(){return this.hasAttribute(`expanded`)}toggle(e=!this.expanded){this.toggleAttribute(`expanded`,!!e),this._sync(),this.dispatchEvent(new CustomEvent(`wui:show-more:toggle`,{bubbles:!0,detail:{expanded:this.expanded}}))}_sync(){let e=_(this._toggle,`WuiShowMore used before it was connected`),t=this.expanded;e.setAttribute(`aria-expanded`,String(t)),e.textContent=t?this.getAttribute(`less-label`)||jo:this.getAttribute(`more-label`)||Ao}_check(){let e=this.querySelector(`.wui-show-more-body`);if(!(e instanceof HTMLElement))return;this._width=this.clientWidth;let t=this.expanded;t&&this.removeAttribute(`expanded`);let n=e.scrollHeight>e.clientHeight+1;t&&this.setAttribute(`expanded`,``);let r=_(this._toggle,`WuiShowMore used before it was connected`);r.hidden=!n}},No=class extends g{_measure;_resize;_mutation;_ownTabindex;constructor(){super(),this._measure=()=>this.measure(),this._resize=null,this._mutation=null,this._ownTabindex=!1}connectedCallback(){this.measure(),this.addEventListener(`mouseover`,this._measure),typeof ResizeObserver<`u`&&(this._resize=new ResizeObserver(this._measure),this._resize.observe(this)),this._mutation=new MutationObserver(this._measure),this._mutation.observe(this,{childList:!0,subtree:!0,characterData:!0})}disconnectedCallback(){this.removeEventListener(`mouseover`,this._measure),this._resize?.disconnect(),this._mutation?.disconnect(),this._resize=null,this._mutation=null}measure(){let e=this.querySelector(`.wui-truncate-text`);e&&(e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight?(this.setAttribute(`data-wui-tip`,(e.textContent??``).replace(/\s+/g,` `).trim()),this.hasAttribute(`tabindex`)||(this.setAttribute(`tabindex`,`0`),this._ownTabindex=!0)):(this.removeAttribute(`data-wui-tip`),this._ownTabindex&&=(this.removeAttribute(`tabindex`),!1)))}},Po=`wui-whats-new-read`,Fo=`wui-whats-new:`,Io=`data-open`,Lo=`data-wui-unread`,Ro=0,zo=e=>{let t=Date.parse(e);return Number.isNaN(t)?-1/0:t},Bo=(e,t)=>zo(t)>zo(e)?t:e,Vo=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},Ho=class extends g{_doc;_stored;_observer;_onTriggerClick;_onKeyDown;_onPointerDown;static get observedAttributes(){return[`storage-key`,`read-through`,`indicator`]}constructor(){super(),this._doc=null,this._stored=``,this._observer=null,this._onTriggerClick=()=>this.isOpen?this.close(!0):this.open(),this._onKeyDown=e=>{e.key===`Escape`&&this.isOpen&&(e.stopPropagation(),this.close(!0))},this._onPointerDown=e=>{this.isOpen&&!e.composedPath().includes(this)&&this.close(!1)}}get isOpen(){return this.hasAttribute(Io)}get _trigger(){return Vo(this,`.wui-whats-new-trigger`)}get _panel(){return Vo(this,`.wui-whats-new-panel`)}get _dot(){return Vo(this,`.wui-whats-new-dot`)}connectedCallback(){this._doc=this.ownerDocument;let e=this._panel,t=this._trigger;e&&t&&(e.id||=`wui-whats-new-${++Ro}`,t.setAttribute(`aria-controls`,e.id),t.setAttribute(`aria-expanded`,`false`),t.addEventListener(`click`,this._onTriggerClick),this.addEventListener(`keydown`,this._onKeyDown),this._stored=this._load(),this._refresh(),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(()=>this._refresh()),this._observer.observe(e,{childList:!0,subtree:!0})))}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._trigger?.removeEventListener(`click`,this._onTriggerClick),this.removeEventListener(`keydown`,this._onKeyDown),this._doc?.removeEventListener(`pointerdown`,this._onPointerDown,!0),p(this),this.removeAttribute(Io),this._doc=null}attributeChangedCallback(e,t,n){t!==n&&this._doc&&(e===`storage-key`&&(this._stored=this._load()),this._refresh())}open(){let e=this._panel;e&&!this.isOpen&&(this.setAttribute(Io,``),this._trigger?.setAttribute(`aria-expanded`,`true`),this._place(),f(this,()=>this._place()),this.ownerDocument.addEventListener(`pointerdown`,this._onPointerDown,!0),e.focus({preventScroll:!0}),this._markRead())}close(e){this.isOpen&&(this.removeAttribute(Io),this._trigger?.setAttribute(`aria-expanded`,`false`),this.ownerDocument.removeEventListener(`pointerdown`,this._onPointerDown,!0),p(this),this._refresh(),e&&this._trigger?.focus())}_place(){d(this._trigger,this._panel,{clampHeight:!0})}_entries(){let e=[];for(let t of this.querySelectorAll(`.wui-whats-new-entry`))t instanceof HTMLElement&&e.push({entry:t,date:t.querySelector(`time[datetime]`)?.getAttribute(`datetime`)??``});return e}_newest(){return this._entries().reduce((e,{date:t})=>Bo(e,t),``)}_seenPoint(){return Bo(this._stored,this.getAttribute(`read-through`)??``)}_refresh(){let e=this._seenPoint(),t=this._entries(),n=0;for(let{entry:r,date:i}of t){let t=zo(i)>zo(e);t&&n++,this.isOpen&&r.hasAttribute(Lo)||r.toggleAttribute(Lo,t)}this.toggleAttribute(Lo,n>0);let r=this._dot;r&&(r.textContent=this.getAttribute(`indicator`)===`count`&&n>0?String(n):``)}_markRead(){let e=this._newest();!e||zo(e)<=zo(this._seenPoint())||(this._stored=Bo(this._stored,e),this._save(this._stored),this._refresh(),this.dispatchEvent(new CustomEvent(Po,{bubbles:!0,detail:{through:e}})))}_storage(){let e=this.getAttribute(`storage-key`);if(!e)return null;try{let t=this.ownerDocument.defaultView;return t?{store:t.localStorage,key:Fo+e}:null}catch{return null}}_load(){let e=this._storage();return e?e.store.getItem(e.key)??``:this._stored}_save(e){let t=this._storage();t&&t.store.setItem(t.key,e)}},Uo=n({APP_BUTTON_MARKER:()=>Wo,buttonClass:()=>Jo}),Wo=`AppButton`,Go=new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),Ko={solid:e=>`btn-${e}`,soft:e=>`btn-soft-${e}`,outline:e=>`btn-outline-${e}`,ghost:e=>`btn-ghost-${e}`,link:e=>`btn-link-${e}`,glass:()=>`btn-glass`};function qo(e){return Object.hasOwn(Ko,e)}function Jo(e=`primary`,t=`solid`,n=`md`){if(!Go.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!qo(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=Ko[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}var Yo=n({COPY_FEEDBACK_MS:()=>Xo,copyTextToClipboard:()=>Zo}),Xo=2e3;async function Zo(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch(e){if(!(e instanceof DOMException))throw e}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.top=`0`,t.style.left=`0`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),!!n}catch(e){if(!(e instanceof DOMException))throw e;return!1}}var Qo=n({MENTION_ID_PATTERN:()=>$o,mentionLabel:()=>ns,mentionTextFromValue:()=>as,mentionValueFromText:()=>os,mentionedIds:()=>ss,parseMentionValue:()=>is}),$o=/^[A-Za-z0-9_.:-]{1,64}$/,es=/@(\\+)\[|@\[([^[\]\n]{1,100})\]\(([A-Za-z0-9_.:-]{1,64})\)/g,ts=/@(\\*)\[/g;function ns(e){return String(e??``).replace(/[[\]\r\n]+/g,` `).replace(/\s+/g,` `).trim().slice(0,100)}var rs=e=>e.replace(ts,(e,t)=>`@\\${t}[`);function is(e){let t=String(e??``),n=[],r=e=>{if(!e)return;let t=n[n.length-1];t&&`text`in t?t.text+=e:n.push({text:e})},i=0;for(let e of t.matchAll(es))r(t.slice(i,e.index)),e[1]===void 0?n.push({id:e[3]??``,label:e[2]??``}):r(`@${e[1].slice(1)}[`),i=e.index+e[0].length;return r(t.slice(i)),n}function as(e){let t=``,n=[];for(let r of is(e)){if(`text`in r){t+=r.text;continue}let e=`@${r.label}`;n.push({start:t.length,end:t.length+e.length,id:r.id,label:r.label}),t+=e}return{text:t,mentions:n}}function os(e,t=[]){let n=String(e??``),r=[...t].sort((e,t)=>e.start-t.start),i=``,a=0;for(let e of r)e.start<a||n.slice(e.start,e.end)!==`@${e.label}`||!$o.test(e.id)||(i+=rs(n.slice(a,e.start)),i+=`@[${e.label}](${e.id})`,a=e.end);return i+rs(n.slice(a))}function ss(e){let t=[];for(let n of is(e))`id`in n&&!t.includes(n.id)&&t.push(n.id);return t}var cs=n({deriveStepStatus:()=>ls,stepperHeaderItems:()=>us});function ls(e,t){return typeof t==`number`?e<t?`done`:e===t?`active`:`pending`:`pending`}function us(e,t){let{statusOf:n,journey:r,connectors:i}=t;return e.map((t,a)=>{let o=n(a),s;return s=o===`done`?{icon:`check`}:o===`error`?{icon:`alert-triangle`}:o===`skipped`?{icon:`minus`}:t.icon?{icon:t.icon}:{number:a+1},{index:a,status:o,className:o===`pending`?`step`:`step ${o}`,glyph:s,current:o===`active`,line:r&&i&&a<e.length-1?{done:o===`done`}:null}})}var ds=n({SELECT_ALL_LABEL:()=>fs,SELECT_CELL_CLASS:()=>K,SELECT_ROW_LABEL:()=>ps,addRowSelectCells:()=>xs,addSelectColumn:()=>Ss,attachShiftRange:()=>Ts,createSelectHeaderCell:()=>hs,createSelectRowCell:()=>gs,createSelectSpacerCell:()=>_s,syncSelectAll:()=>Cs}),fs=`Select all rows`,ps=`Select row`,K=`wui-select-cell`,ms=(e,t)=>{let n=e.createElement(`input`);return n.type=`checkbox`,n.className=`wui-check`,n.setAttribute(`aria-label`,t),n};function hs(e=document){let t=e.createElement(`th`);return t.className=K,t.appendChild(ms(e,fs)),t}function gs(e=document,{disabled:t=!1}={}){let n=e.createElement(`td`);n.className=K;let r=ms(e,ps);return r.disabled=t,n.appendChild(r),n}function _s(e=document){let t=e.createElement(`td`);return t.className=K,t}var vs=e=>e.firstElementChild?.classList.contains(K),ys=e=>e.matches(`.wui-group-row, .wui-virtual-spacer`),bs=(e,t,n)=>[...e.querySelectorAll(t)].filter(e=>e instanceof n);function xs(e){for(let t of e){if(vs(t)||ys(t))continue;let e=t.getAttribute(`data-row-selectable`)===`false`;t.insertBefore(gs(t.ownerDocument,{disabled:e}),t.firstChild)}}function Ss(e){let t=e.querySelector(`thead tr`);if(!(t instanceof HTMLTableRowElement))return null;vs(t)||t.insertBefore(hs(e.ownerDocument),t.firstChild),xs(bs(e,`tbody tr`,HTMLTableRowElement));for(let t of bs(e,`tfoot tr`,HTMLTableRowElement))vs(t)||t.insertBefore(_s(e.ownerDocument),t.firstChild);let n=t.querySelector(`.${K} .wui-check`);return n instanceof HTMLInputElement?n:null}function Cs(e){let t=e.querySelector(`thead .${K} .wui-check`),n=bs(e,`tbody tr .wui-check:not(:disabled)`,HTMLInputElement),r=n.length,i=n.filter(e=>e.checked).length;t instanceof HTMLInputElement&&(t.checked=r>0&&i===r,t.indeterminate=i>0&&i<r);for(let t of bs(e,`tbody tr`,HTMLTableRowElement)){let e=t.querySelector(`.wui-check`);t.classList.toggle(`is-selected`,e instanceof HTMLInputElement&&e.checked)}return{selected:i,total:r}}var ws=`tbody .${K} .wui-check:not(:disabled)`;function Ts(e,t){let n=null,r=e=>e instanceof Element&&e.matches(`.wui-select-cell .wui-check:not(:disabled)`)&&!!e.closest(`tbody`);e.addEventListener(`mousedown`,e=>{e.shiftKey&&r(e.target)&&e.preventDefault()}),e.addEventListener(`click`,i=>{let a=i.target;if(r(a)){if(i.shiftKey&&n?.isConnected&&n!==a){let r=bs(e,ws,HTMLInputElement),i=r.indexOf(n),o=r.indexOf(a);if(i>=0&&o>=0){let e=[];for(let t of r.slice(Math.min(i,o),Math.max(i,o)+1))t!==a&&t.checked!==a.checked&&(t.checked=a.checked,e.push(t));e.length&&t?.(e,a.checked)}}n=a}})}var Es=n({matchSegments:()=>Ds});function Ds(e,t){let n=String(e??``),r=String(t??``).trim();if(!r||!n)return[{text:n,match:!1}];let i=n.toLowerCase(),a=r.toLowerCase();if(i.length!==n.length)return[{text:n,match:!1}];let o=[],s=0,c=i.indexOf(a,s);for(;c!==-1;)c>s&&o.push({text:n.slice(s,c),match:!1}),o.push({text:n.slice(c,c+a.length),match:!0}),s=c+a.length,c=i.indexOf(a,s);return s<n.length&&o.push({text:n.slice(s),match:!1}),o}var Os=Object.freeze({anchorOverlay:a,buttonClass:Uo,calendarMath:_n,copyText:Yo,dataTable:Et,defineElement:r,devWarn:Rn,elementBase:m,fieldState:On,formatters:ze,formMirror:Mn,glyphs:fr,iconGlyphs:fr,listboxKeyNav:za,loader:Wn,mentionText:Qo,notificationDays:$r,optionLabel:Cr,partRegistry:Ya,selectList:Ua,selectRemote:to,stepperHeader:cs,tableSelect:ds,textMatch:Es,wuiHttp:fi,WuiSelect:ro,zone:De}),ks=`image/jpeg,image/png,image/webp,image/heic,image/heif,.heic,.heif`,As=10,js=512,Ms=`image/webp`,Ns=[96,48],Ps={dialogTitle:`Edit photo`,dialogSubtitle:`Drag to position the photo, then zoom or rotate it.`,save:`Save photo`,cancel:`Cancel`,choose:`Upload photo`,change:`Change photo`,camera:`Take photo`,remove:`Remove photo`,unreadable:`That photo could not be opened. Choose a JPG, PNG or WebP image.`,heicUnreadable:`This browser cannot open HEIC photos. Choose a JPG, PNG or WebP image instead.`,cropFailed:`That photo could not be saved. Try again, or choose another one.`};function Fs(e){if(!e)return!1;let t=String(e.type||``).toLowerCase();return t===`image/heic`||t===`image/heif`||/\.hei[cf]$/i.test(String(e.name||``))}function Is(e){return Fs(e)?Ps.heicUnreadable:Ps.unreadable}function Ls(e,t){let n=Number(t);return{name:e?.name||`photo`,type:Ms,size:Number.isInteger(n)&&n>0?n:512}}var Rs=`/`,zs=`.search-wrap.wui-search-collapsible`,Bs=`.wui-topsearch-panel`,Vs=`.modal, wui-drawer[open]`,Hs=new WeakSet,Us=e=>{let t=e.querySelector(`.wui-search-toggle`);return t instanceof HTMLElement?t:null},Ws=e=>{let t=e.querySelector(`.search-input`);return t instanceof HTMLInputElement?t:null},Gs=e=>[...e.querySelectorAll(zs)].filter(e=>e instanceof HTMLElement);function Ks(e){e.classList.remove(`is-collapsed`),Us(e)?.setAttribute(`aria-expanded`,`true`),Ws(e)?.focus()}function qs(e){Ws(e)?.value||(e.classList.add(`is-collapsed`),Us(e)?.setAttribute(`aria-expanded`,`false`))}function Js(e){if(e.dataset.wuiCollapseWired)return;e.dataset.wuiCollapseWired=`1`;let t=Us(e),n=Ws(e);t?.addEventListener(`click`,()=>Ks(e)),n?.addEventListener(`keydown`,r=>{r.key!==`Escape`||n?.value||(r.preventDefault(),qs(e),t?.focus())}),e.addEventListener(`focusout`,t=>{let n=t.relatedTarget;n instanceof Node&&e.contains(n)||qs(e)})}function Ys(e){Hs.has(e)||(Hs.add(e),e.addEventListener(`keydown`,t=>{if(t.key!==`/`||t.ctrlKey||t.altKey||t.metaKey||t.defaultPrevented||ae(t.target instanceof Node?t.target:null)||t.target instanceof Element&&t.target.closest(Vs)||e.querySelector(Bs))return;let n=Gs(e).find(e=>e.offsetParent!==null);n&&(t.preventDefault(),Ks(n))}))}function Xs(e=document){let t=e;for(let e of Gs(t))Js(e);Ys(e instanceof Element?e.ownerDocument:e)}var Zs=`data-wui-command-shortcut`,Qs=`k`,$s=new WeakSet;function ec(e,t){return!(e.ctrlKey||e.metaKey)||e.altKey||e.shiftKey||e.repeat?!1:String(e.key).toLowerCase()===String(t).toLowerCase()}function tc(e){return e.nodeType===Node.DOCUMENT_NODE}function nc(e){let t=_(window.bootstrap?.Modal,`data-wui-command-shortcut: Bootstrap's bundle (window.bootstrap) is not loaded on this page.`),n=e.closest(`.modal`);n&&t.getOrCreateInstance(n).show()}function rc(e){let t=tc(e)?e:e.ownerDocument;!$s.has(t)&&e.querySelector(`[data-wui-command-shortcut]`)&&($s.add(t),t.addEventListener(`keydown`,e=>{for(let n of t.querySelectorAll(`[${Zs}]`))if(ec(e,n.getAttribute(`data-wui-command-shortcut`)||Qs)){e.preventDefault(),n.localName===`wui-command-palette`||n.classList.contains(`modal`)?nc(n):(n.focus(),`select`in n&&typeof n.select==`function`&&n.select());return}}))}var ic=`image/png,image/jpeg,image/webp`,ac=5,oc={"image/png":[`.png`],"image/jpeg":[`.jpg`,`.jpeg`],"image/webp":[`.webp`],"image/gif":[`.gif`],"image/svg+xml":[`.svg`],"image/heic":[`.heic`],"image/heif":[`.heif`],"application/pdf":[`.pdf`],"text/plain":[`.txt`]},sc={"image/png":`PNG`,"image/jpeg":`JPG`,"image/webp":`WEBP`,"image/gif":`GIF`,"image/svg+xml":`SVG`,"image/heic":`HEIC`,"image/heif":`HEIC`,"application/pdf":`PDF`,"text/plain":`text file`,"image/*":`images`,"video/*":`videos`,"audio/*":`audio`,".png":`PNG`,".jpg":`JPG`,".jpeg":`JPG`,".webp":`WEBP`,".gif":`GIF`,".svg":`SVG`,".heic":`HEIC`,".heif":`HEIC`,".pdf":`PDF`,".txt":`text file`},cc=e=>String(e||``).split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean),lc=[`.png`,`.jpg`,`.jpeg`,`.webp`,`.gif`,`.svg`,`.bmp`,`.avif`,`.heic`,`.heif`];function uc(e){if(!e)return!1;let t=typeof e==`object`&&e.type?String(e.type).toLowerCase():``;if(t)return t.startsWith(`image/`);let n=typeof e==`string`?e:e.name||e.url||``,r=String(n).toLowerCase();return lc.some(e=>r.endsWith(e))}var dc=[`KB`,`MB`,`GB`];function fc(e){if(e<1024)return`${e} B`;let t=e/1024,n=0;for(;t>=1024&&n<dc.length-1;)t/=1024,n+=1;return`${t.toFixed(1)} ${dc[n]}`}function pc(e){if(!e)return!1;let t=typeof e==`object`&&e.type?String(e.type).toLowerCase():``;if(t)return t===`application/pdf`;let n=typeof e==`string`?e:e.name||e.url||``;return String(n).toLowerCase().replace(/[?#][\s\S]*$/,``).endsWith(`.pdf`)}function mc(e){let t=cc(e);return t.length?t.every(e=>e.startsWith(`.`)?lc.includes(e):e===`image/*`||e.startsWith(`image/`)):!1}function hc(e){let t=[];for(let n of cc(e)){let e=sc[n]||(n.startsWith(`.`)?n.slice(1).toUpperCase():n.toUpperCase());t.includes(e)||t.push(e)}return t.length<=1?t[0]||`supported`:`${t.slice(0,-1).join(`, `)} or ${t[t.length-1]}`}function gc(e,t){let n=cc(t);if(!n.length)return!0;let r=(e.type||``).toLowerCase(),i=(e.name||``).toLowerCase();return n.some(e=>e.startsWith(`.`)?i.endsWith(e):e.endsWith(`/*`)?r.startsWith(e.slice(0,-1)):r&&r===e?!0:!r&&(oc[e]||[]).some(e=>i.endsWith(e)))}function _c(e,t={}){if(!e)return null;let n=t.accept===void 0?ic:t.accept,r=t.maxSizeMb===void 0?5:t.maxSizeMb;if(!gc(e,n)){let e=hc(n),t=cc(n).map(e=>[`images`,`videos`,`audio`].includes(sc[e]??``));return t.every(Boolean)?`Choose ${e}.`:t.some(Boolean)?`Choose ${e.endsWith(` file`)?`${e}s`:`${e} files`}.`:`Choose a ${e.endsWith(` file`)?e:`${e} file`}.`}return r!==null&&r>0&&e.size>r*1024*1024?`Keep the file under ${r} MB.`:null}function vc(e,t){let n=Array.from(e||[]),r=t.multiple?n:n.slice(0,1),i=[],a=[];for(let e of r){let n=_c(e,{accept:t.accept,maxSizeMb:t.maxSizeMb});n?a.push({file:e,message:n}):i.push(e)}return{files:i,rejections:a}}function yc(e,t){let{overClass:n,isDisabled:r=()=>!1,onFiles:i,onReject:a,...o}=t,s=0,c=t=>e.classList.toggle(n,t),l=e=>{e.preventDefault(),r()||(s+=1,c(!0))},u=e=>{e.preventDefault(),r()||c(!0)},d=e=>{e.preventDefault(),r()||(s=Math.max(0,s-1),s===0&&c(!1))},f=e=>{if(e.preventDefault(),s=0,c(!1),r())return;let{files:t,rejections:n}=vc(e.dataTransfer?.files,o);t.length&&i(t);let l=n[0];l&&a(l)};return e.addEventListener(`dragenter`,l),e.addEventListener(`dragover`,u),e.addEventListener(`dragleave`,d),e.addEventListener(`drop`,f),()=>{e.removeEventListener(`dragenter`,l),e.removeEventListener(`dragover`,u),e.removeEventListener(`dragleave`,d),e.removeEventListener(`drop`,f)}}var bc=/[0-9]/,xc={9:bc,A:/[A-Za-z]/,"*":/[0-9A-Za-z]/},Sc=/[9A*]/,Cc=new Set([`text`,`tel`,`search`,`url`,`password`]),wc=e=>{let t=e.replace(/\D/g,``);return t.length===12&&t.startsWith(`91`)?t.slice(2):t.length===11&&t.startsWith(`0`)?t.slice(1):e},Tc=e=>{let t=Number(e.slice(0,2)),n=Number(e.slice(2,4)),r=Number(e.slice(4,8));if(r<1)return!1;let i=new Date(Date.UTC(r,n-1,t));return i.getUTCFullYear()===r&&i.getUTCMonth()===n-1&&i.getUTCDate()===t},Ec=e=>e.length<=3?e:`${e.slice(0,-3).replace(/\B(?=(\d{2})+(?!\d))/g,`,`)},${e.slice(-3)}`,Dc=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());return t?`${t[3]}-${t[2]}-${t[1]}`:e};function Oc(e,{upper:t=!1,normalize:n,valid:r,post:i=e=>e,message:a=`Enter the full value`}={}){let o=[...e].map(e=>{let t=xc[e];return t?{re:t}:{lit:e}}),s=o.filter(e=>e.re).length;return{inputMode:o.every(e=>!e.re||e.re===bc)?`numeric`:`text`,normalize:n,post:i,message:a,extract(e){let n=``,r=0;for(let i of e){for(;r<o.length&&o[r]?.lit!==void 0&&o[r]?.lit!==i;)r++;if(r>=o.length)break;let e=o[r];e?.lit===void 0?e?.re.test(i)&&(n+=t?i.toUpperCase():i,r++):r++}return n},layout(e){let t=``,n=[],r=0;for(let i=0;i<o.length&&r<e.length;i++){let a=o[i];a?.lit===void 0?(t+=e.charAt(r++),n.push(!0)):(t+=a.lit,n.push(!1))}return{text:t,isRaw:n}},isValid:e=>e.length===s&&(!r||r(e))}}function kc(){return{inputMode:`decimal`,post:e=>e,message:`Enter a valid amount`,extract(e){let t=``,n=!1,r=0;for(let i of e)bc.test(i)?n?r<2&&(t+=i,r++):t+=i:i===`.`&&!n&&(n=!0,t+=i);return t.startsWith(`.`)&&(t=`0${t}`),t.replace(/^0+(?=\d)/,``)},layout(e){let[t=``,n]=e.split(`.`),r=Ec(t)+(e.includes(`.`)?`.${n}`:``);return{text:r,isRaw:[...r].map(e=>e!==`,`)}},isValid:e=>/^\d+(\.\d{1,2})?$/.test(e)}}var Ac={"phone-in":()=>Oc(`99999 99999`,{normalize:wc,valid:e=>/^[6-9]/.test(e),message:`Enter a 10-digit mobile number`}),pan:()=>Oc(`AAAAA9999A`,{upper:!0,valid:e=>/^[A-Z]{5}\d{4}[A-Z]$/.test(e),message:`Enter a valid PAN`}),gstin:()=>Oc(`99AAAAA9999A***`,{upper:!0,valid:e=>/^\d{2}[A-Z]{5}\d{4}[A-Z][1-9A-Z]Z[0-9A-Z]$/.test(e),message:`Enter a valid GSTIN`}),aadhaar:()=>Oc(`9999 9999 9999`,{valid:e=>/^[2-9]/.test(e),message:`Enter a valid 12-digit Aadhaar number`}),ifsc:()=>Oc(`AAAA*******`,{upper:!0,valid:e=>/^[A-Z]{4}0[A-Z0-9]{6}$/.test(e),message:`Enter a valid IFSC`}),"pin-code":()=>Oc(`999999`,{valid:e=>/^[1-9]/.test(e),message:`Enter a valid 6-digit PIN code`}),date:()=>Oc(`99-99-9999`,{normalize:Dc,valid:Tc,post:(e,t)=>e.length===8&&Tc(e)?`${e.slice(4)}-${e.slice(2,4)}-${e.slice(0,2)}`:t,message:`Enter a valid date as DD-MM-YYYY`}),amount:kc},jc=Object.keys(Ac),Mc=e=>{let t=String(e).toLowerCase();return Object.hasOwn(Ac,t)?t:void 0},Nc=e=>Sc.test(String(e))&&Mc(e)===void 0,Pc=new Map;function Fc(e){if(e==null||e===``)return null;let t=String(e),n=Pc.get(t);return n===void 0&&(n=Nc(t)?Oc(t):Object.hasOwn(Ac,t)?Ac[t]?.()??null:null,Pc.set(t,n)),n}var Ic=(e,t)=>e.normalize?e.normalize(t):t;function Lc(e,t){let n=Fc(e);return n?n.extract(Ic(n,String(t??``))):String(t??``)}function Rc(e,t){let n=Fc(e);if(!n)return String(t??``);let r=n.extract(Ic(n,String(t??``)));return n.post(r,n.layout(r).text)}function zc(e,t){let n=Fc(e);return n?n.layout(n.extract(Ic(n,String(t??``)))).text:String(t??``)}var Bc=(e,t)=>{if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(e[r]&&++n===t)return r+1;return e.length},Vc=new WeakMap,Hc=e=>Vc.get(e)?.(),Uc=new WeakMap;function Wc(e,t,n,r){let i=e.getAll(t),a=Uc.get(e)??new Set;Uc.set(e,a);let o=i.findIndex((e,r)=>e===n&&!a.has(`${t}\u0000${r}`));if(!(o<0)){if(a.add(`${t}\u0000${o}`),i[o]=r,i.length===1)e.set(t,r);else{e.delete(t);for(let n of i)e.append(t,n)}}}function Gc(e){let t=null,n=null,r=!1,i=(t,n)=>{n===null?e.removeAttribute(t):n!==void 0&&e.setAttribute(t,n)},a,o,s=()=>{t?.remove(),t=null,n&&(n.hidden=!1),n=null,r&&e.classList.remove(`error`),r=!1,i(`aria-invalid`,a),i(`aria-describedby`,o),a=void 0,o=void 0};return i=>{if(!i){s();return}let c=e.closest(`.field`),l=c instanceof HTMLElement?c:null,u=l?.querySelector(`.field-error`);if(!(u&&u!==t&&u.textContent?.trim())){if(!t){if(r=!e.classList.contains(`error`),e.classList.add(`error`),a=e.getAttribute(`aria-invalid`),o=e.getAttribute(`aria-describedby`),l){t=document.createElement(`div`),t.className=`field-error`,e.id&&(t.id=`${e.id}-error`);let r=l.querySelector(`.field-hint`);n=r instanceof HTMLElement?r:null,n&&(n.hidden=!0),l.insertBefore(t,[...l.children].find(e=>e.classList.contains(`field-count`))??null),t.id&&e.setAttribute(`aria-describedby`,t.id)}e.setAttribute(`aria-invalid`,`true`)}t&&(t.textContent=i)}}}function Kc(e,{mask:t,postFormatted:n=!1,onChange:r,onInvalidChange:i}={}){let a=Fc(t);if(!a||!Cc.has(e.type))return()=>{};let o=Object.getPrototypeOf(e),s=Object.getOwnPropertyDescriptor(o,`value`);if(!s?.set)throw Error(`input value setter missing`);let c=s.set,l=!e.hasAttribute(`inputmode`);l&&e.setAttribute(`inputmode`,a.inputMode);let u=i??Gc(e),d=null,f=!1,p=!1,m=!1,h=``,g=``,v,y=()=>{let e=m?h:``;e!==g&&(g=e,u(g))},b=(t,n,i)=>{let o=a.extract(t.slice(0,n)).length,s=a.extract(t),{text:l,isRaw:u}=a.layout(s);if(e.value!==l&&(c.call(e,l),document.activeElement===e&&Cc.has(e.type))){let t=Bc(u,o);e.setSelectionRange(t,t)}e.dataset.maskRaw=s,h=s&&!a.isValid(s)?a.message:``,e.setCustomValidity(h),y(),i&&s!==d&&r?.(s,l),d=s},x=Object.getOwnPropertyDescriptor(e,`value`),S=x??s;Object.defineProperty(e,"value",{configurable:!0,...S.enumerable===void 0?{}:{enumerable:S.enumerable},get:()=>_(S.get,`input value getter missing`).call(e),set:t=>{if(_(S.set,`input value setter missing`).call(e,t),p)return;let n=Ic(a,e.value);b(n,n.length,!0)}});let C=()=>{f=!0,e.dispatchEvent(new Event(`input`,{bubbles:!0})),f=!1},w=t=>{let n=t instanceof InputEvent?t:null;if(f||p||n?.isComposing)return;let r=n?.inputType===`insertText`&&(n.data?.length??0)<=1||n?.inputType?.startsWith(`delete`)?e.value:Ic(a,e.value);b(r,e.selectionStart??r.length,!0)},ee=()=>{p=!0},T=()=>{p=!1;let t=Ic(a,e.value);b(t,e.selectionStart??t.length,!0),C()},E=t=>{let n=t.inputType===`deleteContentBackward`;if(!n&&t.inputType!==`deleteContentForward`||t.isComposing)return;let r=e.selectionStart;if(r==null||r!==e.selectionEnd)return;let{isRaw:i}=a.layout(a.extract(e.value)),o=n?r-1:r;for(;o>=0&&o<i.length&&!i[o];)o+=n?-1:1;o!==(n?r-1:r)&&(t.preventDefault(),o<0||o>=i.length||(b(e.value.slice(0,o)+e.value.slice(o+1),n?o:r,!0),C()))},D=t=>{if(e.readOnly||e.disabled)return;let n=t.clipboardData?.getData(`text`);if(n==null)return;t.preventDefault();let r=Ic(a,n),i=e.selectionStart??e.value.length,o=e.selectionEnd??i;b(e.value.slice(0,i)+r+e.value.slice(o),i+r.length,!0),C()},te=()=>{let t=a.extract(e.value);return a.post(t,a.layout(t).text)},O=()=>{m=!0,y()};e.addEventListener(`input`,w),e.addEventListener(`beforeinput`,E),e.addEventListener(`paste`,D),e.addEventListener(`compositionstart`,ee),e.addEventListener(`compositionend`,T),e.addEventListener(`blur`,O),e.addEventListener(`invalid`,O);let k=e.form,ne=t=>{e.name&&!e.disabled&&Wc(t.formData,e.name,e.value,te())},re=()=>{clearTimeout(v),v=setTimeout(()=>{m=!1,b(Ic(a,e.value),e.value.length,!0)},0)};n||(k?.addEventListener(`formdata`,ne),Vc.set(e,te)),k?.addEventListener(`reset`,re),k?.addEventListener(`submit`,O);let ie=Ic(a,e.value);return b(ie,ie.length,!1),()=>{clearTimeout(v),e.removeEventListener(`input`,w),e.removeEventListener(`beforeinput`,E),e.removeEventListener(`paste`,D),e.removeEventListener(`compositionstart`,ee),e.removeEventListener(`compositionend`,T),e.removeEventListener(`blur`,O),e.removeEventListener(`invalid`,O),k?.removeEventListener(`formdata`,ne),k?.removeEventListener(`reset`,re),k?.removeEventListener(`submit`,O),Vc.delete(e),x?Object.defineProperty(e,"value",x):Reflect.deleteProperty(e,`value`),m=!1,h=``,y(),e.setCustomValidity(``),delete e.dataset.maskRaw,l&&e.removeAttribute(`inputmode`)}}function qc(){let e=typeof window>`u`?void 0:window.jQuery?.validator?.prototype;if(!e||e.wuiMaskHook)return;let t=e.elementValue;e.elementValue=function(e){let n=Hc(e);return n===void 0?t.call(this,e):n},e.wuiMaskHook=!0}var Jc=new WeakMap,Yc,Xc=e=>{Jc.has(e)||Jc.set(e,Kc(e,{mask:e.dataset.appMask,postFormatted:e.hasAttribute(`data-mask-post-formatted`)}))},Zc=e=>[...e.querySelectorAll(`input[data-app-mask]`)].filter(e=>e instanceof HTMLInputElement),Qc=e=>e instanceof Element?[...e instanceof HTMLInputElement&&e.matches(`input[data-app-mask]`)?[e]:[],...Zc(e)]:[];function $c(){Yc||typeof MutationObserver>`u`||(Yc=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)for(let t of Qc(e))Jc.get(t)?.(),Jc.delete(t);for(let e of t.addedNodes)for(let t of Qc(e))Xc(t)}}),Yc.observe(document.documentElement,{childList:!0,subtree:!0}))}function el(e=document){qc();for(let t of Zc(e))Xc(t);e===document&&$c()}function tl(e,t){let n=e.getInstance(t);n&&(n.tip?.isConnected?(t.addEventListener(`hidden${e.EVENT_KEY}`,()=>n.dispose(),{once:!0}),n.hide()):n.dispose())}var nl=`data-wui-bulk-in-bar`,rl=`[data-wui-page-header-bar][data-wui-bulk-for]`,il=new WeakSet;function al(e){return`${ut(e,{decimals:0})} selected`}function ol(e){let t=e.dataset.wuiBulkFor;return t===void 0?null:document.getElementById(t)}function sl(e){return typeof e==`object`&&!!e&&`selected`in e&&typeof e.selected==`number`}function cl(e,t){return[...e.querySelectorAll(t)].flatMap(e=>e instanceof HTMLElement?[e]:[])}function ll(e,t){for(let n of cl(e,`[data-wui-bar-swap]`))n.hidden=t>0;let n=e.querySelector(`[data-wui-bar-bulk]`);if(!n)return;if(!(n instanceof HTMLElement))throw Error(`The bulk slot is not an HTML element.`);n.hidden=t===0;let r=n.querySelector(`.page-header-bar-bulk-count`);if(!(r instanceof HTMLElement))throw Error(`The bulk slot has no count element.`);r.textContent=t>0?al(t):``}function ul(e=document){for(let t of cl(e,rl))ol(t)?.setAttribute(nl,``);il.has(document)||(il.add(document),document.addEventListener(`selectionchange`,e=>{if(!(e instanceof CustomEvent)||!sl(e.detail))return;let t=e.target;if(t!==null&&!(t instanceof Node))throw Error(`The selection changed on a target that is not a node.`);for(let n of cl(document,rl))ol(n)?.contains(t)&&ll(n,e.detail.selected)}))}var dl={minLength:10,uppercase:!0,lowercase:!0,digit:!0,special:!0,uniqueChars:0,customRules:[]},fl=`Password requirements`;function pl(e){return e===!0||e==null?{...dl}:{...dl,...e}}function ml(e){let t=pl(e),n=[];if(t.minLength>0&&n.push({key:`length`,label:`At least ${t.minLength} characters long`,test:e=>e.length>=t.minLength}),t.uppercase&&n.push({key:`uppercase`,label:`At least one uppercase letter`,test:e=>/[A-Z]/.test(e)}),t.lowercase&&n.push({key:`lowercase`,label:`At least one lowercase letter`,test:e=>/[a-z]/.test(e)}),t.digit&&n.push({key:`digit`,label:`At least one digit`,test:e=>/[0-9]/.test(e)}),t.special&&n.push({key:`special`,label:`At least one special character`,test:e=>/[^A-Za-z0-9]/.test(e)}),t.uniqueChars>0){let e=t.uniqueChars;n.push({key:`unique`,label:`At least ${e} unique character${e>1?`s`:``}`,test:t=>new Set(t).size>=e})}for(let[e,r]of(t.customRules??[]).entries()){let t=new RegExp(r.pattern);n.push({key:`custom-${e}`,label:r.label,test:e=>t.test(e)})}return n}function hl(e,t){let n=e==null?``:String(e);return ml(t).map(e=>({key:e.key,label:e.label,met:e.test(n)}))}function gl(e,t){return hl(e,t).every(e=>e.met)}var _l=`wui:row-drop`,vl=`is-drop-over`,yl=`application/x-wui-rows`,bl=`wui-row-dragging`,xl=`[data-wui-drop-target]`,Sl=`tbody tr[data-row-key]`,Cl=`input, button, a, select, textarea, label`,wl=`.wui-select-cell .wui-check`,Tl=new WeakMap,El=new WeakSet,Dl=null,Ol=null;function kl(e){let t=e.querySelector(wl);return t instanceof HTMLInputElement&&t.checked}function Al(e){let t=[];for(let n of e.querySelectorAll(`tbody tr`))n instanceof HTMLElement&&kl(n)&&t.push(n.dataset.rowKey);return t}function jl(e,t){return y(e,t)}function Ml(e,t){let n=jl(e,t);return n instanceof HTMLElement?n:null}function Nl(e){let t=e.textContent;if(t===null)throw Error(`A drop target has no text content.`);return t.trim()}var Pl=e=>typeof e==`object`&&!!e&&`selected`in e&&typeof e.selected==`number`;function Fl(){Dl=null,document.body.classList.remove(bl);for(let e of document.querySelectorAll(`${xl}.${vl}`))e.classList.remove(vl)}function Il(e,t,n){e.dispatchEvent(new CustomEvent(_l,{bubbles:!0,detail:{keys:t,target:n.dataset.wuiDropTarget}}))}function Ll(e){let t=Ml(e.target,xl);if(!t||!Dl)return;e.preventDefault();let n=_(e.dataTransfer,`A drag event arrived without its DataTransfer.`);n.dropEffect=`move`,t.classList.add(vl)}function Rl(e){let t=Ml(e.target,xl);!t||e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||t.classList.remove(vl)}function zl(e){let t=Ml(e.target,xl);if(!t||!Dl)return;e.preventDefault(),t.classList.remove(vl);let{root:n,keys:r}=Dl;Il(n,r,t),Fl()}function Bl(e){let t=Ml(e.target,xl);t&&Ol?.keys.length&&(e.preventDefault(),Il(Ol.root,Ol.keys,t))}function Vl(e){(e.key===`Enter`||e.key===` `)&&Bl(e)}function Hl(e){El.has(e)||(El.add(e),e.addEventListener(`dragover`,Ll),e.addEventListener(`dragenter`,Ll),e.addEventListener(`dragleave`,Rl),e.addEventListener(`drop`,zl),e.addEventListener(`click`,Bl),e.addEventListener(`keydown`,Vl))}function Ul(e){let t=Tl.get(e);if(t)return t;Hl(e.ownerDocument||e);let n=t=>{let n=Ml(t.target,Sl);if(!n||!e.contains(n))return;let r=jl(t.target,Cl);r&&n.contains(r)||(n.draggable=!0)},r=t=>{let n=Ml(t.target,Sl);if(!n||!e.contains(n))return;let r=kl(n)?Al(e):[n.dataset.rowKey],i=_(t.dataTransfer,`A drag event arrived without its DataTransfer.`);i.setData(yl,JSON.stringify(r)),i.setData(`text/plain`,r.join(`,`)),i.effectAllowed=`move`,Dl={root:e,keys:r},document.body.classList.add(bl)},i=t=>{let n=t instanceof CustomEvent?t.detail:void 0;if(Pl(n)){let{keys:t}=n;n.selected>0?Ol={root:e,keys:Array.isArray(t)?t:Al(e)}:n.selected===0&&(Ol=null)}Wl(document)};e.addEventListener(`pointerdown`,n),e.addEventListener(`dragstart`,r),e.addEventListener(`dragend`,Fl),e.addEventListener(`selectionchange`,i);let a=()=>{e.removeEventListener(`pointerdown`,n),e.removeEventListener(`dragstart`,r),e.removeEventListener(`dragend`,Fl),e.removeEventListener(`selectionchange`,i),Tl.delete(e)};return Tl.set(e,a),a}function Wl(e=document){let t=e.querySelector(`[data-wui-row-drag] tbody tr ${wl}:checked`)!==null;for(let n of e.querySelectorAll(xl)){n.tagName!==`BUTTON`&&(n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`)),t?n.removeAttribute(`aria-disabled`):n.setAttribute(`aria-disabled`,`true`);let e=n.getAttribute(`data-wui-drop-label`)||Nl(n);n.setAttribute(`aria-label`,`Move to ${e}`)}for(let t of e.querySelectorAll(`.wui-drop-tray`))t.hasAttribute(`role`)||(t.setAttribute(`role`,`toolbar`),t.setAttribute(`aria-label`,`Move to`))}function Gl(e=document){for(let t of e.querySelectorAll(`[data-wui-row-drag]`))t instanceof HTMLElement&&Ul(t);Wl(e.ownerDocument||e)}var Kl=`.table-wrap, .table-responsive, [class*="table-responsive-"]`,ql=1;function Jl(e){let t=()=>{let t=e.scrollWidth-e.clientWidth,n=Math.abs(e.scrollLeft);e.toggleAttribute(`data-wui-overflow-start`,t>ql&&n>ql),e.toggleAttribute(`data-wui-overflow-end`,t>ql&&n<t-ql),e.toggleAttribute(`data-wui-overflow-top`,e.scrollTop>ql)},n=()=>{if(e.scrollWidth-e.clientWidth>ql){let t=getComputedStyle(e);e.style.setProperty(`--wui-scroll-pad-start`,t.paddingInlineStart),e.style.setProperty(`--wui-scroll-pad-end`,t.paddingInlineEnd)}else e.style.getPropertyValue(`--wui-scroll-pad-end`)&&(e.style.removeProperty(`--wui-scroll-pad-start`),e.style.removeProperty(`--wui-scroll-pad-end`))},r=()=>{n(),t()};e.addEventListener(`scroll`,t,{passive:!0});let i=null;if(typeof ResizeObserver<`u`){i=new ResizeObserver(r),i.observe(e);for(let t of e.children)i.observe(t)}return r(),()=>{e.removeEventListener(`scroll`,t),i?.disconnect(),e.removeAttribute(`data-wui-overflow-start`),e.removeAttribute(`data-wui-overflow-end`),e.removeAttribute(`data-wui-overflow-top`),e.style.getPropertyValue(`--wui-scroll-pad-end`)&&(e.style.removeProperty(`--wui-scroll-pad-start`),e.style.removeProperty(`--wui-scroll-pad-end`))}}var Yl=new WeakMap,Xl,Zl=e=>{Yl.has(e)||Yl.set(e,Jl(e))},Ql=e=>{if(!(e instanceof HTMLElement))return[];let t=e.matches(`.table-wrap, .table-responsive, [class*="table-responsive-"]`)?[e]:[];if(e.firstElementChild===null)return t;let n=[...e.querySelectorAll(Kl)].filter(e=>e instanceof HTMLElement);return[...t,...n]};function $l(){Xl||typeof MutationObserver>`u`||(Xl=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)for(let t of Ql(e))Yl.get(t)?.(),Yl.delete(t);for(let e of t.addedNodes)for(let t of Ql(e))Zl(t)}}),Xl.observe(document.documentElement,{childList:!0,subtree:!0}))}function eu(e=document){for(let t of e.querySelectorAll(Kl))t instanceof HTMLElement&&Zl(t);e===document&&$l()}var tu=Object.freeze([`page`,`pageSize`,`sortBy`,`sortOrder`,`search`]),nu=`search`,ru=Object.freeze({loading:`Loading rows`,error:`These rows did not load. Try again.`,network:`The connection dropped before the rows loaded. Check it and try again.`,forbidden:`You do not have access to these rows.`,retry:`Retry`,actionFailed:`That did not work. Try again.`,actionForbidden:`You do not have permission to do that.`,empty:`No rows`}),iu=5,au=e=>e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement||e instanceof HTMLFieldSetElement||e instanceof HTMLObjectElement||e instanceof HTMLOutputElement,ou=e=>e instanceof HTMLObjectElement||e instanceof HTMLOutputElement?!1:e.disabled,su=e=>au(e)&&`type`in e&&e.type===`hidden`,q=(e,t,n)=>[...e.querySelectorAll(t)].filter(e=>e instanceof n),J=(e,t,n)=>{let r=e.querySelector(t);return r instanceof n?r:null},Y=(e,t,n)=>{let r=e.closest(t);return r instanceof n?r:null},cu=e=>e.localName===`wui-select`,lu=new WeakMap,uu=(e,t)=>{let n=Number(e);return Number.isInteger(n)?n:t},du=e=>({total:uu(e.dataset.total,0),totalCapped:e.dataset.totalCapped===`true`,page:uu(e.dataset.page,1),pageSize:uu(e.dataset.pageSize,0),sortBy:e.dataset.sortBy||``,sortOrder:e.dataset.sortOrder===`desc`?`desc`:`asc`}),fu=(e,t)=>{e&&X().toast(e,{variant:t})},pu=(e,t)=>{if(!e)return;let n=new Set([...e.elements].filter(e=>!su(e)||e.hasAttribute(`data-range-mirror`)).map(e=>e.getAttribute(`name`)).filter(e=>e&&!tu.includes(e))),r=[...t].some(([e,t])=>t!==``&&n.has(e));for(let t of q(e,`[data-wui-filter-clear]`,HTMLElement))t.hidden=!r},mu=new Intl.NumberFormat(`en-IN`),hu=(e,t)=>t?`${mu.format(e)}+`:mu.format(e),gu=(e,t,n)=>{let r=e.closest(`.wui-list-card`),i=r?J(r,`.wui-list-card-count`,HTMLElement):null;i&&(i.textContent=hu(t,n))};function _u(e=document){let t=q(e,`[data-wui-server]`,HTMLElement);e instanceof HTMLElement&&e.matches(`[data-wui-server]`)&&t.unshift(e);for(let e of t){if(lu.has(e))continue;let t=yu(e);lu.set(e,t),e.hasAttribute(`data-load-first-page`)&&t.reload()}}function vu(e){let t=e instanceof Element?Y(e,`[data-wui-server]`,HTMLElement):null;return t&&lu.get(t)||null}function yu(e){let t=J(e,`.table-wrap`,HTMLElement),n=t?J(t,`:scope > table`,HTMLTableElement):null,r=e.dataset.src;if(!t||!n||!r)throw Error(`A server-paged table needs data-src and a .table-wrap > table: render it with <app-data-table src>.`);let i=J(t,`:scope > [data-wui-table-state]`,HTMLElement),a=J(e,`[data-wui-table-pager]`,HTMLElement),o=J(e,`[data-wui-table-status]`,HTMLElement),s={urlState:e.dataset.urlState!==`false`,refreshOnSuccess:e.dataset.refreshOnSuccess!==`false`,filtersForm:e.dataset.filtersForm||null,filtersRegion:e.dataset.filtersRegion||null,searchInput:e.dataset.searchInput||null,loadingText:e.dataset.loadingText||ru.loading,errorText:e.dataset.errorText||ru.error},c=new URL(r,window.location.href),l=new Set(c.searchParams.keys()),u=n.hasAttribute(`data-app-datatable-selectable`),d=new Set,f=!1,p=Ti(),m=new AbortController,h={signal:m.signal},g=_(J(n,`:scope > tbody[data-wui-rows]`,HTMLTableSectionElement),`A server-paged table needs its rows in <app-table-rows> (tbody[data-wui-rows]).`),v=du(g),y=null,b=null,x=e=>{let t=new URLSearchParams;for(let[n,r]of new URLSearchParams(e))l.has(n)||t.append(n,r);return t},S=e=>x(new URL(e,window.location.href).search),C=e=>{let t=e.toString();return`${window.location.pathname}${t?`?${t}`:``}${window.location.hash}`},w=e=>{let t=new URL(c.href);for(let[n,r]of e)l.has(n)||t.searchParams.append(n,r);return t.origin===window.location.origin?`${t.pathname}${t.search}`:t.href},ee=(e,t)=>{let n=new URLSearchParams(e);return n.has(`page`)&&n.set(`page`,String(t.page)),n.has(`pageSize`)&&n.set(`pageSize`,String(t.pageSize)),n.has(`sortBy`)?t.sortBy?(n.set(`sortBy`,t.sortBy),n.set(`sortOrder`,t.sortOrder)):(n.delete(`sortBy`),n.delete(`sortOrder`)):n.delete(`sortOrder`),n},T=ee(s.urlState?x(window.location.search):new URLSearchParams,v);s.urlState&&C(T)!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.replaceState(window.history.state,``,C(T));let E=(e,n)=>t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n})),D=e=>{o&&(o.textContent=e)},te=e=>{if(e.total===0)return ru.empty;let t=e.pageSize>0?Math.max(1,Math.ceil(e.total/e.pageSize)):1,n=e.totalCapped?hu(e.total,!0):`${e.total}`;return`Page ${e.page} of ${t}, ${n} ${e.total===1?`row`:`rows`}`},O=()=>q(n,`:scope > thead > tr:first-child > th`,HTMLTableCellElement),k=e=>{if(u&&q(e,`:scope > tr:not(.wui-group-row, .wui-virtual-spacer)`,HTMLTableRowElement).some(e=>!e.dataset.rowKey))throw Error(`A selectable server-paged table needs data-row-key on every row, so a selection can span pages.`)},ne=t=>{let n=e.dataset.activeRowKey;if(n!==void 0)for(let e of t){let t=e.classList.contains(`wui-row-active`),r=n!==``&&e.dataset.rowKey===n;e.classList.toggle(`wui-row-active`,r),r?e.setAttribute(`aria-current`,`true`):t&&e.removeAttribute(`aria-current`)}},re=e=>{if(u){xs(e);for(let t of e){let e=J(t,`.${K} .wui-check:not(:disabled)`,HTMLInputElement);e&&(f&&d.add(t.dataset.rowKey),e.checked=d.has(t.dataset.rowKey))}Cs(n)}ne(e);let t=O();if(n.classList.contains(`wui-table-stack`))for(let n of e)[...n.cells].forEach((e,n)=>{let r=t[n]?.textContent?.trim();r&&!e.hasAttribute(`data-label`)&&e.setAttribute(`data-label`,r)});t.forEach((t,n)=>{if(t.classList.contains(`wui-col-hidden`))for(let t of e)t.cells[n]?.classList.add(`wui-col-hidden`)})},ie=e=>re(q(e,`:scope > tr`,HTMLTableRowElement)),ae=e=>{for(let t of e.querySelectorAll(`:scope > template[data-wui-pager], :scope > template[data-wui-empty], :scope > template[data-wui-filters]`))t.remove()},oe=e=>e?.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0})),se=(e,t)=>{if(!i)return;let n=J(e,`:scope > template[data-wui-empty]`,HTMLTemplateElement);oe(i),t.total===0&&n?(i.replaceChildren(n.content.cloneNode(!0)),i.hidden=!1):(i.replaceChildren(),i.hidden=!0)},ce=e=>{let r=du(e),i=r.sortBy!==v.sortBy||r.sortOrder!==v.sortOrder?Zt(g.rows):null;if(a){let t=J(e,`:scope > template[data-wui-pager]`,HTMLTemplateElement);oe(a),a.replaceChildren(...t?[t.content.cloneNode(!0)]:[]),a.hidden=!1}se(e,r);let o=J(e,`:scope > template[data-wui-filters]`,HTMLTemplateElement),c=s.filtersRegion&&o?J(document,s.filtersRegion,HTMLElement):null;c&&o&&(oe(c),c.replaceChildren(o.content.cloneNode(!0))),ae(e),oe(g),n.replaceChild(e,g),g=e;let l=f&&r.total!==v.total;return v=r,l&&(f=!1),t.removeAttribute(`data-wui-table-error`),ie(e),ve(),Qt(e.rows,i),l&&be(),c},le=e=>{let t=document.createElement(`template`);t.innerHTML=`<table>${e}</table>`;let n=J(t.content,`tbody[data-wui-rows]`,HTMLTableSectionElement);return n&&k(n),n?document.importNode(n,!0):null},ue=(e,t=O())=>{let n=document.createElement(`tr`);for(let r=0;r<e;r++){let e=t[r],i=e?.classList.contains(`text-center`),a=!i&&(e?.classList.contains(`num`)||e?.classList.contains(`text-end`)||e?.classList.contains(`wui-cell-end`)),o=document.createElement(`td`);i?o.classList.add(`text-center`):a&&o.classList.add(e?.classList.contains(`num`)?`num`:`wui-cell-end`);let s=document.createElement(`span`);s.className=`skeleton`,s.setAttribute(`aria-hidden`,`true`);let c=i?44:a?56:60;s.style.cssText=`display:block;width:${c}%;height:12px;border-radius:6px`,o.append(s),n.append(o)}return n},de=()=>{if(g.querySelector(`:scope > tr:not([data-wui-skeleton])`))return;let e=Math.max(1,O().length);g.replaceChildren(...Array.from({length:iu},()=>{let t=ue(e);return t.setAttribute(`data-wui-skeleton`,``),t})),t.removeAttribute(`data-wui-table-error`),i&&(i.hidden=!0)},fe=e=>{e?(t.setAttribute(`aria-busy`,`true`),de()):t.removeAttribute(`aria-busy`)},pe=e=>e===`forbidden`?ru.forbidden:e===`network`?ru.network:s.errorText,me=e=>{let n=pe(e);if(t.setAttribute(`data-wui-table-error`,e),a&&(a.hidden=!0),i){let t=document.createElement(`div`);t.className=`empty-state wui-empty-state-table wui-table-error`,t.setAttribute(`role`,`alert`);let r=document.createElement(`span`);r.className=`empty-state-icon`,r.innerHTML=z(e===`forbidden`?`lock`:`alert-circle`,{size:24});let a=document.createElement(`div`);a.className=`empty-state-title`,a.textContent=n;let o=document.createElement(`div`);o.className=`empty-state-action`;let s=document.createElement(`button`);s.type=`button`,s.className=Jo(`primary`,`outline`,`sm`),s.dataset.wui=Wo,s.setAttribute(`data-wui-table-retry`,``),s.textContent=ru.retry,o.append(s),t.append(r,a,o),oe(i),i.replaceChildren(t),i.hidden=!1}D(n)},he=()=>s.filtersForm?J(document,s.filtersForm,HTMLFormElement):null,A=async(n,r=`none`,{quiet:i=!1}={})=>{let a=new URLSearchParams(n);i||(y={query:a,mode:r},fe(!0),D(s.loadingText)),E(`wui:table:loading`,{query:a.toString()});let o=await p.run(w(a));if(o.kind===`aborted`||o.kind===`stale`||o.kind===`session`)return o;i||fe(!1);let c=null;if(o.ok)try{c=le(o.html)}catch(e){R(e)}if(!o.ok||!c){let e=o.ok?`server`:o.kind;return i?zn(`A quiet server table refresh failed; the rows on screen are kept.`,e):me(e),E(`wui:table:error`,{status:o.status,kind:e,message:pe(e)}),o}let l=ce(c);return T=ee(a,v),pu(he(),T),s.urlState&&r===`push`?window.history.pushState(window.history.state,``,C(T)):s.urlState&&r===`replace`&&window.history.replaceState(window.history.state,``,C(T)),i||D(te(v)),X().refresh(t),l&&X().refresh(l),gu(e,v.total,v.totalCapped),E(`wui:table:loaded`,{...v,query:T.toString()}),o},ge=e=>(e.delete(`page`),e),_e=()=>q(n,`:scope > thead th[data-sort-key]`,HTMLTableCellElement),ve=()=>{for(let e of _e()){let t=e.dataset.sortKey===v.sortBy;e.setAttribute(`aria-sort`,t?v.sortOrder===`desc`?`descending`:`ascending`:`none`)}};for(let e of _e())if(e.classList.add(`sortable`),e.tabIndex=0,!e.querySelector(`.sort-icon`)){let t=e.classList.contains(`num`)||e.classList.contains(`text-end`),n=document.createElement(`span`);n.className=t?`sort-icon wui-sort-lead`:`sort-icon`,n.innerHTML=z(`chevrons-up-down`,{size:14}),t?e.prepend(n):e.append(n)}let ye=e=>{let t=ge(new URLSearchParams(T)),n=v.sortBy===e&&v.sortOrder===`asc`?`desc`:`asc`;return t.set(`sortBy`,e),t.set(`sortOrder`,n),A(t,`push`)};n.addEventListener(`click`,e=>{let t=e.target instanceof Element?Y(e.target,`th[data-sort-key]`,HTMLTableCellElement):null;t&&n.tHead?.contains(t)&&ye(t.dataset.sortKey??``)}),n.addEventListener(`keydown`,e=>{if(e.key!==`Enter`&&e.key!==` `)return;let t=e.target instanceof Element?Y(e.target,`th[data-sort-key]`,HTMLTableCellElement):null;t&&n.tHead?.contains(t)&&(e.preventDefault(),ye(t.dataset.sortKey??``))});let be=()=>{Cs(n);let e=f?{selected:v.total,total:v.total,allMatching:f}:{selected:d.size,total:v.total};n.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:e}))};u&&(Ts(n,(e,t)=>{for(let n of e){let e=Y(n,`tr`,HTMLTableRowElement)?.dataset.rowKey;e&&(t?d.add(e):d.delete(e))}t||(f=!1)}),n.addEventListener(`change`,e=>{let t=e.target;if(t instanceof HTMLInputElement&&t.matches(`.wui-select-cell .wui-check:not(:disabled)`)){if(t.checked||(f=!1),n.tHead?.contains(t))for(let e of q(g,`:scope > tr`,HTMLTableRowElement)){let n=J(e,`.${K} .wui-check:not(:disabled)`,HTMLInputElement);n&&(n.checked=t.checked,t.checked?d.add(e.dataset.rowKey):d.delete(e.dataset.rowKey))}else{let e=Y(t,`tr`,HTMLTableRowElement)?.dataset.rowKey;if(!e)return;t.checked?d.add(e):d.delete(e)}be()}})),a&&(a.addEventListener(`click`,e=>{let t=e.target instanceof Element?Y(e.target,`a[href]`,HTMLAnchorElement):null;!t||e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),A(S(t.getAttribute(`href`)??``),`push`))}),a.addEventListener(`change`,e=>{let t=e.target;t instanceof HTMLSelectElement&&t.classList.contains(`tpg-select`)&&t.value&&(e.stopPropagation(),A(S(t.value),`push`))}));let xe=()=>{if(!s.searchInput)return null;let e=J(document,s.searchInput,HTMLElement);return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e:e?J(e,`input`,HTMLInputElement):null},Se=()=>e.isConnected?!0:(m.abort(),clearTimeout(b??void 0),!1),Ce=(e,t)=>{let n=[...e.elements].filter(au),r=new Set;for(let e of n)e.name&&!su(e)&&r.add(e.name);let i=[];for(let e of n)if(e.name&&!ou(e)){if(e instanceof HTMLInputElement&&e.matches(`input[type="hidden"][data-wui-carried]`))r.has(e.name)||i.push([e.name,e.value]);else if(e instanceof HTMLInputElement&&e.matches(`input[type=checkbox], input[type=radio]`))e.checked&&i.push([e.name,e.value]);else if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.matches(`[type=submit], [type=button], [type=reset], [type=image], [type=file]`)||i.push([e.name,e.value]);else if(e instanceof HTMLSelectElement)for(let t of e.selectedOptions)i.push([e.name,t.value])}return(t instanceof HTMLButtonElement||t instanceof HTMLInputElement)&&t.name&&!t.disabled&&i.push([t.name,t.value]),i},we=(e,t)=>{let n=new Set([...e.elements].filter(au).map(e=>e.name).filter(Boolean)),r=new URLSearchParams,i=e=>e!==`search`&&tu.includes(e);for(let[e,t]of T)e!==`page`&&(i(e)||!n.has(e))&&r.append(e,t);for(let[n,a]of Ce(e,t))a===``||i(n)||l.has(n)||r.append(n,a);let a=xe();if(a){r.delete(nu);let e=a.value.trim();e&&r.set(nu,e)}return A(r,`push`)},Te=e=>s.filtersForm&&e.closest?.(s.filtersForm)||s.filtersRegion&&e.closest?.(s.filtersRegion)||null;document.addEventListener(`submit`,e=>{Se()&&s.filtersForm&&e.target instanceof HTMLFormElement&&e.target.matches(s.filtersForm)&&(e.preventDefault(),we(e.target,e.submitter))},h),document.addEventListener(`change`,e=>{if(!Se()||!s.filtersForm||!(e.target instanceof Element))return;let t=Y(e.target,s.filtersForm,HTMLFormElement);!t||e.target===xe()||t.hasAttribute(`data-wui-apply-on-change`)||e.target.closest(`wui-filter-popover`)||we(t)},h);let Ee=(e,t)=>{if(!e)return;let n=e=>t.get(e)??``;for(let r of q(e,`input[name]:not([type=hidden])`,HTMLInputElement))if(r.type===`checkbox`)r.checked=t.getAll(r.name).includes(r.value);else if(r.type===`radio`){let e=n(r.name)===r.value;if(r.checked===e)continue;r.checked=e,e&&r.dispatchEvent(new Event(`change`))}else r.value!==n(r.name)&&(r.value=n(r.name),r.dispatchEvent(new Event(`input`,{bubbles:!0})));for(let r of q(e,`select[name]`,HTMLSelectElement))if(!r.multiple)r.value=n(r.name);else for(let e of r.options)e.selected=t.getAll(r.name).includes(e.value);for(let r of[...e.querySelectorAll(`wui-select[name]`)].filter(cu)){let e=r.getAttribute(`name`)??``;r.value=r.mode===`multiple`||r.mode===`tag`?t.getAll(e):n(e)}for(let t of e.querySelectorAll(`wui-date-range`)){let e=t.getAttribute(`start-name`)||t.getAttribute(`name`),r=t.getAttribute(`end-name`);t.value={start:e?n(e):``,end:r?n(r):``}}};document.addEventListener(`click`,e=>{if(!Se())return;let t=e.target instanceof Element?Y(e.target,`a[href]`,HTMLAnchorElement):null;if(!t||!Te(t)||e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let n=new URL(t.getAttribute(`href`)??``,window.location.href);if(n.origin!==window.location.origin||n.pathname!==window.location.pathname)return;e.preventDefault();let r=ge(S(n.href));Ee(t.closest(`form`),r),pu(t.closest(`form`),r),A(r,`push`)},h),document.addEventListener(`input`,e=>{if(!Se())return;let t=xe();t&&e.target===t&&(clearTimeout(b??void 0),b=setTimeout(()=>{if(!Se())return;let e=ge(new URLSearchParams(T)),n=t.value.trim();n?e.set(nu,n):e.delete(nu),e.toString()!==T.toString()&&A(e,`replace`)},300))},h),s.urlState&&window.addEventListener(`popstate`,()=>{if(!Se())return;let e=x(window.location.search),t=xe();t&&(t.value=e.get(`search`)??``),pu(he(),e),A(e,`none`)},h),document.addEventListener(`wui:modal:success`,()=>{Se()&&s.refreshOnSuccess&&A(T,`none`)},h),i?.addEventListener(`click`,e=>{e.target instanceof Element&&e.target.closest(`[data-wui-table-retry]`)&&y&&A(y.query,y.mode)});let De=e=>[...g.rows].find(t=>t.dataset.rowKey===e)??null,j=e=>{if(!e?.trim())return null;let t=document.createElement(`template`);if(t.innerHTML=`<table><tbody>${e}</tbody></table>`,t.content.querySelector(`tbody[data-wui-rows]`))return null;let n=q(t.content,`table > tbody > tr[data-row-key]`,HTMLTableRowElement);return n.length?n.map(e=>document.importNode(e,!0)):null},Oe=(e,n,r)=>{let i=r?e[0]:e.find(e=>e.dataset.rowKey===n.dataset.rowKey);if(!i)return null;let a=[];for(let t of e){let e=t===i?n:De(t.dataset.rowKey);e&&(oe(e),e.replaceWith(t),a.push(t))}return re(a),X().refresh(t),i},ke=e=>e.message||(e.kind===`forbidden`?ru.actionForbidden:ru.actionFailed),Ae=e=>{e?.isConnected&&e.getAttribute(`data-wui-save-state`)===`saving`&&on(e,null)},je=e=>{if(e instanceof HTMLTableRowElement)return e;let t=document.createElement(`template`);t.innerHTML=`<table><tbody>${String(e)}</tbody></table>`;let n=J(t.content,`table > tbody > tr`,HTMLTableRowElement);return document.importNode(_(n,"saveRow's `row` is the row as it will read: a <tr> element or its HTML."),!0)},Me=async({url:e,method:n=`POST`,body:r,key:a,row:o}={})=>{if(!e)throw Error("saveRow needs `url`: the handler that saves the row.");let s=a==null,c=s?null:De(String(a));if(!s&&!c)throw Error(`saveRow found no row with data-row-key="${a}" on this page.`);let l=O().filter(e=>!e.classList.contains(K)),u=o?je(o):c??ue(Math.max(1,l.length),l);c&&u!==c?c.replaceWith(u):c||g.insertBefore(u,g.firstChild),u!==c&&re([u]),i&&!t.hasAttribute(`data-wui-table-error`)&&(i.hidden=!0),on(u,`saving`);let d=an(u),f=await U(e,{method:n.toUpperCase(),body:r});if(f.kind===`session`)return!1;if(f.ok){let e=j(f.html),t=e&&u.isConnected?Oe(e,u,s):null;return t?D(N.saved(an(t)||d)):(await A(T,`none`),Ae(u)),Tu(f,f.toastVariant||`success`),E(`wui:table:saved`,{key:t?.dataset.rowKey??(s?null:String(a)),added:s,status:f.status}),!0}let p=ke(f),m=u;return c&&u!==c&&u.isConnected?(u.replaceWith(c),m=c):s&&!o&&(u.remove(),m=null,i?.childElementCount&&!g.querySelector(`:scope > tr`)&&(i.hidden=!1)),m?.isConnected&&on(m,`error`,p),f.kind!==`aborted`&&fu(p,`danger`),D(N.notSaved(d,p)),E(`wui:table:failed`,{key:s?null:String(a),added:s,status:f.status,kind:f.kind,message:p}),!1},Ne=async e=>{let t=e.dataset.url;if(!t)throw Error(`A data-wui-row-action button needs data-url: the handler the action posts to.`);let n=Y(e,`tr`,HTMLTableRowElement),r=n?.dataset.rowKey??null,i=e.dataset.wuiRowAction||``,a=n?an(n):``;e.disabled=!0,e.setAttribute(`aria-busy`,`true`),n&&on(n,`saving`);let o=await U(t,{method:(e.dataset.method||`post`).toUpperCase()});if(e.disabled=!1,e.removeAttribute(`aria-busy`),o.kind===`session`||o.kind===`aborted`)Ae(n);else{if(o.ok){Tu(o,o.toastVariant||`success`);let e=n?.isConnected?j(o.html):null,t=e&&n?Oe(e,n,!1):null;t?D(N.saved(an(t)||a)):(await A(T,`none`),Ae(n))}else{let e=ke(o);fu(e,`danger`),n?.isConnected&&on(n,`error`,e),D(N.notSaved(a,e))}E(`wui:table:action`,{action:i,key:r,ok:o.ok,status:o.status})}};return n.addEventListener(`click`,e=>{let t=e.target instanceof Element?Y(e.target,`[data-wui-row-action]`,HTMLButtonElement):null;t&&g.contains(t)&&!t.disabled&&(e.preventDefault(),Ne(t))}),k(g),ae(g),u&&Ss(n),ie(g),ve(),{el:e,reload:async e=>{let n=e?.quiet===!0;return n&&t.getAttribute(`aria-busy`)===`true`?null:A(T,`none`,{quiet:n})},query:()=>new URLSearchParams(T),setQuery:e=>{let t=new URLSearchParams(T);for(let[n,r]of Object.entries(e??{})){t.delete(n);for(let e of Array.isArray(r)?r:[r])e!=null&&e!==``&&t.append(n,String(e))}return e&&`page`in e||t.delete(`page`),A(t,`push`)},saveRow:Me,setActiveRow:t=>{e.dataset.activeRowKey=t==null?``:String(t),ne(q(g,`:scope > tr`,HTMLTableRowElement))},selection:{keys:()=>[...d],count:()=>f?v.total:d.size,allMatching:()=>f,selectAllMatching:()=>{f=!0;for(let e of q(g,`:scope > tr`,HTMLTableRowElement)){let t=J(e,`.${K} .wui-check`,HTMLInputElement);t?.disabled||(t&&(t.checked=!0),e.dataset.rowKey&&d.add(e.dataset.rowKey))}be()},clear:()=>{f=!1,d.clear();for(let e of q(g,`:scope > tr > .${K} .wui-check:not(:disabled)`,HTMLInputElement))e.checked=!1;be()}}}}var bu=8e3,xu=`That did not work. Try again.`,Su=[`success`,`info`,`warning`,`danger`],Cu=e=>Su.some(t=>t===e);function wu(e){if(!Cu(e))throw RangeError(`Unknown toast variant "${e}".`);return e}function X(){return _(window.WUI,`window.WUI is not defined: the Razor behaviour script did not load on this page.`)}function Tu(e,t=`success`){if(!e?.message)return;let n=e.toastAction;n?X().toast(e.message,{variant:wu(t),duration:bu,action:{label:n.label,onClick:()=>Eu(n)}}):X().toast(e.message,{variant:wu(t)})}async function Eu(e){let t=await U(e.url,{method:e.method});if(t.kind!==`session`&&t.kind!==`aborted`){if(t.ok){Tu(t,t.toastVariant||`success`);for(let e of document.querySelectorAll(`[data-wui-server]`))e instanceof HTMLElement&&e.dataset.refreshOnSuccess!==`false`&&vu(e)?.reload()}else X().toast(t.message||xu,{variant:`danger`})}}var Du=`wui-remote-modal`,Ou=`wui-remote-drawer`,ku=Object.freeze({sm:360,md:480,lg:640,xl:720}),Au=`wui-modal-fullscreen`,ju=Object.freeze({sm:380,md:440,lg:640,xl:880}),Z=Object.freeze({loading:`Loading`,close:`Close`,retry:`Try again`,errorTitle:`This could not be loaded`,forbidden:`You do not have access to this.`,client:`It may have been moved or deleted.`,server:`Something went wrong on our side. Try again in a moment.`,network:`Could not reach the server. Check your connection and try again.`,submitFailed:`Your changes were not saved.`,invalid:`Some fields need attention.`}),Mu=`a[href],button:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,Nu=`input:not([type="hidden"]):not([disabled]),select:not([disabled]),textarea:not([disabled]),[contenteditable="true"]`,Pu=`[aria-invalid="true"], .is-invalid, .input-validation-error`,Fu=`.wui-error-summary, [data-wui-form-errors], .validation-summary-errors, [data-valmsg-summary]`,Iu=`[data-wui-modal-content]`,Lu=`[data-wui-pane-close], [data-bs-dismiss="modal"]`,Ru=`<button type="button" class="wui-modal-close" data-bs-dismiss="modal" aria-label="Close"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"></path></svg></button>`,zu=new WeakMap,Bu=new WeakSet;function Vu(e,t){if(e==null)throw TypeError(`The remote modal needs ${t}, and the page does not have it.`);return e}var Q=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},Hu=(e,t,n)=>Vu(Q(e,t),n),Uu=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),Wu=()=>Object.assign(Error(`The remote modal load was aborted.`),{name:`AbortError`}),Gu=e=>typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`,Ku=(e,t)=>{let n=e instanceof Element?e.closest(t):null;return n instanceof HTMLElement?n:null},qu=e=>{let t=window.bootstrap?.Modal;if(!t)throw Error(`WUI.modal.load(${String(e)}): Bootstrap's bundle (window.bootstrap) is not loaded on this page.`);return t},Ju=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML},Yu=e=>Object.hasOwn(ju,e),Xu=e=>Object.hasOwn(ku,e);function Zu(e){if(e==null||e===``)return null;if(e===`fullscreen`)return{fullscreen:!0};if(Yu(e))return{px:ju[e]};let t=typeof e==`number`?e:/^\d+$/.test(String(e))?Number(e):NaN;if(Number.isInteger(t)&&t>0)return{px:t};throw TypeError(`Unsupported modal size "${String(e)}". Use sm, md, lg, xl, fullscreen or a px number.`)}var Qu=e=>{if(e.classList.contains(`wui-modal-fullscreen`))return{fullscreen:!0};let t=Number.parseInt(e.style.getPropertyValue(`--wui-modal-max-width`),10);return{px:t>0?t:ju.md}},$u=(e,t)=>{e.classList.toggle(Au,!!t.fullscreen),t.fullscreen?e.style.removeProperty(`--wui-modal-max-width`):e.style.setProperty(`--wui-modal-max-width`,`${t.px}px`)},ed=[`center`,`top`];function td(e){if(e==null||e===``)return null;if(Xu(e))return{px:ku[e]};let t=typeof e==`number`?e:/^\d+$/.test(String(e))?Number(e):NaN;if(Number.isInteger(t)&&t>0)return{px:t};throw TypeError(`Unsupported drawer size "${String(e)}". Use sm, md, lg, xl or a px number.`)}var nd=e=>e.container===`drawer`,rd=e=>e.container===`pane`,id=e=>e.container!==`modal`,ad=(e,t)=>nd(e)?td(t):Zu(t),od=()=>document.getElementById(`wui-remote-drawer`)?.classList.contains(`show`)??!1,sd=e=>{let t=typeof e==`string`?document.querySelector(e):e,n=t instanceof HTMLElement?t:null;return n?.matches(`[data-wui-pane-host]`)?n:null},cd=e=>rd(e)?e.shell:Hu(e.shell,`.modal-dialog`,`a dialog frame`);function ld(e=`modal`){let t=e===`drawer`,n=t?Ou:Du,r=document.getElementById(n);return r||(r=document.createElement(`div`),r.id=n,r.className=t?`modal fade wui-modal-shell wui-remote-drawer`:`modal fade wui-modal-shell`,r.tabIndex=-1,r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`role`,`dialog`),r.setAttribute(`aria-modal`,`true`),r.style.setProperty(`--wui-modal-max-width`,`${t?ku.md:ju.md}px`),r.innerHTML=t?`<div class="modal-dialog wui-remote-drawer-dialog"><div class="modal-content wui-modal"></div></div>`:`<div class="modal-dialog modal-dialog-centered wui-rb-dialog"><div class="modal-content wui-modal"></div></div>`,document.body.appendChild(r),r)}var ud=e=>`<div class="wui-modal-header"><div class="wui-modal-heading"><div class="wui-modal-headtext"><div class="wui-modal-title">${Ju(e)}</div></div></div>${Ru}</div>`,dd=e=>`<div class="modal-content wui-modal" aria-busy="true">${ud(e)}<div class="wui-modal-body"><div class="wui-modal-loading" role="status"><span class="visually-hidden">${Ju(Z.loading)}</span><div class="skeleton wui-modal-skeleton"></div><div class="skeleton wui-modal-skeleton"></div><div class="skeleton wui-modal-skeleton wui-modal-skeleton--short"></div></div></div></div>`,fd=(e,t)=>`<div class="modal-content wui-modal" data-wui-modal-error="${Ju(t)}">${ud(e)}<div class="wui-modal-body"><div class="wui-modal-state" role="alert"><p class="wui-modal-state-title">${Ju(Z.errorTitle)}</p><p class="wui-modal-state-text">${Ju(Z[t]||Z.server)}</p><div class="wui-modal-state-actions"><button type="button" class="${Jo(`primary`,`soft`,`md`)}" data-bs-dismiss="modal" data-wui="${Wo}">${Ju(Z.close)}</button><button type="button" class="${Jo(`primary`,`solid`,`md`)}" data-wui-modal-retry data-wui="${Wo}">${Ju(Z.retry)}</button></div></div></div></div>`,pd=e=>{let t=document.createElement(`template`);return t.innerHTML=e,Hu(t.content,`.modal-content`,`a card`)},md=e=>Q(e.shell,`.modal-content`);function hd(e){if(!e)return;e.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0}));let t=window.bootstrap,n=t?[t.Tooltip,t.Popover]:[];for(let r of[e,...e.querySelectorAll(`*`)]){for(let e of n)tl(e,r);t?.Dropdown.getInstance(r)?.dispose()}}function gd(e,t){let n=md(e),r=n?vd(n):new Map;hd(n),n?n.replaceWith(t):cd(e).appendChild(t),yd(t,r),X().refresh()}var _d=`input[type="file"][name]`;function vd(e){let t=new Map;for(let n of e.querySelectorAll(_d)){if(!(n instanceof HTMLInputElement))continue;let e=n.files;e&&e.length>0&&t.set(n.name,[...e])}return t}function yd(e,t){if(t.size!==0&&typeof DataTransfer<`u`)for(let n of e.querySelectorAll(_d)){if(!(n instanceof HTMLInputElement))continue;let e=t.get(n.name);if(!e)continue;let r=new DataTransfer;for(let t of e)r.items.add(t);n.files=r.files,n.dispatchEvent(new Event(`change`,{bubbles:!0}))}}var bd=e=>rd(e)?!e.shell.hidden:e.shell.classList.contains(`show`);function xd(e,t,n=!1){let r=t?Q(e,Pu):null,i=r?r.matches(Mu)?r:Q(r,Mu)||r:null;if(!i&&n)i=Q(e,`[data-autofocus]`)||Q(e,Nu)||Q(e,`.wui-modal-close`);else if(!i){let t=Uu(e,Mu);i=Q(e,`[data-autofocus]`)||t.find(e=>!e.classList.contains(`wui-modal-close`))||t[0]||e}r?i?.focus?.():i?.focus?.({preventScroll:!0})}function Sd(e,t){let n=Uu(e,Mu).filter(e=>e.getClientRects().length>0&&getComputedStyle(e).visibility!==`hidden`);if(!n.length){t.preventDefault(),e.focus();return}let r=Vu(n[0],`a focusable control`),i=Vu(n[n.length-1],`a focusable control`),a=document.activeElement;!e.contains(a)||a===e?(t.preventDefault(),(t.shiftKey?i:r).focus()):t.shiftKey&&a===r?(t.preventDefault(),i.focus()):!t.shiftKey&&a===i&&(t.preventDefault(),r.focus())}function Cd(e,t){let n=Q(e.shell,`[data-wui-modal-live]`);n||(n=document.createElement(`div`),n.className=`visually-hidden`,n.setAttribute(`aria-live`,`assertive`),n.setAttribute(`data-wui-modal-live`,``),cd(e).appendChild(n)),n.textContent=``,n.textContent=t}var wd=e=>{let t=Q(e.shell,`[data-wui-modal-live]`);t&&(t.textContent=``)},Td=(e,t,n)=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))};function Ed(e,t,n,r){let i={...r,container:e.container};Td(t,`wui:modal:${n}`,i),nd(e)&&Td(t,`wui:drawer:${n}`,i),rd(e)&&Td(t,`wui:pane:${n}`,i)}var Dd=e=>e.matches(`[data-wui-pane-host]`)?`pane`:e.classList.contains(`wui-remote-drawer`)?`drawer`:`modal`;function Od(e){let t=zu.get(e);if(t)return t;let n={shell:e,container:Dd(e),queue:Ti(),defaultSize:Qu(e),defaultLabel:e.getAttribute(`aria-label`),placeholder:md({shell:e})?.outerHTML||`<div class="modal-content wui-modal"></div>`,remoteUrl:e.getAttribute(`data-wui-remote-url`),cache:e.getAttribute(`data-wui-remote-cache`)===`true`,loadedUrl:null,session:null};return zu.set(e,n),e.addEventListener(`submit`,e=>Xd(n,e)),e.addEventListener(`click`,e=>{Ku(e.target,`[data-wui-modal-retry]`)&&n.session&&(e.preventDefault(),Id(n,n.session))}),rd(n)&&e.addEventListener(`click`,t=>{let r=Ku(t.target,Lu);r&&e.contains(r)&&n.session&&Ad(n,n.session,`dismissed`,null)}),e.addEventListener(`hidden.bs.modal`,t=>{t.target===e&&(e.classList.contains(`wui-modal-stacked`)&&Md(n),Nd(n))}),e.addEventListener(`shown.bs.modal`,t=>{if(t.target!==e)return;e.classList.contains(`wui-modal-stacked`)&&[...document.querySelectorAll(`.modal-backdrop`)].at(-1)?.classList.add(`wui-modal-backdrop-stacked`);let r=md(n);n.session&&r?.matches(Iu)&&!r.contains(document.activeElement)&&xd(r,!1,id(n))}),n.remoteUrl&&e.addEventListener(`show.bs.modal`,t=>{t.target===e&&Pd(n,t)}),n}function kd(e,t,n){e.session&&(e.queue.abort(),e.session.resolveClosed({status:`dismissed`,detail:{replaced:!0}}));let r=()=>void 0,i=new Promise(e=>{r=e}),a={url:t,method:(n.method||`GET`).toUpperCase(),body:n.body,options:n,trigger:n.trigger||null,explicitSize:null,closing:null,resolveClosed:r,handle:{el:e.shell,closed:i,close:()=>Ad(e,a,`dismissed`,null),reload:()=>Id(e,a)}};return e.session=a,a}function Ad(e,t,n,r){e.session===t&&(t.closing={status:n,detail:r},rd(e)?jd(e,t):window.bootstrap?.Modal.getOrCreateInstance(e.shell).hide())}function jd(e,t){let n=e.shell,{status:r,detail:i}=Vu(t.closing,`the closing state`),a=n.contains(document.activeElement);e.queue.abort(),e.session=null,hd(md(e)),n.replaceChildren(),n.hidden=!0,n.removeAttribute(`data-open`),t.resolveClosed({status:r,detail:i}),Ed(e,n,`closed`,{status:r,url:t.url}),a&&t.trigger?.isConnected&&t.trigger.focus?.()}function Md(e){e.shell.classList.remove(`wui-modal-stacked`),od()&&(document.body.classList.add(`modal-open`),document.body.style.overflow=`hidden`)}function Nd(e){let t=e.session;if(e.queue.abort(),e.session=null,wd(e),t){let n=t.closing||{status:`dismissed`,detail:null};t.resolveClosed({status:n.status,detail:n.detail}),Ed(e,e.shell,`closed`,{status:n.status,url:t.url});let r=document.activeElement;t.trigger?.isConnected&&(!r||r===document.body||e.shell.contains(r))&&t.trigger.focus?.()}e.cache||(gd(e,pd(e.placeholder)),e.loadedUrl=null,$u(e.shell,e.defaultSize),e.defaultLabel?e.shell.setAttribute(`aria-label`,e.defaultLabel):e.shell.removeAttribute(`aria-label`))}function Pd(e,t){let n=`relatedTarget`in t?t.relatedTarget:null,r=n instanceof HTMLElement?n:null,i=r?.getAttribute(`data-wui-url`)||e.remoteUrl||``,a=kd(e,i,{trigger:r});a.explicitSize=Fd(e,r?.getAttribute(`data-wui-size`)),a.explicitSize&&$u(e.shell,a.explicitSize),e.cache&&e.loadedUrl===i||(e.loadedUrl&&gd(e,pd(e.placeholder)),Id(e,a,{keepPlaceholder:!0}))}function Fd(e,t){try{return ad(e,t)}catch(e){return R(e),null}}async function Id(e,t,{keepPlaceholder:n=!1}={}){n||gd(e,pd(dd(t.options.title||Ld(e))));let r=await e.queue.run(t.url,{method:t.method,body:t.body,navigate:t.options.navigate});if(e.session!==t||r.kind===`aborted`||r.kind===`stale`)return`aborted`;if(r.kind===`session`)return`session`;if((r.kind===`ok`||r.kind===`validation`)&&Vd(e,t,r.html,!1))return e.loadedUrl=t.url,Ed(e,e.shell,`loaded`,{url:t.url,handle:t.handle}),`loaded`;let i=r.kind===`ok`||r.kind===`validation`?`server`:r.kind;return gd(e,pd(fd(t.options.title||Ld(e),i))),bd(e)&&xd(Vu(md(e),`a card`),!1,id(e)),Ed(e,e.shell,`error`,{url:t.url,kind:i,status:r.status}),`error`}var Ld=e=>md(e)?.querySelector(`.wui-modal-title`)?.textContent||e.shell.getAttribute(`aria-label`)||``,Rd=`/_content/Webority.Ui.Razor/js/`,zd=e=>new URL(e,window.location.href).pathname.includes(Rd);function Bd(e){if([...document.scripts].some(t=>t.getAttribute(`src`)===e))return;let t=document.createElement(`script`);t.src=e,document.head.appendChild(t)}function Vd(e,t,n,r){let i=document.createElement(`template`);i.innerHTML=n;let a=!1;for(let e of i.content.querySelectorAll(`script`)){if(e.getAttribute(`type`)===`application/json`)continue;let t=e.getAttribute(`src`);e.remove(),t&&zd(t)?Bd(t):a=!0}a&&zn(`WUI.modal: ${t.url} returned a fragment with script; it was removed. Keep page behaviour in the page.`);let o=Q(i.content,Iu);if(!o)return R(`WUI.modal: ${t.url} did not answer with an <app-modal-content> fragment.`),!1;if(gd(e,o),r||wd(e),!rd(e)){$u(e.shell,t.explicitSize||Fd(e,o.getAttribute(`data-wui-size`))||e.defaultSize);let n=o.getAttribute(`data-wui-title`);n&&e.shell.setAttribute(`aria-label`,n)}return bd(e)&&xd(o,r,id(e)),!0}var Hd=`button[type="submit"], button:not([type]), input[type="submit"], input[type="image"]`;function Ud(e,t,n){let r=[...e.elements].filter(e=>e.matches(Hd));if(n){e.setAttribute(`data-wui-submitting`,``);let n=t&&r.includes(t)?t:r[0];for(let e of r)e.toggleAttribute(`data-wui-was-disabled`,e.disabled),e.disabled=!0;n&&(n.classList.add(`is-loading`),n.setAttribute(`aria-busy`,`true`),n.tagName===`BUTTON`&&n.insertAdjacentHTML(`afterbegin`,`<span class="spinner-border spinner-border-sm me-2" aria-hidden="true" data-wui-submit-spinner></span>`))}else{e.removeAttribute(`data-wui-submitting`);for(let e of r)e.disabled=e.hasAttribute(`data-wui-was-disabled`),e.removeAttribute(`data-wui-was-disabled`),e.classList.remove(`is-loading`),e.removeAttribute(`aria-busy`),e.querySelector(`[data-wui-submit-spinner]`)?.remove()}}function Wd(e){for(let t of e.querySelectorAll(Fu))t.remove();for(let t of e.querySelectorAll(Pu))t.removeAttribute(`aria-invalid`),t.classList.remove(`is-invalid`,`input-validation-error`);for(let t of e.querySelectorAll(`.field-error`))t.textContent=``}var Gd=new Set(`bad request.unauthorized.payment required.forbidden.not found.method not allowed.not acceptable.proxy authentication required.request timeout.conflict.gone.length required.precondition failed.payload too large.uri too long.unsupported media type.range not satisfiable.expectation failed.misdirected request.unprocessable content.unprocessable entity.locked.failed dependency.too early.upgrade required.precondition required.too many requests.request header fields too large.unavailable for legal reasons`.split(`.`)),Kd=(e,t)=>{if(typeof e==`object`&&e&&t in e)return Reflect.get(e,t)};async function qd(e){if(!e||e.status<400||e.status>499||e.status===422||!e.headers.get(`content-type`)?.toLowerCase().includes(`json`))return null;let t;try{t=JSON.parse(await e.text())}catch{return null}let n=e=>typeof e==`string`?e.trim():``,r=n(Kd(t,`title`)),i=(e.statusText||``).trim().toLowerCase(),a=Gd.has(r.toLowerCase())||r.toLowerCase()===i;return n(Kd(t,`message`))||n(Kd(t,`detail`))||(r&&!a?r:null)}function Jd(e,t,n,r){let i=t.closest(`.wui-modal-body`)||t;i.querySelector(`[data-wui-modal-submit-error]`)?.remove(),Wd(i);let a=document.createElement(`div`);a.className=`alert alert-danger wui-modal-submit-error`,a.setAttribute(`role`,`alert`),a.setAttribute(`data-wui-modal-submit-error`,``),a.innerHTML=Ju(`${Z.submitFailed} ${r||Z[n]||Z.server}`),i.prepend(a),Cd(e,a.textContent)}var Yd=(e,t)=>{let n=new URL(e,window.location.href);for(let[e,r]of t)typeof r==`string`&&n.searchParams.append(e,r);return n.origin===window.location.origin?n.pathname+n.search:n.href};async function Xd(e,t){let n=t.target,r=e.session;if(!(n instanceof HTMLFormElement)||!r||n.hasAttribute(`data-wui-native`)||!n.closest(Iu)||(t.preventDefault(),n.hasAttribute(`data-wui-submitting`)))return;let i=`submitter`in t&&(t.submitter instanceof HTMLButtonElement||t.submitter instanceof HTMLInputElement)?t.submitter:null,a=i?.getAttribute(`formaction`)||n.getAttribute(`action`)||r.url,o=(i?.getAttribute(`formmethod`)||n.getAttribute(`method`)||`GET`).toUpperCase(),s=new FormData(n);i?.name&&!s.has(i.name)&&s.append(i.name,i.value);let c=o===`GET`;Ud(n,i,!0);let l;try{l=await e.queue.run(c?Yd(a,s):a,{method:o,body:c?void 0:s,navigate:r.options.navigate})}catch(t){R(t),e.session===r&&n.isConnected&&(Ud(n,i,!1),Jd(e,n,`server`,null));return}if(e.session!==r)return;if(n.isConnected&&Ud(n,i,!1),l.kind===`ok`&&l.result===`success`){Zd(e,r,l);return}if(l.kind===`aborted`||l.kind===`stale`||l.kind===`session`)return;if(l.kind===`validation`&&Vd(e,r,l.html,!0)){let t=Vu(md(e),`a card`).querySelector(Fu)?.textContent?.replace(/\s+/g,` `).trim();Cd(e,t||Z.invalid);return}if(l.kind===`ok`&&l.html&&Vd(e,r,l.html,!1))return;let u=l.kind===`ok`||l.kind===`validation`?`server`:l.kind,d=await qd(l.response);e.session===r&&Jd(e,n,u,d)}function Zd(e,t,n){let r=n.message,i=n.redirect||null,a=n.toastVariant||`success`;if(!ff(a))throw TypeError(`Unknown toast variant "${a}". Use ${df.join(`, `)}.`);let o={url:t.url,trigger:t.trigger,handle:t.handle,message:r,redirect:i,data:n.data??null,container:e.container};i&&!t.options.navigate?If(r,a):r&&X().toast(r,{variant:a}),Ed(e,t.trigger?.isConnected?t.trigger:document,`success`,o),t.options.onSuccess?.(o,t.handle),i&&(t.options.navigate||(e=>window.location.assign(e)))(i);let s=n.next;s&&!i?(t.url=s,t.method=`GET`,t.body=void 0,Id(e,t)):n.keepOpen?n.html&&Vd(e,t,n.html,!1):Ad(e,t,`success`,o)}function Qd(e){let t=Ku(e.target,`[data-wui-modal], [data-wui-drawer], [data-wui-pane]`);t&&(t.matches(`a[href]`)&&(e.ctrlKey||e.metaKey||e.shiftKey||e.button!==0)||(e.preventDefault(),t.hasAttribute(`data-wui-pane`)?sf(t.getAttribute(`data-wui-pane`)??``,{target:t.getAttribute(`data-wui-pane-target`),trigger:t}).catch(e=>{Gu(e)||R(e)}):t.hasAttribute(`data-wui-modal`)?nf(t.getAttribute(`data-wui-modal`)??``,{size:t.getAttribute(`data-wui-size`)||void 0,title:t.getAttribute(`data-wui-title`)||void 0,trigger:t}).catch(e=>{Gu(e)||R(e)}):af(t.getAttribute(`data-wui-drawer`)??``,{size:t.getAttribute(`data-wui-drawer-size`)||void 0,title:t.getAttribute(`data-wui-title`)||void 0,trigger:t}).catch(e=>{Gu(e)||R(e)})))}function $d(e){if(e.key!==`Tab`||e.defaultPrevented)return;let t=e.currentTarget;if(!(t instanceof Document))return;let n=Uu(t,`.modal.show`),r=Q(t,`.modal.show.wui-modal-stacked`)??n[n.length-1];r&&Sd(r,e)}function ef(e){if(e.key!==`Escape`||e.defaultPrevented)return;let t=Ku(e.target,of),n=t&&zu.get(t),r=e.currentTarget;n?.session&&r instanceof Document&&!r.querySelector(`.modal.show`)&&Ad(n,n.session,`dismissed`,null)}function tf(e=document){let t=e instanceof Document?e:Vu(e.ownerDocument,`an owner document`);Bu.has(t)||(Bu.add(t),t.addEventListener(`click`,Qd),t.addEventListener(`keydown`,$d),t.addEventListener(`keydown`,ef));let n=Uu(e,`.modal[data-wui-remote-url]`);e instanceof HTMLElement&&e.matches(`.modal[data-wui-remote-url]`)&&n.unshift(e);for(let e of n)Od(e)}function nf(e,t={}){try{if(!e)throw TypeError(`WUI.modal.load: a fragment url is required.`);let n=qu(e),r=t.container===`drawer`,i=r?td(t.size):Zu(t.size),a=t.placement||`center`;if(!ed.includes(a))throw TypeError(`WUI.modal.load: unsupported placement "${a}". Use center or top.`);if(t.signal?.aborted)return Promise.reject(Wu());let o=ld(r?`drawer`:`modal`);tf(document);let s=Od(o),c=bd(s),l=kd(s,e,t);l.explicitSize=i,$u(o,i||s.defaultSize),r||Hu(o,`.modal-dialog`,`a dialog frame`).classList.toggle(`modal-dialog-centered`,a===`center`),t.title&&o.setAttribute(`aria-label`,t.title),c||(!r&&od()&&(document.body.appendChild(o),o.classList.add(`wui-modal-stacked`)),n.getInstance(o)?.dispose(),n.getOrCreateInstance(o,{backdrop:t.staticBackdrop===!1||`static`,keyboard:t.staticBackdrop===!1}));let u=c?Promise.resolve():new Promise(e=>o.addEventListener(`shown.bs.modal`,()=>e(),{once:!0})),d=Id(s,l);return c||n.getOrCreateInstance(o).show(),rf(s,l,t,u,d,`WUI.modal.load`)}catch(e){return Promise.reject(e)}}function rf(e,t,n,r,i,a){let o=new Promise((r,i)=>{n.signal?.addEventListener(`abort`,()=>{e.session===t&&(e.queue.abort(),Ad(e,t,`dismissed`,{aborted:!0})),i(Wu())},{once:!0})}),s=Promise.all([r,i]).then(([,e])=>{if(e===`aborted`)throw Wu();if(e===`session`)throw Error(`${a}(${t.url}): the session expired; the browser is signing in again.`);return t.handle});return Promise.race([s,o])}function af(e,t={}){return nf(e,{...t,container:`drawer`,placement:void 0})}var of=`[data-wui-pane-host]`;function sf(e,t={}){try{if(!e)throw TypeError(`WUI.pane.load: a fragment url is required.`);let n=sd(t.target);if(!n)throw TypeError(`WUI.pane.load: the target is not an <app-detail-pane>.`);if(t.signal?.aborted)return Promise.reject(Wu());tf(document);let r=Od(n),i=kd(r,e,t);n.hidden=!1,n.setAttribute(`data-open`,``);let a=Id(r,i);return rf(r,i,t,Promise.resolve(),a,`WUI.pane.load`)}catch(e){return Promise.reject(e)}}function cf(e){let t=sd(e);if(!t)throw TypeError(`WUI.pane.close: the target is not an <app-detail-pane>.`);let n=zu.get(t);n?.session&&Ad(n,n.session,`dismissed`,null)}var lf=`wuiConfirm`,uf=Object.freeze([`danger`]),df=Object.freeze([`success`,`info`,`warning`,`danger`]),ff=e=>df.some(t=>t===e),pf=`wui.flash`,mf=Object.freeze({confirmTitle:`Are you sure?`,confirmLabel:`Confirm`,cancelLabel:`Cancel`,failed:`That did not work. Try again.`,forbidden:`You do not have permission to do that.`,network:`Could not reach the server. Check your connection and try again.`}),hf=new WeakSet,gf=new WeakSet,_f=null,vf=null,yf=!1,bf=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML},xf=(e,t)=>{e&&X().toast(e,{variant:t})},Sf=()=>_(window.bootstrap?.Modal,`data-wui-confirm: Bootstrap's bundle (window.bootstrap) is not loaded on this page.`);function Cf(){let e=document.getElementById(lf);return e||(e=document.createElement(`div`),e.id=lf,e.className=`modal fade wui-modal-shell`,e.tabIndex=-1,e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`role`,`dialog`),e.setAttribute(`aria-modal`,`true`),e.style.setProperty(`--wui-modal-max-width`,`${ju.md}px`),e.innerHTML=`<div class="modal-dialog modal-dialog-centered wui-rb-dialog"><div class="modal-content wui-modal wui-confirm"><div class="wui-modal-body"><div class="wui-confirm-content"><span class="wui-confirm-icon"><wui-status-icon tone="info" size="120"></wui-status-icon></span><h3 class="wui-confirm-title" tabindex="-1" data-autofocus></h3><p class="wui-confirm-msg"></p></div></div><div class="wui-modal-footer"><div class="wui-confirm-actions"><button type="button" class="${Jo(`primary`,`soft`,`md`)}" data-bs-dismiss="modal" data-wui="${Wo}">${bf(mf.cancelLabel)}</button><button type="button" class="${Jo(`primary`,`solid`,`md`)}" data-app-confirm data-wui="${Wo}"></button></div></div></div></div>`,document.body.appendChild(e),e)}function wf(e,t){let n=e.getAttribute(`data-wui-confirm-tone`);if(n!==null&&!uf.includes(n))throw TypeError(`data-wui-confirm-tone="${n}" is not supported. Use danger, or leave it off.`);Tf({title:e.getAttribute(`data-wui-confirm-title`),message:e.getAttribute(`data-wui-confirm`),label:e.getAttribute(`data-wui-confirm-label`),danger:n===`danger`},t)}function Tf({title:e,message:t,label:n,danger:r},i){let a=Sf(),o=Cf(),s=o.querySelector(`.wui-confirm-title`),c=o.querySelector(`[data-app-confirm]`);if(!s||!c)throw Error(`#${lf} is not a confirm dialog with a confirm button. Render <app-confirm-dialog id="${lf}"> without confirm-href, or leave the dialog to the library.`);let l=o.querySelector(`.wui-confirm-msg`);l||(l=document.createElement(`p`),l.className=`wui-confirm-msg`,s.after(l));let u=e||mf.confirmTitle;s.textContent=u,l.textContent=t,c.textContent=n||mf.confirmLabel,c.classList.toggle(`btn-danger`,r),c.classList.toggle(`btn-primary`,!r),o.querySelector(`wui-status-icon`)?.setAttribute(`tone`,r?`delete`:`info`),o.setAttribute(`aria-label`,u),vf=i,yf=!1,a.getOrCreateInstance(o).show()}var Ef=(e,t)=>{_f=e;try{t()}finally{_f=null}},Df=(e,t)=>{let n=Reflect.get(e,t);if(n===void 0||typeof n==`string`)return n;throw TypeError(`confirmAction: ${t} must be text.`)},Of=e=>{if(typeof e!=`object`||!e)throw TypeError(`confirmAction: options must be an object with a message.`);let t=`message`in e?e.message:void 0;if(typeof t!=`string`)throw TypeError(`confirmAction: message must be text.`);return{title:Df(e,`title`),message:t,label:Df(e,`label`),tone:Df(e,`tone`)}};function kf(e,t,n){let{title:r,message:i,label:a,tone:o}=Of(t);if(o!=null&&!uf.includes(o))throw TypeError(`confirmAction: tone "${o}" is not supported. Use danger, or leave it off.`);Yf(e.ownerDocument),Tf({title:r,message:i,label:a,danger:o===`danger`},()=>Ef(e,n))}var Af=e=>`disabled`in e&&e.disabled===!0||e.getAttribute(`aria-disabled`)===`true`,jf=e=>{v(e,HTMLElement,`data-wui-confirm needs an HTML element to click.`).click()};function Mf(e){let t=y(e.target,`[data-wui-confirm]:not(form)`);t&&t!==_f&&!Af(t)&&(e.preventDefault(),e.stopImmediatePropagation(),wf(t,()=>Ef(t,()=>jf(t))))}function Nf(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!t.hasAttribute(`data-wui-confirm`)||t===_f||e.submitter&&e.submitter===_f||t.querySelector(`input[data-app-repeater-hidden]`))return;e.preventDefault(),e.stopImmediatePropagation();let n=e.submitter instanceof HTMLButtonElement||e.submitter instanceof HTMLInputElement?e.submitter:null,r=n?.form===t?n:void 0;wf(t,()=>Ef(t,()=>t.requestSubmit(r)))}function Pf(e){let t=y(e.target,`#${lf} [data-app-confirm]`);if(!t||t.hasAttribute(`disabled`)||!vf)return;yf=!0;let n=Sf(),r=_(t.closest(`#${lf}`),`#${lf} is missing around its confirm button.`);n.getOrCreateInstance(r).hide()}function Ff(e){if(!(e.target instanceof Element)||e.target.id!==`wuiConfirm`)return;let t=yf?vf:null;vf=null,yf=!1,t?.()}function If(e,t){e&&window.sessionStorage.setItem(pf,JSON.stringify({message:e,variant:t}))}var Lf=e=>e===`forbidden`?mf.forbidden:e===`network`?mf.network:mf.failed;function Rf(){for(let e of document.querySelectorAll(`[data-wui-server]`))e.getAttribute(`data-refresh-on-success`)!==`false`&&vu(e)?.reload()}var zf=(e,t)=>{`disabled`in e&&(e.disabled=t)};async function Bf(e){let t=e.getAttribute(`data-wui-post`);if(!t)throw Error(`A data-wui-post button needs the URL the action posts to.`);return Vf(t,e)}async function Vf(e,t,n){let r=t.getAttribute(`data-wui-post-reload`);if(r!==null&&r!==`page`)throw TypeError(`data-wui-post-reload="${r}" is not supported. Use page, or leave it off to reload the server tables.`);zf(t,!0),t.setAttribute(`aria-busy`,`true`);let i=await U(e,{method:`POST`,body:n});if(i.kind===`session`||i.kind===`aborted`)return;let a=i.toastVariant||`success`;i.ok&&(i.redirect||r===`page`)?(If(i.message,a),i.redirect?window.location.assign(i.redirect):window.location.reload()):(zf(t,!1),t.removeAttribute(`aria-busy`),i.ok?(Tu(i,a),Rf()):xf(i.message||Lf(i.kind),`danger`))}function Hf(e,t){zf(e,!1),e.removeAttribute(`aria-busy`),R(t),xf(mf.failed,`danger`)}function Uf(e){let t=y(e.target,`[data-wui-post]`);t&&(e.preventDefault(),Af(t)||t.getAttribute(`aria-busy`)===`true`||Bf(t).catch(e=>Hf(t,e)))}function Wf(e){let t=y(e.target,`form[data-wui-post-form]`);if(!(t instanceof HTMLFormElement)||e.defaultPrevented)return;e.preventDefault();let n=_(e.submitter||t.querySelector(`button:not(.repeater-add):not(.repeater-remove)`),`A data-wui-post-form needs a submit button to report its result on.`);if(n.getAttribute(`aria-busy`)===`true`)return;let r=new URL(_(t.getAttribute(`action`),`A data-wui-post-form needs an action attribute to post to.`),document.baseURI).href;Vf(r,n,new FormData(t)).catch(e=>Hf(n,e));let i=t.closest(`.dropdown`)?.querySelector(`[data-bs-toggle='dropdown']`);i&&window.bootstrap?.Dropdown?.getInstance(i)?.hide()}function Gf(){let e=window.sessionStorage.getItem(pf);if(!e)return;window.sessionStorage.removeItem(pf);let t=JSON.parse(e);if(typeof t!=`object`||!t)throw TypeError(`stored flash is not an object.`);let n=`message`in t?t.message:void 0,r=`variant`in t?t.variant:void 0;if(typeof r!=`string`||!ff(r))throw TypeError(`stored flash variant "${String(r)}" is not supported.`);if(typeof n!=`string`)throw TypeError(`stored flash message is not text.`);xf(n,r)}function Kf(e){let t=e.querySelectorAll?[...e.querySelectorAll(`[data-wui-flash]`)]:[];e instanceof Element&&e.matches(`[data-wui-flash]`)&&t.unshift(e);for(let e of t){let t=e.getAttribute(`data-wui-flash-variant`)||`success`;if(!ff(t))throw TypeError(`data-wui-flash-variant="${t}" is not supported. Use ${df.join(`, `)}.`);let n=e.getAttribute(`data-wui-flash`)||(e.textContent??``).trim();e.remove(),xf(n,t)}}var qf=e=>e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?e.form:null;function Jf(e){if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-wui-auto-submit]`);if(!t)return;let n=qf(e.target)||t.closest(`form`);n instanceof HTMLFormElement&&n.requestSubmit()}function Yf(e){gf.has(e)||(gf.add(e),e.addEventListener(`click`,Pf),e.addEventListener(`hidden.bs.modal`,Ff))}function Xf(e=document){let t=e instanceof Element?e.ownerDocument:e;hf.has(t)||(hf.add(t),t.addEventListener(`click`,Mf,!0),t.addEventListener(`submit`,Nf,!0),Yf(t),t.addEventListener(`click`,Uf),t.addEventListener(`submit`,Wf),t.addEventListener(`change`,Jf),Gf()),Kf(e)}var Zf=Object.freeze({title:`Leave without saving?`,message:`Your changes on this page are not saved. If you leave now, they are lost.`,leaveLabel:`Leave`}),Qf=`form[data-wui-unsaved]`,$f=`[aria-invalid="true"], .field-error:not(:empty), .field-validation-error, .validation-summary-errors, .wui-error-summary`,ep=`[download], [data-wui-modal], [data-wui-post], [data-bs-toggle]`,tp=new Set([`submit`,`button`,`reset`,`image`]),np=new Set([`hidden`,`checkbox`,`radio`,`file`,`submit`,`button`,`reset`,`image`,`range`,`color`]),rp=e=>e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement||e instanceof HTMLFieldSetElement||e instanceof HTMLObjectElement||e instanceof HTMLOutputElement,ip=e=>rp(e)?e instanceof HTMLObjectElement||e instanceof HTMLOutputElement?!1:e.disabled:`disabled`in e&&!!e.disabled,ap=e=>`name`in e&&typeof e.name==`string`&&e.name!==``,op=e=>typeof e==`object`&&!!e,sp=e=>Array.isArray(e)&&e.every(e=>Array.isArray(e)&&typeof e[0]==`string`);function cp(e){let t=JSON.parse(e);if(!sp(t))throw Error(`unsaved-changes snapshot is malformed`);return t}var lp=new WeakMap,up=new WeakSet,dp=e=>`${e.name}:${e.size}:${e.lastModified}`,fp=e=>[...e.querySelectorAll(Qf)].filter(e=>e instanceof HTMLFormElement);function pp(e){let t=[];for(let n of e.elements)ap(n)&&!ip(n)&&(rp(n)&&tp.has(n.type)||(n instanceof HTMLInputElement&&(n.type===`checkbox`||n.type===`radio`)?t.push([n.name,n.value,n.checked]):n instanceof HTMLInputElement&&n.type===`file`?t.push([n.name,[...n.files||[]].map(dp)]):n instanceof HTMLSelectElement&&n.type===`select-multiple`?t.push([n.name,[...n.selectedOptions].map(e=>e.value)]):n instanceof HTMLFieldSetElement||n instanceof HTMLObjectElement?t.push([n.name,null]):t.push([n.name,`value`in n?n.value:null])));return JSON.stringify(t)}function mp(e){return pp(e)}function hp(e,t){let n=new Map,r=cp(t);for(let e of r){let t=n.get(e[0]);t?t.push(e):n.set(e[0],[e])}let i=cp(pp(e)).map(e=>n.get(e[0])?.shift()??e);for(let e of n.values())i.push(...e);return JSON.stringify(i)}function gp(e){for(let t of e.elements)if(rp(t)&&t.name&&!ip(t)){if(t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&!np.has(t.type)){if(t.value.trim()!==``)return!0}else if(t instanceof HTMLInputElement&&t.type===`file`&&(t.files?.length??0)>0)return!0}return!1}var _p=e=>({saved:e.querySelector($f)&&gp(e)?null:pp(e),engaged:!1,discarded:!1});function vp(e){let t=lp.get(e);return!t||t.discarded||!e.isConnected?!1:t.saved===null||t.engaged&&pp(e)!==t.saved}var yp=(e,t)=>fp(e).filter(e=>e!==t&&vp(e)),bp=()=>!!window.bootstrap?.Modal;function xp(e,t,n){let r=t.map(e=>e.getAttribute(`data-wui-unsaved`)).find(Boolean)||Zf.message;kf(e,{title:Zf.title,message:r,label:Zf.leaveLabel,tone:`danger`},()=>{for(let e of t){let t=lp.get(e);t&&(t.discarded=!0)}n()})}function Sp(e){if(e.matches(ep))return!1;let t=e.getAttribute(`target`);if(t&&t.toLowerCase()!==`_self`)return!1;let n=e.getAttribute(`href`);if(n===null)return!1;let r=new URL(n,window.location.href);if(r.protocol!==`http:`&&r.protocol!==`https:`)return!1;let i=window.location;return!(r.hash&&r.origin===i.origin&&r.pathname===i.pathname&&r.search===i.search)}function Cp(e,t){if((t?.getAttribute(`formmethod`)||e.getAttribute(`method`)||`get`).toLowerCase()===`dialog`)return!1;let n=t?.getAttribute(`formtarget`)||e.getAttribute(`target`);return!n||n.toLowerCase()===`_self`}function wp(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target,n=y(t,`a[href]`);if(!(n instanceof HTMLAnchorElement)||!Sp(n))return;let r=yp(n.ownerDocument,null);r.length&&bp()&&(e.preventDefault(),xp(n,r,()=>n.click()))}function Tp(e){let t=e.target;if(!(t instanceof HTMLFormElement)||e.defaultPrevented||!Cp(t,e.submitter))return;let n=yp(t.ownerDocument,t);if(n.length&&bp()){e.preventDefault();let r=e.submitter,i=(r instanceof HTMLButtonElement||r instanceof HTMLInputElement)&&r.form===t?r:void 0;xp(t,n,()=>t.requestSubmit(i));return}let r=lp.get(t);r&&(r.saved=pp(t),r.discarded=!1)}function Ep(e){yp(document,null).length&&(e.preventDefault(),e.returnValue=``)}function Dp(e){let t=e.target,n=y(t,Qf);return n instanceof HTMLFormElement?n:null}function Op(e){let t=Dp(e);if(!t)return;let n=lp.get(t);n&&!n.engaged&&(n.saved!==null&&(n.saved=pp(t)),n.engaged=!0)}function kp(e){let t=Dp(e),n=t&&lp.get(t);n&&(n.discarded=!1,e.isTrusted&&(n.engaged=!0))}function Ap(e){for(let t of fp(e)){let e=lp.get(t);e?.saved&&(e.saved=hp(t,e.saved))}}function jp(e){let t=op(e)?e.handle:void 0;return op(t)?t.el:void 0}function Mp(e){if(!(e instanceof CustomEvent))return;let t=jp(e.detail);if(t instanceof Element)for(let e of fp(t))Pp(e)}function Np(e=document){let t=e instanceof Document?e:e.ownerDocument;if(!up.has(t)){up.add(t);for(let e of[`focusin`,`pointerdown`,`drop`])t.addEventListener(e,Op,!0);for(let e of[`input`,`change`])t.addEventListener(e,kp,!0);t.addEventListener(`click`,wp),t.addEventListener(`submit`,Tp),t.addEventListener(`wui:modal:success`,Mp),t.addEventListener(Gn,()=>Ap(t)),_(t.defaultView,`unsaved-changes guard needs a document with a window`).addEventListener(`beforeunload`,Ep)}let n=fp(e);e instanceof HTMLFormElement&&e.matches(Qf)&&n.unshift(e);for(let e of n)lp.has(e)||lp.set(e,_p(e))}function Pp(e){if(!(e instanceof HTMLFormElement)||!e.matches(Qf))throw TypeError(`resetUnsavedChanges: ${String(e)} is not a <form data-wui-unsaved>.`);lp.set(e,{saved:pp(e),engaged:!1,discarded:!1})}var Fp=Object.freeze({question:`Discard your changes?`,discard:`Discard`,keep:`Keep editing`}),Ip=`wui:drawer:discard`,Lp=`wui-drawer[confirm-discard]`,Rp=`.wui-modal-shell`,zp=`data-wui-no-discard`,Bp=`.wui-drawer-discard`,Vp=`input, select, textarea`,Hp=e=>typeof e==`object`&&!!e||typeof e==`function`;function Up(e){let t=e.currentTarget;if(!(t instanceof Document))throw Error(`The discard guard is not wired on a document.`);return t}function Wp(e,t){return y(e,t)}var Gp=e=>e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement,Kp=new WeakMap,qp=new WeakSet,Jp=new WeakSet;function Yp(e,t,n,r,i){let a=e.createElement(`button`);return a.type=`button`,a.className=Jo(t,n,`sm`),a.dataset.wui=Wo,a.setAttribute(r,``),a.textContent=i,a}function Xp(e,t){let n=e.createElement(`div`);n.className=`wui-drawer-discard`,n.setAttribute(`role`,`alert`);let r=e.createElement(`span`);return r.className=`wui-drawer-discard-text`,r.textContent=t,n.append(r,Yp(e,`danger`,`solid`,`data-wui-discard-confirm`,Fp.discard),Yp(e,`primary`,`soft`,`data-wui-discard-keep`,Fp.keep)),n}function Zp(e){if(!(e instanceof Element))return null;let t=e.closest(Lp);if(t)return t;let n=e.closest(Rp);return n&&em(n).length?n:null}function Qp(e){return e.closest(Lp)??e.closest(Rp)}function $p(e,t){return t.hasAttribute(zp)||e.hasAttribute(zp)?!1:t.hasAttribute(`confirm-discard`)||e.hasAttribute(`data-wui-confirm-discard`)?!0:(e.getAttribute(`method`)||`get`).toLowerCase()!==`get`}function em(e){return e.matches(Lp)?e.querySelectorAll(`form`):[...e.querySelectorAll(`form`)].filter(t=>$p(t,e))}function tm(e){let t=Kp.get(e);return t!=null&&mp(e)!==t}function nm(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-drawer-footer`,_(e.querySelector(`.wui-drawer-panel`),`The drawer has no panel to hold its footer.`).append(t),Jp.add(t),t}function rm(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-modal-footer`,(e.querySelector(`.wui-modal-body`)?.parentElement??e.querySelector(`.modal-content`)??e).append(t),Jp.add(t),t}function im(e){let t=e.querySelector(`[data-wui-discard-confirm]`);if(!(t instanceof HTMLElement))throw Error(`The discard prompt has no confirm button.`);t.focus()}function am(e,t,n){let r=e.querySelector(Bp);if(r){im(r);return}let i=Xp(e.ownerDocument,t),a;if(e.matches(Lp))a=e.querySelector(`.wui-drawer-footer`)??nm(e),a.prepend(i);else if(e.hasAttribute(`confirm-discard`))a=e.querySelector(`.wui-modal-footer`)??rm(e),a.prepend(i);else{if(!n)throw Error(`A discard prompt needs the form that is dirty.`);a=n.querySelector(`.modal-footer`),a?a.prepend(i):(a=n,n.append(i))}a.classList.add(`wui-drawer-discarding`),im(i)}function om(e){let t=e.parentElement;if(e.remove(),!t)throw Error(`The discard prompt has no footer.`);t.classList.remove(`wui-drawer-discarding`),Jp.has(t)&&t.remove()}function sm(e){for(let t of em(e))for(let e of t.querySelectorAll(Vp))if(Gp(e)&&e.type!==`hidden`&&!e.disabled){e.focus({preventScroll:!0});return}}function cm(e){let t=Zp(e.target);if(t)for(let e of em(t))Kp.get(e)??Kp.set(e,mp(e))}function lm(e){for(let t of Up(e).querySelectorAll(`form`)){let e=Kp.get(t);e!=null&&Kp.set(t,hp(t,e))}}function um(e){let t=e.target;t instanceof HTMLFormElement&&Zp(t)&&Kp.set(t,mp(t))}function dm(e){if(!Hp(e))return;let t=`handle`in e?e.handle:void 0;if(Hp(t))return`el`in t?t.el:void 0}function fm(e){if(!(e instanceof CustomEvent))return;let t=e.detail,n=dm(t);if(n instanceof Element)for(let e of n.querySelectorAll(`form`))Kp.delete(e)}function pm(e){let t=e.target;t instanceof Element&&t.matches(Lp)&&[...em(t)].some(tm)&&(e.preventDefault(),am(t,t.getAttribute(`confirm-discard`),null))}function mm(e){let t=e.target;if(!(t instanceof Element)||!t.matches(Rp))return;let n=[...em(t)].find(tm);n&&(e.preventDefault(),am(t,n.getAttribute(`data-wui-confirm-discard`)??t.getAttribute(`confirm-discard`)??Fp.question,n))}function hm(e){let t=e.closest(`wui-drawer`);if(t){t.dispatchEvent(new CustomEvent(`wui-drawer-close`,{bubbles:!0,cancelable:!0}))&&t.hide();return}let n=e.closest(Rp);n&&window.bootstrap?.Modal.getInstance(n)?.hide()}function gm(e){let t=_(e.closest(Bp),`The discard button is outside its prompt.`),n=Qp(t);if(om(t),!n)throw Error(`The discard prompt is outside its drawer or modal.`);for(let e of em(n))Kp.set(e,mp(e));n.dispatchEvent(new CustomEvent(Ip,{bubbles:!0})),n.matches(Lp)?_(n.closest(`wui-drawer`),`The confirm-discard drawer is not a wui-drawer.`).hide():_(window.bootstrap?.Modal.getInstance(n),`Bootstrap's Modal has no instance for the discarded dialog.`).hide()}function _m(e){let t=_(e.closest(Bp),`The keep button is outside its prompt.`),n=Qp(t);if(om(t),!n)throw Error(`The discard prompt is outside its drawer or modal.`);sm(n)}function vm(e){let t=Wp(e.target,`[data-wui-discard-confirm]`);if(t){gm(t);return}let n=Wp(e.target,`[data-wui-discard-keep]`);if(n){_m(n);return}let r=Wp(e.target,`[data-wui-dismiss]`);r&&hm(r)}function ym(e){if(e.key!==`Escape`)return;let t=Up(e).querySelector(Bp);if(!t)return;e.preventDefault(),e.stopPropagation();let n=Qp(t);if(om(t),!n)throw Error(`The discard prompt is outside its drawer or modal.`);sm(n)}function bm(e=document){let t=e instanceof Document?e:e.ownerDocument;qp.has(t)||(qp.add(t),t.addEventListener(`focusin`,cm),t.addEventListener(`pointerdown`,cm),t.addEventListener(`submit`,um),t.addEventListener(Gn,lm),t.addEventListener(`wui:modal:success`,fm),t.addEventListener(`wui:modal:loaded`,fm),t.addEventListener(`wui-drawer-close`,pm,!0),t.addEventListener(`hide.bs.modal`,mm),t.addEventListener(`click`,vm),t.addEventListener(`keydown`,ym,!0))}var xm=31536e3,Sm=new WeakMap,Cm=e=>e>99?`99+`:String(e),wm=(e,t)=>Object.entries(t).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,()=>String(n)),e);function Tm(e,t,n=document){try{n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${xm}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}function Em(e,t,n,r=document){try{let i=`${e}=`,a=r.cookie.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(i)),o=new Set(a?a.slice(i.length).split(`.`).filter(Boolean):[]);n?o.add(t):o.delete(t),r.cookie=`${e}=${[...o].join(`.`)}; Path=/; Max-Age=${xm}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}var Dm=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content},$=(e,t,n)=>{let r=e?.querySelector(t);return r instanceof n?r:null},Om=(e,t,n)=>{let r=e?.closest(t);return r instanceof n?r:null},km=(e,t,n)=>e?[...e.querySelectorAll(t)].filter(e=>e instanceof n):[],Am=e=>{if(!(e.target instanceof Element))throw Error(`event target is not an element`);return e.target},jm=e=>{let t=e.getAttribute(`href`);if(t===null)throw Error(`search hit has no href`);return t},Mm=(e,t)=>{let n=document.createElement(`div`);return n.className=e,n.textContent=t,n};function Nm(e,t){let n=$(e,`.wui-bell-trigger`,HTMLElement),r=$(e,`.wui-bell-count`,HTMLElement),i=$(e,`[data-wui-bell-live]`,HTMLElement),a=$(e,`[data-wui-bell-list]`,HTMLElement),o=()=>_(a,`bell list missing`),s=$(e,`.wui-bell-menu`,HTMLElement),{src:c,readAction:l}=e.dataset,u=e.dataset.label||`Notifications`,d=e.dataset.emptyText||`You are all caught up.`,f=e.dataset.loadingText??`Loading…`,p=e.dataset.noUnreadText??`No unread notifications`,m=e.dataset.unreadText??`{count} unread notifications`,h=e.dataset.bellLabel??`{label}, {count} unread`,g=Number(e.dataset.pollSeconds??60),v=Ti(),y=Number(e.dataset.unread)||0,b=(t,a=!0)=>{let o=Math.max(0,Number(t)||0),s=o!==y;y=o,e.dataset.unread=String(o),r&&(r.textContent=Cm(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?u:wm(h,{label:u,count:Cm(o)})),a&&s&&i&&(i.textContent=o===0?p:wm(m,{count:Cm(o)}))},x=()=>s?.classList.contains(`show`)??!1,S=()=>{let e=Mm(`wui-bell-state`,`Could not load notifications. `),t=document.createElement(`button`);t.type=`button`,t.className=`btn btn-link btn-sm`,t.dataset.wuiBellRetry=``,t.textContent=`Retry`,e.append(t),o().replaceChildren(e)},C=async t=>{if(t&&(o().setAttribute(`aria-busy`,`true`),o().querySelector(`.wui-bell-item`)||o().replaceChildren(Mm(`wui-bell-state`,f))),c===void 0)throw Error(`bell has no data-src`);let n=await v.run(c);if(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)return;if(o().removeAttribute(`aria-busy`),!n.ok){t&&S();return}let r=Dm(n.html),i=$(r,`[data-wui-unread]`,HTMLElement),a=i?Number(i.getAttribute(`data-wui-unread`)):y;b(a),(t||x())&&(r.querySelector(`.wui-bell-item`)?o().replaceChildren(r):o().replaceChildren(Mm(`wui-bell-state`,d))),e.dispatchEvent(new CustomEvent(`wui:notifications:loaded`,{bubbles:!0,detail:{unread:a}}))};e.addEventListener(`show.bs.dropdown`,()=>C(!0)),e.addEventListener(`click`,async e=>{let t=Am(e);if(t.closest(`[data-wui-bell-retry]`)){await C(!0);return}let n=Om(t,`[data-wui-bell-read]`,HTMLButtonElement);if(!n||!l)return;n.disabled=!0;let r=await U(l,{method:`POST`});n.disabled=!1,r.ok&&(b(0),await C(!0))});let w=null,ee=()=>{g>0&&w===null&&(w=setInterval(()=>C(x()),g*1e3))},T=()=>{w!==null&&clearInterval(w),w=null},E=()=>{document.hidden?T():(C(x()),ee())};return g>0&&(document.addEventListener(`visibilitychange`,E),document.hidden||ee()),t.push(()=>{T(),v.abort(),document.removeEventListener(`visibilitychange`,E)}),{setUnread:e=>b(e),refresh:()=>C(x())}}var Pm=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Fm=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function Im(e,t){let n=_($(e,`input.search-input`,HTMLInputElement),`search input missing`),r=$(e,`.wui-topsearch-results`,HTMLElement),i=()=>_(r,`search results missing`),a=$(e,`.wui-topsearch-open`,HTMLElement),o=$(e,`[data-wui-topsearch-live]`,HTMLElement),{src:s,param:c=`q`,resultsHref:l}=e.dataset,u=Number(e.dataset.minChars??2),d=Number(e.dataset.debounceMs??250),f=e.dataset.noResultsText??`No results`,p=e.dataset.resultsCountText??`{count} results`,m=e.dataset.resultCountText??`{count} result`,h=Ti(),g,v=-1,y=()=>km(i(),`.wui-topsearch-hit`,HTMLElement),b=e=>{let t=y();v=t.length===0?-1:(e+t.length)%t.length,t.forEach((e,t)=>{let n=t===v;e.classList.toggle(`is-active`,n),e.setAttribute(`aria-selected`,n?`true`:`false`)});let r=v>=0?t[v]:void 0;r?(n.setAttribute(`aria-activedescendant`,r.id),r.scrollIntoView?.({block:`nearest`})):n.removeAttribute(`aria-activedescendant`)},x=()=>{i().hidden=!0,n.setAttribute(`aria-expanded`,`false`),n.removeAttribute(`aria-activedescendant`),v=-1},S=()=>{i().hidden=!1,n.setAttribute(`aria-expanded`,`true`)},C=t=>{e.classList.toggle(`is-open`,t),a?.setAttribute(`aria-expanded`,t?`true`:`false`)},w=t=>{let n=new CustomEvent(`wui:search:select`,{bubbles:!0,cancelable:!0,detail:{href:t}});e.dispatchEvent(n)&&window.location.assign(t)},ee=async t=>{if(e.classList.add(`is-loading`),s===void 0)throw Error(`search has no data-src`);let n=await h.run(Fm(s,c,t));if(n.kind!==`aborted`&&n.kind!==`stale`&&n.kind!==`session`){if(e.classList.remove(`is-loading`),n.ok){let e=Dm(n.html),t=$(e,`[data-wui-count]`,HTMLElement);i().replaceChildren(e),y().forEach((e,t)=>{e.id=`${i().id}-opt-${t}`});let r=t?Number(t.getAttribute(`data-wui-count`)):y().length;o&&(o.textContent=r===0?f:wm(r===1?m:p,{count:r}))}else i().replaceChildren(Mm(`wui-topsearch-empty`,`Search is unavailable right now.`));v=-1,S()}};n.addEventListener(`input`,()=>{clearTimeout(g);let t=n.value.trim();t.length<u?(h.abort(),e.classList.remove(`is-loading`),i().replaceChildren(),x()):g=setTimeout(()=>ee(t),d)}),n.addEventListener(`keydown`,t=>{if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(i().hidden||y().length===0)return;t.preventDefault(),b(v+(t.key===`ArrowDown`?1:-1))}else if(t.key===`Enter`){let e=y(),r=v>=0?e[v]:void 0;!i().hidden&&r?(t.preventDefault(),w(jm(r))):l&&n.value.trim()!==``&&(t.preventDefault(),w(Fm(l,c,n.value.trim())))}else t.key===`Escape`&&(i().hidden?e.classList.contains(`is-open`)&&(t.preventDefault(),t.stopPropagation(),C(!1),a?.focus()):(t.preventDefault(),t.stopPropagation(),x()))}),i().addEventListener(`click`,e=>{let t=Om(Am(e),`.wui-topsearch-hit`,HTMLElement);!t||e.ctrlKey||e.metaKey||e.shiftKey||e.button===1||(e.preventDefault(),w(jm(t)))}),a?.addEventListener(`click`,()=>{let t=!e.classList.contains(`is-open`);C(t),t&&n.focus()});let T=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||Pm(e.target)||(e.preventDefault(),C(!0),n.focus())},E=t=>{t.target instanceof Node&&e.contains(t.target)||(x(),e.classList.contains(`is-open`)&&C(!1))};document.addEventListener(`keydown`,T),document.addEventListener(`pointerdown`,E),t.push(()=>{clearTimeout(g),h.abort(),document.removeEventListener(`keydown`,T),document.removeEventListener(`pointerdown`,E)})}function Lm(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>{Tm(n,!!e.detail?.collapsed)});let r=e.dataset.wuiFoldedCookie;r&&e.addEventListener(`wui:shell:nav-fold`,e=>{Em(r,e.detail?.key,!!e.detail?.folded)}),e.addEventListener(`click`,t=>{Am(t).closest(`[data-wui-tabbar-more]`)&&$(e,`[data-app-shell-menu]`,HTMLElement)?.click()});let i=$(e,`[data-wui-bell]`,HTMLElement),a=i?Nm(i,t):null,o=$(e,`[data-wui-topsearch]`,HTMLElement);o&&Im(o,t);let s={el:e,setUnread(e){_(a,`WUI.shell: this <app-shell> has no <app-shell-notifications>.`).setUnread(e)},refreshNotifications(){return _(a,`WUI.shell: this <app-shell> has no <app-shell-notifications>.`).refresh()},get collapsed(){return e.classList.contains(`collapsed`)},set collapsed(t){if(!!t===e.classList.contains(`collapsed`))return;let n=$(e,`[data-app-shell-collapse]`,HTMLElement);n?n.click():e.classList.toggle(`collapsed`,!!t)}};Sm.set(e,s);let c=n=>{if(n.target===e||n.target instanceof Node&&n.target.contains(e)){for(let e of t)e();Sm.delete(e),delete e.dataset.wuiPartsWired,document.removeEventListener(`wui:teardown`,c)}};return document.addEventListener(`wui:teardown`,c),s}function Rm(e=document){let t=[];e instanceof HTMLElement&&e.matches(`[data-app-shell]`)&&t.push(e),t.push(...km(e,`[data-app-shell]`,HTMLElement));for(let e of t)e.dataset.wuiPartsWired||(e.dataset.wuiPartsWired=`1`,Lm(e))}function zm(e){let t=Om(e,`[data-app-shell]`,HTMLElement);return t?(Sm.has(t)||Rm(t),Sm.get(t)??null):null}var Bm=`data-wui-submit-once`,Vm=`data-wui-submit-pending`,Hm=`wui-submit-spinner`,Um=new WeakSet,Wm=new WeakMap;function Gm(e){return e instanceof HTMLButtonElement||e instanceof HTMLInputElement?e:null}function Km(e){if(e.setAttribute(`aria-busy`,`true`),e.tagName===`INPUT`||e.querySelector(`.${Hm}`))return;let t=e.ownerDocument.createElement(`span`);t.className=`spinner-border spinner-border-sm me-2 ${Hm}`,t.setAttribute(`aria-hidden`,`true`),e.prepend(t)}function qm(e){e.removeAttribute(`aria-busy`),e.querySelector(`.${Hm}`)?.remove()}function Jm(e){return e.method===`post`&&e.target!==`_blank`&&e.getAttribute(`data-wui-submit-once`)!==`off`}function Ym(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!Jm(t))return;if(t.hasAttribute(Vm)){e.preventDefault();return}t.setAttribute(Vm,``);let n=Gm(e.submitter);setTimeout(()=>{t.hasAttribute(Vm)&&(e.defaultPrevented?t.removeAttribute(Vm):n&&(n.disabled=!0,Km(n),Wm.set(t,n)))},0)}var Xm=e=>[...e.querySelectorAll(`form[${Vm}]`)].filter(e=>e instanceof HTMLFormElement);function Zm(e){for(let t of Xm(e)){t.removeAttribute(Vm);let e=Wm.get(t);e&&(e.disabled=!1,qm(e),Wm.delete(t))}}function Qm(e){let t=e.ownerDocument===null?e:e.ownerDocument;Um.has(t)||(Um.add(t),t.addEventListener(`submit`,Ym,!0),t.defaultView?.addEventListener(`pageshow`,()=>Zm(t)))}var $m=[`light`,`dark`,`auto`],eh=[`wave`,`circle`,`slide`,`blinds`,`fade`,`none`],th=`wave`,nh=`theme`,rh={wave:1100,circle:700,slide:600,blinds:900,fade:350,none:0},ih=`wui-theme-switching`,ah=`wui:theme:change`,oh=`(prefers-color-scheme: dark)`,sh=e=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(e).matches,ch=e=>$m.some(t=>t===e);function lh(e){return e===`dark`||e===`auto`&&sh(oh)?`dark`:`light`}function uh(e=nh){let t=null;try{t=window.localStorage.getItem(e)}catch(e){if(!(e instanceof DOMException))throw e}return ch(t)?t:`auto`}function dh(e,t=nh){try{window.localStorage.setItem(t,e)}catch(e){if(!(e instanceof DOMException))throw e}}function fh(e){let t=document.documentElement,n=lh(e);t.setAttribute(`data-theme`,e),t.setAttribute(`data-bs-theme`,n),document.dispatchEvent(new CustomEvent(ah,{detail:{mode:n,preference:e}}))}var ph=`(function(k){var m;try{m=localStorage.getItem(k)}catch{m=null}if(m!=='light'&&m!=='dark')m='auto';var r=document.documentElement,q=window.matchMedia?window.matchMedia('(prefers-color-scheme: dark)'):null;function s(){var t=r.getAttribute('data-theme');r.setAttribute('data-bs-theme',t==='auto'?(q&&q.matches?'dark':'light'):t)}r.setAttribute('data-theme',m);s();if(q&&q.addEventListener)q.addEventListener('change',function(){if(r.getAttribute('data-theme')==='auto')s()})})(`;function mh(e=nh){return`${ph}${JSON.stringify(String(e)).replace(/</g,`\\u003c`)})`}function hh(e,{includeAuto:t=!1}={}){return e===`light`?`dark`:e===`dark`&&t?`auto`:`light`}function gh(e){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(oh),n=()=>e(t.matches?`dark`:`light`);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}var _h=60,vh=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,yh=e=>e.toFixed(1),bh=(e,t)=>`${yh(e)}px ${yh(t)}px`,xh={amplitude:22,segments:36,cycles:1.5,ripples:2},Sh=6,Ch=(e,t,n,r,i)=>{let{amplitude:a,segments:o,cycles:s}=xh,c=n*(t+2*a),l=i?t+a-c:c-a,u=i?t+2*a:-2*a,d=[bh(0,u)];for(let t=0;t<=o;t++){let n=e*t/o,i=l+a*Math.sin(2*Math.PI*s*t/o+r);d.push(bh(n,i))}return d.push(bh(e,u)),`polygon(${d.join(`, `)})`},wh=(e,t,n,r)=>{let i=t/Sh,a=[];for(let t=0;t<Sh;t++){let o=t*i,s=i*n,c=r?o+i-s:o,l=r?o+i:o+s;a.push(bh(0,c),bh(e,c),bh(e,l),bh(0,l))}return`polygon(${a.join(`, `)})`};function Th(e,{width:t,height:n,to:r=`dark`,origin:i}){let a=r===`dark`,o=[];for(let r=0;r<=_h;r++){let s=r/_h,c=vh(s);switch(e){case`circle`:{let e=i?.x??t/2,r=i?.y??n/2,a=Math.hypot(Math.max(e,t-e),Math.max(r,n-r));o.push({clipPath:`circle(${yh(a*c)}px at ${yh(e)}px ${yh(r)}px)`});break}case`slide`:{let e=n*(1-c);o.push({clipPath:a?`inset(${yh(e)}px 0px 0px 0px)`:`inset(0px 0px ${yh(e)}px 0px)`});break}case`blinds`:o.push({clipPath:wh(t,n,c,a)});break;case`fade`:o.push({clipPath:`none`,opacity:c});break;case`none`:return[];default:o.push({clipPath:Ch(t,n,c,s*xh.ripples*2*Math.PI,a)})}}return o}var Eh=e=>{e instanceof DOMException&&(e.name===`AbortError`||e.name===`InvalidStateError`)||R(`[@webority/ui-elements] The theme view transition failed:`,e)};function Dh(e,{effect:t=th,to:n,origin:r,duration:i}={}){let a=document.documentElement,o=n!==void 0&&a.getAttribute(`data-bs-theme`)===n;if(t===`none`||o||sh(`(prefers-reduced-motion: reduce)`)||typeof document.startViewTransition!=`function`||typeof a.animate!=`function`)return e(),Promise.resolve(!1);a.classList.add(ih);let s=document.startViewTransition(e),c=i??rh[t]??rh.wave;return s.ready.then(()=>{let e=Th(t,{width:window.innerWidth,height:window.innerHeight,to:n,origin:r});a.animate(e,{duration:c,easing:`linear`,fill:`both`,pseudoElement:`::view-transition-new(root)`})}).catch(Eh),s.finished.catch(Eh).finally(()=>a.classList.remove(ih)).then(()=>!0)}function Oh(){Se(),i(`wui-select`,io),i(`wui-datepicker`,Nr),i(`wui-dock`,Pr),i(`wui-otp`,ea),i(`wui-shortcuts`,Oo),i(`wui-record-pager`,ya),i(`wui-data-table`,gn),i(`wui-hover-card`,Wr),i(`wui-navigation-menu`,Qr),i(`wui-notification-center`,Ui),i(`wui-onboarding-checklist`,Zi),i(`wui-overflow`,ua),i(`wui-rating`,va),i(`wui-relative-time`,Ma),i(`wui-rolling-number`,Fa),i(`wui-show-more`,Mo),i(`wui-truncate`,No),i(`wui-whats-new`,Ho)}return globalThis.WeborityUiElementsInternal||(globalThis.WeborityUiElementsInternal={version:`0.161.0`,modules:Os}),rr(),Oh(),e.AVATAR_ACCEPT=ks,e.AVATAR_MAX_SIZE_MB=As,e.AVATAR_OUTPUT_SIZE=js,e.AVATAR_OUTPUT_TYPE=Ms,e.AVATAR_PREVIEW_SIZES=Ns,e.AVATAR_TEXT=Ps,e.BAR_BULK_IN_BAR_ATTRIBUTE=nl,e.COLUMN_MAX_WIDTH=Ot,e.COLUMN_MIN_WIDTH=Dt,e.COMMAND_SHORTCUT_ATTRIBUTE=Zs,e.CONFIRM_DIALOG_ID=lf,e.CONFIRM_TONES=uf,e.COPY_FEEDBACK_MS=Xo,e.CSRF_META_NAME=pi,e.CURRENCIES=Ve,e.CURRENCY_SYMBOLS=we,e.DATA_TABLE_TEXT=N,e.DATE_PATTERNS=We,e.DEFAULT_CSRF_HEADER=mi,e.DEFAULT_CURRENCY=Ce,e.DEFAULT_IMAGE_ACCEPT=ic,e.DEFAULT_MAX_SIZE_MB=ac,e.DEFAULT_PASSWORD_RULES=dl,e.DEFAULT_REQUIREMENTS_TITLE=fl,e.DEFAULT_THEME_EFFECT=th,e.DEFAULT_THEME_STORAGE_KEY=nh,e.DISCARD_EVENT=Ip,e.DISCARD_TEXT=Fp,e.DROP_OVER_CLASS=vl,e.DURATION_UNITS=Ue,e.EMPTY_VALUE=Ke,e.FILTER_POPOVER_MAX_CHIPS=de,e.FLASH_STORAGE_KEY=pf,e.FLASH_VARIANTS=df,e.FORMAT_STYLES=Be,e.HTTP_KINDS=vi,e.IST_TIME_ZONE=j,e.LIST_KEYS=w,e.MASK_INPUT_TYPES=Cc,e.MASK_NAMES=jc,e.MENTION_ID_PATTERN=$o,e.MONEY_UNITS=He,e.NOTIFICATION_COUNT_CAP=ei,e.NOTIFICATION_TEXT=V,e.PIN_AT_VAR=Ht,e.PIN_SIDES=jt,e.RESIZE_STEP=kt,e.RESIZE_STEP_LARGE=At,e.ROW_DRAG_TYPE=yl,e.ROW_DROP_EVENT=_l,e.ROW_HEIGHTS=Nt,e.ROW_MOVE_LIMIT=Kt,e.ROW_MOVE_MS=qt,e.ROW_SAVE_ATTR=tn,e.ROW_SAVE_ERROR_CLASS=nn,e.ROW_SAVE_STATES=en,e.SCROLL_EDGE_SELECTOR=Kl,e.SEARCH_OPEN_KEY=Rs,e.SELECT_ALL_LABEL=fs,e.SELECT_CELL_CLASS=K,e.SELECT_KEY=ee,e.SELECT_ROW_LABEL=ps,e.SERVER_ACTION_TEXT=mf,e.SHORTCUTS_OFF_ATTRIBUTE=b,e.SHORTCUT_EVENT=S,e.SHORTCUT_SCOPE_ATTRIBUTE=x,e.SHORTCUT_TEXT=C,e.SUBMIT_ONCE_ATTRIBUTE=Bm,e.THEME_BOOT_SCRIPT_BODY=ph,e.THEME_CHANGE_EVENT=ah,e.THEME_EFFECTS=eh,e.THEME_EFFECT_DURATION=rh,e.THEME_MODES=$m,e.THEME_SWITCHING_CLASS=ih,e.TOAST_ACTION_METHODS=ci,e.TOAST_ACTION_MS=bu,e.UNSAVED_TEXT=Zf,e.VIRTUAL_OVERSCAN=Mt,e.WHATS_NEW_READ_EVENT=Po,e.WUI_HEADERS=H,e.WuiDataTable=gn,e.WuiDatePicker=Nr,e.WuiDock=Pr,e.WuiHoverCard=Wr,e.WuiNavigationMenu=Qr,e.WuiNotificationCenter=Ui,e.WuiOnboardingChecklist=Zi,e.WuiOtp=ea,e.WuiOverflow=ua,e.WuiRating=va,e.WuiRecordPager=ya,e.WuiRelativeTime=Ma,e.WuiRollingNumber=Fa,e.WuiSelect=io,e.WuiShortcuts=Oo,e.WuiShowMore=Mo,e.WuiTruncate=No,e.WuiWhatsNew=Ho,e.acceptDroppedFiles=vc,e.acceptLabel=hc,e.addRowSelectCells=xs,e.addSelectColumn=Ss,e.applyBarBulk=ll,e.applyTheme=fh,e.ariaKeyShortcuts=ie,e.attachFileDrop=yc,e.attachInputMask=Kc,e.attachRowDrag=Ul,e.attachScrollEdges=Jl,e.attachShiftRange=Ts,e.avatarCropOptions=Ls,e.avatarUnreadableMessage=Is,e.barBulkCountText=al,e.buildPasswordRules=ml,e.clampColumnWidth=Ft,e.classifyStatus=Si,e.closeRemotePane=cf,e.collapseSearch=qs,e.configureCsrf=gi,e.confirmAction=kf,e.copyTextToClipboard=Zo,e.createDiscardPrompt=Xp,e.createRequestQueue=Ti,e.createSelectHeaderCell=hs,e.createSelectRowCell=gs,e.createSelectSpacerCell=_s,e.currencyPrefix=Ee,e.deriveStepStatus=ls,e.evaluatePassword=hl,e.formValues=mp,e.formatCompact=pt,e.formatCurrency=dt,e.formatDate=M,e.formatDateTime=St,e.formatDuration=gt,e.formatFileSize=fc,e.formatMasked=zc,e.formatNumber=ut,e.formatPercent=mt,e.formatRelativeTime=wa,e.formatValue=bt,e.getServerTable=vu,e.getShell=zm,e.glyphSvg=z,e.groupCount=Pt,e.groupItems=It,e.groupNotificationsByDay=si,e.identityCell=rn,e.inShortcutScope=ce,e.initCollapsibleSearch=Xs,e.initCommandShortcuts=rc,e.initDrawerDiscard=bm,e.initInputMasks=el,e.initPageBarBulk=ul,e.initRemoteModals=tf,e.initRowDrag=Gl,e.initScrollEdges=eu,e.initServerActions=Xf,e.initServerTables=_u,e.initShellParts=Rm,e.initSubmitOnce=Qm,e.initUnsavedChanges=Np,e.isCommandChord=ec,e.isCurrencyCode=Te,e.isHeicFile=Fs,e.isImageFile=uc,e.isImageOnlyAccept=mc,e.isMaskPattern=Nc,e.isPdfFile=pc,e.isTimeZone=je,e.isTypingTarget=ae,e.loadRemoteDrawer=af,e.loadRemoteModal=nf,e.loadRemotePane=sf,e.maskedPostValue=Hc,e.matchSegments=Ds,e.matchesAccept=gc,e.measureRows=Zt,e.mentionLabel=ns,e.mentionTextFromValue=as,e.mentionValueFromText=os,e.mentionedIds=ss,e.moveFocus=ue,e.nextTheme=hh,e.notificationCountText=ni,e.notificationDayHeading=oi,e.notificationTime=ai,e.notificationTriggerLabel=ri,e.notificationUnreadAnnouncement=ii,e.openSearch=Ks,e.parseMentionValue=is,e.parseToastAction=di,e.passwordSatisfies=gl,e.pinAtValue=Ut,e.pinClasses=Gt,e.pinOffsetVar=Vt,e.planPins=Wt,e.playRowMoves=Qt,e.postedMasked=Rc,e.rawMasked=Lc,e.readColumnWidths=zt,e.readCsrf=bi,e.readStoredTheme=uh,e.relativeTimeTitle=Ta,e.releaseOverlay=tl,e.resetUnsavedChanges=Pp,e.resolveMask=Fc,e.resolveTheme=lh,e.rowLabel=an,e.rowOrderChanged=$t,e.runShortcut=le,e.runToastAction=Eu,e.saveOutcomeText=cn,e.setRowSaveState=on,e.settledRows=sn,e.shortcutKey=re,e.shortcutName=ne,e.shortcutsOff=se,e.showResultToast=Tu,e.stepperHeaderItems=us,e.storeTheme=dh,e.syncSelectAll=Cs,e.syncTargets=Wl,e.themeBootScript=mh,e.themeKeyframes=Th,e.tickedKeys=Al,e.timeZoneLabel=Tt,e.toInstant=_t,e.todayIn=Le,e.transitionTheme=Dh,e.validateFile=_c,e.virtualRange=Lt,e.wallClockOf=Ie,e.watchSystemTheme=gh,e.whenElementsReady=ar,e.withTrustedLabel=Tr,e.writeColumnWidths=Bt,e.wuiFetch=U,e.zoneOffsetMs=Ne,e.zoneParts=Me,e})({});
52
+ <div class="field-error wui-select-error" id="${W(f)}" aria-live="polite"${this._error?``:` hidden`}>${W(this._error)}</div>`,this._rendered=!0,this._syncMirror(),this._syncValidity(),this._drawValue(),this._syncReset(),this.renderList(),this._wire(),br(this,this.querySelector(`.wui-select-control`)),this._mountParts(e)}_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||`Select`}_snapshotDeclared(){if(this._declared)return;let e=[...this.querySelectorAll(`:scope > wui-option`)];e.length&&(this._declared=e.map(e=>{let t={value:e.getAttribute(`value`)??vs(e).trim(),label:e.innerHTML,[pi]:!0,selected:e.hasAttribute(`selected`)};for(let[n,r]of us){let i=e.getAttribute(n);i&&(t[r]=i)}return e.hasAttribute(`disabled`)&&(t.disabled=!0),t}))}_readOptions(){return this.mode===`country`?this._partOptions||[]:this._partOptions?this._partOptions:this._optionsProp?this._optionsProp:(this._snapshotDeclared(),this._declared||[])}_listOptions(){let e=this._readOptions(),t=this.getAttribute(`value-label`);if(this.mode!==`search`||!t||this._value===``)return e;let n=String(this._value);return e.some(e=>String(e.value)===n)?e:[...e,{value:n,label:t}]}_declaredSelected(){return this._optionsProp?[]:(this._declared??[]).filter(e=>e.selected).map(e=>String(e.value))}_preselect(){let e=this._readOptions(),t=this._value!==``&&e.find(e=>String(e.value)===this._value)||e.find(e=>`selected`in e&&!!e.selected);t&&(this._value=String(t.value))}_optionFor(e){let t=String(e),n=this._readOptions().find(e=>String(e.value)===t);return n?(this._known.set(t,n),n):this._known.get(t)}_placeholder(){return this.getAttribute(`placeholder`)||ss[this.mode]}_hasValue(){return Array.isArray(this._value)?this._value.length>0:this._value!==``}_selectedValues(){return Array.isArray(this._value)?this._value:this._value===``?this._listOptions().some(e=>String(e.value)===``)?[``]:[]:[this._value]}_applyValue(){this._syncMirror(),this._syncValidity(),this._rendered&&(this._drawValue(),this._syncReset(),this.renderList())}_syncMirror(){q(this.mode)?Tr(this,this._selectedValues()):V(this,this._value)}_drawValue(){let e=this._refs();if(!e.value)return;let t=q(this.mode),n=t?void 0:this._optionFor(this._value);this._syncTitle(n),this._syncValueAvatar(),this._activePartsList().some(e=>e.renderValue?.()===!0)||(t?(e.value.classList.remove(`wui-select-placeholder`),e.value.textContent=``):(e.value.classList.toggle(`wui-select-placeholder`,!n),e.value.innerHTML=n?vi(n):W(this._placeholder())))}_syncTitle(e){let t=this.querySelector(`.wui-select-control`);if(!t)return;let n=e&&!this.hasAttribute(`title`)?xi(e).trim():``;n?t.setAttribute(`title`,n):t.removeAttribute(`title`)}_syncValueAvatar(){let e=this.querySelector(`.wui-select-control`);if(!e)return;e.querySelector(`:scope > .wui-select-value-avatar`)?.remove();let t=!q(this.mode)&&this._hasValue()?No({avatar:this.getAttribute(`value-avatar`),initials:this.getAttribute(`value-initials`)},`avatar-xs`):``;e.classList.toggle(`wui-has-value-avatar`,!!t),t&&e.insertAdjacentHTML(`afterbegin`,`<span class="wui-select-value-avatar" aria-hidden="true">${t}</span>`)}_syncValidity(){let e=this._internals;if(typeof e?.setValidity==`function`){if(this.hasAttribute(`required`)&&!this._hasValue()){let t=this.querySelector(`.wui-select-control`);e.setValidity({valueMissing:!0},`Please fill in this field.`,t instanceof HTMLElement?t:void 0)}else e.setValidity({})}}_syncReset(){let e=J(this,`.wui-select-reset`,HTMLElement);e&&(e.hidden=!(this.hasAttribute(`clearable`)&&this._hasValue()&&!B(this)))}_syncInvalid(){let e=this.querySelector(`.wui-select-control`);e&&(this.hasAttribute(`aria-invalid`)||this._error?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}_syncError(){let e=J(this,`.wui-select-error`,HTMLElement);e&&(e.textContent=this._error,e.hidden=!this._error),this._syncInvalid()}_refs(){return{control:J(this,`.wui-select-control`,HTMLElement),value:J(this,`.wui-select-value`,HTMLElement),menu:J(this,`.wui-select-menu`,HTMLElement),list:J(this,`.wui-select-options`,HTMLElement),search:J(this,`.wui-select-search input`,HTMLInputElement),input:J(this,`.wui-select-draft`,HTMLInputElement)}}_menuOpen(){let e=J(this,`.wui-select-menu`,HTMLElement);return e!==null&&M(e)}_hoverZone(e){if(!(e instanceof Element))return!1;let t=e.closest(`.wui-select-control, .wui-select-menu`);return t!==null&&this.contains(t)}_hoverEligible(){if(!this.hasAttribute(`open-on-hover`)||B(this)||this.mode===`tag`)return!1;let e=this._refs();return e.search===null&&e.input===null}_clearHover(){this._hoverTimer!==null&&clearTimeout(this._hoverTimer),this._hoverTimer=null}_autoSearch(){return this.mode===`single`&&this.getAttribute(`searchable`)===null&&this._readOptions().length>os}_visible(){let e=this._refs();return e.list?_s(e.list,`.wui-select-option`):[]}_setActive(e,{reveal:t=!0}={}){let n=this._refs();if(!n.list||!n.control)return;let r=this._visible();this._active=e;let i=e>=0?r[e]??null:null;Ro(n.list,i),i?(t&&i.scrollIntoView({block:`nearest`}),n.control.setAttribute(`aria-activedescendant`,i.id)):n.control.removeAttribute(`aria-activedescendant`)}_actionRows(){let e=[];for(let t of this._activePartsList()){let n=t.actionRow?.(this._query);n&&e.push(n)}return e}_recents(){if(this._query.trim()!==``)return null;for(let e of this._activePartsList()){let t=e.recents?.(this._listOptions());if(t)return t}return null}_menuPlacement(e,t){let n=this.hasAttribute(`open`)?{below:!0}:{};if(this.getAttribute(`density`)!==`compact`)return{matchWidth:!0,...n};let r=e.getBoundingClientRect();return t.style.width=`max-content`,t.style.minWidth=`${r.width}px`,t.style.maxWidth=`280px`,n}_anchorMenu(){let e=this._refs();e.control&&e.menu&&this._menuOpen()&&x(e.control,e.menu,this._menuPlacement(e.control,e.menu))}_showMenu(e,t){A(e,t,{...this._menuPlacement(e,t),mode:`auto`,keepOffscreen:this.hasAttribute(`open`),onClosed:()=>this._onPanelClosed()}),this._panelShown=!0}_onPanelClosed(){if(!this._panelShown)return;this._panelShown=!1;let e=this._refs();e.control&&(e.control.setAttribute(`aria-expanded`,`false`),this._setActive(-1),this._nav?.clearTypeahead(),this.dispatchEvent(new CustomEvent(`wui-select:close`,{bubbles:!0})))}_open({focus:e=!0}={}){let t=this._refs();if(!t.menu||!t.control)return;let n=this._menuOpen();this._hoverOpened=!1,t.control.setAttribute(`aria-expanded`,`true`),this._query=t.input?t.input.value:``,this._ownsFilter=this._ownsFilter&&this._query!==``;let r=J(this,`.wui-select-search .wui-select-clear`,HTMLElement);if(r&&(r.hidden=!0),t.search&&(t.search.value=``),this.renderList(),n||this._showMenu(t.control,t.menu),e&&(t.search?.focus(),this._setActive(this._visible().findIndex(e=>e.classList.contains(`selected`)))),!n){this.dispatchEvent(new CustomEvent(`wui-select:open`,{bubbles:!0}));for(let e of this._activePartsList())e.onOpen?.()}}_close({force:e=!1}={}){if(!e&&this.hasAttribute(`open`))return;let t=this._refs();if(!t.menu||!t.control)return;this._hoverOpened=!1;let n=t.menu.contains(document.activeElement);M(t.menu)&&j(t.menu),this._onPanelClosed(),n&&t.control.focus()}_onQueryChange(e){this._query=e,this._setActive(-1);let t=J(this,`.wui-select-search .wui-select-clear`,HTMLElement);t&&(t.hidden=!e);let n=!1;for(let t of this._activePartsList())t.onQuery?.(e)===!0&&(n=!0);this._ownsFilter=n,this.renderList()}_pick(e){if(e.getAttribute(`aria-disabled`)===`true`)return;let t=e.dataset.custom===`true`,n=e.dataset.value??``,r=t?{value:n,label:vs(e).trim()}:this._listOptions().find(e=>String(e.value)===n)??{value:n,label:n},i=this._activePartsList().some(e=>e.onPick?.(r,{isCustom:t})===!0);q(this.mode)||(i||this.commit(n,{isCustom:t}),this._close(),this._refs().control?.focus())}_draftOpens(){return this.mode===`multiple`?this.hasAttribute(`allow-custom`):this.mode===`tag`&&Qo(this)}_onKeyDown(e){if(!B(this)){for(let t of this._activePartsList())if(t.onKey?.(e)===!0)return;if(!this._menuOpen()){if(e.target instanceof HTMLInputElement){if(e.key!==`ArrowDown`||!this._draftOpens())return;this._open({focus:!1})}else{(e.key===`ArrowDown`||Zn(e)||e.key===` `)&&(e.preventDefault(),this._open({focus:!0}));return}}N(this._nav,`Listbox keys are not wired.`).handler(e)}}_wire(){this._teardown();let e=this._refs(),t=e.control,n=e.list;if(!t||!e.menu||!n)return;let r=N(J(this,`.wui-select`,HTMLElement),`The select wrapper is missing.`),i=J(this,`.wui-select-search .wui-select-clear`,HTMLElement),a=J(this,`.wui-select-reset`,HTMLElement);this._nav=Lo({getVisibleOptions:()=>this._visible(),getActive:()=>this._active,setActive:e=>this._setActive(e),onEnter:(e,t)=>{if(e)this._pick(e);else if(this._query.trim()!==``){let e=t.find(e=>e.dataset.custom===`true`);if(e)this._pick(e);else if(t.length===1){let e=t[0];e&&this._pick(e)}}},onEscape:e=>{e.preventDefault(),this._nav?.clearTypeahead(),this._close(),t.focus()}}),r.addEventListener(`keydown`,e=>this._onKeyDown(e)),r.addEventListener(`input`,e=>{let t=e.target;if(!(t instanceof HTMLInputElement)||!t.matches(`.wui-select-input, .wui-select-draft`))return;this._onQueryChange(t.value);let n=t.matches(`.wui-select-draft`),r=this._visible().length>0||this._actionRows().length>0;n&&r&&!this._menuOpen()&&!B(this)&&this._draftOpens()&&this._open({focus:!1})}),r.addEventListener(`focusout`,e=>{let t=e.relatedTarget;t instanceof Node&&this.contains(t)||!this._activePartsList().some(e=>e.onBlur?.()===!0)&&t&&this._close()}),i?.addEventListener(`click`,()=>{let t=N(e.search,`The search input is missing.`);t.value=``,this._onQueryChange(``),t.focus()}),t.addEventListener(`pointerdown`,()=>{this._pressOpen=this._menuOpen()}),t.addEventListener(`click`,e=>{if(e.target instanceof Element&&e.target.closest(`[data-remove]`))return;if(this.mode===`tag`){if(B(this))return;this._refs().input?.focus(),!this._menuOpen()&&this._draftOpens()&&this._open({focus:!1});return}if(e.target instanceof HTMLInputElement){!this._menuOpen()&&!B(this)&&this._open({focus:!1});return}let t=e.detail>0&&this._pressOpen!==null?this._pressOpen:this._menuOpen();this._pressOpen=null,this._clearHover(),this._hoverOpened&&t?(this._hoverOpened=!1,this._open({focus:!0})):t?this._close():B(this)||this._open({focus:!0})}),a?.addEventListener(`click`,e=>{e.stopPropagation(),this.commit(q(this.mode)?[]:``),this._close(),t.focus()}),n.addEventListener(`click`,n=>{let r=gs(n).closest(`.wui-select-option`);if(r instanceof HTMLElement&&(this._pick(r),q(this.mode))){let n=this.querySelector(`.wui-select-draft`);(e.search??(n instanceof HTMLElement?n:t)).focus()}}),n.addEventListener(`mousedown`,e=>{q(this.mode)&&e.target instanceof Element&&e.target.closest(`.wui-select-option`)&&e.preventDefault()}),n.addEventListener(`mousemove`,e=>{let t=gs(e).closest(`.wui-select-option`);t instanceof HTMLElement&&!t.classList.contains(`is-active`)&&this._setActive(this._visible().indexOf(t),{reveal:!1})}),n.addEventListener(`mouseleave`,()=>this._setActive(-1)),n.addEventListener(`error`,e=>{let t=e.target;t instanceof Element&&t.classList.contains(`avatar-img`)&&t.remove()},!0),this.hasAttribute(`open`)&&this._open({focus:!1})}_teardown(){this._nav?.teardown()}_dropMenu(){let e=J(this,`.wui-select-menu`,HTMLElement);e&&j(e)}_activePartsList(){return this._partsMounted?N(this._parts,`The mounted parts are missing.`):[]}_ensureParts(){if(!this.isConnected)return;let e=ps(this,this.mode),t=e.join(`,`);if(t===this._partSig)return;this._teardownParts(),this._parts=null,this._partSig=t;let n=++this._partToken;Promise.all(e.map(e=>ys(this,e))).then(e=>{n===this._partToken&&(this._parts=e.filter(e=>e!==null),this._mountParts())})}_mountParts(e={draft:``,query:``}){if(!this._parts||this._partsMounted||!this._rendered||!this.isConnected)return;this._partsMounted=!0;let t=ts(this._refs());for(let n of this._parts)n.mount(this,t,{carry:e});this._drawValue(),this.renderList()}_teardownParts(){let e=this._activePartsList();this._partsMounted=!1;for(let t of e)t.teardown()}_remountParts(){if(!this._partsMounted)return;let e=this._carry();this._teardownParts(),this._mountParts(e)}_carry(){let e=this._refs();return{draft:e.input?.value??``,query:e.search?.value??``}}},ts=e=>{let{control:t,value:n,menu:r,list:i}=e;return{control:N(t,`control missing`),value:N(n,`value missing`),menu:N(r,`menu missing`),list:N(i,`list missing`),search:e.search,input:e.input}},ns=e=>Wo.includes(e),rs=[`comfortable`,`compact`],is=150,as=250,os=10,ss={single:`Select…`,search:`Select…`,multiple:`Select…`,tag:`Add…`,country:`Select country`},cs=new Set([`countries`,`suggested`,`suggested-label`,`all-countries-label`,`max-tags`,`pattern`,`collapse-chips`,`source`,`remote`,`min-chars`]),ls=new Set([`separators`,`allow-duplicates`,`invalid-message`,`create-label`,`add-label`,`selected-text`,`clear-all-label`,`value-label`,`value-avatar`,`value-initials`,`hint-text`,`recents-key`,`recents-limit`,`recents-label`]),us=[[`icon`,`icon`],[`description`,`description`],[`meta`,`meta`],[`group`,`group`],[`avatar`,`avatar`],[`initials`,`initials`],[`disabled-hint`,`disabledHint`]],ds=(e,t)=>t?Array.isArray(e)?e.map(String):e==null||e===``?[]:String(e).split(`,`).map(e=>e.trim()).filter(Boolean):Array.isArray(e)?e.length?String(e[0]):``:e==null?``:String(e),fs=(e,t)=>t===`multiple`?Qo(e)?[`chips`,`search`]:[`chips`]:t===`search`?[`search`]:t===`country`?[`country`]:t===`tag`?Qo(e)?[`chips`,`search`]:[`chips`]:[],ps=(e,t)=>e.hasAttribute(`recents-key`)?[`recents`,...fs(e,t)]:fs(e,t),ms=`This control could not load. Reload the page.`,hs=e=>typeof e==`object`&&!!e&&`default`in e&&typeof e.default==`function`,gs=e=>{if(e.target instanceof Element)return e.target;throw Error(`The event target is not an element.`)},J=(e,t,n)=>{let r=e.querySelector(t);return r instanceof n?r:null},_s=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),vs=e=>{let t=e.textContent;if(t===null)throw Error(`The element has no text.`);return t},ys=(e,t)=>Xo(t).then(e=>{if(!hs(e))throw Error(`The part ${t} has no default export.`);return e.default()}).catch(()=>(document.dispatchEvent(new CustomEvent(Fr,{bubbles:!0,composed:!0,detail:{chunk:t}})),e.setError(ms),null)),bs=`wui-shortcuts-open-change`;function xs(e,t){let n=e.querySelector(t);return n instanceof HTMLElement?n:null}function Ss(e,t){return[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement)}var Cs=class extends s{_doc;_onKeyDown;_onClick;_onDocClick;_onPointerDown;_onPressEnd;_pressedOpen;_pinned;_mirroring;static get observedAttributes(){return[`open`,`no-trigger`]}constructor(){super(),this._doc=null,this._pressedOpen=!1,this._pinned=!1,this._mirroring=!1,this._onKeyDown=e=>this._keydown(e),this._onClick=e=>this._click(e),this._onDocClick=e=>{let t=P(e.target,`[data-wui-shortcuts-open]`)?.getAttribute(`data-wui-shortcuts-open`);t&&this.matches(t)&&this.setOpen(!0)},this._onPointerDown=e=>{P(e.target,`.wui-shortcut-toggle`)&&(this._pressedOpen=this.open)},this._onPressEnd=e=>{e.type===`pointerup`&&P(e.target,`.wui-shortcut-toggle`)||(this._pressedOpen=!1)}}connectedCallback(){this._doc=this.ownerDocument,this._doc.addEventListener(`keydown`,this._onKeyDown),this._doc.addEventListener(`click`,this._onDocClick),this._doc.addEventListener(`pointerup`,this._onPressEnd,!0),this._doc.addEventListener(`pointercancel`,this._onPressEnd,!0),this.addEventListener(`click`,this._onClick),this.addEventListener(`pointerdown`,this._onPointerDown,!0),this.hasAttribute(`open`)&&!this.open&&(this._pinned=!0,this.setOpen(!0,{focus:!1})),this._syncTrigger()}attributeChangedCallback(e,t,n){e===`no-trigger`?this._syncTrigger():(this._mirroring||(this._pinned=n!==null),this._sheet()&&n!==null!==this.open&&this.setOpen(n!==null))}disconnectedCallback(){let e=this._sheet();e&&j(e),this._doc?.removeEventListener(`keydown`,this._onKeyDown),this._doc?.removeEventListener(`click`,this._onDocClick),this._doc?.removeEventListener(`pointerup`,this._onPressEnd,!0),this._doc?.removeEventListener(`pointercancel`,this._onPressEnd,!0),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`pointerdown`,this._onPointerDown,!0),this._doc=null}get open(){let e=this._sheet();return!!(e&&M(e))}set open(e){let t=e===!0||e===``||e===`true`;this._pinned=t,this._sheet()?t!==this.open&&this.setOpen(t):this.toggleAttribute(`open`,t)}setOpen(e,{focus:t=!0}={}){let n=this._sheet();if(!n)return;let r=xs(this,`.wui-shortcut-toggle`);e||(this._pinned=!1),e?(n.removeAttribute(`hidden`),A(this.hasAttribute(`no-trigger`)?r??this:N(r,`<wui-shortcuts> needs its toggle to anchor the sheet.`),n,{mode:`auto`,side:`top`,align:`end`,flipAlign:!0,gap:8,keepOffscreen:this._pinned,onClosed:()=>{this._pinned=!1,this._mirror(!1)}})):j(n),this._mirror(e),t&&(e?xs(n,`.wui-shortcut-close`)?.focus():r?.focus())}_mirror(e){let t=this._sheet();t&&(t.hidden=!e),xs(this,`.wui-shortcut-toggle`)?.setAttribute(`aria-expanded`,String(e)),this.hasAttribute(`open`)!==e&&(this._mirroring=!0,this.toggleAttribute(`open`,e),this._mirroring=!1,this.dispatchEvent(new CustomEvent(bs,{bubbles:!0,detail:{open:e}})))}_sheet(){return xs(this,`.wui-shortcut-sheet`)}_syncTrigger(){let e=xs(this,`.wui-shortcut-toggle`);e&&(e.hidden=this.hasAttribute(`no-trigger`))}_scope(){let e=this.closest(`[${je}]`);return e instanceof HTMLElement?e:null}_items(){let e=this.getAttribute(`items`);return e?Ss(N(this._scope()??this._doc,`WuiShortcuts used before it was connected`),e):[]}_click(e){let t=e.target;if(t instanceof Element){if(t.closest(`.wui-shortcut-toggle`)){let e=this._pressedOpen;this._pressedOpen=!1,this.setOpen(!e&&!this.open)}else t.closest(`.wui-shortcut-close`)&&this.setOpen(!1)}}_tickFocused(){let e=this._items(),t=N(this._doc,`WuiShortcuts used before it was connected`).activeElement,n=t?.closest?.(`li, tr`),r=e.find(e=>e===t||e.contains(t)||n?.contains(e)),i=(r?.closest(`li, tr`)??r)?.querySelector(`input[type="checkbox"]`);i instanceof HTMLInputElement&&i.click()}_focusSearch(){let e=this.getAttribute(`search`);if(!e)return;let t=N(this._doc,`WuiShortcuts used before it was connected`);(xs(this._scope()??t,e)??xs(t,e))?.focus()}_keydown(e){if(e.defaultPrevented)return;let t=He(e);if(!t)return;if(t===`esc`&&this.open){e.preventDefault(),this.setOpen(!1);return}let n=this._scope(),r={help:()=>this.setOpen(!this.open)};if(this.getAttribute(`items`)&&(r.j=()=>Xe(this._items(),1),r.k=()=>Xe(this._items(),-1),r.x=()=>this._tickFocused()),this.getAttribute(`search`)&&(r.slash=()=>this._focusSearch()),r[t]){Ye(e,r,n);return}if(t===`enter`)return;let i=N(this._doc,`WuiShortcuts used before it was connected`),a=e.target instanceof Node?e.target:null;if(qe(i)||!Je(a,n)||Ge(a))return;let o=Ue(t),s=Ss(this,`.wui-shortcut-keys [data-shortcut]`).find(e=>e.dataset.shortcut===o);if(!s)return;let c=(n??i).querySelector(`[aria-current="true"]`)?.closest(`[data-key]`),l=c instanceof HTMLElement?c.dataset.key??null:null;if(!this.dispatchEvent(new CustomEvent(`wui:shortcut`,{bubbles:!0,cancelable:!0,detail:{key:o,itemKey:l}}))){e.preventDefault();return}let u=s.dataset.target,d=u?xs(i,u):null;d&&(e.preventDefault(),d.click())}},ws=3,Ts=`Show more`,Es=`Show less`,Ds=class extends s{_width;_observer;_toggle;_onClick;constructor(){super(),this._width=-1,this._observer=null,this._toggle=null,this._onClick=()=>this.toggle()}connectedCallback(){let e=this.querySelector(`.wui-show-more-toggle`);if(this._toggle=e instanceof HTMLButtonElement?e:null,!this._toggle)return;let t=Number.parseInt(this.getAttribute(`lines`)??``,10);this.style.setProperty(`--wui-show-more-lines`,String(t>=1?t:ws)),this._toggle.addEventListener(`click`,this._onClick),this._sync(),this._check(),typeof ResizeObserver<`u`&&(this._observer=new ResizeObserver(()=>{this.clientWidth!==this._width&&this._check()}),this._observer.observe(this))}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._toggle?.removeEventListener(`click`,this._onClick),this._toggle=null}get expanded(){return this.hasAttribute(`expanded`)}toggle(e=!this.expanded){this.toggleAttribute(`expanded`,!!e),this._sync(),this.dispatchEvent(new CustomEvent(`wui:show-more:toggle`,{bubbles:!0,detail:{expanded:this.expanded}}))}_sync(){let e=N(this._toggle,`WuiShowMore used before it was connected`),t=this.expanded;e.setAttribute(`aria-expanded`,String(t)),e.textContent=t?this.getAttribute(`less-label`)||Es:this.getAttribute(`more-label`)||Ts}_check(){let e=this.querySelector(`.wui-show-more-body`);if(!(e instanceof HTMLElement))return;this._width=this.clientWidth;let t=this.expanded;t&&this.removeAttribute(`expanded`);let n=e.scrollHeight>e.clientHeight+1;t&&this.setAttribute(`expanded`,``);let r=N(this._toggle,`WuiShowMore used before it was connected`);r.hidden=!n}},Os=class extends s{_measure;_resize;_mutation;_ownTabindex;constructor(){super(),this._measure=()=>this.measure(),this._resize=null,this._mutation=null,this._ownTabindex=!1}connectedCallback(){this.measure(),this.addEventListener(`mouseover`,this._measure),typeof ResizeObserver<`u`&&(this._resize=new ResizeObserver(this._measure),this._resize.observe(this)),this._mutation=new MutationObserver(this._measure),this._mutation.observe(this,{childList:!0,subtree:!0,characterData:!0})}disconnectedCallback(){this.removeEventListener(`mouseover`,this._measure),this._resize?.disconnect(),this._mutation?.disconnect(),this._resize=null,this._mutation=null}measure(){let e=this.querySelector(`.wui-truncate-text`);e&&(e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight?(this.setAttribute(`data-wui-tooltip`,(e.textContent??``).replace(/\s+/g,` `).trim()),this.hasAttribute(`tabindex`)||(this.setAttribute(`tabindex`,`0`),this._ownTabindex=!0)):(this.removeAttribute(`data-wui-tooltip`),this._ownTabindex&&=(this.removeAttribute(`tabindex`),!1)))}},ks=`wui-whats-new-read`,As=`wui-whats-new:`,js=`data-wui-unread`,Ms=0,Ns=e=>{let t=Date.parse(e);return Number.isNaN(t)?-1/0:t},Ps=(e,t)=>Ns(t)>Ns(e)?t:e,Fs=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},Is=class extends s{_doc;_stored;_observer;_onTriggerClick;_closeFocus;static get observedAttributes(){return[`storage-key`,`read-through`,`indicator`]}constructor(){super(),this._doc=null,this._stored=``,this._closeFocus=null,this._observer=null,this._onTriggerClick=()=>this.isOpen?this.close(!0):this.open()}get isOpen(){let e=this._panel;return e!==null&&M(e)}get _trigger(){return Fs(this,`.wui-whats-new-trigger`)}get _panel(){return Fs(this,`.wui-whats-new-panel`)}get _dot(){return Fs(this,`.wui-whats-new-dot`)}connectedCallback(){this._doc=this.ownerDocument;let e=this._panel,t=this._trigger;e&&t&&(e.id||=`wui-whats-new-${++Ms}`,t.setAttribute(`aria-controls`,e.id),t.setAttribute(`aria-expanded`,`false`),t.addEventListener(`click`,this._onTriggerClick),this._stored=this._load(),this._refresh(),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(()=>this._refresh()),this._observer.observe(e,{childList:!0,subtree:!0})))}disconnectedCallback(){let e=this._panel;e&&(this._closeFocus=!1,j(e),this._closeFocus=null),this._observer?.disconnect(),this._observer=null,this._trigger?.removeEventListener(`click`,this._onTriggerClick),this._doc=null}attributeChangedCallback(e,t,n){t!==n&&this._doc&&(e===`storage-key`&&(this._stored=this._load()),this._refresh())}open(){let e=N(this._trigger,`<wui-whats-new> needs its trigger to open.`),t=N(this._panel,`<wui-whats-new> needs its panel to open.`);this.isOpen||(A(e,t,{mode:`auto`,clampHeight:!0,onClosed:()=>this._closed()}),e.setAttribute(`aria-expanded`,`true`),t.focus({preventScroll:!0}),this._markRead())}close(e){let t=this._panel;t&&this.isOpen&&(this._closeFocus=e,j(t))}_closed(){let e=this._closeFocus??this._panel?.contains(this.ownerDocument.activeElement)??!1;this._closeFocus=null,this._settle(e)}_settle(e){this._trigger?.setAttribute(`aria-expanded`,`false`),this._refresh(),e&&this._trigger?.focus()}_entries(){let e=[];for(let t of this.querySelectorAll(`.wui-whats-new-entry`))t instanceof HTMLElement&&e.push({entry:t,date:t.querySelector(`time[datetime]`)?.getAttribute(`datetime`)??``});return e}_newest(){return this._entries().reduce((e,{date:t})=>Ps(e,t),``)}_seenPoint(){return Ps(this._stored,this.getAttribute(`read-through`)??``)}_refresh(){let e=this._seenPoint(),t=this._entries(),n=0;for(let{entry:r,date:i}of t){let t=Ns(i)>Ns(e);t&&n++,this.isOpen&&r.hasAttribute(js)||r.toggleAttribute(js,t)}this.toggleAttribute(js,n>0);let r=this._dot;r&&(r.textContent=this.getAttribute(`indicator`)===`count`&&n>0?String(n):``)}_markRead(){let e=this._newest();!e||Ns(e)<=Ns(this._seenPoint())||(this._stored=Ps(this._stored,e),this._save(this._stored),this._refresh(),this.dispatchEvent(new CustomEvent(ks,{bubbles:!0,detail:{through:e}})))}_storage(){let e=this.getAttribute(`storage-key`);if(!e)return null;try{let t=this.ownerDocument.defaultView;return t?{store:t.localStorage,key:As+e}:null}catch{return null}}_load(){let e=this._storage();return e?e.store.getItem(e.key)??``:this._stored}_save(e){let t=this._storage();t&&t.store.setItem(t.key,e)}},Ls=n({APP_BUTTON_MARKER:()=>Rs,buttonClass:()=>Hs}),Rs=`AppButton`,zs=new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),Bs={solid:e=>`btn-${e}`,soft:e=>`btn-soft-${e}`,outline:e=>`btn-outline-${e}`,ghost:e=>`btn-ghost-${e}`,link:e=>`btn-link-${e}`,glass:()=>`btn-glass`};function Vs(e){return Object.hasOwn(Bs,e)}function Hs(e=`primary`,t=`solid`,n=`md`){if(!zs.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!Vs(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=Bs[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}var Us=n({COPY_FEEDBACK_MS:()=>Ws,copyTextToClipboard:()=>Gs}),Ws=2e3;async function Gs(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch(e){if(!(e instanceof DOMException))throw e}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.top=`0`,t.style.left=`0`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),!!n}catch(e){if(!(e instanceof DOMException))throw e;return!1}}var Ks=n({MENTION_ID_PATTERN:()=>qs,mentionLabel:()=>Xs,mentionTextFromValue:()=>$s,mentionValueFromText:()=>ec,mentionedIds:()=>tc,parseMentionValue:()=>Qs}),qs=/^[A-Za-z0-9_.:-]{1,64}$/,Js=/@(\\+)\[|@\[([^[\]\n]{1,100})\]\(([A-Za-z0-9_.:-]{1,64})\)/g,Ys=/@(\\*)\[/g;function Xs(e){return String(e??``).replace(/[[\]\r\n]+/g,` `).replace(/\s+/g,` `).trim().slice(0,100)}var Zs=e=>e.replace(Ys,(e,t)=>`@\\${t}[`);function Qs(e){let t=String(e??``),n=[],r=e=>{if(!e)return;let t=n[n.length-1];t&&`text`in t?t.text+=e:n.push({text:e})},i=0;for(let e of t.matchAll(Js))r(t.slice(i,e.index)),e[1]===void 0?n.push({id:e[3]??``,label:e[2]??``}):r(`@${e[1].slice(1)}[`),i=e.index+e[0].length;return r(t.slice(i)),n}function $s(e){let t=``,n=[];for(let r of Qs(e)){if(`text`in r){t+=r.text;continue}let e=`@${r.label}`;n.push({start:t.length,end:t.length+e.length,id:r.id,label:r.label}),t+=e}return{text:t,mentions:n}}function ec(e,t=[]){let n=String(e??``),r=[...t].sort((e,t)=>e.start-t.start),i=``,a=0;for(let e of r)e.start<a||n.slice(e.start,e.end)!==`@${e.label}`||!qs.test(e.id)||(i+=Zs(n.slice(a,e.start)),i+=`@[${e.label}](${e.id})`,a=e.end);return i+Zs(n.slice(a))}function tc(e){let t=[];for(let n of Qs(e))`id`in n&&!t.includes(n.id)&&t.push(n.id);return t}var nc=n({bindMenuKeys:()=>sc}),rc=500,ic=10,ac=new Set([`INPUT`,`TEXTAREA`,`SELECT`]);function oc(e){return e instanceof HTMLElement?ac.has(e.tagName)||e.isContentEditable:!1}function sc(e,t){let{items:n,typeahead:r=!0}=t,i=``,a=null,o=()=>{a!==null&&clearTimeout(a),a=null,i=``},s=e=>{let t=n().filter(e=>!e.closest(`[hidden]`)),s=t.length;if(s===0)return;let c=e.target,l=t.findIndex(e=>c instanceof Node&&e.contains(c)),u=n=>{e.preventDefault(),e.stopPropagation(),t[n]?.focus()},d=oc(c);if(e.key===`ArrowDown`){u(l<0?0:(l+1)%s);return}if(e.key===`ArrowUp`){u(l<0?s-1:(l-1+s)%s);return}if(e.key===`Home`&&!d){u(0);return}if(e.key===`End`&&!d){u(s-1);return}if(e.key===`PageDown`){u(Math.min((l<0?-1:l)+ic,s-1));return}if(e.key===`PageUp`){u(Math.max((l<0?s:l)-ic,0));return}if(!r||!/^\S$/.test(e.key)||e.ctrlKey||e.metaKey||e.altKey||d)return;e.preventDefault(),e.stopPropagation(),a!==null&&clearTimeout(a),i+=e.key.toLowerCase(),a=setTimeout(o,rc);let f=i.length>1&&i.split(``).every(e=>e===i[0]),p=f?i[0]??``:i,m=i.length===1||f?l+1:Math.max(l,0);for(let e=0;e<s;e++){let n=(m+e)%s;if((t[n]?.textContent??``).trim().toLowerCase().startsWith(p)){t[n]?.focus();return}}};return e.addEventListener(`keydown`,s),()=>{e.removeEventListener(`keydown`,s),o()}}var cc=n({deriveStepStatus:()=>lc,stepperHeaderItems:()=>uc});function lc(e,t){return typeof t==`number`?e<t?`done`:e===t?`active`:`pending`:`pending`}function uc(e,t){let{statusOf:n,journey:r,connectors:i}=t;return e.map((t,a)=>{let o=n(a),s;return s=o===`done`?{icon:`check`}:o===`error`?{icon:`alert-triangle`}:o===`skipped`?{icon:`minus`}:t.icon?{icon:t.icon}:{number:a+1},{index:a,status:o,className:o===`pending`?`step`:`step ${o}`,glyph:s,current:o===`active`,line:r&&i&&a<e.length-1?{done:o===`done`}:null}})}var dc=n({SELECT_ALL_LABEL:()=>fc,SELECT_CELL_CLASS:()=>Y,SELECT_ROW_LABEL:()=>pc,addRowSelectCells:()=>xc,addSelectColumn:()=>Sc,attachShiftRange:()=>Tc,createSelectHeaderCell:()=>hc,createSelectRowCell:()=>gc,createSelectSpacerCell:()=>_c,syncSelectAll:()=>Cc}),fc=`Select all rows`,pc=`Select row`,Y=`wui-select-cell`,mc=(e,t)=>{let n=e.createElement(`input`);return n.type=`checkbox`,n.className=`wui-check`,n.setAttribute(`aria-label`,t),n};function hc(e=document){let t=e.createElement(`th`);return t.className=Y,t.appendChild(mc(e,fc)),t}function gc(e=document,{disabled:t=!1}={}){let n=e.createElement(`td`);n.className=Y;let r=mc(e,pc);return r.disabled=t,n.appendChild(r),n}function _c(e=document){let t=e.createElement(`td`);return t.className=Y,t}var vc=e=>e.firstElementChild?.classList.contains(Y),yc=e=>e.matches(`.wui-group-row, .wui-virtual-spacer, .wui-row-expanded`),bc=(e,t,n)=>[...e.querySelectorAll(t)].filter(e=>e instanceof n);function xc(e){for(let t of e){if(vc(t)||yc(t))continue;let e=t.getAttribute(`data-row-selectable`)===`false`;t.insertBefore(gc(t.ownerDocument,{disabled:e}),t.firstChild)}}function Sc(e){let t=e.querySelector(`thead tr`);if(!(t instanceof HTMLTableRowElement))return null;vc(t)||t.insertBefore(hc(e.ownerDocument),t.firstChild),xc(bc(e,`tbody tr`,HTMLTableRowElement));for(let t of bc(e,`tfoot tr`,HTMLTableRowElement))vc(t)||t.insertBefore(_c(e.ownerDocument),t.firstChild);let n=t.querySelector(`.${Y} .wui-check`);return n instanceof HTMLInputElement?n:null}function Cc(e){let t=e.querySelector(`thead .${Y} .wui-check`),n=bc(e,`tbody tr .wui-check:not(:disabled)`,HTMLInputElement),r=n.length,i=n.filter(e=>e.checked).length;t instanceof HTMLInputElement&&(t.checked=r>0&&i===r,t.indeterminate=i>0&&i<r);for(let t of bc(e,`tbody tr`,HTMLTableRowElement)){let e=t.querySelector(`.wui-check`);t.classList.toggle(`is-selected`,e instanceof HTMLInputElement&&e.checked)}return{selected:i,total:r}}var wc=`tbody .${Y} .wui-check:not(:disabled)`;function Tc(e,t){let n=null,r=e=>e instanceof Element&&e.matches(`.wui-select-cell .wui-check:not(:disabled)`)&&!!e.closest(`tbody`);e.addEventListener(`mousedown`,e=>{e.shiftKey&&r(e.target)&&e.preventDefault()}),e.addEventListener(`click`,i=>{let a=i.target;if(r(a)){if(i.shiftKey&&n?.isConnected&&n!==a){let r=bc(e,wc,HTMLInputElement),i=r.indexOf(n),o=r.indexOf(a);if(i>=0&&o>=0){let e=[];for(let t of r.slice(Math.min(i,o),Math.max(i,o)+1))t!==a&&t.checked!==a.checked&&(t.checked=a.checked,e.push(t));e.length&&t?.(e,a.checked)}}n=a}})}var Ec=n({matchSegments:()=>Dc});function Dc(e,t){let n=String(e??``),r=String(t??``).trim();if(!r||!n)return[{text:n,match:!1}];let i=n.toLowerCase(),a=r.toLowerCase();if(i.length!==n.length)return[{text:n,match:!1}];let o=[],s=0,c=i.indexOf(a,s);for(;c!==-1;)c>s&&o.push({text:n.slice(s,c),match:!1}),o.push({text:n.slice(c,c+a.length),match:!0}),s=c+a.length,c=i.indexOf(a,s);return s<n.length&&o.push({text:n.slice(s),match:!1}),o}var Oc=n({TOOLTIP_ATTRIBUTE:()=>kc,TOOLTIP_CLASS_ATTRIBUTE:()=>jc,TOOLTIP_HTML_ATTRIBUTE:()=>Mc,TOOLTIP_ID_ATTRIBUTE:()=>Nc,TOOLTIP_OPEN_ATTRIBUTE:()=>Pc,TOOLTIP_PLACEMENT_ATTRIBUTE:()=>Ac,showPinnedTooltips:()=>Ic,wireTooltips:()=>Fc}),kc=`data-wui-tooltip`,Ac=`data-wui-tooltip-placement`,jc=`data-wui-tooltip-class`,Mc=`data-wui-tooltip-html`,Nc=`data-wui-tooltip-id`,Pc=`data-wui-tooltip-open`;function Fc(e){Bc.has(e)||(Bc.add(e),e.addEventListener(`pointerover`,t=>{let n=Gc(t.target);n&&!qc(e,n)&&Xc(e,n,!1)}),e.addEventListener(`pointerout`,t=>{let n=Hc(e).transient;n&&Gc(t.target)===n.trigger&&(t.relatedTarget instanceof Node&&n.trigger.contains(t.relatedTarget)||Zc(e,n))}),e.addEventListener(`focusin`,t=>{let n=t.target;if(!(n instanceof Element)||!n.matches(`:focus-visible`))return;let r=Gc(n);r&&!qc(e,r)&&Xc(e,r,!1)}),e.addEventListener(`focusout`,t=>{let n=Hc(e).transient;n&&Gc(t.target)===n.trigger&&(t.relatedTarget instanceof Node&&n.trigger.contains(t.relatedTarget)||Zc(e,n))}),e.addEventListener(`click`,t=>{let n=Hc(e).transient;n&&Gc(t.target)===n.trigger&&Zc(e,n)}))}function Ic(e){let t=e instanceof Document?e:e.ownerDocument;for(let n of e.querySelectorAll(`[${Pc}]`))Xc(t,n,!0)}var Lc=[`top`,`bottom`,`start`,`end`],Rc=`wui-tooltip`,zc=`[${kc}], [${Nc}]`,Bc=new WeakSet,Vc=new WeakMap;function Hc(e){let t=Vc.get(e);return t||(t={bubble:null,transient:null,pinned:new Map,pinnedCount:0,onEscape:t=>{t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),Qc(e))}},Vc.set(e,t)),t}function Uc(e){return Lc.includes(e)}function Wc(e){return e===`auto`||Uc(e)}function Gc(e){if(!(e instanceof Element))return null;let t=e.closest(zc);return t instanceof HTMLElement?t:null}function Kc(e,t){return e.transient?.trigger===t?e.transient:e.pinned.get(t)}function qc(e,t){return Kc(Hc(e),t)!==void 0}function Jc(e,t){let n=e.createElement(`div`);n.id=t,n.setAttribute(`role`,`tooltip`),n.setAttribute(`popover`,`manual`);let r=e.createElement(`div`);r.className=`tooltip-arrow`;let i=e.createElement(`div`);return i.className=`tooltip-inner`,n.append(r,i),{el:n,arrow:r,inner:i}}function Yc(e,t){return t.bubble||=Jc(e,Rc),t.bubble}function Xc(e,t,n){let r=t.getAttribute(kc),i=t.getAttribute(Nc);if(r===null&&i===null)throw Error(`a tooltip trigger carries ${kc} or ${Nc}`);if(r!==null&&i!==null)throw Error(`a tooltip trigger carries ${kc} or ${Nc}, not both`);let a=t.getAttribute(`data-wui-tooltip-placement`)??`top`;if(!Wc(a))throw Error(`${Ac} "${a}" is not auto, top, bottom, start or end`);let o=Hc(e);Zc(e,n?o.pinned.get(t):o.transient);let s,c=null,l=null,u=!1;if(i!==null){let t=e.getElementById(i);if(!(t instanceof HTMLElement))throw Error(`no element with id "${i}" for a tooltip`);s=t,c=e.createComment(`wui-tooltip`),s.replaceWith(c),l=s.getAttribute(`popover`),s.setAttribute(`popover`,`manual`)}else{let i=n?Jc(e,`${Rc}-pinned-${++o.pinnedCount}`):Yc(e,o);u=n;let c=t.getAttribute(`data-wui-tooltip-class`)??``;i.el.className=`tooltip wui-tooltip bs-tooltip-${a} ${c}`.trim(),t.hasAttribute(`data-wui-tooltip-html`)?i.inner.innerHTML=r??``:i.inner.textContent=r??``,s=i.el}let d=t.getAttribute(`aria-describedby`);t.setAttribute(`aria-describedby`,s.id),Ee(e).append(s),s.showPopover(),x(t,s,{side:a,align:`center`,gap:6,arrow:s.querySelector(`.tooltip-arrow`)});let f=new MutationObserver(()=>{t.isConnected||Zc(e,Kc(Hc(e),t))});f.observe(e,{childList:!0,subtree:!0});let p={el:s,trigger:t,pinned:n,own:u,home:c,popover:l,describedBy:d,watch:f};n?o.pinned.set(t,p):o.transient=p,e.addEventListener(`keydown`,o.onEscape,!0)}function Zc(e,t){if(!t)return;let n=Hc(e);t.pinned?n.pinned.delete(t.trigger):n.transient=null,!n.transient&&n.pinned.size===0&&e.removeEventListener(`keydown`,n.onEscape,!0),t.watch.disconnect(),t.el.hidePopover(),t.home?(t.popover===null?t.el.removeAttribute(`popover`):t.el.setAttribute(`popover`,t.popover),t.home.replaceWith(t.el)):t.own&&t.el.remove(),t.describedBy===null?t.trigger.removeAttribute(`aria-describedby`):t.trigger.setAttribute(`aria-describedby`,t.describedBy)}function Qc(e){let t=Hc(e);Zc(e,t.transient);for(let n of[...t.pinned.values()])Zc(e,n)}var $c=Object.freeze({anchorOverlay:c,buttonClass:Ls,calendarMath:or,copyText:Us,dataTable:mn,defineElement:r,devWarn:Dr,elementBase:a,fieldState:_r,formatters:Et,formMirror:xr,glyphs:ti,iconGlyphs:ti,imeSafeEnter:Xn,listboxKeyNav:Fo,loader:Nr,mentionText:Ks,menuKeyNav:nc,nativeOverlay:w,notificationDays:Ui,optionLabel:fi,partRegistry:Go,selectList:zo,selectRemote:Zo,stepperHeader:cc,tableSelect:dc,textMatch:Ec,tooltips:Oc,wuiHttp:ra,WuiSelect:$o,zone:mt}),el=`image/jpeg,image/png,image/webp,image/heic,image/heif,.heic,.heif`,tl=10,nl=512,rl=`image/webp`,il=[96,48],al={dialogTitle:`Edit photo`,dialogSubtitle:`Drag to position the photo, then zoom or rotate it.`,save:`Save photo`,cancel:`Cancel`,choose:`Upload photo`,change:`Change photo`,camera:`Take photo`,remove:`Remove photo`,unreadable:`That photo could not be opened. Choose a JPG, PNG or WebP image.`,heicUnreadable:`This browser cannot open HEIC photos. Choose a JPG, PNG or WebP image instead.`,cropFailed:`That photo could not be saved. Try again, or choose another one.`};function ol(e){if(!e)return!1;let t=String(e.type||``).toLowerCase();return t===`image/heic`||t===`image/heif`||/\.hei[cf]$/i.test(String(e.name||``))}function sl(e){return ol(e)?al.heicUnreadable:al.unreadable}function cl(e,t){let n=Number(t);return{name:e?.name||`photo`,type:rl,size:Number.isInteger(n)&&n>0?n:512}}var ll=`/`,ul=`.search-wrap.wui-search-collapsible`,dl=`.wui-topsearch-panel`,fl=`.modal, wui-drawer[open]`,pl=new WeakSet,ml=e=>{let t=e.querySelector(`.wui-search-toggle`);return t instanceof HTMLElement?t:null},hl=e=>{let t=e.querySelector(`.search-input`);return t instanceof HTMLInputElement?t:null},gl=e=>[...e.querySelectorAll(ul)].filter(e=>e instanceof HTMLElement);function _l(e){e.classList.remove(`is-collapsed`),ml(e)?.setAttribute(`aria-expanded`,`true`),hl(e)?.focus()}function vl(e){hl(e)?.value||(e.classList.add(`is-collapsed`),ml(e)?.setAttribute(`aria-expanded`,`false`))}function yl(e){if(e.dataset.wuiCollapseWired)return;e.dataset.wuiCollapseWired=`1`;let t=ml(e),n=hl(e);t?.addEventListener(`click`,()=>_l(e)),n?.addEventListener(`keydown`,r=>{r.key!==`Escape`||n?.value||(r.preventDefault(),vl(e),t?.focus())}),e.addEventListener(`focusout`,t=>{let n=t.relatedTarget;n instanceof Node&&e.contains(n)||vl(e)})}function bl(e){pl.has(e)||(pl.add(e),e.addEventListener(`keydown`,t=>{if(t.key!==`/`||t.ctrlKey||t.altKey||t.metaKey||t.defaultPrevented||Ge(t.target instanceof Node?t.target:null)||t.target instanceof Element&&t.target.closest(fl)||e.querySelector(dl))return;let n=gl(e).find(e=>e.offsetParent!==null);n&&(t.preventDefault(),_l(n))}))}function xl(e=document){let t=e;for(let e of gl(t))yl(e);bl(e instanceof Element?e.ownerDocument:e)}var Sl=`data-wui-command-shortcut`,Cl=`k`,wl=new WeakSet;function Tl(e,t){return!(e.ctrlKey||e.metaKey)||e.altKey||e.shiftKey||e.repeat?!1:String(e.key).toLowerCase()===String(t).toLowerCase()}function El(e){return e.nodeType===Node.DOCUMENT_NODE}function Dl(e){e.closest(`wui-modal`)?.show()}function Ol(e){let t=El(e)?e:e.ownerDocument;!wl.has(t)&&e.querySelector(`[data-wui-command-shortcut]`)&&(wl.add(t),t.addEventListener(`keydown`,e=>{for(let n of t.querySelectorAll(`[${Sl}]`))if(Tl(e,n.getAttribute(`data-wui-command-shortcut`)||Cl)){e.preventDefault(),n.localName===`wui-command-palette`||n.localName===`wui-modal`?Dl(n):(n.focus(),`select`in n&&typeof n.select==`function`&&n.select());return}}))}var kl=`image/png,image/jpeg,image/webp`,Al=5,jl={"image/png":[`.png`],"image/jpeg":[`.jpg`,`.jpeg`],"image/webp":[`.webp`],"image/gif":[`.gif`],"image/svg+xml":[`.svg`],"image/heic":[`.heic`],"image/heif":[`.heif`],"application/pdf":[`.pdf`],"text/plain":[`.txt`]},Ml={"image/png":`PNG`,"image/jpeg":`JPG`,"image/webp":`WEBP`,"image/gif":`GIF`,"image/svg+xml":`SVG`,"image/heic":`HEIC`,"image/heif":`HEIC`,"application/pdf":`PDF`,"text/plain":`text file`,"image/*":`images`,"video/*":`videos`,"audio/*":`audio`,".png":`PNG`,".jpg":`JPG`,".jpeg":`JPG`,".webp":`WEBP`,".gif":`GIF`,".svg":`SVG`,".heic":`HEIC`,".heif":`HEIC`,".pdf":`PDF`,".txt":`text file`},Nl=e=>String(e||``).split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean),Pl=[`.png`,`.jpg`,`.jpeg`,`.webp`,`.gif`,`.svg`,`.bmp`,`.avif`,`.heic`,`.heif`];function Fl(e){if(!e)return!1;let t=typeof e==`object`&&e.type?String(e.type).toLowerCase():``;if(t)return t.startsWith(`image/`);let n=typeof e==`string`?e:e.name||e.url||``,r=String(n).toLowerCase();return Pl.some(e=>r.endsWith(e))}var Il=[`KB`,`MB`,`GB`];function Ll(e){if(e<1024)return`${e} B`;let t=e/1024,n=0;for(;t>=1024&&n<Il.length-1;)t/=1024,n+=1;return`${t.toFixed(1)} ${Il[n]}`}function Rl(e){if(!e)return!1;let t=typeof e==`object`&&e.type?String(e.type).toLowerCase():``;if(t)return t===`application/pdf`;let n=typeof e==`string`?e:e.name||e.url||``;return String(n).toLowerCase().replace(/[?#][\s\S]*$/,``).endsWith(`.pdf`)}function zl(e){let t=Nl(e);return t.length?t.every(e=>e.startsWith(`.`)?Pl.includes(e):e===`image/*`||e.startsWith(`image/`)):!1}function Bl(e){let t=[];for(let n of Nl(e)){let e=Ml[n]||(n.startsWith(`.`)?n.slice(1).toUpperCase():n.toUpperCase());t.includes(e)||t.push(e)}return t.length<=1?t[0]||`supported`:`${t.slice(0,-1).join(`, `)} or ${t[t.length-1]}`}function Vl(e,t){let n=Nl(t);if(!n.length)return!0;let r=(e.type||``).toLowerCase(),i=(e.name||``).toLowerCase();return n.some(e=>e.startsWith(`.`)?i.endsWith(e):e.endsWith(`/*`)?r.startsWith(e.slice(0,-1)):r&&r===e?!0:!r&&(jl[e]||[]).some(e=>i.endsWith(e)))}function Hl(e,t={}){if(!e)return null;let n=t.accept===void 0?kl:t.accept,r=t.maxSizeMb===void 0?5:t.maxSizeMb;if(!Vl(e,n)){let e=Bl(n),t=Nl(n).map(e=>[`images`,`videos`,`audio`].includes(Ml[e]??``));return t.every(Boolean)?`Choose ${e}.`:t.some(Boolean)?`Choose ${e.endsWith(` file`)?`${e}s`:`${e} files`}.`:`Choose a ${e.endsWith(` file`)?e:`${e} file`}.`}return r!==null&&r>0&&e.size>r*1024*1024?`Keep the file under ${r} MB.`:null}function Ul(e,t){let n=Array.from(e||[]),r=t.multiple?n:n.slice(0,1),i=[],a=[];for(let e of r){let n=Hl(e,{accept:t.accept,maxSizeMb:t.maxSizeMb});n?a.push({file:e,message:n}):i.push(e)}return{files:i,rejections:a}}function Wl(e,t){let{overClass:n,isDisabled:r=()=>!1,onFiles:i,onReject:a,...o}=t,s=0,c=t=>e.classList.toggle(n,t),l=e=>{e.preventDefault(),r()||(s+=1,c(!0))},u=e=>{e.preventDefault(),r()||c(!0)},d=e=>{e.preventDefault(),r()||(s=Math.max(0,s-1),s===0&&c(!1))},f=e=>{if(e.preventDefault(),s=0,c(!1),r())return;let{files:t,rejections:n}=Ul(e.dataTransfer?.files,o);t.length&&i(t);let l=n[0];l&&a(l)};return e.addEventListener(`dragenter`,l),e.addEventListener(`dragover`,u),e.addEventListener(`dragleave`,d),e.addEventListener(`drop`,f),()=>{e.removeEventListener(`dragenter`,l),e.removeEventListener(`dragover`,u),e.removeEventListener(`dragleave`,d),e.removeEventListener(`drop`,f)}}var Gl=/[0-9]/,Kl={9:Gl,A:/[A-Za-z]/,"*":/[0-9A-Za-z]/},ql=/[9A*]/,Jl=new Set([`text`,`tel`,`search`,`url`,`password`]),Yl=e=>{let t=e.replace(/\D/g,``);return t.length===12&&t.startsWith(`91`)?t.slice(2):t.length===11&&t.startsWith(`0`)?t.slice(1):e},Xl=e=>{let t=Number(e.slice(0,2)),n=Number(e.slice(2,4)),r=Number(e.slice(4,8));if(r<1)return!1;let i=new Date(Date.UTC(r,n-1,t));return i.getUTCFullYear()===r&&i.getUTCMonth()===n-1&&i.getUTCDate()===t},Zl=e=>e.length<=3?e:`${e.slice(0,-3).replace(/\B(?=(\d{2})+(?!\d))/g,`,`)},${e.slice(-3)}`,Ql=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());return t?`${t[3]}-${t[2]}-${t[1]}`:e};function $l(e,{upper:t=!1,normalize:n,valid:r,post:i=e=>e,message:a=`Enter the full value`}={}){let o=[...e].map(e=>{let t=Kl[e];return t?{re:t}:{lit:e}}),s=o.filter(e=>e.re).length;return{inputMode:o.every(e=>!e.re||e.re===Gl)?`numeric`:`text`,normalize:n,post:i,message:a,extract(e){let n=``,r=0;for(let i of e){for(;r<o.length&&o[r]?.lit!==void 0&&o[r]?.lit!==i;)r++;if(r>=o.length)break;let e=o[r];e?.lit===void 0?e?.re.test(i)&&(n+=t?i.toUpperCase():i,r++):r++}return n},layout(e){let t=``,n=[],r=0;for(let i=0;i<o.length&&r<e.length;i++){let a=o[i];a?.lit===void 0?(t+=e.charAt(r++),n.push(!0)):(t+=a.lit,n.push(!1))}return{text:t,isRaw:n}},isValid:e=>e.length===s&&(!r||r(e))}}function eu(){return{inputMode:`decimal`,post:e=>e,message:`Enter a valid amount`,extract(e){let t=``,n=!1,r=0;for(let i of e)Gl.test(i)?n?r<2&&(t+=i,r++):t+=i:i===`.`&&!n&&(n=!0,t+=i);return t.startsWith(`.`)&&(t=`0${t}`),t.replace(/^0+(?=\d)/,``)},layout(e){let[t=``,n]=e.split(`.`),r=Zl(t)+(e.includes(`.`)?`.${n}`:``);return{text:r,isRaw:[...r].map(e=>e!==`,`)}},isValid:e=>/^\d+(\.\d{1,2})?$/.test(e)}}var tu={"phone-in":()=>$l(`99999 99999`,{normalize:Yl,valid:e=>/^[6-9]/.test(e),message:`Enter a 10-digit mobile number`}),pan:()=>$l(`AAAAA9999A`,{upper:!0,valid:e=>/^[A-Z]{5}\d{4}[A-Z]$/.test(e),message:`Enter a valid PAN`}),gstin:()=>$l(`99AAAAA9999A***`,{upper:!0,valid:e=>/^\d{2}[A-Z]{5}\d{4}[A-Z][1-9A-Z]Z[0-9A-Z]$/.test(e),message:`Enter a valid GSTIN`}),aadhaar:()=>$l(`9999 9999 9999`,{valid:e=>/^[2-9]/.test(e),message:`Enter a valid 12-digit Aadhaar number`}),ifsc:()=>$l(`AAAA*******`,{upper:!0,valid:e=>/^[A-Z]{4}0[A-Z0-9]{6}$/.test(e),message:`Enter a valid IFSC`}),"pin-code":()=>$l(`999999`,{valid:e=>/^[1-9]/.test(e),message:`Enter a valid 6-digit PIN code`}),date:()=>$l(`99-99-9999`,{normalize:Ql,valid:Xl,post:(e,t)=>e.length===8&&Xl(e)?`${e.slice(4)}-${e.slice(2,4)}-${e.slice(0,2)}`:t,message:`Enter a valid date as DD-MM-YYYY`}),amount:eu},nu=Object.keys(tu),ru=e=>{let t=String(e).toLowerCase();return Object.hasOwn(tu,t)?t:void 0},iu=e=>ql.test(String(e))&&ru(e)===void 0,au=new Map;function ou(e){if(e==null||e===``)return null;let t=String(e),n=au.get(t);return n===void 0&&(n=iu(t)?$l(t):Object.hasOwn(tu,t)?tu[t]?.()??null:null,au.set(t,n)),n}var su=(e,t)=>e.normalize?e.normalize(t):t;function cu(e,t){let n=ou(e);return n?n.extract(su(n,String(t??``))):String(t??``)}function lu(e,t){let n=ou(e);if(!n)return String(t??``);let r=n.extract(su(n,String(t??``)));return n.post(r,n.layout(r).text)}function uu(e,t){let n=ou(e);return n?n.layout(n.extract(su(n,String(t??``)))).text:String(t??``)}var du=(e,t)=>{if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(e[r]&&++n===t)return r+1;return e.length},fu=new WeakMap,pu=e=>fu.get(e)?.(),mu=new WeakMap;function hu(e,t,n,r){let i=e.getAll(t),a=mu.get(e)??new Set;mu.set(e,a);let o=i.findIndex((e,r)=>e===n&&!a.has(`${t}\u0000${r}`));if(!(o<0)){if(a.add(`${t}\u0000${o}`),i[o]=r,i.length===1)e.set(t,r);else{e.delete(t);for(let n of i)e.append(t,n)}}}function gu(e){let t=null,n=null,r=!1,i=(t,n)=>{n===null?e.removeAttribute(t):n!==void 0&&e.setAttribute(t,n)},a,o,s=()=>{t?.remove(),t=null,n&&(n.hidden=!1),n=null,r&&e.classList.remove(`error`),r=!1,i(`aria-invalid`,a),i(`aria-describedby`,o),a=void 0,o=void 0};return i=>{if(!i){s();return}let c=e.closest(`.field`),l=c instanceof HTMLElement?c:null,u=l?.querySelector(`.field-error`);if(!(u&&u!==t&&u.textContent?.trim())){if(!t){if(r=!e.classList.contains(`error`),e.classList.add(`error`),a=e.getAttribute(`aria-invalid`),o=e.getAttribute(`aria-describedby`),l){t=document.createElement(`div`),t.className=`field-error`,e.id&&(t.id=`${e.id}-error`);let r=l.querySelector(`.field-hint`);n=r instanceof HTMLElement?r:null,n&&(n.hidden=!0),l.insertBefore(t,[...l.children].find(e=>e.classList.contains(`field-count`))??null),t.id&&e.setAttribute(`aria-describedby`,t.id)}e.setAttribute(`aria-invalid`,`true`)}t&&(t.textContent=i)}}}function _u(e,{mask:t,postFormatted:n=!1,onChange:r,onInvalidChange:i}={}){let a=ou(t);if(!a||!Jl.has(e.type))return()=>{};let o=Object.getPrototypeOf(e),s=Object.getOwnPropertyDescriptor(o,`value`);if(!s?.set)throw Error(`input value setter missing`);let c=s.set,l=!e.hasAttribute(`inputmode`);l&&e.setAttribute(`inputmode`,a.inputMode);let u=i??gu(e),d=null,f=!1,p=!1,m=!1,h=``,g=``,_,v=()=>{let e=m?h:``;e!==g&&(g=e,u(g))},y=(t,n,i)=>{let o=a.extract(t.slice(0,n)).length,s=a.extract(t),{text:l,isRaw:u}=a.layout(s);if(e.value!==l&&(c.call(e,l),document.activeElement===e&&Jl.has(e.type))){let t=du(u,o);e.setSelectionRange(t,t)}e.dataset.maskRaw=s,h=s&&!a.isValid(s)?a.message:``,e.setCustomValidity(h),v(),i&&s!==d&&r?.(s,l),d=s},b=Object.getOwnPropertyDescriptor(e,`value`),x=b??s;Object.defineProperty(e,"value",{configurable:!0,...x.enumerable===void 0?{}:{enumerable:x.enumerable},get:()=>N(x.get,`input value getter missing`).call(e),set:t=>{if(N(x.set,`input value setter missing`).call(e,t),p)return;let n=su(a,e.value);y(n,n.length,!0)}});let S=()=>{f=!0,e.dispatchEvent(new Event(`input`,{bubbles:!0})),f=!1},C=t=>{let n=t instanceof InputEvent?t:null;if(f||p||n?.isComposing)return;let r=n?.inputType===`insertText`&&(n.data?.length??0)<=1||n?.inputType?.startsWith(`delete`)?e.value:su(a,e.value);y(r,e.selectionStart??r.length,!0)},w=()=>{p=!0},T=()=>{p=!1;let t=su(a,e.value);y(t,e.selectionStart??t.length,!0),S()},E=t=>{let n=t.inputType===`deleteContentBackward`;if(!n&&t.inputType!==`deleteContentForward`||t.isComposing)return;let r=e.selectionStart;if(r==null||r!==e.selectionEnd)return;let{isRaw:i}=a.layout(a.extract(e.value)),o=n?r-1:r;for(;o>=0&&o<i.length&&!i[o];)o+=n?-1:1;o!==(n?r-1:r)&&(t.preventDefault(),o<0||o>=i.length||(y(e.value.slice(0,o)+e.value.slice(o+1),n?o:r,!0),S()))},D=t=>{if(e.readOnly||e.disabled)return;let n=t.clipboardData?.getData(`text`);if(n==null)return;t.preventDefault();let r=su(a,n),i=e.selectionStart??e.value.length,o=e.selectionEnd??i;y(e.value.slice(0,i)+r+e.value.slice(o),i+r.length,!0),S()},ee=()=>{let t=a.extract(e.value);return a.post(t,a.layout(t).text)},O=()=>{m=!0,v()};e.addEventListener(`input`,C),e.addEventListener(`beforeinput`,E),e.addEventListener(`paste`,D),e.addEventListener(`compositionstart`,w),e.addEventListener(`compositionend`,T),e.addEventListener(`blur`,O),e.addEventListener(`invalid`,O);let te=e.form,ne=t=>{e.name&&!e.disabled&&hu(t.formData,e.name,e.value,ee())},re=()=>{clearTimeout(_),_=setTimeout(()=>{m=!1,y(su(a,e.value),e.value.length,!0)},0)};n||(te?.addEventListener(`formdata`,ne),fu.set(e,ee)),te?.addEventListener(`reset`,re),te?.addEventListener(`submit`,O);let ie=su(a,e.value);return y(ie,ie.length,!1),()=>{clearTimeout(_),e.removeEventListener(`input`,C),e.removeEventListener(`beforeinput`,E),e.removeEventListener(`paste`,D),e.removeEventListener(`compositionstart`,w),e.removeEventListener(`compositionend`,T),e.removeEventListener(`blur`,O),e.removeEventListener(`invalid`,O),te?.removeEventListener(`formdata`,ne),te?.removeEventListener(`reset`,re),te?.removeEventListener(`submit`,O),fu.delete(e),b?Object.defineProperty(e,"value",b):Reflect.deleteProperty(e,`value`),m=!1,h=``,v(),e.setCustomValidity(``),delete e.dataset.maskRaw,l&&e.removeAttribute(`inputmode`)}}function vu(){let e=typeof window>`u`?void 0:window.jQuery?.validator?.prototype;if(!e||e.wuiMaskHook)return;let t=e.elementValue;e.elementValue=function(e){let n=pu(e);return n===void 0?t.call(this,e):n},e.wuiMaskHook=!0}var yu=new WeakMap,bu,xu=e=>{yu.has(e)||yu.set(e,_u(e,{mask:e.dataset.appMask,postFormatted:e.hasAttribute(`data-mask-post-formatted`)}))},Su=e=>[...e.querySelectorAll(`input[data-app-mask]`)].filter(e=>e instanceof HTMLInputElement),Cu=e=>e instanceof Element?[...e instanceof HTMLInputElement&&e.matches(`input[data-app-mask]`)?[e]:[],...Su(e)]:[];function wu(){bu||typeof MutationObserver>`u`||(bu=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)for(let t of Cu(e))yu.get(t)?.(),yu.delete(t);for(let e of t.addedNodes)for(let t of Cu(e))xu(t)}}),bu.observe(document.documentElement,{childList:!0,subtree:!0}))}function Tu(e=document){vu();for(let t of Su(e))xu(t);e===document&&wu()}var Eu=`data-wui-bulk-in-bar`,Du=`[data-wui-page-header-bar][data-wui-bulk-for]`,Ou=new WeakSet;function ku(e){return`${Zt(e,{decimals:0})} selected`}function Au(e){let t=e.dataset.wuiBulkFor;return t===void 0?null:document.getElementById(t)}function ju(e){return typeof e==`object`&&!!e&&`selected`in e&&typeof e.selected==`number`}function Mu(e,t){return[...e.querySelectorAll(t)].flatMap(e=>e instanceof HTMLElement?[e]:[])}function Nu(e,t){for(let n of Mu(e,`[data-wui-bar-swap]`))n.hidden=t>0;let n=e.querySelector(`[data-wui-bar-bulk]`);if(!n)return;if(!(n instanceof HTMLElement))throw Error(`The bulk slot is not an HTML element.`);n.hidden=t===0;let r=n.querySelector(`.page-header-bar-bulk-count`);if(!(r instanceof HTMLElement))throw Error(`The bulk slot has no count element.`);r.textContent=t>0?ku(t):``}function Pu(e=document){for(let t of Mu(e,Du))Au(t)?.setAttribute(Eu,``);Ou.has(document)||(Ou.add(document),document.addEventListener(`selectionchange`,e=>{if(!(e instanceof CustomEvent)||!ju(e.detail))return;let t=e.target;if(t!==null&&!(t instanceof Node))throw Error(`The selection changed on a target that is not a node.`);for(let n of Mu(document,Du))Au(n)?.contains(t)&&Nu(n,e.detail.selected)}))}var Fu={minLength:10,uppercase:!0,lowercase:!0,digit:!0,special:!0,uniqueChars:0,customRules:[]},Iu=`Password requirements`;function Lu(e){return e===!0||e==null?{...Fu}:{...Fu,...e}}function Ru(e){let t=Lu(e),n=[];if(t.minLength>0&&n.push({key:`length`,label:`At least ${t.minLength} characters long`,test:e=>e.length>=t.minLength}),t.uppercase&&n.push({key:`uppercase`,label:`At least one uppercase letter`,test:e=>/[A-Z]/.test(e)}),t.lowercase&&n.push({key:`lowercase`,label:`At least one lowercase letter`,test:e=>/[a-z]/.test(e)}),t.digit&&n.push({key:`digit`,label:`At least one digit`,test:e=>/[0-9]/.test(e)}),t.special&&n.push({key:`special`,label:`At least one special character`,test:e=>/[^A-Za-z0-9]/.test(e)}),t.uniqueChars>0){let e=t.uniqueChars;n.push({key:`unique`,label:`At least ${e} unique character${e>1?`s`:``}`,test:t=>new Set(t).size>=e})}for(let[e,r]of(t.customRules??[]).entries()){let t=new RegExp(r.pattern);n.push({key:`custom-${e}`,label:r.label,test:e=>t.test(e)})}return n}function zu(e,t){let n=e==null?``:String(e);return Ru(t).map(e=>({key:e.key,label:e.label,met:e.test(n)}))}function Bu(e,t){return zu(e,t).every(e=>e.met)}var Vu=`wui:row-drop`,Hu=`is-drop-over`,Uu=`application/x-wui-rows`,Wu=`wui-row-dragging`,Gu=`[data-wui-drop-target]`,Ku=`tbody tr[data-row-key]`,qu=`input, button, a, select, textarea, label`,Ju=`.wui-select-cell .wui-check`,Yu=new WeakMap,Xu=new WeakSet,Zu=null,Qu=null;function $u(e){let t=e.querySelector(Ju);return t instanceof HTMLInputElement&&t.checked}function ed(e){let t=[];for(let n of e.querySelectorAll(`tbody tr`))n instanceof HTMLElement&&$u(n)&&t.push(n.dataset.rowKey);return t}function td(e,t){return P(e,t)}function nd(e,t){let n=td(e,t);return n instanceof HTMLElement?n:null}function rd(e){let t=e.textContent;if(t===null)throw Error(`A drop target has no text content.`);return t.trim()}var id=e=>typeof e==`object`&&!!e&&`selected`in e&&typeof e.selected==`number`;function ad(){Zu=null,document.body.classList.remove(Wu);for(let e of document.querySelectorAll(`${Gu}.${Hu}`))e.classList.remove(Hu)}function od(e,t,n){e.dispatchEvent(new CustomEvent(Vu,{bubbles:!0,detail:{keys:t,target:n.dataset.wuiDropTarget}}))}function sd(e){let t=nd(e.target,Gu);if(!t||!Zu)return;e.preventDefault();let n=N(e.dataTransfer,`A drag event arrived without its DataTransfer.`);n.dropEffect=`move`,t.classList.add(Hu)}function cd(e){let t=nd(e.target,Gu);!t||e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||t.classList.remove(Hu)}function ld(e){let t=nd(e.target,Gu);if(!t||!Zu)return;e.preventDefault(),t.classList.remove(Hu);let{root:n,keys:r}=Zu;od(n,r,t),ad()}function ud(e){let t=nd(e.target,Gu);t&&Qu?.keys.length&&(e.preventDefault(),od(Qu.root,Qu.keys,t))}function dd(e){(Zn(e)||e.key===` `)&&ud(e)}function fd(e){Xu.has(e)||(Xu.add(e),e.addEventListener(`dragover`,sd),e.addEventListener(`dragenter`,sd),e.addEventListener(`dragleave`,cd),e.addEventListener(`drop`,ld),e.addEventListener(`click`,ud),e.addEventListener(`keydown`,dd))}function pd(e){let t=Yu.get(e);if(t)return t;fd(e.ownerDocument||e);let n=t=>{let n=nd(t.target,Ku);if(!n||!e.contains(n))return;let r=td(t.target,qu);r&&n.contains(r)||(n.draggable=!0)},r=t=>{let n=nd(t.target,Ku);if(!n||!e.contains(n))return;let r=$u(n)?ed(e):[n.dataset.rowKey],i=N(t.dataTransfer,`A drag event arrived without its DataTransfer.`);i.setData(Uu,JSON.stringify(r)),i.setData(`text/plain`,r.join(`,`)),i.effectAllowed=`move`,Zu={root:e,keys:r},document.body.classList.add(Wu)},i=t=>{let n=t instanceof CustomEvent?t.detail:void 0;if(id(n)){let{keys:t}=n;n.selected>0?Qu={root:e,keys:Array.isArray(t)?t:ed(e)}:n.selected===0&&(Qu=null)}md(document)};e.addEventListener(`pointerdown`,n),e.addEventListener(`dragstart`,r),e.addEventListener(`dragend`,ad),e.addEventListener(`selectionchange`,i);let a=()=>{e.removeEventListener(`pointerdown`,n),e.removeEventListener(`dragstart`,r),e.removeEventListener(`dragend`,ad),e.removeEventListener(`selectionchange`,i),Yu.delete(e)};return Yu.set(e,a),a}function md(e=document){let t=e.querySelector(`[data-wui-row-drag] tbody tr ${Ju}:checked`)!==null;for(let n of e.querySelectorAll(Gu)){n.tagName!==`BUTTON`&&(n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`)),t?n.removeAttribute(`aria-disabled`):n.setAttribute(`aria-disabled`,`true`);let e=n.getAttribute(`data-wui-drop-label`)||rd(n);n.setAttribute(`aria-label`,`Move to ${e}`)}for(let t of e.querySelectorAll(`.wui-drop-tray`))t.hasAttribute(`role`)||(t.setAttribute(`role`,`toolbar`),t.setAttribute(`aria-label`,`Move to`))}function hd(e=document){for(let t of e.querySelectorAll(`[data-wui-row-drag]`))t instanceof HTMLElement&&pd(t);md(e.ownerDocument||e)}var gd=`.table-wrap, .table-responsive, [class*="table-responsive-"]`,_d=1;function vd(e){let t=()=>{let t=e.scrollWidth-e.clientWidth,n=Math.abs(e.scrollLeft);e.toggleAttribute(`data-wui-overflow-start`,t>_d&&n>_d),e.toggleAttribute(`data-wui-overflow-end`,t>_d&&n<t-_d),e.toggleAttribute(`data-wui-overflow-top`,e.scrollTop>_d)},n=()=>{if(e.scrollWidth-e.clientWidth>_d){let t=getComputedStyle(e);e.style.setProperty(`--wui-scroll-pad-start`,t.paddingInlineStart),e.style.setProperty(`--wui-scroll-pad-end`,t.paddingInlineEnd)}else e.style.getPropertyValue(`--wui-scroll-pad-end`)&&(e.style.removeProperty(`--wui-scroll-pad-start`),e.style.removeProperty(`--wui-scroll-pad-end`))},r=()=>{n(),t()};e.addEventListener(`scroll`,t,{passive:!0});let i=null;if(typeof ResizeObserver<`u`){i=new ResizeObserver(r),i.observe(e);for(let t of e.children)i.observe(t)}return r(),()=>{e.removeEventListener(`scroll`,t),i?.disconnect(),e.removeAttribute(`data-wui-overflow-start`),e.removeAttribute(`data-wui-overflow-end`),e.removeAttribute(`data-wui-overflow-top`),e.style.getPropertyValue(`--wui-scroll-pad-end`)&&(e.style.removeProperty(`--wui-scroll-pad-start`),e.style.removeProperty(`--wui-scroll-pad-end`))}}var yd=new WeakMap,bd,xd=e=>{yd.has(e)||yd.set(e,vd(e))},Sd=e=>{if(!(e instanceof HTMLElement))return[];let t=e.matches(`.table-wrap, .table-responsive, [class*="table-responsive-"]`)?[e]:[];if(e.firstElementChild===null)return t;let n=[...e.querySelectorAll(gd)].filter(e=>e instanceof HTMLElement);return[...t,...n]};function Cd(){bd||typeof MutationObserver>`u`||(bd=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)for(let t of Sd(e))yd.get(t)?.(),yd.delete(t);for(let e of t.addedNodes)for(let t of Sd(e))xd(t)}}),bd.observe(document.documentElement,{childList:!0,subtree:!0}))}function wd(e=document){for(let t of e.querySelectorAll(gd))t instanceof HTMLElement&&xd(t);e===document&&Cd()}var Td=Object.freeze([`page`,`pageSize`,`sortBy`,`sortOrder`,`search`]),Ed=`search`,Dd=Object.freeze({loading:`Loading rows`,error:`These rows did not load. Try again.`,network:`The connection dropped before the rows loaded. Check it and try again.`,forbidden:`You do not have access to these rows.`,retry:`Retry`,actionFailed:`That did not work. Try again.`,actionForbidden:`You do not have permission to do that.`,empty:`No rows`}),Od=5,kd=e=>e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement||e instanceof HTMLFieldSetElement||e instanceof HTMLObjectElement||e instanceof HTMLOutputElement,Ad=e=>e instanceof HTMLObjectElement||e instanceof HTMLOutputElement?!1:e.disabled,jd=e=>kd(e)&&`type`in e&&e.type===`hidden`,X=(e,t,n)=>[...e.querySelectorAll(t)].filter(e=>e instanceof n),Z=(e,t,n)=>{let r=e.querySelector(t);return r instanceof n?r:null},Md=(e,t,n)=>{let r=e.closest(t);return r instanceof n?r:null},Nd=e=>e.localName===`wui-select`,Pd=new WeakMap,Fd=(e,t)=>{let n=Number(e);return Number.isInteger(n)?n:t},Id=e=>({total:Fd(e.dataset.total,0),totalCapped:e.dataset.totalCapped===`true`,page:Fd(e.dataset.page,1),pageSize:Fd(e.dataset.pageSize,0),sortBy:e.dataset.sortBy||``,sortOrder:e.dataset.sortOrder===`desc`?`desc`:`asc`}),Ld=(e,t)=>{e&&Xd().toast(e,{variant:t})},Rd=(e,t)=>{if(!e)return;let n=new Set([...e.elements].filter(e=>!jd(e)||e.hasAttribute(`data-range-mirror`)).map(e=>e.getAttribute(`name`)).filter(e=>e&&!Td.includes(e))),r=[...t].some(([e,t])=>t!==``&&n.has(e));for(let t of X(e,`[data-wui-filter-clear]`,HTMLElement))t.hidden=!r},zd=new Intl.NumberFormat(`en-IN`),Bd=(e,t)=>t?`${zd.format(e)}+`:zd.format(e),Vd=(e,t,n)=>{let r=e.closest(`.wui-list-card`),i=r?Z(r,`.wui-list-card-count`,HTMLElement):null;i&&(i.textContent=Bd(t,n))};function Hd(e=document){let t=X(e,`[data-wui-server]`,HTMLElement);e instanceof HTMLElement&&e.matches(`[data-wui-server]`)&&t.unshift(e);for(let e of t){if(Pd.has(e))continue;let t=Wd(e);Pd.set(e,t),e.hasAttribute(`data-load-first-page`)&&t.reload()}}function Ud(e){let t=e instanceof Element?Md(e,`[data-wui-server]`,HTMLElement):null;return t&&Pd.get(t)||null}function Wd(e){let t=Z(e,`.table-wrap`,HTMLElement),n=t?Z(t,`:scope > table`,HTMLTableElement):null,r=e.dataset.src;if(!t||!n||!r)throw Error(`A server-paged table needs data-src and a .table-wrap > table: render it with <app-data-table src>.`);let i=Z(t,`:scope > [data-wui-table-state]`,HTMLElement),a=Z(e,`[data-wui-table-pager]`,HTMLElement),o=Z(e,`[data-wui-table-status]`,HTMLElement),s={urlState:e.dataset.urlState!==`false`,refreshOnSuccess:e.dataset.refreshOnSuccess!==`false`,filtersForm:e.dataset.filtersForm||null,filtersRegion:e.dataset.filtersRegion||null,searchInput:e.dataset.searchInput||null,loadingText:e.dataset.loadingText||Dd.loading,errorText:e.dataset.errorText||Dd.error},c=new URL(r,window.location.href),l=new Set(c.searchParams.keys()),u=n.hasAttribute(`data-app-datatable-selectable`),d=new Set,f=!1,p=_a(),m=new AbortController,h={signal:m.signal},g=N(Z(n,`:scope > tbody[data-wui-rows]`,HTMLTableSectionElement),`A server-paged table needs its rows in <app-table-rows> (tbody[data-wui-rows]).`),_=Id(g),v=null,y=null,b=e=>{let t=new URLSearchParams;for(let[n,r]of new URLSearchParams(e))l.has(n)||t.append(n,r);return t},x=e=>b(new URL(e,window.location.href).search),S=e=>{let t=e.toString();return`${window.location.pathname}${t?`?${t}`:``}${window.location.hash}`},C=e=>{let t=new URL(c.href);for(let[n,r]of e)l.has(n)||t.searchParams.append(n,r);return t.origin===window.location.origin?`${t.pathname}${t.search}`:t.href},w=(e,t)=>{let n=new URLSearchParams(e);return n.has(`page`)&&n.set(`page`,String(t.page)),n.has(`pageSize`)&&n.set(`pageSize`,String(t.pageSize)),n.has(`sortBy`)?t.sortBy?(n.set(`sortBy`,t.sortBy),n.set(`sortOrder`,t.sortOrder)):(n.delete(`sortBy`),n.delete(`sortOrder`)):n.delete(`sortOrder`),n},T=w(s.urlState?b(window.location.search):new URLSearchParams,_);s.urlState&&S(T)!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.replaceState(window.history.state,``,S(T));let E=(e,n)=>t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n})),D=e=>{o&&(o.textContent=e)},ee=e=>{if(e.total===0)return Dd.empty;let t=e.pageSize>0?Math.max(1,Math.ceil(e.total/e.pageSize)):1,n=e.totalCapped?Bd(e.total,!0):`${e.total}`;return`Page ${e.page} of ${t}, ${n} ${e.total===1?`row`:`rows`}`},O=()=>X(n,`:scope > thead > tr:first-child > th`,HTMLTableCellElement),te=e=>{if(u&&X(e,`:scope > tr:not(.wui-group-row, .wui-virtual-spacer)`,HTMLTableRowElement).some(e=>!e.dataset.rowKey))throw Error(`A selectable server-paged table needs data-row-key on every row, so a selection can span pages.`)},ne=t=>{let n=e.dataset.activeRowKey;if(n!==void 0)for(let e of t){let t=e.classList.contains(`wui-row-active`),r=n!==``&&e.dataset.rowKey===n;e.classList.toggle(`wui-row-active`,r),r?e.setAttribute(`aria-current`,`true`):t&&e.removeAttribute(`aria-current`)}},re=e=>{if(u){xc(e);for(let t of e){let e=Z(t,`.${Y} .wui-check:not(:disabled)`,HTMLInputElement);e&&(f&&d.add(t.dataset.rowKey),e.checked=d.has(t.dataset.rowKey))}Cc(n)}ne(e);let t=O();if(n.classList.contains(`wui-table-stack`))for(let n of e)[...n.cells].forEach((e,n)=>{let r=t[n]?.textContent?.trim();r&&!e.hasAttribute(`data-label`)&&e.setAttribute(`data-label`,r)});t.forEach((t,n)=>{if(t.classList.contains(`wui-col-hidden`))for(let t of e)t.cells[n]?.classList.add(`wui-col-hidden`)})},ie=e=>re(X(e,`:scope > tr`,HTMLTableRowElement)),ae=e=>{for(let t of e.querySelectorAll(`:scope > template[data-wui-pager], :scope > template[data-wui-empty], :scope > template[data-wui-filters]`))t.remove()},oe=e=>e?.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0})),se=(e,t)=>{if(!i)return;let n=Z(e,`:scope > template[data-wui-empty]`,HTMLTemplateElement);oe(i),t.total===0&&n?(i.replaceChildren(n.content.cloneNode(!0)),i.hidden=!1):(i.replaceChildren(),i.hidden=!0)},ce=e=>{let r=Id(e),i=r.sortBy!==_.sortBy||r.sortOrder!==_.sortOrder?zn(g.rows):null;if(a){let t=Z(e,`:scope > template[data-wui-pager]`,HTMLTemplateElement);oe(a),a.replaceChildren(...t?[t.content.cloneNode(!0)]:[]),a.hidden=!1}se(e,r);let o=Z(e,`:scope > template[data-wui-filters]`,HTMLTemplateElement),c=s.filtersRegion&&o?Z(document,s.filtersRegion,HTMLElement):null;c&&o&&(oe(c),c.replaceChildren(o.content.cloneNode(!0))),ae(e),oe(g),n.replaceChild(e,g),g=e;let l=f&&r.total!==_.total;return _=r,l&&(f=!1),t.removeAttribute(`data-wui-table-error`),ie(e),ve(),Bn(e.rows,i),l&&be(),c},le=e=>{let t=document.createElement(`template`);t.innerHTML=`<table>${e}</table>`;let n=Z(t.content,`tbody[data-wui-rows]`,HTMLTableSectionElement);return n&&te(n),n?document.importNode(n,!0):null},ue=(e,t=O())=>{let n=document.createElement(`tr`);for(let r=0;r<e;r++){let e=t[r],i=e?.classList.contains(`text-center`),a=!i&&(e?.classList.contains(`num`)||e?.classList.contains(`text-end`)||e?.classList.contains(`wui-cell-end`)),o=document.createElement(`td`);i?o.classList.add(`text-center`):a&&o.classList.add(e?.classList.contains(`num`)?`num`:`wui-cell-end`);let s=document.createElement(`span`);s.className=`skeleton`,s.setAttribute(`aria-hidden`,`true`);let c=i?44:a?56:60;s.style.cssText=`display:block;width:${c}%;height:12px;border-radius:6px`,o.append(s),n.append(o)}return n},de=()=>{if(g.querySelector(`:scope > tr:not([data-wui-skeleton])`))return;let e=Math.max(1,O().length);g.replaceChildren(...Array.from({length:Od},()=>{let t=ue(e);return t.setAttribute(`data-wui-skeleton`,``),t})),t.removeAttribute(`data-wui-table-error`),i&&(i.hidden=!0)},fe=e=>{e?(t.setAttribute(`aria-busy`,`true`),de()):t.removeAttribute(`aria-busy`)},pe=e=>e===`forbidden`?Dd.forbidden:e===`network`?Dd.network:s.errorText,me=e=>{let n=pe(e);if(t.setAttribute(`data-wui-table-error`,e),a&&(a.hidden=!0),i){let t=document.createElement(`div`);t.className=`empty-state wui-empty-state-table wui-table-error`,t.setAttribute(`role`,`alert`);let r=document.createElement(`span`);r.className=`empty-state-icon`,r.innerHTML=U(e===`forbidden`?`lock`:`alert-circle`,{size:24});let a=document.createElement(`div`);a.className=`empty-state-title`,a.textContent=n;let o=document.createElement(`div`);o.className=`empty-state-action`;let s=document.createElement(`button`);s.type=`button`,s.className=Hs(`primary`,`outline`,`sm`),s.dataset.wui=Rs,s.setAttribute(`data-wui-table-retry`,``),s.textContent=Dd.retry,o.append(s),t.append(r,a,o),oe(i),i.replaceChildren(t),i.hidden=!1}D(n)},he=()=>s.filtersForm?Z(document,s.filtersForm,HTMLFormElement):null,k=async(n,r=`none`,{quiet:i=!1}={})=>{let a=new URLSearchParams(n);i||(v={query:a,mode:r},fe(!0),D(s.loadingText)),E(`wui:table:loading`,{query:a.toString()});let o=await p.run(C(a));if(o.kind===`aborted`||o.kind===`stale`||o.kind===`session`)return o;i||fe(!1);let c=null;if(o.ok)try{c=le(o.html)}catch(e){H(e)}if(!o.ok||!c){let e=o.ok?`server`:o.kind;return i?Or(`A quiet server table refresh failed; the rows on screen are kept.`,e):me(e),E(`wui:table:error`,{status:o.status,kind:e,message:pe(e)}),o}let l=ce(c);return T=w(a,_),Rd(he(),T),s.urlState&&r===`push`?window.history.pushState(window.history.state,``,S(T)):s.urlState&&r===`replace`&&window.history.replaceState(window.history.state,``,S(T)),i||D(ee(_)),Xd().refresh(t),l&&Xd().refresh(l),Vd(e,_.total,_.totalCapped),E(`wui:table:loaded`,{..._,query:T.toString()}),o},ge=e=>(e.delete(`page`),e),_e=()=>X(n,`:scope > thead th[data-sort-key]`,HTMLTableCellElement),ve=()=>{for(let e of _e()){let t=e.dataset.sortKey===_.sortBy;e.setAttribute(`aria-sort`,t?_.sortOrder===`desc`?`descending`:`ascending`:`none`)}};for(let e of _e())if(e.classList.add(`sortable`),e.tabIndex=0,!e.querySelector(`.sort-icon`)){let t=e.classList.contains(`num`)||e.classList.contains(`text-end`),n=document.createElement(`span`);n.className=t?`sort-icon wui-sort-lead`:`sort-icon`,n.innerHTML=U(`chevrons-up-down`,{size:14}),t?e.prepend(n):e.append(n)}let ye=e=>{let t=ge(new URLSearchParams(T)),n=_.sortBy===e&&_.sortOrder===`asc`?`desc`:`asc`;return t.set(`sortBy`,e),t.set(`sortOrder`,n),k(t,`push`)};n.addEventListener(`click`,e=>{let t=e.target instanceof Element?Md(e.target,`th[data-sort-key]`,HTMLTableCellElement):null;t&&n.tHead?.contains(t)&&ye(t.dataset.sortKey??``)}),n.addEventListener(`keydown`,e=>{if(e.key!==`Enter`&&e.key!==` `)return;let t=e.target instanceof Element?Md(e.target,`th[data-sort-key]`,HTMLTableCellElement):null;t&&n.tHead?.contains(t)&&(e.preventDefault(),ye(t.dataset.sortKey??``))});let be=()=>{Cc(n);let e=f?{selected:_.total,total:_.total,allMatching:f}:{selected:d.size,total:_.total};n.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:e}))};u&&(Tc(n,(e,t)=>{for(let n of e){let e=Md(n,`tr`,HTMLTableRowElement)?.dataset.rowKey;e&&(t?d.add(e):d.delete(e))}t||(f=!1)}),n.addEventListener(`change`,e=>{let t=e.target;if(t instanceof HTMLInputElement&&t.matches(`.wui-select-cell .wui-check:not(:disabled)`)){if(t.checked||(f=!1),n.tHead?.contains(t))for(let e of X(g,`:scope > tr`,HTMLTableRowElement)){let n=Z(e,`.${Y} .wui-check:not(:disabled)`,HTMLInputElement);n&&(n.checked=t.checked,t.checked?d.add(e.dataset.rowKey):d.delete(e.dataset.rowKey))}else{let e=Md(t,`tr`,HTMLTableRowElement)?.dataset.rowKey;if(!e)return;t.checked?d.add(e):d.delete(e)}be()}})),a&&(a.addEventListener(`click`,e=>{let t=e.target instanceof Element?Md(e.target,`a[href]`,HTMLAnchorElement):null;!t||e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),k(x(t.getAttribute(`href`)??``),`push`))}),a.addEventListener(`change`,e=>{let t=e.target;t instanceof HTMLSelectElement&&t.classList.contains(`tpg-select`)&&t.value&&(e.stopPropagation(),k(x(t.value),`push`))}));let xe=()=>{if(!s.searchInput)return null;let e=Z(document,s.searchInput,HTMLElement);return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e:e?Z(e,`input`,HTMLInputElement):null},Se=()=>e.isConnected?!0:(m.abort(),clearTimeout(y??void 0),!1),A=(e,t)=>{let n=[...e.elements].filter(kd),r=new Set;for(let e of n)e.name&&!jd(e)&&r.add(e.name);let i=[];for(let e of n)if(e.name&&!Ad(e)){if(e instanceof HTMLInputElement&&e.matches(`input[type="hidden"][data-wui-carried]`))r.has(e.name)||i.push([e.name,e.value]);else if(e instanceof HTMLInputElement&&e.matches(`input[type=checkbox], input[type=radio]`))e.checked&&i.push([e.name,e.value]);else if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.matches(`[type=submit], [type=button], [type=reset], [type=image], [type=file]`)||i.push([e.name,e.value]);else if(e instanceof HTMLSelectElement)for(let t of e.selectedOptions)i.push([e.name,t.value])}return(t instanceof HTMLButtonElement||t instanceof HTMLInputElement)&&t.name&&!t.disabled&&i.push([t.name,t.value]),i},j=(e,t)=>{let n=new Set([...e.elements].filter(kd).map(e=>e.name).filter(Boolean)),r=new URLSearchParams,i=e=>e!==`search`&&Td.includes(e);for(let[e,t]of T)e!==`page`&&(i(e)||!n.has(e))&&r.append(e,t);for(let[n,a]of A(e,t))a===``||i(n)||l.has(n)||r.append(n,a);let a=xe();if(a){r.delete(Ed);let e=a.value.trim();e&&r.set(Ed,e)}return k(r,`push`)},M=e=>s.filtersForm&&e.closest?.(s.filtersForm)||s.filtersRegion&&e.closest?.(s.filtersRegion)||null;document.addEventListener(`submit`,e=>{Se()&&s.filtersForm&&e.target instanceof HTMLFormElement&&e.target.matches(s.filtersForm)&&(e.preventDefault(),j(e.target,e.submitter))},h),document.addEventListener(`change`,e=>{if(!Se()||!s.filtersForm||!(e.target instanceof Element))return;let t=Md(e.target,s.filtersForm,HTMLFormElement);!t||e.target===xe()||t.hasAttribute(`data-wui-apply-on-change`)||e.target.closest(`wui-filter-popover`)||j(t)},h);let Ce=(e,t)=>{if(!e)return;let n=e=>t.get(e)??``;for(let r of X(e,`input[name]:not([type=hidden])`,HTMLInputElement))if(r.type===`checkbox`)r.checked=t.getAll(r.name).includes(r.value);else if(r.type===`radio`){let e=n(r.name)===r.value;if(r.checked===e)continue;r.checked=e,e&&r.dispatchEvent(new Event(`change`))}else r.value!==n(r.name)&&(r.value=n(r.name),r.dispatchEvent(new Event(`input`,{bubbles:!0})));for(let r of X(e,`select[name]`,HTMLSelectElement))if(!r.multiple)r.value=n(r.name);else for(let e of r.options)e.selected=t.getAll(r.name).includes(e.value);for(let r of[...e.querySelectorAll(`wui-select[name]`)].filter(Nd)){let e=r.getAttribute(`name`)??``;r.value=r.mode===`multiple`||r.mode===`tag`?t.getAll(e):n(e)}for(let t of e.querySelectorAll(`wui-date-range`)){let e=t.getAttribute(`start-name`)||t.getAttribute(`name`),r=t.getAttribute(`end-name`);t.value={start:e?n(e):``,end:r?n(r):``}}};document.addEventListener(`click`,e=>{if(!Se())return;let t=e.target instanceof Element?Md(e.target,`a[href]`,HTMLAnchorElement):null;if(!t||!M(t)||e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let n=new URL(t.getAttribute(`href`)??``,window.location.href);if(n.origin!==window.location.origin||n.pathname!==window.location.pathname)return;e.preventDefault();let r=ge(x(n.href));Ce(t.closest(`form`),r),Rd(t.closest(`form`),r),k(r,`push`)},h),document.addEventListener(`input`,e=>{if(!Se())return;let t=xe();t&&e.target===t&&(clearTimeout(y??void 0),y=setTimeout(()=>{if(!Se())return;let e=ge(new URLSearchParams(T)),n=t.value.trim();n?e.set(Ed,n):e.delete(Ed),e.toString()!==T.toString()&&k(e,`replace`)},300))},h),s.urlState&&window.addEventListener(`popstate`,()=>{if(!Se())return;let e=b(window.location.search),t=xe();t&&(t.value=e.get(`search`)??``),Rd(he(),e),k(e,`none`)},h),document.addEventListener(`wui:modal:success`,()=>{Se()&&s.refreshOnSuccess&&k(T,`none`)},h),i?.addEventListener(`click`,e=>{e.target instanceof Element&&e.target.closest(`[data-wui-table-retry]`)&&v&&k(v.query,v.mode)});let we=e=>[...g.rows].find(t=>t.dataset.rowKey===e)??null,Te=e=>{if(!e?.trim())return null;let t=document.createElement(`template`);if(t.innerHTML=`<table><tbody>${e}</tbody></table>`,t.content.querySelector(`tbody[data-wui-rows]`))return null;let n=X(t.content,`table > tbody > tr[data-row-key]`,HTMLTableRowElement);return n.length?n.map(e=>document.importNode(e,!0)):null},Ee=(e,n,r)=>{let i=r?e[0]:e.find(e=>e.dataset.rowKey===n.dataset.rowKey);if(!i)return null;let a=[];for(let t of e){let e=t===i?n:we(t.dataset.rowKey);e&&(oe(e),e.replaceWith(t),a.push(t))}return re(a),Xd().refresh(t),i},De=e=>e.message||(e.kind===`forbidden`?Dd.actionForbidden:Dd.actionFailed),Oe=e=>{e?.isConnected&&e.getAttribute(`data-wui-save-state`)===`saving`&&qn(e,null)},ke=e=>{if(e instanceof HTMLTableRowElement)return e;let t=document.createElement(`template`);t.innerHTML=`<table><tbody>${String(e)}</tbody></table>`;let n=Z(t.content,`table > tbody > tr`,HTMLTableRowElement);return document.importNode(N(n,"saveRow's `row` is the row as it will read: a <tr> element or its HTML."),!0)},P=async({url:e,method:n=`POST`,body:r,key:a,row:o}={})=>{if(!e)throw Error("saveRow needs `url`: the handler that saves the row.");let s=a==null,c=s?null:we(String(a));if(!s&&!c)throw Error(`saveRow found no row with data-row-key="${a}" on this page.`);let l=O().filter(e=>!e.classList.contains(Y)),u=o?ke(o):c??ue(Math.max(1,l.length),l);c&&u!==c?c.replaceWith(u):c||g.insertBefore(u,g.firstChild),u!==c&&re([u]),i&&!t.hasAttribute(`data-wui-table-error`)&&(i.hidden=!0),qn(u,`saving`);let d=Kn(u),f=await ga(e,{method:n.toUpperCase(),body:r});if(f.kind===`session`)return!1;if(f.ok){let e=Te(f.html),t=e&&u.isConnected?Ee(e,u,s):null;return t?D(L.saved(Kn(t)||d)):(await k(T,`none`),Oe(u)),Zd(f,f.toastVariant||`success`),E(`wui:table:saved`,{key:t?.dataset.rowKey??(s?null:String(a)),added:s,status:f.status}),!0}let p=De(f),m=u;return c&&u!==c&&u.isConnected?(u.replaceWith(c),m=c):s&&!o&&(u.remove(),m=null,i?.childElementCount&&!g.querySelector(`:scope > tr`)&&(i.hidden=!1)),m?.isConnected&&qn(m,`error`,p),f.kind!==`aborted`&&Ld(p,`danger`),D(L.notSaved(d,p)),E(`wui:table:failed`,{key:s?null:String(a),added:s,status:f.status,kind:f.kind,message:p}),!1},Ae=async e=>{let t=e.dataset.url;if(!t)throw Error(`A data-wui-row-action button needs data-url: the handler the action posts to.`);let n=Md(e,`tr`,HTMLTableRowElement),r=n?.dataset.rowKey??null,i=e.dataset.wuiRowAction||``,a=n?Kn(n):``;e.disabled=!0,e.setAttribute(`aria-busy`,`true`),n&&qn(n,`saving`);let o=await ga(t,{method:(e.dataset.method||`post`).toUpperCase()});if(e.disabled=!1,e.removeAttribute(`aria-busy`),o.kind===`session`||o.kind===`aborted`)Oe(n);else{if(o.ok){Zd(o,o.toastVariant||`success`);let e=n?.isConnected?Te(o.html):null,t=e&&n?Ee(e,n,!1):null;t?D(L.saved(Kn(t)||a)):(await k(T,`none`),Oe(n))}else{let e=De(o);Ld(e,`danger`),n?.isConnected&&qn(n,`error`,e),D(L.notSaved(a,e))}E(`wui:table:action`,{action:i,key:r,ok:o.ok,status:o.status})}};return n.addEventListener(`click`,e=>{let t=e.target instanceof Element?Md(e.target,`[data-wui-row-action]`,HTMLButtonElement):null;t&&g.contains(t)&&!t.disabled&&(e.preventDefault(),Ae(t))}),te(g),ae(g),u&&Sc(n),ie(g),ve(),{el:e,reload:async e=>{let n=e?.quiet===!0;return n&&t.getAttribute(`aria-busy`)===`true`?null:k(T,`none`,{quiet:n})},query:()=>new URLSearchParams(T),setQuery:e=>{let t=new URLSearchParams(T);for(let[n,r]of Object.entries(e??{})){t.delete(n);for(let e of Array.isArray(r)?r:[r])e!=null&&e!==``&&t.append(n,String(e))}return e&&`page`in e||t.delete(`page`),k(t,`push`)},saveRow:P,setActiveRow:t=>{e.dataset.activeRowKey=t==null?``:String(t),ne(X(g,`:scope > tr`,HTMLTableRowElement))},selection:{keys:()=>[...d],count:()=>f?_.total:d.size,allMatching:()=>f,selectAllMatching:()=>{f=!0;for(let e of X(g,`:scope > tr`,HTMLTableRowElement)){let t=Z(e,`.${Y} .wui-check`,HTMLInputElement);t?.disabled||(t&&(t.checked=!0),e.dataset.rowKey&&d.add(e.dataset.rowKey))}be()},clear:()=>{f=!1,d.clear();for(let e of X(g,`:scope > tr > .${Y} .wui-check:not(:disabled)`,HTMLInputElement))e.checked=!1;be()}}}}var Gd=8e3,Kd=`That did not work. Try again.`,qd=[`success`,`info`,`warning`,`danger`],Jd=e=>qd.some(t=>t===e);function Yd(e){if(!Jd(e))throw RangeError(`Unknown toast variant "${e}".`);return e}function Xd(){return N(window.WUI,`window.WUI is not defined: the Razor behaviour script did not load on this page.`)}function Zd(e,t=`success`){if(!e?.message)return;let n=e.toastAction;n?Xd().toast(e.message,{variant:Yd(t),duration:Gd,action:{label:n.label,onClick:()=>Qd(n)}}):Xd().toast(e.message,{variant:Yd(t)})}async function Qd(e){let t=await ga(e.url,{method:e.method});if(t.kind!==`session`&&t.kind!==`aborted`){if(t.ok){Zd(t,t.toastVariant||`success`);for(let e of document.querySelectorAll(`[data-wui-server]`))e instanceof HTMLElement&&e.dataset.refreshOnSuccess!==`false`&&Ud(e)?.reload()}else Xd().toast(t.message||Kd,{variant:`danger`})}}var $d=`wui-remote-modal`,ef=`wui-remote-drawer`,tf=Object.freeze({sm:360,md:480,lg:640,xl:720}),nf=`wui-modal-fullscreen`,rf=Object.freeze({sm:380,md:440,lg:640,xl:880}),af=Object.freeze({loading:`Loading`,close:`Close`,retry:`Try again`,errorTitle:`This could not be loaded`,forbidden:`You do not have access to this.`,client:`It may have been moved or deleted.`,server:`Something went wrong on our side. Try again in a moment.`,network:`Could not reach the server. Check your connection and try again.`,submitFailed:`Your changes were not saved.`,invalid:`Some fields need attention.`}),of=`a[href],button:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,sf=`input:not([type="hidden"]):not([disabled]),select:not([disabled]),textarea:not([disabled]),[contenteditable="true"]`,cf=`[aria-invalid="true"], .is-invalid, .input-validation-error`,lf=`invalid`,uf=`.wui-error-summary, [data-wui-form-errors], .validation-summary-errors, [data-valmsg-summary]`,df=`[data-wui-modal-content]`,ff=`[data-wui-pane-close], [data-wui-dismiss]`,pf=`<button type="button" class="wui-modal-close" data-wui-dismiss aria-label="Close"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"></path></svg></button>`,mf=new WeakMap,hf=new WeakSet;function gf(e,t){if(e==null)throw TypeError(`The remote modal needs ${t}, and the page does not have it.`);return e}var Q=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},_f=(e,t,n)=>gf(Q(e,t),n),vf=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),yf=()=>Object.assign(Error(`The remote modal load was aborted.`),{name:`AbortError`}),bf=e=>typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`,xf=(e,t)=>{let n=e instanceof Element?e.closest(t):null;return n instanceof HTMLElement?n:null},Sf=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML},Cf=e=>Object.hasOwn(rf,e),wf=e=>Object.hasOwn(tf,e);function Tf(e){if(e==null||e===``)return null;if(e===`fullscreen`)return{fullscreen:!0};if(Cf(e))return{px:rf[e]};let t=typeof e==`number`?e:/^\d+$/.test(String(e))?Number(e):NaN;if(Number.isInteger(t)&&t>0)return{px:t};throw TypeError(`Unsupported modal size "${String(e)}". Use sm, md, lg, xl, fullscreen or a px number.`)}var Ef=e=>{if(e.classList.contains(`wui-modal-fullscreen`))return{fullscreen:!0};let t=Number.parseInt(e.style.getPropertyValue(`--wui-modal-max-width`),10);return{px:t>0?t:rf.md}},Df=(e,t)=>{e.classList.toggle(nf,!!t.fullscreen),t.fullscreen?e.style.removeProperty(`--wui-modal-max-width`):e.style.setProperty(`--wui-modal-max-width`,`${t.px}px`)},Of=[`center`,`top`];function kf(e){if(e==null||e===``)return null;if(wf(e))return{px:tf[e]};let t=typeof e==`number`?e:/^\d+$/.test(String(e))?Number(e):NaN;if(Number.isInteger(t)&&t>0)return{px:t};throw TypeError(`Unsupported drawer size "${String(e)}". Use sm, md, lg, xl or a px number.`)}var Af=e=>e.container===`drawer`,jf=e=>e.container===`pane`,Mf=e=>e.container!==`modal`,Nf=(e,t)=>Af(e)?kf(t):Tf(t),Pf=e=>{let t=typeof e==`string`?document.querySelector(e):e,n=t instanceof HTMLElement?t:null;return n?.matches(`[data-wui-pane-host]`)?n:null},Ff=e=>jf(e)?e.shell:_f(e.shell,`.modal-dialog`,`a dialog frame`);function If(e=`modal`){let t=e===`drawer`,n=t?ef:$d,r=document.getElementById(n);if(r)return r;let i=document.createElement(`wui-modal`);i.id=n,i.setAttribute(`data-wui`,`AppModal`);let a=document.createElement(`dialog`);return a.className=t?`modal wui-modal-shell wui-remote-drawer`:`modal wui-modal-shell`,a.style.setProperty(`--wui-modal-max-width`,`${t?tf.md:rf.md}px`),a.innerHTML=t?`<div class="modal-dialog wui-remote-drawer-dialog"><div class="modal-content wui-modal"></div></div>`:`<div class="modal-dialog modal-dialog-centered wui-rb-dialog"><div class="modal-content wui-modal"></div></div>`,i.append(a),document.body.appendChild(i),i}var Lf=e=>`<div class="wui-modal-header"><div class="wui-modal-heading"><div class="wui-modal-headtext"><div class="wui-modal-title">${Sf(e)}</div></div></div>${pf}</div>`,Rf=e=>`<div class="modal-content wui-modal" aria-busy="true">${Lf(e)}<div class="wui-modal-body"><div class="wui-modal-loading" role="status"><span class="visually-hidden">${Sf(af.loading)}</span><div class="skeleton wui-modal-skeleton"></div><div class="skeleton wui-modal-skeleton"></div><div class="skeleton wui-modal-skeleton wui-modal-skeleton--short"></div></div></div></div>`,zf=(e,t)=>`<div class="modal-content wui-modal" data-wui-modal-error="${Sf(t)}">${Lf(e)}<div class="wui-modal-body"><div class="wui-modal-state" role="alert"><p class="wui-modal-state-title">${Sf(af.errorTitle)}</p><p class="wui-modal-state-text">${Sf(af[t]||af.server)}</p><div class="wui-modal-state-actions"><button type="button" class="${Hs(`primary`,`soft`,`md`)}" data-wui-dismiss data-wui="${Rs}">${Sf(af.close)}</button><button type="button" class="${Hs(`primary`,`solid`,`md`)}" data-wui-modal-retry data-wui="${Rs}">${Sf(af.retry)}</button></div></div></div></div>`,Bf=e=>{let t=document.createElement(`template`);return t.innerHTML=e,_f(t.content,`.modal-content`,`a card`)},Vf=e=>Q(e.shell,`.modal-content`);function Hf(e){e&&e.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0}))}function Uf(e,t){let n=Vf(e),r=n?Gf(n):new Map;Hf(n),n?n.replaceWith(t):Ff(e).appendChild(t),Kf(t,r),Xd().refresh()}var Wf=`input[type="file"][name]`;function Gf(e){let t=new Map;for(let n of e.querySelectorAll(Wf)){if(!(n instanceof HTMLInputElement))continue;let e=n.files;e&&e.length>0&&t.set(n.name,[...e])}return t}function Kf(e,t){if(t.size!==0&&typeof DataTransfer<`u`)for(let n of e.querySelectorAll(Wf)){if(!(n instanceof HTMLInputElement))continue;let e=t.get(n.name);if(!e)continue;let r=new DataTransfer;for(let t of e)r.items.add(t);n.files=r.files,n.dispatchEvent(new Event(`change`,{bubbles:!0}))}}var qf=e=>jf(e)?!e.shell.hidden:e.host.hasAttribute(`open`);function Jf(e,t,n=!1){let r=t?Q(e,cf):null,i=r?r.matches(of)?r:Q(r,of)||r:null;if(!i&&n)i=Q(e,`[data-autofocus]`)||Q(e,sf)||Q(e,`.wui-modal-close`);else if(!i){let t=vf(e,of);i=Q(e,`[data-autofocus]`)||t.find(e=>!e.classList.contains(`wui-modal-close`))||t[0]||e}r?i?.focus?.():i?.focus?.({preventScroll:!0})}function Yf(e,t){let n=Q(e.shell,`[data-wui-modal-live]`);n||(n=document.createElement(`div`),n.className=`visually-hidden`,n.setAttribute(`aria-live`,`assertive`),n.setAttribute(`data-wui-modal-live`,``),Ff(e).appendChild(n)),n.textContent=``,n.textContent=t}var Xf=e=>{let t=Q(e.shell,`[data-wui-modal-live]`);t&&(t.textContent=``)},Zf=(e,t,n)=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))};function Qf(e,t,n,r){let i={...r,container:e.container};Zf(t,`wui:modal:${n}`,i),Af(e)&&Zf(t,`wui:drawer:${n}`,i),jf(e)&&Zf(t,`wui:pane:${n}`,i)}var $f=e=>e.matches(`[data-wui-pane-host]`)?`pane`:_f(e,`dialog`,`a dialog`).classList.contains(`wui-remote-drawer`)?`drawer`:`modal`,ep=e=>gf(e.host.closest(`wui-modal`),`a wui-modal host`);function tp(e){let t=mf.get(e);if(t)return t;let n=$f(e),r=n===`pane`?e:_f(e,`dialog`,`a dialog`),i={host:e,shell:r,container:n,queue:_a(),defaultSize:Ef(r),defaultLabel:r.getAttribute(`aria-label`),placeholder:Vf({shell:r})?.outerHTML||`<div class="modal-content wui-modal"></div>`,remoteUrl:e.getAttribute(`data-wui-remote-url`),cache:e.getAttribute(`data-wui-remote-cache`)===`true`,loadedUrl:null,session:null};return mf.set(e,i),e.addEventListener(`submit`,e=>Cp(i,e)),e.addEventListener(`click`,e=>{xf(e.target,`[data-wui-modal-retry]`)&&i.session&&(e.preventDefault(),lp(i,i.session))}),jf(i)&&e.addEventListener(`click`,t=>{let n=xf(t.target,ff);n&&e.contains(n)&&i.session&&rp(i,i.session,`dismissed`,null)}),e.addEventListener(`wui-modal-closed`,t=>{t.target===e&&op(i)}),e.addEventListener(`wui-modal-opened`,t=>{if(t.target!==e)return;let n=Vf(i);i.session&&n?.matches(df)&&!n.contains(document.activeElement)&&Jf(n,!1,Mf(i))}),i.remoteUrl&&e.addEventListener(`wui-modal-open`,t=>{t.target===e&&sp(i,t)}),i}function np(e,t,n){e.session&&(e.queue.abort(),e.session.resolveClosed({status:`dismissed`,detail:{replaced:!0}}));let r=()=>void 0,i=new Promise(e=>{r=e}),a={url:t,method:(n.method||`GET`).toUpperCase(),body:n.body,options:n,trigger:n.trigger||null,explicitSize:null,closing:null,resolveClosed:r,handle:{el:e.shell,closed:i,close:()=>rp(e,a,`dismissed`,null),reload:()=>lp(e,a)}};return e.session=a,a}function rp(e,t,n,r){e.session===t&&(t.closing={status:n,detail:r},jf(e)?ap(e,t):ip(e))}function ip(e){let t=ep(e);t.dispatchEvent(new CustomEvent(`wui-modal-close`,{bubbles:!0,cancelable:!0,detail:{reason:`dismiss`}}))&&t.hide()}function ap(e,t){let n=e.shell,{status:r,detail:i}=gf(t.closing,`the closing state`),a=n.contains(document.activeElement);e.queue.abort(),e.session=null,Hf(Vf(e)),n.replaceChildren(),n.hidden=!0,n.removeAttribute(`data-open`),t.resolveClosed({status:r,detail:i}),Qf(e,n,`closed`,{status:r,url:t.url}),a&&t.trigger?.isConnected&&t.trigger.focus?.()}function op(e){let t=e.session;if(e.queue.abort(),e.session=null,Xf(e),t){let n=t.closing||{status:`dismissed`,detail:null};t.resolveClosed({status:n.status,detail:n.detail}),Qf(e,e.shell,`closed`,{status:n.status,url:t.url});let r=document.activeElement;t.trigger?.isConnected&&(!r||r===document.body||e.shell.contains(r))&&t.trigger.focus?.()}e.cache||(Uf(e,Bf(e.placeholder)),e.loadedUrl=null,Df(e.shell,e.defaultSize),e.defaultLabel?e.shell.setAttribute(`aria-label`,e.defaultLabel):e.shell.removeAttribute(`aria-label`))}function sp(e,t){let n=yp(t instanceof CustomEvent?t.detail:null,`trigger`),r=n instanceof HTMLElement?n:null,i=r?.getAttribute(`data-wui-url`)||e.remoteUrl||``,a=np(e,i,{trigger:r});a.explicitSize=cp(e,r?.getAttribute(`data-wui-size`)),a.explicitSize&&Df(e.shell,a.explicitSize),e.cache&&e.loadedUrl===i||(e.loadedUrl&&Uf(e,Bf(e.placeholder)),lp(e,a,{keepPlaceholder:!0}))}function cp(e,t){try{return Nf(e,t)}catch(e){return H(e),null}}async function lp(e,t,{keepPlaceholder:n=!1}={}){n||Uf(e,Bf(Rf(t.options.title||up(e))));let r=await e.queue.run(t.url,{method:t.method,body:t.body,navigate:t.options.navigate});if(e.session!==t||r.kind===`aborted`||r.kind===`stale`)return`aborted`;if(r.kind===`session`)return`session`;if(r.kind===`ok`&&mp(e,t,r.html,!1))return e.loadedUrl=t.url,Qf(e,e.shell,`loaded`,{url:t.url,handle:t.handle}),`loaded`;let i=r.kind===`ok`||r.kind===`validation`?`server`:r.kind;return Uf(e,Bf(zf(t.options.title||up(e),i))),qf(e)&&Jf(gf(Vf(e),`a card`),!1,Mf(e)),Qf(e,e.shell,`error`,{url:t.url,kind:i,status:r.status}),`error`}var up=e=>Vf(e)?.querySelector(`.wui-modal-title`)?.textContent||e.shell.getAttribute(`aria-label`)||``,dp=`/_content/Webority.Ui.Razor/js/`,fp=e=>new URL(e,window.location.href).pathname.includes(dp);function pp(e){if([...document.scripts].some(t=>t.getAttribute(`src`)===e))return;let t=document.createElement(`script`);t.src=e,document.head.appendChild(t)}function mp(e,t,n,r){let i=document.createElement(`template`);i.innerHTML=n;let a=!1;for(let e of i.content.querySelectorAll(`script`)){if(e.getAttribute(`type`)===`application/json`)continue;let t=e.getAttribute(`src`);e.remove(),t&&fp(t)?pp(t):a=!0}a&&Or(`WUI.modal: ${t.url} returned a fragment with script; it was removed. Keep page behaviour in the page.`);let o=Q(i.content,df);if(!o)return H(`WUI.modal: ${t.url} did not answer with an <app-modal-content> fragment.`),!1;if(Uf(e,o),r||Xf(e),!jf(e)){Df(e.shell,t.explicitSize||cp(e,o.getAttribute(`data-wui-size`))||e.defaultSize);let n=o.getAttribute(`data-wui-title`);n&&e.shell.setAttribute(`aria-label`,n)}return qf(e)&&Jf(o,r,Mf(e)),!0}var hp=`button[type="submit"], button:not([type]), input[type="submit"], input[type="image"]`;function gp(e,t,n){let r=[...e.elements].filter(e=>e.matches(hp));if(n){e.setAttribute(`data-wui-submitting`,``);let n=t&&r.includes(t)?t:r[0];for(let e of r)e.toggleAttribute(`data-wui-was-disabled`,e.disabled),e.disabled=!0;n&&(n.classList.add(`is-loading`),n.setAttribute(`aria-busy`,`true`),n.tagName===`BUTTON`&&n.insertAdjacentHTML(`afterbegin`,`<span class="spinner-border spinner-border-sm me-2" aria-hidden="true" data-wui-submit-spinner></span>`))}else{e.removeAttribute(`data-wui-submitting`);for(let e of r)e.disabled=e.hasAttribute(`data-wui-was-disabled`),e.removeAttribute(`data-wui-was-disabled`),e.classList.remove(`is-loading`),e.removeAttribute(`aria-busy`),e.querySelector(`[data-wui-submit-spinner]`)?.remove()}}function _p(e){for(let t of e.querySelectorAll(uf))t.remove();for(let t of e.querySelectorAll(cf))t.removeAttribute(`aria-invalid`),t.classList.remove(`is-invalid`,`input-validation-error`);for(let t of e.querySelectorAll(`.field-error`))t.textContent=``}var vp=new Set(`bad request.unauthorized.payment required.forbidden.not found.method not allowed.not acceptable.proxy authentication required.request timeout.conflict.gone.length required.precondition failed.payload too large.uri too long.unsupported media type.range not satisfiable.expectation failed.misdirected request.unprocessable content.unprocessable entity.locked.failed dependency.too early.upgrade required.precondition required.too many requests.request header fields too large.unavailable for legal reasons`.split(`.`)),yp=(e,t)=>{if(typeof e==`object`&&e&&t in e)return Reflect.get(e,t)};async function bp(e){if(!e||e.status<400||e.status>499||!e.headers.get(`content-type`)?.toLowerCase().includes(`json`))return null;let t;try{t=JSON.parse(await e.text())}catch{return null}let n=e=>typeof e==`string`?e.trim():``,r=n(yp(t,`title`)),i=(e.statusText||``).trim().toLowerCase(),a=vp.has(r.toLowerCase())||r.toLowerCase()===i;return n(yp(t,`message`))||n(yp(t,`detail`))||(r&&!a?r:null)}function xp(e,t,n,r){let i=t.closest(`.wui-modal-body`)||t;i.querySelector(`[data-wui-modal-submit-error]`)?.remove(),_p(i);let a=document.createElement(`div`);a.className=`alert alert-danger wui-modal-submit-error`,a.setAttribute(`role`,`alert`),a.setAttribute(`data-wui-modal-submit-error`,``),a.innerHTML=Sf(`${af.submitFailed} ${r||af[n]||af.server}`),i.prepend(a),Yf(e,a.textContent)}var Sp=(e,t)=>{let n=new URL(e,window.location.href);for(let[e,r]of t)typeof r==`string`&&n.searchParams.append(e,r);return n.origin===window.location.origin?n.pathname+n.search:n.href};async function Cp(e,t){let n=t.target,r=e.session;if(!(n instanceof HTMLFormElement)||!r||n.hasAttribute(`data-wui-native`)||!n.closest(df)||(t.preventDefault(),n.hasAttribute(`data-wui-submitting`)))return;let i=`submitter`in t&&(t.submitter instanceof HTMLButtonElement||t.submitter instanceof HTMLInputElement)?t.submitter:null,a=i?.getAttribute(`formaction`)||n.getAttribute(`action`)||r.url,o=(i?.getAttribute(`formmethod`)||n.getAttribute(`method`)||`GET`).toUpperCase(),s=new FormData(n);i?.name&&!s.has(i.name)&&s.append(i.name,i.value);let c=o===`GET`;gp(n,i,!0);let l;try{l=await e.queue.run(c?Sp(a,s):a,{method:o,body:c?void 0:s,navigate:r.options.navigate})}catch(t){H(t),e.session===r&&n.isConnected&&(gp(n,i,!1),xp(e,n,`server`,null));return}if(e.session!==r)return;if(n.isConnected&&gp(n,i,!1),l.kind===`ok`&&l.result===`success`){wp(e,r,l);return}if(l.kind===`aborted`||l.kind===`stale`||l.kind===`session`)return;if(l.kind===`ok`&&l.html){let t=l.result===lf;if(mp(e,r,l.html,t)){if(t){let t=gf(Vf(e),`a card`).querySelector(uf)?.textContent?.replace(/\s+/g,` `).trim();Yf(e,t||af.invalid)}return}}let u=l.kind===`ok`||l.kind===`validation`?`server`:l.kind,d=await bp(l.response);e.session===r&&xp(e,n,u,d)}function wp(e,t,n){let r=n.message,i=n.redirect||null,a=n.toastVariant||`success`;if(!Lp(a))throw TypeError(`Unknown toast variant "${a}". Use ${Ip.join(`, `)}.`);let o={url:t.url,trigger:t.trigger,handle:t.handle,message:r,redirect:i,data:n.data??null,container:e.container};i&&!t.options.navigate?om(r,a):r&&Xd().toast(r,{variant:a}),Qf(e,t.trigger?.isConnected?t.trigger:document,`success`,o),t.options.onSuccess?.(o,t.handle),i&&(t.options.navigate||(e=>window.location.assign(e)))(i);let s=n.next;s&&!i?(t.url=s,t.method=`GET`,t.body=void 0,lp(e,t)):n.keepOpen?n.html&&mp(e,t,n.html,!1):rp(e,t,`success`,o)}function Tp(e){let t=xf(e.target,`[data-wui-modal], [data-wui-drawer], [data-wui-pane]`);t&&(t.matches(`a[href]`)&&(e.ctrlKey||e.metaKey||e.shiftKey||e.button!==0)||(e.preventDefault(),t.hasAttribute(`data-wui-pane`)?Mp(t.getAttribute(`data-wui-pane`)??``,{target:t.getAttribute(`data-wui-pane-target`),trigger:t}).catch(e=>{bf(e)||H(e)}):t.hasAttribute(`data-wui-modal`)?Op(t.getAttribute(`data-wui-modal`)??``,{size:t.getAttribute(`data-wui-size`)||void 0,title:t.getAttribute(`data-wui-title`)||void 0,trigger:t}).catch(e=>{bf(e)||H(e)}):Ap(t.getAttribute(`data-wui-drawer`)??``,{size:t.getAttribute(`data-wui-drawer-size`)||void 0,title:t.getAttribute(`data-wui-title`)||void 0,trigger:t}).catch(e=>{bf(e)||H(e)})))}function Ep(e){if(e.key!==`Escape`||e.defaultPrevented)return;let t=xf(e.target,jp),n=t&&mf.get(t),r=e.currentTarget;n?.session&&r instanceof Document&&!r.querySelector(`wui-modal[open]`)&&(e.preventDefault(),rp(n,n.session,`dismissed`,null))}function Dp(e=document){let t=e instanceof Document?e:gf(e.ownerDocument,`an owner document`);hf.has(t)||(hf.add(t),t.addEventListener(`click`,Tp),t.addEventListener(`keydown`,Ep));let n=vf(e,`wui-modal[data-wui-remote-url]`);e instanceof HTMLElement&&e.matches(`wui-modal[data-wui-remote-url]`)&&n.unshift(e);for(let e of n)tp(e)}function Op(e,t={}){try{if(!e)throw TypeError(`WUI.modal.load: a fragment url is required.`);let n=t.container===`drawer`,r=n?kf(t.size):Tf(t.size),i=t.placement||`center`;if(!Of.includes(i))throw TypeError(`WUI.modal.load: unsupported placement "${i}". Use center or top.`);if(t.signal?.aborted)return Promise.reject(yf());let a=If(n?`drawer`:`modal`);Dp(document);let o=tp(a),s=qf(o),c=np(o,e,t);if(c.explicitSize=r,Df(o.shell,r||o.defaultSize),n||_f(o.shell,`.modal-dialog`,`a dialog frame`).classList.toggle(`modal-dialog-centered`,i===`center`),t.title&&o.shell.setAttribute(`aria-label`,t.title),!s){let e=t.staticBackdrop!==!1;a.toggleAttribute(`static`,e),a.toggleAttribute(`no-escape`,e)}let l=s?Promise.resolve():new Promise(e=>a.addEventListener(`wui-modal-opened`,()=>e(),{once:!0})),u=lp(o,c);return s||ep(o).show(),kp(o,c,t,l,u,`WUI.modal.load`)}catch(e){return Promise.reject(e)}}function kp(e,t,n,r,i,a){let o=new Promise((r,i)=>{n.signal?.addEventListener(`abort`,()=>{e.session===t&&(e.queue.abort(),rp(e,t,`dismissed`,{aborted:!0})),i(yf())},{once:!0})}),s=Promise.all([r,i]).then(([,e])=>{if(e===`aborted`)throw yf();if(e===`session`)throw Error(`${a}(${t.url}): the session expired; the browser is signing in again.`);return t.handle});return Promise.race([s,o])}function Ap(e,t={}){return Op(e,{...t,container:`drawer`,placement:void 0})}var jp=`[data-wui-pane-host]`;function Mp(e,t={}){try{if(!e)throw TypeError(`WUI.pane.load: a fragment url is required.`);let n=Pf(t.target);if(!n)throw TypeError(`WUI.pane.load: the target is not an <app-detail-pane>.`);if(t.signal?.aborted)return Promise.reject(yf());Dp(document);let r=tp(n),i=np(r,e,t);n.hidden=!1,n.setAttribute(`data-open`,``);let a=lp(r,i);return kp(r,i,t,Promise.resolve(),a,`WUI.pane.load`)}catch(e){return Promise.reject(e)}}function Np(e){let t=Pf(e);if(!t)throw TypeError(`WUI.pane.close: the target is not an <app-detail-pane>.`);let n=mf.get(t);n?.session&&rp(n,n.session,`dismissed`,null)}var Pp=`wuiConfirm`,Fp=Object.freeze([`danger`]),Ip=Object.freeze([`success`,`info`,`warning`,`danger`]),Lp=e=>Ip.some(t=>t===e),Rp=`wui.flash`,zp=Object.freeze({confirmTitle:`Are you sure?`,confirmLabel:`Confirm`,cancelLabel:`Cancel`,failed:`That did not work. Try again.`,forbidden:`You do not have permission to do that.`,network:`Could not reach the server. Check your connection and try again.`}),Bp=new WeakSet,Vp=new WeakSet,Hp=null,Up=null,Wp=!1,Gp=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML},Kp=(e,t)=>{e&&Xd().toast(e,{variant:t})};function qp(){let e=document.getElementById(Pp);if(e)return N(e.closest(`wui-modal`),`#${Pp} must be a wui-modal.`);let t=document.createElement(`wui-modal`);t.id=Pp;let n=document.createElement(`dialog`);return n.className=`modal wui-modal-shell`,n.style.setProperty(`--wui-modal-max-width`,`${rf.md}px`),n.innerHTML=`<div class="modal-dialog modal-dialog-centered wui-rb-dialog"><div class="modal-content wui-modal wui-confirm"><div class="wui-modal-body"><div class="wui-confirm-content"><span class="wui-confirm-icon"><wui-status-icon tone="info" size="120"></wui-status-icon></span><h3 class="wui-confirm-title" tabindex="-1" data-autofocus></h3><p class="wui-confirm-msg"></p></div></div><div class="wui-modal-footer"><div class="wui-confirm-actions"><button type="button" class="${Hs(`primary`,`soft`,`md`)}" data-wui-dismiss data-wui="${Rs}">${Gp(zp.cancelLabel)}</button><button type="button" class="${Hs(`primary`,`solid`,`md`)}" data-app-confirm data-wui="${Rs}"></button></div></div></div></div>`,t.append(n),document.body.appendChild(t),t}function Jp(e,t){let n=e.getAttribute(`data-wui-confirm-tone`);if(n!==null&&!Fp.includes(n))throw TypeError(`data-wui-confirm-tone="${n}" is not supported. Use danger, or leave it off.`);Yp({title:e.getAttribute(`data-wui-confirm-title`),message:e.getAttribute(`data-wui-confirm`),label:e.getAttribute(`data-wui-confirm-label`),danger:n===`danger`},t)}function Yp({title:e,message:t,label:n,danger:r},i){let a=qp(),o=a.querySelector(`.wui-confirm-title`),s=a.querySelector(`[data-app-confirm]`);if(!o||!s)throw Error(`#${Pp} is not a confirm dialog with a confirm button. Render <app-confirm-dialog id="${Pp}"> without confirm-href, or leave the dialog to the library.`);let c=a.querySelector(`.wui-confirm-msg`);c||(c=document.createElement(`p`),c.className=`wui-confirm-msg`,o.after(c));let l=e||zp.confirmTitle;o.textContent=l,c.textContent=t,s.textContent=n||zp.confirmLabel,s.classList.toggle(`btn-danger`,r),s.classList.toggle(`btn-primary`,!r),a.querySelector(`wui-status-icon`)?.setAttribute(`tone`,r?`delete`:`info`),N(a.querySelector(`dialog`),`#${Pp} has no <dialog>.`).setAttribute(`aria-label`,l),Up=i,Wp=!1,a.show()}var Xp=(e,t)=>{Hp=e;try{t()}finally{Hp=null}},Zp=(e,t)=>{let n=Reflect.get(e,t);if(n===void 0||typeof n==`string`)return n;throw TypeError(`confirmAction: ${t} must be text.`)},Qp=e=>{if(typeof e!=`object`||!e)throw TypeError(`confirmAction: options must be an object with a message.`);let t=`message`in e?e.message:void 0;if(typeof t!=`string`)throw TypeError(`confirmAction: message must be text.`);return{title:Zp(e,`title`),message:t,label:Zp(e,`label`),tone:Zp(e,`tone`)}};function $p(e,t,n){let{title:r,message:i,label:a,tone:o}=Qp(t);if(o!=null&&!Fp.includes(o))throw TypeError(`confirmAction: tone "${o}" is not supported. Use danger, or leave it off.`);ym(e.ownerDocument),Yp({title:r,message:i,label:a,danger:o===`danger`},()=>Xp(e,n))}var em=e=>`disabled`in e&&e.disabled===!0||e.getAttribute(`aria-disabled`)===`true`,tm=e=>{ke(e,HTMLElement,`data-wui-confirm needs an HTML element to click.`).click()};function nm(e){let t=P(e.target,`[data-wui-confirm]:not(form)`);t&&t!==Hp&&!em(t)&&(e.preventDefault(),e.stopImmediatePropagation(),Jp(t,()=>Xp(t,()=>tm(t))))}function rm(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!t.hasAttribute(`data-wui-confirm`)||t===Hp||e.submitter&&e.submitter===Hp||t.querySelector(`input[data-app-repeater-hidden]`))return;e.preventDefault(),e.stopImmediatePropagation();let n=e.submitter instanceof HTMLButtonElement||e.submitter instanceof HTMLInputElement?e.submitter:null,r=n?.form===t?n:void 0;Jp(t,()=>Xp(t,()=>t.requestSubmit(r)))}function im(e){let t=P(e.target,`#${Pp} [data-app-confirm]`);t&&!t.hasAttribute(`disabled`)&&Up&&(Wp=!0,N(t.closest(`wui-modal`),`#${Pp} is missing around its confirm button.`).hide())}function am(e){if(!(e.target instanceof Element)||e.target.id!==`wuiConfirm`)return;let t=Wp?Up:null;Up=null,Wp=!1,t?.()}function om(e,t){e&&window.sessionStorage.setItem(Rp,JSON.stringify({message:e,variant:t}))}var sm=e=>e===`forbidden`?zp.forbidden:e===`network`?zp.network:zp.failed;function cm(){for(let e of document.querySelectorAll(`[data-wui-server]`))e.getAttribute(`data-refresh-on-success`)!==`false`&&Ud(e)?.reload()}var lm=(e,t)=>{`disabled`in e&&(e.disabled=t)};async function um(e){let t=e.getAttribute(`data-wui-post`);if(!t)throw Error(`A data-wui-post button needs the URL the action posts to.`);return dm(t,e)}async function dm(e,t,n){let r=t.getAttribute(`data-wui-post-reload`);if(r!==null&&r!==`page`)throw TypeError(`data-wui-post-reload="${r}" is not supported. Use page, or leave it off to reload the server tables.`);lm(t,!0),t.setAttribute(`aria-busy`,`true`);let i=await ga(e,{method:`POST`,body:n});if(i.kind===`session`||i.kind===`aborted`)return;let a=i.toastVariant||`success`;i.ok&&(i.redirect||r===`page`)?(om(i.message,a),i.redirect?window.location.assign(i.redirect):window.location.reload()):(lm(t,!1),t.removeAttribute(`aria-busy`),i.ok?(Zd(i,a),cm()):Kp(i.message||sm(i.kind),`danger`))}function fm(e,t){lm(e,!1),e.removeAttribute(`aria-busy`),H(t),Kp(zp.failed,`danger`)}function pm(e){let t=P(e.target,`[data-wui-post]`);t&&(e.preventDefault(),em(t)||t.getAttribute(`aria-busy`)===`true`||um(t).catch(e=>fm(t,e)))}function mm(e){let t=P(e.target,`form[data-wui-post-form]`);if(!(t instanceof HTMLFormElement)||e.defaultPrevented)return;e.preventDefault();let n=N(e.submitter||t.querySelector(`button:not(.repeater-add):not(.repeater-remove)`),`A data-wui-post-form needs a submit button to report its result on.`);if(n.getAttribute(`aria-busy`)===`true`)return;let r=new URL(N(t.getAttribute(`action`),`A data-wui-post-form needs an action attribute to post to.`),document.baseURI).href;dm(r,n,new FormData(t)).catch(e=>fm(n,e)),t.closest(`wui-dropdown`)?.hide()}function hm(){let e=window.sessionStorage.getItem(Rp);if(!e)return;window.sessionStorage.removeItem(Rp);let t=JSON.parse(e);if(typeof t!=`object`||!t)throw TypeError(`stored flash is not an object.`);let n=`message`in t?t.message:void 0,r=`variant`in t?t.variant:void 0;if(typeof r!=`string`||!Lp(r))throw TypeError(`stored flash variant "${String(r)}" is not supported.`);if(typeof n!=`string`)throw TypeError(`stored flash message is not text.`);Kp(n,r)}function gm(e){let t=e.querySelectorAll?[...e.querySelectorAll(`[data-wui-flash]`)]:[];e instanceof Element&&e.matches(`[data-wui-flash]`)&&t.unshift(e);for(let e of t){let t=e.getAttribute(`data-wui-flash-variant`)||`success`;if(!Lp(t))throw TypeError(`data-wui-flash-variant="${t}" is not supported. Use ${Ip.join(`, `)}.`);let n=e.getAttribute(`data-wui-flash`)||(e.textContent??``).trim();e.remove(),Kp(n,t)}}var _m=e=>e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?e.form:null;function vm(e){if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-wui-auto-submit]`);if(!t)return;let n=_m(e.target)||t.closest(`form`);n instanceof HTMLFormElement&&n.requestSubmit()}function ym(e){Vp.has(e)||(Vp.add(e),e.addEventListener(`click`,im),e.addEventListener(`wui-modal-closed`,am))}function bm(e=document){let t=e instanceof Element?e.ownerDocument:e;Bp.has(t)||(Bp.add(t),t.addEventListener(`click`,nm,!0),t.addEventListener(`submit`,rm,!0),ym(t),t.addEventListener(`click`,pm),t.addEventListener(`submit`,mm),t.addEventListener(`change`,vm),hm()),gm(e)}var xm=Object.freeze({title:`Leave without saving?`,message:`Your changes on this page are not saved. If you leave now, they are lost.`,leaveLabel:`Leave`}),Sm=`form[data-wui-unsaved]`,Cm=`[aria-invalid="true"], .field-error:not(:empty), .field-validation-error, .validation-summary-errors, .wui-error-summary`,wm=`[download], [data-wui-modal], [data-wui-post], [data-bs-toggle]`,Tm=new Set([`submit`,`button`,`reset`,`image`]),Em=new Set([`hidden`,`checkbox`,`radio`,`file`,`submit`,`button`,`reset`,`image`,`range`,`color`]),Dm=e=>e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement||e instanceof HTMLFieldSetElement||e instanceof HTMLObjectElement||e instanceof HTMLOutputElement,Om=e=>Dm(e)?e instanceof HTMLObjectElement||e instanceof HTMLOutputElement?!1:e.disabled:`disabled`in e&&!!e.disabled,km=e=>`name`in e&&typeof e.name==`string`&&e.name!==``,Am=e=>typeof e==`object`&&!!e,jm=e=>Array.isArray(e)&&e.every(e=>Array.isArray(e)&&typeof e[0]==`string`);function Mm(e){let t=JSON.parse(e);if(!jm(t))throw Error(`unsaved-changes snapshot is malformed`);return t}var Nm=new WeakMap,Pm=new WeakSet,Fm=e=>`${e.name}:${e.size}:${e.lastModified}`,Im=e=>[...e.querySelectorAll(Sm)].filter(e=>e instanceof HTMLFormElement);function Lm(e){let t=[];for(let n of e.elements)km(n)&&!Om(n)&&(Dm(n)&&Tm.has(n.type)||(n instanceof HTMLInputElement&&(n.type===`checkbox`||n.type===`radio`)?t.push([n.name,n.value,n.checked]):n instanceof HTMLInputElement&&n.type===`file`?t.push([n.name,[...n.files||[]].map(Fm)]):n instanceof HTMLSelectElement&&n.type===`select-multiple`?t.push([n.name,[...n.selectedOptions].map(e=>e.value)]):n instanceof HTMLFieldSetElement||n instanceof HTMLObjectElement?t.push([n.name,null]):t.push([n.name,`value`in n?n.value:null])));return JSON.stringify(t)}function Rm(e){return Lm(e)}function zm(e,t){let n=new Map,r=Mm(t);for(let e of r){let t=n.get(e[0]);t?t.push(e):n.set(e[0],[e])}let i=Mm(Lm(e)).map(e=>n.get(e[0])?.shift()??e);for(let e of n.values())i.push(...e);return JSON.stringify(i)}function Bm(e){for(let t of e.elements)if(Dm(t)&&t.name&&!Om(t)){if(t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&!Em.has(t.type)){if(t.value.trim()!==``)return!0}else if(t instanceof HTMLInputElement&&t.type===`file`&&(t.files?.length??0)>0)return!0}return!1}var Vm=e=>({saved:e.querySelector(Cm)&&Bm(e)?null:Lm(e),engaged:!1,discarded:!1});function Hm(e){let t=Nm.get(e);return!t||t.discarded||!e.isConnected?!1:t.saved===null||t.engaged&&Lm(e)!==t.saved}var Um=(e,t)=>Im(e).filter(e=>e!==t&&Hm(e));function Wm(e,t,n){let r=t.map(e=>e.getAttribute(`data-wui-unsaved`)).find(Boolean)||xm.message;$p(e,{title:xm.title,message:r,label:xm.leaveLabel,tone:`danger`},()=>{for(let e of t){let t=Nm.get(e);t&&(t.discarded=!0)}n()})}function Gm(e){if(e.matches(wm))return!1;let t=e.getAttribute(`target`);if(t&&t.toLowerCase()!==`_self`)return!1;let n=e.getAttribute(`href`);if(n===null)return!1;let r=new URL(n,window.location.href);if(r.protocol!==`http:`&&r.protocol!==`https:`)return!1;let i=window.location;return!(r.hash&&r.origin===i.origin&&r.pathname===i.pathname&&r.search===i.search)}function Km(e,t){if((t?.getAttribute(`formmethod`)||e.getAttribute(`method`)||`get`).toLowerCase()===`dialog`)return!1;let n=t?.getAttribute(`formtarget`)||e.getAttribute(`target`);return!n||n.toLowerCase()===`_self`}function qm(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target,n=P(t,`a[href]`);if(!(n instanceof HTMLAnchorElement)||!Gm(n))return;let r=Um(n.ownerDocument,null);r.length&&(e.preventDefault(),Wm(n,r,()=>n.click()))}function Jm(e){let t=e.target;if(!(t instanceof HTMLFormElement)||e.defaultPrevented||!Km(t,e.submitter))return;let n=Um(t.ownerDocument,t);if(n.length){e.preventDefault();let r=e.submitter,i=(r instanceof HTMLButtonElement||r instanceof HTMLInputElement)&&r.form===t?r:void 0;Wm(t,n,()=>t.requestSubmit(i));return}let r=Nm.get(t);r&&(r.saved=Lm(t),r.discarded=!1)}function Ym(e){Um(document,null).length&&(e.preventDefault(),e.returnValue=``)}function Xm(e){let t=e.target,n=P(t,Sm);return n instanceof HTMLFormElement?n:null}function Zm(e){let t=Xm(e);if(!t)return;let n=Nm.get(t);n&&!n.engaged&&(n.saved!==null&&(n.saved=Lm(t)),n.engaged=!0)}function Qm(e){let t=Xm(e),n=t&&Nm.get(t);n&&(n.discarded=!1,e.isTrusted&&(n.engaged=!0))}function $m(e){for(let t of Im(e)){let e=Nm.get(t);e?.saved&&(e.saved=zm(t,e.saved))}}function eh(e){let t=Am(e)?e.handle:void 0;return Am(t)?t.el:void 0}function th(e){if(!(e instanceof CustomEvent))return;let t=eh(e.detail);if(t instanceof Element)for(let e of Im(t))rh(e)}function nh(e=document){let t=e instanceof Document?e:e.ownerDocument;if(!Pm.has(t)){Pm.add(t);for(let e of[`focusin`,`pointerdown`,`drop`])t.addEventListener(e,Zm,!0);for(let e of[`input`,`change`])t.addEventListener(e,Qm,!0);t.addEventListener(`click`,qm),t.addEventListener(`submit`,Jm),t.addEventListener(`wui:modal:success`,th),t.addEventListener(Pr,()=>$m(t)),N(t.defaultView,`unsaved-changes guard needs a document with a window`).addEventListener(`beforeunload`,Ym)}let n=Im(e);e instanceof HTMLFormElement&&e.matches(Sm)&&n.unshift(e);for(let e of n)Nm.has(e)||Nm.set(e,Vm(e))}function rh(e){if(!(e instanceof HTMLFormElement)||!e.matches(Sm))throw TypeError(`resetUnsavedChanges: ${String(e)} is not a <form data-wui-unsaved>.`);Nm.set(e,{saved:Lm(e),engaged:!1,discarded:!1})}var ih=Object.freeze({question:`Discard your changes?`,discard:`Discard`,keep:`Keep editing`}),ah=`wui:drawer:discard`,oh=`wui-drawer[confirm-discard]`,sh=`wui-modal`,ch=`data-wui-no-discard`,lh=`.wui-drawer-discard`,uh=`input, select, textarea`,dh=e=>typeof e==`object`&&!!e||typeof e==`function`;function fh(e){let t=e.currentTarget;if(!(t instanceof Document))throw Error(`The discard guard is not wired on a document.`);return t}function ph(e,t){return P(e,t)}var mh=e=>e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement,hh=new WeakMap,gh=new WeakSet,_h=new WeakSet;function vh(e,t,n,r,i){let a=e.createElement(`button`);return a.type=`button`,a.className=Hs(t,n,`sm`),a.dataset.wui=Rs,a.setAttribute(r,``),a.textContent=i,a}function yh(e,t){let n=e.createElement(`div`);n.className=`wui-drawer-discard`,n.setAttribute(`role`,`alert`);let r=e.createElement(`span`);return r.className=`wui-drawer-discard-text`,r.textContent=t,n.append(r,vh(e,`danger`,`solid`,`data-wui-discard-confirm`,ih.discard),vh(e,`primary`,`soft`,`data-wui-discard-keep`,ih.keep)),n}function bh(e){if(!(e instanceof Element))return null;let t=e.closest(oh);if(t)return t;let n=e.closest(sh);return n&&Ch(n).length?n:null}function xh(e){return e.closest(oh)??e.closest(sh)}function Sh(e,t){return t.hasAttribute(ch)||e.hasAttribute(ch)?!1:t.hasAttribute(`confirm-discard`)||e.hasAttribute(`data-wui-confirm-discard`)?!0:(e.getAttribute(`method`)||`get`).toLowerCase()!==`get`}function Ch(e){return e.matches(oh)?e.querySelectorAll(`form`):[...e.querySelectorAll(`form`)].filter(t=>Sh(t,e))}function wh(e){let t=hh.get(e);return t!=null&&Rm(e)!==t}function Th(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-drawer-footer`,N(e.querySelector(`.wui-drawer-panel`),`The drawer has no panel to hold its footer.`).append(t),_h.add(t),t}function Eh(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-modal-footer`,(e.querySelector(`.wui-modal-body`)?.parentElement??e.querySelector(`.modal-content`)??e).append(t),_h.add(t),t}function Dh(e){let t=e.querySelector(`[data-wui-discard-confirm]`);if(!(t instanceof HTMLElement))throw Error(`The discard prompt has no confirm button.`);t.focus()}function Oh(e,t,n){let r=e.querySelector(lh);if(r){Dh(r);return}let i=yh(e.ownerDocument,t),a;if(e.matches(oh))a=e.querySelector(`.wui-drawer-footer`)??Th(e),a.prepend(i);else if(e.hasAttribute(`confirm-discard`))a=e.querySelector(`.wui-modal-footer`)??Eh(e),a.prepend(i);else{if(!n)throw Error(`A discard prompt needs the form that is dirty.`);a=n.querySelector(`.modal-footer`),a?a.prepend(i):(a=n,n.append(i))}a.classList.add(`wui-drawer-discarding`),Dh(i)}function kh(e){let t=e.parentElement;if(e.remove(),!t)throw Error(`The discard prompt has no footer.`);t.classList.remove(`wui-drawer-discarding`),_h.has(t)&&t.remove()}function Ah(e){for(let t of Ch(e))for(let e of t.querySelectorAll(uh))if(mh(e)&&e.type!==`hidden`&&!e.disabled){e.focus({preventScroll:!0});return}}function jh(e){let t=bh(e.target);if(t)for(let e of Ch(t))hh.get(e)??hh.set(e,Rm(e))}function Mh(e){for(let t of fh(e).querySelectorAll(`form`)){let e=hh.get(t);e!=null&&hh.set(t,zm(t,e))}}function Nh(e){let t=e.target;t instanceof HTMLFormElement&&bh(t)&&hh.set(t,Rm(t))}function Ph(e){if(!dh(e))return;let t=`handle`in e?e.handle:void 0;if(dh(t))return`el`in t?t.el:void 0}function Fh(e){if(!(e instanceof CustomEvent))return;let t=e.detail,n=Ph(t);if(n instanceof Element)for(let e of n.querySelectorAll(`form`))hh.delete(e)}function Ih(e){let t=e.target;t instanceof Element&&t.matches(oh)&&[...Ch(t)].some(wh)&&(e.preventDefault(),Oh(t,t.getAttribute(`confirm-discard`),null))}function Lh(e){let t=e.target;if(!(t instanceof Element)||!t.matches(sh))return;let n=[...Ch(t)].find(wh);n&&(e.preventDefault(),Oh(t,n.getAttribute(`data-wui-confirm-discard`)??t.getAttribute(`confirm-discard`)??ih.question,n))}function Rh(e){let t=N(e.closest(lh),`The discard button is outside its prompt.`),n=xh(t);if(kh(t),!n)throw Error(`The discard prompt is outside its drawer or modal.`);for(let e of Ch(n))hh.set(e,Rm(e));n.dispatchEvent(new CustomEvent(ah,{bubbles:!0})),n.matches(oh)?N(n.closest(`wui-drawer`),`The confirm-discard drawer is not a wui-drawer.`).hide():N(n.closest(`wui-modal`),`The discarded dialog is not a wui-modal.`).hide()}function zh(e){let t=N(e.closest(lh),`The keep button is outside its prompt.`),n=xh(t);if(kh(t),!n)throw Error(`The discard prompt is outside its drawer or modal.`);Ah(n)}function Bh(e){let t=ph(e.target,`[data-wui-discard-confirm]`);if(t){Rh(t);return}let n=ph(e.target,`[data-wui-discard-keep]`);n&&zh(n)}function Vh(e=document){let t=e instanceof Document?e:e.ownerDocument;gh.has(t)||(gh.add(t),t.addEventListener(`focusin`,jh),t.addEventListener(`pointerdown`,jh),t.addEventListener(`submit`,Nh),t.addEventListener(Pr,Mh),t.addEventListener(`wui:modal:success`,Fh),t.addEventListener(`wui:modal:loaded`,Fh),t.addEventListener(`wui-drawer-close`,Ih,!0),t.addEventListener(`wui-modal-close`,Lh),t.addEventListener(`click`,Bh))}var Hh=31536e3,Uh=new WeakMap,Wh=e=>e>99?`99+`:String(e),Gh=(e,t)=>Object.entries(t).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,()=>String(n)),e);function Kh(e,t,n=document){try{n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${Hh}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}function qh(e,t,n,r=document){try{let i=`${e}=`,a=r.cookie.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(i)),o=new Set(a?a.slice(i.length).split(`.`).filter(Boolean):[]);n?o.add(t):o.delete(t),r.cookie=`${e}=${[...o].join(`.`)}; Path=/; Max-Age=${Hh}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}var Jh=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content},$=(e,t,n)=>{let r=e?.querySelector(t);return r instanceof n?r:null},Yh=(e,t,n)=>{let r=e?.closest(t);return r instanceof n?r:null},Xh=(e,t,n)=>e?[...e.querySelectorAll(t)].filter(e=>e instanceof n):[],Zh=e=>{if(!(e.target instanceof Element))throw Error(`event target is not an element`);return e.target},Qh=e=>{let t=e.getAttribute(`href`);if(t===null)throw Error(`search hit has no href`);return t},$h=(e,t)=>{let n=document.createElement(`div`);return n.className=e,n.textContent=t,n};function eg(e,t){let n=$(e,`.wui-bell-trigger`,HTMLElement),r=$(e,`.wui-bell-count`,HTMLElement),i=$(e,`[data-wui-bell-live]`,HTMLElement),a=$(e,`[data-wui-bell-list]`,HTMLElement),o=()=>N(a,`bell list missing`),s=$(e,`.wui-bell-menu`,HTMLElement),{src:c,readAction:l}=e.dataset,u=e.dataset.label||`Notifications`,d=e.dataset.emptyText||`You are all caught up.`,f=e.dataset.loadingText??`Loading…`,p=e.dataset.noUnreadText??`No unread notifications`,m=e.dataset.unreadText??`{count} unread notifications`,h=e.dataset.bellLabel??`{label}, {count} unread`,g=Number(e.dataset.pollSeconds??60),_=_a(),v=Number(e.dataset.unread)||0,y=(t,a=!0)=>{let o=Math.max(0,Number(t)||0),s=o!==v;v=o,e.dataset.unread=String(o),r&&(r.textContent=Wh(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?u:Gh(h,{label:u,count:Wh(o)})),a&&s&&i&&(i.textContent=o===0?p:Gh(m,{count:Wh(o)}))},b=()=>s?M(s):!1,x=()=>{let e=$h(`wui-bell-state`,`Could not load notifications. `),t=document.createElement(`button`);t.type=`button`,t.className=`btn btn-link btn-sm`,t.dataset.wuiBellRetry=``,t.textContent=`Retry`,e.append(t),o().replaceChildren(e)},S=async t=>{if(t&&(o().setAttribute(`aria-busy`,`true`),o().querySelector(`.wui-bell-item`)||o().replaceChildren($h(`wui-bell-state`,f))),c===void 0)throw Error(`bell has no data-src`);let n=await _.run(c);if(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)return;if(o().removeAttribute(`aria-busy`),!n.ok){t&&x();return}let r=Jh(n.html),i=$(r,`[data-wui-unread]`,HTMLElement),a=i?Number(i.getAttribute(`data-wui-unread`)):v;y(a),(t||b())&&(r.querySelector(`.wui-bell-item`)?o().replaceChildren(r):o().replaceChildren($h(`wui-bell-state`,d))),e.dispatchEvent(new CustomEvent(`wui:notifications:loaded`,{bubbles:!0,detail:{unread:a}}))};s?.addEventListener(`beforetoggle`,e=>{`newState`in e&&e.newState===`open`&&S(!0)}),e.addEventListener(`click`,async e=>{let t=Zh(e);if(t.closest(`[data-wui-bell-retry]`)){await S(!0);return}let n=Yh(t,`[data-wui-bell-read]`,HTMLButtonElement);if(!n||!l)return;n.disabled=!0;let r=await ga(l,{method:`POST`});n.disabled=!1,r.ok&&(y(0),await S(!0))});let C=null,w=()=>{g>0&&C===null&&(C=setInterval(()=>S(b()),g*1e3))},T=()=>{C!==null&&clearInterval(C),C=null},E=()=>{document.hidden?T():(S(b()),w())};return g>0&&(document.addEventListener(`visibilitychange`,E),document.hidden||w()),t.push(()=>{T(),_.abort(),document.removeEventListener(`visibilitychange`,E)}),{setUnread:e=>y(e),refresh:()=>S(b())}}var tg=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),ng=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function rg(e,t){let n=N($(e,`input.search-input`,HTMLInputElement),`search input missing`),r=$(e,`.wui-topsearch-results`,HTMLElement),i=()=>N(r,`search results missing`),a=$(e,`.wui-topsearch-open`,HTMLElement),o=$(e,`[data-wui-topsearch-live]`,HTMLElement),{src:s,param:c=`q`,resultsHref:l}=e.dataset,u=Number(e.dataset.minChars??2),d=Number(e.dataset.debounceMs??250),f=e.dataset.noResultsText??`No results`,p=e.dataset.resultsCountText??`{count} results`,m=e.dataset.resultCountText??`{count} result`,h=_a(),g,_=-1,v=()=>Xh(i(),`.wui-topsearch-hit`,HTMLElement),y=e=>{let t=v();_=t.length===0?-1:(e+t.length)%t.length,t.forEach((e,t)=>{let n=t===_;e.classList.toggle(`is-active`,n),e.setAttribute(`aria-selected`,n?`true`:`false`)});let r=_>=0?t[_]:void 0;r?(n.setAttribute(`aria-activedescendant`,r.id),r.scrollIntoView?.({block:`nearest`})):n.removeAttribute(`aria-activedescendant`)},b=()=>{i().hidden=!0,n.setAttribute(`aria-expanded`,`false`),n.removeAttribute(`aria-activedescendant`),_=-1},x=()=>{i().hidden=!1,n.setAttribute(`aria-expanded`,`true`)},S=t=>{e.classList.toggle(`is-open`,t),a?.setAttribute(`aria-expanded`,t?`true`:`false`)},C=t=>{let n=new CustomEvent(`wui:search:select`,{bubbles:!0,cancelable:!0,detail:{href:t}});e.dispatchEvent(n)&&window.location.assign(t)},w=async t=>{if(e.classList.add(`is-loading`),s===void 0)throw Error(`search has no data-src`);let n=await h.run(ng(s,c,t));if(n.kind!==`aborted`&&n.kind!==`stale`&&n.kind!==`session`){if(e.classList.remove(`is-loading`),n.ok){let e=Jh(n.html),t=$(e,`[data-wui-count]`,HTMLElement);i().replaceChildren(e),v().forEach((e,t)=>{e.id=`${i().id}-opt-${t}`});let r=t?Number(t.getAttribute(`data-wui-count`)):v().length;o&&(o.textContent=r===0?f:Gh(r===1?m:p,{count:r}))}else i().replaceChildren($h(`wui-topsearch-empty`,`Search is unavailable right now.`));_=-1,x()}};n.addEventListener(`input`,()=>{clearTimeout(g);let t=n.value.trim();t.length<u?(h.abort(),e.classList.remove(`is-loading`),i().replaceChildren(),b()):g=setTimeout(()=>w(t),d)}),n.addEventListener(`keydown`,t=>{if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(i().hidden||v().length===0)return;t.preventDefault(),y(_+(t.key===`ArrowDown`?1:-1))}else if(Zn(t)){let e=v(),r=_>=0?e[_]:void 0;!i().hidden&&r?(t.preventDefault(),C(Qh(r))):l&&n.value.trim()!==``&&(t.preventDefault(),C(ng(l,c,n.value.trim())))}else t.key===`Escape`&&(i().hidden?e.classList.contains(`is-open`)&&(t.preventDefault(),t.stopPropagation(),S(!1),a?.focus()):(t.preventDefault(),t.stopPropagation(),b()))}),i().addEventListener(`click`,e=>{let t=Yh(Zh(e),`.wui-topsearch-hit`,HTMLElement);!t||e.ctrlKey||e.metaKey||e.shiftKey||e.button===1||(e.preventDefault(),C(Qh(t)))}),a?.addEventListener(`click`,()=>{let t=!e.classList.contains(`is-open`);S(t),t&&n.focus()});let T=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||tg(e.target)||(e.preventDefault(),S(!0),n.focus())},E=t=>{t.target instanceof Node&&e.contains(t.target)||(b(),e.classList.contains(`is-open`)&&S(!1))};document.addEventListener(`keydown`,T),document.addEventListener(`pointerdown`,E),t.push(()=>{clearTimeout(g),h.abort(),document.removeEventListener(`keydown`,T),document.removeEventListener(`pointerdown`,E)})}function ig(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>{Kh(n,!!e.detail?.collapsed)});let r=e.dataset.wuiFoldedCookie;r&&e.addEventListener(`wui:shell:nav-fold`,e=>{qh(r,e.detail?.key,!!e.detail?.folded)}),e.addEventListener(`click`,t=>{Zh(t).closest(`[data-wui-tabbar-more]`)&&$(e,`[data-app-shell-menu]`,HTMLElement)?.click()});let i=$(e,`[data-wui-bell]`,HTMLElement),a=i?eg(i,t):null,o=$(e,`[data-wui-topsearch]`,HTMLElement);o&&rg(o,t);let s={el:e,setUnread(e){N(a,`WUI.shell: this <app-shell> has no <app-shell-notifications>.`).setUnread(e)},refreshNotifications(){return N(a,`WUI.shell: this <app-shell> has no <app-shell-notifications>.`).refresh()},get collapsed(){return e.classList.contains(`collapsed`)},set collapsed(t){if(!!t===e.classList.contains(`collapsed`))return;let n=$(e,`[data-app-shell-collapse]`,HTMLElement);n?n.click():e.classList.toggle(`collapsed`,!!t)}};Uh.set(e,s);let c=n=>{if(n.target===e||n.target instanceof Node&&n.target.contains(e)){for(let e of t)e();Uh.delete(e),delete e.dataset.wuiPartsWired,document.removeEventListener(`wui:teardown`,c)}};return document.addEventListener(`wui:teardown`,c),s}function ag(e=document){let t=[];e instanceof HTMLElement&&e.matches(`[data-app-shell]`)&&t.push(e),t.push(...Xh(e,`[data-app-shell]`,HTMLElement));for(let e of t)e.dataset.wuiPartsWired||(e.dataset.wuiPartsWired=`1`,ig(e))}function og(e){let t=Yh(e,`[data-app-shell]`,HTMLElement);return t?(Uh.has(t)||ag(t),Uh.get(t)??null):null}var sg=`data-wui-submit-once`,cg=`data-wui-submit-pending`,lg=`wui-submit-spinner`,ug=new WeakSet,dg=new WeakMap;function fg(e){return e instanceof HTMLButtonElement||e instanceof HTMLInputElement?e:null}function pg(e){if(e.setAttribute(`aria-busy`,`true`),e.tagName===`INPUT`||e.querySelector(`.${lg}`))return;let t=e.ownerDocument.createElement(`span`);t.className=`spinner-border spinner-border-sm me-2 ${lg}`,t.setAttribute(`aria-hidden`,`true`),e.prepend(t)}function mg(e){e.removeAttribute(`aria-busy`),e.querySelector(`.${lg}`)?.remove()}function hg(e){return e.method===`post`&&e.target!==`_blank`&&e.getAttribute(`data-wui-submit-once`)!==`off`}function gg(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!hg(t))return;if(t.hasAttribute(cg)){e.preventDefault();return}t.setAttribute(cg,``);let n=fg(e.submitter);setTimeout(()=>{t.hasAttribute(cg)&&(e.defaultPrevented?t.removeAttribute(cg):n&&(n.disabled=!0,pg(n),dg.set(t,n)))},0)}var _g=e=>[...e.querySelectorAll(`form[${cg}]`)].filter(e=>e instanceof HTMLFormElement);function vg(e){for(let t of _g(e)){t.removeAttribute(cg);let e=dg.get(t);e&&(e.disabled=!1,mg(e),dg.delete(t))}}function yg(e){let t=e.ownerDocument===null?e:e.ownerDocument;ug.has(t)||(ug.add(t),t.addEventListener(`submit`,gg,!0),t.defaultView?.addEventListener(`pageshow`,()=>vg(t)))}var bg=[`light`,`dark`,`auto`],xg=[`wave`,`circle`,`slide`,`blinds`,`fade`,`none`],Sg=`wave`,Cg=`theme`,wg={wave:1100,circle:700,slide:600,blinds:900,fade:350,none:0},Tg=`wui-theme-switching`,Eg=`wui:theme:change`,Dg=`(prefers-color-scheme: dark)`,Og=e=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(e).matches,kg=e=>bg.some(t=>t===e);function Ag(e){return e===`dark`||e===`auto`&&Og(Dg)?`dark`:`light`}function jg(e=Cg){let t=null;try{t=window.localStorage.getItem(e)}catch(e){if(!(e instanceof DOMException))throw e}return kg(t)?t:`auto`}function Mg(e,t=Cg){try{window.localStorage.setItem(t,e)}catch(e){if(!(e instanceof DOMException))throw e}}function Ng(e){let t=document.documentElement,n=Ag(e);t.setAttribute(`data-theme`,e),t.setAttribute(`data-bs-theme`,n),document.dispatchEvent(new CustomEvent(Eg,{detail:{mode:n,preference:e}}))}var Pg=`((k)=>{var m;try{m=localStorage.getItem(k)}catch{m=null}if(m!=='light'&&m!=='dark')m='auto';var r=document.documentElement,q=window.matchMedia?window.matchMedia('(prefers-color-scheme: dark)'):null;function s(){var t=r.getAttribute('data-theme');r.setAttribute('data-bs-theme',t==='auto'?(q?.matches?'dark':'light'):t)}r.setAttribute('data-theme',m);s();if(q?.addEventListener)q.addEventListener('change',()=>{if(r.getAttribute('data-theme')==='auto')s()})})(`;function Fg(e=Cg){return`${Pg}${JSON.stringify(String(e)).replace(/</g,`\\u003c`)})`}function Ig(e,{includeAuto:t=!1}={}){return e===`light`?`dark`:e===`dark`&&t?`auto`:`light`}function Lg(e){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(Dg),n=()=>e(t.matches?`dark`:`light`);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}var Rg=60,zg=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,Bg=e=>e.toFixed(1),Vg=(e,t)=>`${Bg(e)}px ${Bg(t)}px`,Hg={amplitude:22,segments:36,cycles:1.5,ripples:2},Ug=6,Wg=(e,t,n,r,i)=>{let{amplitude:a,segments:o,cycles:s}=Hg,c=n*(t+2*a),l=i?t+a-c:c-a,u=i?t+2*a:-2*a,d=[Vg(0,u)];for(let t=0;t<=o;t++){let n=e*t/o,i=l+a*Math.sin(2*Math.PI*s*t/o+r);d.push(Vg(n,i))}return d.push(Vg(e,u)),`polygon(${d.join(`, `)})`},Gg=(e,t,n,r)=>{let i=t/Ug,a=[];for(let t=0;t<Ug;t++){let o=t*i,s=i*n,c=r?o+i-s:o,l=r?o+i:o+s;a.push(Vg(0,c),Vg(e,c),Vg(e,l),Vg(0,l))}return`polygon(${a.join(`, `)})`};function Kg(e,{width:t,height:n,to:r=`dark`,origin:i}){let a=r===`dark`,o=[];for(let r=0;r<=Rg;r++){let s=r/Rg,c=zg(s);switch(e){case`circle`:{let e=i?.x??t/2,r=i?.y??n/2,a=Math.hypot(Math.max(e,t-e),Math.max(r,n-r));o.push({clipPath:`circle(${Bg(a*c)}px at ${Bg(e)}px ${Bg(r)}px)`});break}case`slide`:{let e=n*(1-c);o.push({clipPath:a?`inset(${Bg(e)}px 0px 0px 0px)`:`inset(0px 0px ${Bg(e)}px 0px)`});break}case`blinds`:o.push({clipPath:Gg(t,n,c,a)});break;case`fade`:o.push({clipPath:`none`,opacity:c});break;case`none`:return[];default:o.push({clipPath:Wg(t,n,c,s*Hg.ripples*2*Math.PI,a)})}}return o}var qg=e=>{e instanceof DOMException&&(e.name===`AbortError`||e.name===`InvalidStateError`)||H(`[@webority/ui-elements] The theme view transition failed:`,e)};function Jg(e,{effect:t=Sg,to:n,origin:r,duration:i}={}){let a=document.documentElement,o=n!==void 0&&a.getAttribute(`data-bs-theme`)===n;if(t===`none`||o||Og(`(prefers-reduced-motion: reduce)`)||typeof document.startViewTransition!=`function`||typeof a.animate!=`function`)return e(),Promise.resolve(!1);a.classList.add(Tg);let s=document.startViewTransition(e),c=i??wg[t]??wg.wave;return s.ready.then(()=>{let e=Kg(t,{width:window.innerWidth,height:window.innerHeight,to:n,origin:r});a.animate(e,{duration:c,easing:`linear`,fill:`both`,pseudoElement:`::view-transition-new(root)`})}).catch(qg),s.finished.catch(qg).finally(()=>a.classList.remove(Tg)).then(()=>!0)}function Yg(){lt(),i(`wui-select`,es),i(`wui-datepicker`,Si),i(`wui-dock`,Ci),i(`wui-otp`,Ka),i(`wui-shortcuts`,Cs),i(`wui-record-pager`,ho),i(`wui-data-table`,ar),i(`wui-hover-card`,Ni),i(`wui-navigation-menu`,Hi),i(`wui-notification-center`,Fa),i(`wui-onboarding-checklist`,Ua),i(`wui-overflow`,ao),i(`wui-rating`,mo),i(`wui-relative-time`,Oo),i(`wui-rolling-number`,jo),i(`wui-show-more`,Ds),i(`wui-truncate`,Os),i(`wui-whats-new`,Is)}return globalThis.WeborityUiElementsInternal||(globalThis.WeborityUiElementsInternal={version:`0.164.0`,modules:$c}),Kr(),Yg(),e.AVATAR_ACCEPT=el,e.AVATAR_MAX_SIZE_MB=tl,e.AVATAR_OUTPUT_SIZE=nl,e.AVATAR_OUTPUT_TYPE=rl,e.AVATAR_PREVIEW_SIZES=il,e.AVATAR_TEXT=al,e.BAR_BULK_IN_BAR_ATTRIBUTE=Eu,e.COLUMN_MAX_WIDTH=gn,e.COLUMN_MIN_WIDTH=hn,e.COMMAND_SHORTCUT_ATTRIBUTE=Sl,e.CONFIRM_DIALOG_ID=Pp,e.CONFIRM_TONES=Fp,e.COPY_FEEDBACK_MS=Ws,e.CSRF_META_NAME=ia,e.CURRENCIES=Ot,e.CURRENCY_SYMBOLS=dt,e.DATA_TABLE_TEXT=L,e.DATE_PATTERNS=jt,e.DEFAULT_CSRF_HEADER=aa,e.DEFAULT_CURRENCY=ut,e.DEFAULT_IMAGE_ACCEPT=kl,e.DEFAULT_MAX_SIZE_MB=Al,e.DEFAULT_PASSWORD_RULES=Fu,e.DEFAULT_REQUIREMENTS_TITLE=Iu,e.DEFAULT_THEME_EFFECT=Sg,e.DEFAULT_THEME_STORAGE_KEY=Cg,e.DISCARD_EVENT=ah,e.DISCARD_TEXT=ih,e.DROP_OVER_CLASS=Hu,e.DURATION_UNITS=At,e.EMPTY_VALUE=Nt,e.FILTER_POPOVER_MAX_CHIPS=Ze,e.FLASH_STORAGE_KEY=Rp,e.FLASH_VARIANTS=Ip,e.FORMAT_STYLES=Dt,e.HTTP_KINDS=la,e.IST_TIME_ZONE=F,e.LIST_KEYS=Pe,e.MASK_INPUT_TYPES=Jl,e.MASK_NAMES=nu,e.MENTION_ID_PATTERN=qs,e.MONEY_UNITS=kt,e.NOTIFICATION_COUNT_CAP=Wi,e.NOTIFICATION_TEXT=Ki,e.PIN_AT_VAR=An,e.PIN_SIDES=yn,e.RESIZE_STEP=_n,e.RESIZE_STEP_LARGE=vn,e.ROW_DRAG_TYPE=Uu,e.ROW_DROP_EVENT=Vu,e.ROW_HEIGHTS=xn,e.ROW_MOVE_LIMIT=Pn,e.ROW_MOVE_MS=Fn,e.ROW_SAVE_ATTR=Un,e.ROW_SAVE_ERROR_CLASS=Wn,e.ROW_SAVE_STATES=Hn,e.SCROLL_EDGE_SELECTOR=gd,e.SEARCH_OPEN_KEY=ll,e.SELECT_ALL_LABEL=fc,e.SELECT_CELL_CLASS=Y,e.SELECT_KEY=Fe,e.SELECT_ROW_LABEL=pc,e.SERVER_ACTION_TEXT=zp,e.SHORTCUTS_OFF_ATTRIBUTE=Ae,e.SHORTCUT_EVENT=Me,e.SHORTCUT_SCOPE_ATTRIBUTE=je,e.SHORTCUT_TEXT=Ne,e.SUBMIT_ONCE_ATTRIBUTE=sg,e.THEME_BOOT_SCRIPT_BODY=Pg,e.THEME_CHANGE_EVENT=Eg,e.THEME_EFFECTS=xg,e.THEME_EFFECT_DURATION=wg,e.THEME_MODES=bg,e.THEME_SWITCHING_CLASS=Tg,e.TOAST_ACTION_METHODS=$i,e.TOAST_ACTION_MS=Gd,e.UNSAVED_TEXT=xm,e.VIRTUAL_OVERSCAN=bn,e.WHATS_NEW_READ_EVENT=ks,e.WUI_HEADERS=G,e.WuiDataTable=ar,e.WuiDatePicker=Si,e.WuiDock=Ci,e.WuiHoverCard=Ni,e.WuiNavigationMenu=Hi,e.WuiNotificationCenter=Fa,e.WuiOnboardingChecklist=Ua,e.WuiOtp=Ka,e.WuiOverflow=ao,e.WuiRating=mo,e.WuiRecordPager=ho,e.WuiRelativeTime=Oo,e.WuiRollingNumber=jo,e.WuiSelect=es,e.WuiShortcuts=Cs,e.WuiShowMore=Ds,e.WuiTruncate=Os,e.WuiWhatsNew=Is,e.acceptDroppedFiles=Ul,e.acceptLabel=Bl,e.addRowSelectCells=xc,e.addSelectColumn=Sc,e.applyBarBulk=Nu,e.applyTheme=Ng,e.ariaKeyShortcuts=We,e.attachFileDrop=Wl,e.attachInputMask=_u,e.attachRowDrag=pd,e.attachScrollEdges=vd,e.attachShiftRange=Tc,e.avatarCropOptions=cl,e.avatarUnreadableMessage=sl,e.barBulkCountText=ku,e.buildPasswordRules=Ru,e.clampColumnWidth=Cn,e.classifyStatus=pa,e.closeRemotePane=Np,e.collapseSearch=vl,e.configureCsrf=sa,e.confirmAction=$p,e.copyTextToClipboard=Gs,e.createDiscardPrompt=yh,e.createRequestQueue=_a,e.createSelectHeaderCell=hc,e.createSelectRowCell=gc,e.createSelectSpacerCell=_c,e.currencyPrefix=pt,e.deriveStepStatus=lc,e.evaluatePassword=zu,e.formValues=Rm,e.formatCompact=en,e.formatCurrency=Qt,e.formatDate=I,e.formatDateTime=un,e.formatDuration=rn,e.formatFileSize=Ll,e.formatMasked=uu,e.formatNumber=Zt,e.formatPercent=tn,e.formatRelativeTime=bo,e.formatValue=cn,e.getServerTable=Ud,e.getShell=og,e.glyphSvg=U,e.groupCount=Sn,e.groupItems=wn,e.groupNotificationsByDay=Qi,e.identityCell=Gn,e.inShortcutScope=Je,e.initCollapsibleSearch=xl,e.initCommandShortcuts=Ol,e.initDrawerDiscard=Vh,e.initInputMasks=Tu,e.initPageBarBulk=Pu,e.initRemoteModals=Dp,e.initRowDrag=hd,e.initScrollEdges=wd,e.initServerActions=bm,e.initServerTables=Hd,e.initShellParts=ag,e.initSubmitOnce=yg,e.initUnsavedChanges=nh,e.isCommandChord=Tl,e.isCurrencyCode=ft,e.isHeicFile=ol,e.isImageFile=Fl,e.isImageOnlyAccept=zl,e.isMaskPattern=iu,e.isPdfFile=Rl,e.isTimeZone=vt,e.isTypingTarget=Ge,e.loadRemoteDrawer=Ap,e.loadRemoteModal=Op,e.loadRemotePane=Mp,e.maskedPostValue=pu,e.matchSegments=Dc,e.matchesAccept=Vl,e.measureRows=zn,e.mentionLabel=Xs,e.mentionTextFromValue=$s,e.mentionValueFromText=ec,e.mentionedIds=tc,e.moveFocus=Xe,e.nextTheme=Ig,e.notificationCountText=qi,e.notificationDayHeading=Zi,e.notificationTime=Xi,e.notificationTriggerLabel=Ji,e.notificationUnreadAnnouncement=Yi,e.openSearch=_l,e.parseMentionValue=Qs,e.parseToastAction=na,e.passwordSatisfies=Bu,e.pinAtValue=jn,e.pinClasses=Nn,e.pinOffsetVar=kn,e.planPins=Mn,e.playRowMoves=Bn,e.postedMasked=lu,e.rawMasked=cu,e.readColumnWidths=Dn,e.readCsrf=da,e.readStoredTheme=jg,e.relativeTimeTitle=xo,e.resetUnsavedChanges=rh,e.resolveMask=ou,e.resolveTheme=Ag,e.rowLabel=Kn,e.rowOrderChanged=Vn,e.runShortcut=Ye,e.runToastAction=Qd,e.saveOutcomeText=Yn,e.setRowSaveState=qn,e.settledRows=Jn,e.shortcutKey=Ue,e.shortcutName=He,e.shortcutsOff=qe,e.showResultToast=Zd,e.stepperHeaderItems=uc,e.storeTheme=Mg,e.syncSelectAll=Cc,e.syncTargets=md,e.themeBootScript=Fg,e.themeKeyframes=Kg,e.tickedKeys=ed,e.timeZoneLabel=pn,e.toInstant=an,e.todayIn=wt,e.transitionTheme=Jg,e.validateFile=Hl,e.virtualRange=Tn,e.wallClockOf=Ct,e.watchSystemTheme=Lg,e.whenElementsReady=Jr,e.withTrustedLabel=mi,e.writeColumnWidths=On,e.wuiFetch=ga,e.zoneOffsetMs=bt,e.zoneParts=yt,e})({});