@aurodesignsystem-dev/auro-formkit 0.0.0-pr593.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 (268) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +2 -0
  4. package/README.md +314 -0
  5. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +39 -0
  6. package/components/bibtemplate/dist/headerVersion.d.ts +2 -0
  7. package/components/bibtemplate/dist/iconVersion.d.ts +2 -0
  8. package/components/bibtemplate/dist/index.d.ts +2 -0
  9. package/components/bibtemplate/dist/index.js +709 -0
  10. package/components/bibtemplate/dist/registered.js +709 -0
  11. package/components/bibtemplate/dist/styles/color-css.d.ts +2 -0
  12. package/components/bibtemplate/dist/styles/style-css.d.ts +2 -0
  13. package/components/bibtemplate/dist/styles/tokens-css.d.ts +2 -0
  14. package/components/checkbox/README.md +142 -0
  15. package/components/checkbox/demo/api.html +55 -0
  16. package/components/checkbox/demo/api.js +17 -0
  17. package/components/checkbox/demo/api.md +401 -0
  18. package/components/checkbox/demo/api.min.js +1833 -0
  19. package/components/checkbox/demo/index.html +51 -0
  20. package/components/checkbox/demo/index.js +8 -0
  21. package/components/checkbox/demo/index.md +327 -0
  22. package/components/checkbox/demo/index.min.js +1808 -0
  23. package/components/checkbox/demo/readme.html +50 -0
  24. package/components/checkbox/demo/readme.md +142 -0
  25. package/components/checkbox/dist/auro-checkbox-group.d.ts +166 -0
  26. package/components/checkbox/dist/auro-checkbox.d.ts +129 -0
  27. package/components/checkbox/dist/helptextVersion.d.ts +2 -0
  28. package/components/checkbox/dist/index.d.ts +3 -0
  29. package/components/checkbox/dist/index.js +1757 -0
  30. package/components/checkbox/dist/registered.js +1758 -0
  31. package/components/checkbox/dist/styles/auro-checkbox-css.d.ts +2 -0
  32. package/components/checkbox/dist/styles/auro-checkbox-group-css.d.ts +2 -0
  33. package/components/checkbox/dist/styles/color-css.d.ts +2 -0
  34. package/components/checkbox/dist/styles/colorGroup-css.d.ts +2 -0
  35. package/components/checkbox/dist/styles/tokens-css.d.ts +2 -0
  36. package/components/combobox/README.md +152 -0
  37. package/components/combobox/demo/api.html +57 -0
  38. package/components/combobox/demo/api.js +36 -0
  39. package/components/combobox/demo/api.md +1209 -0
  40. package/components/combobox/demo/api.min.js +15117 -0
  41. package/components/combobox/demo/index.html +56 -0
  42. package/components/combobox/demo/index.js +26 -0
  43. package/components/combobox/demo/index.md +621 -0
  44. package/components/combobox/demo/index.min.js +14971 -0
  45. package/components/combobox/demo/readme.html +50 -0
  46. package/components/combobox/demo/readme.md +152 -0
  47. package/components/combobox/dist/auro-combobox.d.ts +384 -0
  48. package/components/combobox/dist/bibtemplateVersion.d.ts +2 -0
  49. package/components/combobox/dist/dropdownVersion.d.ts +2 -0
  50. package/components/combobox/dist/index.d.ts +2 -0
  51. package/components/combobox/dist/index.js +13554 -0
  52. package/components/combobox/dist/inputVersion.d.ts +2 -0
  53. package/components/combobox/dist/registered.js +13556 -0
  54. package/components/combobox/dist/styles/style-css.d.ts +2 -0
  55. package/components/counter/README.md +146 -0
  56. package/components/counter/demo/api.html +54 -0
  57. package/components/counter/demo/api.js +20 -0
  58. package/components/counter/demo/api.md +584 -0
  59. package/components/counter/demo/api.min.js +7111 -0
  60. package/components/counter/demo/index.html +54 -0
  61. package/components/counter/demo/index.js +21 -0
  62. package/components/counter/demo/index.md +244 -0
  63. package/components/counter/demo/index.min.js +7075 -0
  64. package/components/counter/demo/readme.html +50 -0
  65. package/components/counter/demo/readme.md +146 -0
  66. package/components/counter/dist/auro-counter-button.d.ts +12 -0
  67. package/components/counter/dist/auro-counter-group.d.ts +235 -0
  68. package/components/counter/dist/auro-counter-wrapper.d.ts +22 -0
  69. package/components/counter/dist/auro-counter.d.ts +97 -0
  70. package/components/counter/dist/bibtemplateVersion.d.ts +2 -0
  71. package/components/counter/dist/dropdownVersion.d.ts +2 -0
  72. package/components/counter/dist/iconVersion.d.ts +2 -0
  73. package/components/counter/dist/index.d.ts +3 -0
  74. package/components/counter/dist/index.js +7018 -0
  75. package/components/counter/dist/registered.js +7019 -0
  76. package/components/counter/dist/styles/color-css.d.ts +2 -0
  77. package/components/counter/dist/styles/counter-button-color-css.d.ts +2 -0
  78. package/components/counter/dist/styles/counter-button-css.d.ts +2 -0
  79. package/components/counter/dist/styles/counter-group-css.d.ts +2 -0
  80. package/components/counter/dist/styles/counter-wrapper-color-css.d.ts +2 -0
  81. package/components/counter/dist/styles/counter-wrapper-css.d.ts +2 -0
  82. package/components/counter/dist/styles/style-css.d.ts +2 -0
  83. package/components/counter/dist/styles/tokens-css.d.ts +2 -0
  84. package/components/datepicker/README.md +140 -0
  85. package/components/datepicker/demo/api.html +57 -0
  86. package/components/datepicker/demo/api.js +35 -0
  87. package/components/datepicker/demo/api.md +1479 -0
  88. package/components/datepicker/demo/api.min.js +24534 -0
  89. package/components/datepicker/demo/index.html +56 -0
  90. package/components/datepicker/demo/index.js +19 -0
  91. package/components/datepicker/demo/index.md +112 -0
  92. package/components/datepicker/demo/index.min.js +24255 -0
  93. package/components/datepicker/demo/readme.html +50 -0
  94. package/components/datepicker/demo/readme.md +140 -0
  95. package/components/datepicker/dist/auro-calendar-cell.d.ts +163 -0
  96. package/components/datepicker/dist/auro-calendar-month.d.ts +20 -0
  97. package/components/datepicker/dist/auro-calendar.d.ts +133 -0
  98. package/components/datepicker/dist/auro-datepicker.d.ts +466 -0
  99. package/components/datepicker/dist/bibtemplateVersion.d.ts +2 -0
  100. package/components/datepicker/dist/buttonVersion.d.ts +2 -0
  101. package/components/datepicker/dist/dropdownVersion.d.ts +2 -0
  102. package/components/datepicker/dist/index.d.ts +2 -0
  103. package/components/datepicker/dist/index.js +24185 -0
  104. package/components/datepicker/dist/inputVersion.d.ts +2 -0
  105. package/components/datepicker/dist/popoverVersion.d.ts +2 -0
  106. package/components/datepicker/dist/registered.js +24185 -0
  107. package/components/datepicker/dist/styles/color-calendar-css.d.ts +2 -0
  108. package/components/datepicker/dist/styles/color-cell-css.d.ts +2 -0
  109. package/components/datepicker/dist/styles/color-css.d.ts +2 -0
  110. package/components/datepicker/dist/styles/color-month-css.d.ts +2 -0
  111. package/components/datepicker/dist/styles/style-auro-calendar-cell-css.d.ts +2 -0
  112. package/components/datepicker/dist/styles/style-auro-calendar-css.d.ts +2 -0
  113. package/components/datepicker/dist/styles/style-auro-calendar-month-css.d.ts +2 -0
  114. package/components/datepicker/dist/styles/style-css.d.ts +2 -0
  115. package/components/datepicker/dist/styles/tokens-css.d.ts +2 -0
  116. package/components/datepicker/dist/utilities.d.ts +78 -0
  117. package/components/datepicker/dist/utilitiesCalendar.d.ts +38 -0
  118. package/components/datepicker/dist/utilitiesCalendarRender.d.ts +50 -0
  119. package/components/datepicker/dist/vendor/wc-range-datepicker/day.d.ts +5 -0
  120. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-calendar.d.ts +60 -0
  121. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-cell.d.ts +1 -0
  122. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker.d.ts +57 -0
  123. package/components/dropdown/README.md +144 -0
  124. package/components/dropdown/demo/api.html +57 -0
  125. package/components/dropdown/demo/api.js +21 -0
  126. package/components/dropdown/demo/api.md +1434 -0
  127. package/components/dropdown/demo/api.min.js +3826 -0
  128. package/components/dropdown/demo/index.html +55 -0
  129. package/components/dropdown/demo/index.js +19 -0
  130. package/components/dropdown/demo/index.md +510 -0
  131. package/components/dropdown/demo/index.min.js +3789 -0
  132. package/components/dropdown/demo/readme.html +50 -0
  133. package/components/dropdown/demo/readme.md +144 -0
  134. package/components/dropdown/dist/auro-dropdown.d.ts +406 -0
  135. package/components/dropdown/dist/auro-dropdownBib.d.ts +46 -0
  136. package/components/dropdown/dist/dropdownVersion.d.ts +2 -0
  137. package/components/dropdown/dist/helptextVersion.d.ts +2 -0
  138. package/components/dropdown/dist/iconVersion.d.ts +2 -0
  139. package/components/dropdown/dist/index.d.ts +2 -0
  140. package/components/dropdown/dist/index.js +3734 -0
  141. package/components/dropdown/dist/registered.js +3734 -0
  142. package/components/dropdown/dist/styles/bibColors-css.d.ts +2 -0
  143. package/components/dropdown/dist/styles/bibStyles-css.d.ts +2 -0
  144. package/components/dropdown/dist/styles/color-css.d.ts +2 -0
  145. package/components/dropdown/dist/styles/style-css.d.ts +2 -0
  146. package/components/dropdown/dist/styles/tokens-css.d.ts +2 -0
  147. package/components/form/README.md +142 -0
  148. package/components/form/demo/api.html +49 -0
  149. package/components/form/demo/api.js +3 -0
  150. package/components/form/demo/api.md +51 -0
  151. package/components/form/demo/api.min.js +638 -0
  152. package/components/form/demo/autocomplete.html +15 -0
  153. package/components/form/demo/index.html +50 -0
  154. package/components/form/demo/index.js +4 -0
  155. package/components/form/demo/index.md +403 -0
  156. package/components/form/demo/index.min.js +639 -0
  157. package/components/form/demo/readme.html +50 -0
  158. package/components/form/demo/readme.md +142 -0
  159. package/components/form/demo/registerDemoDeps.js +23 -0
  160. package/components/form/demo/working.html +118 -0
  161. package/components/form/dist/auro-form.d.ts +223 -0
  162. package/components/form/dist/index.d.ts +2 -0
  163. package/components/form/dist/index.js +614 -0
  164. package/components/form/dist/registered.d.ts +1 -0
  165. package/components/form/dist/registered.js +614 -0
  166. package/components/form/dist/styles/style-css.d.ts +2 -0
  167. package/components/helptext/dist/auro-helptext.d.ts +61 -0
  168. package/components/helptext/dist/index.d.ts +2 -0
  169. package/components/helptext/dist/index.js +209 -0
  170. package/components/helptext/dist/registered.js +209 -0
  171. package/components/helptext/dist/styles/color-css.d.ts +2 -0
  172. package/components/helptext/dist/styles/style-css.d.ts +2 -0
  173. package/components/helptext/dist/styles/tokens-css.d.ts +2 -0
  174. package/components/input/README.md +135 -0
  175. package/components/input/demo/api.html +42 -0
  176. package/components/input/demo/api.js +29 -0
  177. package/components/input/demo/api.md +1252 -0
  178. package/components/input/demo/api.min.js +7238 -0
  179. package/components/input/demo/index.html +43 -0
  180. package/components/input/demo/index.js +20 -0
  181. package/components/input/demo/index.md +202 -0
  182. package/components/input/demo/index.min.js +7157 -0
  183. package/components/input/demo/readme.html +50 -0
  184. package/components/input/demo/readme.md +135 -0
  185. package/components/input/dist/auro-input.d.ts +31 -0
  186. package/components/input/dist/base-input.d.ts +512 -0
  187. package/components/input/dist/buttonVersion.d.ts +2 -0
  188. package/components/input/dist/helptextVersion.d.ts +2 -0
  189. package/components/input/dist/i18n.d.ts +18 -0
  190. package/components/input/dist/iconVersion.d.ts +2 -0
  191. package/components/input/dist/index.d.ts +2 -0
  192. package/components/input/dist/index.js +7063 -0
  193. package/components/input/dist/registered.js +7063 -0
  194. package/components/input/dist/styles/borders-css.d.ts +2 -0
  195. package/components/input/dist/styles/color-css.d.ts +2 -0
  196. package/components/input/dist/styles/input-css.d.ts +2 -0
  197. package/components/input/dist/styles/label-css.d.ts +2 -0
  198. package/components/input/dist/styles/mixins-css.d.ts +2 -0
  199. package/components/input/dist/styles/notificationIcons-css.d.ts +2 -0
  200. package/components/input/dist/styles/style-css.d.ts +2 -0
  201. package/components/input/dist/styles/tokens-css.d.ts +2 -0
  202. package/components/input/dist/utilities.d.ts +25 -0
  203. package/components/menu/README.md +145 -0
  204. package/components/menu/demo/api.html +55 -0
  205. package/components/menu/demo/api.js +27 -0
  206. package/components/menu/demo/api.md +954 -0
  207. package/components/menu/demo/api.min.js +1538 -0
  208. package/components/menu/demo/index.html +52 -0
  209. package/components/menu/demo/index.js +28 -0
  210. package/components/menu/demo/index.md +61 -0
  211. package/components/menu/demo/index.min.js +1484 -0
  212. package/components/menu/demo/readme.html +50 -0
  213. package/components/menu/demo/readme.md +145 -0
  214. package/components/menu/dist/auro-menu-utils.d.ts +42 -0
  215. package/components/menu/dist/auro-menu.d.ts +205 -0
  216. package/components/menu/dist/auro-menuoption.d.ts +63 -0
  217. package/components/menu/dist/dropdownVersion.d.ts +2 -0
  218. package/components/menu/dist/iconVersion.d.ts +2 -0
  219. package/components/menu/dist/index.d.ts +4 -0
  220. package/components/menu/dist/index.js +1426 -0
  221. package/components/menu/dist/registered.js +1427 -0
  222. package/components/menu/dist/styles/color-menu-css.d.ts +2 -0
  223. package/components/menu/dist/styles/color-menuoption-css.d.ts +2 -0
  224. package/components/menu/dist/styles/style-menu-css.d.ts +2 -0
  225. package/components/menu/dist/styles/style-menuoption-css.d.ts +2 -0
  226. package/components/menu/dist/styles/tokens-css.d.ts +2 -0
  227. package/components/radio/README.md +137 -0
  228. package/components/radio/demo/api.html +53 -0
  229. package/components/radio/demo/api.js +19 -0
  230. package/components/radio/demo/api.md +562 -0
  231. package/components/radio/demo/api.min.js +1944 -0
  232. package/components/radio/demo/index.html +50 -0
  233. package/components/radio/demo/index.js +8 -0
  234. package/components/radio/demo/index.md +150 -0
  235. package/components/radio/demo/index.min.js +1901 -0
  236. package/components/radio/demo/readme.html +50 -0
  237. package/components/radio/demo/readme.md +137 -0
  238. package/components/radio/dist/auro-radio-group.d.ts +194 -0
  239. package/components/radio/dist/auro-radio.d.ts +144 -0
  240. package/components/radio/dist/helptextVersion.d.ts +2 -0
  241. package/components/radio/dist/index.d.ts +3 -0
  242. package/components/radio/dist/index.js +1850 -0
  243. package/components/radio/dist/registered.js +1851 -0
  244. package/components/radio/dist/styles/auro-radio-group-css.d.ts +2 -0
  245. package/components/radio/dist/styles/color-css.d.ts +2 -0
  246. package/components/radio/dist/styles/groupColor-css.d.ts +2 -0
  247. package/components/radio/dist/styles/style-css.d.ts +2 -0
  248. package/components/radio/dist/styles/tokens-css.d.ts +2 -0
  249. package/components/select/README.md +144 -0
  250. package/components/select/demo/api.html +71 -0
  251. package/components/select/demo/api.js +35 -0
  252. package/components/select/demo/api.md +1313 -0
  253. package/components/select/demo/api.min.js +7763 -0
  254. package/components/select/demo/index.html +66 -0
  255. package/components/select/demo/index.js +9 -0
  256. package/components/select/demo/index.md +815 -0
  257. package/components/select/demo/index.min.js +7651 -0
  258. package/components/select/demo/readme.html +50 -0
  259. package/components/select/demo/readme.md +144 -0
  260. package/components/select/dist/auro-select.d.ts +359 -0
  261. package/components/select/dist/bibtemplateVersion.d.ts +2 -0
  262. package/components/select/dist/dropdownVersion.d.ts +2 -0
  263. package/components/select/dist/index.d.ts +2 -0
  264. package/components/select/dist/index.js +6300 -0
  265. package/components/select/dist/registered.js +6300 -0
  266. package/components/select/dist/styles/style-css.d.ts +2 -0
  267. package/package.json +217 -0
  268. package/packages/build-tools/src/postinstall.mjs +12 -0
@@ -0,0 +1,1538 @@
1
+ function auroMenuResetExample() {
2
+ const resetExampleBtnElem = document.querySelector('#resetExampleBtn');
3
+ const resetExampleElem = document.querySelector('#resetExample');
4
+
5
+ if (resetExampleElem && resetExampleBtnElem) {
6
+ resetExampleBtnElem.addEventListener('click', () => {
7
+ resetExampleElem.reset();
8
+ });
9
+ }
10
+ }
11
+
12
+ function updateMatch() {
13
+ let matchWordMenu = document.querySelector('#matchWordMenu');
14
+
15
+ matchWordMenu.matchWord = matchWordInput.value;
16
+ }
17
+
18
+ function auroMenuMatchWordExample() {
19
+ let matchWordInput = document.querySelector('#matchWordInput');
20
+
21
+ matchWordInput.addEventListener('keyup', updateMatch);
22
+ }
23
+
24
+ function auroMenuCustomEventExample() {
25
+ let menuCustomEventEl = document.querySelector('auro-menu#customEvent');
26
+
27
+ if (menuCustomEventEl) {
28
+ menuCustomEventEl.addEventListener('mycustomevent', () => {
29
+ console.warn('My Custom Event Fired');
30
+ alert(`My Custom Event Fired`);
31
+ });
32
+ }
33
+ }
34
+
35
+ function auroMenuLoadingExample() {
36
+ document.querySelector("#loadingExampleToggleButton").addEventListener("click", () => {
37
+ document.querySelectorAll("#loadingExampleTable auro-menu").forEach(menu => menu.toggleAttribute("loading"));
38
+ });
39
+ }
40
+
41
+ /**
42
+ * @license
43
+ * Copyright 2019 Google LLC
44
+ * SPDX-License-Identifier: BSD-3-Clause
45
+ */
46
+ const t$2=globalThis,e$4=t$2.ShadowRoot&&(void 0===t$2.ShadyCSS||t$2.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$3=Symbol(),o$5=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$3)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$4&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$5.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$5.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$3("string"==typeof t?t:t+"",void 0,s$3),i$5=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n$3(o,t,s$3)},S$1=(s,o)=>{if(e$4)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$2.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$4?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
47
+
48
+ /**
49
+ * @license
50
+ * Copyright 2017 Google LLC
51
+ * SPDX-License-Identifier: BSD-3-Clause
52
+ */const{is:i$4,defineProperty:e$3,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$4,getPrototypeOf:n$2}=Object,a$2=globalThis,c$1=a$2.trustedTypes,l$2=c$1?c$1.emptyScript:"",p$1=a$2.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$2={toAttribute(t,s){switch(s){case Boolean:t=t?l$2:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$4(t,s),b={attribute:true,type:String,converter:u$2,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$2.litPropertyMetadata??=new WeakMap;let y$1 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$3(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$1(t),...o$4(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$2).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$2;this._$Em=e,this[e]=h.fromAttribute(s,t.type)??this._$Ej?.get(e)??null,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$1("elementProperties")]=new Map,y$1[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y$1}),(a$2.reactiveElementVersions??=[]).push("2.1.0");
53
+
54
+ /**
55
+ * @license
56
+ * Copyright 2017 Google LLC
57
+ * SPDX-License-Identifier: BSD-3-Clause
58
+ */
59
+ const t$1=globalThis,i$3=t$1.trustedTypes,s$2=i$3?i$3.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$2="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$3="?"+h,n$1=`<${o$3}>`,r=document,l$1=()=>r.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a$1=Array.isArray,u$1=t=>a$1(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a$1(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$2?s$2.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n$1:d>=0?(o.push(a),s.slice(0,d)+e$2+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e$2)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H:"?"===e[1]?I:"@"===e[1]?L:k}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i$3?i$3.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l$1()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l$1());}}}else if(8===r.nodeType)if(r.data===o$3)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r.createElement("template");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r).importNode(i,true);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.currentNode=r,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u$1(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a$1(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l$1()),this.O(l$1()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(false,true,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class H extends k{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}}class I extends k{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t);}}const j=t$1.litHtmlPolyfillSupport;j?.(N,R),(t$1.litHtmlVersions??=[]).push("3.3.0");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l$1(),t),t,void 0,s??{});}return h._$AI(t),h};
60
+
61
+ /**
62
+ * @license
63
+ * Copyright 2017 Google LLC
64
+ * SPDX-License-Identifier: BSD-3-Clause
65
+ */const s$1=globalThis;let i$2 = class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return T}};i$2._$litElement$=true,i$2["finalized"]=true,s$1.litElementHydrateSupport?.({LitElement:i$2});const o$2=s$1.litElementPolyfillSupport;o$2?.({LitElement:i$2});(s$1.litElementVersions??=[]).push("4.2.0");
66
+
67
+ var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:inline-block;width:100%;margin:0;padding:0;vertical-align:middle}:host ::slotted(auro-menuoption),:host ::slotted([auro-menuoption]),:host auro-menuoption[loadingplaceholder]{padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem))}:host ::slotted([selected]){padding-left:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host([nocheckmark]) ::slotted(auro-menuoption),:host([nocheckmark]) auro-menuoption[loadingplaceholder]{padding-left:var(--ds-size-200, 1rem)}:host([root]){overflow-y:auto}[loadingplaceholder].empty{opacity:0;position:absolute}[loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;line-height:1;display:inline-block}[loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}`;
68
+
69
+ var colorCss$2 = i$5`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-divider-color)}[loadingplaceholder] slot[name=loadingIcon]{color:var(--ds-auro-menu-loader-color)}[loadingplaceholder] slot[name=loadingText]{color:var(--ds-auro-menu-loader-text-color)}`;
70
+
71
+ var tokensCss$1 = i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
72
+
73
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
74
+ // See LICENSE in the project root for license information.
75
+
76
+ // ---------------------------------------------------------------------
77
+
78
+ /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
79
+
80
+ class AuroLibraryRuntimeUtils {
81
+
82
+ /* eslint-disable jsdoc/require-param */
83
+
84
+ /**
85
+ * This will register a new custom element with the browser.
86
+ * @param {String} name - The name of the custom element.
87
+ * @param {Object} componentClass - The class to register as a custom element.
88
+ * @returns {void}
89
+ */
90
+ registerComponent(name, componentClass) {
91
+ if (!customElements.get(name)) {
92
+ customElements.define(name, class extends componentClass {});
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Finds and returns the closest HTML Element based on a selector.
98
+ * @returns {void}
99
+ */
100
+ closestElement(
101
+ selector, // selector like in .closest()
102
+ base = this, // extra functionality to skip a parent
103
+ __Closest = (el, found = el && el.closest(selector)) =>
104
+ !el || el === document || el === window
105
+ ? null // standard .closest() returns null for non-found selectors also
106
+ : found
107
+ ? found // found a selector INside this element
108
+ : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
109
+ ) {
110
+ return __Closest(base);
111
+ }
112
+ /* eslint-enable jsdoc/require-param */
113
+
114
+ /**
115
+ * If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
116
+ * @param {Object} elem - The element to check.
117
+ * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
118
+ * @returns {void}
119
+ */
120
+ handleComponentTagRename(elem, tagName) {
121
+ const tag = tagName.toLowerCase();
122
+ const elemTag = elem.tagName.toLowerCase();
123
+
124
+ if (elemTag !== tag) {
125
+ elem.setAttribute(tag, true);
126
+ }
127
+ }
128
+
129
+ /**
130
+ * Validates if an element is a specific Auro component.
131
+ * @param {Object} elem - The element to validate.
132
+ * @param {String} tagName - The name of the Auro component to check against.
133
+ * @returns {Boolean} - Returns true if the element is the specified Auro component.
134
+ */
135
+ elementMatch(elem, tagName) {
136
+ const tag = tagName.toLowerCase();
137
+ const elemTag = elem.tagName.toLowerCase();
138
+
139
+ return elemTag === tag || elem.hasAttribute(tag);
140
+ }
141
+ }
142
+
143
+ // Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
144
+ // See LICENSE in the project root for license information.
145
+
146
+ // ---------------------------------------------------------------------
147
+
148
+ /**
149
+ * Converts value to an array.
150
+ * If the value is a JSON string representing an array, it will be parsed.
151
+ * If the value is already an array, it is returned.
152
+ * If the value is undefined, it returns undefined.
153
+ * @private
154
+ * @param {any} value - The value to be converted. Can be a string, array, or undefined.
155
+ * @returns {Array|undefined} - The converted array or undefined.
156
+ * @throws {Error} - Throws an error if the value is not an array, undefined,
157
+ * or if the value cannot be parsed into an array from a JSON string.
158
+ */
159
+ function arrayConverter(value) {
160
+ // Allow undefined
161
+ if (value === undefined) {
162
+ return undefined;
163
+ }
164
+
165
+ // Return the value if it is already an array
166
+ if (Array.isArray(value)) {
167
+ return value;
168
+ }
169
+
170
+ try {
171
+ // If value is a JSON string, parse it
172
+ const parsed = typeof value === 'string' ? JSON.parse(value) : value;
173
+
174
+ // Check if the parsed value is an array
175
+ if (Array.isArray(parsed)) {
176
+ return parsed;
177
+ }
178
+ } catch (error) {
179
+ // If JSON parsing fails, continue to throw an error below
180
+ /* eslint-disable no-console */
181
+ console.error('JSON parsing failed:', error);
182
+ }
183
+
184
+ // Throw error if the input is not an array or undefined
185
+ throw new Error('Invalid value: Input must be an array or undefined');
186
+ }
187
+
188
+ /**
189
+ * Compare two arrays for equality.
190
+ * @private
191
+ * @param {Array} arr1 - First array to compare.
192
+ * @param {Array} arr2 - Second array to compare.
193
+ * @returns {boolean} True if arrays are equal.
194
+ */
195
+ function arraysAreEqual(arr1, arr2) {
196
+ // If both arrays undefined, they are equal (true)
197
+ if (arr1 === undefined || arr2 === undefined) {
198
+ return arr1 === arr2;
199
+ }
200
+
201
+ // If arrays have different lengths, they are not equal
202
+ if (arr1.length !== arr2.length) {
203
+ return false;
204
+ }
205
+
206
+ // If every item at each index is the same, return true
207
+ for (let index = 0; index < arr1.length; index += 1) {
208
+ if (arr1[index] !== arr2[index]) {
209
+ return false;
210
+ }
211
+ }
212
+ return true;
213
+ }
214
+
215
+ /**
216
+ * Compares array for changes.
217
+ * @private
218
+ * @param {Array|any} newVal - New value to compare.
219
+ * @param {Array|any} oldVal - Old value to compare.
220
+ * @returns {boolean} True if arrays have changed.
221
+ */
222
+ function arrayOrUndefinedHasChanged(newVal, oldVal) {
223
+ try {
224
+ // Check if values are undefined or arrays
225
+ const isArrayOrUndefined = (val) => val === undefined || Array.isArray(val);
226
+
227
+ // If non-array or non-undefined, throw error
228
+ if (!isArrayOrUndefined(newVal) || !isArrayOrUndefined(oldVal)) {
229
+ const invalidValue = isArrayOrUndefined(newVal) ? oldVal : newVal;
230
+ throw new Error(`Value must be an array or undefined, received ${typeof invalidValue}`);
231
+ }
232
+
233
+ // Return true if arrays have changed, false if they are the same
234
+ return !arraysAreEqual(newVal, oldVal);
235
+ } catch (error) {
236
+ /* eslint-disable no-console */
237
+ console.error(error);
238
+ // If validation fails, it has changed
239
+ return true;
240
+ }
241
+ }
242
+
243
+ /**
244
+ * Validates if an option can be interacted with.
245
+ * @private
246
+ * @param {HTMLElement} option - The option to check.
247
+ * @returns {boolean} True if option is interactive.
248
+ */
249
+ function isOptionInteractive(option) {
250
+ return !option.hasAttribute('hidden') &&
251
+ !option.hasAttribute('disabled') &&
252
+ !option.hasAttribute('static');
253
+ }
254
+
255
+ /**
256
+ * Helper method to dispatch custom events.
257
+ * @param {HTMLElement} element - Element to dispatch event from.
258
+ * @param {string} eventName - Name of the event to dispatch.
259
+ * @param {Object} [detail] - Optional detail object to include with the event.
260
+ */
261
+ function dispatchMenuEvent(element, eventName, detail = null) {
262
+ const eventConfig = {
263
+ bubbles: true,
264
+ cancelable: false,
265
+ composed: true
266
+ };
267
+
268
+ if (detail !== null) {
269
+ eventConfig.detail = detail;
270
+ }
271
+
272
+ element.dispatchEvent(new CustomEvent(eventName, eventConfig));
273
+ }
274
+
275
+ // Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
276
+ // See LICENSE in the project root for license information.
277
+
278
+
279
+
280
+ // See https://git.io/JJ6SJ for "How to document your components using JSDoc"
281
+ /**
282
+ * The auro-menu element provides users a way to select from a list of options.
283
+ * @attr {Array<HTMLElement>|undefined} optionSelected - An array of currently selected menu options. In single-select mode, the array will contain only one HTMLElement. `undefined` when no options are selected.
284
+ * @attr {object} optionactive - Specifies the current active menuOption.
285
+ * @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
286
+ * @attr {boolean} disabled - When true, the entire menu and all options are disabled;
287
+ * @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
288
+ * @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
289
+ * @attr {boolean} multiselect - When true, the selected option can be multiple options.
290
+ * @attr {Array<string>|undefined} value - Value selected for the menu. `undefined` when no selection has been made, otherwise an array of strings. In single-select mode, the array will contain only one value.
291
+ * @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
292
+ * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
293
+ * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
294
+ * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
295
+ * @event {CustomEvent<any>} auroMenu-selectValueFailure - Notifies that an attempt to select a menuoption by matching a value has failed.
296
+ * @event {CustomEvent<any>} auroMenu-selectValueReset - Notifies that the component value has been reset.
297
+ * @event {CustomEvent<any>} auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
298
+ * @slot loadingText - Text to show while loading attribute is set
299
+ * @slot loadingIcon - Icon to show while loading attribute is set
300
+ * @slot - Slot for insertion of menu options.
301
+ */
302
+
303
+ /* eslint-disable no-magic-numbers, max-lines */
304
+
305
+ class AuroMenu extends i$2 {
306
+ constructor() {
307
+ super();
308
+
309
+ // State properties (reactive)
310
+
311
+ // Value of the selected options
312
+ this.value = undefined;
313
+ // Currently selected option
314
+ this.optionSelected = undefined;
315
+ // String used for highlighting/filtering
316
+ this.matchWord = undefined;
317
+ // Hide the checkmark icon on selected options
318
+ this.noCheckmark = false;
319
+ // Currently active option
320
+ this.optionActive = undefined;
321
+ // Loading state
322
+ this.loading = false;
323
+ // Multi-select mode
324
+ this.multiSelect = false;
325
+
326
+ // Event Bindings
327
+
328
+ /**
329
+ * @private
330
+ */
331
+ this.handleKeyDown = this.handleKeyDown.bind(this);
332
+
333
+ /**
334
+ * @private
335
+ */
336
+ this.handleMouseSelect = this.handleMouseSelect.bind(this);
337
+
338
+ /**
339
+ * @private
340
+ */
341
+ this.handleOptionHover = this.handleOptionHover.bind(this);
342
+
343
+ /**
344
+ * @private
345
+ */
346
+ this.handleSlotChange = this.handleSlotChange.bind(this);
347
+
348
+ // Instance properties (non-reactive)
349
+
350
+ /**
351
+ * @private
352
+ */
353
+ Object.assign(this, {
354
+ // Root-level menu (true) or a nested submenu (false)
355
+ rootMenu: true,
356
+ // Currently focused/active menu item index
357
+ index: -1,
358
+ // Nested menu spacer
359
+ nestingSpacer: '<span class="nestingSpacer"></span>',
360
+ // Loading indicator for slot elements
361
+ loadingSlots: null,
362
+ // Store for menu items
363
+ items: [],
364
+ });
365
+ }
366
+
367
+ static get properties() {
368
+ return {
369
+ noCheckmark: {
370
+ type: Boolean,
371
+ reflect: true,
372
+ attribute: 'nocheckmark'
373
+ },
374
+ disabled: {
375
+ type: Boolean,
376
+ reflect: true
377
+ },
378
+ loading: {
379
+ type: Boolean,
380
+ reflect: true
381
+ },
382
+ optionSelected: {
383
+ // Allow HTMLElement[] arrays and undefined
384
+ converter: arrayConverter,
385
+ hasChanged: arrayOrUndefinedHasChanged
386
+ },
387
+ optionActive: {
388
+ type: Object,
389
+ attribute: 'optionactive'
390
+ },
391
+ matchWord: {
392
+ type: String,
393
+ attribute: 'matchword'
394
+ },
395
+ multiSelect: {
396
+ type: Boolean,
397
+ reflect: true,
398
+ attribute: 'multiselect'
399
+ },
400
+ value: {
401
+ // Allow string[] arrays and undefined
402
+ type: Object,
403
+ converter: arrayConverter,
404
+ hasChanged: arrayOrUndefinedHasChanged
405
+ }
406
+ };
407
+ }
408
+
409
+ static get styles() {
410
+ return [
411
+ styleCss$2,
412
+ colorCss$2,
413
+ tokensCss$1
414
+ ];
415
+ }
416
+
417
+ /**
418
+ * This will register this element with the browser.
419
+ * @param {string} [name="auro-menu"] - The name of element that you want to register to.
420
+ *
421
+ * @example
422
+ * AuroMenu.register("custom-menu") // this will register this element to <custom-menu/>
423
+ *
424
+ */
425
+ static register(name = "auro-menu") {
426
+ AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenu);
427
+ }
428
+
429
+ // Lifecycle Methods
430
+
431
+ connectedCallback() {
432
+ super.connectedCallback();
433
+
434
+ this.addEventListener('keydown', this.handleKeyDown);
435
+ this.addEventListener('mousedown', this.handleMouseSelect);
436
+ this.addEventListener('auroMenuOption-mouseover', this.handleOptionHover);
437
+ this.addEventListener('slotchange', this.handleSlotChange);
438
+ }
439
+
440
+ disconnectedCallback() {
441
+ this.removeEventListener('keydown', this.handleKeyDown);
442
+ this.removeEventListener('mousedown', this.handleMouseSelect);
443
+ this.removeEventListener('auroMenuOption-mouseover', this.handleOptionHover);
444
+ this.removeEventListener('slotchange', this.handleSlotChange);
445
+
446
+ super.disconnectedCallback();
447
+ }
448
+
449
+ firstUpdated() {
450
+ AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-menu');
451
+
452
+ this.loadingSlots = this.querySelectorAll("[slot='loadingText'], [slot='loadingIcon']");
453
+ this.initializeMenu();
454
+ }
455
+
456
+ updated(changedProperties) {
457
+ if (changedProperties.has('value')) {
458
+ // Handle null/undefined case
459
+ if (this.value === undefined || this.value === null) {
460
+ this.optionSelected = undefined;
461
+ // Reset index tracking
462
+ this.index = -1;
463
+ } else {
464
+ // Convert single values to arrays
465
+ const valueArray = Array.isArray(this.value) ? this.value : [this.value];
466
+
467
+ // Find all matching options
468
+ const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
469
+
470
+ if (matchingOptions.length > 0) {
471
+ if (this.multiSelect) {
472
+ // For multiselect, keep all matching options
473
+ this.optionSelected = matchingOptions;
474
+ } else {
475
+ // For single select, only use the first match
476
+ this.optionSelected = [matchingOptions[0]];
477
+ this.index = this.items.indexOf(matchingOptions[0]);
478
+ }
479
+ } else {
480
+ // No matches found - trigger failure event
481
+ dispatchMenuEvent(this, 'auroMenu-selectValueFailure');
482
+ this.optionSelected = undefined;
483
+ this.index = -1;
484
+ }
485
+ }
486
+
487
+ // Update UI state
488
+ this.updateItemsState(new Map([
489
+ [
490
+ 'optionSelected',
491
+ true
492
+ ]
493
+ ]));
494
+
495
+ // Notify of changes
496
+ if (this.optionSelected !== undefined) {
497
+ this.notifySelectionChange();
498
+ }
499
+ }
500
+
501
+ // Process all other UI updates
502
+ this.updateItemsState(changedProperties);
503
+ }
504
+
505
+ /**
506
+ * Updates the UI state and appearance of menu items based on changed properties.
507
+ * @private
508
+ * @param {Map<string, boolean>} changedProperties - LitElement's changed properties map.
509
+ */
510
+ updateItemsState(changedProperties) {
511
+ if (!this.items) {
512
+ return;
513
+ }
514
+
515
+ // Handle noCheckmark propagation to all menus and options
516
+ if (changedProperties.has('noCheckmark') && this.noCheckmark) {
517
+ // Update both menus and options
518
+ this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]').forEach((element) => element.setAttribute('noCheckmark', ''));
519
+ }
520
+
521
+ // Regex for matchWord if needed
522
+ let regexWord = null;
523
+
524
+ if (changedProperties.has('matchWord') && this.matchWord && this.matchWord.length) {
525
+ const escapedWord = this.matchWord.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
526
+ regexWord = new RegExp(escapedWord, 'giu');
527
+ }
528
+
529
+ // Handle direct item updates
530
+ this.items.forEach((option) => {
531
+ // Update selection if option or value changed
532
+ if (changedProperties.has('optionSelected') || changedProperties.has('value')) {
533
+ const isSelected = this.isOptionSelected(option);
534
+ option.setAttribute('aria-selected', isSelected ? 'true' : 'false');
535
+
536
+ // Add/remove selected attribute based on state
537
+ if (isSelected) {
538
+ option.setAttribute('selected', '');
539
+ } else {
540
+ option.removeAttribute('selected');
541
+ }
542
+ }
543
+
544
+ // Update text highlighting if matchWord changed
545
+ if (changedProperties.has('matchWord') && regexWord &&
546
+ isOptionInteractive(option) && !option.hasAttribute('persistent')) {
547
+ const nested = option.querySelectorAll('.nestingSpacer');
548
+ // Create nested spacers
549
+ const nestingSpacerBundle = [...nested].map(() => this.nestingSpacer).join('');
550
+
551
+ // Update with spacers and matchWord
552
+ option.innerHTML = nestingSpacerBundle +
553
+ option.textContent.replace(
554
+ regexWord,
555
+ (match) => `<strong>${match}</strong>`
556
+ );
557
+ }
558
+
559
+ // Update disabled state
560
+ if (changedProperties.has('disabled')) {
561
+ option.disabled = this.disabled;
562
+ }
563
+ });
564
+
565
+ // Handle loading state changes
566
+ if (changedProperties.has('loading')) {
567
+ this.setAttribute("aria-busy", this.loading);
568
+ dispatchMenuEvent(this, "auroMenu-loadingChange", {
569
+ loading: this.loading,
570
+ hasLoadingPlaceholder: this.hasLoadingPlaceholder
571
+ });
572
+ }
573
+ }
574
+
575
+ // Init Methods
576
+
577
+ /**
578
+ * Initializes the menu's state and structure.
579
+ * @private
580
+ */
581
+ initializeMenu() {
582
+ this.initItems();
583
+ if (this.rootMenu) {
584
+ this.setAttribute('role', 'listbox');
585
+ this.setAttribute('root', '');
586
+ this.handleNestedMenus(this);
587
+ }
588
+ }
589
+
590
+ /**
591
+ * Initializes menu items and their attributes.
592
+ * @private
593
+ */
594
+ initItems() {
595
+ this.items = Array.from(this.querySelectorAll('auro-menuoption, [auro-menuoption]'));
596
+ if (this.noCheckmark) {
597
+ this.updateItemsState(new Map([
598
+ [
599
+ 'noCheckmark',
600
+ true
601
+ ]
602
+ ]));
603
+ }
604
+ }
605
+
606
+ // Logic Methods
607
+
608
+ /**
609
+ * Updates menu state when an option is selected.
610
+ * @private
611
+ * @param {HTMLElement} option - The option element to select.
612
+ */
613
+ handleSelectState(option) {
614
+ if (this.multiSelect) {
615
+ const currentValue = this.value || [];
616
+ const currentSelected = this.optionSelected || [];
617
+
618
+ if (!currentValue.includes(option.value)) {
619
+ this.value = [
620
+ ...currentValue,
621
+ option.value
622
+ ];
623
+ }
624
+ if (!currentSelected.includes(option)) {
625
+ this.optionSelected = [
626
+ ...currentSelected,
627
+ option
628
+ ];
629
+ }
630
+ } else {
631
+ // Single select - use arrays with single values
632
+ this.value = [option.value];
633
+ this.optionSelected = [option];
634
+ }
635
+
636
+ this.index = this.items.indexOf(option);
637
+ }
638
+
639
+ /**
640
+ * Deselects a menu option and updates related state.
641
+ * @private
642
+ * @param {HTMLElement} option - The menuoption to be deselected.
643
+ */
644
+ handleDeselectState(option) {
645
+ if (this.multiSelect && Array.isArray(this.value)) {
646
+ // Remove this option from array
647
+ this.value = this.value.filter((val) => val !== option.value);
648
+
649
+ // If array is empty after removal, set back to undefined
650
+ if (this.value.length === 0) {
651
+ this.value = undefined;
652
+ }
653
+
654
+ this.optionSelected = this.optionSelected.filter((val) => val !== option);
655
+ if (this.optionSelected.length === 0) {
656
+ this.optionSelected = undefined;
657
+ }
658
+ } else {
659
+ // For single-select: Back to undefined when deselected
660
+ this.value = undefined;
661
+ this.optionSelected = undefined;
662
+ }
663
+
664
+ // Update the index tracking
665
+ this.index = this.items.indexOf(option);
666
+
667
+ // Update UI to reflect changes
668
+ this.updateItemsState(new Map([
669
+ [
670
+ 'optionSelected',
671
+ true
672
+ ]
673
+ ]));
674
+
675
+ // Notify of selection change
676
+ this.notifySelectionChange();
677
+ }
678
+
679
+ /**
680
+ * Resets all options to their default state.
681
+ * @private
682
+ */
683
+ clearSelection() {
684
+ this.optionSelected = undefined;
685
+ this.value = undefined;
686
+ }
687
+
688
+ /**
689
+ * Resets the menu to its initial state.
690
+ * This is the only way to return value to undefined.
691
+ * @public
692
+ */
693
+ reset() {
694
+ // Reset to undefined - initial state
695
+ this.value = undefined;
696
+ this.optionSelected = undefined;
697
+ this.index = -1;
698
+
699
+ // Reset UI state
700
+ this.updateItemsState(new Map([
701
+ [
702
+ 'optionSelected',
703
+ true
704
+ ]
705
+ ]));
706
+
707
+ // Dispatch reset event
708
+ dispatchMenuEvent(this, 'auroMenu-selectValueReset');
709
+ }
710
+
711
+ /**
712
+ * Handles nested menu structure.
713
+ * @private
714
+ * @param {HTMLElement} menu - Root menu element.
715
+ */
716
+ handleNestedMenus(menu) {
717
+ const nestedMenus = menu.querySelectorAll('auro-menu, [auro-menu]');
718
+
719
+ nestedMenus.forEach((nestedMenu) => {
720
+ // role="listbox" only allows "role=group" for children.
721
+ nestedMenu.setAttribute('role', 'group');
722
+ if (!nestedMenu.hasAttribute('aria-label')) {
723
+ nestedMenu.setAttribute('aria-label', 'submenu');
724
+ }
725
+
726
+ const options = nestedMenu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption]');
727
+ options.forEach((option) => {
728
+ option.innerHTML = this.nestingSpacer + option.innerHTML;
729
+ });
730
+
731
+ this.handleNestedMenus(nestedMenu);
732
+ });
733
+ }
734
+
735
+ // Event Handlers
736
+
737
+ /**
738
+ * Handles keyboard navigation.
739
+ * @private
740
+ * @param {KeyboardEvent} event - Event object from the browser.
741
+ */
742
+ handleKeyDown(event) {
743
+ event.preventDefault();
744
+ switch (event.key) {
745
+ case "ArrowDown":
746
+ this.navigateOptions('down');
747
+ break;
748
+ case "ArrowUp":
749
+ this.navigateOptions('up');
750
+ break;
751
+ case "Enter":
752
+ this.makeSelection();
753
+ break;
754
+ }
755
+ }
756
+
757
+ /**
758
+ * Makes a selection based on the current index or clicked option.
759
+ * @private
760
+ */
761
+ makeSelection() {
762
+ if (!this.items) {
763
+ this.initItems();
764
+ }
765
+
766
+ // Get currently selected menu option based on index
767
+ const option = this.items[this.index];
768
+
769
+ // Return early if option is not interactive
770
+ if (!option || !isOptionInteractive(option)) {
771
+ return;
772
+ }
773
+
774
+ // Handle custom events first
775
+ if (option.hasAttribute('event')) {
776
+ this.handleCustomEvent(option);
777
+ return;
778
+ }
779
+
780
+ if (this.multiSelect) {
781
+ // In multiselect, toggle individual selections
782
+ this.toggleOption(option);
783
+ // In single select, only handle selection of new options
784
+ } else if (!this.isOptionSelected(option)) {
785
+ this.clearSelection();
786
+ this.handleSelectState(option);
787
+ }
788
+
789
+ this.notifySelectionChange();
790
+ }
791
+
792
+ /**
793
+ * Toggle the selection state of the menuoption.
794
+ * @private
795
+ * @param {HTMLElement} option - The menuoption to toggle.
796
+ */
797
+ toggleOption(option) {
798
+ const isCurrentlySelected = this.isOptionSelected(option);
799
+
800
+ if (isCurrentlySelected) {
801
+ this.handleDeselectState(option);
802
+ } else if (option.value === undefined || option.value === '') {
803
+ dispatchMenuEvent(this, 'auroMenu-selectValueFailure');
804
+ } else {
805
+ this.handleSelectState(option);
806
+ }
807
+ }
808
+
809
+ /**
810
+ * Handles option selection via mouse.
811
+ * @private
812
+ * @param {MouseEvent} event - Event object from the browser.
813
+ */
814
+ handleMouseSelect(event) {
815
+ if (event.target === this) {
816
+ return;
817
+ }
818
+
819
+ const option = event.target.closest('auro-menuoption, [auro-menuoption]');
820
+ if (option) {
821
+ this.index = this.items.indexOf(option);
822
+ this.makeSelection();
823
+ }
824
+ }
825
+
826
+ /**
827
+ * Handles option hover events.
828
+ * @private
829
+ * @param {CustomEvent} event - Event object from the browser.
830
+ */
831
+ handleOptionHover(event) {
832
+ const option = event.target;
833
+ this.index = this.items.indexOf(option);
834
+ this.updateActiveOption(this.index);
835
+ }
836
+
837
+ /**
838
+ * Handles slot change events.
839
+ * @private
840
+ */
841
+ handleSlotChange() {
842
+ if (this.parentElement && this.parentElement.closest('auro-menu, [auro-menu]')) {
843
+ this.rootMenu = false;
844
+ }
845
+
846
+ if (this.rootMenu) {
847
+ this.initializeMenu();
848
+ } else if (this.noCheckmark) {
849
+ this.updateItemsState(new Map([
850
+ [
851
+ 'noCheckmark',
852
+ true
853
+ ]
854
+ ]));
855
+ }
856
+ }
857
+
858
+ /**
859
+ * Navigates through options using keyboard.
860
+ * @private
861
+ * @param {string} direction - 'up' or 'down'.
862
+ */
863
+ navigateOptions(direction) {
864
+ // Return early if no items exist
865
+ if (!this.items || !this.items.length) {
866
+ return;
867
+ }
868
+
869
+ let newIndex = this.index;
870
+ const increment = direction === 'down' ? 1 : -1;
871
+ const maxIterations = this.items.length;
872
+ let iterations = 0;
873
+ let foundInteractiveOption = false;
874
+
875
+ do {
876
+ newIndex = (newIndex + increment + this.items.length) % this.items.length;
877
+ iterations += 1;
878
+
879
+ // Check if current option is interactive
880
+ const currentOption = this.items[newIndex];
881
+ if (isOptionInteractive(currentOption)) {
882
+ foundInteractiveOption = true;
883
+ break;
884
+ }
885
+
886
+ // Break if all options were checked
887
+ if (iterations >= maxIterations) {
888
+ break;
889
+ }
890
+ } while (iterations < maxIterations);
891
+
892
+ // Handle the results of the search
893
+ if (foundInteractiveOption) {
894
+ // Update only if an interactive option was found
895
+ this.index = newIndex;
896
+ this.updateActiveOption(this.index);
897
+ } else {
898
+ // All options are disabled or non-interactive
899
+ // Keep the current index unchanged
900
+ dispatchMenuEvent(this, 'auroMenu-navigateFailure', {
901
+ reason: 'No interactive options available',
902
+ direction,
903
+ currentIndex: this.index
904
+ });
905
+ }
906
+ }
907
+
908
+ /**
909
+ * Updates the active option state and dispatches events.
910
+ * @private
911
+ * @param {number} index - Index of the option to make active.
912
+ */
913
+ updateActiveOption(index) {
914
+ if (!this.items || !this.items[index]) {
915
+ return;
916
+ }
917
+
918
+ this.items.forEach((item) => item.classList.remove('active'));
919
+ this.items[index].classList.add('active');
920
+ this.optionActive = this.items[index];
921
+ this.index = index;
922
+
923
+ dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
924
+ }
925
+
926
+ /**
927
+ * Handles custom events defined on options.
928
+ * @private
929
+ * @param {HTMLElement} option - Option with custom event.
930
+ */
931
+ handleCustomEvent(option) {
932
+ const eventName = option.getAttribute('event');
933
+ dispatchMenuEvent(this, eventName);
934
+ dispatchMenuEvent(this, 'auroMenu-customEventFired');
935
+ }
936
+
937
+ /**
938
+ * Notifies selection change to parent components.
939
+ * @private
940
+ */
941
+ notifySelectionChange() {
942
+ dispatchMenuEvent(this, 'auroMenu-selectedOption');
943
+ }
944
+
945
+ /**
946
+ * Checks if an option is currently selected.
947
+ * @private
948
+ * @param {HTMLElement} option - The option to check.
949
+ * @returns {boolean}
950
+ */
951
+ isOptionSelected(option) {
952
+ if (!this.optionSelected) {
953
+ return false;
954
+ }
955
+ // Always treat as array for both single and multi-select
956
+ return Array.isArray(this.optionSelected) && this.optionSelected.includes(option);
957
+ }
958
+
959
+ /**
960
+ * Getter for loading placeholder state.
961
+ * @returns {boolean} - True if loading slots are present and non-empty.
962
+ */
963
+ get hasLoadingPlaceholder() {
964
+ return this.loadingSlots && this.loadingSlots.length > 0;
965
+ }
966
+
967
+ /**
968
+ * Renders the component.
969
+ * @returns {boolean} - True if loading slots are present and non-empty.
970
+ */
971
+ render() {
972
+ if (this.loading) {
973
+ return x`
974
+ <auro-menuoption disabled loadingplaceholder class="${this.hasLoadingPlaceholder ? '' : 'empty'}">
975
+ <div>
976
+ <slot name="loadingIcon"></slot>
977
+ <slot name="loadingText"></slot>
978
+ </div>
979
+ </auro-menuoption>
980
+ `;
981
+ }
982
+
983
+ return x`<slot @slotchange=${this.handleSlotChange}></slot>`;
984
+ }
985
+ }
986
+
987
+ /**
988
+ * @license
989
+ * Copyright 2020 Google LLC
990
+ * SPDX-License-Identifier: BSD-3-Clause
991
+ */
992
+ const a=Symbol.for(""),o$1=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litStatic$:t,r:a}),i$1=(t,...r)=>({_$litStatic$:r.reduce(((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[a+1]),t[0]),r:a}),l=new Map,n=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=false;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o$1(i));)c+=s+r[++$],f=true;$!==a&&u.push(i),n.push(c),$++;}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l.get(t))&&(n.raw=n,l.set(t,r=n)),e=u;}return t(r,...e)},u=n(x);
993
+
994
+ var styleCss$1 = i$5`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-200, 1rem) var(--ds-size-50, 0.25rem) 0;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
995
+
996
+ var colorCss$1 = i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
997
+
998
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
999
+ // See LICENSE in the project root for license information.
1000
+
1001
+
1002
+ class AuroDependencyVersioning {
1003
+
1004
+ /**
1005
+ * Generates a unique string to be used for child auro element naming.
1006
+ * @private
1007
+ * @param {string} baseName - Defines the first part of the unique element name.
1008
+ * @param {string} version - Version of the component that will be appended to the baseName.
1009
+ * @returns {string} - Unique string to be used for naming.
1010
+ */
1011
+ generateElementName(baseName, version) {
1012
+ let result = baseName;
1013
+
1014
+ result += '-';
1015
+ result += version.replace(/[.]/g, '_');
1016
+
1017
+ return result;
1018
+ }
1019
+
1020
+ /**
1021
+ * Generates a unique string to be used for child auro element naming.
1022
+ * @param {string} baseName - Defines the first part of the unique element name.
1023
+ * @param {string} version - Version of the component that will be appended to the baseName.
1024
+ * @returns {string} - Unique string to be used for naming.
1025
+ */
1026
+ generateTag(baseName, version, tagClass) {
1027
+ const elementName = this.generateElementName(baseName, version);
1028
+ const tag = i$1`${s(elementName)}`;
1029
+
1030
+ if (!customElements.get(elementName)) {
1031
+ customElements.define(elementName, class extends tagClass {});
1032
+ }
1033
+
1034
+ return tag;
1035
+ }
1036
+ }
1037
+
1038
+ /**
1039
+ * @license
1040
+ * Copyright 2017 Google LLC
1041
+ * SPDX-License-Identifier: BSD-3-Clause
1042
+ */
1043
+ const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
1044
+
1045
+ /**
1046
+ * @license
1047
+ * Copyright 2018 Google LLC
1048
+ * SPDX-License-Identifier: BSD-3-Clause
1049
+ */const e=e$1(class extends i{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return T}});
1050
+
1051
+ /**
1052
+ * @license
1053
+ * Copyright 2018 Google LLC
1054
+ * SPDX-License-Identifier: BSD-3-Clause
1055
+ */const o=o=>o??E;
1056
+
1057
+ // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1058
+ // See LICENSE in the project root for license information.
1059
+
1060
+
1061
+ /**
1062
+ * @attr {Boolean} hidden - If present, the component will be hidden both visually and from screen readers
1063
+ * @attr {Boolean} hiddenVisually - If present, the component will be hidden visually, but still read by screen readers
1064
+ * @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
1065
+ */
1066
+
1067
+ class AuroElement extends i$2 {
1068
+
1069
+ // function to define props used within the scope of this component
1070
+ static get properties() {
1071
+ return {
1072
+ hidden: { type: Boolean,
1073
+ reflect: true },
1074
+ hiddenVisually: { type: Boolean,
1075
+ reflect: true },
1076
+ hiddenAudible: { type: Boolean,
1077
+ reflect: true },
1078
+ };
1079
+ }
1080
+
1081
+ /**
1082
+ * @private Function that determines state of aria-hidden
1083
+ */
1084
+ hideAudible(value) {
1085
+ if (value) {
1086
+ return 'true'
1087
+ }
1088
+
1089
+ return 'false'
1090
+ }
1091
+ }
1092
+
1093
+ var error = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"error__desc\" class=\"ico_squareLarge\" data-deprecated=\"true\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><desc id=\"error__desc\">Error alert indicator.</desc><path d=\"m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583\"/></svg>"};
1094
+
1095
+ /* eslint-disable no-underscore-dangle, jsdoc/no-undefined-types, jsdoc/require-param-description */
1096
+
1097
+ const _fetchMap = new Map();
1098
+
1099
+ /**
1100
+ * A callback to parse Response body.
1101
+ *
1102
+ * @callback ResponseParser
1103
+ * @param {Fetch.Response} response
1104
+ * @returns {Promise}
1105
+ */
1106
+
1107
+ /**
1108
+ * A minimal in-memory map to de-duplicate Fetch API media requests.
1109
+ *
1110
+ * @param {String} uri
1111
+ * @param {Object} [options={}]
1112
+ * @param {ResponseParser} [options.responseParser=(response) => response.text()]
1113
+ * @returns {Promise}
1114
+ */
1115
+ const cacheFetch = (uri, options = {}) => {
1116
+ const responseParser = options.responseParser || ((response) => response.text());
1117
+ if (!_fetchMap.has(uri)) {
1118
+ _fetchMap.set(uri, fetch(uri).then(responseParser));
1119
+ }
1120
+ return _fetchMap.get(uri);
1121
+ };
1122
+
1123
+ var styleCss = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, 0.75rem))}:host{color:currentColor;vertical-align:middle;line-height:1;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem) !important;width:var(--ds-auro-icon-size, 1.5rem) !important;height:var(--ds-auro-icon-size, 1.5rem) !important}.componentWrapper{display:flex}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.labelWrapper{margin-left:var(--ds-size-50, 0.25rem);line-height:1.8}`;
1124
+
1125
+ // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1126
+ // See LICENSE in the project root for license information.
1127
+
1128
+
1129
+ // See https://git.io/JJ6SJ for "How to document your components using JSDoc"
1130
+ /**
1131
+ * @slot - Hidden from visibility, used for a11y if icon description is needed
1132
+ */
1133
+
1134
+ // build the component class
1135
+ class BaseIcon extends AuroElement {
1136
+ constructor() {
1137
+ super();
1138
+ this.onDark = false;
1139
+ }
1140
+
1141
+ // function to define props used within the scope of this component
1142
+ static get properties() {
1143
+ return {
1144
+ ...super.properties,
1145
+
1146
+ /**
1147
+ * Set value for on-dark version of auro-icon.
1148
+ */
1149
+ onDark: {
1150
+ type: Boolean,
1151
+ reflect: true
1152
+ },
1153
+
1154
+ /**
1155
+ * @private
1156
+ */
1157
+ svg: {
1158
+ attribute: false,
1159
+ reflect: true
1160
+ }
1161
+ };
1162
+ }
1163
+
1164
+ static get styles() {
1165
+ return i$5`
1166
+ ${styleCss}
1167
+ `;
1168
+ }
1169
+
1170
+ /**
1171
+ * Async function to fetch requested icon from npm CDN.
1172
+ * @private
1173
+ * @param {string} category - Icon category.
1174
+ * @param {string} name - Icon name.
1175
+ * @returns {SVGElement} DOM - Ready HTML to be appended.
1176
+ */
1177
+ async fetchIcon(category, name) {
1178
+ let iconHTML = '';
1179
+
1180
+ if (category === 'logos') {
1181
+ iconHTML = await cacheFetch(`${this.uri}/${category}/${name}.svg`);
1182
+ } else {
1183
+ iconHTML = await cacheFetch(`${this.uri}/icons/${category}/${name}.svg`);
1184
+ }
1185
+
1186
+ const dom = new DOMParser().parseFromString(iconHTML, 'text/html');
1187
+
1188
+ return dom.body.querySelector('svg');
1189
+ }
1190
+
1191
+ // lifecycle function
1192
+ async firstUpdated() {
1193
+ if (!this.customSvg) {
1194
+ const svg = await this.fetchIcon(this.category, this.name);
1195
+
1196
+ if (svg) {
1197
+ this.svg = svg;
1198
+ } else if (!svg) {
1199
+ const penDOM = new DOMParser().parseFromString(error.svg, 'text/html');
1200
+
1201
+ this.svg = penDOM.body.firstChild;
1202
+ }
1203
+ }
1204
+ }
1205
+ }
1206
+
1207
+ var tokensCss = i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color:#02426D;--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}`;
1208
+
1209
+ var colorCss = i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}`;
1210
+
1211
+ // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1212
+ // See LICENSE in the project root for license information.
1213
+
1214
+
1215
+ class AuroIcon extends BaseIcon {
1216
+ constructor() {
1217
+ super();
1218
+
1219
+ this.variant = undefined;
1220
+ this.privateDefaults();
1221
+ }
1222
+
1223
+ /**
1224
+ * Internal Defaults.
1225
+ * @private
1226
+ * @returns {void}
1227
+ */
1228
+ privateDefaults() {
1229
+ this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
1230
+ this.runtimeUtils = new AuroLibraryRuntimeUtils();
1231
+ }
1232
+
1233
+ // function to define props used within the scope of this component
1234
+ static get properties() {
1235
+ return {
1236
+ ...super.properties,
1237
+
1238
+ /**
1239
+ * Set aria-hidden value. Default is `true`. Option is `false`.
1240
+ */
1241
+ ariaHidden: {
1242
+ type: String,
1243
+ reflect: true
1244
+ },
1245
+
1246
+ /**
1247
+ * The category of the icon you are looking for. See https://auro.alaskaair.com/icons/usage.
1248
+ */
1249
+ category: {
1250
+ type: String,
1251
+ reflect: true
1252
+ },
1253
+
1254
+ /**
1255
+ * Allows custom color to be set.
1256
+ */
1257
+ customColor: {
1258
+ type: Boolean
1259
+ },
1260
+
1261
+ /**
1262
+ * When true, auro-icon will render a custom SVG inside the default slot.
1263
+ */
1264
+ customSvg: {
1265
+ type: Boolean
1266
+ },
1267
+
1268
+ /**
1269
+ * Exposes content in slot as icon label.
1270
+ */
1271
+ label: {
1272
+ type: Boolean,
1273
+ reflect: true
1274
+ },
1275
+
1276
+ /**
1277
+ * The name of the icon you are looking for without the file extension. See https://auro.alaskaair.com/icons/usage.
1278
+ */
1279
+ name: {
1280
+ type: String,
1281
+ reflect: true
1282
+ },
1283
+
1284
+ /**
1285
+ * The style of the icon. The accepted variants are `accent1`, `disabled`, `muted`, `statusDefault`, `statusInfo`, `statusSuccess`, `statusWarning`, `statusError`, `statusInfoSubtle`, `statusSuccessSubtle`, `statusWarningSubtle`, `statusErrorSubtle`, `fareBasicEconomy`, `fareBusiness`, `fareEconomy`, `fareFirst`, `farePremiumEconomy`, `tierOneWorldEmerald`, `tierOneWorldSapphire`, `tierOneWorldRuby`.
1286
+ */
1287
+ variant: {
1288
+ type: String,
1289
+ reflect: true
1290
+ }
1291
+ };
1292
+ }
1293
+
1294
+ static get styles() {
1295
+ return [
1296
+ super.styles,
1297
+ i$5`${tokensCss}`,
1298
+ i$5`${styleCss}`,
1299
+ i$5`${colorCss}`
1300
+ ];
1301
+ }
1302
+
1303
+ /**
1304
+ * This will register this element with the browser.
1305
+ * @param {string} [name="auro-icon"] - The name of element that you want to register to.
1306
+ *
1307
+ * @example
1308
+ * AuroIcon.register("custom-icon") // this will register this element to <custom-icon/>
1309
+ *
1310
+ */
1311
+ static register(name = "auro-icon") {
1312
+ AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroIcon);
1313
+ }
1314
+
1315
+ connectedCallback() {
1316
+ super.connectedCallback();
1317
+
1318
+ // Add the tag name as an attribute if it is different than the component name
1319
+ this.runtimeUtils.handleComponentTagRename(this, 'auro-icon');
1320
+ }
1321
+
1322
+ /**
1323
+ * @private
1324
+ * @returns {void} Exposes CSS parts for styling from parent components.
1325
+ */
1326
+ exposeCssParts() {
1327
+ this.setAttribute('exportparts', 'svg:iconSvg');
1328
+ }
1329
+
1330
+ async firstUpdated() {
1331
+ await super.firstUpdated();
1332
+
1333
+ // Removes the SVG description for screenreader if ariaHidden is set to true
1334
+ if (!this.hasAttribute('ariaHidden') && this.svg) {
1335
+ const svgDesc = this.svg.querySelector('desc');
1336
+
1337
+ if (svgDesc) {
1338
+ svgDesc.remove();
1339
+ this.svg.removeAttribute('aria-labelledby');
1340
+ }
1341
+ }
1342
+ }
1343
+
1344
+ // function that renders the HTML and CSS into the scope of the component
1345
+ render() {
1346
+ const labelClasses = {
1347
+ 'labelWrapper': true,
1348
+ 'util_displayHiddenVisually': !this.label
1349
+ };
1350
+
1351
+ const svgClasses = {
1352
+ 'svgWrapper': true,
1353
+ };
1354
+
1355
+ return x`
1356
+ <div class="componentWrapper">
1357
+ <div
1358
+ class="${e(svgClasses)}"
1359
+ title="${o(this.title || undefined)}">
1360
+ <span aria-hidden="${o(this.ariaHidden || true)}" part="svg">
1361
+ ${this.customSvg ? x`
1362
+ <slot name="svg"></slot>
1363
+ ` : x`
1364
+ ${this.svg}
1365
+ `
1366
+ }
1367
+ </span>
1368
+ </div>
1369
+
1370
+ <div class="${e(labelClasses)}">
1371
+ <slot></slot>
1372
+ </div>
1373
+ </div>
1374
+ `;
1375
+ }
1376
+ }
1377
+
1378
+ var iconVersion = '8.0.2';
1379
+
1380
+ var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"checkmark-sm__desc\" class=\"ico_squareLarge\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><desc id=\"checkmark-sm__desc\">a small check mark.</desc><path d=\"M8.461 11.84a.625.625 0 1 0-.922.844l2.504 2.738c.247.27.674.27.922 0l5.496-6a.625.625 0 1 0-.922-.844l-5.035 5.496z\"/></svg>"};
1381
+
1382
+ // Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1383
+ // See LICENSE in the project root for license information.
1384
+
1385
+
1386
+ /**
1387
+ * The auro-menu element provides users a way to define a menu option.
1388
+ *
1389
+ * @attr {String} value - Specifies the value to be sent to a server.
1390
+ * @attr {String} noCheckmark - When true, selected option will not show the checkmark.
1391
+ * @attr {Boolean} disabled - When true specifies that the menuoption is disabled.
1392
+ * @attr {Boolean} selected - Specifies that an option is selected.
1393
+ * @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
1394
+ * @slot - Specifies text for an option, but is not the value.
1395
+ */
1396
+ class AuroMenuOption extends i$2 {
1397
+ constructor() {
1398
+ super();
1399
+
1400
+ /**
1401
+ * Generate unique names for dependency components.
1402
+ */
1403
+ const versioning = new AuroDependencyVersioning();
1404
+ this.iconTag = versioning.generateTag('auro-formkit-menuoption-icon', iconVersion, AuroIcon);
1405
+
1406
+ this.selected = false;
1407
+ this.nocheckmark = false;
1408
+ this.disabled = false;
1409
+
1410
+ /**
1411
+ * @private
1412
+ */
1413
+ this.tabIndex = -1;
1414
+
1415
+ /**
1416
+ * @private
1417
+ */
1418
+ this.runtimeUtils = new AuroLibraryRuntimeUtils();
1419
+ }
1420
+
1421
+ static get properties() {
1422
+ return {
1423
+ nocheckmark: {
1424
+ type: Boolean,
1425
+ reflect: true
1426
+ },
1427
+ selected: {
1428
+ type: Boolean,
1429
+ reflect: true
1430
+ },
1431
+ disabled: {
1432
+ type: Boolean,
1433
+ reflect: true
1434
+ },
1435
+ value: {
1436
+ type: String
1437
+ },
1438
+ tabIndex: {
1439
+ type: Number,
1440
+ reflect: true
1441
+ }
1442
+ };
1443
+ }
1444
+
1445
+ static get styles() {
1446
+ return [
1447
+ styleCss$1,
1448
+ colorCss$1,
1449
+ tokensCss$1
1450
+ ];
1451
+ }
1452
+
1453
+ /**
1454
+ * This will register this element with the browser.
1455
+ * @param {string} [name="auro-menuoption"] - The name of element that you want to register to.
1456
+ *
1457
+ * @example
1458
+ * AuroMenuOption.register("custom-menuoption") // this will register this element to <custom-menuoption/>
1459
+ *
1460
+ */
1461
+ static register(name = "auro-menuoption") {
1462
+ AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenuOption);
1463
+ }
1464
+
1465
+ firstUpdated() {
1466
+ // Add the tag name as an attribute if it is different than the component name
1467
+ this.runtimeUtils.handleComponentTagRename(this, 'auro-menuoption');
1468
+
1469
+ this.setAttribute('role', 'option');
1470
+ this.setAttribute('aria-selected', 'false');
1471
+
1472
+ this.addEventListener('mouseover', () => {
1473
+ this.dispatchEvent(new CustomEvent('auroMenuOption-mouseover', {
1474
+ bubbles: true,
1475
+ cancelable: false,
1476
+ composed: true,
1477
+ detail: this
1478
+ }));
1479
+ });
1480
+ }
1481
+
1482
+ // observer for selected property changes
1483
+ updated(changedProperties) {
1484
+ if (changedProperties.has('selected')) {
1485
+ this.setAttribute('aria-selected', this.selected.toString());
1486
+ }
1487
+ }
1488
+
1489
+ /**
1490
+ * Generates an HTML element containing an SVG icon based on the provided `svgContent`.
1491
+ *
1492
+ * @private
1493
+ * @param {string} svgContent - The SVG content to be embedded.
1494
+ * @returns {Element} The HTML element containing the SVG icon.
1495
+ */
1496
+ generateIconHtml(svgContent) {
1497
+ const dom = new DOMParser().parseFromString(svgContent, 'text/html');
1498
+ const svg = dom.body.firstChild;
1499
+
1500
+ svg.setAttribute('slot', 'svg');
1501
+
1502
+ return u`<${this.iconTag} customColor customSvg slot="icon">${svg}</${this.iconTag}>`;
1503
+ }
1504
+
1505
+ render() {
1506
+ return u`
1507
+ ${this.selected && !this.nocheckmark ? this.generateIconHtml(checkmarkIcon.svg) : undefined}
1508
+ <slot></slot>
1509
+ `;
1510
+ }
1511
+ }
1512
+
1513
+ AuroMenu.register();
1514
+ AuroMenuOption.register();
1515
+
1516
+ /* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */
1517
+
1518
+
1519
+ function initExamples(initCount) {
1520
+ initCount = initCount || 0;
1521
+
1522
+ try {
1523
+ // javascript example function calls to be added here upon creation to test examples
1524
+ auroMenuResetExample();
1525
+ auroMenuMatchWordExample();
1526
+ auroMenuCustomEventExample();
1527
+ auroMenuLoadingExample();
1528
+ } catch (err) {
1529
+ if (initCount <= 20) {
1530
+ // setTimeout handles issue where content is sometimes loaded after the functions get called
1531
+ setTimeout(() => {
1532
+ initExamples(initCount + 1);
1533
+ }, 100);
1534
+ }
1535
+ }
1536
+ }
1537
+
1538
+ export { initExamples };