@primer-io/primer-js 0.5.1 → 0.6.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.
- package/CHANGELOG.md +12 -0
- package/dist/custom-elements.json +123 -123
- package/dist/primer-loader.d.ts +11 -0
- package/dist/primer-loader.js +10 -10
- package/dist/web-types.json +1 -1
- package/package.json +1 -1
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"kind": "variable",
|
|
47
|
-
"name": "
|
|
47
|
+
"name": "Xr",
|
|
48
48
|
"default": "class{constructor(t){this._methods=t}get(t){return this._methods.get(t)}toArray(){return Array.from(this._methods.values())}size(){return this._methods.size}}"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
@@ -82,219 +82,219 @@
|
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
"kind": "variable",
|
|
85
|
-
"name": "
|
|
86
|
-
"default": "class extends v{constructor(){super(...arguments);this.size=\"large\";this.showCloseButton=!1;this.open=!1}openDialog(){this.open=!0}closeDialog(){let e=document.querySelector(\"primer-dialog\");if(e){e.startExitAnimation();let r=()=>{this.open=!1,this.removeEventListener(\"primer-dialog-close\",r)};this.addEventListener(\"primer-dialog-close\",r)}else this.open=!1}renderContent(){return m`<div class=\"content-container\"><slot></slot>${this.renderSecureHtmlContent()}</div>`}renderSecureHtmlContent(){return this.secureHtmlContent?
|
|
85
|
+
"name": "le",
|
|
86
|
+
"default": "class extends v{constructor(){super(...arguments);this.size=\"large\";this.showCloseButton=!1;this.open=!1}openDialog(){this.open=!0}closeDialog(){let e=document.querySelector(\"primer-dialog\");if(e){e.startExitAnimation();let r=()=>{this.open=!1,this.removeEventListener(\"primer-dialog-close\",r)};this.addEventListener(\"primer-dialog-close\",r)}else this.open=!1}renderContent(){return m`<div class=\"content-container\"><slot></slot>${this.renderSecureHtmlContent()}</div>`}renderSecureHtmlContent(){return this.secureHtmlContent?No(this.secureHtmlContent)?m`${Mn(this.secureHtmlContent.content)}`:(A.warn(\"PortalDialogComponent: Invalid access token provided for htmlContent. Content will not be rendered.\"),h):h}renderDialog(){return this.open?m`<primer-portal><primer-dialog .open=${this.open} size=${this.size} .showCloseButton=${!1} @primer-dialog-close=\"${()=>this.closeDialog()}\" >${this.renderContent()}</primer-dialog></primer-portal>`:h}connectedCallback(){super.connectedCallback(),this.open||this.openDialog()}updated(e){if(super.updated(e),e.has(\"secureHtmlContent\")){let r=this.secureHtmlContent;r&&!No(r)&&(A.errorWithDatadog(\"PortalDialogComponent: Invalid access token provided for htmlContent. Content will not be rendered.\"),this.secureHtmlContent=void 0)}e.has(\"open\")&&this.open&&this.onOpen&&this.onOpen(),e.has(\"open\")&&this.open&&this.onContentRendered&&this.updateComplete.then(()=>{requestAnimationFrame(()=>{this.onContentRendered?.()})})}render(){return m`${this.renderDialog()}`}}"
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
"kind": "variable",
|
|
90
|
-
"name": "
|
|
91
|
-
"default": "class extends v{constructor(){super();this.customStyles=\"\";this.clientToken=\"\";this.options={};this.disableLoader=!1;this._jsInitialized=!1;this.previousLoadingState=!0;this.hasAssignedContent=!1;this._loadingTimeoutId=null;this._eventListenerController=null;this.locale=\"en-GB\";this.onSlotChange=e=>{let o=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=o.length>0,this.requestUpdate()};this.sdkContextController=new
|
|
90
|
+
"name": "Ae",
|
|
91
|
+
"default": "class extends v{constructor(){super();this.customStyles=\"\";this.clientToken=\"\";this.options={};this.disableLoader=!1;this._jsInitialized=!1;this.previousLoadingState=!0;this.hasAssignedContent=!1;this._loadingTimeoutId=null;this._eventListenerController=null;this.locale=\"en-GB\";this.onSlotChange=e=>{let o=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=o.length>0,this.requestUpdate()};this.sdkContextController=new kr(this),this.sdkStateController=new Tr(this),this.primerEventsController=new Ot(this),this.styleProcessingController=new Ir(this),this.vaultManagerController=new Zt(this),this.cardNetworkController=new Ar(this),this.achPaymentEventsController=new bi(this),new vi(this)}set jsInitialized(e){this.requestUpdate(),this._jsInitialized=e}get jsInitialized(){return this._jsInitialized}connectedCallback(){super.connectedCallback(),this.sdkContextController.setEventsController(this.primerEventsController),this._eventListenerController=new AbortController,document.addEventListener(\"primer:card-submit\",this.handleExternalCardSubmit.bind(this),{signal:this._eventListenerController.signal})}attributeChangedCallback(e,r,o){e===Ac.CUSTOM_STYLES?this.styleProcessingController.processCustomStyles(o):super.attributeChangedCallback(e,r,o)}disconnectedCallback(){this._loadingTimeoutId&&(window.clearTimeout(this._loadingTimeoutId),this._loadingTimeoutId=null),this.sdkStateController?.currentState.isLoading&&this.sdkStateController.forceCompleteLoading(),this._eventListenerController&&(this._eventListenerController.abort(),this._eventListenerController=null),super.disconnectedCallback()}willUpdate(e){e.has(\"options\")&&(this.options?.locale&&(Zi(this.options?.locale)?this.locale=Xi(this.options?.locale):A.warn(\"\\u{1F30E}\\u2757 Unsupported locale provided:\",this.options?.locale,\"- Falling back to default locale `en-GB`\")),qi(this.locale||\"en-GB\"))}updated(){let e=getComputedStyle(this);this.sdkContextController.setComputedStyles(e),this.checkLoadingStateChange()}handleExternalCardSubmit(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:card-submit\",e.detail)}checkLoadingStateChange(){let e=this.sdkStateController?.currentState.isLoading||!1;this.previousLoadingState&&!e&&(this.jsInitialized=!0,q({eventName:\"CHECKOUT_FLOW_STARTED\"})),this.previousLoadingState=e,e&&!this._loadingTimeoutId?this._loadingTimeoutId=window.setTimeout(()=>{this.sdkStateController?.currentState.isLoading&&(A.warn(\"Loading timeout in component, forcing completion\"),this.sdkStateController.forceCompleteLoading(),this.jsInitialized=!0),this._loadingTimeoutId=null},1e4):!e&&this._loadingTimeoutId&&(window.clearTimeout(this._loadingTimeoutId),this._loadingTimeoutId=null)}render(){let e=this.sdkStateController.currentState,r=e.isLoading,o=e.error,a=!r&&!o;return m` ${k(r,()=>h)} ${k(o,()=>m`<primer-checkout-error></primer-checkout-error>`)} ${k(a,()=>m`<slot name=\"main\" @slotchange=${this.onSlotChange}></slot>${k(this.hasAssignedContent,()=>h,()=>m`<primer-main></primer-main>`)} `,()=>h)} `}addEventListener(e,r,o){super.addEventListener(e,r,o)}removeEventListener(e,r,o){super.removeEventListener(e,r,o)}}"
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
"kind": "function",
|
|
95
|
-
"name": "
|
|
95
|
+
"name": "$n"
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
"kind": "function",
|
|
99
|
-
"name": "
|
|
99
|
+
"name": "Vn"
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"kind": "function",
|
|
103
|
-
"name": "
|
|
103
|
+
"name": "wc"
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
"kind": "function",
|
|
107
|
-
"name": "
|
|
107
|
+
"name": "Tc"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
"kind": "variable",
|
|
111
|
-
"name": "
|
|
112
|
-
"default": "class extends v{constructor(){super(...arguments);this.color=\"var(--primer-color-loader)\";this.size=\"medium\";this.compact=!1}getSize(){if(this.size in
|
|
111
|
+
"name": "Ve",
|
|
112
|
+
"default": "class extends v{constructor(){super(...arguments);this.color=\"var(--primer-color-loader)\";this.size=\"medium\";this.compact=!1}getSize(){if(this.size in Oo)return Oo[this.size];let e=parseInt(this.size,10);return isNaN(e)?Oo.medium:e}render(){let e=this.getSize(),r=20,o=`0 0 ${r} ${r}`;return this.style.setProperty(\"--spinner-color\",this.color),this.style.setProperty(\"--spinner-size\",`${e}px`),m`<div class=\"spinner-container ${this.compact?\"compact\":\"\"}\"><svg class=\"spinner\" width=\"${e}\" height=\"${e}\" viewBox=\"${o}\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" role=\"status\" aria-label=\"Loading\" ><path d=\"M4.27827 10.002C4.27827 6.84166 6.84019 4.27973 10.0005 4.27973C10.7676 4.27973 11.3894 3.6579 11.3894 2.89084C11.3894 2.12378 10.7676 1.50195 10.0005 1.50195C5.30607 1.50195 1.50049 5.30753 1.50049 10.002C1.50049 14.6964 5.30607 18.502 10.0005 18.502C14.6949 18.502 18.5005 14.6964 18.5005 10.002C18.5005 9.23489 17.8787 8.61306 17.1116 8.61306C16.3445 8.61306 15.7227 9.23489 15.7227 10.002C15.7227 13.1622 13.1608 15.7242 10.0005 15.7242C6.84019 15.7242 4.27827 13.1622 4.27827 10.002Z\" fill=\"currentColor\" class=\"path\" /></svg></div>`}}"
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"kind": "variable",
|
|
116
|
-
"name": "
|
|
116
|
+
"name": "Ue",
|
|
117
117
|
"default": "class extends v{constructor(){super(...arguments);this.focusWithin=!1;this.hasError=!1;this.handleWrapperClick=e=>{if(e.target!==e.currentTarget)return;let r=this.findSlottedPrimerInput();r?r.focus():this.dispatchEvent(new CustomEvent(\"wrapper-click\",{bubbles:!0,composed:!0}))}}findSlottedPrimerInput(){if(!this.inputSlot)return null;let e=this.inputSlot.assignedElements({flatten:!0}),r=e.find(o=>o.tagName.toLowerCase()===\"primer-input\");if(r)return r;for(let o of e){let a=o.querySelector(\"primer-input\");if(a)return a}return null}render(){let e={\"input-slot\":!0,\"focus-within\":this.focusWithin};return m`<div class=\"input-wrapper\"><slot name=\"label\"></slot><div class=\"${re(e)}\" @click=\"${this.handleWrapperClick}\"><slot name=\"input\"></slot></div><slot name=\"error\"></slot></div>`}}"
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"kind": "variable",
|
|
121
|
-
"name": "
|
|
121
|
+
"name": "Ze",
|
|
122
122
|
"default": "class extends v{constructor(){super(...arguments);this.for=\"\";this.disabled=!1}render(){return m`<label for=${this.for}><slot></slot></label>`}}"
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
"kind": "variable",
|
|
126
|
-
"name": "
|
|
126
|
+
"name": "fe",
|
|
127
127
|
"default": "class extends v{constructor(){super(...arguments);this.variant=\"primary\";this.disabled=!1;this.loading=!1;this.buttonType=\"button\";this.selectionState=\"default\";this.selectable=!1;this.flex=!0;this.handleClick=()=>{!this.selectable||this.disabled||this.loading||(this.selectionState=this.selectionState===\"default\"?\"checked\":\"default\",this.dispatchEvent(new CustomEvent(\"selection-change\",{bubbles:!0,composed:!0,detail:{state:this.selectionState}})))}}renderCheckmark(){return!this.selectable||this.selectionState!==\"checked\"||this.loading?h:m`<primer-icon name=\"checkmark\" size=\"sm\" color=\"var(--primer-color-brand)\" ></primer-icon>`}renderSpinner(){if(!this.loading)return h;let e;return this.variant===\"primary\"?e=\"var(--primer-color-background-outlined-default)\":(this.variant===\"secondary\"||this.variant===\"tertiary\")&&(e=\"var(--primer-color-gray-900)\"),m`<primer-spinner size=\"small\" color=\"${e}\" compact ></primer-spinner>`}render(){return m`<button type=${this.buttonType} ?disabled=${this.disabled||this.loading} @click=${this.handleClick} part=\"button\" aria-checked=${this.selectionState===\"checked\"} aria-busy=${this.loading} >${this.renderSpinner()} ${this.flex?m`<span class=\"button-content ${this.loading?\"loading\":\"\"}\"><slot></slot></span>`:m`<span class=\"button-content-base ${this.loading?\"loading\":\"\"}\" ><slot></slot></span>`} ${this.renderCheckmark()}</button>`}}"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
"kind": "variable",
|
|
131
|
-
"name": "
|
|
131
|
+
"name": "Xe",
|
|
132
132
|
"default": "class extends v{constructor(){super(...arguments);this.for=\"\";this.active=!0}render(){return m`<span class=\"error\" role=\"alert\" aria-live=\"polite\" id=\"${this.for||\"\"}\" ><slot></slot></span>`}}"
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
"kind": "variable",
|
|
136
|
-
"name": "
|
|
137
|
-
"default": "class extends v{constructor(){super(...arguments);this.color=\"var(--primer-color-icon-primary)\";this.size=\"lg\"}render(){let e=this.name
|
|
136
|
+
"name": "Be",
|
|
137
|
+
"default": "class extends v{constructor(){super(...arguments);this.color=\"var(--primer-color-icon-primary)\";this.size=\"lg\"}render(){let e=this.name?zn[this.name]:null;return m`<div style=\"--internal-icon-color: ${this.color}\">${e||m`<slot></slot>`}</div>`}}"
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"kind": "variable",
|
|
141
|
-
"name": "
|
|
141
|
+
"name": "Qe",
|
|
142
142
|
"default": "class extends v{constructor(){super(...arguments);this.type=\"complete\"}render(){return this.type===\"complete\"?m`<primer-icon size=\"lg\" name=\"successful-check\" color=\"var(--primer-color-icon-positive)\" ></primer-icon><p>Checkout complete!</p><p class=\"secondary\"> You'll be redirected to the order confirmation page soon. </p>`:m`<primer-icon size=\"lg\" name=\"failure-icon\" color=\"var(--primer-color-icon-negative)\" ></primer-icon><p>Payment failed</p>${this.description?m`<p class=\"secondary\">${this.description}</p>`:m`<p class=\"secondary\">Something went wrong.</p>`} `}}"
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
"kind": "variable",
|
|
146
|
-
"name": "
|
|
146
|
+
"name": "Y",
|
|
147
147
|
"default": "class extends v{constructor(){super(...arguments);this.value=\"\";this.placeholder=\"\";this.disabled=!1;this.name=\"\";this.type=\"text\";this.required=!1;this.readonly=!1;this.pattern=\"\";this.min=\"\";this.max=\"\";this.step=\"\";this.autocomplete=\"\";this._id=\"\";this.hasFocus=!1;this.hasError=!1;this.handleInput=e=>{e.stopPropagation();let r=e.target;this.value=r.value;let o=new CustomEvent(\"input\",{detail:this.value,bubbles:!0,composed:!0});this.dispatchEvent(o)};this.handleChange=e=>{e.stopPropagation();let r=e.target;this.value=r.value;let o=new CustomEvent(\"change\",{detail:this.value,bubbles:!0,composed:!0});this.dispatchEvent(o)};this.handleFocus=()=>{this.hasFocus=!0,this.dispatchEvent(new FocusEvent(\"focus\",{bubbles:!0,composed:!0}))};this.handleBlur=()=>{this.hasFocus=!1,this.dispatchEvent(new FocusEvent(\"blur\",{bubbles:!0,composed:!0}))};this.handleInvalid=e=>{e.stopPropagation(),this.hasError=!0,this.dispatchEvent(new Event(\"invalid\",{bubbles:!0,composed:!0}))}}get id(){return this._id}set id(e){this._id=e,this.setAttribute(\"id\",e)}focus(e){this.inputElement?.focus(e)}blur(){this.inputElement?.blur()}select(){this.inputElement?.select()}setSelectionRange(e,r,o){this.inputElement?.setSelectionRange(e,r,o)}get validity(){return this.inputElement?.validity||{}}get validationMessage(){return this.inputElement?.validationMessage||\"\"}checkValidity(){return this.inputElement?.checkValidity()||!1}reportValidity(){return this.inputElement?.reportValidity()||!1}render(){let e={input:!0,\"input--focused\":this.hasFocus,\"input--disabled\":this.disabled,\"input--error\":this.hasError,\"input--readonly\":this.readonly},r=Object.entries(e).filter(([,o])=>o).map(([o])=>o).join(\" \");return m`<input part=\"input\" class=${r} .value=${this.value} .type=${this.type} ?disabled=${this.disabled} ?required=${this.required} ?readonly=${this.readonly} placeholder=${this.placeholder} pattern=${this.pattern} minlength=${this.minlength??\"\"} maxlength=${this.maxlength??\"\"} min=${this.min} max=${this.max} step=${this.step} autocomplete=${this.autocomplete} name=${this.name} id=${this.id} @input=${this.handleInput} @change=${this.handleChange} @focus=${this.handleFocus} @blur=${this.handleBlur} @invalid=${this.handleInvalid} />`}addEventListener(e,r,o){super.addEventListener(e,r,o)}removeEventListener(e,r,o){super.removeEventListener(e,r,o)}}"
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
"kind": "variable",
|
|
151
|
-
"name": "
|
|
152
|
-
"default": "class extends v{constructor(){super(...arguments);this.name=\"\";this.id=\"\";this.value=\"\";this.disabled=!1;this.hasError=!1;this.placeholder=\"\";this.options=[]}handleChange(e){let r=e.target,o=this.value;this.value=r.value,this.dispatchEvent(new CustomEvent(\"change\",{detail:this.value,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"input\",{detail:this.value,bubbles:!0,composed:!0})),this.requestUpdate(\"value\",o)}handleFocus(){this.dispatchEvent(new CustomEvent(\"focus\",{bubbles:!0,composed:!0}))}handleBlur(){this.dispatchEvent(new CustomEvent(\"blur\",{bubbles:!0,composed:!0}))}renderSelectOptions(){let e=[];for(let r of this.options)e.push(m`<option value=${r.value}>${r.label}</option>`);return e}render(){return m`<select id=${this.id} name=${this.name} .value=${
|
|
151
|
+
"name": "ge",
|
|
152
|
+
"default": "class extends v{constructor(){super(...arguments);this.name=\"\";this.id=\"\";this.value=\"\";this.disabled=!1;this.hasError=!1;this.placeholder=\"\";this.options=[]}handleChange(e){let r=e.target,o=this.value;this.value=r.value,this.dispatchEvent(new CustomEvent(\"change\",{detail:this.value,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"input\",{detail:this.value,bubbles:!0,composed:!0})),this.requestUpdate(\"value\",o)}handleFocus(){this.dispatchEvent(new CustomEvent(\"focus\",{bubbles:!0,composed:!0}))}handleBlur(){this.dispatchEvent(new CustomEvent(\"blur\",{bubbles:!0,composed:!0}))}renderSelectOptions(){let e=[];for(let r of this.options)e.push(m`<option value=${r.value}>${r.label}</option>`);return e}render(){return m`<select id=${this.id} name=${this.name} .value=${qn(this.value)} ?disabled=${this.disabled} ?required=${!this.value} @change=${this.handleChange} @focus=${this.handleFocus} @blur=${this.handleBlur} aria-invalid=${this.hasError?\"true\":\"false\"} ><option value=\"\" disabled ?selected=${!this.value}>${this.placeholder||\"Select an option\"}</option>${this.renderSelectOptions()}</select>`}}"
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
155
|
"kind": "variable",
|
|
156
|
-
"name": "
|
|
156
|
+
"name": "ye",
|
|
157
157
|
"default": "class extends v{constructor(){super(...arguments);this.header=\"\";this.expanded=!1;this.expandText=\"Expand\";this.collapseText=\"Collapse\";this.ariaLabel=\"\";this.buttonVariant=\"primary\";this.isExpanded=!1;this.toggleExpanded=()=>{this.isExpanded=!this.isExpanded,this.dispatchExpandedChangedEvent(this.isExpanded)}}connectedCallback(){super.connectedCallback(),this.isExpanded=this.expanded}dispatchExpandedChangedEvent(e){this.dispatchEvent(new CustomEvent(\"expanded-changed\",{bubbles:!0,composed:!0,detail:{expanded:e}}))}expand(){this.isExpanded||(this.isExpanded=!0,this.dispatchExpandedChangedEvent(!0))}collapse(){this.isExpanded&&(this.isExpanded=!1,this.dispatchExpandedChangedEvent(!1))}render(){let e=this.isExpanded?this.collapseText:this.expandText,r=this.ariaLabel||this.header||e,o=this.header||e;return m`<div class=\"collapsable\"><primer-button variant=${this.buttonVariant} buttonType=\"button\" @click=${this.toggleExpanded} aria-expanded=${this.isExpanded} aria-controls=\"collapsable-content\" aria-label=${r} ><span>${o}</span></primer-button><div class=\"collapsable-wrapper ${this.isExpanded?\"expanded\":\"\"}\" id=\"collapsable-content\" role=\"region\" aria-labelledby=\"collapsable-header\" ><div class=\"collapsable-content\"><slot></slot></div></div></div>`}}"
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
"kind": "variable",
|
|
161
|
-
"name": "
|
|
161
|
+
"name": "Ye",
|
|
162
162
|
"default": "class extends v{constructor(){super();this.message=\"\";this.visible=!1;this._role=\"alert\";this.showMessage=!1;this.role=\"alert\"}get role(){return this._role}set role(e){this._role=e,this.setAttribute(\"role\",e)}updated(e){e.has(\"visible\")&&this.handleVisibilityChange()}handleVisibilityChange(){this.visible?(this.showMessage=!0,this.setAttribute(\"aria-hidden\",\"false\")):setTimeout(()=>{this.showMessage=!1,this.setAttribute(\"aria-hidden\",\"true\")},200)}render(){if(!this.showMessage&&!this.visible)return h;let e={\"error-message\":!0,hidden:!this.visible};return m`<div part=\"error-message\" class=${re(e)} aria-live=\"assertive\" aria-atomic=\"true\" ><div part=\"error-icon\" class=\"error-icon\"><primer-icon name=\"failure-icon\" size=\"sm\" color=\"var(--primer-color-icon-negative)\" ></primer-icon></div><div part=\"error-content\" class=\"error-content\">${this.message}</div></div>`}}"
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
165
|
"kind": "variable",
|
|
166
|
-
"name": "
|
|
166
|
+
"name": "ht",
|
|
167
167
|
"default": "class extends v{constructor(){super(...arguments);this._id=`d${Math.random().toString(36).substring(7)}`;this._handleSlotChange=e=>{let o=e.target.assignedNodes();if(!o.length)return;let a=this.getContainer();o.forEach(n=>a.appendChild(n))}}get id(){return this._id}getContainer(){let e=document.querySelector(`#${this._id}`);return e||(e=document.createElement(\"div\"),e.id=this._id,document.body.appendChild(e),this._setupEventListeners(e)),e}_setupEventListeners(e){[\"primer-ach-error\",\"primer-ach-bank-details-collected\",\"primer-ach-mandate-confirmed\",\"primer-ach-mandate-declined\",\"primer-dialog-close\"].forEach(r=>{e.addEventListener(r,o=>{o.stopPropagation(),this.dispatchEvent(new CustomEvent(r,{bubbles:!0,composed:!0,detail:o.detail}))})})}disconnectedCallback(){super.disconnectedCallback(),this.getContainer().remove()}render(){return m`<slot @slotchange=${this._handleSlotChange}></slot>`}}"
|
|
168
168
|
},
|
|
169
169
|
{
|
|
170
170
|
"kind": "variable",
|
|
171
|
-
"name": "
|
|
171
|
+
"name": "Ne",
|
|
172
172
|
"default": "class extends v{constructor(){super(...arguments);this.size=\"flex\";this.showCloseButton=!0;this._animationState=\"entering\";this._isVisible=!1;this._handleCloseClick=()=>{this._startExitAnimation()}}startExitAnimation(){this._startExitAnimation()}connectedCallback(){super.connectedCallback(),document.body.style.overflow=\"hidden\",this._startEnterAnimation()}disconnectedCallback(){super.disconnectedCallback(),document.body.style.overflow=\"\",this._animationTimeout&&clearTimeout(this._animationTimeout)}_startEnterAnimation(){this._animationState=\"entering\",this._isVisible=!0,requestAnimationFrame(()=>{this._animationTimeout=window.setTimeout(()=>{this._animationState=\"entered\"},500)})}_startExitAnimation(){this._animationTimeout&&clearTimeout(this._animationTimeout),this._animationState=\"exiting\",this._animationTimeout=window.setTimeout(()=>{this._animationState=\"exited\",this._isVisible=!1,this.dispatchEvent(new CustomEvent(\"primer-dialog-close\",{bubbles:!0,composed:!0}))},500)}render(){return this._isVisible?m`<div class=${re({backdrop:!0,\"backdrop--entering\":this._animationState===\"entering\",\"backdrop--entered\":this._animationState===\"entered\",\"backdrop--exiting\":this._animationState===\"exiting\"})} @click=${e=>{e.preventDefault()}} ><div class=${re({dialog:!0,[this.size]:!0,\"dialog--entering\":this._animationState===\"entering\",\"dialog--entered\":this._animationState===\"entered\",\"dialog--exiting\":this._animationState===\"exiting\"})} ><div class=\"header\">${this.showCloseButton?m`<primer-button variant=\"tertiary\" @click=${this._handleCloseClick} ><primer-icon name=\"close\"></primer-icon></primer-button>`:\"\"}</div><div class=\"content\"><slot></slot></div></div></div>`:m``}}"
|
|
173
173
|
},
|
|
174
174
|
{
|
|
175
175
|
"kind": "variable",
|
|
176
176
|
"name": "ie",
|
|
177
|
-
"default": "class extends v{constructor(){super(...arguments);this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this.klarnaCategories=null;this.disabled=!1;this.selectedCategory=null;this.isExpanded=!1;this.headerAriaLabel=C(\"pay_with\",{id:\"pay_with\"});this._paymentMethodManagerTask=new
|
|
177
|
+
"default": "class extends v{constructor(){super(...arguments);this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this.klarnaCategories=null;this.disabled=!1;this.selectedCategory=null;this.isExpanded=!1;this.headerAriaLabel=C(\"pay_with\",{id:\"pay_with\"});this._paymentMethodManagerTask=new D(this,{task:async([e,r])=>{if(!e||!r)return R;let o=await r.getCDNAssets(\"KLARNA\");return{manager:e.manager,klarnaIcon:o?.assets?.icon?`${o.goatCdnUrl}/${o.assets.icon}`:\"\"}},args:()=>[this.paymentManagers.get(\"KLARNA\"),this.headlessUtils]});this.toggleExpand=()=>{this.disabled||(this.isExpanded=!this.isExpanded,this.isExpanded||(this.selectedCategory=null))}}async startKlarnaPayment(){if(!(!this._paymentMethodManagerTask.value||!this.selectedCategory))try{await this._paymentMethodManagerTask.value.manager.start({paymentMethodCategoryId:this.selectedCategory})}catch(e){A.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){A.errorWithDatadog(\"Failed to render Klarna category\",{error:e})}}selectCategory(e){this.disabled||(this.selectedCategory=e,this.renderSelectedCategory())}updated(e){e.has(\"selectedCategory\")&&this.selectedCategory&&this.renderSelectedCategory()}renderCategorySelection(){let e=this.klarnaCategories?.categories||[];return this.klarnaCategories?.isLoading||!1?m`<div class=\"loading\"><primer-spinner size=\"small\"></primer-spinner></div>`:m`<div class=\"category-selection\">${e.map(o=>m`<button class=${re({\"category-button\":!0,selected:o.id===this.selectedCategory})} @click=${()=>{this.selectCategory(o.id)}} ?disabled=${this.disabled} >${o.name}</button>`)}</div>`}renderExpandedContent(){return m` ${this.renderCategorySelection()} ${this.selectedCategory?m`<div id=\"klarna-category-container\" class=\"klarna-category-container\" ></div>`:h}<button class=${re({\"klarna-pay-button\":!0,loading:!!this.sdkState?.isProcessing,disabled:!this.selectedCategory||this.disabled})} ?disabled=${!this.selectedCategory||this.sdkState?.isProcessing||this.disabled} @click=${()=>this.startKlarnaPayment()} >${C(\"confirm\",{id:\"confirm\"})}</button>`}render(){return this._paymentMethodManagerTask.render({error:e=>{let r=e instanceof Error?e.message:\"Unknown error in Klarna\";return m`<div class=\"error\"> Error loading Klarna: ${r}</div>`},complete:({manager:e,klarnaIcon:r})=>e?m`<div class=\"klarna-container ${this.isExpanded?\"expanded\":\"\"}\"><div class=\"klarna-button-header\"><primer-button buttonType=\"button\" variant=\"secondary\" class=\"klarna-button\" @click=${this.toggleExpand} aria-expanded=${this.isExpanded} aria-controls=\"collapsable-content\" aria-label=${this.headerAriaLabel} ?disabled=${this.disabled} ><img src=${r} alt=\"Klarna logo\" /><span>${C(\"pay_with\",{id:\"pay_with\"})} Klarna</span><span class=\"klarna-accordion-icon ${this.isExpanded?\"expanded\":\"\"}\" > ▼ </span></primer-button></div><div class=\"klarna-expanded-content ${this.isExpanded?\"visible\":\"\"}\" ><div class=\"klarna-accordion-content\">${this.renderExpandedContent()}</div></div></div>`:h})}}"
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
180
|
"kind": "variable",
|
|
181
|
-
"name": "
|
|
182
|
-
"default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.loadManagerTask=new
|
|
181
|
+
"name": "He",
|
|
182
|
+
"default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.loadManagerTask=new D(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return R;let r=this.paymentManagers.get(e);if(!r)throw new Error(`No manager found for payment method type ${e}`);if(r.type!==\"GOOGLE_PAY\")throw new Error(\"Invalid payment method type for Google Pay component\");return r.manager}}),this.renderButtonTask=new D(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return R;await this.updateComplete;let r=e.createButton();return await r.render(this.shadowRoot?.getRootNode(),{style:{shadowRoot:!0}}),this.disabled&&await r.setDisabled(this.disabled),this.disabled&&this.shadowRoot&&(await this.updateComplete,Ei(this.disabled,this.shadowRoot)),r}})}attributeChangedCallback(e,r,o){if(super.attributeChangedCallback(e,r,o),e===\"disabled\"&&r!==o){let a=o!==null,n=this.renderButtonTask.value;n&&n.setDisabled(a)}}updated(e){e.has(\"disabled\")&&this.shadowRoot&&Ei(this.disabled,this.shadowRoot)}render(){return h}}"
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
"kind": "variable",
|
|
186
|
-
"name": "
|
|
187
|
-
"default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.buttonContainerRef=
|
|
186
|
+
"name": "Fe",
|
|
187
|
+
"default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.buttonContainerRef=Lt();this.loadManagerTask=new D(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return R;let r=this.paymentManagers.get(e);if(!r)throw new Error(`No manager found for payment method type ${e}`);if(r.type!==\"APPLE_PAY\")throw new Error(\"Invalid payment method type for Apple Pay component\");return r.manager}}),this.renderButtonTask=new D(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return R;await this.updateComplete;let r=this.buttonContainerRef.value;if(!r)throw new Error(\"Button container not found\");let o=e.createButton(),a=xi(r);return await o.render(r,{style:{buttonHeight:a}}),this.disabled&&await o.setDisabled(this.disabled),this.disabled&&(await this.updateComplete,Kt(this.disabled,this.buttonContainerRef)),o}})}attributeChangedCallback(e,r,o){if(super.attributeChangedCallback(e,r,o),e===\"disabled\"&&r!==o){let a=o!==null,n=this.renderButtonTask.value;n&&n.setDisabled(a)}}updated(e){e.has(\"disabled\")&&Kt(this.disabled,this.buttonContainerRef)}render(){return m`<div class=\"native-button-container\" ${gt(this.buttonContainerRef)} ></div>`}}"
|
|
188
188
|
},
|
|
189
189
|
{
|
|
190
190
|
"kind": "variable",
|
|
191
|
-
"name": "
|
|
192
|
-
"default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.buttonContainerRef=
|
|
191
|
+
"name": "ze",
|
|
192
|
+
"default": "class extends v{constructor(){super();this.paymentManagers=new Map;this.disabled=!1;this.buttonContainerRef=Lt();this.loadManagerTask=new D(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return R;let r=this.paymentManagers.get(e);if(!r)throw new Error(`No manager found for payment method type ${e}`);if(r.type!==\"PAYPAL\")throw new Error(\"Invalid payment method type for PayPal component\");return r.manager}}),this.renderButtonTask=new D(this,{args:()=>[this.loadManagerTask.value],task:async([e])=>{if(!e)return R;await this.updateComplete;let r=this.buttonContainerRef.value;if(!r)throw new Error(\"Button container not found\");let o=e.createButton(),a=xi(this),n=ss(a),s=55;return a>s&&A.warn(`PayPal button height (${a}px) exceeds maximum allowed height of ${s}px. Button will be capped at ${s}px. This is a PayPal SDK limitation.`),await o.render(r,{style:{buttonHeight:n}}),this.disabled&&await o.setDisabled(this.disabled),this.disabled&&(await this.updateComplete,Kt(this.disabled,this.buttonContainerRef)),o}})}attributeChangedCallback(e,r,o){if(super.attributeChangedCallback(e,r,o),e===\"disabled\"&&r!==o){let a=o!==null,n=this.renderButtonTask.value;n&&n.setDisabled(a)}}updated(e){e.has(\"disabled\")&&Kt(this.disabled,this.buttonContainerRef)}render(){return m`<div class=\"native-button-container\" ${gt(this.buttonContainerRef)} ></div>`}}"
|
|
193
193
|
},
|
|
194
194
|
{
|
|
195
195
|
"kind": "variable",
|
|
196
|
-
"name": "
|
|
197
|
-
"default": "class extends v{constructor(){super(...arguments);this.disabled=!1;this.paymentManagers=new Map;this.currentState=\"collapsed\";this.blikCode=\"\";this.errorMessage=\"\";this.pollingDuration=0;this.pollingTimer=null;this.loadManagerTask=new
|
|
196
|
+
"name": "ve",
|
|
197
|
+
"default": "class extends v{constructor(){super(...arguments);this.disabled=!1;this.paymentManagers=new Map;this.currentState=\"collapsed\";this.blikCode=\"\";this.errorMessage=\"\";this.pollingDuration=0;this.pollingTimer=null;this.loadManagerTask=new D(this,{args:()=>[this.paymentMethod?.type],task:([e])=>{if(!e)return R;let r=this.paymentManagers.get(e);if(!r)throw new Error(\"BLIK payment method manager not initialized\");if(r.type!==\"ADYEN_BLIK\")throw new Error(\"Invalid payment method type for BLIK component\");return r.manager}});this.handleButtonClick=async()=>{if(this.disabled)return;if(this.currentState===\"expanded-input\"){this.handleCollapse();return}if(this.currentState!==\"collapsed\")return;let e=this.paymentMethod?.type;if(!e){this.errorMessage=C(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",A.error(\"Payment method type not available\");return}let r=this.paymentManagers.get(e);if(!r||r.type!==\"ADYEN_BLIK\"){this.errorMessage=C(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",A.error(\"Manager not available when expanding BLIK form\");return}this.currentState=\"expanded-input\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()};this.handleCollapse=()=>{this.currentState=\"collapsed\",this.blikCode=\"\",this.errorMessage=\"\",this.stopPollingTimer()};this.handleInput=e=>{let r=e.target,o=r.value,n=o.replace(/\\D/g,\"\").slice(0,6);o!==n&&(r.value=n),this.blikCode=n,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\"),n.length===6&&this.submitBlikCode()};this.handleRetry=async()=>{this.currentState=\"expanded-input\",this.errorMessage=\"\",this.blikCode=\"\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()}}startPollingTimer(){this.pollingDuration=0,this.pollingTimer=window.setInterval(()=>{this.pollingDuration+=1},1e3)}stopPollingTimer(){this.pollingTimer!==null&&(window.clearInterval(this.pollingTimer),this.pollingTimer=null),this.pollingDuration=0}async submitBlikCode(){if(this.blikCode.length!==6){this.errorMessage=C(\"sixDigitCodeErrorTooShort\",{id:\"sixDigitCodeErrorTooShort\"}),this.currentState=\"error\";return}let e=this.loadManagerTask.value;if(!e){this.errorMessage=\"BLIK payment method not initialized\",this.currentState=\"error\",A.error(\"BLIK manager not available via loadManagerTask\");return}this.currentState=\"loading\",this.errorMessage=\"\",this.startPollingTimer();try{await e.start({blikCode:this.blikCode}),this.stopPollingTimer(),this.currentState=\"collapsed\",this.blikCode=\"\"}catch(r){this.stopPollingTimer(),this.currentState=\"error\",this.errorMessage=r instanceof Error?r.message:C(\"tokenizationError\",{id:\"tokenizationError\"}),A.errorWithDatadog(\"BLIK payment failed\",{error:r instanceof Error?{message:r.message,name:r.name}:\"Unknown error\"})}}renderCollapsed(){return m`<primer-button class=\"blik-button\" @click=${this.handleButtonClick} ?disabled=${this.disabled} aria-label=\"${C(\"pay_with\",{id:\"pay_with\"})} BLIK\" aria-expanded=\"${this.currentState!==\"collapsed\"}\" title=\"BLIK\" ><span class=\"image-container\"><img src=\"https://goat-assets.production.core.primer.io/button/blik/inverted.png\" alt=\"BLIK\" /></span></primer-button>`}renderExpandedInput(){return m`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-input-wrapper\"><label for=\"blik-code\" class=\"blik-label\">${C(\"getCodeFromBankingApp\",{id:\"getCodeFromBankingApp\"})}</label><input id=\"blik-code\" type=\"text\" inputmode=\"numeric\" pattern=\"[0-9]*\" maxlength=\"6\" class=\"blik-input\" .value=\"${this.blikCode}\" @input=\"${this.handleInput}\" ?disabled=\"${this.disabled}\" placeholder=\"000000\" aria-label=\"${C(\"sixDigitCodeLabel\",{id:\"sixDigitCodeLabel\"})}\" autocomplete=\"off\" spellcheck=\"false\" /></div></div></div>`}renderLoading(){return m`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-loading\"><primer-spinner size=\"medium\"></primer-spinner>${this.pollingDuration>30?m`<div class=\"blik-timeout-warning\"> This is taking longer than expected... </div>`:h}</div></div></div>`}renderError(){return m`<div class=\"blik-expanded-content\"><div class=\"blik-content-wrapper\"><div class=\"blik-error\"><div class=\"blik-error-message\" role=\"alert\">${this.errorMessage||C(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"blik-retry-button\" @click=\"${this.handleRetry}\" ?disabled=\"${this.disabled}\" >${C(\"retry_button\",{id:\"retry_button\"})}</button></div></div></div>`}renderExpandedState(){switch(this.currentState){case\"expanded-input\":return this.renderExpandedInput();case\"loading\":return this.renderLoading();case\"error\":return this.renderError();default:return h}}disconnectedCallback(){super.disconnectedCallback(),this.stopPollingTimer()}render(){return m`<div class=\"blik-container ${this.currentState!==\"collapsed\"?\"expanded\":\"\"}\" >${this.renderCollapsed()} ${this.currentState!==\"collapsed\"?this.renderExpandedState():h}</div>`}}"
|
|
198
198
|
},
|
|
199
199
|
{
|
|
200
200
|
"kind": "variable",
|
|
201
|
-
"name": "
|
|
202
|
-
"default": "class extends v{constructor(){super(...arguments);this.type=void 0;this.disabled=!1;this.paymentMethods=null;this.analyticsUtils=null;this.handleClick=()=>{this.paymentMethods?.get(this.type)?.managerType!==\"CARD\"&&this.sendPaymentMethodSelectionEvent()}}sendPaymentMethodSelectionEvent(){this.type&&q({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:this.type})}render(){if(!this.type)return h;let e=this.paymentMethods?.get(this.type);if(!e)return h;let r;switch(e?.managerType){case\"CARD\":r=m`<primer-card-form ?disabled=${this.disabled} ></primer-card-form>`;break;case\"NATIVE\":{let o=e.type;o===
|
|
201
|
+
"name": "Le",
|
|
202
|
+
"default": "class extends v{constructor(){super(...arguments);this.type=void 0;this.disabled=!1;this.paymentMethods=null;this.analyticsUtils=null;this.handleClick=()=>{this.paymentMethods?.get(this.type)?.managerType!==\"CARD\"&&this.sendPaymentMethodSelectionEvent()}}sendPaymentMethodSelectionEvent(){this.type&&q({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:this.type})}render(){if(!this.type)return h;let e=this.paymentMethods?.get(this.type);if(!e)return h;let r;switch(e?.managerType){case\"CARD\":r=m`<primer-card-form ?disabled=${this.disabled} ></primer-card-form>`;break;case\"NATIVE\":{let o=e.type;o===vr.GOOGLE_PAY?r=m`<primer-google-pay .paymentMethod=${e} ?disabled=${this.disabled} ></primer-google-pay>`:o===vr.APPLE_PAY?r=m`<primer-apple-pay .paymentMethod=${e} ?disabled=${this.disabled} ></primer-apple-pay>`:o===vr.PAYPAL?r=m`<primer-paypal .paymentMethod=${e} ?disabled=${this.disabled} ></primer-paypal>`:o===vr.ADYEN_BLIK&&(r=m`<primer-blik .paymentMethod=${e} ?disabled=${this.disabled} ></primer-blik>`);break}case\"REDIRECT\":r=m`<primer-redirect-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-redirect-payment>`;break;case\"KLARNA\":r=m`<primer-klarna ?disabled=${this.disabled} ></primer-klarna>`;break;case\"ACH\":r=m`<primer-dynamic-payment .paymentMethod=${e} ></primer-dynamic-payment>`;break;default:return h}return m`<div @click=${this.handleClick}>${r}</div>`}}"
|
|
203
203
|
},
|
|
204
204
|
{
|
|
205
205
|
"kind": "variable",
|
|
206
|
-
"name": "
|
|
206
|
+
"name": "Me",
|
|
207
207
|
"default": "class extends v{constructor(){super(...arguments);this.disabled=!1;this.paymentMethods=null;this.clientOptions=null}getFilteredMethods(){if(!this.paymentMethods)return[];let e=this.paymentMethods.toArray();if(this.include){let r=this.include.split(\",\").map(o=>o.trim());e=e.filter(o=>r.includes(o.type))}if(this.exclude){let r=this.exclude.split(\",\").map(o=>o.trim());e=e.filter(o=>!r.includes(o.type))}return e}render(){let e=this.getFilteredMethods();return e.length===0?h:m`<div class=\"payment-methods-container\">${e.map(r=>m`<primer-payment-method type=\"${r.type}\" ?disabled=\"${this.disabled||this.clientOptions?.disabledPayments===!0}\" ></primer-payment-method>`)}</div>`}}"
|
|
208
208
|
},
|
|
209
209
|
{
|
|
210
210
|
"kind": "variable",
|
|
211
|
-
"name": "
|
|
212
|
-
"default": "class extends v{constructor(){super(...arguments);this.formController=new
|
|
211
|
+
"name": "xe",
|
|
212
|
+
"default": "class extends v{constructor(){super(...arguments);this.formController=new Si(this,e=>this._paymentMethodManagerTask.value.setAndValidate(e));this.paymentManagers=new Map;this.sdkState=void 0;this.clientOptions=void 0;this.screen=\"form\";this.isSubmitting=!1;this._paymentMethodManagerTask=new D(this,{task:([e])=>e!==\"STRIPE_ACH\"?R:this.paymentManagers.get(e)?.manager,args:()=>[this.paymentMethod?.type]})}_handleInput(e,r){let o=e.target;this.formController.setFieldValue(r,o.value)}_handleBlur(e){this.formController.setFieldTouched(e)}_handleError(e){this.dispatchEvent(new CustomEvent(\"primer-ach-error\",{bubbles:!0,composed:!0,detail:{error:e instanceof Error?e:new Error(typeof e==\"string\"?e:\"Unknown error occurred\")}}))}async _handleSubmitButtonClick(e){if(!this.isSubmitting){this.isSubmitting=!0;try{let r=await e.start(this.formController.formData);if(!r||r.valid)return await this._handleCollectBankAccountDetails(e);r&&this.formController.setValidation(r,!0)}catch(r){this._handleError(r)}finally{this.isSubmitting=!1}}}async _handleCollectBankAccountDetails(e){try{await e.collectBankAccountDetails(),this.screen=\"mandate\",this.dispatchEvent(new CustomEvent(\"primer-ach-bank-details-collected\",{bubbles:!0,composed:!0}))}catch(r){this._handleError(r)}}async _handleConfirmMandate(){if(this._paymentMethodManagerTask.value){this.isSubmitting=!0;try{await this._paymentMethodManagerTask.value.confirmMandate(),this.dispatchEvent(new CustomEvent(\"primer-ach-mandate-confirmed\",{bubbles:!0,composed:!0}))}catch(e){this._handleError(e)}finally{this.isSubmitting=!1}}}async _handleDeclineMandate(){if(this._paymentMethodManagerTask.value){this.isSubmitting=!0;try{await this._paymentMethodManagerTask.value.declineMandate(),this.dispatchEvent(new CustomEvent(\"primer-ach-mandate-declined\",{bubbles:!0,composed:!0}))}catch(e){this._handleError(e)}finally{this.isSubmitting=!1}}}renderForm(e){return m`<h2>${C(\"payWithAch\",{id:\"payWithAch\"})}</h2><p>${C(\"stripe_ach_user_details_collection_subtitle_label\",{id:\"stripe_ach_user_details_collection_subtitle_label\"})}</p><form @submit=${r=>r.preventDefault()}><div class=\"form-row\"><primer-input-wrapper .hasError=${this.formController.hasError.firstName} ><primer-input-label slot=\"label\">${C(\"stripe_ach_user_details_collection_first_name_label\",{id:\"stripe_ach_user_details_collection_first_name_label\"})}</primer-input-label><primer-input slot=\"input\" .value=${this.formController.formState.firstName.value} @input=${r=>this._handleInput(r,\"firstName\")} @blur=${()=>this._handleBlur(\"firstName\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.firstName?this.formController.formState.firstName.error:h}</primer-input-error></primer-input-wrapper><primer-input-wrapper .hasError=${this.formController.hasError.lastName} ><primer-input-label slot=\"label\">${C(\"stripe_ach_user_details_collection_last_name_label\",{id:\"stripe_ach_user_details_collection_last_name_label\"})}</primer-input-label><primer-input slot=\"input\" .value=${this.formController.formState.lastName.value} @input=${r=>this._handleInput(r,\"lastName\")} @blur=${()=>this._handleBlur(\"lastName\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.lastName?this.formController.formState.lastName.error:h}</primer-input-error></primer-input-wrapper></div><primer-input-wrapper .hasError=${this.formController.hasError.emailAddress} ><primer-input-label slot=\"label\">${C(\"stripe_ach_user_details_collection_email_address_label\",{id:\"stripe_ach_user_details_collection_email_address_label\"})}</primer-input-label><primer-input slot=\"input\" type=\"email\" .value=${this.formController.formState.emailAddress.value} @input=${r=>this._handleInput(r,\"emailAddress\")} @blur=${()=>this._handleBlur(\"emailAddress\")} ?disabled=${this.isSubmitting} ></primer-input><primer-input-error slot=\"error\">${this.formController.hasError.emailAddress?this.formController.formState.emailAddress.error:h}</primer-input-error></primer-input-wrapper><p>${C(\"stripe_ach_user_details_collection_data_usage_label\",{id:\"stripe_ach_user_details_collection_data_usage_label\"})}</p><primer-button buttonType=\"submit\" variant=\"primary\" @click=${()=>this._handleSubmitButtonClick(e)} ?disabled=${this.isSubmitting} ?loading=${this.isSubmitting} >${C(\"stripe_ach_user_details_collection_continue_button\",{id:\"stripe_ach_user_details_collection_continue_button\"})}</primer-button></form>`}renderMandate(){return m`<h2>${C(\"payWithAch\",{id:\"payWithAch\"})}</h2><p>${this.clientOptions?.stripe?.mandateData.fullMandateText??C(\"stripe_ach_mandate_template_web\",{id:\"stripe_ach_mandate_template_web\"}).replace(/\\{merchantName\\}/g,this.clientOptions?.stripe?.mandateData.merchantName??\"Merchant\")}</p><div class=\"button-group\"><primer-button variant=\"primary\" @click=${this._handleConfirmMandate.bind(this)} ?disabled=${this.isSubmitting} ?loading=${this.isSubmitting} >${C(\"stripe_ach_mandate_accept_button\",{id:\"stripe_ach_mandate_accept_button\"})}</primer-button><primer-button variant=\"tertiary\" @click=${this._handleDeclineMandate.bind(this)} ?disabled=${this.isSubmitting} >${C(\"stripe_ach_mandate_cancel_payment_button\",{id:\"stripe_ach_mandate_cancel_payment_button\"})}</primer-button></div>`}render(){return this._paymentMethodManagerTask.render({complete:e=>e?this.screen===\"form\"?this.renderForm(e):this.renderMandate():h})}}"
|
|
213
213
|
},
|
|
214
214
|
{
|
|
215
215
|
"kind": "variable",
|
|
216
|
-
"name": "
|
|
217
|
-
"default": "class extends v{constructor(){super(...arguments);this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this.open=!1;this._paymentMethodManagerTask=new
|
|
216
|
+
"name": "ke",
|
|
217
|
+
"default": "class extends v{constructor(){super(...arguments);this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this.open=!1;this._paymentMethodManagerTask=new D(this,{task:([e,r])=>!e||!r?R:r.get(e)?.manager,args:()=>[this.paymentMethod?.type,this.paymentManagers]});this._getAssetsTask=new D(this,{task:([e,r])=>{if(!e||!r)return R;let o=r.getPaymentMethodConfiguration(e);return o?{backgroundColor:o.displayMetadata.button.backgroundColor.colored,name:o.name,displayName:this._legacyGetButtonLabel(o.displayMetadata.button.text),iconUrl:o.displayMetadata.button.iconUrl.colored||o.displayMetadata.button.iconUrl.light||o.displayMetadata.button.iconUrl.dark}:R},args:()=>[this.paymentMethod?.type,this.headlessUtils]});this._setupTasks=new D(this,{task:([e,r])=>!e||!r?R:{paymentMethodManager:e,assetsConfig:r},args:()=>[this._paymentMethodManagerTask.value,this._getAssetsTask.value]})}_legacyGetButtonLabel(e){if(!e)return;let r=e?Cr(e):\"\";return r===\"payWith\"&&(r=\"pay_with\"),C(r,{id:r})}start(){this._paymentMethodManagerTask.value&&(this.open=!0)}renderDialog(){return this.open?m`<primer-portal><primer-dialog @primer-dialog-close=\"${()=>this.open=!1}\"><primer-ach-payment .paymentMethod=${this.paymentMethod} @primer-ach-error=${()=>this.open=!1} @primer-ach-mandate-confirmed=${()=>this.open=!1} @primer-ach-mandate-declined=${()=>this.open=!1} ></primer-ach-payment></primer-dialog></primer-portal>`:h}render(){return this._setupTasks.render({error:()=>h,complete:({assetsConfig:e})=>(this.style.setProperty(\"--dynamic-payment-button-bg-color\",e.backgroundColor),m`<primer-button @click=\"${()=>this.start()}\" class=${re({loading:!!this.sdkState?.isProcessing,reverse:!0})} title=\"${C(\"pay_with\",{id:\"pay_with\"})} ${e.name}\" ><span class=\"image-container\"><img src=\"${e.iconUrl}\" alt=\"${e.name}\" /></span>${e.displayName}</primer-button>${this.renderDialog()} `)})}}"
|
|
218
218
|
},
|
|
219
219
|
{
|
|
220
220
|
"kind": "variable",
|
|
221
|
-
"name": "
|
|
222
|
-
"default": "class extends v{constructor(){super(...arguments);this.disabled=!1;this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this._paymentMethodManagerTask=new
|
|
221
|
+
"name": "Ie",
|
|
222
|
+
"default": "class extends v{constructor(){super(...arguments);this.disabled=!1;this.paymentManagers=new Map;this.sdkState=null;this.headlessUtils=null;this._paymentMethodManagerTask=new D(this,{task:([e,r])=>!e||!r?R:r.get(e)?.manager,args:()=>[this.paymentMethod?.type,this.paymentManagers]});this._getAssetsTask=new D(this,{task:([e,r])=>{if(!e||!r)return R;let o=r.getPaymentMethodConfiguration(e);if(!o)return R;let a=o.displayMetadata.button.backgroundColor.colored??o.displayMetadata.button.backgroundColor.light,n=o.displayMetadata.button.iconPositionRelativeToText||\"START\";return{backgroundColor:a,name:o.name,displayName:this._legacyGetButtonLabel(o.displayMetadata.button.text),iconUrl:o.displayMetadata.button.iconUrl.colored??o.displayMetadata.button.iconUrl.light,iconPosition:n}},args:()=>[this.paymentMethod?.type,this.headlessUtils]});this._setupTasks=new D(this,{task:([e,r])=>!e||!r?R:{paymentMethodManager:e,assetsConfig:r},args:()=>[this._paymentMethodManagerTask.value,this._getAssetsTask.value]})}_legacyGetButtonLabel(e){if(!e)return;let r=e?Cr(e):\"\";return r===\"payWith\"&&(r=\"pay_with\"),C(r,{id:r})}startRedirectPayment(){this.disabled||this._paymentMethodManagerTask.value&&this._paymentMethodManagerTask.value.start()}render(){return this._setupTasks.render({error:()=>h,complete:({assetsConfig:e})=>{this.style.setProperty(\"--redirect-payment-button-bg-color\",e.backgroundColor);let r={loading:!!this.sdkState?.isProcessing,\"icon-end\":e.iconPosition===\"END\",\"image-only\":!e.displayName},o=e.displayName?m`<span class=\"image-container\"><img src=\"${e.iconUrl}\" alt=\"${e.name}\" /></span><span class=\"button-text\">${e.displayName}</span>`:m`<span class=\"image-container\"><img src=\"${e.iconUrl}\" alt=\"${e.name}\" /></span>`;return m`<primer-button @click=\"${()=>this.startRedirectPayment()}\" class=${re(r)} title=\"${C(\"pay_with\",{id:\"pay_with\"})} ${e.name}\" ?disabled=${this.disabled} >${o}</primer-button>`}})}}"
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
"kind": "variable",
|
|
226
226
|
"name": "oe",
|
|
227
|
-
"default": "class extends v{constructor(){super(...arguments);this.configuration=null;this.headlessUtils=null;this.formData={};this.errors={};this.touchedFields=new Set;this.dirtyFields=new Set;this.focusedField=null;this.submitted=!1;this.countryOptions=[];this._initializationTask=new
|
|
227
|
+
"default": "class extends v{constructor(){super(...arguments);this.configuration=null;this.headlessUtils=null;this.formData={};this.errors={};this.touchedFields=new Set;this.dirtyFields=new Set;this.focusedField=null;this.submitted=!1;this.countryOptions=[];this._initializationTask=new D(this,{task:async([e,r])=>{if(!e||!r)return R;let o=this.extractFieldConfig(e);return await this.initializeCountryOptions(),o},args:()=>[this.configuration,this.headlessUtils]})}connectedCallback(){super.connectedCallback(),this._initializationTask.value}extractFieldConfig(e){if(e?.checkoutModules){let r=e.checkoutModules.find(o=>o.type===\"BILLING_ADDRESS\");if(r?.options){let o=r.options;return Object.keys(Yo).reduce((a,n)=>({...a,[n]:o[n]??!1}),{})}}return this.defaultFieldConfig}async initializeCountryOptions(){try{let e=Bo(\"en\");this.countryOptions=[...e.map(([a,n])=>({value:a,label:n}))],this.requestUpdate(\"countryOptions\");let r=Ji();if(r===\"en\"||r===\"en-GB\"||r.startsWith(\"en-\"))return;if(await gs(r)){let a=Bo(r);this.countryOptions=[...a.map(([n,s])=>({value:n,label:s}))],this.requestUpdate(\"countryOptions\")}}catch(e){A.errorWithDatadog(\"Failed to load country locale\",{error:e})}}get fieldConfig(){return this.extractFieldConfig(this.configuration)}get defaultFieldConfig(){return Object.keys(Yo).reduce((e,r)=>({...e,[r]:!1}),{})}get shouldShowForm(){return this.fieldConfig.postalCode}handleInput(e,r){this.formData={...this.formData,[e]:r},this.dirtyFields.add(e),(this.submitted||this.dirtyFields.has(e)&&this.touchedFields.has(e))&&this.validateField(e),this.dispatchEvent(new CustomEvent(\"primer-billing-address-change\",{detail:this.formData,bubbles:!0,composed:!0}))}handleFocus(e){this.focusedField=e}handleBlur(e){this.focusedField=null,this.touchedFields.add(e),this.validateField(e)}validateField(e){let r=this.formData[e],o=this.fieldConfig[e];if(!o){delete this.errors[e];return}if(o&&(!r||r.trim()===\"\")){let a=`${e}ErrorRequired`;this.errors={...this.errors,[e]:C(\"This field is required\",{id:a})}}else{let a={...this.errors};delete a[e],this.errors=a}}validateForm(){return Object.keys(Yo).forEach(e=>{let r=e;this.fieldConfig[r]&&this.validateField(r)}),Object.keys(this.errors).length===0}async validateForSubmission(){if(!this.shouldShowForm)return!0;this.submitted=!0,Object.keys(this.fieldConfig).forEach(r=>{this.fieldConfig[r]&&this.touchedFields.add(r)});let e=this.validateForm();return this.requestUpdate(),await this.updateComplete,e}async submitToSDK(){if(this.headlessUtils?.setBillingAddress)try{return await this.headlessUtils.setBillingAddress(this.formData),this.dispatchEvent(new CustomEvent(\"primer-billing-address-submit\",{detail:this.formData,bubbles:!0,composed:!0})),!0}catch(e){return A.errorWithDatadog(\"Failed to set billing address\",{error:e}),!1}return!0}shouldShowError(e){let r=!!this.errors[e],o=this.dirtyFields.has(e),a=this.touchedFields.has(e);return r&&(this.submitted||o&&a)}render(){return this._initializationTask.render({pending:()=>h,error:()=>h,complete:()=>this.shouldShowForm?(this.removeAttribute(\"hidden\"),m`<div class=\"billing-address-form\"><div class=\"billing-address-title\">${C(\"Billing address\",{id:\"billingAddressLabel\"})}</div>${k(this.fieldConfig.countryCode,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"countryCode\"} .hasError=${this.shouldShowError(\"countryCode\")} ><primer-input-label slot=\"label\">${C(\"Country code\",{id:\"countryCodeLabel\"})}</primer-input-label><primer-select slot=\"input\" id=\"countryCode\" name=\"countryCode\" .value=${this.formData.countryCode||\"\"} .options=${this.countryOptions} .hasError=${this.shouldShowError(\"countryCode\")} placeholder=${C(\"Select a country\",{id:\"countrySelectPlaceholder\"})} @input=${e=>this.handleInput(\"countryCode\",e.detail)} @focus=${()=>this.handleFocus(\"countryCode\")} @blur=${()=>this.handleBlur(\"countryCode\")} ></primer-select>${k(this.shouldShowError(\"countryCode\"),()=>m`<primer-input-error slot=\"error\">${this.errors.countryCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.firstName||this.fieldConfig.lastName,()=>m`<div class=\"billing-address-row\">${k(this.fieldConfig.firstName,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"firstName\"} .hasError=${this.shouldShowError(\"firstName\")} ><primer-input-label slot=\"label\">${C(\"First name\",{id:\"firstNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"firstName\" name=\"firstName\" type=\"text\" .value=${this.formData.firstName||\"\"} placeholder=${C(\"First name\",{id:\"firstNamePlaceholder\"})} @input=${e=>this.handleInput(\"firstName\",e.detail)} @focus=${()=>this.handleFocus(\"firstName\")} @blur=${()=>this.handleBlur(\"firstName\")} ></primer-input>${k(this.shouldShowError(\"firstName\"),()=>m`<primer-input-error slot=\"error\">${this.errors.firstName}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.lastName,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"lastName\"} .hasError=${this.shouldShowError(\"lastName\")} ><primer-input-label slot=\"label\">${C(\"Last name\",{id:\"lastNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"lastName\" name=\"lastName\" type=\"text\" .value=${this.formData.lastName||\"\"} placeholder=${C(\"Last name\",{id:\"lastNamePlaceholder\"})} @input=${e=>this.handleInput(\"lastName\",e.detail)} @focus=${()=>this.handleFocus(\"lastName\")} @blur=${()=>this.handleBlur(\"lastName\")} ></primer-input>${k(this.shouldShowError(\"lastName\"),()=>m`<primer-input-error slot=\"error\">${this.errors.lastName}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${k(this.fieldConfig.addressLine1,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine1\"} .hasError=${this.shouldShowError(\"addressLine1\")} ><primer-input-label slot=\"label\">${C(\"Address line 1\",{id:\"addressLine1\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine1\" name=\"addressLine1\" type=\"text\" .value=${this.formData.addressLine1||\"\"} placeholder=${C(\"Address line 1\",{id:\"addressLine1Placeholder\"})} @input=${e=>this.handleInput(\"addressLine1\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine1\")} @blur=${()=>this.handleBlur(\"addressLine1\")} ></primer-input>${k(this.shouldShowError(\"addressLine1\"),()=>m`<primer-input-error slot=\"error\">${this.errors.addressLine1}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.addressLine2,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine2\"} .hasError=${this.shouldShowError(\"addressLine2\")} ><primer-input-label slot=\"label\">${C(\"Address line 2\",{id:\"addressLine2\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine2\" name=\"addressLine2\" type=\"text\" .value=${this.formData.addressLine2||\"\"} placeholder=${C(\"Address line 2\",{id:\"addressLine2Placeholder\"})} @input=${e=>this.handleInput(\"addressLine2\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine2\")} @blur=${()=>this.handleBlur(\"addressLine2\")} ></primer-input>${k(this.shouldShowError(\"addressLine2\"),()=>m`<primer-input-error slot=\"error\">${this.errors.addressLine2}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.postalCode||this.fieldConfig.city,()=>m`<div class=\"billing-address-row\">${k(this.fieldConfig.postalCode,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"postalCode\"} .hasError=${this.shouldShowError(\"postalCode\")} ><primer-input-label slot=\"label\">${C(\"Postal code\",{id:\"postalCodeLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"postalCode\" name=\"postalCode\" type=\"text\" .value=${this.formData.postalCode||\"\"} placeholder=${C(\"90210\",{id:\"postalCodePlaceholder\"})} @input=${e=>this.handleInput(\"postalCode\",e.detail)} @focus=${()=>this.handleFocus(\"postalCode\")} @blur=${()=>this.handleBlur(\"postalCode\")} ></primer-input>${k(this.shouldShowError(\"postalCode\"),()=>m`<primer-input-error slot=\"error\">${this.errors.postalCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${k(this.fieldConfig.city,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"city\"} .hasError=${this.shouldShowError(\"city\")} ><primer-input-label slot=\"label\">${C(\"City\",{id:\"cityLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"city\" name=\"city\" type=\"text\" .value=${this.formData.city||\"\"} placeholder=${C(\"Cape Town\",{id:\"cityPlaceholder\"})} @input=${e=>this.handleInput(\"city\",e.detail)} @focus=${()=>this.handleFocus(\"city\")} @blur=${()=>this.handleBlur(\"city\")} ></primer-input>${k(this.shouldShowError(\"city\"),()=>m`<primer-input-error slot=\"error\">${this.errors.city}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${k(this.fieldConfig.state,()=>m`<primer-input-wrapper .focusWithin=${this.focusedField===\"state\"} .hasError=${this.shouldShowError(\"state\")} ><primer-input-label slot=\"label\">${C(\"State / Region / County\",{id:\"stateLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"state\" name=\"state\" type=\"text\" .value=${this.formData.state||\"\"} placeholder=${C(\"State / Region / County\",{id:\"statePlaceholder\"})} @input=${e=>this.handleInput(\"state\",e.detail)} @focus=${()=>this.handleFocus(\"state\")} @blur=${()=>this.handleBlur(\"state\")} ></primer-input>${k(this.shouldShowError(\"state\"),()=>m`<primer-input-error slot=\"error\">${this.errors.state}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`):(this.setAttribute(\"hidden\",\"\"),h)})}}"
|
|
228
228
|
},
|
|
229
229
|
{
|
|
230
230
|
"kind": "variable",
|
|
231
231
|
"name": "ae",
|
|
232
|
-
"default": "class extends v{constructor(){super();this.vaultManagerContext=null;this.vaultItemContext=null;this.headlessUtils=null;this.isEditMode=!1;this.deletePaymentMethodId=null;this.isDeleting=!1;this.errorMessage=\"\";this.animationDuration=300;this.deleteAssetConfig=null;this.handleToggleEditMode=e=>{this.isEditMode=e.detail,this.deletePaymentMethodId=null,this.isEditMode&&this.vaultItemContext&&this.vaultItemContext.setSelectedVaultedPaymentMethod(null)};this.handleDeletePaymentMethod=async e=>{if(this.deletePaymentMethodId=e.detail,this.deletePaymentMethodId&&this.vaultManagerContext&&this.headlessUtils){let r=this.vaultManagerContext.vaultedPaymentMethods.find(o=>o.id===this.deletePaymentMethodId);r&&(this.deleteAssetConfig=await
|
|
232
|
+
"default": "class extends v{constructor(){super();this.vaultManagerContext=null;this.vaultItemContext=null;this.headlessUtils=null;this.isEditMode=!1;this.deletePaymentMethodId=null;this.isDeleting=!1;this.errorMessage=\"\";this.animationDuration=300;this.deleteAssetConfig=null;this.handleToggleEditMode=e=>{this.isEditMode=e.detail,this.deletePaymentMethodId=null,this.isEditMode&&this.vaultItemContext&&this.vaultItemContext.setSelectedVaultedPaymentMethod(null)};this.handleDeletePaymentMethod=async e=>{if(this.deletePaymentMethodId=e.detail,this.deletePaymentMethodId&&this.vaultManagerContext&&this.headlessUtils){let r=this.vaultManagerContext.vaultedPaymentMethods.find(o=>o.id===this.deletePaymentMethodId);r&&(this.deleteAssetConfig=await Pi(r,this.headlessUtils,this.vaultManagerContext))}};this.handleCancelDelete=()=>{this.deletePaymentMethodId=null,this.deleteAssetConfig=null};this.handleConfirmDelete=async()=>{if(!this.vaultManagerContext?.deleteVaultedPaymentMethod||!this.deletePaymentMethodId){this.errorMessage=C(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"});return}try{this.isDeleting=!0,await this.vaultManagerContext.deleteVaultedPaymentMethod(this.deletePaymentMethodId),this.deletePaymentMethodId=null,this.deleteAssetConfig=null}catch(e){this.errorMessage=e instanceof Error?e.message:C(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}finally{this.isDeleting=!1}};this.handlePaymentError=e=>{let r=e.detail?.error;this.errorMessage=r instanceof Error?r.message:C(\"payment_processing_error\",{id:\"payment_processing_error\"})};this.handleCloseError=()=>{this.errorMessage=\"\"};new jt(this,{defaultOptions:{keyframeOptions:{duration:Number(getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-duration\").trim().replace(\"ms\",\"\")),easing:getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-easing\").trim()}}})}getAnimationConfig(){return{keyframeOptions:{duration:this.animationDuration,easing:getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-easing\").trim(),fill:\"both\"}}}getPaymentMethodName(e){if(!this.vaultManagerContext)return\"\";let r=this.vaultManagerContext.vaultedPaymentMethods.find(o=>o.id===e);if(!r)return\"\";try{return Ho(r).description||\"\"}catch{return\"\"}}renderLoadingOverlay(){return m`<div class=\"loading-overlay\" ${yt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ><primer-spinner size=\"medium\" color=\"var(--primer-color-loader)\" ></primer-spinner></div>`}renderDeleteConfirmation(){if(!this.deletePaymentMethodId||!this.deleteAssetConfig)return h;let e=this.getPaymentMethodName(this.deletePaymentMethodId);return m`<div class=\"delete-confirmation-container\"><primer-button disabled variant=\"secondary\"><primer-payment-method-content .assetConfig=${this.deleteAssetConfig} ></primer-payment-method-content></primer-button><primer-vault-delete-confirmation .isDeleting=${this.isDeleting} .paymentMethodId=${this.deletePaymentMethodId} .paymentMethodName=${e} @confirm-delete=${this.handleConfirmDelete} @cancel-delete=${this.handleCancelDelete} ${yt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-delete-confirmation></div>`}renderPaymentMethodItem(e){return this.deletePaymentMethodId===e.id?h:m`<primer-vault-payment-method-item .paymentMethod=${e} .isEditMode=${this.isEditMode} @delete-payment-method=${this.handleDeletePaymentMethod} ${yt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-payment-method-item>`}renderPaymentMethodList(){let e=this.vaultManagerContext?.vaultedPaymentMethods||[],r=!this.isEditMode&&e.length>0&&!this.deletePaymentMethodId;return m`<div class=\"payment-methods-list\">${e.map(o=>this.renderPaymentMethodItem(o))} ${k(r,()=>m`<div class=\"submit-button-container\"><primer-vault-payment-submit class=\"submit-button\" @primer-vault-payment-error=${this.handlePaymentError} ${yt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-payment-submit></div>`,()=>h)}</div>`}render(){if(!this.vaultManagerContext?.enabled)return h;let e=this.vaultManagerContext.vaultedPaymentMethods.length>0,r=this.vaultManagerContext.isLoading,o=this.vaultManagerContext.isUpdating;return m` ${k(!this.vaultManagerContext?.showEmptyState&&!e,()=>h,()=>m`<slot name=\"vault-empty-state\"><div class=\"vault-manager ${o?\"is-updating\":\"\"}\"><primer-vault-manager-header .isEditMode=${this.isEditMode} .hasPaymentMethods=${e} @toggle-edit-mode=${this.handleToggleEditMode} ></primer-vault-manager-header>${k(this.errorMessage,()=>m`<primer-vault-error-message .errorMessage=${this.errorMessage} @close-error=${this.handleCloseError} ${yt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-error-message>`,()=>h)}<div class=\"vault-manager-content\">${k(!r&&!e,()=>m`<div class=\"content-container\"><primer-vault-empty-state ${yt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-empty-state></div>`,()=>h)} ${k(!r&&e,()=>m`<div class=\"content-container\">${k(this.deletePaymentMethodId,()=>this.renderDeleteConfirmation(),()=>this.renderPaymentMethodList())}</div>`,()=>h)}</div>${k(o,()=>this.renderLoadingOverlay(),()=>h)}</div></slot>`)} `}}"
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
235
|
"kind": "variable",
|
|
236
|
-
"name": "
|
|
237
|
-
"default": "class extends v{constructor(){super(...arguments);this.vaultManagerContext=null;this.vaultItemContext=null;this.headlessUtils=null;this.paymentMethod=null;this.isEditMode=!1;this._getAssetsTask=new
|
|
236
|
+
"name": "be",
|
|
237
|
+
"default": "class extends v{constructor(){super(...arguments);this.vaultManagerContext=null;this.vaultItemContext=null;this.headlessUtils=null;this.paymentMethod=null;this.isEditMode=!1;this._getAssetsTask=new D(this,{task:async([e,r,o])=>await Pi(e,r,o),args:()=>[this.paymentMethod,this.headlessUtils,this.vaultManagerContext]});this.handleClick=()=>{this.isEditMode||!this.vaultManagerContext||!this.paymentMethod||(this.isSelected()?this.vaultItemContext?.setSelectedVaultedPaymentMethod(null):this.vaultItemContext?.setSelectedVaultedPaymentMethod(this.paymentMethod))};this.handleDeleteClick=e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent(\"delete-payment-method\",{detail:this.paymentMethod?.id,bubbles:!0,composed:!0}))}}isSelected(){if(!this.vaultManagerContext||!this.paymentMethod)return!1;let e=this.vaultItemContext?.selectedVaultedPaymentMethod;return!!e&&e.id===this.paymentMethod.id}render(){return this._getAssetsTask.render({error:()=>h,complete:e=>{let r=this.isSelected()?\"checked\":\"default\",o=!1,a=e?.description;return m`<div class=\"payment-method-wrapper\"><div class=\"payment-method-container\"><primer-button variant=\"secondary\" class=\"payment-method-button ${e.shouldShowCVV?\"with-cvv\":\"\"}\" selectable ?disabled=${this.isEditMode} selectionState=${r} .flex=${o} @click=${this.handleClick} ><primer-payment-method-content .assetConfig=${e} ></primer-payment-method-content>${k(e.shouldShowCVV&&this.isSelected()&&!this.isEditMode,()=>m`<div class=\"payment-method-row mt-2\"><span class=\"flex-center\"><primer-icon name=\"lock\" size=\"sm\"></primer-icon><span class=\"payment-method-subtitle\"> Input the card CVV for a secure payment</span ></span><span class=\"cell-2\"><primer-vault-cvv-input .paymentMethod=\"${this.paymentMethod}\" ><span slot=\"label\"></span></primer-vault-cvv-input></span></div>`,()=>h)}</primer-button>${this.isEditMode?m`<primer-button variant=\"tertiary\" class=\"delete-button\" @click=${this.handleDeleteClick} aria-label=${`${C(\"delete\",{id:\"delete\"})} ${a}`} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:h}</div></div>`}})}}"
|
|
238
238
|
},
|
|
239
239
|
{
|
|
240
240
|
"kind": "variable",
|
|
241
|
-
"name": "
|
|
241
|
+
"name": "Re",
|
|
242
242
|
"default": "class extends v{constructor(){super(...arguments);this.isEditMode=!1;this.hasPaymentMethods=!1;this.toggleEditMode=()=>{this.dispatchEvent(new CustomEvent(\"toggle-edit-mode\",{detail:!this.isEditMode,bubbles:!0,composed:!0}))}}render(){return m`<div class=\"vault-manager-header\"><h3>${C(\"previouslyUsed\",{id:\"previouslyUsed\"})}</h3>${this.hasPaymentMethods?m`<primer-button variant=\"tertiary\" class=\"edit-button ${this.isEditMode?\"active\":\"\"}\" @click=${this.toggleEditMode} aria-label=${this.isEditMode?C(\"confirm\",{id:\"confirm\"}):C(\"editPaymentMethods\",{id:\"editPaymentMethods\"})} >${this.isEditMode?m`<primer-icon name=\"checkmark\" size=\"sm\"></primer-icon>`:m`<primer-icon name=\"edit\" size=\"sm\"></primer-icon>`}</primer-button>`:h}</div>`}}"
|
|
243
243
|
},
|
|
244
244
|
{
|
|
245
245
|
"kind": "variable",
|
|
246
|
-
"name": "
|
|
246
|
+
"name": "Se",
|
|
247
247
|
"default": "class extends v{constructor(){super(...arguments);this.isDeleting=!1;this.paymentMethodId=\"\";this.paymentMethodName=\"\";this.vaultManager=null;this.handleConfirmClick=()=>{this.dispatchEvent(new CustomEvent(\"confirm-delete\",{bubbles:!0,composed:!0}))};this.handleCancelClick=()=>{this.dispatchEvent(new CustomEvent(\"cancel-delete\",{bubbles:!0,composed:!0}))}}render(){return m`<div class=\"delete-confirmation\"><p class=\"delete-confirmation-text\"> Are you sure you want to delete this payment method? </p><div class=\"delete-actions\"><primer-button variant=\"secondary\" @click=${this.handleCancelClick} ?disabled=${this.isDeleting} >${C(\"cancel\",{id:\"cancel\"})}</primer-button><primer-button @click=${this.handleConfirmClick} ?disabled=${this.isDeleting} >${this.isDeleting?C(\"deleting\",{id:\"deleting\"}):C(\"confirmVaultedPaymentMethodDeletion\",{id:\"confirmVaultedPaymentMethodDeletion\"})}</primer-button></div></div>`}}"
|
|
248
248
|
},
|
|
249
249
|
{
|
|
250
250
|
"kind": "variable",
|
|
251
|
-
"name": "
|
|
251
|
+
"name": "et",
|
|
252
252
|
"default": "class extends v{render(){return m`<div class=\"empty-state\"><p>${C(\"savedPaymentMethodsEmpty\",{id:\"savedPaymentMethodsEmpty\"})}</p></div>`}}"
|
|
253
253
|
},
|
|
254
254
|
{
|
|
255
255
|
"kind": "variable",
|
|
256
|
-
"name": "
|
|
256
|
+
"name": "Ke",
|
|
257
257
|
"default": "class extends v{constructor(){super(...arguments);this.errorMessage=\"\";this.handleDismiss=()=>{this.dispatchEvent(new CustomEvent(\"close-error\",{bubbles:!0,composed:!0}))}}render(){return m`<div class=\"error-message\"><div class=\"error-content\"><primer-icon name=\"warning\" size=\"sm\" color=\"var(--primer-color-red-500)\" ></primer-icon><p>${this.errorMessage}</p></div><button @click=${this.handleDismiss} aria-label=${C(\"closeErrorMessage\",{id:\"closeErrorMessage\"})} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></button></div>`}}"
|
|
258
258
|
},
|
|
259
259
|
{
|
|
260
260
|
"kind": "variable",
|
|
261
|
-
"name": "
|
|
261
|
+
"name": "X",
|
|
262
262
|
"default": "class extends v{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.headlessInstance=null;this.sdkState=null;this.vaultItemContext=null;this.vaultManager=null;this.clientOptions=null;this.variant=\"primary\";this.disabled=!1;this.handleClick=async e=>{if(e.preventDefault(),!this.isButtonDisabled)try{await this.vaultManager?.startVaultedPaymentFlow()}catch(r){let o=new CustomEvent(\"primer-vault-payment-error\",{bubbles:!0,composed:!0,detail:{error:r}});this.dispatchEvent(o)}}}get buttonText(){return this._userAssignedProps.has(\"buttonText\")?this._internalButtonText:C(\"pay\",{id:\"pay\"})}set buttonText(e){let r=this.buttonText;e!==\"\"?(this._userAssignedProps.add(\"buttonText\"),this._internalButtonText=e):(this._userAssignedProps.delete(\"buttonText\"),this._internalButtonText=\"\"),this.requestUpdate(\"buttonText\",r)}get isButtonDisabled(){return!!(this.disabled||!this.vaultItemContext?.selectedVaultedPaymentMethod||this.vaultManager?.isLoading)}render(){let e=this.clientOptions?.submitButton?.amountVisible?this.headlessInstance?.getUIOrderAmount():null,r=e?` ${e}`:h;return m`<primer-button buttonType=\"submit\" variant=${this.variant} @click=${this.handleClick} .disabled=${this.isButtonDisabled} .loading=${this.sdkState?.isProcessing} data-submit >${this.buttonText}${r}</primer-button>`}}"
|
|
263
263
|
},
|
|
264
264
|
{
|
|
265
265
|
"kind": "variable",
|
|
266
266
|
"name": "G",
|
|
267
|
-
"default": "class extends v{constructor(){super();this.vaultManagerFormContext=null;this.vaultManagerCvvContext=null;this.computedStyles=null;this.paymentMethod=null;this.cvvError=null;this.cvvInputIsDirty=!1;this.cvvInputIsBlurred=!1;this.cvvInput=null;this.isFocused=!1;this._setupCVVIframe=new
|
|
267
|
+
"default": "class extends v{constructor(){super();this.vaultManagerFormContext=null;this.vaultManagerCvvContext=null;this.computedStyles=null;this.paymentMethod=null;this.cvvError=null;this.cvvInputIsDirty=!1;this.cvvInputIsBlurred=!1;this.cvvInput=null;this.isFocused=!1;this._setupCVVIframe=new D(this,{task:([e,r])=>!e||!r||e.paymentMethodType!==\"PAYMENT_CARD\"||!e.paymentInstrumentData?.network||r.createCvvInput===null?R:{network:e.paymentInstrumentData.network,createCvvInput:r.createCvvInput},args:()=>[this.paymentMethod,this.vaultManagerFormContext]});this.cvvContainerId=`cvv-container-${Math.random().toString(36).substring(2,9)}`,new D(this,{task:async([e])=>{if(!e)return R;await this.updateComplete;let r=this.renderRoot.querySelector(`#${this.cvvContainerId}`);if(!r)return;let o=ki(this.computedStyles),a=o?{input:{base:o}}:void 0,n={cardNetwork:e.network,container:r,name:\"cvv\",placeholder:\"123\",style:a};this.cvvInput=await e.createCvvInput?.(n)??null,this.cvvInput&&(this.cvvInput.focus(),this.cvvError=this.cvvInput.metadata.errorCode||null,this.vaultManagerCvvContext?.setCvvInput(this.cvvInput),this.cvvInput.addListener(\"change\",()=>{this.onCvvInputChange()}),this.cvvInput.addListener(\"blur\",()=>{this.onBlur()}),this.cvvInput.addListener(\"focus\",()=>{this.onFocus()}))},args:()=>[this._setupCVVIframe.value]})}disconnectedCallback(){super.disconnectedCallback(),this.cvvInput&&(this.cvvInput.remove(),this.cvvInput=null,this.cvvError=null,this.vaultManagerCvvContext?.setCvvInput(null))}onCvvInputChange(){!this.cvvInput||!this.vaultManagerCvvContext||(this.cvvInputIsDirty=!0,this.cvvError=this.cvvInput.metadata.errorCode||null)}onBlur(){this.cvvInput&&(this.cvvInputIsBlurred=!0,this.cvvError=this.cvvInput.metadata.errorCode||null,this.isFocused=!1)}onFocus(){this.isFocused=!0}render(){return this._setupCVVIframe.render({error:()=>h,complete:()=>m`<div class=\"cvv-input-container\"><primer-input-wrapper .focusWithin=${this.isFocused} .hasError=${!!this.cvvError&&(this.vaultManagerCvvContext?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred)} ><slot name=\"label\" slot=\"label\"><primer-input-label>CVV</primer-input-label></slot><div slot=\"input\" id=\"${this.cvvContainerId}\"></div>${k(this.cvvError&&(this.vaultManagerCvvContext?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred),()=>m`<primer-input-error slot=\"error\">${C(this.cvvError,{id:this.cvvError})}</primer-input-error>`)}</primer-input-wrapper></div>`})}}"
|
|
268
268
|
},
|
|
269
269
|
{
|
|
270
270
|
"kind": "variable",
|
|
271
|
-
"name": "
|
|
272
|
-
"default": "class extends v{constructor(){super(...arguments);this.assetConfig=null}render(){if(!this.assetConfig)return h;let e=this.assetConfig.description,r=this.assetConfig.icon,o=k(this.assetConfig.icon,()=>m`<img class=\"payment-method-icon\" src=${r} alt=${e} />`,()=>m`<div class=\"payment-method-icon payment-method-icon-generic\"><primer-icon name=\"payment-card\" size=\"sm\"></primer-icon></div>`);return this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType!==\"ACH\"?m`<div class=\"payment-method-card-other\"><div class=\"left-column\"><div class=\"payment-method-header\">${this.assetConfig.fullName}</div><div class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.paymentMethodType}</span ></div></div><div class=\"payment-method-right-column-text\">${this.assetConfig.email||`\\u2022\\u2022\\u2022\\u2022 ${this.assetConfig.last4}`}</div></div>`:this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType===\"ACH\"?m`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.fullName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.bankName}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.accountType}</span ></div></span>`:this.assetConfig.type===\"card\"?m`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.cardholderName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.network}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.expiresDate}</span ></div></span>`:h}}"
|
|
271
|
+
"name": "je",
|
|
272
|
+
"default": "class extends v{constructor(){super(...arguments);this.assetConfig=null}render(){if(!this.assetConfig)return h;let e=this.assetConfig.description,r=this.assetConfig.icon,o=k(this.assetConfig.icon,()=>m`<img class=\"payment-method-icon\" src=${r} alt=${e} />`,()=>m`<div class=\"payment-method-icon payment-method-icon-generic\"><primer-icon name=\"payment-card\" size=\"sm\"></primer-icon></div>`);return this.assetConfig.type===\"paypal\"?m`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.fullName}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.paymentMethodType}</span ></span></div></span>`:this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType!==\"ACH\"?m`<div class=\"payment-method-card-other\"><div class=\"left-column\"><div class=\"payment-method-header\">${this.assetConfig.fullName}</div><div class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.paymentMethodType}</span ></div></div><div class=\"payment-method-right-column-text\">${this.assetConfig.email||`\\u2022\\u2022\\u2022\\u2022 ${this.assetConfig.last4}`}</div></div>`:this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType===\"ACH\"?m`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.fullName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.bankName}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.accountType}</span ></div></span>`:this.assetConfig.type===\"card\"?m`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.cardholderName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${o}<span class=\"payment-method-subtitle\" >${this.assetConfig.network}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.expiresDate}</span ></div></span>`:h}}"
|
|
273
273
|
},
|
|
274
274
|
{
|
|
275
275
|
"kind": "variable",
|
|
276
|
-
"name": "
|
|
277
|
-
"default": "class extends v{constructor(){super(...arguments);this.hideLabels=!1;this.disabled=!1;this.hasAssignedContent=!1;this.selectedCardNetwork=null;this.formErrorMessage=null;this.paymentMethodSelectionSent=!1;this.paymentManagers=new Map;this.clientOptions=null;this.headlessUtils=null;this.analyticsUtils=null;this.contextEventsController=null;this.cardFormProvider=new
|
|
276
|
+
"name": "Q",
|
|
277
|
+
"default": "class extends v{constructor(){super(...arguments);this.hideLabels=!1;this.disabled=!1;this.hasAssignedContent=!1;this.selectedCardNetwork=null;this.formErrorMessage=null;this.paymentMethodSelectionSent=!1;this.paymentManagers=new Map;this.clientOptions=null;this.headlessUtils=null;this.analyticsUtils=null;this.contextEventsController=null;this.cardFormProvider=new z(this,{context:Gt,initialValue:null});this.eventsController=new Ot(this);this._contextCardSubmitListener=null;this._isHandlingContextEvent=!1;this.inputControllers=new Map;this.setupCardFormTask=new D(this,{task:([e])=>{if(!e?.manager)return R;let{manager:r}=e,o=r.createHostedInputs(),{cardNumberInput:a,expiryInput:n,cvvInput:s}=o;return this.cardFormProvider.setValue({cardholderNameInput:o.cardholderNameInput,cardNumberInput:a,expiryInput:n,cvvInput:s,setCardholderName:d=>{r.setCardholderName(d),this.shouldRequireCardholderName&&r.validate?.().then(c=>{let g=c?.validationErrors?.find(x=>x.name===Bs.cardholderName),f=this.inputControllers.get(\"cardholderName\");f&&f.updateMetaFromValidation({valid:!1,error:g?.message||g?.error||null,errorCode:g?.message||g?.error||null})})},setCardNetwork:d=>{this.selectedCardNetwork=d},validate:()=>r.validate(),submit:d=>r.submit(d),hideLabels:this.hideLabels,disabled:this.disabled,setSubmissionState:d=>{this.inputControllers.forEach(c=>{c.setSubmitted(d)})},propagateValidationErrors:d=>{d&&d.forEach(c=>{let u=c.field||c.name,g=c.message||c.error,f=Bs[u];if(f){let x=this.inputControllers.get(f);if(x){let I={valid:!1,error:g,errorCode:g};x.updateMetaFromValidation(I)}}})},registerInputController:(d,c)=>{this.inputControllers.set(d,c)},unregisterInputController:d=>{this.inputControllers.delete(d)},onUserInteraction:()=>{this.sendPaymentMethodSelectionEvent(),this.checkAndSendPaymentDetailsEnteredEvent()}}),!0},args:()=>[this.paymentManagers.get(\"PAYMENT_CARD\")]});this.paymentDetailsEnteredSent=!1;this.handleSlotButtonClick=e=>{let o=e.target.closest(\"button, primer-button\");if(!o)return;let a=o;this.isSubmitButton(a)&&(e.preventDefault(),this.submitCardPayment())};this.handleDirectSubmit=e=>{e.stopPropagation(),this.submitCardPayment()};this.handleContextCardSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitCardPayment())}finally{this._isHandlingContextEvent=!1}}};this.onSlotChange=e=>{let o=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=o.length>0};this.handleFormSubmit=e=>{e.preventDefault(),e.stopPropagation(),this.submitCardPayment()}}updated(e){if(super.updated(e),(e.has(\"hideLabels\")||e.has(\"disabled\"))&&this.cardFormProvider.value&&this.cardFormProvider.setValue({...this.cardFormProvider.value,hideLabels:this.hideLabels,disabled:this.disabled}),e.has(\"contextEventsController\")){let r=e.get(\"contextEventsController\");r?.host&&this._contextCardSubmitListener&&r.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener),this.setupContextEventListeners()}}get shouldShowCardholderName(){let e=this.clientOptions?.card?.cardholderName;return typeof e?.visible==\"boolean\"?e.visible:!0}get shouldRequireCardholderName(){if(!this.shouldShowCardholderName)return!1;let e=this.clientOptions?.card?.cardholderName;return typeof e?.required==\"boolean\"?e.required:!0}sendPaymentMethodSelectionEvent(){this.paymentMethodSelectionSent||(this.paymentMethodSelectionSent=!0,q({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:\"PAYMENT_CARD\"}))}checkAndSendPaymentDetailsEnteredEvent(){if(this.paymentDetailsEnteredSent)return;let e=this.inputControllers.get(\"cardNumber\"),r=this.inputControllers.get(\"expire\"),o=this.inputControllers.get(\"cvv\"),a=e?.meta?.dirty===!0,n=r?.meta?.dirty===!0,s=o?.meta?.dirty===!0,d=!0;this.shouldRequireCardholderName&&(d=this.inputControllers.get(\"cardholderName\")?.meta?.dirty===!0),a&&n&&s&&d&&(this.sendPaymentDetailsEnteredEvent(),this.paymentDetailsEnteredSent=!0)}sendPaymentDetailsEnteredEvent(){q({eventName:\"PAYMENT_DETAILS_ENTERED\",paymentMethod:\"PAYMENT_CARD\"})}connectedCallback(){super.connectedCallback(),this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:card-submit\",this.handleDirectSubmit),this._contextCardSubmitListener=e=>{this.handleContextCardSubmit(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:card-submit\",this.handleDirectSubmit),this.cleanupContextEventListeners(),super.disconnectedCallback()}setupContextEventListeners(){this.contextEventsController?.host&&this._contextCardSubmitListener&&this.contextEventsController.host.addEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}cleanupContextEventListeners(){this.contextEventsController?.host&&this._contextCardSubmitListener&&this.contextEventsController.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}isSubmitButton(e){let r=e.tagName.toLowerCase(),o=r===\"button\",a=r===\"primer-button\";return o&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||a&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitCardPayment(){let e=this.cardFormProvider.value;if(!e||this.disabled)return;this.formErrorMessage=null,e.setSubmissionState?.(!0);let r=this.querySelector(\"primer-billing-address\")||this.renderRoot.querySelector(\"primer-billing-address\"),o=!0;r&&(o=await r.validateForSubmission());let a=await e.validate?.();if(a?.valid&&o){if(r&&!await r.submitToSDK()){let c=C(\"tokenizationError\",{id:\"tokenizationError\"});this.formErrorMessage=c,this.eventsController.dispatchFormSubmitErrors([{field:\"billingAddress\",name:\"billingAddress\",error:\"BILLING_ADDRESS_SUBMISSION_FAILED\",message:c}]);return}let n=this.selectedCardNetwork?{cardNetwork:this.selectedCardNetwork}:void 0;await e.submit?.(n);let s={success:!0};this.eventsController.dispatchFormSubmitSuccess(s)}else{let n=a?.validationErrors;e.propagateValidationErrors?.(n||[]),this.cardFormProvider.setValue({...e,errors:n}),this.eventsController.dispatchFormSubmitErrors(n)}}render(){return this.setupCardFormTask.status===ct.ERROR||this.setupCardFormTask.status===ct.INITIAL?h:m`<form @submit=${this.handleFormSubmit}><slot name=\"card-form-content\" @slotchange=${this.onSlotChange}></slot>${this.setupCardFormTask.render({complete:()=>k(this.hasAssignedContent,()=>h,()=>m`<div class=\"card-form\"><primer-input-card-number></primer-input-card-number><div class=\"card-form-row\"><primer-input-card-expiry></primer-input-card-expiry><primer-input-cvv></primer-input-cvv></div>${k(this.shouldShowCardholderName,()=>m`<primer-input-card-holder-name></primer-input-card-holder-name>`,()=>h)}<primer-billing-address></primer-billing-address></div><primer-card-form-submit></primer-card-form-submit><primer-error-message message=\"${this.formErrorMessage||\"\"}\" ?visible=\"${!!this.formErrorMessage}\" ></primer-error-message>`)})}</form>`}}"
|
|
278
278
|
},
|
|
279
279
|
{
|
|
280
280
|
"kind": "variable",
|
|
281
|
-
"name": "
|
|
282
|
-
"default": "class extends
|
|
281
|
+
"name": "tt",
|
|
282
|
+
"default": "class extends de{constructor(){super();this.config={inputType:\"cardNumber\",containerSelector:\"#cardNumber\",errorName:\"cardNumber-card\",translations:{label:{id:\"cardNumber\",defaultMessage:\"Card Number\"},placeholder:\"4111 1111 1111 1111\",ariaLabel:{id:\"cardNumber\",defaultMessage:\"Card Number\"}}};this.handleNetworkSelected=e=>{let{network:r}=e.detail;this.cardFormContext&&this.cardFormContext.setCardNetwork(r)};this.childUpdated()}renderInput(){if(this.hostedInputController.setupTask.status===ct.ERROR)return h;let e=this.getError();return m`<primer-input-wrapper .focusWithin=\"${this.hostedInputController.meta.active}\" .hasError=${!!e} >${k(!this.cardFormContext?.hideLabels,()=>m`<primer-input-label slot=\"label\" >${this.label}</primer-input-label >`,()=>h)}<div slot=\"input\" class=\"card-number-container\" aria-label=\"${this.ariaLabel}\" ><div id=\"${this.config.containerSelector.substring(1)}\"></div><div class=\"network-selector-container\"><primer-card-network-selector @network-selected=${this.handleNetworkSelected} ></primer-card-network-selector></div></div>${k(e,r=>m`<primer-input-error slot=\"error\">${C(r,{id:r})}</primer-input-error>`,()=>h)}</primer-input-wrapper>`}render(){return this.renderInput()}}"
|
|
283
283
|
},
|
|
284
284
|
{
|
|
285
285
|
"kind": "variable",
|
|
286
|
-
"name": "
|
|
287
|
-
"default": "class extends
|
|
286
|
+
"name": "rt",
|
|
287
|
+
"default": "class extends de{constructor(){super();this.config={inputType:\"cvv\",containerSelector:\"#cvv\",errorName:\"cvv-card\",translations:{label:\"CVV\",placeholder:\"123\"}};this.childUpdated()}render(){return this.renderInput()}}"
|
|
288
288
|
},
|
|
289
289
|
{
|
|
290
290
|
"kind": "variable",
|
|
291
|
-
"name": "
|
|
292
|
-
"default": "class extends
|
|
291
|
+
"name": "it",
|
|
292
|
+
"default": "class extends de{constructor(){super();this.config={inputType:\"expire\",containerSelector:\"#expiry\",errorName:\"expiryDate-card\",translations:{label:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"},placeholder:{id:\"cardExpiryPlaceholder\",defaultMessage:\"MM/YY\"},ariaLabel:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"}}};this.childUpdated()}render(){return this.renderInput()}}"
|
|
293
293
|
},
|
|
294
294
|
{
|
|
295
295
|
"kind": "variable",
|
|
296
|
-
"name": "
|
|
297
|
-
"default": "class extends
|
|
296
|
+
"name": "ot",
|
|
297
|
+
"default": "class extends de{constructor(){super();this.config={inputType:\"cardholderName\",containerSelector:\"#cardFormName\",errorName:\"cardholderName\",translations:{label:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"},placeholder:{id:\"cardholderNamePlaceholder\",defaultMessage:\"Name on card\"},ariaLabel:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"}},onInput:e=>this.handleInput(e)};this.childUpdated()}handleInput(e){this.cardFormContext?.setCardholderName?.(e)}render(){return this.renderInput()}}"
|
|
298
298
|
},
|
|
299
299
|
{
|
|
300
300
|
"kind": "variable",
|
|
@@ -303,37 +303,37 @@
|
|
|
303
303
|
},
|
|
304
304
|
{
|
|
305
305
|
"kind": "variable",
|
|
306
|
-
"name": "
|
|
307
|
-
"default": "class extends v{constructor(){super(...arguments);this.cardNetworks=null;this.headlessUtils=null;this.selectedCardNetwork=null;this.isDropdownOpen=!1;this.focusedNetworkIndex=0;this.isKeyboardNavigation=!1;this.buttonRef=
|
|
306
|
+
"name": "ce",
|
|
307
|
+
"default": "class extends v{constructor(){super(...arguments);this.cardNetworks=null;this.headlessUtils=null;this.selectedCardNetwork=null;this.isDropdownOpen=!1;this.focusedNetworkIndex=0;this.isKeyboardNavigation=!1;this.buttonRef=Lt();this.dropdownRef=Lt();this.networkOptionRefs=[];this.toggleDropdown=e=>{this.isKeyboardNavigation=!1,e.stopPropagation(),this.getSelectableNetworks().length>1&&(this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&(this.focusedNetworkIndex=this.getSelectedNetworkIndex()))};this.handleClickOutside=e=>{this.isDropdownOpen&&(this.contains(e.target)||(this.isDropdownOpen=!1,this.isKeyboardNavigation=!1))};this.handleMouseMove=()=>{this.isKeyboardNavigation&&(this.isKeyboardNavigation=!1)};this.handleKeyDown=e=>{if(!(!(this.getSelectableNetworks().length>1)||!(this.contains(e.target)||this===e.target||this.isDropdownOpen&&e.target===document.body)))switch(this.isKeyboardNavigation=!0,e.key){case\"ArrowDown\":e.preventDefault(),this.isDropdownOpen?(this.focusedNetworkIndex=(this.focusedNetworkIndex+1)%this.getSelectableNetworks().length,this.focusNetworkOption()):(this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"ArrowUp\":e.preventDefault(),this.isDropdownOpen?(this.focusedNetworkIndex=(this.focusedNetworkIndex-1+this.getSelectableNetworks().length)%this.getSelectableNetworks().length,this.focusNetworkOption()):(this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"Enter\":case\" \":this.isDropdownOpen&&this.focusedNetworkIndex>=0?(e.preventDefault(),this.selectNetwork(e,this.getSelectableNetworks()[this.focusedNetworkIndex])):!this.isDropdownOpen&&this.buttonRef.value===document.activeElement&&(e.preventDefault(),this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"Escape\":this.isDropdownOpen&&(e.preventDefault(),this.isDropdownOpen=!1,this.buttonRef.value?.focus());break;case\"Tab\":this.isDropdownOpen&&(this.isDropdownOpen=!1);break}};this.handleDocumentKeyDown=e=>{this.isDropdownOpen&&this.handleKeyDown(e)}}getNetworkIconUrl(e){return this.headlessUtils?.getCardNetworkAsset(e.network)?.cardUrl}getSelectableNetworks(){return this.cardNetworks?.selectableCardNetworks||[]}getDetectedNetwork(){return this.selectedCardNetwork??(this.cardNetworks?.detectedCardNetwork||null)}getSelectedNetworkIndex(){let e=this.getDetectedNetwork();if(!e)return 0;let r=this.getSelectableNetworks().findIndex(o=>o.network===e.network);return r>=0?r:0}selectNetwork(e,r){e.stopPropagation(),this.selectedCardNetwork=r,this.isDropdownOpen=!1,this.buttonRef.value?.focus(),this.cardNetworks&&this.dispatchEvent(new CustomEvent(\"network-selected\",{detail:{network:r.network},bubbles:!0,composed:!0}))}focusNetworkOption(){requestAnimationFrame(()=>{this.networkOptionRefs[this.focusedNetworkIndex]&&this.networkOptionRefs[this.focusedNetworkIndex].focus()})}setNetworkOptionRef(e,r){this.networkOptionRefs[r]=e}connectedCallback(){super.connectedCallback(),setTimeout(()=>{document.addEventListener(\"click\",this.handleClickOutside),document.addEventListener(\"mousemove\",this.handleMouseMove),this.addEventListener(\"keydown\",this.handleKeyDown),document.addEventListener(\"keydown\",this.handleDocumentKeyDown)},0)}disconnectedCallback(){document.removeEventListener(\"click\",this.handleClickOutside),document.removeEventListener(\"keydown\",this.handleDocumentKeyDown),document.removeEventListener(\"mousemove\",this.handleMouseMove),this.removeEventListener(\"keydown\",this.handleKeyDown),super.disconnectedCallback()}render(){if(this.cardNetworks?.isLoading)return m`<primer-spinner size=\"small\" compact></primer-spinner>`;let e=this.getSelectableNetworks();if(!this.getDetectedNetwork()&&e.length===0)return m`<primer-icon name=\"payment-card\" size=\"sm\"></primer-icon>`;let r=this.getDetectedNetwork()||(e.length>0?e[0]:null);if(!r)return m`<primer-icon name=\"payment-card\" size=\"sm\"></primer-icon>`;let o=e.length>1;return m`<button ${gt(this.buttonRef)} class=\"network-selector\" @click=${this.toggleDropdown} @keydown=${a=>{(a.key===\" \"||a.key===\"Enter\")&&o&&(a.preventDefault(),this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&(this.focusedNetworkIndex=this.getSelectedNetworkIndex()))}} aria-label=${o?`Selected card network: ${r.displayName}. Click to change.`:`Card network: ${r.displayName}`} aria-expanded=${o?this.isDropdownOpen:h} aria-haspopup=${o?\"true\":h} aria-controls=${o?\"network-dropdown\":h} ><img class=\"network-icon\" src=${this.getNetworkIconUrl(r)} alt=${r.displayName} />${k(o,()=>m`<primer-icon class=\"caret ${this.isDropdownOpen?\"open\":\"\"}\" size=\"sm\" name=\"chevron-down\" ></primer-icon>`,()=>h)}</button>${k(this.isDropdownOpen,()=>m`<div ${gt(this.dropdownRef)} id=\"network-dropdown\" class=\"dropdown open\" role=\"listbox\" aria-label=\"Select card network\" >${e.map((a,n)=>m`<div ${gt(s=>this.setNetworkOptionRef(s,n))} class=\"network-option ${this.isKeyboardNavigation&&n===this.focusedNetworkIndex?\"focused\":\"\"}\" @click=${s=>this.selectNetwork(s,a)} @keydown=${s=>{(s.key===\"Enter\"||s.key===\" \")&&this.selectNetwork(s,a)}} role=\"option\" aria-selected=${a.network===r.network} tabindex=\"${n===this.focusedNetworkIndex?\"0\":\"-1\"}\" ><img class=\"network-option-icon\" src=${this.getNetworkIconUrl(a)} alt=${a.displayName} /><span class=\"network-name\">${a.displayName}</span>${k(a.network===r.network,()=>m`<primer-icon class=\"checkmark\" name=\"checkmark\" size=\"sm\" ></primer-icon>`,()=>h)}</div>`)}</div>`,()=>h)} `}}"
|
|
308
308
|
},
|
|
309
309
|
{
|
|
310
310
|
"kind": "variable",
|
|
311
|
-
"name": "
|
|
311
|
+
"name": "bt",
|
|
312
312
|
"default": "class extends v{constructor(){super(...arguments);this.vaultManager=null}render(){if(this.vaultManager?.isLoading)return h;let e=this.vaultManager?.showEmptyState&&this.vaultManager?.vaultedPaymentMethods.length;return!this.vaultManager||!this.vaultManager.enabled||!e?m`<slot name=\"other-payments\"></slot>`:m`<div class=\"other-payment-methods-container\"><primer-collapsable buttonVariant=\"secondary\" .expanded=\"${this.vaultManager?.vaultedPaymentMethods.length===0}\" .header=\"${C(\"navigateToPaymentMethods\",{id:\"navigateToPaymentMethods\"})}\" ><div class=\"other-payment-methods-content\"><slot name=\"other-payments\"></slot></div></primer-collapsable></div>`}}"
|
|
313
313
|
},
|
|
314
314
|
{
|
|
315
315
|
"kind": "variable",
|
|
316
|
-
"name": "
|
|
316
|
+
"name": "Wt",
|
|
317
317
|
"default": "class extends v{render(){return m`<primer-checkout-state type=\"complete\"></primer-checkout-state>`}}"
|
|
318
318
|
},
|
|
319
319
|
{
|
|
320
320
|
"kind": "variable",
|
|
321
|
-
"name": "
|
|
321
|
+
"name": "Rt",
|
|
322
322
|
"default": "class extends v{constructor(){super(...arguments);this.sdkState=null}render(){return m`<primer-checkout-state type=\"failure\" description=${this.sdkState?.error?.message||\"\"} ></primer-checkout-state>`}}"
|
|
323
323
|
},
|
|
324
324
|
{
|
|
325
325
|
"kind": "variable",
|
|
326
|
-
"name": "
|
|
326
|
+
"name": "at",
|
|
327
327
|
"default": "class extends v{constructor(){super(...arguments);this.showProcessingErrors=!0}get shouldShowError(){return!this.sdkState||this.sdkState.isProcessing?!1:!!(this.sdkState.failure&&this.showProcessingErrors)}render(){return this.sdkState?m`<primer-error-message message=\"${C(this.sdkState.failure?.message??\"\",{id:\"tokenizationError\"})}\" ?visible=\"${this.shouldShowError}\" ></primer-error-message>`:h}}"
|
|
328
328
|
},
|
|
329
329
|
{
|
|
330
330
|
"kind": "variable",
|
|
331
|
-
"name": "
|
|
331
|
+
"name": "Ge",
|
|
332
332
|
"default": "class extends v{constructor(){super(...arguments);this.hasAssignedContent=!1;this.onSlotChange=e=>{let o=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=o.length>0,this.requestUpdate()};this.paymentMethods=null;this.sdkState=null;this.clientOptions=null}render(){return this.sdkState?.isSuccessful?m`<slot name=\"checkout-complete\"><primer-checkout-complete></primer-checkout-complete></slot>`:m`<slot name=\"payments\" @slotchange=${this.onSlotChange}></slot>${k(this.hasAssignedContent,()=>h,()=>m`<div class=${re({\"primer-is-processing\":!!this.sdkState?.isProcessing})} ><primer-vault-manager></primer-vault-manager><primer-show-other-payments><div slot=\"other-payments\" class=\"primer-main-list\">${this.paymentMethods?.toArray().map(e=>m`<primer-payment-method type=${e.type} ?disabled=${this.clientOptions?.disabledPayments===!0} ></primer-payment-method>`)}</div></primer-show-other-payments><primer-error-message-container></primer-error-message-container></div>`)} `}}"
|
|
333
333
|
},
|
|
334
334
|
{
|
|
335
335
|
"kind": "function",
|
|
336
|
-
"name": "
|
|
336
|
+
"name": "$k"
|
|
337
337
|
}
|
|
338
338
|
],
|
|
339
339
|
"exports": [
|
|
@@ -357,7 +357,7 @@
|
|
|
357
357
|
"kind": "js",
|
|
358
358
|
"name": "AchPayment",
|
|
359
359
|
"declaration": {
|
|
360
|
-
"name": "
|
|
360
|
+
"name": "xe",
|
|
361
361
|
"module": "dist/primer-loader.js"
|
|
362
362
|
}
|
|
363
363
|
},
|
|
@@ -365,7 +365,7 @@
|
|
|
365
365
|
"kind": "js",
|
|
366
366
|
"name": "ApplePay",
|
|
367
367
|
"declaration": {
|
|
368
|
-
"name": "
|
|
368
|
+
"name": "Fe",
|
|
369
369
|
"module": "dist/primer-loader.js"
|
|
370
370
|
}
|
|
371
371
|
},
|
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
"kind": "js",
|
|
382
382
|
"name": "Blik",
|
|
383
383
|
"declaration": {
|
|
384
|
-
"name": "
|
|
384
|
+
"name": "ve",
|
|
385
385
|
"module": "dist/primer-loader.js"
|
|
386
386
|
}
|
|
387
387
|
},
|
|
@@ -389,7 +389,7 @@
|
|
|
389
389
|
"kind": "js",
|
|
390
390
|
"name": "Button",
|
|
391
391
|
"declaration": {
|
|
392
|
-
"name": "
|
|
392
|
+
"name": "fe",
|
|
393
393
|
"module": "dist/primer-loader.js"
|
|
394
394
|
}
|
|
395
395
|
},
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
"kind": "js",
|
|
398
398
|
"name": "CardForm",
|
|
399
399
|
"declaration": {
|
|
400
|
-
"name": "
|
|
400
|
+
"name": "Q",
|
|
401
401
|
"module": "dist/primer-loader.js"
|
|
402
402
|
}
|
|
403
403
|
},
|
|
@@ -405,7 +405,7 @@
|
|
|
405
405
|
"kind": "js",
|
|
406
406
|
"name": "CardFormCVV",
|
|
407
407
|
"declaration": {
|
|
408
|
-
"name": "
|
|
408
|
+
"name": "rt",
|
|
409
409
|
"module": "dist/primer-loader.js"
|
|
410
410
|
}
|
|
411
411
|
},
|
|
@@ -413,7 +413,7 @@
|
|
|
413
413
|
"kind": "js",
|
|
414
414
|
"name": "CardFormCardNetworkSelector",
|
|
415
415
|
"declaration": {
|
|
416
|
-
"name": "
|
|
416
|
+
"name": "ce",
|
|
417
417
|
"module": "dist/primer-loader.js"
|
|
418
418
|
}
|
|
419
419
|
},
|
|
@@ -421,7 +421,7 @@
|
|
|
421
421
|
"kind": "js",
|
|
422
422
|
"name": "CardFormCardNumber",
|
|
423
423
|
"declaration": {
|
|
424
|
-
"name": "
|
|
424
|
+
"name": "tt",
|
|
425
425
|
"module": "dist/primer-loader.js"
|
|
426
426
|
}
|
|
427
427
|
},
|
|
@@ -429,7 +429,7 @@
|
|
|
429
429
|
"kind": "js",
|
|
430
430
|
"name": "CardFormError",
|
|
431
431
|
"declaration": {
|
|
432
|
-
"name": "
|
|
432
|
+
"name": "Xe",
|
|
433
433
|
"module": "dist/primer-loader.js"
|
|
434
434
|
}
|
|
435
435
|
},
|
|
@@ -437,7 +437,7 @@
|
|
|
437
437
|
"kind": "js",
|
|
438
438
|
"name": "CardFormExpiry",
|
|
439
439
|
"declaration": {
|
|
440
|
-
"name": "
|
|
440
|
+
"name": "it",
|
|
441
441
|
"module": "dist/primer-loader.js"
|
|
442
442
|
}
|
|
443
443
|
},
|
|
@@ -445,7 +445,7 @@
|
|
|
445
445
|
"kind": "js",
|
|
446
446
|
"name": "CardFormName",
|
|
447
447
|
"declaration": {
|
|
448
|
-
"name": "
|
|
448
|
+
"name": "ot",
|
|
449
449
|
"module": "dist/primer-loader.js"
|
|
450
450
|
}
|
|
451
451
|
},
|
|
@@ -461,7 +461,7 @@
|
|
|
461
461
|
"kind": "js",
|
|
462
462
|
"name": "Collapsable",
|
|
463
463
|
"declaration": {
|
|
464
|
-
"name": "
|
|
464
|
+
"name": "ye",
|
|
465
465
|
"module": "dist/primer-loader.js"
|
|
466
466
|
}
|
|
467
467
|
},
|
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
"kind": "js",
|
|
470
470
|
"name": "Dialog",
|
|
471
471
|
"declaration": {
|
|
472
|
-
"name": "
|
|
472
|
+
"name": "Ne",
|
|
473
473
|
"module": "dist/primer-loader.js"
|
|
474
474
|
}
|
|
475
475
|
},
|
|
@@ -477,7 +477,7 @@
|
|
|
477
477
|
"kind": "js",
|
|
478
478
|
"name": "DynamicPayment",
|
|
479
479
|
"declaration": {
|
|
480
|
-
"name": "
|
|
480
|
+
"name": "ke",
|
|
481
481
|
"module": "dist/primer-loader.js"
|
|
482
482
|
}
|
|
483
483
|
},
|
|
@@ -485,7 +485,7 @@
|
|
|
485
485
|
"kind": "js",
|
|
486
486
|
"name": "ErrorMessage",
|
|
487
487
|
"declaration": {
|
|
488
|
-
"name": "
|
|
488
|
+
"name": "Ye",
|
|
489
489
|
"module": "dist/primer-loader.js"
|
|
490
490
|
}
|
|
491
491
|
},
|
|
@@ -493,7 +493,7 @@
|
|
|
493
493
|
"kind": "js",
|
|
494
494
|
"name": "ErrorMessageContainer",
|
|
495
495
|
"declaration": {
|
|
496
|
-
"name": "
|
|
496
|
+
"name": "at",
|
|
497
497
|
"module": "dist/primer-loader.js"
|
|
498
498
|
}
|
|
499
499
|
},
|
|
@@ -501,7 +501,7 @@
|
|
|
501
501
|
"kind": "js",
|
|
502
502
|
"name": "GooglePay",
|
|
503
503
|
"declaration": {
|
|
504
|
-
"name": "
|
|
504
|
+
"name": "He",
|
|
505
505
|
"module": "dist/primer-loader.js"
|
|
506
506
|
}
|
|
507
507
|
},
|
|
@@ -509,7 +509,7 @@
|
|
|
509
509
|
"kind": "js",
|
|
510
510
|
"name": "InitializedPayments",
|
|
511
511
|
"declaration": {
|
|
512
|
-
"name": "
|
|
512
|
+
"name": "Xr",
|
|
513
513
|
"module": "dist/primer-loader.js"
|
|
514
514
|
}
|
|
515
515
|
},
|
|
@@ -517,7 +517,7 @@
|
|
|
517
517
|
"kind": "js",
|
|
518
518
|
"name": "Input",
|
|
519
519
|
"declaration": {
|
|
520
|
-
"name": "
|
|
520
|
+
"name": "Y",
|
|
521
521
|
"module": "dist/primer-loader.js"
|
|
522
522
|
}
|
|
523
523
|
},
|
|
@@ -525,7 +525,7 @@
|
|
|
525
525
|
"kind": "js",
|
|
526
526
|
"name": "InputLabel",
|
|
527
527
|
"declaration": {
|
|
528
|
-
"name": "
|
|
528
|
+
"name": "Ze",
|
|
529
529
|
"module": "dist/primer-loader.js"
|
|
530
530
|
}
|
|
531
531
|
},
|
|
@@ -533,7 +533,7 @@
|
|
|
533
533
|
"kind": "js",
|
|
534
534
|
"name": "InputWrapper",
|
|
535
535
|
"declaration": {
|
|
536
|
-
"name": "
|
|
536
|
+
"name": "Ue",
|
|
537
537
|
"module": "dist/primer-loader.js"
|
|
538
538
|
}
|
|
539
539
|
},
|
|
@@ -541,7 +541,7 @@
|
|
|
541
541
|
"kind": "js",
|
|
542
542
|
"name": "PayPal",
|
|
543
543
|
"declaration": {
|
|
544
|
-
"name": "
|
|
544
|
+
"name": "ze",
|
|
545
545
|
"module": "dist/primer-loader.js"
|
|
546
546
|
}
|
|
547
547
|
},
|
|
@@ -549,7 +549,7 @@
|
|
|
549
549
|
"kind": "js",
|
|
550
550
|
"name": "PaymentMethod",
|
|
551
551
|
"declaration": {
|
|
552
|
-
"name": "
|
|
552
|
+
"name": "Le",
|
|
553
553
|
"module": "dist/primer-loader.js"
|
|
554
554
|
}
|
|
555
555
|
},
|
|
@@ -557,7 +557,7 @@
|
|
|
557
557
|
"kind": "js",
|
|
558
558
|
"name": "PaymentMethodContainer",
|
|
559
559
|
"declaration": {
|
|
560
|
-
"name": "
|
|
560
|
+
"name": "Me",
|
|
561
561
|
"module": "dist/primer-loader.js"
|
|
562
562
|
}
|
|
563
563
|
},
|
|
@@ -565,7 +565,7 @@
|
|
|
565
565
|
"kind": "js",
|
|
566
566
|
"name": "PaymentMethodContentComponent",
|
|
567
567
|
"declaration": {
|
|
568
|
-
"name": "
|
|
568
|
+
"name": "je",
|
|
569
569
|
"module": "dist/primer-loader.js"
|
|
570
570
|
}
|
|
571
571
|
},
|
|
@@ -573,7 +573,7 @@
|
|
|
573
573
|
"kind": "js",
|
|
574
574
|
"name": "Portal",
|
|
575
575
|
"declaration": {
|
|
576
|
-
"name": "
|
|
576
|
+
"name": "ht",
|
|
577
577
|
"module": "dist/primer-loader.js"
|
|
578
578
|
}
|
|
579
579
|
},
|
|
@@ -581,7 +581,7 @@
|
|
|
581
581
|
"kind": "js",
|
|
582
582
|
"name": "PortalDialog",
|
|
583
583
|
"declaration": {
|
|
584
|
-
"name": "
|
|
584
|
+
"name": "le",
|
|
585
585
|
"module": "dist/primer-loader.js"
|
|
586
586
|
}
|
|
587
587
|
},
|
|
@@ -589,7 +589,7 @@
|
|
|
589
589
|
"kind": "js",
|
|
590
590
|
"name": "PrimerCheckoutComplete",
|
|
591
591
|
"declaration": {
|
|
592
|
-
"name": "
|
|
592
|
+
"name": "Wt",
|
|
593
593
|
"module": "dist/primer-loader.js"
|
|
594
594
|
}
|
|
595
595
|
},
|
|
@@ -597,7 +597,7 @@
|
|
|
597
597
|
"kind": "js",
|
|
598
598
|
"name": "PrimerCheckoutComponent",
|
|
599
599
|
"declaration": {
|
|
600
|
-
"name": "
|
|
600
|
+
"name": "Ae",
|
|
601
601
|
"module": "dist/primer-loader.js"
|
|
602
602
|
}
|
|
603
603
|
},
|
|
@@ -605,7 +605,7 @@
|
|
|
605
605
|
"kind": "js",
|
|
606
606
|
"name": "PrimerCheckoutFailure",
|
|
607
607
|
"declaration": {
|
|
608
|
-
"name": "
|
|
608
|
+
"name": "Rt",
|
|
609
609
|
"module": "dist/primer-loader.js"
|
|
610
610
|
}
|
|
611
611
|
},
|
|
@@ -613,7 +613,7 @@
|
|
|
613
613
|
"kind": "js",
|
|
614
614
|
"name": "PrimerCheckoutState",
|
|
615
615
|
"declaration": {
|
|
616
|
-
"name": "
|
|
616
|
+
"name": "Qe",
|
|
617
617
|
"module": "dist/primer-loader.js"
|
|
618
618
|
}
|
|
619
619
|
},
|
|
@@ -621,7 +621,7 @@
|
|
|
621
621
|
"kind": "js",
|
|
622
622
|
"name": "PrimerIcon",
|
|
623
623
|
"declaration": {
|
|
624
|
-
"name": "
|
|
624
|
+
"name": "Be",
|
|
625
625
|
"module": "dist/primer-loader.js"
|
|
626
626
|
}
|
|
627
627
|
},
|
|
@@ -637,7 +637,7 @@
|
|
|
637
637
|
"kind": "js",
|
|
638
638
|
"name": "PrimerMain",
|
|
639
639
|
"declaration": {
|
|
640
|
-
"name": "
|
|
640
|
+
"name": "Ge",
|
|
641
641
|
"module": "dist/primer-loader.js"
|
|
642
642
|
}
|
|
643
643
|
},
|
|
@@ -645,7 +645,7 @@
|
|
|
645
645
|
"kind": "js",
|
|
646
646
|
"name": "RedirectPayment",
|
|
647
647
|
"declaration": {
|
|
648
|
-
"name": "
|
|
648
|
+
"name": "Ie",
|
|
649
649
|
"module": "dist/primer-loader.js"
|
|
650
650
|
}
|
|
651
651
|
},
|
|
@@ -653,7 +653,7 @@
|
|
|
653
653
|
"kind": "js",
|
|
654
654
|
"name": "Select",
|
|
655
655
|
"declaration": {
|
|
656
|
-
"name": "
|
|
656
|
+
"name": "ge",
|
|
657
657
|
"module": "dist/primer-loader.js"
|
|
658
658
|
}
|
|
659
659
|
},
|
|
@@ -661,7 +661,7 @@
|
|
|
661
661
|
"kind": "js",
|
|
662
662
|
"name": "ShowOtherPayments",
|
|
663
663
|
"declaration": {
|
|
664
|
-
"name": "
|
|
664
|
+
"name": "bt",
|
|
665
665
|
"module": "dist/primer-loader.js"
|
|
666
666
|
}
|
|
667
667
|
},
|
|
@@ -669,7 +669,7 @@
|
|
|
669
669
|
"kind": "js",
|
|
670
670
|
"name": "Spinner",
|
|
671
671
|
"declaration": {
|
|
672
|
-
"name": "
|
|
672
|
+
"name": "Ve",
|
|
673
673
|
"module": "dist/primer-loader.js"
|
|
674
674
|
}
|
|
675
675
|
},
|
|
@@ -685,7 +685,7 @@
|
|
|
685
685
|
"kind": "js",
|
|
686
686
|
"name": "VaultDeleteConfirmation",
|
|
687
687
|
"declaration": {
|
|
688
|
-
"name": "
|
|
688
|
+
"name": "Se",
|
|
689
689
|
"module": "dist/primer-loader.js"
|
|
690
690
|
}
|
|
691
691
|
},
|
|
@@ -693,7 +693,7 @@
|
|
|
693
693
|
"kind": "js",
|
|
694
694
|
"name": "VaultEmptyState",
|
|
695
695
|
"declaration": {
|
|
696
|
-
"name": "
|
|
696
|
+
"name": "et",
|
|
697
697
|
"module": "dist/primer-loader.js"
|
|
698
698
|
}
|
|
699
699
|
},
|
|
@@ -701,7 +701,7 @@
|
|
|
701
701
|
"kind": "js",
|
|
702
702
|
"name": "VaultErrorMessage",
|
|
703
703
|
"declaration": {
|
|
704
|
-
"name": "
|
|
704
|
+
"name": "Ke",
|
|
705
705
|
"module": "dist/primer-loader.js"
|
|
706
706
|
}
|
|
707
707
|
},
|
|
@@ -717,7 +717,7 @@
|
|
|
717
717
|
"kind": "js",
|
|
718
718
|
"name": "VaultManagerHeader",
|
|
719
719
|
"declaration": {
|
|
720
|
-
"name": "
|
|
720
|
+
"name": "Re",
|
|
721
721
|
"module": "dist/primer-loader.js"
|
|
722
722
|
}
|
|
723
723
|
},
|
|
@@ -725,7 +725,7 @@
|
|
|
725
725
|
"kind": "js",
|
|
726
726
|
"name": "VaultPaymentMethodItem",
|
|
727
727
|
"declaration": {
|
|
728
|
-
"name": "
|
|
728
|
+
"name": "be",
|
|
729
729
|
"module": "dist/primer-loader.js"
|
|
730
730
|
}
|
|
731
731
|
},
|
|
@@ -733,7 +733,7 @@
|
|
|
733
733
|
"kind": "js",
|
|
734
734
|
"name": "VaultPaymentSubmit",
|
|
735
735
|
"declaration": {
|
|
736
|
-
"name": "
|
|
736
|
+
"name": "X",
|
|
737
737
|
"module": "dist/primer-loader.js"
|
|
738
738
|
}
|
|
739
739
|
},
|
|
@@ -741,7 +741,7 @@
|
|
|
741
741
|
"kind": "js",
|
|
742
742
|
"name": "injectDarkTheme",
|
|
743
743
|
"declaration": {
|
|
744
|
-
"name": "
|
|
744
|
+
"name": "Tc",
|
|
745
745
|
"module": "dist/primer-loader.js"
|
|
746
746
|
}
|
|
747
747
|
},
|
|
@@ -749,7 +749,7 @@
|
|
|
749
749
|
"kind": "js",
|
|
750
750
|
"name": "injectLightTheme",
|
|
751
751
|
"declaration": {
|
|
752
|
-
"name": "
|
|
752
|
+
"name": "wc",
|
|
753
753
|
"module": "dist/primer-loader.js"
|
|
754
754
|
}
|
|
755
755
|
},
|
|
@@ -757,7 +757,7 @@
|
|
|
757
757
|
"kind": "js",
|
|
758
758
|
"name": "injectLoaderStyles",
|
|
759
759
|
"declaration": {
|
|
760
|
-
"name": "
|
|
760
|
+
"name": "$n",
|
|
761
761
|
"module": "dist/primer-loader.js"
|
|
762
762
|
}
|
|
763
763
|
},
|
|
@@ -765,7 +765,7 @@
|
|
|
765
765
|
"kind": "js",
|
|
766
766
|
"name": "injectThemeStyles",
|
|
767
767
|
"declaration": {
|
|
768
|
-
"name": "
|
|
768
|
+
"name": "Vn",
|
|
769
769
|
"module": "dist/primer-loader.js"
|
|
770
770
|
}
|
|
771
771
|
},
|
|
@@ -773,7 +773,7 @@
|
|
|
773
773
|
"kind": "js",
|
|
774
774
|
"name": "loadPrimer",
|
|
775
775
|
"declaration": {
|
|
776
|
-
"name": "
|
|
776
|
+
"name": "$k",
|
|
777
777
|
"module": "dist/primer-loader.js"
|
|
778
778
|
}
|
|
779
779
|
}
|
|
@@ -14172,7 +14172,7 @@
|
|
|
14172
14172
|
}
|
|
14173
14173
|
}
|
|
14174
14174
|
],
|
|
14175
|
-
"description": "Calculates the button height by reading the computed height from the element.\nThe CSS already calculates the correct height using CSS variables,\nso we just read the browser's computed value (which handles rem/em/% conversions)."
|
|
14175
|
+
"description": "Calculates the button height by reading the computed height from the element.\nThe CSS already calculates the correct height using CSS variables,\nso we just read the browser's computed value (which handles rem/em/% conversions).\n\nFor PayPal with height: auto, falls back to min-height if computed height is too small."
|
|
14176
14176
|
},
|
|
14177
14177
|
{
|
|
14178
14178
|
"kind": "function",
|
|
@@ -17044,7 +17044,7 @@
|
|
|
17044
17044
|
"kind": "field",
|
|
17045
17045
|
"name": "renderButtonTask",
|
|
17046
17046
|
"privacy": "private",
|
|
17047
|
-
"default": "new Task(this, { args: () => [this.loadManagerTask.value], task: async ([manager]) => { if (!manager) { return initialState; } // Ensure the component's DOM is updated await this.updateComplete; const buttonContainer = this.buttonContainerRef.value; if (!buttonContainer) { throw new Error('Button container not found'); } const button = manager.createButton(); // Calculate button height from the
|
|
17047
|
+
"default": "new Task(this, { args: () => [this.loadManagerTask.value], task: async ([manager]) => { if (!manager) { return initialState; } // Ensure the component's DOM is updated await this.updateComplete; const buttonContainer = this.buttonContainerRef.value; if (!buttonContainer) { throw new Error('Button container not found'); } const button = manager.createButton(); // Calculate button height from the host element (where :host styles are applied) // The buttonContainer itself has no height, but the host element has min-height from CSS const buttonHeight = calculateButtonHeight( this as unknown as HTMLElement, ); // Apply PayPal SDK height constraints (25-55px) const constrainedHeight = getPayPalConstrainedHeight(buttonHeight); // Warn if height exceeds maximum const PAYPAL_MAX_HEIGHT = 55; if (buttonHeight > PAYPAL_MAX_HEIGHT) { PrimerJSLogger.warn( `PayPal button height (${buttonHeight}px) exceeds maximum allowed height of ${PAYPAL_MAX_HEIGHT}px. Button will be capped at ${PAYPAL_MAX_HEIGHT}px. This is a PayPal SDK limitation.`, ); } // Render to button container with constrained height await button.render(buttonContainer as Element, { style: { buttonHeight: constrainedHeight, }, }); // Apply current disabled state to newly created button if (this.disabled) { await button.setDisabled(this.disabled); } // Apply disabled overlay if needed if (this.disabled) { await this.updateComplete; updateOverlayForContainer(this.disabled, this.buttonContainerRef); } return button; }, })"
|
|
17048
17048
|
}
|
|
17049
17049
|
],
|
|
17050
17050
|
"attributes": [
|