@primer-io/primer-js 0.14.1 → 0.15.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.
@@ -49,12 +49,12 @@
49
49
  },
50
50
  {
51
51
  "kind": "variable",
52
- "name": "cr",
52
+ "name": "pr",
53
53
  "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}}"
54
54
  },
55
55
  {
56
56
  "kind": "variable",
57
- "name": "ur",
57
+ "name": "mr",
58
58
  "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}}"
59
59
  },
60
60
  {
@@ -65,28 +65,28 @@
65
65
  {
66
66
  "kind": "variable",
67
67
  "name": "Pe",
68
- "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=qt(vr());this.onSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=i.length>0,this.requestUpdate()};this.sdkContextController=new rr(this),this.sdkStateController=new ar(this),this.primerEventsController=new Wt(this),this.styleProcessingController=new ir(this),this.vaultManagerController=new ha(this),this.cardNetworkController=new _a(this),this.achPaymentEventsController=new _r(this),this.headlessSdkController=new xr(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}),document.addEventListener(\"primer:vault-submit\",this.handleExternalVaultSubmit.bind(this),{signal:this._eventListenerController.signal}),document.addEventListener(\"primer:show-other-payments-toggle\",this.handleExternalShowOtherPaymentsToggle.bind(this),{signal:this._eventListenerController.signal})}attributeChangedCallback(e,a,i){e===bp.CUSTOM_STYLES?this.styleProcessingController.processCustomStyles(i):super.attributeChangedCallback(e,a,i)}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&&(Ui(this.options?.locale)?this.locale=qt(this.options?.locale):P.warn(\"\\u{1F30E}\\u2757 Unsupported locale provided:\",this.options?.locale,\"- Falling back to system locale\")),Ki(this.locale))}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)}handleExternalVaultSubmit(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:vault-submit\",e.detail)}handleExternalShowOtherPaymentsToggle(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:show-other-payments-toggle\",e.detail)}checkLoadingStateChange(){let e=this.sdkStateController?.currentState.isLoading||!1;if(this.previousLoadingState&&!e){this.jsInitialized=!0,Q({eventName:\"CHECKOUT_FLOW_STARTED\"});let a=Ye.getSdkInitStartTime(),i=a?Date.now()-a:void 0;To(i)}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,a=e.isLoading,i=e.primerJsError,n=!a&&!i;return p` ${R(a,()=>y)} ${R(i,()=>p`<primer-checkout-error></primer-checkout-error>`)} ${R(n,()=>p`<slot name=\"main\" @slotchange=${this.onSlotChange}></slot>${R(this.hasAssignedContent,()=>y,()=>p`<primer-main></primer-main>`)} `,()=>y)} `}addEventListener(e,a,i){super.addEventListener(e,a,i)}removeEventListener(e,a,i){super.removeEventListener(e,a,i)}}"
68
+ "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=qt(br());this.onSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=i.length>0,this.requestUpdate()};this.sdkContextController=new nr(this),this.sdkStateController=new ir(this),this.primerEventsController=new Wt(this),this.styleProcessingController=new or(this),this.vaultManagerController=new ga(this),this.cardNetworkController=new wa(this),this.achPaymentEventsController=new Dr(this),this.headlessSdkController=new wr(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}),document.addEventListener(\"primer:vault-submit\",this.handleExternalVaultSubmit.bind(this),{signal:this._eventListenerController.signal}),document.addEventListener(\"primer:show-other-payments-toggle\",this.handleExternalShowOtherPaymentsToggle.bind(this),{signal:this._eventListenerController.signal})}attributeChangedCallback(e,a,i){e===Mp.CUSTOM_STYLES?this.styleProcessingController.processCustomStyles(i):super.attributeChangedCallback(e,a,i)}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&&(Vi(this.options?.locale)?this.locale=qt(this.options?.locale):P.warn(\"\\u{1F30E}\\u2757 Unsupported locale provided:\",this.options?.locale,\"- Falling back to system locale\")),Fi(this.locale))}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)}handleExternalVaultSubmit(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:vault-submit\",e.detail)}handleExternalShowOtherPaymentsToggle(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:show-other-payments-toggle\",e.detail)}checkLoadingStateChange(){let e=this.sdkStateController?.currentState.isLoading||!1;if(this.previousLoadingState&&!e){this.jsInitialized=!0,Q({eventName:\"CHECKOUT_FLOW_STARTED\"});let a=Ye.getSdkInitStartTime(),i=a?Date.now()-a:void 0;Po(i)}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,a=e.isLoading,i=e.primerJsError,n=!a&&!i;return p` ${R(a,()=>y)} ${R(i,()=>p`<primer-checkout-error></primer-checkout-error>`)} ${R(n,()=>p`<slot name=\"main\" @slotchange=${this.onSlotChange}></slot>${R(this.hasAssignedContent,()=>y,()=>p`<primer-main></primer-main>`)} `,()=>y)} `}addEventListener(e,a,i){super.addEventListener(e,a,i)}removeEventListener(e,a,i){super.removeEventListener(e,a,i)}}"
69
69
  },
70
70
  {
71
71
  "kind": "function",
72
- "name": "Ts"
72
+ "name": "Ps"
73
73
  },
74
74
  {
75
75
  "kind": "function",
76
- "name": "Ps"
76
+ "name": "Is"
77
77
  },
78
78
  {
79
79
  "kind": "function",
80
- "name": "Tp"
80
+ "name": "Np"
81
81
  },
82
82
  {
83
83
  "kind": "function",
84
- "name": "Pp"
84
+ "name": "kp"
85
85
  },
86
86
  {
87
87
  "kind": "variable",
88
88
  "name": "ze",
89
- "default": "class extends v{constructor(){super(...arguments);this.color=\"var(--primer-color-loader)\";this.size=\"medium\";this.compact=!1}getSize(){if(this.size in Xi)return Xi[this.size];let e=parseInt(this.size,10);return isNaN(e)?Xi.medium:e}render(){let e=this.getSize(),a=20,i=`0 0 ${a} ${a}`;return this.style.setProperty(\"--spinner-color\",this.color),this.style.setProperty(\"--spinner-size\",`${e}px`),p`<div class=\"spinner-container ${this.compact?\"compact\":\"\"}\"><svg class=\"spinner\" width=\"${e}\" height=\"${e}\" viewBox=\"${i}\" 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>`}}"
89
+ "default": "class extends v{constructor(){super(...arguments);this.color=\"var(--primer-color-loader)\";this.size=\"medium\";this.compact=!1}getSize(){if(this.size in en)return en[this.size];let e=parseInt(this.size,10);return isNaN(e)?en.medium:e}render(){let e=this.getSize(),a=20,i=`0 0 ${a} ${a}`;return this.style.setProperty(\"--spinner-color\",this.color),this.style.setProperty(\"--spinner-size\",`${e}px`),p`<div class=\"spinner-container ${this.compact?\"compact\":\"\"}\"><svg class=\"spinner\" width=\"${e}\" height=\"${e}\" viewBox=\"${i}\" 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>`}}"
90
90
  },
91
91
  {
92
92
  "kind": "variable",
@@ -111,7 +111,7 @@
111
111
  {
112
112
  "kind": "variable",
113
113
  "name": "je",
114
- "default": "class extends v{constructor(){super(...arguments);this.color=\"var(--primer-color-icon-primary)\";this.size=\"lg\"}render(){let e=this.name?xs[this.name]:null;return p`<div style=\"--internal-icon-color: ${this.color}\">${e||p`<slot></slot>`}</div>`}}"
114
+ "default": "class extends v{constructor(){super(...arguments);this.color=\"var(--primer-color-icon-primary)\";this.size=\"lg\"}render(){let e=this.name?_s[this.name]:null;return p`<div style=\"--internal-icon-color: ${this.color}\">${e||p`<slot></slot>`}</div>`}}"
115
115
  },
116
116
  {
117
117
  "kind": "variable",
@@ -126,7 +126,7 @@
126
126
  {
127
127
  "kind": "variable",
128
128
  "name": "Ae",
129
- "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 a=e.target,i=this.value;this.value=a.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\",i)}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 a of this.options)e.push(p`<option value=${a.value}>${a.label}</option>`);return e}render(){return p`<select id=${this.id} name=${this.name} .value=${Bs(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>`}}"
129
+ "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 a=e.target,i=this.value;this.value=a.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\",i)}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 a of this.options)e.push(p`<option value=${a.value}>${a.label}</option>`);return e}render(){return p`<select id=${this.id} name=${this.name} .value=${Gs(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>`}}"
130
130
  },
131
131
  {
132
132
  "kind": "variable",
@@ -151,32 +151,32 @@
151
151
  {
152
152
  "kind": "variable",
153
153
  "name": "se",
154
- "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=b(\"pay_with\",{id:\"pay_with\"});this._paymentMethodManagerTask=new B(this,{task:async([e,a])=>{if(!e||!a)return w;let i=await a.getCDNAssets(\"KLARNA\");return{manager:e.manager,klarnaIcon:i?.assets?.icon?`${i.goatCdnUrl}/${i.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?p`<div class=\"loading\"><primer-spinner size=\"small\"></primer-spinner></div>`:p`<div class=\"category-selection\">${e.map(i=>p`<button class=${oe({\"category-button\":!0,selected:i.id===this.selectedCategory})} @click=${()=>{this.selectCategory(i.id)}} ?disabled=${this.disabled} >${i.name}</button>`)}</div>`}renderExpandedContent(){return p` ${this.renderCategorySelection()} ${this.selectedCategory?p`<div id=\"klarna-category-container\" class=\"klarna-category-container\" ></div>`:y}<button class=${oe({\"klarna-pay-button\":!0,loading:!!this.sdkState?.isProcessing,disabled:!this.selectedCategory||this.disabled})} ?disabled=${!this.selectedCategory||this.sdkState?.isProcessing||this.disabled} @click=${()=>this.startKlarnaPayment()} >${b(\"confirm\",{id:\"confirm\"})}</button>`}render(){return this._paymentMethodManagerTask.render({error:e=>{let a=e instanceof Error?e.message:\"Unknown error in Klarna\";return p`<div class=\"error\"> Error loading Klarna: ${a}</div>`},complete:({manager:e,klarnaIcon:a})=>e?p`<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=${a} alt=\"Klarna logo\" /><span>${b(\"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>`:y})}}"
154
+ "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=b(\"pay_with\",{id:\"pay_with\"});this._paymentMethodManagerTask=new O(this,{task:async([e,a])=>{if(!e||!a)return w;let i=await a.getCDNAssets(\"KLARNA\");return{manager:e.manager,klarnaIcon:i?.assets?.icon?`${i.goatCdnUrl}/${i.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?p`<div class=\"loading\"><primer-spinner size=\"small\"></primer-spinner></div>`:p`<div class=\"category-selection\">${e.map(i=>p`<button class=${oe({\"category-button\":!0,selected:i.id===this.selectedCategory})} @click=${()=>{this.selectCategory(i.id)}} ?disabled=${this.disabled} >${i.name}</button>`)}</div>`}renderExpandedContent(){return p` ${this.renderCategorySelection()} ${this.selectedCategory?p`<div id=\"klarna-category-container\" class=\"klarna-category-container\" ></div>`:y}<button class=${oe({\"klarna-pay-button\":!0,loading:!!this.sdkState?.isProcessing,disabled:!this.selectedCategory||this.disabled})} ?disabled=${!this.selectedCategory||this.sdkState?.isProcessing||this.disabled} @click=${()=>this.startKlarnaPayment()} >${b(\"confirm\",{id:\"confirm\"})}</button>`}render(){return this._paymentMethodManagerTask.render({error:e=>{let a=e instanceof Error?e.message:\"Unknown error in Klarna\";return p`<div class=\"error\"> Error loading Klarna: ${a}</div>`},complete:({manager:e,klarnaIcon:a})=>e?p`<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=${a} alt=\"Klarna logo\" /><span>${b(\"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>`:y})}}"
155
155
  },
156
156
  {
157
157
  "kind": "variable",
158
158
  "name": "Ze",
159
- "default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.loadManagerTask=new B(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return w;let a=this.paymentManagers.get(e);if(!a)throw new Error(`No manager found for payment method type ${e}`);if(a.type!==\"GOOGLE_PAY\")throw new Error(\"Invalid payment method type for Google Pay component\");return a.manager}}),this.renderButtonTask=new B(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return w;await this.updateComplete;let a=e.createButton();return await a.render(this.shadowRoot?.getRootNode(),{style:{shadowRoot:!0}}),this.disabled&&await a.setDisabled(this.disabled),this.disabled&&this.shadowRoot&&(await this.updateComplete,Dr(this.disabled,this.shadowRoot)),a}})}attributeChangedCallback(e,a,i){if(super.attributeChangedCallback(e,a,i),e===\"disabled\"&&a!==i){let n=i!==null,o=this.renderButtonTask.value;o&&o.setDisabled(n)}}updated(e){e.has(\"disabled\")&&this.shadowRoot&&Dr(this.disabled,this.shadowRoot)}render(){return y}}"
159
+ "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 w;let a=this.paymentManagers.get(e);if(!a)throw new Error(`No manager found for payment method type ${e}`);if(a.type!==\"GOOGLE_PAY\")throw new Error(\"Invalid payment method type for Google Pay component\");return a.manager}}),this.renderButtonTask=new O(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return w;await this.updateComplete;let a=e.createButton();return await a.render(this.shadowRoot?.getRootNode(),{style:{shadowRoot:!0}}),this.disabled&&await a.setDisabled(this.disabled),this.disabled&&this.shadowRoot&&(await this.updateComplete,Or(this.disabled,this.shadowRoot)),a}})}attributeChangedCallback(e,a,i){if(super.attributeChangedCallback(e,a,i),e===\"disabled\"&&a!==i){let n=i!==null,o=this.renderButtonTask.value;o&&o.setDisabled(n)}}updated(e){e.has(\"disabled\")&&this.shadowRoot&&Or(this.disabled,this.shadowRoot)}render(){return y}}"
160
160
  },
161
161
  {
162
162
  "kind": "variable",
163
163
  "name": "Je",
164
- "default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.buttonContainerRef=Kt();this.loadManagerTask=new B(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return w;let a=this.paymentManagers.get(e);if(!a)throw new Error(`No manager found for payment method type ${e}`);if(a.type!==\"APPLE_PAY\")throw new Error(\"Invalid payment method type for Apple Pay component\");return a.manager}}),this.renderButtonTask=new B(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return w;await this.updateComplete;let a=this.buttonContainerRef.value;if(!a)throw new Error(\"Button container not found\");let i=e.createButton(),n=Br(a);return await i.render(a,{style:{buttonHeight:n}}),this.disabled&&await i.setDisabled(this.disabled),this.disabled&&(await this.updateComplete,ta(this.disabled,this.buttonContainerRef)),i}})}attributeChangedCallback(e,a,i){if(super.attributeChangedCallback(e,a,i),e===\"disabled\"&&a!==i){let n=i!==null,o=this.renderButtonTask.value;o&&o.setDisabled(n)}}updated(e){e.has(\"disabled\")&&ta(this.disabled,this.buttonContainerRef)}render(){return p`<div class=\"native-button-container\" ${Et(this.buttonContainerRef)} ></div>`}}"
164
+ "default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.buttonContainerRef=Kt();this.loadManagerTask=new O(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return w;let a=this.paymentManagers.get(e);if(!a)throw new Error(`No manager found for payment method type ${e}`);if(a.type!==\"APPLE_PAY\")throw new Error(\"Invalid payment method type for Apple Pay component\");return a.manager}}),this.renderButtonTask=new O(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return w;await this.updateComplete;let a=this.buttonContainerRef.value;if(!a)throw new Error(\"Button container not found\");let i=e.createButton(),n=Kr(a);return await i.render(a,{style:{buttonHeight:n}}),this.disabled&&await i.setDisabled(this.disabled),this.disabled&&(await this.updateComplete,ta(this.disabled,this.buttonContainerRef)),i}})}attributeChangedCallback(e,a,i){if(super.attributeChangedCallback(e,a,i),e===\"disabled\"&&a!==i){let n=i!==null,o=this.renderButtonTask.value;o&&o.setDisabled(n)}}updated(e){e.has(\"disabled\")&&ta(this.disabled,this.buttonContainerRef)}render(){return p`<div class=\"native-button-container\" ${Et(this.buttonContainerRef)} ></div>`}}"
165
165
  },
166
166
  {
167
167
  "kind": "variable",
168
168
  "name": "qe",
169
- "default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.buttonContainerRef=Kt();this.loadManagerTask=new B(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return w;let a=this.paymentManagers.get(e);if(!a)throw new Error(`No manager found for payment method type ${e}`);if(a.type!==\"PAYPAL\")throw new Error(\"Invalid payment method type for PayPal component\");return a.manager}}),this.renderButtonTask=new B(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return w;await this.updateComplete;let a=this.buttonContainerRef.value;if(!a)throw new Error(\"Button container not found\");let i=e.createButton(),n=Zs(Br(this));return await i.render(a,{style:{buttonHeight:n}}),this.disabled&&await i.setDisabled(this.disabled),this.disabled&&(await this.updateComplete,ta(this.disabled,this.buttonContainerRef)),i}})}attributeChangedCallback(e,a,i){if(super.attributeChangedCallback(e,a,i),e===\"disabled\"&&a!==i){let n=i!==null,o=this.renderButtonTask.value;o&&o.setDisabled(n)}}updated(e){e.has(\"disabled\")&&ta(this.disabled,this.buttonContainerRef)}render(){return p`<div class=\"native-button-container\" ${Et(this.buttonContainerRef)} ></div>`}}"
169
+ "default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.buttonContainerRef=Kt();this.loadManagerTask=new O(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return w;let a=this.paymentManagers.get(e);if(!a)throw new Error(`No manager found for payment method type ${e}`);if(a.type!==\"PAYPAL\")throw new Error(\"Invalid payment method type for PayPal component\");return a.manager}}),this.renderButtonTask=new O(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return w;await this.updateComplete;let a=this.buttonContainerRef.value;if(!a)throw new Error(\"Button container not found\");let i=e.createButton(),n=Js(Kr(this));return await i.render(a,{style:{buttonHeight:n}}),this.disabled&&await i.setDisabled(this.disabled),this.disabled&&(await this.updateComplete,ta(this.disabled,this.buttonContainerRef)),i}})}attributeChangedCallback(e,a,i){if(super.attributeChangedCallback(e,a,i),e===\"disabled\"&&a!==i){let n=i!==null,o=this.renderButtonTask.value;o&&o.setDisabled(n)}}updated(e){e.has(\"disabled\")&&ta(this.disabled,this.buttonContainerRef)}render(){return p`<div class=\"native-button-container\" ${Et(this.buttonContainerRef)} ></div>`}}"
170
170
  },
171
171
  {
172
172
  "kind": "variable",
173
173
  "name": "Me",
174
- "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 B(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return w;let a=this.paymentManagers.get(e);if(!a)throw new Error(\"BLIK payment method manager not initialized\");if(a.type!==\"ADYEN_BLIK\")throw new Error(\"Invalid payment method type for BLIK component\");return a.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=b(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",P.error(\"Payment method type not available\");return}let a=this.paymentManagers.get(e);if(!a||a.type!==\"ADYEN_BLIK\"){this.errorMessage=b(\"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 a=e.target,i=a.value,o=i.replace(/\\D/g,\"\").slice(0,6);i!==o&&(a.value=o),this.blikCode=o,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\"),o.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=b(\"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(a){this.stopPollingTimer(),this.currentState=\"error\",this.errorMessage=a instanceof Error?a.message:b(\"tokenizationError\",{id:\"tokenizationError\"}),P.errorWithDatadog(\"BLIK payment failed\",{error:a instanceof Error?{message:a.message,name:a.name}:\"Unknown error\"})}}renderCollapsed(){return p`<primer-button class=\"blik-button\" @click=${this.handleButtonClick} ?disabled=${this.disabled} aria-label=\"${b(\"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 p`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-input-wrapper\"><label for=\"blik-code\" class=\"blik-label\">${b(\"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=\"${b(\"sixDigitCodeLabel\",{id:\"sixDigitCodeLabel\"})}\" autocomplete=\"off\" spellcheck=\"false\" /></div></div></div>`}renderLoading(){return p`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-loading\"><primer-spinner size=\"medium\"></primer-spinner>${this.pollingDuration>30?p`<div class=\"blik-timeout-warning\"> This is taking longer than expected... </div>`:y}</div></div></div>`}renderError(){return p`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-error\"><div class=\"blik-error-message\" role=\"alert\">${this.errorMessage||b(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"blik-retry-button\" @click=\"${this.handleRetry}\" ?disabled=\"${this.disabled}\" >${b(\"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 y}}disconnectedCallback(){super.disconnectedCallback(),this.stopPollingTimer()}render(){return p`<div class=\"blik-container ${this.currentState!==\"collapsed\"?\"expanded\":\"\"}\" >${this.renderCollapsed()} ${this.currentState!==\"collapsed\"?this.renderExpandedState():y}</div>`}}"
174
+ "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 w;let a=this.paymentManagers.get(e);if(!a)throw new Error(\"BLIK payment method manager not initialized\");if(a.type!==\"ADYEN_BLIK\")throw new Error(\"Invalid payment method type for BLIK component\");return a.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=b(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",P.error(\"Payment method type not available\");return}let a=this.paymentManagers.get(e);if(!a||a.type!==\"ADYEN_BLIK\"){this.errorMessage=b(\"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 a=e.target,i=a.value,o=i.replace(/\\D/g,\"\").slice(0,6);i!==o&&(a.value=o),this.blikCode=o,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\"),o.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=b(\"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(a){this.stopPollingTimer(),this.currentState=\"error\",this.errorMessage=a instanceof Error?a.message:b(\"tokenizationError\",{id:\"tokenizationError\"}),P.errorWithDatadog(\"BLIK payment failed\",{error:a instanceof Error?{message:a.message,name:a.name}:\"Unknown error\"})}}renderCollapsed(){return p`<primer-button class=\"blik-button\" @click=${this.handleButtonClick} ?disabled=${this.disabled} aria-label=\"${b(\"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 p`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-input-wrapper\"><label for=\"blik-code\" class=\"blik-label\">${b(\"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=\"${b(\"sixDigitCodeLabel\",{id:\"sixDigitCodeLabel\"})}\" autocomplete=\"off\" spellcheck=\"false\" /></div></div></div>`}renderLoading(){return p`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-loading\"><primer-spinner size=\"medium\"></primer-spinner>${this.pollingDuration>30?p`<div class=\"blik-timeout-warning\"> This is taking longer than expected... </div>`:y}</div></div></div>`}renderError(){return p`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-error\"><div class=\"blik-error-message\" role=\"alert\">${this.errorMessage||b(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"blik-retry-button\" @click=\"${this.handleRetry}\" ?disabled=\"${this.disabled}\" >${b(\"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 y}}disconnectedCallback(){super.disconnectedCallback(),this.stopPollingTimer()}render(){return p`<div class=\"blik-container ${this.currentState!==\"collapsed\"?\"expanded\":\"\"}\" >${this.renderCollapsed()} ${this.currentState!==\"collapsed\"?this.renderExpandedState():y}</div>`}}"
175
175
  },
176
176
  {
177
177
  "kind": "variable",
178
178
  "name": "Fe",
179
- "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 y;let e=this.paymentMethods?.get(this.type);if(!e)return y;let a;switch(e?.managerType){case\"CARD\":a=p`<primer-card-form ?disabled=${this.disabled} ></primer-card-form>`;break;case\"NATIVE\":{let i=e.type;i===Na.GOOGLE_PAY?a=p`<primer-google-pay .paymentMethod=${e} ?disabled=${this.disabled} ></primer-google-pay>`:i===Na.APPLE_PAY?a=p`<primer-apple-pay .paymentMethod=${e} ?disabled=${this.disabled} ></primer-apple-pay>`:i===Na.PAYPAL?a=p`<primer-paypal .paymentMethod=${e} ?disabled=${this.disabled} ></primer-paypal>`:i===Na.ADYEN_BLIK&&(a=p`<primer-blik .paymentMethod=${e} ?disabled=${this.disabled} ></primer-blik>`);break}case\"REDIRECT\":a=p`<primer-redirect-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-redirect-payment>`;break;case\"KLARNA\":a=p`<primer-klarna ?disabled=${this.disabled} ></primer-klarna>`;break;case\"ACH\":a=p`<primer-dynamic-payment .paymentMethod=${e} ></primer-dynamic-payment>`;break;default:return y}return p`<div @click=${this.handleClick}>${a}</div>`}}"
179
+ "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 y;let e=this.paymentMethods?.get(this.type);if(!e)return y;let a;switch(e?.managerType){case\"CARD\":a=p`<primer-card-form ?disabled=${this.disabled} ></primer-card-form>`;break;case\"NATIVE\":{let i=e.type;i===ka.GOOGLE_PAY?a=p`<primer-google-pay .paymentMethod=${e} ?disabled=${this.disabled} ></primer-google-pay>`:i===ka.APPLE_PAY?a=p`<primer-apple-pay .paymentMethod=${e} ?disabled=${this.disabled} ></primer-apple-pay>`:i===ka.PAYPAL?a=p`<primer-paypal .paymentMethod=${e} ?disabled=${this.disabled} ></primer-paypal>`:i===ka.ADYEN_BLIK&&(a=p`<primer-blik .paymentMethod=${e} ?disabled=${this.disabled} ></primer-blik>`);break}case\"REDIRECT\":a=p`<primer-redirect-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-redirect-payment>`;break;case\"KLARNA\":a=p`<primer-klarna ?disabled=${this.disabled} ></primer-klarna>`;break;case\"ACH\":a=p`<primer-dynamic-payment .paymentMethod=${e} ></primer-dynamic-payment>`;break;default:return y}return p`<div @click=${this.handleClick}>${a}</div>`}}"
180
180
  },
181
181
  {
182
182
  "kind": "variable",
@@ -186,32 +186,32 @@
186
186
  {
187
187
  "kind": "variable",
188
188
  "name": "Ie",
189
- "default": "class extends v{constructor(){super(...arguments);this.formController=new Gr(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 B(this,{task:([e])=>e!==\"STRIPE_ACH\"?w:this.paymentManagers.get(e)?.manager,args:()=>[this.paymentMethod?.type]})}_handleInput(e,a){let i=e.target;this.formController.setFieldValue(a,i.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 a=await e.start(this.formController.formData);if(!a||a.valid)return await this._handleCollectBankAccountDetails(e);a&&this.formController.setValidation(a,!0)}catch(a){this._handleError(a)}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(a){this._handleError(a)}}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 p`<h2>${b(\"payWithAch\",{id:\"payWithAch\"})}</h2><p>${b(\"stripe_ach_user_details_collection_subtitle_label\",{id:\"stripe_ach_user_details_collection_subtitle_label\"})}</p><form @submit=${a=>a.preventDefault()}><div class=\"form-row\"><primer-input-wrapper .hasError=${this.formController.hasError.firstName} ><primer-input-label slot=\"label\">${b(\"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=${a=>this._handleInput(a,\"firstName\")} @blur=${()=>this._handleBlur(\"firstName\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.firstName?this.formController.formState.firstName.error:y}</primer-input-error></primer-input-wrapper><primer-input-wrapper .hasError=${this.formController.hasError.lastName} ><primer-input-label slot=\"label\">${b(\"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=${a=>this._handleInput(a,\"lastName\")} @blur=${()=>this._handleBlur(\"lastName\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.lastName?this.formController.formState.lastName.error:y}</primer-input-error></primer-input-wrapper></div><primer-input-wrapper .hasError=${this.formController.hasError.emailAddress} ><primer-input-label slot=\"label\">${b(\"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=${a=>this._handleInput(a,\"emailAddress\")} @blur=${()=>this._handleBlur(\"emailAddress\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.emailAddress?this.formController.formState.emailAddress.error:y}</primer-input-error></primer-input-wrapper><p>${b(\"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} >${b(\"stripe_ach_user_details_collection_continue_button\",{id:\"stripe_ach_user_details_collection_continue_button\"})}</primer-button></form>`}renderMandate(){return p`<h2>${b(\"payWithAch\",{id:\"payWithAch\"})}</h2><p>${this.clientOptions?.stripe?.mandateData.fullMandateText??b(\"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} >${b(\"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} >${b(\"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():y})}}"
189
+ "default": "class extends v{constructor(){super(...arguments);this.formController=new Fr(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\"?w:this.paymentManagers.get(e)?.manager,args:()=>[this.paymentMethod?.type]})}_handleInput(e,a){let i=e.target;this.formController.setFieldValue(a,i.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 a=await e.start(this.formController.formData);if(!a||a.valid)return await this._handleCollectBankAccountDetails(e);a&&this.formController.setValidation(a,!0)}catch(a){this._handleError(a)}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(a){this._handleError(a)}}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 p`<h2>${b(\"payWithAch\",{id:\"payWithAch\"})}</h2><p>${b(\"stripe_ach_user_details_collection_subtitle_label\",{id:\"stripe_ach_user_details_collection_subtitle_label\"})}</p><form @submit=${a=>a.preventDefault()}><div class=\"form-row\"><primer-input-wrapper .hasError=${this.formController.hasError.firstName} ><primer-input-label slot=\"label\">${b(\"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=${a=>this._handleInput(a,\"firstName\")} @blur=${()=>this._handleBlur(\"firstName\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.firstName?this.formController.formState.firstName.error:y}</primer-input-error></primer-input-wrapper><primer-input-wrapper .hasError=${this.formController.hasError.lastName} ><primer-input-label slot=\"label\">${b(\"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=${a=>this._handleInput(a,\"lastName\")} @blur=${()=>this._handleBlur(\"lastName\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.lastName?this.formController.formState.lastName.error:y}</primer-input-error></primer-input-wrapper></div><primer-input-wrapper .hasError=${this.formController.hasError.emailAddress} ><primer-input-label slot=\"label\">${b(\"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=${a=>this._handleInput(a,\"emailAddress\")} @blur=${()=>this._handleBlur(\"emailAddress\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.emailAddress?this.formController.formState.emailAddress.error:y}</primer-input-error></primer-input-wrapper><p>${b(\"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} >${b(\"stripe_ach_user_details_collection_continue_button\",{id:\"stripe_ach_user_details_collection_continue_button\"})}</primer-button></form>`}renderMandate(){return p`<h2>${b(\"payWithAch\",{id:\"payWithAch\"})}</h2><p>${this.clientOptions?.stripe?.mandateData.fullMandateText??b(\"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} >${b(\"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} >${b(\"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():y})}}"
190
190
  },
191
191
  {
192
192
  "kind": "variable",
193
193
  "name": "xe",
194
- "default": "class extends v{constructor(){super(...arguments);this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this.open=!1;this._paymentMethodManagerTask=new B(this,{task:([e,a])=>!e||!a?w:a.get(e)?.manager,args:()=>[this.paymentMethod?.type,this.paymentManagers]});this._getAssetsTask=new B(this,{task:([e,a])=>{if(!e||!a)return w;let i=a.getPaymentMethodConfiguration(e);return i?{backgroundColor:i.displayMetadata.button.backgroundColor.colored,name:i.name,displayName:this._legacyGetButtonLabel(i.displayMetadata.button.text),iconUrl:i.displayMetadata.button.iconUrl.colored||i.displayMetadata.button.iconUrl.light||i.displayMetadata.button.iconUrl.dark}:w},args:()=>[this.paymentMethod?.type,this.headlessUtils]});this._setupTasks=new B(this,{task:([e,a])=>!e||!a?w:{paymentMethodManager:e,assetsConfig:a},args:()=>[this._paymentMethodManagerTask.value,this._getAssetsTask.value]})}_legacyGetButtonLabel(e){if(!e)return;let a=e?Ra(e):\"\";return a===\"payWith\"&&(a=\"pay_with\"),b(a,{id:a})}start(){this._paymentMethodManagerTask.value&&(this.open=!0)}renderDialog(){return this.open?p`<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>`:y}render(){return this._setupTasks.render({error:()=>y,complete:({assetsConfig:e})=>(this.style.setProperty(\"--dynamic-payment-button-bg-color\",e.backgroundColor),p`<primer-button @click=\"${()=>this.start()}\" class=${oe({loading:!!this.sdkState?.isProcessing,reverse:!0})} title=\"${b(\"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()} `)})}}"
194
+ "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,a])=>!e||!a?w:a.get(e)?.manager,args:()=>[this.paymentMethod?.type,this.paymentManagers]});this._getAssetsTask=new O(this,{task:([e,a])=>{if(!e||!a)return w;let i=a.getPaymentMethodConfiguration(e);return i?{backgroundColor:i.displayMetadata.button.backgroundColor.colored,name:i.name,displayName:this._legacyGetButtonLabel(i.displayMetadata.button.text),iconUrl:i.displayMetadata.button.iconUrl.colored||i.displayMetadata.button.iconUrl.light||i.displayMetadata.button.iconUrl.dark}:w},args:()=>[this.paymentMethod?.type,this.headlessUtils]});this._setupTasks=new O(this,{task:([e,a])=>!e||!a?w:{paymentMethodManager:e,assetsConfig:a},args:()=>[this._paymentMethodManagerTask.value,this._getAssetsTask.value]})}_legacyGetButtonLabel(e){if(!e)return;let a=e?xa(e):\"\";return a===\"payWith\"&&(a=\"pay_with\"),b(a,{id:a})}start(){this._paymentMethodManagerTask.value&&(this.open=!0)}renderDialog(){return this.open?p`<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>`:y}render(){return this._setupTasks.render({error:()=>y,complete:({assetsConfig:e})=>(this.style.setProperty(\"--dynamic-payment-button-bg-color\",e.backgroundColor),p`<primer-button @click=\"${()=>this.start()}\" class=${oe({loading:!!this.sdkState?.isProcessing,reverse:!0})} title=\"${b(\"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()} `)})}}"
195
195
  },
196
196
  {
197
197
  "kind": "variable",
198
198
  "name": "_e",
199
- "default": "class extends v{constructor(){super(...arguments);this.disabled=!1;this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this._paymentMethodManagerTask=new B(this,{task:([e,a])=>!e||!a?w:a.get(e)?.manager,args:()=>[this.paymentMethod?.type,this.paymentManagers]});this._getAssetsTask=new B(this,{task:([e,a])=>{if(!e||!a)return w;let i=a.getPaymentMethodConfiguration(e);if(!i)return w;let n=i.displayMetadata.button.backgroundColor.colored??i.displayMetadata.button.backgroundColor.light,o=i.displayMetadata.button.iconPositionRelativeToText||\"START\";return{backgroundColor:n,name:i.name,displayName:this._legacyGetButtonLabel(i.displayMetadata.button.text),iconUrl:i.displayMetadata.button.iconUrl.colored??i.displayMetadata.button.iconUrl.light,iconPosition:o}},args:()=>[this.paymentMethod?.type,this.headlessUtils]});this._setupTasks=new B(this,{task:([e,a])=>!e||!a?w:{paymentMethodManager:e,assetsConfig:a},args:()=>[this._paymentMethodManagerTask.value,this._getAssetsTask.value]})}_legacyGetButtonLabel(e){if(!e)return;let a=e?Ra(e):\"\";return a===\"payWith\"&&(a=\"pay_with\"),b(a,{id:a})}startRedirectPayment(){this.disabled||this._paymentMethodManagerTask.value&&this._paymentMethodManagerTask.value.start()}render(){return this._setupTasks.render({error:()=>y,complete:({assetsConfig:e})=>{this.style.setProperty(\"--redirect-payment-button-bg-color\",e.backgroundColor);let a={loading:!!this.sdkState?.isProcessing,\"icon-end\":e.iconPosition===\"END\",\"image-only\":!e.displayName},i=e.displayName?p`<span class=\"image-container\"><img src=\"${e.iconUrl}\" alt=\"${e.name}\" /></span><span class=\"button-text\">${e.displayName}</span>`:p`<span class=\"image-container\"><img src=\"${e.iconUrl}\" alt=\"${e.name}\" /></span>`;return p`<primer-button @click=\"${()=>this.startRedirectPayment()}\" class=${oe(a)} title=\"${b(\"pay_with\",{id:\"pay_with\"})} ${e.name}\" ?disabled=${this.disabled} >${i}</primer-button>`}})}}"
199
+ "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,a])=>!e||!a?w:a.get(e)?.manager,args:()=>[this.paymentMethod?.type,this.paymentManagers]});this._getAssetsTask=new O(this,{task:([e,a])=>{if(!e||!a)return w;let i=a.getPaymentMethodConfiguration(e);if(!i)return w;let n=i.displayMetadata.button.backgroundColor.colored??i.displayMetadata.button.backgroundColor.light,o=i.displayMetadata.button.iconPositionRelativeToText||\"START\";return{backgroundColor:n,name:i.name,displayName:this._legacyGetButtonLabel(i.displayMetadata.button.text),iconUrl:i.displayMetadata.button.iconUrl.colored??i.displayMetadata.button.iconUrl.light,iconPosition:o}},args:()=>[this.paymentMethod?.type,this.headlessUtils]});this._setupTasks=new O(this,{task:([e,a])=>!e||!a?w:{paymentMethodManager:e,assetsConfig:a},args:()=>[this._paymentMethodManagerTask.value,this._getAssetsTask.value]})}_legacyGetButtonLabel(e){if(!e)return;let a=e?xa(e):\"\";return a===\"payWith\"&&(a=\"pay_with\"),b(a,{id:a})}startRedirectPayment(){this.disabled||this._paymentMethodManagerTask.value&&this._paymentMethodManagerTask.value.start()}render(){return this._setupTasks.render({error:()=>y,complete:({assetsConfig:e})=>{this.style.setProperty(\"--redirect-payment-button-bg-color\",e.backgroundColor);let a={loading:!!this.sdkState?.isProcessing,\"icon-end\":e.iconPosition===\"END\",\"image-only\":!e.displayName},i=e.displayName?p`<span class=\"image-container\"><img src=\"${e.iconUrl}\" alt=\"${e.name}\" /></span><span class=\"button-text\">${e.displayName}</span>`:p`<span class=\"image-container\"><img src=\"${e.iconUrl}\" alt=\"${e.name}\" /></span>`;return p`<primer-button @click=\"${()=>this.startRedirectPayment()}\" class=${oe(a)} title=\"${b(\"pay_with\",{id:\"pay_with\"})} ${e.name}\" ?disabled=${this.disabled} >${i}</primer-button>`}})}}"
200
200
  },
201
201
  {
202
202
  "kind": "variable",
203
203
  "name": "le",
204
- "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 B(this,{task:async([e,a])=>{if(!e||!a)return w;let i=this.extractFieldConfig(e);return await this.initializeCountryOptions(),i},args:()=>[this.configuration,this.headlessUtils]})}connectedCallback(){super.connectedCallback(),this._initializationTask.value}extractFieldConfig(e){if(e?.checkoutModules){let a=e.checkoutModules.find(i=>i.type===\"BILLING_ADDRESS\");if(a?.options){let i=a.options;return Object.keys(on).reduce((n,o)=>({...n,[o]:i[o]??!1}),{})}}return this.defaultFieldConfig}async initializeCountryOptions(){try{let e=nn(\"en\");this.countryOptions=[...e.map(([n,o])=>({value:n,label:o}))],this.requestUpdate(\"countryOptions\");let a=Fi();if(a===\"en\"||a===\"en-GB\"||a.startsWith(\"en-\"))return;if(await Fl(a)){let n=nn(a);this.countryOptions=[...n.map(([o,s])=>({value:o,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(on).reduce((e,a)=>({...e,[a]:!1}),{})}get shouldShowForm(){return this.fieldConfig.postalCode}handleInput(e,a){this.formData={...this.formData,[e]:a},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 a=this.formData[e],i=this.fieldConfig[e];if(!i){delete this.errors[e];return}if(i&&(!a||a.trim()===\"\")){let n=`${e}ErrorRequired`;this.errors={...this.errors,[e]:b(\"This field is required\",{id:n})}}else{let n={...this.errors};delete n[e],this.errors=n}}validateForm(){return Object.keys(on).forEach(e=>{let a=e;this.fieldConfig[a]&&this.validateField(a)}),Object.keys(this.errors).length===0}async validateForSubmission(){if(!this.shouldShowForm)return!0;this.submitted=!0,Object.keys(this.fieldConfig).forEach(a=>{this.fieldConfig[a]&&this.touchedFields.add(a)});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 a=!!this.errors[e],i=this.dirtyFields.has(e),n=this.touchedFields.has(e);return a&&(this.submitted||i&&n)}render(){return this._initializationTask.render({pending:()=>y,error:()=>y,complete:()=>this.shouldShowForm?(this.removeAttribute(\"hidden\"),p`<div class=\"billing-address-form\"><div class=\"billing-address-title\">${b(\"Billing address\",{id:\"billingAddressLabel\"})}</div>${R(this.fieldConfig.countryCode,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"countryCode\"} .hasError=${this.shouldShowError(\"countryCode\")} ><primer-input-label slot=\"label\">${b(\"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=${b(\"Select a country\",{id:\"countrySelectPlaceholder\"})} @input=${e=>this.handleInput(\"countryCode\",e.detail)} @focus=${()=>this.handleFocus(\"countryCode\")} @blur=${()=>this.handleBlur(\"countryCode\")} ></primer-select>${R(this.shouldShowError(\"countryCode\"),()=>p`<primer-input-error slot=\"error\">${this.errors.countryCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${R(this.fieldConfig.firstName||this.fieldConfig.lastName,()=>p`<div class=\"billing-address-row\">${R(this.fieldConfig.firstName,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"firstName\"} .hasError=${this.shouldShowError(\"firstName\")} ><primer-input-label slot=\"label\">${b(\"First name\",{id:\"firstNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"firstName\" name=\"firstName\" type=\"text\" .value=${this.formData.firstName||\"\"} placeholder=${b(\"First name\",{id:\"firstNamePlaceholder\"})} @input=${e=>this.handleInput(\"firstName\",e.detail)} @focus=${()=>this.handleFocus(\"firstName\")} @blur=${()=>this.handleBlur(\"firstName\")} ></primer-input>${R(this.shouldShowError(\"firstName\"),()=>p`<primer-input-error slot=\"error\">${this.errors.firstName}</primer-input-error>`)}</primer-input-wrapper>`)} ${R(this.fieldConfig.lastName,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"lastName\"} .hasError=${this.shouldShowError(\"lastName\")} ><primer-input-label slot=\"label\">${b(\"Last name\",{id:\"lastNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"lastName\" name=\"lastName\" type=\"text\" .value=${this.formData.lastName||\"\"} placeholder=${b(\"Last name\",{id:\"lastNamePlaceholder\"})} @input=${e=>this.handleInput(\"lastName\",e.detail)} @focus=${()=>this.handleFocus(\"lastName\")} @blur=${()=>this.handleBlur(\"lastName\")} ></primer-input>${R(this.shouldShowError(\"lastName\"),()=>p`<primer-input-error slot=\"error\">${this.errors.lastName}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${R(this.fieldConfig.addressLine1,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine1\"} .hasError=${this.shouldShowError(\"addressLine1\")} ><primer-input-label slot=\"label\">${b(\"Address line 1\",{id:\"addressLine1\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine1\" name=\"addressLine1\" type=\"text\" .value=${this.formData.addressLine1||\"\"} placeholder=${b(\"Address line 1\",{id:\"addressLine1Placeholder\"})} @input=${e=>this.handleInput(\"addressLine1\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine1\")} @blur=${()=>this.handleBlur(\"addressLine1\")} ></primer-input>${R(this.shouldShowError(\"addressLine1\"),()=>p`<primer-input-error slot=\"error\">${this.errors.addressLine1}</primer-input-error>`)}</primer-input-wrapper>`)} ${R(this.fieldConfig.addressLine2,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine2\"} .hasError=${this.shouldShowError(\"addressLine2\")} ><primer-input-label slot=\"label\">${b(\"Address line 2\",{id:\"addressLine2\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine2\" name=\"addressLine2\" type=\"text\" .value=${this.formData.addressLine2||\"\"} placeholder=${b(\"Address line 2\",{id:\"addressLine2Placeholder\"})} @input=${e=>this.handleInput(\"addressLine2\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine2\")} @blur=${()=>this.handleBlur(\"addressLine2\")} ></primer-input>${R(this.shouldShowError(\"addressLine2\"),()=>p`<primer-input-error slot=\"error\">${this.errors.addressLine2}</primer-input-error>`)}</primer-input-wrapper>`)} ${R(this.fieldConfig.postalCode||this.fieldConfig.city,()=>p`<div class=\"billing-address-row\">${R(this.fieldConfig.postalCode,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"postalCode\"} .hasError=${this.shouldShowError(\"postalCode\")} ><primer-input-label slot=\"label\">${b(\"Postal code\",{id:\"postalCodeLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"postalCode\" name=\"postalCode\" type=\"text\" .value=${this.formData.postalCode||\"\"} placeholder=${b(\"90210\",{id:\"postalCodePlaceholder\"})} @input=${e=>this.handleInput(\"postalCode\",e.detail)} @focus=${()=>this.handleFocus(\"postalCode\")} @blur=${()=>this.handleBlur(\"postalCode\")} ></primer-input>${R(this.shouldShowError(\"postalCode\"),()=>p`<primer-input-error slot=\"error\">${this.errors.postalCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${R(this.fieldConfig.city,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"city\"} .hasError=${this.shouldShowError(\"city\")} ><primer-input-label slot=\"label\">${b(\"City\",{id:\"cityLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"city\" name=\"city\" type=\"text\" .value=${this.formData.city||\"\"} placeholder=${b(\"Cape Town\",{id:\"cityPlaceholder\"})} @input=${e=>this.handleInput(\"city\",e.detail)} @focus=${()=>this.handleFocus(\"city\")} @blur=${()=>this.handleBlur(\"city\")} ></primer-input>${R(this.shouldShowError(\"city\"),()=>p`<primer-input-error slot=\"error\">${this.errors.city}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${R(this.fieldConfig.state,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"state\"} .hasError=${this.shouldShowError(\"state\")} ><primer-input-label slot=\"label\">${b(\"State / Region / County\",{id:\"stateLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"state\" name=\"state\" type=\"text\" .value=${this.formData.state||\"\"} placeholder=${b(\"State / Region / County\",{id:\"statePlaceholder\"})} @input=${e=>this.handleInput(\"state\",e.detail)} @focus=${()=>this.handleFocus(\"state\")} @blur=${()=>this.handleBlur(\"state\")} ></primer-input>${R(this.shouldShowError(\"state\"),()=>p`<primer-input-error slot=\"error\">${this.errors.state}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`):(this.setAttribute(\"hidden\",\"\"),y)})}}"
204
+ "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,a])=>{if(!e||!a)return w;let i=this.extractFieldConfig(e);return await this.initializeCountryOptions(),i},args:()=>[this.configuration,this.headlessUtils]})}connectedCallback(){super.connectedCallback(),this._initializationTask.value}extractFieldConfig(e){if(e?.checkoutModules){let a=e.checkoutModules.find(i=>i.type===\"BILLING_ADDRESS\");if(a?.options){let i=a.options;return Object.keys(sn).reduce((n,o)=>({...n,[o]:i[o]??!1}),{})}}return this.defaultFieldConfig}async initializeCountryOptions(){try{let e=on(\"en\");this.countryOptions=[...e.map(([n,o])=>({value:n,label:o}))],this.requestUpdate(\"countryOptions\");let a=Ui();if(a===\"en\"||a===\"en-GB\"||a.startsWith(\"en-\"))return;if(await Ul(a)){let n=on(a);this.countryOptions=[...n.map(([o,s])=>({value:o,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(sn).reduce((e,a)=>({...e,[a]:!1}),{})}get shouldShowForm(){return this.fieldConfig.postalCode}handleInput(e,a){this.formData={...this.formData,[e]:a},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 a=this.formData[e],i=this.fieldConfig[e];if(!i){delete this.errors[e];return}if(i&&(!a||a.trim()===\"\")){let n=`${e}ErrorRequired`;this.errors={...this.errors,[e]:b(\"This field is required\",{id:n})}}else{let n={...this.errors};delete n[e],this.errors=n}}validateForm(){return Object.keys(sn).forEach(e=>{let a=e;this.fieldConfig[a]&&this.validateField(a)}),Object.keys(this.errors).length===0}async validateForSubmission(){if(!this.shouldShowForm)return!0;this.submitted=!0,Object.keys(this.fieldConfig).forEach(a=>{this.fieldConfig[a]&&this.touchedFields.add(a)});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 a=!!this.errors[e],i=this.dirtyFields.has(e),n=this.touchedFields.has(e);return a&&(this.submitted||i&&n)}render(){return this._initializationTask.render({pending:()=>y,error:()=>y,complete:()=>this.shouldShowForm?(this.removeAttribute(\"hidden\"),p`<div class=\"billing-address-form\"><div class=\"billing-address-title\">${b(\"Billing address\",{id:\"billingAddressLabel\"})}</div>${R(this.fieldConfig.countryCode,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"countryCode\"} .hasError=${this.shouldShowError(\"countryCode\")} ><primer-input-label slot=\"label\">${b(\"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=${b(\"Select a country\",{id:\"countrySelectPlaceholder\"})} @input=${e=>this.handleInput(\"countryCode\",e.detail)} @focus=${()=>this.handleFocus(\"countryCode\")} @blur=${()=>this.handleBlur(\"countryCode\")} ></primer-select>${R(this.shouldShowError(\"countryCode\"),()=>p`<primer-input-error slot=\"error\">${this.errors.countryCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${R(this.fieldConfig.firstName||this.fieldConfig.lastName,()=>p`<div class=\"billing-address-row\">${R(this.fieldConfig.firstName,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"firstName\"} .hasError=${this.shouldShowError(\"firstName\")} ><primer-input-label slot=\"label\">${b(\"First name\",{id:\"firstNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"firstName\" name=\"firstName\" type=\"text\" .value=${this.formData.firstName||\"\"} placeholder=${b(\"First name\",{id:\"firstNamePlaceholder\"})} @input=${e=>this.handleInput(\"firstName\",e.detail)} @focus=${()=>this.handleFocus(\"firstName\")} @blur=${()=>this.handleBlur(\"firstName\")} ></primer-input>${R(this.shouldShowError(\"firstName\"),()=>p`<primer-input-error slot=\"error\">${this.errors.firstName}</primer-input-error>`)}</primer-input-wrapper>`)} ${R(this.fieldConfig.lastName,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"lastName\"} .hasError=${this.shouldShowError(\"lastName\")} ><primer-input-label slot=\"label\">${b(\"Last name\",{id:\"lastNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"lastName\" name=\"lastName\" type=\"text\" .value=${this.formData.lastName||\"\"} placeholder=${b(\"Last name\",{id:\"lastNamePlaceholder\"})} @input=${e=>this.handleInput(\"lastName\",e.detail)} @focus=${()=>this.handleFocus(\"lastName\")} @blur=${()=>this.handleBlur(\"lastName\")} ></primer-input>${R(this.shouldShowError(\"lastName\"),()=>p`<primer-input-error slot=\"error\">${this.errors.lastName}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${R(this.fieldConfig.addressLine1,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine1\"} .hasError=${this.shouldShowError(\"addressLine1\")} ><primer-input-label slot=\"label\">${b(\"Address line 1\",{id:\"addressLine1\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine1\" name=\"addressLine1\" type=\"text\" .value=${this.formData.addressLine1||\"\"} placeholder=${b(\"Address line 1\",{id:\"addressLine1Placeholder\"})} @input=${e=>this.handleInput(\"addressLine1\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine1\")} @blur=${()=>this.handleBlur(\"addressLine1\")} ></primer-input>${R(this.shouldShowError(\"addressLine1\"),()=>p`<primer-input-error slot=\"error\">${this.errors.addressLine1}</primer-input-error>`)}</primer-input-wrapper>`)} ${R(this.fieldConfig.addressLine2,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine2\"} .hasError=${this.shouldShowError(\"addressLine2\")} ><primer-input-label slot=\"label\">${b(\"Address line 2\",{id:\"addressLine2\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine2\" name=\"addressLine2\" type=\"text\" .value=${this.formData.addressLine2||\"\"} placeholder=${b(\"Address line 2\",{id:\"addressLine2Placeholder\"})} @input=${e=>this.handleInput(\"addressLine2\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine2\")} @blur=${()=>this.handleBlur(\"addressLine2\")} ></primer-input>${R(this.shouldShowError(\"addressLine2\"),()=>p`<primer-input-error slot=\"error\">${this.errors.addressLine2}</primer-input-error>`)}</primer-input-wrapper>`)} ${R(this.fieldConfig.postalCode||this.fieldConfig.city,()=>p`<div class=\"billing-address-row\">${R(this.fieldConfig.postalCode,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"postalCode\"} .hasError=${this.shouldShowError(\"postalCode\")} ><primer-input-label slot=\"label\">${b(\"Postal code\",{id:\"postalCodeLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"postalCode\" name=\"postalCode\" type=\"text\" .value=${this.formData.postalCode||\"\"} placeholder=${b(\"90210\",{id:\"postalCodePlaceholder\"})} @input=${e=>this.handleInput(\"postalCode\",e.detail)} @focus=${()=>this.handleFocus(\"postalCode\")} @blur=${()=>this.handleBlur(\"postalCode\")} ></primer-input>${R(this.shouldShowError(\"postalCode\"),()=>p`<primer-input-error slot=\"error\">${this.errors.postalCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${R(this.fieldConfig.city,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"city\"} .hasError=${this.shouldShowError(\"city\")} ><primer-input-label slot=\"label\">${b(\"City\",{id:\"cityLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"city\" name=\"city\" type=\"text\" .value=${this.formData.city||\"\"} placeholder=${b(\"Cape Town\",{id:\"cityPlaceholder\"})} @input=${e=>this.handleInput(\"city\",e.detail)} @focus=${()=>this.handleFocus(\"city\")} @blur=${()=>this.handleBlur(\"city\")} ></primer-input>${R(this.shouldShowError(\"city\"),()=>p`<primer-input-error slot=\"error\">${this.errors.city}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${R(this.fieldConfig.state,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"state\"} .hasError=${this.shouldShowError(\"state\")} ><primer-input-label slot=\"label\">${b(\"State / Region / County\",{id:\"stateLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"state\" name=\"state\" type=\"text\" .value=${this.formData.state||\"\"} placeholder=${b(\"State / Region / County\",{id:\"statePlaceholder\"})} @input=${e=>this.handleInput(\"state\",e.detail)} @focus=${()=>this.handleFocus(\"state\")} @blur=${()=>this.handleBlur(\"state\")} ></primer-input>${R(this.shouldShowError(\"state\"),()=>p`<primer-input-error slot=\"error\">${this.errors.state}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`):(this.setAttribute(\"hidden\",\"\"),y)})}}"
205
205
  },
206
206
  {
207
207
  "kind": "variable",
208
208
  "name": "X",
209
- "default": "class extends v{constructor(){super();this.vaultManagerContext=null;this.vaultItemContext=null;this.headlessUtils=null;this.contextEventsController=null;this.hasSlottedSubmit=!1;this.isEditMode=!1;this.deletePaymentMethodId=null;this.isDeleting=!1;this.errorMessage=\"\";this.animationDuration=300;this._isHandlingContextEvent=!1;this._contextVaultSubmitListener=null;this.deleteAssetConfig=null;this.handleSubmitSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasSlottedSubmit=i.length>0};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 a=this.vaultManagerContext.vaultedPaymentMethods.find(i=>i.id===this.deletePaymentMethodId);a&&(this.deleteAssetConfig=await Fr(a,this.headlessUtils,this.vaultManagerContext))}};this.handleCancelDelete=()=>{this.deletePaymentMethodId=null,this.deleteAssetConfig=null};this.handleConfirmDelete=async()=>{if(!this.vaultManagerContext?.deleteVaultedPaymentMethod||!this.deletePaymentMethodId){this.errorMessage=b(\"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:b(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}finally{this.isDeleting=!1}};this.handlePaymentError=e=>{let a=e.detail?.error;this.errorMessage=a instanceof Error?a.message:b(\"payment_processing_error\",{id:\"payment_processing_error\"})};this.handleCloseError=()=>{this.errorMessage=\"\"};this.handleSlotButtonClick=e=>{let i=e.target.closest(\"button, primer-button\");if(!i)return;let n=i;this.isSubmitButton(n)&&(e.preventDefault(),this.submitVaultPayment())};this.handleDirectSubmit=()=>{this.submitVaultPayment()};this.handleContextVaultSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitVaultPayment())}finally{this._isHandlingContextEvent=!1}}};new aa(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\"}}}isSubmitButton(e){let a=e.tagName.toLowerCase(),i=a===\"button\",n=a===\"primer-button\";return i&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||n&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitVaultPayment(){if(this.vaultManagerContext)try{await this.vaultManagerContext.startVaultedPaymentFlow()}catch(e){this.dispatchEvent(new CustomEvent(\"primer-vault-payment-error\",{detail:{error:e},bubbles:!0,composed:!0}))}}getPaymentMethodName(e){if(!this.vaultManagerContext)return\"\";let a=this.vaultManagerContext.vaultedPaymentMethods.find(i=>i.id===e);if(!a)return\"\";try{return ln(a).description||\"\"}catch{return\"\"}}setupContextEventListeners(){this.contextEventsController?.host&&this._contextVaultSubmitListener&&this.contextEventsController.host.addEventListener(\"primer:vault-submit\",this._contextVaultSubmitListener)}cleanupContextEventListeners(){this.contextEventsController?.host&&this._contextVaultSubmitListener&&this.contextEventsController.host.removeEventListener(\"primer:vault-submit\",this._contextVaultSubmitListener)}connectedCallback(){super.connectedCallback(),this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:vault-submit\",this.handleDirectSubmit),this._contextVaultSubmitListener=e=>{this.handleContextVaultSubmit(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:vault-submit\",this.handleDirectSubmit),this.cleanupContextEventListeners(),super.disconnectedCallback()}renderLoadingOverlay(){return p`<div class=\"loading-overlay\" ${Tt({...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 y;let e=this.getPaymentMethodName(this.deletePaymentMethodId);return p`<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} ${Tt({...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?y:p`<primer-vault-payment-method-item .paymentMethod=${e} .isEditMode=${this.isEditMode} @delete-payment-method=${this.handleDeletePaymentMethod} ${Tt({...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||[],a=!this.isEditMode&&e.length>0&&!this.deletePaymentMethodId;return p`<div class=\"payment-methods-list\">${e.map(i=>this.renderPaymentMethodItem(i))} ${R(a,()=>p`<div class=\"submit-button-container\"><slot name=\"submit-button\" @slotchange=${this.handleSubmitSlotChange} ${Tt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></slot>${R(!this.hasSlottedSubmit,()=>p`<primer-vault-payment-submit class=\"submit-button\" @primer-vault-payment-error=${this.handlePaymentError} ></primer-vault-payment-submit>`)}</div>`,()=>y)}</div>`}render(){if(!this.vaultManagerContext?.enabled||this.vaultManagerContext?.headless)return y;let e=this.vaultManagerContext.vaultedPaymentMethods.length>0,a=this.vaultManagerContext.isLoading,i=this.vaultManagerContext.isUpdating;return p` ${R(!this.vaultManagerContext?.showEmptyState&&!e,()=>y,()=>p`<slot name=\"vault-empty-state\"><div class=\"vault-manager ${i?\"is-updating\":\"\"}\"><primer-vault-manager-header .isEditMode=${this.isEditMode} .hasPaymentMethods=${e} @toggle-edit-mode=${this.handleToggleEditMode} ></primer-vault-manager-header>${R(this.errorMessage,()=>p`<primer-vault-error-message .errorMessage=${this.errorMessage} @close-error=${this.handleCloseError} ${Tt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-error-message>`,()=>y)}<div class=\"vault-manager-content\">${R(!a&&!e,()=>p`<div class=\"content-container\"><primer-vault-empty-state ${Tt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-empty-state></div>`,()=>y)} ${R(!a&&e,()=>p`<div class=\"content-container\">${R(this.deletePaymentMethodId,()=>this.renderDeleteConfirmation(),()=>this.renderPaymentMethodList())}</div>`,()=>y)}</div>${R(i,()=>this.renderLoadingOverlay(),()=>y)}</div></slot>`)} `}}"
209
+ "default": "class extends v{constructor(){super();this.vaultManagerContext=null;this.vaultItemContext=null;this.headlessUtils=null;this.contextEventsController=null;this.hasSlottedSubmit=!1;this.isEditMode=!1;this.deletePaymentMethodId=null;this.isDeleting=!1;this.errorMessage=\"\";this.animationDuration=300;this._isHandlingContextEvent=!1;this._contextVaultSubmitListener=null;this.deleteAssetConfig=null;this.handleSubmitSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasSlottedSubmit=i.length>0};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 a=this.vaultManagerContext.vaultedPaymentMethods.find(i=>i.id===this.deletePaymentMethodId);a&&(this.deleteAssetConfig=await Vr(a,this.headlessUtils,this.vaultManagerContext))}};this.handleCancelDelete=()=>{this.deletePaymentMethodId=null,this.deleteAssetConfig=null};this.handleConfirmDelete=async()=>{if(!this.vaultManagerContext?.deleteVaultedPaymentMethod||!this.deletePaymentMethodId){this.errorMessage=b(\"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:b(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}finally{this.isDeleting=!1}};this.handlePaymentError=e=>{let a=e.detail?.error;this.errorMessage=a instanceof Error?a.message:b(\"payment_processing_error\",{id:\"payment_processing_error\"})};this.handleCloseError=()=>{this.errorMessage=\"\"};this.handleSlotButtonClick=e=>{let i=e.target.closest(\"button, primer-button\");if(!i)return;let n=i;this.isSubmitButton(n)&&(e.preventDefault(),this.submitVaultPayment())};this.handleDirectSubmit=()=>{this.submitVaultPayment()};this.handleContextVaultSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitVaultPayment())}finally{this._isHandlingContextEvent=!1}}};new aa(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\"}}}isSubmitButton(e){let a=e.tagName.toLowerCase(),i=a===\"button\",n=a===\"primer-button\";return i&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||n&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitVaultPayment(){if(this.vaultManagerContext)try{await this.vaultManagerContext.startVaultedPaymentFlow()}catch(e){this.dispatchEvent(new CustomEvent(\"primer-vault-payment-error\",{detail:{error:e},bubbles:!0,composed:!0}))}}getPaymentMethodName(e){if(!this.vaultManagerContext)return\"\";let a=this.vaultManagerContext.vaultedPaymentMethods.find(i=>i.id===e);if(!a)return\"\";try{return dn(a).description||\"\"}catch{return\"\"}}setupContextEventListeners(){this.contextEventsController?.host&&this._contextVaultSubmitListener&&this.contextEventsController.host.addEventListener(\"primer:vault-submit\",this._contextVaultSubmitListener)}cleanupContextEventListeners(){this.contextEventsController?.host&&this._contextVaultSubmitListener&&this.contextEventsController.host.removeEventListener(\"primer:vault-submit\",this._contextVaultSubmitListener)}connectedCallback(){super.connectedCallback(),this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:vault-submit\",this.handleDirectSubmit),this._contextVaultSubmitListener=e=>{this.handleContextVaultSubmit(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:vault-submit\",this.handleDirectSubmit),this.cleanupContextEventListeners(),super.disconnectedCallback()}renderLoadingOverlay(){return p`<div class=\"loading-overlay\" ${Tt({...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 y;let e=this.getPaymentMethodName(this.deletePaymentMethodId);return p`<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} ${Tt({...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?y:p`<primer-vault-payment-method-item .paymentMethod=${e} .isEditMode=${this.isEditMode} @delete-payment-method=${this.handleDeletePaymentMethod} ${Tt({...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||[],a=!this.isEditMode&&e.length>0&&!this.deletePaymentMethodId;return p`<div class=\"payment-methods-list\">${e.map(i=>this.renderPaymentMethodItem(i))} ${R(a,()=>p`<div class=\"submit-button-container\"><slot name=\"submit-button\" @slotchange=${this.handleSubmitSlotChange} ${Tt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></slot>${R(!this.hasSlottedSubmit,()=>p`<primer-vault-payment-submit class=\"submit-button\" @primer-vault-payment-error=${this.handlePaymentError} ></primer-vault-payment-submit>`)}</div>`,()=>y)}</div>`}render(){if(!this.vaultManagerContext?.enabled||this.vaultManagerContext?.headless)return y;let e=this.vaultManagerContext.vaultedPaymentMethods.length>0,a=this.vaultManagerContext.isLoading,i=this.vaultManagerContext.isUpdating;return p` ${R(!this.vaultManagerContext?.showEmptyState&&!e,()=>y,()=>p`<slot name=\"vault-empty-state\"><div class=\"vault-manager ${i?\"is-updating\":\"\"}\"><primer-vault-manager-header .isEditMode=${this.isEditMode} .hasPaymentMethods=${e} @toggle-edit-mode=${this.handleToggleEditMode} ></primer-vault-manager-header>${R(this.errorMessage,()=>p`<primer-vault-error-message .errorMessage=${this.errorMessage} @close-error=${this.handleCloseError} ${Tt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-error-message>`,()=>y)}<div class=\"vault-manager-content\">${R(!a&&!e,()=>p`<div class=\"content-container\"><primer-vault-empty-state ${Tt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-empty-state></div>`,()=>y)} ${R(!a&&e,()=>p`<div class=\"content-container\">${R(this.deletePaymentMethodId,()=>this.renderDeleteConfirmation(),()=>this.renderPaymentMethodList())}</div>`,()=>y)}</div>${R(i,()=>this.renderLoadingOverlay(),()=>y)}</div></slot>`)} `}}"
210
210
  },
211
211
  {
212
212
  "kind": "variable",
213
213
  "name": "Ee",
214
- "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 B(this,{task:async([e,a,i])=>await Fr(e,a,i),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:()=>y,complete:e=>{let a=this.isSelected()?\"checked\":\"default\",i=!1,n=e?.description;return p`<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=${a} .flex=${i} @click=${this.handleClick} ><primer-payment-method-content .assetConfig=${e} ></primer-payment-method-content>${R(e.shouldShowCVV&&this.isSelected()&&!this.isEditMode,()=>p`<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>`,()=>y)}</primer-button>${this.isEditMode?p`<primer-button variant=\"tertiary\" class=\"delete-button\" @click=${this.handleDeleteClick} aria-label=${`${b(\"delete\",{id:\"delete\"})} ${n}`} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:y}</div></div>`}})}}"
214
+ "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,a,i])=>await Vr(e,a,i),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:()=>y,complete:e=>{let a=this.isSelected()?\"checked\":\"default\",i=!1,n=e?.description;return p`<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=${a} .flex=${i} @click=${this.handleClick} ><primer-payment-method-content .assetConfig=${e} ></primer-payment-method-content>${R(e.shouldShowCVV&&this.isSelected()&&!this.isEditMode,()=>p`<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>`,()=>y)}</primer-button>${this.isEditMode?p`<primer-button variant=\"tertiary\" class=\"delete-button\" @click=${this.handleDeleteClick} aria-label=${`${b(\"delete\",{id:\"delete\"})} ${n}`} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:y}</div></div>`}})}}"
215
215
  },
216
216
  {
217
217
  "kind": "variable",
@@ -241,7 +241,7 @@
241
241
  {
242
242
  "kind": "variable",
243
243
  "name": "ee",
244
- "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 B(this,{task:([e,a])=>!e||!a||e.paymentMethodType!==\"PAYMENT_CARD\"||!e.paymentInstrumentData?.network||a.createCvvInput===null?w:{network:e.paymentInstrumentData.network,createCvvInput:a.createCvvInput},args:()=>[this.paymentMethod,this.vaultManagerFormContext]});this.cvvContainerId=`cvv-container-${Math.random().toString(36).substring(2,9)}`,new B(this,{task:async([e])=>{if(!e)return w;await this.updateComplete;let a=this.renderRoot.querySelector(`#${this.cvvContainerId}`);if(!a)return;let i=zr(this.computedStyles),n=i?{input:{base:i}}:void 0,o={cardNetwork:e.network,container:a,name:\"cvv\",placeholder:\"123\",style:n,ariaLabel:b(\"CVV\",{id:\"cardCVV\"})};this.cvvInput=await e.createCvvInput?.(o)??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:()=>y,complete:()=>p`<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>${R(this.cvvError&&(this.vaultManagerCvvContext?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred),()=>p`<primer-input-error slot=\"error\">${b(this.cvvError,{id:this.cvvError})}</primer-input-error>`)}</primer-input-wrapper></div>`})}}"
244
+ "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,a])=>!e||!a||e.paymentMethodType!==\"PAYMENT_CARD\"||!e.paymentInstrumentData?.network||a.createCvvInput===null?w:{network:e.paymentInstrumentData.network,createCvvInput:a.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 w;await this.updateComplete;let a=this.renderRoot.querySelector(`#${this.cvvContainerId}`);if(!a)return;let i=jr(this.computedStyles),n=i?{input:{base:i}}:void 0,o={cardNetwork:e.network,container:a,name:\"cvv\",placeholder:\"123\",style:n,ariaLabel:b(\"CVV\",{id:\"cardCVV\"})};this.cvvInput=await e.createCvvInput?.(o)??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:()=>y,complete:()=>p`<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>${R(this.cvvError&&(this.vaultManagerCvvContext?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred),()=>p`<primer-input-error slot=\"error\">${b(this.cvvError,{id:this.cvvError})}</primer-input-error>`)}</primer-input-wrapper></div>`})}}"
245
245
  },
246
246
  {
247
247
  "kind": "variable",
@@ -251,7 +251,7 @@
251
251
  {
252
252
  "kind": "variable",
253
253
  "name": "ie",
254
- "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 W(this,{context:ra,initialValue:null});this.eventsController=new Wt(this);this._contextCardSubmitListener=null;this._isHandlingContextEvent=!1;this.inputControllers=new Map;this.setupCardFormTask=new B(this,{task:([e])=>{if(!e?.manager)return w;let{manager:a}=e,i=a.createHostedInputs(),{cardNumberInput:n,expiryInput:o,cvvInput:s}=i;return this.cardFormProvider.setValue({cardholderNameInput:i.cardholderNameInput,cardNumberInput:n,expiryInput:o,cvvInput:s,setCardholderName:l=>{a.setCardholderName(l),this.shouldRequireCardholderName&&a.validate?.().then(c=>{let g=c?.validationErrors?.find(T=>T.name===ud.cardholderName),h=this.inputControllers.get(\"cardholderName\");h&&h.updateMetaFromValidation({valid:!1,error:g?.message||g?.error||null,errorCode:g?.message||g?.error||null})})},setCardNetwork:l=>{this.selectedCardNetwork=l},validate:()=>a.validate(),submit:l=>a.submit(l),hideLabels:this.hideLabels,disabled:this.disabled,setSubmissionState:l=>{this.inputControllers.forEach(c=>{c.setSubmitted(l)})},propagateValidationErrors:l=>{l&&l.forEach(c=>{let m=c.field||c.name,g=c.message||c.error,h=ud[m];if(h){let T=this.inputControllers.get(h);if(T){let M={valid:!1,error:g,errorCode:g};T.updateMetaFromValidation(M)}}})},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 i=e.target.closest(\"button, primer-button\");if(!i)return;let n=i;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 i=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=i.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 a=e.get(\"contextEventsController\");a?.host&&this._contextCardSubmitListener&&a.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\"),a=this.inputControllers.get(\"expire\"),i=this.inputControllers.get(\"cvv\"),n=e?.meta?.dirty===!0,o=a?.meta?.dirty===!0,s=i?.meta?.dirty===!0,l=!0;this.shouldRequireCardholderName&&(l=this.inputControllers.get(\"cardholderName\")?.meta?.dirty===!0),n&&o&&s&&l&&(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 a=e.tagName.toLowerCase(),i=a===\"button\",n=a===\"primer-button\";return i&&(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 a=this.querySelector(\"primer-billing-address\")||this.renderRoot.querySelector(\"primer-billing-address\"),i=!0;a&&(i=await a.validateForSubmission());let n=await e.validate?.();if(n?.valid&&i){if(a&&!await a.submitToSDK()){let c=b(\"tokenizationError\",{id:\"tokenizationError\"});this.formErrorMessage=c,this.eventsController.dispatchFormSubmitErrors([{field:\"billingAddress\",name:\"billingAddress\",error:\"BILLING_ADDRESS_SUBMISSION_FAILED\",message:c}]);return}let o=this.selectedCardNetwork?{cardNetwork:this.selectedCardNetwork}:void 0;await e.submit?.(o);let s={success:!0};this.eventsController.dispatchFormSubmitSuccess(s)}else{let o=n?.validationErrors;e.propagateValidationErrors?.(o||[]),this.cardFormProvider.setValue({...e,errors:o}),this.eventsController.dispatchFormSubmitErrors(o)}}render(){return this.setupCardFormTask.status===vt.ERROR||this.setupCardFormTask.status===vt.INITIAL?y:p`<form @submit=${this.handleFormSubmit}><slot name=\"card-form-content\" @slotchange=${this.onSlotChange}></slot>${this.setupCardFormTask.render({complete:()=>R(this.hasAssignedContent,()=>y,()=>p`<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>${R(this.shouldShowCardholderName,()=>p`<primer-input-card-holder-name></primer-input-card-holder-name>`,()=>y)}<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>`}}"
254
+ "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 W(this,{context:ra,initialValue:null});this.eventsController=new Wt(this);this._contextCardSubmitListener=null;this._isHandlingContextEvent=!1;this.inputControllers=new Map;this.setupCardFormTask=new O(this,{task:([e])=>{if(!e?.manager)return w;let{manager:a}=e,i=a.createHostedInputs(),{cardNumberInput:n,expiryInput:o,cvvInput:s}=i;return this.cardFormProvider.setValue({cardholderNameInput:i.cardholderNameInput,cardNumberInput:n,expiryInput:o,cvvInput:s,setCardholderName:l=>{a.setCardholderName(l),this.shouldRequireCardholderName&&a.validate?.().then(c=>{let g=c?.validationErrors?.find(T=>T.name===pd.cardholderName),h=this.inputControllers.get(\"cardholderName\");h&&h.updateMetaFromValidation({valid:!1,error:g?.message||g?.error||null,errorCode:g?.message||g?.error||null})})},setCardNetwork:l=>{this.selectedCardNetwork=l},validate:()=>a.validate(),submit:l=>a.submit(l),hideLabels:this.hideLabels,disabled:this.disabled,setSubmissionState:l=>{this.inputControllers.forEach(c=>{c.setSubmitted(l)})},propagateValidationErrors:l=>{l&&l.forEach(c=>{let m=c.field||c.name,g=c.message||c.error,h=pd[m];if(h){let T=this.inputControllers.get(h);if(T){let M={valid:!1,error:g,errorCode:g};T.updateMetaFromValidation(M)}}})},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 i=e.target.closest(\"button, primer-button\");if(!i)return;let n=i;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 i=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=i.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 a=e.get(\"contextEventsController\");a?.host&&this._contextCardSubmitListener&&a.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\"),a=this.inputControllers.get(\"expire\"),i=this.inputControllers.get(\"cvv\"),n=e?.meta?.dirty===!0,o=a?.meta?.dirty===!0,s=i?.meta?.dirty===!0,l=!0;this.shouldRequireCardholderName&&(l=this.inputControllers.get(\"cardholderName\")?.meta?.dirty===!0),n&&o&&s&&l&&(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 a=e.tagName.toLowerCase(),i=a===\"button\",n=a===\"primer-button\";return i&&(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 a=this.querySelector(\"primer-billing-address\")||this.renderRoot.querySelector(\"primer-billing-address\"),i=!0;a&&(i=await a.validateForSubmission());let n=await e.validate?.();if(n?.valid&&i){if(a&&!await a.submitToSDK()){let c=b(\"tokenizationError\",{id:\"tokenizationError\"});this.formErrorMessage=c,this.eventsController.dispatchFormSubmitErrors([{field:\"billingAddress\",name:\"billingAddress\",error:\"BILLING_ADDRESS_SUBMISSION_FAILED\",message:c}]);return}let o=this.selectedCardNetwork?{cardNetwork:this.selectedCardNetwork}:void 0;await e.submit?.(o);let s={success:!0};this.eventsController.dispatchFormSubmitSuccess(s)}else{let o=n?.validationErrors;e.propagateValidationErrors?.(o||[]),this.cardFormProvider.setValue({...e,errors:o}),this.eventsController.dispatchFormSubmitErrors(o)}}render(){return this.setupCardFormTask.status===vt.ERROR||this.setupCardFormTask.status===vt.INITIAL?y:p`<form @submit=${this.handleFormSubmit}><slot name=\"card-form-content\" @slotchange=${this.onSlotChange}></slot>${this.setupCardFormTask.render({complete:()=>R(this.hasAssignedContent,()=>y,()=>p`<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>${R(this.shouldShowCardholderName,()=>p`<primer-input-card-holder-name></primer-input-card-holder-name>`,()=>y)}<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>`}}"
255
255
  },
256
256
  {
257
257
  "kind": "variable",
@@ -310,7 +310,7 @@
310
310
  },
311
311
  {
312
312
  "kind": "function",
313
- "name": "eO"
313
+ "name": "rB"
314
314
  }
315
315
  ],
316
316
  "exports": [
@@ -486,7 +486,7 @@
486
486
  "kind": "js",
487
487
  "name": "InitializedPayments",
488
488
  "declaration": {
489
- "name": "cr",
489
+ "name": "pr",
490
490
  "module": "dist/primer-loader.js"
491
491
  }
492
492
  },
@@ -494,7 +494,7 @@
494
494
  "kind": "js",
495
495
  "name": "InitializedVaultedPayments",
496
496
  "declaration": {
497
- "name": "ur",
497
+ "name": "mr",
498
498
  "module": "dist/primer-loader.js"
499
499
  }
500
500
  },
@@ -726,7 +726,7 @@
726
726
  "kind": "js",
727
727
  "name": "injectDarkTheme",
728
728
  "declaration": {
729
- "name": "Pp",
729
+ "name": "kp",
730
730
  "module": "dist/primer-loader.js"
731
731
  }
732
732
  },
@@ -734,7 +734,7 @@
734
734
  "kind": "js",
735
735
  "name": "injectLightTheme",
736
736
  "declaration": {
737
- "name": "Tp",
737
+ "name": "Np",
738
738
  "module": "dist/primer-loader.js"
739
739
  }
740
740
  },
@@ -742,7 +742,7 @@
742
742
  "kind": "js",
743
743
  "name": "injectLoaderStyles",
744
744
  "declaration": {
745
- "name": "Ts",
745
+ "name": "Ps",
746
746
  "module": "dist/primer-loader.js"
747
747
  }
748
748
  },
@@ -750,7 +750,7 @@
750
750
  "kind": "js",
751
751
  "name": "injectThemeStyles",
752
752
  "declaration": {
753
- "name": "Ps",
753
+ "name": "Is",
754
754
  "module": "dist/primer-loader.js"
755
755
  }
756
756
  },
@@ -758,7 +758,7 @@
758
758
  "kind": "js",
759
759
  "name": "loadPrimer",
760
760
  "declaration": {
761
- "name": "eO",
761
+ "name": "rB",
762
762
  "module": "dist/primer-loader.js"
763
763
  }
764
764
  }
@@ -3246,479 +3246,63 @@
3246
3246
  },
3247
3247
  {
3248
3248
  "kind": "javascript-module",
3249
- "path": "src/contexts/analytics-context.ts",
3250
- "declarations": [
3251
- {
3252
- "kind": "variable",
3253
- "name": "analyticsContext"
3254
- }
3255
- ],
3256
- "exports": [
3257
- {
3258
- "kind": "js",
3259
- "name": "analyticsContext",
3260
- "declaration": {
3261
- "name": "analyticsContext",
3262
- "module": "src/contexts/analytics-context.ts"
3263
- }
3264
- }
3265
- ]
3266
- },
3267
- {
3268
- "kind": "javascript-module",
3269
- "path": "src/contexts/card-networks-context.ts",
3270
- "declarations": [
3271
- {
3272
- "kind": "variable",
3273
- "name": "cardNetworksContext"
3274
- }
3275
- ],
3276
- "exports": [
3277
- {
3278
- "kind": "js",
3279
- "name": "cardNetworksContext",
3280
- "declaration": {
3281
- "name": "cardNetworksContext",
3282
- "module": "src/contexts/card-networks-context.ts"
3283
- }
3284
- }
3285
- ]
3286
- },
3287
- {
3288
- "kind": "javascript-module",
3289
- "path": "src/contexts/client-options-context.ts",
3290
- "declarations": [
3291
- {
3292
- "kind": "variable",
3293
- "name": "clientOptionsContext"
3294
- }
3295
- ],
3296
- "exports": [
3297
- {
3298
- "kind": "js",
3299
- "name": "clientOptionsContext",
3300
- "declaration": {
3301
- "name": "clientOptionsContext",
3302
- "module": "src/contexts/client-options-context.ts"
3303
- }
3304
- }
3305
- ]
3306
- },
3307
- {
3308
- "kind": "javascript-module",
3309
- "path": "src/contexts/computed-styles-context.ts",
3310
- "declarations": [
3311
- {
3312
- "kind": "variable",
3313
- "name": "computedStylesContext"
3314
- }
3315
- ],
3316
- "exports": [
3317
- {
3318
- "kind": "js",
3319
- "name": "computedStylesContext",
3320
- "declaration": {
3321
- "name": "computedStylesContext",
3322
- "module": "src/contexts/computed-styles-context.ts"
3323
- }
3324
- }
3325
- ]
3326
- },
3327
- {
3328
- "kind": "javascript-module",
3329
- "path": "src/contexts/configuration-context.ts",
3330
- "declarations": [
3331
- {
3332
- "kind": "variable",
3333
- "name": "configurationContext"
3334
- }
3335
- ],
3336
- "exports": [
3337
- {
3338
- "kind": "js",
3339
- "name": "configurationContext",
3340
- "declaration": {
3341
- "name": "configurationContext",
3342
- "module": "src/contexts/configuration-context.ts"
3343
- }
3344
- }
3345
- ]
3346
- },
3347
- {
3348
- "kind": "javascript-module",
3349
- "path": "src/contexts/events-context.ts",
3350
- "declarations": [
3351
- {
3352
- "kind": "variable",
3353
- "name": "eventsContext"
3354
- }
3355
- ],
3356
- "exports": [
3357
- {
3358
- "kind": "js",
3359
- "name": "eventsContext",
3360
- "declaration": {
3361
- "name": "eventsContext",
3362
- "module": "src/contexts/events-context.ts"
3363
- }
3364
- }
3365
- ]
3366
- },
3367
- {
3368
- "kind": "javascript-module",
3369
- "path": "src/contexts/headless-utils-context.ts",
3370
- "declarations": [
3371
- {
3372
- "kind": "variable",
3373
- "name": "headlessUtilsContext"
3374
- }
3375
- ],
3376
- "exports": [
3377
- {
3378
- "kind": "js",
3379
- "name": "headlessUtilsContext",
3380
- "declaration": {
3381
- "name": "headlessUtilsContext",
3382
- "module": "src/contexts/headless-utils-context.ts"
3383
- }
3384
- }
3385
- ]
3386
- },
3387
- {
3388
- "kind": "javascript-module",
3389
- "path": "src/contexts/klarna-categories-context.ts",
3390
- "declarations": [
3391
- {
3392
- "kind": "variable",
3393
- "name": "klarnaCategoriesContext"
3394
- }
3395
- ],
3396
- "exports": [
3397
- {
3398
- "kind": "js",
3399
- "name": "klarnaCategoriesContext",
3400
- "declaration": {
3401
- "name": "klarnaCategoriesContext",
3402
- "module": "src/contexts/klarna-categories-context.ts"
3403
- }
3404
- }
3405
- ]
3406
- },
3407
- {
3408
- "kind": "javascript-module",
3409
- "path": "src/contexts/payment-manager-context.ts",
3410
- "declarations": [
3411
- {
3412
- "kind": "variable",
3413
- "name": "paymentManagerContext"
3414
- }
3415
- ],
3416
- "exports": [
3417
- {
3418
- "kind": "js",
3419
- "name": "paymentManagerContext",
3420
- "declaration": {
3421
- "name": "paymentManagerContext",
3422
- "module": "src/contexts/payment-manager-context.ts"
3423
- }
3424
- }
3425
- ]
3426
- },
3427
- {
3428
- "kind": "javascript-module",
3429
- "path": "src/contexts/payment-methods-context.ts",
3430
- "declarations": [
3431
- {
3432
- "kind": "variable",
3433
- "name": "paymentMethodsContext"
3434
- }
3435
- ],
3436
- "exports": [
3437
- {
3438
- "kind": "js",
3439
- "name": "paymentMethodsContext",
3440
- "declaration": {
3441
- "name": "paymentMethodsContext",
3442
- "module": "src/contexts/payment-methods-context.ts"
3443
- }
3444
- }
3445
- ]
3446
- },
3447
- {
3448
- "kind": "javascript-module",
3449
- "path": "src/contexts/payments-objects.ts",
3249
+ "path": "src/controllers/card-network-controller.ts",
3450
3250
  "declarations": [
3451
3251
  {
3452
3252
  "kind": "class",
3453
- "description": "",
3454
- "name": "InitializedPayments",
3253
+ "description": "CardNetworkController manages and processes card network data\n\nThis controller is responsible for:\n- Handling card network change events\n- Processing detected and selectable card networks\n- Maintaining card network state",
3254
+ "name": "CardNetworkController",
3455
3255
  "members": [
3456
3256
  {
3457
3257
  "kind": "field",
3458
- "name": "_methods",
3258
+ "name": "host",
3459
3259
  "type": {
3460
- "text": "InitializedPaymentMethodMap"
3260
+ "text": "PrimerCheckoutType"
3461
3261
  },
3462
- "privacy": "private",
3463
- "readonly": true,
3464
- "default": "map"
3262
+ "privacy": "private"
3465
3263
  },
3466
3264
  {
3467
3265
  "kind": "method",
3468
- "name": "get",
3266
+ "name": "hostConnected",
3469
3267
  "return": {
3470
3268
  "type": {
3471
- "text": "RedirectPaymentMethod | undefined"
3269
+ "text": "void"
3472
3270
  }
3473
- },
3474
- "parameters": [
3475
- {
3476
- "name": "type",
3477
- "type": {
3478
- "text": "T"
3479
- }
3271
+ }
3272
+ },
3273
+ {
3274
+ "kind": "method",
3275
+ "name": "setCardNetworksLoading",
3276
+ "return": {
3277
+ "type": {
3278
+ "text": "void"
3480
3279
  }
3481
- ]
3280
+ },
3281
+ "description": "Sets the card networks to loading state"
3482
3282
  },
3483
3283
  {
3484
3284
  "kind": "method",
3485
- "name": "get",
3285
+ "name": "updateCardNetworksState",
3286
+ "privacy": "private",
3486
3287
  "return": {
3487
3288
  "type": {
3488
- "text": "PaymentMethodByType<T> | undefined"
3289
+ "text": "void"
3489
3290
  }
3490
3291
  },
3491
3292
  "parameters": [
3492
3293
  {
3493
- "name": "type",
3294
+ "name": "cardNetworks",
3494
3295
  "type": {
3495
- "text": "T"
3496
- }
3296
+ "text": "CardNetworksContextType"
3297
+ },
3298
+ "description": "The new card networks context"
3497
3299
  }
3498
- ]
3300
+ ],
3301
+ "description": "Updates card networks state and dispatches events"
3499
3302
  },
3500
3303
  {
3501
3304
  "kind": "method",
3502
- "name": "get",
3503
- "parameters": [
3504
- {
3505
- "name": "type",
3506
- "type": {
3507
- "text": "T"
3508
- }
3509
- }
3510
- ]
3511
- },
3512
- {
3513
- "kind": "method",
3514
- "name": "toArray",
3515
- "return": {
3516
- "type": {
3517
- "text": "InitializedPaymentMethod[]"
3518
- }
3519
- }
3520
- },
3521
- {
3522
- "kind": "method",
3523
- "name": "size",
3524
- "return": {
3525
- "type": {
3526
- "text": "number"
3527
- }
3528
- }
3529
- }
3530
- ]
3531
- },
3532
- {
3533
- "kind": "class",
3534
- "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.",
3535
- "name": "InitializedVaultedPayments",
3536
- "members": [
3537
- {
3538
- "kind": "field",
3539
- "name": "_methods",
3540
- "type": {
3541
- "text": "VaultedPaymentMethodsMap"
3542
- },
3543
- "privacy": "private",
3544
- "readonly": true,
3545
- "default": "map"
3546
- },
3547
- {
3548
- "kind": "method",
3549
- "name": "get",
3550
- "return": {
3551
- "type": {
3552
- "text": ""
3553
- }
3554
- },
3555
- "parameters": [
3556
- {
3557
- "name": "id",
3558
- "type": {
3559
- "text": "string"
3560
- },
3561
- "description": "Payment method ID"
3562
- }
3563
- ],
3564
- "description": "Get a vaulted payment method by its ID"
3565
- },
3566
- {
3567
- "kind": "method",
3568
- "name": "toArray",
3569
- "return": {
3570
- "type": {
3571
- "text": ""
3572
- }
3573
- },
3574
- "description": "Get all vaulted payment methods as an array"
3575
- },
3576
- {
3577
- "kind": "method",
3578
- "name": "size",
3579
- "return": {
3580
- "type": {
3581
- "text": ""
3582
- }
3583
- },
3584
- "description": "Get the count of vaulted payment methods"
3585
- }
3586
- ]
3587
- }
3588
- ],
3589
- "exports": [
3590
- {
3591
- "kind": "js",
3592
- "name": "VaultedPaymentMethodSummary",
3593
- "declaration": {
3594
- "name": "VaultedPaymentMethodSummary",
3595
- "module": "src/contexts/payments-objects.ts"
3596
- }
3597
- },
3598
- {
3599
- "kind": "js",
3600
- "name": "InitializedPayments",
3601
- "declaration": {
3602
- "name": "InitializedPayments",
3603
- "module": "src/contexts/payments-objects.ts"
3604
- }
3605
- },
3606
- {
3607
- "kind": "js",
3608
- "name": "InitializedVaultedPayments",
3609
- "declaration": {
3610
- "name": "InitializedVaultedPayments",
3611
- "module": "src/contexts/payments-objects.ts"
3612
- }
3613
- }
3614
- ]
3615
- },
3616
- {
3617
- "kind": "javascript-module",
3618
- "path": "src/contexts/sdk-state-context.ts",
3619
- "declarations": [
3620
- {
3621
- "kind": "variable",
3622
- "name": "sdkStateContext"
3623
- }
3624
- ],
3625
- "exports": [
3626
- {
3627
- "kind": "js",
3628
- "name": "sdkStateContext",
3629
- "declaration": {
3630
- "name": "sdkStateContext",
3631
- "module": "src/contexts/sdk-state-context.ts"
3632
- }
3633
- }
3634
- ]
3635
- },
3636
- {
3637
- "kind": "javascript-module",
3638
- "path": "src/contexts/types.ts",
3639
- "declarations": [],
3640
- "exports": []
3641
- },
3642
- {
3643
- "kind": "javascript-module",
3644
- "path": "src/contexts/vault-item-context.ts",
3645
- "declarations": [
3646
- {
3647
- "kind": "variable",
3648
- "name": "vaultItemContext"
3649
- }
3650
- ],
3651
- "exports": [
3652
- {
3653
- "kind": "js",
3654
- "name": "vaultItemContext",
3655
- "declaration": {
3656
- "name": "vaultItemContext",
3657
- "module": "src/contexts/vault-item-context.ts"
3658
- }
3659
- }
3660
- ]
3661
- },
3662
- {
3663
- "kind": "javascript-module",
3664
- "path": "src/contexts/vault-manager-context.ts",
3665
- "declarations": [
3666
- {
3667
- "kind": "variable",
3668
- "name": "vaultManagerContext"
3669
- }
3670
- ],
3671
- "exports": [
3672
- {
3673
- "kind": "js",
3674
- "name": "vaultManagerContext",
3675
- "declaration": {
3676
- "name": "vaultManagerContext",
3677
- "module": "src/contexts/vault-manager-context.ts"
3678
- }
3679
- }
3680
- ]
3681
- },
3682
- {
3683
- "kind": "javascript-module",
3684
- "path": "src/controllers/card-network-controller.ts",
3685
- "declarations": [
3686
- {
3687
- "kind": "class",
3688
- "description": "CardNetworkController manages and processes card network data\n\nThis controller is responsible for:\n- Handling card network change events\n- Processing detected and selectable card networks\n- Maintaining card network state",
3689
- "name": "CardNetworkController",
3690
- "members": [
3691
- {
3692
- "kind": "field",
3693
- "name": "host",
3694
- "type": {
3695
- "text": "PrimerCheckoutType"
3696
- },
3697
- "privacy": "private"
3698
- },
3699
- {
3700
- "kind": "method",
3701
- "name": "hostConnected",
3702
- "return": {
3703
- "type": {
3704
- "text": "void"
3705
- }
3706
- }
3707
- },
3708
- {
3709
- "kind": "method",
3710
- "name": "setCardNetworksLoading",
3711
- "return": {
3712
- "type": {
3713
- "text": "void"
3714
- }
3715
- },
3716
- "description": "Sets the card networks to loading state"
3717
- },
3718
- {
3719
- "kind": "method",
3720
- "name": "updateCardNetworksState",
3721
- "privacy": "private",
3305
+ "name": "processCardNetworkChangeEvent",
3722
3306
  "return": {
3723
3307
  "type": {
3724
3308
  "text": "void"
@@ -3726,18 +3310,18 @@
3726
3310
  },
3727
3311
  "parameters": [
3728
3312
  {
3729
- "name": "cardNetworks",
3313
+ "name": "event",
3730
3314
  "type": {
3731
- "text": "CardNetworksContextType"
3315
+ "text": "CardNetworkChangeEvent"
3732
3316
  },
3733
- "description": "The new card networks context"
3317
+ "description": "The card network change event"
3734
3318
  }
3735
3319
  ],
3736
- "description": "Updates card networks state and dispatches events"
3320
+ "description": "Processes a card network change event"
3737
3321
  },
3738
3322
  {
3739
3323
  "kind": "method",
3740
- "name": "processCardNetworkChangeEvent",
3324
+ "name": "processBinDataAvailableEvent",
3741
3325
  "return": {
3742
3326
  "type": {
3743
3327
  "text": "void"
@@ -3747,12 +3331,10 @@
3747
3331
  {
3748
3332
  "name": "event",
3749
3333
  "type": {
3750
- "text": "CardNetworkChangeEvent"
3751
- },
3752
- "description": "The card network change event"
3334
+ "text": "BinDataAvailableEvent"
3335
+ }
3753
3336
  }
3754
- ],
3755
- "description": "Processes a card network change event"
3337
+ ]
3756
3338
  }
3757
3339
  ]
3758
3340
  }
@@ -4226,7 +3808,7 @@
4226
3808
  },
4227
3809
  {
4228
3810
  "kind": "method",
4229
- "name": "dispatchCardSubmit",
3811
+ "name": "dispatchBinDataAvailable",
4230
3812
  "return": {
4231
3813
  "type": {
4232
3814
  "text": "void"
@@ -4234,17 +3816,16 @@
4234
3816
  },
4235
3817
  "parameters": [
4236
3818
  {
4237
- "name": "source",
4238
- "optional": true,
3819
+ "name": "data",
4239
3820
  "type": {
4240
- "text": "string"
3821
+ "text": "BinDataAvailableEvent"
4241
3822
  }
4242
3823
  }
4243
3824
  ]
4244
3825
  },
4245
3826
  {
4246
3827
  "kind": "method",
4247
- "name": "dispatchFormSubmitSuccess",
3828
+ "name": "dispatchBinDataLoadingChange",
4248
3829
  "return": {
4249
3830
  "type": {
4250
3831
  "text": "void"
@@ -4252,16 +3833,16 @@
4252
3833
  },
4253
3834
  "parameters": [
4254
3835
  {
4255
- "name": "result",
3836
+ "name": "loading",
4256
3837
  "type": {
4257
- "text": "CardSubmitResult"
3838
+ "text": "boolean"
4258
3839
  }
4259
3840
  }
4260
3841
  ]
4261
3842
  },
4262
3843
  {
4263
3844
  "kind": "method",
4264
- "name": "dispatchFormSubmitErrors",
3845
+ "name": "dispatchCardSubmit",
4265
3846
  "return": {
4266
3847
  "type": {
4267
3848
  "text": "void"
@@ -4269,16 +3850,17 @@
4269
3850
  },
4270
3851
  "parameters": [
4271
3852
  {
4272
- "name": "errors",
3853
+ "name": "source",
3854
+ "optional": true,
4273
3855
  "type": {
4274
- "text": "InputValidationError[]"
3856
+ "text": "string"
4275
3857
  }
4276
3858
  }
4277
3859
  ]
4278
3860
  },
4279
3861
  {
4280
3862
  "kind": "method",
4281
- "name": "handleExternalCardSubmit",
3863
+ "name": "dispatchFormSubmitSuccess",
4282
3864
  "return": {
4283
3865
  "type": {
4284
3866
  "text": "void"
@@ -4286,7 +3868,41 @@
4286
3868
  },
4287
3869
  "parameters": [
4288
3870
  {
4289
- "name": "eventDetails",
3871
+ "name": "result",
3872
+ "type": {
3873
+ "text": "CardSubmitResult"
3874
+ }
3875
+ }
3876
+ ]
3877
+ },
3878
+ {
3879
+ "kind": "method",
3880
+ "name": "dispatchFormSubmitErrors",
3881
+ "return": {
3882
+ "type": {
3883
+ "text": "void"
3884
+ }
3885
+ },
3886
+ "parameters": [
3887
+ {
3888
+ "name": "errors",
3889
+ "type": {
3890
+ "text": "InputValidationError[]"
3891
+ }
3892
+ }
3893
+ ]
3894
+ },
3895
+ {
3896
+ "kind": "method",
3897
+ "name": "handleExternalCardSubmit",
3898
+ "return": {
3899
+ "type": {
3900
+ "text": "void"
3901
+ }
3902
+ },
3903
+ "parameters": [
3904
+ {
3905
+ "name": "eventDetails",
4290
3906
  "type": {
4291
3907
  "text": "CardSubmitPayload"
4292
3908
  },
@@ -5602,218 +5218,653 @@
5602
5218
  },
5603
5219
  {
5604
5220
  "kind": "javascript-module",
5605
- "path": "src/services/primer-dialog-provider.ts",
5221
+ "path": "src/contexts/analytics-context.ts",
5606
5222
  "declarations": [
5607
5223
  {
5608
- "kind": "class",
5609
- "description": "Primer-js DialogProvider implementation using existing PortalDialogComponent",
5610
- "name": "PrimerDialogProvider",
5611
- "members": [
5612
- {
5613
- "kind": "field",
5614
- "name": "currentDialog",
5615
- "type": {
5616
- "text": "PortalDialogComponent | null"
5617
- },
5618
- "privacy": "private",
5619
- "default": "null"
5620
- },
5621
- {
5622
- "kind": "field",
5623
- "name": "currentResolver",
5624
- "type": {
5625
- "text": "((result: DialogResult) => void) | null"
5626
- },
5627
- "privacy": "private",
5628
- "default": "null"
5629
- },
5630
- {
5631
- "kind": "method",
5632
- "name": "show",
5633
- "return": {
5634
- "type": {
5635
- "text": "Promise<DialogResult>"
5636
- }
5637
- },
5638
- "parameters": [
5639
- {
5640
- "name": "request",
5641
- "type": {
5642
- "text": "DialogRequest"
5643
- }
5644
- }
5645
- ]
5646
- },
5647
- {
5648
- "kind": "method",
5649
- "name": "close",
5650
- "return": {
5651
- "type": {
5652
- "text": "void"
5653
- }
5654
- }
5655
- }
5656
- ]
5224
+ "kind": "variable",
5225
+ "name": "analyticsContext"
5657
5226
  }
5658
5227
  ],
5659
5228
  "exports": [
5660
5229
  {
5661
5230
  "kind": "js",
5662
- "name": "PrimerDialogProvider",
5231
+ "name": "analyticsContext",
5663
5232
  "declaration": {
5664
- "name": "PrimerDialogProvider",
5665
- "module": "src/services/primer-dialog-provider.ts"
5233
+ "name": "analyticsContext",
5234
+ "module": "src/contexts/analytics-context.ts"
5666
5235
  }
5667
5236
  }
5668
5237
  ]
5669
5238
  },
5670
5239
  {
5671
5240
  "kind": "javascript-module",
5672
- "path": "src/styles/base.styles.ts",
5241
+ "path": "src/contexts/card-networks-context.ts",
5673
5242
  "declarations": [
5674
5243
  {
5675
5244
  "kind": "variable",
5676
- "name": "base",
5677
- "default": "css` * { box-sizing: border-box; } `"
5678
- },
5679
- {
5680
- "kind": "variable",
5681
- "name": "primerCheckout",
5682
- "default": "css` :host { display: block; isolation: isolate; position: relative; width: 100%; //Keep the CSS loader in the same position - check css-loader-inline.ts min-height: 64px; } `"
5245
+ "name": "cardNetworksContext"
5683
5246
  }
5684
5247
  ],
5685
5248
  "exports": [
5686
5249
  {
5687
5250
  "kind": "js",
5688
- "name": "base",
5251
+ "name": "cardNetworksContext",
5689
5252
  "declaration": {
5690
- "name": "base",
5691
- "module": "src/styles/base.styles.ts"
5253
+ "name": "cardNetworksContext",
5254
+ "module": "src/contexts/card-networks-context.ts"
5692
5255
  }
5693
- },
5256
+ }
5257
+ ]
5258
+ },
5259
+ {
5260
+ "kind": "javascript-module",
5261
+ "path": "src/contexts/client-options-context.ts",
5262
+ "declarations": [
5263
+ {
5264
+ "kind": "variable",
5265
+ "name": "clientOptionsContext"
5266
+ }
5267
+ ],
5268
+ "exports": [
5694
5269
  {
5695
5270
  "kind": "js",
5696
- "name": "primerCheckout",
5271
+ "name": "clientOptionsContext",
5697
5272
  "declaration": {
5698
- "name": "primerCheckout",
5699
- "module": "src/styles/base.styles.ts"
5273
+ "name": "clientOptionsContext",
5274
+ "module": "src/contexts/client-options-context.ts"
5700
5275
  }
5701
5276
  }
5702
5277
  ]
5703
5278
  },
5704
5279
  {
5705
5280
  "kind": "javascript-module",
5706
- "path": "src/styles/css-loader-inline.ts",
5281
+ "path": "src/contexts/computed-styles-context.ts",
5707
5282
  "declarations": [
5708
5283
  {
5709
5284
  "kind": "variable",
5710
- "name": "cssLoaderStyles",
5711
- "default": "` @keyframes primer-css-spinner-rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } primer-checkout:has(:not(:defined)) > * { visibility: hidden; } primer-checkout:not([js-initialized]) { display: block; position: relative; width: 100%; min-height: 64px; } primer-checkout:not([js-initialized]):not([loader-disabled])::after { content: \"\"; display: block; box-sizing: border-box; position: absolute; inset: 0; margin: auto; width: var(--primer-size-xlarge); height: var(--primer-size-xlarge); border-radius: 50%; border: 3px solid #f5f5f5; border-top-color: var(--primer-color-loader); animation: primer-css-spinner-rotate 1.2s linear infinite; z-index: 9999; } `",
5712
- "description": "This module exports the CSS loader styles as a string for inline injection.\nThese styles are injected into the page before any JavaScript loads,\nensuring the loading indicator appears immediately."
5285
+ "name": "computedStylesContext"
5713
5286
  }
5714
5287
  ],
5715
5288
  "exports": [
5716
5289
  {
5717
5290
  "kind": "js",
5718
- "name": "cssLoaderStyles",
5291
+ "name": "computedStylesContext",
5719
5292
  "declaration": {
5720
- "name": "cssLoaderStyles",
5721
- "module": "src/styles/css-loader-inline.ts"
5293
+ "name": "computedStylesContext",
5294
+ "module": "src/contexts/computed-styles-context.ts"
5722
5295
  }
5723
5296
  }
5724
5297
  ]
5725
5298
  },
5726
5299
  {
5727
5300
  "kind": "javascript-module",
5728
- "path": "src/styles/styles.ts",
5301
+ "path": "src/contexts/configuration-context.ts",
5729
5302
  "declarations": [
5730
5303
  {
5731
- "kind": "function",
5732
- "name": "injectLoaderStyles",
5733
- "return": {
5734
- "type": {
5735
- "text": "void"
5736
- }
5737
- },
5738
- "description": "Injects the CSS loader styles into the page\nThese styles display a loading indicator before JavaScript initializes\n\nUnlike theme styles, loader styles should take precedence over merchant styles\nto ensure the loading indicator is visible. We append them to the end of the head."
5739
- },
5740
- {
5741
- "kind": "function",
5742
- "name": "injectThemeStyles",
5743
- "return": {
5744
- "type": {
5745
- "text": "void"
5746
- }
5747
- },
5748
- "description": "Injects all required theme CSS variables into the page\nThis should be called before components are rendered to ensure\nthey have access to all design tokens\n\nTheme styles are prepended to the document head to allow merchant styles\nto override our default variables."
5749
- },
5750
- {
5751
- "kind": "function",
5752
- "name": "injectLightTheme",
5753
- "return": {
5754
- "type": {
5755
- "text": "void"
5756
- }
5757
- },
5758
- "description": "Utility function to inject only the light theme CSS variables"
5759
- },
5760
- {
5761
- "kind": "function",
5762
- "name": "injectDarkTheme",
5763
- "return": {
5764
- "type": {
5765
- "text": "void"
5766
- }
5767
- },
5768
- "description": "Utility function to inject only the dark theme CSS variables"
5304
+ "kind": "variable",
5305
+ "name": "configurationContext"
5769
5306
  }
5770
5307
  ],
5771
5308
  "exports": [
5772
5309
  {
5773
5310
  "kind": "js",
5774
- "name": "injectLoaderStyles",
5311
+ "name": "configurationContext",
5775
5312
  "declaration": {
5776
- "name": "injectLoaderStyles",
5777
- "module": "src/styles/styles.ts"
5313
+ "name": "configurationContext",
5314
+ "module": "src/contexts/configuration-context.ts"
5778
5315
  }
5779
- },
5316
+ }
5317
+ ]
5318
+ },
5319
+ {
5320
+ "kind": "javascript-module",
5321
+ "path": "src/contexts/events-context.ts",
5322
+ "declarations": [
5323
+ {
5324
+ "kind": "variable",
5325
+ "name": "eventsContext"
5326
+ }
5327
+ ],
5328
+ "exports": [
5780
5329
  {
5781
5330
  "kind": "js",
5782
- "name": "injectThemeStyles",
5331
+ "name": "eventsContext",
5783
5332
  "declaration": {
5784
- "name": "injectThemeStyles",
5785
- "module": "src/styles/styles.ts"
5333
+ "name": "eventsContext",
5334
+ "module": "src/contexts/events-context.ts"
5786
5335
  }
5787
- },
5336
+ }
5337
+ ]
5338
+ },
5339
+ {
5340
+ "kind": "javascript-module",
5341
+ "path": "src/contexts/headless-utils-context.ts",
5342
+ "declarations": [
5343
+ {
5344
+ "kind": "variable",
5345
+ "name": "headlessUtilsContext"
5346
+ }
5347
+ ],
5348
+ "exports": [
5788
5349
  {
5789
5350
  "kind": "js",
5790
- "name": "injectLightTheme",
5351
+ "name": "headlessUtilsContext",
5791
5352
  "declaration": {
5792
- "name": "injectLightTheme",
5793
- "module": "src/styles/styles.ts"
5353
+ "name": "headlessUtilsContext",
5354
+ "module": "src/contexts/headless-utils-context.ts"
5794
5355
  }
5795
- },
5356
+ }
5357
+ ]
5358
+ },
5359
+ {
5360
+ "kind": "javascript-module",
5361
+ "path": "src/contexts/klarna-categories-context.ts",
5362
+ "declarations": [
5363
+ {
5364
+ "kind": "variable",
5365
+ "name": "klarnaCategoriesContext"
5366
+ }
5367
+ ],
5368
+ "exports": [
5796
5369
  {
5797
5370
  "kind": "js",
5798
- "name": "injectDarkTheme",
5371
+ "name": "klarnaCategoriesContext",
5799
5372
  "declaration": {
5800
- "name": "injectDarkTheme",
5801
- "module": "src/styles/styles.ts"
5373
+ "name": "klarnaCategoriesContext",
5374
+ "module": "src/contexts/klarna-categories-context.ts"
5802
5375
  }
5803
5376
  }
5804
5377
  ]
5805
5378
  },
5806
5379
  {
5807
5380
  "kind": "javascript-module",
5808
- "path": "src/styles/theme-loader.ts",
5381
+ "path": "src/contexts/payment-manager-context.ts",
5809
5382
  "declarations": [
5810
5383
  {
5811
5384
  "kind": "variable",
5812
- "name": "LIGHT_THEME_ID",
5813
- "type": {
5814
- "text": "string"
5815
- },
5816
- "default": "'primer-light-theme-css'",
5385
+ "name": "paymentManagerContext"
5386
+ }
5387
+ ],
5388
+ "exports": [
5389
+ {
5390
+ "kind": "js",
5391
+ "name": "paymentManagerContext",
5392
+ "declaration": {
5393
+ "name": "paymentManagerContext",
5394
+ "module": "src/contexts/payment-manager-context.ts"
5395
+ }
5396
+ }
5397
+ ]
5398
+ },
5399
+ {
5400
+ "kind": "javascript-module",
5401
+ "path": "src/contexts/payment-methods-context.ts",
5402
+ "declarations": [
5403
+ {
5404
+ "kind": "variable",
5405
+ "name": "paymentMethodsContext"
5406
+ }
5407
+ ],
5408
+ "exports": [
5409
+ {
5410
+ "kind": "js",
5411
+ "name": "paymentMethodsContext",
5412
+ "declaration": {
5413
+ "name": "paymentMethodsContext",
5414
+ "module": "src/contexts/payment-methods-context.ts"
5415
+ }
5416
+ }
5417
+ ]
5418
+ },
5419
+ {
5420
+ "kind": "javascript-module",
5421
+ "path": "src/contexts/payments-objects.ts",
5422
+ "declarations": [
5423
+ {
5424
+ "kind": "class",
5425
+ "description": "",
5426
+ "name": "InitializedPayments",
5427
+ "members": [
5428
+ {
5429
+ "kind": "field",
5430
+ "name": "_methods",
5431
+ "type": {
5432
+ "text": "InitializedPaymentMethodMap"
5433
+ },
5434
+ "privacy": "private",
5435
+ "readonly": true,
5436
+ "default": "map"
5437
+ },
5438
+ {
5439
+ "kind": "method",
5440
+ "name": "get",
5441
+ "return": {
5442
+ "type": {
5443
+ "text": "RedirectPaymentMethod | undefined"
5444
+ }
5445
+ },
5446
+ "parameters": [
5447
+ {
5448
+ "name": "type",
5449
+ "type": {
5450
+ "text": "T"
5451
+ }
5452
+ }
5453
+ ]
5454
+ },
5455
+ {
5456
+ "kind": "method",
5457
+ "name": "get",
5458
+ "return": {
5459
+ "type": {
5460
+ "text": "PaymentMethodByType<T> | undefined"
5461
+ }
5462
+ },
5463
+ "parameters": [
5464
+ {
5465
+ "name": "type",
5466
+ "type": {
5467
+ "text": "T"
5468
+ }
5469
+ }
5470
+ ]
5471
+ },
5472
+ {
5473
+ "kind": "method",
5474
+ "name": "get",
5475
+ "parameters": [
5476
+ {
5477
+ "name": "type",
5478
+ "type": {
5479
+ "text": "T"
5480
+ }
5481
+ }
5482
+ ]
5483
+ },
5484
+ {
5485
+ "kind": "method",
5486
+ "name": "toArray",
5487
+ "return": {
5488
+ "type": {
5489
+ "text": "InitializedPaymentMethod[]"
5490
+ }
5491
+ }
5492
+ },
5493
+ {
5494
+ "kind": "method",
5495
+ "name": "size",
5496
+ "return": {
5497
+ "type": {
5498
+ "text": "number"
5499
+ }
5500
+ }
5501
+ }
5502
+ ]
5503
+ },
5504
+ {
5505
+ "kind": "class",
5506
+ "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.",
5507
+ "name": "InitializedVaultedPayments",
5508
+ "members": [
5509
+ {
5510
+ "kind": "field",
5511
+ "name": "_methods",
5512
+ "type": {
5513
+ "text": "VaultedPaymentMethodsMap"
5514
+ },
5515
+ "privacy": "private",
5516
+ "readonly": true,
5517
+ "default": "map"
5518
+ },
5519
+ {
5520
+ "kind": "method",
5521
+ "name": "get",
5522
+ "return": {
5523
+ "type": {
5524
+ "text": ""
5525
+ }
5526
+ },
5527
+ "parameters": [
5528
+ {
5529
+ "name": "id",
5530
+ "type": {
5531
+ "text": "string"
5532
+ },
5533
+ "description": "Payment method ID"
5534
+ }
5535
+ ],
5536
+ "description": "Get a vaulted payment method by its ID"
5537
+ },
5538
+ {
5539
+ "kind": "method",
5540
+ "name": "toArray",
5541
+ "return": {
5542
+ "type": {
5543
+ "text": ""
5544
+ }
5545
+ },
5546
+ "description": "Get all vaulted payment methods as an array"
5547
+ },
5548
+ {
5549
+ "kind": "method",
5550
+ "name": "size",
5551
+ "return": {
5552
+ "type": {
5553
+ "text": ""
5554
+ }
5555
+ },
5556
+ "description": "Get the count of vaulted payment methods"
5557
+ }
5558
+ ]
5559
+ }
5560
+ ],
5561
+ "exports": [
5562
+ {
5563
+ "kind": "js",
5564
+ "name": "VaultedPaymentMethodSummary",
5565
+ "declaration": {
5566
+ "name": "VaultedPaymentMethodSummary",
5567
+ "module": "src/contexts/payments-objects.ts"
5568
+ }
5569
+ },
5570
+ {
5571
+ "kind": "js",
5572
+ "name": "InitializedPayments",
5573
+ "declaration": {
5574
+ "name": "InitializedPayments",
5575
+ "module": "src/contexts/payments-objects.ts"
5576
+ }
5577
+ },
5578
+ {
5579
+ "kind": "js",
5580
+ "name": "InitializedVaultedPayments",
5581
+ "declaration": {
5582
+ "name": "InitializedVaultedPayments",
5583
+ "module": "src/contexts/payments-objects.ts"
5584
+ }
5585
+ }
5586
+ ]
5587
+ },
5588
+ {
5589
+ "kind": "javascript-module",
5590
+ "path": "src/contexts/sdk-state-context.ts",
5591
+ "declarations": [
5592
+ {
5593
+ "kind": "variable",
5594
+ "name": "sdkStateContext"
5595
+ }
5596
+ ],
5597
+ "exports": [
5598
+ {
5599
+ "kind": "js",
5600
+ "name": "sdkStateContext",
5601
+ "declaration": {
5602
+ "name": "sdkStateContext",
5603
+ "module": "src/contexts/sdk-state-context.ts"
5604
+ }
5605
+ }
5606
+ ]
5607
+ },
5608
+ {
5609
+ "kind": "javascript-module",
5610
+ "path": "src/contexts/types.ts",
5611
+ "declarations": [],
5612
+ "exports": []
5613
+ },
5614
+ {
5615
+ "kind": "javascript-module",
5616
+ "path": "src/contexts/vault-item-context.ts",
5617
+ "declarations": [
5618
+ {
5619
+ "kind": "variable",
5620
+ "name": "vaultItemContext"
5621
+ }
5622
+ ],
5623
+ "exports": [
5624
+ {
5625
+ "kind": "js",
5626
+ "name": "vaultItemContext",
5627
+ "declaration": {
5628
+ "name": "vaultItemContext",
5629
+ "module": "src/contexts/vault-item-context.ts"
5630
+ }
5631
+ }
5632
+ ]
5633
+ },
5634
+ {
5635
+ "kind": "javascript-module",
5636
+ "path": "src/contexts/vault-manager-context.ts",
5637
+ "declarations": [
5638
+ {
5639
+ "kind": "variable",
5640
+ "name": "vaultManagerContext"
5641
+ }
5642
+ ],
5643
+ "exports": [
5644
+ {
5645
+ "kind": "js",
5646
+ "name": "vaultManagerContext",
5647
+ "declaration": {
5648
+ "name": "vaultManagerContext",
5649
+ "module": "src/contexts/vault-manager-context.ts"
5650
+ }
5651
+ }
5652
+ ]
5653
+ },
5654
+ {
5655
+ "kind": "javascript-module",
5656
+ "path": "src/services/primer-dialog-provider.ts",
5657
+ "declarations": [
5658
+ {
5659
+ "kind": "class",
5660
+ "description": "Primer-js DialogProvider implementation using existing PortalDialogComponent",
5661
+ "name": "PrimerDialogProvider",
5662
+ "members": [
5663
+ {
5664
+ "kind": "field",
5665
+ "name": "currentDialog",
5666
+ "type": {
5667
+ "text": "PortalDialogComponent | null"
5668
+ },
5669
+ "privacy": "private",
5670
+ "default": "null"
5671
+ },
5672
+ {
5673
+ "kind": "field",
5674
+ "name": "currentResolver",
5675
+ "type": {
5676
+ "text": "((result: DialogResult) => void) | null"
5677
+ },
5678
+ "privacy": "private",
5679
+ "default": "null"
5680
+ },
5681
+ {
5682
+ "kind": "method",
5683
+ "name": "show",
5684
+ "return": {
5685
+ "type": {
5686
+ "text": "Promise<DialogResult>"
5687
+ }
5688
+ },
5689
+ "parameters": [
5690
+ {
5691
+ "name": "request",
5692
+ "type": {
5693
+ "text": "DialogRequest"
5694
+ }
5695
+ }
5696
+ ]
5697
+ },
5698
+ {
5699
+ "kind": "method",
5700
+ "name": "close",
5701
+ "return": {
5702
+ "type": {
5703
+ "text": "void"
5704
+ }
5705
+ }
5706
+ }
5707
+ ]
5708
+ }
5709
+ ],
5710
+ "exports": [
5711
+ {
5712
+ "kind": "js",
5713
+ "name": "PrimerDialogProvider",
5714
+ "declaration": {
5715
+ "name": "PrimerDialogProvider",
5716
+ "module": "src/services/primer-dialog-provider.ts"
5717
+ }
5718
+ }
5719
+ ]
5720
+ },
5721
+ {
5722
+ "kind": "javascript-module",
5723
+ "path": "src/styles/base.styles.ts",
5724
+ "declarations": [
5725
+ {
5726
+ "kind": "variable",
5727
+ "name": "base",
5728
+ "default": "css` * { box-sizing: border-box; } `"
5729
+ },
5730
+ {
5731
+ "kind": "variable",
5732
+ "name": "primerCheckout",
5733
+ "default": "css` :host { display: block; isolation: isolate; position: relative; width: 100%; //Keep the CSS loader in the same position - check css-loader-inline.ts min-height: 64px; } `"
5734
+ }
5735
+ ],
5736
+ "exports": [
5737
+ {
5738
+ "kind": "js",
5739
+ "name": "base",
5740
+ "declaration": {
5741
+ "name": "base",
5742
+ "module": "src/styles/base.styles.ts"
5743
+ }
5744
+ },
5745
+ {
5746
+ "kind": "js",
5747
+ "name": "primerCheckout",
5748
+ "declaration": {
5749
+ "name": "primerCheckout",
5750
+ "module": "src/styles/base.styles.ts"
5751
+ }
5752
+ }
5753
+ ]
5754
+ },
5755
+ {
5756
+ "kind": "javascript-module",
5757
+ "path": "src/styles/css-loader-inline.ts",
5758
+ "declarations": [
5759
+ {
5760
+ "kind": "variable",
5761
+ "name": "cssLoaderStyles",
5762
+ "default": "` @keyframes primer-css-spinner-rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } primer-checkout:has(:not(:defined)) > * { visibility: hidden; } primer-checkout:not([js-initialized]) { display: block; position: relative; width: 100%; min-height: 64px; } primer-checkout:not([js-initialized]):not([loader-disabled])::after { content: \"\"; display: block; box-sizing: border-box; position: absolute; inset: 0; margin: auto; width: var(--primer-size-xlarge); height: var(--primer-size-xlarge); border-radius: 50%; border: 3px solid #f5f5f5; border-top-color: var(--primer-color-loader); animation: primer-css-spinner-rotate 1.2s linear infinite; z-index: 9999; } `",
5763
+ "description": "This module exports the CSS loader styles as a string for inline injection.\nThese styles are injected into the page before any JavaScript loads,\nensuring the loading indicator appears immediately."
5764
+ }
5765
+ ],
5766
+ "exports": [
5767
+ {
5768
+ "kind": "js",
5769
+ "name": "cssLoaderStyles",
5770
+ "declaration": {
5771
+ "name": "cssLoaderStyles",
5772
+ "module": "src/styles/css-loader-inline.ts"
5773
+ }
5774
+ }
5775
+ ]
5776
+ },
5777
+ {
5778
+ "kind": "javascript-module",
5779
+ "path": "src/styles/styles.ts",
5780
+ "declarations": [
5781
+ {
5782
+ "kind": "function",
5783
+ "name": "injectLoaderStyles",
5784
+ "return": {
5785
+ "type": {
5786
+ "text": "void"
5787
+ }
5788
+ },
5789
+ "description": "Injects the CSS loader styles into the page\nThese styles display a loading indicator before JavaScript initializes\n\nUnlike theme styles, loader styles should take precedence over merchant styles\nto ensure the loading indicator is visible. We append them to the end of the head."
5790
+ },
5791
+ {
5792
+ "kind": "function",
5793
+ "name": "injectThemeStyles",
5794
+ "return": {
5795
+ "type": {
5796
+ "text": "void"
5797
+ }
5798
+ },
5799
+ "description": "Injects all required theme CSS variables into the page\nThis should be called before components are rendered to ensure\nthey have access to all design tokens\n\nTheme styles are prepended to the document head to allow merchant styles\nto override our default variables."
5800
+ },
5801
+ {
5802
+ "kind": "function",
5803
+ "name": "injectLightTheme",
5804
+ "return": {
5805
+ "type": {
5806
+ "text": "void"
5807
+ }
5808
+ },
5809
+ "description": "Utility function to inject only the light theme CSS variables"
5810
+ },
5811
+ {
5812
+ "kind": "function",
5813
+ "name": "injectDarkTheme",
5814
+ "return": {
5815
+ "type": {
5816
+ "text": "void"
5817
+ }
5818
+ },
5819
+ "description": "Utility function to inject only the dark theme CSS variables"
5820
+ }
5821
+ ],
5822
+ "exports": [
5823
+ {
5824
+ "kind": "js",
5825
+ "name": "injectLoaderStyles",
5826
+ "declaration": {
5827
+ "name": "injectLoaderStyles",
5828
+ "module": "src/styles/styles.ts"
5829
+ }
5830
+ },
5831
+ {
5832
+ "kind": "js",
5833
+ "name": "injectThemeStyles",
5834
+ "declaration": {
5835
+ "name": "injectThemeStyles",
5836
+ "module": "src/styles/styles.ts"
5837
+ }
5838
+ },
5839
+ {
5840
+ "kind": "js",
5841
+ "name": "injectLightTheme",
5842
+ "declaration": {
5843
+ "name": "injectLightTheme",
5844
+ "module": "src/styles/styles.ts"
5845
+ }
5846
+ },
5847
+ {
5848
+ "kind": "js",
5849
+ "name": "injectDarkTheme",
5850
+ "declaration": {
5851
+ "name": "injectDarkTheme",
5852
+ "module": "src/styles/styles.ts"
5853
+ }
5854
+ }
5855
+ ]
5856
+ },
5857
+ {
5858
+ "kind": "javascript-module",
5859
+ "path": "src/styles/theme-loader.ts",
5860
+ "declarations": [
5861
+ {
5862
+ "kind": "variable",
5863
+ "name": "LIGHT_THEME_ID",
5864
+ "type": {
5865
+ "text": "string"
5866
+ },
5867
+ "default": "'primer-light-theme-css'",
5817
5868
  "description": "ID for the light theme CSS element in the DOM"
5818
5869
  },
5819
5870
  {
@@ -7041,6 +7092,48 @@
7041
7092
  }
7042
7093
  ]
7043
7094
  },
7095
+ {
7096
+ "kind": "javascript-module",
7097
+ "path": "e2e/tests/sdkcore-false-tests/card-3ds.spec.ts",
7098
+ "declarations": [],
7099
+ "exports": []
7100
+ },
7101
+ {
7102
+ "kind": "javascript-module",
7103
+ "path": "e2e/tests/sdkcore-false-tests/card-basic.spec.ts",
7104
+ "declarations": [],
7105
+ "exports": []
7106
+ },
7107
+ {
7108
+ "kind": "javascript-module",
7109
+ "path": "e2e/tests/sdkcore-false-tests/disabled-payments.spec.ts",
7110
+ "declarations": [],
7111
+ "exports": []
7112
+ },
7113
+ {
7114
+ "kind": "javascript-module",
7115
+ "path": "e2e/tests/sdkcore-false-tests/klarna.spec.ts",
7116
+ "declarations": [],
7117
+ "exports": []
7118
+ },
7119
+ {
7120
+ "kind": "javascript-module",
7121
+ "path": "e2e/tests/sdkcore-false-tests/vaulted-paypal.spec.ts",
7122
+ "declarations": [],
7123
+ "exports": []
7124
+ },
7125
+ {
7126
+ "kind": "javascript-module",
7127
+ "path": "e2e/tests/sdkcore-true-tests/card-form-billing-address.spec.ts",
7128
+ "declarations": [],
7129
+ "exports": []
7130
+ },
7131
+ {
7132
+ "kind": "javascript-module",
7133
+ "path": "e2e/tests/sdkcore-true-tests/paypal.spec.ts",
7134
+ "declarations": [],
7135
+ "exports": []
7136
+ },
7044
7137
  {
7045
7138
  "kind": "javascript-module",
7046
7139
  "path": "e2e/mocks/sdkcore-false/card-3ds.ts",
@@ -7453,48 +7546,6 @@
7453
7546
  }
7454
7547
  ]
7455
7548
  },
7456
- {
7457
- "kind": "javascript-module",
7458
- "path": "e2e/tests/sdkcore-false-tests/card-3ds.spec.ts",
7459
- "declarations": [],
7460
- "exports": []
7461
- },
7462
- {
7463
- "kind": "javascript-module",
7464
- "path": "e2e/tests/sdkcore-false-tests/card-basic.spec.ts",
7465
- "declarations": [],
7466
- "exports": []
7467
- },
7468
- {
7469
- "kind": "javascript-module",
7470
- "path": "e2e/tests/sdkcore-false-tests/disabled-payments.spec.ts",
7471
- "declarations": [],
7472
- "exports": []
7473
- },
7474
- {
7475
- "kind": "javascript-module",
7476
- "path": "e2e/tests/sdkcore-false-tests/klarna.spec.ts",
7477
- "declarations": [],
7478
- "exports": []
7479
- },
7480
- {
7481
- "kind": "javascript-module",
7482
- "path": "e2e/tests/sdkcore-false-tests/vaulted-paypal.spec.ts",
7483
- "declarations": [],
7484
- "exports": []
7485
- },
7486
- {
7487
- "kind": "javascript-module",
7488
- "path": "e2e/tests/sdkcore-true-tests/card-form-billing-address.spec.ts",
7489
- "declarations": [],
7490
- "exports": []
7491
- },
7492
- {
7493
- "kind": "javascript-module",
7494
- "path": "e2e/tests/sdkcore-true-tests/paypal.spec.ts",
7495
- "declarations": [],
7496
- "exports": []
7497
- },
7498
7549
  {
7499
7550
  "kind": "javascript-module",
7500
7551
  "path": "src/__tests__/mocks/sdk-core.ts",
@@ -7747,91 +7798,259 @@
7747
7798
  "kind": "field",
7748
7799
  "name": "type",
7749
7800
  "type": {
7750
- "text": "'complete' | 'failure'"
7801
+ "text": "'complete' | 'failure'"
7802
+ },
7803
+ "default": "'complete'",
7804
+ "attribute": "type",
7805
+ "reflects": true
7806
+ },
7807
+ {
7808
+ "kind": "field",
7809
+ "name": "description",
7810
+ "type": {
7811
+ "text": "string | undefined"
7812
+ },
7813
+ "attribute": "description",
7814
+ "reflects": true
7815
+ }
7816
+ ],
7817
+ "attributes": [
7818
+ {
7819
+ "name": "type",
7820
+ "type": {
7821
+ "text": "'complete' | 'failure'"
7822
+ },
7823
+ "default": "'complete'",
7824
+ "fieldName": "type"
7825
+ },
7826
+ {
7827
+ "name": "description",
7828
+ "type": {
7829
+ "text": "string | undefined"
7830
+ },
7831
+ "fieldName": "description"
7832
+ }
7833
+ ],
7834
+ "superclass": {
7835
+ "name": "LitElement",
7836
+ "package": "lit"
7837
+ },
7838
+ "tagName": "primer-checkout-state",
7839
+ "customElement": true
7840
+ }
7841
+ ],
7842
+ "exports": [
7843
+ {
7844
+ "kind": "js",
7845
+ "name": "PrimerCheckoutStateComponent",
7846
+ "declaration": {
7847
+ "name": "PrimerCheckoutStateComponent",
7848
+ "module": "src/atoms/checkout-state/checkout-state.component.ts"
7849
+ }
7850
+ },
7851
+ {
7852
+ "kind": "custom-element-definition",
7853
+ "name": "primer-checkout-state",
7854
+ "declaration": {
7855
+ "name": "PrimerCheckoutStateComponent",
7856
+ "module": "src/atoms/checkout-state/checkout-state.component.ts"
7857
+ }
7858
+ }
7859
+ ]
7860
+ },
7861
+ {
7862
+ "kind": "javascript-module",
7863
+ "path": "src/atoms/checkout-state/checkout-state.styles.ts",
7864
+ "declarations": [],
7865
+ "exports": [
7866
+ {
7867
+ "kind": "js",
7868
+ "name": "default",
7869
+ "declaration": {
7870
+ "module": "src/atoms/checkout-state/checkout-state.styles.ts"
7871
+ }
7872
+ }
7873
+ ]
7874
+ },
7875
+ {
7876
+ "kind": "javascript-module",
7877
+ "path": "src/atoms/checkout-state/checkout-state.ts",
7878
+ "declarations": [],
7879
+ "exports": [
7880
+ {
7881
+ "kind": "js",
7882
+ "name": "PrimerCheckoutState",
7883
+ "declaration": {
7884
+ "name": "PrimerCheckoutStateComponent",
7885
+ "module": "src/atoms/checkout-state/checkout-state.ts"
7886
+ }
7887
+ }
7888
+ ]
7889
+ },
7890
+ {
7891
+ "kind": "javascript-module",
7892
+ "path": "src/atoms/dialog/dialog.component.ts",
7893
+ "declarations": [
7894
+ {
7895
+ "kind": "class",
7896
+ "description": "",
7897
+ "name": "DialogComponent",
7898
+ "members": [
7899
+ {
7900
+ "kind": "field",
7901
+ "name": "size",
7902
+ "type": {
7903
+ "text": "'flex' | 'large'"
7904
+ },
7905
+ "default": "'flex'",
7906
+ "attribute": "size"
7907
+ },
7908
+ {
7909
+ "kind": "field",
7910
+ "name": "showCloseButton",
7911
+ "type": {
7912
+ "text": "boolean"
7913
+ },
7914
+ "default": "true",
7915
+ "attribute": "showCloseButton"
7916
+ },
7917
+ {
7918
+ "kind": "field",
7919
+ "name": "_animationState",
7920
+ "type": {
7921
+ "text": "'entering' | 'entered' | 'exiting' | 'exited'"
7922
+ },
7923
+ "privacy": "private",
7924
+ "default": "'entering'"
7925
+ },
7926
+ {
7927
+ "kind": "field",
7928
+ "name": "_isVisible",
7929
+ "type": {
7930
+ "text": "boolean"
7931
+ },
7932
+ "privacy": "private",
7933
+ "default": "false"
7934
+ },
7935
+ {
7936
+ "kind": "field",
7937
+ "name": "_animationTimeout",
7938
+ "type": {
7939
+ "text": "number | undefined"
7751
7940
  },
7752
- "default": "'complete'",
7753
- "attribute": "type",
7754
- "reflects": true
7941
+ "privacy": "private"
7755
7942
  },
7756
7943
  {
7757
7944
  "kind": "field",
7758
- "name": "description",
7759
- "type": {
7760
- "text": "string | undefined"
7945
+ "name": "_handleCloseClick",
7946
+ "privacy": "private"
7947
+ },
7948
+ {
7949
+ "kind": "method",
7950
+ "name": "startExitAnimation",
7951
+ "privacy": "public",
7952
+ "return": {
7953
+ "type": {
7954
+ "text": "void"
7955
+ }
7761
7956
  },
7762
- "attribute": "description",
7763
- "reflects": true
7957
+ "description": "Public method to trigger exit animation programmatically"
7958
+ },
7959
+ {
7960
+ "kind": "method",
7961
+ "name": "_startEnterAnimation",
7962
+ "privacy": "private"
7963
+ },
7964
+ {
7965
+ "kind": "method",
7966
+ "name": "_startExitAnimation",
7967
+ "privacy": "private"
7968
+ }
7969
+ ],
7970
+ "events": [
7971
+ {
7972
+ "name": "primer:dialog-open",
7973
+ "type": {
7974
+ "text": "CustomEvent"
7975
+ }
7976
+ },
7977
+ {
7978
+ "name": "primer:dialog-close",
7979
+ "type": {
7980
+ "text": "CustomEvent"
7981
+ }
7764
7982
  }
7765
7983
  ],
7766
7984
  "attributes": [
7767
7985
  {
7768
- "name": "type",
7986
+ "name": "size",
7769
7987
  "type": {
7770
- "text": "'complete' | 'failure'"
7988
+ "text": "'flex' | 'large'"
7771
7989
  },
7772
- "default": "'complete'",
7773
- "fieldName": "type"
7990
+ "default": "'flex'",
7991
+ "fieldName": "size"
7774
7992
  },
7775
7993
  {
7776
- "name": "description",
7994
+ "name": "showCloseButton",
7777
7995
  "type": {
7778
- "text": "string | undefined"
7996
+ "text": "boolean"
7779
7997
  },
7780
- "fieldName": "description"
7998
+ "default": "true",
7999
+ "fieldName": "showCloseButton"
7781
8000
  }
7782
8001
  ],
7783
8002
  "superclass": {
7784
8003
  "name": "LitElement",
7785
8004
  "package": "lit"
7786
8005
  },
7787
- "tagName": "primer-checkout-state",
8006
+ "tagName": "primer-dialog",
7788
8007
  "customElement": true
7789
8008
  }
7790
8009
  ],
7791
8010
  "exports": [
7792
8011
  {
7793
8012
  "kind": "js",
7794
- "name": "PrimerCheckoutStateComponent",
8013
+ "name": "DialogComponent",
7795
8014
  "declaration": {
7796
- "name": "PrimerCheckoutStateComponent",
7797
- "module": "src/atoms/checkout-state/checkout-state.component.ts"
8015
+ "name": "DialogComponent",
8016
+ "module": "src/atoms/dialog/dialog.component.ts"
7798
8017
  }
7799
8018
  },
7800
8019
  {
7801
8020
  "kind": "custom-element-definition",
7802
- "name": "primer-checkout-state",
8021
+ "name": "primer-dialog",
7803
8022
  "declaration": {
7804
- "name": "PrimerCheckoutStateComponent",
7805
- "module": "src/atoms/checkout-state/checkout-state.component.ts"
8023
+ "name": "DialogComponent",
8024
+ "module": "src/atoms/dialog/dialog.component.ts"
7806
8025
  }
7807
8026
  }
7808
8027
  ]
7809
8028
  },
7810
8029
  {
7811
8030
  "kind": "javascript-module",
7812
- "path": "src/atoms/checkout-state/checkout-state.styles.ts",
8031
+ "path": "src/atoms/dialog/dialog.styles.ts",
7813
8032
  "declarations": [],
7814
8033
  "exports": [
7815
8034
  {
7816
8035
  "kind": "js",
7817
8036
  "name": "default",
7818
8037
  "declaration": {
7819
- "module": "src/atoms/checkout-state/checkout-state.styles.ts"
8038
+ "module": "src/atoms/dialog/dialog.styles.ts"
7820
8039
  }
7821
8040
  }
7822
8041
  ]
7823
8042
  },
7824
8043
  {
7825
8044
  "kind": "javascript-module",
7826
- "path": "src/atoms/checkout-state/checkout-state.ts",
8045
+ "path": "src/atoms/dialog/dialog.ts",
7827
8046
  "declarations": [],
7828
8047
  "exports": [
7829
8048
  {
7830
8049
  "kind": "js",
7831
- "name": "PrimerCheckoutState",
8050
+ "name": "Dialog",
7832
8051
  "declaration": {
7833
- "name": "PrimerCheckoutStateComponent",
7834
- "module": "src/atoms/checkout-state/checkout-state.ts"
8052
+ "name": "DialogComponent",
8053
+ "module": "src/atoms/dialog/dialog.ts"
7835
8054
  }
7836
8055
  }
7837
8056
  ]
@@ -8093,176 +8312,8 @@
8093
8312
  "kind": "js",
8094
8313
  "name": "ExpandedChangedDetail",
8095
8314
  "declaration": {
8096
- "name": "ExpandedChangedDetail",
8097
- "module": "src/atoms/collapsable/collapsable.ts"
8098
- }
8099
- }
8100
- ]
8101
- },
8102
- {
8103
- "kind": "javascript-module",
8104
- "path": "src/atoms/dialog/dialog.component.ts",
8105
- "declarations": [
8106
- {
8107
- "kind": "class",
8108
- "description": "",
8109
- "name": "DialogComponent",
8110
- "members": [
8111
- {
8112
- "kind": "field",
8113
- "name": "size",
8114
- "type": {
8115
- "text": "'flex' | 'large'"
8116
- },
8117
- "default": "'flex'",
8118
- "attribute": "size"
8119
- },
8120
- {
8121
- "kind": "field",
8122
- "name": "showCloseButton",
8123
- "type": {
8124
- "text": "boolean"
8125
- },
8126
- "default": "true",
8127
- "attribute": "showCloseButton"
8128
- },
8129
- {
8130
- "kind": "field",
8131
- "name": "_animationState",
8132
- "type": {
8133
- "text": "'entering' | 'entered' | 'exiting' | 'exited'"
8134
- },
8135
- "privacy": "private",
8136
- "default": "'entering'"
8137
- },
8138
- {
8139
- "kind": "field",
8140
- "name": "_isVisible",
8141
- "type": {
8142
- "text": "boolean"
8143
- },
8144
- "privacy": "private",
8145
- "default": "false"
8146
- },
8147
- {
8148
- "kind": "field",
8149
- "name": "_animationTimeout",
8150
- "type": {
8151
- "text": "number | undefined"
8152
- },
8153
- "privacy": "private"
8154
- },
8155
- {
8156
- "kind": "field",
8157
- "name": "_handleCloseClick",
8158
- "privacy": "private"
8159
- },
8160
- {
8161
- "kind": "method",
8162
- "name": "startExitAnimation",
8163
- "privacy": "public",
8164
- "return": {
8165
- "type": {
8166
- "text": "void"
8167
- }
8168
- },
8169
- "description": "Public method to trigger exit animation programmatically"
8170
- },
8171
- {
8172
- "kind": "method",
8173
- "name": "_startEnterAnimation",
8174
- "privacy": "private"
8175
- },
8176
- {
8177
- "kind": "method",
8178
- "name": "_startExitAnimation",
8179
- "privacy": "private"
8180
- }
8181
- ],
8182
- "events": [
8183
- {
8184
- "name": "primer:dialog-open",
8185
- "type": {
8186
- "text": "CustomEvent"
8187
- }
8188
- },
8189
- {
8190
- "name": "primer:dialog-close",
8191
- "type": {
8192
- "text": "CustomEvent"
8193
- }
8194
- }
8195
- ],
8196
- "attributes": [
8197
- {
8198
- "name": "size",
8199
- "type": {
8200
- "text": "'flex' | 'large'"
8201
- },
8202
- "default": "'flex'",
8203
- "fieldName": "size"
8204
- },
8205
- {
8206
- "name": "showCloseButton",
8207
- "type": {
8208
- "text": "boolean"
8209
- },
8210
- "default": "true",
8211
- "fieldName": "showCloseButton"
8212
- }
8213
- ],
8214
- "superclass": {
8215
- "name": "LitElement",
8216
- "package": "lit"
8217
- },
8218
- "tagName": "primer-dialog",
8219
- "customElement": true
8220
- }
8221
- ],
8222
- "exports": [
8223
- {
8224
- "kind": "js",
8225
- "name": "DialogComponent",
8226
- "declaration": {
8227
- "name": "DialogComponent",
8228
- "module": "src/atoms/dialog/dialog.component.ts"
8229
- }
8230
- },
8231
- {
8232
- "kind": "custom-element-definition",
8233
- "name": "primer-dialog",
8234
- "declaration": {
8235
- "name": "DialogComponent",
8236
- "module": "src/atoms/dialog/dialog.component.ts"
8237
- }
8238
- }
8239
- ]
8240
- },
8241
- {
8242
- "kind": "javascript-module",
8243
- "path": "src/atoms/dialog/dialog.styles.ts",
8244
- "declarations": [],
8245
- "exports": [
8246
- {
8247
- "kind": "js",
8248
- "name": "default",
8249
- "declaration": {
8250
- "module": "src/atoms/dialog/dialog.styles.ts"
8251
- }
8252
- }
8253
- ]
8254
- },
8255
- {
8256
- "kind": "javascript-module",
8257
- "path": "src/atoms/dialog/dialog.ts",
8258
- "declarations": [],
8259
- "exports": [
8260
- {
8261
- "kind": "js",
8262
- "name": "Dialog",
8263
- "declaration": {
8264
- "name": "DialogComponent",
8265
- "module": "src/atoms/dialog/dialog.ts"
8315
+ "name": "ExpandedChangedDetail",
8316
+ "module": "src/atoms/collapsable/collapsable.ts"
8266
8317
  }
8267
8318
  }
8268
8319
  ]
@@ -10908,42 +10959,21 @@
10908
10959
  },
10909
10960
  {
10910
10961
  "kind": "javascript-module",
10911
- "path": "src/containers/card-form/card-form-context.ts",
10912
- "declarations": [
10913
- {
10914
- "kind": "variable",
10915
- "name": "cardFormContext"
10916
- }
10917
- ],
10918
- "exports": [
10919
- {
10920
- "kind": "js",
10921
- "name": "cardFormContext",
10922
- "declaration": {
10923
- "name": "cardFormContext",
10924
- "module": "src/containers/card-form/card-form-context.ts"
10925
- }
10926
- }
10927
- ]
10928
- },
10929
- {
10930
- "kind": "javascript-module",
10931
- "path": "src/containers/card-form/card-form.component.ts",
10962
+ "path": "src/containers/blik/blik.component.ts",
10932
10963
  "declarations": [
10933
10964
  {
10934
10965
  "kind": "class",
10935
- "description": "CardFormComponent serves as a container for card input components.\nIt handles form submission, validation, and provides context to child components.",
10936
- "name": "CardFormComponent",
10966
+ "description": "BLIK Payment Component\n\nConsolidated component handling BLIK payment flow from button click through\npayment completion. Uses a 4-state machine for managing the user experience.",
10967
+ "name": "BlikComponent",
10937
10968
  "members": [
10938
10969
  {
10939
10970
  "kind": "field",
10940
- "name": "hideLabels",
10971
+ "name": "paymentMethod",
10941
10972
  "type": {
10942
- "text": "boolean"
10973
+ "text": "InitializedPaymentMethod"
10943
10974
  },
10944
- "default": "false",
10945
- "attribute": "hide-labels",
10946
- "reflects": true
10975
+ "description": "Payment method configuration",
10976
+ "attribute": "paymentMethod"
10947
10977
  },
10948
10978
  {
10949
10979
  "kind": "field",
@@ -10952,296 +10982,200 @@
10952
10982
  "text": "boolean"
10953
10983
  },
10954
10984
  "default": "false",
10985
+ "description": "Disables component interaction when true",
10955
10986
  "attribute": "disabled"
10956
10987
  },
10957
10988
  {
10958
10989
  "kind": "field",
10959
- "name": "hasAssignedContent",
10990
+ "name": "paymentManagers",
10960
10991
  "type": {
10961
- "text": "boolean"
10992
+ "text": "InitializedManagersMap"
10962
10993
  },
10963
- "privacy": "private",
10964
- "default": "false",
10965
- "description": "Tracks whether custom content has been provided via slot"
10994
+ "default": "new Map()"
10966
10995
  },
10967
10996
  {
10968
10997
  "kind": "field",
10969
- "name": "selectedCardNetwork",
10998
+ "name": "currentState",
10970
10999
  "type": {
10971
- "text": "string | null"
11000
+ "text": "BlikState"
10972
11001
  },
10973
11002
  "privacy": "private",
10974
- "default": "null"
11003
+ "default": "'collapsed'"
10975
11004
  },
10976
11005
  {
10977
11006
  "kind": "field",
10978
- "name": "formErrorMessage",
11007
+ "name": "blikCode",
10979
11008
  "type": {
10980
- "text": "string | null"
11009
+ "text": "string"
10981
11010
  },
10982
11011
  "privacy": "private",
10983
- "default": "null",
10984
- "description": "Form-level error message to display"
11012
+ "default": "''"
10985
11013
  },
10986
11014
  {
10987
11015
  "kind": "field",
10988
- "name": "paymentMethodSelectionSent",
11016
+ "name": "errorMessage",
10989
11017
  "type": {
10990
- "text": "boolean"
11018
+ "text": "string"
10991
11019
  },
10992
11020
  "privacy": "private",
10993
- "default": "false",
10994
- "description": "Flag to track if PAYMENT_METHOD_SELECTION event has been sent"
10995
- },
10996
- {
10997
- "kind": "field",
10998
- "name": "paymentManagers",
10999
- "type": {
11000
- "text": "InitializedManagersMap"
11001
- },
11002
- "default": "new Map()",
11003
- "description": "Payment managers injected from context",
11004
- "attribute": "paymentManagers"
11005
- },
11006
- {
11007
- "kind": "field",
11008
- "name": "clientOptions",
11009
- "type": {
11010
- "text": "ClientOptionsContextType"
11011
- },
11012
- "default": "null",
11013
- "description": "Client options for configuration"
11014
- },
11015
- {
11016
- "kind": "field",
11017
- "name": "headlessUtils",
11018
- "type": {
11019
- "text": "HeadlessUtilsContextType"
11020
- },
11021
- "default": "null",
11022
- "description": "Headless utils for accessing server configuration"
11023
- },
11024
- {
11025
- "kind": "field",
11026
- "name": "analyticsUtils",
11027
- "type": {
11028
- "text": "AnalyticsContextType"
11029
- },
11030
- "default": "null",
11031
- "description": "Analytics utils for sending analytics events"
11021
+ "default": "''"
11032
11022
  },
11033
11023
  {
11034
11024
  "kind": "field",
11035
- "name": "contextEventsController",
11025
+ "name": "pollingDuration",
11036
11026
  "type": {
11037
- "text": "EventsContextType"
11027
+ "text": "number"
11038
11028
  },
11039
- "default": "null",
11040
- "description": "Events controller from context for receiving forwarded events"
11041
- },
11042
- {
11043
- "kind": "field",
11044
- "name": "cardFormProvider",
11045
11029
  "privacy": "private",
11046
- "readonly": true,
11047
- "default": "new ContextProvider(this, { context: cardFormContext, initialValue: null, })",
11048
- "description": "Context provider for card form data"
11049
- },
11050
- {
11051
- "kind": "field",
11052
- "name": "shouldShowCardholderName",
11053
- "type": {
11054
- "text": "boolean"
11055
- },
11056
- "description": "Determines whether to show the cardholder name field\nUses client configuration with fallback to default (true)",
11057
- "readonly": true
11030
+ "default": "0"
11058
11031
  },
11059
11032
  {
11060
11033
  "kind": "field",
11061
- "name": "shouldRequireCardholderName",
11034
+ "name": "pollingTimer",
11062
11035
  "type": {
11063
- "text": "boolean"
11036
+ "text": "number | null"
11064
11037
  },
11065
- "description": "Determines whether the cardholder name field is required\nUses client configuration with fallback to default (false)",
11066
- "readonly": true
11038
+ "privacy": "private",
11039
+ "default": "null"
11067
11040
  },
11068
11041
  {
11069
11042
  "kind": "field",
11070
- "name": "eventsController",
11043
+ "name": "loadManagerTask",
11071
11044
  "privacy": "private",
11072
- "readonly": true,
11073
- "default": "new PrimerEventsController(this)",
11074
- "description": "Events controller for dispatching form events"
11045
+ "default": "new Task(this, { args: () => [this.paymentMethod?.type], task: ([type]) => { if (!type) { return initialState; } const managerEntry = this.paymentManagers.get(type); if (!managerEntry) { throw new Error('BLIK payment method manager not initialized'); } // TypeScript narrows the union type based on the payment method type check if (managerEntry.type !== 'ADYEN_BLIK') { throw new Error('Invalid payment method type for BLIK component'); } return managerEntry.manager; }, })",
11046
+ "description": "Manager loading task\nValidates BLIK manager exists before allowing payment flow\n\nThis Task provides reactive validation of manager availability:\n- Automatically re-runs when paymentMethod or paymentManagers change\n- Provides type-safe access to the BLIK manager\n- Enables early error detection before user interaction\n\nUnlike native payment methods (Apple Pay, Google Pay, PayPal) which use a\ntwo-task pattern (manager loading + button rendering), BLIK only needs the\nmanager loading task because it renders its own UI via Lit templates."
11075
11047
  },
11076
11048
  {
11077
11049
  "kind": "field",
11078
- "name": "_contextCardSubmitListener",
11079
- "type": {
11080
- "text": "((event: CustomEvent) => void) | null"
11081
- },
11050
+ "name": "handleButtonClick",
11082
11051
  "privacy": "private",
11083
- "default": "null",
11084
- "description": "External event listener reference for cleanup"
11052
+ "description": "Handles button click to toggle between collapsed and expanded states"
11085
11053
  },
11086
11054
  {
11087
11055
  "kind": "field",
11088
- "name": "_isHandlingContextEvent",
11089
- "type": {
11090
- "text": "boolean"
11091
- },
11056
+ "name": "handleCollapse",
11092
11057
  "privacy": "private",
11093
- "default": "false",
11094
- "description": "Flag to prevent circular event loop when handling events"
11058
+ "description": "Handles collapsing the form back to button-only view\nResets form state when user clicks button to collapse"
11095
11059
  },
11096
11060
  {
11097
11061
  "kind": "field",
11098
- "name": "inputControllers",
11062
+ "name": "handleInput",
11099
11063
  "privacy": "private",
11100
- "readonly": true,
11101
- "default": "new Map< HostedInputType, IHostedInputController >()",
11102
- "description": "Registry for input controllers to enable context-driven meta state management"
11064
+ "description": "Handles input changes, validates numeric input, and auto-submits on 6 digits"
11103
11065
  },
11104
11066
  {
11105
11067
  "kind": "field",
11106
- "name": "setupCardFormTask",
11068
+ "name": "handleRetry",
11107
11069
  "privacy": "private",
11108
- "readonly": true,
11109
- "default": "new Task(this, { task: ([cardManager]) => { if (!cardManager?.manager) return initialState; const { manager } = cardManager; const hostedInputs = manager.createHostedInputs(); const { cardNumberInput, expiryInput, cvvInput } = hostedInputs; this.cardFormProvider.setValue({ // Temporarily set any so we can toggle between sdk v2 and new sdk core cardholderNameInput: ( hostedInputs as { cardholderNameInput?: IHeadlessHostedInput } ).cardholderNameInput, cardNumberInput, expiryInput, cvvInput, setCardholderName: (val: string) => { manager.setCardholderName(val); if (this.shouldRequireCardholderName) { manager.validate?.().then((validationResult) => { const errors = validationResult?.validationErrors; const cardholderNameError = errors?.find( (error) => error.name === fieldToInputType.cardholderName, ); const controller = this.inputControllers.get( HostedInputType.CARD_HOLDER_NAME, ); if (controller) { controller.updateMetaFromValidation({ valid: false, error: cardholderNameError?.message || cardholderNameError?.error || null, errorCode: cardholderNameError?.message || cardholderNameError?.error || null, }); } }); } }, setCardNetwork: (val: string) => { this.selectedCardNetwork = val; }, validate: () => manager.validate(), submit: (args) => manager.submit(args), hideLabels: this.hideLabels, disabled: this.disabled, // New meta state management methods setSubmissionState: (submitted: boolean) => { this.inputControllers.forEach((controller) => { controller.setSubmitted(submitted); }); }, propagateValidationErrors: (errors: InputValidationError[]) => { if (!errors) return; errors.forEach((error) => { const fieldName = error.field || error.name; const errorMessage = error.message || error.error; const inputType = fieldToInputType[fieldName]; if (inputType) { const controller = this.inputControllers.get(inputType); if (controller) { const updateData = { valid: false, error: errorMessage, errorCode: errorMessage, // Use error message (localization key) instead of field name }; controller.updateMetaFromValidation(updateData); } } }); }, registerInputController: ( inputType: HostedInputType, controller: IHostedInputController, ) => { this.inputControllers.set(inputType, controller); }, unregisterInputController: (inputType: HostedInputType) => { this.inputControllers.delete(inputType); }, onUserInteraction: () => { this.sendPaymentMethodSelectionEvent(); this.checkAndSendPaymentDetailsEnteredEvent(); }, }); return true; }, args: () => [this.paymentManagers.get('PAYMENT_CARD')], })",
11110
- "description": "Task to set up the card form with hosted inputs"
11070
+ "description": "Handles retry button click"
11111
11071
  },
11112
11072
  {
11113
11073
  "kind": "method",
11114
- "name": "sendPaymentMethodSelectionEvent",
11074
+ "name": "startPollingTimer",
11115
11075
  "privacy": "private",
11116
11076
  "return": {
11117
11077
  "type": {
11118
11078
  "text": "void"
11119
11079
  }
11120
11080
  },
11121
- "description": "Sends PAYMENT_METHOD_SELECTION analytics event when user first interacts with card form"
11081
+ "description": "Starts polling timer to track payment duration"
11122
11082
  },
11123
11083
  {
11124
11084
  "kind": "method",
11125
- "name": "checkAndSendPaymentDetailsEnteredEvent",
11085
+ "name": "stopPollingTimer",
11126
11086
  "privacy": "private",
11127
11087
  "return": {
11128
11088
  "type": {
11129
11089
  "text": "void"
11130
11090
  }
11131
11091
  },
11132
- "description": "Checks if all required fields are filled and sends PAYMENT_DETAILS_ENTERED event"
11133
- },
11134
- {
11135
- "kind": "field",
11136
- "name": "paymentDetailsEnteredSent",
11137
- "type": {
11138
- "text": "boolean"
11139
- },
11140
- "privacy": "private",
11141
- "default": "false"
11092
+ "description": "Stops and resets polling timer"
11142
11093
  },
11143
11094
  {
11144
11095
  "kind": "method",
11145
- "name": "sendPaymentDetailsEnteredEvent",
11096
+ "name": "submitBlikCode",
11146
11097
  "privacy": "private",
11147
11098
  "return": {
11148
11099
  "type": {
11149
- "text": "void"
11100
+ "text": "Promise<void>"
11150
11101
  }
11151
11102
  },
11152
- "description": "Sends PAYMENT_DETAILS_ENTERED analytics event when all payment details are complete and valid"
11153
- },
11154
- {
11155
- "kind": "field",
11156
- "name": "handleSlotButtonClick",
11157
- "privacy": "private",
11158
- "description": "Handles click events from slotted content.\nSupports both native <button> and custom <primer-button> elements."
11159
- },
11160
- {
11161
- "kind": "field",
11162
- "name": "handleDirectSubmit",
11163
- "privacy": "private",
11164
- "description": "Handles direct submit events from child components\nThis is a backup method to catch all possible submission events"
11103
+ "description": "Validates and submits the BLIK code"
11165
11104
  },
11166
11105
  {
11167
11106
  "kind": "method",
11168
- "name": "setupContextEventListeners",
11107
+ "name": "renderCollapsed",
11169
11108
  "privacy": "private",
11170
11109
  "return": {
11171
11110
  "type": {
11172
- "text": "void"
11111
+ "text": "TemplateResult"
11173
11112
  }
11174
11113
  },
11175
- "description": "Sets up event listeners for context-forwarded events"
11114
+ "description": "Renders the collapsed button state"
11176
11115
  },
11177
11116
  {
11178
11117
  "kind": "method",
11179
- "name": "cleanupContextEventListeners",
11118
+ "name": "renderExpandedInput",
11180
11119
  "privacy": "private",
11181
11120
  "return": {
11182
11121
  "type": {
11183
- "text": "void"
11122
+ "text": "TemplateResult"
11184
11123
  }
11185
11124
  },
11186
- "description": "Cleans up context event listeners"
11187
- },
11188
- {
11189
- "kind": "field",
11190
- "name": "handleContextCardSubmit",
11191
- "privacy": "private",
11192
- "description": "Handles primer:card-submit events received from the events context\nThis allows the card form to respond to external submit triggers"
11125
+ "description": "Renders the expanded input state"
11193
11126
  },
11194
11127
  {
11195
11128
  "kind": "method",
11196
- "name": "isSubmitButton",
11129
+ "name": "renderLoading",
11197
11130
  "privacy": "private",
11198
11131
  "return": {
11199
11132
  "type": {
11200
- "text": "boolean"
11133
+ "text": "TemplateResult"
11201
11134
  }
11202
11135
  },
11203
- "parameters": [
11204
- {
11205
- "name": "button",
11206
- "type": {
11207
- "text": "HTMLElement"
11208
- }
11209
- }
11210
- ],
11211
- "description": "Determines if a button is a submit button based on its attributes"
11136
+ "description": "Renders the loading state"
11212
11137
  },
11213
11138
  {
11214
- "kind": "field",
11215
- "name": "onSlotChange",
11139
+ "kind": "method",
11140
+ "name": "renderError",
11216
11141
  "privacy": "private",
11217
- "description": "Handles slot change events to detect custom content"
11142
+ "return": {
11143
+ "type": {
11144
+ "text": "TemplateResult"
11145
+ }
11146
+ },
11147
+ "description": "Renders the error state"
11218
11148
  },
11219
11149
  {
11220
11150
  "kind": "method",
11221
- "name": "submitCardPayment",
11151
+ "name": "renderExpandedState",
11222
11152
  "privacy": "private",
11223
11153
  "return": {
11224
11154
  "type": {
11225
- "text": "Promise<void>"
11155
+ "text": "TemplateResult | typeof nothing"
11226
11156
  }
11227
11157
  },
11228
- "description": "Handles the card form submission.\nValidates the form and dispatches either a submit success or errors event."
11158
+ "description": "Renders the appropriate expanded state based on current state"
11159
+ }
11160
+ ],
11161
+ "events": [
11162
+ {
11163
+ "description": "Dispatched on successful payment",
11164
+ "name": "primer-payment-success"
11229
11165
  },
11230
11166
  {
11231
- "kind": "field",
11232
- "name": "handleFormSubmit",
11233
- "privacy": "private",
11234
- "description": "Event handler for form submission\nHandles both native form submissions and custom events"
11167
+ "description": "Dispatched on payment error",
11168
+ "name": "primer-payment-error"
11235
11169
  }
11236
11170
  ],
11237
11171
  "attributes": [
11238
11172
  {
11239
- "name": "hide-labels",
11173
+ "name": "paymentMethod",
11240
11174
  "type": {
11241
- "text": "boolean"
11175
+ "text": "InitializedPaymentMethod"
11242
11176
  },
11243
- "default": "false",
11244
- "fieldName": "hideLabels"
11177
+ "description": "Payment method configuration",
11178
+ "fieldName": "paymentMethod"
11245
11179
  },
11246
11180
  {
11247
11181
  "name": "disabled",
@@ -11249,145 +11183,111 @@
11249
11183
  "text": "boolean"
11250
11184
  },
11251
11185
  "default": "false",
11186
+ "description": "Disables component interaction when true",
11252
11187
  "fieldName": "disabled"
11253
- },
11254
- {
11255
- "name": "paymentManagers",
11256
- "type": {
11257
- "text": "InitializedManagersMap"
11258
- },
11259
- "default": "new Map()",
11260
- "description": "Payment managers injected from context",
11261
- "fieldName": "paymentManagers"
11262
11188
  }
11263
11189
  ],
11264
11190
  "superclass": {
11265
11191
  "name": "LitElement",
11266
11192
  "package": "lit"
11267
11193
  },
11268
- "tagName": "primer-card-form",
11194
+ "tagName": "primer-blik",
11269
11195
  "customElement": true
11270
11196
  }
11271
11197
  ],
11272
11198
  "exports": [
11273
11199
  {
11274
11200
  "kind": "js",
11275
- "name": "CardFormComponent",
11201
+ "name": "BlikComponent",
11276
11202
  "declaration": {
11277
- "name": "CardFormComponent",
11278
- "module": "src/containers/card-form/card-form.component.ts"
11203
+ "name": "BlikComponent",
11204
+ "module": "src/containers/blik/blik.component.ts"
11279
11205
  }
11280
11206
  },
11281
11207
  {
11282
11208
  "kind": "custom-element-definition",
11283
- "name": "primer-card-form",
11209
+ "name": "primer-blik",
11284
11210
  "declaration": {
11285
- "name": "CardFormComponent",
11286
- "module": "src/containers/card-form/card-form.component.ts"
11211
+ "name": "BlikComponent",
11212
+ "module": "src/containers/blik/blik.component.ts"
11287
11213
  }
11288
11214
  }
11289
11215
  ]
11290
11216
  },
11291
11217
  {
11292
11218
  "kind": "javascript-module",
11293
- "path": "src/containers/card-form/card-form.styles.ts",
11294
- "declarations": [],
11219
+ "path": "src/containers/blik/blik.styles.ts",
11220
+ "declarations": [
11221
+ {
11222
+ "kind": "variable",
11223
+ "name": "styles",
11224
+ "default": "css` :host { display: flex; width: 100%; } .blik-container { width: 100%; display: flex; flex-direction: column; transition: all var(--primer-animation-duration) var(--primer-animation-easing); } .blik-container.expanded { border-radius: var(--primer-radius-medium); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); background-color: var(--primer-color-background-outlined-default); border: 1px solid var(--primer-color-border-outlined-default); padding: var(--primer-space-large); } /* Button styles (collapsed state) */ primer-button.blik-button { width: 100%; } /* Override primer-button part styles for BLIK branding */ primer-button.blik-button::part(button) { /* BLIK brand requirement: Black background (#000000) with white logo */ background-color: #000000; border: none; color: var(--primer-color-text-primary); padding: 2px; display: flex; align-items: center; justify-content: center; gap: var(--primer-space-small); /* Fixed height for button - matches redirect payment method calculation */ height: calc( ${unsafeCSS(PAYMENT_METHOD_LINE_HEIGHT)} + calc(2 * var(--primer-space-medium)) ); flex-shrink: 0; /* Prevent button from shrinking when form appears */ } /* Image container for button logo */ .image-container { display: flex; justify-content: center; align-items: center; min-width: 100px; height: 100%; flex-shrink: 0; flex-grow: 1; } /* Button logo */ img { max-width: 100px; width: 100%; height: auto; object-fit: cover; max-height: 98%; } /* Expanded content (form, loading, error states) */ .blik-expanded-content { width: 100%; display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--primer-animation-duration) var(--primer-animation-easing); overflow: hidden; margin-top: var(--primer-space-medium); } .blik-container.expanded .blik-expanded-content { grid-template-rows: 1fr; } .blik-content-wrapper { overflow: hidden; } /* Input wrapper */ .blik-input-wrapper { display: flex; flex-direction: column; gap: var(--primer-space-small); } /* Input label */ .blik-label { font-family: var(--primer-typography-body-medium-font); font-size: var(--primer-typography-body-medium-size); font-weight: var(--primer-typography-body-medium-weight); line-height: var(--primer-typography-body-medium-line-height); color: var(--primer-color-text-primary); } /* Input field */ .blik-input { width: 100%; padding: var(--primer-space-medium); font-family: var(--primer-typography-body-large-font); font-size: var(--primer-typography-body-large-size); font-weight: var(--primer-typography-body-large-weight); line-height: var(--primer-typography-body-large-line-height); /* Increase spacing between digits for better 6-digit code readability */ letter-spacing: 0.25em; text-align: center; color: var(--primer-color-text-primary); background-color: var(--primer-color-background-outlined-default); border: 1px solid var(--primer-color-border-outlined-default); border-radius: var(--primer-radius-medium); outline: none; transition: border-color var(--primer-animation-duration) var(--primer-animation-easing); } .blik-input::placeholder { color: var(--primer-color-text-secondary); /* Reduce placeholder visibility to emphasize user input */ opacity: 0.5; } .blik-input:focus { border-color: var(--primer-color-border-outlined-focus); } .blik-input:disabled { background-color: var(--primer-color-background-outlined-disabled); border-color: var(--primer-color-border-outlined-disabled); color: var(--primer-color-text-disabled); cursor: not-allowed; } /* Loading state */ .blik-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--primer-space-large); padding: var(--primer-space-xlarge) var(--primer-space-medium); } /* Timeout warning */ .blik-timeout-warning { margin-top: var(--primer-space-medium); padding: var(--primer-space-small); font-size: var(--primer-typography-body-small-size); color: var(--primer-color-text-warning); text-align: center; border-radius: var(--primer-radius-small); background-color: var(--primer-color-surface-warning); } /* Error state */ .blik-error { display: flex; flex-direction: column; align-items: center; gap: var(--primer-space-medium); } .blik-error-message { font-family: var(--primer-typography-body-medium-font); font-size: var(--primer-typography-body-medium-size); font-weight: var(--primer-typography-body-medium-weight); line-height: var(--primer-typography-body-medium-line-height); color: var(--primer-color-text-primary); text-align: center; } /* Retry button */ .blik-retry-button { padding: var(--primer-space-medium) var(--primer-space-large); font-family: var(--primer-typography-title-large-font); font-size: var(--primer-typography-title-large-size); font-weight: var(--primer-typography-title-large-weight); line-height: var(--primer-typography-title-large-line-height); color: var(--primer-color-background-outlined-default); background-color: var(--primer-color-brand); border: none; border-radius: var(--primer-radius-medium); cursor: pointer; outline: none; transition: filter var(--primer-animation-duration) var(--primer-animation-easing); } .blik-retry-button:hover:not(:disabled) { filter: brightness(105%); } .blik-retry-button:active:not(:disabled) { filter: brightness(98%); } .blik-retry-button:focus-visible { outline: 2px solid var(--primer-color-brand); outline-offset: 2px; } .blik-retry-button:disabled { background-color: var(--primer-color-background-outlined-disabled); color: var(--primer-color-text-disabled); cursor: not-allowed; } /* Disabled state styling */ :host([disabled]) { opacity: 0.6; cursor: not-allowed; } :host([disabled]) primer-button::part(button) { pointer-events: none; cursor: not-allowed; } :host([disabled]) img { filter: grayscale(100%); } /* Responsive typography for larger screens */ @media (min-width: 768px) { .blik-input { font-size: var(--primer-typography-title-large-size); } } `"
11225
+ }
11226
+ ],
11295
11227
  "exports": [
11296
11228
  {
11297
11229
  "kind": "js",
11298
- "name": "default",
11230
+ "name": "styles",
11299
11231
  "declaration": {
11300
- "module": "src/containers/card-form/card-form.styles.ts"
11232
+ "name": "styles",
11233
+ "module": "src/containers/blik/blik.styles.ts"
11301
11234
  }
11302
11235
  }
11303
11236
  ]
11304
11237
  },
11305
11238
  {
11306
11239
  "kind": "javascript-module",
11307
- "path": "src/containers/card-form/card-form.ts",
11240
+ "path": "src/containers/blik/blik.ts",
11308
11241
  "declarations": [],
11309
11242
  "exports": [
11310
11243
  {
11311
11244
  "kind": "js",
11312
- "name": "CardFormCardNumber",
11313
- "declaration": {
11314
- "name": "CardFormCardNumber",
11315
- "module": "./components"
11316
- }
11317
- },
11318
- {
11319
- "kind": "js",
11320
- "name": "CardFormCVV",
11321
- "declaration": {
11322
- "name": "CardFormCVV",
11323
- "module": "./components"
11324
- }
11325
- },
11326
- {
11327
- "kind": "js",
11328
- "name": "CardFormExpiry",
11329
- "declaration": {
11330
- "name": "CardFormExpiry",
11331
- "module": "./components"
11332
- }
11333
- },
11334
- {
11335
- "kind": "js",
11336
- "name": "CardFormName",
11337
- "declaration": {
11338
- "name": "CardFormName",
11339
- "module": "./components"
11340
- }
11341
- },
11342
- {
11343
- "kind": "js",
11344
- "name": "CardFormSubmit",
11245
+ "name": "Blik",
11345
11246
  "declaration": {
11346
- "name": "CardFormSubmit",
11347
- "module": "./components"
11247
+ "name": "BlikComponent",
11248
+ "module": "src/containers/blik/blik.ts"
11348
11249
  }
11349
- },
11250
+ }
11251
+ ]
11252
+ },
11253
+ {
11254
+ "kind": "javascript-module",
11255
+ "path": "src/containers/card-form/card-form-context.ts",
11256
+ "declarations": [
11350
11257
  {
11351
- "kind": "js",
11352
- "name": "CardFormCardNetworkSelector",
11353
- "declaration": {
11354
- "name": "CardFormCardNetworkSelector",
11355
- "module": "./components"
11356
- }
11357
- },
11258
+ "kind": "variable",
11259
+ "name": "cardFormContext"
11260
+ }
11261
+ ],
11262
+ "exports": [
11358
11263
  {
11359
11264
  "kind": "js",
11360
- "name": "CardForm",
11265
+ "name": "cardFormContext",
11361
11266
  "declaration": {
11362
- "name": "CardFormComponent",
11363
- "module": "src/containers/card-form/card-form.ts"
11267
+ "name": "cardFormContext",
11268
+ "module": "src/containers/card-form/card-form-context.ts"
11364
11269
  }
11365
11270
  }
11366
11271
  ]
11367
11272
  },
11368
11273
  {
11369
11274
  "kind": "javascript-module",
11370
- "path": "src/containers/card-form/types.ts",
11371
- "declarations": [],
11372
- "exports": []
11373
- },
11374
- {
11375
- "kind": "javascript-module",
11376
- "path": "src/containers/blik/blik.component.ts",
11275
+ "path": "src/containers/card-form/card-form.component.ts",
11377
11276
  "declarations": [
11378
11277
  {
11379
11278
  "kind": "class",
11380
- "description": "BLIK Payment Component\n\nConsolidated component handling BLIK payment flow from button click through\npayment completion. Uses a 4-state machine for managing the user experience.",
11381
- "name": "BlikComponent",
11279
+ "description": "CardFormComponent serves as a container for card input components.\nIt handles form submission, validation, and provides context to child components.",
11280
+ "name": "CardFormComponent",
11382
11281
  "members": [
11383
11282
  {
11384
11283
  "kind": "field",
11385
- "name": "paymentMethod",
11284
+ "name": "hideLabels",
11386
11285
  "type": {
11387
- "text": "InitializedPaymentMethod"
11286
+ "text": "boolean"
11388
11287
  },
11389
- "description": "Payment method configuration",
11390
- "attribute": "paymentMethod"
11288
+ "default": "false",
11289
+ "attribute": "hide-labels",
11290
+ "reflects": true
11391
11291
  },
11392
11292
  {
11393
11293
  "kind": "field",
@@ -11396,200 +11296,296 @@
11396
11296
  "text": "boolean"
11397
11297
  },
11398
11298
  "default": "false",
11399
- "description": "Disables component interaction when true",
11400
11299
  "attribute": "disabled"
11401
11300
  },
11402
11301
  {
11403
11302
  "kind": "field",
11404
- "name": "paymentManagers",
11303
+ "name": "hasAssignedContent",
11405
11304
  "type": {
11406
- "text": "InitializedManagersMap"
11305
+ "text": "boolean"
11407
11306
  },
11408
- "default": "new Map()"
11307
+ "privacy": "private",
11308
+ "default": "false",
11309
+ "description": "Tracks whether custom content has been provided via slot"
11409
11310
  },
11410
11311
  {
11411
11312
  "kind": "field",
11412
- "name": "currentState",
11313
+ "name": "selectedCardNetwork",
11413
11314
  "type": {
11414
- "text": "BlikState"
11315
+ "text": "string | null"
11415
11316
  },
11416
11317
  "privacy": "private",
11417
- "default": "'collapsed'"
11318
+ "default": "null"
11418
11319
  },
11419
11320
  {
11420
11321
  "kind": "field",
11421
- "name": "blikCode",
11322
+ "name": "formErrorMessage",
11422
11323
  "type": {
11423
- "text": "string"
11324
+ "text": "string | null"
11424
11325
  },
11425
11326
  "privacy": "private",
11426
- "default": "''"
11327
+ "default": "null",
11328
+ "description": "Form-level error message to display"
11427
11329
  },
11428
11330
  {
11429
11331
  "kind": "field",
11430
- "name": "errorMessage",
11332
+ "name": "paymentMethodSelectionSent",
11431
11333
  "type": {
11432
- "text": "string"
11334
+ "text": "boolean"
11433
11335
  },
11434
11336
  "privacy": "private",
11435
- "default": "''"
11337
+ "default": "false",
11338
+ "description": "Flag to track if PAYMENT_METHOD_SELECTION event has been sent"
11436
11339
  },
11437
11340
  {
11438
11341
  "kind": "field",
11439
- "name": "pollingDuration",
11342
+ "name": "paymentManagers",
11440
11343
  "type": {
11441
- "text": "number"
11344
+ "text": "InitializedManagersMap"
11442
11345
  },
11443
- "privacy": "private",
11444
- "default": "0"
11346
+ "default": "new Map()",
11347
+ "description": "Payment managers injected from context",
11348
+ "attribute": "paymentManagers"
11445
11349
  },
11446
11350
  {
11447
11351
  "kind": "field",
11448
- "name": "pollingTimer",
11352
+ "name": "clientOptions",
11449
11353
  "type": {
11450
- "text": "number | null"
11354
+ "text": "ClientOptionsContextType"
11355
+ },
11356
+ "default": "null",
11357
+ "description": "Client options for configuration"
11358
+ },
11359
+ {
11360
+ "kind": "field",
11361
+ "name": "headlessUtils",
11362
+ "type": {
11363
+ "text": "HeadlessUtilsContextType"
11364
+ },
11365
+ "default": "null",
11366
+ "description": "Headless utils for accessing server configuration"
11367
+ },
11368
+ {
11369
+ "kind": "field",
11370
+ "name": "analyticsUtils",
11371
+ "type": {
11372
+ "text": "AnalyticsContextType"
11373
+ },
11374
+ "default": "null",
11375
+ "description": "Analytics utils for sending analytics events"
11376
+ },
11377
+ {
11378
+ "kind": "field",
11379
+ "name": "contextEventsController",
11380
+ "type": {
11381
+ "text": "EventsContextType"
11451
11382
  },
11383
+ "default": "null",
11384
+ "description": "Events controller from context for receiving forwarded events"
11385
+ },
11386
+ {
11387
+ "kind": "field",
11388
+ "name": "cardFormProvider",
11452
11389
  "privacy": "private",
11453
- "default": "null"
11390
+ "readonly": true,
11391
+ "default": "new ContextProvider(this, { context: cardFormContext, initialValue: null, })",
11392
+ "description": "Context provider for card form data"
11454
11393
  },
11455
11394
  {
11456
11395
  "kind": "field",
11457
- "name": "loadManagerTask",
11396
+ "name": "shouldShowCardholderName",
11397
+ "type": {
11398
+ "text": "boolean"
11399
+ },
11400
+ "description": "Determines whether to show the cardholder name field\nUses client configuration with fallback to default (true)",
11401
+ "readonly": true
11402
+ },
11403
+ {
11404
+ "kind": "field",
11405
+ "name": "shouldRequireCardholderName",
11406
+ "type": {
11407
+ "text": "boolean"
11408
+ },
11409
+ "description": "Determines whether the cardholder name field is required\nUses client configuration with fallback to default (false)",
11410
+ "readonly": true
11411
+ },
11412
+ {
11413
+ "kind": "field",
11414
+ "name": "eventsController",
11458
11415
  "privacy": "private",
11459
- "default": "new Task(this, { args: () => [this.paymentMethod?.type], task: ([type]) => { if (!type) { return initialState; } const managerEntry = this.paymentManagers.get(type); if (!managerEntry) { throw new Error('BLIK payment method manager not initialized'); } // TypeScript narrows the union type based on the payment method type check if (managerEntry.type !== 'ADYEN_BLIK') { throw new Error('Invalid payment method type for BLIK component'); } return managerEntry.manager; }, })",
11460
- "description": "Manager loading task\nValidates BLIK manager exists before allowing payment flow\n\nThis Task provides reactive validation of manager availability:\n- Automatically re-runs when paymentMethod or paymentManagers change\n- Provides type-safe access to the BLIK manager\n- Enables early error detection before user interaction\n\nUnlike native payment methods (Apple Pay, Google Pay, PayPal) which use a\ntwo-task pattern (manager loading + button rendering), BLIK only needs the\nmanager loading task because it renders its own UI via Lit templates."
11416
+ "readonly": true,
11417
+ "default": "new PrimerEventsController(this)",
11418
+ "description": "Events controller for dispatching form events"
11461
11419
  },
11462
11420
  {
11463
11421
  "kind": "field",
11464
- "name": "handleButtonClick",
11422
+ "name": "_contextCardSubmitListener",
11423
+ "type": {
11424
+ "text": "((event: CustomEvent) => void) | null"
11425
+ },
11465
11426
  "privacy": "private",
11466
- "description": "Handles button click to toggle between collapsed and expanded states"
11427
+ "default": "null",
11428
+ "description": "External event listener reference for cleanup"
11467
11429
  },
11468
11430
  {
11469
11431
  "kind": "field",
11470
- "name": "handleCollapse",
11432
+ "name": "_isHandlingContextEvent",
11433
+ "type": {
11434
+ "text": "boolean"
11435
+ },
11471
11436
  "privacy": "private",
11472
- "description": "Handles collapsing the form back to button-only view\nResets form state when user clicks button to collapse"
11437
+ "default": "false",
11438
+ "description": "Flag to prevent circular event loop when handling events"
11473
11439
  },
11474
11440
  {
11475
11441
  "kind": "field",
11476
- "name": "handleInput",
11442
+ "name": "inputControllers",
11477
11443
  "privacy": "private",
11478
- "description": "Handles input changes, validates numeric input, and auto-submits on 6 digits"
11444
+ "readonly": true,
11445
+ "default": "new Map< HostedInputType, IHostedInputController >()",
11446
+ "description": "Registry for input controllers to enable context-driven meta state management"
11479
11447
  },
11480
11448
  {
11481
11449
  "kind": "field",
11482
- "name": "handleRetry",
11450
+ "name": "setupCardFormTask",
11483
11451
  "privacy": "private",
11484
- "description": "Handles retry button click"
11452
+ "readonly": true,
11453
+ "default": "new Task(this, { task: ([cardManager]) => { if (!cardManager?.manager) return initialState; const { manager } = cardManager; const hostedInputs = manager.createHostedInputs(); const { cardNumberInput, expiryInput, cvvInput } = hostedInputs; this.cardFormProvider.setValue({ // Temporarily set any so we can toggle between sdk v2 and new sdk core cardholderNameInput: ( hostedInputs as { cardholderNameInput?: IHeadlessHostedInput } ).cardholderNameInput, cardNumberInput, expiryInput, cvvInput, setCardholderName: (val: string) => { manager.setCardholderName(val); if (this.shouldRequireCardholderName) { manager.validate?.().then((validationResult) => { const errors = validationResult?.validationErrors; const cardholderNameError = errors?.find( (error) => error.name === fieldToInputType.cardholderName, ); const controller = this.inputControllers.get( HostedInputType.CARD_HOLDER_NAME, ); if (controller) { controller.updateMetaFromValidation({ valid: false, error: cardholderNameError?.message || cardholderNameError?.error || null, errorCode: cardholderNameError?.message || cardholderNameError?.error || null, }); } }); } }, setCardNetwork: (val: string) => { this.selectedCardNetwork = val; }, validate: () => manager.validate(), submit: (args) => manager.submit(args), hideLabels: this.hideLabels, disabled: this.disabled, // New meta state management methods setSubmissionState: (submitted: boolean) => { this.inputControllers.forEach((controller) => { controller.setSubmitted(submitted); }); }, propagateValidationErrors: (errors: InputValidationError[]) => { if (!errors) return; errors.forEach((error) => { const fieldName = error.field || error.name; const errorMessage = error.message || error.error; const inputType = fieldToInputType[fieldName]; if (inputType) { const controller = this.inputControllers.get(inputType); if (controller) { const updateData = { valid: false, error: errorMessage, errorCode: errorMessage, // Use error message (localization key) instead of field name }; controller.updateMetaFromValidation(updateData); } } }); }, registerInputController: ( inputType: HostedInputType, controller: IHostedInputController, ) => { this.inputControllers.set(inputType, controller); }, unregisterInputController: (inputType: HostedInputType) => { this.inputControllers.delete(inputType); }, onUserInteraction: () => { this.sendPaymentMethodSelectionEvent(); this.checkAndSendPaymentDetailsEnteredEvent(); }, }); return true; }, args: () => [this.paymentManagers.get('PAYMENT_CARD')], })",
11454
+ "description": "Task to set up the card form with hosted inputs"
11485
11455
  },
11486
11456
  {
11487
11457
  "kind": "method",
11488
- "name": "startPollingTimer",
11458
+ "name": "sendPaymentMethodSelectionEvent",
11489
11459
  "privacy": "private",
11490
11460
  "return": {
11491
11461
  "type": {
11492
11462
  "text": "void"
11493
11463
  }
11494
11464
  },
11495
- "description": "Starts polling timer to track payment duration"
11465
+ "description": "Sends PAYMENT_METHOD_SELECTION analytics event when user first interacts with card form"
11496
11466
  },
11497
11467
  {
11498
11468
  "kind": "method",
11499
- "name": "stopPollingTimer",
11469
+ "name": "checkAndSendPaymentDetailsEnteredEvent",
11500
11470
  "privacy": "private",
11501
11471
  "return": {
11502
11472
  "type": {
11503
11473
  "text": "void"
11504
11474
  }
11505
11475
  },
11506
- "description": "Stops and resets polling timer"
11476
+ "description": "Checks if all required fields are filled and sends PAYMENT_DETAILS_ENTERED event"
11507
11477
  },
11508
11478
  {
11509
- "kind": "method",
11510
- "name": "submitBlikCode",
11511
- "privacy": "private",
11512
- "return": {
11513
- "type": {
11514
- "text": "Promise<void>"
11515
- }
11479
+ "kind": "field",
11480
+ "name": "paymentDetailsEnteredSent",
11481
+ "type": {
11482
+ "text": "boolean"
11516
11483
  },
11517
- "description": "Validates and submits the BLIK code"
11484
+ "privacy": "private",
11485
+ "default": "false"
11518
11486
  },
11519
11487
  {
11520
11488
  "kind": "method",
11521
- "name": "renderCollapsed",
11489
+ "name": "sendPaymentDetailsEnteredEvent",
11522
11490
  "privacy": "private",
11523
11491
  "return": {
11524
11492
  "type": {
11525
- "text": "TemplateResult"
11493
+ "text": "void"
11526
11494
  }
11527
11495
  },
11528
- "description": "Renders the collapsed button state"
11496
+ "description": "Sends PAYMENT_DETAILS_ENTERED analytics event when all payment details are complete and valid"
11497
+ },
11498
+ {
11499
+ "kind": "field",
11500
+ "name": "handleSlotButtonClick",
11501
+ "privacy": "private",
11502
+ "description": "Handles click events from slotted content.\nSupports both native <button> and custom <primer-button> elements."
11503
+ },
11504
+ {
11505
+ "kind": "field",
11506
+ "name": "handleDirectSubmit",
11507
+ "privacy": "private",
11508
+ "description": "Handles direct submit events from child components\nThis is a backup method to catch all possible submission events"
11529
11509
  },
11530
11510
  {
11531
11511
  "kind": "method",
11532
- "name": "renderExpandedInput",
11512
+ "name": "setupContextEventListeners",
11533
11513
  "privacy": "private",
11534
11514
  "return": {
11535
11515
  "type": {
11536
- "text": "TemplateResult"
11516
+ "text": "void"
11537
11517
  }
11538
11518
  },
11539
- "description": "Renders the expanded input state"
11519
+ "description": "Sets up event listeners for context-forwarded events"
11540
11520
  },
11541
11521
  {
11542
11522
  "kind": "method",
11543
- "name": "renderLoading",
11523
+ "name": "cleanupContextEventListeners",
11544
11524
  "privacy": "private",
11545
11525
  "return": {
11546
11526
  "type": {
11547
- "text": "TemplateResult"
11527
+ "text": "void"
11548
11528
  }
11549
11529
  },
11550
- "description": "Renders the loading state"
11530
+ "description": "Cleans up context event listeners"
11531
+ },
11532
+ {
11533
+ "kind": "field",
11534
+ "name": "handleContextCardSubmit",
11535
+ "privacy": "private",
11536
+ "description": "Handles primer:card-submit events received from the events context\nThis allows the card form to respond to external submit triggers"
11551
11537
  },
11552
11538
  {
11553
11539
  "kind": "method",
11554
- "name": "renderError",
11540
+ "name": "isSubmitButton",
11555
11541
  "privacy": "private",
11556
11542
  "return": {
11557
11543
  "type": {
11558
- "text": "TemplateResult"
11544
+ "text": "boolean"
11559
11545
  }
11560
11546
  },
11561
- "description": "Renders the error state"
11547
+ "parameters": [
11548
+ {
11549
+ "name": "button",
11550
+ "type": {
11551
+ "text": "HTMLElement"
11552
+ }
11553
+ }
11554
+ ],
11555
+ "description": "Determines if a button is a submit button based on its attributes"
11556
+ },
11557
+ {
11558
+ "kind": "field",
11559
+ "name": "onSlotChange",
11560
+ "privacy": "private",
11561
+ "description": "Handles slot change events to detect custom content"
11562
11562
  },
11563
11563
  {
11564
11564
  "kind": "method",
11565
- "name": "renderExpandedState",
11565
+ "name": "submitCardPayment",
11566
11566
  "privacy": "private",
11567
11567
  "return": {
11568
11568
  "type": {
11569
- "text": "TemplateResult | typeof nothing"
11569
+ "text": "Promise<void>"
11570
11570
  }
11571
11571
  },
11572
- "description": "Renders the appropriate expanded state based on current state"
11573
- }
11574
- ],
11575
- "events": [
11576
- {
11577
- "description": "Dispatched on successful payment",
11578
- "name": "primer-payment-success"
11572
+ "description": "Handles the card form submission.\nValidates the form and dispatches either a submit success or errors event."
11579
11573
  },
11580
11574
  {
11581
- "description": "Dispatched on payment error",
11582
- "name": "primer-payment-error"
11575
+ "kind": "field",
11576
+ "name": "handleFormSubmit",
11577
+ "privacy": "private",
11578
+ "description": "Event handler for form submission\nHandles both native form submissions and custom events"
11583
11579
  }
11584
11580
  ],
11585
11581
  "attributes": [
11586
11582
  {
11587
- "name": "paymentMethod",
11583
+ "name": "hide-labels",
11588
11584
  "type": {
11589
- "text": "InitializedPaymentMethod"
11585
+ "text": "boolean"
11590
11586
  },
11591
- "description": "Payment method configuration",
11592
- "fieldName": "paymentMethod"
11587
+ "default": "false",
11588
+ "fieldName": "hideLabels"
11593
11589
  },
11594
11590
  {
11595
11591
  "name": "disabled",
@@ -11597,73 +11593,128 @@
11597
11593
  "text": "boolean"
11598
11594
  },
11599
11595
  "default": "false",
11600
- "description": "Disables component interaction when true",
11601
11596
  "fieldName": "disabled"
11597
+ },
11598
+ {
11599
+ "name": "paymentManagers",
11600
+ "type": {
11601
+ "text": "InitializedManagersMap"
11602
+ },
11603
+ "default": "new Map()",
11604
+ "description": "Payment managers injected from context",
11605
+ "fieldName": "paymentManagers"
11602
11606
  }
11603
11607
  ],
11604
11608
  "superclass": {
11605
11609
  "name": "LitElement",
11606
11610
  "package": "lit"
11607
11611
  },
11608
- "tagName": "primer-blik",
11612
+ "tagName": "primer-card-form",
11609
11613
  "customElement": true
11610
11614
  }
11611
11615
  ],
11612
11616
  "exports": [
11613
11617
  {
11614
11618
  "kind": "js",
11615
- "name": "BlikComponent",
11619
+ "name": "CardFormComponent",
11616
11620
  "declaration": {
11617
- "name": "BlikComponent",
11618
- "module": "src/containers/blik/blik.component.ts"
11621
+ "name": "CardFormComponent",
11622
+ "module": "src/containers/card-form/card-form.component.ts"
11619
11623
  }
11620
11624
  },
11621
11625
  {
11622
11626
  "kind": "custom-element-definition",
11623
- "name": "primer-blik",
11627
+ "name": "primer-card-form",
11624
11628
  "declaration": {
11625
- "name": "BlikComponent",
11626
- "module": "src/containers/blik/blik.component.ts"
11629
+ "name": "CardFormComponent",
11630
+ "module": "src/containers/card-form/card-form.component.ts"
11627
11631
  }
11628
11632
  }
11629
11633
  ]
11630
11634
  },
11631
11635
  {
11632
11636
  "kind": "javascript-module",
11633
- "path": "src/containers/blik/blik.styles.ts",
11634
- "declarations": [
11635
- {
11636
- "kind": "variable",
11637
- "name": "styles",
11638
- "default": "css` :host { display: flex; width: 100%; } .blik-container { width: 100%; display: flex; flex-direction: column; transition: all var(--primer-animation-duration) var(--primer-animation-easing); } .blik-container.expanded { border-radius: var(--primer-radius-medium); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); background-color: var(--primer-color-background-outlined-default); border: 1px solid var(--primer-color-border-outlined-default); padding: var(--primer-space-large); } /* Button styles (collapsed state) */ primer-button.blik-button { width: 100%; } /* Override primer-button part styles for BLIK branding */ primer-button.blik-button::part(button) { /* BLIK brand requirement: Black background (#000000) with white logo */ background-color: #000000; border: none; color: var(--primer-color-text-primary); padding: 2px; display: flex; align-items: center; justify-content: center; gap: var(--primer-space-small); /* Fixed height for button - matches redirect payment method calculation */ height: calc( ${unsafeCSS(PAYMENT_METHOD_LINE_HEIGHT)} + calc(2 * var(--primer-space-medium)) ); flex-shrink: 0; /* Prevent button from shrinking when form appears */ } /* Image container for button logo */ .image-container { display: flex; justify-content: center; align-items: center; min-width: 100px; height: 100%; flex-shrink: 0; flex-grow: 1; } /* Button logo */ img { max-width: 100px; width: 100%; height: auto; object-fit: cover; max-height: 98%; } /* Expanded content (form, loading, error states) */ .blik-expanded-content { width: 100%; display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--primer-animation-duration) var(--primer-animation-easing); overflow: hidden; margin-top: var(--primer-space-medium); } .blik-container.expanded .blik-expanded-content { grid-template-rows: 1fr; } .blik-content-wrapper { overflow: hidden; } /* Input wrapper */ .blik-input-wrapper { display: flex; flex-direction: column; gap: var(--primer-space-small); } /* Input label */ .blik-label { font-family: var(--primer-typography-body-medium-font); font-size: var(--primer-typography-body-medium-size); font-weight: var(--primer-typography-body-medium-weight); line-height: var(--primer-typography-body-medium-line-height); color: var(--primer-color-text-primary); } /* Input field */ .blik-input { width: 100%; padding: var(--primer-space-medium); font-family: var(--primer-typography-body-large-font); font-size: var(--primer-typography-body-large-size); font-weight: var(--primer-typography-body-large-weight); line-height: var(--primer-typography-body-large-line-height); /* Increase spacing between digits for better 6-digit code readability */ letter-spacing: 0.25em; text-align: center; color: var(--primer-color-text-primary); background-color: var(--primer-color-background-outlined-default); border: 1px solid var(--primer-color-border-outlined-default); border-radius: var(--primer-radius-medium); outline: none; transition: border-color var(--primer-animation-duration) var(--primer-animation-easing); } .blik-input::placeholder { color: var(--primer-color-text-secondary); /* Reduce placeholder visibility to emphasize user input */ opacity: 0.5; } .blik-input:focus { border-color: var(--primer-color-border-outlined-focus); } .blik-input:disabled { background-color: var(--primer-color-background-outlined-disabled); border-color: var(--primer-color-border-outlined-disabled); color: var(--primer-color-text-disabled); cursor: not-allowed; } /* Loading state */ .blik-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--primer-space-large); padding: var(--primer-space-xlarge) var(--primer-space-medium); } /* Timeout warning */ .blik-timeout-warning { margin-top: var(--primer-space-medium); padding: var(--primer-space-small); font-size: var(--primer-typography-body-small-size); color: var(--primer-color-text-warning); text-align: center; border-radius: var(--primer-radius-small); background-color: var(--primer-color-surface-warning); } /* Error state */ .blik-error { display: flex; flex-direction: column; align-items: center; gap: var(--primer-space-medium); } .blik-error-message { font-family: var(--primer-typography-body-medium-font); font-size: var(--primer-typography-body-medium-size); font-weight: var(--primer-typography-body-medium-weight); line-height: var(--primer-typography-body-medium-line-height); color: var(--primer-color-text-primary); text-align: center; } /* Retry button */ .blik-retry-button { padding: var(--primer-space-medium) var(--primer-space-large); font-family: var(--primer-typography-title-large-font); font-size: var(--primer-typography-title-large-size); font-weight: var(--primer-typography-title-large-weight); line-height: var(--primer-typography-title-large-line-height); color: var(--primer-color-background-outlined-default); background-color: var(--primer-color-brand); border: none; border-radius: var(--primer-radius-medium); cursor: pointer; outline: none; transition: filter var(--primer-animation-duration) var(--primer-animation-easing); } .blik-retry-button:hover:not(:disabled) { filter: brightness(105%); } .blik-retry-button:active:not(:disabled) { filter: brightness(98%); } .blik-retry-button:focus-visible { outline: 2px solid var(--primer-color-brand); outline-offset: 2px; } .blik-retry-button:disabled { background-color: var(--primer-color-background-outlined-disabled); color: var(--primer-color-text-disabled); cursor: not-allowed; } /* Disabled state styling */ :host([disabled]) { opacity: 0.6; cursor: not-allowed; } :host([disabled]) primer-button::part(button) { pointer-events: none; cursor: not-allowed; } :host([disabled]) img { filter: grayscale(100%); } /* Responsive typography for larger screens */ @media (min-width: 768px) { .blik-input { font-size: var(--primer-typography-title-large-size); } } `"
11639
- }
11640
- ],
11637
+ "path": "src/containers/card-form/card-form.styles.ts",
11638
+ "declarations": [],
11641
11639
  "exports": [
11642
11640
  {
11643
11641
  "kind": "js",
11644
- "name": "styles",
11642
+ "name": "default",
11645
11643
  "declaration": {
11646
- "name": "styles",
11647
- "module": "src/containers/blik/blik.styles.ts"
11644
+ "module": "src/containers/card-form/card-form.styles.ts"
11648
11645
  }
11649
11646
  }
11650
11647
  ]
11651
11648
  },
11652
11649
  {
11653
11650
  "kind": "javascript-module",
11654
- "path": "src/containers/blik/blik.ts",
11651
+ "path": "src/containers/card-form/card-form.ts",
11655
11652
  "declarations": [],
11656
11653
  "exports": [
11657
11654
  {
11658
11655
  "kind": "js",
11659
- "name": "Blik",
11656
+ "name": "CardFormCardNumber",
11660
11657
  "declaration": {
11661
- "name": "BlikComponent",
11662
- "module": "src/containers/blik/blik.ts"
11658
+ "name": "CardFormCardNumber",
11659
+ "module": "./components"
11660
+ }
11661
+ },
11662
+ {
11663
+ "kind": "js",
11664
+ "name": "CardFormCVV",
11665
+ "declaration": {
11666
+ "name": "CardFormCVV",
11667
+ "module": "./components"
11668
+ }
11669
+ },
11670
+ {
11671
+ "kind": "js",
11672
+ "name": "CardFormExpiry",
11673
+ "declaration": {
11674
+ "name": "CardFormExpiry",
11675
+ "module": "./components"
11676
+ }
11677
+ },
11678
+ {
11679
+ "kind": "js",
11680
+ "name": "CardFormName",
11681
+ "declaration": {
11682
+ "name": "CardFormName",
11683
+ "module": "./components"
11684
+ }
11685
+ },
11686
+ {
11687
+ "kind": "js",
11688
+ "name": "CardFormSubmit",
11689
+ "declaration": {
11690
+ "name": "CardFormSubmit",
11691
+ "module": "./components"
11692
+ }
11693
+ },
11694
+ {
11695
+ "kind": "js",
11696
+ "name": "CardFormCardNetworkSelector",
11697
+ "declaration": {
11698
+ "name": "CardFormCardNetworkSelector",
11699
+ "module": "./components"
11700
+ }
11701
+ },
11702
+ {
11703
+ "kind": "js",
11704
+ "name": "CardForm",
11705
+ "declaration": {
11706
+ "name": "CardFormComponent",
11707
+ "module": "src/containers/card-form/card-form.ts"
11663
11708
  }
11664
11709
  }
11665
11710
  ]
11666
11711
  },
11712
+ {
11713
+ "kind": "javascript-module",
11714
+ "path": "src/containers/card-form/types.ts",
11715
+ "declarations": [],
11716
+ "exports": []
11717
+ },
11667
11718
  {
11668
11719
  "kind": "javascript-module",
11669
11720
  "path": "src/containers/dynamic-payment/dynamic-payment.component.ts",
@@ -17245,39 +17296,23 @@
17245
17296
  },
17246
17297
  {
17247
17298
  "kind": "javascript-module",
17248
- "path": "src/containers/card-form/components/input-card-number/input-card-number.component.ts",
17299
+ "path": "src/containers/card-form/components/input-cvv/input-cvv.component.ts",
17249
17300
  "declarations": [
17250
17301
  {
17251
17302
  "kind": "class",
17252
- "description": "Card number input component with dynamic card network detection and selection",
17253
- "name": "InputCardNumberComponent",
17303
+ "description": "",
17304
+ "name": "InputCvvComponent",
17254
17305
  "members": [
17255
- {
17256
- "kind": "field",
17257
- "name": "config",
17258
- "type": {
17259
- "text": "InputComponentConfig"
17260
- },
17261
- "privacy": "protected",
17262
- "readonly": true,
17263
- "description": "Configuration for this input component",
17264
- "default": "{ inputType: HostedInputType.CARD_NUMBER, containerSelector: '#cardNumber', errorName: 'cardNumber-card', translations: { label: { id: 'cardNumber', defaultMessage: 'Card Number' }, placeholder: '4111 1111 1111 1111', ariaLabel: { id: 'cardNumber', defaultMessage: 'Card Number' }, }, }",
17265
- "inheritedFrom": {
17266
- "name": "AbstractCardInputComponent",
17267
- "module": "src/containers/card-form/components/abstract-card-input-component.ts"
17268
- }
17269
- },
17270
- {
17271
- "kind": "field",
17272
- "name": "handleNetworkSelected",
17273
- "privacy": "private",
17274
- "description": "Handle network selection from the network selector component"
17275
- },
17276
- {
17277
- "kind": "method",
17278
- "name": "renderInput",
17306
+ {
17307
+ "kind": "field",
17308
+ "name": "config",
17309
+ "type": {
17310
+ "text": "InputComponentConfig"
17311
+ },
17279
17312
  "privacy": "protected",
17280
- "description": "Override the renderInput method to include the network selector",
17313
+ "readonly": true,
17314
+ "description": "Configuration for this input component",
17315
+ "default": "{ inputType: HostedInputType.CVV, containerSelector: '#cvv', errorName: 'cvv-card', translations: { label: 'CVV', placeholder: '123', }, }",
17281
17316
  "inheritedFrom": {
17282
17317
  "name": "AbstractCardInputComponent",
17283
17318
  "module": "src/containers/card-form/components/abstract-card-input-component.ts"
@@ -17487,13 +17522,23 @@
17487
17522
  "name": "AbstractCardInputComponent",
17488
17523
  "module": "src/containers/card-form/components/abstract-card-input-component.ts"
17489
17524
  }
17525
+ },
17526
+ {
17527
+ "kind": "method",
17528
+ "name": "renderInput",
17529
+ "privacy": "protected",
17530
+ "description": "Common rendering logic for all card input components",
17531
+ "inheritedFrom": {
17532
+ "name": "AbstractCardInputComponent",
17533
+ "module": "src/containers/card-form/components/abstract-card-input-component.ts"
17534
+ }
17490
17535
  }
17491
17536
  ],
17492
17537
  "superclass": {
17493
17538
  "name": "AbstractCardInputComponent",
17494
17539
  "package": "@components/containers/card-form/components/abstract-card-input-component"
17495
17540
  },
17496
- "tagName": "primer-input-card-number",
17541
+ "tagName": "primer-input-cvv",
17497
17542
  "customElement": true,
17498
17543
  "attributes": [
17499
17544
  {
@@ -17550,59 +17595,59 @@
17550
17595
  "exports": [
17551
17596
  {
17552
17597
  "kind": "js",
17553
- "name": "InputCardNumberComponent",
17598
+ "name": "InputCvvComponent",
17554
17599
  "declaration": {
17555
- "name": "InputCardNumberComponent",
17556
- "module": "src/containers/card-form/components/input-card-number/input-card-number.component.ts"
17600
+ "name": "InputCvvComponent",
17601
+ "module": "src/containers/card-form/components/input-cvv/input-cvv.component.ts"
17557
17602
  }
17558
17603
  },
17559
17604
  {
17560
17605
  "kind": "custom-element-definition",
17561
- "name": "primer-input-card-number",
17606
+ "name": "primer-input-cvv",
17562
17607
  "declaration": {
17563
- "name": "InputCardNumberComponent",
17564
- "module": "src/containers/card-form/components/input-card-number/input-card-number.component.ts"
17608
+ "name": "InputCvvComponent",
17609
+ "module": "src/containers/card-form/components/input-cvv/input-cvv.component.ts"
17565
17610
  }
17566
17611
  }
17567
17612
  ]
17568
17613
  },
17569
17614
  {
17570
17615
  "kind": "javascript-module",
17571
- "path": "src/containers/card-form/components/input-card-number/input-card-number.styles.ts",
17616
+ "path": "src/containers/card-form/components/input-cvv/input-cvv.styles.ts",
17572
17617
  "declarations": [],
17573
17618
  "exports": [
17574
17619
  {
17575
17620
  "kind": "js",
17576
17621
  "name": "default",
17577
17622
  "declaration": {
17578
- "module": "src/containers/card-form/components/input-card-number/input-card-number.styles.ts"
17623
+ "module": "src/containers/card-form/components/input-cvv/input-cvv.styles.ts"
17579
17624
  }
17580
17625
  }
17581
17626
  ]
17582
17627
  },
17583
17628
  {
17584
17629
  "kind": "javascript-module",
17585
- "path": "src/containers/card-form/components/input-card-number/input-card-number.ts",
17630
+ "path": "src/containers/card-form/components/input-cvv/input-cvv.ts",
17586
17631
  "declarations": [],
17587
17632
  "exports": [
17588
17633
  {
17589
17634
  "kind": "js",
17590
- "name": "CardFormCardNumber",
17635
+ "name": "CardFormCVV",
17591
17636
  "declaration": {
17592
- "name": "InputCardNumberComponent",
17593
- "module": "src/containers/card-form/components/input-card-number/input-card-number.ts"
17637
+ "name": "InputCvvComponent",
17638
+ "module": "src/containers/card-form/components/input-cvv/input-cvv.ts"
17594
17639
  }
17595
17640
  }
17596
17641
  ]
17597
17642
  },
17598
17643
  {
17599
17644
  "kind": "javascript-module",
17600
- "path": "src/containers/card-form/components/input-cvv/input-cvv.component.ts",
17645
+ "path": "src/containers/card-form/components/input-card-number/input-card-number.component.ts",
17601
17646
  "declarations": [
17602
17647
  {
17603
17648
  "kind": "class",
17604
- "description": "",
17605
- "name": "InputCvvComponent",
17649
+ "description": "Card number input component with dynamic card network detection and selection",
17650
+ "name": "InputCardNumberComponent",
17606
17651
  "members": [
17607
17652
  {
17608
17653
  "kind": "field",
@@ -17613,7 +17658,23 @@
17613
17658
  "privacy": "protected",
17614
17659
  "readonly": true,
17615
17660
  "description": "Configuration for this input component",
17616
- "default": "{ inputType: HostedInputType.CVV, containerSelector: '#cvv', errorName: 'cvv-card', translations: { label: 'CVV', placeholder: '123', }, }",
17661
+ "default": "{ inputType: HostedInputType.CARD_NUMBER, containerSelector: '#cardNumber', errorName: 'cardNumber-card', translations: { label: { id: 'cardNumber', defaultMessage: 'Card Number' }, placeholder: '4111 1111 1111 1111', ariaLabel: { id: 'cardNumber', defaultMessage: 'Card Number' }, }, }",
17662
+ "inheritedFrom": {
17663
+ "name": "AbstractCardInputComponent",
17664
+ "module": "src/containers/card-form/components/abstract-card-input-component.ts"
17665
+ }
17666
+ },
17667
+ {
17668
+ "kind": "field",
17669
+ "name": "handleNetworkSelected",
17670
+ "privacy": "private",
17671
+ "description": "Handle network selection from the network selector component"
17672
+ },
17673
+ {
17674
+ "kind": "method",
17675
+ "name": "renderInput",
17676
+ "privacy": "protected",
17677
+ "description": "Override the renderInput method to include the network selector",
17617
17678
  "inheritedFrom": {
17618
17679
  "name": "AbstractCardInputComponent",
17619
17680
  "module": "src/containers/card-form/components/abstract-card-input-component.ts"
@@ -17823,23 +17884,13 @@
17823
17884
  "name": "AbstractCardInputComponent",
17824
17885
  "module": "src/containers/card-form/components/abstract-card-input-component.ts"
17825
17886
  }
17826
- },
17827
- {
17828
- "kind": "method",
17829
- "name": "renderInput",
17830
- "privacy": "protected",
17831
- "description": "Common rendering logic for all card input components",
17832
- "inheritedFrom": {
17833
- "name": "AbstractCardInputComponent",
17834
- "module": "src/containers/card-form/components/abstract-card-input-component.ts"
17835
- }
17836
17887
  }
17837
17888
  ],
17838
17889
  "superclass": {
17839
17890
  "name": "AbstractCardInputComponent",
17840
17891
  "package": "@components/containers/card-form/components/abstract-card-input-component"
17841
17892
  },
17842
- "tagName": "primer-input-cvv",
17893
+ "tagName": "primer-input-card-number",
17843
17894
  "customElement": true,
17844
17895
  "attributes": [
17845
17896
  {
@@ -17896,47 +17947,47 @@
17896
17947
  "exports": [
17897
17948
  {
17898
17949
  "kind": "js",
17899
- "name": "InputCvvComponent",
17950
+ "name": "InputCardNumberComponent",
17900
17951
  "declaration": {
17901
- "name": "InputCvvComponent",
17902
- "module": "src/containers/card-form/components/input-cvv/input-cvv.component.ts"
17952
+ "name": "InputCardNumberComponent",
17953
+ "module": "src/containers/card-form/components/input-card-number/input-card-number.component.ts"
17903
17954
  }
17904
17955
  },
17905
17956
  {
17906
17957
  "kind": "custom-element-definition",
17907
- "name": "primer-input-cvv",
17958
+ "name": "primer-input-card-number",
17908
17959
  "declaration": {
17909
- "name": "InputCvvComponent",
17910
- "module": "src/containers/card-form/components/input-cvv/input-cvv.component.ts"
17960
+ "name": "InputCardNumberComponent",
17961
+ "module": "src/containers/card-form/components/input-card-number/input-card-number.component.ts"
17911
17962
  }
17912
17963
  }
17913
17964
  ]
17914
17965
  },
17915
17966
  {
17916
17967
  "kind": "javascript-module",
17917
- "path": "src/containers/card-form/components/input-cvv/input-cvv.styles.ts",
17968
+ "path": "src/containers/card-form/components/input-card-number/input-card-number.styles.ts",
17918
17969
  "declarations": [],
17919
17970
  "exports": [
17920
17971
  {
17921
17972
  "kind": "js",
17922
17973
  "name": "default",
17923
17974
  "declaration": {
17924
- "module": "src/containers/card-form/components/input-cvv/input-cvv.styles.ts"
17975
+ "module": "src/containers/card-form/components/input-card-number/input-card-number.styles.ts"
17925
17976
  }
17926
17977
  }
17927
17978
  ]
17928
17979
  },
17929
17980
  {
17930
17981
  "kind": "javascript-module",
17931
- "path": "src/containers/card-form/components/input-cvv/input-cvv.ts",
17982
+ "path": "src/containers/card-form/components/input-card-number/input-card-number.ts",
17932
17983
  "declarations": [],
17933
17984
  "exports": [
17934
17985
  {
17935
17986
  "kind": "js",
17936
- "name": "CardFormCVV",
17987
+ "name": "CardFormCardNumber",
17937
17988
  "declaration": {
17938
- "name": "InputCvvComponent",
17939
- "module": "src/containers/card-form/components/input-cvv/input-cvv.ts"
17989
+ "name": "InputCardNumberComponent",
17990
+ "module": "src/containers/card-form/components/input-card-number/input-card-number.ts"
17940
17991
  }
17941
17992
  }
17942
17993
  ]
@@ -18368,81 +18419,6 @@
18368
18419
  }
18369
18420
  ]
18370
18421
  },
18371
- {
18372
- "kind": "javascript-module",
18373
- "path": "src/containers/vault-manager/components/payment-method-content/payment-method-content.component.ts",
18374
- "declarations": [
18375
- {
18376
- "kind": "class",
18377
- "description": "PaymentMethodContentComponent - renders payment method information with icon and details\nThis component encapsulates the display logic and styles for payment method content\nso it can be reused across different containers without style conflicts",
18378
- "name": "PaymentMethodContentComponent",
18379
- "members": [
18380
- {
18381
- "kind": "field",
18382
- "name": "assetConfig",
18383
- "type": {
18384
- "text": "AssetConfig | null"
18385
- },
18386
- "default": "null",
18387
- "description": "The asset configuration containing icon and display data"
18388
- }
18389
- ],
18390
- "superclass": {
18391
- "name": "LitElement",
18392
- "package": "lit"
18393
- },
18394
- "tagName": "primer-payment-method-content",
18395
- "customElement": true
18396
- }
18397
- ],
18398
- "exports": [
18399
- {
18400
- "kind": "js",
18401
- "name": "PaymentMethodContentComponent",
18402
- "declaration": {
18403
- "name": "PaymentMethodContentComponent",
18404
- "module": "src/containers/vault-manager/components/payment-method-content/payment-method-content.component.ts"
18405
- }
18406
- },
18407
- {
18408
- "kind": "custom-element-definition",
18409
- "name": "primer-payment-method-content",
18410
- "declaration": {
18411
- "name": "PaymentMethodContentComponent",
18412
- "module": "src/containers/vault-manager/components/payment-method-content/payment-method-content.component.ts"
18413
- }
18414
- }
18415
- ]
18416
- },
18417
- {
18418
- "kind": "javascript-module",
18419
- "path": "src/containers/vault-manager/components/payment-method-content/payment-method-content.styles.ts",
18420
- "declarations": [],
18421
- "exports": [
18422
- {
18423
- "kind": "js",
18424
- "name": "default",
18425
- "declaration": {
18426
- "module": "src/containers/vault-manager/components/payment-method-content/payment-method-content.styles.ts"
18427
- }
18428
- }
18429
- ]
18430
- },
18431
- {
18432
- "kind": "javascript-module",
18433
- "path": "src/containers/vault-manager/components/payment-method-content/payment-method-content.ts",
18434
- "declarations": [],
18435
- "exports": [
18436
- {
18437
- "kind": "js",
18438
- "name": "PaymentMethodContentComponent",
18439
- "declaration": {
18440
- "name": "PaymentMethodContentComponent",
18441
- "module": "src/containers/vault-manager/components/payment-method-content/payment-method-content.ts"
18442
- }
18443
- }
18444
- ]
18445
- },
18446
18422
  {
18447
18423
  "kind": "javascript-module",
18448
18424
  "path": "src/containers/vault-manager/components/vault-cvv-input/vault-cvv-input.component.ts",
@@ -18642,6 +18618,81 @@
18642
18618
  }
18643
18619
  ]
18644
18620
  },
18621
+ {
18622
+ "kind": "javascript-module",
18623
+ "path": "src/containers/vault-manager/components/payment-method-content/payment-method-content.component.ts",
18624
+ "declarations": [
18625
+ {
18626
+ "kind": "class",
18627
+ "description": "PaymentMethodContentComponent - renders payment method information with icon and details\nThis component encapsulates the display logic and styles for payment method content\nso it can be reused across different containers without style conflicts",
18628
+ "name": "PaymentMethodContentComponent",
18629
+ "members": [
18630
+ {
18631
+ "kind": "field",
18632
+ "name": "assetConfig",
18633
+ "type": {
18634
+ "text": "AssetConfig | null"
18635
+ },
18636
+ "default": "null",
18637
+ "description": "The asset configuration containing icon and display data"
18638
+ }
18639
+ ],
18640
+ "superclass": {
18641
+ "name": "LitElement",
18642
+ "package": "lit"
18643
+ },
18644
+ "tagName": "primer-payment-method-content",
18645
+ "customElement": true
18646
+ }
18647
+ ],
18648
+ "exports": [
18649
+ {
18650
+ "kind": "js",
18651
+ "name": "PaymentMethodContentComponent",
18652
+ "declaration": {
18653
+ "name": "PaymentMethodContentComponent",
18654
+ "module": "src/containers/vault-manager/components/payment-method-content/payment-method-content.component.ts"
18655
+ }
18656
+ },
18657
+ {
18658
+ "kind": "custom-element-definition",
18659
+ "name": "primer-payment-method-content",
18660
+ "declaration": {
18661
+ "name": "PaymentMethodContentComponent",
18662
+ "module": "src/containers/vault-manager/components/payment-method-content/payment-method-content.component.ts"
18663
+ }
18664
+ }
18665
+ ]
18666
+ },
18667
+ {
18668
+ "kind": "javascript-module",
18669
+ "path": "src/containers/vault-manager/components/payment-method-content/payment-method-content.styles.ts",
18670
+ "declarations": [],
18671
+ "exports": [
18672
+ {
18673
+ "kind": "js",
18674
+ "name": "default",
18675
+ "declaration": {
18676
+ "module": "src/containers/vault-manager/components/payment-method-content/payment-method-content.styles.ts"
18677
+ }
18678
+ }
18679
+ ]
18680
+ },
18681
+ {
18682
+ "kind": "javascript-module",
18683
+ "path": "src/containers/vault-manager/components/payment-method-content/payment-method-content.ts",
18684
+ "declarations": [],
18685
+ "exports": [
18686
+ {
18687
+ "kind": "js",
18688
+ "name": "PaymentMethodContentComponent",
18689
+ "declaration": {
18690
+ "name": "PaymentMethodContentComponent",
18691
+ "module": "src/containers/vault-manager/components/payment-method-content/payment-method-content.ts"
18692
+ }
18693
+ }
18694
+ ]
18695
+ },
18645
18696
  {
18646
18697
  "kind": "javascript-module",
18647
18698
  "path": "src/containers/vault-manager/components/vault-delete-confirmation/vault-delete-confirmation.component.ts",