@webority/ui-elements 0.75.0 → 0.76.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.
@@ -1 +1 @@
1
- import{n as e}from"./elementBase-BlsR4tqa.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-BD8kwDfx.js";import{a as _,c as v,d as y,f as b,h as x,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-CUm_mfze.js";import{C as Ue,S as We,T as Ge,_ as Ke,a as qe,b as Je,c as S,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 C,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-0pGmgUIV.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-C0RiKTUx.js";import{n as Mt,t as Nt}from"./statusIcons-2X4iGkKL.js";import{o as Pt}from"./optionLabel-BBaur8Bs.js";import{t as Ft}from"./WuiAutocomplete-CYpMjHs3.js";import{t as It}from"./WuiCarousel-C33Z8FBt.js";import{t as Lt}from"./WuiCodeBlock-BcLJhLBJ.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-CcmFOWNc.js";import{i as Ht,n as Ut,r as Wt,t as Gt}from"./WuiCommentThread-BHtcGLX0.js";import{t as Kt}from"./WuiConsentBanner-C2jOIeQK.js";import{t as qt}from"./WuiContextMenu-BLNKaFsB.js";import{t as Jt}from"./WuiSelect-DJgzL9Z_.js";import{t as Yt}from"./WuiCountrySelect-DlmQ6qeN.js";import{t as Xt}from"./WuiDataTable-Bqs6FW2t.js";import{t as Zt}from"./WuiDatePicker-CpRYPtYz.js";import{t as Qt}from"./WuiDateRange-h4lDtS-H.js";import{t as $t}from"./WuiDock-BD2HgMmP.js";import{t as en}from"./WuiDrawer-D6K2eRlW.js";import{t as tn}from"./WuiHoverCard-Ql6CD3BL.js";import{t as nn}from"./WuiImageCrop-Cr3D2iPo.js";import{a as rn,i as an,n as on,r as sn,t as cn}from"./WuiInlineEdit-2XnVPzY-.js";import{t as ln}from"./WuiLightbox-hluak_-q.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-BxYXpBRt.js";import{t as bn}from"./WuiMenubar-4MOZ51R_.js";import{t as xn}from"./WuiMultiSelect-CBbY_sPD.js";import{t as Sn}from"./WuiNavigationMenu-BsLnvz2Y.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-pYmoU0g6.js";import{t as jn}from"./WuiNotificationCenter-BLsM1WkE.js";import{t as Mn}from"./WuiOnboardingChecklist-s2DG6PZ0.js";import{t as Nn}from"./WuiOtp-BbO_75RB.js";import{t as Pn}from"./WuiOverflow-Ixc3PRuW.js";import{t as Fn}from"./WuiPhone-BfM_ttOi.js";import{t as In}from"./WuiRating-BzeW6iDC.js";import{t as Ln}from"./WuiRecordPager-yXv4g2ZR.js";import{n as Rn,r as zn,t as Bn}from"./WuiRelativeTime-Cfc8TMd8.js";import{t as Vn}from"./WuiResizable-m2Ypa-zD.js";import{t as Hn}from"./WuiRollingNumber-DBgi_3l7.js";import{t as Un}from"./WuiShortcuts-CMibF1XM.js";import{t as Wn}from"./WuiShowMore-Bu7IQcXS.js";import{t as Gn}from"./WuiSlider-Br6V2amU.js";import{t as Kn}from"./WuiSortable-Bd7Fz5Ox.js";import{t as qn}from"./WuiTagInput-DQ79rmjZ.js";import{t as Jn}from"./WuiTimePicker-BIhwlHuA.js";import{n as Yn,t as Xn}from"./WuiTour-Bi_0ayiH.js";import{t as Zn}from"./WuiTree-BSx5pKJo.js";import{t as Qn}from"./WuiTruncate-BLl2u3b-.js";import{n as $n,t as er}from"./WuiWhatsNew-68sOQOTO.js";import{n as tr,t as nr}from"./WuiWizardStep-DtA3nVPi.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,p as Yr,q as Xr,r as Zr,rt as Qr,s as $r,t as ei,tt as ti,u as ni,v as ri,w as ii,x as ai,y as oi,z as si}from"./themeTransition-QXpGgIMc.js";var ci=`/`,li=`.search-wrap.wui-search-collapsible`,ui=`.wui-topsearch-panel`,di=`.modal, wui-drawer[open]`,fi=new WeakSet,w=e=>e.querySelector(`.wui-search-toggle`),T=e=>e.querySelector(`.search-input`);function E(e){e.classList.remove(`is-collapsed`),w(e)?.setAttribute(`aria-expanded`,`true`),T(e)?.focus()}function pi(e){T(e)?.value||(e.classList.add(`is-collapsed`),w(e)?.setAttribute(`aria-expanded`,`false`))}function mi(e){if(e.dataset.wuiCollapseWired)return;e.dataset.wuiCollapseWired=`1`;let t=w(e),n=T(e);t?.addEventListener(`click`,()=>E(e)),n?.addEventListener(`keydown`,r=>{r.key!==`Escape`||n.value||(r.preventDefault(),pi(e),t?.focus())}),e.addEventListener(`focusout`,t=>{e.contains(t.relatedTarget)||pi(e)})}function hi(e){fi.has(e)||(fi.add(e),e.addEventListener(`keydown`,t=>{if(t.key!==`/`||t.ctrlKey||t.altKey||t.metaKey||t.defaultPrevented||o(t.target)||t.target?.closest?.(di)||e.querySelector(ui))return;let n=[...e.querySelectorAll(li)].find(e=>e.offsetParent!==null);n&&(t.preventDefault(),E(n))}))}function gi(e=document){for(let t of e.querySelectorAll(li))mi(t);hi(e.ownerDocument??e)}var D=`wuiConfirm`,_i=Object.freeze([`danger`]),O=Object.freeze([`success`,`info`,`warning`,`danger`]),k=`wui.flash`,A=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,j=null,M=null,N=!1,bi=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML},P=(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(D);return e||(e=document.createElement(`div`),e.id=D,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(A.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&&!_i.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(`#${D} is not a confirm dialog with a confirm button. Render <app-confirm-dialog id="${D}"> 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||A.confirmTitle,l.textContent=t,c.textContent=n||A.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),M=i,N=!1,a.getOrCreateInstance(o).show()}var F=(e,t)=>{j=e;try{t()}finally{j=null}};function Ti(e,{title:t,message:n,label:r,tone:i},a){if(i!=null&&!_i.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`},()=>F(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===j||Ei(t)||(e.preventDefault(),e.stopImmediatePropagation(),Ci(t,()=>F(t,()=>t.click())))}function Oi(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!t.hasAttribute(`data-wui-confirm`)||t===j||e.submitter&&e.submitter===j)return;e.preventDefault(),e.stopImmediatePropagation();let n=e.submitter?.form===t?e.submitter:void 0;Ci(t,()=>F(t,()=>t.requestSubmit(n)))}function ki(e){let t=e.target.closest?.(`#${D} [data-app-confirm]`);!t||t.disabled||!M||(N=!0,xi().getOrCreateInstance(t.closest(`#${D}`)).hide())}function Ai(e){if(e.target.id!==`wuiConfirm`)return;let t=N?M:null;M=null,N=!1,t?.()}var ji=(e,t)=>{e&&window.sessionStorage.setItem(k,JSON.stringify({message:e,variant:t}))},Mi=e=>e===`forbidden`?A.forbidden:e===`network`?A.network:A.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 S(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}P(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=>console.error(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=>console.error(e)),window.bootstrap?.Dropdown?.getInstance(t.closest(`.dropdown`)?.querySelector(`[data-bs-toggle='dropdown']`))?.hide())}function Ri(){let e=window.sessionStorage.getItem(k);if(!e)return;window.sessionStorage.removeItem(k);let{message:t,variant:n}=JSON.parse(e);P(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(!O.includes(t))throw TypeError(`data-wui-flash-variant="${t}" is not supported. Use ${O.join(`, `)}.`);let n=e.getAttribute(`data-wui-flash`)||e.textContent.trim();e.remove(),P(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 I=Object.freeze({title:`Leave without saving?`,message:`Your changes on this page are not saved. If you leave now, they are lost.`,leaveLabel:`Leave`}),L=`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`]),R=new WeakMap,Gi=new WeakSet,Ki=e=>`${e.name}:${e.size}:${e.lastModified}`;function z(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(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 B(e){return z(e)}var qi=e=>({saved:e.querySelector(Hi)?null:z(e),engaged:!1,discarded:!1});function Ji(e){let t=R.get(e);return!t||t.discarded||!e.isConnected?!1:t.saved===null||t.engaged&&z(e)!==t.saved}var V=(e,t)=>[...e.querySelectorAll(L)].filter(e=>e!==t&&Ji(e)),Yi=()=>!!window.bootstrap?.Modal;function Xi(e,t,n){let r=t.map(e=>e.getAttribute(`data-wui-unsaved`)).find(Boolean)||I.message;Ti(e,{title:I.title,message:r,label:I.leaveLabel,tone:`danger`},()=>{for(let e of t)R.get(e).discarded=!0;n()})}function Zi(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 Qi(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 $i(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||!Zi(t))return;let n=V(t.ownerDocument,null);!n.length||!Yi()||(e.preventDefault(),Xi(t,n,()=>t.click()))}function ea(e){let t=e.target;if(!(t instanceof HTMLFormElement)||e.defaultPrevented||!Qi(t,e.submitter))return;let n=V(t.ownerDocument,t);if(n.length&&Yi()){e.preventDefault();let r=e.submitter?.form===t?e.submitter:void 0;Xi(t,n,()=>t.requestSubmit(r));return}let r=R.get(t);r&&(r.saved=z(t),r.discarded=!1)}function ta(e){V(document,null).length&&(e.preventDefault(),e.returnValue=``)}function na(e){let t=e.target.closest?.(L),n=t&&R.get(t);!n||n.engaged||(n.saved!==null&&(n.saved=z(t)),n.engaged=!0)}function ra(e){let t=e.target.closest?.(L),n=t&&R.get(t);n&&(n.discarded=!1,e.isTrusted&&(n.engaged=!0))}function ia(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(L))oa(e)}function aa(e=document){let t=e.ownerDocument||e;if(!Gi.has(t)){Gi.add(t);for(let e of[`focusin`,`pointerdown`,`drop`])t.addEventListener(e,na,!0);for(let e of[`input`,`change`])t.addEventListener(e,ra,!0);t.addEventListener(`click`,$i),t.addEventListener(`submit`,ea),t.addEventListener(`wui:modal:success`,ia),t.defaultView.addEventListener(`beforeunload`,ta)}let n=[...e.querySelectorAll?.(L)||[]];e.matches?.(L)&&n.unshift(e);for(let e of n)R.has(e)||R.set(e,qi(e))}function oa(e){if(!(e instanceof HTMLFormElement)||!e.matches(L))throw TypeError(`resetUnsavedChanges: ${String(e)} is not a <form data-wui-unsaved>.`);R.set(e,{saved:z(e),engaged:!1,discarded:!1})}var H=Object.freeze({discard:`Discard`,keep:`Keep editing`}),sa=`wui:drawer:discard`,U=`wui-drawer[confirm-discard]`,W=`.wui-modal-shell`,G=`form[data-wui-confirm-discard]`,K=`.wui-drawer-discard`,ca=`input, select, textarea`,q=new WeakMap,la=new WeakSet,J=new WeakSet;function ua(e,t,n,r){let i=e.createElement(`button`);return i.type=`button`,i.className=t,i.setAttribute(n,``),i.textContent=r,i}function da(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,ua(e,`btn btn-danger btn-sm`,`data-wui-discard-confirm`,H.discard),ua(e,`btn btn-secondary btn-sm`,`data-wui-discard-keep`,H.keep)),n}function fa(e){let t=e.closest?.(U);if(t)return t;let n=e.closest?.(W);return n&&(n.hasAttribute(`confirm-discard`)||n.querySelector(G))?n:null}function Y(e){return e.closest(U)??e.closest(W)}function X(e){return e.matches(U)||e.hasAttribute(`confirm-discard`)?e.querySelectorAll(`form`):e.querySelectorAll(G)}function pa(e){let t=q.get(e);return t!=null&&B(e)!==t}function ma(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-drawer-footer`,e.querySelector(`.wui-drawer-panel`).append(t),J.add(t),t}function ha(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-modal-footer`,(e.querySelector(`.wui-modal-body`)?.parentElement??e.querySelector(`.modal-content`)).append(t),J.add(t),t}function ga(e){e.querySelector(`[data-wui-discard-confirm]`).focus()}function _a(e,t){let n=e.querySelector(K);if(n){ga(n);return}let r=da(e.ownerDocument,t),i;if(e.matches(U))i=e.querySelector(`.wui-drawer-footer`)??ma(e),i.prepend(r);else if(e.hasAttribute(`confirm-discard`))i=e.querySelector(`.wui-modal-footer`)??ha(e),i.prepend(r);else{let t=e.querySelector(G);i=t.querySelector(`.modal-footer`),i?i.prepend(r):(i=t,t.append(r))}i.classList.add(`wui-drawer-discarding`),ga(r)}function Z(e){let t=e.parentElement;e.remove(),t.classList.remove(`wui-drawer-discarding`),J.has(t)&&t.remove()}function va(e){for(let t of X(e)){let e=[...t.querySelectorAll(ca)].find(e=>e.type!==`hidden`&&!e.disabled);if(e){e.focus();return}}}function ya(e){let t=fa(e.target);if(t)for(let e of X(t))q.get(e)??q.set(e,B(e))}function ba(e){let t=e.target;!(t instanceof HTMLFormElement)||!fa(t)||q.set(t,B(t))}function xa(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(`form`))q.delete(e)}function Sa(e){let t=e.target;!(t instanceof Element)||!t.matches(U)||[...X(t)].some(pa)&&(e.preventDefault(),_a(t,t.getAttribute(`confirm-discard`)))}function Ca(e){let t=e.target;if(!(t instanceof Element)||!t.matches(W))return;let n=[...X(t)].find(pa);n&&(e.preventDefault(),_a(t,t.getAttribute(`confirm-discard`)??n.getAttribute(`data-wui-confirm-discard`)))}function wa(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(W);n&&window.bootstrap?.Modal?.getInstance(n)?.hide()}function Ta(e){let t=e.closest(K),n=Y(t);Z(t);for(let e of X(n))q.set(e,B(e));n.dispatchEvent(new CustomEvent(sa,{bubbles:!0})),n.matches(U)?n.hide():window.bootstrap.Modal.getInstance(n).hide()}function Ea(e){let t=e.closest(K),n=Y(t);Z(t),va(n)}function Da(e){let t=e.target,n=t.closest?.(`[data-wui-discard-confirm]`);if(n){Ta(n);return}let r=t.closest?.(`[data-wui-discard-keep]`);if(r){Ea(r);return}let i=t.closest?.(`[data-wui-dismiss]`);i&&wa(i)}function Oa(e){if(e.key!==`Escape`)return;let t=e.currentTarget.querySelector(K);if(!t)return;e.preventDefault(),e.stopPropagation();let n=Y(t);Z(t),va(n)}function ka(e=document){let t=e.ownerDocument||e;la.has(t)||(la.add(t),t.addEventListener(`focusin`,ya),t.addEventListener(`pointerdown`,ya),t.addEventListener(`submit`,ba),t.addEventListener(`wui:modal:success`,xa),t.addEventListener(`wui:modal:loaded`,xa),t.addEventListener(`wui-drawer-close`,Sa,!0),t.addEventListener(`hide.bs.modal`,Ca),t.addEventListener(`click`,Da),t.addEventListener(`keydown`,Oa,!0))}var Aa=`data-wui-bulk-in-bar`,ja=`[data-wui-page-header-bar][data-wui-bulk-for]`,Ma=new WeakSet;function Na(e){return`${b(e,{decimals:0})} selected`}function Pa(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?Na(t):``)}function Fa(e=document){for(let t of e.querySelectorAll(ja))document.getElementById(t.dataset.wuiBulkFor)?.setAttribute(Aa,``);Ma.has(document)||(Ma.add(document),document.addEventListener(`selectionchange`,e=>{if(typeof e.detail?.selected==`number`)for(let t of document.querySelectorAll(ja))document.getElementById(t.dataset.wuiBulkFor)?.contains(e.target)&&Pa(t,e.detail.selected)}))}var Ia=31536e3,Q=new WeakMap,La=e=>e>99?`99+`:String(e);function Ra(e,t,n=document){n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${Ia}; SameSite=Lax`}var za=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 Ba(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=C(),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=La(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?l:`${l}, ${La(o)} unread`),a&&s&&i&&(i.textContent=o===0?`No unread notifications`:`${La(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=za(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 S(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 Va=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Ha=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function Ua(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=C(),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(Ha(o,s,t));if(!(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)){if(e.classList.remove(`is-loading`),n.ok){let e=za(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(Ha(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||Va(e.target)||(e.preventDefault(),v(!0),n.focus())},ee=t=>{e.contains(t.target)||(g(),e.classList.contains(`is-open`)&&v(!1))};document.addEventListener(`keydown`,x),document.addEventListener(`pointerdown`,ee),t.push(()=>{clearTimeout(f),d.abort(),document.removeEventListener(`keydown`,x),document.removeEventListener(`pointerdown`,ee)})}function Wa(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>Ra(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?Ba(r,t):null,a=e.querySelector(`[data-wui-topsearch]`);a&&Ua(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 Ga(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`,Wa(e))}function Ka(e){let t=e?.closest?.(`[data-app-shell]`)??null;return t?(Q.has(t)||Ga(t),Q.get(t)??null):null}function qa(){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)}qa();export{kr as AVATAR_ACCEPT,br as AVATAR_MAX_SIZE_MB,rr as AVATAR_OUTPUT_SIZE,Ir as AVATAR_OUTPUT_TYPE,ti as AVATAR_PREVIEW_SIZES,qr as AVATAR_TEXT,Aa 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,D as CONFIRM_DIALOG_ID,_i 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,ei as DEFAULT_THEME_EFFECT,Kr as DEFAULT_THEME_STORAGE_KEY,sa as DISCARD_EVENT,H as DISCARD_TEXT,ai as DROP_OVER_CLASS,oe as DURATION_UNITS,ee as EMPTY_VALUE,g as FILTER_POPOVER_MAX_CHIPS,k as FLASH_STORAGE_KEY,O as FLASH_VARIANTS,_ 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,ri as SCROLL_EDGE_SELECTOR,ci as SEARCH_OPEN_KEY,Ze as SELECT_ALL_LABEL,Ke as SELECT_CELL_CLASS,c as SELECT_KEY,ct as SELECT_ROW_LABEL,A 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,Zr as THEME_BOOT_SCRIPT_BODY,Br as THEME_CHANGE_EVENT,jr as THEME_EFFECTS,Jr as THEME_EFFECT_DURATION,$r as THEME_MODES,Pr as THEME_SWITCHING_CLASS,et as TOAST_ACTION_METHODS,st as TOAST_ACTION_MS,I 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,Pa as applyBarBulk,Wr as applyTheme,f as ariaKeyShortcuts,lr as attachInputMask,ii as attachRowDrag,oi as attachScrollEdges,ut as attachShiftRange,Qr as avatarCropOptions,Vr as avatarUnreadableMessage,Na as barBulkCountText,ir as buildPasswordRules,Te as clampColumnWidth,qe as classifyStatus,pi as collapseSearch,Ti as confirmAction,Rt as copyTextToClipboard,da as createDiscardPrompt,Yn as createLocalSeenStore,C as createRequestQueue,We as createSelectHeaderCell,Ue as createSelectRowCell,lt as createSelectSpacerCell,qa as defineWeborityElements,Hr as evaluatePassword,B as formValues,v as formatCompact,te as formatCurrency,le as formatDate,y as formatDuration,fr as formatMasked,b as formatNumber,ae as formatPercent,Rn as formatRelativeTime,ne as formatValue,tt as getServerTable,Ka as getShell,He as glyphSvg,we as groupCount,ve as groupItems,On as groupNotificationsByDay,Re as identityCell,n as inShortcutScope,gi as initCollapsibleSearch,ka as initDrawerDiscard,hr as initInputMasks,Fa as initPageBarBulk,At as initRemoteModals,Cr as initRowDrag,Nr as initScrollEdges,Vi as initServerActions,Qe as initServerTables,Ga as initShellParts,aa as initUnsavedChanges,rn as inlineEditText,Mr as isHeicFile,mr as isImageFile,Xr as isImageOnlyAccept,xr as isMaskPattern,pr 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,si as maskedPostValue,Bt as matchSegments,Or as matchesAccept,Ve as measureRows,hn as mentionLabel,_n as mentionTextFromValue,dn as mentionValueFromText,pn as mentionedIds,m as moveFocus,ni as nextTheme,Tn as notificationCountText,Cn as notificationDayHeading,Dn as notificationTime,kn as notificationTriggerLabel,wn as notificationUnreadAnnouncement,E 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,oa 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,Yr as storeTheme,yt as sumKanbanValues,Ge as syncSelectAll,cr as syncTargets,Gr as themeBootScript,zr as themeKeyframes,sr as tickedKeys,x as toInstant,Rr as transitionTheme,Dr as validateFile,De as virtualRange,Ar as watchSystemTheme,Pt as withTrustedLabel,me as writeColumnWidths,vt as writeKanbanCollapsed,S as wuiFetch};
1
+ import{n as e}from"./elementBase-BlsR4tqa.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-BD8kwDfx.js";import{a as _,c as v,d as y,f as b,h as x,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-CUm_mfze.js";import{C as Ue,S as We,T as Ge,_ as Ke,a as qe,b as Je,c as S,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 C,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-0pGmgUIV.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-C0RiKTUx.js";import{n as Mt,t as Nt}from"./statusIcons-2X4iGkKL.js";import{o as Pt}from"./optionLabel-BBaur8Bs.js";import{t as Ft}from"./WuiAutocomplete-CYpMjHs3.js";import{t as It}from"./WuiCarousel-C33Z8FBt.js";import{t as Lt}from"./WuiCodeBlock-BcLJhLBJ.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-CcmFOWNc.js";import{i as Ht,n as Ut,r as Wt,t as Gt}from"./WuiCommentThread-BHtcGLX0.js";import{t as Kt}from"./WuiConsentBanner-jdTxzdJs.js";import{t as qt}from"./WuiContextMenu-BLNKaFsB.js";import{t as Jt}from"./WuiSelect-DJgzL9Z_.js";import{t as Yt}from"./WuiCountrySelect-DlmQ6qeN.js";import{t as Xt}from"./WuiDataTable-Bqs6FW2t.js";import{t as Zt}from"./WuiDatePicker-CpRYPtYz.js";import{t as Qt}from"./WuiDateRange-h4lDtS-H.js";import{t as $t}from"./WuiDock-BD2HgMmP.js";import{t as en}from"./WuiDrawer-D6K2eRlW.js";import{t as tn}from"./WuiHoverCard-Ql6CD3BL.js";import{t as nn}from"./WuiImageCrop-Cr3D2iPo.js";import{a as rn,i as an,n as on,r as sn,t as cn}from"./WuiInlineEdit-2XnVPzY-.js";import{t as ln}from"./WuiLightbox-hluak_-q.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-BxYXpBRt.js";import{t as bn}from"./WuiMenubar-4MOZ51R_.js";import{t as xn}from"./WuiMultiSelect-CBbY_sPD.js";import{t as Sn}from"./WuiNavigationMenu-BsLnvz2Y.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-pYmoU0g6.js";import{t as jn}from"./WuiNotificationCenter-BLsM1WkE.js";import{t as Mn}from"./WuiOnboardingChecklist-s2DG6PZ0.js";import{t as Nn}from"./WuiOtp-BbO_75RB.js";import{t as Pn}from"./WuiOverflow-Ixc3PRuW.js";import{t as Fn}from"./WuiPhone-BfM_ttOi.js";import{t as In}from"./WuiRating-BzeW6iDC.js";import{t as Ln}from"./WuiRecordPager-yXv4g2ZR.js";import{n as Rn,r as zn,t as Bn}from"./WuiRelativeTime-Cfc8TMd8.js";import{t as Vn}from"./WuiResizable-m2Ypa-zD.js";import{t as Hn}from"./WuiRollingNumber-DBgi_3l7.js";import{t as Un}from"./WuiShortcuts-CMibF1XM.js";import{t as Wn}from"./WuiShowMore-Bu7IQcXS.js";import{t as Gn}from"./WuiSlider-Br6V2amU.js";import{t as Kn}from"./WuiSortable-Bd7Fz5Ox.js";import{t as qn}from"./WuiTagInput-DQ79rmjZ.js";import{t as Jn}from"./WuiTimePicker-BIhwlHuA.js";import{n as Yn,t as Xn}from"./WuiTour-Bi_0ayiH.js";import{t as Zn}from"./WuiTree-BSx5pKJo.js";import{t as Qn}from"./WuiTruncate-BLl2u3b-.js";import{n as $n,t as er}from"./WuiWhatsNew-68sOQOTO.js";import{n as tr,t as nr}from"./WuiWizardStep-DtA3nVPi.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,p as Yr,q as Xr,r as Zr,rt as Qr,s as $r,t as ei,tt as ti,u as ni,v as ri,w as ii,x as ai,y as oi,z as si}from"./themeTransition-QXpGgIMc.js";var ci=`/`,li=`.search-wrap.wui-search-collapsible`,ui=`.wui-topsearch-panel`,di=`.modal, wui-drawer[open]`,fi=new WeakSet,w=e=>e.querySelector(`.wui-search-toggle`),T=e=>e.querySelector(`.search-input`);function E(e){e.classList.remove(`is-collapsed`),w(e)?.setAttribute(`aria-expanded`,`true`),T(e)?.focus()}function pi(e){T(e)?.value||(e.classList.add(`is-collapsed`),w(e)?.setAttribute(`aria-expanded`,`false`))}function mi(e){if(e.dataset.wuiCollapseWired)return;e.dataset.wuiCollapseWired=`1`;let t=w(e),n=T(e);t?.addEventListener(`click`,()=>E(e)),n?.addEventListener(`keydown`,r=>{r.key!==`Escape`||n.value||(r.preventDefault(),pi(e),t?.focus())}),e.addEventListener(`focusout`,t=>{e.contains(t.relatedTarget)||pi(e)})}function hi(e){fi.has(e)||(fi.add(e),e.addEventListener(`keydown`,t=>{if(t.key!==`/`||t.ctrlKey||t.altKey||t.metaKey||t.defaultPrevented||o(t.target)||t.target?.closest?.(di)||e.querySelector(ui))return;let n=[...e.querySelectorAll(li)].find(e=>e.offsetParent!==null);n&&(t.preventDefault(),E(n))}))}function gi(e=document){for(let t of e.querySelectorAll(li))mi(t);hi(e.ownerDocument??e)}var D=`wuiConfirm`,_i=Object.freeze([`danger`]),O=Object.freeze([`success`,`info`,`warning`,`danger`]),k=`wui.flash`,A=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,j=null,M=null,N=!1,bi=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML},P=(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(D);return e||(e=document.createElement(`div`),e.id=D,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(A.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&&!_i.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(`#${D} is not a confirm dialog with a confirm button. Render <app-confirm-dialog id="${D}"> 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||A.confirmTitle,l.textContent=t,c.textContent=n||A.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),M=i,N=!1,a.getOrCreateInstance(o).show()}var F=(e,t)=>{j=e;try{t()}finally{j=null}};function Ti(e,{title:t,message:n,label:r,tone:i},a){if(i!=null&&!_i.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`},()=>F(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===j||Ei(t)||(e.preventDefault(),e.stopImmediatePropagation(),Ci(t,()=>F(t,()=>t.click())))}function Oi(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!t.hasAttribute(`data-wui-confirm`)||t===j||e.submitter&&e.submitter===j)return;e.preventDefault(),e.stopImmediatePropagation();let n=e.submitter?.form===t?e.submitter:void 0;Ci(t,()=>F(t,()=>t.requestSubmit(n)))}function ki(e){let t=e.target.closest?.(`#${D} [data-app-confirm]`);!t||t.disabled||!M||(N=!0,xi().getOrCreateInstance(t.closest(`#${D}`)).hide())}function Ai(e){if(e.target.id!==`wuiConfirm`)return;let t=N?M:null;M=null,N=!1,t?.()}var ji=(e,t)=>{e&&window.sessionStorage.setItem(k,JSON.stringify({message:e,variant:t}))},Mi=e=>e===`forbidden`?A.forbidden:e===`network`?A.network:A.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 S(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}P(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=>console.error(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=>console.error(e)),window.bootstrap?.Dropdown?.getInstance(t.closest(`.dropdown`)?.querySelector(`[data-bs-toggle='dropdown']`))?.hide())}function Ri(){let e=window.sessionStorage.getItem(k);if(!e)return;window.sessionStorage.removeItem(k);let{message:t,variant:n}=JSON.parse(e);P(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(!O.includes(t))throw TypeError(`data-wui-flash-variant="${t}" is not supported. Use ${O.join(`, `)}.`);let n=e.getAttribute(`data-wui-flash`)||e.textContent.trim();e.remove(),P(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 I=Object.freeze({title:`Leave without saving?`,message:`Your changes on this page are not saved. If you leave now, they are lost.`,leaveLabel:`Leave`}),L=`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`]),R=new WeakMap,Gi=new WeakSet,Ki=e=>`${e.name}:${e.size}:${e.lastModified}`;function z(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(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 B(e){return z(e)}var qi=e=>({saved:e.querySelector(Hi)?null:z(e),engaged:!1,discarded:!1});function Ji(e){let t=R.get(e);return!t||t.discarded||!e.isConnected?!1:t.saved===null||t.engaged&&z(e)!==t.saved}var V=(e,t)=>[...e.querySelectorAll(L)].filter(e=>e!==t&&Ji(e)),Yi=()=>!!window.bootstrap?.Modal;function Xi(e,t,n){let r=t.map(e=>e.getAttribute(`data-wui-unsaved`)).find(Boolean)||I.message;Ti(e,{title:I.title,message:r,label:I.leaveLabel,tone:`danger`},()=>{for(let e of t)R.get(e).discarded=!0;n()})}function Zi(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 Qi(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 $i(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||!Zi(t))return;let n=V(t.ownerDocument,null);!n.length||!Yi()||(e.preventDefault(),Xi(t,n,()=>t.click()))}function ea(e){let t=e.target;if(!(t instanceof HTMLFormElement)||e.defaultPrevented||!Qi(t,e.submitter))return;let n=V(t.ownerDocument,t);if(n.length&&Yi()){e.preventDefault();let r=e.submitter?.form===t?e.submitter:void 0;Xi(t,n,()=>t.requestSubmit(r));return}let r=R.get(t);r&&(r.saved=z(t),r.discarded=!1)}function ta(e){V(document,null).length&&(e.preventDefault(),e.returnValue=``)}function na(e){let t=e.target.closest?.(L),n=t&&R.get(t);!n||n.engaged||(n.saved!==null&&(n.saved=z(t)),n.engaged=!0)}function ra(e){let t=e.target.closest?.(L),n=t&&R.get(t);n&&(n.discarded=!1,e.isTrusted&&(n.engaged=!0))}function ia(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(L))oa(e)}function aa(e=document){let t=e.ownerDocument||e;if(!Gi.has(t)){Gi.add(t);for(let e of[`focusin`,`pointerdown`,`drop`])t.addEventListener(e,na,!0);for(let e of[`input`,`change`])t.addEventListener(e,ra,!0);t.addEventListener(`click`,$i),t.addEventListener(`submit`,ea),t.addEventListener(`wui:modal:success`,ia),t.defaultView.addEventListener(`beforeunload`,ta)}let n=[...e.querySelectorAll?.(L)||[]];e.matches?.(L)&&n.unshift(e);for(let e of n)R.has(e)||R.set(e,qi(e))}function oa(e){if(!(e instanceof HTMLFormElement)||!e.matches(L))throw TypeError(`resetUnsavedChanges: ${String(e)} is not a <form data-wui-unsaved>.`);R.set(e,{saved:z(e),engaged:!1,discarded:!1})}var H=Object.freeze({discard:`Discard`,keep:`Keep editing`}),sa=`wui:drawer:discard`,U=`wui-drawer[confirm-discard]`,W=`.wui-modal-shell`,G=`form[data-wui-confirm-discard]`,K=`.wui-drawer-discard`,ca=`input, select, textarea`,q=new WeakMap,la=new WeakSet,J=new WeakSet;function ua(e,t,n,r){let i=e.createElement(`button`);return i.type=`button`,i.className=t,i.setAttribute(n,``),i.textContent=r,i}function da(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,ua(e,`btn btn-danger btn-sm`,`data-wui-discard-confirm`,H.discard),ua(e,`btn btn-secondary btn-sm`,`data-wui-discard-keep`,H.keep)),n}function fa(e){let t=e.closest?.(U);if(t)return t;let n=e.closest?.(W);return n&&(n.hasAttribute(`confirm-discard`)||n.querySelector(G))?n:null}function Y(e){return e.closest(U)??e.closest(W)}function X(e){return e.matches(U)||e.hasAttribute(`confirm-discard`)?e.querySelectorAll(`form`):e.querySelectorAll(G)}function pa(e){let t=q.get(e);return t!=null&&B(e)!==t}function ma(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-drawer-footer`,e.querySelector(`.wui-drawer-panel`).append(t),J.add(t),t}function ha(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-modal-footer`,(e.querySelector(`.wui-modal-body`)?.parentElement??e.querySelector(`.modal-content`)).append(t),J.add(t),t}function ga(e){e.querySelector(`[data-wui-discard-confirm]`).focus()}function _a(e,t){let n=e.querySelector(K);if(n){ga(n);return}let r=da(e.ownerDocument,t),i;if(e.matches(U))i=e.querySelector(`.wui-drawer-footer`)??ma(e),i.prepend(r);else if(e.hasAttribute(`confirm-discard`))i=e.querySelector(`.wui-modal-footer`)??ha(e),i.prepend(r);else{let t=e.querySelector(G);i=t.querySelector(`.modal-footer`),i?i.prepend(r):(i=t,t.append(r))}i.classList.add(`wui-drawer-discarding`),ga(r)}function Z(e){let t=e.parentElement;e.remove(),t.classList.remove(`wui-drawer-discarding`),J.has(t)&&t.remove()}function va(e){for(let t of X(e)){let e=[...t.querySelectorAll(ca)].find(e=>e.type!==`hidden`&&!e.disabled);if(e){e.focus();return}}}function ya(e){let t=fa(e.target);if(t)for(let e of X(t))q.get(e)??q.set(e,B(e))}function ba(e){let t=e.target;!(t instanceof HTMLFormElement)||!fa(t)||q.set(t,B(t))}function xa(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(`form`))q.delete(e)}function Sa(e){let t=e.target;!(t instanceof Element)||!t.matches(U)||[...X(t)].some(pa)&&(e.preventDefault(),_a(t,t.getAttribute(`confirm-discard`)))}function Ca(e){let t=e.target;if(!(t instanceof Element)||!t.matches(W))return;let n=[...X(t)].find(pa);n&&(e.preventDefault(),_a(t,t.getAttribute(`confirm-discard`)??n.getAttribute(`data-wui-confirm-discard`)))}function wa(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(W);n&&window.bootstrap?.Modal?.getInstance(n)?.hide()}function Ta(e){let t=e.closest(K),n=Y(t);Z(t);for(let e of X(n))q.set(e,B(e));n.dispatchEvent(new CustomEvent(sa,{bubbles:!0})),n.matches(U)?n.hide():window.bootstrap.Modal.getInstance(n).hide()}function Ea(e){let t=e.closest(K),n=Y(t);Z(t),va(n)}function Da(e){let t=e.target,n=t.closest?.(`[data-wui-discard-confirm]`);if(n){Ta(n);return}let r=t.closest?.(`[data-wui-discard-keep]`);if(r){Ea(r);return}let i=t.closest?.(`[data-wui-dismiss]`);i&&wa(i)}function Oa(e){if(e.key!==`Escape`)return;let t=e.currentTarget.querySelector(K);if(!t)return;e.preventDefault(),e.stopPropagation();let n=Y(t);Z(t),va(n)}function ka(e=document){let t=e.ownerDocument||e;la.has(t)||(la.add(t),t.addEventListener(`focusin`,ya),t.addEventListener(`pointerdown`,ya),t.addEventListener(`submit`,ba),t.addEventListener(`wui:modal:success`,xa),t.addEventListener(`wui:modal:loaded`,xa),t.addEventListener(`wui-drawer-close`,Sa,!0),t.addEventListener(`hide.bs.modal`,Ca),t.addEventListener(`click`,Da),t.addEventListener(`keydown`,Oa,!0))}var Aa=`data-wui-bulk-in-bar`,ja=`[data-wui-page-header-bar][data-wui-bulk-for]`,Ma=new WeakSet;function Na(e){return`${b(e,{decimals:0})} selected`}function Pa(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?Na(t):``)}function Fa(e=document){for(let t of e.querySelectorAll(ja))document.getElementById(t.dataset.wuiBulkFor)?.setAttribute(Aa,``);Ma.has(document)||(Ma.add(document),document.addEventListener(`selectionchange`,e=>{if(typeof e.detail?.selected==`number`)for(let t of document.querySelectorAll(ja))document.getElementById(t.dataset.wuiBulkFor)?.contains(e.target)&&Pa(t,e.detail.selected)}))}var Ia=31536e3,Q=new WeakMap,La=e=>e>99?`99+`:String(e);function Ra(e,t,n=document){n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${Ia}; SameSite=Lax`}var za=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 Ba(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=C(),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=La(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?l:`${l}, ${La(o)} unread`),a&&s&&i&&(i.textContent=o===0?`No unread notifications`:`${La(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=za(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 S(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 Va=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Ha=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function Ua(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=C(),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(Ha(o,s,t));if(!(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)){if(e.classList.remove(`is-loading`),n.ok){let e=za(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(Ha(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||Va(e.target)||(e.preventDefault(),v(!0),n.focus())},ee=t=>{e.contains(t.target)||(g(),e.classList.contains(`is-open`)&&v(!1))};document.addEventListener(`keydown`,x),document.addEventListener(`pointerdown`,ee),t.push(()=>{clearTimeout(f),d.abort(),document.removeEventListener(`keydown`,x),document.removeEventListener(`pointerdown`,ee)})}function Wa(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>Ra(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?Ba(r,t):null,a=e.querySelector(`[data-wui-topsearch]`);a&&Ua(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 Ga(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`,Wa(e))}function Ka(e){let t=e?.closest?.(`[data-app-shell]`)??null;return t?(Q.has(t)||Ga(t),Q.get(t)??null):null}function qa(){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)}qa();export{kr as AVATAR_ACCEPT,br as AVATAR_MAX_SIZE_MB,rr as AVATAR_OUTPUT_SIZE,Ir as AVATAR_OUTPUT_TYPE,ti as AVATAR_PREVIEW_SIZES,qr as AVATAR_TEXT,Aa 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,D as CONFIRM_DIALOG_ID,_i 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,ei as DEFAULT_THEME_EFFECT,Kr as DEFAULT_THEME_STORAGE_KEY,sa as DISCARD_EVENT,H as DISCARD_TEXT,ai as DROP_OVER_CLASS,oe as DURATION_UNITS,ee as EMPTY_VALUE,g as FILTER_POPOVER_MAX_CHIPS,k as FLASH_STORAGE_KEY,O as FLASH_VARIANTS,_ 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,ri as SCROLL_EDGE_SELECTOR,ci as SEARCH_OPEN_KEY,Ze as SELECT_ALL_LABEL,Ke as SELECT_CELL_CLASS,c as SELECT_KEY,ct as SELECT_ROW_LABEL,A 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,Zr as THEME_BOOT_SCRIPT_BODY,Br as THEME_CHANGE_EVENT,jr as THEME_EFFECTS,Jr as THEME_EFFECT_DURATION,$r as THEME_MODES,Pr as THEME_SWITCHING_CLASS,et as TOAST_ACTION_METHODS,st as TOAST_ACTION_MS,I 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,Pa as applyBarBulk,Wr as applyTheme,f as ariaKeyShortcuts,lr as attachInputMask,ii as attachRowDrag,oi as attachScrollEdges,ut as attachShiftRange,Qr as avatarCropOptions,Vr as avatarUnreadableMessage,Na as barBulkCountText,ir as buildPasswordRules,Te as clampColumnWidth,qe as classifyStatus,pi as collapseSearch,Ti as confirmAction,Rt as copyTextToClipboard,da as createDiscardPrompt,Yn as createLocalSeenStore,C as createRequestQueue,We as createSelectHeaderCell,Ue as createSelectRowCell,lt as createSelectSpacerCell,qa as defineWeborityElements,Hr as evaluatePassword,B as formValues,v as formatCompact,te as formatCurrency,le as formatDate,y as formatDuration,fr as formatMasked,b as formatNumber,ae as formatPercent,Rn as formatRelativeTime,ne as formatValue,tt as getServerTable,Ka as getShell,He as glyphSvg,we as groupCount,ve as groupItems,On as groupNotificationsByDay,Re as identityCell,n as inShortcutScope,gi as initCollapsibleSearch,ka as initDrawerDiscard,hr as initInputMasks,Fa as initPageBarBulk,At as initRemoteModals,Cr as initRowDrag,Nr as initScrollEdges,Vi as initServerActions,Qe as initServerTables,Ga as initShellParts,aa as initUnsavedChanges,rn as inlineEditText,Mr as isHeicFile,mr as isImageFile,Xr as isImageOnlyAccept,xr as isMaskPattern,pr 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,si as maskedPostValue,Bt as matchSegments,Or as matchesAccept,Ve as measureRows,hn as mentionLabel,_n as mentionTextFromValue,dn as mentionValueFromText,pn as mentionedIds,m as moveFocus,ni as nextTheme,Tn as notificationCountText,Cn as notificationDayHeading,Dn as notificationTime,kn as notificationTriggerLabel,wn as notificationUnreadAnnouncement,E 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,oa 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,Yr as storeTheme,yt as sumKanbanValues,Ge as syncSelectAll,cr as syncTargets,Gr as themeBootScript,zr as themeKeyframes,sr as tickedKeys,x as toInstant,Rr as transitionTheme,Dr as validateFile,De as virtualRange,Ar as watchSystemTheme,Pt as withTrustedLabel,me as writeColumnWidths,vt as writeKanbanCollapsed,S as wuiFetch};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-elements",
3
- "version": "0.75.0",
3
+ "version": "0.76.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",
@@ -1 +0,0 @@
1
- import{t as e}from"./elementBase-BlsR4tqa.js";import{t}from"./tourOpenMark-nPeAJFSo.js";var n={"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-ink":`#4F46E5`,"--color-primary-text":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-surface":`#FFFFFF`,"--wui-radius-lg":`14px`,"--wui-shadow-overlay-lg":`0 24px 60px -16px rgba(7, 20, 55, 0.28)`,"--wui-z-fixed":`1030`},r=e=>`var(${e}, ${n[e]})`,i=` :host { all: initial; position: fixed; bottom: 20px; left: 20px; right: auto; z-index: ${r(`--wui-z-fixed`)}; display: block; width: 420px; max-width: calc(100vw - 40px); font-family: inherit; font-size: 16px; line-height: 1.5; color: ${r(`--color-text`)}; } :host([position="bottom-right"]) { right: 20px; left: auto; } :host(:not([open])) { pointer-events: none; } :host([tour-open]) { visibility: hidden; } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .wui-consent-banner-panel { padding: 20px; background: ${r(`--color-surface`)}; border: 1px solid ${r(`--color-border`)}; border-radius: ${r(`--wui-radius-lg`)}; box-shadow: ${r(`--wui-shadow-overlay-lg`)}; text-align: start; pointer-events: auto; } .wui-consent-banner-heading { margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.3; color: ${r(`--color-text`)}; } .wui-consent-banner-description { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: ${r(`--color-text-muted`)}; } .wui-consent-banner-policy { color: ${r(`--color-primary-ink`)}; font-weight: 500; } .wui-consent-banner-settings { display: grid; gap: 12px; max-height: 50vh; margin: 0 0 16px; padding: 12px 0; overflow-y: auto; border-top: 1px solid ${r(`--color-border`)}; border-bottom: 1px solid ${r(`--color-border`)}; } .wui-consent-banner-category-description { margin: 2px 0 0; padding-inline-start: 2.5em; font-size: 12px; line-height: 1.4; color: ${r(`--color-text-muted`)}; } .form-check { display: flex; align-items: center; gap: 0.5em; margin: 0; font-size: 14px; } .form-check-input { appearance: none; flex: none; width: 2em; height: 1em; margin: 0; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2em; background: ${r(`--color-surface`)} radial-gradient(circle, rgba(0, 0, 0, 0.25) 0.35em, transparent 0.4em) left / 1em 1em no-repeat; cursor: pointer; transition: background-position 0.15s ease-in-out; } .form-check-input:checked { border-color: ${r(`--color-primary`)}; background: ${r(`--color-primary`)} radial-gradient(circle, #fff 0.35em, transparent 0.4em) right / 1em 1em no-repeat; } .form-check-input:disabled { opacity: 0.5; cursor: default; } .form-check-input:focus-visible { outline: 2px solid ${r(`--color-primary`)}; outline-offset: 2px; } .form-check-label { cursor: pointer; } .wui-consent-banner-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; } .btn { display: inline-block; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid ${r(`--color-primary`)}; outline-offset: 2px; } .btn-primary { background: ${r(`--color-primary`)}; border-color: ${r(`--color-primary`)}; color: ${r(`--color-primary-text`)}; } .btn-primary:hover { background: ${r(`--color-primary-hover`)}; border-color: ${r(`--color-primary-hover`)}; } .btn-outline-secondary { border-color: ${r(`--color-text-muted`)}; color: ${r(`--color-text-muted`)}; } .btn-outline-secondary:hover { background: ${r(`--color-bg-muted`)}; color: ${r(`--color-text`)}; } .btn-link { font-weight: 400; color: ${r(`--color-primary-ink`)}; text-decoration: underline; } .btn-link:hover { color: ${r(`--color-primary-hover`)}; } .wui-consent-banner-settings-toggle { margin-inline-end: auto; padding-inline: 0; } .wui-consent-banner-save { flex: 1 1 100%; } @media (max-width: 575.98px) { :host, :host([position="bottom-right"]) { left: 0; right: 0; bottom: 0; width: auto; max-width: none; } .wui-consent-banner-panel { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-width: 1px 0 0; border-radius: 0; } /* Hidden on phones, but it stays the dialog's accessible name. */ .wui-consent-banner-heading { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } .wui-consent-banner-description { margin: 0 0 8px; font-size: 13px; line-height: 1.4; } .wui-consent-banner-actions { gap: 6px; } } `,a=`wui-consent-save`,o=`[data-consent-settings]`,s=`tour-open`,c={heading:`Cookies on this site`,description:`We use cookies to understand how the site is used and to measure our campaigns. You can change your choice at any time.`,policyLabel:`Cookie policy`,essentialLabel:`Essential cookies`,essentialDescription:`Required for the site to work and stay secure. Always on.`,analyticsLabel:`Analytics cookies`,analyticsDescription:`Help us understand how visitors use the site.`,functionalLabel:`Functional cookies`,functionalDescription:`Remember choices you make, such as your preferences.`,marketingLabel:`Marketing cookies`,marketingDescription:`Measure how well our campaigns work.`,settingsLabel:`Cookie settings`,rejectLabel:`Reject all`,acceptLabel:`Accept all`,saveLabel:`Save preferences`},l=[`analytics`,`functional`,`marketing`],u={analytics:{label:c.analyticsLabel,description:`analyticsDescription`},functional:{label:c.functionalLabel,description:`functionalDescription`},marketing:{label:c.marketingLabel,description:`marketingDescription`}},d=new Set;function f(e){d.has(e)||(d.add(e),console.warn(`[@webority/ui-elements] <wui-consent-banner> received categories containing "${e}", which is not one of ${l.map(e=>`"${e}"`).join(` | `)}. It is ignored.`))}var p=0,m=class extends e{static get observedAttributes(){return[`heading`,`description`,`policy-href`,`policy-label`,`analytics-description`,`functional-description`,`marketing-description`,`categories`]}constructor(){super(),p+=1,this._uid=`wui-consent-${p}`,this._preferences={analytics:!1,functional:!1,marketing:!1},this._settings=!1,this._onDocumentClick=e=>{e.target instanceof Element&&e.target.closest(o)&&(e.preventDefault(),this.open({settings:!0,focus:!0}))},this._tourWatch=null}get position(){return this.getAttribute(`position`)===`bottom-right`?`bottom-right`:`bottom-left`}set position(e){this.setAttribute(`position`,String(e??`bottom-left`))}get standalone(){return this.hasAttribute(`standalone`)}set standalone(e){this.toggleAttribute(`standalone`,e===!0||e===``||e===`true`)}get heading(){return this.getAttribute(`heading`)||c.heading}set heading(e){this.setAttribute(`heading`,String(e??``))}get description(){return this.getAttribute(`description`)||c.description}set description(e){this.setAttribute(`description`,String(e??``))}get policyHref(){return this.getAttribute(`policy-href`)||``}set policyHref(e){this.setAttribute(`policy-href`,String(e??``))}get policyLabel(){return this.getAttribute(`policy-label`)||c.policyLabel}set policyLabel(e){this.setAttribute(`policy-label`,String(e??``))}get analyticsDescription(){return this.getAttribute(`analytics-description`)||c.analyticsDescription}set analyticsDescription(e){this.setAttribute(`analytics-description`,String(e??``))}get functionalDescription(){return this.getAttribute(`functional-description`)||c.functionalDescription}set functionalDescription(e){this.setAttribute(`functional-description`,String(e??``))}get marketingDescription(){return this.getAttribute(`marketing-description`)||c.marketingDescription}set marketingDescription(e){this.setAttribute(`marketing-description`,String(e??``))}get categories(){let e=this.getAttribute(`categories`);if(!e?.trim())return[...l];let t=e.split(/\s+/).filter(Boolean);for(let e of t)l.includes(e)||f(e);let n=l.filter(e=>t.includes(e));return n.length?n:[...l]}set categories(e){e==null?this.removeAttribute(`categories`):this.setAttribute(`categories`,Array.isArray(e)?e.join(` `):String(e))}get preferences(){let e=this.categories;return Object.fromEntries(l.map(t=>[t,e.includes(t)&&this._preferences[t]]))}set preferences(e){this._preferences={analytics:e?.analytics===!0,functional:e?.functional===!0,marketing:e?.marketing===!0},this._applyPreferences()}get isOpen(){return this.hasAttribute(`open`)}connectedCallback(){this._rendered||this.render(),document.addEventListener(`click`,this._onDocumentClick),this._syncTour(),this._tourWatch??=new MutationObserver(()=>this._syncTour()),this._tourWatch.observe(document.documentElement,{attributes:!0,attributeFilter:[t]})}disconnectedCallback(){document.removeEventListener(`click`,this._onDocumentClick),this._tourWatch?.disconnect()}_syncTour(){this.toggleAttribute(s,document.documentElement.hasAttribute(t))}attributeChangedCallback(){this._rendered&&this.render()}render(){let e=this.isOpen,t=this._uid,n=this.policyHref?` <a class="wui-consent-banner-policy" href="${_(this.policyHref)}">${g(this.policyLabel)}</a>`:``,r=this._root();r.innerHTML=`${r===this?``:`<style>${i}</style>`} <div class="wui-consent-banner-panel" role="dialog" aria-labelledby="${t}-heading" aria-describedby="${t}-description" hidden> <h2 class="wui-consent-banner-heading" id="${t}-heading">${g(this.heading)}</h2> <p class="wui-consent-banner-description" id="${t}-description">${g(this.description)}${n}</p> <div class="wui-consent-banner-settings" hidden> ${h(t,`essential`,c.essentialLabel,c.essentialDescription,!0)} ${this.categories.map(e=>h(t,e,u[e].label,this[u[e].description],!1)).join(` `)} </div> <div class="wui-consent-banner-actions"> <button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${c.settingsLabel}</button> <button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${c.rejectLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${c.acceptLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${c.saveLabel}</button> </div> </div>`,this._rendered=!0,this._wire(),this._applyPreferences(),this._showSettings(this._settings),e&&(this._panel().hidden=!1)}open({settings:e=!1,focus:t=!1}={}){this._rendered||this.render(),this._applyPreferences(),this._showSettings(e),this._panel().hidden=!1,this.setAttribute(`open`,``),t&&(e?this._root().querySelector(`.wui-consent-banner-category input:not([disabled])`):this._root().querySelector(`.wui-consent-banner-accept`))?.focus()}close(){let e=this._panel();e&&(e.hidden=!0),this.removeAttribute(`open`),this._showSettings(!1)}_root(){return this.shadowRoot?this.shadowRoot:this.standalone?this.attachShadow({mode:`open`}):this}_panel(){return this._root().querySelector(`.wui-consent-banner-panel`)}_wire(){let e=this._root();e.querySelector(`.wui-consent-banner-accept`)?.addEventListener(`click`,()=>this._save(this._choiceForShown(!0))),e.querySelector(`.wui-consent-banner-reject`)?.addEventListener(`click`,()=>this._save(this._choiceForShown(!1))),e.querySelector(`.wui-consent-banner-save`)?.addEventListener(`click`,()=>this._save(this._switchValues())),e.querySelector(`.wui-consent-banner-settings-toggle`)?.addEventListener(`click`,()=>this._showSettings(!this._settings))}_save(e){this._preferences={...e},this.dispatchEvent(new CustomEvent(a,{bubbles:!0,composed:!0,detail:{...e}})),this.close()}_choiceForShown(e){let t=this.categories;return Object.fromEntries(l.map(n=>[n,e&&t.includes(n)]))}_switchValues(){let e={};for(let t of l)e[t]=this._root().querySelector(`input[data-category="${t}"]`)?.checked===!0;return e}_applyPreferences(){for(let e of l){let t=this._root().querySelector(`input[data-category="${e}"]`);t&&(t.checked=this._preferences[e])}}_showSettings(e){this._settings=e;let t=this._root(),n=t.querySelector(`.wui-consent-banner-settings`);if(!n)return;n.hidden=!e,t.querySelector(`.wui-consent-banner-settings-toggle`)?.setAttribute(`aria-expanded`,e?`true`:`false`);let r=t.querySelector(`.wui-consent-banner-save`);r&&(r.hidden=!e);for(let n of[`.wui-consent-banner-reject`,`.wui-consent-banner-accept`]){let r=t.querySelector(n);r&&(r.hidden=e)}}};function h(e,t,n,r,i){let a=`${e}-${t}`;return`<div class="wui-consent-banner-category"> <div class="form-check form-switch"> <input class="form-check-input" type="checkbox" role="switch" id="${a}" data-category="${t}"${i?` checked disabled`:``} /> <label class="form-check-label" for="${a}">${g(n)}</label> </div> <p class="wui-consent-banner-category-description">${g(r)}</p> </div>`}var g=e=>String(e??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),_=e=>String(e??``).replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`);export{m as t};