@webority/ui-elements 0.186.1 → 0.187.1
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.
- package/dist/WuiSelect-C1NNAsFQ.js +1 -0
- package/dist/{chips-DxSWAJDI.js → chips-DtDYq3XM.js} +1 -1
- package/dist/{country-T7AfpJpN.js → country-BySxiqti.js} +1 -1
- package/dist/elements/select.js +1 -1
- package/dist/{recents-B9efQ1Au.js → recents-Da5C5_lV.js} +1 -1
- package/dist/search-BAgNDqG2.js +1 -0
- package/dist/search.g-chn0itlW.js +1 -0
- package/dist/text/en.json +3 -0
- package/dist/text.js +1 -1
- package/dist/ui-elements/calendar-views.global.js +1 -1
- package/dist/ui-elements/carousel.global.js +1 -1
- package/dist/ui-elements/code-block.global.js +1 -1
- package/dist/ui-elements/command-palette.global.js +1 -1
- package/dist/ui-elements/comment-thread.global.js +1 -1
- package/dist/ui-elements/consent-banner.global.js +1 -1
- package/dist/ui-elements/context-menu.global.js +1 -1
- package/dist/ui-elements/dashboard-grid.global.js +1 -1
- package/dist/ui-elements/data-table.global.js +1 -1
- package/dist/ui-elements/date-range.global.js +1 -1
- package/dist/ui-elements/date-time.global.js +1 -1
- package/dist/ui-elements/datepicker.global.js +1 -1
- package/dist/ui-elements/dock.global.js +1 -1
- package/dist/ui-elements/drawer.global.js +1 -1
- package/dist/ui-elements/dropdown.global.js +1 -1
- package/dist/ui-elements/entry-grid.global.js +1 -1
- package/dist/ui-elements/gantt.global.js +1 -1
- package/dist/ui-elements/glyphs.global.js +1 -1
- package/dist/ui-elements/hover-card.global.js +1 -1
- package/dist/ui-elements/image-crop.global.js +1 -1
- package/dist/ui-elements/inline-edit.global.js +1 -1
- package/dist/ui-elements/kanban.global.js +1 -1
- package/dist/ui-elements/lead-popup.global.js +1 -1
- package/dist/ui-elements/lightbox.global.js +1 -1
- package/dist/ui-elements/markdown.global.js +1 -1
- package/dist/ui-elements/mini-calendar.global.js +1 -1
- package/dist/ui-elements/navigation-menu.global.js +1 -1
- package/dist/ui-elements/notification-center.global.js +1 -1
- package/dist/ui-elements/offline-banner.global.js +1 -1
- package/dist/ui-elements/onboarding-checklist.global.js +1 -1
- package/dist/ui-elements/org-tree.global.js +1 -1
- package/dist/ui-elements/otp.global.js +1 -1
- package/dist/ui-elements/overflow.global.js +1 -1
- package/dist/ui-elements/phone.global.js +1 -1
- package/dist/ui-elements/popover.global.js +1 -1
- package/dist/ui-elements/rating.global.js +1 -1
- package/dist/ui-elements/record-pager.global.js +1 -1
- package/dist/ui-elements/relative-time.global.js +1 -1
- package/dist/ui-elements/saved-views.global.js +1 -1
- package/dist/ui-elements/select-chips.global.js +1 -1
- package/dist/ui-elements/select-recents.global.js +1 -1
- package/dist/ui-elements/select-search.global.js +1 -1
- package/dist/ui-elements/select-window.global.js +1 -1
- package/dist/ui-elements/server.global.js +1 -1
- package/dist/ui-elements/shell.global.js +1 -1
- package/dist/ui-elements/shortcuts.global.js +1 -1
- package/dist/ui-elements/show-more.global.js +1 -1
- package/dist/ui-elements/slider.global.js +1 -1
- package/dist/ui-elements/sortable.global.js +1 -1
- package/dist/ui-elements/status-icon.global.js +1 -1
- package/dist/ui-elements/table-export.global.js +1 -1
- package/dist/ui-elements/timepicker.global.js +1 -1
- package/dist/ui-elements/tour.global.js +1 -1
- package/dist/ui-elements/tree-picker.global.js +1 -1
- package/dist/ui-elements/tree.global.js +1 -1
- package/dist/ui-elements/truncate.global.js +1 -1
- package/dist/ui-elements/whats-new.global.js +1 -1
- package/dist/ui-elements/wizard.global.js +1 -1
- package/dist/ui-elements.global.js +1 -1
- package/dist/ui-elements.js +1 -1
- package/package.json +5 -5
- package/types/WuiSelect.d.ts +9 -9
- package/types/select/list.d.ts +5 -2
- package/types/select/part.d.ts +17 -5
- package/types/select/search.d.ts +1 -1
- package/types/text/web/filePicker.g.d.ts +2 -0
- package/types/text/web/select.g.d.ts +1 -0
- package/dist/WuiSelect-B0CT2utp.js +0 -1
- package/dist/search-DLRWJomU.js +0 -1
- package/dist/search.g-B5d1s59A.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./anchorOverlay-daGdh_91.js";import{t}from"./avatarNode-BaEvz5Xr.js";import{n}from"./devWarn-DXdRWZs3.js";import{i as r,r as i}from"./dom-DMQu--xV.js";import{t as a}from"./elementBase-Cxeyx0tU.js";import{r as o,t as s}from"./fieldState-D-zQcXUS.js";import{n as c,t as l}from"./formMirror-9IpSgeZb.js";import{n as u}from"./loader-X2uBXCDm.js";import{t as d}from"./iconGlyphs.g-a9FtjPXh.js";import{n as f}from"./imeSafeEnter-DeO_3lXy.js";import{n as p,t as m}from"./listboxKeyNav-CNso9shL.js";import{a as h,l as g,s as _}from"./nativeOverlay-BHD2QV02.js";import{i as v,n as y,t as b}from"./optionLabel-wbpl8OTJ.js";import{r as x}from"./textStore-DBplASiZ.js";import{n as S,r as C,t as w}from"./search.g-chn0itlW.js";import{t as T}from"./hasOwn-CJsplJ62.js";import{n as E,r as D,t as O}from"./window-BZWK3rQk.js";var k=()=>x(`select`,C);function A(e,t){let n=String(t??``).trim().toLowerCase();return n?e.filter(e=>[y(e),e.description,e.meta].some(e=>String(e??``).toLowerCase().includes(n))):e}var j=/* @__PURE__ */ new WeakMap,M=e=>e?{"data-index":String(e.index),"aria-setsize":String(e.size),"aria-posinset":String(e.index+1)}:{},N=e=>e.map(e=>e instanceof Element?e.outerHTML:e.textContent??``).join(``),P;function F(e){P=e}function I(e){P?.clear(e),j.delete(e),e.replaceChildren()}function L(e,t,n={}){let{selected:r=[],query:a=``,status:o=`idle`,emptyText:s=k().emptyText,searchingText:c=k().searchingText,loadingMoreText:l=k().loadingMoreText,hintText:u=k().hintText,actionRow:d=[],recents:f=null}=n,p=new Set(r.map(String)),m=A(t,a),h=e.id,g=d.filter(e=>e.position===`top`),_=d.filter(e=>e.position===`bottom`),v=f?.options.length?f.options:[],y=g.length+v.length+m.length+_.length,b=m.length>300,x=P,S=b&&x!==void 0,C=e=>S?{index:e,size:y}:void 0,w=0,T=e=>{let t=w++;return i(`button`,{type:`button`,role:`option`,id:R(h,t),class:`wui-select-option wui-select-add`,"data-value":String(e.value??``),"data-custom":`true`,"aria-selected":`false`,...M(C(t))},e.label)},E=e=>{let t=w++;return ne(e,R(h,t),p.has(String(e.value)),C(t))},D=g.map(T),O=v.length&&f?[i(`div`,{class:`wui-select-group`},f.label),...v.map(E),i(`div`,{class:`wui-select-sep`,"aria-hidden":`true`})]:[],F=w,I=[];if(S)w+=m.length;else{let e=``;for(let t of m)t.group&&t.group!==e&&I.push(i(`div`,{class:`wui-select-group`},t.group)),e=t.group??``,I.push(E(t))}let L=_.map(T),z=[];if(o===`loading`||o===`more`?z=[i(`div`,{class:`wui-select-loading`},i(`span`,{class:`wui-select-spinner spinner-border spinner-border-sm`,role:`status`,"aria-hidden":`true`}),o===`more`?l:c)]:o===`hint`?z=[i(`div`,{class:`wui-select-hint`},u)]:(o===`empty`||m.length===0&&d.length===0)&&(z=[i(`div`,{class:`wui-select-empty`},s)]),S&&x){let n=[...D,...O],r=[...L,...z];return x.render(e,{options:t,query:a,rows:m,pre:n,post:r,preSig:N(n),postSig:N(r),picked:p,top:g,recent:v,bottom:_,bodyBase:F,total:y}),{rows:y,windowed:!0,long:b}}x?.clear(e);let B=[...D,...O,...I,...L,...z],V=N(B);return j.get(e)===V||(j.set(e,V),e.replaceChildren(...B)),{rows:w,windowed:!1,long:b}}var R=(e,t)=>`${e}-opt-${t}`,z=e=>[...e.querySelectorAll(`.wui-select-option`)];function B(e){return P?P.refresh(e):!1}function V(e,t){return P?P.reveal(e,t):z(e)[t]??null}function ee(e,t){if(P)return P.indexOfValue(e,t);let n=new Set(t.map(String));return z(e).findIndex(e=>n.has(e.dataset.value??``))}function te(e,t){return P?P.indexByPrefix(e,t):z(e).findIndex(e=>(e.textContent??``).trim().toLowerCase().startsWith(t))}function ne(e,n,r,a){let o=!!e.disabled,s={id:n,role:`option`,"data-value":String(e.value??``),"aria-selected":String(r),"aria-disabled":o?`true`:void 0,title:o&&e.disabledHint?e.disabledHint:void 0,...M(a)},c=i(`span`,{class:`wui-select-check`,"aria-hidden":`true`},d(`check`));if(!e.description&&!e.meta)return i(`button`,{type:`button`,class:`wui-select-option${r?` selected`:``}`,...s},t(e),i(`span`,{class:`wui-select-opt-name`},...b(e)),c);let l=e.description?i(`span`,{class:`wui-select-opt-desc`},e.description):null,u=e.meta?i(`span`,{class:`wui-select-opt-meta`},e.meta):null;return i(`div`,{class:`wui-select-option wui-select-option-rich${r?` selected`:``}`,...s},t(e),i(`span`,{class:`wui-select-option-text`},i(`span`,{class:`wui-opt-label`},...b(e)),l),u,c)}var re=Object.freeze([`single`,`multiple`,`search`,`tag`,`country`]),H=e=>e===`multiple`||e===`tag`,U={recents:()=>import(`./recents-Da5C5_lV.js`),chips:()=>import(`./chips-DtDYq3XM.js`),search:()=>import(`./search-BAgNDqG2.js`),country:()=>import(`./country-BySxiqti.js`)};function ie(e){let t=T(U,e)?U[e]:void 0;return t?t():Promise.reject(/* @__PURE__ */ Error(`Unknown <wui-select> part: ${e}.`))}var W=e=>typeof e.loadOptions==`function`||!!e.getAttribute(`source`)||e.hasAttribute(`remote`),ae=300,G=`<div class="wui-select-spacer" aria-hidden="true"></div>`,K=()=>i(`div`,{class:`wui-select-spacer`,"aria-hidden":`true`}),q=/* @__PURE__ */ new WeakMap,J=(e,t)=>{let n=e.entries[e.optionEntry[t]??-1];return n?.kind===`option`?n.option:void 0},oe=(e,t,n)=>e.query===t&&e.count>0&&n.length>e.count&&n[0]===J(e,0)&&n[e.count-1]===J(e,e.count-1);function se(e,t,n,r){let i=q.get(e);if(i&&i.options===t&&i.query===n&&i.count===r.length)return i;let a=i!==void 0&&oe(i,n,r),o=[],s=new Int32Array(r.length),c=``;r.forEach((e,t)=>{e.group&&e.group!==c&&o.push({kind:`group`,label:e.group}),c=e.group??``,s[t]=o.length,o.push({kind:`option`,option:e,ord:t})});let l={options:t,query:n,count:r.length,entries:o,optionEntry:s,heights:O(o.length),estimated:!1,bodyTop:0,start:0,end:0,pre:[],post:[],preSig:``,postSig:``,picked:/* @__PURE__ */ new Set,top:[],recent:[],bottom:[],bodyBase:0,total:0};if(q.set(e,l),i&&a){l.heights.setEstimate(i.heights.estimate),l.estimated=i.estimated,l.bodyTop=i.bodyTop;for(let e=0;e<i.entries.length;e++)l.heights.set(e,i.heights.heightOf(e))}else i&&(e.scrollTop=0);return l}var Y=e=>e.clientHeight||ae,ce=(e,t)=>D(t.heights,{scrollTop:Math.max(0,e.scrollTop-t.bodyTop),viewport:Y(e)});function le(e,t,n,r){let a=[];for(let o=n;o<r;o++){let n=e.entries[o];if(n){if(n.kind===`group`)a.push(i(`div`,{class:`wui-select-group`,"data-entry":o},n.label));else{let r=e.bodyBase+n.ord;a.push(ne(n.option,R(t,r),e.picked.has(String(n.option.value)),{index:r,size:e.total}))}}}return a}function ue(e,t){let[n,r]=e.querySelectorAll(`.wui-select-spacer`);n&&r&&(n.style.flex=r.style.flex=`none`,n.style.height=`${t.heights.offsetOf(t.start)}px`,r.style.height=`${t.heights.total()-t.heights.offsetOf(t.end)}px`)}function de(e,t){let{start:n,end:r}=ce(e,t);t.start=n,t.end=r;let i=le(t,e.id,n,r),a=t.preSig+G+N(i)+G+t.postSig,o=e.scrollTop;j.get(e)!==a&&(j.set(e,a),e.replaceChildren(...t.pre,K(),...i,K(),...t.post)),ue(e,t),e.scrollTop!==o&&(e.scrollTop=o)}function fe(e,t){let n={changed:!1,delta:0};if(!e.clientHeight)return n;let{heights:r}=t,i=e.querySelector(`.wui-select-spacer`),a=[],o=!0,s=!1;if(i){let n=i.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;Math.abs(n-t.bodyTop)>.5&&(t.bodyTop=n,s=!0)}let c=r.indexAt(Math.max(0,e.scrollTop-t.bodyTop)),l=r.offsetOf(c),u=0;for(let n of e.querySelectorAll(`.wui-select-option[data-index], .wui-select-group[data-entry]`)){let e=n.getBoundingClientRect().height;if(n.dataset.entry!==void 0)a.push([Number(n.dataset.entry),e]);else{let r=Number(n.dataset.index)-t.bodyBase,i=r>=0?t.optionEntry[r]:void 0;if(i===void 0)continue;o&&(u=e),o=!1,a.push([i,e])}}if(!t.estimated&&u>0){let e=r.estimate;r.setEstimate(u),t.estimated=!0,r.estimate!==e&&(s=!0)}for(let[e,t]of a)r.set(e,t)&&(s=!0);return s?{changed:s,delta:r.offsetOf(c)-l}:n}function X(e,t){de(e,t);for(let n=0;n<2;n++){let{changed:n,delta:r}=fe(e,t);if(!n)return;ue(e,t),r&&(e.scrollTop+=r),de(e,t)}}function pe(e,t){let n=se(e,t.options,t.query,t.rows);Object.assign(n,{pre:t.pre,post:t.post,preSig:t.preSig,postSig:t.postSig,picked:t.picked,top:t.top,recent:t.recent,bottom:t.bottom,bodyBase:t.bodyBase,total:t.total}),X(e,n)}function me(e){let t=q.get(e);if(!t)return!1;let{start:n,end:r}=ce(e,t);return n===t.start&&r===t.end?!1:(X(e,t),!0)}function he(e,t){let n=q.get(e);if(!n||t<0||t>=n.total)return null;let r=t-n.bodyBase,i=r>=0?n.optionEntry[r]:void 0,a=()=>e.querySelector(`[data-index="${t}"]`);if(i===void 0)return a();for(let t=0;t<2;t++){let t={scrollTop:e.scrollTop-n.bodyTop,viewport:Y(e)},r=n.bodyTop+E(n.heights,i,t);if(Math.abs(r-e.scrollTop)>.5)e.scrollTop=r;else if(a())break;X(e,n)}return a()}function ge(e,t){if(t<0||t>=e.total)return;if(t<e.top.length)return e.top[t];let n=t-e.top.length;if(n<e.recent.length)return e.recent[n];let r=t-e.bodyBase;if(r<e.count){let t=e.entries[e.optionEntry[r]??-1];return t?.kind===`option`?t.option:void 0}return e.bottom[r-e.count]}var _e=e=>e&&!(`position`in e)?e:void 0;function ve(e,t){let n=q.get(e);if(!n||t.length===0)return-1;let r=new Set(t.map(String));for(let e=0;e<n.total;e++){let t=_e(ge(n,e));if(t&&r.has(String(t.value)))return e}return-1}var ye=e=>`position`in e?e.label:`${e.initials??``}${y(e)}${e.description??``}${e.meta??``}`;function be(e,t){let n=q.get(e);if(!n)return-1;for(let e=0;e<n.total;e++){let r=ge(n,e);if(r&&ye(r).trim().toLowerCase().startsWith(t))return e}return-1}F({render:pe,refresh:me,reveal:he,indexOfValue:ve,indexByPrefix:be,clear(e){q.delete(e)}});function xe(){return Promise.resolve()}var Z=()=>x(`select`,C),Se=()=>x(`search`,w),Ce=()=>x(`field`,S),we=160,Te=class extends a{static formAssociated=!0;_internals;_value;_optionsProp;_partOptions;_known;_loadOptionsFn;_validateFn;_declared;_query;_ownsFilter;_active;_rows;_windowed;_windowLoad;_windowFailed;_scrollFrame;_endFrame;_status;_error;_nav;_parts;_partSig;_partsMounted;_partToken;_rendered;_searchShown;_defaultValue;_warnedMode;_warnedDensity;_hoverTimer;_hoverOpened;_onHoverOver;_onHoverOut;_panelShown;_pressOpen;static get observedAttributes(){return/* @__PURE__ */ `class.mode.value.placeholder.search-placeholder.empty-text.searchable.clearable.disabled.readonly.loading.required.size.density.icon.prefix.open.open-on-hover.lazy-options.aria-label.aria-describedby.aria-invalid.min-chars.debounce.source.remote.allow-custom.add-label.searching-text.hint-text.value-label.value-avatar.value-initials.max-tags.allow-duplicates.separators.pattern.invalid-message.create-label.collapse-chips.selected-text.clear-all-label.countries.suggested.suggested-label.all-countries-label.recents-key.recents-limit.recents-label`.split(`.`)}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``,this._optionsProp=null,this._partOptions=null,this._known=/* @__PURE__ */ new Map,this._loadOptionsFn=null,this._validateFn=null,this._declared=void 0,this._query=``,this._ownsFilter=!1,this._active=-1,this._rows=0,this._windowed=!1,this._windowLoad=null,this._windowFailed=!1,this._scrollFrame=null,this._endFrame=null,this._status=`idle`,this._error=``,this._nav=null,this._parts=null,this._partSig=``,this._partsMounted=!1,this._partToken=0,this._rendered=!1,this._searchShown=!1,this._defaultValue=void 0,this._warnedMode=null,this._hoverTimer=null,this._hoverOpened=!1,this._panelShown=!1,this._pressOpen=null,this._onHoverOver=e=>{e.pointerType===`mouse`&&this._hoverZone(e.target)&&(this._clearHover(),!this._menuOpen()&&this._hoverEligible()&&(this._hoverTimer=setTimeout(()=>{this._hoverTimer=null,!this._menuOpen()&&this._hoverEligible()&&(this._open({focus:!1}),this._hoverOpened=!0)},ke)))},this._onHoverOut=e=>{e.pointerType===`mouse`&&this._hoverZone(e.target)&&!this._hoverZone(e.relatedTarget)&&(this._clearHover(),this._menuOpen()&&this.hasAttribute(`open-on-hover`)&&(this._hoverTimer=setTimeout(()=>{this._hoverTimer=null,this._close()},Ae)))}}connectedCallback(){this.addEventListener(`pointerover`,this._onHoverOver),this.addEventListener(`pointerout`,this._onHoverOut),this._rendered||this.render(),this._ensureParts(),this._mountParts()}disconnectedCallback(){this.removeEventListener(`pointerover`,this._onHoverOver),this.removeEventListener(`pointerout`,this._onHoverOut),this._clearHover(),this._dropMenu(),this._teardown(),this._teardownParts()}attributeChangedCallback(e,t,n){e===`class`?this._syncUnderline():e===`value`?(this._value=Q(n,H(this.mode)),this._applyValue()):e===`aria-invalid`?this._syncInvalid():e===`open`?this._rendered&&(this.hasAttribute(`open`)?this._open({focus:!1}):this._close({force:!0})):e===`open-on-hover`?this.hasAttribute(`open-on-hover`)||this._clearHover():e!==`lazy-options`&&(e===`mode`&&(this._value=Q(this._value,H(this.mode)),this._partOptions=null,this._known.clear(),this._ensureParts()),(e===`source`||e===`remote`||e===`recents-key`)&&this._ensureParts(),Pe.has(e)?this._rendered&&(this._drawValue(),this.renderList()):Ne.has(e)?this._remountParts():this._rendered&&this.render())}formResetCallback(){if(this.value=this._defaultValue??``,!this._rendered)return;let e=this._refs();e.input&&(e.input.value=``,e.input.removeAttribute(`aria-invalid`)),e.search&&(e.search.value=``),this.setError(``),this._query!==``&&this._onQueryChange(``)}get mode(){let e=this.getAttribute(`mode`);return e===null?`single`:De(e)?e:(e!==this._warnedMode&&(this._warnedMode=e,n(`<wui-select> mode "${e}" is not one of ${re.join(`, `)}; it is treated as "single".`)),`single`)}_checkDensity(){let e=this.getAttribute(`density`);e===null||Oe.includes(e)||e===this._warnedDensity||(this._warnedDensity=e,n(`<wui-select> density "${e}" is not one of ${Oe.join(`, `)}; it is treated as "comfortable".`))}set mode(e){this.setAttribute(`mode`,String(e))}get value(){return Array.isArray(this._value)?this._value.slice():this._value}set value(e){this._value=Q(e,H(this.mode)),this._applyValue()}get options(){return this._readOptions()}set options(e){this._optionsProp=Array.isArray(e)?e:null,this.mode!==`country`&&(this._partOptions=null);for(let e of this._activePartsList())e.onOptions?.();if(this._rendered){if(this.mode===`single`&&this.getAttribute(`searchable`)===null&&this._autoSearch()!==this._searchShown){this.render();return}this._drawValue(),this.renderList()}}get loadOptions(){return this._loadOptionsFn}set loadOptions(e){this._loadOptionsFn=typeof e==`function`?e:null,this._ensureParts()}get validate(){return this._validateFn}set validate(e){this._validateFn=typeof e==`function`?e:null}commit(e,t={}){this.value=e,this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,detail:{isCustom:!!t.isCustom}}))}setPartOptions(e){this._partOptions=Array.isArray(e)?e:null,this._drawValue(),this.renderList()}setStatus(e){this._status=e,this.renderList()}setError(e){this._error=e?String(e):``,this._syncError()}openMenu(){s(this)||this._open({focus:!1})}closeMenu({focusControl:e=!1}={}){this._close(),e&&this._refs().control?.focus()}renderList(){let e=this._refs();if(!e.list)return;let t=this._ownsFilter?``:this._query,n=this._actionRows(),r=this._recents();if(this.hasAttribute(`lazy-options`)&&!this._menuOpen()){this._rows=A(this._listOptions(),t).length+n.length+(r?.options.length??0),this._windowed=!1,I(e.list),this._anchorMenu();return}let i=L(e.list,this._listOptions(),{selected:this._selectedValues(),query:t,status:this._status,emptyText:this.getAttribute(`empty-text`)||Z().emptyText,searchingText:this.getAttribute(`searching-text`)||Z().searchingText,loadingMoreText:Z().loadingMoreText,hintText:this.getAttribute(`hint-text`)||void 0,actionRow:n,recents:r});this._rows=i.rows,this._windowed=i.windowed,i.long&&!i.windowed&&!this._windowFailed&&this._loadWindow(),this._active>=this._rowCount()&&(this._active=-1),this._active>=0&&this._setActive(this._active,{reveal:!1}),this._anchorMenu(),this._watchListEnd()}_watchListEnd(){this._endFrame===null&&this._activePartsList().some(e=>e.onListEnd)&&(this._endFrame=requestAnimationFrame(()=>{this._endFrame=null,this._checkListEnd()}))}_checkListEnd(){let e=this._refs().list;if(e?.clientHeight&&this._menuOpen()&&!(e.scrollTop+e.clientHeight<e.scrollHeight-we))for(let e of this._activePartsList())e.onListEnd?.()}render(){this._dropMenu();let e=this._carry();this._teardownParts(),this._snapshotDeclared();let t=this.mode;this._checkDensity();let n=H(t),r=t===`tag`,a=n&&(r||this.hasAttribute(`allow-custom`));this._value=Q(this._value,n),this._defaultValue===void 0&&n&&this._value.length===0&&(this._value=this._declaredSelected()),n||this._preselect(),this._defaultValue===void 0&&(this._defaultValue=Q(this._value,n));let s=this.getAttribute(`size`),c=s===`sm`?` wui-select-sm`:s===`lg`?` wui-select-lg`:s===`xl`?` wui-select-xl`:``,l=this.getAttribute(`icon`),u=this.getAttribute(`prefix`),f=this.hasAttribute(`clearable`),p=this.hasAttribute(`disabled`);if(!this.id){let e=crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(8));this.id=`wui-select-${Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}`}let m=`${this.id}-listbox`,h=`${this.id}-entry-error`,g=this.getAttribute(`aria-describedby`)?.trim(),_=g?`${g} ${h}`:h,v=this.hasAttribute(`aria-invalid`)||!!this._error,y=this.hasAttribute(`required`)&&!a,b=this._accessibleName(),x=a?{}:{role:`combobox`,"aria-haspopup":`listbox`,"aria-expanded":`false`,"aria-controls":m},S={"aria-label":b,"aria-describedby":_,"aria-invalid":v?`true`:void 0,"aria-required":y?`true`:void 0},C=n?i(`div`,{class:`input wui-select-control wui-select-multi`,...x,...S,"aria-disabled":p?`true`:void 0,tabindex:!p&&!r?`0`:void 0}):i(`button`,{type:`button`,class:`input wui-select-control`,...x,...S,disabled:p||void 0}),w=[l?d(l,{className:`wui-select-icon`}):null,u?i(`span`,{class:`wui-select-prefix`},u):null,i(`span`,{class:`wui-select-value`,"data-label":!0}),f?i(`span`,{class:`wui-select-reset`,role:`button`,"aria-label":Z().clearSelectionLabel,hidden:!0},d(`x`)):null,d(`chevron-down`,{className:`wui-select-caret`})];C.append(...w.filter(e=>e!==null));let T=this.getAttribute(`searchable`),E=T===null?t===`multiple`||t===`country`||this._autoSearch():T!==`false`,D=t===`search`||E&&!a;this._searchShown=D;let O=this.getAttribute(`search-placeholder`)||(t===`country`?Z().countrySearchPlaceholder:Se().placeholder),k=D?i(`div`,{class:`wui-select-search`},d(`search`),i(`input`,{class:`wui-select-input`,placeholder:O,"aria-label":O,"aria-autocomplete":`list`}),i(`button`,{type:`button`,class:`wui-select-clear`,"aria-label":Se().clearLabel,hidden:!0},d(`x`))):null,A=i(`div`,{class:`wui-select-options`,role:`listbox`,id:m,tabindex:`-1`,"aria-multiselectable":n?`true`:void 0}),j=i(`div`,{class:`wui-select-menu wui-select-menu-fixed`,popover:`auto`},k,A),M=i(`div`,{class:`field-error wui-select-error`,id:h,"aria-live":`polite`,hidden:!this._error||void 0},this._error||null);this.replaceChildren(i(`div`,{class:`wui-select${c}`},C,j),M),this._rendered=!0,this._syncMirror(),this._syncValidity(),this._drawValue(),this._syncReset(),this.renderList(),this._wire(),o(this,this.querySelector(`.wui-select-control`)),this._syncUnderline(),this._mountParts(e)}_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||Z().fallbackName}_snapshotDeclared(){if(this._declared)return;let e=[...this.querySelectorAll(`:scope > wui-option`)];e.length&&(this._declared=e.map(e=>{let t=document.createDocumentFragment();for(let n of e.childNodes)t.append(n.cloneNode(!0));let n={value:e.getAttribute(`value`)??Ve(e).trim(),label:t.textContent??``,selected:e.hasAttribute(`selected`)};for(let[t,r]of Fe){let i=e.getAttribute(t);i&&(n[r]=i)}return e.hasAttribute(`disabled`)&&(n.disabled=!0),v(n,t)}))}_readOptions(){return this.mode===`country`?this._partOptions||[]:this._partOptions?this._partOptions:this._optionsProp?this._optionsProp:(this._snapshotDeclared(),this._declared||[])}_listOptions(){let e=this._readOptions(),t=this.getAttribute(`value-label`);if(this.mode!==`search`||!t||this._value===``)return e;let n=String(this._value);return e.some(e=>String(e.value)===n)?e:[...e,{value:n,label:t}]}_declaredSelected(){return this._optionsProp?[]:(this._declared??[]).filter(e=>e.selected).map(e=>String(e.value))}_preselect(){let e=this._readOptions(),t=this._value!==``&&e.find(e=>String(e.value)===this._value)||e.find(e=>`selected`in e&&!!e.selected);t&&(this._value=String(t.value))}_optionFor(e){let t=String(e),n=this._readOptions().find(e=>String(e.value)===t);return n?(this._known.set(t,n),n):this._known.get(t)}_placeholder(){return this.getAttribute(`placeholder`)||Me()[this.mode]}_hasValue(){return Array.isArray(this._value)?this._value.length>0:this._value!==``}_selectedValues(){return Array.isArray(this._value)?this._value:this._value===``?this._listOptions().some(e=>String(e.value)===``)?[``]:[]:[this._value]}_applyValue(){this._syncMirror(),this._syncValidity(),this._rendered&&(this._drawValue(),this._syncReset(),this.renderList())}_syncMirror(){H(this.mode)?c(this,this._selectedValues()):l(this,this._value)}_drawValue(){let e=this._refs();if(!e.value)return;let t=H(this.mode),n=t?void 0:this._optionFor(this._value);if(this._syncTitle(n),this._syncValueAvatar(),this._activePartsList().some(e=>e.renderValue?.()===!0))return;if(t){e.value.classList.remove(`wui-select-placeholder`),e.value.textContent=``;return}e.value.classList.toggle(`wui-select-placeholder`,!n);let r=this._placeholder();e.value.replaceChildren(...n?b(n):r?[r]:[])}_syncTitle(e){let t=this.querySelector(`.wui-select-control`);if(!t)return;let n=e&&!this.hasAttribute(`title`)?y(e).trim():``;n?t.setAttribute(`title`,n):t.removeAttribute(`title`)}_syncValueAvatar(){let e=this.querySelector(`.wui-select-control`);if(!e)return;e.querySelector(`:scope > .wui-select-value-avatar`)?.remove();let n=!H(this.mode)&&this._hasValue()?t({avatar:this.getAttribute(`value-avatar`),initials:this.getAttribute(`value-initials`)},`avatar-xs`):null;e.classList.toggle(`wui-has-value-avatar`,!!n),n&&e.prepend(i(`span`,{class:`wui-select-value-avatar`,"aria-hidden":`true`},n))}_syncValidity(){let e=this._internals;if(typeof e?.setValidity==`function`){if(this.hasAttribute(`required`)&&!this._hasValue()){let t=this.querySelector(`.wui-select-control`);e.setValidity({valueMissing:!0},Ce().requiredFieldMessage,t instanceof HTMLElement?t:void 0)}else e.setValidity({})}}_syncReset(){let e=$(this,`.wui-select-reset`,HTMLElement);e&&(e.hidden=!(this.hasAttribute(`clearable`)&&this._hasValue()&&!s(this)))}_syncUnderline(){this.querySelector(`.wui-select-control`)?.classList.toggle(`wui-input-underline`,this.classList.contains(`wui-input-underline`))}_syncInvalid(){let e=this.querySelector(`.wui-select-control`);e&&(this.hasAttribute(`aria-invalid`)||this._error?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}_syncError(){let e=$(this,`.wui-select-error`,HTMLElement);e&&(e.textContent=this._error,e.hidden=!this._error),this._syncInvalid()}_refs(){return{control:$(this,`.wui-select-control`,HTMLElement),value:$(this,`.wui-select-value`,HTMLElement),menu:$(this,`.wui-select-menu`,HTMLElement),list:$(this,`.wui-select-options`,HTMLElement),search:$(this,`.wui-select-search input`,HTMLInputElement),input:$(this,`.wui-select-draft`,HTMLInputElement)}}_menuOpen(){let e=$(this,`.wui-select-menu`,HTMLElement);return e!==null&&_(e)}_hoverZone(e){if(!(e instanceof Element))return!1;let t=e.closest(`.wui-select-control, .wui-select-menu`);return t!==null&&this.contains(t)}_hoverEligible(){if(!this.hasAttribute(`open-on-hover`)||s(this)||this.mode===`tag`)return!1;let e=this._refs();return e.search===null&&e.input===null}_clearHover(){this._hoverTimer!==null&&clearTimeout(this._hoverTimer),this._hoverTimer=null}_autoSearch(){return this.mode===`single`&&this.getAttribute(`searchable`)===null&&this._readOptions().length>je}_visible(){let e=this._refs();return e.list?Be(e.list,`.wui-select-option`):[]}_rowCount(){return this._windowed?this._rows:this._visible().length}_rowEl(e){if(!this._windowed)return this._visible()[e];let t=this._refs().list?.querySelector(`[data-index="${e}"]`);return t instanceof HTMLElement?t:void 0}_setActive(e,{reveal:t=!0}={}){let n=this._refs();if(!n.list||!n.control)return;this._active=e;let r=null;e>=0&&e<this._rowCount()&&(r=this._rowEl(e)??(this._windowed&&t?V(n.list,e):null)),p(n.list,r),r?(t&&r.scrollIntoView({block:`nearest`}),n.control.setAttribute(`aria-activedescendant`,r.id)):n.control.removeAttribute(`aria-activedescendant`)}_onListScroll(){this._scrollFrame=null;let e=this._refs().list;e&&(this._windowed&&B(e)&&this._active>=0&&this._setActive(this._active,{reveal:!1}),this._checkListEnd())}_actionRows(){let e=[];for(let t of this._activePartsList()){let n=t.actionRow?.(this._query);n&&e.push(n)}return e}_recents(){if(this._query.trim()!==``)return null;for(let e of this._activePartsList()){let t=e.recents?.(this._listOptions());if(t)return t}return null}_menuPlacement(e,t){let n=this.hasAttribute(`open`)?{below:!0}:{};if(this.getAttribute(`density`)!==`compact`)return{matchWidth:!0,...n};let r=e.getBoundingClientRect();return t.style.width=`max-content`,t.style.minWidth=`${r.width}px`,t.style.maxWidth=`280px`,n}_anchorMenu(){let t=this._refs();t.control&&t.menu&&this._menuOpen()&&e(t.control,t.menu,this._menuPlacement(t.control,t.menu))}_showMenu(e,t){g(e,t,{...this._menuPlacement(e,t),mode:`auto`,keepOffscreen:this.hasAttribute(`open`),onClosed:()=>this._onPanelClosed()}),this._panelShown=!0}_onPanelClosed(){if(!this._panelShown)return;this._panelShown=!1;let e=this._refs();e.control&&(e.control.setAttribute(`aria-expanded`,`false`),this._setActive(-1),this._nav?.clearTypeahead(),this.dispatchEvent(new CustomEvent(`wui-select:close`,{bubbles:!0})))}_open({focus:e=!0}={}){let t=this._refs();if(!t.menu||!t.control)return;let n=this._menuOpen();this._hoverOpened=!1,t.control.setAttribute(`aria-expanded`,`true`),this._query=t.input?t.input.value:``,this._ownsFilter=this._ownsFilter&&this._query!==``;let r=$(this,`.wui-select-search .wui-select-clear`,HTMLElement);if(r&&(r.hidden=!0),t.search&&(t.search.value=``),n||this._showMenu(t.control,t.menu),this.renderList(),e&&(t.search?.focus(),this._setActive(this._windowed&&t.list?ee(t.list,this._selectedValues()):this._visible().findIndex(e=>e.classList.contains(`selected`)))),!n){this.dispatchEvent(new CustomEvent(`wui-select:open`,{bubbles:!0}));for(let e of this._activePartsList())e.onOpen?.()}}_close({force:e=!1}={}){if(!e&&this.hasAttribute(`open`))return;let t=this._refs();if(!t.menu||!t.control)return;this._hoverOpened=!1;let n=t.menu.contains(document.activeElement);_(t.menu)&&h(t.menu),this._onPanelClosed(),n&&t.control.focus()}_onQueryChange(e){this._query=e,this._setActive(-1);let t=$(this,`.wui-select-search .wui-select-clear`,HTMLElement);t&&(t.hidden=!e);let n=!1;for(let t of this._activePartsList())t.onQuery?.(e)===!0&&(n=!0);this._ownsFilter=n,this.renderList()}_pick(e){if(e.getAttribute(`aria-disabled`)===`true`)return;let t=e.dataset.custom===`true`,n=e.dataset.value??``,r=t?{value:n,label:Ve(e).trim()}:this._listOptions().find(e=>String(e.value)===n)??{value:n,label:n},i=this._activePartsList().some(e=>e.onPick?.(r,{isCustom:t})===!0);H(this.mode)||(i||this.commit(n,{isCustom:t}),this._close(),this._refs().control?.focus())}_draftOpens(){return this.mode===`multiple`?this.hasAttribute(`allow-custom`):this.mode===`tag`&&W(this)}_onKeyDown(e){if(!s(this)){for(let t of this._activePartsList())if(t.onKey?.(e)===!0)return;if(!this._menuOpen()){if(e.target instanceof HTMLInputElement){if(e.key!==`ArrowDown`||!this._draftOpens())return;this._open({focus:!1})}else{(e.key===`ArrowDown`||f(e)||e.key===` `)&&(e.preventDefault(),this._open({focus:!0}));return}}r(this._nav,`Listbox keys are not wired.`).handler(e)}}_wire(){this._teardown();let e=this._refs(),t=e.control,n=e.list;if(!t||!e.menu||!n)return;let i=r($(this,`.wui-select`,HTMLElement),`The select wrapper is missing.`),a=$(this,`.wui-select-search .wui-select-clear`,HTMLElement),o=$(this,`.wui-select-reset`,HTMLElement);this._nav=m({getVisibleOptions:()=>this._visible(),getActive:()=>this._active,setActive:e=>this._setActive(e),getCount:()=>this._rowCount(),getOptionAt:e=>this._rowEl(e),findByPrefix:e=>this._windowed?te(n,e):this._visible().findIndex(t=>t.textContent.trim().toLowerCase().startsWith(e)),onEnter:(e,t)=>{if(e)this._pick(e);else if(this._query.trim()!==``){let e=t.find(e=>e.dataset.custom===`true`);if(e)this._pick(e);else if(t.length===1){let e=t[0];e&&this._pick(e)}}},onEscape:e=>{e.preventDefault(),this._nav?.clearTypeahead(),this._close(),t.focus()}}),i.addEventListener(`keydown`,e=>this._onKeyDown(e)),i.addEventListener(`input`,e=>{let t=e.target;if(!(t instanceof HTMLInputElement)||!t.matches(`.wui-select-input, .wui-select-draft`))return;this._onQueryChange(t.value);let n=t.matches(`.wui-select-draft`),r=this._rows>0||this._actionRows().length>0;n&&r&&!this._menuOpen()&&!s(this)&&this._draftOpens()&&this._open({focus:!1})}),i.addEventListener(`focusout`,e=>{let t=e.relatedTarget;t instanceof Node&&this.contains(t)||!this._activePartsList().some(e=>e.onBlur?.()===!0)&&t&&this._close()}),a?.addEventListener(`click`,()=>{let t=r(e.search,`The search input is missing.`);t.value=``,this._onQueryChange(``),t.focus()}),t.addEventListener(`pointerdown`,()=>{this._pressOpen=this._menuOpen()}),t.addEventListener(`click`,e=>{if(e.target instanceof Element&&e.target.closest(`[data-remove]`))return;if(this.mode===`tag`){if(s(this))return;this._refs().input?.focus(),!this._menuOpen()&&this._draftOpens()&&this._open({focus:!1});return}if(e.target instanceof HTMLInputElement){!this._menuOpen()&&!s(this)&&this._open({focus:!1});return}let t=e.detail>0&&this._pressOpen!==null?this._pressOpen:this._menuOpen();this._pressOpen=null,this._clearHover(),this._hoverOpened&&t?(this._hoverOpened=!1,this._open({focus:!0})):t?this._close():s(this)||this._open({focus:!0})}),o?.addEventListener(`click`,e=>{e.stopPropagation(),this.commit(H(this.mode)?[]:``),this._close(),t.focus()}),n.addEventListener(`click`,n=>{let r=ze(n).closest(`.wui-select-option`);if(r instanceof HTMLElement&&(this._pick(r),H(this.mode))){let n=this.querySelector(`.wui-select-draft`);(e.search??(n instanceof HTMLElement?n:t)).focus()}}),n.addEventListener(`mousedown`,e=>{H(this.mode)&&e.target instanceof Element&&e.target.closest(`.wui-select-option`)&&e.preventDefault()}),n.addEventListener(`mousemove`,e=>{let t=ze(e).closest(`.wui-select-option`);t instanceof HTMLElement&&!t.classList.contains(`is-active`)&&this._setActive(this._windowed?Number(t.dataset.index):this._visible().indexOf(t),{reveal:!1})}),n.addEventListener(`scroll`,()=>{this._scrollFrame===null&&(this._scrollFrame=requestAnimationFrame(()=>this._onListScroll()))},{passive:!0}),n.addEventListener(`mouseleave`,()=>this._setActive(-1)),n.addEventListener(`error`,e=>{let t=e.target;t instanceof Element&&t.classList.contains(`avatar-img`)&&t.remove()},!0),this.hasAttribute(`open`)&&this._open({focus:!1})}_teardown(){this._nav?.clearTypeahead(),this._scrollFrame!==null&&cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null,this._endFrame!==null&&cancelAnimationFrame(this._endFrame),this._endFrame=null}_dropMenu(){let e=$(this,`.wui-select-menu`,HTMLElement);e&&h(e)}_activePartsList(){return this._partsMounted?r(this._parts,`The mounted parts are missing.`):[]}_ensureParts(){if(!this.isConnected)return;(this.hasAttribute(`source`)||this.hasAttribute(`remote`)||this.hasAttribute(`recents-key`)||this._loadOptionsFn!==null)&&this._loadWindow();let e=Le(this,this.mode),t=e.join(`,`);if(t===this._partSig)return;this._teardownParts(),this._parts=null,this._partSig=t;let n=++this._partToken;Promise.all(e.map(e=>He(this,e))).then(e=>{n===this._partToken&&(this._parts=e.filter(e=>e!==null),this._mountParts())})}_loadWindow(){this._windowLoad===null&&(this._windowLoad=xe().then(()=>this.renderList(),()=>{this._windowFailed=!0,document.dispatchEvent(new CustomEvent(u,{bubbles:!0,composed:!0,detail:{chunk:`select-window`}})),this.setError(Z().partLoadMessage)}))}_mountParts(e={draft:``,query:``}){if(!this._parts||this._partsMounted||!this._rendered||!this.isConnected)return;this._partsMounted=!0;let t=Ee(this._refs());for(let n of this._parts)n.mount(this,t,{carry:e});this._drawValue(),this.renderList()}_teardownParts(){let e=this._activePartsList();this._partsMounted=!1;for(let t of e)t.teardown()}_remountParts(){if(!this._partsMounted)return;let e=this._carry();this._teardownParts(),this._mountParts(e)}_carry(){let e=this._refs();return{draft:e.input?.value??``,query:e.search?.value??``}}},Ee=e=>{let{control:t,value:n,menu:i,list:a}=e;return{control:r(t,`control missing`),value:r(n,`value missing`),menu:r(i,`menu missing`),list:r(a,`list missing`),search:e.search,input:e.input}},De=e=>re.includes(e),Oe=[`comfortable`,`compact`],ke=150,Ae=250,je=10,Me=()=>{let e=Z();return{single:e.placeholder,search:e.placeholder,multiple:e.placeholder,tag:e.tagPlaceholder,country:e.countryPlaceholder}},Ne=/* @__PURE__ */ new Set([`countries`,`suggested`,`suggested-label`,`all-countries-label`,`max-tags`,`pattern`,`collapse-chips`,`source`,`remote`,`min-chars`]),Pe=/* @__PURE__ */ new Set([`separators`,`allow-duplicates`,`invalid-message`,`create-label`,`add-label`,`selected-text`,`clear-all-label`,`value-label`,`value-avatar`,`value-initials`,`hint-text`,`recents-key`,`recents-limit`,`recents-label`]),Fe=[[`icon`,`icon`],[`description`,`description`],[`meta`,`meta`],[`group`,`group`],[`avatar`,`avatar`],[`initials`,`initials`],[`disabled-hint`,`disabledHint`]],Q=(e,t)=>t?Array.isArray(e)?e.map(String):e==null||e===``?[]:String(e).split(`,`).map(e=>e.trim()).filter(Boolean):Array.isArray(e)?e.length?String(e[0]):``:e==null?``:String(e),Ie=(e,t)=>t===`multiple`?W(e)?[`chips`,`search`]:[`chips`]:t===`search`?[`search`]:t===`country`?[`country`]:t===`tag`?W(e)?[`chips`,`search`]:[`chips`]:[],Le=(e,t)=>e.hasAttribute(`recents-key`)?[`recents`,...Ie(e,t)]:Ie(e,t),Re=e=>typeof e==`object`&&!!e&&`default`in e&&typeof e.default==`function`,ze=e=>{if(e.target instanceof Element)return e.target;throw Error(`The event target is not an element.`)},$=(e,t,n)=>{let r=e.querySelector(t);return r instanceof n?r:null},Be=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),Ve=e=>{let t=e.textContent;if(t===null)throw Error(`The element has no text.`);return t},He=(e,t)=>ie(t).then(e=>{if(!Re(e))throw Error(`The part ${t} has no default export.`);return e.default()}).catch(()=>(document.dispatchEvent(new CustomEvent(u,{bubbles:!0,composed:!0,detail:{chunk:t}})),e.setError(Z().partLoadMessage),null));export{W as n,A as r,Te as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./dom-DMQu--xV.js";import{n as t,t as n}from"./fieldState-D-zQcXUS.js";import{t as r}from"./iconGlyphs.g-a9FtjPXh.js";import{n as i}from"./imeSafeEnter-DeO_3lXy.js";import{s as a}from"./nativeOverlay-BHD2QV02.js";import{n as o,r as s,t as c}from"./optionLabel-wbpl8OTJ.js";import{r as l,t as u}from"./textStore-DBplASiZ.js";import{r as d}from"./search.g-
|
|
1
|
+
import{r as e}from"./dom-DMQu--xV.js";import{n as t,t as n}from"./fieldState-D-zQcXUS.js";import{t as r}from"./iconGlyphs.g-a9FtjPXh.js";import{n as i}from"./imeSafeEnter-DeO_3lXy.js";import{s as a}from"./nativeOverlay-BHD2QV02.js";import{n as o,r as s,t as c}from"./optionLabel-wbpl8OTJ.js";import{r as l,t as u}from"./textStore-DBplASiZ.js";import{r as d}from"./search.g-chn0itlW.js";import{t as ee}from"./customRule-BpwcjVLb.js";import{r as f}from"./WuiSelect-C1NNAsFQ.js";var p={enter:`Enter`,comma:`,`,space:` `,tab:`Tab`},m={enter:`
|
|
2
2
|
`,comma:`,`,space:` `,tab:` `},te=e=>p[e],h=e=>m[e];function ne(e,t){let n=[String(e??``)];for(let e of t)n=n.flatMap(t=>t.split(e));return n.map(e=>e.trim()).filter(Boolean)}var re=(e,t)=>t.some(t=>String(e??``).includes(t)),g=()=>l(`select`,d),_=/* @__PURE__ */ new WeakMap;function v(e,t){if(e===null)throw TypeError(`The chip row needs ${t}, and it is not mounted.`);return e}function y(){let l,d,p=null,m=null,y=null,b=null,x=null,S=null,C=null,w=!1,T=()=>v(m,`the draft input`),E=()=>l.mode===`tag`,D=()=>Array.isArray(l.value)?l.value.slice():[],O=()=>(l.getAttribute(`separators`)||`enter,comma`).split(`,`).map(e=>e.trim()).filter(Boolean),ie=()=>new Set(O().map(te).filter(Boolean)),k=()=>{let e=parseInt(l.getAttribute(`max-tags`)??``,10)||0;return Math.max(e,0)},A=()=>{let e=k();return e>0&&D().length>=e},j=(e,t)=>!l.hasAttribute(`allow-duplicates`)&&e.some(e=>e.toLowerCase()===t.toLowerCase()),M=()=>{let e=_.get(l);return e||(e=/* @__PURE__ */ new Map,_.set(l,e)),e},N=e=>(l.options||[]).find(t=>String(t.value)===String(e))??M().get(String(e)),P=e=>{let t=M();for(let n of l.options||[])e.includes(String(n.value))&&t.set(String(n.value),n);for(let n of t.keys())e.includes(n)||t.delete(n)},F=e=>{let t=e.trim().toLowerCase();return(l.options||[]).find(e=>String(e.value??``).toLowerCase()===t||o(e).trim().toLowerCase()===t)},ae=e=>{for(let t of O()){let n=h(t)??t;if(re(e,[n]))return ne(e,[n])}return[e.trim()]},I=()=>m?m.value:l._query||``,oe=()=>E()||l.hasAttribute(`allow-custom`),se=()=>l.getAttribute(`placeholder`)||(E()?g().tagPlaceholder:g().placeholder),ce=()=>{let e=l.getAttribute(`aria-label`);if(e)return e;let t=l.closest(`label`)?.textContent?.trim();if(t)return t;let n=l.id;return(n?[...document.querySelectorAll(`label[for]`)].find(e=>e instanceof HTMLLabelElement&&e.htmlFor===n):void 0)?.textContent?.trim()||(E()?g().addTagsLabel:g().fallbackName)},L=()=>{m&&(m.setAttribute(`aria-expanded`,String(a(d.menu))),d.list.id&&m.setAttribute(`aria-controls`,d.list.id),m.setAttribute(`aria-label`,ce()))},le=()=>!t(l)&&!l.hasAttribute(`loading`),ue=e=>{w=!0,T().setAttribute(`aria-invalid`,`true`),l.setError(e)},R=()=>{w&&(w=!1,T().removeAttribute(`aria-invalid`),l.setError(null))},z=(e,{quiet:t=!1,strip:n=!1}={})=>{let r=D(),i=r.slice(),a=k(),o=[],s=``,c=!1;for(let t of e){let e=(n?t.trim().replace(/,+$/,``):t).trim();if(!e)continue;if(a&&i.length>=a)break;let r=F(e);if(r){if(r.disabled){o.push(e),s||=r.disabledHint||l.getAttribute(`invalid-message`)||g().invalidMessage;continue}j(i,String(r.value))||i.push(String(r.value));continue}let u=ee(l,e);u?(o.push(e),s||=u):j(i,e)||(i.push(e),c=!0)}i.length!==r.length&&(c?l.commit(i,{isCustom:!0}):l.commit(i)),T().value=o.join(`, `),s?t||ue(s):R()},B=e=>{n(l)||z([T().value],e)},V=e=>l.commit(D().filter(t=>t!==e)),H=()=>e(`span`,{class:`wui-select-placeholder`},l.getAttribute(`placeholder`)||g().placeholder),de=t=>{let n=N(t),i=e(`span`,{class:`chip chip-sm`}),a=e(`span`,{class:`chip-label`});if(a.replaceChildren(...n?c(n):[t]),i.append(a),le()){let a=n?o(n):s(t),c=e(`button`,{class:`chip-remove`,type:`button`,"data-remove":t,"aria-label":u(g().removeText,{text:a})}),l=r(`x`);l&&c.replaceChildren(l),i.append(c)}return i};function U(){if(!p)return;p.querySelector(`:scope > .chip-more`)?.remove();let t=[...p.querySelectorAll(`:scope > .chip`)].map(e=>{if(!(e instanceof HTMLElement))throw Error(`The chip row holds a node that is not an element.`);return e});for(let e of t)e.style.display=``;let n=t[t.length-1];if(!l.hasAttribute(`collapse-chips`)||!n)return;let r=p.clientWidth,i=e=>e.offsetLeft+e.offsetWidth;if(i(n)<=r)return;let a=e(`span`,{class:`chip chip-sm chip-more`});a.textContent=`+${t.length}`,n.after(a);let o=a.offsetWidth+6,s=0;for(let e of t)if(i(e)<=r-o)s+=1;else break;s<1&&(s=1);for(let e of t.slice(s))e.style.display=`none`;a.textContent=`+${t.length-s}`}function W(){if(!p)return!1;p.parentNode!==d.value&&d.value.append(p);for(let e of p.querySelectorAll(`:scope > .chip, :scope > .wui-select-placeholder`))e.remove();let e=D();P(e);let t=p,r=e=>{m?t.insertBefore(e,m):t.append(e)};E()||m||e.length||r(H());for(let t of e)r(de(t));return m&&(m.placeholder=E()||!e.length?se():``,m.disabled=l.hasAttribute(`disabled`),m.readOnly=n(l),L()),E()||(v(b,`the footer text`).textContent=(()=>{let t=l.getAttribute(`selected-text`);return t?t.replace(`{n}`,()=>String(e.length)):u(g().selectedText,{count:e.length})})(),v(x,`the clear-all button`).textContent=l.getAttribute(`clear-all-label`)||g().clearAllLabel),U(),!0}function fe(e){if(e.key===`Backspace`){let t=m?!I():!I()&&a(d.menu),n=D(),r=n[n.length-1];return!t||r===void 0?!1:(e.preventDefault(),V(r),!0)}if(!m)return!1;let t=m.value;if(e.key===`Escape`){if(!E())return!1;let n=a(d.menu);return!n&&!t?!1:(e.preventDefault(),n&&e.stopPropagation(),m.value=``,R(),l.closeMenu({focusControl:!1}),!0)}let n=!E()&&!t.trim(),r=ie();return i(e)&&r.has(`Enter`)?n||d.list.querySelector(`.is-active`)?!1:(e.preventDefault(),B(),!0):e.key===`,`&&r.has(`,`)?!n&&(e.preventDefault(),B({strip:!0}),!0):e.key===` `&&r.has(` `)&&t.trim()||e.key===`Tab`&&r.has(`Tab`)&&!n?(e.preventDefault(),B(),!0):!1}function pe(e){let t=String(e.value);if(E()||m&&!N(t))return z([t]),!0;let n=D();return n.includes(t)?l.commit(n.filter(e=>e!==t)):m?z([t]):l.commit([...n,t]),m?.value&&(m.value=``,R()),!0}function G(e){if(!m)return null;let t=String(e??``).trim().replace(/,+$/,``).trim();if(!t||A()||F(t)||j(D(),t))return null;let n=l.getAttribute(`create-label`)||g().createLabel;return{position:E()?`top`:`bottom`,label:n.replace(`{text}`,()=>t),value:t}}function K(e){let t=e.target,r=t instanceof Element?t.closest(`[data-remove]`):null;if(r instanceof HTMLElement){if(n(l))return;e.stopPropagation(),V(r.dataset.remove??``),m?.focus()}else m&&!n(l)&&m.focus()}function q(){R();let e=T().value.trim();E()||!e||a(d.menu)||(G(e)||f(l.options||[],e).length)&&l.openMenu()}function J(e){e.preventDefault(),n(l)||z(ae(e.clipboardData?.getData(`text/plain`)??``))}function Y(){T().value.trim()&&B({quiet:!0,strip:!0}),l.closeMenu({focusControl:!1})}function X(e){e.relatedTarget instanceof Node&&l.contains(e.relatedTarget)||Y()}function me(){return m?(Y(),!0):!1}function Z(){T().value.trim()&&B({strip:!0})}function Q(){n(l)||l.commit([])}function $(e){e.target!==m&&e.preventDefault()}function he(t,n,r={}){l=t,d=n,p=e(`div`,{class:`wui-select-chips`}),p.addEventListener(`click`,K),d.value.append(p),oe()&&(m=e(`input`,{class:`wui-select-draft`,type:`text`,autocomplete:`off`,role:`combobox`,"aria-autocomplete":`list`}),l.hasAttribute(`required`)&&m.setAttribute(`aria-required`,`true`),d.menu.addEventListener(`toggle`,L),p.append(m),m.value=r.carry?.draft??``,d.input=m,m.addEventListener(`input`,q),m.addEventListener(`paste`,J),m.addEventListener(`blur`,X),p.addEventListener(`mousedown`,$),S=l.closest(`form`),S?.addEventListener(`submit`,Z,!0)),E()||(y=e(`div`,{class:`wui-select-footer`}),b=document.createElement(`span`),x=e(`button`,{class:`wui-select-clear-all`,type:`button`}),x.addEventListener(`click`,Q),y.append(b,x),d.menu.append(y)),typeof ResizeObserver<`u`&&(C=new ResizeObserver(U),C.observe(p)),W()}function ge(){p?.removeEventListener(`click`,K),p?.removeEventListener(`mousedown`,$),m&&(m.removeEventListener(`input`,q),m.removeEventListener(`paste`,J),m.removeEventListener(`blur`,X),d.input=null),x&&x.removeEventListener(`click`,Q),S?.removeEventListener(`submit`,Z,!0),S=null,C?.disconnect(),C=null,d.menu.removeEventListener(`toggle`,L),y?.remove(),p?.remove(),p=null,m=null,y=null,w=!1}return{mount:he,onKey:fe,onPick:pe,renderValue:W,actionRow:G,onQuery:()=>!1,onBlur:me,teardown:ge}}export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./countries-DQL9nAUt.js";import{r as t}from"./textStore-DBplASiZ.js";import{r as n}from"./search.g-
|
|
1
|
+
import{t as e}from"./countries-DQL9nAUt.js";import{r as t}from"./textStore-DBplASiZ.js";import{r as n}from"./search.g-chn0itlW.js";var r=()=>t(`select`,n),i=/^\+?\d+$/,a=e=>String(e??``).split(`,`).map(e=>e.trim().toUpperCase()).filter(Boolean),o=t=>{let n=a(t.getAttribute(`countries`)),i=n.length?new Set(n):null,o=e.filter(([e])=>!i||i.has(e)),s=new Map(o.map(e=>[e[0],e])),c=[...new Set(a(t.getAttribute(`suggested`)))].map(e=>s.get(e)).filter(e=>e!==void 0);if(!c.length)return o.map(e=>({tuple:e,group:null}));let l=new Set(c.map(e=>e[0])),u=t.getAttribute(`suggested-label`)||r().suggestedLabel,d=t.getAttribute(`all-countries-label`)||r().allCountriesLabel;return[...c.map(e=>({tuple:e,group:u})),...o.filter(e=>!l.has(e[0])).map(e=>({tuple:e,group:d}))]},s=({tuple:[e,t,n],group:r})=>({value:e,label:t,flag:e,meta:`+${n}`,...r?{group:r}:{}}),c=([,e,t],n)=>n?i.test(n)?t.startsWith(n.replace(`+`,``)):e.toLowerCase().includes(n):!0;function l(){let e,t=[];return{mount(n){e=n,t=o(n),n.setPartOptions(t.map(s))},onQuery(n){let r=n.trim().toLowerCase();return e.setPartOptions(t.filter(e=>c(e.tuple,r)).map(s)),!0},teardown(){}}}export{l as default};
|
package/dist/elements/select.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiSelect-
|
|
1
|
+
import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiSelect-C1NNAsFQ.js";e(`wui-select`,t);export{t as WuiSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./devWarn-DXdRWZs3.js";import{r as t}from"./textStore-DBplASiZ.js";import{r as n}from"./search.g-
|
|
1
|
+
import{n as e}from"./devWarn-DXdRWZs3.js";import{r as t}from"./textStore-DBplASiZ.js";import{r as n}from"./search.g-chn0itlW.js";var r=()=>t(`select`,n),i=5,a=20;function o(){let t,n=null,o=()=>t.getAttribute(`recents-key`)??``,s=()=>t.mode!==`tag`&&o()!==``,c=(t,r)=>{t!==n&&(n=t,e(`<wui-select> recents-limit "${t}" ${r}.`))},l=()=>{let e=t.getAttribute(`recents-limit`);if(e===null)return i;let n=Number(e);return!Number.isInteger(n)||n<1?(c(e,`is not a whole number from 1 to 20; 5 is used`),i):n>a?(c(e,`is over 20; 20 is used`),a):n},u=()=>{let e;try{e=JSON.parse(globalThis.localStorage?.getItem(o())??`[]`)}catch{return[]}return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]},d=e=>{try{globalThis.localStorage?.setItem(o(),JSON.stringify(e))}catch(e){if(!(e instanceof DOMException))throw e}};return{mount(n){t=n,t.mode===`tag`?e(`<wui-select> recents-key is not used in mode "tag"; it is ignored.`):o()===``&&e(`<wui-select> recents-key is empty; no recents are kept.`)},onPick(e,n){if(!s()||n?.isCustom)return!1;let r=String(e.value);return r===``||Array.isArray(t.value)&&t.value.includes(r)||d([r,...u().filter(e=>e!==r)].slice(0,l())),!1},recents(e){if(!s())return null;let n=l(),i=[];for(let t of u()){let r=e.find(e=>String(e.value)===t);if(r&&!r.disabled&&i.push(r),i.length===n)break}return i.length?{label:t.getAttribute(`recents-label`)||r().recentsLabel,options:i}:null},teardown(){}}}export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./devWarn-DXdRWZs3.js";import{n as t}from"./optionLabel-wbpl8OTJ.js";import{r as n}from"./textStore-DBplASiZ.js";import{r}from"./search.g-chn0itlW.js";import{t as i}from"./customRule-BpwcjVLb.js";import{n as a}from"./WuiSelect-C1NNAsFQ.js";var o=()=>n(`select`,r);function s(e){if(Array.isArray(e))return{options:e,hasMore:!1};if(typeof e==`object`&&e&&`options`in e&&`hasMore`in e){let{options:t,hasMore:n}=e;if(Array.isArray(t)&&typeof n==`boolean`)return{options:t,hasMore:n}}throw TypeError(`search results must be an array or { options, hasMore }`)}var c=(e,n)=>{let r=n.toLowerCase(),i=e.getAttribute(`value-label`);return i&&String(e.value??``)!==``&&i.toLowerCase()===r?!0:e.options.some(e=>t(e).toLowerCase()===r||String(e.value??``).toLowerCase()===r)},l=e=>{if(e.querySelector(`.wui-select-spacer`))return null;let t=[...e.querySelectorAll(`.wui-select-option`)].filter(e=>e.dataset.custom!==`true`&&e.getAttribute(`aria-disabled`)!==`true`);return t.length===1?t[0]?.dataset.value??null:null};function u(){let t,n,r=0,u,d=null,f=null,p=``,m=null,h=!1,g=[],_=0,v=!1,y=``,b=()=>a(t),x=()=>typeof t.loadOptions!=`function`&&!t.getAttribute(`source`),S=(e,n,r)=>{let i=t.getAttribute(e);if(i==null||i.trim()===``)return n;let a=Number(i);return r(a)?a:n},C=()=>S(`min-chars`,1,e=>Number.isInteger(e)&&e>=0),w=()=>S(`debounce`,250,e=>Number.isFinite(e)&&e>=0),T=()=>{d?.abort(),d=null};function E(e,n,r){if(typeof t.loadOptions==`function`)return t.loadOptions(e,{signal:r,page:n});let i=t.getAttribute(`source`);if(i===null)throw Error(`search source attribute missing`);let a=`${i}${i.includes(`?`)?`&`:`?`}q=${encodeURIComponent(e)}&page=${n}`;return fetch(a,{signal:r,credentials:`same-origin`,headers:{Accept:`application/json`}}).then(e=>{if(!e.ok)throw Error(`search request failed with status ${e.status}`);return e.json()})}function D(r,i,a,o){if(a){if(e(`wui-select: search failed`,o),v=!1,i>1){t.setStatus(`idle`);return}g=[],t.setPartOptions([]),t.setStatus(`empty`)}else _=i,v=r.hasMore,g=i>1?[...g,...r.options]:r.options,i===1&&(n.list.scrollTop=0),t.setPartOptions(g),t.setStatus(g.length?`idle`:`empty`)}async function O(e,t,n,i){let a={options:[],hasMore:!1},o=!1,c=null;try{a=s(await E(e,t,i))}catch(e){o=!0,c=e??/* @__PURE__ */ Error(`search failed`)}finally{n===r&&(d=null,D(a,t,o,c))}}function k(e){let n=r;T(),_=0,v=!1,y=e,x()?(h=!0,t.setStatus(`loading`)):(d=new AbortController,t.setStatus(`loading`),O(e,1,n,d.signal))}let A=(e,n)=>t.dispatchEvent(new CustomEvent(`search`,{bubbles:!0,detail:{query:e,seq:n}}));function j(e){r+=1,T(),clearTimeout(u),u=void 0,e.trim().length<C()?(t.setPartOptions([]),t.setStatus(`hint`)):(A(e,r),k(e))}return{mount(e,r,i={}){t=e,n=r;let a=n.search?.value??``;n.search&&i.carry?.query&&a===``&&(n.search.value=i.carry.query),a.trim()!==``&&t._onQueryChange(a)},onQuery(e){if(r+=1,T(),clearTimeout(u),u=void 0,p=e,m=null,h=!1,v=!1,!b())return!1;if(e.trim().length<C())return t.setPartOptions([]),t.setStatus(`hint`),!0;let n=r;return u=setTimeout(()=>{u=void 0,A(e,n),k(e)},w()),!0},onOpen(){if(b()){if(m!==null){let e=m;m=null,j(e)}else C()===0&&t._query.trim()===``&&j(``)}},onListEnd(){v&&d===null&&u===void 0&&!x()&&(d=new AbortController,t.setStatus(`more`),O(y,_+1,r,d.signal))},onOptions(){h&&(h=!1,t.setStatus(t.options.length?`idle`:`empty`))},onBlur(){if(t.mode!==`search`)return!1;let e=(n.search?.value??``).trim();if(!e||e===String(t.value))return!1;if(t.hasAttribute(`allow-custom`)&&!c(t,e)){let n=i(t,e);return n?(t.setError(n),!1):(t.commit(e,{isCustom:!0}),!0)}let r=l(n.list);return r===null||r===String(t.value)?!1:(t.commit(r,{isCustom:!1}),t.closeMenu(),!0)},actionRow(e){if(f=null,t.mode!==`search`||!t.hasAttribute(`allow-custom`))return null;let n=e.trim();return!n||c(t,n)?null:(f={position:`bottom`,label:(t.getAttribute(`add-label`)??o().addLabel).replaceAll(`{query}`,n),value:n},f)},onPick(e){if(!f||e.value!==f.value||e.label!==f.label)return!1;let n=f.value;return f=null,t.commit(n,{isCustom:!0}),!0},renderValue(){let e=t.value;if(t.mode!==`search`||!e||t.options.some(t=>String(t.value)===String(e)))return!1;let r=t.getAttribute(`value-label`);return r?(n.value.classList.remove(`wui-select-placeholder`),n.value.textContent=r,!0):!1},teardown(){(u!==void 0||d!==null||h)&&(m=p),h=!1,v=!1,r+=1,clearTimeout(u),u=void 0,T(),f=null}}}export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={addLabel:`Add '{query}'`,addTagsLabel:`Add tags`,allCountriesLabel:`All countries`,clearAllLabel:`Clear all`,clearSelectionLabel:`Clear selection`,countryPlaceholder:`Select country`,countrySearchPlaceholder:`Search countries…`,createLabel:`Create '{text}'`,defaultSearchPlaceholder:`Search {labelText}…`,emptyText:`No matches`,fallbackName:`Select`,helpLabel:`More information`,hintText:`Type to search…`,invalidMessage:`That option is not available.`,loadingMoreText:`Loading more…`,optionalLabel:`(optional)`,partLoadMessage:`This control could not load. Reload the page.`,placeholder:`Select…`,recentsLabel:`Recent`,removeText:`Remove {text}`,searchingText:`Searching…`,selectedText:`{count} selected`,suggestedLabel:`Suggested`,tagPlaceholder:`Add…`},t={requiredFieldMessage:`Please fill in this field.`},n={clearLabel:`Clear search`,placeholder:`Search…`,searchLabel:`Search`};export{t as n,e as r,n as t};
|
package/dist/text/en.json
CHANGED
|
@@ -507,6 +507,8 @@
|
|
|
507
507
|
"maxSizeText": "up to {size} MB",
|
|
508
508
|
"optionalLabel": "(optional)",
|
|
509
509
|
"previewAltText": "{label} preview",
|
|
510
|
+
"previewError": "This image could not be loaded.",
|
|
511
|
+
"previewRetry": "Try again",
|
|
510
512
|
"removeFileLabel": "Remove {name}",
|
|
511
513
|
"removeNamedText": "Remove {label}",
|
|
512
514
|
"selectedPreviewText": "Selected {noun} preview"
|
|
@@ -1257,6 +1259,7 @@
|
|
|
1257
1259
|
"helpLabel": "More information",
|
|
1258
1260
|
"hintText": "Type to search…",
|
|
1259
1261
|
"invalidMessage": "That option is not available.",
|
|
1262
|
+
"loadingMoreText": "Loading more…",
|
|
1260
1263
|
"optionalLabel": "(optional)",
|
|
1261
1264
|
"partLoadMessage": "This control could not load. Reload the page.",
|
|
1262
1265
|
"placeholder": "Select…",
|
package/dist/text.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,t as a}from"./textStore-DBplASiZ.js";import{t as o}from"./shortcutKeys.g-C0TeAfYL.js";import{t as s}from"./formatters.g-BNAu1PMe.js";import{t as c}from"./kanban.g-dtKYyIpr.js";import{t as l}from"./httpFailure.g-DjZzGxPj.js";import{t as u}from"./carousel.g-Bw_pFDzc.js";import{t as d}from"./codeBlock.g-BCF2IlK-.js";import{t as f}from"./commandPalette.g-DP-Zl8SU.js";import{t as p}from"./commentThread.g-C7L18Tvy.js";import{t as m}from"./mentionInput.g-DJo6d2Gm.js";import{t as h}from"./consentBanner.g-CZAb1BLJ.js";import{t as g}from"./dashboardGrid.g-vkCZGw6G.js";import{t as _}from"./dataTable.g-1PsmN1Nj.js";import{t as v}from"./tableSelect.g-DwI5_9Nw.js";import{t as y}from"./datePicker.g-sGQE8c3n.js";import{t as b}from"./dateRangePicker.g-Pnc37vgX.js";import{t as x}from"./drawer.g-B-zYKBfQ.js";import{t as S}from"./gantt.g-CWvMXwBR.js";import{t as C}from"./imageCrop.g-BnbAeH2Q.js";import{n as w,t as T}from"./inlineEdit.g-DKIhYoPF.js";import{t as E}from"./leadPopup.g-BfMPz9nH.js";import{t as D}from"./lightbox.g-DDrycPou.js";import{t as O}from"./notificationCentre.g-Cees-vKg.js";import{t as k}from"./orgTree.g-CIg75quV.js";import{t as A}from"./overflow.g-BfcGEhwR.js";import{t as j}from"./phone.g-P66U-SK5.js";import{t as M}from"./relativeTime.g-BH90tjJM.js";import{t as N}from"./savedViews.g-CzzEliTR.js";import{n as P,r as F,t as I}from"./search.g-B5d1s59A.js";import{t as L}from"./showMore.g-BdQ5MUSd.js";import{t as R}from"./slider.g-BPNfxZEV.js";import{t as z}from"./sortable.g-BsTKys5-.js";import{t as B}from"./timePicker.g-IEczeE48.js";import{n as V,t as H}from"./tourAdvance.g-BJqDnqag.js";import{t as U}from"./tree.g-RId8xZSk.js";import{t as W}from"./treePicker.g-BR35ru5f.js";import{t as G}from"./wizard.g-UKG1dMs_.js";import{t as K}from"./rowDrop.g-DQpB10Ey.js";import{i as q,n as J,r as Y,t as X}from"./toast.g-CJ8c0BNZ.js";import{i as Z,n as Q,r as $,t as ee}from"./passwordRules.g-CMYrohdd.js";import{t as te}from"./customRule.g-Cfkl3_ZC.js";import{t as ne}from"./shell.g-BhC11Oe3.js";var re={label:`Switch account`},ie={addLabel:`Add`,empty:`Nothing to show`,label:`Agenda`,showMore:`Show {count} more`},ae={closeLabel:`Close alert`},oe={photoLabel:`Profile photo`},se={moreLabel:`{count} more`},ce={dismissLabel:`Dismiss`},le={moreLabel:`Show hidden levels`},ue={agendaLabel:`Agenda`,allDayDateText:`all day, {start}`,allDayLabel:`All day`,calendarViewLabel:`Calendar view`,dayLabel:`Day`,emptyText:`Nothing scheduled in this period.`,errorText:`The events couldn't load. Try again in a moment.`,label:`Calendar`,listLabel:`List`,loadFailedText:`This calendar couldn't load. Try again in a moment.`,monthLabel:`Month`,moveThroughCalendarLabel:`Move through the calendar`,nextLabel:`Next`,previousLabel:`Previous`,rangeTitleText:`{start} to {last}`,timelineLabel:`Timeline`,todayLabel:`Today`,tryAgainLabel:`Try again`,weekLabel:`Week`},de={closeLabel:`Close`},fe={now:`Now`,was:`Was`},pe={aboveLabel:`Above`,areaChartLabel:`Area chart`,arrowKeysText:`{title}: use the arrow keys to read the values`,bandLabel:`Band`,barChartLabel:`Bar chart`,belowLabel:`Below`,bubbleChartLabel:`Bubble chart`,calendarHeatmapLabel:`Calendar heatmap`,calendarRangeText:`, from {first} to {last}`,calendarSummaryTextOne:`Calendar heatmap of {label}, {n} day.`,calendarSummaryTextOther:`Calendar heatmap of {label}, {n} days{range}.`,categoryLabel:`Category`,centerLabel:`Total`,changeLabel:`Change`,chartLabel:`chart`,columnChartLabel:`Column chart`,columnFallbackLabel:`column`,columnXLabel:`X`,constantSpanText:`{label} is {lo}.`,currencyFormatText:`This chart's currency format needs a currency code, such as "INR", in its currency field.`,dataSuffixLabel:`data`,dateLabel:`Date`,donutChartLabel:`Donut chart`,donutLargestText:`{top} is the largest, at {share}.`,donutSummaryTextOne:`Donut chart of {label} in {rows} part, {total} in all.`,donutSummaryTextOther:`Donut chart of {label} in {rows} parts, {total} in all.`,emptyText:`No data to show for this chart.`,errorText:`This chart couldn't load. Try again in a moment.`,everySeriesHiddenText:`Every series is hidden.`,firstStageLabel:`first stage`,fromLabel:`From`,funnelChartLabel:`Funnel chart`,funnelPreviousStepText:`{share} of previous step`,funnelStartText:`{first} is {firstValue} and {last} is {lastValue}, {share} of the start.`,funnelSummaryText:`Funnel chart of {label} in {n} stages.`,gaugeBandText:`, in the {band} band`,gaugeLabel:`Gauge`,gaugeSummaryText:`{type}: {label} is {value} on a scale from {min} to {max}{band}.`,groupLabel:`Group`,groupsTextOne:` in {count} group: {groups}`,groupsTextOther:` in {count} groups: {groups}`,heatmapLabel:`Heatmap`,heatmapSummaryText:`Heatmap of {label} by {group} and {x}, {n} cells.`,highestAtLowestAtText:`Highest is {highValue} at {highGroup}, {high}; lowest is {lowValue} at {lowGroup}, {low}.`,highestLowestText:`Highest is {maxValue} on {max}; lowest is {minValue} on {min}.`,itemLabel:`Item`,largestFallText:`The largest fall is {xText}, {signed}.`,largestFlowText:`The largest flow is {xText} to {toText}, {fmtAt}.`,largestRiseText:`The largest rise is {xText}, {signed}.`,latestText:`Latest {latest}`,legendLabel:`Legend`,lessLabel:`Less`,lineChartLabel:`Line chart`,loadingText:`Loading chart`,measureLabel:`Measure`,moreLabel:`More`,ofFirstStepText:`Of {first}`,ofPreviousStepLabel:`Of previous step`,openingShareText:`{share} of opening`,opensAtClosesAtText:`It opens at {opening} and closes at {closing}.`,otherLabel:`Other`,pointsSummaryTextOne:`{n} point, {first}.`,pointsSummaryTextOther:`{n} points, from {first} to {last}.`,rangeSpanText:`{label} runs from {lo} to {hi}.`,rowFallbackLabel:`row`,rowLabel:`Row`,runningTotalLabel:`Running total`,sankeyLabel:`Sankey diagram`,sankeySummaryText:`Sankey diagram of {label}: {n} flows between {nodes} places.`,scaleLabel:`Scale`,scaleRangeText:`{min} to {max}`,scatterPlotLabel:`Scatter plot`,scatterSummaryText:`{type} of {label} against {xLabel}, {count} points{groups}.`,shareLabel:`Share`,shareOfAllLabel:`Share of all`,shareOfGroupLabel:`Share of group`,shareOfParentText:`Share of {parent}`,shareOfStepText:`{share} of {first}`,sharedAxisText:`, sharing one x axis`,showingFirstRowsDownloadText:`Showing the first {rows} of {total} rows. Download the CSV for all of them.`,smallMultiplesLabel:`Small multiples`,soFarText:`so far`,stackedPercentText:`, stacked to 100%`,stackedText:`, stacked`,stageLabel:`Stage`,stepLabel:`Step`,summaryText:`{type} of {series}{stacked}{sharedAxis}.`,targetGapText:`{direction} {label} by {gap}`,targetLabel:`target`,toLabel:`To`,tooManyGroupsText:`This chart has more groups than it can show clearly.`,tooManySeriesText:`This chart has more series than it can show clearly.`,totalText:`Total {total}`,treemapEmptyText:`Treemap of {label}: no items.`,treemapLabel:`Treemap`,treemapLargestGroupText:`{name} is the largest group, at {share}.`,treemapSummaryText:`Treemap of {label}: {n} items in {totals} groups, {total} in all.`,trendLabel:`Trend`,untitledLabel:`Chart`,waterfallLabel:`Waterfall chart`,waterfallSummaryText:`Waterfall chart of {label}.`},me={chartViewLabel:`Chart`,downloadCsvLabel:`Download CSV`,downloadPngLabel:`Download PNG`,legendLabel:`Show legend`,legendTitle:`Show or hide the legend`,moreActionsForLabel:`More actions for {title}`,moreActionsLabel:`More actions`,retryLabel:`Try again`,tableViewLabel:`Table`,viewLabel:`View`},he={helpLabel:`More information`},ge={helpLabel:`More information`},_e={removeLabel:`Remove`,removeText:`Remove {content}`},ve={moreLabel:`More`},ye={helpLabel:`More information`},be={helpLabel:`More information`},xe={colourLabel:`Colour`,colourPickerLabel:`{label}, colour picker`,helpLabel:`More information`,optionalLabel:`(optional)`},Se={label:`Columns`},Ce={noLabel:`No`,partialLabel:`Partial`,warningLabel:`Warning`,yesLabel:`Yes`},we={title:`Are you sure?`},Te={ariaLabel:`Context menu`,searchPlaceholder:`Search`},Ee={copiedLabel:`Copied`,label:`Copy`},De={amLabel:`am`,pmLabel:`pm`,updatedLabel:`Updated {time} IST`},Oe={label:`Menu`,noMatch:`No matches.`,noMatchText:`No matches.`,searchPlaceholder:`Search`},ke={anyTypeText:`Any file type`,browseLabel:`Click to upload`,dropLabel:`or drag & drop`,maxSizeText:`up to {size} MB`,removeAttachmentLabel:`Remove attachment`},Ae={daysLeftLabel:`{days} days left`,dueInLabel:`Due in {days} days`,dueTodayLabel:`Due today`,dueTomorrowLabel:`Due tomorrow`,notSetLabel:`Not set`,oneDayLeftLabel:`1 day left`,overdueSinceLabel:`Overdue since {date}`},je={addLabel:`Add line`,cancelLabel:`Cancel`,commitNextLabel:`Save and go to the next line`,commitStayLabel:`Save`,dirtyLabel:`Changed`,discardLabel:`Discard changes`,emptyLabel:`No lines yet`,failedLabel:`Not saved`,label:`Entry lines`,moveLabel:`Move between lines`,removeLineLabel:`Remove line`,rowActionsLabel:`Actions`,savedLabel:`Saved`,savingLabel:`Saving`,statusLabel:`Status`},Me={reloadPageLabel:`Reload the page`},Ne={titleOne:`Fix {count} field to continue`,titleOther:`Fix {count} fields to continue`},Pe={attachmentLabel:`attachment`,browseLabel:`Browse`,dropFileTitleOne:`Add a file`,dropFileTitleOther:`Add files`,dropImageTitleOne:`Add an image`,dropImageTitleOther:`Add images`,dropTitleOne:`Add {article} {noun}`,dropTitleOther:`Add {noun}s`,label:`Attachment`,maxSizeText:`Up to {size} MB`,optionalLabel:`(optional)`,removeFileLabel:`Remove {name}`,removeLabel:`Remove attachment`,typesAndMaxSizeText:`{types}, up to {size} MB`,uploadingLabel:`Uploading {name}`},Fe={browseLabel:`Click to upload`,buttonLabel:`Add file`,changeFileLabel:`Change file`,changeImageLabel:`Change image`,changeNamedText:`Change {label}`,dropLabel:`or drag & drop`,fileLabel:`file`,helpLabel:`More information`,imageLabel:`image`,loadingLabel:`Loading`,maxFilesText:`Up to {count} files.`,maxSizeText:`up to {size} MB`,optionalLabel:`(optional)`,previewAltText:`{label} preview`,removeFileLabel:`Remove {name}`,removeNamedText:`Remove {label}`,selectedPreviewText:`Selected {noun} preview`},Ie={audioLabel:`Audio`,captionsLabel:`Captions`,closeSearchLabel:`Close search`,documentLabel:`Document`,documentPagesLabel:`Document pages`,documentPrintingTitle:`Document for printing`,downloadLabel:`Download`,exitFullScreenLabel:`Exit full screen`,fitLabel:`Fit`,fitPageLabel:`Fit page`,fitWidthLabel:`Fit width`,fullScreenLabel:`Full screen`,goToPageText:`Go to page {targetPage}`,hideCaptionsLabel:`Hide captions`,hideThumbnailsLabel:`Hide thumbnails`,imageLabel:`Image`,imagePrintingTitle:`Image for printing`,loadingText:`Loading...`,muteLabel:`Mute`,nextMatchLabel:`Next match`,nextPageLabel:`Next page`,noFileText:`No file to show.`,noMatchesText:`No matches`,openFailedText:`Couldn't open this file.`,pageNumberLabel:`Page number`,pauseLabel:`Pause`,playLabel:`Play`,playbackSpeedLabel:`Playback speed`,playbackSpeedText:`Playback speed, {label}`,preparingPrintLabel:`Preparing to print`,previousMatchLabel:`Previous match`,previousPageLabel:`Previous page`,printLabel:`Print`,rotateLeftLabel:`Rotate left`,rotateRightLabel:`Rotate right`,searchDocumentLabel:`Search the document`,searchPositionText:`{position} of {total}{plus}`,searchUnavailableText:`Search isn't available for this document.`,searchingText:`Searching...`,seekLabel:`Seek`,seekValueText:`{now} of {total}`,showCaptionsLabel:`Show captions`,showThumbnailsLabel:`Show thumbnails`,twoPageViewLabel:`Two-page view`,unmuteLabel:`Unmute`,unsupportedFileText:`This file can't be shown here.`,videoLabel:`Video`,volumeLabel:`Volume`,zoomInLabel:`Zoom in`,zoomLabel:`Zoom`,zoomOutLabel:`Zoom out`,zoomText:`Zoom, {percent}%`},Le={allLabel:`All`,anyLabel:`Any`,appliesAtOnceText:`Changes apply at once.`,applyLabel:`Apply`,clearAllLabel:`Clear all`,dateFromText:`From {date}`,dateRangeText:`{from} to {to}`,dateUntilText:`Until {date}`,filtersActiveLabel:`Filters, {count} active`,filtersLabel:`Filters`,keepOpenLabel:`Keep open`,removeChipLabel:`Remove {facet} filter {value}`},Re={ariaLabel:`Quick navigation`},ze={dirty:`Unsaved changes`,invalidOne:`1 field needs attention`,invalidOther:`{count} fields need attention`,pristine:`No changes yet`,saved:`Saved at {time}`,saving:`Saving changes`},Be={divideLabel:`divided by`,equalLabel:`equals`,label:`Calculation`,minusLabel:`minus`,plusLabel:`plus`,timesLabel:`times`},Ve={loadingLabel:`Loading`},He={description:`You will be signed out in {time} because there has been no activity.`,signOutLabel:`Sign out`,stayLabel:`Stay signed in`,title:`Are you still there?`},Ue={label:`More information`},We={clearLabel:`Clear`,helpLabel:`More information`,hidePasswordLabel:`Hide password`,optionalLabel:`(optional)`,requirementMetLabel:`: met`,requirementNotMetLabel:`: not met`,requirementsTitle:`Password requirements`,showPasswordLabel:`Show password`},Ge={ctrlLabel:`Ctrl`,enterLabel:`Enter`,escLabel:`Esc`},Ke={noData:`No data`,periodLabel:`vs last period`},qe={helpLabel:`More information`},Je={failedText:`Could not load more`,finishedText:`You are all caught up.`,loadMoreLabel:`Load more`,loadingLabel:`Loading more`,retryLabel:`Try again`},Ye={label:`Calendar`},Xe={backLabel:`Back`,closeLabel:`Close`},Ze={backLabel:`Back`},Qe={cancelLabel:`Cancel`,submitLabel:`Save`},$e={ariaLabel:`Main`},et={decreaseLabel:`Decrease`,helpLabel:`More information`,increaseLabel:`Increase`,optionalLabel:`(optional)`},tt={backOnlineText:`You are back online`,checkAgainLabel:`Check again`,loadedAtText:`Showing what loaded at {time}.`,loadedText:`Showing what loaded.`,offlineText:`You are offline.`},nt={dismissLabel:`Dismiss checklist`,donePrefixText:`Done:`,headCountSkippedText:`{done} of {total} done, {skipped} skipped`,headCountText:`{done} of {total} done`,restoreLabel:`Show setup checklist`,skippedPrefixText:`Skipped:`,title:`Get started`},rt={helpLabel:`More information`,optionalLabel:`(optional)`},it={moreLabel:`More`,selectedText:`{count} selected`},at={applyLabel:`Apply`,dayCountOne:`1 day`,dayCountOther:`{count} days`,financialYearText:`FY {startYear}-{endYear}`,label:`Period`,nextMonthLabel:`Next month`,previousMonthLabel:`Previous month`,quarterPrefixText:`Q`,shortDaySuffixText:`d`,startEndPlaceholder:`Start to End`},ot={youLabel:`You`},st={helpLabel:`More information`,label:`Phone number`,optionalLabel:`(optional)`},ct={badge:`Most popular`},lt={title:`QR code`},ut={addConditionLabel:`Add condition`,addGroupLabel:`Add group`,andLabel:`and`,applyLabel:`Apply filter`,cancelLabel:`Cancel`,clearAllLabel:`Clear all`,closeLabel:`Close filters`,conditionCountTextOne:`{count} condition`,conditionCountTextOther:`{count} conditions`,datePlaceholder:`DD-MMM-YYYY`,emptySummaryText:`No conditions. The whole list shows.`,emptyText:`Add a condition to narrow the list.`,emptyTitle:`No conditions yet`,emptyValueText:`…`,fieldLabel:`Field`,filtersCountLabel:`Filters · {count}`,filtersLabel:`Filters`,groupCountTextOne:`in {count} group`,groupCountTextOther:`in {count} groups`,incompleteTextOne:`{count} condition is incomplete`,incompleteTextOther:`{count} conditions are incomplete`,matchAllLabel:`All`,matchAnyLabel:`Any`,matchLabel:`Match`,matchSuffixText:`of these`,maxPlaceholder:`Max`,minPlaceholder:`Min`,multiPlaceholder:`Select values`,noLabel:`No`,operatorBetween:`is between`,operatorContains:`contains`,operatorGt:`is over`,operatorGtDate:`is after`,operatorInLast:`in the last`,operatorIs:`is`,operatorIsAnyOf:`is any of`,operatorIsEmpty:`is empty`,operatorIsNot:`is not`,operatorLabel:`Operator`,operatorLt:`is under`,operatorLtDate:`is before`,orLabel:`or`,panelTitle:`Filters`,rangeJoinText:`and`,removeClauseLabel:`Remove filter: {clause}`,removeConditionLabel:`Remove condition`,removeGroupLabel:`Remove group`,singlePlaceholder:`Select a value`,textPlaceholder:`Type to match`,unitDays:`days`,unitLabel:`Unit`,unitMonths:`months`,unitWeeks:`weeks`,valueLabel:`Value`,valueRequiredText:`Enter a value`,yesLabel:`Yes`},dt={allApprovedLabel:`All approved`,approveLabel:`Approve {count}`,approveMoreLabel:`Approve {count} more`,checkListLabel:`Check the list`,runningLabel:`{done} of {total} approved`,statusBusyLabel:`Approving`,statusDoneLabel:`Approved`,statusFailedLabel:`Not approved`},ft={helpLabel:`More information`},pt={helpLabel:`More information`,optionalLabel:`(optional)`},mt={helpLabel:`More information`,ratingLabel:`Rating`,starLabel:`{count} star`,starsLabel:`{count} stars`,valueText:`{value} out of {max}`},ht={nextLabel:`Next`,positionText:`{position} of {total}`,prevLabel:`Previous`},gt={addLabel:`Add another`,removeLabel:`Remove row`},_t={copiedLabel:`Copied`,copyLabel:`Copy reference`,referenceLabel:`Reference`},vt={applyLabel:`Apply`,ariaLabel:`Rich text`,boldLabel:`Bold`,bulletedListLabel:`Bulleted list`,cancelLabel:`Cancel`,closeLinkBoxLabel:`Close link box`,codeBlockLabel:`Code block`,heading2Label:`Heading 2`,heading3Label:`Heading 3`,helpLabel:`More information`,inlineCodeLabel:`Inline code`,italicLabel:`Italic`,linkAddressLabel:`Link address`,linkErrorMessage:`Use a web address, an email address or a phone number.`,linkLabel:`Link`,loadFailedText:`The editor couldn't load. Reload the page and try again.`,numberedListLabel:`Numbered list`,quoteLabel:`Quote`,redoLabel:`Redo`,removeLinkLabel:`Remove link`,textFormattingLabel:`Text formatting`,undoLabel:`Undo`},yt={checkAgainLabel:`Check again`,copyReferenceLabel:`Copy reference`,errorText:`Something went wrong on our side. Try again in a moment.`,errorTitle:`This page did not load`,forbiddenText:`Ask your administrator for access, or go to the home page.`,forbiddenTitle:`You do not have access to this page`,homeLabel:`Go to the home page`,maintenanceBackBy:`We expect it back by {time} IST.`,maintenanceText:`This page is back shortly. Check again in a few minutes.`,maintenanceTitle:`We are doing some maintenance`,notFoundText:`Check the address, or go to the home page.`,notFoundTitle:`We could not find that page`,offlineText:`Check your connection, then try again.`,offlineTitle:`You are offline`,referenceLabel:`Reference`,reloadLabel:`Reload`,requestAccessLabel:`Request access`,retryLabel:`Try again`,signInLabel:`Sign in again`,signedOutText:`Sign in again to carry on where you were.`,signedOutTitle:`You are signed out`,staleText:`This app was updated while you had it open. Reload to get the new version.`,staleTitle:`A new version is ready`},bt={menuLabel:`More actions`},xt={scoreLabel:`Score`},St={companyLabel:`Company`,emailLabel:`Email`,invalidEmailText:`Enter an email address such as name@example.com.`,messageLabel:`Message`,nameLabel:`Name`,phoneLabel:`Phone number`,requiredText:`This field is required.`,submitErrorText:`We could not send your message. Please try again.`,submitLabel:`Send`},Ct={helpLabel:`More information`},wt={cancel:`Cancel`,confirmHint:`Type {word} to turn on {action}.`,confirmWordLabel:`Type {word} to confirm`,edit:`Edit`,keepEditing:`Keep editing`,save:`Save`,was:`Was {value}`},Tt={loadingLabel:`Loading`},Et={reorderLabel:`Reorder {name}`},Dt={namedTrendLabel:`{label} trend`,oneValueText:`{name} has one value, {value}.`,rangeText:`{name} from {from} to {to} across {count} points.`,trendLabel:`Trend`},Ot={label:`Loading`},kt={label:`Loading`},At={menuLabel:`More actions`},jt={empty:`Nothing here yet.`,errorText:`This item did not load. Try again.`,forbiddenText:`You do not have access to this item.`,itemsLabel:`Items`,loadingLabel:`Loading`,moveLabel:`Move`,networkText:`The connection dropped before this item loaded. Check it and try again.`,nextItemLabel:`Next item`,openLabel:`Open`,previousItemLabel:`Previous item`,readingPaneLabel:`Reading pane`,retryLabel:`Retry`,selectAllLabel:`Select all items`,selectItemLabel:`Select {title}`,selectedLabel:`{count} selected`,untitledItemLabel:`item`},Mt={label:`Progress`,stepLabel:`Step {number}`},Nt={helpLabel:`More information`},Pt={ariaLabel:`Pagination`,nextLabel:`Next page`,pageLabel:`Page {page}`,pageSizeLabel:`{count} per page`,previousLabel:`Previous page`,rangeText:`Page {page} of {pages}`,rowsPerPageLabel:`Rows per page`,summaryText:`Showing {first} to {last} of {total}`},Ft={emptyTitle:`No records found`},It={allSelectedLabel:`All {count} selected`,clearLabel:`Clear`,clearSelectionLabel:`Clear selection`,selectAllMatchingLabel:`Select all {count} matching`,selectedLabel:`{count} selected`},Lt={moreLabel:`More`,scrollTabsBackwardLabel:`Scroll tabs backward`,scrollTabsForwardLabel:`Scroll tabs forward`},Rt={clearLabel:`Clear`,helpLabel:`More information`,optionalLabel:`(optional)`},zt={autoLabel:`System`,autoModeLabel:`follows your device`,darkLabel:`Dark`,darkModeLabel:`dark`,label:`Theme`,lightLabel:`Light`,lightModeLabel:`light`},Bt={stepLabel:`Step {number}`},Vt={addAllLabel:`Add all shown`,addLabel:`Add {name}`,availableTitle:`Available`,chosenTitle:`Chosen`,dragHintText:`Press Space to pick up a row, then Left or Right to move it across, or Up and Down to reorder the chosen rows.`,emptyAvailableText:`Remove an item from Chosen to see it here.`,emptyAvailableTitle:`Everything is chosen`,emptyChosenText:`Use Add on an item, or press Enter on it.`,emptyChosenTitle:`Nothing chosen yet`,noMatchText:`No matches for "{query}"`,orderHintText:`The order of Chosen is kept. Drag the grip to reorder.`,removeAllLabel:`Remove all`,removeLabel:`Remove {name}`,searchLabel:`Search {title}`,searchPlaceholder:`Search`},Ht={description:`A new version of this app is ready.`,dismissLabel:`Dismiss`,reloadLabel:`Reload`},Ut={emptyText:`Not set`},Wt={emptyText:`Nothing new yet`,label:`What's new`,linkLabel:`Learn more`,unreadLabel:`unread`},Gt={ariaLabel:`Workspace {currentName}`,createLabel:`Create workspace`,noMatchText:`No workspaces match.`,searchPlaceholder:`Search workspaces`,triggerLabel:`Workspace {currentName}`},Kt=e=>t(e);export{re as ACCOUNT_SWITCHER_TEXT,ie as AGENDA_TEXT,ae as ALERT_TEXT,w as ASYNC_BLOCK_TEXT,se as AVATAR_GROUP_TEXT,oe as AVATAR_TEXT,ce as BANNER_TEXT,le as BREADCRUMBS_TEXT,ue as CALENDAR_TEXT,de as CARD_TEXT,u as CAROUSEL_TEXT,fe as CHANGE_LIST_TEXT,me as CHART_CARD_TEXT,pe as CHART_TEXT,ge as CHECKBOX_TEXT,he as CHECK_TEXT,ve as CHIP_GROUP_TEXT,_e as CHIP_TEXT,ye as CHOICE_CARD_TEXT,be as CHOICE_CHIP_TEXT,d as CODE_BLOCK_TEXT,xe as COLOUR_FIELD_TEXT,Se as COLUMN_MENU_TEXT,f as COMMAND_PALETTE_TEXT,p as COMMENT_THREAD_TEXT,Ce as COMPARE_TABLE_TEXT,Y as CONFIRM_DIALOG_TEXT,we as CONFIRM_PROVIDER_TEXT,h as CONSENT_BANNER_TEXT,Te as CONTEXT_MENU_TEXT,Ee as COPY_BUTTON_TEXT,te as CUSTOM_RULE_TEXT,g as DASHBOARD_GRID_TEXT,De as DASHBOARD_HEADER_TEXT,_ as DATA_TABLE_TEXT,y as DATE_PICKER_TEXT,b as DATE_RANGE_PICKER_TEXT,x as DRAWER_TEXT,Oe as DROPDOWN_TEXT,ke as DROP_ZONE_TEXT,Ae as DUE_DATE_TEXT,je as ENTRY_GRID_TEXT,Me as ERROR_BOUNDARY_TEXT,Ne as ERROR_SUMMARY_TEXT,P as FIELD_TEXT,Pe as FILE_ATTACHMENT_TEXT,Fe as FILE_PICKER_TEXT,$ as FILE_VALIDATION_TEXT,Ie as FILE_VIEWER_TEXT,Le as FILTER_BAR_TEXT,Re as FLOATING_DOCK_TEXT,s as FORMATTERS_TEXT,Be as FORMULA_STEPS_TEXT,ze as FORM_ACTIONS_TEXT,S as GANTT_TEXT,Ve as HOVER_CARD_TEXT,l as HTTP_FAILURE_TEXT,He as IDLE_TIMEOUT_DIALOG_TEXT,C as IMAGE_CROP_TEXT,Z as IMAGE_PICKER_TEXT,Ue as INFO_TIP_TEXT,T as INLINE_EDIT_TEXT,Q as INPUT_MASK_TEXT,We as INPUT_TEXT,c as KANBAN_TEXT,Ge as KBD_TEXT,Ke as KPI_TILE_TEXT,qe as LABEL_HELP_TEXT,E as LEAD_POPUP_TEXT,D as LIGHTBOX_TEXT,Je as LOAD_MORE_TEXT,m as MENTION_INPUT_TEXT,Ye as MINI_CALENDAR_TEXT,Xe as MODAL_CARD_RENDERER_TEXT,Ze as MODAL_CONTENT_TEXT,Qe as MODAL_FORM_TEXT,J as MODAL_TEXT,$e as NAVIGATION_MENU_TEXT,O as NOTIFICATION_CENTRE_TEXT,et as NUMBER_INPUT_TEXT,tt as OFFLINE_BANNER_TEXT,nt as ONBOARDING_CHECKLIST_TEXT,k as ORG_TREE_TEXT,rt as OTP_INPUT_TEXT,A as OVERFLOW_TEXT,it as PAGE_HEADER_TEXT,ee as PASSWORD_RULES_TEXT,at as PERIOD_PICKER_TEXT,ot as PERSON_TEXT,st as PHONE_NUMBER_INPUT_TEXT,j as PHONE_TEXT,ct as PRICING_CARD_TEXT,lt as QR_CODE_TEXT,ut as QUERY_BUILDER_TEXT,dt as QUEUE_BUNDLE_TEXT,pt as RADIO_GROUP_TEXT,ft as RADIO_TEXT,mt as RATING_TEXT,ht as RECORD_PAGER_TEXT,M as RELATIVE_TIME_TEXT,gt as REPEATER_TEXT,_t as RESULT_BLOCK_TEXT,vt as RICH_TEXT_TEXT,yt as ROUTE_ERROR_TEXT,bt as ROW_ACTIONS_TEXT,K as ROW_DROP_TEXT,N as SAVED_VIEWS_TEXT,xt as SCORE_SCALE_TEXT,I as SEARCH_TEXT,St as SECTION_LEAD_CAPTURE_TEXT,Ct as SEGMENTED_TEXT,F as SELECT_TEXT,wt as SETTING_ROW_TEXT,ne as SHELL_TEXT,o as SHORTCUT_KEYS_TEXT,L as SHOW_MORE_TEXT,Tt as SKELETON_SHAPES_TEXT,R as SLIDER_TEXT,Et as SORTABLE_LIST_TEXT,z as SORTABLE_TEXT,Dt as SPARKLINE_TEXT,Ot as SPINNER_TEXT,kt as SPLASH_TEXT,At as SPLIT_BUTTON_TEXT,jt as SPLIT_VIEW_TEXT,Mt as STEPPER_TEXT,Nt as SWITCH_TEXT,Pt as TABLE_PAGINATION_TEXT,Ft as TABLE_ROWS_TEXT,v as TABLE_SELECT_TEXT,It as TABLE_TOOLBAR_TEXT,Lt as TABS_TEXT,Rt as TEXTAREA_TEXT,zt as THEME_TOGGLE_TEXT,Bt as TIMELINE_TEXT,B as TIME_PICKER_TEXT,X as TOAST_TEXT,H as TOUR_ADVANCE_TEXT,V as TOUR_TEXT,Vt as TRANSFER_LIST_TEXT,W as TREE_PICKER_TEXT,U as TREE_TEXT,q as UNSAVED_CHANGES_TEXT,Ht as UPDATE_BAR_TEXT,Ut as VALUE_TEXT,Wt as WHATS_NEW_TEXT,G as WIZARD_TEXT,Gt as WORKSPACE_SWITCHER_TEXT,a as fillText,n as pluralText,i as readText,Kt as setWuiText,e as subscribeText,r as textLocale};
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,t as a}from"./textStore-DBplASiZ.js";import{t as o}from"./shortcutKeys.g-C0TeAfYL.js";import{t as s}from"./formatters.g-BNAu1PMe.js";import{t as c}from"./kanban.g-dtKYyIpr.js";import{t as l}from"./httpFailure.g-DjZzGxPj.js";import{t as u}from"./carousel.g-Bw_pFDzc.js";import{t as d}from"./codeBlock.g-BCF2IlK-.js";import{t as f}from"./commandPalette.g-DP-Zl8SU.js";import{t as p}from"./commentThread.g-C7L18Tvy.js";import{t as m}from"./mentionInput.g-DJo6d2Gm.js";import{t as h}from"./consentBanner.g-CZAb1BLJ.js";import{t as g}from"./dashboardGrid.g-vkCZGw6G.js";import{t as _}from"./dataTable.g-1PsmN1Nj.js";import{t as v}from"./tableSelect.g-DwI5_9Nw.js";import{t as y}from"./datePicker.g-sGQE8c3n.js";import{t as b}from"./dateRangePicker.g-Pnc37vgX.js";import{t as x}from"./drawer.g-B-zYKBfQ.js";import{t as S}from"./gantt.g-CWvMXwBR.js";import{t as C}from"./imageCrop.g-BnbAeH2Q.js";import{n as w,t as T}from"./inlineEdit.g-DKIhYoPF.js";import{t as E}from"./leadPopup.g-BfMPz9nH.js";import{t as D}from"./lightbox.g-DDrycPou.js";import{t as O}from"./notificationCentre.g-Cees-vKg.js";import{t as k}from"./orgTree.g-CIg75quV.js";import{t as A}from"./overflow.g-BfcGEhwR.js";import{t as j}from"./phone.g-P66U-SK5.js";import{t as M}from"./relativeTime.g-BH90tjJM.js";import{t as N}from"./savedViews.g-CzzEliTR.js";import{n as P,r as F,t as I}from"./search.g-chn0itlW.js";import{t as L}from"./showMore.g-BdQ5MUSd.js";import{t as R}from"./slider.g-BPNfxZEV.js";import{t as z}from"./sortable.g-BsTKys5-.js";import{t as B}from"./timePicker.g-IEczeE48.js";import{n as V,t as H}from"./tourAdvance.g-BJqDnqag.js";import{t as U}from"./tree.g-RId8xZSk.js";import{t as W}from"./treePicker.g-BR35ru5f.js";import{t as G}from"./wizard.g-UKG1dMs_.js";import{t as K}from"./rowDrop.g-DQpB10Ey.js";import{i as q,n as J,r as Y,t as X}from"./toast.g-CJ8c0BNZ.js";import{i as Z,n as Q,r as $,t as ee}from"./passwordRules.g-CMYrohdd.js";import{t as te}from"./customRule.g-Cfkl3_ZC.js";import{t as ne}from"./shell.g-BhC11Oe3.js";var re={label:`Switch account`},ie={addLabel:`Add`,empty:`Nothing to show`,label:`Agenda`,showMore:`Show {count} more`},ae={closeLabel:`Close alert`},oe={photoLabel:`Profile photo`},se={moreLabel:`{count} more`},ce={dismissLabel:`Dismiss`},le={moreLabel:`Show hidden levels`},ue={agendaLabel:`Agenda`,allDayDateText:`all day, {start}`,allDayLabel:`All day`,calendarViewLabel:`Calendar view`,dayLabel:`Day`,emptyText:`Nothing scheduled in this period.`,errorText:`The events couldn't load. Try again in a moment.`,label:`Calendar`,listLabel:`List`,loadFailedText:`This calendar couldn't load. Try again in a moment.`,monthLabel:`Month`,moveThroughCalendarLabel:`Move through the calendar`,nextLabel:`Next`,previousLabel:`Previous`,rangeTitleText:`{start} to {last}`,timelineLabel:`Timeline`,todayLabel:`Today`,tryAgainLabel:`Try again`,weekLabel:`Week`},de={closeLabel:`Close`},fe={now:`Now`,was:`Was`},pe={aboveLabel:`Above`,areaChartLabel:`Area chart`,arrowKeysText:`{title}: use the arrow keys to read the values`,bandLabel:`Band`,barChartLabel:`Bar chart`,belowLabel:`Below`,bubbleChartLabel:`Bubble chart`,calendarHeatmapLabel:`Calendar heatmap`,calendarRangeText:`, from {first} to {last}`,calendarSummaryTextOne:`Calendar heatmap of {label}, {n} day.`,calendarSummaryTextOther:`Calendar heatmap of {label}, {n} days{range}.`,categoryLabel:`Category`,centerLabel:`Total`,changeLabel:`Change`,chartLabel:`chart`,columnChartLabel:`Column chart`,columnFallbackLabel:`column`,columnXLabel:`X`,constantSpanText:`{label} is {lo}.`,currencyFormatText:`This chart's currency format needs a currency code, such as "INR", in its currency field.`,dataSuffixLabel:`data`,dateLabel:`Date`,donutChartLabel:`Donut chart`,donutLargestText:`{top} is the largest, at {share}.`,donutSummaryTextOne:`Donut chart of {label} in {rows} part, {total} in all.`,donutSummaryTextOther:`Donut chart of {label} in {rows} parts, {total} in all.`,emptyText:`No data to show for this chart.`,errorText:`This chart couldn't load. Try again in a moment.`,everySeriesHiddenText:`Every series is hidden.`,firstStageLabel:`first stage`,fromLabel:`From`,funnelChartLabel:`Funnel chart`,funnelPreviousStepText:`{share} of previous step`,funnelStartText:`{first} is {firstValue} and {last} is {lastValue}, {share} of the start.`,funnelSummaryText:`Funnel chart of {label} in {n} stages.`,gaugeBandText:`, in the {band} band`,gaugeLabel:`Gauge`,gaugeSummaryText:`{type}: {label} is {value} on a scale from {min} to {max}{band}.`,groupLabel:`Group`,groupsTextOne:` in {count} group: {groups}`,groupsTextOther:` in {count} groups: {groups}`,heatmapLabel:`Heatmap`,heatmapSummaryText:`Heatmap of {label} by {group} and {x}, {n} cells.`,highestAtLowestAtText:`Highest is {highValue} at {highGroup}, {high}; lowest is {lowValue} at {lowGroup}, {low}.`,highestLowestText:`Highest is {maxValue} on {max}; lowest is {minValue} on {min}.`,itemLabel:`Item`,largestFallText:`The largest fall is {xText}, {signed}.`,largestFlowText:`The largest flow is {xText} to {toText}, {fmtAt}.`,largestRiseText:`The largest rise is {xText}, {signed}.`,latestText:`Latest {latest}`,legendLabel:`Legend`,lessLabel:`Less`,lineChartLabel:`Line chart`,loadingText:`Loading chart`,measureLabel:`Measure`,moreLabel:`More`,ofFirstStepText:`Of {first}`,ofPreviousStepLabel:`Of previous step`,openingShareText:`{share} of opening`,opensAtClosesAtText:`It opens at {opening} and closes at {closing}.`,otherLabel:`Other`,pointsSummaryTextOne:`{n} point, {first}.`,pointsSummaryTextOther:`{n} points, from {first} to {last}.`,rangeSpanText:`{label} runs from {lo} to {hi}.`,rowFallbackLabel:`row`,rowLabel:`Row`,runningTotalLabel:`Running total`,sankeyLabel:`Sankey diagram`,sankeySummaryText:`Sankey diagram of {label}: {n} flows between {nodes} places.`,scaleLabel:`Scale`,scaleRangeText:`{min} to {max}`,scatterPlotLabel:`Scatter plot`,scatterSummaryText:`{type} of {label} against {xLabel}, {count} points{groups}.`,shareLabel:`Share`,shareOfAllLabel:`Share of all`,shareOfGroupLabel:`Share of group`,shareOfParentText:`Share of {parent}`,shareOfStepText:`{share} of {first}`,sharedAxisText:`, sharing one x axis`,showingFirstRowsDownloadText:`Showing the first {rows} of {total} rows. Download the CSV for all of them.`,smallMultiplesLabel:`Small multiples`,soFarText:`so far`,stackedPercentText:`, stacked to 100%`,stackedText:`, stacked`,stageLabel:`Stage`,stepLabel:`Step`,summaryText:`{type} of {series}{stacked}{sharedAxis}.`,targetGapText:`{direction} {label} by {gap}`,targetLabel:`target`,toLabel:`To`,tooManyGroupsText:`This chart has more groups than it can show clearly.`,tooManySeriesText:`This chart has more series than it can show clearly.`,totalText:`Total {total}`,treemapEmptyText:`Treemap of {label}: no items.`,treemapLabel:`Treemap`,treemapLargestGroupText:`{name} is the largest group, at {share}.`,treemapSummaryText:`Treemap of {label}: {n} items in {totals} groups, {total} in all.`,trendLabel:`Trend`,untitledLabel:`Chart`,waterfallLabel:`Waterfall chart`,waterfallSummaryText:`Waterfall chart of {label}.`},me={chartViewLabel:`Chart`,downloadCsvLabel:`Download CSV`,downloadPngLabel:`Download PNG`,legendLabel:`Show legend`,legendTitle:`Show or hide the legend`,moreActionsForLabel:`More actions for {title}`,moreActionsLabel:`More actions`,retryLabel:`Try again`,tableViewLabel:`Table`,viewLabel:`View`},he={helpLabel:`More information`},ge={helpLabel:`More information`},_e={removeLabel:`Remove`,removeText:`Remove {content}`},ve={moreLabel:`More`},ye={helpLabel:`More information`},be={helpLabel:`More information`},xe={colourLabel:`Colour`,colourPickerLabel:`{label}, colour picker`,helpLabel:`More information`,optionalLabel:`(optional)`},Se={label:`Columns`},Ce={noLabel:`No`,partialLabel:`Partial`,warningLabel:`Warning`,yesLabel:`Yes`},we={title:`Are you sure?`},Te={ariaLabel:`Context menu`,searchPlaceholder:`Search`},Ee={copiedLabel:`Copied`,label:`Copy`},De={amLabel:`am`,pmLabel:`pm`,updatedLabel:`Updated {time} IST`},Oe={label:`Menu`,noMatch:`No matches.`,noMatchText:`No matches.`,searchPlaceholder:`Search`},ke={anyTypeText:`Any file type`,browseLabel:`Click to upload`,dropLabel:`or drag & drop`,maxSizeText:`up to {size} MB`,removeAttachmentLabel:`Remove attachment`},Ae={daysLeftLabel:`{days} days left`,dueInLabel:`Due in {days} days`,dueTodayLabel:`Due today`,dueTomorrowLabel:`Due tomorrow`,notSetLabel:`Not set`,oneDayLeftLabel:`1 day left`,overdueSinceLabel:`Overdue since {date}`},je={addLabel:`Add line`,cancelLabel:`Cancel`,commitNextLabel:`Save and go to the next line`,commitStayLabel:`Save`,dirtyLabel:`Changed`,discardLabel:`Discard changes`,emptyLabel:`No lines yet`,failedLabel:`Not saved`,label:`Entry lines`,moveLabel:`Move between lines`,removeLineLabel:`Remove line`,rowActionsLabel:`Actions`,savedLabel:`Saved`,savingLabel:`Saving`,statusLabel:`Status`},Me={reloadPageLabel:`Reload the page`},Ne={titleOne:`Fix {count} field to continue`,titleOther:`Fix {count} fields to continue`},Pe={attachmentLabel:`attachment`,browseLabel:`Browse`,dropFileTitleOne:`Add a file`,dropFileTitleOther:`Add files`,dropImageTitleOne:`Add an image`,dropImageTitleOther:`Add images`,dropTitleOne:`Add {article} {noun}`,dropTitleOther:`Add {noun}s`,label:`Attachment`,maxSizeText:`Up to {size} MB`,optionalLabel:`(optional)`,removeFileLabel:`Remove {name}`,removeLabel:`Remove attachment`,typesAndMaxSizeText:`{types}, up to {size} MB`,uploadingLabel:`Uploading {name}`},Fe={browseLabel:`Click to upload`,buttonLabel:`Add file`,changeFileLabel:`Change file`,changeImageLabel:`Change image`,changeNamedText:`Change {label}`,dropLabel:`or drag & drop`,fileLabel:`file`,helpLabel:`More information`,imageLabel:`image`,loadingLabel:`Loading`,maxFilesText:`Up to {count} files.`,maxSizeText:`up to {size} MB`,optionalLabel:`(optional)`,previewAltText:`{label} preview`,previewError:`This image could not be loaded.`,previewRetry:`Try again`,removeFileLabel:`Remove {name}`,removeNamedText:`Remove {label}`,selectedPreviewText:`Selected {noun} preview`},Ie={audioLabel:`Audio`,captionsLabel:`Captions`,closeSearchLabel:`Close search`,documentLabel:`Document`,documentPagesLabel:`Document pages`,documentPrintingTitle:`Document for printing`,downloadLabel:`Download`,exitFullScreenLabel:`Exit full screen`,fitLabel:`Fit`,fitPageLabel:`Fit page`,fitWidthLabel:`Fit width`,fullScreenLabel:`Full screen`,goToPageText:`Go to page {targetPage}`,hideCaptionsLabel:`Hide captions`,hideThumbnailsLabel:`Hide thumbnails`,imageLabel:`Image`,imagePrintingTitle:`Image for printing`,loadingText:`Loading...`,muteLabel:`Mute`,nextMatchLabel:`Next match`,nextPageLabel:`Next page`,noFileText:`No file to show.`,noMatchesText:`No matches`,openFailedText:`Couldn't open this file.`,pageNumberLabel:`Page number`,pauseLabel:`Pause`,playLabel:`Play`,playbackSpeedLabel:`Playback speed`,playbackSpeedText:`Playback speed, {label}`,preparingPrintLabel:`Preparing to print`,previousMatchLabel:`Previous match`,previousPageLabel:`Previous page`,printLabel:`Print`,rotateLeftLabel:`Rotate left`,rotateRightLabel:`Rotate right`,searchDocumentLabel:`Search the document`,searchPositionText:`{position} of {total}{plus}`,searchUnavailableText:`Search isn't available for this document.`,searchingText:`Searching...`,seekLabel:`Seek`,seekValueText:`{now} of {total}`,showCaptionsLabel:`Show captions`,showThumbnailsLabel:`Show thumbnails`,twoPageViewLabel:`Two-page view`,unmuteLabel:`Unmute`,unsupportedFileText:`This file can't be shown here.`,videoLabel:`Video`,volumeLabel:`Volume`,zoomInLabel:`Zoom in`,zoomLabel:`Zoom`,zoomOutLabel:`Zoom out`,zoomText:`Zoom, {percent}%`},Le={allLabel:`All`,anyLabel:`Any`,appliesAtOnceText:`Changes apply at once.`,applyLabel:`Apply`,clearAllLabel:`Clear all`,dateFromText:`From {date}`,dateRangeText:`{from} to {to}`,dateUntilText:`Until {date}`,filtersActiveLabel:`Filters, {count} active`,filtersLabel:`Filters`,keepOpenLabel:`Keep open`,removeChipLabel:`Remove {facet} filter {value}`},Re={ariaLabel:`Quick navigation`},ze={dirty:`Unsaved changes`,invalidOne:`1 field needs attention`,invalidOther:`{count} fields need attention`,pristine:`No changes yet`,saved:`Saved at {time}`,saving:`Saving changes`},Be={divideLabel:`divided by`,equalLabel:`equals`,label:`Calculation`,minusLabel:`minus`,plusLabel:`plus`,timesLabel:`times`},Ve={loadingLabel:`Loading`},He={description:`You will be signed out in {time} because there has been no activity.`,signOutLabel:`Sign out`,stayLabel:`Stay signed in`,title:`Are you still there?`},Ue={label:`More information`},We={clearLabel:`Clear`,helpLabel:`More information`,hidePasswordLabel:`Hide password`,optionalLabel:`(optional)`,requirementMetLabel:`: met`,requirementNotMetLabel:`: not met`,requirementsTitle:`Password requirements`,showPasswordLabel:`Show password`},Ge={ctrlLabel:`Ctrl`,enterLabel:`Enter`,escLabel:`Esc`},Ke={noData:`No data`,periodLabel:`vs last period`},qe={helpLabel:`More information`},Je={failedText:`Could not load more`,finishedText:`You are all caught up.`,loadMoreLabel:`Load more`,loadingLabel:`Loading more`,retryLabel:`Try again`},Ye={label:`Calendar`},Xe={backLabel:`Back`,closeLabel:`Close`},Ze={backLabel:`Back`},Qe={cancelLabel:`Cancel`,submitLabel:`Save`},$e={ariaLabel:`Main`},et={decreaseLabel:`Decrease`,helpLabel:`More information`,increaseLabel:`Increase`,optionalLabel:`(optional)`},tt={backOnlineText:`You are back online`,checkAgainLabel:`Check again`,loadedAtText:`Showing what loaded at {time}.`,loadedText:`Showing what loaded.`,offlineText:`You are offline.`},nt={dismissLabel:`Dismiss checklist`,donePrefixText:`Done:`,headCountSkippedText:`{done} of {total} done, {skipped} skipped`,headCountText:`{done} of {total} done`,restoreLabel:`Show setup checklist`,skippedPrefixText:`Skipped:`,title:`Get started`},rt={helpLabel:`More information`,optionalLabel:`(optional)`},it={moreLabel:`More`,selectedText:`{count} selected`},at={applyLabel:`Apply`,dayCountOne:`1 day`,dayCountOther:`{count} days`,financialYearText:`FY {startYear}-{endYear}`,label:`Period`,nextMonthLabel:`Next month`,previousMonthLabel:`Previous month`,quarterPrefixText:`Q`,shortDaySuffixText:`d`,startEndPlaceholder:`Start to End`},ot={youLabel:`You`},st={helpLabel:`More information`,label:`Phone number`,optionalLabel:`(optional)`},ct={badge:`Most popular`},lt={title:`QR code`},ut={addConditionLabel:`Add condition`,addGroupLabel:`Add group`,andLabel:`and`,applyLabel:`Apply filter`,cancelLabel:`Cancel`,clearAllLabel:`Clear all`,closeLabel:`Close filters`,conditionCountTextOne:`{count} condition`,conditionCountTextOther:`{count} conditions`,datePlaceholder:`DD-MMM-YYYY`,emptySummaryText:`No conditions. The whole list shows.`,emptyText:`Add a condition to narrow the list.`,emptyTitle:`No conditions yet`,emptyValueText:`…`,fieldLabel:`Field`,filtersCountLabel:`Filters · {count}`,filtersLabel:`Filters`,groupCountTextOne:`in {count} group`,groupCountTextOther:`in {count} groups`,incompleteTextOne:`{count} condition is incomplete`,incompleteTextOther:`{count} conditions are incomplete`,matchAllLabel:`All`,matchAnyLabel:`Any`,matchLabel:`Match`,matchSuffixText:`of these`,maxPlaceholder:`Max`,minPlaceholder:`Min`,multiPlaceholder:`Select values`,noLabel:`No`,operatorBetween:`is between`,operatorContains:`contains`,operatorGt:`is over`,operatorGtDate:`is after`,operatorInLast:`in the last`,operatorIs:`is`,operatorIsAnyOf:`is any of`,operatorIsEmpty:`is empty`,operatorIsNot:`is not`,operatorLabel:`Operator`,operatorLt:`is under`,operatorLtDate:`is before`,orLabel:`or`,panelTitle:`Filters`,rangeJoinText:`and`,removeClauseLabel:`Remove filter: {clause}`,removeConditionLabel:`Remove condition`,removeGroupLabel:`Remove group`,singlePlaceholder:`Select a value`,textPlaceholder:`Type to match`,unitDays:`days`,unitLabel:`Unit`,unitMonths:`months`,unitWeeks:`weeks`,valueLabel:`Value`,valueRequiredText:`Enter a value`,yesLabel:`Yes`},dt={allApprovedLabel:`All approved`,approveLabel:`Approve {count}`,approveMoreLabel:`Approve {count} more`,checkListLabel:`Check the list`,runningLabel:`{done} of {total} approved`,statusBusyLabel:`Approving`,statusDoneLabel:`Approved`,statusFailedLabel:`Not approved`},ft={helpLabel:`More information`},pt={helpLabel:`More information`,optionalLabel:`(optional)`},mt={helpLabel:`More information`,ratingLabel:`Rating`,starLabel:`{count} star`,starsLabel:`{count} stars`,valueText:`{value} out of {max}`},ht={nextLabel:`Next`,positionText:`{position} of {total}`,prevLabel:`Previous`},gt={addLabel:`Add another`,removeLabel:`Remove row`},_t={copiedLabel:`Copied`,copyLabel:`Copy reference`,referenceLabel:`Reference`},vt={applyLabel:`Apply`,ariaLabel:`Rich text`,boldLabel:`Bold`,bulletedListLabel:`Bulleted list`,cancelLabel:`Cancel`,closeLinkBoxLabel:`Close link box`,codeBlockLabel:`Code block`,heading2Label:`Heading 2`,heading3Label:`Heading 3`,helpLabel:`More information`,inlineCodeLabel:`Inline code`,italicLabel:`Italic`,linkAddressLabel:`Link address`,linkErrorMessage:`Use a web address, an email address or a phone number.`,linkLabel:`Link`,loadFailedText:`The editor couldn't load. Reload the page and try again.`,numberedListLabel:`Numbered list`,quoteLabel:`Quote`,redoLabel:`Redo`,removeLinkLabel:`Remove link`,textFormattingLabel:`Text formatting`,undoLabel:`Undo`},yt={checkAgainLabel:`Check again`,copyReferenceLabel:`Copy reference`,errorText:`Something went wrong on our side. Try again in a moment.`,errorTitle:`This page did not load`,forbiddenText:`Ask your administrator for access, or go to the home page.`,forbiddenTitle:`You do not have access to this page`,homeLabel:`Go to the home page`,maintenanceBackBy:`We expect it back by {time} IST.`,maintenanceText:`This page is back shortly. Check again in a few minutes.`,maintenanceTitle:`We are doing some maintenance`,notFoundText:`Check the address, or go to the home page.`,notFoundTitle:`We could not find that page`,offlineText:`Check your connection, then try again.`,offlineTitle:`You are offline`,referenceLabel:`Reference`,reloadLabel:`Reload`,requestAccessLabel:`Request access`,retryLabel:`Try again`,signInLabel:`Sign in again`,signedOutText:`Sign in again to carry on where you were.`,signedOutTitle:`You are signed out`,staleText:`This app was updated while you had it open. Reload to get the new version.`,staleTitle:`A new version is ready`},bt={menuLabel:`More actions`},xt={scoreLabel:`Score`},St={companyLabel:`Company`,emailLabel:`Email`,invalidEmailText:`Enter an email address such as name@example.com.`,messageLabel:`Message`,nameLabel:`Name`,phoneLabel:`Phone number`,requiredText:`This field is required.`,submitErrorText:`We could not send your message. Please try again.`,submitLabel:`Send`},Ct={helpLabel:`More information`},wt={cancel:`Cancel`,confirmHint:`Type {word} to turn on {action}.`,confirmWordLabel:`Type {word} to confirm`,edit:`Edit`,keepEditing:`Keep editing`,save:`Save`,was:`Was {value}`},Tt={loadingLabel:`Loading`},Et={reorderLabel:`Reorder {name}`},Dt={namedTrendLabel:`{label} trend`,oneValueText:`{name} has one value, {value}.`,rangeText:`{name} from {from} to {to} across {count} points.`,trendLabel:`Trend`},Ot={label:`Loading`},kt={label:`Loading`},At={menuLabel:`More actions`},jt={empty:`Nothing here yet.`,errorText:`This item did not load. Try again.`,forbiddenText:`You do not have access to this item.`,itemsLabel:`Items`,loadingLabel:`Loading`,moveLabel:`Move`,networkText:`The connection dropped before this item loaded. Check it and try again.`,nextItemLabel:`Next item`,openLabel:`Open`,previousItemLabel:`Previous item`,readingPaneLabel:`Reading pane`,retryLabel:`Retry`,selectAllLabel:`Select all items`,selectItemLabel:`Select {title}`,selectedLabel:`{count} selected`,untitledItemLabel:`item`},Mt={label:`Progress`,stepLabel:`Step {number}`},Nt={helpLabel:`More information`},Pt={ariaLabel:`Pagination`,nextLabel:`Next page`,pageLabel:`Page {page}`,pageSizeLabel:`{count} per page`,previousLabel:`Previous page`,rangeText:`Page {page} of {pages}`,rowsPerPageLabel:`Rows per page`,summaryText:`Showing {first} to {last} of {total}`},Ft={emptyTitle:`No records found`},It={allSelectedLabel:`All {count} selected`,clearLabel:`Clear`,clearSelectionLabel:`Clear selection`,selectAllMatchingLabel:`Select all {count} matching`,selectedLabel:`{count} selected`},Lt={moreLabel:`More`,scrollTabsBackwardLabel:`Scroll tabs backward`,scrollTabsForwardLabel:`Scroll tabs forward`},Rt={clearLabel:`Clear`,helpLabel:`More information`,optionalLabel:`(optional)`},zt={autoLabel:`System`,autoModeLabel:`follows your device`,darkLabel:`Dark`,darkModeLabel:`dark`,label:`Theme`,lightLabel:`Light`,lightModeLabel:`light`},Bt={stepLabel:`Step {number}`},Vt={addAllLabel:`Add all shown`,addLabel:`Add {name}`,availableTitle:`Available`,chosenTitle:`Chosen`,dragHintText:`Press Space to pick up a row, then Left or Right to move it across, or Up and Down to reorder the chosen rows.`,emptyAvailableText:`Remove an item from Chosen to see it here.`,emptyAvailableTitle:`Everything is chosen`,emptyChosenText:`Use Add on an item, or press Enter on it.`,emptyChosenTitle:`Nothing chosen yet`,noMatchText:`No matches for "{query}"`,orderHintText:`The order of Chosen is kept. Drag the grip to reorder.`,removeAllLabel:`Remove all`,removeLabel:`Remove {name}`,searchLabel:`Search {title}`,searchPlaceholder:`Search`},Ht={description:`A new version of this app is ready.`,dismissLabel:`Dismiss`,reloadLabel:`Reload`},Ut={emptyText:`Not set`},Wt={emptyText:`Nothing new yet`,label:`What's new`,linkLabel:`Learn more`,unreadLabel:`unread`},Gt={ariaLabel:`Workspace {currentName}`,createLabel:`Create workspace`,noMatchText:`No workspaces match.`,searchPlaceholder:`Search workspaces`,triggerLabel:`Workspace {currentName}`},Kt=e=>t(e);export{re as ACCOUNT_SWITCHER_TEXT,ie as AGENDA_TEXT,ae as ALERT_TEXT,w as ASYNC_BLOCK_TEXT,se as AVATAR_GROUP_TEXT,oe as AVATAR_TEXT,ce as BANNER_TEXT,le as BREADCRUMBS_TEXT,ue as CALENDAR_TEXT,de as CARD_TEXT,u as CAROUSEL_TEXT,fe as CHANGE_LIST_TEXT,me as CHART_CARD_TEXT,pe as CHART_TEXT,ge as CHECKBOX_TEXT,he as CHECK_TEXT,ve as CHIP_GROUP_TEXT,_e as CHIP_TEXT,ye as CHOICE_CARD_TEXT,be as CHOICE_CHIP_TEXT,d as CODE_BLOCK_TEXT,xe as COLOUR_FIELD_TEXT,Se as COLUMN_MENU_TEXT,f as COMMAND_PALETTE_TEXT,p as COMMENT_THREAD_TEXT,Ce as COMPARE_TABLE_TEXT,Y as CONFIRM_DIALOG_TEXT,we as CONFIRM_PROVIDER_TEXT,h as CONSENT_BANNER_TEXT,Te as CONTEXT_MENU_TEXT,Ee as COPY_BUTTON_TEXT,te as CUSTOM_RULE_TEXT,g as DASHBOARD_GRID_TEXT,De as DASHBOARD_HEADER_TEXT,_ as DATA_TABLE_TEXT,y as DATE_PICKER_TEXT,b as DATE_RANGE_PICKER_TEXT,x as DRAWER_TEXT,Oe as DROPDOWN_TEXT,ke as DROP_ZONE_TEXT,Ae as DUE_DATE_TEXT,je as ENTRY_GRID_TEXT,Me as ERROR_BOUNDARY_TEXT,Ne as ERROR_SUMMARY_TEXT,P as FIELD_TEXT,Pe as FILE_ATTACHMENT_TEXT,Fe as FILE_PICKER_TEXT,$ as FILE_VALIDATION_TEXT,Ie as FILE_VIEWER_TEXT,Le as FILTER_BAR_TEXT,Re as FLOATING_DOCK_TEXT,s as FORMATTERS_TEXT,Be as FORMULA_STEPS_TEXT,ze as FORM_ACTIONS_TEXT,S as GANTT_TEXT,Ve as HOVER_CARD_TEXT,l as HTTP_FAILURE_TEXT,He as IDLE_TIMEOUT_DIALOG_TEXT,C as IMAGE_CROP_TEXT,Z as IMAGE_PICKER_TEXT,Ue as INFO_TIP_TEXT,T as INLINE_EDIT_TEXT,Q as INPUT_MASK_TEXT,We as INPUT_TEXT,c as KANBAN_TEXT,Ge as KBD_TEXT,Ke as KPI_TILE_TEXT,qe as LABEL_HELP_TEXT,E as LEAD_POPUP_TEXT,D as LIGHTBOX_TEXT,Je as LOAD_MORE_TEXT,m as MENTION_INPUT_TEXT,Ye as MINI_CALENDAR_TEXT,Xe as MODAL_CARD_RENDERER_TEXT,Ze as MODAL_CONTENT_TEXT,Qe as MODAL_FORM_TEXT,J as MODAL_TEXT,$e as NAVIGATION_MENU_TEXT,O as NOTIFICATION_CENTRE_TEXT,et as NUMBER_INPUT_TEXT,tt as OFFLINE_BANNER_TEXT,nt as ONBOARDING_CHECKLIST_TEXT,k as ORG_TREE_TEXT,rt as OTP_INPUT_TEXT,A as OVERFLOW_TEXT,it as PAGE_HEADER_TEXT,ee as PASSWORD_RULES_TEXT,at as PERIOD_PICKER_TEXT,ot as PERSON_TEXT,st as PHONE_NUMBER_INPUT_TEXT,j as PHONE_TEXT,ct as PRICING_CARD_TEXT,lt as QR_CODE_TEXT,ut as QUERY_BUILDER_TEXT,dt as QUEUE_BUNDLE_TEXT,pt as RADIO_GROUP_TEXT,ft as RADIO_TEXT,mt as RATING_TEXT,ht as RECORD_PAGER_TEXT,M as RELATIVE_TIME_TEXT,gt as REPEATER_TEXT,_t as RESULT_BLOCK_TEXT,vt as RICH_TEXT_TEXT,yt as ROUTE_ERROR_TEXT,bt as ROW_ACTIONS_TEXT,K as ROW_DROP_TEXT,N as SAVED_VIEWS_TEXT,xt as SCORE_SCALE_TEXT,I as SEARCH_TEXT,St as SECTION_LEAD_CAPTURE_TEXT,Ct as SEGMENTED_TEXT,F as SELECT_TEXT,wt as SETTING_ROW_TEXT,ne as SHELL_TEXT,o as SHORTCUT_KEYS_TEXT,L as SHOW_MORE_TEXT,Tt as SKELETON_SHAPES_TEXT,R as SLIDER_TEXT,Et as SORTABLE_LIST_TEXT,z as SORTABLE_TEXT,Dt as SPARKLINE_TEXT,Ot as SPINNER_TEXT,kt as SPLASH_TEXT,At as SPLIT_BUTTON_TEXT,jt as SPLIT_VIEW_TEXT,Mt as STEPPER_TEXT,Nt as SWITCH_TEXT,Pt as TABLE_PAGINATION_TEXT,Ft as TABLE_ROWS_TEXT,v as TABLE_SELECT_TEXT,It as TABLE_TOOLBAR_TEXT,Lt as TABS_TEXT,Rt as TEXTAREA_TEXT,zt as THEME_TOGGLE_TEXT,Bt as TIMELINE_TEXT,B as TIME_PICKER_TEXT,X as TOAST_TEXT,H as TOUR_ADVANCE_TEXT,V as TOUR_TEXT,Vt as TRANSFER_LIST_TEXT,W as TREE_PICKER_TEXT,U as TREE_TEXT,q as UNSAVED_CHANGES_TEXT,Ht as UPDATE_BAR_TEXT,Ut as VALUE_TEXT,Wt as WHATS_NEW_TEXT,G as WIZARD_TEXT,Gt as WORKSPACE_SWITCHER_TEXT,a as fillText,n as pluralText,i as readText,Kt as setWuiText,e as subscribeText,r as textLocale};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var r=globalThis.WeborityUiElementsInternal?.version;if(r!==`0.
|
|
1
|
+
(function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var r=globalThis.WeborityUiElementsInternal?.version;if(r!==`0.187.1`)throw Error(`[webority-ui] calendar-views expects ui-elements 0.187.1 but the page loaded `+r+`.`);function i(e){"@babel/helpers - typeof";return i=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i(e)}function a(e,t){if(i(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(i(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function o(e){var t=a(e,`string`);return i(t)==`symbol`?t:t+``}function s(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=`#view=`,l=`wui-calendar-views:view-change`,u=`wui-calendar-views:period-change`,d=[`previous`,`next`,`today`],f=`.wui-cal-views-switch input[type='radio']`,p=class extends n.ElementBase{constructor(){super(),s(this,`_onChange`,void 0),s(this,`_onClick`,void 0),this._onChange=e=>this._choose(e),this._onClick=e=>this._step(e)}static get observedAttributes(){return[`view`]}connectedCallback(){if(this.addEventListener(`change`,this._onChange),this.addEventListener(`click`,this._onClick),!this.hasAttribute(`data-controlled`)){let e=m(this._views());e&&this.setAttribute(`view`,e)}if(!this.hasAttribute(`view`)){let e=this._views()[0];e&&this.setAttribute(`view`,e)}this._sync()}disconnectedCallback(){this.removeEventListener(`change`,this._onChange),this.removeEventListener(`click`,this._onClick)}attributeChangedCallback(){this._sync()}_views(){return Array.from(this.querySelectorAll(f),e=>e.value)}_sync(){let e=this.getAttribute(`view`)??``;for(let t of this.querySelectorAll(f))t.checked=t.value===e;for(let t of this.querySelectorAll(`:scope > .wui-cal-views-body[data-view]`))t.hidden=t.dataset.view!==e}_choose(e){let t=e.target;if(!(t instanceof HTMLInputElement)||t.type!==`radio`||!this.contains(t))return;let n=t.value;this.hasAttribute(`data-controlled`)||this.setAttribute(`view`,n),h(n),this.dispatchEvent(new CustomEvent(l,{bubbles:!0,detail:{view:n}})),this._sync()}_step(e){let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`button[data-step]`),r=n?.getAttribute(`data-step`)??``;n&&this.contains(n)&&d.includes(r)&&this.dispatchEvent(new CustomEvent(u,{bubbles:!0,detail:{step:r}}))}};function m(e){if(!window.location.hash.startsWith(c))return null;let t=window.location.hash.slice(6);return e.includes(t)?t:null}function h(e){let t=new URL(window.location.href);t.hash=`view=${e}`,window.history.replaceState(window.history.state,``,t)}(0,t.defineElement)(`wui-calendar-views`,p),e.WuiCalendarViews=p})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.elementBase);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=globalThis.WeborityUiElementsInternal?.version;if(a!==`0.186.1`)throw Error(`[webority-ui] carousel expects ui-elements 0.186.1 but the page loaded `+a+`.`);var o={carouselLabel:`carousel`,dotLabel:`Go to slide`,nextLabel:`Next slide`,pauseLabel:`Pause`,playLabel:`Play`,previousLabel:`Previous slide`,slideLabel:`slide`,slideText:`{n} of {total}`,statusTextOne:`Slide {first} of {total}`,statusTextOther:`Slides {first} to {last} of {total}`};function s(e){"@babel/helpers - typeof";return s=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},s(e)}function c(e,t){if(s(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(s(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function l(e){var t=c(e,`string`);return s(t)==`symbol`?t:t+``}function u(e,t,n){return(t=l(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=()=>(0,i.readText)(`carousel`,o),f=120,p=class extends n.ElementBase{static get observedAttributes(){return[`autoplay`]}constructor(){super(),u(this,`_page`,void 0),u(this,`_pages`,void 0),u(this,`_perView`,void 0),u(this,`_paused`,void 0),u(this,`_hover`,void 0),u(this,`_focus`,void 0),u(this,`_timer`,void 0),u(this,`_settleTimer`,void 0),u(this,`_status`,void 0),u(this,`_ready`,void 0),u(this,`_motion`,void 0),u(this,`_mutations`,void 0),u(this,`_resizer`,void 0),u(this,`_doc`,void 0),u(this,`_track`,void 0),u(this,`_onClick`,void 0),u(this,`_onKeyDown`,void 0),u(this,`_onScroll`,void 0),u(this,`_onEnter`,void 0),u(this,`_onLeave`,void 0),u(this,`_onFocusIn`,void 0),u(this,`_onFocusOut`,void 0),u(this,`_onVisibility`,void 0),u(this,`_onMotion`,void 0),u(this,`_tick`,void 0),this._page=0,this._pages=1,this._perView=1,this._paused=!1,this._hover=!1,this._focus=!1,this._timer=null,this._settleTimer=null,this._status=``,this._ready=!1,this._motion=null,this._mutations=null,this._resizer=null,this._doc=null,this._track=null,this._onClick=e=>this._click(e),this._onKeyDown=e=>this._key(e),this._onScroll=()=>{this._settleTimer!==null&&clearTimeout(this._settleTimer),this._settleTimer=setTimeout(()=>this._settle(),f)},this._onEnter=()=>this._hold({hover:!0}),this._onLeave=()=>this._hold({hover:!1}),this._onFocusIn=()=>this._hold({focus:!0}),this._onFocusOut=e=>this._hold({focus:e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)}),this._onVisibility=()=>this._sync(),this._onMotion=()=>this._sync(),this._tick=()=>{this._timer=null,this._go(this._page+1<this._pages?this._page+1:0)}}connectedCallback(){let e=this.querySelector(`.wui-carousel-track`);if(this._track=e instanceof HTMLElement?e:null,!this._track){this.ownerDocument.readyState===`loading`&&this.ownerDocument.addEventListener(`DOMContentLoaded`,()=>this.isConnected&&this.connectedCallback(),{once:!0});return}this._doc=this.ownerDocument;let t=this.getAttribute(`data-wui-style`);if(t){for(let e of t.split(`;`)){let t=e.indexOf(`:`);t>0&&this.style.setProperty(e.slice(0,t).trim(),e.slice(t+1).trim())}this.removeAttribute(`data-wui-style`)}this._motion=typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(prefers-reduced-motion: reduce)`):null,this._motion?.addEventListener(`change`,this._onMotion),this.addEventListener(`click`,this._onClick),this.addEventListener(`mouseenter`,this._onEnter),this.addEventListener(`mouseleave`,this._onLeave),this.addEventListener(`focusin`,this._onFocusIn),this.addEventListener(`focusout`,this._onFocusOut),this._track.addEventListener(`keydown`,this._onKeyDown),this._track.addEventListener(`scroll`,this._onScroll,{passive:!0}),this._doc.addEventListener(`visibilitychange`,this._onVisibility),typeof MutationObserver<`u`&&(this._mutations=new MutationObserver(()=>this._refresh()),this._mutations.observe(this._track,{childList:!0})),typeof ResizeObserver<`u`&&(this._resizer=new ResizeObserver(()=>this._refresh()),this._resizer.observe(this._track)),this._ready=!0,this._refresh()}disconnectedCallback(){this._ready=!1,this._timer!==null&&clearTimeout(this._timer),this._settleTimer!==null&&clearTimeout(this._settleTimer),this._timer=null,this._motion?.removeEventListener(`change`,this._onMotion),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`mouseenter`,this._onEnter),this.removeEventListener(`mouseleave`,this._onLeave),this.removeEventListener(`focusin`,this._onFocusIn),this.removeEventListener(`focusout`,this._onFocusOut),this._track?.removeEventListener(`keydown`,this._onKeyDown),this._track?.removeEventListener(`scroll`,this._onScroll),this._doc?.removeEventListener(`visibilitychange`,this._onVisibility),this._mutations?.disconnect(),this._resizer?.disconnect(),this._mutations=this._resizer=this._motion=this._doc=null}attributeChangedCallback(){this._ready&&this._sync()}get paused(){return this._paused}set paused(e){this._paused=!!e,this._ready&&this._sync()}next(){this._page+1<this._pages?this._go(this._page+1):this.hasAttribute(`loop`)&&this._go(0)}prev(){this._page>0?this._go(this._page-1):this.hasAttribute(`loop`)&&this._go(this._pages-1)}goTo(e){this._go(Number(e))}_interval(){let e=Number.parseInt(this.getAttribute(`autoplay`)??``,10);return Math.max(e||0,0)}_slides(){let e=this._track;if(!e)throw Error(`WuiCarousel used before it was connected`);return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e.classList.contains(`wui-carousel-slide`))}_playing(){return this._interval()>0&&this._pages>1&&!this._paused&&!this._hover&&!this._focus&&!this._motion?.matches&&!this._doc?.hidden}_hold({hover:e=this._hover,focus:t=this._focus}){this._hover=e,this._focus=t,this._sync()}_click(e){let t=(e.target instanceof Element?e.target:null)?.closest(`.wui-carousel-pause, .wui-carousel-prev, .wui-carousel-next, .wui-carousel-dot`),n=t instanceof HTMLElement?t:null;if(!n||!this.contains(n))return;let r=this._track;if(!r)throw Error(`WuiCarousel used before it was connected`);r.contains(n)||(n.classList.contains(`wui-carousel-pause`)?(this._paused=!this._paused,this._hover=!1,this._focus=!1,this._sync()):n.getAttribute(`aria-disabled`)===`true`?e.preventDefault():n.classList.contains(`wui-carousel-prev`)?this.prev():n.classList.contains(`wui-carousel-next`)?this.next():this._go(Number(n.dataset.page)))}_key(e){if(e.target!==this._track||e.altKey||e.ctrlKey||e.metaKey)return;let t={ArrowRight:()=>this.next(),ArrowLeft:()=>this.prev(),Home:()=>this._go(0),End:()=>this._go(this._pages-1)}[(0,r.mirrorKey)(e.key,(0,r.isRtl)(this))];t&&(e.preventDefault(),t())}_perViewNow(){let e=``;if(typeof window<`u`){let t=this._track;if(!t)throw Error(`WuiCarousel used before it was connected`);e=window.getComputedStyle(t).getPropertyValue(`--wui-carousel-view`)}return Math.max(Number.parseInt(e,10)||0,1)}_start(e){return Math.min(e*this._perView,Math.max(0,this._slides().length-this._perView))}_label(){let e=this._slides();return e.forEach((t,n)=>{let r=(0,i.fillText)(d().slideText,{n:n+1,total:e.length});t.getAttribute(`aria-label`)!==r&&t.setAttribute(`aria-label`,r)}),e.length}_refresh(){let e=this._label();this._perView=this._perViewNow();let t=Math.max(1,Math.ceil(e/this._perView)),n=this.querySelector(`.wui-carousel-dots`);if(n&&n.children.length!==t){let e=this.getAttribute(`dot-label`)||d().dotLabel;n.replaceChildren(...Array.from({length:t},(t,n)=>{let r=this.ownerDocument.createElement(`button`);return r.type=`button`,r.className=`wui-carousel-dot`,r.dataset.page=String(n),r.setAttribute(`aria-label`,`${e} ${this._start(n)+1}`),r}))}this._pages=t,this._page=Math.min(this._page,t-1),this.toggleAttribute(`data-single`,t<=1),this._render(!1),this._sync()}_settle(){let e=this._track;if(!e)throw Error(`WuiCarousel used before it was connected`);let t=this._slides();if(!t.length)return;let n;if(e.scrollWidth>e.clientWidth&&e.scrollLeft+e.clientWidth>=e.scrollWidth-2)n=this._pages-1;else{let r=0,i=1/0;t.forEach((t,n)=>{let a=Math.abs(t.offsetLeft-e.scrollLeft);a<i&&(i=a,r=n)}),n=Math.min(this._pages-1,Math.round(r/this._perView))}n!==this._page&&(this._page=n,this._render(!0),this._sync())}_go(e){if(!Number.isInteger(e))return;this._page=Math.max(0,Math.min(this._pages-1,e));let t=this._track;if(!t)throw Error(`WuiCarousel used before it was connected`);let n=this._slides()[this._start(this._page)];if(n){let e=this._motion?.matches?`auto`:`smooth`;typeof t.scrollTo==`function`?t.scrollTo({left:n.offsetLeft,behavior:e}):t.scrollLeft=n.offsetLeft}this._render(!0),this._sync()}_render(e){let t=this.hasAttribute(`loop`);for(let e of this.querySelectorAll(`.wui-carousel-dot`))e instanceof HTMLElement&&(Number(e.dataset.page)===this._page?e.setAttribute(`aria-current`,`true`):e.removeAttribute(`aria-current`));this.querySelector(`.wui-carousel-prev`)?.setAttribute(`aria-disabled`,String(!t&&this._page===0)),this.querySelector(`.wui-carousel-next`)?.setAttribute(`aria-disabled`,String(!t&&this._page===this._pages-1));let n=this._slides().length,r=this._start(this._page)+1,a=Math.min(n,r+this._perView-1),o=r===a?(0,i.fillText)(d().statusTextOne,{first:r,total:n}):(0,i.fillText)(d().statusTextOther,{first:r,last:a,total:n});if(o===this._status||(this._status=o,!e))return;let s=this.querySelector(`[data-wui-status]`);s&&!this._playing()&&(s.textContent=o),this.dispatchEvent(new CustomEvent(`wui:carousel:change`,{bubbles:!0,detail:{page:this._page,pages:this._pages}}))}_sync(){this._timer!==null&&clearTimeout(this._timer),this._timer=null;let e=this._interval(),t=this.querySelector(`.wui-carousel-pause`);if(t instanceof HTMLElement){t.hidden=e===0||this._pages<=1||!!this._motion?.matches;let n=this._paused?this.getAttribute(`play-label`)||d().playLabel:this.getAttribute(`pause-label`)||d().pauseLabel,r=t.querySelector(`.wui-carousel-pause-text`);r&&r.textContent!==n&&(r.textContent=n),this.toggleAttribute(`data-paused`,this._paused)}this._playing()&&(this._timer=setTimeout(this._tick,e))}};(0,t.defineElement)(`wui-carousel`,p),e.WuiCarousel=p})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.rtl,WeborityUiElementsInternal.modules.textStore);
|
|
1
|
+
(function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=globalThis.WeborityUiElementsInternal?.version;if(a!==`0.187.1`)throw Error(`[webority-ui] carousel expects ui-elements 0.187.1 but the page loaded `+a+`.`);var o={carouselLabel:`carousel`,dotLabel:`Go to slide`,nextLabel:`Next slide`,pauseLabel:`Pause`,playLabel:`Play`,previousLabel:`Previous slide`,slideLabel:`slide`,slideText:`{n} of {total}`,statusTextOne:`Slide {first} of {total}`,statusTextOther:`Slides {first} to {last} of {total}`};function s(e){"@babel/helpers - typeof";return s=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},s(e)}function c(e,t){if(s(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(s(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function l(e){var t=c(e,`string`);return s(t)==`symbol`?t:t+``}function u(e,t,n){return(t=l(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=()=>(0,i.readText)(`carousel`,o),f=120,p=class extends n.ElementBase{static get observedAttributes(){return[`autoplay`]}constructor(){super(),u(this,`_page`,void 0),u(this,`_pages`,void 0),u(this,`_perView`,void 0),u(this,`_paused`,void 0),u(this,`_hover`,void 0),u(this,`_focus`,void 0),u(this,`_timer`,void 0),u(this,`_settleTimer`,void 0),u(this,`_status`,void 0),u(this,`_ready`,void 0),u(this,`_motion`,void 0),u(this,`_mutations`,void 0),u(this,`_resizer`,void 0),u(this,`_doc`,void 0),u(this,`_track`,void 0),u(this,`_onClick`,void 0),u(this,`_onKeyDown`,void 0),u(this,`_onScroll`,void 0),u(this,`_onEnter`,void 0),u(this,`_onLeave`,void 0),u(this,`_onFocusIn`,void 0),u(this,`_onFocusOut`,void 0),u(this,`_onVisibility`,void 0),u(this,`_onMotion`,void 0),u(this,`_tick`,void 0),this._page=0,this._pages=1,this._perView=1,this._paused=!1,this._hover=!1,this._focus=!1,this._timer=null,this._settleTimer=null,this._status=``,this._ready=!1,this._motion=null,this._mutations=null,this._resizer=null,this._doc=null,this._track=null,this._onClick=e=>this._click(e),this._onKeyDown=e=>this._key(e),this._onScroll=()=>{this._settleTimer!==null&&clearTimeout(this._settleTimer),this._settleTimer=setTimeout(()=>this._settle(),f)},this._onEnter=()=>this._hold({hover:!0}),this._onLeave=()=>this._hold({hover:!1}),this._onFocusIn=()=>this._hold({focus:!0}),this._onFocusOut=e=>this._hold({focus:e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)}),this._onVisibility=()=>this._sync(),this._onMotion=()=>this._sync(),this._tick=()=>{this._timer=null,this._go(this._page+1<this._pages?this._page+1:0)}}connectedCallback(){let e=this.querySelector(`.wui-carousel-track`);if(this._track=e instanceof HTMLElement?e:null,!this._track){this.ownerDocument.readyState===`loading`&&this.ownerDocument.addEventListener(`DOMContentLoaded`,()=>this.isConnected&&this.connectedCallback(),{once:!0});return}this._doc=this.ownerDocument;let t=this.getAttribute(`data-wui-style`);if(t){for(let e of t.split(`;`)){let t=e.indexOf(`:`);t>0&&this.style.setProperty(e.slice(0,t).trim(),e.slice(t+1).trim())}this.removeAttribute(`data-wui-style`)}this._motion=typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(prefers-reduced-motion: reduce)`):null,this._motion?.addEventListener(`change`,this._onMotion),this.addEventListener(`click`,this._onClick),this.addEventListener(`mouseenter`,this._onEnter),this.addEventListener(`mouseleave`,this._onLeave),this.addEventListener(`focusin`,this._onFocusIn),this.addEventListener(`focusout`,this._onFocusOut),this._track.addEventListener(`keydown`,this._onKeyDown),this._track.addEventListener(`scroll`,this._onScroll,{passive:!0}),this._doc.addEventListener(`visibilitychange`,this._onVisibility),typeof MutationObserver<`u`&&(this._mutations=new MutationObserver(()=>this._refresh()),this._mutations.observe(this._track,{childList:!0})),typeof ResizeObserver<`u`&&(this._resizer=new ResizeObserver(()=>this._refresh()),this._resizer.observe(this._track)),this._ready=!0,this._refresh()}disconnectedCallback(){this._ready=!1,this._timer!==null&&clearTimeout(this._timer),this._settleTimer!==null&&clearTimeout(this._settleTimer),this._timer=null,this._motion?.removeEventListener(`change`,this._onMotion),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`mouseenter`,this._onEnter),this.removeEventListener(`mouseleave`,this._onLeave),this.removeEventListener(`focusin`,this._onFocusIn),this.removeEventListener(`focusout`,this._onFocusOut),this._track?.removeEventListener(`keydown`,this._onKeyDown),this._track?.removeEventListener(`scroll`,this._onScroll),this._doc?.removeEventListener(`visibilitychange`,this._onVisibility),this._mutations?.disconnect(),this._resizer?.disconnect(),this._mutations=this._resizer=this._motion=this._doc=null}attributeChangedCallback(){this._ready&&this._sync()}get paused(){return this._paused}set paused(e){this._paused=!!e,this._ready&&this._sync()}next(){this._page+1<this._pages?this._go(this._page+1):this.hasAttribute(`loop`)&&this._go(0)}prev(){this._page>0?this._go(this._page-1):this.hasAttribute(`loop`)&&this._go(this._pages-1)}goTo(e){this._go(Number(e))}_interval(){let e=Number.parseInt(this.getAttribute(`autoplay`)??``,10);return Math.max(e||0,0)}_slides(){let e=this._track;if(!e)throw Error(`WuiCarousel used before it was connected`);return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e.classList.contains(`wui-carousel-slide`))}_playing(){return this._interval()>0&&this._pages>1&&!this._paused&&!this._hover&&!this._focus&&!this._motion?.matches&&!this._doc?.hidden}_hold({hover:e=this._hover,focus:t=this._focus}){this._hover=e,this._focus=t,this._sync()}_click(e){let t=(e.target instanceof Element?e.target:null)?.closest(`.wui-carousel-pause, .wui-carousel-prev, .wui-carousel-next, .wui-carousel-dot`),n=t instanceof HTMLElement?t:null;if(!n||!this.contains(n))return;let r=this._track;if(!r)throw Error(`WuiCarousel used before it was connected`);r.contains(n)||(n.classList.contains(`wui-carousel-pause`)?(this._paused=!this._paused,this._hover=!1,this._focus=!1,this._sync()):n.getAttribute(`aria-disabled`)===`true`?e.preventDefault():n.classList.contains(`wui-carousel-prev`)?this.prev():n.classList.contains(`wui-carousel-next`)?this.next():this._go(Number(n.dataset.page)))}_key(e){if(e.target!==this._track||e.altKey||e.ctrlKey||e.metaKey)return;let t={ArrowRight:()=>this.next(),ArrowLeft:()=>this.prev(),Home:()=>this._go(0),End:()=>this._go(this._pages-1)}[(0,r.mirrorKey)(e.key,(0,r.isRtl)(this))];t&&(e.preventDefault(),t())}_perViewNow(){let e=``;if(typeof window<`u`){let t=this._track;if(!t)throw Error(`WuiCarousel used before it was connected`);e=window.getComputedStyle(t).getPropertyValue(`--wui-carousel-view`)}return Math.max(Number.parseInt(e,10)||0,1)}_start(e){return Math.min(e*this._perView,Math.max(0,this._slides().length-this._perView))}_label(){let e=this._slides();return e.forEach((t,n)=>{let r=(0,i.fillText)(d().slideText,{n:n+1,total:e.length});t.getAttribute(`aria-label`)!==r&&t.setAttribute(`aria-label`,r)}),e.length}_refresh(){let e=this._label();this._perView=this._perViewNow();let t=Math.max(1,Math.ceil(e/this._perView)),n=this.querySelector(`.wui-carousel-dots`);if(n&&n.children.length!==t){let e=this.getAttribute(`dot-label`)||d().dotLabel;n.replaceChildren(...Array.from({length:t},(t,n)=>{let r=this.ownerDocument.createElement(`button`);return r.type=`button`,r.className=`wui-carousel-dot`,r.dataset.page=String(n),r.setAttribute(`aria-label`,`${e} ${this._start(n)+1}`),r}))}this._pages=t,this._page=Math.min(this._page,t-1),this.toggleAttribute(`data-single`,t<=1),this._render(!1),this._sync()}_settle(){let e=this._track;if(!e)throw Error(`WuiCarousel used before it was connected`);let t=this._slides();if(!t.length)return;let n;if(e.scrollWidth>e.clientWidth&&e.scrollLeft+e.clientWidth>=e.scrollWidth-2)n=this._pages-1;else{let r=0,i=1/0;t.forEach((t,n)=>{let a=Math.abs(t.offsetLeft-e.scrollLeft);a<i&&(i=a,r=n)}),n=Math.min(this._pages-1,Math.round(r/this._perView))}n!==this._page&&(this._page=n,this._render(!0),this._sync())}_go(e){if(!Number.isInteger(e))return;this._page=Math.max(0,Math.min(this._pages-1,e));let t=this._track;if(!t)throw Error(`WuiCarousel used before it was connected`);let n=this._slides()[this._start(this._page)];if(n){let e=this._motion?.matches?`auto`:`smooth`;typeof t.scrollTo==`function`?t.scrollTo({left:n.offsetLeft,behavior:e}):t.scrollLeft=n.offsetLeft}this._render(!0),this._sync()}_render(e){let t=this.hasAttribute(`loop`);for(let e of this.querySelectorAll(`.wui-carousel-dot`))e instanceof HTMLElement&&(Number(e.dataset.page)===this._page?e.setAttribute(`aria-current`,`true`):e.removeAttribute(`aria-current`));this.querySelector(`.wui-carousel-prev`)?.setAttribute(`aria-disabled`,String(!t&&this._page===0)),this.querySelector(`.wui-carousel-next`)?.setAttribute(`aria-disabled`,String(!t&&this._page===this._pages-1));let n=this._slides().length,r=this._start(this._page)+1,a=Math.min(n,r+this._perView-1),o=r===a?(0,i.fillText)(d().statusTextOne,{first:r,total:n}):(0,i.fillText)(d().statusTextOther,{first:r,last:a,total:n});if(o===this._status||(this._status=o,!e))return;let s=this.querySelector(`[data-wui-status]`);s&&!this._playing()&&(s.textContent=o),this.dispatchEvent(new CustomEvent(`wui:carousel:change`,{bubbles:!0,detail:{page:this._page,pages:this._pages}}))}_sync(){this._timer!==null&&clearTimeout(this._timer),this._timer=null;let e=this._interval(),t=this.querySelector(`.wui-carousel-pause`);if(t instanceof HTMLElement){t.hidden=e===0||this._pages<=1||!!this._motion?.matches;let n=this._paused?this.getAttribute(`play-label`)||d().playLabel:this.getAttribute(`pause-label`)||d().pauseLabel,r=t.querySelector(`.wui-carousel-pause-text`);r&&r.textContent!==n&&(r.textContent=n),this.toggleAttribute(`data-paused`,this._paused)}this._playing()&&(this._timer=setTimeout(this._tick,e))}};(0,t.defineElement)(`wui-carousel`,p),e.WuiCarousel=p})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.rtl,WeborityUiElementsInternal.modules.textStore);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t,n,r,i,a,o,s){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var c=globalThis.WeborityUiElementsInternal?.version;if(c!==`0.186.1`)throw Error(`[webority-ui] code-block expects ui-elements 0.186.1 but the page loaded `+c+`.`);Object.freeze([`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`razor`,`css`]);var l=Object.freeze({text:``,json:`JSON`,js:`JavaScript`,cs:`C#`,sql:`SQL`,bash:`Bash`,http:`HTTP`,html:`HTML`,razor:`Razor`,css:`CSS`}),u=e=>RegExp(`\\b(?:${e.join(`|`)})\\b`),d=`(?![\\s\\S])`,f=RegExp(`/\\*[\\s\\S]*?(?:\\*/|${d})`).source,p=[[`attr`,/"(?:[^"\\\n]|\\.)*"(?=\s*:)/],[`string`,/"(?:[^"\\\n]|\\.)*"?/],[`number`,/-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],[`literal`,u([`true`,`false`,`null`])],[`punct`,/[{}[\],:]/]],m=[[`comment`,RegExp(`//[^\\n]*|${f}`)],[`string`,/"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?|`(?:[^`\\]|\\[\s\S])*`?/],[`number`,/\b(?:0[xX][\da-fA-F_]+|\d[\d_]*\.?\d*(?:[eE][+-]?\d+)?n?)\b/],[`keyword`,u(`async.await.break.case.catch.class.const.continue.default.delete.do.else.export.extends.finally.for.from.function.if.import.in.instanceof.let.new.of.return.static.super.switch.this.throw.try.typeof.var.void.while.yield`.split(`.`))],[`literal`,u([`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`])],[`function`,RegExp(`(?<![\\w$])[A-Za-z_$][\\w$]*(?=\\s*\\()`,``)],[`type`,RegExp(`(?<![\\w$])[A-Z][\\w$]*`,``)],[`punct`,/[{}()[\];,]/]],h=[[`comment`,RegExp(`//[^\\n]*|${f}`)],[`string`,/@"(?:[^"]|"")*"?|\$@?"(?:[^"\\\n]|\\.)*"?|"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?/],[`number`,/\b\d[\d_]*\.?\d*(?:[eE][+-]?\d+)?[fFdDmMlLuU]{0,2}\b/],[`keyword`,u(`abstract.as.async.await.base.bool.break.byte.case.catch.char.checked.class.const.continue.decimal.default.delegate.do.double.else.enum.event.explicit.extern.finally.fixed.float.for.foreach.get.goto.if.implicit.in.init.int.interface.internal.is.lock.long.namespace.new.object.operator.out.override.params.private.protected.public.readonly.record.ref.required.return.sbyte.sealed.set.short.sizeof.static.string.struct.switch.this.throw.try.typeof.uint.ulong.unchecked.unsafe.ushort.using.var.virtual.void.volatile.when.while.with`.split(`.`))],[`literal`,u([`true`,`false`,`null`])],[`function`,RegExp(`(?<!\\w)[A-Za-z_]\\w*(?=\\s*\\()`,``)],[`type`,RegExp(`(?<!\\w)[A-Z]\\w*`,``)],[`punct`,/[{}()[\];,]/]],g=[[`comment`,RegExp(`--[^\\n]*|${f}`)],[`string`,/'(?:[^']|'')*'?/],[`variable`,/@@?\w+/],[`number`,/\b\d+(?:\.\d+)?\b/],[`keyword`,u(`add.all.alter.and.as.asc.begin.between.by.case.check.column.commit.constraint.create.cross.database.declare.default.delete.desc.distinct.drop.else.end.exec.execute.exists.foreign.from.full.function.group.having.if.in.index.inner.insert.into.is.join.key.left.like.limit.not.null.offset.on.or.order.outer.over.partition.primary.procedure.references.return.returns.right.rollback.select.set.table.then.top.transaction.union.unique.update.values.view.when.where.while.with`.split(`.`))],[`literal`,u([`true`,`false`])],[`type`,u([`bigint`,`bit`,`char`,`date`,`datetime`,`datetime2`,`decimal`,`float`,`int`,`money`,`nchar`,`numeric`,`nvarchar`,`real`,`smallint`,`text`,`time`,`tinyint`,`uniqueidentifier`,`varchar`])],[`function`,/\b[A-Za-z_]\w*(?=\s*\()/],[`punct`,/[(),;]/]],_=[[`comment`,RegExp(`(?<![^\\s;|&(])#[^\\n]*`,``)],[`string`,/"(?:[^"\\]|\\[\s\S])*"?|'[^']*'?/],[`variable`,/\$(?:\{[^}\n]*\}?|[A-Za-z_]\w*|[0-9@#?$!*-])/],[`attr`,RegExp(`(?<![\\w-])--?[A-Za-z][\\w-]*`,``)],[`number`,RegExp(`(?<![\\w.-])\\d+(?:\\.\\d+)?\\b`,``)],[`keyword`,u([`case`,`do`,`done`,`elif`,`else`,`esac`,`exit`,`export`,`fi`,`for`,`function`,`if`,`in`,`local`,`return`,`select`,`then`,`until`,`while`])],[`function`,u(`awk.az.cat.cd.chmod.chown.cp.curl.docker.dotnet.echo.gcloud.git.grep.kubectl.ls.mkdir.mv.npm.npx.pnpm.rm.sed.source.sudo.wget`.split(`.`))],[`punct`,/[|&;<>(){}[\]]+/]],v=[[`comment`,/^#[^\n]*/m],[`keyword`,/^(?:GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS|TRACE|CONNECT)(?= )/m],[`literal`,/HTTP\/\d(?:\.\d)?/],[`number`,RegExp(`(?<=^HTTP\\/\\d(?:\\.\\d)? )\\d{3}\\b`,`m`)],[`function`,RegExp(`(?<=^[A-Z]+ )\\S+`,`m`)],[`attr`,/^[A-Za-z][\w-]*(?=:)/m],[`string`,RegExp(`(?<=^[A-Za-z][\\w-]*:[ \\t]*)[^\\n]+`,`m`)]],y=[[`comment`,RegExp(`<!--[\\s\\S]*?(?:-->|${d})`)],[`keyword`,/<![A-Za-z][^>]*>?/],[`tag`,/<\/?[A-Za-z][^<>]*>?/],[`literal`,/&#?\w+;/]],b=[[`tag`,/^<\/?[\w:.-]+/],[`string`,/"[^"]*"?|'[^']*'?/],[`attr`,RegExp(`(?<=\\s)[^\\s=<>/"']+`,``)],[`punct`,/\/?>|=/]],x={json:p,js:m,cs:h,sql:g,bash:_,http:v,css:[[`comment`,new RegExp(f)],[`string`,/"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?/],[`keyword`,/@[\w-]+|!important/],[`attr`,/[\w-]+(?=\s*:[^{};]*[;}])/],[`number`,RegExp(`#[0-9a-fA-F]{3,8}\\b|(?<![\\w-])-?(?:\\d+\\.?\\d*|\\.\\d+)(?:%|[A-Za-z]{1,4})?`,``)],[`function`,/[\w-]+(?=\()/],[`type`,/[.#](?!\d)[A-Za-z_][\w-]*/],[`punct`,/[{}();:,]/]],html:y,htmlTag:b},S=e=>(0,r.hasOwn)(x,e),C=new Map;function w(e){let t=C.get(e);if(!t){let n=x[e],r=e===`sql`?`gi`:`g`,i=n.map(([,e])=>`(${e.source})`).join(`|`);t={re:new RegExp(i,`${r}m`),types:n.map(([e])=>e)},C.set(e,t)}return t}function T(e,t,n){if(!n)return;let r=e[e.length-1];r&&r[0]===t?r[1]+=n:e.push([t,n])}function E(e,t,n=[]){let{re:r,types:i}=w(e),a=0;for(let o of t.matchAll(r)){let r=o[0];if(!r)continue;T(n,`plain`,t.slice(a,o.index));let s=i.findIndex((e,t)=>o[t+1]!==void 0);e===`html`&&i[s]===`tag`?E(`htmlTag`,r,n):T(n,i[s]??`plain`,r),a=o.index+r.length}return T(n,`plain`,t.slice(a)),n}function D(e){let t=/\r?\n\r?\n/.exec(e);if(!t)return E(`http`,e);let n=t[0]??``,r=E(`http`,e.slice(0,t.index+n.length)),i=e.slice(t.index+n.length),a=i.trimStart()[0];return a===`{`||a===`[`?E(`json`,i,r):a===`<`?E(`html`,i,r):(T(r,`plain`,i),r)}function O(e,t){let n=String(e??``);if(!n||n.length>1e5)return n?[[`plain`,n]]:[];if(t===`http`)return D(n);let r=t===`razor`?`html`:t;return!S(r)||r===`htmlTag`?[[`plain`,n]]:E(r,n)}function k(e,t){let n=[],r=[n];for(let[i,a]of O(e,t))a.split(/\r\n|\r|\n/).forEach((e,t)=>{t>0&&(n=[],r.push(n)),e&&n.push([i,e])});return r.length>1&&n.length===0&&r.pop(),r}var A={copiedLabel:`Copied`,copyLabel:`Copy`,label:`Code`};function j(e){"@babel/helpers - typeof";return j=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},j(e)}function M(e,t){if(j(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(j(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function N(e){var t=M(e,`string`);return j(t)==`symbol`?t:t+``}function P(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var F=()=>(0,s.readText)(`codeBlock`,A);function I(e){return(0,r.hasOwn)(l,e)}var L=class extends a.ElementBase{constructor(){super(),P(this,`_title`,void 0),P(this,`_view`,void 0),P(this,`_codeEl`,void 0),P(this,`_copyIcon`,void 0),P(this,`_copyText`,void 0),P(this,`_chrome`,null),P(this,`_copied`,!1),P(this,`_observer`,null),P(this,`_timer`,0),P(this,`_cancelFrame`,null);let e=this.ownerDocument;this._title=e.createElement(`span`),this._title.className=`wui-code-title`,this._view=e.createElement(`div`),this._codeEl=e.createElement(`code`),this._copyIcon=e.createElement(`span`),this._copyIcon.className=`wui-code-copy-icon`,this._copyText=e.createElement(`span`)}static get observedAttributes(){return[`language`,`line-numbers`,`wrap`,`label`,`copy-label`,`copied-label`]}connectedCallback(){this._render(),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(e=>{e.some(e=>!this._chrome?.contains(e.target))&&this._schedule()}),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0}))}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._cancelPending()}attributeChangedCallback(){this.isConnected&&this._render()}_source(){return Array.from(this.children).find(e=>e.classList.contains(`wui-code-source`))}_code(){return(this._source()?.textContent??``).replace(/\r?\n$/,``)}_schedule(){if(this._cancelFrame)return;let e=()=>{this._cancelFrame=null,this._render()};if(typeof requestAnimationFrame==`function`){let t=requestAnimationFrame(e);this._cancelFrame=()=>cancelAnimationFrame(t)}else{let t=!0;queueMicrotask(()=>{t&&e()}),this._cancelFrame=()=>{t=!1}}}_cancelPending(){this._cancelFrame?.(),this._cancelFrame=null}_render(){if(!this._source())return;this._cancelPending();let e=this.ownerDocument;this._chrome||this._build(e);let t=this.getAttribute(`language`),n=t!==null&&I(t)?t:`text`,r=this.getAttribute(`label`)||``,i=k(this._code(),n);this._title.textContent=r||l[n],this._view.setAttribute(`aria-label`,r||F().label),this._view.style.setProperty(`--wui-code-digits`,String(String(i.length).length)),this._codeEl.replaceChildren(...i.map(t=>R(e,t))),this._copied||(this._copyText.textContent=this._copyLabel()),this.setAttribute(`data-wui-ready`,``),this._observer?.takeRecords()}_build(e){let t=e.createElement(`div`);t.className=`wui-code-chrome`,t.append(this._bar(e));let n=this._view;n.className=`wui-code-view`,n.setAttribute(`role`,`region`),n.tabIndex=0;let r=e.createElement(`pre`);r.className=`wui-code-pre`,r.append(this._codeEl),n.append(r),t.append(n),this._chrome=t,this.append(t)}_bar(e){let t=e.createElement(`div`);t.className=`wui-code-bar`;let r=e.createElement(`button`);return r.type=`button`,r.className=`${(0,n.buttonClass)(`primary`,`ghost`,`sm`)} wui-code-copy`,r.dataset.wui=n.APP_BUTTON_MARKER,r.setAttribute(`aria-live`,`polite`),this._setCopied(!1),r.append(this._copyIcon,this._copyText),r.addEventListener(`click`,async()=>{await(0,i.copyTextToClipboard)(this._code())&&(this._setCopied(!0),clearTimeout(this._timer),this._timer=window.setTimeout(()=>this._setCopied(!1),i.COPY_FEEDBACK_MS))}),t.append(this._title,r),t}_setCopied(e){this._copied=e;let t=(0,o.glyphNode)(e?`check`:`files`,{size:14});this._copyIcon.replaceChildren(...t?[t]:[]),this._copyText.textContent=this._copyLabel()}_copyLabel(){return this._copied?this.getAttribute(`copied-label`)||F().copiedLabel:this.getAttribute(`copy-label`)||F().copyLabel}};function R(e,t){let n=e.createElement(`span`);n.className=`wui-code-line`;for(let[r,i]of t){if(r===`plain`){n.append(i);continue}let t=e.createElement(`span`);t.className=`wui-code-t-${r}`,t.textContent=i,n.append(t)}return n}(0,t.defineElement)(`wui-code-block`,L),e.WuiCodeBlock=L})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.buttonClass,WeborityUiElementsInternal.modules.hasOwn,WeborityUiElementsInternal.modules.copyText,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.iconGlyphs,WeborityUiElementsInternal.modules.textStore);
|
|
1
|
+
(function(e,t,n,r,i,a,o,s){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var c=globalThis.WeborityUiElementsInternal?.version;if(c!==`0.187.1`)throw Error(`[webority-ui] code-block expects ui-elements 0.187.1 but the page loaded `+c+`.`);Object.freeze([`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`razor`,`css`]);var l=Object.freeze({text:``,json:`JSON`,js:`JavaScript`,cs:`C#`,sql:`SQL`,bash:`Bash`,http:`HTTP`,html:`HTML`,razor:`Razor`,css:`CSS`}),u=e=>RegExp(`\\b(?:${e.join(`|`)})\\b`),d=`(?![\\s\\S])`,f=RegExp(`/\\*[\\s\\S]*?(?:\\*/|${d})`).source,p=[[`attr`,/"(?:[^"\\\n]|\\.)*"(?=\s*:)/],[`string`,/"(?:[^"\\\n]|\\.)*"?/],[`number`,/-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],[`literal`,u([`true`,`false`,`null`])],[`punct`,/[{}[\],:]/]],m=[[`comment`,RegExp(`//[^\\n]*|${f}`)],[`string`,/"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?|`(?:[^`\\]|\\[\s\S])*`?/],[`number`,/\b(?:0[xX][\da-fA-F_]+|\d[\d_]*\.?\d*(?:[eE][+-]?\d+)?n?)\b/],[`keyword`,u(`async.await.break.case.catch.class.const.continue.default.delete.do.else.export.extends.finally.for.from.function.if.import.in.instanceof.let.new.of.return.static.super.switch.this.throw.try.typeof.var.void.while.yield`.split(`.`))],[`literal`,u([`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`])],[`function`,RegExp(`(?<![\\w$])[A-Za-z_$][\\w$]*(?=\\s*\\()`,``)],[`type`,RegExp(`(?<![\\w$])[A-Z][\\w$]*`,``)],[`punct`,/[{}()[\];,]/]],h=[[`comment`,RegExp(`//[^\\n]*|${f}`)],[`string`,/@"(?:[^"]|"")*"?|\$@?"(?:[^"\\\n]|\\.)*"?|"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?/],[`number`,/\b\d[\d_]*\.?\d*(?:[eE][+-]?\d+)?[fFdDmMlLuU]{0,2}\b/],[`keyword`,u(`abstract.as.async.await.base.bool.break.byte.case.catch.char.checked.class.const.continue.decimal.default.delegate.do.double.else.enum.event.explicit.extern.finally.fixed.float.for.foreach.get.goto.if.implicit.in.init.int.interface.internal.is.lock.long.namespace.new.object.operator.out.override.params.private.protected.public.readonly.record.ref.required.return.sbyte.sealed.set.short.sizeof.static.string.struct.switch.this.throw.try.typeof.uint.ulong.unchecked.unsafe.ushort.using.var.virtual.void.volatile.when.while.with`.split(`.`))],[`literal`,u([`true`,`false`,`null`])],[`function`,RegExp(`(?<!\\w)[A-Za-z_]\\w*(?=\\s*\\()`,``)],[`type`,RegExp(`(?<!\\w)[A-Z]\\w*`,``)],[`punct`,/[{}()[\];,]/]],g=[[`comment`,RegExp(`--[^\\n]*|${f}`)],[`string`,/'(?:[^']|'')*'?/],[`variable`,/@@?\w+/],[`number`,/\b\d+(?:\.\d+)?\b/],[`keyword`,u(`add.all.alter.and.as.asc.begin.between.by.case.check.column.commit.constraint.create.cross.database.declare.default.delete.desc.distinct.drop.else.end.exec.execute.exists.foreign.from.full.function.group.having.if.in.index.inner.insert.into.is.join.key.left.like.limit.not.null.offset.on.or.order.outer.over.partition.primary.procedure.references.return.returns.right.rollback.select.set.table.then.top.transaction.union.unique.update.values.view.when.where.while.with`.split(`.`))],[`literal`,u([`true`,`false`])],[`type`,u([`bigint`,`bit`,`char`,`date`,`datetime`,`datetime2`,`decimal`,`float`,`int`,`money`,`nchar`,`numeric`,`nvarchar`,`real`,`smallint`,`text`,`time`,`tinyint`,`uniqueidentifier`,`varchar`])],[`function`,/\b[A-Za-z_]\w*(?=\s*\()/],[`punct`,/[(),;]/]],_=[[`comment`,RegExp(`(?<![^\\s;|&(])#[^\\n]*`,``)],[`string`,/"(?:[^"\\]|\\[\s\S])*"?|'[^']*'?/],[`variable`,/\$(?:\{[^}\n]*\}?|[A-Za-z_]\w*|[0-9@#?$!*-])/],[`attr`,RegExp(`(?<![\\w-])--?[A-Za-z][\\w-]*`,``)],[`number`,RegExp(`(?<![\\w.-])\\d+(?:\\.\\d+)?\\b`,``)],[`keyword`,u([`case`,`do`,`done`,`elif`,`else`,`esac`,`exit`,`export`,`fi`,`for`,`function`,`if`,`in`,`local`,`return`,`select`,`then`,`until`,`while`])],[`function`,u(`awk.az.cat.cd.chmod.chown.cp.curl.docker.dotnet.echo.gcloud.git.grep.kubectl.ls.mkdir.mv.npm.npx.pnpm.rm.sed.source.sudo.wget`.split(`.`))],[`punct`,/[|&;<>(){}[\]]+/]],v=[[`comment`,/^#[^\n]*/m],[`keyword`,/^(?:GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS|TRACE|CONNECT)(?= )/m],[`literal`,/HTTP\/\d(?:\.\d)?/],[`number`,RegExp(`(?<=^HTTP\\/\\d(?:\\.\\d)? )\\d{3}\\b`,`m`)],[`function`,RegExp(`(?<=^[A-Z]+ )\\S+`,`m`)],[`attr`,/^[A-Za-z][\w-]*(?=:)/m],[`string`,RegExp(`(?<=^[A-Za-z][\\w-]*:[ \\t]*)[^\\n]+`,`m`)]],y=[[`comment`,RegExp(`<!--[\\s\\S]*?(?:-->|${d})`)],[`keyword`,/<![A-Za-z][^>]*>?/],[`tag`,/<\/?[A-Za-z][^<>]*>?/],[`literal`,/&#?\w+;/]],b=[[`tag`,/^<\/?[\w:.-]+/],[`string`,/"[^"]*"?|'[^']*'?/],[`attr`,RegExp(`(?<=\\s)[^\\s=<>/"']+`,``)],[`punct`,/\/?>|=/]],x={json:p,js:m,cs:h,sql:g,bash:_,http:v,css:[[`comment`,new RegExp(f)],[`string`,/"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?/],[`keyword`,/@[\w-]+|!important/],[`attr`,/[\w-]+(?=\s*:[^{};]*[;}])/],[`number`,RegExp(`#[0-9a-fA-F]{3,8}\\b|(?<![\\w-])-?(?:\\d+\\.?\\d*|\\.\\d+)(?:%|[A-Za-z]{1,4})?`,``)],[`function`,/[\w-]+(?=\()/],[`type`,/[.#](?!\d)[A-Za-z_][\w-]*/],[`punct`,/[{}();:,]/]],html:y,htmlTag:b},S=e=>(0,r.hasOwn)(x,e),C=new Map;function w(e){let t=C.get(e);if(!t){let n=x[e],r=e===`sql`?`gi`:`g`,i=n.map(([,e])=>`(${e.source})`).join(`|`);t={re:new RegExp(i,`${r}m`),types:n.map(([e])=>e)},C.set(e,t)}return t}function T(e,t,n){if(!n)return;let r=e[e.length-1];r&&r[0]===t?r[1]+=n:e.push([t,n])}function E(e,t,n=[]){let{re:r,types:i}=w(e),a=0;for(let o of t.matchAll(r)){let r=o[0];if(!r)continue;T(n,`plain`,t.slice(a,o.index));let s=i.findIndex((e,t)=>o[t+1]!==void 0);e===`html`&&i[s]===`tag`?E(`htmlTag`,r,n):T(n,i[s]??`plain`,r),a=o.index+r.length}return T(n,`plain`,t.slice(a)),n}function D(e){let t=/\r?\n\r?\n/.exec(e);if(!t)return E(`http`,e);let n=t[0]??``,r=E(`http`,e.slice(0,t.index+n.length)),i=e.slice(t.index+n.length),a=i.trimStart()[0];return a===`{`||a===`[`?E(`json`,i,r):a===`<`?E(`html`,i,r):(T(r,`plain`,i),r)}function O(e,t){let n=String(e??``);if(!n||n.length>1e5)return n?[[`plain`,n]]:[];if(t===`http`)return D(n);let r=t===`razor`?`html`:t;return!S(r)||r===`htmlTag`?[[`plain`,n]]:E(r,n)}function k(e,t){let n=[],r=[n];for(let[i,a]of O(e,t))a.split(/\r\n|\r|\n/).forEach((e,t)=>{t>0&&(n=[],r.push(n)),e&&n.push([i,e])});return r.length>1&&n.length===0&&r.pop(),r}var A={copiedLabel:`Copied`,copyLabel:`Copy`,label:`Code`};function j(e){"@babel/helpers - typeof";return j=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},j(e)}function M(e,t){if(j(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(j(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function N(e){var t=M(e,`string`);return j(t)==`symbol`?t:t+``}function P(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var F=()=>(0,s.readText)(`codeBlock`,A);function I(e){return(0,r.hasOwn)(l,e)}var L=class extends a.ElementBase{constructor(){super(),P(this,`_title`,void 0),P(this,`_view`,void 0),P(this,`_codeEl`,void 0),P(this,`_copyIcon`,void 0),P(this,`_copyText`,void 0),P(this,`_chrome`,null),P(this,`_copied`,!1),P(this,`_observer`,null),P(this,`_timer`,0),P(this,`_cancelFrame`,null);let e=this.ownerDocument;this._title=e.createElement(`span`),this._title.className=`wui-code-title`,this._view=e.createElement(`div`),this._codeEl=e.createElement(`code`),this._copyIcon=e.createElement(`span`),this._copyIcon.className=`wui-code-copy-icon`,this._copyText=e.createElement(`span`)}static get observedAttributes(){return[`language`,`line-numbers`,`wrap`,`label`,`copy-label`,`copied-label`]}connectedCallback(){this._render(),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(e=>{e.some(e=>!this._chrome?.contains(e.target))&&this._schedule()}),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0}))}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._cancelPending()}attributeChangedCallback(){this.isConnected&&this._render()}_source(){return Array.from(this.children).find(e=>e.classList.contains(`wui-code-source`))}_code(){return(this._source()?.textContent??``).replace(/\r?\n$/,``)}_schedule(){if(this._cancelFrame)return;let e=()=>{this._cancelFrame=null,this._render()};if(typeof requestAnimationFrame==`function`){let t=requestAnimationFrame(e);this._cancelFrame=()=>cancelAnimationFrame(t)}else{let t=!0;queueMicrotask(()=>{t&&e()}),this._cancelFrame=()=>{t=!1}}}_cancelPending(){this._cancelFrame?.(),this._cancelFrame=null}_render(){if(!this._source())return;this._cancelPending();let e=this.ownerDocument;this._chrome||this._build(e);let t=this.getAttribute(`language`),n=t!==null&&I(t)?t:`text`,r=this.getAttribute(`label`)||``,i=k(this._code(),n);this._title.textContent=r||l[n],this._view.setAttribute(`aria-label`,r||F().label),this._view.style.setProperty(`--wui-code-digits`,String(String(i.length).length)),this._codeEl.replaceChildren(...i.map(t=>R(e,t))),this._copied||(this._copyText.textContent=this._copyLabel()),this.setAttribute(`data-wui-ready`,``),this._observer?.takeRecords()}_build(e){let t=e.createElement(`div`);t.className=`wui-code-chrome`,t.append(this._bar(e));let n=this._view;n.className=`wui-code-view`,n.setAttribute(`role`,`region`),n.tabIndex=0;let r=e.createElement(`pre`);r.className=`wui-code-pre`,r.append(this._codeEl),n.append(r),t.append(n),this._chrome=t,this.append(t)}_bar(e){let t=e.createElement(`div`);t.className=`wui-code-bar`;let r=e.createElement(`button`);return r.type=`button`,r.className=`${(0,n.buttonClass)(`primary`,`ghost`,`sm`)} wui-code-copy`,r.dataset.wui=n.APP_BUTTON_MARKER,r.setAttribute(`aria-live`,`polite`),this._setCopied(!1),r.append(this._copyIcon,this._copyText),r.addEventListener(`click`,async()=>{await(0,i.copyTextToClipboard)(this._code())&&(this._setCopied(!0),clearTimeout(this._timer),this._timer=window.setTimeout(()=>this._setCopied(!1),i.COPY_FEEDBACK_MS))}),t.append(this._title,r),t}_setCopied(e){this._copied=e;let t=(0,o.glyphNode)(e?`check`:`files`,{size:14});this._copyIcon.replaceChildren(...t?[t]:[]),this._copyText.textContent=this._copyLabel()}_copyLabel(){return this._copied?this.getAttribute(`copied-label`)||F().copiedLabel:this.getAttribute(`copy-label`)||F().copyLabel}};function R(e,t){let n=e.createElement(`span`);n.className=`wui-code-line`;for(let[r,i]of t){if(r===`plain`){n.append(i);continue}let t=e.createElement(`span`);t.className=`wui-code-t-${r}`,t.textContent=i,n.append(t)}return n}(0,t.defineElement)(`wui-code-block`,L),e.WuiCodeBlock=L})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.buttonClass,WeborityUiElementsInternal.modules.hasOwn,WeborityUiElementsInternal.modules.copyText,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.iconGlyphs,WeborityUiElementsInternal.modules.textStore);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=globalThis.WeborityUiElementsInternal?.version;if(o!==`0.
|
|
1
|
+
(function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=globalThis.WeborityUiElementsInternal?.version;if(o!==`0.187.1`)throw Error(`[webority-ui] command-palette expects ui-elements 0.187.1 but the page loaded `+o+`.`);var s={allCountText:`All ({count})`,ariaLabel:`Search`,backLabel:`Back`,emptyText:`No results`,errorRetryLabel:`Try again`,placeholder:`Search…`,recentsLabel:`Recent`,resultGroupsLabel:`Result groups`,resultsLabel:`Results`,rootLabel:`All`};function c(e){"@babel/helpers - typeof";return c=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},c(e)}function l(e,t){if(c(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(c(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function u(e){var t=l(e,`string`);return c(t)==`symbol`?t:t+``}function d(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f=`[role="option"]`,p=()=>(0,i.readText)(`commandPalette`,s),m=5,h=20,g=`.wui-cmd-back, [data-depth]`,_=`[data-group-tab]`,v=`.wui-cmd-error-retry`,y=0;function b(e,t){if(!(e instanceof Element))return null;let n=e.closest(t);return n instanceof HTMLElement?n:null}var x=(e,t,n)=>{let r=e.querySelector(t);return r instanceof n?r:null},S=(e,t,n)=>[...e.querySelectorAll(t)].filter(e=>e instanceof n),C=class extends r.ElementBase{static get observedAttributes(){return[`filter`,`group-filter`,`highlight`,`empty-text`,`path`,`root-label`,`recents-key`,`recents-limit`,`recents-label`]}constructor(){super(),d(this,`_path`,void 0),d(this,`_group`,void 0),d(this,`_crumbSig`,void 0),d(this,`_modal`,void 0),d(this,`_recentsId`,void 0),d(this,`_onModalClosed`,void 0),d(this,`_activeId`,void 0),d(this,`_lastQuery`,void 0),d(this,`_lastIds`,void 0),d(this,`_userChose`,void 0),d(this,`_onKeyDown`,void 0),d(this,`_onClick`,void 0),d(this,`_onMouseDown`,void 0),d(this,`_onMouseMove`,void 0),d(this,`_onInput`,void 0),this._path=[],this._group=null,this._crumbSig=null,this._modal=null,this._recentsId=`wui-cmd-recents-${++y}`,this._onModalClosed=()=>{this._setKeyboard(!1),this._reset(),this.hasAttribute(`path`)&&this._restart()},this._activeId=null,this._lastQuery=null,this._lastIds=null,this._userChose=!1,this._onKeyDown=e=>this._handleKeyDown(e),this._onClick=e=>{let t=b(e.target,v);if(t&&this.contains(t)){this.dispatchEvent(new CustomEvent(`wui-command-palette:retry`,{bubbles:!0}));return}let n=b(e.target,g);if(n&&this.contains(n)){let e=n.matches(`.wui-cmd-back`)?this._path.length-1:Number(n.dataset.depth);this._goTo(this._path.slice(0,e));return}let r=b(e.target,_);if(r&&this.contains(r)){this._pickGroup(r.dataset.groupTab||null);return}let i=this._optionFrom(e.target);i&&this._select(i)},this._onMouseDown=e=>{let t=b(e.target,g),n=b(e.target,_);(t&&this.contains(t)||n&&this.contains(n)||this._optionFrom(e.target,!0))&&e.preventDefault()},this._onMouseMove=e=>{let t=this._optionFrom(e.target);t&&t.id!==this._activeId&&(this._setKeyboard(!1),this._userChose=!0,this._setActive(t,!1))},this._onInput=e=>{this.hasAttribute(`filter`)&&e.target===this._input()&&(this._group=null,this._applyFilter(),this.refresh())}}connectedCallback(){this._teardown(),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`click`,this._onClick),this.addEventListener(`mousedown`,this._onMouseDown),this.addEventListener(`mousemove`,this._onMouseMove),this.addEventListener(`input`,this._onInput),this._modal=this.closest(`wui-modal`),this._modal?.addEventListener(`wui-modal-closed`,this._onModalClosed),this._readPath(),this.hasAttribute(`filter`)&&this._applyFilter(),this.refresh()}disconnectedCallback(){this._teardown()}attributeChangedCallback(e){this.isConnected&&(e===`path`&&this._readPath(),this.hasAttribute(`filter`)&&this._applyFilter(),this.refresh())}get filter(){return this.hasAttribute(`filter`)}set filter(e){this.toggleAttribute(`filter`,!!e)}get highlight(){return this.getAttribute(`highlight`)!==`false`}set highlight(e){this.setAttribute(`highlight`,e?`true`:`false`)}get emptyText(){return this.getAttribute(`empty-text`)??p().emptyText}set emptyText(e){this.setAttribute(`empty-text`,String(e??``))}refresh(){this._renderRecents(),this._renderCrumbs(),this._syncTabs();let e=this._input(),t=e?e.value:``,n=t!==this._lastQuery;this._lastQuery=t;let r=this._selectableOptions(),i=r.map(e=>e.id).join(`
|
|
2
2
|
`),a=i!==this._lastIds;this._lastIds=i;let o=!n&&(this._userChose||!a)?r.find(e=>e.id===this._activeId):null;o||(this._userChose=!1,this._setKeyboard(!1)),this._setActive(o??r[0]??null,n)}_input(){let e=this.querySelector(`[role="combobox"]`);return e instanceof HTMLInputElement?e:null}_optionFrom(e,t=!1){let n=b(e,f);return n&&this.contains(n)&&!this._isHidden(n)&&(t||!this._isDisabled(n))?n:null}_isDisabled(e){return e.getAttribute(`aria-disabled`)===`true`}_isHidden(e){return e.hidden!==!1||(b(e,`[role="group"]`)?.hidden??!1)!==!1}_selectableOptions(){return S(this,f,HTMLElement).filter(e=>!this._isHidden(e)&&!this._isDisabled(e))}_setActive(e,t){this._activeId=e?e.id:null;for(let t of S(this,f,HTMLElement))t.setAttribute(`aria-selected`,t===e?`true`:`false`);let n=this._input();n&&(e?n.setAttribute(`aria-activedescendant`,e.id):n.removeAttribute(`aria-activedescendant`)),e&&t&&e.scrollIntoView({block:`nearest`})}_move(e){let t=this._selectableOptions();if(!t.length)return;let n=t.findIndex(e=>e.id===this._activeId),r=n<0?e>0?0:t.length-1:(n+e+t.length)%t.length;this._userChose=!0,this._setKeyboard(!0),this._setActive(t[r]??null,!0)}_setKeyboard(e){this.toggleAttribute(`data-keyboard`,e)}_handleKeyDown(e){let t=this._input();if(t&&e.target===t){if(e.key===`ArrowDown`||e.key===`ArrowUp`)e.preventDefault(),this._move(e.key===`ArrowDown`?1:-1);else if(e.key===`Tab`&&this._groupActive()&&this._tabs().length)e.preventDefault(),this._cycleGroup(e.shiftKey?-1:1);else if(e.key===`Backspace`&&!e.isComposing&&this._path.length&&!t.value)e.preventDefault(),this._goTo(this._path.slice(0,-1));else if(e.key===`Enter`&&!e.isComposing){let t=this._selectableOptions().find(e=>e.id===this._activeId);if(!t)return;e.preventDefault(),this._select(t)}}}_select(e){this._remember(e),this.dispatchEvent(new CustomEvent(`wui-command-palette:select`,{bubbles:!0,cancelable:!0,detail:{key:e.dataset.key??null,groupKey:e.dataset.groupKey??null,id:e.id}}))&&(e.dataset.opens?this._open(e.dataset.opens):e.dataset.href&&this._navigate(e.dataset.href))}_open(e){let t=S(this,`.wui-cmd-page`,HTMLElement).find(t=>t.dataset.page===e);this._goTo([...this._path,{key:e,label:t?.dataset.label??e}])}_goTo(e){this._input()?.focus(),this.dispatchEvent(new CustomEvent(`wui-command-palette:navigate`,{bubbles:!0,cancelable:!0,detail:{path:e}}))&&(this._path=e,this._restart())}_tabs(){return S(this,_,HTMLElement)}_groupActive(){return this.hasAttribute(`group-filter`)&&this._path.length===0}_pickGroup(e){this._group=e,this._applyFilter(),this.refresh()}_cycleGroup(e){let t=this._tabs().map(e=>e.dataset.groupTab||null),n=Math.max(0,t.indexOf(this._group));this._pickGroup(t[(n+e+t.length)%t.length]??null)}_syncTabs(){if(!this.hasAttribute(`group-filter`))return;let e=x(this,`.wui-cmd-tabs`,HTMLElement);e&&(e.hidden=!this._groupActive());for(let e of this._tabs())e.setAttribute(`aria-selected`,String((e.dataset.groupTab||null)===this._group))}_restart(){this._group=null;let e=this._input();e&&(e.value=``),this.hasAttribute(`filter`)&&this._applyFilter(),this.refresh()}_reset(){this.hasAttribute(`path`)||(this._path=[],this._restart())}_readPath(){let e=this.getAttribute(`path`);if(e==null)return;let t=JSON.parse(e);this._path=Array.isArray(t)?t.filter(e=>e&&typeof e.key==`string`&&typeof e.label==`string`):[]}_renderCrumbs(){let e=x(this,`.wui-cmd-crumbs`,HTMLElement);if(!e)return;let t=this.getAttribute(`root-label`)??p().rootLabel,n=JSON.stringify([t,this._path]);if(e.hidden=this._path.length===0,n===this._crumbSig)return;this._crumbSig=n;let r=x(e,`.wui-cmd-trail`,HTMLElement);if(!r)return;let i=[t,...this._path.map(e=>e.label)];r.replaceChildren(...i.map((e,t)=>{let n=document.createElement(`li`),r=t===i.length-1,a=document.createElement(r?`span`:`button`);if(a.className=`wui-cmd-crumb`,a.textContent=e,r)a.setAttribute(`aria-current`,`page`);else{if(!(a instanceof HTMLButtonElement))throw Error(`breadcrumb button missing`);a.type=`button`,a.dataset.depth=String(t)}return n.append(a),n}))}_recentsHost(){return x(this,`.wui-cmd-recents`,HTMLElement)}_realOptions(){let e=this._recentsHost();return S(this,f,HTMLElement).filter(t=>!e?.contains(t))}_recentEntries(){let e=this.getAttribute(`recents-key`);if(!e)return[];let t;try{t=JSON.parse(globalThis.localStorage?.getItem(e)??`[]`)}catch{return[]}return Array.isArray(t)?t.filter(e=>e&&typeof e.g==`string`&&typeof e.k==`string`):[]}_recentsLimit(){let e=Number.parseInt(this.getAttribute(`recents-limit`)??``,10);return Number.isFinite(e)&&e>0?Math.min(e,h):m}_remember(e){let t=this.getAttribute(`recents-key`),{groupKey:n,key:r,opens:i}=e.dataset;if(!t||i||n==null||r==null)return;let a=[{g:n,k:r},...this._recentEntries().filter(e=>e.g!==n||e.k!==r)];try{globalThis.localStorage?.setItem(t,JSON.stringify(a.slice(0,this._recentsLimit())))}catch(e){if(!(e instanceof DOMException))throw e}}_renderRecents(){let e=this._recentsHost();if(!e)return;let t=this._input(),n=this._groupActive()?this._group:null,r=this._path.length===0&&!(t?.value??``).trim()?this._recentEntries().filter(e=>!n||e.g===n):[],i=this._realOptions(),a=[];for(let e of r){let t=i.find(t=>t.dataset.groupKey===e.g&&t.dataset.key===e.k);if(t&&!t.dataset.opens&&!this._isDisabled(t)&&a.push(t),a.length>=this._recentsLimit())break}if(!a.length){e.firstChild&&e.replaceChildren();return}let o=`${this._recentsId}-label`,s=document.createElement(`div`);s.className=`wui-cmd-group`,s.setAttribute(`role`,`group`),s.setAttribute(`aria-labelledby`,o);let c=document.createElement(`div`);c.className=`wui-cmd-group-label`,c.setAttribute(`role`,`presentation`),c.id=o,c.textContent=this.getAttribute(`recents-label`)??p().recentsLabel,s.append(c);for(let e of a){let t=e.cloneNode(!0);if(!(t instanceof HTMLElement))throw Error(`recent option copy is not an element`);t.id=`${this._recentsId}-${e.id}`,t.hidden=!1,t.removeAttribute(`aria-selected`),s.append(t)}e.replaceChildren(s)}_inScope(e,t){return!t||(b(e,`.wui-cmd-page`)?.dataset.page??null)===(this._path[this._path.length-1]?.key??null)}_navigate(e){window.location.assign(e)}_applyFilter(){let e=this._input(),t=(e?e.value:``).trim(),r=t.toLowerCase(),i=this.highlight,o=S(this,`.wui-cmd-page`,HTMLElement),s=o.length>0,c=this._path[this._path.length-1]?.key??null;for(let e of o)e.hidden=e.dataset.page!==c;let l=this._groupActive()?this._group:null,u=0;for(let e of this._realOptions()){let o=x(e,`.wui-cmd-item-label`,HTMLElement),c=e.dataset.label??o?.textContent??``,d=(e.dataset.keywords??``).split(/\s+/).filter(Boolean),f=!r||c.toLowerCase().includes(r)||d.some(e=>e.toLowerCase().includes(r)),p=this._inScope(e,s)&&(!l||e.dataset.groupKey===l)&&f;e.hidden=!p,p&&u++,o&&o.replaceChildren(...(0,a.matchSegments)(c,i?t:``).map(e=>e.match?(0,n.make)(`mark`,{class:`wui-cmd-mark`},e.text):e.text))}let d=this._recentsHost();for(let e of S(this,`[role="group"]`,HTMLElement))d?.contains(e)||(e.hidden=!S(e,f,HTMLElement).some(e=>!e.hidden));let p=x(this,`[role="listbox"]`,HTMLElement);p&&(p.hidden=u===0);let m=x(this,`.wui-cmd-empty`,HTMLElement);m&&(m.textContent=r&&u===0?this.emptyText:``)}_teardown(){this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`mousedown`,this._onMouseDown),this.removeEventListener(`mousemove`,this._onMouseMove),this.removeEventListener(`input`,this._onInput),this._modal?.removeEventListener(`wui-modal-closed`,this._onModalClosed),this._modal=null}};(0,t.defineElement)(`wui-command-palette`,C),e.WuiCommandPalette=C})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.dom,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.textStore,WeborityUiElementsInternal.modules.textMatch);
|