@webority/ui-elements 0.174.0 → 0.175.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 (183) hide show
  1. package/dist/{WuiCarousel-CFKmFVzc.js → WuiCarousel-B0yPDH5I.js} +1 -1
  2. package/dist/WuiCodeBlock-BWYZ1S70.js +1 -0
  3. package/dist/{WuiCommandPalette-BQCy0bon.js → WuiCommandPalette-u1XD5WMv.js} +2 -2
  4. package/dist/WuiCommentThread-C5n933uz.js +1 -0
  5. package/dist/{WuiConsentBanner-DlAE3DTf.js → WuiConsentBanner-nTua-kEd.js} +1 -1
  6. package/dist/WuiContextMenu-DEWYYFRG.js +1 -0
  7. package/dist/{WuiDataTable-B-JaTsrI.js → WuiDataTable-Ble3hl5L.js} +1 -1
  8. package/dist/{WuiDatePicker-4tdWakGX.js → WuiDatePicker-3D33rzH4.js} +1 -1
  9. package/dist/{WuiDateRange-D7LJuY2F.js → WuiDateRange-qTncGobM.js} +1 -1
  10. package/dist/{WuiDateTime-BSJfyZ0q.js → WuiDateTime-Vimu6grS.js} +1 -1
  11. package/dist/{WuiDrawer-D-XfW1kl.js → WuiDrawer-BsY0fs_u.js} +1 -1
  12. package/dist/{WuiDropdown-5-6E5Q9d.js → WuiDropdown-6g074v1T.js} +1 -1
  13. package/dist/WuiGantt-BqNhYIr6.js +1 -0
  14. package/dist/{WuiImageCrop-CIAjHOGk.js → WuiImageCrop-UakcSM2k.js} +1 -1
  15. package/dist/{WuiInlineEdit-C9FxCWCk.js → WuiInlineEdit-BwB-w61N.js} +1 -1
  16. package/dist/{WuiLeadPopup-KyguGV-q.js → WuiLeadPopup-DaYZ2zCJ.js} +1 -1
  17. package/dist/{WuiLightbox-CBiqJmGE.js → WuiLightbox-DpHJAMO3.js} +1 -1
  18. package/dist/WuiMentionInput-DJv-WwW6.js +1 -0
  19. package/dist/{WuiNotificationCenter-DZariS2K.js → WuiNotificationCenter-1Hw7W0st.js} +1 -1
  20. package/dist/{WuiOrgTree-CFxoY9Vr.js → WuiOrgTree-DWSk_LHd.js} +1 -1
  21. package/dist/{WuiOverflow-CXYk2ubC.js → WuiOverflow-fZKqdsr-.js} +1 -1
  22. package/dist/{WuiPhone-BI438y4S.js → WuiPhone-CBge7oVA.js} +1 -1
  23. package/dist/{WuiRecordPager-DAyoD650.js → WuiRecordPager-BXoe4KfU.js} +1 -1
  24. package/dist/{WuiRelativeTime-CPzs4tjM.js → WuiRelativeTime-CSg9vzfk.js} +1 -1
  25. package/dist/{WuiSavedViews-BAqHgVj2.js → WuiSavedViews-OjB-ZiCo.js} +1 -1
  26. package/dist/WuiSelect-D89S-POU.js +1 -0
  27. package/dist/{WuiShortcuts-DWzmRKEG.js → WuiShortcuts-CRCctX82.js} +1 -1
  28. package/dist/{WuiShowMore-DyfGnrob.js → WuiShowMore-BoYCrYYf.js} +1 -1
  29. package/dist/{WuiSlider-LE2wquOo.js → WuiSlider-R_mTula0.js} +1 -1
  30. package/dist/{WuiSortable-DxwYjicc.js → WuiSortable-x8Mg0tOv.js} +1 -1
  31. package/dist/{WuiTimePicker-xrPYytjq.js → WuiTimePicker-DYLFaWDc.js} +1 -1
  32. package/dist/{WuiTour-D-H5sMJS.js → WuiTour-BU00-6Lf.js} +1 -1
  33. package/dist/WuiTree-CIOM1G59.js +1 -0
  34. package/dist/WuiTreePicker-DLddmEgG.js +1 -0
  35. package/dist/{WuiWizardStep-n8Ge5GDI.js → WuiWizardStep-gFtuUzsL.js} +1 -1
  36. package/dist/buttonClass-C8BRtTk8.js +1 -0
  37. package/dist/{calendarMath-rI1aBVRd.js → calendarMath-CT99RyhR.js} +1 -1
  38. package/dist/chips-_rw5Aev4.js +2 -0
  39. package/dist/copyText-sHWcpcPm.js +1 -0
  40. package/dist/{country-B7jmc--B.js → country-T7AfpJpN.js} +1 -1
  41. package/dist/{customRule-BXJdj57A.js → customRule-BpwcjVLb.js} +1 -1
  42. package/dist/{dataTable-Bz6HxUx0.js → dataTable-VB3nBucm.js} +1 -1
  43. package/dist/drawerDiscard-D_n8guAp.js +1 -0
  44. package/dist/elements/carousel.js +1 -1
  45. package/dist/elements/code-block.js +1 -1
  46. package/dist/elements/command-palette.js +1 -1
  47. package/dist/elements/comment-thread.js +1 -1
  48. package/dist/elements/consent-banner.js +1 -1
  49. package/dist/elements/context-menu.js +1 -1
  50. package/dist/elements/data-table.js +1 -1
  51. package/dist/elements/date-range.js +1 -1
  52. package/dist/elements/date-time.js +1 -1
  53. package/dist/elements/datepicker.js +1 -1
  54. package/dist/elements/drawer.js +1 -1
  55. package/dist/elements/dropdown.js +1 -1
  56. package/dist/elements/filter-popover.js +1 -1
  57. package/dist/elements/gantt.js +1 -1
  58. package/dist/elements/image-crop.js +1 -1
  59. package/dist/elements/inline-edit.js +1 -1
  60. package/dist/elements/kanban.js +1 -1
  61. package/dist/elements/lead-popup.js +1 -1
  62. package/dist/elements/lightbox.js +1 -1
  63. package/dist/elements/mention-input.js +1 -1
  64. package/dist/elements/notification-center.js +1 -1
  65. package/dist/elements/org-tree.js +1 -1
  66. package/dist/elements/overflow.js +1 -1
  67. package/dist/elements/phone.js +1 -1
  68. package/dist/elements/record-pager.js +1 -1
  69. package/dist/elements/relative-time.js +1 -1
  70. package/dist/elements/saved-views.js +1 -1
  71. package/dist/elements/select.js +1 -1
  72. package/dist/elements/shortcuts.js +1 -1
  73. package/dist/elements/show-more.js +1 -1
  74. package/dist/elements/slider.js +1 -1
  75. package/dist/elements/sortable.js +1 -1
  76. package/dist/elements/timepicker.js +1 -1
  77. package/dist/elements/tour.js +1 -1
  78. package/dist/elements/tree-picker.js +1 -1
  79. package/dist/elements/tree.js +1 -1
  80. package/dist/elements/wizard.js +1 -1
  81. package/dist/fileViewer.g-D_zLw_p-.js +1 -0
  82. package/dist/{fileViewerImage-ItX9j9U9.js → fileViewerImage-DnzDd-rQ.js} +1 -1
  83. package/dist/{fileViewerMedia-BCqp2Z96.js → fileViewerMedia-Dm99qAjY.js} +1 -1
  84. package/dist/{fileViewerPdf-aaI2R2nB.js → fileViewerPdf-Tb26qdtM.js} +3 -3
  85. package/dist/{filterPopover-D7LGrhnO.js → filterPopover-DskHFNLi.js} +1 -1
  86. package/dist/{formatters-DikbTYA4.js → formatters-DTW53DjY.js} +1 -1
  87. package/dist/hasOwn-CJsplJ62.js +1 -0
  88. package/dist/helpers.js +1 -1
  89. package/dist/iconGlyphs.g-a9FtjPXh.js +1 -0
  90. package/dist/imeSafeEnter-DeO_3lXy.js +1 -0
  91. package/dist/{inlineEditText-C6g6qhye.js → inlineEditText-DRBhMnam.js} +1 -1
  92. package/dist/kanban-DlVHIpxL.js +1 -0
  93. package/dist/{kanbanModel-CuMgMnSc.js → kanbanModel-BzXK4SkM.js} +1 -1
  94. package/dist/{listboxKeyNav-DtlIOryj.js → listboxKeyNav-DNtuh6Ob.js} +1 -1
  95. package/dist/{loader-B3lirubB.js → loader-C2hgZrCR.js} +1 -1
  96. package/dist/{menuKeyNav-CstMzU08.js → menuKeyNav-BCHtqitp.js} +1 -1
  97. package/dist/{notificationDays-grsj1DtM.js → notificationDays-wMr8rZko.js} +1 -1
  98. package/dist/{optionLabel-CmrOSHbD.js → optionLabel-wbpl8OTJ.js} +1 -1
  99. package/dist/{recents-BQ0fD7Y0.js → recents-B9efQ1Au.js} +1 -1
  100. package/dist/{relativeTime-vdCXtfKg.js → relativeTime-CNgauvqB.js} +1 -1
  101. package/dist/{search-DwboX91o.js → search-D-lfoHy9.js} +1 -1
  102. package/dist/server.js +1 -1
  103. package/dist/{shortcutKeys-6iLc6oDR.js → shortcutKeys-BMTWgV2g.js} +1 -1
  104. package/dist/text.js +1 -1
  105. package/dist/textStore-DBplASiZ.js +1 -0
  106. package/dist/{themeTransition-D7HJ4A4m.js → themeTransition-DBv2olsl.js} +1 -1
  107. package/dist/ui-calendar.global.js +1 -1
  108. package/dist/ui-calendar.js +1 -1
  109. package/dist/ui-chart.global.js +2 -2
  110. package/dist/ui-chart.js +2 -2
  111. package/dist/ui-consent-banner.global.js +1 -1
  112. package/dist/ui-elements/carousel.global.js +1 -1
  113. package/dist/ui-elements/code-block.global.js +1 -1
  114. package/dist/ui-elements/command-palette.global.js +2 -2
  115. package/dist/ui-elements/comment-thread.global.js +1 -1
  116. package/dist/ui-elements/consent-banner.global.js +1 -1
  117. package/dist/ui-elements/context-menu.global.js +1 -1
  118. package/dist/ui-elements/date-range.global.js +1 -1
  119. package/dist/ui-elements/date-time.global.js +1 -1
  120. package/dist/ui-elements/datepicker.global.js +1 -1
  121. package/dist/ui-elements/drawer.global.js +1 -1
  122. package/dist/ui-elements/dropdown.global.js +1 -1
  123. package/dist/ui-elements/entry-grid.global.js +2 -2
  124. package/dist/ui-elements/gantt.global.js +1 -1
  125. package/dist/ui-elements/glyphs.global.js +1 -1
  126. package/dist/ui-elements/image-crop.global.js +1 -1
  127. package/dist/ui-elements/inline-edit.global.js +1 -1
  128. package/dist/ui-elements/kanban.global.js +1 -1
  129. package/dist/ui-elements/lead-popup.global.js +2 -2
  130. package/dist/ui-elements/lightbox.global.js +1 -1
  131. package/dist/ui-elements/markdown.global.js +3 -3
  132. package/dist/ui-elements/org-tree.global.js +1 -1
  133. package/dist/ui-elements/phone.global.js +1 -1
  134. package/dist/ui-elements/popover.global.js +1 -1
  135. package/dist/ui-elements/saved-views.global.js +1 -1
  136. package/dist/ui-elements/select-chips.global.js +2 -2
  137. package/dist/ui-elements/select-recents.global.js +1 -1
  138. package/dist/ui-elements/select-search.global.js +1 -1
  139. package/dist/ui-elements/select-window.global.js +1 -1
  140. package/dist/ui-elements/slider.global.js +1 -1
  141. package/dist/ui-elements/sortable.global.js +1 -1
  142. package/dist/ui-elements/status-icon.global.js +1 -1
  143. package/dist/ui-elements/table-export.global.js +1 -1
  144. package/dist/ui-elements/timepicker.global.js +1 -1
  145. package/dist/ui-elements/tour.global.js +1 -1
  146. package/dist/ui-elements/tree-picker.global.js +1 -1
  147. package/dist/ui-elements/tree.global.js +1 -1
  148. package/dist/ui-elements/wizard.global.js +1 -1
  149. package/dist/ui-elements.global.js +1 -1
  150. package/dist/ui-elements.js +1 -1
  151. package/dist/ui-file-viewer.global.js +10 -10
  152. package/dist/ui-file-viewer.js +1 -1
  153. package/dist/ui-lead-popup.global.js +1 -1
  154. package/dist/ui-rich-text.global.js +55 -55
  155. package/dist/ui-rich-text.js +54 -54
  156. package/dist/ui-tour.global.js +1 -1
  157. package/package.json +5 -5
  158. package/types/codeHighlight.d.ts +2 -1
  159. package/types/copyText.d.ts +2 -3
  160. package/types/global/shared.d.ts +48 -45
  161. package/types/hasOwn.d.ts +1 -0
  162. package/types/imeSafeEnter.d.ts +7 -0
  163. package/types/razor-js/modules/api.d.ts +8 -5
  164. package/types/razor-js/modules/look.d.ts +4 -5
  165. package/types/razor-js/modules/pageListeners.d.ts +1 -1
  166. package/types/razor-js/webority-ui.d.ts +14 -38
  167. package/dist/WuiCodeBlock-fBc3Uwsw.js +0 -1
  168. package/dist/WuiCommentThread-B58UyYGD.js +0 -1
  169. package/dist/WuiContextMenu-T-pkqJdV.js +0 -1
  170. package/dist/WuiGantt-XMvgsZsn.js +0 -1
  171. package/dist/WuiMentionInput-CktKQjQc.js +0 -1
  172. package/dist/WuiSelect-htggZB0v.js +0 -1
  173. package/dist/WuiTree-BnlK9fYL.js +0 -1
  174. package/dist/WuiTreePicker-Bx9nvRrC.js +0 -1
  175. package/dist/buttonClass-GtEi8hAY.js +0 -1
  176. package/dist/chips-DrTvHdbb.js +0 -2
  177. package/dist/copyText-Q-QZKBmx.js +0 -1
  178. package/dist/drawerDiscard-B33Oc_Sv.js +0 -1
  179. package/dist/fileViewer.g-B6N9K2xi.js +0 -1
  180. package/dist/iconGlyphs.g-P04RJkSE.js +0 -1
  181. package/dist/imeSafeEnter-DPs9qL3S.js +0 -1
  182. package/dist/kanban-CX6DyApZ.js +0 -1
  183. package/dist/textStore-opIEM4lu.js +0 -1
@@ -1 +1 @@
1
- var WeborityTour=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){if(typeof customElements>`u`||customElements.get(e))return;let n=[];if(typeof document<`u`)for(let r of document.querySelectorAll(e))for(let i of Object.keys(r)){let a=Object.getOwnPropertyDescriptor(t.prototype,i);if(a&&(a.set||a.get)&&(n.push([r,i,Reflect.get(r,i)]),!Reflect.deleteProperty(r,i)))throw Error(`defineElement: could not clear the early "${i}" property on <${e}>.`)}customElements.define(e,t);for(let[t,r,i]of n)if(!Reflect.set(t,r,i))throw Error(`defineElement: could not restore the "${r}" property on <${e}>.`)}var n=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(n);var r=HTMLElement;function i(e){return getComputedStyle(e).direction===`rtl`}function a(e,t){return t?e===`ArrowRight`?`ArrowLeft`:e===`ArrowLeft`?`ArrowRight`:e:e}function o(e,t){s(e),e._reanchor=t,e._reanchorScroll=n=>{n.composedPath().includes(e)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function s(e){if(!e?._reanchor)return;window.removeEventListener(`resize`,e._reanchor);let t=e._reanchorScroll;t&&window.removeEventListener(`scroll`,t,!0),e._reanchor=null,e._reanchorScroll=null}var c=`AppButton`,l=new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),u={solid:e=>`btn-${e}`,soft:e=>`btn-soft-${e}`,outline:e=>`btn-outline-${e}`,ghost:e=>`btn-ghost-${e}`,link:e=>`btn-link-${e}`,glass:()=>`btn-glass`};function d(e){return Object.hasOwn(u,e)}function f(e=`primary`,t=`solid`,n=`md`){if(!l.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!d(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=u[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}function p(e,t,...n){if(e.toLowerCase()===`svg`)throw Error(`make() builds HTML elements; use svgRoot for svg`);let r=document.createElement(e);for(let[e,n]of Object.entries(t??{}))n===!0?r.setAttribute(e,``):(typeof n==`string`||typeof n==`number`)&&r.setAttribute(e,String(n));let i=[];for(let e of n)e instanceof Node?i.push(e):(typeof e==`string`||typeof e==`number`)&&i.push(document.createTextNode(String(e)));return r.append(...i),r}var m=`data-wui-dismiss`,h=`data-wui-closing`,g=`[${m}]`,_=`(prefers-reduced-motion: reduce)`,v=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,y=new WeakSet,b=Symbol.for(`webority.ui.modal-stack`),x=Symbol.for(`webority.ui.root-watches`);function ee(e){let t=e;return t[x]??=new Set,t[x]}function te(e){let t=e.querySelector(`[data-autofocus]`);if(t)return t;let n=null;for(let t of e.querySelectorAll(v))if(!t.closest(`[hidden],[inert]`)){if(!t.closest(`${g},.wui-modal-back`))return t;n??=t}return n}function ne(e){let t=[],n=new Map;for(let r of e.querySelectorAll(v))if(!(r.closest(`[hidden],[inert]`)||r.closest(`dialog`)!==e)&&!(r.tabIndex<0||r.getClientRects().length===0)){if(r instanceof HTMLInputElement&&r.type===`radio`&&r.name){let e=n.get(r.name);e?r.checked&&!e.checked&&(e.checked=r,t[t.indexOf(e.first)]=r):(n.set(r.name,{first:r,checked:r.checked?r:null}),t.push(r))}else t.push(r)}return t}function S(e){let t=e;return t[b]??=[],t[b]}function re(e){C(e),S(e.ownerDocument).push(e)}function C(e){let t=S(e.ownerDocument),n=t.indexOf(e);n>=0&&t.splice(n,1)}function w(e){for(let t of ee(e)){let n=T(e);t.last!==n&&(t.last=n,t.listener(n))}}function ie(e){let t=Promise.allSettled(e.getAnimations().map(e=>e.finished));return new Promise(e=>{let n=window.setTimeout(e,400);t.then(()=>{window.clearTimeout(n),e()})})}function ae(e,t){let n=t.focus===`first-control`?te(e):null,r=n??e,i=r===e&&!e.hasAttribute(`tabindex`);i&&e.setAttribute(`tabindex`,`-1`);let a=!t.escape&&!e.hasAttribute(`closedby`);a&&e.setAttribute(`closedby`,`none`),y.add(e);let o=()=>{if(re(e),!e.hasAttribute(`open`)){let t=n!==null&&!e.querySelector(`[autofocus]`);t&&n.setAttribute(`autofocus`,``);try{e.showModal()}catch(t){throw C(e),t}finally{t&&n.removeAttribute(`autofocus`)}}r.focus(),w(e.ownerDocument)},s=!1,c=n=>{if(n.key!==`Escape`||n.defaultPrevented||!t.escape||n.altKey||n.ctrlKey||n.metaKey)return;let r=e.ownerDocument;T(r)===e&&(e.querySelector(`:popover-open`)||r.querySelector(`[popover=""]:popover-open, [popover="auto"]:popover-open`)||(s=!0,window.setTimeout(()=>{s&&y.has(e)&&e.open&&(s=!1,t.onRequestClose(`escape`))},0)))},l=t=>{if(t.key!==`Tab`||t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)return;let n=e.ownerDocument;if(T(n)!==e||e.querySelector(`:popover-open`))return;t.preventDefault();let r=ne(e),i=r[0],a=r[r.length-1];if(!i||!a){e.focus();return}let o=n.activeElement,s=o?r.findIndex(e=>e===o||e.contains(o)):-1;s<0?(t.shiftKey?a:i).focus():r[((t.shiftKey?s-1:s+1)+r.length)%r.length]?.focus()},u=e=>{s=!1,e.preventDefault(),t.escape&&t.onRequestClose(`escape`)},d=n=>{let r=n.target;if(!(r instanceof Element))return;let i=r.closest(g);if(i&&i.closest(`dialog`)===e){t.onRequestClose(`dismiss`);return}if(r!==e||!t.backdrop)return;let a=e.getBoundingClientRect();(n.clientX<a.left||n.clientX>a.right||n.clientY<a.top||n.clientY>a.bottom)&&t.onRequestClose(`backdrop`)},f=()=>{let n=s;s=!1,C(e),y.has(e)?(o(),n&&t.onRequestClose(`escape`)):w(e.ownerDocument)},p=e.ownerDocument;return p.addEventListener(`keydown`,c),p.addEventListener(`keydown`,l),e.addEventListener(`cancel`,u),e.addEventListener(`click`,d),e.addEventListener(`close`,f),o(),()=>{p.removeEventListener(`keydown`,c),p.removeEventListener(`keydown`,l),e.removeEventListener(`cancel`,u),e.removeEventListener(`click`,d),e.removeEventListener(`close`,f),y.delete(e),i&&e.removeAttribute(`tabindex`),a&&e.removeAttribute(`closedby`),C(e),w(e.ownerDocument)}}async function oe(e){y.delete(e),e.setAttribute(h,``),!window.matchMedia(_).matches&&typeof e.getAnimations==`function`&&e.getAnimations().length>0&&await ie(e),e.close(),C(e),w(e.ownerDocument),e.removeAttribute(h)}function se(e){if(ce(e),!e.isConnected)throw Error(`nativeOverlay: raisePopover was given a panel that is not on the page; a caller whose overlay root can leave the page skips the raise until the panel moves to the new root`);e.hidePopover(),e.showPopover()}function ce(e){if(!e.hasAttribute(`popover`))throw Error(`nativeOverlay: the panel has no popover attribute`)}function T(e=document){let t=S(e);for(let e=t.length-1;e>=0;e--){let n=t[e];if(n?.isConnected&&n.hasAttribute(`open`))return n}return e.body}var le=/\{([A-Za-z0-9_]+)\}/g,ue=new Map,de=0,fe=new Map;function E(e,t){let n=ue.get(e);if(n===void 0)return t;let r=fe.get(e);if(r!==void 0&&r.version===de&&r.english===t&&me(r.merged,t))return r.merged;let i=pe(e,n,t);return fe.set(e,{version:de,english:t,merged:i}),i}function pe(e,t,n){let r={};for(let[i,a]of Object.entries(t)){let t=Object.hasOwn(n,i)?n[i]:void 0;if(t===void 0)throw RangeError(`Text ${e}.${i} is not a key of the English text. Allowed keys: ${Object.keys(n).join(`, `)}.`);let o=D(t);for(let t of D(a))if(!o.includes(t))throw RangeError(`Text ${e}.${i} uses {${t}}, which the English text does not have. Allowed placeholders: ${o.length===0?`none`:o.map(e=>`{${e}}`).join(`, `)}.`);r[i]=a}return Object.assign({},n,r)}function me(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(t=>Object.hasOwn(e,t))}function D(e){return Array.from(e.matchAll(le),e=>e[1]??``)}var O={backLabel:`Back`,doneLabel:`Done`,endMessage:`You know your way around now. Enjoy exploring.`,endTitle:`You're all set`,mediaPauseLabel:`Pause animation`,mediaPlayLabel:`Play animation`,nextLabel:`Next`,progressLabel:`Step {current} of {total}`,skipLabel:`Skip`},he={advanceLabel:`Click {actionName} to continue.`},k=`data-advance`,A=`wui-tour-hint`,j=`wui-tour-pointer`,ge=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,_e=()=>E(`tourAdvance`,he),M=(e,t)=>e?.advanceOn===`click`&&!!t,N=e=>(e??``).replace(/\s+/g,` `).trim(),ve=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLMeterElement||e instanceof HTMLOutputElement||e instanceof HTMLProgressElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?e.labels:null,ye=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLFieldSetElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement?e.disabled:!1;function be(e){let t=e.ownerDocument,n=(e.getAttribute(`aria-labelledby`)||``).split(/\s+/).filter(Boolean),r=e instanceof HTMLInputElement&&/^(button|submit|reset)$/.test(e.type)?e.value:``,i=[n.map(e=>t.getElementById(e)?.textContent??``).join(` `),e.getAttribute(`aria-label`),Array.from(ve(e)??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=N(e);if(t)return t}return``}function xe(e){for(let t of[e,...e.querySelectorAll(ge)])if((t instanceof HTMLElement||t instanceof SVGElement)&&t.tabIndex>=0&&!ye(t))return t;return null}function P(e,t,n){let r=(e.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(e=>e&&e!==t);n&&r.push(t),r.length>0?e.setAttribute(`aria-describedby`,r.join(` `)):e.removeAttribute(`aria-describedby`)}function Se(e,t){let n=e.querySelector(`.${A}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t)n?.remove(),i&&P(e,i,!1);else{if(!n){n=e.ownerDocument.createElement(`p`),n.className=A,i&&(n.id=i);let t=e.querySelector(`.wui-tour-actions`);if(!t)throw Error(`Tour card has no actions row.`);t.before(n)}n.textContent=t,i&&P(e,i,!0)}}function Ce(e,t){let n=e.querySelector(`.${j}`);if(!t){n?.remove();return}if(n)return;let r=e.ownerDocument.createElement(`span`);r.className=j,r.setAttribute(`aria-hidden`,`true`),e.append(r)}var we=e=>getComputedStyle(e).animationName;function F(e,{layer:t,spot:n,card:r},i,a){let o=M(i,a);t.toggleAttribute(k,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(k)&&(n.removeAttribute(k),o&&we(n)),o&&n.setAttribute(k,``),Ce(n,o);let s=r.querySelector(`.wui-tour-next`);if(!(s instanceof HTMLElement))throw Error(`Tour card has no next button.`);s.classList.toggle(`btn-primary`,!o),s.classList.toggle(`btn-link`,o);let c=o?N(i?.actionLabel)||be(a):``,l=e.getAttribute(`advance-label`)||_e().advanceLabel,u=c?l.replace(/\{actionName\}/g,()=>c):``;return Se(r,u),u}function Te(e,t,n){if(!M(e,t))return()=>{};let r,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function Ee(e,t,n,r){return e.contains(r)||M(t,n)&&n.contains(r)}function De(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=M(r,i)?xe(i):null;o&&a.push(o);let s=a.findIndex(e=>e===n||e===o&&i?.contains(n));e.preventDefault();let c=a[s===-1?e.shiftKey?a.length-1:0:(s+(e.shiftKey?-1:1)+a.length)%a.length];if(!c)throw Error(`Tour card has no focus stop.`);c.focus()}function Oe(e){return e.key===`Enter`&&e.isComposing!==!0&&e.keyCode!==229}var I=`http://www.w3.org/2000/svg`;function L(e){return e.map(Ae)}function ke(e,t){let n=document.createElementNS(I,`svg`);return R(n,e),n.append(...L(t)),n}function Ae(e){let[t,n,r]=e,i=document.createElementNS(I,t);return R(i,n),typeof r==`string`?i.append(document.createTextNode(r)):r&&i.append(...L(r)),i}function R(e,t){for(let[n,r]of Object.entries(t))r===!0?e.setAttribute(n,``):(typeof r==`string`||typeof r==`number`)&&e.setAttribute(n,String(r))}var je=2/3,Me=1e3,Ne=new Set([`top`,`left`,`width`,`height`]),z=new WeakMap,B=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],V=e=>`transitionProperty`in e&&e.transitionProperty===`opacity`,Pe=e=>`transitionProperty`in e&&typeof e.transitionProperty==`string`&&Ne.has(e.transitionProperty),Fe=e=>`animationName`in e&&typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function Ie(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,Me);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function Le(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?B(t,Pe):[]){let t=e.effect?.getComputedTiming?.();if(typeof t?.duration!=`number`)continue;let r=typeof e.currentTime==`number`?e.currentTime:0;n=Math.max(n,(t.delay??0)+t.duration*je-r)}return n}function Re(e){let t=Le(e);t>0?e.style.setProperty(`--wui-tour-card-delay`,`${Math.round(t)}ms`):e.style.removeProperty(`--wui-tour-card-delay`),e.dataset.state=`entering`;let n={};z.set(e,n);let r=()=>{z.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=B(e,Fe);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function ze(e){return e.dataset.state=`leaving`,Ie(B(e,V))}function Be(e){let t=e.shadowRoot?.querySelector(`.wui-tour-layer`),n=e.classList.contains(`wui-tour-layer`)?e:t instanceof HTMLElement?t:null;n&&(n.dataset.state=`leaving`);let r=n?Ie(B(n,V)):null;r?(e.setAttribute(`inert`,``),r.then(()=>e.remove())):e.remove()}var Ve=2,H=12,U=8,He=4,W=20,Ue=`(max-width: 575.98px)`,We=[`bottom`,`top`,`right`,`left`],Ge=[`bottom`,`top`,`left`,`right`],Ke=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],qe,G=(e,t,n)=>Math.max(t,Math.min(e,n)),K=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function Je(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=et(e),r=e.offsetHeight+H;if(t.getBoundingClientRect().height+4+r*2<=n.bottom-n.top){t.scrollIntoView({block:`center`,inline:`nearest`});return}let i=t.style.scrollMarginTop;t.style.scrollMarginTop=`${n.top+r+Ve}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function Ye(e,t,n){let r=e.style,a=t.style,o=tt(t);if(!n){r.top=`50%`,r.left=`50%`,r.width=`0px`,r.height=`0px`,r.boxShadow=`0 0 0 100vmax var(--color-scrim-strong)`;for(let e of Ke)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,o.hidden=!0,a.position=`fixed`,a.top=`50%`,a.left=`50%`,a.transform=`translate(-50%, -50%)`,a.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,a.transform=``,a.position=`fixed`;let s=n.getBoundingClientRect();r.top=`${s.top}px`,r.left=`${s.left}px`,r.width=`${s.width}px`,r.height=`${s.height}px`,Xe(r,n);let c=t.scrollTop;a.maxHeight=``;let l={width:t.offsetWidth,height:t.offsetHeight},u=et(t),d=u.bottom-u.top,f={bottom:u.bottom-s.bottom-H,top:s.top-H-u.top,right:u.right-s.right-H,left:s.left-H-u.left},p=window.matchMedia(Ue).matches,m=(i(n)?Ge:We).find(e=>e===`top`||e===`bottom`?l.height<=f[e]+1:!p&&l.width<=f[e]+1&&l.height<=d+1),h=Math.min(s.bottom,u.bottom+U)-Math.max(s.top,u.top-U);m?Ze(t,o,m,s,u,l):h>=Math.min(l.height,d)+8?Qe(t,o,s,u,l):$e(t,o,f.bottom>=f.top?`bottom`:`top`,s,u,l,f),t.scrollTop=c}function Xe(e,t){qe??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of Ke)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),qe&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function Ze(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=K(r.left,r.right,i.left,i.right);s=G(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+H:r.top-H-a.height,l=G(e-s,W,a.width-W)}else{let e=K(r.top,r.bottom,i.top,i.bottom);c=G(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+H:r.left-H-a.width,l=G(e-c,W,a.height-W)}e.dataset.placement=n,e.style.top=`${c}px`,e.style.left=`${s}px`,t.hidden=!1,t.style.left=o?`${l-e.clientLeft-t.offsetWidth/2}px`:``,t.style.top=o?``:`${l-e.clientTop-t.offsetHeight/2}px`}function Qe(e,t,n,r,i){let a=r.bottom-r.top;e.dataset.placement=`overlap`,t.hidden=!0,e.style.maxHeight=i.height>a?`${Math.max(a,0)}px`:``;let o=Math.min(n.bottom,r.bottom)-He;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${G(n.left+He,r.left,r.right-i.width)}px`}function $e(e,t,n,r,i,a,o){let s=Math.max(o[n],0),c=Math.min(a.height,s);e.dataset.placement=n,t.hidden=!0,e.style.maxHeight=a.height>s?`${s}px`:``,e.style.top=`${n===`bottom`?r.bottom+H:r.top-H-c}px`;let l=K(r.left,r.right,i.left,i.right);e.style.left=`${G(l-a.width/2,i.left,i.right-a.width)}px`}function et(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e]??``)||0;return{top:r(`paddingTop`)+U,bottom:window.innerHeight-r(`paddingBottom`)-U,left:r(`paddingLeft`)+U,right:window.innerWidth-r(`paddingRight`)-U}}function tt(e){let t=e.querySelector(`:scope > .wui-tour-arrow`);if(t instanceof HTMLElement)return t;let n=document.createElement(`span`);return n.className=`wui-tour-arrow`,n.setAttribute(`aria-hidden`,`true`),n.hidden=!0,e.append(n),n}var nt=0,rt=`btn btn-sm btn-link`;function q(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`Expected "${t}" to match a ${n.name}.`);return r}function it(e,t){let n=`wui-tour-end-${++nt}`,{nextLabel:r,nextHref:i}=e,a=r&&i?p(`a`,{class:`${f(`primary`,`solid`,`sm`)} wui-tour-end-next`,"data-wui":c,href:i},r):null,o=a!==null,s=p(`button`,{type:`button`,class:`${o?rt:f(`primary`,`solid`,`sm`)} wui-tour-end-button`,"data-wui":c},e.button);return p(t?`dialog`:`div`,{class:`wui-tour-card wui-tour-end`,"data-layout":`center`,"data-next":o||void 0,role:`dialog`,tabindex:-1,"aria-labelledby":`${n}-title`,"aria-describedby":`${n}-message`},p(`div`,{class:`wui-tour-end-mark`,"aria-hidden":`true`},ke({viewBox:`0 0 24 24`,focusable:`false`},[[`path`,{d:`M5 12.5l4.5 4.5L19 7.5`}]])),p(`h2`,{class:`wui-tour-title wui-tour-end-title`,id:`${n}-title`},e.title),p(`p`,{class:`wui-tour-text wui-tour-end-message`,id:`${n}-message`},e.message),p(`div`,{class:`wui-tour-actions`},a,s))}var at=e=>e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;function ot(e,t,n){let r=e.ownerDocument,i=it(t,e.getRootNode()===r),a=q(i,`.wui-tour-end-button`,HTMLButtonElement),o=i.querySelector(`.wui-tour-end-next`);if(o!==null&&!(o instanceof HTMLAnchorElement))throw Error(`The end dialog's next link is not a link.`);let s=o,c=s??a,l=new AbortController,u=i instanceof HTMLDialogElement?i:null,d=null;return new Promise(o=>{let f=e=>{if(l.abort(),d&&u){let e=d;d=null,oe(u).then(e)}o(e)};if(n?.aborted){f(`done`);return}let p=q(e,`.wui-tour-card:not(.wui-tour-end)`,HTMLElement),m=q(e,`.wui-tour-spot`,HTMLElement),h=q(e,`[role=status]`,HTMLElement),g={signal:l.signal};n?.addEventListener(`abort`,()=>f(`done`),g),a.addEventListener(`click`,()=>f(`done`),g),s&&s.addEventListener(`click`,e=>{at(e)&&(e.preventDefault(),f(`next`))},g),r.addEventListener(`keydown`,e=>{if(!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){if(d)return;e.preventDefault(),e.stopPropagation(),f(`done`)}else Oe(e)&&s&&!e.shiftKey&&(e.composedPath?.()[0]??e.target)===s&&(e.preventDefault(),f(`next`))}},{capture:!0,signal:l.signal});let _=()=>{l.signal.aborted||(p.hidden=!0,Ye(m,p,null),e.append(i),Re(i),u&&(d=ae(u,{escape:!0,backdrop:!1,focus:`first-control`,onRequestClose:()=>f(`done`)})),h.textContent=[t.title,t.message].filter(Boolean).join(`. `),c.focus())},v=ze(p);v===null?_():v.then(_)})}var st=` :host { all: initial; display: revert-layer; position: fixed; inset: 0; ${Object.entries({"--wui-z-tour":`1550`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-popover":`0px 8px 28px -6px rgba(7, 20, 55, 0.14)`,"--wui-ease-out":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-ease-linear":`cubic-bezier(0, 0, 1, 1)`,"--wui-duration-fast":`150ms`,"--wui-duration-default":`250ms`,"--wui-duration-slow":`400ms`,"--wui-space-xs":`4px`,"--wui-tour-motion-duration":`200ms`,"--wui-tour-motion-ease":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-tour-spot-duration":`240ms`,"--wui-tour-spot-ease":`cubic-bezier(0.32, 0.72, 0, 1)`,"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-text":`#4F46E5`,"--color-focus-ring":`#4F46E5`,"--wui-focus-ring-width":`2px`,"--wui-focus-ring-offset":`2px`,"--color-on-primary":`#FFFFFF`,"--color-success-soft":`#E8FAEE`,"--color-success-text":`#0e7531`,"--color-on-scrim":`#FFFFFF`,"--color-scrim-strong":`color-mix(in srgb, #071437 62%, transparent)`,"--color-surface":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-bg-muted":`#F5F6FA`}).map(([e,t])=>` ${e}: ${t};`).join(` `)} } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; } .btn { display: inline-block; margin: 0; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; } .btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); } .btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); } .btn-outline-neutral { border-color: var(--color-text-muted); color: var(--color-text-muted); } .btn-outline-neutral:hover { background: var(--color-bg-muted); color: var(--color-text); } .btn-link { font-weight: 400; color: var(--color-primary-text); text-decoration: underline; } .btn-link:hover { color: var(--color-primary-hover); } .wui-tour-layer { pointer-events: none; font-family: "Webority Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--color-text); text-align: start; } .wui-tour-card { pointer-events: auto; } .wui-tour-layer { position: fixed; inset: 0; z-index: var(--wui-z-tour); width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; background: none; } .wui-tour-spot { position: fixed; box-shadow: 0 0 0 2px var(--color-primary), 0 0 4px 2px color-mix(in srgb, var(--color-primary) 30%, transparent), 0 0 0 100vmax var(--color-scrim-strong); pointer-events: none; } .wui-tour-card { display: flex; flex-direction: column; gap: 8px; width: min(360px, 100vw - 16px); padding: 16px; overflow-y: auto; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--wui-radius-lg); corner-shape: squircle; box-shadow: var(--wui-shadow-popover); } .wui-tour-card:focus { outline: none; } .wui-tour-card:focus-visible { outline: var(--wui-focus-ring-width) solid var(--color-focus-ring); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-title { margin: 0; font-size: 16px; font-weight: 600; } .wui-tour-text { margin: 0; font-size: 14px; color: var(--color-text-muted); } .wui-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; } .wui-tour-nav { display: flex; gap: 8px; } .wui-tour-skip { color: var(--color-text-muted); } .wui-tour-back, .wui-tour-next { min-width: 64px; } @keyframes wui-tour-fade-in { from { opacity: 0; } to { opacity: 1; } } @keyframes wui-tour-card-enter { from { opacity: 0; scale: 0.96; translate: var(--wui-tour-card-lift, 0 6px); } to { opacity: 1; scale: 1; translate: 0 0; } } .wui-tour-layer[data-state=leaving], .wui-tour-card[data-state=leaving] { opacity: 0; } .wui-tour-layer[data-state=leaving], .wui-tour-layer[data-state=leaving] * { pointer-events: none; } @media (prefers-reduced-motion: no-preference) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-spot { transition: top var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), left var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), width var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), height var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), border-radius var(--wui-tour-spot-duration) var(--wui-tour-spot-ease); } .wui-tour-spot[data-tracking] { transition: none; } .wui-tour-card { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=top] { --wui-tour-card-lift: 0 -6px; transform-origin: bottom center; } .wui-tour-card[data-placement=bottom] { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=left] { --wui-tour-card-lift: -6px 0; transform-origin: right center; } .wui-tour-card[data-placement=right] { --wui-tour-card-lift: 6px 0; transform-origin: left center; } .wui-tour-card[data-placement=overlap], .wui-tour-card[data-placement=center] { --wui-tour-card-lift: 0 0; transform-origin: center; } .wui-tour-card[data-state=entering] { animation: wui-tour-card-enter var(--wui-tour-motion-duration) var(--wui-tour-motion-ease) var(--wui-tour-card-delay, 0ms) both; } .wui-tour-card[data-state=leaving] { transition: opacity calc(var(--wui-tour-motion-duration) / 2) var(--wui-tour-motion-ease); } } @media (prefers-reduced-motion: reduce) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-card[data-state=entering] { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear) both; } } .wui-tour-progress-bar { display: flex; gap: 4px; } .wui-tour-progress-segment { flex: 1 1 0; height: 4px; border-radius: 999px; background: var(--color-border); } .wui-tour-progress-segment[data-filled] { background: var(--color-primary); } .wui-tour-position { margin: 0; font-size: 12px; color: var(--color-text-muted); } .wui-tour-layer { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); } .wui-tour-card:has(.wui-tour-arrow:not([hidden])) { overflow: visible; } .wui-tour-arrow { position: absolute; width: 8px; height: 8px; background: var(--color-surface); border: 1px solid var(--color-border); rotate: 45deg; pointer-events: none; } .wui-tour-card[data-placement=bottom] .wui-tour-arrow { top: -5px; border-right-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=top] .wui-tour-arrow { bottom: -5px; border-top-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=right] .wui-tour-arrow { left: -5px; border-top-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=left] .wui-tour-arrow { right: -5px; border-bottom-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } @media (max-width: 575.98px) { .wui-tour-card { width: calc(100vw - 16px); } .wui-tour-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; } } .wui-tour-media { position: relative; order: -1; flex: none; aspect-ratio: 16/9; margin: -16px -16px 4px; overflow: hidden; background: var(--color-border); } .wui-tour-media>img, .wui-tour-media>video { display: block; width: 100%; height: 100%; object-fit: cover; } .wui-tour-card[data-welcome] { width: min(420px, 100vw - 16px); } .wui-tour-media-toggle { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--color-scrim-strong); color: var(--color-on-scrim); cursor: pointer; } .wui-tour-media-toggle>svg { width: 20px; height: 20px; fill: currentColor; } .wui-tour-media-toggle:focus-visible { outline: 2px solid var(--color-on-scrim); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-layer[data-advance] { pointer-events: none; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-card { pointer-events: auto; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-spot::before { content: ""; position: absolute; inset: -100vmax; pointer-events: auto; clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 100vmax 100vmax, calc(100% - 100vmax) 100vmax, calc(100% - 100vmax) calc(100% - 100vmax), 100vmax calc(100% - 100vmax), 100vmax 100vmax); } .wui-tour-hint { margin: 0; font-size: 14px; font-weight: 600; color: var(--color-text); } .wui-tour-pointer { position: absolute; top: 50%; left: 50%; width: 18px; height: 24px; pointer-events: none; } .wui-tour-pointer::before { content: ""; position: absolute; inset: 0; background: var(--color-primary); clip-path: polygon(0 0, 0 75%, 28% 58%, 46% 100%, 62% 92%, 45% 52%, 85% 52%); filter: drop-shadow(1px 0 0 var(--color-surface)) drop-shadow(-1px 0 0 var(--color-surface)) drop-shadow(0 1px 0 var(--color-surface)) drop-shadow(0 -1px 0 var(--color-surface)); } .wui-tour-pointer::after { content: ""; position: absolute; top: -16px; left: -16px; width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary); opacity: 0; display: none; } @media (max-width: 575.98px) { .wui-tour-pointer { width: 24px; height: 24px; translate: -50% -50%; } .wui-tour-pointer::before { clip-path: none; border-radius: 50%; box-shadow: 0 0 0 2px var(--color-surface); filter: none; } .wui-tour-pointer::after { top: -4px; left: -4px; } } @keyframes wui-tour-tap { 0% { opacity: 0; transform: translate(56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-tap-rtl { 0% { opacity: 0; transform: translate(-56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(-56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-ripple { 0%, 50% { opacity: 0; transform: scale(0.2); } 52% { opacity: 0.35; transform: scale(0.2); } 80%, 100% { opacity: 0; transform: scale(1); } } @media (prefers-reduced-motion: no-preference) { .wui-tour-pointer { opacity: 0; animation: wui-tour-tap calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } .wui-tour-pointer:dir(rtl) { animation-name: wui-tour-tap-rtl; } .wui-tour-pointer::after { display: block; animation: wui-tour-ripple calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } } @keyframes wui-tour-check { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } } .wui-tour-end[data-layout=center] { --wui-tour-card-lift: 0 0; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); transform-origin: center; align-items: center; gap: 8px; width: min(420px, 100vw - 16px); max-height: calc(100vh - 16px); padding: 24px; text-align: center; } .wui-tour-end[data-layout=center] .wui-tour-actions { justify-content: center; margin-top: 8px; } .wui-tour-end[data-layout=center][data-next] .wui-tour-actions { flex-direction: column; align-items: stretch; width: 100%; gap: var(--wui-space-xs); } .wui-tour-end-mark { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--color-success-soft); color: var(--color-success-text); } .wui-tour-end-mark>svg { width: 26px; height: 26px; } .wui-tour-end-mark path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; } .wui-tour-end-title { font-size: 18px; } .wui-tour-end-message { text-wrap: balance; } .wui-tour-end-next { text-wrap: balance; } .wui-tour-end-button { min-width: 120px; } @media (prefers-reduced-motion: no-preference) { .wui-tour-end-mark path { animation: wui-tour-check var(--wui-duration-default) var(--wui-ease-out) calc(var(--wui-tour-card-delay, 0ms) + var(--wui-duration-fast)) both; } } `,ct=()=>E(`tour`,O),lt=`wui-tour-media`,ut=`wui-tour-media-toggle`,dt=`http://www.w3.org/2000/svg`,ft=`M6 5h4v14H6zM14 5h4v14h-4z`,pt=`M8 5v14l11-7z`,mt=()=>({pause:ct().mediaPauseLabel,play:ct().mediaPlayLabel}),ht=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function gt(e){let t=document.createElementNS(dt,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(dt,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function _t(e){let t=document.createElement(`img`);return t.setAttribute(`alt`,e.mediaAlt??``),t.setAttribute(`width`,`1280`),t.setAttribute(`height`,`720`),t.setAttribute(`loading`,`lazy`),t.setAttribute(`decoding`,`async`),t.setAttribute(`src`,e.media??``),t}function vt(e,t){let n=document.createElement(`video`);return n.muted=!0,n.setAttribute(`muted`,``),n.loop=!0,n.setAttribute(`playsinline`,``),t&&n.setAttribute(`autoplay`,``),n.setAttribute(`preload`,t?`auto`:`metadata`),e.mediaAlt&&n.setAttribute(`aria-label`,e.mediaAlt),e.mediaPoster&&n.setAttribute(`poster`,e.mediaPoster),n.setAttribute(`src`,e.media??``),n}function yt(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=ut;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(gt(r?ft:pt))};return e.addEventListener(`play`,()=>r()),e.addEventListener(`pause`,()=>r()),n.addEventListener(`click`,()=>{e.paused?e.play()?.catch(()=>r()):e.pause()}),r(e.hasAttribute(`autoplay`)),n}function bt(e){let t=e.querySelector(`:scope > .${lt}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function xt(e,t,n=mt()){if(bt(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=lt,t.mediaType===`video`){let e=vt(t,!ht());r.append(e,yt(e,n))}else r.appendChild(_t(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var St=`data-wui-tour-open`,Ct=()=>E(`tour`,O);function wt(e){let t=new Set;return{drop:e=>{t.add(e)},position:e=>{t.delete(e);let n=0;for(let r of t)r<e&&n++;return e+1-n},total:()=>e-t.size}}function Tt(e,t,n){return(e.getAttribute(`progress-label`)||Ct().progressLabel).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function Et(e,{text:t,position:n,total:r}){let i=e.querySelector(`.wui-tour-position`);if(!(i instanceof HTMLElement))throw Error(`tour position label missing`);i.textContent=t;let a=e.querySelector(`.wui-tour-progress-bar`);if(!a){let t=e.ownerDocument,n=t.createElement(`div`);n.className=`wui-tour-progress`,n.setAttribute(`aria-hidden`,`true`),a=t.createElement(`div`),a.className=`wui-tour-progress-bar`,n.append(a),i.before(n)}let o=a.children;for(;o.length<r;){let t=e.ownerDocument.createElement(`span`);t.className=`wui-tour-progress-segment`,a.append(t)}for(;o.length>r;){let e=a.lastElementChild;if(!e)throw Error(`progress bar segment missing`);e.remove()}for(let e=0;e<o.length;e++){let t=o[e];if(!t)throw Error(`progress bar segment missing`);t.toggleAttribute(`data-filled`,e<n)}}var Dt=`wui-tour-seen:`;function Ot(e=Dt,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var kt=`wui-tour-step`,At=`wui-tour-host`,J=`data-tracking`,Y=()=>E(`tour`,O),jt=()=>({back:Y().backLabel,next:Y().nextLabel,skip:Y().skipLabel,done:Y().doneLabel,mediaPause:Y().mediaPauseLabel,mediaPlay:Y().mediaPlayLabel,endTitle:Y().endTitle,endMessage:Y().endMessage,endButton:Y().doneLabel}),Mt={back:`back-label`,next:`next-label`,skip:`skip-label`,done:`done-label`,mediaPause:`media-pause-label`,mediaPlay:`media-play-label`,endTitle:`end-title`,endMessage:`end-message`,endButton:`end-button`},Nt=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],Pt={index:null,position:null,total:null},Ft=0,X=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,It=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function Z(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`<wui-tour> layer has no ${t}`);return r}var Lt=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},Q=null;function Rt(e){Q||(Q=new CSSStyleSheet,Q.replaceSync(st)),e.adoptedStyleSheets=[Q]}var zt=class extends r{seenStore;onBeforeStep;_run;_running;_layer;_outer;_shadow;_unbindAdvance;_ending;_seenMark;_steps=[];_progress=wt(0);_firstIndex=0;_returnFocus=null;_current=null;_moving=!1;_card=null;_spot=null;_live=null;_onKey=null;_onFocusIn=null;static get observedAttributes(){return[`open`]}constructor(){super(),this.seenStore=null,this.onBeforeStep=null,this._run=0,this._running=!1,this._layer=null,this._outer=null,this._shadow=null,this._unbindAdvance=null,this._ending=null,this._seenMark=null}connectedCallback(){this.hasAttribute(`open`)&&this.start()}disconnectedCallback(){this.stop()}attributeChangedCallback(e,t,n){e===`open`&&this.isConnected&&(n===null?this.stop():this.start())}get tourId(){return this.getAttribute(`tour-id`)||``}set tourId(e){e==null||e===``?this.removeAttribute(`tour-id`):this.setAttribute(`tour-id`,String(e))}get isolated(){return this.hasAttribute(`isolated`)}set isolated(e){this.toggleAttribute(`isolated`,e===!0||e===``||e===`true`)}_stepList(){return Array.from(this.querySelectorAll(`:scope > ${kt}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:(e.textContent??``).trim()};for(let[n,r]of Nt)e.hasAttribute(r)&&(t[n]=e.getAttribute(r)??``);return t})}_stepAt(e){let t=this._steps[e];if(!t)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);return t}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?Ot():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(Mt[e])||jt()[e]}_endDialogText(){if(this.getAttribute(`end-dialog`)===`false`)return null;let e=(this.getAttribute(`end-next-label`)??``).trim(),t=(this.getAttribute(`end-next-href`)??``).trim();return{title:this._label(`endTitle`),message:this._label(`endMessage`),button:this._label(`endButton`),nextLabel:e,nextHref:t}}_markSeen(e){let t=this._store();return t?t.markSeen(this.tourId,e):null}async start(){if(this._running)return;this._running=!0;let e=++this._run;this.hasAttribute(`open`)||this.setAttribute(`open`,``);try{await this._start(e)}catch(t){throw e===this._run&&(this._running=!1),t}}async _start(e){this._steps=this._stepList(),this._progress=wt(this._steps.length);let t=this._store();if(t&&!this.tourId)throw Error(`<wui-tour> needs a tour-id to use a seen store.`);if(t&&await t.isSeen(this.tourId)){e===this._run&&this._finish(`alreadySeen`);return}for(let[e,t]of this._steps.entries())t.target&&!X(document.querySelector(t.target))&&this._progress.drop(e);this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);e===this._run&&(n?(this._firstIndex=n.index,this.dispatchEvent(new CustomEvent(`wui-tour:start`,{bubbles:!0,detail:{total:this._progress.total()}})),e===this._run&&(this._build(),this._show(n))):this._finish(`noTargets`))}next(){return this._move(1)}back(){return!this._current||this._current.index<=this._firstIndex?Promise.resolve():this._move(-1)}async goTo(e){if(this._current){if(!Number.isInteger(e)||e<0||e>=this._steps.length)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);await this._go(e,1)}}stop(){this._running&&(this._run++,this._teardown(),this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`))}async _locate(e,t,n){let r=this._steps;for(let i=e;i>=0&&i<r.length;i+=t){let e=r[i];if(!e)break;if(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target),a=t instanceof HTMLElement||t instanceof SVGElement?t:null;if(X(a))return this._progress.position(i),{index:i,target:a};this._progress.drop(i)}return null}async _beforeStep(e,t){let n=[];this.dispatchEvent(new CustomEvent(`wui-tour:beforestep`,{bubbles:!0,detail:{step:e,index:t,wait:e=>n.push(e)}})),await Promise.all(n),typeof this.onBeforeStep==`function`&&await this.onBeforeStep(e,t)}_build(){let e=`wui-tour-${++Ft}`,t=document.createElement(`div`);t.className=`wui-tour-layer`,t.replaceChildren(p(`div`,{class:`wui-tour-spot`,"aria-hidden":`true`}),p(`div`,{class:`wui-tour-card`,role:`dialog`,tabindex:`-1`,"aria-labelledby":`${e}-title`,"aria-describedby":`${e}-text`},p(`p`,{class:`wui-tour-position`}),p(`h2`,{class:`wui-tour-title`,id:`${e}-title`}),p(`p`,{class:`wui-tour-text`,id:`${e}-text`}),p(`div`,{class:`wui-tour-actions`},p(`button`,{type:`button`,class:`btn btn-sm btn-link wui-tour-skip`}),p(`div`,{class:`wui-tour-nav`},p(`button`,{type:`button`,class:`${f(`neutral`,`outline`,`sm`)} wui-tour-back`,"data-wui":c}),p(`button`,{type:`button`,class:`${f(`primary`,`solid`,`sm`)} wui-tour-next`,"data-wui":c})))),p(`div`,{class:`visually-hidden`,role:`status`,"aria-live":`polite`}));let n=t;this._shadow=null,this.isolated&&(n=document.createElement(At),this._shadow=n.attachShadow({mode:`open`}),Rt(this._shadow),this._shadow.appendChild(t)),n.setAttribute(`popover`,`manual`),T(document).appendChild(n),document.documentElement.setAttribute(St,``),this._outer=n,this._layer=t;let r=Z(t,`.wui-tour-spot`,HTMLDivElement),i=Z(t,`.wui-tour-card`,HTMLDivElement),a=Z(t,`[role=status]`,HTMLElement);this._spot=r,this._card=i,this._live=a,Z(i,`.wui-tour-skip`,HTMLElement).addEventListener(`click`,()=>this._close(`skipped`,`button`)),Z(i,`.wui-tour-back`,HTMLElement).addEventListener(`click`,()=>this._move(-1)),Z(i,`.wui-tour-next`,HTMLElement).addEventListener(`click`,()=>this._move(1));let s=e=>this._key(e);this._onKey=s;let l=e=>{let t=this._layer;if(!t||this._ending)return;let n=this._current,r=n?this._stepAt(n.index):null;if(!(e.target instanceof Node))throw Error(`<wui-tour> saw a focus change from a non-node target`);Ee(t,r,n?.target??null,e.target)||i.focus()};this._onFocusIn=l,document.addEventListener(`keydown`,s,!0),this._shadow||document.addEventListener(`focusin`,l),o(n,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_raise(){let e=this._outer;if(!e)throw Error(`<wui-tour> raises a step before its host is built`);let t=T(this.ownerDocument);e.parentElement!==t&&t.appendChild(e),se(e)}_show(e){this._current=e;let{index:t,target:n}=e,r=this._stepAt(t),i=this._layer,a=this._spot,o=this._card,s=this._live;if(!i||!a||!o||!s)throw Error(`<wui-tour> shows a step before its layer is built`);this._raise();let c=this._progress.position(t),l=this._progress.total(),u=c===l&&!this._endDialogText(),d=Tt(this,c,l);Et(o,{text:d,position:c,total:l}),xt(o,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)}),o.toggleAttribute(`data-welcome`,!n);let f=F(this,{layer:i,spot:a,card:o},r,n),p=Z(o,`.wui-tour-title`,HTMLElement);p.textContent=r.title||``,p.hidden=!r.title,Z(o,`.wui-tour-text`,HTMLElement).textContent=r.description||``,Z(o,`.wui-tour-skip`,HTMLElement).textContent=this._label(`skip`);let m=Z(o,`.wui-tour-back`,HTMLElement);m.textContent=this._label(`back`),m.hidden=t<=this._firstIndex,Z(o,`.wui-tour-next`,HTMLElement).textContent=this._label(u?`done`:`next`);let h=[d,r.title,r.description].filter(Boolean).join(`. `);s.textContent=f?[h,f].join(/[.!?]$/.test(h)?` `:`. `):h,Je(o,n),a.removeAttribute(J),this._place(),Re(o),this._unbindAdvance?.(),this._unbindAdvance=Te(r,n,()=>void this._move(1));let g=this._active();(g!==null&&o.contains(g)?!(g instanceof HTMLElement&&g.hidden):this._shadow!==null&&It(Lt()))||o.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t,position:c,total:l}}))}_place(){if(!this._current||!this._layer)return;let e=this._spot,t=this._card;if(!e||!t)throw Error(`<wui-tour> places a step before its layer is built`);Ye(e,t,this._current.target)}_follow(){if(!this._current||!this._layer||this._ending)return;let e=this._spot;if(!e)throw Error(`<wui-tour> follows a step before its spot is built`);let t=e.style.cssText;this._place(),e.style.cssText!==t&&e.setAttribute(J,``)}async _move(e){this._current&&await this._go(this._current.index+e,e)}async _go(e,t){if(!this._current||this._moving)return;this._moving=!0;let n=this._run;try{let r=await this._locate(e,t,n);if(n!==this._run)return;if(r){let e=this._card;if(!e)throw Error(`<wui-tour> moved with no card showing`);let t=ze(e);if(t!==null&&await t,n!==this._run)return;this._show(r)}else if(t>0){let e=this._endDialogText(),t=e?await this._showEnd(e):`done`;if(n!==this._run)return;let r=await this._close(t===`next`?`next`:`finished`);if(t===`next`&&r&&e){let t=this.ownerDocument.defaultView;if(!t)throw Error(`<wui-tour> has no window to follow its next link in`);t.location.assign(e.nextHref)}}}finally{this._moving=!1}}_showEnd(e){this._unbindAdvance?.(),this._unbindAdvance=null;let t=this._layer,n=this._spot,r=this._card;if(!t||!n||!r)throw Error(`<wui-tour> ends a tour before its layer is built`);return F(this,{layer:t,spot:n,card:r},null,null),n.removeAttribute(J),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),ot(t,e,this._ending.signal)}_key(e){if(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)return;let t=a(e.key,i(this));if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(t===`ArrowRight`||t===`ArrowLeft`){if(It(e.composedPath?.()[0]??e.target))return;if(e.preventDefault(),t===`ArrowRight`)this._move(1);else{let e=this._current;if(!e)throw Error(`<wui-tour> moved back with no step showing`);e.index>this._firstIndex&&this._move(-1)}}else if(e.key===`Tab`&&!this._shadow){let t=this._current,n=this._card;if(!t||!n)throw Error(`<wui-tour> cycled focus with no step showing`);De(e,{card:n,active:this._active(),step:this._stepAt(t.index),target:t.target})}}_teardown(){if(!this._layer)return;this._onKey&&document.removeEventListener(`keydown`,this._onKey,!0),this._onFocusIn&&document.removeEventListener(`focusin`,this._onFocusIn);let e=!this._shadow||this._shadow.activeElement!==null||!document.activeElement||document.activeElement===document.body;this._unbindAdvance?.(),this._unbindAdvance=null,this._ending?.abort(),this._ending=null,this._seenMark=null;let t=this._outer;if(s(t),!t)throw Error(`<wui-tour> has a layer with no host to remove`);Be(t),document.documentElement.removeAttribute(St),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let n=this._returnFocus;this._returnFocus=null,e&&n?.isConnected&&(n instanceof HTMLElement||n instanceof SVGElement)&&n.focus()}async _close(e,t=null){let n=this._run,r=this._current,i=r?{index:r.index,position:this._progress.position(r.index),total:this._progress.total()}:Pt,a=this._seenMark;this._teardown();let o=e===`next`?`finished`:e,s=!1;try{n===this._run&&await(a??this._markSeen(o)),s=n===this._run}finally{this._finish(e,i,t)}return s}_finish(e,t=Pt,n=null){this._run++,this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`),this.dispatchEvent(new CustomEvent(`wui-tour:close`,{bubbles:!0,detail:{reason:e,...t,via:n}}))}},$=class extends r{constructor(){super(),this.shadowRoot||this.attachShadow({mode:`open`})}};return t(`wui-tour`,zt),t(`wui-tour-step`,$),e.WuiTourStep=$,e})({});
1
+ var WeborityTour=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){if(typeof customElements>`u`||customElements.get(e))return;let n=[];if(typeof document<`u`)for(let r of document.querySelectorAll(e))for(let i of Object.keys(r)){let a=Object.getOwnPropertyDescriptor(t.prototype,i);if(a&&(a.set||a.get)&&(n.push([r,i,Reflect.get(r,i)]),!Reflect.deleteProperty(r,i)))throw Error(`defineElement: could not clear the early "${i}" property on <${e}>.`)}customElements.define(e,t);for(let[t,r,i]of n)if(!Reflect.set(t,r,i))throw Error(`defineElement: could not restore the "${r}" property on <${e}>.`)}var n=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(n);var r=HTMLElement;function i(e){return getComputedStyle(e).direction===`rtl`}function a(e,t){return t?e===`ArrowRight`?`ArrowLeft`:e===`ArrowLeft`?`ArrowRight`:e:e}function o(e,t){s(e),e._reanchor=t,e._reanchorScroll=n=>{n.composedPath().includes(e)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function s(e){if(!e?._reanchor)return;window.removeEventListener(`resize`,e._reanchor);let t=e._reanchorScroll;t&&window.removeEventListener(`scroll`,t,!0),e._reanchor=null,e._reanchorScroll=null}var c=(e,t)=>Object.getOwnPropertyDescriptor(e,t)!==void 0,l=`AppButton`,u=new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),d={solid:e=>`btn-${e}`,soft:e=>`btn-soft-${e}`,outline:e=>`btn-outline-${e}`,ghost:e=>`btn-ghost-${e}`,link:e=>`btn-link-${e}`,glass:()=>`btn-glass`};function f(e){return c(d,e)}function p(e=`primary`,t=`solid`,n=`md`){if(!u.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!f(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=d[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}function m(e,t,...n){if(e.toLowerCase()===`svg`)throw Error(`make() builds HTML elements; use svgRoot for svg`);let r=document.createElement(e);for(let[e,n]of Object.entries(t??{}))n===!0?r.setAttribute(e,``):(typeof n==`string`||typeof n==`number`)&&r.setAttribute(e,String(n));let i=[];for(let e of n)e instanceof Node?i.push(e):(typeof e==`string`||typeof e==`number`)&&i.push(document.createTextNode(String(e)));return r.append(...i),r}var h=`data-wui-dismiss`,g=`data-wui-closing`,_=`[${h}]`,v=`(prefers-reduced-motion: reduce)`,y=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,b=new WeakSet,x=Symbol.for(`webority.ui.modal-stack`),ee=Symbol.for(`webority.ui.root-watches`);function te(e){let t=e;return t[ee]??=new Set,t[ee]}function ne(e){let t=e.querySelector(`[data-autofocus]`);if(t)return t;let n=null;for(let t of e.querySelectorAll(y))if(!t.closest(`[hidden],[inert]`)){if(!t.closest(`${_},.wui-modal-back`))return t;n??=t}return n}function re(e){let t=[],n=new Map;for(let r of e.querySelectorAll(y))if(!(r.closest(`[hidden],[inert]`)||r.closest(`dialog`)!==e)&&!(r.tabIndex<0||r.getClientRects().length===0)){if(r instanceof HTMLInputElement&&r.type===`radio`&&r.name){let e=n.get(r.name);e?r.checked&&!e.checked&&(e.checked=r,t[t.indexOf(e.first)]=r):(n.set(r.name,{first:r,checked:r.checked?r:null}),t.push(r))}else t.push(r)}return t}function S(e){let t=e;return t[x]??=[],t[x]}function ie(e){C(e),S(e.ownerDocument).push(e)}function C(e){let t=S(e.ownerDocument),n=t.indexOf(e);n>=0&&t.splice(n,1)}function w(e){for(let t of te(e)){let n=T(e);t.last!==n&&(t.last=n,t.listener(n))}}function ae(e){let t=Promise.allSettled(e.getAnimations().map(e=>e.finished));return new Promise(e=>{let n=window.setTimeout(e,400);t.then(()=>{window.clearTimeout(n),e()})})}function oe(e,t){let n=t.focus===`first-control`?ne(e):null,r=n??e,i=r===e&&!e.hasAttribute(`tabindex`);i&&e.setAttribute(`tabindex`,`-1`);let a=!t.escape&&!e.hasAttribute(`closedby`);a&&e.setAttribute(`closedby`,`none`),b.add(e);let o=()=>{if(ie(e),!e.hasAttribute(`open`)){let t=n!==null&&!e.querySelector(`[autofocus]`);t&&n.setAttribute(`autofocus`,``);try{e.showModal()}catch(t){throw C(e),t}finally{t&&n.removeAttribute(`autofocus`)}}r.focus(),w(e.ownerDocument)},s=!1,c=n=>{if(n.key!==`Escape`||n.defaultPrevented||!t.escape||n.altKey||n.ctrlKey||n.metaKey)return;let r=e.ownerDocument;T(r)===e&&(e.querySelector(`:popover-open`)||r.querySelector(`[popover=""]:popover-open, [popover="auto"]:popover-open`)||(s=!0,window.setTimeout(()=>{s&&b.has(e)&&e.open&&(s=!1,t.onRequestClose(`escape`))},0)))},l=t=>{if(t.key!==`Tab`||t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)return;let n=e.ownerDocument;if(T(n)!==e||e.querySelector(`:popover-open`))return;t.preventDefault();let r=re(e),i=r[0],a=r[r.length-1];if(!i||!a){e.focus();return}let o=n.activeElement,s=o?r.findIndex(e=>e===o||e.contains(o)):-1;s<0?(t.shiftKey?a:i).focus():r[((t.shiftKey?s-1:s+1)+r.length)%r.length]?.focus()},u=e=>{s=!1,e.preventDefault(),t.escape&&t.onRequestClose(`escape`)},d=n=>{let r=n.target;if(!(r instanceof Element))return;let i=r.closest(_);if(i&&i.closest(`dialog`)===e){t.onRequestClose(`dismiss`);return}if(r!==e||!t.backdrop)return;let a=e.getBoundingClientRect();(n.clientX<a.left||n.clientX>a.right||n.clientY<a.top||n.clientY>a.bottom)&&t.onRequestClose(`backdrop`)},f=()=>{let n=s;s=!1,C(e),b.has(e)?(o(),n&&t.onRequestClose(`escape`)):w(e.ownerDocument)},p=e.ownerDocument;return p.addEventListener(`keydown`,c),p.addEventListener(`keydown`,l),e.addEventListener(`cancel`,u),e.addEventListener(`click`,d),e.addEventListener(`close`,f),o(),()=>{p.removeEventListener(`keydown`,c),p.removeEventListener(`keydown`,l),e.removeEventListener(`cancel`,u),e.removeEventListener(`click`,d),e.removeEventListener(`close`,f),b.delete(e),i&&e.removeAttribute(`tabindex`),a&&e.removeAttribute(`closedby`),C(e),w(e.ownerDocument)}}async function se(e){b.delete(e),e.setAttribute(g,``),!window.matchMedia(v).matches&&typeof e.getAnimations==`function`&&e.getAnimations().length>0&&await ae(e),e.close(),C(e),w(e.ownerDocument),e.removeAttribute(g)}function ce(e){if(le(e),!e.isConnected)throw Error(`nativeOverlay: raisePopover was given a panel that is not on the page; a caller whose overlay root can leave the page skips the raise until the panel moves to the new root`);e.hidePopover(),e.showPopover()}function le(e){if(!e.hasAttribute(`popover`))throw Error(`nativeOverlay: the panel has no popover attribute`)}function T(e=document){let t=S(e);for(let e=t.length-1;e>=0;e--){let n=t[e];if(n?.isConnected&&n.hasAttribute(`open`))return n}return e.body}var ue=/\{([A-Za-z0-9_]+)\}/g,de=(e,t)=>Object.getOwnPropertyDescriptor(e,t)!==void 0,fe=new Map,pe=0,me=new Map;function E(e,t){let n=fe.get(e);if(n===void 0)return t;let r=me.get(e);if(r!==void 0&&r.version===pe&&r.english===t&&ge(r.merged,t))return r.merged;let i=he(e,n,t);return me.set(e,{version:pe,english:t,merged:i}),i}function he(e,t,n){let r={};for(let[i,a]of Object.entries(t)){let t=de(n,i)?n[i]:void 0;if(t===void 0)throw RangeError(`Text ${e}.${i} is not a key of the English text. Allowed keys: ${Object.keys(n).join(`, `)}.`);let o=D(t);for(let t of D(a))if(!o.includes(t))throw RangeError(`Text ${e}.${i} uses {${t}}, which the English text does not have. Allowed placeholders: ${o.length===0?`none`:o.map(e=>`{${e}}`).join(`, `)}.`);r[i]=a}return Object.assign({},n,r)}function ge(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(t=>de(e,t))}function D(e){return Array.from(e.matchAll(ue),e=>e[1]??``)}var O={backLabel:`Back`,doneLabel:`Done`,endMessage:`You know your way around now. Enjoy exploring.`,endTitle:`You're all set`,mediaPauseLabel:`Pause animation`,mediaPlayLabel:`Play animation`,nextLabel:`Next`,progressLabel:`Step {current} of {total}`,skipLabel:`Skip`},_e={advanceLabel:`Click {actionName} to continue.`},k=`data-advance`,A=`wui-tour-hint`,j=`wui-tour-pointer`,ve=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,ye=()=>E(`tourAdvance`,_e),M=(e,t)=>e?.advanceOn===`click`&&!!t,N=e=>(e??``).replace(/\s+/g,` `).trim(),be=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLMeterElement||e instanceof HTMLOutputElement||e instanceof HTMLProgressElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?e.labels:null,xe=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLFieldSetElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement?e.disabled:!1;function Se(e){let t=e.ownerDocument,n=(e.getAttribute(`aria-labelledby`)||``).split(/\s+/).filter(Boolean),r=e instanceof HTMLInputElement&&/^(button|submit|reset)$/.test(e.type)?e.value:``,i=[n.map(e=>t.getElementById(e)?.textContent??``).join(` `),e.getAttribute(`aria-label`),Array.from(be(e)??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=N(e);if(t)return t}return``}function Ce(e){for(let t of[e,...e.querySelectorAll(ve)])if((t instanceof HTMLElement||t instanceof SVGElement)&&t.tabIndex>=0&&!xe(t))return t;return null}function P(e,t,n){let r=(e.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(e=>e&&e!==t);n&&r.push(t),r.length>0?e.setAttribute(`aria-describedby`,r.join(` `)):e.removeAttribute(`aria-describedby`)}function we(e,t){let n=e.querySelector(`.${A}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t)n?.remove(),i&&P(e,i,!1);else{if(!n){n=e.ownerDocument.createElement(`p`),n.className=A,i&&(n.id=i);let t=e.querySelector(`.wui-tour-actions`);if(!t)throw Error(`Tour card has no actions row.`);t.before(n)}n.textContent=t,i&&P(e,i,!0)}}function Te(e,t){let n=e.querySelector(`.${j}`);if(!t){n?.remove();return}if(n)return;let r=e.ownerDocument.createElement(`span`);r.className=j,r.setAttribute(`aria-hidden`,`true`),e.append(r)}var Ee=e=>getComputedStyle(e).animationName;function F(e,{layer:t,spot:n,card:r},i,a){let o=M(i,a);t.toggleAttribute(k,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(k)&&(n.removeAttribute(k),o&&Ee(n)),o&&n.setAttribute(k,``),Te(n,o);let s=r.querySelector(`.wui-tour-next`);if(!(s instanceof HTMLElement))throw Error(`Tour card has no next button.`);s.classList.toggle(`btn-primary`,!o),s.classList.toggle(`btn-link`,o);let c=o?N(i?.actionLabel)||Se(a):``,l=e.getAttribute(`advance-label`)||ye().advanceLabel,u=c?l.replace(/\{actionName\}/g,()=>c):``;return we(r,u),u}function De(e,t,n){if(!M(e,t))return()=>{};let r,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function Oe(e,t,n,r){return e.contains(r)||M(t,n)&&n.contains(r)}function ke(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=M(r,i)?Ce(i):null;o&&a.push(o);let s=a.findIndex(e=>e===n||e===o&&i?.contains(n));e.preventDefault();let c=a[s===-1?e.shiftKey?a.length-1:0:(s+(e.shiftKey?-1:1)+a.length)%a.length];if(!c)throw Error(`Tour card has no focus stop.`);c.focus()}function Ae(e){return e.isComposing||e.keyCode===229}function je(e){return e.key===`Enter`&&!Ae(e)}var I=`http://www.w3.org/2000/svg`;function L(e){return e.map(Ne)}function Me(e,t){let n=document.createElementNS(I,`svg`);return R(n,e),n.append(...L(t)),n}function Ne(e){let[t,n,r]=e,i=document.createElementNS(I,t);return R(i,n),typeof r==`string`?i.append(document.createTextNode(r)):r&&i.append(...L(r)),i}function R(e,t){for(let[n,r]of Object.entries(t))r===!0?e.setAttribute(n,``):(typeof r==`string`||typeof r==`number`)&&e.setAttribute(n,String(r))}var Pe=2/3,Fe=1e3,Ie=new Set([`top`,`left`,`width`,`height`]),z=new WeakMap,B=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],Le=e=>`transitionProperty`in e&&e.transitionProperty===`opacity`,Re=e=>`transitionProperty`in e&&typeof e.transitionProperty==`string`&&Ie.has(e.transitionProperty),ze=e=>`animationName`in e&&typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function Be(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,Fe);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function Ve(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?B(t,Re):[]){let t=e.effect?.getComputedTiming?.();if(typeof t?.duration!=`number`)continue;let r=typeof e.currentTime==`number`?e.currentTime:0;n=Math.max(n,(t.delay??0)+t.duration*Pe-r)}return n}function He(e){let t=Ve(e);t>0?e.style.setProperty(`--wui-tour-card-delay`,`${Math.round(t)}ms`):e.style.removeProperty(`--wui-tour-card-delay`),e.dataset.state=`entering`;let n={};z.set(e,n);let r=()=>{z.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=B(e,ze);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function Ue(e){return e.dataset.state=`leaving`,Be(B(e,Le))}function We(e){let t=e.shadowRoot?.querySelector(`.wui-tour-layer`),n=e.classList.contains(`wui-tour-layer`)?e:t instanceof HTMLElement?t:null;n&&(n.dataset.state=`leaving`);let r=n?Be(B(n,Le)):null;r?(e.setAttribute(`inert`,``),r.then(()=>e.remove())):e.remove()}var Ge=2,V=12,H=8,Ke=4,U=20,qe=`(max-width: 575.98px)`,Je=[`bottom`,`top`,`right`,`left`],Ye=[`bottom`,`top`,`left`,`right`],Xe=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],Ze,W=(e,t,n)=>Math.max(t,Math.min(e,n)),G=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function Qe(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=it(e),r=e.offsetHeight+V;if(t.getBoundingClientRect().height+4+r*2<=n.bottom-n.top){t.scrollIntoView({block:`center`,inline:`nearest`});return}let i=t.style.scrollMarginTop;t.style.scrollMarginTop=`${n.top+r+Ge}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function $e(e,t,n){let r=e.style,a=t.style,o=at(t);if(!n){r.top=`50%`,r.left=`50%`,r.width=`0px`,r.height=`0px`,r.boxShadow=`0 0 0 100vmax var(--color-scrim-strong)`;for(let e of Xe)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,o.hidden=!0,a.position=`fixed`,a.top=`50%`,a.left=`50%`,a.transform=`translate(-50%, -50%)`,a.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,a.transform=``,a.position=`fixed`;let s=n.getBoundingClientRect();r.top=`${s.top}px`,r.left=`${s.left}px`,r.width=`${s.width}px`,r.height=`${s.height}px`,et(r,n);let c=t.scrollTop;a.maxHeight=``;let l={width:t.offsetWidth,height:t.offsetHeight},u=it(t),d=u.bottom-u.top,f={bottom:u.bottom-s.bottom-V,top:s.top-V-u.top,right:u.right-s.right-V,left:s.left-V-u.left},p=window.matchMedia(qe).matches,m=(i(n)?Ye:Je).find(e=>e===`top`||e===`bottom`?l.height<=f[e]+1:!p&&l.width<=f[e]+1&&l.height<=d+1),h=Math.min(s.bottom,u.bottom+H)-Math.max(s.top,u.top-H);m?tt(t,o,m,s,u,l):h>=Math.min(l.height,d)+8?nt(t,o,s,u,l):rt(t,o,f.bottom>=f.top?`bottom`:`top`,s,u,l,f),t.scrollTop=c}function et(e,t){Ze??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of Xe)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),Ze&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function tt(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=G(r.left,r.right,i.left,i.right);s=W(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+V:r.top-V-a.height,l=W(e-s,U,a.width-U)}else{let e=G(r.top,r.bottom,i.top,i.bottom);c=W(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+V:r.left-V-a.width,l=W(e-c,U,a.height-U)}e.dataset.placement=n,e.style.top=`${c}px`,e.style.left=`${s}px`,t.hidden=!1,t.style.left=o?`${l-e.clientLeft-t.offsetWidth/2}px`:``,t.style.top=o?``:`${l-e.clientTop-t.offsetHeight/2}px`}function nt(e,t,n,r,i){let a=r.bottom-r.top;e.dataset.placement=`overlap`,t.hidden=!0,e.style.maxHeight=i.height>a?`${Math.max(a,0)}px`:``;let o=Math.min(n.bottom,r.bottom)-Ke;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${W(n.left+Ke,r.left,r.right-i.width)}px`}function rt(e,t,n,r,i,a,o){let s=Math.max(o[n],0),c=Math.min(a.height,s);e.dataset.placement=n,t.hidden=!0,e.style.maxHeight=a.height>s?`${s}px`:``,e.style.top=`${n===`bottom`?r.bottom+V:r.top-V-c}px`;let l=G(r.left,r.right,i.left,i.right);e.style.left=`${W(l-a.width/2,i.left,i.right-a.width)}px`}function it(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e]??``)||0;return{top:r(`paddingTop`)+H,bottom:window.innerHeight-r(`paddingBottom`)-H,left:r(`paddingLeft`)+H,right:window.innerWidth-r(`paddingRight`)-H}}function at(e){let t=e.querySelector(`:scope > .wui-tour-arrow`);if(t instanceof HTMLElement)return t;let n=document.createElement(`span`);return n.className=`wui-tour-arrow`,n.setAttribute(`aria-hidden`,`true`),n.hidden=!0,e.append(n),n}var ot=0,st=`btn btn-sm btn-link`;function K(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`Expected "${t}" to match a ${n.name}.`);return r}function ct(e,t){let n=`wui-tour-end-${++ot}`,{nextLabel:r,nextHref:i}=e,a=r&&i?m(`a`,{class:`${p(`primary`,`solid`,`sm`)} wui-tour-end-next`,"data-wui":l,href:i},r):null,o=a!==null,s=m(`button`,{type:`button`,class:`${o?st:p(`primary`,`solid`,`sm`)} wui-tour-end-button`,"data-wui":l},e.button);return m(t?`dialog`:`div`,{class:`wui-tour-card wui-tour-end`,"data-layout":`center`,"data-next":o||void 0,role:`dialog`,tabindex:-1,"aria-labelledby":`${n}-title`,"aria-describedby":`${n}-message`},m(`div`,{class:`wui-tour-end-mark`,"aria-hidden":`true`},Me({viewBox:`0 0 24 24`,focusable:`false`},[[`path`,{d:`M5 12.5l4.5 4.5L19 7.5`}]])),m(`h2`,{class:`wui-tour-title wui-tour-end-title`,id:`${n}-title`},e.title),m(`p`,{class:`wui-tour-text wui-tour-end-message`,id:`${n}-message`},e.message),m(`div`,{class:`wui-tour-actions`},a,s))}var lt=e=>e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;function ut(e,t,n){let r=e.ownerDocument,i=ct(t,e.getRootNode()===r),a=K(i,`.wui-tour-end-button`,HTMLButtonElement),o=i.querySelector(`.wui-tour-end-next`);if(o!==null&&!(o instanceof HTMLAnchorElement))throw Error(`The end dialog's next link is not a link.`);let s=o,c=s??a,l=new AbortController,u=i instanceof HTMLDialogElement?i:null,d=null;return new Promise(o=>{let f=e=>{if(l.abort(),d&&u){let e=d;d=null,se(u).then(e)}o(e)};if(n?.aborted){f(`done`);return}let p=K(e,`.wui-tour-card:not(.wui-tour-end)`,HTMLElement),m=K(e,`.wui-tour-spot`,HTMLElement),h=K(e,`[role=status]`,HTMLElement),g={signal:l.signal};n?.addEventListener(`abort`,()=>f(`done`),g),a.addEventListener(`click`,()=>f(`done`),g),s&&s.addEventListener(`click`,e=>{lt(e)&&(e.preventDefault(),f(`next`))},g),r.addEventListener(`keydown`,e=>{if(!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){if(d)return;e.preventDefault(),e.stopPropagation(),f(`done`)}else je(e)&&s&&!e.shiftKey&&(e.composedPath?.()[0]??e.target)===s&&(e.preventDefault(),f(`next`))}},{capture:!0,signal:l.signal});let _=()=>{l.signal.aborted||(p.hidden=!0,$e(m,p,null),e.append(i),He(i),u&&(d=oe(u,{escape:!0,backdrop:!1,focus:`first-control`,onRequestClose:()=>f(`done`)})),h.textContent=[t.title,t.message].filter(Boolean).join(`. `),c.focus())},v=Ue(p);v===null?_():v.then(_)})}var dt=` :host { all: initial; display: revert-layer; position: fixed; inset: 0; ${Object.entries({"--wui-z-tour":`1550`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-popover":`0px 8px 28px -6px rgba(7, 20, 55, 0.14)`,"--wui-ease-out":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-ease-linear":`cubic-bezier(0, 0, 1, 1)`,"--wui-duration-fast":`150ms`,"--wui-duration-default":`250ms`,"--wui-duration-slow":`400ms`,"--wui-space-xs":`4px`,"--wui-tour-motion-duration":`200ms`,"--wui-tour-motion-ease":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-tour-spot-duration":`240ms`,"--wui-tour-spot-ease":`cubic-bezier(0.32, 0.72, 0, 1)`,"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-text":`#4F46E5`,"--color-focus-ring":`#4F46E5`,"--wui-focus-ring-width":`2px`,"--wui-focus-ring-offset":`2px`,"--color-on-primary":`#FFFFFF`,"--color-success-soft":`#E8FAEE`,"--color-success-text":`#0e7531`,"--color-on-scrim":`#FFFFFF`,"--color-scrim-strong":`color-mix(in srgb, #071437 62%, transparent)`,"--color-surface":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-bg-muted":`#F5F6FA`}).map(([e,t])=>` ${e}: ${t};`).join(` `)} } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; } .btn { display: inline-block; margin: 0; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; } .btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); } .btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); } .btn-outline-neutral { border-color: var(--color-text-muted); color: var(--color-text-muted); } .btn-outline-neutral:hover { background: var(--color-bg-muted); color: var(--color-text); } .btn-link { font-weight: 400; color: var(--color-primary-text); text-decoration: underline; } .btn-link:hover { color: var(--color-primary-hover); } .wui-tour-layer { pointer-events: none; font-family: "Webority Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--color-text); text-align: start; } .wui-tour-card { pointer-events: auto; } .wui-tour-layer { position: fixed; inset: 0; z-index: var(--wui-z-tour); width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; background: none; } .wui-tour-spot { position: fixed; box-shadow: 0 0 0 2px var(--color-primary), 0 0 4px 2px color-mix(in srgb, var(--color-primary) 30%, transparent), 0 0 0 100vmax var(--color-scrim-strong); pointer-events: none; } .wui-tour-card { display: flex; flex-direction: column; gap: 8px; width: min(360px, 100vw - 16px); padding: 16px; overflow-y: auto; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--wui-radius-lg); corner-shape: squircle; box-shadow: var(--wui-shadow-popover); } .wui-tour-card:focus { outline: none; } .wui-tour-card:focus-visible { outline: var(--wui-focus-ring-width) solid var(--color-focus-ring); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-title { margin: 0; font-size: 16px; font-weight: 600; } .wui-tour-text { margin: 0; font-size: 14px; color: var(--color-text-muted); } .wui-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; } .wui-tour-nav { display: flex; gap: 8px; } .wui-tour-skip { color: var(--color-text-muted); } .wui-tour-back, .wui-tour-next { min-width: 64px; } @keyframes wui-tour-fade-in { from { opacity: 0; } to { opacity: 1; } } @keyframes wui-tour-card-enter { from { opacity: 0; scale: 0.96; translate: var(--wui-tour-card-lift, 0 6px); } to { opacity: 1; scale: 1; translate: 0 0; } } .wui-tour-layer[data-state=leaving], .wui-tour-card[data-state=leaving] { opacity: 0; } .wui-tour-layer[data-state=leaving], .wui-tour-layer[data-state=leaving] * { pointer-events: none; } @media (prefers-reduced-motion: no-preference) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-spot { transition: top var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), left var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), width var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), height var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), border-radius var(--wui-tour-spot-duration) var(--wui-tour-spot-ease); } .wui-tour-spot[data-tracking] { transition: none; } .wui-tour-card { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=top] { --wui-tour-card-lift: 0 -6px; transform-origin: bottom center; } .wui-tour-card[data-placement=bottom] { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=left] { --wui-tour-card-lift: -6px 0; transform-origin: right center; } .wui-tour-card[data-placement=right] { --wui-tour-card-lift: 6px 0; transform-origin: left center; } .wui-tour-card[data-placement=overlap], .wui-tour-card[data-placement=center] { --wui-tour-card-lift: 0 0; transform-origin: center; } .wui-tour-card[data-state=entering] { animation: wui-tour-card-enter var(--wui-tour-motion-duration) var(--wui-tour-motion-ease) var(--wui-tour-card-delay, 0ms) both; } .wui-tour-card[data-state=leaving] { transition: opacity calc(var(--wui-tour-motion-duration) / 2) var(--wui-tour-motion-ease); } } @media (prefers-reduced-motion: reduce) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-card[data-state=entering] { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear) both; } } .wui-tour-progress-bar { display: flex; gap: 4px; } .wui-tour-progress-segment { flex: 1 1 0; height: 4px; border-radius: 999px; background: var(--color-border); } .wui-tour-progress-segment[data-filled] { background: var(--color-primary); } .wui-tour-position { margin: 0; font-size: 12px; color: var(--color-text-muted); } .wui-tour-layer { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); } .wui-tour-card:has(.wui-tour-arrow:not([hidden])) { overflow: visible; } .wui-tour-arrow { position: absolute; width: 8px; height: 8px; background: var(--color-surface); border: 1px solid var(--color-border); rotate: 45deg; pointer-events: none; } .wui-tour-card[data-placement=bottom] .wui-tour-arrow { top: -5px; border-right-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=top] .wui-tour-arrow { bottom: -5px; border-top-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=right] .wui-tour-arrow { left: -5px; border-top-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=left] .wui-tour-arrow { right: -5px; border-bottom-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } @media (max-width: 575.98px) { .wui-tour-card { width: calc(100vw - 16px); } .wui-tour-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; } } .wui-tour-media { position: relative; order: -1; flex: none; aspect-ratio: 16/9; margin: -16px -16px 4px; overflow: hidden; background: var(--color-border); } .wui-tour-media>img, .wui-tour-media>video { display: block; width: 100%; height: 100%; object-fit: cover; } .wui-tour-card[data-welcome] { width: min(420px, 100vw - 16px); } .wui-tour-media-toggle { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--color-scrim-strong); color: var(--color-on-scrim); cursor: pointer; } .wui-tour-media-toggle>svg { width: 20px; height: 20px; fill: currentColor; } .wui-tour-media-toggle:focus-visible { outline: 2px solid var(--color-on-scrim); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-layer[data-advance] { pointer-events: none; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-card { pointer-events: auto; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-spot::before { content: ""; position: absolute; inset: -100vmax; pointer-events: auto; clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 100vmax 100vmax, calc(100% - 100vmax) 100vmax, calc(100% - 100vmax) calc(100% - 100vmax), 100vmax calc(100% - 100vmax), 100vmax 100vmax); } .wui-tour-hint { margin: 0; font-size: 14px; font-weight: 600; color: var(--color-text); } .wui-tour-pointer { position: absolute; top: 50%; left: 50%; width: 18px; height: 24px; pointer-events: none; } .wui-tour-pointer::before { content: ""; position: absolute; inset: 0; background: var(--color-primary); clip-path: polygon(0 0, 0 75%, 28% 58%, 46% 100%, 62% 92%, 45% 52%, 85% 52%); filter: drop-shadow(1px 0 0 var(--color-surface)) drop-shadow(-1px 0 0 var(--color-surface)) drop-shadow(0 1px 0 var(--color-surface)) drop-shadow(0 -1px 0 var(--color-surface)); } .wui-tour-pointer::after { content: ""; position: absolute; top: -16px; left: -16px; width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary); opacity: 0; display: none; } @media (max-width: 575.98px) { .wui-tour-pointer { width: 24px; height: 24px; translate: -50% -50%; } .wui-tour-pointer::before { clip-path: none; border-radius: 50%; box-shadow: 0 0 0 2px var(--color-surface); filter: none; } .wui-tour-pointer::after { top: -4px; left: -4px; } } @keyframes wui-tour-tap { 0% { opacity: 0; transform: translate(56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-tap-rtl { 0% { opacity: 0; transform: translate(-56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(-56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-ripple { 0%, 50% { opacity: 0; transform: scale(0.2); } 52% { opacity: 0.35; transform: scale(0.2); } 80%, 100% { opacity: 0; transform: scale(1); } } @media (prefers-reduced-motion: no-preference) { .wui-tour-pointer { opacity: 0; animation: wui-tour-tap calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } .wui-tour-pointer:dir(rtl) { animation-name: wui-tour-tap-rtl; } .wui-tour-pointer::after { display: block; animation: wui-tour-ripple calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } } @keyframes wui-tour-check { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } } .wui-tour-end[data-layout=center] { --wui-tour-card-lift: 0 0; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); transform-origin: center; align-items: center; gap: 8px; width: min(420px, 100vw - 16px); max-height: calc(100vh - 16px); padding: 24px; text-align: center; } .wui-tour-end[data-layout=center] .wui-tour-actions { justify-content: center; margin-top: 8px; } .wui-tour-end[data-layout=center][data-next] .wui-tour-actions { flex-direction: column; align-items: stretch; width: 100%; gap: var(--wui-space-xs); } .wui-tour-end-mark { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--color-success-soft); color: var(--color-success-text); } .wui-tour-end-mark>svg { width: 26px; height: 26px; } .wui-tour-end-mark path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; } .wui-tour-end-title { font-size: 18px; } .wui-tour-end-message { text-wrap: balance; } .wui-tour-end-next { text-wrap: balance; } .wui-tour-end-button { min-width: 120px; } @media (prefers-reduced-motion: no-preference) { .wui-tour-end-mark path { animation: wui-tour-check var(--wui-duration-default) var(--wui-ease-out) calc(var(--wui-tour-card-delay, 0ms) + var(--wui-duration-fast)) both; } } `,ft=()=>E(`tour`,O),pt=`wui-tour-media`,mt=`wui-tour-media-toggle`,ht=`http://www.w3.org/2000/svg`,gt=`M6 5h4v14H6zM14 5h4v14h-4z`,_t=`M8 5v14l11-7z`,vt=()=>({pause:ft().mediaPauseLabel,play:ft().mediaPlayLabel}),yt=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function bt(e){let t=document.createElementNS(ht,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(ht,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function xt(e){let t=document.createElement(`img`);return t.setAttribute(`alt`,e.mediaAlt??``),t.setAttribute(`width`,`1280`),t.setAttribute(`height`,`720`),t.setAttribute(`loading`,`lazy`),t.setAttribute(`decoding`,`async`),t.setAttribute(`src`,e.media??``),t}function St(e,t){let n=document.createElement(`video`);return n.muted=!0,n.setAttribute(`muted`,``),n.loop=!0,n.setAttribute(`playsinline`,``),t&&n.setAttribute(`autoplay`,``),n.setAttribute(`preload`,t?`auto`:`metadata`),e.mediaAlt&&n.setAttribute(`aria-label`,e.mediaAlt),e.mediaPoster&&n.setAttribute(`poster`,e.mediaPoster),n.setAttribute(`src`,e.media??``),n}function Ct(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=mt;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(bt(r?gt:_t))};return e.addEventListener(`play`,()=>r()),e.addEventListener(`pause`,()=>r()),n.addEventListener(`click`,()=>{e.paused?e.play()?.catch(()=>r()):e.pause()}),r(e.hasAttribute(`autoplay`)),n}function wt(e){let t=e.querySelector(`:scope > .${pt}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function Tt(e,t,n=vt()){if(wt(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=pt,t.mediaType===`video`){let e=St(t,!yt());r.append(e,Ct(e,n))}else r.appendChild(xt(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var Et=`data-wui-tour-open`,Dt=()=>E(`tour`,O);function Ot(e){let t=new Set;return{drop:e=>{t.add(e)},position:e=>{t.delete(e);let n=0;for(let r of t)r<e&&n++;return e+1-n},total:()=>e-t.size}}function kt(e,t,n){return(e.getAttribute(`progress-label`)||Dt().progressLabel).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function At(e,{text:t,position:n,total:r}){let i=e.querySelector(`.wui-tour-position`);if(!(i instanceof HTMLElement))throw Error(`tour position label missing`);i.textContent=t;let a=e.querySelector(`.wui-tour-progress-bar`);if(!a){let t=e.ownerDocument,n=t.createElement(`div`);n.className=`wui-tour-progress`,n.setAttribute(`aria-hidden`,`true`),a=t.createElement(`div`),a.className=`wui-tour-progress-bar`,n.append(a),i.before(n)}let o=a.children;for(;o.length<r;){let t=e.ownerDocument.createElement(`span`);t.className=`wui-tour-progress-segment`,a.append(t)}for(;o.length>r;){let e=a.lastElementChild;if(!e)throw Error(`progress bar segment missing`);e.remove()}for(let e=0;e<o.length;e++){let t=o[e];if(!t)throw Error(`progress bar segment missing`);t.toggleAttribute(`data-filled`,e<n)}}var jt=`wui-tour-seen:`;function Mt(e=jt,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}function q(e){"@babel/helpers - typeof";return q=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},q(e)}function Nt(e,t){if(q(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(q(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pt(e){var t=Nt(e,`string`);return q(t)==`symbol`?t:t+``}function J(e,t,n){return(t=Pt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ft=`wui-tour-step`,It=`wui-tour-host`,Y=`data-tracking`,X=()=>E(`tour`,O),Lt=()=>({back:X().backLabel,next:X().nextLabel,skip:X().skipLabel,done:X().doneLabel,mediaPause:X().mediaPauseLabel,mediaPlay:X().mediaPlayLabel,endTitle:X().endTitle,endMessage:X().endMessage,endButton:X().doneLabel}),Rt={back:`back-label`,next:`next-label`,skip:`skip-label`,done:`done-label`,mediaPause:`media-pause-label`,mediaPlay:`media-play-label`,endTitle:`end-title`,endMessage:`end-message`,endButton:`end-button`},zt=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],Bt={index:null,position:null,total:null},Vt=0,Z=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Ht=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function Q(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`<wui-tour> layer has no ${t}`);return r}var Ut=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function Wt(e){$||($=new CSSStyleSheet,$.replaceSync(dt)),e.adoptedStyleSheets=[$]}var Gt=class extends r{static get observedAttributes(){return[`open`]}constructor(){super(),J(this,`seenStore`,void 0),J(this,`onBeforeStep`,void 0),J(this,`_run`,void 0),J(this,`_running`,void 0),J(this,`_layer`,void 0),J(this,`_outer`,void 0),J(this,`_shadow`,void 0),J(this,`_unbindAdvance`,void 0),J(this,`_ending`,void 0),J(this,`_seenMark`,void 0),J(this,`_steps`,[]),J(this,`_progress`,Ot(0)),J(this,`_firstIndex`,0),J(this,`_returnFocus`,null),J(this,`_current`,null),J(this,`_moving`,!1),J(this,`_card`,null),J(this,`_spot`,null),J(this,`_live`,null),J(this,`_onKey`,null),J(this,`_onFocusIn`,null),this.seenStore=null,this.onBeforeStep=null,this._run=0,this._running=!1,this._layer=null,this._outer=null,this._shadow=null,this._unbindAdvance=null,this._ending=null,this._seenMark=null}connectedCallback(){this.hasAttribute(`open`)&&this.start()}disconnectedCallback(){this.stop()}attributeChangedCallback(e,t,n){e===`open`&&this.isConnected&&(n===null?this.stop():this.start())}get tourId(){return this.getAttribute(`tour-id`)||``}set tourId(e){e==null||e===``?this.removeAttribute(`tour-id`):this.setAttribute(`tour-id`,String(e))}get isolated(){return this.hasAttribute(`isolated`)}set isolated(e){this.toggleAttribute(`isolated`,e===!0||e===``||e===`true`)}_stepList(){return Array.from(this.querySelectorAll(`:scope > ${Ft}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:(e.textContent??``).trim()};for(let[n,r]of zt)e.hasAttribute(r)&&(t[n]=e.getAttribute(r)??``);return t})}_stepAt(e){let t=this._steps[e];if(!t)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);return t}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?Mt():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(Rt[e])||Lt()[e]}_endDialogText(){if(this.getAttribute(`end-dialog`)===`false`)return null;let e=(this.getAttribute(`end-next-label`)??``).trim(),t=(this.getAttribute(`end-next-href`)??``).trim();return{title:this._label(`endTitle`),message:this._label(`endMessage`),button:this._label(`endButton`),nextLabel:e,nextHref:t}}_markSeen(e){let t=this._store();return t?t.markSeen(this.tourId,e):null}async start(){if(this._running)return;this._running=!0;let e=++this._run;this.hasAttribute(`open`)||this.setAttribute(`open`,``);try{await this._start(e)}catch(t){throw e===this._run&&(this._running=!1),t}}async _start(e){this._steps=this._stepList(),this._progress=Ot(this._steps.length);let t=this._store();if(t&&!this.tourId)throw Error(`<wui-tour> needs a tour-id to use a seen store.`);if(t&&await t.isSeen(this.tourId)){e===this._run&&this._finish(`alreadySeen`);return}for(let[e,t]of this._steps.entries())t.target&&!Z(document.querySelector(t.target))&&this._progress.drop(e);this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);e===this._run&&(n?(this._firstIndex=n.index,this.dispatchEvent(new CustomEvent(`wui-tour:start`,{bubbles:!0,detail:{total:this._progress.total()}})),e===this._run&&(this._build(),this._show(n))):this._finish(`noTargets`))}next(){return this._move(1)}back(){return!this._current||this._current.index<=this._firstIndex?Promise.resolve():this._move(-1)}async goTo(e){if(this._current){if(!Number.isInteger(e)||e<0||e>=this._steps.length)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);await this._go(e,1)}}stop(){this._running&&(this._run++,this._teardown(),this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`))}async _locate(e,t,n){let r=this._steps;for(let i=e;i>=0&&i<r.length;i+=t){let e=r[i];if(!e)break;if(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target),a=t instanceof HTMLElement||t instanceof SVGElement?t:null;if(Z(a))return this._progress.position(i),{index:i,target:a};this._progress.drop(i)}return null}async _beforeStep(e,t){let n=[];this.dispatchEvent(new CustomEvent(`wui-tour:beforestep`,{bubbles:!0,detail:{step:e,index:t,wait:e=>n.push(e)}})),await Promise.all(n),typeof this.onBeforeStep==`function`&&await this.onBeforeStep(e,t)}_build(){let e=`wui-tour-${++Vt}`,t=document.createElement(`div`);t.className=`wui-tour-layer`,t.replaceChildren(m(`div`,{class:`wui-tour-spot`,"aria-hidden":`true`}),m(`div`,{class:`wui-tour-card`,role:`dialog`,tabindex:`-1`,"aria-labelledby":`${e}-title`,"aria-describedby":`${e}-text`},m(`p`,{class:`wui-tour-position`}),m(`h2`,{class:`wui-tour-title`,id:`${e}-title`}),m(`p`,{class:`wui-tour-text`,id:`${e}-text`}),m(`div`,{class:`wui-tour-actions`},m(`button`,{type:`button`,class:`btn btn-sm btn-link wui-tour-skip`}),m(`div`,{class:`wui-tour-nav`},m(`button`,{type:`button`,class:`${p(`neutral`,`outline`,`sm`)} wui-tour-back`,"data-wui":l}),m(`button`,{type:`button`,class:`${p(`primary`,`solid`,`sm`)} wui-tour-next`,"data-wui":l})))),m(`div`,{class:`visually-hidden`,role:`status`,"aria-live":`polite`}));let n=t;this._shadow=null,this.isolated&&(n=document.createElement(It),this._shadow=n.attachShadow({mode:`open`}),Wt(this._shadow),this._shadow.appendChild(t)),n.setAttribute(`popover`,`manual`),T(document).appendChild(n),document.documentElement.setAttribute(Et,``),this._outer=n,this._layer=t;let r=Q(t,`.wui-tour-spot`,HTMLDivElement),i=Q(t,`.wui-tour-card`,HTMLDivElement),a=Q(t,`[role=status]`,HTMLElement);this._spot=r,this._card=i,this._live=a,Q(i,`.wui-tour-skip`,HTMLElement).addEventListener(`click`,()=>this._close(`skipped`,`button`)),Q(i,`.wui-tour-back`,HTMLElement).addEventListener(`click`,()=>this._move(-1)),Q(i,`.wui-tour-next`,HTMLElement).addEventListener(`click`,()=>this._move(1));let s=e=>this._key(e);this._onKey=s;let c=e=>{let t=this._layer;if(!t||this._ending)return;let n=this._current,r=n?this._stepAt(n.index):null;if(!(e.target instanceof Node))throw Error(`<wui-tour> saw a focus change from a non-node target`);Oe(t,r,n?.target??null,e.target)||i.focus()};this._onFocusIn=c,document.addEventListener(`keydown`,s,!0),this._shadow||document.addEventListener(`focusin`,c),o(n,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_raise(){let e=this._outer;if(!e)throw Error(`<wui-tour> raises a step before its host is built`);let t=T(this.ownerDocument);e.parentElement!==t&&t.appendChild(e),ce(e)}_show(e){this._current=e;let{index:t,target:n}=e,r=this._stepAt(t),i=this._layer,a=this._spot,o=this._card,s=this._live;if(!i||!a||!o||!s)throw Error(`<wui-tour> shows a step before its layer is built`);this._raise();let c=this._progress.position(t),l=this._progress.total(),u=c===l&&!this._endDialogText(),d=kt(this,c,l);At(o,{text:d,position:c,total:l}),Tt(o,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)}),o.toggleAttribute(`data-welcome`,!n);let f=F(this,{layer:i,spot:a,card:o},r,n),p=Q(o,`.wui-tour-title`,HTMLElement);p.textContent=r.title||``,p.hidden=!r.title,Q(o,`.wui-tour-text`,HTMLElement).textContent=r.description||``,Q(o,`.wui-tour-skip`,HTMLElement).textContent=this._label(`skip`);let m=Q(o,`.wui-tour-back`,HTMLElement);m.textContent=this._label(`back`),m.hidden=t<=this._firstIndex,Q(o,`.wui-tour-next`,HTMLElement).textContent=this._label(u?`done`:`next`);let h=[d,r.title,r.description].filter(Boolean).join(`. `);s.textContent=f?[h,f].join(/[.!?]$/.test(h)?` `:`. `):h,Qe(o,n),a.removeAttribute(Y),this._place(),He(o),this._unbindAdvance?.(),this._unbindAdvance=De(r,n,()=>void this._move(1));let g=this._active();(g!==null&&o.contains(g)?!(g instanceof HTMLElement&&g.hidden):this._shadow!==null&&Ht(Ut()))||o.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t,position:c,total:l}}))}_place(){if(!this._current||!this._layer)return;let e=this._spot,t=this._card;if(!e||!t)throw Error(`<wui-tour> places a step before its layer is built`);$e(e,t,this._current.target)}_follow(){if(!this._current||!this._layer||this._ending)return;let e=this._spot;if(!e)throw Error(`<wui-tour> follows a step before its spot is built`);let t=e.style.cssText;this._place(),e.style.cssText!==t&&e.setAttribute(Y,``)}async _move(e){this._current&&await this._go(this._current.index+e,e)}async _go(e,t){if(!this._current||this._moving)return;this._moving=!0;let n=this._run;try{let r=await this._locate(e,t,n);if(n!==this._run)return;if(r){let e=this._card;if(!e)throw Error(`<wui-tour> moved with no card showing`);let t=Ue(e);if(t!==null&&await t,n!==this._run)return;this._show(r)}else if(t>0){let e=this._endDialogText(),t=e?await this._showEnd(e):`done`;if(n!==this._run)return;let r=await this._close(t===`next`?`next`:`finished`);if(t===`next`&&r&&e){let t=this.ownerDocument.defaultView;if(!t)throw Error(`<wui-tour> has no window to follow its next link in`);t.location.assign(e.nextHref)}}}finally{this._moving=!1}}_showEnd(e){this._unbindAdvance?.(),this._unbindAdvance=null;let t=this._layer,n=this._spot,r=this._card;if(!t||!n||!r)throw Error(`<wui-tour> ends a tour before its layer is built`);return F(this,{layer:t,spot:n,card:r},null,null),n.removeAttribute(Y),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),ut(t,e,this._ending.signal)}_key(e){if(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)return;let t=a(e.key,i(this));if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(t===`ArrowRight`||t===`ArrowLeft`){if(Ht(e.composedPath?.()[0]??e.target))return;if(e.preventDefault(),t===`ArrowRight`)this._move(1);else{let e=this._current;if(!e)throw Error(`<wui-tour> moved back with no step showing`);e.index>this._firstIndex&&this._move(-1)}}else if(e.key===`Tab`&&!this._shadow){let t=this._current,n=this._card;if(!t||!n)throw Error(`<wui-tour> cycled focus with no step showing`);ke(e,{card:n,active:this._active(),step:this._stepAt(t.index),target:t.target})}}_teardown(){if(!this._layer)return;this._onKey&&document.removeEventListener(`keydown`,this._onKey,!0),this._onFocusIn&&document.removeEventListener(`focusin`,this._onFocusIn);let e=!this._shadow||this._shadow.activeElement!==null||!document.activeElement||document.activeElement===document.body;this._unbindAdvance?.(),this._unbindAdvance=null,this._ending?.abort(),this._ending=null,this._seenMark=null;let t=this._outer;if(s(t),!t)throw Error(`<wui-tour> has a layer with no host to remove`);We(t),document.documentElement.removeAttribute(Et),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let n=this._returnFocus;this._returnFocus=null,e&&n?.isConnected&&(n instanceof HTMLElement||n instanceof SVGElement)&&n.focus()}async _close(e,t=null){let n=this._run,r=this._current,i=r?{index:r.index,position:this._progress.position(r.index),total:this._progress.total()}:Bt,a=this._seenMark;this._teardown();let o=e===`next`?`finished`:e,s=!1;try{n===this._run&&await(a??this._markSeen(o)),s=n===this._run}finally{this._finish(e,i,t)}return s}_finish(e,t=Bt,n=null){this._run++,this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`),this.dispatchEvent(new CustomEvent(`wui-tour:close`,{bubbles:!0,detail:{reason:e,...t,via:n}}))}},Kt=class extends r{constructor(){super(),this.shadowRoot||this.attachShadow({mode:`open`})}};return t(`wui-tour`,Gt),t(`wui-tour-step`,Kt),e.WuiTourStep=Kt,e})({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-elements",
3
- "version": "0.174.0",
3
+ "version": "0.175.0",
4
4
  "description": "Webority framework-agnostic UI custom elements (<wui-*>): the single implementation of the interactive components, styled by @webority/theme. Used natively in Razor and wrapped by @webority/ui-react.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -275,10 +275,10 @@
275
275
  "@tiptap/starter-kit": "3.31.4",
276
276
  "@types/node": "25.6.0",
277
277
  "@vitest/coverage-v8": "5.1.0",
278
- "@webority/biome-config": "0.174.0",
279
- "@webority/markdown-core": "0.174.0",
280
- "@webority/theme": "0.174.0",
281
- "@webority/web-core": "0.174.0",
278
+ "@webority/biome-config": "0.175.0",
279
+ "@webority/markdown-core": "0.175.0",
280
+ "@webority/theme": "0.175.0",
281
+ "@webority/web-core": "0.175.0",
282
282
  "echarts": "6.1.0",
283
283
  "jsdom": "30.1.1",
284
284
  "libphonenumber-js": "^1.13.9",
@@ -1,5 +1,6 @@
1
1
  /** The languages the block highlights; "text" shows the source as written. */
2
- export declare const CODE_LANGUAGES: readonly ["text", "json", "js", "cs", "sql", "bash", "http", "html", "razor", "css"];
2
+ export type CodeLanguages = readonly ["text", "json", "js", "cs", "sql", "bash", "http", "html", "razor", "css"];
3
+ export declare const CODE_LANGUAGES: CodeLanguages;
3
4
  /** The name the block's header shows when it has no label. */
4
5
  export declare const CODE_LANGUAGE_NAMES: Readonly<Record<(typeof CODE_LANGUAGES)[number], string>>;
5
6
  /** Source longer than this is not tokenized. */
@@ -1,10 +1,9 @@
1
1
  /** Feedback window for copy-button label/icon swap on both surfaces. */
2
2
  export declare const COPY_FEEDBACK_MS = 2000;
3
3
  /**
4
- * Copy plain text to the clipboard. Tries `navigator.clipboard.writeText`, then falls
5
- * back to a hidden textarea + `document.execCommand("copy")`.
4
+ * Copy plain text to the clipboard with `navigator.clipboard.writeText`.
6
5
  *
7
6
  * @param text
8
- * @returns true when the copy succeeded
7
+ * @returns true when the copy succeeded; false when the Clipboard API is missing or refuses the write
9
8
  */
10
9
  export declare function copyTextToClipboard(text: string): Promise<boolean>;
@@ -11,6 +11,7 @@ import * as elementBase from "../elementBase.ts";
11
11
  import * as fieldState from "../fieldState.ts";
12
12
  import * as formatters from "../formatters.ts";
13
13
  import * as formMirror from "../formMirror.ts";
14
+ import * as hasOwn from "../hasOwn.ts";
14
15
  import * as iconGlyphs from "../iconGlyphs.g.ts";
15
16
  import * as imeSafeEnter from "../imeSafeEnter.ts";
16
17
  import * as isDrawn from "../isDrawn.ts";
@@ -41,48 +42,50 @@ import * as zone from "../zone.ts";
41
42
  import * as glyphs from "./glyphs.ts";
42
43
  import * as loader from "./loader.ts";
43
44
  import * as tableExport from "./tableExport.ts";
44
- export declare const SHARED_MODULES: Readonly<{
45
- anchorOverlay: typeof anchorOverlay;
46
- avatarNode: typeof avatarNode;
47
- buttonClass: typeof buttonClass;
48
- calendarMath: typeof calendarMath;
49
- copyText: typeof copyText;
50
- dataTable: typeof dataTable;
51
- datePickerText: typeof datePickerText;
52
- defineElement: typeof defineElement;
53
- devWarn: typeof devWarn;
54
- dom: typeof dom;
55
- drawerText: typeof drawerText;
56
- elementBase: typeof elementBase;
57
- fieldState: typeof fieldState;
58
- formatters: typeof formatters;
59
- formMirror: typeof formMirror;
60
- glyphs: typeof glyphs;
61
- iconGlyphs: typeof iconGlyphs;
62
- imeSafeEnter: typeof imeSafeEnter;
63
- isDrawn: typeof isDrawn;
64
- listboxKeyNav: typeof listboxKeyNav;
65
- loader: typeof loader;
66
- mentionText: typeof mentionText;
67
- menuKeyNav: typeof menuKeyNav;
68
- nativeOverlay: typeof nativeOverlay;
69
- notificationDays: typeof notificationDays;
70
- optionLabel: typeof optionLabel;
71
- partRegistry: typeof partRegistry;
72
- rtl: typeof rtl;
73
- selectList: typeof selectList;
74
- selectRemote: typeof selectRemote;
75
- selectText: typeof selectText;
76
- selectWindow: typeof selectWindow;
77
- serverHtml: typeof serverHtml;
78
- stepperHeader: typeof stepperHeader;
79
- svgNodes: typeof svgNodes;
80
- tableExport: typeof tableExport;
81
- tableSelect: typeof tableSelect;
82
- textMatch: typeof textMatch;
83
- textStore: typeof textStore;
84
- tooltips: typeof tooltips;
85
- wuiHttp: typeof wuiHttp;
86
- WuiSelect: typeof WuiSelect;
87
- zone: typeof zone;
88
- }>;
45
+ export interface SharedModules {
46
+ readonly anchorOverlay: typeof anchorOverlay;
47
+ readonly avatarNode: typeof avatarNode;
48
+ readonly buttonClass: typeof buttonClass;
49
+ readonly calendarMath: typeof calendarMath;
50
+ readonly copyText: typeof copyText;
51
+ readonly dataTable: typeof dataTable;
52
+ readonly datePickerText: typeof datePickerText;
53
+ readonly defineElement: typeof defineElement;
54
+ readonly devWarn: typeof devWarn;
55
+ readonly dom: typeof dom;
56
+ readonly drawerText: typeof drawerText;
57
+ readonly elementBase: typeof elementBase;
58
+ readonly fieldState: typeof fieldState;
59
+ readonly formatters: typeof formatters;
60
+ readonly formMirror: typeof formMirror;
61
+ readonly glyphs: typeof glyphs;
62
+ readonly hasOwn: typeof hasOwn;
63
+ readonly iconGlyphs: typeof iconGlyphs;
64
+ readonly imeSafeEnter: typeof imeSafeEnter;
65
+ readonly isDrawn: typeof isDrawn;
66
+ readonly listboxKeyNav: typeof listboxKeyNav;
67
+ readonly loader: typeof loader;
68
+ readonly mentionText: typeof mentionText;
69
+ readonly menuKeyNav: typeof menuKeyNav;
70
+ readonly nativeOverlay: typeof nativeOverlay;
71
+ readonly notificationDays: typeof notificationDays;
72
+ readonly optionLabel: typeof optionLabel;
73
+ readonly partRegistry: typeof partRegistry;
74
+ readonly rtl: typeof rtl;
75
+ readonly selectList: typeof selectList;
76
+ readonly selectRemote: typeof selectRemote;
77
+ readonly selectText: typeof selectText;
78
+ readonly selectWindow: typeof selectWindow;
79
+ readonly serverHtml: typeof serverHtml;
80
+ readonly stepperHeader: typeof stepperHeader;
81
+ readonly svgNodes: typeof svgNodes;
82
+ readonly tableExport: typeof tableExport;
83
+ readonly tableSelect: typeof tableSelect;
84
+ readonly textMatch: typeof textMatch;
85
+ readonly textStore: typeof textStore;
86
+ readonly tooltips: typeof tooltips;
87
+ readonly wuiHttp: typeof wuiHttp;
88
+ readonly WuiSelect: typeof WuiSelect;
89
+ readonly zone: typeof zone;
90
+ }
91
+ export declare const SHARED_MODULES: Readonly<SharedModules>;
@@ -0,0 +1 @@
1
+ export declare const hasOwn: (object: object, key: PropertyKey) => boolean;
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Whether a keydown was typed during an input method composition, Safari's confirming keydown included.
3
+ */
4
+ export declare function isImeComposing(event: KeyboardEvent | {
5
+ isComposing?: boolean;
6
+ keyCode?: number;
7
+ }): boolean;
1
8
  /**
2
9
  * Whether a keydown is an Enter that may submit: not one that confirms an input method composition
3
10
  * (Hindi, Chinese or Japanese typed through an IME). Safari fires the confirming keydown after
@@ -1,14 +1,17 @@
1
+ import type { ModalHandle } from "../../server/remoteModal.ts";
2
+ import type { ServerTableHandle } from "../../server/serverTable.ts";
3
+ import type { ShellHandle } from "../../server/shellParts.ts";
1
4
  export type RemoteOptions = Parameters<typeof window.WeborityUiElements.loadRemoteModal>[1];
2
5
  export declare const modal: {
3
6
  open: (id: string) => void;
4
7
  close: (id: string) => void;
5
- load: (url: string, options?: RemoteOptions) => Promise<import("../../server/remoteModal.ts").ModalHandle>;
8
+ load: (url: string, options?: RemoteOptions) => Promise<ModalHandle>;
6
9
  };
7
10
  export declare const drawer: {
8
- load: (url: string, options?: RemoteOptions) => Promise<import("../../server/remoteModal.ts").ModalHandle>;
11
+ load: (url: string, options?: RemoteOptions) => Promise<ModalHandle>;
9
12
  };
10
13
  export declare const pane: {
11
- load: (url: string, options?: RemoteOptions) => Promise<import("../../server/remoteModal.ts").ModalHandle>;
14
+ load: (url: string, options?: RemoteOptions) => Promise<ModalHandle>;
12
15
  close: (target: string | Element) => void;
13
16
  };
14
17
  export interface TourSeenStore {
@@ -20,10 +23,10 @@ export declare const tour: {
20
23
  start: (id: string) => unknown;
21
24
  };
22
25
  export declare const table: {
23
- get: (target: string | Element) => import("../../server/serverTable.ts").ServerTableHandle;
26
+ get: (target: string | Element) => ServerTableHandle;
24
27
  };
25
28
  export declare const shell: {
26
- get: (target?: string | Element) => import("../../server/shellParts.ts").ShellHandle;
29
+ get: (target?: string | Element) => ShellHandle;
27
30
  };
28
31
  export declare const filePicker: {
29
32
  setLoading: (target: string | Element, on: boolean) => void;
@@ -1,6 +1,5 @@
1
- declare const fromAddress: (url: string) => Promise<string>;
2
- export declare const look: {
1
+ export interface Look {
3
2
  apply: (file: unknown) => string;
4
- fromAddress: typeof fromAddress;
5
- };
6
- export {};
3
+ fromAddress: (url: string) => Promise<string>;
4
+ }
5
+ export declare const look: Look;
@@ -1 +1 @@
1
- declare const chartOf: (node: Element) => import("../../WuiChart").WuiChart | null | undefined;
1
+ declare const chartOf: (node: Element) => HTMLElementTagNameMap["wui-chart"] | null | undefined;
@@ -1,50 +1,26 @@
1
1
  import "../globals.ts";
2
2
  import "./modules/pageListeners.ts";
3
+ import { button, drawer, filePicker, modal, pane, shell, table, tour, unsaved } from "./modules/api.ts";
4
+ import { look } from "./modules/look.ts";
3
5
  import { dismissAllToasts, toast } from "./modules/toast.ts";
4
6
  import { showErrorSummary } from "./modules/validation.ts";
5
7
  declare const refresh: (root?: Document | Element) => void;
6
- declare const wui: {
7
- modal: {
8
- open: (id: string) => void;
9
- close: (id: string) => void;
10
- load: (url: string, options?: import("./modules/api.ts").RemoteOptions) => Promise<import("../server/remoteModal.ts").ModalHandle>;
11
- };
12
- drawer: {
13
- load: (url: string, options?: import("./modules/api.ts").RemoteOptions) => Promise<import("../server/remoteModal.ts").ModalHandle>;
14
- };
15
- pane: {
16
- load: (url: string, options?: import("./modules/api.ts").RemoteOptions) => Promise<import("../server/remoteModal.ts").ModalHandle>;
17
- close: (target: string | Element) => void;
18
- };
19
- tour: {
20
- seenStore: import("./modules/api.ts").TourSeenStore | null;
21
- start: (id: string) => unknown;
22
- };
23
- table: {
24
- get: (target: string | Element) => import("../server/serverTable.ts").ServerTableHandle;
25
- };
26
- shell: {
27
- get: (target?: string | Element) => import("../server/shellParts.ts").ShellHandle;
28
- };
29
- filePicker: {
30
- setLoading: (target: string | Element, on: boolean) => void;
31
- };
32
- button: {
33
- setLoading: (target: HTMLElement | string, isLoading: boolean) => void;
34
- };
35
- unsaved: {
36
- reset: (target: string | Element) => void;
37
- };
8
+ export interface WuiApi {
9
+ modal: typeof modal;
10
+ drawer: typeof drawer;
11
+ pane: typeof pane;
12
+ tour: typeof tour;
13
+ table: typeof table;
14
+ shell: typeof shell;
15
+ filePicker: typeof filePicker;
16
+ button: typeof button;
17
+ unsaved: typeof unsaved;
38
18
  toast: typeof toast;
39
19
  dismissAllToasts: typeof dismissAllToasts;
40
20
  showErrorSummary: typeof showErrorSummary;
41
- look: {
42
- apply: (file: unknown) => string;
43
- fromAddress: (url: string) => Promise<string>;
44
- };
21
+ look: typeof look;
45
22
  refresh: typeof refresh;
46
- };
47
- export type WuiApi = typeof wui;
23
+ }
48
24
  declare global {
49
25
  interface WuiHost extends WuiApi {
50
26
  }
@@ -1 +0,0 @@
1
- import{n as e,t}from"./buttonClass-GtEi8hAY.js";import{n,t as r}from"./copyText-Q-QZKBmx.js";import{t as i}from"./elementBase-Cxeyx0tU.js";import{t as a}from"./iconGlyphs.g-P04RJkSE.js";import{r as o}from"./textStore-opIEM4lu.js";import{t as s}from"./codeBlock.g-BCF2IlK-.js";Object.freeze([`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`razor`,`css`]);var c=Object.freeze({text:``,json:`JSON`,js:`JavaScript`,cs:`C#`,sql:`SQL`,bash:`Bash`,http:`HTTP`,html:`HTML`,razor:`Razor`,css:`CSS`}),l=e=>RegExp(`\\b(?:${e.join(`|`)})\\b`),u=`(?![\\s\\S])`,d=RegExp(`/\\*[\\s\\S]*?(?:\\*/|${u})`).source,f=[[`attr`,/"(?:[^"\\\n]|\\.)*"(?=\s*:)/],[`string`,/"(?:[^"\\\n]|\\.)*"?/],[`number`,/-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],[`literal`,l([`true`,`false`,`null`])],[`punct`,/[{}[\],:]/]],p=[[`comment`,RegExp(`//[^\\n]*|${d}`)],[`string`,/"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?|`(?:[^`\\]|\\[\s\S])*`?/],[`number`,/\b(?:0[xX][\da-fA-F_]+|\d[\d_]*\.?\d*(?:[eE][+-]?\d+)?n?)\b/],[`keyword`,l(/* @__PURE__ */ `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`,l([`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`])],[`function`,/(?<![\w$])[A-Za-z_$][\w$]*(?=\s*\()/],[`type`,/(?<![\w$])[A-Z][\w$]*/],[`punct`,/[{}()[\];,]/]],m=[[`comment`,RegExp(`//[^\\n]*|${d}`)],[`string`,/@"(?:[^"]|"")*"?|\$@?"(?:[^"\\\n]|\\.)*"?|"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?/],[`number`,/\b\d[\d_]*\.?\d*(?:[eE][+-]?\d+)?[fFdDmMlLuU]{0,2}\b/],[`keyword`,l(/* @__PURE__ */ `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`,l([`true`,`false`,`null`])],[`function`,/(?<!\w)[A-Za-z_]\w*(?=\s*\()/],[`type`,/(?<!\w)[A-Z]\w*/],[`punct`,/[{}()[\];,]/]],h=[[`comment`,RegExp(`--[^\\n]*|${d}`)],[`string`,/'(?:[^']|'')*'?/],[`variable`,/@@?\w+/],[`number`,/\b\d+(?:\.\d+)?\b/],[`keyword`,l(/* @__PURE__ */ `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`,l([`true`,`false`])],[`type`,l([`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`,/[(),;]/]],g=[[`comment`,/(?<![^\s;|&(])#[^\n]*/],[`string`,/"(?:[^"\\]|\\[\s\S])*"?|'[^']*'?/],[`variable`,/\$(?:\{[^}\n]*\}?|[A-Za-z_]\w*|[0-9@#?$!*-])/],[`attr`,/(?<![\w-])--?[A-Za-z][\w-]*/],[`number`,/(?<![\w.-])\d+(?:\.\d+)?\b/],[`keyword`,l([`case`,`do`,`done`,`elif`,`else`,`esac`,`exit`,`export`,`fi`,`for`,`function`,`if`,`in`,`local`,`return`,`select`,`then`,`until`,`while`])],[`function`,l(/* @__PURE__ */ `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`,/[|&;<>(){}[\]]+/]],_=[[`comment`,/^#[^\n]*/m],[`keyword`,/^(?:GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS|TRACE|CONNECT)(?= )/m],[`literal`,/HTTP\/\d(?:\.\d)?/],[`number`,/(?<=^HTTP\/\d(?:\.\d)? )\d{3}\b/m],[`function`,/(?<=^[A-Z]+ )\S+/m],[`attr`,/^[A-Za-z][\w-]*(?=:)/m],[`string`,/(?<=^[A-Za-z][\w-]*:[ \t]*)[^\n]+/m]],v=[[`comment`,RegExp(`<!--[\\s\\S]*?(?:-->|${u})`)],[`keyword`,/<![A-Za-z][^>]*>?/],[`tag`,/<\/?[A-Za-z][^<>]*>?/],[`literal`,/&#?\w+;/]],y={json:f,js:p,cs:m,sql:h,bash:g,http:_,css:[[`comment`,new RegExp(d)],[`string`,/"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?/],[`keyword`,/@[\w-]+|!important/],[`attr`,/[\w-]+(?=\s*:[^{};]*[;}])/],[`number`,/#[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:v,htmlTag:[[`tag`,/^<\/?[\w:.-]+/],[`string`,/"[^"]*"?|'[^']*'?/],[`attr`,/(?<=\s)[^\s=<>/"']+/],[`punct`,/\/?>|=/]]},b=e=>Object.hasOwn(y,e),x=/* @__PURE__ */ new Map;function S(e){let t=x.get(e);if(!t){let n=y[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)},x.set(e,t)}return t}function C(e,t,n){if(!n)return;let r=e[e.length-1];r&&r[0]===t?r[1]+=n:e.push([t,n])}function w(e,t,n=[]){let{re:r,types:i}=S(e),a=0;for(let o of t.matchAll(r)){let r=o[0];if(!r)continue;C(n,`plain`,t.slice(a,o.index));let s=i.findIndex((e,t)=>o[t+1]!==void 0);e===`html`&&i[s]===`tag`?w(`htmlTag`,r,n):C(n,i[s]??`plain`,r),a=o.index+r.length}return C(n,`plain`,t.slice(a)),n}function T(e){let t=/\r?\n\r?\n/.exec(e);if(!t)return w(`http`,e);let n=t[0]??``,r=w(`http`,e.slice(0,t.index+n.length)),i=e.slice(t.index+n.length),a=i.trimStart()[0];return a===`{`||a===`[`?w(`json`,i,r):a===`<`?w(`html`,i,r):(C(r,`plain`,i),r)}function E(e,t){let n=String(e??``);if(!n||n.length>1e5)return n?[[`plain`,n]]:[];if(t===`http`)return T(n);let r=t===`razor`?`html`:t;return!b(r)||r===`htmlTag`?[[`plain`,n]]:w(r,n)}function D(e,t){let n=[],r=[n];for(let[i,a]of E(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 O=()=>o(`codeBlock`,s);function k(e){return Object.hasOwn(c,e)}var A=class extends i{_title;_view;_codeEl;_copyIcon;_copyText;_chrome=null;_copied=!1;_observer=null;_timer=0;_cancelFrame=null;constructor(){super();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&&k(t)?t:`text`,r=this.getAttribute(`label`)||``,i=D(this._code(),n);this._title.textContent=r||c[n],this._view.setAttribute(`aria-label`,r||O().label),this._view.style.setProperty(`--wui-code-digits`,String(String(i.length).length)),this._codeEl.replaceChildren(...i.map(t=>j(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(i){let a=i.createElement(`div`);a.className=`wui-code-bar`;let o=i.createElement(`button`);return o.type=`button`,o.className=`${e(`primary`,`ghost`,`sm`)} wui-code-copy`,o.dataset.wui=t,o.setAttribute(`aria-live`,`polite`),this._setCopied(!1),o.append(this._copyIcon,this._copyText),o.addEventListener(`click`,async()=>{await n(this._code())&&(this._setCopied(!0),clearTimeout(this._timer),this._timer=window.setTimeout(()=>this._setCopied(!1),r))}),a.append(this._title,o),a}_setCopied(e){this._copied=e;let t=a(e?`check`:`files`,{size:14});this._copyIcon.replaceChildren(...t?[t]:[]),this._copyText.textContent=this._copyLabel()}_copyLabel(){return this._copied?this.getAttribute(`copied-label`)||O().copiedLabel:this.getAttribute(`copy-label`)||O().copyLabel}};function j(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}export{A as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./buttonClass-GtEi8hAY.js";import{n}from"./commentText-NWsssKvj.js";import{t as r}from"./elementBase-Cxeyx0tU.js";import{a as i,l as a,s as o}from"./nativeOverlay-BHD2QV02.js";import{n as s,t as c}from"./rtl-g7G8Bsib.js";import{t as l}from"./serverHtml-BC6tAyAl.js";import{d as u}from"./wuiHttp-BWf9dDsZ.js";import{r as d,t as f}from"./textStore-opIEM4lu.js";import{n as p,t as m}from"./httpFailure.g-DBKzEpAf.js";import{r as h}from"./WuiMentionInput-CktKQjQc.js";var g=`[data-wui-items]`,_=`[data-wui-picker]`,v=`[data-wui-composer]`,y=`[data-wui-comment]`,b=`[data-wui-live]`,x=()=>d(`commentThread`,p),S=e=>({forbidden:x().forbiddenMessage,client:x().failedClientMessage,validation:x().validationMessage,server:x().failedServerMessage,network:d(`httpFailure`,m).networkText})[e],C=e=>({post:x().donePostText,reply:x().doneReplyText,edit:x().doneEditText,delete:x().doneDeleteText,react:``})[e],w=e=>{let t=typeof e==`object`&&e&&`message`in e?e.message:void 0;return typeof t==`string`&&t?t:x().failedServerMessage},T=e=>e instanceof Element?e:null,E=e=>`disabled`in e&&e.disabled===!0,D=(e,t)=>{if(e==null)throw Error(`${t} missing`);return e},O=(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},A=(e,t,n)=>e?[...e.querySelectorAll(t)].filter(e=>e instanceof n):[],j=class extends r{_wired;_busy;_peopleProp;_pickerFor;_openers;constructor(){super(),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(Object.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=O(this,`${v} wui-mention-input`,h);this._handPeople(e),this._applyComposerPlaceholder(e)}disconnectedCallback(){this._closePicker(!1)}get people(){return this._peopleProp?this._peopleProp:A(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:n}_onClick(e){let t=k(T(e.target),`[data-wui-emoji]`,HTMLElement);if(t&&this.contains(t)&&!E(t)){let e=t.closest(_),n=e?this._pickerFor?.comment:t.closest(y);e&&this._closePicker(!0),n&&this._react(n,t.getAttribute(`data-wui-emoji`));return}let n=k(T(e.target),`[data-wui-action]`,HTMLElement);if(!n||!this.contains(n)||E(n))return;let r=n.closest(y);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=D(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(k(n,`[data-wui-reply], [data-wui-editor]`,HTMLElement),!0);break;case`post`:case`send`:this._sendFrom(n)}}_onKeyDown(e){let t=O(this,_,HTMLElement),n=T(e.target),r=s(e.key,c(this));if(this._pickerFor&&t?.contains(n)){let i=A(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=k(n,`[data-wui-reply], [data-wui-editor]`,HTMLElement);if(i&&this.contains(i)){e.preventDefault(),e.stopPropagation(),this._closeSlot(i,!0);return}let a=k(n,`[data-wui-comment-confirm]`,HTMLElement);a&&(e.preventDefault(),e.stopPropagation(),this._closeConfirm(a.closest(y),!0))}_onSubmitKey(e){let t=O(k(T(e.target),`[data-wui-reply], [data-wui-editor], [data-wui-composer]`,HTMLElement),`[data-wui-action="send"], [data-wui-action="post"]`,HTMLElement);t&&!E(t)&&this._sendFrom(t)}_openReply(e,t){if(this.hasAttribute(`no-replies`))return;let n=O(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:f(x().replyToText,{author:r}),placeholder:x().replyPlaceholder,value:``,send:x().replyLabel,opener:t})}_openEditor(e,t){let n=O(e,`:scope > .wui-comment-row [data-wui-editor]`,HTMLElement);if(!n?.hidden)return;let r=O(D(n.parentElement,`comment row`),`:scope > [data-wui-text]`,HTMLElement);r&&(r.hidden=!0),this._fillSlot(n,{label:x().editCommentLabel,placeholder:``,value:e?.getAttribute(`data-value`)??``,send:x().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`,x().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??=/* @__PURE__ */ new WeakMap,this._openers.set(e,a),s.focus();let u=s.querySelector(`textarea`);u?.setSelectionRange(u.value.length,u.value.length)}_button(n,r,i,a,o){let s=this.ownerDocument.createElement(`button`);return s.type=`button`,s.className=e(n,r,i),s.dataset.wui=t,s.setAttribute(`data-wui-action`,a),s.textContent=o,s}_closeSlot(e,t){if(!e||e.hidden)return;if(e.hidden=!0,e.replaceChildren(),e.hasAttribute(`data-wui-editor`)){let t=O(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=O(e,`:scope > .wui-comment-row`,HTMLElement),n=O(t,`[data-wui-comment-confirm]`,HTMLElement),r=O(t,`[data-wui-actions]`,HTMLElement);n&&(n.hidden=!1,r&&(r.hidden=!0),O(n,`[data-wui-action="cancel-delete"]`,HTMLElement)?.focus())}_closeConfirm(e,t){let n=O(e,`:scope > .wui-comment-row`,HTMLElement),r=O(n,`[data-wui-comment-confirm]`,HTMLElement),i=O(n,`[data-wui-actions]`,HTMLElement);r&&(r.hidden=!0),i&&(i.hidden=!1),t&&O(i,`[data-wui-action="delete"]`,HTMLElement)?.focus()}_openPicker(e,t){let n=O(this,_,HTMLElement);n&&e&&!this.hasAttribute(`no-reactions`)&&(this._closePicker(!1),this._pickerFor={comment:e,button:t},t.setAttribute(`aria-expanded`,`true`),a(t,n,{mode:`auto`,onClosed:()=>this._pickerClosed()}),O(n,`[data-wui-emoji]`,HTMLElement)?.focus())}_closePicker(e){let t=this._pickerFor;if(!t)return;let n=O(this,_,HTMLElement);n&&i(n),this._pickerClosed(),e&&t.button.isConnected&&t.button.focus()}_pickerClosed(){let e=O(this,_,HTMLElement),t=this._pickerFor;!t||e&&o(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=k(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,x().emptyBodyMessage),n?.focus();return}let i=t.closest(y);t.hasAttribute(`data-wui-composer`)?this._send(`post`,{body:r},{scope:t,form:t}):t.hasAttribute(`data-wui-reply`)?this._send(`reply`,{parentId:D(i,`comment`).getAttribute(`data-wui-comment`),body:r},{comment:i,scope:t,form:t}):this._send(`edit`,{commentId:D(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??O(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),C(e)&&this._announce(C(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:x().failedClientMessage};let n=new URLSearchParams;for(let[t,r]of Object.entries(e))r!=null&&n.set(t,r);let r=await u(t,{method:`POST`,body:n});return r.ok?{ok:!0,html:r.html}:{ok:!1,kind:r.kind,message:r.message||S(r.kind)||x().failedServerMessage}}_swapItems(e){let t=O(this,g,HTMLElement);if(!t||!e.trim())return;let n=l(e),r=O(n,g,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)&&!E(i))return;let a=e=>e?A(this,y,HTMLElement).find(t=>t.getAttribute(`data-wui-comment`)===e):null,o=e=>O(a(e),`:scope > .wui-comment-row`,HTMLElement),s=null;if(e===`post`)s=n?.querySelector(`textarea`);else if(e===`reply`)s=O(o(t.parentId),`[data-wui-action="reply"]`,HTMLElement);else if(e===`edit`)s=O(o(t.commentId),`[data-wui-action="edit"]`,HTMLElement);else if(e===`react`){let e=o(t.commentId);s=A(e,`button[data-wui-emoji]`,HTMLButtonElement).find(e=>e.getAttribute(`data-wui-emoji`)===t.emoji)??O(e,`[data-wui-action="react-menu"]`,HTMLElement)}s??=O(this,`${v} textarea`,HTMLTextAreaElement),s?.focus()}_showError(e,t){let n=O(e,`:scope > [data-wui-error], :scope > .wui-comment-main > [data-wui-error]`,HTMLElement);n&&(n.textContent=t||``,n.hidden=!t)}_announce(e){let t=O(this,`:scope > ${b}`,HTMLElement);t&&e&&(t.textContent=``,t.textContent=e)}};export{j as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./elementBase-Cxeyx0tU.js";import{t}from"./imeSafeEnter-DPs9qL3S.js";import{t as n}from"./isDrawn-BbF4phmB.js";import{t as r}from"./menuKeyNav-CstMzU08.js";import{a as i,l as a,s as o}from"./nativeOverlay-BHD2QV02.js";import{n as s,t as c}from"./rtl-g7G8Bsib.js";var l=`[role="menuitem"]`,u=`.wui-context-menu-sub`,d=`input.wui-context-menu-search`,f=`input, textarea, select, [contenteditable=""], [contenteditable="true"]`,p=500,m=10,h=400,g=null,_=null,v=0;function y(e,t,n){let r=document.createElement(`span`);return r.setAttribute(`aria-hidden`,`true`),r.style.cssText=n?`position:absolute;left:${e+window.scrollX}px;top:${t+window.scrollY}px;width:0;height:0;`:`position:fixed;left:${e}px;top:${t}px;width:0;height:0;`,document.body.append(r),r}var b=/* @__PURE__ */ new WeakMap;function x(e,t,n){let r=b.get(e);if(r){if(r.region===t||t.contains(r.region))return!1;r.cancel()}return b.set(e,{region:t,cancel:n}),!0}var S=e=>e instanceof Element?e:e instanceof Node?e.parentElement:null,C=e=>`focus`in e,w=e=>[...e.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE||e instanceof Element&&!e.matches(`.wui-context-menu-hint, .wui-context-menu-tick`)).map(e=>e.textContent).join(``),T=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),E=e=>[...e.children].filter(e=>e instanceof HTMLElement),D=(e,t)=>{let n=e.children[t];if(!(n instanceof HTMLElement))throw Error(`a submenu holds its opener and then its panel`);return n},O=e=>D(e,0),k=e=>D(e,1),A=(e,t)=>{let n=e?.closest(t);return n instanceof HTMLElement?n:null};function j(e,t){return!(e instanceof Node)||e.contains(t)}var M=class extends e{_region;_origin;_returnFocus;_press;_swallowClick;_unbindKeys;_anchor;_closingByKey;_onContextMenu;_onContextMenuCapture;_onDocKeyDown;_onDocClick;_onPointerDown;_onPressMove;_onPressEnd;_onClickCapture;_onKeyDown;_onClick;_onInput;_onMouseMove;_onDismiss;_onPointerDownCapture;static get observedAttributes(){return[`disabled`,`open`]}constructor(){super(),this._region=null,this._origin=null,this._returnFocus=null,this._press=null,this._swallowClick=!1,this._unbindKeys=null,this._anchor=null,this._closingByKey=!1,this._onContextMenu=e=>this._handleContextMenu(e),this._onContextMenuCapture=e=>{this.isOpen&&!this._inPanel(e.target)&&!this._isKeyEcho()&&this.close()},this._onDocKeyDown=e=>this._handleDocKeyDown(e),this._onDocClick=e=>this._handleDocClick(e),this._onPointerDown=e=>this._handlePointerDown(e),this._onPressMove=e=>{this._press&&Math.hypot(e.clientX-this._press.x,e.clientY-this._press.y)>m&&this._cancelPress()},this._onPressEnd=e=>{(e.type!==`scroll`||!this._press||j(e.target,this._press.region))&&this._cancelPress()},this._onClickCapture=e=>{if(this._swallowClick&&this._region){if(!(e.target instanceof Node))throw Error(`a click target is always a node`);this._region.contains(e.target)&&(this._swallowClick=!1,e.preventDefault(),e.stopImmediatePropagation())}},this._onKeyDown=e=>{if(this.isOpen&&this._inPanel(e.target)){if(e.key===`Escape`){if(e.stopPropagation(),this.hasAttribute(`open`)&&A(S(e.target),`[role="menu"]`)===this._panel()){e.preventDefault(),this.close(!0);return}this._closingByKey=!0}this._handleMenuKey(e)}},this._onClick=e=>this._handleClick(e),this._onInput=e=>this._handleInput(e),this._onMouseMove=e=>{let t=A(S(e.target),l);t&&this._inPanel(t)&&!this._isDisabled(t)&&t!==document.activeElement&&t.focus({preventScroll:!0})},this._onDismiss=e=>{this.hasAttribute(`open`)||(e.type!==`scroll`||!this._inPanel(e.target)&&j(e.target,this._region??this))&&this.close()},this._onPointerDownCapture=()=>{this._swallowClick=!1}}connectedCallback(){this._teardown(),document.addEventListener(`contextmenu`,this._onContextMenuCapture,!0),document.addEventListener(`contextmenu`,this._onContextMenu),document.addEventListener(`keydown`,this._onDocKeyDown),document.addEventListener(`pointerdown`,this._onPointerDownCapture,!0),document.addEventListener(`pointerdown`,this._onPointerDown),document.addEventListener(`click`,this._onClickCapture,!0),document.addEventListener(`click`,this._onDocClick),window.addEventListener(`keydown`,this._onKeyDown,!0),this.addEventListener(`click`,this._onClick),this.addEventListener(`input`,this._onInput),this.addEventListener(`mousemove`,this._onMouseMove),this._syncOpen()}disconnectedCallback(){this._teardown()}attributeChangedCallback(e){e===`open`?this.isConnected&&this._syncOpen():this.disabled&&this.close()}get target(){return this.getAttribute(`target`)}set target(e){e==null||e===``?this.removeAttribute(`target`):this.setAttribute(`target`,String(e))}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}get isOpen(){let e=this._panel();return!!e&&o(e)}open(e,t,{region:n=this,origin:i=n,trigger:s=null,keyboard:c=!1}={}){let l=this._panel();if(!l)return!1;let u=new CustomEvent(`wui-context-menu:beforeopen`,{bubbles:!0,cancelable:!0,detail:{region:n,origin:i,trigger:s}});if(this.dispatchEvent(u),u.defaultPrevented)return!1;if(this._decorate(l),g&&g!==this&&g.close(!0),!this.isOpen){let e=document.activeElement;this._returnFocus=e&&e!==document.body&&!this._inPanel(e)&&C(e)?e:null}this._region=n,this._origin=i,_=null,g=this,this._unbindKeys?.(),this._unbindKeys=r(l,{items:()=>this._menuRows()}),this._anchor?.remove();let d=this.hasAttribute(`open`);return this._anchor=y(e,t,d),a(this._anchor,l,{mode:d?`manual`:`auto`,keepOffscreen:d,clampHeight:!0,onClosed:()=>this._onPanelClosed()}),window.addEventListener(`scroll`,this._onDismiss,!0),window.addEventListener(`resize`,this._onDismiss),window.addEventListener(`blur`,this._onDismiss),queueMicrotask(()=>{o(l)&&((c?this._rowsOf(l)[0]:null)??l).focus({preventScroll:!0})}),this.dispatchEvent(new CustomEvent(`wui-context-menu:open`,{bubbles:!0,detail:{region:n,origin:i,x:e,y:t}})),!0}_syncOpen(){if(!this.hasAttribute(`open`)){this.close(this._inPanel(document.activeElement));return}let e=this.target?document.querySelector(this.target):this,t=e&&this._regionRect(e);e&&t&&this.open(t.left,t.top,{region:e,origin:e})}_regionRect(e){if(e!==this)return e.getBoundingClientRect();let t=[...this.children].filter(e=>e!==this._panel()).map(e=>e.getBoundingClientRect());return t.length?{left:Math.min(...t.map(e=>e.left)),top:Math.min(...t.map(e=>e.top))}:null}close(e=!1){let t=this._panel();t&&o(t)&&(e&&(this._closingByKey=!0),i(t))}_finish(e){let t=this._panel();if(t)for(let e of T(t,u))this._setSub(e,!1);g===this&&(g=null),window.removeEventListener(`scroll`,this._onDismiss,!0),window.removeEventListener(`resize`,this._onDismiss),window.removeEventListener(`blur`,this._onDismiss),this._unbindKeys?.(),this._unbindKeys=null,this._anchor?.remove(),this._anchor=null;let n=this._returnFocus;this._returnFocus=null,e&&n?.isConnected&&n.focus({preventScroll:!0})}_onPanelClosed(){let e=this._panel();if(!e||o(e))return;let t=this._closingByKey;this._closingByKey=!1,this._finish(t)}_menuRows(){let e=S(document.activeElement);if(!e||e.matches(d))return[];let t=A(e,`[role="menu"]`);return t?this._rowsOf(t):[]}_panel(){return E(this).find(e=>e.getAttribute(`role`)===`menu`)??null}_inPanel(e){return e instanceof Node&&!!this._panel()?.contains(e)}_rowsOf(e){return e?T(e,l).filter(t=>t.closest(`[role="menu"]`)===e&&!this._isDisabled(t)&&n(t)):[]}_isDisabled(e){return e.getAttribute(`aria-disabled`)===`true`}_regionFor(e){let t=S(e);if(!t||this.disabled||!this._panel()||this._inPanel(t)||t.closest(f))return null;let n=this.target;return n?t.closest(n):this.contains(t)?this:null}_triggerFor(e){let t=S(e),n=this.getAttribute(`trigger`);if(!t||!n||this._inPanel(t))return null;let r=A(t,n),i=r&&this._regionFor(r);return r&&i?{trigger:r,region:i}:null}_isKeyEcho(){return _?.menu===this&&this.isOpen&&performance.now()-_.at<h}_handleContextMenu(e){if(this._inPanel(e.target)){e.preventDefault();return}if(e.defaultPrevented&&!b.has(e))return;let t=this._regionFor(e.target);t&&(this._isKeyEcho()?e.preventDefault():e.shiftKey||x(e,t,()=>this.close(!0))&&this.open(e.clientX,e.clientY,{region:t,origin:S(e.target)})&&e.preventDefault())}_handleDocKeyDown(e){if(e.defaultPrevented&&!b.has(e))return;if(t(e)){let t=this._triggerFor(e.target);if(!t||!x(e,t.region,()=>this.close(!0)))return;e.preventDefault(),t.trigger.click();return}if(!(e.key===`ContextMenu`||e.key===`F10`&&e.shiftKey)||this._inPanel(e.target))return;let n=this._regionFor(e.target);if(!n||!x(e,n,()=>this.close(!0)))return;let r=S(e.target);if(!r)return;let i=r.getBoundingClientRect();this.open(i.left+Math.min(16,i.width/2),i.bottom,{region:n,origin:r,keyboard:!0})&&(e.preventDefault(),_={menu:this,at:performance.now()})}_handleDocClick(e){let t=this._triggerFor(e.target);if(!t||!x(e,t.region,()=>this.close(!0)))return;let n=t.trigger.getBoundingClientRect();this.open(n.left,n.bottom,{region:t.region,origin:t.trigger,trigger:t.trigger,keyboard:e.detail===0})}_handlePointerDown(e){if(e.pointerType!==`touch`)return;let t=this._regionFor(e.target);if(!t||!x(e,t,()=>this._cancelPress()))return;this._cancelPress();let{clientX:n,clientY:r}=e,i=S(e.target);this._press={x:n,y:r,region:t,timer:setTimeout(()=>{this._cancelPress(),this.open(n,r,{region:t,origin:i})&&(this._swallowClick=!0)},p)},document.addEventListener(`pointermove`,this._onPressMove,{passive:!0}),document.addEventListener(`pointerup`,this._onPressEnd),document.addEventListener(`pointercancel`,this._onPressEnd),window.addEventListener(`scroll`,this._onPressEnd,!0)}_cancelPress(){this._press&&(clearTimeout(this._press.timer),this._press=null,document.removeEventListener(`pointermove`,this._onPressMove),document.removeEventListener(`pointerup`,this._onPressEnd),document.removeEventListener(`pointercancel`,this._onPressEnd),window.removeEventListener(`scroll`,this._onPressEnd,!0))}_handleMenuKey(e){if(!this.isOpen)return;let n=S(e.target);if(!n)return;if(n.matches(d)){this._handleSearchKey(e,n);return}let r=A(n,`[role="menu"]`);if(!r)return;let i=A(n,l),a=r.matches(`.wui-context-menu-subpanel`)?r.parentElement:null,o=s(e.key,c(this));if(e.key===`Tab`)this.close(!0);else if(o===`ArrowRight`){let t=i&&this._subOf(i);if(!t)return;e.preventDefault(),this._openSub(t,!0)}else if(o===`ArrowLeft`){if(!a)return;e.preventDefault(),this._closeSubByKey(a)}else(t(e)||e.key===` `)&&(e.preventDefault(),i?.click())}_handleSearchKey(e,t){let n=A(t,u);if(!n)return;let r=this._rowsOf(k(n));e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),this._closeSubByKey(n)):e.key===`ArrowDown`?(e.preventDefault(),r[0]?.focus({preventScroll:!0})):e.key===`ArrowUp`?(e.preventDefault(),r[r.length-1]?.focus({preventScroll:!0})):e.key===`Tab`&&this.close(!0)}_subOf(e){return e.hasAttribute(`aria-haspopup`)&&e.parentElement?.matches(u)?e.parentElement:null}_openSub(e,t){let n=e.parentElement;if(!n)throw Error(`a submenu is always inside its menu panel`);for(let t of E(n))t!==e&&t.matches(u)&&this._closeSub(t);this._setSub(e,!0);let r=k(e).querySelector(`:scope > ${d}`),i=e.hasAttribute(`data-searchable`)&&r instanceof HTMLInputElement?r:null;i?(i.value=``,this._filter(e,``),i.focus({preventScroll:!0})):t&&this._rowsOf(k(e))[0]?.focus({preventScroll:!0})}_closeSub(e){for(let t of T(k(e),u))this._setSub(t,!1);this._setSub(e,!1)}_closeSubByKey(e){this._closeSub(e),O(e).focus({preventScroll:!0})}_setSub(e,t){let n=k(e);t?(a(O(e),n,{mode:`auto`,beside:!0,onClosed:()=>this._onSubClosed(e)}),O(e).setAttribute(`aria-expanded`,String(o(n)))):o(n)?i(n):this._onSubClosed(e)}_onSubClosed(e){let t=k(e);if(o(t))return;let n=O(e);n.setAttribute(`aria-expanded`,`false`),t.removeAttribute(`data-side`);let r=this._closingByKey;this._closingByKey=!1,r&&n.focus({preventScroll:!0})}_filter(e,t){let n=t.trim().toLowerCase();for(let t of E(k(e)))t.tagName===`HR`?t.hidden=n!==``:t.matches(l)?t.hidden=n!==``&&!w(t).toLowerCase().includes(n):t.matches(u)&&(t.hidden=n!==``&&!w(O(t)).toLowerCase().includes(n))}_handleInput(e){let t=S(e.target)?.closest(d);if(!(t instanceof HTMLInputElement))return;let n=A(t,u);n?.hasAttribute(`data-searchable`)&&this._inPanel(n)&&this._filter(n,t.value)}_decorate(e){for(let t of T(e,l)){let e=t.getAttribute(`aria-checked`)===`true`,n=t.querySelector(`:scope > .wui-context-menu-tick`);if(e&&!n){let e=document.createElement(`span`);e.className=`wui-context-menu-tick`,e.setAttribute(`aria-hidden`,`true`),t.prepend(e)}else!e&&n&&n.remove();let r=t.querySelector(`:scope > .wui-context-menu-hint`),i=t.dataset.hint;if(i){let e=r??document.createElement(`span`);r||(e.className=`wui-context-menu-hint`,e.id=`wui-context-menu-hint-${++v}`,t.append(e)),e.textContent=i,t.setAttribute(`aria-describedby`,e.id)}else r&&(r.remove(),t.removeAttribute(`aria-describedby`))}}_handleClick(e){let t=A(S(e.target),l);if(!t||!this._inPanel(t))return;if(this._isDisabled(t)){e.preventDefault(),e.stopPropagation();return}let n=this._subOf(t);n?(e.preventDefault(),this._openSub(n,e.detail===0)):(this.close(!0),this.dispatchEvent(new CustomEvent(`wui-context-menu:select`,{bubbles:!0,detail:{key:t.dataset.key??null,item:t,region:this._region,origin:this._origin}})))}_teardown(){let e=this._panel();if(this._closingByKey=!1,e){for(let t of[...T(e,u)].reverse())i(k(t));i(e)}this._anchor&&this._finish(!1),this._cancelPress(),document.removeEventListener(`contextmenu`,this._onContextMenuCapture,!0),document.removeEventListener(`contextmenu`,this._onContextMenu),document.removeEventListener(`keydown`,this._onDocKeyDown),document.removeEventListener(`pointerdown`,this._onPointerDownCapture,!0),document.removeEventListener(`pointerdown`,this._onPointerDown),document.removeEventListener(`click`,this._onClickCapture,!0),document.removeEventListener(`click`,this._onDocClick),window.removeEventListener(`keydown`,this._onKeyDown,!0),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`input`,this._onInput),this.removeEventListener(`mousemove`,this._onMouseMove)}};export{M as t};