@webority/ui-elements 0.177.0 → 0.178.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/WuiInlineEdit-D7AuEv1R.js +1 -0
  2. package/dist/{WuiSavedViews-BKpnSd-Y.js → WuiSavedViews-BR6ZHd9Y.js} +1 -1
  3. package/dist/{WuiSelect-iUXaHKw5.js → WuiSelect-CNff3FNi.js} +1 -1
  4. package/dist/{chips-xXgAvIFy.js → chips-BdpsN50B.js} +1 -1
  5. package/dist/{drawerDiscard-z1PsI4cx.js → drawerDiscard-APy8TZxi.js} +1 -1
  6. package/dist/elements/inline-edit.js +1 -1
  7. package/dist/elements/saved-views.js +1 -1
  8. package/dist/elements/select.js +1 -1
  9. package/dist/{fileViewerPdf-Tb26qdtM.js → fileViewerPdf-BET_tiP6.js} +1 -1
  10. package/dist/inlineEdit.g-DLDVospu.js +1 -0
  11. package/dist/loader-A38-PdcB.js +1 -0
  12. package/dist/{search-Bhn-bjLL.js → search-Dl07KqWw.js} +1 -1
  13. package/dist/server.js +1 -1
  14. package/dist/text.js +1 -1
  15. package/dist/ui-elements/carousel.global.js +1 -1
  16. package/dist/ui-elements/code-block.global.js +1 -1
  17. package/dist/ui-elements/command-palette.global.js +1 -1
  18. package/dist/ui-elements/comment-thread.global.js +1 -1
  19. package/dist/ui-elements/consent-banner.global.js +1 -1
  20. package/dist/ui-elements/context-menu.global.js +1 -1
  21. package/dist/ui-elements/data-table.global.js +1 -0
  22. package/dist/ui-elements/date-range.global.js +1 -1
  23. package/dist/ui-elements/date-time.global.js +1 -1
  24. package/dist/ui-elements/datepicker.global.js +1 -1
  25. package/dist/ui-elements/dock.global.js +1 -0
  26. package/dist/ui-elements/drawer.global.js +1 -1
  27. package/dist/ui-elements/dropdown.global.js +1 -1
  28. package/dist/ui-elements/entry-grid.global.js +1 -1
  29. package/dist/ui-elements/gantt.global.js +1 -1
  30. package/dist/ui-elements/glyphs.global.js +1 -1
  31. package/dist/ui-elements/hover-card.global.js +1 -0
  32. package/dist/ui-elements/image-crop.global.js +1 -1
  33. package/dist/ui-elements/inline-edit.global.js +1 -1
  34. package/dist/ui-elements/kanban.global.js +1 -1
  35. package/dist/ui-elements/lead-popup.global.js +1 -1
  36. package/dist/ui-elements/lightbox.global.js +1 -1
  37. package/dist/ui-elements/markdown.global.js +1 -1
  38. package/dist/ui-elements/navigation-menu.global.js +1 -0
  39. package/dist/ui-elements/notification-center.global.js +1 -0
  40. package/dist/ui-elements/onboarding-checklist.global.js +1 -0
  41. package/dist/ui-elements/org-tree.global.js +1 -1
  42. package/dist/ui-elements/otp.global.js +1 -0
  43. package/dist/ui-elements/overflow.global.js +1 -0
  44. package/dist/ui-elements/phone.global.js +1 -1
  45. package/dist/ui-elements/popover.global.js +1 -1
  46. package/dist/ui-elements/rating.global.js +1 -0
  47. package/dist/ui-elements/record-pager.global.js +1 -0
  48. package/dist/ui-elements/relative-time.global.js +1 -0
  49. package/dist/ui-elements/saved-views.global.js +1 -1
  50. package/dist/ui-elements/select-chips.global.js +1 -1
  51. package/dist/ui-elements/select-recents.global.js +1 -1
  52. package/dist/ui-elements/select-search.global.js +1 -1
  53. package/dist/ui-elements/select-window.global.js +1 -1
  54. package/dist/ui-elements/shortcuts.global.js +1 -0
  55. package/dist/ui-elements/show-more.global.js +1 -0
  56. package/dist/ui-elements/slider.global.js +1 -1
  57. package/dist/ui-elements/sortable.global.js +1 -1
  58. package/dist/ui-elements/status-icon.global.js +1 -1
  59. package/dist/ui-elements/table-export.global.js +1 -1
  60. package/dist/ui-elements/timepicker.global.js +1 -1
  61. package/dist/ui-elements/tour.global.js +1 -1
  62. package/dist/ui-elements/tree-picker.global.js +1 -1
  63. package/dist/ui-elements/tree.global.js +1 -1
  64. package/dist/ui-elements/truncate.global.js +1 -0
  65. package/dist/ui-elements/whats-new.global.js +1 -0
  66. package/dist/ui-elements/wizard.global.js +1 -1
  67. package/dist/ui-elements.global.js +1 -1
  68. package/dist/ui-elements.js +1 -1
  69. package/dist/ui-file-viewer.global.js +1 -1
  70. package/dist/ui-file-viewer.js +1 -1
  71. package/package.json +5 -5
  72. package/types/WuiInlineEdit.d.ts +10 -0
  73. package/types/global/core.d.ts +1 -17
  74. package/types/global/shared.d.ts +6 -0
  75. package/types/razor-js/modules/lazyModules.d.ts +22 -0
  76. package/types/razor-js/modules/themeCopy.d.ts +1 -0
  77. package/types/razor-js/webority-ui.d.ts +2 -2
  78. package/dist/WuiInlineEdit-p0cm_i90.js +0 -1
  79. package/dist/inlineEdit.g-ZxRNYq0t.js +0 -1
  80. package/dist/loader-DvNLnnaO.js +0 -1
@@ -0,0 +1 @@
1
+ var e={emptyTitle:`Nothing here yet`,errorTitle:`That didn't load`,loadingLabel:`Loading`,retryLabel:`Try again`},t={clientMessage:`This could not be saved. Refresh the page and try again.`,editText:`Edit {label}: `,forbiddenMessage:`You do not have permission to change this.`,networkMessage:`Could not reach the server, so this was not saved. Check your connection and try again.`,notSavedText:`{label} was not saved. {reason}`,readOnlyText:`{label}: `,savedText:`{label} saved.`,serverMessage:`Something went wrong on our side, so this was not saved. Try again in a moment.`,validationMessage:`This value was not accepted. Check it and try again.`};export{e as n,t};
@@ -0,0 +1 @@
1
+ var e=Object.freeze({carousel:{entries:[`elements/carousel.ts`],tags:[`wui-carousel`]},"data-table":{entries:[`elements/data-table.ts`],tags:[`wui-data-table`]},dock:{entries:[`elements/dock.ts`],tags:[`wui-dock`]},"hover-card":{entries:[`elements/hover-card.ts`],tags:[`wui-hover-card`]},"navigation-menu":{entries:[`elements/navigation-menu.ts`],tags:[`wui-navigation-menu`]},"notification-center":{entries:[`elements/notification-center.ts`],tags:[`wui-notification-center`]},"onboarding-checklist":{entries:[`elements/onboarding-checklist.ts`],tags:[`wui-onboarding-checklist`]},otp:{entries:[`elements/otp.ts`],tags:[`wui-otp`]},overflow:{entries:[`elements/overflow.ts`],tags:[`wui-overflow`]},rating:{entries:[`elements/rating.ts`],tags:[`wui-rating`]},"record-pager":{entries:[`elements/record-pager.ts`],tags:[`wui-record-pager`]},"relative-time":{entries:[`elements/relative-time.ts`],tags:[`wui-relative-time`]},shortcuts:{entries:[`elements/shortcuts.ts`],tags:[`wui-shortcuts`]},"show-more":{entries:[`elements/show-more.ts`],tags:[`wui-show-more`]},truncate:{entries:[`elements/truncate.ts`],tags:[`wui-truncate`]},"whats-new":{entries:[`elements/whats-new.ts`],tags:[`wui-whats-new`]},"code-block":{entries:[`elements/code-block.ts`],tags:[`wui-code-block`]},"command-palette":{entries:[`elements/command-palette.ts`],tags:[`wui-command-palette`]},"comment-thread":{entries:[`elements/comment-thread.ts`],tags:[`wui-mention-input`,`wui-comment-thread`]},"consent-banner":{entries:[`elements/consent-banner.ts`],tags:[`wui-consent-banner`]},"context-menu":{entries:[`elements/context-menu.ts`],tags:[`wui-context-menu`]},"date-range":{entries:[`elements/date-range.ts`],tags:[`wui-date-range`]},"date-time":{entries:[`elements/date-time.ts`],tags:[`wui-date-time`]},datepicker:{entries:[`elements/datepicker.ts`],tags:[`wui-datepicker`]},drawer:{entries:[`elements/drawer.ts`],tags:[`wui-drawer`]},dropdown:{entries:[`elements/dropdown.ts`],tags:[`wui-dropdown`]},"entry-grid":{entries:[`elements/entry-grid.ts`],tags:[`wui-entry-grid`]},gantt:{entries:[`elements/gantt.ts`],tags:[`wui-gantt`]},"image-crop":{entries:[`elements/image-crop.ts`],tags:[`wui-image-crop`]},"inline-edit":{entries:[`elements/inline-edit.ts`],tags:[`wui-inline-edit`]},kanban:{entries:[`elements/kanban.ts`],tags:[`wui-kanban`]},"lead-popup":{entries:[`elements/lead-popup.ts`],tags:[`wui-lead-popup`]},lightbox:{entries:[`elements/lightbox.ts`],tags:[`wui-lightbox`]},"org-tree":{entries:[`elements/org-tree.ts`],tags:[`wui-org-tree`]},markdown:{entries:[`elements/markdown.ts`],tags:[`wui-markdown`]},phone:{entries:[`elements/phone.ts`,`global/parts/select-country.ts`],tags:[`wui-phone`]},popover:{entries:[`elements/popover.ts`],tags:[`wui-popover`]},"saved-views":{entries:[`elements/saved-views.ts`],tags:[`wui-saved-views`]},glyphs:{entries:[`global/parts/glyphs.ts`],tags:[]},"select-chips":{entries:[`global/parts/select-chips.ts`],tags:[]},"select-recents":{entries:[`global/parts/select-recents.ts`],tags:[]},"select-search":{entries:[`global/parts/select-search.ts`],tags:[]},"select-window":{entries:[`global/parts/select-window.ts`],tags:[]},"table-export":{entries:[`global/parts/table-export.ts`],tags:[]},slider:{entries:[`elements/slider.ts`],tags:[`wui-slider`]},sortable:{entries:[`elements/sortable.ts`],tags:[`wui-sortable`]},"status-icon":{entries:[`elements/status-icon.ts`],tags:[`wui-status-icon`]},timepicker:{entries:[`elements/timepicker.ts`],tags:[`wui-timepicker`]},tour:{entries:[`elements/tour.ts`],tags:[`wui-tour`]},tree:{entries:[`elements/tree.ts`],tags:[`wui-tree`]},"tree-picker":{entries:[`elements/tree-picker.ts`],tags:[`wui-tree-picker`]},wizard:{entries:[`elements/wizard.ts`],tags:[`wui-wizard-step`,`wui-wizard`]},chart:{file:`ui-chart.global.js`,tags:[`wui-chart`],selfContained:!0},calendar:{file:`ui-calendar.global.js`,tags:[`wui-calendar`],selfContained:!0},"rich-text":{file:`ui-rich-text.global.js`,tags:[`wui-rich-text`],selfContained:!0},"file-viewer":{file:`ui-file-viewer.global.js`,tags:[`wui-file-viewer`],selfContained:!0}});Object.freeze({anchorOverlay:`anchorOverlay.ts`,avatarNode:`avatarNode.ts`,buttonClass:`buttonClass.ts`,calendarMath:`calendarMath.ts`,copyText:`copyText.ts`,dataTable:`dataTable.ts`,datePickerText:`text/web/datePicker.g.ts`,defineElement:`defineElement.ts`,devWarn:`devWarn.ts`,dom:`dom.ts`,drawerText:`text/web/drawer.g.ts`,elementBase:`elementBase.ts`,fieldState:`fieldState.ts`,formatters:`formatters.ts`,formMirror:`formMirror.ts`,glyphs:`global/glyphs.ts`,hasOwn:`hasOwn.ts`,httpFailureText:`text/web/httpFailure.g.ts`,iconGlyphs:`iconGlyphs.g.ts`,imeSafeEnter:`imeSafeEnter.ts`,isDrawn:`isDrawn.ts`,listboxKeyNav:`listboxKeyNav.ts`,loader:`global/loader.ts`,mentionText:`mentionText.ts`,menuKeyNav:`menuKeyNav.ts`,nativeOverlay:`nativeOverlay.ts`,notificationCentreText:`text/web/notificationCentre.g.ts`,notificationDays:`notificationDays.ts`,optionLabel:`optionLabel.ts`,partRegistry:`select/partRegistry.ts`,relativeTime:`relativeTime.ts`,rtl:`rtl.ts`,selectList:`select/list.ts`,selectRemote:`select/remote.ts`,selectText:`text/web/select.g.ts`,selectWindow:`select/window.ts`,serverHtml:`server/serverHtml.ts`,shortcutKeys:`shortcutKeys.ts`,stepperHeader:`stepperHeader.ts`,svgNodes:`svgNodes.ts`,tableExport:`global/tableExport.ts`,tableSelect:`tableSelect.ts`,textMatch:`textMatch.ts`,textStore:`text/textStore.ts`,tooltips:`tooltips.ts`,wuiHttp:`server/wuiHttp.ts`,WuiSelect:`WuiSelect.ts`,zone:`zone.ts`});var t=`wui-elements:defined`,n=`wui-elements:load-error`,r=/* @__PURE__ */ new Map;for(let[t,n]of Object.entries(e))for(let e of n.tags)r.set(e,t);[...r.keys()].join(`,`);export{n,t};
@@ -1 +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-B5d1s59A.js";import{t as i}from"./customRule-BpwcjVLb.js";import{n as a}from"./WuiSelect-iUXaHKw5.js";var o=()=>n(`select`,r),s=(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)},c=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 l(){let t,n,r=0,l,u=null,d=null,f=``,p=null,m=!1,h=()=>a(t),g=()=>typeof t.loadOptions!=`function`&&!t.getAttribute(`source`),_=(e,n,r)=>{let i=t.getAttribute(e);if(i==null||i.trim()===``)return n;let a=Number(i);return r(a)?a:n},v=()=>_(`min-chars`,1,e=>Number.isInteger(e)&&e>=0),y=()=>_(`debounce`,250,e=>Number.isFinite(e)&&e>=0),b=()=>{u?.abort(),u=null};function x(e,n){if(typeof t.loadOptions==`function`)return t.loadOptions(e,{signal:n});let r=t.getAttribute(`source`);if(r===null)throw Error(`search source attribute missing`);let i=`${r}${r.includes(`?`)?`&`:`?`}q=${encodeURIComponent(e)}`;return fetch(i,{signal:n,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 S(n,r,i){r?(e(`wui-select: search failed`,i),t.setPartOptions([]),t.setStatus(`empty`)):(t.setPartOptions(n),t.setStatus(n.length?`idle`:`empty`))}async function C(e,t,n){let i=[],a=!1,o=null;try{if(i=await x(e,n),!Array.isArray(i))throw TypeError(`search results must be an array`)}catch(e){a=!0,o=e??/* @__PURE__ */ Error(`search failed`)}finally{t===r&&(u=null,S(i,a,o))}}function w(e){let n=r;b(),g()?(m=!0,t.setStatus(`loading`)):(u=new AbortController,t.setStatus(`loading`),C(e,n,u.signal))}let T=(e,n)=>t.dispatchEvent(new CustomEvent(`search`,{bubbles:!0,detail:{query:e,seq:n}}));function E(e){r+=1,b(),clearTimeout(l),l=void 0,e.trim().length<v()?(t.setPartOptions([]),t.setStatus(`hint`)):(T(e,r),w(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,b(),clearTimeout(l),l=void 0,f=e,p=null,m=!1,!h())return!1;if(e.trim().length<v())return t.setPartOptions([]),t.setStatus(`hint`),!0;let n=r;return l=setTimeout(()=>{l=void 0,T(e,n),w(e)},y()),!0},onOpen(){if(h()){if(p!==null){let e=p;p=null,E(e)}else v()===0&&t._query.trim()===``&&E(``)}},onOptions(){m&&(m=!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`)&&!s(t,e)){let n=i(t,e);return n?(t.setError(n),!1):(t.commit(e,{isCustom:!0}),!0)}let r=c(n.list);return r===null||r===String(t.value)?!1:(t.commit(r,{isCustom:!1}),t.closeMenu(),!0)},actionRow(e){if(d=null,t.mode!==`search`||!t.hasAttribute(`allow-custom`))return null;let n=e.trim();return!n||s(t,n)?null:(d={position:`bottom`,label:(t.getAttribute(`add-label`)??o().addLabel).replaceAll(`{query}`,n),value:n},d)},onPick(e){if(!d||e.value!==d.value||e.label!==d.label)return!1;let n=d.value;return d=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(){(l!==void 0||u!==null||m)&&(p=f),m=!1,r+=1,clearTimeout(l),l=void 0,b(),d=null}}}export{l as default};
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-B5d1s59A.js";import{t as i}from"./customRule-BpwcjVLb.js";import{n as a}from"./WuiSelect-CNff3FNi.js";var o=()=>n(`select`,r),s=(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)},c=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 l(){let t,n,r=0,l,u=null,d=null,f=``,p=null,m=!1,h=()=>a(t),g=()=>typeof t.loadOptions!=`function`&&!t.getAttribute(`source`),_=(e,n,r)=>{let i=t.getAttribute(e);if(i==null||i.trim()===``)return n;let a=Number(i);return r(a)?a:n},v=()=>_(`min-chars`,1,e=>Number.isInteger(e)&&e>=0),y=()=>_(`debounce`,250,e=>Number.isFinite(e)&&e>=0),b=()=>{u?.abort(),u=null};function x(e,n){if(typeof t.loadOptions==`function`)return t.loadOptions(e,{signal:n});let r=t.getAttribute(`source`);if(r===null)throw Error(`search source attribute missing`);let i=`${r}${r.includes(`?`)?`&`:`?`}q=${encodeURIComponent(e)}`;return fetch(i,{signal:n,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 S(n,r,i){r?(e(`wui-select: search failed`,i),t.setPartOptions([]),t.setStatus(`empty`)):(t.setPartOptions(n),t.setStatus(n.length?`idle`:`empty`))}async function C(e,t,n){let i=[],a=!1,o=null;try{if(i=await x(e,n),!Array.isArray(i))throw TypeError(`search results must be an array`)}catch(e){a=!0,o=e??/* @__PURE__ */ Error(`search failed`)}finally{t===r&&(u=null,S(i,a,o))}}function w(e){let n=r;b(),g()?(m=!0,t.setStatus(`loading`)):(u=new AbortController,t.setStatus(`loading`),C(e,n,u.signal))}let T=(e,n)=>t.dispatchEvent(new CustomEvent(`search`,{bubbles:!0,detail:{query:e,seq:n}}));function E(e){r+=1,b(),clearTimeout(l),l=void 0,e.trim().length<v()?(t.setPartOptions([]),t.setStatus(`hint`)):(T(e,r),w(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,b(),clearTimeout(l),l=void 0,f=e,p=null,m=!1,!h())return!1;if(e.trim().length<v())return t.setPartOptions([]),t.setStatus(`hint`),!0;let n=r;return l=setTimeout(()=>{l=void 0,T(e,n),w(e)},y()),!0},onOpen(){if(h()){if(p!==null){let e=p;p=null,E(e)}else v()===0&&t._query.trim()===``&&E(``)}},onOptions(){m&&(m=!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`)&&!s(t,e)){let n=i(t,e);return n?(t.setError(n),!1):(t.commit(e,{isCustom:!0}),!0)}let r=c(n.list);return r===null||r===String(t.value)?!1:(t.commit(r,{isCustom:!1}),t.closeMenu(),!0)},actionRow(e){if(d=null,t.mode!==`search`||!t.hasAttribute(`allow-custom`))return null;let n=e.trim();return!n||s(t,n)?null:(d={position:`bottom`,label:(t.getAttribute(`add-label`)??o().addLabel).replaceAll(`{query}`,n),value:n},d)},onPick(e){if(!d||e.value!==d.value||e.label!==d.label)return!1;let n=d.value;return d=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(){(l!==void 0||u!==null||m)&&(p=f),m=!1,r+=1,clearTimeout(l),l=void 0,b(),d=null}}}export{l as default};
package/dist/server.js CHANGED
@@ -1 +1 @@
1
- import{S as e,_ as t,a as n,b as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y,x as b,y as x}from"./drawerDiscard-z1PsI4cx.js";import{t as S}from"./serverHtml-BC6tAyAl.js";import{i as C}from"./dom-DMQu--xV.js";import{n as w}from"./imeSafeEnter-DeO_3lXy.js";import{s as T}from"./nativeOverlay-BHD2QV02.js";import{r as E}from"./textStore-DBplASiZ.js";import{t as D}from"./shell.g-C2Ht5xl2.js";import{a as O,c as k,d as A,f as j,g as ee,h as te,i as M,l as N,m as P,n as ne,o as re,p as ie,s as F,t as I,u as L}from"./wuiHttp-Cw7V8u2w.js";var R=()=>E(`shell`,D),z=31536e3,B=/* @__PURE__ */ new WeakMap;function ae(e,t,n,r){let i=[...e.querySelectorAll(`nav.wui-tabbar a.wui-tabbar-item`)].find(e=>e.getAttribute(`href`)===t);if(!i)throw Error(`setTabCount: no tab bar item links to ${t}.`);let a=i.querySelector(`:scope > .wui-tabbar-badge`);if(n===null||n===0){a?.remove();return}a||(a=document.createElement(`span`),i.append(a)),a.className=`wui-tabbar-badge${r?` tone-${r}`:``}`;let o=e.querySelector(`nav.wui-tabbar`)?.hasAttribute(`data-wui-cap-badges`)===!0;a.textContent=o?V(n):String(n)}var V=e=>e>99?`99+`:String(e),H=(e,t)=>Object.entries(t).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,()=>String(n)),e);function U(e,t,n=document){try{n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${z}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}function W(e,t,n,r=document){try{let i=`${e}=`,a=r.cookie.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(i)),o=new Set(a?a.slice(i.length).split(`.`).filter(Boolean):[]);n?o.add(t):o.delete(t),r.cookie=`${e}=${[...o].join(`.`)}; Path=/; Max-Age=${z}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}var G=(e,t,n)=>{let r=e?.querySelector(t);return r instanceof n?r:null},K=(e,t,n)=>{let r=e?.closest(t);return r instanceof n?r:null},q=(e,t,n)=>e?[...e.querySelectorAll(t)].filter(e=>e instanceof n):[],J=e=>{if(!(e.target instanceof Element))throw Error(`event target is not an element`);return e.target},Y=e=>{let t=e.getAttribute(`href`);if(t===null)throw Error(`search hit has no href`);return t},X=(e,t)=>{let n=document.createElement(`div`);return n.className=e,n.textContent=t,n};function oe(e,t){let n=G(e,`.wui-bell-trigger`,HTMLElement),r=G(e,`.wui-bell-count`,HTMLElement),i=G(e,`[data-wui-bell-live]`,HTMLElement),a=G(e,`[data-wui-bell-list]`,HTMLElement),o=()=>C(a,`bell list missing`),s=G(e,`.wui-bell-menu`,HTMLElement),{src:c,readAction:l}=e.dataset,u=e.dataset.label||R().label,d=e.dataset.emptyText||R().emptyText,f=e.dataset.loadingText??R().loadingNotificationsText,p=e.dataset.noUnreadText??R().noUnreadText,m=e.dataset.unreadText??R().unreadNotificationsText,h=e.dataset.bellLabel??R().unreadBellLabel,g=Number(e.dataset.pollSeconds??60),_=N(),v=Number(e.dataset.unread)||0,y=(t,a=!0)=>{let o=Math.max(0,Number(t)||0),s=o!==v;v=o,e.dataset.unread=String(o),r&&(r.textContent=V(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?u:H(h,{label:u,count:V(o)})),a&&s&&i&&(i.textContent=o===0?p:H(m,{count:V(o)}))},b=()=>s?T(s):!1,x=()=>{let e=X(`wui-bell-state`,`${R().notificationsLoadErrorMessage} `),t=document.createElement(`button`);t.type=`button`,t.className=`btn btn-link btn-sm`,t.dataset.wuiBellRetry=``,t.textContent=R().retryLabel,e.append(t),o().replaceChildren(e)},w=async t=>{if(t&&(o().setAttribute(`aria-busy`,`true`),o().querySelector(`.wui-bell-item`)||o().replaceChildren(X(`wui-bell-state`,f))),c===void 0)throw Error(`bell has no data-src`);let n=await _.run(c);if(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)return;if(o().removeAttribute(`aria-busy`),!n.ok){t&&x();return}let r=S(n.html),i=G(r,`[data-wui-unread]`,HTMLElement),a=i?Number(i.getAttribute(`data-wui-unread`)):v;y(a),(t||b())&&(r.querySelector(`.wui-bell-item`)?o().replaceChildren(r):o().replaceChildren(X(`wui-bell-state`,d))),e.dispatchEvent(new CustomEvent(`wui:notifications:loaded`,{bubbles:!0,detail:{unread:a}}))};s?.addEventListener(`beforetoggle`,e=>{`newState`in e&&e.newState===`open`&&w(!0)}),e.addEventListener(`click`,async e=>{let t=J(e);if(t.closest(`[data-wui-bell-retry]`)){await w(!0);return}let n=K(t,`[data-wui-bell-read]`,HTMLButtonElement);if(!n||!l)return;n.disabled=!0;let r=await P(l,{method:`POST`});n.disabled=!1,r.ok&&(y(0),await w(!0))});let E=null,D=()=>{g>0&&E===null&&(E=setInterval(()=>w(b()),g*1e3))},O=()=>{E!==null&&clearInterval(E),E=null},k=()=>{document.hidden?O():(w(b()),D())};return g>0&&(document.addEventListener(`visibilitychange`,k),document.hidden||D()),t.push(()=>{O(),_.abort(),document.removeEventListener(`visibilitychange`,k)}),{setUnread:e=>y(e),refresh:()=>w(b())}}var se=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Z=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function ce(e,t){let n=C(G(e,`input.search-input`,HTMLInputElement),`search input missing`),r=G(e,`.wui-topsearch-results`,HTMLElement),i=()=>C(r,`search results missing`),a=G(e,`.wui-topsearch-open`,HTMLElement),o=G(e,`[data-wui-topsearch-live]`,HTMLElement),{src:s,param:c=`q`,resultsHref:l}=e.dataset,u=Number(e.dataset.minChars??2),d=Number(e.dataset.debounceMs??250),f=e.dataset.noResultsText??R().noResultsText,p=e.dataset.resultsCountText??R().resultsCountText,m=e.dataset.resultCountText??R().resultCountText,h=N(),g,_=-1,v=()=>q(i(),`.wui-topsearch-hit`,HTMLElement),y=e=>{let t=v();_=t.length===0?-1:(e+t.length)%t.length,t.forEach((e,t)=>{let n=t===_;e.classList.toggle(`is-active`,n),e.setAttribute(`aria-selected`,n?`true`:`false`)});let r=_>=0?t[_]:void 0;r?(n.setAttribute(`aria-activedescendant`,r.id),r.scrollIntoView?.({block:`nearest`})):n.removeAttribute(`aria-activedescendant`)},b=()=>{i().hidden=!0,n.setAttribute(`aria-expanded`,`false`),n.removeAttribute(`aria-activedescendant`),_=-1},x=()=>{i().hidden=!1,n.setAttribute(`aria-expanded`,`true`)},T=t=>{e.classList.toggle(`is-open`,t),a?.setAttribute(`aria-expanded`,t?`true`:`false`)},E=t=>{let n=new CustomEvent(`wui:search:select`,{bubbles:!0,cancelable:!0,detail:{href:t}});e.dispatchEvent(n)&&window.location.assign(t)},D=async t=>{if(e.classList.add(`is-loading`),s===void 0)throw Error(`search has no data-src`);let n=await h.run(Z(s,c,t));if(n.kind!==`aborted`&&n.kind!==`stale`&&n.kind!==`session`){if(e.classList.remove(`is-loading`),n.ok){let e=S(n.html),t=G(e,`[data-wui-count]`,HTMLElement);i().replaceChildren(e),v().forEach((e,t)=>{e.id=`${i().id}-opt-${t}`});let r=t?Number(t.getAttribute(`data-wui-count`)):v().length;o&&(o.textContent=r===0?f:H(r===1?m:p,{count:r}))}else i().replaceChildren(X(`wui-topsearch-empty`,R().searchUnavailableMessage));_=-1,x()}};n.addEventListener(`input`,()=>{clearTimeout(g);let t=n.value.trim();t.length<u?(h.abort(),e.classList.remove(`is-loading`),i().replaceChildren(),b()):g=setTimeout(()=>D(t),d)}),n.addEventListener(`keydown`,t=>{if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(i().hidden||v().length===0)return;t.preventDefault(),y(_+(t.key===`ArrowDown`?1:-1))}else if(w(t)){let e=v(),r=_>=0?e[_]:void 0;!i().hidden&&r?(t.preventDefault(),E(Y(r))):l&&n.value.trim()!==``&&(t.preventDefault(),E(Z(l,c,n.value.trim())))}else t.key===`Escape`&&(i().hidden?e.classList.contains(`is-open`)&&(t.preventDefault(),t.stopPropagation(),T(!1),a?.focus()):(t.preventDefault(),t.stopPropagation(),b()))}),i().addEventListener(`click`,e=>{let t=K(J(e),`.wui-topsearch-hit`,HTMLElement);!t||e.ctrlKey||e.metaKey||e.shiftKey||e.button===1||(e.preventDefault(),E(Y(t)))}),a?.addEventListener(`click`,()=>{let t=!e.classList.contains(`is-open`);T(t),t&&n.focus()});let O=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||se(e.target)||(e.preventDefault(),T(!0),n.focus())},k=t=>{t.target instanceof Node&&e.contains(t.target)||(b(),e.classList.contains(`is-open`)&&T(!1))};document.addEventListener(`keydown`,O),document.addEventListener(`pointerdown`,k),t.push(()=>{clearTimeout(g),h.abort(),document.removeEventListener(`keydown`,O),document.removeEventListener(`pointerdown`,k)})}function le(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>{U(n,!!e.detail?.collapsed)});let r=e.dataset.wuiFoldedCookie;r&&e.addEventListener(`wui:shell:nav-fold`,e=>{W(r,e.detail?.key,!!e.detail?.folded)}),e.addEventListener(`click`,t=>{J(t).closest(`[data-wui-tabbar-more]`)&&G(e,`[data-app-shell-menu]`,HTMLElement)?.click()});let i=G(e,`[data-wui-bell]`,HTMLElement),a=i?oe(i,t):null,o=G(e,`[data-wui-topsearch]`,HTMLElement);o&&ce(o,t);let s={el:e,setUnread(e){C(a,`WUI.shell: this <app-shell> has no <app-shell-notifications>.`).setUnread(e)},setTabCount(t,n,r){ae(e,t,n,r)},refreshNotifications(){return C(a,`WUI.shell: this <app-shell> has no <app-shell-notifications>.`).refresh()},get collapsed(){return e.classList.contains(`collapsed`)},set collapsed(t){if(!!t===e.classList.contains(`collapsed`))return;let n=G(e,`[data-app-shell-collapse]`,HTMLElement);n?n.click():e.classList.toggle(`collapsed`,!!t)}};B.set(e,s);let c=n=>{if(n.target===e||n.target instanceof Node&&n.target.contains(e)){for(let e of t)e();B.delete(e),delete e.dataset.wuiPartsWired,document.removeEventListener(`wui:teardown`,c)}};return document.addEventListener(`wui:teardown`,c),s}function Q(e=document){let t=[];e instanceof HTMLElement&&e.matches(`[data-app-shell]`)&&t.push(e),t.push(...q(e,`[data-app-shell]`,HTMLElement));for(let e of t)e.dataset.wuiPartsWired||(e.dataset.wuiPartsWired=`1`,le(e))}function $(e){let t=K(e,`[data-app-shell]`,HTMLElement);return t?(B.has(t)||Q(t),B.get(t)??null):null}var ue=/* @__PURE__ */ new Set([204,205,304]),de=e=>{let t=new Headers;for(let n of e.split(/\r?\n/)){let e=n.indexOf(`:`);e>0&&t.append(n.slice(0,e).trim(),n.slice(e+1).trim())}return t};async function fe(e,t,n={}){if(!(t instanceof FormData))throw TypeError(`wuiUpload: body must be FormData`);let r=n.timeoutMs;if(r!==void 0&&!(Number.isFinite(r)&&r>0))throw TypeError(`wuiUpload: timeoutMs must be a positive number`);let i={Accept:`text/html`,"X-Requested-With":`XMLHttpRequest`,[re]:`1`,...n.headers};if(L(e)){let e=A();e&&(i[e.header]=e.token)}let a=n.signal;return a?.aborted?j(`aborted`):new Promise(o=>{let s=new XMLHttpRequest,c=!1,l,u=()=>s.abort(),d=(e,t=null,n=``)=>{l!==void 0&&clearTimeout(l),a?.removeEventListener(`abort`,u),o(j(e,t,n))};s.upload.onprogress=e=>{n.onProgress?.(e.loaded,e.lengthComputable?e.total:0)},s.onload=()=>{let e=s.status;if(e===0){d(`network`);return}let t=de(s.getAllResponseHeaders()),n=F(e,t),r=s.responseText,i=n===`ok`||n===`validation`?r:``;if(e<200||e>599){d(n,null,i);return}let a=new Response(ue.has(e)?null:r,{status:e,headers:t});d(n,a,i)},s.onerror=()=>d(`network`),s.onabort=()=>{d(a?.aborted?`aborted`:c?`timeout`:`aborted`)},r!==void 0&&(l=setTimeout(()=>{c=!0,s.abort()},r)),a?.addEventListener(`abort`,u,{once:!0}),s.open(`POST`,e,!0);for(let[e,t]of Object.entries(i))s.setRequestHeader(e,t);s.send(t)})}export{g as CONFIRM_DIALOG_ID,i as CONFIRM_TONES,I as CSRF_META_NAME,ne as DEFAULT_CSRF_HEADER,_ as DISCARD_EVENT,u as FLASH_STORAGE_KEY,v as FLASH_VARIANTS,M as HTTP_KINDS,te as TOAST_ACTION_METHODS,y as TOAST_ACTION_MS,O as WUI_HEADERS,F as classifyStatus,m as closeRemotePane,k as configureCsrf,a as confirmAction,f as createDiscardPrompt,N as createRequestQueue,l as formValues,b as getServerTable,$ as getShell,h as initDrawerDiscard,d as initRemoteModals,o as initServerActions,e as initServerTables,Q as initShellParts,n as initUnsavedChanges,c as loadRemoteDrawer,s as loadRemoteModal,t as loadRemotePane,S as parseServerHtml,ee as parseToastAction,A as readCsrf,p as resetUnsavedChanges,x as runToastAction,r as showResultToast,ie as timeoutFromAttribute,P as wuiFetch,fe as wuiUpload};
1
+ import{S as e,_ as t,a as n,b as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y,x as b,y as x}from"./drawerDiscard-APy8TZxi.js";import{t as S}from"./serverHtml-BC6tAyAl.js";import{i as C}from"./dom-DMQu--xV.js";import{n as w}from"./imeSafeEnter-DeO_3lXy.js";import{s as T}from"./nativeOverlay-BHD2QV02.js";import{r as E}from"./textStore-DBplASiZ.js";import{t as D}from"./shell.g-C2Ht5xl2.js";import{a as O,c as k,d as A,f as j,g as ee,h as te,i as M,l as N,m as P,n as ne,o as re,p as ie,s as F,t as I,u as L}from"./wuiHttp-Cw7V8u2w.js";var R=()=>E(`shell`,D),z=31536e3,B=/* @__PURE__ */ new WeakMap;function ae(e,t,n,r){let i=[...e.querySelectorAll(`nav.wui-tabbar a.wui-tabbar-item`)].find(e=>e.getAttribute(`href`)===t);if(!i)throw Error(`setTabCount: no tab bar item links to ${t}.`);let a=i.querySelector(`:scope > .wui-tabbar-badge`);if(n===null||n===0){a?.remove();return}a||(a=document.createElement(`span`),i.append(a)),a.className=`wui-tabbar-badge${r?` tone-${r}`:``}`;let o=e.querySelector(`nav.wui-tabbar`)?.hasAttribute(`data-wui-cap-badges`)===!0;a.textContent=o?V(n):String(n)}var V=e=>e>99?`99+`:String(e),H=(e,t)=>Object.entries(t).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,()=>String(n)),e);function U(e,t,n=document){try{n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${z}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}function W(e,t,n,r=document){try{let i=`${e}=`,a=r.cookie.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(i)),o=new Set(a?a.slice(i.length).split(`.`).filter(Boolean):[]);n?o.add(t):o.delete(t),r.cookie=`${e}=${[...o].join(`.`)}; Path=/; Max-Age=${z}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}var G=(e,t,n)=>{let r=e?.querySelector(t);return r instanceof n?r:null},K=(e,t,n)=>{let r=e?.closest(t);return r instanceof n?r:null},q=(e,t,n)=>e?[...e.querySelectorAll(t)].filter(e=>e instanceof n):[],J=e=>{if(!(e.target instanceof Element))throw Error(`event target is not an element`);return e.target},Y=e=>{let t=e.getAttribute(`href`);if(t===null)throw Error(`search hit has no href`);return t},X=(e,t)=>{let n=document.createElement(`div`);return n.className=e,n.textContent=t,n};function oe(e,t){let n=G(e,`.wui-bell-trigger`,HTMLElement),r=G(e,`.wui-bell-count`,HTMLElement),i=G(e,`[data-wui-bell-live]`,HTMLElement),a=G(e,`[data-wui-bell-list]`,HTMLElement),o=()=>C(a,`bell list missing`),s=G(e,`.wui-bell-menu`,HTMLElement),{src:c,readAction:l}=e.dataset,u=e.dataset.label||R().label,d=e.dataset.emptyText||R().emptyText,f=e.dataset.loadingText??R().loadingNotificationsText,p=e.dataset.noUnreadText??R().noUnreadText,m=e.dataset.unreadText??R().unreadNotificationsText,h=e.dataset.bellLabel??R().unreadBellLabel,g=Number(e.dataset.pollSeconds??60),_=N(),v=Number(e.dataset.unread)||0,y=(t,a=!0)=>{let o=Math.max(0,Number(t)||0),s=o!==v;v=o,e.dataset.unread=String(o),r&&(r.textContent=V(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?u:H(h,{label:u,count:V(o)})),a&&s&&i&&(i.textContent=o===0?p:H(m,{count:V(o)}))},b=()=>s?T(s):!1,x=()=>{let e=X(`wui-bell-state`,`${R().notificationsLoadErrorMessage} `),t=document.createElement(`button`);t.type=`button`,t.className=`btn btn-link btn-sm`,t.dataset.wuiBellRetry=``,t.textContent=R().retryLabel,e.append(t),o().replaceChildren(e)},w=async t=>{if(t&&(o().setAttribute(`aria-busy`,`true`),o().querySelector(`.wui-bell-item`)||o().replaceChildren(X(`wui-bell-state`,f))),c===void 0)throw Error(`bell has no data-src`);let n=await _.run(c);if(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)return;if(o().removeAttribute(`aria-busy`),!n.ok){t&&x();return}let r=S(n.html),i=G(r,`[data-wui-unread]`,HTMLElement),a=i?Number(i.getAttribute(`data-wui-unread`)):v;y(a),(t||b())&&(r.querySelector(`.wui-bell-item`)?o().replaceChildren(r):o().replaceChildren(X(`wui-bell-state`,d))),e.dispatchEvent(new CustomEvent(`wui:notifications:loaded`,{bubbles:!0,detail:{unread:a}}))};s?.addEventListener(`beforetoggle`,e=>{`newState`in e&&e.newState===`open`&&w(!0)}),e.addEventListener(`click`,async e=>{let t=J(e);if(t.closest(`[data-wui-bell-retry]`)){await w(!0);return}let n=K(t,`[data-wui-bell-read]`,HTMLButtonElement);if(!n||!l)return;n.disabled=!0;let r=await P(l,{method:`POST`});n.disabled=!1,r.ok&&(y(0),await w(!0))});let E=null,D=()=>{g>0&&E===null&&(E=setInterval(()=>w(b()),g*1e3))},O=()=>{E!==null&&clearInterval(E),E=null},k=()=>{document.hidden?O():(w(b()),D())};return g>0&&(document.addEventListener(`visibilitychange`,k),document.hidden||D()),t.push(()=>{O(),_.abort(),document.removeEventListener(`visibilitychange`,k)}),{setUnread:e=>y(e),refresh:()=>w(b())}}var se=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Z=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function ce(e,t){let n=C(G(e,`input.search-input`,HTMLInputElement),`search input missing`),r=G(e,`.wui-topsearch-results`,HTMLElement),i=()=>C(r,`search results missing`),a=G(e,`.wui-topsearch-open`,HTMLElement),o=G(e,`[data-wui-topsearch-live]`,HTMLElement),{src:s,param:c=`q`,resultsHref:l}=e.dataset,u=Number(e.dataset.minChars??2),d=Number(e.dataset.debounceMs??250),f=e.dataset.noResultsText??R().noResultsText,p=e.dataset.resultsCountText??R().resultsCountText,m=e.dataset.resultCountText??R().resultCountText,h=N(),g,_=-1,v=()=>q(i(),`.wui-topsearch-hit`,HTMLElement),y=e=>{let t=v();_=t.length===0?-1:(e+t.length)%t.length,t.forEach((e,t)=>{let n=t===_;e.classList.toggle(`is-active`,n),e.setAttribute(`aria-selected`,n?`true`:`false`)});let r=_>=0?t[_]:void 0;r?(n.setAttribute(`aria-activedescendant`,r.id),r.scrollIntoView?.({block:`nearest`})):n.removeAttribute(`aria-activedescendant`)},b=()=>{i().hidden=!0,n.setAttribute(`aria-expanded`,`false`),n.removeAttribute(`aria-activedescendant`),_=-1},x=()=>{i().hidden=!1,n.setAttribute(`aria-expanded`,`true`)},T=t=>{e.classList.toggle(`is-open`,t),a?.setAttribute(`aria-expanded`,t?`true`:`false`)},E=t=>{let n=new CustomEvent(`wui:search:select`,{bubbles:!0,cancelable:!0,detail:{href:t}});e.dispatchEvent(n)&&window.location.assign(t)},D=async t=>{if(e.classList.add(`is-loading`),s===void 0)throw Error(`search has no data-src`);let n=await h.run(Z(s,c,t));if(n.kind!==`aborted`&&n.kind!==`stale`&&n.kind!==`session`){if(e.classList.remove(`is-loading`),n.ok){let e=S(n.html),t=G(e,`[data-wui-count]`,HTMLElement);i().replaceChildren(e),v().forEach((e,t)=>{e.id=`${i().id}-opt-${t}`});let r=t?Number(t.getAttribute(`data-wui-count`)):v().length;o&&(o.textContent=r===0?f:H(r===1?m:p,{count:r}))}else i().replaceChildren(X(`wui-topsearch-empty`,R().searchUnavailableMessage));_=-1,x()}};n.addEventListener(`input`,()=>{clearTimeout(g);let t=n.value.trim();t.length<u?(h.abort(),e.classList.remove(`is-loading`),i().replaceChildren(),b()):g=setTimeout(()=>D(t),d)}),n.addEventListener(`keydown`,t=>{if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(i().hidden||v().length===0)return;t.preventDefault(),y(_+(t.key===`ArrowDown`?1:-1))}else if(w(t)){let e=v(),r=_>=0?e[_]:void 0;!i().hidden&&r?(t.preventDefault(),E(Y(r))):l&&n.value.trim()!==``&&(t.preventDefault(),E(Z(l,c,n.value.trim())))}else t.key===`Escape`&&(i().hidden?e.classList.contains(`is-open`)&&(t.preventDefault(),t.stopPropagation(),T(!1),a?.focus()):(t.preventDefault(),t.stopPropagation(),b()))}),i().addEventListener(`click`,e=>{let t=K(J(e),`.wui-topsearch-hit`,HTMLElement);!t||e.ctrlKey||e.metaKey||e.shiftKey||e.button===1||(e.preventDefault(),E(Y(t)))}),a?.addEventListener(`click`,()=>{let t=!e.classList.contains(`is-open`);T(t),t&&n.focus()});let O=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||se(e.target)||(e.preventDefault(),T(!0),n.focus())},k=t=>{t.target instanceof Node&&e.contains(t.target)||(b(),e.classList.contains(`is-open`)&&T(!1))};document.addEventListener(`keydown`,O),document.addEventListener(`pointerdown`,k),t.push(()=>{clearTimeout(g),h.abort(),document.removeEventListener(`keydown`,O),document.removeEventListener(`pointerdown`,k)})}function le(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>{U(n,!!e.detail?.collapsed)});let r=e.dataset.wuiFoldedCookie;r&&e.addEventListener(`wui:shell:nav-fold`,e=>{W(r,e.detail?.key,!!e.detail?.folded)}),e.addEventListener(`click`,t=>{J(t).closest(`[data-wui-tabbar-more]`)&&G(e,`[data-app-shell-menu]`,HTMLElement)?.click()});let i=G(e,`[data-wui-bell]`,HTMLElement),a=i?oe(i,t):null,o=G(e,`[data-wui-topsearch]`,HTMLElement);o&&ce(o,t);let s={el:e,setUnread(e){C(a,`WUI.shell: this <app-shell> has no <app-shell-notifications>.`).setUnread(e)},setTabCount(t,n,r){ae(e,t,n,r)},refreshNotifications(){return C(a,`WUI.shell: this <app-shell> has no <app-shell-notifications>.`).refresh()},get collapsed(){return e.classList.contains(`collapsed`)},set collapsed(t){if(!!t===e.classList.contains(`collapsed`))return;let n=G(e,`[data-app-shell-collapse]`,HTMLElement);n?n.click():e.classList.toggle(`collapsed`,!!t)}};B.set(e,s);let c=n=>{if(n.target===e||n.target instanceof Node&&n.target.contains(e)){for(let e of t)e();B.delete(e),delete e.dataset.wuiPartsWired,document.removeEventListener(`wui:teardown`,c)}};return document.addEventListener(`wui:teardown`,c),s}function Q(e=document){let t=[];e instanceof HTMLElement&&e.matches(`[data-app-shell]`)&&t.push(e),t.push(...q(e,`[data-app-shell]`,HTMLElement));for(let e of t)e.dataset.wuiPartsWired||(e.dataset.wuiPartsWired=`1`,le(e))}function $(e){let t=K(e,`[data-app-shell]`,HTMLElement);return t?(B.has(t)||Q(t),B.get(t)??null):null}var ue=/* @__PURE__ */ new Set([204,205,304]),de=e=>{let t=new Headers;for(let n of e.split(/\r?\n/)){let e=n.indexOf(`:`);e>0&&t.append(n.slice(0,e).trim(),n.slice(e+1).trim())}return t};async function fe(e,t,n={}){if(!(t instanceof FormData))throw TypeError(`wuiUpload: body must be FormData`);let r=n.timeoutMs;if(r!==void 0&&!(Number.isFinite(r)&&r>0))throw TypeError(`wuiUpload: timeoutMs must be a positive number`);let i={Accept:`text/html`,"X-Requested-With":`XMLHttpRequest`,[re]:`1`,...n.headers};if(L(e)){let e=A();e&&(i[e.header]=e.token)}let a=n.signal;return a?.aborted?j(`aborted`):new Promise(o=>{let s=new XMLHttpRequest,c=!1,l,u=()=>s.abort(),d=(e,t=null,n=``)=>{l!==void 0&&clearTimeout(l),a?.removeEventListener(`abort`,u),o(j(e,t,n))};s.upload.onprogress=e=>{n.onProgress?.(e.loaded,e.lengthComputable?e.total:0)},s.onload=()=>{let e=s.status;if(e===0){d(`network`);return}let t=de(s.getAllResponseHeaders()),n=F(e,t),r=s.responseText,i=n===`ok`||n===`validation`?r:``;if(e<200||e>599){d(n,null,i);return}let a=new Response(ue.has(e)?null:r,{status:e,headers:t});d(n,a,i)},s.onerror=()=>d(`network`),s.onabort=()=>{d(a?.aborted?`aborted`:c?`timeout`:`aborted`)},r!==void 0&&(l=setTimeout(()=>{c=!0,s.abort()},r)),a?.addEventListener(`abort`,u,{once:!0}),s.open(`POST`,e,!0);for(let[e,t]of Object.entries(i))s.setRequestHeader(e,t);s.send(t)})}export{g as CONFIRM_DIALOG_ID,i as CONFIRM_TONES,I as CSRF_META_NAME,ne as DEFAULT_CSRF_HEADER,_ as DISCARD_EVENT,u as FLASH_STORAGE_KEY,v as FLASH_VARIANTS,M as HTTP_KINDS,te as TOAST_ACTION_METHODS,y as TOAST_ACTION_MS,O as WUI_HEADERS,F as classifyStatus,m as closeRemotePane,k as configureCsrf,a as confirmAction,f as createDiscardPrompt,N as createRequestQueue,l as formValues,b as getServerTable,$ as getShell,h as initDrawerDiscard,d as initRemoteModals,o as initServerActions,e as initServerTables,Q as initShellParts,n as initUnsavedChanges,c as loadRemoteDrawer,s as loadRemoteModal,t as loadRemotePane,S as parseServerHtml,ee as parseToastAction,A as readCsrf,p as resetUnsavedChanges,x as runToastAction,r as showResultToast,ie as timeoutFromAttribute,P as wuiFetch,fe as wuiUpload};
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-DFWnCufa.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"./dataTable.g-DazoWWps.js";import{t as _}from"./datePicker.g-sGQE8c3n.js";import{t as v}from"./dateRangePicker.g-Pnc37vgX.js";import{t as y}from"./drawer.g-B-zYKBfQ.js";import{t as b}from"./gantt.g-TdTxeruW.js";import{t as x}from"./imageCrop.g-BnbAeH2Q.js";import{t as S}from"./inlineEdit.g-ZxRNYq0t.js";import{t as C}from"./leadPopup.g-BfMPz9nH.js";import{t as w}from"./lightbox.g-DDrycPou.js";import{t as T}from"./notificationCentre.g-UsAurkUz.js";import{t as E}from"./orgTree.g-CIg75quV.js";import{t as D}from"./overflow.g-BfcGEhwR.js";import{t as O}from"./phone.g-P66U-SK5.js";import{t as k}from"./relativeTime.g-BH90tjJM.js";import{t as A}from"./savedViews.g-CzzEliTR.js";import{n as j,r as M,t as N}from"./search.g-B5d1s59A.js";import{t as P}from"./showMore.g-BdQ5MUSd.js";import{t as F}from"./slider.g-BPNfxZEV.js";import{t as I}from"./sortable.g-BsTKys5-.js";import{t as L}from"./timePicker.g-IEczeE48.js";import{n as R,t as z}from"./tourAdvance.g-BJqDnqag.js";import{t as B}from"./tree.g-RId8xZSk.js";import{t as V}from"./treePicker.g-BR35ru5f.js";import{t as H}from"./wizard.g-DOZSBUc5.js";import{t as U}from"./rowDrop.g-DQpB10Ey.js";import{a as W,i as G,n as K,r as q,t as J}from"./tableSelect.g-Bmd-ExRE.js";import{i as Y,n as X,r as Z,t as Q}from"./passwordRules.g-CMYrohdd.js";import{t as $}from"./customRule.g-Cfkl3_ZC.js";import{t as ee}from"./shell.g-C2Ht5xl2.js";var te={label:`Switch account`},ne={closeLabel:`Close alert`},re={emptyTitle:`Nothing here yet`,errorTitle:`That didn't load`,loadingLabel:`Loading`,retryLabel:`Try again`},ie={photoLabel:`Profile photo`},ae={moreLabel:`{count} more`},oe={dismissLabel:`Dismiss`},se={moreLabel:`Show hidden levels`},ce={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}`,todayLabel:`Today`,tryAgainLabel:`Try again`,weekLabel:`Week`},le={closeLabel:`Close`},ue={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`,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}.`},de={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`},fe={helpLabel:`More information`},pe={helpLabel:`More information`},me={removeLabel:`Remove`,removeText:`Remove {content}`},he={moreLabel:`More`},ge={helpLabel:`More information`},_e={helpLabel:`More information`},ve={colourLabel:`Colour`,colourPickerLabel:`{label}, colour picker`,helpLabel:`More information`,optionalLabel:`(optional)`},ye={label:`Columns`},be={noLabel:`No`,partialLabel:`Partial`,warningLabel:`Warning`,yesLabel:`Yes`},xe={title:`Are you sure?`},Se={ariaLabel:`Context menu`,searchPlaceholder:`Search`},Ce={copiedLabel:`Copied`,label:`Copy`},we={label:`Menu`,noMatch:`No matches.`,noMatchText:`No matches.`,searchPlaceholder:`Search`},Te={anyTypeText:`Any file type`,browseLabel:`Click to upload`,dropLabel:`or drag & drop`,maxSizeText:`up to {size} MB`,removeAttachmentLabel:`Remove attachment`},Ee={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}`},De={addLabel:`Add line`,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`,savedLabel:`Saved`,savingLabel:`Saving`,statusLabel:`Status`},Oe={reloadPageLabel:`Reload the page`},ke={titleOne:`Fix {count} field to continue`,titleOther:`Fix {count} fields to continue`},Ae={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}`},je={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`},Me={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}%`},Ne={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}`},Pe={ariaLabel:`Quick navigation`},Fe={divideLabel:`divided by`,equalLabel:`equals`,label:`Calculation`,minusLabel:`minus`,plusLabel:`plus`,timesLabel:`times`},Ie={loadingLabel:`Loading`},Le={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?`},Re={label:`More information`},ze={clearLabel:`Clear`,helpLabel:`More information`,hidePasswordLabel:`Hide password`,optionalLabel:`(optional)`,requirementMetLabel:`: met`,requirementNotMetLabel:`: not met`,requirementsTitle:`Password requirements`,showPasswordLabel:`Show password`},Be={ctrlLabel:`Ctrl`,enterLabel:`Enter`,escLabel:`Esc`},Ve={periodLabel:`vs last period`},He={helpLabel:`More information`},Ue={failedText:`Could not load more`,finishedText:`You are all caught up.`,loadMoreLabel:`Load more`,loadingLabel:`Loading more`,retryLabel:`Try again`},We={backLabel:`Back`,closeLabel:`Close`},Ge={backLabel:`Back`},Ke={cancelLabel:`Cancel`,submitLabel:`Save`},qe={ariaLabel:`Main`},Je={decreaseLabel:`Decrease`,helpLabel:`More information`,increaseLabel:`Increase`,optionalLabel:`(optional)`},Ye={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`},Xe={helpLabel:`More information`,optionalLabel:`(optional)`},Ze={moreLabel:`More`,selectedText:`{count} selected`},Qe={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`},$e={youLabel:`You`},et={helpLabel:`More information`,label:`Phone number`,optionalLabel:`(optional)`},tt={badge:`Most popular`},nt={title:`QR code`},rt={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`},it={helpLabel:`More information`},at={helpLabel:`More information`,optionalLabel:`(optional)`},ot={helpLabel:`More information`,ratingLabel:`Rating`,starLabel:`{count} star`,starsLabel:`{count} stars`,valueText:`{value} out of {max}`},st={nextLabel:`Next`,positionText:`{position} of {total}`,prevLabel:`Previous`},ct={addLabel:`Add another`,removeLabel:`Remove row`},lt={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`},ut={errorText:`Something went wrong on our side. Try again in a moment.`,errorTitle:`This page did not load`,homeLabel:`Go to the home page`,notFoundText:`Check the address, or go to the home page.`,notFoundTitle:`We could not find that page`,reloadLabel:`Reload`,retryLabel:`Try again`,staleText:`This app was updated while you had it open. Reload to get the new version.`,staleTitle:`A new version is ready`},dt={menuLabel:`More actions`},ft={scoreLabel:`Score`},pt={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`},mt={helpLabel:`More information`},ht={loadingLabel:`Loading`},gt={reorderLabel:`Reorder {name}`},_t={namedTrendLabel:`{label} trend`,oneValueText:`{name} has one value, {value}.`,rangeText:`{name} from {from} to {to} across {count} points.`,trendLabel:`Trend`},vt={label:`Loading`},yt={label:`Loading`},bt={menuLabel:`More actions`},xt={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`},St={label:`Progress`,stepLabel:`Step {number}`},Ct={helpLabel:`More information`},wt={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}`},Tt={emptyTitle:`No records found`},Et={allSelectedLabel:`All {count} selected`,clearLabel:`Clear`,clearSelectionLabel:`Clear selection`,selectAllMatchingLabel:`Select all {count} matching`,selectedLabel:`{count} selected`},Dt={moreLabel:`More`,scrollTabsBackwardLabel:`Scroll tabs backward`,scrollTabsForwardLabel:`Scroll tabs forward`},Ot={helpLabel:`More information`,optionalLabel:`(optional)`},kt={autoLabel:`System`,autoModeLabel:`follows your device`,darkLabel:`Dark`,darkModeLabel:`dark`,label:`Theme`,lightLabel:`Light`,lightModeLabel:`light`},At={stepLabel:`Step {number}`},jt={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`},Mt={description:`A new version of this app is ready.`,dismissLabel:`Dismiss`,reloadLabel:`Reload`},Nt={emptyText:`Not set`},Pt={emptyText:`Nothing new yet`,label:`What's new`,linkLabel:`Learn more`,unreadLabel:`unread`},Ft={ariaLabel:`Workspace {currentName}`,createLabel:`Create workspace`,noMatchText:`No workspaces match.`,searchPlaceholder:`Search workspaces`,triggerLabel:`Workspace {currentName}`},It=e=>t(e);export{te as ACCOUNT_SWITCHER_TEXT,ne as ALERT_TEXT,re as ASYNC_BLOCK_TEXT,ae as AVATAR_GROUP_TEXT,ie as AVATAR_TEXT,oe as BANNER_TEXT,se as BREADCRUMBS_TEXT,ce as CALENDAR_TEXT,le as CARD_TEXT,u as CAROUSEL_TEXT,de as CHART_CARD_TEXT,ue as CHART_TEXT,pe as CHECKBOX_TEXT,fe as CHECK_TEXT,he as CHIP_GROUP_TEXT,me as CHIP_TEXT,ge as CHOICE_CARD_TEXT,_e as CHOICE_CHIP_TEXT,d as CODE_BLOCK_TEXT,ve as COLOUR_FIELD_TEXT,ye as COLUMN_MENU_TEXT,f as COMMAND_PALETTE_TEXT,p as COMMENT_THREAD_TEXT,be as COMPARE_TABLE_TEXT,G as CONFIRM_DIALOG_TEXT,xe as CONFIRM_PROVIDER_TEXT,h as CONSENT_BANNER_TEXT,Se as CONTEXT_MENU_TEXT,Ce as COPY_BUTTON_TEXT,$ as CUSTOM_RULE_TEXT,g as DATA_TABLE_TEXT,_ as DATE_PICKER_TEXT,v as DATE_RANGE_PICKER_TEXT,y as DRAWER_TEXT,we as DROPDOWN_TEXT,Te as DROP_ZONE_TEXT,Ee as DUE_DATE_TEXT,De as ENTRY_GRID_TEXT,Oe as ERROR_BOUNDARY_TEXT,ke as ERROR_SUMMARY_TEXT,j as FIELD_TEXT,Ae as FILE_ATTACHMENT_TEXT,je as FILE_PICKER_TEXT,Z as FILE_VALIDATION_TEXT,Me as FILE_VIEWER_TEXT,Ne as FILTER_BAR_TEXT,Pe as FLOATING_DOCK_TEXT,s as FORMATTERS_TEXT,Fe as FORMULA_STEPS_TEXT,b as GANTT_TEXT,Ie as HOVER_CARD_TEXT,l as HTTP_FAILURE_TEXT,Le as IDLE_TIMEOUT_DIALOG_TEXT,x as IMAGE_CROP_TEXT,Y as IMAGE_PICKER_TEXT,Re as INFO_TIP_TEXT,S as INLINE_EDIT_TEXT,X as INPUT_MASK_TEXT,ze as INPUT_TEXT,c as KANBAN_TEXT,Be as KBD_TEXT,Ve as KPI_TILE_TEXT,He as LABEL_HELP_TEXT,C as LEAD_POPUP_TEXT,w as LIGHTBOX_TEXT,Ue as LOAD_MORE_TEXT,m as MENTION_INPUT_TEXT,We as MODAL_CARD_RENDERER_TEXT,Ge as MODAL_CONTENT_TEXT,Ke as MODAL_FORM_TEXT,q as MODAL_TEXT,qe as NAVIGATION_MENU_TEXT,T as NOTIFICATION_CENTRE_TEXT,Je as NUMBER_INPUT_TEXT,Ye as ONBOARDING_CHECKLIST_TEXT,E as ORG_TREE_TEXT,Xe as OTP_INPUT_TEXT,D as OVERFLOW_TEXT,Ze as PAGE_HEADER_TEXT,Q as PASSWORD_RULES_TEXT,Qe as PERIOD_PICKER_TEXT,$e as PERSON_TEXT,et as PHONE_NUMBER_INPUT_TEXT,O as PHONE_TEXT,tt as PRICING_CARD_TEXT,nt as QR_CODE_TEXT,rt as QUERY_BUILDER_TEXT,at as RADIO_GROUP_TEXT,it as RADIO_TEXT,ot as RATING_TEXT,st as RECORD_PAGER_TEXT,k as RELATIVE_TIME_TEXT,ct as REPEATER_TEXT,lt as RICH_TEXT_TEXT,ut as ROUTE_ERROR_TEXT,dt as ROW_ACTIONS_TEXT,U as ROW_DROP_TEXT,A as SAVED_VIEWS_TEXT,ft as SCORE_SCALE_TEXT,N as SEARCH_TEXT,pt as SECTION_LEAD_CAPTURE_TEXT,mt as SEGMENTED_TEXT,M as SELECT_TEXT,ee as SHELL_TEXT,o as SHORTCUT_KEYS_TEXT,P as SHOW_MORE_TEXT,ht as SKELETON_SHAPES_TEXT,F as SLIDER_TEXT,gt as SORTABLE_LIST_TEXT,I as SORTABLE_TEXT,_t as SPARKLINE_TEXT,vt as SPINNER_TEXT,yt as SPLASH_TEXT,bt as SPLIT_BUTTON_TEXT,xt as SPLIT_VIEW_TEXT,St as STEPPER_TEXT,Ct as SWITCH_TEXT,wt as TABLE_PAGINATION_TEXT,Tt as TABLE_ROWS_TEXT,J as TABLE_SELECT_TEXT,Et as TABLE_TOOLBAR_TEXT,Dt as TABS_TEXT,Ot as TEXTAREA_TEXT,kt as THEME_TOGGLE_TEXT,At as TIMELINE_TEXT,L as TIME_PICKER_TEXT,K as TOAST_TEXT,z as TOUR_ADVANCE_TEXT,R as TOUR_TEXT,jt as TRANSFER_LIST_TEXT,V as TREE_PICKER_TEXT,B as TREE_TEXT,W as UNSAVED_CHANGES_TEXT,Mt as UPDATE_BAR_TEXT,Nt as VALUE_TEXT,Pt as WHATS_NEW_TEXT,H as WIZARD_TEXT,Ft as WORKSPACE_SWITCHER_TEXT,a as fillText,n as pluralText,i as readText,It 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-DFWnCufa.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"./dataTable.g-DazoWWps.js";import{t as _}from"./datePicker.g-sGQE8c3n.js";import{t as v}from"./dateRangePicker.g-Pnc37vgX.js";import{t as y}from"./drawer.g-B-zYKBfQ.js";import{t as b}from"./gantt.g-TdTxeruW.js";import{t as x}from"./imageCrop.g-BnbAeH2Q.js";import{n as S,t as C}from"./inlineEdit.g-DLDVospu.js";import{t as w}from"./leadPopup.g-BfMPz9nH.js";import{t as T}from"./lightbox.g-DDrycPou.js";import{t as E}from"./notificationCentre.g-UsAurkUz.js";import{t as D}from"./orgTree.g-CIg75quV.js";import{t as O}from"./overflow.g-BfcGEhwR.js";import{t as k}from"./phone.g-P66U-SK5.js";import{t as A}from"./relativeTime.g-BH90tjJM.js";import{t as j}from"./savedViews.g-CzzEliTR.js";import{n as M,r as N,t as P}from"./search.g-B5d1s59A.js";import{t as F}from"./showMore.g-BdQ5MUSd.js";import{t as I}from"./slider.g-BPNfxZEV.js";import{t as L}from"./sortable.g-BsTKys5-.js";import{t as R}from"./timePicker.g-IEczeE48.js";import{n as z,t as B}from"./tourAdvance.g-BJqDnqag.js";import{t as V}from"./tree.g-RId8xZSk.js";import{t as H}from"./treePicker.g-BR35ru5f.js";import{t as U}from"./wizard.g-DOZSBUc5.js";import{t as W}from"./rowDrop.g-DQpB10Ey.js";import{a as G,i as K,n as q,r as J,t as Y}from"./tableSelect.g-Bmd-ExRE.js";import{i as X,n as Z,r as Q,t as $}from"./passwordRules.g-CMYrohdd.js";import{t as ee}from"./customRule.g-Cfkl3_ZC.js";import{t as te}from"./shell.g-C2Ht5xl2.js";var ne={label:`Switch account`},re={closeLabel:`Close alert`},ie={photoLabel:`Profile photo`},ae={moreLabel:`{count} more`},oe={dismissLabel:`Dismiss`},se={moreLabel:`Show hidden levels`},ce={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}`,todayLabel:`Today`,tryAgainLabel:`Try again`,weekLabel:`Week`},le={closeLabel:`Close`},ue={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`,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}.`},de={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`},fe={helpLabel:`More information`},pe={helpLabel:`More information`},me={removeLabel:`Remove`,removeText:`Remove {content}`},he={moreLabel:`More`},ge={helpLabel:`More information`},_e={helpLabel:`More information`},ve={colourLabel:`Colour`,colourPickerLabel:`{label}, colour picker`,helpLabel:`More information`,optionalLabel:`(optional)`},ye={label:`Columns`},be={noLabel:`No`,partialLabel:`Partial`,warningLabel:`Warning`,yesLabel:`Yes`},xe={title:`Are you sure?`},Se={ariaLabel:`Context menu`,searchPlaceholder:`Search`},Ce={copiedLabel:`Copied`,label:`Copy`},we={label:`Menu`,noMatch:`No matches.`,noMatchText:`No matches.`,searchPlaceholder:`Search`},Te={anyTypeText:`Any file type`,browseLabel:`Click to upload`,dropLabel:`or drag & drop`,maxSizeText:`up to {size} MB`,removeAttachmentLabel:`Remove attachment`},Ee={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}`},De={addLabel:`Add line`,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`,savedLabel:`Saved`,savingLabel:`Saving`,statusLabel:`Status`},Oe={reloadPageLabel:`Reload the page`},ke={titleOne:`Fix {count} field to continue`,titleOther:`Fix {count} fields to continue`},Ae={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}`},je={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`},Me={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}%`},Ne={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}`},Pe={ariaLabel:`Quick navigation`},Fe={divideLabel:`divided by`,equalLabel:`equals`,label:`Calculation`,minusLabel:`minus`,plusLabel:`plus`,timesLabel:`times`},Ie={loadingLabel:`Loading`},Le={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?`},Re={label:`More information`},ze={clearLabel:`Clear`,helpLabel:`More information`,hidePasswordLabel:`Hide password`,optionalLabel:`(optional)`,requirementMetLabel:`: met`,requirementNotMetLabel:`: not met`,requirementsTitle:`Password requirements`,showPasswordLabel:`Show password`},Be={ctrlLabel:`Ctrl`,enterLabel:`Enter`,escLabel:`Esc`},Ve={periodLabel:`vs last period`},He={helpLabel:`More information`},Ue={failedText:`Could not load more`,finishedText:`You are all caught up.`,loadMoreLabel:`Load more`,loadingLabel:`Loading more`,retryLabel:`Try again`},We={backLabel:`Back`,closeLabel:`Close`},Ge={backLabel:`Back`},Ke={cancelLabel:`Cancel`,submitLabel:`Save`},qe={ariaLabel:`Main`},Je={decreaseLabel:`Decrease`,helpLabel:`More information`,increaseLabel:`Increase`,optionalLabel:`(optional)`},Ye={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`},Xe={helpLabel:`More information`,optionalLabel:`(optional)`},Ze={moreLabel:`More`,selectedText:`{count} selected`},Qe={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`},$e={youLabel:`You`},et={helpLabel:`More information`,label:`Phone number`,optionalLabel:`(optional)`},tt={badge:`Most popular`},nt={title:`QR code`},rt={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`},it={helpLabel:`More information`},at={helpLabel:`More information`,optionalLabel:`(optional)`},ot={helpLabel:`More information`,ratingLabel:`Rating`,starLabel:`{count} star`,starsLabel:`{count} stars`,valueText:`{value} out of {max}`},st={nextLabel:`Next`,positionText:`{position} of {total}`,prevLabel:`Previous`},ct={addLabel:`Add another`,removeLabel:`Remove row`},lt={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`},ut={errorText:`Something went wrong on our side. Try again in a moment.`,errorTitle:`This page did not load`,homeLabel:`Go to the home page`,notFoundText:`Check the address, or go to the home page.`,notFoundTitle:`We could not find that page`,reloadLabel:`Reload`,retryLabel:`Try again`,staleText:`This app was updated while you had it open. Reload to get the new version.`,staleTitle:`A new version is ready`},dt={menuLabel:`More actions`},ft={scoreLabel:`Score`},pt={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`},mt={helpLabel:`More information`},ht={loadingLabel:`Loading`},gt={reorderLabel:`Reorder {name}`},_t={namedTrendLabel:`{label} trend`,oneValueText:`{name} has one value, {value}.`,rangeText:`{name} from {from} to {to} across {count} points.`,trendLabel:`Trend`},vt={label:`Loading`},yt={label:`Loading`},bt={menuLabel:`More actions`},xt={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`},St={label:`Progress`,stepLabel:`Step {number}`},Ct={helpLabel:`More information`},wt={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}`},Tt={emptyTitle:`No records found`},Et={allSelectedLabel:`All {count} selected`,clearLabel:`Clear`,clearSelectionLabel:`Clear selection`,selectAllMatchingLabel:`Select all {count} matching`,selectedLabel:`{count} selected`},Dt={moreLabel:`More`,scrollTabsBackwardLabel:`Scroll tabs backward`,scrollTabsForwardLabel:`Scroll tabs forward`},Ot={helpLabel:`More information`,optionalLabel:`(optional)`},kt={autoLabel:`System`,autoModeLabel:`follows your device`,darkLabel:`Dark`,darkModeLabel:`dark`,label:`Theme`,lightLabel:`Light`,lightModeLabel:`light`},At={stepLabel:`Step {number}`},jt={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`},Mt={description:`A new version of this app is ready.`,dismissLabel:`Dismiss`,reloadLabel:`Reload`},Nt={emptyText:`Not set`},Pt={emptyText:`Nothing new yet`,label:`What's new`,linkLabel:`Learn more`,unreadLabel:`unread`},Ft={ariaLabel:`Workspace {currentName}`,createLabel:`Create workspace`,noMatchText:`No workspaces match.`,searchPlaceholder:`Search workspaces`,triggerLabel:`Workspace {currentName}`},It=e=>t(e);export{ne as ACCOUNT_SWITCHER_TEXT,re as ALERT_TEXT,S as ASYNC_BLOCK_TEXT,ae as AVATAR_GROUP_TEXT,ie as AVATAR_TEXT,oe as BANNER_TEXT,se as BREADCRUMBS_TEXT,ce as CALENDAR_TEXT,le as CARD_TEXT,u as CAROUSEL_TEXT,de as CHART_CARD_TEXT,ue as CHART_TEXT,pe as CHECKBOX_TEXT,fe as CHECK_TEXT,he as CHIP_GROUP_TEXT,me as CHIP_TEXT,ge as CHOICE_CARD_TEXT,_e as CHOICE_CHIP_TEXT,d as CODE_BLOCK_TEXT,ve as COLOUR_FIELD_TEXT,ye as COLUMN_MENU_TEXT,f as COMMAND_PALETTE_TEXT,p as COMMENT_THREAD_TEXT,be as COMPARE_TABLE_TEXT,K as CONFIRM_DIALOG_TEXT,xe as CONFIRM_PROVIDER_TEXT,h as CONSENT_BANNER_TEXT,Se as CONTEXT_MENU_TEXT,Ce as COPY_BUTTON_TEXT,ee as CUSTOM_RULE_TEXT,g as DATA_TABLE_TEXT,_ as DATE_PICKER_TEXT,v as DATE_RANGE_PICKER_TEXT,y as DRAWER_TEXT,we as DROPDOWN_TEXT,Te as DROP_ZONE_TEXT,Ee as DUE_DATE_TEXT,De as ENTRY_GRID_TEXT,Oe as ERROR_BOUNDARY_TEXT,ke as ERROR_SUMMARY_TEXT,M as FIELD_TEXT,Ae as FILE_ATTACHMENT_TEXT,je as FILE_PICKER_TEXT,Q as FILE_VALIDATION_TEXT,Me as FILE_VIEWER_TEXT,Ne as FILTER_BAR_TEXT,Pe as FLOATING_DOCK_TEXT,s as FORMATTERS_TEXT,Fe as FORMULA_STEPS_TEXT,b as GANTT_TEXT,Ie as HOVER_CARD_TEXT,l as HTTP_FAILURE_TEXT,Le as IDLE_TIMEOUT_DIALOG_TEXT,x as IMAGE_CROP_TEXT,X as IMAGE_PICKER_TEXT,Re as INFO_TIP_TEXT,C as INLINE_EDIT_TEXT,Z as INPUT_MASK_TEXT,ze as INPUT_TEXT,c as KANBAN_TEXT,Be as KBD_TEXT,Ve as KPI_TILE_TEXT,He as LABEL_HELP_TEXT,w as LEAD_POPUP_TEXT,T as LIGHTBOX_TEXT,Ue as LOAD_MORE_TEXT,m as MENTION_INPUT_TEXT,We as MODAL_CARD_RENDERER_TEXT,Ge as MODAL_CONTENT_TEXT,Ke as MODAL_FORM_TEXT,J as MODAL_TEXT,qe as NAVIGATION_MENU_TEXT,E as NOTIFICATION_CENTRE_TEXT,Je as NUMBER_INPUT_TEXT,Ye as ONBOARDING_CHECKLIST_TEXT,D as ORG_TREE_TEXT,Xe as OTP_INPUT_TEXT,O as OVERFLOW_TEXT,Ze as PAGE_HEADER_TEXT,$ as PASSWORD_RULES_TEXT,Qe as PERIOD_PICKER_TEXT,$e as PERSON_TEXT,et as PHONE_NUMBER_INPUT_TEXT,k as PHONE_TEXT,tt as PRICING_CARD_TEXT,nt as QR_CODE_TEXT,rt as QUERY_BUILDER_TEXT,at as RADIO_GROUP_TEXT,it as RADIO_TEXT,ot as RATING_TEXT,st as RECORD_PAGER_TEXT,A as RELATIVE_TIME_TEXT,ct as REPEATER_TEXT,lt as RICH_TEXT_TEXT,ut as ROUTE_ERROR_TEXT,dt as ROW_ACTIONS_TEXT,W as ROW_DROP_TEXT,j as SAVED_VIEWS_TEXT,ft as SCORE_SCALE_TEXT,P as SEARCH_TEXT,pt as SECTION_LEAD_CAPTURE_TEXT,mt as SEGMENTED_TEXT,N as SELECT_TEXT,te as SHELL_TEXT,o as SHORTCUT_KEYS_TEXT,F as SHOW_MORE_TEXT,ht as SKELETON_SHAPES_TEXT,I as SLIDER_TEXT,gt as SORTABLE_LIST_TEXT,L as SORTABLE_TEXT,_t as SPARKLINE_TEXT,vt as SPINNER_TEXT,yt as SPLASH_TEXT,bt as SPLIT_BUTTON_TEXT,xt as SPLIT_VIEW_TEXT,St as STEPPER_TEXT,Ct as SWITCH_TEXT,wt as TABLE_PAGINATION_TEXT,Tt as TABLE_ROWS_TEXT,Y as TABLE_SELECT_TEXT,Et as TABLE_TOOLBAR_TEXT,Dt as TABS_TEXT,Ot as TEXTAREA_TEXT,kt as THEME_TOGGLE_TEXT,At as TIMELINE_TEXT,R as TIME_PICKER_TEXT,q as TOAST_TEXT,B as TOUR_ADVANCE_TEXT,z as TOUR_TEXT,jt as TRANSFER_LIST_TEXT,H as TREE_PICKER_TEXT,V as TREE_TEXT,G as UNSAVED_CHANGES_TEXT,Mt as UPDATE_BAR_TEXT,Nt as VALUE_TEXT,Pt as WHATS_NEW_TEXT,U as WIZARD_TEXT,Ft as WORKSPACE_SWITCHER_TEXT,a as fillText,n as pluralText,i as readText,It as setWuiText,e as subscribeText,r as textLocale};
@@ -1 +1 @@
1
- (function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=globalThis.WeborityUiElementsInternal?.version;if(a!==`0.177.0`)throw Error(`[webority-ui] carousel expects ui-elements 0.177.0 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.178.0`)throw Error(`[webority-ui] carousel expects ui-elements 0.178.0 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.177.0`)throw Error(`[webority-ui] code-block expects ui-elements 0.177.0 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.178.0`)throw Error(`[webority-ui] code-block expects ui-elements 0.178.0 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.177.0`)throw Error(`[webority-ui] command-palette expects ui-elements 0.177.0 but the page loaded `+o+`.`);var s={allCountText:`All ({count})`,ariaLabel:`Search`,backLabel:`Back`,emptyText:`No results`,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=0;function y(e,t){if(!(e instanceof Element))return null;let n=e.closest(t);return n instanceof HTMLElement?n:null}var b=(e,t,n)=>{let r=e.querySelector(t);return r instanceof n?r:null},x=(e,t,n)=>[...e.querySelectorAll(t)].filter(e=>e instanceof n),S=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-${++v}`,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=y(e.target,g);if(t&&this.contains(t)){let e=t.matches(`.wui-cmd-back`)?this._path.length-1:Number(t.dataset.depth);this._goTo(this._path.slice(0,e));return}let n=y(e.target,_);if(n&&this.contains(n)){this._pickGroup(n.dataset.groupTab||null);return}let r=this._optionFrom(e.target);r&&this._select(r)},this._onMouseDown=e=>{let t=y(e.target,g),n=y(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(`
1
+ (function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=globalThis.WeborityUiElementsInternal?.version;if(o!==`0.178.0`)throw Error(`[webority-ui] command-palette expects ui-elements 0.178.0 but the page loaded `+o+`.`);var s={allCountText:`All ({count})`,ariaLabel:`Search`,backLabel:`Back`,emptyText:`No results`,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=0;function y(e,t){if(!(e instanceof Element))return null;let n=e.closest(t);return n instanceof HTMLElement?n:null}var b=(e,t,n)=>{let r=e.querySelector(t);return r instanceof n?r:null},x=(e,t,n)=>[...e.querySelectorAll(t)].filter(e=>e instanceof n),S=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-${++v}`,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=y(e.target,g);if(t&&this.contains(t)){let e=t.matches(`.wui-cmd-back`)?this._path.length-1:Number(t.dataset.depth);this._goTo(this._path.slice(0,e));return}let n=y(e.target,_);if(n&&this.contains(n)){this._pickGroup(n.dataset.groupTab||null);return}let r=this._optionFrom(e.target);r&&this._select(r)},this._onMouseDown=e=>{let t=y(e.target,g),n=y(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=y(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||(y(e,`[role="group"]`)?.hidden??!1)!==!1}_selectableOptions(){return x(this,f,HTMLElement).filter(e=>!this._isHidden(e)&&!this._isDisabled(e))}_setActive(e,t){this._activeId=e?e.id:null;for(let t of x(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=x(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 x(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=b(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=b(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=b(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 b(this,`.wui-cmd-recents`,HTMLElement)}_realOptions(){let e=this._recentsHost();return x(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||(y(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=x(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=b(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 x(this,`[role="group"]`,HTMLElement))d?.contains(e)||(e.hidden=!x(e,f,HTMLElement).some(e=>!e.hidden));let p=b(this,`[role="listbox"]`,HTMLElement);p&&(p.hidden=u===0);let m=b(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`,S),e.WuiCommandPalette=S})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.dom,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.textStore,WeborityUiElementsInternal.modules.textMatch);
@@ -1 +1 @@
1
- (function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var g=globalThis.WeborityUiElementsInternal?.version;if(g!==`0.177.0`)throw Error(`[webority-ui] comment-thread expects ui-elements 0.177.0 but the page loaded `+g+`.`);var _=Object.freeze([`👍`,`❤️`,`🎉`,`😄`,`👀`,`🙏`]),v=Object.freeze([`post`,`reply`,`edit`,`delete`,`react`]),y={addReactionLabel:`Add a reaction`,attachmentsLabel:`Attachments`,cancelLabel:`Cancel`,chooseReactionLabel:`Choose a reaction`,composerLabel:`Add a comment`,composerPlaceholder:`Write a comment. Type @ to mention someone.`,deleteConfirmText:`Delete this comment?`,deleteLabel:`Delete`,deletedText:`This comment was deleted.`,doneDeleteText:`Comment deleted.`,doneEditText:`Comment saved.`,donePostText:`Comment posted.`,doneReplyText:`Reply posted.`,editCommentLabel:`Edit comment`,editLabel:`Edit`,editedLabel:`Edited`,emptyBodyMessage:`Write something first.`,failedClientMessage:`This did not go through. Refresh the page and try again.`,failedServerMessage:`Something went wrong on our side. Try again in a moment.`,forbiddenMessage:`You do not have permission to do this.`,internalLabel:`Internal note`,label:`Comments`,noCommentsText:`No comments yet.`,peopleLabel:`People`,postLabel:`Comment`,reactionsLabel:`Reactions`,repliesToLabel:`Replies to {name}`,replyLabel:`Reply`,replyPlaceholder:`Write a reply`,replyToText:`Reply to {author}`,saveLabel:`Save`,validationMessage:`This was not accepted. Check it and try again.`},b={foundTextOne:`1 person. Up and down to choose, Enter to mention.`,foundTextOther:`{count} people. Up and down to choose, Enter to mention.`,helpLabel:`More information`,listNameLabel:`People`,mentioned:`Mentioned {label}.`,noMatchLabel:`No one matches`,searchFailedMessage:`Couldn't load people. Keep typing to try again.`,searchingLabel:`Searching…`};function x(e){"@babel/helpers - typeof";return x=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},x(e)}function S(e,t){if(x(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(x(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function C(e){var t=S(e,`string`);return x(t)==`symbol`?t:t+``}function w(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T=()=>(0,l.readText)(`mentionInput`,b),E=`[data-wui-control]`,D=`[data-wui-field]`,O=`[data-wui-menu]`,k=`[data-wui-live]`,A=0,j=e=>!!(e&&h.MENTION_ID_PATTERN.test(String(e.value??``))&&(0,h.mentionLabel)(e.label)!==``);function M(e,t){let n=e.getAttribute(`size`);t.classList.toggle(`wui-input-sm`,n===`sm`),t.classList.toggle(`wui-input-lg`,n===`lg`),t.classList.toggle(`wui-input-xl`,n===`xl`)}function N(e,t){t.readOnly=(0,d.isReadOnly)(e)||e.hasAttribute(`loading`)}function P(e){let t=e.ownerDocument;e.id||=`wui-mention-${++A}`;let n=t.createElement(`textarea`);n.id=`${e.id}-text`,n.className=`form-control wui-mention-input-text`,n.rows=Number(e.getAttribute(`rows`))>0?Number(e.getAttribute(`rows`)):3,n.setAttribute(`data-wui-control`,``),n.setAttribute(`aria-autocomplete`,`list`),n.setAttribute(`aria-controls`,`${e.id}-people`);let r=e.getAttribute(`label`);r&&n.setAttribute(`aria-label`,r);let i=e.getAttribute(`placeholder`);i&&(n.placeholder=i);for(let t of[`aria-describedby`,`aria-invalid`]){let r=e.getAttribute(t);r&&n.setAttribute(t,r)}n.disabled=e.hasAttribute(`disabled`),N(e,n),M(e,n),e.appendChild(n);let a=e.getAttribute(`name`);if(a){let n=t.createElement(`input`);n.type=`hidden`,n.name=a,n.value=e.getAttribute(`value`)??``,n.setAttribute(`data-wui-field`,``),e.appendChild(n)}let o=t.createElement(`div`);o.className=`wui-mention-menu`,o.id=`${e.id}-people`,o.setAttribute(`role`,`listbox`),o.setAttribute(`aria-label`,e.getAttribute(`people-label`)??T().listNameLabel),o.setAttribute(`data-wui-menu`,``),o.setAttribute(`popover`,`manual`),e.appendChild(o);let s=t.createElement(`span`);s.className=`visually-hidden`,s.setAttribute(`data-wui-live`,``),s.setAttribute(`aria-live`,`polite`),s.setAttribute(`aria-atomic`,`true`),e.appendChild(s)}var F=class extends r.ElementBase{static get observedAttributes(){return[`disabled`,`readonly`,`loading`,`size`,`aria-invalid`,`aria-describedby`]}constructor(){super(),w(this,`_wired`,void 0),w(this,`_pendingValue`,void 0),w(this,`_text`,void 0),w(this,`_mentions`,void 0),w(this,`_peopleProp`,void 0),w(this,`_declared`,void 0),w(this,`_loading`,void 0),w(this,`_searchFailed`,void 0),w(this,`_query`,void 0),w(this,`_results`,void 0),w(this,`_active`,void 0),w(this,`_timer`,void 0),w(this,`_searchSeq`,void 0),w(this,`_lastSearch`,void 0),w(this,`_abort`,void 0),w(this,`_onMenuDown`,void 0),this._wired=!1,this._text=``,this._mentions=[],this._peopleProp=null,this._declared=null,this._loading=!1,this._searchFailed=!1,this._query=null,this._results=[],this._active=-1,this._timer=void 0,this._searchSeq=0,this._abort=null,this._onInput=this._onInput.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onCaret=this._onCaret.bind(this),this._onFocusOut=this._onFocusOut.bind(this),this._onMenuDown=e=>e.preventDefault(),this._onMenuClick=this._onMenuClick.bind(this)}connectedCallback(){for(let e of[`people`,`loading`,`searchFailed`,`value`])if((0,i.hasOwn)(this,e)){let t=Reflect.get(this,e);Reflect.deleteProperty(this,e),Reflect.set(this,e,t)}if(this._wired)return;this._wired=!0,this.querySelector(E)||P(this);let e=this._requireControl(),t=this.querySelector(D)?.value??this.getAttribute(`value`)??``;this._pendingValue===void 0?this._load(t):this._load(this._pendingValue),this._pendingValue=void 0,this._syncState(),e.addEventListener(`input`,this._onInput),e.addEventListener(`keydown`,this._onKeyDown),e.addEventListener(`click`,this._onCaret),e.addEventListener(`keyup`,this._onCaret),this.addEventListener(`focusout`,this._onFocusOut);let n=this._requireMenu();n.addEventListener(`mousedown`,this._onMenuDown),n.addEventListener(`click`,this._onMenuClick),n.addEventListener(`mousemove`,e=>{let t=e.target instanceof Element?e.target.closest(`.wui-mention-option`):null;t&&Number(t.dataset.index)!==this._active&&this._setActive(Number(t.dataset.index),{reveal:!1})})}disconnectedCallback(){this._close(),clearTimeout(this._timer),this._abort?.abort()}attributeChangedCallback(e,t,n){let r=this._control();r&&(e===`disabled`?(r.disabled=n!==null,n!==null&&this._close()):e===`readonly`?(N(this,r),n!==null&&this._close(),this._syncState()):e===`loading`?(N(this,r),this._syncState(),this._query!==null&&this._renderMenu()):e===`size`?M(this,r):n===null?r.removeAttribute(e):r.setAttribute(e,n))}get value(){return(0,h.mentionValueFromText)(this._text,this._mentions)}set value(e){let t=e==null?``:String(e);this._wired?t!==this.value&&this._load(t):this._pendingValue=t}get mentions(){let e=new Set,t=[];for(let n of[...this._mentions].sort((e,t)=>e.start-t.start))e.has(n.id)||(e.add(n.id),t.push({id:n.id,label:n.label}));return t}get people(){return this._peopleProp?this._peopleProp:(this._declared||=[...this.querySelectorAll(`[data-wui-people] > wui-option`)].map(e=>({value:e.getAttribute(`value`)??``,label:(e.textContent??``).trim(),description:e.getAttribute(`data-description`)||void 0,src:e.getAttribute(`data-src`)||void 0})),this._declared)}set people(e){this._peopleProp=Array.isArray(e)?e.filter(j):[],this._searchFailed=!1,(this._isOpen()||this._query!==null)&&this._refresh()}get searchFailed(){return this._searchFailed}set searchFailed(e){this._searchFailed=!!e,this._query!==null&&this._renderMenu()}get loading(){return this._loading||this.hasAttribute(`loading`)}set loading(e){this._loading=!!e,this.toggleAttribute(`loading`,this._loading),this._query!==null&&this._renderMenu()}focus(e){this._control()?.focus(e)}clear(){this._load(``),this._emit()}_control(){return this.querySelector(E)}_menu(){return this.querySelector(O)}_requireControl(){let e=this._control();if(!e)throw Error(`<wui-mention-input> has no text box.`);return e}_requireMenu(){let e=this._menu();if(!e)throw Error(`<wui-mention-input> has no people list.`);return e}_load(e){let{text:t,mentions:n}=(0,h.mentionTextFromValue)(e);this._text=t,this._mentions=n;let r=this._control();r&&(r.defaultValue=t,r.value=t),this._syncField(),this._close()}_syncField(){let e=this.querySelector(D);e&&(e.value=this.value)}_emit(){this._syncField(),this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,detail:{value:this.value,mentions:this.mentions}}))}_onInput(){let e=this._requireControl(),t=e.value,n=this._text,r=t.length-n.length,i=Math.min(n.length,t.length),a=Math.max(0,Math.min(i,e.selectionEnd-Math.max(r,0))),o=0;for(;o<a&&n[o]===t[o];)o++;let s=0;for(;s<i-o&&n[n.length-1-s]===t[t.length-1-s];)s++;let c=n.length-s;this._mentions=this._mentions.filter(e=>e.end<=o||e.start>=c).map(e=>e.start>=c?{...e,start:e.start+r,end:e.end+r}:e),this._text=t,this._emit(),this._onCaret()}_onCaret(e){if(e instanceof KeyboardEvent&&e.type===`keyup`&&[`ArrowUp`,`ArrowDown`,`Enter`,`Tab`,`Escape`].includes(e.key))return;let t=this._queryAtCaret();t?this._query&&t.text===this._query.text&&t.start===this._query.start||(this._query=t,this._refresh()):this._close()}_queryAtCaret(){let e=this._control();if(!e||(0,d.isInert)(this)||e.selectionStart!==e.selectionEnd)return null;let t=e.selectionStart,n=this._text,r=n.lastIndexOf(`@`,t-1);if(r<0||r>0&&!/[\s([{"'“‘]/.test(n.charAt(r-1)))return null;let i=n.slice(r+1,t);return i.length>40||/[\n@]/.test(i)||/^\s/.test(i)||/\s{2}/.test(i)||this._mentions.some(e=>r>=e.start&&r<e.end)?null:{start:r,end:t,text:i}}_refresh(){if(!this._query)return;let e=this.hasAttribute(`remote`)||this.hasAttribute(`source`);if(e&&this._query.text.length<this._minChars()){this._results=[],this._close();return}e&&!this._answered(this._query.text)&&this._search(this._query.text);let t=this._query.text.toLowerCase(),n=e?this.people:this.people.filter(e=>(0,h.mentionLabel)(e.label).toLowerCase().includes(t));this._results=n.slice(0,8),this._renderMenu()}_answered(e){return this._lastSearch===e}_minChars(){let e=this.getAttribute(`min-chars`),t=e==null||e===``?1:Number(e);return Number.isFinite(t)&&t>=0?t:1}_debounce(){let e=this.getAttribute(`debounce`),t=e==null||e===``?250:Number(e);return Number.isFinite(t)&&t>=0?t:250}_search(e){this._lastSearch=e,clearTimeout(this._timer);let t=++this._searchSeq;this._timer=setTimeout(()=>{let n=this.getAttribute(`source`);n?this._fetchPeople(n,e,t):this.dispatchEvent(new CustomEvent(`search`,{bubbles:!0,detail:{query:e,seq:t}}))},this._debounce())}async _fetchPeople(e,t,n){this._abort?.abort();let r=new AbortController;this._abort=r,this.loading=!0;let i=`${e}${e.includes(`?`)?`&`:`?`}q=${encodeURIComponent(t)}`,a=await(0,c.wuiFetch)(i,{signal:r.signal});if(n!==this._searchSeq)return;if(this._abort=null,!a.ok){this._peopleProp=[],this._searchFailed=!0,this.loading=!1,this._refresh();return}this._searchFailed=!1;let o=(0,s.parseServerHtml)(a.html);this._peopleProp=[...o.querySelectorAll(`wui-option`)].map(e=>({value:e.getAttribute(`value`)??``,label:(e.textContent??``).trim(),description:e.getAttribute(`data-description`)||void 0,src:e.getAttribute(`data-src`)||void 0})).filter(j),this.loading=!1,this._refresh()}_isOpen(){let e=this._menu();return e!==null&&(0,a.isPopoverOpen)(e)}_renderMenu(){let e=this._menu(),t=this._control();if(!e||!t||!this._query)return;this._syncState();let n=this.ownerDocument;if(e.replaceChildren(),this._results.forEach((t,r)=>{let i=n.createElement(`div`);if(i.className=`wui-mention-option`,i.id=`${e.id}-${r}`,i.setAttribute(`role`,`option`),i.setAttribute(`aria-selected`,`false`),i.dataset.index=String(r),t.src){let e=n.createElement(`img`);e.className=`wui-mention-option-photo`,e.src=t.src,e.alt=``,i.appendChild(e)}let a=n.createElement(`span`);a.className=`wui-mention-option-text`;let o=n.createElement(`span`);if(o.className=`wui-mention-option-label`,o.textContent=(0,h.mentionLabel)(t.label),a.appendChild(o),t.description){let e=n.createElement(`span`);e.className=`wui-mention-option-description`,e.textContent=String(t.description),a.appendChild(e)}i.appendChild(a),e.appendChild(i)}),!this._results.length){let t=n.createElement(`div`);t.className=`wui-mention-empty`,t.textContent=this.loading?T().searchingLabel:this._searchFailed?T().searchFailedMessage:`${T().noMatchLabel} “${this._query.text}”`,e.appendChild(t)}(0,a.openAnchoredPopover)(t,e,{mode:`manual`}),this._setActive(this._results.length?0:-1),this.loading||this._announce(this._results.length?(0,l.pluralText)(T(),`foundText`,this._results.length,{count:(0,f.formatNumber)(this._results.length,{decimals:0})}):this._searchFailed?T().searchFailedMessage:`${T().noMatchLabel}.`)}_syncState(){let e=this._control();e&&(0,d.syncFieldState)(this,e)}_close(){this._query=null,this._lastSearch=void 0,clearTimeout(this._timer);let e=this._menu();if(e){let t=(0,a.isPopoverOpen)(e);(0,a.closeAnchoredPopover)(e),t&&e.replaceChildren()}this._active=-1,this._control()?.removeAttribute(`aria-activedescendant`)}_setActive(e,{reveal:t=!0}={}){let n=this._requireMenu(),r=[...n.querySelectorAll(`.wui-mention-option`)];this._active=e>=0&&e<r.length?e:-1;let i=this._active>=0?r[this._active]??null:null;for(let e of r)e.setAttribute(`aria-selected`,e===i?`true`:`false`);(0,m.moveActiveRow)(n,i),i?(t&&i.scrollIntoView?.({block:`nearest`}),this._requireControl().setAttribute(`aria-activedescendant`,i.id)):this._requireControl().removeAttribute(`aria-activedescendant`)}_onKeyDown(e){if(this._isOpen()&&this._query){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=this._results.length;if(!t)return;let n=e.key===`ArrowDown`?1:-1;this._setActive((this._active+n+t)%t);return}if(((0,p.isImeSafeEnter)(e)||e.key===`Tab`)&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&this._active>=0){e.preventDefault(),this._pick(this._results[this._active]);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),this._close();return}}(0,p.isImeSafeEnter)(e)&&(e.ctrlKey||e.metaKey)?(e.preventDefault(),this.dispatchEvent(new CustomEvent(`wui:mention-input:submit`,{bubbles:!0,detail:{value:this.value}}))):e.key===`Backspace`&&this._removeWholeMention(e)}_removeWholeMention(e){let t=this._requireControl();if(t.selectionStart!==t.selectionEnd)return;let n=t.selectionStart,r=this._mentions.find(e=>e.end===n);r&&(e.preventDefault(),this._replace(r.start,r.end,``))}_onMenuClick(e){let t=e.target instanceof Element?e.target.closest(`.wui-mention-option`):null;t&&this._pick(this._results[Number(t.dataset.index)])}_pick(e){if(!e||!this._query)return;let t=(0,h.mentionLabel)(e.label),{start:n,end:r}=this._query,i=this._text.slice(r),a=`@${t}${/^\s/.test(i)?``:` `}`;this._replace(n,r,a,{id:String(e.value),label:t}),this._announce((0,l.fillText)(T().mentioned,{label:t}))}_replace(e,t,n,r){let i=this._requireControl(),a=n.length-(t-e);this._mentions=this._mentions.filter(n=>n.end<=e||n.start>=t).map(e=>e.start>=t?{...e,start:e.start+a,end:e.end+a}:e),r&&this._mentions.push({start:e,end:e+1+r.label.length,id:r.id,label:r.label}),this._text=this._text.slice(0,e)+n+this._text.slice(t),i.value=this._text;let o=e+n.length;i.setSelectionRange(o,o),this._close(),i.focus(),this._emit()}_onFocusOut(e){e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||this._close()}_announce(e){let t=this.querySelector(k);t&&(t.textContent=``,t.textContent=e)}},I=`[data-wui-items]`,L=`[data-wui-picker]`,R=`[data-wui-composer]`,z=`[data-wui-comment]`,B=`[data-wui-live]`,V=()=>(0,l.readText)(`commentThread`,y),H=e=>({forbidden:V().forbiddenMessage,networkCheck:(0,l.readText)(`httpFailure`,u.HTTP_FAILURE_TEXT).networkCheckText,client:V().failedClientMessage,validation:V().validationMessage,server:V().failedServerMessage,network:(0,l.readText)(`httpFailure`,u.HTTP_FAILURE_TEXT).networkText})[e],U=e=>({post:V().donePostText,reply:V().doneReplyText,edit:V().doneEditText,delete:V().doneDeleteText,react:``})[e],W=e=>{let t=typeof e==`object`&&e&&`message`in e?e.message:void 0;return typeof t==`string`&&t?t:V().failedServerMessage},G=e=>e instanceof Element?e:null,K=e=>`disabled`in e&&e.disabled===!0,q=(e,t)=>{if(e==null)throw Error(`${t} missing`);return e},J=(e,t,n)=>{let r=e?.querySelector(t);return r instanceof n?r:null},Y=(e,t,n)=>{let r=e?.closest(t);return r instanceof n?r:null},X=(e,t,n)=>e?[...e.querySelectorAll(t)].filter(e=>e instanceof n):[],Z=class extends r.ElementBase{constructor(){super(),w(this,`_wired`,void 0),w(this,`_busy`,void 0),w(this,`_peopleProp`,void 0),w(this,`_pickerFor`,void 0),w(this,`_openers`,void 0),this._wired=!1,this._busy=!1,this._peopleProp=null,this._pickerFor=null,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onSubmitKey=this._onSubmitKey.bind(this)}connectedCallback(){if((0,i.hasOwn)(this,`people`)){let e=this.people;Reflect.deleteProperty(this,`people`),this.people=e}if(this._wired)return;this._wired=!0,this.addEventListener(`click`,this._onClick),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`wui:mention-input:submit`,this._onSubmitKey),customElements.upgrade(this);let e=J(this,`${R} wui-mention-input`,F);this._handPeople(e),this._applyComposerPlaceholder(e)}disconnectedCallback(){this._closePicker(!1)}get people(){return this._peopleProp?this._peopleProp:X(this,`:scope > [data-wui-people] > wui-option`,HTMLElement).map(e=>({value:e.getAttribute(`value`)??``,label:(e.textContent??``).trim(),description:e.getAttribute(`data-description`)||void 0,src:e.getAttribute(`data-src`)||void 0}))}set people(e){this._peopleProp=Array.isArray(e)?e:[];for(let e of this.querySelectorAll(`wui-mention-input`))e.people=this._peopleProp}_handPeople(e){!e||this.hasAttribute(`remote`)||this.hasAttribute(`source`)||(e.people=this.people)}_applyComposerPlaceholder(e){let t=this.getAttribute(`composer-placeholder`);e&&t!=null&&e.setAttribute(`placeholder`,t)}_reactionChoices(){let e=this.getAttribute(`reaction-choices`),t=e?e.split(/\s+/).filter(Boolean):[];return t.length?t:_}_onClick(e){let t=Y(G(e.target),`[data-wui-emoji]`,HTMLElement);if(t&&this.contains(t)&&!K(t)){let e=t.closest(L),n=e?this._pickerFor?.comment:t.closest(z);e&&this._closePicker(!0),n&&this._react(n,t.getAttribute(`data-wui-emoji`));return}let n=Y(G(e.target),`[data-wui-action]`,HTMLElement);if(!n||!this.contains(n)||K(n))return;let r=n.closest(z);switch(n.getAttribute(`data-wui-action`)){case`reply`:this._openReply(r,n);break;case`edit`:this._openEditor(r,n);break;case`delete`:this._askDelete(r);break;case`cancel-delete`:this._closeConfirm(r,!0);break;case`confirm-delete`:{let e=q(r,`comment`);this._send(`delete`,{commentId:e.getAttribute(`data-wui-comment`)},{comment:e,scope:e});break}case`react-menu`:this._pickerFor?.button===n?this._closePicker(!0):this._openPicker(r,n);break;case`cancel`:this._closeSlot(Y(n,`[data-wui-reply], [data-wui-editor]`,HTMLElement),!0);break;case`post`:case`send`:this._sendFrom(n)}}_onKeyDown(e){let t=J(this,L,HTMLElement),n=G(e.target),r=(0,o.mirrorKey)(e.key,(0,o.isRtl)(this));if(this._pickerFor&&t?.contains(n)){let i=X(t,`[data-wui-emoji]`,HTMLElement),a=n instanceof HTMLElement?i.indexOf(n):-1;e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),this._closePicker(!0)):r===`ArrowRight`||r===`ArrowLeft`?(e.preventDefault(),i[(a+(r===`ArrowRight`?1:-1)+i.length)%i.length]?.focus()):e.key===`Tab`&&this._closePicker(!1);return}if(e.key!==`Escape`)return;let i=Y(n,`[data-wui-reply], [data-wui-editor]`,HTMLElement);if(i&&this.contains(i)){e.preventDefault(),e.stopPropagation(),this._closeSlot(i,!0);return}let a=Y(n,`[data-wui-comment-confirm]`,HTMLElement);a&&(e.preventDefault(),e.stopPropagation(),this._closeConfirm(a.closest(z),!0))}_onSubmitKey(e){let t=J(Y(G(e.target),`[data-wui-reply], [data-wui-editor], [data-wui-composer]`,HTMLElement),`[data-wui-action="send"], [data-wui-action="post"]`,HTMLElement);t&&!K(t)&&this._sendFrom(t)}_openReply(e,t){if(this.hasAttribute(`no-replies`))return;let n=J(e,`:scope > [data-wui-reply]`,HTMLElement);if(!n)return;if(!n.hidden){n.querySelector(`wui-mention-input`)?.focus();return}let r=e?.querySelector(`.wui-comment-author`)?.textContent?.trim()||``;this._fillSlot(n,{label:(0,l.fillText)(V().replyToText,{author:r}),placeholder:V().replyPlaceholder,value:``,send:V().replyLabel,opener:t})}_openEditor(e,t){let n=J(e,`:scope > .wui-comment-row [data-wui-editor]`,HTMLElement);if(!n?.hidden)return;let r=J(q(n.parentElement,`comment row`),`:scope > [data-wui-text]`,HTMLElement);r&&(r.hidden=!0),this._fillSlot(n,{label:V().editCommentLabel,placeholder:``,value:e?.getAttribute(`data-value`)??``,send:V().saveLabel,opener:t})}_fillSlot(e,{label:t,placeholder:n,value:r,send:i,opener:a}){let o=this.ownerDocument,s=o.createElement(`wui-mention-input`);s.className=`wui-mention-input`,s.setAttribute(`label`,t),n&&s.setAttribute(`placeholder`,n),s.setAttribute(`rows`,`2`),s.setAttribute(`value`,r);for(let e of[`remote`,`source`,`min-chars`,`debounce`]){let t=this.getAttribute(e);t!=null&&s.setAttribute(e,t)}let c=o.createElement(`div`);c.className=`wui-comment-form-actions`,c.append(this._button(`primary`,`solid`,`sm`,`send`,i),this._button(`primary`,`ghost`,`sm`,`cancel`,V().cancelLabel));let l=o.createElement(`div`);l.className=`wui-comment-error`,l.setAttribute(`data-wui-error`,``),l.hidden=!0,e.replaceChildren(s,c,l),this._handPeople(s),e.hidden=!1,this._openers??=new WeakMap,this._openers.set(e,a),s.focus();let u=s.querySelector(`textarea`);u?.setSelectionRange(u.value.length,u.value.length)}_button(e,t,r,i,a){let o=this.ownerDocument.createElement(`button`);return o.type=`button`,o.className=(0,n.buttonClass)(e,t,r),o.dataset.wui=n.APP_BUTTON_MARKER,o.setAttribute(`data-wui-action`,i),o.textContent=a,o}_closeSlot(e,t){if(!e||e.hidden)return;if(e.hidden=!0,e.replaceChildren(),e.hasAttribute(`data-wui-editor`)){let t=J(e.parentElement,`:scope > [data-wui-text]`,HTMLElement);t&&(t.hidden=!1)}let n=this._openers?.get(e);t&&n?.isConnected&&n.focus()}_askDelete(e){let t=J(e,`:scope > .wui-comment-row`,HTMLElement),n=J(t,`[data-wui-comment-confirm]`,HTMLElement),r=J(t,`[data-wui-actions]`,HTMLElement);n&&(n.hidden=!1,r&&(r.hidden=!0),J(n,`[data-wui-action="cancel-delete"]`,HTMLElement)?.focus())}_closeConfirm(e,t){let n=J(e,`:scope > .wui-comment-row`,HTMLElement),r=J(n,`[data-wui-comment-confirm]`,HTMLElement),i=J(n,`[data-wui-actions]`,HTMLElement);r&&(r.hidden=!0),i&&(i.hidden=!1),t&&J(i,`[data-wui-action="delete"]`,HTMLElement)?.focus()}_openPicker(e,t){let n=J(this,L,HTMLElement);n&&e&&!this.hasAttribute(`no-reactions`)&&(this._closePicker(!1),this._pickerFor={comment:e,button:t},t.setAttribute(`aria-expanded`,`true`),(0,a.openAnchoredPopover)(t,n,{mode:`auto`,onClosed:()=>this._pickerClosed()}),J(n,`[data-wui-emoji]`,HTMLElement)?.focus())}_closePicker(e){let t=this._pickerFor;if(!t)return;let n=J(this,L,HTMLElement);n&&(0,a.closeAnchoredPopover)(n),this._pickerClosed(),e&&t.button.isConnected&&t.button.focus()}_pickerClosed(){let e=J(this,L,HTMLElement),t=this._pickerFor;!t||e&&(0,a.isPopoverOpen)(e)||(this._pickerFor=null,t.button.setAttribute(`aria-expanded`,`false`))}_react(e,t){t&&!this.hasAttribute(`no-reactions`)&&this._send(`react`,{commentId:e.getAttribute(`data-wui-comment`),emoji:t},{comment:e,scope:e})}_sendFrom(e){let t=Y(e,`[data-wui-reply], [data-wui-editor], [data-wui-composer]`,HTMLElement);if(!t)return;let n=t.querySelector(`wui-mention-input`),r=n?.value??``;if(!r.trim()){this._showError(t,V().emptyBodyMessage),n?.focus();return}let i=t.closest(z);t.hasAttribute(`data-wui-composer`)?this._send(`post`,{body:r},{scope:t,form:t}):t.hasAttribute(`data-wui-reply`)?this._send(`reply`,{parentId:q(i,`comment`).getAttribute(`data-wui-comment`),body:r},{comment:i,scope:t,form:t}):this._send(`edit`,{commentId:q(i,`comment`).getAttribute(`data-wui-comment`),body:r},{comment:i,scope:t,form:t})}async _send(e,t,{comment:n,scope:r,form:i}){if(this._busy)return;this._busy=!0,this.setAttribute(`aria-busy`,`true`);let a=i??J(n,`:scope > .wui-comment-row`,HTMLElement)??this;this._showError(a,null);let o=[...r.querySelectorAll(`button, textarea`)].filter(e=>e instanceof HTMLButtonElement||e instanceof HTMLTextAreaElement).filter(e=>!e.disabled);for(let e of o)e.disabled=!0;let s=await this._persist({intent:e,...t});for(let e of o)e.isConnected&&(e.disabled=!1);this._busy=!1,this.removeAttribute(`aria-busy`);let c=t.commentId??null,l=t.parentId??null;s.ok?(s.html!=null&&this._swapItems(s.html),e===`post`?i?.querySelector(`wui-mention-input`)?.clear():i?.isConnected&&this._closeSlot(i,!1),e===`delete`&&n?.isConnected&&this._closeConfirm(n,!1),this._restoreFocus(e,t,i),U(e)&&this._announce(U(e)),this.dispatchEvent(new CustomEvent(`wui:comment-thread:done`,{bubbles:!0,detail:{intent:e,commentId:c,parentId:l}}))):s.kind!==`session`&&s.kind!==`aborted`&&(this._showError(a.isConnected?a:this,s.message),this._announce(s.message),this.dispatchEvent(new CustomEvent(`wui:comment-thread:failed`,{bubbles:!0,detail:{intent:e,kind:s.kind,message:s.message}})))}async _persist(e){if(this.hasAttribute(`controlled`)){if(typeof this.submit!=`function`)return{ok:!0,html:null};try{return await this.submit(e),{ok:!0,html:null}}catch(e){return{ok:!1,kind:`server`,message:W(e)}}}let t=this.getAttribute(`action`);if(!t)return{ok:!1,kind:`client`,message:V().failedClientMessage};let n=new URLSearchParams;for(let[t,r]of Object.entries(e))r!=null&&n.set(t,r);let r=await(0,c.wuiFetch)(t,{method:`POST`,body:n});return r.ok?{ok:!0,html:r.html}:{ok:!1,kind:r.kind,message:r.message||H(r.kind)||V().failedServerMessage}}_swapItems(e){let t=J(this,I,HTMLElement);if(!t||!e.trim())return;let n=(0,s.parseServerHtml)(e),r=J(n,I,HTMLElement);t.replaceChildren(...r?r.childNodes:n.childNodes)}_restoreFocus(e,t,n){let r=this.ownerDocument,i=r.activeElement;if(i&&i!==r.body&&i.isConnected&&this.contains(i)&&!K(i))return;let a=e=>e?X(this,z,HTMLElement).find(t=>t.getAttribute(`data-wui-comment`)===e):null,o=e=>J(a(e),`:scope > .wui-comment-row`,HTMLElement),s=null;if(e===`post`)s=n?.querySelector(`textarea`);else if(e===`reply`)s=J(o(t.parentId),`[data-wui-action="reply"]`,HTMLElement);else if(e===`edit`)s=J(o(t.commentId),`[data-wui-action="edit"]`,HTMLElement);else if(e===`react`){let e=o(t.commentId);s=X(e,`button[data-wui-emoji]`,HTMLButtonElement).find(e=>e.getAttribute(`data-wui-emoji`)===t.emoji)??J(e,`[data-wui-action="react-menu"]`,HTMLElement)}s??=J(this,`${R} textarea`,HTMLTextAreaElement),s?.focus()}_showError(e,t){let n=J(e,`:scope > [data-wui-error], :scope > .wui-comment-main > [data-wui-error]`,HTMLElement);n&&(n.textContent=t||``,n.hidden=!t)}_announce(e){let t=J(this,`:scope > ${B}`,HTMLElement);t&&e&&(t.textContent=``,t.textContent=e)}};(0,t.defineElement)(`wui-mention-input`,F),(0,t.defineElement)(`wui-comment-thread`,Z),e.COMMENT_INTENTS=v,e.COMMENT_REACTIONS=_,e.WuiCommentThread=Z})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.buttonClass,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.hasOwn,WeborityUiElementsInternal.modules.nativeOverlay,WeborityUiElementsInternal.modules.rtl,WeborityUiElementsInternal.modules.serverHtml,WeborityUiElementsInternal.modules.wuiHttp,WeborityUiElementsInternal.modules.textStore,WeborityUiElementsInternal.modules.httpFailureText,WeborityUiElementsInternal.modules.fieldState,WeborityUiElementsInternal.modules.formatters,WeborityUiElementsInternal.modules.imeSafeEnter,WeborityUiElementsInternal.modules.listboxKeyNav,WeborityUiElementsInternal.modules.mentionText);
1
+ (function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var g=globalThis.WeborityUiElementsInternal?.version;if(g!==`0.178.0`)throw Error(`[webority-ui] comment-thread expects ui-elements 0.178.0 but the page loaded `+g+`.`);var _=Object.freeze([`👍`,`❤️`,`🎉`,`😄`,`👀`,`🙏`]),v=Object.freeze([`post`,`reply`,`edit`,`delete`,`react`]),y={addReactionLabel:`Add a reaction`,attachmentsLabel:`Attachments`,cancelLabel:`Cancel`,chooseReactionLabel:`Choose a reaction`,composerLabel:`Add a comment`,composerPlaceholder:`Write a comment. Type @ to mention someone.`,deleteConfirmText:`Delete this comment?`,deleteLabel:`Delete`,deletedText:`This comment was deleted.`,doneDeleteText:`Comment deleted.`,doneEditText:`Comment saved.`,donePostText:`Comment posted.`,doneReplyText:`Reply posted.`,editCommentLabel:`Edit comment`,editLabel:`Edit`,editedLabel:`Edited`,emptyBodyMessage:`Write something first.`,failedClientMessage:`This did not go through. Refresh the page and try again.`,failedServerMessage:`Something went wrong on our side. Try again in a moment.`,forbiddenMessage:`You do not have permission to do this.`,internalLabel:`Internal note`,label:`Comments`,noCommentsText:`No comments yet.`,peopleLabel:`People`,postLabel:`Comment`,reactionsLabel:`Reactions`,repliesToLabel:`Replies to {name}`,replyLabel:`Reply`,replyPlaceholder:`Write a reply`,replyToText:`Reply to {author}`,saveLabel:`Save`,validationMessage:`This was not accepted. Check it and try again.`},b={foundTextOne:`1 person. Up and down to choose, Enter to mention.`,foundTextOther:`{count} people. Up and down to choose, Enter to mention.`,helpLabel:`More information`,listNameLabel:`People`,mentioned:`Mentioned {label}.`,noMatchLabel:`No one matches`,searchFailedMessage:`Couldn't load people. Keep typing to try again.`,searchingLabel:`Searching…`};function x(e){"@babel/helpers - typeof";return x=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},x(e)}function S(e,t){if(x(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(x(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function C(e){var t=S(e,`string`);return x(t)==`symbol`?t:t+``}function w(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T=()=>(0,l.readText)(`mentionInput`,b),E=`[data-wui-control]`,D=`[data-wui-field]`,O=`[data-wui-menu]`,k=`[data-wui-live]`,A=0,j=e=>!!(e&&h.MENTION_ID_PATTERN.test(String(e.value??``))&&(0,h.mentionLabel)(e.label)!==``);function M(e,t){let n=e.getAttribute(`size`);t.classList.toggle(`wui-input-sm`,n===`sm`),t.classList.toggle(`wui-input-lg`,n===`lg`),t.classList.toggle(`wui-input-xl`,n===`xl`)}function N(e,t){t.readOnly=(0,d.isReadOnly)(e)||e.hasAttribute(`loading`)}function P(e){let t=e.ownerDocument;e.id||=`wui-mention-${++A}`;let n=t.createElement(`textarea`);n.id=`${e.id}-text`,n.className=`form-control wui-mention-input-text`,n.rows=Number(e.getAttribute(`rows`))>0?Number(e.getAttribute(`rows`)):3,n.setAttribute(`data-wui-control`,``),n.setAttribute(`aria-autocomplete`,`list`),n.setAttribute(`aria-controls`,`${e.id}-people`);let r=e.getAttribute(`label`);r&&n.setAttribute(`aria-label`,r);let i=e.getAttribute(`placeholder`);i&&(n.placeholder=i);for(let t of[`aria-describedby`,`aria-invalid`]){let r=e.getAttribute(t);r&&n.setAttribute(t,r)}n.disabled=e.hasAttribute(`disabled`),N(e,n),M(e,n),e.appendChild(n);let a=e.getAttribute(`name`);if(a){let n=t.createElement(`input`);n.type=`hidden`,n.name=a,n.value=e.getAttribute(`value`)??``,n.setAttribute(`data-wui-field`,``),e.appendChild(n)}let o=t.createElement(`div`);o.className=`wui-mention-menu`,o.id=`${e.id}-people`,o.setAttribute(`role`,`listbox`),o.setAttribute(`aria-label`,e.getAttribute(`people-label`)??T().listNameLabel),o.setAttribute(`data-wui-menu`,``),o.setAttribute(`popover`,`manual`),e.appendChild(o);let s=t.createElement(`span`);s.className=`visually-hidden`,s.setAttribute(`data-wui-live`,``),s.setAttribute(`aria-live`,`polite`),s.setAttribute(`aria-atomic`,`true`),e.appendChild(s)}var F=class extends r.ElementBase{static get observedAttributes(){return[`disabled`,`readonly`,`loading`,`size`,`aria-invalid`,`aria-describedby`]}constructor(){super(),w(this,`_wired`,void 0),w(this,`_pendingValue`,void 0),w(this,`_text`,void 0),w(this,`_mentions`,void 0),w(this,`_peopleProp`,void 0),w(this,`_declared`,void 0),w(this,`_loading`,void 0),w(this,`_searchFailed`,void 0),w(this,`_query`,void 0),w(this,`_results`,void 0),w(this,`_active`,void 0),w(this,`_timer`,void 0),w(this,`_searchSeq`,void 0),w(this,`_lastSearch`,void 0),w(this,`_abort`,void 0),w(this,`_onMenuDown`,void 0),this._wired=!1,this._text=``,this._mentions=[],this._peopleProp=null,this._declared=null,this._loading=!1,this._searchFailed=!1,this._query=null,this._results=[],this._active=-1,this._timer=void 0,this._searchSeq=0,this._abort=null,this._onInput=this._onInput.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onCaret=this._onCaret.bind(this),this._onFocusOut=this._onFocusOut.bind(this),this._onMenuDown=e=>e.preventDefault(),this._onMenuClick=this._onMenuClick.bind(this)}connectedCallback(){for(let e of[`people`,`loading`,`searchFailed`,`value`])if((0,i.hasOwn)(this,e)){let t=Reflect.get(this,e);Reflect.deleteProperty(this,e),Reflect.set(this,e,t)}if(this._wired)return;this._wired=!0,this.querySelector(E)||P(this);let e=this._requireControl(),t=this.querySelector(D)?.value??this.getAttribute(`value`)??``;this._pendingValue===void 0?this._load(t):this._load(this._pendingValue),this._pendingValue=void 0,this._syncState(),e.addEventListener(`input`,this._onInput),e.addEventListener(`keydown`,this._onKeyDown),e.addEventListener(`click`,this._onCaret),e.addEventListener(`keyup`,this._onCaret),this.addEventListener(`focusout`,this._onFocusOut);let n=this._requireMenu();n.addEventListener(`mousedown`,this._onMenuDown),n.addEventListener(`click`,this._onMenuClick),n.addEventListener(`mousemove`,e=>{let t=e.target instanceof Element?e.target.closest(`.wui-mention-option`):null;t&&Number(t.dataset.index)!==this._active&&this._setActive(Number(t.dataset.index),{reveal:!1})})}disconnectedCallback(){this._close(),clearTimeout(this._timer),this._abort?.abort()}attributeChangedCallback(e,t,n){let r=this._control();r&&(e===`disabled`?(r.disabled=n!==null,n!==null&&this._close()):e===`readonly`?(N(this,r),n!==null&&this._close(),this._syncState()):e===`loading`?(N(this,r),this._syncState(),this._query!==null&&this._renderMenu()):e===`size`?M(this,r):n===null?r.removeAttribute(e):r.setAttribute(e,n))}get value(){return(0,h.mentionValueFromText)(this._text,this._mentions)}set value(e){let t=e==null?``:String(e);this._wired?t!==this.value&&this._load(t):this._pendingValue=t}get mentions(){let e=new Set,t=[];for(let n of[...this._mentions].sort((e,t)=>e.start-t.start))e.has(n.id)||(e.add(n.id),t.push({id:n.id,label:n.label}));return t}get people(){return this._peopleProp?this._peopleProp:(this._declared||=[...this.querySelectorAll(`[data-wui-people] > wui-option`)].map(e=>({value:e.getAttribute(`value`)??``,label:(e.textContent??``).trim(),description:e.getAttribute(`data-description`)||void 0,src:e.getAttribute(`data-src`)||void 0})),this._declared)}set people(e){this._peopleProp=Array.isArray(e)?e.filter(j):[],this._searchFailed=!1,(this._isOpen()||this._query!==null)&&this._refresh()}get searchFailed(){return this._searchFailed}set searchFailed(e){this._searchFailed=!!e,this._query!==null&&this._renderMenu()}get loading(){return this._loading||this.hasAttribute(`loading`)}set loading(e){this._loading=!!e,this.toggleAttribute(`loading`,this._loading),this._query!==null&&this._renderMenu()}focus(e){this._control()?.focus(e)}clear(){this._load(``),this._emit()}_control(){return this.querySelector(E)}_menu(){return this.querySelector(O)}_requireControl(){let e=this._control();if(!e)throw Error(`<wui-mention-input> has no text box.`);return e}_requireMenu(){let e=this._menu();if(!e)throw Error(`<wui-mention-input> has no people list.`);return e}_load(e){let{text:t,mentions:n}=(0,h.mentionTextFromValue)(e);this._text=t,this._mentions=n;let r=this._control();r&&(r.defaultValue=t,r.value=t),this._syncField(),this._close()}_syncField(){let e=this.querySelector(D);e&&(e.value=this.value)}_emit(){this._syncField(),this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,detail:{value:this.value,mentions:this.mentions}}))}_onInput(){let e=this._requireControl(),t=e.value,n=this._text,r=t.length-n.length,i=Math.min(n.length,t.length),a=Math.max(0,Math.min(i,e.selectionEnd-Math.max(r,0))),o=0;for(;o<a&&n[o]===t[o];)o++;let s=0;for(;s<i-o&&n[n.length-1-s]===t[t.length-1-s];)s++;let c=n.length-s;this._mentions=this._mentions.filter(e=>e.end<=o||e.start>=c).map(e=>e.start>=c?{...e,start:e.start+r,end:e.end+r}:e),this._text=t,this._emit(),this._onCaret()}_onCaret(e){if(e instanceof KeyboardEvent&&e.type===`keyup`&&[`ArrowUp`,`ArrowDown`,`Enter`,`Tab`,`Escape`].includes(e.key))return;let t=this._queryAtCaret();t?this._query&&t.text===this._query.text&&t.start===this._query.start||(this._query=t,this._refresh()):this._close()}_queryAtCaret(){let e=this._control();if(!e||(0,d.isInert)(this)||e.selectionStart!==e.selectionEnd)return null;let t=e.selectionStart,n=this._text,r=n.lastIndexOf(`@`,t-1);if(r<0||r>0&&!/[\s([{"'“‘]/.test(n.charAt(r-1)))return null;let i=n.slice(r+1,t);return i.length>40||/[\n@]/.test(i)||/^\s/.test(i)||/\s{2}/.test(i)||this._mentions.some(e=>r>=e.start&&r<e.end)?null:{start:r,end:t,text:i}}_refresh(){if(!this._query)return;let e=this.hasAttribute(`remote`)||this.hasAttribute(`source`);if(e&&this._query.text.length<this._minChars()){this._results=[],this._close();return}e&&!this._answered(this._query.text)&&this._search(this._query.text);let t=this._query.text.toLowerCase(),n=e?this.people:this.people.filter(e=>(0,h.mentionLabel)(e.label).toLowerCase().includes(t));this._results=n.slice(0,8),this._renderMenu()}_answered(e){return this._lastSearch===e}_minChars(){let e=this.getAttribute(`min-chars`),t=e==null||e===``?1:Number(e);return Number.isFinite(t)&&t>=0?t:1}_debounce(){let e=this.getAttribute(`debounce`),t=e==null||e===``?250:Number(e);return Number.isFinite(t)&&t>=0?t:250}_search(e){this._lastSearch=e,clearTimeout(this._timer);let t=++this._searchSeq;this._timer=setTimeout(()=>{let n=this.getAttribute(`source`);n?this._fetchPeople(n,e,t):this.dispatchEvent(new CustomEvent(`search`,{bubbles:!0,detail:{query:e,seq:t}}))},this._debounce())}async _fetchPeople(e,t,n){this._abort?.abort();let r=new AbortController;this._abort=r,this.loading=!0;let i=`${e}${e.includes(`?`)?`&`:`?`}q=${encodeURIComponent(t)}`,a=await(0,c.wuiFetch)(i,{signal:r.signal});if(n!==this._searchSeq)return;if(this._abort=null,!a.ok){this._peopleProp=[],this._searchFailed=!0,this.loading=!1,this._refresh();return}this._searchFailed=!1;let o=(0,s.parseServerHtml)(a.html);this._peopleProp=[...o.querySelectorAll(`wui-option`)].map(e=>({value:e.getAttribute(`value`)??``,label:(e.textContent??``).trim(),description:e.getAttribute(`data-description`)||void 0,src:e.getAttribute(`data-src`)||void 0})).filter(j),this.loading=!1,this._refresh()}_isOpen(){let e=this._menu();return e!==null&&(0,a.isPopoverOpen)(e)}_renderMenu(){let e=this._menu(),t=this._control();if(!e||!t||!this._query)return;this._syncState();let n=this.ownerDocument;if(e.replaceChildren(),this._results.forEach((t,r)=>{let i=n.createElement(`div`);if(i.className=`wui-mention-option`,i.id=`${e.id}-${r}`,i.setAttribute(`role`,`option`),i.setAttribute(`aria-selected`,`false`),i.dataset.index=String(r),t.src){let e=n.createElement(`img`);e.className=`wui-mention-option-photo`,e.src=t.src,e.alt=``,i.appendChild(e)}let a=n.createElement(`span`);a.className=`wui-mention-option-text`;let o=n.createElement(`span`);if(o.className=`wui-mention-option-label`,o.textContent=(0,h.mentionLabel)(t.label),a.appendChild(o),t.description){let e=n.createElement(`span`);e.className=`wui-mention-option-description`,e.textContent=String(t.description),a.appendChild(e)}i.appendChild(a),e.appendChild(i)}),!this._results.length){let t=n.createElement(`div`);t.className=`wui-mention-empty`,t.textContent=this.loading?T().searchingLabel:this._searchFailed?T().searchFailedMessage:`${T().noMatchLabel} “${this._query.text}”`,e.appendChild(t)}(0,a.openAnchoredPopover)(t,e,{mode:`manual`}),this._setActive(this._results.length?0:-1),this.loading||this._announce(this._results.length?(0,l.pluralText)(T(),`foundText`,this._results.length,{count:(0,f.formatNumber)(this._results.length,{decimals:0})}):this._searchFailed?T().searchFailedMessage:`${T().noMatchLabel}.`)}_syncState(){let e=this._control();e&&(0,d.syncFieldState)(this,e)}_close(){this._query=null,this._lastSearch=void 0,clearTimeout(this._timer);let e=this._menu();if(e){let t=(0,a.isPopoverOpen)(e);(0,a.closeAnchoredPopover)(e),t&&e.replaceChildren()}this._active=-1,this._control()?.removeAttribute(`aria-activedescendant`)}_setActive(e,{reveal:t=!0}={}){let n=this._requireMenu(),r=[...n.querySelectorAll(`.wui-mention-option`)];this._active=e>=0&&e<r.length?e:-1;let i=this._active>=0?r[this._active]??null:null;for(let e of r)e.setAttribute(`aria-selected`,e===i?`true`:`false`);(0,m.moveActiveRow)(n,i),i?(t&&i.scrollIntoView?.({block:`nearest`}),this._requireControl().setAttribute(`aria-activedescendant`,i.id)):this._requireControl().removeAttribute(`aria-activedescendant`)}_onKeyDown(e){if(this._isOpen()&&this._query){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=this._results.length;if(!t)return;let n=e.key===`ArrowDown`?1:-1;this._setActive((this._active+n+t)%t);return}if(((0,p.isImeSafeEnter)(e)||e.key===`Tab`)&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&this._active>=0){e.preventDefault(),this._pick(this._results[this._active]);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),this._close();return}}(0,p.isImeSafeEnter)(e)&&(e.ctrlKey||e.metaKey)?(e.preventDefault(),this.dispatchEvent(new CustomEvent(`wui:mention-input:submit`,{bubbles:!0,detail:{value:this.value}}))):e.key===`Backspace`&&this._removeWholeMention(e)}_removeWholeMention(e){let t=this._requireControl();if(t.selectionStart!==t.selectionEnd)return;let n=t.selectionStart,r=this._mentions.find(e=>e.end===n);r&&(e.preventDefault(),this._replace(r.start,r.end,``))}_onMenuClick(e){let t=e.target instanceof Element?e.target.closest(`.wui-mention-option`):null;t&&this._pick(this._results[Number(t.dataset.index)])}_pick(e){if(!e||!this._query)return;let t=(0,h.mentionLabel)(e.label),{start:n,end:r}=this._query,i=this._text.slice(r),a=`@${t}${/^\s/.test(i)?``:` `}`;this._replace(n,r,a,{id:String(e.value),label:t}),this._announce((0,l.fillText)(T().mentioned,{label:t}))}_replace(e,t,n,r){let i=this._requireControl(),a=n.length-(t-e);this._mentions=this._mentions.filter(n=>n.end<=e||n.start>=t).map(e=>e.start>=t?{...e,start:e.start+a,end:e.end+a}:e),r&&this._mentions.push({start:e,end:e+1+r.label.length,id:r.id,label:r.label}),this._text=this._text.slice(0,e)+n+this._text.slice(t),i.value=this._text;let o=e+n.length;i.setSelectionRange(o,o),this._close(),i.focus(),this._emit()}_onFocusOut(e){e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||this._close()}_announce(e){let t=this.querySelector(k);t&&(t.textContent=``,t.textContent=e)}},I=`[data-wui-items]`,L=`[data-wui-picker]`,R=`[data-wui-composer]`,z=`[data-wui-comment]`,B=`[data-wui-live]`,V=()=>(0,l.readText)(`commentThread`,y),H=e=>({forbidden:V().forbiddenMessage,networkCheck:(0,l.readText)(`httpFailure`,u.HTTP_FAILURE_TEXT).networkCheckText,client:V().failedClientMessage,validation:V().validationMessage,server:V().failedServerMessage,network:(0,l.readText)(`httpFailure`,u.HTTP_FAILURE_TEXT).networkText})[e],U=e=>({post:V().donePostText,reply:V().doneReplyText,edit:V().doneEditText,delete:V().doneDeleteText,react:``})[e],W=e=>{let t=typeof e==`object`&&e&&`message`in e?e.message:void 0;return typeof t==`string`&&t?t:V().failedServerMessage},G=e=>e instanceof Element?e:null,K=e=>`disabled`in e&&e.disabled===!0,q=(e,t)=>{if(e==null)throw Error(`${t} missing`);return e},J=(e,t,n)=>{let r=e?.querySelector(t);return r instanceof n?r:null},Y=(e,t,n)=>{let r=e?.closest(t);return r instanceof n?r:null},X=(e,t,n)=>e?[...e.querySelectorAll(t)].filter(e=>e instanceof n):[],Z=class extends r.ElementBase{constructor(){super(),w(this,`_wired`,void 0),w(this,`_busy`,void 0),w(this,`_peopleProp`,void 0),w(this,`_pickerFor`,void 0),w(this,`_openers`,void 0),this._wired=!1,this._busy=!1,this._peopleProp=null,this._pickerFor=null,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onSubmitKey=this._onSubmitKey.bind(this)}connectedCallback(){if((0,i.hasOwn)(this,`people`)){let e=this.people;Reflect.deleteProperty(this,`people`),this.people=e}if(this._wired)return;this._wired=!0,this.addEventListener(`click`,this._onClick),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`wui:mention-input:submit`,this._onSubmitKey),customElements.upgrade(this);let e=J(this,`${R} wui-mention-input`,F);this._handPeople(e),this._applyComposerPlaceholder(e)}disconnectedCallback(){this._closePicker(!1)}get people(){return this._peopleProp?this._peopleProp:X(this,`:scope > [data-wui-people] > wui-option`,HTMLElement).map(e=>({value:e.getAttribute(`value`)??``,label:(e.textContent??``).trim(),description:e.getAttribute(`data-description`)||void 0,src:e.getAttribute(`data-src`)||void 0}))}set people(e){this._peopleProp=Array.isArray(e)?e:[];for(let e of this.querySelectorAll(`wui-mention-input`))e.people=this._peopleProp}_handPeople(e){!e||this.hasAttribute(`remote`)||this.hasAttribute(`source`)||(e.people=this.people)}_applyComposerPlaceholder(e){let t=this.getAttribute(`composer-placeholder`);e&&t!=null&&e.setAttribute(`placeholder`,t)}_reactionChoices(){let e=this.getAttribute(`reaction-choices`),t=e?e.split(/\s+/).filter(Boolean):[];return t.length?t:_}_onClick(e){let t=Y(G(e.target),`[data-wui-emoji]`,HTMLElement);if(t&&this.contains(t)&&!K(t)){let e=t.closest(L),n=e?this._pickerFor?.comment:t.closest(z);e&&this._closePicker(!0),n&&this._react(n,t.getAttribute(`data-wui-emoji`));return}let n=Y(G(e.target),`[data-wui-action]`,HTMLElement);if(!n||!this.contains(n)||K(n))return;let r=n.closest(z);switch(n.getAttribute(`data-wui-action`)){case`reply`:this._openReply(r,n);break;case`edit`:this._openEditor(r,n);break;case`delete`:this._askDelete(r);break;case`cancel-delete`:this._closeConfirm(r,!0);break;case`confirm-delete`:{let e=q(r,`comment`);this._send(`delete`,{commentId:e.getAttribute(`data-wui-comment`)},{comment:e,scope:e});break}case`react-menu`:this._pickerFor?.button===n?this._closePicker(!0):this._openPicker(r,n);break;case`cancel`:this._closeSlot(Y(n,`[data-wui-reply], [data-wui-editor]`,HTMLElement),!0);break;case`post`:case`send`:this._sendFrom(n)}}_onKeyDown(e){let t=J(this,L,HTMLElement),n=G(e.target),r=(0,o.mirrorKey)(e.key,(0,o.isRtl)(this));if(this._pickerFor&&t?.contains(n)){let i=X(t,`[data-wui-emoji]`,HTMLElement),a=n instanceof HTMLElement?i.indexOf(n):-1;e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),this._closePicker(!0)):r===`ArrowRight`||r===`ArrowLeft`?(e.preventDefault(),i[(a+(r===`ArrowRight`?1:-1)+i.length)%i.length]?.focus()):e.key===`Tab`&&this._closePicker(!1);return}if(e.key!==`Escape`)return;let i=Y(n,`[data-wui-reply], [data-wui-editor]`,HTMLElement);if(i&&this.contains(i)){e.preventDefault(),e.stopPropagation(),this._closeSlot(i,!0);return}let a=Y(n,`[data-wui-comment-confirm]`,HTMLElement);a&&(e.preventDefault(),e.stopPropagation(),this._closeConfirm(a.closest(z),!0))}_onSubmitKey(e){let t=J(Y(G(e.target),`[data-wui-reply], [data-wui-editor], [data-wui-composer]`,HTMLElement),`[data-wui-action="send"], [data-wui-action="post"]`,HTMLElement);t&&!K(t)&&this._sendFrom(t)}_openReply(e,t){if(this.hasAttribute(`no-replies`))return;let n=J(e,`:scope > [data-wui-reply]`,HTMLElement);if(!n)return;if(!n.hidden){n.querySelector(`wui-mention-input`)?.focus();return}let r=e?.querySelector(`.wui-comment-author`)?.textContent?.trim()||``;this._fillSlot(n,{label:(0,l.fillText)(V().replyToText,{author:r}),placeholder:V().replyPlaceholder,value:``,send:V().replyLabel,opener:t})}_openEditor(e,t){let n=J(e,`:scope > .wui-comment-row [data-wui-editor]`,HTMLElement);if(!n?.hidden)return;let r=J(q(n.parentElement,`comment row`),`:scope > [data-wui-text]`,HTMLElement);r&&(r.hidden=!0),this._fillSlot(n,{label:V().editCommentLabel,placeholder:``,value:e?.getAttribute(`data-value`)??``,send:V().saveLabel,opener:t})}_fillSlot(e,{label:t,placeholder:n,value:r,send:i,opener:a}){let o=this.ownerDocument,s=o.createElement(`wui-mention-input`);s.className=`wui-mention-input`,s.setAttribute(`label`,t),n&&s.setAttribute(`placeholder`,n),s.setAttribute(`rows`,`2`),s.setAttribute(`value`,r);for(let e of[`remote`,`source`,`min-chars`,`debounce`]){let t=this.getAttribute(e);t!=null&&s.setAttribute(e,t)}let c=o.createElement(`div`);c.className=`wui-comment-form-actions`,c.append(this._button(`primary`,`solid`,`sm`,`send`,i),this._button(`primary`,`ghost`,`sm`,`cancel`,V().cancelLabel));let l=o.createElement(`div`);l.className=`wui-comment-error`,l.setAttribute(`data-wui-error`,``),l.hidden=!0,e.replaceChildren(s,c,l),this._handPeople(s),e.hidden=!1,this._openers??=new WeakMap,this._openers.set(e,a),s.focus();let u=s.querySelector(`textarea`);u?.setSelectionRange(u.value.length,u.value.length)}_button(e,t,r,i,a){let o=this.ownerDocument.createElement(`button`);return o.type=`button`,o.className=(0,n.buttonClass)(e,t,r),o.dataset.wui=n.APP_BUTTON_MARKER,o.setAttribute(`data-wui-action`,i),o.textContent=a,o}_closeSlot(e,t){if(!e||e.hidden)return;if(e.hidden=!0,e.replaceChildren(),e.hasAttribute(`data-wui-editor`)){let t=J(e.parentElement,`:scope > [data-wui-text]`,HTMLElement);t&&(t.hidden=!1)}let n=this._openers?.get(e);t&&n?.isConnected&&n.focus()}_askDelete(e){let t=J(e,`:scope > .wui-comment-row`,HTMLElement),n=J(t,`[data-wui-comment-confirm]`,HTMLElement),r=J(t,`[data-wui-actions]`,HTMLElement);n&&(n.hidden=!1,r&&(r.hidden=!0),J(n,`[data-wui-action="cancel-delete"]`,HTMLElement)?.focus())}_closeConfirm(e,t){let n=J(e,`:scope > .wui-comment-row`,HTMLElement),r=J(n,`[data-wui-comment-confirm]`,HTMLElement),i=J(n,`[data-wui-actions]`,HTMLElement);r&&(r.hidden=!0),i&&(i.hidden=!1),t&&J(i,`[data-wui-action="delete"]`,HTMLElement)?.focus()}_openPicker(e,t){let n=J(this,L,HTMLElement);n&&e&&!this.hasAttribute(`no-reactions`)&&(this._closePicker(!1),this._pickerFor={comment:e,button:t},t.setAttribute(`aria-expanded`,`true`),(0,a.openAnchoredPopover)(t,n,{mode:`auto`,onClosed:()=>this._pickerClosed()}),J(n,`[data-wui-emoji]`,HTMLElement)?.focus())}_closePicker(e){let t=this._pickerFor;if(!t)return;let n=J(this,L,HTMLElement);n&&(0,a.closeAnchoredPopover)(n),this._pickerClosed(),e&&t.button.isConnected&&t.button.focus()}_pickerClosed(){let e=J(this,L,HTMLElement),t=this._pickerFor;!t||e&&(0,a.isPopoverOpen)(e)||(this._pickerFor=null,t.button.setAttribute(`aria-expanded`,`false`))}_react(e,t){t&&!this.hasAttribute(`no-reactions`)&&this._send(`react`,{commentId:e.getAttribute(`data-wui-comment`),emoji:t},{comment:e,scope:e})}_sendFrom(e){let t=Y(e,`[data-wui-reply], [data-wui-editor], [data-wui-composer]`,HTMLElement);if(!t)return;let n=t.querySelector(`wui-mention-input`),r=n?.value??``;if(!r.trim()){this._showError(t,V().emptyBodyMessage),n?.focus();return}let i=t.closest(z);t.hasAttribute(`data-wui-composer`)?this._send(`post`,{body:r},{scope:t,form:t}):t.hasAttribute(`data-wui-reply`)?this._send(`reply`,{parentId:q(i,`comment`).getAttribute(`data-wui-comment`),body:r},{comment:i,scope:t,form:t}):this._send(`edit`,{commentId:q(i,`comment`).getAttribute(`data-wui-comment`),body:r},{comment:i,scope:t,form:t})}async _send(e,t,{comment:n,scope:r,form:i}){if(this._busy)return;this._busy=!0,this.setAttribute(`aria-busy`,`true`);let a=i??J(n,`:scope > .wui-comment-row`,HTMLElement)??this;this._showError(a,null);let o=[...r.querySelectorAll(`button, textarea`)].filter(e=>e instanceof HTMLButtonElement||e instanceof HTMLTextAreaElement).filter(e=>!e.disabled);for(let e of o)e.disabled=!0;let s=await this._persist({intent:e,...t});for(let e of o)e.isConnected&&(e.disabled=!1);this._busy=!1,this.removeAttribute(`aria-busy`);let c=t.commentId??null,l=t.parentId??null;s.ok?(s.html!=null&&this._swapItems(s.html),e===`post`?i?.querySelector(`wui-mention-input`)?.clear():i?.isConnected&&this._closeSlot(i,!1),e===`delete`&&n?.isConnected&&this._closeConfirm(n,!1),this._restoreFocus(e,t,i),U(e)&&this._announce(U(e)),this.dispatchEvent(new CustomEvent(`wui:comment-thread:done`,{bubbles:!0,detail:{intent:e,commentId:c,parentId:l}}))):s.kind!==`session`&&s.kind!==`aborted`&&(this._showError(a.isConnected?a:this,s.message),this._announce(s.message),this.dispatchEvent(new CustomEvent(`wui:comment-thread:failed`,{bubbles:!0,detail:{intent:e,kind:s.kind,message:s.message}})))}async _persist(e){if(this.hasAttribute(`controlled`)){if(typeof this.submit!=`function`)return{ok:!0,html:null};try{return await this.submit(e),{ok:!0,html:null}}catch(e){return{ok:!1,kind:`server`,message:W(e)}}}let t=this.getAttribute(`action`);if(!t)return{ok:!1,kind:`client`,message:V().failedClientMessage};let n=new URLSearchParams;for(let[t,r]of Object.entries(e))r!=null&&n.set(t,r);let r=await(0,c.wuiFetch)(t,{method:`POST`,body:n});return r.ok?{ok:!0,html:r.html}:{ok:!1,kind:r.kind,message:r.message||H(r.kind)||V().failedServerMessage}}_swapItems(e){let t=J(this,I,HTMLElement);if(!t||!e.trim())return;let n=(0,s.parseServerHtml)(e),r=J(n,I,HTMLElement);t.replaceChildren(...r?r.childNodes:n.childNodes)}_restoreFocus(e,t,n){let r=this.ownerDocument,i=r.activeElement;if(i&&i!==r.body&&i.isConnected&&this.contains(i)&&!K(i))return;let a=e=>e?X(this,z,HTMLElement).find(t=>t.getAttribute(`data-wui-comment`)===e):null,o=e=>J(a(e),`:scope > .wui-comment-row`,HTMLElement),s=null;if(e===`post`)s=n?.querySelector(`textarea`);else if(e===`reply`)s=J(o(t.parentId),`[data-wui-action="reply"]`,HTMLElement);else if(e===`edit`)s=J(o(t.commentId),`[data-wui-action="edit"]`,HTMLElement);else if(e===`react`){let e=o(t.commentId);s=X(e,`button[data-wui-emoji]`,HTMLButtonElement).find(e=>e.getAttribute(`data-wui-emoji`)===t.emoji)??J(e,`[data-wui-action="react-menu"]`,HTMLElement)}s??=J(this,`${R} textarea`,HTMLTextAreaElement),s?.focus()}_showError(e,t){let n=J(e,`:scope > [data-wui-error], :scope > .wui-comment-main > [data-wui-error]`,HTMLElement);n&&(n.textContent=t||``,n.hidden=!t)}_announce(e){let t=J(this,`:scope > ${B}`,HTMLElement);t&&e&&(t.textContent=``,t.textContent=e)}};(0,t.defineElement)(`wui-mention-input`,F),(0,t.defineElement)(`wui-comment-thread`,Z),e.COMMENT_INTENTS=v,e.COMMENT_REACTIONS=_,e.WuiCommentThread=Z})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.buttonClass,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.hasOwn,WeborityUiElementsInternal.modules.nativeOverlay,WeborityUiElementsInternal.modules.rtl,WeborityUiElementsInternal.modules.serverHtml,WeborityUiElementsInternal.modules.wuiHttp,WeborityUiElementsInternal.modules.textStore,WeborityUiElementsInternal.modules.httpFailureText,WeborityUiElementsInternal.modules.fieldState,WeborityUiElementsInternal.modules.formatters,WeborityUiElementsInternal.modules.imeSafeEnter,WeborityUiElementsInternal.modules.listboxKeyNav,WeborityUiElementsInternal.modules.mentionText);