@primer-io/primer-js 1.6.1 → 1.6.3
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 +15 -0
- package/dist/custom-elements.json +620 -515
- package/dist/jsx/index.d.ts +2 -0
- package/dist/primer-loader.d.ts +79 -13
- package/dist/primer-loader.js +14 -14
- package/dist/web-types.json +3 -2
- package/package.json +1 -1
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
3
|
"readme": "",
|
|
4
4
|
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "e2e/utils.ts",
|
|
8
|
+
"declarations": [
|
|
9
|
+
{
|
|
10
|
+
"kind": "variable",
|
|
11
|
+
"name": "test",
|
|
12
|
+
"default": "chromaticTest"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"exports": [
|
|
16
|
+
{
|
|
17
|
+
"kind": "js",
|
|
18
|
+
"name": "expect",
|
|
19
|
+
"declaration": {
|
|
20
|
+
"name": "expect",
|
|
21
|
+
"package": "@chromatic-com/playwright"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"kind": "js",
|
|
26
|
+
"name": "test",
|
|
27
|
+
"declaration": {
|
|
28
|
+
"name": "test",
|
|
29
|
+
"module": "e2e/utils.ts"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
5
34
|
{
|
|
6
35
|
"kind": "javascript-module",
|
|
7
36
|
"path": "dist/primer-loader.js",
|
|
@@ -21,7 +50,7 @@
|
|
|
21
50
|
},
|
|
22
51
|
{
|
|
23
52
|
"kind": "function",
|
|
24
|
-
"name": "
|
|
53
|
+
"name": "r",
|
|
25
54
|
"parameters": [
|
|
26
55
|
{
|
|
27
56
|
"name": "t"
|
|
@@ -33,7 +62,31 @@
|
|
|
33
62
|
},
|
|
34
63
|
{
|
|
35
64
|
"kind": "function",
|
|
36
|
-
"name": "
|
|
65
|
+
"name": "r",
|
|
66
|
+
"parameters": [
|
|
67
|
+
{
|
|
68
|
+
"name": "t"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "e"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"kind": "function",
|
|
77
|
+
"name": "r",
|
|
78
|
+
"parameters": [
|
|
79
|
+
{
|
|
80
|
+
"name": "t"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "e"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"kind": "function",
|
|
89
|
+
"name": "r",
|
|
37
90
|
"parameters": [
|
|
38
91
|
{
|
|
39
92
|
"name": "t"
|
|
@@ -45,277 +98,269 @@
|
|
|
45
98
|
},
|
|
46
99
|
{
|
|
47
100
|
"kind": "variable",
|
|
48
|
-
"name": "
|
|
49
|
-
"default": "class extends
|
|
101
|
+
"name": "ee",
|
|
102
|
+
"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?u`<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?u`<primer-button @click=${this.cta.onClick} class=\"cta-button\">${this.cta.icon?u`<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
103
|
},
|
|
51
104
|
{
|
|
52
105
|
"kind": "variable",
|
|
53
|
-
"name": "
|
|
54
|
-
"default": "class extends
|
|
106
|
+
"name": "ve",
|
|
107
|
+
"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===gg.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&&(An(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\")),Sn(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 u` ${w(i,()=>u`<primer-checkout-error></primer-checkout-error>`)}<slot name=\"main\" @slotchange=${this.onSlotChange}></slot>${w(this.hasAssignedContent||!n,()=>f,()=>u`<primer-main></primer-main>`)} `}addEventListener(e,a,i){super.addEventListener(e,a,i)}removeEventListener(e,a,i){super.removeEventListener(e,a,i)}}"
|
|
55
108
|
},
|
|
56
109
|
{
|
|
57
110
|
"kind": "function",
|
|
58
|
-
"name": "
|
|
111
|
+
"name": "Wl"
|
|
59
112
|
},
|
|
60
113
|
{
|
|
61
114
|
"kind": "function",
|
|
62
|
-
"name": "
|
|
115
|
+
"name": "Jl"
|
|
63
116
|
},
|
|
64
117
|
{
|
|
65
118
|
"kind": "function",
|
|
66
|
-
"name": "
|
|
119
|
+
"name": "Cg"
|
|
67
120
|
},
|
|
68
121
|
{
|
|
69
122
|
"kind": "function",
|
|
70
|
-
"name": "
|
|
123
|
+
"name": "Sg"
|
|
71
124
|
},
|
|
72
125
|
{
|
|
73
126
|
"kind": "variable",
|
|
74
|
-
"name": "
|
|
75
|
-
"default": "class extends
|
|
127
|
+
"name": "He",
|
|
128
|
+
"default": "class extends b{constructor(){super(...arguments);this.color=\"var(--primer-color-loader)\";this.size=\"medium\";this.compact=!1}getSize(){if(this.size in Vn)return Vn[this.size];let e=parseInt(this.size,10);return isNaN(e)?Vn.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`),u`<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
129
|
},
|
|
77
130
|
{
|
|
78
131
|
"kind": "variable",
|
|
79
|
-
"name": "
|
|
80
|
-
"default": "class extends
|
|
132
|
+
"name": "$e",
|
|
133
|
+
"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 u`<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
134
|
},
|
|
82
135
|
{
|
|
83
136
|
"kind": "variable",
|
|
84
|
-
"name": "
|
|
85
|
-
"default": "class extends
|
|
137
|
+
"name": "nt",
|
|
138
|
+
"default": "class extends b{constructor(){super(...arguments);this.for=\"\";this.disabled=!1}render(){return u`<label for=${this.for}><slot></slot></label>`}}"
|
|
86
139
|
},
|
|
87
140
|
{
|
|
88
141
|
"kind": "variable",
|
|
89
|
-
"name": "
|
|
90
|
-
"default": "class extends
|
|
142
|
+
"name": "ue",
|
|
143
|
+
"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:u`<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)\"),u`<primer-spinner size=\"small\" color=\"${e}\" compact ></primer-spinner>`}render(){return u`<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?u`<span class=\"button-content ${this.loading?\"loading\":\"\"}\"><slot></slot></span>`:u`<span class=\"button-content-base ${this.loading?\"loading\":\"\"}\" ><slot></slot></span>`} ${this.renderCheckmark()}</button>`}}"
|
|
91
144
|
},
|
|
92
145
|
{
|
|
93
146
|
"kind": "variable",
|
|
94
|
-
"name": "
|
|
95
|
-
"default": "class extends
|
|
147
|
+
"name": "ot",
|
|
148
|
+
"default": "class extends b{constructor(){super(...arguments);this.for=\"\";this.active=!0}render(){return u`<span class=\"error\" role=\"alert\" aria-live=\"polite\" id=\"${this.for||\"\"}\" ><slot></slot></span>`}}"
|
|
96
149
|
},
|
|
97
150
|
{
|
|
98
151
|
"kind": "variable",
|
|
99
|
-
"name": "
|
|
100
|
-
"default": "class extends
|
|
152
|
+
"name": "Ye",
|
|
153
|
+
"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 u`<div style=\"--internal-icon-color: ${this.color}\">${e||u`<slot></slot>`}</div>`}}"
|
|
101
154
|
},
|
|
102
155
|
{
|
|
103
156
|
"kind": "variable",
|
|
104
|
-
"name": "
|
|
105
|
-
"default": "class extends
|
|
157
|
+
"name": "st",
|
|
158
|
+
"default": "class extends b{constructor(){super(...arguments);this.type=\"complete\"}render(){return this.type===\"complete\"?u`<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>`:u`<primer-icon size=\"lg\" name=\"failure-icon\" color=\"var(--primer-color-icon-negative)\" ></primer-icon><p>Payment failed</p>${this.description?u`<p class=\"secondary\">${this.description}</p>`:u`<p class=\"secondary\">Something went wrong.</p>`} `}}"
|
|
106
159
|
},
|
|
107
160
|
{
|
|
108
161
|
"kind": "variable",
|
|
109
|
-
"name": "
|
|
110
|
-
"default": "class extends
|
|
162
|
+
"name": "$",
|
|
163
|
+
"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 u`<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
164
|
},
|
|
112
165
|
{
|
|
113
166
|
"kind": "variable",
|
|
114
167
|
"name": "re",
|
|
115
|
-
"default": "class extends
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"kind": "variable",
|
|
119
|
-
"name": "ve",
|
|
120
|
-
"default": "class extends C{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 r of this.options)e.push(p`<option value=${r.value} ?selected=${this.value===r.value} >${r.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>`}}"
|
|
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>`}}"
|
|
168
|
+
"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 u`<div @click=${this.handleHostClick} style=\"display: contents;\"><span class=\"flag\" aria-hidden=\"true\">${Mg}</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>`}}"
|
|
126
169
|
},
|
|
127
170
|
{
|
|
128
171
|
"kind": "variable",
|
|
129
|
-
"name": "
|
|
130
|
-
"default": "class extends
|
|
172
|
+
"name": "be",
|
|
173
|
+
"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(u`<option value=${a.value} ?selected=${this.value===a.value} >${a.label}</option>`);return e}render(){return u`<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
174
|
},
|
|
132
175
|
{
|
|
133
176
|
"kind": "variable",
|
|
134
|
-
"name": "
|
|
135
|
-
"default": "class extends
|
|
177
|
+
"name": "pe",
|
|
178
|
+
"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 u`<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
179
|
},
|
|
137
180
|
{
|
|
138
181
|
"kind": "variable",
|
|
139
|
-
"name": "
|
|
140
|
-
"default": "class extends
|
|
182
|
+
"name": "ze",
|
|
183
|
+
"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 u`<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
184
|
},
|
|
142
185
|
{
|
|
143
186
|
"kind": "variable",
|
|
144
187
|
"name": "xe",
|
|
145
|
-
"default": "class extends
|
|
188
|
+
"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?u`<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?u`<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>`:u``}}"
|
|
146
189
|
},
|
|
147
190
|
{
|
|
148
191
|
"kind": "variable",
|
|
149
192
|
"name": "Ce",
|
|
150
|
-
"default": "class extends
|
|
193
|
+
"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)){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?u`<div class=\"loading\"><primer-spinner size=\"small\"></primer-spinner></div>`:(e.length>0&&!this.selectedCategory&&this.selectCategory(e[0].id),e.length===1?f:u`<div class=\"category-selection\">${e.map(i=>u`<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?u`<primer-spinner class=\"category-spinner\" size=\"small\" compact ></primer-spinner>`:f}</button>`)}</div>`)}renderExpandedContent(){return u` ${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 u`<div class=\"error\"> Error loading Klarna: ${a}</div>`},complete:({manager:e})=>e?u`<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
194
|
},
|
|
152
195
|
{
|
|
153
196
|
"kind": "variable",
|
|
154
|
-
"name": "
|
|
155
|
-
"default": "class extends
|
|
197
|
+
"name": "Be",
|
|
198
|
+
"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:Ns.CONTAINER_NOT_FOUND});let n=e.type===\"GOOGLE_PAY\"?{shadowRoot:this.shadowRoot}:e.type===\"APPLE_PAY\"?{buttonHeight:gd(i)}:{buttonHeight:Ng(gd(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 u`<div class=\"native-button-container\" ${pr(this.buttonContainerRef)} ></div>`}}"
|
|
156
199
|
},
|
|
157
200
|
{
|
|
158
201
|
"kind": "variable",
|
|
159
202
|
"name": "Se",
|
|
160
|
-
"default": "class extends
|
|
203
|
+
"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.currentState===\"loading\")return;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 u`<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 u`<div class=\"blik-loading\"><primer-spinner size=\"medium\"></primer-spinner>${this.pollingDuration>30?u`<div class=\"blik-timeout-warning\"> This is taking longer than expected... </div>`:f}</div>`}renderError(){return u`<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 u`<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
204
|
},
|
|
162
205
|
{
|
|
163
206
|
"kind": "variable",
|
|
164
|
-
"name": "
|
|
165
|
-
"default": "class extends
|
|
207
|
+
"name": "Ie",
|
|
208
|
+
"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>=bd&&this.phoneNumber.length<=Cd&&/^\\+\\d+$/.test(this.phoneNumber)}async submit(){if(this.currentState===\"loading\")return;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 u`<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=${Cd} .minLength=${bd} ?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 u`<div class=\"mbway-loading\"><primer-spinner size=\"medium\"></primer-spinner><div class=\"mbway-loading-message\">${e}</div></div>`}renderError(){return u`<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 u`<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
209
|
},
|
|
167
210
|
{
|
|
168
211
|
"kind": "variable",
|
|
169
|
-
"name": "
|
|
170
|
-
"default": "class extends
|
|
212
|
+
"name": "Ee",
|
|
213
|
+
"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||(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?u`<div class=\"qrcode-loading\"><primer-spinner size=\"medium\"></primer-spinner></div>`:u`<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?u`<img src=${this.qrCodeUrl} alt=${T(\"qrCode\",{id:\"qrCode\"})} />`:f}</div></div>`}render(){return u`<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
214
|
},
|
|
172
215
|
{
|
|
173
216
|
"kind": "variable",
|
|
174
|
-
"name": "
|
|
175
|
-
"default": "class extends
|
|
217
|
+
"name": "De",
|
|
218
|
+
"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=u`<primer-card-form ?disabled=${this.disabled} ></primer-card-form>`;break;case\"NATIVE\":a=u`<primer-native-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-native-payment>`;break;case\"QRCODE\":a=u`<primer-qrcode .paymentMethod=${e} ?disabled=${this.disabled} ></primer-qrcode>`;break;case\"BLIK\":a=u`<primer-blik .paymentMethod=${e} ?disabled=${this.disabled} ></primer-blik>`;break;case\"REDIRECT\":a=u`<primer-redirect-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-redirect-payment>`;break;case\"KLARNA\":a=u`<primer-klarna ?disabled=${this.disabled} ></primer-klarna>`;break;case\"ADYEN_KLARNA\":a=u`<primer-adyen-klarna .paymentMethod=${e} ?disabled=${this.disabled} ></primer-adyen-klarna>`;break;case\"MBWAY\":a=u`<primer-adyen-mbway .paymentMethod=${e} ?disabled=${this.disabled} ></primer-adyen-mbway>`;break;default:return f}return u`<div @click=${this.handleClick} @expanded-change=${i=>{this.isActive=i.detail.expanded}} >${a}</div>`}}"
|
|
176
219
|
},
|
|
177
220
|
{
|
|
178
221
|
"kind": "variable",
|
|
179
|
-
"name": "
|
|
180
|
-
"default": "class extends
|
|
222
|
+
"name": "_e",
|
|
223
|
+
"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:u`<div class=\"payment-methods-container\">${e.map(a=>u`<primer-payment-method type=\"${a.type}\" ?disabled=\"${this.disabled||this.primerContext?.clientOptions?.disabledPayments===!0}\" ></primer-payment-method>`)}</div>`}}"
|
|
181
224
|
},
|
|
182
225
|
{
|
|
183
226
|
"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\"}}"
|
|
227
|
+
"name": "je",
|
|
228
|
+
"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=Md(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?Yn(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 Dg;case k.PAY_NL_PAYCONIQ:return i===a.backgroundColor.light?Rg:xg;case k.ADYEN_CASHAPP:return a.iconUrl.dark??a.iconUrl.colored??a.iconUrl.light;default:return e===\"TRIPLE_A\"?Bg: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 u`<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,()=>u`<span class=\"button-text\">${e.displayName}</span>`)}</primer-button>`}})}}"
|
|
189
229
|
},
|
|
190
230
|
{
|
|
191
231
|
"kind": "variable",
|
|
192
|
-
"name": "
|
|
193
|
-
"default": "class extends
|
|
232
|
+
"name": "Ze",
|
|
233
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1}_handleClick(){this.disabled||!this.paymentMethod?.manager||this.primerContext?.sdkState.isProcessing||(this.primerContext?.setProcessing?.(!0),this.paymentMethod.manager.start())}render(){return u`<primer-payment-method-button .type=${this.paymentMethod?.type} ?disabled=${this.disabled} @payment-method-click=${()=>this._handleClick()} ></primer-payment-method-button>`}}"
|
|
194
234
|
},
|
|
195
235
|
{
|
|
196
236
|
"kind": "variable",
|
|
197
237
|
"name": "oe",
|
|
198
|
-
"default": "class extends
|
|
238
|
+
"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(Wn).reduce((n,o)=>({...n,[o]:i[o]??!1}),{})}}return this.defaultFieldConfig}async initializeCountryOptions(){try{let e=Zn(\"en\");this.countryOptions=[...e.map(([n,o])=>({value:n,label:o}))],this.requestUpdate(\"countryOptions\");let a=En();if(a===\"en\"||a===\"en-GB\"||a.startsWith(\"en-\"))return;if(await lc(a)){let n=Zn(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(Wn).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(Wn).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\"),u`<div class=\"billing-address-form\"><div class=\"billing-address-title\">${T(\"Billing address\",{id:\"billingAddressLabel\"})}</div>${w(this.fieldConfig.countryCode,()=>u`<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\"),()=>u`<primer-input-error slot=\"error\">${this.errors.countryCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.firstName||this.fieldConfig.lastName,()=>u`<div class=\"billing-address-row\">${w(this.fieldConfig.firstName,()=>u`<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\"),()=>u`<primer-input-error slot=\"error\">${this.errors.firstName}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.lastName,()=>u`<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\"),()=>u`<primer-input-error slot=\"error\">${this.errors.lastName}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${w(this.fieldConfig.addressLine1,()=>u`<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\"),()=>u`<primer-input-error slot=\"error\">${this.errors.addressLine1}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.addressLine2,()=>u`<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\"),()=>u`<primer-input-error slot=\"error\">${this.errors.addressLine2}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.postalCode||this.fieldConfig.city,()=>u`<div class=\"billing-address-row\">${w(this.fieldConfig.postalCode,()=>u`<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\"),()=>u`<primer-input-error slot=\"error\">${this.errors.postalCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.city,()=>u`<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\"),()=>u`<primer-input-error slot=\"error\">${this.errors.city}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${w(this.fieldConfig.state,()=>u`<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\"),()=>u`<primer-input-error slot=\"error\">${this.errors.state}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`):(this.setAttribute(\"hidden\",\"\"),f)})}}"
|
|
199
239
|
},
|
|
200
240
|
{
|
|
201
241
|
"kind": "variable",
|
|
202
|
-
"name": "
|
|
203
|
-
"default": "class extends
|
|
242
|
+
"name": "se",
|
|
243
|
+
"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 qn(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 u`<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 u`<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:u`<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 u`<div class=\"payment-methods-list\">${e.map(i=>this.renderPaymentMethodItem(i))} ${w(a,()=>u`<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,()=>u`<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 u` ${w(!this.primerContext?.vaultManager?.showEmptyState&&!e,()=>f,()=>u`<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,()=>u`<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,()=>u`<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,()=>u`<div class=\"content-container\">${w(this.deletePaymentMethodId,()=>this.renderDeleteConfirmation(),()=>this.renderPaymentMethodList())}</div>`,()=>f)}</div>${w(i,()=>this.renderLoadingOverlay(),()=>f)}</div></slot>`)} `}}"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"kind": "variable",
|
|
247
|
+
"name": "Ne",
|
|
248
|
+
"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 u`<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,()=>u`<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?u`<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
249
|
},
|
|
205
250
|
{
|
|
206
251
|
"kind": "variable",
|
|
207
252
|
"name": "Oe",
|
|
208
|
-
"default": "class extends
|
|
253
|
+
"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 u`<div class=\"vault-manager-header\"><h3>${T(\"previouslyUsed\",{id:\"previouslyUsed\"})}</h3>${this.hasPaymentMethods?u`<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?u`<primer-icon name=\"checkmark\" size=\"sm\"></primer-icon>`:u`<primer-icon name=\"edit\" size=\"sm\"></primer-icon>`}</primer-button>`:f}</div>`}}"
|
|
209
254
|
},
|
|
210
255
|
{
|
|
211
256
|
"kind": "variable",
|
|
212
|
-
"name": "
|
|
213
|
-
"default": "class extends
|
|
257
|
+
"name": "we",
|
|
258
|
+
"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 u`<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
259
|
},
|
|
215
260
|
{
|
|
216
261
|
"kind": "variable",
|
|
217
|
-
"name": "
|
|
218
|
-
"default": "class extends
|
|
262
|
+
"name": "lt",
|
|
263
|
+
"default": "class extends b{render(){return u`<div class=\"empty-state\"><p>${T(\"savedPaymentMethodsEmpty\",{id:\"savedPaymentMethodsEmpty\"})}</p></div>`}}"
|
|
219
264
|
},
|
|
220
265
|
{
|
|
221
266
|
"kind": "variable",
|
|
222
|
-
"name": "
|
|
223
|
-
"default": "class extends
|
|
267
|
+
"name": "We",
|
|
268
|
+
"default": "class extends b{constructor(){super(...arguments);this.errorMessage=\"\";this.handleDismiss=()=>{this.dispatchEvent(new CustomEvent(\"close-error\",{bubbles:!0,composed:!0}))}}render(){return u`<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
269
|
},
|
|
225
270
|
{
|
|
226
271
|
"kind": "variable",
|
|
227
272
|
"name": "Ae",
|
|
228
|
-
"default": "class extends
|
|
273
|
+
"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 u`<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
274
|
},
|
|
230
275
|
{
|
|
231
276
|
"kind": "variable",
|
|
232
277
|
"name": "ae",
|
|
233
|
-
"default": "class extends
|
|
278
|
+
"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:()=>u`<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),()=>u`<primer-input-error slot=\"error\">${T(this.cvvError,{id:this.cvvError})}</primer-input-error>`)}</primer-input-wrapper></div>`})}}"
|
|
234
279
|
},
|
|
235
280
|
{
|
|
236
281
|
"kind": "variable",
|
|
237
|
-
"name": "
|
|
238
|
-
"default": "class extends
|
|
282
|
+
"name": "Je",
|
|
283
|
+
"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,()=>u`<img class=\"payment-method-icon\" src=${a} alt=${e} />`,()=>u`<div class=\"payment-method-icon payment-method-icon-generic\"><primer-icon name=\"payment-card\" size=\"sm\"></primer-icon></div>`);return this.assetConfig.type===\"paypal\"?u`<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\"?u`<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\"?u`<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\"?u`<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\"?u`<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
284
|
},
|
|
240
285
|
{
|
|
241
286
|
"kind": "variable",
|
|
242
|
-
"name": "
|
|
243
|
-
"default": "class extends
|
|
287
|
+
"name": "Me",
|
|
288
|
+
"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(S=>S.name===Lc.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 p=c.field||c.name,m=c.message||c.error,g=Lc[p];if(g){let S=this.inputControllers.get(g);if(S){let A={valid:!1,error:m,errorCode:m};S.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.primerContext?.setProcessing?.(!0),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 p=T(\"tokenizationError\",{id:\"tokenizationError\"});this.formErrorMessage=p,this.primerContext?.setProcessing?.(!1),this.eventsController.dispatchFormSubmitErrors([{field:\"billingAddress\",name:\"billingAddress\",error:\"BILLING_ADDRESS_SUBMISSION_FAILED\",message:p}]);return}let s={success:!0};this.eventsController.dispatchFormSubmitSuccess(s);let l=this.selectedCardNetwork?{cardNetwork:this.selectedCardNetwork}:void 0;await e.submit?.(l)}else{this.primerContext?.setProcessing?.(!1);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:u`<form @submit=${this.handleFormSubmit}><slot name=\"card-form-content\" @slotchange=${this.onSlotChange}></slot>${this.setupCardFormTask.render({complete:()=>w(this.hasAssignedContent,()=>f,()=>u`<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,()=>u`<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
289
|
},
|
|
245
290
|
{
|
|
246
291
|
"kind": "variable",
|
|
247
|
-
"name": "
|
|
248
|
-
"default": "class extends
|
|
292
|
+
"name": "dt",
|
|
293
|
+
"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 u`<primer-input-wrapper .focusWithin=\"${this.hostedInputController.meta.active}\" .hasError=${!!e} >${w(!this.cardFormContext?.hideLabels,()=>u`<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=>u`<primer-input-error slot=\"error\">${T(a,{id:a})}</primer-input-error>`,()=>f)}</primer-input-wrapper>`}render(){return this.renderInput()}}"
|
|
249
294
|
},
|
|
250
295
|
{
|
|
251
296
|
"kind": "variable",
|
|
252
|
-
"name": "
|
|
253
|
-
"default": "class extends
|
|
297
|
+
"name": "ct",
|
|
298
|
+
"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
299
|
},
|
|
255
300
|
{
|
|
256
301
|
"kind": "variable",
|
|
257
|
-
"name": "
|
|
258
|
-
"default": "class extends
|
|
302
|
+
"name": "ut",
|
|
303
|
+
"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
304
|
},
|
|
260
305
|
{
|
|
261
306
|
"kind": "variable",
|
|
262
|
-
"name": "
|
|
263
|
-
"default": "class extends
|
|
307
|
+
"name": "pt",
|
|
308
|
+
"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
309
|
},
|
|
265
310
|
{
|
|
266
311
|
"kind": "variable",
|
|
267
|
-
"name": "
|
|
268
|
-
"default": "class extends
|
|
312
|
+
"name": "me",
|
|
313
|
+
"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 u`<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
314
|
},
|
|
270
315
|
{
|
|
271
316
|
"kind": "variable",
|
|
272
|
-
"name": "
|
|
273
|
-
"default": "class extends
|
|
317
|
+
"name": "he",
|
|
318
|
+
"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 u`<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 u`<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&&!lu(e.map(o=>o.network))?u`<div class=\"network-selector-inline\">${e.map(o=>u`<div class=\"network-icon-container\"><img class=\"network-icon\" src=${this.getNetworkIconUrl(o)??\"\"} alt=${o.displayName} /></div>`)}</div>`:u`<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,()=>u`<primer-icon class=\"caret ${this.isDropdownOpen?\"open\":\"\"}\" size=\"sm\" name=\"chevron-down\" ></primer-icon>`,()=>f)}</button>${w(this.isDropdownOpen,()=>u`<div ${pr(this.dropdownRef)} id=\"network-dropdown\" class=\"dropdown open\" role=\"listbox\" aria-label=\"Select card network\" >${e.map((o,s)=>u`<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,()=>u`<primer-icon class=\"checkmark\" name=\"checkmark\" size=\"sm\" ></primer-icon>`,()=>f)}</div>`)}</div>`,()=>f)} `}}"
|
|
274
319
|
},
|
|
275
320
|
{
|
|
276
321
|
"kind": "variable",
|
|
277
|
-
"name": "
|
|
278
|
-
"default": "class extends
|
|
322
|
+
"name": "Ge",
|
|
323
|
+
"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?u`<slot name=\"other-payments\"></slot>`:u`<div class=\"other-payment-methods-container\"><slot name=\"show-other-payments-toggle-button\" @slotchange=${this.handleToggleSlotChange} ></slot>${w(!this.hasSlottedToggle,()=>u`<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>`,()=>u`<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
324
|
},
|
|
280
325
|
{
|
|
281
326
|
"kind": "variable",
|
|
282
|
-
"name": "
|
|
283
|
-
"default": "class extends
|
|
327
|
+
"name": "Le",
|
|
328
|
+
"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 u`<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
329
|
},
|
|
285
330
|
{
|
|
286
331
|
"kind": "variable",
|
|
287
|
-
"name": "
|
|
288
|
-
"default": "class extends
|
|
332
|
+
"name": "mt",
|
|
333
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.loading=!1}render(){return u`<button class=${W({loading:this.loading})} ?disabled=${this.disabled||this.loading} @click=${()=>this.dispatchEvent(new Event(\"confirm\",{bubbles:!0,composed:!0}))} >${this.loading?u`<primer-spinner size=\"small\" compact></primer-spinner>`:T(\"confirm\",{id:\"confirm\"})}</button>`}}"
|
|
289
334
|
},
|
|
290
335
|
{
|
|
291
336
|
"kind": "variable",
|
|
292
|
-
"name": "
|
|
293
|
-
"default": "class extends
|
|
337
|
+
"name": "yr",
|
|
338
|
+
"default": "class extends b{render(){return u`<primer-checkout-state type=\"complete\"></primer-checkout-state>`}}"
|
|
294
339
|
},
|
|
295
340
|
{
|
|
296
341
|
"kind": "variable",
|
|
297
|
-
"name": "
|
|
298
|
-
"default": "class extends
|
|
342
|
+
"name": "Zt",
|
|
343
|
+
"default": "class extends b{render(){return u`<primer-checkout-state type=\"failure\" description=${this.primerContext?.sdkState?.primerJsError?.message||\"\"} ></primer-checkout-state>`}}"
|
|
299
344
|
},
|
|
300
345
|
{
|
|
301
346
|
"kind": "variable",
|
|
302
|
-
"name": "
|
|
303
|
-
"default": "class extends
|
|
347
|
+
"name": "ht",
|
|
348
|
+
"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?u`<primer-error-message message=\"${T(this.primerContext.sdkState.paymentFailure?.message??\"\",{id:\"tokenizationError\"})}\" ?visible=\"${this.shouldShowError}\" ></primer-error-message>`:f}}"
|
|
304
349
|
},
|
|
305
350
|
{
|
|
306
351
|
"kind": "variable",
|
|
307
|
-
"name": "
|
|
308
|
-
"default": "class extends
|
|
352
|
+
"name": "Bt",
|
|
353
|
+
"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?u`<slot name=\"checkout-complete\"><primer-checkout-complete></primer-checkout-complete></slot>`:u`<slot name=\"payments\" @slotchange=${this.onSlotChange}></slot>${w(this.hasAssignedContent,()=>f,()=>u`<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=>u`<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
354
|
},
|
|
310
355
|
{
|
|
311
356
|
"kind": "function",
|
|
312
|
-
"name": "
|
|
357
|
+
"name": "yB"
|
|
313
358
|
}
|
|
314
359
|
],
|
|
315
360
|
"exports": [
|
|
316
361
|
{
|
|
317
362
|
"kind": "custom-element-definition",
|
|
318
|
-
"name": "
|
|
363
|
+
"name": "r",
|
|
319
364
|
"declaration": {
|
|
320
365
|
"name": "t",
|
|
321
366
|
"module": "dist/primer-loader.js"
|
|
@@ -323,7 +368,7 @@
|
|
|
323
368
|
},
|
|
324
369
|
{
|
|
325
370
|
"kind": "custom-element-definition",
|
|
326
|
-
"name": "
|
|
371
|
+
"name": "r",
|
|
327
372
|
"declaration": {
|
|
328
373
|
"name": "t",
|
|
329
374
|
"module": "dist/primer-loader.js"
|
|
@@ -333,7 +378,7 @@
|
|
|
333
378
|
"kind": "js",
|
|
334
379
|
"name": "AdyenMbway",
|
|
335
380
|
"declaration": {
|
|
336
|
-
"name": "
|
|
381
|
+
"name": "Ie",
|
|
337
382
|
"module": "dist/primer-loader.js"
|
|
338
383
|
}
|
|
339
384
|
},
|
|
@@ -341,7 +386,7 @@
|
|
|
341
386
|
"kind": "js",
|
|
342
387
|
"name": "BillingAddress",
|
|
343
388
|
"declaration": {
|
|
344
|
-
"name": "
|
|
389
|
+
"name": "oe",
|
|
345
390
|
"module": "dist/primer-loader.js"
|
|
346
391
|
}
|
|
347
392
|
},
|
|
@@ -349,7 +394,7 @@
|
|
|
349
394
|
"kind": "js",
|
|
350
395
|
"name": "Blik",
|
|
351
396
|
"declaration": {
|
|
352
|
-
"name": "
|
|
397
|
+
"name": "Se",
|
|
353
398
|
"module": "dist/primer-loader.js"
|
|
354
399
|
}
|
|
355
400
|
},
|
|
@@ -357,7 +402,7 @@
|
|
|
357
402
|
"kind": "js",
|
|
358
403
|
"name": "Button",
|
|
359
404
|
"declaration": {
|
|
360
|
-
"name": "
|
|
405
|
+
"name": "ue",
|
|
361
406
|
"module": "dist/primer-loader.js"
|
|
362
407
|
}
|
|
363
408
|
},
|
|
@@ -365,7 +410,7 @@
|
|
|
365
410
|
"kind": "js",
|
|
366
411
|
"name": "CardForm",
|
|
367
412
|
"declaration": {
|
|
368
|
-
"name": "
|
|
413
|
+
"name": "Me",
|
|
369
414
|
"module": "dist/primer-loader.js"
|
|
370
415
|
}
|
|
371
416
|
},
|
|
@@ -373,7 +418,7 @@
|
|
|
373
418
|
"kind": "js",
|
|
374
419
|
"name": "CardFormCVV",
|
|
375
420
|
"declaration": {
|
|
376
|
-
"name": "
|
|
421
|
+
"name": "ct",
|
|
377
422
|
"module": "dist/primer-loader.js"
|
|
378
423
|
}
|
|
379
424
|
},
|
|
@@ -381,7 +426,7 @@
|
|
|
381
426
|
"kind": "js",
|
|
382
427
|
"name": "CardFormCardNetworkSelector",
|
|
383
428
|
"declaration": {
|
|
384
|
-
"name": "
|
|
429
|
+
"name": "he",
|
|
385
430
|
"module": "dist/primer-loader.js"
|
|
386
431
|
}
|
|
387
432
|
},
|
|
@@ -389,7 +434,7 @@
|
|
|
389
434
|
"kind": "js",
|
|
390
435
|
"name": "CardFormCardNumber",
|
|
391
436
|
"declaration": {
|
|
392
|
-
"name": "
|
|
437
|
+
"name": "dt",
|
|
393
438
|
"module": "dist/primer-loader.js"
|
|
394
439
|
}
|
|
395
440
|
},
|
|
@@ -397,7 +442,7 @@
|
|
|
397
442
|
"kind": "js",
|
|
398
443
|
"name": "CardFormError",
|
|
399
444
|
"declaration": {
|
|
400
|
-
"name": "
|
|
445
|
+
"name": "ot",
|
|
401
446
|
"module": "dist/primer-loader.js"
|
|
402
447
|
}
|
|
403
448
|
},
|
|
@@ -405,7 +450,7 @@
|
|
|
405
450
|
"kind": "js",
|
|
406
451
|
"name": "CardFormExpiry",
|
|
407
452
|
"declaration": {
|
|
408
|
-
"name": "
|
|
453
|
+
"name": "ut",
|
|
409
454
|
"module": "dist/primer-loader.js"
|
|
410
455
|
}
|
|
411
456
|
},
|
|
@@ -413,7 +458,7 @@
|
|
|
413
458
|
"kind": "js",
|
|
414
459
|
"name": "CardFormName",
|
|
415
460
|
"declaration": {
|
|
416
|
-
"name": "
|
|
461
|
+
"name": "pt",
|
|
417
462
|
"module": "dist/primer-loader.js"
|
|
418
463
|
}
|
|
419
464
|
},
|
|
@@ -421,7 +466,7 @@
|
|
|
421
466
|
"kind": "js",
|
|
422
467
|
"name": "CardFormSubmit",
|
|
423
468
|
"declaration": {
|
|
424
|
-
"name": "
|
|
469
|
+
"name": "me",
|
|
425
470
|
"module": "dist/primer-loader.js"
|
|
426
471
|
}
|
|
427
472
|
},
|
|
@@ -429,7 +474,7 @@
|
|
|
429
474
|
"kind": "js",
|
|
430
475
|
"name": "Collapsable",
|
|
431
476
|
"declaration": {
|
|
432
|
-
"name": "
|
|
477
|
+
"name": "pe",
|
|
433
478
|
"module": "dist/primer-loader.js"
|
|
434
479
|
}
|
|
435
480
|
},
|
|
@@ -437,7 +482,7 @@
|
|
|
437
482
|
"kind": "js",
|
|
438
483
|
"name": "Dialog",
|
|
439
484
|
"declaration": {
|
|
440
|
-
"name": "
|
|
485
|
+
"name": "xe",
|
|
441
486
|
"module": "dist/primer-loader.js"
|
|
442
487
|
}
|
|
443
488
|
},
|
|
@@ -445,7 +490,7 @@
|
|
|
445
490
|
"kind": "js",
|
|
446
491
|
"name": "ErrorMessage",
|
|
447
492
|
"declaration": {
|
|
448
|
-
"name": "
|
|
493
|
+
"name": "ze",
|
|
449
494
|
"module": "dist/primer-loader.js"
|
|
450
495
|
}
|
|
451
496
|
},
|
|
@@ -453,7 +498,7 @@
|
|
|
453
498
|
"kind": "js",
|
|
454
499
|
"name": "ErrorMessageContainer",
|
|
455
500
|
"declaration": {
|
|
456
|
-
"name": "
|
|
501
|
+
"name": "ht",
|
|
457
502
|
"module": "dist/primer-loader.js"
|
|
458
503
|
}
|
|
459
504
|
},
|
|
@@ -461,7 +506,7 @@
|
|
|
461
506
|
"kind": "js",
|
|
462
507
|
"name": "Input",
|
|
463
508
|
"declaration": {
|
|
464
|
-
"name": "
|
|
509
|
+
"name": "$",
|
|
465
510
|
"module": "dist/primer-loader.js"
|
|
466
511
|
}
|
|
467
512
|
},
|
|
@@ -469,7 +514,7 @@
|
|
|
469
514
|
"kind": "js",
|
|
470
515
|
"name": "InputLabel",
|
|
471
516
|
"declaration": {
|
|
472
|
-
"name": "
|
|
517
|
+
"name": "nt",
|
|
473
518
|
"module": "dist/primer-loader.js"
|
|
474
519
|
}
|
|
475
520
|
},
|
|
@@ -477,7 +522,7 @@
|
|
|
477
522
|
"kind": "js",
|
|
478
523
|
"name": "InputWrapper",
|
|
479
524
|
"declaration": {
|
|
480
|
-
"name": "
|
|
525
|
+
"name": "$e",
|
|
481
526
|
"module": "dist/primer-loader.js"
|
|
482
527
|
}
|
|
483
528
|
},
|
|
@@ -485,7 +530,7 @@
|
|
|
485
530
|
"kind": "js",
|
|
486
531
|
"name": "NativePayment",
|
|
487
532
|
"declaration": {
|
|
488
|
-
"name": "
|
|
533
|
+
"name": "Be",
|
|
489
534
|
"module": "dist/primer-loader.js"
|
|
490
535
|
}
|
|
491
536
|
},
|
|
@@ -493,7 +538,7 @@
|
|
|
493
538
|
"kind": "js",
|
|
494
539
|
"name": "PaymentMethod",
|
|
495
540
|
"declaration": {
|
|
496
|
-
"name": "
|
|
541
|
+
"name": "De",
|
|
497
542
|
"module": "dist/primer-loader.js"
|
|
498
543
|
}
|
|
499
544
|
},
|
|
@@ -501,7 +546,7 @@
|
|
|
501
546
|
"kind": "js",
|
|
502
547
|
"name": "PaymentMethodAccordion",
|
|
503
548
|
"declaration": {
|
|
504
|
-
"name": "
|
|
549
|
+
"name": "Le",
|
|
505
550
|
"module": "dist/primer-loader.js"
|
|
506
551
|
}
|
|
507
552
|
},
|
|
@@ -509,7 +554,7 @@
|
|
|
509
554
|
"kind": "js",
|
|
510
555
|
"name": "PaymentMethodAccordionConfirmButton",
|
|
511
556
|
"declaration": {
|
|
512
|
-
"name": "
|
|
557
|
+
"name": "mt",
|
|
513
558
|
"module": "dist/primer-loader.js"
|
|
514
559
|
}
|
|
515
560
|
},
|
|
@@ -517,7 +562,7 @@
|
|
|
517
562
|
"kind": "js",
|
|
518
563
|
"name": "PaymentMethodButton",
|
|
519
564
|
"declaration": {
|
|
520
|
-
"name": "
|
|
565
|
+
"name": "je",
|
|
521
566
|
"module": "dist/primer-loader.js"
|
|
522
567
|
}
|
|
523
568
|
},
|
|
@@ -525,7 +570,7 @@
|
|
|
525
570
|
"kind": "js",
|
|
526
571
|
"name": "PaymentMethodContainer",
|
|
527
572
|
"declaration": {
|
|
528
|
-
"name": "
|
|
573
|
+
"name": "_e",
|
|
529
574
|
"module": "dist/primer-loader.js"
|
|
530
575
|
}
|
|
531
576
|
},
|
|
@@ -533,7 +578,7 @@
|
|
|
533
578
|
"kind": "js",
|
|
534
579
|
"name": "PaymentMethodContentComponent",
|
|
535
580
|
"declaration": {
|
|
536
|
-
"name": "
|
|
581
|
+
"name": "Je",
|
|
537
582
|
"module": "dist/primer-loader.js"
|
|
538
583
|
}
|
|
539
584
|
},
|
|
@@ -541,7 +586,7 @@
|
|
|
541
586
|
"kind": "js",
|
|
542
587
|
"name": "PortalDialog",
|
|
543
588
|
"declaration": {
|
|
544
|
-
"name": "
|
|
589
|
+
"name": "ee",
|
|
545
590
|
"module": "dist/primer-loader.js"
|
|
546
591
|
}
|
|
547
592
|
},
|
|
@@ -549,7 +594,7 @@
|
|
|
549
594
|
"kind": "js",
|
|
550
595
|
"name": "PrimerCheckoutComplete",
|
|
551
596
|
"declaration": {
|
|
552
|
-
"name": "
|
|
597
|
+
"name": "yr",
|
|
553
598
|
"module": "dist/primer-loader.js"
|
|
554
599
|
}
|
|
555
600
|
},
|
|
@@ -557,7 +602,7 @@
|
|
|
557
602
|
"kind": "js",
|
|
558
603
|
"name": "PrimerCheckoutComponent",
|
|
559
604
|
"declaration": {
|
|
560
|
-
"name": "
|
|
605
|
+
"name": "ve",
|
|
561
606
|
"module": "dist/primer-loader.js"
|
|
562
607
|
}
|
|
563
608
|
},
|
|
@@ -565,7 +610,7 @@
|
|
|
565
610
|
"kind": "js",
|
|
566
611
|
"name": "PrimerCheckoutFailure",
|
|
567
612
|
"declaration": {
|
|
568
|
-
"name": "
|
|
613
|
+
"name": "Zt",
|
|
569
614
|
"module": "dist/primer-loader.js"
|
|
570
615
|
}
|
|
571
616
|
},
|
|
@@ -573,7 +618,7 @@
|
|
|
573
618
|
"kind": "js",
|
|
574
619
|
"name": "PrimerCheckoutState",
|
|
575
620
|
"declaration": {
|
|
576
|
-
"name": "
|
|
621
|
+
"name": "st",
|
|
577
622
|
"module": "dist/primer-loader.js"
|
|
578
623
|
}
|
|
579
624
|
},
|
|
@@ -581,7 +626,7 @@
|
|
|
581
626
|
"kind": "js",
|
|
582
627
|
"name": "PrimerIcon",
|
|
583
628
|
"declaration": {
|
|
584
|
-
"name": "
|
|
629
|
+
"name": "Ye",
|
|
585
630
|
"module": "dist/primer-loader.js"
|
|
586
631
|
}
|
|
587
632
|
},
|
|
@@ -589,7 +634,7 @@
|
|
|
589
634
|
"kind": "js",
|
|
590
635
|
"name": "PrimerKlarna",
|
|
591
636
|
"declaration": {
|
|
592
|
-
"name": "
|
|
637
|
+
"name": "Ce",
|
|
593
638
|
"module": "dist/primer-loader.js"
|
|
594
639
|
}
|
|
595
640
|
},
|
|
@@ -597,7 +642,7 @@
|
|
|
597
642
|
"kind": "js",
|
|
598
643
|
"name": "PrimerMain",
|
|
599
644
|
"declaration": {
|
|
600
|
-
"name": "
|
|
645
|
+
"name": "Bt",
|
|
601
646
|
"module": "dist/primer-loader.js"
|
|
602
647
|
}
|
|
603
648
|
},
|
|
@@ -613,7 +658,7 @@
|
|
|
613
658
|
"kind": "js",
|
|
614
659
|
"name": "QRCode",
|
|
615
660
|
"declaration": {
|
|
616
|
-
"name": "
|
|
661
|
+
"name": "Ee",
|
|
617
662
|
"module": "dist/primer-loader.js"
|
|
618
663
|
}
|
|
619
664
|
},
|
|
@@ -621,7 +666,7 @@
|
|
|
621
666
|
"kind": "js",
|
|
622
667
|
"name": "RedirectPayment",
|
|
623
668
|
"declaration": {
|
|
624
|
-
"name": "
|
|
669
|
+
"name": "Ze",
|
|
625
670
|
"module": "dist/primer-loader.js"
|
|
626
671
|
}
|
|
627
672
|
},
|
|
@@ -629,7 +674,7 @@
|
|
|
629
674
|
"kind": "js",
|
|
630
675
|
"name": "Select",
|
|
631
676
|
"declaration": {
|
|
632
|
-
"name": "
|
|
677
|
+
"name": "be",
|
|
633
678
|
"module": "dist/primer-loader.js"
|
|
634
679
|
}
|
|
635
680
|
},
|
|
@@ -637,7 +682,7 @@
|
|
|
637
682
|
"kind": "js",
|
|
638
683
|
"name": "ShowOtherPayments",
|
|
639
684
|
"declaration": {
|
|
640
|
-
"name": "
|
|
685
|
+
"name": "Ge",
|
|
641
686
|
"module": "dist/primer-loader.js"
|
|
642
687
|
}
|
|
643
688
|
},
|
|
@@ -645,7 +690,7 @@
|
|
|
645
690
|
"kind": "js",
|
|
646
691
|
"name": "Spinner",
|
|
647
692
|
"declaration": {
|
|
648
|
-
"name": "
|
|
693
|
+
"name": "He",
|
|
649
694
|
"module": "dist/primer-loader.js"
|
|
650
695
|
}
|
|
651
696
|
},
|
|
@@ -661,7 +706,7 @@
|
|
|
661
706
|
"kind": "js",
|
|
662
707
|
"name": "VaultDeleteConfirmation",
|
|
663
708
|
"declaration": {
|
|
664
|
-
"name": "
|
|
709
|
+
"name": "we",
|
|
665
710
|
"module": "dist/primer-loader.js"
|
|
666
711
|
}
|
|
667
712
|
},
|
|
@@ -669,7 +714,7 @@
|
|
|
669
714
|
"kind": "js",
|
|
670
715
|
"name": "VaultEmptyState",
|
|
671
716
|
"declaration": {
|
|
672
|
-
"name": "
|
|
717
|
+
"name": "lt",
|
|
673
718
|
"module": "dist/primer-loader.js"
|
|
674
719
|
}
|
|
675
720
|
},
|
|
@@ -677,7 +722,7 @@
|
|
|
677
722
|
"kind": "js",
|
|
678
723
|
"name": "VaultErrorMessage",
|
|
679
724
|
"declaration": {
|
|
680
|
-
"name": "
|
|
725
|
+
"name": "We",
|
|
681
726
|
"module": "dist/primer-loader.js"
|
|
682
727
|
}
|
|
683
728
|
},
|
|
@@ -685,7 +730,7 @@
|
|
|
685
730
|
"kind": "js",
|
|
686
731
|
"name": "VaultManager",
|
|
687
732
|
"declaration": {
|
|
688
|
-
"name": "
|
|
733
|
+
"name": "se",
|
|
689
734
|
"module": "dist/primer-loader.js"
|
|
690
735
|
}
|
|
691
736
|
},
|
|
@@ -701,7 +746,7 @@
|
|
|
701
746
|
"kind": "js",
|
|
702
747
|
"name": "VaultPaymentMethodItem",
|
|
703
748
|
"declaration": {
|
|
704
|
-
"name": "
|
|
749
|
+
"name": "Ne",
|
|
705
750
|
"module": "dist/primer-loader.js"
|
|
706
751
|
}
|
|
707
752
|
},
|
|
@@ -717,7 +762,7 @@
|
|
|
717
762
|
"kind": "js",
|
|
718
763
|
"name": "injectDarkTheme",
|
|
719
764
|
"declaration": {
|
|
720
|
-
"name": "
|
|
765
|
+
"name": "Sg",
|
|
721
766
|
"module": "dist/primer-loader.js"
|
|
722
767
|
}
|
|
723
768
|
},
|
|
@@ -725,7 +770,7 @@
|
|
|
725
770
|
"kind": "js",
|
|
726
771
|
"name": "injectLightTheme",
|
|
727
772
|
"declaration": {
|
|
728
|
-
"name": "
|
|
773
|
+
"name": "Cg",
|
|
729
774
|
"module": "dist/primer-loader.js"
|
|
730
775
|
}
|
|
731
776
|
},
|
|
@@ -733,7 +778,7 @@
|
|
|
733
778
|
"kind": "js",
|
|
734
779
|
"name": "injectLoaderStyles",
|
|
735
780
|
"declaration": {
|
|
736
|
-
"name": "
|
|
781
|
+
"name": "Wl",
|
|
737
782
|
"module": "dist/primer-loader.js"
|
|
738
783
|
}
|
|
739
784
|
},
|
|
@@ -741,7 +786,7 @@
|
|
|
741
786
|
"kind": "js",
|
|
742
787
|
"name": "injectThemeStyles",
|
|
743
788
|
"declaration": {
|
|
744
|
-
"name": "
|
|
789
|
+
"name": "Jl",
|
|
745
790
|
"module": "dist/primer-loader.js"
|
|
746
791
|
}
|
|
747
792
|
},
|
|
@@ -749,41 +794,12 @@
|
|
|
749
794
|
"kind": "js",
|
|
750
795
|
"name": "loadPrimer",
|
|
751
796
|
"declaration": {
|
|
752
|
-
"name": "
|
|
797
|
+
"name": "yB",
|
|
753
798
|
"module": "dist/primer-loader.js"
|
|
754
799
|
}
|
|
755
800
|
}
|
|
756
801
|
]
|
|
757
802
|
},
|
|
758
|
-
{
|
|
759
|
-
"kind": "javascript-module",
|
|
760
|
-
"path": "e2e/utils.ts",
|
|
761
|
-
"declarations": [
|
|
762
|
-
{
|
|
763
|
-
"kind": "variable",
|
|
764
|
-
"name": "test",
|
|
765
|
-
"default": "chromaticTest"
|
|
766
|
-
}
|
|
767
|
-
],
|
|
768
|
-
"exports": [
|
|
769
|
-
{
|
|
770
|
-
"kind": "js",
|
|
771
|
-
"name": "expect",
|
|
772
|
-
"declaration": {
|
|
773
|
-
"name": "expect",
|
|
774
|
-
"package": "@chromatic-com/playwright"
|
|
775
|
-
}
|
|
776
|
-
},
|
|
777
|
-
{
|
|
778
|
-
"kind": "js",
|
|
779
|
-
"name": "test",
|
|
780
|
-
"declaration": {
|
|
781
|
-
"name": "test",
|
|
782
|
-
"module": "e2e/utils.ts"
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
]
|
|
786
|
-
},
|
|
787
803
|
{
|
|
788
804
|
"kind": "javascript-module",
|
|
789
805
|
"path": "src/consts.ts",
|
|
@@ -1657,49 +1673,240 @@
|
|
|
1657
1673
|
},
|
|
1658
1674
|
{
|
|
1659
1675
|
"kind": "javascript-module",
|
|
1660
|
-
"path": "
|
|
1676
|
+
"path": "e2e/mocks/billing-address.ts",
|
|
1661
1677
|
"declarations": [
|
|
1662
1678
|
{
|
|
1663
1679
|
"kind": "variable",
|
|
1664
|
-
"name": "
|
|
1665
|
-
"
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
"kind": "js",
|
|
1671
|
-
"name": "templates",
|
|
1672
|
-
"declaration": {
|
|
1673
|
-
"name": "o",
|
|
1674
|
-
"module": "dist/chunks/ar.BIHRX5RF.js"
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
]
|
|
1678
|
-
},
|
|
1679
|
-
{
|
|
1680
|
-
"kind": "javascript-module",
|
|
1681
|
-
"path": "dist/chunks/bg.FGU6YCAF.js",
|
|
1682
|
-
"declarations": [
|
|
1680
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
1681
|
+
"type": {
|
|
1682
|
+
"text": "object"
|
|
1683
|
+
},
|
|
1684
|
+
"default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [ { type: 'BILLING_ADDRESS', options: { firstName: false, lastName: false, city: true, countryCode: true, postalCode: true, addressLine1: true, addressLine2: true, state: false, }, }, ], clientSession: { clientSessionId: '0ad5b471-5b80-436b-ad03-57850585e3fd', order: { orderId: '12577', currencyCode: 'EUR', countryCode: 'FR', totalOrderAmount: 1050, merchantAmount: 1050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer123', billingAddress: { firstName: 'testt', lastName: 'test', postalCode: '51662', addressLine1: 'aksjlkajl', addressLine2: 'jfjkahk', countryCode: 'PL', city: 'wroclaw', state: 'test', }, shippingAddress: {}, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '75dc7012-785c-443a-80b1-0e1f88fd4fad', env: 'SANDBOX', paymentMethods: [ { id: '42e32c6e-7faa-4f5a-97d0-9c4f7b848ae1', type: 'APPLE_PAY', options: { merchantId: '75dc7012785c443a80b10e1f88fd4fad', merchantName: 'Primer', merchantDomains: [], }, implementationType: 'NATIVE_SDK', name: 'Apple Pay', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
|
|
1685
|
+
},
|
|
1683
1686
|
{
|
|
1684
1687
|
"kind": "variable",
|
|
1685
|
-
"name": "
|
|
1686
|
-
"
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1688
|
+
"name": "CARD_NUMBER",
|
|
1689
|
+
"type": {
|
|
1690
|
+
"text": "string"
|
|
1691
|
+
},
|
|
1692
|
+
"default": "'4242 4242 4242 4242'"
|
|
1693
|
+
},
|
|
1690
1694
|
{
|
|
1691
|
-
"kind": "
|
|
1692
|
-
"name": "
|
|
1693
|
-
"
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1695
|
+
"kind": "function",
|
|
1696
|
+
"name": "mockBinData",
|
|
1697
|
+
"parameters": [
|
|
1698
|
+
{
|
|
1699
|
+
"name": "page",
|
|
1700
|
+
"type": {
|
|
1701
|
+
"text": "Page"
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
]
|
|
1705
|
+
},
|
|
1706
|
+
{
|
|
1707
|
+
"kind": "function",
|
|
1708
|
+
"name": "mockPaymentInstruments",
|
|
1709
|
+
"parameters": [
|
|
1710
|
+
{
|
|
1711
|
+
"name": "page",
|
|
1712
|
+
"type": {
|
|
1713
|
+
"text": "Page"
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
]
|
|
1717
|
+
},
|
|
1718
|
+
{
|
|
1719
|
+
"kind": "function",
|
|
1720
|
+
"name": "mockPayments",
|
|
1721
|
+
"parameters": [
|
|
1722
|
+
{
|
|
1723
|
+
"name": "page",
|
|
1724
|
+
"type": {
|
|
1725
|
+
"text": "Page"
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
]
|
|
1729
|
+
}
|
|
1730
|
+
],
|
|
1731
|
+
"exports": [
|
|
1732
|
+
{
|
|
1733
|
+
"kind": "js",
|
|
1734
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
1735
|
+
"declaration": {
|
|
1736
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
1737
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
1738
|
+
}
|
|
1739
|
+
},
|
|
1740
|
+
{
|
|
1741
|
+
"kind": "js",
|
|
1742
|
+
"name": "CARD_NUMBER",
|
|
1743
|
+
"declaration": {
|
|
1744
|
+
"name": "CARD_NUMBER",
|
|
1745
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
1746
|
+
}
|
|
1747
|
+
},
|
|
1748
|
+
{
|
|
1749
|
+
"kind": "js",
|
|
1750
|
+
"name": "mockBinData",
|
|
1751
|
+
"declaration": {
|
|
1752
|
+
"name": "mockBinData",
|
|
1753
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
1754
|
+
}
|
|
1755
|
+
},
|
|
1756
|
+
{
|
|
1757
|
+
"kind": "js",
|
|
1758
|
+
"name": "mockPaymentInstruments",
|
|
1759
|
+
"declaration": {
|
|
1760
|
+
"name": "mockPaymentInstruments",
|
|
1761
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
1762
|
+
}
|
|
1763
|
+
},
|
|
1764
|
+
{
|
|
1765
|
+
"kind": "js",
|
|
1766
|
+
"name": "mockPayments",
|
|
1767
|
+
"declaration": {
|
|
1768
|
+
"name": "mockPayments",
|
|
1769
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
]
|
|
1773
|
+
},
|
|
1774
|
+
{
|
|
1775
|
+
"kind": "javascript-module",
|
|
1776
|
+
"path": "e2e/mocks/paypal.ts",
|
|
1777
|
+
"declarations": [
|
|
1778
|
+
{
|
|
1779
|
+
"kind": "variable",
|
|
1780
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
1781
|
+
"type": {
|
|
1782
|
+
"text": "object"
|
|
1783
|
+
},
|
|
1784
|
+
"default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [], clientSession: { clientSessionId: 'f2868f83-9f30-44d0-ae15-c67d6424badc', order: { orderId: '1257721757579', currencyCode: 'USD', countryCode: 'FR', totalOrderAmount: 5050, merchantAmount: 5050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 4950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer1234367', billingAddress: { countryCode: 'FR', }, shippingAddress: { firstName: 'test', lastName: 'test', postalCode: '51786', addressLine1: 'test', addressLine2: 'test', countryCode: 'FR', city: 'test', }, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '33c6e1fc-5199-43ed-a734-acd3deb27d81', env: 'SANDBOX', paymentMethods: [ { id: 'a04ecba7-cc9d-40de-96b9-7bd6a85b4e0d', type: 'GOOGLE_PAY', options: { merchantId: 'Chris', merchantName: 'Chisisthebest', type: 'GOOGLE_PAY', }, implementationType: 'NATIVE_SDK', name: 'Google Pay', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', dark: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-light@3x.png', }, backgroundColor: { colored: '#000000', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 1, dark: 1, light: 1, }, borderColor: { colored: '#8E8E93', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '1c2bb0fc-d8ed-4399-9154-2aba015ec50a', type: 'BRAINTREE_VENMO', options: { merchantId: 'primer', merchantAccountId: 'cde7e786-5324-5e41-9694-1aa394ed5be1', }, processorConfigId: '52bef1ae-fdfc-4cae-bb91-3fb9b81a7b5a', implementationType: 'WEB_REDIRECT', name: 'Venmo', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-light@3x.png', }, backgroundColor: { colored: '#008CFF', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, { id: '2fc60a42-3729-40c4-bf52-4427e87db7eb', type: 'KLARNA', options: { merchantId: 'PK55462', merchantAccountId: 'fcd08555-1d1a-588f-b7d7-c3058b9fcd26', clientId: 'PK55462', }, processorConfigId: 'a38c95ba-8381-4bd7-b7c5-07f36c1f0a98', implementationType: 'NATIVE_SDK', name: 'Klarna', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-light@3x.png', }, backgroundColor: { colored: '#FFB3C7', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { colored: '#FFB3C7', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '30294d7c-d820-470e-9d43-5b701cd925d8', type: 'PAYPAL', options: { merchantId: 'Default Application', merchantAccountId: '49989e77-764d-585f-b66c-3ea34551094b', clientId: 'AW0qJdOMrgWr2ste9V9pZ1njg3tilO-8P9-vkSfm9e0f82wlXfsAxjoNSCmu-xGfFd6vqNM9XAHB6vX_', intent: 'authorize', }, processorConfigId: 'bf904deb-a083-4168-883d-f55eb142e993', implementationType: 'NATIVE_SDK', name: 'PayPal', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo-dark@3x.png', }, backgroundColor: { colored: '#FFC439', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
|
|
1785
|
+
}
|
|
1786
|
+
],
|
|
1787
|
+
"exports": [
|
|
1788
|
+
{
|
|
1789
|
+
"kind": "js",
|
|
1790
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
1791
|
+
"declaration": {
|
|
1792
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
1793
|
+
"module": "e2e/mocks/paypal.ts"
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
]
|
|
1797
|
+
},
|
|
1798
|
+
{
|
|
1799
|
+
"kind": "javascript-module",
|
|
1800
|
+
"path": "e2e/mocks/shared.ts",
|
|
1801
|
+
"declarations": [
|
|
1802
|
+
{
|
|
1803
|
+
"kind": "function",
|
|
1804
|
+
"name": "mockConfigurationCall",
|
|
1805
|
+
"parameters": [
|
|
1806
|
+
{
|
|
1807
|
+
"name": "page",
|
|
1808
|
+
"type": {
|
|
1809
|
+
"text": "Page"
|
|
1810
|
+
}
|
|
1811
|
+
},
|
|
1812
|
+
{
|
|
1813
|
+
"name": "config",
|
|
1814
|
+
"type": {
|
|
1815
|
+
"text": "unknown"
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
]
|
|
1819
|
+
},
|
|
1820
|
+
{
|
|
1821
|
+
"kind": "function",
|
|
1822
|
+
"name": "mockDemoUrl",
|
|
1823
|
+
"parameters": [
|
|
1824
|
+
{
|
|
1825
|
+
"name": "primerCheckoutOptions",
|
|
1826
|
+
"optional": true,
|
|
1827
|
+
"type": {
|
|
1828
|
+
"text": "PrimerCheckoutOptions"
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
]
|
|
1832
|
+
}
|
|
1833
|
+
],
|
|
1834
|
+
"exports": [
|
|
1835
|
+
{
|
|
1836
|
+
"kind": "js",
|
|
1837
|
+
"name": "mockConfigurationCall",
|
|
1838
|
+
"declaration": {
|
|
1839
|
+
"name": "mockConfigurationCall",
|
|
1840
|
+
"module": "e2e/mocks/shared.ts"
|
|
1841
|
+
}
|
|
1842
|
+
},
|
|
1843
|
+
{
|
|
1844
|
+
"kind": "js",
|
|
1845
|
+
"name": "mockDemoUrl",
|
|
1846
|
+
"declaration": {
|
|
1847
|
+
"name": "mockDemoUrl",
|
|
1848
|
+
"module": "e2e/mocks/shared.ts"
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
]
|
|
1852
|
+
},
|
|
1853
|
+
{
|
|
1854
|
+
"kind": "javascript-module",
|
|
1855
|
+
"path": "e2e/tests/card-form-billing-address.spec.ts",
|
|
1856
|
+
"declarations": [],
|
|
1857
|
+
"exports": []
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
"kind": "javascript-module",
|
|
1861
|
+
"path": "e2e/tests/paypal.spec.ts",
|
|
1862
|
+
"declarations": [],
|
|
1863
|
+
"exports": []
|
|
1864
|
+
},
|
|
1865
|
+
{
|
|
1866
|
+
"kind": "javascript-module",
|
|
1867
|
+
"path": "dist/chunks/ar.BIHRX5RF.js",
|
|
1868
|
+
"declarations": [
|
|
1869
|
+
{
|
|
1870
|
+
"kind": "variable",
|
|
1871
|
+
"name": "o",
|
|
1872
|
+
"default": "e"
|
|
1873
|
+
}
|
|
1874
|
+
],
|
|
1875
|
+
"exports": [
|
|
1876
|
+
{
|
|
1877
|
+
"kind": "js",
|
|
1878
|
+
"name": "templates",
|
|
1879
|
+
"declaration": {
|
|
1880
|
+
"name": "o",
|
|
1881
|
+
"module": "dist/chunks/ar.BIHRX5RF.js"
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
]
|
|
1885
|
+
},
|
|
1886
|
+
{
|
|
1887
|
+
"kind": "javascript-module",
|
|
1888
|
+
"path": "dist/chunks/bg.FGU6YCAF.js",
|
|
1889
|
+
"declarations": [
|
|
1890
|
+
{
|
|
1891
|
+
"kind": "variable",
|
|
1892
|
+
"name": "o",
|
|
1893
|
+
"default": "e"
|
|
1894
|
+
}
|
|
1895
|
+
],
|
|
1896
|
+
"exports": [
|
|
1897
|
+
{
|
|
1898
|
+
"kind": "js",
|
|
1899
|
+
"name": "templates",
|
|
1900
|
+
"declaration": {
|
|
1901
|
+
"name": "o",
|
|
1902
|
+
"module": "dist/chunks/bg.FGU6YCAF.js"
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
]
|
|
1906
|
+
},
|
|
1907
|
+
{
|
|
1908
|
+
"kind": "javascript-module",
|
|
1909
|
+
"path": "dist/chunks/ca.IKG75KNP.js",
|
|
1703
1910
|
"declarations": [
|
|
1704
1911
|
{
|
|
1705
1912
|
"kind": "variable",
|
|
@@ -2641,343 +2848,152 @@
|
|
|
2641
2848
|
}
|
|
2642
2849
|
]
|
|
2643
2850
|
},
|
|
2644
|
-
{
|
|
2645
|
-
"kind": "javascript-module",
|
|
2646
|
-
"path": "dist/chunks/tr.E2CHOIPA.js",
|
|
2647
|
-
"declarations": [
|
|
2648
|
-
{
|
|
2649
|
-
"kind": "variable",
|
|
2650
|
-
"name": "n",
|
|
2651
|
-
"default": "e"
|
|
2652
|
-
}
|
|
2653
|
-
],
|
|
2654
|
-
"exports": [
|
|
2655
|
-
{
|
|
2656
|
-
"kind": "js",
|
|
2657
|
-
"name": "templates",
|
|
2658
|
-
"declaration": {
|
|
2659
|
-
"name": "n",
|
|
2660
|
-
"module": "dist/chunks/tr.E2CHOIPA.js"
|
|
2661
|
-
}
|
|
2662
|
-
}
|
|
2663
|
-
]
|
|
2664
|
-
},
|
|
2665
|
-
{
|
|
2666
|
-
"kind": "javascript-module",
|
|
2667
|
-
"path": "dist/chunks/uk-UA.QYJJIGTW.js",
|
|
2668
|
-
"declarations": [
|
|
2669
|
-
{
|
|
2670
|
-
"kind": "variable",
|
|
2671
|
-
"name": "o",
|
|
2672
|
-
"default": "e"
|
|
2673
|
-
}
|
|
2674
|
-
],
|
|
2675
|
-
"exports": [
|
|
2676
|
-
{
|
|
2677
|
-
"kind": "js",
|
|
2678
|
-
"name": "templates",
|
|
2679
|
-
"declaration": {
|
|
2680
|
-
"name": "o",
|
|
2681
|
-
"module": "dist/chunks/uk-UA.QYJJIGTW.js"
|
|
2682
|
-
}
|
|
2683
|
-
}
|
|
2684
|
-
]
|
|
2685
|
-
},
|
|
2686
|
-
{
|
|
2687
|
-
"kind": "javascript-module",
|
|
2688
|
-
"path": "dist/chunks/vi.YGBNA3NJ.js",
|
|
2689
|
-
"declarations": [
|
|
2690
|
-
{
|
|
2691
|
-
"kind": "variable",
|
|
2692
|
-
"name": "a",
|
|
2693
|
-
"default": "n"
|
|
2694
|
-
}
|
|
2695
|
-
],
|
|
2696
|
-
"exports": [
|
|
2697
|
-
{
|
|
2698
|
-
"kind": "js",
|
|
2699
|
-
"name": "templates",
|
|
2700
|
-
"declaration": {
|
|
2701
|
-
"name": "a",
|
|
2702
|
-
"module": "dist/chunks/vi.YGBNA3NJ.js"
|
|
2703
|
-
}
|
|
2704
|
-
}
|
|
2705
|
-
]
|
|
2706
|
-
},
|
|
2707
|
-
{
|
|
2708
|
-
"kind": "javascript-module",
|
|
2709
|
-
"path": "dist/chunks/zf.LNP32XVM.js",
|
|
2710
|
-
"declarations": [
|
|
2711
|
-
{
|
|
2712
|
-
"kind": "variable",
|
|
2713
|
-
"name": "a",
|
|
2714
|
-
"default": "t"
|
|
2715
|
-
}
|
|
2716
|
-
],
|
|
2717
|
-
"exports": [
|
|
2718
|
-
{
|
|
2719
|
-
"kind": "js",
|
|
2720
|
-
"name": "templates",
|
|
2721
|
-
"declaration": {
|
|
2722
|
-
"name": "a",
|
|
2723
|
-
"module": "dist/chunks/zf.LNP32XVM.js"
|
|
2724
|
-
}
|
|
2725
|
-
}
|
|
2726
|
-
]
|
|
2727
|
-
},
|
|
2728
|
-
{
|
|
2729
|
-
"kind": "javascript-module",
|
|
2730
|
-
"path": "dist/chunks/zh-CN.SRN7TXMD.js",
|
|
2731
|
-
"declarations": [
|
|
2732
|
-
{
|
|
2733
|
-
"kind": "variable",
|
|
2734
|
-
"name": "o",
|
|
2735
|
-
"default": "e"
|
|
2736
|
-
}
|
|
2737
|
-
],
|
|
2738
|
-
"exports": [
|
|
2739
|
-
{
|
|
2740
|
-
"kind": "js",
|
|
2741
|
-
"name": "templates",
|
|
2742
|
-
"declaration": {
|
|
2743
|
-
"name": "o",
|
|
2744
|
-
"module": "dist/chunks/zh-CN.SRN7TXMD.js"
|
|
2745
|
-
}
|
|
2746
|
-
}
|
|
2747
|
-
]
|
|
2748
|
-
},
|
|
2749
|
-
{
|
|
2750
|
-
"kind": "javascript-module",
|
|
2751
|
-
"path": "dist/chunks/zh-HK.3JAKYZ5N.js",
|
|
2752
|
-
"declarations": [
|
|
2753
|
-
{
|
|
2754
|
-
"kind": "variable",
|
|
2755
|
-
"name": "o",
|
|
2756
|
-
"default": "e"
|
|
2757
|
-
}
|
|
2758
|
-
],
|
|
2759
|
-
"exports": [
|
|
2760
|
-
{
|
|
2761
|
-
"kind": "js",
|
|
2762
|
-
"name": "templates",
|
|
2763
|
-
"declaration": {
|
|
2764
|
-
"name": "o",
|
|
2765
|
-
"module": "dist/chunks/zh-HK.3JAKYZ5N.js"
|
|
2766
|
-
}
|
|
2767
|
-
}
|
|
2768
|
-
]
|
|
2769
|
-
},
|
|
2770
|
-
{
|
|
2771
|
-
"kind": "javascript-module",
|
|
2772
|
-
"path": "dist/chunks/zh-TW.WTNQLAHV.js",
|
|
2773
|
-
"declarations": [
|
|
2774
|
-
{
|
|
2775
|
-
"kind": "variable",
|
|
2776
|
-
"name": "o",
|
|
2777
|
-
"default": "e"
|
|
2778
|
-
}
|
|
2779
|
-
],
|
|
2780
|
-
"exports": [
|
|
2781
|
-
{
|
|
2782
|
-
"kind": "js",
|
|
2783
|
-
"name": "templates",
|
|
2784
|
-
"declaration": {
|
|
2785
|
-
"name": "o",
|
|
2786
|
-
"module": "dist/chunks/zh-TW.WTNQLAHV.js"
|
|
2787
|
-
}
|
|
2788
|
-
}
|
|
2789
|
-
]
|
|
2790
|
-
},
|
|
2791
|
-
{
|
|
2792
|
-
"kind": "javascript-module",
|
|
2793
|
-
"path": "e2e/mocks/billing-address.ts",
|
|
2794
|
-
"declarations": [
|
|
2795
|
-
{
|
|
2796
|
-
"kind": "variable",
|
|
2797
|
-
"name": "CONFIGURATION_RESPONSE",
|
|
2798
|
-
"type": {
|
|
2799
|
-
"text": "object"
|
|
2800
|
-
},
|
|
2801
|
-
"default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [ { type: 'BILLING_ADDRESS', options: { firstName: false, lastName: false, city: true, countryCode: true, postalCode: true, addressLine1: true, addressLine2: true, state: false, }, }, ], clientSession: { clientSessionId: '0ad5b471-5b80-436b-ad03-57850585e3fd', order: { orderId: '12577', currencyCode: 'EUR', countryCode: 'FR', totalOrderAmount: 1050, merchantAmount: 1050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer123', billingAddress: { firstName: 'testt', lastName: 'test', postalCode: '51662', addressLine1: 'aksjlkajl', addressLine2: 'jfjkahk', countryCode: 'PL', city: 'wroclaw', state: 'test', }, shippingAddress: {}, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '75dc7012-785c-443a-80b1-0e1f88fd4fad', env: 'SANDBOX', paymentMethods: [ { id: '42e32c6e-7faa-4f5a-97d0-9c4f7b848ae1', type: 'APPLE_PAY', options: { merchantId: '75dc7012785c443a80b10e1f88fd4fad', merchantName: 'Primer', merchantDomains: [], }, implementationType: 'NATIVE_SDK', name: 'Apple Pay', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
|
|
2802
|
-
},
|
|
2803
|
-
{
|
|
2804
|
-
"kind": "variable",
|
|
2805
|
-
"name": "CARD_NUMBER",
|
|
2806
|
-
"type": {
|
|
2807
|
-
"text": "string"
|
|
2808
|
-
},
|
|
2809
|
-
"default": "'4242 4242 4242 4242'"
|
|
2810
|
-
},
|
|
2811
|
-
{
|
|
2812
|
-
"kind": "function",
|
|
2813
|
-
"name": "mockBinData",
|
|
2814
|
-
"parameters": [
|
|
2815
|
-
{
|
|
2816
|
-
"name": "page",
|
|
2817
|
-
"type": {
|
|
2818
|
-
"text": "Page"
|
|
2819
|
-
}
|
|
2820
|
-
}
|
|
2821
|
-
]
|
|
2822
|
-
},
|
|
2823
|
-
{
|
|
2824
|
-
"kind": "function",
|
|
2825
|
-
"name": "mockPaymentInstruments",
|
|
2826
|
-
"parameters": [
|
|
2827
|
-
{
|
|
2828
|
-
"name": "page",
|
|
2829
|
-
"type": {
|
|
2830
|
-
"text": "Page"
|
|
2831
|
-
}
|
|
2832
|
-
}
|
|
2833
|
-
]
|
|
2834
|
-
},
|
|
2835
|
-
{
|
|
2836
|
-
"kind": "function",
|
|
2837
|
-
"name": "mockPayments",
|
|
2838
|
-
"parameters": [
|
|
2839
|
-
{
|
|
2840
|
-
"name": "page",
|
|
2841
|
-
"type": {
|
|
2842
|
-
"text": "Page"
|
|
2843
|
-
}
|
|
2844
|
-
}
|
|
2845
|
-
]
|
|
2851
|
+
{
|
|
2852
|
+
"kind": "javascript-module",
|
|
2853
|
+
"path": "dist/chunks/tr.E2CHOIPA.js",
|
|
2854
|
+
"declarations": [
|
|
2855
|
+
{
|
|
2856
|
+
"kind": "variable",
|
|
2857
|
+
"name": "n",
|
|
2858
|
+
"default": "e"
|
|
2846
2859
|
}
|
|
2847
2860
|
],
|
|
2848
2861
|
"exports": [
|
|
2849
2862
|
{
|
|
2850
2863
|
"kind": "js",
|
|
2851
|
-
"name": "
|
|
2864
|
+
"name": "templates",
|
|
2852
2865
|
"declaration": {
|
|
2853
|
-
"name": "
|
|
2854
|
-
"module": "
|
|
2866
|
+
"name": "n",
|
|
2867
|
+
"module": "dist/chunks/tr.E2CHOIPA.js"
|
|
2855
2868
|
}
|
|
2856
|
-
}
|
|
2869
|
+
}
|
|
2870
|
+
]
|
|
2871
|
+
},
|
|
2872
|
+
{
|
|
2873
|
+
"kind": "javascript-module",
|
|
2874
|
+
"path": "dist/chunks/uk-UA.QYJJIGTW.js",
|
|
2875
|
+
"declarations": [
|
|
2857
2876
|
{
|
|
2858
|
-
"kind": "
|
|
2859
|
-
"name": "
|
|
2860
|
-
"
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
},
|
|
2877
|
+
"kind": "variable",
|
|
2878
|
+
"name": "o",
|
|
2879
|
+
"default": "e"
|
|
2880
|
+
}
|
|
2881
|
+
],
|
|
2882
|
+
"exports": [
|
|
2865
2883
|
{
|
|
2866
2884
|
"kind": "js",
|
|
2867
|
-
"name": "
|
|
2885
|
+
"name": "templates",
|
|
2868
2886
|
"declaration": {
|
|
2869
|
-
"name": "
|
|
2870
|
-
"module": "
|
|
2887
|
+
"name": "o",
|
|
2888
|
+
"module": "dist/chunks/uk-UA.QYJJIGTW.js"
|
|
2871
2889
|
}
|
|
2872
|
-
}
|
|
2890
|
+
}
|
|
2891
|
+
]
|
|
2892
|
+
},
|
|
2893
|
+
{
|
|
2894
|
+
"kind": "javascript-module",
|
|
2895
|
+
"path": "dist/chunks/vi.YGBNA3NJ.js",
|
|
2896
|
+
"declarations": [
|
|
2873
2897
|
{
|
|
2874
|
-
"kind": "
|
|
2875
|
-
"name": "
|
|
2876
|
-
"
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
},
|
|
2898
|
+
"kind": "variable",
|
|
2899
|
+
"name": "a",
|
|
2900
|
+
"default": "n"
|
|
2901
|
+
}
|
|
2902
|
+
],
|
|
2903
|
+
"exports": [
|
|
2881
2904
|
{
|
|
2882
2905
|
"kind": "js",
|
|
2883
|
-
"name": "
|
|
2906
|
+
"name": "templates",
|
|
2884
2907
|
"declaration": {
|
|
2885
|
-
"name": "
|
|
2886
|
-
"module": "
|
|
2908
|
+
"name": "a",
|
|
2909
|
+
"module": "dist/chunks/vi.YGBNA3NJ.js"
|
|
2887
2910
|
}
|
|
2888
2911
|
}
|
|
2889
2912
|
]
|
|
2890
2913
|
},
|
|
2891
2914
|
{
|
|
2892
2915
|
"kind": "javascript-module",
|
|
2893
|
-
"path": "
|
|
2916
|
+
"path": "dist/chunks/zf.LNP32XVM.js",
|
|
2894
2917
|
"declarations": [
|
|
2895
2918
|
{
|
|
2896
2919
|
"kind": "variable",
|
|
2897
|
-
"name": "
|
|
2898
|
-
"
|
|
2899
|
-
"text": "object"
|
|
2900
|
-
},
|
|
2901
|
-
"default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [], clientSession: { clientSessionId: 'f2868f83-9f30-44d0-ae15-c67d6424badc', order: { orderId: '1257721757579', currencyCode: 'USD', countryCode: 'FR', totalOrderAmount: 5050, merchantAmount: 5050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 4950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer1234367', billingAddress: { countryCode: 'FR', }, shippingAddress: { firstName: 'test', lastName: 'test', postalCode: '51786', addressLine1: 'test', addressLine2: 'test', countryCode: 'FR', city: 'test', }, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '33c6e1fc-5199-43ed-a734-acd3deb27d81', env: 'SANDBOX', paymentMethods: [ { id: 'a04ecba7-cc9d-40de-96b9-7bd6a85b4e0d', type: 'GOOGLE_PAY', options: { merchantId: 'Chris', merchantName: 'Chisisthebest', type: 'GOOGLE_PAY', }, implementationType: 'NATIVE_SDK', name: 'Google Pay', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', dark: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-light@3x.png', }, backgroundColor: { colored: '#000000', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 1, dark: 1, light: 1, }, borderColor: { colored: '#8E8E93', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '1c2bb0fc-d8ed-4399-9154-2aba015ec50a', type: 'BRAINTREE_VENMO', options: { merchantId: 'primer', merchantAccountId: 'cde7e786-5324-5e41-9694-1aa394ed5be1', }, processorConfigId: '52bef1ae-fdfc-4cae-bb91-3fb9b81a7b5a', implementationType: 'WEB_REDIRECT', name: 'Venmo', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-light@3x.png', }, backgroundColor: { colored: '#008CFF', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, { id: '2fc60a42-3729-40c4-bf52-4427e87db7eb', type: 'KLARNA', options: { merchantId: 'PK55462', merchantAccountId: 'fcd08555-1d1a-588f-b7d7-c3058b9fcd26', clientId: 'PK55462', }, processorConfigId: 'a38c95ba-8381-4bd7-b7c5-07f36c1f0a98', implementationType: 'NATIVE_SDK', name: 'Klarna', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-light@3x.png', }, backgroundColor: { colored: '#FFB3C7', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { colored: '#FFB3C7', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '30294d7c-d820-470e-9d43-5b701cd925d8', type: 'PAYPAL', options: { merchantId: 'Default Application', merchantAccountId: '49989e77-764d-585f-b66c-3ea34551094b', clientId: 'AW0qJdOMrgWr2ste9V9pZ1njg3tilO-8P9-vkSfm9e0f82wlXfsAxjoNSCmu-xGfFd6vqNM9XAHB6vX_', intent: 'authorize', }, processorConfigId: 'bf904deb-a083-4168-883d-f55eb142e993', implementationType: 'NATIVE_SDK', name: 'PayPal', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo-dark@3x.png', }, backgroundColor: { colored: '#FFC439', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
|
|
2920
|
+
"name": "a",
|
|
2921
|
+
"default": "t"
|
|
2902
2922
|
}
|
|
2903
2923
|
],
|
|
2904
2924
|
"exports": [
|
|
2905
2925
|
{
|
|
2906
2926
|
"kind": "js",
|
|
2907
|
-
"name": "
|
|
2927
|
+
"name": "templates",
|
|
2908
2928
|
"declaration": {
|
|
2909
|
-
"name": "
|
|
2910
|
-
"module": "
|
|
2929
|
+
"name": "a",
|
|
2930
|
+
"module": "dist/chunks/zf.LNP32XVM.js"
|
|
2911
2931
|
}
|
|
2912
2932
|
}
|
|
2913
2933
|
]
|
|
2914
2934
|
},
|
|
2915
2935
|
{
|
|
2916
2936
|
"kind": "javascript-module",
|
|
2917
|
-
"path": "
|
|
2937
|
+
"path": "dist/chunks/zh-CN.SRN7TXMD.js",
|
|
2918
2938
|
"declarations": [
|
|
2919
2939
|
{
|
|
2920
|
-
"kind": "
|
|
2921
|
-
"name": "
|
|
2922
|
-
"
|
|
2923
|
-
{
|
|
2924
|
-
"name": "page",
|
|
2925
|
-
"type": {
|
|
2926
|
-
"text": "Page"
|
|
2927
|
-
}
|
|
2928
|
-
},
|
|
2929
|
-
{
|
|
2930
|
-
"name": "config",
|
|
2931
|
-
"type": {
|
|
2932
|
-
"text": "unknown"
|
|
2933
|
-
}
|
|
2934
|
-
}
|
|
2935
|
-
]
|
|
2936
|
-
},
|
|
2937
|
-
{
|
|
2938
|
-
"kind": "function",
|
|
2939
|
-
"name": "mockDemoUrl",
|
|
2940
|
-
"parameters": [
|
|
2941
|
-
{
|
|
2942
|
-
"name": "primerCheckoutOptions",
|
|
2943
|
-
"optional": true,
|
|
2944
|
-
"type": {
|
|
2945
|
-
"text": "PrimerCheckoutOptions"
|
|
2946
|
-
}
|
|
2947
|
-
}
|
|
2948
|
-
]
|
|
2940
|
+
"kind": "variable",
|
|
2941
|
+
"name": "o",
|
|
2942
|
+
"default": "e"
|
|
2949
2943
|
}
|
|
2950
2944
|
],
|
|
2951
2945
|
"exports": [
|
|
2952
2946
|
{
|
|
2953
2947
|
"kind": "js",
|
|
2954
|
-
"name": "
|
|
2948
|
+
"name": "templates",
|
|
2955
2949
|
"declaration": {
|
|
2956
|
-
"name": "
|
|
2957
|
-
"module": "
|
|
2950
|
+
"name": "o",
|
|
2951
|
+
"module": "dist/chunks/zh-CN.SRN7TXMD.js"
|
|
2958
2952
|
}
|
|
2959
|
-
}
|
|
2953
|
+
}
|
|
2954
|
+
]
|
|
2955
|
+
},
|
|
2956
|
+
{
|
|
2957
|
+
"kind": "javascript-module",
|
|
2958
|
+
"path": "dist/chunks/zh-HK.3JAKYZ5N.js",
|
|
2959
|
+
"declarations": [
|
|
2960
|
+
{
|
|
2961
|
+
"kind": "variable",
|
|
2962
|
+
"name": "o",
|
|
2963
|
+
"default": "e"
|
|
2964
|
+
}
|
|
2965
|
+
],
|
|
2966
|
+
"exports": [
|
|
2960
2967
|
{
|
|
2961
2968
|
"kind": "js",
|
|
2962
|
-
"name": "
|
|
2969
|
+
"name": "templates",
|
|
2963
2970
|
"declaration": {
|
|
2964
|
-
"name": "
|
|
2965
|
-
"module": "
|
|
2971
|
+
"name": "o",
|
|
2972
|
+
"module": "dist/chunks/zh-HK.3JAKYZ5N.js"
|
|
2966
2973
|
}
|
|
2967
2974
|
}
|
|
2968
2975
|
]
|
|
2969
2976
|
},
|
|
2970
2977
|
{
|
|
2971
2978
|
"kind": "javascript-module",
|
|
2972
|
-
"path": "
|
|
2973
|
-
"declarations": [
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
"exports": [
|
|
2979
|
+
"path": "dist/chunks/zh-TW.WTNQLAHV.js",
|
|
2980
|
+
"declarations": [
|
|
2981
|
+
{
|
|
2982
|
+
"kind": "variable",
|
|
2983
|
+
"name": "o",
|
|
2984
|
+
"default": "e"
|
|
2985
|
+
}
|
|
2986
|
+
],
|
|
2987
|
+
"exports": [
|
|
2988
|
+
{
|
|
2989
|
+
"kind": "js",
|
|
2990
|
+
"name": "templates",
|
|
2991
|
+
"declaration": {
|
|
2992
|
+
"name": "o",
|
|
2993
|
+
"module": "dist/chunks/zh-TW.WTNQLAHV.js"
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
]
|
|
2981
2997
|
},
|
|
2982
2998
|
{
|
|
2983
2999
|
"kind": "javascript-module",
|
|
@@ -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",
|
|
@@ -4534,7 +4586,7 @@
|
|
|
4534
4586
|
"type": {
|
|
4535
4587
|
"text": "ContextProvider<{\n __context__: ContextType;\n }>"
|
|
4536
4588
|
},
|
|
4537
|
-
"default": "new ContextProvider(host, { context, initialValue: structuredClone(initialContext), })"
|
|
4589
|
+
"default": "new ContextProvider(host, { context, initialValue: { ...structuredClone(initialContext), setProcessing: (isProcessing: boolean) => this.setSdkState({ isProcessing }), }, })"
|
|
4538
4590
|
},
|
|
4539
4591
|
{
|
|
4540
4592
|
"kind": "method",
|
|
@@ -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": [
|
|
@@ -11923,6 +12014,13 @@
|
|
|
11923
12014
|
"default": "false",
|
|
11924
12015
|
"attribute": "disabled"
|
|
11925
12016
|
},
|
|
12017
|
+
{
|
|
12018
|
+
"kind": "field",
|
|
12019
|
+
"name": "primerContext",
|
|
12020
|
+
"type": {
|
|
12021
|
+
"text": "ContextType | undefined"
|
|
12022
|
+
}
|
|
12023
|
+
},
|
|
11926
12024
|
{
|
|
11927
12025
|
"kind": "method",
|
|
11928
12026
|
"name": "_handleClick",
|
|
@@ -14101,6 +14199,13 @@
|
|
|
14101
14199
|
"type": {
|
|
14102
14200
|
"text": "VaultedPaymentMethod"
|
|
14103
14201
|
}
|
|
14202
|
+
},
|
|
14203
|
+
{
|
|
14204
|
+
"name": "telemetry",
|
|
14205
|
+
"optional": true,
|
|
14206
|
+
"type": {
|
|
14207
|
+
"text": "TelemetryClient"
|
|
14208
|
+
}
|
|
14104
14209
|
}
|
|
14105
14210
|
],
|
|
14106
14211
|
"description": "Get a formatted display for any payment method type\nThis is the main entry point for formatting payment methods"
|