@cfpb/cfpb-design-system
Version:
CFPB's UI framework
33 lines (29 loc) • 31 kB
JavaScript
(()=>{var ge=Object.defineProperty;var Nt=Object.getOwnPropertySymbols;var fe=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable;var jt=r=>{throw TypeError(r)};var dt=(r,t,e)=>t in r?ge(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ot=(r,t)=>{for(var e in t||(t={}))fe.call(t,e)&&dt(r,e,t[e]);if(Nt)for(var e of Nt(t))ve.call(t,e)&&dt(r,e,t[e]);return r};var Ht=(r,t,e)=>dt(r,typeof t!="symbol"?t+"":t,e),pt=(r,t,e)=>t.has(r)||jt("Cannot "+e);var l=(r,t,e)=>(pt(r,t,"read from private field"),e?e.call(r):t.get(r)),m=(r,t,e)=>t.has(r)?jt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),g=(r,t,e,i)=>(pt(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e),f=(r,t,e)=>(pt(r,t,"access private method"),e);var Lt=(r,t,e)=>new Promise((i,s)=>{var a=o=>{try{h(e.next(o))}catch(c){s(c)}},n=o=>{try{h(e.throw(o))}catch(c){s(c)}},h=o=>o.done?i(o.value):Promise.resolve(o.value).then(a,n);h((e=e.apply(r,t)).next())});var et=globalThis,it=et.ShadowRoot&&(et.ShadyCSS===void 0||et.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ut=Symbol(),Rt=new WeakMap,q=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==ut)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(it&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=Rt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Rt.set(e,t))}return t}toString(){return this.cssText}},st=r=>new q(typeof r=="string"?r:r+"",void 0,ut),mt=(r,...t)=>{let e=r.length===1?r[0]:t.reduce(((i,s,a)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+r[a+1]),r[0]);return new q(e,r,ut)},kt=(r,t)=>{if(it)r.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let i=document.createElement("style"),s=et.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,r.appendChild(i)}},gt=it?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return st(e)})(r):r;var{is:$e,defineProperty:be,getOwnPropertyDescriptor:_e,getOwnPropertyNames:ye,getOwnPropertySymbols:Ae,getPrototypeOf:we}=Object,E=globalThis,Dt=E.trustedTypes,xe=Dt?Dt.emptyScript:"",ft=E.reactiveElementPolyfillSupport,B=(r,t)=>r,vt={toAttribute(r,t){switch(t){case Boolean:r=r?xe:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch(i){e=null}}return e}},Vt=(r,t)=>!$e(r,t),zt={attribute:!0,type:String,converter:vt,reflect:!1,useDefault:!1,hasChanged:Vt},It,qt;(It=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(qt=E.litPropertyMetadata)!=null||(E.litPropertyMetadata=new WeakMap);var _=class extends HTMLElement{static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=zt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&be(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){var n;let{get:s,set:a}=(n=_e(this.prototype,t))!=null?n:{get(){return this[e]},set(h){this[e]=h}};return{get:s,set(h){let o=s==null?void 0:s.call(this);a==null||a.call(this,h),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:zt}static _$Ei(){if(this.hasOwnProperty(B("elementProperties")))return;let t=we(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(B("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(B("properties"))){let e=this.properties,i=[...ye(e),...Ae(e)];for(let s of i)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(let[e,i]of this.elementProperties){let s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let s of i)e.unshift(gt(s))}else t!==void 0&&e.push(gt(t));return e}static _$Eu(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach((e=>e(this)))}addController(t){var e,i;((e=this._$EO)!=null?e:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)==null||i.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return kt(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach((i=>{var s;return(s=i.hostConnected)==null?void 0:s.call(i)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){var a;let i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){let n=(((a=i.converter)==null?void 0:a.toAttribute)!==void 0?i.converter:vt).toAttribute(e,i.type);this._$Em=t,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(t,e){var a,n,h,o;let i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let c=i.getPropertyOptions(s),p=typeof c.converter=="function"?{fromAttribute:c.converter}:((a=c.converter)==null?void 0:a.fromAttribute)!==void 0?c.converter:vt;this._$Em=s,this[s]=(o=(h=p.fromAttribute(e,c.type))!=null?h:(n=this._$Ej)==null?void 0:n.get(s))!=null?o:null,this._$Em=null}}requestUpdate(t,e,i){var s,a;if(t!==void 0){let n=this.constructor,h=this[t];if(i!=null||(i=n.getPropertyOptions(t)),!(((s=i.hasChanged)!=null?s:Vt)(h,e)||i.useDefault&&i.reflect&&h===((a=this._$Ej)==null?void 0:a.get(t))&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:a},n){var h,o,c;i&&!((h=this._$Ej)!=null?h:this._$Ej=new Map).has(t)&&(this._$Ej.set(t,(o=n!=null?n:e)!=null?o:this[t]),a!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),s===!0&&this._$Em!==t&&((c=this._$Eq)!=null?c:this._$Eq=new Set).add(t))}_$EP(){return Lt(this,null,function*(){this.isUpdatePending=!0;try{yield this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&(yield t),!this.isUpdatePending})}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i,s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((i=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,h]of this._$Ep)this[n]=h;this._$Ep=void 0}let a=this.constructor.elementProperties;if(a.size>0)for(let[n,h]of a){let{wrapped:o}=h,c=this[n];o!==!0||this._$AL.has(n)||c===void 0||this.C(n,void 0,h,c)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach((a=>{var n;return(n=a.hostUpdate)==null?void 0:n.call(a)})),this.update(e)):this._$EM()}catch(a){throw t=!1,this._$EM(),a}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}},Bt;_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[B("elementProperties")]=new Map,_[B("finalized")]=new Map,ft==null||ft({ReactiveElement:_}),((Bt=E.reactiveElementVersions)!=null?Bt:E.reactiveElementVersions=[]).push("2.1.0");var W=globalThis,rt=W.trustedTypes,Wt=rt?rt.createPolicy("lit-html",{createHTML:r=>r}):void 0,Yt="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,Xt="?"+S,Ee=`<${Xt}>`,j=document,F=()=>j.createComment(""),J=r=>r===null||typeof r!="object"&&typeof r!="function",Et=Array.isArray,Se=r=>Et(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",$t=`[
\f\r]`,V=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ft=/-->/g,Jt=/>/g,U=RegExp(`>|${$t}(?:([^\\s"'>=/]+)(${$t}*=${$t}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),Kt=/'/g,Zt=/"/g,te=/^(?:script|style|textarea|title)$/i,St=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),ee=St(1),Re=St(2),ke=St(3),y=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Gt=new WeakMap,N=j.createTreeWalker(j,129);function ie(r,t){if(!Et(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Wt!==void 0?Wt.createHTML(t):t}var Ce=(r,t)=>{let e=r.length-1,i=[],s,a=t===2?"<svg>":t===3?"<math>":"",n=V;for(let h=0;h<e;h++){let o=r[h],c,p,d=-1,b=0;for(;b<o.length&&(n.lastIndex=b,p=n.exec(o),p!==null);)b=n.lastIndex,n===V?p[1]==="!--"?n=Ft:p[1]!==void 0?n=Jt:p[2]!==void 0?(te.test(p[2])&&(s=RegExp("</"+p[2],"g")),n=U):p[3]!==void 0&&(n=U):n===U?p[0]===">"?(n=s!=null?s:V,d=-1):p[1]===void 0?d=-2:(d=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?U:p[3]==='"'?Zt:Kt):n===Zt||n===Kt?n=U:n===Ft||n===Jt?n=V:(n=U,s=void 0);let x=n===U&&r[h+1].startsWith("/>")?" ":"";a+=n===V?o+Ee:d>=0?(i.push(c),o.slice(0,d)+Yt+o.slice(d)+S+x):o+S+(d===-2?h:x)}return[ie(r,a+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},K=class r{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let a=0,n=0,h=t.length-1,o=this.parts,[c,p]=Ce(t,e);if(this.el=r.createElement(c,i),N.currentNode=this.el.content,e===2||e===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=N.nextNode())!==null&&o.length<h;){if(s.nodeType===1){if(s.hasAttributes())for(let d of s.getAttributeNames())if(d.endsWith(Yt)){let b=p[n++],x=s.getAttribute(d).split(S),tt=/([.?@])?(.*)/.exec(b);o.push({type:1,index:a,name:tt[2],strings:x,ctor:tt[1]==="."?yt:tt[1]==="?"?At:tt[1]==="@"?wt:k}),s.removeAttribute(d)}else d.startsWith(S)&&(o.push({type:6,index:a}),s.removeAttribute(d));if(te.test(s.tagName)){let d=s.textContent.split(S),b=d.length-1;if(b>0){s.textContent=rt?rt.emptyScript:"";for(let x=0;x<b;x++)s.append(d[x],F()),N.nextNode(),o.push({type:2,index:++a});s.append(d[b],F())}}}else if(s.nodeType===8)if(s.data===Xt)o.push({type:2,index:a});else{let d=-1;for(;(d=s.data.indexOf(S,d+1))!==-1;)o.push({type:7,index:a}),d+=S.length-1}a++}}static createElement(t,e){let i=j.createElement("template");return i.innerHTML=t,i}};function R(r,t,e=r,i){var n,h,o;if(t===y)return t;let s=i!==void 0?(n=e._$Co)==null?void 0:n[i]:e._$Cl,a=J(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==a&&((h=s==null?void 0:s._$AO)==null||h.call(s,!1),a===void 0?s=void 0:(s=new a(r),s._$AT(r,e,i)),i!==void 0?((o=e._$Co)!=null?o:e._$Co=[])[i]=s:e._$Cl=s),s!==void 0&&(t=R(r,s._$AS(r,t.values),s,i)),t}var _t=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var c;let{el:{content:e},parts:i}=this._$AD,s=((c=t==null?void 0:t.creationScope)!=null?c:j).importNode(e,!0);N.currentNode=s;let a=N.nextNode(),n=0,h=0,o=i[0];for(;o!==void 0;){if(n===o.index){let p;o.type===2?p=new Z(a,a.nextSibling,this,t):o.type===1?p=new o.ctor(a,o.name,o.strings,this,t):o.type===6&&(p=new xt(a,this,t)),this._$AV.push(p),o=i[++h]}n!==(o==null?void 0:o.index)&&(a=N.nextNode(),n++)}return N.currentNode=j,s}p(t){let e=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},Z=class r{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this._$Cv}constructor(t,e,i,s){var a;this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=(a=s==null?void 0:s.isConnected)!=null?a:!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=R(this,t,e),J(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==y&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Se(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==u&&J(this._$AH)?this._$AA.nextSibling.data=t:this.T(j.createTextNode(t)),this._$AH=t}$(t){var a;let{values:e,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=K.createElement(ie(i.h,i.h[0]),this.options)),i);if(((a=this._$AH)==null?void 0:a._$AD)===s)this._$AH.p(e);else{let n=new _t(s,this),h=n.u(this.options);n.p(e),this.T(h),this._$AH=n}}_$AC(t){let e=Gt.get(t.strings);return e===void 0&&Gt.set(t.strings,e=new K(t)),e}k(t){Et(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,s=0;for(let a of t)s===e.length?e.push(i=new r(this.O(F()),this.O(F()),this,this.options)):i=e[s],i._$AI(a),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},k=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,a){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=u}_$AI(t,e=this,i,s){let a=this.strings,n=!1;if(a===void 0)t=R(this,t,e,0),n=!J(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let h=t,o,c;for(t=a[0],o=0;o<a.length-1;o++)c=R(this,h[i+o],e,o),c===y&&(c=this._$AH[o]),n||(n=!J(c)||c!==this._$AH[o]),c===u?t=u:t!==u&&(t+=(c!=null?c:"")+a[o+1]),this._$AH[o]=c}n&&!s&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},yt=class extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}},At=class extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}},wt=class extends k{constructor(t,e,i,s,a){super(t,e,i,s,a),this.type=5}_$AI(t,e=this){var n;if((t=(n=R(this,t,e,0))!=null?n:u)===y)return;let i=this._$AH,s=t===u&&i!==u||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==u&&(i===u||s);s&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;typeof this._$AH=="function"?this._$AH.call((i=(e=this.options)==null?void 0:e.host)!=null?i:this.element,t):this._$AH.handleEvent(t)}},xt=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){R(this,t)}};var bt=W.litHtmlPolyfillSupport,Qt;bt==null||bt(K,Z),((Qt=W.litHtmlVersions)!=null?Qt:W.litHtmlVersions=[]).push("3.3.0");var se=(r,t,e)=>{var a,n;let i=(a=e==null?void 0:e.renderBefore)!=null?a:t,s=i._$litPart$;if(s===void 0){let h=(n=e==null?void 0:e.renderBefore)!=null?n:null;i._$litPart$=s=new Z(t.insertBefore(F(),h),h,void 0,e!=null?e:{})}return s._$AI(r),s};var O=globalThis,C=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,i;let t=super.createRenderRoot();return(i=(e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=se(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return y}},re;C._$litElement$=!0,C.finalized=!0,(re=O.litElementHydrateSupport)==null||re.call(O,{LitElement:C});var Ct=O.litElementPolyfillSupport;Ct==null||Ct({LitElement:C});var ne;((ne=O.litElementVersions)!=null?ne:O.litElementVersions=[]).push("4.2.0");var ae={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},at=r=>(...t)=>({_$litDirective$:r,values:t}),nt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var H=class extends nt{constructor(t){if(super(t),this.it=u,t.type!==ae.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===u||t==null)return this._t=void 0,this.it=t;if(t===y)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};H.directiveName="unsafeHTML",H.resultType=1;var ti=at(H);var G=class extends H{};G.directiveName="unsafeSVG",G.resultType=2;var Pt=at(G);var oe=':root{--font-adjust-base:0.517;--font-adjust-step:0.0054;--font-adjust-h1:calc(var(--font-size-adjust-base) + var(--font-adjust-step)*5);--font-adjust-h2:calc(var(--font-size-adjust-base) + var(--font-adjust-step)*4);--font-adjust-h3:calc(var(--font-size-adjust-base) + var(--font-adjust-step)*3);--font-adjust-h4:calc(var(--font-size-adjust-base) + var(--font-adjust-step)*2);--font-adjust-h5:calc(var(--font-size-adjust-base) + var(--font-adjust-step)*1);--font-adjust-h6:var(--font-adjust-base);--font-adjust-body:var(--font-adjust-base);--input-text-default:var(--black);--input-text-disabled-default:var(--gray-dark);--input-text-placeholder-default:var(--gray-dark);--input-border-default:var(--gray-60);--input-border-disabled:var(--gray-60);--input-border-success:var(--green);--input-border-warning:var(--gold);--input-border-error:var(--red);--input-border-hover-default:var(--pacific);--input-border-focus-default:var(--pacific);--input-bg-default:var(--white);--input-bg-disabled-default:var(--gray-10);--form-alert-icon-color-default:var(--gray);--form-alert-icon-color-success:var(--green);--form-alert-icon-color-warning:var(--gold);--form-alert-icon-color-error:var(--red);--select-border-default:var(--gray-60);--select-border-width-default:1px;--select-border-error:var(--red);--select-border-width-error:2px;--select-border-hover-default:var(--pacific);--select-border-focus-default:var(--pacific);--select-bg-disabled-default:var(--gray-10);--select-icon-bg-default:var(--gray-10);--select-text-disabled-default:var(--gray-dark);--choice-border-default:var(--gray-60);--choice-border-disabled:var(--gray-60);--choice-border-success:var(--green);--choice-border-warning:var(--gold);--choice-border-error:var(--red);--choice-border-hover-default:var(--pacific);--choice-border-focus-default:var(--pacific);--choice-outline-focus-default:var(--pacific);--choice-bg-default:var(--white);--choice-bg-disabled:var(--gray-10);--choice-bg-selected-default:var(--pacific);--choice-bg-selected-disabled:var(--gray-40);--choice-bg-selected-focus-default:var(--pacific);--choice-label-disabled-default:var(--gray-dark)}.no-js .u-js-only,.u-hide-if-js{display:none!important}.no-js .u-hide-if-js{display:block!important}@media screen{.u-print-only{display:none}}@media print{.u-screen-only{display:none}}.u-clearfix:after{clear:both;content:"";display:table}.u-visually-hidden{border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0 0 0 0)}@media only screen and (max-width:37.5em){.u-hide-on-mobile{display:none}}@media only screen and (min-width:37.5625em){.u-show-on-mobile{display:none}}.u-hidden{display:none!important}.u-invisible{visibility:hidden}.u-right{float:right}.u-nowrap{white-space:nowrap}.u-flexible-container{height:0;padding-bottom:56.25%;position:relative}.u-flexible-container__inner{height:100%;left:0;position:absolute;top:0;width:100%}.u-flexible-container--4-3{height:0;padding-bottom:75%;position:relative}.u-mt0{margin-top:0!important}.u-mb0{margin-bottom:0!important}.u-mt5{margin-top:5px!important}.u-mb5{margin-bottom:5px!important}.u-mt10{margin-top:10px!important}.u-mb10{margin-bottom:10px!important}.u-mt15{margin-top:15px!important}.u-mb15{margin-bottom:15px!important}.u-mt20{margin-top:20px!important}.u-mb20{margin-bottom:20px!important}.u-mt30{margin-top:30px!important}.u-mb30{margin-bottom:30px!important}.u-mt45{margin-top:45px!important}.u-mb45{margin-bottom:45px!important}.u-mt60{margin-top:60px!important}.u-mb60{margin-bottom:60px!important}.u-w100pct{width:100%}.u-w90pct{width:90%}.u-w80pct{width:80%}.u-w70pct{width:70%}.u-w60pct{width:60%}.u-w50pct{width:50%}.u-w40pct{width:40%}.u-w30pct{width:30%}.u-w20pct{width:20%}.u-w10pct{width:10%}.u-w75pct{width:75%}.u-w65pct{width:65%}.u-w25pct{width:25%}.u-w15pct{width:15%}.u-w66pct{width:66.6666666667%}.u-w33pct{width:33.3333333333%}.u-small-text,small{font-size:.875em}.u-small-text--subtle,small--subtle{color:var(--gray)}.u-no-animation{transition-duration:0s!important}.u-move-transition{transition:transform .25s ease-out}.u-move-to-origin{transform:translateZ(0)}.u-move-left{transform:translate3d(-100%,0,0)}.u-move-left-2x{transform:translate3d(-200%,0,0)}.u-move-left-3x{transform:translate3d(-300%,0,0)}.u-move-right{transform:translate3d(100%,0,0)}.u-move-up{transform:translate3d(0,-100%,0)}.u-alpha-transition{transition:opacity .25s linear}.u-alpha-100{opacity:1}.u-alpha-0{opacity:0}.u-max-height-transition{contain:paint;overflow:hidden;transition:max-height .2s ease-out}.u-max-height-zero{max-height:0!important}.u-max-height-summary{max-height:88px!important}:host{width:100%}:host .cf-icon-svg{height:1.1875em;vertical-align:middle;fill:currentcolor}:host .m-pagination{display:grid;grid-template-areas:"pag-btn-prev . pag-btn-next" "pag-form pag-form pag-form";grid-template-columns:auto 1fr auto;row-gap:.9375rem}:host .m-pagination__form{background:var(--gray-5);border-radius:.25rem;color:var(--gray);display:flex;flex-flow:wrap;gap:.625rem;grid-area:pag-form;padding:.3125rem;place-content:center}:host .m-pagination__current-page{font-weight:500;text-align:right;width:2.8125rem}:host .m-pagination__label{display:contents;white-space:nowrap}:host .m-pagination__btn-prev{grid-area:pag-btn-prev;z-index:1}:host .m-pagination__btn-next{grid-area:pag-btn-next;z-index:1}@media only screen and (min-width:37.5625em){:host .m-pagination{grid-template-areas:"pag-btn-prev pag-form pag-btn-next"}:host .m-pagination__btn-prev{border-bottom-right-radius:0;border-top-right-radius:0}:host .m-pagination__btn-next{border-bottom-left-radius:0;border-top-left-radius:0}}';var he='<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="cf-icon-svg cf-icon-svg--left" viewBox="0 0 10 19"><path d="M8.4 17.269a1.03 1.03 0 0 1-.727-.302l-6.801-6.8a1.03 1.03 0 0 1 0-1.456l6.8-6.8a1.03 1.03 0 0 1 1.456 1.455L3.055 9.439l6.073 6.073A1.03 1.03 0 0 1 8.4 17.27z"/></svg>';var le='<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="cf-icon-svg cf-icon-svg--right" viewBox="0 0 10 19"><path d="M1.6 17.262a1.03 1.03 0 0 1-.728-1.757l6.073-6.073L.872 3.36a1.03 1.03 0 0 1 1.455-1.455l6.8 6.8a1.03 1.03 0 0 1 0 1.456l-6.8 6.8a1.02 1.02 0 0 1-.727.302z"/></svg>';var P,A,Q,Tt,Mt=class Mt extends HTMLElement{constructor(){super();m(this,Q);m(this,P);m(this,A);g(this,P,{}),g(this,A,"")}connectedCallback(){let e=[],i=this.querySelector("template");if(!i){e.push(["missing-template","No <template> found inside <i18n-service>"]);return}try{let s=i.innerHTML.trim(),a=JSON.parse(s);(typeof a!="object"||Array.isArray(a))&&e.push(["invalid-format","Translations JSON must be an object keyed by the language codes"]),g(this,P,a);let n=this.availableLanguages;n.length>0&&!l(this,A)&&(this.language=n[0])}catch(s){e.push(["parse-error","Failed to parse i18n template JSON",{err:s}])}requestAnimationFrame(()=>{e.forEach(s=>{f(this,Q,Tt).call(this,...s)})})}set language(e){if(!l(this,P)[e]){f(this,Q,Tt).call(this,"invalid-language",`Unsupported language: ${e}`,{lang:e});return}l(this,A)!==e&&(g(this,A,e),this.dispatchEvent(new CustomEvent("i18n-change",{detail:{language:e},bubbles:!0,composed:!0})))}get language(){return l(this,A)}get availableLanguages(){return Object.keys(l(this,P))}translate(e){var i;return((i=l(this,P)[l(this,A)])==null?void 0:i[e])||e}static init(){window.customElements.get("i18n-service")||window.customElements.define("i18n-service",Mt)}};P=new WeakMap,A=new WeakMap,Q=new WeakSet,Tt=function(e,i,s={}){this.dispatchEvent(new CustomEvent("i18n-error",{detail:Ot({type:e,message:i},s),bubbles:!0,composed:!0}))};var ot=Mt;var Y,D,z,T,I,L,ce,Ut,ht=class extends EventTarget{constructor(e){super();m(this,L);m(this,Y);m(this,D,new Map);m(this,z,new Map);m(this,T,new Map);m(this,I,!1);g(this,Y,e!=null?e:{xs:{min:0,max:600},sm:{min:601,max:900},med:{min:901,max:1020},lg:{min:1021,max:1200},xl:{min:1201}});for(let[i,s]of Object.entries(l(this,Y))){let a=f(this,L,ce).call(this,s),n=window.matchMedia(a);l(this,D).set(i,n),l(this,T).set(i,n.matches);let h=o=>{l(this,T).set(i,o.matches),l(this,I)||(g(this,I,!0),requestAnimationFrame(()=>{g(this,I,!1),f(this,L,Ut).call(this)}))};n.addEventListener("change",h),l(this,z).set(i,h)}f(this,L,Ut).call(this)}get matches(){return Object.fromEntries(l(this,T))}destroy(){for(let[e,i]of l(this,D).entries()){let s=l(this,z).get(e);s&&i.removeEventListener("change",s)}l(this,D).clear(),l(this,z).clear(),l(this,T).clear()}};Y=new WeakMap,D=new WeakMap,z=new WeakMap,T=new WeakMap,I=new WeakMap,L=new WeakSet,ce=function(e){let i=[];return e.min!=null&&i.push(`(min-width: ${e.min}px)`),e.max!=null&&i.push(`(max-width: ${e.max}px)`),i.join(" and ")},Ut=function(){let e={matches:Object.fromEntries(l(this,T))};this.dispatchEvent(new CustomEvent("change",{detail:e}))};var M,w,v,$,pe,X,ue,me,lt,ct=class ct extends C{constructor(){super();m(this,$);m(this,M);m(this,w);m(this,v);m(this,X,e=>{let i=e.detail.matches.xs;i!==l(this,w)&&(g(this,w,i),this.requestUpdate())});this.currentPage=1,this.maxPage=1,g(this,M,new ht),g(this,w,!1),this.lang="en"}static get properties(){return{currentPage:{type:Number,attribute:"value",reflect:!0},maxPage:{type:Number,attribute:"max",reflect:!0},lang:{type:String,reflect:!0}}}connectedCallback(){super.connectedCallback(),g(this,v,this.querySelector("i18n-service")),l(this,v)&&(this.addEventListener("i18n-change",f(this,$,pe)),l(this,v).language=this.lang)}firstUpdated(){l(this,M).addEventListener("change",l(this,X)),g(this,w,l(this,M).matches.xs)}disconnectedCallback(){super.disconnectedCallback(),l(this,M).removeEventListener("change",l(this,X)),l(this,M).destroy()}updated(e){(e.has("currentPage")||e.has("maxPage"))&&(this.currentPage<1?this.currentPage=1:this.currentPage>this.maxPage&&(this.currentPage=this.maxPage)),e.has("lang")&&(l(this,v).language=this.lang,this.requestUpdate())}get isAtMin(){return this.currentPage<=1}get isAtMax(){return this.currentPage>=this.maxPage}render(){let e=l(this,v)&&l(this,v).translate?l(this,v).translate.bind(l(this,v)):i=>i;return ee`<slot></slot><nav class="m-pagination" role="navigation" aria-label="${e("page number")}"><cfpb-button class="m-pagination__btn-prev" id="next" href="#" ?flush-right="${!l(this,w)}" ?disabled="${this.isAtMin}" @click="${()=>f(this,$,lt).call(this,this.currentPage-1)}">${Pt(he)} ${e("next")}</cfpb-button><form class="m-pagination__form" action="#pagination_content" @submit="${f(this,$,me)}"><label class="m-pagination__label">${e("page")} <span class="u-visually-hidden">${this.currentPage} ${e("out of")} ${this.maxPage} ${e("total pages")} </span><input class="m-pagination__current-page" name="page" type="number" min="1" max="${this.maxPage}" pattern="[0-9]*" inputmode="numeric" .value="${this.currentPage}" @input="${f(this,$,ue)}"> ${e("of")} ${this.maxPage}</label><cfpb-button id="go" type="submit" style-as-link>${e("go")}</cfpb-button></form><cfpb-button class="m-pagination__btn-next" id="previous" href="#" ?flush-left="${!l(this,w)}" ?disabled="${this.isAtMax}" @click="${()=>f(this,$,lt).call(this,this.currentPage+1)}">${e("previous")} ${Pt(le)}</cfpb-button></nav>`}static init(){ot.init(),window.customElements.get("cfpb-pagination")||window.customElements.define("cfpb-pagination",ct)}};M=new WeakMap,w=new WeakMap,v=new WeakMap,$=new WeakSet,pe=function(){let e=(i,s)=>{let a=this.renderRoot.querySelector(i),n=a.querySelector("span");if(a){let h=l(this,v).translate(s);n.innerHTML=h,a.requestUpdate()}};e("#previous","previous"),e("#next","next"),e("#go","go"),this.requestUpdate()},X=new WeakMap,ue=function(e){this.currentPage=e.target.value},me=function(e){e.preventDefault();let i=parseInt(this.currentPage,10);Number.isNaN(i)||f(this,$,lt).call(this,i)},lt=function(e){let i=Math.max(1,Math.min(e,this.maxPage));i!==this.currentPage&&(this.currentPage=i,this.dispatchEvent(new CustomEvent("page-change",{detail:{page:i},bubbles:!0,composed:!0})))},Ht(ct,"styles",mt`${st(oe)}`);var de=ct;})();
/*! Bundled license information:
@lit/reactive-element/css-tag.js:
(**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/reactive-element.js:
lit-html/lit-html.js:
lit-element/lit-element.js:
lit-html/directive.js:
lit-html/directives/unsafe-html.js:
lit-html/directives/unsafe-svg.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
lit-html/is-server.js:
(**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
*/
//# sourceMappingURL=index.js.map