@webority/ui-elements 0.83.4 → 0.84.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 (34) hide show
  1. package/dist/WuiDataTable-YzxEQGIO.js +1 -0
  2. package/dist/WuiMarkdown-DZ5CMeCz.js +4 -0
  3. package/dist/elements/data-table.js +1 -1
  4. package/dist/elements/markdown.js +1 -0
  5. package/dist/ui-elements/autocomplete.global.js +1 -1
  6. package/dist/ui-elements/carousel.global.js +1 -1
  7. package/dist/ui-elements/code-block.global.js +1 -1
  8. package/dist/ui-elements/command-palette.global.js +1 -1
  9. package/dist/ui-elements/comment-thread.global.js +1 -1
  10. package/dist/ui-elements/consent-banner.global.js +1 -1
  11. package/dist/ui-elements/context-menu.global.js +1 -1
  12. package/dist/ui-elements/date-range.global.js +1 -1
  13. package/dist/ui-elements/drawer.global.js +1 -1
  14. package/dist/ui-elements/image-crop.global.js +1 -1
  15. package/dist/ui-elements/inline-edit.global.js +1 -1
  16. package/dist/ui-elements/kanban.global.js +1 -1
  17. package/dist/ui-elements/lightbox.global.js +1 -1
  18. package/dist/ui-elements/markdown.global.js +4 -0
  19. package/dist/ui-elements/menubar.global.js +1 -1
  20. package/dist/ui-elements/multiselect.global.js +1 -1
  21. package/dist/ui-elements/phone.global.js +1 -1
  22. package/dist/ui-elements/resizable.global.js +1 -1
  23. package/dist/ui-elements/slider.global.js +1 -1
  24. package/dist/ui-elements/sortable.global.js +1 -1
  25. package/dist/ui-elements/status-icon.global.js +1 -1
  26. package/dist/ui-elements/taginput.global.js +1 -1
  27. package/dist/ui-elements/timepicker.global.js +1 -1
  28. package/dist/ui-elements/tour.global.js +1 -1
  29. package/dist/ui-elements/tree.global.js +1 -1
  30. package/dist/ui-elements/wizard.global.js +1 -1
  31. package/dist/ui-elements.global.js +2 -2
  32. package/dist/ui-elements.js +1 -1
  33. package/package.json +2 -1
  34. package/dist/WuiDataTable-CJZ3ufxj.js +0 -1
@@ -1 +1 @@
1
- import{n as e}from"./elementBase-DV9IZZCu.js";import{a as t,c as n,d as r,f as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./shortcutKeys-BQiDpsTJ.js";import{n as h,t as g}from"./filterPopover-QL0Pa875.js";import{t as _}from"./devWarn-DXdRWZs3.js";import{a as v,c as y,d as b,f as x,h as S,i as ee,l as te,m as ne,n as re,o as ie,p as ae,r as oe,s as se,t as ce,u as le}from"./formatters-BAE__8ye.js";import{A as ue,C as de,D as fe,E as pe,M as me,O as he,S as ge,T as _e,_ as ve,a as ye,b as be,c as xe,d as Se,f as Ce,g as we,h as Te,i as Ee,j as De,k as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as Ie,u as Le,v as Re,w as ze,x as Be,y as Ve}from"./dataTable-Cd_IJQcs.js";import{t as He}from"./iconGlyphs.g-Bk8AzmSO.js";import{C as Ue,S as We,T as Ge,_ as Ke,a as qe,b as Je,c as C,d as Ye,f as Xe,g as Ze,h as Qe,i as $e,l as et,m as tt,n as nt,o as w,p as rt,r as it,s as at,t as ot,u as st,v as ct,w as lt,x as ut,y as dt}from"./wuiHttp-Cu7OPWr2.js";import{_ as ft,a as pt,b as mt,c as ht,d as gt,f as _t,g as vt,h as yt,i as bt,l as xt,m as St,n as Ct,o as wt,p as Tt,r as Et,s as Dt,t as Ot,u as kt,v as At,y as jt}from"./kanban-CxpZlQDL.js";import{n as Mt,t as Nt}from"./statusIcons-Dt2ZVJyk.js";import{o as Pt}from"./optionLabel-Bd3vP-XI.js";import{t as Ft}from"./WuiAutocomplete-DpPpa4FC.js";import{t as It}from"./WuiCarousel-BbO8AoM6.js";import{t as Lt}from"./WuiCodeBlock-DIPE7V93.js";import{n as Rt,t as zt}from"./copyText-DM5HhXjf.js";import{t as Bt}from"./textMatch-wdY7XLIc.js";import{t as Vt}from"./WuiCommandPalette-BROO_xyP.js";import{i as Ht,n as Ut,r as Wt,t as Gt}from"./WuiCommentThread-DqKktFs2.js";import{t as Kt}from"./WuiConsentBanner-BDeCCk6b.js";import{t as qt}from"./WuiContextMenu-BrHXfA-X.js";import{t as Jt}from"./WuiSelect-1nRsHfEt.js";import{t as Yt}from"./WuiCountrySelect-8zZAl6bH.js";import{t as Xt}from"./WuiDataTable-CJZ3ufxj.js";import{t as Zt}from"./WuiDatePicker-CEabNb5D.js";import{t as Qt}from"./WuiDateRange-CshFgseR.js";import{t as $t}from"./WuiDock-Bd2ijOaJ.js";import{t as en}from"./WuiDrawer-DnHsXG4q.js";import{t as tn}from"./WuiHoverCard-BjPDXlhV.js";import{t as nn}from"./WuiImageCrop-CvXh791S.js";import{a as rn,i as an,n as on,r as sn,t as cn}from"./WuiInlineEdit-BkzYdhpE.js";import{t as ln}from"./WuiLightbox-D6aI_3tH.js";import{a as un,c as dn,i as fn,l as pn,n as mn,o as hn,r as gn,s as _n,t as vn,u as yn}from"./WuiMentionInput-DWuua2rm.js";import{t as bn}from"./WuiMenubar-BC48Kv8o.js";import{t as xn}from"./WuiMultiSelect-C1XQnhfW.js";import{t as Sn}from"./WuiNavigationMenu-CGqTADvr.js";import{a as Cn,c as wn,i as Tn,n as En,o as Dn,r as On,s as kn,t as An}from"./notificationDays-BUoh4mG6.js";import{t as jn}from"./WuiNotificationCenter-D8z-xECD.js";import{t as Mn}from"./WuiOnboardingChecklist-DXUETu1h.js";import{t as Nn}from"./WuiOtp-DfhXc829.js";import{t as Pn}from"./WuiOverflow-blOepYs6.js";import{t as Fn}from"./WuiPhone-BwFv7s0F.js";import{t as In}from"./WuiRating-DhhqYj5Z.js";import{t as Ln}from"./WuiRecordPager-BFqaMK8g.js";import{n as Rn,r as zn,t as Bn}from"./WuiRelativeTime-D6hPHWXX.js";import{t as Vn}from"./WuiResizable-CtwCQUWR.js";import{t as Hn}from"./WuiRollingNumber-fiD54wsj.js";import{t as Un}from"./WuiShortcuts-Xa7eq9-J.js";import{t as Wn}from"./WuiShowMore-D3VHRZJg.js";import{t as Gn}from"./WuiSlider-IOqadOtK.js";import{t as Kn}from"./WuiSortable-CugtxycN.js";import{t as qn}from"./WuiTagInput-hAQ14Wgk.js";import{t as Jn}from"./WuiTimePicker-DXljDDxI.js";import{n as Yn,t as Xn}from"./WuiTour-BZQVityh.js";import{t as Zn}from"./WuiTree-B7TFIZWp.js";import{t as Qn}from"./WuiTruncate-Cxujs1Xt.js";import{n as $n,t as er}from"./WuiWhatsNew-bOkXSofq.js";import{n as tr,t as nr}from"./WuiWizardStep-D46JBR4c.js";import{$ as rr,A as ir,B as ar,C as or,D as sr,E as cr,F as lr,G as ur,H as dr,I as fr,J as pr,K as mr,L as hr,M as gr,N as _r,O as vr,P as yr,Q as br,R as xr,S as Sr,T as Cr,U as wr,V as Tr,W as Er,X as Dr,Y as Or,Z as kr,_ as Ar,a as jr,at as Mr,b as Nr,c as Pr,d as Fr,et as Ir,f as Lr,g as Rr,h as zr,i as Br,it as Vr,j as Hr,k as Ur,l as Wr,m as Gr,n as Kr,nt as qr,o as Jr,ot as Yr,p as Xr,q as Zr,r as Qr,rt as $r,s as ei,t as ti,tt as ni,u as ri,v as ii,w as ai,x as oi,y as si,z as ci}from"./themeTransition-BSTpUIVI.js";var li=`/`,ui=`.search-wrap.wui-search-collapsible`,di=`.wui-topsearch-panel`,fi=`.modal, wui-drawer[open]`,pi=new WeakSet,T=e=>e.querySelector(`.wui-search-toggle`),E=e=>e.querySelector(`.search-input`);function D(e){e.classList.remove(`is-collapsed`),T(e)?.setAttribute(`aria-expanded`,`true`),E(e)?.focus()}function O(e){E(e)?.value||(e.classList.add(`is-collapsed`),T(e)?.setAttribute(`aria-expanded`,`false`))}function mi(e){if(e.dataset.wuiCollapseWired)return;e.dataset.wuiCollapseWired=`1`;let t=T(e),n=E(e);t?.addEventListener(`click`,()=>D(e)),n?.addEventListener(`keydown`,r=>{r.key!==`Escape`||n.value||(r.preventDefault(),O(e),t?.focus())}),e.addEventListener(`focusout`,t=>{e.contains(t.relatedTarget)||O(e)})}function hi(e){pi.has(e)||(pi.add(e),e.addEventListener(`keydown`,t=>{if(t.key!==`/`||t.ctrlKey||t.altKey||t.metaKey||t.defaultPrevented||o(t.target)||t.target?.closest?.(fi)||e.querySelector(di))return;let n=[...e.querySelectorAll(ui)].find(e=>e.offsetParent!==null);n&&(t.preventDefault(),D(n))}))}function gi(e=document){for(let t of e.querySelectorAll(ui))mi(t);hi(e.ownerDocument??e)}var k=`wuiConfirm`,A=Object.freeze([`danger`]),j=Object.freeze([`success`,`info`,`warning`,`danger`]),M=`wui.flash`,N=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.`}),_i=new WeakSet,vi=new WeakSet,P=null,F=null,I=!1,yi=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML},L=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})},bi=()=>{let e=window.bootstrap?.Modal;if(!e)throw Error(`data-wui-confirm: Bootstrap's bundle (window.bootstrap) is not loaded on this page.`);return e};function xi(){let e=document.getElementById(k);return e||(e=document.createElement(`div`),e.id=k,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`,`${ft.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="btn btn-secondary" data-bs-dismiss="modal">${yi(N.cancelLabel)}</button><button type="button" class="btn btn-primary" data-app-confirm></button></div></div></div></div>`,document.body.appendChild(e),e)}function Si(e,t){let n=e.getAttribute(`data-wui-confirm-tone`);if(n!==null&&!A.includes(n))throw TypeError(`data-wui-confirm-tone="${n}" is not supported. Use danger, or leave it off.`);Ci({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 Ci({title:e,message:t,label:n,danger:r},i){let a=bi(),o=xi(),s=o.querySelector(`.wui-confirm-title`),c=o.querySelector(`[data-app-confirm]`);if(!s||!c)throw Error(`#${k} is not a confirm dialog with a confirm button. Render <app-confirm-dialog id="${k}"> 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)),s.textContent=e||N.confirmTitle,l.textContent=t,c.textContent=n||N.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`,s.textContent),F=i,I=!1,a.getOrCreateInstance(o).show()}var R=(e,t)=>{P=e;try{t()}finally{P=null}};function wi(e,{title:t,message:n,label:r,tone:i},a){if(i!=null&&!A.includes(i))throw TypeError(`confirmAction: tone "${i}" is not supported. Use danger, or leave it off.`);zi(e.ownerDocument),Ci({title:t,message:n,label:r,danger:i===`danger`},()=>R(e,a))}var Ti=e=>e.disabled===!0||e.getAttribute(`aria-disabled`)===`true`;function Ei(e){let t=e.target.closest?.(`[data-wui-confirm]:not(form)`);!t||t===P||Ti(t)||(e.preventDefault(),e.stopImmediatePropagation(),Si(t,()=>R(t,()=>t.click())))}function Di(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!t.hasAttribute(`data-wui-confirm`)||t===P||e.submitter&&e.submitter===P||t.querySelector(`input[data-app-repeater-hidden]`))return;e.preventDefault(),e.stopImmediatePropagation();let n=e.submitter?.form===t?e.submitter:void 0;Si(t,()=>R(t,()=>t.requestSubmit(n)))}function Oi(e){let t=e.target.closest?.(`#${k} [data-app-confirm]`);!t||t.disabled||!F||(I=!0,bi().getOrCreateInstance(t.closest(`#${k}`)).hide())}function ki(e){if(e.target.id!==`wuiConfirm`)return;let t=I?F:null;F=null,I=!1,t?.()}var Ai=(e,t)=>{e&&window.sessionStorage.setItem(M,JSON.stringify({message:e,variant:t}))},ji=e=>e===`forbidden`?N.forbidden:e===`network`?N.network:N.failed;function Mi(){for(let e of document.querySelectorAll(`[data-wui-server]`))e.dataset.refreshOnSuccess!==`false`&&tt(e)?.reload()}async function Ni(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 Pi(t,e)}async function Pi(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.`);t.disabled=!0,t.setAttribute(`aria-busy`,`true`);let i=await C(e,{method:`POST`,body:n});if(i.kind===`session`||i.kind===`aborted`)return;let a=i.toastVariant||`success`;if(i.ok&&(i.redirect||r===`page`)){Ai(i.message,a),i.redirect?window.location.assign(i.redirect):window.location.reload();return}if(t.disabled=!1,t.removeAttribute(`aria-busy`),i.ok){rt(i,a),Mi();return}L(i.message||ji(i.kind),`danger`)}function Fi(e){let t=e.target.closest?.(`[data-wui-post]`);t&&(e.preventDefault(),!(Ti(t)||t.getAttribute(`aria-busy`)===`true`)&&Ni(t).catch(e=>_(e)))}function Ii(e){let t=e.target.closest?.(`form[data-wui-post-form]`);if(!t||e.defaultPrevented)return;e.preventDefault();let n=e.submitter||t.querySelector(`button`);n.getAttribute(`aria-busy`)!==`true`&&(Pi(t.getAttribute(`action`),n,new FormData(t)).catch(e=>_(e)),window.bootstrap?.Dropdown?.getInstance(t.closest(`.dropdown`)?.querySelector(`[data-bs-toggle='dropdown']`))?.hide())}function Li(){let e=window.sessionStorage.getItem(M);if(!e)return;window.sessionStorage.removeItem(M);let{message:t,variant:n}=JSON.parse(e);L(t,n)}function Ri(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(!j.includes(t))throw TypeError(`data-wui-flash-variant="${t}" is not supported. Use ${j.join(`, `)}.`);let n=e.getAttribute(`data-wui-flash`)||e.textContent.trim();e.remove(),L(n,t)}}function zi(e){vi.has(e)||(vi.add(e),e.addEventListener(`click`,Oi),e.addEventListener(`hidden.bs.modal`,ki))}function Bi(e=document){let t=e.ownerDocument||e;_i.has(t)||(_i.add(t),t.addEventListener(`click`,Ei,!0),t.addEventListener(`submit`,Di,!0),zi(t),t.addEventListener(`click`,Fi),t.addEventListener(`submit`,Ii),Li()),Ri(e)}var z=Object.freeze({title:`Leave without saving?`,message:`Your changes on this page are not saved. If you leave now, they are lost.`,leaveLabel:`Leave`}),B=`form[data-wui-unsaved]`,Vi=`[aria-invalid="true"], .field-error:not(:empty), .field-validation-error, .validation-summary-errors, .wui-error-summary`,Hi=`[download], [data-wui-modal], [data-wui-post], [data-bs-toggle]`,Ui=new Set([`submit`,`button`,`reset`,`image`]),Wi=new Set([`hidden`,`checkbox`,`radio`,`file`,`submit`,`button`,`reset`,`image`,`range`,`color`]),V=new WeakMap,Gi=new WeakSet,Ki=e=>`${e.name}:${e.size}:${e.lastModified}`;function H(e){let t=[];for(let n of e.elements)!n.name||n.disabled||Ui.has(n.type)||(n.type===`checkbox`||n.type===`radio`?t.push([n.name,n.value,n.checked]):n.type===`file`?t.push([n.name,[...n.files||[]].map(Ki)]):n.type===`select-multiple`?t.push([n.name,[...n.selectedOptions].map(e=>e.value)]):t.push([n.name,n.value]));return JSON.stringify(t)}function U(e){return H(e)}function qi(e){for(let t of e.elements)if(!(!t.name||t.disabled)){if(t.tagName===`TEXTAREA`||t.tagName===`INPUT`&&!Wi.has(t.type)){if(t.value.trim()!==``)return!0}else if(t.tagName===`INPUT`&&t.type===`file`&&t.files?.length>0)return!0}return!1}var Ji=e=>({saved:e.querySelector(Vi)&&qi(e)?null:H(e),engaged:!1,discarded:!1});function Yi(e){let t=V.get(e);return!t||t.discarded||!e.isConnected?!1:t.saved===null||t.engaged&&H(e)!==t.saved}var W=(e,t)=>[...e.querySelectorAll(B)].filter(e=>e!==t&&Yi(e)),Xi=()=>!!window.bootstrap?.Modal;function Zi(e,t,n){let r=t.map(e=>e.getAttribute(`data-wui-unsaved`)).find(Boolean)||z.message;wi(e,{title:z.title,message:r,label:z.leaveLabel,tone:`danger`},()=>{for(let e of t)V.get(e).discarded=!0;n()})}function Qi(e){if(e.matches(Hi))return!1;let t=e.getAttribute(`target`);if(t&&t.toLowerCase()!==`_self`)return!1;let n=new URL(e.getAttribute(`href`),window.location.href);if(n.protocol!==`http:`&&n.protocol!==`https:`)return!1;let r=window.location;return!(n.hash&&n.origin===r.origin&&n.pathname===r.pathname&&n.search===r.search)}function $i(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 ea(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target.closest?.(`a[href]`);if(!t||!Qi(t))return;let n=W(t.ownerDocument,null);!n.length||!Xi()||(e.preventDefault(),Zi(t,n,()=>t.click()))}function ta(e){let t=e.target;if(!(t instanceof HTMLFormElement)||e.defaultPrevented||!$i(t,e.submitter))return;let n=W(t.ownerDocument,t);if(n.length&&Xi()){e.preventDefault();let r=e.submitter?.form===t?e.submitter:void 0;Zi(t,n,()=>t.requestSubmit(r));return}let r=V.get(t);r&&(r.saved=H(t),r.discarded=!1)}function na(e){W(document,null).length&&(e.preventDefault(),e.returnValue=``)}function ra(e){let t=e.target.closest?.(B),n=t&&V.get(t);!n||n.engaged||(n.saved!==null&&(n.saved=H(t)),n.engaged=!0)}function ia(e){let t=e.target.closest?.(B),n=t&&V.get(t);n&&(n.discarded=!1,e.isTrusted&&(n.engaged=!0))}function aa(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(B))sa(e)}function oa(e=document){let t=e.ownerDocument||e;if(!Gi.has(t)){Gi.add(t);for(let e of[`focusin`,`pointerdown`,`drop`])t.addEventListener(e,ra,!0);for(let e of[`input`,`change`])t.addEventListener(e,ia,!0);t.addEventListener(`click`,ea),t.addEventListener(`submit`,ta),t.addEventListener(`wui:modal:success`,aa),t.defaultView.addEventListener(`beforeunload`,na)}let n=[...e.querySelectorAll?.(B)||[]];e.matches?.(B)&&n.unshift(e);for(let e of n)V.has(e)||V.set(e,Ji(e))}function sa(e){if(!(e instanceof HTMLFormElement)||!e.matches(B))throw TypeError(`resetUnsavedChanges: ${String(e)} is not a <form data-wui-unsaved>.`);V.set(e,{saved:H(e),engaged:!1,discarded:!1})}var G=Object.freeze({discard:`Discard`,keep:`Keep editing`}),ca=`wui:drawer:discard`,K=`wui-drawer[confirm-discard]`,q=`.wui-modal-shell`,J=`form[data-wui-confirm-discard]`,Y=`.wui-drawer-discard`,la=`input, select, textarea`,X=new WeakMap,ua=new WeakSet,da=new WeakSet;function fa(e,t,n,r){let i=e.createElement(`button`);return i.type=`button`,i.className=t,i.setAttribute(n,``),i.textContent=r,i}function pa(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,fa(e,`btn btn-danger btn-sm`,`data-wui-discard-confirm`,G.discard),fa(e,`btn btn-secondary btn-sm`,`data-wui-discard-keep`,G.keep)),n}function ma(e){let t=e.closest?.(K);if(t)return t;let n=e.closest?.(q);return n&&(n.hasAttribute(`confirm-discard`)||n.querySelector(J))?n:null}function ha(e){return e.closest(K)??e.closest(q)}function Z(e){return e.matches(K)||e.hasAttribute(`confirm-discard`)?e.querySelectorAll(`form`):e.querySelectorAll(J)}function ga(e){let t=X.get(e);return t!=null&&U(e)!==t}function _a(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-drawer-footer`,e.querySelector(`.wui-drawer-panel`).append(t),da.add(t),t}function va(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),da.add(t),t}function ya(e){e.querySelector(`[data-wui-discard-confirm]`).focus()}function ba(e,t){let n=e.querySelector(Y);if(n){ya(n);return}let r=pa(e.ownerDocument,t),i;if(e.matches(K))i=e.querySelector(`.wui-drawer-footer`)??_a(e),i.prepend(r);else if(e.hasAttribute(`confirm-discard`))i=e.querySelector(`.wui-modal-footer`)??va(e),i.prepend(r);else{let t=e.querySelector(J);i=t.querySelector(`.modal-footer`),i?i.prepend(r):(i=t,t.append(r))}i.classList.add(`wui-drawer-discarding`),ya(r)}function xa(e){let t=e.parentElement;e.remove(),t.classList.remove(`wui-drawer-discarding`),da.has(t)&&t.remove()}function Sa(e){for(let t of Z(e)){let e=[...t.querySelectorAll(la)].find(e=>e.type!==`hidden`&&!e.disabled);if(e){e.focus();return}}}function Ca(e){let t=ma(e.target);if(t)for(let e of Z(t))X.get(e)??X.set(e,U(e))}function wa(e){let t=e.target;!(t instanceof HTMLFormElement)||!ma(t)||X.set(t,U(t))}function Ta(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(`form`))X.delete(e)}function Ea(e){let t=e.target;!(t instanceof Element)||!t.matches(K)||[...Z(t)].some(ga)&&(e.preventDefault(),ba(t,t.getAttribute(`confirm-discard`)))}function Da(e){let t=e.target;if(!(t instanceof Element)||!t.matches(q))return;let n=[...Z(t)].find(ga);n&&(e.preventDefault(),ba(t,t.getAttribute(`confirm-discard`)??n.getAttribute(`data-wui-confirm-discard`)))}function Oa(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(q);n&&window.bootstrap?.Modal?.getInstance(n)?.hide()}function ka(e){let t=e.closest(Y),n=ha(t);xa(t);for(let e of Z(n))X.set(e,U(e));n.dispatchEvent(new CustomEvent(ca,{bubbles:!0})),n.matches(K)?n.hide():window.bootstrap.Modal.getInstance(n).hide()}function Aa(e){let t=e.closest(Y),n=ha(t);xa(t),Sa(n)}function ja(e){let t=e.target,n=t.closest?.(`[data-wui-discard-confirm]`);if(n){ka(n);return}let r=t.closest?.(`[data-wui-discard-keep]`);if(r){Aa(r);return}let i=t.closest?.(`[data-wui-dismiss]`);i&&Oa(i)}function Ma(e){if(e.key!==`Escape`)return;let t=e.currentTarget.querySelector(Y);if(!t)return;e.preventDefault(),e.stopPropagation();let n=ha(t);xa(t),Sa(n)}function Na(e=document){let t=e.ownerDocument||e;ua.has(t)||(ua.add(t),t.addEventListener(`focusin`,Ca),t.addEventListener(`pointerdown`,Ca),t.addEventListener(`submit`,wa),t.addEventListener(`wui:modal:success`,Ta),t.addEventListener(`wui:modal:loaded`,Ta),t.addEventListener(`wui-drawer-close`,Ea,!0),t.addEventListener(`hide.bs.modal`,Da),t.addEventListener(`click`,ja),t.addEventListener(`keydown`,Ma,!0))}var Pa=`data-wui-bulk-in-bar`,Fa=`[data-wui-page-header-bar][data-wui-bulk-for]`,Ia=new WeakSet;function La(e){return`${x(e,{decimals:0})} selected`}function Ra(e,t){for(let n of e.querySelectorAll(`[data-wui-bar-swap]`))n.hidden=t>0;let n=e.querySelector(`[data-wui-bar-bulk]`);n&&(n.hidden=t===0,n.querySelector(`.page-header-bar-bulk-count`).textContent=t>0?La(t):``)}function za(e=document){for(let t of e.querySelectorAll(Fa))document.getElementById(t.dataset.wuiBulkFor)?.setAttribute(Pa,``);Ia.has(document)||(Ia.add(document),document.addEventListener(`selectionchange`,e=>{if(typeof e.detail?.selected==`number`)for(let t of document.querySelectorAll(Fa))document.getElementById(t.dataset.wuiBulkFor)?.contains(e.target)&&Ra(t,e.detail.selected)}))}var Ba=31536e3,Q=new WeakMap,Va=e=>e>99?`99+`:String(e);function Ha(e,t,n=document){n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${Ba}; SameSite=Lax`}var Ua=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content},$=(e,t)=>{let n=document.createElement(`div`);return n.className=e,n.textContent=t,n};function Wa(e,t){let n=e.querySelector(`.wui-bell-trigger`),r=e.querySelector(`.wui-bell-count`),i=e.querySelector(`[data-wui-bell-live]`),a=e.querySelector(`[data-wui-bell-list]`),o=e.querySelector(`.wui-bell-menu`),{src:s,readAction:c}=e.dataset,l=e.dataset.label||`Notifications`,u=e.dataset.emptyText||`You are all caught up.`,d=Number(e.dataset.pollSeconds??60),f=w(),p=Number(e.dataset.unread)||0,m=(t,a=!0)=>{let o=Math.max(0,Number(t)||0),s=o!==p;p=o,e.dataset.unread=String(o),r&&(r.textContent=Va(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?l:`${l}, ${Va(o)} unread`),a&&s&&i&&(i.textContent=o===0?`No unread notifications`:`${Va(o)} unread notifications`)},h=()=>o?.classList.contains(`show`)??!1,g=()=>{let e=$(`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),a.replaceChildren(e)},_=async t=>{t&&(a.setAttribute(`aria-busy`,`true`),a.querySelector(`.wui-bell-item`)||a.replaceChildren($(`wui-bell-state`,`Loading…`)));let n=await f.run(s);if(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)return;if(a.removeAttribute(`aria-busy`),!n.ok){t&&g();return}let r=Ua(n.html),i=r.querySelector(`[data-wui-unread]`),o=i?Number(i.getAttribute(`data-wui-unread`)):p;m(o),(t||h())&&(r.querySelector(`.wui-bell-item`)?a.replaceChildren(r):a.replaceChildren($(`wui-bell-state`,u))),e.dispatchEvent(new CustomEvent(`wui:notifications:loaded`,{bubbles:!0,detail:{unread:o}}))};e.addEventListener(`show.bs.dropdown`,()=>_(!0)),e.addEventListener(`click`,async e=>{if(e.target.closest(`[data-wui-bell-retry]`)){_(!0);return}let t=e.target.closest(`[data-wui-bell-read]`);if(!t||!c)return;t.disabled=!0;let n=await C(c,{method:`POST`});t.disabled=!1,n.ok&&(m(0),_(!0))});let v=null,y=()=>{d>0&&v===null&&(v=setInterval(()=>_(h()),d*1e3))},b=()=>{v!==null&&clearInterval(v),v=null},x=()=>{document.hidden?b():(_(h()),y())};return d>0&&(document.addEventListener(`visibilitychange`,x),document.hidden||y()),t.push(()=>{b(),f.abort(),document.removeEventListener(`visibilitychange`,x)}),{setUnread:e=>m(e),refresh:()=>_(h())}}var Ga=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Ka=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function qa(e,t){let n=e.querySelector(`input.search-input`),r=e.querySelector(`.wui-topsearch-results`),i=e.querySelector(`.wui-topsearch-open`),a=e.querySelector(`[data-wui-topsearch-live]`),{src:o,param:s=`q`,resultsHref:c}=e.dataset,l=Number(e.dataset.minChars??2),u=Number(e.dataset.debounceMs??250),d=w(),f=null,p=-1,m=()=>[...r.querySelectorAll(`.wui-topsearch-hit`)],h=e=>{let t=m();p=t.length===0?-1:(e+t.length)%t.length,t.forEach((e,t)=>{let n=t===p;e.classList.toggle(`is-active`,n),e.setAttribute(`aria-selected`,n?`true`:`false`)}),p>=0?(n.setAttribute(`aria-activedescendant`,t[p].id),t[p].scrollIntoView?.({block:`nearest`})):n.removeAttribute(`aria-activedescendant`)},g=()=>{r.hidden=!0,n.setAttribute(`aria-expanded`,`false`),n.removeAttribute(`aria-activedescendant`),p=-1},_=()=>{r.hidden=!1,n.setAttribute(`aria-expanded`,`true`)},v=t=>{e.classList.toggle(`is-open`,t),i?.setAttribute(`aria-expanded`,t?`true`:`false`)},y=t=>{let n=new CustomEvent(`wui:search:select`,{bubbles:!0,cancelable:!0,detail:{href:t}});e.dispatchEvent(n)&&window.location.assign(t)},b=async t=>{e.classList.add(`is-loading`);let n=await d.run(Ka(o,s,t));if(!(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)){if(e.classList.remove(`is-loading`),n.ok){let e=Ua(n.html),t=e.querySelector(`[data-wui-count]`);r.replaceChildren(e),m().forEach((e,t)=>{e.id=`${r.id}-opt-${t}`});let i=t?Number(t.getAttribute(`data-wui-count`)):m().length;a&&(a.textContent=i===0?`No results`:`${i} ${i===1?`result`:`results`}`)}else r.replaceChildren($(`wui-topsearch-empty`,`Search is unavailable right now.`));p=-1,_()}};n.addEventListener(`input`,()=>{clearTimeout(f);let t=n.value.trim();if(t.length<l){d.abort(),e.classList.remove(`is-loading`),r.replaceChildren(),g();return}f=setTimeout(()=>b(t),u)}),n.addEventListener(`keydown`,t=>{if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(r.hidden||m().length===0)return;t.preventDefault(),h(p+(t.key===`ArrowDown`?1:-1))}else if(t.key===`Enter`){let e=m();!r.hidden&&p>=0&&e[p]?(t.preventDefault(),y(e[p].getAttribute(`href`))):c&&n.value.trim()!==``&&(t.preventDefault(),y(Ka(c,s,n.value.trim())))}else t.key===`Escape`&&(r.hidden?e.classList.contains(`is-open`)&&(t.preventDefault(),t.stopPropagation(),v(!1),i?.focus()):(t.preventDefault(),t.stopPropagation(),g()))}),r.addEventListener(`click`,e=>{let t=e.target.closest(`.wui-topsearch-hit`);!t||e.ctrlKey||e.metaKey||e.shiftKey||e.button===1||(e.preventDefault(),y(t.getAttribute(`href`)))}),i?.addEventListener(`click`,()=>{let t=!e.classList.contains(`is-open`);v(t),t&&n.focus()});let x=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||Ga(e.target)||(e.preventDefault(),v(!0),n.focus())},S=t=>{e.contains(t.target)||(g(),e.classList.contains(`is-open`)&&v(!1))};document.addEventListener(`keydown`,x),document.addEventListener(`pointerdown`,S),t.push(()=>{clearTimeout(f),d.abort(),document.removeEventListener(`keydown`,x),document.removeEventListener(`pointerdown`,S)})}function Ja(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>Ha(n,!!e.detail?.collapsed)),e.addEventListener(`click`,t=>{t.target.closest(`[data-wui-tabbar-more]`)&&e.querySelector(`[data-app-shell-menu]`)?.click()});let r=e.querySelector(`[data-wui-bell]`),i=r?Wa(r,t):null,a=e.querySelector(`[data-wui-topsearch]`);a&&qa(a,t);let o={el:e,setUnread(e){if(!i)throw Error(`WUI.shell: this <app-shell> has no <app-shell-notifications>.`);i.setUnread(e)},refreshNotifications(){if(!i)throw Error(`WUI.shell: this <app-shell> has no <app-shell-notifications>.`);return i.refresh()},get collapsed(){return e.classList.contains(`collapsed`)},set collapsed(t){if(!!t===e.classList.contains(`collapsed`))return;let n=e.querySelector(`[data-app-shell-collapse]`);n?n.click():e.classList.toggle(`collapsed`,!!t)}};Q.set(e,o);let s=n=>{if(n.target===e||n.target.contains?.(e)){for(let e of t)e();Q.delete(e),delete e.dataset.wuiPartsWired,document.removeEventListener(`wui:teardown`,s)}};return document.addEventListener(`wui:teardown`,s),o}function Ya(e=document){let t=[];e instanceof Element&&e.matches(`[data-app-shell]`)&&t.push(e),t.push(...e.querySelectorAll(`[data-app-shell]`));for(let e of t)e.dataset.wuiPartsWired||(e.dataset.wuiPartsWired=`1`,Ja(e))}function Xa(e){let t=e?.closest?.(`[data-app-shell]`)??null;return t?(Q.has(t)||Ya(t),Q.get(t)??null):null}function Za(){h(),e(`wui-select`,Jt),e(`wui-country-select`,Yt),e(`wui-phone`,Fn),e(`wui-datepicker`,Zt),e(`wui-date-range`,Qt),e(`wui-dock`,$t),e(`wui-image-crop`,nn),e(`wui-kanban`,ht),e(`wui-inline-edit`,an),e(`wui-consent-banner`,Kt),e(`wui-slider`,Gn),e(`wui-sortable`,Kn),e(`wui-timepicker`,Jn),e(`wui-tour`,Xn),e(`wui-tree`,Zn),e(`wui-autocomplete`,Ft),e(`wui-command-palette`,Vt),e(`wui-context-menu`,qt),e(`wui-multiselect`,xn),e(`wui-taginput`,qn),e(`wui-otp`,Nn),e(`wui-status-icon`,Mt),e(`wui-shortcuts`,Un),e(`wui-record-pager`,Ln),e(`wui-carousel`,It),e(`wui-code-block`,Lt),e(`wui-data-table`,Xt),e(`wui-drawer`,en),e(`wui-hover-card`,tn),e(`wui-lightbox`,ln),e(`wui-menubar`,bn),e(`wui-navigation-menu`,Sn),e(`wui-notification-center`,jn),e(`wui-onboarding-checklist`,Mn),e(`wui-overflow`,Pn),e(`wui-rating`,In),e(`wui-relative-time`,Bn),e(`wui-resizable`,Vn),e(`wui-rolling-number`,Hn),e(`wui-show-more`,Wn),e(`wui-truncate`,Qn),e(`wui-whats-new`,$n),e(`wui-mention-input`,fn),e(`wui-comment-thread`,Ht),e(`wui-wizard-step`,nr),e(`wui-wizard`,tr)}Za();export{br as AVATAR_ACCEPT,rr as AVATAR_MAX_SIZE_MB,Ir as AVATAR_OUTPUT_SIZE,ni as AVATAR_OUTPUT_TYPE,qr as AVATAR_PREVIEW_SIZES,$r as AVATAR_TEXT,Pa as BAR_BULK_IN_BAR_ATTRIBUTE,Ie as COLUMN_MAX_WIDTH,je as COLUMN_MIN_WIDTH,Gt as COMMENT_INTENTS,Ut as COMMENT_REACTIONS,Wt as COMMENT_TEXT,k as CONFIRM_DIALOG_ID,A as CONFIRM_TONES,zt as COPY_FEEDBACK_MS,ot as CSRF_META_NAME,ce as CURRENCIES,Pe as DATA_TABLE_TEXT,re as DATE_PATTERNS,nt as DEFAULT_CSRF_HEADER,wr as DEFAULT_IMAGE_ACCEPT,Er as DEFAULT_MAX_SIZE_MB,vr as DEFAULT_PASSWORD_RULES,Ur as DEFAULT_REQUIREMENTS_TITLE,ti as DEFAULT_THEME_EFFECT,Kr as DEFAULT_THEME_STORAGE_KEY,ca as DISCARD_EVENT,G as DISCARD_TEXT,oi as DROP_OVER_CLASS,oe as DURATION_UNITS,ee as EMPTY_VALUE,g as FILTER_POPOVER_MAX_CHIPS,M as FLASH_STORAGE_KEY,j as FLASH_VARIANTS,v as FORMAT_STYLES,it as HTTP_KINDS,cn as INLINE_EDIT_SAVED_MS,on as INLINE_EDIT_TEXT,sn as INLINE_EDIT_TYPES,ie as IST_TIME_ZONE,Ot as KANBAN_DRAG_THRESHOLD_PX,Ct as KANBAN_LONG_PRESS_MS,Et as KANBAN_PHONE_QUERY,bt as KANBAN_STORAGE_PREFIX,pt as KANBAN_SUMMARY_FORMATS,wt as KANBAN_TEXT,Dt as KANBAN_TONES,p as LIST_KEYS,_r as MASK_INPUT_TYPES,yr as MASK_NAMES,un as MENTION_ID_PATTERN,vn as MENTION_MAX_QUERY,mn as MENTION_MAX_RESULTS,gn as MENTION_TEXT,se as MONEY_UNITS,An as NOTIFICATION_COUNT_CAP,En as NOTIFICATION_TEXT,Ee as PIN_AT_VAR,ye as PIN_SIDES,Me as RESIZE_STEP,Fe as RESIZE_STEP_LARGE,Sr as ROW_DRAG_TYPE,or as ROW_DROP_EVENT,xe as ROW_HEIGHTS,ke as ROW_MOVE_LIMIT,Le as ROW_MOVE_MS,Se as ROW_SAVE_ATTR,Ce as ROW_SAVE_ERROR_CLASS,Ne as ROW_SAVE_STATES,ii as SCROLL_EDGE_SELECTOR,li as SEARCH_OPEN_KEY,Ze as SELECT_ALL_LABEL,Ke as SELECT_CELL_CLASS,c as SELECT_KEY,ct as SELECT_ROW_LABEL,N as SERVER_ACTION_TEXT,d as SHORTCUTS_OFF_ATTRIBUTE,a as SHORTCUT_EVENT,t as SHORTCUT_SCOPE_ATTRIBUTE,l as SHORTCUT_TEXT,Nt as STATUS_TONES,Qr as THEME_BOOT_SCRIPT_BODY,Br as THEME_CHANGE_EVENT,jr as THEME_EFFECTS,Jr as THEME_EFFECT_DURATION,ei as THEME_MODES,Pr as THEME_SWITCHING_CLASS,et as TOAST_ACTION_METHODS,st as TOAST_ACTION_MS,z as UNSAVED_TEXT,Ae as VIRTUAL_OVERSCAN,er as WHATS_NEW_READ_EVENT,$e as WUI_HEADERS,Ft as WuiAutocomplete,It as WuiCarousel,Lt as WuiCodeBlock,Vt as WuiCommandPalette,Ht as WuiCommentThread,Kt as WuiConsentBanner,qt as WuiContextMenu,Yt as WuiCountrySelect,Xt as WuiDataTable,Zt as WuiDatePicker,Qt as WuiDateRange,$t as WuiDock,en as WuiDrawer,tn as WuiHoverCard,nn as WuiImageCrop,an as WuiInlineEdit,ht as WuiKanban,ln as WuiLightbox,fn as WuiMentionInput,bn as WuiMenubar,xn as WuiMultiSelect,Sn as WuiNavigationMenu,jn as WuiNotificationCenter,Mn as WuiOnboardingChecklist,Nn as WuiOtp,Pn as WuiOverflow,Fn as WuiPhone,In as WuiRating,Ln as WuiRecordPager,Bn as WuiRelativeTime,Vn as WuiResizable,Hn as WuiRollingNumber,Jt as WuiSelect,Un as WuiShortcuts,Wn as WuiShowMore,Gn as WuiSlider,Kn as WuiSortable,Mt as WuiStatusIcon,qn as WuiTagInput,Jn as WuiTimePicker,Xn as WuiTour,Zn as WuiTree,Qn as WuiTruncate,$n as WuiWhatsNew,tr as WuiWizard,nr as WuiWizardStep,ur as acceptLabel,dt as addRowSelectCells,Je as addSelectColumn,Ra as applyBarBulk,Wr as applyTheme,f as ariaKeyShortcuts,lr as attachInputMask,ai as attachRowDrag,si as attachScrollEdges,ut as attachShiftRange,Vr as avatarCropOptions,Mr as avatarUnreadableMessage,La as barBulkCountText,ir as buildPasswordRules,Te as clampColumnWidth,qe as classifyStatus,O as collapseSearch,wi as confirmAction,Rt as copyTextToClipboard,pa as createDiscardPrompt,Yn as createLocalSeenStore,w as createRequestQueue,We as createSelectHeaderCell,Ue as createSelectRowCell,lt as createSelectSpacerCell,Za as defineWeborityElements,Hr as evaluatePassword,U as formValues,y as formatCompact,te as formatCurrency,le as formatDate,b as formatDuration,mr as formatFileSize,fr as formatMasked,x as formatNumber,ae as formatPercent,Rn as formatRelativeTime,ne as formatValue,tt as getServerTable,Xa as getShell,He as glyphSvg,we as groupCount,ve as groupItems,On as groupNotificationsByDay,Re as identityCell,n as inShortcutScope,gi as initCollapsibleSearch,Na as initDrawerDiscard,hr as initInputMasks,za as initPageBarBulk,At as initRemoteModals,Cr as initRowDrag,Nr as initScrollEdges,Bi as initServerActions,Qe as initServerTables,Ya as initShellParts,oa as initUnsavedChanges,rn as inlineEditText,Yr as isHeicFile,Zr as isImageFile,pr as isImageOnlyAccept,xr as isMaskPattern,Or as isPdfFile,o as isTypingTarget,xt as kanbanCardLabel,kt as kanbanOverflow,gt as kanbanStorageKey,_t as kanbanSummaryFormat,Tt as kanbanVisibleLimit,jt as loadRemoteDrawer,mt as loadRemoteModal,ci as maskedPostValue,Bt as matchSegments,Dr as matchesAccept,Ve as measureRows,hn as mentionLabel,_n as mentionTextFromValue,dn as mentionValueFromText,pn as mentionedIds,m as moveFocus,ri as nextTheme,Tn as notificationCountText,Cn as notificationDayHeading,Dn as notificationTime,kn as notificationTriggerLabel,wn as notificationUnreadAnnouncement,D as openSearch,yn as parseMentionValue,Ye as parseToastAction,gr as passwordSatisfies,be as pinAtValue,Be as pinClasses,ge as pinOffsetVar,de as planPins,ze as playRowMoves,ar as postedMasked,Tr as rawMasked,_e as readColumnWidths,at as readCsrf,St as readKanbanCollapsed,Fr as readStoredTheme,zn as relativeTimeTitle,sa as resetUnsavedChanges,dr as resolveMask,Lr as resolveTheme,pe as rowLabel,fe as rowOrderChanged,r as runShortcut,Xe as runToastAction,he as saveOutcomeText,Oe as setRowSaveState,ue as settledRows,i as shortcutKey,u as shortcutName,s as shortcutsOff,rt as showResultToast,Xr as storeTheme,yt as sumKanbanValues,Ge as syncSelectAll,cr as syncTargets,Gr as themeBootScript,zr as themeKeyframes,sr as tickedKeys,S as toInstant,Rr as transitionTheme,kr as validateFile,De as virtualRange,Ar as watchSystemTheme,Pt as withTrustedLabel,me as writeColumnWidths,vt as writeKanbanCollapsed,C as wuiFetch};
1
+ import{n as e}from"./elementBase-DV9IZZCu.js";import{a as t,c as n,d as r,f as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./shortcutKeys-BQiDpsTJ.js";import{n as h,t as g}from"./filterPopover-QL0Pa875.js";import{t as _}from"./devWarn-DXdRWZs3.js";import{a as v,c as y,d as b,f as x,h as S,i as ee,l as te,m as ne,n as re,o as ie,p as ae,r as oe,s as se,t as ce,u as le}from"./formatters-BAE__8ye.js";import{A as ue,C as de,D as fe,E as pe,M as me,O as he,S as ge,T as _e,_ as ve,a as ye,b as be,c as xe,d as Se,f as Ce,g as we,h as Te,i as Ee,j as De,k as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as Ie,u as Le,v as Re,w as ze,x as Be,y as Ve}from"./dataTable-Cd_IJQcs.js";import{t as He}from"./iconGlyphs.g-Bk8AzmSO.js";import{C as Ue,S as We,T as Ge,_ as Ke,a as qe,b as Je,c as C,d as Ye,f as Xe,g as Ze,h as Qe,i as $e,l as et,m as tt,n as nt,o as w,p as rt,r as it,s as at,t as ot,u as st,v as ct,w as lt,x as ut,y as dt}from"./wuiHttp-Cu7OPWr2.js";import{_ as ft,a as pt,b as mt,c as ht,d as gt,f as _t,g as vt,h as yt,i as bt,l as xt,m as St,n as Ct,o as wt,p as Tt,r as Et,s as Dt,t as Ot,u as kt,v as At,y as jt}from"./kanban-CxpZlQDL.js";import{n as Mt,t as Nt}from"./statusIcons-Dt2ZVJyk.js";import{o as Pt}from"./optionLabel-Bd3vP-XI.js";import{t as Ft}from"./WuiAutocomplete-DpPpa4FC.js";import{t as It}from"./WuiCarousel-BbO8AoM6.js";import{t as Lt}from"./WuiCodeBlock-DIPE7V93.js";import{n as Rt,t as zt}from"./copyText-DM5HhXjf.js";import{t as Bt}from"./textMatch-wdY7XLIc.js";import{t as Vt}from"./WuiCommandPalette-BROO_xyP.js";import{i as Ht,n as Ut,r as Wt,t as Gt}from"./WuiCommentThread-DqKktFs2.js";import{t as Kt}from"./WuiConsentBanner-BDeCCk6b.js";import{t as qt}from"./WuiContextMenu-BrHXfA-X.js";import{t as Jt}from"./WuiSelect-1nRsHfEt.js";import{t as Yt}from"./WuiCountrySelect-8zZAl6bH.js";import{t as Xt}from"./WuiDataTable-YzxEQGIO.js";import{t as Zt}from"./WuiDatePicker-CEabNb5D.js";import{t as Qt}from"./WuiDateRange-CshFgseR.js";import{t as $t}from"./WuiDock-Bd2ijOaJ.js";import{t as en}from"./WuiDrawer-DnHsXG4q.js";import{t as tn}from"./WuiHoverCard-BjPDXlhV.js";import{t as nn}from"./WuiImageCrop-CvXh791S.js";import{a as rn,i as an,n as on,r as sn,t as cn}from"./WuiInlineEdit-BkzYdhpE.js";import{t as ln}from"./WuiLightbox-D6aI_3tH.js";import{t as un}from"./WuiMarkdown-DZ5CMeCz.js";import{a as dn,c as fn,i as pn,l as mn,n as hn,o as gn,r as _n,s as vn,t as yn,u as bn}from"./WuiMentionInput-DWuua2rm.js";import{t as xn}from"./WuiMenubar-BC48Kv8o.js";import{t as Sn}from"./WuiMultiSelect-C1XQnhfW.js";import{t as Cn}from"./WuiNavigationMenu-CGqTADvr.js";import{a as wn,c as Tn,i as En,n as Dn,o as On,r as kn,s as An,t as jn}from"./notificationDays-BUoh4mG6.js";import{t as Mn}from"./WuiNotificationCenter-D8z-xECD.js";import{t as Nn}from"./WuiOnboardingChecklist-DXUETu1h.js";import{t as Pn}from"./WuiOtp-DfhXc829.js";import{t as Fn}from"./WuiOverflow-blOepYs6.js";import{t as In}from"./WuiPhone-BwFv7s0F.js";import{t as Ln}from"./WuiRating-DhhqYj5Z.js";import{t as Rn}from"./WuiRecordPager-BFqaMK8g.js";import{n as zn,r as Bn,t as Vn}from"./WuiRelativeTime-D6hPHWXX.js";import{t as Hn}from"./WuiResizable-CtwCQUWR.js";import{t as Un}from"./WuiRollingNumber-fiD54wsj.js";import{t as Wn}from"./WuiShortcuts-Xa7eq9-J.js";import{t as Gn}from"./WuiShowMore-D3VHRZJg.js";import{t as Kn}from"./WuiSlider-IOqadOtK.js";import{t as qn}from"./WuiSortable-CugtxycN.js";import{t as Jn}from"./WuiTagInput-hAQ14Wgk.js";import{t as Yn}from"./WuiTimePicker-DXljDDxI.js";import{n as Xn,t as Zn}from"./WuiTour-BZQVityh.js";import{t as Qn}from"./WuiTree-B7TFIZWp.js";import{t as $n}from"./WuiTruncate-Cxujs1Xt.js";import{n as er,t as tr}from"./WuiWhatsNew-bOkXSofq.js";import{n as nr,t as rr}from"./WuiWizardStep-D46JBR4c.js";import{$ as ir,A as ar,B as or,C as sr,D as cr,E as lr,F as ur,G as dr,H as fr,I as pr,J as mr,K as hr,L as gr,M as _r,N as vr,O as yr,P as br,Q as xr,R as Sr,S as Cr,T as wr,U as Tr,V as Er,W as Dr,X as Or,Y as kr,Z as Ar,_ as jr,a as Mr,at as Nr,b as Pr,c as Fr,d as Ir,et as Lr,f as Rr,g as zr,h as Br,i as Vr,it as Hr,j as Ur,k as Wr,l as Gr,m as Kr,n as qr,nt as Jr,o as Yr,ot as Xr,p as Zr,q as Qr,r as $r,rt as ei,s as ti,t as ni,tt as ri,u as ii,v as ai,w as oi,x as si,y as ci,z as li}from"./themeTransition-BSTpUIVI.js";var ui=`/`,di=`.search-wrap.wui-search-collapsible`,fi=`.wui-topsearch-panel`,pi=`.modal, wui-drawer[open]`,mi=new WeakSet,T=e=>e.querySelector(`.wui-search-toggle`),E=e=>e.querySelector(`.search-input`);function D(e){e.classList.remove(`is-collapsed`),T(e)?.setAttribute(`aria-expanded`,`true`),E(e)?.focus()}function O(e){E(e)?.value||(e.classList.add(`is-collapsed`),T(e)?.setAttribute(`aria-expanded`,`false`))}function hi(e){if(e.dataset.wuiCollapseWired)return;e.dataset.wuiCollapseWired=`1`;let t=T(e),n=E(e);t?.addEventListener(`click`,()=>D(e)),n?.addEventListener(`keydown`,r=>{r.key!==`Escape`||n.value||(r.preventDefault(),O(e),t?.focus())}),e.addEventListener(`focusout`,t=>{e.contains(t.relatedTarget)||O(e)})}function gi(e){mi.has(e)||(mi.add(e),e.addEventListener(`keydown`,t=>{if(t.key!==`/`||t.ctrlKey||t.altKey||t.metaKey||t.defaultPrevented||o(t.target)||t.target?.closest?.(pi)||e.querySelector(fi))return;let n=[...e.querySelectorAll(di)].find(e=>e.offsetParent!==null);n&&(t.preventDefault(),D(n))}))}function _i(e=document){for(let t of e.querySelectorAll(di))hi(t);gi(e.ownerDocument??e)}var k=`wuiConfirm`,A=Object.freeze([`danger`]),j=Object.freeze([`success`,`info`,`warning`,`danger`]),M=`wui.flash`,N=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.`}),vi=new WeakSet,yi=new WeakSet,P=null,F=null,I=!1,bi=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML},L=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})},xi=()=>{let e=window.bootstrap?.Modal;if(!e)throw Error(`data-wui-confirm: Bootstrap's bundle (window.bootstrap) is not loaded on this page.`);return e};function Si(){let e=document.getElementById(k);return e||(e=document.createElement(`div`),e.id=k,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`,`${ft.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="btn btn-secondary" data-bs-dismiss="modal">${bi(N.cancelLabel)}</button><button type="button" class="btn btn-primary" data-app-confirm></button></div></div></div></div>`,document.body.appendChild(e),e)}function Ci(e,t){let n=e.getAttribute(`data-wui-confirm-tone`);if(n!==null&&!A.includes(n))throw TypeError(`data-wui-confirm-tone="${n}" is not supported. Use danger, or leave it off.`);wi({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 wi({title:e,message:t,label:n,danger:r},i){let a=xi(),o=Si(),s=o.querySelector(`.wui-confirm-title`),c=o.querySelector(`[data-app-confirm]`);if(!s||!c)throw Error(`#${k} is not a confirm dialog with a confirm button. Render <app-confirm-dialog id="${k}"> 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)),s.textContent=e||N.confirmTitle,l.textContent=t,c.textContent=n||N.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`,s.textContent),F=i,I=!1,a.getOrCreateInstance(o).show()}var R=(e,t)=>{P=e;try{t()}finally{P=null}};function Ti(e,{title:t,message:n,label:r,tone:i},a){if(i!=null&&!A.includes(i))throw TypeError(`confirmAction: tone "${i}" is not supported. Use danger, or leave it off.`);Bi(e.ownerDocument),wi({title:t,message:n,label:r,danger:i===`danger`},()=>R(e,a))}var Ei=e=>e.disabled===!0||e.getAttribute(`aria-disabled`)===`true`;function Di(e){let t=e.target.closest?.(`[data-wui-confirm]:not(form)`);!t||t===P||Ei(t)||(e.preventDefault(),e.stopImmediatePropagation(),Ci(t,()=>R(t,()=>t.click())))}function Oi(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!t.hasAttribute(`data-wui-confirm`)||t===P||e.submitter&&e.submitter===P||t.querySelector(`input[data-app-repeater-hidden]`))return;e.preventDefault(),e.stopImmediatePropagation();let n=e.submitter?.form===t?e.submitter:void 0;Ci(t,()=>R(t,()=>t.requestSubmit(n)))}function ki(e){let t=e.target.closest?.(`#${k} [data-app-confirm]`);!t||t.disabled||!F||(I=!0,xi().getOrCreateInstance(t.closest(`#${k}`)).hide())}function Ai(e){if(e.target.id!==`wuiConfirm`)return;let t=I?F:null;F=null,I=!1,t?.()}var ji=(e,t)=>{e&&window.sessionStorage.setItem(M,JSON.stringify({message:e,variant:t}))},Mi=e=>e===`forbidden`?N.forbidden:e===`network`?N.network:N.failed;function Ni(){for(let e of document.querySelectorAll(`[data-wui-server]`))e.dataset.refreshOnSuccess!==`false`&&tt(e)?.reload()}async function Pi(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 Fi(t,e)}async function Fi(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.`);t.disabled=!0,t.setAttribute(`aria-busy`,`true`);let i=await C(e,{method:`POST`,body:n});if(i.kind===`session`||i.kind===`aborted`)return;let a=i.toastVariant||`success`;if(i.ok&&(i.redirect||r===`page`)){ji(i.message,a),i.redirect?window.location.assign(i.redirect):window.location.reload();return}if(t.disabled=!1,t.removeAttribute(`aria-busy`),i.ok){rt(i,a),Ni();return}L(i.message||Mi(i.kind),`danger`)}function Ii(e){let t=e.target.closest?.(`[data-wui-post]`);t&&(e.preventDefault(),!(Ei(t)||t.getAttribute(`aria-busy`)===`true`)&&Pi(t).catch(e=>_(e)))}function Li(e){let t=e.target.closest?.(`form[data-wui-post-form]`);if(!t||e.defaultPrevented)return;e.preventDefault();let n=e.submitter||t.querySelector(`button`);n.getAttribute(`aria-busy`)!==`true`&&(Fi(t.getAttribute(`action`),n,new FormData(t)).catch(e=>_(e)),window.bootstrap?.Dropdown?.getInstance(t.closest(`.dropdown`)?.querySelector(`[data-bs-toggle='dropdown']`))?.hide())}function Ri(){let e=window.sessionStorage.getItem(M);if(!e)return;window.sessionStorage.removeItem(M);let{message:t,variant:n}=JSON.parse(e);L(t,n)}function zi(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(!j.includes(t))throw TypeError(`data-wui-flash-variant="${t}" is not supported. Use ${j.join(`, `)}.`);let n=e.getAttribute(`data-wui-flash`)||e.textContent.trim();e.remove(),L(n,t)}}function Bi(e){yi.has(e)||(yi.add(e),e.addEventListener(`click`,ki),e.addEventListener(`hidden.bs.modal`,Ai))}function Vi(e=document){let t=e.ownerDocument||e;vi.has(t)||(vi.add(t),t.addEventListener(`click`,Di,!0),t.addEventListener(`submit`,Oi,!0),Bi(t),t.addEventListener(`click`,Ii),t.addEventListener(`submit`,Li),Ri()),zi(e)}var z=Object.freeze({title:`Leave without saving?`,message:`Your changes on this page are not saved. If you leave now, they are lost.`,leaveLabel:`Leave`}),B=`form[data-wui-unsaved]`,Hi=`[aria-invalid="true"], .field-error:not(:empty), .field-validation-error, .validation-summary-errors, .wui-error-summary`,Ui=`[download], [data-wui-modal], [data-wui-post], [data-bs-toggle]`,Wi=new Set([`submit`,`button`,`reset`,`image`]),Gi=new Set([`hidden`,`checkbox`,`radio`,`file`,`submit`,`button`,`reset`,`image`,`range`,`color`]),V=new WeakMap,Ki=new WeakSet,qi=e=>`${e.name}:${e.size}:${e.lastModified}`;function H(e){let t=[];for(let n of e.elements)!n.name||n.disabled||Wi.has(n.type)||(n.type===`checkbox`||n.type===`radio`?t.push([n.name,n.value,n.checked]):n.type===`file`?t.push([n.name,[...n.files||[]].map(qi)]):n.type===`select-multiple`?t.push([n.name,[...n.selectedOptions].map(e=>e.value)]):t.push([n.name,n.value]));return JSON.stringify(t)}function U(e){return H(e)}function Ji(e){for(let t of e.elements)if(!(!t.name||t.disabled)){if(t.tagName===`TEXTAREA`||t.tagName===`INPUT`&&!Gi.has(t.type)){if(t.value.trim()!==``)return!0}else if(t.tagName===`INPUT`&&t.type===`file`&&t.files?.length>0)return!0}return!1}var Yi=e=>({saved:e.querySelector(Hi)&&Ji(e)?null:H(e),engaged:!1,discarded:!1});function Xi(e){let t=V.get(e);return!t||t.discarded||!e.isConnected?!1:t.saved===null||t.engaged&&H(e)!==t.saved}var W=(e,t)=>[...e.querySelectorAll(B)].filter(e=>e!==t&&Xi(e)),Zi=()=>!!window.bootstrap?.Modal;function Qi(e,t,n){let r=t.map(e=>e.getAttribute(`data-wui-unsaved`)).find(Boolean)||z.message;Ti(e,{title:z.title,message:r,label:z.leaveLabel,tone:`danger`},()=>{for(let e of t)V.get(e).discarded=!0;n()})}function $i(e){if(e.matches(Ui))return!1;let t=e.getAttribute(`target`);if(t&&t.toLowerCase()!==`_self`)return!1;let n=new URL(e.getAttribute(`href`),window.location.href);if(n.protocol!==`http:`&&n.protocol!==`https:`)return!1;let r=window.location;return!(n.hash&&n.origin===r.origin&&n.pathname===r.pathname&&n.search===r.search)}function ea(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 ta(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target.closest?.(`a[href]`);if(!t||!$i(t))return;let n=W(t.ownerDocument,null);!n.length||!Zi()||(e.preventDefault(),Qi(t,n,()=>t.click()))}function na(e){let t=e.target;if(!(t instanceof HTMLFormElement)||e.defaultPrevented||!ea(t,e.submitter))return;let n=W(t.ownerDocument,t);if(n.length&&Zi()){e.preventDefault();let r=e.submitter?.form===t?e.submitter:void 0;Qi(t,n,()=>t.requestSubmit(r));return}let r=V.get(t);r&&(r.saved=H(t),r.discarded=!1)}function ra(e){W(document,null).length&&(e.preventDefault(),e.returnValue=``)}function ia(e){let t=e.target.closest?.(B),n=t&&V.get(t);!n||n.engaged||(n.saved!==null&&(n.saved=H(t)),n.engaged=!0)}function aa(e){let t=e.target.closest?.(B),n=t&&V.get(t);n&&(n.discarded=!1,e.isTrusted&&(n.engaged=!0))}function oa(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(B))ca(e)}function sa(e=document){let t=e.ownerDocument||e;if(!Ki.has(t)){Ki.add(t);for(let e of[`focusin`,`pointerdown`,`drop`])t.addEventListener(e,ia,!0);for(let e of[`input`,`change`])t.addEventListener(e,aa,!0);t.addEventListener(`click`,ta),t.addEventListener(`submit`,na),t.addEventListener(`wui:modal:success`,oa),t.defaultView.addEventListener(`beforeunload`,ra)}let n=[...e.querySelectorAll?.(B)||[]];e.matches?.(B)&&n.unshift(e);for(let e of n)V.has(e)||V.set(e,Yi(e))}function ca(e){if(!(e instanceof HTMLFormElement)||!e.matches(B))throw TypeError(`resetUnsavedChanges: ${String(e)} is not a <form data-wui-unsaved>.`);V.set(e,{saved:H(e),engaged:!1,discarded:!1})}var G=Object.freeze({discard:`Discard`,keep:`Keep editing`}),la=`wui:drawer:discard`,K=`wui-drawer[confirm-discard]`,q=`.wui-modal-shell`,ua=`form[data-wui-confirm-discard]`,J=`.wui-drawer-discard`,da=`input, select, textarea`,Y=new WeakMap,fa=new WeakSet,pa=new WeakSet;function ma(e,t,n,r){let i=e.createElement(`button`);return i.type=`button`,i.className=t,i.setAttribute(n,``),i.textContent=r,i}function ha(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,ma(e,`btn btn-danger btn-sm`,`data-wui-discard-confirm`,G.discard),ma(e,`btn btn-secondary btn-sm`,`data-wui-discard-keep`,G.keep)),n}function ga(e){let t=e.closest?.(K);if(t)return t;let n=e.closest?.(q);return n&&(n.hasAttribute(`confirm-discard`)||n.querySelector(ua))?n:null}function _a(e){return e.closest(K)??e.closest(q)}function X(e){return e.matches(K)||e.hasAttribute(`confirm-discard`)?e.querySelectorAll(`form`):e.querySelectorAll(ua)}function va(e){let t=Y.get(e);return t!=null&&U(e)!==t}function ya(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-drawer-footer`,e.querySelector(`.wui-drawer-panel`).append(t),pa.add(t),t}function ba(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),pa.add(t),t}function xa(e){e.querySelector(`[data-wui-discard-confirm]`).focus()}function Sa(e,t){let n=e.querySelector(J);if(n){xa(n);return}let r=ha(e.ownerDocument,t),i;if(e.matches(K))i=e.querySelector(`.wui-drawer-footer`)??ya(e),i.prepend(r);else if(e.hasAttribute(`confirm-discard`))i=e.querySelector(`.wui-modal-footer`)??ba(e),i.prepend(r);else{let t=e.querySelector(ua);i=t.querySelector(`.modal-footer`),i?i.prepend(r):(i=t,t.append(r))}i.classList.add(`wui-drawer-discarding`),xa(r)}function Ca(e){let t=e.parentElement;e.remove(),t.classList.remove(`wui-drawer-discarding`),pa.has(t)&&t.remove()}function wa(e){for(let t of X(e)){let e=[...t.querySelectorAll(da)].find(e=>e.type!==`hidden`&&!e.disabled);if(e){e.focus();return}}}function Ta(e){let t=ga(e.target);if(t)for(let e of X(t))Y.get(e)??Y.set(e,U(e))}function Ea(e){let t=e.target;!(t instanceof HTMLFormElement)||!ga(t)||Y.set(t,U(t))}function Da(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(`form`))Y.delete(e)}function Oa(e){let t=e.target;!(t instanceof Element)||!t.matches(K)||[...X(t)].some(va)&&(e.preventDefault(),Sa(t,t.getAttribute(`confirm-discard`)))}function ka(e){let t=e.target;if(!(t instanceof Element)||!t.matches(q))return;let n=[...X(t)].find(va);n&&(e.preventDefault(),Sa(t,t.getAttribute(`confirm-discard`)??n.getAttribute(`data-wui-confirm-discard`)))}function Aa(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(q);n&&window.bootstrap?.Modal?.getInstance(n)?.hide()}function ja(e){let t=e.closest(J),n=_a(t);Ca(t);for(let e of X(n))Y.set(e,U(e));n.dispatchEvent(new CustomEvent(la,{bubbles:!0})),n.matches(K)?n.hide():window.bootstrap.Modal.getInstance(n).hide()}function Ma(e){let t=e.closest(J),n=_a(t);Ca(t),wa(n)}function Na(e){let t=e.target,n=t.closest?.(`[data-wui-discard-confirm]`);if(n){ja(n);return}let r=t.closest?.(`[data-wui-discard-keep]`);if(r){Ma(r);return}let i=t.closest?.(`[data-wui-dismiss]`);i&&Aa(i)}function Pa(e){if(e.key!==`Escape`)return;let t=e.currentTarget.querySelector(J);if(!t)return;e.preventDefault(),e.stopPropagation();let n=_a(t);Ca(t),wa(n)}function Fa(e=document){let t=e.ownerDocument||e;fa.has(t)||(fa.add(t),t.addEventListener(`focusin`,Ta),t.addEventListener(`pointerdown`,Ta),t.addEventListener(`submit`,Ea),t.addEventListener(`wui:modal:success`,Da),t.addEventListener(`wui:modal:loaded`,Da),t.addEventListener(`wui-drawer-close`,Oa,!0),t.addEventListener(`hide.bs.modal`,ka),t.addEventListener(`click`,Na),t.addEventListener(`keydown`,Pa,!0))}var Ia=`data-wui-bulk-in-bar`,La=`[data-wui-page-header-bar][data-wui-bulk-for]`,Ra=new WeakSet;function za(e){return`${x(e,{decimals:0})} selected`}function Ba(e,t){for(let n of e.querySelectorAll(`[data-wui-bar-swap]`))n.hidden=t>0;let n=e.querySelector(`[data-wui-bar-bulk]`);n&&(n.hidden=t===0,n.querySelector(`.page-header-bar-bulk-count`).textContent=t>0?za(t):``)}function Va(e=document){for(let t of e.querySelectorAll(La))document.getElementById(t.dataset.wuiBulkFor)?.setAttribute(Ia,``);Ra.has(document)||(Ra.add(document),document.addEventListener(`selectionchange`,e=>{if(typeof e.detail?.selected==`number`)for(let t of document.querySelectorAll(La))document.getElementById(t.dataset.wuiBulkFor)?.contains(e.target)&&Ba(t,e.detail.selected)}))}var Ha=31536e3,Z=new WeakMap,Q=e=>e>99?`99+`:String(e);function Ua(e,t,n=document){n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${Ha}; SameSite=Lax`}var Wa=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content},$=(e,t)=>{let n=document.createElement(`div`);return n.className=e,n.textContent=t,n};function Ga(e,t){let n=e.querySelector(`.wui-bell-trigger`),r=e.querySelector(`.wui-bell-count`),i=e.querySelector(`[data-wui-bell-live]`),a=e.querySelector(`[data-wui-bell-list]`),o=e.querySelector(`.wui-bell-menu`),{src:s,readAction:c}=e.dataset,l=e.dataset.label||`Notifications`,u=e.dataset.emptyText||`You are all caught up.`,d=Number(e.dataset.pollSeconds??60),f=w(),p=Number(e.dataset.unread)||0,m=(t,a=!0)=>{let o=Math.max(0,Number(t)||0),s=o!==p;p=o,e.dataset.unread=String(o),r&&(r.textContent=Q(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?l:`${l}, ${Q(o)} unread`),a&&s&&i&&(i.textContent=o===0?`No unread notifications`:`${Q(o)} unread notifications`)},h=()=>o?.classList.contains(`show`)??!1,g=()=>{let e=$(`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),a.replaceChildren(e)},_=async t=>{t&&(a.setAttribute(`aria-busy`,`true`),a.querySelector(`.wui-bell-item`)||a.replaceChildren($(`wui-bell-state`,`Loading…`)));let n=await f.run(s);if(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)return;if(a.removeAttribute(`aria-busy`),!n.ok){t&&g();return}let r=Wa(n.html),i=r.querySelector(`[data-wui-unread]`),o=i?Number(i.getAttribute(`data-wui-unread`)):p;m(o),(t||h())&&(r.querySelector(`.wui-bell-item`)?a.replaceChildren(r):a.replaceChildren($(`wui-bell-state`,u))),e.dispatchEvent(new CustomEvent(`wui:notifications:loaded`,{bubbles:!0,detail:{unread:o}}))};e.addEventListener(`show.bs.dropdown`,()=>_(!0)),e.addEventListener(`click`,async e=>{if(e.target.closest(`[data-wui-bell-retry]`)){_(!0);return}let t=e.target.closest(`[data-wui-bell-read]`);if(!t||!c)return;t.disabled=!0;let n=await C(c,{method:`POST`});t.disabled=!1,n.ok&&(m(0),_(!0))});let v=null,y=()=>{d>0&&v===null&&(v=setInterval(()=>_(h()),d*1e3))},b=()=>{v!==null&&clearInterval(v),v=null},x=()=>{document.hidden?b():(_(h()),y())};return d>0&&(document.addEventListener(`visibilitychange`,x),document.hidden||y()),t.push(()=>{b(),f.abort(),document.removeEventListener(`visibilitychange`,x)}),{setUnread:e=>m(e),refresh:()=>_(h())}}var Ka=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),qa=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function Ja(e,t){let n=e.querySelector(`input.search-input`),r=e.querySelector(`.wui-topsearch-results`),i=e.querySelector(`.wui-topsearch-open`),a=e.querySelector(`[data-wui-topsearch-live]`),{src:o,param:s=`q`,resultsHref:c}=e.dataset,l=Number(e.dataset.minChars??2),u=Number(e.dataset.debounceMs??250),d=w(),f=null,p=-1,m=()=>[...r.querySelectorAll(`.wui-topsearch-hit`)],h=e=>{let t=m();p=t.length===0?-1:(e+t.length)%t.length,t.forEach((e,t)=>{let n=t===p;e.classList.toggle(`is-active`,n),e.setAttribute(`aria-selected`,n?`true`:`false`)}),p>=0?(n.setAttribute(`aria-activedescendant`,t[p].id),t[p].scrollIntoView?.({block:`nearest`})):n.removeAttribute(`aria-activedescendant`)},g=()=>{r.hidden=!0,n.setAttribute(`aria-expanded`,`false`),n.removeAttribute(`aria-activedescendant`),p=-1},_=()=>{r.hidden=!1,n.setAttribute(`aria-expanded`,`true`)},v=t=>{e.classList.toggle(`is-open`,t),i?.setAttribute(`aria-expanded`,t?`true`:`false`)},y=t=>{let n=new CustomEvent(`wui:search:select`,{bubbles:!0,cancelable:!0,detail:{href:t}});e.dispatchEvent(n)&&window.location.assign(t)},b=async t=>{e.classList.add(`is-loading`);let n=await d.run(qa(o,s,t));if(!(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)){if(e.classList.remove(`is-loading`),n.ok){let e=Wa(n.html),t=e.querySelector(`[data-wui-count]`);r.replaceChildren(e),m().forEach((e,t)=>{e.id=`${r.id}-opt-${t}`});let i=t?Number(t.getAttribute(`data-wui-count`)):m().length;a&&(a.textContent=i===0?`No results`:`${i} ${i===1?`result`:`results`}`)}else r.replaceChildren($(`wui-topsearch-empty`,`Search is unavailable right now.`));p=-1,_()}};n.addEventListener(`input`,()=>{clearTimeout(f);let t=n.value.trim();if(t.length<l){d.abort(),e.classList.remove(`is-loading`),r.replaceChildren(),g();return}f=setTimeout(()=>b(t),u)}),n.addEventListener(`keydown`,t=>{if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(r.hidden||m().length===0)return;t.preventDefault(),h(p+(t.key===`ArrowDown`?1:-1))}else if(t.key===`Enter`){let e=m();!r.hidden&&p>=0&&e[p]?(t.preventDefault(),y(e[p].getAttribute(`href`))):c&&n.value.trim()!==``&&(t.preventDefault(),y(qa(c,s,n.value.trim())))}else t.key===`Escape`&&(r.hidden?e.classList.contains(`is-open`)&&(t.preventDefault(),t.stopPropagation(),v(!1),i?.focus()):(t.preventDefault(),t.stopPropagation(),g()))}),r.addEventListener(`click`,e=>{let t=e.target.closest(`.wui-topsearch-hit`);!t||e.ctrlKey||e.metaKey||e.shiftKey||e.button===1||(e.preventDefault(),y(t.getAttribute(`href`)))}),i?.addEventListener(`click`,()=>{let t=!e.classList.contains(`is-open`);v(t),t&&n.focus()});let x=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||Ka(e.target)||(e.preventDefault(),v(!0),n.focus())},S=t=>{e.contains(t.target)||(g(),e.classList.contains(`is-open`)&&v(!1))};document.addEventListener(`keydown`,x),document.addEventListener(`pointerdown`,S),t.push(()=>{clearTimeout(f),d.abort(),document.removeEventListener(`keydown`,x),document.removeEventListener(`pointerdown`,S)})}function Ya(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>Ua(n,!!e.detail?.collapsed)),e.addEventListener(`click`,t=>{t.target.closest(`[data-wui-tabbar-more]`)&&e.querySelector(`[data-app-shell-menu]`)?.click()});let r=e.querySelector(`[data-wui-bell]`),i=r?Ga(r,t):null,a=e.querySelector(`[data-wui-topsearch]`);a&&Ja(a,t);let o={el:e,setUnread(e){if(!i)throw Error(`WUI.shell: this <app-shell> has no <app-shell-notifications>.`);i.setUnread(e)},refreshNotifications(){if(!i)throw Error(`WUI.shell: this <app-shell> has no <app-shell-notifications>.`);return i.refresh()},get collapsed(){return e.classList.contains(`collapsed`)},set collapsed(t){if(!!t===e.classList.contains(`collapsed`))return;let n=e.querySelector(`[data-app-shell-collapse]`);n?n.click():e.classList.toggle(`collapsed`,!!t)}};Z.set(e,o);let s=n=>{if(n.target===e||n.target.contains?.(e)){for(let e of t)e();Z.delete(e),delete e.dataset.wuiPartsWired,document.removeEventListener(`wui:teardown`,s)}};return document.addEventListener(`wui:teardown`,s),o}function Xa(e=document){let t=[];e instanceof Element&&e.matches(`[data-app-shell]`)&&t.push(e),t.push(...e.querySelectorAll(`[data-app-shell]`));for(let e of t)e.dataset.wuiPartsWired||(e.dataset.wuiPartsWired=`1`,Ya(e))}function Za(e){let t=e?.closest?.(`[data-app-shell]`)??null;return t?(Z.has(t)||Xa(t),Z.get(t)??null):null}function Qa(){h(),e(`wui-select`,Jt),e(`wui-country-select`,Yt),e(`wui-phone`,In),e(`wui-datepicker`,Zt),e(`wui-date-range`,Qt),e(`wui-dock`,$t),e(`wui-image-crop`,nn),e(`wui-kanban`,ht),e(`wui-inline-edit`,an),e(`wui-consent-banner`,Kt),e(`wui-slider`,Kn),e(`wui-sortable`,qn),e(`wui-timepicker`,Yn),e(`wui-tour`,Zn),e(`wui-tree`,Qn),e(`wui-autocomplete`,Ft),e(`wui-command-palette`,Vt),e(`wui-context-menu`,qt),e(`wui-multiselect`,Sn),e(`wui-taginput`,Jn),e(`wui-otp`,Pn),e(`wui-status-icon`,Mt),e(`wui-shortcuts`,Wn),e(`wui-record-pager`,Rn),e(`wui-carousel`,It),e(`wui-code-block`,Lt),e(`wui-markdown`,un),e(`wui-data-table`,Xt),e(`wui-drawer`,en),e(`wui-hover-card`,tn),e(`wui-lightbox`,ln),e(`wui-menubar`,xn),e(`wui-navigation-menu`,Cn),e(`wui-notification-center`,Mn),e(`wui-onboarding-checklist`,Nn),e(`wui-overflow`,Fn),e(`wui-rating`,Ln),e(`wui-relative-time`,Vn),e(`wui-resizable`,Hn),e(`wui-rolling-number`,Un),e(`wui-show-more`,Gn),e(`wui-truncate`,$n),e(`wui-whats-new`,er),e(`wui-mention-input`,pn),e(`wui-comment-thread`,Ht),e(`wui-wizard-step`,rr),e(`wui-wizard`,nr)}Qa();export{xr as AVATAR_ACCEPT,ir as AVATAR_MAX_SIZE_MB,Lr as AVATAR_OUTPUT_SIZE,ri as AVATAR_OUTPUT_TYPE,Jr as AVATAR_PREVIEW_SIZES,ei as AVATAR_TEXT,Ia as BAR_BULK_IN_BAR_ATTRIBUTE,Ie as COLUMN_MAX_WIDTH,je as COLUMN_MIN_WIDTH,Gt as COMMENT_INTENTS,Ut as COMMENT_REACTIONS,Wt as COMMENT_TEXT,k as CONFIRM_DIALOG_ID,A as CONFIRM_TONES,zt as COPY_FEEDBACK_MS,ot as CSRF_META_NAME,ce as CURRENCIES,Pe as DATA_TABLE_TEXT,re as DATE_PATTERNS,nt as DEFAULT_CSRF_HEADER,Tr as DEFAULT_IMAGE_ACCEPT,Dr as DEFAULT_MAX_SIZE_MB,yr as DEFAULT_PASSWORD_RULES,Wr as DEFAULT_REQUIREMENTS_TITLE,ni as DEFAULT_THEME_EFFECT,qr as DEFAULT_THEME_STORAGE_KEY,la as DISCARD_EVENT,G as DISCARD_TEXT,si as DROP_OVER_CLASS,oe as DURATION_UNITS,ee as EMPTY_VALUE,g as FILTER_POPOVER_MAX_CHIPS,M as FLASH_STORAGE_KEY,j as FLASH_VARIANTS,v as FORMAT_STYLES,it as HTTP_KINDS,cn as INLINE_EDIT_SAVED_MS,on as INLINE_EDIT_TEXT,sn as INLINE_EDIT_TYPES,ie as IST_TIME_ZONE,Ot as KANBAN_DRAG_THRESHOLD_PX,Ct as KANBAN_LONG_PRESS_MS,Et as KANBAN_PHONE_QUERY,bt as KANBAN_STORAGE_PREFIX,pt as KANBAN_SUMMARY_FORMATS,wt as KANBAN_TEXT,Dt as KANBAN_TONES,p as LIST_KEYS,vr as MASK_INPUT_TYPES,br as MASK_NAMES,dn as MENTION_ID_PATTERN,yn as MENTION_MAX_QUERY,hn as MENTION_MAX_RESULTS,_n as MENTION_TEXT,se as MONEY_UNITS,jn as NOTIFICATION_COUNT_CAP,Dn as NOTIFICATION_TEXT,Ee as PIN_AT_VAR,ye as PIN_SIDES,Me as RESIZE_STEP,Fe as RESIZE_STEP_LARGE,Cr as ROW_DRAG_TYPE,sr as ROW_DROP_EVENT,xe as ROW_HEIGHTS,ke as ROW_MOVE_LIMIT,Le as ROW_MOVE_MS,Se as ROW_SAVE_ATTR,Ce as ROW_SAVE_ERROR_CLASS,Ne as ROW_SAVE_STATES,ai as SCROLL_EDGE_SELECTOR,ui as SEARCH_OPEN_KEY,Ze as SELECT_ALL_LABEL,Ke as SELECT_CELL_CLASS,c as SELECT_KEY,ct as SELECT_ROW_LABEL,N as SERVER_ACTION_TEXT,d as SHORTCUTS_OFF_ATTRIBUTE,a as SHORTCUT_EVENT,t as SHORTCUT_SCOPE_ATTRIBUTE,l as SHORTCUT_TEXT,Nt as STATUS_TONES,$r as THEME_BOOT_SCRIPT_BODY,Vr as THEME_CHANGE_EVENT,Mr as THEME_EFFECTS,Yr as THEME_EFFECT_DURATION,ti as THEME_MODES,Fr as THEME_SWITCHING_CLASS,et as TOAST_ACTION_METHODS,st as TOAST_ACTION_MS,z as UNSAVED_TEXT,Ae as VIRTUAL_OVERSCAN,tr as WHATS_NEW_READ_EVENT,$e as WUI_HEADERS,Ft as WuiAutocomplete,It as WuiCarousel,Lt as WuiCodeBlock,Vt as WuiCommandPalette,Ht as WuiCommentThread,Kt as WuiConsentBanner,qt as WuiContextMenu,Yt as WuiCountrySelect,Xt as WuiDataTable,Zt as WuiDatePicker,Qt as WuiDateRange,$t as WuiDock,en as WuiDrawer,tn as WuiHoverCard,nn as WuiImageCrop,an as WuiInlineEdit,ht as WuiKanban,ln as WuiLightbox,un as WuiMarkdown,pn as WuiMentionInput,xn as WuiMenubar,Sn as WuiMultiSelect,Cn as WuiNavigationMenu,Mn as WuiNotificationCenter,Nn as WuiOnboardingChecklist,Pn as WuiOtp,Fn as WuiOverflow,In as WuiPhone,Ln as WuiRating,Rn as WuiRecordPager,Vn as WuiRelativeTime,Hn as WuiResizable,Un as WuiRollingNumber,Jt as WuiSelect,Wn as WuiShortcuts,Gn as WuiShowMore,Kn as WuiSlider,qn as WuiSortable,Mt as WuiStatusIcon,Jn as WuiTagInput,Yn as WuiTimePicker,Zn as WuiTour,Qn as WuiTree,$n as WuiTruncate,er as WuiWhatsNew,nr as WuiWizard,rr as WuiWizardStep,dr as acceptLabel,dt as addRowSelectCells,Je as addSelectColumn,Ba as applyBarBulk,Gr as applyTheme,f as ariaKeyShortcuts,ur as attachInputMask,oi as attachRowDrag,ci as attachScrollEdges,ut as attachShiftRange,Hr as avatarCropOptions,Nr as avatarUnreadableMessage,za as barBulkCountText,ar as buildPasswordRules,Te as clampColumnWidth,qe as classifyStatus,O as collapseSearch,Ti as confirmAction,Rt as copyTextToClipboard,ha as createDiscardPrompt,Xn as createLocalSeenStore,w as createRequestQueue,We as createSelectHeaderCell,Ue as createSelectRowCell,lt as createSelectSpacerCell,Qa as defineWeborityElements,Ur as evaluatePassword,U as formValues,y as formatCompact,te as formatCurrency,le as formatDate,b as formatDuration,hr as formatFileSize,pr as formatMasked,x as formatNumber,ae as formatPercent,zn as formatRelativeTime,ne as formatValue,tt as getServerTable,Za as getShell,He as glyphSvg,we as groupCount,ve as groupItems,kn as groupNotificationsByDay,Re as identityCell,n as inShortcutScope,_i as initCollapsibleSearch,Fa as initDrawerDiscard,gr as initInputMasks,Va as initPageBarBulk,At as initRemoteModals,wr as initRowDrag,Pr as initScrollEdges,Vi as initServerActions,Qe as initServerTables,Xa as initShellParts,sa as initUnsavedChanges,rn as inlineEditText,Xr as isHeicFile,Qr as isImageFile,mr as isImageOnlyAccept,Sr as isMaskPattern,kr as isPdfFile,o as isTypingTarget,xt as kanbanCardLabel,kt as kanbanOverflow,gt as kanbanStorageKey,_t as kanbanSummaryFormat,Tt as kanbanVisibleLimit,jt as loadRemoteDrawer,mt as loadRemoteModal,li as maskedPostValue,Bt as matchSegments,Or as matchesAccept,Ve as measureRows,gn as mentionLabel,vn as mentionTextFromValue,fn as mentionValueFromText,mn as mentionedIds,m as moveFocus,ii as nextTheme,En as notificationCountText,wn as notificationDayHeading,On as notificationTime,An as notificationTriggerLabel,Tn as notificationUnreadAnnouncement,D as openSearch,bn as parseMentionValue,Ye as parseToastAction,_r as passwordSatisfies,be as pinAtValue,Be as pinClasses,ge as pinOffsetVar,de as planPins,ze as playRowMoves,or as postedMasked,Er as rawMasked,_e as readColumnWidths,at as readCsrf,St as readKanbanCollapsed,Ir as readStoredTheme,Bn as relativeTimeTitle,ca as resetUnsavedChanges,fr as resolveMask,Rr as resolveTheme,pe as rowLabel,fe as rowOrderChanged,r as runShortcut,Xe as runToastAction,he as saveOutcomeText,Oe as setRowSaveState,ue as settledRows,i as shortcutKey,u as shortcutName,s as shortcutsOff,rt as showResultToast,Zr as storeTheme,yt as sumKanbanValues,Ge as syncSelectAll,lr as syncTargets,Kr as themeBootScript,Br as themeKeyframes,cr as tickedKeys,S as toInstant,zr as transitionTheme,Ar as validateFile,De as virtualRange,jr as watchSystemTheme,Pt as withTrustedLabel,me as writeColumnWidths,vt as writeKanbanCollapsed,C as wuiFetch};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-elements",
3
- "version": "0.83.4",
3
+ "version": "0.84.0",
4
4
  "description": "Webority framework-agnostic UI custom elements (<wui-*>) — the single implementation of the interactive components, styled by @webority/theme. Used natively in Razor and wrapped by @webority/ui-react.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -41,6 +41,7 @@
41
41
  "./elements/inline-edit": "./dist/elements/inline-edit.js",
42
42
  "./elements/kanban": "./dist/elements/kanban.js",
43
43
  "./elements/lightbox": "./dist/elements/lightbox.js",
44
+ "./elements/markdown": "./dist/elements/markdown.js",
44
45
  "./elements/mention-input": "./dist/elements/mention-input.js",
45
46
  "./elements/menubar": "./dist/elements/menubar.js",
46
47
  "./elements/multiselect": "./dist/elements/multiselect.js",
@@ -1 +0,0 @@
1
- import{t as e}from"./elementBase-DV9IZZCu.js";import{C as t,M as n,S as r,T as i,_ as a,b as o,c as s,g as c,h as l,i as u,j as d,r as f,t as p}from"./dataTable-Cd_IJQcs.js";var m=`.wui-col-resize`,h=`.wui-group-row, .wui-virtual-spacer`,g=`.wui-select-cell, .wui-expand-cell`,_=`<svg class="wui-icon" data-icon="chevron-down" 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>`,v=e=>e.hasAttribute(`data-wui-skeleton`)||!!e.querySelector(`:scope > td > .skeleton`),y=class extends e{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=e.target.closest?.(m);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=i(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(){return this.querySelector(`:scope > table`)}_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.nodeType===1?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,n){let i=this._headCells(e),a=i.map(e=>{let t=e.dataset.pin;return t===`start`||t===`end`?t:e.matches(g)?`lead`:null});if(!a.some(e=>e===`start`||e===`end`))return;let s=t(a);s.forEach((e,t)=>{e&&this._ro?.observe(i[t])});let c=e=>i[e].getBoundingClientRect().width,l=0;s.forEach((t,n)=>{t?.side===`start`&&(this._setVar(e,r(`start`,t.ordinal),l),l+=c(n))}),l=0;for(let t=s.length-1;t>=0;t--){let n=s[t];n?.side===`end`&&(this._setVar(e,r(`end`,n.ordinal),l),l+=c(t))}if(n)for(let t of e.rows)t.matches(`${h}, .wui-row-expanded`)||t.cells.length!==i.length||s.forEach((e,n)=>{if(!e)return;let 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=o(e.side,e.ordinal);r.style.getPropertyValue(`--wui-pin-at`)!==i&&r.style.setProperty(u,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(g))}_handles(e){let t=this._headCells(e),n=this._resizable(t);t.forEach((e,t)=>{if(!n[t]||e.querySelector(m))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(p)),r.setAttribute(`tabindex`,`0`);let i=e.textContent.trim();r.setAttribute(`aria-label`,f.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(h)&&!v(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(m);n&&this._handleValue(n,l(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(g))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=l(t);e.style.width=`${n}px`,e.setAttribute(`data-wui-width`,``);let r=e.querySelector(m);return r&&this._handleValue(r,n),n}_handleValue(e,t){e.setAttribute(`aria-valuenow`,String(t)),e.setAttribute(`aria-valuetext`,f.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(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)},n(this.getAttribute(`view-key`),this._widths))}_reset(e){let t=this._table;if(!e||!t)return;let r=this._ensureFrozen(t);this._userSized=!0;let i=e.dataset.key;if(i&&i in this._widths){let{[i]:e,...t}=this._widths;this._widths=t,n(this.getAttribute(`view-key`),this._widths)}this._setWidth(e,this._natural[r.indexOf(e)]||0),this._fitTable(t,r),this._pins(t,!1)}_rtl(){return getComputedStyle(this).direction===`rtl`}_startDrag(e){let t=e.target.closest?.(m);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=e.target.closest?.(m);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=e.shiftKey?50:10,a=e.key===`ArrowRight`!==this._rtl(),o=Number.parseFloat(n.style.width)||n.getBoundingClientRect().width;this._resizeTo(n,o+(a?i:-i),!0)}_click(e){let t=!!e.target.closest?.(m);if(this._swallowClick||t){e.stopPropagation(),(t||this._swallowClick)&&e.preventDefault(),this._swallowClick=!1;return}if(!this.hasAttribute(`group-by`))return;let n=(e.target.closest?.(`.wui-group-toggle`))?.closest(`.wui-group-row`);if(!n||!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 o=[...i.rows].filter(e=>!e.matches(h));if(o.some(v))return;let s=this.ownerDocument,l=new Map([...i.querySelectorAll(`:scope > tr.wui-group-row`)].map(e=>[e.dataset.groupKey,e])),u=a(o,e=>e.dataset.group??e.cells[r]?.textContent.trim()??``,this._groupOrder);this._groupOrder=u.map(e=>e.key);let d=s.createDocumentFragment(),p=u.map(e=>{let t=l.get(e.key)??this._groupRow(s,e.key);return l.delete(e.key),t.querySelector(`.wui-group-cell`).colSpan=n.length,t.querySelector(`.wui-group-count`).textContent=c(e.items.length),t.querySelector(`.wui-group-rows`).textContent=`, ${f.rows(e.items.length)}`,d.append(t,...e.items),[t,e.key]});for(let e of l.values())e.remove();i.insertBefore(d,this._bottom?.parentNode===i?this._bottom:null);for(let[e,t]of p)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=_;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(h);n=n.nextElementSibling)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);this._top.cells[0].colSpan=t,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=d({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=this._items[e];n.classList.contains(`wui-virtual-off`)!==t&&n.classList.toggle(`wui-virtual-off`,t)}this._range=i,this._top.hidden=i.before===0,this._bottom.hidden=i.after===0,this._top.cells[0].style.height=`${i.before}px`,this._bottom.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;return t>0?t:e.classList.contains(`wui-table-compact`)?s.compact:e.classList.contains(`wui-table-cozy`)?s.cozy:s.comfortable}};export{y as t};