@dcl/governance-site 2.0.0 → 2.0.1-20995780683.commit-d6baf5e
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/assets/BlockOverrides-9837a6f9.js +5 -0
- package/assets/ConstantsUtil-298f7898.js +1 -0
- package/assets/ExchangeController-d2354ec6.js +1 -0
- package/assets/HelpersUtil-8cddb046.js +62 -0
- package/assets/MathUtil-b514a570.js +1 -0
- package/assets/NavigationUtil-a0d0ce87.js +1 -0
- package/assets/NetworkUtil-220ea128.js +1 -0
- package/assets/PhWallet-fd2006d2.js +14 -0
- package/assets/{features-b72c9430.js → ReownAuthentication-468828df.js} +4 -4
- package/assets/SwapController-7bfd6ce7.js +1 -0
- package/assets/{UserAvatar-78751cb5.js → UserAvatar-456716f1.js} +1 -1
- package/assets/ccip-ddcec720.js +1 -0
- package/assets/data-capture-3e424a2c.js +242 -0
- package/assets/email-ea617f9c.js +90 -0
- package/assets/embedded-wallet-814bf005.js +410 -0
- package/assets/features-fd521597.js +1 -0
- package/assets/fortmatic-f3cb4aa6.js +13 -0
- package/assets/if-defined-0a35f675.js +5 -0
- package/assets/index-034d22a0.js +138 -0
- package/assets/{index-a8255d1c.css → index-05771666.css} +4 -4
- package/assets/index-07a61b45.js +51 -0
- package/assets/index-1039ded0.js +132 -0
- package/assets/index-123c1362.js +224 -0
- package/assets/index-15bbaaa0.js +7 -0
- package/assets/{index-073512a1.js → index-206e3e77.js} +1 -1
- package/assets/index-27a991e4.js +53 -0
- package/assets/index-2d0efdd2.js +210 -0
- package/assets/index-32d53c87.js +189 -0
- package/assets/index-3b861a37.js +102 -0
- package/assets/index-4207595b.js +100 -0
- package/assets/index-4243d275.js +43 -0
- package/assets/index-42ce7246.js +63 -0
- package/assets/index-47e87339.js +152 -0
- package/assets/index-48bd3fca.js +277 -0
- package/assets/index-49cc5044.js +46 -0
- package/assets/index-5788a0d6.js +468 -0
- package/assets/index-5824c226.js +81 -0
- package/assets/index-5da565ce.js +78 -0
- package/assets/index-685e7949.js +425 -0
- package/assets/index-84e8ecf6.js +647 -0
- package/assets/index-965fdf98.js +3425 -0
- package/assets/index-9d970383.js +152 -0
- package/assets/index-a59b6662.js +68 -0
- package/assets/index-b457d047.js +1062 -0
- package/assets/index-b65e06cc.js +27 -0
- package/assets/{index-2ef9f1d1.js → index-d70e4ab8.js} +66 -66
- package/assets/index-d7a6ceea.js +30 -0
- package/assets/index-d9c55c27.js +77 -0
- package/assets/index-db5b7889.js +77 -0
- package/assets/index-e3222791.js +78 -0
- package/assets/index-eb060c20.js +1 -0
- package/assets/index-f3f03959.js +90 -0
- package/assets/index-fcda68c9.js +19 -0
- package/assets/index-ff4dea43.js +85 -0
- package/assets/networks-14f3c0d2.js +1 -0
- package/assets/onramp-dcdb1a34.js +422 -0
- package/assets/pay-with-exchange-a64f18a3.js +280 -0
- package/assets/receive-ca7bc867.js +131 -0
- package/assets/ref-88e1be05.js +13 -0
- package/assets/send-8739c9fb.js +554 -0
- package/assets/socials-ccc593f5.js +250 -0
- package/assets/swaps-0a90eb06.js +1050 -0
- package/assets/transactions-bb8cb277.js +16 -0
- package/assets/{tslib.es6-82b9ba96.js → tslib.es6-db2ec995.js} +2 -2
- package/assets/w3m-modal-869dafbc.js +891 -0
- package/assets/zoraTestnet-adc7b76b.js +36 -0
- package/index.html +4 -4
- package/package.json +3 -3
- package/assets/basic-ca749c4c.js +0 -1435
- package/assets/core-806d78ea.js +0 -249
- package/assets/fortmatic-12e0f2e5.js +0 -13
- package/assets/index-372705ba.js +0 -1321
- package/assets/index-4be588a0.js +0 -94
- package/assets/index-74e34dfb.js +0 -39
- package/assets/index-bbb36593.js +0 -7
- package/assets/index-c1c8440f.js +0 -47
- package/assets/w3m-modal-26eff9d9.js +0 -1209
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import{n as y,l as m,m as a,E as b,y as g,C as x,W as v,R as T,O as c,j as d,r as C,k as _}from"./index-48bd3fca.js";import{c as w,r as $}from"./index-84e8ecf6.js";import"./index-a59b6662.js";const R=y``;var O=globalThis&&globalThis.__decorate||function(n,e,r,o){var i=arguments.length,t=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(n,e,r,o);else for(var s=n.length-1;s>=0;s--)(l=n[s])&&(t=(i<3?l(t):i>3?l(e,r,t):l(e,r))||t);return i>3&&t&&Object.defineProperty(e,r,t),t};let f=class extends m{render(){const{termsConditionsUrl:e,privacyPolicyUrl:r}=c.state;return!e&&!r?null:a`
|
|
2
|
+
<wui-flex
|
|
3
|
+
.padding=${["4","3","3","3"]}
|
|
4
|
+
flexDirection="column"
|
|
5
|
+
alignItems="center"
|
|
6
|
+
justifyContent="center"
|
|
7
|
+
gap="3"
|
|
8
|
+
>
|
|
9
|
+
<wui-text color="secondary" variant="md-regular" align="center">
|
|
10
|
+
We work with the best providers to give you the lowest fees and best support. More options
|
|
11
|
+
coming soon!
|
|
12
|
+
</wui-text>
|
|
13
|
+
|
|
14
|
+
${this.howDoesItWorkTemplate()}
|
|
15
|
+
</wui-flex>
|
|
16
|
+
`}howDoesItWorkTemplate(){return a` <wui-link @click=${this.onWhatIsBuy.bind(this)}>
|
|
17
|
+
<wui-icon size="xs" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
|
|
18
|
+
How does it work?
|
|
19
|
+
</wui-link>`}onWhatIsBuy(){b.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:g(x.state.activeChain)===v.ACCOUNT_TYPES.SMART_ACCOUNT}}),T.push("WhatIsABuy")}};f.styles=[R];f=O([w("w3m-onramp-providers-footer")],f);const P="https://reown.com",W=d`
|
|
20
|
+
.reown-logo {
|
|
21
|
+
height: 24px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
a {
|
|
25
|
+
text-decoration: none;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
color: ${({tokens:n})=>n.theme.textSecondary};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
a:hover {
|
|
31
|
+
opacity: 0.9;
|
|
32
|
+
}
|
|
33
|
+
`;var U=globalThis&&globalThis.__decorate||function(n,e,r,o){var i=arguments.length,t=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(n,e,r,o);else for(var s=n.length-1;s>=0;s--)(l=n[s])&&(t=(i<3?l(t):i>3?l(e,r,t):l(e,r))||t);return i>3&&t&&Object.defineProperty(e,r,t),t};let p=class extends m{render(){return a`
|
|
34
|
+
<a
|
|
35
|
+
data-testid="ux-branding-reown"
|
|
36
|
+
href=${P}
|
|
37
|
+
rel="noreferrer"
|
|
38
|
+
target="_blank"
|
|
39
|
+
style="text-decoration: none;"
|
|
40
|
+
>
|
|
41
|
+
<wui-flex
|
|
42
|
+
justifyContent="center"
|
|
43
|
+
alignItems="center"
|
|
44
|
+
gap="1"
|
|
45
|
+
.padding=${["01","0","3","0"]}
|
|
46
|
+
>
|
|
47
|
+
<wui-text variant="sm-regular" color="inherit"> UX by </wui-text>
|
|
48
|
+
<wui-icon name="reown" size="inherit" class="reown-logo"></wui-icon>
|
|
49
|
+
</wui-flex>
|
|
50
|
+
</a>
|
|
51
|
+
`}};p.styles=[C,_,W];p=U([w("wui-ux-by-reown")],p);const j=d`
|
|
52
|
+
:host wui-ux-by-reown {
|
|
53
|
+
padding-top: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host wui-ux-by-reown.branding-only {
|
|
57
|
+
padding-top: ${({spacing:n})=>n[3]};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
a {
|
|
61
|
+
text-decoration: none;
|
|
62
|
+
color: ${({tokens:n})=>n.core.textAccentPrimary};
|
|
63
|
+
font-weight: 500;
|
|
64
|
+
}
|
|
65
|
+
`;var h=globalThis&&globalThis.__decorate||function(n,e,r,o){var i=arguments.length,t=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(n,e,r,o);else for(var s=n.length-1;s>=0;s--)(l=n[s])&&(t=(i<3?l(t):i>3?l(e,r,t):l(e,r))||t);return i>3&&t&&Object.defineProperty(e,r,t),t};let u=class extends m{constructor(){super(),this.unsubscribe=[],this.remoteFeatures=c.state.remoteFeatures,this.unsubscribe.push(c.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var t;const{termsConditionsUrl:e,privacyPolicyUrl:r}=c.state,o=(t=c.state.features)==null?void 0:t.legalCheckbox;return!e&&!r||o?a`
|
|
66
|
+
<wui-flex flexDirection="column"> ${this.reownBrandingTemplate(!0)} </wui-flex>
|
|
67
|
+
`:a`
|
|
68
|
+
<wui-flex flexDirection="column">
|
|
69
|
+
<wui-flex .padding=${["4","3","3","3"]} justifyContent="center">
|
|
70
|
+
<wui-text color="secondary" variant="md-regular" align="center">
|
|
71
|
+
By connecting your wallet, you agree to our <br />
|
|
72
|
+
${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
|
|
73
|
+
</wui-text>
|
|
74
|
+
</wui-flex>
|
|
75
|
+
${this.reownBrandingTemplate()}
|
|
76
|
+
</wui-flex>
|
|
77
|
+
`}andTemplate(){const{termsConditionsUrl:e,privacyPolicyUrl:r}=c.state;return e&&r?"and":""}termsTemplate(){const{termsConditionsUrl:e}=c.state;return e?a`<a href=${e} target="_blank" rel="noopener noreferrer"
|
|
78
|
+
>Terms of Service</a
|
|
79
|
+
>`:null}privacyTemplate(){const{privacyPolicyUrl:e}=c.state;return e?a`<a href=${e} target="_blank" rel="noopener noreferrer"
|
|
80
|
+
>Privacy Policy</a
|
|
81
|
+
>`:null}reownBrandingTemplate(e=!1){var r;return(r=this.remoteFeatures)!=null&&r.reownBranding?e?a`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>`:a`<wui-ux-by-reown></wui-ux-by-reown>`:null}};u.styles=[j];h([$()],u.prototype,"remoteFeatures",void 0);u=h([w("w3m-legal-footer")],u);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import{j as d,r as m,k as c,l as f,v,m as h}from"./index-48bd3fca.js";import{n as r,c as y,U as b}from"./index-84e8ecf6.js";import{e as g,n as w}from"./ref-88e1be05.js";const x=d`
|
|
2
|
+
:host {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: inline-block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host([data-error='true']) > input {
|
|
8
|
+
color: ${({tokens:t})=>t.core.textError};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:host([data-error='false']) > input {
|
|
12
|
+
color: ${({tokens:t})=>t.theme.textSecondary};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
input {
|
|
16
|
+
background: transparent;
|
|
17
|
+
height: auto;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
color: ${({tokens:t})=>t.theme.textPrimary};
|
|
20
|
+
font-feature-settings: 'case' on;
|
|
21
|
+
font-size: ${({textSize:t})=>t.h4};
|
|
22
|
+
caret-color: ${({tokens:t})=>t.core.backgroundAccentPrimary};
|
|
23
|
+
line-height: ${({typography:t})=>t["h4-regular-mono"].lineHeight};
|
|
24
|
+
letter-spacing: ${({typography:t})=>t["h4-regular-mono"].letterSpacing};
|
|
25
|
+
-webkit-appearance: none;
|
|
26
|
+
-moz-appearance: textfield;
|
|
27
|
+
padding: 0px;
|
|
28
|
+
font-family: ${({fontFamily:t})=>t.mono};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host([data-width-variant='auto']) input {
|
|
32
|
+
width: 100%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([data-width-variant='fit']) input {
|
|
36
|
+
width: 1ch;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.wui-input-amount-fit-mirror {
|
|
40
|
+
position: absolute;
|
|
41
|
+
visibility: hidden;
|
|
42
|
+
white-space: pre;
|
|
43
|
+
font-size: var(--local-font-size);
|
|
44
|
+
line-height: 130%;
|
|
45
|
+
letter-spacing: -1.28px;
|
|
46
|
+
font-family: ${({fontFamily:t})=>t.mono};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.wui-input-amount-fit-width {
|
|
50
|
+
display: inline-block;
|
|
51
|
+
position: relative;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
input::-webkit-outer-spin-button,
|
|
55
|
+
input::-webkit-inner-spin-button {
|
|
56
|
+
-webkit-appearance: none;
|
|
57
|
+
margin: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
input::placeholder {
|
|
61
|
+
color: ${({tokens:t})=>t.theme.textSecondary};
|
|
62
|
+
}
|
|
63
|
+
`;var a=globalThis&&globalThis.__decorate||function(t,e,n,s){var l=arguments.length,o=l<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,n):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,s);else for(var u=t.length-1;u>=0;u--)(p=t[u])&&(o=(l<3?p(o):l>3?p(e,n,o):p(e,n))||o);return l>3&&o&&Object.defineProperty(e,n,o),o};let i=class extends f{constructor(){super(...arguments),this.inputElementRef=g(),this.disabled=!1,this.value="",this.placeholder="0",this.widthVariant="auto",this.maxDecimals=void 0,this.maxIntegers=void 0,this.fontSize="h4",this.error=!1}firstUpdated(){this.resizeInput()}updated(){this.style.setProperty("--local-font-size",v.textSize[this.fontSize]),this.resizeInput()}render(){var e;return this.dataset.widthVariant=this.widthVariant,this.dataset.error=String(this.error),(e=this.inputElementRef)!=null&&e.value&&this.value&&(this.inputElementRef.value.value=this.value),this.widthVariant==="auto"?this.inputTemplate():h`
|
|
64
|
+
<div class="wui-input-amount-fit-width">
|
|
65
|
+
<span class="wui-input-amount-fit-mirror"></span>
|
|
66
|
+
${this.inputTemplate()}
|
|
67
|
+
</div>
|
|
68
|
+
`}inputTemplate(){return h`<input
|
|
69
|
+
${w(this.inputElementRef)}
|
|
70
|
+
type="text"
|
|
71
|
+
inputmode="decimal"
|
|
72
|
+
pattern="[0-9,.]*"
|
|
73
|
+
placeholder=${this.placeholder}
|
|
74
|
+
?disabled=${this.disabled}
|
|
75
|
+
autofocus
|
|
76
|
+
value=${this.value??""}
|
|
77
|
+
@input=${this.dispatchInputChangeEvent.bind(this)}
|
|
78
|
+
/>`}dispatchInputChangeEvent(){this.inputElementRef.value&&(this.inputElementRef.value.value=b.maskInput({value:this.inputElementRef.value.value,decimals:this.maxDecimals,integers:this.maxIntegers}),this.dispatchEvent(new CustomEvent("inputChange",{detail:this.inputElementRef.value.value,bubbles:!0,composed:!0})),this.resizeInput())}resizeInput(){if(this.widthVariant==="fit"){const e=this.inputElementRef.value;if(e){const n=e.previousElementSibling;n&&(n.textContent=e.value||"0",e.style.width=`${n.offsetWidth}px`)}}}};i.styles=[m,c,x];a([r({type:Boolean})],i.prototype,"disabled",void 0);a([r({type:String})],i.prototype,"value",void 0);a([r({type:String})],i.prototype,"placeholder",void 0);a([r({type:String})],i.prototype,"widthVariant",void 0);a([r({type:Number})],i.prototype,"maxDecimals",void 0);a([r({type:Number})],i.prototype,"maxIntegers",void 0);a([r({type:String})],i.prototype,"fontSize",void 0);a([r({type:Boolean})],i.prototype,"error",void 0);i=a([y("wui-input-amount")],i);
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import{j as ot,l as st,m as w,r as Tt,C as ht,a2 as F,h as gt,R as Ot,E as At,y as Ct,W as Ft,O as Nt}from"./index-48bd3fca.js";import{U as vt,n as I,r as Q,c as at}from"./index-84e8ecf6.js";import{c as mt,g as ft}from"./index-d70e4ab8.js";import"./index-ff4dea43.js";import"./index-a59b6662.js";import{o as Rt}from"./if-defined-0a35f675.js";import"./index-42ce7246.js";import"./index-d7a6ceea.js";var _t={exports:{}};(function(t,e){(function(i,r){t.exports=r()})(mt,function(){var i=1e3,r=6e4,o=36e5,n="millisecond",s="second",u="minute",g="hour",h="day",y="week",$="month",L="quarter",D="year",N="date",Y="Invalid Date",X=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,tt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,et={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(p){var l=["th","st","nd","rd"],a=p%100;return"["+p+(l[(a-20)%10]||l[a]||l[0])+"]"}},it=function(p,l,a){var d=String(p);return!d||d.length>=l?p:""+Array(l+1-d.length).join(a)+p},B={s:it,z:function(p){var l=-p.utcOffset(),a=Math.abs(l),d=Math.floor(a/60),c=a%60;return(l<=0?"+":"-")+it(d,2,"0")+":"+it(c,2,"0")},m:function p(l,a){if(l.date()<a.date())return-p(a,l);var d=12*(a.year()-l.year())+(a.month()-l.month()),c=l.clone().add(d,$),m=a-c<0,f=l.clone().add(d+(m?-1:1),$);return+(-(d+(a-c)/(m?c-f:f-c))||0)},a:function(p){return p<0?Math.ceil(p)||0:Math.floor(p)},p:function(p){return{M:$,y:D,w:y,d:h,D:N,h:g,m:u,s,ms:n,Q:L}[p]||String(p||"").toLowerCase().replace(/s$/,"")},u:function(p){return p===void 0}},S="en",O={};O[S]=et;var V="$isDayjsObject",W=function(p){return p instanceof lt||!(!p||!p[V])},ct=function p(l,a,d){var c;if(!l)return S;if(typeof l=="string"){var m=l.toLowerCase();O[m]&&(c=m),a&&(O[m]=a,c=m);var f=l.split("-");if(!c&&f.length>1)return p(f[0])}else{var b=l.name;O[b]=l,c=b}return!d&&c&&(S=c),c||!d&&S},T=function(p,l){if(W(p))return p.clone();var a=typeof l=="object"?l:{};return a.date=p,a.args=arguments,new lt(a)},x=B;x.l=ct,x.i=W,x.w=function(p,l){return T(p,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var lt=function(){function p(a){this.$L=ct(a.locale,null,!0),this.parse(a),this.$x=this.$x||a.x||{},this[V]=!0}var l=p.prototype;return l.parse=function(a){this.$d=function(d){var c=d.date,m=d.utc;if(c===null)return new Date(NaN);if(x.u(c))return new Date;if(c instanceof Date)return new Date(c);if(typeof c=="string"&&!/Z$/i.test(c)){var f=c.match(X);if(f){var b=f[2]-1||0,v=(f[7]||"0").substring(0,3);return m?new Date(Date.UTC(f[1],b,f[3]||1,f[4]||0,f[5]||0,f[6]||0,v)):new Date(f[1],b,f[3]||1,f[4]||0,f[5]||0,f[6]||0,v)}}return new Date(c)}(a),this.init()},l.init=function(){var a=this.$d;this.$y=a.getFullYear(),this.$M=a.getMonth(),this.$D=a.getDate(),this.$W=a.getDay(),this.$H=a.getHours(),this.$m=a.getMinutes(),this.$s=a.getSeconds(),this.$ms=a.getMilliseconds()},l.$utils=function(){return x},l.isValid=function(){return this.$d.toString()!==Y},l.isSame=function(a,d){var c=T(a);return this.startOf(d)<=c&&c<=this.endOf(d)},l.isAfter=function(a,d){return T(a)<this.startOf(d)},l.isBefore=function(a,d){return this.endOf(d)<T(a)},l.$g=function(a,d,c){return x.u(a)?this[d]:this.set(c,a)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(a,d){var c=this,m=!!x.u(d)||d,f=x.p(a),b=function(H,A){var z=x.w(c.$u?Date.UTC(c.$y,A,H):new Date(c.$y,A,H),c);return m?z:z.endOf(h)},v=function(H,A){return x.w(c.toDate()[H].apply(c.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(A)),c)},_=this.$W,M=this.$M,C=this.$D,J="set"+(this.$u?"UTC":"");switch(f){case D:return m?b(1,0):b(31,11);case $:return m?b(1,M):b(0,M+1);case y:var P=this.$locale().weekStart||0,rt=(_<P?_+7:_)-P;return b(m?C-rt:C+(6-rt),M);case h:case N:return v(J+"Hours",0);case g:return v(J+"Minutes",1);case u:return v(J+"Seconds",2);case s:return v(J+"Milliseconds",3);default:return this.clone()}},l.endOf=function(a){return this.startOf(a,!1)},l.$set=function(a,d){var c,m=x.p(a),f="set"+(this.$u?"UTC":""),b=(c={},c[h]=f+"Date",c[N]=f+"Date",c[$]=f+"Month",c[D]=f+"FullYear",c[g]=f+"Hours",c[u]=f+"Minutes",c[s]=f+"Seconds",c[n]=f+"Milliseconds",c)[m],v=m===h?this.$D+(d-this.$W):d;if(m===$||m===D){var _=this.clone().set(N,1);_.$d[b](v),_.init(),this.$d=_.set(N,Math.min(this.$D,_.daysInMonth())).$d}else b&&this.$d[b](v);return this.init(),this},l.set=function(a,d){return this.clone().$set(a,d)},l.get=function(a){return this[x.p(a)]()},l.add=function(a,d){var c,m=this;a=Number(a);var f=x.p(d),b=function(M){var C=T(m);return x.w(C.date(C.date()+Math.round(M*a)),m)};if(f===$)return this.set($,this.$M+a);if(f===D)return this.set(D,this.$y+a);if(f===h)return b(1);if(f===y)return b(7);var v=(c={},c[u]=r,c[g]=o,c[s]=i,c)[f]||1,_=this.$d.getTime()+a*v;return x.w(_,this)},l.subtract=function(a,d){return this.add(-1*a,d)},l.format=function(a){var d=this,c=this.$locale();if(!this.isValid())return c.invalidDate||Y;var m=a||"YYYY-MM-DDTHH:mm:ssZ",f=x.z(this),b=this.$H,v=this.$m,_=this.$M,M=c.weekdays,C=c.months,J=c.meridiem,P=function(A,z,nt,dt){return A&&(A[z]||A(d,m))||nt[z].slice(0,dt)},rt=function(A){return x.s(b%12||12,A,"0")},H=J||function(A,z,nt){var dt=A<12?"AM":"PM";return nt?dt.toLowerCase():dt};return m.replace(tt,function(A,z){return z||function(nt){switch(nt){case"YY":return String(d.$y).slice(-2);case"YYYY":return x.s(d.$y,4,"0");case"M":return _+1;case"MM":return x.s(_+1,2,"0");case"MMM":return P(c.monthsShort,_,C,3);case"MMMM":return P(C,_);case"D":return d.$D;case"DD":return x.s(d.$D,2,"0");case"d":return String(d.$W);case"dd":return P(c.weekdaysMin,d.$W,M,2);case"ddd":return P(c.weekdaysShort,d.$W,M,3);case"dddd":return M[d.$W];case"H":return String(b);case"HH":return x.s(b,2,"0");case"h":return rt(1);case"hh":return rt(2);case"a":return H(b,v,!0);case"A":return H(b,v,!1);case"m":return String(v);case"mm":return x.s(v,2,"0");case"s":return String(d.$s);case"ss":return x.s(d.$s,2,"0");case"SSS":return x.s(d.$ms,3,"0");case"Z":return f}return null}(A)||f.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(a,d,c){var m,f=this,b=x.p(d),v=T(a),_=(v.utcOffset()-this.utcOffset())*r,M=this-v,C=function(){return x.m(f,v)};switch(b){case D:m=C()/12;break;case $:m=C();break;case L:m=C()/3;break;case y:m=(M-_)/6048e5;break;case h:m=(M-_)/864e5;break;case g:m=M/o;break;case u:m=M/r;break;case s:m=M/i;break;default:m=M}return c?m:x.a(m)},l.daysInMonth=function(){return this.endOf($).$D},l.$locale=function(){return O[this.$L]},l.locale=function(a,d){if(!a)return this.$L;var c=this.clone(),m=ct(a,d,!0);return m&&(c.$L=m),c},l.clone=function(){return x.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},p}(),$t=lt.prototype;return T.prototype=$t,[["$ms",n],["$s",s],["$m",u],["$H",g],["$W",h],["$M",$],["$y",D],["$D",N]].forEach(function(p){$t[p[1]]=function(l){return this.$g(l,p[0],p[1])}}),T.extend=function(p,l){return p.$i||(p(l,lt,T),p.$i=!0),T},T.locale=ct,T.isDayjs=W,T.unix=function(p){return T(1e3*p)},T.en=O[S],T.Ls=O,T.p={},T})})(_t);var jt=_t.exports;const K=ft(jt);var It={exports:{}};(function(t,e){(function(i,r){t.exports=r()})(mt,function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(i){var r=["th","st","nd","rd"],o=i%100;return"["+i+(r[(o-20)%10]||r[o]||r[0])+"]"}}})})(It);var Lt=It.exports;const kt=ft(Lt);var Mt={exports:{}};(function(t,e){(function(i,r){t.exports=r()})(mt,function(){return function(i,r,o){i=i||{};var n=r.prototype,s={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(h,y,$,L){return n.fromToBase(h,y,$,L)}o.en.relativeTime=s,n.fromToBase=function(h,y,$,L,D){for(var N,Y,X,tt=$.$locale().relativeTime||s,et=i.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],it=et.length,B=0;B<it;B+=1){var S=et[B];S.d&&(N=L?o(h).diff($,S.d,!0):$.diff(h,S.d,!0));var O=(i.rounding||Math.round)(Math.abs(N));if(X=N>0,O<=S.r||!S.r){O<=1&&B>0&&(S=et[B-1]);var V=tt[S.l];D&&(O=D(""+O)),Y=typeof V=="string"?V.replace("%d",O):V(O,y,S.l,X);break}}if(y)return Y;var W=X?tt.future:tt.past;return typeof W=="function"?W(Y):W.replace("%s",Y)},n.to=function(h,y){return u(h,y,this,!0)},n.from=function(h,y){return u(h,y,this)};var g=function(h){return h.$u?o.utc():o()};n.toNow=function(h){return this.to(g(this),h)},n.fromNow=function(h){return this.from(g(this),h)}}})})(Mt);var zt=Mt.exports;const Ut=ft(zt);var St={exports:{}};(function(t,e){(function(i,r){t.exports=r()})(mt,function(){return function(i,r,o){o.updateLocale=function(n,s){var u=o.Ls[n];if(u)return(s?Object.keys(s):[]).forEach(function(g){u[g]=s[g]}),u}}})})(St);var Et=St.exports;const Yt=ft(Et);K.extend(Ut);K.extend(Yt);const Bt={...kt,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}},Wt=["January","February","March","April","May","June","July","August","September","October","November","December"];K.locale("en-web3-modal",Bt);const yt={getMonthNameByIndex(t){return Wt[t]},getYear(t=new Date().toISOString()){return K(t).year()},getRelativeDateFromNow(t){return K(t).locale("en-web3-modal").fromNow(!0)},formatDate(t,e="DD MMM"){return K(t).format(e)}},Pt=3,pt=.1,Ht=["receive","deposit","borrow","claim"],Gt=["withdraw","repay","burn"],Z={getTransactionGroupTitle(t,e){const i=yt.getYear(),r=yt.getMonthNameByIndex(e);return t===i?r:`${r} ${t}`},getTransactionImages(t){const[e]=t;return(t==null?void 0:t.length)>1?t.map(r=>this.getTransactionImage(r)):[this.getTransactionImage(e)]},getTransactionImage(t){return{type:Z.getTransactionTransferTokenType(t),url:Z.getTransactionImageURL(t)}},getTransactionImageURL(t){var o,n,s,u,g;let e;const i=!!(t!=null&&t.nft_info),r=!!(t!=null&&t.fungible_info);return t&&i?e=(s=(n=(o=t==null?void 0:t.nft_info)==null?void 0:o.content)==null?void 0:n.preview)==null?void 0:s.url:t&&r&&(e=(g=(u=t==null?void 0:t.fungible_info)==null?void 0:u.icon)==null?void 0:g.url),e},getTransactionTransferTokenType(t){if(t!=null&&t.fungible_info)return"FUNGIBLE";if(t!=null&&t.nft_info)return"NFT"},getTransactionDescriptions(t,e){var L;const i=(L=t==null?void 0:t.metadata)==null?void 0:L.operationType,r=e||(t==null?void 0:t.transfers),o=r&&r.length>0,n=r&&r.length>1,s=o&&r.every(D=>!!(D!=null&&D.fungible_info)),[u,g]=r||[];let h=this.getTransferDescription(u),y=this.getTransferDescription(g);if(!o)return(i==="send"||i==="receive")&&s?(h=vt.getTruncateString({string:t==null?void 0:t.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),y=vt.getTruncateString({string:t==null?void 0:t.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"}),[h,y]):[t.metadata.status];if(n)return r==null?void 0:r.map(D=>this.getTransferDescription(D));let $="";return Ht.includes(i)?$="+":Gt.includes(i)&&($="-"),h=$.concat(h),[h]},getTransferDescription(t){var i;let e="";return t&&(t!=null&&t.nft_info?e=((i=t==null?void 0:t.nft_info)==null?void 0:i.name)||"-":t!=null&&t.fungible_info&&(e=this.getFungibleTransferDescription(t)||"-")),e},getFungibleTransferDescription(t){var r;return t?[this.getQuantityFixedValue(t==null?void 0:t.quantity.numeric),(r=t==null?void 0:t.fungible_info)==null?void 0:r.symbol].join(" ").trim():null},mergeTransfers(t){if((t==null?void 0:t.length)<=1)return t;const i=this.filterGasFeeTransfers(t).reduce((o,n)=>{var g;const s=(g=n==null?void 0:n.fungible_info)==null?void 0:g.name,u=o.find(({fungible_info:h,direction:y})=>s&&s===(h==null?void 0:h.name)&&y===n.direction);if(u){const h=Number(u.quantity.numeric)+Number(n.quantity.numeric);u.quantity.numeric=h.toString(),u.value=(u.value||0)+(n.value||0)}else o.push(n);return o},[]);let r=i;return i.length>2&&(r=i.sort((o,n)=>(n.value||0)-(o.value||0)).slice(0,2)),r=r.sort((o,n)=>o.direction==="out"&&n.direction==="in"?-1:o.direction==="in"&&n.direction==="out"?1:0),r},filterGasFeeTransfers(t){const e=t==null?void 0:t.reduce((r,o)=>{var s;const n=(s=o==null?void 0:o.fungible_info)==null?void 0:s.name;return n&&(r[n]||(r[n]=[]),r[n].push(o)),r},{}),i=[];return Object.values(e??{}).forEach(r=>{if(r.length===1){const o=r[0];o&&i.push(o)}else{const o=r.filter(s=>s.direction==="in"),n=r.filter(s=>s.direction==="out");if(o.length===1&&n.length===1){const s=o[0],u=n[0];let g=!1;if(s&&u){const h=Number(s.quantity.numeric),y=Number(u.quantity.numeric);y<h*pt?(i.push(s),g=!0):h<y*pt&&(i.push(u),g=!0)}g||i.push(...r)}else{const s=this.filterGasFeesFromTokenGroup(r);i.push(...s)}}}),t==null||t.forEach(r=>{var o;(o=r==null?void 0:r.fungible_info)!=null&&o.name||i.push(r)}),i},filterGasFeesFromTokenGroup(t){if(t.length<=1)return t;const e=t==null?void 0:t.map(u=>Number(u.quantity.numeric)),i=Math.max(...e),r=Math.min(...e),o=.01;if(r<i*o)return t==null?void 0:t.filter(g=>Number(g.quantity.numeric)>=i*o);const n=t==null?void 0:t.filter(u=>u.direction==="in"),s=t==null?void 0:t.filter(u=>u.direction==="out");if(n.length===1&&s.length===1){const u=n[0],g=s[0];if(u&&g){const h=Number(u.quantity.numeric),y=Number(g.quantity.numeric);if(y<h*pt)return[u];if(h<y*pt)return[g]}}return t},getQuantityFixedValue(t){return t?parseFloat(t).toFixed(Pt):null}};var xt;(function(t){t.approve="approved",t.bought="bought",t.borrow="borrowed",t.burn="burnt",t.cancel="canceled",t.claim="claimed",t.deploy="deployed",t.deposit="deposited",t.execute="executed",t.mint="minted",t.receive="received",t.repay="repaid",t.send="sent",t.sell="sold",t.stake="staked",t.trade="swapped",t.unstake="unstaked",t.withdraw="withdrawn"})(xt||(xt={}));const qt=ot`
|
|
2
|
+
:host > wui-flex {
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
align-items: center;
|
|
6
|
+
position: relative;
|
|
7
|
+
width: 40px;
|
|
8
|
+
height: 40px;
|
|
9
|
+
box-shadow: inset 0 0 0 1px ${({tokens:t})=>t.core.glass010};
|
|
10
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host([data-no-images='true']) > wui-flex {
|
|
14
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
15
|
+
border-radius: ${({borderRadius:t})=>t[3]} !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host > wui-flex wui-image {
|
|
19
|
+
display: block;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host > wui-flex,
|
|
23
|
+
:host > wui-flex wui-image,
|
|
24
|
+
.swap-images-container,
|
|
25
|
+
.swap-images-container.nft,
|
|
26
|
+
wui-image.nft {
|
|
27
|
+
border-top-left-radius: var(--local-left-border-radius);
|
|
28
|
+
border-top-right-radius: var(--local-right-border-radius);
|
|
29
|
+
border-bottom-left-radius: var(--local-left-border-radius);
|
|
30
|
+
border-bottom-right-radius: var(--local-right-border-radius);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.swap-images-container {
|
|
34
|
+
position: relative;
|
|
35
|
+
width: 40px;
|
|
36
|
+
height: 40px;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.swap-images-container wui-image:first-child {
|
|
41
|
+
position: absolute;
|
|
42
|
+
width: 40px;
|
|
43
|
+
height: 40px;
|
|
44
|
+
top: 0;
|
|
45
|
+
left: 0%;
|
|
46
|
+
clip-path: inset(0px calc(50% + 2px) 0px 0%);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.swap-images-container wui-image:last-child {
|
|
50
|
+
clip-path: inset(0px 0px 0px calc(50% + 2px));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.swap-fallback-container {
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 0;
|
|
56
|
+
width: 40px;
|
|
57
|
+
height: 40px;
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.swap-fallback-container.first {
|
|
64
|
+
clip-path: inset(0px calc(50% + 2px) 0px 0%);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.swap-fallback-container.last {
|
|
68
|
+
clip-path: inset(0px 0px 0px calc(50% + 2px));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
wui-flex.status-box {
|
|
72
|
+
position: absolute;
|
|
73
|
+
right: 0;
|
|
74
|
+
bottom: 0;
|
|
75
|
+
transform: translate(20%, 20%);
|
|
76
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
77
|
+
background-color: ${({tokens:t})=>t.theme.backgroundPrimary};
|
|
78
|
+
box-shadow: 0 0 0 2px ${({tokens:t})=>t.theme.backgroundPrimary};
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
width: 16px;
|
|
81
|
+
height: 16px;
|
|
82
|
+
}
|
|
83
|
+
`;var U=globalThis&&globalThis.__decorate||function(t,e,i,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,r);else for(var u=t.length-1;u>=0;u--)(s=t[u])&&(n=(o<3?s(n):o>3?s(e,i,n):s(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n};let R=class extends st{constructor(){super(...arguments),this.images=[],this.secondImage={type:void 0,url:""},this.failedImageUrls=new Set}handleImageError(e){return i=>{i.stopPropagation(),this.failedImageUrls.add(e),this.requestUpdate()}}render(){const[e,i]=this.images;this.images.length||(this.dataset.noImages="true");const r=(e==null?void 0:e.type)==="NFT",o=i!=null&&i.url?i.type==="NFT":r,n=r?"var(--apkt-borderRadius-3)":"var(--apkt-borderRadius-5)",s=o?"var(--apkt-borderRadius-3)":"var(--apkt-borderRadius-5)";return this.style.cssText=`
|
|
84
|
+
--local-left-border-radius: ${n};
|
|
85
|
+
--local-right-border-radius: ${s};
|
|
86
|
+
`,w`<wui-flex> ${this.templateVisual()} ${this.templateIcon()} </wui-flex>`}templateVisual(){const[e,i]=this.images;return this.images.length===2&&(e!=null&&e.url||i!=null&&i.url)?this.renderSwapImages(e,i):e!=null&&e.url&&!this.failedImageUrls.has(e.url)?this.renderSingleImage(e):(e==null?void 0:e.type)==="NFT"?this.renderPlaceholderIcon("nftPlaceholder"):this.renderPlaceholderIcon("coinPlaceholder")}renderSwapImages(e,i){return w`<div class="swap-images-container">
|
|
87
|
+
${e!=null&&e.url?this.renderImageOrFallback(e,"first",!0):null}
|
|
88
|
+
${i!=null&&i.url?this.renderImageOrFallback(i,"last",!0):null}
|
|
89
|
+
</div>`}renderSingleImage(e){return this.renderImageOrFallback(e,void 0,!1)}renderImageOrFallback(e,i,r=!1){return e.url?this.failedImageUrls.has(e.url)?r&&i?this.renderFallbackIconInContainer(i):this.renderFallbackIcon():w`<wui-image
|
|
90
|
+
src=${e.url}
|
|
91
|
+
alt="Transaction image"
|
|
92
|
+
@onLoadError=${this.handleImageError(e.url)}
|
|
93
|
+
></wui-image>`:null}renderFallbackIconInContainer(e){return w`<div class="swap-fallback-container ${e}">${this.renderFallbackIcon()}</div>`}renderFallbackIcon(){return w`<wui-icon
|
|
94
|
+
size="xl"
|
|
95
|
+
weight="regular"
|
|
96
|
+
color="default"
|
|
97
|
+
name="networkPlaceholder"
|
|
98
|
+
></wui-icon>`}renderPlaceholderIcon(e){return w`<wui-icon size="xl" weight="regular" color="default" name=${e}></wui-icon>`}templateIcon(){let e="accent-primary",i;return i=this.getIcon(),this.status&&(e=this.getStatusColor()),i?w`
|
|
99
|
+
<wui-flex alignItems="center" justifyContent="center" class="status-box">
|
|
100
|
+
<wui-icon-box size="sm" color=${e} icon=${i}></wui-icon-box>
|
|
101
|
+
</wui-flex>
|
|
102
|
+
`:null}getDirectionIcon(){switch(this.direction){case"in":return"arrowBottom";case"out":return"arrowTop";default:return}}getIcon(){return this.onlyDirectionIcon?this.getDirectionIcon():this.type==="trade"?"swapHorizontal":this.type==="approve"?"checkmark":this.type==="cancel"?"close":this.getDirectionIcon()}getStatusColor(){switch(this.status){case"confirmed":return"success";case"failed":return"error";case"pending":return"inverse";default:return"accent-primary"}}};R.styles=[qt];U([I()],R.prototype,"type",void 0);U([I()],R.prototype,"status",void 0);U([I()],R.prototype,"direction",void 0);U([I({type:Boolean})],R.prototype,"onlyDirectionIcon",void 0);U([I({type:Array})],R.prototype,"images",void 0);U([I({type:Object})],R.prototype,"secondImage",void 0);U([Q()],R.prototype,"failedImageUrls",void 0);R=U([at("wui-transaction-visual")],R);const Vt=ot`
|
|
103
|
+
:host {
|
|
104
|
+
width: 100%;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:host > wui-flex:first-child {
|
|
108
|
+
align-items: center;
|
|
109
|
+
column-gap: ${({spacing:t})=>t[2]};
|
|
110
|
+
padding: ${({spacing:t})=>t[1]} ${({spacing:t})=>t[2]};
|
|
111
|
+
width: 100%;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:host > wui-flex:first-child wui-text:nth-child(1) {
|
|
115
|
+
text-transform: capitalize;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
wui-transaction-visual {
|
|
119
|
+
width: 40px;
|
|
120
|
+
height: 40px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
wui-flex {
|
|
124
|
+
flex: 1;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
:host wui-flex wui-flex {
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
:host .description-container wui-text span {
|
|
132
|
+
word-break: break-all;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
:host .description-container wui-text {
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:host .description-separator-icon {
|
|
140
|
+
margin: 0px 6px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:host wui-text > span {
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
display: -webkit-box;
|
|
146
|
+
-webkit-box-orient: vertical;
|
|
147
|
+
-webkit-line-clamp: 1;
|
|
148
|
+
}
|
|
149
|
+
`;var E=globalThis&&globalThis.__decorate||function(t,e,i,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,r);else for(var u=t.length-1;u>=0;u--)(s=t[u])&&(n=(o<3?s(n):o>3?s(e,i,n):s(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n};let j=class extends st{constructor(){super(...arguments),this.type="approve",this.onlyDirectionIcon=!1,this.images=[]}render(){return w`
|
|
150
|
+
<wui-flex>
|
|
151
|
+
<wui-transaction-visual
|
|
152
|
+
.status=${this.status}
|
|
153
|
+
direction=${Rt(this.direction)}
|
|
154
|
+
type=${this.type}
|
|
155
|
+
.onlyDirectionIcon=${this.onlyDirectionIcon}
|
|
156
|
+
.images=${this.images}
|
|
157
|
+
></wui-transaction-visual>
|
|
158
|
+
<wui-flex flexDirection="column" gap="1">
|
|
159
|
+
<wui-text variant="lg-medium" color="primary">
|
|
160
|
+
${xt[this.type]||this.type}
|
|
161
|
+
</wui-text>
|
|
162
|
+
<wui-flex class="description-container">
|
|
163
|
+
${this.templateDescription()} ${this.templateSecondDescription()}
|
|
164
|
+
</wui-flex>
|
|
165
|
+
</wui-flex>
|
|
166
|
+
<wui-text variant="sm-medium" color="secondary"><span>${this.date}</span></wui-text>
|
|
167
|
+
</wui-flex>
|
|
168
|
+
`}templateDescription(){var i;const e=(i=this.descriptions)==null?void 0:i[0];return e?w`
|
|
169
|
+
<wui-text variant="md-regular" color="secondary">
|
|
170
|
+
<span>${e}</span>
|
|
171
|
+
</wui-text>
|
|
172
|
+
`:null}templateSecondDescription(){var i;const e=(i=this.descriptions)==null?void 0:i[1];return e?w`
|
|
173
|
+
<wui-icon class="description-separator-icon" size="sm" name="arrowRight"></wui-icon>
|
|
174
|
+
<wui-text variant="md-regular" color="secondary">
|
|
175
|
+
<span>${e}</span>
|
|
176
|
+
</wui-text>
|
|
177
|
+
`:null}};j.styles=[Tt,Vt];E([I()],j.prototype,"type",void 0);E([I({type:Array})],j.prototype,"descriptions",void 0);E([I()],j.prototype,"date",void 0);E([I({type:Boolean})],j.prototype,"onlyDirectionIcon",void 0);E([I()],j.prototype,"status",void 0);E([I()],j.prototype,"direction",void 0);E([I({type:Array})],j.prototype,"images",void 0);j=E([at("wui-transaction-list-item")],j);const Jt=ot`
|
|
178
|
+
wui-flex {
|
|
179
|
+
position: relative;
|
|
180
|
+
display: inline-flex;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
align-items: center;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
wui-image {
|
|
186
|
+
border-radius: ${({borderRadius:t})=>t[128]};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.fallback-icon {
|
|
190
|
+
color: ${({tokens:t})=>t.theme.iconInverse};
|
|
191
|
+
border-radius: ${({borderRadius:t})=>t[3]};
|
|
192
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.direction-icon,
|
|
196
|
+
.status-image {
|
|
197
|
+
position: absolute;
|
|
198
|
+
right: 0;
|
|
199
|
+
bottom: 0;
|
|
200
|
+
border-radius: ${({borderRadius:t})=>t[128]};
|
|
201
|
+
border: 2px solid ${({tokens:t})=>t.theme.backgroundPrimary};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.direction-icon {
|
|
205
|
+
padding: ${({spacing:t})=>t["01"]};
|
|
206
|
+
color: ${({tokens:t})=>t.core.iconSuccess};
|
|
207
|
+
|
|
208
|
+
background-color: color-mix(
|
|
209
|
+
in srgb,
|
|
210
|
+
${({tokens:t})=>t.core.textSuccess} 30%,
|
|
211
|
+
${({tokens:t})=>t.theme.backgroundPrimary} 70%
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* -- Sizes --------------------------------------------------- */
|
|
216
|
+
:host([data-size='sm']) > wui-image:not(.status-image),
|
|
217
|
+
:host([data-size='sm']) > wui-flex {
|
|
218
|
+
width: 24px;
|
|
219
|
+
height: 24px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
:host([data-size='lg']) > wui-image:not(.status-image),
|
|
223
|
+
:host([data-size='lg']) > wui-flex {
|
|
224
|
+
width: 40px;
|
|
225
|
+
height: 40px;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
:host([data-size='sm']) .fallback-icon {
|
|
229
|
+
height: 16px;
|
|
230
|
+
width: 16px;
|
|
231
|
+
padding: ${({spacing:t})=>t[1]};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
:host([data-size='lg']) .fallback-icon {
|
|
235
|
+
height: 32px;
|
|
236
|
+
width: 32px;
|
|
237
|
+
padding: ${({spacing:t})=>t[1]};
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
:host([data-size='sm']) .direction-icon,
|
|
241
|
+
:host([data-size='sm']) .status-image {
|
|
242
|
+
transform: translate(40%, 30%);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
:host([data-size='lg']) .direction-icon,
|
|
246
|
+
:host([data-size='lg']) .status-image {
|
|
247
|
+
transform: translate(40%, 10%);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
:host([data-size='sm']) .status-image {
|
|
251
|
+
height: 14px;
|
|
252
|
+
width: 14px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
:host([data-size='lg']) .status-image {
|
|
256
|
+
height: 20px;
|
|
257
|
+
width: 20px;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/* -- Crop effects --------------------------------------------------- */
|
|
261
|
+
.swap-crop-left-image,
|
|
262
|
+
.swap-crop-right-image {
|
|
263
|
+
position: absolute;
|
|
264
|
+
top: 0;
|
|
265
|
+
bottom: 0;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.swap-crop-left-image {
|
|
269
|
+
left: 0;
|
|
270
|
+
clip-path: inset(0px calc(50% + 1.5px) 0px 0%);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.swap-crop-right-image {
|
|
274
|
+
right: 0;
|
|
275
|
+
clip-path: inset(0px 0px 0px calc(50% + 1.5px));
|
|
276
|
+
}
|
|
277
|
+
`;var ut=globalThis&&globalThis.__decorate||function(t,e,i,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,r);else for(var u=t.length-1;u>=0;u--)(s=t[u])&&(n=(o<3?s(n):o>3?s(e,i,n):s(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n};const wt={sm:"xxs",lg:"md"};let G=class extends st{constructor(){super(...arguments),this.type="approve",this.size="lg",this.statusImageUrl="",this.images=[]}render(){return w`<wui-flex>${this.templateVisual()} ${this.templateIcon()}</wui-flex>`}templateVisual(){switch(this.dataset.size=this.size,this.type){case"trade":return this.swapTemplate();case"fiat":return this.fiatTemplate();case"unknown":return this.unknownTemplate();default:return this.tokenTemplate()}}swapTemplate(){const[e,i]=this.images;return this.images.length===2&&(e||i)?w`
|
|
278
|
+
<wui-image class="swap-crop-left-image" src=${e} alt="Swap image"></wui-image>
|
|
279
|
+
<wui-image class="swap-crop-right-image" src=${i} alt="Swap image"></wui-image>
|
|
280
|
+
`:e?w`<wui-image src=${e} alt="Swap image"></wui-image>`:null}fiatTemplate(){return w`<wui-icon
|
|
281
|
+
class="fallback-icon"
|
|
282
|
+
size=${wt[this.size]}
|
|
283
|
+
name="dollar"
|
|
284
|
+
></wui-icon>`}unknownTemplate(){return w`<wui-icon
|
|
285
|
+
class="fallback-icon"
|
|
286
|
+
size=${wt[this.size]}
|
|
287
|
+
name="questionMark"
|
|
288
|
+
></wui-icon>`}tokenTemplate(){const[e]=this.images;return e?w`<wui-image src=${e} alt="Token image"></wui-image> `:w`<wui-icon
|
|
289
|
+
class="fallback-icon"
|
|
290
|
+
name=${this.type==="nft"?"image":"coinPlaceholder"}
|
|
291
|
+
></wui-icon>`}templateIcon(){return this.statusImageUrl?w`<wui-image
|
|
292
|
+
class="status-image"
|
|
293
|
+
src=${this.statusImageUrl}
|
|
294
|
+
alt="Status image"
|
|
295
|
+
></wui-image>`:w`<wui-icon
|
|
296
|
+
class="direction-icon"
|
|
297
|
+
size=${wt[this.size]}
|
|
298
|
+
name=${this.getTemplateIcon()}
|
|
299
|
+
></wui-icon>`}getTemplateIcon(){return this.type==="trade"?"arrowClockWise":"arrowBottom"}};G.styles=[Jt];ut([I()],G.prototype,"type",void 0);ut([I()],G.prototype,"size",void 0);ut([I()],G.prototype,"statusImageUrl",void 0);ut([I({type:Array})],G.prototype,"images",void 0);G=ut([at("wui-transaction-thumbnail")],G);const Zt=ot`
|
|
300
|
+
:host > wui-flex:first-child {
|
|
301
|
+
gap: ${({spacing:t})=>t[2]};
|
|
302
|
+
padding: ${({spacing:t})=>t[3]};
|
|
303
|
+
width: 100%;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
wui-flex {
|
|
307
|
+
display: flex;
|
|
308
|
+
flex: 1;
|
|
309
|
+
}
|
|
310
|
+
`;var Kt=globalThis&&globalThis.__decorate||function(t,e,i,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,r);else for(var u=t.length-1;u>=0;u--)(s=t[u])&&(n=(o<3?s(n):o>3?s(e,i,n):s(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n};let bt=class extends st{render(){return w`
|
|
311
|
+
<wui-flex alignItems="center" .padding=${["1","2","1","2"]}>
|
|
312
|
+
<wui-shimmer width="40px" height="40px" rounded></wui-shimmer>
|
|
313
|
+
<wui-flex flexDirection="column" gap="1">
|
|
314
|
+
<wui-shimmer width="124px" height="16px" rounded></wui-shimmer>
|
|
315
|
+
<wui-shimmer width="60px" height="14px" rounded></wui-shimmer>
|
|
316
|
+
</wui-flex>
|
|
317
|
+
<wui-shimmer width="24px" height="12px" rounded></wui-shimmer>
|
|
318
|
+
</wui-flex>
|
|
319
|
+
`}};bt.styles=[Tt,Zt];bt=Kt([at("wui-transaction-list-item-loader")],bt);const Qt=ot`
|
|
320
|
+
:host {
|
|
321
|
+
min-height: 100%;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.group-container[last-group='true'] {
|
|
325
|
+
padding-bottom: ${({spacing:t})=>t[3]};
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.contentContainer {
|
|
329
|
+
height: 280px;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.contentContainer > wui-icon-box {
|
|
333
|
+
width: 40px;
|
|
334
|
+
height: 40px;
|
|
335
|
+
border-radius: ${({borderRadius:t})=>t[3]};
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.contentContainer > .textContent {
|
|
339
|
+
width: 65%;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.emptyContainer {
|
|
343
|
+
height: 100%;
|
|
344
|
+
}
|
|
345
|
+
`;var q=globalThis&&globalThis.__decorate||function(t,e,i,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,r);else for(var u=t.length-1;u>=0;u--)(s=t[u])&&(n=(o<3?s(n):o>3?s(e,i,n):s(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n};const Dt="last-transaction",Xt=7;let k=class extends st{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.page="activity",this.caipAddress=ht.state.activeCaipAddress,this.transactionsByYear=F.state.transactionsByYear,this.loading=F.state.loading,this.empty=F.state.empty,this.next=F.state.next,F.clearCursor(),this.unsubscribe.push(ht.subscribeKey("activeCaipAddress",e=>{e&&this.caipAddress!==e&&(F.resetTransactions(),F.fetchTransactions(e)),this.caipAddress=e}),ht.subscribeKey("activeCaipNetwork",()=>{this.updateTransactionView()}),F.subscribe(e=>{this.transactionsByYear=e.transactionsByYear,this.loading=e.loading,this.empty=e.empty,this.next=e.next}))}firstUpdated(){this.updateTransactionView(),this.createPaginationObserver()}updated(){this.setPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return w` ${this.empty?null:this.templateTransactionsByYear()}
|
|
346
|
+
${this.loading?this.templateLoading():null}
|
|
347
|
+
${!this.loading&&this.empty?this.templateEmpty():null}`}updateTransactionView(){F.resetTransactions(),this.caipAddress&&F.fetchTransactions(gt.getPlainAddress(this.caipAddress))}templateTransactionsByYear(){return Object.keys(this.transactionsByYear).sort().reverse().map(i=>{const r=parseInt(i,10),o=new Array(12).fill(null).map((n,s)=>{var h;const u=Z.getTransactionGroupTitle(r,s),g=(h=this.transactionsByYear[r])==null?void 0:h[s];return{groupTitle:u,transactions:g}}).filter(({transactions:n})=>n).reverse();return o.map(({groupTitle:n,transactions:s},u)=>{const g=u===o.length-1;return s?w`
|
|
348
|
+
<wui-flex
|
|
349
|
+
flexDirection="column"
|
|
350
|
+
class="group-container"
|
|
351
|
+
last-group="${g?"true":"false"}"
|
|
352
|
+
data-testid="month-indexes"
|
|
353
|
+
>
|
|
354
|
+
<wui-flex
|
|
355
|
+
alignItems="center"
|
|
356
|
+
flexDirection="row"
|
|
357
|
+
.padding=${["2","3","3","3"]}
|
|
358
|
+
>
|
|
359
|
+
<wui-text variant="md-medium" color="secondary" data-testid="group-title">
|
|
360
|
+
${n}
|
|
361
|
+
</wui-text>
|
|
362
|
+
</wui-flex>
|
|
363
|
+
<wui-flex flexDirection="column" gap="2">
|
|
364
|
+
${this.templateTransactions(s,g)}
|
|
365
|
+
</wui-flex>
|
|
366
|
+
</wui-flex>
|
|
367
|
+
`:null})})}templateRenderTransaction(e,i){const{date:r,descriptions:o,direction:n,images:s,status:u,type:g,transfers:h,isAllNFT:y}=this.getTransactionListItemProps(e);return w`
|
|
368
|
+
<wui-transaction-list-item
|
|
369
|
+
date=${r}
|
|
370
|
+
.direction=${n}
|
|
371
|
+
id=${i&&this.next?Dt:""}
|
|
372
|
+
status=${u}
|
|
373
|
+
type=${g}
|
|
374
|
+
.images=${s}
|
|
375
|
+
.onlyDirectionIcon=${y||h.length===1}
|
|
376
|
+
.descriptions=${o}
|
|
377
|
+
></wui-transaction-list-item>
|
|
378
|
+
`}templateTransactions(e,i){return e.map((r,o)=>{const n=i&&o===e.length-1;return w`${this.templateRenderTransaction(r,n)}`})}emptyStateActivity(){return w`<wui-flex
|
|
379
|
+
class="emptyContainer"
|
|
380
|
+
flexGrow="1"
|
|
381
|
+
flexDirection="column"
|
|
382
|
+
justifyContent="center"
|
|
383
|
+
alignItems="center"
|
|
384
|
+
.padding=${["10","5","10","5"]}
|
|
385
|
+
gap="5"
|
|
386
|
+
data-testid="empty-activity-state"
|
|
387
|
+
>
|
|
388
|
+
<wui-icon-box color="default" icon="wallet" size="xl"></wui-icon-box>
|
|
389
|
+
<wui-flex flexDirection="column" alignItems="center" gap="2">
|
|
390
|
+
<wui-text align="center" variant="lg-medium" color="primary">No Transactions yet</wui-text>
|
|
391
|
+
<wui-text align="center" variant="lg-regular" color="secondary"
|
|
392
|
+
>Start trading on dApps <br />
|
|
393
|
+
to grow your wallet!</wui-text
|
|
394
|
+
>
|
|
395
|
+
</wui-flex>
|
|
396
|
+
</wui-flex>`}emptyStateAccount(){return w`<wui-flex
|
|
397
|
+
class="contentContainer"
|
|
398
|
+
alignItems="center"
|
|
399
|
+
justifyContent="center"
|
|
400
|
+
flexDirection="column"
|
|
401
|
+
gap="4"
|
|
402
|
+
data-testid="empty-account-state"
|
|
403
|
+
>
|
|
404
|
+
<wui-icon-box icon="swapHorizontal" size="lg" color="default"></wui-icon-box>
|
|
405
|
+
<wui-flex
|
|
406
|
+
class="textContent"
|
|
407
|
+
gap="2"
|
|
408
|
+
flexDirection="column"
|
|
409
|
+
justifyContent="center"
|
|
410
|
+
flexDirection="column"
|
|
411
|
+
>
|
|
412
|
+
<wui-text variant="md-regular" align="center" color="primary">No activity yet</wui-text>
|
|
413
|
+
<wui-text variant="sm-regular" align="center" color="secondary"
|
|
414
|
+
>Your next transactions will appear here</wui-text
|
|
415
|
+
>
|
|
416
|
+
</wui-flex>
|
|
417
|
+
<wui-link @click=${this.onReceiveClick.bind(this)}>Trade</wui-link>
|
|
418
|
+
</wui-flex>`}templateEmpty(){return this.page==="account"?w`${this.emptyStateAccount()}`:w`${this.emptyStateActivity()}`}templateLoading(){return this.page==="activity"?w` <wui-flex flexDirection="column" width="100%">
|
|
419
|
+
<wui-flex .padding=${["2","3","3","3"]}>
|
|
420
|
+
<wui-shimmer width="70px" height="16px" rounded></wui-shimmer>
|
|
421
|
+
</wui-flex>
|
|
422
|
+
<wui-flex flexDirection="column" gap="2" width="100%">
|
|
423
|
+
${Array(Xt).fill(w` <wui-transaction-list-item-loader></wui-transaction-list-item-loader> `).map(e=>e)}
|
|
424
|
+
</wui-flex>
|
|
425
|
+
</wui-flex>`:null}onReceiveClick(){Ot.push("WalletReceive")}createPaginationObserver(){const{projectId:e}=Nt.state;this.paginationObserver=new IntersectionObserver(([i])=>{i!=null&&i.isIntersecting&&!this.loading&&(F.fetchTransactions(gt.getPlainAddress(this.caipAddress)),At.sendEvent({type:"track",event:"LOAD_MORE_TRANSACTIONS",properties:{address:gt.getPlainAddress(this.caipAddress),projectId:e,cursor:this.next,isSmartAccount:Ct(ht.state.activeChain)===Ft.ACCOUNT_TYPES.SMART_ACCOUNT}}))},{}),this.setPaginationObserver()}setPaginationObserver(){var i,r,o;(i=this.paginationObserver)==null||i.disconnect();const e=(r=this.shadowRoot)==null?void 0:r.querySelector(`#${Dt}`);e&&((o=this.paginationObserver)==null||o.observe(e))}getTransactionListItemProps(e){var g,h,y;const i=yt.formatDate((g=e==null?void 0:e.metadata)==null?void 0:g.minedAt),r=Z.mergeTransfers((e==null?void 0:e.transfers)||[]),o=Z.getTransactionDescriptions(e,r),n=r==null?void 0:r[0],s=!!n&&(r==null?void 0:r.every($=>!!$.nft_info)),u=Z.getTransactionImages(r);return{date:i,direction:n==null?void 0:n.direction,descriptions:o,isAllNFT:s,images:u,status:(h=e.metadata)==null?void 0:h.status,transfers:r,type:(y=e.metadata)==null?void 0:y.operationType}}};k.styles=Qt;q([I()],k.prototype,"page",void 0);q([Q()],k.prototype,"caipAddress",void 0);q([Q()],k.prototype,"transactionsByYear",void 0);q([Q()],k.prototype,"loading",void 0);q([Q()],k.prototype,"empty",void 0);q([Q()],k.prototype,"next",void 0);k=q([at("w3m-activity-list")],k);
|