@prohetamine/redstone 0.0.1
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/dist/PhArrowCircleDown-BR-zH4LC.js +14 -0
- package/dist/PhArrowCircleDown-Sb38khBy.mjs +73 -0
- package/dist/PhArrowClockwise-BE5j9P0Z.mjs +73 -0
- package/dist/PhArrowClockwise-BRaehQGe.js +14 -0
- package/dist/PhArrowDown-B_WmmmY9.js +14 -0
- package/dist/PhArrowDown-CFEyR2dR.mjs +73 -0
- package/dist/PhArrowLeft-CYfU7NZj.mjs +73 -0
- package/dist/PhArrowLeft-CkEd70hm.js +14 -0
- package/dist/PhArrowRight-C07Qkx86.js +14 -0
- package/dist/PhArrowRight-EermNu0V.mjs +73 -0
- package/dist/PhArrowSquareOut-BjTBfzOP.js +14 -0
- package/dist/PhArrowSquareOut-DZwTtw54.mjs +73 -0
- package/dist/PhArrowUp-DB4CCSss.js +14 -0
- package/dist/PhArrowUp-xTpLFQkg.mjs +73 -0
- package/dist/PhArrowUpRight-CQbvn6NO.mjs +73 -0
- package/dist/PhArrowUpRight-GpCIMsAh.js +14 -0
- package/dist/PhArrowsClockwise-BgcIUg-Z.js +14 -0
- package/dist/PhArrowsClockwise-DnUYZTVx.mjs +73 -0
- package/dist/PhArrowsDownUp-C8KXUqtu.js +14 -0
- package/dist/PhArrowsDownUp-DgoprEe2.mjs +73 -0
- package/dist/PhArrowsLeftRight-CahChzCj.js +14 -0
- package/dist/PhArrowsLeftRight-FD4AZiLh.mjs +73 -0
- package/dist/PhBank-DIqIL4x_.js +14 -0
- package/dist/PhBank-DbQOQ9zJ.mjs +73 -0
- package/dist/PhBrowser-BCBXK2IM.mjs +73 -0
- package/dist/PhBrowser-laCKtn7T.js +14 -0
- package/dist/PhCaretDown-CnjP-QjZ.mjs +73 -0
- package/dist/PhCaretDown-DDe42xDU.js +14 -0
- package/dist/PhCaretLeft-Cskc5OY9.js +14 -0
- package/dist/PhCaretLeft-DkuXxjf_.mjs +73 -0
- package/dist/PhCaretRight-CBWpghxt.mjs +73 -0
- package/dist/PhCaretRight-DNgI5w_B.js +14 -0
- package/dist/PhCaretUp-CQ-OztBV.mjs +73 -0
- package/dist/PhCaretUp-CUZ4g_Me.js +14 -0
- package/dist/PhCheck-BVV_Dwfo.js +14 -0
- package/dist/PhCheck-t515emYS.mjs +73 -0
- package/dist/PhCircleHalf-BuQTmrKW.mjs +73 -0
- package/dist/PhCircleHalf-DDC7rige.js +14 -0
- package/dist/PhClock-BqynEKWl.js +14 -0
- package/dist/PhClock-D6XkTmM_.mjs +73 -0
- package/dist/PhCompass-2QeeX5Ad.mjs +73 -0
- package/dist/PhCompass-BsuJwXAE.js +14 -0
- package/dist/PhCopy-CO34-_xD.mjs +73 -0
- package/dist/PhCopy-MVqtRS6X.js +14 -0
- package/dist/PhCreditCard-Dq4kdjCw.js +14 -0
- package/dist/PhCreditCard-bfnqYflD.mjs +73 -0
- package/dist/PhCurrencyDollar-6k8UWxal.js +14 -0
- package/dist/PhCurrencyDollar-BekVYPtC.mjs +73 -0
- package/dist/PhDesktop-BkNzf3rT.mjs +73 -0
- package/dist/PhDesktop-CfsXQ0vC.js +14 -0
- package/dist/PhDeviceMobile-BT3Mg_b0.mjs +73 -0
- package/dist/PhDeviceMobile-BnrrDrwf.js +14 -0
- package/dist/PhDotsThree-6LRvhAcL.js +14 -0
- package/dist/PhDotsThree-kpf2OKxJ.mjs +73 -0
- package/dist/PhEnvelope-CHsfC2e0.js +14 -0
- package/dist/PhEnvelope-UFKpKtwf.mjs +73 -0
- package/dist/PhFunnelSimple-CdAqSIhK.mjs +73 -0
- package/dist/PhFunnelSimple-JAk7X9Wo.js +14 -0
- package/dist/PhGlobe-B3RYXl8h.mjs +73 -0
- package/dist/PhGlobe-Tfs4MfpG.js +14 -0
- package/dist/PhIdentificationCard-Dqmd6eY1.js +14 -0
- package/dist/PhIdentificationCard-rSq59Czm.mjs +73 -0
- package/dist/PhImage-aEryzfCi.js +14 -0
- package/dist/PhImage-ynsEnFd_.mjs +73 -0
- package/dist/PhInfo-B7lsWl6m.mjs +73 -0
- package/dist/PhInfo-D6oUrWpA.js +14 -0
- package/dist/PhLightbulb-FQDaMMqu.mjs +73 -0
- package/dist/PhLightbulb-qbEduhPa.js +14 -0
- package/dist/PhMagnifyingGlass-COdRH2k5.js +14 -0
- package/dist/PhMagnifyingGlass-_NXk13-0.mjs +73 -0
- package/dist/PhPaperPlaneRight-BYi7SorW.mjs +73 -0
- package/dist/PhPaperPlaneRight-DrpVAQOZ.js +14 -0
- package/dist/PhPlus-25KQTPHG.mjs +73 -0
- package/dist/PhPlus-BhUXef08.js +14 -0
- package/dist/PhPower-BKl7gzsB.mjs +73 -0
- package/dist/PhPower-BNJf1AGQ.js +14 -0
- package/dist/PhPuzzlePiece-BkZeF8CX.js +14 -0
- package/dist/PhPuzzlePiece-BqUI4GRs.mjs +73 -0
- package/dist/PhQrCode-C-tqZKPP.mjs +73 -0
- package/dist/PhQrCode-C0v0iXQN.js +14 -0
- package/dist/PhQuestion-BBAiRWgt.js +14 -0
- package/dist/PhQuestion-CtYvffyD.mjs +73 -0
- package/dist/PhQuestionMark-BNbtL2yx.mjs +73 -0
- package/dist/PhQuestionMark-BvGUBZ1h.js +14 -0
- package/dist/PhSealCheck-B0TEqWpq.mjs +73 -0
- package/dist/PhSealCheck-BwNkuF7G.js +14 -0
- package/dist/PhSignOut-C1rMSNaS.js +14 -0
- package/dist/PhSignOut-HX2_BVsD.mjs +73 -0
- package/dist/PhSpinner-CoDYLYOX.mjs +73 -0
- package/dist/PhSpinner-nmsGWDQl.js +14 -0
- package/dist/PhTrash-CALlKx3e.js +14 -0
- package/dist/PhTrash-DeQHS8ZP.mjs +73 -0
- package/dist/PhUser-CA0e5OPI.js +14 -0
- package/dist/PhUser-Cy5EY3vX.mjs +73 -0
- package/dist/PhVault-DdXjVOO9.mjs +73 -0
- package/dist/PhVault-DqxV75cz.js +14 -0
- package/dist/PhWallet-CeQrfGYc.mjs +73 -0
- package/dist/PhWallet-CyCuEs2U.js +14 -0
- package/dist/PhWarning-BKaHv_wT.mjs +73 -0
- package/dist/PhWarning-C7oj86bY.js +14 -0
- package/dist/PhWarningCircle-8MWw-QgE.mjs +73 -0
- package/dist/PhWarningCircle-CrNPXGj4.js +14 -0
- package/dist/PhX-9lsrXjyl.js +14 -0
- package/dist/PhX-DgXr_Fb0.mjs +73 -0
- package/dist/ReownAuthentication-Bfv31LzI.mjs +274 -0
- package/dist/ReownAuthentication-d8aYgGOq.js +5 -0
- package/dist/SwapController-4lzoYsYr.js +1 -0
- package/dist/SwapController-DjzUWRyQ.mjs +462 -0
- package/dist/ccip-CvwbEhki.js +1 -0
- package/dist/ccip-TuO68NeE.mjs +150 -0
- package/dist/data-capture-BwdjH2vc.mjs +489 -0
- package/dist/data-capture-xVUNZJ2T.js +242 -0
- package/dist/email-BCZObJCY.js +90 -0
- package/dist/email-m-wo60fN.mjs +338 -0
- package/dist/embedded-wallet-CGSri-4g.js +410 -0
- package/dist/embedded-wallet-DdZmv5qP.mjs +808 -0
- package/dist/features-BJ8kNaE8.js +1 -0
- package/dist/features-CJ34oImB.mjs +6 -0
- package/dist/index-4lfXeo30.js +132 -0
- package/dist/index-B6Mg114Z.mjs +69182 -0
- package/dist/index-BX7gAgT3.mjs +35 -0
- package/dist/index-BYQqNbCe.js +1 -0
- package/dist/index-BmdHwtJo.js +1 -0
- package/dist/index-BvUx3ULC.js +78 -0
- package/dist/index-CD-QGO70.mjs +196 -0
- package/dist/index-CJtXfdoM.mjs +29621 -0
- package/dist/index-CMzdgE-y.mjs +215 -0
- package/dist/index-CjZQCcwG.js +7203 -0
- package/dist/index-D7VuOaCI.js +19 -0
- package/dist/index-DV7SQwgn.mjs +2688 -0
- package/dist/index-DVf4BnNh.mjs +352 -0
- package/dist/index-DhN9vL4k.js +138 -0
- package/dist/index-DvllakY0.mjs +274 -0
- package/dist/index-Ho06VKh2.mjs +151 -0
- package/dist/index-a8mS2Eh1.js +1062 -0
- package/dist/index-aamBi9Tu.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.es.js +14 -0
- package/dist/onramp-DLlhSPQg.js +422 -0
- package/dist/onramp-k-EAEepC.mjs +842 -0
- package/dist/parseSignature-D1tZHglo.js +16 -0
- package/dist/parseSignature-DM0lwcDr.mjs +8883 -0
- package/dist/pay-with-exchange---G2M1Ag.js +280 -0
- package/dist/pay-with-exchange-CFIcUXUe.mjs +512 -0
- package/dist/property-Bd8U3_QP.mjs +618 -0
- package/dist/property-DissjCbZ.js +27 -0
- package/dist/receive-B9LCljO6.mjs +228 -0
- package/dist/receive-E8H6GDOX.js +131 -0
- package/dist/send-B-AooLph.js +554 -0
- package/dist/send-DZd_xhsd.mjs +1155 -0
- package/dist/socials-ChWFLEFe.mjs +611 -0
- package/dist/socials-YSUYSh8o.js +250 -0
- package/dist/swaps-DpR9W9Ld.js +1050 -0
- package/dist/swaps-Du7-Ui_V.mjs +1752 -0
- package/dist/transactions-DhsK5-QJ.mjs +35 -0
- package/dist/transactions-VPsz2OLe.js +16 -0
- package/dist/w3m-modal-DhomfjKU.js +891 -0
- package/dist/w3m-modal-KuYD-zqQ.mjs +1759 -0
- package/package.json +51 -0
- package/readme.md +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ReownAuthentication-d8aYgGOq.js");exports.ReownAuthentication=e.ReownAuthentication;exports.ReownAuthenticationMessenger=e.ReownAuthenticationMessenger;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";const s=require("./index-CjZQCcwG.js"),g=s.css`
|
|
2
|
+
:host {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: inline-block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
input {
|
|
8
|
+
width: 48px;
|
|
9
|
+
height: 48px;
|
|
10
|
+
background: ${({tokens:n})=>n.theme.foregroundPrimary};
|
|
11
|
+
border-radius: ${({borderRadius:n})=>n[4]};
|
|
12
|
+
border: 1px solid ${({tokens:n})=>n.theme.borderPrimary};
|
|
13
|
+
font-family: ${({fontFamily:n})=>n.regular};
|
|
14
|
+
font-size: ${({textSize:n})=>n.large};
|
|
15
|
+
line-height: 18px;
|
|
16
|
+
letter-spacing: -0.16px;
|
|
17
|
+
text-align: center;
|
|
18
|
+
color: ${({tokens:n})=>n.theme.textPrimary};
|
|
19
|
+
caret-color: ${({tokens:n})=>n.core.textAccentPrimary};
|
|
20
|
+
transition:
|
|
21
|
+
background-color ${({durations:n})=>n.lg}
|
|
22
|
+
${({easings:n})=>n["ease-out-power-2"]},
|
|
23
|
+
border-color ${({durations:n})=>n.lg}
|
|
24
|
+
${({easings:n})=>n["ease-out-power-2"]},
|
|
25
|
+
box-shadow ${({durations:n})=>n.lg}
|
|
26
|
+
${({easings:n})=>n["ease-out-power-2"]};
|
|
27
|
+
will-change: background-color, border-color, box-shadow;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
-webkit-appearance: none;
|
|
30
|
+
-moz-appearance: textfield;
|
|
31
|
+
padding: ${({spacing:n})=>n[4]};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
input::-webkit-outer-spin-button,
|
|
35
|
+
input::-webkit-inner-spin-button {
|
|
36
|
+
-webkit-appearance: none;
|
|
37
|
+
margin: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
input[type='number'] {
|
|
41
|
+
-moz-appearance: textfield;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
input:disabled {
|
|
45
|
+
cursor: not-allowed;
|
|
46
|
+
opacity: 0.5;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
input:focus-visible:enabled {
|
|
50
|
+
background-color: transparent;
|
|
51
|
+
border: 1px solid ${({tokens:n})=>n.theme.borderSecondary};
|
|
52
|
+
box-shadow: 0px 0px 0px 4px ${({tokens:n})=>n.core.foregroundAccent040};
|
|
53
|
+
}
|
|
54
|
+
`;var m=function(n,t,e,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,t,e,i);else for(var a=n.length-1;a>=0;a--)(l=n[a])&&(o=(r<3?l(o):r>3?l(t,e,o):l(t,e))||o);return r>3&&o&&Object.defineProperty(t,e,o),o};let p=class extends s.i{constructor(){super(...arguments),this.disabled=!1,this.value=""}render(){return s.b`<input
|
|
55
|
+
type="number"
|
|
56
|
+
maxlength="1"
|
|
57
|
+
inputmode="numeric"
|
|
58
|
+
autofocus
|
|
59
|
+
?disabled=${this.disabled}
|
|
60
|
+
value=${this.value}
|
|
61
|
+
/> `}};p.styles=[s.resetStyles,s.elementStyles,g];m([s.n({type:Boolean})],p.prototype,"disabled",void 0);m([s.n({type:String})],p.prototype,"value",void 0);p=m([s.customElement("wui-input-numeric")],p);const b=s.i$1`
|
|
62
|
+
:host {
|
|
63
|
+
position: relative;
|
|
64
|
+
display: block;
|
|
65
|
+
}
|
|
66
|
+
`;var c=function(n,t,e,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,t,e,i);else for(var a=n.length-1;a>=0;a--)(l=n[a])&&(o=(r<3?l(o):r>3?l(t,e,o):l(t,e))||o);return r>3&&o&&Object.defineProperty(t,e,o),o};let u=class extends s.i{constructor(){super(...arguments),this.length=6,this.otp="",this.values=Array.from({length:this.length}).map(()=>""),this.numerics=[],this.shouldInputBeEnabled=t=>this.values.slice(0,t).every(i=>i!==""),this.handleKeyDown=(t,e)=>{const i=t.target,r=this.getInputElement(i),o=["ArrowLeft","ArrowRight","Shift","Delete"];if(!r)return;o.includes(t.key)&&t.preventDefault();const l=r.selectionStart;switch(t.key){case"ArrowLeft":l&&r.setSelectionRange(l+1,l+1),this.focusInputField("prev",e);break;case"ArrowRight":this.focusInputField("next",e);break;case"Shift":this.focusInputField("next",e);break;case"Delete":r.value===""?this.focusInputField("prev",e):this.updateInput(r,e,"");break;case"Backspace":r.value===""?this.focusInputField("prev",e):this.updateInput(r,e,"");break}},this.focusInputField=(t,e)=>{if(t==="next"){const i=e+1;if(!this.shouldInputBeEnabled(i))return;const r=this.numerics[i<this.length?i:e],o=r?this.getInputElement(r):void 0;o&&(o.disabled=!1,o.focus())}if(t==="prev"){const i=e-1,r=this.numerics[i>-1?i:e],o=r?this.getInputElement(r):void 0;o&&o.focus()}}}firstUpdated(){var e,i;this.otp&&(this.values=this.otp.split(""));const t=(e=this.shadowRoot)==null?void 0:e.querySelectorAll("wui-input-numeric");t&&(this.numerics=Array.from(t)),(i=this.numerics[0])==null||i.focus()}render(){return s.b`
|
|
67
|
+
<wui-flex gap="1" data-testid="wui-otp-input">
|
|
68
|
+
${Array.from({length:this.length}).map((t,e)=>s.b`
|
|
69
|
+
<wui-input-numeric
|
|
70
|
+
@input=${i=>this.handleInput(i,e)}
|
|
71
|
+
@click=${i=>this.selectInput(i)}
|
|
72
|
+
@keydown=${i=>this.handleKeyDown(i,e)}
|
|
73
|
+
.disabled=${!this.shouldInputBeEnabled(e)}
|
|
74
|
+
.value=${this.values[e]||""}
|
|
75
|
+
>
|
|
76
|
+
</wui-input-numeric>
|
|
77
|
+
`)}
|
|
78
|
+
</wui-flex>
|
|
79
|
+
`}updateInput(t,e,i){const r=this.numerics[e],o=t||(r?this.getInputElement(r):void 0);o&&(o.value=i,this.values=this.values.map((l,a)=>a===e?i:l))}selectInput(t){const e=t.target;if(e){const i=this.getInputElement(e);i==null||i.select()}}handleInput(t,e){const i=t.target,r=this.getInputElement(i);if(r){const o=r.value;t.inputType==="insertFromPaste"?this.handlePaste(r,o,e):s.UiHelperUtil.isNumber(o)&&t.data?(this.updateInput(r,e,t.data),this.focusInputField("next",e)):this.updateInput(r,e,"")}this.dispatchInputChangeEvent()}handlePaste(t,e,i){const r=e[0];if(r&&s.UiHelperUtil.isNumber(r)){this.updateInput(t,i,r);const l=e.substring(1);if(i+1<this.length&&l.length){const a=this.numerics[i+1],f=a?this.getInputElement(a):void 0;f&&this.handlePaste(f,l,i+1)}else this.focusInputField("next",i)}else this.updateInput(t,i,"")}getInputElement(t){var e;return(e=t.shadowRoot)!=null&&e.querySelector("input")?t.shadowRoot.querySelector("input"):null}dispatchInputChangeEvent(){const t=this.values.join("");this.dispatchEvent(new CustomEvent("inputChange",{detail:t,bubbles:!0,composed:!0}))}};u.styles=[s.resetStyles,b];c([s.n({type:Number})],u.prototype,"length",void 0);c([s.n({type:String})],u.prototype,"otp",void 0);c([s.r()],u.prototype,"values",void 0);u=c([s.customElement("wui-otp")],u);const w=s.i$1`
|
|
80
|
+
wui-loading-spinner {
|
|
81
|
+
margin: 9px auto;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.email-display,
|
|
85
|
+
.email-display wui-text {
|
|
86
|
+
max-width: 100%;
|
|
87
|
+
}
|
|
88
|
+
`;var h=function(n,t,e,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,t,e,i);else for(var a=n.length-1;a>=0;a--)(l=n[a])&&(o=(r<3?l(o):r>3?l(t,e,o):l(t,e))||o);return r>3&&o&&Object.defineProperty(t,e,o),o},d;exports.W3mEmailOtpWidget=d=class extends s.i{firstUpdated(){this.startOTPTimeout()}disconnectedCallback(){clearTimeout(this.OTPTimeout)}constructor(){var t;super(),this.loading=!1,this.timeoutTimeLeft=s.W3mFrameHelpers.getTimeToNextEmailLogin(),this.error="",this.otp="",this.email=(t=s.RouterController.state.data)==null?void 0:t.email,this.authConnector=s.ConnectorController.getAuthConnector()}render(){if(!this.email)throw new Error("w3m-email-otp-widget: No email provided");const t=!!this.timeoutTimeLeft,e=this.getFooterLabels(t);return s.b`
|
|
89
|
+
<wui-flex
|
|
90
|
+
flexDirection="column"
|
|
91
|
+
alignItems="center"
|
|
92
|
+
.padding=${["4","0","4","0"]}
|
|
93
|
+
gap="4"
|
|
94
|
+
>
|
|
95
|
+
<wui-flex
|
|
96
|
+
class="email-display"
|
|
97
|
+
flexDirection="column"
|
|
98
|
+
alignItems="center"
|
|
99
|
+
.padding=${["0","5","0","5"]}
|
|
100
|
+
>
|
|
101
|
+
<wui-text variant="md-regular" color="primary" align="center">
|
|
102
|
+
Enter the code we sent to
|
|
103
|
+
</wui-text>
|
|
104
|
+
<wui-text variant="md-medium" color="primary" lineClamp="1" align="center">
|
|
105
|
+
${this.email}
|
|
106
|
+
</wui-text>
|
|
107
|
+
</wui-flex>
|
|
108
|
+
|
|
109
|
+
<wui-text variant="sm-regular" color="secondary">The code expires in 20 minutes</wui-text>
|
|
110
|
+
|
|
111
|
+
${this.loading?s.b`<wui-loading-spinner size="xl" color="accent-primary"></wui-loading-spinner>`:s.b` <wui-flex flexDirection="column" alignItems="center" gap="2">
|
|
112
|
+
<wui-otp
|
|
113
|
+
dissabled
|
|
114
|
+
length="6"
|
|
115
|
+
@inputChange=${this.onOtpInputChange.bind(this)}
|
|
116
|
+
.otp=${this.otp}
|
|
117
|
+
></wui-otp>
|
|
118
|
+
${this.error?s.b`
|
|
119
|
+
<wui-text variant="sm-regular" align="center" color="error">
|
|
120
|
+
${this.error}. Try Again
|
|
121
|
+
</wui-text>
|
|
122
|
+
`:null}
|
|
123
|
+
</wui-flex>`}
|
|
124
|
+
|
|
125
|
+
<wui-flex alignItems="center" gap="2">
|
|
126
|
+
<wui-text variant="sm-regular" color="secondary">${e.title}</wui-text>
|
|
127
|
+
<wui-link @click=${this.onResendCode.bind(this)} .disabled=${t}>
|
|
128
|
+
${e.action}
|
|
129
|
+
</wui-link>
|
|
130
|
+
</wui-flex>
|
|
131
|
+
</wui-flex>
|
|
132
|
+
`}startOTPTimeout(){this.timeoutTimeLeft=s.W3mFrameHelpers.getTimeToNextEmailLogin(),this.OTPTimeout=setInterval(()=>{this.timeoutTimeLeft>0?this.timeoutTimeLeft=s.W3mFrameHelpers.getTimeToNextEmailLogin():clearInterval(this.OTPTimeout)},1e3)}async onOtpInputChange(t){var e;try{this.loading||(this.otp=t.detail,this.shouldSubmitOnOtpChange()&&(this.loading=!0,await((e=this.onOtpSubmit)==null?void 0:e.call(this,this.otp))))}catch(i){this.error=s.CoreHelperUtil.parseError(i),this.loading=!1}}async onResendCode(){try{if(this.onOtpResend){if(!this.loading&&!this.timeoutTimeLeft){if(this.error="",this.otp="",!s.ConnectorController.getAuthConnector()||!this.email)throw new Error("w3m-email-otp-widget: Unable to resend email");this.loading=!0,await this.onOtpResend(this.email),this.startOTPTimeout(),s.SnackController.showSuccess("Code email resent")}}else this.onStartOver&&this.onStartOver()}catch(t){s.SnackController.showError(t)}finally{this.loading=!1}}getFooterLabels(t){return this.onStartOver?{title:"Something wrong?",action:`Try again ${t?`in ${this.timeoutTimeLeft}s`:""}`}:{title:"Didn't receive it?",action:`Resend ${t?`in ${this.timeoutTimeLeft}s`:"Code"}`}}shouldSubmitOnOtpChange(){return this.authConnector&&this.otp.length===d.OTP_LENGTH}};exports.W3mEmailOtpWidget.OTP_LENGTH=6;exports.W3mEmailOtpWidget.styles=w;h([s.r()],exports.W3mEmailOtpWidget.prototype,"loading",void 0);h([s.r()],exports.W3mEmailOtpWidget.prototype,"timeoutTimeLeft",void 0);h([s.r()],exports.W3mEmailOtpWidget.prototype,"error",void 0);exports.W3mEmailOtpWidget=d=h([s.customElement("w3m-email-otp-widget")],exports.W3mEmailOtpWidget);
|