@primer-io/primer-js 0.5.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,11 +42,6 @@
42
42
  },
43
43
  "default": "{detectedCardNetwork:null,selectableCardNetworks:[],isLoading:!0}"
44
44
  },
45
- {
46
- "kind": "variable",
47
- "name": "Zr",
48
- "default": "class{constructor(t){this._methods=t}get(t){return this._methods.get(t)}toArray(){return Array.from(this._methods.values())}size(){return this._methods.size}}"
49
- },
50
45
  {
51
46
  "kind": "function",
52
47
  "name": "t",
@@ -82,63 +77,73 @@
82
77
  },
83
78
  {
84
79
  "kind": "variable",
85
- "name": "se",
86
- "default": "class extends v{constructor(){super(...arguments);this.size=\"large\";this.showCloseButton=!1;this.open=!1}openDialog(){this.open=!0}closeDialog(){let e=document.querySelector(\"primer-dialog\");if(e){e.startExitAnimation();let r=()=>{this.open=!1,this.removeEventListener(\"primer-dialog-close\",r)};this.addEventListener(\"primer-dialog-close\",r)}else this.open=!1}renderContent(){return m`<div class=\"content-container\"><slot></slot>${this.renderSecureHtmlContent()}</div>`}renderSecureHtmlContent(){return this.secureHtmlContent?Mo(this.secureHtmlContent)?m`${An(this.secureHtmlContent.content)}`:(x.warn(\"PortalDialogComponent: Invalid access token provided for htmlContent. Content will not be rendered.\"),h):h}renderDialog(){return this.open?m`<primer-portal><primer-dialog .open=${this.open} size=${this.size} .showCloseButton=${!1} @primer-dialog-close=\"${()=>this.closeDialog()}\" >${this.renderContent()}</primer-dialog></primer-portal>`:h}connectedCallback(){super.connectedCallback(),this.open||this.openDialog()}updated(e){if(super.updated(e),e.has(\"secureHtmlContent\")){let r=this.secureHtmlContent;r&&!Mo(r)&&(x.errorWithDatadog(\"PortalDialogComponent: Invalid access token provided for htmlContent. Content will not be rendered.\"),this.secureHtmlContent=void 0)}e.has(\"open\")&&this.open&&this.onOpen&&this.onOpen(),e.has(\"open\")&&this.open&&this.onContentRendered&&this.updateComplete.then(()=>{requestAnimationFrame(()=>{this.onContentRendered?.()})})}render(){return m`${this.renderDialog()}`}}"
80
+ "name": "Xr",
81
+ "default": "class{constructor(t){this._methods=t}get(t){return this._methods.get(t)}toArray(){return Array.from(this._methods.values())}size(){return this._methods.size}}"
87
82
  },
88
83
  {
89
84
  "kind": "variable",
90
- "name": "be",
91
- "default": "class extends v{constructor(){super();this.customStyles=\"\";this.clientToken=\"\";this.options={};this.disableLoader=!1;this._jsInitialized=!1;this.previousLoadingState=!0;this.hasAssignedContent=!1;this._loadingTimeoutId=null;this._eventListenerController=null;this.locale=\"en-GB\";this.onSlotChange=e=>{let o=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=o.length>0,this.requestUpdate()};this.sdkContextController=new Mr(this),this.sdkStateController=new wr(this),this.primerEventsController=new Lt(this),this.styleProcessingController=new kr(this),this.vaultManagerController=new Jt(this),this.cardNetworkController=new Er(this),this.achPaymentEventsController=new yi(this),new gi(this)}set jsInitialized(e){this.requestUpdate(),this._jsInitialized=e}get jsInitialized(){return this._jsInitialized}connectedCallback(){super.connectedCallback(),this.sdkContextController.setEventsController(this.primerEventsController),this._eventListenerController=new AbortController,document.addEventListener(\"primer:card-submit\",this.handleExternalCardSubmit.bind(this),{signal:this._eventListenerController.signal})}attributeChangedCallback(e,r,o){e===Xd.CUSTOM_STYLES?this.styleProcessingController.processCustomStyles(o):super.attributeChangedCallback(e,r,o)}disconnectedCallback(){this._loadingTimeoutId&&(window.clearTimeout(this._loadingTimeoutId),this._loadingTimeoutId=null),this.sdkStateController?.currentState.isLoading&&this.sdkStateController.forceCompleteLoading(),this._eventListenerController&&(this._eventListenerController.abort(),this._eventListenerController=null),super.disconnectedCallback()}willUpdate(e){e.has(\"options\")&&(this.options?.locale&&(qi(this.options?.locale)?this.locale=Ji(this.options?.locale):x.warn(\"\\u{1F30E}\\u2757 Unsupported locale provided:\",this.options?.locale,\"- Falling back to default locale `en-GB`\")),Gi(this.locale||\"en-GB\"))}updated(){let e=getComputedStyle(this);this.sdkContextController.setComputedStyles(e),this.checkLoadingStateChange()}handleExternalCardSubmit(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:card-submit\",e.detail)}checkLoadingStateChange(){let e=this.sdkStateController?.currentState.isLoading||!1;this.previousLoadingState&&!e&&(this.jsInitialized=!0,q({eventName:\"CHECKOUT_FLOW_STARTED\"})),this.previousLoadingState=e,e&&!this._loadingTimeoutId?this._loadingTimeoutId=window.setTimeout(()=>{this.sdkStateController?.currentState.isLoading&&(x.warn(\"Loading timeout in component, forcing completion\"),this.sdkStateController.forceCompleteLoading(),this.jsInitialized=!0),this._loadingTimeoutId=null},1e4):!e&&this._loadingTimeoutId&&(window.clearTimeout(this._loadingTimeoutId),this._loadingTimeoutId=null)}render(){let e=this.sdkStateController.currentState,r=e.isLoading,o=e.error,a=!r&&!o;return m` ${k(r,()=>h)} ${k(o,()=>m`<primer-checkout-error></primer-checkout-error>`)} ${k(a,()=>m`<slot name=\"main\" @slotchange=${this.onSlotChange}></slot>${k(this.hasAssignedContent,()=>h,()=>m`<primer-main></primer-main>`)} `,()=>h)} `}addEventListener(e,r,o){super.addEventListener(e,r,o)}removeEventListener(e,r,o){super.removeEventListener(e,r,o)}}"
85
+ "name": "Qr",
86
+ "default": "class{constructor(t){this._methods=t}get(t){return this._methods.get(t)}toArray(){return Array.from(this._methods.values())}size(){return this._methods.size}}"
87
+ },
88
+ {
89
+ "kind": "variable",
90
+ "name": "le",
91
+ "default": "class extends v{constructor(){super(...arguments);this.size=\"large\";this.showCloseButton=!1;this.open=!1}openDialog(){this.open=!0}closeDialog(){let e=document.querySelector(\"primer-dialog\");if(e){e.startExitAnimation();let r=()=>{this.open=!1,this.removeEventListener(\"primer-dialog-close\",r)};this.addEventListener(\"primer-dialog-close\",r)}else this.open=!1}renderContent(){return m`<div class=\"content-container\"><slot></slot>${this.renderSecureHtmlContent()}</div>`}renderSecureHtmlContent(){return this.secureHtmlContent?Do(this.secureHtmlContent)?m`${Va(this.secureHtmlContent.content)}`:(P.warn(\"PortalDialogComponent: Invalid access token provided for htmlContent. Content will not be rendered.\"),g):g}renderDialog(){return this.open?m`<primer-portal><primer-dialog .open=${this.open} size=${this.size} .showCloseButton=${!1} @primer-dialog-close=\"${()=>this.closeDialog()}\" >${this.renderContent()}</primer-dialog></primer-portal>`:g}connectedCallback(){super.connectedCallback(),this.open||this.openDialog()}updated(e){if(super.updated(e),e.has(\"secureHtmlContent\")){let r=this.secureHtmlContent;r&&!Do(r)&&(P.errorWithDatadog(\"PortalDialogComponent: Invalid access token provided for htmlContent. Content will not be rendered.\"),this.secureHtmlContent=void 0)}e.has(\"open\")&&this.open&&this.onOpen&&this.onOpen(),e.has(\"open\")&&this.open&&this.onContentRendered&&this.updateComplete.then(()=>{requestAnimationFrame(()=>{this.onContentRendered?.()})})}render(){return m`${this.renderDialog()}`}}"
92
+ },
93
+ {
94
+ "kind": "variable",
95
+ "name": "Ae",
96
+ "default": "class extends v{constructor(){super();this.customStyles=\"\";this.clientToken=\"\";this.options={};this.disableLoader=!1;this._jsInitialized=!1;this.previousLoadingState=!0;this.hasAssignedContent=!1;this._loadingTimeoutId=null;this._eventListenerController=null;this.locale=\"en-GB\";this.onSlotChange=e=>{let o=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=o.length>0,this.requestUpdate()};this.sdkContextController=new Kr(this),this.sdkStateController=new zr(this),this.primerEventsController=new Yt(this),this.styleProcessingController=new Gr(this),this.vaultManagerController=new ir(this),this.cardNetworkController=new Sr(this),this.achPaymentEventsController=new Ei(this),this.headlessSdkController=new bi(this)}set jsInitialized(e){this.requestUpdate(),this._jsInitialized=e}get jsInitialized(){return this._jsInitialized}get primerJS(){return this.headlessSdkController?.primerJSInstance??void 0}connectedCallback(){super.connectedCallback(),this.sdkContextController.setEventsController(this.primerEventsController),this._eventListenerController=new AbortController,document.addEventListener(\"primer:card-submit\",this.handleExternalCardSubmit.bind(this),{signal:this._eventListenerController.signal})}attributeChangedCallback(e,r,o){e===Rc.CUSTOM_STYLES?this.styleProcessingController.processCustomStyles(o):super.attributeChangedCallback(e,r,o)}disconnectedCallback(){this._loadingTimeoutId&&(window.clearTimeout(this._loadingTimeoutId),this._loadingTimeoutId=null),this.sdkStateController?.currentState.isLoading&&this.sdkStateController.forceCompleteLoading(),this._eventListenerController&&(this._eventListenerController.abort(),this._eventListenerController=null),super.disconnectedCallback()}willUpdate(e){e.has(\"options\")&&(this.options?.locale&&(To(this.options?.locale)?this.locale=Mo(this.options?.locale):P.warn(\"\\u{1F30E}\\u2757 Unsupported locale provided:\",this.options?.locale,\"- Falling back to default locale `en-GB`\")),xo(this.locale||\"en-GB\"))}updated(){let e=getComputedStyle(this);this.sdkContextController.setComputedStyles(e),this.checkLoadingStateChange()}handleExternalCardSubmit(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:card-submit\",e.detail)}checkLoadingStateChange(){let e=this.sdkStateController?.currentState.isLoading||!1;this.previousLoadingState&&!e&&(this.jsInitialized=!0,J({eventName:\"CHECKOUT_FLOW_STARTED\"})),this.previousLoadingState=e,e&&!this._loadingTimeoutId?this._loadingTimeoutId=window.setTimeout(()=>{this.sdkStateController?.currentState.isLoading&&(P.warn(\"Loading timeout in component, forcing completion\"),this.sdkStateController.forceCompleteLoading(),this.jsInitialized=!0),this._loadingTimeoutId=null},1e4):!e&&this._loadingTimeoutId&&(window.clearTimeout(this._loadingTimeoutId),this._loadingTimeoutId=null)}render(){let e=this.sdkStateController.currentState,r=e.isLoading,o=e.primerJsError,n=!r&&!o;return m` ${k(r,()=>g)} ${k(o,()=>m`<primer-checkout-error></primer-checkout-error>`)} ${k(n,()=>m`<slot name=\"main\" @slotchange=${this.onSlotChange}></slot>${k(this.hasAssignedContent,()=>g,()=>m`<primer-main></primer-main>`)} `,()=>g)} `}addEventListener(e,r,o){super.addEventListener(e,r,o)}removeEventListener(e,r,o){super.removeEventListener(e,r,o)}}"
92
97
  },
93
98
  {
94
99
  "kind": "function",
95
- "name": "In"
100
+ "name": "Ga"
96
101
  },
97
102
  {
98
103
  "kind": "function",
99
- "name": "Nn"
104
+ "name": "ja"
100
105
  },
101
106
  {
102
107
  "kind": "function",
103
- "name": "ic"
108
+ "name": "Uc"
104
109
  },
105
110
  {
106
111
  "kind": "function",
107
- "name": "oc"
112
+ "name": "Yc"
108
113
  },
109
114
  {
110
115
  "kind": "variable",
111
- "name": "De",
112
- "default": "class extends v{constructor(){super(...arguments);this.color=\"var(--primer-color-loader)\";this.size=\"medium\";this.compact=!1}getSize(){if(this.size in No)return No[this.size];let e=parseInt(this.size,10);return isNaN(e)?No.medium:e}render(){let e=this.getSize(),r=20,o=`0 0 ${r} ${r}`;return this.style.setProperty(\"--spinner-color\",this.color),this.style.setProperty(\"--spinner-size\",`${e}px`),m`<div class=\"spinner-container ${this.compact?\"compact\":\"\"}\"><svg class=\"spinner\" width=\"${e}\" height=\"${e}\" viewBox=\"${o}\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" role=\"status\" aria-label=\"Loading\" ><path d=\"M4.27827 10.002C4.27827 6.84166 6.84019 4.27973 10.0005 4.27973C10.7676 4.27973 11.3894 3.6579 11.3894 2.89084C11.3894 2.12378 10.7676 1.50195 10.0005 1.50195C5.30607 1.50195 1.50049 5.30753 1.50049 10.002C1.50049 14.6964 5.30607 18.502 10.0005 18.502C14.6949 18.502 18.5005 14.6964 18.5005 10.002C18.5005 9.23489 17.8787 8.61306 17.1116 8.61306C16.3445 8.61306 15.7227 9.23489 15.7227 10.002C15.7227 13.1622 13.1608 15.7242 10.0005 15.7242C6.84019 15.7242 4.27827 13.1622 4.27827 10.002Z\" fill=\"currentColor\" class=\"path\" /></svg></div>`}}"
116
+ "name": "Ve",
117
+ "default": "class extends v{constructor(){super(...arguments);this.color=\"var(--primer-color-loader)\";this.size=\"medium\";this.compact=!1}getSize(){if(this.size in Yo)return Yo[this.size];let e=parseInt(this.size,10);return isNaN(e)?Yo.medium:e}render(){let e=this.getSize(),r=20,o=`0 0 ${r} ${r}`;return this.style.setProperty(\"--spinner-color\",this.color),this.style.setProperty(\"--spinner-size\",`${e}px`),m`<div class=\"spinner-container ${this.compact?\"compact\":\"\"}\"><svg class=\"spinner\" width=\"${e}\" height=\"${e}\" viewBox=\"${o}\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" role=\"status\" aria-label=\"Loading\" ><path d=\"M4.27827 10.002C4.27827 6.84166 6.84019 4.27973 10.0005 4.27973C10.7676 4.27973 11.3894 3.6579 11.3894 2.89084C11.3894 2.12378 10.7676 1.50195 10.0005 1.50195C5.30607 1.50195 1.50049 5.30753 1.50049 10.002C1.50049 14.6964 5.30607 18.502 10.0005 18.502C14.6949 18.502 18.5005 14.6964 18.5005 10.002C18.5005 9.23489 17.8787 8.61306 17.1116 8.61306C16.3445 8.61306 15.7227 9.23489 15.7227 10.002C15.7227 13.1622 13.1608 15.7242 10.0005 15.7242C6.84019 15.7242 4.27827 13.1622 4.27827 10.002Z\" fill=\"currentColor\" class=\"path\" /></svg></div>`}}"
113
118
  },
114
119
  {
115
120
  "kind": "variable",
116
- "name": "$e",
117
- "default": "class extends v{constructor(){super(...arguments);this.focusWithin=!1;this.hasError=!1;this.handleWrapperClick=e=>{if(e.target!==e.currentTarget)return;let r=this.findSlottedPrimerInput();r?r.focus():this.dispatchEvent(new CustomEvent(\"wrapper-click\",{bubbles:!0,composed:!0}))}}findSlottedPrimerInput(){if(!this.inputSlot)return null;let e=this.inputSlot.assignedElements({flatten:!0}),r=e.find(o=>o.tagName.toLowerCase()===\"primer-input\");if(r)return r;for(let o of e){let a=o.querySelector(\"primer-input\");if(a)return a}return null}render(){let e={\"input-slot\":!0,\"focus-within\":this.focusWithin};return m`<div class=\"input-wrapper\"><slot name=\"label\"></slot><div class=\"${re(e)}\" @click=\"${this.handleWrapperClick}\"><slot name=\"input\"></slot></div><slot name=\"error\"></slot></div>`}}"
121
+ "name": "Ue",
122
+ "default": "class extends v{constructor(){super(...arguments);this.focusWithin=!1;this.hasError=!1;this.handleWrapperClick=e=>{if(e.target!==e.currentTarget)return;let r=this.findSlottedPrimerInput();r?r.focus():this.dispatchEvent(new CustomEvent(\"wrapper-click\",{bubbles:!0,composed:!0}))}}findSlottedPrimerInput(){if(!this.inputSlot)return null;let e=this.inputSlot.assignedElements({flatten:!0}),r=e.find(o=>o.tagName.toLowerCase()===\"primer-input\");if(r)return r;for(let o of e){let n=o.querySelector(\"primer-input\");if(n)return n}return null}render(){let e={\"input-slot\":!0,\"focus-within\":this.focusWithin};return m`<div class=\"input-wrapper\"><slot name=\"label\"></slot><div class=\"${re(e)}\" @click=\"${this.handleWrapperClick}\"><slot name=\"input\"></slot></div><slot name=\"error\"></slot></div>`}}"
118
123
  },
119
124
  {
120
125
  "kind": "variable",
121
- "name": "qe",
126
+ "name": "Ze",
122
127
  "default": "class extends v{constructor(){super(...arguments);this.for=\"\";this.disabled=!1}render(){return m`<label for=${this.for}><slot></slot></label>`}}"
123
128
  },
124
129
  {
125
130
  "kind": "variable",
126
- "name": "ue",
127
- "default": "class extends v{constructor(){super(...arguments);this.variant=\"primary\";this.disabled=!1;this.loading=!1;this.buttonType=\"button\";this.selectionState=\"default\";this.selectable=!1;this.flex=!0;this.handleClick=()=>{!this.selectable||this.disabled||this.loading||(this.selectionState=this.selectionState===\"default\"?\"checked\":\"default\",this.dispatchEvent(new CustomEvent(\"selection-change\",{bubbles:!0,composed:!0,detail:{state:this.selectionState}})))}}renderCheckmark(){return!this.selectable||this.selectionState!==\"checked\"||this.loading?h:m`<primer-icon name=\"checkmark\" size=\"sm\" color=\"var(--primer-color-brand)\" ></primer-icon>`}renderSpinner(){if(!this.loading)return h;let e;return this.variant===\"primary\"?e=\"var(--primer-color-background-outlined-default)\":(this.variant===\"secondary\"||this.variant===\"tertiary\")&&(e=\"var(--primer-color-gray-900)\"),m`<primer-spinner size=\"small\" color=\"${e}\" compact ></primer-spinner>`}render(){return m`<button type=${this.buttonType} ?disabled=${this.disabled||this.loading} @click=${this.handleClick} part=\"button\" aria-checked=${this.selectionState===\"checked\"} aria-busy=${this.loading} >${this.renderSpinner()} ${this.flex?m`<span class=\"button-content ${this.loading?\"loading\":\"\"}\"><slot></slot></span>`:m`<span class=\"button-content-base ${this.loading?\"loading\":\"\"}\" ><slot></slot></span>`} ${this.renderCheckmark()}</button>`}}"
131
+ "name": "ge",
132
+ "default": "class extends v{constructor(){super(...arguments);this.variant=\"primary\";this.disabled=!1;this.loading=!1;this.buttonType=\"button\";this.selectionState=\"default\";this.selectable=!1;this.flex=!0;this.handleClick=()=>{!this.selectable||this.disabled||this.loading||(this.selectionState=this.selectionState===\"default\"?\"checked\":\"default\",this.dispatchEvent(new CustomEvent(\"selection-change\",{bubbles:!0,composed:!0,detail:{state:this.selectionState}})))}}renderCheckmark(){return!this.selectable||this.selectionState!==\"checked\"||this.loading?g:m`<primer-icon name=\"checkmark\" size=\"sm\" color=\"var(--primer-color-brand)\" ></primer-icon>`}renderSpinner(){if(!this.loading)return g;let e;return this.variant===\"primary\"?e=\"var(--primer-color-background-outlined-default)\":(this.variant===\"secondary\"||this.variant===\"tertiary\")&&(e=\"var(--primer-color-gray-900)\"),m`<primer-spinner size=\"small\" color=\"${e}\" compact ></primer-spinner>`}render(){return m`<button type=${this.buttonType} ?disabled=${this.disabled||this.loading} @click=${this.handleClick} part=\"button\" aria-checked=${this.selectionState===\"checked\"} aria-busy=${this.loading} >${this.renderSpinner()} ${this.flex?m`<span class=\"button-content ${this.loading?\"loading\":\"\"}\"><slot></slot></span>`:m`<span class=\"button-content-base ${this.loading?\"loading\":\"\"}\" ><slot></slot></span>`} ${this.renderCheckmark()}</button>`}}"
128
133
  },
129
134
  {
130
135
  "kind": "variable",
131
- "name": "Je",
136
+ "name": "Xe",
132
137
  "default": "class extends v{constructor(){super(...arguments);this.for=\"\";this.active=!0}render(){return m`<span class=\"error\" role=\"alert\" aria-live=\"polite\" id=\"${this.for||\"\"}\" ><slot></slot></span>`}}"
133
138
  },
134
139
  {
135
140
  "kind": "variable",
136
- "name": "Ve",
137
- "default": "class extends v{constructor(){super(...arguments);this.color=\"var(--primer-color-icon-primary)\";this.size=\"lg\"}render(){let e=this.name?Vn[this.name]:null;return m`<div style=\"--internal-icon-color: ${this.color}\">${e||m`<slot></slot>`}</div>`}}"
141
+ "name": "Ye",
142
+ "default": "class extends v{constructor(){super(...arguments);this.color=\"var(--primer-color-icon-primary)\";this.size=\"lg\"}render(){let e=this.name?Qa[this.name]:null;return m`<div style=\"--internal-icon-color: ${this.color}\">${e||m`<slot></slot>`}</div>`}}"
138
143
  },
139
144
  {
140
145
  "kind": "variable",
141
- "name": "Ze",
146
+ "name": "Qe",
142
147
  "default": "class extends v{constructor(){super(...arguments);this.type=\"complete\"}render(){return this.type===\"complete\"?m`<primer-icon size=\"lg\" name=\"successful-check\" color=\"var(--primer-color-icon-positive)\" ></primer-icon><p>Checkout complete!</p><p class=\"secondary\"> You'll be redirected to the order confirmation page soon. </p>`:m`<primer-icon size=\"lg\" name=\"failure-icon\" color=\"var(--primer-color-icon-negative)\" ></primer-icon><p>Payment failed</p>${this.description?m`<p class=\"secondary\">${this.description}</p>`:m`<p class=\"secondary\">Something went wrong.</p>`} `}}"
143
148
  },
144
149
  {
@@ -148,192 +153,192 @@
148
153
  },
149
154
  {
150
155
  "kind": "variable",
151
- "name": "he",
152
- "default": "class extends v{constructor(){super(...arguments);this.name=\"\";this.id=\"\";this.value=\"\";this.disabled=!1;this.hasError=!1;this.placeholder=\"\";this.options=[]}handleChange(e){let r=e.target,o=this.value;this.value=r.value,this.dispatchEvent(new CustomEvent(\"change\",{detail:this.value,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"input\",{detail:this.value,bubbles:!0,composed:!0})),this.requestUpdate(\"value\",o)}handleFocus(){this.dispatchEvent(new CustomEvent(\"focus\",{bubbles:!0,composed:!0}))}handleBlur(){this.dispatchEvent(new CustomEvent(\"blur\",{bubbles:!0,composed:!0}))}renderSelectOptions(){let e=[];for(let r of this.options)e.push(m`<option value=${r.value}>${r.label}</option>`);return e}render(){return m`<select id=${this.id} name=${this.name} .value=${Fn(this.value)} ?disabled=${this.disabled} ?required=${!this.value} @change=${this.handleChange} @focus=${this.handleFocus} @blur=${this.handleBlur} aria-invalid=${this.hasError?\"true\":\"false\"} ><option value=\"\" disabled ?selected=${!this.value}>${this.placeholder||\"Select an option\"}</option>${this.renderSelectOptions()}</select>`}}"
156
+ "name": "fe",
157
+ "default": "class extends v{constructor(){super(...arguments);this.name=\"\";this.id=\"\";this.value=\"\";this.disabled=!1;this.hasError=!1;this.placeholder=\"\";this.options=[]}handleChange(e){let r=e.target,o=this.value;this.value=r.value,this.dispatchEvent(new CustomEvent(\"change\",{detail:this.value,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"input\",{detail:this.value,bubbles:!0,composed:!0})),this.requestUpdate(\"value\",o)}handleFocus(){this.dispatchEvent(new CustomEvent(\"focus\",{bubbles:!0,composed:!0}))}handleBlur(){this.dispatchEvent(new CustomEvent(\"blur\",{bubbles:!0,composed:!0}))}renderSelectOptions(){let e=[];for(let r of this.options)e.push(m`<option value=${r.value}>${r.label}</option>`);return e}render(){return m`<select id=${this.id} name=${this.name} .value=${os(this.value)} ?disabled=${this.disabled} ?required=${!this.value} @change=${this.handleChange} @focus=${this.handleFocus} @blur=${this.handleBlur} aria-invalid=${this.hasError?\"true\":\"false\"} ><option value=\"\" disabled ?selected=${!this.value}>${this.placeholder||\"Select an option\"}</option>${this.renderSelectOptions()}</select>`}}"
153
158
  },
154
159
  {
155
160
  "kind": "variable",
156
- "name": "fe",
161
+ "name": "ye",
157
162
  "default": "class extends v{constructor(){super(...arguments);this.header=\"\";this.expanded=!1;this.expandText=\"Expand\";this.collapseText=\"Collapse\";this.ariaLabel=\"\";this.buttonVariant=\"primary\";this.isExpanded=!1;this.toggleExpanded=()=>{this.isExpanded=!this.isExpanded,this.dispatchExpandedChangedEvent(this.isExpanded)}}connectedCallback(){super.connectedCallback(),this.isExpanded=this.expanded}dispatchExpandedChangedEvent(e){this.dispatchEvent(new CustomEvent(\"expanded-changed\",{bubbles:!0,composed:!0,detail:{expanded:e}}))}expand(){this.isExpanded||(this.isExpanded=!0,this.dispatchExpandedChangedEvent(!0))}collapse(){this.isExpanded&&(this.isExpanded=!1,this.dispatchExpandedChangedEvent(!1))}render(){let e=this.isExpanded?this.collapseText:this.expandText,r=this.ariaLabel||this.header||e,o=this.header||e;return m`<div class=\"collapsable\"><primer-button variant=${this.buttonVariant} buttonType=\"button\" @click=${this.toggleExpanded} aria-expanded=${this.isExpanded} aria-controls=\"collapsable-content\" aria-label=${r} ><span>${o}</span></primer-button><div class=\"collapsable-wrapper ${this.isExpanded?\"expanded\":\"\"}\" id=\"collapsable-content\" role=\"region\" aria-labelledby=\"collapsable-header\" ><div class=\"collapsable-content\"><slot></slot></div></div></div>`}}"
158
163
  },
159
164
  {
160
165
  "kind": "variable",
161
- "name": "Ue",
162
- "default": "class extends v{constructor(){super();this.message=\"\";this.visible=!1;this._role=\"alert\";this.showMessage=!1;this.role=\"alert\"}get role(){return this._role}set role(e){this._role=e,this.setAttribute(\"role\",e)}updated(e){e.has(\"visible\")&&this.handleVisibilityChange()}handleVisibilityChange(){this.visible?(this.showMessage=!0,this.setAttribute(\"aria-hidden\",\"false\")):setTimeout(()=>{this.showMessage=!1,this.setAttribute(\"aria-hidden\",\"true\")},200)}render(){if(!this.showMessage&&!this.visible)return h;let e={\"error-message\":!0,hidden:!this.visible};return m`<div part=\"error-message\" class=${re(e)} aria-live=\"assertive\" aria-atomic=\"true\" ><div part=\"error-icon\" class=\"error-icon\"><primer-icon name=\"failure-icon\" size=\"sm\" color=\"var(--primer-color-icon-negative)\" ></primer-icon></div><div part=\"error-content\" class=\"error-content\">${this.message}</div></div>`}}"
166
+ "name": "Be",
167
+ "default": "class extends v{constructor(){super();this.message=\"\";this.visible=!1;this._role=\"alert\";this.showMessage=!1;this.role=\"alert\"}get role(){return this._role}set role(e){this._role=e,this.setAttribute(\"role\",e)}updated(e){e.has(\"visible\")&&this.handleVisibilityChange()}handleVisibilityChange(){this.visible?(this.showMessage=!0,this.setAttribute(\"aria-hidden\",\"false\")):setTimeout(()=>{this.showMessage=!1,this.setAttribute(\"aria-hidden\",\"true\")},200)}render(){if(!this.showMessage&&!this.visible)return g;let e={\"error-message\":!0,hidden:!this.visible};return m`<div part=\"error-message\" class=${re(e)} aria-live=\"assertive\" aria-atomic=\"true\" ><div part=\"error-icon\" class=\"error-icon\"><primer-icon name=\"failure-icon\" size=\"sm\" color=\"var(--primer-color-icon-negative)\" ></primer-icon></div><div part=\"error-content\" class=\"error-content\">${this.message}</div></div>`}}"
163
168
  },
164
169
  {
165
170
  "kind": "variable",
166
- "name": "ut",
167
- "default": "class extends v{constructor(){super(...arguments);this._id=`d${Math.random().toString(36).substring(7)}`;this._handleSlotChange=e=>{let o=e.target.assignedNodes();if(!o.length)return;let a=this.getContainer();o.forEach(n=>a.appendChild(n))}}get id(){return this._id}getContainer(){let e=document.querySelector(`#${this._id}`);return e||(e=document.createElement(\"div\"),e.id=this._id,document.body.appendChild(e),this._setupEventListeners(e)),e}_setupEventListeners(e){[\"primer-ach-error\",\"primer-ach-bank-details-collected\",\"primer-ach-mandate-confirmed\",\"primer-ach-mandate-declined\",\"primer-dialog-close\"].forEach(r=>{e.addEventListener(r,o=>{o.stopPropagation(),this.dispatchEvent(new CustomEvent(r,{bubbles:!0,composed:!0,detail:o.detail}))})})}disconnectedCallback(){super.disconnectedCallback(),this.getContainer().remove()}render(){return m`<slot @slotchange=${this._handleSlotChange}></slot>`}}"
171
+ "name": "ht",
172
+ "default": "class extends v{constructor(){super(...arguments);this._id=`d${Math.random().toString(36).substring(7)}`;this._handleSlotChange=e=>{let o=e.target.assignedNodes();if(!o.length)return;let n=this.getContainer();o.forEach(a=>n.appendChild(a))}}get id(){return this._id}getContainer(){let e=document.querySelector(`#${this._id}`);return e||(e=document.createElement(\"div\"),e.id=this._id,document.body.appendChild(e),this._setupEventListeners(e)),e}_setupEventListeners(e){[\"primer-ach-error\",\"primer-ach-bank-details-collected\",\"primer-ach-mandate-confirmed\",\"primer-ach-mandate-declined\",\"primer-dialog-close\"].forEach(r=>{e.addEventListener(r,o=>{o.stopPropagation(),this.dispatchEvent(new CustomEvent(r,{bubbles:!0,composed:!0,detail:o.detail}))})})}disconnectedCallback(){super.disconnectedCallback(),this.getContainer().remove()}render(){return m`<slot @slotchange=${this._handleSlotChange}></slot>`}}"
168
173
  },
169
174
  {
170
175
  "kind": "variable",
171
- "name": "Te",
176
+ "name": "Ne",
172
177
  "default": "class extends v{constructor(){super(...arguments);this.size=\"flex\";this.showCloseButton=!0;this._animationState=\"entering\";this._isVisible=!1;this._handleCloseClick=()=>{this._startExitAnimation()}}startExitAnimation(){this._startExitAnimation()}connectedCallback(){super.connectedCallback(),document.body.style.overflow=\"hidden\",this._startEnterAnimation()}disconnectedCallback(){super.disconnectedCallback(),document.body.style.overflow=\"\",this._animationTimeout&&clearTimeout(this._animationTimeout)}_startEnterAnimation(){this._animationState=\"entering\",this._isVisible=!0,requestAnimationFrame(()=>{this._animationTimeout=window.setTimeout(()=>{this._animationState=\"entered\"},500)})}_startExitAnimation(){this._animationTimeout&&clearTimeout(this._animationTimeout),this._animationState=\"exiting\",this._animationTimeout=window.setTimeout(()=>{this._animationState=\"exited\",this._isVisible=!1,this.dispatchEvent(new CustomEvent(\"primer-dialog-close\",{bubbles:!0,composed:!0}))},500)}render(){return this._isVisible?m`<div class=${re({backdrop:!0,\"backdrop--entering\":this._animationState===\"entering\",\"backdrop--entered\":this._animationState===\"entered\",\"backdrop--exiting\":this._animationState===\"exiting\"})} @click=${e=>{e.preventDefault()}} ><div class=${re({dialog:!0,[this.size]:!0,\"dialog--entering\":this._animationState===\"entering\",\"dialog--entered\":this._animationState===\"entered\",\"dialog--exiting\":this._animationState===\"exiting\"})} ><div class=\"header\">${this.showCloseButton?m`<primer-button variant=\"tertiary\" @click=${this._handleCloseClick} ><primer-icon name=\"close\"></primer-icon></primer-button>`:\"\"}</div><div class=\"content\"><slot></slot></div></div></div>`:m``}}"
173
178
  },
174
179
  {
175
180
  "kind": "variable",
176
181
  "name": "ie",
177
- "default": "class extends v{constructor(){super(...arguments);this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this.klarnaCategories=null;this.disabled=!1;this.selectedCategory=null;this.isExpanded=!1;this.headerAriaLabel=C(\"pay_with\",{id:\"pay_with\"});this._paymentMethodManagerTask=new O(this,{task:async([e,r])=>{if(!e||!r)return N;let o=await r.getCDNAssets(\"KLARNA\");return{manager:e.manager,klarnaIcon:o?.assets?.icon?`${o.goatCdnUrl}/${o.assets.icon}`:\"\"}},args:()=>[this.paymentManagers.get(\"KLARNA\"),this.headlessUtils]});this.toggleExpand=()=>{this.disabled||(this.isExpanded=!this.isExpanded,this.isExpanded||(this.selectedCategory=null))}}async startKlarnaPayment(){if(!(!this._paymentMethodManagerTask.value||!this.selectedCategory))try{await this._paymentMethodManagerTask.value.manager.start({paymentMethodCategoryId:this.selectedCategory})}catch(e){x.errorWithDatadog(\"Failed to start Klarna payment\",{error:e})}}async renderSelectedCategory(){if(!(!this._paymentMethodManagerTask.value||!this.selectedCategory||!this.klarnaContainer))try{this.klarnaContainer.innerHTML=\"\",await this._paymentMethodManagerTask.value.manager.renderCategory({containerId:this.klarnaContainer,paymentMethodCategoryId:this.selectedCategory,onHeightChange:e=>{e>0&&(this.klarnaContainer.style.height=`${e}px`)}})}catch(e){x.errorWithDatadog(\"Failed to render Klarna category\",{error:e})}}selectCategory(e){this.disabled||(this.selectedCategory=e,this.renderSelectedCategory())}updated(e){e.has(\"selectedCategory\")&&this.selectedCategory&&this.renderSelectedCategory()}renderCategorySelection(){let e=this.klarnaCategories?.categories||[];return this.klarnaCategories?.isLoading||!1?m`<div class=\"loading\"><primer-spinner size=\"small\"></primer-spinner></div>`:m`<div class=\"category-selection\">${e.map(o=>m`<button class=${re({\"category-button\":!0,selected:o.id===this.selectedCategory})} @click=${()=>{this.selectCategory(o.id)}} ?disabled=${this.disabled} >${o.name}</button>`)}</div>`}renderExpandedContent(){return m` ${this.renderCategorySelection()} ${this.selectedCategory?m`<div id=\"klarna-category-container\" class=\"klarna-category-container\" ></div>`:h}<button class=${re({\"klarna-pay-button\":!0,loading:!!this.sdkState?.isProcessing,disabled:!this.selectedCategory||this.disabled})} ?disabled=${!this.selectedCategory||this.sdkState?.isProcessing||this.disabled} @click=${()=>this.startKlarnaPayment()} >${C(\"confirm\",{id:\"confirm\"})}</button>`}render(){return this._paymentMethodManagerTask.render({error:e=>{let r=e instanceof Error?e.message:\"Unknown error in Klarna\";return m`<div class=\"error\"> Error loading Klarna: ${r}</div>`},complete:({manager:e,klarnaIcon:r})=>e?m`<div class=\"klarna-container ${this.isExpanded?\"expanded\":\"\"}\"><div class=\"klarna-button-header\"><primer-button buttonType=\"button\" variant=\"secondary\" class=\"klarna-button\" @click=${this.toggleExpand} aria-expanded=${this.isExpanded} aria-controls=\"collapsable-content\" aria-label=${this.headerAriaLabel} ?disabled=${this.disabled} ><img src=${r} alt=\"Klarna logo\" /><span>${C(\"pay_with\",{id:\"pay_with\"})} Klarna</span><span class=\"klarna-accordion-icon ${this.isExpanded?\"expanded\":\"\"}\" > ▼ </span></primer-button></div><div class=\"klarna-expanded-content ${this.isExpanded?\"visible\":\"\"}\" ><div class=\"klarna-accordion-content\">${this.renderExpandedContent()}</div></div></div>`:h})}}"
182
+ "default": "class extends v{constructor(){super(...arguments);this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this.klarnaCategories=null;this.disabled=!1;this.selectedCategory=null;this.isExpanded=!1;this.headerAriaLabel=E(\"pay_with\",{id:\"pay_with\"});this._paymentMethodManagerTask=new D(this,{task:async([e,r])=>{if(!e||!r)return R;let o=await r.getCDNAssets(\"KLARNA\");return{manager:e.manager,klarnaIcon:o?.assets?.icon?`${o.goatCdnUrl}/${o.assets.icon}`:\"\"}},args:()=>[this.paymentManagers.get(\"KLARNA\"),this.headlessUtils]});this.toggleExpand=()=>{this.disabled||(this.isExpanded=!this.isExpanded,this.isExpanded||(this.selectedCategory=null))}}async startKlarnaPayment(){if(!(!this._paymentMethodManagerTask.value||!this.selectedCategory))try{await this._paymentMethodManagerTask.value.manager.start({paymentMethodCategoryId:this.selectedCategory})}catch(e){P.errorWithDatadog(\"Failed to start Klarna payment\",{error:e})}}async renderSelectedCategory(){if(!(!this._paymentMethodManagerTask.value||!this.selectedCategory||!this.klarnaContainer))try{this.klarnaContainer.innerHTML=\"\",await this._paymentMethodManagerTask.value.manager.renderCategory({containerId:this.klarnaContainer,paymentMethodCategoryId:this.selectedCategory,onHeightChange:e=>{e>0&&(this.klarnaContainer.style.height=`${e}px`)}})}catch(e){P.errorWithDatadog(\"Failed to render Klarna category\",{error:e})}}selectCategory(e){this.disabled||(this.selectedCategory=e,this.renderSelectedCategory())}updated(e){e.has(\"selectedCategory\")&&this.selectedCategory&&this.renderSelectedCategory()}renderCategorySelection(){let e=this.klarnaCategories?.categories||[];return this.klarnaCategories?.isLoading||!1?m`<div class=\"loading\"><primer-spinner size=\"small\"></primer-spinner></div>`:m`<div class=\"category-selection\">${e.map(o=>m`<button class=${re({\"category-button\":!0,selected:o.id===this.selectedCategory})} @click=${()=>{this.selectCategory(o.id)}} ?disabled=${this.disabled} >${o.name}</button>`)}</div>`}renderExpandedContent(){return m` ${this.renderCategorySelection()} ${this.selectedCategory?m`<div id=\"klarna-category-container\" class=\"klarna-category-container\" ></div>`:g}<button class=${re({\"klarna-pay-button\":!0,loading:!!this.sdkState?.isProcessing,disabled:!this.selectedCategory||this.disabled})} ?disabled=${!this.selectedCategory||this.sdkState?.isProcessing||this.disabled} @click=${()=>this.startKlarnaPayment()} >${E(\"confirm\",{id:\"confirm\"})}</button>`}render(){return this._paymentMethodManagerTask.render({error:e=>{let r=e instanceof Error?e.message:\"Unknown error in Klarna\";return m`<div class=\"error\"> Error loading Klarna: ${r}</div>`},complete:({manager:e,klarnaIcon:r})=>e?m`<div class=\"klarna-container ${this.isExpanded?\"expanded\":\"\"}\"><div class=\"klarna-button-header\"><primer-button buttonType=\"button\" variant=\"secondary\" class=\"klarna-button\" @click=${this.toggleExpand} aria-expanded=${this.isExpanded} aria-controls=\"collapsable-content\" aria-label=${this.headerAriaLabel} ?disabled=${this.disabled} ><img src=${r} alt=\"Klarna logo\" /><span>${E(\"pay_with\",{id:\"pay_with\"})} Klarna</span><span class=\"klarna-accordion-icon ${this.isExpanded?\"expanded\":\"\"}\" > ▼ </span></primer-button></div><div class=\"klarna-expanded-content ${this.isExpanded?\"visible\":\"\"}\" ><div class=\"klarna-accordion-content\">${this.renderExpandedContent()}</div></div></div>`:g})}}"
178
183
  },
179
184
  {
180
185
  "kind": "variable",
181
- "name": "Be",
182
- "default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.loadManagerTask=new O(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return N;let r=this.paymentManagers.get(e);if(!r)throw new Error(`No manager found for payment method type ${e}`);if(r.type!==\"GOOGLE_PAY\")throw new Error(\"Invalid payment method type for Google Pay component\");return r.manager}}),this.renderButtonTask=new O(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return N;await this.updateComplete;let r=e.createButton();return await r.render(this.shadowRoot?.getRootNode(),{style:{shadowRoot:!0}}),this.disabled&&await r.setDisabled(this.disabled),this.disabled&&this.shadowRoot&&(await this.updateComplete,bi(this.disabled,this.shadowRoot)),r}})}attributeChangedCallback(e,r,o){if(super.attributeChangedCallback(e,r,o),e===\"disabled\"&&r!==o){let a=o!==null,n=this.renderButtonTask.value;n&&n.setDisabled(a)}}updated(e){e.has(\"disabled\")&&this.shadowRoot&&bi(this.disabled,this.shadowRoot)}render(){return h}}"
186
+ "name": "Fe",
187
+ "default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.loadManagerTask=new D(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return R;let r=this.paymentManagers.get(e);if(!r)throw new Error(`No manager found for payment method type ${e}`);if(r.type!==\"GOOGLE_PAY\")throw new Error(\"Invalid payment method type for Google Pay component\");return r.manager}}),this.renderButtonTask=new D(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return R;await this.updateComplete;let r=e.createButton();return await r.render(this.shadowRoot?.getRootNode(),{style:{shadowRoot:!0}}),this.disabled&&await r.setDisabled(this.disabled),this.disabled&&this.shadowRoot&&(await this.updateComplete,Ai(this.disabled,this.shadowRoot)),r}})}attributeChangedCallback(e,r,o){if(super.attributeChangedCallback(e,r,o),e===\"disabled\"&&r!==o){let n=o!==null,a=this.renderButtonTask.value;a&&a.setDisabled(n)}}updated(e){e.has(\"disabled\")&&this.shadowRoot&&Ai(this.disabled,this.shadowRoot)}render(){return g}}"
183
188
  },
184
189
  {
185
190
  "kind": "variable",
186
- "name": "Ye",
187
- "default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.buttonContainerRef=It();this.loadManagerTask=new O(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return N;let r=this.paymentManagers.get(e);if(!r)throw new Error(`No manager found for payment method type ${e}`);if(r.type!==\"APPLE_PAY\")throw new Error(\"Invalid payment method type for Apple Pay component\");return r.manager}}),this.renderButtonTask=new O(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return N;await this.updateComplete;let r=this.buttonContainerRef.value;if(!r)throw new Error(\"Button container not found\");let o=e.createButton(),a=Ei(r);return await o.render(r,{style:{buttonHeight:a}}),this.disabled&&await o.setDisabled(this.disabled),this.disabled&&(await this.updateComplete,Ft(this.disabled,this.buttonContainerRef)),o}})}attributeChangedCallback(e,r,o){if(super.attributeChangedCallback(e,r,o),e===\"disabled\"&&r!==o){let a=o!==null,n=this.renderButtonTask.value;n&&n.setDisabled(a)}}updated(e){e.has(\"disabled\")&&Ft(this.disabled,this.buttonContainerRef)}render(){return m`<div class=\"native-button-container\" ${ft(this.buttonContainerRef)} ></div>`}}"
191
+ "name": "He",
192
+ "default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.buttonContainerRef=Lt();this.loadManagerTask=new D(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return R;let r=this.paymentManagers.get(e);if(!r)throw new Error(`No manager found for payment method type ${e}`);if(r.type!==\"APPLE_PAY\")throw new Error(\"Invalid payment method type for Apple Pay component\");return r.manager}}),this.renderButtonTask=new D(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return R;await this.updateComplete;let r=this.buttonContainerRef.value;if(!r)throw new Error(\"Button container not found\");let o=e.createButton(),n=Pi(r);return await o.render(r,{style:{buttonHeight:n}}),this.disabled&&await o.setDisabled(this.disabled),this.disabled&&(await this.updateComplete,jt(this.disabled,this.buttonContainerRef)),o}})}attributeChangedCallback(e,r,o){if(super.attributeChangedCallback(e,r,o),e===\"disabled\"&&r!==o){let n=o!==null,a=this.renderButtonTask.value;a&&a.setDisabled(n)}}updated(e){e.has(\"disabled\")&&jt(this.disabled,this.buttonContainerRef)}render(){return m`<div class=\"native-button-container\" ${ft(this.buttonContainerRef)} ></div>`}}"
188
193
  },
189
194
  {
190
195
  "kind": "variable",
191
- "name": "He",
192
- "default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.buttonContainerRef=It();this.loadManagerTask=new O(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return N;let r=this.paymentManagers.get(e);if(!r)throw new Error(`No manager found for payment method type ${e}`);if(r.type!==\"PAYPAL\")throw new Error(\"Invalid payment method type for PayPal component\");return r.manager}}),this.renderButtonTask=new O(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return N;await this.updateComplete;let r=this.buttonContainerRef.value;if(!r)throw new Error(\"Button container not found\");let o=e.createButton(),a=Ei(r),n=ts(a),l=55;return a>l&&x.warn(`PayPal button height (${a}px) exceeds maximum allowed height of ${l}px. Button will be capped at ${l}px. This is a PayPal SDK limitation.`),await o.render(r,{style:{buttonHeight:n}}),this.disabled&&await o.setDisabled(this.disabled),this.disabled&&(await this.updateComplete,Ft(this.disabled,this.buttonContainerRef)),o}})}attributeChangedCallback(e,r,o){if(super.attributeChangedCallback(e,r,o),e===\"disabled\"&&r!==o){let a=o!==null,n=this.renderButtonTask.value;n&&n.setDisabled(a)}}updated(e){e.has(\"disabled\")&&Ft(this.disabled,this.buttonContainerRef)}render(){return m`<div class=\"native-button-container\" ${ft(this.buttonContainerRef)} ></div>`}}"
196
+ "name": "ze",
197
+ "default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.buttonContainerRef=Lt();this.loadManagerTask=new D(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return R;let r=this.paymentManagers.get(e);if(!r)throw new Error(`No manager found for payment method type ${e}`);if(r.type!==\"PAYPAL\")throw new Error(\"Invalid payment method type for PayPal component\");return r.manager}}),this.renderButtonTask=new D(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return R;await this.updateComplete;let r=this.buttonContainerRef.value;if(!r)throw new Error(\"Button container not found\");let o=e.createButton(),n=Pi(this),a=fs(n),s=55;return n>s&&P.warn(`PayPal button height (${n}px) exceeds maximum allowed height of ${s}px. Button will be capped at ${s}px. This is a PayPal SDK limitation.`),await o.render(r,{style:{buttonHeight:a}}),this.disabled&&await o.setDisabled(this.disabled),this.disabled&&(await this.updateComplete,jt(this.disabled,this.buttonContainerRef)),o}})}attributeChangedCallback(e,r,o){if(super.attributeChangedCallback(e,r,o),e===\"disabled\"&&r!==o){let n=o!==null,a=this.renderButtonTask.value;a&&a.setDisabled(n)}}updated(e){e.has(\"disabled\")&&jt(this.disabled,this.buttonContainerRef)}render(){return m`<div class=\"native-button-container\" ${ft(this.buttonContainerRef)} ></div>`}}"
193
198
  },
194
199
  {
195
200
  "kind": "variable",
196
- "name": "ge",
197
- "default": "class extends v{constructor(){super(...arguments);this.disabled=!1;this.paymentManagers=new Map;this.currentState=\"collapsed\";this.blikCode=\"\";this.errorMessage=\"\";this.pollingDuration=0;this.pollingTimer=null;this.loadManagerTask=new O(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return N;let r=this.paymentManagers.get(e);if(!r)throw new Error(\"BLIK payment method manager not initialized\");if(r.type!==\"ADYEN_BLIK\")throw new Error(\"Invalid payment method type for BLIK component\");return r.manager}});this.handleButtonClick=async()=>{if(this.disabled)return;if(this.currentState===\"expanded-input\"){this.handleCollapse();return}if(this.currentState!==\"collapsed\")return;let e=this.paymentMethod?.type;if(!e){this.errorMessage=C(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",x.error(\"Payment method type not available\");return}let r=this.paymentManagers.get(e);if(!r||r.type!==\"ADYEN_BLIK\"){this.errorMessage=C(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",x.error(\"Manager not available when expanding BLIK form\");return}this.currentState=\"expanded-input\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()};this.handleCollapse=()=>{this.currentState=\"collapsed\",this.blikCode=\"\",this.errorMessage=\"\",this.stopPollingTimer()};this.handleInput=e=>{let r=e.target,o=r.value,n=o.replace(/\\D/g,\"\").slice(0,6);o!==n&&(r.value=n),this.blikCode=n,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\"),n.length===6&&this.submitBlikCode()};this.handleRetry=async()=>{this.currentState=\"expanded-input\",this.errorMessage=\"\",this.blikCode=\"\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()}}startPollingTimer(){this.pollingDuration=0,this.pollingTimer=window.setInterval(()=>{this.pollingDuration+=1},1e3)}stopPollingTimer(){this.pollingTimer!==null&&(window.clearInterval(this.pollingTimer),this.pollingTimer=null),this.pollingDuration=0}async submitBlikCode(){if(this.blikCode.length!==6){this.errorMessage=C(\"sixDigitCodeErrorTooShort\",{id:\"sixDigitCodeErrorTooShort\"}),this.currentState=\"error\";return}let e=this.loadManagerTask.value;if(!e){this.errorMessage=\"BLIK payment method not initialized\",this.currentState=\"error\",x.error(\"BLIK manager not available via loadManagerTask\");return}this.currentState=\"loading\",this.errorMessage=\"\",this.startPollingTimer();try{await e.start({blikCode:this.blikCode}),this.stopPollingTimer(),this.currentState=\"collapsed\",this.blikCode=\"\"}catch(r){this.stopPollingTimer(),this.currentState=\"error\",this.errorMessage=r instanceof Error?r.message:C(\"tokenizationError\",{id:\"tokenizationError\"}),x.errorWithDatadog(\"BLIK payment failed\",{error:r instanceof Error?{message:r.message,name:r.name}:\"Unknown error\"})}}renderCollapsed(){return m`<primer-button class=\"blik-button\" @click=${this.handleButtonClick} ?disabled=${this.disabled} aria-label=\"${C(\"pay_with\",{id:\"pay_with\"})} BLIK\" aria-expanded=\"${this.currentState!==\"collapsed\"}\" title=\"BLIK\" ><span class=\"image-container\"><img src=\"https://goat-assets.production.core.primer.io/button/blik/inverted.png\" alt=\"BLIK\" /></span></primer-button>`}renderExpandedInput(){return m`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-input-wrapper\"><label for=\"blik-code\" class=\"blik-label\">${C(\"getCodeFromBankingApp\",{id:\"getCodeFromBankingApp\"})}</label><input id=\"blik-code\" type=\"text\" inputmode=\"numeric\" pattern=\"[0-9]*\" maxlength=\"6\" class=\"blik-input\" .value=\"${this.blikCode}\" @input=\"${this.handleInput}\" ?disabled=\"${this.disabled}\" placeholder=\"000000\" aria-label=\"${C(\"sixDigitCodeLabel\",{id:\"sixDigitCodeLabel\"})}\" autocomplete=\"off\" spellcheck=\"false\" /></div></div></div>`}renderLoading(){return m`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-loading\"><primer-spinner size=\"medium\"></primer-spinner>${this.pollingDuration>30?m`<div class=\"blik-timeout-warning\"> This is taking longer than expected... </div>`:h}</div></div></div>`}renderError(){return m`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-error\"><div class=\"blik-error-message\" role=\"alert\">${this.errorMessage||C(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"blik-retry-button\" @click=\"${this.handleRetry}\" ?disabled=\"${this.disabled}\" >${C(\"retry_button\",{id:\"retry_button\"})}</button></div></div></div>`}renderExpandedState(){switch(this.currentState){case\"expanded-input\":return this.renderExpandedInput();case\"loading\":return this.renderLoading();case\"error\":return this.renderError();default:return h}}disconnectedCallback(){super.disconnectedCallback(),this.stopPollingTimer()}render(){return m`<div class=\"blik-container ${this.currentState!==\"collapsed\"?\"expanded\":\"\"}\" >${this.renderCollapsed()} ${this.currentState!==\"collapsed\"?this.renderExpandedState():h}</div>`}}"
201
+ "name": "ve",
202
+ "default": "class extends v{constructor(){super(...arguments);this.disabled=!1;this.paymentManagers=new Map;this.currentState=\"collapsed\";this.blikCode=\"\";this.errorMessage=\"\";this.pollingDuration=0;this.pollingTimer=null;this.loadManagerTask=new D(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return R;let r=this.paymentManagers.get(e);if(!r)throw new Error(\"BLIK payment method manager not initialized\");if(r.type!==\"ADYEN_BLIK\")throw new Error(\"Invalid payment method type for BLIK component\");return r.manager}});this.handleButtonClick=async()=>{if(this.disabled)return;if(this.currentState===\"expanded-input\"){this.handleCollapse();return}if(this.currentState!==\"collapsed\")return;let e=this.paymentMethod?.type;if(!e){this.errorMessage=E(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",P.error(\"Payment method type not available\");return}let r=this.paymentManagers.get(e);if(!r||r.type!==\"ADYEN_BLIK\"){this.errorMessage=E(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",P.error(\"Manager not available when expanding BLIK form\");return}this.currentState=\"expanded-input\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()};this.handleCollapse=()=>{this.currentState=\"collapsed\",this.blikCode=\"\",this.errorMessage=\"\",this.stopPollingTimer()};this.handleInput=e=>{let r=e.target,o=r.value,a=o.replace(/\\D/g,\"\").slice(0,6);o!==a&&(r.value=a),this.blikCode=a,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\"),a.length===6&&this.submitBlikCode()};this.handleRetry=async()=>{this.currentState=\"expanded-input\",this.errorMessage=\"\",this.blikCode=\"\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()}}startPollingTimer(){this.pollingDuration=0,this.pollingTimer=window.setInterval(()=>{this.pollingDuration+=1},1e3)}stopPollingTimer(){this.pollingTimer!==null&&(window.clearInterval(this.pollingTimer),this.pollingTimer=null),this.pollingDuration=0}async submitBlikCode(){if(this.blikCode.length!==6){this.errorMessage=E(\"sixDigitCodeErrorTooShort\",{id:\"sixDigitCodeErrorTooShort\"}),this.currentState=\"error\";return}let e=this.loadManagerTask.value;if(!e){this.errorMessage=\"BLIK payment method not initialized\",this.currentState=\"error\",P.error(\"BLIK manager not available via loadManagerTask\");return}this.currentState=\"loading\",this.errorMessage=\"\",this.startPollingTimer();try{await e.start({blikCode:this.blikCode}),this.stopPollingTimer(),this.currentState=\"collapsed\",this.blikCode=\"\"}catch(r){this.stopPollingTimer(),this.currentState=\"error\",this.errorMessage=r instanceof Error?r.message:E(\"tokenizationError\",{id:\"tokenizationError\"}),P.errorWithDatadog(\"BLIK payment failed\",{error:r instanceof Error?{message:r.message,name:r.name}:\"Unknown error\"})}}renderCollapsed(){return m`<primer-button class=\"blik-button\" @click=${this.handleButtonClick} ?disabled=${this.disabled} aria-label=\"${E(\"pay_with\",{id:\"pay_with\"})} BLIK\" aria-expanded=\"${this.currentState!==\"collapsed\"}\" title=\"BLIK\" ><span class=\"image-container\"><img src=\"https://goat-assets.production.core.primer.io/button/blik/inverted.png\" alt=\"BLIK\" /></span></primer-button>`}renderExpandedInput(){return m`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-input-wrapper\"><label for=\"blik-code\" class=\"blik-label\">${E(\"getCodeFromBankingApp\",{id:\"getCodeFromBankingApp\"})}</label><input id=\"blik-code\" type=\"text\" inputmode=\"numeric\" pattern=\"[0-9]*\" maxlength=\"6\" class=\"blik-input\" .value=\"${this.blikCode}\" @input=\"${this.handleInput}\" ?disabled=\"${this.disabled}\" placeholder=\"000000\" aria-label=\"${E(\"sixDigitCodeLabel\",{id:\"sixDigitCodeLabel\"})}\" autocomplete=\"off\" spellcheck=\"false\" /></div></div></div>`}renderLoading(){return m`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-loading\"><primer-spinner size=\"medium\"></primer-spinner>${this.pollingDuration>30?m`<div class=\"blik-timeout-warning\"> This is taking longer than expected... </div>`:g}</div></div></div>`}renderError(){return m`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-error\"><div class=\"blik-error-message\" role=\"alert\">${this.errorMessage||E(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"blik-retry-button\" @click=\"${this.handleRetry}\" ?disabled=\"${this.disabled}\" >${E(\"retry_button\",{id:\"retry_button\"})}</button></div></div></div>`}renderExpandedState(){switch(this.currentState){case\"expanded-input\":return this.renderExpandedInput();case\"loading\":return this.renderLoading();case\"error\":return this.renderError();default:return g}}disconnectedCallback(){super.disconnectedCallback(),this.stopPollingTimer()}render(){return m`<div class=\"blik-container ${this.currentState!==\"collapsed\"?\"expanded\":\"\"}\" >${this.renderCollapsed()} ${this.currentState!==\"collapsed\"?this.renderExpandedState():g}</div>`}}"
198
203
  },
199
204
  {
200
205
  "kind": "variable",
201
- "name": "Me",
202
- "default": "class extends v{constructor(){super(...arguments);this.type=void 0;this.disabled=!1;this.paymentMethods=null;this.analyticsUtils=null;this.handleClick=()=>{this.paymentMethods?.get(this.type)?.managerType!==\"CARD\"&&this.sendPaymentMethodSelectionEvent()}}sendPaymentMethodSelectionEvent(){this.type&&q({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:this.type})}render(){if(!this.type)return h;let e=this.paymentMethods?.get(this.type);if(!e)return h;let r;switch(e?.managerType){case\"CARD\":r=m`<primer-card-form ?disabled=${this.disabled} ></primer-card-form>`;break;case\"NATIVE\":{let o=e.type;o===yr.GOOGLE_PAY?r=m`<primer-google-pay .paymentMethod=${e} ?disabled=${this.disabled} ></primer-google-pay>`:o===yr.APPLE_PAY?r=m`<primer-apple-pay .paymentMethod=${e} ?disabled=${this.disabled} ></primer-apple-pay>`:o===yr.PAYPAL?r=m`<primer-paypal .paymentMethod=${e} ?disabled=${this.disabled} ></primer-paypal>`:o===yr.ADYEN_BLIK&&(r=m`<primer-blik .paymentMethod=${e} ?disabled=${this.disabled} ></primer-blik>`);break}case\"REDIRECT\":r=m`<primer-redirect-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-redirect-payment>`;break;case\"KLARNA\":r=m`<primer-klarna ?disabled=${this.disabled} ></primer-klarna>`;break;case\"ACH\":r=m`<primer-dynamic-payment .paymentMethod=${e} ></primer-dynamic-payment>`;break;default:return h}return m`<div @click=${this.handleClick}>${r}</div>`}}"
206
+ "name": "Le",
207
+ "default": "class extends v{constructor(){super(...arguments);this.type=void 0;this.disabled=!1;this.paymentMethods=null;this.analyticsUtils=null;this.handleClick=()=>{this.paymentMethods?.get(this.type)?.managerType!==\"CARD\"&&this.sendPaymentMethodSelectionEvent()}}sendPaymentMethodSelectionEvent(){this.type&&J({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:this.type})}render(){if(!this.type)return g;let e=this.paymentMethods?.get(this.type);if(!e)return g;let r;switch(e?.managerType){case\"CARD\":r=m`<primer-card-form ?disabled=${this.disabled} ></primer-card-form>`;break;case\"NATIVE\":{let o=e.type;o===yr.GOOGLE_PAY?r=m`<primer-google-pay .paymentMethod=${e} ?disabled=${this.disabled} ></primer-google-pay>`:o===yr.APPLE_PAY?r=m`<primer-apple-pay .paymentMethod=${e} ?disabled=${this.disabled} ></primer-apple-pay>`:o===yr.PAYPAL?r=m`<primer-paypal .paymentMethod=${e} ?disabled=${this.disabled} ></primer-paypal>`:o===yr.ADYEN_BLIK&&(r=m`<primer-blik .paymentMethod=${e} ?disabled=${this.disabled} ></primer-blik>`);break}case\"REDIRECT\":r=m`<primer-redirect-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-redirect-payment>`;break;case\"KLARNA\":r=m`<primer-klarna ?disabled=${this.disabled} ></primer-klarna>`;break;case\"ACH\":r=m`<primer-dynamic-payment .paymentMethod=${e} ></primer-dynamic-payment>`;break;default:return g}return m`<div @click=${this.handleClick}>${r}</div>`}}"
203
208
  },
204
209
  {
205
210
  "kind": "variable",
206
- "name": "_e",
207
- "default": "class extends v{constructor(){super(...arguments);this.disabled=!1;this.paymentMethods=null;this.clientOptions=null}getFilteredMethods(){if(!this.paymentMethods)return[];let e=this.paymentMethods.toArray();if(this.include){let r=this.include.split(\",\").map(o=>o.trim());e=e.filter(o=>r.includes(o.type))}if(this.exclude){let r=this.exclude.split(\",\").map(o=>o.trim());e=e.filter(o=>!r.includes(o.type))}return e}render(){let e=this.getFilteredMethods();return e.length===0?h:m`<div class=\"payment-methods-container\">${e.map(r=>m`<primer-payment-method type=\"${r.type}\" ?disabled=\"${this.disabled||this.clientOptions?.disabledPayments===!0}\" ></primer-payment-method>`)}</div>`}}"
211
+ "name": "we",
212
+ "default": "class extends v{constructor(){super(...arguments);this.disabled=!1;this.paymentMethods=null;this.clientOptions=null}getFilteredMethods(){if(!this.paymentMethods)return[];let e=this.paymentMethods.toArray();if(this.include){let r=this.include.split(\",\").map(o=>o.trim());e=e.filter(o=>r.includes(o.type))}if(this.exclude){let r=this.exclude.split(\",\").map(o=>o.trim());e=e.filter(o=>!r.includes(o.type))}return e}render(){let e=this.getFilteredMethods();return e.length===0?g:m`<div class=\"payment-methods-container\">${e.map(r=>m`<primer-payment-method type=\"${r.type}\" ?disabled=\"${this.disabled||this.clientOptions?.disabledPayments===!0}\" ></primer-payment-method>`)}</div>`}}"
208
213
  },
209
214
  {
210
215
  "kind": "variable",
211
- "name": "Ce",
212
- "default": "class extends v{constructor(){super(...arguments);this.formController=new xi(this,e=>this._paymentMethodManagerTask.value.setAndValidate(e));this.paymentManagers=new Map;this.sdkState=void 0;this.clientOptions=void 0;this.screen=\"form\";this.isSubmitting=!1;this._paymentMethodManagerTask=new O(this,{task:([e])=>e!==\"STRIPE_ACH\"?N:this.paymentManagers.get(e)?.manager,args:()=>[this.paymentMethod?.type]})}_handleInput(e,r){let o=e.target;this.formController.setFieldValue(r,o.value)}_handleBlur(e){this.formController.setFieldTouched(e)}_handleError(e){this.dispatchEvent(new CustomEvent(\"primer-ach-error\",{bubbles:!0,composed:!0,detail:{error:e instanceof Error?e:new Error(typeof e==\"string\"?e:\"Unknown error occurred\")}}))}async _handleSubmitButtonClick(e){if(!this.isSubmitting){this.isSubmitting=!0;try{let r=await e.start(this.formController.formData);if(!r||r.valid)return await this._handleCollectBankAccountDetails(e);r&&this.formController.setValidation(r,!0)}catch(r){this._handleError(r)}finally{this.isSubmitting=!1}}}async _handleCollectBankAccountDetails(e){try{await e.collectBankAccountDetails(),this.screen=\"mandate\",this.dispatchEvent(new CustomEvent(\"primer-ach-bank-details-collected\",{bubbles:!0,composed:!0}))}catch(r){this._handleError(r)}}async _handleConfirmMandate(){if(this._paymentMethodManagerTask.value){this.isSubmitting=!0;try{await this._paymentMethodManagerTask.value.confirmMandate(),this.dispatchEvent(new CustomEvent(\"primer-ach-mandate-confirmed\",{bubbles:!0,composed:!0}))}catch(e){this._handleError(e)}finally{this.isSubmitting=!1}}}async _handleDeclineMandate(){if(this._paymentMethodManagerTask.value){this.isSubmitting=!0;try{await this._paymentMethodManagerTask.value.declineMandate(),this.dispatchEvent(new CustomEvent(\"primer-ach-mandate-declined\",{bubbles:!0,composed:!0}))}catch(e){this._handleError(e)}finally{this.isSubmitting=!1}}}renderForm(e){return m`<h2>${C(\"payWithAch\",{id:\"payWithAch\"})}</h2><p>${C(\"stripe_ach_user_details_collection_subtitle_label\",{id:\"stripe_ach_user_details_collection_subtitle_label\"})}</p><form @submit=${r=>r.preventDefault()}><div class=\"form-row\"><primer-input-wrapper .hasError=${this.formController.hasError.firstName} ><primer-input-label slot=\"label\">${C(\"stripe_ach_user_details_collection_first_name_label\",{id:\"stripe_ach_user_details_collection_first_name_label\"})}</primer-input-label><primer-input slot=\"input\" .value=${this.formController.formState.firstName.value} @input=${r=>this._handleInput(r,\"firstName\")} @blur=${()=>this._handleBlur(\"firstName\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.firstName?this.formController.formState.firstName.error:h}</primer-input-error></primer-input-wrapper><primer-input-wrapper .hasError=${this.formController.hasError.lastName} ><primer-input-label slot=\"label\">${C(\"stripe_ach_user_details_collection_last_name_label\",{id:\"stripe_ach_user_details_collection_last_name_label\"})}</primer-input-label><primer-input slot=\"input\" .value=${this.formController.formState.lastName.value} @input=${r=>this._handleInput(r,\"lastName\")} @blur=${()=>this._handleBlur(\"lastName\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.lastName?this.formController.formState.lastName.error:h}</primer-input-error></primer-input-wrapper></div><primer-input-wrapper .hasError=${this.formController.hasError.emailAddress} ><primer-input-label slot=\"label\">${C(\"stripe_ach_user_details_collection_email_address_label\",{id:\"stripe_ach_user_details_collection_email_address_label\"})}</primer-input-label><primer-input slot=\"input\" type=\"email\" .value=${this.formController.formState.emailAddress.value} @input=${r=>this._handleInput(r,\"emailAddress\")} @blur=${()=>this._handleBlur(\"emailAddress\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.emailAddress?this.formController.formState.emailAddress.error:h}</primer-input-error></primer-input-wrapper><p>${C(\"stripe_ach_user_details_collection_data_usage_label\",{id:\"stripe_ach_user_details_collection_data_usage_label\"})}</p><primer-button buttonType=\"submit\" variant=\"primary\" @click=${()=>this._handleSubmitButtonClick(e)} ?disabled=${this.isSubmitting} ?loading=${this.isSubmitting} >${C(\"stripe_ach_user_details_collection_continue_button\",{id:\"stripe_ach_user_details_collection_continue_button\"})}</primer-button></form>`}renderMandate(){return m`<h2>${C(\"payWithAch\",{id:\"payWithAch\"})}</h2><p>${this.clientOptions?.stripe?.mandateData.fullMandateText??C(\"stripe_ach_mandate_template_web\",{id:\"stripe_ach_mandate_template_web\"}).replace(/\\{merchantName\\}/g,this.clientOptions?.stripe?.mandateData.merchantName??\"Merchant\")}</p><div class=\"button-group\"><primer-button variant=\"primary\" @click=${this._handleConfirmMandate.bind(this)} ?disabled=${this.isSubmitting} ?loading=${this.isSubmitting} >${C(\"stripe_ach_mandate_accept_button\",{id:\"stripe_ach_mandate_accept_button\"})}</primer-button><primer-button variant=\"tertiary\" @click=${this._handleDeclineMandate.bind(this)} ?disabled=${this.isSubmitting} >${C(\"stripe_ach_mandate_cancel_payment_button\",{id:\"stripe_ach_mandate_cancel_payment_button\"})}</primer-button></div>`}render(){return this._paymentMethodManagerTask.render({complete:e=>e?this.screen===\"form\"?this.renderForm(e):this.renderMandate():h})}}"
216
+ "name": "Se",
217
+ "default": "class extends v{constructor(){super(...arguments);this.formController=new xi(this,e=>this._paymentMethodManagerTask.value.setAndValidate(e));this.paymentManagers=new Map;this.sdkState=void 0;this.clientOptions=void 0;this.screen=\"form\";this.isSubmitting=!1;this._paymentMethodManagerTask=new D(this,{task:([e])=>e!==\"STRIPE_ACH\"?R:this.paymentManagers.get(e)?.manager,args:()=>[this.paymentMethod?.type]})}_handleInput(e,r){let o=e.target;this.formController.setFieldValue(r,o.value)}_handleBlur(e){this.formController.setFieldTouched(e)}_handleError(e){this.dispatchEvent(new CustomEvent(\"primer-ach-error\",{bubbles:!0,composed:!0,detail:{error:e instanceof Error?e:new Error(typeof e==\"string\"?e:\"Unknown error occurred\")}}))}async _handleSubmitButtonClick(e){if(!this.isSubmitting){this.isSubmitting=!0;try{let r=await e.start(this.formController.formData);if(!r||r.valid)return await this._handleCollectBankAccountDetails(e);r&&this.formController.setValidation(r,!0)}catch(r){this._handleError(r)}finally{this.isSubmitting=!1}}}async _handleCollectBankAccountDetails(e){try{await e.collectBankAccountDetails(),this.screen=\"mandate\",this.dispatchEvent(new CustomEvent(\"primer-ach-bank-details-collected\",{bubbles:!0,composed:!0}))}catch(r){this._handleError(r)}}async _handleConfirmMandate(){if(this._paymentMethodManagerTask.value){this.isSubmitting=!0;try{await this._paymentMethodManagerTask.value.confirmMandate(),this.dispatchEvent(new CustomEvent(\"primer-ach-mandate-confirmed\",{bubbles:!0,composed:!0}))}catch(e){this._handleError(e)}finally{this.isSubmitting=!1}}}async _handleDeclineMandate(){if(this._paymentMethodManagerTask.value){this.isSubmitting=!0;try{await this._paymentMethodManagerTask.value.declineMandate(),this.dispatchEvent(new CustomEvent(\"primer-ach-mandate-declined\",{bubbles:!0,composed:!0}))}catch(e){this._handleError(e)}finally{this.isSubmitting=!1}}}renderForm(e){return m`<h2>${E(\"payWithAch\",{id:\"payWithAch\"})}</h2><p>${E(\"stripe_ach_user_details_collection_subtitle_label\",{id:\"stripe_ach_user_details_collection_subtitle_label\"})}</p><form @submit=${r=>r.preventDefault()}><div class=\"form-row\"><primer-input-wrapper .hasError=${this.formController.hasError.firstName} ><primer-input-label slot=\"label\">${E(\"stripe_ach_user_details_collection_first_name_label\",{id:\"stripe_ach_user_details_collection_first_name_label\"})}</primer-input-label><primer-input slot=\"input\" .value=${this.formController.formState.firstName.value} @input=${r=>this._handleInput(r,\"firstName\")} @blur=${()=>this._handleBlur(\"firstName\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.firstName?this.formController.formState.firstName.error:g}</primer-input-error></primer-input-wrapper><primer-input-wrapper .hasError=${this.formController.hasError.lastName} ><primer-input-label slot=\"label\">${E(\"stripe_ach_user_details_collection_last_name_label\",{id:\"stripe_ach_user_details_collection_last_name_label\"})}</primer-input-label><primer-input slot=\"input\" .value=${this.formController.formState.lastName.value} @input=${r=>this._handleInput(r,\"lastName\")} @blur=${()=>this._handleBlur(\"lastName\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.lastName?this.formController.formState.lastName.error:g}</primer-input-error></primer-input-wrapper></div><primer-input-wrapper .hasError=${this.formController.hasError.emailAddress} ><primer-input-label slot=\"label\">${E(\"stripe_ach_user_details_collection_email_address_label\",{id:\"stripe_ach_user_details_collection_email_address_label\"})}</primer-input-label><primer-input slot=\"input\" type=\"email\" .value=${this.formController.formState.emailAddress.value} @input=${r=>this._handleInput(r,\"emailAddress\")} @blur=${()=>this._handleBlur(\"emailAddress\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.emailAddress?this.formController.formState.emailAddress.error:g}</primer-input-error></primer-input-wrapper><p>${E(\"stripe_ach_user_details_collection_data_usage_label\",{id:\"stripe_ach_user_details_collection_data_usage_label\"})}</p><primer-button buttonType=\"submit\" variant=\"primary\" @click=${()=>this._handleSubmitButtonClick(e)} ?disabled=${this.isSubmitting} ?loading=${this.isSubmitting} >${E(\"stripe_ach_user_details_collection_continue_button\",{id:\"stripe_ach_user_details_collection_continue_button\"})}</primer-button></form>`}renderMandate(){return m`<h2>${E(\"payWithAch\",{id:\"payWithAch\"})}</h2><p>${this.clientOptions?.stripe?.mandateData.fullMandateText??E(\"stripe_ach_mandate_template_web\",{id:\"stripe_ach_mandate_template_web\"}).replace(/\\{merchantName\\}/g,this.clientOptions?.stripe?.mandateData.merchantName??\"Merchant\")}</p><div class=\"button-group\"><primer-button variant=\"primary\" @click=${this._handleConfirmMandate.bind(this)} ?disabled=${this.isSubmitting} ?loading=${this.isSubmitting} >${E(\"stripe_ach_mandate_accept_button\",{id:\"stripe_ach_mandate_accept_button\"})}</primer-button><primer-button variant=\"tertiary\" @click=${this._handleDeclineMandate.bind(this)} ?disabled=${this.isSubmitting} >${E(\"stripe_ach_mandate_cancel_payment_button\",{id:\"stripe_ach_mandate_cancel_payment_button\"})}</primer-button></div>`}render(){return this._paymentMethodManagerTask.render({complete:e=>e?this.screen===\"form\"?this.renderForm(e):this.renderMandate():g})}}"
213
218
  },
214
219
  {
215
220
  "kind": "variable",
216
- "name": "Pe",
217
- "default": "class extends v{constructor(){super(...arguments);this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this.open=!1;this._paymentMethodManagerTask=new O(this,{task:([e,r])=>!e||!r?N:r.get(e)?.manager,args:()=>[this.paymentMethod?.type,this.paymentManagers]});this._getAssetsTask=new O(this,{task:([e,r])=>{if(!e||!r)return N;let o=r.getPaymentMethodConfiguration(e);return o?{backgroundColor:o.displayMetadata.button.backgroundColor.colored,name:o.name,displayName:this._legacyGetButtonLabel(o.displayMetadata.button.text),iconUrl:o.displayMetadata.button.iconUrl.colored||o.displayMetadata.button.iconUrl.light||o.displayMetadata.button.iconUrl.dark}:N},args:()=>[this.paymentMethod?.type,this.headlessUtils]});this._setupTasks=new O(this,{task:([e,r])=>!e||!r?N:{paymentMethodManager:e,assetsConfig:r},args:()=>[this._paymentMethodManagerTask.value,this._getAssetsTask.value]})}_legacyGetButtonLabel(e){if(!e)return;let r=e?br(e):\"\";return r===\"payWith\"&&(r=\"pay_with\"),C(r,{id:r})}start(){this._paymentMethodManagerTask.value&&(this.open=!0)}renderDialog(){return this.open?m`<primer-portal><primer-dialog @primer-dialog-close=\"${()=>this.open=!1}\"><primer-ach-payment .paymentMethod=${this.paymentMethod} @primer-ach-error=${()=>this.open=!1} @primer-ach-mandate-confirmed=${()=>this.open=!1} @primer-ach-mandate-declined=${()=>this.open=!1} ></primer-ach-payment></primer-dialog></primer-portal>`:h}render(){return this._setupTasks.render({error:()=>h,complete:({assetsConfig:e})=>(this.style.setProperty(\"--dynamic-payment-button-bg-color\",e.backgroundColor),m`<primer-button @click=\"${()=>this.start()}\" class=${re({loading:!!this.sdkState?.isProcessing,reverse:!0})} title=\"${C(\"pay_with\",{id:\"pay_with\"})} ${e.name}\" ><span class=\"image-container\"><img src=\"${e.iconUrl}\" alt=\"${e.name}\" /></span>${e.displayName}</primer-button>${this.renderDialog()} `)})}}"
221
+ "name": "Ie",
222
+ "default": "class extends v{constructor(){super(...arguments);this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this.open=!1;this._paymentMethodManagerTask=new D(this,{task:([e,r])=>!e||!r?R:r.get(e)?.manager,args:()=>[this.paymentMethod?.type,this.paymentManagers]});this._getAssetsTask=new D(this,{task:([e,r])=>{if(!e||!r)return R;let o=r.getPaymentMethodConfiguration(e);return o?{backgroundColor:o.displayMetadata.button.backgroundColor.colored,name:o.name,displayName:this._legacyGetButtonLabel(o.displayMetadata.button.text),iconUrl:o.displayMetadata.button.iconUrl.colored||o.displayMetadata.button.iconUrl.light||o.displayMetadata.button.iconUrl.dark}:R},args:()=>[this.paymentMethod?.type,this.headlessUtils]});this._setupTasks=new D(this,{task:([e,r])=>!e||!r?R:{paymentMethodManager:e,assetsConfig:r},args:()=>[this._paymentMethodManagerTask.value,this._getAssetsTask.value]})}_legacyGetButtonLabel(e){if(!e)return;let r=e?Cr(e):\"\";return r===\"payWith\"&&(r=\"pay_with\"),E(r,{id:r})}start(){this._paymentMethodManagerTask.value&&(this.open=!0)}renderDialog(){return this.open?m`<primer-portal><primer-dialog @primer-dialog-close=\"${()=>this.open=!1}\"><primer-ach-payment .paymentMethod=${this.paymentMethod} @primer-ach-error=${()=>this.open=!1} @primer-ach-mandate-confirmed=${()=>this.open=!1} @primer-ach-mandate-declined=${()=>this.open=!1} ></primer-ach-payment></primer-dialog></primer-portal>`:g}render(){return this._setupTasks.render({error:()=>g,complete:({assetsConfig:e})=>(this.style.setProperty(\"--dynamic-payment-button-bg-color\",e.backgroundColor),m`<primer-button @click=\"${()=>this.start()}\" class=${re({loading:!!this.sdkState?.isProcessing,reverse:!0})} title=\"${E(\"pay_with\",{id:\"pay_with\"})} ${e.name}\" ><span class=\"image-container\"><img src=\"${e.iconUrl}\" alt=\"${e.name}\" /></span>${e.displayName}</primer-button>${this.renderDialog()} `)})}}"
218
223
  },
219
224
  {
220
225
  "kind": "variable",
221
- "name": "we",
222
- "default": "class extends v{constructor(){super(...arguments);this.disabled=!1;this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this._paymentMethodManagerTask=new O(this,{task:([e,r])=>!e||!r?N:r.get(e)?.manager,args:()=>[this.paymentMethod?.type,this.paymentManagers]});this._getAssetsTask=new O(this,{task:([e,r])=>{if(!e||!r)return N;let o=r.getPaymentMethodConfiguration(e);if(!o)return N;let a=o.displayMetadata.button.backgroundColor.colored??o.displayMetadata.button.backgroundColor.light,n=o.displayMetadata.button.iconPositionRelativeToText||\"START\";return{backgroundColor:a,name:o.name,displayName:this._legacyGetButtonLabel(o.displayMetadata.button.text),iconUrl:o.displayMetadata.button.iconUrl.colored??o.displayMetadata.button.iconUrl.light,iconPosition:n}},args:()=>[this.paymentMethod?.type,this.headlessUtils]});this._setupTasks=new O(this,{task:([e,r])=>!e||!r?N:{paymentMethodManager:e,assetsConfig:r},args:()=>[this._paymentMethodManagerTask.value,this._getAssetsTask.value]})}_legacyGetButtonLabel(e){if(!e)return;let r=e?br(e):\"\";return r===\"payWith\"&&(r=\"pay_with\"),C(r,{id:r})}startRedirectPayment(){this.disabled||this._paymentMethodManagerTask.value&&this._paymentMethodManagerTask.value.start()}render(){return this._setupTasks.render({error:()=>h,complete:({assetsConfig:e})=>{this.style.setProperty(\"--redirect-payment-button-bg-color\",e.backgroundColor);let r={loading:!!this.sdkState?.isProcessing,\"icon-end\":e.iconPosition===\"END\",\"image-only\":!e.displayName},o=e.displayName?m`<span class=\"image-container\"><img src=\"${e.iconUrl}\" alt=\"${e.name}\" /></span><span class=\"button-text\">${e.displayName}</span>`:m`<span class=\"image-container\"><img src=\"${e.iconUrl}\" alt=\"${e.name}\" /></span>`;return m`<primer-button @click=\"${()=>this.startRedirectPayment()}\" class=${re(r)} title=\"${C(\"pay_with\",{id:\"pay_with\"})} ${e.name}\" ?disabled=${this.disabled} >${o}</primer-button>`}})}}"
226
+ "name": "ke",
227
+ "default": "class extends v{constructor(){super(...arguments);this.disabled=!1;this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this._paymentMethodManagerTask=new D(this,{task:([e,r])=>!e||!r?R:r.get(e)?.manager,args:()=>[this.paymentMethod?.type,this.paymentManagers]});this._getAssetsTask=new D(this,{task:([e,r])=>{if(!e||!r)return R;let o=r.getPaymentMethodConfiguration(e);if(!o)return R;let n=o.displayMetadata.button.backgroundColor.colored??o.displayMetadata.button.backgroundColor.light,a=o.displayMetadata.button.iconPositionRelativeToText||\"START\";return{backgroundColor:n,name:o.name,displayName:this._legacyGetButtonLabel(o.displayMetadata.button.text),iconUrl:o.displayMetadata.button.iconUrl.colored??o.displayMetadata.button.iconUrl.light,iconPosition:a}},args:()=>[this.paymentMethod?.type,this.headlessUtils]});this._setupTasks=new D(this,{task:([e,r])=>!e||!r?R:{paymentMethodManager:e,assetsConfig:r},args:()=>[this._paymentMethodManagerTask.value,this._getAssetsTask.value]})}_legacyGetButtonLabel(e){if(!e)return;let r=e?Cr(e):\"\";return r===\"payWith\"&&(r=\"pay_with\"),E(r,{id:r})}startRedirectPayment(){this.disabled||this._paymentMethodManagerTask.value&&this._paymentMethodManagerTask.value.start()}render(){return this._setupTasks.render({error:()=>g,complete:({assetsConfig:e})=>{this.style.setProperty(\"--redirect-payment-button-bg-color\",e.backgroundColor);let r={loading:!!this.sdkState?.isProcessing,\"icon-end\":e.iconPosition===\"END\",\"image-only\":!e.displayName},o=e.displayName?m`<span class=\"image-container\"><img src=\"${e.iconUrl}\" alt=\"${e.name}\" /></span><span class=\"button-text\">${e.displayName}</span>`:m`<span class=\"image-container\"><img src=\"${e.iconUrl}\" alt=\"${e.name}\" /></span>`;return m`<primer-button @click=\"${()=>this.startRedirectPayment()}\" class=${re(r)} title=\"${E(\"pay_with\",{id:\"pay_with\"})} ${e.name}\" ?disabled=${this.disabled} >${o}</primer-button>`}})}}"
223
228
  },
224
229
  {
225
230
  "kind": "variable",
226
231
  "name": "oe",
227
- "default": "class extends v{constructor(){super(...arguments);this.configuration=null;this.headlessUtils=null;this.formData={};this.errors={};this.touchedFields=new Set;this.dirtyFields=new Set;this.focusedField=null;this.submitted=!1;this.countryOptions=[];this._initializationTask=new O(this,{task:async([e,r])=>{if(!e||!r)return N;let o=this.extractFieldConfig(e);return await this.initializeCountryOptions(),o},args:()=>[this.configuration,this.headlessUtils]})}connectedCallback(){super.connectedCallback(),this._initializationTask.value}extractFieldConfig(e){if(e?.checkoutModules){let r=e.checkoutModules.find(o=>o.type===\"BILLING_ADDRESS\");if(r?.options){let o=r.options;return Object.keys(Vo).reduce((a,n)=>({...a,[n]:o[n]??!1}),{})}}return this.defaultFieldConfig}async initializeCountryOptions(){try{let e=$o(\"en\");this.countryOptions=[...e.map(([a,n])=>({value:a,label:n}))],this.requestUpdate(\"countryOptions\");let r=Wi();if(r===\"en\"||r===\"en-GB\"||r.startsWith(\"en-\"))return;if(await cs(r)){let a=$o(r);this.countryOptions=[...a.map(([n,l])=>({value:n,label:l}))],this.requestUpdate(\"countryOptions\")}}catch(e){x.errorWithDatadog(\"Failed to load country locale\",{error:e})}}get fieldConfig(){return this.extractFieldConfig(this.configuration)}get defaultFieldConfig(){return Object.keys(Vo).reduce((e,r)=>({...e,[r]:!1}),{})}get shouldShowForm(){return this.fieldConfig.postalCode}handleInput(e,r){this.formData={...this.formData,[e]:r},this.dirtyFields.add(e),(this.submitted||this.dirtyFields.has(e)&&this.touchedFields.has(e))&&this.validateField(e),this.dispatchEvent(new CustomEvent(\"primer-billing-address-change\",{detail:this.formData,bubbles:!0,composed:!0}))}handleFocus(e){this.focusedField=e}handleBlur(e){this.focusedField=null,this.touchedFields.add(e),this.validateField(e)}validateField(e){let r=this.formData[e],o=this.fieldConfig[e];if(!o){delete this.errors[e];return}if(o&&(!r||r.trim()===\"\")){let a=`${e}ErrorRequired`;this.errors={...this.errors,[e]:C(\"This field is required\",{id:a})}}else{let a={...this.errors};delete a[e],this.errors=a}}validateForm(){return Object.keys(Vo).forEach(e=>{let r=e;this.fieldConfig[r]&&this.validateField(r)}),Object.keys(this.errors).length===0}async validateForSubmission(){if(!this.shouldShowForm)return!0;this.submitted=!0,Object.keys(this.fieldConfig).forEach(r=>{this.fieldConfig[r]&&this.touchedFields.add(r)});let e=this.validateForm();return this.requestUpdate(),await this.updateComplete,e}async submitToSDK(){if(this.headlessUtils?.setBillingAddress)try{return await this.headlessUtils.setBillingAddress(this.formData),this.dispatchEvent(new CustomEvent(\"primer-billing-address-submit\",{detail:this.formData,bubbles:!0,composed:!0})),!0}catch(e){return x.errorWithDatadog(\"Failed to set billing address\",{error:e}),!1}return!0}shouldShowError(e){let r=!!this.errors[e],o=this.dirtyFields.has(e),a=this.touchedFields.has(e);return r&&(this.submitted||o&&a)}render(){return this._initializationTask.render({pending:()=>h,error:()=>h,complete:()=>this.shouldShowForm?(this.removeAttribute(\"hidden\"),m`<div class=\"billing-address-form\"><div class=\"billing-address-title\">${C(\"Billing address\",{id:\"billingAddressLabel\"})}</div>${k(this.fieldConfig.countryCode,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"countryCode\"} .hasError=${this.shouldShowError(\"countryCode\")} ><primer-input-label slot=\"label\">${C(\"Country code\",{id:\"countryCodeLabel\"})}</primer-input-label><primer-select slot=\"input\" id=\"countryCode\" name=\"countryCode\" .value=${this.formData.countryCode||\"\"} .options=${this.countryOptions} .hasError=${this.shouldShowError(\"countryCode\")} placeholder=${C(\"Select a country\",{id:\"countrySelectPlaceholder\"})} @input=${e=>this.handleInput(\"countryCode\",e.detail)} @focus=${()=>this.handleFocus(\"countryCode\")} @blur=${()=>this.handleBlur(\"countryCode\")} ></primer-select>${k(this.shouldShowError(\"countryCode\"),()=>m`<primer-input-error slot=\"error\">${this.errors.countryCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.firstName||this.fieldConfig.lastName,()=>m`<div class=\"billing-address-row\">${k(this.fieldConfig.firstName,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"firstName\"} .hasError=${this.shouldShowError(\"firstName\")} ><primer-input-label slot=\"label\">${C(\"First name\",{id:\"firstNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"firstName\" name=\"firstName\" type=\"text\" .value=${this.formData.firstName||\"\"} placeholder=${C(\"First name\",{id:\"firstNamePlaceholder\"})} @input=${e=>this.handleInput(\"firstName\",e.detail)} @focus=${()=>this.handleFocus(\"firstName\")} @blur=${()=>this.handleBlur(\"firstName\")} ></primer-input>${k(this.shouldShowError(\"firstName\"),()=>m`<primer-input-error slot=\"error\">${this.errors.firstName}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.lastName,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"lastName\"} .hasError=${this.shouldShowError(\"lastName\")} ><primer-input-label slot=\"label\">${C(\"Last name\",{id:\"lastNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"lastName\" name=\"lastName\" type=\"text\" .value=${this.formData.lastName||\"\"} placeholder=${C(\"Last name\",{id:\"lastNamePlaceholder\"})} @input=${e=>this.handleInput(\"lastName\",e.detail)} @focus=${()=>this.handleFocus(\"lastName\")} @blur=${()=>this.handleBlur(\"lastName\")} ></primer-input>${k(this.shouldShowError(\"lastName\"),()=>m`<primer-input-error slot=\"error\">${this.errors.lastName}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${k(this.fieldConfig.addressLine1,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine1\"} .hasError=${this.shouldShowError(\"addressLine1\")} ><primer-input-label slot=\"label\">${C(\"Address line 1\",{id:\"addressLine1\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine1\" name=\"addressLine1\" type=\"text\" .value=${this.formData.addressLine1||\"\"} placeholder=${C(\"Address line 1\",{id:\"addressLine1Placeholder\"})} @input=${e=>this.handleInput(\"addressLine1\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine1\")} @blur=${()=>this.handleBlur(\"addressLine1\")} ></primer-input>${k(this.shouldShowError(\"addressLine1\"),()=>m`<primer-input-error slot=\"error\">${this.errors.addressLine1}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.addressLine2,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine2\"} .hasError=${this.shouldShowError(\"addressLine2\")} ><primer-input-label slot=\"label\">${C(\"Address line 2\",{id:\"addressLine2\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine2\" name=\"addressLine2\" type=\"text\" .value=${this.formData.addressLine2||\"\"} placeholder=${C(\"Address line 2\",{id:\"addressLine2Placeholder\"})} @input=${e=>this.handleInput(\"addressLine2\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine2\")} @blur=${()=>this.handleBlur(\"addressLine2\")} ></primer-input>${k(this.shouldShowError(\"addressLine2\"),()=>m`<primer-input-error slot=\"error\">${this.errors.addressLine2}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.postalCode||this.fieldConfig.city,()=>m`<div class=\"billing-address-row\">${k(this.fieldConfig.postalCode,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"postalCode\"} .hasError=${this.shouldShowError(\"postalCode\")} ><primer-input-label slot=\"label\">${C(\"Postal code\",{id:\"postalCodeLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"postalCode\" name=\"postalCode\" type=\"text\" .value=${this.formData.postalCode||\"\"} placeholder=${C(\"90210\",{id:\"postalCodePlaceholder\"})} @input=${e=>this.handleInput(\"postalCode\",e.detail)} @focus=${()=>this.handleFocus(\"postalCode\")} @blur=${()=>this.handleBlur(\"postalCode\")} ></primer-input>${k(this.shouldShowError(\"postalCode\"),()=>m`<primer-input-error slot=\"error\">${this.errors.postalCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.city,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"city\"} .hasError=${this.shouldShowError(\"city\")} ><primer-input-label slot=\"label\">${C(\"City\",{id:\"cityLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"city\" name=\"city\" type=\"text\" .value=${this.formData.city||\"\"} placeholder=${C(\"Cape Town\",{id:\"cityPlaceholder\"})} @input=${e=>this.handleInput(\"city\",e.detail)} @focus=${()=>this.handleFocus(\"city\")} @blur=${()=>this.handleBlur(\"city\")} ></primer-input>${k(this.shouldShowError(\"city\"),()=>m`<primer-input-error slot=\"error\">${this.errors.city}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${k(this.fieldConfig.state,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"state\"} .hasError=${this.shouldShowError(\"state\")} ><primer-input-label slot=\"label\">${C(\"State / Region / County\",{id:\"stateLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"state\" name=\"state\" type=\"text\" .value=${this.formData.state||\"\"} placeholder=${C(\"State / Region / County\",{id:\"statePlaceholder\"})} @input=${e=>this.handleInput(\"state\",e.detail)} @focus=${()=>this.handleFocus(\"state\")} @blur=${()=>this.handleBlur(\"state\")} ></primer-input>${k(this.shouldShowError(\"state\"),()=>m`<primer-input-error slot=\"error\">${this.errors.state}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`):(this.setAttribute(\"hidden\",\"\"),h)})}}"
232
+ "default": "class extends v{constructor(){super(...arguments);this.configuration=null;this.headlessUtils=null;this.formData={};this.errors={};this.touchedFields=new Set;this.dirtyFields=new Set;this.focusedField=null;this.submitted=!1;this.countryOptions=[];this._initializationTask=new D(this,{task:async([e,r])=>{if(!e||!r)return R;let o=this.extractFieldConfig(e);return await this.initializeCountryOptions(),o},args:()=>[this.configuration,this.headlessUtils]})}connectedCallback(){super.connectedCallback(),this._initializationTask.value}extractFieldConfig(e){if(e?.checkoutModules){let r=e.checkoutModules.find(o=>o.type===\"BILLING_ADDRESS\");if(r?.options){let o=r.options;return Object.keys(Go).reduce((n,a)=>({...n,[a]:o[a]??!1}),{})}}return this.defaultFieldConfig}async initializeCountryOptions(){try{let e=Ko(\"en\");this.countryOptions=[...e.map(([n,a])=>({value:n,label:a}))],this.requestUpdate(\"countryOptions\");let r=_o();if(r===\"en\"||r===\"en-GB\"||r.startsWith(\"en-\"))return;if(await xs(r)){let n=Ko(r);this.countryOptions=[...n.map(([a,s])=>({value:a,label:s}))],this.requestUpdate(\"countryOptions\")}}catch(e){P.errorWithDatadog(\"Failed to load country locale\",{error:e})}}get fieldConfig(){return this.extractFieldConfig(this.configuration)}get defaultFieldConfig(){return Object.keys(Go).reduce((e,r)=>({...e,[r]:!1}),{})}get shouldShowForm(){return this.fieldConfig.postalCode}handleInput(e,r){this.formData={...this.formData,[e]:r},this.dirtyFields.add(e),(this.submitted||this.dirtyFields.has(e)&&this.touchedFields.has(e))&&this.validateField(e),this.dispatchEvent(new CustomEvent(\"primer-billing-address-change\",{detail:this.formData,bubbles:!0,composed:!0}))}handleFocus(e){this.focusedField=e}handleBlur(e){this.focusedField=null,this.touchedFields.add(e),this.validateField(e)}validateField(e){let r=this.formData[e],o=this.fieldConfig[e];if(!o){delete this.errors[e];return}if(o&&(!r||r.trim()===\"\")){let n=`${e}ErrorRequired`;this.errors={...this.errors,[e]:E(\"This field is required\",{id:n})}}else{let n={...this.errors};delete n[e],this.errors=n}}validateForm(){return Object.keys(Go).forEach(e=>{let r=e;this.fieldConfig[r]&&this.validateField(r)}),Object.keys(this.errors).length===0}async validateForSubmission(){if(!this.shouldShowForm)return!0;this.submitted=!0,Object.keys(this.fieldConfig).forEach(r=>{this.fieldConfig[r]&&this.touchedFields.add(r)});let e=this.validateForm();return this.requestUpdate(),await this.updateComplete,e}async submitToSDK(){if(this.headlessUtils?.setBillingAddress)try{return await this.headlessUtils.setBillingAddress(this.formData),this.dispatchEvent(new CustomEvent(\"primer-billing-address-submit\",{detail:this.formData,bubbles:!0,composed:!0})),!0}catch(e){return P.errorWithDatadog(\"Failed to set billing address\",{error:e}),!1}return!0}shouldShowError(e){let r=!!this.errors[e],o=this.dirtyFields.has(e),n=this.touchedFields.has(e);return r&&(this.submitted||o&&n)}render(){return this._initializationTask.render({pending:()=>g,error:()=>g,complete:()=>this.shouldShowForm?(this.removeAttribute(\"hidden\"),m`<div class=\"billing-address-form\"><div class=\"billing-address-title\">${E(\"Billing address\",{id:\"billingAddressLabel\"})}</div>${k(this.fieldConfig.countryCode,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"countryCode\"} .hasError=${this.shouldShowError(\"countryCode\")} ><primer-input-label slot=\"label\">${E(\"Country code\",{id:\"countryCodeLabel\"})}</primer-input-label><primer-select slot=\"input\" id=\"countryCode\" name=\"countryCode\" .value=${this.formData.countryCode||\"\"} .options=${this.countryOptions} .hasError=${this.shouldShowError(\"countryCode\")} placeholder=${E(\"Select a country\",{id:\"countrySelectPlaceholder\"})} @input=${e=>this.handleInput(\"countryCode\",e.detail)} @focus=${()=>this.handleFocus(\"countryCode\")} @blur=${()=>this.handleBlur(\"countryCode\")} ></primer-select>${k(this.shouldShowError(\"countryCode\"),()=>m`<primer-input-error slot=\"error\">${this.errors.countryCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.firstName||this.fieldConfig.lastName,()=>m`<div class=\"billing-address-row\">${k(this.fieldConfig.firstName,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"firstName\"} .hasError=${this.shouldShowError(\"firstName\")} ><primer-input-label slot=\"label\">${E(\"First name\",{id:\"firstNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"firstName\" name=\"firstName\" type=\"text\" .value=${this.formData.firstName||\"\"} placeholder=${E(\"First name\",{id:\"firstNamePlaceholder\"})} @input=${e=>this.handleInput(\"firstName\",e.detail)} @focus=${()=>this.handleFocus(\"firstName\")} @blur=${()=>this.handleBlur(\"firstName\")} ></primer-input>${k(this.shouldShowError(\"firstName\"),()=>m`<primer-input-error slot=\"error\">${this.errors.firstName}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.lastName,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"lastName\"} .hasError=${this.shouldShowError(\"lastName\")} ><primer-input-label slot=\"label\">${E(\"Last name\",{id:\"lastNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"lastName\" name=\"lastName\" type=\"text\" .value=${this.formData.lastName||\"\"} placeholder=${E(\"Last name\",{id:\"lastNamePlaceholder\"})} @input=${e=>this.handleInput(\"lastName\",e.detail)} @focus=${()=>this.handleFocus(\"lastName\")} @blur=${()=>this.handleBlur(\"lastName\")} ></primer-input>${k(this.shouldShowError(\"lastName\"),()=>m`<primer-input-error slot=\"error\">${this.errors.lastName}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${k(this.fieldConfig.addressLine1,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine1\"} .hasError=${this.shouldShowError(\"addressLine1\")} ><primer-input-label slot=\"label\">${E(\"Address line 1\",{id:\"addressLine1\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine1\" name=\"addressLine1\" type=\"text\" .value=${this.formData.addressLine1||\"\"} placeholder=${E(\"Address line 1\",{id:\"addressLine1Placeholder\"})} @input=${e=>this.handleInput(\"addressLine1\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine1\")} @blur=${()=>this.handleBlur(\"addressLine1\")} ></primer-input>${k(this.shouldShowError(\"addressLine1\"),()=>m`<primer-input-error slot=\"error\">${this.errors.addressLine1}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.addressLine2,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine2\"} .hasError=${this.shouldShowError(\"addressLine2\")} ><primer-input-label slot=\"label\">${E(\"Address line 2\",{id:\"addressLine2\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine2\" name=\"addressLine2\" type=\"text\" .value=${this.formData.addressLine2||\"\"} placeholder=${E(\"Address line 2\",{id:\"addressLine2Placeholder\"})} @input=${e=>this.handleInput(\"addressLine2\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine2\")} @blur=${()=>this.handleBlur(\"addressLine2\")} ></primer-input>${k(this.shouldShowError(\"addressLine2\"),()=>m`<primer-input-error slot=\"error\">${this.errors.addressLine2}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.postalCode||this.fieldConfig.city,()=>m`<div class=\"billing-address-row\">${k(this.fieldConfig.postalCode,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"postalCode\"} .hasError=${this.shouldShowError(\"postalCode\")} ><primer-input-label slot=\"label\">${E(\"Postal code\",{id:\"postalCodeLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"postalCode\" name=\"postalCode\" type=\"text\" .value=${this.formData.postalCode||\"\"} placeholder=${E(\"90210\",{id:\"postalCodePlaceholder\"})} @input=${e=>this.handleInput(\"postalCode\",e.detail)} @focus=${()=>this.handleFocus(\"postalCode\")} @blur=${()=>this.handleBlur(\"postalCode\")} ></primer-input>${k(this.shouldShowError(\"postalCode\"),()=>m`<primer-input-error slot=\"error\">${this.errors.postalCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.city,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"city\"} .hasError=${this.shouldShowError(\"city\")} ><primer-input-label slot=\"label\">${E(\"City\",{id:\"cityLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"city\" name=\"city\" type=\"text\" .value=${this.formData.city||\"\"} placeholder=${E(\"Cape Town\",{id:\"cityPlaceholder\"})} @input=${e=>this.handleInput(\"city\",e.detail)} @focus=${()=>this.handleFocus(\"city\")} @blur=${()=>this.handleBlur(\"city\")} ></primer-input>${k(this.shouldShowError(\"city\"),()=>m`<primer-input-error slot=\"error\">${this.errors.city}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${k(this.fieldConfig.state,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"state\"} .hasError=${this.shouldShowError(\"state\")} ><primer-input-label slot=\"label\">${E(\"State / Region / County\",{id:\"stateLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"state\" name=\"state\" type=\"text\" .value=${this.formData.state||\"\"} placeholder=${E(\"State / Region / County\",{id:\"statePlaceholder\"})} @input=${e=>this.handleInput(\"state\",e.detail)} @focus=${()=>this.handleFocus(\"state\")} @blur=${()=>this.handleBlur(\"state\")} ></primer-input>${k(this.shouldShowError(\"state\"),()=>m`<primer-input-error slot=\"error\">${this.errors.state}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`):(this.setAttribute(\"hidden\",\"\"),g)})}}"
228
233
  },
229
234
  {
230
235
  "kind": "variable",
231
- "name": "ae",
232
- "default": "class extends v{constructor(){super();this.vaultManagerContext=null;this.vaultItemContext=null;this.headlessUtils=null;this.isEditMode=!1;this.deletePaymentMethodId=null;this.isDeleting=!1;this.errorMessage=\"\";this.animationDuration=300;this.deleteAssetConfig=null;this.handleToggleEditMode=e=>{this.isEditMode=e.detail,this.deletePaymentMethodId=null,this.isEditMode&&this.vaultItemContext&&this.vaultItemContext.setSelectedVaultedPaymentMethod(null)};this.handleDeletePaymentMethod=async e=>{if(this.deletePaymentMethodId=e.detail,this.deletePaymentMethodId&&this.vaultManagerContext&&this.headlessUtils){let r=this.vaultManagerContext.vaultedPaymentMethods.find(o=>o.id===this.deletePaymentMethodId);r&&(this.deleteAssetConfig=await Ai(r,this.headlessUtils,this.vaultManagerContext))}};this.handleCancelDelete=()=>{this.deletePaymentMethodId=null,this.deleteAssetConfig=null};this.handleConfirmDelete=async()=>{if(!this.vaultManagerContext?.deleteVaultedPaymentMethod||!this.deletePaymentMethodId){this.errorMessage=C(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"});return}try{this.isDeleting=!0,await this.vaultManagerContext.deleteVaultedPaymentMethod(this.deletePaymentMethodId),this.deletePaymentMethodId=null,this.deleteAssetConfig=null}catch(e){this.errorMessage=e instanceof Error?e.message:C(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}finally{this.isDeleting=!1}};this.handlePaymentError=e=>{let r=e.detail?.error;this.errorMessage=r instanceof Error?r.message:C(\"payment_processing_error\",{id:\"payment_processing_error\"})};this.handleCloseError=()=>{this.errorMessage=\"\"};new zt(this,{defaultOptions:{keyframeOptions:{duration:Number(getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-duration\").trim().replace(\"ms\",\"\")),easing:getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-easing\").trim()}}})}getAnimationConfig(){return{keyframeOptions:{duration:this.animationDuration,easing:getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-easing\").trim(),fill:\"both\"}}}getPaymentMethodName(e){if(!this.vaultManagerContext)return\"\";let r=this.vaultManagerContext.vaultedPaymentMethods.find(o=>o.id===e);if(!r)return\"\";try{return Uo(r).description||\"\"}catch{return\"\"}}renderLoadingOverlay(){return m`<div class=\"loading-overlay\" ${gt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ><primer-spinner size=\"medium\" color=\"var(--primer-color-loader)\" ></primer-spinner></div>`}renderDeleteConfirmation(){if(!this.deletePaymentMethodId||!this.deleteAssetConfig)return h;let e=this.getPaymentMethodName(this.deletePaymentMethodId);return m`<div class=\"delete-confirmation-container\"><primer-button disabled variant=\"secondary\"><primer-payment-method-content .assetConfig=${this.deleteAssetConfig} ></primer-payment-method-content></primer-button><primer-vault-delete-confirmation .isDeleting=${this.isDeleting} .paymentMethodId=${this.deletePaymentMethodId} .paymentMethodName=${e} @confirm-delete=${this.handleConfirmDelete} @cancel-delete=${this.handleCancelDelete} ${gt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-delete-confirmation></div>`}renderPaymentMethodItem(e){return this.deletePaymentMethodId===e.id?h:m`<primer-vault-payment-method-item .paymentMethod=${e} .isEditMode=${this.isEditMode} @delete-payment-method=${this.handleDeletePaymentMethod} ${gt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-payment-method-item>`}renderPaymentMethodList(){let e=this.vaultManagerContext?.vaultedPaymentMethods||[],r=!this.isEditMode&&e.length>0&&!this.deletePaymentMethodId;return m`<div class=\"payment-methods-list\">${e.map(o=>this.renderPaymentMethodItem(o))} ${k(r,()=>m`<div class=\"submit-button-container\"><primer-vault-payment-submit class=\"submit-button\" @primer-vault-payment-error=${this.handlePaymentError} ${gt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-payment-submit></div>`,()=>h)}</div>`}render(){if(!this.vaultManagerContext?.enabled)return h;let e=this.vaultManagerContext.vaultedPaymentMethods.length>0,r=this.vaultManagerContext.isLoading,o=this.vaultManagerContext.isUpdating;return m` ${k(!this.vaultManagerContext?.showEmptyState&&!e,()=>h,()=>m`<slot name=\"vault-empty-state\"><div class=\"vault-manager ${o?\"is-updating\":\"\"}\"><primer-vault-manager-header .isEditMode=${this.isEditMode} .hasPaymentMethods=${e} @toggle-edit-mode=${this.handleToggleEditMode} ></primer-vault-manager-header>${k(this.errorMessage,()=>m`<primer-vault-error-message .errorMessage=${this.errorMessage} @close-error=${this.handleCloseError} ${gt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-error-message>`,()=>h)}<div class=\"vault-manager-content\">${k(!r&&!e,()=>m`<div class=\"content-container\"><primer-vault-empty-state ${gt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-empty-state></div>`,()=>h)} ${k(!r&&e,()=>m`<div class=\"content-container\">${k(this.deletePaymentMethodId,()=>this.renderDeleteConfirmation(),()=>this.renderPaymentMethodList())}</div>`,()=>h)}</div>${k(o,()=>this.renderLoadingOverlay(),()=>h)}</div></slot>`)} `}}"
236
+ "name": "ne",
237
+ "default": "class extends v{constructor(){super();this.vaultManagerContext=null;this.vaultItemContext=null;this.headlessUtils=null;this.isEditMode=!1;this.deletePaymentMethodId=null;this.isDeleting=!1;this.errorMessage=\"\";this.animationDuration=300;this.deleteAssetConfig=null;this.handleToggleEditMode=e=>{this.isEditMode=e.detail,this.deletePaymentMethodId=null,this.isEditMode&&this.vaultItemContext&&this.vaultItemContext.setSelectedVaultedPaymentMethod(null)};this.handleDeletePaymentMethod=async e=>{if(this.deletePaymentMethodId=e.detail,this.deletePaymentMethodId&&this.vaultManagerContext&&this.headlessUtils){let r=this.vaultManagerContext.vaultedPaymentMethods.find(o=>o.id===this.deletePaymentMethodId);r&&(this.deleteAssetConfig=await _i(r,this.headlessUtils,this.vaultManagerContext))}};this.handleCancelDelete=()=>{this.deletePaymentMethodId=null,this.deleteAssetConfig=null};this.handleConfirmDelete=async()=>{if(!this.vaultManagerContext?.deleteVaultedPaymentMethod||!this.deletePaymentMethodId){this.errorMessage=E(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"});return}try{this.isDeleting=!0,await this.vaultManagerContext.deleteVaultedPaymentMethod(this.deletePaymentMethodId),this.deletePaymentMethodId=null,this.deleteAssetConfig=null}catch(e){this.errorMessage=e instanceof Error?e.message:E(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}finally{this.isDeleting=!1}};this.handlePaymentError=e=>{let r=e.detail?.error;this.errorMessage=r instanceof Error?r.message:E(\"payment_processing_error\",{id:\"payment_processing_error\"})};this.handleCloseError=()=>{this.errorMessage=\"\"};new Wt(this,{defaultOptions:{keyframeOptions:{duration:Number(getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-duration\").trim().replace(\"ms\",\"\")),easing:getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-easing\").trim()}}})}getAnimationConfig(){return{keyframeOptions:{duration:this.animationDuration,easing:getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-easing\").trim(),fill:\"both\"}}}getPaymentMethodName(e){if(!this.vaultManagerContext)return\"\";let r=this.vaultManagerContext.vaultedPaymentMethods.find(o=>o.id===e);if(!r)return\"\";try{return jo(r).description||\"\"}catch{return\"\"}}renderLoadingOverlay(){return m`<div class=\"loading-overlay\" ${yt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ><primer-spinner size=\"medium\" color=\"var(--primer-color-loader)\" ></primer-spinner></div>`}renderDeleteConfirmation(){if(!this.deletePaymentMethodId||!this.deleteAssetConfig)return g;let e=this.getPaymentMethodName(this.deletePaymentMethodId);return m`<div class=\"delete-confirmation-container\"><primer-button disabled variant=\"secondary\"><primer-payment-method-content .assetConfig=${this.deleteAssetConfig} ></primer-payment-method-content></primer-button><primer-vault-delete-confirmation .isDeleting=${this.isDeleting} .paymentMethodId=${this.deletePaymentMethodId} .paymentMethodName=${e} @confirm-delete=${this.handleConfirmDelete} @cancel-delete=${this.handleCancelDelete} ${yt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-delete-confirmation></div>`}renderPaymentMethodItem(e){return this.deletePaymentMethodId===e.id?g:m`<primer-vault-payment-method-item .paymentMethod=${e} .isEditMode=${this.isEditMode} @delete-payment-method=${this.handleDeletePaymentMethod} ${yt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-payment-method-item>`}renderPaymentMethodList(){let e=this.vaultManagerContext?.vaultedPaymentMethods||[],r=!this.isEditMode&&e.length>0&&!this.deletePaymentMethodId;return m`<div class=\"payment-methods-list\">${e.map(o=>this.renderPaymentMethodItem(o))} ${k(r,()=>m`<div class=\"submit-button-container\"><primer-vault-payment-submit class=\"submit-button\" @primer-vault-payment-error=${this.handlePaymentError} ${yt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-payment-submit></div>`,()=>g)}</div>`}render(){if(!this.vaultManagerContext?.enabled)return g;let e=this.vaultManagerContext.vaultedPaymentMethods.length>0,r=this.vaultManagerContext.isLoading,o=this.vaultManagerContext.isUpdating;return m` ${k(!this.vaultManagerContext?.showEmptyState&&!e,()=>g,()=>m`<slot name=\"vault-empty-state\"><div class=\"vault-manager ${o?\"is-updating\":\"\"}\"><primer-vault-manager-header .isEditMode=${this.isEditMode} .hasPaymentMethods=${e} @toggle-edit-mode=${this.handleToggleEditMode} ></primer-vault-manager-header>${k(this.errorMessage,()=>m`<primer-vault-error-message .errorMessage=${this.errorMessage} @close-error=${this.handleCloseError} ${yt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-error-message>`,()=>g)}<div class=\"vault-manager-content\">${k(!r&&!e,()=>m`<div class=\"content-container\"><primer-vault-empty-state ${yt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-empty-state></div>`,()=>g)} ${k(!r&&e,()=>m`<div class=\"content-container\">${k(this.deletePaymentMethodId,()=>this.renderDeleteConfirmation(),()=>this.renderPaymentMethodList())}</div>`,()=>g)}</div>${k(o,()=>this.renderLoadingOverlay(),()=>g)}</div></slot>`)} `}}"
233
238
  },
234
239
  {
235
240
  "kind": "variable",
236
- "name": "ye",
237
- "default": "class extends v{constructor(){super(...arguments);this.vaultManagerContext=null;this.vaultItemContext=null;this.headlessUtils=null;this.paymentMethod=null;this.isEditMode=!1;this._getAssetsTask=new O(this,{task:async([e,r,o])=>await Ai(e,r,o),args:()=>[this.paymentMethod,this.headlessUtils,this.vaultManagerContext]});this.handleClick=()=>{this.isEditMode||!this.vaultManagerContext||!this.paymentMethod||(this.isSelected()?this.vaultItemContext?.setSelectedVaultedPaymentMethod(null):this.vaultItemContext?.setSelectedVaultedPaymentMethod(this.paymentMethod))};this.handleDeleteClick=e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent(\"delete-payment-method\",{detail:this.paymentMethod?.id,bubbles:!0,composed:!0}))}}isSelected(){if(!this.vaultManagerContext||!this.paymentMethod)return!1;let e=this.vaultItemContext?.selectedVaultedPaymentMethod;return!!e&&e.id===this.paymentMethod.id}render(){return this._getAssetsTask.render({error:()=>h,complete:e=>{let r=this.isSelected()?\"checked\":\"default\",o=!1,a=e?.description;return m`<div class=\"payment-method-wrapper\"><div class=\"payment-method-container\"><primer-button variant=\"secondary\" class=\"payment-method-button ${e.shouldShowCVV?\"with-cvv\":\"\"}\" selectable ?disabled=${this.isEditMode} selectionState=${r} .flex=${o} @click=${this.handleClick} ><primer-payment-method-content .assetConfig=${e} ></primer-payment-method-content>${k(e.shouldShowCVV&&this.isSelected()&&!this.isEditMode,()=>m`<div class=\"payment-method-row mt-2\"><span class=\"flex-center\"><primer-icon name=\"lock\" size=\"sm\"></primer-icon><span class=\"payment-method-subtitle\"> Input the card CVV for a secure payment</span ></span><span class=\"cell-2\"><primer-vault-cvv-input .paymentMethod=\"${this.paymentMethod}\" ><span slot=\"label\"></span></primer-vault-cvv-input></span></div>`,()=>h)}</primer-button>${this.isEditMode?m`<primer-button variant=\"tertiary\" class=\"delete-button\" @click=${this.handleDeleteClick} aria-label=${`${C(\"delete\",{id:\"delete\"})} ${a}`} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:h}</div></div>`}})}}"
241
+ "name": "be",
242
+ "default": "class extends v{constructor(){super(...arguments);this.vaultManagerContext=null;this.vaultItemContext=null;this.headlessUtils=null;this.paymentMethod=null;this.isEditMode=!1;this._getAssetsTask=new D(this,{task:async([e,r,o])=>await _i(e,r,o),args:()=>[this.paymentMethod,this.headlessUtils,this.vaultManagerContext]});this.handleClick=()=>{this.isEditMode||!this.vaultManagerContext||!this.paymentMethod||(this.isSelected()?this.vaultItemContext?.setSelectedVaultedPaymentMethod(null):this.vaultItemContext?.setSelectedVaultedPaymentMethod(this.paymentMethod))};this.handleDeleteClick=e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent(\"delete-payment-method\",{detail:this.paymentMethod?.id,bubbles:!0,composed:!0}))}}isSelected(){if(!this.vaultManagerContext||!this.paymentMethod)return!1;let e=this.vaultItemContext?.selectedVaultedPaymentMethod;return!!e&&e.id===this.paymentMethod.id}render(){return this._getAssetsTask.render({error:()=>g,complete:e=>{let r=this.isSelected()?\"checked\":\"default\",o=!1,n=e?.description;return m`<div class=\"payment-method-wrapper\"><div class=\"payment-method-container\"><primer-button variant=\"secondary\" class=\"payment-method-button ${e.shouldShowCVV?\"with-cvv\":\"\"}\" selectable ?disabled=${this.isEditMode} selectionState=${r} .flex=${o} @click=${this.handleClick} ><primer-payment-method-content .assetConfig=${e} ></primer-payment-method-content>${k(e.shouldShowCVV&&this.isSelected()&&!this.isEditMode,()=>m`<div class=\"payment-method-row mt-2\"><span class=\"flex-center\"><primer-icon name=\"lock\" size=\"sm\"></primer-icon><span class=\"payment-method-subtitle\"> Input the card CVV for a secure payment</span ></span><span class=\"cell-2\"><primer-vault-cvv-input .paymentMethod=\"${this.paymentMethod}\" ><span slot=\"label\"></span></primer-vault-cvv-input></span></div>`,()=>g)}</primer-button>${this.isEditMode?m`<primer-button variant=\"tertiary\" class=\"delete-button\" @click=${this.handleDeleteClick} aria-label=${`${E(\"delete\",{id:\"delete\"})} ${n}`} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:g}</div></div>`}})}}"
238
243
  },
239
244
  {
240
245
  "kind": "variable",
241
- "name": "ke",
242
- "default": "class extends v{constructor(){super(...arguments);this.isEditMode=!1;this.hasPaymentMethods=!1;this.toggleEditMode=()=>{this.dispatchEvent(new CustomEvent(\"toggle-edit-mode\",{detail:!this.isEditMode,bubbles:!0,composed:!0}))}}render(){return m`<div class=\"vault-manager-header\"><h3>${C(\"previouslyUsed\",{id:\"previouslyUsed\"})}</h3>${this.hasPaymentMethods?m`<primer-button variant=\"tertiary\" class=\"edit-button ${this.isEditMode?\"active\":\"\"}\" @click=${this.toggleEditMode} aria-label=${this.isEditMode?C(\"confirm\",{id:\"confirm\"}):C(\"editPaymentMethods\",{id:\"editPaymentMethods\"})} >${this.isEditMode?m`<primer-icon name=\"checkmark\" size=\"sm\"></primer-icon>`:m`<primer-icon name=\"edit\" size=\"sm\"></primer-icon>`}</primer-button>`:h}</div>`}}"
246
+ "name": "Re",
247
+ "default": "class extends v{constructor(){super(...arguments);this.isEditMode=!1;this.hasPaymentMethods=!1;this.toggleEditMode=()=>{this.dispatchEvent(new CustomEvent(\"toggle-edit-mode\",{detail:!this.isEditMode,bubbles:!0,composed:!0}))}}render(){return m`<div class=\"vault-manager-header\"><h3>${E(\"previouslyUsed\",{id:\"previouslyUsed\"})}</h3>${this.hasPaymentMethods?m`<primer-button variant=\"tertiary\" class=\"edit-button ${this.isEditMode?\"active\":\"\"}\" @click=${this.toggleEditMode} aria-label=${this.isEditMode?E(\"confirm\",{id:\"confirm\"}):E(\"editPaymentMethods\",{id:\"editPaymentMethods\"})} >${this.isEditMode?m`<primer-icon name=\"checkmark\" size=\"sm\"></primer-icon>`:m`<primer-icon name=\"edit\" size=\"sm\"></primer-icon>`}</primer-button>`:g}</div>`}}"
243
248
  },
244
249
  {
245
250
  "kind": "variable",
246
- "name": "Ee",
247
- "default": "class extends v{constructor(){super(...arguments);this.isDeleting=!1;this.paymentMethodId=\"\";this.paymentMethodName=\"\";this.vaultManager=null;this.handleConfirmClick=()=>{this.dispatchEvent(new CustomEvent(\"confirm-delete\",{bubbles:!0,composed:!0}))};this.handleCancelClick=()=>{this.dispatchEvent(new CustomEvent(\"cancel-delete\",{bubbles:!0,composed:!0}))}}render(){return m`<div class=\"delete-confirmation\"><p class=\"delete-confirmation-text\"> Are you sure you want to delete this payment method? </p><div class=\"delete-actions\"><primer-button variant=\"secondary\" @click=${this.handleCancelClick} ?disabled=${this.isDeleting} >${C(\"cancel\",{id:\"cancel\"})}</primer-button><primer-button @click=${this.handleConfirmClick} ?disabled=${this.isDeleting} >${this.isDeleting?C(\"deleting\",{id:\"deleting\"}):C(\"confirmVaultedPaymentMethodDeletion\",{id:\"confirmVaultedPaymentMethodDeletion\"})}</primer-button></div></div>`}}"
251
+ "name": "Pe",
252
+ "default": "class extends v{constructor(){super(...arguments);this.isDeleting=!1;this.paymentMethodId=\"\";this.paymentMethodName=\"\";this.vaultManager=null;this.handleConfirmClick=()=>{this.dispatchEvent(new CustomEvent(\"confirm-delete\",{bubbles:!0,composed:!0}))};this.handleCancelClick=()=>{this.dispatchEvent(new CustomEvent(\"cancel-delete\",{bubbles:!0,composed:!0}))}}render(){return m`<div class=\"delete-confirmation\"><p class=\"delete-confirmation-text\"> Are you sure you want to delete this payment method? </p><div class=\"delete-actions\"><primer-button variant=\"secondary\" @click=${this.handleCancelClick} ?disabled=${this.isDeleting} >${E(\"cancel\",{id:\"cancel\"})}</primer-button><primer-button @click=${this.handleConfirmClick} ?disabled=${this.isDeleting} >${this.isDeleting?E(\"deleting\",{id:\"deleting\"}):E(\"confirmVaultedPaymentMethodDeletion\",{id:\"confirmVaultedPaymentMethodDeletion\"})}</primer-button></div></div>`}}"
248
253
  },
249
254
  {
250
255
  "kind": "variable",
251
- "name": "Xe",
252
- "default": "class extends v{render(){return m`<div class=\"empty-state\"><p>${C(\"savedPaymentMethodsEmpty\",{id:\"savedPaymentMethodsEmpty\"})}</p></div>`}}"
256
+ "name": "et",
257
+ "default": "class extends v{render(){return m`<div class=\"empty-state\"><p>${E(\"savedPaymentMethodsEmpty\",{id:\"savedPaymentMethodsEmpty\"})}</p></div>`}}"
253
258
  },
254
259
  {
255
260
  "kind": "variable",
256
- "name": "Fe",
257
- "default": "class extends v{constructor(){super(...arguments);this.errorMessage=\"\";this.handleDismiss=()=>{this.dispatchEvent(new CustomEvent(\"close-error\",{bubbles:!0,composed:!0}))}}render(){return m`<div class=\"error-message\"><div class=\"error-content\"><primer-icon name=\"warning\" size=\"sm\" color=\"var(--primer-color-red-500)\" ></primer-icon><p>${this.errorMessage}</p></div><button @click=${this.handleDismiss} aria-label=${C(\"closeErrorMessage\",{id:\"closeErrorMessage\"})} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></button></div>`}}"
261
+ "name": "Ke",
262
+ "default": "class extends v{constructor(){super(...arguments);this.errorMessage=\"\";this.handleDismiss=()=>{this.dispatchEvent(new CustomEvent(\"close-error\",{bubbles:!0,composed:!0}))}}render(){return m`<div class=\"error-message\"><div class=\"error-content\"><primer-icon name=\"warning\" size=\"sm\" color=\"var(--primer-color-red-500)\" ></primer-icon><p>${this.errorMessage}</p></div><button @click=${this.handleDismiss} aria-label=${E(\"closeErrorMessage\",{id:\"closeErrorMessage\"})} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></button></div>`}}"
258
263
  },
259
264
  {
260
265
  "kind": "variable",
261
- "name": "Q",
262
- "default": "class extends v{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.headlessInstance=null;this.sdkState=null;this.vaultItemContext=null;this.vaultManager=null;this.clientOptions=null;this.variant=\"primary\";this.disabled=!1;this.handleClick=async e=>{if(e.preventDefault(),!this.isButtonDisabled)try{await this.vaultManager?.startVaultedPaymentFlow()}catch(r){let o=new CustomEvent(\"primer-vault-payment-error\",{bubbles:!0,composed:!0,detail:{error:r}});this.dispatchEvent(o)}}}get buttonText(){return this._userAssignedProps.has(\"buttonText\")?this._internalButtonText:C(\"pay\",{id:\"pay\"})}set buttonText(e){let r=this.buttonText;e!==\"\"?(this._userAssignedProps.add(\"buttonText\"),this._internalButtonText=e):(this._userAssignedProps.delete(\"buttonText\"),this._internalButtonText=\"\"),this.requestUpdate(\"buttonText\",r)}get isButtonDisabled(){return!!(this.disabled||!this.vaultItemContext?.selectedVaultedPaymentMethod||this.vaultManager?.isLoading)}render(){let e=this.clientOptions?.submitButton?.amountVisible?this.headlessInstance?.getUIOrderAmount():null,r=e?` ${e}`:h;return m`<primer-button buttonType=\"submit\" variant=${this.variant} @click=${this.handleClick} .disabled=${this.isButtonDisabled} .loading=${this.sdkState?.isProcessing} data-submit >${this.buttonText}${r}</primer-button>`}}"
266
+ "name": "X",
267
+ "default": "class extends v{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.headlessInstance=null;this.sdkState=null;this.vaultItemContext=null;this.vaultManager=null;this.clientOptions=null;this.variant=\"primary\";this.disabled=!1;this.handleClick=async e=>{if(e.preventDefault(),!this.isButtonDisabled)try{await this.vaultManager?.startVaultedPaymentFlow()}catch(r){let o=new CustomEvent(\"primer-vault-payment-error\",{bubbles:!0,composed:!0,detail:{error:r}});this.dispatchEvent(o)}}}get buttonText(){return this._userAssignedProps.has(\"buttonText\")?this._internalButtonText:E(\"pay\",{id:\"pay\"})}set buttonText(e){let r=this.buttonText;e!==\"\"?(this._userAssignedProps.add(\"buttonText\"),this._internalButtonText=e):(this._userAssignedProps.delete(\"buttonText\"),this._internalButtonText=\"\"),this.requestUpdate(\"buttonText\",r)}get isButtonDisabled(){return!!(this.disabled||!this.vaultItemContext?.selectedVaultedPaymentMethod||this.vaultManager?.isLoading)}render(){let e=this.clientOptions?.submitButton?.amountVisible?this.headlessInstance?.getUIOrderAmount():null,r=e?` ${e}`:g;return m`<primer-button buttonType=\"submit\" variant=${this.variant} @click=${this.handleClick} .disabled=${this.isButtonDisabled} .loading=${this.sdkState?.isProcessing} data-submit >${this.buttonText}${r}</primer-button>`}}"
263
268
  },
264
269
  {
265
270
  "kind": "variable",
266
- "name": "G",
267
- "default": "class extends v{constructor(){super();this.vaultManagerFormContext=null;this.vaultManagerCvvContext=null;this.computedStyles=null;this.paymentMethod=null;this.cvvError=null;this.cvvInputIsDirty=!1;this.cvvInputIsBlurred=!1;this.cvvInput=null;this.isFocused=!1;this._setupCVVIframe=new O(this,{task:([e,r])=>!e||!r||e.paymentMethodType!==\"PAYMENT_CARD\"||!e.paymentInstrumentData?.network||r.createCvvInput===null?N:{network:e.paymentInstrumentData.network,createCvvInput:r.createCvvInput},args:()=>[this.paymentMethod,this.vaultManagerFormContext]});this.cvvContainerId=`cvv-container-${Math.random().toString(36).substring(2,9)}`,new O(this,{task:async([e])=>{if(!e)return N;await this.updateComplete;let r=this.renderRoot.querySelector(`#${this.cvvContainerId}`);if(!r)return;let o=Ti(this.computedStyles),a=o?{input:{base:o}}:void 0,n={cardNetwork:e.network,container:r,name:\"cvv\",placeholder:\"123\",style:a};this.cvvInput=await e.createCvvInput?.(n)??null,this.cvvInput&&(this.cvvInput.focus(),this.cvvError=this.cvvInput.metadata.errorCode||null,this.vaultManagerCvvContext?.setCvvInput(this.cvvInput),this.cvvInput.addListener(\"change\",()=>{this.onCvvInputChange()}),this.cvvInput.addListener(\"blur\",()=>{this.onBlur()}),this.cvvInput.addListener(\"focus\",()=>{this.onFocus()}))},args:()=>[this._setupCVVIframe.value]})}disconnectedCallback(){super.disconnectedCallback(),this.cvvInput&&(this.cvvInput.remove(),this.cvvInput=null,this.cvvError=null,this.vaultManagerCvvContext?.setCvvInput(null))}onCvvInputChange(){!this.cvvInput||!this.vaultManagerCvvContext||(this.cvvInputIsDirty=!0,this.cvvError=this.cvvInput.metadata.errorCode||null)}onBlur(){this.cvvInput&&(this.cvvInputIsBlurred=!0,this.cvvError=this.cvvInput.metadata.errorCode||null,this.isFocused=!1)}onFocus(){this.isFocused=!0}render(){return this._setupCVVIframe.render({error:()=>h,complete:()=>m`<div class=\"cvv-input-container\"><primer-input-wrapper .focusWithin=${this.isFocused} .hasError=${!!this.cvvError&&(this.vaultManagerCvvContext?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred)} ><slot name=\"label\" slot=\"label\"><primer-input-label>CVV</primer-input-label></slot><div slot=\"input\" id=\"${this.cvvContainerId}\"></div>${k(this.cvvError&&(this.vaultManagerCvvContext?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred),()=>m`<primer-input-error slot=\"error\">${C(this.cvvError,{id:this.cvvError})}</primer-input-error>`)}</primer-input-wrapper></div>`})}}"
271
+ "name": "j",
272
+ "default": "class extends v{constructor(){super();this.vaultManagerFormContext=null;this.vaultManagerCvvContext=null;this.computedStyles=null;this.paymentMethod=null;this.cvvError=null;this.cvvInputIsDirty=!1;this.cvvInputIsBlurred=!1;this.cvvInput=null;this.isFocused=!1;this._setupCVVIframe=new D(this,{task:([e,r])=>!e||!r||e.paymentMethodType!==\"PAYMENT_CARD\"||!e.paymentInstrumentData?.network||r.createCvvInput===null?R:{network:e.paymentInstrumentData.network,createCvvInput:r.createCvvInput},args:()=>[this.paymentMethod,this.vaultManagerFormContext]});this.cvvContainerId=`cvv-container-${Math.random().toString(36).substring(2,9)}`,new D(this,{task:async([e])=>{if(!e)return R;await this.updateComplete;let r=this.renderRoot.querySelector(`#${this.cvvContainerId}`);if(!r)return;let o=ki(this.computedStyles),n=o?{input:{base:o}}:void 0,a={cardNetwork:e.network,container:r,name:\"cvv\",placeholder:\"123\",style:n};this.cvvInput=await e.createCvvInput?.(a)??null,this.cvvInput&&(this.cvvInput.focus(),this.cvvError=this.cvvInput.metadata.errorCode||null,this.vaultManagerCvvContext?.setCvvInput(this.cvvInput),this.cvvInput.addListener(\"change\",()=>{this.onCvvInputChange()}),this.cvvInput.addListener(\"blur\",()=>{this.onBlur()}),this.cvvInput.addListener(\"focus\",()=>{this.onFocus()}))},args:()=>[this._setupCVVIframe.value]})}disconnectedCallback(){super.disconnectedCallback(),this.cvvInput&&(this.cvvInput.remove(),this.cvvInput=null,this.cvvError=null,this.vaultManagerCvvContext?.setCvvInput(null))}onCvvInputChange(){!this.cvvInput||!this.vaultManagerCvvContext||(this.cvvInputIsDirty=!0,this.cvvError=this.cvvInput.metadata.errorCode||null)}onBlur(){this.cvvInput&&(this.cvvInputIsBlurred=!0,this.cvvError=this.cvvInput.metadata.errorCode||null,this.isFocused=!1)}onFocus(){this.isFocused=!0}render(){return this._setupCVVIframe.render({error:()=>g,complete:()=>m`<div class=\"cvv-input-container\"><primer-input-wrapper .focusWithin=${this.isFocused} .hasError=${!!this.cvvError&&(this.vaultManagerCvvContext?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred)} ><slot name=\"label\" slot=\"label\"><primer-input-label>CVV</primer-input-label></slot><div slot=\"input\" id=\"${this.cvvContainerId}\"></div>${k(this.cvvError&&(this.vaultManagerCvvContext?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred),()=>m`<primer-input-error slot=\"error\">${E(this.cvvError,{id:this.cvvError})}</primer-input-error>`)}</primer-input-wrapper></div>`})}}"
268
273
  },
269
274
  {
270
275
  "kind": "variable",
271
- "name": "ze",
272
- "default": "class extends v{constructor(){super(...arguments);this.assetConfig=null}render(){if(!this.assetConfig)return h;let e=this.assetConfig.description,r=this.assetConfig.icon,o=k(this.assetConfig.icon,()=>m`<img class=\"payment-method-icon\" src=${r} alt=${e} />`,()=>m`<div class=\"payment-method-icon payment-method-icon-generic\"><primer-icon name=\"payment-card\" size=\"sm\"></primer-icon></div>`);return this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType!==\"ACH\"?m`<div class=\"payment-method-card-other\"><div class=\"left-column\"><div class=\"payment-method-header\">${this.assetConfig.fullName}</div><div class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.paymentMethodType}</span ></div></div><div class=\"payment-method-right-column-text\">${this.assetConfig.email||`\\u2022\\u2022\\u2022\\u2022 ${this.assetConfig.last4}`}</div></div>`:this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType===\"ACH\"?m`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.fullName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.bankName}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.accountType}</span ></div></span>`:this.assetConfig.type===\"card\"?m`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.cardholderName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.network}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.expiresDate}</span ></div></span>`:h}}"
276
+ "name": "Ge",
277
+ "default": "class extends v{constructor(){super(...arguments);this.assetConfig=null}render(){if(!this.assetConfig)return g;let e=this.assetConfig.description,r=this.assetConfig.icon,o=k(this.assetConfig.icon,()=>m`<img class=\"payment-method-icon\" src=${r} alt=${e} />`,()=>m`<div class=\"payment-method-icon payment-method-icon-generic\"><primer-icon name=\"payment-card\" size=\"sm\"></primer-icon></div>`);return this.assetConfig.type===\"paypal\"?m`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.fullName}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.paymentMethodType}</span ></span></div></span>`:this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType!==\"ACH\"?m`<div class=\"payment-method-card-other\"><div class=\"left-column\"><div class=\"payment-method-header\">${this.assetConfig.fullName}</div><div class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.paymentMethodType}</span ></div></div><div class=\"payment-method-right-column-text\">${this.assetConfig.email||`\\u2022\\u2022\\u2022\\u2022 ${this.assetConfig.last4}`}</div></div>`:this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType===\"ACH\"?m`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.fullName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.bankName}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.accountType}</span ></div></span>`:this.assetConfig.type===\"card\"?m`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.cardholderName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.network}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.expiresDate}</span ></div></span>`:g}}"
273
278
  },
274
279
  {
275
280
  "kind": "variable",
276
- "name": "ee",
277
- "default": "class extends v{constructor(){super(...arguments);this.hideLabels=!1;this.disabled=!1;this.hasAssignedContent=!1;this.selectedCardNetwork=null;this.formErrorMessage=null;this.paymentMethodSelectionSent=!1;this.paymentManagers=new Map;this.clientOptions=null;this.headlessUtils=null;this.analyticsUtils=null;this.contextEventsController=null;this.cardFormProvider=new F(this,{context:Kt,initialValue:null});this.eventsController=new Lt(this);this._contextCardSubmitListener=null;this._isHandlingContextEvent=!1;this.inputControllers=new Map;this.setupCardFormTask=new O(this,{task:([e])=>{if(!e?.manager)return N;let{manager:r}=e,o=r.createHostedInputs(),{cardNumberInput:a,expiryInput:n,cvvInput:l}=o;return this.cardFormProvider.setValue({cardholderNameInput:o.cardholderNameInput,cardNumberInput:a,expiryInput:n,cvvInput:l,setCardholderName:d=>{r.setCardholderName(d),this.shouldRequireCardholderName&&r.validate?.().then(c=>{let f=c?.validationErrors?.find(A=>A.name===Rs.cardholderName),g=this.inputControllers.get(\"cardholderName\");g&&g.updateMetaFromValidation({valid:!1,error:f?.message||f?.error||null,errorCode:f?.message||f?.error||null})})},setCardNetwork:d=>{this.selectedCardNetwork=d},validate:()=>r.validate(),submit:d=>r.submit(d),hideLabels:this.hideLabels,disabled:this.disabled,setSubmissionState:d=>{this.inputControllers.forEach(c=>{c.setSubmitted(d)})},propagateValidationErrors:d=>{d&&d.forEach(c=>{let u=c.field||c.name,f=c.message||c.error,g=Rs[u];if(g){let A=this.inputControllers.get(g);if(A){let S={valid:!1,error:f,errorCode:f};A.updateMetaFromValidation(S)}}})},registerInputController:(d,c)=>{this.inputControllers.set(d,c)},unregisterInputController:d=>{this.inputControllers.delete(d)},onUserInteraction:()=>{this.sendPaymentMethodSelectionEvent(),this.checkAndSendPaymentDetailsEnteredEvent()}}),!0},args:()=>[this.paymentManagers.get(\"PAYMENT_CARD\")]});this.paymentDetailsEnteredSent=!1;this.handleSlotButtonClick=e=>{let o=e.target.closest(\"button, primer-button\");if(!o)return;let a=o;this.isSubmitButton(a)&&(e.preventDefault(),this.submitCardPayment())};this.handleDirectSubmit=e=>{e.stopPropagation(),this.submitCardPayment()};this.handleContextCardSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitCardPayment())}finally{this._isHandlingContextEvent=!1}}};this.onSlotChange=e=>{let o=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=o.length>0};this.handleFormSubmit=e=>{e.preventDefault(),e.stopPropagation(),this.submitCardPayment()}}updated(e){if(super.updated(e),(e.has(\"hideLabels\")||e.has(\"disabled\"))&&this.cardFormProvider.value&&this.cardFormProvider.setValue({...this.cardFormProvider.value,hideLabels:this.hideLabels,disabled:this.disabled}),e.has(\"contextEventsController\")){let r=e.get(\"contextEventsController\");r?.host&&this._contextCardSubmitListener&&r.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener),this.setupContextEventListeners()}}get shouldShowCardholderName(){let e=this.clientOptions?.card?.cardholderName;return typeof e?.visible==\"boolean\"?e.visible:!0}get shouldRequireCardholderName(){if(!this.shouldShowCardholderName)return!1;let e=this.clientOptions?.card?.cardholderName;return typeof e?.required==\"boolean\"?e.required:!0}sendPaymentMethodSelectionEvent(){this.paymentMethodSelectionSent||(this.paymentMethodSelectionSent=!0,q({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:\"PAYMENT_CARD\"}))}checkAndSendPaymentDetailsEnteredEvent(){if(this.paymentDetailsEnteredSent)return;let e=this.inputControllers.get(\"cardNumber\"),r=this.inputControllers.get(\"expire\"),o=this.inputControllers.get(\"cvv\"),a=e?.meta?.dirty===!0,n=r?.meta?.dirty===!0,l=o?.meta?.dirty===!0,d=!0;this.shouldRequireCardholderName&&(d=this.inputControllers.get(\"cardholderName\")?.meta?.dirty===!0),a&&n&&l&&d&&(this.sendPaymentDetailsEnteredEvent(),this.paymentDetailsEnteredSent=!0)}sendPaymentDetailsEnteredEvent(){q({eventName:\"PAYMENT_DETAILS_ENTERED\",paymentMethod:\"PAYMENT_CARD\"})}connectedCallback(){super.connectedCallback(),this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:card-submit\",this.handleDirectSubmit),this._contextCardSubmitListener=e=>{this.handleContextCardSubmit(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:card-submit\",this.handleDirectSubmit),this.cleanupContextEventListeners(),super.disconnectedCallback()}setupContextEventListeners(){this.contextEventsController?.host&&this._contextCardSubmitListener&&this.contextEventsController.host.addEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}cleanupContextEventListeners(){this.contextEventsController?.host&&this._contextCardSubmitListener&&this.contextEventsController.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}isSubmitButton(e){let r=e.tagName.toLowerCase(),o=r===\"button\",a=r===\"primer-button\";return o&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||a&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitCardPayment(){let e=this.cardFormProvider.value;if(!e||this.disabled)return;this.formErrorMessage=null,e.setSubmissionState?.(!0);let r=this.querySelector(\"primer-billing-address\")||this.renderRoot.querySelector(\"primer-billing-address\"),o=!0;r&&(o=await r.validateForSubmission());let a=await e.validate?.();if(a?.valid&&o){if(r&&!await r.submitToSDK()){let c=C(\"tokenizationError\",{id:\"tokenizationError\"});this.formErrorMessage=c,this.eventsController.dispatchFormSubmitErrors([{field:\"billingAddress\",name:\"billingAddress\",error:\"BILLING_ADDRESS_SUBMISSION_FAILED\",message:c}]);return}let n=this.selectedCardNetwork?{cardNetwork:this.selectedCardNetwork}:void 0;await e.submit?.(n);let l={success:!0};this.eventsController.dispatchFormSubmitSuccess(l)}else{let n=a?.validationErrors;e.propagateValidationErrors?.(n||[]),this.cardFormProvider.setValue({...e,errors:n}),this.eventsController.dispatchFormSubmitErrors(n)}}render(){return this.setupCardFormTask.status===dt.ERROR||this.setupCardFormTask.status===dt.INITIAL?h:m`<form @submit=${this.handleFormSubmit}><slot name=\"card-form-content\" @slotchange=${this.onSlotChange}></slot>${this.setupCardFormTask.render({complete:()=>k(this.hasAssignedContent,()=>h,()=>m`<div class=\"card-form\"><primer-input-card-number></primer-input-card-number><div class=\"card-form-row\"><primer-input-card-expiry></primer-input-card-expiry><primer-input-cvv></primer-input-cvv></div>${k(this.shouldShowCardholderName,()=>m`<primer-input-card-holder-name></primer-input-card-holder-name>`,()=>h)}<primer-billing-address></primer-billing-address></div><primer-card-form-submit></primer-card-form-submit><primer-error-message message=\"${this.formErrorMessage||\"\"}\" ?visible=\"${!!this.formErrorMessage}\" ></primer-error-message>`)})}</form>`}}"
281
+ "name": "Q",
282
+ "default": "class extends v{constructor(){super(...arguments);this.hideLabels=!1;this.disabled=!1;this.hasAssignedContent=!1;this.selectedCardNetwork=null;this.formErrorMessage=null;this.paymentMethodSelectionSent=!1;this.paymentManagers=new Map;this.clientOptions=null;this.headlessUtils=null;this.analyticsUtils=null;this.contextEventsController=null;this.cardFormProvider=new z(this,{context:qt,initialValue:null});this.eventsController=new Yt(this);this._contextCardSubmitListener=null;this._isHandlingContextEvent=!1;this.inputControllers=new Map;this.setupCardFormTask=new D(this,{task:([e])=>{if(!e?.manager)return R;let{manager:r}=e,o=r.createHostedInputs(),{cardNumberInput:n,expiryInput:a,cvvInput:s}=o;return this.cardFormProvider.setValue({cardholderNameInput:o.cardholderNameInput,cardNumberInput:n,expiryInput:a,cvvInput:s,setCardholderName:l=>{r.setCardholderName(l),this.shouldRequireCardholderName&&r.validate?.().then(c=>{let f=c?.validationErrors?.find(A=>A.name===qs.cardholderName),h=this.inputControllers.get(\"cardholderName\");h&&h.updateMetaFromValidation({valid:!1,error:f?.message||f?.error||null,errorCode:f?.message||f?.error||null})})},setCardNetwork:l=>{this.selectedCardNetwork=l},validate:()=>r.validate(),submit:l=>r.submit(l),hideLabels:this.hideLabels,disabled:this.disabled,setSubmissionState:l=>{this.inputControllers.forEach(c=>{c.setSubmitted(l)})},propagateValidationErrors:l=>{l&&l.forEach(c=>{let u=c.field||c.name,f=c.message||c.error,h=qs[u];if(h){let A=this.inputControllers.get(h);if(A){let x={valid:!1,error:f,errorCode:f};A.updateMetaFromValidation(x)}}})},registerInputController:(l,c)=>{this.inputControllers.set(l,c)},unregisterInputController:l=>{this.inputControllers.delete(l)},onUserInteraction:()=>{this.sendPaymentMethodSelectionEvent(),this.checkAndSendPaymentDetailsEnteredEvent()}}),!0},args:()=>[this.paymentManagers.get(\"PAYMENT_CARD\")]});this.paymentDetailsEnteredSent=!1;this.handleSlotButtonClick=e=>{let o=e.target.closest(\"button, primer-button\");if(!o)return;let n=o;this.isSubmitButton(n)&&(e.preventDefault(),this.submitCardPayment())};this.handleDirectSubmit=e=>{e.stopPropagation(),this.submitCardPayment()};this.handleContextCardSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitCardPayment())}finally{this._isHandlingContextEvent=!1}}};this.onSlotChange=e=>{let o=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=o.length>0};this.handleFormSubmit=e=>{e.preventDefault(),e.stopPropagation(),this.submitCardPayment()}}updated(e){if(super.updated(e),(e.has(\"hideLabels\")||e.has(\"disabled\"))&&this.cardFormProvider.value&&this.cardFormProvider.setValue({...this.cardFormProvider.value,hideLabels:this.hideLabels,disabled:this.disabled}),e.has(\"contextEventsController\")){let r=e.get(\"contextEventsController\");r?.host&&this._contextCardSubmitListener&&r.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener),this.setupContextEventListeners()}}get shouldShowCardholderName(){let e=this.clientOptions?.card?.cardholderName;return typeof e?.visible==\"boolean\"?e.visible:!0}get shouldRequireCardholderName(){if(!this.shouldShowCardholderName)return!1;let e=this.clientOptions?.card?.cardholderName;return typeof e?.required==\"boolean\"?e.required:!0}sendPaymentMethodSelectionEvent(){this.paymentMethodSelectionSent||(this.paymentMethodSelectionSent=!0,J({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:\"PAYMENT_CARD\"}))}checkAndSendPaymentDetailsEnteredEvent(){if(this.paymentDetailsEnteredSent)return;let e=this.inputControllers.get(\"cardNumber\"),r=this.inputControllers.get(\"expire\"),o=this.inputControllers.get(\"cvv\"),n=e?.meta?.dirty===!0,a=r?.meta?.dirty===!0,s=o?.meta?.dirty===!0,l=!0;this.shouldRequireCardholderName&&(l=this.inputControllers.get(\"cardholderName\")?.meta?.dirty===!0),n&&a&&s&&l&&(this.sendPaymentDetailsEnteredEvent(),this.paymentDetailsEnteredSent=!0)}sendPaymentDetailsEnteredEvent(){J({eventName:\"PAYMENT_DETAILS_ENTERED\",paymentMethod:\"PAYMENT_CARD\"})}connectedCallback(){super.connectedCallback(),this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:card-submit\",this.handleDirectSubmit),this._contextCardSubmitListener=e=>{this.handleContextCardSubmit(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:card-submit\",this.handleDirectSubmit),this.cleanupContextEventListeners(),super.disconnectedCallback()}setupContextEventListeners(){this.contextEventsController?.host&&this._contextCardSubmitListener&&this.contextEventsController.host.addEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}cleanupContextEventListeners(){this.contextEventsController?.host&&this._contextCardSubmitListener&&this.contextEventsController.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}isSubmitButton(e){let r=e.tagName.toLowerCase(),o=r===\"button\",n=r===\"primer-button\";return o&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||n&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitCardPayment(){let e=this.cardFormProvider.value;if(!e||this.disabled)return;this.formErrorMessage=null,e.setSubmissionState?.(!0);let r=this.querySelector(\"primer-billing-address\")||this.renderRoot.querySelector(\"primer-billing-address\"),o=!0;r&&(o=await r.validateForSubmission());let n=await e.validate?.();if(n?.valid&&o){if(r&&!await r.submitToSDK()){let c=E(\"tokenizationError\",{id:\"tokenizationError\"});this.formErrorMessage=c,this.eventsController.dispatchFormSubmitErrors([{field:\"billingAddress\",name:\"billingAddress\",error:\"BILLING_ADDRESS_SUBMISSION_FAILED\",message:c}]);return}let a=this.selectedCardNetwork?{cardNetwork:this.selectedCardNetwork}:void 0;await e.submit?.(a);let s={success:!0};this.eventsController.dispatchFormSubmitSuccess(s)}else{let a=n?.validationErrors;e.propagateValidationErrors?.(a||[]),this.cardFormProvider.setValue({...e,errors:a}),this.eventsController.dispatchFormSubmitErrors(a)}}render(){return this.setupCardFormTask.status===pt.ERROR||this.setupCardFormTask.status===pt.INITIAL?g:m`<form @submit=${this.handleFormSubmit}><slot name=\"card-form-content\" @slotchange=${this.onSlotChange}></slot>${this.setupCardFormTask.render({complete:()=>k(this.hasAssignedContent,()=>g,()=>m`<div class=\"card-form\"><primer-input-card-number></primer-input-card-number><div class=\"card-form-row\"><primer-input-card-expiry></primer-input-card-expiry><primer-input-cvv></primer-input-cvv></div>${k(this.shouldShowCardholderName,()=>m`<primer-input-card-holder-name></primer-input-card-holder-name>`,()=>g)}<primer-billing-address></primer-billing-address></div><primer-card-form-submit></primer-card-form-submit><primer-error-message message=\"${this.formErrorMessage||\"\"}\" ?visible=\"${!!this.formErrorMessage}\" ></primer-error-message>`)})}</form>`}}"
278
283
  },
279
284
  {
280
285
  "kind": "variable",
281
- "name": "Qe",
282
- "default": "class extends le{constructor(){super();this.config={inputType:\"cardNumber\",containerSelector:\"#cardNumber\",errorName:\"cardNumber-card\",translations:{label:{id:\"cardNumber\",defaultMessage:\"Card Number\"},placeholder:\"4111 1111 1111 1111\",ariaLabel:{id:\"cardNumber\",defaultMessage:\"Card Number\"}}};this.handleNetworkSelected=e=>{let{network:r}=e.detail;this.cardFormContext&&this.cardFormContext.setCardNetwork(r)};this.childUpdated()}renderInput(){if(this.hostedInputController.setupTask.status===dt.ERROR)return h;let e=this.getError();return m`<primer-input-wrapper .focusWithin=\"${this.hostedInputController.meta.active}\" .hasError=${!!e} >${k(!this.cardFormContext?.hideLabels,()=>m`<primer-input-label slot=\"label\" >${this.label}</primer-input-label >`,()=>h)}<div slot=\"input\" class=\"card-number-container\" aria-label=\"${this.ariaLabel}\" ><div id=\"${this.config.containerSelector.substring(1)}\"></div><div class=\"network-selector-container\"><primer-card-network-selector @network-selected=${this.handleNetworkSelected} ></primer-card-network-selector></div></div>${k(e,r=>m`<primer-input-error slot=\"error\">${C(r,{id:r})}</primer-input-error>`,()=>h)}</primer-input-wrapper>`}render(){return this.renderInput()}}"
286
+ "name": "tt",
287
+ "default": "class extends de{constructor(){super();this.config={inputType:\"cardNumber\",containerSelector:\"#cardNumber\",errorName:\"cardNumber-card\",translations:{label:{id:\"cardNumber\",defaultMessage:\"Card Number\"},placeholder:\"4111 1111 1111 1111\",ariaLabel:{id:\"cardNumber\",defaultMessage:\"Card Number\"}}};this.handleNetworkSelected=e=>{let{network:r}=e.detail;this.cardFormContext&&this.cardFormContext.setCardNetwork(r)};this.childUpdated()}renderInput(){if(this.hostedInputController.setupTask.status===pt.ERROR)return g;let e=this.getError();return m`<primer-input-wrapper .focusWithin=\"${this.hostedInputController.meta.active}\" .hasError=${!!e} >${k(!this.cardFormContext?.hideLabels,()=>m`<primer-input-label slot=\"label\" >${this.label}</primer-input-label >`,()=>g)}<div slot=\"input\" class=\"card-number-container\" aria-label=\"${this.ariaLabel}\" ><div id=\"${this.config.containerSelector.substring(1)}\"></div><div class=\"network-selector-container\"><primer-card-network-selector @network-selected=${this.handleNetworkSelected} ></primer-card-network-selector></div></div>${k(e,r=>m`<primer-input-error slot=\"error\">${E(r,{id:r})}</primer-input-error>`,()=>g)}</primer-input-wrapper>`}render(){return this.renderInput()}}"
283
288
  },
284
289
  {
285
290
  "kind": "variable",
286
- "name": "et",
287
- "default": "class extends le{constructor(){super();this.config={inputType:\"cvv\",containerSelector:\"#cvv\",errorName:\"cvv-card\",translations:{label:\"CVV\",placeholder:\"123\"}};this.childUpdated()}render(){return this.renderInput()}}"
291
+ "name": "rt",
292
+ "default": "class extends de{constructor(){super();this.config={inputType:\"cvv\",containerSelector:\"#cvv\",errorName:\"cvv-card\",translations:{label:\"CVV\",placeholder:\"123\"}};this.childUpdated()}render(){return this.renderInput()}}"
288
293
  },
289
294
  {
290
295
  "kind": "variable",
291
- "name": "tt",
292
- "default": "class extends le{constructor(){super();this.config={inputType:\"expire\",containerSelector:\"#expiry\",errorName:\"expiryDate-card\",translations:{label:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"},placeholder:{id:\"cardExpiryPlaceholder\",defaultMessage:\"MM/YY\"},ariaLabel:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"}}};this.childUpdated()}render(){return this.renderInput()}}"
296
+ "name": "it",
297
+ "default": "class extends de{constructor(){super();this.config={inputType:\"expire\",containerSelector:\"#expiry\",errorName:\"expiryDate-card\",translations:{label:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"},placeholder:{id:\"cardExpiryPlaceholder\",defaultMessage:\"MM/YY\"},ariaLabel:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"}}};this.childUpdated()}render(){return this.renderInput()}}"
293
298
  },
294
299
  {
295
300
  "kind": "variable",
296
- "name": "rt",
297
- "default": "class extends le{constructor(){super();this.config={inputType:\"cardholderName\",containerSelector:\"#cardFormName\",errorName:\"cardholderName\",translations:{label:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"},placeholder:{id:\"cardholderNamePlaceholder\",defaultMessage:\"Name on card\"},ariaLabel:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"}},onInput:e=>this.handleInput(e)};this.childUpdated()}handleInput(e){this.cardFormContext?.setCardholderName?.(e)}render(){return this.renderInput()}}"
301
+ "name": "ot",
302
+ "default": "class extends de{constructor(){super();this.config={inputType:\"cardholderName\",containerSelector:\"#cardFormName\",errorName:\"cardholderName\",translations:{label:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"},placeholder:{id:\"cardholderNamePlaceholder\",defaultMessage:\"Name on card\"},ariaLabel:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"}},onInput:e=>this.handleInput(e)};this.childUpdated()}handleInput(e){this.cardFormContext?.setCardholderName?.(e)}render(){return this.renderInput()}}"
298
303
  },
299
304
  {
300
305
  "kind": "variable",
301
306
  "name": "W",
302
- "default": "class extends v{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.headlessUtils=null;this.clientOptions=null;this.sdkState=null;this.cardFormContext=null;this.analyticsUtils=null;this.contextEventsController=null;this.variant=\"primary\";this.disabled=!1;this.handleClick=e=>{if(e.preventDefault(),this.disabled)return;q({eventName:\"PAYMENT_SUBMITTED\",paymentMethod:\"PAYMENT_CARD\"});let r=new CustomEvent(\"primer:card-submit\",{bubbles:!0,composed:!0,detail:{source:\"primer-card-form-submit\"}});this.dispatchEvent(r)}}get buttonText(){return this._userAssignedProps.has(\"buttonText\")?this._internalButtonText:C(\"pay\",{id:\"pay\"})}set buttonText(e){let r=this.buttonText;e!==\"\"?(this._userAssignedProps.add(\"buttonText\"),this._internalButtonText=e):(this._userAssignedProps.delete(\"buttonText\"),this._internalButtonText=\"\"),this.requestUpdate(\"buttonText\",r)}get submitButtonConfig(){return this.clientOptions?.submitButton??null}get shouldShowBuiltInButton(){return this.submitButtonConfig?.useBuiltInButton??!0}render(){if(!this.shouldShowBuiltInButton)return h;let e=this.submitButtonConfig?.amountVisible?this.headlessUtils?.getUIOrderAmount():null,r=e?` ${e}`:h,o=this.disabled||this.cardFormContext?.disabled||!1;return m`<primer-button type=\"submit\" variant=${this.variant} ?disabled=${o} @click=${this.handleClick} .loading=${!!this.sdkState?.isProcessing} data-submit >${this.buttonText}${r}</primer-button>`}}"
307
+ "default": "class extends v{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.headlessUtils=null;this.clientOptions=null;this.sdkState=null;this.cardFormContext=null;this.analyticsUtils=null;this.contextEventsController=null;this.variant=\"primary\";this.disabled=!1;this.handleClick=e=>{if(e.preventDefault(),this.disabled)return;J({eventName:\"PAYMENT_SUBMITTED\",paymentMethod:\"PAYMENT_CARD\"});let r=new CustomEvent(\"primer:card-submit\",{bubbles:!0,composed:!0,detail:{source:\"primer-card-form-submit\"}});this.dispatchEvent(r)}}get buttonText(){return this._userAssignedProps.has(\"buttonText\")?this._internalButtonText:E(\"pay\",{id:\"pay\"})}set buttonText(e){let r=this.buttonText;e!==\"\"?(this._userAssignedProps.add(\"buttonText\"),this._internalButtonText=e):(this._userAssignedProps.delete(\"buttonText\"),this._internalButtonText=\"\"),this.requestUpdate(\"buttonText\",r)}get submitButtonConfig(){return this.clientOptions?.submitButton??null}get shouldShowBuiltInButton(){return this.submitButtonConfig?.useBuiltInButton??!0}render(){if(!this.shouldShowBuiltInButton)return g;let e=this.submitButtonConfig?.amountVisible?this.headlessUtils?.getUIOrderAmount():null,r=e?` ${e}`:g,o=this.disabled||this.cardFormContext?.disabled||!1;return m`<primer-button type=\"submit\" variant=${this.variant} ?disabled=${o} @click=${this.handleClick} .loading=${!!this.sdkState?.isProcessing} data-submit >${this.buttonText}${r}</primer-button>`}}"
303
308
  },
304
309
  {
305
310
  "kind": "variable",
306
- "name": "de",
307
- "default": "class extends v{constructor(){super(...arguments);this.cardNetworks=null;this.headlessUtils=null;this.selectedCardNetwork=null;this.isDropdownOpen=!1;this.focusedNetworkIndex=0;this.isKeyboardNavigation=!1;this.buttonRef=It();this.dropdownRef=It();this.networkOptionRefs=[];this.toggleDropdown=e=>{this.isKeyboardNavigation=!1,e.stopPropagation(),this.getSelectableNetworks().length>1&&(this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&(this.focusedNetworkIndex=this.getSelectedNetworkIndex()))};this.handleClickOutside=e=>{this.isDropdownOpen&&(this.contains(e.target)||(this.isDropdownOpen=!1,this.isKeyboardNavigation=!1))};this.handleMouseMove=()=>{this.isKeyboardNavigation&&(this.isKeyboardNavigation=!1)};this.handleKeyDown=e=>{if(!(!(this.getSelectableNetworks().length>1)||!(this.contains(e.target)||this===e.target||this.isDropdownOpen&&e.target===document.body)))switch(this.isKeyboardNavigation=!0,e.key){case\"ArrowDown\":e.preventDefault(),this.isDropdownOpen?(this.focusedNetworkIndex=(this.focusedNetworkIndex+1)%this.getSelectableNetworks().length,this.focusNetworkOption()):(this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"ArrowUp\":e.preventDefault(),this.isDropdownOpen?(this.focusedNetworkIndex=(this.focusedNetworkIndex-1+this.getSelectableNetworks().length)%this.getSelectableNetworks().length,this.focusNetworkOption()):(this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"Enter\":case\" \":this.isDropdownOpen&&this.focusedNetworkIndex>=0?(e.preventDefault(),this.selectNetwork(e,this.getSelectableNetworks()[this.focusedNetworkIndex])):!this.isDropdownOpen&&this.buttonRef.value===document.activeElement&&(e.preventDefault(),this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"Escape\":this.isDropdownOpen&&(e.preventDefault(),this.isDropdownOpen=!1,this.buttonRef.value?.focus());break;case\"Tab\":this.isDropdownOpen&&(this.isDropdownOpen=!1);break}};this.handleDocumentKeyDown=e=>{this.isDropdownOpen&&this.handleKeyDown(e)}}getNetworkIconUrl(e){return this.headlessUtils?.getCardNetworkAsset(e.network)?.cardUrl}getSelectableNetworks(){return this.cardNetworks?.selectableCardNetworks||[]}getDetectedNetwork(){return this.selectedCardNetwork??(this.cardNetworks?.detectedCardNetwork||null)}getSelectedNetworkIndex(){let e=this.getDetectedNetwork();if(!e)return 0;let r=this.getSelectableNetworks().findIndex(o=>o.network===e.network);return r>=0?r:0}selectNetwork(e,r){e.stopPropagation(),this.selectedCardNetwork=r,this.isDropdownOpen=!1,this.buttonRef.value?.focus(),this.cardNetworks&&this.dispatchEvent(new CustomEvent(\"network-selected\",{detail:{network:r.network},bubbles:!0,composed:!0}))}focusNetworkOption(){requestAnimationFrame(()=>{this.networkOptionRefs[this.focusedNetworkIndex]&&this.networkOptionRefs[this.focusedNetworkIndex].focus()})}setNetworkOptionRef(e,r){this.networkOptionRefs[r]=e}connectedCallback(){super.connectedCallback(),setTimeout(()=>{document.addEventListener(\"click\",this.handleClickOutside),document.addEventListener(\"mousemove\",this.handleMouseMove),this.addEventListener(\"keydown\",this.handleKeyDown),document.addEventListener(\"keydown\",this.handleDocumentKeyDown)},0)}disconnectedCallback(){document.removeEventListener(\"click\",this.handleClickOutside),document.removeEventListener(\"keydown\",this.handleDocumentKeyDown),document.removeEventListener(\"mousemove\",this.handleMouseMove),this.removeEventListener(\"keydown\",this.handleKeyDown),super.disconnectedCallback()}render(){if(this.cardNetworks?.isLoading)return m`<primer-spinner size=\"small\" compact></primer-spinner>`;let e=this.getSelectableNetworks();if(!this.getDetectedNetwork()&&e.length===0)return m`<primer-icon name=\"payment-card\" size=\"sm\"></primer-icon>`;let r=this.getDetectedNetwork()||(e.length>0?e[0]:null);if(!r)return m`<primer-icon name=\"payment-card\" size=\"sm\"></primer-icon>`;let o=e.length>1;return m`<button ${ft(this.buttonRef)} class=\"network-selector\" @click=${this.toggleDropdown} @keydown=${a=>{(a.key===\" \"||a.key===\"Enter\")&&o&&(a.preventDefault(),this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&(this.focusedNetworkIndex=this.getSelectedNetworkIndex()))}} aria-label=${o?`Selected card network: ${r.displayName}. Click to change.`:`Card network: ${r.displayName}`} aria-expanded=${o?this.isDropdownOpen:h} aria-haspopup=${o?\"true\":h} aria-controls=${o?\"network-dropdown\":h} ><img class=\"network-icon\" src=${this.getNetworkIconUrl(r)} alt=${r.displayName} />${k(o,()=>m`<primer-icon class=\"caret ${this.isDropdownOpen?\"open\":\"\"}\" size=\"sm\" name=\"chevron-down\" ></primer-icon>`,()=>h)}</button>${k(this.isDropdownOpen,()=>m`<div ${ft(this.dropdownRef)} id=\"network-dropdown\" class=\"dropdown open\" role=\"listbox\" aria-label=\"Select card network\" >${e.map((a,n)=>m`<div ${ft(l=>this.setNetworkOptionRef(l,n))} class=\"network-option ${this.isKeyboardNavigation&&n===this.focusedNetworkIndex?\"focused\":\"\"}\" @click=${l=>this.selectNetwork(l,a)} @keydown=${l=>{(l.key===\"Enter\"||l.key===\" \")&&this.selectNetwork(l,a)}} role=\"option\" aria-selected=${a.network===r.network} tabindex=\"${n===this.focusedNetworkIndex?\"0\":\"-1\"}\" ><img class=\"network-option-icon\" src=${this.getNetworkIconUrl(a)} alt=${a.displayName} /><span class=\"network-name\">${a.displayName}</span>${k(a.network===r.network,()=>m`<primer-icon class=\"checkmark\" name=\"checkmark\" size=\"sm\" ></primer-icon>`,()=>h)}</div>`)}</div>`,()=>h)} `}}"
311
+ "name": "ce",
312
+ "default": "class extends v{constructor(){super(...arguments);this.cardNetworks=null;this.headlessUtils=null;this.selectedCardNetwork=null;this.isDropdownOpen=!1;this.focusedNetworkIndex=0;this.isKeyboardNavigation=!1;this.buttonRef=Lt();this.dropdownRef=Lt();this.networkOptionRefs=[];this.toggleDropdown=e=>{this.isKeyboardNavigation=!1,e.stopPropagation(),this.getSelectableNetworks().length>1&&(this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&(this.focusedNetworkIndex=this.getSelectedNetworkIndex()))};this.handleClickOutside=e=>{this.isDropdownOpen&&(this.contains(e.target)||(this.isDropdownOpen=!1,this.isKeyboardNavigation=!1))};this.handleMouseMove=()=>{this.isKeyboardNavigation&&(this.isKeyboardNavigation=!1)};this.handleKeyDown=e=>{if(!(!(this.getSelectableNetworks().length>1)||!(this.contains(e.target)||this===e.target||this.isDropdownOpen&&e.target===document.body)))switch(this.isKeyboardNavigation=!0,e.key){case\"ArrowDown\":e.preventDefault(),this.isDropdownOpen?(this.focusedNetworkIndex=(this.focusedNetworkIndex+1)%this.getSelectableNetworks().length,this.focusNetworkOption()):(this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"ArrowUp\":e.preventDefault(),this.isDropdownOpen?(this.focusedNetworkIndex=(this.focusedNetworkIndex-1+this.getSelectableNetworks().length)%this.getSelectableNetworks().length,this.focusNetworkOption()):(this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"Enter\":case\" \":this.isDropdownOpen&&this.focusedNetworkIndex>=0?(e.preventDefault(),this.selectNetwork(e,this.getSelectableNetworks()[this.focusedNetworkIndex])):!this.isDropdownOpen&&this.buttonRef.value===document.activeElement&&(e.preventDefault(),this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"Escape\":this.isDropdownOpen&&(e.preventDefault(),this.isDropdownOpen=!1,this.buttonRef.value?.focus());break;case\"Tab\":this.isDropdownOpen&&(this.isDropdownOpen=!1);break}};this.handleDocumentKeyDown=e=>{this.isDropdownOpen&&this.handleKeyDown(e)}}getNetworkIconUrl(e){return this.headlessUtils?.getCardNetworkAsset(e.network)?.cardUrl}getSelectableNetworks(){return this.cardNetworks?.selectableCardNetworks||[]}getDetectedNetwork(){return this.selectedCardNetwork??(this.cardNetworks?.detectedCardNetwork||null)}getSelectedNetworkIndex(){let e=this.getDetectedNetwork();if(!e)return 0;let r=this.getSelectableNetworks().findIndex(o=>o.network===e.network);return r>=0?r:0}selectNetwork(e,r){e.stopPropagation(),this.selectedCardNetwork=r,this.isDropdownOpen=!1,this.buttonRef.value?.focus(),this.cardNetworks&&this.dispatchEvent(new CustomEvent(\"network-selected\",{detail:{network:r.network},bubbles:!0,composed:!0}))}focusNetworkOption(){requestAnimationFrame(()=>{this.networkOptionRefs[this.focusedNetworkIndex]&&this.networkOptionRefs[this.focusedNetworkIndex].focus()})}setNetworkOptionRef(e,r){this.networkOptionRefs[r]=e}connectedCallback(){super.connectedCallback(),setTimeout(()=>{document.addEventListener(\"click\",this.handleClickOutside),document.addEventListener(\"mousemove\",this.handleMouseMove),this.addEventListener(\"keydown\",this.handleKeyDown),document.addEventListener(\"keydown\",this.handleDocumentKeyDown)},0)}disconnectedCallback(){document.removeEventListener(\"click\",this.handleClickOutside),document.removeEventListener(\"keydown\",this.handleDocumentKeyDown),document.removeEventListener(\"mousemove\",this.handleMouseMove),this.removeEventListener(\"keydown\",this.handleKeyDown),super.disconnectedCallback()}render(){if(this.cardNetworks?.isLoading)return m`<primer-spinner size=\"small\" compact></primer-spinner>`;let e=this.getSelectableNetworks();if(!this.getDetectedNetwork()&&e.length===0)return m`<primer-icon name=\"payment-card\" size=\"sm\"></primer-icon>`;let r=this.getDetectedNetwork()||(e.length>0?e[0]:null);if(!r)return m`<primer-icon name=\"payment-card\" size=\"sm\"></primer-icon>`;let o=e.length>1;return m`<button ${ft(this.buttonRef)} class=\"network-selector\" @click=${this.toggleDropdown} @keydown=${n=>{(n.key===\" \"||n.key===\"Enter\")&&o&&(n.preventDefault(),this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&(this.focusedNetworkIndex=this.getSelectedNetworkIndex()))}} aria-label=${o?`Selected card network: ${r.displayName}. Click to change.`:`Card network: ${r.displayName}`} aria-expanded=${o?this.isDropdownOpen:g} aria-haspopup=${o?\"true\":g} aria-controls=${o?\"network-dropdown\":g} ><img class=\"network-icon\" src=${this.getNetworkIconUrl(r)} alt=${r.displayName} />${k(o,()=>m`<primer-icon class=\"caret ${this.isDropdownOpen?\"open\":\"\"}\" size=\"sm\" name=\"chevron-down\" ></primer-icon>`,()=>g)}</button>${k(this.isDropdownOpen,()=>m`<div ${ft(this.dropdownRef)} id=\"network-dropdown\" class=\"dropdown open\" role=\"listbox\" aria-label=\"Select card network\" >${e.map((n,a)=>m`<div ${ft(s=>this.setNetworkOptionRef(s,a))} class=\"network-option ${this.isKeyboardNavigation&&a===this.focusedNetworkIndex?\"focused\":\"\"}\" @click=${s=>this.selectNetwork(s,n)} @keydown=${s=>{(s.key===\"Enter\"||s.key===\" \")&&this.selectNetwork(s,n)}} role=\"option\" aria-selected=${n.network===r.network} tabindex=\"${a===this.focusedNetworkIndex?\"0\":\"-1\"}\" ><img class=\"network-option-icon\" src=${this.getNetworkIconUrl(n)} alt=${n.displayName} /><span class=\"network-name\">${n.displayName}</span>${k(n.network===r.network,()=>m`<primer-icon class=\"checkmark\" name=\"checkmark\" size=\"sm\" ></primer-icon>`,()=>g)}</div>`)}</div>`,()=>g)} `}}"
308
313
  },
309
314
  {
310
315
  "kind": "variable",
311
- "name": "vt",
312
- "default": "class extends v{constructor(){super(...arguments);this.vaultManager=null}render(){if(this.vaultManager?.isLoading)return h;let e=this.vaultManager?.showEmptyState&&this.vaultManager?.vaultedPaymentMethods.length;return!this.vaultManager||!this.vaultManager.enabled||!e?m`<slot name=\"other-payments\"></slot>`:m`<div class=\"other-payment-methods-container\"><primer-collapsable buttonVariant=\"secondary\" .expanded=\"${this.vaultManager?.vaultedPaymentMethods.length===0}\" .header=\"${C(\"navigateToPaymentMethods\",{id:\"navigateToPaymentMethods\"})}\" ><div class=\"other-payment-methods-content\"><slot name=\"other-payments\"></slot></div></primer-collapsable></div>`}}"
316
+ "name": "bt",
317
+ "default": "class extends v{constructor(){super(...arguments);this.vaultManager=null}render(){if(this.vaultManager?.isLoading)return g;let e=this.vaultManager?.showEmptyState&&this.vaultManager?.vaultedPaymentMethods.length;return!this.vaultManager||!this.vaultManager.enabled||!e?m`<slot name=\"other-payments\"></slot>`:m`<div class=\"other-payment-methods-container\"><primer-collapsable buttonVariant=\"secondary\" .expanded=\"${this.vaultManager?.vaultedPaymentMethods.length===0}\" .header=\"${E(\"navigateToPaymentMethods\",{id:\"navigateToPaymentMethods\"})}\" ><div class=\"other-payment-methods-content\"><slot name=\"other-payments\"></slot></div></primer-collapsable></div>`}}"
313
318
  },
314
319
  {
315
320
  "kind": "variable",
316
- "name": "jt",
321
+ "name": "Jt",
317
322
  "default": "class extends v{render(){return m`<primer-checkout-state type=\"complete\"></primer-checkout-state>`}}"
318
323
  },
319
324
  {
320
325
  "kind": "variable",
321
- "name": "Nt",
322
- "default": "class extends v{constructor(){super(...arguments);this.sdkState=null}render(){return m`<primer-checkout-state type=\"failure\" description=${this.sdkState?.error?.message||\"\"} ></primer-checkout-state>`}}"
326
+ "name": "Rt",
327
+ "default": "class extends v{constructor(){super(...arguments);this.sdkState=null}render(){return m`<primer-checkout-state type=\"failure\" description=${this.sdkState?.primerJsError?.message||\"\"} ></primer-checkout-state>`}}"
323
328
  },
324
329
  {
325
330
  "kind": "variable",
326
- "name": "it",
327
- "default": "class extends v{constructor(){super(...arguments);this.showProcessingErrors=!0}get shouldShowError(){return!this.sdkState||this.sdkState.isProcessing?!1:!!(this.sdkState.failure&&this.showProcessingErrors)}render(){return this.sdkState?m`<primer-error-message message=\"${C(this.sdkState.failure?.message??\"\",{id:\"tokenizationError\"})}\" ?visible=\"${this.shouldShowError}\" ></primer-error-message>`:h}}"
331
+ "name": "nt",
332
+ "default": "class extends v{constructor(){super(...arguments);this.showProcessingErrors=!0}get shouldShowError(){return!this.sdkState||this.sdkState.isProcessing?!1:!!(this.sdkState.paymentFailure&&this.showProcessingErrors)}render(){return this.sdkState?m`<primer-error-message message=\"${E(this.sdkState.paymentFailure?.message??\"\",{id:\"tokenizationError\"})}\" ?visible=\"${this.shouldShowError}\" ></primer-error-message>`:g}}"
328
333
  },
329
334
  {
330
335
  "kind": "variable",
331
- "name": "Ke",
332
- "default": "class extends v{constructor(){super(...arguments);this.hasAssignedContent=!1;this.onSlotChange=e=>{let o=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=o.length>0,this.requestUpdate()};this.paymentMethods=null;this.sdkState=null;this.clientOptions=null}render(){return this.sdkState?.isSuccessful?m`<slot name=\"checkout-complete\"><primer-checkout-complete></primer-checkout-complete></slot>`:m`<slot name=\"payments\" @slotchange=${this.onSlotChange}></slot>${k(this.hasAssignedContent,()=>h,()=>m`<div class=${re({\"primer-is-processing\":!!this.sdkState?.isProcessing})} ><primer-vault-manager></primer-vault-manager><primer-show-other-payments><div slot=\"other-payments\" class=\"primer-main-list\">${this.paymentMethods?.toArray().map(e=>m`<primer-payment-method type=${e.type} ?disabled=${this.clientOptions?.disabledPayments===!0} ></primer-payment-method>`)}</div></primer-show-other-payments><primer-error-message-container></primer-error-message-container></div>`)} `}}"
336
+ "name": "je",
337
+ "default": "class extends v{constructor(){super(...arguments);this.hasAssignedContent=!1;this.onSlotChange=e=>{let o=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=o.length>0,this.requestUpdate()};this.paymentMethods=null;this.sdkState=null;this.clientOptions=null}render(){return this.sdkState?.isSuccessful?m`<slot name=\"checkout-complete\"><primer-checkout-complete></primer-checkout-complete></slot>`:m`<slot name=\"payments\" @slotchange=${this.onSlotChange}></slot>${k(this.hasAssignedContent,()=>g,()=>m`<div class=${re({\"primer-is-processing\":!!this.sdkState?.isProcessing})} ><primer-vault-manager></primer-vault-manager><primer-show-other-payments><div slot=\"other-payments\" class=\"primer-main-list\">${this.paymentMethods?.toArray().map(e=>m`<primer-payment-method type=${e.type} ?disabled=${this.clientOptions?.disabledPayments===!0} ></primer-payment-method>`)}</div></primer-show-other-payments><primer-error-message-container></primer-error-message-container></div>`)} `}}"
333
338
  },
334
339
  {
335
340
  "kind": "function",
336
- "name": "mk"
341
+ "name": "ok"
337
342
  }
338
343
  ],
339
344
  "exports": [
@@ -357,7 +362,7 @@
357
362
  "kind": "js",
358
363
  "name": "AchPayment",
359
364
  "declaration": {
360
- "name": "Ce",
365
+ "name": "Se",
361
366
  "module": "dist/primer-loader.js"
362
367
  }
363
368
  },
@@ -365,7 +370,7 @@
365
370
  "kind": "js",
366
371
  "name": "ApplePay",
367
372
  "declaration": {
368
- "name": "Ye",
373
+ "name": "He",
369
374
  "module": "dist/primer-loader.js"
370
375
  }
371
376
  },
@@ -381,7 +386,7 @@
381
386
  "kind": "js",
382
387
  "name": "Blik",
383
388
  "declaration": {
384
- "name": "ge",
389
+ "name": "ve",
385
390
  "module": "dist/primer-loader.js"
386
391
  }
387
392
  },
@@ -389,7 +394,7 @@
389
394
  "kind": "js",
390
395
  "name": "Button",
391
396
  "declaration": {
392
- "name": "ue",
397
+ "name": "ge",
393
398
  "module": "dist/primer-loader.js"
394
399
  }
395
400
  },
@@ -397,7 +402,7 @@
397
402
  "kind": "js",
398
403
  "name": "CardForm",
399
404
  "declaration": {
400
- "name": "ee",
405
+ "name": "Q",
401
406
  "module": "dist/primer-loader.js"
402
407
  }
403
408
  },
@@ -405,7 +410,7 @@
405
410
  "kind": "js",
406
411
  "name": "CardFormCVV",
407
412
  "declaration": {
408
- "name": "et",
413
+ "name": "rt",
409
414
  "module": "dist/primer-loader.js"
410
415
  }
411
416
  },
@@ -413,7 +418,7 @@
413
418
  "kind": "js",
414
419
  "name": "CardFormCardNetworkSelector",
415
420
  "declaration": {
416
- "name": "de",
421
+ "name": "ce",
417
422
  "module": "dist/primer-loader.js"
418
423
  }
419
424
  },
@@ -421,7 +426,7 @@
421
426
  "kind": "js",
422
427
  "name": "CardFormCardNumber",
423
428
  "declaration": {
424
- "name": "Qe",
429
+ "name": "tt",
425
430
  "module": "dist/primer-loader.js"
426
431
  }
427
432
  },
@@ -429,7 +434,7 @@
429
434
  "kind": "js",
430
435
  "name": "CardFormError",
431
436
  "declaration": {
432
- "name": "Je",
437
+ "name": "Xe",
433
438
  "module": "dist/primer-loader.js"
434
439
  }
435
440
  },
@@ -437,7 +442,7 @@
437
442
  "kind": "js",
438
443
  "name": "CardFormExpiry",
439
444
  "declaration": {
440
- "name": "tt",
445
+ "name": "it",
441
446
  "module": "dist/primer-loader.js"
442
447
  }
443
448
  },
@@ -445,7 +450,7 @@
445
450
  "kind": "js",
446
451
  "name": "CardFormName",
447
452
  "declaration": {
448
- "name": "rt",
453
+ "name": "ot",
449
454
  "module": "dist/primer-loader.js"
450
455
  }
451
456
  },
@@ -461,7 +466,7 @@
461
466
  "kind": "js",
462
467
  "name": "Collapsable",
463
468
  "declaration": {
464
- "name": "fe",
469
+ "name": "ye",
465
470
  "module": "dist/primer-loader.js"
466
471
  }
467
472
  },
@@ -469,7 +474,7 @@
469
474
  "kind": "js",
470
475
  "name": "Dialog",
471
476
  "declaration": {
472
- "name": "Te",
477
+ "name": "Ne",
473
478
  "module": "dist/primer-loader.js"
474
479
  }
475
480
  },
@@ -477,7 +482,7 @@
477
482
  "kind": "js",
478
483
  "name": "DynamicPayment",
479
484
  "declaration": {
480
- "name": "Pe",
485
+ "name": "Ie",
481
486
  "module": "dist/primer-loader.js"
482
487
  }
483
488
  },
@@ -485,7 +490,7 @@
485
490
  "kind": "js",
486
491
  "name": "ErrorMessage",
487
492
  "declaration": {
488
- "name": "Ue",
493
+ "name": "Be",
489
494
  "module": "dist/primer-loader.js"
490
495
  }
491
496
  },
@@ -493,7 +498,7 @@
493
498
  "kind": "js",
494
499
  "name": "ErrorMessageContainer",
495
500
  "declaration": {
496
- "name": "it",
501
+ "name": "nt",
497
502
  "module": "dist/primer-loader.js"
498
503
  }
499
504
  },
@@ -501,7 +506,7 @@
501
506
  "kind": "js",
502
507
  "name": "GooglePay",
503
508
  "declaration": {
504
- "name": "Be",
509
+ "name": "Fe",
505
510
  "module": "dist/primer-loader.js"
506
511
  }
507
512
  },
@@ -509,7 +514,15 @@
509
514
  "kind": "js",
510
515
  "name": "InitializedPayments",
511
516
  "declaration": {
512
- "name": "Zr",
517
+ "name": "Xr",
518
+ "module": "dist/primer-loader.js"
519
+ }
520
+ },
521
+ {
522
+ "kind": "js",
523
+ "name": "InitializedVaultedPayments",
524
+ "declaration": {
525
+ "name": "Qr",
513
526
  "module": "dist/primer-loader.js"
514
527
  }
515
528
  },
@@ -525,7 +538,7 @@
525
538
  "kind": "js",
526
539
  "name": "InputLabel",
527
540
  "declaration": {
528
- "name": "qe",
541
+ "name": "Ze",
529
542
  "module": "dist/primer-loader.js"
530
543
  }
531
544
  },
@@ -533,7 +546,7 @@
533
546
  "kind": "js",
534
547
  "name": "InputWrapper",
535
548
  "declaration": {
536
- "name": "$e",
549
+ "name": "Ue",
537
550
  "module": "dist/primer-loader.js"
538
551
  }
539
552
  },
@@ -541,7 +554,7 @@
541
554
  "kind": "js",
542
555
  "name": "PayPal",
543
556
  "declaration": {
544
- "name": "He",
557
+ "name": "ze",
545
558
  "module": "dist/primer-loader.js"
546
559
  }
547
560
  },
@@ -549,7 +562,7 @@
549
562
  "kind": "js",
550
563
  "name": "PaymentMethod",
551
564
  "declaration": {
552
- "name": "Me",
565
+ "name": "Le",
553
566
  "module": "dist/primer-loader.js"
554
567
  }
555
568
  },
@@ -557,7 +570,7 @@
557
570
  "kind": "js",
558
571
  "name": "PaymentMethodContainer",
559
572
  "declaration": {
560
- "name": "_e",
573
+ "name": "we",
561
574
  "module": "dist/primer-loader.js"
562
575
  }
563
576
  },
@@ -565,7 +578,7 @@
565
578
  "kind": "js",
566
579
  "name": "PaymentMethodContentComponent",
567
580
  "declaration": {
568
- "name": "ze",
581
+ "name": "Ge",
569
582
  "module": "dist/primer-loader.js"
570
583
  }
571
584
  },
@@ -573,7 +586,7 @@
573
586
  "kind": "js",
574
587
  "name": "Portal",
575
588
  "declaration": {
576
- "name": "ut",
589
+ "name": "ht",
577
590
  "module": "dist/primer-loader.js"
578
591
  }
579
592
  },
@@ -581,7 +594,7 @@
581
594
  "kind": "js",
582
595
  "name": "PortalDialog",
583
596
  "declaration": {
584
- "name": "se",
597
+ "name": "le",
585
598
  "module": "dist/primer-loader.js"
586
599
  }
587
600
  },
@@ -589,7 +602,7 @@
589
602
  "kind": "js",
590
603
  "name": "PrimerCheckoutComplete",
591
604
  "declaration": {
592
- "name": "jt",
605
+ "name": "Jt",
593
606
  "module": "dist/primer-loader.js"
594
607
  }
595
608
  },
@@ -597,7 +610,7 @@
597
610
  "kind": "js",
598
611
  "name": "PrimerCheckoutComponent",
599
612
  "declaration": {
600
- "name": "be",
613
+ "name": "Ae",
601
614
  "module": "dist/primer-loader.js"
602
615
  }
603
616
  },
@@ -605,7 +618,7 @@
605
618
  "kind": "js",
606
619
  "name": "PrimerCheckoutFailure",
607
620
  "declaration": {
608
- "name": "Nt",
621
+ "name": "Rt",
609
622
  "module": "dist/primer-loader.js"
610
623
  }
611
624
  },
@@ -613,7 +626,7 @@
613
626
  "kind": "js",
614
627
  "name": "PrimerCheckoutState",
615
628
  "declaration": {
616
- "name": "Ze",
629
+ "name": "Qe",
617
630
  "module": "dist/primer-loader.js"
618
631
  }
619
632
  },
@@ -621,7 +634,7 @@
621
634
  "kind": "js",
622
635
  "name": "PrimerIcon",
623
636
  "declaration": {
624
- "name": "Ve",
637
+ "name": "Ye",
625
638
  "module": "dist/primer-loader.js"
626
639
  }
627
640
  },
@@ -637,7 +650,7 @@
637
650
  "kind": "js",
638
651
  "name": "PrimerMain",
639
652
  "declaration": {
640
- "name": "Ke",
653
+ "name": "je",
641
654
  "module": "dist/primer-loader.js"
642
655
  }
643
656
  },
@@ -645,7 +658,7 @@
645
658
  "kind": "js",
646
659
  "name": "RedirectPayment",
647
660
  "declaration": {
648
- "name": "we",
661
+ "name": "ke",
649
662
  "module": "dist/primer-loader.js"
650
663
  }
651
664
  },
@@ -653,7 +666,7 @@
653
666
  "kind": "js",
654
667
  "name": "Select",
655
668
  "declaration": {
656
- "name": "he",
669
+ "name": "fe",
657
670
  "module": "dist/primer-loader.js"
658
671
  }
659
672
  },
@@ -661,7 +674,7 @@
661
674
  "kind": "js",
662
675
  "name": "ShowOtherPayments",
663
676
  "declaration": {
664
- "name": "vt",
677
+ "name": "bt",
665
678
  "module": "dist/primer-loader.js"
666
679
  }
667
680
  },
@@ -669,7 +682,7 @@
669
682
  "kind": "js",
670
683
  "name": "Spinner",
671
684
  "declaration": {
672
- "name": "De",
685
+ "name": "Ve",
673
686
  "module": "dist/primer-loader.js"
674
687
  }
675
688
  },
@@ -677,7 +690,7 @@
677
690
  "kind": "js",
678
691
  "name": "VaultCvvInput",
679
692
  "declaration": {
680
- "name": "G",
693
+ "name": "j",
681
694
  "module": "dist/primer-loader.js"
682
695
  }
683
696
  },
@@ -685,7 +698,7 @@
685
698
  "kind": "js",
686
699
  "name": "VaultDeleteConfirmation",
687
700
  "declaration": {
688
- "name": "Ee",
701
+ "name": "Pe",
689
702
  "module": "dist/primer-loader.js"
690
703
  }
691
704
  },
@@ -693,7 +706,7 @@
693
706
  "kind": "js",
694
707
  "name": "VaultEmptyState",
695
708
  "declaration": {
696
- "name": "Xe",
709
+ "name": "et",
697
710
  "module": "dist/primer-loader.js"
698
711
  }
699
712
  },
@@ -701,7 +714,7 @@
701
714
  "kind": "js",
702
715
  "name": "VaultErrorMessage",
703
716
  "declaration": {
704
- "name": "Fe",
717
+ "name": "Ke",
705
718
  "module": "dist/primer-loader.js"
706
719
  }
707
720
  },
@@ -709,7 +722,7 @@
709
722
  "kind": "js",
710
723
  "name": "VaultManager",
711
724
  "declaration": {
712
- "name": "ae",
725
+ "name": "ne",
713
726
  "module": "dist/primer-loader.js"
714
727
  }
715
728
  },
@@ -717,7 +730,7 @@
717
730
  "kind": "js",
718
731
  "name": "VaultManagerHeader",
719
732
  "declaration": {
720
- "name": "ke",
733
+ "name": "Re",
721
734
  "module": "dist/primer-loader.js"
722
735
  }
723
736
  },
@@ -725,7 +738,7 @@
725
738
  "kind": "js",
726
739
  "name": "VaultPaymentMethodItem",
727
740
  "declaration": {
728
- "name": "ye",
741
+ "name": "be",
729
742
  "module": "dist/primer-loader.js"
730
743
  }
731
744
  },
@@ -733,7 +746,7 @@
733
746
  "kind": "js",
734
747
  "name": "VaultPaymentSubmit",
735
748
  "declaration": {
736
- "name": "Q",
749
+ "name": "X",
737
750
  "module": "dist/primer-loader.js"
738
751
  }
739
752
  },
@@ -741,7 +754,7 @@
741
754
  "kind": "js",
742
755
  "name": "injectDarkTheme",
743
756
  "declaration": {
744
- "name": "oc",
757
+ "name": "Yc",
745
758
  "module": "dist/primer-loader.js"
746
759
  }
747
760
  },
@@ -749,7 +762,7 @@
749
762
  "kind": "js",
750
763
  "name": "injectLightTheme",
751
764
  "declaration": {
752
- "name": "ic",
765
+ "name": "Uc",
753
766
  "module": "dist/primer-loader.js"
754
767
  }
755
768
  },
@@ -757,7 +770,7 @@
757
770
  "kind": "js",
758
771
  "name": "injectLoaderStyles",
759
772
  "declaration": {
760
- "name": "In",
773
+ "name": "Ga",
761
774
  "module": "dist/primer-loader.js"
762
775
  }
763
776
  },
@@ -765,7 +778,7 @@
765
778
  "kind": "js",
766
779
  "name": "injectThemeStyles",
767
780
  "declaration": {
768
- "name": "Nn",
781
+ "name": "ja",
769
782
  "module": "dist/primer-loader.js"
770
783
  }
771
784
  },
@@ -773,7 +786,7 @@
773
786
  "kind": "js",
774
787
  "name": "loadPrimer",
775
788
  "declaration": {
776
- "name": "mk",
789
+ "name": "ok",
777
790
  "module": "dist/primer-loader.js"
778
791
  }
779
792
  }
@@ -880,6 +893,46 @@
880
893
  "module": "./controllers/primer-js"
881
894
  }
882
895
  },
896
+ {
897
+ "kind": "js",
898
+ "name": "PrepareHandler",
899
+ "declaration": {
900
+ "name": "PrepareHandler",
901
+ "module": "./controllers/primer-js"
902
+ }
903
+ },
904
+ {
905
+ "kind": "js",
906
+ "name": "PaymentData",
907
+ "declaration": {
908
+ "name": "PaymentData",
909
+ "module": "./controllers/primer-js"
910
+ }
911
+ },
912
+ {
913
+ "kind": "js",
914
+ "name": "PaymentSuccessData",
915
+ "declaration": {
916
+ "name": "PaymentSuccessData",
917
+ "module": "./controllers/primer-js"
918
+ }
919
+ },
920
+ {
921
+ "kind": "js",
922
+ "name": "PaymentFailureData",
923
+ "declaration": {
924
+ "name": "PaymentFailureData",
925
+ "module": "./controllers/primer-js"
926
+ }
927
+ },
928
+ {
929
+ "kind": "js",
930
+ "name": "Payment",
931
+ "declaration": {
932
+ "name": "Payment",
933
+ "module": "./types/compatibility-types"
934
+ }
935
+ },
883
936
  {
884
937
  "kind": "js",
885
938
  "name": "PrimerCheckoutComponent",
@@ -888,6 +941,22 @@
888
941
  "module": "src/loader.ts"
889
942
  }
890
943
  },
944
+ {
945
+ "kind": "js",
946
+ "name": "SdkState",
947
+ "declaration": {
948
+ "name": "SdkState",
949
+ "module": "./contexts/sdk-state-context"
950
+ }
951
+ },
952
+ {
953
+ "kind": "js",
954
+ "name": "SdkStateContextType",
955
+ "declaration": {
956
+ "name": "SdkStateContextType",
957
+ "module": "./contexts/sdk-state-context"
958
+ }
959
+ },
891
960
  {
892
961
  "kind": "js",
893
962
  "name": "injectLoaderStyles",
@@ -946,6 +1015,14 @@
946
1015
  "text": "boolean"
947
1016
  }
948
1017
  },
1018
+ {
1019
+ "kind": "field",
1020
+ "name": "primerJS",
1021
+ "type": {
1022
+ "text": "PrimerJS | undefined"
1023
+ },
1024
+ "readonly": true
1025
+ },
949
1026
  {
950
1027
  "kind": "field",
951
1028
  "name": "customStyles",
@@ -1106,6 +1183,14 @@
1106
1183
  },
1107
1184
  "default": "new AchPaymentEventsController(this)"
1108
1185
  },
1186
+ {
1187
+ "kind": "field",
1188
+ "name": "headlessSdkController",
1189
+ "type": {
1190
+ "text": "HeadlessSdkController"
1191
+ },
1192
+ "default": "new HeadlessSdkController(this)"
1193
+ },
1109
1194
  {
1110
1195
  "kind": "method",
1111
1196
  "name": "handleExternalCardSubmit",
@@ -2029,102 +2114,6 @@
2029
2114
  }
2030
2115
  ]
2031
2116
  },
2032
- {
2033
- "kind": "javascript-module",
2034
- "path": "e2e/mocks/vaulting-card.ts",
2035
- "declarations": [
2036
- {
2037
- "kind": "variable",
2038
- "name": "settings",
2039
- "type": {
2040
- "text": "string"
2041
- },
2042
- "default": "'?settings=eyJjbGllbnRTZXNzaW9uQ29uZmlnIjp7ImN1c3RvbWVySWQiOiJjdXN0b21lcklkIiwib3JkZXJJZCI6IjM4NjYyIiwiYW1vdW50Ijo1MDAwLCJjdXJyZW5jeUNvZGUiOiJFVVIiLCJtZXRhZGF0YSI6e30sIm9yZGVyIjp7ImNvdW50cnlDb2RlIjoiRlIiLCJsaW5lSXRlbXMiOlt7Iml0ZW1JZCI6InByaW1lci1ob29kaWUtZ3JheSIsImRlc2NyaXB0aW9uIjoiUHJpbWVyIEhvb2RpZSIsImFtb3VudCI6NTAwMCwicXVhbnRpdHkiOjF9XX0sImN1c3RvbWVyIjp7ImJpbGxpbmdBZGRyZXNzIjp7ImNvdW50cnlDb2RlIjoiRlIifSwibmF0aW9uYWxEb2N1bWVudElkIjoiOTAxMTIxMTIzNDU2NyJ9LCJwYXltZW50TWV0aG9kIjp7InZhdWx0T25TdWNjZXNzIjp0cnVlLCJwYXltZW50VHlwZSI6IkZJUlNUX1BBWU1FTlQiLCJ2YXVsdE9uM0RTIjpmYWxzZSwib3B0aW9ucyI6eyJQQVlNRU5UX0NBUkQiOnsiY2FwdHVyZVZhdWx0ZWRDYXJkQ3Z2Ijp0cnVlfX0sIm9yZGVyZWRBbGxvd2VkQ2FyZE5ldHdvcmtzIjpbIlZJU0EiLCJNQVNURVJDQVJEIiwiQU1FWCIsIk1BRVNUUk8iLCJVTklPTlBBWSIsIkNBUlRFU19CQU5DQUlSRVMiLCJEQU5LT1JUIiwiRElORVJTX0NMVUIiLCJESVNDT1ZFUiIsIkVOUk9VVEUiLCJFTE8iLCJISVBFUiIsIklOVEVSQUMiLCJKQ0IiLCJNSVIiLCJPVEhFUiJdfX0sImNsaWVudE9wdGlvbnMiOnsiY2FyZCI6eyJwcmVmZXJyZWRGbG93IjoiRU1CRURERURfSU5fSE9NRSJ9LCJkaXJlY3REZWJpdCI6eyJjdXN0b21lckNvdW50cnlDb2RlIjoiRlIiLCJjb21wYW55TmFtZSI6IlByaW1lciBBUEkgTFREIiwiY29tcGFueUFkZHJlc3MiOiIxMjMgRmFrZSBTdCwgTG9uZG9uLCBFQzJBIDhYWSJ9LCJyZWRpcmVjdCI6eyJmb3JjZVJlZGlyZWN0IjpmYWxzZX0sImdvb2dsZVBheSI6eyJjYXB0dXJlQmlsbGluZ0FkZHJlc3MiOnRydWV9LCJwYXlwYWwiOnsicGF5bWVudEZsb3ciOiJQUkVGRVJfVkFVTFQifX0sImFwaUNvbmZpZyI6eyJhcGlLZXkiOiJmZTRkNzFiMi1mNzJmLTQ4NGItYjlkMS1hNDBkMDM0ZGRmNmMiLCJhcGlWZXJzaW9uIjoiMi4zIiwiZW52IjoiQ1VTVE9NX1NBTkRCT1gifSwiaGVhZGxlc3NPcHRpb25zIjp7InN0cmlwZSI6eyJwdWJsaXNoYWJsZUtleSI6InBrX3Rlc3RfNTFPOHpmUUtVSzZiWElkQzJ4UHZTUzZVdnJpRTlrd3B2dHR3QjdIOVBBemhOQVpvR3pMZ2lET3lkNFdvb296ZVdIeG9ScktvNmIyVmpaWXhOQ01YM1c3YmswMHJNRGl2amF1In0sInZhdWx0Ijp7ImVuYWJsZWQiOnRydWV9fSwibGl0Q29tcG9uZW50c09wdGlvbnMiOnsicGF5cGFsIjp7InBheW1lbnRGbG93IjoiUFJFRkVSX1ZBVUxUIn0sInZhdWx0Ijp7ImVuYWJsZWQiOnRydWV9LCJzZGtDb3JlIjpmYWxzZX19'"
2043
- },
2044
- {
2045
- "kind": "variable",
2046
- "name": "CONFIGURATION_RESPONSE",
2047
- "type": {
2048
- "text": "object"
2049
- },
2050
- "default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [], clientSession: { clientSessionId: '73195f20-be41-43ac-abad-d6fdf786c4cb', order: { orderId: '38662', currencyCode: 'EUR', countryCode: 'FR', totalOrderAmount: 5000, merchantAmount: 5000, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 5000, quantity: 1, }, ], }, customer: { customerId: 'customerId', billingAddress: { countryCode: 'FR', }, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: true, options: [ { type: 'PAYMENT_CARD', }, ], orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '6723b06a-37c5-4b93-87bf-9dadf4aa62f8', env: 'SANDBOX', paymentMethods: [ { id: '0b4775b8-4c43-4261-88ec-24d4f891912a', type: 'STRIPE_ACH', options: { merchantId: '7804d409-4caa-4fa8-8adb-ab34217d6c4e', merchantAccountId: '42dd7bba-3c06-5c50-b009-d1aafdd18a51', }, processorConfigId: '7804d409-4caa-4fa8-8adb-ab34217d6c4e', implementationType: 'NATIVE_SDK', name: 'Automated Clearing House (ACH)', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/BANK_TRANSFER/bank-transfer-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/BANK_TRANSFER/bank-transfer-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay with ACH', textColor: { dark: '#FFFFFF', light: '#000000', }, }, popup: { width: 1050, height: 1300, }, }, forceRedirect: false, implementation: {}, }, { id: 'f7e3b1d5-9922-4269-8d69-98a021c3c7ab', type: 'PRIMER_TEST_KLARNA', options: { merchantId: 'acct_primer-test_1', merchantAccountId: 'f49628b3-fc15-5e89-a710-1ad4a78a1b3b', }, processorConfigId: '7799d7a0-21b3-4778-bac4-de4bb302a702', implementationType: 'NATIVE_SDK', name: 'Klarna', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-light@3x.png', }, backgroundColor: { colored: '#FFB3C7', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { colored: '#FFB3C7', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: 'f43bbce8-2d0c-497e-b35c-7eeb647e0f9f', type: 'NOL_PAY', options: { merchantId: 'b89640a1-f1fd-47ca-857a-dac21d52f778', merchantAccountId: 'a3b4cecc-2305-54db-86f5-9670e237ed2d', appId: '1301', }, processorConfigId: 'b89640a1-f1fd-47ca-857a-dac21d52f778', implementationType: 'NATIVE_SDK', name: 'Nol Pay', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/NOL_PAY/nol-pay-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/NOL_PAY/nol-pay-logo@3x.png', light: 'https://assets.sandbox.core.primer.io/NOL_PAY/nol-pay-logo-light@3x.png', }, backgroundColor: { colored: '#171e90', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { colored: '#FFFFFF', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, captureVaultedCardCvv: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
2051
- },
2052
- {
2053
- "kind": "variable",
2054
- "name": "SUCCESSFUL_CARD_TO_VAULT",
2055
- "type": {
2056
- "text": "string"
2057
- },
2058
- "default": "'4000002500001001'"
2059
- },
2060
- {
2061
- "kind": "function",
2062
- "name": "mockPaymentInstruments",
2063
- "parameters": [
2064
- {
2065
- "name": "page",
2066
- "type": {
2067
- "text": "Page"
2068
- }
2069
- }
2070
- ]
2071
- },
2072
- {
2073
- "kind": "function",
2074
- "name": "mockPayments",
2075
- "parameters": [
2076
- {
2077
- "name": "page",
2078
- "type": {
2079
- "text": "Page"
2080
- }
2081
- }
2082
- ]
2083
- }
2084
- ],
2085
- "exports": [
2086
- {
2087
- "kind": "js",
2088
- "name": "settings",
2089
- "declaration": {
2090
- "name": "settings",
2091
- "module": "e2e/mocks/vaulting-card.ts"
2092
- }
2093
- },
2094
- {
2095
- "kind": "js",
2096
- "name": "CONFIGURATION_RESPONSE",
2097
- "declaration": {
2098
- "name": "CONFIGURATION_RESPONSE",
2099
- "module": "e2e/mocks/vaulting-card.ts"
2100
- }
2101
- },
2102
- {
2103
- "kind": "js",
2104
- "name": "SUCCESSFUL_CARD_TO_VAULT",
2105
- "declaration": {
2106
- "name": "SUCCESSFUL_CARD_TO_VAULT",
2107
- "module": "e2e/mocks/vaulting-card.ts"
2108
- }
2109
- },
2110
- {
2111
- "kind": "js",
2112
- "name": "mockPaymentInstruments",
2113
- "declaration": {
2114
- "name": "mockPaymentInstruments",
2115
- "module": "e2e/mocks/vaulting-card.ts"
2116
- }
2117
- },
2118
- {
2119
- "kind": "js",
2120
- "name": "mockPayments",
2121
- "declaration": {
2122
- "name": "mockPayments",
2123
- "module": "e2e/mocks/vaulting-card.ts"
2124
- }
2125
- }
2126
- ]
2127
- },
2128
2117
  {
2129
2118
  "kind": "javascript-module",
2130
2119
  "path": "e2e/tests/card-3ds.spec.ts",
@@ -2179,12 +2168,6 @@
2179
2168
  "declarations": [],
2180
2169
  "exports": []
2181
2170
  },
2182
- {
2183
- "kind": "javascript-module",
2184
- "path": "e2e/tests/vaulting-card.spec.ts",
2185
- "declarations": [],
2186
- "exports": []
2187
- },
2188
2171
  {
2189
2172
  "kind": "javascript-module",
2190
2173
  "path": "dist/chunks/ar.KRXB3WQO.js",
@@ -3979,6 +3962,62 @@
3979
3962
  }
3980
3963
  }
3981
3964
  ]
3965
+ },
3966
+ {
3967
+ "kind": "class",
3968
+ "description": "Wrapper class for vaulted payment methods that provides type-safe access\nto filtered vaulted payment method data.\n\nThis class mirrors the structure of InitializedPayments but for vault data,\nproviding a consistent API for merchants to access vaulted payment methods\nthrough events and callbacks.",
3969
+ "name": "InitializedVaultedPayments",
3970
+ "members": [
3971
+ {
3972
+ "kind": "field",
3973
+ "name": "_methods",
3974
+ "type": {
3975
+ "text": "VaultedPaymentMethodsMap"
3976
+ },
3977
+ "privacy": "private",
3978
+ "readonly": true,
3979
+ "default": "map"
3980
+ },
3981
+ {
3982
+ "kind": "method",
3983
+ "name": "get",
3984
+ "return": {
3985
+ "type": {
3986
+ "text": ""
3987
+ }
3988
+ },
3989
+ "parameters": [
3990
+ {
3991
+ "name": "id",
3992
+ "type": {
3993
+ "text": "string"
3994
+ },
3995
+ "description": "Payment method ID"
3996
+ }
3997
+ ],
3998
+ "description": "Get a vaulted payment method by its ID"
3999
+ },
4000
+ {
4001
+ "kind": "method",
4002
+ "name": "toArray",
4003
+ "return": {
4004
+ "type": {
4005
+ "text": ""
4006
+ }
4007
+ },
4008
+ "description": "Get all vaulted payment methods as an array"
4009
+ },
4010
+ {
4011
+ "kind": "method",
4012
+ "name": "size",
4013
+ "return": {
4014
+ "type": {
4015
+ "text": ""
4016
+ }
4017
+ },
4018
+ "description": "Get the count of vaulted payment methods"
4019
+ }
4020
+ ]
3982
4021
  }
3983
4022
  ],
3984
4023
  "exports": [
@@ -3989,6 +4028,14 @@
3989
4028
  "name": "InitializedPayments",
3990
4029
  "module": "src/contexts/payments-objects.ts"
3991
4030
  }
4031
+ },
4032
+ {
4033
+ "kind": "js",
4034
+ "name": "InitializedVaultedPayments",
4035
+ "declaration": {
4036
+ "name": "InitializedVaultedPayments",
4037
+ "module": "src/contexts/payments-objects.ts"
4038
+ }
3992
4039
  }
3993
4040
  ]
3994
4041
  },
@@ -4233,6 +4280,14 @@
4233
4280
  "text": "PaymentMethodInfo[]"
4234
4281
  }
4235
4282
  },
4283
+ {
4284
+ "kind": "field",
4285
+ "name": "primerJSInstance",
4286
+ "type": {
4287
+ "text": "PrimerJS | null"
4288
+ },
4289
+ "readonly": true
4290
+ },
4236
4291
  {
4237
4292
  "kind": "method",
4238
4293
  "name": "hostConnected",
@@ -4433,14 +4488,83 @@
4433
4488
  {
4434
4489
  "name": "paymentMethods",
4435
4490
  "type": {
4436
- "text": "InitializedPayments"
4491
+ "text": "InitializedPayments"
4492
+ }
4493
+ }
4494
+ ]
4495
+ },
4496
+ {
4497
+ "kind": "method",
4498
+ "name": "dispatchCheckoutInitialized",
4499
+ "return": {
4500
+ "type": {
4501
+ "text": "void"
4502
+ }
4503
+ },
4504
+ "parameters": [
4505
+ {
4506
+ "name": "checkoutInstance",
4507
+ "type": {
4508
+ "text": "PrimerJS"
4509
+ }
4510
+ }
4511
+ ]
4512
+ },
4513
+ {
4514
+ "kind": "method",
4515
+ "name": "dispatchCardNetworkChange",
4516
+ "return": {
4517
+ "type": {
4518
+ "text": "void"
4519
+ }
4520
+ },
4521
+ "parameters": [
4522
+ {
4523
+ "name": "network",
4524
+ "type": {
4525
+ "text": "CardNetworksContextType"
4526
+ }
4527
+ }
4528
+ ]
4529
+ },
4530
+ {
4531
+ "kind": "method",
4532
+ "name": "dispatchCardSubmit",
4533
+ "return": {
4534
+ "type": {
4535
+ "text": "void"
4536
+ }
4537
+ },
4538
+ "parameters": [
4539
+ {
4540
+ "name": "source",
4541
+ "optional": true,
4542
+ "type": {
4543
+ "text": "string"
4544
+ }
4545
+ }
4546
+ ]
4547
+ },
4548
+ {
4549
+ "kind": "method",
4550
+ "name": "dispatchFormSubmitSuccess",
4551
+ "return": {
4552
+ "type": {
4553
+ "text": "void"
4554
+ }
4555
+ },
4556
+ "parameters": [
4557
+ {
4558
+ "name": "result",
4559
+ "type": {
4560
+ "text": "CardSubmitResult"
4437
4561
  }
4438
4562
  }
4439
4563
  ]
4440
4564
  },
4441
4565
  {
4442
4566
  "kind": "method",
4443
- "name": "dispatchCheckoutInitialized",
4567
+ "name": "dispatchFormSubmitErrors",
4444
4568
  "return": {
4445
4569
  "type": {
4446
4570
  "text": "void"
@@ -4448,16 +4572,16 @@
4448
4572
  },
4449
4573
  "parameters": [
4450
4574
  {
4451
- "name": "checkoutInstance",
4575
+ "name": "errors",
4452
4576
  "type": {
4453
- "text": "PrimerJS"
4577
+ "text": "InputValidationError[]"
4454
4578
  }
4455
4579
  }
4456
4580
  ]
4457
4581
  },
4458
4582
  {
4459
4583
  "kind": "method",
4460
- "name": "dispatchCardNetworkChange",
4584
+ "name": "handleExternalCardSubmit",
4461
4585
  "return": {
4462
4586
  "type": {
4463
4587
  "text": "void"
@@ -4465,34 +4589,28 @@
4465
4589
  },
4466
4590
  "parameters": [
4467
4591
  {
4468
- "name": "network",
4592
+ "name": "eventDetails",
4469
4593
  "type": {
4470
- "text": "CardNetworksContextType"
4471
- }
4594
+ "text": "CardSubmitPayload"
4595
+ },
4596
+ "description": "The event details to forward, including source information"
4472
4597
  }
4473
- ]
4598
+ ],
4599
+ "description": "Handle external card submit events and forward them through the event system.\nThis method provides a centralized way to process external card submission events\nthat come from custom buttons or external triggers."
4474
4600
  },
4475
4601
  {
4476
4602
  "kind": "method",
4477
- "name": "dispatchCardSubmit",
4603
+ "name": "dispatchPaymentStart",
4478
4604
  "return": {
4479
4605
  "type": {
4480
4606
  "text": "void"
4481
4607
  }
4482
4608
  },
4483
- "parameters": [
4484
- {
4485
- "name": "source",
4486
- "optional": true,
4487
- "type": {
4488
- "text": "string"
4489
- }
4490
- }
4491
- ]
4609
+ "description": "Dispatch payment start event.\nCalled when payment flow begins."
4492
4610
  },
4493
4611
  {
4494
4612
  "kind": "method",
4495
- "name": "dispatchFormSubmitSuccess",
4613
+ "name": "dispatchPaymentSuccess",
4496
4614
  "return": {
4497
4615
  "type": {
4498
4616
  "text": "void"
@@ -4500,16 +4618,23 @@
4500
4618
  },
4501
4619
  "parameters": [
4502
4620
  {
4503
- "name": "result",
4621
+ "name": "payment",
4504
4622
  "type": {
4505
- "text": "CardSubmitResult"
4623
+ "text": "Payment"
4624
+ }
4625
+ },
4626
+ {
4627
+ "name": "paymentMethodType",
4628
+ "type": {
4629
+ "text": "string"
4506
4630
  }
4507
4631
  }
4508
- ]
4632
+ ],
4633
+ "description": "Dispatch payment success event with minimal payment summary.\nCalled when payment completes successfully."
4509
4634
  },
4510
4635
  {
4511
4636
  "kind": "method",
4512
- "name": "dispatchFormSubmitErrors",
4637
+ "name": "dispatchPaymentFailure",
4513
4638
  "return": {
4514
4639
  "type": {
4515
4640
  "text": "void"
@@ -4517,16 +4642,30 @@
4517
4642
  },
4518
4643
  "parameters": [
4519
4644
  {
4520
- "name": "errors",
4645
+ "name": "error",
4521
4646
  "type": {
4522
- "text": "InputValidationError[]"
4647
+ "text": "{\n code: string;\n message: string;\n diagnosticsId?: string;\n data?: Record<string, unknown>;\n }"
4648
+ }
4649
+ },
4650
+ {
4651
+ "name": "paymentMethodType",
4652
+ "type": {
4653
+ "text": "string"
4654
+ }
4655
+ },
4656
+ {
4657
+ "name": "payment",
4658
+ "optional": true,
4659
+ "type": {
4660
+ "text": "Payment"
4523
4661
  }
4524
4662
  }
4525
- ]
4663
+ ],
4664
+ "description": "Dispatch payment failure event.\nCalled when payment fails or is declined."
4526
4665
  },
4527
4666
  {
4528
4667
  "kind": "method",
4529
- "name": "handleExternalCardSubmit",
4668
+ "name": "dispatchVaultMethodsUpdate",
4530
4669
  "return": {
4531
4670
  "type": {
4532
4671
  "text": "void"
@@ -4534,14 +4673,14 @@
4534
4673
  },
4535
4674
  "parameters": [
4536
4675
  {
4537
- "name": "eventDetails",
4676
+ "name": "vaultedPayments",
4538
4677
  "type": {
4539
- "text": "CardSubmitPayload"
4678
+ "text": "InitializedVaultedPayments"
4540
4679
  },
4541
- "description": "The event details to forward, including source information"
4680
+ "description": "Wrapper containing filtered vaulted payment methods"
4542
4681
  }
4543
4682
  ],
4544
- "description": "Handle external card submit events and forward them through the event system.\nThis method provides a centralized way to process external card submission events\nthat come from custom buttons or external triggers."
4683
+ "description": "Dispatch vault methods update event.\nCalled when vaulted payment methods are loaded or updated."
4545
4684
  }
4546
4685
  ]
4547
4686
  }
@@ -4590,7 +4729,8 @@
4590
4729
  "type": {
4591
4730
  "text": "() => void | undefined"
4592
4731
  },
4593
- "privacy": "public"
4732
+ "privacy": "public",
4733
+ "description": "Called when payment flow begins.\nUse for analytics tracking or UI updates (e.g., disable form)."
4594
4734
  },
4595
4735
  {
4596
4736
  "kind": "field",
@@ -4598,15 +4738,63 @@
4598
4738
  "type": {
4599
4739
  "text": "(\n data: PaymentData,\n handler: PrepareHandler,\n ) => void | undefined"
4600
4740
  },
4601
- "privacy": "public"
4741
+ "privacy": "public",
4742
+ "description": "Called before payment creation for validation or abort control flow.\nUse for last-chance validation or conditional payment creation.",
4743
+ "parameters": [
4744
+ {
4745
+ "description": "Payment method information",
4746
+ "name": "data"
4747
+ },
4748
+ {
4749
+ "description": "Control flow handler (continue or abort)",
4750
+ "name": "handler"
4751
+ }
4752
+ ]
4753
+ },
4754
+ {
4755
+ "kind": "field",
4756
+ "name": "onPaymentSuccess",
4757
+ "type": {
4758
+ "text": "(data: PaymentSuccessData) => void | undefined"
4759
+ },
4760
+ "privacy": "public",
4761
+ "description": "Called when payment completes successfully.\nReceives minimal payment summary with reduced PII exposure.\n\nUse for:\n- Order confirmation and backend sync\n- Receipt generation\n- Payment processing with minimal PII exposure",
4762
+ "parameters": [
4763
+ {
4764
+ "description": "Payment success data with PaymentSummary (ID, orderId, last4, brand)",
4765
+ "name": "data"
4766
+ }
4767
+ ]
4768
+ },
4769
+ {
4770
+ "kind": "field",
4771
+ "name": "onPaymentFailure",
4772
+ "type": {
4773
+ "text": "(data: PaymentFailureData) => void | undefined"
4774
+ },
4775
+ "privacy": "public",
4776
+ "description": "Called when payment fails or is declined.\nReceives error details and optional payment summary if created before failure.\n\nUse for:\n- Error handling and user messaging\n- Support ticket creation with diagnosticsId\n- Retry logic for specific error types",
4777
+ "parameters": [
4778
+ {
4779
+ "description": "Payment failure data with error details and optional PaymentSummary",
4780
+ "name": "data"
4781
+ }
4782
+ ]
4602
4783
  },
4603
4784
  {
4604
4785
  "kind": "field",
4605
- "name": "onPaymentComplete",
4786
+ "name": "onVaultedMethodsUpdate",
4606
4787
  "type": {
4607
- "text": "(data: PaymentCompleteData) => void | undefined"
4788
+ "text": "(data: VaultedMethodsUpdateData) => void | undefined"
4608
4789
  },
4609
- "privacy": "public"
4790
+ "privacy": "public",
4791
+ "description": "Called when vaulted payment methods are loaded or updated.\nReceives filtered vaulted payment method data with minimal PII exposure.\n\nUse for:\n- Building custom vault UI\n- Analytics tracking for vault usage\n- Syncing vault state with backend",
4792
+ "parameters": [
4793
+ {
4794
+ "description": "Vault methods update data with filtered payment methods",
4795
+ "name": "data"
4796
+ }
4797
+ ]
4610
4798
  },
4611
4799
  {
4612
4800
  "kind": "method",
@@ -5038,10 +5226,7 @@
5038
5226
  {
5039
5227
  "kind": "variable",
5040
5228
  "name": "initialSDKState",
5041
- "type": {
5042
- "text": "SdkState"
5043
- },
5044
- "default": "{ isSuccessful: false, isProcessing: false, isLoading: false, error: null, failure: null, }"
5229
+ "default": "initialState"
5045
5230
  },
5046
5231
  {
5047
5232
  "kind": "class",
@@ -5050,72 +5235,160 @@
5050
5235
  "members": [
5051
5236
  {
5052
5237
  "kind": "method",
5053
- "name": "startLoading"
5054
- },
5055
- {
5056
- "kind": "method",
5057
- "name": "startProcessing"
5058
- },
5059
- {
5060
- "kind": "method",
5061
- "name": "stopProcessing"
5238
+ "name": "setLoading",
5239
+ "return": {
5240
+ "type": {
5241
+ "text": "void"
5242
+ }
5243
+ },
5244
+ "parameters": [
5245
+ {
5246
+ "name": "loading",
5247
+ "type": {
5248
+ "text": "boolean"
5249
+ }
5250
+ }
5251
+ ]
5062
5252
  },
5063
5253
  {
5064
5254
  "kind": "method",
5065
- "name": "completeProcessing"
5255
+ "name": "setProcessing",
5256
+ "return": {
5257
+ "type": {
5258
+ "text": "void"
5259
+ }
5260
+ },
5261
+ "parameters": [
5262
+ {
5263
+ "name": "processing",
5264
+ "type": {
5265
+ "text": "boolean"
5266
+ }
5267
+ }
5268
+ ]
5066
5269
  },
5067
5270
  {
5068
5271
  "kind": "method",
5069
- "name": "completeLoading"
5272
+ "name": "setSuccess",
5273
+ "return": {
5274
+ "type": {
5275
+ "text": "void"
5276
+ }
5277
+ },
5278
+ "parameters": [
5279
+ {
5280
+ "name": "success",
5281
+ "type": {
5282
+ "text": "boolean"
5283
+ }
5284
+ }
5285
+ ]
5070
5286
  },
5071
5287
  {
5072
5288
  "kind": "method",
5073
- "name": "setError",
5289
+ "name": "setPrimerJsError",
5290
+ "return": {
5291
+ "type": {
5292
+ "text": "void"
5293
+ }
5294
+ },
5074
5295
  "parameters": [
5075
5296
  {
5076
5297
  "name": "error",
5077
5298
  "type": {
5078
- "text": "Error"
5299
+ "text": "Error | null"
5079
5300
  }
5080
5301
  }
5081
5302
  ]
5082
5303
  },
5083
5304
  {
5084
5305
  "kind": "method",
5085
- "name": "setFailure",
5306
+ "name": "setPaymentFailure",
5307
+ "return": {
5308
+ "type": {
5309
+ "text": "void"
5310
+ }
5311
+ },
5086
5312
  "parameters": [
5087
5313
  {
5088
- "name": "code",
5089
- "type": {
5090
- "text": "string"
5091
- }
5092
- },
5093
- {
5094
- "name": "message",
5095
- "type": {
5096
- "text": "string"
5097
- }
5098
- },
5099
- {
5100
- "name": "details",
5101
- "optional": true,
5314
+ "name": "failure",
5102
5315
  "type": {
5103
- "text": "Record<string, unknown>"
5316
+ "text": "{\n code: string;\n message: string;\n diagnosticsId?: string | null;\n data?: Record<string, unknown>;\n } | null"
5104
5317
  }
5105
5318
  }
5106
5319
  ]
5107
5320
  },
5108
5321
  {
5109
5322
  "kind": "method",
5110
- "name": "reset"
5323
+ "name": "completeProcessing",
5324
+ "return": {
5325
+ "type": {
5326
+ "text": "void"
5327
+ }
5328
+ }
5329
+ },
5330
+ {
5331
+ "kind": "method",
5332
+ "name": "reset",
5333
+ "return": {
5334
+ "type": {
5335
+ "text": "void"
5336
+ }
5337
+ }
5338
+ },
5339
+ {
5340
+ "kind": "method",
5341
+ "name": "startLoading",
5342
+ "return": {
5343
+ "type": {
5344
+ "text": "void"
5345
+ }
5346
+ }
5347
+ },
5348
+ {
5349
+ "kind": "method",
5350
+ "name": "completeLoading",
5351
+ "return": {
5352
+ "type": {
5353
+ "text": "void"
5354
+ }
5355
+ }
5356
+ },
5357
+ {
5358
+ "kind": "method",
5359
+ "name": "startProcessing",
5360
+ "return": {
5361
+ "type": {
5362
+ "text": "void"
5363
+ }
5364
+ }
5365
+ },
5366
+ {
5367
+ "kind": "method",
5368
+ "name": "stopProcessing",
5369
+ "return": {
5370
+ "type": {
5371
+ "text": "void"
5372
+ }
5373
+ }
5111
5374
  },
5112
5375
  {
5113
5376
  "kind": "method",
5114
- "name": "resetError"
5377
+ "name": "resetError",
5378
+ "return": {
5379
+ "type": {
5380
+ "text": "void"
5381
+ }
5382
+ }
5115
5383
  },
5116
5384
  {
5117
5385
  "kind": "method",
5118
- "name": "forceCompleteLoading"
5386
+ "name": "forceCompleteLoading",
5387
+ "return": {
5388
+ "type": {
5389
+ "text": "void"
5390
+ }
5391
+ }
5119
5392
  },
5120
5393
  {
5121
5394
  "kind": "field",
@@ -5859,6 +6132,14 @@
5859
6132
  "name": "PrimerClientError",
5860
6133
  "module": "src/types/compatibility-types.ts"
5861
6134
  }
6135
+ },
6136
+ {
6137
+ "kind": "js",
6138
+ "name": "PaymentSummary",
6139
+ "declaration": {
6140
+ "name": "PaymentSummary",
6141
+ "package": "@primer-io/sdk-core"
6142
+ }
5862
6143
  }
5863
6144
  ]
5864
6145
  },
@@ -6251,6 +6532,14 @@
6251
6532
  "module": "./compatibility-types"
6252
6533
  }
6253
6534
  },
6535
+ {
6536
+ "kind": "js",
6537
+ "name": "PaymentSummary",
6538
+ "declaration": {
6539
+ "name": "PaymentSummary",
6540
+ "module": "./compatibility-types"
6541
+ }
6542
+ },
6254
6543
  {
6255
6544
  "kind": "js",
6256
6545
  "name": "PrimerJS",
@@ -13175,6 +13464,46 @@
13175
13464
  "module": "src/controllers/reactive-state/index.ts"
13176
13465
  }
13177
13466
  },
13467
+ {
13468
+ "kind": "method",
13469
+ "name": "createVaultedPaymentsWrapper",
13470
+ "privacy": "private",
13471
+ "return": {
13472
+ "type": {
13473
+ "text": ""
13474
+ }
13475
+ },
13476
+ "parameters": [
13477
+ {
13478
+ "name": "vaultedPaymentMethods",
13479
+ "type": {
13480
+ "text": "VaultedPaymentMethod[]"
13481
+ },
13482
+ "description": "Raw vaulted payment methods from API"
13483
+ }
13484
+ ],
13485
+ "description": "Transform raw vault data into filtered, event-ready format.\nApplies PII filtering to all vaulted payment methods."
13486
+ },
13487
+ {
13488
+ "kind": "method",
13489
+ "name": "updatePaymentMethodsWithEvents",
13490
+ "privacy": "private",
13491
+ "return": {
13492
+ "type": {
13493
+ "text": "void"
13494
+ }
13495
+ },
13496
+ "parameters": [
13497
+ {
13498
+ "name": "methods",
13499
+ "type": {
13500
+ "text": "VaultedPaymentMethod[]"
13501
+ },
13502
+ "description": "Raw vaulted payment methods from API"
13503
+ }
13504
+ ],
13505
+ "description": "Update vaulted payment methods and dispatch events/callbacks.\nThis method:\n1. Updates internal state via core controller\n2. Creates filtered wrapper for external APIs\n3. Dispatches event to listeners\n4. Invokes callback if defined"
13506
+ },
13178
13507
  {
13179
13508
  "kind": "method",
13180
13509
  "name": "fetchVaultedPaymentMethods",
@@ -14172,7 +14501,7 @@
14172
14501
  }
14173
14502
  }
14174
14503
  ],
14175
- "description": "Calculates the button height by reading the computed height from the element.\nThe CSS already calculates the correct height using CSS variables,\nso we just read the browser's computed value (which handles rem/em/% conversions)."
14504
+ "description": "Calculates the button height by reading the computed height from the element.\nThe CSS already calculates the correct height using CSS variables,\nso we just read the browser's computed value (which handles rem/em/% conversions).\n\nFor PayPal with height: auto, falls back to min-height if computed height is too small."
14176
14505
  },
14177
14506
  {
14178
14507
  "kind": "function",
@@ -17044,7 +17373,7 @@
17044
17373
  "kind": "field",
17045
17374
  "name": "renderButtonTask",
17046
17375
  "privacy": "private",
17047
- "default": "new Task(this, { args: () => [this.loadManagerTask.value], task: async ([manager]) => { if (!manager) { return initialState; } // Ensure the component's DOM is updated await this.updateComplete; const buttonContainer = this.buttonContainerRef.value; if (!buttonContainer) { throw new Error('Button container not found'); } const button = manager.createButton(); // Calculate button height from the container const buttonHeight = calculateButtonHeight(buttonContainer); // Apply PayPal SDK height constraints (25-55px) const constrainedHeight = getPayPalConstrainedHeight(buttonHeight); // Warn if height exceeds maximum const PAYPAL_MAX_HEIGHT = 55; if (buttonHeight > PAYPAL_MAX_HEIGHT) { PrimerJSLogger.warn( `PayPal button height (${buttonHeight}px) exceeds maximum allowed height of ${PAYPAL_MAX_HEIGHT}px. Button will be capped at ${PAYPAL_MAX_HEIGHT}px. This is a PayPal SDK limitation.`, ); } // Render to button container with constrained height await button.render(buttonContainer as Element, { style: { buttonHeight: constrainedHeight, }, }); // Apply current disabled state to newly created button if (this.disabled) { await button.setDisabled(this.disabled); } // Apply disabled overlay if needed if (this.disabled) { await this.updateComplete; updateOverlayForContainer(this.disabled, this.buttonContainerRef); } return button; }, })"
17376
+ "default": "new Task(this, { args: () => [this.loadManagerTask.value], task: async ([manager]) => { if (!manager) { return initialState; } // Ensure the component's DOM is updated await this.updateComplete; const buttonContainer = this.buttonContainerRef.value; if (!buttonContainer) { throw new Error('Button container not found'); } const button = manager.createButton(); // Calculate button height from the host element (where :host styles are applied) // The buttonContainer itself has no height, but the host element has min-height from CSS const buttonHeight = calculateButtonHeight( this as unknown as HTMLElement, ); // Apply PayPal SDK height constraints (25-55px) const constrainedHeight = getPayPalConstrainedHeight(buttonHeight); // Warn if height exceeds maximum const PAYPAL_MAX_HEIGHT = 55; if (buttonHeight > PAYPAL_MAX_HEIGHT) { PrimerJSLogger.warn( `PayPal button height (${buttonHeight}px) exceeds maximum allowed height of ${PAYPAL_MAX_HEIGHT}px. Button will be capped at ${PAYPAL_MAX_HEIGHT}px. This is a PayPal SDK limitation.`, ); } // Render to button container with constrained height await button.render(buttonContainer as Element, { style: { buttonHeight: constrainedHeight, }, }); // Apply current disabled state to newly created button if (this.disabled) { await button.setDisabled(this.disabled); } // Apply disabled overlay if needed if (this.disabled) { await this.updateComplete; updateOverlayForContainer(this.disabled, this.buttonContainerRef); } return button; }, })"
17048
17377
  }
17049
17378
  ],
17050
17379
  "attributes": [