@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,1944 @@
1
+ function dynamicExample() {
2
+ const values = ['Yes', 'No', 'Maybe'];
3
+ const radioGroup = document.getElementById('dynamicExample');
4
+
5
+ for (let i = 0; i < values.length; i++) {
6
+ const radio = document.createElement('auro-radio');
7
+
8
+ radio.id = `dynamicRadio${i}`;
9
+ radio.label = values[i];
10
+ radio.name = 'radioDemo';
11
+ radio.value = values[i];
12
+ radio.textContent = values[i];
13
+
14
+ radioGroup.appendChild(radio);
15
+ }
16
+ }
17
+
18
+ function resetStateExample() {
19
+ const elem = document.querySelector('#resetStateExample');
20
+
21
+ document.querySelector('#resetStateBtn').addEventListener('click', () => {
22
+ elem.reset();
23
+ });
24
+ }
25
+
26
+ /**
27
+ * @license
28
+ * Copyright 2019 Google LLC
29
+ * SPDX-License-Identifier: BSD-3-Clause
30
+ */
31
+ 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;
32
+
33
+ /**
34
+ * @license
35
+ * Copyright 2017 Google LLC
36
+ * SPDX-License-Identifier: BSD-3-Clause
37
+ */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");
38
+
39
+ /**
40
+ * @license
41
+ * Copyright 2017 Google LLC
42
+ * SPDX-License-Identifier: BSD-3-Clause
43
+ */
44
+ 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};
45
+
46
+ /**
47
+ * @license
48
+ * Copyright 2017 Google LLC
49
+ * SPDX-License-Identifier: BSD-3-Clause
50
+ */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");
51
+
52
+ /**
53
+ * @license
54
+ * Copyright 2017 Google LLC
55
+ * SPDX-License-Identifier: BSD-3-Clause
56
+ */
57
+ const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});let i$1 = 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)}};
58
+
59
+ /**
60
+ * @license
61
+ * Copyright 2018 Google LLC
62
+ * SPDX-License-Identifier: BSD-3-Clause
63
+ */const e=e$1(class extends i$1{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}});
64
+
65
+ /**
66
+ * @license
67
+ * Copyright 2018 Google LLC
68
+ * SPDX-License-Identifier: BSD-3-Clause
69
+ */const o$1=o=>o??E;
70
+
71
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t();}(0,function(){function e(e){var t=true,n=false,o=null,d={text:true,search:true,url:true,tel:true,email:true,password:true,number:true,date:true,month:true,week:true,time:true,datetime:true,"datetime-local":true};function i(e){return !!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function s(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""));}function u(e){t=false;}function a(){document.addEventListener("mousemove",c),document.addEventListener("mousedown",c),document.addEventListener("mouseup",c),document.addEventListener("pointermove",c),document.addEventListener("pointerdown",c),document.addEventListener("pointerup",c),document.addEventListener("touchmove",c),document.addEventListener("touchstart",c),document.addEventListener("touchend",c);}function c(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=false,document.removeEventListener("mousemove",c),document.removeEventListener("mousedown",c),document.removeEventListener("mouseup",c),document.removeEventListener("pointermove",c),document.removeEventListener("pointerdown",c),document.removeEventListener("pointerup",c),document.removeEventListener("touchmove",c),document.removeEventListener("touchstart",c),document.removeEventListener("touchend",c));}document.addEventListener("keydown",function(n){n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement),t=true);},true),document.addEventListener("mousedown",u,true),document.addEventListener("pointerdown",u,true),document.addEventListener("touchstart",u,true),document.addEventListener("visibilitychange",function(e){"hidden"===document.visibilityState&&(n&&(t=true),a());},true),a(),e.addEventListener("focus",function(e){var n,o,u;i(e.target)&&(t||(n=e.target,o=n.type,"INPUT"===(u=n.tagName)&&d[o]&&!n.readOnly||"TEXTAREA"===u&&!n.readOnly||n.isContentEditable))&&s(e.target);},true),e.addEventListener("blur",function(e){var t;i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=true,window.clearTimeout(o),o=window.setTimeout(function(){n=false;},100),(t=e.target).hasAttribute("data-focus-visible-added")&&(t.classList.remove("focus-visible"),t.removeAttribute("data-focus-visible-added")));},true),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""));}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready");}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",false,false,{});}window.dispatchEvent(t);}"undefined"!=typeof document&&e(document);});
72
+
73
+ var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;outline:unset}:host(.focus-visible) .displayFlex .inputGroup:focus-within{width:auto}:host(.focus-visible) .rdoGroup{display:block;padding-right:var(--ds-size-100, 0.5rem);outline:3px solid transparent}:host(.focus-visible) .rdoGroup .label:after{outline-width:1px;outline-style:solid}.rdoGroup{position:relative;padding-right:var(--ds-size-100, 0.5rem);padding-left:var(--ds-size-100, 0.5rem);line-height:var(--ds-size-400, 2rem)}.label{display:block;margin-left:var(--ds-size-300, 1.5rem)}.label:hover{cursor:pointer}.label:after{position:absolute;z-index:1;top:50%;left:var(--ds-size-50, 0.25rem);width:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem));height:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem));transform:translateY(-50%);content:"";border-radius:50%;border:1px solid}.slotContent{display:block;margin-left:var(--ds-size-400, 2rem);padding-left:var(--ds-size-100, 0.5rem)}`;
74
+
75
+ var colorCss$2 = i$5`.label{color:var(--ds-auro-radio-label-color)}.label:after{background-color:var(--ds-auro-radio-btn-fill-color);border-color:var(--ds-auro-radio-btn-border-color);box-shadow:inset 0 0 0 3px var(--ds-auro-radio-btn-inset-color);outline-color:var(--ds-auro-radio-btn-border-color);-webkit-tap-highlight-color:var(--ds-auro-radio-tap-color)}:host([checked]){--ds-auro-radio-btn-inset-color: var(--ds-advanced-color-boolean-indicator, #ffffff);--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-istrue, #01426a);--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-istrue, #01426a)}:host([error]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-error, #e31f26)}:host([checked][error]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-error, #e31f26)}:host([disabled]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-background-disabled, #dddddd);--ds-auro-radio-label-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([checked][disabled]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-state-background-disabled, #dddddd)}:host(.focus-visible){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-focused, #01426a)}:host([onDark]){--ds-auro-radio-label-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-radio-btn-border-color: var(--ds-basic-color-border-inverse, #ffffff)}:host([onDark][checked]){--ds-auro-radio-btn-inset-color: var(--ds-advanced-color-boolean-indicator-inverse, #00274a);--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-istrue-inverse, #ffffff);--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-istrue-inverse, #ffffff)}:host([onDark][error]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-error-inverse, #f9a4a8)}:host([onDark][checked][error]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-error-inverse, #f9a4a8)}:host([onDark][disabled]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-background-inverse-disabled, #7e8894);--ds-auro-radio-label-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][checked][disabled]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-state-background-inverse-disabled, #7e8894)}:host([onDark].focus-visible){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}`;
76
+
77
+ var tokenCss = i$5`:host{--ds-auro-radio-group-label-color: inherit;--ds-auro-radio-btn-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-radio-btn-fill-color: transparent;--ds-auro-radio-btn-inset-color: transparent;--ds-auro-radio-label-color: inherit;--ds-auro-radio-tap-color: transparent}`;
78
+
79
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
80
+ // See LICENSE in the project root for license information.
81
+
82
+ // ---------------------------------------------------------------------
83
+
84
+ /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
85
+
86
+ let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
87
+
88
+ /* eslint-disable jsdoc/require-param */
89
+
90
+ /**
91
+ * This will register a new custom element with the browser.
92
+ * @param {String} name - The name of the custom element.
93
+ * @param {Object} componentClass - The class to register as a custom element.
94
+ * @returns {void}
95
+ */
96
+ registerComponent(name, componentClass) {
97
+ if (!customElements.get(name)) {
98
+ customElements.define(name, class extends componentClass {});
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Finds and returns the closest HTML Element based on a selector.
104
+ * @returns {void}
105
+ */
106
+ closestElement(
107
+ selector, // selector like in .closest()
108
+ base = this, // extra functionality to skip a parent
109
+ __Closest = (el, found = el && el.closest(selector)) =>
110
+ !el || el === document || el === window
111
+ ? null // standard .closest() returns null for non-found selectors also
112
+ : found
113
+ ? found // found a selector INside this element
114
+ : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
115
+ ) {
116
+ return __Closest(base);
117
+ }
118
+ /* eslint-enable jsdoc/require-param */
119
+
120
+ /**
121
+ * 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.
122
+ * @param {Object} elem - The element to check.
123
+ * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
124
+ * @returns {void}
125
+ */
126
+ handleComponentTagRename(elem, tagName) {
127
+ const tag = tagName.toLowerCase();
128
+ const elemTag = elem.tagName.toLowerCase();
129
+
130
+ if (elemTag !== tag) {
131
+ elem.setAttribute(tag, true);
132
+ }
133
+ }
134
+
135
+ /**
136
+ * Validates if an element is a specific Auro component.
137
+ * @param {Object} elem - The element to validate.
138
+ * @param {String} tagName - The name of the Auro component to check against.
139
+ * @returns {Boolean} - Returns true if the element is the specified Auro component.
140
+ */
141
+ elementMatch(elem, tagName) {
142
+ const tag = tagName.toLowerCase();
143
+ const elemTag = elem.tagName.toLowerCase();
144
+
145
+ return elemTag === tag || elem.hasAttribute(tag);
146
+ }
147
+ };
148
+
149
+ // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
150
+ // See LICENSE in the project root for license information.
151
+
152
+
153
+ /**
154
+ * @attr {Boolean} checked - If set to true, the radio button will be filled.
155
+ * @attr {Boolean} disabled - If set to true, the radio button will be non-clickable.
156
+ * @attr {Boolean} required - Defines element as required.
157
+ * @attr {Boolean} error - If set to true, sets an error state on the radio button.
158
+ * @attr {Boolean} onDark - If set to true, the component will render with a dark theme.
159
+ * @event toggleSelected - Notifies that the component has toggled the checked/selected state.
160
+ *
161
+ * @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
162
+ * @attr id
163
+ *
164
+ * @event focusSelected - Notifies that the component has gained focus.
165
+ * @event auroRadio-blur - Notifies that the component has lost focus.
166
+ * @event resetRadio - Notifies that the component has reset the checked/selected state.
167
+ * @event auroRadio-selected - Notifies that the component has been marked as checked/selected.
168
+ */
169
+
170
+ // build the component class
171
+ class AuroRadio extends i$2 {
172
+ constructor() {
173
+ super();
174
+ this.checked = false;
175
+ this.disabled = false;
176
+ this.required = false;
177
+ this.error = false;
178
+ this.onDark = false;
179
+ this.tabIndex = -1;
180
+ this.touched = false;
181
+
182
+ /**
183
+ * @private
184
+ */
185
+ this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
186
+ }
187
+
188
+ static get styles() {
189
+ return [
190
+ styleCss$2,
191
+ colorCss$2,
192
+ tokenCss
193
+ ];
194
+ }
195
+
196
+ // function to define props used within the scope of this component
197
+ static get properties() {
198
+ return {
199
+ checked: {
200
+ type: Boolean,
201
+ reflect: true
202
+ },
203
+ disabled: {
204
+ type: Boolean,
205
+ reflect: true
206
+ },
207
+ required: {
208
+ type: Boolean,
209
+ reflect: true
210
+ },
211
+ error: {
212
+ type: Boolean,
213
+ reflect: true
214
+ },
215
+ onDark: {
216
+ type: Boolean,
217
+ reflect: true
218
+ },
219
+ label: { type: String },
220
+ name: { type: String },
221
+ value: { type: String },
222
+ tabIndex: {
223
+ type: Number,
224
+ reflect: true
225
+ },
226
+
227
+ /**
228
+ * Whether or not the radio button has been touched by the user.
229
+ * @private
230
+ */
231
+ touched: {
232
+ type: Boolean,
233
+ reflect: true,
234
+ attribute: false
235
+ },
236
+
237
+ /**
238
+ * @private
239
+ * id for input node
240
+ */
241
+ inputId: {
242
+ type: String,
243
+ reflect: false,
244
+ attribute: false
245
+ }
246
+ };
247
+ }
248
+
249
+ /**
250
+ * This will register this element with the browser.
251
+ * @param {string} [name="auro-radio"] - The name of element that you want to register to.
252
+ *
253
+ * @example
254
+ * AuroRadio.register("custom-radio") // This will resgiter this element to <custom-radio/>
255
+ *
256
+ */
257
+ static register(name = "auro-radio") {
258
+ AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroRadio);
259
+ }
260
+
261
+ /**
262
+ * Method for handling content when change event is fired.
263
+ * @private
264
+ * @param {Event} event - The trigger event tied to this function.
265
+ * @returns {void}
266
+ */
267
+ handleChange(event) {
268
+ this.checked = event.target.checked;
269
+ const customEvent = new CustomEvent(event.type, event);
270
+
271
+ this.dispatchEvent(customEvent);
272
+ }
273
+
274
+ /**
275
+ * Method for handling content when input event is fired.
276
+ * @private
277
+ * @param {Event} event - The trigger event tied to this function.
278
+ * @returns {void}
279
+ */
280
+ handleInput(event) {
281
+ this.checked = event.target.checked;
282
+ this.dispatchEvent(new CustomEvent('toggleSelected', {
283
+ bubbles: true,
284
+ composed: true,
285
+ target: this
286
+ }));
287
+ }
288
+
289
+ /**
290
+ * Method for handling focus event.
291
+ * @private
292
+ * @param {Event} event - The trigger event tied to this function.
293
+ * @returns {void}
294
+ */
295
+ handleFocus(event) {
296
+ this.touched = true;
297
+ this.dispatchEvent(new CustomEvent('focusSelected', {
298
+ bubbles: true,
299
+ composed: true,
300
+ target: event.target
301
+ }));
302
+ }
303
+
304
+ /**
305
+ * Method for handling blur event.
306
+ * @private
307
+ * @param {Event} event - The trigger event tied to this function.
308
+ * @returns {void}
309
+ */
310
+ handleBlur(event) {
311
+ this.dispatchEvent(new CustomEvent('auroRadio-blur', {
312
+ bubbles: true,
313
+ composed: true,
314
+ target: event.target
315
+ }));
316
+ }
317
+
318
+ /**
319
+ * Resets component to initial state.
320
+ * @returns {void}
321
+ */
322
+ reset() {
323
+ this.touched = false;
324
+ this.checked = false;
325
+ this.error = false;
326
+ }
327
+
328
+ updated(changedProperties) {
329
+ if (changedProperties.has('checked')) {
330
+ this.dispatchEvent(new CustomEvent('resetRadio', {
331
+ bubbles: true,
332
+ composed: true
333
+ }));
334
+
335
+ if (this.checked) {
336
+ this.dispatchEvent(new CustomEvent('auroRadio-selected', {
337
+ bubbles: true,
338
+ composed: true
339
+ }));
340
+ }
341
+ }
342
+ }
343
+
344
+ /**
345
+ * Method for handling content when it is invalid accessibility wise.
346
+ * @private
347
+ * @param {Boolean} error - The element's error attribute.
348
+ * @returns {void}
349
+ */
350
+ invalid(error) {
351
+ if (error) {
352
+ return 'true';
353
+ }
354
+
355
+ return 'false';
356
+ }
357
+
358
+ /**
359
+ * Method for handling passing the required status to aria.
360
+ * @private
361
+ * @param {Boolean} required - The element's required attribute.
362
+ * @returns {void}
363
+ */
364
+ isRequired(required) {
365
+ if (required) {
366
+ return 'true';
367
+ }
368
+
369
+ return 'false';
370
+ }
371
+
372
+ firstUpdated() {
373
+ // Add the tag name as an attribute if it is different than the component name
374
+ this.runtimeUtils.handleComponentTagRename(this, 'auro-radio');
375
+
376
+ this.addEventListener('blur', this.handleBlur);
377
+
378
+ this.input = this.shadowRoot.querySelector('input');
379
+
380
+ this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
381
+
382
+ this.addEventListener('click', () => {
383
+ this.input.click();
384
+ });
385
+ }
386
+
387
+ // function that renders the HTML and CSS into the scope of the component
388
+ render() {
389
+ const labelClasses = {
390
+ 'ods-inputLabel': true,
391
+ 'ods-inputLabel--radio': true,
392
+ 'label': true,
393
+ 'label--rdo': true,
394
+ 'errorBorder': this.error
395
+ };
396
+
397
+ return x`
398
+ <div class="ods-inputGroup rdoGroup">
399
+ <input
400
+ class="util_displayHiddenVisually ods-inputOption rdo--input"
401
+ @focus="${this.handleFocus}"
402
+ @input="${this.handleInput}"
403
+ @change="${this.handleChange}"
404
+ ?disabled="${this.disabled}"
405
+ aria-invalid="${this.invalid(this.error)}"
406
+ aria-required="${this.isRequired(this.required)}"
407
+ .checked="${this.checked}"
408
+ id="${this.inputId}"
409
+ name="${o$1(this.name)}"
410
+ type="radio"
411
+ .value="${this.value}"
412
+ tabIndex="-1"
413
+ />
414
+
415
+ <label for="${this.inputId}" class="${e(labelClasses)}">
416
+ <slot>${this.label}</slot>
417
+ </label>
418
+
419
+ </div>
420
+ <slot name="content" class="slotContent"></slot>
421
+ `;
422
+ }
423
+ }
424
+
425
+ /**
426
+ * @license
427
+ * Copyright 2020 Google LLC
428
+ * SPDX-License-Identifier: BSD-3-Clause
429
+ */
430
+ const a=Symbol.for(""),o=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litStatic$:t,r:a}),i=(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(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);
431
+
432
+ var styleCss$1 = i$5`:host{display:block;padding-bottom:var(--ds-size-150, 0.75rem)}fieldset{all:unset}.displayFlex legend+slot{display:flex;white-space:nowrap}legend{margin-bottom:var(--ds-size-150, 0.75rem)}`;
433
+
434
+ var colorCss$1 = i$5`:host legend{color:var(--ds-auro-radio-group-label-color)}:host([disabled]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([onDark]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][disabled]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}`;
435
+
436
+ class DateFormatter {
437
+
438
+ constructor() {
439
+
440
+ /**
441
+ * @description Parses a date string into its components.
442
+ * @param {string} dateStr - Date string to parse.
443
+ * @param {string} format - Date format to parse.
444
+ * @returns {Object<key["month" | "day" | "year"]: number>|undefined}
445
+ */
446
+ this.parseDate = (dateStr, format = 'mm/dd/yyyy') => {
447
+
448
+ // Guard Clause: Date string is defined
449
+ if (!dateStr) {
450
+ return undefined;
451
+ }
452
+
453
+ // Assume the separator is a "/" a defined in our code base
454
+ const separator = '/';
455
+
456
+ // Get the parts of the date and format
457
+ const valueParts = dateStr.split(separator);
458
+ const formatParts = format.split(separator);
459
+
460
+ // Check if the value and format have the correct number of parts
461
+ if (valueParts.length !== formatParts.length) {
462
+ throw new Error('AuroDatepickerUtilities | parseDate: Date string and format length do not match');
463
+ }
464
+
465
+ // Holds the result to be returned
466
+ const result = formatParts.reduce((acc, part, index) => {
467
+ const value = valueParts[index];
468
+
469
+ if ((/m/iu).test(part)) {
470
+ acc.month = value;
471
+ } else if ((/d/iu).test(part)) {
472
+ acc.day = value;
473
+ } else if ((/y/iu).test(part)) {
474
+ acc.year = value;
475
+ }
476
+
477
+ return acc;
478
+ }, {});
479
+
480
+ // If we found all the parts, return the result
481
+ if (result.month && result.year) {
482
+ return result;
483
+ }
484
+
485
+ // Throw an error to let the dev know we were unable to parse the date string
486
+ throw new Error('AuroDatepickerUtilities | parseDate: Unable to parse date string');
487
+ };
488
+
489
+ /**
490
+ * Convert a date object to string format.
491
+ * @param {Object} date - Date to convert to string.
492
+ * @returns {Object} Returns the date as a string.
493
+ */
494
+ this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
495
+ year: "numeric",
496
+ month: "2-digit",
497
+ day: "2-digit",
498
+ });
499
+
500
+ /**
501
+ * Converts a date string to a North American date format.
502
+ * @param {String} dateStr - Date to validate.
503
+ * @param {String} format - Date format to validate against.
504
+ * @returns {Boolean}
505
+ */
506
+ this.toNorthAmericanFormat = (dateStr, format) => {
507
+
508
+ if (format === 'mm/dd/yyyy') {
509
+ return dateStr;
510
+ }
511
+
512
+ const parsedDate = this.parseDate(dateStr, format);
513
+
514
+ if (!parsedDate) {
515
+ throw new Error('AuroDatepickerUtilities | toNorthAmericanFormat: Unable to parse date string');
516
+ }
517
+
518
+ const { month, day, year } = parsedDate;
519
+
520
+ const dateParts = [];
521
+ if (month) {
522
+ dateParts.push(month);
523
+ }
524
+
525
+ if (day) {
526
+ dateParts.push(day);
527
+ }
528
+
529
+ if (year) {
530
+ dateParts.push(year);
531
+ }
532
+
533
+ return dateParts.join('/');
534
+ };
535
+ }
536
+ }
537
+ const dateFormatter = new DateFormatter();
538
+
539
+ // filepath: dateConstraints.mjs
540
+ const DATE_UTIL_CONSTRAINTS = {
541
+ maxDay: 31,
542
+ maxMonth: 12,
543
+ maxYear: 2400,
544
+ minDay: 1,
545
+ minMonth: 1,
546
+ minYear: 1900,
547
+ };
548
+
549
+ class AuroDateUtilitiesBase {
550
+
551
+ /**
552
+ * @description The maximum day value allowed by the various utilities in this class.
553
+ * @readonly
554
+ * @type {Number}
555
+ */
556
+ get maxDay() {
557
+ return DATE_UTIL_CONSTRAINTS.maxDay;
558
+ }
559
+
560
+ /**
561
+ * @description The maximum month value allowed by the various utilities in this class.
562
+ * @readonly
563
+ * @type {Number}
564
+ */
565
+ get maxMonth() {
566
+ return DATE_UTIL_CONSTRAINTS.maxMonth;
567
+ }
568
+
569
+ /**
570
+ * @description The maximum year value allowed by the various utilities in this class.
571
+ * @readonly
572
+ * @type {Number}
573
+ */
574
+ get maxYear() {
575
+ return DATE_UTIL_CONSTRAINTS.maxYear;
576
+ }
577
+
578
+ /**
579
+ * @description The minimum day value allowed by the various utilities in this class.
580
+ * @readonly
581
+ * @type {Number}
582
+ */
583
+ get minDay() {
584
+ return DATE_UTIL_CONSTRAINTS.minDay;
585
+ }
586
+
587
+ /**
588
+ * @description The minimum month value allowed by the various utilities in this class.
589
+ * @readonly
590
+ * @type {Number}
591
+ */
592
+ get minMonth() {
593
+ return DATE_UTIL_CONSTRAINTS.minMonth;
594
+ }
595
+
596
+ /**
597
+ * @description The minimum year value allowed by the various utilities in this class.
598
+ * @readonly
599
+ * @type {Number}
600
+ */
601
+ get minYear() {
602
+ return DATE_UTIL_CONSTRAINTS.minYear;
603
+ }
604
+ }
605
+
606
+ /* eslint-disable no-magic-numbers */
607
+
608
+ class AuroDateUtilities extends AuroDateUtilitiesBase {
609
+
610
+ /**
611
+ * Returns the current century.
612
+ * @returns {String} The current century.
613
+ */
614
+ getCentury () {
615
+ return String(new Date().getFullYear()).slice(0, 2);
616
+ }
617
+
618
+ /**
619
+ * Returns a four digit year.
620
+ * @param {String} year - The year to convert to four digits.
621
+ * @returns {String} The four digit year.
622
+ */
623
+ getFourDigitYear (year) {
624
+
625
+ const strYear = String(year).trim();
626
+ return strYear.length <= 2 ? this.getCentury() + strYear : strYear;
627
+ }
628
+
629
+ constructor() {
630
+
631
+ super();
632
+
633
+ /**
634
+ * Compares two dates to see if they match.
635
+ * @param {Object} date1 - First date to compare.
636
+ * @param {Object} date2 - Second date to compare.
637
+ * @returns {Boolean} Returns true if the dates match.
638
+ */
639
+ this.datesMatch = (date1, date2) => new Date(date1).getTime() === new Date(date2).getTime();
640
+
641
+ /**
642
+ * Returns true if value passed in is a valid date.
643
+ * @param {String} date - Date to validate.
644
+ * @param {String} format - Date format to validate against.
645
+ * @returns {Boolean}
646
+ */
647
+ this.validDateStr = (date, format) => {
648
+
649
+ // The length we expect the date string to be
650
+ const dateStrLength = format.length;
651
+
652
+ // Guard Clause: Date and format are defined
653
+ if (typeof date === "undefined" || typeof format === "undefined") {
654
+ throw new Error('AuroDatepickerUtilities | validateDateStr: Date and format are required');
655
+ }
656
+
657
+ // Guard Clause: Date should be of type string
658
+ if (typeof date !== "string") {
659
+ throw new Error('AuroDatepickerUtilities | validateDateStr: Date must be a string');
660
+ }
661
+
662
+ // Guard Clause: Format should be of type string
663
+ if (typeof format !== "string") {
664
+ throw new Error('AuroDatepickerUtilities | validateDateStr: Format must be a string');
665
+ }
666
+
667
+ // Guard Clause: Length is what we expect it to be
668
+ if (date.length !== dateStrLength) {
669
+ return false;
670
+ }
671
+ // Get a formatted date string and parse it
672
+ const dateParts = dateFormatter.parseDate(date, format);
673
+
674
+ // Guard Clause: Date parse succeeded
675
+ if (!dateParts) {
676
+ return false;
677
+ }
678
+
679
+ // Create the expected date string based on the date parts
680
+ const expectedDateStr = `${dateParts.month}/${dateParts.day || "01"}/${this.getFourDigitYear(dateParts.year)}`;
681
+
682
+ // Generate a date object that we will extract a string date from to compare to the passed in date string
683
+ const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
684
+
685
+ // Get the date string of the date object we created from the string date
686
+ const actualDateStr = dateFormatter.getDateAsString(dateObj);
687
+
688
+ // Guard Clause: Generated date matches date string input
689
+ if (expectedDateStr !== actualDateStr) {
690
+ return false;
691
+ }
692
+
693
+ // If we passed all other checks, we can assume the date is valid
694
+ return true;
695
+ };
696
+
697
+ /**
698
+ * Determines if a string date value matches the format provided.
699
+ * @param {string} value = The date string value.
700
+ * @param { string} format = The date format to match against.
701
+ * @returns {boolean}
702
+ */
703
+ this.dateAndFormatMatch = (value, format) => {
704
+
705
+ // Ensure we have both values we need to do the comparison
706
+ if (!value || !format) {
707
+ throw new Error('AuroFormValidation | dateFormatMatch: value and format are required');
708
+ }
709
+
710
+ // If the lengths are different, they cannot match
711
+ if (value.length !== format.length) {
712
+ return false;
713
+ }
714
+
715
+ // Get the parts of the date
716
+ const dateParts = dateFormatter.parseDate(value, format);
717
+
718
+ // Validator for day
719
+ const dayValueIsValid = (day) => {
720
+
721
+ // Guard clause: if there is no day in the dateParts, we can ignore this check.
722
+ if (!dateParts.day) {
723
+ return true;
724
+ }
725
+
726
+ // Guard clause: ensure day exists.
727
+ if (!day) {
728
+ return false;
729
+ }
730
+
731
+ // Convert day to number
732
+ const numDay = Number.parseInt(day, 10);
733
+
734
+ // Guard clause: ensure day is a valid integer
735
+ if (Number.isNaN(numDay)) {
736
+ throw new Error('AuroDatepickerUtilities | dayValueIsValid: Unable to parse day value integer');
737
+ }
738
+
739
+ // Guard clause: ensure day is within the valid range
740
+ if (numDay < this.minDay || numDay > this.maxDay) {
741
+ return false;
742
+ }
743
+
744
+ // Default return
745
+ return true;
746
+ };
747
+
748
+ // Validator for month
749
+ const monthValueIsValid = (month) => {
750
+
751
+ // Guard clause: ensure month exists.
752
+ if (!month) {
753
+ return false;
754
+ }
755
+
756
+ // Convert month to number
757
+ const numMonth = Number.parseInt(month, 10);
758
+
759
+ // Guard clause: ensure month is a valid integer
760
+ if (Number.isNaN(numMonth)) {
761
+ throw new Error('AuroDatepickerUtilities | monthValueIsValid: Unable to parse month value integer');
762
+ }
763
+
764
+ // Guard clause: ensure month is within the valid range
765
+ if (numMonth < this.minMonth || numMonth > this.maxMonth) {
766
+ return false;
767
+ }
768
+
769
+ // Default return
770
+ return true;
771
+ };
772
+
773
+ // Validator for year
774
+ const yearIsValid = (_year) => {
775
+
776
+ // Guard clause: ensure year exists.
777
+ if (!_year) {
778
+ return false;
779
+ }
780
+
781
+ // Get the full year
782
+ const year = this.getFourDigitYear(_year);
783
+
784
+ // Convert year to number
785
+ const numYear = Number.parseInt(year, 10);
786
+
787
+ // Guard clause: ensure year is a valid integer
788
+ if (Number.isNaN(numYear)) {
789
+ throw new Error('AuroDatepickerUtilities | yearValueIsValid: Unable to parse year value integer');
790
+ }
791
+
792
+ // Guard clause: ensure year is within the valid range
793
+ if (numYear < this.minYear || numYear > this.maxYear) {
794
+ return false;
795
+ }
796
+
797
+ // Default return
798
+ return true;
799
+ };
800
+
801
+ // Self-contained checks for month, day, and year
802
+ const checks = [
803
+ monthValueIsValid(dateParts.month),
804
+ dayValueIsValid(dateParts.day),
805
+ yearIsValid(dateParts.year)
806
+ ];
807
+
808
+ // If any of the checks failed, the date format does not match and the result is invalid
809
+ const isValid = checks.every((check) => check === true);
810
+
811
+ // If the check is invalid, return false
812
+ if (!isValid) {
813
+ return false;
814
+ }
815
+
816
+ // Default case
817
+ return true;
818
+ };
819
+ }
820
+ }
821
+
822
+ // Export a class instance
823
+ const dateUtilities = new AuroDateUtilities();
824
+
825
+ // Export the class instance methods individually
826
+ const {
827
+ datesMatch,
828
+ validDateStr,
829
+ dateAndFormatMatch,
830
+ minDay,
831
+ minMonth,
832
+ minYear,
833
+ maxDay,
834
+ maxMonth,
835
+ maxYear
836
+ } = dateUtilities;
837
+
838
+ const {
839
+ toNorthAmericanFormat,
840
+ parseDate,
841
+ getDateAsString
842
+ } = dateFormatter;
843
+
844
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
845
+ // See LICENSE in the project root for license information.
846
+
847
+
848
+ class AuroFormValidation {
849
+
850
+ constructor() {
851
+ this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
852
+ }
853
+
854
+ /**
855
+ * Resets the element to its initial state.
856
+ * @private
857
+ * @param {object} elem - HTML element to reset.
858
+ * @returns {void}
859
+ */
860
+ reset(elem) {
861
+ elem.validity = undefined;
862
+ elem.value = undefined;
863
+ elem.touched = false;
864
+
865
+ // Resets the second value of the datepicker in range state
866
+ if (elem.valueEnd) {
867
+ elem.valueEnd = undefined;
868
+ }
869
+
870
+ // Resets selected option of element
871
+ if (elem.optionSelected) {
872
+ elem.optionSelected = undefined;
873
+ }
874
+
875
+ // Runs validation to handle error attribute
876
+ this.validate(elem);
877
+ }
878
+
879
+ /**
880
+ * Validates the attributes of a given element based on predefined validation rules.
881
+ *
882
+ * @param {HTMLElement} elem - The element to be validated.
883
+ * @returns {void}
884
+ *
885
+ * @example
886
+ * // Assuming `inputElement` is a reference to an input element in the DOM
887
+ * validateElementAttributes(inputElement);
888
+ *
889
+ * The function checks the element's attributes against the validation rules defined for 'input' and 'counter' types.
890
+ * If a validation rule is violated, it sets the element's validity state and error message accordingly.
891
+ *
892
+ * Validation rules:
893
+ * - input:
894
+ * - length:
895
+ * - tooShort: Checks if the value length is less than the minimum length.
896
+ * - tooLong: Checks if the value length exceeds the maximum length.
897
+ * - pattern:
898
+ * - patternMismatch: Checks if the value does not match the specified pattern.
899
+ * - counter:
900
+ * - range:
901
+ * - rangeOverflow: Checks if the value exceeds the maximum value.
902
+ * - rangeUnderflow: Checks if the value is less than the minimum value.
903
+ */
904
+ validateElementAttributes(elem) {
905
+ const validationRules = {
906
+ input: {
907
+ length: [
908
+ {
909
+ check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
910
+ validity: 'tooShort',
911
+ message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
912
+ },
913
+ {
914
+ check: (e) => e.value?.length > e.maxLength,
915
+ validity: 'tooLong',
916
+ message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
917
+ }
918
+ ],
919
+ pattern: [
920
+ {
921
+ check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
922
+ validity: 'patternMismatch',
923
+ message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
924
+ }
925
+ ]
926
+ },
927
+ counter: {
928
+ range: [
929
+ {
930
+ check: (e) => e.max !== undefined && Number(e.max) < Number(e.value),
931
+ validity: 'rangeOverflow',
932
+ message: e => e.getAttribute('setCustomValidityRangeOverflow') || ''
933
+ },
934
+ {
935
+ check: (e) => e.min !== undefined && Number(e.min) > Number(e.value),
936
+ validity: 'rangeUnderflow',
937
+ message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
938
+ }
939
+ ]
940
+ }
941
+ };
942
+
943
+ let elementType;
944
+ if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
945
+ elementType = 'input';
946
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
947
+ elementType = 'counter';
948
+ }
949
+
950
+ if (elementType) {
951
+ const rules = validationRules[elementType];
952
+
953
+ if (rules) {
954
+ Object.values(rules).flat().forEach(rule => {
955
+ if (rule.check(elem)) {
956
+ elem.validity = rule.validity;
957
+ elem.errorMessage = rule.message(elem);
958
+ }
959
+ });
960
+ }
961
+ }
962
+ }
963
+
964
+ /**
965
+ * Determines the validity state of the element based on the type attribute.
966
+ * @private
967
+ * @param {object} elem - HTML element to validate.
968
+ * @returns {void}
969
+ */
970
+ validateType(elem) {
971
+ if (elem.hasAttribute('type')) {
972
+ if (elem.type === 'email') {
973
+ const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
974
+
975
+ if (!elem.value.match(emailRegex)) {
976
+ elem.validity = 'patternMismatch';
977
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
978
+ return;
979
+ }
980
+ } else if (elem.type === 'credit-card') {
981
+ if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
982
+ elem.validity = 'tooShort';
983
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
984
+ return;
985
+ }
986
+ } else if (elem.type === 'number') {
987
+ if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
988
+ elem.validity = 'rangeOverflow';
989
+ elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
990
+ return;
991
+ }
992
+
993
+ if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
994
+ elem.validity = 'rangeUnderflow';
995
+ elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
996
+ return;
997
+ }
998
+ } else if (elem.type === 'date' && elem.value?.length > 0) {
999
+
1000
+ // Guard Clause: if the value is too short
1001
+ if (elem.value?.length < elem.lengthForType) {
1002
+
1003
+ elem.validity = 'tooShort';
1004
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
1005
+ return;
1006
+ }
1007
+
1008
+ // Guard Clause: If the value is too long for the type
1009
+ if (elem.value?.length > elem.lengthForType) {
1010
+
1011
+ elem.validity = 'tooLong';
1012
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
1013
+ return;
1014
+ }
1015
+
1016
+ // Validate that the date passed was the correct format
1017
+ if (!dateAndFormatMatch(elem.value, elem.format)) {
1018
+ elem.validity = 'patternMismatch';
1019
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || 'Invalid Date Format Entered';
1020
+ return;
1021
+ }
1022
+
1023
+ // Validate that the date passed was a valid date
1024
+ if (!validDateStr(elem.value, elem.format)) {
1025
+ elem.validity = 'invalidDate';
1026
+ elem.errorMessage = elem.setCustomValidityInvalidDate || elem.setCustomValidity || 'Invalid Date Entered';
1027
+ return;
1028
+ }
1029
+
1030
+ // Perform the rest of the validation
1031
+ const formattedValue = toNorthAmericanFormat(elem.value, elem.format);
1032
+ const valueDate = new Date(formattedValue);
1033
+
1034
+ // // Validate max date
1035
+ if (elem.max?.length === elem.lengthForType) {
1036
+
1037
+ const maxDate = new Date(toNorthAmericanFormat(elem.max, elem.format));
1038
+
1039
+ if (valueDate > maxDate) {
1040
+ elem.validity = 'rangeOverflow';
1041
+ elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
1042
+ return;
1043
+ }
1044
+ }
1045
+
1046
+ // Validate min date
1047
+ if (elem.min?.length === elem.lengthForType) {
1048
+ const minDate = new Date(toNorthAmericanFormat(elem.min, elem.format));
1049
+
1050
+ if (valueDate < minDate) {
1051
+ elem.validity = 'rangeUnderflow';
1052
+ elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
1053
+ return;
1054
+ }
1055
+ }
1056
+ }
1057
+ }
1058
+ }
1059
+
1060
+ /**
1061
+ * Determines the validity state of the element.
1062
+ * @param {object} elem - HTML element to validate.
1063
+ * @param {boolean} force - Boolean that forces validation to run.
1064
+ * @returns {void}
1065
+ */
1066
+ validate(elem, force) {
1067
+ this.getInputElements(elem);
1068
+ this.getAuroInputs(elem);
1069
+
1070
+ // Validate only if noValidate is not true and the input does not have focus
1071
+ let validationShouldRun =
1072
+ force ||
1073
+ (!elem.contains(document.activeElement) &&
1074
+ (elem.touched ||
1075
+ (!elem.touched && typeof elem.value !== "undefined"))) ||
1076
+ elem.validateOnInput;
1077
+
1078
+ if (elem.hasAttribute('error')) {
1079
+ elem.validity = 'customError';
1080
+ elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
1081
+ validationShouldRun = false;
1082
+ } else if (validationShouldRun) {
1083
+ elem.validity = 'valid';
1084
+ elem.errorMessage = '';
1085
+
1086
+ /**
1087
+ * Only validate once we interact with the datepicker
1088
+ * elem.value === undefined is the initial state pre-interaction.
1089
+ *
1090
+ * The validityState definitions are located at https://developer.mozilla.org/en-US/docs/Web/API/ValidityState.
1091
+ */
1092
+
1093
+ let hasValue = false;
1094
+
1095
+ // Check string for having a value
1096
+ if (typeof elem.value === "string") {
1097
+ hasValue = elem.value && elem.value.length > 0;
1098
+ }
1099
+
1100
+ // Check array value types for having a value
1101
+ if (Array.isArray(elem.value)) {
1102
+ hasValue = Boolean(
1103
+ elem.value.length > 0 &&
1104
+ elem.value.some((value) => typeof value === "string" && value.length > 0)
1105
+ );
1106
+ }
1107
+
1108
+ // If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
1109
+ if (this.auroInputElements?.length === 2) {
1110
+ if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
1111
+ hasValue = false;
1112
+ }
1113
+ }
1114
+
1115
+ if (!hasValue && elem.required && elem.touched) {
1116
+ elem.validity = 'valueMissing';
1117
+ elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
1118
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
1119
+ this.validateType(elem);
1120
+ this.validateElementAttributes(elem);
1121
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
1122
+ this.validateElementAttributes(elem);
1123
+ }
1124
+ }
1125
+
1126
+ if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
1127
+ elem.validity = this.auroInputElements[0].validity;
1128
+ elem.errorMessage = this.auroInputElements[0].errorMessage;
1129
+
1130
+ if (elem.validity === 'valid' && this.auroInputElements.length > 1) {
1131
+ elem.validity = this.auroInputElements[1].validity;
1132
+ elem.errorMessage = this.auroInputElements[1].errorMessage;
1133
+ }
1134
+ }
1135
+
1136
+ if (validationShouldRun || elem.hasAttribute('error')) {
1137
+ // Use the validity message override if it is declared
1138
+ if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
1139
+ elem.errorMessage = elem.ValidityMessageOverride;
1140
+ }
1141
+
1142
+ this.getErrorMessage(elem);
1143
+
1144
+ elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1145
+ bubbles: true,
1146
+ composed: true,
1147
+ detail: {
1148
+ validity: elem.validity,
1149
+ message: elem.errorMessage
1150
+ }
1151
+ }));
1152
+ }
1153
+ }
1154
+
1155
+ /**
1156
+ * Gets all the HTML5 `inputs` in the element shadow DOM.
1157
+ * @private
1158
+ * @param {object} elem - HTML element to validate.
1159
+ * @returns {void}
1160
+ */
1161
+ getInputElements(elem) {
1162
+ this.inputElements = elem.renderRoot.querySelectorAll('input');
1163
+ }
1164
+
1165
+ /**
1166
+ * Gets all the `auro-inputs` in the element shadow DOM.
1167
+ * @private
1168
+ * @param {object} elem - HTML element to validate.
1169
+ * @returns {void}
1170
+ */
1171
+ getAuroInputs(elem) {
1172
+ this.auroInputElements = elem.shadowRoot.querySelectorAll('auro-input, [auro-input]');
1173
+ }
1174
+
1175
+ /**
1176
+ * Return appropriate error message.
1177
+ * @private
1178
+ * @param {object} elem - HTML element to validate.
1179
+ * @returns {void}
1180
+ */
1181
+ getErrorMessage(elem) {
1182
+ if (elem.validity !== 'valid') {
1183
+ if (elem.setCustomValidity) {
1184
+ elem.errorMessage = elem.setCustomValidity;
1185
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
1186
+ const input = elem.renderRoot.querySelector('input');
1187
+
1188
+ if (input.validationMessage.length > 0) {
1189
+ elem.errorMessage = input.validationMessage;
1190
+ }
1191
+ } else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
1192
+ const firstInput = this.inputElements[0];
1193
+
1194
+ if (firstInput.validationMessage.length > 0) {
1195
+ elem.errorMessage = firstInput.validationMessage;
1196
+ } else if (this.inputElements?.length === 2) {
1197
+ const secondInput = this.inputElements[1];
1198
+
1199
+ if (secondInput.validationMessage.length > 0) {
1200
+ elem.errorMessage = secondInput.validationMessage;
1201
+ }
1202
+ }
1203
+ }
1204
+ } else {
1205
+ elem.errorMessage = '';
1206
+ }
1207
+ }
1208
+ }
1209
+
1210
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1211
+ // See LICENSE in the project root for license information.
1212
+
1213
+
1214
+ class AuroDependencyVersioning {
1215
+
1216
+ /**
1217
+ * Generates a unique string to be used for child auro element naming.
1218
+ * @private
1219
+ * @param {string} baseName - Defines the first part of the unique element name.
1220
+ * @param {string} version - Version of the component that will be appended to the baseName.
1221
+ * @returns {string} - Unique string to be used for naming.
1222
+ */
1223
+ generateElementName(baseName, version) {
1224
+ let result = baseName;
1225
+
1226
+ result += '-';
1227
+ result += version.replace(/[.]/g, '_');
1228
+
1229
+ return result;
1230
+ }
1231
+
1232
+ /**
1233
+ * Generates a unique string to be used for child auro element naming.
1234
+ * @param {string} baseName - Defines the first part of the unique element name.
1235
+ * @param {string} version - Version of the component that will be appended to the baseName.
1236
+ * @returns {string} - Unique string to be used for naming.
1237
+ */
1238
+ generateTag(baseName, version, tagClass) {
1239
+ const elementName = this.generateElementName(baseName, version);
1240
+ const tag = i`${s(elementName)}`;
1241
+
1242
+ if (!customElements.get(elementName)) {
1243
+ customElements.define(elementName, class extends tagClass {});
1244
+ }
1245
+
1246
+ return tag;
1247
+ }
1248
+ }
1249
+
1250
+ var colorCss = i$5`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
1251
+
1252
+ var styleCss = i$5`.helptext-wrapper{display:none;font-size:var(--ds-basic-text-body-xs-font-size, 12px);font-weight:var(--ds-basic-text-body-xs-font-weight, 450);letter-spacing:var(--ds-basic-text-body-xs-letter-spacing, 0);line-height:var(--ds-basic-text-body-xs-line-height, 16px)}:host([large]) .helptext-wrapper{font-size:var(--ds-basic-text-body-default-font-size, 16px);font-weight:var(--ds-basic-text-body-default-font-weight, 450);letter-spacing:var(--ds-basic-text-body-default-letter-spacing, 0);line-height:var(--ds-basic-text-body-default-line-height, 24px)}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
1253
+
1254
+ var tokensCss = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
1255
+
1256
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1257
+ // See LICENSE in the project root for license information.
1258
+
1259
+ // ---------------------------------------------------------------------
1260
+
1261
+ /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
1262
+
1263
+ class AuroLibraryRuntimeUtils {
1264
+
1265
+ /* eslint-disable jsdoc/require-param */
1266
+
1267
+ /**
1268
+ * This will register a new custom element with the browser.
1269
+ * @param {String} name - The name of the custom element.
1270
+ * @param {Object} componentClass - The class to register as a custom element.
1271
+ * @returns {void}
1272
+ */
1273
+ registerComponent(name, componentClass) {
1274
+ if (!customElements.get(name)) {
1275
+ customElements.define(name, class extends componentClass {});
1276
+ }
1277
+ }
1278
+
1279
+ /**
1280
+ * Finds and returns the closest HTML Element based on a selector.
1281
+ * @returns {void}
1282
+ */
1283
+ closestElement(
1284
+ selector, // selector like in .closest()
1285
+ base = this, // extra functionality to skip a parent
1286
+ __Closest = (el, found = el && el.closest(selector)) =>
1287
+ !el || el === document || el === window
1288
+ ? null // standard .closest() returns null for non-found selectors also
1289
+ : found
1290
+ ? found // found a selector INside this element
1291
+ : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
1292
+ ) {
1293
+ return __Closest(base);
1294
+ }
1295
+ /* eslint-enable jsdoc/require-param */
1296
+
1297
+ /**
1298
+ * 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.
1299
+ * @param {Object} elem - The element to check.
1300
+ * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
1301
+ * @returns {void}
1302
+ */
1303
+ handleComponentTagRename(elem, tagName) {
1304
+ const tag = tagName.toLowerCase();
1305
+ const elemTag = elem.tagName.toLowerCase();
1306
+
1307
+ if (elemTag !== tag) {
1308
+ elem.setAttribute(tag, true);
1309
+ }
1310
+ }
1311
+
1312
+ /**
1313
+ * Validates if an element is a specific Auro component.
1314
+ * @param {Object} elem - The element to validate.
1315
+ * @param {String} tagName - The name of the Auro component to check against.
1316
+ * @returns {Boolean} - Returns true if the element is the specified Auro component.
1317
+ */
1318
+ elementMatch(elem, tagName) {
1319
+ const tag = tagName.toLowerCase();
1320
+ const elemTag = elem.tagName.toLowerCase();
1321
+
1322
+ return elemTag === tag || elem.hasAttribute(tag);
1323
+ }
1324
+ }
1325
+
1326
+ // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1327
+ // See LICENSE in the project root for license information.
1328
+
1329
+
1330
+ /**
1331
+ * Displays help text or error messages within form elements - Internal Use Only.
1332
+ *
1333
+ * @attr { Boolean } large - If declared, make font-size to 1rem(16px).
1334
+ */
1335
+ class AuroHelpText extends i$2 {
1336
+
1337
+ constructor() {
1338
+ super();
1339
+
1340
+ this.error = false;
1341
+ this.onDark = false;
1342
+ this.hasTextContent = false;
1343
+
1344
+ AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-helptext');
1345
+ }
1346
+
1347
+ static get styles() {
1348
+ return [
1349
+ colorCss,
1350
+ styleCss,
1351
+ tokensCss
1352
+ ];
1353
+ }
1354
+
1355
+ // function to define props used within the scope of this component
1356
+ static get properties() {
1357
+ return {
1358
+
1359
+ /**
1360
+ * @private
1361
+ */
1362
+ slotNodes: {
1363
+ type: Boolean,
1364
+ },
1365
+
1366
+ /**
1367
+ * @private
1368
+ */
1369
+ hasTextContent: {
1370
+ type: Boolean,
1371
+ },
1372
+
1373
+ /**
1374
+ * If declared, make font color red.
1375
+ */
1376
+ error: {
1377
+ type: Boolean,
1378
+ reflect: true,
1379
+ },
1380
+
1381
+ /**
1382
+ * If declared, will apply onDark styles.
1383
+ */
1384
+ onDark: {
1385
+ type: Boolean,
1386
+ reflect: true
1387
+ }
1388
+ };
1389
+ }
1390
+
1391
+ /**
1392
+ * This will register this element with the browser.
1393
+ * @param {string} [name="auro-helptext"] - The name of element that you want to register to.
1394
+ *
1395
+ * @example
1396
+ * AuroCheckbox.register("custom-helptext") // this will register this element to <custom-helptext/>
1397
+ *
1398
+ */
1399
+ static register(name = "auro-helptext") {
1400
+ AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroHelpText);
1401
+ }
1402
+
1403
+ updated() {
1404
+ this.handleSlotChange();
1405
+ }
1406
+
1407
+ handleSlotChange(event) {
1408
+ if (event) {
1409
+ this.slotNodes = event.target.assignedNodes();
1410
+ }
1411
+
1412
+ this.hasTextContent = this.checkSlotsForContent(this.slotNodes);
1413
+ }
1414
+
1415
+ /**
1416
+ * Checks if any of the provided nodes or their nested slot nodes contain non-empty text content.
1417
+ *
1418
+ * @param {NodeList|Array} nodes - The list of nodes to check for content.
1419
+ * @returns {boolean} - Returns true if any node or nested slot node contains non-empty text content, otherwise false.
1420
+ * @private
1421
+ */
1422
+ checkSlotsForContent(nodes) {
1423
+ if (!nodes) {
1424
+ return false;
1425
+ }
1426
+
1427
+ return nodes.some((node) => {
1428
+ if (node.textContent.trim()) {
1429
+ return true;
1430
+ }
1431
+
1432
+ if (!node.querySelector) {
1433
+ return false;
1434
+ }
1435
+
1436
+ const nestedSlot = node.tagName === 'SLOT' ? node : node.querySelector('slot');
1437
+ if (!nestedSlot) {
1438
+ return false;
1439
+ }
1440
+
1441
+ const nestedSlotNodes = nestedSlot.assignedNodes();
1442
+ return this.checkSlotsForContent(nestedSlotNodes);
1443
+ });
1444
+ }
1445
+
1446
+ // function that renders the HTML and CSS into the scope of the component
1447
+ render() {
1448
+ return x`
1449
+ <div class="helptext-wrapper" ?visible="${this.hasTextContent}">
1450
+ <slot @slotchange=${this.handleSlotChange}></slot>
1451
+ </div>
1452
+ `;
1453
+ }
1454
+ }
1455
+
1456
+ var helpTextVersion = '1.0.0';
1457
+
1458
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1459
+ // See LICENSE in the project root for license information.
1460
+ // ---------------------------------------------------------------------
1461
+
1462
+
1463
+ /* eslint no-magic-numbers: ["error", { "ignore": [0, 1, -1] }] */
1464
+ /* eslint-disable max-lines, lit/binding-positions, lit/no-invalid-html */
1465
+
1466
+ /**
1467
+ * @attr {String} validity - Specifies the `validityState` this element is in.
1468
+ * @attr {String} setCustomValidity - Sets a custom help text message to display for all validityStates.
1469
+ * @attr {String} setCustomValidityCustomError - Custom help text message to display when validity = `customError`.
1470
+ * @attr {String} setCustomValidityValueMissing - Custom help text message to display when validity = `valueMissing`.
1471
+ * @attr {String} error - When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value.
1472
+ * @attr {Boolean} noValidate - If set, disables auto-validation on blur.
1473
+ * @attr {Boolean} onDark - Applies dark mode styles to the component.
1474
+ * @attr {Boolean} required - Populates the `required` attribute on the element. Used for client-side validation.
1475
+ * @attr {Object} optionSelected - Specifies the current selected radio button.
1476
+ * @csspart radio-group - Apply css to the fieldset element in the shadow DOM
1477
+ * @slot {HTMLSlotElement} legend - Allows for the legend to be overridden.
1478
+ * @slot {HTMLSlotElement} optionalLabel - Allows for the optional label to be overridden.
1479
+ * @slot {HTMLSlotElement} helpText - Allows for the helper text to be overridden.
1480
+ * @event auroFormElement-validated - Notifies that the element has been validated.
1481
+ * @event input - Notifies every time the value prop of the element is changed.
1482
+ */
1483
+
1484
+ class AuroRadioGroup extends i$2 {
1485
+ constructor() {
1486
+ super();
1487
+ this.disabled = false;
1488
+ this.horizontal = false;
1489
+ this.required = false;
1490
+ this.validity = undefined;
1491
+ this.value = undefined;
1492
+ this.optionSelected = undefined;
1493
+ this.onDark = false;
1494
+ this.touched = false;
1495
+
1496
+ /**
1497
+ * @private
1498
+ */
1499
+ this.validation = new AuroFormValidation();
1500
+
1501
+ /**
1502
+ * @private
1503
+ */
1504
+ this.index = 0;
1505
+
1506
+ /**
1507
+ * @private
1508
+ */
1509
+ this.max = 3;
1510
+
1511
+ /**
1512
+ * @private
1513
+ */
1514
+ this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
1515
+
1516
+ /**
1517
+ * Generate unique names for dependency components.
1518
+ */
1519
+ const versioning = new AuroDependencyVersioning();
1520
+
1521
+ /**
1522
+ * @private
1523
+ */
1524
+ this.helpTextTag = versioning.generateTag('auro-formkit-radio-helptext', helpTextVersion, AuroHelpText);
1525
+ }
1526
+
1527
+ static get styles() {
1528
+ return [
1529
+ styleCss$1,
1530
+ colorCss$1,
1531
+ tokenCss
1532
+ ];
1533
+ }
1534
+
1535
+ static get properties() {
1536
+ return {
1537
+ disabled: {
1538
+ type: Boolean,
1539
+ reflect: true
1540
+ },
1541
+ horizontal: { type: Boolean },
1542
+ error: {
1543
+ type: String,
1544
+ reflect: true
1545
+ },
1546
+ value: {
1547
+ type: String
1548
+ },
1549
+ noValidate: {
1550
+ type: Boolean,
1551
+ reflect: true
1552
+ },
1553
+ onDark: {
1554
+ type: Boolean,
1555
+ reflect: true
1556
+ },
1557
+ required: {
1558
+ type: Boolean,
1559
+ reflect: true
1560
+ },
1561
+ setCustomValidity: {
1562
+ type: String
1563
+ },
1564
+ setCustomValidityCustomError: {
1565
+ type: String
1566
+ },
1567
+ setCustomValidityValueMissing: {
1568
+ type: String
1569
+ },
1570
+ validity: {
1571
+ type: String,
1572
+ reflect: true
1573
+ },
1574
+ optionSelected: {
1575
+ type: Object
1576
+ },
1577
+
1578
+ /**
1579
+ * Indicates whether the radio group is in a dirty state (has been interacted with).
1580
+ * @type {boolean}
1581
+ * @default false
1582
+ * @private
1583
+ */
1584
+ touched: {
1585
+ type: Boolean,
1586
+ reflect: true,
1587
+ attribute: false
1588
+ }
1589
+ };
1590
+ }
1591
+
1592
+ /**
1593
+ * This will register this element with the browser.
1594
+ * @param {string} [name="auro-radio-group"] - The name of element that you want to register to.
1595
+ *
1596
+ * @example
1597
+ * AuroRadioGroup.register("custom-radio-group") // This will register this element to <custom-radio-group/>
1598
+ *
1599
+ */
1600
+ static register(name = "auro-radio-group") {
1601
+ AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroRadioGroup);
1602
+ }
1603
+
1604
+ connectedCallback() {
1605
+ super.connectedCallback();
1606
+ this.handleItems();
1607
+ this.addEventListener('toggleSelected', this.handleToggleSelected);
1608
+ this.addEventListener('keydown', this.handleKeyDown);
1609
+ this.addEventListener('resetRadio', this.resetRadio);
1610
+ this.addEventListener('auroRadio-blur', this.handleRadioBlur);
1611
+ this.addEventListener('auroRadio-selected', this.handleSelection);
1612
+ }
1613
+
1614
+ firstUpdated() {
1615
+ // Add the tag name as an attribute if it is different than the component name
1616
+ this.runtimeUtils.handleComponentTagRename(this, 'auro-radio-group');
1617
+ }
1618
+
1619
+ /**
1620
+ * Method for handling of selection of a radio element.
1621
+ * @private
1622
+ * @param {Event} event - The trigger event tied to this function.
1623
+ * @returns {void}
1624
+ */
1625
+ handleSelection(event) {
1626
+ if (event.target.value) {
1627
+ this.value = event.target.value;
1628
+ } else {
1629
+ this.value = '';
1630
+ }
1631
+
1632
+ this.optionSelected = event.target;
1633
+
1634
+ this.validation.validate(this);
1635
+ }
1636
+
1637
+ /**
1638
+ * Method handles radio element blur.
1639
+ * @private
1640
+ * @returns {void}
1641
+ */
1642
+ handleRadioBlur() {
1643
+ this.touched = true;
1644
+ this.validation.validate(this);
1645
+ }
1646
+
1647
+ /**
1648
+ * LitElement lifecycle method. Called after the DOM has been updated.
1649
+ * @param {Map<string, any>} changedProperties - Keys are the names of changed properties, values are the corresponding previous values.
1650
+ * @returns {void}
1651
+ */
1652
+ updated(changedProperties) {
1653
+ if (changedProperties.has('disabled')) {
1654
+ // only change the children if we are making everything disabled, or if we are making everything enabled and there are no individually-disabled radio buttons
1655
+ if (this.disabled || this.items.every((el) => el.disabled)) {
1656
+ this.items.forEach((el) => {
1657
+ el.disabled = this.disabled;
1658
+ });
1659
+ }
1660
+ }
1661
+
1662
+ if (changedProperties.has('value')) {
1663
+ this.dispatchEvent(new CustomEvent('input', {
1664
+ bubbles: true,
1665
+ cancelable: true,
1666
+ composed: true,
1667
+ }));
1668
+ }
1669
+
1670
+ if (changedProperties.has('required')) {
1671
+ this.items.forEach((el) => {
1672
+ el.required = this.required;
1673
+ });
1674
+ }
1675
+
1676
+ if (changedProperties.has('onDark')) {
1677
+ this.items.forEach((el) => {
1678
+ el.onDark = this.onDark;
1679
+ });
1680
+ }
1681
+
1682
+ if (changedProperties.has('error')) {
1683
+ this.validate(true);
1684
+ }
1685
+
1686
+ if (changedProperties.has('validity')) {
1687
+ if (this.validity && this.validity !== 'valid') {
1688
+ this.items.forEach((el) => {
1689
+ el.setAttribute('error', true);
1690
+ });
1691
+ } else {
1692
+ this.items.forEach((el) => {
1693
+ el.removeAttribute('error');
1694
+ });
1695
+ }
1696
+ }
1697
+ }
1698
+
1699
+ /**
1700
+ * Resets component to initial state.
1701
+ * @returns {void}
1702
+ */
1703
+ reset() {
1704
+ // Sets first radio button to receive focus during keyboard navigation
1705
+ this.index = 0;
1706
+
1707
+ const buttons = this.querySelectorAll('auro-radio, [auro-radio]');
1708
+
1709
+ buttons.forEach((button) => {
1710
+ button.reset();
1711
+ });
1712
+
1713
+ this.validation.reset(this);
1714
+ }
1715
+
1716
+ /**
1717
+ * Validates value.
1718
+ * @param {boolean} [force=false] - Whether to force validation.
1719
+ */
1720
+ validate(force = false) {
1721
+ this.validation.validate(this, force);
1722
+ }
1723
+
1724
+ /**
1725
+ * Method handles the reset event from a radio element.
1726
+ * @private
1727
+ * @returns {void}
1728
+ */
1729
+ resetRadio() {
1730
+ if (this.items.length === 0) {
1731
+ this.handleItems();
1732
+ }
1733
+
1734
+ // handle tab index
1735
+ this.items.forEach((item) => {
1736
+ item.tabIndex = -1;
1737
+ });
1738
+
1739
+ if (!this.disabled) {
1740
+ this.items[this.index].tabIndex = 0;
1741
+ }
1742
+ }
1743
+
1744
+ /**
1745
+ * Method for handling the attributes of each radio input.
1746
+ * @private
1747
+ * @returns {void}
1748
+ */
1749
+ handleItems() {
1750
+ this.items = [...this.querySelectorAll(':scope auro-radio, :scope [auro-radio]')];
1751
+ this.initializeIndex();
1752
+
1753
+ if (this.disabled) {
1754
+ this.items.forEach((el) => {
1755
+ el.disabled = this.disabled;
1756
+ });
1757
+ }
1758
+
1759
+ this.items.forEach((el) => {
1760
+ el.required = this.required;
1761
+ el.error = Boolean(this.error);
1762
+ });
1763
+ }
1764
+
1765
+ /**
1766
+ * Method for handling slot content changes.
1767
+ * @private
1768
+ * @returns {void}
1769
+ */
1770
+ handleSlotChange() {
1771
+ this.handleItems();
1772
+ }
1773
+
1774
+ /**
1775
+ * Method for initializing the tab index of the checked radio input.
1776
+ * @private
1777
+ * @returns {void}
1778
+ */
1779
+ initializeIndex() {
1780
+ if (!this.disabled) {
1781
+ const index = this.items.findIndex((item) => item.hasAttribute('checked') && !item.hasAttribute('disabled'));
1782
+ const nextEnabledIndex = this.items.findIndex((item) => !item.hasAttribute('disabled'));
1783
+
1784
+ this.index = index >= 0 ? index : nextEnabledIndex;
1785
+
1786
+ if (this.index >= 0) {
1787
+ this.items[this.index].tabIndex = 0;
1788
+ }
1789
+ }
1790
+ }
1791
+
1792
+ /**
1793
+ * Method for handling a newly selected radio input.
1794
+ * @private
1795
+ * @param {Event} event - The trigger event tied to this function.
1796
+ * @returns {void}
1797
+ */
1798
+ handleToggleSelected(event) {
1799
+ this.index = this.items.indexOf(event.target);
1800
+
1801
+ this.items.forEach((item) => {
1802
+ if (item === event.target) {
1803
+ item.tabIndex = 0;
1804
+ if (event.target.value) {
1805
+ this.value = event.target.value;
1806
+ }
1807
+ } else {
1808
+ const sdInput = item.shadowRoot.querySelector('input');
1809
+
1810
+ sdInput.checked = false;
1811
+ item.checked = false;
1812
+ item.tabIndex = -1;
1813
+ }
1814
+ });
1815
+
1816
+ this.optionSelected = event.target;
1817
+
1818
+ this.validation.validate(this);
1819
+ }
1820
+
1821
+ /**
1822
+ * Method for selecting a radio input.
1823
+ * @private
1824
+ * @param {Number} index - The value of the element's index attribute.
1825
+ * @returns {void}
1826
+ */
1827
+ selectItem(index) {
1828
+ const sdItem = this.items[index].shadowRoot.querySelector('input');
1829
+
1830
+ sdItem.click();
1831
+ sdItem.focus();
1832
+ this.index = index;
1833
+ }
1834
+
1835
+ /**
1836
+ * Method for selecting the next radio input.
1837
+ * @private
1838
+ * @param {Number} index - The value of the element's index attribute.
1839
+ * @param {String} moveDirection - Arrow key pressed by user.
1840
+ * @returns {void}
1841
+ */
1842
+ selectNextItem(index, moveDirection) {
1843
+ let currIndex = index;
1844
+
1845
+ for (currIndex; currIndex < this.items.length; moveDirection === "Down" ? currIndex += 1 : currIndex -= 1) {
1846
+ currIndex = currIndex === -1 ? this.items.length - 1 : currIndex;
1847
+ const sdItem = this.items[currIndex].shadowRoot.querySelector('input');
1848
+
1849
+ if (this.disabled || this.items.every((item) => item.disabled === true)) {
1850
+ sdItem.focus();
1851
+ break;
1852
+ }
1853
+ if (!sdItem.disabled) {
1854
+ sdItem.click();
1855
+ sdItem.focus();
1856
+ this.index = currIndex;
1857
+ break;
1858
+ }
1859
+ }
1860
+ }
1861
+
1862
+ /**
1863
+ * Method for handling a keydown event.
1864
+ * @private
1865
+ * @param {Event} event - The trigger event tied to this function.
1866
+ * @returns {void}
1867
+ */
1868
+ handleKeyDown(event) {
1869
+ switch (event.key) {
1870
+ case " ":
1871
+ event.preventDefault();
1872
+ this.selectItem(this.index);
1873
+ break;
1874
+
1875
+ case "Down":
1876
+ case "ArrowDown":
1877
+ case "Right":
1878
+ case "ArrowRight":
1879
+ event.preventDefault();
1880
+ this.selectNextItem(this.index === this.items.length - 1 ? 0 : this.index + 1, "Down");
1881
+ break;
1882
+
1883
+ case "Up":
1884
+ case "ArrowUp":
1885
+ case "Left":
1886
+ case "ArrowLeft":
1887
+ event.preventDefault();
1888
+ this.selectNextItem(this.index === 0 ? this.items.length - 1 : this.index - 1, "Up");
1889
+ break;
1890
+ }
1891
+ }
1892
+
1893
+ // function that renders the HTML and CSS into the scope of the component
1894
+ render() {
1895
+ const groupClasses = {
1896
+ 'displayFlex': this.horizontal && this.items.length <= this.max
1897
+ };
1898
+
1899
+ return u`
1900
+ <fieldset class="${e(groupClasses)}" part="radio-group">
1901
+ ${this.required
1902
+ ? u`<legend><slot name="legend"></slot></legend>`
1903
+ : u`<legend><slot name="legend"></slot> <slot name="optionalLabel">(optional)</slot></legend>`
1904
+ }
1905
+ <slot @slotchange=${this.handleSlotChange}></slot>
1906
+ </fieldset>
1907
+
1908
+ ${!this.validity || this.validity === undefined || this.validity === 'valid'
1909
+ ? u`
1910
+ <${this.helpTextTag} large ?onDark="${this.onDark}" part="helpText">
1911
+ <slot name="helpText"></slot>
1912
+ </${this.helpTextTag}>`
1913
+ : u`
1914
+ <${this.helpTextTag} large ?onDark="${this.onDark}" role="alert" error aria-live="assertive" part="helpText">
1915
+ ${this.errorMessage}
1916
+ </${this.helpTextTag}>`
1917
+ }
1918
+ `;
1919
+ }
1920
+ }
1921
+
1922
+ AuroRadio.register();
1923
+ AuroRadioGroup.register();
1924
+
1925
+ AuroRadio.register('custom-radio');
1926
+ AuroRadioGroup.register('custom-radio-group');
1927
+
1928
+ function initExamples(initCount) {
1929
+ initCount = initCount || 0;
1930
+
1931
+ try {
1932
+ dynamicExample();
1933
+ resetStateExample();
1934
+ } catch (error) {
1935
+ if (initCount <= 20) {
1936
+ // setTimeout handles issue where content is sometimes loaded after the functions get called
1937
+ setTimeout(() => {
1938
+ initExamples(initCount + 1);
1939
+ }, 100);
1940
+ }
1941
+ }
1942
+ }
1943
+
1944
+ export { initExamples };