@webority/ui-elements 0.76.0 → 0.77.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 (84) hide show
  1. package/dist/{WuiAutocomplete-CYpMjHs3.js → WuiAutocomplete-Cvoyr30K.js} +1 -1
  2. package/dist/WuiCarousel-DjQNKykv.js +1 -0
  3. package/dist/{WuiCodeBlock-BcLJhLBJ.js → WuiCodeBlock-8qgxTcyK.js} +1 -1
  4. package/dist/{WuiCommandPalette-CcmFOWNc.js → WuiCommandPalette-DMXm40wj.js} +1 -1
  5. package/dist/{WuiCommentThread-BHtcGLX0.js → WuiCommentThread-WL1GX7Jy.js} +1 -1
  6. package/dist/WuiConsentBanner-D6YE84__.js +1 -0
  7. package/dist/{WuiCountrySelect-DlmQ6qeN.js → WuiCountrySelect-Dac15o75.js} +1 -1
  8. package/dist/WuiDataTable-BVAsbW-S.js +1 -0
  9. package/dist/{WuiDatePicker-CpRYPtYz.js → WuiDatePicker-BUtDjbek.js} +1 -1
  10. package/dist/{WuiDateRange-h4lDtS-H.js → WuiDateRange-DCNf4MSb.js} +11 -11
  11. package/dist/{WuiInlineEdit-2XnVPzY-.js → WuiInlineEdit-DrQmhWZ6.js} +1 -1
  12. package/dist/{WuiLightbox-hluak_-q.js → WuiLightbox-DQ47WenM.js} +1 -1
  13. package/dist/{WuiMentionInput-BxYXpBRt.js → WuiMentionInput-BqcTKb8b.js} +1 -1
  14. package/dist/WuiMultiSelect-CAMJOfq1.js +25 -0
  15. package/dist/{WuiNotificationCenter-BLsM1WkE.js → WuiNotificationCenter-Dc7hD9w-.js} +1 -1
  16. package/dist/{WuiPhone-BfM_ttOi.js → WuiPhone-BhmKncvF.js} +2 -2
  17. package/dist/{WuiSelect-DJgzL9Z_.js → WuiSelect-DR4PYwAw.js} +2 -2
  18. package/dist/{WuiSlider-Br6V2amU.js → WuiSlider-CH4vFmtk.js} +2 -5
  19. package/dist/{WuiTagInput-DQ79rmjZ.js → WuiTagInput-BO7Fah7w.js} +1 -1
  20. package/dist/{WuiTimePicker-BIhwlHuA.js → WuiTimePicker-CaJrTq3m.js} +1 -1
  21. package/dist/{WuiTour-Bi_0ayiH.js → WuiTour-DOeTJa4V.js} +1 -1
  22. package/dist/WuiTree-amrUzT-J.js +1 -0
  23. package/dist/WuiWizardStep-1O75EzB2.js +1 -0
  24. package/dist/devWarn-DXdRWZs3.js +1 -0
  25. package/dist/elements/autocomplete.js +1 -1
  26. package/dist/elements/carousel.js +1 -1
  27. package/dist/elements/code-block.js +1 -1
  28. package/dist/elements/command-palette.js +1 -1
  29. package/dist/elements/comment-thread.js +1 -1
  30. package/dist/elements/consent-banner.js +1 -1
  31. package/dist/elements/country-select.js +1 -1
  32. package/dist/elements/data-table.js +1 -1
  33. package/dist/elements/date-range.js +1 -1
  34. package/dist/elements/datepicker.js +1 -1
  35. package/dist/elements/inline-edit.js +1 -1
  36. package/dist/elements/kanban.js +1 -1
  37. package/dist/elements/lightbox.js +1 -1
  38. package/dist/elements/mention-input.js +1 -1
  39. package/dist/elements/multiselect.js +1 -1
  40. package/dist/elements/notification-center.js +1 -1
  41. package/dist/elements/phone.js +1 -1
  42. package/dist/elements/select.js +1 -1
  43. package/dist/elements/slider.js +1 -1
  44. package/dist/elements/taginput.js +1 -1
  45. package/dist/elements/timepicker.js +1 -1
  46. package/dist/elements/tour.js +1 -1
  47. package/dist/elements/tree.js +1 -1
  48. package/dist/elements/wizard.js +1 -1
  49. package/dist/fileViewerImage-BWrW3zAb.js +3 -0
  50. package/dist/fileViewerMedia-CbvjcIc6.js +1 -0
  51. package/dist/{fileViewerPdf-CL451vuw.js → fileViewerPdf-qmMcAn1q.js} +12 -14
  52. package/dist/fileViewerUi-CSOkacnB.js +1 -0
  53. package/dist/helpers.js +1 -1
  54. package/dist/{iconGlyphs.g-CUm_mfze.js → iconGlyphs.g-Bk8AzmSO.js} +1 -1
  55. package/dist/kanban-yqsg7glT.js +1 -0
  56. package/dist/{optionLabel-BBaur8Bs.js → optionLabel-Bd3vP-XI.js} +1 -1
  57. package/dist/types/chatClient.d.ts +3 -3
  58. package/dist/ui-calendar.global.js +1 -1
  59. package/dist/ui-calendar.js +1 -1
  60. package/dist/ui-chart.global.js +2 -2
  61. package/dist/ui-chart.js +2 -2
  62. package/dist/ui-chat.global.js +2 -2
  63. package/dist/ui-chat.js +2 -2
  64. package/dist/ui-consent-banner.global.js +1 -1
  65. package/dist/ui-elements.global.js +54 -57
  66. package/dist/ui-elements.js +1 -1
  67. package/dist/ui-file-viewer.global.js +12 -17
  68. package/dist/ui-file-viewer.js +1 -1
  69. package/dist/ui-rich-text.global.js +56 -56
  70. package/dist/ui-rich-text.js +56 -56
  71. package/dist/ui-tour.global.js +1 -1
  72. package/dist/wuiHttp-27mq9Jpn.js +1 -0
  73. package/package.json +1 -1
  74. package/dist/WuiCarousel-C33Z8FBt.js +0 -1
  75. package/dist/WuiConsentBanner-jdTxzdJs.js +0 -1
  76. package/dist/WuiDataTable-Bqs6FW2t.js +0 -1
  77. package/dist/WuiMultiSelect-CBbY_sPD.js +0 -25
  78. package/dist/WuiTree-BSx5pKJo.js +0 -1
  79. package/dist/WuiWizardStep-DtA3nVPi.js +0 -1
  80. package/dist/fileViewerImage-Du71Tgbf.js +0 -6
  81. package/dist/fileViewerMedia-BWRNH-we.js +0 -1
  82. package/dist/fileViewerUi-DAWY2fNB.js +0 -1
  83. package/dist/kanban-C0RiKTUx.js +0 -1
  84. package/dist/wuiHttp-0pGmgUIV.js +0 -1
@@ -1 +1 @@
1
- import{t as e}from"./elementBase-BlsR4tqa.js";import{c as t}from"./wuiHttp-0pGmgUIV.js";import{c as n,i as r,n as i,s as a}from"./notificationDays-pYmoU0g6.js";var o=`.wui-notification-center-trigger`,s=`.wui-notification-center-panel`,c=`.wui-notification-center-count`,l=`.wui-notification-center-live`,u=`.wui-notification-center-markall`,d=`.wui-notification-center-item`,f=`wui-notification-center-item-read`,p=`.wui-notification-center-unread-label`,m=class extends e{constructor(){super(),this._doc=null,this._unread=0,this._busy=!1,this._onClick=e=>this._click(e),this._onKeyDown=e=>this._key(e),this._onOutside=e=>{this.contains(e.target)||this.close()},this._onFocusOut=e=>{let t=e.relatedTarget;t instanceof Node&&!this.contains(t)&&this.close()}}connectedCallback(){this._doc=this.ownerDocument,this._unread=this._initialUnread(),this.addEventListener(`click`,this._onClick),this.addEventListener(`keydown`,this._onKeyDown),this._doc.addEventListener(`mousedown`,this._onOutside),this.addEventListener(`focusout`,this._onFocusOut),this._syncOpen()}disconnectedCallback(){this.removeEventListener(`click`,this._onClick),this.removeEventListener(`keydown`,this._onKeyDown),this._doc?.removeEventListener(`mousedown`,this._onOutside),this.removeEventListener(`focusout`,this._onFocusOut),this._doc=null}get isOpen(){return this.hasAttribute(`open`)}open(){this.isOpen||(this.setAttribute(`open`,``),this._syncOpen(),this.querySelector(s)?.focus(),this._announceToggle())}close({restoreFocus:e=!1}={}){this.isOpen&&(this.removeAttribute(`open`),this._syncOpen(),e&&this.querySelector(o)?.focus(),this._announceToggle())}toggle(){this.isOpen?this.close():this.open()}_announceToggle(){this.dispatchEvent(new CustomEvent(`wui:notification-center:toggle`,{bubbles:!0,detail:{open:this.isOpen}}))}_syncOpen(){this.querySelector(o)?.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`)}_initialUnread(){let e=Number.parseInt(this.getAttribute(`unread`)??``,10);return Number.isInteger(e)&&e>=0?e:this.querySelectorAll(`${d}:not(.${f})`).length}_click(e){let t=e.target.closest?.(`${o}, ${u}, ${d}`);if(!(!t||!this.contains(t))){if(t.matches(o)){this.toggle();return}this.hasAttribute(`controlled`)||(t.matches(u)?this._markAll():this._markItem(t))}}_key(e){if(e.key===`Escape`&&this.isOpen){e.preventDefault(),e.stopPropagation(),this.close({restoreFocus:!0});return}if(!this.isOpen||!this.querySelector(s)?.contains(e.target))return;let t={ArrowDown:1,ArrowUp:-1,Home:`first`,End:`last`}[e.key];if(t===void 0)return;let n=[...this.querySelectorAll(d)];if(n.length===0)return;let r=n.indexOf(e.target.closest(d)),i;i=t===`first`?0:t===`last`?n.length-1:r===-1?t===1?0:n.length-1:Math.min(n.length-1,Math.max(0,r+t)),e.preventDefault(),n[i].focus()}_markItem(e){e.classList.contains(f)||(this._applyRead(e),this._unread=Math.max(0,this._unread-1),this._render(),this._say(n(this._unread)),this._emitRead([e.dataset.id].filter(Boolean),!1))}async _markAll(){if(this._busy)return;let e=[...this.querySelectorAll(`${d}:not(.${f})`)];if(e.length===0&&this._unread===0)return;let n=e.map(e=>e.dataset.id).filter(Boolean),r=this.getAttribute(`read-action`);if(r){this._setBusy(!0);let e=new URLSearchParams;for(let t of n)e.append(`ids`,t);let a=await t(r,{method:`POST`,body:e});if(this._setBusy(!1),!a.ok){if(a.kind===`session`||a.kind===`aborted`)return;let e=a.message||i.failed[a.kind]||i.failed.server;this._say(e),this.dispatchEvent(new CustomEvent(`wui:notification-center:failed`,{bubbles:!0,detail:{kind:a.kind,message:e}}));return}}for(let t of e)this._applyRead(t);this._unread=0,this._render(),this._say(i.allRead),this._emitRead(n,!0)}_applyRead(e){e.classList.add(f),e.querySelector(p)?.remove()}_setBusy(e){this._busy=e;let t=this.querySelector(u);t&&(t.disabled=e||this._unread===0,e?t.setAttribute(`aria-busy`,`true`):t.removeAttribute(`aria-busy`))}_render(){let e=this.querySelector(c);e&&(e.textContent=r(this._unread),e.hidden=this._unread===0),this.querySelector(o)?.setAttribute(`aria-label`,a(this.getAttribute(`label`)||i.label,this._unread));let t=this.querySelector(u);t&&(t.disabled=this._unread===0)}_say(e){let t=this.querySelector(l);t&&(t.textContent=e)}_emitRead(e,t){this.dispatchEvent(new CustomEvent(`wui:notification-center:read`,{bubbles:!0,detail:{ids:e,all:t}}))}};export{m as t};
1
+ import{t as e}from"./elementBase-BlsR4tqa.js";import{c as t}from"./wuiHttp-27mq9Jpn.js";import{c as n,i as r,n as i,s as a}from"./notificationDays-pYmoU0g6.js";var o=`.wui-notification-center-trigger`,s=`.wui-notification-center-panel`,c=`.wui-notification-center-count`,l=`.wui-notification-center-live`,u=`.wui-notification-center-markall`,d=`.wui-notification-center-item`,f=`wui-notification-center-item-read`,p=`.wui-notification-center-unread-label`,m=class extends e{constructor(){super(),this._doc=null,this._unread=0,this._busy=!1,this._onClick=e=>this._click(e),this._onKeyDown=e=>this._key(e),this._onOutside=e=>{this.contains(e.target)||this.close()},this._onFocusOut=e=>{let t=e.relatedTarget;t instanceof Node&&!this.contains(t)&&this.close()}}connectedCallback(){this._doc=this.ownerDocument,this._unread=this._initialUnread(),this.addEventListener(`click`,this._onClick),this.addEventListener(`keydown`,this._onKeyDown),this._doc.addEventListener(`mousedown`,this._onOutside),this.addEventListener(`focusout`,this._onFocusOut),this._syncOpen()}disconnectedCallback(){this.removeEventListener(`click`,this._onClick),this.removeEventListener(`keydown`,this._onKeyDown),this._doc?.removeEventListener(`mousedown`,this._onOutside),this.removeEventListener(`focusout`,this._onFocusOut),this._doc=null}get isOpen(){return this.hasAttribute(`open`)}open(){this.isOpen||(this.setAttribute(`open`,``),this._syncOpen(),this.querySelector(s)?.focus(),this._announceToggle())}close({restoreFocus:e=!1}={}){this.isOpen&&(this.removeAttribute(`open`),this._syncOpen(),e&&this.querySelector(o)?.focus(),this._announceToggle())}toggle(){this.isOpen?this.close():this.open()}_announceToggle(){this.dispatchEvent(new CustomEvent(`wui:notification-center:toggle`,{bubbles:!0,detail:{open:this.isOpen}}))}_syncOpen(){this.querySelector(o)?.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`)}_initialUnread(){let e=Number.parseInt(this.getAttribute(`unread`)??``,10);return Number.isInteger(e)&&e>=0?e:this.querySelectorAll(`${d}:not(.${f})`).length}_click(e){let t=e.target.closest?.(`${o}, ${u}, ${d}`);if(!(!t||!this.contains(t))){if(t.matches(o)){this.toggle();return}this.hasAttribute(`controlled`)||(t.matches(u)?this._markAll():this._markItem(t))}}_key(e){if(e.key===`Escape`&&this.isOpen){e.preventDefault(),e.stopPropagation(),this.close({restoreFocus:!0});return}if(!this.isOpen||!this.querySelector(s)?.contains(e.target))return;let t={ArrowDown:1,ArrowUp:-1,Home:`first`,End:`last`}[e.key];if(t===void 0)return;let n=[...this.querySelectorAll(d)];if(n.length===0)return;let r=n.indexOf(e.target.closest(d)),i;i=t===`first`?0:t===`last`?n.length-1:r===-1?t===1?0:n.length-1:Math.min(n.length-1,Math.max(0,r+t)),e.preventDefault(),n[i].focus()}_markItem(e){e.classList.contains(f)||(this._applyRead(e),this._unread=Math.max(0,this._unread-1),this._render(),this._say(n(this._unread)),this._emitRead([e.dataset.id].filter(Boolean),!1))}async _markAll(){if(this._busy)return;let e=[...this.querySelectorAll(`${d}:not(.${f})`)];if(e.length===0&&this._unread===0)return;let n=e.map(e=>e.dataset.id).filter(Boolean),r=this.getAttribute(`read-action`);if(r){this._setBusy(!0);let e=new URLSearchParams;for(let t of n)e.append(`ids`,t);let a=await t(r,{method:`POST`,body:e});if(this._setBusy(!1),!a.ok){if(a.kind===`session`||a.kind===`aborted`)return;let e=a.message||i.failed[a.kind]||i.failed.server;this._say(e),this.dispatchEvent(new CustomEvent(`wui:notification-center:failed`,{bubbles:!0,detail:{kind:a.kind,message:e}}));return}}for(let t of e)this._applyRead(t);this._unread=0,this._render(),this._say(i.allRead),this._emitRead(n,!0)}_applyRead(e){e.classList.add(f),e.querySelector(p)?.remove()}_setBusy(e){this._busy=e;let t=this.querySelector(u);t&&(t.disabled=e||this._unread===0,e?t.setAttribute(`aria-busy`,`true`):t.removeAttribute(`aria-busy`))}_render(){let e=this.querySelector(c);e&&(e.textContent=r(this._unread),e.hidden=this._unread===0),this.querySelector(o)?.setAttribute(`aria-label`,a(this.getAttribute(`label`)||i.label,this._unread));let t=this.querySelector(u);t&&(t.disabled=this._unread===0)}_say(e){let t=this.querySelector(l);t&&(t.textContent=e)}_emitRead(e,t){this.dispatchEvent(new CustomEvent(`wui:notification-center:read`,{bubbles:!0,detail:{ids:e,all:t}}))}};export{m as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"./anchorOverlay-HAWsGzlr.js";import{t as i}from"./iconGlyphs.g-CUm_mfze.js";import{t as a}from"./formMirror-BgY7zkC3.js";import{n as o}from"./listboxKeyNav-DMIvs9d6.js";import{n as s,t as c}from"./countries-CvmZ2xpG.js";var l={AD:[`Europe/Andorra`],AE:[`Asia/Dubai`],AF:[`Asia/Kabul`],AG:[`America/Antigua`],AI:[`America/Anguilla`],AL:[`Europe/Tirane`],AM:[`Asia/Yerevan`],AO:[`Africa/Luanda`],AR:[`America/Argentina/Buenos_Aires`,`America/Argentina/Catamarca`,`America/Argentina/ComodRivadavia`,`America/Argentina/Cordoba`,`America/Argentina/Jujuy`,`America/Argentina/La_Rioja`,`America/Argentina/Mendoza`,`America/Argentina/Rio_Gallegos`,`America/Argentina/Salta`,`America/Argentina/San_Juan`,`America/Argentina/San_Luis`,`America/Argentina/Tucuman`,`America/Argentina/Ushuaia`,`America/Buenos_Aires`,`America/Catamarca`,`America/Cordoba`,`America/Jujuy`,`America/Mendoza`,`America/Rosario`],AS:[`Pacific/Pago_Pago`,`Pacific/Samoa`,`US/Samoa`],AT:[`Europe/Vienna`],AU:[`Antarctica/Macquarie`,`Australia/Adelaide`,`Australia/Brisbane`,`Australia/Broken_Hill`,`Australia/Canberra`,`Australia/Currie`,`Australia/Darwin`,`Australia/Eucla`,`Australia/Hobart`,`Australia/LHI`,`Australia/Lindeman`,`Australia/Lord_Howe`,`Australia/Melbourne`,`Australia/NSW`,`Australia/North`,`Australia/Perth`,`Australia/Queensland`,`Australia/South`,`Australia/Sydney`,`Australia/Tasmania`,`Australia/Victoria`,`Australia/West`,`Australia/Yancowinna`],AW:[`America/Aruba`],AX:[`Europe/Mariehamn`],AZ:[`Asia/Baku`],BA:[`Europe/Sarajevo`],BB:[`America/Barbados`],BD:[`Asia/Dacca`,`Asia/Dhaka`],BE:[`Europe/Brussels`],BF:[`Africa/Ouagadougou`],BG:[`Europe/Sofia`],BH:[`Asia/Bahrain`],BI:[`Africa/Bujumbura`],BJ:[`Africa/Porto-Novo`],BL:[`America/St_Barthelemy`],BM:[`Atlantic/Bermuda`],BN:[`Asia/Brunei`],BO:[`America/La_Paz`],BQ:[`America/Kralendijk`],BR:[`America/Araguaina`,`America/Bahia`,`America/Belem`,`America/Boa_Vista`,`America/Campo_Grande`,`America/Cuiaba`,`America/Eirunepe`,`America/Fortaleza`,`America/Maceio`,`America/Manaus`,`America/Noronha`,`America/Porto_Acre`,`America/Porto_Velho`,`America/Recife`,`America/Rio_Branco`,`America/Santarem`,`America/Sao_Paulo`,`Brazil/DeNoronha`,`Brazil/East`,`Brazil/West`],BS:[`America/Nassau`],BT:[`Asia/Thimbu`,`Asia/Thimphu`],BW:[`Africa/Gaborone`],BY:[`Europe/Minsk`],BZ:[`America/Belize`],CA:`America/Atikokan.America/Blanc-Sablon.America/Cambridge_Bay.America/Coral_Harbour.America/Creston.America/Dawson.America/Dawson_Creek.America/Edmonton.America/Fort_Nelson.America/Glace_Bay.America/Goose_Bay.America/Halifax.America/Inuvik.America/Iqaluit.America/Moncton.America/Montreal.America/Nipigon.America/Pangnirtung.America/Rainy_River.America/Rankin_Inlet.America/Regina.America/Resolute.America/St_Johns.America/Swift_Current.America/Thunder_Bay.America/Toronto.America/Vancouver.America/Whitehorse.America/Winnipeg.America/Yellowknife.Canada/Atlantic.Canada/Central.Canada/Eastern.Canada/Mountain.Canada/Newfoundland.Canada/Pacific.Canada/Saskatchewan.Canada/Yukon`.split(`.`),CC:[`Indian/Cocos`],CD:[`Africa/Kinshasa`,`Africa/Lubumbashi`],CF:[`Africa/Bangui`],CG:[`Africa/Brazzaville`],CH:[`Europe/Zurich`],CI:[`Africa/Abidjan`],CK:[`Pacific/Rarotonga`],CL:[`America/Coyhaique`,`America/Punta_Arenas`,`America/Santiago`,`Chile/Continental`,`Chile/EasterIsland`,`Pacific/Easter`],CM:[`Africa/Douala`],CN:[`Asia/Chongqing`,`Asia/Harbin`,`Asia/Kashgar`,`Asia/Shanghai`,`Asia/Urumqi`],CO:[`America/Bogota`],CR:[`America/Costa_Rica`],CU:[`America/Havana`],CV:[`Atlantic/Cape_Verde`],CW:[`America/Curacao`],CX:[`Indian/Christmas`],CY:[`Asia/Famagusta`,`Asia/Nicosia`,`Europe/Nicosia`],CZ:[`Europe/Prague`],DE:[`Europe/Berlin`,`Europe/Busingen`],DJ:[`Africa/Djibouti`],DK:[`Europe/Copenhagen`],DM:[`America/Dominica`],DO:[`America/Santo_Domingo`],DZ:[`Africa/Algiers`],EC:[`America/Guayaquil`,`Pacific/Galapagos`],EE:[`Europe/Tallinn`],EG:[`Africa/Cairo`],EH:[`Africa/El_Aaiun`],ER:[`Africa/Asmara`,`Africa/Asmera`],ES:[`Africa/Ceuta`,`Atlantic/Canary`,`Europe/Madrid`],ET:[`Africa/Addis_Ababa`],FI:[`Europe/Helsinki`],FJ:[`Pacific/Fiji`],FK:[`Atlantic/Stanley`],FM:[`Pacific/Chuuk`,`Pacific/Kosrae`,`Pacific/Pohnpei`,`Pacific/Ponape`,`Pacific/Truk`,`Pacific/Yap`],FO:[`Atlantic/Faeroe`,`Atlantic/Faroe`],FR:[`Europe/Paris`],GA:[`Africa/Libreville`],GB:[`Europe/Belfast`,`Europe/London`],GD:[`America/Grenada`],GE:[`Asia/Tbilisi`],GF:[`America/Cayenne`],GG:[`Europe/Guernsey`],GH:[`Africa/Accra`],GI:[`Europe/Gibraltar`],GL:[`America/Danmarkshavn`,`America/Godthab`,`America/Nuuk`,`America/Scoresbysund`,`America/Thule`],GM:[`Africa/Banjul`],GN:[`Africa/Conakry`],GP:[`America/Guadeloupe`],GQ:[`Africa/Malabo`],GR:[`Europe/Athens`],GT:[`America/Guatemala`],GU:[`Pacific/Guam`],GW:[`Africa/Bissau`],GY:[`America/Guyana`],HK:[`Asia/Hong_Kong`],HN:[`America/Tegucigalpa`],HR:[`Europe/Zagreb`],HT:[`America/Port-au-Prince`],HU:[`Europe/Budapest`],ID:[`Asia/Jakarta`,`Asia/Jayapura`,`Asia/Makassar`,`Asia/Pontianak`,`Asia/Ujung_Pandang`],IE:[`Europe/Dublin`],IL:[`Asia/Jerusalem`,`Asia/Tel_Aviv`],IM:[`Europe/Isle_of_Man`],IN:[`Asia/Calcutta`,`Asia/Kolkata`],IO:[`Indian/Chagos`],IQ:[`Asia/Baghdad`],IR:[`Asia/Tehran`],IS:[`Atlantic/Reykjavik`],IT:[`Europe/Rome`],JE:[`Europe/Jersey`],JM:[`America/Jamaica`],JO:[`Asia/Amman`],JP:[`Asia/Tokyo`],KE:[`Africa/Nairobi`],KG:[`Asia/Bishkek`],KH:[`Asia/Phnom_Penh`],KI:[`Pacific/Enderbury`,`Pacific/Kanton`,`Pacific/Kiritimati`,`Pacific/Tarawa`],KM:[`Indian/Comoro`],KN:[`America/St_Kitts`],KP:[`Asia/Pyongyang`],KR:[`Asia/Seoul`],KW:[`Asia/Kuwait`],KY:[`America/Cayman`],KZ:[`Asia/Almaty`,`Asia/Aqtau`,`Asia/Aqtobe`,`Asia/Atyrau`,`Asia/Oral`,`Asia/Qostanay`,`Asia/Qyzylorda`],LA:[`Asia/Vientiane`],LB:[`Asia/Beirut`],LC:[`America/St_Lucia`],LI:[`Europe/Vaduz`],LK:[`Asia/Colombo`],LR:[`Africa/Monrovia`],LS:[`Africa/Maseru`],LT:[`Europe/Vilnius`],LU:[`Europe/Luxembourg`],LV:[`Europe/Riga`],LY:[`Africa/Tripoli`],MA:[`Africa/Casablanca`],MC:[`Europe/Monaco`],MD:[`Europe/Chisinau`,`Europe/Tiraspol`],ME:[`Europe/Podgorica`],MF:[`America/Marigot`],MG:[`Indian/Antananarivo`],MH:[`Pacific/Kwajalein`,`Pacific/Majuro`],MK:[`Europe/Skopje`],ML:[`Africa/Bamako`,`Africa/Timbuktu`],MM:[`Asia/Rangoon`,`Asia/Yangon`],MN:[`Asia/Choibalsan`,`Asia/Hovd`,`Asia/Ulaanbaatar`,`Asia/Ulan_Bator`],MO:[`Asia/Macao`,`Asia/Macau`],MP:[`Pacific/Saipan`],MQ:[`America/Martinique`],MR:[`Africa/Nouakchott`],MS:[`America/Montserrat`],MT:[`Europe/Malta`],MU:[`Indian/Mauritius`],MV:[`Indian/Maldives`],MW:[`Africa/Blantyre`],MX:[`America/Bahia_Banderas`,`America/Cancun`,`America/Chihuahua`,`America/Ciudad_Juarez`,`America/Ensenada`,`America/Hermosillo`,`America/Matamoros`,`America/Mazatlan`,`America/Merida`,`America/Mexico_City`,`America/Monterrey`,`America/Ojinaga`,`America/Santa_Isabel`,`America/Tijuana`,`Mexico/BajaNorte`,`Mexico/BajaSur`,`Mexico/General`],MY:[`Asia/Kuala_Lumpur`,`Asia/Kuching`],MZ:[`Africa/Maputo`],NA:[`Africa/Windhoek`],NC:[`Pacific/Noumea`],NE:[`Africa/Niamey`],NF:[`Pacific/Norfolk`],NG:[`Africa/Lagos`],NI:[`America/Managua`],NL:[`Europe/Amsterdam`],NO:[`Europe/Oslo`],NP:[`Asia/Kathmandu`,`Asia/Katmandu`],NR:[`Pacific/Nauru`],NU:[`Pacific/Niue`],NZ:[`Pacific/Auckland`,`Pacific/Chatham`],OM:[`Asia/Muscat`],PA:[`America/Panama`],PE:[`America/Lima`],PF:[`Pacific/Gambier`,`Pacific/Marquesas`,`Pacific/Tahiti`],PG:[`Pacific/Bougainville`,`Pacific/Port_Moresby`],PH:[`Asia/Manila`],PK:[`Asia/Karachi`],PL:[`Europe/Warsaw`],PM:[`America/Miquelon`],PR:[`America/Puerto_Rico`],PS:[`Asia/Gaza`,`Asia/Hebron`],PT:[`Atlantic/Azores`,`Atlantic/Madeira`,`Europe/Lisbon`],PW:[`Pacific/Palau`],PY:[`America/Asuncion`],QA:[`Asia/Qatar`],RE:[`Indian/Reunion`],RO:[`Europe/Bucharest`],RS:[`Europe/Belgrade`],RU:`Asia/Anadyr.Asia/Barnaul.Asia/Chita.Asia/Irkutsk.Asia/Kamchatka.Asia/Khandyga.Asia/Krasnoyarsk.Asia/Magadan.Asia/Novokuznetsk.Asia/Novosibirsk.Asia/Omsk.Asia/Sakhalin.Asia/Srednekolymsk.Asia/Tomsk.Asia/Ust-Nera.Asia/Vladivostok.Asia/Yakutsk.Asia/Yekaterinburg.Europe/Astrakhan.Europe/Kaliningrad.Europe/Kirov.Europe/Moscow.Europe/Samara.Europe/Saratov.Europe/Ulyanovsk.Europe/Volgograd`.split(`.`),RW:[`Africa/Kigali`],SA:[`Asia/Riyadh`],SB:[`Pacific/Guadalcanal`],SC:[`Indian/Mahe`],SD:[`Africa/Khartoum`],SE:[`Europe/Stockholm`],SG:[`Asia/Singapore`],SH:[`Atlantic/St_Helena`],SI:[`Europe/Ljubljana`],SJ:[`Arctic/Longyearbyen`,`Atlantic/Jan_Mayen`],SK:[`Europe/Bratislava`],SL:[`Africa/Freetown`],SM:[`Europe/San_Marino`],SN:[`Africa/Dakar`],SO:[`Africa/Mogadishu`],SR:[`America/Paramaribo`],SS:[`Africa/Juba`],ST:[`Africa/Sao_Tome`],SV:[`America/El_Salvador`],SX:[`America/Lower_Princes`],SY:[`Asia/Damascus`],SZ:[`Africa/Mbabane`],TC:[`America/Grand_Turk`],TD:[`Africa/Ndjamena`],TG:[`Africa/Lome`],TH:[`Asia/Bangkok`],TJ:[`Asia/Dushanbe`],TK:[`Pacific/Fakaofo`],TL:[`Asia/Dili`],TM:[`Asia/Ashgabat`,`Asia/Ashkhabad`],TN:[`Africa/Tunis`],TO:[`Pacific/Tongatapu`],TR:[`Asia/Istanbul`,`Europe/Istanbul`],TT:[`America/Port_of_Spain`],TV:[`Pacific/Funafuti`],TW:[`Asia/Taipei`],TZ:[`Africa/Dar_es_Salaam`],UA:[`Europe/Kiev`,`Europe/Kyiv`,`Europe/Simferopol`,`Europe/Uzhgorod`,`Europe/Zaporozhye`],UG:[`Africa/Kampala`],US:`America/Adak.America/Anchorage.America/Atka.America/Boise.America/Chicago.America/Denver.America/Detroit.America/Fort_Wayne.America/Indiana/Indianapolis.America/Indiana/Knox.America/Indiana/Marengo.America/Indiana/Petersburg.America/Indiana/Tell_City.America/Indiana/Vevay.America/Indiana/Vincennes.America/Indiana/Winamac.America/Indianapolis.America/Juneau.America/Kentucky/Louisville.America/Kentucky/Monticello.America/Knox_IN.America/Los_Angeles.America/Louisville.America/Menominee.America/Metlakatla.America/New_York.America/Nome.America/North_Dakota/Beulah.America/North_Dakota/Center.America/North_Dakota/New_Salem.America/Phoenix.America/Shiprock.America/Sitka.America/Yakutat.Pacific/Honolulu.US/Alaska.US/Aleutian.US/Arizona.US/Central.US/East-Indiana.US/Eastern.US/Hawaii.US/Indiana-Starke.US/Michigan.US/Mountain.US/Pacific`.split(`.`),UY:[`America/Montevideo`],UZ:[`Asia/Samarkand`,`Asia/Tashkent`],VA:[`Europe/Vatican`],VC:[`America/St_Vincent`],VE:[`America/Caracas`],VG:[`America/Tortola`],VI:[`America/St_Thomas`,`America/Virgin`],VN:[`Asia/Ho_Chi_Minh`,`Asia/Saigon`],VU:[`Pacific/Efate`],WF:[`Pacific/Wallis`],WS:[`Pacific/Apia`],YE:[`Asia/Aden`],YT:[`Indian/Mayotte`],ZA:[`Africa/Johannesburg`],ZM:[`Africa/Lusaka`],ZW:[`Africa/Harare`]},u=new Set(c.map(([e])=>e)),d=new Map;for(let[e,t]of Object.entries(l))for(let n of t)d.set(n,e);function f(e){let t=d.get(e);return t&&u.has(t)?t:null}function p(e){if(!e)return null;let t;try{t=new Intl.Locale(e).region}catch{return null}return t&&u.has(t)?t:null}function m(){let e;try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{e=void 0}let t=typeof navigator>`u`?void 0:navigator.language;return f(e)||p(t)||null}function h(){return Promise.all([import(`./max-CNrKnpEj.js`),import(`./examples.mobile.json-GS1_MGh9.js`)]).then(([e,t])=>g(e,t.default||t))}function g(e,t){return{AsYouType:e.AsYouType,getExampleNumber:e.getExampleNumber,isValidPhoneNumber:e.isValidPhoneNumber,parsePhoneNumber:e.parsePhoneNumber,examples:t}}var _=e=>e?`wui-flag wui-flag-${String(e).toLowerCase()}`:`wui-flag`,v=e=>e?`+${s(e)}`:``,y=null,b=null;function x(){return y?Promise.resolve(y):(b||=h().then(e=>(y=e,y)).catch(()=>null),b)}function S(e,t){let n=`+${s(e)}`;return t?.startsWith(n)?t.slice(n.length).trimStart():null}function C(e,t){if(!y||!t||!e)return t;try{return S(e,new y.AsYouType(e).input(`+${s(e)}${t}`))||t}catch{return t}}function w(e,t){if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(/[0-9]/.test(e[r])&&(n+=1,n===t))return r+1;return e.length}function T(e){if(!y||!e)return null;try{return S(e,y.getExampleNumber(e,y.examples)?.formatInternational())||null}catch{return null}}function E(e){let t=T(e);return t?`For example ${t}`:null}function D(e){if(!y||!e)return null;try{if(!y.isValidPhoneNumber(e))return!1;let t=y.parsePhoneNumber(e)?.getType?.();return t===void 0||t===`MOBILE`||t===`FIXED_LINE_OR_MOBILE`}catch{return null}}function O(e){if(!y||!e)return null;try{let t=y.getExampleNumber(e,y.examples);return t?.nationalNumber?t.nationalNumber.length:null}catch{return null}}function k(e,t,n){try{let r=y.parsePhoneNumber(t,e),i=r?.nationalNumber;return!i||r.country!==e||i.length>n||!t.endsWith(i)?null:i}catch{return null}}function A(e){if(!y||!e?.trim().startsWith(`+`))return null;try{let t=new y.AsYouType;t.input(e.trim());let n=t.getCountry();return n?{country:n,national:t.getNationalNumber()||``}:null}catch{return null}}var j=class extends e{static formAssociated=!0;static get observedAttributes(){return[`value`,`country`,`placeholder`,`disabled`,`required`,`aria-label`,`aria-describedby`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._defaultCountry=m()||``,this._country=this._defaultCountry,this._national=``,this._active=-1,this._committedValue=``,this._validateOnInput=!1}connectedCallback(){if(!this._rendered){this.render();return}this._bindGlobal?.()}attributeChangedCallback(e,t,n){if(e===`value`){this.value=n;return}if(this._rendered){if(e===`aria-label`){let t=this.querySelector(`input[type=tel]`);t&&(n==null?t.removeAttribute(e):t.setAttribute(e,n));return}if(e===`aria-describedby`){this._syncDescribedBy();return}e===`country`&&(this._country=n||this._defaultCountry,this._suppressCountryRender)||this.render()}}formResetCallback(){this._validateOnInput=!1,this.value=this._defaultValue||``}get value(){return this._national&&this._country?`+${s(this._country)}${this._national}`:``}set value(e){let t=String(e??``).trim(),n=A(t);if(n)this._country=n.country,this._national=n.national.replace(/[^0-9]/g,``);else if(t.startsWith(`+`)){let e=t.replace(/[^0-9]/g,``),n=String(s(this._country));n&&e.startsWith(n)&&(e=e.slice(n.length)),this._national=e}else this._national=t.replace(/[^0-9]/g,``);n&&this.getAttribute(`country`)!==this._country?this.setAttribute(`country`,this._country):this._rendered&&this.render(),this._committedValue=this.value,this._syncMirror()}_syncMirror(){a(this,this.value)}_syncDescribedBy(){let e=this.querySelector(`input[type=tel]`);if(!e)return;let t=[this.getAttribute(`aria-describedby`),this.querySelector(`[data-phone-error]`)?.id].filter(Boolean);t.length?e.setAttribute(`aria-describedby`,t.join(` `)):e.removeAttribute(`aria-describedby`)}_emitInput(){this.dispatchEvent(new Event(`input`,{bubbles:!0}))}_emitChange(){this._committedValue=this.value,this.dispatchEvent(new Event(`change`,{bubbles:!0}))}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``),this._country=this.getAttribute(`country`)||this._country;let e=this.getAttribute(`placeholder`)||E(this._country)||`Enter phone number`;this.id||=`wui-phone-${Math.random().toString(36).slice(2,9)}`;let t=`${this.id}-listbox`;this._listboxId=t,this.innerHTML=`
1
+ import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"./anchorOverlay-HAWsGzlr.js";import{t as i}from"./iconGlyphs.g-Bk8AzmSO.js";import{t as a}from"./formMirror-BgY7zkC3.js";import{n as o}from"./listboxKeyNav-DMIvs9d6.js";import{n as s,t as c}from"./countries-CvmZ2xpG.js";var l={AD:[`Europe/Andorra`],AE:[`Asia/Dubai`],AF:[`Asia/Kabul`],AG:[`America/Antigua`],AI:[`America/Anguilla`],AL:[`Europe/Tirane`],AM:[`Asia/Yerevan`],AO:[`Africa/Luanda`],AR:[`America/Argentina/Buenos_Aires`,`America/Argentina/Catamarca`,`America/Argentina/ComodRivadavia`,`America/Argentina/Cordoba`,`America/Argentina/Jujuy`,`America/Argentina/La_Rioja`,`America/Argentina/Mendoza`,`America/Argentina/Rio_Gallegos`,`America/Argentina/Salta`,`America/Argentina/San_Juan`,`America/Argentina/San_Luis`,`America/Argentina/Tucuman`,`America/Argentina/Ushuaia`,`America/Buenos_Aires`,`America/Catamarca`,`America/Cordoba`,`America/Jujuy`,`America/Mendoza`,`America/Rosario`],AS:[`Pacific/Pago_Pago`,`Pacific/Samoa`,`US/Samoa`],AT:[`Europe/Vienna`],AU:[`Antarctica/Macquarie`,`Australia/Adelaide`,`Australia/Brisbane`,`Australia/Broken_Hill`,`Australia/Canberra`,`Australia/Currie`,`Australia/Darwin`,`Australia/Eucla`,`Australia/Hobart`,`Australia/LHI`,`Australia/Lindeman`,`Australia/Lord_Howe`,`Australia/Melbourne`,`Australia/NSW`,`Australia/North`,`Australia/Perth`,`Australia/Queensland`,`Australia/South`,`Australia/Sydney`,`Australia/Tasmania`,`Australia/Victoria`,`Australia/West`,`Australia/Yancowinna`],AW:[`America/Aruba`],AX:[`Europe/Mariehamn`],AZ:[`Asia/Baku`],BA:[`Europe/Sarajevo`],BB:[`America/Barbados`],BD:[`Asia/Dacca`,`Asia/Dhaka`],BE:[`Europe/Brussels`],BF:[`Africa/Ouagadougou`],BG:[`Europe/Sofia`],BH:[`Asia/Bahrain`],BI:[`Africa/Bujumbura`],BJ:[`Africa/Porto-Novo`],BL:[`America/St_Barthelemy`],BM:[`Atlantic/Bermuda`],BN:[`Asia/Brunei`],BO:[`America/La_Paz`],BQ:[`America/Kralendijk`],BR:[`America/Araguaina`,`America/Bahia`,`America/Belem`,`America/Boa_Vista`,`America/Campo_Grande`,`America/Cuiaba`,`America/Eirunepe`,`America/Fortaleza`,`America/Maceio`,`America/Manaus`,`America/Noronha`,`America/Porto_Acre`,`America/Porto_Velho`,`America/Recife`,`America/Rio_Branco`,`America/Santarem`,`America/Sao_Paulo`,`Brazil/DeNoronha`,`Brazil/East`,`Brazil/West`],BS:[`America/Nassau`],BT:[`Asia/Thimbu`,`Asia/Thimphu`],BW:[`Africa/Gaborone`],BY:[`Europe/Minsk`],BZ:[`America/Belize`],CA:`America/Atikokan.America/Blanc-Sablon.America/Cambridge_Bay.America/Coral_Harbour.America/Creston.America/Dawson.America/Dawson_Creek.America/Edmonton.America/Fort_Nelson.America/Glace_Bay.America/Goose_Bay.America/Halifax.America/Inuvik.America/Iqaluit.America/Moncton.America/Montreal.America/Nipigon.America/Pangnirtung.America/Rainy_River.America/Rankin_Inlet.America/Regina.America/Resolute.America/St_Johns.America/Swift_Current.America/Thunder_Bay.America/Toronto.America/Vancouver.America/Whitehorse.America/Winnipeg.America/Yellowknife.Canada/Atlantic.Canada/Central.Canada/Eastern.Canada/Mountain.Canada/Newfoundland.Canada/Pacific.Canada/Saskatchewan.Canada/Yukon`.split(`.`),CC:[`Indian/Cocos`],CD:[`Africa/Kinshasa`,`Africa/Lubumbashi`],CF:[`Africa/Bangui`],CG:[`Africa/Brazzaville`],CH:[`Europe/Zurich`],CI:[`Africa/Abidjan`],CK:[`Pacific/Rarotonga`],CL:[`America/Coyhaique`,`America/Punta_Arenas`,`America/Santiago`,`Chile/Continental`,`Chile/EasterIsland`,`Pacific/Easter`],CM:[`Africa/Douala`],CN:[`Asia/Chongqing`,`Asia/Harbin`,`Asia/Kashgar`,`Asia/Shanghai`,`Asia/Urumqi`],CO:[`America/Bogota`],CR:[`America/Costa_Rica`],CU:[`America/Havana`],CV:[`Atlantic/Cape_Verde`],CW:[`America/Curacao`],CX:[`Indian/Christmas`],CY:[`Asia/Famagusta`,`Asia/Nicosia`,`Europe/Nicosia`],CZ:[`Europe/Prague`],DE:[`Europe/Berlin`,`Europe/Busingen`],DJ:[`Africa/Djibouti`],DK:[`Europe/Copenhagen`],DM:[`America/Dominica`],DO:[`America/Santo_Domingo`],DZ:[`Africa/Algiers`],EC:[`America/Guayaquil`,`Pacific/Galapagos`],EE:[`Europe/Tallinn`],EG:[`Africa/Cairo`],EH:[`Africa/El_Aaiun`],ER:[`Africa/Asmara`,`Africa/Asmera`],ES:[`Africa/Ceuta`,`Atlantic/Canary`,`Europe/Madrid`],ET:[`Africa/Addis_Ababa`],FI:[`Europe/Helsinki`],FJ:[`Pacific/Fiji`],FK:[`Atlantic/Stanley`],FM:[`Pacific/Chuuk`,`Pacific/Kosrae`,`Pacific/Pohnpei`,`Pacific/Ponape`,`Pacific/Truk`,`Pacific/Yap`],FO:[`Atlantic/Faeroe`,`Atlantic/Faroe`],FR:[`Europe/Paris`],GA:[`Africa/Libreville`],GB:[`Europe/Belfast`,`Europe/London`],GD:[`America/Grenada`],GE:[`Asia/Tbilisi`],GF:[`America/Cayenne`],GG:[`Europe/Guernsey`],GH:[`Africa/Accra`],GI:[`Europe/Gibraltar`],GL:[`America/Danmarkshavn`,`America/Godthab`,`America/Nuuk`,`America/Scoresbysund`,`America/Thule`],GM:[`Africa/Banjul`],GN:[`Africa/Conakry`],GP:[`America/Guadeloupe`],GQ:[`Africa/Malabo`],GR:[`Europe/Athens`],GT:[`America/Guatemala`],GU:[`Pacific/Guam`],GW:[`Africa/Bissau`],GY:[`America/Guyana`],HK:[`Asia/Hong_Kong`],HN:[`America/Tegucigalpa`],HR:[`Europe/Zagreb`],HT:[`America/Port-au-Prince`],HU:[`Europe/Budapest`],ID:[`Asia/Jakarta`,`Asia/Jayapura`,`Asia/Makassar`,`Asia/Pontianak`,`Asia/Ujung_Pandang`],IE:[`Europe/Dublin`],IL:[`Asia/Jerusalem`,`Asia/Tel_Aviv`],IM:[`Europe/Isle_of_Man`],IN:[`Asia/Calcutta`,`Asia/Kolkata`],IO:[`Indian/Chagos`],IQ:[`Asia/Baghdad`],IR:[`Asia/Tehran`],IS:[`Atlantic/Reykjavik`],IT:[`Europe/Rome`],JE:[`Europe/Jersey`],JM:[`America/Jamaica`],JO:[`Asia/Amman`],JP:[`Asia/Tokyo`],KE:[`Africa/Nairobi`],KG:[`Asia/Bishkek`],KH:[`Asia/Phnom_Penh`],KI:[`Pacific/Enderbury`,`Pacific/Kanton`,`Pacific/Kiritimati`,`Pacific/Tarawa`],KM:[`Indian/Comoro`],KN:[`America/St_Kitts`],KP:[`Asia/Pyongyang`],KR:[`Asia/Seoul`],KW:[`Asia/Kuwait`],KY:[`America/Cayman`],KZ:[`Asia/Almaty`,`Asia/Aqtau`,`Asia/Aqtobe`,`Asia/Atyrau`,`Asia/Oral`,`Asia/Qostanay`,`Asia/Qyzylorda`],LA:[`Asia/Vientiane`],LB:[`Asia/Beirut`],LC:[`America/St_Lucia`],LI:[`Europe/Vaduz`],LK:[`Asia/Colombo`],LR:[`Africa/Monrovia`],LS:[`Africa/Maseru`],LT:[`Europe/Vilnius`],LU:[`Europe/Luxembourg`],LV:[`Europe/Riga`],LY:[`Africa/Tripoli`],MA:[`Africa/Casablanca`],MC:[`Europe/Monaco`],MD:[`Europe/Chisinau`,`Europe/Tiraspol`],ME:[`Europe/Podgorica`],MF:[`America/Marigot`],MG:[`Indian/Antananarivo`],MH:[`Pacific/Kwajalein`,`Pacific/Majuro`],MK:[`Europe/Skopje`],ML:[`Africa/Bamako`,`Africa/Timbuktu`],MM:[`Asia/Rangoon`,`Asia/Yangon`],MN:[`Asia/Choibalsan`,`Asia/Hovd`,`Asia/Ulaanbaatar`,`Asia/Ulan_Bator`],MO:[`Asia/Macao`,`Asia/Macau`],MP:[`Pacific/Saipan`],MQ:[`America/Martinique`],MR:[`Africa/Nouakchott`],MS:[`America/Montserrat`],MT:[`Europe/Malta`],MU:[`Indian/Mauritius`],MV:[`Indian/Maldives`],MW:[`Africa/Blantyre`],MX:[`America/Bahia_Banderas`,`America/Cancun`,`America/Chihuahua`,`America/Ciudad_Juarez`,`America/Ensenada`,`America/Hermosillo`,`America/Matamoros`,`America/Mazatlan`,`America/Merida`,`America/Mexico_City`,`America/Monterrey`,`America/Ojinaga`,`America/Santa_Isabel`,`America/Tijuana`,`Mexico/BajaNorte`,`Mexico/BajaSur`,`Mexico/General`],MY:[`Asia/Kuala_Lumpur`,`Asia/Kuching`],MZ:[`Africa/Maputo`],NA:[`Africa/Windhoek`],NC:[`Pacific/Noumea`],NE:[`Africa/Niamey`],NF:[`Pacific/Norfolk`],NG:[`Africa/Lagos`],NI:[`America/Managua`],NL:[`Europe/Amsterdam`],NO:[`Europe/Oslo`],NP:[`Asia/Kathmandu`,`Asia/Katmandu`],NR:[`Pacific/Nauru`],NU:[`Pacific/Niue`],NZ:[`Pacific/Auckland`,`Pacific/Chatham`],OM:[`Asia/Muscat`],PA:[`America/Panama`],PE:[`America/Lima`],PF:[`Pacific/Gambier`,`Pacific/Marquesas`,`Pacific/Tahiti`],PG:[`Pacific/Bougainville`,`Pacific/Port_Moresby`],PH:[`Asia/Manila`],PK:[`Asia/Karachi`],PL:[`Europe/Warsaw`],PM:[`America/Miquelon`],PR:[`America/Puerto_Rico`],PS:[`Asia/Gaza`,`Asia/Hebron`],PT:[`Atlantic/Azores`,`Atlantic/Madeira`,`Europe/Lisbon`],PW:[`Pacific/Palau`],PY:[`America/Asuncion`],QA:[`Asia/Qatar`],RE:[`Indian/Reunion`],RO:[`Europe/Bucharest`],RS:[`Europe/Belgrade`],RU:`Asia/Anadyr.Asia/Barnaul.Asia/Chita.Asia/Irkutsk.Asia/Kamchatka.Asia/Khandyga.Asia/Krasnoyarsk.Asia/Magadan.Asia/Novokuznetsk.Asia/Novosibirsk.Asia/Omsk.Asia/Sakhalin.Asia/Srednekolymsk.Asia/Tomsk.Asia/Ust-Nera.Asia/Vladivostok.Asia/Yakutsk.Asia/Yekaterinburg.Europe/Astrakhan.Europe/Kaliningrad.Europe/Kirov.Europe/Moscow.Europe/Samara.Europe/Saratov.Europe/Ulyanovsk.Europe/Volgograd`.split(`.`),RW:[`Africa/Kigali`],SA:[`Asia/Riyadh`],SB:[`Pacific/Guadalcanal`],SC:[`Indian/Mahe`],SD:[`Africa/Khartoum`],SE:[`Europe/Stockholm`],SG:[`Asia/Singapore`],SH:[`Atlantic/St_Helena`],SI:[`Europe/Ljubljana`],SJ:[`Arctic/Longyearbyen`,`Atlantic/Jan_Mayen`],SK:[`Europe/Bratislava`],SL:[`Africa/Freetown`],SM:[`Europe/San_Marino`],SN:[`Africa/Dakar`],SO:[`Africa/Mogadishu`],SR:[`America/Paramaribo`],SS:[`Africa/Juba`],ST:[`Africa/Sao_Tome`],SV:[`America/El_Salvador`],SX:[`America/Lower_Princes`],SY:[`Asia/Damascus`],SZ:[`Africa/Mbabane`],TC:[`America/Grand_Turk`],TD:[`Africa/Ndjamena`],TG:[`Africa/Lome`],TH:[`Asia/Bangkok`],TJ:[`Asia/Dushanbe`],TK:[`Pacific/Fakaofo`],TL:[`Asia/Dili`],TM:[`Asia/Ashgabat`,`Asia/Ashkhabad`],TN:[`Africa/Tunis`],TO:[`Pacific/Tongatapu`],TR:[`Asia/Istanbul`,`Europe/Istanbul`],TT:[`America/Port_of_Spain`],TV:[`Pacific/Funafuti`],TW:[`Asia/Taipei`],TZ:[`Africa/Dar_es_Salaam`],UA:[`Europe/Kiev`,`Europe/Kyiv`,`Europe/Simferopol`,`Europe/Uzhgorod`,`Europe/Zaporozhye`],UG:[`Africa/Kampala`],US:`America/Adak.America/Anchorage.America/Atka.America/Boise.America/Chicago.America/Denver.America/Detroit.America/Fort_Wayne.America/Indiana/Indianapolis.America/Indiana/Knox.America/Indiana/Marengo.America/Indiana/Petersburg.America/Indiana/Tell_City.America/Indiana/Vevay.America/Indiana/Vincennes.America/Indiana/Winamac.America/Indianapolis.America/Juneau.America/Kentucky/Louisville.America/Kentucky/Monticello.America/Knox_IN.America/Los_Angeles.America/Louisville.America/Menominee.America/Metlakatla.America/New_York.America/Nome.America/North_Dakota/Beulah.America/North_Dakota/Center.America/North_Dakota/New_Salem.America/Phoenix.America/Shiprock.America/Sitka.America/Yakutat.Pacific/Honolulu.US/Alaska.US/Aleutian.US/Arizona.US/Central.US/East-Indiana.US/Eastern.US/Hawaii.US/Indiana-Starke.US/Michigan.US/Mountain.US/Pacific`.split(`.`),UY:[`America/Montevideo`],UZ:[`Asia/Samarkand`,`Asia/Tashkent`],VA:[`Europe/Vatican`],VC:[`America/St_Vincent`],VE:[`America/Caracas`],VG:[`America/Tortola`],VI:[`America/St_Thomas`,`America/Virgin`],VN:[`Asia/Ho_Chi_Minh`,`Asia/Saigon`],VU:[`Pacific/Efate`],WF:[`Pacific/Wallis`],WS:[`Pacific/Apia`],YE:[`Asia/Aden`],YT:[`Indian/Mayotte`],ZA:[`Africa/Johannesburg`],ZM:[`Africa/Lusaka`],ZW:[`Africa/Harare`]},u=new Set(c.map(([e])=>e)),d=new Map;for(let[e,t]of Object.entries(l))for(let n of t)d.set(n,e);function f(e){let t=d.get(e);return t&&u.has(t)?t:null}function p(e){if(!e)return null;let t;try{t=new Intl.Locale(e).region}catch{return null}return t&&u.has(t)?t:null}function m(){let e;try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{e=void 0}let t=typeof navigator>`u`?void 0:navigator.language;return f(e)||p(t)||null}function h(){return Promise.all([import(`./max-CNrKnpEj.js`),import(`./examples.mobile.json-GS1_MGh9.js`)]).then(([e,t])=>g(e,t.default||t))}function g(e,t){return{AsYouType:e.AsYouType,getExampleNumber:e.getExampleNumber,isValidPhoneNumber:e.isValidPhoneNumber,parsePhoneNumber:e.parsePhoneNumber,examples:t}}var _=e=>e?`wui-flag wui-flag-${String(e).toLowerCase()}`:`wui-flag`,v=e=>e?`+${s(e)}`:``,y=null,b=null;function x(){return y?Promise.resolve(y):(b||=h().then(e=>(y=e,y)).catch(()=>null),b)}function S(e,t){let n=`+${s(e)}`;return t?.startsWith(n)?t.slice(n.length).trimStart():null}function C(e,t){if(!y||!t||!e)return t;try{return S(e,new y.AsYouType(e).input(`+${s(e)}${t}`))||t}catch{return t}}function w(e,t){if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(/[0-9]/.test(e[r])&&(n+=1,n===t))return r+1;return e.length}function T(e){if(!y||!e)return null;try{return S(e,y.getExampleNumber(e,y.examples)?.formatInternational())||null}catch{return null}}function E(e){let t=T(e);return t?`For example ${t}`:null}function D(e){if(!y||!e)return null;try{if(!y.isValidPhoneNumber(e))return!1;let t=y.parsePhoneNumber(e)?.getType?.();return t===void 0||t===`MOBILE`||t===`FIXED_LINE_OR_MOBILE`}catch{return null}}function O(e){if(!y||!e)return null;try{let t=y.getExampleNumber(e,y.examples);return t?.nationalNumber?t.nationalNumber.length:null}catch{return null}}function k(e,t,n){try{let r=y.parsePhoneNumber(t,e),i=r?.nationalNumber;return!i||r.country!==e||i.length>n||!t.endsWith(i)?null:i}catch{return null}}function A(e){if(!y||!e?.trim().startsWith(`+`))return null;try{let t=new y.AsYouType;t.input(e.trim());let n=t.getCountry();return n?{country:n,national:t.getNationalNumber()||``}:null}catch{return null}}var j=class extends e{static formAssociated=!0;static get observedAttributes(){return[`value`,`country`,`placeholder`,`disabled`,`required`,`aria-label`,`aria-describedby`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._defaultCountry=m()||``,this._country=this._defaultCountry,this._national=``,this._active=-1,this._committedValue=``,this._validateOnInput=!1}connectedCallback(){if(!this._rendered){this.render();return}this._bindGlobal?.()}attributeChangedCallback(e,t,n){if(e===`value`){this.value=n;return}if(this._rendered){if(e===`aria-label`){let t=this.querySelector(`input[type=tel]`);t&&(n==null?t.removeAttribute(e):t.setAttribute(e,n));return}if(e===`aria-describedby`){this._syncDescribedBy();return}e===`country`&&(this._country=n||this._defaultCountry,this._suppressCountryRender)||this.render()}}formResetCallback(){this._validateOnInput=!1,this.value=this._defaultValue||``}get value(){return this._national&&this._country?`+${s(this._country)}${this._national}`:``}set value(e){let t=String(e??``).trim(),n=A(t);if(n)this._country=n.country,this._national=n.national.replace(/[^0-9]/g,``);else if(t.startsWith(`+`)){let e=t.replace(/[^0-9]/g,``),n=String(s(this._country));n&&e.startsWith(n)&&(e=e.slice(n.length)),this._national=e}else this._national=t.replace(/[^0-9]/g,``);n&&this.getAttribute(`country`)!==this._country?this.setAttribute(`country`,this._country):this._rendered&&this.render(),this._committedValue=this.value,this._syncMirror()}_syncMirror(){a(this,this.value)}_syncDescribedBy(){let e=this.querySelector(`input[type=tel]`);if(!e)return;let t=[this.getAttribute(`aria-describedby`),this.querySelector(`[data-phone-error]`)?.id].filter(Boolean);t.length?e.setAttribute(`aria-describedby`,t.join(` `)):e.removeAttribute(`aria-describedby`)}_emitInput(){this.dispatchEvent(new Event(`input`,{bubbles:!0}))}_emitChange(){this._committedValue=this.value,this.dispatchEvent(new Event(`change`,{bubbles:!0}))}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``),this._country=this.getAttribute(`country`)||this._country;let e=this.getAttribute(`placeholder`)||E(this._country)||`Enter phone number`;this.id||=`wui-phone-${Math.random().toString(36).slice(2,9)}`;let t=`${this.id}-listbox`;this._listboxId=t,this.innerHTML=`
2
2
  <div class="phone-input-wrap">
3
3
  <div class="phone-country-adornment">
4
4
  <button type="button" class="country-toggle" aria-label="Choose country" aria-haspopup="listbox" aria-expanded="false" aria-controls="${M(t)}"${this.hasAttribute(`disabled`)?` disabled`:``}>
@@ -12,4 +12,4 @@ import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from".
12
12
  </div>
13
13
  </div>
14
14
  <input type="tel" class="input" placeholder="${M(e)}" value="${M(C(this._country,this._national))}"${this.getAttribute(`aria-label`)?` aria-label="${M(this.getAttribute(`aria-label`))}"`:``}${this.getAttribute(`aria-describedby`)?` aria-describedby="${M(this.getAttribute(`aria-describedby`))}"`:``}${this.hasAttribute(`required`)?` required aria-required="true"`:``}${this.hasAttribute(`disabled`)?` disabled`:``} />
15
- </div>`,this._rendered=!0,a(this,this.value),this._wire()}_ensureItems(){let e=this.querySelector(`.country-list-scroll`);if(!e||e.querySelector(`.country-dropdown-item`))return;let t=this._listboxId,n=c.map(([e,n,r],i)=>`<button type="button" role="option" id="${M(`${t}-opt-${i}`)}" class="country-dropdown-item${e===this._country?` selected`:``}" data-iso="${e}" aria-selected="${e===this._country}"><span class="${_(e)}" aria-hidden="true"></span><span class="country-name-text">${n}<span class="country-code-text">+${r}</span></span></button>`).join(``);e.insertAdjacentHTML(`afterbegin`,n)}_itemEls(){return[...this.querySelectorAll(`.country-dropdown-item`)]}_visibleItems(){return this._itemEls().filter(e=>!e.hidden)}_wire(){this._teardown();let e=this.querySelector(`.country-toggle`),i=this.querySelector(`.phone-input-wrap`),a=this.querySelector(`.country-dropdown-menu`),c=this.querySelector(`.dropdown-search-input`),l=this.querySelector(`.country-list-scroll`),u=this.querySelector(`.country-empty`),d=this.querySelector(`input[type=tel]`),f=this.querySelector(`[data-flag]`),p=this.querySelector(`[data-dial]`);if(!e||!a)return;let m=()=>!a.hidden,h=()=>r(i||e,a),g=(e,{reveal:t=!0}={})=>{let n=this._visibleItems();this._active=e,o(l,e>=0&&n[e]||null),e>=0&&n[e]?(t&&n[e].scrollIntoView({block:`nearest`}),c?.setAttribute(`aria-activedescendant`,n[e].id)):c?.removeAttribute(`aria-activedescendant`)},v=()=>{m()&&h()},y=()=>{this._ensureItems(),a.hidden=!1,e.setAttribute(`aria-expanded`,`true`),c.value=``,S(``),h(),t(this,v),c.focus(),g(this._visibleItems().findIndex(e=>e.classList.contains(`selected`)))},b=()=>{a.hidden=!0,e.setAttribute(`aria-expanded`,`false`),g(-1),n(this)},S=e=>{let t=e.trim().toLowerCase(),n=0;for(let e of this._itemEls()){let r=!t||e.textContent.toLowerCase().includes(t);e.hidden=!r,r&&(n+=1)}u&&(u.hidden=n>0)},j=e=>{this._country=e,this.getAttribute(`country`)!==e&&(this._suppressCountryRender=!0,this.setAttribute(`country`,e),this._suppressCountryRender=!1),f&&(f.className=_(e)),p&&(p.textContent=`+${s(e)}`);for(let t of this._itemEls()){let n=t.dataset.iso===e;t.classList.toggle(`selected`,n),t.setAttribute(`aria-selected`,String(n))}!this.getAttribute(`placeholder`)&&d&&(d.placeholder=E(e)||`Enter phone number`),d&&this._national&&(d.value=C(e,this._national)),b(),this._syncMirror(),this._emitChange(),this._validateOnInput&&N(P()),d?.focus()},M=t=>{let n=this._visibleItems();if(t.key===`ArrowDown`){if(t.preventDefault(),!m()){y();return}g(Math.min(this._active+1,n.length-1))}else if(t.key===`ArrowUp`){if(t.preventDefault(),!m())return;g(Math.max(this._active-1,0))}else t.key===`Enter`?(t.preventDefault(),m()&&n[this._active]&&j(n[this._active].dataset.iso)):t.key===`Escape`&&m()&&(t.preventDefault(),t.stopPropagation(),b(),e.focus())};e.addEventListener(`click`,()=>m()?b():y()),e.addEventListener(`keydown`,e=>{if(m()){M(e);return}(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),y())}),c.addEventListener(`input`,()=>{S(c.value);let e=this._visibleItems();g(e.length?0:-1)}),l.addEventListener(`click`,e=>{let t=e.target.closest(`.country-dropdown-item`);t&&j(t.dataset.iso)}),l.addEventListener(`mousemove`,e=>{let t=e.target.closest(`.country-dropdown-item`);t&&!t.classList.contains(`is-active`)&&g(this._visibleItems().indexOf(t),{reveal:!1})}),l.addEventListener(`mouseleave`,()=>g(-1)),a.addEventListener(`keydown`,M);let N=e=>{d.classList.toggle(`is-invalid`,e),e?d.setAttribute(`aria-invalid`,`true`):d.removeAttribute(`aria-invalid`);let t=this.querySelector(`[data-phone-error]`);if(e){t||(t=document.createElement(`div`),t.className=`field-error`,t.id=`${this.id}-phone-error`,t.setAttribute(`data-phone-error`,``),i.after(t));let e=T(this._country);t.textContent=this._country?e?`Enter a valid phone number, e.g. ${e}`:`Enter a valid phone number`:`Choose a country`}else t?.remove();this._syncDescribedBy()},P=()=>this._national.length>0&&(!this._country||D(this.value)===!1);d.addEventListener(`input`,e=>{e.stopPropagation();let t=d.selectionStart??d.value.length,n=d.value.slice(0,t).replace(/[^0-9]/g,``).length,r=d.value.replace(/[^0-9]/g,``),i=O(this._country);if(i&&r.length>i){let e=k(this._country,r,i);e?(n=Math.max(0,n-(r.length-e.length)),r=e):r=r.slice(0,i)}this._national=r;let a=C(this._country,this._national);if(d.value!==a){d.value=a;let e=w(a,Math.min(n,r.length));d.setSelectionRange(e,e)}this._syncMirror(),this._emitInput(),this._validateOnInput&&N(P())}),d.addEventListener(`change`,e=>e.stopPropagation()),d.addEventListener(`blur`,()=>{let e=P();N(e),e&&(this._validateOnInput=!0),this.value!==this._committedValue&&this._emitChange()}),d.addEventListener(`paste`,e=>{let t=A(e.clipboardData?.getData(`text`));t&&(e.preventDefault(),this._national=t.national.replace(/[^0-9]/g,``),t.country===this._country?d.value=C(this._country,this._national):this.setAttribute(`country`,t.country),this._syncMirror(),this._emitInput(),this._emitChange(),this._validateOnInput&&d.isConnected&&N(P()),this.querySelector(`input[type=tel]`)?.focus())}),this._bindGlobal=()=>{this._teardownGlobals?.(),this._onDocClick=e=>{m()&&!this.contains(e.target)&&b()},document.addEventListener(`click`,this._onDocClick),m()&&t(this,v)},this._teardownGlobals=()=>{this._onDocClick&&=(document.removeEventListener(`click`,this._onDocClick),null),n(this)},this._bindGlobal(),this._validateOnInput&&N(P()),x().then(e=>{if(!(!e||!d.isConnected)&&(this._national&&(d.value=C(this._country,this._national)),!this.getAttribute(`placeholder`))){let e=E(this._country);e&&(d.placeholder=e)}}),this._syncMirror()}_teardown(){this._teardownGlobals?.()}disconnectedCallback(){this._teardown()}},M=e=>String(e??``).replace(/"/g,`&quot;`).replace(/</g,`&lt;`);export{j as t};
15
+ </div>`,this._rendered=!0,a(this,this.value),this._wire()}_ensureItems(){let e=this.querySelector(`.country-list-scroll`);if(!e||e.querySelector(`.country-dropdown-item`))return;let t=this._listboxId,n=c.map(([e,n,r],i)=>`<button type="button" role="option" id="${M(`${t}-opt-${i}`)}" class="country-dropdown-item${e===this._country?` selected`:``}" data-iso="${e}" aria-selected="${e===this._country}"><span class="${_(e)}" aria-hidden="true"></span><span class="country-name-text">${n}<span class="country-code-text">+${r}</span></span></button>`).join(``);e.insertAdjacentHTML(`afterbegin`,n)}_itemEls(){return[...this.querySelectorAll(`.country-dropdown-item`)]}_visibleItems(){return this._itemEls().filter(e=>!e.hidden)}_wire(){this._teardown();let e=this.querySelector(`.country-toggle`),i=this.querySelector(`.phone-input-wrap`),a=this.querySelector(`.country-dropdown-menu`),c=this.querySelector(`.dropdown-search-input`),l=this.querySelector(`.country-list-scroll`),u=this.querySelector(`.country-empty`),d=this.querySelector(`input[type=tel]`),f=this.querySelector(`[data-flag]`),p=this.querySelector(`[data-dial]`);if(!e||!a)return;let m=()=>!a.hidden,h=()=>r(i||e,a),g=(e,{reveal:t=!0}={})=>{let n=this._visibleItems();this._active=e,o(l,e>=0&&n[e]||null),e>=0&&n[e]?(t&&n[e].scrollIntoView({block:`nearest`}),c?.setAttribute(`aria-activedescendant`,n[e].id)):c?.removeAttribute(`aria-activedescendant`)},v=()=>{m()&&h()},y=()=>{this._ensureItems(),a.hidden=!1,e.setAttribute(`aria-expanded`,`true`),c.value=``,S(``),h(),t(this,v),c.focus(),g(this._visibleItems().findIndex(e=>e.classList.contains(`selected`)))},b=()=>{a.hidden=!0,e.setAttribute(`aria-expanded`,`false`),g(-1),n(this)},S=e=>{let t=e.trim().toLowerCase(),n=0;for(let e of this._itemEls()){let r=!t||e.textContent.toLowerCase().includes(t);e.hidden=!r,r&&(n+=1)}u&&(u.hidden=n>0)},j=e=>{this._country=e,this.getAttribute(`country`)!==e&&(this._suppressCountryRender=!0,this.setAttribute(`country`,e),this._suppressCountryRender=!1),f&&(f.className=_(e)),p&&(p.textContent=`+${s(e)}`);for(let t of this._itemEls()){let n=t.dataset.iso===e;t.classList.toggle(`selected`,n),t.setAttribute(`aria-selected`,String(n))}!this.getAttribute(`placeholder`)&&d&&(d.placeholder=E(e)||`Enter phone number`),d&&this._national&&(d.value=C(e,this._national)),b(),this._syncMirror(),this._emitChange(),this._validateOnInput&&N(P()),d?.focus()},M=t=>{let n=this._visibleItems();if(t.key===`ArrowDown`){if(t.preventDefault(),!m()){y();return}g(Math.min(this._active+1,n.length-1))}else if(t.key===`ArrowUp`){if(t.preventDefault(),!m())return;g(Math.max(this._active-1,0))}else t.key===`Enter`?(t.preventDefault(),m()&&n[this._active]&&j(n[this._active].dataset.iso)):t.key===`Escape`&&m()&&(t.preventDefault(),t.stopPropagation(),b(),e.focus())};e.addEventListener(`click`,()=>m()?b():y()),e.addEventListener(`keydown`,e=>{if(m()){M(e);return}(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),y())}),c.addEventListener(`input`,()=>{S(c.value);let e=this._visibleItems();g(e.length?0:-1)}),l.addEventListener(`click`,e=>{let t=e.target.closest(`.country-dropdown-item`);t&&j(t.dataset.iso)}),l.addEventListener(`mousemove`,e=>{let t=e.target.closest(`.country-dropdown-item`);t&&!t.classList.contains(`is-active`)&&g(this._visibleItems().indexOf(t),{reveal:!1})}),l.addEventListener(`mouseleave`,()=>g(-1)),a.addEventListener(`keydown`,M);let N=e=>{d.classList.toggle(`is-invalid`,e),e?d.setAttribute(`aria-invalid`,`true`):d.removeAttribute(`aria-invalid`);let t=this.querySelector(`[data-phone-error]`);if(e&&!this.hasAttribute(`external-error`)){t||(t=document.createElement(`div`),t.className=`field-error`,t.id=`${this.id}-phone-error`,t.setAttribute(`data-phone-error`,``),i.after(t));let e=T(this._country);t.textContent=this._country?e?`Enter a valid phone number, e.g. ${e}`:`Enter a valid phone number`:`Choose a country`}else t?.remove();this._syncDescribedBy()},P=()=>this._national.length>0&&(!this._country||D(this.value)===!1);d.addEventListener(`input`,e=>{e.stopPropagation();let t=d.selectionStart??d.value.length,n=d.value.slice(0,t).replace(/[^0-9]/g,``).length,r=d.value.replace(/[^0-9]/g,``),i=O(this._country);if(i&&r.length>i){let e=k(this._country,r,i);e?(n=Math.max(0,n-(r.length-e.length)),r=e):r=r.slice(0,i)}this._national=r;let a=C(this._country,this._national);if(d.value!==a){d.value=a;let e=w(a,Math.min(n,r.length));d.setSelectionRange(e,e)}this._syncMirror(),this._emitInput(),this._validateOnInput&&N(P())}),d.addEventListener(`change`,e=>e.stopPropagation()),d.addEventListener(`blur`,()=>{let e=P();N(e),e&&(this._validateOnInput=!0),this.value!==this._committedValue&&this._emitChange()}),d.addEventListener(`paste`,e=>{let t=A(e.clipboardData?.getData(`text`));t&&(e.preventDefault(),this._national=t.national.replace(/[^0-9]/g,``),t.country===this._country?d.value=C(this._country,this._national):this.setAttribute(`country`,t.country),this._syncMirror(),this._emitInput(),this._emitChange(),this._validateOnInput&&d.isConnected&&N(P()),this.querySelector(`input[type=tel]`)?.focus())}),this._bindGlobal=()=>{this._teardownGlobals?.(),this._onDocClick=e=>{m()&&!this.contains(e.target)&&b()},document.addEventListener(`click`,this._onDocClick),m()&&t(this,v)},this._teardownGlobals=()=>{this._onDocClick&&=(document.removeEventListener(`click`,this._onDocClick),null),n(this)},this._bindGlobal(),this._validateOnInput&&N(P()),x().then(e=>{if(!(!e||!d.isConnected)&&(this._national&&(d.value=C(this._country,this._national)),!this.getAttribute(`placeholder`))){let e=E(this._country);e&&(d.placeholder=e)}}),this._syncMirror()}_teardown(){this._teardownGlobals?.()}disconnectedCallback(){this._teardown()}},M=e=>String(e??``).replace(/"/g,`&quot;`).replace(/</g,`&lt;`);export{j as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"./anchorOverlay-HAWsGzlr.js";import{t as i}from"./iconGlyphs.g-CUm_mfze.js";import{t as a}from"./formMirror-BgY7zkC3.js";import{n as o,t as s}from"./listboxKeyNav-DMIvs9d6.js";import{n as c,r as l,t as u}from"./optionLabel-BBaur8Bs.js";var d=class extends e{static formAssociated=!0;static get observedAttributes(){return[`value`,`placeholder`,`search-placeholder`,`searchable`,`disabled`,`compact`,`size`,`clearable`,`icon`,`prefix`,`aria-label`,`aria-invalid`]}_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||`Select`}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``,this._optionsProp=null,this._active=-1,this._typeahead=``,this._typeaheadTimer=null}connectedCallback(){if(!this._rendered){this.render();return}this._bindGlobal?.()}attributeChangedCallback(e,t,n){if(e===`value`){this.value=n;return}if(e===`aria-invalid`){this._syncInvalid();return}this._rendered&&this.render()}_syncInvalid(){let e=this.querySelector(`.search-select-control`);e&&(this.hasAttribute(`aria-invalid`)?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}formResetCallback(){this.value=this._defaultValue||``}get value(){return this._value}set value(e){this._value=e==null?``:String(e),a(this,this._value),this._syncSelected(),this._syncReset()}set options(e){this._optionsProp=Array.isArray(e)?e:null,this.isConnected&&this.render()}get options(){return this._readOptions()}_snapshotDeclared(){if(this._declared)return;let e=[...this.querySelectorAll(`:scope > wui-option`)];e.length&&(this._declared=e.map(e=>({value:e.getAttribute(`value`)??e.textContent.trim(),label:e.innerHTML,icon:e.getAttribute(`icon`)||void 0,[u]:!0,selected:e.hasAttribute(`selected`)})))}_readOptions(){return this._optionsProp?this._optionsProp:(this._snapshotDeclared(),this._declared||[])}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``),this._snapshotDeclared();let e=this._readOptions(),t=this.hasAttribute(`searchable`),n=this.hasAttribute(`clearable`),r=this.getAttribute(`size`),o=r===`sm`?` search-select-sm`:r===`lg`?` search-select-lg`:``,s=this.getAttribute(`icon`),u=this.getAttribute(`prefix`),d=this.getAttribute(`placeholder`)||`Select...`,p=this.getAttribute(`search-placeholder`)||`Search...`,m=e.find(e=>String(e.value)===String(this._value))||e.find(e=>e.selected);m&&(this._value=String(m.value)),a(this,this._value),this.id||=`wui-select-${Math.random().toString(36).slice(2,9)}`;let h=`${this.id}-listbox`;this._listboxId=h;let g=e.map((e,t)=>{let n=String(e.value)===String(this._value);return`<button type="button" role="option" id="${f(`${h}-opt-${t}`)}" class="search-select-option${n?` selected`:``}" data-value="${f(e.value)}" aria-selected="${n}">${l(e)}</button>`}).join(``);this.innerHTML=`
1
+ import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"./anchorOverlay-HAWsGzlr.js";import{t as i}from"./iconGlyphs.g-Bk8AzmSO.js";import{t as a}from"./formMirror-BgY7zkC3.js";import{n as o,t as s}from"./listboxKeyNav-DMIvs9d6.js";import{n as c,r as l,t as u}from"./optionLabel-Bd3vP-XI.js";var d=class extends e{static formAssociated=!0;static get observedAttributes(){return[`value`,`placeholder`,`search-placeholder`,`searchable`,`disabled`,`compact`,`size`,`clearable`,`icon`,`prefix`,`aria-label`,`aria-invalid`]}_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||`Select`}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``,this._optionsProp=null,this._active=-1,this._typeahead=``,this._typeaheadTimer=null}connectedCallback(){if(!this._rendered){this.render();return}this._bindGlobal?.()}attributeChangedCallback(e,t,n){if(e===`value`){this.value=n;return}if(e===`aria-invalid`){this._syncInvalid();return}this._rendered&&this.render()}_syncInvalid(){let e=this.querySelector(`.search-select-control`);e&&(this.hasAttribute(`aria-invalid`)?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}formResetCallback(){this.value=this._defaultValue||``}get value(){return this._value}set value(e){this._value=e==null?``:String(e),a(this,this._value),this._syncSelected(),this._syncReset()}set options(e){this._optionsProp=Array.isArray(e)?e:null,this.isConnected&&this.render()}get options(){return this._readOptions()}_snapshotDeclared(){if(this._declared)return;let e=[...this.querySelectorAll(`:scope > wui-option`)];e.length&&(this._declared=e.map(e=>({value:e.getAttribute(`value`)??e.textContent.trim(),label:e.innerHTML,icon:e.getAttribute(`icon`)||void 0,[u]:!0,selected:e.hasAttribute(`selected`)})))}_readOptions(){return this._optionsProp?this._optionsProp:(this._snapshotDeclared(),this._declared||[])}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``),this._snapshotDeclared();let e=this._readOptions(),t=this.hasAttribute(`searchable`),n=this.hasAttribute(`clearable`),r=this.getAttribute(`size`),o=r===`sm`?` search-select-sm`:r===`lg`?` search-select-lg`:``,s=this.getAttribute(`icon`),u=this.getAttribute(`prefix`),d=this.getAttribute(`placeholder`)||`Select...`,p=this.getAttribute(`search-placeholder`)||`Search...`,m=e.find(e=>String(e.value)===String(this._value))||e.find(e=>e.selected);m&&(this._value=String(m.value)),a(this,this._value),this.id||=`wui-select-${Math.random().toString(36).slice(2,9)}`;let h=`${this.id}-listbox`;this._listboxId=h;let g=e.map((e,t)=>{let n=String(e.value)===String(this._value);return`<button type="button" role="option" id="${f(`${h}-opt-${t}`)}" class="search-select-option${n?` selected`:``}" data-value="${f(e.value)}" aria-selected="${n}">${l(e)}</button>`}).join(``);this.innerHTML=`
2
2
  <div class="search-select${this.hasAttribute(`compact`)?` search-select-compact`:``}${o}">
3
3
  <button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-controls="${f(h)}" aria-label="${f(this._accessibleName())}"${this.hasAttribute(`aria-invalid`)?` aria-invalid="true"`:``}${this.hasAttribute(`disabled`)?` disabled`:``}>
4
4
  ${s?i(s,{className:`search-select-icon`}):``}
@@ -11,4 +11,4 @@ import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from".
11
11
  ${t?`<div class="search-select-search">${i(`search`)}<input class="search-select-input" placeholder="${f(p)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden>${i(`x`)}</button></div>`:``}
12
12
  <div class="search-select-options">${g}<div class="search-select-empty" hidden>No matches</div></div>
13
13
  </div>
14
- </div>`,this._rendered=!0,a(this,this._value),this._wire(),this._syncReset()}_refs(){return{control:this.querySelector(`.search-select-control`),menu:this.querySelector(`.search-select-menu`),label:this.querySelector(`[data-label]`),reset:this.querySelector(`.search-select-reset`),search:this.querySelector(`.search-select-input`),clear:this.querySelector(`.search-select-clear`),empty:this.querySelector(`.search-select-empty`),optionsWrap:this.querySelector(`.search-select-options`)}}_optionEls(){return[...this.querySelectorAll(`.search-select-option`)]}_visible(){return this._optionEls().filter(e=>!e.hidden)}_syncSelected(){let{label:e}=this._refs(),t=this._readOptions().find(e=>String(e.value)===String(this._value));for(let e of this._optionEls()){let t=e.dataset.value===String(this._value);e.classList.toggle(`selected`,t),e.setAttribute(`aria-selected`,String(t))}e&&(e.innerHTML=t?l(t):c(this.getAttribute(`placeholder`)||`Select...`),e.classList.toggle(`search-select-placeholder`,!t))}_syncReset(){let{reset:e}=this._refs();e&&(e.hidden=!(this.hasAttribute(`clearable`)&&this._value!==``&&!this.hasAttribute(`disabled`)))}_wire(){this._teardown();let e=this._refs();if(!e.control||!e.menu)return;let i=()=>{if(this.hasAttribute(`compact`)){let t=e.control.getBoundingClientRect();e.menu.style.width=`max-content`,e.menu.style.minWidth=`${t.width}px`,e.menu.style.maxWidth=`280px`,r(e.control,e.menu)}else r(e.control,e.menu,{matchWidth:!0})},a=(t,{reveal:n=!0}={})=>{let r=this._visible();this._active=t,o(e.optionsWrap,t>=0&&r[t]||null),t>=0&&r[t]?(n&&r[t].scrollIntoView({block:`nearest`}),e.control.setAttribute(`aria-activedescendant`,r[t].id)):e.control.removeAttribute(`aria-activedescendant`)},c=t=>{let n=t.trim().toLowerCase(),r=0;for(let e of this._optionEls()){let t=!n||e.textContent.toLowerCase().includes(n);e.hidden=!t,t&&(r+=1)}e.empty&&(e.empty.hidden=r>0),e.clear&&(e.clear.hidden=!n),e.menu.hidden||i()},l=()=>!e.menu.hidden,u=()=>{l()&&i()},d=()=>{e.menu.hidden=!1,e.control.setAttribute(`aria-expanded`,`true`),e.control.classList.add(`open`),i(),t(this,u),e.search&&(e.search.value=``,c(``),e.search.focus()),a(this._optionEls().findIndex(e=>e.classList.contains(`selected`)))},f=()=>{e.menu.hidden=!0,e.control.setAttribute(`aria-expanded`,`false`),e.control.classList.remove(`open`),a(-1),n(this)},p=t=>{this.value=t.dataset.value,this.dispatchEvent(new Event(`change`,{bubbles:!0})),f(),e.control.focus()};this._navHandler=s({getVisibleOptions:()=>this._visible(),getActive:()=>this._active,setActive:e=>a(e),onEnter:e=>{e&&p(e)},onEscape:()=>{this._navHandler.clearTypeahead(),f(),e.control.focus()}});let m=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation()),this._navHandler.handler(e)};e.reset?.addEventListener(`click`,t=>{t.stopPropagation(),this.value=``,this.dispatchEvent(new Event(`change`,{bubbles:!0})),e.control.focus()}),e.control.addEventListener(`click`,()=>l()?f():d()),e.control.addEventListener(`keydown`,e=>{if(l()){m(e);return}(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),d())}),e.optionsWrap.addEventListener(`click`,e=>{let t=e.target.closest(`.search-select-option`);t&&p(t)}),e.optionsWrap.addEventListener(`mousemove`,e=>{let t=e.target.closest(`.search-select-option`);t&&!t.classList.contains(`is-active`)&&a(this._visible().indexOf(t),{reveal:!1})}),e.optionsWrap.addEventListener(`mouseleave`,()=>a(-1)),e.search?.addEventListener(`input`,()=>{c(e.search.value),a(-1)}),e.clear?.addEventListener(`click`,()=>{e.search.value=``,c(``),e.search.focus()}),e.menu.addEventListener(`keydown`,m),this._bindGlobal=()=>{this._teardown(),this._onDocClick=e=>{l()&&!this.contains(e.target)&&f()},document.addEventListener(`click`,this._onDocClick),l()&&t(this,u)},this._bindGlobal()}_teardown(){this._onDocClick&&=(document.removeEventListener(`click`,this._onDocClick),null),n(this),this._navHandler?.teardown()}disconnectedCallback(){this._teardown()}},f=e=>String(e??``).replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`);export{d as t};
14
+ </div>`,this._rendered=!0,a(this,this._value),this._wire(),this._syncReset()}_refs(){return{control:this.querySelector(`.search-select-control`),menu:this.querySelector(`.search-select-menu`),label:this.querySelector(`[data-label]`),reset:this.querySelector(`.search-select-reset`),search:this.querySelector(`.search-select-input`),clear:this.querySelector(`.search-select-clear`),empty:this.querySelector(`.search-select-empty`),optionsWrap:this.querySelector(`.search-select-options`)}}_optionEls(){return[...this.querySelectorAll(`.search-select-option`)]}_visible(){return this._optionEls().filter(e=>!e.hidden)}_syncSelected(){let{label:e}=this._refs(),t=this._readOptions().find(e=>String(e.value)===String(this._value));for(let e of this._optionEls()){let t=e.dataset.value===String(this._value);e.classList.toggle(`selected`,t),e.setAttribute(`aria-selected`,String(t))}e&&(e.innerHTML=t?l(t):c(this.getAttribute(`placeholder`)||`Select...`),e.classList.toggle(`search-select-placeholder`,!t))}_syncReset(){let{reset:e}=this._refs();e&&(e.hidden=!(this.hasAttribute(`clearable`)&&this._value!==``&&!this.hasAttribute(`disabled`)))}_wire(){this._teardown();let e=this._refs();if(!e.control||!e.menu)return;let i=()=>{if(this.hasAttribute(`compact`)){let t=e.control.getBoundingClientRect();e.menu.style.width=`max-content`,e.menu.style.minWidth=`${t.width}px`,e.menu.style.maxWidth=`280px`,r(e.control,e.menu)}else r(e.control,e.menu,{matchWidth:!0})},a=(t,{reveal:n=!0}={})=>{let r=this._visible();this._active=t,o(e.optionsWrap,t>=0&&r[t]||null),t>=0&&r[t]?(n&&r[t].scrollIntoView({block:`nearest`}),e.control.setAttribute(`aria-activedescendant`,r[t].id)):e.control.removeAttribute(`aria-activedescendant`)},c=t=>{let n=t.trim().toLowerCase(),r=0;for(let e of this._optionEls()){let t=!n||e.textContent.toLowerCase().includes(n);e.hidden=!t,t&&(r+=1)}e.empty&&(e.empty.hidden=r>0),e.clear&&(e.clear.hidden=!n),e.menu.hidden||i()},l=()=>!e.menu.hidden,u=()=>{l()&&i()},d=()=>{e.menu.hidden=!1,e.control.setAttribute(`aria-expanded`,`true`),e.control.classList.add(`open`),i(),t(this,u),e.search&&(e.search.value=``,c(``),e.search.focus()),a(this._optionEls().findIndex(e=>e.classList.contains(`selected`)))},f=()=>{e.menu.hidden=!0,e.control.setAttribute(`aria-expanded`,`false`),e.control.classList.remove(`open`),a(-1),n(this)},p=t=>{try{this.value=t.dataset.value,this.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{f(),e.control.focus()}};this._navHandler=s({getVisibleOptions:()=>this._visible(),getActive:()=>this._active,setActive:e=>a(e),onEnter:e=>{e&&p(e)},onEscape:()=>{this._navHandler.clearTypeahead(),f(),e.control.focus()}});let m=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation()),this._navHandler.handler(e)};e.reset?.addEventListener(`click`,t=>{t.stopPropagation(),this.value=``,this.dispatchEvent(new Event(`change`,{bubbles:!0})),f(),e.control.focus()}),e.control.addEventListener(`click`,()=>l()?f():d()),e.control.addEventListener(`keydown`,e=>{if(l()){m(e);return}(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),d())}),e.optionsWrap.addEventListener(`click`,e=>{let t=e.target.closest(`.search-select-option`);t&&p(t)}),e.optionsWrap.addEventListener(`mousemove`,e=>{let t=e.target.closest(`.search-select-option`);t&&!t.classList.contains(`is-active`)&&a(this._visible().indexOf(t),{reveal:!1})}),e.optionsWrap.addEventListener(`mouseleave`,()=>a(-1)),e.search?.addEventListener(`input`,()=>{c(e.search.value),a(-1)}),e.clear?.addEventListener(`click`,()=>{e.search.value=``,c(``),e.search.focus()}),e.menu.addEventListener(`keydown`,m),this._bindGlobal=()=>{this._teardown(),this._onDocClick=e=>{l()&&!this.contains(e.target)&&f()},document.addEventListener(`click`,this._onDocClick),l()&&t(this,u)},this._bindGlobal()}_teardown(){this._onDocClick&&=(document.removeEventListener(`click`,this._onDocClick),null),n(this),this._navHandler?.teardown()}disconnectedCallback(){this._teardown()}},f=e=>String(e??``).replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`);export{d as t};
@@ -1,14 +1,13 @@
1
- import{t as e}from"./elementBase-BlsR4tqa.js";import{t}from"./formMirror-BgY7zkC3.js";var n=class extends e{static formAssociated=!0;static get observedAttributes(){return[`min`,`max`,`step`,`value`,`start`,`end`,`name`,`start-name`,`end-name`,`disabled`,`size`,`show-value`,`unit`,`aria-label`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=50,this._start=25,this._end=75,this._isDragging=!1,this._dragThumb=null,this._pointerDownListener=null,this._pointerMoveListener=null,this._pointerUpListener=null,this._thumbKeyListener=null,this._trackClickListener=null}connectedCallback(){if(!this._rendered){this.render();return}this._wire()}get value(){return this._value}set value(e){this._value=this._snapToStep(this._clamp(r(e,this._value))),this._syncValue(),this._syncMirrors()}get start(){return this._start}set start(e){this._start=Math.min(this._snapToStep(this._clamp(r(e,this._start))),this._end),this._syncValue(),this._syncMirrors()}get end(){return this._end}set end(e){this._end=Math.max(this._snapToStep(this._clamp(r(e,this._end))),this._start),this._syncValue(),this._syncMirrors()}attributeChangedCallback(e,t,n){if(e===`value`||e===`start`||e===`end`||e===`min`||e===`max`||e===`step`){this._updateFromAttribute(e),this._rendered&&(this._syncValue(),this._syncMirrors());return}this._rendered&&this.render()}formResetCallback(){this._isRange()?this._resetRange():this._resetSingle()}_updateFromAttribute(e){e===`value`?this._value=this._snapToStep(this._clamp(r(this.getAttribute(`value`),this._value))):e===`start`?this._start=this._snapToStep(this._clamp(r(this.getAttribute(`start`),this._start))):e===`end`&&(this._end=this._snapToStep(this._clamp(r(this.getAttribute(`end`),this._end))))}_isRange(){return this.hasAttribute(`range`)}_min(){return r(this.getAttribute(`min`),0)}_max(){return r(this.getAttribute(`max`),100)}_step(){return r(this.getAttribute(`step`),1)}_clamp(e){return Math.max(this._min(),Math.min(e,this._max()))}_snapToStep(e){let t=this._step();if(t<=0)return e;let n=this._min();return this._clamp(n+Math.round((e-n)/t)*t)}_captureDefaults(){this._defaultsCaptured||=(this._isRange()?(this._defaultStart=this._start,this._defaultEnd=this._end):this._defaultValue=this._value,!0)}_resetSingle(){this._value=this._defaultValue??50,this._syncValue(),this._syncMirrors()}_resetRange(){this._start=this._defaultStart??25,this._end=this._defaultEnd??75,this._syncValue(),this._syncMirrors()}render(){this._captureDefaults();let e=this._min(),t=this._max(),n=this._isRange(),r=this.getAttribute(`size`),a=r===`sm`?` slider-sm`:r===`lg`?` slider-lg`:``,o=this.hasAttribute(`disabled`);n?(this._start=this._clamp(this._start),this._end=this._clamp(this._end),this._start>this._end&&([this._start,this._end]=[this._end,this._start])):this._value=this._clamp(this._value);let s=n=>t===e?0:(n-e)/(t-e)*100,c=n?s(this._start):0,l=s(n?this._end:this._value);this.innerHTML=`
1
+ import{t as e}from"./elementBase-BlsR4tqa.js";import{t}from"./formMirror-BgY7zkC3.js";var n=class extends e{static formAssociated=!0;static get observedAttributes(){return[`min`,`max`,`step`,`value`,`start`,`end`,`name`,`start-name`,`end-name`,`disabled`,`size`,`show-value`,`unit`,`aria-label`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=50,this._start=25,this._end=75,this._isDragging=!1,this._dragThumb=null,this._pointerDownListener=null,this._pointerMoveListener=null,this._pointerUpListener=null,this._thumbKeyListener=null,this._trackClickListener=null}connectedCallback(){if(!this._rendered){this.render();return}this._wire()}get value(){return this._value}set value(e){this._value=this._snapToStep(this._clamp(r(e,this._value))),this._syncValue(),this._syncMirrors()}get start(){return this._start}set start(e){this._start=Math.min(this._snapToStep(this._clamp(r(e,this._start))),this._end),this._syncValue(),this._syncMirrors()}get end(){return this._end}set end(e){this._end=Math.max(this._snapToStep(this._clamp(r(e,this._end))),this._start),this._syncValue(),this._syncMirrors()}attributeChangedCallback(e,t,n){if(e===`value`||e===`start`||e===`end`||e===`min`||e===`max`||e===`step`){this._updateFromAttribute(e),this._rendered&&(this._syncValue(),this._syncMirrors());return}this._rendered&&this.render()}formResetCallback(){this._isRange()?this._resetRange():this._resetSingle()}_updateFromAttribute(e){e===`value`?this._value=this._snapToStep(this._clamp(r(this.getAttribute(`value`),this._value))):e===`start`?this._start=this._snapToStep(this._clamp(r(this.getAttribute(`start`),this._start))):e===`end`&&(this._end=this._snapToStep(this._clamp(r(this.getAttribute(`end`),this._end))))}_isRange(){return this.hasAttribute(`range`)}_min(){return r(this.getAttribute(`min`),0)}_max(){return r(this.getAttribute(`max`),100)}_step(){return r(this.getAttribute(`step`),1)}_clamp(e){return Math.max(this._min(),Math.min(e,this._max()))}_snapToStep(e){let t=this._step();if(t<=0)return e;let n=this._min();return this._clamp(n+Math.round((e-n)/t)*t)}_captureDefaults(){this._defaultsCaptured||=(this._isRange()?(this._defaultStart=this._start,this._defaultEnd=this._end):this._defaultValue=this._value,!0)}_resetSingle(){this._value=this._defaultValue??50,this._syncValue(),this._syncMirrors()}_resetRange(){this._start=this._defaultStart??25,this._end=this._defaultEnd??75,this._syncValue(),this._syncMirrors()}render(){this._captureDefaults();let e=this._min(),t=this._max(),n=this._isRange(),r=this.getAttribute(`size`),a=r===`sm`?` slider-sm`:r===`lg`?` slider-lg`:``,o=this.hasAttribute(`disabled`);n?(this._start=this._clamp(this._start),this._end=this._clamp(this._end),this._start>this._end&&([this._start,this._end]=[this._end,this._start])):this._value=this._clamp(this._value),this.innerHTML=`
2
2
  <div class="slider${a}">
3
3
  <div class="slider-track" role="presentation"></div>
4
- <div class="slider-fill" style="left: ${c}%; right: ${100-l}%;" role="presentation"></div>
4
+ <div class="slider-fill" role="presentation"></div>
5
5
  ${n?`
6
6
  <button
7
7
  type="button"
8
8
  role="slider"
9
9
  class="slider-thumb"
10
10
  data-thumb="start"
11
- style="left: ${c}%;"
12
11
  aria-label="Minimum"
13
12
  aria-valuemin="${e}"
14
13
  aria-valuemax="${t}"
@@ -21,7 +20,6 @@ import{t as e}from"./elementBase-BlsR4tqa.js";import{t}from"./formMirror-BgY7zkC
21
20
  role="slider"
22
21
  class="slider-thumb"
23
22
  data-thumb="end"
24
- style="left: ${l}%;"
25
23
  aria-label="Maximum"
26
24
  aria-valuemin="${e}"
27
25
  aria-valuemax="${t}"
@@ -35,7 +33,6 @@ import{t as e}from"./elementBase-BlsR4tqa.js";import{t}from"./formMirror-BgY7zkC
35
33
  role="slider"
36
34
  class="slider-thumb"
37
35
  data-thumb="single"
38
- style="left: ${l}%;"
39
36
  aria-valuemin="${e}"
40
37
  aria-valuemax="${t}"
41
38
  aria-valuenow="${this._value}"
@@ -1,4 +1,4 @@
1
- import{t as e}from"./elementBase-BlsR4tqa.js";import{t}from"./iconGlyphs.g-CUm_mfze.js";import{n}from"./formMirror-BgY7zkC3.js";import{i as r,n as i,r as a,t as o}from"./tokenCommit-BKckxgtg.js";var s=class extends e{static formAssociated=!0;_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||`Add tags`}static get observedAttributes(){return[`placeholder`,`disabled`,`size`,`max-tags`,`aria-label`,`separators`,`allow-duplicates`,`aria-invalid`]}constructor(){super(),this._values=[],this._draftText=``;try{this._internals=this.attachInternals()}catch{this._internals=null}}connectedCallback(){if(!this._rendered){if(!this._valuesInit&&!this._values.length){let e=this.getAttribute(`value`);if(e!=null&&e!==``)this._values=e.split(`,`).map(e=>e.trim()).filter(Boolean);else{let e=[...this.querySelectorAll(`:scope > wui-tag`)].map(e=>e.textContent.trim());e.length&&(this._values=e.map(String))}}this._valuesInit=!0,this._defaultCaptured||=(this._defaultValues=this._values.slice(),!0),this.render();return}this._wire()}formResetCallback(){this.values=(this._defaultValues||[]).slice(),this._draftText=``;let e=this.querySelector(`[data-input]`);e&&(e.value=``)}attributeChangedCallback(e){if(e===`aria-invalid`){this._syncInvalid();return}if(this._rendered){if(e===`separators`||e===`allow-duplicates`){this._wire();return}this.render()}}_syncInvalid(){let e=this.querySelector(`.search-select-control`);e&&(this.hasAttribute(`aria-invalid`)?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}get values(){return this._values.slice()}set values(e){this._values=Array.isArray(e)?e.map(String):[],n(this,this._values),this._rendered&&this._renderControl()}render(){let e=this.getAttribute(`size`),t=e===`sm`?` search-select-sm`:e===`lg`?` search-select-lg`:``;n(this,this._values),this.innerHTML=`
1
+ import{t as e}from"./elementBase-BlsR4tqa.js";import{t}from"./iconGlyphs.g-Bk8AzmSO.js";import{n}from"./formMirror-BgY7zkC3.js";import{i as r,n as i,r as a,t as o}from"./tokenCommit-BKckxgtg.js";var s=class extends e{static formAssociated=!0;_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||`Add tags`}static get observedAttributes(){return[`placeholder`,`disabled`,`size`,`max-tags`,`aria-label`,`separators`,`allow-duplicates`,`aria-invalid`]}constructor(){super(),this._values=[],this._draftText=``;try{this._internals=this.attachInternals()}catch{this._internals=null}}connectedCallback(){if(!this._rendered){if(!this._valuesInit&&!this._values.length){let e=this.getAttribute(`value`);if(e!=null&&e!==``)this._values=e.split(`,`).map(e=>e.trim()).filter(Boolean);else{let e=[...this.querySelectorAll(`:scope > wui-tag`)].map(e=>e.textContent.trim());e.length&&(this._values=e.map(String))}}this._valuesInit=!0,this._defaultCaptured||=(this._defaultValues=this._values.slice(),!0),this.render();return}this._wire()}formResetCallback(){this.values=(this._defaultValues||[]).slice(),this._draftText=``;let e=this.querySelector(`[data-input]`);e&&(e.value=``)}attributeChangedCallback(e){if(e===`aria-invalid`){this._syncInvalid();return}if(this._rendered){if(e===`separators`||e===`allow-duplicates`){this._wire();return}this.render()}}_syncInvalid(){let e=this.querySelector(`.search-select-control`);e&&(this.hasAttribute(`aria-invalid`)?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}get values(){return this._values.slice()}set values(e){this._values=Array.isArray(e)?e.map(String):[],n(this,this._values),this._rendered&&this._renderControl()}render(){let e=this.getAttribute(`size`),t=e===`sm`?` search-select-sm`:e===`lg`?` search-select-lg`:``;n(this,this._values),this.innerHTML=`
2
2
  <div class="search-select${t}">
3
3
  <div class="input search-select-control search-select-multi"${this.hasAttribute(`aria-invalid`)?` aria-invalid="true"`:``}${this.hasAttribute(`disabled`)?` aria-disabled="true"`:``}>
4
4
  <div class="ms-chips" data-chips><input type="text" class="ms-input" data-input aria-label="${l(this._accessibleName())}" placeholder="${l(this.getAttribute(`placeholder`)||`Add…`)}" autocomplete="off"${this.hasAttribute(`disabled`)?` disabled`:``}/></div>
@@ -1,4 +1,4 @@
1
- import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"./anchorOverlay-HAWsGzlr.js";import{t as i}from"./iconGlyphs.g-CUm_mfze.js";import{t as a}from"./formMirror-BgY7zkC3.js";var o=e=>String(e).padStart(2,`0`),s=(e,t)=>`${o(e)}:${o(t)}`,c=e=>{let t=/^(\d{2}):(\d{2})$/.exec(e||``);return t?{h:+t[1],m:+t[2]}:null},l=(e,t=`24`)=>{if(!e)return``;if(t===`24`)return s(e.h,e.m);let n=e.h%12||12,r=e.h>=12?`PM`:`AM`;return`${n}:${o(e.m)} ${r}`},u=e=>{let t=String(e||``).trim().toLowerCase(),n=/^(\d{1,2})(?:[:.](\d{2})|(\d{2}))?\s*(?:([ap])\.?\s*(?:m\.?)?)?$/.exec(t);if(!n)return null;let r=+n[1],i=+(n[2]??n[3]??`0`);if(i>59)return null;if(n[4]){if(r<1||r>12)return null;r=r%12+(n[4]===`p`?12:0)}else if(r>23)return null;return{h:r,m:i}},d=0,f=class extends e{static formAssociated=!0;static get observedAttributes(){return[`value`,`min`,`max`,`step`,`format`,`placeholder`,`disabled`,`required`,`size`,`aria-label`,`aria-describedby`,`aria-invalid`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``,this._uid=`wui-tp-${++d}`,this._typedError=``,this._typeahead=``,this._typeaheadTimer=null,this.addEventListener(`focusout`,e=>{this._isOpen?.()&&e.relatedTarget&&!this.contains(e.relatedTarget)&&this._close({commit:!0})})}connectedCallback(){if(!this._rendered){this.render();return}this._bindGlobal?.()}attributeChangedCallback(e,t,n){if(this._rendered)switch(e){case`value`:this._value=n||``,this._typedError=``,this._syncFormValue(),this._syncText(),this._syncInvalid();return;case`aria-invalid`:case`aria-describedby`:this._syncInvalid();return;case`aria-label`:case`placeholder`:case`disabled`:case`required`:this._syncAttrs();return;default:this.render()}}formResetCallback(){this.value=this._defaultValue||``}get value(){return this._value}set value(e){this._value=e||``,this._typedError=``,a(this,this._value),this._syncText(),this._syncInvalid()}_format(){return this.getAttribute(`format`)||`24`}_step(){return Math.max(1,parseInt(this.getAttribute(`step`)||`30`,10)||30)}_bounds(){let e=c(this.getAttribute(`min`))||{h:0,m:0},t=c(this.getAttribute(`max`))||{h:23,m:59};return{min:e.h*60+e.m,max:t.h*60+t.m}}_allowed(e,t){let n=e*60+t,{min:r,max:i}=this._bounds();return n>=r&&n<=i&&n%this._step()===0}_times(){let e=[];for(let t=0;t<1440;t+=this._step()){let n=Math.floor(t/60),r=t%60;this._allowed(n,r)&&e.push({h:n,m:r})}return e}_refusal(e){if(this._allowed(e.h,e.m))return``;let t=this._format(),{min:n,max:r}=this._bounds(),i=e.h*60+e.m,a=e=>l({h:Math.floor(e/60),m:e%60},t);if(i<n||i>r){let e=!!c(this.getAttribute(`min`)),t=!!c(this.getAttribute(`max`));return e&&t?`Enter a time between ${a(n)} and ${a(r)}.`:e?`Enter a time at or after ${a(n)}.`:`Enter a time at or before ${a(r)}.`}return`Enter a time in ${this._step()}-minute steps.`}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``,this._value=this._defaultValue||this._value),this._isOpen=null;let e=this.getAttribute(`size`),t=e===`sm`?` input-sm`:e===`lg`?` input-lg`:``,n=this._uid;this.innerHTML=`
1
+ import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"./anchorOverlay-HAWsGzlr.js";import{t as i}from"./iconGlyphs.g-Bk8AzmSO.js";import{t as a}from"./formMirror-BgY7zkC3.js";var o=e=>String(e).padStart(2,`0`),s=(e,t)=>`${o(e)}:${o(t)}`,c=e=>{let t=/^(\d{2}):(\d{2})$/.exec(e||``);return t?{h:+t[1],m:+t[2]}:null},l=(e,t=`24`)=>{if(!e)return``;if(t===`24`)return s(e.h,e.m);let n=e.h%12||12,r=e.h>=12?`PM`:`AM`;return`${n}:${o(e.m)} ${r}`},u=e=>{let t=String(e||``).trim().toLowerCase(),n=/^(\d{1,2})(?:[:.](\d{2})|(\d{2}))?\s*(?:([ap])\.?\s*(?:m\.?)?)?$/.exec(t);if(!n)return null;let r=+n[1],i=+(n[2]??n[3]??`0`);if(i>59)return null;if(n[4]){if(r<1||r>12)return null;r=r%12+(n[4]===`p`?12:0)}else if(r>23)return null;return{h:r,m:i}},d=0,f=class extends e{static formAssociated=!0;static get observedAttributes(){return[`value`,`min`,`max`,`step`,`format`,`placeholder`,`disabled`,`required`,`size`,`aria-label`,`aria-describedby`,`aria-invalid`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``,this._uid=`wui-tp-${++d}`,this._typedError=``,this._typeahead=``,this._typeaheadTimer=null,this.addEventListener(`focusout`,e=>{this._isOpen?.()&&e.relatedTarget&&!this.contains(e.relatedTarget)&&this._close({commit:!0})})}connectedCallback(){if(!this._rendered){this.render();return}this._bindGlobal?.()}attributeChangedCallback(e,t,n){if(this._rendered)switch(e){case`value`:this._value=n||``,this._typedError=``,this._syncFormValue(),this._syncText(),this._syncInvalid();return;case`aria-invalid`:case`aria-describedby`:this._syncInvalid();return;case`aria-label`:case`placeholder`:case`disabled`:case`required`:this._syncAttrs();return;default:this.render()}}formResetCallback(){this.value=this._defaultValue||``}get value(){return this._value}set value(e){this._value=e||``,this._typedError=``,a(this,this._value),this._syncText(),this._syncInvalid()}_format(){return this.getAttribute(`format`)||`24`}_step(){return Math.max(1,parseInt(this.getAttribute(`step`)||`30`,10)||30)}_bounds(){let e=c(this.getAttribute(`min`))||{h:0,m:0},t=c(this.getAttribute(`max`))||{h:23,m:59};return{min:e.h*60+e.m,max:t.h*60+t.m}}_allowed(e,t){let n=e*60+t,{min:r,max:i}=this._bounds();return n>=r&&n<=i&&n%this._step()===0}_times(){let e=[];for(let t=0;t<1440;t+=this._step()){let n=Math.floor(t/60),r=t%60;this._allowed(n,r)&&e.push({h:n,m:r})}return e}_refusal(e){if(this._allowed(e.h,e.m))return``;let t=this._format(),{min:n,max:r}=this._bounds(),i=e.h*60+e.m,a=e=>l({h:Math.floor(e/60),m:e%60},t);if(i<n||i>r){let e=!!c(this.getAttribute(`min`)),t=!!c(this.getAttribute(`max`));return e&&t?`Enter a time between ${a(n)} and ${a(r)}.`:e?`Enter a time at or after ${a(n)}.`:`Enter a time at or before ${a(r)}.`}return`Enter a time in ${this._step()}-minute steps.`}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``,this._value=this._defaultValue||this._value),this._isOpen=null;let e=this.getAttribute(`size`),t=e===`sm`?` input-sm`:e===`lg`?` input-lg`:``,n=this._uid;this.innerHTML=`
2
2
  <div class="timepicker">
3
3
  <div class="wui-timepicker-field">
4
4
  <input type="text" class="input timepicker-trigger${t}" id="${n}-input" role="combobox" aria-haspopup="dialog" aria-expanded="false" aria-controls="${n}-pop" aria-autocomplete="none" autocomplete="off" spellcheck="false">
@@ -1 +1 @@
1
- import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n}from"./anchorOverlay-HAWsGzlr.js";import{t as r}from"./tourOpenMark-nPeAJFSo.js";var i=`data-advance`,a=`wui-tour-hint`,o=`Click {actionName} to continue.`,s=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,c=(e,t)=>e?.advanceOn===`click`&&!!t,l=e=>(e??``).replace(/\s+/g,` `).trim();function u(e){let t=e.ownerDocument,n=(e.getAttribute(`aria-labelledby`)||``).split(/\s+/).filter(Boolean),r=e.tagName===`INPUT`&&/^(button|submit|reset)$/.test(e.type)?e.value:``,i=[n.map(e=>t.getElementById(e)?.textContent??``).join(` `),e.getAttribute(`aria-label`),Array.from(e.labels??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=l(e);if(t)return t}return``}function d(e){for(let t of[e,...e.querySelectorAll(s)])if(t.tabIndex>=0&&!t.disabled)return t;return null}function f(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 p(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&&f(e,i,!1);return}n||(n=e.ownerDocument.createElement(`p`),n.className=a,i&&(n.id=i),e.querySelector(`.wui-tour-actions`).before(n)),n.textContent=t,i&&f(e,i,!0)}var m=e=>getComputedStyle(e).animationName;function h(e,{layer:t,spot:n,card:r},a,s){let d=c(a,s);t.toggleAttribute(i,d&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(i)&&(n.removeAttribute(i),d&&m(n)),d&&n.setAttribute(i,``);let f=r.querySelector(`.wui-tour-next`);f.classList.toggle(`btn-primary`,!d),f.classList.toggle(`btn-link`,d);let h=d?l(a.actionLabel)||u(s):``,g=e.getAttribute(`advance-label`)||o,_=h?g.replace(/\{actionName\}/g,()=>h):``;return p(r,_),_}function g(e,t,n){if(!c(e,t))return()=>{};let r=null,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function _(e,t,n,r){return e.contains(r)||c(t,n)&&n.contains(r)}function ee(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=c(r,i)?d(i):null;o&&a.push(o);let s=a.findIndex(e=>e===n||e===o&&i.contains(n));e.preventDefault(),a[s===-1?e.shiftKey?a.length-1:0:(s+(e.shiftKey?-1:1)+a.length)%a.length].focus()}var te=2/3,ne=1e3,v=new Set([`top`,`left`,`width`,`height`]),y=new WeakMap,b=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],x=e=>e.transitionProperty===`opacity`,re=e=>v.has(e.transitionProperty),S=e=>typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function C(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,ne);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function ie(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*te-r)}return n}function w(e){let t=ie(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={};y.set(e,n);let r=()=>{y.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=b(e,S);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function T(e){return e.dataset.state=`leaving`,C(b(e,x))}function ae(e){let t=e.classList.contains(`wui-tour-layer`)?e:e.shadowRoot?.querySelector(`.wui-tour-layer`);t&&(t.dataset.state=`leaving`);let n=t?C(b(t,x)):null;if(!n){e.remove();return}e.setAttribute(`inert`,``),n.then(()=>e.remove())}var E=2,D=12,O=8,k=4,A=20,oe=`(max-width: 575.98px)`,se=[`bottom`,`top`,`right`,`left`],j=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],M,N=(e,t,n)=>Math.max(t,Math.min(e,n)),P=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function ce(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=z(e),r=e.offsetHeight+D;if(t.getBoundingClientRect().height+E*2+r*2<=n.bottom-n.top){t.scrollIntoView({block:`center`,inline:`nearest`});return}let i=t.style.scrollMarginTop;t.style.scrollMarginTop=`${n.top+r+E}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function F(e,t,n){let r=e.style,i=t.style,a=B(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 j)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,a.hidden=!0,i.position=`fixed`,i.top=`50%`,i.left=`50%`,i.transform=`translate(-50%, -50%)`,i.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,i.transform=``,i.position=`fixed`;let o=n.getBoundingClientRect();r.top=`${o.top}px`,r.left=`${o.left}px`,r.width=`${o.width}px`,r.height=`${o.height}px`,le(r,n);let s=t.scrollTop;i.maxHeight=``;let c={width:t.offsetWidth,height:t.offsetHeight},l=z(t),u=l.bottom-l.top,d={bottom:l.bottom-o.bottom-D,top:o.top-D-l.top,right:l.right-o.right-D,left:o.left-D-l.left},f=window.matchMedia(oe).matches,p=se.find(e=>e===`top`||e===`bottom`?c.height<=d[e]+1:!f&&c.width<=d[e]+1&&c.height<=u+1),m=Math.min(o.bottom,l.bottom+O)-Math.max(o.top,l.top-O);p?I(t,a,p,o,l,c):m>=Math.min(c.height,u)+k*2?L(t,a,o,l,c):R(t,a,d.bottom>=d.top?`bottom`:`top`,o,l,c,d),t.scrollTop=s}function le(e,t){M??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of j)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),M&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function I(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=P(r.left,r.right,i.left,i.right);s=N(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+D:r.top-D-a.height,l=N(e-s,A,a.width-A)}else{let e=P(r.top,r.bottom,i.top,i.bottom);c=N(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+D:r.left-D-a.width,l=N(e-c,A,a.height-A)}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 L(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)-k;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${N(n.left+k,r.left,r.right-i.width)}px`}function R(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+D:r.top-D-c}px`;let l=P(r.left,r.right,i.left,i.right);e.style.left=`${N(l-a.width/2,i.left,i.right-a.width)}px`}function z(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e])||0;return{top:r(`paddingTop`)+O,bottom:window.innerHeight-r(`paddingBottom`)-O,left:r(`paddingLeft`)+O,right:window.innerWidth-r(`paddingRight`)-O}}function B(e){let t=e.querySelector(`:scope > .wui-tour-arrow`);return t||(t=document.createElement(`span`),t.className=`wui-tour-arrow`,t.setAttribute(`aria-hidden`,`true`),t.hidden=!0,e.append(t)),t}var V=0;function H(e,t,n){let r=`wui-tour-end-${++V}`,i=e.createElement(`div`);return i.className=`wui-tour-card wui-tour-end`,i.dataset.layout=`center`,i.setAttribute(`role`,`dialog`),n&&i.setAttribute(`aria-modal`,`true`),i.tabIndex=-1,i.setAttribute(`aria-labelledby`,`${r}-title`),i.setAttribute(`aria-describedby`,`${r}-message`),i.innerHTML=` <div class="wui-tour-end-mark" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></div> <h2 class="wui-tour-title wui-tour-end-title" id="${r}-title"></h2> <p class="wui-tour-text wui-tour-end-message" id="${r}-message"></p> <div class="wui-tour-actions"><button type="button" class="btn btn-sm btn-primary wui-tour-end-button"></button></div>`,i.querySelector(`.wui-tour-end-title`).textContent=t.title,i.querySelector(`.wui-tour-end-message`).textContent=t.message,i.querySelector(`.wui-tour-end-button`).textContent=t.button,i}function U(e,t,n){let r=e.ownerDocument,i=e.getRootNode()===r,a=e.querySelector(`.wui-tour-card:not(.wui-tour-end)`),o=e.querySelector(`.wui-tour-spot`),s=e.querySelector(`[role=status]`),c=H(r,t,i),l=c.querySelector(`.wui-tour-end-button`),u=new AbortController;return new Promise(d=>{let f=()=>{u.abort(),d()};if(n?.aborted){f();return}let p={signal:u.signal};n?.addEventListener(`abort`,f,p),l.addEventListener(`click`,f,p),r.addEventListener(`keydown`,e=>{e.altKey||e.ctrlKey||e.metaKey||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),f()):e.key===`Tab`&&i&&(e.preventDefault(),l.focus()))},{capture:!0,signal:u.signal}),i&&r.addEventListener(`focusin`,e=>{c.contains(e.target)||l.focus()},p);let m=()=>{u.signal.aborted||(a.hidden=!0,F(o,a,null),e.append(c),w(c),s.textContent=[t.title,t.message].filter(Boolean).join(`. `),l.focus())},h=T(a);h?h.then(m):m()})}var W=` :host { all: initial; ${Object.entries({"--wui-z-tour":`1550`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-overlay":`0 8px 28px -6px rgba(7, 20, 55, 0.14)`,"--wui-ease-out-quart":`cubic-bezier(0.22, 1, 0.36, 1)`,"--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-ink":`#4F46E5`,"--color-focus-ring":`#4F46E5`,"--wui-focus-ring-width":`2px`,"--wui-focus-ring-offset":`2px`,"--color-primary-text":`#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-primary-text); } .btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); } .btn-outline-secondary { border-color: var(--color-text-muted); color: var(--color-text-muted); } .btn-outline-secondary:hover { background: var(--color-bg-muted); color: var(--color-text); } .btn-link { font-weight: 400; color: var(--color-primary-ink); 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); } .wui-tour-spot { position: fixed; box-shadow: 0 0 0 2px var(--color-primary), 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-overlay); } .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 120ms linear; } .wui-tour-layer[data-state=leaving] { transition: opacity 120ms linear; } .wui-tour-card[data-state=entering] { animation: wui-tour-fade-in 120ms 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-media=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: 2px; } .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); } @keyframes wui-tour-pulse { from { box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 85%, transparent); } to { box-shadow: 0 0 0 14px color-mix(in srgb, var(--color-primary) 0%, transparent); } } @media (prefers-reduced-motion: no-preference) { .wui-tour-spot[data-advance]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; corner-shape: inherit; pointer-events: none; animation: wui-tour-pulse 600ms var(--wui-ease-out-quart) var(--wui-tour-spot-duration); } } @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-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-button { min-width: 120px; } @media (prefers-reduced-motion: no-preference) { .wui-tour-end-mark path { animation: wui-tour-check 300ms var(--wui-ease-out-quart) calc(var(--wui-tour-card-delay, 0ms) + 120ms) both; } } `,G=`wui-tour-media`,ue=`wui-tour-media-toggle`,K=`http://www.w3.org/2000/svg`,de=`M6 5h4v14H6zM14 5h4v14h-4z`,fe=`M8 5v14l11-7z`,pe={pause:`Pause animation`,play:`Play animation`},me=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function he(e){let t=document.createElementNS(K,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(K,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function ge(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 _e(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 ve(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=ue;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(he(r?de:fe))};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 ye(e){let t=e.querySelector(`:scope > .${G}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function be(e,t,n=pe){if(ye(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=G,t.mediaType===`video`){let e=_e(t,!me());r.append(e,ve(e,n))}else r.appendChild(ge(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var xe=`Step {current} of {total}`;function Se(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 Ce(e,t,n){return(e.getAttribute(`progress-label`)||xe).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function we(e,{text:t,position:n,total:r}){let i=e.querySelector(`.wui-tour-position`);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;)a.lastElementChild.remove();for(let e=0;e<o.length;e++)o[e].toggleAttribute(`data-filled`,e<n)}var Te=`wui-tour-step`,Ee=`wui-tour-host`,De=`wui-tour-seen:`,q=`data-tracking`,Oe={back:`Back`,next:`Next`,skip:`Skip`,done:`Done`,mediaPause:`Pause animation`,mediaPlay:`Play animation`,endTitle:`You're all set`,endMessage:`You know your way around now. Enjoy exploring.`,endButton:`Done`},ke={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`},Ae=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],J={index:null,position:null,total:null},je=0;function Y(e=De,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var X=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Z=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Q=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function Me(e){if(`adoptedStyleSheets`in e&&typeof CSSStyleSheet==`function`&&`replaceSync`in CSSStyleSheet.prototype){$||($=new CSSStyleSheet,$.replaceSync(W)),e.adoptedStyleSheets=[$];return}let t=document.createElement(`style`);t.textContent=W,e.appendChild(t)}var Ne=class extends e{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 > ${Te}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:e.textContent.trim()};for(let[n,r]of Ae)e.hasAttribute(r)&&(t[n]=e.getAttribute(r));return t})}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?Y():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(ke[e])||Oe[e]}_endDialogText(){return this.getAttribute(`end-dialog`)===`false`?null:{title:this._label(`endTitle`),message:this._label(`endMessage`),button:this._label(`endButton`)}}_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=Se(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);if(e===this._run){if(!n){this._finish(`noTargets`);return}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))}}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(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target);if(X(t))return this._progress.position(i),{index:i,target:t};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-${++je}`,n=document.createElement(`div`);n.className=`wui-tour-layer`,n.innerHTML=` <div class="wui-tour-spot" aria-hidden="true"></div> <div class="wui-tour-card" role="dialog" aria-modal="true" tabindex="-1" aria-labelledby="${e}-title" aria-describedby="${e}-text"> <p class="wui-tour-position"></p> <h2 class="wui-tour-title" id="${e}-title"></h2> <p class="wui-tour-text" id="${e}-text"></p> <div class="wui-tour-actions"> <button type="button" class="btn btn-sm btn-link wui-tour-skip"></button> <div class="wui-tour-nav"> <button type="button" class="btn btn-sm btn-outline-secondary wui-tour-back"></button> <button type="button" class="btn btn-sm btn-primary wui-tour-next"></button> </div> </div> </div> <div class="visually-hidden" role="status" aria-live="polite"></div>`;let i=n;this._shadow=null,this.isolated&&(i=document.createElement(Ee),this._shadow=i.attachShadow({mode:`open`}),Me(this._shadow),this._shadow.appendChild(n)),document.body.appendChild(i),document.documentElement.setAttribute(r,``),this._outer=i,this._layer=n,this._spot=n.querySelector(`.wui-tour-spot`),this._card=n.querySelector(`.wui-tour-card`),this._live=n.querySelector(`[role=status]`),this._card.querySelector(`.wui-tour-skip`).addEventListener(`click`,()=>this._close(`skipped`,`button`)),this._card.querySelector(`.wui-tour-back`).addEventListener(`click`,()=>this._move(-1)),this._card.querySelector(`.wui-tour-next`).addEventListener(`click`,()=>this._move(1)),this._shadow&&this._card.removeAttribute(`aria-modal`),this._onKey=e=>this._key(e),this._onFocusIn=e=>{if(!this._layer||this._ending)return;let t=this._current,n=t?this._steps[t.index]:null;_(this._layer,n,t?.target??null,e.target)||this._card.focus()},document.addEventListener(`keydown`,this._onKey,!0),this._shadow||document.addEventListener(`focusin`,this._onFocusIn),t(i,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_show(e){this._current=e;let{index:t,target:n}=e,r=this._steps[t],i=this._card,a=this._progress.position(t),o=this._progress.total(),s=a===o&&!this._endDialogText(),c=Ce(this,a,o);we(i,{text:c,position:a,total:o}),be(i,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)});let l=h(this,{layer:this._layer,spot:this._spot,card:i},r,n),u=i.querySelector(`.wui-tour-title`);u.textContent=r.title||``,u.hidden=!r.title,i.querySelector(`.wui-tour-text`).textContent=r.description||``,i.querySelector(`.wui-tour-skip`).textContent=this._label(`skip`),i.querySelector(`.wui-tour-back`).textContent=this._label(`back`),i.querySelector(`.wui-tour-back`).hidden=t<=this._firstIndex,i.querySelector(`.wui-tour-next`).textContent=this._label(s?`done`:`next`);let d=[c,r.title,r.description].filter(Boolean).join(`. `);this._live.textContent=l?[d,l].join(/[.!?]$/.test(d)?` `:`. `):d,ce(i,n),this._spot.removeAttribute(q),this._place(),w(i),this._unbindAdvance?.(),this._unbindAdvance=g(r,n,()=>this._move(1));let f=this._active();(i.contains(f)?!f.hidden:this._shadow!==null&&Z(Q()))||i.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t,position:a,total:o}}))}_place(){!this._current||!this._layer||F(this._spot,this._card,this._current.target)}_follow(){if(!this._current||!this._layer||this._ending)return;let e=this._spot.style.cssText;this._place(),this._spot.style.cssText!==e&&this._spot.setAttribute(q,``)}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=T(this._card);if(e&&await e,n!==this._run)return;this._show(r)}else if(t>0){let e=this._endDialogText();if(e&&await this._showEnd(e),n!==this._run)return;await this._close(`finished`)}}finally{this._moving=!1}}_showEnd(e){return this._unbindAdvance?.(),this._unbindAdvance=null,h(this,{layer:this._layer,spot:this._spot,card:this._card},null,null),this._spot.removeAttribute(q),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),U(this._layer,e,this._ending.signal)}_key(e){if(!(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(e.key===`ArrowRight`||e.key===`ArrowLeft`){if(Z(e.composedPath?.()[0]??e.target))return;e.preventDefault(),e.key===`ArrowRight`?this._move(1):this._current.index>this._firstIndex&&this._move(-1)}else if(e.key===`Tab`&&!this._shadow){let{index:t,target:n}=this._current;ee(e,{card:this._card,active:this._active(),step:this._steps[t],target:n})}}}_teardown(){if(!this._layer)return;document.removeEventListener(`keydown`,this._onKey,!0),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,n(this._outer),ae(this._outer),document.documentElement.removeAttribute(r),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let t=this._returnFocus;this._returnFocus=null,e&&t?.isConnected&&t.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()}:J,a=this._seenMark;this._teardown();try{n===this._run&&await(a??this._markSeen(e))}finally{this._finish(e,i,t)}}_finish(e,t=J,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}}))}};export{Y as n,Ne as t};
1
+ import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n}from"./anchorOverlay-HAWsGzlr.js";import{t as r}from"./tourOpenMark-nPeAJFSo.js";var i=`data-advance`,a=`wui-tour-hint`,o=`Click {actionName} to continue.`,s=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,c=(e,t)=>e?.advanceOn===`click`&&!!t,l=e=>(e??``).replace(/\s+/g,` `).trim();function u(e){let t=e.ownerDocument,n=(e.getAttribute(`aria-labelledby`)||``).split(/\s+/).filter(Boolean),r=e.tagName===`INPUT`&&/^(button|submit|reset)$/.test(e.type)?e.value:``,i=[n.map(e=>t.getElementById(e)?.textContent??``).join(` `),e.getAttribute(`aria-label`),Array.from(e.labels??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=l(e);if(t)return t}return``}function d(e){for(let t of[e,...e.querySelectorAll(s)])if(t.tabIndex>=0&&!t.disabled)return t;return null}function f(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 p(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&&f(e,i,!1);return}n||(n=e.ownerDocument.createElement(`p`),n.className=a,i&&(n.id=i),e.querySelector(`.wui-tour-actions`).before(n)),n.textContent=t,i&&f(e,i,!0)}var m=e=>getComputedStyle(e).animationName;function h(e,{layer:t,spot:n,card:r},a,s){let d=c(a,s);t.toggleAttribute(i,d&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(i)&&(n.removeAttribute(i),d&&m(n)),d&&n.setAttribute(i,``);let f=r.querySelector(`.wui-tour-next`);f.classList.toggle(`btn-primary`,!d),f.classList.toggle(`btn-link`,d);let h=d?l(a.actionLabel)||u(s):``,g=e.getAttribute(`advance-label`)||o,_=h?g.replace(/\{actionName\}/g,()=>h):``;return p(r,_),_}function g(e,t,n){if(!c(e,t))return()=>{};let r=null,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function _(e,t,n,r){return e.contains(r)||c(t,n)&&n.contains(r)}function ee(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=c(r,i)?d(i):null;o&&a.push(o);let s=a.findIndex(e=>e===n||e===o&&i.contains(n));e.preventDefault(),a[s===-1?e.shiftKey?a.length-1:0:(s+(e.shiftKey?-1:1)+a.length)%a.length].focus()}var te=2/3,ne=1e3,re=new Set([`top`,`left`,`width`,`height`]),v=new WeakMap,y=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],b=e=>e.transitionProperty===`opacity`,ie=e=>re.has(e.transitionProperty),x=e=>typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function S(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,ne);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function ae(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?y(t,ie):[]){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*te-r)}return n}function C(e){let t=ae(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={};v.set(e,n);let r=()=>{v.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=y(e,x);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function w(e){return e.dataset.state=`leaving`,S(y(e,b))}function oe(e){let t=e.classList.contains(`wui-tour-layer`)?e:e.shadowRoot?.querySelector(`.wui-tour-layer`);t&&(t.dataset.state=`leaving`);let n=t?S(y(t,b)):null;if(!n){e.remove();return}e.setAttribute(`inert`,``),n.then(()=>e.remove())}var T=2,E=12,D=8,O=4,k=20,se=`(max-width: 575.98px)`,ce=[`bottom`,`top`,`right`,`left`],A=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],j,M=(e,t,n)=>Math.max(t,Math.min(e,n)),N=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function le(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=z(e),r=e.offsetHeight+E;if(t.getBoundingClientRect().height+T*2+r*2<=n.bottom-n.top){t.scrollIntoView({block:`center`,inline:`nearest`});return}let i=t.style.scrollMarginTop;t.style.scrollMarginTop=`${n.top+r+T}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function P(e,t,n){let r=e.style,i=t.style,a=B(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 A)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,a.hidden=!0,i.position=`fixed`,i.top=`50%`,i.left=`50%`,i.transform=`translate(-50%, -50%)`,i.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,i.transform=``,i.position=`fixed`;let o=n.getBoundingClientRect();r.top=`${o.top}px`,r.left=`${o.left}px`,r.width=`${o.width}px`,r.height=`${o.height}px`,F(r,n);let s=t.scrollTop;i.maxHeight=``;let c={width:t.offsetWidth,height:t.offsetHeight},l=z(t),u=l.bottom-l.top,d={bottom:l.bottom-o.bottom-E,top:o.top-E-l.top,right:l.right-o.right-E,left:o.left-E-l.left},f=window.matchMedia(se).matches,p=ce.find(e=>e===`top`||e===`bottom`?c.height<=d[e]+1:!f&&c.width<=d[e]+1&&c.height<=u+1),m=Math.min(o.bottom,l.bottom+D)-Math.max(o.top,l.top-D);p?I(t,a,p,o,l,c):m>=Math.min(c.height,u)+O*2?L(t,a,o,l,c):R(t,a,d.bottom>=d.top?`bottom`:`top`,o,l,c,d),t.scrollTop=s}function F(e,t){j??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of A)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),j&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function I(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=N(r.left,r.right,i.left,i.right);s=M(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+E:r.top-E-a.height,l=M(e-s,k,a.width-k)}else{let e=N(r.top,r.bottom,i.top,i.bottom);c=M(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+E:r.left-E-a.width,l=M(e-c,k,a.height-k)}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 L(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)-O;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${M(n.left+O,r.left,r.right-i.width)}px`}function R(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+E:r.top-E-c}px`;let l=N(r.left,r.right,i.left,i.right);e.style.left=`${M(l-a.width/2,i.left,i.right-a.width)}px`}function z(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e])||0;return{top:r(`paddingTop`)+D,bottom:window.innerHeight-r(`paddingBottom`)-D,left:r(`paddingLeft`)+D,right:window.innerWidth-r(`paddingRight`)-D}}function B(e){let t=e.querySelector(`:scope > .wui-tour-arrow`);return t||(t=document.createElement(`span`),t.className=`wui-tour-arrow`,t.setAttribute(`aria-hidden`,`true`),t.hidden=!0,e.append(t)),t}var V=0;function H(e,t,n){let r=`wui-tour-end-${++V}`,i=e.createElement(`div`);return i.className=`wui-tour-card wui-tour-end`,i.dataset.layout=`center`,i.setAttribute(`role`,`dialog`),n&&i.setAttribute(`aria-modal`,`true`),i.tabIndex=-1,i.setAttribute(`aria-labelledby`,`${r}-title`),i.setAttribute(`aria-describedby`,`${r}-message`),i.innerHTML=` <div class="wui-tour-end-mark" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></div> <h2 class="wui-tour-title wui-tour-end-title" id="${r}-title"></h2> <p class="wui-tour-text wui-tour-end-message" id="${r}-message"></p> <div class="wui-tour-actions"><button type="button" class="btn btn-sm btn-primary wui-tour-end-button"></button></div>`,i.querySelector(`.wui-tour-end-title`).textContent=t.title,i.querySelector(`.wui-tour-end-message`).textContent=t.message,i.querySelector(`.wui-tour-end-button`).textContent=t.button,i}function U(e,t,n){let r=e.ownerDocument,i=e.getRootNode()===r,a=e.querySelector(`.wui-tour-card:not(.wui-tour-end)`),o=e.querySelector(`.wui-tour-spot`),s=e.querySelector(`[role=status]`),c=H(r,t,i),l=c.querySelector(`.wui-tour-end-button`),u=new AbortController;return new Promise(d=>{let f=()=>{u.abort(),d()};if(n?.aborted){f();return}let p={signal:u.signal};n?.addEventListener(`abort`,f,p),l.addEventListener(`click`,f,p),r.addEventListener(`keydown`,e=>{e.altKey||e.ctrlKey||e.metaKey||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),f()):e.key===`Tab`&&i&&(e.preventDefault(),l.focus()))},{capture:!0,signal:u.signal}),i&&r.addEventListener(`focusin`,e=>{c.contains(e.target)||l.focus()},p);let m=()=>{u.signal.aborted||(a.hidden=!0,P(o,a,null),e.append(c),C(c),s.textContent=[t.title,t.message].filter(Boolean).join(`. `),l.focus())},h=w(a);h?h.then(m):m()})}var W=` :host { all: initial; ${Object.entries({"--wui-z-tour":`1550`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-overlay":`0 8px 28px -6px rgba(7, 20, 55, 0.14)`,"--wui-ease-out-quart":`cubic-bezier(0.22, 1, 0.36, 1)`,"--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-ink":`#4F46E5`,"--color-focus-ring":`#4F46E5`,"--wui-focus-ring-width":`2px`,"--wui-focus-ring-offset":`2px`,"--color-primary-text":`#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-primary-text); } .btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); } .btn-outline-secondary { border-color: var(--color-text-muted); color: var(--color-text-muted); } .btn-outline-secondary:hover { background: var(--color-bg-muted); color: var(--color-text); } .btn-link { font-weight: 400; color: var(--color-primary-ink); 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); } .wui-tour-spot { position: fixed; box-shadow: 0 0 0 2px var(--color-primary), 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-overlay); } .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 120ms linear; } .wui-tour-layer[data-state=leaving] { transition: opacity 120ms linear; } .wui-tour-card[data-state=entering] { animation: wui-tour-fade-in 120ms 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-media=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: 2px; } .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); } @keyframes wui-tour-pulse { from { box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 85%, transparent); } to { box-shadow: 0 0 0 14px color-mix(in srgb, var(--color-primary) 0%, transparent); } } @media (prefers-reduced-motion: no-preference) { .wui-tour-spot[data-advance]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; corner-shape: inherit; pointer-events: none; animation: wui-tour-pulse 600ms var(--wui-ease-out-quart) var(--wui-tour-spot-duration); } } @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-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-button { min-width: 120px; } @media (prefers-reduced-motion: no-preference) { .wui-tour-end-mark path { animation: wui-tour-check 300ms var(--wui-ease-out-quart) calc(var(--wui-tour-card-delay, 0ms) + 120ms) both; } } `,G=`wui-tour-media`,ue=`wui-tour-media-toggle`,K=`http://www.w3.org/2000/svg`,de=`M6 5h4v14H6zM14 5h4v14h-4z`,fe=`M8 5v14l11-7z`,pe={pause:`Pause animation`,play:`Play animation`},me=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function he(e){let t=document.createElementNS(K,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(K,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function ge(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 _e(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 ve(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=ue;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(he(r?de:fe))};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 ye(e){let t=e.querySelector(`:scope > .${G}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function be(e,t,n=pe){if(ye(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=G,t.mediaType===`video`){let e=_e(t,!me());r.append(e,ve(e,n))}else r.appendChild(ge(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var xe=`Step {current} of {total}`;function Se(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 Ce(e,t,n){return(e.getAttribute(`progress-label`)||xe).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function we(e,{text:t,position:n,total:r}){let i=e.querySelector(`.wui-tour-position`);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;)a.lastElementChild.remove();for(let e=0;e<o.length;e++)o[e].toggleAttribute(`data-filled`,e<n)}var Te=`wui-tour-step`,Ee=`wui-tour-host`,De=`wui-tour-seen:`,q=`data-tracking`,Oe={back:`Back`,next:`Next`,skip:`Skip`,done:`Done`,mediaPause:`Pause animation`,mediaPlay:`Play animation`,endTitle:`You're all set`,endMessage:`You know your way around now. Enjoy exploring.`,endButton:`Done`},ke={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`},Ae=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],J={index:null,position:null,total:null},je=0;function Y(e=De,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var X=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Z=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Q=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function Me(e){$||($=new CSSStyleSheet,$.replaceSync(W)),e.adoptedStyleSheets=[$]}var Ne=class extends e{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 > ${Te}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:e.textContent.trim()};for(let[n,r]of Ae)e.hasAttribute(r)&&(t[n]=e.getAttribute(r));return t})}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?Y():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(ke[e])||Oe[e]}_endDialogText(){return this.getAttribute(`end-dialog`)===`false`?null:{title:this._label(`endTitle`),message:this._label(`endMessage`),button:this._label(`endButton`)}}_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=Se(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);if(e===this._run){if(!n){this._finish(`noTargets`);return}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))}}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(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target);if(X(t))return this._progress.position(i),{index:i,target:t};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-${++je}`,n=document.createElement(`div`);n.className=`wui-tour-layer`,n.innerHTML=` <div class="wui-tour-spot" aria-hidden="true"></div> <div class="wui-tour-card" role="dialog" aria-modal="true" tabindex="-1" aria-labelledby="${e}-title" aria-describedby="${e}-text"> <p class="wui-tour-position"></p> <h2 class="wui-tour-title" id="${e}-title"></h2> <p class="wui-tour-text" id="${e}-text"></p> <div class="wui-tour-actions"> <button type="button" class="btn btn-sm btn-link wui-tour-skip"></button> <div class="wui-tour-nav"> <button type="button" class="btn btn-sm btn-outline-secondary wui-tour-back"></button> <button type="button" class="btn btn-sm btn-primary wui-tour-next"></button> </div> </div> </div> <div class="visually-hidden" role="status" aria-live="polite"></div>`;let i=n;this._shadow=null,this.isolated&&(i=document.createElement(Ee),this._shadow=i.attachShadow({mode:`open`}),Me(this._shadow),this._shadow.appendChild(n)),document.body.appendChild(i),document.documentElement.setAttribute(r,``),this._outer=i,this._layer=n,this._spot=n.querySelector(`.wui-tour-spot`),this._card=n.querySelector(`.wui-tour-card`),this._live=n.querySelector(`[role=status]`),this._card.querySelector(`.wui-tour-skip`).addEventListener(`click`,()=>this._close(`skipped`,`button`)),this._card.querySelector(`.wui-tour-back`).addEventListener(`click`,()=>this._move(-1)),this._card.querySelector(`.wui-tour-next`).addEventListener(`click`,()=>this._move(1)),this._shadow&&this._card.removeAttribute(`aria-modal`),this._onKey=e=>this._key(e),this._onFocusIn=e=>{if(!this._layer||this._ending)return;let t=this._current,n=t?this._steps[t.index]:null;_(this._layer,n,t?.target??null,e.target)||this._card.focus()},document.addEventListener(`keydown`,this._onKey,!0),this._shadow||document.addEventListener(`focusin`,this._onFocusIn),t(i,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_show(e){this._current=e;let{index:t,target:n}=e,r=this._steps[t],i=this._card,a=this._progress.position(t),o=this._progress.total(),s=a===o&&!this._endDialogText(),c=Ce(this,a,o);we(i,{text:c,position:a,total:o}),be(i,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)});let l=h(this,{layer:this._layer,spot:this._spot,card:i},r,n),u=i.querySelector(`.wui-tour-title`);u.textContent=r.title||``,u.hidden=!r.title,i.querySelector(`.wui-tour-text`).textContent=r.description||``,i.querySelector(`.wui-tour-skip`).textContent=this._label(`skip`),i.querySelector(`.wui-tour-back`).textContent=this._label(`back`),i.querySelector(`.wui-tour-back`).hidden=t<=this._firstIndex,i.querySelector(`.wui-tour-next`).textContent=this._label(s?`done`:`next`);let d=[c,r.title,r.description].filter(Boolean).join(`. `);this._live.textContent=l?[d,l].join(/[.!?]$/.test(d)?` `:`. `):d,le(i,n),this._spot.removeAttribute(q),this._place(),C(i),this._unbindAdvance?.(),this._unbindAdvance=g(r,n,()=>this._move(1));let f=this._active();(i.contains(f)?!f.hidden:this._shadow!==null&&Z(Q()))||i.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t,position:a,total:o}}))}_place(){!this._current||!this._layer||P(this._spot,this._card,this._current.target)}_follow(){if(!this._current||!this._layer||this._ending)return;let e=this._spot.style.cssText;this._place(),this._spot.style.cssText!==e&&this._spot.setAttribute(q,``)}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=w(this._card);if(e&&await e,n!==this._run)return;this._show(r)}else if(t>0){let e=this._endDialogText();if(e&&await this._showEnd(e),n!==this._run)return;await this._close(`finished`)}}finally{this._moving=!1}}_showEnd(e){return this._unbindAdvance?.(),this._unbindAdvance=null,h(this,{layer:this._layer,spot:this._spot,card:this._card},null,null),this._spot.removeAttribute(q),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),U(this._layer,e,this._ending.signal)}_key(e){if(!(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(e.key===`ArrowRight`||e.key===`ArrowLeft`){if(Z(e.composedPath?.()[0]??e.target))return;e.preventDefault(),e.key===`ArrowRight`?this._move(1):this._current.index>this._firstIndex&&this._move(-1)}else if(e.key===`Tab`&&!this._shadow){let{index:t,target:n}=this._current;ee(e,{card:this._card,active:this._active(),step:this._steps[t],target:n})}}}_teardown(){if(!this._layer)return;document.removeEventListener(`keydown`,this._onKey,!0),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,n(this._outer),oe(this._outer),document.documentElement.removeAttribute(r),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let t=this._returnFocus;this._returnFocus=null,e&&t?.isConnected&&t.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()}:J,a=this._seenMark;this._teardown();try{n===this._run&&await(a??this._markSeen(e))}finally{this._finish(e,i,t)}}_finish(e,t=J,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}}))}};export{Y as n,Ne as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./elementBase-BlsR4tqa.js";import{t}from"./devWarn-DXdRWZs3.js";import{t as n}from"./iconGlyphs.g-Bk8AzmSO.js";import{c as r}from"./wuiHttp-27mq9Jpn.js";import{n as i,t as a}from"./formMirror-BgY7zkC3.js";import{t as o}from"./listboxKeyNav-DMIvs9d6.js";var s=[`none`,`single`,`multiple`],c=`parentId`,l=`Loading`,u=`Could not load. Try again.`,d=`:scope > input[data-wui-mirror]`,f=[`nodes`,`selection`,`selected`,`values`,`loadChildren`,`loadUrl`,`name`],p=0;function m(e,t,n){let r=document.createElement(e);t&&(r.className=t);for(let[e,t]of Object.entries(n??{}))t!=null&&r.setAttribute(e,String(t));return r}var h=class extends e{static get observedAttributes(){return[`selection`,`selected`,`name`,`aria-label`,`loading-text`,`error-text`]}constructor(){super(),this._uid=`wui-tree-${++p}`,this._seq=0,this._roots=[],this._byId=new Map,this._prev=null,this._staged=null,this._els=new Map,this._checked=new Set,this._selected=null,this._focusId=null,this._loader=null,this._list=null,this._live=null,this._ready=!1,this._nav=o({getVisibleOptions:()=>this._visible().map(e=>this._els.get(e.id)?.row),getActive:()=>this._visible().findIndex(e=>e.id===this._focusId),setActive:e=>this._focusNode(this._visible()[e]),onEnter:()=>{let e=this._byId.get(this._focusId);e&&this._activate(e)}}),this._onKeyDown=e=>this._handleKeyDown(e),this._onClick=e=>this._handleClick(e),this._onFocusIn=e=>{let t=this._nodeFrom(e.target);t&&t.id!==this._focusId&&this._setRoving(t)}}connectedCallback(){let e={};for(let t of f)Object.hasOwn(this,t)&&(e[t]=this[t],delete this[t]);if(!this._ready){this._ready=!0;let e=this._readScript();this.replaceChildren(),this._list=m(`ul`,`wui-tree`),this._list.setAttribute(`role`,`tree`),this._live=m(`div`,`visually-hidden`,{role:`status`,"aria-live":`polite`}),this.append(this._list,this._live),e&&this._adoptAll(e)}for(let[t,n]of Object.entries(e))this[t]=n;this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`click`,this._onClick),this.addEventListener(`focusin`,this._onFocusIn),this._render(),this._loadOpenNodes()}disconnectedCallback(){this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`focusin`,this._onFocusIn),this._nav.teardown()}attributeChangedCallback(e,t,n){e===`selected`&&(this._selected=n),this._ready&&this.isConnected&&this._render()}get nodes(){return this._roots.map(e=>e.raw)}set nodes(e){this._adoptAll(e??[]),this._render(),this._loadOpenNodes()}get selection(){let e=this.getAttribute(`selection`);return s.includes(e)?e:`none`}set selection(e){this.setAttribute(`selection`,String(e))}get selected(){return this._selected}set selected(e){this._selected=e==null?null:String(e),this._render()}get values(){let e=[],t=n=>{for(let r of n)this._state(r)===`checked`&&e.push(r.id),r.children&&t(r.children)};return t(this._roots),[...e,...[...this._checked].filter(e=>!this._byId.has(e))]}set values(e){this._checked.clear();for(let t of e??[]){let e=this._byId.get(String(t));e?this._setChecked(e,!0):this._checked.add(String(t))}this._render()}get loadChildren(){return this._loader}set loadChildren(e){this._loader=typeof e==`function`?e:null}get loadUrl(){return this.getAttribute(`load-url`)}set loadUrl(e){e==null?this.removeAttribute(`load-url`):this.setAttribute(`load-url`,String(e))}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,String(e))}get loadingText(){return this.getAttribute(`loading-text`)??l}set loadingText(e){this.setAttribute(`loading-text`,String(e??``))}get errorText(){return this.getAttribute(`error-text`)??u}set errorText(e){this.setAttribute(`error-text`,String(e??``))}_readScript(){let e=this.querySelector(`:scope > script[type='application/json']`);if(!e)return null;try{return JSON.parse(e.textContent)}catch(e){return t(`[@webority/ui-elements] <wui-tree> could not read its JSON nodes:`,e?.message),null}}_adoptAll(e){let t=this._byId;this._prev=t,this._byId=new Map;let n;try{n=this._adoptStaged(e,null,1)}catch(e){throw this._byId=t,e}finally{this._prev=null}this._roots=n;for(let e of t.keys())this._byId.has(e)||this._checked.delete(e);for(let e of this._roots)this._passChecksDown(e);this._focusId&&!this._byId.has(this._focusId)&&(this._focusId=null)}_adoptStaged(e,t,n){let r=[],i=[];this._staged={ids:r,checks:i};try{let r=this._adopt(e,t,n);for(let e of i)this._checked.add(e);return r}catch(e){for(let e of r)this._byId.delete(e);throw e}finally{this._staged=null}}_adopt(e,t,n){if(!Array.isArray(e))throw Error(`<wui-tree> nodes must be an array.`);return e.map(e=>{let r=e?.id==null?``:String(e.id);if(!r)throw Error(`<wui-tree> every node needs an id.`);if(this._byId.has(r))throw Error(`<wui-tree> node id "${r}" is used twice.`);let i=this._prev?.get(r),a={id:r,raw:e,parent:t,level:n,seq:++this._seq,label:e.label==null?r:String(e.label),icon:e.icon||null,badge:e.badge==null||e.badge===``?null:String(e.badge),badgeTone:e.badgeTone||null,disabled:!!e.disabled,hasChildren:!!e.hasChildren,children:null,expanded:i?i.expanded:!!e.expanded,loading:!1,failed:!1};this._byId.set(r,a),this._staged.ids.push(r);let o=e.children??(e.hasChildren?i?.children?.map(e=>e.raw):void 0);return Array.isArray(o)&&(a.children=this._adopt(o,a,n+1)),a.loading=!!i?.loading&&a.children===null&&a.hasChildren,e.checked&&!i&&this._staged.checks.push(r),a})}_passChecksDown(e){e.children?.length&&this._checked.has(e.id)&&(this._checked.delete(e.id),this._setChecked(e,!0));for(let t of e.children??[])this._passChecksDown(t)}_loadOpenNodes(){queueMicrotask(()=>{if(this.isConnected)for(let e of[...this._byId.values()])e.expanded&&e.children===null&&e.hasChildren&&!e.loading&&this._load(e)})}_isBranch(e){return e.children?e.children.length>0:e.hasChildren}_visible(){let e=[],t=n=>{for(let r of n)e.push(r),r.expanded&&r.children&&t(r.children)};return t(this._roots),e}_state(e){if(e.children?.length){let t=0,n=0;for(let r of e.children){let e=this._state(r);e===`checked`?t++:e===`unchecked`&&n++}return t===e.children.length?`checked`:n===e.children.length?`unchecked`:`mixed`}return this._checked.has(e.id)?`checked`:`unchecked`}_setChecked(e,t){if(e.children?.length)for(let n of e.children)n.disabled||this._setChecked(n,t);else t?this._checked.add(e.id):this._checked.delete(e.id)}_nodeFrom(e){let t=e?.closest?.(`li.wui-tree-item`);if(!t)return null;for(let[e,n]of this._els)if(n.li===t)return this._byId.get(e)??null;return null}_emit(e,t){this.dispatchEvent(new CustomEvent(`wui-tree:${e}`,{detail:t,bubbles:!0,composed:!0}))}_announce(e){this._live&&(this._live.textContent=e)}_setRoving(e){let t=this._els.get(this._focusId);t&&(t.li.tabIndex=-1),this._focusId=e.id;let n=this._els.get(e.id);n&&(n.li.tabIndex=0)}_focusNode(e){e&&(this._setRoving(e),this._els.get(e.id)?.li.focus())}_activate(e){e.disabled||(this.selection===`single`&&(this._selected=e.id,this._render(),this._syncForm()),this._emit(`select`,{id:e.id,node:e.raw}))}_enabledLeaves(e){return e.disabled?[]:e.children?.length?e.children.flatMap(e=>this._enabledLeaves(e)):[e]}_toggleCheck(e){let t=this._enabledLeaves(e);if(!t.length)return;let n=!t.every(e=>this._checked.has(e.id));this._setChecked(e,n),this._render(),this._syncForm(),this._emit(`check`,{id:e.id,checked:n,values:this.values})}_toggleExpand(e){e.disabled||!this._isBranch(e)||(e.expanded?(e.expanded=!1,this._render()):this._expand(e))}_expand(e){e.expanded=!0,e.children===null?this._load(e):this._render()}async _load(e){if(e.loading)return;e.loading=!0,e.failed=!1,this._announce(this.loadingText),this._render();let t,n=null;try{t=await this._fetchChildren(e)}catch(e){n=e}let r=this._byId.get(e.id);if(!r){this._announce(``);return}if(r.loading){if(r.loading=!1,!n)try{r.children=this._adoptStaged(t,r,r.level+1),this._passChecksDown(r),this._announce(``)}catch(e){n=e}n&&(r.failed=!0,r.expanded=!1,this._announce(this.errorText),this._emit(`error`,{id:r.id,message:n?.message??String(n)})),this._render(),this._syncForm()}}async _fetchChildren(e){if(this._loader)return this._loader(e.raw);let t=this.getAttribute(`load-url`);if(!t)throw Error(`<wui-tree> has a node with children to load but no loadChildren or load-url.`);let n=new URL(t,window.location.href);n.searchParams.set(c,e.id);let i=await r(n.href,{headers:{Accept:`application/json`}});if(!i.ok)throw Error(`Loading children answered ${i.kind}.`);return JSON.parse(i.html)}_handleClick(e){let t=this._nodeFrom(e.target);!t||t.disabled||(this._focusNode(t),e.target.closest(`.wui-tree-toggle`)?this._toggleExpand(t):e.target.closest(`.wui-tree-check`)?(e.preventDefault(),this._toggleCheck(t)):this._activate(t))}_handleKeyDown(e){if(e.ctrlKey||e.metaKey||e.altKey)return;let t=this._nodeFrom(e.target);if(!(!t||e.target!==this._els.get(t.id)?.li))if(e.key===`ArrowRight`){if(e.preventDefault(),!this._isBranch(t)||t.disabled)return;t.expanded?t.children?.length&&this._focusNode(t.children[0]):this._expand(t)}else e.key===`ArrowLeft`?(e.preventDefault(),t.expanded&&this._isBranch(t)&&!t.disabled?this._toggleExpand(t):t.parent&&this._focusNode(t.parent)):e.key===` `?(e.preventDefault(),this.selection===`multiple`?this._toggleCheck(t):this.selection===`single`&&this._activate(t)):this._nav.handler(e)}_syncForm(){let e=this.selection;if(e===`multiple`)i(this,this.values);else if(e===`single`)a(this,this._selected??``);else for(let e of this.querySelectorAll(d))e.remove()}_render(){if(!this._list)return;let e=document.activeElement,t=!!e&&this._list.contains(e),n=this._visible();n.some(e=>e.id===this._focusId)||(this._focusId=(n.find(e=>e.id===this._selected)??n[0])?.id??null),this._els=new Map;let r=this.getAttribute(`aria-label`);r?this._list.setAttribute(`aria-label`,r):this._list.removeAttribute(`aria-label`),this._list.replaceChildren(...this._buildLevel(this._roots)),t&&this._focusId&&this._els.get(this._focusId)?.li.focus(),this._syncForm()}_buildLevel(e){return e.map((t,n)=>this._buildItem(t,n+1,e.length))}_buildItem(e,t,r){let i=this.selection,a=this._isBranch(e),o=this._state(e),s=m(`li`,`wui-tree-item`,{role:`treeitem`,tabindex:e.id===this._focusId?0:-1,"aria-level":e.level,"aria-setsize":r,"aria-posinset":t,"aria-labelledby":`${this._uid}-${e.seq}`,"aria-describedby":e.badge?`${this._uid}-${e.seq}-badge`:null});a&&s.setAttribute(`aria-expanded`,String(e.expanded)),e.disabled&&s.setAttribute(`aria-disabled`,`true`),e.loading&&s.setAttribute(`aria-busy`,`true`),i===`single`&&s.setAttribute(`aria-selected`,String(e.id===this._selected)),i===`multiple`&&s.setAttribute(`aria-checked`,o===`mixed`?`mixed`:String(o===`checked`));let c=m(`div`,`wui-tree-row`,{role:`presentation`});c.style.setProperty(`--wui-tree-level`,String(e.level-1)),i===`single`&&e.id===this._selected&&c.classList.add(`wui-tree-row-selected`),e.failed&&c.classList.add(`wui-tree-row-error`);let l=m(`span`,a?`wui-tree-toggle`:`wui-tree-toggle wui-tree-toggle-leaf`,{"aria-hidden":`true`});if(a&&(l.innerHTML=n(`chevron-right`,{size:16})),c.append(l),i===`multiple`){let t=m(`input`,`form-check-input wui-tree-check`,{type:`checkbox`,tabindex:-1,"aria-hidden":`true`});t.checked=o===`checked`,t.indeterminate=o===`mixed`,t.disabled=e.disabled,t.addEventListener(`mousedown`,e=>e.preventDefault()),c.append(t)}if(e.icon){let t=m(`span`,`wui-tree-icon`,{"aria-hidden":`true`});t.innerHTML=n(e.icon,{size:16}),c.append(t)}let u=m(`span`,`wui-tree-label`,{id:`${this._uid}-${e.seq}`});if(u.textContent=e.label,c.append(u),e.badge){let t=m(`span`,`badge wui-tree-badge${e.badgeTone&&e.badgeTone!==`neutral`?` badge-${e.badgeTone}`:``}`,{id:`${this._uid}-${e.seq}-badge`});t.textContent=e.badge,c.append(t)}if(e.loading&&c.append(m(`span`,`wui-tree-spinner`,{"aria-hidden":`true`})),s.append(c),e.expanded&&e.children?.length){let t=m(`ul`,`wui-tree-group`,{role:`group`});t.append(...this._buildLevel(e.children)),s.append(t)}return this._els.set(e.id,{li:s,row:c}),s}};export{h as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./elementBase-BlsR4tqa.js";import{t}from"./iconGlyphs.g-Bk8AzmSO.js";var n=`wui-wizard-step`,r=`:scope > [data-wui-glyphs]`,i={done:`Done`,active:`Current`,pending:`To do`,error:`Error`,skipped:`Skipped`},a=[`data-nav`,`data-step`,`data-close`],o=class extends e{static get observedAttributes(){return[`active`,`variant`,`orientation`,`icon-size`,`non-linear`,`hide-stepper`,`hide-connectors`,`disabled`,`skippable`,`label`,`back-label`,`next-label`,`skip-label`,`finish-label`,`top-bar`,`bar-title`,`close-label`]}constructor(){super(),this._active=0,this._skipped=new Set,this._invalid=new Set,this._finished=!1,this._rendered=!1,this._reflecting=!1,this._beforeNext=null,this._header=null,this._footer=null,this._topBar=null,this._onTopBarClick=e=>{e.target.closest(`[data-close]`)&&this.dispatchEvent(new CustomEvent(`wui-wizard:close`,{detail:{index:this._active},bubbles:!0}))},this._known=[],this._observer=null,this._glyphs=null,this._glyphObserver=null}get active(){return this._active}set active(e){let t=Number.parseInt(e,10);Number.isFinite(t)&&this._go(t,`set`)}get beforeNext(){return this._beforeNext}set beforeNext(e){this._beforeNext=typeof e==`function`?e:null}get _steps(){return[...this.querySelectorAll(`:scope > ${n}`)]}refresh(){this._rendered&&this._renderChrome()}connectedCallback(){if(this._rendered)this._wire(),this._onStepsMutated();else{let e=Number.parseInt(this.getAttribute(`active`),10);this._active=Number.isFinite(e)&&e>=0?e:0,this.render()}}disconnectedCallback(){this._teardown()}attributeChangedCallback(e,t,n){if(!(!this._rendered||this._reflecting)){if(e===`active`){let e=Number.parseInt(n,10);Number.isFinite(e)&&this._go(e,`set`);return}this._renderChrome()}}render(){let e=this._steps;this._header||(this._header=document.createElement(`nav`),this._header.className=`stepper wizard-stepper`,this._footer=document.createElement(`div`),this._footer.className=`form-actions wizard-footer form-actions-between`,e.length?(this.insertBefore(this._header,e[0]),e[e.length-1].after(this._footer)):(this.prepend(this._header),this.append(this._footer))),this._known=e,this._renderChrome(),this._rendered=!0,this._wire()}_renderChrome(){let e=this._reconcileSteps();this._placeChrome(e),this._clampActive(e),this._syncPanels(e);let t=this._focusedControl();this._syncTopBar(e),this._header.innerHTML=this._headerHtml(e),this._footer.innerHTML=this._footerHtml(e),this._header.hidden=this.hasAttribute(`hide-stepper`),this._restoreFocus(t)}_focusedControl(){let e=document.activeElement;if(!e||![this._topBar,this._header,this._footer].some(t=>t?.contains(e)))return null;let t=a.find(t=>e.hasAttribute(t));return t?{attr:t,value:e.getAttribute(t)}:null}_restoreFocus(e){if(e)for(let t of[this._topBar,this._header,this._footer]){let n=t&&[...t.querySelectorAll(`[${e.attr}]`)].find(t=>t.getAttribute(e.attr)===e.value);if(n){n.disabled||n.focus({preventScroll:!0});return}}}_syncTopBar(e){if(!this.hasAttribute(`top-bar`)){this._topBar?.removeEventListener(`click`,this._onTopBarClick),this._topBar?.remove(),this._topBar=null;return}this._topBar||(this._topBar=document.createElement(`div`),this._topBar.className=`wui-wizard-topbar`,this._rendered&&this._topBar.addEventListener(`click`,this._onTopBarClick)),this._header.previousElementSibling!==this._topBar&&this.insertBefore(this._topBar,this._header);let t=this.getAttribute(`bar-title`)||``,n=this.getAttribute(`close-label`)||`Close`,r=e.length?`<span class="wui-wizard-topbar-count">Step ${this._active+1} of ${e.length}</span>`:``;this._topBar.innerHTML=`<span class="wui-wizard-topbar-title">${c(t)}</span>${r}<button type="button" class="wui-wizard-topbar-close" data-close aria-label="${l(n)}">${this._glyph(`x`)}</button>`}_clampActive(e){let t=Math.max(0,e.length-1);this._active>t&&(this._active=t),this._active<0&&(this._active=0)}_reconcileSteps(){let e=this._steps,t=this._known;if(this._known=e,s(e,t))return e;let n=n=>new Set([...n].map(n=>e.indexOf(t[n])).filter(e=>e>=0));this._skipped=n(this._skipped),this._invalid=n(this._invalid);let r=t[this._active];if(!r)return e;let i=e.indexOf(r);if(i<0){let n=t=>e.includes(t),r=t.slice(this._active+1).find(n)??t.slice(0,this._active).reverse().find(n);i=r?e.indexOf(r):this._active}return i=Math.min(i,Math.max(0,e.length-1)),i!==this._active&&(this._active=i,this._reflectActive(i)),e}_placeChrome(e){if(!e.length)return;let t=e[e.length-1];this._header.nextElementSibling!==e[0]&&this.insertBefore(this._header,e[0]),this._footer.previousElementSibling!==t&&t.after(this._footer)}_onStepsMutated(){if(!this._rendered)return;let e=this._steps,t=!e.length||this._header.nextElementSibling===e[0]&&this._footer.previousElementSibling===e[e.length-1];this.querySelector(r)!==this._glyphs&&(this._watchGlyphs(),this._renderHeader()),!(t&&s(e,this._known))&&(this._renderChrome(),this._observer?.takeRecords())}_syncPanels(e){e.forEach((e,t)=>{let n=t===this._active;e.classList.add(`wizard-panel`),e.hidden=!n,e.setAttribute(`role`,`tabpanel`),e.setAttribute(`aria-hidden`,n?`false`:`true`)})}_stepStatus(e,t){return e.getAttribute(`status`)||(this._invalid.has(t)?`error`:this._finished?`done`:t===this._active?`active`:t<this._active?this._skipped.has(t)?`skipped`:`done`:`pending`)}_headerHtml(e){let t=this.getAttribute(`variant`)===`journey`,n=this.getAttribute(`variant`)===`icons`,r=this.getAttribute(`variant`)===`tiles`,a=this.getAttribute(`orientation`)===`vertical`,o=!this.hasAttribute(`hide-connectors`);this._header.className=[`stepper`,`wizard-stepper`,t&&`stepper-journey`,n&&`stepper-icons`,r&&`wui-step-tiles`,a&&`stepper-vertical`,!o&&`wui-stepper-no-connectors`].filter(Boolean).join(` `),this._header.setAttribute(`aria-label`,this.getAttribute(`label`)||`Progress`);let s=this.hasAttribute(`non-linear`),l=e.map((a,l)=>{let u=this._stepStatus(a,l),d=a.getAttribute(`label`)||``,f=a.getAttribute(`description`)||``,p=a.getAttribute(`icon`)||``,m=l+1,h;h=u===`done`?this._glyph(`check`):u===`error`?this._glyph(`alert-triangle`):u===`skipped`?this._glyph(`minus`):p?this._glyph(p):String(m);let g=u===`pending`?`step`:`step ${u}`,_=u===`active`?` aria-current="step"`:``,v=s||l<this._active;if(r){let e=`<span class="step-circle">${h}</span><span class="step-text"><span class="step-label">${c(d)}</span><span class="wui-step-tile-state">${i[u]??``}</span></span>`,t=v?`<button type="button" class="wui-step-tile-body" data-step="${l}"${_}>${e}</button>`:`<div class="wui-step-tile-body"${_}>${e}</div>`;return`<li class="${u===`pending`?`wui-step-tile`:`wui-step-tile ${u}`}">${t}</li>`}let y=f?`<span class="step-desc">${c(f)}</span>`:``,b;b=t?`<span class="step-circle">${h}</span><span class="step-text"><span class="step-index">Step ${m}</span><span class="step-label">${c(d)}</span>${y}</span>`:n?`<span class="step-circle">${h}</span><span class="step-index">Step ${m}</span><span class="step-label">${c(d)}</span>${y}`:`<span class="step-circle">${h}</span><span class="step-label">${c(d)}</span>${y}`;let x=v?`<button type="button" class="${g}" data-step="${l}"${_}>${b}</button>`:`<div class="${g}"${_}>${b}</div>`;return t&&o&&l<e.length-1?`${x}<span class="step-line${u===`done`?` done`:``}" aria-hidden="true"></span>`:x}).join(``);return r?`<ol>${l}</ol>`:l}_footerHtml(e){let n=this._active,r=e.length-1,i=this.hasAttribute(`disabled`)?` disabled`:``,a=e[n]?.hasAttribute(`optional`)||this.hasAttribute(`skippable`),o=this.getAttribute(`back-label`)||`Back`,s=this.getAttribute(`next-label`)||`Next`,l=this.getAttribute(`skip-label`)||`Skip`,u=this.getAttribute(`finish-label`)||`Finish`;return`${n>0?`<button type="button" class="btn btn-secondary" data-nav="back"${i}>${t(`arrow-left`,{className:`me-2`})}${c(o)}</button>`:`<span></span>`}<span class="wizard-footer-actions">${a&&n<r?`<button type="button" class="btn btn-neutral" data-nav="skip"${i}>${c(l)}</button>`:``}${n<r?`<button type="button" class="btn btn-primary" data-nav="next"${i}>${c(s)}${t(`arrow-right`,{className:`ms-2`})}</button>`:`<button type="button" class="btn btn-primary" data-nav="finish"${i}>${c(u)}</button>`}</span>`}_wire(){this._teardown(),this._onHeaderClick=e=>{let t=e.target.closest(`[data-step]`);t&&this.contains(t)&&this._stepTo(Number.parseInt(t.dataset.step,10))},this._onFooterClick=e=>{let t=e.target.closest(`[data-nav]`);if(!t||!this.contains(t)||this.hasAttribute(`disabled`))return;let n=t.dataset.nav;n===`back`?this._back():n===`skip`?this._skip():(n===`next`||n===`finish`)&&this._next()},this._header.addEventListener(`click`,this._onHeaderClick),this._footer.addEventListener(`click`,this._onFooterClick),this._topBar?.addEventListener(`click`,this._onTopBarClick),this._observer=new MutationObserver(()=>this._onStepsMutated()),this._observer.observe(this,{childList:!0}),this._watchGlyphs()}_glyph(e){let n=this.querySelector(r),i=n&&[...n.children].find(t=>t.getAttribute(`data-icon`)===e);if(i)return i.outerHTML;let a=Number.parseInt(this.getAttribute(`icon-size`),10);return t(e,a>0?{size:a}:void 0)}_watchGlyphs(){this._glyphObserver?.disconnect(),this._glyphObserver=null,this._glyphs=this.querySelector(r),this._glyphs&&(this._glyphObserver=new MutationObserver(()=>this._renderHeader()),this._glyphObserver.observe(this._glyphs,{childList:!0,subtree:!0,attributes:!0,characterData:!0}))}_renderHeader(){if(!this._rendered)return;let e=this._focusedControl();this._header.innerHTML=this._headerHtml(this._steps),this._restoreFocus(e)}_teardown(){this._header&&this._onHeaderClick&&this._header.removeEventListener(`click`,this._onHeaderClick),this._footer&&this._onFooterClick&&this._footer.removeEventListener(`click`,this._onFooterClick),this._topBar?.removeEventListener(`click`,this._onTopBarClick),this._observer?.disconnect(),this._observer=null,this._glyphObserver?.disconnect(),this._glyphObserver=null}_stepTo(e){this.hasAttribute(`disabled`)||!this.hasAttribute(`non-linear`)&&e>=this._active||this._go(e,`step`)}_back(){this._active>0&&this._go(this._active-1,`back`)}async _next(){this._reconcileSteps();let e=this._active,t=this._steps,n=e>=t.length-1,r=t[e];if(!this.dispatchEvent(new CustomEvent(`wui-wizard:beforechange`,{detail:n?{index:e,next:e,reason:`finish`}:{index:e,next:e+1,reason:`next`},cancelable:!0})))return this._flagInvalid(e);if(this._beforeNext){let i;try{i=await this._beforeNext(e)}catch{i=!1}if(this._reconcileSteps(),t=this._steps,e=t.indexOf(r),e<0)return;if(n=e>=t.length-1,i===!1)return this._flagInvalid(e)}if(this._invalid.delete(e),this._skipped.delete(e),n)return this._finish();this._go(e+1,`next`)}_skip(){let e=this._active,t=this._steps;if(!(!t[e]?.hasAttribute(`optional`)&&!this.hasAttribute(`skippable`))){if(this._invalid.delete(e),this._skipped.add(e),this.dispatchEvent(new CustomEvent(`wui-wizard:skip`,{detail:{index:e}})),e>=t.length-1)return this._finish();this._go(e+1,`skip`)}}_flagInvalid(e){this._invalid.add(e),this._renderChrome(),this.dispatchEvent(new CustomEvent(`wui-wizard:invalid`,{detail:{index:e}}))}_finish(){this._invalid.delete(this._active),this._finished=!0,this._renderChrome(),this.dispatchEvent(new CustomEvent(`wui-wizard:finish`,{detail:{index:this._active}}))}_go(e,t){let n=this._reconcileSteps(),r=Math.max(0,n.length-1),i=Math.min(Math.max(e,0),r),a=this._active;this._finished=!1,this._invalid.delete(a),this._active=i,this._reflectActive(i),this._renderChrome(),t!==`silent`&&i!==a&&this.dispatchEvent(new CustomEvent(`wui-wizard:change`,{detail:{index:i,previous:a,reason:t}}))}_reflectActive(e){this._reflecting=!0,this.setAttribute(`active`,String(e)),this._reflecting=!1}},s=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),c=e=>String(e??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),l=e=>String(e??``).replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`),u=class extends e{static get observedAttributes(){return[`label`,`description`,`optional`,`icon`,`status`]}attributeChangedCallback(){let e=this.closest(`wui-wizard`);e&&typeof e.refresh==`function`&&e.refresh()}};export{o as n,u as t};
@@ -0,0 +1 @@
1
+ function e(e,...t){console.warn(e,...t)}function t(e,...t){console.error(e,...t)}export{e as n,t};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiAutocomplete-CYpMjHs3.js";e(`wui-autocomplete`,t);export{t as WuiAutocomplete};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiAutocomplete-Cvoyr30K.js";e(`wui-autocomplete`,t);export{t as WuiAutocomplete};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiCarousel-C33Z8FBt.js";e(`wui-carousel`,t);export{t as WuiCarousel};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiCarousel-DjQNKykv.js";e(`wui-carousel`,t);export{t as WuiCarousel};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiCodeBlock-BcLJhLBJ.js";e(`wui-code-block`,t);export{t as WuiCodeBlock};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiCodeBlock-8qgxTcyK.js";e(`wui-code-block`,t);export{t as WuiCodeBlock};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiCommandPalette-CcmFOWNc.js";e(`wui-command-palette`,t);export{t as WuiCommandPalette};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiCommandPalette-DMXm40wj.js";e(`wui-command-palette`,t);export{t as WuiCommandPalette};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{i as t,n,r,t as i}from"../WuiCommentThread-BHtcGLX0.js";import"./mention-input.js";e(`wui-comment-thread`,t);export{i as COMMENT_INTENTS,n as COMMENT_REACTIONS,r as COMMENT_TEXT,t as WuiCommentThread};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{i as t,n,r,t as i}from"../WuiCommentThread-WL1GX7Jy.js";import"./mention-input.js";e(`wui-comment-thread`,t);export{i as COMMENT_INTENTS,n as COMMENT_REACTIONS,r as COMMENT_TEXT,t as WuiCommentThread};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiConsentBanner-jdTxzdJs.js";e(`wui-consent-banner`,t);export{t as WuiConsentBanner};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiConsentBanner-D6YE84__.js";e(`wui-consent-banner`,t);export{t as WuiConsentBanner};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiCountrySelect-DlmQ6qeN.js";e(`wui-country-select`,t);export{t as WuiCountrySelect};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiCountrySelect-Dac15o75.js";e(`wui-country-select`,t);export{t as WuiCountrySelect};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{A as t,C as n,D as r,E as i,M as a,O as o,S as s,T as c,_ as l,a as u,b as d,c as f,d as p,f as m,g as h,h as g,i as _,j as v,k as y,l as b,m as x,n as S,o as C,p as w,r as T,s as E,t as D,u as O,v as k,w as A,x as j,y as M}from"../dataTable-Cd_IJQcs.js";import{t as N}from"../WuiDataTable-Bqs6FW2t.js";e(`wui-data-table`,N);export{D as COLUMN_MAX_WIDTH,S as COLUMN_MIN_WIDTH,T as DATA_TABLE_TEXT,_ as PIN_AT_VAR,u as PIN_SIDES,C as RESIZE_STEP,E as RESIZE_STEP_LARGE,f as ROW_HEIGHTS,b as ROW_MOVE_LIMIT,O as ROW_MOVE_MS,p as ROW_SAVE_ATTR,m as ROW_SAVE_ERROR_CLASS,w as ROW_SAVE_STATES,x as VIRTUAL_OVERSCAN,N as WuiDataTable,g as clampColumnWidth,h as groupCount,l as groupItems,k as identityCell,M as measureRows,d as pinAtValue,j as pinClasses,s as pinOffsetVar,n as planPins,A as playRowMoves,c as readColumnWidths,i as rowLabel,r as rowOrderChanged,o as saveOutcomeText,y as setRowSaveState,t as settledRows,v as virtualRange,a as writeColumnWidths};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{A as t,C as n,D as r,E as i,M as a,O as o,S as s,T as c,_ as l,a as u,b as d,c as f,d as p,f as m,g as h,h as g,i as _,j as v,k as y,l as b,m as x,n as S,o as C,p as w,r as T,s as E,t as D,u as O,v as k,w as A,x as j,y as M}from"../dataTable-Cd_IJQcs.js";import{t as N}from"../WuiDataTable-BVAsbW-S.js";e(`wui-data-table`,N);export{D as COLUMN_MAX_WIDTH,S as COLUMN_MIN_WIDTH,T as DATA_TABLE_TEXT,_ as PIN_AT_VAR,u as PIN_SIDES,C as RESIZE_STEP,E as RESIZE_STEP_LARGE,f as ROW_HEIGHTS,b as ROW_MOVE_LIMIT,O as ROW_MOVE_MS,p as ROW_SAVE_ATTR,m as ROW_SAVE_ERROR_CLASS,w as ROW_SAVE_STATES,x as VIRTUAL_OVERSCAN,N as WuiDataTable,g as clampColumnWidth,h as groupCount,l as groupItems,k as identityCell,M as measureRows,d as pinAtValue,j as pinClasses,s as pinOffsetVar,n as planPins,A as playRowMoves,c as readColumnWidths,i as rowLabel,r as rowOrderChanged,o as saveOutcomeText,y as setRowSaveState,t as settledRows,v as virtualRange,a as writeColumnWidths};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiDateRange-h4lDtS-H.js";e(`wui-date-range`,t);export{t as WuiDateRange};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiDateRange-DCNf4MSb.js";e(`wui-date-range`,t);export{t as WuiDateRange};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiDatePicker-CpRYPtYz.js";e(`wui-datepicker`,t);export{t as WuiDatePicker};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiDatePicker-BUtDjbek.js";e(`wui-datepicker`,t);export{t as WuiDatePicker};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{a as t,i as n,n as r,r as i,t as a}from"../WuiInlineEdit-2XnVPzY-.js";e(`wui-inline-edit`,n);export{a as INLINE_EDIT_SAVED_MS,r as INLINE_EDIT_TEXT,i as INLINE_EDIT_TYPES,n as WuiInlineEdit,t as inlineEditText};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{a as t,i as n,n as r,r as i,t as a}from"../WuiInlineEdit-DrQmhWZ6.js";e(`wui-inline-edit`,n);export{a as INLINE_EDIT_SAVED_MS,r as INLINE_EDIT_TEXT,i as INLINE_EDIT_TYPES,n as WuiInlineEdit,t as inlineEditText};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"../kanban-C0RiKTUx.js";e(`wui-kanban`,n);export{h as KANBAN_DRAG_THRESHOLD_PX,u as KANBAN_LONG_PRESS_MS,p as KANBAN_PHONE_QUERY,s as KANBAN_STORAGE_PREFIX,t as KANBAN_SUMMARY_FORMATS,d as KANBAN_TEXT,m as KANBAN_TONES,n as WuiKanban,c as kanbanCardLabel,g as kanbanOverflow,r as kanbanStorageKey,i as kanbanSummaryFormat,f as kanbanVisibleLimit,l as readKanbanCollapsed,o as sumKanbanValues,a as writeKanbanCollapsed};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"../kanban-yqsg7glT.js";e(`wui-kanban`,n);export{h as KANBAN_DRAG_THRESHOLD_PX,u as KANBAN_LONG_PRESS_MS,p as KANBAN_PHONE_QUERY,s as KANBAN_STORAGE_PREFIX,t as KANBAN_SUMMARY_FORMATS,d as KANBAN_TEXT,m as KANBAN_TONES,n as WuiKanban,c as kanbanCardLabel,g as kanbanOverflow,r as kanbanStorageKey,i as kanbanSummaryFormat,f as kanbanVisibleLimit,l as readKanbanCollapsed,o as sumKanbanValues,a as writeKanbanCollapsed};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiLightbox-hluak_-q.js";e(`wui-lightbox`,t);export{t as WuiLightbox};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiLightbox-DQ47WenM.js";e(`wui-lightbox`,t);export{t as WuiLightbox};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l,u}from"../WuiMentionInput-BxYXpBRt.js";e(`wui-mention-input`,r);export{t as MENTION_ID_PATTERN,l as MENTION_MAX_QUERY,a as MENTION_MAX_RESULTS,s as MENTION_TEXT,r as WuiMentionInput,o as mentionLabel,c as mentionTextFromValue,n as mentionValueFromText,i as mentionedIds,u as parseMentionValue};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l,u}from"../WuiMentionInput-BqcTKb8b.js";e(`wui-mention-input`,r);export{t as MENTION_ID_PATTERN,l as MENTION_MAX_QUERY,a as MENTION_MAX_RESULTS,s as MENTION_TEXT,r as WuiMentionInput,o as mentionLabel,c as mentionTextFromValue,n as mentionValueFromText,i as mentionedIds,u as parseMentionValue};