@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.
Files changed (77) hide show
  1. package/assets/BlockOverrides-9837a6f9.js +5 -0
  2. package/assets/ConstantsUtil-298f7898.js +1 -0
  3. package/assets/ExchangeController-d2354ec6.js +1 -0
  4. package/assets/HelpersUtil-8cddb046.js +62 -0
  5. package/assets/MathUtil-b514a570.js +1 -0
  6. package/assets/NavigationUtil-a0d0ce87.js +1 -0
  7. package/assets/NetworkUtil-220ea128.js +1 -0
  8. package/assets/PhWallet-fd2006d2.js +14 -0
  9. package/assets/{features-b72c9430.js → ReownAuthentication-468828df.js} +4 -4
  10. package/assets/SwapController-7bfd6ce7.js +1 -0
  11. package/assets/{UserAvatar-78751cb5.js → UserAvatar-456716f1.js} +1 -1
  12. package/assets/ccip-ddcec720.js +1 -0
  13. package/assets/data-capture-3e424a2c.js +242 -0
  14. package/assets/email-ea617f9c.js +90 -0
  15. package/assets/embedded-wallet-814bf005.js +410 -0
  16. package/assets/features-fd521597.js +1 -0
  17. package/assets/fortmatic-f3cb4aa6.js +13 -0
  18. package/assets/if-defined-0a35f675.js +5 -0
  19. package/assets/index-034d22a0.js +138 -0
  20. package/assets/{index-a8255d1c.css → index-05771666.css} +4 -4
  21. package/assets/index-07a61b45.js +51 -0
  22. package/assets/index-1039ded0.js +132 -0
  23. package/assets/index-123c1362.js +224 -0
  24. package/assets/index-15bbaaa0.js +7 -0
  25. package/assets/{index-073512a1.js → index-206e3e77.js} +1 -1
  26. package/assets/index-27a991e4.js +53 -0
  27. package/assets/index-2d0efdd2.js +210 -0
  28. package/assets/index-32d53c87.js +189 -0
  29. package/assets/index-3b861a37.js +102 -0
  30. package/assets/index-4207595b.js +100 -0
  31. package/assets/index-4243d275.js +43 -0
  32. package/assets/index-42ce7246.js +63 -0
  33. package/assets/index-47e87339.js +152 -0
  34. package/assets/index-48bd3fca.js +277 -0
  35. package/assets/index-49cc5044.js +46 -0
  36. package/assets/index-5788a0d6.js +468 -0
  37. package/assets/index-5824c226.js +81 -0
  38. package/assets/index-5da565ce.js +78 -0
  39. package/assets/index-685e7949.js +425 -0
  40. package/assets/index-84e8ecf6.js +647 -0
  41. package/assets/index-965fdf98.js +3425 -0
  42. package/assets/index-9d970383.js +152 -0
  43. package/assets/index-a59b6662.js +68 -0
  44. package/assets/index-b457d047.js +1062 -0
  45. package/assets/index-b65e06cc.js +27 -0
  46. package/assets/{index-2ef9f1d1.js → index-d70e4ab8.js} +66 -66
  47. package/assets/index-d7a6ceea.js +30 -0
  48. package/assets/index-d9c55c27.js +77 -0
  49. package/assets/index-db5b7889.js +77 -0
  50. package/assets/index-e3222791.js +78 -0
  51. package/assets/index-eb060c20.js +1 -0
  52. package/assets/index-f3f03959.js +90 -0
  53. package/assets/index-fcda68c9.js +19 -0
  54. package/assets/index-ff4dea43.js +85 -0
  55. package/assets/networks-14f3c0d2.js +1 -0
  56. package/assets/onramp-dcdb1a34.js +422 -0
  57. package/assets/pay-with-exchange-a64f18a3.js +280 -0
  58. package/assets/receive-ca7bc867.js +131 -0
  59. package/assets/ref-88e1be05.js +13 -0
  60. package/assets/send-8739c9fb.js +554 -0
  61. package/assets/socials-ccc593f5.js +250 -0
  62. package/assets/swaps-0a90eb06.js +1050 -0
  63. package/assets/transactions-bb8cb277.js +16 -0
  64. package/assets/{tslib.es6-82b9ba96.js → tslib.es6-db2ec995.js} +2 -2
  65. package/assets/w3m-modal-869dafbc.js +891 -0
  66. package/assets/zoraTestnet-adc7b76b.js +36 -0
  67. package/index.html +4 -4
  68. package/package.json +3 -3
  69. package/assets/basic-ca749c4c.js +0 -1435
  70. package/assets/core-806d78ea.js +0 -249
  71. package/assets/fortmatic-12e0f2e5.js +0 -13
  72. package/assets/index-372705ba.js +0 -1321
  73. package/assets/index-4be588a0.js +0 -94
  74. package/assets/index-74e34dfb.js +0 -39
  75. package/assets/index-bbb36593.js +0 -7
  76. package/assets/index-c1c8440f.js +0 -47
  77. package/assets/w3m-modal-26eff9d9.js +0 -1209
@@ -1,4 +1,4 @@
1
- import{bE as H,bD as ft}from"./index-2ef9f1d1.js";function pt(m,a){for(var h=0;h<a.length;h++){const f=a[h];if(typeof f!="string"&&!Array.isArray(f)){for(const l in f)if(l!=="default"&&!(l in m)){const r=Object.getOwnPropertyDescriptor(f,l);r&&Object.defineProperty(m,l,r.get?r:{enumerable:!0,get:()=>f[l]})}}}return Object.freeze(Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}))}var ct={exports:{}},A={exports:{}},L={exports:{}};/*!
1
+ import{i as H,g as ft}from"./index-d70e4ab8.js";function pt(m,a){for(var h=0;h<a.length;h++){const f=a[h];if(typeof f!="string"&&!Array.isArray(f)){for(const l in f)if(l!=="default"&&!(l in m)){const r=Object.getOwnPropertyDescriptor(f,l);r&&Object.defineProperty(m,l,r.get?r:{enumerable:!0,get:()=>f[l]})}}}return Object.freeze(Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}))}var ct={exports:{}},A={exports:{}},L={exports:{}};/*!
2
2
  * getSize v2.0.3
3
3
  * measure size of elements
4
4
  * MIT license
@@ -0,0 +1,53 @@
1
+ import{C as c,E as d,R as g,o as m,S as w,h as l,I as E,J as _,j as b,r as y,l as C,m as v,k as R}from"./index-48bd3fca.js";import{C as T}from"./NetworkUtil-220ea128.js";import{n as p,c as S}from"./index-84e8ecf6.js";import{o as O}from"./if-defined-0a35f675.js";function $(){try{return l.returnOpenHref(`${T.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes")}catch{throw new Error("Could not open social popup")}}async function I(){g.push("ConnectingFarcaster");const e=m.getAuthConnector();if(e){const o=c.getAccountData();if(!(o!=null&&o.farcasterUrl))try{const{url:t}=await e.provider.getFarcasterUri();c.setAccountProp("farcasterUrl",t,c.state.activeChain)}catch(t){g.goBack(),w.showError(t)}}}async function L(e){g.push("ConnectingSocial");const o=m.getAuthConnector();let t=null;try{const n=setTimeout(()=>{throw new Error("Social login timed out. Please try again.")},45e3);if(o&&e){if(l.isTelegram()||(t=$()),t)c.setAccountProp("socialWindow",E(t),c.state.activeChain);else if(!l.isTelegram())throw new Error("Could not create social popup");const{uri:i}=await o.provider.getSocialRedirectUri({provider:e});if(!i)throw t==null||t.close(),new Error("Could not fetch the social redirect uri");if(t&&(t.location.href=i),l.isTelegram()){_.setTelegramSocialProvider(e);const r=l.formatTelegramSocialLoginUrl(i);l.openHref(r,"_top")}clearTimeout(n)}}catch(n){t==null||t.close();const i=l.parseError(n);w.showError(i),d.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:e,message:i}})}}async function z(e){c.setAccountProp("socialProvider",e,c.state.activeChain),d.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}}),e==="farcaster"?await I():await L(e)}const U=b`
2
+ :host {
3
+ display: flex;
4
+ justify-content: center;
5
+ align-items: center;
6
+ width: 40px;
7
+ height: 40px;
8
+ border-radius: ${({borderRadius:e})=>e[20]};
9
+ overflow: hidden;
10
+ }
11
+
12
+ wui-icon {
13
+ width: 100%;
14
+ height: 100%;
15
+ }
16
+ `;var x=globalThis&&globalThis.__decorate||function(e,o,t,n){var i=arguments.length,r=i<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(e,o,t,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(i<3?a(r):i>3?a(o,t,r):a(o,t))||r);return i>3&&r&&Object.defineProperty(o,t,r),r};let f=class extends C{constructor(){super(...arguments),this.logo="google"}render(){return v`<wui-icon color="inherit" size="inherit" name=${this.logo}></wui-icon> `}};f.styles=[y,U];x([p()],f.prototype,"logo",void 0);f=x([S("wui-logo")],f);const j=b`
17
+ :host {
18
+ width: 100%;
19
+ }
20
+
21
+ button {
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: space-between;
25
+ padding: ${({spacing:e})=>e[3]};
26
+ width: 100%;
27
+ background-color: transparent;
28
+ border-radius: ${({borderRadius:e})=>e[4]};
29
+ }
30
+
31
+ wui-text {
32
+ text-transform: capitalize;
33
+ }
34
+
35
+ @media (hover: hover) {
36
+ button:hover:enabled {
37
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
38
+ }
39
+ }
40
+
41
+ button:disabled {
42
+ opacity: 0.5;
43
+ cursor: not-allowed;
44
+ }
45
+ `;var h=globalThis&&globalThis.__decorate||function(e,o,t,n){var i=arguments.length,r=i<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(e,o,t,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(i<3?a(r):i>3?a(o,t,r):a(o,t))||r);return i>3&&r&&Object.defineProperty(o,t,r),r};let u=class extends C{constructor(){super(...arguments),this.logo="google",this.name="Continue with google",this.disabled=!1}render(){return v`
46
+ <button ?disabled=${this.disabled} tabindex=${O(this.tabIdx)}>
47
+ <wui-flex gap="2" alignItems="center">
48
+ <wui-image ?boxed=${!0} logo=${this.logo}></wui-image>
49
+ <wui-text variant="lg-regular" color="primary">${this.name}</wui-text>
50
+ </wui-flex>
51
+ <wui-icon name="chevronRight" size="lg" color="default"></wui-icon>
52
+ </button>
53
+ `}};u.styles=[y,R,j];h([p()],u.prototype,"logo",void 0);h([p()],u.prototype,"name",void 0);h([p()],u.prototype,"tabIdx",void 0);h([p({type:Boolean})],u.prototype,"disabled",void 0);u=h([S("wui-list-social")],u);export{z as e};
@@ -0,0 +1,210 @@
1
+ import{j as g,l as f,R as u,m as e,E as P,r as k,k as A}from"./index-48bd3fca.js";import{r as y,c as b,n as w}from"./index-84e8ecf6.js";import"./index-5824c226.js";import{H as x}from"./HelpersUtil-8cddb046.js";import{o as h}from"./if-defined-0a35f675.js";import"./index-ff4dea43.js";import"./index-123c1362.js";const I=g`
2
+ :host {
3
+ display: block;
4
+ }
5
+
6
+ div.container {
7
+ position: absolute;
8
+ bottom: 0;
9
+ left: 0;
10
+ right: 0;
11
+ overflow: hidden;
12
+ height: auto;
13
+ display: block;
14
+ }
15
+
16
+ div.container[status='hide'] {
17
+ animation: fade-out;
18
+ animation-duration: var(--apkt-duration-dynamic);
19
+ animation-timing-function: ${({easings:t})=>t["ease-out-power-2"]};
20
+ animation-fill-mode: both;
21
+ animation-delay: 0s;
22
+ }
23
+
24
+ div.container[status='show'] {
25
+ animation: fade-in;
26
+ animation-duration: var(--apkt-duration-dynamic);
27
+ animation-timing-function: ${({easings:t})=>t["ease-out-power-2"]};
28
+ animation-fill-mode: both;
29
+ animation-delay: var(--apkt-duration-dynamic);
30
+ }
31
+
32
+ @keyframes fade-in {
33
+ from {
34
+ opacity: 0;
35
+ filter: blur(6px);
36
+ }
37
+ to {
38
+ opacity: 1;
39
+ filter: blur(0px);
40
+ }
41
+ }
42
+
43
+ @keyframes fade-out {
44
+ from {
45
+ opacity: 1;
46
+ filter: blur(0px);
47
+ }
48
+ to {
49
+ opacity: 0;
50
+ filter: blur(6px);
51
+ }
52
+ }
53
+ `;var $=globalThis&&globalThis.__decorate||function(t,i,n,r){var o=arguments.length,a=o<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,i,n,r);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(o<3?s(a):o>3?s(i,n,a):s(i,n))||a);return o>3&&a&&Object.defineProperty(i,n,a),a};let p=class extends f{constructor(){super(...arguments),this.resizeObserver=void 0,this.unsubscribe=[],this.status="hide",this.view=u.state.view}firstUpdated(){this.status=x.hasFooter()?"show":"hide",this.unsubscribe.push(u.subscribeKey("view",i=>{this.view=i,this.status=x.hasFooter()?"show":"hide",this.status==="hide"&&document.documentElement.style.setProperty("--apkt-footer-height","0px")})),this.resizeObserver=new ResizeObserver(i=>{for(const n of i)if(n.target===this.getWrapper()){const r=`${n.contentRect.height}px`;document.documentElement.style.setProperty("--apkt-footer-height",r)}}),this.resizeObserver.observe(this.getWrapper())}render(){return e`
54
+ <div class="container" status=${this.status}>${this.templatePageContainer()}</div>
55
+ `}templatePageContainer(){return x.hasFooter()?e` ${this.templateFooter()}`:null}templateFooter(){switch(this.view){case"Networks":return this.templateNetworksFooter();case"Connect":case"ConnectWallets":case"OnRampFiatSelect":case"OnRampTokenSelect":return e`<w3m-legal-footer></w3m-legal-footer>`;case"OnRampProviders":return e`<w3m-onramp-providers-footer></w3m-onramp-providers-footer>`;default:return null}}templateNetworksFooter(){return e` <wui-flex
56
+ class="footer-in"
57
+ padding="3"
58
+ flexDirection="column"
59
+ gap="3"
60
+ alignItems="center"
61
+ >
62
+ <wui-text variant="md-regular" color="secondary" align="center">
63
+ Your connected wallet may not support some of the networks available for this dApp
64
+ </wui-text>
65
+ <wui-link @click=${this.onNetworkHelp.bind(this)}>
66
+ <wui-icon size="sm" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
67
+ What is a network
68
+ </wui-link>
69
+ </wui-flex>`}onNetworkHelp(){P.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),u.push("WhatIsANetwork")}getWrapper(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("div.container")}};p.styles=[I];$([y()],p.prototype,"status",void 0);$([y()],p.prototype,"view",void 0);p=$([b("w3m-footer")],p);const R=g`
70
+ :host {
71
+ display: block;
72
+ width: inherit;
73
+ }
74
+ `;var W=globalThis&&globalThis.__decorate||function(t,i,n,r){var o=arguments.length,a=o<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,i,n,r);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(o<3?s(a):o>3?s(i,n,a):s(i,n))||a);return o>3&&a&&Object.defineProperty(i,n,a),a};let d=class extends f{constructor(){super(),this.unsubscribe=[],this.viewState=u.state.view,this.history=u.state.history.join(","),this.unsubscribe.push(u.subscribeKey("view",()=>{this.history=u.state.history.join(","),document.documentElement.style.setProperty("--apkt-duration-dynamic","var(--apkt-durations-lg)")}))}disconnectedCallback(){this.unsubscribe.forEach(i=>i()),document.documentElement.style.setProperty("--apkt-duration-dynamic","0s")}render(){return e`${this.templatePageContainer()}`}templatePageContainer(){return e`<w3m-router-container
75
+ history=${this.history}
76
+ .setView=${()=>{this.viewState=u.state.view}}
77
+ >
78
+ ${this.viewTemplate(this.viewState)}
79
+ </w3m-router-container>`}viewTemplate(i){switch(i){case"AccountSettings":return e`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return e`<w3m-account-view></w3m-account-view>`;case"AllWallets":return e`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return e`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return e`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return e`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":return e`<w3m-connect-view></w3m-connect-view>`;case"Create":return e`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return e`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return e`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;case"ConnectingExternal":return e`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return e`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return e`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return e`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return e`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"DataCapture":return e`<w3m-data-capture-view></w3m-data-capture-view>`;case"DataCaptureOtpConfirm":return e`<w3m-data-capture-otp-confirm-view></w3m-data-capture-otp-confirm-view>`;case"Downloads":return e`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return e`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return e`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return e`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return e`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return e`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return e`<w3m-network-switch-view></w3m-network-switch-view>`;case"ProfileWallets":return e`<w3m-profile-wallets-view></w3m-profile-wallets-view>`;case"Transactions":return e`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return e`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampTokenSelect":return e`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return e`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return e`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return e`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return e`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return e`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return e`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return e`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return e`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return e`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return e`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return e`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return e`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WalletSendConfirmed":return e`<w3m-send-confirmed-view></w3m-send-confirmed-view>`;case"WhatIsABuy":return e`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return e`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return e`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return e`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return e`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return e`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return e`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return e`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return e`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return e`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return e`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return e`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return e`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return e`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return e`<w3m-pay-loading-view></w3m-pay-loading-view>`;case"PayQuote":return e`<w3m-pay-quote-view></w3m-pay-quote-view>`;case"FundWallet":return e`<w3m-fund-wallet-view></w3m-fund-wallet-view>`;case"PayWithExchange":return e`<w3m-deposit-from-exchange-view></w3m-deposit-from-exchange-view>`;case"PayWithExchangeSelectAsset":return e`<w3m-deposit-from-exchange-select-asset-view></w3m-deposit-from-exchange-select-asset-view>`;case"UsageExceeded":return e`<w3m-usage-exceeded-view></w3m-usage-exceeded-view>`;case"SmartAccountSettings":return e`<w3m-smart-account-settings-view></w3m-smart-account-settings-view>`;default:return e`<w3m-connect-view></w3m-connect-view>`}}};d.styles=[R];W([y()],d.prototype,"viewState",void 0);W([y()],d.prototype,"history",void 0);d=W([b("w3m-router")],d);const O=g`
80
+ :host {
81
+ position: relative;
82
+ border-radius: ${({borderRadius:t})=>t[2]};
83
+ width: 40px;
84
+ height: 40px;
85
+ overflow: hidden;
86
+ background: ${({tokens:t})=>t.theme.foregroundPrimary};
87
+ display: flex;
88
+ justify-content: center;
89
+ align-items: center;
90
+ flex-wrap: wrap;
91
+ column-gap: ${({spacing:t})=>t[1]};
92
+ padding: ${({spacing:t})=>t[1]};
93
+ }
94
+
95
+ :host > wui-wallet-image {
96
+ width: 14px;
97
+ height: 14px;
98
+ border-radius: 2px;
99
+ }
100
+ `;var C=globalThis&&globalThis.__decorate||function(t,i,n,r){var o=arguments.length,a=o<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,i,n,r);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(o<3?s(a):o>3?s(i,n,a):s(i,n))||a);return o>3&&a&&Object.defineProperty(i,n,a),a};const S=4;let v=class extends f{constructor(){super(...arguments),this.walletImages=[]}render(){const i=this.walletImages.length<S;return e`${this.walletImages.slice(0,S).map(({src:n,walletName:r})=>e`
101
+ <wui-wallet-image
102
+ size="sm"
103
+ imageSrc=${n}
104
+ name=${h(r)}
105
+ ></wui-wallet-image>
106
+ `)}
107
+ ${i?[...Array(S-this.walletImages.length)].map(()=>e` <wui-wallet-image size="sm" name=""></wui-wallet-image>`):null} `}};v.styles=[k,O];C([w({type:Array})],v.prototype,"walletImages",void 0);v=C([b("wui-all-wallets-image")],v);const E=g`
108
+ :host {
109
+ width: 100%;
110
+ }
111
+
112
+ button {
113
+ column-gap: ${({spacing:t})=>t[2]};
114
+ padding: ${({spacing:t})=>t[3]};
115
+ width: 100%;
116
+ background-color: transparent;
117
+ border-radius: ${({borderRadius:t})=>t[4]};
118
+ color: ${({tokens:t})=>t.theme.textPrimary};
119
+ }
120
+
121
+ button > wui-wallet-image {
122
+ background: ${({tokens:t})=>t.theme.foregroundSecondary};
123
+ }
124
+
125
+ button > wui-text:nth-child(2) {
126
+ display: flex;
127
+ flex: 1;
128
+ }
129
+
130
+ button:hover:enabled {
131
+ background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
132
+ }
133
+
134
+ button[data-all-wallets='true'] {
135
+ background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
136
+ }
137
+
138
+ button[data-all-wallets='true']:hover:enabled {
139
+ background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
140
+ }
141
+
142
+ button:focus-visible:enabled {
143
+ background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
144
+ box-shadow: 0 0 0 4px ${({tokens:t})=>t.core.foregroundAccent020};
145
+ }
146
+
147
+ button:disabled {
148
+ background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
149
+ opacity: 0.5;
150
+ cursor: not-allowed;
151
+ }
152
+
153
+ button:disabled > wui-tag {
154
+ background-color: ${({tokens:t})=>t.core.glass010};
155
+ color: ${({tokens:t})=>t.theme.foregroundTertiary};
156
+ }
157
+
158
+ wui-flex.namespace-icon {
159
+ width: 16px;
160
+ height: 16px;
161
+ border-radius: ${({borderRadius:t})=>t.round};
162
+ background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
163
+ box-shadow: 0 0 0 2px ${({tokens:t})=>t.theme.backgroundPrimary};
164
+ transition: box-shadow var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2);
165
+ }
166
+
167
+ button:hover:enabled wui-flex.namespace-icon {
168
+ box-shadow: 0 0 0 2px ${({tokens:t})=>t.theme.foregroundPrimary};
169
+ }
170
+
171
+ wui-flex.namespace-icon > wui-icon {
172
+ width: 10px;
173
+ height: 10px;
174
+ }
175
+
176
+ wui-flex.namespace-icon:not(:first-child) {
177
+ margin-left: -4px;
178
+ }
179
+ `;var m=globalThis&&globalThis.__decorate||function(t,i,n,r){var o=arguments.length,a=o<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,i,n,r);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(o<3?s(a):o>3?s(i,n,a):s(i,n))||a);return o>3&&a&&Object.defineProperty(i,n,a),a};const z={eip155:"ethereum",solana:"solana",bip122:"bitcoin",polkadot:void 0,cosmos:void 0,sui:void 0,stacks:void 0,ton:"ton"};let l=class extends f{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.size="md",this.tabIdx=void 0,this.namespaces=[],this.disabled=!1,this.showAllWallets=!1,this.loading=!1,this.loadingSpinnerColor="accent-100"}render(){return this.dataset.size=this.size,e`
180
+ <button
181
+ ?disabled=${this.disabled}
182
+ data-all-wallets=${this.showAllWallets}
183
+ tabindex=${h(this.tabIdx)}
184
+ >
185
+ ${this.templateAllWallets()} ${this.templateWalletImage()}
186
+ <wui-flex flexDirection="column" justifyContent="center" alignItems="flex-start" gap="1">
187
+ <wui-text variant="lg-regular" color="inherit">${this.name}</wui-text>
188
+ ${this.templateNamespaces()}
189
+ </wui-flex>
190
+ ${this.templateStatus()}
191
+ <wui-icon name="chevronRight" size="lg" color="default"></wui-icon>
192
+ </button>
193
+ `}templateNamespaces(){var i;return(i=this.namespaces)!=null&&i.length?e`<wui-flex alignItems="center" gap="0">
194
+ ${this.namespaces.map((n,r)=>{var o;return e`<wui-flex
195
+ alignItems="center"
196
+ justifyContent="center"
197
+ zIndex=${(((o=this.namespaces)==null?void 0:o.length)??0)*2-r}
198
+ class="namespace-icon"
199
+ >
200
+ <wui-icon
201
+ name=${h(z[n])}
202
+ size="sm"
203
+ color="default"
204
+ ></wui-icon>
205
+ </wui-flex>`})}
206
+ </wui-flex>`:null}templateAllWallets(){return this.showAllWallets&&this.imageSrc?e` <wui-all-wallets-image .imageeSrc=${this.imageSrc}> </wui-all-wallets-image> `:this.showAllWallets&&this.walletIcon?e` <wui-wallet-image .walletIcon=${this.walletIcon} size="sm"> </wui-wallet-image> `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?e`<wui-wallet-image
207
+ size=${h(this.size==="sm"?"sm":"md")}
208
+ imageSrc=${this.imageSrc}
209
+ name=${this.name}
210
+ ></wui-wallet-image>`:!this.showAllWallets&&!this.imageSrc?e`<wui-wallet-image size="sm" name=${this.name}></wui-wallet-image>`:null}templateStatus(){return this.loading?e`<wui-loading-spinner size="lg" color="accent-primary"></wui-loading-spinner>`:this.tagLabel&&this.tagVariant?e`<wui-tag size="sm" variant=${this.tagVariant}>${this.tagLabel}</wui-tag>`:null}};l.styles=[k,A,E];m([w({type:Array})],l.prototype,"walletImages",void 0);m([w()],l.prototype,"imageSrc",void 0);m([w()],l.prototype,"name",void 0);m([w()],l.prototype,"size",void 0);m([w()],l.prototype,"tagLabel",void 0);m([w()],l.prototype,"tagVariant",void 0);m([w()],l.prototype,"walletIcon",void 0);m([w()],l.prototype,"tabIdx",void 0);m([w({type:Array})],l.prototype,"namespaces",void 0);m([w({type:Boolean})],l.prototype,"disabled",void 0);m([w({type:Boolean})],l.prototype,"showAllWallets",void 0);m([w({type:Boolean})],l.prototype,"loading",void 0);m([w({type:String})],l.prototype,"loadingSpinnerColor",void 0);l=m([b("wui-list-wallet")],l);export{d as W,p as a};
@@ -0,0 +1,189 @@
1
+ import{p as v,s as C,a as T,j as k,r as y,l as m,m as d,O as l}from"./index-48bd3fca.js";import{n as b,c as g,r as O}from"./index-84e8ecf6.js";import{o as _}from"./if-defined-0a35f675.js";import{e as j,n as L}from"./ref-88e1be05.js";const h=v({isLegalCheckboxChecked:!1}),f={state:h,subscribe(e){return C(h,()=>e(h))},subscribeKey(e,t){return T(h,e,t)},setIsLegalCheckboxChecked(e){h.isLegalCheckboxChecked=e}},R=k`
2
+ label {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ cursor: pointer;
6
+ user-select: none;
7
+ column-gap: ${({spacing:e})=>e[2]};
8
+ }
9
+
10
+ label > input[type='checkbox'] {
11
+ height: 0;
12
+ width: 0;
13
+ opacity: 0;
14
+ position: absolute;
15
+ }
16
+
17
+ label > span {
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ height: 100%;
22
+ width: 100%;
23
+ border: 1px solid ${({colors:e})=>e.neutrals400};
24
+ color: ${({colors:e})=>e.white};
25
+ background-color: transparent;
26
+ will-change: border-color, background-color;
27
+ }
28
+
29
+ label > span > wui-icon {
30
+ opacity: 0;
31
+ will-change: opacity;
32
+ }
33
+
34
+ label > input[type='checkbox']:checked + span > wui-icon {
35
+ color: ${({colors:e})=>e.white};
36
+ }
37
+
38
+ label > input[type='checkbox']:not(:checked) > span > wui-icon {
39
+ color: ${({colors:e})=>e.neutrals900};
40
+ }
41
+
42
+ label > input[type='checkbox']:checked + span > wui-icon {
43
+ opacity: 1;
44
+ }
45
+
46
+ /* -- Sizes --------------------------------------------------- */
47
+ label[data-size='lg'] > span {
48
+ width: 24px;
49
+ height: 24px;
50
+ min-width: 24px;
51
+ min-height: 24px;
52
+ border-radius: ${({borderRadius:e})=>e[10]};
53
+ }
54
+
55
+ label[data-size='md'] > span {
56
+ width: 20px;
57
+ height: 20px;
58
+ min-width: 20px;
59
+ min-height: 20px;
60
+ border-radius: ${({borderRadius:e})=>e[2]};
61
+ }
62
+
63
+ label[data-size='sm'] > span {
64
+ width: 16px;
65
+ height: 16px;
66
+ min-width: 16px;
67
+ min-height: 16px;
68
+ border-radius: ${({borderRadius:e})=>e[1]};
69
+ }
70
+
71
+ /* -- Focus states --------------------------------------------------- */
72
+ label > input[type='checkbox']:focus-visible + span,
73
+ label > input[type='checkbox']:focus + span {
74
+ border: 1px solid ${({tokens:e})=>e.core.borderAccentPrimary};
75
+ box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
76
+ }
77
+
78
+ /* -- Checked states --------------------------------------------------- */
79
+ label > input[type='checkbox']:checked + span {
80
+ background-color: ${({tokens:e})=>e.core.iconAccentPrimary};
81
+ border: 1px solid transparent;
82
+ }
83
+
84
+ /* -- Hover states --------------------------------------------------- */
85
+ input[type='checkbox']:not(:checked):not(:disabled) + span:hover {
86
+ border: 1px solid ${({colors:e})=>e.neutrals700};
87
+ background-color: ${({colors:e})=>e.neutrals800};
88
+ box-shadow: none;
89
+ }
90
+
91
+ input[type='checkbox']:checked:not(:disabled) + span:hover {
92
+ border: 1px solid transparent;
93
+ background-color: ${({colors:e})=>e.accent080};
94
+ box-shadow: none;
95
+ }
96
+
97
+ /* -- Disabled state --------------------------------------------------- */
98
+ label > input[type='checkbox']:checked:disabled + span {
99
+ border: 1px solid transparent;
100
+ opacity: 0.3;
101
+ }
102
+
103
+ label > input[type='checkbox']:not(:checked):disabled + span {
104
+ border: 1px solid ${({colors:e})=>e.neutrals700};
105
+ }
106
+
107
+ label:has(input[type='checkbox']:disabled) {
108
+ cursor: auto;
109
+ }
110
+
111
+ label > input[type='checkbox']:disabled + span {
112
+ cursor: not-allowed;
113
+ }
114
+ `;var x=globalThis&&globalThis.__decorate||function(e,t,s,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,s):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,s,i);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(o=(n<3?r(o):n>3?r(t,s,o):r(t,s))||o);return n>3&&o&&Object.defineProperty(t,s,o),o};const z={lg:"md",md:"sm",sm:"sm"};let a=class extends m{constructor(){super(...arguments),this.inputElementRef=j(),this.checked=void 0,this.disabled=!1,this.size="md"}render(){const t=z[this.size];return d`
115
+ <label data-size=${this.size}>
116
+ <input
117
+ ${L(this.inputElementRef)}
118
+ ?checked=${_(this.checked)}
119
+ ?disabled=${this.disabled}
120
+ type="checkbox"
121
+ @change=${this.dispatchChangeEvent}
122
+ />
123
+ <span>
124
+ <wui-icon name="checkmarkBold" size=${t}></wui-icon>
125
+ </span>
126
+ <slot></slot>
127
+ </label>
128
+ `}dispatchChangeEvent(){var t;this.dispatchEvent(new CustomEvent("checkboxChange",{detail:(t=this.inputElementRef.value)==null?void 0:t.checked,bubbles:!0,composed:!0}))}};a.styles=[y,R];x([b({type:Boolean})],a.prototype,"checked",void 0);x([b({type:Boolean})],a.prototype,"disabled",void 0);x([b()],a.prototype,"size",void 0);a=x([g("wui-checkbox")],a);const E=k`
129
+ :host {
130
+ display: flex;
131
+ align-items: center;
132
+ justify-content: center;
133
+ }
134
+ wui-checkbox {
135
+ padding: ${({spacing:e})=>e[3]};
136
+ }
137
+ a {
138
+ text-decoration: none;
139
+ color: ${({tokens:e})=>e.theme.textSecondary};
140
+ font-weight: 500;
141
+ }
142
+ `;var w=globalThis&&globalThis.__decorate||function(e,t,s,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,s):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,s,i);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(o=(n<3?r(o):n>3?r(t,s,o):r(t,s))||o);return n>3&&o&&Object.defineProperty(t,s,o),o};let p=class extends m{constructor(){super(),this.unsubscribe=[],this.checked=f.state.isLegalCheckboxChecked,this.unsubscribe.push(f.subscribeKey("isLegalCheckboxChecked",t=>{this.checked=t}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){var n;const{termsConditionsUrl:t,privacyPolicyUrl:s}=l.state,i=(n=l.state.features)==null?void 0:n.legalCheckbox;return!t&&!s||!i?null:d`
143
+ <wui-checkbox
144
+ ?checked=${this.checked}
145
+ @checkboxChange=${this.onCheckboxChange.bind(this)}
146
+ data-testid="wui-checkbox"
147
+ >
148
+ <wui-text color="secondary" variant="sm-regular" align="left">
149
+ I agree to our ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
150
+ </wui-text>
151
+ </wui-checkbox>
152
+ `}andTemplate(){const{termsConditionsUrl:t,privacyPolicyUrl:s}=l.state;return t&&s?"and":""}termsTemplate(){const{termsConditionsUrl:t}=l.state;return t?d`<a rel="noreferrer" target="_blank" href=${t}>terms of service</a>`:null}privacyTemplate(){const{privacyPolicyUrl:t}=l.state;return t?d`<a rel="noreferrer" target="_blank" href=${t}>privacy policy</a>`:null}onCheckboxChange(){f.setIsLegalCheckboxChecked(!this.checked)}};p.styles=[E];w([O()],p.prototype,"checked",void 0);p=w([g("w3m-legal-checkbox")],p);const P=k`
153
+ :host {
154
+ display: block;
155
+ width: 100px;
156
+ height: 100px;
157
+ }
158
+
159
+ svg {
160
+ width: 100px;
161
+ height: 100px;
162
+ }
163
+
164
+ rect {
165
+ fill: none;
166
+ stroke: ${e=>e.colors.accent100};
167
+ stroke-width: 3px;
168
+ stroke-linecap: round;
169
+ animation: dash 1s linear infinite;
170
+ }
171
+
172
+ @keyframes dash {
173
+ to {
174
+ stroke-dashoffset: 0px;
175
+ }
176
+ }
177
+ `;var $=globalThis&&globalThis.__decorate||function(e,t,s,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,s):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,s,i);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(o=(n<3?r(o):n>3?r(t,s,o):r(t,s))||o);return n>3&&o&&Object.defineProperty(t,s,o),o};let u=class extends m{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){const t=this.radius>50?50:this.radius,i=36-t,n=116+i,o=245+i,r=360+i*1.75;return d`
178
+ <svg viewBox="0 0 110 110" width="110" height="110">
179
+ <rect
180
+ x="2"
181
+ y="2"
182
+ width="106"
183
+ height="106"
184
+ rx=${t}
185
+ stroke-dasharray="${n} ${o}"
186
+ stroke-dashoffset=${r}
187
+ />
188
+ </svg>
189
+ `}};u.styles=[y,P];$([b({type:Number})],u.prototype,"radius",void 0);u=$([g("wui-loading-thumbnail")],u);export{f as O};
@@ -0,0 +1,102 @@
1
+ import{U as Q,j as Ft,r as $t,l as zt,m as Y}from"./index-48bd3fca.js";import{n as U,c as Vt}from"./index-84e8ecf6.js";import"./index-42ce7246.js";var K={},Ot=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Bt={},I={};let ht;const Ht=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];I.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};I.getSymbolTotalCodewords=function(e){return Ht[e]};I.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};I.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');ht=e};I.isKanjiModeEnabled=function(){return typeof ht<"u"};I.toSJIS=function(e){return ht(e)};var x={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+i)}}t.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},t.from=function(o,r){if(t.isValid(o))return o;try{return e(o)}catch{return r}}})(x);function At(){this.buffer=[],this.length=0}At.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let i=0;i<e;i++)this.putBit((t>>>e-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Kt=At;function J(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}J.prototype.set=function(t,e,i,o){const r=t*this.size+e;this.data[r]=i,o&&(this.reservedBit[r]=!0)};J.prototype.get=function(t,e){return this.data[t*this.size+e]};J.prototype.xor=function(t,e,i){this.data[t*this.size+e]^=i};J.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var Jt=J,bt={};(function(t){const e=I.getSymbolSize;t.getRowColCoords=function(o){if(o===1)return[];const r=Math.floor(o/7)+2,n=e(o),s=n===145?26:Math.ceil((n-13)/(2*r-2))*2,a=[n-7];for(let u=1;u<r-1;u++)a[u]=a[u-1]-s;return a.push(6),a.reverse()},t.getPositions=function(o){const r=[],n=t.getRowColCoords(o),s=n.length;for(let a=0;a<s;a++)for(let u=0;u<s;u++)a===0&&u===0||a===0&&u===s-1||a===s-1&&u===0||r.push([n[a],n[u]]);return r}})(bt);var It={};const Yt=I.getSymbolSize,yt=7;It.getPositions=function(e){const i=Yt(e);return[[0,0],[i-yt,0],[0,i-yt]]};var Nt={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(r){return r!=null&&r!==""&&!isNaN(r)&&r>=0&&r<=7},t.from=function(r){return t.isValid(r)?parseInt(r,10):void 0},t.getPenaltyN1=function(r){const n=r.size;let s=0,a=0,u=0,d=null,g=null;for(let B=0;B<n;B++){a=u=0,d=g=null;for(let p=0;p<n;p++){let w=r.get(B,p);w===d?a++:(a>=5&&(s+=e.N1+(a-5)),d=w,a=1),w=r.get(p,B),w===g?u++:(u>=5&&(s+=e.N1+(u-5)),g=w,u=1)}a>=5&&(s+=e.N1+(a-5)),u>=5&&(s+=e.N1+(u-5))}return s},t.getPenaltyN2=function(r){const n=r.size;let s=0;for(let a=0;a<n-1;a++)for(let u=0;u<n-1;u++){const d=r.get(a,u)+r.get(a,u+1)+r.get(a+1,u)+r.get(a+1,u+1);(d===4||d===0)&&s++}return s*e.N2},t.getPenaltyN3=function(r){const n=r.size;let s=0,a=0,u=0;for(let d=0;d<n;d++){a=u=0;for(let g=0;g<n;g++)a=a<<1&2047|r.get(d,g),g>=10&&(a===1488||a===93)&&s++,u=u<<1&2047|r.get(g,d),g>=10&&(u===1488||u===93)&&s++}return s*e.N3},t.getPenaltyN4=function(r){let n=0;const s=r.data.length;for(let u=0;u<s;u++)n+=r.data[u];return Math.abs(Math.ceil(n*100/s/5)-10)*e.N4};function i(o,r,n){switch(o){case t.Patterns.PATTERN000:return(r+n)%2===0;case t.Patterns.PATTERN001:return r%2===0;case t.Patterns.PATTERN010:return n%3===0;case t.Patterns.PATTERN011:return(r+n)%3===0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2===0;case t.Patterns.PATTERN101:return r*n%2+r*n%3===0;case t.Patterns.PATTERN110:return(r*n%2+r*n%3)%2===0;case t.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}t.applyMask=function(r,n){const s=n.size;for(let a=0;a<s;a++)for(let u=0;u<s;u++)n.isReserved(u,a)||n.xor(u,a,i(r,u,a))},t.getBestMask=function(r,n){const s=Object.keys(t.Patterns).length;let a=0,u=1/0;for(let d=0;d<s;d++){n(d),t.applyMask(d,r);const g=t.getPenaltyN1(r)+t.getPenaltyN2(r)+t.getPenaltyN3(r)+t.getPenaltyN4(r);t.applyMask(d,r),g<u&&(u=g,a=d)}return a}})(Nt);var X={};const _=x,j=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],G=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];X.getBlocksCount=function(e,i){switch(i){case _.L:return j[(e-1)*4+0];case _.M:return j[(e-1)*4+1];case _.Q:return j[(e-1)*4+2];case _.H:return j[(e-1)*4+3];default:return}};X.getTotalCodewordsCount=function(e,i){switch(i){case _.L:return G[(e-1)*4+0];case _.M:return G[(e-1)*4+1];case _.Q:return G[(e-1)*4+2];case _.H:return G[(e-1)*4+3];default:return}};var Tt={},Z={};const O=new Uint8Array(512),q=new Uint8Array(256);(function(){let e=1;for(let i=0;i<255;i++)O[i]=e,q[e]=i,e<<=1,e&256&&(e^=285);for(let i=255;i<512;i++)O[i]=O[i-255]})();Z.log=function(e){if(e<1)throw new Error("log("+e+")");return q[e]};Z.exp=function(e){return O[e]};Z.mul=function(e,i){return e===0||i===0?0:O[q[e]+q[i]]};(function(t){const e=Z;t.mul=function(o,r){const n=new Uint8Array(o.length+r.length-1);for(let s=0;s<o.length;s++)for(let a=0;a<r.length;a++)n[s+a]^=e.mul(o[s],r[a]);return n},t.mod=function(o,r){let n=new Uint8Array(o);for(;n.length-r.length>=0;){const s=n[0];for(let u=0;u<r.length;u++)n[u]^=e.mul(r[u],s);let a=0;for(;a<n.length&&n[a]===0;)a++;n=n.slice(a)}return n},t.generateECPolynomial=function(o){let r=new Uint8Array([1]);for(let n=0;n<o;n++)r=t.mul(r,new Uint8Array([1,e.exp(n)]));return r}})(Tt);const St=Tt;function dt(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}dt.prototype.initialize=function(e){this.degree=e,this.genPoly=St.generateECPolynomial(this.degree)};dt.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(e.length+this.degree);i.set(e);const o=St.mod(i,this.genPoly),r=this.degree-o.length;if(r>0){const n=new Uint8Array(this.degree);return n.set(o,r),n}return o};var jt=dt,Mt={},D={},gt={};gt.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var M={};const Pt="[0-9]+",Gt="[A-Z $%*+\\-./:]+";let H="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";H=H.replace(/u/g,"\\u");const Qt="(?:(?![A-Z0-9 $%*+\\-./:]|"+H+`)(?:.|[\r
2
+ ]))+`;M.KANJI=new RegExp(H,"g");M.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");M.BYTE=new RegExp(Qt,"g");M.NUMERIC=new RegExp(Pt,"g");M.ALPHANUMERIC=new RegExp(Gt,"g");const qt=new RegExp("^"+H+"$"),Wt=new RegExp("^"+Pt+"$"),xt=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");M.testKanji=function(e){return qt.test(e)};M.testNumeric=function(e){return Wt.test(e)};M.testAlphanumeric=function(e){return xt.test(e)};(function(t){const e=gt,i=M;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(n,s){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?n.ccBits[0]:s<27?n.ccBits[1]:n.ccBits[2]},t.getBestModeForData=function(n){return i.testNumeric(n)?t.NUMERIC:i.testAlphanumeric(n)?t.ALPHANUMERIC:i.testKanji(n)?t.KANJI:t.BYTE},t.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},t.isValid=function(n){return n&&n.bit&&n.ccBits};function o(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+r)}}t.from=function(n,s){if(t.isValid(n))return n;try{return o(n)}catch{return s}}})(D);(function(t){const e=I,i=X,o=x,r=D,n=gt,s=7973,a=e.getBCHDigit(s);function u(p,w,E){for(let m=1;m<=40;m++)if(w<=t.getCapacity(m,E,p))return m}function d(p,w){return r.getCharCountIndicator(p,w)+4}function g(p,w){let E=0;return p.forEach(function(m){const y=d(m.mode,w);E+=y+m.getBitsLength()}),E}function B(p,w){for(let E=1;E<=40;E++)if(g(p,E)<=t.getCapacity(E,w,r.MIXED))return E}t.from=function(w,E){return n.isValid(w)?parseInt(w,10):E},t.getCapacity=function(w,E,m){if(!n.isValid(w))throw new Error("Invalid QR Code version");typeof m>"u"&&(m=r.BYTE);const y=e.getSymbolTotalCodewords(w),f=i.getTotalCodewordsCount(w,E),l=(y-f)*8;if(m===r.MIXED)return l;const h=l-d(m,w);switch(m){case r.NUMERIC:return Math.floor(h/10*3);case r.ALPHANUMERIC:return Math.floor(h/11*2);case r.KANJI:return Math.floor(h/13);case r.BYTE:default:return Math.floor(h/8)}},t.getBestVersionForData=function(w,E){let m;const y=o.from(E,o.M);if(Array.isArray(w)){if(w.length>1)return B(w,y);if(w.length===0)return 1;m=w[0]}else m=w;return u(m.mode,m.getLength(),y)},t.getEncodedBits=function(w){if(!n.isValid(w)||w<7)throw new Error("Invalid QR Code version");let E=w<<12;for(;e.getBCHDigit(E)-a>=0;)E^=s<<e.getBCHDigit(E)-a;return w<<12|E}})(Mt);var Rt={};const at=I,Lt=1335,Xt=21522,pt=at.getBCHDigit(Lt);Rt.getEncodedBits=function(e,i){const o=e.bit<<3|i;let r=o<<10;for(;at.getBCHDigit(r)-pt>=0;)r^=Lt<<at.getBCHDigit(r)-pt;return(o<<10|r)^Xt};var _t={};const Zt=D;function v(t){this.mode=Zt.NUMERIC,this.data=t.toString()}v.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};v.prototype.getLength=function(){return this.data.length};v.prototype.getBitsLength=function(){return v.getBitsLength(this.data.length)};v.prototype.write=function(e){let i,o,r;for(i=0;i+3<=this.data.length;i+=3)o=this.data.substr(i,3),r=parseInt(o,10),e.put(r,10);const n=this.data.length-i;n>0&&(o=this.data.substr(i),r=parseInt(o,10),e.put(r,n*3+1))};var te=v;const ee=D,nt=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function F(t){this.mode=ee.ALPHANUMERIC,this.data=t}F.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};F.prototype.getLength=function(){return this.data.length};F.prototype.getBitsLength=function(){return F.getBitsLength(this.data.length)};F.prototype.write=function(e){let i;for(i=0;i+2<=this.data.length;i+=2){let o=nt.indexOf(this.data[i])*45;o+=nt.indexOf(this.data[i+1]),e.put(o,11)}this.data.length%2&&e.put(nt.indexOf(this.data[i]),6)};var ne=F,re=function(e){for(var i=[],o=e.length,r=0;r<o;r++){var n=e.charCodeAt(r);if(n>=55296&&n<=56319&&o>r+1){var s=e.charCodeAt(r+1);s>=56320&&s<=57343&&(n=(n-55296)*1024+s-56320+65536,r+=1)}if(n<128){i.push(n);continue}if(n<2048){i.push(n>>6|192),i.push(n&63|128);continue}if(n<55296||n>=57344&&n<65536){i.push(n>>12|224),i.push(n>>6&63|128),i.push(n&63|128);continue}if(n>=65536&&n<=1114111){i.push(n>>18|240),i.push(n>>12&63|128),i.push(n>>6&63|128),i.push(n&63|128);continue}i.push(239,191,189)}return new Uint8Array(i).buffer};const oe=re,ie=D;function $(t){this.mode=ie.BYTE,typeof t=="string"&&(t=oe(t)),this.data=new Uint8Array(t)}$.getBitsLength=function(e){return e*8};$.prototype.getLength=function(){return this.data.length};$.prototype.getBitsLength=function(){return $.getBitsLength(this.data.length)};$.prototype.write=function(t){for(let e=0,i=this.data.length;e<i;e++)t.put(this.data[e],8)};var se=$;const ue=D,ae=I;function z(t){this.mode=ue.KANJI,this.data=t}z.getBitsLength=function(e){return e*13};z.prototype.getLength=function(){return this.data.length};z.prototype.getBitsLength=function(){return z.getBitsLength(this.data.length)};z.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let i=ae.toSJIS(this.data[e]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
3
+ Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),t.put(i,13)}};var ce=z,Dt={exports:{}};(function(t){var e={single_source_shortest_paths:function(i,o,r){var n={},s={};s[o]=0;var a=e.PriorityQueue.make();a.push(o,0);for(var u,d,g,B,p,w,E,m,y;!a.empty();){u=a.pop(),d=u.value,B=u.cost,p=i[d]||{};for(g in p)p.hasOwnProperty(g)&&(w=p[g],E=B+w,m=s[g],y=typeof s[g]>"u",(y||m>E)&&(s[g]=E,a.push(g,E),n[g]=d))}if(typeof r<"u"&&typeof s[r]>"u"){var f=["Could not find a path from ",o," to ",r,"."].join("");throw new Error(f)}return n},extract_shortest_path_from_predecessor_list:function(i,o){for(var r=[],n=o;n;)r.push(n),i[n],n=i[n];return r.reverse(),r},find_path:function(i,o,r){var n=e.single_source_shortest_paths(i,o,r);return e.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(i){var o=e.PriorityQueue,r={},n;i=i||{};for(n in o)o.hasOwnProperty(n)&&(r[n]=o[n]);return r.queue=[],r.sorter=i.sorter||o.default_sorter,r},default_sorter:function(i,o){return i.cost-o.cost},push:function(i,o){var r={value:i,cost:o};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Dt);var le=Dt.exports;(function(t){const e=D,i=te,o=ne,r=se,n=ce,s=M,a=I,u=le;function d(f){return unescape(encodeURIComponent(f)).length}function g(f,l,h){const c=[];let C;for(;(C=f.exec(h))!==null;)c.push({data:C[0],index:C.index,mode:l,length:C[0].length});return c}function B(f){const l=g(s.NUMERIC,e.NUMERIC,f),h=g(s.ALPHANUMERIC,e.ALPHANUMERIC,f);let c,C;return a.isKanjiModeEnabled()?(c=g(s.BYTE,e.BYTE,f),C=g(s.KANJI,e.KANJI,f)):(c=g(s.BYTE_KANJI,e.BYTE,f),C=[]),l.concat(h,c,C).sort(function(b,N){return b.index-N.index}).map(function(b){return{data:b.data,mode:b.mode,length:b.length}})}function p(f,l){switch(l){case e.NUMERIC:return i.getBitsLength(f);case e.ALPHANUMERIC:return o.getBitsLength(f);case e.KANJI:return n.getBitsLength(f);case e.BYTE:return r.getBitsLength(f)}}function w(f){return f.reduce(function(l,h){const c=l.length-1>=0?l[l.length-1]:null;return c&&c.mode===h.mode?(l[l.length-1].data+=h.data,l):(l.push(h),l)},[])}function E(f){const l=[];for(let h=0;h<f.length;h++){const c=f[h];switch(c.mode){case e.NUMERIC:l.push([c,{data:c.data,mode:e.ALPHANUMERIC,length:c.length},{data:c.data,mode:e.BYTE,length:c.length}]);break;case e.ALPHANUMERIC:l.push([c,{data:c.data,mode:e.BYTE,length:c.length}]);break;case e.KANJI:l.push([c,{data:c.data,mode:e.BYTE,length:d(c.data)}]);break;case e.BYTE:l.push([{data:c.data,mode:e.BYTE,length:d(c.data)}])}}return l}function m(f,l){const h={},c={start:{}};let C=["start"];for(let A=0;A<f.length;A++){const b=f[A],N=[];for(let L=0;L<b.length;L++){const T=b[L],V=""+A+L;N.push(V),h[V]={node:T,lastCount:0},c[V]={};for(let et=0;et<C.length;et++){const P=C[et];h[P]&&h[P].node.mode===T.mode?(c[P][V]=p(h[P].lastCount+T.length,T.mode)-p(h[P].lastCount,T.mode),h[P].lastCount+=T.length):(h[P]&&(h[P].lastCount=T.length),c[P][V]=p(T.length,T.mode)+4+e.getCharCountIndicator(T.mode,l))}}C=N}for(let A=0;A<C.length;A++)c[C[A]].end=0;return{map:c,table:h}}function y(f,l){let h;const c=e.getBestModeForData(f);if(h=e.from(l,c),h!==e.BYTE&&h.bit<c.bit)throw new Error('"'+f+'" cannot be encoded with mode '+e.toString(h)+`.
4
+ Suggested mode is: `+e.toString(c));switch(h===e.KANJI&&!a.isKanjiModeEnabled()&&(h=e.BYTE),h){case e.NUMERIC:return new i(f);case e.ALPHANUMERIC:return new o(f);case e.KANJI:return new n(f);case e.BYTE:return new r(f)}}t.fromArray=function(l){return l.reduce(function(h,c){return typeof c=="string"?h.push(y(c,null)):c.data&&h.push(y(c.data,c.mode)),h},[])},t.fromString=function(l,h){const c=B(l,a.isKanjiModeEnabled()),C=E(c),A=m(C,h),b=u.find_path(A.map,"start","end"),N=[];for(let L=1;L<b.length-1;L++)N.push(A.table[b[L]].node);return t.fromArray(w(N))},t.rawSplit=function(l){return t.fromArray(B(l,a.isKanjiModeEnabled()))}})(_t);const tt=I,rt=x,fe=Kt,he=Jt,de=bt,ge=It,ct=Nt,lt=X,me=jt,W=Mt,we=Rt,ye=D,ot=_t;function pe(t,e){const i=t.size,o=ge.getPositions(e);for(let r=0;r<o.length;r++){const n=o[r][0],s=o[r][1];for(let a=-1;a<=7;a++)if(!(n+a<=-1||i<=n+a))for(let u=-1;u<=7;u++)s+u<=-1||i<=s+u||(a>=0&&a<=6&&(u===0||u===6)||u>=0&&u<=6&&(a===0||a===6)||a>=2&&a<=4&&u>=2&&u<=4?t.set(n+a,s+u,!0,!0):t.set(n+a,s+u,!1,!0))}}function Ee(t){const e=t.size;for(let i=8;i<e-8;i++){const o=i%2===0;t.set(i,6,o,!0),t.set(6,i,o,!0)}}function Ce(t,e){const i=de.getPositions(e);for(let o=0;o<i.length;o++){const r=i[o][0],n=i[o][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?t.set(r+s,n+a,!0,!0):t.set(r+s,n+a,!1,!0)}}function Be(t,e){const i=t.size,o=W.getEncodedBits(e);let r,n,s;for(let a=0;a<18;a++)r=Math.floor(a/3),n=a%3+i-8-3,s=(o>>a&1)===1,t.set(r,n,s,!0),t.set(n,r,s,!0)}function it(t,e,i){const o=t.size,r=we.getEncodedBits(e,i);let n,s;for(n=0;n<15;n++)s=(r>>n&1)===1,n<6?t.set(n,8,s,!0):n<8?t.set(n+1,8,s,!0):t.set(o-15+n,8,s,!0),n<8?t.set(8,o-n-1,s,!0):n<9?t.set(8,15-n-1+1,s,!0):t.set(8,15-n-1,s,!0);t.set(o-8,8,1,!0)}function Ae(t,e){const i=t.size;let o=-1,r=i-1,n=7,s=0;for(let a=i-1;a>0;a-=2)for(a===6&&a--;;){for(let u=0;u<2;u++)if(!t.isReserved(r,a-u)){let d=!1;s<e.length&&(d=(e[s]>>>n&1)===1),t.set(r,a-u,d),n--,n===-1&&(s++,n=7)}if(r+=o,r<0||i<=r){r-=o,o=-o;break}}}function be(t,e,i){const o=new fe;i.forEach(function(u){o.put(u.mode.bit,4),o.put(u.getLength(),ye.getCharCountIndicator(u.mode,t)),u.write(o)});const r=tt.getSymbolTotalCodewords(t),n=lt.getTotalCodewordsCount(t,e),s=(r-n)*8;for(o.getLengthInBits()+4<=s&&o.put(0,4);o.getLengthInBits()%8!==0;)o.putBit(0);const a=(s-o.getLengthInBits())/8;for(let u=0;u<a;u++)o.put(u%2?17:236,8);return Ie(o,t,e)}function Ie(t,e,i){const o=tt.getSymbolTotalCodewords(e),r=lt.getTotalCodewordsCount(e,i),n=o-r,s=lt.getBlocksCount(e,i),a=o%s,u=s-a,d=Math.floor(o/s),g=Math.floor(n/s),B=g+1,p=d-g,w=new me(p);let E=0;const m=new Array(s),y=new Array(s);let f=0;const l=new Uint8Array(t.buffer);for(let b=0;b<s;b++){const N=b<u?g:B;m[b]=l.slice(E,E+N),y[b]=w.encode(m[b]),E+=N,f=Math.max(f,N)}const h=new Uint8Array(o);let c=0,C,A;for(C=0;C<f;C++)for(A=0;A<s;A++)C<m[A].length&&(h[c++]=m[A][C]);for(C=0;C<p;C++)for(A=0;A<s;A++)h[c++]=y[A][C];return h}function Ne(t,e,i,o){let r;if(Array.isArray(t))r=ot.fromArray(t);else if(typeof t=="string"){let d=e;if(!d){const g=ot.rawSplit(t);d=W.getBestVersionForData(g,i)}r=ot.fromString(t,d||40)}else throw new Error("Invalid data");const n=W.getBestVersionForData(r,i);if(!n)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=n;else if(e<n)throw new Error(`
5
+ The chosen QR Code version cannot contain this amount of data.
6
+ Minimum version required to store current data is: `+n+`.
7
+ `);const s=be(e,i,r),a=tt.getSymbolSize(e),u=new he(a);return pe(u,e),Ee(u),Ce(u,e),it(u,i,0),e>=7&&Be(u,e),Ae(u,s),isNaN(o)&&(o=ct.getBestMask(u,it.bind(null,u,i))),ct.applyMask(o,u),it(u,i,o),{modules:u,version:e,errorCorrectionLevel:i,maskPattern:o,segments:r}}Bt.create=function(e,i){if(typeof e>"u"||e==="")throw new Error("No input text");let o=rt.M,r,n;return typeof i<"u"&&(o=rt.from(i.errorCorrectionLevel,rt.M),r=W.from(i.version),n=ct.from(i.maskPattern),i.toSJISFunc&&tt.setToSJISFunction(i.toSJISFunc)),Ne(e,r,o,n)};var kt={},mt={};(function(t){function e(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let o=i.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+i);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(n){return[n,n]}))),o.length===6&&o.push("F","F");const r=parseInt(o.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+o.slice(0,6).join("")}}t.getOptions=function(o){o||(o={}),o.color||(o.color={});const r=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,n=o.width&&o.width>=21?o.width:void 0,s=o.scale||4;return{width:n,scale:n?4:s,margin:r,color:{dark:e(o.color.dark||"#000000ff"),light:e(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},t.getScale=function(o,r){return r.width&&r.width>=o+r.margin*2?r.width/(o+r.margin*2):r.scale},t.getImageWidth=function(o,r){const n=t.getScale(o,r);return Math.floor((o+r.margin*2)*n)},t.qrToImageData=function(o,r,n){const s=r.modules.size,a=r.modules.data,u=t.getScale(s,n),d=Math.floor((s+n.margin*2)*u),g=n.margin*u,B=[n.color.light,n.color.dark];for(let p=0;p<d;p++)for(let w=0;w<d;w++){let E=(p*d+w)*4,m=n.color.light;if(p>=g&&w>=g&&p<d-g&&w<d-g){const y=Math.floor((p-g)/u),f=Math.floor((w-g)/u);m=B[a[y*s+f]?1:0]}o[E++]=m.r,o[E++]=m.g,o[E++]=m.b,o[E]=m.a}}})(mt);(function(t){const e=mt;function i(r,n,s){r.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=s,n.width=s,n.style.height=s+"px",n.style.width=s+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(n,s,a){let u=a,d=s;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(d=o()),u=e.getOptions(u);const g=e.getImageWidth(n.modules.size,u),B=d.getContext("2d"),p=B.createImageData(g,g);return e.qrToImageData(p.data,n,u),i(B,d,g),B.putImageData(p,0,0),d},t.renderToDataURL=function(n,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const d=t.render(n,s,u),g=u.type||"image/png",B=u.rendererOpts||{};return d.toDataURL(g,B.quality)}})(kt);var Ut={};const Te=mt;function Et(t,e){const i=t.a/255,o=e+'="'+t.hex+'"';return i<1?o+" "+e+'-opacity="'+i.toFixed(2).slice(1)+'"':o}function st(t,e,i){let o=t+e;return typeof i<"u"&&(o+=" "+i),o}function Se(t,e,i){let o="",r=0,n=!1,s=0;for(let a=0;a<t.length;a++){const u=Math.floor(a%e),d=Math.floor(a/e);!u&&!n&&(n=!0),t[a]?(s++,a>0&&u>0&&t[a-1]||(o+=n?st("M",u+i,.5+d+i):st("m",r,0),r=0,n=!1),u+1<e&&t[a+1]||(o+=st("h",s),s=0)):r++}return o}Ut.render=function(e,i,o){const r=Te.getOptions(i),n=e.modules.size,s=e.modules.data,a=n+r.margin*2,u=r.color.light.a?"<path "+Et(r.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",d="<path "+Et(r.color.dark,"stroke")+' d="'+Se(s,n,r.margin)+'"/>',g='viewBox="0 0 '+a+" "+a+'"',p='<svg xmlns="http://www.w3.org/2000/svg" '+(r.width?'width="'+r.width+'" height="'+r.width+'" ':"")+g+' shape-rendering="crispEdges">'+u+d+`</svg>
8
+ `;return typeof o=="function"&&o(null,p),p};const Me=Ot,ft=Bt,vt=kt,Pe=Ut;function wt(t,e,i,o,r){const n=[].slice.call(arguments,1),s=n.length,a=typeof n[s-1]=="function";if(!a&&!Me())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(r=i,i=e,e=o=void 0):s===3&&(e.getContext&&typeof r>"u"?(r=o,o=void 0):(r=o,o=i,i=e,e=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(i=e,e=o=void 0):s===2&&!e.getContext&&(o=i,i=e,e=void 0),new Promise(function(u,d){try{const g=ft.create(i,o);u(t(g,e,o))}catch(g){d(g)}})}try{const u=ft.create(i,o);r(null,t(u,e,o))}catch(u){r(u)}}K.create=ft.create;K.toCanvas=wt.bind(null,vt.render);K.toDataURL=wt.bind(null,vt.renderToDataURL);K.toString=wt.bind(null,function(t,e,i){return Pe.render(t,i)});const Re=.1,Ct=2.5,R=7;function ut(t,e,i){return t===e?!1:(t-e<0?e-t:t-e)<=i+Re}function Le(t,e){const i=Array.prototype.slice.call(K.create(t,{errorCorrectionLevel:e}).modules.data,0),o=Math.sqrt(i.length);return i.reduce((r,n,s)=>(s%o===0?r.push([n]):r[r.length-1].push(n))&&r,[])}const _e={generate({uri:t,size:e,logoSize:i,padding:o=8,dotColor:r="var(--apkt-colors-black)"}){const s=[],a=Le(t,"Q"),u=(e-2*o)/a.length,d=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];d.forEach(({x:m,y})=>{const f=(a.length-R)*u*m+o,l=(a.length-R)*u*y+o,h=.45;for(let c=0;c<d.length;c+=1){const C=u*(R-c*2);s.push(Q`
9
+ <rect
10
+ fill=${c===2?"var(--apkt-colors-black)":"var(--apkt-colors-white)"}
11
+ width=${c===0?C-10:C}
12
+ rx= ${c===0?(C-10)*h:C*h}
13
+ ry= ${c===0?(C-10)*h:C*h}
14
+ stroke=${r}
15
+ stroke-width=${c===0?10:0}
16
+ height=${c===0?C-10:C}
17
+ x= ${c===0?l+u*c+10/2:l+u*c}
18
+ y= ${c===0?f+u*c+10/2:f+u*c}
19
+ />
20
+ `)}});const g=Math.floor((i+25)/u),B=a.length/2-g/2,p=a.length/2+g/2-1,w=[];a.forEach((m,y)=>{m.forEach((f,l)=>{if(a[y][l]&&!(y<R&&l<R||y>a.length-(R+1)&&l<R||y<R&&l>a.length-(R+1))&&!(y>B&&y<p&&l>B&&l<p)){const h=y*u+u/2+o,c=l*u+u/2+o;w.push([h,c])}})});const E={};return w.forEach(([m,y])=>{var f;E[m]?(f=E[m])==null||f.push(y):E[m]=[y]}),Object.entries(E).map(([m,y])=>{const f=y.filter(l=>y.every(h=>!ut(l,h,u)));return[Number(m),f]}).forEach(([m,y])=>{y.forEach(f=>{s.push(Q`<circle cx=${m} cy=${f} fill=${r} r=${u/Ct} />`)})}),Object.entries(E).filter(([m,y])=>y.length>1).map(([m,y])=>{const f=y.filter(l=>y.some(h=>ut(l,h,u)));return[Number(m),f]}).map(([m,y])=>{y.sort((l,h)=>l<h?-1:1);const f=[];for(const l of y){const h=f.find(c=>c.some(C=>ut(l,C,u)));h?h.push(l):f.push([l])}return[m,f.map(l=>[l[0],l[l.length-1]])]}).forEach(([m,y])=>{y.forEach(([f,l])=>{s.push(Q`
21
+ <line
22
+ x1=${m}
23
+ x2=${m}
24
+ y1=${f}
25
+ y2=${l}
26
+ stroke=${r}
27
+ stroke-width=${u/(Ct/2)}
28
+ stroke-linecap="round"
29
+ />
30
+ `)})}),s}},De=Ft`
31
+ :host {
32
+ position: relative;
33
+ user-select: none;
34
+ display: block;
35
+ overflow: hidden;
36
+ aspect-ratio: 1 / 1;
37
+ width: 100%;
38
+ height: 100%;
39
+ background-color: ${({colors:t})=>t.white};
40
+ border: 1px solid ${({tokens:t})=>t.theme.borderPrimary};
41
+ }
42
+
43
+ :host {
44
+ border-radius: ${({borderRadius:t})=>t[4]};
45
+ display: flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ }
49
+
50
+ :host([data-clear='true']) > wui-icon {
51
+ display: none;
52
+ }
53
+
54
+ svg:first-child,
55
+ wui-image,
56
+ wui-icon {
57
+ position: absolute;
58
+ top: 50%;
59
+ left: 50%;
60
+ transform: translateY(-50%) translateX(-50%);
61
+ background-color: ${({tokens:t})=>t.theme.backgroundPrimary};
62
+ box-shadow: inset 0 0 0 4px ${({tokens:t})=>t.theme.backgroundPrimary};
63
+ border-radius: ${({borderRadius:t})=>t[6]};
64
+ }
65
+
66
+ wui-image {
67
+ width: 25%;
68
+ height: 25%;
69
+ border-radius: ${({borderRadius:t})=>t[2]};
70
+ }
71
+
72
+ wui-icon {
73
+ width: 100%;
74
+ height: 100%;
75
+ color: #3396ff !important;
76
+ transform: translateY(-50%) translateX(-50%) scale(0.25);
77
+ }
78
+
79
+ wui-icon > svg {
80
+ width: inherit;
81
+ height: inherit;
82
+ }
83
+ `;var k=globalThis&&globalThis.__decorate||function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let S=class extends zt{constructor(){super(...arguments),this.uri="",this.size=500,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),Y`<wui-flex
84
+ alignItems="center"
85
+ justifyContent="center"
86
+ class="wui-qr-code"
87
+ direction="column"
88
+ gap="4"
89
+ width="100%"
90
+ style="height: 100%"
91
+ >
92
+ ${this.templateVisual()} ${this.templateSvg()}
93
+ </wui-flex>`}templateSvg(){return Q`
94
+ <svg viewBox="0 0 ${this.size} ${this.size}" width="100%" height="100%">
95
+ ${_e.generate({uri:this.uri,size:this.size,logoSize:this.arenaClear?0:this.size/4})}
96
+ </svg>
97
+ `}templateVisual(){return this.imageSrc?Y`<wui-image src=${this.imageSrc} alt=${this.alt??"logo"}></wui-image>`:this.farcaster?Y`<wui-icon
98
+ class="farcaster"
99
+ size="inherit"
100
+ color="inherit"
101
+ name="farcaster"
102
+ ></wui-icon>`:Y`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`}};S.styles=[$t,De];k([U()],S.prototype,"uri",void 0);k([U({type:Number})],S.prototype,"size",void 0);k([U()],S.prototype,"theme",void 0);k([U()],S.prototype,"imageSrc",void 0);k([U()],S.prototype,"alt",void 0);k([U({type:Boolean})],S.prototype,"arenaClear",void 0);k([U({type:Boolean})],S.prototype,"farcaster",void 0);S=k([Vt("wui-qr-code")],S);