@nexus-cross/crossx-sdk-core 2.2.3-beta.4 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1393,7 +1393,18 @@ button.__crossx-connect-other-block:active {
1393
1393
  }
1394
1394
  /* ── Mobile bottom sheet ───────────────────────────────────── */
1395
1395
  @media (max-width: 480px) {
1396
- #${ee} { align-items: flex-end; }
1396
+ #${ee} {
1397
+ align-items: flex-end;
1398
+ /*
1399
+ * iOS Safari 는 soft keyboard 가 떠도 layout viewport 를 축소시키지 않아
1400
+ * \`position: fixed; inset: 0\` 인 overlay 의 하단 docking card 가 키보드에
1401
+ * 가려집니다. mountOverlay 의 visualViewport listener 가 매 resize 마다
1402
+ * layoutH - visualBottom 을 \`--cx-keyboard-inset\` 으로 publish 하므로,
1403
+ * 여기서 padding-bottom 으로 받아 카드 정렬축을 키보드 위로 끌어올립니다.
1404
+ * 키보드 닫히면 inset=0 으로 자동 복귀.
1405
+ */
1406
+ padding-bottom: var(--cx-keyboard-inset, 0px);
1407
+ }
1397
1408
  .__crossx-safe-area-fill {
1398
1409
  display: block;
1399
1410
  position: fixed;
@@ -2125,18 +2136,18 @@ button.__crossx-connect-other-block:active {
2125
2136
  .__crossx-tip-overlay.--visible {
2126
2137
  display: block;
2127
2138
  }
2128
- `;function ae(){let s=document.getElementById(ur);s||(s=document.createElement("style"),s.id=ur,document.head.appendChild(s)),s.textContent=hi}function pi(){const s=`#${ee}`,e=t=>{var n,i;(i=(n=t.target)==null?void 0:n.closest)!=null&&i.call(n,s)&&t.stopImmediatePropagation()},r=t=>{var n,i;(i=(n=t.relatedTarget)==null?void 0:n.closest)!=null&&i.call(n,s)&&t.stopImmediatePropagation()};return document.addEventListener("focusin",e,!0),document.addEventListener("focusout",r,!0),()=>{document.removeEventListener("focusin",e,!0),document.removeEventListener("focusout",r,!0)}}function ce(s){const e=s.querySelector(".__crossx-card");if(e){const o=(e.getAttribute("style")??"").match(/--cx-bg:\s*([^;]+)/);if(o){const a=o[1].trim();s.style.setProperty("--cx-bg",a);const c=document.createElement("div");c.className="__crossx-safe-area-fill",c.style.background=a,s.appendChild(c)}}const r=i=>i.stopPropagation();for(const i of["pointerdown","pointerup","mousedown","mouseup","click"])s.addEventListener(i,r);s.setAttribute("data-vaul-no-drag","");for(const i of["touchstart","touchend"])s.addEventListener(i,r);s.addEventListener("touchmove",i=>{i.stopPropagation();let o=i.target;for(;o&&o!==s;){const a=window.getComputedStyle(o);if((a.overflowY==="auto"||a.overflowY==="scroll")&&o.scrollHeight>o.clientHeight)return;o=o.parentElement}i.preventDefault()},{passive:!1});const t=pi(),n=s.remove.bind(s);s.remove=()=>{t(),n()},document.body.appendChild(s)}function _i(s){const e=Array.from(s.querySelectorAll(".__crossx-amount-tip"));if(!e.length)return;const r=document.createElement("div");r.className="__crossx-tip-overlay",s.appendChild(r);let t=null;const n=o=>{const a=o.dataset.full;if(!a)return;r.textContent=a,r.classList.add("--visible");const c=o.getBoundingClientRect(),l=r.offsetWidth,u=r.offsetHeight;let p=c.right-l,g=c.top-u-6;p<8&&(p=8),g<8&&(g=c.bottom+6),r.style.left=`${p}px`,r.style.top=`${g}px`,t=o},i=()=>{r.classList.remove("--visible"),t=null};e.forEach(o=>{o.addEventListener("mouseenter",()=>n(o)),o.addEventListener("mouseleave",i),o.addEventListener("touchstart",a=>{a.stopPropagation(),t===o?i():n(o)},{passive:!0})}),s.addEventListener("touchstart",o=>{o.target.closest(".__crossx-amount-tip")||i()},{passive:!0})}const fi=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;function Ce(){if(fi()){const e=window.scrollY;return document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.left="0",document.body.style.right="0",()=>{document.body.style.position="",document.body.style.top="",document.body.style.left="",document.body.style.right="",window.scrollTo(0,e)}}const s=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=s}}function de(s){return s?s.length<=13?s:`${s.slice(0,6)}…${s.slice(-4)}`:"—"}function Jr(s,e="CROSS",r=18,t=6){if(!s||s==="0x"||s==="0x0")return null;try{const n=BigInt(s);if(n===0n)return null;const i=At(n,r,t);if(i==="0")return null;const o=St(n,r);return Et(`${i} ${e}`,`${o} ${e}`)}catch{return null}}const pr={1:"Ethereum Mainnet",5:"Goerli Testnet",11155111:"Ethereum Sepolia",17e3:"Ethereum Holesky",10:"Optimism",420:"Optimism Goerli",42161:"Arbitrum One",421614:"Arbitrum Sepolia",8453:"Base",84532:"Base Sepolia",137:"Polygon",80002:"Polygon Amoy",56:"BNB Smart Chain",97:"BNB Testnet",43114:"Avalanche C-Chain",43113:"Avalanche Fuji",250:"Fantom Opera",2020:"Ronin",202601:"Ronin Saigon",612044:"CROSS Testnet",612055:"CROSS Mainnet"};function Zr(s){const e=parseInt(s.split(":")[1]??"",10);return!isNaN(e)&&pr[e]?pr[e]:s}function St(s,e){if(s===0n)return"0";const r=10n**BigInt(e),t=s/r,i=(s%r).toString().padStart(e,"0").replace(/0+$/,"");return i?`${t}.${i}`:`${t}`}function Et(s,e){return s===e?S(s):`<span class="__crossx-amount-tip" data-full="${S(e)}">${S(s)}</span>`}function At(s,e,r){if(s===0n)return"0";const t=10n**BigInt(e),n=s/t,a=(s%t).toString().padStart(e,"0").slice(0,r).replace(/0+$/,"");return a?`${n}.${a}`:`${n}`}function gt(s){try{const e=BigInt(s),r=e/1000000000n,n=(e%1000000000n).toString().padStart(9,"0").slice(0,2).replace(/0+$/,"");return n?`${r}.${n}`:`${r}`}catch{return s}}function gi(s){try{return BigInt(s).toLocaleString()}catch{return s}}function xi(s,e){const{gasLimit:r,gasPrice:t,maxFeePerGas:n,maxPriorityFeePerGas:i,nativeSymbol:o="ETH",nativeDecimals:a=18}=s;if(!r)return null;try{const c=BigInt(r),l=gi(r);if(n){const u=c*BigInt(n);return{isDynamic:!0,estTxFee:Et(`${At(u,a,e)} ${o}`,`${St(u,a)} ${o}`),maxFeeGwei:gt(n),maxPriorityFeeGwei:i?gt(i):void 0,gasLimitFormatted:l}}if(t){const u=c*BigInt(t);return{isDynamic:!1,estTxFee:Et(`${At(u,a,e)} ${o}`,`${St(u,a)} ${o}`),gasPriceGwei:gt(t),gasLimitFormatted:l}}return{isDynamic:!1,estTxFee:`${c.toLocaleString()} gas`,gasLimitFormatted:l}}catch{return null}}function Qr(s,e,r){const t=xi(s,e);if(!t)return Z((r==null?void 0:r.label_estimated_fee)??"Estimated fee","<span>—</span>");let n=Z((r==null?void 0:r.label_est_tx_fee)??"Est. Tx Fee",`<span>${t.estTxFee}</span>`);return t.isDynamic?(t.maxPriorityFeeGwei!==void 0&&(n+=Z((r==null?void 0:r.label_max_priority_fee)??"Max Priority Fee",`<span>${t.maxPriorityFeeGwei} Gwei</span>`)),t.maxFeeGwei!==void 0&&(n+=Z((r==null?void 0:r.label_max_gas_fee)??"Max Gas Fee",`<span>${t.maxFeeGwei} Gwei</span>`))):t.gasPriceGwei!==void 0&&(n+=Z((r==null?void 0:r.label_gas_price)??"Gas Price",`<span>${t.gasPriceGwei} Gwei</span>`)),t.gasLimitFormatted&&(n+=Z((r==null?void 0:r.label_gas_limit)??"Gas Limit",`<span>${t.gasLimitFormatted}</span>`)),n}const we=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2139
+ `;function ae(){let s=document.getElementById(ur);s||(s=document.createElement("style"),s.id=ur,document.head.appendChild(s)),s.textContent=hi}function pi(){const s=`#${ee}`,e=t=>{var n,i;(i=(n=t.target)==null?void 0:n.closest)!=null&&i.call(n,s)&&t.stopImmediatePropagation()},r=t=>{var n,i;(i=(n=t.relatedTarget)==null?void 0:n.closest)!=null&&i.call(n,s)&&t.stopImmediatePropagation()};return document.addEventListener("focusin",e,!0),document.addEventListener("focusout",r,!0),()=>{document.removeEventListener("focusin",e,!0),document.removeEventListener("focusout",r,!0)}}function ce(s){const e=s.querySelector(".__crossx-card");if(e){const a=(e.getAttribute("style")??"").match(/--cx-bg:\s*([^;]+)/);if(a){const c=a[1].trim();s.style.setProperty("--cx-bg",c);const l=document.createElement("div");l.className="__crossx-safe-area-fill",l.style.background=c,s.appendChild(l)}}const r=o=>o.stopPropagation();for(const o of["pointerdown","pointerup","mousedown","mouseup","click"])s.addEventListener(o,r);s.setAttribute("data-vaul-no-drag","");for(const o of["touchstart","touchend"])s.addEventListener(o,r);s.addEventListener("touchmove",o=>{o.stopPropagation();let a=o.target;for(;a&&a!==s;){const c=window.getComputedStyle(a);if((c.overflowY==="auto"||c.overflowY==="scroll")&&a.scrollHeight>a.clientHeight)return;a=a.parentElement}o.preventDefault()},{passive:!1});const t=pi(),n=_i(s),i=s.remove.bind(s);s.remove=()=>{n(),t(),i()},document.body.appendChild(s)}function _i(s){if(typeof window>"u")return()=>{};const e=window.visualViewport;if(!e)return()=>{};let r=-1;const t=()=>{const n=window.innerHeight,i=e.offsetTop+e.height,o=Math.max(0,Math.round(n-i));o!==r&&(r=o,s.style.setProperty("--cx-keyboard-inset",`${o}px`))};return t(),e.addEventListener("resize",t),e.addEventListener("scroll",t),()=>{e.removeEventListener("resize",t),e.removeEventListener("scroll",t),s.style.removeProperty("--cx-keyboard-inset")}}function fi(s){const e=Array.from(s.querySelectorAll(".__crossx-amount-tip"));if(!e.length)return;const r=document.createElement("div");r.className="__crossx-tip-overlay",s.appendChild(r);let t=null;const n=o=>{const a=o.dataset.full;if(!a)return;r.textContent=a,r.classList.add("--visible");const c=o.getBoundingClientRect(),l=r.offsetWidth,u=r.offsetHeight;let p=c.right-l,g=c.top-u-6;p<8&&(p=8),g<8&&(g=c.bottom+6),r.style.left=`${p}px`,r.style.top=`${g}px`,t=o},i=()=>{r.classList.remove("--visible"),t=null};e.forEach(o=>{o.addEventListener("mouseenter",()=>n(o)),o.addEventListener("mouseleave",i),o.addEventListener("touchstart",a=>{a.stopPropagation(),t===o?i():n(o)},{passive:!0})}),s.addEventListener("touchstart",o=>{o.target.closest(".__crossx-amount-tip")||i()},{passive:!0})}const gi=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;function Ce(){if(gi()){const e=window.scrollY;return document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.left="0",document.body.style.right="0",()=>{document.body.style.position="",document.body.style.top="",document.body.style.left="",document.body.style.right="",window.scrollTo(0,e)}}const s=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=s}}function de(s){return s?s.length<=13?s:`${s.slice(0,6)}…${s.slice(-4)}`:"—"}function Jr(s,e="CROSS",r=18,t=6){if(!s||s==="0x"||s==="0x0")return null;try{const n=BigInt(s);if(n===0n)return null;const i=At(n,r,t);if(i==="0")return null;const o=St(n,r);return Et(`${i} ${e}`,`${o} ${e}`)}catch{return null}}const pr={1:"Ethereum Mainnet",5:"Goerli Testnet",11155111:"Ethereum Sepolia",17e3:"Ethereum Holesky",10:"Optimism",420:"Optimism Goerli",42161:"Arbitrum One",421614:"Arbitrum Sepolia",8453:"Base",84532:"Base Sepolia",137:"Polygon",80002:"Polygon Amoy",56:"BNB Smart Chain",97:"BNB Testnet",43114:"Avalanche C-Chain",43113:"Avalanche Fuji",250:"Fantom Opera",2020:"Ronin",202601:"Ronin Saigon",612044:"CROSS Testnet",612055:"CROSS Mainnet"};function Zr(s){const e=parseInt(s.split(":")[1]??"",10);return!isNaN(e)&&pr[e]?pr[e]:s}function St(s,e){if(s===0n)return"0";const r=10n**BigInt(e),t=s/r,i=(s%r).toString().padStart(e,"0").replace(/0+$/,"");return i?`${t}.${i}`:`${t}`}function Et(s,e){return s===e?S(s):`<span class="__crossx-amount-tip" data-full="${S(e)}">${S(s)}</span>`}function At(s,e,r){if(s===0n)return"0";const t=10n**BigInt(e),n=s/t,a=(s%t).toString().padStart(e,"0").slice(0,r).replace(/0+$/,"");return a?`${n}.${a}`:`${n}`}function gt(s){try{const e=BigInt(s),r=e/1000000000n,n=(e%1000000000n).toString().padStart(9,"0").slice(0,2).replace(/0+$/,"");return n?`${r}.${n}`:`${r}`}catch{return s}}function xi(s){try{return BigInt(s).toLocaleString()}catch{return s}}function wi(s,e){const{gasLimit:r,gasPrice:t,maxFeePerGas:n,maxPriorityFeePerGas:i,nativeSymbol:o="ETH",nativeDecimals:a=18}=s;if(!r)return null;try{const c=BigInt(r),l=xi(r);if(n){const u=c*BigInt(n);return{isDynamic:!0,estTxFee:Et(`${At(u,a,e)} ${o}`,`${St(u,a)} ${o}`),maxFeeGwei:gt(n),maxPriorityFeeGwei:i?gt(i):void 0,gasLimitFormatted:l}}if(t){const u=c*BigInt(t);return{isDynamic:!1,estTxFee:Et(`${At(u,a,e)} ${o}`,`${St(u,a)} ${o}`),gasPriceGwei:gt(t),gasLimitFormatted:l}}return{isDynamic:!1,estTxFee:`${c.toLocaleString()} gas`,gasLimitFormatted:l}}catch{return null}}function Qr(s,e,r){const t=wi(s,e);if(!t)return Z((r==null?void 0:r.label_estimated_fee)??"Estimated fee","<span>—</span>");let n=Z((r==null?void 0:r.label_est_tx_fee)??"Est. Tx Fee",`<span>${t.estTxFee}</span>`);return t.isDynamic?(t.maxPriorityFeeGwei!==void 0&&(n+=Z((r==null?void 0:r.label_max_priority_fee)??"Max Priority Fee",`<span>${t.maxPriorityFeeGwei} Gwei</span>`)),t.maxFeeGwei!==void 0&&(n+=Z((r==null?void 0:r.label_max_gas_fee)??"Max Gas Fee",`<span>${t.maxFeeGwei} Gwei</span>`))):t.gasPriceGwei!==void 0&&(n+=Z((r==null?void 0:r.label_gas_price)??"Gas Price",`<span>${t.gasPriceGwei} Gwei</span>`)),t.gasLimitFormatted&&(n+=Z((r==null?void 0:r.label_gas_limit)??"Gas Limit",`<span>${t.gasLimitFormatted}</span>`)),n}const we=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2129
2140
  <rect x="9" y="9" width="13" height="13" rx="2"/>
2130
2141
  <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
2131
2142
  </svg>`,ne=`<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
2132
2143
  <line x1="18" y1="6" x2="6" y2="18"/>
2133
2144
  <line x1="6" y1="6" x2="18" y2="18"/>
2134
- </svg>`,wi=`<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2145
+ </svg>`,mi=`<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2135
2146
  <circle cx="20" cy="20" r="20" fill="#00D5AA"/>
2136
2147
  <path fill-rule="evenodd" clip-rule="evenodd" d="M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z" fill="#121212"/>
2137
- </svg>`,mi='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 318.6 318.6" aria-hidden="true"><style>.st1,.st6{fill:#e4761b;stroke:#e4761b;stroke-linecap:round;stroke-linejoin:round}.st6{fill:#f6851b;stroke:#f6851b}</style><path fill="#e2761b" stroke="#e2761b" stroke-linecap="round" stroke-linejoin="round" d="m274.1 35.5-99.5 73.9L193 65.8z"/><path d="m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z" class="st1"/><path d="m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z" class="st1"/><path fill="#d7c1b3" stroke="#d7c1b3" stroke-linecap="round" stroke-linejoin="round" d="m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"/><path fill="#233447" stroke="#233447" stroke-linecap="round" stroke-linejoin="round" d="m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"/><path fill="#cd6116" stroke="#cd6116" stroke-linecap="round" stroke-linejoin="round" d="m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"/><path fill="#e4751f" stroke="#e4751f" stroke-linecap="round" stroke-linejoin="round" d="m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"/><path d="m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z" class="st6"/><path fill="#c0ad9e" stroke="#c0ad9e" stroke-linecap="round" stroke-linejoin="round" d="m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"/><path fill="#161616" stroke="#161616" stroke-linecap="round" stroke-linejoin="round" d="m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"/><path fill="#763d16" stroke="#763d16" stroke-linecap="round" stroke-linejoin="round" d="m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"/><path d="m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z" class="st6"/></svg>',yi='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 126.611 126.611" aria-hidden="true"><polygon fill="#F3BA2F" points="38.171,53.203 62.759,28.616 87.36,53.216 101.667,38.909 62.759,0 23.864,38.896 "/><rect x="3.644" y="53.188" transform="matrix(0.7071 0.7071 -0.7071 0.7071 48.7933 8.8106)" fill="#F3BA2F" width="20.233" height="20.234"/><polygon fill="#F3BA2F" points="38.171,73.408 62.759,97.995 87.359,73.396 101.674,87.695 101.667,87.703 62.759,126.611 23.863,87.716 23.843,87.696 "/><rect x="101.64" y="53.189" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 235.5457 29.0503)" fill="#F3BA2F" width="20.234" height="20.233"/><polygon fill="#F3BA2F" points="77.271,63.298 77.277,63.298 62.759,48.78 52.03,59.509 52.029,59.509 50.797,60.742 48.254,63.285 48.254,63.285 48.234,63.305 48.254,63.326 62.759,77.831 77.277,63.313 77.284,63.305 "/></svg>',bi='<svg width="16" height="16" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><circle cx="20" cy="20" r="20" fill="#00D5AA"/><path fill-rule="evenodd" clip-rule="evenodd" d="M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z" fill="#121212"/></svg>',vi={[Le.MetaMask]:mi,[Le.Binance]:yi,[Le.CROSSx]:bi},es='<path d="M22.6667 11.8333V10.1667C22.6667 9.2475 21.9192 8.5 21.0001 8.5H10.1667C8.78841 8.5 7.66675 9.62167 7.66675 11V21C7.66675 22.8342 9.16175 23.5 10.1667 23.5H22.6667C23.5859 23.5 24.3334 22.7525 24.3334 21.8333V13.5C24.3334 12.5808 23.5859 11.8333 22.6667 11.8333ZM21.0001 19.3333H19.3334V16H21.0001V19.3333ZM10.1667 11.8333C9.95218 11.8237 9.74959 11.7317 9.60114 11.5765C9.4527 11.4213 9.36986 11.2148 9.36986 11C9.36986 10.7852 9.4527 10.5787 9.60114 10.4235C9.74959 10.2683 9.95218 10.1763 10.1667 10.1667H21.0001V11.8333H10.1667Z"/>',$t=`<svg width="20" height="20" viewBox="0 0 32 32" fill="currentColor" xmlns="http://www.w3.org/2000/svg">${es}</svg>`,Si=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
2148
+ </svg>`,yi='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 318.6 318.6" aria-hidden="true"><style>.st1,.st6{fill:#e4761b;stroke:#e4761b;stroke-linecap:round;stroke-linejoin:round}.st6{fill:#f6851b;stroke:#f6851b}</style><path fill="#e2761b" stroke="#e2761b" stroke-linecap="round" stroke-linejoin="round" d="m274.1 35.5-99.5 73.9L193 65.8z"/><path d="m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z" class="st1"/><path d="m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z" class="st1"/><path fill="#d7c1b3" stroke="#d7c1b3" stroke-linecap="round" stroke-linejoin="round" d="m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"/><path fill="#233447" stroke="#233447" stroke-linecap="round" stroke-linejoin="round" d="m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"/><path fill="#cd6116" stroke="#cd6116" stroke-linecap="round" stroke-linejoin="round" d="m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"/><path fill="#e4751f" stroke="#e4751f" stroke-linecap="round" stroke-linejoin="round" d="m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"/><path d="m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z" class="st6"/><path fill="#c0ad9e" stroke="#c0ad9e" stroke-linecap="round" stroke-linejoin="round" d="m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"/><path fill="#161616" stroke="#161616" stroke-linecap="round" stroke-linejoin="round" d="m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"/><path fill="#763d16" stroke="#763d16" stroke-linecap="round" stroke-linejoin="round" d="m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"/><path d="m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z" class="st6"/></svg>',bi='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 126.611 126.611" aria-hidden="true"><polygon fill="#F3BA2F" points="38.171,53.203 62.759,28.616 87.36,53.216 101.667,38.909 62.759,0 23.864,38.896 "/><rect x="3.644" y="53.188" transform="matrix(0.7071 0.7071 -0.7071 0.7071 48.7933 8.8106)" fill="#F3BA2F" width="20.233" height="20.234"/><polygon fill="#F3BA2F" points="38.171,73.408 62.759,97.995 87.359,73.396 101.674,87.695 101.667,87.703 62.759,126.611 23.863,87.716 23.843,87.696 "/><rect x="101.64" y="53.189" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 235.5457 29.0503)" fill="#F3BA2F" width="20.234" height="20.233"/><polygon fill="#F3BA2F" points="77.271,63.298 77.277,63.298 62.759,48.78 52.03,59.509 52.029,59.509 50.797,60.742 48.254,63.285 48.254,63.285 48.234,63.305 48.254,63.326 62.759,77.831 77.277,63.313 77.284,63.305 "/></svg>',vi='<svg width="16" height="16" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><circle cx="20" cy="20" r="20" fill="#00D5AA"/><path fill-rule="evenodd" clip-rule="evenodd" d="M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z" fill="#121212"/></svg>',Si={[Le.MetaMask]:yi,[Le.Binance]:bi,[Le.CROSSx]:vi},es='<path d="M22.6667 11.8333V10.1667C22.6667 9.2475 21.9192 8.5 21.0001 8.5H10.1667C8.78841 8.5 7.66675 9.62167 7.66675 11V21C7.66675 22.8342 9.16175 23.5 10.1667 23.5H22.6667C23.5859 23.5 24.3334 22.7525 24.3334 21.8333V13.5C24.3334 12.5808 23.5859 11.8333 22.6667 11.8333ZM21.0001 19.3333H19.3334V16H21.0001V19.3333ZM10.1667 11.8333C9.95218 11.8237 9.74959 11.7317 9.60114 11.5765C9.4527 11.4213 9.36986 11.2148 9.36986 11C9.36986 10.7852 9.4527 10.5787 9.60114 10.4235C9.74959 10.2683 9.95218 10.1763 10.1667 10.1667H21.0001V11.8333H10.1667Z"/>',$t=`<svg width="20" height="20" viewBox="0 0 32 32" fill="currentColor" xmlns="http://www.w3.org/2000/svg">${es}</svg>`,Ei=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
2138
2149
  <path d="M12 0C18.6274 0 24 5.37258 24 12C23.9999 18.6273 18.6274 24 12 24C5.37264 24 9.89594e-05 18.6273 0 12C0 5.37258 5.37258 0 12 0ZM10.875 15.127V17.377H13.125V15.127H10.875ZM10.875 6.62207V13.627H13.125V6.62207H10.875Z" fill="var(--cx-error)"/>
2139
- </svg>`,Ei=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
2150
+ </svg>`,Ai=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
2140
2151
  <circle cx="12" cy="12" r="12" fill="var(--cx-error)"/>
2141
2152
  <circle cx="12" cy="12" r="5.5" stroke="white" stroke-width="1.5"/>
2142
2153
  <path d="M12 9.5v3l2 1.5" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
@@ -2144,7 +2155,7 @@ button.__crossx-connect-other-block:active {
2144
2155
  <div class="__crossx-row">
2145
2156
  <span class="__crossx-row-label">${s}</span>
2146
2157
  <div class="__crossx-row-value">${e}</div>
2147
- </div>`}function Ai(s,e,r,t){const n=e,i=s.nativeSymbol??"ETH",o=s.nativeDecimals??18,a=ot(s.dappName),c=s.to?`<span class="__crossx-addr-text">${de(s.to)}</span>
2158
+ </div>`}function Ii(s,e,r,t){const n=e,i=s.nativeSymbol??"ETH",o=s.nativeDecimals??18,a=ot(s.dappName),c=s.to?`<span class="__crossx-addr-text">${de(s.to)}</span>
2148
2159
  <button class="__crossx-copy-btn" data-copy="${S(s.to)}" title="Copy address">${we}</button>`:"<span>—</span>",l=Qr(s,r,t),u=Jr(s.value,i,o,r),p=u?Z((t==null?void 0:t.label_value)??"Value",`<span>${u}</span>`):"",g=s.data??"0x",_=document.createElement("div");return _.id=ee,_.innerHTML=`
2149
2160
  <div class="__crossx-card __crossx-card--migration __crossx-card--sign-tx" style="${ie(n)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
2150
2161
  <div class="__crossx-header">
@@ -2181,7 +2192,7 @@ button.__crossx-connect-other-block:active {
2181
2192
  </div>
2182
2193
  </div>
2183
2194
  </div>
2184
- `,_}function Ii(s,e,r,t){const n=e,i=s.nativeSymbol??"ETH",o=s.nativeDecimals??18,a=ot(s.dappName),c=s.to?`<span class="__crossx-addr-text">${de(s.to)}</span>
2195
+ `,_}function Ti(s,e,r,t){const n=e,i=s.nativeSymbol??"ETH",o=s.nativeDecimals??18,a=ot(s.dappName),c=s.to?`<span class="__crossx-addr-text">${de(s.to)}</span>
2185
2196
  <button class="__crossx-copy-btn" data-copy="${S(s.to)}" title="Copy address">${we}</button>`:"<span>—</span>",l=Qr(s,r,t),p=Jr(s.value,i,o,r)??"—",g=document.createElement("div");return g.id=ee,g.innerHTML=`
2186
2197
  <div class="__crossx-card __crossx-card--migration __crossx-card--send-tx" style="${ie(n)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
2187
2198
  <div class="__crossx-header">
@@ -2207,7 +2218,7 @@ button.__crossx-connect-other-block:active {
2207
2218
  <button class="__crossx-approve-btn" id="__crossx-confirm-btn">${S((t==null?void 0:t.send_tx_approve_button)??"Approve")}</button>
2208
2219
  </div>
2209
2220
  </div>
2210
- `,g}function ot(s){var e;if(s)return s;try{return((e=window.location)==null?void 0:e.hostname)||"This site"}catch{return"This site"}}function S(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Ti(s){return typeof s=="string"&&/^0x[0-9a-fA-F]{40}$/i.test(s)}function ki(s){if(typeof s=="string")return S(s);if(typeof s=="number"||typeof s=="bigint"||typeof s=="boolean")return String(s);try{return S(JSON.stringify(s))}catch{return String(s)}}function Ri(s){return s.includes(":")?s.split(":")[1]??s:s}function Ni(s){return`https://www.crossscan.io/address/${s}?tab=txs`}function Oi(s,e){return`https://explorer.crosstoken.io/${Ri(s)}/tx/${e}`}function ts(s,e){return`<a class="__crossx-addr-text __crossx-row-link" href="${S(e)}" target="_blank" rel="noopener noreferrer">${S(s)}</a>`}function tt(s){return ts(de(s),Ni(s))}function rs(s,e){return ts(de(e),Oi(s,e))}function Ci(s,e,r){const t=Z((r==null?void 0:r.label_from)??"From",`${tt(s.from)}
2221
+ `,g}function ot(s){var e;if(s)return s;try{return((e=window.location)==null?void 0:e.hostname)||"This site"}catch{return"This site"}}function S(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ki(s){return typeof s=="string"&&/^0x[0-9a-fA-F]{40}$/i.test(s)}function Ri(s){if(typeof s=="string")return S(s);if(typeof s=="number"||typeof s=="bigint"||typeof s=="boolean")return String(s);try{return S(JSON.stringify(s))}catch{return String(s)}}function Ni(s){return s.includes(":")?s.split(":")[1]??s:s}function Oi(s){return`https://www.crossscan.io/address/${s}?tab=txs`}function Ci(s,e){return`https://explorer.crosstoken.io/${Ni(s)}/tx/${e}`}function ts(s,e){return`<a class="__crossx-addr-text __crossx-row-link" href="${S(e)}" target="_blank" rel="noopener noreferrer">${S(s)}</a>`}function tt(s){return ts(de(s),Oi(s))}function rs(s,e){return ts(de(e),Ci(s,e))}function Pi(s,e,r){const t=Z((r==null?void 0:r.label_from)??"From",`${tt(s.from)}
2211
2222
  <button class="__crossx-copy-btn" data-copy="${S(s.from)}" title="Copy address">${we}</button>`),n=s.to?Z((r==null?void 0:r.label_to)??"To",`${tt(s.to)}
2212
2223
  <button class="__crossx-copy-btn" data-copy="${S(s.to)}" title="Copy address">${we}</button>`):"",i=s.amount?Z((r==null?void 0:r.label_transfer)??"Transfer",`<span>${S(s.amount)}</span>`):"",o=s.fees?Z((r==null?void 0:r.label_tx_fee)??"Tx Fee",`<span>${S(s.fees)}</span>`):"",a=s.txHash?Z((r==null?void 0:r.label_tx_hash)??"Tx Hash",`${rs(s.chainId,s.txHash)}
2213
2224
  <button class="__crossx-copy-btn" data-copy="${S(s.txHash)}" title="Copy hash">${we}</button>`):"",c=s.total?`<div class="__crossx-total-pill">
@@ -2232,7 +2243,7 @@ button.__crossx-connect-other-block:active {
2232
2243
  <button class="__crossx-approve-btn" id="__crossx-done-btn">${S((r==null?void 0:r.tx_complete_done_button)??"All Done")}</button>
2233
2244
  </div>
2234
2245
  </div>
2235
- `,l}function Pi(s,e,r){const t=document.createElement("div");return t.id=ee,t.innerHTML=`
2246
+ `,l}function Li(s,e,r){const t=document.createElement("div");return t.id=ee,t.innerHTML=`
2236
2247
  <div class="__crossx-card __crossx-card--migration" style="${ie(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
2237
2248
  <div class="__crossx-header">
2238
2249
  <p class="__crossx-title" id="__crossx-ttl">${S((r==null?void 0:r.tx_progress_waiting_title)??"Waiting for confirmation")}</p>
@@ -2245,7 +2256,7 @@ button.__crossx-connect-other-block:active {
2245
2256
  </div>
2246
2257
  </div>
2247
2258
  </div>
2248
- `,t}function Li(s,e,r,t){const n=e.status!=="reverted"&&e.status!=="timeout",i=e.status==="timeout",o=s.querySelector("#__crossx-ttl"),a=s.querySelector(".__crossx-header");if(o){const y=i?Ei:n?"":Si,v=i?(t==null?void 0:t.tx_timeout)??"Transaction timeout":n?(t==null?void 0:t.tx_success)??"Transaction complete":(t==null?void 0:t.tx_failed)??"Transaction failed";y?(o.style.display="flex",o.style.alignItems="center",o.style.gap="8px",o.innerHTML=`${y}<span>${S(v)}</span>`):o.textContent=v}if(a&&!s.querySelector("#__crossx-close-btn")){const y=document.createElement("button");y.className="__crossx-close",y.id="__crossx-close-btn",y.setAttribute("aria-label","Close"),y.innerHTML=ne,a.appendChild(y)}const c=s.querySelector("#__crossx-progress-body");if(!c)return;const l=e.from?Z((t==null?void 0:t.label_from)??"From",`${tt(e.from)}
2259
+ `,t}function Di(s,e,r,t){const n=e.status!=="reverted"&&e.status!=="timeout",i=e.status==="timeout",o=s.querySelector("#__crossx-ttl"),a=s.querySelector(".__crossx-header");if(o){const y=i?Ai:n?"":Ei,v=i?(t==null?void 0:t.tx_timeout)??"Transaction timeout":n?(t==null?void 0:t.tx_success)??"Transaction complete":(t==null?void 0:t.tx_failed)??"Transaction failed";y?(o.style.display="flex",o.style.alignItems="center",o.style.gap="8px",o.innerHTML=`${y}<span>${S(v)}</span>`):o.textContent=v}if(a&&!s.querySelector("#__crossx-close-btn")){const y=document.createElement("button");y.className="__crossx-close",y.id="__crossx-close-btn",y.setAttribute("aria-label","Close"),y.innerHTML=ne,a.appendChild(y)}const c=s.querySelector("#__crossx-progress-body");if(!c)return;const l=e.from?Z((t==null?void 0:t.label_from)??"From",`${tt(e.from)}
2249
2260
  <button class="__crossx-copy-btn" data-copy="${S(e.from)}" title="Copy address">${we}</button>`):"",u=e.to?Z((t==null?void 0:t.label_to)??"To",`${tt(e.to)}
2250
2261
  <button class="__crossx-copy-btn" data-copy="${S(e.to)}" title="Copy address">${we}</button>`):"",p=e.amount?Z((t==null?void 0:t.label_transfer)??"Transfer",`<span>${S(e.amount)}</span>`):"",g=e.fees?Z((t==null?void 0:t.label_tx_fee)??"Tx Fee",`<span>${S(e.fees)}</span>`):"",_=e.txHash?Z((t==null?void 0:t.label_tx_hash)??"Tx Hash",`${rs(e.chainId,e.txHash)}
2251
2262
  <button class="__crossx-copy-btn" data-copy="${S(e.txHash)}" title="Copy hash">${we}</button>`):"",x=e.total?`<div class="__crossx-total-pill">
@@ -2261,7 +2272,7 @@ button.__crossx-connect-other-block:active {
2261
2272
  </div>
2262
2273
  ${x}
2263
2274
  <button class="__crossx-approve-btn" id="__crossx-done-btn">${S((t==null?void 0:t.tx_complete_done_button)??(n?"All Done":"Done"))}</button>
2264
- `,c.querySelectorAll(".__crossx-copy-btn").forEach(y=>{y.addEventListener("click",v=>{var R;v.stopPropagation();const A=y.dataset.copy;A&&((R=navigator.clipboard)==null||R.writeText(A).catch(()=>{}))})})}function Di(s,e,r){const t=e,n=ot(s.dappName),i=S(s.message),o=document.createElement("div");return o.id=ee,o.innerHTML=`
2275
+ `,c.querySelectorAll(".__crossx-copy-btn").forEach(y=>{y.addEventListener("click",v=>{var R;v.stopPropagation();const A=y.dataset.copy;A&&((R=navigator.clipboard)==null||R.writeText(A).catch(()=>{}))})})}function $i(s,e,r){const t=e,n=ot(s.dappName),i=S(s.message),o=document.createElement("div");return o.id=ee,o.innerHTML=`
2265
2276
  <div class="__crossx-card __crossx-card--migration __crossx-card--sign-msg" style="${ie(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
2266
2277
  <div class="__crossx-header">
2267
2278
  <p class="__crossx-title" id="__crossx-ttl">${S((r==null?void 0:r.sign_message_title)??"Signature Request")}</p>
@@ -2289,11 +2300,11 @@ button.__crossx-connect-other-block:active {
2289
2300
  </div>
2290
2301
  </div>
2291
2302
  </div>
2292
- `,o}function $i(s,e,r){const t=e,n=ot(s.dappName);let i={};if(typeof s.typedData=="string")try{i=JSON.parse(s.typedData)}catch{}else s.typedData&&typeof s.typedData=="object"&&(i=s.typedData);const o=i.primaryType??"—",a=i.message??{};let c=`
2303
+ `,o}function Bi(s,e,r){const t=e,n=ot(s.dappName);let i={};if(typeof s.typedData=="string")try{i=JSON.parse(s.typedData)}catch{}else s.typedData&&typeof s.typedData=="object"&&(i=s.typedData);const o=i.primaryType??"—",a=i.message??{};let c=`
2293
2304
  <div class="__crossx-td-row">
2294
2305
  <span class="__crossx-td-label">${S((r==null?void 0:r.label_primary_type)??"Primary Type")}</span>
2295
2306
  <span class="__crossx-td-value">${S(o)}</span>
2296
- </div>`;for(const[u,p]of Object.entries(a)){const g=ki(p),x=Ti(p)?`<span class="__crossx-addr-text">${de(p)}</span>
2307
+ </div>`;for(const[u,p]of Object.entries(a)){const g=Ri(p),x=ki(p)?`<span class="__crossx-addr-text">${de(p)}</span>
2297
2308
  <button class="__crossx-copy-btn" data-copy="${S(String(p))}" title="Copy">${we}</button>`:`<span>${g}</span>`;c+=`
2298
2309
  <div class="__crossx-td-row">
2299
2310
  <span class="__crossx-td-label">${S(u)}</span>
@@ -2326,10 +2337,10 @@ button.__crossx-connect-other-block:active {
2326
2337
  </div>
2327
2338
  </div>
2328
2339
  </div>
2329
- `,l}const Bi=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
2340
+ `,l}const Mi=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
2330
2341
  <line x1="12" y1="5" x2="12" y2="19"/>
2331
2342
  <line x1="5" y1="12" x2="19" y2="12"/>
2332
- </svg>`,Mi='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="var(--cx-primary, #019d92)"/><path d="M7.5 12.5L10.5 15.5L16.5 8.5" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';function ss(s){return s.name||`Account ${s.index+1}`}function Fi(){return`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><rect width="32" height="32" rx="16" fill="#121212" fill-opacity="0.1"/><g fill="#121212" fill-opacity="0.5">${es}</g></svg>`}const Ui=mr().portraitBaseUrl;function Hi(s,e){const r=e.replace("#","");return`${Ui}/portrait/evm/${s}.png?size=256&bg=${r}`}function ns(s,e,r){const t=Hi(s,r),i=Fi().replace(/"/g,"&quot;");return`<span class="__crossx-wallet-avatar"><img class="__crossx-wallet-avatar-img" src="${t}" alt="" onerror="this.style.display='none';this.nextElementSibling.innerHTML='${i}';this.nextElementSibling.style.display='flex';"><span class="__crossx-wallet-avatar-fallback"></span></span>`}function Wi(s,e,r,t){const n=r==null?void 0:r.toLowerCase(),i=s.map(a=>{const c=n&&a.address.toLowerCase()===n,l=c?" __crossx-wallet-item--selected":"",u=c?`<span class="__crossx-wallet-selected">${S((t==null?void 0:t.wallet_selector_selected)??"Selected")}</span><span class="__crossx-wallet-check">${Mi}</span>`:"";return`<button class="__crossx-wallet-item${l}" data-wallet-index="${a.index}" data-wallet-address="${S(a.address)}">
2343
+ </svg>`,Fi='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="var(--cx-primary, #019d92)"/><path d="M7.5 12.5L10.5 15.5L16.5 8.5" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';function ss(s){return s.name||`Account ${s.index+1}`}function Ui(){return`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><rect width="32" height="32" rx="16" fill="#121212" fill-opacity="0.1"/><g fill="#121212" fill-opacity="0.5">${es}</g></svg>`}const Hi=mr().portraitBaseUrl;function Wi(s,e){const r=e.replace("#","");return`${Hi}/portrait/evm/${s}.png?size=256&bg=${r}`}function ns(s,e,r){const t=Wi(s,r),i=Ui().replace(/"/g,"&quot;");return`<span class="__crossx-wallet-avatar"><img class="__crossx-wallet-avatar-img" src="${t}" alt="" onerror="this.style.display='none';this.nextElementSibling.innerHTML='${i}';this.nextElementSibling.style.display='flex';"><span class="__crossx-wallet-avatar-fallback"></span></span>`}function Gi(s,e,r,t){const n=r==null?void 0:r.toLowerCase(),i=s.map(a=>{const c=n&&a.address.toLowerCase()===n,l=c?" __crossx-wallet-item--selected":"",u=c?`<span class="__crossx-wallet-selected">${S((t==null?void 0:t.wallet_selector_selected)??"Selected")}</span><span class="__crossx-wallet-check">${Fi}</span>`:"";return`<button class="__crossx-wallet-item${l}" data-wallet-index="${a.index}" data-wallet-address="${S(a.address)}">
2333
2344
  ${ns(a.address,a.index,e.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${S(ss(a))}</span><span class="__crossx-wallet-addr">${de(a.address)}</span></span>${u}
2334
2345
  </button>`}).join(""),o=document.createElement("div");return o.id=ee,o.innerHTML=`
2335
2346
  <div class="__crossx-card __crossx-card--migration __crossx-card--wallet-selector" style="${ie(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
@@ -2355,7 +2366,7 @@ button.__crossx-connect-other-block:active {
2355
2366
  ${i}
2356
2367
  </div>
2357
2368
  <button class="__crossx-wallet-add" id="__crossx-add-wallet-btn" type="button">
2358
- <span class="__crossx-wallet-add-icon">${Bi}</span>
2369
+ <span class="__crossx-wallet-add-icon">${Mi}</span>
2359
2370
  <span class="__crossx-wallet-add-label">${S((t==null?void 0:t.wallet_selector_add_button)??"add a wallet")}</span>
2360
2371
  </button>
2361
2372
  <p class="__crossx-wallet-add-error" id="__crossx-add-wallet-error" role="alert" aria-live="polite" hidden></p>
@@ -2363,22 +2374,22 @@ button.__crossx-connect-other-block:active {
2363
2374
  </div>
2364
2375
  </div>
2365
2376
  </div>
2366
- `,o}const Gi=`<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2377
+ `,o}const qi=`<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2367
2378
  <path d="M26.693 21.193c-.028-3.168 2.587-4.712 2.706-4.786-1.477-2.16-3.77-2.454-4.58-2.484-1.944-.197-3.804 1.148-4.793 1.148-.992 0-2.52-1.12-4.147-1.09-2.13.032-4.1 1.239-5.198 3.133-2.222 3.855-.569 9.562 1.593 12.69 1.061 1.535 2.318 3.258 3.975 3.196 1.6-.064 2.2-1.03 4.133-1.03 1.928 0 2.48 1.03 4.172.997 1.72-.03 2.806-1.56 3.862-3.1 1.211-1.779 1.713-3.495 1.74-3.583-.037-.017-3.427-1.316-3.463-5.09z" fill="currentColor"/>
2368
2379
  <path d="M23.527 11.876c.877-1.065 1.471-2.545 1.31-4.024-1.266.053-2.807.845-3.718 1.907-.813.946-1.53 2.468-1.34 3.915 1.41.107 2.852-.716 3.748-1.798z" fill="currentColor"/>
2369
- </svg>`,qi=`<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2380
+ </svg>`,Ki=`<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2370
2381
  <path d="M38.06 20.44c0-1.34-.12-2.63-.34-3.87H20.5v7.32h9.84c-.42 2.28-1.71 4.21-3.65 5.51v4.57h5.91c3.46-3.19 5.46-7.88 5.46-13.53z" fill="#4285F4"/>
2371
2382
  <path d="M20.5 38.5c4.94 0 9.09-1.64 12.12-4.44l-5.91-4.57c-1.64 1.1-3.73 1.75-6.21 1.75-4.77 0-8.82-3.22-10.26-7.55H4.16v4.72A18.49 18.49 0 0 0 20.5 38.5z" fill="#34A853"/>
2372
2383
  <path d="M10.24 23.69A11.16 11.16 0 0 1 9.66 20c0-1.28.22-2.52.58-3.69v-4.72H4.16A18.49 18.49 0 0 0 2 20c0 2.97.71 5.78 1.97 8.28l6.27-4.59z" fill="#FBBC05"/>
2373
2384
  <path d="M20.5 8.76c2.69 0 5.1.92 7 2.73l5.24-5.24C29.58 3.36 25.43 1.5 20.5 1.5A18.49 18.49 0 0 0 4.16 11.59l6.08 4.72C11.68 11.98 15.73 8.76 20.5 8.76z" fill="#EA4335"/>
2374
- </svg>`;function Ki(s){const e=gr(s);return`<span class="__crossx-connect-other-wallet-desc-part"><span class="__crossx-connect-other-wallet-icon" aria-hidden="true">${vi[s]??""}</span><span class="__crossx-connect-other-wallet-name">${S(e)}</span></span>`}function Vi(s){if(s.length===0)return"";const e=n=>Ki(s[n]),r="Supported wallets include ";if(s.length===1)return`${r}${e(0)}.`;if(s.length===2)return`${r}${e(0)} and ${e(1)}.`;if(s.length===3)return`${r}${e(0)}, ${e(1)} and ${e(2)}.`;const t=s.length-3;return`${r}${e(0)}, ${e(1)}, ${e(2)}, and ${t} more.`}function zi(s,e=[],r){const t=s,n=S(String(e[0])),i=S((r==null?void 0:r.login_selector_or)??"or"),o=e.length>0?`
2385
+ </svg>`;function Vi(s){const e=gr(s);return`<span class="__crossx-connect-other-wallet-desc-part"><span class="__crossx-connect-other-wallet-icon" aria-hidden="true">${Si[s]??""}</span><span class="__crossx-connect-other-wallet-name">${S(e)}</span></span>`}function zi(s){if(s.length===0)return"";const e=n=>Vi(s[n]),r="Supported wallets include ";if(s.length===1)return`${r}${e(0)}.`;if(s.length===2)return`${r}${e(0)} and ${e(1)}.`;if(s.length===3)return`${r}${e(0)}, ${e(1)} and ${e(2)}.`;const t=s.length-3;return`${r}${e(0)}, ${e(1)}, ${e(2)}, and ${t} more.`}function ji(s,e=[],r){const t=s,n=S(String(e[0])),i=S((r==null?void 0:r.login_selector_or)??"or"),o=e.length>0?`
2375
2386
  <div class="__crossx-login-or-divider">
2376
2387
  <hr><span>${i}</span><hr>
2377
2388
  </div>
2378
2389
  <button type="button" class="__crossx-connect-other-block" id="__crossx-connect-other-wallet-btn" data-wallet-id="${n}" aria-labelledby="__crossx-connect-other-heading">
2379
2390
  <span class="__crossx-connect-other-text">
2380
2391
  <span class="__crossx-connect-other-title" id="__crossx-connect-other-heading">${S((r==null?void 0:r.login_selector_connect_other_wallets)??"Connect with Other Wallets")}</span>
2381
- <span class="__crossx-connect-other-desc __crossx-connect-other-summary">${Vi(e)}</span>
2392
+ <span class="__crossx-connect-other-desc __crossx-connect-other-summary">${zi(e)}</span>
2382
2393
  </span>
2383
2394
  </button>`:"",a=document.createElement("div");return a.id=ee,a.innerHTML=`
2384
2395
  <div class="__crossx-card __crossx-card--migration" style="${ie(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
@@ -2393,11 +2404,11 @@ button.__crossx-connect-other-block:active {
2393
2404
  <div class="__crossx-body">
2394
2405
  <div class="__crossx-login-btn-row">
2395
2406
  <button class="__crossx-login-btn" id="__crossx-apple-btn" type="button">
2396
- <span class="__crossx-login-icon" style="color:var(--cx-value);">${Gi}</span>
2407
+ <span class="__crossx-login-icon" style="color:var(--cx-value);">${qi}</span>
2397
2408
  <span class="__crossx-login-btn-label">${S((r==null?void 0:r.login_selector_apple)??"Sign in with Apple")}</span>
2398
2409
  </button>
2399
2410
  <button class="__crossx-login-btn" id="__crossx-google-btn" type="button">
2400
- <span class="__crossx-login-icon">${qi}</span>
2411
+ <span class="__crossx-login-icon">${Ki}</span>
2401
2412
  <span class="__crossx-login-btn-label">${S((r==null?void 0:r.login_selector_google)??"Sign in with Google")}</span>
2402
2413
  </button>
2403
2414
  </div>${o}
@@ -2406,7 +2417,7 @@ button.__crossx-connect-other-block:active {
2406
2417
  </p>
2407
2418
  </div>
2408
2419
  </div>
2409
- `,a}function ji(s,e){const r=s,t=document.createElement("div");t.id=ee;const n=S(e.message).replace(/\n/g,"<br>"),i=e.email?`<div class="__crossx-session-account-card">
2420
+ `,a}function Yi(s,e){const r=s,t=document.createElement("div");t.id=ee;const n=S(e.message).replace(/\n/g,"<br>"),i=e.email?`<div class="__crossx-session-account-card">
2410
2421
  <p class="__crossx-session-account-label">${S(e.accountLabel)}</p>
2411
2422
  <p class="__crossx-session-account-email">${S(e.email)}</p>
2412
2423
  </div>`:"";return t.innerHTML=`
@@ -2428,7 +2439,7 @@ button.__crossx-connect-other-block:active {
2428
2439
  </div>
2429
2440
  </div>
2430
2441
  </div>
2431
- `,t}function Yi(s,e=!0){const r=s,t=e?`<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${ne}</button>`:"",n=e?'<button class="__crossx-skip-btn" id="__crossx-skip-btn">Skip for Now</button>':"",i=document.createElement("div");return i.id=ee,i.innerHTML=`
2442
+ `,t}function Xi(s,e=!0){const r=s,t=e?`<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${ne}</button>`:"",n=e?'<button class="__crossx-skip-btn" id="__crossx-skip-btn">Skip for Now</button>':"",i=document.createElement("div");return i.id=ee,i.innerHTML=`
2432
2443
  <div class="__crossx-card __crossx-card--migration" style="${ie(r)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
2433
2444
  <div class="__crossx-header">
2434
2445
  <p class="__crossx-title" id="__crossx-ttl">Wallet Found on Social Account 🎉</p>
@@ -2442,13 +2453,13 @@ button.__crossx-connect-other-block:active {
2442
2453
  <p class="__crossx-mig-info-desc">It safely restores and integrates all your previous assets. Simply verify your PIN to get started.</p>
2443
2454
  </div>
2444
2455
  <button class="__crossx-recover-btn" id="__crossx-recover-btn">
2445
- <span class="__crossx-recover-icon">${wi}</span>
2456
+ <span class="__crossx-recover-icon">${mi}</span>
2446
2457
  <span class="__crossx-recover-label">Import from Social Backup</span>
2447
2458
  </button>
2448
2459
  ${n}
2449
2460
  </div>
2450
2461
  </div>
2451
- `,i}function Xi(s,e){const r=s,{errorMessage:t,attemptCount:n,maxAttempts:i=5}=e??{},o=!!t,a=o?" --error":"",c=n!=null&&n>0?`<p class="__crossx-pin-attempt">${n}/${i}</p>`:"",l=n!=null&&n>=3?'<p class="__crossx-pin-warning">Your account will be locked after further failures.</p>':"",u=o?`<p class="__crossx-pin-error-text">${t}</p>`:"",p=document.createElement("div");return p.id=ee,p.innerHTML=`
2462
+ `,i}function Ji(s,e){const r=s,{errorMessage:t,attemptCount:n,maxAttempts:i=5}=e??{},o=!!t,a=o?" --error":"",c=n!=null&&n>0?`<p class="__crossx-pin-attempt">${n}/${i}</p>`:"",l=n!=null&&n>=3?'<p class="__crossx-pin-warning">Your account will be locked after further failures.</p>':"",u=o?`<p class="__crossx-pin-error-text">${t}</p>`:"",p=document.createElement("div");return p.id=ee,p.innerHTML=`
2452
2463
  <div class="__crossx-card __crossx-card--migration" style="${ie(r)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
2453
2464
  <div class="__crossx-header">
2454
2465
  <p class="__crossx-title" id="__crossx-ttl">Import from Social Backup</p>
@@ -2468,7 +2479,7 @@ button.__crossx-connect-other-block:active {
2468
2479
  ${u}
2469
2480
  </div>
2470
2481
  </div>
2471
- `,p}function Ji(s){const e=new Date(s),r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],n=r[e.getDay()],i=t[e.getMonth()],o=e.getDate(),a=String(e.getHours()).padStart(2,"0"),c=String(e.getMinutes()).padStart(2,"0");return`${n}, ${i} ${o} ${a}:${c}`}function Zi(s,e,r){const t=s,n=e<=0,i=n?null:Date.now()+e*1e3,o=i?Ji(i):null,a=document.createElement("div");return a.id=ee,a.innerHTML=`
2482
+ `,p}function Zi(s){const e=new Date(s),r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],n=r[e.getDay()],i=t[e.getMonth()],o=e.getDate(),a=String(e.getHours()).padStart(2,"0"),c=String(e.getMinutes()).padStart(2,"0");return`${n}, ${i} ${o} ${a}:${c}`}function Qi(s,e,r){const t=s,n=e<=0,i=n?null:Date.now()+e*1e3,o=i?Zi(i):null,a=document.createElement("div");return a.id=ee,a.innerHTML=`
2472
2483
  <div class="__crossx-card __crossx-card--migration" style="${ie(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
2473
2484
  <div class="__crossx-header">
2474
2485
  <p class="__crossx-title" id="__crossx-ttl">Import from Social Backup</p>
@@ -2488,9 +2499,9 @@ button.__crossx-connect-other-block:active {
2488
2499
  </div>
2489
2500
  </div>
2490
2501
  </div>
2491
- `,{overlay:a,startCountdown:l=>{if(n||!i)return()=>{};const p=setInterval(()=>{Date.now()>=i&&(clearInterval(p),l())},1e3);return()=>clearInterval(p)}}}function Qi(s){const r=[s.check1,s.check2].map((t,n)=>`
2502
+ `,{overlay:a,startCountdown:l=>{if(n||!i)return()=>{};const p=setInterval(()=>{Date.now()>=i&&(clearInterval(p),l())},1e3);return()=>clearInterval(p)}}}function eo(s){const r=[s.check1,s.check2].map((t,n)=>`
2492
2503
  <div class="__crossx-pw-notice-item" data-check-index="${n}" role="checkbox" aria-checked="false" tabindex="0">
2493
- <div class="__crossx-pw-notice-check" id="__crossx-notice-check-${n}">${so}</div>
2504
+ <div class="__crossx-pw-notice-check" id="__crossx-notice-check-${n}">${no}</div>
2494
2505
  <span class="__crossx-pw-notice-item-text">${S(t)}</span>
2495
2506
  </div>
2496
2507
  `).join("");return`
@@ -2504,7 +2515,7 @@ button.__crossx-connect-other-block:active {
2504
2515
  <div class="__crossx-pw-fields __crossx-pw-fields--notice">
2505
2516
  <div class="__crossx-pw-notice-header">
2506
2517
  <div class="__crossx-pw-notice-title-row">
2507
- <span class="__crossx-pw-notice-icon">${no}</span>
2518
+ <span class="__crossx-pw-notice-icon">${io}</span>
2508
2519
  <p class="__crossx-pw-notice-title">${S(s.noticeTitle)}</p>
2509
2520
  </div>
2510
2521
  <p class="__crossx-pw-notice-desc">${S(s.noticeDesc)}</p>
@@ -2543,7 +2554,7 @@ button.__crossx-connect-other-block:active {
2543
2554
  <div class="__crossx-pin6-numpad-row">
2544
2555
  <button type="button" class="__crossx-pin6-numpad-key --empty" aria-hidden="true"></button>
2545
2556
  <button type="button" class="__crossx-pin6-numpad-key${_}" data-key="0">0</button>
2546
- <button type="button" class="__crossx-pin6-numpad-key --delete${_}" data-key="backspace" aria-label="Delete">${ro}</button>
2557
+ <button type="button" class="__crossx-pin6-numpad-key --delete${_}" data-key="backspace" aria-label="Delete">${so}</button>
2547
2558
  </div>
2548
2559
  </div>`;return`
2549
2560
  <div class="__crossx-header">
@@ -2570,16 +2581,16 @@ button.__crossx-connect-other-block:active {
2570
2581
  <div class="__crossx-card __crossx-card--pin6" style="${ie(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
2571
2582
  ${e}
2572
2583
  </div>
2573
- `,r}function eo(s,e){if(s.length!==6)return e.tooShort;if(!/^\d+$/.test(s))return e.numbersOnly;if(/(.)\1{2}/.test(s))return e.repeatingDigit;const r=s.split("").map(Number),t=r.every((i,o)=>o===0||i===(r[o-1]+1)%10),n=r.every((i,o)=>o===0||i===(r[o-1]+9)%10);return t||n?e.sequential:s[0]!==s[1]&&s===s.slice(0,2).repeat(3)?e.alternatingPattern:null}function to(s){const e=Math.max(0,Math.ceil(s/1e3)),r=Math.floor(e/3600),t=Math.floor(e%3600/60),n=e%60;return r>0?`${r}h ${String(t).padStart(2,"0")}m`:`${String(t).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function wt(s,e,r,t,n,i,o){var C,W;let a=!!(i&&i>Date.now()),c=!1;const l=()=>Array.from(s.querySelectorAll(".__crossx-pin6-box")),u=()=>s.querySelector("#__crossx-pin6-boxes"),p=()=>s.querySelector("#__crossx-pin6-error"),g=()=>s.querySelector("#__crossx-pin6-lock-msg"),_=()=>s.querySelector("#__crossx-pin6-lock-countdown"),x=()=>s.querySelector(".__crossx-pin6-body"),y="●",v=(b,E)=>{b.dataset.digit=E,b.value=y},A=b=>{delete b.dataset.digit,b.value=""},R=b=>b.dataset.digit??"",k=()=>l().map(R).join(""),L=()=>Array.from(s.querySelectorAll(".__crossx-pin6-dot")),D=()=>{var N;const b=l(),E=L();if(E.length&&(E.forEach((I,U)=>{const K=!!(b[U]&&R(b[U]));I.classList.toggle("--filled",K),I.classList.toggle("--active",!1)}),!a&&!c)){const I=b.findIndex(K=>!R(K));(N=E[I===-1?5:I])==null||N.classList.add("--active")}},z=()=>{s.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach(E=>E.classList.toggle("--disabled",a)),L().forEach(E=>E.classList.toggle("--locked",a)),D()},Q=b=>{a=b,l().forEach(E=>{E.disabled=b,E.classList.toggle("--locked",b)})},q=()=>s.querySelector("#__crossx-pin6-attempt"),J=()=>{const b=p();b&&(b.textContent="")},te=()=>o??"Your account will be locked after further failures.",G=()=>s.querySelector("#__crossx-pin6-warning"),B=b=>{var N;let E=G();if(!E){E=document.createElement("p"),E.className="__crossx-pin6-warning",E.id="__crossx-pin6-warning";const I=p();I?I.insertAdjacentElement("afterend",E):(N=x())==null||N.appendChild(E)}E.textContent=b},H=()=>{const b=G();b&&(b.textContent="")},m=(b,E)=>{var I;let N=q();if(!N){N=document.createElement("p"),N.className="__crossx-pin6-attempt",N.id="__crossx-pin6-attempt";const U=G()??p();U?U.insertAdjacentElement("afterend",N):(I=x())==null||I.appendChild(N)}N.textContent=`${b}/${E}`},w=()=>{const b=q();b&&(b.textContent="")},T=b=>{const E=p();E&&(E.textContent=b);const N=u();N==null||N.classList.add("--shake"),setTimeout(()=>N==null?void 0:N.classList.remove("--shake"),500),l().forEach(A),setTimeout(()=>{var I;(I=l()[0])==null||I.focus(),D()},50)},O=b=>{var K;Q(!0),l().forEach(A),z();const E=p();if(E&&(E.textContent="Too many failed attempts. Please wait."),!g()){const j=document.createElement("p");j.className="__crossx-pin6-lock-msg",j.id="__crossx-pin6-lock-msg",j.innerHTML=`${is}<span id="__crossx-pin6-lock-countdown"></span>`;const V=p();V?V.insertAdjacentElement("afterend",j):(K=x())==null||K.appendChild(j)}const N=()=>{var Y;const j=b-Date.now(),V=_();j<=0?(clearInterval(I),Q(!1),(Y=g())==null||Y.remove(),E&&(E.textContent=""),z(),setTimeout(()=>{var Ee;return(Ee=l()[0])==null?void 0:Ee.focus()},50)):V&&(V.textContent=` ${to(j)}`)},I=setInterval(N,1e3);N();const U=new MutationObserver(()=>{document.contains(s)||(clearInterval(I),U.disconnect())});U.observe(document.body,{childList:!0,subtree:!1})},F=async()=>{if(a||c)return;const b=k();if(b.length===6){c=!0,l().forEach(E=>{E.disabled=!0});try{if(n){const E=await n(b);E.ok?e(b):E.lockExpiresAt?(w(),O(E.lockExpiresAt)):(T(E.error??"Incorrect PIN. Please try again."),E.attemptCount!=null&&E.maxAttempts!=null?(B(te()),m(E.attemptCount,E.maxAttempts)):(H(),w()))}else e(b)}catch(E){t&&t(E)}finally{c=!1,a||l().forEach(E=>{E.disabled=!1}),D()}}};i&&i>Date.now()?O(i):setTimeout(()=>{var b;return(b=l()[0])==null?void 0:b.focus()},100);const $=()=>{if(a||c)return;const b=l(),E=b.find(N=>!R(N))??b[b.length-1];E==null||E.focus()};(C=u())==null||C.addEventListener("click",b=>{b.target.classList.contains("__crossx-pin6-box")||$()}),(W=x())==null||W.addEventListener("click",b=>{const E=b.target;E.classList.contains("__crossx-pin6-box")||E.closest("button")||$()}),l().forEach((b,E)=>{b.addEventListener("input",()=>{var I;const N=b.value.replace(/\D/g,"").slice(-1);N?v(b,N):A(b),J(),N&&E<5&&((I=l()[E+1])==null||I.focus()),D(),k().length===6&&setTimeout(F,80)}),b.addEventListener("keydown",N=>{var I,U;if(N.key==="Backspace"){if(N.preventDefault(),R(b))A(b);else if(E>0){const K=l()[E-1];A(K),K.focus()}D()}else N.key==="ArrowLeft"&&E>0?(N.preventDefault(),(I=l()[E-1])==null||I.focus()):N.key==="ArrowRight"&&E<5?(N.preventDefault(),(U=l()[E+1])==null||U.focus()):N.key==="Escape"&&r()}),b.addEventListener("paste",N=>{var K,j;N.preventDefault();const I=(((K=N.clipboardData)==null?void 0:K.getData("text"))??"").replace(/\D/g,"").slice(0,6);if(!I)return;const U=l();I.split("").forEach((V,Y)=>{U[Y]&&v(U[Y],V)}),(j=U[Math.min(I.length-1,5)])==null||j.focus(),J(),D(),k().length===6&&setTimeout(F,80)}),b.addEventListener("focus",()=>b.select())});const M=s.querySelector("#__crossx-pin6-numpad");if(M){let b=null;const E=()=>{b&&(b.classList.remove("--pressed"),b=null)};M.addEventListener("pointerdown",I=>{const U=I.target.closest(".__crossx-pin6-numpad-key");!U||a||c||(E(),b=U,U.classList.add("--pressed"),U.setPointerCapture(I.pointerId))});const N=I=>{const U=I.dataset.key;if(!U)return;if(U==="backspace"){const Y=[...l()].reverse().find(Ee=>R(Ee));Y&&(A(Y),J()),D();return}if(!/^\d$/.test(U))return;const j=l().find(V=>!R(V));j&&(v(j,U),J(),D(),k().length===6&&setTimeout(F,80))};M.addEventListener("pointerup",I=>{if(!b)return;const U=b;E();const K=U.getBoundingClientRect();I.clientX>=K.left&&I.clientX<=K.right&&I.clientY>=K.top&&I.clientY<=K.bottom&&!a&&!c&&N(U)}),M.addEventListener("pointercancel",E),M.addEventListener("pointerleave",E,!0),D(),i&&i>Date.now()&&z()}}const ro=`<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
2584
+ `,r}function to(s,e){if(s.length!==6)return e.tooShort;if(!/^\d+$/.test(s))return e.numbersOnly;if(/(.)\1{2}/.test(s))return e.repeatingDigit;const r=s.split("").map(Number),t=r.every((i,o)=>o===0||i===(r[o-1]+1)%10),n=r.every((i,o)=>o===0||i===(r[o-1]+9)%10);return t||n?e.sequential:s[0]!==s[1]&&s===s.slice(0,2).repeat(3)?e.alternatingPattern:null}function ro(s){const e=Math.max(0,Math.ceil(s/1e3)),r=Math.floor(e/3600),t=Math.floor(e%3600/60),n=e%60;return r>0?`${r}h ${String(t).padStart(2,"0")}m`:`${String(t).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function wt(s,e,r,t,n,i,o){var C,W;let a=!!(i&&i>Date.now()),c=!1;const l=()=>Array.from(s.querySelectorAll(".__crossx-pin6-box")),u=()=>s.querySelector("#__crossx-pin6-boxes"),p=()=>s.querySelector("#__crossx-pin6-error"),g=()=>s.querySelector("#__crossx-pin6-lock-msg"),_=()=>s.querySelector("#__crossx-pin6-lock-countdown"),x=()=>s.querySelector(".__crossx-pin6-body"),y="●",v=(b,E)=>{b.dataset.digit=E,b.value=y},A=b=>{delete b.dataset.digit,b.value=""},R=b=>b.dataset.digit??"",k=()=>l().map(R).join(""),L=()=>Array.from(s.querySelectorAll(".__crossx-pin6-dot")),D=()=>{var N;const b=l(),E=L();if(E.length&&(E.forEach((I,U)=>{const K=!!(b[U]&&R(b[U]));I.classList.toggle("--filled",K),I.classList.toggle("--active",!1)}),!a&&!c)){const I=b.findIndex(K=>!R(K));(N=E[I===-1?5:I])==null||N.classList.add("--active")}},z=()=>{s.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach(E=>E.classList.toggle("--disabled",a)),L().forEach(E=>E.classList.toggle("--locked",a)),D()},Q=b=>{a=b,l().forEach(E=>{E.disabled=b,E.classList.toggle("--locked",b)})},q=()=>s.querySelector("#__crossx-pin6-attempt"),J=()=>{const b=p();b&&(b.textContent="")},te=()=>o??"Your account will be locked after further failures.",G=()=>s.querySelector("#__crossx-pin6-warning"),B=b=>{var N;let E=G();if(!E){E=document.createElement("p"),E.className="__crossx-pin6-warning",E.id="__crossx-pin6-warning";const I=p();I?I.insertAdjacentElement("afterend",E):(N=x())==null||N.appendChild(E)}E.textContent=b},H=()=>{const b=G();b&&(b.textContent="")},m=(b,E)=>{var I;let N=q();if(!N){N=document.createElement("p"),N.className="__crossx-pin6-attempt",N.id="__crossx-pin6-attempt";const U=G()??p();U?U.insertAdjacentElement("afterend",N):(I=x())==null||I.appendChild(N)}N.textContent=`${b}/${E}`},w=()=>{const b=q();b&&(b.textContent="")},T=b=>{const E=p();E&&(E.textContent=b);const N=u();N==null||N.classList.add("--shake"),setTimeout(()=>N==null?void 0:N.classList.remove("--shake"),500),l().forEach(A),setTimeout(()=>{var I;(I=l()[0])==null||I.focus(),D()},50)},O=b=>{var K;Q(!0),l().forEach(A),z();const E=p();if(E&&(E.textContent="Too many failed attempts. Please wait."),!g()){const j=document.createElement("p");j.className="__crossx-pin6-lock-msg",j.id="__crossx-pin6-lock-msg",j.innerHTML=`${is}<span id="__crossx-pin6-lock-countdown"></span>`;const V=p();V?V.insertAdjacentElement("afterend",j):(K=x())==null||K.appendChild(j)}const N=()=>{var Y;const j=b-Date.now(),V=_();j<=0?(clearInterval(I),Q(!1),(Y=g())==null||Y.remove(),E&&(E.textContent=""),z(),setTimeout(()=>{var Ee;return(Ee=l()[0])==null?void 0:Ee.focus()},50)):V&&(V.textContent=` ${ro(j)}`)},I=setInterval(N,1e3);N();const U=new MutationObserver(()=>{document.contains(s)||(clearInterval(I),U.disconnect())});U.observe(document.body,{childList:!0,subtree:!1})},F=async()=>{if(a||c)return;const b=k();if(b.length===6){c=!0,l().forEach(E=>{E.disabled=!0});try{if(n){const E=await n(b);E.ok?e(b):E.lockExpiresAt?(w(),O(E.lockExpiresAt)):(T(E.error??"Incorrect PIN. Please try again."),E.attemptCount!=null&&E.maxAttempts!=null?(B(te()),m(E.attemptCount,E.maxAttempts)):(H(),w()))}else e(b)}catch(E){t&&t(E)}finally{c=!1,a||l().forEach(E=>{E.disabled=!1}),D()}}};i&&i>Date.now()?O(i):setTimeout(()=>{var b;return(b=l()[0])==null?void 0:b.focus()},100);const $=()=>{if(a||c)return;const b=l(),E=b.find(N=>!R(N))??b[b.length-1];E==null||E.focus()};(C=u())==null||C.addEventListener("click",b=>{b.target.classList.contains("__crossx-pin6-box")||$()}),(W=x())==null||W.addEventListener("click",b=>{const E=b.target;E.classList.contains("__crossx-pin6-box")||E.closest("button")||$()}),l().forEach((b,E)=>{b.addEventListener("input",()=>{var I;const N=b.value.replace(/\D/g,"").slice(-1);N?v(b,N):A(b),J(),N&&E<5&&((I=l()[E+1])==null||I.focus()),D(),k().length===6&&setTimeout(F,80)}),b.addEventListener("keydown",N=>{var I,U;if(N.key==="Backspace"){if(N.preventDefault(),R(b))A(b);else if(E>0){const K=l()[E-1];A(K),K.focus()}D()}else N.key==="ArrowLeft"&&E>0?(N.preventDefault(),(I=l()[E-1])==null||I.focus()):N.key==="ArrowRight"&&E<5?(N.preventDefault(),(U=l()[E+1])==null||U.focus()):N.key==="Escape"&&r()}),b.addEventListener("paste",N=>{var K,j;N.preventDefault();const I=(((K=N.clipboardData)==null?void 0:K.getData("text"))??"").replace(/\D/g,"").slice(0,6);if(!I)return;const U=l();I.split("").forEach((V,Y)=>{U[Y]&&v(U[Y],V)}),(j=U[Math.min(I.length-1,5)])==null||j.focus(),J(),D(),k().length===6&&setTimeout(F,80)}),b.addEventListener("focus",()=>b.select())});const M=s.querySelector("#__crossx-pin6-numpad");if(M){let b=null;const E=()=>{b&&(b.classList.remove("--pressed"),b=null)};M.addEventListener("pointerdown",I=>{const U=I.target.closest(".__crossx-pin6-numpad-key");!U||a||c||(E(),b=U,U.classList.add("--pressed"),U.setPointerCapture(I.pointerId))});const N=I=>{const U=I.dataset.key;if(!U)return;if(U==="backspace"){const Y=[...l()].reverse().find(Ee=>R(Ee));Y&&(A(Y),J()),D();return}if(!/^\d$/.test(U))return;const j=l().find(V=>!R(V));j&&(v(j,U),J(),D(),k().length===6&&setTimeout(F,80))};M.addEventListener("pointerup",I=>{if(!b)return;const U=b;E();const K=U.getBoundingClientRect();I.clientX>=K.left&&I.clientX<=K.right&&I.clientY>=K.top&&I.clientY<=K.bottom&&!a&&!c&&N(U)}),M.addEventListener("pointercancel",E),M.addEventListener("pointerleave",E,!0),D(),i&&i>Date.now()&&z()}}const so=`<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
2574
2585
  <path d="M7.36 0.5H19.5C20.6046 0.5 21.5 1.39543 21.5 2.5V14.5C21.5 15.6046 20.6046 16.5 19.5 16.5H7.36C6.76 16.5 6.19 16.24 5.8 15.79L0.94 10.02C0.35 9.32 0.35 8.3 0.94 7.6L5.8 1.71C6.19 1.26 6.76 0.5 7.36 0.5Z" stroke="currentColor" stroke-width="1.2" fill="none"/>
2575
2586
  <line x1="10" y1="5.5" x2="16" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
2576
2587
  <line x1="16" y1="5.5" x2="10" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
2577
2588
  </svg>`,is=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2578
2589
  <path d="M14.5 8.5H14V6.5C14 4.015 11.985 2 9.5 2C7.015 2 5 4.015 5 6.5V8.5H4.5C3.672 8.5 3 9.172 3 10V16.5C3 17.328 3.672 18 4.5 18H14.5C15.328 18 16 17.328 16 16.5V10C16 9.172 15.328 8.5 14.5 8.5ZM10.5 13.415V15C10.5 15.276 10.276 15.5 10 15.5H9C8.724 15.5 8.5 15.276 8.5 15V13.415C8.187 13.196 8 12.847 8 12.5C8 11.672 8.672 11 9.5 11C10.328 11 11 11.672 11 12.5C11 12.847 10.813 13.196 10.5 13.415ZM12.5 8.5H6.5V6.5C6.5 4.843 7.843 3.5 9.5 3.5C11.157 3.5 12.5 4.843 12.5 6.5V8.5Z" fill="currentColor"/>
2579
- </svg>`,so=`<svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
2590
+ </svg>`,no=`<svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
2580
2591
  <path d="M1 4.5L4 7.5L10 1" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
2581
- </svg>`,no=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2592
+ </svg>`,io=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2582
2593
  <path d="M12 0C18.6274 0 24 5.37258 24 12C23.9999 18.6273 18.6274 24 12 24C5.37264 24 9.89594e-05 18.6273 0 12C0 5.37258 5.37258 0 12 0ZM10.875 15.127V17.377H13.125V15.127H10.875ZM10.875 6.62207V13.627H13.125V6.62207H10.875Z" fill="currentColor"/>
2583
- </svg>`;function io(s,e,r){var i;const t=s.querySelectorAll(".__crossx-pin-input");t.forEach((o,a)=>{o.addEventListener("input",()=>{const c=o.value.replace(/\D/g,"");o.value=c?c[0]:"",c&&a<3&&t[a+1].focus();const l=Array.from(t).map(u=>u.value).join("");l.length===4&&setTimeout(()=>e(l),200)}),o.addEventListener("keydown",c=>{c.key==="Backspace"&&!o.value&&a>0&&(t[a-1].focus(),t[a-1].value=""),c.key==="Escape"&&r()}),o.addEventListener("keypress",c=>{/[0-9]/.test(c.key)||c.preventDefault()}),o.addEventListener("paste",c=>{var p;c.preventDefault();const l=(((p=c.clipboardData)==null?void 0:p.getData("text"))??"").replace(/\D/g,"").slice(0,4);if(!l)return;l.split("").forEach((g,_)=>{t[_]&&(t[_].value=g)});const u=Math.min(l.length,3);t[u].focus(),l.length===4&&setTimeout(()=>e(l),200)})});const n=s.querySelector(".__crossx-pin-inputs");n==null||n.addEventListener("click",o=>{if(!o.target.classList.contains("__crossx-pin-input")){const a=Array.from(t).find(c=>!c.value)??t[t.length-1];a==null||a.focus()}}),(i=t[0])==null||i.focus()}class oo{constructor(e="light",r,t=Tt,n){this.theme=e,this.overrides=r,this.tokens=hr(e,r),this.displayDecimals=t,this.pinKeyboard=n}setPinKeyboard(e){this.pinKeyboard=e}resolvePinKeyboardMode(){const e=this.pinKeyboard;if(typeof e=="function")try{return e()==="native"?"native":"virtual"}catch{return"virtual"}return e==="native"?"native":"virtual"}applyPinKeyboardMode(e){e&&e.classList.toggle("--native-keypad",this.resolvePinKeyboardMode()==="native")}setTheme(e,r){this.theme=e,r!==void 0&&(this.overrides=r),this.tokens=hr(e,this.overrides)}setMessages(e){this.messages=e}getTheme(){return this.theme}showWalletSelector(e,r,t){return new Promise((n,i)=>{var R;ae();const o=[...e],a=Wi(o,this.tokens,t,this.messages),c=Ce();ce(a);let l=!1;const u=()=>{l||(l=!0,a.remove(),c())};let p=null;const g=k=>{u(),n(k)},_=()=>{u(),p?i(p):n(null)};(()=>{a.querySelectorAll(".__crossx-wallet-item").forEach(k=>{k.addEventListener("click",()=>{const L=k.dataset.walletAddress??"",D=parseInt(k.dataset.walletIndex??"0",10),z=o.find(Q=>Q.index===D);g({address:L,index:D,name:z==null?void 0:z.name})})})})();const y=a.querySelector("#__crossx-add-wallet-error"),v=a.querySelector("#__crossx-add-wallet-btn");v&&v.addEventListener("click",async()=>{v.disabled=!0,y&&(y.hidden=!0,y.textContent="");try{const k=await r();o.push(k);const L=a.querySelector("#__crossx-wallet-list");if(L){const D=document.createElement("button");D.className="__crossx-wallet-item",D.dataset.walletIndex=String(k.index),D.dataset.walletAddress=k.address,D.innerHTML=`${ns(k.address,k.index,this.tokens.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${S(ss(k))}</span><span class="__crossx-wallet-addr">${de(k.address)}</span></span>`,D.addEventListener("click",()=>g(k)),L.appendChild(D);try{D.scrollIntoView({behavior:"smooth",block:"nearest"})}catch{}}v.disabled=!1}catch(k){const L=k instanceof f&&k.code===h.ADDRESS_LIMIT_EXCEEDED,D=this.resolveAddWalletErrorMessage(k);y&&(y.textContent=D,y.hidden=!1),L?(v.disabled=!0,v.setAttribute("aria-disabled","true")):v.disabled=!1,p=k}}),(R=a.querySelector("#__crossx-close-btn"))==null||R.addEventListener("click",_),a.addEventListener("click",k=>{k.target===a&&_()});const A=k=>{k.key==="Escape"&&(document.removeEventListener("keydown",A),_())};document.addEventListener("keydown",A)})}resolveAddWalletErrorMessage(e){const r=this.messages;if(e instanceof f&&e.code===h.ADDRESS_LIMIT_EXCEEDED){const n=e.details,i=typeof(n==null?void 0:n.limit)=="number"?n.limit:Xe;return((r==null?void 0:r.wallet_selector_add_error_limit_exceeded)??"Account limit reached. Maximum {limit} accounts allowed.").replace("{limit}",String(i))}return(r==null?void 0:r.wallet_selector_add_error_generic)??"Failed to add a new account. Please try again."}showLoginSelector(e){var t;const r=((t=e==null?void 0:e.connectOtherWallets)==null?void 0:t.filter(n=>Object.values(Le).includes(n)&&String(n).trim()!==""))??[];return new Promise(n=>{var g,_,x,y;ae();const i=zi(this.tokens,r,this.messages),o=Ce();ce(i);const a=()=>{i.remove(),o()},c=v=>{a(),n({type:"oauth",provider:v})},l=v=>{a(),n({type:"external",walletId:v})},u=()=>{a(),n(null)};(g=i.querySelector("#__crossx-apple-btn"))==null||g.addEventListener("click",()=>c("apple")),(_=i.querySelector("#__crossx-google-btn"))==null||_.addEventListener("click",()=>c("google")),(x=i.querySelector("#__crossx-connect-other-wallet-btn"))==null||x.addEventListener("click",v=>{const R=v.currentTarget.dataset.walletId??"";R&&l(R)}),(y=i.querySelector("#__crossx-close-btn"))==null||y.addEventListener("click",u),i.addEventListener("click",v=>{v.target===i&&u()}),i.querySelectorAll(".__crossx-login-terms-link").forEach(v=>{v.addEventListener("click",A=>A.stopPropagation())});const p=v=>{v.key==="Escape"&&(document.removeEventListener("keydown",p),u())};document.addEventListener("keydown",p)})}showSessionAlert(e){return new Promise(r=>{var u,p,g;ae();const t=this.messages,n=ji(this.tokens,{title:e.title,message:e.message,email:e.email,accountLabel:(t==null?void 0:t.session_alert_account_label)??"Account",signOutLabel:(t==null?void 0:t.session_alert_sign_out_button)??"Sign out",signInAgainLabel:(t==null?void 0:t.session_alert_sign_in_again_button)??"Sign in again"}),i=Ce();ce(n);let o=!1;const a=()=>{o||(o=!0,n.remove(),i())},c=()=>{a(),r("signout")},l=()=>{a(),r("signin-again")};(u=n.querySelector("#__crossx-session-signout"))==null||u.addEventListener("click",c),(p=n.querySelector("#__crossx-session-signin"))==null||p.addEventListener("click",l),(g=n.querySelector("#__crossx-close-btn"))==null||g.addEventListener("click",c)})}showMigrationFoundPrompt(e){const r=(e==null?void 0:e.allowSkip)??!0;return new Promise(t=>{var a,c,l;ae();const n=Yi(this.tokens,r);ce(n);const i=()=>n.remove(),o=()=>{i(),t("recover")};if((a=n.querySelector("#__crossx-recover-btn"))==null||a.addEventListener("click",o),r){const u=()=>{i(),t("skip")};(c=n.querySelector("#__crossx-skip-btn"))==null||c.addEventListener("click",u),(l=n.querySelector("#__crossx-close-btn"))==null||l.addEventListener("click",u),n.addEventListener("click",g=>{g.target===n&&u()});const p=g=>{g.key==="Escape"&&(document.removeEventListener("keydown",p),u())};document.addEventListener("keydown",p)}})}showPinSetupPrompt(e){return new Promise(r=>{ae();const t=this.messages,n={title:(t==null?void 0:t.pin_setup_title)??"Create PIN",headerSubtitle:(t==null?void 0:t.pin_notice_header_subtitle)??"Required for transactions, PK/mnemonic export & account deletion.",noticeTitle:(t==null?void 0:t.pin_notice_title)??"PIN Setup Notice",noticeDesc:(t==null?void 0:t.pin_notice_description)??"For your security, this PIN cannot be reset or recovered. Please make sure you remember it or store it in a safe place.",check1:(t==null?void 0:t.pin_notice_check1)??"I understand that losing this PIN will result in permanent loss of access to my wallet and assets.",check2:(t==null?void 0:t.pin_notice_check2)??"I understand that no one, including the support team, can recover or reset this PIN on my behalf.",nextButton:(t==null?void 0:t.pin_notice_next_button)??"Next",submitButton:(t==null?void 0:t.pin_notice_submit_button)??"I Understand"},i={title:(t==null?void 0:t.pin_setup_title)??"Create PIN",headerSubtitle:(t==null?void 0:t.pin_setup_header_subtitle)??"This PIN is used to authorize your transactions.",subtitle:(t==null?void 0:t.pin_setup_subtitle)??"Set a 6-digit PIN to authorize transactions.",mismatchError:(t==null?void 0:t.pin_setup_mismatch_error)??"PINs do not match. Please try again."},o={title:(t==null?void 0:t.pin_setup_confirm_title)??"Confirm PIN",headerSubtitle:(t==null?void 0:t.pin_setup_confirm_subtitle)??"Enter your PIN again to confirm."},a=_r(this.tokens,Qi(n)),c=Ce();ce(a);let l=!1;const u=()=>{l||(l=!0,a.remove(),c())},p=R=>{u(),r(R)},g=()=>{u(),r(null)},_=a.querySelector(".__crossx-card"),x={tooShort:(t==null?void 0:t.pin_validation_too_short)??"Please enter a 6-digit PIN.",numbersOnly:(t==null?void 0:t.pin_validation_numbers_only)??"Only numbers (0-9) are allowed.",repeatingDigit:(t==null?void 0:t.pin_validation_repeating_digit)??"Cannot use the same number 3+ times in a row.",sequential:(t==null?void 0:t.pin_validation_sequential)??"Sequential numbers (e.g., 123456) are not allowed.",alternatingPattern:(t==null?void 0:t.pin_validation_alternating_pattern)??"Repeating patterns (e.g., 121212) are not allowed."},y=R=>{var k;_.innerHTML=xt({title:o.title,headerSubtitle:o.headerSubtitle}),this.applyPinKeyboardMode(_),(k=_.querySelector("#__crossx-close-btn"))==null||k.addEventListener("click",g),wt(_,L=>{L===R?p(R):v(i.mismatchError)},g)},v=R=>{var k;_.innerHTML=xt({title:i.title,headerSubtitle:i.headerSubtitle,subtitle:i.subtitle,errorMessage:R}),this.applyPinKeyboardMode(_),(k=_.querySelector("#__crossx-close-btn"))==null||k.addEventListener("click",g),wt(_,L=>{const D=eo(L,x);D?v(D):y(L)},g)};(()=>{var te;const R=Array.from(_.querySelectorAll(".__crossx-pw-notice-item")),k=_.querySelector("#__crossx-pin-notice-next"),L=new Set;k.removeAttribute("disabled");const D=k.dataset.nextLabel??"Next",z=k.dataset.submitLabel??"I Understand",Q=()=>{const G=L.size===R.length;k.classList.toggle("--disabled",!G),k.textContent=G?z:D},q=(G,B)=>{if(L.has(B))return;const H=G.querySelector(`#__crossx-notice-check-${B}`);L.add(B),H.classList.add("--checked"),G.setAttribute("aria-checked","true"),Q()},J=(G,B)=>{if(!L.has(B))return;const H=G.querySelector(`#__crossx-notice-check-${B}`);L.delete(B),H.classList.remove("--checked"),G.setAttribute("aria-checked","false"),Q()};R.forEach(G=>{const B=parseInt(G.dataset.checkIndex??"0",10);G.addEventListener("click",()=>{L.has(B)?J(G,B):q(G,B)}),G.addEventListener("keydown",H=>{(H.key===" "||H.key==="Enter")&&(H.preventDefault(),L.has(B)?J(G,B):q(G,B))})}),k.addEventListener("click",()=>{if(L.size===R.length){v(e==null?void 0:e.errorMessage);return}const G=R.find(H=>{const m=parseInt(H.dataset.checkIndex??"0",10);return!L.has(m)});if(!G)return;const B=parseInt(G.dataset.checkIndex??"0",10);G.scrollIntoView({behavior:"smooth",block:"nearest"}),G.classList.add("--highlight"),setTimeout(()=>{G.classList.remove("--highlight"),q(G,B)},400)}),(te=_.querySelector("#__crossx-close-btn"))==null||te.addEventListener("click",g)})(),a.addEventListener("click",R=>{R.target===a&&g()})})}showPinInputPrompt(e){return new Promise((r,t)=>{var A;ae();const n=this.messages,i=(e==null?void 0:e.verifyMode)===!0,o=i?(n==null?void 0:n.verify_pin_title)??"Verify Your PIN":(n==null?void 0:n.pin_input_title)??"Enter PIN",a=i?(n==null?void 0:n.verify_pin_subtitle)??"Enter your PIN to authorize this transaction.":(n==null?void 0:n.pin_input_subtitle)??"Enter your 6-digit PIN to continue.",c=(n==null?void 0:n.pin_locked_failure_warning)??"Your account will be locked after further failures.",l=_r(this.tokens,xt({title:o,headerSubtitle:a,errorMessage:e==null?void 0:e.errorMessage,warningMessage:c,lockExpiresAt:e==null?void 0:e.lockExpiresAt,attemptCount:e==null?void 0:e.attemptCount,maxAttempts:e==null?void 0:e.maxAttempts})),u=Ce();ce(l);let p=!1;const g=()=>{p||(p=!0,l.remove(),u())},_=R=>{g(),r(R)},x=()=>{g(),r(null)},y=R=>{g(),t(R)},v=l.querySelector(".__crossx-card");this.applyPinKeyboardMode(v),(A=v.querySelector("#__crossx-close-btn"))==null||A.addEventListener("click",x),wt(v,_,x,y,e==null?void 0:e.onSubmit,e==null?void 0:e.lockExpiresAt,c),l.addEventListener("click",R=>{R.target===l&&x()})})}showRecoveryPinInputPrompt(e){return new Promise(r=>{var c;ae();const t=Xi(this.tokens,e);ce(t);const n=()=>t.remove(),i=l=>{n(),r(l)},o=()=>{n(),r(null)},a=t.querySelector(".__crossx-card");a&&this.applyPinKeyboardMode(a),io(t,i,o),(c=t.querySelector("#__crossx-close-btn"))==null||c.addEventListener("click",o),t.addEventListener("click",l=>{l.target===t&&o()})})}showRecoveryPinLockedPrompt(e,r){return new Promise(t=>{var l;ae();const{overlay:n,startCountdown:i}=Zi(this.tokens,e,r);ce(n);const o=()=>{c(),n.remove()},a=()=>{o(),t()},c=i(a);(l=n.querySelector("#__crossx-close-btn"))==null||l.addEventListener("click",a),n.addEventListener("click",u=>{u.target===n&&a()})})}showTransactionComplete(e){return new Promise(r=>{var a,c;ae();const t=Ci(e,this.tokens,this.messages);ce(t);const n=()=>t.remove(),i=()=>{n(),r()};(a=t.querySelector("#__crossx-done-btn"))==null||a.addEventListener("click",i),(c=t.querySelector("#__crossx-close-btn"))==null||c.addEventListener("click",i),t.querySelectorAll(".__crossx-copy-btn").forEach(l=>{l.addEventListener("click",u=>{var g;u.stopPropagation();const p=l.dataset.copy;p&&((g=navigator.clipboard)==null||g.writeText(p).catch(()=>{}))})}),t.addEventListener("click",l=>{l.target===t&&i()});const o=l=>{l.key==="Escape"&&(document.removeEventListener("keydown",o),i())};document.addEventListener("keydown",o)})}showTransactionProgress(e,r){return new Promise(t=>{ae();const n=Pi(e,this.tokens,this.messages);ce(n);const i=()=>n.remove();let o=!1;const a=()=>{o||(o=!0,i(),t())},c=()=>{var u,p;(u=n.querySelector("#__crossx-done-btn"))==null||u.addEventListener("click",a),(p=n.querySelector("#__crossx-close-btn"))==null||p.addEventListener("click",a),n.addEventListener("click",g=>{g.target===n&&a()});const l=g=>{g.key==="Escape"&&(document.removeEventListener("keydown",l),a())};document.addEventListener("keydown",l)};r.then(l=>{o||(Li(n,l,this.tokens,this.messages),c())})})}requestConfirmation(e){return new Promise(r=>{var l,u,p;ae();let t;e.type==="sign-message"?t=Di(e,this.tokens,this.messages):e.type==="sign-typed-data"?t=$i(e,this.tokens,this.messages):e.type==="sign"?t=Ai(e,this.tokens,this.displayDecimals,this.messages):t=Ii(e,this.tokens,this.displayDecimals,this.messages);const n=Ce();ce(t);const i=()=>{t.remove(),n()},o=()=>{i(),r(!0)},a=()=>{i(),r(!1)};(l=t.querySelector("#__crossx-confirm-btn"))==null||l.addEventListener("click",o),(u=t.querySelector("#__crossx-cancel-btn"))==null||u.addEventListener("click",a),(p=t.querySelector("#__crossx-close-btn"))==null||p.addEventListener("click",a),t.querySelectorAll(".__crossx-copy-btn").forEach(g=>{g.addEventListener("click",_=>{var y;_.stopPropagation();const x=g.dataset.copy;x&&((y=navigator.clipboard)==null||y.writeText(x).catch(()=>{}))})}),_i(t),t.addEventListener("click",g=>{g.target===t&&a()});const c=g=>{g.key==="Escape"&&(document.removeEventListener("keydown",c),a())};document.addEventListener("keydown",c)})}}class ao{constructor(e,r,t,n=()=>!1){this.browserConfirmation=e,this.getBridge=r,this.getOrigin=t,this.isAuthenticatedViaRNBridge=n}shouldDelegateToBridge(){var e;return this.isAuthenticatedViaRNBridge()&&!!((e=this.getBridge())!=null&&e.isInstalled)}async requestConfirmation(e){return this.shouldDelegateToBridge()?!0:this.browserConfirmation.requestConfirmation(e)}async requestNativeConfirmation(e){const r=this.getBridge();if(!r)return{approved:!1,reason:"Bridge not available"};const{operation:t,payload:n,chainId:i}=this.mapToNativeParams(e),o={operation:t,payload:n,dappOrigin:this.getOrigin(),chainId:i};return await r.requestUserConfirmation(o)}mapToNativeParams(e){const r=e.type;switch(r){case"sign-message":{const t=e;return{operation:"signMessage",payload:{message:t.message,from:t.from,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}case"sign-typed-data":{const t=e;return{operation:"signTypedData",payload:{typedData:t.typedData,from:t.from,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}case"sign":{const t=e;return{operation:"signTransaction",payload:{from:t.from,to:t.to,value:t.value,data:t.data,gasLimit:t.gasLimit,gasPrice:t.gasPrice,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas,nativeSymbol:t.nativeSymbol,nativeDecimals:t.nativeDecimals,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}case"send":{const t=e;return{operation:"sendTransaction",payload:{from:t.from,to:t.to,value:t.value,data:t.data,gasLimit:t.gasLimit,gasPrice:t.gasPrice,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas,nativeSymbol:t.nativeSymbol,nativeDecimals:t.nativeDecimals,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}default:throw new f(h.INVALID_CONFIG,`Unknown confirmation type: ${String(r)}`)}}async showTransactionComplete(e){if(!this.shouldDelegateToBridge())return this.browserConfirmation.showTransactionComplete(e)}async showTransactionProgress(e,r){if(this.shouldDelegateToBridge()){try{await r}catch{}return}return this.browserConfirmation.showTransactionProgress(e,r)}async showLoginSelector(e){return this.browserConfirmation.showLoginSelector(e)}async showMigrationFoundPrompt(e){return this.browserConfirmation.showMigrationFoundPrompt(e)}async showRecoveryPinInputPrompt(e){return this.browserConfirmation.showRecoveryPinInputPrompt(e)}async showRecoveryPinLockedPrompt(e,r){return this.browserConfirmation.showRecoveryPinLockedPrompt(e,r)}async showWalletSelector(e,r,t){const n=this.getBridge();if(this.shouldDelegateToBridge()&&(n!=null&&n.showWalletSelector))try{const i=await n.showWalletSelector({requiredAddress:t}),o=e.find(a=>a.address.toLowerCase()===i.address.toLowerCase());return{address:i.address,index:(o==null?void 0:o.index)??i.index,name:o==null?void 0:o.name}}catch{return null}return this.browserConfirmation.showWalletSelector(e,r,t)}async showPinSetupPrompt(e){return this.browserConfirmation.showPinSetupPrompt(e)}async showPinInputPrompt(e){return this.browserConfirmation.showPinInputPrompt(e)}async showSessionAlert(e){return this.browserConfirmation.showSessionAlert(e)}setTheme(e,r){return this.browserConfirmation.setTheme(e,r)}setMessages(e){return this.browserConfirmation.setMessages(e)}setPinKeyboard(e){var r,t;(t=(r=this.browserConfirmation).setPinKeyboard)==null||t.call(r,e)}}class os{constructor(){this._accessToken=null,this._expiresAt=0}set(e){this._accessToken=e;try{const r=JSON.parse(atob(e.split(".")[1]));this._expiresAt=typeof r.exp=="number"?r.exp*1e3:0}catch{this._expiresAt=0}}get(){return this._accessToken&&this._expiresAt>0&&Date.now()>=this._expiresAt?(this.clear(),null):this._accessToken}clear(){this._accessToken=null,this._expiresAt=0}has(){return this.get()!==null}isExpiringSoon(e=3e4){return!this._accessToken||this._expiresAt<=0?!0:Date.now()>=this._expiresAt-e}}function co(s,e){if(!s.projectId)throw new Error(`[CROSSx] Fatal: projectId is required but was not provided.
2594
+ </svg>`;function oo(s,e,r){var i;const t=s.querySelectorAll(".__crossx-pin-input");t.forEach((o,a)=>{o.addEventListener("input",()=>{const c=o.value.replace(/\D/g,"");o.value=c?c[0]:"",c&&a<3&&t[a+1].focus();const l=Array.from(t).map(u=>u.value).join("");l.length===4&&setTimeout(()=>e(l),200)}),o.addEventListener("keydown",c=>{c.key==="Backspace"&&!o.value&&a>0&&(t[a-1].focus(),t[a-1].value=""),c.key==="Escape"&&r()}),o.addEventListener("keypress",c=>{/[0-9]/.test(c.key)||c.preventDefault()}),o.addEventListener("paste",c=>{var p;c.preventDefault();const l=(((p=c.clipboardData)==null?void 0:p.getData("text"))??"").replace(/\D/g,"").slice(0,4);if(!l)return;l.split("").forEach((g,_)=>{t[_]&&(t[_].value=g)});const u=Math.min(l.length,3);t[u].focus(),l.length===4&&setTimeout(()=>e(l),200)})});const n=s.querySelector(".__crossx-pin-inputs");n==null||n.addEventListener("click",o=>{if(!o.target.classList.contains("__crossx-pin-input")){const a=Array.from(t).find(c=>!c.value)??t[t.length-1];a==null||a.focus()}}),(i=t[0])==null||i.focus()}class ao{constructor(e="light",r,t=Tt,n){this.theme=e,this.overrides=r,this.tokens=hr(e,r),this.displayDecimals=t,this.pinKeyboard=n}setPinKeyboard(e){this.pinKeyboard=e}resolvePinKeyboardMode(){const e=this.pinKeyboard;if(typeof e=="function")try{return e()==="native"?"native":"virtual"}catch{return"virtual"}return e==="native"?"native":"virtual"}applyPinKeyboardMode(e){e&&e.classList.toggle("--native-keypad",this.resolvePinKeyboardMode()==="native")}setTheme(e,r){this.theme=e,r!==void 0&&(this.overrides=r),this.tokens=hr(e,this.overrides)}setMessages(e){this.messages=e}getTheme(){return this.theme}showWalletSelector(e,r,t){return new Promise((n,i)=>{var R;ae();const o=[...e],a=Gi(o,this.tokens,t,this.messages),c=Ce();ce(a);let l=!1;const u=()=>{l||(l=!0,a.remove(),c())};let p=null;const g=k=>{u(),n(k)},_=()=>{u(),p?i(p):n(null)};(()=>{a.querySelectorAll(".__crossx-wallet-item").forEach(k=>{k.addEventListener("click",()=>{const L=k.dataset.walletAddress??"",D=parseInt(k.dataset.walletIndex??"0",10),z=o.find(Q=>Q.index===D);g({address:L,index:D,name:z==null?void 0:z.name})})})})();const y=a.querySelector("#__crossx-add-wallet-error"),v=a.querySelector("#__crossx-add-wallet-btn");v&&v.addEventListener("click",async()=>{v.disabled=!0,y&&(y.hidden=!0,y.textContent="");try{const k=await r();o.push(k);const L=a.querySelector("#__crossx-wallet-list");if(L){const D=document.createElement("button");D.className="__crossx-wallet-item",D.dataset.walletIndex=String(k.index),D.dataset.walletAddress=k.address,D.innerHTML=`${ns(k.address,k.index,this.tokens.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${S(ss(k))}</span><span class="__crossx-wallet-addr">${de(k.address)}</span></span>`,D.addEventListener("click",()=>g(k)),L.appendChild(D);try{D.scrollIntoView({behavior:"smooth",block:"nearest"})}catch{}}v.disabled=!1}catch(k){const L=k instanceof f&&k.code===h.ADDRESS_LIMIT_EXCEEDED,D=this.resolveAddWalletErrorMessage(k);y&&(y.textContent=D,y.hidden=!1),L?(v.disabled=!0,v.setAttribute("aria-disabled","true")):v.disabled=!1,p=k}}),(R=a.querySelector("#__crossx-close-btn"))==null||R.addEventListener("click",_),a.addEventListener("click",k=>{k.target===a&&_()});const A=k=>{k.key==="Escape"&&(document.removeEventListener("keydown",A),_())};document.addEventListener("keydown",A)})}resolveAddWalletErrorMessage(e){const r=this.messages;if(e instanceof f&&e.code===h.ADDRESS_LIMIT_EXCEEDED){const n=e.details,i=typeof(n==null?void 0:n.limit)=="number"?n.limit:Xe;return((r==null?void 0:r.wallet_selector_add_error_limit_exceeded)??"Account limit reached. Maximum {limit} accounts allowed.").replace("{limit}",String(i))}return(r==null?void 0:r.wallet_selector_add_error_generic)??"Failed to add a new account. Please try again."}showLoginSelector(e){var t;const r=((t=e==null?void 0:e.connectOtherWallets)==null?void 0:t.filter(n=>Object.values(Le).includes(n)&&String(n).trim()!==""))??[];return new Promise(n=>{var g,_,x,y;ae();const i=ji(this.tokens,r,this.messages),o=Ce();ce(i);const a=()=>{i.remove(),o()},c=v=>{a(),n({type:"oauth",provider:v})},l=v=>{a(),n({type:"external",walletId:v})},u=()=>{a(),n(null)};(g=i.querySelector("#__crossx-apple-btn"))==null||g.addEventListener("click",()=>c("apple")),(_=i.querySelector("#__crossx-google-btn"))==null||_.addEventListener("click",()=>c("google")),(x=i.querySelector("#__crossx-connect-other-wallet-btn"))==null||x.addEventListener("click",v=>{const R=v.currentTarget.dataset.walletId??"";R&&l(R)}),(y=i.querySelector("#__crossx-close-btn"))==null||y.addEventListener("click",u),i.addEventListener("click",v=>{v.target===i&&u()}),i.querySelectorAll(".__crossx-login-terms-link").forEach(v=>{v.addEventListener("click",A=>A.stopPropagation())});const p=v=>{v.key==="Escape"&&(document.removeEventListener("keydown",p),u())};document.addEventListener("keydown",p)})}showSessionAlert(e){return new Promise(r=>{var u,p,g;ae();const t=this.messages,n=Yi(this.tokens,{title:e.title,message:e.message,email:e.email,accountLabel:(t==null?void 0:t.session_alert_account_label)??"Account",signOutLabel:(t==null?void 0:t.session_alert_sign_out_button)??"Sign out",signInAgainLabel:(t==null?void 0:t.session_alert_sign_in_again_button)??"Sign in again"}),i=Ce();ce(n);let o=!1;const a=()=>{o||(o=!0,n.remove(),i())},c=()=>{a(),r("signout")},l=()=>{a(),r("signin-again")};(u=n.querySelector("#__crossx-session-signout"))==null||u.addEventListener("click",c),(p=n.querySelector("#__crossx-session-signin"))==null||p.addEventListener("click",l),(g=n.querySelector("#__crossx-close-btn"))==null||g.addEventListener("click",c)})}showMigrationFoundPrompt(e){const r=(e==null?void 0:e.allowSkip)??!0;return new Promise(t=>{var a,c,l;ae();const n=Xi(this.tokens,r);ce(n);const i=()=>n.remove(),o=()=>{i(),t("recover")};if((a=n.querySelector("#__crossx-recover-btn"))==null||a.addEventListener("click",o),r){const u=()=>{i(),t("skip")};(c=n.querySelector("#__crossx-skip-btn"))==null||c.addEventListener("click",u),(l=n.querySelector("#__crossx-close-btn"))==null||l.addEventListener("click",u),n.addEventListener("click",g=>{g.target===n&&u()});const p=g=>{g.key==="Escape"&&(document.removeEventListener("keydown",p),u())};document.addEventListener("keydown",p)}})}showPinSetupPrompt(e){return new Promise(r=>{ae();const t=this.messages,n={title:(t==null?void 0:t.pin_setup_title)??"Create PIN",headerSubtitle:(t==null?void 0:t.pin_notice_header_subtitle)??"Required for transactions, PK/mnemonic export & account deletion.",noticeTitle:(t==null?void 0:t.pin_notice_title)??"PIN Setup Notice",noticeDesc:(t==null?void 0:t.pin_notice_description)??"For your security, this PIN cannot be reset or recovered. Please make sure you remember it or store it in a safe place.",check1:(t==null?void 0:t.pin_notice_check1)??"I understand that losing this PIN will result in permanent loss of access to my wallet and assets.",check2:(t==null?void 0:t.pin_notice_check2)??"I understand that no one, including the support team, can recover or reset this PIN on my behalf.",nextButton:(t==null?void 0:t.pin_notice_next_button)??"Next",submitButton:(t==null?void 0:t.pin_notice_submit_button)??"I Understand"},i={title:(t==null?void 0:t.pin_setup_title)??"Create PIN",headerSubtitle:(t==null?void 0:t.pin_setup_header_subtitle)??"This PIN is used to authorize your transactions.",subtitle:(t==null?void 0:t.pin_setup_subtitle)??"Set a 6-digit PIN to authorize transactions.",mismatchError:(t==null?void 0:t.pin_setup_mismatch_error)??"PINs do not match. Please try again."},o={title:(t==null?void 0:t.pin_setup_confirm_title)??"Confirm PIN",headerSubtitle:(t==null?void 0:t.pin_setup_confirm_subtitle)??"Enter your PIN again to confirm."},a=_r(this.tokens,eo(n)),c=Ce();ce(a);let l=!1;const u=()=>{l||(l=!0,a.remove(),c())},p=R=>{u(),r(R)},g=()=>{u(),r(null)},_=a.querySelector(".__crossx-card"),x={tooShort:(t==null?void 0:t.pin_validation_too_short)??"Please enter a 6-digit PIN.",numbersOnly:(t==null?void 0:t.pin_validation_numbers_only)??"Only numbers (0-9) are allowed.",repeatingDigit:(t==null?void 0:t.pin_validation_repeating_digit)??"Cannot use the same number 3+ times in a row.",sequential:(t==null?void 0:t.pin_validation_sequential)??"Sequential numbers (e.g., 123456) are not allowed.",alternatingPattern:(t==null?void 0:t.pin_validation_alternating_pattern)??"Repeating patterns (e.g., 121212) are not allowed."},y=R=>{var k;_.innerHTML=xt({title:o.title,headerSubtitle:o.headerSubtitle}),this.applyPinKeyboardMode(_),(k=_.querySelector("#__crossx-close-btn"))==null||k.addEventListener("click",g),wt(_,L=>{L===R?p(R):v(i.mismatchError)},g)},v=R=>{var k;_.innerHTML=xt({title:i.title,headerSubtitle:i.headerSubtitle,subtitle:i.subtitle,errorMessage:R}),this.applyPinKeyboardMode(_),(k=_.querySelector("#__crossx-close-btn"))==null||k.addEventListener("click",g),wt(_,L=>{const D=to(L,x);D?v(D):y(L)},g)};(()=>{var te;const R=Array.from(_.querySelectorAll(".__crossx-pw-notice-item")),k=_.querySelector("#__crossx-pin-notice-next"),L=new Set;k.removeAttribute("disabled");const D=k.dataset.nextLabel??"Next",z=k.dataset.submitLabel??"I Understand",Q=()=>{const G=L.size===R.length;k.classList.toggle("--disabled",!G),k.textContent=G?z:D},q=(G,B)=>{if(L.has(B))return;const H=G.querySelector(`#__crossx-notice-check-${B}`);L.add(B),H.classList.add("--checked"),G.setAttribute("aria-checked","true"),Q()},J=(G,B)=>{if(!L.has(B))return;const H=G.querySelector(`#__crossx-notice-check-${B}`);L.delete(B),H.classList.remove("--checked"),G.setAttribute("aria-checked","false"),Q()};R.forEach(G=>{const B=parseInt(G.dataset.checkIndex??"0",10);G.addEventListener("click",()=>{L.has(B)?J(G,B):q(G,B)}),G.addEventListener("keydown",H=>{(H.key===" "||H.key==="Enter")&&(H.preventDefault(),L.has(B)?J(G,B):q(G,B))})}),k.addEventListener("click",()=>{if(L.size===R.length){v(e==null?void 0:e.errorMessage);return}const G=R.find(H=>{const m=parseInt(H.dataset.checkIndex??"0",10);return!L.has(m)});if(!G)return;const B=parseInt(G.dataset.checkIndex??"0",10);G.scrollIntoView({behavior:"smooth",block:"nearest"}),G.classList.add("--highlight"),setTimeout(()=>{G.classList.remove("--highlight"),q(G,B)},400)}),(te=_.querySelector("#__crossx-close-btn"))==null||te.addEventListener("click",g)})(),a.addEventListener("click",R=>{R.target===a&&g()})})}showPinInputPrompt(e){return new Promise((r,t)=>{var A;ae();const n=this.messages,i=(e==null?void 0:e.verifyMode)===!0,o=i?(n==null?void 0:n.verify_pin_title)??"Verify Your PIN":(n==null?void 0:n.pin_input_title)??"Enter PIN",a=i?(n==null?void 0:n.verify_pin_subtitle)??"Enter your PIN to authorize this transaction.":(n==null?void 0:n.pin_input_subtitle)??"Enter your 6-digit PIN to continue.",c=(n==null?void 0:n.pin_locked_failure_warning)??"Your account will be locked after further failures.",l=_r(this.tokens,xt({title:o,headerSubtitle:a,errorMessage:e==null?void 0:e.errorMessage,warningMessage:c,lockExpiresAt:e==null?void 0:e.lockExpiresAt,attemptCount:e==null?void 0:e.attemptCount,maxAttempts:e==null?void 0:e.maxAttempts})),u=Ce();ce(l);let p=!1;const g=()=>{p||(p=!0,l.remove(),u())},_=R=>{g(),r(R)},x=()=>{g(),r(null)},y=R=>{g(),t(R)},v=l.querySelector(".__crossx-card");this.applyPinKeyboardMode(v),(A=v.querySelector("#__crossx-close-btn"))==null||A.addEventListener("click",x),wt(v,_,x,y,e==null?void 0:e.onSubmit,e==null?void 0:e.lockExpiresAt,c),l.addEventListener("click",R=>{R.target===l&&x()})})}showRecoveryPinInputPrompt(e){return new Promise(r=>{var c;ae();const t=Ji(this.tokens,e);ce(t);const n=()=>t.remove(),i=l=>{n(),r(l)},o=()=>{n(),r(null)},a=t.querySelector(".__crossx-card");a&&this.applyPinKeyboardMode(a),oo(t,i,o),(c=t.querySelector("#__crossx-close-btn"))==null||c.addEventListener("click",o),t.addEventListener("click",l=>{l.target===t&&o()})})}showRecoveryPinLockedPrompt(e,r){return new Promise(t=>{var l;ae();const{overlay:n,startCountdown:i}=Qi(this.tokens,e,r);ce(n);const o=()=>{c(),n.remove()},a=()=>{o(),t()},c=i(a);(l=n.querySelector("#__crossx-close-btn"))==null||l.addEventListener("click",a),n.addEventListener("click",u=>{u.target===n&&a()})})}showTransactionComplete(e){return new Promise(r=>{var a,c;ae();const t=Pi(e,this.tokens,this.messages);ce(t);const n=()=>t.remove(),i=()=>{n(),r()};(a=t.querySelector("#__crossx-done-btn"))==null||a.addEventListener("click",i),(c=t.querySelector("#__crossx-close-btn"))==null||c.addEventListener("click",i),t.querySelectorAll(".__crossx-copy-btn").forEach(l=>{l.addEventListener("click",u=>{var g;u.stopPropagation();const p=l.dataset.copy;p&&((g=navigator.clipboard)==null||g.writeText(p).catch(()=>{}))})}),t.addEventListener("click",l=>{l.target===t&&i()});const o=l=>{l.key==="Escape"&&(document.removeEventListener("keydown",o),i())};document.addEventListener("keydown",o)})}showTransactionProgress(e,r){return new Promise(t=>{ae();const n=Li(e,this.tokens,this.messages);ce(n);const i=()=>n.remove();let o=!1;const a=()=>{o||(o=!0,i(),t())},c=()=>{var u,p;(u=n.querySelector("#__crossx-done-btn"))==null||u.addEventListener("click",a),(p=n.querySelector("#__crossx-close-btn"))==null||p.addEventListener("click",a),n.addEventListener("click",g=>{g.target===n&&a()});const l=g=>{g.key==="Escape"&&(document.removeEventListener("keydown",l),a())};document.addEventListener("keydown",l)};r.then(l=>{o||(Di(n,l,this.tokens,this.messages),c())})})}requestConfirmation(e){return new Promise(r=>{var l,u,p;ae();let t;e.type==="sign-message"?t=$i(e,this.tokens,this.messages):e.type==="sign-typed-data"?t=Bi(e,this.tokens,this.messages):e.type==="sign"?t=Ii(e,this.tokens,this.displayDecimals,this.messages):t=Ti(e,this.tokens,this.displayDecimals,this.messages);const n=Ce();ce(t);const i=()=>{t.remove(),n()},o=()=>{i(),r(!0)},a=()=>{i(),r(!1)};(l=t.querySelector("#__crossx-confirm-btn"))==null||l.addEventListener("click",o),(u=t.querySelector("#__crossx-cancel-btn"))==null||u.addEventListener("click",a),(p=t.querySelector("#__crossx-close-btn"))==null||p.addEventListener("click",a),t.querySelectorAll(".__crossx-copy-btn").forEach(g=>{g.addEventListener("click",_=>{var y;_.stopPropagation();const x=g.dataset.copy;x&&((y=navigator.clipboard)==null||y.writeText(x).catch(()=>{}))})}),fi(t),t.addEventListener("click",g=>{g.target===t&&a()});const c=g=>{g.key==="Escape"&&(document.removeEventListener("keydown",c),a())};document.addEventListener("keydown",c)})}}class co{constructor(e,r,t,n=()=>!1){this.browserConfirmation=e,this.getBridge=r,this.getOrigin=t,this.isAuthenticatedViaRNBridge=n}shouldDelegateToBridge(){var e;return this.isAuthenticatedViaRNBridge()&&!!((e=this.getBridge())!=null&&e.isInstalled)}async requestConfirmation(e){return this.shouldDelegateToBridge()?!0:this.browserConfirmation.requestConfirmation(e)}async requestNativeConfirmation(e){const r=this.getBridge();if(!r)return{approved:!1,reason:"Bridge not available"};const{operation:t,payload:n,chainId:i}=this.mapToNativeParams(e),o={operation:t,payload:n,dappOrigin:this.getOrigin(),chainId:i};return await r.requestUserConfirmation(o)}mapToNativeParams(e){const r=e.type;switch(r){case"sign-message":{const t=e;return{operation:"signMessage",payload:{message:t.message,from:t.from,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}case"sign-typed-data":{const t=e;return{operation:"signTypedData",payload:{typedData:t.typedData,from:t.from,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}case"sign":{const t=e;return{operation:"signTransaction",payload:{from:t.from,to:t.to,value:t.value,data:t.data,gasLimit:t.gasLimit,gasPrice:t.gasPrice,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas,nativeSymbol:t.nativeSymbol,nativeDecimals:t.nativeDecimals,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}case"send":{const t=e;return{operation:"sendTransaction",payload:{from:t.from,to:t.to,value:t.value,data:t.data,gasLimit:t.gasLimit,gasPrice:t.gasPrice,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas,nativeSymbol:t.nativeSymbol,nativeDecimals:t.nativeDecimals,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}default:throw new f(h.INVALID_CONFIG,`Unknown confirmation type: ${String(r)}`)}}async showTransactionComplete(e){if(!this.shouldDelegateToBridge())return this.browserConfirmation.showTransactionComplete(e)}async showTransactionProgress(e,r){if(this.shouldDelegateToBridge()){try{await r}catch{}return}return this.browserConfirmation.showTransactionProgress(e,r)}async showLoginSelector(e){return this.browserConfirmation.showLoginSelector(e)}async showMigrationFoundPrompt(e){return this.browserConfirmation.showMigrationFoundPrompt(e)}async showRecoveryPinInputPrompt(e){return this.browserConfirmation.showRecoveryPinInputPrompt(e)}async showRecoveryPinLockedPrompt(e,r){return this.browserConfirmation.showRecoveryPinLockedPrompt(e,r)}async showWalletSelector(e,r,t){const n=this.getBridge();if(this.shouldDelegateToBridge()&&(n!=null&&n.showWalletSelector))try{const i=await n.showWalletSelector({requiredAddress:t}),o=e.find(a=>a.address.toLowerCase()===i.address.toLowerCase());return{address:i.address,index:(o==null?void 0:o.index)??i.index,name:o==null?void 0:o.name}}catch{return null}return this.browserConfirmation.showWalletSelector(e,r,t)}async showPinSetupPrompt(e){return this.browserConfirmation.showPinSetupPrompt(e)}async showPinInputPrompt(e){return this.browserConfirmation.showPinInputPrompt(e)}async showSessionAlert(e){return this.browserConfirmation.showSessionAlert(e)}setTheme(e,r){return this.browserConfirmation.setTheme(e,r)}setMessages(e){return this.browserConfirmation.setMessages(e)}setPinKeyboard(e){var r,t;(t=(r=this.browserConfirmation).setPinKeyboard)==null||t.call(r,e)}}class os{constructor(){this._accessToken=null,this._expiresAt=0}set(e){this._accessToken=e;try{const r=JSON.parse(atob(e.split(".")[1]));this._expiresAt=typeof r.exp=="number"?r.exp*1e3:0}catch{this._expiresAt=0}}get(){return this._accessToken&&this._expiresAt>0&&Date.now()>=this._expiresAt?(this.clear(),null):this._accessToken}clear(){this._accessToken=null,this._expiresAt=0}has(){return this.get()!==null}isExpiringSoon(e=3e4){return!this._accessToken||this._expiresAt<=0?!0:Date.now()>=this._expiresAt-e}}function lo(s,e){if(!s.projectId)throw new Error(`[CROSSx] Fatal: projectId is required but was not provided.
2584
2595
  Set the projectId field in SDKConfig when calling createCROSSxSDK().
2585
- Example: createCROSSxSDK({ projectId: "your-project-id", ... })`);s.debug;const r=De.production,t={...s,oauthServiceUrl:r.oauthServiceUrl,authApiUrl:r.authApiUrl,walletGatewayUrl:r.walletGatewayUrl},n={gatewayUrl:r.walletGatewayUrl,projectId:s.projectId},i=t.authMode!=="cookie"&&jt.isAvailable();!i&&t.authMode!=="cookie"&&d.warn("[CROSSx] IndexedDB 사용 불가 — LocalStorage fallback 사용 중.","refresh_token이 평문 저장되지 않도록 세션 영속성이 제한됩니다.","IndexedDB를 지원하는 브라우저 사용을 권장합니다."),t.secureStorageAvailable=i;const o=i?new jt(s.projectId):new js,a=new si,c=new ai,l=new Ie,u=new os,p=new It;let g;s.useMockWallet?(d.log("[CROSSx] Mock Wallet Provider 사용"),g=new li(o,p)):(d.log("[CROSSx] Remote Wallet Provider 사용"),g=new Te(n,o,c,u,p));let _=null;const x=()=>{var D;return((D=_==null?void 0:_.isAuthenticatedViaRNBridge)==null?void 0:D.call(_))??!1};g=new di(g,()=>{var D;return(D=_==null?void 0:_.getRNBridge)==null?void 0:D.call(_)},x);const y=new We(n,c),v=new oo(s.theme??"light",s.themeTokens,s.displayDecimals,s.pinKeyboard),A=new ao(v,()=>{var D;return(D=_==null?void 0:_.getRNBridge)==null?void 0:D.call(_)},()=>typeof window<"u"?window.location.origin:"http://localhost",x),R=e!=null&&e.wrapConfirmation?e.wrapConfirmation(A):A,k=new Je(t,n,o,a,c,l,g,u,R,y,p);_=k;const L=k.signInUseCase;return L&&typeof L.setFreshTokenCallback=="function"&&L.setFreshTokenCallback(()=>k.requestFreshFirebaseIdTokenFromBridge()),typeof window<"u"&&(window.__crossxSDK=k),k}function lo(s){const e=uo(s),r=ho(e),t=JSON.parse(r);_o(t);const{data:n}=t;return{status:t.status,state:t.state,firebaseToken:n.accessToken,provider:n.provider,email:n.email,providerSub:n.sub,tokenType:n.tokenType,expiresIn:n.expiresIn,raw:t}}function uo(s){if(s.includes("://")&&s.includes("?")){const e=new URL(s),r=e.searchParams.get("crossx_oauth_result");if(r)return r;const t=e.searchParams.get("data");if(t)return t;throw new Error("Deeplink URL에 crossx_oauth_result 또는 data 파라미터가 없습니다")}return s}function ho(s){if(s.startsWith("{"))return s;if(s.startsWith("%7B")||s.startsWith("%7b"))return decodeURIComponent(s);const e=po(s);return decodeURIComponent(e)}function po(s){if(typeof atob=="function")return atob(s);if(typeof Buffer<"u")return Buffer.from(s,"base64").toString("utf-8");throw new Error("Base64 디코딩을 지원하는 환경이 아닙니다")}function _o(s){if(typeof s!="object"||s===null)throw new Error("Deeplink payload가 유효한 객체가 아닙니다");const e=s;if(typeof e.status!="string")throw new Error("Deeplink payload에 status 필드가 없습니다");if(typeof e.state!="string")throw new Error("Deeplink payload에 state 필드가 없습니다");if(typeof e.data!="object"||e.data===null)throw new Error("Deeplink payload에 data 필드가 없습니다");const r=e.data;if(typeof r.provider!="string")throw new Error("Deeplink data에 provider 필드가 없습니다");if(typeof r.accessToken!="string")throw new Error("Deeplink data에 accessToken 필드가 없습니다")}exports.CONNECT_OTHER_WALLET_DISPLAY_ORDER=fr;exports.CROSSxError=f;exports.CROSSxEthereumProvider=xr;exports.CROSSxSDK=Je;exports.ChainId=us;exports.ConnectOtherWalletItem=Le;exports.ErrorCode=h;exports.MNEMONIC_ADDRESS_LIMIT=Xe;exports.PinMemoryStore=It;exports.TokenMemoryStore=os;exports.createCROSSxSDK=co;exports.getConnectOtherWalletLabel=gr;exports.parseOAuthDeeplink=lo;
2596
+ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`);s.debug;const r=De.production,t={...s,oauthServiceUrl:r.oauthServiceUrl,authApiUrl:r.authApiUrl,walletGatewayUrl:r.walletGatewayUrl},n={gatewayUrl:r.walletGatewayUrl,projectId:s.projectId},i=t.authMode!=="cookie"&&jt.isAvailable();!i&&t.authMode!=="cookie"&&d.warn("[CROSSx] IndexedDB 사용 불가 — LocalStorage fallback 사용 중.","refresh_token이 평문 저장되지 않도록 세션 영속성이 제한됩니다.","IndexedDB를 지원하는 브라우저 사용을 권장합니다."),t.secureStorageAvailable=i;const o=i?new jt(s.projectId):new js,a=new si,c=new ai,l=new Ie,u=new os,p=new It;let g;s.useMockWallet?(d.log("[CROSSx] Mock Wallet Provider 사용"),g=new li(o,p)):(d.log("[CROSSx] Remote Wallet Provider 사용"),g=new Te(n,o,c,u,p));let _=null;const x=()=>{var D;return((D=_==null?void 0:_.isAuthenticatedViaRNBridge)==null?void 0:D.call(_))??!1};g=new di(g,()=>{var D;return(D=_==null?void 0:_.getRNBridge)==null?void 0:D.call(_)},x);const y=new We(n,c),v=new ao(s.theme??"light",s.themeTokens,s.displayDecimals,s.pinKeyboard),A=new co(v,()=>{var D;return(D=_==null?void 0:_.getRNBridge)==null?void 0:D.call(_)},()=>typeof window<"u"?window.location.origin:"http://localhost",x),R=e!=null&&e.wrapConfirmation?e.wrapConfirmation(A):A,k=new Je(t,n,o,a,c,l,g,u,R,y,p);_=k;const L=k.signInUseCase;return L&&typeof L.setFreshTokenCallback=="function"&&L.setFreshTokenCallback(()=>k.requestFreshFirebaseIdTokenFromBridge()),typeof window<"u"&&(window.__crossxSDK=k),k}function uo(s){const e=ho(s),r=po(e),t=JSON.parse(r);fo(t);const{data:n}=t;return{status:t.status,state:t.state,firebaseToken:n.accessToken,provider:n.provider,email:n.email,providerSub:n.sub,tokenType:n.tokenType,expiresIn:n.expiresIn,raw:t}}function ho(s){if(s.includes("://")&&s.includes("?")){const e=new URL(s),r=e.searchParams.get("crossx_oauth_result");if(r)return r;const t=e.searchParams.get("data");if(t)return t;throw new Error("Deeplink URL에 crossx_oauth_result 또는 data 파라미터가 없습니다")}return s}function po(s){if(s.startsWith("{"))return s;if(s.startsWith("%7B")||s.startsWith("%7b"))return decodeURIComponent(s);const e=_o(s);return decodeURIComponent(e)}function _o(s){if(typeof atob=="function")return atob(s);if(typeof Buffer<"u")return Buffer.from(s,"base64").toString("utf-8");throw new Error("Base64 디코딩을 지원하는 환경이 아닙니다")}function fo(s){if(typeof s!="object"||s===null)throw new Error("Deeplink payload가 유효한 객체가 아닙니다");const e=s;if(typeof e.status!="string")throw new Error("Deeplink payload에 status 필드가 없습니다");if(typeof e.state!="string")throw new Error("Deeplink payload에 state 필드가 없습니다");if(typeof e.data!="object"||e.data===null)throw new Error("Deeplink payload에 data 필드가 없습니다");const r=e.data;if(typeof r.provider!="string")throw new Error("Deeplink data에 provider 필드가 없습니다");if(typeof r.accessToken!="string")throw new Error("Deeplink data에 accessToken 필드가 없습니다")}exports.CONNECT_OTHER_WALLET_DISPLAY_ORDER=fr;exports.CROSSxError=f;exports.CROSSxEthereumProvider=xr;exports.CROSSxSDK=Je;exports.ChainId=us;exports.ConnectOtherWalletItem=Le;exports.ErrorCode=h;exports.MNEMONIC_ADDRESS_LIMIT=Xe;exports.PinMemoryStore=It;exports.TokenMemoryStore=os;exports.createCROSSxSDK=lo;exports.getConnectOtherWalletLabel=gr;exports.parseOAuthDeeplink=uo;