@latticexyz/entrykit 2.2.22-6344ced32a0e0903de81a689ac45b97703db136e → 2.2.22-6508c1df5ea605f58112f192114a2f837f362ecc

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.
@@ -22,7 +22,7 @@ import { forwardRef, useEffect, useRef, useState } from "react";
22
22
  import ReactDOM from "react-dom";
23
23
 
24
24
  // ../../node_modules/.pnpm/tailwindcss@3.4.13/node_modules/tailwindcss/tailwind.css?inline
25
- var tailwind_default = '*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}/*\n! tailwindcss v3.4.13 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: \'\';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user\'s configured `sans` font-family by default.\n5. Use the user\'s configured `sans` font-feature-settings by default.\n6. Use the user\'s configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */ /* 3 */\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user\'s configured `mono` font-family by default.\n2. Use the user\'s configured `mono` font-feature-settings by default.\n3. Use the user\'s configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type=\'button\']),\ninput:where([type=\'reset\']),\ninput:where([type=\'submit\']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type=\'search\'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user\'s configured gray 400 color.\n*/\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role="button"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don\'t get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden] {\n display: none;\n}\n\n.container {\n width: 100%;\n}\n\n@media (min-width: 640px) {\n\n .container {\n max-width: 640px;\n }\n}\n\n@media (min-width: 768px) {\n\n .container {\n max-width: 768px;\n }\n}\n\n@media (min-width: 1024px) {\n\n .container {\n max-width: 1024px;\n }\n}\n\n@media (min-width: 1280px) {\n\n .container {\n max-width: 1280px;\n }\n}\n\n@media (min-width: 1536px) {\n\n .container {\n max-width: 1536px;\n }\n}\n\n.grid-cols-2.divide-y > :not([hidden]) ~ :not([hidden]):nth-child(-n + 2) {\n border-top-width: 0;\n border-bottom-width: 0;\n}\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.pointer-events-none {\n pointer-events: none;\n}\n\n.pointer-events-auto {\n pointer-events: auto;\n}\n\n.fixed {\n position: fixed;\n}\n\n.absolute {\n position: absolute;\n}\n\n.relative {\n position: relative;\n}\n\n.sticky {\n position: sticky;\n}\n\n.inset-0 {\n inset: 0px;\n}\n\n.bottom-0 {\n bottom: 0px;\n}\n\n.left-0 {\n left: 0px;\n}\n\n.right-0 {\n right: 0px;\n}\n\n.top-0 {\n top: 0px;\n}\n\n.col-start-1 {\n grid-column-start: 1;\n}\n\n.row-start-1 {\n grid-row-start: 1;\n}\n\n.m-0 {\n margin: 0px;\n}\n\n.m-2 {\n margin: 0.5rem;\n}\n\n.-mx-0\\.5 {\n margin-left: -0.125rem;\n margin-right: -0.125rem;\n}\n\n.-my-1 {\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n}\n\n.-my-\\[0\\.125em\\] {\n margin-top: -0.125em;\n margin-bottom: -0.125em;\n}\n\n.mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n\n.-ml-3 {\n margin-left: -0.75rem;\n}\n\n.-mt-2 {\n margin-top: -0.5rem;\n}\n\n.block {\n display: block;\n}\n\n.flex {\n display: flex;\n}\n\n.inline-flex {\n display: inline-flex;\n}\n\n.table {\n display: table;\n}\n\n.grid {\n display: grid;\n}\n\n.inline-grid {\n display: inline-grid;\n}\n\n.contents {\n display: contents;\n}\n\n.hidden {\n display: none;\n}\n\n.h-12 {\n height: 3rem;\n}\n\n.h-16 {\n height: 4rem;\n}\n\n.h-4 {\n height: 1rem;\n}\n\n.h-6 {\n height: 1.5rem;\n}\n\n.h-64 {\n height: 16rem;\n}\n\n.h-\\[1\\.25em\\] {\n height: 1.25em;\n}\n\n.h-\\[1em\\] {\n height: 1em;\n}\n\n.h-full {\n height: 100%;\n}\n\n.max-h-full {\n max-height: 100%;\n}\n\n.min-h-\\[22rem\\] {\n min-height: 22rem;\n}\n\n.min-h-\\[26rem\\] {\n min-height: 26rem;\n}\n\n.w-16 {\n width: 4rem;\n}\n\n.w-24 {\n width: 6rem;\n}\n\n.w-28 {\n width: 7rem;\n}\n\n.w-4 {\n width: 1rem;\n}\n\n.w-48 {\n width: 12rem;\n}\n\n.w-6 {\n width: 1.5rem;\n}\n\n.w-60 {\n width: 15rem;\n}\n\n.w-\\[0\\.6em\\] {\n width: 0.6em;\n}\n\n.w-\\[1\\.25em\\] {\n width: 1.25em;\n}\n\n.w-full {\n width: 100%;\n}\n\n.max-w-\\[26rem\\] {\n max-width: 26rem;\n}\n\n.flex-shrink-0 {\n flex-shrink: 0;\n}\n\n.flex-grow {\n flex-grow: 1;\n}\n\n.-translate-y-2 {\n --tw-translate-y: -0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.-translate-y-4 {\n --tw-translate-y: -1rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-x-2 {\n --tw-translate-x: 0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-y-0 {\n --tw-translate-y: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-50 {\n --tw-scale-x: .5;\n --tw-scale-y: .5;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n@keyframes spin {\n\n to {\n transform: rotate(360deg);\n }\n}\n\n.animate-spin {\n animation: spin 1s linear infinite;\n}\n\n.cursor-pointer {\n cursor: pointer;\n}\n\n.grid-cols-\\[1fr_auto_1fr\\] {\n grid-template-columns: 1fr auto 1fr;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.place-items-center {\n place-items: center;\n}\n\n.items-end {\n align-items: flex-end;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.justify-center {\n justify-content: center;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.gap-1 {\n gap: 0.25rem;\n}\n\n.gap-2 {\n gap: 0.5rem;\n}\n\n.gap-2\\.5 {\n gap: 0.625rem;\n}\n\n.gap-4 {\n gap: 1rem;\n}\n\n.gap-6 {\n gap: 1.5rem;\n}\n\n.space-y-6 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));\n}\n\n.divide-y > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-y-reverse: 0;\n border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));\n border-bottom-width: calc(1px * var(--tw-divide-y-reverse));\n}\n\n.divide-neutral-800 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(38 38 38 / var(--tw-divide-opacity));\n}\n\n.self-auto {\n align-self: auto;\n}\n\n.self-center {\n align-self: center;\n}\n\n.overflow-auto {\n overflow: auto;\n}\n\n.overflow-clip {\n overflow: clip;\n}\n\n.whitespace-pre-wrap {\n white-space: pre-wrap;\n}\n\n.rounded-full {\n border-radius: 9999px;\n}\n\n.border {\n border-width: 1px;\n}\n\n.border-4 {\n border-width: 4px;\n}\n\n.border-neutral-300 {\n --tw-border-opacity: 1;\n border-color: rgb(212 212 212 / var(--tw-border-opacity));\n}\n\n.border-transparent {\n border-color: transparent;\n}\n\n.bg-black\\/10 {\n background-color: rgb(0 0 0 / 0.1);\n}\n\n.bg-blue-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(29 78 216 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700\\/60 {\n background-color: rgb(29 78 216 / 0.6);\n}\n\n.bg-neutral-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(245 245 245 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800 {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800\\/85 {\n background-color: rgb(38 38 38 / 0.85);\n}\n\n.bg-neutral-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.bg-orange-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(249 115 22 / var(--tw-bg-opacity));\n}\n\n.bg-orange-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.bg-gradient-to-b {\n background-image: linear-gradient(to bottom, var(--tw-gradient-stops));\n}\n\n.from-transparent {\n --tw-gradient-from: transparent var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n\n.to-blue-700 {\n --tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position);\n}\n\n.bg-cover {\n background-size: cover;\n}\n\n.bg-center {\n background-position: center;\n}\n\n.bg-no-repeat {\n background-repeat: no-repeat;\n}\n\n.object-cover {\n object-fit: cover;\n}\n\n.p-1 {\n padding: 0.25rem;\n}\n\n.p-2 {\n padding: 0.5rem;\n}\n\n.p-3 {\n padding: 0.75rem;\n}\n\n.p-4 {\n padding: 1rem;\n}\n\n.p-6 {\n padding: 1.5rem;\n}\n\n.p-\\[\\.75em\\] {\n padding: .75em;\n}\n\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n.py-8 {\n padding-top: 2rem;\n padding-bottom: 2rem;\n}\n\n.pb-8 {\n padding-bottom: 2rem;\n}\n\n.pt-8 {\n padding-top: 2rem;\n}\n\n.text-left {\n text-align: left;\n}\n\n.text-center {\n text-align: center;\n}\n\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n}\n\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n\n.text-\\[\\.75em\\] {\n font-size: .75em;\n}\n\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.font-bold {\n font-weight: 700;\n}\n\n.font-medium {\n font-weight: 500;\n}\n\n.leading-none {\n line-height: 1;\n}\n\n.tracking-\\[-1ch\\] {\n letter-spacing: -1ch;\n}\n\n.text-black {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n\n.text-neutral-400 {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity));\n}\n\n.text-transparent {\n color: transparent;\n}\n\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.text-white\\/20 {\n color: rgb(255 255 255 / 0.2);\n}\n\n.text-white\\/80 {\n color: rgb(255 255 255 / 0.8);\n}\n\n.opacity-0 {\n opacity: 0;\n}\n\n.opacity-100 {\n opacity: 1;\n}\n\n.opacity-25 {\n opacity: 0.25;\n}\n\n.opacity-30 {\n opacity: 0.3;\n}\n\n.opacity-75 {\n opacity: 0.75;\n}\n\n.outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.ring-1 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.ring-neutral-700\\/50 {\n --tw-ring-color: rgb(64 64 64 / 0.5);\n}\n\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.duration-100 {\n transition-duration: 100ms;\n}\n\n.duration-300 {\n transition-duration: 300ms;\n}\n\n@keyframes enter {\n\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n\n@keyframes exit {\n\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n\n.animate-in {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n\n.fade-in {\n --tw-enter-opacity: 0;\n}\n\n.slide-in-from-bottom-16 {\n --tw-enter-translate-y: 4rem;\n}\n\n.slide-in-from-bottom-8 {\n --tw-enter-translate-y: 2rem;\n}\n\n.animate-duration-300 {\n animation-duration: 300ms;\n}\n\n@property --tw-border-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@property --tw-conic-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@keyframes border-gradient {\n\n to {\n --tw-border-gradient-angle: 360deg;\n }\n}\n\n.after\\:select-none::after {\n content: var(--tw-content);\n -webkit-user-select: none;\n user-select: none;\n}\n\n.after\\:content-\\[\\\'\\2026\\\'\\]::after {\n --tw-content: \'\u2026\';\n content: var(--tw-content);\n}\n\n.hover\\:bg-blue-500:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-neutral-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-orange-400:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(251 146 60 / var(--tw-bg-opacity));\n}\n\n.hover\\:text-white:hover {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.hover\\:text-white\\/40:hover {\n color: rgb(255 255 255 / 0.4);\n}\n\n.hover\\:brightness-125:hover {\n --tw-brightness: brightness(1.25);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.focus\\:border-orange-500:focus {\n --tw-border-opacity: 1;\n border-color: rgb(249 115 22 / var(--tw-border-opacity));\n}\n\n.focus\\:border-yellow-400:focus {\n --tw-border-opacity: 1;\n border-color: rgb(250 204 21 / var(--tw-border-opacity));\n}\n\n.active\\:bg-orange-600:active {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.active\\:brightness-150:active {\n --tw-brightness: brightness(1.5);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.group:hover .group-hover\\:rotate-90 {\n --tw-rotate: 90deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.aria-busy\\:pointer-events-none[aria-busy="true"] {\n pointer-events: none;\n}\n\n.aria-busy\\:bg-blue-500[aria-busy="true"] {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.aria-disabled\\:pointer-events-none[aria-disabled="true"] {\n pointer-events: none;\n}\n\n.aria-disabled\\:opacity-50[aria-disabled="true"] {\n opacity: 0.5;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:inline {\n display: inline;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:hidden {\n display: none;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:translate-x-0 {\n --tw-translate-x: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-125 {\n --tw-scale-x: 1.25;\n --tw-scale-y: 1.25;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:opacity-100 {\n opacity: 1;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-0 {\n opacity: 0;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-100 {\n opacity: 1;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:duration-300 {\n transition-duration: 300ms;\n}\n\n.data-\\[highlighted\\]\\:bg-neutral-200[data-highlighted] {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.links\\:font-medium a[href]:not(.links-unset) {\n font-weight: 500;\n}\n\n.links\\:text-white a[href]:not(.links-unset) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.links\\:underline a[href]:not(.links-unset) {\n text-decoration-line: underline;\n}\n\n.links\\:decoration-neutral-500 a[href]:not(.links-unset) {\n text-decoration-color: #737373;\n}\n\n.links\\:underline-offset-4 a[href]:not(.links-unset) {\n text-underline-offset: 4px;\n}\n\n.hover\\:links\\:decoration-orange-500 a[href]:not(.links-unset):hover {\n text-decoration-color: #f97316;\n}\n\n@media (min-width: 640px) {\n\n .sm\\:items-center {\n align-items: center;\n }\n}\n\n.dark\\:border-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-border-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-border-opacity));\n}\n\n.dark\\:bg-neutral-800:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-white\\/10:where([data-theme="dark"], [data-theme="dark"] *) {\n background-color: rgb(255 255 255 / 0.1);\n}\n\n.dark\\:text-white:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.dark\\:hover\\:bg-neutral-700:hover:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n';
25
+ var tailwind_default = '*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}/*\n! tailwindcss v3.4.13 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: \'\';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user\'s configured `sans` font-family by default.\n5. Use the user\'s configured `sans` font-feature-settings by default.\n6. Use the user\'s configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */ /* 3 */\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user\'s configured `mono` font-family by default.\n2. Use the user\'s configured `mono` font-feature-settings by default.\n3. Use the user\'s configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type=\'button\']),\ninput:where([type=\'reset\']),\ninput:where([type=\'submit\']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type=\'search\'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user\'s configured gray 400 color.\n*/\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role="button"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don\'t get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden] {\n display: none;\n}\n\n.container {\n width: 100%;\n}\n\n@media (min-width: 640px) {\n\n .container {\n max-width: 640px;\n }\n}\n\n@media (min-width: 768px) {\n\n .container {\n max-width: 768px;\n }\n}\n\n@media (min-width: 1024px) {\n\n .container {\n max-width: 1024px;\n }\n}\n\n@media (min-width: 1280px) {\n\n .container {\n max-width: 1280px;\n }\n}\n\n@media (min-width: 1536px) {\n\n .container {\n max-width: 1536px;\n }\n}\n\n.grid-cols-2.divide-y > :not([hidden]) ~ :not([hidden]):nth-child(-n + 2) {\n border-top-width: 0;\n border-bottom-width: 0;\n}\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.pointer-events-none {\n pointer-events: none;\n}\n\n.pointer-events-auto {\n pointer-events: auto;\n}\n\n.fixed {\n position: fixed;\n}\n\n.absolute {\n position: absolute;\n}\n\n.relative {\n position: relative;\n}\n\n.sticky {\n position: sticky;\n}\n\n.inset-0 {\n inset: 0px;\n}\n\n.bottom-0 {\n bottom: 0px;\n}\n\n.left-0 {\n left: 0px;\n}\n\n.right-0 {\n right: 0px;\n}\n\n.top-0 {\n top: 0px;\n}\n\n.col-start-1 {\n grid-column-start: 1;\n}\n\n.row-start-1 {\n grid-row-start: 1;\n}\n\n.m-0 {\n margin: 0px;\n}\n\n.m-2 {\n margin: 0.5rem;\n}\n\n.-mx-0\\.5 {\n margin-left: -0.125rem;\n margin-right: -0.125rem;\n}\n\n.-my-1 {\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n}\n\n.-my-\\[0\\.125em\\] {\n margin-top: -0.125em;\n margin-bottom: -0.125em;\n}\n\n.mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n\n.-ml-3 {\n margin-left: -0.75rem;\n}\n\n.-mr-1 {\n margin-right: -0.25rem;\n}\n\n.-mt-2 {\n margin-top: -0.5rem;\n}\n\n.mt-1 {\n margin-top: 0.25rem;\n}\n\n.mt-4 {\n margin-top: 1rem;\n}\n\n.block {\n display: block;\n}\n\n.inline-block {\n display: inline-block;\n}\n\n.flex {\n display: flex;\n}\n\n.inline-flex {\n display: inline-flex;\n}\n\n.table {\n display: table;\n}\n\n.grid {\n display: grid;\n}\n\n.inline-grid {\n display: inline-grid;\n}\n\n.contents {\n display: contents;\n}\n\n.hidden {\n display: none;\n}\n\n.aspect-square {\n aspect-ratio: 1 / 1;\n}\n\n.h-10 {\n height: 2.5rem;\n}\n\n.h-12 {\n height: 3rem;\n}\n\n.h-16 {\n height: 4rem;\n}\n\n.h-3 {\n height: 0.75rem;\n}\n\n.h-3\\.5 {\n height: 0.875rem;\n}\n\n.h-4 {\n height: 1rem;\n}\n\n.h-6 {\n height: 1.5rem;\n}\n\n.h-64 {\n height: 16rem;\n}\n\n.h-\\[1\\.25em\\] {\n height: 1.25em;\n}\n\n.h-\\[1em\\] {\n height: 1em;\n}\n\n.h-\\[2px\\] {\n height: 2px;\n}\n\n.h-full {\n height: 100%;\n}\n\n.max-h-\\[230px\\] {\n max-height: 230px;\n}\n\n.max-h-full {\n max-height: 100%;\n}\n\n.w-10 {\n width: 2.5rem;\n}\n\n.w-16 {\n width: 4rem;\n}\n\n.w-24 {\n width: 6rem;\n}\n\n.w-28 {\n width: 7rem;\n}\n\n.w-3 {\n width: 0.75rem;\n}\n\n.w-3\\.5 {\n width: 0.875rem;\n}\n\n.w-4 {\n width: 1rem;\n}\n\n.w-48 {\n width: 12rem;\n}\n\n.w-6 {\n width: 1.5rem;\n}\n\n.w-60 {\n width: 15rem;\n}\n\n.w-8 {\n width: 2rem;\n}\n\n.w-\\[0\\.6em\\] {\n width: 0.6em;\n}\n\n.w-\\[1\\.25em\\] {\n width: 1.25em;\n}\n\n.w-\\[352px\\] {\n width: 352px;\n}\n\n.w-full {\n width: 100%;\n}\n\n.max-w-\\[26rem\\] {\n max-width: 26rem;\n}\n\n.flex-shrink-0 {\n flex-shrink: 0;\n}\n\n.flex-grow {\n flex-grow: 1;\n}\n\n.-translate-y-2 {\n --tw-translate-y: -0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.-translate-y-4 {\n --tw-translate-y: -1rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-x-2 {\n --tw-translate-x: 0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-y-0 {\n --tw-translate-y: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-50 {\n --tw-scale-x: .5;\n --tw-scale-y: .5;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n@keyframes spin {\n\n to {\n transform: rotate(360deg);\n }\n}\n\n.animate-spin {\n animation: spin 1s linear infinite;\n}\n\n.cursor-pointer {\n cursor: pointer;\n}\n\n.cursor-text {\n cursor: text;\n}\n\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n\n.grid-cols-\\[1fr_auto_1fr\\] {\n grid-template-columns: 1fr auto 1fr;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.place-items-center {\n place-items: center;\n}\n\n.items-end {\n align-items: flex-end;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.justify-center {\n justify-content: center;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.gap-1 {\n gap: 0.25rem;\n}\n\n.gap-2 {\n gap: 0.5rem;\n}\n\n.gap-2\\.5 {\n gap: 0.625rem;\n}\n\n.gap-4 {\n gap: 1rem;\n}\n\n.gap-5 {\n gap: 1.25rem;\n}\n\n.gap-6 {\n gap: 1.5rem;\n}\n\n.space-y-6 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));\n}\n\n.divide-y > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-y-reverse: 0;\n border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));\n border-bottom-width: calc(1px * var(--tw-divide-y-reverse));\n}\n\n.divide-neutral-700 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-divide-opacity));\n}\n\n.divide-neutral-800 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(38 38 38 / var(--tw-divide-opacity));\n}\n\n.self-auto {\n align-self: auto;\n}\n\n.self-center {\n align-self: center;\n}\n\n.overflow-auto {\n overflow: auto;\n}\n\n.overflow-clip {\n overflow: clip;\n}\n\n.overflow-y-auto {\n overflow-y: auto;\n}\n\n.whitespace-nowrap {\n white-space: nowrap;\n}\n\n.whitespace-pre-wrap {\n white-space: pre-wrap;\n}\n\n.rounded-full {\n border-radius: 9999px;\n}\n\n.border {\n border-width: 1px;\n}\n\n.border-2 {\n border-width: 2px;\n}\n\n.border-4 {\n border-width: 4px;\n}\n\n.border-dashed {\n border-style: dashed;\n}\n\n.border-neutral-300 {\n --tw-border-opacity: 1;\n border-color: rgb(212 212 212 / var(--tw-border-opacity));\n}\n\n.border-neutral-700 {\n --tw-border-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-border-opacity));\n}\n\n.border-transparent {\n border-color: transparent;\n}\n\n.border-white\\/50 {\n border-color: rgb(255 255 255 / 0.5);\n}\n\n.bg-black\\/10 {\n background-color: rgb(0 0 0 / 0.1);\n}\n\n.bg-blue-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(29 78 216 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700\\/60 {\n background-color: rgb(29 78 216 / 0.6);\n}\n\n.bg-green-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(22 163 74 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(245 245 245 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800 {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800\\/85 {\n background-color: rgb(38 38 38 / 0.85);\n}\n\n.bg-neutral-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.bg-orange-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(249 115 22 / var(--tw-bg-opacity));\n}\n\n.bg-orange-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.bg-red-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(220 38 38 / var(--tw-bg-opacity));\n}\n\n.bg-transparent {\n background-color: transparent;\n}\n\n.bg-gradient-to-b {\n background-image: linear-gradient(to bottom, var(--tw-gradient-stops));\n}\n\n.from-transparent {\n --tw-gradient-from: transparent var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n\n.to-blue-700 {\n --tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position);\n}\n\n.bg-cover {\n background-size: cover;\n}\n\n.bg-center {\n background-position: center;\n}\n\n.bg-no-repeat {\n background-repeat: no-repeat;\n}\n\n.object-cover {\n object-fit: cover;\n}\n\n.p-1 {\n padding: 0.25rem;\n}\n\n.p-2 {\n padding: 0.5rem;\n}\n\n.p-2\\.5 {\n padding: 0.625rem;\n}\n\n.p-3 {\n padding: 0.75rem;\n}\n\n.p-4 {\n padding: 1rem;\n}\n\n.p-6 {\n padding: 1.5rem;\n}\n\n.p-\\[\\.75em\\] {\n padding: .75em;\n}\n\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n.py-8 {\n padding-top: 2rem;\n padding-bottom: 2rem;\n}\n\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n\n.pb-8 {\n padding-bottom: 2rem;\n}\n\n.pt-10 {\n padding-top: 2.5rem;\n}\n\n.pt-8 {\n padding-top: 2rem;\n}\n\n.text-left {\n text-align: left;\n}\n\n.text-center {\n text-align: center;\n}\n\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n}\n\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n\n.text-\\[\\.75em\\] {\n font-size: .75em;\n}\n\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.font-bold {\n font-weight: 700;\n}\n\n.font-medium {\n font-weight: 500;\n}\n\n.leading-loose {\n line-height: 2;\n}\n\n.leading-none {\n line-height: 1;\n}\n\n.tracking-\\[-1ch\\] {\n letter-spacing: -1ch;\n}\n\n.text-amber-500 {\n --tw-text-opacity: 1;\n color: rgb(245 158 11 / var(--tw-text-opacity));\n}\n\n.text-black {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n\n.text-gray-400 {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity));\n}\n\n.text-green-600 {\n --tw-text-opacity: 1;\n color: rgb(22 163 74 / var(--tw-text-opacity));\n}\n\n.text-neutral-300 {\n --tw-text-opacity: 1;\n color: rgb(212 212 212 / var(--tw-text-opacity));\n}\n\n.text-neutral-400 {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n\n.text-neutral-500 {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity));\n}\n\n.text-transparent {\n color: transparent;\n}\n\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.text-white\\/20 {\n color: rgb(255 255 255 / 0.2);\n}\n\n.text-white\\/50 {\n color: rgb(255 255 255 / 0.5);\n}\n\n.text-white\\/80 {\n color: rgb(255 255 255 / 0.8);\n}\n\n.underline {\n text-decoration-line: underline;\n}\n\n.decoration-neutral-500 {\n text-decoration-color: #737373;\n}\n\n.underline-offset-4 {\n text-underline-offset: 4px;\n}\n\n.opacity-0 {\n opacity: 0;\n}\n\n.opacity-100 {\n opacity: 1;\n}\n\n.opacity-25 {\n opacity: 0.25;\n}\n\n.opacity-30 {\n opacity: 0.3;\n}\n\n.opacity-50 {\n opacity: 0.5;\n}\n\n.opacity-75 {\n opacity: 0.75;\n}\n\n.outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.ring-1 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.ring-2 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.ring-neutral-700\\/50 {\n --tw-ring-color: rgb(64 64 64 / 0.5);\n}\n\n.ring-transparent {\n --tw-ring-color: transparent;\n}\n\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.duration-100 {\n transition-duration: 100ms;\n}\n\n.duration-300 {\n transition-duration: 300ms;\n}\n\n.ease-linear {\n transition-timing-function: linear;\n}\n\n@keyframes enter {\n\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n\n@keyframes exit {\n\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n\n.animate-in {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n\n.animate-out {\n animation-name: exit;\n animation-duration: 150ms;\n --tw-exit-opacity: initial;\n --tw-exit-scale: initial;\n --tw-exit-rotate: initial;\n --tw-exit-translate-x: initial;\n --tw-exit-translate-y: initial;\n}\n\n.fade-in {\n --tw-enter-opacity: 0;\n}\n\n.fade-out {\n --tw-exit-opacity: 0;\n}\n\n.slide-in-from-bottom-16 {\n --tw-enter-translate-y: 4rem;\n}\n\n.slide-in-from-bottom-2 {\n --tw-enter-translate-y: 0.5rem;\n}\n\n.slide-in-from-bottom-8 {\n --tw-enter-translate-y: 2rem;\n}\n\n.slide-in-from-top-2 {\n --tw-enter-translate-y: -0.5rem;\n}\n\n.animate-duration-300 {\n animation-duration: 300ms;\n}\n\n.ease-linear {\n animation-timing-function: linear;\n}\n\n@property --tw-border-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@property --tw-conic-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@keyframes border-gradient {\n\n to {\n --tw-border-gradient-angle: 360deg;\n }\n}\n\n.placeholder\\:text-neutral-500::placeholder {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.after\\:select-none::after {\n content: var(--tw-content);\n -webkit-user-select: none;\n user-select: none;\n}\n\n.after\\:content-\\[\\\'\\2026\\\'\\]::after {\n --tw-content: \'\u2026\';\n content: var(--tw-content);\n}\n\n.focus-within\\:border-transparent:focus-within {\n border-color: transparent;\n}\n\n.focus-within\\:ring-orange-500:focus-within {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(249 115 22 / var(--tw-ring-opacity));\n}\n\n.hover\\:bg-blue-500:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-neutral-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-orange-400:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(251 146 60 / var(--tw-bg-opacity));\n}\n\n.hover\\:text-white:hover {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.hover\\:text-white\\/40:hover {\n color: rgb(255 255 255 / 0.4);\n}\n\n.hover\\:text-white\\/80:hover {\n color: rgb(255 255 255 / 0.8);\n}\n\n.hover\\:decoration-orange-500:hover {\n text-decoration-color: #f97316;\n}\n\n.hover\\:brightness-125:hover {\n --tw-brightness: brightness(1.25);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.focus\\:border-orange-500:focus {\n --tw-border-opacity: 1;\n border-color: rgb(249 115 22 / var(--tw-border-opacity));\n}\n\n.focus\\:border-yellow-400:focus {\n --tw-border-opacity: 1;\n border-color: rgb(250 204 21 / var(--tw-border-opacity));\n}\n\n.focus\\:bg-neutral-700:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.active\\:bg-orange-600:active {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.active\\:brightness-150:active {\n --tw-brightness: brightness(1.5);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.group:hover .group-hover\\:pointer-events-none {\n pointer-events: none;\n}\n\n.group:hover .group-hover\\:pointer-events-auto {\n pointer-events: auto;\n}\n\n.group:hover .group-hover\\:inline-block {\n display: inline-block;\n}\n\n.group:hover .group-hover\\:hidden {\n display: none;\n}\n\n.group:hover .group-hover\\:rotate-90 {\n --tw-rotate: 90deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group:hover .group-hover\\:opacity-0 {\n opacity: 0;\n}\n\n.group:hover .group-hover\\:opacity-100 {\n opacity: 1;\n}\n\n.peer:placeholder-shown ~ .peer-placeholder-shown\\:text-neutral-500 {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.aria-busy\\:pointer-events-none[aria-busy="true"] {\n pointer-events: none;\n}\n\n.aria-busy\\:bg-blue-500[aria-busy="true"] {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.aria-disabled\\:pointer-events-none[aria-disabled="true"] {\n pointer-events: none;\n}\n\n.aria-disabled\\:opacity-50[aria-disabled="true"] {\n opacity: 0.5;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:inline {\n display: inline;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:hidden {\n display: none;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:translate-x-0 {\n --tw-translate-x: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-125 {\n --tw-scale-x: 1.25;\n --tw-scale-y: 1.25;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:opacity-100 {\n opacity: 1;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-0 {\n opacity: 0;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-100 {\n opacity: 1;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:duration-300 {\n transition-duration: 300ms;\n}\n\n.group[aria-expanded="true"] .group-aria-expanded\\:inline {\n display: inline;\n}\n\n.group[aria-expanded="true"] .group-aria-expanded\\:hidden {\n display: none;\n}\n\n.data-\\[highlighted\\]\\:bg-neutral-200[data-highlighted] {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.data-\\[state\\=checked\\]\\:bg-neutral-900[data-state="checked"] {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.links\\:font-medium a[href]:not(.links-unset) {\n font-weight: 500;\n}\n\n.links\\:text-white a[href]:not(.links-unset) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.links\\:underline a[href]:not(.links-unset) {\n text-decoration-line: underline;\n}\n\n.links\\:decoration-neutral-500 a[href]:not(.links-unset) {\n text-decoration-color: #737373;\n}\n\n.links\\:underline-offset-4 a[href]:not(.links-unset) {\n text-underline-offset: 4px;\n}\n\n.hover\\:links\\:decoration-orange-500 a[href]:not(.links-unset):hover {\n text-decoration-color: #f97316;\n}\n\n@media (min-width: 640px) {\n\n .sm\\:items-center {\n align-items: center;\n }\n}\n\n.dark\\:border-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-border-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-border-opacity));\n}\n\n.dark\\:bg-neutral-800:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-white\\/10:where([data-theme="dark"], [data-theme="dark"] *) {\n background-color: rgb(255 255 255 / 0.1);\n}\n\n.dark\\:text-white:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.dark\\:hover\\:bg-neutral-700:hover:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.\\[\\&_\\>_\\:is\\(dt\\2c dd\\)\\]\\:px-1 > :is(dt,dd) {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n\n.\\[\\&_\\>_dd\\]\\:text-right > dd {\n text-align: right;\n}\n';
26
26
 
27
27
  // src/ui/Shadow.tsx
28
28
  import { useResizeObserver } from "usehooks-ts";
@@ -37,14 +37,17 @@ function FrameProvider({ frame, children }) {
37
37
  if (value) throw new Error("`FrameProvider` can only be used once.");
38
38
  return /* @__PURE__ */ jsx(Context.Provider, { value: { frame }, children });
39
39
  }
40
+ function useFrame() {
41
+ const value = useContext(Context);
42
+ if (!value) throw new Error("`useFrame` can only be used within a `FrameProvider`.");
43
+ return value;
44
+ }
40
45
 
41
46
  // src/useTheme.ts
42
47
  import { useMediaQuery } from "usehooks-ts";
43
48
 
44
49
  // src/EntryKitConfigProvider.tsx
45
- import "@rainbow-me/rainbowkit/styles.css";
46
50
  import { createContext as createContext2, useContext as useContext2 } from "react";
47
- import { RainbowKitProvider, midnightTheme } from "@rainbow-me/rainbowkit";
48
51
  import { useChains } from "wagmi";
49
52
 
50
53
  // src/getBundlerTransport.ts
@@ -201,6 +204,7 @@ function getBundlerTransport(chain) {
201
204
  }
202
205
 
203
206
  // src/EntryKitConfigProvider.tsx
207
+ import { ConnectKitProvider } from "connectkit";
204
208
  import { jsx as jsx2 } from "react/jsx-runtime";
205
209
  var Context2 = createContext2(null);
206
210
  function EntryKitConfigProvider({ config, children }) {
@@ -211,14 +215,14 @@ function EntryKitConfigProvider({ config, children }) {
211
215
  if (!chain) throw new Error(`Could not find configured chain for chain ID ${config.chainId}.`);
212
216
  getBundlerTransport(chain);
213
217
  return /* @__PURE__ */ jsx2(
214
- RainbowKitProvider,
218
+ ConnectKitProvider,
215
219
  {
216
- initialChain: 0,
217
- appInfo: {
218
- appName: config.appName
219
- // TODO: learn more and disclaimer
220
+ theme: "midnight",
221
+ options: {
222
+ // Prevent Wagmi trying to switch chains after connection
223
+ // https://github.com/wevm/wagmi/blob/f5b717ccf8a5b283263cadc984ba00b354bcefae/packages/core/src/connectors/injected.ts#L174-L182
224
+ initialChainId: 0
220
225
  },
221
- theme: midnightTheme({ borderRadius: "none" }),
222
226
  children: /* @__PURE__ */ jsx2(Context2.Provider, { value: { ...config, chain }, children })
223
227
  }
224
228
  );
@@ -269,7 +273,9 @@ var Shadow = forwardRef(function Shadow2({ mode, children }, forwardedRef) {
269
273
  inset: "0",
270
274
  width: "100%",
271
275
  height: "100%",
272
- zIndex: "2147483646"
276
+ // one less than ConnectKit's modal z-index
277
+ // so that ConnectKit can overlap properly
278
+ zIndex: "2147483645"
273
279
  } : frameSize.width && frameSize.height ? {
274
280
  all: "unset",
275
281
  display: "inline-grid",
@@ -368,13 +374,10 @@ function useAccountModal() {
368
374
  }
369
375
 
370
376
  // src/AccountModal.tsx
371
- import { twMerge as twMerge10 } from "tailwind-merge";
377
+ import { twMerge as twMerge20 } from "tailwind-merge";
372
378
 
373
379
  // src/AccountModalContent.tsx
374
- import { useAccount as useAccount2, useConnectorClient } from "wagmi";
375
-
376
- // src/ConnectWallet.tsx
377
- import { useAccount } from "wagmi";
380
+ import { useAccount as useAccount8, useConnectorClient } from "wagmi";
378
381
 
379
382
  // src/ui/Button.tsx
380
383
  import { twMerge as twMerge3 } from "tailwind-merge";
@@ -441,7 +444,7 @@ var Button = ({ pending, variant, type, className, children, disabled, ...props
441
444
  };
442
445
 
443
446
  // src/ConnectWallet.tsx
444
- import { useConnectModal } from "@rainbow-me/rainbowkit";
447
+ import { useModal } from "connectkit";
445
448
 
446
449
  // src/icons/Logo.tsx
447
450
  import { twMerge as twMerge4 } from "tailwind-merge";
@@ -501,7 +504,7 @@ function AppInfo() {
501
504
  return /* @__PURE__ */ jsxs6("div", { className: "flex-grow flex flex-col items-center justify-center gap-2", children: [
502
505
  /* @__PURE__ */ jsx8("div", { className: "w-16 h-16 m-2", children: !appIconLoading ? hasAppIcon ? /* @__PURE__ */ jsx8("img", { src: appIcon, className: "w-full h-full object-cover" }) : (
503
506
  // TODO: swap with favicon
504
- /* @__PURE__ */ jsx8(Logo, { className: "w-full h-full text-orange-500 dark:bg-neutral-800" })
507
+ /* @__PURE__ */ jsx8(Logo, { className: "w-full h-full text-orange-500 bg-neutral-800" })
505
508
  ) : null }),
506
509
  /* @__PURE__ */ jsx8("div", { className: "text-2xl text-white text-center", children: appName })
507
510
  ] });
@@ -509,18 +512,17 @@ function AppInfo() {
509
512
 
510
513
  // src/ConnectWallet.tsx
511
514
  import { twMerge as twMerge5 } from "tailwind-merge";
512
- import { useEffect as useEffect3, useState as useState2 } from "react";
515
+ import { useEffect as useEffect3, useRef as useRef2 } from "react";
513
516
  import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
514
517
  function ConnectWallet() {
515
- const userAccount = useAccount();
516
- const { openConnectModal, connectModalOpen } = useConnectModal();
517
- const [hasAutoOpened, setHasAutoOpened] = useState2(false);
518
+ const { open, setOpen } = useModal();
519
+ const hasAutoOpenedRef = useRef2(false);
518
520
  useEffect3(() => {
519
- if (!connectModalOpen && !hasAutoOpened) {
520
- openConnectModal?.();
521
- setHasAutoOpened(true);
521
+ if (!open && !hasAutoOpenedRef.current) {
522
+ setOpen(true);
523
+ hasAutoOpenedRef.current = true;
522
524
  }
523
- }, [connectModalOpen, hasAutoOpened, openConnectModal]);
525
+ }, [open, setOpen]);
524
526
  return /* @__PURE__ */ jsxs7(
525
527
  "div",
526
528
  {
@@ -532,8 +534,7 @@ function ConnectWallet() {
532
534
  {
533
535
  variant: "secondary",
534
536
  className: "self-auto flex justify-center",
535
- disabled: userAccount.status === "connecting",
536
- onClick: openConnectModal,
537
+ onClick: () => setOpen(true),
537
538
  autoFocus: true,
538
539
  children: "Connect wallet"
539
540
  },
@@ -545,16 +546,39 @@ function ConnectWallet() {
545
546
  }
546
547
 
547
548
  // src/onboarding/ConnectedSteps.tsx
548
- import { useEffect as useEffect8, useMemo as useMemo2, useRef as useRef2, useState as useState3 } from "react";
549
- import { twMerge as twMerge7 } from "tailwind-merge";
549
+ import { useEffect as useEffect15, useMemo as useMemo4, useRef as useRef5, useState as useState5 } from "react";
550
+ import { twMerge as twMerge18 } from "tailwind-merge";
550
551
 
551
- // src/onboarding/common.ts
552
- import { parseEther as parseEther2 } from "viem";
553
- var minGasBalance = parseEther2("0.01");
552
+ // src/onboarding/usePrerequisites.ts
553
+ import { useClient as useClient6, useConfig } from "wagmi";
554
+ import { getBalanceQueryOptions as getBalanceQueryOptions2 } from "wagmi/query";
555
+ import { queryOptions as queryOptions6, skipToken as skipToken6, useQuery as useQuery7, useQueryClient } from "@tanstack/react-query";
556
+
557
+ // src/getPaymaster.ts
558
+ function getPaymaster(chain) {
559
+ const contracts = chain.contracts ?? {};
560
+ if ("quarryPaymaster" in contracts && contracts.quarryPaymaster != null) {
561
+ if ("address" in contracts.quarryPaymaster) {
562
+ return {
563
+ type: "quarry",
564
+ address: contracts.quarryPaymaster.address,
565
+ isGasPass: !!chain.rpcUrls.quarryPassIssuer?.http?.[0]
566
+ };
567
+ }
568
+ }
569
+ if ("paymaster" in contracts && contracts.paymaster != null) {
570
+ if ("address" in contracts.paymaster) {
571
+ return {
572
+ type: "simple",
573
+ address: contracts.paymaster.address
574
+ };
575
+ }
576
+ }
577
+ }
554
578
 
555
579
  // src/onboarding/quarry/useAllowance.ts
556
580
  import { useClient } from "wagmi";
557
- import { queryOptions, useQuery as useQuery2 } from "@tanstack/react-query";
581
+ import { queryOptions, skipToken, useQuery as useQuery2 } from "@tanstack/react-query";
558
582
 
559
583
  // src/quarry/getAllowance.ts
560
584
  import { numberToHex as numberToHex2 } from "viem";
@@ -565,7 +589,11 @@ import { parseAbi } from "viem";
565
589
  var paymasterAbi = parseAbi([
566
590
  "error SpenderSystem_AlreadyRegistered(address spender, address user)",
567
591
  "error SpenderSystem_HasOwnBalance(address spender)",
568
- "function registerSpender(address spender)"
592
+ "error BalanceSystem_BalanceTooHigh(address user, uint256 balance, uint256 max)",
593
+ "error BalanceSystem_InsufficientBalance(address user, uint256 amount, uint256 balance)",
594
+ "function registerSpender(address spender)",
595
+ "function depositTo(address to) payable",
596
+ "function withdrawTo(address to, uint256 amount)"
569
597
  ]);
570
598
  var paymasterConfig = defineStore({
571
599
  namespaces: {
@@ -579,6 +607,13 @@ var paymasterConfig = defineStore({
579
607
  },
580
608
  key: ["user"]
581
609
  },
610
+ Balance: {
611
+ schema: {
612
+ user: "address",
613
+ balance: "uint256"
614
+ },
615
+ key: ["user"]
616
+ },
582
617
  Grantor: {
583
618
  schema: {
584
619
  grantor: "address",
@@ -628,29 +663,6 @@ var paymasterTables = paymasterConfig.namespaces.root.tables;
628
663
  import { getRecord, getStaticDataLocation } from "@latticexyz/store/internal";
629
664
  import { getKeyTuple } from "@latticexyz/protocol-parser/internal";
630
665
  import { setStorageAt } from "viem/actions";
631
-
632
- // src/getPaymaster.ts
633
- function getPaymaster(chain) {
634
- const contracts = chain.contracts ?? {};
635
- if ("quarryPaymaster" in contracts && contracts.quarryPaymaster != null) {
636
- if ("address" in contracts.quarryPaymaster) {
637
- return {
638
- type: "quarry",
639
- address: contracts.quarryPaymaster.address
640
- };
641
- }
642
- }
643
- if ("paymaster" in contracts && contracts.paymaster != null) {
644
- if ("address" in contracts.paymaster) {
645
- return {
646
- type: "simple",
647
- address: contracts.paymaster.address
648
- };
649
- }
650
- }
651
- }
652
-
653
- // src/quarry/getAllowance.ts
654
666
  async function getAllowance({ client, userAddress }) {
655
667
  const paymaster = getPaymaster(client.chain);
656
668
  if (paymaster?.type !== "quarry") return null;
@@ -684,13 +696,10 @@ function getAllowanceQueryOptions({
684
696
  client,
685
697
  userAddress
686
698
  }) {
687
- const queryKey = ["getAllowance", client?.uid, userAddress];
688
- return queryOptions(
689
- client && userAddress ? {
690
- queryKey,
691
- queryFn: () => getAllowance({ client, userAddress })
692
- } : { queryKey, enabled: false }
693
- );
699
+ return queryOptions({
700
+ queryKey: ["getAllowance", client?.uid, userAddress],
701
+ queryFn: client && userAddress ? () => getAllowance({ client, userAddress }) : skipToken
702
+ });
694
703
  }
695
704
  function useAllowance(userAddress) {
696
705
  const { chainId } = useEntryKitConfig();
@@ -700,7 +709,7 @@ function useAllowance(userAddress) {
700
709
 
701
710
  // src/onboarding/quarry/useSpender.ts
702
711
  import { useClient as useClient2 } from "wagmi";
703
- import { queryOptions as queryOptions2, useQuery as useQuery3 } from "@tanstack/react-query";
712
+ import { queryOptions as queryOptions2, skipToken as skipToken2, useQuery as useQuery3 } from "@tanstack/react-query";
704
713
 
705
714
  // src/onboarding/quarry/getSpender.ts
706
715
  import { getRecord as getRecord2 } from "@latticexyz/store/internal";
@@ -722,18 +731,15 @@ function getSpenderQueryOptions({
722
731
  userAddress,
723
732
  sessionAddress
724
733
  }) {
725
- const queryKey = ["getSpender", client?.uid, userAddress, sessionAddress];
726
- return queryOptions2(
727
- client && userAddress && sessionAddress ? {
728
- queryKey,
729
- queryFn: () => getSpender({ client, userAddress, sessionAddress })
730
- } : { queryKey, enabled: false }
731
- );
734
+ return queryOptions2({
735
+ queryKey: ["getSpender", client?.uid, userAddress, sessionAddress],
736
+ queryFn: client && userAddress && sessionAddress ? () => getSpender({ client, userAddress, sessionAddress }) : skipToken2
737
+ });
732
738
  }
733
739
 
734
740
  // src/onboarding/useDelegation.ts
735
741
  import { useClient as useClient3 } from "wagmi";
736
- import { queryOptions as queryOptions3, useQuery as useQuery4 } from "@tanstack/react-query";
742
+ import { queryOptions as queryOptions3, skipToken as skipToken3, useQuery as useQuery4 } from "@tanstack/react-query";
737
743
 
738
744
  // src/onboarding/getDelegation.ts
739
745
  import { getRecord as getRecord3 } from "@latticexyz/store/internal";
@@ -776,22 +782,15 @@ function getDelegationQueryOptions({
776
782
  userAddress,
777
783
  sessionAddress
778
784
  }) {
779
- const queryKey = ["getDelegation", client?.uid, worldAddress, userAddress, sessionAddress];
780
- return queryOptions3(
781
- client && userAddress && sessionAddress ? {
782
- queryKey,
783
- queryFn: () => getDelegation({ client, worldAddress, userAddress, sessionAddress })
784
- } : { queryKey, enabled: false }
785
- );
785
+ return queryOptions3({
786
+ queryKey: ["getDelegation", client?.uid, worldAddress, userAddress, sessionAddress],
787
+ queryFn: client && userAddress && sessionAddress ? () => getDelegation({ client, worldAddress, userAddress, sessionAddress }) : skipToken3
788
+ });
786
789
  }
787
790
 
788
- // src/onboarding/usePrerequisites.ts
789
- import { queryOptions as queryOptions5, useQuery as useQuery6, useQueryClient } from "@tanstack/react-query";
790
- import { useClient as useClient5, useConfig } from "wagmi";
791
-
792
791
  // src/useSessionAccount.ts
793
792
  import { useClient as useClient4 } from "wagmi";
794
- import { queryOptions as queryOptions4, useQuery as useQuery5 } from "@tanstack/react-query";
793
+ import { queryOptions as queryOptions4, skipToken as skipToken4, useQuery as useQuery5 } from "@tanstack/react-query";
795
794
 
796
795
  // src/getSessionAccount.ts
797
796
  import { toSimpleSmartAccount } from "permissionless/accounts";
@@ -855,20 +854,50 @@ function getSessionAccountQueryOptions({
855
854
  client,
856
855
  userAddress
857
856
  }) {
858
- const queryKey = ["getSessionAccount", client?.uid, userAddress];
859
- return queryOptions4(
860
- client && userAddress ? {
861
- queryKey,
862
- queryFn: () => getSessionAccount({ client, userAddress }),
863
- staleTime: Infinity,
864
- // TODO: replace with function to retry only connection errors
865
- retry: false
866
- } : { queryKey, enabled: false }
867
- );
857
+ return queryOptions4({
858
+ queryKey: ["getSessionAccount", client?.uid, userAddress],
859
+ queryFn: client && userAddress ? () => getSessionAccount({ client, userAddress }) : skipToken4,
860
+ staleTime: Infinity,
861
+ // TODO: replace with function to retry only connection errors
862
+ retry: false
863
+ });
864
+ }
865
+
866
+ // src/onboarding/quarry/useBalance.ts
867
+ import { useClient as useClient5 } from "wagmi";
868
+ import { queryOptions as queryOptions5, skipToken as skipToken5, useQuery as useQuery6 } from "@tanstack/react-query";
869
+
870
+ // src/quarry/getBalance.ts
871
+ import { getRecord as getRecord4 } from "@latticexyz/store/internal";
872
+ async function getBalance({ client, userAddress }) {
873
+ const paymaster = getPaymaster(client.chain);
874
+ if (paymaster?.type !== "quarry") return null;
875
+ const record = await getRecord4(client, {
876
+ address: paymaster.address,
877
+ table: paymasterTables.Balance,
878
+ key: { user: userAddress },
879
+ blockTag: "pending"
880
+ });
881
+ return record.balance;
882
+ }
883
+
884
+ // src/onboarding/quarry/useBalance.ts
885
+ function getBalanceQueryOptions({
886
+ client,
887
+ userAddress
888
+ }) {
889
+ return queryOptions5({
890
+ queryKey: ["getBalance", client?.uid, userAddress],
891
+ queryFn: client && userAddress ? () => getBalance({ client, userAddress }) : skipToken5
892
+ });
893
+ }
894
+ function useBalance(userAddress) {
895
+ const { chainId } = useEntryKitConfig();
896
+ const client = useClient5({ chainId });
897
+ return useQuery6(getBalanceQueryOptions({ client, userAddress }));
868
898
  }
869
899
 
870
900
  // src/onboarding/usePrerequisites.ts
871
- import { getBalanceQueryOptions } from "wagmi/query";
872
901
  function getPrequisitesQueryOptions({
873
902
  queryClient,
874
903
  config,
@@ -876,46 +905,46 @@ function getPrequisitesQueryOptions({
876
905
  userAddress,
877
906
  worldAddress
878
907
  }) {
879
- const queryKey = ["getPrerequisites", client?.uid, userAddress];
880
- return queryOptions5(
881
- client && userAddress ? {
882
- queryKey,
883
- async queryFn() {
884
- const paymaster = getPaymaster(client.chain);
885
- const {
886
- account: { address: sessionAddress }
887
- } = await queryClient.fetchQuery(getSessionAccountQueryOptions({ client, userAddress }));
888
- const [sessionBalance, allowance, spender, hasDelegation] = await Promise.all([
889
- !paymaster ? queryClient.fetchQuery(
890
- getBalanceQueryOptions(config, { chainId: client.chain.id, address: sessionAddress })
891
- ) : null,
892
- paymaster?.type === "quarry" ? queryClient.fetchQuery(getAllowanceQueryOptions({ client, userAddress })) : null,
893
- paymaster?.type === "quarry" ? queryClient.fetchQuery(getSpenderQueryOptions({ client, userAddress, sessionAddress })) : null,
894
- queryClient.fetchQuery(getDelegationQueryOptions({ client, worldAddress, userAddress, sessionAddress }))
895
- ]);
896
- const hasAllowance = allowance == null || allowance >= minGasBalance;
897
- const isSpender = spender == null ? true : spender;
898
- const hasGasBalance = sessionBalance == null || sessionBalance.value >= minGasBalance;
899
- return {
900
- sessionAddress,
901
- hasAllowance,
902
- isSpender,
903
- hasGasBalance,
904
- hasDelegation,
905
- // we intentionally don't enforce an allowance/gas balance here
906
- complete: isSpender && hasDelegation
907
- };
908
- },
909
- retry: false
910
- } : { queryKey, enabled: false }
911
- );
908
+ return queryOptions6({
909
+ queryKey: ["getPrerequisites", client?.uid, userAddress],
910
+ queryFn: client && userAddress ? async () => {
911
+ const paymaster = getPaymaster(client.chain);
912
+ const {
913
+ account: { address: sessionAddress }
914
+ } = await queryClient.fetchQuery(getSessionAccountQueryOptions({ client, userAddress }));
915
+ const [sessionBalance, allowance, spender, quarryBalance, hasDelegation] = await Promise.all([
916
+ !paymaster ? queryClient.fetchQuery(
917
+ getBalanceQueryOptions2(config, { chainId: client.chain.id, address: sessionAddress })
918
+ ) : null,
919
+ paymaster?.type === "quarry" ? queryClient.fetchQuery(getAllowanceQueryOptions({ client, userAddress })) : null,
920
+ paymaster?.type === "quarry" ? queryClient.fetchQuery(getSpenderQueryOptions({ client, userAddress, sessionAddress })) : null,
921
+ paymaster?.type === "quarry" ? queryClient.fetchQuery(getBalanceQueryOptions({ client, userAddress })) : null,
922
+ queryClient.fetchQuery(getDelegationQueryOptions({ client, worldAddress, userAddress, sessionAddress }))
923
+ ]);
924
+ const hasAllowance = allowance == null || allowance > 0n;
925
+ const isSpender = spender == null ? true : spender;
926
+ const hasGasBalance = sessionBalance == null || sessionBalance.value > 0n;
927
+ const hasQuarryGasBalance = quarryBalance == null || quarryBalance > 0n;
928
+ return {
929
+ sessionAddress,
930
+ hasAllowance,
931
+ isSpender,
932
+ hasGasBalance,
933
+ hasQuarryGasBalance,
934
+ hasDelegation,
935
+ // we intentionally don't enforce an allowance/gas balance here
936
+ complete: isSpender && hasDelegation
937
+ };
938
+ } : skipToken6,
939
+ retry: false
940
+ });
912
941
  }
913
942
  function usePrerequisites(userAddress) {
914
943
  const queryClient = useQueryClient();
915
944
  const config = useConfig();
916
945
  const { chainId, worldAddress } = useEntryKitConfig();
917
- const client = useClient5({ chainId });
918
- const prereqs = useQuery6(
946
+ const client = useClient6({ chainId });
947
+ const prereqs = useQuery7(
919
948
  getPrequisitesQueryOptions({
920
949
  queryClient,
921
950
  config,
@@ -932,10 +961,10 @@ function usePrerequisites(userAddress) {
932
961
  import { useDisconnect } from "wagmi";
933
962
 
934
963
  // src/useENS.ts
935
- import { useQuery as useQuery7 } from "@tanstack/react-query";
964
+ import { useQuery as useQuery8 } from "@tanstack/react-query";
936
965
  function useENS(address) {
937
966
  const normalizedAddress = address?.toLowerCase();
938
- return useQuery7({
967
+ return useQuery8({
939
968
  enabled: !!normalizedAddress,
940
969
  queryKey: ["ens", normalizedAddress],
941
970
  queryFn: async () => {
@@ -1054,8 +1083,11 @@ function Wallet({ isActive, isExpanded, userAddress }) {
1054
1083
  ] });
1055
1084
  }
1056
1085
 
1057
- // src/onboarding/quarry/useClaimGasPass.ts
1086
+ // src/onboarding/quarry/Allowance.tsx
1058
1087
  import { parseEther as parseEther3 } from "viem";
1088
+
1089
+ // src/onboarding/quarry/useClaimGasPass.ts
1090
+ import { parseEther as parseEther2 } from "viem";
1059
1091
  import { useMutation, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
1060
1092
 
1061
1093
  // src/quarry/transports/quarryPassIssuer.ts
@@ -1085,11 +1117,11 @@ async function claimGasPass({ chain, userAddress }) {
1085
1117
  }
1086
1118
 
1087
1119
  // src/onboarding/quarry/useClaimGasPass.ts
1088
- import { useClient as useClient6 } from "wagmi";
1120
+ import { useClient as useClient7 } from "wagmi";
1089
1121
  function useClaimGasPass() {
1090
1122
  const queryClient = useQueryClient2();
1091
1123
  const { chain } = useEntryKitConfig();
1092
- const client = useClient6({ chainId: chain.id });
1124
+ const client = useClient7({ chainId: chain.id });
1093
1125
  const mutationKey = ["claimGasPass", chain.id];
1094
1126
  return useMutation({
1095
1127
  retry: 0,
@@ -1097,7 +1129,7 @@ function useClaimGasPass() {
1097
1129
  mutationFn: async (userAddress) => {
1098
1130
  if (chain.id === 31337) {
1099
1131
  if (!client) throw new Error("No client?");
1100
- await setAllowanceSlot({ client, userAddress, allowance: parseEther3("1") });
1132
+ await setAllowanceSlot({ client, userAddress, allowance: parseEther2("1") });
1101
1133
  } else {
1102
1134
  await claimGasPass({ chain, userAddress });
1103
1135
  }
@@ -1135,8 +1167,12 @@ function EthIcon({ className, ...props }) {
1135
1167
  import { formatEther } from "viem";
1136
1168
  function formatBalance(wei) {
1137
1169
  const formatted = formatEther(wei);
1138
- const magnitude = Math.floor(parseFloat(formatted)).toString().length;
1139
- return parseFloat(formatted).toLocaleString("en-US", { maximumFractionDigits: Math.max(0, 6 - magnitude) });
1170
+ const parsed = parseFloat(formatted);
1171
+ if (parsed > 0 && parsed < 1e-5) {
1172
+ return "<0.00001";
1173
+ }
1174
+ const magnitude = Math.floor(parsed).toString().length;
1175
+ return parsed.toLocaleString("en-US", { maximumFractionDigits: Math.max(0, 6 - magnitude) });
1140
1176
  }
1141
1177
 
1142
1178
  // src/ui/Balance.tsx
@@ -1172,7 +1208,7 @@ function Allowance({ isActive, isExpanded, userAddress }) {
1172
1208
  const claimGasPass2 = useShowMutationError(useClaimGasPass());
1173
1209
  useEffect6(() => {
1174
1210
  const timer = setTimeout(() => {
1175
- if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data < minGasBalance) {
1211
+ if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data < parseEther3("0.01")) {
1176
1212
  claimGasPass2.mutate(userAddress);
1177
1213
  }
1178
1214
  });
@@ -1200,6 +1236,9 @@ function Allowance({ isActive, isExpanded, userAddress }) {
1200
1236
  ] });
1201
1237
  }
1202
1238
 
1239
+ // src/onboarding/Session.tsx
1240
+ import { useEffect as useEffect7 } from "react";
1241
+
1203
1242
  // src/onboarding/useSetupSession.ts
1204
1243
  import { encodeFunctionData } from "viem";
1205
1244
  import { useMutation as useMutation2, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
@@ -1213,11 +1252,12 @@ function defineCall(call) {
1213
1252
  }
1214
1253
 
1215
1254
  // src/onboarding/useSetupSession.ts
1216
- import { useClient as useClient7 } from "wagmi";
1255
+ import { useClient as useClient8 } from "wagmi";
1217
1256
  import { resourceToHex as resourceToHex2 } from "@latticexyz/common";
1218
1257
  import IBaseWorldAbi from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json";
1219
1258
 
1220
1259
  // src/utils/callWithSignature.ts
1260
+ import { parseErc6492Signature } from "viem";
1221
1261
  import { writeContract as viem_writeContract } from "viem/actions";
1222
1262
  import { getAction as getAction3 } from "viem/utils";
1223
1263
 
@@ -1225,7 +1265,7 @@ import { getAction as getAction3 } from "viem/utils";
1225
1265
  import { toHex } from "viem";
1226
1266
  import { signTypedData } from "viem/actions";
1227
1267
  import { callWithSignatureTypes } from "@latticexyz/world-module-callwithsignature/internal";
1228
- import { getRecord as getRecord4 } from "@latticexyz/store/internal";
1268
+ import { getRecord as getRecord5 } from "@latticexyz/store/internal";
1229
1269
  import moduleConfig from "@latticexyz/world-module-callwithsignature/mud.config";
1230
1270
  import { hexToResource } from "@latticexyz/common";
1231
1271
  import { getAction as getAction2 } from "viem/utils";
@@ -1237,7 +1277,7 @@ async function signCall({
1237
1277
  nonce: initialNonce,
1238
1278
  client
1239
1279
  }) {
1240
- const nonce = initialNonce ?? (client ? (await getRecord4(client, {
1280
+ const nonce = initialNonce ?? (client ? (await getRecord5(client, {
1241
1281
  address: worldAddress,
1242
1282
  table: moduleConfig.tables.CallWithSignatureNonces,
1243
1283
  key: { signer: userClient.account.address },
@@ -1272,7 +1312,13 @@ async function callWithSignature({
1272
1312
  sessionClient,
1273
1313
  ...opts
1274
1314
  }) {
1275
- const signature = await signCall(opts);
1315
+ const rawSignature = await signCall(opts);
1316
+ const { address, signature } = parseErc6492Signature(rawSignature);
1317
+ if (address != null) {
1318
+ throw new Error(
1319
+ "ERC-6492 signatures, like from Coinbase Smart Wallet, are not yet supported. Try using a different wallet?"
1320
+ );
1321
+ }
1276
1322
  return getAction3(
1277
1323
  sessionClient,
1278
1324
  viem_writeContract,
@@ -1290,7 +1336,7 @@ import { systemsConfig as worldSystemsConfig } from "@latticexyz/world/mud.confi
1290
1336
  function useSetupSession({ userClient }) {
1291
1337
  const queryClient = useQueryClient3();
1292
1338
  const { chainId, worldAddress } = useEntryKitConfig();
1293
- const client = useClient7({ chainId });
1339
+ const client = useClient8({ chainId });
1294
1340
  const mutationKey = ["setupSession", client?.chain.id, userClient.account.address];
1295
1341
  return useMutation2({
1296
1342
  retry: 0,
@@ -1396,20 +1442,18 @@ function useSetupSession({ userClient }) {
1396
1442
  });
1397
1443
  }
1398
1444
 
1399
- // src/onboarding/Session.tsx
1400
- import { useEffect as useEffect7 } from "react";
1401
-
1402
1445
  // src/useSessionClient.ts
1403
- import { useClient as useClient8 } from "wagmi";
1446
+ import { useClient as useClient9 } from "wagmi";
1404
1447
  import {
1405
- queryOptions as queryOptions6,
1406
- useQuery as useQuery8,
1448
+ queryOptions as queryOptions7,
1449
+ skipToken as skipToken7,
1450
+ useQuery as useQuery9,
1407
1451
  useQueryClient as useQueryClient4
1408
1452
  } from "@tanstack/react-query";
1409
1453
 
1410
1454
  // src/getSessionClient.ts
1411
1455
  import { smartAccountActions } from "permissionless";
1412
- import { callFrom } from "@latticexyz/world/internal";
1456
+ import { callFrom, sendUserOperationFrom } from "@latticexyz/world/internal";
1413
1457
 
1414
1458
  // src/createBundlerClient.ts
1415
1459
  import {
@@ -1468,6 +1512,12 @@ async function getSessionClient({
1468
1512
  delegatorAddress: userAddress,
1469
1513
  publicClient: client
1470
1514
  })
1515
+ ).extend(
1516
+ sendUserOperationFrom({
1517
+ worldAddress,
1518
+ delegatorAddress: userAddress,
1519
+ publicClient: client
1520
+ })
1471
1521
  ).extend(() => ({ userAddress, worldAddress, internal_signer: sessionSigner }));
1472
1522
  return sessionClient;
1473
1523
  }
@@ -1482,32 +1532,29 @@ function getSessionClientQueryOptions({
1482
1532
  userAddress,
1483
1533
  worldAddress
1484
1534
  }) {
1485
- const queryKey = ["getSessionClient", client?.uid, userAddress, worldAddress];
1486
- return queryOptions6(
1487
- userAddress ? {
1488
- queryKey,
1489
- async queryFn() {
1490
- const { account: sessionAccount, signer: sessionSigner } = await queryClient.fetchQuery(
1491
- getSessionAccountQueryOptions({ client, userAddress })
1492
- );
1493
- return await getSessionClient({
1494
- sessionAccount,
1495
- sessionSigner,
1496
- userAddress,
1497
- worldAddress
1498
- });
1499
- },
1500
- staleTime: Infinity,
1501
- // TODO: replace with function to retry only connection errors
1502
- retry: false
1503
- } : { queryKey, enabled: false }
1504
- );
1535
+ return queryOptions7({
1536
+ queryKey: ["getSessionClient", client?.uid, userAddress, worldAddress],
1537
+ queryFn: userAddress ? async () => {
1538
+ const { account: sessionAccount, signer: sessionSigner } = await queryClient.fetchQuery(
1539
+ getSessionAccountQueryOptions({ client, userAddress })
1540
+ );
1541
+ return await getSessionClient({
1542
+ sessionAccount,
1543
+ sessionSigner,
1544
+ userAddress,
1545
+ worldAddress
1546
+ });
1547
+ } : skipToken7,
1548
+ staleTime: Infinity,
1549
+ // TODO: replace with function to retry only connection errors
1550
+ retry: false
1551
+ });
1505
1552
  }
1506
1553
  function useSessionClient(userAddress) {
1507
1554
  const queryClient = useQueryClient4();
1508
1555
  const { chainId, worldAddress } = useEntryKitConfig();
1509
- const client = useClient8({ chainId });
1510
- return useQuery8(
1556
+ const client = useClient9({ chainId });
1557
+ return useQuery9(
1511
1558
  getSessionClientQueryOptions({
1512
1559
  queryClient,
1513
1560
  client,
@@ -1523,9 +1570,11 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
1523
1570
  const sessionClient = useShowQueryError(useSessionClient(userClient.account.address));
1524
1571
  const setup = useShowMutationError(useSetupSession({ userClient }));
1525
1572
  const hasSession = !registerDelegation && !registerDelegation;
1573
+ const { data: prerequisites } = usePrerequisites(userClient.account.address);
1574
+ const { hasAllowance, hasGasBalance, hasQuarryGasBalance } = prerequisites ?? {};
1526
1575
  useEffect7(() => {
1527
1576
  const timer = setTimeout(() => {
1528
- if (isActive && setup.status === "idle" && sessionClient.data && !hasSession) {
1577
+ if (isActive && setup.status === "idle" && sessionClient.data && !hasSession && (hasAllowance || hasGasBalance || hasQuarryGasBalance)) {
1529
1578
  setup.mutate({
1530
1579
  sessionClient: sessionClient.data,
1531
1580
  registerSpender,
@@ -1534,7 +1583,17 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
1534
1583
  }
1535
1584
  });
1536
1585
  return () => clearTimeout(timer);
1537
- }, [hasSession, isActive, registerDelegation, registerSpender, sessionClient, setup]);
1586
+ }, [
1587
+ hasSession,
1588
+ isActive,
1589
+ registerDelegation,
1590
+ registerSpender,
1591
+ sessionClient,
1592
+ setup,
1593
+ hasAllowance,
1594
+ hasGasBalance,
1595
+ hasQuarryGasBalance
1596
+ ]);
1538
1597
  return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-4", children: [
1539
1598
  /* @__PURE__ */ jsxs13("div", { className: "flex justify-between gap-4", children: [
1540
1599
  /* @__PURE__ */ jsxs13("div", { children: [
@@ -1562,7 +1621,10 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
1562
1621
  }
1563
1622
 
1564
1623
  // src/onboarding/GasBalance.tsx
1565
- import { useBalance, useWatchBlockNumber } from "wagmi";
1624
+ import { useEffect as useEffect9, useState as useState2 } from "react";
1625
+ import { parseEther as parseEther4 } from "viem";
1626
+ import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
1627
+ import { useBalance as useBalance2, useWatchBlockNumber } from "wagmi";
1566
1628
 
1567
1629
  // src/data/relayChains.json
1568
1630
  var relayChains_default = {
@@ -1847,11 +1909,11 @@ var relayChains_default = {
1847
1909
  // src/onboarding/useSetBalance.ts
1848
1910
  import { useQueryClient as useQueryClient5, useMutation as useMutation3 } from "@tanstack/react-query";
1849
1911
  import { setBalance as setBalance2 } from "viem/actions";
1850
- import { useClient as useClient9 } from "wagmi";
1912
+ import { useClient as useClient10 } from "wagmi";
1851
1913
  function useSetBalance() {
1852
1914
  const queryClient = useQueryClient5();
1853
1915
  const { chainId } = useEntryKitConfig();
1854
- const client = useClient9({ chainId });
1916
+ const client = useClient10({ chainId });
1855
1917
  return useMutation3({
1856
1918
  retry: 0,
1857
1919
  mutationKey: ["setBalance", chainId],
@@ -1867,21 +1929,93 @@ function useSetBalance() {
1867
1929
  });
1868
1930
  }
1869
1931
 
1932
+ // src/errors/usePrevious.ts
1933
+ import { useEffect as useEffect8, useRef as useRef3 } from "react";
1934
+ function usePrevious(value, initialValue) {
1935
+ const ref = useRef3();
1936
+ useEffect8(() => {
1937
+ ref.current = { value };
1938
+ }, [value]);
1939
+ return ref.current ? ref.current.value : initialValue;
1940
+ }
1941
+
1942
+ // src/icons/IconSVG.tsx
1943
+ import { twMerge as twMerge7 } from "tailwind-merge";
1944
+ import { jsx as jsx16 } from "react/jsx-runtime";
1945
+ function IconSVG({ className, children, ...props }) {
1946
+ return /* @__PURE__ */ jsx16(
1947
+ "svg",
1948
+ {
1949
+ xmlns: "http://www.w3.org/2000/svg",
1950
+ viewBox: "0 0 24 24",
1951
+ fill: "currentColor",
1952
+ className: twMerge7("-my-[0.125em] h-[1.25em] w-[1.25em]", className),
1953
+ ...props,
1954
+ children
1955
+ }
1956
+ );
1957
+ }
1958
+
1959
+ // src/icons/CopyIcon.tsx
1960
+ import { jsx as jsx17 } from "react/jsx-runtime";
1961
+ function CopyIcon(props) {
1962
+ return /* @__PURE__ */ jsx17(IconSVG, { ...props, children: /* @__PURE__ */ jsx17(
1963
+ "path",
1964
+ {
1965
+ d: "M8 5H6C4.89543 5 4 5.89543 4 7V19C4 20.1046 4.89543 21 6 21H16C17.1046 21 18 20.1046 18 19V18M8 5C8 6.10457 8.89543 7 10 7H12C13.1046 7 14 6.10457 14 5M8 5C8 3.89543 8.89543 3 10 3H12C13.1046 3 14 3.89543 14 5M14 5H16C17.1046 5 18 5.89543 18 7V10M20 14H10M10 14L13 11M10 14L13 17",
1966
+ fill: "none",
1967
+ stroke: "currentColor",
1968
+ strokeWidth: "2",
1969
+ strokeLinecap: "round",
1970
+ strokeLinejoin: "round"
1971
+ }
1972
+ ) });
1973
+ }
1974
+
1975
+ // src/icons/CheckIcon.tsx
1976
+ import { jsx as jsx18 } from "react/jsx-runtime";
1977
+ function CheckIcon(props) {
1978
+ return /* @__PURE__ */ jsx18(IconSVG, { ...props, children: /* @__PURE__ */ jsx18(
1979
+ "path",
1980
+ {
1981
+ d: "M5 13L9 17L19 7",
1982
+ fill: "none",
1983
+ stroke: "currentColor",
1984
+ strokeWidth: "2",
1985
+ strokeLinecap: "round",
1986
+ strokeLinejoin: "round"
1987
+ }
1988
+ ) });
1989
+ }
1990
+
1870
1991
  // src/onboarding/GasBalance.tsx
1871
- import { Fragment, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
1992
+ import { Fragment, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
1872
1993
  function GasBalance({ isActive, isExpanded, sessionAddress }) {
1994
+ const queryClient = useQueryClient6();
1873
1995
  const { chain } = useEntryKitConfig();
1874
- const balance = useShowQueryError(useBalance({ chainId: chain.id, address: sessionAddress }));
1996
+ const [copied, setCopied] = useState2(false);
1997
+ const balance = useShowQueryError(useBalance2({ chainId: chain.id, address: sessionAddress }));
1998
+ const prevBalance = usePrevious(balance.data);
1875
1999
  useWatchBlockNumber({ onBlockNumber: () => balance.refetch() });
1876
2000
  const setBalance3 = useShowMutationError(useSetBalance());
1877
2001
  const relayChain = relayChains_default[chain.id];
2002
+ const handleCopy = () => {
2003
+ navigator.clipboard.writeText(sessionAddress);
2004
+ setCopied(true);
2005
+ setTimeout(() => setCopied(false), 2e3);
2006
+ };
2007
+ useEffect9(() => {
2008
+ if (balance.data != null && prevBalance?.value === 0n && balance.data.value > 0n) {
2009
+ queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
2010
+ }
2011
+ }, [balance.data, prevBalance, setBalance3, sessionAddress, queryClient]);
1878
2012
  return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-4", children: [
1879
2013
  /* @__PURE__ */ jsxs14("div", { className: "flex justify-between gap-4", children: [
1880
2014
  /* @__PURE__ */ jsxs14("div", { children: [
1881
- /* @__PURE__ */ jsx16("div", { children: "Gas balance" }),
1882
- /* @__PURE__ */ jsx16("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx16(Balance, { wei: balance.data.value }) : /* @__PURE__ */ jsx16(PendingIcon, { className: "text-sm" }) })
2015
+ /* @__PURE__ */ jsx19("div", { children: "Gas balance" }),
2016
+ /* @__PURE__ */ jsx19("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx19(Balance, { wei: balance.data.value }) : /* @__PURE__ */ jsx19(PendingIcon, { className: "text-sm" }) })
1883
2017
  ] }),
1884
- chain.id === 31337 ? /* @__PURE__ */ jsx16(
2018
+ chain.id === 31337 ? /* @__PURE__ */ jsx19(
1885
2019
  Button,
1886
2020
  {
1887
2021
  variant: isActive ? "primary" : "tertiary",
@@ -1890,19 +2024,19 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
1890
2024
  pending: balance.status === "pending" || setBalance3.status === "pending",
1891
2025
  onClick: () => setBalance3.mutate({
1892
2026
  address: sessionAddress,
1893
- value: minGasBalance + (balance.data?.value ?? 0n)
2027
+ value: parseEther4("0.01") + (balance.data?.value ?? 0n)
1894
2028
  }),
1895
2029
  children: "Top up"
1896
2030
  }
1897
2031
  ) : relayChain != null ? (
1898
2032
  // TODO: convert this to a <ButtonLink>
1899
- /* @__PURE__ */ jsx16(
2033
+ /* @__PURE__ */ jsx19(
1900
2034
  "a",
1901
2035
  {
1902
- href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress })}`,
2036
+ href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress, amount: "0.01" })}`,
1903
2037
  target: "_blank",
1904
2038
  rel: "noopener noreferrer",
1905
- children: /* @__PURE__ */ jsx16(
2039
+ children: /* @__PURE__ */ jsx19(
1906
2040
  Button,
1907
2041
  {
1908
2042
  variant: isActive ? "primary" : "tertiary",
@@ -1917,11 +2051,23 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
1917
2051
  ) : null
1918
2052
  ] }),
1919
2053
  isExpanded ? /* @__PURE__ */ jsxs14(Fragment, { children: [
1920
- /* @__PURE__ */ jsx16("p", { className: "text-sm", children: "Your session's gas balance is used to pay for onchain computation." }),
2054
+ /* @__PURE__ */ jsx19("p", { className: "text-sm", children: "Your session's gas balance is used to pay for onchain computation." }),
1921
2055
  /* @__PURE__ */ jsxs14("p", { className: "text-sm", children: [
1922
2056
  "Send funds to",
1923
2057
  " ",
1924
- /* @__PURE__ */ jsx16("span", { className: "font-mono text-white", children: /* @__PURE__ */ jsx16(TruncatedHex, { hex: sessionAddress }) }),
2058
+ /* @__PURE__ */ jsxs14(
2059
+ "span",
2060
+ {
2061
+ className: "inline-flex items-center gap-1 font-mono text-white cursor-pointer hover:text-white/80 transition-colors",
2062
+ onClick: handleCopy,
2063
+ title: "Click to copy",
2064
+ children: [
2065
+ /* @__PURE__ */ jsx19(TruncatedHex, { hex: sessionAddress }),
2066
+ " ",
2067
+ copied ? /* @__PURE__ */ jsx19(CheckIcon, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsx19(CopyIcon, { className: "w-3.5 h-3.5" })
2068
+ ]
2069
+ }
2070
+ ),
1925
2071
  " ",
1926
2072
  "on ",
1927
2073
  chain.name,
@@ -1931,133 +2077,754 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
1931
2077
  ] });
1932
2078
  }
1933
2079
 
1934
- // src/onboarding/ConnectedSteps.tsx
1935
- import { jsx as jsx17 } from "react/jsx-runtime";
1936
- function ConnectedSteps({ userClient, initialUserAddress }) {
1937
- const { chain } = useEntryKitConfig();
1938
- const paymaster = getPaymaster(chain);
1939
- const userAddress = userClient.account.address;
1940
- const { data: prerequisites, error: prerequisitesError } = usePrerequisites(userAddress);
1941
- useEffect8(() => {
1942
- if (prerequisitesError) {
1943
- console.error("Could not get prerequisites", prerequisitesError);
1944
- }
1945
- }, [prerequisitesError]);
1946
- const { closeAccountModal } = useAccountModal();
1947
- const isNewConnection = userAddress !== initialUserAddress;
1948
- const initialPrerequisites = useRef2(prerequisites);
1949
- useEffect8(() => {
1950
- if (prerequisites == null) return;
1951
- if (initialPrerequisites.current == null) {
1952
- initialPrerequisites.current = prerequisites;
1953
- }
1954
- if (prerequisites.complete) {
1955
- if (isNewConnection || !initialPrerequisites.current.complete) {
1956
- closeAccountModal();
1957
- }
1958
- }
1959
- }, [closeAccountModal, isNewConnection, prerequisites]);
1960
- const { sessionAddress, hasAllowance, isSpender, hasDelegation, hasGasBalance } = prerequisites ?? {};
1961
- const steps = useMemo2(() => {
1962
- if (!userAddress) {
1963
- return [
1964
- {
1965
- id: "wallet",
1966
- isComplete: false,
1967
- content: () => null
1968
- }
1969
- ];
2080
+ // src/onboarding/quarry/GasBalance.tsx
2081
+ import { useEffect as useEffect14 } from "react";
2082
+ import { useQueryClient as useQueryClient9 } from "@tanstack/react-query";
2083
+
2084
+ // src/onboarding/deposit/DepositFormContainer.tsx
2085
+ import { useState as useState4 } from "react";
2086
+ import { useChains as useChains4, useChainId } from "wagmi";
2087
+
2088
+ // src/onboarding/deposit/DepositViaTransferForm.tsx
2089
+ import { useAccount as useAccount4, useWriteContract, usePrepareTransactionRequest, usePublicClient } from "wagmi";
2090
+ import { encodeFunctionData as encodeFunctionData2 } from "viem";
2091
+ import { useMutation as useMutation4, useQuery as useQuery12 } from "@tanstack/react-query";
2092
+
2093
+ // src/onboarding/deposit/DepositForm.tsx
2094
+ import { useEffect as useEffect11, useRef as useRef4 } from "react";
2095
+ import { useAccount as useAccount3, useBalance as useBalance4, useWatchBlockNumber as useWatchBlockNumber2 } from "wagmi";
2096
+ import { useIsMounted } from "usehooks-ts";
2097
+ import { twMerge as twMerge15 } from "tailwind-merge";
2098
+
2099
+ // src/onboarding/deposit/ChainSelect.tsx
2100
+ import { useEffect as useEffect10, useMemo as useMemo2 } from "react";
2101
+ import { useSwitchChain } from "wagmi";
2102
+ import { twMerge as twMerge12 } from "tailwind-merge";
2103
+ import * as Select from "@radix-ui/react-select";
2104
+
2105
+ // src/icons/ChevronUpIcon.tsx
2106
+ import { jsx as jsx20 } from "react/jsx-runtime";
2107
+ function ChevronUpIcon(props) {
2108
+ return /* @__PURE__ */ jsx20(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx20(
2109
+ "path",
2110
+ {
2111
+ d: "M14.7071 12.7071C14.3166 13.0976 13.6834 13.0976 13.2929 12.7071L10 9.41421L6.70711 12.7071C6.31658 13.0976 5.68342 13.0976 5.29289 12.7071C4.90237 12.3166 4.90237 11.6834 5.29289 11.2929L9.29289 7.29289C9.68342 6.90237 10.3166 6.90237 10.7071 7.29289L14.7071 11.2929C15.0976 11.6834 15.0976 12.3166 14.7071 12.7071Z",
2112
+ fillRule: "evenodd",
2113
+ clipRule: "evenodd"
1970
2114
  }
1971
- const steps2 = [
1972
- {
1973
- id: "wallet",
1974
- isComplete: true,
1975
- content: (props) => /* @__PURE__ */ jsx17(Wallet, { ...props, userAddress })
1976
- }
1977
- ];
1978
- if (!paymaster) {
1979
- if (sessionAddress != null) {
1980
- steps2.push({
1981
- id: "gasBalance",
1982
- isComplete: !!hasGasBalance,
1983
- content: (props) => /* @__PURE__ */ jsx17(GasBalance, { ...props, sessionAddress })
1984
- });
1985
- }
1986
- } else if (paymaster.type === "quarry") {
1987
- steps2.push({
1988
- id: "allowance",
1989
- isComplete: !!hasAllowance,
1990
- content: (props) => /* @__PURE__ */ jsx17(Allowance, { ...props, userAddress })
1991
- });
2115
+ ) });
2116
+ }
2117
+
2118
+ // src/icons/ChevronDownIcon.tsx
2119
+ import { jsx as jsx21 } from "react/jsx-runtime";
2120
+ function ChevronDownIcon(props) {
2121
+ return /* @__PURE__ */ jsx21(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx21(
2122
+ "path",
2123
+ {
2124
+ d: "M5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289L10 10.5858L13.2929 7.29289C13.6834 6.90237 14.3166 6.90237 14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L10.7071 12.7071C10.3166 13.0976 9.68342 13.0976 9.29289 12.7071L5.29289 8.70711C4.90237 8.31658 4.90237 7.68342 5.29289 7.29289Z",
2125
+ fillRule: "evenodd",
2126
+ clipRule: "evenodd"
1992
2127
  }
1993
- steps2.push({
1994
- id: "session",
1995
- isComplete: !!isSpender && !!hasDelegation,
1996
- content: (props) => /* @__PURE__ */ jsx17(Session, { ...props, userClient, registerSpender: !isSpender, registerDelegation: !hasDelegation })
2128
+ ) });
2129
+ }
2130
+
2131
+ // src/ui/Slot.tsx
2132
+ import { isValidElement, cloneElement, Children } from "react";
2133
+ import { twMerge as twMerge8 } from "tailwind-merge";
2134
+ function Slot({
2135
+ children,
2136
+ ...props
2137
+ }) {
2138
+ if (isValidElement(children)) {
2139
+ return cloneElement(children, {
2140
+ ...props,
2141
+ ...children.props,
2142
+ style: {
2143
+ ...props.style,
2144
+ ...children.props.style
2145
+ },
2146
+ className: twMerge8(props.className, children.props.className)
1997
2147
  });
1998
- return steps2;
1999
- }, [hasAllowance, hasDelegation, hasGasBalance, isSpender, paymaster, sessionAddress, userAddress, userClient]);
2000
- const [selectedStepId] = useState3(null);
2001
- const nextStep = steps.find((step) => step.content != null && !step.isComplete);
2002
- const completedSteps = steps.filter((step) => step.isComplete);
2003
- const activeStep = (selectedStepId != null ? steps.find((step) => step.id === selectedStepId) : null) ?? nextStep ?? (completedSteps.length < steps.length ? completedSteps.at(-1) : null);
2004
- const activeStepIndex = activeStep ? steps.indexOf(activeStep) : -1;
2005
- return /* @__PURE__ */ jsx17(
2006
- "div",
2148
+ }
2149
+ if (Children.count(children) > 1) {
2150
+ Children.only(null);
2151
+ }
2152
+ return null;
2153
+ }
2154
+
2155
+ // src/ui/Input.tsx
2156
+ import { twMerge as twMerge9 } from "tailwind-merge";
2157
+ import { jsx as jsx22 } from "react/jsx-runtime";
2158
+ function Input({ asChild, className, ...props }) {
2159
+ const Child = asChild ? Slot : "input";
2160
+ return /* @__PURE__ */ jsx22(
2161
+ Child,
2007
2162
  {
2008
- className: twMerge7(
2009
- // steps.length === 2 ? "min-h-[22rem]" : "min-h-[26rem]",
2010
- "px-8 flex flex-col divide-y divide-neutral-800",
2011
- "animate-in animate-duration-300 fade-in slide-in-from-bottom-8"
2163
+ className: twMerge9(
2164
+ "p-2.5 gap-1 border text-lg font-medium transition",
2165
+ "outline-none ring-2 ring-transparent focus-within:ring-orange-500 focus-within:border-transparent",
2166
+ "bg-neutral-900 border-neutral-700 text-white placeholder:text-neutral-500",
2167
+ className
2012
2168
  ),
2013
- children: steps.map((step, i) => {
2014
- const isActive = step === activeStep;
2015
- const isExpanded = isActive || completedSteps.length === steps.length;
2016
- const isDisabled = !step.isComplete && activeStepIndex !== -1 && i > activeStepIndex;
2017
- return /* @__PURE__ */ jsx17("div", { className: twMerge7("py-8 flex flex-col justify-center", isActive ? "flex-grow" : null), children: /* @__PURE__ */ jsx17("div", { className: twMerge7("flex flex-col", isDisabled ? "opacity-30 pointer-events-none" : null), children: step.content({ isActive, isExpanded }) }) }, step.id);
2018
- })
2169
+ ...props
2019
2170
  }
2020
2171
  );
2021
2172
  }
2022
2173
 
2023
- // src/AccountModalContent.tsx
2024
- import { useRef as useRef3 } from "react";
2025
- import { jsx as jsx18 } from "react/jsx-runtime";
2026
- function AccountModalContent() {
2027
- const { chainId } = useEntryKitConfig();
2028
- const userClient = useConnectorClient({ chainId });
2029
- const { address: userAddress } = useAccount2();
2030
- const initialUserAddress = useRef3(userAddress);
2031
- if (userClient.status !== "success") {
2032
- return /* @__PURE__ */ jsx18(ConnectWallet, {});
2174
+ // src/onboarding/deposit/ChainIcon.tsx
2175
+ import { twMerge as twMerge11 } from "tailwind-merge";
2176
+
2177
+ // src/onboarding/deposit/PreloadedImage.tsx
2178
+ import { twMerge as twMerge10 } from "tailwind-merge";
2179
+ import { jsx as jsx23 } from "react/jsx-runtime";
2180
+ function PreloadedImage({ url, fallback: fallback2, className }) {
2181
+ const { isSuccess, isLoading } = usePreloadImage(url);
2182
+ return /* @__PURE__ */ jsx23("span", { className: twMerge10("inline-flex w-full h-full items-center justify-center overflow-clip", className), children: !isLoading ? isSuccess ? /* @__PURE__ */ jsx23("img", { src: url, className: "w-full h-full object-cover" }) : fallback2 : null });
2183
+ }
2184
+
2185
+ // src/onboarding/deposit/ChainIcon.tsx
2186
+ import { forwardRef as forwardRef2 } from "react";
2187
+ import { jsx as jsx24 } from "react/jsx-runtime";
2188
+ var ChainIcon = forwardRef2(function ChainIcon2({ name, url, className }, forwardedRef) {
2189
+ return /* @__PURE__ */ jsx24(
2190
+ "span",
2191
+ {
2192
+ ref: forwardedRef,
2193
+ className: twMerge11("flex-shrink-0 inline-flex w-6 aspect-square rounded-full overflow-clip", className),
2194
+ children: url ? /* @__PURE__ */ jsx24(PreloadedImage, { url }) : (
2195
+ // TODO: better placeholder
2196
+ /* @__PURE__ */ jsx24(
2197
+ "span",
2198
+ {
2199
+ className: twMerge11(
2200
+ "inline-flex items-center justify-center w-full h-full rounded-full",
2201
+ "border-2 border-dashed border-white/50 opacity-50"
2202
+ ),
2203
+ children: name?.slice(0, 1)
2204
+ }
2205
+ )
2206
+ )
2207
+ }
2208
+ );
2209
+ });
2210
+
2211
+ // src/onboarding/deposit/useRelay.ts
2212
+ import {
2213
+ MAINNET_RELAY_API,
2214
+ TESTNET_RELAY_API,
2215
+ fetchChainConfigs,
2216
+ createClient as createClient2,
2217
+ LogLevel
2218
+ } from "@reservoir0x/relay-sdk";
2219
+ import { useQuery as useQuery10 } from "@tanstack/react-query";
2220
+ function useRelay() {
2221
+ const { chain } = useEntryKitConfig();
2222
+ const appOrigin = location.host;
2223
+ const baseApiUrl = chain.testnet ? TESTNET_RELAY_API : MAINNET_RELAY_API;
2224
+ return useQuery10({
2225
+ queryKey: ["relayChains", baseApiUrl, appOrigin],
2226
+ queryFn: async () => {
2227
+ debug("fetching relay chains from", baseApiUrl);
2228
+ const chains = await fetchChainConfigs(baseApiUrl);
2229
+ debug("got relay chains", chains);
2230
+ const client = createClient2({
2231
+ baseApiUrl,
2232
+ source: appOrigin,
2233
+ chains,
2234
+ logLevel: LogLevel.Verbose
2235
+ });
2236
+ return { client, chains };
2237
+ },
2238
+ refetchOnMount: false,
2239
+ refetchOnReconnect: false,
2240
+ refetchOnWindowFocus: false,
2241
+ staleTime: Infinity
2242
+ });
2243
+ }
2244
+
2245
+ // src/onboarding/deposit/useChainBalances.ts
2246
+ import { useAccount, useConfig as useWagmiConfig } from "wagmi";
2247
+ import { getBalance as getBalance2 } from "wagmi/actions";
2248
+ import { useQuery as useQuery11, skipToken as skipToken8 } from "@tanstack/react-query";
2249
+ import { isNotNull } from "@latticexyz/common/utils";
2250
+ function useChainBalances({ chains }) {
2251
+ const { address: userAddress } = useAccount();
2252
+ const wagmiConfig = useWagmiConfig();
2253
+ const chainIds = chains.map((chain) => chain.id);
2254
+ return useQuery11({
2255
+ queryKey: ["chainBalances", chainIds, userAddress],
2256
+ queryFn: userAddress ? async () => {
2257
+ const chainBalances = await Promise.allSettled(
2258
+ chains.map(async (chain) => {
2259
+ const balance = await getBalance2(wagmiConfig, { chainId: chain.id, address: userAddress });
2260
+ return { chain, balance };
2261
+ })
2262
+ );
2263
+ return chainBalances.map((result) => result.status === "fulfilled" ? result.value : null).filter(isNotNull);
2264
+ } : skipToken8,
2265
+ refetchInterval: 1e3 * 60,
2266
+ retry: 1
2267
+ });
2268
+ }
2269
+
2270
+ // src/onboarding/deposit/ChainSelect.tsx
2271
+ import { Fragment as Fragment2, jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
2272
+ function ChainSelect({ value, onChange }) {
2273
+ const theme = useTheme();
2274
+ const { frame } = useFrame();
2275
+ const { chains, switchChain } = useSwitchChain();
2276
+ const relay = useRelay();
2277
+ const relayChains = relay.data?.chains;
2278
+ const sourceChains = useMemo2(() => {
2279
+ return chains.map((sourceChain) => {
2280
+ const relayChain = relayChains?.find((c) => c.id === sourceChain.id);
2281
+ return {
2282
+ ...sourceChain,
2283
+ relayChain
2284
+ };
2285
+ }).filter((c) => c.relayChain);
2286
+ }, [chains, relayChains]);
2287
+ const selectedChain = sourceChains.find((c) => c.id === value);
2288
+ const { data: chainsBalances, isLoading } = useShowQueryError(useChainBalances({ chains: sourceChains }));
2289
+ const renderedChains = useMemo2(() => {
2290
+ if (!chainsBalances) return [];
2291
+ const chainsWithBalance = chainsBalances.filter(({ balance }) => balance.value > 0n).map(({ chain, balance }) => ({ chain, balance: balance.value }));
2292
+ return chainsWithBalance.length > 0 ? chainsWithBalance : sourceChains.map((chain) => ({ chain, balance: 0n }));
2293
+ }, [chainsBalances, sourceChains]);
2294
+ useEffect10(() => {
2295
+ if (renderedChains.length > 0 && (!selectedChain || !renderedChains.find((c) => c.chain.id === selectedChain?.id))) {
2296
+ const defaultChain = renderedChains[0].chain;
2297
+ onChange(defaultChain.id);
2298
+ switchChain({ chainId: defaultChain.id });
2299
+ }
2300
+ }, [value, selectedChain, renderedChains, onChange, switchChain]);
2301
+ return /* @__PURE__ */ jsxs15(
2302
+ Select.Root,
2303
+ {
2304
+ value: value.toString(),
2305
+ onValueChange: (value2) => {
2306
+ if (value2) {
2307
+ const chain = renderedChains.find((item) => item.chain.id.toString() === value2)?.chain;
2308
+ if (!chain) throw new Error(`Unknown chain selected: ${value2}`);
2309
+ onChange(chain.id);
2310
+ }
2311
+ },
2312
+ children: [
2313
+ /* @__PURE__ */ jsx25(Input, { asChild: true, children: /* @__PURE__ */ jsxs15(Select.Trigger, { className: "group inline-flex items-center justify-center", children: [
2314
+ /* @__PURE__ */ jsx25(Select.Value, { asChild: true, children: /* @__PURE__ */ jsx25(
2315
+ ChainIcon,
2316
+ {
2317
+ id: selectedChain?.id,
2318
+ name: selectedChain?.name,
2319
+ url: selectedChain?.relayChain?.icon?.[theme],
2320
+ className: "w-8"
2321
+ }
2322
+ ) }),
2323
+ /* @__PURE__ */ jsx25(Select.Icon, { asChild: true, children: /* @__PURE__ */ jsxs15(Fragment2, { children: [
2324
+ /* @__PURE__ */ jsx25(ChevronDownIcon, { className: "text-sm -mr-1 group-aria-expanded:hidden" }),
2325
+ /* @__PURE__ */ jsx25(ChevronUpIcon, { className: "text-sm -mr-1 hidden group-aria-expanded:inline" })
2326
+ ] }) })
2327
+ ] }) }),
2328
+ frame.contentDocument ? /* @__PURE__ */ jsx25(Select.Portal, { container: frame.contentDocument.body, children: /* @__PURE__ */ jsx25(
2329
+ Select.Content,
2330
+ {
2331
+ position: "popper",
2332
+ className: "w-[352px] max-h-[230px] overflow-y-auto mt-1 animate-in fade-in slide-in-from-top-2",
2333
+ children: /* @__PURE__ */ jsx25(Select.Viewport, { children: /* @__PURE__ */ jsx25(
2334
+ Select.Group,
2335
+ {
2336
+ className: twMerge12(
2337
+ "flex flex-col border divide-y",
2338
+ "bg-neutral-800 text-neutral-300 border-neutral-700 divide-neutral-700"
2339
+ ),
2340
+ children: isLoading ? /* @__PURE__ */ jsx25("div", { className: "flex items-center justify-center p-4", children: /* @__PURE__ */ jsx25(PendingIcon, { className: "h-6 w-6 animate-spin text-gray-400" }) }) : renderedChains.map(({ chain, balance }) => {
2341
+ return /* @__PURE__ */ jsxs15(
2342
+ Select.Item,
2343
+ {
2344
+ value: chain.id.toString(),
2345
+ className: twMerge12(
2346
+ "group flex p-2.5 gap-2.5 items-center cursor-pointer outline-none",
2347
+ "text-white focus:bg-neutral-700 data-[state=checked]:bg-neutral-900"
2348
+ ),
2349
+ children: [
2350
+ /* @__PURE__ */ jsx25(ChainIcon, { id: chain.id, name: chain.name, url: chain.relayChain?.icon?.[theme] }),
2351
+ /* @__PURE__ */ jsx25("span", { className: "flex-grow flex-shrink-0", children: chain.name }),
2352
+ /* @__PURE__ */ jsx25("span", { className: "flex-shrink-0 font-mono text-sm text-neutral-400", children: /* @__PURE__ */ jsx25(Balance, { wei: balance }) })
2353
+ ]
2354
+ },
2355
+ chain.id
2356
+ );
2357
+ })
2358
+ }
2359
+ ) })
2360
+ }
2361
+ ) }) : null
2362
+ ]
2363
+ }
2364
+ );
2365
+ }
2366
+
2367
+ // src/onboarding/deposit/AmountInput.tsx
2368
+ import { formatEther as formatEther3, parseEther as parseEther5 } from "viem";
2369
+ import { twMerge as twMerge13 } from "tailwind-merge";
2370
+ import { forwardRef as forwardRef3 } from "react";
2371
+ import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
2372
+ var AmountInput = forwardRef3(function AmountInput2({ initialAmount, onChange }, forwardedRef) {
2373
+ return /* @__PURE__ */ jsx26(Input, { asChild: true, className: "w-full cursor-text flex items-center", children: /* @__PURE__ */ jsxs16("label", { children: [
2374
+ /* @__PURE__ */ jsx26(
2375
+ "input",
2376
+ {
2377
+ ref: forwardedRef,
2378
+ className: twMerge13("peer flex-grow outline-none bg-transparent", "placeholder:text-neutral-500"),
2379
+ placeholder: "0.005",
2380
+ required: true,
2381
+ autoFocus: true,
2382
+ defaultValue: initialAmount == null ? "" : formatEther3(initialAmount),
2383
+ onChange: (event) => {
2384
+ const input = event.currentTarget;
2385
+ if (input.value.trim() === "") {
2386
+ input.setCustomValidity("");
2387
+ onChange(void 0);
2388
+ return;
2389
+ }
2390
+ const value = input.value.trim().replace(/\.$/, ".0");
2391
+ if (!/^\d*(\.\d+)?$/.test(value)) {
2392
+ return input.setCustomValidity("Invalid amount.");
2393
+ }
2394
+ input.setCustomValidity("");
2395
+ onChange(parseEther5(value));
2396
+ }
2397
+ }
2398
+ ),
2399
+ /* @__PURE__ */ jsx26("span", { className: twMerge13("flex-shrink-0 text-2xl", "peer-placeholder-shown:text-neutral-500"), children: /* @__PURE__ */ jsx26(EthIcon, {}) })
2400
+ ] }) });
2401
+ });
2402
+
2403
+ // src/onboarding/deposit/SubmitButton.tsx
2404
+ import { useAccount as useAccount2, useBalance as useBalance3, useSwitchChain as useSwitchChain2 } from "wagmi";
2405
+ import { twMerge as twMerge14 } from "tailwind-merge";
2406
+ import { parseEther as parseEther6 } from "viem";
2407
+ import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
2408
+ var MAX_DEPOSIT_AMOUNT = "0.1";
2409
+ function SubmitButton({ amount, chainId, className, ...buttonProps }) {
2410
+ const { chainId: userChainId, address: userAddress } = useAccount2();
2411
+ const { data: userBalance } = useBalance3({ address: userAddress });
2412
+ const shouldSwitchChain = chainId != null && chainId !== userChainId;
2413
+ const switchChain = useSwitchChain2();
2414
+ if (shouldSwitchChain) {
2415
+ return /* @__PURE__ */ jsx27(
2416
+ Button,
2417
+ {
2418
+ type: "button",
2419
+ variant: "primary",
2420
+ className: twMerge14("w-full", className),
2421
+ pending: switchChain.isPending,
2422
+ onClick: () => switchChain.switchChain({ chainId }),
2423
+ children: "Switch chain"
2424
+ }
2425
+ );
2426
+ } else if (amount) {
2427
+ if (amount > parseEther6(MAX_DEPOSIT_AMOUNT)) {
2428
+ return /* @__PURE__ */ jsxs17(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: [
2429
+ "Max amount is ",
2430
+ MAX_DEPOSIT_AMOUNT,
2431
+ " ETH"
2432
+ ] });
2433
+ } else if (amount > (userBalance?.value ?? 0n)) {
2434
+ return /* @__PURE__ */ jsx27(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: "Insufficient balance" });
2435
+ }
2033
2436
  }
2034
- return /* @__PURE__ */ jsx18(ConnectedSteps, { userClient: userClient.data, initialUserAddress: initialUserAddress.current });
2437
+ return /* @__PURE__ */ jsx27(Button, { type: "submit", className: twMerge14("w-full", className), ...buttonProps });
2035
2438
  }
2036
2439
 
2037
- // src/AccountModal.tsx
2038
- import { DialogClose } from "@radix-ui/react-dialog";
2440
+ // src/icons/WarningIcon.tsx
2441
+ import { jsx as jsx28 } from "react/jsx-runtime";
2442
+ function WarningIcon(props) {
2443
+ return /* @__PURE__ */ jsx28(IconSVG, { fill: "none", ...props, children: /* @__PURE__ */ jsx28(
2444
+ "path",
2445
+ {
2446
+ d: "M12 9V11M12 15H12.01M5.07183 19H18.9282C20.4678 19 21.4301 17.3333 20.6603 16L13.7321 4C12.9623 2.66667 11.0378 2.66667 10.268 4L3.33978 16C2.56998 17.3333 3.53223 19 5.07183 19Z",
2447
+ stroke: "currentColor",
2448
+ strokeWidth: "2",
2449
+ strokeLinecap: "round",
2450
+ strokeLinejoin: "round"
2451
+ }
2452
+ ) });
2453
+ }
2039
2454
 
2040
- // src/icons/IconSVG.tsx
2041
- import { twMerge as twMerge8 } from "tailwind-merge";
2042
- import { jsx as jsx19 } from "react/jsx-runtime";
2043
- function IconSVG({ className, children, ...props }) {
2044
- return /* @__PURE__ */ jsx19(
2045
- "svg",
2455
+ // src/formatGas.ts
2456
+ import { formatGwei } from "viem";
2457
+ function formatGas(wei) {
2458
+ const formatted = formatGwei(wei);
2459
+ const magnitude = Math.floor(parseFloat(formatted)).toString().length;
2460
+ return parseFloat(formatted).toLocaleString("en-US", { maximumFractionDigits: Math.max(0, 6 - magnitude) });
2461
+ }
2462
+
2463
+ // src/onboarding/deposit/DepositForm.tsx
2464
+ import { Fragment as Fragment3, jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
2465
+ function DepositForm({
2466
+ sourceChain,
2467
+ setSourceChainId,
2468
+ amount,
2469
+ setAmount,
2470
+ estimatedFee,
2471
+ estimatedTime,
2472
+ onSubmit,
2473
+ submitButton
2474
+ }) {
2475
+ const amountInputRef = useRef4(null);
2476
+ const isMounted = useIsMounted();
2477
+ const { address: userAddress, chainId: userChainId } = useAccount3();
2478
+ const balance = useShowQueryError(useBalance4({ chainId: sourceChain.id, address: userAddress }));
2479
+ const quarryBalance = useShowQueryError(useBalance(userAddress));
2480
+ useWatchBlockNumber2({
2481
+ onBlockNumber: () => {
2482
+ balance.refetch();
2483
+ quarryBalance.refetch();
2484
+ }
2485
+ });
2486
+ const minimumBalance = amount != null ? amount + (estimatedFee?.fee ?? 0n) : void 0;
2487
+ const hasMinimumBalance = balance.data != null ? balance.data.value > (minimumBalance ?? 0n) : void 0;
2488
+ useEffect11(() => {
2489
+ amountInputRef.current?.focus();
2490
+ }, [userChainId]);
2491
+ return /* @__PURE__ */ jsxs18(
2492
+ "form",
2046
2493
  {
2047
- xmlns: "http://www.w3.org/2000/svg",
2048
- viewBox: "0 0 24 24",
2049
- fill: "currentColor",
2050
- className: twMerge8("-my-[0.125em] h-[1.25em] w-[1.25em]", className),
2051
- ...props,
2052
- children
2494
+ className: "flex flex-col gap-5",
2495
+ onSubmit: async (event) => {
2496
+ event.preventDefault();
2497
+ try {
2498
+ await onSubmit();
2499
+ if (isMounted()) {
2500
+ setAmount(void 0);
2501
+ if (amountInputRef.current) {
2502
+ amountInputRef.current.value = "";
2503
+ }
2504
+ }
2505
+ } catch (error2) {
2506
+ console.error("Error during deposit", error2);
2507
+ } finally {
2508
+ amountInputRef.current?.focus();
2509
+ }
2510
+ },
2511
+ children: [
2512
+ /* @__PURE__ */ jsxs18("div", { className: "flex gap-2", children: [
2513
+ /* @__PURE__ */ jsx29(ChainSelect, { value: sourceChain.id, onChange: setSourceChainId }),
2514
+ /* @__PURE__ */ jsx29(AmountInput, { ref: amountInputRef, initialAmount: amount, onChange: setAmount })
2515
+ ] }),
2516
+ /* @__PURE__ */ jsxs18(
2517
+ "dl",
2518
+ {
2519
+ className: twMerge15(
2520
+ "grid grid-cols-2 divide-y text-sm leading-loose [&_>_:is(dt,dd)]:px-1 [&_>_dd]:text-right",
2521
+ "divide-neutral-700 text-neutral-400"
2522
+ ),
2523
+ children: [
2524
+ /* @__PURE__ */ jsx29("dt", { children: "Available to deposit" }),
2525
+ /* @__PURE__ */ jsx29("dd", { children: balance.isSuccess ? /* @__PURE__ */ jsx29(Balance, { wei: balance.data.value }) : balance.isError ? /* @__PURE__ */ jsx29("span", { title: String(balance.error), children: /* @__PURE__ */ jsx29(WarningIcon, { className: "inline-block text-amber-500" }) }) : balance.isLoading ? /* @__PURE__ */ jsx29(PendingIcon, { className: "inline-block text-xs" }) : null }),
2526
+ /* @__PURE__ */ jsx29("dt", { children: "Gas balance after deposit" }),
2527
+ /* @__PURE__ */ jsx29("dd", { children: /* @__PURE__ */ jsx29(Balance, { wei: (quarryBalance.data ?? 0n) + (amount ?? 0n) }) }),
2528
+ /* @__PURE__ */ jsx29("dt", { children: "Estimated fee" }),
2529
+ /* @__PURE__ */ jsx29("dd", { children: estimatedFee.fee ? /* @__PURE__ */ jsxs18(Fragment3, { children: [
2530
+ formatGas(estimatedFee.fee),
2531
+ " gwei"
2532
+ ] }) : estimatedFee.error ? /* @__PURE__ */ jsx29("span", { title: String(estimatedFee.error), children: /* @__PURE__ */ jsx29(WarningIcon, { className: "inline-block text-amber-500" }) }) : estimatedFee.isLoading ? /* @__PURE__ */ jsx29(PendingIcon, { className: "inline-block text-xs" }) : null }),
2533
+ /* @__PURE__ */ jsx29("dt", { children: "Time to deposit" }),
2534
+ /* @__PURE__ */ jsx29("dd", { children: estimatedTime })
2535
+ ]
2536
+ }
2537
+ ),
2538
+ hasMinimumBalance ? submitButton : /* @__PURE__ */ jsx29(SubmitButton, { disabled: true, children: "Not enough funds" })
2539
+ ]
2540
+ }
2541
+ );
2542
+ }
2543
+
2544
+ // src/onboarding/deposit/useDeposits.ts
2545
+ import { createStore as createStore4 } from "zustand/vanilla";
2546
+ import { useStore as useStore2 } from "zustand";
2547
+ import { useCallback as useCallback2, useMemo as useMemo3 } from "react";
2548
+ var store4 = createStore4(() => ({
2549
+ count: 0,
2550
+ deposits: []
2551
+ }));
2552
+ function useDeposits() {
2553
+ const deposits = useStore2(store4, (state) => state.deposits);
2554
+ const addDeposit = useCallback2((transaction) => {
2555
+ store4.setState((state) => {
2556
+ if (transaction.type === "relay") {
2557
+ const existingDeposit = state.deposits.find(
2558
+ (deposit) => deposit.type === "relay" && deposit.requestId === transaction.requestId
2559
+ );
2560
+ if (existingDeposit) {
2561
+ return state;
2562
+ }
2563
+ }
2564
+ return {
2565
+ count: state.count + 1,
2566
+ deposits: [
2567
+ ...state.deposits,
2568
+ {
2569
+ ...transaction,
2570
+ uid: `deposit-${state.count}`
2571
+ }
2572
+ ]
2573
+ };
2574
+ });
2575
+ }, []);
2576
+ const removeDeposit = useCallback2((uid) => {
2577
+ store4.setState((state) => ({
2578
+ deposits: state.deposits.filter((deposit) => deposit.uid !== uid)
2579
+ }));
2580
+ }, []);
2581
+ return useMemo3(
2582
+ () => ({
2583
+ deposits,
2584
+ addDeposit,
2585
+ removeDeposit
2586
+ }),
2587
+ [addDeposit, deposits, removeDeposit]
2588
+ );
2589
+ }
2590
+
2591
+ // src/onboarding/deposit/DepositViaTransferForm.tsx
2592
+ import { jsx as jsx30 } from "react/jsx-runtime";
2593
+ function DepositViaTransferForm({ amount, setAmount, sourceChain, setSourceChainId }) {
2594
+ const { chain } = useEntryKitConfig();
2595
+ const paymaster = getPaymaster(chain);
2596
+ const publicClient = usePublicClient();
2597
+ const { address: userAddress } = useAccount4();
2598
+ const { writeContractAsync } = useWriteContract();
2599
+ const { addDeposit } = useDeposits();
2600
+ if (!userAddress) {
2601
+ throw new Error("User address not found");
2602
+ }
2603
+ const { data: gasPrice } = useQuery12({
2604
+ queryKey: ["gasPrice", sourceChain.id],
2605
+ queryFn: async () => {
2606
+ if (!publicClient) throw new Error("Public client not available");
2607
+ return publicClient.getGasPrice();
2608
+ },
2609
+ refetchInterval: 15e3,
2610
+ enabled: !!publicClient
2611
+ });
2612
+ const { data: prepareData, error: prepareError } = usePrepareTransactionRequest({
2613
+ to: paymaster?.address,
2614
+ data: encodeFunctionData2({
2615
+ abi: paymasterAbi,
2616
+ functionName: "depositTo",
2617
+ args: [userAddress]
2618
+ }),
2619
+ value: amount
2620
+ });
2621
+ const deposit = useMutation4({
2622
+ mutationKey: ["depositViaTransfer", amount?.toString()],
2623
+ mutationFn: async () => {
2624
+ if (!paymaster) throw new Error("Paymaster not found");
2625
+ if (!publicClient) throw new Error("Public client not found");
2626
+ if (!amount) throw new Error("Amount cannot be 0");
2627
+ try {
2628
+ const hash = await writeContractAsync({
2629
+ address: paymaster.address,
2630
+ abi: paymasterAbi,
2631
+ functionName: "depositTo",
2632
+ args: [userAddress],
2633
+ value: amount
2634
+ });
2635
+ const receipt = publicClient.waitForTransactionReceipt({ hash }).then((receipt2) => {
2636
+ if (receipt2.status === "reverted") {
2637
+ throw new Error("Transfer transaction reverted.");
2638
+ }
2639
+ return receipt2;
2640
+ });
2641
+ const pendingDeposit = {
2642
+ type: "transfer",
2643
+ amount,
2644
+ chainL1Id: sourceChain.id,
2645
+ chainL2Id: chain.id,
2646
+ hash,
2647
+ receipt,
2648
+ start: /* @__PURE__ */ new Date(),
2649
+ estimatedTime: 1e3 * 12,
2650
+ isComplete: receipt.then(() => void 0)
2651
+ };
2652
+ addDeposit(pendingDeposit);
2653
+ } catch (error2) {
2654
+ console.error("Error while depositing via bridge", error2);
2655
+ throw error2;
2656
+ }
2657
+ }
2658
+ });
2659
+ const estimatedFee = prepareData?.gas && gasPrice ? prepareData.gas * gasPrice : void 0;
2660
+ return /* @__PURE__ */ jsx30(
2661
+ DepositForm,
2662
+ {
2663
+ sourceChain,
2664
+ setSourceChainId,
2665
+ amount,
2666
+ setAmount,
2667
+ estimatedFee: {
2668
+ fee: estimatedFee,
2669
+ isLoading: !prepareData && !prepareError || !gasPrice,
2670
+ error: prepareError instanceof Error ? prepareError : void 0
2671
+ },
2672
+ estimatedTime: "A few seconds",
2673
+ onSubmit: async () => {
2674
+ await deposit.mutateAsync();
2675
+ },
2676
+ submitButton: /* @__PURE__ */ jsx30(
2677
+ SubmitButton,
2678
+ {
2679
+ variant: "primary",
2680
+ amount,
2681
+ chainId: sourceChain.id,
2682
+ disabled: !!prepareError || !amount || !userAddress,
2683
+ pending: deposit.isPending,
2684
+ children: "Deposit"
2685
+ }
2686
+ )
2053
2687
  }
2054
2688
  );
2055
2689
  }
2056
2690
 
2691
+ // src/onboarding/deposit/DepositViaRelayForm.tsx
2692
+ import { encodeFunctionData as encodeFunctionData3 } from "viem";
2693
+ import { useAccount as useAccount5, useWalletClient } from "wagmi";
2694
+ import { useMutation as useMutation5, useQuery as useQuery13 } from "@tanstack/react-query";
2695
+ import { jsx as jsx31 } from "react/jsx-runtime";
2696
+ var ETH_ADDRESS = "0x0000000000000000000000000000000000000000";
2697
+ function DepositViaRelayForm({ amount, setAmount, sourceChain, setSourceChainId }) {
2698
+ const { chain, chainId: destinationChainId } = useEntryKitConfig();
2699
+ const paymaster = getPaymaster(chain);
2700
+ const { data: wallet } = useWalletClient();
2701
+ const { address: userAddress } = useAccount5();
2702
+ const { addDeposit } = useDeposits();
2703
+ const { data: relay } = useRelay();
2704
+ const relayClient = relay?.client;
2705
+ const quote = useQuery13({
2706
+ queryKey: ["relayBridgeQuote", sourceChain.id, amount?.toString()],
2707
+ queryFn: async () => {
2708
+ if (!relayClient) throw new Error("No Relay client found.");
2709
+ if (!userAddress) throw new Error("No user address found.");
2710
+ const result = await relayClient.actions.getQuote({
2711
+ chainId: sourceChain.id,
2712
+ toChainId: destinationChainId,
2713
+ currency: ETH_ADDRESS,
2714
+ toCurrency: ETH_ADDRESS,
2715
+ amount: amount?.toString(),
2716
+ tradeType: "EXACT_OUTPUT",
2717
+ recipient: paymaster?.address,
2718
+ wallet,
2719
+ txs: [
2720
+ {
2721
+ to: paymaster?.address,
2722
+ data: encodeFunctionData3({
2723
+ abi: paymasterAbi,
2724
+ functionName: "depositTo",
2725
+ args: [userAddress]
2726
+ }),
2727
+ value: amount?.toString()
2728
+ }
2729
+ ]
2730
+ });
2731
+ if (!result) {
2732
+ throw new Error("Failed to get relay quote");
2733
+ }
2734
+ return result;
2735
+ },
2736
+ retry: 1,
2737
+ refetchInterval: 15e3,
2738
+ enabled: !!amount && !!userAddress && !!relayClient
2739
+ });
2740
+ const deposit = useMutation5({
2741
+ mutationKey: ["depositViaRelay", sourceChain.id, amount?.toString()],
2742
+ mutationFn: async ({ quote: quote2, amount: amount2 }) => {
2743
+ if (!relayClient) throw new Error("No Relay client found.");
2744
+ if (!wallet) throw new Error("No wallet found.");
2745
+ try {
2746
+ return new Promise((resolve) => {
2747
+ const pendingDeposit = relayClient.actions.execute({
2748
+ quote: quote2,
2749
+ wallet,
2750
+ onProgress(progress) {
2751
+ const currentStep = progress.currentStep;
2752
+ const requestId = currentStep?.requestId;
2753
+ const currentState = currentStep?.items[0]?.progressState;
2754
+ if (requestId && currentState === "validating") {
2755
+ addDeposit({
2756
+ type: "relay",
2757
+ requestId,
2758
+ amount: amount2,
2759
+ chainL1Id: sourceChain.id,
2760
+ chainL2Id: destinationChainId,
2761
+ start: /* @__PURE__ */ new Date(),
2762
+ estimatedTime: 1e3 * 30,
2763
+ depositPromise: pendingDeposit,
2764
+ isComplete: pendingDeposit.then(() => void 0)
2765
+ });
2766
+ resolve(void 0);
2767
+ }
2768
+ }
2769
+ });
2770
+ });
2771
+ } catch (error2) {
2772
+ console.error("Error while depositing via Relay", error2);
2773
+ throw error2;
2774
+ }
2775
+ }
2776
+ });
2777
+ const fees = quote.data?.fees;
2778
+ const gasFee = BigInt(fees?.gas?.amount ?? 0);
2779
+ const relayerFee = BigInt(fees?.relayer?.amount ?? 0);
2780
+ const fee = gasFee + relayerFee;
2781
+ return /* @__PURE__ */ jsx31(
2782
+ DepositForm,
2783
+ {
2784
+ sourceChain,
2785
+ setSourceChainId,
2786
+ amount,
2787
+ setAmount,
2788
+ estimatedFee: {
2789
+ fee: fee != null ? BigInt(fee) : void 0,
2790
+ isLoading: quote.isLoading,
2791
+ error: quote.error instanceof Error ? quote.error : void 0
2792
+ },
2793
+ estimatedTime: "A few seconds",
2794
+ onSubmit: async () => {
2795
+ if (!quote.data || !amount) return;
2796
+ await deposit.mutateAsync({ quote: quote.data, amount });
2797
+ },
2798
+ submitButton: /* @__PURE__ */ jsx31(
2799
+ SubmitButton,
2800
+ {
2801
+ variant: "primary",
2802
+ amount,
2803
+ chainId: sourceChain.id,
2804
+ disabled: quote.isError || !amount,
2805
+ pending: deposit.isPending,
2806
+ children: "Deposit"
2807
+ }
2808
+ )
2809
+ }
2810
+ );
2811
+ }
2812
+
2813
+ // src/onboarding/deposit/Deposits.tsx
2814
+ import { useEffect as useEffect13 } from "react";
2815
+ import { useQuery as useQuery16, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
2816
+
2817
+ // src/onboarding/deposit/TransferDepositStatus.tsx
2818
+ import { useQuery as useQuery14 } from "@tanstack/react-query";
2819
+
2820
+ // src/onboarding/deposit/DepositStatus.tsx
2821
+ import { useEffect as useEffect12, useState as useState3 } from "react";
2822
+ import { twMerge as twMerge16 } from "tailwind-merge";
2823
+
2057
2824
  // src/icons/CloseIcon.tsx
2058
- import { jsx as jsx20 } from "react/jsx-runtime";
2825
+ import { jsx as jsx32 } from "react/jsx-runtime";
2059
2826
  function CloseIcon(props) {
2060
- return /* @__PURE__ */ jsx20(IconSVG, { strokeWidth: "2", stroke: "currentColor", ...props, children: /* @__PURE__ */ jsx20(
2827
+ return /* @__PURE__ */ jsx32(IconSVG, { strokeWidth: "2", stroke: "currentColor", ...props, children: /* @__PURE__ */ jsx32(
2061
2828
  "path",
2062
2829
  {
2063
2830
  d: "M6 18L18 6M6 6L18 18",
@@ -2070,52 +2837,583 @@ function CloseIcon(props) {
2070
2837
  ) });
2071
2838
  }
2072
2839
 
2840
+ // src/onboarding/deposit/DepositStatus.tsx
2841
+ import { jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
2842
+ function DepositStatus({ status, progress, children, onDismiss }) {
2843
+ const [appear, setAppear] = useState3(false);
2844
+ useEffect12(() => {
2845
+ setAppear(true);
2846
+ }, []);
2847
+ return /* @__PURE__ */ jsxs19("div", { className: "group bg-neutral-900 flex flex-col animate-in fade-in slide-in-from-bottom-2 animate-out fade-out", children: [
2848
+ /* @__PURE__ */ jsxs19("div", { className: "py-1 text-sm flex items-center gap-2", children: [
2849
+ /* @__PURE__ */ jsx33("div", { className: "flex-grow", children }),
2850
+ /* @__PURE__ */ jsxs19("div", { className: "flex-shrink-0 grid", children: [
2851
+ /* @__PURE__ */ jsx33("span", { className: "col-start-1 row-start-1 transition opacity-100 group-hover:opacity-0 group-hover:pointer-events-none", children: status === "success" ? /* @__PURE__ */ jsx33(CheckIcon, { className: "text-green-600" }) : status === "error" ? /* @__PURE__ */ jsx33(WarningIcon, { className: "text-amber-500" }) : /* @__PURE__ */ jsx33(PendingIcon, { className: "text-neutral-500 transition" }) }),
2852
+ /* @__PURE__ */ jsx33(
2853
+ "button",
2854
+ {
2855
+ type: "button",
2856
+ className: twMerge16(
2857
+ "col-start-1 row-start-1 flex items-center justify-center transition",
2858
+ "opacity-0 pointer-events-none",
2859
+ "group-hover:opacity-100 group-hover:pointer-events-auto",
2860
+ "text-neutral-500 hover:text-white"
2861
+ ),
2862
+ title: "Dismiss",
2863
+ onClick: onDismiss,
2864
+ children: /* @__PURE__ */ jsx33(CloseIcon, {})
2865
+ }
2866
+ )
2867
+ ] })
2868
+ ] }),
2869
+ /* @__PURE__ */ jsx33("div", { className: "w-full h-[2px] -mt-full overflow-clip", children: /* @__PURE__ */ jsx33(
2870
+ "div",
2871
+ {
2872
+ className: twMerge16(
2873
+ "w-full h-full transition ease-linear",
2874
+ status === "success" ? "bg-green-600" : status === "error" ? "bg-red-600" : "bg-blue-600",
2875
+ status === "pending" ? "opacity-100" : "opacity-0"
2876
+ ),
2877
+ style: status === "pending" ? {
2878
+ transform: appear ? `translateX(0)` : "translate(-100%)",
2879
+ transitionDuration: `${progress.duration}ms`,
2880
+ transitionDelay: `-${Math.min(progress.duration, progress.elapsed)}ms`
2881
+ } : void 0
2882
+ }
2883
+ ) })
2884
+ ] });
2885
+ }
2886
+
2887
+ // src/onboarding/deposit/TransferDepositStatus.tsx
2888
+ import { useChains as useChains2 } from "wagmi";
2889
+ import { Fragment as Fragment4, jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
2890
+ function TransferDepositStatus({
2891
+ amount,
2892
+ chainL1Id,
2893
+ hash,
2894
+ receipt: receiptPromise,
2895
+ start,
2896
+ estimatedTime,
2897
+ onDismiss
2898
+ }) {
2899
+ const chains = useChains2();
2900
+ const chain = chains.find((chain2) => chain2.id === chainL1Id);
2901
+ const receipt = useQuery14({
2902
+ queryKey: ["transferDepositStatus", hash],
2903
+ queryFn: () => receiptPromise
2904
+ });
2905
+ return /* @__PURE__ */ jsx34(
2906
+ DepositStatus,
2907
+ {
2908
+ status: receipt.status,
2909
+ progress: {
2910
+ duration: estimatedTime,
2911
+ elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
2912
+ },
2913
+ onDismiss,
2914
+ children: (() => {
2915
+ const blockExplorer = chain.blockExplorers?.default.url;
2916
+ if (receipt.status === "pending") {
2917
+ return /* @__PURE__ */ jsxs20(Fragment4, { children: [
2918
+ "Confirming deposit on",
2919
+ " ",
2920
+ /* @__PURE__ */ jsx34(
2921
+ "a",
2922
+ {
2923
+ href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
2924
+ target: "_blank",
2925
+ rel: "noreferrer noopener",
2926
+ children: chain.name
2927
+ }
2928
+ ),
2929
+ "\u2026"
2930
+ ] });
2931
+ }
2932
+ if (receipt.status === "error") {
2933
+ return /* @__PURE__ */ jsxs20(Fragment4, { children: [
2934
+ "Could not find deposit on",
2935
+ " ",
2936
+ /* @__PURE__ */ jsx34(
2937
+ "a",
2938
+ {
2939
+ href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
2940
+ target: "_blank",
2941
+ rel: "noreferrer noopener",
2942
+ children: chain.name
2943
+ }
2944
+ ),
2945
+ "."
2946
+ ] });
2947
+ }
2948
+ return /* @__PURE__ */ jsxs20(Fragment4, { children: [
2949
+ "Successfully",
2950
+ " ",
2951
+ /* @__PURE__ */ jsx34(
2952
+ "a",
2953
+ {
2954
+ href: blockExplorer ? `${blockExplorer}/tx/${receipt.data.transactionHash}` : void 0,
2955
+ target: "_blank",
2956
+ rel: "noreferrer noopener",
2957
+ children: "deposited"
2958
+ }
2959
+ ),
2960
+ " ",
2961
+ /* @__PURE__ */ jsx34(Balance, { wei: amount })
2962
+ ] });
2963
+ })()
2964
+ }
2965
+ );
2966
+ }
2967
+
2968
+ // src/onboarding/deposit/RelayDepositStatus.tsx
2969
+ import { useQuery as useQuery15 } from "@tanstack/react-query";
2970
+ import { useChains as useChains3 } from "wagmi";
2971
+ import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
2972
+ function RelayDepositStatus({
2973
+ amount,
2974
+ chainL1Id,
2975
+ chainL2Id,
2976
+ start,
2977
+ estimatedTime,
2978
+ depositPromise,
2979
+ onDismiss
2980
+ }) {
2981
+ const chains = useChains3();
2982
+ const chainL1 = chains.find((chain) => chain.id === chainL1Id);
2983
+ const chainL2 = chains.find((chain) => chain.id === chainL2Id);
2984
+ const deposit = useQuery15({
2985
+ queryKey: ["relayDepositPromise", chainL1Id, chainL2Id, amount.toString(), start.toISOString()],
2986
+ queryFn: () => depositPromise
2987
+ });
2988
+ return /* @__PURE__ */ jsx35(
2989
+ DepositStatus,
2990
+ {
2991
+ status: deposit.status,
2992
+ progress: {
2993
+ duration: estimatedTime,
2994
+ elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
2995
+ },
2996
+ onDismiss,
2997
+ children: (() => {
2998
+ if (deposit.status === "pending") {
2999
+ return /* @__PURE__ */ jsxs21(Fragment5, { children: [
3000
+ "Relay bridge deposit pending on ",
3001
+ chainL1.name,
3002
+ "\u2026"
3003
+ ] });
3004
+ }
3005
+ if (deposit.status === "error") {
3006
+ return /* @__PURE__ */ jsxs21(Fragment5, { children: [
3007
+ "Relay bridge deposit to ",
3008
+ chainL2.name,
3009
+ " failed."
3010
+ ] });
3011
+ }
3012
+ return /* @__PURE__ */ jsxs21(Fragment5, { children: [
3013
+ "Successfully bridged ",
3014
+ /* @__PURE__ */ jsx35(Balance, { wei: amount }),
3015
+ " to ",
3016
+ chainL2.name,
3017
+ "!"
3018
+ ] });
3019
+ })()
3020
+ }
3021
+ );
3022
+ }
3023
+
3024
+ // src/onboarding/deposit/Deposits.tsx
3025
+ import { useAccount as useAccount6, useClient as useClient11 } from "wagmi";
3026
+ import { jsx as jsx36 } from "react/jsx-runtime";
3027
+ function Deposits() {
3028
+ const queryClient = useQueryClient7();
3029
+ const { chainId } = useEntryKitConfig();
3030
+ const client = useClient11({ chainId });
3031
+ const { address: userAddress } = useAccount6();
3032
+ const { deposits, removeDeposit } = useDeposits();
3033
+ const { data: isComplete } = useQuery16({
3034
+ queryKey: ["depositsComplete", deposits.map((deposit) => deposit.uid)],
3035
+ queryFn: async () => {
3036
+ if (!deposits.length) return false;
3037
+ await Promise.all(deposits.map((deposit) => deposit.isComplete));
3038
+ return true;
3039
+ }
3040
+ });
3041
+ useEffect13(() => {
3042
+ if (isComplete) {
3043
+ queryClient.invalidateQueries({ queryKey: ["balance"] });
3044
+ queryClient.invalidateQueries({ queryKey: ["getBalance", client?.uid, userAddress] });
3045
+ }
3046
+ }, [client?.uid, isComplete, queryClient, userAddress]);
3047
+ if (!deposits.length) return null;
3048
+ return /* @__PURE__ */ jsx36("div", { className: "flex flex-col gap-1 mt-4", children: deposits.map((deposit) => {
3049
+ if (deposit.type === "transfer") {
3050
+ return /* @__PURE__ */ jsx36(TransferDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
3051
+ } else if (deposit.type === "relay") {
3052
+ return /* @__PURE__ */ jsx36(RelayDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
3053
+ }
3054
+ }) });
3055
+ }
3056
+
3057
+ // src/onboarding/deposit/DepositFormContainer.tsx
3058
+ import { jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
3059
+ function DepositFormContainer() {
3060
+ const { chainId: destinationChainId } = useEntryKitConfig();
3061
+ const chainId = useChainId();
3062
+ const chains = useChains4();
3063
+ const [amount, setAmount] = useState4(void 0);
3064
+ const [sourceChainId, setSourceChainId] = useState4(chainId);
3065
+ const sourceChain = chains.find(({ id }) => id === sourceChainId);
3066
+ return /* @__PURE__ */ jsxs22("div", { className: "pt-10 pb-2", children: [
3067
+ destinationChainId === sourceChainId ? /* @__PURE__ */ jsx37(
3068
+ DepositViaTransferForm,
3069
+ {
3070
+ amount,
3071
+ setAmount,
3072
+ sourceChain,
3073
+ setSourceChainId
3074
+ }
3075
+ ) : /* @__PURE__ */ jsx37(
3076
+ DepositViaRelayForm,
3077
+ {
3078
+ amount,
3079
+ setAmount,
3080
+ sourceChain,
3081
+ setSourceChainId
3082
+ }
3083
+ ),
3084
+ /* @__PURE__ */ jsx37(Deposits, {})
3085
+ ] });
3086
+ }
3087
+
3088
+ // src/icons/ArrowLeftIcon.tsx
3089
+ import { jsx as jsx38 } from "react/jsx-runtime";
3090
+ function ArrowLeftIcon(props) {
3091
+ return /* @__PURE__ */ jsx38(IconSVG, { ...props, children: /* @__PURE__ */ jsx38(
3092
+ "path",
3093
+ {
3094
+ d: "M19 12H5M12 19l-7-7 7-7",
3095
+ fill: "none",
3096
+ stroke: "currentColor",
3097
+ strokeWidth: "2",
3098
+ strokeLinecap: "round",
3099
+ strokeLinejoin: "round"
3100
+ }
3101
+ ) });
3102
+ }
3103
+
3104
+ // src/onboarding/quarry/WithdrawGasBalanceButton.tsx
3105
+ import { getAction as getAction6 } from "viem/utils";
3106
+ import { waitForTransactionReceipt as waitForTransactionReceipt3 } from "viem/actions";
3107
+ import { useAccount as useAccount7, useClient as useClient12, useSwitchChain as useSwitchChain3, useWriteContract as useWriteContract2 } from "wagmi";
3108
+ import { twMerge as twMerge17 } from "tailwind-merge";
3109
+ import { useMutation as useMutation6 } from "@tanstack/react-query";
3110
+ import { useQueryClient as useQueryClient8 } from "@tanstack/react-query";
3111
+ import { jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
3112
+ function WithdrawGasBalanceButton({ userAddress }) {
3113
+ const { writeContractAsync } = useWriteContract2();
3114
+ const { switchChain } = useSwitchChain3();
3115
+ const { chain, chainId } = useEntryKitConfig();
3116
+ const { chainId: userChainId } = useAccount7();
3117
+ const queryClient = useQueryClient8();
3118
+ const client = useClient12({ chainId });
3119
+ const paymaster = getPaymaster(chain);
3120
+ const balance = useShowQueryError(useBalance(userAddress));
3121
+ const shouldSwitchChain = chainId != null && chainId !== userChainId;
3122
+ const withdraw = useMutation6({
3123
+ mutationKey: ["withdraw", userAddress],
3124
+ mutationFn: async () => {
3125
+ if (!client) throw new Error("Client not ready.");
3126
+ if (!paymaster) throw new Error("Paymaster not found");
3127
+ if (!balance.data) throw new Error("No gas balance to withdraw.");
3128
+ try {
3129
+ const hash = await writeContractAsync({
3130
+ address: paymaster.address,
3131
+ abi: paymasterAbi,
3132
+ functionName: "withdrawTo",
3133
+ args: [userAddress, balance.data],
3134
+ chainId
3135
+ });
3136
+ await getAction6(client, waitForTransactionReceipt3, "waitForTransactionReceipt")({ hash });
3137
+ await Promise.all([
3138
+ queryClient.invalidateQueries({ queryKey: ["balance"] }),
3139
+ queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] })
3140
+ ]);
3141
+ } catch (error2) {
3142
+ console.error("Error while withdrawing", error2);
3143
+ throw error2;
3144
+ }
3145
+ }
3146
+ });
3147
+ if (balance.data == null || balance.data === 0n) {
3148
+ return null;
3149
+ }
3150
+ return /* @__PURE__ */ jsx39(
3151
+ "button",
3152
+ {
3153
+ onClick: () => {
3154
+ if (shouldSwitchChain) {
3155
+ return switchChain({ chainId });
3156
+ }
3157
+ withdraw.mutate();
3158
+ },
3159
+ className: twMerge17(
3160
+ "text-sm font-medium text-white/50 group whitespace-nowrap",
3161
+ withdraw.isPending ? "opacity-50 pointer-events-none" : "cursor-pointer hover:text-white"
3162
+ ),
3163
+ disabled: withdraw.isPending,
3164
+ children: /* @__PURE__ */ jsxs23("span", { className: "inline-block", children: [
3165
+ /* @__PURE__ */ jsxs23(
3166
+ "span",
3167
+ {
3168
+ className: twMerge17(
3169
+ "inline-flex items-center gap-1 underline decoration-neutral-500 underline-offset-4",
3170
+ !withdraw.isPending && "hover:decoration-orange-500",
3171
+ shouldSwitchChain && "group-hover:hidden"
3172
+ ),
3173
+ children: [
3174
+ withdraw.isPending && /* @__PURE__ */ jsx39(PendingIcon, { className: "w-3 h-3" }),
3175
+ "Withdraw"
3176
+ ]
3177
+ }
3178
+ ),
3179
+ shouldSwitchChain && /* @__PURE__ */ jsx39("span", { className: "hidden group-hover:inline-block underline decoration-neutral-500 underline-offset-4 hover:decoration-orange-500", children: "Switch chain" })
3180
+ ] })
3181
+ }
3182
+ );
3183
+ }
3184
+
3185
+ // src/onboarding/quarry/GasBalance.tsx
3186
+ import { jsx as jsx40, jsxs as jsxs24 } from "react/jsx-runtime";
3187
+ function GasBalance2({ isActive, isExpanded, isFocused, setFocused, userAddress }) {
3188
+ const queryClient = useQueryClient9();
3189
+ const balance = useShowQueryError(useBalance(userAddress));
3190
+ const prevBalance = usePrevious(balance.data || 0n);
3191
+ useEffect14(() => {
3192
+ if (balance.data != null && prevBalance === 0n && balance.data > 0n) {
3193
+ queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
3194
+ setFocused(false);
3195
+ }
3196
+ }, [balance.data, prevBalance, setFocused, queryClient, userAddress]);
3197
+ if (isFocused) {
3198
+ return /* @__PURE__ */ jsxs24("div", { children: [
3199
+ isFocused && /* @__PURE__ */ jsx40("div", { className: "absolute top-0 left-0", children: /* @__PURE__ */ jsx40(
3200
+ "div",
3201
+ {
3202
+ className: "flex items-center justify-center w-10 h-10 text-white/20 hover:text-white/40 cursor-pointer",
3203
+ onClick: () => setFocused(false),
3204
+ children: /* @__PURE__ */ jsx40(ArrowLeftIcon, { className: "m-0" })
3205
+ }
3206
+ ) }),
3207
+ /* @__PURE__ */ jsx40(DepositFormContainer, {})
3208
+ ] });
3209
+ }
3210
+ return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-4", children: [
3211
+ /* @__PURE__ */ jsxs24("div", { className: "flex justify-between gap-4", children: [
3212
+ /* @__PURE__ */ jsxs24("div", { children: [
3213
+ /* @__PURE__ */ jsx40("div", { children: "Gas balance" }),
3214
+ /* @__PURE__ */ jsx40("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx40(Balance, { wei: balance.data }) : /* @__PURE__ */ jsx40(PendingIcon, { className: "text-sm" }) })
3215
+ ] }),
3216
+ /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-1 justify-center items-center", children: [
3217
+ /* @__PURE__ */ jsx40(
3218
+ Button,
3219
+ {
3220
+ variant: isActive ? "primary" : "tertiary",
3221
+ className: "flex-shrink-0 text-sm p-1 w-28",
3222
+ autoFocus: isActive || isExpanded,
3223
+ pending: balance.status === "pending",
3224
+ onClick: () => setFocused(true),
3225
+ children: "Top up"
3226
+ }
3227
+ ),
3228
+ /* @__PURE__ */ jsx40(WithdrawGasBalanceButton, { userAddress })
3229
+ ] })
3230
+ ] }),
3231
+ isExpanded ? /* @__PURE__ */ jsx40("p", { className: "text-sm", children: "Your gas balance is used to pay for onchain computation." }) : null
3232
+ ] });
3233
+ }
3234
+
3235
+ // src/onboarding/ConnectedSteps.tsx
3236
+ import { jsx as jsx41 } from "react/jsx-runtime";
3237
+ function ConnectedSteps({ userClient, initialUserAddress }) {
3238
+ const { chain } = useEntryKitConfig();
3239
+ const paymaster = getPaymaster(chain);
3240
+ const [focusedId, setFocusedId] = useState5(null);
3241
+ const userAddress = userClient.account.address;
3242
+ const { data: prerequisites, error: prerequisitesError } = usePrerequisites(userAddress);
3243
+ useEffect15(() => {
3244
+ if (prerequisitesError) {
3245
+ console.error("Could not get prerequisites", prerequisitesError);
3246
+ }
3247
+ }, [prerequisitesError]);
3248
+ const { closeAccountModal } = useAccountModal();
3249
+ const isNewConnection = userAddress !== initialUserAddress;
3250
+ const initialPrerequisites = useRef5(prerequisites);
3251
+ useEffect15(() => {
3252
+ if (prerequisites == null) return;
3253
+ if (initialPrerequisites.current == null) {
3254
+ initialPrerequisites.current = prerequisites;
3255
+ }
3256
+ if (prerequisites.complete) {
3257
+ if (isNewConnection || !initialPrerequisites.current.complete) {
3258
+ closeAccountModal();
3259
+ }
3260
+ }
3261
+ }, [closeAccountModal, isNewConnection, prerequisites]);
3262
+ const { sessionAddress, hasAllowance, isSpender, hasDelegation, hasGasBalance, hasQuarryGasBalance } = prerequisites ?? {};
3263
+ const steps = useMemo4(() => {
3264
+ if (!userAddress) {
3265
+ return [
3266
+ {
3267
+ id: "wallet",
3268
+ isComplete: false,
3269
+ content: () => null
3270
+ }
3271
+ ];
3272
+ }
3273
+ const steps2 = [
3274
+ {
3275
+ id: "wallet",
3276
+ isComplete: true,
3277
+ content: (props) => /* @__PURE__ */ jsx41(Wallet, { ...props, userAddress })
3278
+ }
3279
+ ];
3280
+ if (!paymaster) {
3281
+ if (sessionAddress != null) {
3282
+ steps2.push({
3283
+ id: "gasBalance",
3284
+ isComplete: !!hasGasBalance,
3285
+ content: (props) => /* @__PURE__ */ jsx41(GasBalance, { ...props, sessionAddress })
3286
+ });
3287
+ }
3288
+ } else if (paymaster.type === "quarry") {
3289
+ if (paymaster.isGasPass) {
3290
+ steps2.push({
3291
+ id: "allowance",
3292
+ isComplete: !!hasAllowance,
3293
+ content: (props) => /* @__PURE__ */ jsx41(Allowance, { ...props, userAddress })
3294
+ });
3295
+ } else {
3296
+ steps2.push({
3297
+ id: "gasBalanceQuarry",
3298
+ isComplete: !!hasQuarryGasBalance,
3299
+ content: (props) => /* @__PURE__ */ jsx41(GasBalance2, { ...props, userAddress })
3300
+ });
3301
+ }
3302
+ }
3303
+ steps2.push({
3304
+ id: "session",
3305
+ isComplete: !!isSpender && !!hasDelegation,
3306
+ content: (props) => /* @__PURE__ */ jsx41(Session, { ...props, userClient, registerSpender: !isSpender, registerDelegation: !hasDelegation })
3307
+ });
3308
+ return steps2;
3309
+ }, [
3310
+ hasAllowance,
3311
+ hasDelegation,
3312
+ hasGasBalance,
3313
+ hasQuarryGasBalance,
3314
+ isSpender,
3315
+ paymaster,
3316
+ sessionAddress,
3317
+ userAddress,
3318
+ userClient
3319
+ ]);
3320
+ const [selectedStepId] = useState5(null);
3321
+ const nextStep = steps.find((step) => step.content != null && !step.isComplete);
3322
+ const completedSteps = steps.filter((step) => step.isComplete);
3323
+ const activeStep = (selectedStepId != null ? steps.find((step) => step.id === selectedStepId) : null) ?? nextStep ?? (completedSteps.length < steps.length ? completedSteps.at(-1) : null);
3324
+ const activeStepIndex = activeStep ? steps.indexOf(activeStep) : -1;
3325
+ return /* @__PURE__ */ jsx41(
3326
+ "div",
3327
+ {
3328
+ className: twMerge18(
3329
+ "px-8 flex flex-col",
3330
+ "divide-y divide-neutral-800",
3331
+ "animate-in animate-duration-300 fade-in slide-in-from-bottom-8"
3332
+ ),
3333
+ children: steps.map((step, i) => {
3334
+ const isActive = step === activeStep;
3335
+ const isExpanded = isActive || completedSteps.length === steps.length;
3336
+ const isDisabled = !step.isComplete && activeStepIndex !== -1 && i > activeStepIndex;
3337
+ const isFocused = focusedId === step.id;
3338
+ const content = step.content({
3339
+ isActive,
3340
+ isExpanded,
3341
+ isFocused,
3342
+ setFocused: (focused) => setFocusedId(focused ? step.id : null)
3343
+ });
3344
+ if (focusedId) {
3345
+ if (step.id === focusedId) {
3346
+ return content;
3347
+ }
3348
+ return null;
3349
+ }
3350
+ return /* @__PURE__ */ jsx41("div", { className: twMerge18("py-8 flex flex-col justify-center", isActive ? "flex-grow" : null), children: /* @__PURE__ */ jsx41("div", { className: twMerge18("flex flex-col", isDisabled ? "opacity-30 pointer-events-none" : null), children: content }) }, step.id);
3351
+ })
3352
+ }
3353
+ );
3354
+ }
3355
+
3356
+ // src/AccountModalContent.tsx
3357
+ import { useRef as useRef6 } from "react";
3358
+ import { jsx as jsx42 } from "react/jsx-runtime";
3359
+ function AccountModalContent() {
3360
+ const { chainId } = useEntryKitConfig();
3361
+ const userClient = useConnectorClient({ chainId });
3362
+ const { address: userAddress } = useAccount8();
3363
+ const initialUserAddress = useRef6(userAddress);
3364
+ if (userClient.status !== "success") {
3365
+ return /* @__PURE__ */ jsx42(ConnectWallet, {});
3366
+ }
3367
+ return /* @__PURE__ */ jsx42(ConnectedSteps, { userClient: userClient.data, initialUserAddress: initialUserAddress.current });
3368
+ }
3369
+
2073
3370
  // src/AccountModal.tsx
3371
+ import { DialogClose } from "@radix-ui/react-dialog";
2074
3372
  import { ErrorBoundary } from "react-error-boundary";
2075
3373
 
2076
3374
  // src/errors/ErrorOverlay.tsx
2077
3375
  import { wait } from "@latticexyz/common/utils";
2078
- import { useEffect as useEffect9 } from "react";
2079
- import { twMerge as twMerge9 } from "tailwind-merge";
2080
- import { Fragment as Fragment2, jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
3376
+ import { useEffect as useEffect16 } from "react";
3377
+ import { twMerge as twMerge19 } from "tailwind-merge";
3378
+ import { Fragment as Fragment6, jsx as jsx43, jsxs as jsxs25 } from "react/jsx-runtime";
2081
3379
  function ErrorOverlay({ error: error2, retry, dismiss }) {
2082
- useEffect9(() => {
3380
+ useEffect16(() => {
2083
3381
  if (error2) {
2084
3382
  console.error(error2);
2085
3383
  }
2086
3384
  }, [error2]);
2087
- return /* @__PURE__ */ jsxs15("div", { className: "pointer-events-none absolute inset-0 overflow-clip", children: [
2088
- /* @__PURE__ */ jsx21(
3385
+ return /* @__PURE__ */ jsxs25("div", { className: "pointer-events-none absolute inset-0 overflow-clip", children: [
3386
+ /* @__PURE__ */ jsx43(
2089
3387
  "div",
2090
3388
  {
2091
- className: twMerge9(
3389
+ className: twMerge19(
2092
3390
  "absolute inset-0 bg-blue-700/60",
2093
3391
  "transition duration-300",
2094
3392
  error2 ? "opacity-100 pointer-events-auto" : "opacity-0"
2095
3393
  )
2096
3394
  }
2097
3395
  ),
2098
- /* @__PURE__ */ jsx21(
3396
+ /* @__PURE__ */ jsx43(
2099
3397
  "div",
2100
3398
  {
2101
- className: twMerge9(
3399
+ className: twMerge19(
2102
3400
  "absolute inset-0 pb-8",
2103
3401
  "transition duration-300",
2104
3402
  error2 ? "translate-y-0 opacity-100 pointer-events-auto" : "-translate-y-4 opacity-0"
2105
3403
  ),
2106
- children: error2 ? /* @__PURE__ */ jsx21(Fragment2, { children: /* @__PURE__ */ jsxs15("div", { className: "w-full max-h-full bg-blue-700 text-white/80 overflow-auto", children: [
2107
- /* @__PURE__ */ jsxs15("div", { className: "space-y-6 px-8 pt-8", children: [
2108
- /* @__PURE__ */ jsx21("div", { className: "text-white text-lg font-bold", children: "Oops! It broke :(" }),
2109
- /* @__PURE__ */ jsx21("div", { className: "font-mono text-xs whitespace-pre-wrap", children: error2.message.trim() }),
2110
- /* @__PURE__ */ jsx21("div", { className: "text-sm", children: "See the console for more info." })
3404
+ children: error2 ? /* @__PURE__ */ jsx43(Fragment6, { children: /* @__PURE__ */ jsxs25("div", { className: "w-full max-h-full bg-blue-700 text-white/80 overflow-auto", children: [
3405
+ /* @__PURE__ */ jsxs25("div", { className: "space-y-6 px-8 pt-8", children: [
3406
+ /* @__PURE__ */ jsx43("div", { className: "text-white text-lg font-bold", children: "Oops! It broke :(" }),
3407
+ /* @__PURE__ */ jsx43("div", { className: "font-mono text-xs whitespace-pre-wrap", children: error2.message.trim() }),
3408
+ /* @__PURE__ */ jsx43("div", { className: "text-sm", children: "See the console for more info." })
2111
3409
  ] }),
2112
- /* @__PURE__ */ jsxs15("div", { className: "pointer-events-none sticky bottom-0 left-0 -mt-2", children: [
2113
- /* @__PURE__ */ jsx21("div", { className: "w-full h-12 bg-gradient-to-b from-transparent to-blue-700" }),
2114
- retry ? /* @__PURE__ */ jsx21("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsxs15(
3410
+ /* @__PURE__ */ jsxs25("div", { className: "pointer-events-none sticky bottom-0 left-0 -mt-2", children: [
3411
+ /* @__PURE__ */ jsx43("div", { className: "w-full h-12 bg-gradient-to-b from-transparent to-blue-700" }),
3412
+ retry ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsxs25(
2115
3413
  "button",
2116
3414
  {
2117
3415
  type: "button",
2118
- className: twMerge9(
3416
+ className: twMerge19(
2119
3417
  "pointer-events-auto group w-24 p-1 -translate-y-2 transition",
2120
3418
  "bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
2121
3419
  "text-white text-sm font-medium",
@@ -2130,15 +3428,15 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
2130
3428
  }
2131
3429
  },
2132
3430
  children: [
2133
- /* @__PURE__ */ jsx21("span", { className: "group-aria-busy:hidden", children: "Retry" }),
2134
- /* @__PURE__ */ jsx21("span", { className: "hidden group-aria-busy:inline", children: "Retrying\u2026" })
3431
+ /* @__PURE__ */ jsx43("span", { className: "group-aria-busy:hidden", children: "Retry" }),
3432
+ /* @__PURE__ */ jsx43("span", { className: "hidden group-aria-busy:inline", children: "Retrying\u2026" })
2135
3433
  ]
2136
3434
  }
2137
- ) }) : dismiss ? /* @__PURE__ */ jsx21("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsx21(
3435
+ ) }) : dismiss ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsx43(
2138
3436
  "button",
2139
3437
  {
2140
3438
  type: "button",
2141
- className: twMerge9(
3439
+ className: twMerge19(
2142
3440
  "pointer-events-auto group w-24 p-1 -translate-y-2 transition",
2143
3441
  "bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
2144
3442
  "text-white text-sm font-medium",
@@ -2156,27 +3454,27 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
2156
3454
  }
2157
3455
 
2158
3456
  // src/errors/ErrorFallback.tsx
2159
- import { jsx as jsx22 } from "react/jsx-runtime";
3457
+ import { jsx as jsx44 } from "react/jsx-runtime";
2160
3458
  function ErrorFallback({ error: error2, resetErrorBoundary }) {
2161
- return /* @__PURE__ */ jsx22("div", { className: "h-64", children: /* @__PURE__ */ jsx22(ErrorOverlay, { error: error2, retry: resetErrorBoundary }) });
3459
+ return /* @__PURE__ */ jsx44("div", { className: "h-64", children: /* @__PURE__ */ jsx44(ErrorOverlay, { error: error2, retry: resetErrorBoundary }) });
2162
3460
  }
2163
3461
 
2164
3462
  // src/errors/ErrorsOverlay.tsx
2165
- import { useStore as useStore2 } from "zustand";
2166
- import { jsx as jsx23 } from "react/jsx-runtime";
3463
+ import { useStore as useStore3 } from "zustand";
3464
+ import { jsx as jsx45 } from "react/jsx-runtime";
2167
3465
  function ErrorsOverlay() {
2168
- const error2 = useStore2(store3, (state) => state.errors.at(0));
2169
- return /* @__PURE__ */ jsx23(ErrorOverlay, { error: error2?.error, retry: error2?.retry, dismiss: error2?.dismiss });
3466
+ const error2 = useStore3(store3, (state) => state.errors.at(0));
3467
+ return /* @__PURE__ */ jsx45(ErrorOverlay, { error: error2?.error, retry: error2?.retry, dismiss: error2?.dismiss });
2170
3468
  }
2171
3469
 
2172
3470
  // src/AccountModal.tsx
2173
- import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
3471
+ import { jsx as jsx46, jsxs as jsxs26 } from "react/jsx-runtime";
2174
3472
  function AccountModal() {
2175
3473
  const { accountModalOpen, toggleAccountModal } = useAccountModal();
2176
- return /* @__PURE__ */ jsx24(Modal, { open: accountModalOpen, onOpenChange: toggleAccountModal, children: accountModalOpen ? /* @__PURE__ */ jsxs16(
3474
+ return /* @__PURE__ */ jsx46(Modal, { open: accountModalOpen, onOpenChange: toggleAccountModal, children: accountModalOpen ? /* @__PURE__ */ jsxs26(
2177
3475
  "div",
2178
3476
  {
2179
- className: twMerge10(
3477
+ className: twMerge20(
2180
3478
  "relative py-2 ring-1",
2181
3479
  "bg-neutral-900 text-neutral-400 ring-neutral-700/50",
2182
3480
  "links:font-medium links:underline links:underline-offset-4",
@@ -2184,11 +3482,11 @@ function AccountModal() {
2184
3482
  "links:decoration-neutral-500 hover:links:decoration-orange-500"
2185
3483
  ),
2186
3484
  children: [
2187
- /* @__PURE__ */ jsxs16(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [
2188
- /* @__PURE__ */ jsx24(AccountModalContent, {}),
2189
- /* @__PURE__ */ jsx24(ErrorsOverlay, {})
3485
+ /* @__PURE__ */ jsxs26(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [
3486
+ /* @__PURE__ */ jsx46(AccountModalContent, {}),
3487
+ /* @__PURE__ */ jsx46(ErrorsOverlay, {})
2190
3488
  ] }),
2191
- /* @__PURE__ */ jsxs16(
3489
+ /* @__PURE__ */ jsxs26(
2192
3490
  "a",
2193
3491
  {
2194
3492
  href: "https://mud.dev",
@@ -2196,20 +3494,20 @@ function AccountModal() {
2196
3494
  rel: "noreferrer noopener",
2197
3495
  className: "group self-center p-3 flex items-center justify-center gap-2 links-unset text-sm font-mono transition text-neutral-400 hover:text-white",
2198
3496
  children: [
2199
- /* @__PURE__ */ jsx24("span", { className: "block w-4 h-4", children: /* @__PURE__ */ jsx24(Logo, { className: "w-full h-full text-orange-500 group-hover:rotate-90 transition duration-300" }) }),
2200
- /* @__PURE__ */ jsx24("span", { children: "Powered by MUD" })
3497
+ /* @__PURE__ */ jsx46("span", { className: "block w-4 h-4", children: /* @__PURE__ */ jsx46(Logo, { className: "w-full h-full text-orange-500 group-hover:rotate-90 transition duration-300" }) }),
3498
+ /* @__PURE__ */ jsx46("span", { children: "Powered by MUD" })
2201
3499
  ]
2202
3500
  }
2203
3501
  ),
2204
- /* @__PURE__ */ jsx24("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ jsx24(
3502
+ /* @__PURE__ */ jsx46("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ jsx46(
2205
3503
  DialogClose,
2206
3504
  {
2207
- className: twMerge10(
3505
+ className: twMerge20(
2208
3506
  "pointer-events-auto leading-none p-2 transition",
2209
3507
  "text-white/20 hover:text-white/40"
2210
3508
  ),
2211
3509
  title: "Close",
2212
- children: /* @__PURE__ */ jsx24(CloseIcon, { className: "m-0" })
3510
+ children: /* @__PURE__ */ jsx46(CloseIcon, { className: "m-0" })
2213
3511
  }
2214
3512
  ) })
2215
3513
  ]
@@ -2218,31 +3516,31 @@ function AccountModal() {
2218
3516
  }
2219
3517
 
2220
3518
  // src/EntryKitProvider.tsx
2221
- import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
3519
+ import { jsx as jsx47, jsxs as jsxs27 } from "react/jsx-runtime";
2222
3520
  function EntryKitProvider({ config, children }) {
2223
- return /* @__PURE__ */ jsxs17(EntryKitConfigProvider, { config, children: [
3521
+ return /* @__PURE__ */ jsxs27(EntryKitConfigProvider, { config, children: [
2224
3522
  children,
2225
- /* @__PURE__ */ jsx25(AccountModal, {})
3523
+ /* @__PURE__ */ jsx47(AccountModal, {})
2226
3524
  ] });
2227
3525
  }
2228
3526
 
2229
3527
  // src/AccountButton.tsx
2230
- import { useAccount as useAccount3 } from "wagmi";
2231
- import { twMerge as twMerge12 } from "tailwind-merge";
3528
+ import { useAccount as useAccount9 } from "wagmi";
3529
+ import { twMerge as twMerge22 } from "tailwind-merge";
2232
3530
 
2233
3531
  // src/AccountName.tsx
2234
- import { twMerge as twMerge11 } from "tailwind-merge";
2235
- import { Fragment as Fragment3, jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
3532
+ import { twMerge as twMerge21 } from "tailwind-merge";
3533
+ import { Fragment as Fragment7, jsx as jsx48, jsxs as jsxs28 } from "react/jsx-runtime";
2236
3534
  function AccountName({ address }) {
2237
3535
  const { data: ens } = useENS(address);
2238
3536
  const avatar = usePreloadImage(ens?.avatar);
2239
- return /* @__PURE__ */ jsxs18(Fragment3, { children: [
2240
- /* @__PURE__ */ jsxs18("span", { className: "flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center", children: [
2241
- /* @__PURE__ */ jsx26(
3537
+ return /* @__PURE__ */ jsxs28(Fragment7, { children: [
3538
+ /* @__PURE__ */ jsxs28("span", { className: "flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center", children: [
3539
+ /* @__PURE__ */ jsx48(
2242
3540
  "img",
2243
3541
  {
2244
3542
  src: ens?.avatar && avatar.isSuccess ? ens.avatar : void 0,
2245
- className: twMerge11(
3543
+ className: twMerge21(
2246
3544
  "col-start-1 row-start-1",
2247
3545
  "inline-flex w-full h-full rounded-full bg-black/10 dark:bg-white/10 bg-cover bg-no-repeat bg-center",
2248
3546
  "transtion duration-300",
@@ -2250,10 +3548,10 @@ function AccountName({ address }) {
2250
3548
  )
2251
3549
  }
2252
3550
  ),
2253
- /* @__PURE__ */ jsx26(
3551
+ /* @__PURE__ */ jsx48(
2254
3552
  Logo,
2255
3553
  {
2256
- className: twMerge11(
3554
+ className: twMerge21(
2257
3555
  "col-start-1 row-start-1 text-orange-500",
2258
3556
  "transition duration-300",
2259
3557
  ens && (!ens.avatar || avatar.isError) ? "opacity-100" : "opacity-0"
@@ -2261,29 +3559,29 @@ function AccountName({ address }) {
2261
3559
  }
2262
3560
  )
2263
3561
  ] }),
2264
- /* @__PURE__ */ jsx26("span", { className: "flex-grow", children: ens?.name ?? /* @__PURE__ */ jsx26(TruncatedHex, { hex: address }) })
3562
+ /* @__PURE__ */ jsx48("span", { className: "flex-grow", children: ens?.name ?? /* @__PURE__ */ jsx48(TruncatedHex, { hex: address }) })
2265
3563
  ] });
2266
3564
  }
2267
3565
 
2268
3566
  // src/AccountButton.tsx
2269
- import { useRef as useRef4 } from "react";
2270
- import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
2271
- var containerClassNames = twMerge12(
3567
+ import { useRef as useRef7 } from "react";
3568
+ import { jsx as jsx49, jsxs as jsxs29 } from "react/jsx-runtime";
3569
+ var containerClassNames = twMerge22(
2272
3570
  "w-48 p-3 inline-flex outline-none transition",
2273
3571
  "border border-transparent",
2274
3572
  "text-base leading-none"
2275
3573
  );
2276
- var secondaryClassNames = twMerge12(
3574
+ var secondaryClassNames = twMerge22(
2277
3575
  "bg-neutral-100 border-neutral-300 text-black",
2278
3576
  "dark:bg-neutral-800 dark:border-neutral-700 dark:text-white"
2279
3577
  );
2280
- var secondaryInteractiveClassNames = twMerge12(
3578
+ var secondaryInteractiveClassNames = twMerge22(
2281
3579
  "cursor-pointer outline-none hover:bg-neutral-200 data-[highlighted]:bg-neutral-200 dark:hover:bg-neutral-700"
2282
3580
  );
2283
3581
  function AccountButton() {
2284
3582
  const { openAccountModal, accountModalOpen } = useAccountModal();
2285
- const { status, address: userAddress } = useAccount3();
2286
- const initialUserAddress = useRef4(userAddress);
3583
+ const { status, address: userAddress } = useAccount9();
3584
+ const initialUserAddress = useRef7(userAddress);
2287
3585
  const prereqs = usePrerequisites(userAddress);
2288
3586
  const isConnected = status === "connected" || status === "reconnecting" && userAddress;
2289
3587
  const isNewConnection = userAddress !== initialUserAddress.current;
@@ -2295,20 +3593,20 @@ function AccountButton() {
2295
3593
  }
2296
3594
  return "Sign in";
2297
3595
  })();
2298
- return /* @__PURE__ */ jsx27(Shadow, { mode: "child", children: isSignedIn ? /* @__PURE__ */ jsx27(
3596
+ return /* @__PURE__ */ jsx49(Shadow, { mode: "child", children: isSignedIn ? /* @__PURE__ */ jsx49(
2299
3597
  "button",
2300
3598
  {
2301
3599
  type: "button",
2302
- className: twMerge12(containerClassNames, secondaryClassNames, secondaryInteractiveClassNames),
3600
+ className: twMerge22(containerClassNames, secondaryClassNames, secondaryInteractiveClassNames),
2303
3601
  onClick: openAccountModal,
2304
- children: /* @__PURE__ */ jsx27("span", { className: "flex-grow inline-flex gap-2.5 items-center text-left font-medium", children: userAddress ? /* @__PURE__ */ jsx27(AccountName, { address: userAddress }) : null })
3602
+ children: /* @__PURE__ */ jsx49("span", { className: "flex-grow inline-flex gap-2.5 items-center text-left font-medium", children: userAddress ? /* @__PURE__ */ jsx49(AccountName, { address: userAddress }) : null })
2305
3603
  },
2306
3604
  "connected"
2307
- ) : /* @__PURE__ */ jsxs19(
3605
+ ) : /* @__PURE__ */ jsxs29(
2308
3606
  "button",
2309
3607
  {
2310
3608
  type: "button",
2311
- className: twMerge12(
3609
+ className: twMerge22(
2312
3610
  containerClassNames,
2313
3611
  "group",
2314
3612
  "items-center justify-center gap-2.5",
@@ -2319,32 +3617,32 @@ function AccountButton() {
2319
3617
  "aria-busy": accountModalOpen,
2320
3618
  onClick: openAccountModal,
2321
3619
  children: [
2322
- /* @__PURE__ */ jsxs19("span", { className: "pointer-events-none inline-grid place-items-center -ml-3", children: [
2323
- /* @__PURE__ */ jsx27(
3620
+ /* @__PURE__ */ jsxs29("span", { className: "pointer-events-none inline-grid place-items-center -ml-3", children: [
3621
+ /* @__PURE__ */ jsx49(
2324
3622
  "span",
2325
3623
  {
2326
- className: twMerge12(
3624
+ className: twMerge22(
2327
3625
  "col-start-1 row-start-1 leading-none",
2328
3626
  "scale-100 opacity-100 transition duration-300",
2329
3627
  "group-aria-busy:scale-125 group-aria-busy:opacity-0"
2330
3628
  ),
2331
- children: /* @__PURE__ */ jsx27(Logo, {})
3629
+ children: /* @__PURE__ */ jsx49(Logo, {})
2332
3630
  }
2333
3631
  ),
2334
- /* @__PURE__ */ jsx27(
3632
+ /* @__PURE__ */ jsx49(
2335
3633
  "span",
2336
3634
  {
2337
3635
  "aria-hidden": true,
2338
- className: twMerge12(
3636
+ className: twMerge22(
2339
3637
  "col-start-1 row-start-1",
2340
3638
  "scale-50 opacity-0 transition duration-300 delay-50",
2341
3639
  "group-aria-busy:scale-100 group-aria-busy:opacity-100"
2342
3640
  ),
2343
- children: /* @__PURE__ */ jsx27(PendingIcon, {})
3641
+ children: /* @__PURE__ */ jsx49(PendingIcon, {})
2344
3642
  }
2345
3643
  )
2346
3644
  ] }),
2347
- /* @__PURE__ */ jsx27("span", { className: "font-medium", children: buttonLabel })
3645
+ /* @__PURE__ */ jsx49("span", { className: "font-medium", children: buttonLabel })
2348
3646
  ]
2349
3647
  },
2350
3648
  "sign in"
@@ -2366,44 +3664,379 @@ function useSessionClientReady() {
2366
3664
  }
2367
3665
 
2368
3666
  // src/createWagmiConfig.ts
2369
- import { connectorsForWallets } from "@rainbow-me/rainbowkit";
2370
3667
  import { createConfig } from "wagmi";
3668
+ import { getDefaultConfig } from "connectkit";
3669
+ import { injected, coinbaseWallet, safe } from "wagmi/connectors";
2371
3670
 
2372
- // src/getWallets.ts
2373
- import { getDefaultWallets } from "@rainbow-me/rainbowkit";
2374
- function getWallets(_config) {
2375
- const { wallets: defaultWallets } = getDefaultWallets();
2376
- return [
2377
- // TODO: passkey wallet
2378
- ...defaultWallets
2379
- ];
3671
+ // src/connectors/walletConnect.ts
3672
+ import { ChainNotConfiguredError, ProviderNotFoundError, createConnector } from "wagmi";
3673
+ import {
3674
+ SwitchChainError,
3675
+ UserRejectedRequestError,
3676
+ getAddress,
3677
+ numberToHex as numberToHex3
3678
+ } from "viem";
3679
+ walletConnect.type = "walletConnect";
3680
+ function walletConnect(parameters) {
3681
+ const isNewChainsStale = parameters.isNewChainsStale ?? true;
3682
+ let provider_;
3683
+ let providerPromise;
3684
+ const NAMESPACE = "eip155";
3685
+ let accountsChanged;
3686
+ let chainChanged;
3687
+ let connect;
3688
+ let displayUri;
3689
+ let sessionDelete;
3690
+ let disconnect;
3691
+ return createConnector((config) => ({
3692
+ id: "walletConnect",
3693
+ name: "WalletConnect",
3694
+ type: walletConnect.type,
3695
+ async setup() {
3696
+ const provider = await this.getProvider().catch(() => null);
3697
+ if (!provider) return;
3698
+ if (!connect) {
3699
+ connect = this.onConnect.bind(this);
3700
+ provider.on("connect", connect);
3701
+ }
3702
+ if (!sessionDelete) {
3703
+ sessionDelete = this.onSessionDelete.bind(this);
3704
+ provider.on("session_delete", sessionDelete);
3705
+ }
3706
+ },
3707
+ async connect({ chainId, ...rest } = {}) {
3708
+ try {
3709
+ const provider = await this.getProvider();
3710
+ if (!provider) throw new ProviderNotFoundError();
3711
+ if (!displayUri) {
3712
+ displayUri = this.onDisplayUri;
3713
+ provider.on("display_uri", displayUri);
3714
+ }
3715
+ let targetChainId = chainId;
3716
+ if (!targetChainId) {
3717
+ const state = await config.storage?.getItem("state") ?? {};
3718
+ const isChainSupported = config.chains.some((x) => x.id === state.chainId);
3719
+ if (isChainSupported) targetChainId = state.chainId;
3720
+ else targetChainId = config.chains[0]?.id;
3721
+ }
3722
+ if (!targetChainId) throw new Error("No chains found on connector.");
3723
+ const isChainsStale = await this.isChainsStale();
3724
+ if (provider.session && isChainsStale) await provider.disconnect();
3725
+ if (!provider.session || isChainsStale) {
3726
+ const optionalChains = config.chains.filter((chain) => chain.id !== targetChainId).map((optionalChain) => optionalChain.id);
3727
+ await provider.connect({
3728
+ optionalChains: [targetChainId, ...optionalChains],
3729
+ ..."pairingTopic" in rest ? { pairingTopic: rest.pairingTopic } : {}
3730
+ });
3731
+ this.setRequestedChainsIds(config.chains.map((x) => x.id));
3732
+ }
3733
+ const accounts = (await provider.enable()).map((x) => getAddress(x));
3734
+ let currentChainId = await this.getChainId();
3735
+ if (chainId && currentChainId !== chainId) {
3736
+ const chain = await this.switchChain({ chainId }).catch((error2) => {
3737
+ if (error2.code === UserRejectedRequestError.code) throw error2;
3738
+ return { id: currentChainId };
3739
+ });
3740
+ currentChainId = chain?.id ?? currentChainId;
3741
+ }
3742
+ if (displayUri) {
3743
+ provider.removeListener("display_uri", displayUri);
3744
+ displayUri = void 0;
3745
+ }
3746
+ if (connect) {
3747
+ provider.removeListener("connect", connect);
3748
+ connect = void 0;
3749
+ }
3750
+ if (!accountsChanged) {
3751
+ accountsChanged = this.onAccountsChanged.bind(this);
3752
+ provider.on("accountsChanged", accountsChanged);
3753
+ }
3754
+ if (!chainChanged) {
3755
+ chainChanged = this.onChainChanged.bind(this);
3756
+ provider.on("chainChanged", chainChanged);
3757
+ }
3758
+ if (!disconnect) {
3759
+ disconnect = this.onDisconnect.bind(this);
3760
+ provider.on("disconnect", disconnect);
3761
+ }
3762
+ if (!sessionDelete) {
3763
+ sessionDelete = this.onSessionDelete.bind(this);
3764
+ provider.on("session_delete", sessionDelete);
3765
+ }
3766
+ return { accounts, chainId: currentChainId };
3767
+ } catch (error2) {
3768
+ if (/(user rejected|connection request reset)/i.test(error2?.message)) {
3769
+ throw new UserRejectedRequestError(error2);
3770
+ }
3771
+ throw error2;
3772
+ }
3773
+ },
3774
+ async disconnect() {
3775
+ const provider = await this.getProvider();
3776
+ try {
3777
+ await provider?.disconnect();
3778
+ } catch (error2) {
3779
+ if (!/No matching key/i.test(error2.message)) throw error2;
3780
+ } finally {
3781
+ if (chainChanged) {
3782
+ provider?.removeListener("chainChanged", chainChanged);
3783
+ chainChanged = void 0;
3784
+ }
3785
+ if (disconnect) {
3786
+ provider?.removeListener("disconnect", disconnect);
3787
+ disconnect = void 0;
3788
+ }
3789
+ if (!connect) {
3790
+ connect = this.onConnect.bind(this);
3791
+ provider?.on("connect", connect);
3792
+ }
3793
+ if (accountsChanged) {
3794
+ provider?.removeListener("accountsChanged", accountsChanged);
3795
+ accountsChanged = void 0;
3796
+ }
3797
+ if (sessionDelete) {
3798
+ provider?.removeListener("session_delete", sessionDelete);
3799
+ sessionDelete = void 0;
3800
+ }
3801
+ this.setRequestedChainsIds([]);
3802
+ }
3803
+ },
3804
+ async getAccounts() {
3805
+ const provider = await this.getProvider();
3806
+ return provider.accounts.map((x) => getAddress(x));
3807
+ },
3808
+ async getProvider() {
3809
+ async function initProvider() {
3810
+ const optionalChains = config.chains.map((x) => x.id);
3811
+ if (!optionalChains.length) return;
3812
+ const { EthereumProvider } = await import("@walletconnect/ethereum-provider");
3813
+ return await EthereumProvider.init({
3814
+ ...parameters,
3815
+ disableProviderPing: true,
3816
+ optionalChains,
3817
+ projectId: parameters.projectId,
3818
+ rpcMap: Object.fromEntries(
3819
+ config.chains.map((chain) => {
3820
+ const [url] = extractRpcUrls({
3821
+ chain,
3822
+ transports: config.transports
3823
+ });
3824
+ return [chain.id, url];
3825
+ })
3826
+ ),
3827
+ showQrModal: parameters.showQrModal ?? true
3828
+ });
3829
+ }
3830
+ if (!provider_) {
3831
+ if (!providerPromise) providerPromise = initProvider();
3832
+ provider_ = await providerPromise;
3833
+ provider_?.events.setMaxListeners(Number.POSITIVE_INFINITY);
3834
+ }
3835
+ return provider_;
3836
+ },
3837
+ async getChainId() {
3838
+ const provider = await this.getProvider();
3839
+ return provider.chainId;
3840
+ },
3841
+ async isAuthorized() {
3842
+ try {
3843
+ const [accounts, provider] = await Promise.all([this.getAccounts(), this.getProvider()]);
3844
+ if (!accounts.length) return false;
3845
+ const isChainsStale = await this.isChainsStale();
3846
+ if (isChainsStale && provider.session) {
3847
+ await provider.disconnect().catch(() => {
3848
+ });
3849
+ return false;
3850
+ }
3851
+ return true;
3852
+ } catch {
3853
+ return false;
3854
+ }
3855
+ },
3856
+ async switchChain({ addEthereumChainParameter, chainId }) {
3857
+ const provider = await this.getProvider();
3858
+ if (!provider) throw new ProviderNotFoundError();
3859
+ const chain = config.chains.find((x) => x.id === chainId);
3860
+ if (!chain) throw new SwitchChainError(new ChainNotConfiguredError());
3861
+ try {
3862
+ await Promise.all([
3863
+ new Promise((resolve) => {
3864
+ const listener2 = ({ chainId: currentChainId }) => {
3865
+ if (currentChainId === chainId) {
3866
+ config.emitter.off("change", listener2);
3867
+ resolve();
3868
+ }
3869
+ };
3870
+ config.emitter.on("change", listener2);
3871
+ }),
3872
+ provider.request({
3873
+ method: "wallet_switchEthereumChain",
3874
+ params: [{ chainId: numberToHex3(chainId) }]
3875
+ })
3876
+ ]);
3877
+ const requestedChains = await this.getRequestedChainsIds();
3878
+ this.setRequestedChainsIds([...requestedChains, chainId]);
3879
+ return chain;
3880
+ } catch (err) {
3881
+ const error2 = err;
3882
+ if (/(user rejected)/i.test(error2.message)) throw new UserRejectedRequestError(error2);
3883
+ try {
3884
+ let blockExplorerUrls;
3885
+ if (addEthereumChainParameter?.blockExplorerUrls)
3886
+ blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls;
3887
+ else blockExplorerUrls = chain.blockExplorers?.default.url ? [chain.blockExplorers?.default.url] : [];
3888
+ let rpcUrls;
3889
+ if (addEthereumChainParameter?.rpcUrls?.length) rpcUrls = addEthereumChainParameter.rpcUrls;
3890
+ else rpcUrls = [...chain.rpcUrls.default.http];
3891
+ const addEthereumChain = {
3892
+ blockExplorerUrls,
3893
+ chainId: numberToHex3(chainId),
3894
+ chainName: addEthereumChainParameter?.chainName ?? chain.name,
3895
+ iconUrls: addEthereumChainParameter?.iconUrls,
3896
+ nativeCurrency: addEthereumChainParameter?.nativeCurrency ?? chain.nativeCurrency,
3897
+ rpcUrls
3898
+ };
3899
+ await provider.request({
3900
+ method: "wallet_addEthereumChain",
3901
+ params: [addEthereumChain]
3902
+ });
3903
+ const requestedChains = await this.getRequestedChainsIds();
3904
+ this.setRequestedChainsIds([...requestedChains, chainId]);
3905
+ return chain;
3906
+ } catch (error3) {
3907
+ throw new UserRejectedRequestError(error3);
3908
+ }
3909
+ }
3910
+ },
3911
+ onAccountsChanged(accounts) {
3912
+ if (accounts.length === 0) this.onDisconnect();
3913
+ else
3914
+ config.emitter.emit("change", {
3915
+ accounts: accounts.map((x) => getAddress(x))
3916
+ });
3917
+ },
3918
+ onChainChanged(chain) {
3919
+ const chainId = Number(chain);
3920
+ config.emitter.emit("change", { chainId });
3921
+ },
3922
+ async onConnect(connectInfo) {
3923
+ const chainId = Number(connectInfo.chainId);
3924
+ const accounts = await this.getAccounts();
3925
+ config.emitter.emit("connect", { accounts, chainId });
3926
+ },
3927
+ async onDisconnect(_error) {
3928
+ this.setRequestedChainsIds([]);
3929
+ config.emitter.emit("disconnect");
3930
+ const provider = await this.getProvider();
3931
+ if (accountsChanged) {
3932
+ provider.removeListener("accountsChanged", accountsChanged);
3933
+ accountsChanged = void 0;
3934
+ }
3935
+ if (chainChanged) {
3936
+ provider.removeListener("chainChanged", chainChanged);
3937
+ chainChanged = void 0;
3938
+ }
3939
+ if (disconnect) {
3940
+ provider.removeListener("disconnect", disconnect);
3941
+ disconnect = void 0;
3942
+ }
3943
+ if (sessionDelete) {
3944
+ provider.removeListener("session_delete", sessionDelete);
3945
+ sessionDelete = void 0;
3946
+ }
3947
+ if (!connect) {
3948
+ connect = this.onConnect.bind(this);
3949
+ provider.on("connect", connect);
3950
+ }
3951
+ },
3952
+ onDisplayUri(uri) {
3953
+ config.emitter.emit("message", { type: "display_uri", data: uri });
3954
+ },
3955
+ onSessionDelete() {
3956
+ this.onDisconnect();
3957
+ },
3958
+ getNamespaceChainsIds() {
3959
+ if (!provider_) return [];
3960
+ const chainIds = provider_.session?.namespaces[NAMESPACE]?.accounts?.map(
3961
+ (account) => Number.parseInt(account.split(":")[1] || "")
3962
+ );
3963
+ return chainIds ?? [];
3964
+ },
3965
+ async getRequestedChainsIds() {
3966
+ return await config.storage?.getItem(this.requestedChainsStorageKey) ?? [];
3967
+ },
3968
+ /**
3969
+ * Checks if the target chains match the chains that were
3970
+ * initially requested by the connector for the WalletConnect session.
3971
+ * If there is a mismatch, this means that the chains on the connector
3972
+ * are considered stale, and need to be revalidated at a later point (via
3973
+ * connection).
3974
+ *
3975
+ * There may be a scenario where a dapp adds a chain to the
3976
+ * connector later on, however, this chain will not have been approved or rejected
3977
+ * by the wallet. In this case, the chain is considered stale.
3978
+ */
3979
+ async isChainsStale() {
3980
+ if (!isNewChainsStale) return false;
3981
+ const connectorChains = config.chains.map((x) => x.id);
3982
+ const namespaceChains = this.getNamespaceChainsIds();
3983
+ if (namespaceChains.length && !namespaceChains.some((id) => connectorChains.includes(id))) return false;
3984
+ const requestedChains = await this.getRequestedChainsIds();
3985
+ return !connectorChains.every((id) => requestedChains.includes(id));
3986
+ },
3987
+ async setRequestedChainsIds(chains) {
3988
+ await config.storage?.setItem(this.requestedChainsStorageKey, chains);
3989
+ },
3990
+ get requestedChainsStorageKey() {
3991
+ return `${this.id}.requestedChains`;
3992
+ }
3993
+ }));
3994
+ }
3995
+ function extractRpcUrls(parameters) {
3996
+ const { chain } = parameters;
3997
+ const fallbackUrl = chain.rpcUrls.default.http[0];
3998
+ if (!parameters.transports) return [fallbackUrl];
3999
+ const transport = parameters.transports?.[chain.id]?.({ chain });
4000
+ const transports = transport?.value?.transports || [transport];
4001
+ return transports.map(({ value }) => value?.url || fallbackUrl);
2380
4002
  }
2381
4003
 
2382
4004
  // src/createWagmiConfig.ts
2383
4005
  function createWagmiConfig(config) {
2384
- const wallets = getWallets(config);
2385
- const connectors = connectorsForWallets(wallets, {
2386
- appName: config.appName,
2387
- projectId: config.walletConnectProjectId
2388
- });
2389
- return createConfig({
2390
- connectors,
4006
+ const connectors = [];
4007
+ const shouldUseSafeConnector = !(typeof window === "undefined") && window?.parent !== window;
4008
+ if (shouldUseSafeConnector) {
4009
+ connectors.push(
4010
+ safe({
4011
+ allowedDomains: [/gnosis-safe.io$/, /app.safe.global$/]
4012
+ })
4013
+ );
4014
+ }
4015
+ connectors.push(
4016
+ injected({ target: "metaMask" }),
4017
+ coinbaseWallet({
4018
+ appName: config.appName,
4019
+ overrideIsMetaMask: false
4020
+ })
4021
+ );
4022
+ if (config.walletConnectProjectId) {
4023
+ connectors.push(
4024
+ walletConnect({
4025
+ showQrModal: false,
4026
+ projectId: config.walletConnectProjectId
4027
+ })
4028
+ );
4029
+ }
4030
+ const configParams = getDefaultConfig({
2391
4031
  chains: config.chains,
2392
4032
  transports: config.transports,
2393
- pollingInterval: config.pollingInterval
2394
- });
2395
- }
2396
-
2397
- // src/getConnectors.ts
2398
- import { connectorsForWallets as connectorsForWallets2 } from "@rainbow-me/rainbowkit";
2399
- function getConnectors({
2400
- wallets,
2401
- ...config
2402
- }) {
2403
- return connectorsForWallets2(wallets ?? getWallets(config), {
4033
+ pollingInterval: config.pollingInterval,
2404
4034
  appName: config.appName,
2405
- projectId: config.walletConnectProjectId
4035
+ walletConnectProjectId: config.walletConnectProjectId,
4036
+ enableFamily: false,
4037
+ connectors
2406
4038
  });
4039
+ return createConfig(configParams);
2407
4040
  }
2408
4041
 
2409
4042
  // src/validateSigner.ts
@@ -2454,8 +4087,6 @@ export {
2454
4087
  EntryKitProvider,
2455
4088
  createWagmiConfig,
2456
4089
  defineConfig,
2457
- getConnectors,
2458
- getWallets,
2459
4090
  internal_validateSigner,
2460
4091
  useAccountModal,
2461
4092
  useEntryKitConfig,