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