@primer-io/primer-js 1.6.1 → 1.6.2
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 +7 -0
- package/dist/custom-elements.json +264 -166
- package/dist/primer-loader.d.ts +81 -13
- package/dist/primer-loader.js +14 -14
- package/dist/web-types.json +1 -1
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"kind": "function",
|
|
24
|
-
"name": "
|
|
24
|
+
"name": "r",
|
|
25
25
|
"parameters": [
|
|
26
26
|
{
|
|
27
27
|
"name": "t"
|
|
@@ -33,7 +33,31 @@
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"kind": "function",
|
|
36
|
-
"name": "
|
|
36
|
+
"name": "r",
|
|
37
|
+
"parameters": [
|
|
38
|
+
{
|
|
39
|
+
"name": "t"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "e"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"kind": "function",
|
|
48
|
+
"name": "r",
|
|
49
|
+
"parameters": [
|
|
50
|
+
{
|
|
51
|
+
"name": "t"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "e"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"kind": "function",
|
|
60
|
+
"name": "r",
|
|
37
61
|
"parameters": [
|
|
38
62
|
{
|
|
39
63
|
"name": "t"
|
|
@@ -45,277 +69,269 @@
|
|
|
45
69
|
},
|
|
46
70
|
{
|
|
47
71
|
"kind": "variable",
|
|
48
|
-
"name": "
|
|
49
|
-
"default": "class extends
|
|
72
|
+
"name": "ee",
|
|
73
|
+
"default": "class extends b{constructor(){super(...arguments);this.size=\"large\";this.showCloseButton=!1;this.darkMode=!1;this.open=!1}openDialog(){this.open=!0}closeDialog(){let e=()=>{this.open=!1,this.removeEventListener(\"primer:dialog-close\",e)};this.addEventListener(\"primer:dialog-close\",e),this.dialog.startExitAnimation()}connectedCallback(){super.connectedCallback(),this.darkMode&&this.classList.add(\"primer-dark-theme\"),this.open||this.openDialog()}updated(e){super.updated(e),e.has(\"darkMode\")&&(this.darkMode?this.classList.add(\"primer-dark-theme\"):this.classList.remove(\"primer-dark-theme\")),e.has(\"open\")&&this.open&&this.onOpen&&this.onOpen(),e.has(\"open\")&&this.open&&this.onContentRendered&&this.updateComplete.then(()=>{requestAnimationFrame(()=>{this.onContentRendered?.()})})}render(){return this.open?p`<primer-dialog class=\"${this.darkMode?\"primer-dark-theme\":\"\"}\" .open=${this.open} size=${this.size} .showCloseButton=${this.showCloseButton} @primer:dialog-close=\"${()=>{this.open=!1}}\" ><slot></slot>${this.cta?p`<primer-button @click=${this.cta.onClick} class=\"cta-button\">${this.cta.icon?p`<primer-icon name=\"${this.cta.icon}\" size=\"sm\" color=\"var(--primer-color-background-outlined-default)\" ></primer-icon>`:f} ${this.cta.label}</primer-button>`:f}</primer-dialog>`:f}}"
|
|
50
74
|
},
|
|
51
75
|
{
|
|
52
76
|
"kind": "variable",
|
|
53
|
-
"name": "
|
|
54
|
-
"default": "class extends
|
|
77
|
+
"name": "ve",
|
|
78
|
+
"default": "class extends b{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._classObserver=null;this.locale=nr(Ra());this.onSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=i.length>0,this.requestUpdate()};this.sdkContextController=new va(this),this.primerEventsController=new rr(this),this.styleProcessingController=new ba(this),this.vaultManagerController=new Pr(this),this.headlessSdkController=new ja(this)}set jsInitialized(e){this.requestUpdate(),this._jsInitialized=e}get jsInitialized(){return this._jsInitialized}get primerJS(){return this.headlessSdkController?.primerJSInstance??void 0}connectedCallback(){super.connectedCallback(),this.sdkContextController.setEventsController(this.primerEventsController),this._eventListenerController=new AbortController,document.addEventListener(\"primer:card-submit\",this.handleExternalCardSubmit.bind(this),{signal:this._eventListenerController.signal}),document.addEventListener(\"primer:vault-submit\",this.handleExternalVaultSubmit.bind(this),{signal:this._eventListenerController.signal}),document.addEventListener(\"primer:show-other-payments-toggle\",this.handleExternalShowOtherPaymentsToggle.bind(this),{signal:this._eventListenerController.signal}),this._classObserver=new MutationObserver(()=>{this.requestUpdate()}),this._classObserver.observe(this,{attributes:!0,attributeFilter:[\"class\"]})}attributeChangedCallback(e,a,i){e===hg.CUSTOM_STYLES?this.styleProcessingController.processCustomStyles(i):super.attributeChangedCallback(e,a,i)}disconnectedCallback(){this._loadingTimeoutId&&(window.clearTimeout(this._loadingTimeoutId),this._loadingTimeoutId=null),this.sdkContextController.contextProvider.value.sdkState?.isLoading&&this.sdkContextController.setSdkState({isLoading:!1}),this._eventListenerController&&(this._eventListenerController.abort(),this._eventListenerController=null),this._classObserver&&(this._classObserver.disconnect(),this._classObserver=null),super.disconnectedCallback()}willUpdate(e){e.has(\"options\")&&(this.options?.locale&&(Cn(this.options?.locale)?this.locale=nr(this.options?.locale):B.warn(\"\\u{1F30E}\\u2757 Unsupported locale provided:\",this.options?.locale,\"- Falling back to system locale\")),vn(this.locale))}updated(){let e=getComputedStyle(this);this.sdkContextController.setComputedStyles(e),this.checkLoadingStateChange()}handleExternalCardSubmit(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:card-submit\",e.detail)}handleExternalVaultSubmit(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:vault-submit\",e.detail)}handleExternalShowOtherPaymentsToggle(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:show-other-payments-toggle\",e.detail)}checkLoadingStateChange(){let e=this.sdkContextController.contextProvider.value.sdkState.isLoading||!1;if(this.previousLoadingState&&!e){this.jsInitialized=!0;let a=this.sdkContextController.contextProvider.value.telemetry;a?.analytics.sendEvent({eventName:\"CHECKOUT_FLOW_STARTED\"});let i=a?.getSdkInitStartTime();a?.remoteLog.checkoutInitialized(i?Date.now()-i:void 0)}this.previousLoadingState=e,e&&!this._loadingTimeoutId?this._loadingTimeoutId=window.setTimeout(()=>{this.sdkContextController.contextProvider.value.sdkState.isLoading&&(B.warn(\"Loading timeout in component, forcing completion\"),this.sdkContextController.setSdkState({isLoading:!1}),this.jsInitialized=!0),this._loadingTimeoutId=null},1e4):!e&&this._loadingTimeoutId&&(window.clearTimeout(this._loadingTimeoutId),this._loadingTimeoutId=null)}render(){let e=this.sdkContextController.contextProvider.value.sdkState,a=e.isLoading,i=e.primerJsError,n=!a&&!i;return p` ${w(i,()=>p`<primer-checkout-error></primer-checkout-error>`)}<slot name=\"main\" @slotchange=${this.onSlotChange}></slot>${w(this.hasAssignedContent||!n,()=>f,()=>p`<primer-main></primer-main>`)} `}addEventListener(e,a,i){super.addEventListener(e,a,i)}removeEventListener(e,a,i){super.removeEventListener(e,a,i)}}"
|
|
55
79
|
},
|
|
56
80
|
{
|
|
57
81
|
"kind": "function",
|
|
58
|
-
"name": "
|
|
82
|
+
"name": "zl"
|
|
59
83
|
},
|
|
60
84
|
{
|
|
61
85
|
"kind": "function",
|
|
62
|
-
"name": "
|
|
86
|
+
"name": "jl"
|
|
63
87
|
},
|
|
64
88
|
{
|
|
65
89
|
"kind": "function",
|
|
66
|
-
"name": "
|
|
90
|
+
"name": "bg"
|
|
67
91
|
},
|
|
68
92
|
{
|
|
69
93
|
"kind": "function",
|
|
70
|
-
"name": "
|
|
94
|
+
"name": "Cg"
|
|
71
95
|
},
|
|
72
96
|
{
|
|
73
97
|
"kind": "variable",
|
|
74
|
-
"name": "
|
|
75
|
-
"default": "class extends
|
|
98
|
+
"name": "He",
|
|
99
|
+
"default": "class extends b{constructor(){super(...arguments);this.color=\"var(--primer-color-loader)\";this.size=\"medium\";this.compact=!1}getSize(){if(this.size in Kn)return Kn[this.size];let e=parseInt(this.size,10);return isNaN(e)?Kn.medium:e}render(){let e=this.getSize(),a=20,i=`0 0 ${a} ${a}`;return this.style.setProperty(\"--spinner-color\",this.color),this.style.setProperty(\"--spinner-size\",`${e}px`),p`<div class=\"spinner-container ${this.compact?\"compact\":\"\"}\"><svg class=\"spinner\" width=\"${e}\" height=\"${e}\" viewBox=\"${i}\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" role=\"status\" aria-label=\"Loading\" ><path d=\"M4.27827 10.002C4.27827 6.84166 6.84019 4.27973 10.0005 4.27973C10.7676 4.27973 11.3894 3.6579 11.3894 2.89084C11.3894 2.12378 10.7676 1.50195 10.0005 1.50195C5.30607 1.50195 1.50049 5.30753 1.50049 10.002C1.50049 14.6964 5.30607 18.502 10.0005 18.502C14.6949 18.502 18.5005 14.6964 18.5005 10.002C18.5005 9.23489 17.8787 8.61306 17.1116 8.61306C16.3445 8.61306 15.7227 9.23489 15.7227 10.002C15.7227 13.1622 13.1608 15.7242 10.0005 15.7242C6.84019 15.7242 4.27827 13.1622 4.27827 10.002Z\" fill=\"currentColor\" class=\"path\" /></svg></div>`}}"
|
|
76
100
|
},
|
|
77
101
|
{
|
|
78
102
|
"kind": "variable",
|
|
79
|
-
"name": "
|
|
80
|
-
"default": "class extends
|
|
103
|
+
"name": "$e",
|
|
104
|
+
"default": "class extends b{constructor(){super(...arguments);this.focusWithin=!1;this.hasError=!1;this.handleWrapperClick=e=>{if(e.target!==e.currentTarget)return;let a=this.findSlottedPrimerInput();a?a.focus():this.dispatchEvent(new CustomEvent(\"wrapper-click\",{bubbles:!0,composed:!0}))}}findSlottedPrimerInput(){if(!this.inputSlot)return null;let e=this.inputSlot.assignedElements({flatten:!0}),a=e.find(i=>i.tagName.toLowerCase()===\"primer-input\");if(a)return a;for(let i of e){let n=i.querySelector(\"primer-input\");if(n)return n}return null}render(){let e={\"input-slot\":!0,\"focus-within\":this.focusWithin};return p`<div class=\"input-wrapper\"><slot name=\"label\"></slot><div class=\"${W(e)}\" @click=\"${this.handleWrapperClick}\"><slot name=\"input\"></slot></div><slot name=\"error\"></slot></div>`}}"
|
|
81
105
|
},
|
|
82
106
|
{
|
|
83
107
|
"kind": "variable",
|
|
84
|
-
"name": "
|
|
85
|
-
"default": "class extends
|
|
108
|
+
"name": "it",
|
|
109
|
+
"default": "class extends b{constructor(){super(...arguments);this.for=\"\";this.disabled=!1}render(){return p`<label for=${this.for}><slot></slot></label>`}}"
|
|
86
110
|
},
|
|
87
111
|
{
|
|
88
112
|
"kind": "variable",
|
|
89
|
-
"name": "
|
|
90
|
-
"default": "class extends
|
|
113
|
+
"name": "ue",
|
|
114
|
+
"default": "class extends b{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?f:p`<primer-icon name=\"checkmark\" size=\"sm\" color=\"var(--primer-color-brand)\" ></primer-icon>`}renderSpinner(){if(!this.loading)return f;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)\"),p`<primer-spinner size=\"small\" color=\"${e}\" compact ></primer-spinner>`}render(){return p`<button type=${this.buttonType} ?disabled=${this.disabled||this.loading} @click=${this.handleClick} part=\"button\" aria-checked=${this.selectionState===\"checked\"} aria-busy=${this.loading} aria-label=${this.ariaLabel?this.ariaLabel:f} >${this.renderSpinner()} ${this.flex?p`<span class=\"button-content ${this.loading?\"loading\":\"\"}\"><slot></slot></span>`:p`<span class=\"button-content-base ${this.loading?\"loading\":\"\"}\" ><slot></slot></span>`} ${this.renderCheckmark()}</button>`}}"
|
|
91
115
|
},
|
|
92
116
|
{
|
|
93
117
|
"kind": "variable",
|
|
94
|
-
"name": "
|
|
95
|
-
"default": "class extends
|
|
118
|
+
"name": "nt",
|
|
119
|
+
"default": "class extends b{constructor(){super(...arguments);this.for=\"\";this.active=!0}render(){return p`<span class=\"error\" role=\"alert\" aria-live=\"polite\" id=\"${this.for||\"\"}\" ><slot></slot></span>`}}"
|
|
96
120
|
},
|
|
97
121
|
{
|
|
98
122
|
"kind": "variable",
|
|
99
|
-
"name": "
|
|
100
|
-
"default": "class extends
|
|
123
|
+
"name": "Ye",
|
|
124
|
+
"default": "class extends b{constructor(){super(...arguments);this.color=\"var(--primer-color-icon-primary)\";this.size=\"lg\"}render(){let e=this.name?Za[this.name]:null;return p`<div style=\"--internal-icon-color: ${this.color}\">${e||p`<slot></slot>`}</div>`}}"
|
|
101
125
|
},
|
|
102
126
|
{
|
|
103
127
|
"kind": "variable",
|
|
104
|
-
"name": "
|
|
105
|
-
"default": "class extends
|
|
128
|
+
"name": "ot",
|
|
129
|
+
"default": "class extends b{constructor(){super(...arguments);this.type=\"complete\"}render(){return this.type===\"complete\"?p`<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>`:p`<primer-icon size=\"lg\" name=\"failure-icon\" color=\"var(--primer-color-icon-negative)\" ></primer-icon><p>Payment failed</p>${this.description?p`<p class=\"secondary\">${this.description}</p>`:p`<p class=\"secondary\">Something went wrong.</p>`} `}}"
|
|
106
130
|
},
|
|
107
131
|
{
|
|
108
132
|
"kind": "variable",
|
|
109
|
-
"name": "
|
|
110
|
-
"default": "class extends
|
|
133
|
+
"name": "$",
|
|
134
|
+
"default": "class extends b{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 a=e.target;this.value=a.value;let i=new CustomEvent(\"input\",{detail:this.value,bubbles:!0,composed:!0});this.dispatchEvent(i)};this.handleChange=e=>{e.stopPropagation();let a=e.target;this.value=a.value;let i=new CustomEvent(\"change\",{detail:this.value,bubbles:!0,composed:!0});this.dispatchEvent(i)};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,a,i){this.inputElement?.setSelectionRange(e,a,i)}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},a=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join(\" \");return p`<input part=\"input\" class=${a} .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,a,i){super.addEventListener(e,a,i)}removeEventListener(e,a,i){super.removeEventListener(e,a,i)}}"
|
|
111
135
|
},
|
|
112
136
|
{
|
|
113
137
|
"kind": "variable",
|
|
114
138
|
"name": "re",
|
|
115
|
-
"default": "class extends
|
|
139
|
+
"default": "class extends b{constructor(){super(...arguments);this.prefix=\"+351\";this.value=\"\";this.placeholder=\"\";this.inputId=\"primer-pt-phone-number-input\";this.maxLength=15;this.minLength=9;this.disabled=!1;this.hasErrors=!1;this.handleInput=e=>{e.stopPropagation();let a=e.target,n=a.value.replace(/\\D/g,\"\").slice(0,this.maxLocalDigits);a.value!==n&&(a.value=n),this.dispatchValueEvent(\"input\",n)};this.handleChange=e=>{e.stopPropagation();let i=e.target.value.replace(/\\D/g,\"\");this.dispatchValueEvent(\"change\",i)};this.handleHostClick=()=>{this.inputEl?.focus()}}get localDigits(){let a=(this.value==null?\"\":String(this.value)).replace(/[^\\d+]/g,\"\");return a.startsWith(this.prefix)?a.slice(this.prefix.length):a.replace(/^\\+/,\"\")}get maxLocalDigits(){return Math.max(this.maxLength-this.prefix.length,0)}updated(e){if(!e.has(\"value\")&&!e.has(\"prefix\"))return;let a=this.inputEl;if(!a)return;let i=this.localDigits;a.value!==i&&(a.value=i)}dispatchValueEvent(e,a){let i=a.length?`${this.prefix}${a}`:\"\";this.dispatchEvent(new CustomEvent(e,{detail:i,bubbles:!0,composed:!0}))}focus(){this.inputEl?.focus()}render(){return p`<div @click=${this.handleHostClick} style=\"display: contents;\"><span class=\"flag\" aria-hidden=\"true\">${Ag}</span><span class=\"prefix\">${this.prefix}</span><input id=${this.inputId} type=\"tel\" inputmode=\"numeric\" autocomplete=\"tel-national\" ?disabled=${this.disabled} placeholder=${this.placeholder} @input=${this.handleInput} @change=${this.handleChange} /></div>`}}"
|
|
116
140
|
},
|
|
117
141
|
{
|
|
118
142
|
"kind": "variable",
|
|
119
|
-
"name": "
|
|
120
|
-
"default": "class extends
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"kind": "variable",
|
|
124
|
-
"name": "ue",
|
|
125
|
-
"default": "class extends C{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,i=this.header||e;return p`<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>${i}</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>`}}"
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"kind": "variable",
|
|
129
|
-
"name": "$e",
|
|
130
|
-
"default": "class extends C{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 f;let e={\"error-message\":!0,hidden:!this.visible};return p`<div part=\"error-message\" class=${X(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>`}}"
|
|
143
|
+
"name": "be",
|
|
144
|
+
"default": "class extends b{constructor(){super(...arguments);this.name=\"\";this.value=\"\";this.disabled=!1;this.hasError=!1;this.placeholder=\"\";this.options=[];this.handleChange=e=>{let i=e.target.value;this.dispatchEvent(new CustomEvent(\"change\",{detail:i,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"input\",{detail:i,bubbles:!0,composed:!0}))};this.handleFocus=()=>{this.dispatchEvent(new CustomEvent(\"focus\",{bubbles:!0,composed:!0}))};this.handleBlur=()=>{this.dispatchEvent(new CustomEvent(\"blur\",{bubbles:!0,composed:!0}))};this.stopNativeEvent=e=>{e.stopPropagation()}}renderSelectOptions(){let e=[];for(let a of this.options)e.push(p`<option value=${a.value} ?selected=${this.value===a.value} >${a.label}</option>`);return e}render(){return p`<select id=${this.id} name=${this.name} ?disabled=${this.disabled} ?required=${!this.value} @change=${this.handleChange} @input=${this.stopNativeEvent} @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>`}}"
|
|
131
145
|
},
|
|
132
146
|
{
|
|
133
147
|
"kind": "variable",
|
|
134
|
-
"name": "
|
|
135
|
-
"default": "class extends
|
|
148
|
+
"name": "pe",
|
|
149
|
+
"default": "class extends b{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,a=this.ariaLabel||this.header||e,i=this.header||e;return p`<div class=\"collapsable\"><primer-button variant=${this.buttonVariant} buttonType=\"button\" @click=${this.toggleExpanded} aria-expanded=${this.isExpanded} aria-controls=\"collapsable-content\" aria-label=${a} ><span>${i}</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>`}}"
|
|
136
150
|
},
|
|
137
151
|
{
|
|
138
152
|
"kind": "variable",
|
|
139
|
-
"name": "
|
|
140
|
-
"default": "class extends
|
|
153
|
+
"name": "ze",
|
|
154
|
+
"default": "class extends b{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 f;let e={\"error-message\":!0,hidden:!this.visible};return p`<div part=\"error-message\" class=${W(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>`}}"
|
|
141
155
|
},
|
|
142
156
|
{
|
|
143
157
|
"kind": "variable",
|
|
144
158
|
"name": "xe",
|
|
145
|
-
"default": "class extends
|
|
159
|
+
"default": "class extends b{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\",this.dispatchEvent(new CustomEvent(\"primer:dialog-open\",{bubbles:!0,composed:!0}))},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?p`<div class=${W({backdrop:!0,\"backdrop--entering\":this._animationState===\"entering\",\"backdrop--entered\":this._animationState===\"entered\",\"backdrop--exiting\":this._animationState===\"exiting\"})} @click=${e=>{e.preventDefault()}} ><div class=${W({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?p`<primer-button class=\"close\" variant=\"tertiary\" @click=${this._handleCloseClick} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:\"\"}</div><div class=\"content\"><slot></slot></div></div></div>`:p``}}"
|
|
146
160
|
},
|
|
147
161
|
{
|
|
148
162
|
"kind": "variable",
|
|
149
163
|
"name": "Ce",
|
|
150
|
-
"default": "class extends
|
|
164
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.selectedCategory=null;this.isExpanded=!1;this.categoryLoading=!1;this._setupTask=new H(this,{task:async([e,a])=>{let i=e?.find(n=>n.type===k.KLARNA);return!i||!a?V:{manager:i.manager}},args:()=>[this.primerContext?.paymentMethods,this.primerContext?.headlessUtils]});this.handleExpandedChange=e=>{this.isExpanded=e.detail.expanded,this.isExpanded||(this.selectedCategory=null,this.categoryLoading=!1,this.klarnaContainer&&(this.klarnaContainer.innerHTML=\"\"))};this.klarnaPaymentInProgress=!1}async startKlarnaPayment(){if(!(!this._setupTask.value||!this.selectedCategory)){this.klarnaPaymentInProgress=!0;try{await this._setupTask.value.manager.start({paymentMethodCategoryId:this.selectedCategory})}catch{}finally{this.klarnaPaymentInProgress=!1}}}async renderSelectedCategory(){if(!(!this._setupTask.value||!this.selectedCategory||!this.klarnaContainer))try{this.klarnaContainer.innerHTML=\"\",this.categoryLoading=!0,await this._setupTask.value.manager.renderCategory({containerId:this.klarnaContainer,paymentMethodCategoryId:this.selectedCategory,onHeightChange:()=>{}})}catch{}finally{this.categoryLoading=!1}}selectCategory(e){this.disabled||(this.selectedCategory=e)}updated(e){e.has(\"selectedCategory\")&&this.selectedCategory&&this.renderSelectedCategory()}renderCategorySelection(){let e=this.primerContext?.klarnaCategories?.categories||[];return this.primerContext?.klarnaCategories?.isLoading||!1?p`<div class=\"loading\"><primer-spinner size=\"small\"></primer-spinner></div>`:(e.length>0&&!this.selectedCategory&&this.selectCategory(e[0].id),e.length===1?f:p`<div class=\"category-selection\">${e.map(i=>p`<button class=${W({\"category-button\":!0,selected:i.id===this.selectedCategory,loading:this.categoryLoading&&i.id===this.selectedCategory})} @click=${()=>{this.selectCategory(i.id)}} ?disabled=${this.disabled} ><span class=${W({\"category-label\":!0,hidden:this.categoryLoading&&i.id===this.selectedCategory})} >${i.name}</span >${this.categoryLoading&&i.id===this.selectedCategory?p`<primer-spinner class=\"category-spinner\" size=\"small\" compact ></primer-spinner>`:f}</button>`)}</div>`)}renderExpandedContent(){return p` ${this.renderCategorySelection()}<div class=\"klarna-category-container ${!this.categoryLoading&&this.selectedCategory?\"visible\":\"\"}\" ><div id=\"klarna-category-container\" class=\"klarna-category-content\" ></div></div><primer-payment-method-accordion-confirm-button ?disabled=${!this.selectedCategory||this.disabled} ?loading=${Ct(this.primerContext?.sdkState)} @confirm=${()=>this.startKlarnaPayment()} ></primer-payment-method-accordion-confirm-button>`}render(){return this._setupTask.render({error:e=>{let a=e instanceof Error?e.message:\"Unknown error in Klarna\";return p`<div class=\"error\"> Error loading Klarna: ${a}</div>`},complete:({manager:e})=>e?p`<primer-payment-method-accordion .type=${k.KLARNA} ?disabled=${this.disabled} .expanded=${this.isExpanded} ?suppress-blur-collapse=${this.klarnaPaymentInProgress} @expanded-change=${this.handleExpandedChange} >${this.renderExpandedContent()}</primer-payment-method-accordion>`:f})}}"
|
|
151
165
|
},
|
|
152
166
|
{
|
|
153
167
|
"kind": "variable",
|
|
154
|
-
"name": "
|
|
155
|
-
"default": "class extends
|
|
168
|
+
"name": "Be",
|
|
169
|
+
"default": "class extends b{constructor(){super();this.type=void 0;this.disabled=!1;this.buttonContainerRef=Hr();this.renderButtonTask=new H(this,{args:()=>[this.paymentMethod],task:async([e])=>{if(!e)return V;await this.updateComplete;let a=e.manager.createButton(),i=this.buttonContainerRef.value;if(!i)throw new Q({origin:\"integration\",message:\"Button container not found\",code:Ps.CONTAINER_NOT_FOUND});let n=e.type===\"GOOGLE_PAY\"?{shadowRoot:this.shadowRoot}:e.type===\"APPLE_PAY\"?{buttonHeight:pd(i)}:{buttonHeight:Ig(pd(this))};return await a.render(i,{style:n}),this.disabled&&await a.setDisabled(this.disabled),a}})}attributeChangedCallback(e,a,i){if(super.attributeChangedCallback(e,a,i),e===\"disabled\"&&a!==i){let n=i!==null,o=this.renderButtonTask.value;o&&o.setDisabled(n)}}willUpdate(e){e.has(\"paymentMethod\")&&(this.type=this.paymentMethod?.type)}render(){return p`<div class=\"native-button-container\" ${pr(this.buttonContainerRef)} ></div>`}}"
|
|
156
170
|
},
|
|
157
171
|
{
|
|
158
172
|
"kind": "variable",
|
|
159
173
|
"name": "Se",
|
|
160
|
-
"default": "class extends
|
|
174
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.currentState=\"collapsed\";this.blikCode=\"\";this.errorMessage=\"\";this.pollingDuration=0;this.pollingTimer=null;this.handleExpandedChange=async e=>{if(this.disabled)return;if(!e.detail.expanded){this.handleCollapse();return}if(this.currentState!==\"collapsed\")return;if(!this.paymentMethod?.manager){this.errorMessage=T(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",B.error(\"Manager not available when expanding BLIK form\");return}this.currentState=\"expanded-input\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()};this.handleCollapse=()=>{this.currentState=\"collapsed\",this.blikCode=\"\",this.errorMessage=\"\",this.stopPollingTimer()};this.handleInput=e=>{let a=e.target,i=a.value,o=i.replace(/\\D/g,\"\").slice(0,6);i!==o&&(a.value=o),this.blikCode=o,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\"),o.length===6&&this.submitBlikCode()};this.handleRetry=async()=>{this.currentState=\"expanded-input\",this.errorMessage=\"\",this.blikCode=\"\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()}}get isExpanded(){return this.currentState!==\"collapsed\"}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=T(\"sixDigitCodeErrorTooShort\",{id:\"sixDigitCodeErrorTooShort\"}),this.currentState=\"error\";return}let e=this.paymentMethod?.manager;if(!e){this.errorMessage=\"BLIK payment method not initialized\",this.currentState=\"error\",B.error(\"BLIK manager not available via loadManagerTask\");return}this.currentState=\"loading\",this.errorMessage=\"\",this.startPollingTimer();try{await e.start({blikCode:this.blikCode}),this.stopPollingTimer(),this.currentState=\"collapsed\",this.blikCode=\"\"}catch(a){this.stopPollingTimer(),this.currentState=\"error\",this.errorMessage=a instanceof Error?a.message:T(\"tokenizationError\",{id:\"tokenizationError\"})}}renderExpandedInput(){return p`<div class=\"blik-input-wrapper\"><label for=\"blik-code\" class=\"blik-label\">${T(\"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=\"${T(\"sixDigitCodeLabel\",{id:\"sixDigitCodeLabel\"})}\" autocomplete=\"off\" spellcheck=\"false\" /></div>`}renderLoading(){return p`<div class=\"blik-loading\"><primer-spinner size=\"medium\"></primer-spinner>${this.pollingDuration>30?p`<div class=\"blik-timeout-warning\"> This is taking longer than expected... </div>`:f}</div>`}renderError(){return p`<div class=\"blik-error\"><div class=\"blik-error-message\" role=\"alert\">${this.errorMessage||T(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"blik-retry-button\" @click=\"${this.handleRetry}\" ?disabled=\"${this.disabled}\" >${T(\"retry_button\",{id:\"retry_button\"})}</button></div>`}renderExpandedState(){switch(this.currentState){case\"expanded-input\":return this.renderExpandedInput();case\"loading\":return this.renderLoading();case\"error\":return this.renderError();default:return f}}disconnectedCallback(){super.disconnectedCallback(),this.stopPollingTimer()}render(){return p`<primer-payment-method-accordion .type=${this.paymentMethod?.type} ?disabled=${this.disabled} .expanded=${this.isExpanded} @expanded-change=${this.handleExpandedChange} >${this.isExpanded?this.renderExpandedState():f}</primer-payment-method-accordion>`}}"
|
|
161
175
|
},
|
|
162
176
|
{
|
|
163
177
|
"kind": "variable",
|
|
164
|
-
"name": "
|
|
165
|
-
"default": "class extends
|
|
178
|
+
"name": "Ie",
|
|
179
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.currentState=\"collapsed\";this.phoneNumber=\"\";this.errorMessage=\"\";this.handleExpandedChange=async e=>{if(!this.disabled){if(!e.detail.expanded){this.handleCollapse();return}if(this.currentState===\"collapsed\"){if(!this.paymentMethod?.manager){this.errorMessage=T(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",B.error(\"Manager not available when expanding MB WAY form\");return}this.currentState=\"expanded-input\",await this.updateComplete,this.shadowRoot?.querySelector(\"primer-pt-phone-number-input\")?.focus()}}};this.handleCollapse=()=>{this.currentState=\"collapsed\",this.phoneNumber=\"\",this.errorMessage=\"\"};this.handleInput=e=>{this.phoneNumber=e.detail,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\")};this.handleRetry=async()=>{this.currentState=\"expanded-input\",this.errorMessage=\"\",this.phoneNumber=\"\",await this.updateComplete,this.shadowRoot?.querySelector(\"primer-pt-phone-number-input\")?.focus()}}get isExpanded(){return this.currentState!==\"collapsed\"}get isPhoneValid(){return this.phoneNumber.length>=fd&&this.phoneNumber.length<=yd&&/^\\+\\d+$/.test(this.phoneNumber)}async submit(){if(!this.isPhoneValid){this.errorMessage=T(\"telephoneNumberErrorTooShort\",{id:\"telephoneNumberErrorTooShort\"}),this.currentState=\"error\";return}let e=this.paymentMethod?.manager;if(!e){this.errorMessage=\"MB WAY payment method not initialized\",this.currentState=\"error\",B.error(\"MB WAY manager not available\");return}this.currentState=\"loading\",this.errorMessage=\"\";try{await e.start({phoneNumber:this.phoneNumber}),this.currentState=\"collapsed\",this.phoneNumber=\"\"}catch(a){this.currentState=\"error\",this.errorMessage=a instanceof Error?a.message:T(\"tokenizationError\",{id:\"tokenizationError\"})}}renderExpandedInput(){return p`<div class=\"mbway-input-wrapper\"><label class=\"mbway-label\" for=\"primer-mbway-phone\">${T(\"telephoneNumberLabel\",{id:\"telephoneNumberLabel\"})}</label><primer-pt-phone-number-input input-id=\"primer-mbway-phone\" .value=${this.phoneNumber} .placeholder=${T(\"telephoneNumberPlaceholder\",{id:\"telephoneNumberPlaceholder\"})} .maxLength=${yd} .minLength=${fd} ?disabled=${this.disabled} ?has-errors=${!!this.errorMessage} @input=${this.handleInput} ></primer-pt-phone-number-input><button class=\"mbway-submit-button\" @click=${()=>void this.submit()} ?disabled=${this.disabled||!this.isPhoneValid} >${T(\"pay\",{id:\"pay\"})}</button></div>`}renderLoading(){let e=T(\"Complete your payment in {appName}\",{id:\"completeYourPaymentInTheApp\"}).replace(\"{appName}\",\"MB WAY\");return p`<div class=\"mbway-loading\"><primer-spinner size=\"medium\"></primer-spinner><div class=\"mbway-loading-message\">${e}</div></div>`}renderError(){return p`<div class=\"mbway-error\"><div class=\"mbway-error-message\" role=\"alert\">${this.errorMessage||T(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"mbway-retry-button\" @click=${this.handleRetry} ?disabled=${this.disabled} >${T(\"retry_button\",{id:\"retry_button\"})}</button></div>`}renderExpandedState(){switch(this.currentState){case\"expanded-input\":return this.renderExpandedInput();case\"loading\":return this.renderLoading();case\"error\":return this.renderError();default:return f}}render(){return p`<primer-payment-method-accordion .type=${this.paymentMethod?.type} ?disabled=${this.disabled} .expanded=${this.isExpanded} @expanded-change=${this.handleExpandedChange} >${this.isExpanded?this.renderExpandedState():f}</primer-payment-method-accordion>`}}"
|
|
166
180
|
},
|
|
167
181
|
{
|
|
168
182
|
"kind": "variable",
|
|
169
|
-
"name": "
|
|
170
|
-
"default": "class extends
|
|
183
|
+
"name": "Ee",
|
|
184
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.isExpanded=!1;this.isLoading=!1;this.handleExpandedChange=e=>{this.isExpanded=e.detail.expanded,this.isExpanded?this.loadQRCode():(this.paymentMethod?.manager.stop(),this.qrCodeUrl=void 0,this.isLoading=!1)}}disconnectedCallback(){super.disconnectedCallback(),this.isExpanded&&this.paymentMethod?.manager.stop()}async loadQRCode(){this.paymentMethod?.manager&&(this.isLoading=!0,await this.paymentMethod.manager.start({onQRCodeReceived:e=>{this.qrCodeUrl=e,this.isLoading=!1}}))}willUpdate(e){e.has(\"primerContext\")&&this.isLoading&&this.isExpanded&&this.primerContext?.sdkState.paymentFailure&&(this.isLoading=!1,this.isExpanded=!1,this.qrCodeUrl=void 0)}renderQRCode(){return this.isLoading?p`<div class=\"qrcode-loading\"><primer-spinner size=\"medium\"></primer-spinner></div>`:p`<div class=\"qrcode-content\"><div class=\"qrcode-labels\"><h3 class=\"qrcode-title\">${T(\"scanToPay\",{id:\"scanToPay\"})}</h3><p class=\"qrcode-description\">${T(\"uploadScreenshot\",{id:\"uploadScreenshot\"})}</p></div><div class=\"qrcode-image\">${this.qrCodeUrl?p`<img src=${this.qrCodeUrl} alt=${T(\"qrCode\",{id:\"qrCode\"})} />`:f}</div></div>`}render(){return p`<primer-payment-method-accordion .type=${this.paymentMethod?.type} ?disabled=${this.disabled&&!this.isExpanded} ?loading=${this.isLoading} .expanded=${this.isExpanded} suppress-blur-collapse @expanded-change=${this.handleExpandedChange} >${this.isExpanded?this.renderQRCode():f}</primer-payment-method-accordion>`}}"
|
|
171
185
|
},
|
|
172
186
|
{
|
|
173
187
|
"kind": "variable",
|
|
174
|
-
"name": "
|
|
175
|
-
"default": "class extends
|
|
188
|
+
"name": "De",
|
|
189
|
+
"default": "class extends b{constructor(){super(...arguments);this.type=void 0;this.disabled=!1;this.isActive=!1;this.handleClick=()=>{this.disabled||this.primerContext?.paymentMethods?.find(a=>a.type===this.type)?.managerType===\"CARD\"||this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:this.type})}}updated(){let e=!!this.primerContext?.sdkState?.isProcessing;this.toggleAttribute(\"processing-inactive\",e&&!this.isActive)}render(){if(!this.type)return f;let e=this.primerContext?.paymentMethods.find(i=>i.type===this.type);if(!e)return f;let a;switch(e?.managerType){case\"CARD\":a=p`<primer-card-form ?disabled=${this.disabled} ></primer-card-form>`;break;case\"NATIVE\":a=p`<primer-native-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-native-payment>`;break;case\"QRCODE\":a=p`<primer-qrcode .paymentMethod=${e} ?disabled=${this.disabled} ></primer-qrcode>`;break;case\"BLIK\":a=p`<primer-blik .paymentMethod=${e} ?disabled=${this.disabled} ></primer-blik>`;break;case\"REDIRECT\":a=p`<primer-redirect-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-redirect-payment>`;break;case\"KLARNA\":a=p`<primer-klarna ?disabled=${this.disabled} ></primer-klarna>`;break;case\"ADYEN_KLARNA\":a=p`<primer-adyen-klarna .paymentMethod=${e} ?disabled=${this.disabled} ></primer-adyen-klarna>`;break;case\"MBWAY\":a=p`<primer-adyen-mbway .paymentMethod=${e} ?disabled=${this.disabled} ></primer-adyen-mbway>`;break;default:return f}return p`<div @click=${this.handleClick} @expanded-change=${i=>{this.isActive=i.detail.expanded}} >${a}</div>`}}"
|
|
176
190
|
},
|
|
177
191
|
{
|
|
178
192
|
"kind": "variable",
|
|
179
|
-
"name": "
|
|
180
|
-
"default": "class extends
|
|
193
|
+
"name": "_e",
|
|
194
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1}getFilteredMethods(){if(!this.primerContext?.paymentMethods)return[];let e=[...this.primerContext.paymentMethods];if(this.include){let a=this.include.split(\",\").map(i=>i.trim());e=e.filter(i=>a.includes(i.type))}if(this.exclude){let a=this.exclude.split(\",\").map(i=>i.trim());e=e.filter(i=>!a.includes(i.type))}return e}render(){let e=this.getFilteredMethods();return e.length===0?f:p`<div class=\"payment-methods-container\">${e.map(a=>p`<primer-payment-method type=\"${a.type}\" ?disabled=\"${this.disabled||this.primerContext?.clientOptions?.disabledPayments===!0}\" ></primer-payment-method>`)}</div>`}}"
|
|
181
195
|
},
|
|
182
196
|
{
|
|
183
197
|
"kind": "variable",
|
|
184
|
-
"name": "
|
|
185
|
-
"type": {
|
|
186
|
-
"text": "object"
|
|
187
|
-
},
|
|
188
|
-
"default": "{locale:\"id\",countries:{AF:\"Afghanistan\",AL:\"Albania\",DZ:\"Algeria\",AS:\"Samoa Amerika\",AD:\"Andorra\",AO:\"Angola\",AI:\"Anguilla\",AQ:\"Antarctica\",AG:\"Antigua dan Barbuda\",AR:\"Argentina\",AM:\"Armenia\",AW:\"Aruba\",AU:\"Australia\",AT:\"Austria\",AZ:\"Azerbaijan\",BS:\"Bahama\",BH:\"Bahrain\",BD:\"Bangladesh\",BB:\"Barbados\",BY:\"Belarusia\",BE:\"Belgia\",BZ:\"Belize\",BJ:\"Benin\",BM:\"Bermuda\",BT:\"Bhutan\",BO:\"Bolivia\",BA:\"Bosnia dan Herzegovina\",BW:\"Botswana\",BV:\"Kepulauan Bouvet\",BR:\"Brasil\",IO:\"Teritori Samudra Hindia Britania\",BN:\"Brunei Darussalam\",BG:\"Bulgaria\",BF:\"Burkina Faso\",BI:\"Burundi\",KH:\"Kamboja\",CM:\"Kamerun\",CA:\"Kanada\",CV:\"Tanjung Verde\",KY:\"Kepulauan Cayman\",CF:\"Afrika Tengah\",TD:\"Chad\",CL:\"Chile\",CN:\"China\",CX:\"Pulau Natal\",CC:\"Kepulauan Cocos (Keeling)\",CO:\"Kolombia\",KM:\"Komoro\",CG:\"Kongo\",CD:\"Republik Demokratik Kongo\",CK:\"Kepulauan Cook\",CR:\"Kosta Rika\",CI:\"Pantai Gading\",HR:\"Kroasia\",CU:\"Kuba\",CY:\"Siprus\",CZ:\"Republik Ceko\",DK:\"Denmark\",DJ:\"Djibouti\",DM:\"Dominika\",DO:\"Republik Dominika\",EC:\"Ekuador\",EG:\"Mesir\",SV:\"El Salvador\",GQ:\"Guinea Khatulistiwa\",ER:\"Eritrea\",EE:\"Estonia\",ET:\"Ethiopia\",FK:\"Kepulauan Falkland(Malvinas)\",FO:\"Kepulauan Faroe\",FJ:\"Fiji\",FI:\"Finlandia\",FR:\"Perancis\",GF:\"Guyana Perancis\",PF:\"Polinesia Perancis\",TF:\"Antartika Perancis\",GA:\"Gabon\",GM:\"Gambia\",GE:\"Georgia\",DE:\"Jerman\",GH:\"Ghana\",GI:\"Gibraltar\",GR:\"Yunani\",GL:\"Greenland\",GD:\"Grenada\",GP:\"Guadeloupe\",GU:\"Guam\",GT:\"Guatamala\",GN:\"Guinea\",GW:\"Guinea-Bissau\",GY:\"Guyana\",HT:\"Haiti\",HM:\"Pulau Heard dan Kepulauan McDonald\",VA:\"Vatikan\",HN:\"Honduras\",HK:\"Hong Kong\",HU:\"Hungaria\",IS:\"Islandia\",IN:\"India\",ID:\"Indonesia\",IR:\"Iran\",IQ:\"Irak\",IE:\"Irlandia\",IL:\"Israel\",IT:\"Italia\",JM:\"Jamaika\",JP:\"Jepang\",JO:\"Yordania\",KZ:\"Kazakhstan\",KE:\"Kenya\",KI:\"Kiribati\",KP:\"Korea Utara\",KR:\"Korea Selatan\",KW:\"Kuwait\",KG:\"Kyrgyzstan\",LA:\"Laos\",LV:\"Latvia\",LB:\"Lebanon\",LS:\"Lesotho\",LR:\"Liberia\",LY:\"Libya\",LI:\"Liechtenstein\",LT:\"Lithuania\",LU:\"Luxemburg\",MO:\"Makau\",MK:\"Makedonia Utara\",MG:\"Madagaskar\",MW:\"Malawi\",MY:\"Malaysia\",MV:\"Maldives\",ML:\"Mali\",MT:\"Malta\",MH:\"Kepulauan Marshall\",MQ:\"Martinik\",MR:\"Mauritania\",MU:\"Mauritius\",YT:\"Mayotte\",MX:\"Meksiko\",FM:\"Federasi Mikronesia\",MD:\"Moldova\",MC:\"Monako\",MN:\"Mongolia\",MS:\"Montserrat\",MA:\"Moroko\",MZ:\"Mozambik\",MM:\"Myanmar\",NA:\"Namibia\",NR:\"Nauru\",NP:\"Nepal\",NL:\"Belanda\",NC:\"Kaledonia Baru\",NZ:\"Selandia Baru\",NI:\"Nikaragua\",NE:\"Niger\",NG:\"Nigeria\",NU:\"Niue\",NF:\"Kepulauan Norfolk\",MP:\"Kepulauan Mariana Utara\",NO:\"Norwegia\",OM:\"Oman\",PK:\"Pakistan\",PW:\"Palau\",PS:\"Palestina\",PA:\"Panama\",PG:\"Papua Nugini\",PY:\"Paraguay\",PE:\"Peru\",PH:\"Filipina\",PN:\"Pitcairn\",PL:\"Polandia\",PT:\"Portugal\",PR:\"Puerto Riko\",QA:\"Qatar\",RE:\"Reunion\",RO:\"Rumania\",RU:\"Rusia\",RW:\"Rwanda\",SH:\"Saint Helena\",KN:\"Saint Kitts dan Nevis\",LC:\"Saint Lucia\",PM:\"Saint Pierre dan Miquelon\",VC:\"Saint Vincent dan the Grenadines\",WS:\"Samoa\",SM:\"San Marino\",ST:\"Sao Tome dan Principe\",SA:\"Arab Saudi\",SN:\"Senegal\",SC:\"Seychelles\",SL:\"Sierra Leone\",SG:\"Singapura\",SK:\"Slovakia\",SI:\"Slovenia\",SB:\"Kepulauan Solomon\",SO:\"Somalia\",ZA:\"Afrika Selatan\",GS:\"Georgia Selatan dan Kepulauan Sandwich Selatan\",ES:\"Spanyol\",LK:\"Sri Lanka\",SD:\"Sudan\",SR:\"Suriname\",SJ:\"Svalbard dan Jan Mayen\",SZ:\"Eswatini\",SE:\"Sweden\",CH:\"Swiss\",SY:\"Suriah\",TW:\"Taiwan\",TJ:\"Tajikistan\",TZ:\"Tanzania\",TH:\"Thailand\",TL:\"Timor-Leste\",TG:\"Togo\",TK:\"Tokelau\",TO:\"Tonga\",TT:\"Trinidad dan Tobago\",TN:\"Tunisia\",TR:\"Turki\",TM:\"Turkmenistan\",TC:\"Turks dan Caicos Islands\",TV:\"Tuvalu\",UG:\"Uganda\",UA:\"Ukraina\",AE:\"Uni Emirat Arab\",GB:\"Britania Raya\",US:\"Amerika Serikat\",UM:\"United States Minor Outlying Islands\",UY:\"Uruguay\",UZ:\"Uzbekistan\",VU:\"Vanuatu\",VE:\"Venezuela\",VN:\"Viet Nam\",VG:\"Virgin Islands, British\",VI:\"Virgin Islands, U.S.\",WF:\"Wallis and Futuna\",EH:\"Sahara Barat\",YE:\"Yaman\",ZM:\"Zambia\",ZW:\"Zimbabwe\",AX:\"\\xC5land Islands\",BQ:\"Bonaire, Sint Eustatius and Saba\",CW:\"Cura\\xE7ao\",GG:\"Guernsey\",IM:\"Isle of Man\",JE:\"Jersey\",ME:\"Montenegro\",BL:\"Saint Barth\\xE9lemy\",MF:\"Saint Martin (French part)\",RS:\"Serbia\",SX:\"Sint Maarten (Dutch part)\",SS:\"Sudan Selatan\",XK:\"Kosovo\"}}"
|
|
198
|
+
"name": "je",
|
|
199
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this._setupTask=new H(this,{task:([e,a])=>{if(!e||!a)return V;let i=a.getPaymentMethodConfiguration(e);if(!i)return V;let n=Sd(e)?this.primerContext?.clientOptions?.giftCard:void 0,o=i.displayMetadata.button,s=this._getBackgroundColor(e,o,n?.background),l=this._getTextColor(s);return{backgroundColor:s,textColor:l,name:i.name,alt:n?.logoAlt??i.name,displayName:this._getDisplayName(e,o.text,n?.text),iconUrl:this._getIconUrl(e,o,s,n?.logoSrc),iconPosition:this._getIconPosition(e,o)}},args:()=>[this.type,this.primerContext?.headlessUtils]})}_legacyGetButtonLabel(e){if(!e)return;let a=e?Vn(e):\"\";return a===\"payWith\"&&(a=\"pay_with\"),T(a,{id:a})}_getBackgroundColor(e,a,i){switch(e){case k.KLARNA:case k.ADYEN_KLARNA:return a.backgroundColor.light??a.backgroundColor.colored;default:return i??a.backgroundColor.colored??a.backgroundColor.light}}_getIconUrl(e,a,i,n){if(n)return n;switch(e){case k.KLARNA:case k.ADYEN_KLARNA:return Bg;case k.PAY_NL_PAYCONIQ:return i===a.backgroundColor.light?Lg:Rg;case k.ADYEN_CASHAPP:return a.iconUrl.dark??a.iconUrl.colored??a.iconUrl.light;default:return e===\"TRIPLE_A\"?xg:a.iconUrl.colored??a.iconUrl.light}}_getIconPosition(e,a){switch(e){case k.KLARNA:case k.ADYEN_KLARNA:return\"END\";default:return a.iconPositionRelativeToText||\"START\"}}_getTextColor(e){let a=e.replace(\"#\",\"\");if(a.length<6)return;let i=parseInt(a.substring(0,2),16),n=parseInt(a.substring(2,4),16),o=parseInt(a.substring(4,6),16);return isNaN(i)||isNaN(n)||isNaN(o)?void 0:(.2126*i+.7152*n+.0722*o)/255>.6?\"#000000\":\"#FFFFFF\"}_getDisplayName(e,a,i){switch(e){case k.KLARNA:return this.primerContext?.clientOptions?.klarna?.buttonOptions?.text??i??this._legacyGetButtonLabel(a)??this._legacyGetButtonLabel(\"Pay with\");case k.ADYEN_KLARNA:return this.primerContext?.clientOptions?.adyenKlarna?.buttonOptions?.text??i??this._legacyGetButtonLabel(a)??this._legacyGetButtonLabel(\"Pay with\");default:return i??this._legacyGetButtonLabel(a)}}_handleClick(){this.disabled||this.dispatchEvent(new Event(\"payment-method-click\",{bubbles:!0,composed:!0}))}render(){return this._setupTask.render({error:()=>f,complete:e=>{this.style.setProperty(\"--payment-method-button-bg-color\",e.backgroundColor),e.textColor&&this.style.setProperty(\"--payment-method-button-text-color\",e.textColor);let a={loading:Ct(this.primerContext?.sdkState),\"icon-end\":e.iconPosition===\"END\",\"image-only\":!e.displayName};return p`<primer-button @click=\"${()=>this._handleClick()}\" class=${W(a)} title=\"${T(\"pay_with\",{id:\"pay_with\"})} ${e.name}\" ?disabled=${this.disabled} ><img src=\"${e.iconUrl}\" alt=\"${e.alt}\" />${w(e.displayName,()=>p`<span class=\"button-text\">${e.displayName}</span>`)}</primer-button>`}})}}"
|
|
189
200
|
},
|
|
190
201
|
{
|
|
191
202
|
"kind": "variable",
|
|
192
|
-
"name": "
|
|
193
|
-
"default": "class extends
|
|
203
|
+
"name": "st",
|
|
204
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1}_handleClick(){this.disabled||!this.paymentMethod?.manager||this.paymentMethod.manager.start()}render(){return p`<primer-payment-method-button .type=${this.paymentMethod?.type} ?disabled=${this.disabled} @payment-method-click=${()=>this._handleClick()} ></primer-payment-method-button>`}}"
|
|
194
205
|
},
|
|
195
206
|
{
|
|
196
207
|
"kind": "variable",
|
|
197
208
|
"name": "oe",
|
|
198
|
-
"default": "class extends
|
|
209
|
+
"default": "class extends b{constructor(){super(...arguments);this.formData={};this.errors={};this.touchedFields=new Set;this.dirtyFields=new Set;this.focusedField=null;this.submitted=!1;this.countryOptions=[];this._initializationTask=new H(this,{task:async([e,a])=>{if(!e||!a)return V;let i=this.extractFieldConfig(e);return await this.initializeCountryOptions(),i},args:()=>[this.primerContext?.configuration??null,this.primerContext?.headlessUtils]})}connectedCallback(){super.connectedCallback(),this._initializationTask.value}extractFieldConfig(e){if(e?.checkoutModules){let a=e.checkoutModules.find(i=>i.type===\"BILLING_ADDRESS\");if(a?.options){let i=a.options;return Object.keys(zn).reduce((n,o)=>({...n,[o]:i[o]??!1}),{})}}return this.defaultFieldConfig}async initializeCountryOptions(){try{let e=Yn(\"en\");this.countryOptions=[...e.map(([n,o])=>({value:n,label:o}))],this.requestUpdate(\"countryOptions\");let a=bn();if(a===\"en\"||a===\"en-GB\"||a.startsWith(\"en-\"))return;if(await nc(a)){let n=Yn(a);this.countryOptions=[...n.map(([o,s])=>({value:o,label:s}))],this.requestUpdate(\"countryOptions\")}}catch(e){ir(this.primerContext?.telemetry,\"Failed to load country locale\",{error:e})}}get fieldConfig(){return this.extractFieldConfig(this.primerContext?.configuration)}get defaultFieldConfig(){return Object.keys(zn).reduce((e,a)=>({...e,[a]:!1}),{})}get shouldShowForm(){return this.fieldConfig.postalCode}handleInput(e,a){this.formData={...this.formData,[e]:a},this.dirtyFields.add(e),(this.submitted||this.dirtyFields.has(e)&&this.touchedFields.has(e))&&this.validateField(e),this.dispatchEvent(new CustomEvent(\"primer-billing-address-change\",{detail:this.formData,bubbles:!0,composed:!0}))}handleFocus(e){this.focusedField=e}handleBlur(e){this.focusedField=null,this.touchedFields.add(e),this.validateField(e)}validateField(e){let a=this.formData[e],i=this.fieldConfig[e];if(!i){delete this.errors[e];return}if(i&&(!a||a.trim()===\"\")){let n=`${e}ErrorRequired`;this.errors={...this.errors,[e]:T(\"This field is required\",{id:n})}}else{let n={...this.errors};delete n[e],this.errors=n}}validateForm(){return Object.keys(zn).forEach(e=>{let a=e;this.fieldConfig[a]&&this.validateField(a)}),Object.keys(this.errors).length===0}async validateForSubmission(){if(!this.shouldShowForm)return!0;this.submitted=!0,Object.keys(this.fieldConfig).forEach(a=>{this.fieldConfig[a]&&this.touchedFields.add(a)});let e=this.validateForm();return this.requestUpdate(),await this.updateComplete,e}async submitToSDK(){if(this.primerContext?.headlessUtils?.setBillingAddress)try{return await this.primerContext?.headlessUtils.setBillingAddress(this.formData),this.dispatchEvent(new CustomEvent(\"primer-billing-address-submit\",{detail:this.formData,bubbles:!0,composed:!0})),!0}catch{return!1}return!0}shouldShowError(e){let a=!!this.errors[e],i=this.dirtyFields.has(e),n=this.touchedFields.has(e);return a&&(this.submitted||i&&n)}render(){return this._initializationTask.render({pending:()=>f,error:()=>f,complete:()=>this.shouldShowForm?(this.removeAttribute(\"hidden\"),p`<div class=\"billing-address-form\"><div class=\"billing-address-title\">${T(\"Billing address\",{id:\"billingAddressLabel\"})}</div>${w(this.fieldConfig.countryCode,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"countryCode\"} .hasError=${this.shouldShowError(\"countryCode\")} ><primer-input-label slot=\"label\">${T(\"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=${T(\"Select a country\",{id:\"countrySelectPlaceholder\"})} @input=${e=>this.handleInput(\"countryCode\",e.detail)} @focus=${()=>this.handleFocus(\"countryCode\")} @blur=${()=>this.handleBlur(\"countryCode\")} ></primer-select>${w(this.shouldShowError(\"countryCode\"),()=>p`<primer-input-error slot=\"error\">${this.errors.countryCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.firstName||this.fieldConfig.lastName,()=>p`<div class=\"billing-address-row\">${w(this.fieldConfig.firstName,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"firstName\"} .hasError=${this.shouldShowError(\"firstName\")} ><primer-input-label slot=\"label\">${T(\"First name\",{id:\"firstNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"firstName\" name=\"firstName\" type=\"text\" .value=${this.formData.firstName||\"\"} placeholder=${T(\"First name\",{id:\"firstNamePlaceholder\"})} @input=${e=>this.handleInput(\"firstName\",e.detail)} @focus=${()=>this.handleFocus(\"firstName\")} @blur=${()=>this.handleBlur(\"firstName\")} ></primer-input>${w(this.shouldShowError(\"firstName\"),()=>p`<primer-input-error slot=\"error\">${this.errors.firstName}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.lastName,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"lastName\"} .hasError=${this.shouldShowError(\"lastName\")} ><primer-input-label slot=\"label\">${T(\"Last name\",{id:\"lastNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"lastName\" name=\"lastName\" type=\"text\" .value=${this.formData.lastName||\"\"} placeholder=${T(\"Last name\",{id:\"lastNamePlaceholder\"})} @input=${e=>this.handleInput(\"lastName\",e.detail)} @focus=${()=>this.handleFocus(\"lastName\")} @blur=${()=>this.handleBlur(\"lastName\")} ></primer-input>${w(this.shouldShowError(\"lastName\"),()=>p`<primer-input-error slot=\"error\">${this.errors.lastName}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${w(this.fieldConfig.addressLine1,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine1\"} .hasError=${this.shouldShowError(\"addressLine1\")} ><primer-input-label slot=\"label\">${T(\"Address line 1\",{id:\"addressLine1\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine1\" name=\"addressLine1\" type=\"text\" .value=${this.formData.addressLine1||\"\"} placeholder=${T(\"Address line 1\",{id:\"addressLine1Placeholder\"})} @input=${e=>this.handleInput(\"addressLine1\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine1\")} @blur=${()=>this.handleBlur(\"addressLine1\")} ></primer-input>${w(this.shouldShowError(\"addressLine1\"),()=>p`<primer-input-error slot=\"error\">${this.errors.addressLine1}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.addressLine2,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine2\"} .hasError=${this.shouldShowError(\"addressLine2\")} ><primer-input-label slot=\"label\">${T(\"Address line 2\",{id:\"addressLine2\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine2\" name=\"addressLine2\" type=\"text\" .value=${this.formData.addressLine2||\"\"} placeholder=${T(\"Address line 2\",{id:\"addressLine2Placeholder\"})} @input=${e=>this.handleInput(\"addressLine2\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine2\")} @blur=${()=>this.handleBlur(\"addressLine2\")} ></primer-input>${w(this.shouldShowError(\"addressLine2\"),()=>p`<primer-input-error slot=\"error\">${this.errors.addressLine2}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.postalCode||this.fieldConfig.city,()=>p`<div class=\"billing-address-row\">${w(this.fieldConfig.postalCode,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"postalCode\"} .hasError=${this.shouldShowError(\"postalCode\")} ><primer-input-label slot=\"label\">${T(\"Postal code\",{id:\"postalCodeLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"postalCode\" name=\"postalCode\" type=\"text\" .value=${this.formData.postalCode||\"\"} placeholder=${T(\"90210\",{id:\"postalCodePlaceholder\"})} @input=${e=>this.handleInput(\"postalCode\",e.detail)} @focus=${()=>this.handleFocus(\"postalCode\")} @blur=${()=>this.handleBlur(\"postalCode\")} ></primer-input>${w(this.shouldShowError(\"postalCode\"),()=>p`<primer-input-error slot=\"error\">${this.errors.postalCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.city,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"city\"} .hasError=${this.shouldShowError(\"city\")} ><primer-input-label slot=\"label\">${T(\"City\",{id:\"cityLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"city\" name=\"city\" type=\"text\" .value=${this.formData.city||\"\"} placeholder=${T(\"Cape Town\",{id:\"cityPlaceholder\"})} @input=${e=>this.handleInput(\"city\",e.detail)} @focus=${()=>this.handleFocus(\"city\")} @blur=${()=>this.handleBlur(\"city\")} ></primer-input>${w(this.shouldShowError(\"city\"),()=>p`<primer-input-error slot=\"error\">${this.errors.city}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${w(this.fieldConfig.state,()=>p`<primer-input-wrapper .focusWithin=${this.focusedField===\"state\"} .hasError=${this.shouldShowError(\"state\")} ><primer-input-label slot=\"label\">${T(\"State / Region / County\",{id:\"stateLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"state\" name=\"state\" type=\"text\" .value=${this.formData.state||\"\"} placeholder=${T(\"State / Region / County\",{id:\"statePlaceholder\"})} @input=${e=>this.handleInput(\"state\",e.detail)} @focus=${()=>this.handleFocus(\"state\")} @blur=${()=>this.handleBlur(\"state\")} ></primer-input>${w(this.shouldShowError(\"state\"),()=>p`<primer-input-error slot=\"error\">${this.errors.state}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`):(this.setAttribute(\"hidden\",\"\"),f)})}}"
|
|
199
210
|
},
|
|
200
211
|
{
|
|
201
212
|
"kind": "variable",
|
|
202
|
-
"name": "
|
|
203
|
-
"default": "class extends
|
|
213
|
+
"name": "se",
|
|
214
|
+
"default": "class extends b{constructor(){super();this.hasSlottedSubmit=!1;this.isEditMode=!1;this.deletePaymentMethodId=null;this.isDeleting=!1;this.errorMessage=\"\";this.animationDuration=300;this._isHandlingContextEvent=!1;this._contextVaultSubmitListener=null;this.deleteAssetConfig=null;this.handleSubmitSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasSlottedSubmit=i.length>0};this.handleToggleEditMode=e=>{this.isEditMode=e.detail,this.deletePaymentMethodId=null,this.isEditMode&&this.primerContext?.vaultItem&&this.primerContext?.vaultItem.setSelectedVaultedPaymentMethod(null)};this.handleDeletePaymentMethod=async e=>{if(this.deletePaymentMethodId=e.detail,this.deletePaymentMethodId&&this.primerContext?.vaultManager&&this.primerContext?.headlessUtils){let a=this.primerContext?.vaultManager.vaultedPaymentMethods.find(i=>i.id===this.deletePaymentMethodId);a&&(this.deleteAssetConfig=await qa(a,this.primerContext?.headlessUtils,this.primerContext?.vaultManager))}};this.handleCancelDelete=()=>{this.deletePaymentMethodId=null,this.deleteAssetConfig=null};this.handleConfirmDelete=async()=>{if(!this.primerContext?.vaultManager?.deleteVaultedPaymentMethod||!this.deletePaymentMethodId){this.errorMessage=T(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"});return}try{this.isDeleting=!0,await this.primerContext?.vaultManager.deleteVaultedPaymentMethod(this.deletePaymentMethodId),this.deletePaymentMethodId=null,this.deleteAssetConfig=null}catch(e){this.errorMessage=e instanceof Error?e.message:T(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}finally{this.isDeleting=!1}};this.handlePaymentError=e=>{let a=e.detail?.error;this.errorMessage=a instanceof Error?a.message:T(\"payment_processing_error\",{id:\"payment_processing_error\"})};this.handleCloseError=()=>{this.errorMessage=\"\"};this.handleSlotButtonClick=e=>{let i=e.target.closest(\"button, primer-button\");if(!i)return;let n=i;this.isSubmitButton(n)&&(e.preventDefault(),this.submitVaultPayment())};this.handleDirectSubmit=()=>{this.submitVaultPayment()};this.handleContextVaultSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitVaultPayment())}finally{this._isHandlingContextEvent=!1}}};new mr(this,{defaultOptions:{keyframeOptions:{duration:Number(getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-duration\").trim().replace(\"ms\",\"\")),easing:getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-easing\").trim()}}})}getAnimationConfig(){return{keyframeOptions:{duration:this.animationDuration,easing:getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-easing\").trim(),fill:\"both\"}}}isSubmitButton(e){let a=e.tagName.toLowerCase(),i=a===\"button\",n=a===\"primer-button\";return i&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||n&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitVaultPayment(){if(this.primerContext?.vaultManager)try{await this.primerContext?.vaultManager.startVaultedPaymentFlow()}catch(e){this.dispatchEvent(new CustomEvent(\"primer-vault-payment-error\",{detail:{error:e},bubbles:!0,composed:!0}))}}getPaymentMethodName(e){if(!this.primerContext?.vaultManager)return\"\";let a=this.primerContext?.vaultManager.vaultedPaymentMethods.find(i=>i.id===e);if(!a)return\"\";try{return Zn(a,this.primerContext?.telemetry).description||\"\"}catch{return\"\"}}setupContextEventListeners(){this.primerContext?.events?.host&&this._contextVaultSubmitListener&&this.primerContext?.events.host.addEventListener(\"primer:vault-submit\",this._contextVaultSubmitListener)}cleanupContextEventListeners(){this.primerContext?.events?.host&&this._contextVaultSubmitListener&&this.primerContext?.events.host.removeEventListener(\"primer:vault-submit\",this._contextVaultSubmitListener)}connectedCallback(){super.connectedCallback(),this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:vault-submit\",this.handleDirectSubmit),this._contextVaultSubmitListener=e=>{this.handleContextVaultSubmit(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:vault-submit\",this.handleDirectSubmit),this.cleanupContextEventListeners(),super.disconnectedCallback()}renderLoadingOverlay(){return p`<div class=\"loading-overlay\" ${Nt({...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 f;let e=this.getPaymentMethodName(this.deletePaymentMethodId);return p`<div class=\"delete-confirmation-container\"><primer-button disabled variant=\"secondary\"><primer-payment-method-content .assetConfig=${this.deleteAssetConfig} ></primer-payment-method-content></primer-button><primer-vault-delete-confirmation .isDeleting=${this.isDeleting} .paymentMethodId=${this.deletePaymentMethodId} .paymentMethodName=${e} @confirm-delete=${this.handleConfirmDelete} @cancel-delete=${this.handleCancelDelete} ${Nt({...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?f:p`<primer-vault-payment-method-item .paymentMethod=${e} .isEditMode=${this.isEditMode} @delete-payment-method=${this.handleDeletePaymentMethod} ${Nt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-payment-method-item>`}renderPaymentMethodList(){let e=this.primerContext?.vaultManager?.vaultedPaymentMethods||[],a=!this.isEditMode&&e.length>0&&!this.deletePaymentMethodId;return p`<div class=\"payment-methods-list\">${e.map(i=>this.renderPaymentMethodItem(i))} ${w(a,()=>p`<div class=\"submit-button-container\"><slot name=\"submit-button\" @slotchange=${this.handleSubmitSlotChange} ${Nt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></slot>${w(!this.hasSlottedSubmit,()=>p`<primer-vault-payment-submit class=\"submit-button\" @primer-vault-payment-error=${this.handlePaymentError} ></primer-vault-payment-submit>`)}</div>`,()=>f)}</div>`}render(){if(!this.primerContext?.vaultManager?.enabled||this.primerContext?.vaultManager?.headless)return f;let e=this.primerContext?.vaultManager.vaultedPaymentMethods.length>0,a=this.primerContext?.vaultManager.isLoading,i=this.primerContext?.vaultManager.isUpdating;return p` ${w(!this.primerContext?.vaultManager?.showEmptyState&&!e,()=>f,()=>p`<slot name=\"vault-empty-state\"><div class=\"vault-manager ${i?\"is-updating\":\"\"}\"><primer-vault-manager-header .isEditMode=${this.isEditMode} .hasPaymentMethods=${e} @toggle-edit-mode=${this.handleToggleEditMode} ></primer-vault-manager-header>${w(this.errorMessage,()=>p`<primer-vault-error-message .errorMessage=${this.errorMessage} @close-error=${this.handleCloseError} ${Nt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-error-message>`,()=>f)}<div class=\"vault-manager-content\">${w(!a&&!e,()=>p`<div class=\"content-container\"><primer-vault-empty-state ${Nt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-empty-state></div>`,()=>f)} ${w(!a&&e,()=>p`<div class=\"content-container\">${w(this.deletePaymentMethodId,()=>this.renderDeleteConfirmation(),()=>this.renderPaymentMethodList())}</div>`,()=>f)}</div>${w(i,()=>this.renderLoadingOverlay(),()=>f)}</div></slot>`)} `}}"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"kind": "variable",
|
|
218
|
+
"name": "Ne",
|
|
219
|
+
"default": "class extends b{constructor(){super(...arguments);this.paymentMethod=void 0;this.isEditMode=!1;this._getAssetsTask=new H(this,{task:async([e,a,i])=>await qa(e,a,i),args:()=>[this.paymentMethod,this.primerContext?.headlessUtils,this.primerContext?.vaultManager]});this.handleClick=()=>{this.isEditMode||!this.primerContext?.vaultManager||!this.paymentMethod||(this.isSelected()?this.primerContext?.vaultItem?.setSelectedVaultedPaymentMethod(null):this.primerContext?.vaultItem?.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.primerContext?.vaultManager||!this.paymentMethod)return!1;let e=this.primerContext?.vaultItem?.selectedVaultedPaymentMethod;return!!e&&e.id===this.paymentMethod.id}render(){return this._getAssetsTask.render({error:()=>f,complete:e=>{let a=this.isSelected()?\"checked\":\"default\",i=!1,n=e?.description;return p`<div class=\"payment-method-wrapper\"><div class=\"payment-method-container\"><primer-button variant=\"secondary\" class=\"payment-method-button ${e.shouldShowCVV?\"with-cvv\":\"\"}\" selectable ?disabled=${this.isEditMode} selectionState=${a} .flex=${i} @click=${this.handleClick} ><primer-payment-method-content .assetConfig=${e} ></primer-payment-method-content>${w(e.shouldShowCVV&&this.isSelected()&&!this.isEditMode,()=>p`<div class=\"payment-method-row mt-2\"><span class=\"flex-center\"><primer-icon name=\"lock\" size=\"sm\"></primer-icon><span class=\"payment-method-subtitle\"> Input the card CVV for a secure payment</span ></span><span class=\"cell-2\"><primer-vault-cvv-input .paymentMethod=\"${this.paymentMethod}\" ><span slot=\"label\"></span></primer-vault-cvv-input></span></div>`,()=>f)}</primer-button>${this.isEditMode?p`<primer-button variant=\"tertiary\" class=\"delete-button\" @click=${this.handleDeleteClick} aria-label=${`${T(\"delete\",{id:\"delete\"})} ${n}`} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:f}</div></div>`}})}}"
|
|
204
220
|
},
|
|
205
221
|
{
|
|
206
222
|
"kind": "variable",
|
|
207
223
|
"name": "Oe",
|
|
208
|
-
"default": "class extends
|
|
224
|
+
"default": "class extends b{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 p`<div class=\"vault-manager-header\"><h3>${T(\"previouslyUsed\",{id:\"previouslyUsed\"})}</h3>${this.hasPaymentMethods?p`<primer-button variant=\"tertiary\" class=\"edit-button ${this.isEditMode?\"active\":\"\"}\" @click=${this.toggleEditMode} aria-label=${this.isEditMode?T(\"confirm\",{id:\"confirm\"}):T(\"editPaymentMethods\",{id:\"editPaymentMethods\"})} >${this.isEditMode?p`<primer-icon name=\"checkmark\" size=\"sm\"></primer-icon>`:p`<primer-icon name=\"edit\" size=\"sm\"></primer-icon>`}</primer-button>`:f}</div>`}}"
|
|
209
225
|
},
|
|
210
226
|
{
|
|
211
227
|
"kind": "variable",
|
|
212
|
-
"name": "
|
|
213
|
-
"default": "class extends
|
|
228
|
+
"name": "we",
|
|
229
|
+
"default": "class extends b{constructor(){super(...arguments);this.isDeleting=!1;this.paymentMethodId=\"\";this.paymentMethodName=\"\";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 p`<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} >${T(\"cancel\",{id:\"cancel\"})}</primer-button><primer-button @click=${this.handleConfirmClick} ?disabled=${this.isDeleting} >${this.isDeleting?T(\"deleting\",{id:\"deleting\"}):T(\"confirmVaultedPaymentMethodDeletion\",{id:\"confirmVaultedPaymentMethodDeletion\"})}</primer-button></div></div>`}}"
|
|
214
230
|
},
|
|
215
231
|
{
|
|
216
232
|
"kind": "variable",
|
|
217
|
-
"name": "
|
|
218
|
-
"default": "class extends
|
|
233
|
+
"name": "lt",
|
|
234
|
+
"default": "class extends b{render(){return p`<div class=\"empty-state\"><p>${T(\"savedPaymentMethodsEmpty\",{id:\"savedPaymentMethodsEmpty\"})}</p></div>`}}"
|
|
219
235
|
},
|
|
220
236
|
{
|
|
221
237
|
"kind": "variable",
|
|
222
|
-
"name": "
|
|
223
|
-
"default": "class extends
|
|
238
|
+
"name": "Ze",
|
|
239
|
+
"default": "class extends b{constructor(){super(...arguments);this.errorMessage=\"\";this.handleDismiss=()=>{this.dispatchEvent(new CustomEvent(\"close-error\",{bubbles:!0,composed:!0}))}}render(){return p`<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=${T(\"closeErrorMessage\",{id:\"closeErrorMessage\"})} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></button></div>`}}"
|
|
224
240
|
},
|
|
225
241
|
{
|
|
226
242
|
"kind": "variable",
|
|
227
243
|
"name": "Ae",
|
|
228
|
-
"default": "class extends
|
|
244
|
+
"default": "class extends b{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.variant=\"primary\";this.disabled=!1;this.handleClick=async e=>{if(e.preventDefault(),!this.isButtonDisabled)try{await this.primerContext?.vaultManager?.startVaultedPaymentFlow()}catch(a){let i=new CustomEvent(\"primer-vault-payment-error\",{bubbles:!0,composed:!0,detail:{error:a}});this.dispatchEvent(i)}}}get buttonText(){return this._userAssignedProps.has(\"buttonText\")?this._internalButtonText:T(\"pay\",{id:\"pay\"})}set buttonText(e){let a=this.buttonText;e!==\"\"?(this._userAssignedProps.add(\"buttonText\"),this._internalButtonText=e):(this._userAssignedProps.delete(\"buttonText\"),this._internalButtonText=\"\"),this.requestUpdate(\"buttonText\",a)}get isButtonDisabled(){return!!(this.disabled||!this.primerContext?.vaultItem?.selectedVaultedPaymentMethod||this.primerContext?.vaultManager?.isLoading)}render(){let e=this.primerContext?.clientOptions?.submitButton?.amountVisible?this.primerContext?.headlessUtils?.getUIOrderAmount():null,a=e?` ${e}`:f;return p`<primer-button buttonType=\"submit\" variant=${this.variant} @click=${this.handleClick} .disabled=${this.isButtonDisabled} .loading=${Ct(this.primerContext?.sdkState)} data-submit >${this.buttonText}${a}</primer-button>`}}"
|
|
229
245
|
},
|
|
230
246
|
{
|
|
231
247
|
"kind": "variable",
|
|
232
248
|
"name": "ae",
|
|
233
|
-
"default": "class extends
|
|
249
|
+
"default": "class extends b{constructor(){super();this.paymentMethod=null;this.cvvError=null;this.cvvInputIsDirty=!1;this.cvvInputIsBlurred=!1;this.cvvInput=null;this.isFocused=!1;this._setupCVVIframe=new H(this,{task:([e,a])=>!e||!a||e.paymentMethodType!==\"PAYMENT_CARD\"||!e.paymentInstrumentData?.network||a.createCvvInput===null?V:{network:e.paymentInstrumentData.network,createCvvInput:a.createCvvInput},args:()=>[this.paymentMethod,this.primerContext?.vaultManager]});this.cvvContainerId=`cvv-container-${Math.random().toString(36).substring(2,9)}`,new H(this,{task:async([e])=>{if(!e)return V;await this.updateComplete;let a=this.renderRoot.querySelector(`#${this.cvvContainerId}`);if(!a)return;let i=$r(this.primerContext?.computedStyles??null),n=i?{input:{base:i}}:void 0,o={cardNetwork:e.network,container:a,name:\"cvv\",placeholder:\"123\",style:n,ariaLabel:T(\"CVV\",{id:\"cardCVV\"})};this.cvvInput=await e.createCvvInput?.(o)??null,this.cvvInput&&(this.cvvInput.focus(),this.cvvError=this.cvvInput.metadata.errorCode||null,this.primerContext?.vaultItem?.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.primerContext?.vaultItem?.setCvvInput(null))}onCvvInputChange(){!this.cvvInput||!this.primerContext?.vaultItem||(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:()=>f,complete:()=>p`<div class=\"cvv-input-container\"><primer-input-wrapper .focusWithin=${this.isFocused} .hasError=${!!this.cvvError&&(this.primerContext?.vaultItem?.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>${w(this.cvvError&&(this.primerContext?.vaultItem?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred),()=>p`<primer-input-error slot=\"error\">${T(this.cvvError,{id:this.cvvError})}</primer-input-error>`)}</primer-input-wrapper></div>`})}}"
|
|
234
250
|
},
|
|
235
251
|
{
|
|
236
252
|
"kind": "variable",
|
|
237
|
-
"name": "
|
|
238
|
-
"default": "class extends
|
|
253
|
+
"name": "We",
|
|
254
|
+
"default": "class extends b{constructor(){super(...arguments);this.assetConfig=null}render(){if(!this.assetConfig)return f;let e=this.assetConfig.description,a=this.assetConfig.icon,i=w(this.assetConfig.icon,()=>p`<img class=\"payment-method-icon\" src=${a} alt=${e} />`,()=>p`<div class=\"payment-method-icon payment-method-icon-generic\"><primer-icon name=\"payment-card\" size=\"sm\"></primer-icon></div>`);return this.assetConfig.type===\"paypal\"?p`<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\">${i}<span class=\"payment-method-subtitle\" >${this.assetConfig.paymentMethodType}</span ></span></div></span>`:this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType!==\"ACH\"?p`<div class=\"payment-method-card-other\"><div class=\"left-column\"><div class=\"payment-method-header\">${this.assetConfig.fullName}</div><div class=\"flex\">${i}<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\"?p`<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\">${i}<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\"?p`<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\">${i}<span class=\"payment-method-subtitle\" >${this.assetConfig.network}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.expiresDate}</span ></div></span>`:this.assetConfig.type===\"GOOGLE_PAY\"?p`<span class=\"payment-method-card\"><div class=\"payment-method-row\">${i}<span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"payment-method-subtitle\" >${this.assetConfig.network}</span ><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.expiresDate}</span ></div></span>`:f}}"
|
|
239
255
|
},
|
|
240
256
|
{
|
|
241
257
|
"kind": "variable",
|
|
242
|
-
"name": "
|
|
243
|
-
"default": "class extends
|
|
258
|
+
"name": "Me",
|
|
259
|
+
"default": "class extends b{constructor(){super(...arguments);this.hideLabels=!1;this.disabled=!1;this.hasAssignedContent=!1;this.selectedCardNetwork=null;this.formErrorMessage=null;this.paymentMethodSelectionSent=!1;this.cardFormProvider=new bt(this,{context:hr,initialValue:null});this.eventsController=new rr(this);this._contextCardSubmitListener=null;this._isHandlingContextEvent=!1;this.inputControllers=new Map;this.setupCardFormTask=new H(this,{task:([e])=>{let a=e?.find(l=>l.type===k.PAYMENT_CARD)?.manager;if(!a)return V;let i=a.createHostedInputs(),{cardNumberInput:n,expiryInput:o,cvvInput:s}=i;return this.cardFormProvider.setValue({cardholderNameInput:i.cardholderNameInput,cardNumberInput:n,expiryInput:o,cvvInput:s,setCardholderName:l=>{a.setCardholderName(l),this.shouldRequireCardholderName&&a.validate?.().then(c=>{let m=c?.validationErrors?.find(E=>E.name===Ic.cardholderName),g=this.inputControllers.get(\"cardholderName\");g&&g.updateMetaFromValidation({valid:!1,error:m?.message||m?.error||null,errorCode:m?.message||m?.error||null})})},setCardNetwork:l=>{this.selectedCardNetwork=l},validate:()=>a.validate(),submit:l=>a.submit(l),hideLabels:this.hideLabels,disabled:this.disabled,setSubmissionState:l=>{this.inputControllers.forEach(c=>{c.setSubmitted(l)})},propagateValidationErrors:l=>{l&&l.forEach(c=>{let u=c.field||c.name,m=c.message||c.error,g=Ic[u];if(g){let E=this.inputControllers.get(g);if(E){let A={valid:!1,error:m,errorCode:m};E.updateMetaFromValidation(A)}}})},registerInputController:(l,c)=>{this.inputControllers.set(l,c)},unregisterInputController:l=>{this.inputControllers.delete(l)},onUserInteraction:()=>{this.sendPaymentMethodSelectionEvent(),this.checkAndSendPaymentDetailsEnteredEvent()}}),!0},args:()=>[this.primerContext?.paymentMethods]});this.paymentDetailsEnteredSent=!1;this.handleSlotButtonClick=e=>{let i=e.target.closest(\"button, primer-button\");if(!i)return;let n=i;this.isSubmitButton(n)&&(e.preventDefault(),this.submitCardPayment())};this.handleDirectSubmit=e=>{e.stopPropagation(),this.submitCardPayment()};this.handleContextCardSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitCardPayment())}finally{this._isHandlingContextEvent=!1}}};this.onSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=i.length>0};this.handleFormSubmit=e=>{e.preventDefault(),e.stopPropagation(),this.submitCardPayment()}}updated(e){if(super.updated(e),(e.has(\"hideLabels\")||e.has(\"disabled\"))&&this.cardFormProvider.value&&this.cardFormProvider.setValue({...this.cardFormProvider.value,hideLabels:this.hideLabels,disabled:this.disabled}),e.has(\"context\")){let i=e.get(\"context\")?.events??null;i?.host&&this._contextCardSubmitListener&&i.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener),this.setupContextEventListeners()}}get shouldShowCardholderName(){let e=this.primerContext?.clientOptions?.card?.cardholderName;return typeof e?.visible==\"boolean\"?e.visible:!0}get shouldRequireCardholderName(){if(!this.shouldShowCardholderName)return!1;let e=this.primerContext?.clientOptions?.card?.cardholderName;return typeof e?.required==\"boolean\"?e.required:!0}sendPaymentMethodSelectionEvent(){this.paymentMethodSelectionSent||(this.paymentMethodSelectionSent=!0,this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:\"PAYMENT_CARD\"}))}checkAndSendPaymentDetailsEnteredEvent(){if(this.paymentDetailsEnteredSent)return;let e=this.inputControllers.get(\"cardNumber\"),a=this.inputControllers.get(\"expire\"),i=this.inputControllers.get(\"cvv\"),n=e?.meta?.dirty===!0,o=a?.meta?.dirty===!0,s=i?.meta?.dirty===!0,l=!0;this.shouldRequireCardholderName&&(l=this.inputControllers.get(\"cardholderName\")?.meta?.dirty===!0),n&&o&&s&&l&&(this.sendPaymentDetailsEnteredEvent(),this.paymentDetailsEnteredSent=!0)}sendPaymentDetailsEnteredEvent(){this.primerContext?.telemetry?.analytics.sendEvent({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.primerContext?.events?.host&&this._contextCardSubmitListener&&this.primerContext?.events.host.addEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}cleanupContextEventListeners(){this.primerContext?.events?.host&&this._contextCardSubmitListener&&this.primerContext?.events.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}isSubmitButton(e){let a=e.tagName.toLowerCase(),i=a===\"button\",n=a===\"primer-button\";return i&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||n&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitCardPayment(){let e=this.cardFormProvider.value,a=this.primerContext?.sdkState.isProcessing;if(!e||this.disabled||a)return;this.formErrorMessage=null,e.setSubmissionState?.(!0);let i=this.querySelector(\"primer-billing-address\")||this.renderRoot.querySelector(\"primer-billing-address\"),n=!0;i&&(n=await i.validateForSubmission());let o=await e.validate?.();if(o?.valid&&n){if(i&&!await i.submitToSDK()){let u=T(\"tokenizationError\",{id:\"tokenizationError\"});this.formErrorMessage=u,this.eventsController.dispatchFormSubmitErrors([{field:\"billingAddress\",name:\"billingAddress\",error:\"BILLING_ADDRESS_SUBMISSION_FAILED\",message:u}]);return}let s={success:!0};this.eventsController.dispatchFormSubmitSuccess(s);let l=this.selectedCardNetwork?{cardNetwork:this.selectedCardNetwork}:void 0;await e.submit?.(l)}else{let s=o?.validationErrors;e.propagateValidationErrors?.(s||[]),this.cardFormProvider.setValue({...e,errors:s}),this.eventsController.dispatchFormSubmitErrors(s)}}render(){return this.setupCardFormTask.status===At.ERROR||this.setupCardFormTask.status===At.INITIAL?f:p`<form @submit=${this.handleFormSubmit}><slot name=\"card-form-content\" @slotchange=${this.onSlotChange}></slot>${this.setupCardFormTask.render({complete:()=>w(this.hasAssignedContent,()=>f,()=>p`<div class=\"card-form\"><primer-input-card-number></primer-input-card-number><div class=\"card-form-row\"><primer-input-card-expiry></primer-input-card-expiry><primer-input-cvv></primer-input-cvv></div>${w(this.shouldShowCardholderName,()=>p`<primer-input-card-holder-name></primer-input-card-holder-name>`,()=>f)}<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>`}}"
|
|
244
260
|
},
|
|
245
261
|
{
|
|
246
262
|
"kind": "variable",
|
|
247
|
-
"name": "
|
|
248
|
-
"default": "class extends
|
|
263
|
+
"name": "dt",
|
|
264
|
+
"default": "class extends le{constructor(){super();this.config={inputType:\"cardNumber\",containerSelector:\"#cardNumber\",errorName:\"cardNumber-card\",translations:{label:{id:\"cardNumber\",defaultMessage:\"Card Number\"},placeholder:\"4111 1111 1111 1111\",ariaLabel:{id:\"cardNumber\",defaultMessage:\"Card Number\"}}};this.handleNetworkSelected=e=>{let{network:a}=e.detail;this.cardFormContext&&this.cardFormContext.setCardNetwork(a)};this.childUpdated()}renderInput(){if(this.hostedInputController.setupTask.status===At.ERROR)return f;let e=this.getError();return p`<primer-input-wrapper .focusWithin=\"${this.hostedInputController.meta.active}\" .hasError=${!!e} >${w(!this.cardFormContext?.hideLabels,()=>p`<primer-input-label slot=\"label\" >${this.label}</primer-input-label >`,()=>f)}<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>${w(e,a=>p`<primer-input-error slot=\"error\">${T(a,{id:a})}</primer-input-error>`,()=>f)}</primer-input-wrapper>`}render(){return this.renderInput()}}"
|
|
249
265
|
},
|
|
250
266
|
{
|
|
251
267
|
"kind": "variable",
|
|
252
|
-
"name": "
|
|
253
|
-
"default": "class extends
|
|
268
|
+
"name": "ct",
|
|
269
|
+
"default": "class extends le{constructor(){super();this.config={inputType:\"cvv\",containerSelector:\"#cvv\",errorName:\"cvv-card\",translations:{label:\"CVV\",placeholder:\"123\"}};this.childUpdated()}render(){return this.renderInput()}}"
|
|
254
270
|
},
|
|
255
271
|
{
|
|
256
272
|
"kind": "variable",
|
|
257
|
-
"name": "
|
|
258
|
-
"default": "class extends
|
|
273
|
+
"name": "ut",
|
|
274
|
+
"default": "class extends le{constructor(){super();this.config={inputType:\"expire\",containerSelector:\"#expiry\",errorName:\"expiryDate-card\",translations:{label:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"},placeholder:{id:\"cardExpiryPlaceholder\",defaultMessage:\"MM/YY\"},ariaLabel:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"}}};this.childUpdated()}render(){return this.renderInput()}}"
|
|
259
275
|
},
|
|
260
276
|
{
|
|
261
277
|
"kind": "variable",
|
|
262
|
-
"name": "
|
|
263
|
-
"default": "class extends
|
|
278
|
+
"name": "pt",
|
|
279
|
+
"default": "class extends le{constructor(){super();this.config={inputType:\"cardholderName\",containerSelector:\"#cardFormName\",errorName:\"cardholderName\",translations:{label:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"},placeholder:{id:\"cardholderNamePlaceholder\",defaultMessage:\"Name on card\"},ariaLabel:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"}},onInput:e=>this.handleInput(e)};this.childUpdated()}handleInput(e){this.cardFormContext?.setCardholderName?.(e)}render(){return this.renderInput()}}"
|
|
264
280
|
},
|
|
265
281
|
{
|
|
266
282
|
"kind": "variable",
|
|
267
|
-
"name": "
|
|
268
|
-
"default": "class extends
|
|
283
|
+
"name": "me",
|
|
284
|
+
"default": "class extends b{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.cardFormContext=null;this.variant=\"primary\";this.disabled=!1;this.handleClick=e=>{if(e.preventDefault(),this.disabled)return;this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_SUBMITTED\",paymentMethod:\"PAYMENT_CARD\"});let a=new CustomEvent(\"primer:card-submit\",{bubbles:!0,composed:!0,detail:{source:\"primer-card-form-submit\"}});this.dispatchEvent(a)}}get buttonText(){return this._userAssignedProps.has(\"buttonText\")?this._internalButtonText:T(\"pay\",{id:\"pay\"})}set buttonText(e){let a=this.buttonText;e!==\"\"?(this._userAssignedProps.add(\"buttonText\"),this._internalButtonText=e):(this._userAssignedProps.delete(\"buttonText\"),this._internalButtonText=\"\"),this.requestUpdate(\"buttonText\",a)}get submitButtonConfig(){return this.primerContext?.clientOptions?.submitButton??null}get shouldShowBuiltInButton(){return this.submitButtonConfig?.useBuiltInButton??!0}render(){if(!this.shouldShowBuiltInButton)return f;let e=this.submitButtonConfig?.amountVisible?this.primerContext?.headlessUtils?.getUIOrderAmount():null,a=e?` ${e}`:f,i=this.disabled||this.cardFormContext?.disabled||!1;return p`<primer-button type=\"submit\" variant=${this.variant} ?disabled=${i} @click=${this.handleClick} .loading=${Ct(this.primerContext?.sdkState)} data-submit >${this.buttonText}${a}</primer-button>`}}"
|
|
269
285
|
},
|
|
270
286
|
{
|
|
271
287
|
"kind": "variable",
|
|
272
|
-
"name": "
|
|
273
|
-
"default": "class extends
|
|
288
|
+
"name": "he",
|
|
289
|
+
"default": "class extends b{constructor(){super(...arguments);this.selectedCardNetwork=null;this.isDropdownOpen=!1;this.focusedNetworkIndex=0;this.isKeyboardNavigation=!1;this.buttonRef=Hr();this.dropdownRef=Hr();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.primerContext?.headlessUtils?.getCardNetworkAsset(e.network)?.cardUrl}renderDefaultCardIcon(){return p`<div class=\"network-icon\">${Za[\"payment-card\"]}</div>`}getSelectableNetworks(){return this.primerContext?.cardNetworks?.selectableCardNetworks||[]}getDetectedNetwork(){return this.selectedCardNetwork??(this.primerContext?.cardNetworks?.detectedCardNetwork||null)}getSelectedNetworkIndex(){let e=this.getDetectedNetwork();if(!e)return 0;let a=this.getSelectableNetworks().findIndex(i=>i.network===e.network);return a>=0?a:0}selectNetwork(e,a){e.stopPropagation(),this.selectedCardNetwork=a,this.isDropdownOpen=!1,this.buttonRef.value?.focus(),this.primerContext?.cardNetworks&&this.dispatchEvent(new CustomEvent(\"network-selected\",{detail:{network:a.network},bubbles:!0,composed:!0}))}focusNetworkOption(){requestAnimationFrame(()=>{this.networkOptionRefs[this.focusedNetworkIndex]&&this.networkOptionRefs[this.focusedNetworkIndex].focus()})}setNetworkOptionRef(e,a){this.networkOptionRefs[a]=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.primerContext?.cardNetworks?.isLoading)return p`<primer-spinner size=\"small\" compact></primer-spinner>`;let e=this.getSelectableNetworks();if(!this.getDetectedNetwork()&&e.length===0)return this.renderDefaultCardIcon();let a=this.getDetectedNetwork()||(e.length>0?e[0]:null);if(!a)return this.renderDefaultCardIcon();let i=e.length>1;return i&&!nu(e.map(o=>o.network))?p`<div class=\"network-selector-inline\">${e.map(o=>p`<div class=\"network-icon-container\"><img class=\"network-icon\" src=${this.getNetworkIconUrl(o)??\"\"} alt=${o.displayName} /></div>`)}</div>`:p`<button ${pr(this.buttonRef)} class=\"network-selector ${i?\"\":\"static\"}\" tabindex=${i?\"0\":\"-1\"} @click=${this.toggleDropdown} @keydown=${o=>{(o.key===\" \"||o.key===\"Enter\")&&i&&(o.preventDefault(),this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&(this.focusedNetworkIndex=this.getSelectedNetworkIndex()))}} aria-label=${i?`Selected card network: ${a.displayName}. Click to change.`:`Card network: ${a.displayName}`} aria-expanded=${i?this.isDropdownOpen:f} aria-haspopup=${i?\"true\":f} aria-controls=${i?\"network-dropdown\":f} ><img class=\"network-icon\" src=${this.getNetworkIconUrl(a)} alt=${a.displayName} />${w(i,()=>p`<primer-icon class=\"caret ${this.isDropdownOpen?\"open\":\"\"}\" size=\"sm\" name=\"chevron-down\" ></primer-icon>`,()=>f)}</button>${w(this.isDropdownOpen,()=>p`<div ${pr(this.dropdownRef)} id=\"network-dropdown\" class=\"dropdown open\" role=\"listbox\" aria-label=\"Select card network\" >${e.map((o,s)=>p`<div ${pr(l=>this.setNetworkOptionRef(l,s))} class=\"network-option ${this.isKeyboardNavigation&&s===this.focusedNetworkIndex?\"focused\":\"\"}\" @click=${l=>this.selectNetwork(l,o)} @keydown=${l=>{(l.key===\"Enter\"||l.key===\" \")&&this.selectNetwork(l,o)}} role=\"option\" aria-selected=${o.network===a.network} tabindex=\"${s===this.focusedNetworkIndex?\"0\":\"-1\"}\" ><img class=\"network-option-icon\" src=${this.getNetworkIconUrl(o)} alt=${o.displayName} /><span class=\"network-name\">${o.displayName}</span>${w(o.network===a.network,()=>p`<primer-icon class=\"checkmark\" name=\"checkmark\" size=\"sm\" ></primer-icon>`,()=>f)}</div>`)}</div>`,()=>f)} `}}"
|
|
274
290
|
},
|
|
275
291
|
{
|
|
276
292
|
"kind": "variable",
|
|
277
|
-
"name": "
|
|
278
|
-
"default": "class extends
|
|
293
|
+
"name": "Ge",
|
|
294
|
+
"default": "class extends b{constructor(){super(...arguments);this.hasSlottedToggle=!1;this.isExpanded=!1;this._isHandlingContextEvent=!1;this._contextToggleListener=null;this.handleToggleSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasSlottedToggle=i.length>0};this.handleSlotButtonClick=e=>{let i=e.target.closest(\"button, primer-button\");if(!i)return;let n=i;this.isToggleButton(n)&&(e.preventDefault(),this.toggleAccordion())};this.handleDirectToggle=e=>{let a=e.detail?.action;a===\"expand\"?this.expand():a===\"collapse\"?this.collapse():this.toggleAccordion()};this.handleContextToggle=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{if(e.target!==this){e.stopPropagation();let a=e.detail?.action;a===\"expand\"?this.expand():a===\"collapse\"?this.collapse():this.toggleAccordion()}}finally{this._isHandlingContextEvent=!1}}}}isToggleButton(e){let a=this.shadowRoot?.querySelector('slot[name=\"show-other-payments-toggle-button\"]');return a?a.assignedElements({flatten:!0}).some(n=>n===e||n.contains(e)):!1}toggleAccordion(){this.hasSlottedToggle?(this.isExpanded=!this.isExpanded,this.dispatchExpandedEvent(this.isExpanded)):this.collapsableElement&&(this.collapsableElement.isExpanded?this.collapsableElement.collapse():this.collapsableElement.expand())}dispatchExpandedEvent(e){this.dispatchEvent(new CustomEvent(\"primer:show-other-payments-toggled\",{bubbles:!0,composed:!0,detail:{expanded:e}}))}expand(){this.hasSlottedToggle?this.isExpanded||(this.isExpanded=!0,this.dispatchExpandedEvent(!0)):this.collapsableElement?.expand()}collapse(){this.hasSlottedToggle?this.isExpanded&&(this.isExpanded=!1,this.dispatchExpandedEvent(!1)):this.collapsableElement?.collapse()}setupContextEventListeners(){this.primerContext?.events?.host&&this._contextToggleListener&&this.primerContext?.events.host.addEventListener(\"primer:show-other-payments-toggle\",this._contextToggleListener)}cleanupContextEventListeners(){this.primerContext?.events?.host&&this._contextToggleListener&&this.primerContext?.events.host.removeEventListener(\"primer:show-other-payments-toggle\",this._contextToggleListener)}connectedCallback(){super.connectedCallback(),this.isExpanded=this.primerContext?.vaultManager?.vaultedPaymentMethods.length===0,this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:show-other-payments-toggle\",this.handleDirectToggle),this._contextToggleListener=e=>{this.handleContextToggle(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:show-other-payments-toggle\",this.handleDirectToggle),this.cleanupContextEventListeners(),super.disconnectedCallback()}render(){if(this.primerContext?.vaultManager?.isLoading)return f;let e=this.primerContext?.vaultManager?.showEmptyState||this.primerContext?.vaultManager?.vaultedPaymentMethods.length;return!this.primerContext?.vaultManager||!this.primerContext?.vaultManager.enabled||this.primerContext?.vaultManager.headless||!e?p`<slot name=\"other-payments\"></slot>`:p`<div class=\"other-payment-methods-container\"><slot name=\"show-other-payments-toggle-button\" @slotchange=${this.handleToggleSlotChange} ></slot>${w(!this.hasSlottedToggle,()=>p`<primer-collapsable buttonVariant=\"secondary\" .expanded=\"${this.primerContext?.vaultManager?.vaultedPaymentMethods.length===0}\" .header=\"${T(\"navigateToPaymentMethods\",{id:\"navigateToPaymentMethods\"})}\" ><div class=\"other-payment-methods-content\"><slot name=\"other-payments\"></slot></div></primer-collapsable>`,()=>p`<div class=\"collapsable-wrapper ${this.isExpanded?\"expanded\":\"\"}\" role=\"region\" aria-labelledby=\"custom-toggle-button\" ><div class=\"collapsable-content\"><div class=\"other-payment-methods-content\"><slot name=\"other-payments\"></slot></div></div></div>`)}</div>`}}"
|
|
279
295
|
},
|
|
280
296
|
{
|
|
281
297
|
"kind": "variable",
|
|
282
|
-
"name": "
|
|
283
|
-
"default": "class extends
|
|
298
|
+
"name": "Le",
|
|
299
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.expanded=!1;this.suppressBlurCollapse=!1;this.loading=!1;this._handleDocumentClick=e=>{this.expanded&&(this.suppressBlurCollapse||this.loading||e.composedPath().includes(this)||this._collapseFromOutsideInteraction())};this._handleWindowBlur=()=>{!this.expanded||this.suppressBlurCollapse||this.loading||setTimeout(()=>{document.hasFocus()&&this._collapseFromOutsideInteraction()},100)}}connectedCallback(){super.connectedCallback(),document.addEventListener(\"click\",this._handleDocumentClick),window.addEventListener(\"blur\",this._handleWindowBlur)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"click\",this._handleDocumentClick),window.removeEventListener(\"blur\",this._handleWindowBlur)}_collapseFromOutsideInteraction(){this.expanded&&(this.expanded=!1,this.dispatchEvent(new CustomEvent(\"expanded-change\",{detail:{expanded:!1},bubbles:!0,composed:!0})))}_handleButtonClick(){this.disabled||this.loading||(this.expanded=!this.expanded,this.dispatchEvent(new CustomEvent(\"expanded-change\",{detail:{expanded:this.expanded},bubbles:!0,composed:!0})))}render(){return p`<div class=\"container ${this.expanded?\"expanded\":\"\"}\"><primer-payment-method-button .type=${this.type} ?disabled=${this.disabled||this.loading} @payment-method-click=${()=>this._handleButtonClick()} ></primer-payment-method-button><div class=\"expanded-content\"><div class=\"content-wrapper\"><slot></slot></div></div></div>`}}"
|
|
284
300
|
},
|
|
285
301
|
{
|
|
286
302
|
"kind": "variable",
|
|
287
|
-
"name": "
|
|
288
|
-
"default": "class extends
|
|
303
|
+
"name": "mt",
|
|
304
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.loading=!1}render(){return p`<button class=${W({loading:this.loading})} ?disabled=${this.disabled||this.loading} @click=${()=>this.dispatchEvent(new Event(\"confirm\",{bubbles:!0,composed:!0}))} >${this.loading?p`<primer-spinner size=\"small\" compact></primer-spinner>`:T(\"confirm\",{id:\"confirm\"})}</button>`}}"
|
|
289
305
|
},
|
|
290
306
|
{
|
|
291
307
|
"kind": "variable",
|
|
292
|
-
"name": "
|
|
293
|
-
"default": "class extends
|
|
308
|
+
"name": "yr",
|
|
309
|
+
"default": "class extends b{render(){return p`<primer-checkout-state type=\"complete\"></primer-checkout-state>`}}"
|
|
294
310
|
},
|
|
295
311
|
{
|
|
296
312
|
"kind": "variable",
|
|
297
|
-
"name": "
|
|
298
|
-
"default": "class extends
|
|
313
|
+
"name": "Zt",
|
|
314
|
+
"default": "class extends b{render(){return p`<primer-checkout-state type=\"failure\" description=${this.primerContext?.sdkState?.primerJsError?.message||\"\"} ></primer-checkout-state>`}}"
|
|
299
315
|
},
|
|
300
316
|
{
|
|
301
317
|
"kind": "variable",
|
|
302
|
-
"name": "
|
|
303
|
-
"default": "class extends
|
|
318
|
+
"name": "ht",
|
|
319
|
+
"default": "class extends b{constructor(){super(...arguments);this.showProcessingErrors=!0}get shouldShowError(){return!this.primerContext?.sdkState||this.primerContext.sdkState.isProcessing?!1:!!(this.primerContext.sdkState.paymentFailure&&this.showProcessingErrors)}render(){return this.primerContext?.sdkState?p`<primer-error-message message=\"${T(this.primerContext.sdkState.paymentFailure?.message??\"\",{id:\"tokenizationError\"})}\" ?visible=\"${this.shouldShowError}\" ></primer-error-message>`:f}}"
|
|
304
320
|
},
|
|
305
321
|
{
|
|
306
322
|
"kind": "variable",
|
|
307
|
-
"name": "
|
|
308
|
-
"default": "class extends
|
|
323
|
+
"name": "Bt",
|
|
324
|
+
"default": "class extends b{constructor(){super(...arguments);this.hasAssignedContent=!1;this.onSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=i.length>0,this.requestUpdate()}}render(){return this.primerContext?.sdkState?.isLoading?f:this.primerContext?.sdkState?.isSuccessful?p`<slot name=\"checkout-complete\"><primer-checkout-complete></primer-checkout-complete></slot>`:p`<slot name=\"payments\" @slotchange=${this.onSlotChange}></slot>${w(this.hasAssignedContent,()=>f,()=>p`<div class=${W({\"primer-is-processing\":!!this.primerContext?.sdkState?.isProcessing})} ><primer-vault-manager></primer-vault-manager><primer-show-other-payments><div slot=\"other-payments\" class=\"primer-main-list\">${this.primerContext?.paymentMethods?.map(e=>p`<primer-payment-method type=${e.type} ?disabled=${this.primerContext?.clientOptions?.disabledPayments===!0} ></primer-payment-method>`)}</div></primer-show-other-payments><primer-error-message-container></primer-error-message-container></div>`)} `}}"
|
|
309
325
|
},
|
|
310
326
|
{
|
|
311
327
|
"kind": "function",
|
|
312
|
-
"name": "
|
|
328
|
+
"name": "tB"
|
|
313
329
|
}
|
|
314
330
|
],
|
|
315
331
|
"exports": [
|
|
316
332
|
{
|
|
317
333
|
"kind": "custom-element-definition",
|
|
318
|
-
"name": "
|
|
334
|
+
"name": "r",
|
|
319
335
|
"declaration": {
|
|
320
336
|
"name": "t",
|
|
321
337
|
"module": "dist/primer-loader.js"
|
|
@@ -323,7 +339,7 @@
|
|
|
323
339
|
},
|
|
324
340
|
{
|
|
325
341
|
"kind": "custom-element-definition",
|
|
326
|
-
"name": "
|
|
342
|
+
"name": "r",
|
|
327
343
|
"declaration": {
|
|
328
344
|
"name": "t",
|
|
329
345
|
"module": "dist/primer-loader.js"
|
|
@@ -333,7 +349,7 @@
|
|
|
333
349
|
"kind": "js",
|
|
334
350
|
"name": "AdyenMbway",
|
|
335
351
|
"declaration": {
|
|
336
|
-
"name": "
|
|
352
|
+
"name": "Ie",
|
|
337
353
|
"module": "dist/primer-loader.js"
|
|
338
354
|
}
|
|
339
355
|
},
|
|
@@ -341,7 +357,7 @@
|
|
|
341
357
|
"kind": "js",
|
|
342
358
|
"name": "BillingAddress",
|
|
343
359
|
"declaration": {
|
|
344
|
-
"name": "
|
|
360
|
+
"name": "oe",
|
|
345
361
|
"module": "dist/primer-loader.js"
|
|
346
362
|
}
|
|
347
363
|
},
|
|
@@ -349,7 +365,7 @@
|
|
|
349
365
|
"kind": "js",
|
|
350
366
|
"name": "Blik",
|
|
351
367
|
"declaration": {
|
|
352
|
-
"name": "
|
|
368
|
+
"name": "Se",
|
|
353
369
|
"module": "dist/primer-loader.js"
|
|
354
370
|
}
|
|
355
371
|
},
|
|
@@ -357,7 +373,7 @@
|
|
|
357
373
|
"kind": "js",
|
|
358
374
|
"name": "Button",
|
|
359
375
|
"declaration": {
|
|
360
|
-
"name": "
|
|
376
|
+
"name": "ue",
|
|
361
377
|
"module": "dist/primer-loader.js"
|
|
362
378
|
}
|
|
363
379
|
},
|
|
@@ -365,7 +381,7 @@
|
|
|
365
381
|
"kind": "js",
|
|
366
382
|
"name": "CardForm",
|
|
367
383
|
"declaration": {
|
|
368
|
-
"name": "
|
|
384
|
+
"name": "Me",
|
|
369
385
|
"module": "dist/primer-loader.js"
|
|
370
386
|
}
|
|
371
387
|
},
|
|
@@ -373,7 +389,7 @@
|
|
|
373
389
|
"kind": "js",
|
|
374
390
|
"name": "CardFormCVV",
|
|
375
391
|
"declaration": {
|
|
376
|
-
"name": "
|
|
392
|
+
"name": "ct",
|
|
377
393
|
"module": "dist/primer-loader.js"
|
|
378
394
|
}
|
|
379
395
|
},
|
|
@@ -381,7 +397,7 @@
|
|
|
381
397
|
"kind": "js",
|
|
382
398
|
"name": "CardFormCardNetworkSelector",
|
|
383
399
|
"declaration": {
|
|
384
|
-
"name": "
|
|
400
|
+
"name": "he",
|
|
385
401
|
"module": "dist/primer-loader.js"
|
|
386
402
|
}
|
|
387
403
|
},
|
|
@@ -389,7 +405,7 @@
|
|
|
389
405
|
"kind": "js",
|
|
390
406
|
"name": "CardFormCardNumber",
|
|
391
407
|
"declaration": {
|
|
392
|
-
"name": "
|
|
408
|
+
"name": "dt",
|
|
393
409
|
"module": "dist/primer-loader.js"
|
|
394
410
|
}
|
|
395
411
|
},
|
|
@@ -397,7 +413,7 @@
|
|
|
397
413
|
"kind": "js",
|
|
398
414
|
"name": "CardFormError",
|
|
399
415
|
"declaration": {
|
|
400
|
-
"name": "
|
|
416
|
+
"name": "nt",
|
|
401
417
|
"module": "dist/primer-loader.js"
|
|
402
418
|
}
|
|
403
419
|
},
|
|
@@ -405,7 +421,7 @@
|
|
|
405
421
|
"kind": "js",
|
|
406
422
|
"name": "CardFormExpiry",
|
|
407
423
|
"declaration": {
|
|
408
|
-
"name": "
|
|
424
|
+
"name": "ut",
|
|
409
425
|
"module": "dist/primer-loader.js"
|
|
410
426
|
}
|
|
411
427
|
},
|
|
@@ -413,7 +429,7 @@
|
|
|
413
429
|
"kind": "js",
|
|
414
430
|
"name": "CardFormName",
|
|
415
431
|
"declaration": {
|
|
416
|
-
"name": "
|
|
432
|
+
"name": "pt",
|
|
417
433
|
"module": "dist/primer-loader.js"
|
|
418
434
|
}
|
|
419
435
|
},
|
|
@@ -421,7 +437,7 @@
|
|
|
421
437
|
"kind": "js",
|
|
422
438
|
"name": "CardFormSubmit",
|
|
423
439
|
"declaration": {
|
|
424
|
-
"name": "
|
|
440
|
+
"name": "me",
|
|
425
441
|
"module": "dist/primer-loader.js"
|
|
426
442
|
}
|
|
427
443
|
},
|
|
@@ -429,7 +445,7 @@
|
|
|
429
445
|
"kind": "js",
|
|
430
446
|
"name": "Collapsable",
|
|
431
447
|
"declaration": {
|
|
432
|
-
"name": "
|
|
448
|
+
"name": "pe",
|
|
433
449
|
"module": "dist/primer-loader.js"
|
|
434
450
|
}
|
|
435
451
|
},
|
|
@@ -437,7 +453,7 @@
|
|
|
437
453
|
"kind": "js",
|
|
438
454
|
"name": "Dialog",
|
|
439
455
|
"declaration": {
|
|
440
|
-
"name": "
|
|
456
|
+
"name": "xe",
|
|
441
457
|
"module": "dist/primer-loader.js"
|
|
442
458
|
}
|
|
443
459
|
},
|
|
@@ -445,7 +461,7 @@
|
|
|
445
461
|
"kind": "js",
|
|
446
462
|
"name": "ErrorMessage",
|
|
447
463
|
"declaration": {
|
|
448
|
-
"name": "
|
|
464
|
+
"name": "ze",
|
|
449
465
|
"module": "dist/primer-loader.js"
|
|
450
466
|
}
|
|
451
467
|
},
|
|
@@ -453,7 +469,7 @@
|
|
|
453
469
|
"kind": "js",
|
|
454
470
|
"name": "ErrorMessageContainer",
|
|
455
471
|
"declaration": {
|
|
456
|
-
"name": "
|
|
472
|
+
"name": "ht",
|
|
457
473
|
"module": "dist/primer-loader.js"
|
|
458
474
|
}
|
|
459
475
|
},
|
|
@@ -461,7 +477,7 @@
|
|
|
461
477
|
"kind": "js",
|
|
462
478
|
"name": "Input",
|
|
463
479
|
"declaration": {
|
|
464
|
-
"name": "
|
|
480
|
+
"name": "$",
|
|
465
481
|
"module": "dist/primer-loader.js"
|
|
466
482
|
}
|
|
467
483
|
},
|
|
@@ -469,7 +485,7 @@
|
|
|
469
485
|
"kind": "js",
|
|
470
486
|
"name": "InputLabel",
|
|
471
487
|
"declaration": {
|
|
472
|
-
"name": "
|
|
488
|
+
"name": "it",
|
|
473
489
|
"module": "dist/primer-loader.js"
|
|
474
490
|
}
|
|
475
491
|
},
|
|
@@ -477,7 +493,7 @@
|
|
|
477
493
|
"kind": "js",
|
|
478
494
|
"name": "InputWrapper",
|
|
479
495
|
"declaration": {
|
|
480
|
-
"name": "
|
|
496
|
+
"name": "$e",
|
|
481
497
|
"module": "dist/primer-loader.js"
|
|
482
498
|
}
|
|
483
499
|
},
|
|
@@ -485,7 +501,7 @@
|
|
|
485
501
|
"kind": "js",
|
|
486
502
|
"name": "NativePayment",
|
|
487
503
|
"declaration": {
|
|
488
|
-
"name": "
|
|
504
|
+
"name": "Be",
|
|
489
505
|
"module": "dist/primer-loader.js"
|
|
490
506
|
}
|
|
491
507
|
},
|
|
@@ -493,7 +509,7 @@
|
|
|
493
509
|
"kind": "js",
|
|
494
510
|
"name": "PaymentMethod",
|
|
495
511
|
"declaration": {
|
|
496
|
-
"name": "
|
|
512
|
+
"name": "De",
|
|
497
513
|
"module": "dist/primer-loader.js"
|
|
498
514
|
}
|
|
499
515
|
},
|
|
@@ -501,7 +517,7 @@
|
|
|
501
517
|
"kind": "js",
|
|
502
518
|
"name": "PaymentMethodAccordion",
|
|
503
519
|
"declaration": {
|
|
504
|
-
"name": "
|
|
520
|
+
"name": "Le",
|
|
505
521
|
"module": "dist/primer-loader.js"
|
|
506
522
|
}
|
|
507
523
|
},
|
|
@@ -509,7 +525,7 @@
|
|
|
509
525
|
"kind": "js",
|
|
510
526
|
"name": "PaymentMethodAccordionConfirmButton",
|
|
511
527
|
"declaration": {
|
|
512
|
-
"name": "
|
|
528
|
+
"name": "mt",
|
|
513
529
|
"module": "dist/primer-loader.js"
|
|
514
530
|
}
|
|
515
531
|
},
|
|
@@ -517,7 +533,7 @@
|
|
|
517
533
|
"kind": "js",
|
|
518
534
|
"name": "PaymentMethodButton",
|
|
519
535
|
"declaration": {
|
|
520
|
-
"name": "
|
|
536
|
+
"name": "je",
|
|
521
537
|
"module": "dist/primer-loader.js"
|
|
522
538
|
}
|
|
523
539
|
},
|
|
@@ -525,7 +541,7 @@
|
|
|
525
541
|
"kind": "js",
|
|
526
542
|
"name": "PaymentMethodContainer",
|
|
527
543
|
"declaration": {
|
|
528
|
-
"name": "
|
|
544
|
+
"name": "_e",
|
|
529
545
|
"module": "dist/primer-loader.js"
|
|
530
546
|
}
|
|
531
547
|
},
|
|
@@ -533,7 +549,7 @@
|
|
|
533
549
|
"kind": "js",
|
|
534
550
|
"name": "PaymentMethodContentComponent",
|
|
535
551
|
"declaration": {
|
|
536
|
-
"name": "
|
|
552
|
+
"name": "We",
|
|
537
553
|
"module": "dist/primer-loader.js"
|
|
538
554
|
}
|
|
539
555
|
},
|
|
@@ -541,7 +557,7 @@
|
|
|
541
557
|
"kind": "js",
|
|
542
558
|
"name": "PortalDialog",
|
|
543
559
|
"declaration": {
|
|
544
|
-
"name": "
|
|
560
|
+
"name": "ee",
|
|
545
561
|
"module": "dist/primer-loader.js"
|
|
546
562
|
}
|
|
547
563
|
},
|
|
@@ -549,7 +565,7 @@
|
|
|
549
565
|
"kind": "js",
|
|
550
566
|
"name": "PrimerCheckoutComplete",
|
|
551
567
|
"declaration": {
|
|
552
|
-
"name": "
|
|
568
|
+
"name": "yr",
|
|
553
569
|
"module": "dist/primer-loader.js"
|
|
554
570
|
}
|
|
555
571
|
},
|
|
@@ -557,7 +573,7 @@
|
|
|
557
573
|
"kind": "js",
|
|
558
574
|
"name": "PrimerCheckoutComponent",
|
|
559
575
|
"declaration": {
|
|
560
|
-
"name": "
|
|
576
|
+
"name": "ve",
|
|
561
577
|
"module": "dist/primer-loader.js"
|
|
562
578
|
}
|
|
563
579
|
},
|
|
@@ -565,7 +581,7 @@
|
|
|
565
581
|
"kind": "js",
|
|
566
582
|
"name": "PrimerCheckoutFailure",
|
|
567
583
|
"declaration": {
|
|
568
|
-
"name": "
|
|
584
|
+
"name": "Zt",
|
|
569
585
|
"module": "dist/primer-loader.js"
|
|
570
586
|
}
|
|
571
587
|
},
|
|
@@ -573,7 +589,7 @@
|
|
|
573
589
|
"kind": "js",
|
|
574
590
|
"name": "PrimerCheckoutState",
|
|
575
591
|
"declaration": {
|
|
576
|
-
"name": "
|
|
592
|
+
"name": "ot",
|
|
577
593
|
"module": "dist/primer-loader.js"
|
|
578
594
|
}
|
|
579
595
|
},
|
|
@@ -581,7 +597,7 @@
|
|
|
581
597
|
"kind": "js",
|
|
582
598
|
"name": "PrimerIcon",
|
|
583
599
|
"declaration": {
|
|
584
|
-
"name": "
|
|
600
|
+
"name": "Ye",
|
|
585
601
|
"module": "dist/primer-loader.js"
|
|
586
602
|
}
|
|
587
603
|
},
|
|
@@ -589,7 +605,7 @@
|
|
|
589
605
|
"kind": "js",
|
|
590
606
|
"name": "PrimerKlarna",
|
|
591
607
|
"declaration": {
|
|
592
|
-
"name": "
|
|
608
|
+
"name": "Ce",
|
|
593
609
|
"module": "dist/primer-loader.js"
|
|
594
610
|
}
|
|
595
611
|
},
|
|
@@ -597,7 +613,7 @@
|
|
|
597
613
|
"kind": "js",
|
|
598
614
|
"name": "PrimerMain",
|
|
599
615
|
"declaration": {
|
|
600
|
-
"name": "
|
|
616
|
+
"name": "Bt",
|
|
601
617
|
"module": "dist/primer-loader.js"
|
|
602
618
|
}
|
|
603
619
|
},
|
|
@@ -613,7 +629,7 @@
|
|
|
613
629
|
"kind": "js",
|
|
614
630
|
"name": "QRCode",
|
|
615
631
|
"declaration": {
|
|
616
|
-
"name": "
|
|
632
|
+
"name": "Ee",
|
|
617
633
|
"module": "dist/primer-loader.js"
|
|
618
634
|
}
|
|
619
635
|
},
|
|
@@ -621,7 +637,7 @@
|
|
|
621
637
|
"kind": "js",
|
|
622
638
|
"name": "RedirectPayment",
|
|
623
639
|
"declaration": {
|
|
624
|
-
"name": "
|
|
640
|
+
"name": "st",
|
|
625
641
|
"module": "dist/primer-loader.js"
|
|
626
642
|
}
|
|
627
643
|
},
|
|
@@ -629,7 +645,7 @@
|
|
|
629
645
|
"kind": "js",
|
|
630
646
|
"name": "Select",
|
|
631
647
|
"declaration": {
|
|
632
|
-
"name": "
|
|
648
|
+
"name": "be",
|
|
633
649
|
"module": "dist/primer-loader.js"
|
|
634
650
|
}
|
|
635
651
|
},
|
|
@@ -637,7 +653,7 @@
|
|
|
637
653
|
"kind": "js",
|
|
638
654
|
"name": "ShowOtherPayments",
|
|
639
655
|
"declaration": {
|
|
640
|
-
"name": "
|
|
656
|
+
"name": "Ge",
|
|
641
657
|
"module": "dist/primer-loader.js"
|
|
642
658
|
}
|
|
643
659
|
},
|
|
@@ -645,7 +661,7 @@
|
|
|
645
661
|
"kind": "js",
|
|
646
662
|
"name": "Spinner",
|
|
647
663
|
"declaration": {
|
|
648
|
-
"name": "
|
|
664
|
+
"name": "He",
|
|
649
665
|
"module": "dist/primer-loader.js"
|
|
650
666
|
}
|
|
651
667
|
},
|
|
@@ -661,7 +677,7 @@
|
|
|
661
677
|
"kind": "js",
|
|
662
678
|
"name": "VaultDeleteConfirmation",
|
|
663
679
|
"declaration": {
|
|
664
|
-
"name": "
|
|
680
|
+
"name": "we",
|
|
665
681
|
"module": "dist/primer-loader.js"
|
|
666
682
|
}
|
|
667
683
|
},
|
|
@@ -669,7 +685,7 @@
|
|
|
669
685
|
"kind": "js",
|
|
670
686
|
"name": "VaultEmptyState",
|
|
671
687
|
"declaration": {
|
|
672
|
-
"name": "
|
|
688
|
+
"name": "lt",
|
|
673
689
|
"module": "dist/primer-loader.js"
|
|
674
690
|
}
|
|
675
691
|
},
|
|
@@ -677,7 +693,7 @@
|
|
|
677
693
|
"kind": "js",
|
|
678
694
|
"name": "VaultErrorMessage",
|
|
679
695
|
"declaration": {
|
|
680
|
-
"name": "
|
|
696
|
+
"name": "Ze",
|
|
681
697
|
"module": "dist/primer-loader.js"
|
|
682
698
|
}
|
|
683
699
|
},
|
|
@@ -685,7 +701,7 @@
|
|
|
685
701
|
"kind": "js",
|
|
686
702
|
"name": "VaultManager",
|
|
687
703
|
"declaration": {
|
|
688
|
-
"name": "
|
|
704
|
+
"name": "se",
|
|
689
705
|
"module": "dist/primer-loader.js"
|
|
690
706
|
}
|
|
691
707
|
},
|
|
@@ -701,7 +717,7 @@
|
|
|
701
717
|
"kind": "js",
|
|
702
718
|
"name": "VaultPaymentMethodItem",
|
|
703
719
|
"declaration": {
|
|
704
|
-
"name": "
|
|
720
|
+
"name": "Ne",
|
|
705
721
|
"module": "dist/primer-loader.js"
|
|
706
722
|
}
|
|
707
723
|
},
|
|
@@ -717,7 +733,7 @@
|
|
|
717
733
|
"kind": "js",
|
|
718
734
|
"name": "injectDarkTheme",
|
|
719
735
|
"declaration": {
|
|
720
|
-
"name": "
|
|
736
|
+
"name": "Cg",
|
|
721
737
|
"module": "dist/primer-loader.js"
|
|
722
738
|
}
|
|
723
739
|
},
|
|
@@ -725,7 +741,7 @@
|
|
|
725
741
|
"kind": "js",
|
|
726
742
|
"name": "injectLightTheme",
|
|
727
743
|
"declaration": {
|
|
728
|
-
"name": "
|
|
744
|
+
"name": "bg",
|
|
729
745
|
"module": "dist/primer-loader.js"
|
|
730
746
|
}
|
|
731
747
|
},
|
|
@@ -733,7 +749,7 @@
|
|
|
733
749
|
"kind": "js",
|
|
734
750
|
"name": "injectLoaderStyles",
|
|
735
751
|
"declaration": {
|
|
736
|
-
"name": "
|
|
752
|
+
"name": "zl",
|
|
737
753
|
"module": "dist/primer-loader.js"
|
|
738
754
|
}
|
|
739
755
|
},
|
|
@@ -741,7 +757,7 @@
|
|
|
741
757
|
"kind": "js",
|
|
742
758
|
"name": "injectThemeStyles",
|
|
743
759
|
"declaration": {
|
|
744
|
-
"name": "
|
|
760
|
+
"name": "jl",
|
|
745
761
|
"module": "dist/primer-loader.js"
|
|
746
762
|
}
|
|
747
763
|
},
|
|
@@ -749,7 +765,7 @@
|
|
|
749
765
|
"kind": "js",
|
|
750
766
|
"name": "loadPrimer",
|
|
751
767
|
"declaration": {
|
|
752
|
-
"name": "
|
|
768
|
+
"name": "tB",
|
|
753
769
|
"module": "dist/primer-loader.js"
|
|
754
770
|
}
|
|
755
771
|
}
|
|
@@ -3527,6 +3543,16 @@
|
|
|
3527
3543
|
"privacy": "private",
|
|
3528
3544
|
"default": "false"
|
|
3529
3545
|
},
|
|
3546
|
+
{
|
|
3547
|
+
"kind": "field",
|
|
3548
|
+
"name": "telemetry",
|
|
3549
|
+
"type": {
|
|
3550
|
+
"text": "TelemetryClient | null"
|
|
3551
|
+
},
|
|
3552
|
+
"privacy": "private",
|
|
3553
|
+
"default": "null",
|
|
3554
|
+
"description": "Session-bound telemetry of the current SDK instance. Held here (in\naddition to the Lit context) so teardown paths can still emit\nPAYMENT_FLOW_EXITED before the instance is disposed."
|
|
3555
|
+
},
|
|
3530
3556
|
{
|
|
3531
3557
|
"kind": "field",
|
|
3532
3558
|
"name": "primerJSInstance",
|
|
@@ -3583,6 +3609,32 @@
|
|
|
3583
3609
|
}
|
|
3584
3610
|
}
|
|
3585
3611
|
},
|
|
3612
|
+
{
|
|
3613
|
+
"kind": "method",
|
|
3614
|
+
"name": "reportError",
|
|
3615
|
+
"privacy": "private",
|
|
3616
|
+
"return": {
|
|
3617
|
+
"type": {
|
|
3618
|
+
"text": "void"
|
|
3619
|
+
}
|
|
3620
|
+
},
|
|
3621
|
+
"parameters": [
|
|
3622
|
+
{
|
|
3623
|
+
"name": "message",
|
|
3624
|
+
"type": {
|
|
3625
|
+
"text": "string"
|
|
3626
|
+
}
|
|
3627
|
+
},
|
|
3628
|
+
{
|
|
3629
|
+
"name": "options",
|
|
3630
|
+
"optional": true,
|
|
3631
|
+
"type": {
|
|
3632
|
+
"text": "{ error?: unknown }"
|
|
3633
|
+
}
|
|
3634
|
+
}
|
|
3635
|
+
],
|
|
3636
|
+
"description": "Datadog error reporting that works across the whole lifecycle: uses the\nsession telemetry once it exists, and the pre-init error context while\ninitialization is still in flight (e.g. createCheckoutContext threw)."
|
|
3637
|
+
},
|
|
3586
3638
|
{
|
|
3587
3639
|
"kind": "method",
|
|
3588
3640
|
"name": "handlePaymentApprovalRequired",
|
|
@@ -5295,14 +5347,6 @@
|
|
|
5295
5347
|
"package": "@primer-io/sdk-core"
|
|
5296
5348
|
}
|
|
5297
5349
|
},
|
|
5298
|
-
{
|
|
5299
|
-
"kind": "js",
|
|
5300
|
-
"name": "AnalyticsUtils",
|
|
5301
|
-
"declaration": {
|
|
5302
|
-
"name": "AnalyticsUtils",
|
|
5303
|
-
"package": "@primer-io/sdk-core"
|
|
5304
|
-
}
|
|
5305
|
-
},
|
|
5306
5350
|
{
|
|
5307
5351
|
"kind": "js",
|
|
5308
5352
|
"name": "BinDataAvailableEvent",
|
|
@@ -5853,6 +5897,53 @@
|
|
|
5853
5897
|
}
|
|
5854
5898
|
]
|
|
5855
5899
|
},
|
|
5900
|
+
{
|
|
5901
|
+
"kind": "javascript-module",
|
|
5902
|
+
"path": "src/utils/reportError.ts",
|
|
5903
|
+
"declarations": [
|
|
5904
|
+
{
|
|
5905
|
+
"kind": "function",
|
|
5906
|
+
"name": "reportError",
|
|
5907
|
+
"return": {
|
|
5908
|
+
"type": {
|
|
5909
|
+
"text": "void"
|
|
5910
|
+
}
|
|
5911
|
+
},
|
|
5912
|
+
"parameters": [
|
|
5913
|
+
{
|
|
5914
|
+
"name": "telemetry",
|
|
5915
|
+
"type": {
|
|
5916
|
+
"text": "TelemetryClient | undefined"
|
|
5917
|
+
}
|
|
5918
|
+
},
|
|
5919
|
+
{
|
|
5920
|
+
"name": "message",
|
|
5921
|
+
"type": {
|
|
5922
|
+
"text": "string"
|
|
5923
|
+
}
|
|
5924
|
+
},
|
|
5925
|
+
{
|
|
5926
|
+
"name": "options",
|
|
5927
|
+
"optional": true,
|
|
5928
|
+
"type": {
|
|
5929
|
+
"text": "{ error?: unknown }"
|
|
5930
|
+
}
|
|
5931
|
+
}
|
|
5932
|
+
],
|
|
5933
|
+
"description": "Report an unexpected technical error that ORIGINATES IN PRIMER-JS (UI\nconcerns like locale loading or display formatting): console + Datadog via\nthe session telemetry. Falls back to console-only when telemetry is not\navailable (before initialization completed, or in legacy mode).\n\nErrors thrown by sdk-core are reported by sdk-core itself (it holds the\ncheckout context and telemetry) — do not re-report those here."
|
|
5934
|
+
}
|
|
5935
|
+
],
|
|
5936
|
+
"exports": [
|
|
5937
|
+
{
|
|
5938
|
+
"kind": "js",
|
|
5939
|
+
"name": "reportError",
|
|
5940
|
+
"declaration": {
|
|
5941
|
+
"name": "reportError",
|
|
5942
|
+
"module": "src/utils/reportError.ts"
|
|
5943
|
+
}
|
|
5944
|
+
}
|
|
5945
|
+
]
|
|
5946
|
+
},
|
|
5856
5947
|
{
|
|
5857
5948
|
"kind": "javascript-module",
|
|
5858
5949
|
"path": "src/utils/shouldUpdateInputMeta.ts",
|
|
@@ -10454,7 +10545,7 @@
|
|
|
10454
10545
|
"kind": "field",
|
|
10455
10546
|
"name": "renderButtonTask",
|
|
10456
10547
|
"privacy": "private",
|
|
10457
|
-
"default": "new Task(this, { args: () => [this.paymentMethod], task: async ([paymentMethod]) => { if (!paymentMethod) { return initialState; } // Ensure the component's DOM is updated await this.updateComplete; const button = paymentMethod.manager.createButton(); const buttonContainer = this.buttonContainerRef.value; if (!buttonContainer) { throw new
|
|
10548
|
+
"default": "new Task(this, { args: () => [this.paymentMethod], task: async ([paymentMethod]) => { if (!paymentMethod) { return initialState; } // Ensure the component's DOM is updated await this.updateComplete; const button = paymentMethod.manager.createButton(); const buttonContainer = this.buttonContainerRef.value; if (!buttonContainer) { throw new SdkError({ origin: 'integration', message: 'Button container not found', code: InitializationErrorCodes.CONTAINER_NOT_FOUND, }); } const style = paymentMethod.type === 'GOOGLE_PAY' ? { shadowRoot: this.shadowRoot } : paymentMethod.type === 'APPLE_PAY' ? { buttonHeight: calculateButtonHeight(buttonContainer) } : { buttonHeight: getPayPalConstrainedHeight( calculateButtonHeight(this), ), }; await button.render(buttonContainer, { style }); // Apply current disabled state to newly created button if (this.disabled) { await button.setDisabled(this.disabled); } return button; }, })"
|
|
10458
10549
|
}
|
|
10459
10550
|
],
|
|
10460
10551
|
"attributes": [
|
|
@@ -14101,6 +14192,13 @@
|
|
|
14101
14192
|
"type": {
|
|
14102
14193
|
"text": "VaultedPaymentMethod"
|
|
14103
14194
|
}
|
|
14195
|
+
},
|
|
14196
|
+
{
|
|
14197
|
+
"name": "telemetry",
|
|
14198
|
+
"optional": true,
|
|
14199
|
+
"type": {
|
|
14200
|
+
"text": "TelemetryClient"
|
|
14201
|
+
}
|
|
14104
14202
|
}
|
|
14105
14203
|
],
|
|
14106
14204
|
"description": "Get a formatted display for any payment method type\nThis is the main entry point for formatting payment methods"
|