@noctuatech/uswds 0.0.3 → 0.0.5

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 (65) hide show
  1. package/README.md +1 -1
  2. package/assets/uswds.min.js +1 -1
  3. package/package.json +4 -4
  4. package/src/lib/accordion/accordion.element.ts +147 -0
  5. package/src/lib/accordion/accordion.stories.ts +49 -0
  6. package/src/lib/accordion/accordion.test.ts +160 -0
  7. package/src/lib/checkbox/checkbox.element.ts +4 -1
  8. package/src/lib/define.ts +4 -0
  9. package/src/lib/link/link.element.ts +6 -2
  10. package/src/lib/radio/radio-option.element.ts +31 -13
  11. package/src/lib/radio/radio.element.ts +28 -40
  12. package/src/lib/radio/radio.stories.ts +18 -8
  13. package/src/lib/select/select-option.element.ts +10 -11
  14. package/src/lib/select/select.element.ts +7 -21
  15. package/src/lib/side-nav/side-nav-item.element.ts +86 -0
  16. package/src/lib/side-nav/side-nav.element.ts +25 -0
  17. package/src/lib/side-nav/side-nav.stories.ts +62 -0
  18. package/src/lib/side-nav/side-nav.test.ts +110 -0
  19. package/src/lib.ts +2 -0
  20. package/target/lib/accordion/accordion.element.d.ts +19 -0
  21. package/target/lib/accordion/accordion.element.js +172 -0
  22. package/target/lib/accordion/accordion.element.js.map +1 -0
  23. package/target/lib/accordion/accordion.stories.d.ts +12 -0
  24. package/target/lib/accordion/accordion.stories.js +42 -0
  25. package/target/lib/accordion/accordion.stories.js.map +1 -0
  26. package/target/lib/accordion/accordion.test.d.ts +1 -0
  27. package/target/lib/accordion/accordion.test.js +113 -0
  28. package/target/lib/accordion/accordion.test.js.map +1 -0
  29. package/target/lib/checkbox/checkbox.element.js +4 -1
  30. package/target/lib/checkbox/checkbox.element.js.map +1 -1
  31. package/target/lib/define.d.ts +4 -0
  32. package/target/lib/define.js +4 -0
  33. package/target/lib/define.js.map +1 -1
  34. package/target/lib/link/link.element.js +6 -2
  35. package/target/lib/link/link.element.js.map +1 -1
  36. package/target/lib/radio/radio-option.element.d.ts +5 -2
  37. package/target/lib/radio/radio-option.element.js +37 -15
  38. package/target/lib/radio/radio-option.element.js.map +1 -1
  39. package/target/lib/radio/radio.element.d.ts +2 -3
  40. package/target/lib/radio/radio.element.js +31 -36
  41. package/target/lib/radio/radio.element.js.map +1 -1
  42. package/target/lib/radio/radio.stories.d.ts +7 -2
  43. package/target/lib/radio/radio.stories.js +13 -7
  44. package/target/lib/radio/radio.stories.js.map +1 -1
  45. package/target/lib/select/select-option.element.d.ts +2 -1
  46. package/target/lib/select/select-option.element.js +8 -11
  47. package/target/lib/select/select-option.element.js.map +1 -1
  48. package/target/lib/select/select.element.d.ts +1 -3
  49. package/target/lib/select/select.element.js +10 -19
  50. package/target/lib/select/select.element.js.map +1 -1
  51. package/target/lib/side-nav/side-nav-item.element.d.ts +8 -0
  52. package/target/lib/side-nav/side-nav-item.element.js +109 -0
  53. package/target/lib/side-nav/side-nav-item.element.js.map +1 -0
  54. package/target/lib/side-nav/side-nav.element.d.ts +8 -0
  55. package/target/lib/side-nav/side-nav.element.js +36 -0
  56. package/target/lib/side-nav/side-nav.element.js.map +1 -0
  57. package/target/lib/side-nav/side-nav.stories.d.ts +12 -0
  58. package/target/lib/side-nav/side-nav.stories.js +55 -0
  59. package/target/lib/side-nav/side-nav.stories.js.map +1 -0
  60. package/target/lib/side-nav/side-nav.test.d.ts +2 -0
  61. package/target/lib/side-nav/side-nav.test.js +92 -0
  62. package/target/lib/side-nav/side-nav.test.js.map +1 -0
  63. package/target/lib.d.ts +2 -0
  64. package/target/lib.js +2 -0
  65. package/target/lib.js.map +1 -1
package/README.md CHANGED
@@ -23,7 +23,7 @@ https://designsystem.digital.gov/
23
23
  }
24
24
  </style>
25
25
 
26
- <script src="https://cdn.jsdelivr.net/npm/@noctuatech/uswds@latest/uswds.min.js"></script>
26
+ <script src="https://cdn.jsdelivr.net/npm/@noctuatech/uswds@latest/assets/uswds.min.js"></script>
27
27
 
28
28
  <usa-config
29
29
  spritesheet="https://cdn.jsdelivr.net/npm/@noctuatech/uswds@latest/assets/img/sprite.svg"
@@ -1 +1 @@
1
- !function(){"use strict";function e(e,t,a,s,n,o){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var l,r=s.kind,c="getter"===r?"get":"setter"===r?"set":"value",d=!t&&e?s.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,s.name):{}),u=!1,m=a.length-1;m>=0;m--){var f={};for(var b in s)f[b]="access"===b?{}:s[b];for(var b in s.access)f.access[b]=s.access[b];f.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(e||null))};var p=(0,a[m])("accessor"===r?{get:h.get,set:h.set}:h[c],f);if("accessor"===r){if(void 0===p)continue;if(null===p||"object"!=typeof p)throw new TypeError("Object expected");(l=i(p.get))&&(h.get=l),(l=i(p.set))&&(h.set=l),(l=i(p.init))&&n.unshift(l)}else(l=i(p))&&("field"===r?n.unshift(l):h[c]=l)}d&&Object.defineProperty(d,s.name,h),u=!0}function t(e,t,a){for(var s=arguments.length>2,n=0;n<t.length;n++)a=s?t[n].call(e,a):t[n].call(e);return s?a:void 0}function a(e,t,a){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:a?"".concat(a," ",t):t})}function s(e,t,a,s){if("a"===a&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?s:"a"===a?s.call(e):s?s.value:t.get(e)}function n(e,t,a,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,a):n?n.value=a:t.set(e,a),a}function o(e){return e[Symbol.metadata]}"function"==typeof SuppressedError&&SuppressedError;class i{#e;#t;get name(){return this.#e}get factory(){return this.#t}constructor(e,t){this.#e=e,this.#t=t}}const l=new WeakMap;class r{#a=new WeakMap;parent;providers;constructor(e=[],t){this.parent=t,this.providers=e}inject(e){if(this.#a.has(e)){const t=this.#a.get(e),a=o(e);return a&&c(t,a.onInjected),t}const t=this.#s(e);if(t){if(t.use){const a=t.use;return this.#n(e,(()=>new a))}if(t.factory){const a=t.factory;return this.#n(e,a)}throw new Error(`Provider for ${e.name} found but is missing either 'use' or 'factory'`)}if(this.parent)return this.parent.inject(e);if(e instanceof i){if(!e.factory)throw new Error(`Provider not found for ${e}`);return this.#n(e,e.factory)}return this.#n(e,(()=>new e))}setParent(e){this.parent=e}clear(){this.#a=new WeakMap}#n(e,t){const a=t(this);if(this.#a.set(e,a),"object"==typeof a&&null!==a){const t=l.get(a);t&&t.setParent(this);const s=o(e);s&&(c(a,s.onCreated),c(a,s.onInjected))}return a}#s(e){if(this.providers)for(let t=0;t<this.providers.length;t++)if(this.providers[t].provide===e)return this.providers[t]}}function c(e,t){if(Array.isArray(t))for(let a of t)"function"==typeof a&&a.call(e)}function d(e,t){return class extends e{constructor(...e){super(),this.addEventListener("finddiroot",(e=>{e.stopPropagation();const t=function(e){const t=e.composedPath();for(let e=1;e<t.length;e++){const a=t[e],s=l.get(a);if(s)return s;if(a===document.body)return null}return null}(e);t&&l.get(this)?.setParent(t)}))}connectedCallback(){this.isConnected&&(this.dispatchEvent(new Event("finddiroot",{bubbles:!0,composed:!0})),super.connectedCallback&&super.connectedCallback())}disconnectedCallback(){l.get(this)?.setParent(void 0),super.disconnectedCallback&&super.disconnectedCallback()}}}function h(e){return function(t,a){class s extends t{constructor(...t){super(...t);const a=new r(e?.providers);a.providers.push({provide:r,factory:()=>a}),l.set(this,a)}}return"HTMLElement"in globalThis&&HTMLElement.prototype.isPrototypeOf(t.prototype)?d(s):s}}function u(e){return function(){const t=l.get(this);if(void 0===t){const e=Object.getPrototypeOf(this.constructor).name;throw new Error(`${e} is either not injectable or a service is being called in the constructor. \n Either add the @injectable() to your class or use the @injected callback method.`)}return t.inject(e)}}Symbol.metadata??=Symbol("Symbol.metadata");class m{#o;constructor(e,...t){this.#o=document.createElement("template"),this.#o.innerHTML=g(e)}apply(e){e.shadowRoot&&e.shadowRoot.append(this.#o.content.cloneNode(!0))}}function f(e,...t){return new m(e,...t)}class b{#i;constructor(e,...t){this.#i=new CSSStyleSheet,this.#i.replaceSync(g(e))}apply(e){e.shadowRoot&&(e.shadowRoot.adoptedStyleSheets=[...e.shadowRoot.adoptedStyleSheets,this.#i])}}function p(e){return new b(e)}function g(e){let t="";for(let a=0;a<e.length;a++)t+=e[a];return t}Symbol.metadata??=Symbol("Symbol.metadata");class v extends Map{}class y{attrs=new v;listeners=[];onReady=new Set}class k extends WeakMap{read(e){return this.has(e)||this.set(e,new y),this.get(e)}}const w=new k;function S(e){return function({get:t,set:a},s){const n=function(e){let t;if("symbol"==typeof e){if(!e.description)throw new Error("Cannot handle Symbol property without description");t=e.description}else t=e;return t.toLowerCase().replaceAll(" ","-")}(s.name),o=w.read(s.metadata),i=e?.reflect??!0;return o.attrs.set(n,{propName:s.name,observe:e?.observed??!0,reflect:i,getPropValue:t,setPropValue:a}),{set(e){i&&(!0===e?this.setAttribute(n,""):!1===e?this.removeAttribute(n):this.setAttribute(n,String(e))),a.call(this,e)}}}}function x(e,t){return function(a,s){const n=w.read(s.metadata);let o=e=>e.shadowRoot??e;t&&(o="string"==typeof t?e=>e.shadowRoot?e.shadowRoot.querySelector(t):e.querySelector(t):t),n.listeners.push({event:e,cb:a,selector:o})}}function C(e){return function(t,a){const s=w.read(a.metadata);return a.addInitializer((function(){e?.tagName&&(customElements.get(e.tagName)||customElements.define(e.tagName,this))})),class extends t{static observedAttributes=[];static{for(let[e,{observe:t}]of s.attrs)t&&this.observedAttributes.push(e)}constructor(...t){if(super(...t),e?.shadowDom){this.shadowRoot||this.attachShadow({mode:e.shadowDomMode??"open"});for(let t of e.shadowDom)t.apply(this)}for(let{event:e,cb:t,selector:a}of s.listeners){const s=a(this);if(!s)throw new Error(`could not add listener to ${s}`);s.addEventListener(e,t.bind(this))}for(let e of s.onReady)e.call(this)}connectedCallback(){this.isConnected&&(!function(e,t){for(let[a,{getPropValue:s,reflect:n}]of t)if(n){const t=s.call(e);null!=t&&""!==t&&("boolean"==typeof t?!0===t&&e.setAttribute(a,""):e.setAttribute(a,String(t)))}}(this,s.attrs),super.connectedCallback&&super.connectedCallback())}attributeChangedCallback(e,t,a){const n=s.attrs.get(e);if(n&&t!==a){const e=n.getPropValue.call(this);""===a?n.setPropValue.call(this,!0):"number"==typeof e?n.setPropValue.call(this,Number(a)):n.setPropValue.call(this,a)}super.attributeChangedCallback&&super.attributeChangedCallback(e,t,a)}}}}function M(e){let t=null;return function(){if(t)return t;if(t=this.shadowRoot?this.shadowRoot.querySelector(e):this.querySelector(e),!t)throw new Error("could not find element");return t}}class E{constructor(){this.spriteSheet=""}}(()=>{var o,i;let l,c,d,m=[C({tagName:"usa-config",shadowDom:[p`:host{display:contents}`,f`<slot></slot>`]}),h()],b=[],g=HTMLElement,v=[],y=[];c=class extends g{constructor(){super(...arguments),i.set(this,t(this,v,"/assets/img/sprite.svg")),o.set(this,(t(this,y),u(r)))}get spriteSheet(){return s(this,i,"f")}set spriteSheet(e){n(this,i,e,"f")}connectedCallback(){const{providers:e}=s(this,o,"f").call(this);e.push({provide:E,factory:()=>this})}},o=new WeakMap,i=new WeakMap,a(c,"USAConfigElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(g[Symbol.metadata]??null):void 0;d=[S()],e(c,null,d,{kind:"accessor",name:"spriteSheet",static:!1,private:!1,access:{has:e=>"spriteSheet"in e,get:e=>e.spriteSheet,set:(e,t)=>{e.spriteSheet=t}},metadata:a},v,y),e(null,l={value:c},m,{kind:"class",name:c.name,metadata:a},null,b),c=l.value,a&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(c,b)})()})();const W={info:{icon:"info"},warning:{icon:"warning"},success:{icon:"check_circle"},error:{icon:"error"},emergency:{icon:"error"}};(()=>{var o,i;let l,r,c,d=[C({tagName:"usa-alert",shadowDom:[p`:host{display:block;border-left:.5rem solid #adadad;padding:1rem 1.2rem;color:#1b1b1b;margin-bottom:1rem}:host([type=info]){border-left-color:#00bde3;background-color:#e7f6f8}:host([type=warning]){background-color:#faf3d1;border-left-color:#ffbe2e}:host([type=success]){background-color:#ecf3ec;border-left-color:#00a91c}:host([type=error]){background-color:#f4e3db;border-left-color:#d54309}:host([type=emergency]){background-color:#9c3d10;border-left-color:#9c3d10;color:#fff}:host([type=emergency]) ::slotted(*){color:#fff}.alert-heading{display:grid;grid-template-columns:auto 1fr;align-items:center}usa-icon{margin:-.28rem .75rem 0 0}#heading::slotted(*){font-family:Source Sans Pro Web,Helvetica Neue,Helvetica,Roboto,Arial,sans-serif;font-size:1.33rem;line-height:.9;margin-top:0;margin-bottom:.5rem}`,f`<div class="alert-heading"><usa-icon icon="check_circle"></usa-icon><div><slot id="heading" name="heading"></slot></div><div class="spacer"></div><div><slot></slot></div></div>`]})],h=[],u=HTMLElement,m=[],b=[];r=class extends u{constructor(){super(...arguments),i.set(this,t(this,m,"info")),o.set(this,(t(this,b),M("usa-icon")))}get type(){return s(this,i,"f")}set type(e){n(this,i,e,"f")}attributeChangedCallback(){s(this,o,"f").call(this).icon=W[this.type].icon}},o=new WeakMap,i=new WeakMap,a(r,"USAAlertElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;c=[S()],e(r,null,c,{kind:"accessor",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:a},m,b),e(null,l={value:r},d,{kind:"class",name:r.name,metadata:a},null,h),r=l.value,a&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(r,h)})()})(),(()=>{var o,i,l,r,c,d,h;let u,m,b,g,v,y,k,w=[C({tagName:"usa-button",shadowDom:[p`:host{display:contents}.usa-button{box-sizing:border-box;font-family:Source Sans Pro Web,Helvetica Neue,Helvetica,Roboto,Arial,sans-serif;font-size:1.06rem;line-height:.9;color:#fff;background-color:#005ea2;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;border:0;border-radius:.25rem;cursor:pointer;-moz-column-gap:.5rem;column-gap:.5rem;display:inline-flex;font-weight:700;justify-content:center;padding:.75rem 1.25rem;text-align:center;text-decoration:none;width:100%;cursor:pointer}@media all and (min-width:30em){.usa-button{width:auto}}.usa-button:visited{color:#fff}.usa-button:hover{color:#fff;background-color:#1a4480;border-bottom:0;text-decoration:none}.usa-button:active{color:#fff;background-color:#162e51}.usa-button:not([disabled]):focus{outline-offset:.25rem}.usa-button:disabled{color:#454545;background-color:#c9c9c9;cursor:not-allowed;opacity:1}.usa-button:disabled:active,.usa-button:disabled:focus,.usa-button:disabled:hover{color:#454545;background-color:#c9c9c9}.usa-button:focus{outline:.25rem solid #2491ff;outline-offset:0}:host([variant=secondary]) .usa-button{color:#fff;background-color:#d83933}:host([variant=secondary]) .usa-button:hover{background-color:#b50909}:host([variant=secondary]) .usa-button:active{background-color:#8b0a03}:host([variant=cool]) .usa-button{color:#1b1b1b;background-color:#00bde3}:host([variant=cool]) .usa-button:hover{background-color:#28a0cb}:host([variant=cool]) .usa-button:active{color:#fff;background-color:#07648d}:host([variant=warm]) .usa-button{color:#1b1b1b;background-color:#fa9441}:host([variant=warm]) .usa-button:hover{color:#fff;background-color:#c05600}:host([variant=warm]) .usa-button:active{color:#fff;background-color:#775540}:host([variant=outline]) .usa-button{background-color:transparent;box-shadow:inset 0 0 0 2px #005ea2;color:#005ea2}:host([variant=outline]) .usa-button:hover{box-shadow:inset 0 0 0 2px #1a4480;color:#1a4480}:host([variant=outline]) .usa-button:active{box-shadow:inset 0 0 0 2px #162e51;color:#162e51}`,f`<button class="usa-button"><slot></slot></button>`]})],E=[],W=HTMLElement,j=[],A=[],O=[],P=[],N=[],H=[],R=[];m=class extends W{constructor(){super(...arguments),o.add(this),c.set(this,(t(this,j),t(this,A,"button"))),d.set(this,(t(this,O),t(this,P,!1))),h.set(this,(t(this,N),t(this,H,"primary"))),i.set(this,(t(this,R),this.attachInternals())),l.set(this,M("button"))}get type(){return s(this,c,"f")}set type(e){n(this,c,e,"f")}get disabled(){return s(this,d,"f")}set disabled(e){n(this,d,e,"f")}get variant(){return s(this,h,"f")}set variant(e){n(this,h,e,"f")}onKeyDown(e){"submit"===this.type&&"ENTER"===e.key.toUpperCase()&&s(this,o,"m",r).call(this)}onInternalClick(){s(this,o,"m",r).call(this)}attributeChangedCallback(){const e=s(this,l,"f").call(this);e.type=this.type,e.disabled=this.disabled}},i=new WeakMap,l=new WeakMap,o=new WeakSet,c=new WeakMap,d=new WeakMap,h=new WeakMap,r=function(){const{form:e}=s(this,i,"f");if(e)if("submit"===this.type){const t=document.createElement("button");t.type="submit",e.append(t),t.click(),t.remove()}else"reset"===this.type&&e.reset()},a(m,"USAButtonElement"),(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(W[Symbol.metadata]??null):void 0;b=[S()],g=[S()],v=[S()],y=[x("keydown",(()=>document.body))],k=[x("click")],e(m,null,b,{kind:"accessor",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:t},A,O),e(m,null,g,{kind:"accessor",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:t},P,N),e(m,null,v,{kind:"accessor",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:t},H,R),e(m,null,y,{kind:"method",name:"onKeyDown",static:!1,private:!1,access:{has:e=>"onKeyDown"in e,get:e=>e.onKeyDown},metadata:t},null,j),e(m,null,k,{kind:"method",name:"onInternalClick",static:!1,private:!1,access:{has:e=>"onInternalClick"in e,get:e=>e.onInternalClick},metadata:t},null,j),e(null,u={value:m},w,{kind:"class",name:m.name,metadata:t},null,E),m=u.value,t&&Object.defineProperty(m,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),m.formAssociated=!0,t(m,E)})(),(()=>{var o,i,l,r,c,d;let h,u,m,b,g,v,y,k=[C({tagName:"usa-checkbox",shadowDom:[p`*{box-sizing:border-box}:host{display:inline-block;font-family:Source Sans Pro Web,Helvetica Neue,Helvetica,Roboto,Arial,sans-serif}:host([tiled]) label{background-color:#fff;border:2px solid #c9c9c9;border-radius:.25rem;color:#1b1b1b;padding:.75rem 1rem .75rem .75rem}label{display:inline-flex;cursor:pointer;font-size:1.06rem;line-height:1.3;flex-wrap:wrap}.checkbox{background:#fff;box-shadow:0 0 0 2px #1b1b1b;display:flex;align-items:center;justify-content:center;height:1.25rem;width:1.25rem;border-radius:2px;position:relative;margin-right:.75rem}input:checked+.checkbox{background-color:#005ea2;box-shadow:0 0 0 2px #005ea2}input:checked+.checkbox::after{content:" ";display:block;height:1rem;width:.5rem;border-right:4px solid #fff;border-bottom:4px solid #fff;transform:rotate(45deg) scale(.65)}input{height:0;width:0;position:absolute;left:-999em;right:auto}input:focus+.checkbox{outline:.25rem solid #2491ff;outline-offset:.25rem}.description{display:block;font-size:.93rem;margin-top:.5rem}.break{flex-basis:100%;height:0}.spacer{height:1.25rem;width:1.25rem;margin-right:.75rem}:host([tiled]) label:has(input:checked){background-color:rgba(0,94,162,.1);border-color:#005ea2}`,f`<label><input type="checkbox"><div class="checkbox"></div><div class="title"><slot></slot></div></label>`]})],w=[],E=HTMLElement,W=[],j=[],A=[],O=[],P=[],N=[],H=[],R=[],T=[];u=class extends E{constructor(){super(...arguments),l.set(this,(t(this,W),t(this,j,!1))),r.set(this,(t(this,A),t(this,O,""))),c.set(this,(t(this,P),t(this,N,""))),d.set(this,(t(this,H),t(this,R,!1))),o.set(this,(t(this,T),M("input"))),i.set(this,this.attachInternals())}get checked(){return s(this,l,"f")}set checked(e){n(this,l,e,"f")}get name(){return s(this,r,"f")}set name(e){n(this,r,e,"f")}get value(){return s(this,c,"f")}set value(e){n(this,c,e,"f")}get tiled(){return s(this,d,"f")}set tiled(e){n(this,d,e,"f")}connectedCallback(){const e=s(this,o,"f").call(this);this.checked&&s(this,i,"f").setFormValue(this.value),e.checked=this.checked,e.name=this.name}attributeChangedCallback(){const e=s(this,o,"f").call(this);e.checked=this.checked,e.name=this.name}onCheckboxChange(){s(this,o,"f").call(this).checked?s(this,i,"f").setFormValue(this.value):s(this,i,"f").setFormValue(null)}},o=new WeakMap,i=new WeakMap,l=new WeakMap,r=new WeakMap,c=new WeakMap,d=new WeakMap,a(u,"USACheckboxElement"),(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(E[Symbol.metadata]??null):void 0;m=[S()],b=[S()],g=[S()],v=[S()],y=[x("change","input[type=checkbox]")],e(u,null,m,{kind:"accessor",name:"checked",static:!1,private:!1,access:{has:e=>"checked"in e,get:e=>e.checked,set:(e,t)=>{e.checked=t}},metadata:t},j,A),e(u,null,b,{kind:"accessor",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:t},O,P),e(u,null,g,{kind:"accessor",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:t},N,H),e(u,null,v,{kind:"accessor",name:"tiled",static:!1,private:!1,access:{has:e=>"tiled"in e,get:e=>e.tiled,set:(e,t)=>{e.tiled=t}},metadata:t},R,T),e(u,null,y,{kind:"method",name:"onCheckboxChange",static:!1,private:!1,access:{has:e=>"onCheckboxChange"in e,get:e=>e.onCheckboxChange},metadata:t},null,W),e(null,h={value:u},k,{kind:"class",name:u.name,metadata:t},null,w),u=h.value,t&&Object.defineProperty(u,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),u.formAssociated=!0,t(u,w)})(),(()=>{let s,n,o=[C({tagName:"usa-description",shadowDom:[p`:host{display:block;font-size:.93rem;margin-top:.5rem}`,f`<slot></slot>`]})],i=[],l=HTMLElement;n=class extends l{},a(n,"USADescriptionElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;e(null,s={value:n},o,{kind:"class",name:n.name,metadata:a},null,i),n=s.value,a&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(n,i)})()})(),Symbol.metadata??=Symbol("Symbol.metadata");class j extends Map{}class A{scheduler=null;changes=new j}class O extends WeakMap{read(e){let t=this.get(e);return t||(t=new A,this.set(e,t)),t}}class P{effects=new Set}class N extends WeakMap{read(e){let t=this.get(e);return t||(t=new P,this.set(e,t)),t}}const H=new O,R=new N;function T(){return function(e,t){const a=R.read(t.metadata);return{init(e){let a=null;try{a=t.access.get(this)}catch{}return a?(Reflect.deleteProperty(this,t.name),a):e},set(s){const n=H.read(this);null===n.scheduler&&(n.scheduler=Promise.resolve().then((()=>{for(let e of a.effects)e.call(this,n.changes);n.scheduler=null,n.changes.clear()}))),n.changes.set(t.name,{oldValue:e.get.call(this),newValue:s}),e.set.call(this,s)}}}}function L(){return function(e,t){R.read(t.metadata).effects.add(e)}}function D(e){const t=new Image;return t.height=40,t.width=40,t.src=URL.createObjectURL(e),t.ariaHidden="true",t}var I;(()=>{var o,i;let l,r,c,d,h=[C({tagName:"usa-file-input-preview",shadowDom:[p`*{box-sizing:border-box}:host{display:block;font-size:.87rem;pointer-events:none;position:relative;text-align:left;word-wrap:anywhere;z-index:3}:host([hidden]){display:none}img{border:0;display:block;height:2.5rem;margin-right:.5rem;-o-object-fit:contain;object-fit:contain;width:2.5rem}.preview-heading{align-items:center;background:#d9e8f6;display:flex;pointer-events:none;position:relative;z-index:3;font-weight:700;justify-content:space-between;padding:.5rem;text-align:left}.preview-item{align-items:center;background:#d9e8f6;display:flex;padding:.5rem;width:100%;margin-top:1px}`,f`<slot class="preview-heading"></slot>`]})],u=[],m=HTMLElement,b=[],g=[],v=[];r=class extends m{constructor(){super(...arguments),i.set(this,(t(this,b),t(this,g,null))),o.set(this,(t(this,v),new Map))}get files(){return s(this,i,"f")}set files(e){n(this,i,e,"f")}connectedCallback(){this.onChange()}onChange(){if(this.files){this.hidden=!1;let e=new Set;for(let t of this.files)if(e.add(t.name),!s(this,o,"f").has(t.name)){const e=document.createElement("div");e.id=t.name,e.className="preview-item";const a=D(t);e.append(a,document.createTextNode(t.name)),this.shadowRoot.append(e),s(this,o,"f").set(t.name,e)}for(let[t,a]of s(this,o,"f"))e.has(t)||(a.remove(),s(this,o,"f").delete(t))}else this.hidden=!0}},o=new WeakMap,i=new WeakMap,a(r,"USAFileInputPreviewElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(m[Symbol.metadata]??null):void 0;c=[T()],d=[L()],e(r,null,c,{kind:"accessor",name:"files",static:!1,private:!1,access:{has:e=>"files"in e,get:e=>e.files,set:(e,t)=>{e.files=t}},metadata:a},g,v),e(r,null,d,{kind:"method",name:"onChange",static:!1,private:!1,access:{has:e=>"onChange"in e,get:e=>e.onChange},metadata:a},null,b),e(null,l={value:r},h,{kind:"class",name:r.name,metadata:a},null,u),r=l.value,a&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(r,u)})()})(),(()=>{var o,i,l,r,c,d;let m,b,g,v=[C({tagName:"usa-icon",shadowDom:[p`:host{display:inline-block;height:2rem;position:relative;width:2rem}svg{fill:currentColor;height:100%;width:100%}`,f`<svg class="usa-icon" aria-hidden="true" focusable="false" role="img"><use></use></svg>`]}),h()],y=[],k=HTMLElement,w=[],x=[];b=class extends k{constructor(){super(...arguments),o.add(this),d.set(this,t(this,w,"accessibility_new")),i.set(this,(t(this,x),M("use"))),l.set(this,u(E)),r.set(this,!1)}get icon(){return s(this,d,"f")}set icon(e){n(this,d,e,"f")}connectedCallback(){n(this,r,!0,"f"),s(this,o,"m",c).call(this)}attributeChangedCallback(){s(this,r,"f")&&s(this,o,"m",c).call(this)}},i=new WeakMap,l=new WeakMap,r=new WeakMap,o=new WeakSet,d=new WeakMap,c=function(){const e=s(this,l,"f").call(this),t=s(this,i,"f").call(this);this.icon!==t.getAttribute("href")&&t.setAttribute("href",`${e.spriteSheet}#${this.icon}`)},a(b,"USAIconElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;g=[S()],e(b,null,g,{kind:"accessor",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:a},w,x),e(null,m={value:b},v,{kind:"class",name:b.name,metadata:a},null,y),b=m.value,a&&Object.defineProperty(b,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(b,y)})()})(),(()=>{var o,i,l,r,c,d;let h,u,m,b,g,v,y,k,w=[C({tagName:"usa-input",shadowDom:[p`*{box-sizing:border-box}:host{font-family:Source Sans Pro Web,Helvetica Neue,Helvetica,Roboto,Arial,sans-serif;font-size:1.06rem;line-height:1.3;display:block;font-weight:400;max-width:30rem;margin-bottom:1.5rem}input{border-width:1px;border-color:#5c5c5c;border-style:solid;border-radius:0;color:#1b1b1b;display:block;height:2.5rem;line-height:1.3;font-size:1.06rem;margin-top:.5rem;padding:.5rem;width:100%}input:not(:disabled):focus{outline:.25rem solid #2491ff;outline-offset:0}`,f`<label><slot></slot><input></label>`]})],E=[],W=HTMLElement,j=[],A=[],O=[],P=[],N=[],H=[],R=[],D=[],I=[];u=class extends W{constructor(){super(...arguments),l.set(this,(t(this,j),t(this,A,""))),r.set(this,(t(this,O),t(this,P,"on"))),c.set(this,(t(this,N),t(this,H,""))),d.set(this,(t(this,R),t(this,D,""))),o.set(this,(t(this,I),this.attachInternals())),i.set(this,M("input"))}get name(){return s(this,l,"f")}set name(e){n(this,l,e,"f")}get autocomplete(){return s(this,r,"f")}set autocomplete(e){n(this,r,e,"f")}get placeholder(){return s(this,c,"f")}set placeholder(e){n(this,c,e,"f")}get value(){return s(this,d,"f")}set value(e){n(this,d,e,"f")}get selectionStart(){const{selectionStart:e}=s(this,i,"f").call(this);return e}setSelectionRange(e,t){s(this,i,"f").call(this).setSelectionRange(e,t)}onChange(){s(this,i,"f").call(this).value=this.value}onInputChange(){const e=s(this,i,"f").call(this);s(this,o,"f").setFormValue(e.value),this.value=e.value}attributeChangedCallback(e){const t=s(this,i,"f").call(this);switch(e){case"autocomplete":t.autocomplete=this.autocomplete;break;case"placeholder":t.placeholder=this.placeholder;break;case"name":t.name=this.name;break;case"value":t.value=this.value,s(this,o,"f").setFormValue(this.value)}}},o=new WeakMap,i=new WeakMap,l=new WeakMap,r=new WeakMap,c=new WeakMap,d=new WeakMap,a(u,"USATextInputElement"),(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(W[Symbol.metadata]??null):void 0;m=[S()],b=[S()],g=[S()],v=[S({reflect:!1}),T()],y=[L()],k=[x("input")],e(u,null,m,{kind:"accessor",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:t},A,O),e(u,null,b,{kind:"accessor",name:"autocomplete",static:!1,private:!1,access:{has:e=>"autocomplete"in e,get:e=>e.autocomplete,set:(e,t)=>{e.autocomplete=t}},metadata:t},P,N),e(u,null,g,{kind:"accessor",name:"placeholder",static:!1,private:!1,access:{has:e=>"placeholder"in e,get:e=>e.placeholder,set:(e,t)=>{e.placeholder=t}},metadata:t},H,R),e(u,null,v,{kind:"accessor",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:t},D,I),e(u,null,y,{kind:"method",name:"onChange",static:!1,private:!1,access:{has:e=>"onChange"in e,get:e=>e.onChange},metadata:t},null,j),e(u,null,k,{kind:"method",name:"onInputChange",static:!1,private:!1,access:{has:e=>"onInputChange"in e,get:e=>e.onInputChange},metadata:t},null,j),e(null,h={value:u},w,{kind:"class",name:u.name,metadata:t},null,E),u=h.value,t&&Object.defineProperty(u,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),u.formAssociated=!0,t(u,E)})(),function(e){e.Any="*",e.Number="9",e.Letter="A"}(I||(I={}));const z=Object.values(I),U={Letters:/^[a-z]/i,Numbers:/^[0-9]/i};function V(e,t){const a=e.replace(/[^a-z0-9]/gi,""),s=a.split("");let n=0,o="";for(var i=0;i<t.length;i++){const e=t[i],a=s[n];a&&e&&(e===I.Any?(o+=a,n++):e===I.Number?(/^[0-9]/i.test(a)&&(o+=a),n++):e===I.Letter?(/^[a-z]/i.test(a)&&(o+=a),n++):o+=e)}return{raw:a,formatted:o}}(()=>{var o,i,l;let r,c,d,h,u,m=[C({tagName:"usa-input-mask",shadowDom:[p`:host{display:contents}`,f`<slot></slot>`]})],b=[],g=HTMLElement,v=[],y=[],k=[];c=class extends g{get mask(){return s(this,l,"f")}set mask(e){n(this,l,e,"f")}connectedCallback(){for(let e of this.querySelectorAll("[mask]")){const{formatted:t}=V(e.value,s(this,o,"m",i).call(this,e));e.value=t}}async onInput(e){const t=e.target,a=t.selectionStart||0,n=t.value,l=s(this,o,"m",i).call(this,t),{formatted:r}=V(t.value,l);t.value=r;const c=t.value.length-n.length,d=l[a-1];await Promise.resolve(),d&&!z.includes(d)&&c>0?t.setSelectionRange(a+c,a+c):t.setSelectionRange(a,a),n!==t.value&&t.dispatchEvent(new Event("input",{bubbles:!0}))}onKeyDown(e){const t=e.target,a=s(this,o,"m",i).call(this,t),n=a[t.selectionStart||0];1===e.key.length&&/^[a-z0-9]/i.test(e.key)&&(t.value.length>=a.length?e.preventDefault():n===I.Number?U.Numbers.test(e.key)||e.preventDefault():n===I.Letter&&(U.Letters.test(e.key)||e.preventDefault()))}constructor(){super(...arguments),o.add(this),l.set(this,(t(this,v),t(this,y,""))),t(this,k)}},o=new WeakSet,l=new WeakMap,i=function(e){return this.mask||e.getAttribute("mask")||""},a(c,"USAInputMaskElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(g[Symbol.metadata]??null):void 0;d=[S()],h=[x("input")],u=[x("keydown")],e(c,null,d,{kind:"accessor",name:"mask",static:!1,private:!1,access:{has:e=>"mask"in e,get:e=>e.mask,set:(e,t)=>{e.mask=t}},metadata:a},y,k),e(c,null,h,{kind:"method",name:"onInput",static:!1,private:!1,access:{has:e=>"onInput"in e,get:e=>e.onInput},metadata:a},null,v),e(c,null,u,{kind:"method",name:"onKeyDown",static:!1,private:!1,access:{has:e=>"onKeyDown"in e,get:e=>e.onKeyDown},metadata:a},null,v),e(null,r={value:c},m,{kind:"class",name:c.name,metadata:a},null,b),c=r.value,a&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(c,b)})()})(),(()=>{var o,i,l,r,c;let d,h,u,m,b,g,v=[C({tagName:"usa-link",shadowDom:[p`:host{display:inline;color:#005ea2;text-decoration:underline}a{color:inherit}`,f`<a><slot></slot></a>`]})],y=[],k=HTMLElement,w=[],x=[],E=[],W=[],j=[],A=[],O=[],P=[];h=class extends k{constructor(){super(...arguments),i.set(this,t(this,w,"")),l.set(this,(t(this,x),t(this,E,""))),r.set(this,(t(this,W),t(this,j,""))),c.set(this,(t(this,A),t(this,O,!1))),o.set(this,(t(this,P),M("a")))}get href(){return s(this,i,"f")}set href(e){n(this,i,e,"f")}get target(){return s(this,l,"f")}set target(e){n(this,l,e,"f")}get title(){return s(this,r,"f")}set title(e){n(this,r,e,"f")}get disabled(){return s(this,c,"f")}set disabled(e){n(this,c,e,"f")}attributeChangedCallback(e){const t=s(this,o,"f").call(this);switch(e){case"href":t.href=this.href;break;case"target":t.target=this.target;break;case"title":t.target=this.title}}},o=new WeakMap,i=new WeakMap,l=new WeakMap,r=new WeakMap,c=new WeakMap,a(h,"USALinkElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;u=[S()],m=[S()],b=[S()],g=[S()],e(h,null,u,{kind:"accessor",name:"href",static:!1,private:!1,access:{has:e=>"href"in e,get:e=>e.href,set:(e,t)=>{e.href=t}},metadata:a},w,x),e(h,null,m,{kind:"accessor",name:"target",static:!1,private:!1,access:{has:e=>"target"in e,get:e=>e.target,set:(e,t)=>{e.target=t}},metadata:a},E,W),e(h,null,b,{kind:"accessor",name:"title",static:!1,private:!1,access:{has:e=>"title"in e,get:e=>e.title,set:(e,t)=>{e.title=t}},metadata:a},j,A),e(h,null,g,{kind:"accessor",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:a},O,P),e(null,d={value:h},v,{kind:"class",name:h.name,metadata:a},null,y),h=d.value,a&&Object.defineProperty(h,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(h,y)})()})();let F=(()=>{var o,i,l,r,c;let d,h,u,m,b,g,v=[C({tagName:"usa-radio",shadowDom:[p`:host{display:block}.radios{display:flex;flex-direction:column;gap:1rem}label{display:flex;cursor:pointer;gap:.5rem}input{position:absolute;left:-999em;right:auto}label::before{content:" ";display:block;left:0;height:1.25rem;border-radius:99rem;width:1.25rem;background:#fff;box-shadow:0 0 0 2px #1b1b1b}label:has(input:checked)::before{background-color:#005ea2;box-shadow:0 0 0 2px #005ea2,inset 0 0 0 2px #fff}label:has(input:focus)::before{outline:.25rem solid #2491ff;outline-offset:.25rem}:host([tiled]) .radios{gap:.5rem}:host([tiled]) label{background-color:#fff;border:2px solid #c9c9c9;color:#1b1b1b;border-radius:.25rem;padding:.75rem 1rem .75rem .75rem}:host([tiled]) label:has(input:checked){background-color:rgba(0,94,162,.1);border-color:#005ea2}`,f`<slot></slot><div class="radios"></div>`]})],y=[],k=HTMLElement,w=[],E=[],W=[],j=[],A=[],O=[],P=[];return h=class extends k{constructor(){super(...arguments),l.set(this,(t(this,w),t(this,E,""))),r.set(this,(t(this,W),t(this,j,""))),c.set(this,(t(this,A),t(this,O,!1))),o.set(this,(t(this,P),M(".radios"))),i.set(this,this.attachInternals())}get value(){return s(this,l,"f")}set value(e){n(this,l,e,"f")}get name(){return s(this,r,"f")}set name(e){n(this,r,e,"f")}get tiled(){return s(this,c,"f")}set tiled(e){n(this,c,e,"f")}onChange(e){e.target instanceof HTMLInputElement&&e.target.checked&&(this.value=e.target.value,s(this,i,"f").setFormValue(e.target.value))}connectedCallback(){this.value&&s(this,i,"f").setFormValue(this.value)}attributeChangedCallback(){const e=s(this,o,"f").call(this);for(let t of e.querySelectorAll("input"))t.checked=t.value===this.value,t.name=this.name}onOptionAdded(e){const t=s(this,o,"f").call(this),a=document.createElement("label");a.id=e.value;const n=document.createElement("input");n.type="radio",n.name=this.name,n.value=e.value,n.checked=this.value===e.value;const i=document.createElement("slot");i.name=e.value,a.append(n,i),t.append(a)}onOptionRemoved(e){const t=s(this,o,"f").call(this).querySelector(`#${e.value}`);t&&t.remove()}},o=new WeakMap,i=new WeakMap,l=new WeakMap,r=new WeakMap,c=new WeakMap,a(h,"USARadioElement"),(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;u=[S()],m=[S()],b=[S()],g=[x("change")],e(h,null,u,{kind:"accessor",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:t},E,W),e(h,null,m,{kind:"accessor",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:t},j,A),e(h,null,b,{kind:"accessor",name:"tiled",static:!1,private:!1,access:{has:e=>"tiled"in e,get:e=>e.tiled,set:(e,t)=>{e.tiled=t}},metadata:t},O,P),e(h,null,g,{kind:"method",name:"onChange",static:!1,private:!1,access:{has:e=>"onChange"in e,get:e=>e.onChange},metadata:t},null,w),e(null,d={value:h},v,{kind:"class",name:h.name,metadata:t},null,y),h=d.value,t&&Object.defineProperty(h,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),h.formAssociated=!0,t(h,y),h})();(()=>{var o,i;let l,r,c,d=[C({tagName:"usa-radio-option",shadowDom:[p`:host{display:inline-flex;flex-direction:column}`,f`<slot></slot>`]})],h=[],u=HTMLElement,m=[],b=[];r=class extends u{constructor(){super(...arguments),i.set(this,t(this,m,"")),o.set(this,(t(this,b),null))}get value(){return s(this,i,"f")}set value(e){n(this,i,e,"f")}attributeChangedCallback(){this.slot=this.value}connectedCallback(){this.parentElement instanceof F&&(n(this,o,this.parentElement,"f"),this.parentElement.onOptionAdded(this))}disconnectedCallback(){s(this,o,"f")&&s(this,o,"f").onOptionRemoved(this)}},o=new WeakMap,i=new WeakMap,a(r,"USARadioOptionElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;c=[S()],e(r,null,c,{kind:"accessor",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:a},m,b),e(null,l={value:r},d,{kind:"class",name:r.name,metadata:a},null,h),r=l.value,a&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(r,h)})()})();let q=(()=>{var o,i,l,r,c,d;let h,u,m,b,g,v=[C({tagName:"usa-select",shadowDom:[p`:host{display:block;font-family:Source Sans Pro Web,Helvetica Neue,Helvetica,Roboto,Arial,sans-serif;line-height:1.3;position:relative;width:100%;max-width:30rem}select{font-size:1.06rem;appearance:none;border-width:1px;border-color:#5c5c5c;border-style:solid;border-radius:0;color:#1b1b1b;display:block;height:2.5rem;margin-top:.5rem;padding:.5rem;width:100%}select:not(:disabled):focus{outline:.25rem solid #2491ff;outline-offset:0}usa-icon{position:absolute;right:.5rem;bottom:12%;height:1.5rem;width:1.5rem}`,f`<usa-icon icon="unfold_more"></usa-icon><label><div class="label"><slot></slot></div><select></select></label>`]})],y=[],k=HTMLElement,w=[],E=[],W=[],j=[],A=[];return u=class extends k{constructor(){super(...arguments),o.add(this),c.set(this,(t(this,w),t(this,E,""))),d.set(this,(t(this,W),t(this,j,""))),i.set(this,(t(this,A),M("select"))),l.set(this,this.attachInternals())}get value(){return s(this,c,"f")}set value(e){n(this,c,e,"f")}get name(){return s(this,d,"f")}set name(e){n(this,d,e,"f")}connectedCallback(){const e=s(this,i,"f").call(this);e.value=this.value,e.name=this.name,s(this,l,"f").setFormValue(this.value)}onSelectChange(){const e=s(this,i,"f").call(this);s(this,l,"f").setFormValue(e.value)}onOptionAdded(e){const t=document.createElement("option");t.value=e.value,t.innerHTML=e.innerHTML,t.id=s(this,o,"m",r).call(this,e.value);s(this,i,"f").call(this).append(t)}onOptionRemoved(e){const t=s(this,i,"f").call(this).querySelector(`#${s(this,o,"m",r).call(this,e.value)}`);t&&t.remove()}},i=new WeakMap,l=new WeakMap,o=new WeakSet,c=new WeakMap,d=new WeakMap,r=function(e){return e.split(" ").join("-").toLowerCase()},a(u,"USASelectElement"),(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;m=[S()],b=[S()],g=[x("change")],e(u,null,m,{kind:"accessor",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:t},E,W),e(u,null,b,{kind:"accessor",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:t},j,A),e(u,null,g,{kind:"method",name:"onSelectChange",static:!1,private:!1,access:{has:e=>"onSelectChange"in e,get:e=>e.onSelectChange},metadata:t},null,w),e(null,h={value:u},v,{kind:"class",name:u.name,metadata:t},null,y),u=h.value,t&&Object.defineProperty(u,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),u.formAssociated=!0,t(u,y),u})();(()=>{var o,i;let l,r,c,d=[C({tagName:"usa-select-option",shadowDom:[p`:host{display:none}`]})],h=[],u=HTMLElement,m=[],f=[];r=class extends u{constructor(){super(...arguments),i.set(this,t(this,m,"")),o.set(this,(t(this,f),null))}get value(){return s(this,i,"f")}set value(e){n(this,i,e,"f")}connectedCallback(){this.parentElement instanceof q&&(n(this,o,this.parentElement,"f"),this.parentElement.onOptionAdded(this))}disconnectedCallback(){s(this,o,"f")&&s(this,o,"f").onOptionRemoved(this)}},o=new WeakMap,i=new WeakMap,a(r,"USASelecOptionElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;c=[S()],e(r,null,c,{kind:"accessor",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:a},m,f),e(null,l={value:r},d,{kind:"class",name:r.name,metadata:a},null,h),r=l.value,a&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(r,h)})()})(),(()=>{var o;let i,l,r,c=[C({tagName:"usa-tag",shadowDom:[p`:host{font-family:Source Sans Pro Web,Helvetica Neue,Helvetica,Roboto,Arial,sans-serif;font-size:.93rem;color:#fff;text-transform:uppercase;background-color:#5c5c5c;border-radius:2px;margin-right:.25rem;padding:1px .5rem}:host([variant=big]){padding-left:.5rem;padding-right:.5rem;font-size:1.06rem}`,f`<slot></slot>`]})],d=[],h=HTMLElement,u=[],m=[];l=class extends h{get variant(){return s(this,o,"f")}set variant(e){n(this,o,e,"f")}constructor(){super(...arguments),o.set(this,t(this,u,"default")),t(this,m)}},o=new WeakMap,a(l,"USATagElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;r=[S()],e(l,null,r,{kind:"accessor",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:a},u,m),e(null,i={value:l},c,{kind:"class",name:l.name,metadata:a},null,d),l=i.value,a&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(l,d)})()})()}();
1
+ !function(){"use strict";function e(e,t,a,s,n,i){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var l,r=s.kind,c="getter"===r?"get":"setter"===r?"set":"value",d=!t&&e?s.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,s.name):{}),u=!1,m=a.length-1;m>=0;m--){var p={};for(var f in s)p[f]="access"===f?{}:s[f];for(var f in s.access)p.access[f]=s.access[f];p.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(e||null))};var b=(0,a[m])("accessor"===r?{get:h.get,set:h.set}:h[c],p);if("accessor"===r){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(l=o(b.get))&&(h.get=l),(l=o(b.set))&&(h.set=l),(l=o(b.init))&&n.unshift(l)}else(l=o(b))&&("field"===r?n.unshift(l):h[c]=l)}d&&Object.defineProperty(d,s.name,h),u=!0}function t(e,t,a){for(var s=arguments.length>2,n=0;n<t.length;n++)a=s?t[n].call(e,a):t[n].call(e);return s?a:void 0}function a(e,t,a){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:a?"".concat(a," ",t):t})}function s(e,t,a,s){if("a"===a&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?s:"a"===a?s.call(e):s?s.value:t.get(e)}function n(e,t,a,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,a):n?n.value=a:t.set(e,a),a}function i(e){return e[Symbol.metadata]}"function"==typeof SuppressedError&&SuppressedError;class o{#e;#t;get name(){return this.#e}get factory(){return this.#t}constructor(e,t){this.#e=e,this.#t=t}}const l=new WeakMap;class r{#a=new WeakMap;parent;providers;constructor(e=[],t){this.parent=t,this.providers=e}inject(e){if(this.#a.has(e)){const t=this.#a.get(e),a=i(e);return a&&c(t,a.onInjected),t}const t=this.#s(e);if(t){if(t.use){const a=t.use;return this.#n(e,(()=>new a))}if(t.factory){const a=t.factory;return this.#n(e,a)}throw new Error(`Provider for ${e.name} found but is missing either 'use' or 'factory'`)}if(this.parent)return this.parent.inject(e);if(e instanceof o){if(!e.factory)throw new Error(`Provider not found for "${e.name}"`);return this.#n(e,e.factory)}return this.#n(e,(()=>new e))}setParent(e){this.parent=e}clear(){this.#a=new WeakMap}#n(e,t){const a=t(this);if(this.#a.set(e,a),"object"==typeof a&&null!==a){const t=l.get(a);t&&t.setParent(this);const s=i(e);s&&(c(a,s.onCreated),c(a,s.onInjected))}return a}#s(e){if(this.providers)for(let t=0;t<this.providers.length;t++)if(this.providers[t].provide===e)return this.providers[t]}}function c(e,t){if(Array.isArray(t))for(let a of t)"function"==typeof a&&a.call(e)}function d(e,t){return{[e.name]:class extends e{constructor(...e){super(),this.addEventListener("finddiroot",(e=>{e.stopPropagation();const t=function(e){const t=e.composedPath();for(let e=1;e<t.length;e++){const a=t[e],s=l.get(a);if(s)return s;if(a===document.body)return null}return null}(e);t&&l.get(this)?.setParent(t)}))}connectedCallback(){this.isConnected&&(this.dispatchEvent(new Event("finddiroot",{bubbles:!0,composed:!0})),super.connectedCallback&&super.connectedCallback())}disconnectedCallback(){l.get(this)?.setParent(void 0),super.disconnectedCallback&&super.disconnectedCallback()}}}[e.name]}function h(e){return function(t,a){const s={[t.name]:class extends t{constructor(...t){super(...t);const a=new r(e?.providers);a.providers.push({provide:r,factory:()=>a}),l.set(this,a)}}};return"HTMLElement"in globalThis&&HTMLElement.prototype.isPrototypeOf(t.prototype)?d(s[t.name]):s[t.name]}}function u(e){return function(){const t=l.get(this);if(void 0===t){const e=this.constructor.name;throw new Error(`${e} is either not injectable or a service is being called in the constructor. \n Either add the @injectable() to your class or use the @injected callback method.`)}return t.inject(e)}}Symbol.metadata??=Symbol("Symbol.metadata");class m{#i;constructor(e,...t){this.#i=document.createElement("template"),this.#i.innerHTML=g(e)}apply(e){e.shadowRoot&&e.shadowRoot.append(this.#i.content.cloneNode(!0))}}function p(e,...t){return new m(e,...t)}class f{#o;constructor(e,...t){this.#o=new CSSStyleSheet,this.#o.replaceSync(g(e))}apply(e){e.shadowRoot&&(e.shadowRoot.adoptedStyleSheets=[...e.shadowRoot.adoptedStyleSheets,this.#o])}}function b(e){return new f(e)}function g(e){let t="";for(let a=0;a<e.length;a++)t+=e[a];return t}Symbol.metadata??=Symbol("Symbol.metadata");class v extends Map{}class k extends Map{}class y{attrs=new v;attrChanges=new k;listeners=[];onReady=new Set}class w extends WeakMap{read(e){return this.has(e)||this.set(e,new y),this.get(e)}}const S=new w;function x(e){return function({get:t,set:a},s){const n=e?.name??function(e){let t;if("symbol"==typeof e){if(!e.description)throw new Error("Cannot handle Symbol property without description");t=e.description}else t=e;return t.toLowerCase().replaceAll(" ","-")}(s.name),i=S.read(s.metadata),o=e?.reflect??!0;return i.attrs.set(n,{propName:s.name,observe:e?.observed??!0,reflect:o,getPropValue:t,setPropValue:a}),{set(e){if(o)if(!0===e)this.hasAttribute(n)||this.setAttribute(n,"");else if(!1===e)this.hasAttribute(n)&&this.removeAttribute(n);else{const t=String(e);this.getAttribute(n)!==t&&this.setAttribute(n,t)}a.call(this,e)}}}}function C(e,t){return function(a,s){const n=S.read(s.metadata);let i=e=>e.shadowRoot??e;t&&(i="string"==typeof t?e=>e.shadowRoot?e.shadowRoot.querySelector(t):e.querySelector(t):t),n.listeners.push({event:e,cb:a,selector:i})}}function M(e){return function(t,a){const s=S.read(a.metadata);a.addInitializer((function(){e?.tagName&&(customElements.get(e.tagName)||customElements.define(e.tagName,this))}));const n={[t.name]:class extends t{static observedAttributes=Array.from(s.attrs.keys());constructor(...t){if(super(...t),e?.shadowDom){this.shadowRoot||this.attachShadow(e.shadowDomOpts??{mode:"open"});for(let t of e.shadowDom)t.apply(this)}for(let{event:e,cb:t,selector:a}of s.listeners){const s=a(this);if(!s)throw new Error(`could not add listener to ${s}`);s.addEventListener(e,t.bind(this))}for(let e of s.onReady)e.call(this)}connectedCallback(){this.isConnected&&(!function(e,t){for(let[a,{getPropValue:s,reflect:n}]of t)if(n){const t=s.call(e);if(null!=t&&""!==t)if("boolean"==typeof t)!0===t&&(e.hasAttribute(a)||e.setAttribute(a,""));else{const s=String(t);e.getAttribute(a)!==s&&e.setAttribute(a,s)}}}(this,s.attrs),super.connectedCallback&&super.connectedCallback())}attributeChangedCallback(e,t,a){const n=s.attrs.get(e),i=s.attrChanges.get(e);if(n){if(t!==a){const e=n.getPropValue.call(this);""===a?n.setPropValue.call(this,!0):"number"==typeof e?n.setPropValue.call(this,Number(a)):n.setPropValue.call(this,a)}if(i)for(let e of i)e.call(this,t,a);super.attributeChangedCallback&&super.attributeChangedCallback(e,t,a)}}}};return n[t.name]}}function E(e){let t=null;return function(){if(t)return t;if(t=this.shadowRoot?this.shadowRoot.querySelector(e):this.querySelector(e),!t)throw new Error("could not find element");return t}}class W{constructor(){this.spriteSheet=""}}(()=>{var i,o;let l,c,d,m=[M({tagName:"usa-config",shadowDom:[b`:host{display:contents}`,p`<slot></slot>`]}),h()],f=[],g=HTMLElement,v=[],k=[];c=class extends g{constructor(){super(...arguments),o.set(this,t(this,v,"/assets/img/sprite.svg")),i.set(this,(t(this,k),u(r)))}get spriteSheet(){return s(this,o,"f")}set spriteSheet(e){n(this,o,e,"f")}connectedCallback(){const{providers:e}=s(this,i,"f").call(this);e.push({provide:W,factory:()=>this})}},i=new WeakMap,o=new WeakMap,a(c,"USAConfigElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(g[Symbol.metadata]??null):void 0;d=[x()],e(c,null,d,{kind:"accessor",name:"spriteSheet",static:!1,private:!1,access:{has:e=>"spriteSheet"in e,get:e=>e.spriteSheet,set:(e,t)=>{e.spriteSheet=t}},metadata:a},v,k),e(null,l={value:c},m,{kind:"class",name:c.name,metadata:a},null,f),c=l.value,a&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(c,f)})()})();const A={info:{icon:"info"},warning:{icon:"warning"},success:{icon:"check_circle"},error:{icon:"error"},emergency:{icon:"error"}};(()=>{var i,o;let l,r,c,d=[M({tagName:"usa-alert",shadowDom:[b`:host{display:block;border-left:.5rem solid #adadad;padding:1rem 1.2rem;color:#1b1b1b;margin-bottom:1rem}:host([type=info]){border-left-color:#00bde3;background-color:#e7f6f8}:host([type=warning]){background-color:#faf3d1;border-left-color:#ffbe2e}:host([type=success]){background-color:#ecf3ec;border-left-color:#00a91c}:host([type=error]){background-color:#f4e3db;border-left-color:#d54309}:host([type=emergency]){background-color:#9c3d10;border-left-color:#9c3d10;color:#fff}:host([type=emergency]) ::slotted(*){color:#fff}.alert-heading{display:grid;grid-template-columns:auto 1fr;align-items:center}usa-icon{margin:-.28rem .75rem 0 0}#heading::slotted(*){font-family:Source Sans Pro Web,Helvetica Neue,Helvetica,Roboto,Arial,sans-serif;font-size:1.33rem;line-height:.9;margin-top:0;margin-bottom:.5rem}`,p`<div class="alert-heading"><usa-icon icon="check_circle"></usa-icon><div><slot id="heading" name="heading"></slot></div><div class="spacer"></div><div><slot></slot></div></div>`]})],h=[],u=HTMLElement,m=[],f=[];r=class extends u{constructor(){super(...arguments),o.set(this,t(this,m,"info")),i.set(this,(t(this,f),E("usa-icon")))}get type(){return s(this,o,"f")}set type(e){n(this,o,e,"f")}attributeChangedCallback(){s(this,i,"f").call(this).icon=A[this.type].icon}},i=new WeakMap,o=new WeakMap,a(r,"USAAlertElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;c=[x()],e(r,null,c,{kind:"accessor",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:a},m,f),e(null,l={value:r},d,{kind:"class",name:r.name,metadata:a},null,h),r=l.value,a&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(r,h)})()})(),(()=>{var i,o,l,r,c,d,h;let u,m,f,g,v,k,y,w=[M({tagName:"usa-button",shadowDom:[b`:host{display:contents}.usa-button{box-sizing:border-box;font-family:Source Sans Pro Web,Helvetica Neue,Helvetica,Roboto,Arial,sans-serif;font-size:1.06rem;line-height:.9;color:#fff;background-color:#005ea2;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;border:0;border-radius:.25rem;cursor:pointer;-moz-column-gap:.5rem;column-gap:.5rem;display:inline-flex;font-weight:700;justify-content:center;padding:.75rem 1.25rem;text-align:center;text-decoration:none;width:100%;cursor:pointer}@media all and (min-width:30em){.usa-button{width:auto}}.usa-button:visited{color:#fff}.usa-button:hover{color:#fff;background-color:#1a4480;border-bottom:0;text-decoration:none}.usa-button:active{color:#fff;background-color:#162e51}.usa-button:not([disabled]):focus{outline-offset:.25rem}.usa-button:disabled{color:#454545;background-color:#c9c9c9;cursor:not-allowed;opacity:1}.usa-button:disabled:active,.usa-button:disabled:focus,.usa-button:disabled:hover{color:#454545;background-color:#c9c9c9}.usa-button:focus{outline:.25rem solid #2491ff;outline-offset:0}:host([variant=secondary]) .usa-button{color:#fff;background-color:#d83933}:host([variant=secondary]) .usa-button:hover{background-color:#b50909}:host([variant=secondary]) .usa-button:active{background-color:#8b0a03}:host([variant=cool]) .usa-button{color:#1b1b1b;background-color:#00bde3}:host([variant=cool]) .usa-button:hover{background-color:#28a0cb}:host([variant=cool]) .usa-button:active{color:#fff;background-color:#07648d}:host([variant=warm]) .usa-button{color:#1b1b1b;background-color:#fa9441}:host([variant=warm]) .usa-button:hover{color:#fff;background-color:#c05600}:host([variant=warm]) .usa-button:active{color:#fff;background-color:#775540}:host([variant=outline]) .usa-button{background-color:transparent;box-shadow:inset 0 0 0 2px #005ea2;color:#005ea2}:host([variant=outline]) .usa-button:hover{box-shadow:inset 0 0 0 2px #1a4480;color:#1a4480}:host([variant=outline]) .usa-button:active{box-shadow:inset 0 0 0 2px #162e51;color:#162e51}`,p`<button class="usa-button"><slot></slot></button>`]})],S=[],W=HTMLElement,A=[],j=[],O=[],P=[],N=[],T=[],D=[];m=class extends W{constructor(){super(...arguments),i.add(this),c.set(this,(t(this,A),t(this,j,"button"))),d.set(this,(t(this,O),t(this,P,!1))),h.set(this,(t(this,N),t(this,T,"primary"))),o.set(this,(t(this,D),this.attachInternals())),l.set(this,E("button"))}get type(){return s(this,c,"f")}set type(e){n(this,c,e,"f")}get disabled(){return s(this,d,"f")}set disabled(e){n(this,d,e,"f")}get variant(){return s(this,h,"f")}set variant(e){n(this,h,e,"f")}onKeyDown(e){"submit"===this.type&&"ENTER"===e.key.toUpperCase()&&s(this,i,"m",r).call(this)}onInternalClick(){s(this,i,"m",r).call(this)}attributeChangedCallback(){const e=s(this,l,"f").call(this);e.type=this.type,e.disabled=this.disabled}},o=new WeakMap,l=new WeakMap,i=new WeakSet,c=new WeakMap,d=new WeakMap,h=new WeakMap,r=function(){const{form:e}=s(this,o,"f");if(e)if("submit"===this.type){const t=document.createElement("button");t.type="submit",e.append(t),t.click(),t.remove()}else"reset"===this.type&&e.reset()},a(m,"USAButtonElement"),(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(W[Symbol.metadata]??null):void 0;f=[x()],g=[x()],v=[x()],k=[C("keydown",(()=>document.body))],y=[C("click")],e(m,null,f,{kind:"accessor",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:t},j,O),e(m,null,g,{kind:"accessor",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:t},P,N),e(m,null,v,{kind:"accessor",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:t},T,D),e(m,null,k,{kind:"method",name:"onKeyDown",static:!1,private:!1,access:{has:e=>"onKeyDown"in e,get:e=>e.onKeyDown},metadata:t},null,A),e(m,null,y,{kind:"method",name:"onInternalClick",static:!1,private:!1,access:{has:e=>"onInternalClick"in e,get:e=>e.onInternalClick},metadata:t},null,A),e(null,u={value:m},w,{kind:"class",name:m.name,metadata:t},null,S),m=u.value,t&&Object.defineProperty(m,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),m.formAssociated=!0,t(m,S)})(),(()=>{var i,o,l,r,c,d;let h,u,m,f,g,v,k,y=[M({tagName:"usa-checkbox",shadowDom:[b`*{box-sizing:border-box}:host{display:inline-block;font-family:Source Sans Pro Web,Helvetica Neue,Helvetica,Roboto,Arial,sans-serif;max-width:30rem}:host([tiled]) label{background-color:#fff;border:2px solid #c9c9c9;border-radius:.25rem;color:#1b1b1b;padding:.75rem 1rem .75rem .75rem}label{display:inline-flex;cursor:pointer;font-size:1.06rem;line-height:1.3;flex-wrap:wrap}.checkbox{background:#fff;box-shadow:0 0 0 2px #1b1b1b;display:flex;align-items:center;justify-content:center;height:1.25rem;width:1.25rem;border-radius:2px;position:relative;margin-right:.75rem}input:checked+.checkbox{background-color:#005ea2;box-shadow:0 0 0 2px #005ea2}input:checked+.checkbox::after{content:" ";display:block;height:1rem;width:.5rem;border-right:4px solid #fff;border-bottom:4px solid #fff;transform:rotate(45deg) scale(.65)}input{height:0;width:0;position:absolute;left:-999em;right:auto}input:focus+.checkbox{outline:.25rem solid #2491ff;outline-offset:.25rem}.description{display:block;font-size:.93rem;margin-top:.5rem}.break{flex-basis:100%;height:0}.spacer{height:1.25rem;width:1.25rem;margin-right:.75rem}:host([tiled]) label:has(input:checked){background-color:rgba(0,94,162,.1);border-color:#005ea2}`,p`<label><input type="checkbox"><div class="checkbox"></div><div class="title"><slot></slot></div></label>`]})],w=[],S=HTMLElement,W=[],A=[],j=[],O=[],P=[],N=[],T=[],D=[],H=[];u=class extends S{constructor(){super(...arguments),l.set(this,(t(this,W),t(this,A,!1))),r.set(this,(t(this,j),t(this,O,""))),c.set(this,(t(this,P),t(this,N,""))),d.set(this,(t(this,T),t(this,D,!1))),i.set(this,(t(this,H),E("input"))),o.set(this,this.attachInternals())}get checked(){return s(this,l,"f")}set checked(e){n(this,l,e,"f")}get name(){return s(this,r,"f")}set name(e){n(this,r,e,"f")}get value(){return s(this,c,"f")}set value(e){n(this,c,e,"f")}get tiled(){return s(this,d,"f")}set tiled(e){n(this,d,e,"f")}connectedCallback(){const e=s(this,i,"f").call(this);this.checked&&s(this,o,"f").setFormValue(this.value),e.checked=this.checked,e.name=this.name}attributeChangedCallback(){const e=s(this,i,"f").call(this);e.checked=this.checked,e.name=this.name}onCheckboxChange(){s(this,i,"f").call(this).checked?s(this,o,"f").setFormValue(this.value):s(this,o,"f").setFormValue(null)}},i=new WeakMap,o=new WeakMap,l=new WeakMap,r=new WeakMap,c=new WeakMap,d=new WeakMap,a(u,"USACheckboxElement"),(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(S[Symbol.metadata]??null):void 0;m=[x()],f=[x()],g=[x()],v=[x({observed:!1})],k=[C("change","input[type=checkbox]")],e(u,null,m,{kind:"accessor",name:"checked",static:!1,private:!1,access:{has:e=>"checked"in e,get:e=>e.checked,set:(e,t)=>{e.checked=t}},metadata:t},A,j),e(u,null,f,{kind:"accessor",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:t},O,P),e(u,null,g,{kind:"accessor",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:t},N,T),e(u,null,v,{kind:"accessor",name:"tiled",static:!1,private:!1,access:{has:e=>"tiled"in e,get:e=>e.tiled,set:(e,t)=>{e.tiled=t}},metadata:t},D,H),e(u,null,k,{kind:"method",name:"onCheckboxChange",static:!1,private:!1,access:{has:e=>"onCheckboxChange"in e,get:e=>e.onCheckboxChange},metadata:t},null,W),e(null,h={value:u},y,{kind:"class",name:u.name,metadata:t},null,w),u=h.value,t&&Object.defineProperty(u,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),u.formAssociated=!0,t(u,w)})(),(()=>{let s,n,i=[M({tagName:"usa-description",shadowDom:[b`:host{display:block;font-size:.93rem;margin-top:.5rem}`,p`<slot></slot>`]})],o=[],l=HTMLElement;n=class extends l{},a(n,"USADescriptionElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;e(null,s={value:n},i,{kind:"class",name:n.name,metadata:a},null,o),n=s.value,a&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(n,o)})()})(),Symbol.metadata??=Symbol("Symbol.metadata");class j extends Map{}class O{scheduler=null;changes=new j}class P extends WeakMap{read(e){let t=this.get(e);return t||(t=new O,this.set(e,t)),t}}class N{effects=new Set}class T extends WeakMap{read(e){let t=this.get(e);return t||(t=new N,this.set(e,t)),t}}const D=new P,H=new T;function I(){return function(e,t){const a=H.read(t.metadata);return{init(e){let a=null;try{a=t.access.get(this)}catch{}return a?(Reflect.deleteProperty(this,t.name),a):e},set(s){const n=D.read(this);null===n.scheduler&&(n.scheduler=Promise.resolve().then((()=>{for(let e of a.effects)e.call(this,n.changes);n.scheduler=null,n.changes.clear()}))),n.changes.set(t.name,{oldValue:e.get.call(this),newValue:s}),e.set.call(this,s)}}}}function L(){return function(e,t){H.read(t.metadata).effects.add(e)}}function z(e){const t=new Image;return t.height=40,t.width=40,t.src=URL.createObjectURL(e),t.ariaHidden="true",t}var R;(()=>{var i,o;let l,r,c,d,h=[M({tagName:"usa-file-input-preview",shadowDom:[b`*{box-sizing:border-box}:host{display:block;font-size:.87rem;pointer-events:none;position:relative;text-align:left;word-wrap:anywhere;z-index:3}:host([hidden]){display:none}img{border:0;display:block;height:2.5rem;margin-right:.5rem;-o-object-fit:contain;object-fit:contain;width:2.5rem}.preview-heading{align-items:center;background:#d9e8f6;display:flex;pointer-events:none;position:relative;z-index:3;font-weight:700;justify-content:space-between;padding:.5rem;text-align:left}.preview-item{align-items:center;background:#d9e8f6;display:flex;padding:.5rem;width:100%;margin-top:1px}`,p`<slot class="preview-heading"></slot>`]})],u=[],m=HTMLElement,f=[],g=[],v=[];r=class extends m{constructor(){super(...arguments),o.set(this,(t(this,f),t(this,g,null))),i.set(this,(t(this,v),new Map))}get files(){return s(this,o,"f")}set files(e){n(this,o,e,"f")}connectedCallback(){this.onChange()}onChange(){if(this.files){this.hidden=!1;let e=new Set;for(let t of this.files)if(e.add(t.name),!s(this,i,"f").has(t.name)){const e=document.createElement("div");e.id=t.name,e.className="preview-item";const a=z(t);e.append(a,document.createTextNode(t.name)),this.shadowRoot.append(e),s(this,i,"f").set(t.name,e)}for(let[t,a]of s(this,i,"f"))e.has(t)||(a.remove(),s(this,i,"f").delete(t))}else this.hidden=!0}},i=new WeakMap,o=new WeakMap,a(r,"USAFileInputPreviewElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(m[Symbol.metadata]??null):void 0;c=[I()],d=[L()],e(r,null,c,{kind:"accessor",name:"files",static:!1,private:!1,access:{has:e=>"files"in e,get:e=>e.files,set:(e,t)=>{e.files=t}},metadata:a},g,v),e(r,null,d,{kind:"method",name:"onChange",static:!1,private:!1,access:{has:e=>"onChange"in e,get:e=>e.onChange},metadata:a},null,f),e(null,l={value:r},h,{kind:"class",name:r.name,metadata:a},null,u),r=l.value,a&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(r,u)})()})(),(()=>{var i,o,l,r,c;let d,h,u,m,f,g,v=[M({tagName:"usa-link",shadowDom:[b`:host{display:inline-flex;color:#005ea2;text-decoration:underline}a{color:inherit;text-decoration:inherit;display:inherit}`,p`<a><slot></slot></a>`]})],k=[],y=HTMLElement,w=[],S=[],C=[],W=[],A=[],j=[],O=[],P=[];h=class extends y{constructor(){super(...arguments),o.set(this,t(this,w,"")),l.set(this,(t(this,S),t(this,C,""))),r.set(this,(t(this,W),t(this,A,""))),c.set(this,(t(this,j),t(this,O,!1))),i.set(this,(t(this,P),E("a")))}get href(){return s(this,o,"f")}set href(e){n(this,o,e,"f")}get target(){return s(this,l,"f")}set target(e){n(this,l,e,"f")}get title(){return s(this,r,"f")}set title(e){n(this,r,e,"f")}get disabled(){return s(this,c,"f")}set disabled(e){n(this,c,e,"f")}attributeChangedCallback(e){const t=s(this,i,"f").call(this);switch(e){case"href":t.href=this.href;break;case"target":t.target=this.target;break;case"title":t.target=this.title}}},i=new WeakMap,o=new WeakMap,l=new WeakMap,r=new WeakMap,c=new WeakMap,a(h,"USALinkElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(y[Symbol.metadata]??null):void 0;u=[x()],m=[x()],f=[x()],g=[x({observed:!1})],e(h,null,u,{kind:"accessor",name:"href",static:!1,private:!1,access:{has:e=>"href"in e,get:e=>e.href,set:(e,t)=>{e.href=t}},metadata:a},w,S),e(h,null,m,{kind:"accessor",name:"target",static:!1,private:!1,access:{has:e=>"target"in e,get:e=>e.target,set:(e,t)=>{e.target=t}},metadata:a},C,W),e(h,null,f,{kind:"accessor",name:"title",static:!1,private:!1,access:{has:e=>"title"in e,get:e=>e.title,set:(e,t)=>{e.title=t}},metadata:a},A,j),e(h,null,g,{kind:"accessor",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:a},O,P),e(null,d={value:h},v,{kind:"class",name:h.name,metadata:a},null,k),h=d.value,a&&Object.defineProperty(h,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(h,k)})()})(),(()=>{var i,o,l,r,c,d,h,u;let m,f,g,v,k,y,w,S,W=[M({tagName:"usa-file-input",shadowDom:[b`*{box-sizing:border-box}:host{display:block;max-width:30rem;position:relative}label{display:block}input{cursor:pointer;height:100%;left:0;margin:0;max-width:none;position:absolute;text-indent:-999em;top:0;width:100%;z-index:1}label slot{font-size:1.06rem;line-height:1.3;display:block;font-weight:400;margin-bottom:.5rem}.box{border:1px dashed #adadad;display:block;font-size:.93rem;position:relative;text-align:center;width:100%;max-width:30rem;padding:2rem 1rem}`,p`<label><slot></slot><input type="file"></label><div class="box"><slot name="description">Drag file here or<usa-link>choose from folder</usa-link></slot></div><usa-file-input-preview>Selected file<usa-link>Change file</usa-link></usa-file-input-preview>`]})],A=[],j=HTMLElement,O=[],P=[],N=[],T=[],D=[],H=[],z=[],R=[],U=[];f=class extends j{constructor(){super(...arguments),c.set(this,(t(this,O),t(this,P,""))),d.set(this,(t(this,N),t(this,T,!0))),h.set(this,(t(this,D),t(this,H,""))),u.set(this,(t(this,z),t(this,R,null))),i.set(this,(t(this,U),this.attachInternals())),o.set(this,E("input")),l.set(this,E(".box")),r.set(this,E("usa-file-input-preview"))}get name(){return s(this,c,"f")}set name(e){n(this,c,e,"f")}get multiple(){return s(this,d,"f")}set multiple(e){n(this,d,e,"f")}get accept(){return s(this,h,"f")}set accept(e){n(this,h,e,"f")}get files(){return s(this,u,"f")}set files(e){n(this,u,e,"f")}onChange(){const e=s(this,o,"f").call(this);this.files&&(e.files=this.files,this.onInputChange())}attributeChangedCallback(){const e=s(this,o,"f").call(this);e.name=this.name,e.multiple=this.multiple,e.accept=this.accept}onInputChange(){const e=s(this,o,"f").call(this),t=s(this,l,"f").call(this);s(this,r,"f").call(this).files=e.files;const a=new FormData;if(e.files){t.style.display="none";for(let t of e.files)a.append(this.name,t)}else t.style.display="block";s(this,i,"f").setFormValue(a)}},i=new WeakMap,o=new WeakMap,l=new WeakMap,r=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,a(f,"USAFileInputElement"),(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(j[Symbol.metadata]??null):void 0;g=[x()],v=[x()],k=[x()],y=[I()],w=[L()],S=[C("change")],e(f,null,g,{kind:"accessor",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:t},P,N),e(f,null,v,{kind:"accessor",name:"multiple",static:!1,private:!1,access:{has:e=>"multiple"in e,get:e=>e.multiple,set:(e,t)=>{e.multiple=t}},metadata:t},T,D),e(f,null,k,{kind:"accessor",name:"accept",static:!1,private:!1,access:{has:e=>"accept"in e,get:e=>e.accept,set:(e,t)=>{e.accept=t}},metadata:t},H,z),e(f,null,y,{kind:"accessor",name:"files",static:!1,private:!1,access:{has:e=>"files"in e,get:e=>e.files,set:(e,t)=>{e.files=t}},metadata:t},R,U),e(f,null,w,{kind:"method",name:"onChange",static:!1,private:!1,access:{has:e=>"onChange"in e,get:e=>e.onChange},metadata:t},null,O),e(f,null,S,{kind:"method",name:"onInputChange",static:!1,private:!1,access:{has:e=>"onInputChange"in e,get:e=>e.onInputChange},metadata:t},null,O),e(null,m={value:f},W,{kind:"class",name:f.name,metadata:t},null,A),f=m.value,t&&Object.defineProperty(f,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),f.formAssociated=!0,t(f,A)})(),(()=>{var i,o,l,r,c,d;let m,f,g,v=[M({tagName:"usa-icon",shadowDom:[b`:host{display:inline-block;height:2rem;position:relative;width:2rem}svg{fill:currentColor;height:100%;width:100%}`,p`<svg class="usa-icon" aria-hidden="true" focusable="false" role="img"><use></use></svg>`]}),h()],k=[],y=HTMLElement,w=[],S=[];f=class extends y{constructor(){super(...arguments),i.add(this),d.set(this,t(this,w,"accessibility_new")),o.set(this,(t(this,S),E("use"))),l.set(this,u(W)),r.set(this,!1)}get icon(){return s(this,d,"f")}set icon(e){n(this,d,e,"f")}connectedCallback(){n(this,r,!0,"f"),s(this,i,"m",c).call(this)}attributeChangedCallback(){s(this,r,"f")&&s(this,i,"m",c).call(this)}},o=new WeakMap,l=new WeakMap,r=new WeakMap,i=new WeakSet,d=new WeakMap,c=function(){const e=s(this,l,"f").call(this),t=s(this,o,"f").call(this);this.icon!==t.getAttribute("href")&&t.setAttribute("href",`${e.spriteSheet}#${this.icon}`)},a(f,"USAIconElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(y[Symbol.metadata]??null):void 0;g=[x()],e(f,null,g,{kind:"accessor",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:a},w,S),e(null,m={value:f},v,{kind:"class",name:f.name,metadata:a},null,k),f=m.value,a&&Object.defineProperty(f,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(f,k)})()})(),(()=>{var i,o,l,r,c,d;let h,u,m,f,g,v,k,y,w=[M({tagName:"usa-input",shadowDom:[b`*{box-sizing:border-box}:host{font-family:Source Sans Pro Web,Helvetica Neue,Helvetica,Roboto,Arial,sans-serif;font-size:1.06rem;line-height:1.3;display:block;font-weight:400;max-width:30rem;margin-bottom:1.5rem}input{border-width:1px;border-color:#5c5c5c;border-style:solid;border-radius:0;color:#1b1b1b;display:block;height:2.5rem;line-height:1.3;font-size:1.06rem;margin-top:.5rem;padding:.5rem;width:100%}input:not(:disabled):focus{outline:.25rem solid #2491ff;outline-offset:0}`,p`<label><slot></slot><input></label>`]})],S=[],W=HTMLElement,A=[],j=[],O=[],P=[],N=[],T=[],D=[],H=[],z=[];u=class extends W{constructor(){super(...arguments),l.set(this,(t(this,A),t(this,j,""))),r.set(this,(t(this,O),t(this,P,"on"))),c.set(this,(t(this,N),t(this,T,""))),d.set(this,(t(this,D),t(this,H,""))),i.set(this,(t(this,z),this.attachInternals())),o.set(this,E("input"))}get name(){return s(this,l,"f")}set name(e){n(this,l,e,"f")}get autocomplete(){return s(this,r,"f")}set autocomplete(e){n(this,r,e,"f")}get placeholder(){return s(this,c,"f")}set placeholder(e){n(this,c,e,"f")}get value(){return s(this,d,"f")}set value(e){n(this,d,e,"f")}get selectionStart(){const{selectionStart:e}=s(this,o,"f").call(this);return e}setSelectionRange(e,t){s(this,o,"f").call(this).setSelectionRange(e,t)}onChange(){s(this,o,"f").call(this).value=this.value}onInputChange(){const e=s(this,o,"f").call(this);s(this,i,"f").setFormValue(e.value),this.value=e.value}attributeChangedCallback(e){const t=s(this,o,"f").call(this);switch(e){case"autocomplete":t.autocomplete=this.autocomplete;break;case"placeholder":t.placeholder=this.placeholder;break;case"name":t.name=this.name;break;case"value":t.value=this.value,s(this,i,"f").setFormValue(this.value)}}},i=new WeakMap,o=new WeakMap,l=new WeakMap,r=new WeakMap,c=new WeakMap,d=new WeakMap,a(u,"USATextInputElement"),(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(W[Symbol.metadata]??null):void 0;m=[x()],f=[x()],g=[x()],v=[x({reflect:!1}),I()],k=[L()],y=[C("input")],e(u,null,m,{kind:"accessor",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:t},j,O),e(u,null,f,{kind:"accessor",name:"autocomplete",static:!1,private:!1,access:{has:e=>"autocomplete"in e,get:e=>e.autocomplete,set:(e,t)=>{e.autocomplete=t}},metadata:t},P,N),e(u,null,g,{kind:"accessor",name:"placeholder",static:!1,private:!1,access:{has:e=>"placeholder"in e,get:e=>e.placeholder,set:(e,t)=>{e.placeholder=t}},metadata:t},T,D),e(u,null,v,{kind:"accessor",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:t},H,z),e(u,null,k,{kind:"method",name:"onChange",static:!1,private:!1,access:{has:e=>"onChange"in e,get:e=>e.onChange},metadata:t},null,A),e(u,null,y,{kind:"method",name:"onInputChange",static:!1,private:!1,access:{has:e=>"onInputChange"in e,get:e=>e.onInputChange},metadata:t},null,A),e(null,h={value:u},w,{kind:"class",name:u.name,metadata:t},null,S),u=h.value,t&&Object.defineProperty(u,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),u.formAssociated=!0,t(u,S)})(),function(e){e.Any="*",e.Number="9",e.Letter="A"}(R||(R={}));const U=Object.values(R),V={Letters:/^[a-z]/i,Numbers:/^[0-9]/i};function F(e,t){const a=e.replace(/[^a-z0-9]/gi,""),s=a.split("");let n=0,i="";for(var o=0;o<t.length;o++){const e=t[o],a=s[n];a&&e&&(e===R.Any?(i+=a,n++):e===R.Number?(/^[0-9]/i.test(a)&&(i+=a),n++):e===R.Letter?(/^[a-z]/i.test(a)&&(i+=a),n++):i+=e)}return{raw:a,formatted:i}}(()=>{var i,o,l;let r,c,d,h,u,m=[M({tagName:"usa-input-mask",shadowDom:[b`:host{display:contents}`,p`<slot></slot>`]})],f=[],g=HTMLElement,v=[],k=[],y=[];c=class extends g{get mask(){return s(this,l,"f")}set mask(e){n(this,l,e,"f")}connectedCallback(){for(let e of this.querySelectorAll("[mask]")){const{formatted:t}=F(e.value,s(this,i,"m",o).call(this,e));e.value=t}}async onInput(e){const t=e.target,a=t.selectionStart||0,n=t.value,l=s(this,i,"m",o).call(this,t),{formatted:r}=F(t.value,l);t.value=r;const c=t.value.length-n.length,d=l[a-1];await Promise.resolve(),d&&!U.includes(d)&&c>0?t.setSelectionRange(a+c,a+c):t.setSelectionRange(a,a),n!==t.value&&t.dispatchEvent(new Event("input",{bubbles:!0}))}onKeyDown(e){const t=e.target,a=s(this,i,"m",o).call(this,t),n=a[t.selectionStart||0];1===e.key.length&&/^[a-z0-9]/i.test(e.key)&&(t.value.length>=a.length?e.preventDefault():n===R.Number?V.Numbers.test(e.key)||e.preventDefault():n===R.Letter&&(V.Letters.test(e.key)||e.preventDefault()))}constructor(){super(...arguments),i.add(this),l.set(this,(t(this,v),t(this,k,""))),t(this,y)}},i=new WeakSet,l=new WeakMap,o=function(e){return this.mask||e.getAttribute("mask")||""},a(c,"USAInputMaskElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(g[Symbol.metadata]??null):void 0;d=[x()],h=[C("input")],u=[C("keydown")],e(c,null,d,{kind:"accessor",name:"mask",static:!1,private:!1,access:{has:e=>"mask"in e,get:e=>e.mask,set:(e,t)=>{e.mask=t}},metadata:a},k,y),e(c,null,h,{kind:"method",name:"onInput",static:!1,private:!1,access:{has:e=>"onInput"in e,get:e=>e.onInput},metadata:a},null,v),e(c,null,u,{kind:"method",name:"onKeyDown",static:!1,private:!1,access:{has:e=>"onKeyDown"in e,get:e=>e.onKeyDown},metadata:a},null,v),e(null,r={value:c},m,{kind:"class",name:c.name,metadata:a},null,f),c=r.value,a&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(c,f)})()})();let K=(()=>{var i,o,l,r,c;let d,h,u,m,f,g=[M({tagName:"usa-radio-option",shadowDom:[b`:host{display:flex;flex-direction:column;margin-top:.05rem}`,p`<slot></slot>`]})],v=[],k=HTMLElement,y=[],w=[],S=[],C=[],E=[],W=[];return h=class extends k{get value(){return s(this,l,"f")}set value(e){n(this,l,e,"f")}get name(){return s(this,r,"f")}set name(e){n(this,r,e,"f")}get checked(){return s(this,c,"f")}set checked(e){n(this,c,e,"f")}constructor(){super(),l.set(this,t(this,y,"")),r.set(this,(t(this,w),t(this,S,""))),c.set(this,(t(this,C),t(this,E,!1))),this.radio=(t(this,W),document.createElement("label")),i.set(this,document.createElement("input")),o.set(this,document.createElement("slot")),s(this,i,"f").type="radio",this.radio.append(s(this,i,"f"),s(this,o,"f"))}attributeChangedCallback(){this.slot=this.value,s(this,i,"f").name=this.name,s(this,i,"f").value=this.value,s(this,i,"f").checked=this.checked,s(this,o,"f").name=this.value}connectedCallback(){this.dispatchEvent(new Event("usa::radio::option::added",{bubbles:!0}))}disconnectedCallback(){this.radio.remove()}},i=new WeakMap,o=new WeakMap,l=new WeakMap,r=new WeakMap,c=new WeakMap,a(h,"USARadioOptionElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;u=[x()],m=[x()],f=[x()],e(h,null,u,{kind:"accessor",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:a},y,w),e(h,null,m,{kind:"accessor",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:a},S,C),e(h,null,f,{kind:"accessor",name:"checked",static:!1,private:!1,access:{has:e=>"checked"in e,get:e=>e.checked,set:(e,t)=>{e.checked=t}},metadata:a},E,W),e(null,d={value:h},g,{kind:"class",name:h.name,metadata:a},null,v),h=d.value,a&&Object.defineProperty(h,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(h,v)})(),h})();(()=>{var i,o,l,r;let c,d,h,u,m,f,g,v=[M({tagName:"usa-radio",shadowDom:[b`:host{display:flex;flex-direction:column;gap:1rem;max-width:30rem}label{display:flex;cursor:pointer;gap:.5rem}input{position:absolute;left:-999em;right:auto}label::before{content:" ";display:block;left:0;height:1.25rem;border-radius:99rem;width:1.25rem;background:#fff;box-shadow:0 0 0 2px #1b1b1b;flex:0 0 1.25rem}label:has(input:checked)::before{background-color:#005ea2;box-shadow:0 0 0 2px #005ea2,inset 0 0 0 2px #fff}label:has(input:focus)::before{outline:.25rem solid #2491ff;outline-offset:.25rem}:host([tiled]){gap:.5rem}:host([tiled]) label{background-color:#fff;border:2px solid #c9c9c9;color:#1b1b1b;border-radius:.25rem;padding:.75rem 1rem .75rem .75rem}:host([tiled]) label:has(input:checked){background-color:rgba(0,94,162,.1);border-color:#005ea2}slot{display:flex}slot#main{margin-bottom:.5rem}`,p`<slot id="main"></slot>`]})],k=[],y=HTMLElement,w=[],S=[],E=[],W=[],A=[],j=[],O=[];d=class extends y{constructor(){super(...arguments),o.set(this,(t(this,w),t(this,S,""))),l.set(this,(t(this,E),t(this,W,""))),r.set(this,(t(this,A),t(this,j,!1))),i.set(this,(t(this,O),this.attachInternals()))}get value(){return s(this,o,"f")}set value(e){n(this,o,e,"f")}get name(){return s(this,l,"f")}set name(e){n(this,l,e,"f")}get tiled(){return s(this,r,"f")}set tiled(e){n(this,r,e,"f")}get shadow(){return this.shadowRoot}onChange(e){e.target instanceof HTMLInputElement&&e.target.checked&&(this.value=e.target.value,s(this,i,"f").setFormValue(e.target.value))}connectedCallback(){this.value&&s(this,i,"f").setFormValue(this.value)}attributeChangedCallback(){for(let e of this.shadow.querySelectorAll("usa-radio-option"))e.checked=e.value===this.value,e.name=this.name}onOptionAdded(e){e.target instanceof K&&(e.stopPropagation(),e.target.checked=e.target.value===this.value,e.target.name=this.name,this.shadow.append(e.target.radio))}},i=new WeakMap,o=new WeakMap,l=new WeakMap,r=new WeakMap,a(d,"USARadioElement"),(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(y[Symbol.metadata]??null):void 0;h=[x()],u=[x()],m=[x({observed:!1})],f=[C("change")],g=[C("usa::radio::option::added",(e=>e))],e(d,null,h,{kind:"accessor",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:t},S,E),e(d,null,u,{kind:"accessor",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:t},W,A),e(d,null,m,{kind:"accessor",name:"tiled",static:!1,private:!1,access:{has:e=>"tiled"in e,get:e=>e.tiled,set:(e,t)=>{e.tiled=t}},metadata:t},j,O),e(d,null,f,{kind:"method",name:"onChange",static:!1,private:!1,access:{has:e=>"onChange"in e,get:e=>e.onChange},metadata:t},null,w),e(d,null,g,{kind:"method",name:"onOptionAdded",static:!1,private:!1,access:{has:e=>"onOptionAdded"in e,get:e=>e.onOptionAdded},metadata:t},null,w),e(null,c={value:d},v,{kind:"class",name:d.name,metadata:t},null,k),d=c.value,t&&Object.defineProperty(d,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),d.formAssociated=!0,t(d,k)})();let q=(()=>{var i;let o,l,r,c=[M({tagName:"usa-select-option",shadowDom:[b`:host{display:none}`]})],d=[],h=HTMLElement,u=[],m=[];return l=class extends h{constructor(){super(...arguments),i.set(this,t(this,u,"")),this.option=(t(this,m),document.createElement("option"))}get value(){return s(this,i,"f")}set value(e){n(this,i,e,"f")}attributeChangedCallback(){this.option.textContent=this.textContent,this.option.value=this.value}connectedCallback(){this.dispatchEvent(new Event("usa::select::option::added",{bubbles:!0}))}disconnectedCallback(){this.option.remove()}},i=new WeakMap,a(l,"USASelecOptionElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;r=[x()],e(l,null,r,{kind:"accessor",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:a},u,m),e(null,o={value:l},c,{kind:"class",name:l.name,metadata:a},null,d),l=o.value,a&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(l,d)})(),l})();(()=>{var i,o,l,r;let c,d,h,u,m,f,g=[M({tagName:"usa-select",shadowDom:[b`:host{display:block;font-family:Source Sans Pro Web,Helvetica Neue,Helvetica,Roboto,Arial,sans-serif;line-height:1.3;position:relative;width:100%;max-width:30rem}select{font-size:1.06rem;appearance:none;border-width:1px;border-color:#5c5c5c;border-style:solid;border-radius:0;color:#1b1b1b;display:block;height:2.5rem;margin-top:.5rem;padding:.5rem;width:100%}select:not(:disabled):focus{outline:.25rem solid #2491ff;outline-offset:0}usa-icon{position:absolute;right:.5rem;bottom:12%;height:1.5rem;width:1.5rem}`,p`<usa-icon icon="unfold_more"></usa-icon><label><div class="label"><slot></slot></div><select></select></label>`]})],v=[],k=HTMLElement,y=[],w=[],S=[],W=[],A=[];d=class extends k{constructor(){super(...arguments),l.set(this,(t(this,y),t(this,w,""))),r.set(this,(t(this,S),t(this,W,""))),i.set(this,(t(this,A),E("select"))),o.set(this,this.attachInternals())}get value(){return s(this,l,"f")}set value(e){n(this,l,e,"f")}get name(){return s(this,r,"f")}set name(e){n(this,r,e,"f")}connectedCallback(){const e=s(this,i,"f").call(this);e.value=this.value,e.name=this.name,s(this,o,"f").setFormValue(this.value)}onSelectChange(){const e=s(this,i,"f").call(this);s(this,o,"f").setFormValue(e.value)}onOptionAdded(e){if(e.target instanceof q){e.stopPropagation();s(this,i,"f").call(this).append(e.target.option)}}},i=new WeakMap,o=new WeakMap,l=new WeakMap,r=new WeakMap,a(d,"USASelectElement"),(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;h=[x()],u=[x()],m=[C("change")],f=[C("usa::select::option::added")],e(d,null,h,{kind:"accessor",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:t},w,S),e(d,null,u,{kind:"accessor",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:t},W,A),e(d,null,m,{kind:"method",name:"onSelectChange",static:!1,private:!1,access:{has:e=>"onSelectChange"in e,get:e=>e.onSelectChange},metadata:t},null,y),e(d,null,f,{kind:"method",name:"onOptionAdded",static:!1,private:!1,access:{has:e=>"onOptionAdded"in e,get:e=>e.onOptionAdded},metadata:t},null,y),e(null,c={value:d},g,{kind:"class",name:d.name,metadata:t},null,v),d=c.value,t&&Object.defineProperty(d,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),d.formAssociated=!0,t(d,v)})(),(()=>{var i;let o,l,r,c=[M({tagName:"usa-tag",shadowDom:[b`:host{font-family:Source Sans Pro Web,Helvetica Neue,Helvetica,Roboto,Arial,sans-serif;font-size:.93rem;color:#fff;text-transform:uppercase;background-color:#5c5c5c;border-radius:2px;margin-right:.25rem;padding:1px .5rem}:host([variant=big]){padding-left:.5rem;padding-right:.5rem;font-size:1.06rem}`,p`<slot></slot>`]})],d=[],h=HTMLElement,u=[],m=[];l=class extends h{get variant(){return s(this,i,"f")}set variant(e){n(this,i,e,"f")}constructor(){super(...arguments),i.set(this,t(this,u,"default")),t(this,m)}},i=new WeakMap,a(l,"USATagElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;r=[x()],e(l,null,r,{kind:"accessor",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:a},u,m),e(null,o={value:l},c,{kind:"class",name:l.name,metadata:a},null,d),l=o.value,a&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(l,d)})()})(),(()=>{var i,o,l;let r,c,d,h,u,m,f=[M({tagName:"usa-accordion",shadowDomOpts:{mode:"open",delegatesFocus:!0},shadowDom:[b`*{box-sizing:border-box}:host{display:block}:host(:not(:first-child)) summary{margin-top:.5rem}summary{align-items:center;border:0;border-radius:0;box-shadow:none;justify-content:normal;text-align:left;padding:0;color:#1b1b1b;background-color:#f0f0f0;cursor:pointer;display:flex;font-weight:700;margin:0;padding:1rem 1.25rem 1rem 1.25rem;text-decoration:none;width:100%}summary::-webkit-details-marker{display:none}slot[name=heading]{display:block;flex:1 1 auto}slot[name=heading]::slotted(*){margin:0}.content{padding-bottom:1.5rem;padding-left:1rem;padding-top:1.5rem}usa-icon[icon=remove]{display:none}details[open] usa-icon[icon=add]{display:none}details[open] usa-icon[icon=remove]{display:block}summary:hover{background-color:#e6e6e6}summary:focus{outline:.25rem solid #2491ff;outline-offset:0}`,p`<details><summary><slot name="heading"></slot><usa-icon icon="add"></usa-icon><usa-icon icon="remove"></usa-icon></summary><div class="content"><slot></slot></div></details>`]})],g=[],v=HTMLElement,k=[],y=[],w=[],S=[],W=[];c=class extends v{constructor(){super(...arguments),o.set(this,(t(this,k),t(this,y,""))),l.set(this,(t(this,w),t(this,S,!1))),i.set(this,(t(this,W),E("details")))}get name(){return s(this,o,"f")}set name(e){n(this,o,e,"f")}get open(){return s(this,l,"f")}set open(e){n(this,l,e,"f")}attributeChangedCallback(){s(this,i,"f").call(this).open=this.open}onClick(e){e.preventDefault(),this.dispatchEvent(new $(!this.open))}onAccordionToggle(e){e.target.name===this.name?this.open=e.target===this&&e.open:e.target===this&&(this.open=e.open)}},i=new WeakMap,o=new WeakMap,l=new WeakMap,a(c,"USAAccordionElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(v[Symbol.metadata]??null):void 0;d=[x()],h=[x()],u=[C("click","summary")],m=[C("usa::accordion::toggle",(()=>document.body))],e(c,null,d,{kind:"accessor",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:a},y,w),e(c,null,h,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:a},S,W),e(c,null,u,{kind:"method",name:"onClick",static:!1,private:!1,access:{has:e=>"onClick"in e,get:e=>e.onClick},metadata:a},null,k),e(c,null,m,{kind:"method",name:"onAccordionToggle",static:!1,private:!1,access:{has:e=>"onAccordionToggle"in e,get:e=>e.onAccordionToggle},metadata:a},null,k),e(null,r={value:c},f,{kind:"class",name:c.name,metadata:a},null,g),c=r.value,a&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(c,g)})()})();class $ extends Event{get target(){return super.target}constructor(e){super("usa::accordion::toggle",{bubbles:!0}),this.open=e}}(()=>{var i;let o,l,r,c=[M({tagName:"usa-side-nav-item",shadowDom:[b`:host{--usa-nav-item-padding-left:2rem;display:block;border-top:1px solid #e6e6e6}.side-nav-item{display:flex;padding:.5rem 1rem;text-decoration:none;position:relative}.side-nav-item:hover{background-color:#f0f0f0;color:#005ea2}::slotted(*){color:#5c5c5c;text-decoration:none;display:block;width:100%}:host(:hover) ::slotted(*){color:#005ea2}:host([current]) ::slotted(:not(usa-side-nav-item)){color:#005ea2;font-weight:700}:host([current]) .side-nav-item::after{background-color:#005ea2;border-radius:99rem;content:"";display:block;position:absolute;bottom:.25rem;top:.25rem;width:.25rem;left:0}:host([slot=children]) .side-nav-item{padding-left:var(--usa-nav-item-padding-left)}:host([slot=children]) ::slotted(usa-side-nav-item){--usa-nav-item-padding-left:3rem}:host([slot=children]) .side-nav-item::after{display:none}`,p`<div class="side-nav-item"><slot></slot></div><slot name="children"></slot>`]})],d=[],h=HTMLElement,u=[],m=[];l=class extends h{get current(){return s(this,i,"f")}set current(e){n(this,i,e,"f")}constructor(){super(...arguments),i.set(this,t(this,u,!1)),t(this,m)}},i=new WeakMap,a(l,"USASideNavItemElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;r=[x({observed:!1})],e(l,null,r,{kind:"accessor",name:"current",static:!1,private:!1,access:{has:e=>"current"in e,get:e=>e.current,set:(e,t)=>{e.current=t}},metadata:a},u,m),e(null,o={value:l},c,{kind:"class",name:l.name,metadata:a},null,d),l=o.value,a&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(l,d)})()})(),(()=>{let s,n,i=[M({tagName:"usa-side-nav",shadowDom:[b`:host{display:block;font-size:1.06rem;line-height:1.3;border-bottom:1px solid #e6e6e6}`,p`<slot></slot>`]})],o=[],l=HTMLElement;n=class extends l{},a(n,"USASideNavElement"),(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;e(null,s={value:n},i,{kind:"class",name:n.name,metadata:a},null,o),n=s.value,a&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),t(n,o)})()})()}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noctuatech/uswds",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  "packages/**"
@@ -77,9 +77,9 @@
77
77
  "license": "ISC",
78
78
  "description": "",
79
79
  "dependencies": {
80
- "@joist/di": "^4.0.0-next.26",
81
- "@joist/element": "^4.0.0-next.26",
82
- "@joist/observable": "^4.0.0-next.26",
80
+ "@joist/di": "^4.0.0-next.32",
81
+ "@joist/element": "^4.0.0-next.32",
82
+ "@joist/observable": "^4.0.0-next.32",
83
83
  "tslib": "2.8.1"
84
84
  },
85
85
  "devDependencies": {
@@ -0,0 +1,147 @@
1
+ import { attr, css, element, html, listen, query } from "@joist/element";
2
+
3
+ declare global {
4
+ interface HTMLElementTagNameMap {
5
+ "usa-accordion": USAAccordionElement;
6
+ }
7
+ }
8
+
9
+ @element({
10
+ tagName: "usa-accordion",
11
+ shadowDomOpts: {
12
+ mode: "open",
13
+ delegatesFocus: true,
14
+ },
15
+ shadowDom: [
16
+ css`
17
+ * {
18
+ box-sizing: border-box;
19
+ }
20
+
21
+ :host {
22
+ display: block;
23
+ }
24
+
25
+ :host(:not(:first-child)) summary {
26
+ margin-top: 0.5rem;
27
+ }
28
+
29
+ summary {
30
+ align-items: center;
31
+ border: 0;
32
+ border-radius: 0;
33
+ box-shadow: none;
34
+ justify-content: normal;
35
+ text-align: left;
36
+ padding: 0;
37
+ color: #1b1b1b;
38
+ background-color: #f0f0f0;
39
+ cursor: pointer;
40
+ display: flex;
41
+ font-weight: 700;
42
+ margin: 0;
43
+ padding: 1rem 1.25rem 1rem 1.25rem;
44
+ text-decoration: none;
45
+ width: 100%;
46
+ }
47
+
48
+ summary::-webkit-details-marker {
49
+ display: none;
50
+ }
51
+
52
+ slot[name="heading"] {
53
+ display: block;
54
+ flex: 1 1 auto;
55
+ }
56
+
57
+ slot[name="heading"]::slotted(*) {
58
+ margin: 0;
59
+ }
60
+
61
+ .content {
62
+ padding-bottom: 1.5rem;
63
+ padding-left: 1rem;
64
+ padding-top: 1.5rem;
65
+ }
66
+
67
+ usa-icon[icon="remove"] {
68
+ display: none;
69
+ }
70
+
71
+ details[open] usa-icon[icon="add"] {
72
+ display: none;
73
+ }
74
+
75
+ details[open] usa-icon[icon="remove"] {
76
+ display: block;
77
+ }
78
+
79
+ summary:hover {
80
+ background-color: #e6e6e6;
81
+ }
82
+
83
+ summary:focus {
84
+ outline: 0.25rem solid #2491ff;
85
+ outline-offset: 0;
86
+ }
87
+ `,
88
+ html`
89
+ <details>
90
+ <summary>
91
+ <slot name="heading"></slot>
92
+
93
+ <usa-icon icon="add"></usa-icon>
94
+ <usa-icon icon="remove"></usa-icon>
95
+ </summary>
96
+
97
+ <div class="content">
98
+ <slot></slot>
99
+ </div>
100
+ </details>
101
+ `,
102
+ ],
103
+ })
104
+ export class USAAccordionElement extends HTMLElement {
105
+ @attr()
106
+ accessor name = "";
107
+
108
+ @attr()
109
+ accessor open = false;
110
+
111
+ #details = query("details");
112
+
113
+ attributeChangedCallback() {
114
+ const details = this.#details();
115
+ details.open = this.open;
116
+ }
117
+
118
+ @listen("click", "summary")
119
+ onClick(e: Event) {
120
+ e.preventDefault();
121
+
122
+ this.dispatchEvent(new USAAccordionToggleEvent(!this.open));
123
+ }
124
+
125
+ @listen("usa::accordion::toggle", () => document.body)
126
+ onAccordionToggle(e: USAAccordionToggleEvent) {
127
+ if (e.target.name === this.name) {
128
+ this.open = e.target === this && e.open;
129
+ } else if (e.target === this) {
130
+ this.open = e.open;
131
+ }
132
+ }
133
+ }
134
+
135
+ class USAAccordionToggleEvent extends Event {
136
+ open;
137
+
138
+ get target() {
139
+ return super.target as USAAccordionElement;
140
+ }
141
+
142
+ constructor(open: boolean) {
143
+ super("usa::accordion::toggle", { bubbles: true });
144
+
145
+ this.open = open;
146
+ }
147
+ }
@@ -0,0 +1,49 @@
1
+ import type { Meta, StoryObj } from "@storybook/web-components";
2
+ import { html } from "lit";
3
+
4
+ import type { USAAccordionElement } from "./accordion.element.js";
5
+
6
+ // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
7
+ const meta = {
8
+ title: "usa-accordion",
9
+ tags: ["autodocs"],
10
+ render(args) {
11
+ return html`
12
+ <usa-accordion id="first" name="ammendment">
13
+ <h4 slot="heading">First Ammendment</h4>
14
+
15
+ Congress shall make no law respecting an establishment of religion, or
16
+ prohibiting the free exercise thereof; or abridging the freedom of
17
+ speech, or of the press; or the right of the people peaceably to
18
+ assemble, and to petition the Government for a redress of grievances.
19
+ </usa-accordion>
20
+
21
+ <usa-accordion id="second" name="ammendment">
22
+ <h4 slot="heading">Second Ammendment</h4>
23
+
24
+ A well regulated Militia, being necessary to the security of a free
25
+ State, the right of the people to keep and bear Arms, shall not be
26
+ infringed.
27
+ </usa-accordion>
28
+
29
+ <usa-accordion id="third" name="ammendment">
30
+ <h4 slot="heading">Third Ammendment</h4>
31
+
32
+ No Soldier shall, in time of peace be quartered in any house, without
33
+ the consent of the Owner, nor in time of war, but in a manner to be
34
+ prescribed by law.
35
+ </usa-accordion>
36
+ `;
37
+ },
38
+ argTypes: {},
39
+ args: {},
40
+ } satisfies Meta<USAAccordionElement>;
41
+
42
+ export default meta;
43
+
44
+ type Story = StoryObj<USAAccordionElement>;
45
+
46
+ // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
47
+ export const Primary: Story = {
48
+ args: {},
49
+ };
@@ -0,0 +1,160 @@
1
+ import "./accordion.element.js";
2
+
3
+ import { fixture, html, assert } from "@open-wc/testing";
4
+
5
+ import { USAAccordionElement } from "./accordion.element.js";
6
+
7
+ describe("usa-accordion", () => {
8
+ it("should be accessible", async () => {
9
+ const accordion = await fixture<USAAccordionElement>(html`
10
+ <usa-accordion id="first" name="ammendment">
11
+ <h4 slot="heading">First Ammendment</h4>
12
+
13
+ <div class="content">
14
+ Congress shall make no law respecting an establishment of religion, or
15
+ prohibiting the free exercise thereof; or abridging the freedom of
16
+ speech, or of the press; or the right of the people peaceably to
17
+ assemble, and to petition the Government for a redress of grievances.
18
+ </div>
19
+ </usa-accordion>
20
+ `);
21
+
22
+ return assert.isAccessible(accordion);
23
+ });
24
+
25
+ it("should toggle the open state when clicked", async () => {
26
+ const accordion = await fixture<USAAccordionElement>(html`
27
+ <usa-accordion id="first" name="ammendment">
28
+ <h4 slot="heading">First Ammendment</h4>
29
+
30
+ <div class="content">
31
+ Congress shall make no law respecting an establishment of religion, or
32
+ prohibiting the free exercise thereof; or abridging the freedom of
33
+ speech, or of the press; or the right of the people peaceably to
34
+ assemble, and to petition the Government for a redress of grievances.
35
+ </div>
36
+ </usa-accordion>
37
+ `);
38
+
39
+ const heading = accordion.querySelector("h4")!;
40
+ const content = accordion.querySelector<HTMLDivElement>(".content")!;
41
+
42
+ heading.click();
43
+
44
+ assert.isTrue(content.checkVisibility());
45
+ });
46
+
47
+ it("should toggle the open state when clicked", async () => {
48
+ const accordion = await fixture<USAAccordionElement>(html`
49
+ <usa-accordion id="first" name="ammendment">
50
+ <h4 slot="heading">First Ammendment</h4>
51
+
52
+ <div class="content">
53
+ Congress shall make no law respecting an establishment of religion, or
54
+ prohibiting the free exercise thereof; or abridging the freedom of
55
+ speech, or of the press; or the right of the people peaceably to
56
+ assemble, and to petition the Government for a redress of grievances.
57
+ </div>
58
+ </usa-accordion>
59
+ `);
60
+
61
+ const heading = accordion.querySelector("h4")!;
62
+ const content = accordion.querySelector<HTMLDivElement>(".content")!;
63
+
64
+ assert.isFalse(content.checkVisibility());
65
+
66
+ heading.click();
67
+
68
+ assert.isTrue(content.checkVisibility());
69
+ });
70
+
71
+ it("should only allow a single accordion in a group to be open", async () => {
72
+ const el = await fixture(html`
73
+ <section>
74
+ <usa-accordion name="ammendment">
75
+ <h4 slot="heading">First Ammendment</h4>
76
+ <div class="content">Content for First</div>
77
+ </usa-accordion>
78
+
79
+ <usa-accordion name="ammendment">
80
+ <h4 slot="heading">Second Ammendment</h4>
81
+ <div class="content">Content for Second</div>
82
+ </usa-accordion>
83
+
84
+ <usa-accordion name="ammendment">
85
+ <h4 slot="heading">Third Ammendment</h4>
86
+ <div class="content">Content for Third</div>
87
+ </usa-accordion>
88
+ </section>
89
+ `);
90
+
91
+ const headings = el.querySelectorAll("h4");
92
+ const content = Array.from(el.querySelectorAll<HTMLDivElement>(".content"));
93
+
94
+ headings[0].click();
95
+
96
+ assert.deepEqual(
97
+ content.map((el) => el.checkVisibility()),
98
+ [true, false, false]
99
+ );
100
+
101
+ headings[1].click();
102
+
103
+ assert.deepEqual(
104
+ content.map((el) => el.checkVisibility()),
105
+ [false, true, false]
106
+ );
107
+
108
+ headings[2].click();
109
+
110
+ assert.deepEqual(
111
+ content.map((el) => el.checkVisibility()),
112
+ [false, false, true]
113
+ );
114
+ });
115
+
116
+ it("should not close accordion not in the same group", async () => {
117
+ const el = await fixture(html`
118
+ <section>
119
+ <usa-accordion name="ammendment">
120
+ <h4 slot="heading">First Ammendment</h4>
121
+ <div class="content">Content for First</div>
122
+ </usa-accordion>
123
+
124
+ <usa-accordion name="ammendment">
125
+ <h4 slot="heading">Second Ammendment</h4>
126
+ <div class="content">Content for Second</div>
127
+ </usa-accordion>
128
+
129
+ <usa-accordion name="different">
130
+ <h4 slot="heading">Third Ammendment</h4>
131
+ <div class="content">Content for Third</div>
132
+ </usa-accordion>
133
+ </section>
134
+ `);
135
+
136
+ const headings = el.querySelectorAll("h4");
137
+ const content = Array.from(el.querySelectorAll<HTMLDivElement>(".content"));
138
+
139
+ headings[0].click();
140
+
141
+ assert.deepEqual(
142
+ content.map((el) => el.checkVisibility()),
143
+ [true, false, false]
144
+ );
145
+
146
+ headings[1].click();
147
+
148
+ assert.deepEqual(
149
+ content.map((el) => el.checkVisibility()),
150
+ [false, true, false]
151
+ );
152
+
153
+ headings[2].click();
154
+
155
+ assert.deepEqual(
156
+ content.map((el) => el.checkVisibility()),
157
+ [false, true, true]
158
+ );
159
+ });
160
+ });
@@ -23,6 +23,7 @@ declare global {
23
23
  Roboto,
24
24
  Arial,
25
25
  sans-serif;
26
+ max-width: 30rem;
26
27
  }
27
28
 
28
29
  :host([tiled]) label {
@@ -129,7 +130,9 @@ export class USACheckboxElement extends HTMLElement {
129
130
  @attr()
130
131
  accessor value = "";
131
132
 
132
- @attr()
133
+ @attr({
134
+ observed: false,
135
+ })
133
136
  accessor tiled = false;
134
137
 
135
138
  #checkbox = query("input");