@latticexyz/entrykit 2.2.22-725f1aed27b397ad153bec254b2530eb20d2d743 → 2.2.22-7382971451b731dc451a2a3834bb20c5c7756917
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.-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\\.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-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\\.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.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-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\\/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-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\\: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\\: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';
|
|
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";
|
|
@@ -139,8 +139,11 @@ var debug2 = debug.extend("quarry");
|
|
|
139
139
|
|
|
140
140
|
// src/quarry/transports/userOpExecutor.ts
|
|
141
141
|
import { setBalance } from "viem/actions";
|
|
142
|
-
function userOpExecutor({
|
|
143
|
-
|
|
142
|
+
function userOpExecutor({
|
|
143
|
+
executor,
|
|
144
|
+
fallbackDefaultTransport
|
|
145
|
+
}) {
|
|
146
|
+
return (opts) => {
|
|
144
147
|
debug2("using a local user op executor", executor.account.address);
|
|
145
148
|
if (executor.chain.id === 31337) {
|
|
146
149
|
debug2("setting executor balance");
|
|
@@ -175,7 +178,9 @@ function userOpExecutor({ executor }) {
|
|
|
175
178
|
if (method === "eth_estimateUserOperationGas") {
|
|
176
179
|
return await estimateUserOperationGas(params);
|
|
177
180
|
}
|
|
178
|
-
|
|
181
|
+
debug2(`userOpExecutor: method "${method}" not overridden, falling back to fallback transport`);
|
|
182
|
+
const { request: fallbackRequest } = fallbackDefaultTransport(opts);
|
|
183
|
+
return fallbackRequest({ method, params });
|
|
179
184
|
};
|
|
180
185
|
return createTransport({
|
|
181
186
|
key: "userOpExecutor",
|
|
@@ -187,20 +192,27 @@ function userOpExecutor({ executor }) {
|
|
|
187
192
|
}
|
|
188
193
|
|
|
189
194
|
// src/getBundlerTransport.ts
|
|
195
|
+
import { wiresaw } from "@latticexyz/common/internal";
|
|
190
196
|
function getBundlerTransport(chain) {
|
|
197
|
+
if ("wiresaw" in chain.rpcUrls) {
|
|
198
|
+
return wiresaw();
|
|
199
|
+
}
|
|
191
200
|
const bundlerHttpUrl = chain.rpcUrls.bundler?.http[0];
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
chain,
|
|
195
|
-
transport: fallback([webSocket(), http()]),
|
|
196
|
-
account: privateKeyToAccount(keccak256(stringToHex("local user op executor"))),
|
|
197
|
-
pollingInterval: 10
|
|
198
|
-
}).extend(transactionQueue())
|
|
199
|
-
}) : null;
|
|
200
|
-
if (!bundlerTransport) {
|
|
201
|
-
throw new Error(`Chain ${chain.id} config did not include a bundler RPC URL.`);
|
|
201
|
+
if (bundlerHttpUrl) {
|
|
202
|
+
return http(bundlerHttpUrl);
|
|
202
203
|
}
|
|
203
|
-
|
|
204
|
+
if (chain.id === 31337) {
|
|
205
|
+
return userOpExecutor({
|
|
206
|
+
executor: createClient({
|
|
207
|
+
chain,
|
|
208
|
+
transport: fallback([webSocket(), http()]),
|
|
209
|
+
account: privateKeyToAccount(keccak256(stringToHex("local user op executor"))),
|
|
210
|
+
pollingInterval: 10
|
|
211
|
+
}).extend(transactionQueue()),
|
|
212
|
+
fallbackDefaultTransport: http()
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
throw new Error(`Chain ${chain.id} config did not include a bundler RPC URL.`);
|
|
204
216
|
}
|
|
205
217
|
|
|
206
218
|
// src/EntryKitConfigProvider.tsx
|
|
@@ -374,10 +386,10 @@ function useAccountModal() {
|
|
|
374
386
|
}
|
|
375
387
|
|
|
376
388
|
// src/AccountModal.tsx
|
|
377
|
-
import { twMerge as
|
|
389
|
+
import { twMerge as twMerge20 } from "tailwind-merge";
|
|
378
390
|
|
|
379
391
|
// src/AccountModalContent.tsx
|
|
380
|
-
import { useAccount as
|
|
392
|
+
import { useAccount as useAccount8, useConnectorClient } from "wagmi";
|
|
381
393
|
|
|
382
394
|
// src/ui/Button.tsx
|
|
383
395
|
import { twMerge as twMerge3 } from "tailwind-merge";
|
|
@@ -547,42 +559,16 @@ function ConnectWallet() {
|
|
|
547
559
|
|
|
548
560
|
// src/onboarding/ConnectedSteps.tsx
|
|
549
561
|
import { useEffect as useEffect15, useMemo as useMemo4, useRef as useRef5, useState as useState5 } from "react";
|
|
550
|
-
import { twMerge as
|
|
562
|
+
import { twMerge as twMerge18 } from "tailwind-merge";
|
|
551
563
|
|
|
552
564
|
// src/onboarding/usePrerequisites.ts
|
|
553
|
-
import { useClient as
|
|
554
|
-
import {
|
|
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
|
-
}
|
|
565
|
+
import { useClient as useClient7, useConfig as useConfig2 } from "wagmi";
|
|
566
|
+
import { queryOptions as queryOptions7, useQuery as useQuery8, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
578
567
|
|
|
579
|
-
// src/onboarding/quarry/
|
|
568
|
+
// src/onboarding/quarry/useSpender.ts
|
|
580
569
|
import { useClient } from "wagmi";
|
|
581
570
|
import { queryOptions, skipToken, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
582
571
|
|
|
583
|
-
// src/quarry/getAllowance.ts
|
|
584
|
-
import { numberToHex as numberToHex2 } from "viem";
|
|
585
|
-
|
|
586
572
|
// src/quarry/common.ts
|
|
587
573
|
import { defineStore } from "@latticexyz/store";
|
|
588
574
|
import { parseAbi } from "viem";
|
|
@@ -592,7 +578,8 @@ var paymasterAbi = parseAbi([
|
|
|
592
578
|
"error BalanceSystem_BalanceTooHigh(address user, uint256 balance, uint256 max)",
|
|
593
579
|
"error BalanceSystem_InsufficientBalance(address user, uint256 amount, uint256 balance)",
|
|
594
580
|
"function registerSpender(address spender)",
|
|
595
|
-
"function depositTo(address to) payable"
|
|
581
|
+
"function depositTo(address to) payable",
|
|
582
|
+
"function withdrawTo(address to, uint256 amount)"
|
|
596
583
|
]);
|
|
597
584
|
var paymasterConfig = defineStore({
|
|
598
585
|
namespaces: {
|
|
@@ -658,64 +645,36 @@ var paymasterConfig = defineStore({
|
|
|
658
645
|
});
|
|
659
646
|
var paymasterTables = paymasterConfig.namespaces.root.tables;
|
|
660
647
|
|
|
661
|
-
// src/quarry/
|
|
662
|
-
import { getRecord
|
|
663
|
-
import { getKeyTuple } from "@latticexyz/protocol-parser/internal";
|
|
664
|
-
import { setStorageAt } from "viem/actions";
|
|
665
|
-
async function getAllowance({ client, userAddress }) {
|
|
666
|
-
const paymaster = getPaymaster(client.chain);
|
|
667
|
-
if (paymaster?.type !== "quarry") return null;
|
|
668
|
-
const record = await getRecord(client, {
|
|
669
|
-
address: paymaster.address,
|
|
670
|
-
table: paymasterTables.Allowance,
|
|
671
|
-
key: { user: userAddress },
|
|
672
|
-
blockTag: "pending"
|
|
673
|
-
});
|
|
674
|
-
return record.allowance;
|
|
675
|
-
}
|
|
676
|
-
async function setAllowanceSlot({ client, userAddress, allowance }) {
|
|
677
|
-
const paymaster = getPaymaster(client.chain);
|
|
678
|
-
if (paymaster?.type !== "quarry") return;
|
|
679
|
-
const slot = getStaticDataLocation(
|
|
680
|
-
paymasterTables.Allowance.tableId,
|
|
681
|
-
getKeyTuple(paymasterTables.Allowance, { user: userAddress })
|
|
682
|
-
);
|
|
683
|
-
await setStorageAt(
|
|
684
|
-
client.extend(() => ({ mode: "anvil" })),
|
|
685
|
-
{
|
|
686
|
-
address: paymaster.address,
|
|
687
|
-
index: slot,
|
|
688
|
-
value: numberToHex2(allowance, { size: 32 })
|
|
689
|
-
}
|
|
690
|
-
);
|
|
691
|
-
}
|
|
648
|
+
// src/onboarding/quarry/getSpender.ts
|
|
649
|
+
import { getRecord } from "@latticexyz/store/internal";
|
|
692
650
|
|
|
693
|
-
// src/
|
|
694
|
-
function
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
651
|
+
// src/getPaymaster.ts
|
|
652
|
+
function getPaymaster(chain) {
|
|
653
|
+
const contracts = chain.contracts ?? {};
|
|
654
|
+
if ("quarryPaymaster" in contracts && contracts.quarryPaymaster != null) {
|
|
655
|
+
if ("address" in contracts.quarryPaymaster) {
|
|
656
|
+
return {
|
|
657
|
+
type: "quarry",
|
|
658
|
+
address: contracts.quarryPaymaster.address,
|
|
659
|
+
isGasPass: !!chain.rpcUrls.quarryPassIssuer?.http?.[0]
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
if ("paymaster" in contracts && contracts.paymaster != null) {
|
|
664
|
+
if ("address" in contracts.paymaster) {
|
|
665
|
+
return {
|
|
666
|
+
type: "simple",
|
|
667
|
+
address: contracts.paymaster.address
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
}
|
|
707
671
|
}
|
|
708
672
|
|
|
709
|
-
// src/onboarding/quarry/useSpender.ts
|
|
710
|
-
import { useClient as useClient2 } from "wagmi";
|
|
711
|
-
import { queryOptions as queryOptions2, skipToken as skipToken2, useQuery as useQuery3 } from "@tanstack/react-query";
|
|
712
|
-
|
|
713
673
|
// src/onboarding/quarry/getSpender.ts
|
|
714
|
-
import { getRecord as getRecord2 } from "@latticexyz/store/internal";
|
|
715
674
|
async function getSpender({ client, userAddress, sessionAddress }) {
|
|
716
675
|
const paymaster = getPaymaster(client.chain);
|
|
717
676
|
if (paymaster?.type !== "quarry") return null;
|
|
718
|
-
const record = await
|
|
677
|
+
const record = await getRecord(client, {
|
|
719
678
|
address: paymaster.address,
|
|
720
679
|
table: paymasterTables.Spender,
|
|
721
680
|
key: { spender: sessionAddress },
|
|
@@ -730,18 +689,18 @@ function getSpenderQueryOptions({
|
|
|
730
689
|
userAddress,
|
|
731
690
|
sessionAddress
|
|
732
691
|
}) {
|
|
733
|
-
return
|
|
692
|
+
return queryOptions({
|
|
734
693
|
queryKey: ["getSpender", client?.uid, userAddress, sessionAddress],
|
|
735
|
-
queryFn: client && userAddress && sessionAddress ? () => getSpender({ client, userAddress, sessionAddress }) :
|
|
694
|
+
queryFn: client && userAddress && sessionAddress ? () => getSpender({ client, userAddress, sessionAddress }) : skipToken
|
|
736
695
|
});
|
|
737
696
|
}
|
|
738
697
|
|
|
739
698
|
// src/onboarding/useDelegation.ts
|
|
740
|
-
import { useClient as
|
|
741
|
-
import { queryOptions as
|
|
699
|
+
import { useClient as useClient2 } from "wagmi";
|
|
700
|
+
import { queryOptions as queryOptions2, skipToken as skipToken2, useQuery as useQuery3 } from "@tanstack/react-query";
|
|
742
701
|
|
|
743
702
|
// src/onboarding/getDelegation.ts
|
|
744
|
-
import { getRecord as
|
|
703
|
+
import { getRecord as getRecord2 } from "@latticexyz/store/internal";
|
|
745
704
|
|
|
746
705
|
// src/common.ts
|
|
747
706
|
import { resourceToHex } from "@latticexyz/common";
|
|
@@ -765,7 +724,7 @@ async function getDelegation({
|
|
|
765
724
|
// TODO: move everything to latest instead of pending
|
|
766
725
|
blockTag = "pending"
|
|
767
726
|
}) {
|
|
768
|
-
const record = await
|
|
727
|
+
const record = await getRecord2(client, {
|
|
769
728
|
address: worldAddress,
|
|
770
729
|
table: worldTables.UserDelegationControl,
|
|
771
730
|
key: { delegator: userAddress, delegatee: sessionAddress },
|
|
@@ -781,15 +740,15 @@ function getDelegationQueryOptions({
|
|
|
781
740
|
userAddress,
|
|
782
741
|
sessionAddress
|
|
783
742
|
}) {
|
|
784
|
-
return
|
|
743
|
+
return queryOptions2({
|
|
785
744
|
queryKey: ["getDelegation", client?.uid, worldAddress, userAddress, sessionAddress],
|
|
786
|
-
queryFn: client && userAddress && sessionAddress ? () => getDelegation({ client, worldAddress, userAddress, sessionAddress }) :
|
|
745
|
+
queryFn: client && userAddress && sessionAddress ? () => getDelegation({ client, worldAddress, userAddress, sessionAddress }) : skipToken2
|
|
787
746
|
});
|
|
788
747
|
}
|
|
789
748
|
|
|
790
749
|
// src/useSessionAccount.ts
|
|
791
|
-
import { useClient as
|
|
792
|
-
import { queryOptions as
|
|
750
|
+
import { useClient as useClient3 } from "wagmi";
|
|
751
|
+
import { queryOptions as queryOptions3, skipToken as skipToken3, useQuery as useQuery4 } from "@tanstack/react-query";
|
|
793
752
|
|
|
794
753
|
// src/getSessionAccount.ts
|
|
795
754
|
import { toSimpleSmartAccount } from "permissionless/accounts";
|
|
@@ -853,15 +812,73 @@ function getSessionAccountQueryOptions({
|
|
|
853
812
|
client,
|
|
854
813
|
userAddress
|
|
855
814
|
}) {
|
|
856
|
-
return
|
|
815
|
+
return queryOptions3({
|
|
857
816
|
queryKey: ["getSessionAccount", client?.uid, userAddress],
|
|
858
|
-
queryFn: client && userAddress ? () => getSessionAccount({ client, userAddress }) :
|
|
817
|
+
queryFn: client && userAddress ? () => getSessionAccount({ client, userAddress }) : skipToken3,
|
|
859
818
|
staleTime: Infinity,
|
|
860
819
|
// TODO: replace with function to retry only connection errors
|
|
861
820
|
retry: false
|
|
862
821
|
});
|
|
863
822
|
}
|
|
864
823
|
|
|
824
|
+
// src/useFunds.ts
|
|
825
|
+
import { useClient as useClient6, useConfig } from "wagmi";
|
|
826
|
+
import { getBalanceQueryOptions as getBalanceQueryOptions2 } from "wagmi/query";
|
|
827
|
+
import { queryOptions as queryOptions6, useQuery as useQuery7, useQueryClient } from "@tanstack/react-query";
|
|
828
|
+
|
|
829
|
+
// src/onboarding/quarry/useAllowance.ts
|
|
830
|
+
import { useClient as useClient4 } from "wagmi";
|
|
831
|
+
import { queryOptions as queryOptions4, skipToken as skipToken4, useQuery as useQuery5 } from "@tanstack/react-query";
|
|
832
|
+
|
|
833
|
+
// src/quarry/getAllowance.ts
|
|
834
|
+
import { numberToHex as numberToHex2 } from "viem";
|
|
835
|
+
import { getRecord as getRecord3, getStaticDataLocation } from "@latticexyz/store/internal";
|
|
836
|
+
import { getKeyTuple } from "@latticexyz/protocol-parser/internal";
|
|
837
|
+
import { setStorageAt } from "viem/actions";
|
|
838
|
+
async function getAllowance({ client, userAddress }) {
|
|
839
|
+
const paymaster = getPaymaster(client.chain);
|
|
840
|
+
if (paymaster?.type !== "quarry") return null;
|
|
841
|
+
const record = await getRecord3(client, {
|
|
842
|
+
address: paymaster.address,
|
|
843
|
+
table: paymasterTables.Allowance,
|
|
844
|
+
key: { user: userAddress },
|
|
845
|
+
blockTag: "pending"
|
|
846
|
+
});
|
|
847
|
+
return record.allowance;
|
|
848
|
+
}
|
|
849
|
+
async function setAllowanceSlot({ client, userAddress, allowance }) {
|
|
850
|
+
const paymaster = getPaymaster(client.chain);
|
|
851
|
+
if (paymaster?.type !== "quarry") return;
|
|
852
|
+
const slot = getStaticDataLocation(
|
|
853
|
+
paymasterTables.Allowance.tableId,
|
|
854
|
+
getKeyTuple(paymasterTables.Allowance, { user: userAddress })
|
|
855
|
+
);
|
|
856
|
+
await setStorageAt(
|
|
857
|
+
client.extend(() => ({ mode: "anvil" })),
|
|
858
|
+
{
|
|
859
|
+
address: paymaster.address,
|
|
860
|
+
index: slot,
|
|
861
|
+
value: numberToHex2(allowance, { size: 32 })
|
|
862
|
+
}
|
|
863
|
+
);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
// src/onboarding/quarry/useAllowance.ts
|
|
867
|
+
function getAllowanceQueryOptions({
|
|
868
|
+
client,
|
|
869
|
+
userAddress
|
|
870
|
+
}) {
|
|
871
|
+
return queryOptions4({
|
|
872
|
+
queryKey: ["getAllowance", client?.uid, userAddress],
|
|
873
|
+
queryFn: client && userAddress ? () => getAllowance({ client, userAddress }) : skipToken4
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
function useAllowance(userAddress) {
|
|
877
|
+
const { chainId } = useEntryKitConfig();
|
|
878
|
+
const client = useClient4({ chainId });
|
|
879
|
+
return useQuery5(getAllowanceQueryOptions({ client, userAddress }));
|
|
880
|
+
}
|
|
881
|
+
|
|
865
882
|
// src/onboarding/quarry/useBalance.ts
|
|
866
883
|
import { useClient as useClient5 } from "wagmi";
|
|
867
884
|
import { queryOptions as queryOptions5, skipToken as skipToken5, useQuery as useQuery6 } from "@tanstack/react-query";
|
|
@@ -896,6 +913,43 @@ function useBalance(userAddress) {
|
|
|
896
913
|
return useQuery6(getBalanceQueryOptions({ client, userAddress }));
|
|
897
914
|
}
|
|
898
915
|
|
|
916
|
+
// src/useFunds.ts
|
|
917
|
+
function getFundsQueryOptions({
|
|
918
|
+
queryClient,
|
|
919
|
+
config,
|
|
920
|
+
client,
|
|
921
|
+
userAddress
|
|
922
|
+
}) {
|
|
923
|
+
return queryOptions6({
|
|
924
|
+
queryKey: ["getFunds", client?.uid, userAddress],
|
|
925
|
+
queryFn: async () => {
|
|
926
|
+
if (!client) throw new Error("Viem client not ready.");
|
|
927
|
+
if (!userAddress) throw new Error("User not connected.");
|
|
928
|
+
const {
|
|
929
|
+
account: { address: sessionAddress }
|
|
930
|
+
} = await queryClient.fetchQuery(getSessionAccountQueryOptions({ client, userAddress }));
|
|
931
|
+
const [sessionBalance, paymasterAllowance, paymasterBalance] = await Promise.all([
|
|
932
|
+
queryClient.fetchQuery(getBalanceQueryOptions2(config, { chainId: client.chain.id, address: sessionAddress })),
|
|
933
|
+
queryClient.fetchQuery(getAllowanceQueryOptions({ client, userAddress })),
|
|
934
|
+
queryClient.fetchQuery(getBalanceQueryOptions({ client, userAddress }))
|
|
935
|
+
]);
|
|
936
|
+
return {
|
|
937
|
+
sessionBalance: sessionBalance?.value ?? null,
|
|
938
|
+
paymasterAllowance,
|
|
939
|
+
paymasterBalance
|
|
940
|
+
};
|
|
941
|
+
},
|
|
942
|
+
retry: false
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
function useFunds(userAddress) {
|
|
946
|
+
const queryClient = useQueryClient();
|
|
947
|
+
const config = useConfig();
|
|
948
|
+
const { chainId } = useEntryKitConfig();
|
|
949
|
+
const client = useClient6({ chainId });
|
|
950
|
+
return useQuery7(getFundsQueryOptions({ queryClient, config, client, userAddress }), queryClient);
|
|
951
|
+
}
|
|
952
|
+
|
|
899
953
|
// src/onboarding/usePrerequisites.ts
|
|
900
954
|
function getPrequisitesQueryOptions({
|
|
901
955
|
queryClient,
|
|
@@ -904,26 +958,23 @@ function getPrequisitesQueryOptions({
|
|
|
904
958
|
userAddress,
|
|
905
959
|
worldAddress
|
|
906
960
|
}) {
|
|
907
|
-
return
|
|
961
|
+
return queryOptions7({
|
|
908
962
|
queryKey: ["getPrerequisites", client?.uid, userAddress],
|
|
909
|
-
queryFn:
|
|
910
|
-
|
|
963
|
+
queryFn: async () => {
|
|
964
|
+
if (!client) throw new Error("Viem client not ready.");
|
|
965
|
+
if (!userAddress) throw new Error("User not connected.");
|
|
911
966
|
const {
|
|
912
967
|
account: { address: sessionAddress }
|
|
913
968
|
} = await queryClient.fetchQuery(getSessionAccountQueryOptions({ client, userAddress }));
|
|
914
|
-
const [
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
) : null,
|
|
918
|
-
paymaster?.type === "quarry" ? queryClient.fetchQuery(getAllowanceQueryOptions({ client, userAddress })) : null,
|
|
919
|
-
paymaster?.type === "quarry" ? queryClient.fetchQuery(getSpenderQueryOptions({ client, userAddress, sessionAddress })) : null,
|
|
920
|
-
paymaster?.type === "quarry" ? queryClient.fetchQuery(getBalanceQueryOptions({ client, userAddress })) : null,
|
|
969
|
+
const [funds, spender, hasDelegation] = await Promise.all([
|
|
970
|
+
queryClient.fetchQuery(getFundsQueryOptions({ queryClient, config, client, userAddress })),
|
|
971
|
+
queryClient.fetchQuery(getSpenderQueryOptions({ client, userAddress, sessionAddress })),
|
|
921
972
|
queryClient.fetchQuery(getDelegationQueryOptions({ client, worldAddress, userAddress, sessionAddress }))
|
|
922
973
|
]);
|
|
923
|
-
const hasAllowance =
|
|
974
|
+
const hasAllowance = funds.paymasterAllowance == null || funds.paymasterAllowance > 0n;
|
|
924
975
|
const isSpender = spender == null ? true : spender;
|
|
925
|
-
const hasGasBalance = sessionBalance == null || sessionBalance
|
|
926
|
-
const hasQuarryGasBalance =
|
|
976
|
+
const hasGasBalance = funds.sessionBalance == null || funds.sessionBalance > 0n;
|
|
977
|
+
const hasQuarryGasBalance = funds.paymasterBalance == null || funds.paymasterBalance > 0n;
|
|
927
978
|
return {
|
|
928
979
|
sessionAddress,
|
|
929
980
|
hasAllowance,
|
|
@@ -934,16 +985,16 @@ function getPrequisitesQueryOptions({
|
|
|
934
985
|
// we intentionally don't enforce an allowance/gas balance here
|
|
935
986
|
complete: isSpender && hasDelegation
|
|
936
987
|
};
|
|
937
|
-
}
|
|
988
|
+
},
|
|
938
989
|
retry: false
|
|
939
990
|
});
|
|
940
991
|
}
|
|
941
992
|
function usePrerequisites(userAddress) {
|
|
942
|
-
const queryClient =
|
|
943
|
-
const config =
|
|
993
|
+
const queryClient = useQueryClient2();
|
|
994
|
+
const config = useConfig2();
|
|
944
995
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
945
|
-
const client =
|
|
946
|
-
const prereqs =
|
|
996
|
+
const client = useClient7({ chainId });
|
|
997
|
+
const prereqs = useQuery8(
|
|
947
998
|
getPrequisitesQueryOptions({
|
|
948
999
|
queryClient,
|
|
949
1000
|
config,
|
|
@@ -960,10 +1011,10 @@ function usePrerequisites(userAddress) {
|
|
|
960
1011
|
import { useDisconnect } from "wagmi";
|
|
961
1012
|
|
|
962
1013
|
// src/useENS.ts
|
|
963
|
-
import { useQuery as
|
|
1014
|
+
import { useQuery as useQuery9 } from "@tanstack/react-query";
|
|
964
1015
|
function useENS(address) {
|
|
965
1016
|
const normalizedAddress = address?.toLowerCase();
|
|
966
|
-
return
|
|
1017
|
+
return useQuery9({
|
|
967
1018
|
enabled: !!normalizedAddress,
|
|
968
1019
|
queryKey: ["ens", normalizedAddress],
|
|
969
1020
|
queryFn: async () => {
|
|
@@ -1087,7 +1138,7 @@ import { parseEther as parseEther3 } from "viem";
|
|
|
1087
1138
|
|
|
1088
1139
|
// src/onboarding/quarry/useClaimGasPass.ts
|
|
1089
1140
|
import { parseEther as parseEther2 } from "viem";
|
|
1090
|
-
import { useMutation, useQueryClient as
|
|
1141
|
+
import { useMutation, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
|
|
1091
1142
|
|
|
1092
1143
|
// src/quarry/transports/quarryPassIssuer.ts
|
|
1093
1144
|
import { http as http2 } from "viem";
|
|
@@ -1116,11 +1167,11 @@ async function claimGasPass({ chain, userAddress }) {
|
|
|
1116
1167
|
}
|
|
1117
1168
|
|
|
1118
1169
|
// src/onboarding/quarry/useClaimGasPass.ts
|
|
1119
|
-
import { useClient as
|
|
1170
|
+
import { useClient as useClient8 } from "wagmi";
|
|
1120
1171
|
function useClaimGasPass() {
|
|
1121
|
-
const queryClient =
|
|
1172
|
+
const queryClient = useQueryClient3();
|
|
1122
1173
|
const { chain } = useEntryKitConfig();
|
|
1123
|
-
const client =
|
|
1174
|
+
const client = useClient8({ chainId: chain.id });
|
|
1124
1175
|
const mutationKey = ["claimGasPass", chain.id];
|
|
1125
1176
|
return useMutation({
|
|
1126
1177
|
retry: 0,
|
|
@@ -1134,6 +1185,7 @@ function useClaimGasPass() {
|
|
|
1134
1185
|
}
|
|
1135
1186
|
await Promise.all([
|
|
1136
1187
|
queryClient.invalidateQueries({ queryKey: ["getAllowance"] }),
|
|
1188
|
+
queryClient.invalidateQueries({ queryKey: ["getFunds"] }),
|
|
1137
1189
|
queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] })
|
|
1138
1190
|
]);
|
|
1139
1191
|
}
|
|
@@ -1166,8 +1218,12 @@ function EthIcon({ className, ...props }) {
|
|
|
1166
1218
|
import { formatEther } from "viem";
|
|
1167
1219
|
function formatBalance(wei) {
|
|
1168
1220
|
const formatted = formatEther(wei);
|
|
1169
|
-
const
|
|
1170
|
-
|
|
1221
|
+
const parsed = parseFloat(formatted);
|
|
1222
|
+
if (parsed > 0 && parsed < 1e-5) {
|
|
1223
|
+
return "<0.00001";
|
|
1224
|
+
}
|
|
1225
|
+
const magnitude = Math.floor(parsed).toString().length;
|
|
1226
|
+
return parsed.toLocaleString("en-US", { maximumFractionDigits: Math.max(0, 6 - magnitude) });
|
|
1171
1227
|
}
|
|
1172
1228
|
|
|
1173
1229
|
// src/ui/Balance.tsx
|
|
@@ -1236,7 +1292,7 @@ import { useEffect as useEffect7 } from "react";
|
|
|
1236
1292
|
|
|
1237
1293
|
// src/onboarding/useSetupSession.ts
|
|
1238
1294
|
import { encodeFunctionData } from "viem";
|
|
1239
|
-
import { useMutation as useMutation2, useQueryClient as
|
|
1295
|
+
import { useMutation as useMutation2, useQueryClient as useQueryClient4 } from "@tanstack/react-query";
|
|
1240
1296
|
import { getAction as getAction4 } from "viem/utils";
|
|
1241
1297
|
import { sendUserOperation as sendUserOperation2, waitForUserOperationReceipt } from "viem/account-abstraction";
|
|
1242
1298
|
import { waitForTransactionReceipt as waitForTransactionReceipt2 } from "viem/actions";
|
|
@@ -1247,7 +1303,7 @@ function defineCall(call) {
|
|
|
1247
1303
|
}
|
|
1248
1304
|
|
|
1249
1305
|
// src/onboarding/useSetupSession.ts
|
|
1250
|
-
import { useClient as
|
|
1306
|
+
import { useClient as useClient9 } from "wagmi";
|
|
1251
1307
|
import { resourceToHex as resourceToHex2 } from "@latticexyz/common";
|
|
1252
1308
|
import IBaseWorldAbi from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json";
|
|
1253
1309
|
|
|
@@ -1329,9 +1385,9 @@ async function callWithSignature({
|
|
|
1329
1385
|
// src/onboarding/useSetupSession.ts
|
|
1330
1386
|
import { systemsConfig as worldSystemsConfig } from "@latticexyz/world/mud.config";
|
|
1331
1387
|
function useSetupSession({ userClient }) {
|
|
1332
|
-
const queryClient =
|
|
1388
|
+
const queryClient = useQueryClient4();
|
|
1333
1389
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
1334
|
-
const client =
|
|
1390
|
+
const client = useClient9({ chainId });
|
|
1335
1391
|
const mutationKey = ["setupSession", client?.chain.id, userClient.account.address];
|
|
1336
1392
|
return useMutation2({
|
|
1337
1393
|
retry: 0,
|
|
@@ -1438,12 +1494,11 @@ function useSetupSession({ userClient }) {
|
|
|
1438
1494
|
}
|
|
1439
1495
|
|
|
1440
1496
|
// src/useSessionClient.ts
|
|
1441
|
-
import { useClient as
|
|
1497
|
+
import { useClient as useClient10 } from "wagmi";
|
|
1442
1498
|
import {
|
|
1443
|
-
queryOptions as
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
useQueryClient as useQueryClient4
|
|
1499
|
+
queryOptions as queryOptions8,
|
|
1500
|
+
useQuery as useQuery10,
|
|
1501
|
+
useQueryClient as useQueryClient5
|
|
1447
1502
|
} from "@tanstack/react-query";
|
|
1448
1503
|
|
|
1449
1504
|
// src/getSessionClient.ts
|
|
@@ -1527,9 +1582,10 @@ function getSessionClientQueryOptions({
|
|
|
1527
1582
|
userAddress,
|
|
1528
1583
|
worldAddress
|
|
1529
1584
|
}) {
|
|
1530
|
-
return
|
|
1585
|
+
return queryOptions8({
|
|
1531
1586
|
queryKey: ["getSessionClient", client?.uid, userAddress, worldAddress],
|
|
1532
|
-
queryFn:
|
|
1587
|
+
queryFn: async () => {
|
|
1588
|
+
if (!userAddress) throw new Error("User not connected.");
|
|
1533
1589
|
const { account: sessionAccount, signer: sessionSigner } = await queryClient.fetchQuery(
|
|
1534
1590
|
getSessionAccountQueryOptions({ client, userAddress })
|
|
1535
1591
|
);
|
|
@@ -1539,17 +1595,17 @@ function getSessionClientQueryOptions({
|
|
|
1539
1595
|
userAddress,
|
|
1540
1596
|
worldAddress
|
|
1541
1597
|
});
|
|
1542
|
-
}
|
|
1598
|
+
},
|
|
1543
1599
|
staleTime: Infinity,
|
|
1544
1600
|
// TODO: replace with function to retry only connection errors
|
|
1545
1601
|
retry: false
|
|
1546
1602
|
});
|
|
1547
1603
|
}
|
|
1548
1604
|
function useSessionClient(userAddress) {
|
|
1549
|
-
const queryClient =
|
|
1605
|
+
const queryClient = useQueryClient5();
|
|
1550
1606
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
1551
|
-
const client =
|
|
1552
|
-
return
|
|
1607
|
+
const client = useClient10({ chainId });
|
|
1608
|
+
return useQuery10(
|
|
1553
1609
|
getSessionClientQueryOptions({
|
|
1554
1610
|
queryClient,
|
|
1555
1611
|
client,
|
|
@@ -1618,7 +1674,7 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1618
1674
|
// src/onboarding/GasBalance.tsx
|
|
1619
1675
|
import { useEffect as useEffect9, useState as useState2 } from "react";
|
|
1620
1676
|
import { parseEther as parseEther4 } from "viem";
|
|
1621
|
-
import { useQueryClient as
|
|
1677
|
+
import { useQueryClient as useQueryClient7 } from "@tanstack/react-query";
|
|
1622
1678
|
import { useBalance as useBalance2, useWatchBlockNumber } from "wagmi";
|
|
1623
1679
|
|
|
1624
1680
|
// src/data/relayChains.json
|
|
@@ -1902,13 +1958,13 @@ var relayChains_default = {
|
|
|
1902
1958
|
};
|
|
1903
1959
|
|
|
1904
1960
|
// src/onboarding/useSetBalance.ts
|
|
1905
|
-
import { useQueryClient as
|
|
1961
|
+
import { useQueryClient as useQueryClient6, useMutation as useMutation3 } from "@tanstack/react-query";
|
|
1906
1962
|
import { setBalance as setBalance2 } from "viem/actions";
|
|
1907
|
-
import { useClient as
|
|
1963
|
+
import { useClient as useClient11 } from "wagmi";
|
|
1908
1964
|
function useSetBalance() {
|
|
1909
|
-
const queryClient =
|
|
1965
|
+
const queryClient = useQueryClient6();
|
|
1910
1966
|
const { chainId } = useEntryKitConfig();
|
|
1911
|
-
const client =
|
|
1967
|
+
const client = useClient11({ chainId });
|
|
1912
1968
|
return useMutation3({
|
|
1913
1969
|
retry: 0,
|
|
1914
1970
|
mutationKey: ["setBalance", chainId],
|
|
@@ -1917,6 +1973,7 @@ function useSetBalance() {
|
|
|
1917
1973
|
await setBalance2({ ...client, mode: "anvil" }, params);
|
|
1918
1974
|
await Promise.all([
|
|
1919
1975
|
queryClient.invalidateQueries({ queryKey: ["balance"] }),
|
|
1976
|
+
queryClient.invalidateQueries({ queryKey: ["getFunds"] }),
|
|
1920
1977
|
queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] })
|
|
1921
1978
|
]);
|
|
1922
1979
|
return null;
|
|
@@ -1986,7 +2043,7 @@ function CheckIcon(props) {
|
|
|
1986
2043
|
// src/onboarding/GasBalance.tsx
|
|
1987
2044
|
import { Fragment, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1988
2045
|
function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
1989
|
-
const queryClient =
|
|
2046
|
+
const queryClient = useQueryClient7();
|
|
1990
2047
|
const { chain } = useEntryKitConfig();
|
|
1991
2048
|
const [copied, setCopied] = useState2(false);
|
|
1992
2049
|
const balance = useShowQueryError(useBalance2({ chainId: chain.id, address: sessionAddress }));
|
|
@@ -2001,6 +2058,7 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
2001
2058
|
};
|
|
2002
2059
|
useEffect9(() => {
|
|
2003
2060
|
if (balance.data != null && prevBalance?.value === 0n && balance.data.value > 0n) {
|
|
2061
|
+
queryClient.invalidateQueries({ queryKey: ["getFunds"] });
|
|
2004
2062
|
queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
|
|
2005
2063
|
}
|
|
2006
2064
|
}, [balance.data, prevBalance, setBalance3, sessionAddress, queryClient]);
|
|
@@ -2072,6 +2130,10 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
2072
2130
|
] });
|
|
2073
2131
|
}
|
|
2074
2132
|
|
|
2133
|
+
// src/onboarding/quarry/GasBalance.tsx
|
|
2134
|
+
import { useEffect as useEffect14 } from "react";
|
|
2135
|
+
import { useQueryClient as useQueryClient10 } from "@tanstack/react-query";
|
|
2136
|
+
|
|
2075
2137
|
// src/onboarding/deposit/DepositFormContainer.tsx
|
|
2076
2138
|
import { useState as useState4 } from "react";
|
|
2077
2139
|
import { useChains as useChains4, useChainId } from "wagmi";
|
|
@@ -2079,17 +2141,17 @@ import { useChains as useChains4, useChainId } from "wagmi";
|
|
|
2079
2141
|
// src/onboarding/deposit/DepositViaTransferForm.tsx
|
|
2080
2142
|
import { useAccount as useAccount4, useWriteContract, usePrepareTransactionRequest, usePublicClient } from "wagmi";
|
|
2081
2143
|
import { encodeFunctionData as encodeFunctionData2 } from "viem";
|
|
2082
|
-
import { useMutation as useMutation4, useQuery as
|
|
2144
|
+
import { useMutation as useMutation4, useQuery as useQuery13 } from "@tanstack/react-query";
|
|
2083
2145
|
|
|
2084
2146
|
// src/onboarding/deposit/DepositForm.tsx
|
|
2085
2147
|
import { useEffect as useEffect11, useRef as useRef4 } from "react";
|
|
2086
|
-
import { useAccount as useAccount3, useBalance as
|
|
2148
|
+
import { useAccount as useAccount3, useBalance as useBalance4, useWatchBlockNumber as useWatchBlockNumber2 } from "wagmi";
|
|
2087
2149
|
import { useIsMounted } from "usehooks-ts";
|
|
2088
2150
|
import { twMerge as twMerge15 } from "tailwind-merge";
|
|
2089
2151
|
|
|
2090
2152
|
// src/onboarding/deposit/ChainSelect.tsx
|
|
2091
2153
|
import { useEffect as useEffect10, useMemo as useMemo2 } from "react";
|
|
2092
|
-
import {
|
|
2154
|
+
import { useSwitchChain } from "wagmi";
|
|
2093
2155
|
import { twMerge as twMerge12 } from "tailwind-merge";
|
|
2094
2156
|
import * as Select from "@radix-ui/react-select";
|
|
2095
2157
|
|
|
@@ -2162,37 +2224,29 @@ function Input({ asChild, className, ...props }) {
|
|
|
2162
2224
|
);
|
|
2163
2225
|
}
|
|
2164
2226
|
|
|
2165
|
-
// src/onboarding/deposit/ChainBalance.tsx
|
|
2166
|
-
import { useBalance as useBalance3 } from "wagmi";
|
|
2167
|
-
import { Fragment as Fragment2, jsx as jsx23 } from "react/jsx-runtime";
|
|
2168
|
-
function ChainBalance({ chainId, address }) {
|
|
2169
|
-
const balance = useBalance3({ chainId, address });
|
|
2170
|
-
return /* @__PURE__ */ jsx23(Fragment2, { children: balance.data ? /* @__PURE__ */ jsx23(Balance, { wei: balance.data.value }) : /* @__PURE__ */ jsx23(PendingIcon, {}) });
|
|
2171
|
-
}
|
|
2172
|
-
|
|
2173
2227
|
// src/onboarding/deposit/ChainIcon.tsx
|
|
2174
2228
|
import { twMerge as twMerge11 } from "tailwind-merge";
|
|
2175
2229
|
|
|
2176
2230
|
// src/onboarding/deposit/PreloadedImage.tsx
|
|
2177
2231
|
import { twMerge as twMerge10 } from "tailwind-merge";
|
|
2178
|
-
import { jsx as
|
|
2232
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
2179
2233
|
function PreloadedImage({ url, fallback: fallback2, className }) {
|
|
2180
2234
|
const { isSuccess, isLoading } = usePreloadImage(url);
|
|
2181
|
-
return /* @__PURE__ */
|
|
2235
|
+
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 });
|
|
2182
2236
|
}
|
|
2183
2237
|
|
|
2184
2238
|
// src/onboarding/deposit/ChainIcon.tsx
|
|
2185
2239
|
import { forwardRef as forwardRef2 } from "react";
|
|
2186
|
-
import { jsx as
|
|
2240
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2187
2241
|
var ChainIcon = forwardRef2(function ChainIcon2({ name, url, className }, forwardedRef) {
|
|
2188
|
-
return /* @__PURE__ */
|
|
2242
|
+
return /* @__PURE__ */ jsx24(
|
|
2189
2243
|
"span",
|
|
2190
2244
|
{
|
|
2191
2245
|
ref: forwardedRef,
|
|
2192
2246
|
className: twMerge11("flex-shrink-0 inline-flex w-6 aspect-square rounded-full overflow-clip", className),
|
|
2193
|
-
children: url ? /* @__PURE__ */
|
|
2247
|
+
children: url ? /* @__PURE__ */ jsx24(PreloadedImage, { url }) : (
|
|
2194
2248
|
// TODO: better placeholder
|
|
2195
|
-
/* @__PURE__ */
|
|
2249
|
+
/* @__PURE__ */ jsx24(
|
|
2196
2250
|
"span",
|
|
2197
2251
|
{
|
|
2198
2252
|
className: twMerge11(
|
|
@@ -2215,12 +2269,12 @@ import {
|
|
|
2215
2269
|
createClient as createClient2,
|
|
2216
2270
|
LogLevel
|
|
2217
2271
|
} from "@reservoir0x/relay-sdk";
|
|
2218
|
-
import { useQuery as
|
|
2272
|
+
import { useQuery as useQuery11 } from "@tanstack/react-query";
|
|
2219
2273
|
function useRelay() {
|
|
2220
2274
|
const { chain } = useEntryKitConfig();
|
|
2221
2275
|
const appOrigin = location.host;
|
|
2222
2276
|
const baseApiUrl = chain.testnet ? TESTNET_RELAY_API : MAINNET_RELAY_API;
|
|
2223
|
-
return
|
|
2277
|
+
return useQuery11({
|
|
2224
2278
|
queryKey: ["relayChains", baseApiUrl, appOrigin],
|
|
2225
2279
|
queryFn: async () => {
|
|
2226
2280
|
debug("fetching relay chains from", baseApiUrl);
|
|
@@ -2241,12 +2295,36 @@ function useRelay() {
|
|
|
2241
2295
|
});
|
|
2242
2296
|
}
|
|
2243
2297
|
|
|
2298
|
+
// src/onboarding/deposit/useChainBalances.ts
|
|
2299
|
+
import { useAccount, useConfig as useWagmiConfig } from "wagmi";
|
|
2300
|
+
import { getBalance as getBalance2 } from "wagmi/actions";
|
|
2301
|
+
import { useQuery as useQuery12, skipToken as skipToken6 } from "@tanstack/react-query";
|
|
2302
|
+
import { isNotNull } from "@latticexyz/common/utils";
|
|
2303
|
+
function useChainBalances({ chains }) {
|
|
2304
|
+
const { address: userAddress } = useAccount();
|
|
2305
|
+
const wagmiConfig = useWagmiConfig();
|
|
2306
|
+
const chainIds = chains.map((chain) => chain.id);
|
|
2307
|
+
return useQuery12({
|
|
2308
|
+
queryKey: ["chainBalances", chainIds, userAddress],
|
|
2309
|
+
queryFn: userAddress ? async () => {
|
|
2310
|
+
const chainBalances = await Promise.allSettled(
|
|
2311
|
+
chains.map(async (chain) => {
|
|
2312
|
+
const balance = await getBalance2(wagmiConfig, { chainId: chain.id, address: userAddress });
|
|
2313
|
+
return { chain, balance };
|
|
2314
|
+
})
|
|
2315
|
+
);
|
|
2316
|
+
return chainBalances.map((result) => result.status === "fulfilled" ? result.value : null).filter(isNotNull);
|
|
2317
|
+
} : skipToken6,
|
|
2318
|
+
refetchInterval: 1e3 * 60,
|
|
2319
|
+
retry: 1
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2244
2323
|
// src/onboarding/deposit/ChainSelect.tsx
|
|
2245
|
-
import { Fragment as
|
|
2324
|
+
import { Fragment as Fragment2, jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2246
2325
|
function ChainSelect({ value, onChange }) {
|
|
2247
2326
|
const theme = useTheme();
|
|
2248
2327
|
const { frame } = useFrame();
|
|
2249
|
-
const userAccount = useAccount();
|
|
2250
2328
|
const { chains, switchChain } = useSwitchChain();
|
|
2251
2329
|
const relay = useRelay();
|
|
2252
2330
|
const relayChains = relay.data?.chains;
|
|
@@ -2260,27 +2338,33 @@ function ChainSelect({ value, onChange }) {
|
|
|
2260
2338
|
}).filter((c) => c.relayChain);
|
|
2261
2339
|
}, [chains, relayChains]);
|
|
2262
2340
|
const selectedChain = sourceChains.find((c) => c.id === value);
|
|
2341
|
+
const { data: chainsBalances, isLoading } = useShowQueryError(useChainBalances({ chains: sourceChains }));
|
|
2342
|
+
const renderedChains = useMemo2(() => {
|
|
2343
|
+
if (!chainsBalances) return [];
|
|
2344
|
+
const chainsWithBalance = chainsBalances.filter(({ balance }) => balance.value > 0n).map(({ chain, balance }) => ({ chain, balance: balance.value }));
|
|
2345
|
+
return chainsWithBalance.length > 0 ? chainsWithBalance : sourceChains.map((chain) => ({ chain, balance: 0n }));
|
|
2346
|
+
}, [chainsBalances, sourceChains]);
|
|
2263
2347
|
useEffect10(() => {
|
|
2264
|
-
if (
|
|
2265
|
-
const defaultChain =
|
|
2348
|
+
if (renderedChains.length > 0 && (!selectedChain || !renderedChains.find((c) => c.chain.id === selectedChain?.id))) {
|
|
2349
|
+
const defaultChain = renderedChains[0].chain;
|
|
2266
2350
|
onChange(defaultChain.id);
|
|
2267
2351
|
switchChain({ chainId: defaultChain.id });
|
|
2268
2352
|
}
|
|
2269
|
-
}, [value, selectedChain,
|
|
2353
|
+
}, [value, selectedChain, renderedChains, onChange, switchChain]);
|
|
2270
2354
|
return /* @__PURE__ */ jsxs15(
|
|
2271
2355
|
Select.Root,
|
|
2272
2356
|
{
|
|
2273
2357
|
value: value.toString(),
|
|
2274
2358
|
onValueChange: (value2) => {
|
|
2275
2359
|
if (value2) {
|
|
2276
|
-
const chain =
|
|
2360
|
+
const chain = renderedChains.find((item) => item.chain.id.toString() === value2)?.chain;
|
|
2277
2361
|
if (!chain) throw new Error(`Unknown chain selected: ${value2}`);
|
|
2278
2362
|
onChange(chain.id);
|
|
2279
2363
|
}
|
|
2280
2364
|
},
|
|
2281
2365
|
children: [
|
|
2282
|
-
/* @__PURE__ */
|
|
2283
|
-
/* @__PURE__ */
|
|
2366
|
+
/* @__PURE__ */ jsx25(Input, { asChild: true, children: /* @__PURE__ */ jsxs15(Select.Trigger, { className: "group inline-flex items-center justify-center", children: [
|
|
2367
|
+
/* @__PURE__ */ jsx25(Select.Value, { asChild: true, children: /* @__PURE__ */ jsx25(
|
|
2284
2368
|
ChainIcon,
|
|
2285
2369
|
{
|
|
2286
2370
|
id: selectedChain?.id,
|
|
@@ -2289,40 +2373,45 @@ function ChainSelect({ value, onChange }) {
|
|
|
2289
2373
|
className: "w-8"
|
|
2290
2374
|
}
|
|
2291
2375
|
) }),
|
|
2292
|
-
/* @__PURE__ */
|
|
2293
|
-
/* @__PURE__ */
|
|
2294
|
-
/* @__PURE__ */
|
|
2376
|
+
/* @__PURE__ */ jsx25(Select.Icon, { asChild: true, children: /* @__PURE__ */ jsxs15(Fragment2, { children: [
|
|
2377
|
+
/* @__PURE__ */ jsx25(ChevronDownIcon, { className: "text-sm -mr-1 group-aria-expanded:hidden" }),
|
|
2378
|
+
/* @__PURE__ */ jsx25(ChevronUpIcon, { className: "text-sm -mr-1 hidden group-aria-expanded:inline" })
|
|
2295
2379
|
] }) })
|
|
2296
2380
|
] }) }),
|
|
2297
|
-
frame.contentDocument ? /* @__PURE__ */
|
|
2298
|
-
Select.
|
|
2381
|
+
frame.contentDocument ? /* @__PURE__ */ jsx25(Select.Portal, { container: frame.contentDocument.body, children: /* @__PURE__ */ jsx25(
|
|
2382
|
+
Select.Content,
|
|
2299
2383
|
{
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2384
|
+
position: "popper",
|
|
2385
|
+
className: "w-[352px] max-h-[230px] overflow-y-auto mt-1 animate-in fade-in slide-in-from-top-2",
|
|
2386
|
+
children: /* @__PURE__ */ jsx25(Select.Viewport, { children: /* @__PURE__ */ jsx25(
|
|
2387
|
+
Select.Group,
|
|
2388
|
+
{
|
|
2389
|
+
className: twMerge12(
|
|
2390
|
+
"flex flex-col border divide-y",
|
|
2391
|
+
"bg-neutral-800 text-neutral-300 border-neutral-700 divide-neutral-700"
|
|
2392
|
+
),
|
|
2393
|
+
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 }) => {
|
|
2394
|
+
return /* @__PURE__ */ jsxs15(
|
|
2395
|
+
Select.Item,
|
|
2396
|
+
{
|
|
2397
|
+
value: chain.id.toString(),
|
|
2398
|
+
className: twMerge12(
|
|
2399
|
+
"group flex p-2.5 gap-2.5 items-center cursor-pointer outline-none",
|
|
2400
|
+
"text-white focus:bg-neutral-700 data-[state=checked]:bg-neutral-900"
|
|
2401
|
+
),
|
|
2402
|
+
children: [
|
|
2403
|
+
/* @__PURE__ */ jsx25(ChainIcon, { id: chain.id, name: chain.name, url: chain.relayChain?.icon?.[theme] }),
|
|
2404
|
+
/* @__PURE__ */ jsx25("span", { className: "flex-grow flex-shrink-0", children: chain.name }),
|
|
2405
|
+
/* @__PURE__ */ jsx25("span", { className: "flex-shrink-0 font-mono text-sm text-neutral-400", children: /* @__PURE__ */ jsx25(Balance, { wei: balance }) })
|
|
2406
|
+
]
|
|
2407
|
+
},
|
|
2408
|
+
chain.id
|
|
2409
|
+
);
|
|
2410
|
+
})
|
|
2411
|
+
}
|
|
2412
|
+
) })
|
|
2324
2413
|
}
|
|
2325
|
-
) })
|
|
2414
|
+
) }) : null
|
|
2326
2415
|
]
|
|
2327
2416
|
}
|
|
2328
2417
|
);
|
|
@@ -2332,10 +2421,10 @@ function ChainSelect({ value, onChange }) {
|
|
|
2332
2421
|
import { formatEther as formatEther3, parseEther as parseEther5 } from "viem";
|
|
2333
2422
|
import { twMerge as twMerge13 } from "tailwind-merge";
|
|
2334
2423
|
import { forwardRef as forwardRef3 } from "react";
|
|
2335
|
-
import { jsx as
|
|
2424
|
+
import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2336
2425
|
var AmountInput = forwardRef3(function AmountInput2({ initialAmount, onChange }, forwardedRef) {
|
|
2337
|
-
return /* @__PURE__ */
|
|
2338
|
-
/* @__PURE__ */
|
|
2426
|
+
return /* @__PURE__ */ jsx26(Input, { asChild: true, className: "w-full cursor-text flex items-center", children: /* @__PURE__ */ jsxs16("label", { children: [
|
|
2427
|
+
/* @__PURE__ */ jsx26(
|
|
2339
2428
|
"input",
|
|
2340
2429
|
{
|
|
2341
2430
|
ref: forwardedRef,
|
|
@@ -2360,23 +2449,23 @@ var AmountInput = forwardRef3(function AmountInput2({ initialAmount, onChange },
|
|
|
2360
2449
|
}
|
|
2361
2450
|
}
|
|
2362
2451
|
),
|
|
2363
|
-
/* @__PURE__ */
|
|
2452
|
+
/* @__PURE__ */ jsx26("span", { className: twMerge13("flex-shrink-0 text-2xl", "peer-placeholder-shown:text-neutral-500"), children: /* @__PURE__ */ jsx26(EthIcon, {}) })
|
|
2364
2453
|
] }) });
|
|
2365
2454
|
});
|
|
2366
2455
|
|
|
2367
2456
|
// src/onboarding/deposit/SubmitButton.tsx
|
|
2368
|
-
import { useAccount as useAccount2, useBalance as
|
|
2457
|
+
import { useAccount as useAccount2, useBalance as useBalance3, useSwitchChain as useSwitchChain2 } from "wagmi";
|
|
2369
2458
|
import { twMerge as twMerge14 } from "tailwind-merge";
|
|
2370
2459
|
import { parseEther as parseEther6 } from "viem";
|
|
2371
|
-
import { jsx as
|
|
2460
|
+
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2372
2461
|
var MAX_DEPOSIT_AMOUNT = "0.1";
|
|
2373
2462
|
function SubmitButton({ amount, chainId, className, ...buttonProps }) {
|
|
2374
2463
|
const { chainId: userChainId, address: userAddress } = useAccount2();
|
|
2375
|
-
const { data: userBalance } =
|
|
2464
|
+
const { data: userBalance } = useBalance3({ address: userAddress });
|
|
2376
2465
|
const shouldSwitchChain = chainId != null && chainId !== userChainId;
|
|
2377
2466
|
const switchChain = useSwitchChain2();
|
|
2378
2467
|
if (shouldSwitchChain) {
|
|
2379
|
-
return /* @__PURE__ */
|
|
2468
|
+
return /* @__PURE__ */ jsx27(
|
|
2380
2469
|
Button,
|
|
2381
2470
|
{
|
|
2382
2471
|
type: "button",
|
|
@@ -2395,16 +2484,16 @@ function SubmitButton({ amount, chainId, className, ...buttonProps }) {
|
|
|
2395
2484
|
" ETH"
|
|
2396
2485
|
] });
|
|
2397
2486
|
} else if (amount > (userBalance?.value ?? 0n)) {
|
|
2398
|
-
return /* @__PURE__ */
|
|
2487
|
+
return /* @__PURE__ */ jsx27(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: "Insufficient balance" });
|
|
2399
2488
|
}
|
|
2400
2489
|
}
|
|
2401
|
-
return /* @__PURE__ */
|
|
2490
|
+
return /* @__PURE__ */ jsx27(Button, { type: "submit", className: twMerge14("w-full", className), ...buttonProps });
|
|
2402
2491
|
}
|
|
2403
2492
|
|
|
2404
2493
|
// src/icons/WarningIcon.tsx
|
|
2405
|
-
import { jsx as
|
|
2494
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2406
2495
|
function WarningIcon(props) {
|
|
2407
|
-
return /* @__PURE__ */
|
|
2496
|
+
return /* @__PURE__ */ jsx28(IconSVG, { fill: "none", ...props, children: /* @__PURE__ */ jsx28(
|
|
2408
2497
|
"path",
|
|
2409
2498
|
{
|
|
2410
2499
|
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",
|
|
@@ -2425,7 +2514,7 @@ function formatGas(wei) {
|
|
|
2425
2514
|
}
|
|
2426
2515
|
|
|
2427
2516
|
// src/onboarding/deposit/DepositForm.tsx
|
|
2428
|
-
import { Fragment as
|
|
2517
|
+
import { Fragment as Fragment3, jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2429
2518
|
function DepositForm({
|
|
2430
2519
|
sourceChain,
|
|
2431
2520
|
setSourceChainId,
|
|
@@ -2439,7 +2528,7 @@ function DepositForm({
|
|
|
2439
2528
|
const amountInputRef = useRef4(null);
|
|
2440
2529
|
const isMounted = useIsMounted();
|
|
2441
2530
|
const { address: userAddress, chainId: userChainId } = useAccount3();
|
|
2442
|
-
const balance = useShowQueryError(
|
|
2531
|
+
const balance = useShowQueryError(useBalance4({ chainId: sourceChain.id, address: userAddress }));
|
|
2443
2532
|
const quarryBalance = useShowQueryError(useBalance(userAddress));
|
|
2444
2533
|
useWatchBlockNumber2({
|
|
2445
2534
|
onBlockNumber: () => {
|
|
@@ -2474,8 +2563,8 @@ function DepositForm({
|
|
|
2474
2563
|
},
|
|
2475
2564
|
children: [
|
|
2476
2565
|
/* @__PURE__ */ jsxs18("div", { className: "flex gap-2", children: [
|
|
2477
|
-
/* @__PURE__ */
|
|
2478
|
-
/* @__PURE__ */
|
|
2566
|
+
/* @__PURE__ */ jsx29(ChainSelect, { value: sourceChain.id, onChange: setSourceChainId }),
|
|
2567
|
+
/* @__PURE__ */ jsx29(AmountInput, { ref: amountInputRef, initialAmount: amount, onChange: setAmount })
|
|
2479
2568
|
] }),
|
|
2480
2569
|
/* @__PURE__ */ jsxs18(
|
|
2481
2570
|
"dl",
|
|
@@ -2485,21 +2574,21 @@ function DepositForm({
|
|
|
2485
2574
|
"divide-neutral-700 text-neutral-400"
|
|
2486
2575
|
),
|
|
2487
2576
|
children: [
|
|
2488
|
-
/* @__PURE__ */
|
|
2489
|
-
/* @__PURE__ */
|
|
2490
|
-
/* @__PURE__ */
|
|
2491
|
-
/* @__PURE__ */
|
|
2492
|
-
/* @__PURE__ */
|
|
2493
|
-
/* @__PURE__ */
|
|
2577
|
+
/* @__PURE__ */ jsx29("dt", { children: "Available to deposit" }),
|
|
2578
|
+
/* @__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 }),
|
|
2579
|
+
/* @__PURE__ */ jsx29("dt", { children: "Gas balance after deposit" }),
|
|
2580
|
+
/* @__PURE__ */ jsx29("dd", { children: /* @__PURE__ */ jsx29(Balance, { wei: (quarryBalance.data ?? 0n) + (amount ?? 0n) }) }),
|
|
2581
|
+
/* @__PURE__ */ jsx29("dt", { children: "Estimated fee" }),
|
|
2582
|
+
/* @__PURE__ */ jsx29("dd", { children: estimatedFee.fee ? /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
2494
2583
|
formatGas(estimatedFee.fee),
|
|
2495
2584
|
" gwei"
|
|
2496
|
-
] }) : estimatedFee.error ? /* @__PURE__ */
|
|
2497
|
-
/* @__PURE__ */
|
|
2498
|
-
/* @__PURE__ */
|
|
2585
|
+
] }) : 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 }),
|
|
2586
|
+
/* @__PURE__ */ jsx29("dt", { children: "Time to deposit" }),
|
|
2587
|
+
/* @__PURE__ */ jsx29("dd", { children: estimatedTime })
|
|
2499
2588
|
]
|
|
2500
2589
|
}
|
|
2501
2590
|
),
|
|
2502
|
-
hasMinimumBalance ? submitButton : /* @__PURE__ */
|
|
2591
|
+
hasMinimumBalance ? submitButton : /* @__PURE__ */ jsx29(SubmitButton, { disabled: true, children: "Not enough funds" })
|
|
2503
2592
|
]
|
|
2504
2593
|
}
|
|
2505
2594
|
);
|
|
@@ -2553,7 +2642,7 @@ function useDeposits() {
|
|
|
2553
2642
|
}
|
|
2554
2643
|
|
|
2555
2644
|
// src/onboarding/deposit/DepositViaTransferForm.tsx
|
|
2556
|
-
import { jsx as
|
|
2645
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2557
2646
|
function DepositViaTransferForm({ amount, setAmount, sourceChain, setSourceChainId }) {
|
|
2558
2647
|
const { chain } = useEntryKitConfig();
|
|
2559
2648
|
const paymaster = getPaymaster(chain);
|
|
@@ -2564,7 +2653,7 @@ function DepositViaTransferForm({ amount, setAmount, sourceChain, setSourceChain
|
|
|
2564
2653
|
if (!userAddress) {
|
|
2565
2654
|
throw new Error("User address not found");
|
|
2566
2655
|
}
|
|
2567
|
-
const { data: gasPrice } =
|
|
2656
|
+
const { data: gasPrice } = useQuery13({
|
|
2568
2657
|
queryKey: ["gasPrice", sourceChain.id],
|
|
2569
2658
|
queryFn: async () => {
|
|
2570
2659
|
if (!publicClient) throw new Error("Public client not available");
|
|
@@ -2621,7 +2710,7 @@ function DepositViaTransferForm({ amount, setAmount, sourceChain, setSourceChain
|
|
|
2621
2710
|
}
|
|
2622
2711
|
});
|
|
2623
2712
|
const estimatedFee = prepareData?.gas && gasPrice ? prepareData.gas * gasPrice : void 0;
|
|
2624
|
-
return /* @__PURE__ */
|
|
2713
|
+
return /* @__PURE__ */ jsx30(
|
|
2625
2714
|
DepositForm,
|
|
2626
2715
|
{
|
|
2627
2716
|
sourceChain,
|
|
@@ -2637,7 +2726,7 @@ function DepositViaTransferForm({ amount, setAmount, sourceChain, setSourceChain
|
|
|
2637
2726
|
onSubmit: async () => {
|
|
2638
2727
|
await deposit.mutateAsync();
|
|
2639
2728
|
},
|
|
2640
|
-
submitButton: /* @__PURE__ */
|
|
2729
|
+
submitButton: /* @__PURE__ */ jsx30(
|
|
2641
2730
|
SubmitButton,
|
|
2642
2731
|
{
|
|
2643
2732
|
variant: "primary",
|
|
@@ -2655,8 +2744,8 @@ function DepositViaTransferForm({ amount, setAmount, sourceChain, setSourceChain
|
|
|
2655
2744
|
// src/onboarding/deposit/DepositViaRelayForm.tsx
|
|
2656
2745
|
import { encodeFunctionData as encodeFunctionData3 } from "viem";
|
|
2657
2746
|
import { useAccount as useAccount5, useWalletClient } from "wagmi";
|
|
2658
|
-
import { useMutation as useMutation5, useQuery as
|
|
2659
|
-
import { jsx as
|
|
2747
|
+
import { useMutation as useMutation5, useQuery as useQuery14 } from "@tanstack/react-query";
|
|
2748
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2660
2749
|
var ETH_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
2661
2750
|
function DepositViaRelayForm({ amount, setAmount, sourceChain, setSourceChainId }) {
|
|
2662
2751
|
const { chain, chainId: destinationChainId } = useEntryKitConfig();
|
|
@@ -2666,7 +2755,7 @@ function DepositViaRelayForm({ amount, setAmount, sourceChain, setSourceChainId
|
|
|
2666
2755
|
const { addDeposit } = useDeposits();
|
|
2667
2756
|
const { data: relay } = useRelay();
|
|
2668
2757
|
const relayClient = relay?.client;
|
|
2669
|
-
const quote =
|
|
2758
|
+
const quote = useQuery14({
|
|
2670
2759
|
queryKey: ["relayBridgeQuote", sourceChain.id, amount?.toString()],
|
|
2671
2760
|
queryFn: async () => {
|
|
2672
2761
|
if (!relayClient) throw new Error("No Relay client found.");
|
|
@@ -2742,7 +2831,7 @@ function DepositViaRelayForm({ amount, setAmount, sourceChain, setSourceChainId
|
|
|
2742
2831
|
const gasFee = BigInt(fees?.gas?.amount ?? 0);
|
|
2743
2832
|
const relayerFee = BigInt(fees?.relayer?.amount ?? 0);
|
|
2744
2833
|
const fee = gasFee + relayerFee;
|
|
2745
|
-
return /* @__PURE__ */
|
|
2834
|
+
return /* @__PURE__ */ jsx31(
|
|
2746
2835
|
DepositForm,
|
|
2747
2836
|
{
|
|
2748
2837
|
sourceChain,
|
|
@@ -2759,7 +2848,7 @@ function DepositViaRelayForm({ amount, setAmount, sourceChain, setSourceChainId
|
|
|
2759
2848
|
if (!quote.data || !amount) return;
|
|
2760
2849
|
await deposit.mutateAsync({ quote: quote.data, amount });
|
|
2761
2850
|
},
|
|
2762
|
-
submitButton: /* @__PURE__ */
|
|
2851
|
+
submitButton: /* @__PURE__ */ jsx31(
|
|
2763
2852
|
SubmitButton,
|
|
2764
2853
|
{
|
|
2765
2854
|
variant: "primary",
|
|
@@ -2776,19 +2865,19 @@ function DepositViaRelayForm({ amount, setAmount, sourceChain, setSourceChainId
|
|
|
2776
2865
|
|
|
2777
2866
|
// src/onboarding/deposit/Deposits.tsx
|
|
2778
2867
|
import { useEffect as useEffect13 } from "react";
|
|
2779
|
-
import { useQuery as
|
|
2868
|
+
import { useQuery as useQuery17, useQueryClient as useQueryClient8 } from "@tanstack/react-query";
|
|
2780
2869
|
|
|
2781
2870
|
// src/onboarding/deposit/TransferDepositStatus.tsx
|
|
2782
|
-
import { useQuery as
|
|
2871
|
+
import { useQuery as useQuery15 } from "@tanstack/react-query";
|
|
2783
2872
|
|
|
2784
2873
|
// src/onboarding/deposit/DepositStatus.tsx
|
|
2785
2874
|
import { useEffect as useEffect12, useState as useState3 } from "react";
|
|
2786
2875
|
import { twMerge as twMerge16 } from "tailwind-merge";
|
|
2787
2876
|
|
|
2788
2877
|
// src/icons/CloseIcon.tsx
|
|
2789
|
-
import { jsx as
|
|
2878
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2790
2879
|
function CloseIcon(props) {
|
|
2791
|
-
return /* @__PURE__ */
|
|
2880
|
+
return /* @__PURE__ */ jsx32(IconSVG, { strokeWidth: "2", stroke: "currentColor", ...props, children: /* @__PURE__ */ jsx32(
|
|
2792
2881
|
"path",
|
|
2793
2882
|
{
|
|
2794
2883
|
d: "M6 18L18 6M6 6L18 18",
|
|
@@ -2802,7 +2891,7 @@ function CloseIcon(props) {
|
|
|
2802
2891
|
}
|
|
2803
2892
|
|
|
2804
2893
|
// src/onboarding/deposit/DepositStatus.tsx
|
|
2805
|
-
import { jsx as
|
|
2894
|
+
import { jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2806
2895
|
function DepositStatus({ status, progress, children, onDismiss }) {
|
|
2807
2896
|
const [appear, setAppear] = useState3(false);
|
|
2808
2897
|
useEffect12(() => {
|
|
@@ -2810,10 +2899,10 @@ function DepositStatus({ status, progress, children, onDismiss }) {
|
|
|
2810
2899
|
}, []);
|
|
2811
2900
|
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: [
|
|
2812
2901
|
/* @__PURE__ */ jsxs19("div", { className: "py-1 text-sm flex items-center gap-2", children: [
|
|
2813
|
-
/* @__PURE__ */
|
|
2902
|
+
/* @__PURE__ */ jsx33("div", { className: "flex-grow", children }),
|
|
2814
2903
|
/* @__PURE__ */ jsxs19("div", { className: "flex-shrink-0 grid", children: [
|
|
2815
|
-
/* @__PURE__ */
|
|
2816
|
-
/* @__PURE__ */
|
|
2904
|
+
/* @__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" }) }),
|
|
2905
|
+
/* @__PURE__ */ jsx33(
|
|
2817
2906
|
"button",
|
|
2818
2907
|
{
|
|
2819
2908
|
type: "button",
|
|
@@ -2825,12 +2914,12 @@ function DepositStatus({ status, progress, children, onDismiss }) {
|
|
|
2825
2914
|
),
|
|
2826
2915
|
title: "Dismiss",
|
|
2827
2916
|
onClick: onDismiss,
|
|
2828
|
-
children: /* @__PURE__ */
|
|
2917
|
+
children: /* @__PURE__ */ jsx33(CloseIcon, {})
|
|
2829
2918
|
}
|
|
2830
2919
|
)
|
|
2831
2920
|
] })
|
|
2832
2921
|
] }),
|
|
2833
|
-
/* @__PURE__ */
|
|
2922
|
+
/* @__PURE__ */ jsx33("div", { className: "w-full h-[2px] -mt-full overflow-clip", children: /* @__PURE__ */ jsx33(
|
|
2834
2923
|
"div",
|
|
2835
2924
|
{
|
|
2836
2925
|
className: twMerge16(
|
|
@@ -2850,7 +2939,7 @@ function DepositStatus({ status, progress, children, onDismiss }) {
|
|
|
2850
2939
|
|
|
2851
2940
|
// src/onboarding/deposit/TransferDepositStatus.tsx
|
|
2852
2941
|
import { useChains as useChains2 } from "wagmi";
|
|
2853
|
-
import { Fragment as
|
|
2942
|
+
import { Fragment as Fragment4, jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2854
2943
|
function TransferDepositStatus({
|
|
2855
2944
|
amount,
|
|
2856
2945
|
chainL1Id,
|
|
@@ -2862,11 +2951,11 @@ function TransferDepositStatus({
|
|
|
2862
2951
|
}) {
|
|
2863
2952
|
const chains = useChains2();
|
|
2864
2953
|
const chain = chains.find((chain2) => chain2.id === chainL1Id);
|
|
2865
|
-
const receipt =
|
|
2954
|
+
const receipt = useQuery15({
|
|
2866
2955
|
queryKey: ["transferDepositStatus", hash],
|
|
2867
2956
|
queryFn: () => receiptPromise
|
|
2868
2957
|
});
|
|
2869
|
-
return /* @__PURE__ */
|
|
2958
|
+
return /* @__PURE__ */ jsx34(
|
|
2870
2959
|
DepositStatus,
|
|
2871
2960
|
{
|
|
2872
2961
|
status: receipt.status,
|
|
@@ -2878,10 +2967,10 @@ function TransferDepositStatus({
|
|
|
2878
2967
|
children: (() => {
|
|
2879
2968
|
const blockExplorer = chain.blockExplorers?.default.url;
|
|
2880
2969
|
if (receipt.status === "pending") {
|
|
2881
|
-
return /* @__PURE__ */ jsxs20(
|
|
2970
|
+
return /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
2882
2971
|
"Confirming deposit on",
|
|
2883
2972
|
" ",
|
|
2884
|
-
/* @__PURE__ */
|
|
2973
|
+
/* @__PURE__ */ jsx34(
|
|
2885
2974
|
"a",
|
|
2886
2975
|
{
|
|
2887
2976
|
href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
|
|
@@ -2894,10 +2983,10 @@ function TransferDepositStatus({
|
|
|
2894
2983
|
] });
|
|
2895
2984
|
}
|
|
2896
2985
|
if (receipt.status === "error") {
|
|
2897
|
-
return /* @__PURE__ */ jsxs20(
|
|
2986
|
+
return /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
2898
2987
|
"Could not find deposit on",
|
|
2899
2988
|
" ",
|
|
2900
|
-
/* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ jsx34(
|
|
2901
2990
|
"a",
|
|
2902
2991
|
{
|
|
2903
2992
|
href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
|
|
@@ -2909,10 +2998,10 @@ function TransferDepositStatus({
|
|
|
2909
2998
|
"."
|
|
2910
2999
|
] });
|
|
2911
3000
|
}
|
|
2912
|
-
return /* @__PURE__ */ jsxs20(
|
|
3001
|
+
return /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
2913
3002
|
"Successfully",
|
|
2914
3003
|
" ",
|
|
2915
|
-
/* @__PURE__ */
|
|
3004
|
+
/* @__PURE__ */ jsx34(
|
|
2916
3005
|
"a",
|
|
2917
3006
|
{
|
|
2918
3007
|
href: blockExplorer ? `${blockExplorer}/tx/${receipt.data.transactionHash}` : void 0,
|
|
@@ -2922,7 +3011,7 @@ function TransferDepositStatus({
|
|
|
2922
3011
|
}
|
|
2923
3012
|
),
|
|
2924
3013
|
" ",
|
|
2925
|
-
/* @__PURE__ */
|
|
3014
|
+
/* @__PURE__ */ jsx34(Balance, { wei: amount })
|
|
2926
3015
|
] });
|
|
2927
3016
|
})()
|
|
2928
3017
|
}
|
|
@@ -2930,9 +3019,9 @@ function TransferDepositStatus({
|
|
|
2930
3019
|
}
|
|
2931
3020
|
|
|
2932
3021
|
// src/onboarding/deposit/RelayDepositStatus.tsx
|
|
2933
|
-
import { useQuery as
|
|
3022
|
+
import { useQuery as useQuery16 } from "@tanstack/react-query";
|
|
2934
3023
|
import { useChains as useChains3 } from "wagmi";
|
|
2935
|
-
import { Fragment as
|
|
3024
|
+
import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2936
3025
|
function RelayDepositStatus({
|
|
2937
3026
|
amount,
|
|
2938
3027
|
chainL1Id,
|
|
@@ -2945,11 +3034,11 @@ function RelayDepositStatus({
|
|
|
2945
3034
|
const chains = useChains3();
|
|
2946
3035
|
const chainL1 = chains.find((chain) => chain.id === chainL1Id);
|
|
2947
3036
|
const chainL2 = chains.find((chain) => chain.id === chainL2Id);
|
|
2948
|
-
const deposit =
|
|
3037
|
+
const deposit = useQuery16({
|
|
2949
3038
|
queryKey: ["relayDepositPromise", chainL1Id, chainL2Id, amount.toString(), start.toISOString()],
|
|
2950
3039
|
queryFn: () => depositPromise
|
|
2951
3040
|
});
|
|
2952
|
-
return /* @__PURE__ */
|
|
3041
|
+
return /* @__PURE__ */ jsx35(
|
|
2953
3042
|
DepositStatus,
|
|
2954
3043
|
{
|
|
2955
3044
|
status: deposit.status,
|
|
@@ -2960,22 +3049,22 @@ function RelayDepositStatus({
|
|
|
2960
3049
|
onDismiss,
|
|
2961
3050
|
children: (() => {
|
|
2962
3051
|
if (deposit.status === "pending") {
|
|
2963
|
-
return /* @__PURE__ */ jsxs21(
|
|
3052
|
+
return /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
2964
3053
|
"Relay bridge deposit pending on ",
|
|
2965
3054
|
chainL1.name,
|
|
2966
3055
|
"\u2026"
|
|
2967
3056
|
] });
|
|
2968
3057
|
}
|
|
2969
3058
|
if (deposit.status === "error") {
|
|
2970
|
-
return /* @__PURE__ */ jsxs21(
|
|
3059
|
+
return /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
2971
3060
|
"Relay bridge deposit to ",
|
|
2972
3061
|
chainL2.name,
|
|
2973
3062
|
" failed."
|
|
2974
3063
|
] });
|
|
2975
3064
|
}
|
|
2976
|
-
return /* @__PURE__ */ jsxs21(
|
|
3065
|
+
return /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
2977
3066
|
"Successfully bridged ",
|
|
2978
|
-
/* @__PURE__ */
|
|
3067
|
+
/* @__PURE__ */ jsx35(Balance, { wei: amount }),
|
|
2979
3068
|
" to ",
|
|
2980
3069
|
chainL2.name,
|
|
2981
3070
|
"!"
|
|
@@ -2986,15 +3075,15 @@ function RelayDepositStatus({
|
|
|
2986
3075
|
}
|
|
2987
3076
|
|
|
2988
3077
|
// src/onboarding/deposit/Deposits.tsx
|
|
2989
|
-
import { useAccount as useAccount6, useClient as
|
|
2990
|
-
import { jsx as
|
|
3078
|
+
import { useAccount as useAccount6, useClient as useClient12 } from "wagmi";
|
|
3079
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
2991
3080
|
function Deposits() {
|
|
2992
|
-
const queryClient =
|
|
3081
|
+
const queryClient = useQueryClient8();
|
|
2993
3082
|
const { chainId } = useEntryKitConfig();
|
|
2994
|
-
const client =
|
|
3083
|
+
const client = useClient12({ chainId });
|
|
2995
3084
|
const { address: userAddress } = useAccount6();
|
|
2996
3085
|
const { deposits, removeDeposit } = useDeposits();
|
|
2997
|
-
const { data: isComplete } =
|
|
3086
|
+
const { data: isComplete } = useQuery17({
|
|
2998
3087
|
queryKey: ["depositsComplete", deposits.map((deposit) => deposit.uid)],
|
|
2999
3088
|
queryFn: async () => {
|
|
3000
3089
|
if (!deposits.length) return false;
|
|
@@ -3009,17 +3098,17 @@ function Deposits() {
|
|
|
3009
3098
|
}
|
|
3010
3099
|
}, [client?.uid, isComplete, queryClient, userAddress]);
|
|
3011
3100
|
if (!deposits.length) return null;
|
|
3012
|
-
return /* @__PURE__ */
|
|
3101
|
+
return /* @__PURE__ */ jsx36("div", { className: "flex flex-col gap-1 mt-4", children: deposits.map((deposit) => {
|
|
3013
3102
|
if (deposit.type === "transfer") {
|
|
3014
|
-
return /* @__PURE__ */
|
|
3103
|
+
return /* @__PURE__ */ jsx36(TransferDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
|
|
3015
3104
|
} else if (deposit.type === "relay") {
|
|
3016
|
-
return /* @__PURE__ */
|
|
3105
|
+
return /* @__PURE__ */ jsx36(RelayDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
|
|
3017
3106
|
}
|
|
3018
3107
|
}) });
|
|
3019
3108
|
}
|
|
3020
3109
|
|
|
3021
3110
|
// src/onboarding/deposit/DepositFormContainer.tsx
|
|
3022
|
-
import { jsx as
|
|
3111
|
+
import { jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3023
3112
|
function DepositFormContainer() {
|
|
3024
3113
|
const { chainId: destinationChainId } = useEntryKitConfig();
|
|
3025
3114
|
const chainId = useChainId();
|
|
@@ -3028,7 +3117,7 @@ function DepositFormContainer() {
|
|
|
3028
3117
|
const [sourceChainId, setSourceChainId] = useState4(chainId);
|
|
3029
3118
|
const sourceChain = chains.find(({ id }) => id === sourceChainId);
|
|
3030
3119
|
return /* @__PURE__ */ jsxs22("div", { className: "pt-10 pb-2", children: [
|
|
3031
|
-
destinationChainId === sourceChainId ? /* @__PURE__ */
|
|
3120
|
+
destinationChainId === sourceChainId ? /* @__PURE__ */ jsx37(
|
|
3032
3121
|
DepositViaTransferForm,
|
|
3033
3122
|
{
|
|
3034
3123
|
amount,
|
|
@@ -3036,7 +3125,7 @@ function DepositFormContainer() {
|
|
|
3036
3125
|
sourceChain,
|
|
3037
3126
|
setSourceChainId
|
|
3038
3127
|
}
|
|
3039
|
-
) : /* @__PURE__ */
|
|
3128
|
+
) : /* @__PURE__ */ jsx37(
|
|
3040
3129
|
DepositViaRelayForm,
|
|
3041
3130
|
{
|
|
3042
3131
|
amount,
|
|
@@ -3045,14 +3134,14 @@ function DepositFormContainer() {
|
|
|
3045
3134
|
setSourceChainId
|
|
3046
3135
|
}
|
|
3047
3136
|
),
|
|
3048
|
-
/* @__PURE__ */
|
|
3137
|
+
/* @__PURE__ */ jsx37(Deposits, {})
|
|
3049
3138
|
] });
|
|
3050
3139
|
}
|
|
3051
3140
|
|
|
3052
3141
|
// src/icons/ArrowLeftIcon.tsx
|
|
3053
|
-
import { jsx as
|
|
3142
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3054
3143
|
function ArrowLeftIcon(props) {
|
|
3055
|
-
return /* @__PURE__ */
|
|
3144
|
+
return /* @__PURE__ */ jsx38(IconSVG, { ...props, children: /* @__PURE__ */ jsx38(
|
|
3056
3145
|
"path",
|
|
3057
3146
|
{
|
|
3058
3147
|
d: "M19 12H5M12 19l-7-7 7-7",
|
|
@@ -3065,12 +3154,92 @@ function ArrowLeftIcon(props) {
|
|
|
3065
3154
|
) });
|
|
3066
3155
|
}
|
|
3067
3156
|
|
|
3157
|
+
// src/onboarding/quarry/WithdrawGasBalanceButton.tsx
|
|
3158
|
+
import { getAction as getAction6 } from "viem/utils";
|
|
3159
|
+
import { waitForTransactionReceipt as waitForTransactionReceipt3 } from "viem/actions";
|
|
3160
|
+
import { useAccount as useAccount7, useClient as useClient13, useSwitchChain as useSwitchChain3, useWriteContract as useWriteContract2 } from "wagmi";
|
|
3161
|
+
import { twMerge as twMerge17 } from "tailwind-merge";
|
|
3162
|
+
import { useMutation as useMutation6 } from "@tanstack/react-query";
|
|
3163
|
+
import { useQueryClient as useQueryClient9 } from "@tanstack/react-query";
|
|
3164
|
+
import { jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3165
|
+
function WithdrawGasBalanceButton({ userAddress }) {
|
|
3166
|
+
const { writeContractAsync } = useWriteContract2();
|
|
3167
|
+
const { switchChain } = useSwitchChain3();
|
|
3168
|
+
const { chain, chainId } = useEntryKitConfig();
|
|
3169
|
+
const { chainId: userChainId } = useAccount7();
|
|
3170
|
+
const queryClient = useQueryClient9();
|
|
3171
|
+
const client = useClient13({ chainId });
|
|
3172
|
+
const paymaster = getPaymaster(chain);
|
|
3173
|
+
const balance = useShowQueryError(useBalance(userAddress));
|
|
3174
|
+
const shouldSwitchChain = chainId != null && chainId !== userChainId;
|
|
3175
|
+
const withdraw = useMutation6({
|
|
3176
|
+
mutationKey: ["withdraw", userAddress],
|
|
3177
|
+
mutationFn: async () => {
|
|
3178
|
+
if (!client) throw new Error("Client not ready.");
|
|
3179
|
+
if (!paymaster) throw new Error("Paymaster not found");
|
|
3180
|
+
if (!balance.data) throw new Error("No gas balance to withdraw.");
|
|
3181
|
+
try {
|
|
3182
|
+
const hash = await writeContractAsync({
|
|
3183
|
+
address: paymaster.address,
|
|
3184
|
+
abi: paymasterAbi,
|
|
3185
|
+
functionName: "withdrawTo",
|
|
3186
|
+
args: [userAddress, balance.data],
|
|
3187
|
+
chainId
|
|
3188
|
+
});
|
|
3189
|
+
await getAction6(client, waitForTransactionReceipt3, "waitForTransactionReceipt")({ hash });
|
|
3190
|
+
await Promise.all([
|
|
3191
|
+
queryClient.invalidateQueries({ queryKey: ["balance"] }),
|
|
3192
|
+
queryClient.invalidateQueries({ queryKey: ["getFunds"] }),
|
|
3193
|
+
queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] })
|
|
3194
|
+
]);
|
|
3195
|
+
} catch (error2) {
|
|
3196
|
+
console.error("Error while withdrawing", error2);
|
|
3197
|
+
throw error2;
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
});
|
|
3201
|
+
if (balance.data == null || balance.data === 0n) {
|
|
3202
|
+
return null;
|
|
3203
|
+
}
|
|
3204
|
+
return /* @__PURE__ */ jsx39(
|
|
3205
|
+
"button",
|
|
3206
|
+
{
|
|
3207
|
+
onClick: () => {
|
|
3208
|
+
if (shouldSwitchChain) {
|
|
3209
|
+
return switchChain({ chainId });
|
|
3210
|
+
}
|
|
3211
|
+
withdraw.mutate();
|
|
3212
|
+
},
|
|
3213
|
+
className: twMerge17(
|
|
3214
|
+
"text-sm font-medium text-white/50 group whitespace-nowrap",
|
|
3215
|
+
withdraw.isPending ? "opacity-50 pointer-events-none" : "cursor-pointer hover:text-white"
|
|
3216
|
+
),
|
|
3217
|
+
disabled: withdraw.isPending,
|
|
3218
|
+
children: /* @__PURE__ */ jsxs23("span", { className: "inline-block", children: [
|
|
3219
|
+
/* @__PURE__ */ jsxs23(
|
|
3220
|
+
"span",
|
|
3221
|
+
{
|
|
3222
|
+
className: twMerge17(
|
|
3223
|
+
"inline-flex items-center gap-1 underline decoration-neutral-500 underline-offset-4",
|
|
3224
|
+
!withdraw.isPending && "hover:decoration-orange-500",
|
|
3225
|
+
shouldSwitchChain && "group-hover:hidden"
|
|
3226
|
+
),
|
|
3227
|
+
children: [
|
|
3228
|
+
withdraw.isPending && /* @__PURE__ */ jsx39(PendingIcon, { className: "w-3 h-3" }),
|
|
3229
|
+
"Withdraw"
|
|
3230
|
+
]
|
|
3231
|
+
}
|
|
3232
|
+
),
|
|
3233
|
+
shouldSwitchChain && /* @__PURE__ */ jsx39("span", { className: "hidden group-hover:inline-block underline decoration-neutral-500 underline-offset-4 hover:decoration-orange-500", children: "Switch chain" })
|
|
3234
|
+
] })
|
|
3235
|
+
}
|
|
3236
|
+
);
|
|
3237
|
+
}
|
|
3238
|
+
|
|
3068
3239
|
// src/onboarding/quarry/GasBalance.tsx
|
|
3069
|
-
import {
|
|
3070
|
-
import { useQueryClient as useQueryClient8 } from "@tanstack/react-query";
|
|
3071
|
-
import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3240
|
+
import { jsx as jsx40, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3072
3241
|
function GasBalance2({ isActive, isExpanded, isFocused, setFocused, userAddress }) {
|
|
3073
|
-
const queryClient =
|
|
3242
|
+
const queryClient = useQueryClient10();
|
|
3074
3243
|
const balance = useShowQueryError(useBalance(userAddress));
|
|
3075
3244
|
const prevBalance = usePrevious(balance.data || 0n);
|
|
3076
3245
|
useEffect14(() => {
|
|
@@ -3080,7 +3249,7 @@ function GasBalance2({ isActive, isExpanded, isFocused, setFocused, userAddress
|
|
|
3080
3249
|
}
|
|
3081
3250
|
}, [balance.data, prevBalance, setFocused, queryClient, userAddress]);
|
|
3082
3251
|
if (isFocused) {
|
|
3083
|
-
return /* @__PURE__ */
|
|
3252
|
+
return /* @__PURE__ */ jsxs24("div", { children: [
|
|
3084
3253
|
isFocused && /* @__PURE__ */ jsx40("div", { className: "absolute top-0 left-0", children: /* @__PURE__ */ jsx40(
|
|
3085
3254
|
"div",
|
|
3086
3255
|
{
|
|
@@ -3092,23 +3261,26 @@ function GasBalance2({ isActive, isExpanded, isFocused, setFocused, userAddress
|
|
|
3092
3261
|
/* @__PURE__ */ jsx40(DepositFormContainer, {})
|
|
3093
3262
|
] });
|
|
3094
3263
|
}
|
|
3095
|
-
return /* @__PURE__ */
|
|
3096
|
-
/* @__PURE__ */
|
|
3097
|
-
/* @__PURE__ */
|
|
3264
|
+
return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-4", children: [
|
|
3265
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex justify-between gap-4", children: [
|
|
3266
|
+
/* @__PURE__ */ jsxs24("div", { children: [
|
|
3098
3267
|
/* @__PURE__ */ jsx40("div", { children: "Gas balance" }),
|
|
3099
3268
|
/* @__PURE__ */ jsx40("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx40(Balance, { wei: balance.data }) : /* @__PURE__ */ jsx40(PendingIcon, { className: "text-sm" }) })
|
|
3100
3269
|
] }),
|
|
3101
|
-
/* @__PURE__ */
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3270
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-1 justify-center items-center", children: [
|
|
3271
|
+
/* @__PURE__ */ jsx40(
|
|
3272
|
+
Button,
|
|
3273
|
+
{
|
|
3274
|
+
variant: isActive ? "primary" : "tertiary",
|
|
3275
|
+
className: "flex-shrink-0 text-sm p-1 w-28",
|
|
3276
|
+
autoFocus: isActive || isExpanded,
|
|
3277
|
+
pending: balance.status === "pending",
|
|
3278
|
+
onClick: () => setFocused(true),
|
|
3279
|
+
children: "Top up"
|
|
3280
|
+
}
|
|
3281
|
+
),
|
|
3282
|
+
/* @__PURE__ */ jsx40(WithdrawGasBalanceButton, { userAddress })
|
|
3283
|
+
] })
|
|
3112
3284
|
] }),
|
|
3113
3285
|
isExpanded ? /* @__PURE__ */ jsx40("p", { className: "text-sm", children: "Your gas balance is used to pay for onchain computation." }) : null
|
|
3114
3286
|
] });
|
|
@@ -3207,9 +3379,9 @@ function ConnectedSteps({ userClient, initialUserAddress }) {
|
|
|
3207
3379
|
return /* @__PURE__ */ jsx41(
|
|
3208
3380
|
"div",
|
|
3209
3381
|
{
|
|
3210
|
-
className:
|
|
3382
|
+
className: twMerge18(
|
|
3211
3383
|
"px-8 flex flex-col",
|
|
3212
|
-
|
|
3384
|
+
"divide-y divide-neutral-800",
|
|
3213
3385
|
"animate-in animate-duration-300 fade-in slide-in-from-bottom-8"
|
|
3214
3386
|
),
|
|
3215
3387
|
children: steps.map((step, i) => {
|
|
@@ -3229,7 +3401,7 @@ function ConnectedSteps({ userClient, initialUserAddress }) {
|
|
|
3229
3401
|
}
|
|
3230
3402
|
return null;
|
|
3231
3403
|
}
|
|
3232
|
-
return /* @__PURE__ */ jsx41("div", { className:
|
|
3404
|
+
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);
|
|
3233
3405
|
})
|
|
3234
3406
|
}
|
|
3235
3407
|
);
|
|
@@ -3241,7 +3413,7 @@ import { jsx as jsx42 } from "react/jsx-runtime";
|
|
|
3241
3413
|
function AccountModalContent() {
|
|
3242
3414
|
const { chainId } = useEntryKitConfig();
|
|
3243
3415
|
const userClient = useConnectorClient({ chainId });
|
|
3244
|
-
const { address: userAddress } =
|
|
3416
|
+
const { address: userAddress } = useAccount8();
|
|
3245
3417
|
const initialUserAddress = useRef6(userAddress);
|
|
3246
3418
|
if (userClient.status !== "success") {
|
|
3247
3419
|
return /* @__PURE__ */ jsx42(ConnectWallet, {});
|
|
@@ -3256,19 +3428,19 @@ import { ErrorBoundary } from "react-error-boundary";
|
|
|
3256
3428
|
// src/errors/ErrorOverlay.tsx
|
|
3257
3429
|
import { wait } from "@latticexyz/common/utils";
|
|
3258
3430
|
import { useEffect as useEffect16 } from "react";
|
|
3259
|
-
import { twMerge as
|
|
3260
|
-
import { Fragment as
|
|
3431
|
+
import { twMerge as twMerge19 } from "tailwind-merge";
|
|
3432
|
+
import { Fragment as Fragment6, jsx as jsx43, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3261
3433
|
function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
3262
3434
|
useEffect16(() => {
|
|
3263
3435
|
if (error2) {
|
|
3264
3436
|
console.error(error2);
|
|
3265
3437
|
}
|
|
3266
3438
|
}, [error2]);
|
|
3267
|
-
return /* @__PURE__ */
|
|
3439
|
+
return /* @__PURE__ */ jsxs25("div", { className: "pointer-events-none absolute inset-0 overflow-clip", children: [
|
|
3268
3440
|
/* @__PURE__ */ jsx43(
|
|
3269
3441
|
"div",
|
|
3270
3442
|
{
|
|
3271
|
-
className:
|
|
3443
|
+
className: twMerge19(
|
|
3272
3444
|
"absolute inset-0 bg-blue-700/60",
|
|
3273
3445
|
"transition duration-300",
|
|
3274
3446
|
error2 ? "opacity-100 pointer-events-auto" : "opacity-0"
|
|
@@ -3278,24 +3450,24 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
|
3278
3450
|
/* @__PURE__ */ jsx43(
|
|
3279
3451
|
"div",
|
|
3280
3452
|
{
|
|
3281
|
-
className:
|
|
3453
|
+
className: twMerge19(
|
|
3282
3454
|
"absolute inset-0 pb-8",
|
|
3283
3455
|
"transition duration-300",
|
|
3284
3456
|
error2 ? "translate-y-0 opacity-100 pointer-events-auto" : "-translate-y-4 opacity-0"
|
|
3285
3457
|
),
|
|
3286
|
-
children: error2 ? /* @__PURE__ */ jsx43(
|
|
3287
|
-
/* @__PURE__ */
|
|
3458
|
+
children: error2 ? /* @__PURE__ */ jsx43(Fragment6, { children: /* @__PURE__ */ jsxs25("div", { className: "w-full max-h-full bg-blue-700 text-white/80 overflow-auto", children: [
|
|
3459
|
+
/* @__PURE__ */ jsxs25("div", { className: "space-y-6 px-8 pt-8", children: [
|
|
3288
3460
|
/* @__PURE__ */ jsx43("div", { className: "text-white text-lg font-bold", children: "Oops! It broke :(" }),
|
|
3289
3461
|
/* @__PURE__ */ jsx43("div", { className: "font-mono text-xs whitespace-pre-wrap", children: error2.message.trim() }),
|
|
3290
3462
|
/* @__PURE__ */ jsx43("div", { className: "text-sm", children: "See the console for more info." })
|
|
3291
3463
|
] }),
|
|
3292
|
-
/* @__PURE__ */
|
|
3464
|
+
/* @__PURE__ */ jsxs25("div", { className: "pointer-events-none sticky bottom-0 left-0 -mt-2", children: [
|
|
3293
3465
|
/* @__PURE__ */ jsx43("div", { className: "w-full h-12 bg-gradient-to-b from-transparent to-blue-700" }),
|
|
3294
|
-
retry ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */
|
|
3466
|
+
retry ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsxs25(
|
|
3295
3467
|
"button",
|
|
3296
3468
|
{
|
|
3297
3469
|
type: "button",
|
|
3298
|
-
className:
|
|
3470
|
+
className: twMerge19(
|
|
3299
3471
|
"pointer-events-auto group w-24 p-1 -translate-y-2 transition",
|
|
3300
3472
|
"bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
|
|
3301
3473
|
"text-white text-sm font-medium",
|
|
@@ -3318,7 +3490,7 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
|
3318
3490
|
"button",
|
|
3319
3491
|
{
|
|
3320
3492
|
type: "button",
|
|
3321
|
-
className:
|
|
3493
|
+
className: twMerge19(
|
|
3322
3494
|
"pointer-events-auto group w-24 p-1 -translate-y-2 transition",
|
|
3323
3495
|
"bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
|
|
3324
3496
|
"text-white text-sm font-medium",
|
|
@@ -3350,13 +3522,13 @@ function ErrorsOverlay() {
|
|
|
3350
3522
|
}
|
|
3351
3523
|
|
|
3352
3524
|
// src/AccountModal.tsx
|
|
3353
|
-
import { jsx as jsx46, jsxs as
|
|
3525
|
+
import { jsx as jsx46, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3354
3526
|
function AccountModal() {
|
|
3355
3527
|
const { accountModalOpen, toggleAccountModal } = useAccountModal();
|
|
3356
|
-
return /* @__PURE__ */ jsx46(Modal, { open: accountModalOpen, onOpenChange: toggleAccountModal, children: accountModalOpen ? /* @__PURE__ */
|
|
3528
|
+
return /* @__PURE__ */ jsx46(Modal, { open: accountModalOpen, onOpenChange: toggleAccountModal, children: accountModalOpen ? /* @__PURE__ */ jsxs26(
|
|
3357
3529
|
"div",
|
|
3358
3530
|
{
|
|
3359
|
-
className:
|
|
3531
|
+
className: twMerge20(
|
|
3360
3532
|
"relative py-2 ring-1",
|
|
3361
3533
|
"bg-neutral-900 text-neutral-400 ring-neutral-700/50",
|
|
3362
3534
|
"links:font-medium links:underline links:underline-offset-4",
|
|
@@ -3364,11 +3536,11 @@ function AccountModal() {
|
|
|
3364
3536
|
"links:decoration-neutral-500 hover:links:decoration-orange-500"
|
|
3365
3537
|
),
|
|
3366
3538
|
children: [
|
|
3367
|
-
/* @__PURE__ */
|
|
3539
|
+
/* @__PURE__ */ jsxs26(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [
|
|
3368
3540
|
/* @__PURE__ */ jsx46(AccountModalContent, {}),
|
|
3369
3541
|
/* @__PURE__ */ jsx46(ErrorsOverlay, {})
|
|
3370
3542
|
] }),
|
|
3371
|
-
/* @__PURE__ */
|
|
3543
|
+
/* @__PURE__ */ jsxs26(
|
|
3372
3544
|
"a",
|
|
3373
3545
|
{
|
|
3374
3546
|
href: "https://mud.dev",
|
|
@@ -3384,7 +3556,7 @@ function AccountModal() {
|
|
|
3384
3556
|
/* @__PURE__ */ jsx46("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ jsx46(
|
|
3385
3557
|
DialogClose,
|
|
3386
3558
|
{
|
|
3387
|
-
className:
|
|
3559
|
+
className: twMerge20(
|
|
3388
3560
|
"pointer-events-auto leading-none p-2 transition",
|
|
3389
3561
|
"text-white/20 hover:text-white/40"
|
|
3390
3562
|
),
|
|
@@ -3398,31 +3570,31 @@ function AccountModal() {
|
|
|
3398
3570
|
}
|
|
3399
3571
|
|
|
3400
3572
|
// src/EntryKitProvider.tsx
|
|
3401
|
-
import { jsx as jsx47, jsxs as
|
|
3573
|
+
import { jsx as jsx47, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3402
3574
|
function EntryKitProvider({ config, children }) {
|
|
3403
|
-
return /* @__PURE__ */
|
|
3575
|
+
return /* @__PURE__ */ jsxs27(EntryKitConfigProvider, { config, children: [
|
|
3404
3576
|
children,
|
|
3405
3577
|
/* @__PURE__ */ jsx47(AccountModal, {})
|
|
3406
3578
|
] });
|
|
3407
3579
|
}
|
|
3408
3580
|
|
|
3409
3581
|
// src/AccountButton.tsx
|
|
3410
|
-
import { useAccount as
|
|
3411
|
-
import { twMerge as
|
|
3582
|
+
import { useAccount as useAccount9 } from "wagmi";
|
|
3583
|
+
import { twMerge as twMerge22 } from "tailwind-merge";
|
|
3412
3584
|
|
|
3413
3585
|
// src/AccountName.tsx
|
|
3414
|
-
import { twMerge as
|
|
3415
|
-
import { Fragment as
|
|
3586
|
+
import { twMerge as twMerge21 } from "tailwind-merge";
|
|
3587
|
+
import { Fragment as Fragment7, jsx as jsx48, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3416
3588
|
function AccountName({ address }) {
|
|
3417
3589
|
const { data: ens } = useENS(address);
|
|
3418
3590
|
const avatar = usePreloadImage(ens?.avatar);
|
|
3419
|
-
return /* @__PURE__ */
|
|
3420
|
-
/* @__PURE__ */
|
|
3591
|
+
return /* @__PURE__ */ jsxs28(Fragment7, { children: [
|
|
3592
|
+
/* @__PURE__ */ jsxs28("span", { className: "flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center", children: [
|
|
3421
3593
|
/* @__PURE__ */ jsx48(
|
|
3422
3594
|
"img",
|
|
3423
3595
|
{
|
|
3424
3596
|
src: ens?.avatar && avatar.isSuccess ? ens.avatar : void 0,
|
|
3425
|
-
className:
|
|
3597
|
+
className: twMerge21(
|
|
3426
3598
|
"col-start-1 row-start-1",
|
|
3427
3599
|
"inline-flex w-full h-full rounded-full bg-black/10 dark:bg-white/10 bg-cover bg-no-repeat bg-center",
|
|
3428
3600
|
"transtion duration-300",
|
|
@@ -3433,7 +3605,7 @@ function AccountName({ address }) {
|
|
|
3433
3605
|
/* @__PURE__ */ jsx48(
|
|
3434
3606
|
Logo,
|
|
3435
3607
|
{
|
|
3436
|
-
className:
|
|
3608
|
+
className: twMerge21(
|
|
3437
3609
|
"col-start-1 row-start-1 text-orange-500",
|
|
3438
3610
|
"transition duration-300",
|
|
3439
3611
|
ens && (!ens.avatar || avatar.isError) ? "opacity-100" : "opacity-0"
|
|
@@ -3447,22 +3619,22 @@ function AccountName({ address }) {
|
|
|
3447
3619
|
|
|
3448
3620
|
// src/AccountButton.tsx
|
|
3449
3621
|
import { useRef as useRef7 } from "react";
|
|
3450
|
-
import { jsx as jsx49, jsxs as
|
|
3451
|
-
var containerClassNames =
|
|
3622
|
+
import { jsx as jsx49, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3623
|
+
var containerClassNames = twMerge22(
|
|
3452
3624
|
"w-48 p-3 inline-flex outline-none transition",
|
|
3453
3625
|
"border border-transparent",
|
|
3454
3626
|
"text-base leading-none"
|
|
3455
3627
|
);
|
|
3456
|
-
var secondaryClassNames =
|
|
3628
|
+
var secondaryClassNames = twMerge22(
|
|
3457
3629
|
"bg-neutral-100 border-neutral-300 text-black",
|
|
3458
3630
|
"dark:bg-neutral-800 dark:border-neutral-700 dark:text-white"
|
|
3459
3631
|
);
|
|
3460
|
-
var secondaryInteractiveClassNames =
|
|
3632
|
+
var secondaryInteractiveClassNames = twMerge22(
|
|
3461
3633
|
"cursor-pointer outline-none hover:bg-neutral-200 data-[highlighted]:bg-neutral-200 dark:hover:bg-neutral-700"
|
|
3462
3634
|
);
|
|
3463
3635
|
function AccountButton() {
|
|
3464
3636
|
const { openAccountModal, accountModalOpen } = useAccountModal();
|
|
3465
|
-
const { status, address: userAddress } =
|
|
3637
|
+
const { status, address: userAddress } = useAccount9();
|
|
3466
3638
|
const initialUserAddress = useRef7(userAddress);
|
|
3467
3639
|
const prereqs = usePrerequisites(userAddress);
|
|
3468
3640
|
const isConnected = status === "connected" || status === "reconnecting" && userAddress;
|
|
@@ -3479,16 +3651,16 @@ function AccountButton() {
|
|
|
3479
3651
|
"button",
|
|
3480
3652
|
{
|
|
3481
3653
|
type: "button",
|
|
3482
|
-
className:
|
|
3654
|
+
className: twMerge22(containerClassNames, secondaryClassNames, secondaryInteractiveClassNames),
|
|
3483
3655
|
onClick: openAccountModal,
|
|
3484
3656
|
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 })
|
|
3485
3657
|
},
|
|
3486
3658
|
"connected"
|
|
3487
|
-
) : /* @__PURE__ */
|
|
3659
|
+
) : /* @__PURE__ */ jsxs29(
|
|
3488
3660
|
"button",
|
|
3489
3661
|
{
|
|
3490
3662
|
type: "button",
|
|
3491
|
-
className:
|
|
3663
|
+
className: twMerge22(
|
|
3492
3664
|
containerClassNames,
|
|
3493
3665
|
"group",
|
|
3494
3666
|
"items-center justify-center gap-2.5",
|
|
@@ -3496,14 +3668,14 @@ function AccountButton() {
|
|
|
3496
3668
|
"hover:bg-orange-400",
|
|
3497
3669
|
"active:bg-orange-600"
|
|
3498
3670
|
),
|
|
3499
|
-
"aria-busy": accountModalOpen,
|
|
3671
|
+
"aria-busy": accountModalOpen || prereqs.isPending,
|
|
3500
3672
|
onClick: openAccountModal,
|
|
3501
3673
|
children: [
|
|
3502
|
-
/* @__PURE__ */
|
|
3674
|
+
/* @__PURE__ */ jsxs29("span", { className: "pointer-events-none inline-grid place-items-center -ml-3", children: [
|
|
3503
3675
|
/* @__PURE__ */ jsx49(
|
|
3504
3676
|
"span",
|
|
3505
3677
|
{
|
|
3506
|
-
className:
|
|
3678
|
+
className: twMerge22(
|
|
3507
3679
|
"col-start-1 row-start-1 leading-none",
|
|
3508
3680
|
"scale-100 opacity-100 transition duration-300",
|
|
3509
3681
|
"group-aria-busy:scale-125 group-aria-busy:opacity-0"
|
|
@@ -3515,7 +3687,7 @@ function AccountButton() {
|
|
|
3515
3687
|
"span",
|
|
3516
3688
|
{
|
|
3517
3689
|
"aria-hidden": true,
|
|
3518
|
-
className:
|
|
3690
|
+
className: twMerge22(
|
|
3519
3691
|
"col-start-1 row-start-1",
|
|
3520
3692
|
"scale-50 opacity-0 transition duration-300 delay-50",
|
|
3521
3693
|
"group-aria-busy:scale-100 group-aria-busy:opacity-100"
|
|
@@ -3540,22 +3712,384 @@ function useSessionClientReady() {
|
|
|
3540
3712
|
const userAddress = userClient.data?.account.address;
|
|
3541
3713
|
const prerequisites = usePrerequisites(userAddress);
|
|
3542
3714
|
const sessionClient = useSessionClient(userAddress);
|
|
3543
|
-
if (!
|
|
3544
|
-
|
|
3715
|
+
if (!prerequisites.isSuccess || !prerequisites.data.complete) {
|
|
3716
|
+
return { ...prerequisites, data: void 0 };
|
|
3717
|
+
}
|
|
3545
3718
|
return sessionClient;
|
|
3546
3719
|
}
|
|
3547
3720
|
|
|
3548
3721
|
// src/createWagmiConfig.ts
|
|
3549
3722
|
import { createConfig } from "wagmi";
|
|
3550
3723
|
import { getDefaultConfig } from "connectkit";
|
|
3724
|
+
import { injected, coinbaseWallet, safe } from "wagmi/connectors";
|
|
3725
|
+
|
|
3726
|
+
// src/connectors/walletConnect.ts
|
|
3727
|
+
import { ChainNotConfiguredError, ProviderNotFoundError, createConnector } from "wagmi";
|
|
3728
|
+
import {
|
|
3729
|
+
SwitchChainError,
|
|
3730
|
+
UserRejectedRequestError,
|
|
3731
|
+
getAddress,
|
|
3732
|
+
numberToHex as numberToHex3
|
|
3733
|
+
} from "viem";
|
|
3734
|
+
walletConnect.type = "walletConnect";
|
|
3735
|
+
function walletConnect(parameters) {
|
|
3736
|
+
const isNewChainsStale = parameters.isNewChainsStale ?? true;
|
|
3737
|
+
let provider_;
|
|
3738
|
+
let providerPromise;
|
|
3739
|
+
const NAMESPACE = "eip155";
|
|
3740
|
+
let accountsChanged;
|
|
3741
|
+
let chainChanged;
|
|
3742
|
+
let connect;
|
|
3743
|
+
let displayUri;
|
|
3744
|
+
let sessionDelete;
|
|
3745
|
+
let disconnect;
|
|
3746
|
+
return createConnector((config) => ({
|
|
3747
|
+
id: "walletConnect",
|
|
3748
|
+
name: "WalletConnect",
|
|
3749
|
+
type: walletConnect.type,
|
|
3750
|
+
async setup() {
|
|
3751
|
+
const provider = await this.getProvider().catch(() => null);
|
|
3752
|
+
if (!provider) return;
|
|
3753
|
+
if (!connect) {
|
|
3754
|
+
connect = this.onConnect.bind(this);
|
|
3755
|
+
provider.on("connect", connect);
|
|
3756
|
+
}
|
|
3757
|
+
if (!sessionDelete) {
|
|
3758
|
+
sessionDelete = this.onSessionDelete.bind(this);
|
|
3759
|
+
provider.on("session_delete", sessionDelete);
|
|
3760
|
+
}
|
|
3761
|
+
},
|
|
3762
|
+
async connect({ chainId, ...rest } = {}) {
|
|
3763
|
+
try {
|
|
3764
|
+
const provider = await this.getProvider();
|
|
3765
|
+
if (!provider) throw new ProviderNotFoundError();
|
|
3766
|
+
if (!displayUri) {
|
|
3767
|
+
displayUri = this.onDisplayUri;
|
|
3768
|
+
provider.on("display_uri", displayUri);
|
|
3769
|
+
}
|
|
3770
|
+
let targetChainId = chainId;
|
|
3771
|
+
if (!targetChainId) {
|
|
3772
|
+
const state = await config.storage?.getItem("state") ?? {};
|
|
3773
|
+
const isChainSupported = config.chains.some((x) => x.id === state.chainId);
|
|
3774
|
+
if (isChainSupported) targetChainId = state.chainId;
|
|
3775
|
+
else targetChainId = config.chains[0]?.id;
|
|
3776
|
+
}
|
|
3777
|
+
if (!targetChainId) throw new Error("No chains found on connector.");
|
|
3778
|
+
const isChainsStale = await this.isChainsStale();
|
|
3779
|
+
if (provider.session && isChainsStale) await provider.disconnect();
|
|
3780
|
+
if (!provider.session || isChainsStale) {
|
|
3781
|
+
const optionalChains = config.chains.filter((chain) => chain.id !== targetChainId).map((optionalChain) => optionalChain.id);
|
|
3782
|
+
await provider.connect({
|
|
3783
|
+
optionalChains: [targetChainId, ...optionalChains],
|
|
3784
|
+
..."pairingTopic" in rest ? { pairingTopic: rest.pairingTopic } : {}
|
|
3785
|
+
});
|
|
3786
|
+
this.setRequestedChainsIds(config.chains.map((x) => x.id));
|
|
3787
|
+
}
|
|
3788
|
+
const accounts = (await provider.enable()).map((x) => getAddress(x));
|
|
3789
|
+
let currentChainId = await this.getChainId();
|
|
3790
|
+
if (chainId && currentChainId !== chainId) {
|
|
3791
|
+
const chain = await this.switchChain({ chainId }).catch((error2) => {
|
|
3792
|
+
if (error2.code === UserRejectedRequestError.code) throw error2;
|
|
3793
|
+
return { id: currentChainId };
|
|
3794
|
+
});
|
|
3795
|
+
currentChainId = chain?.id ?? currentChainId;
|
|
3796
|
+
}
|
|
3797
|
+
if (displayUri) {
|
|
3798
|
+
provider.removeListener("display_uri", displayUri);
|
|
3799
|
+
displayUri = void 0;
|
|
3800
|
+
}
|
|
3801
|
+
if (connect) {
|
|
3802
|
+
provider.removeListener("connect", connect);
|
|
3803
|
+
connect = void 0;
|
|
3804
|
+
}
|
|
3805
|
+
if (!accountsChanged) {
|
|
3806
|
+
accountsChanged = this.onAccountsChanged.bind(this);
|
|
3807
|
+
provider.on("accountsChanged", accountsChanged);
|
|
3808
|
+
}
|
|
3809
|
+
if (!chainChanged) {
|
|
3810
|
+
chainChanged = this.onChainChanged.bind(this);
|
|
3811
|
+
provider.on("chainChanged", chainChanged);
|
|
3812
|
+
}
|
|
3813
|
+
if (!disconnect) {
|
|
3814
|
+
disconnect = this.onDisconnect.bind(this);
|
|
3815
|
+
provider.on("disconnect", disconnect);
|
|
3816
|
+
}
|
|
3817
|
+
if (!sessionDelete) {
|
|
3818
|
+
sessionDelete = this.onSessionDelete.bind(this);
|
|
3819
|
+
provider.on("session_delete", sessionDelete);
|
|
3820
|
+
}
|
|
3821
|
+
return { accounts, chainId: currentChainId };
|
|
3822
|
+
} catch (error2) {
|
|
3823
|
+
if (/(user rejected|connection request reset)/i.test(error2?.message)) {
|
|
3824
|
+
throw new UserRejectedRequestError(error2);
|
|
3825
|
+
}
|
|
3826
|
+
throw error2;
|
|
3827
|
+
}
|
|
3828
|
+
},
|
|
3829
|
+
async disconnect() {
|
|
3830
|
+
const provider = await this.getProvider();
|
|
3831
|
+
try {
|
|
3832
|
+
await provider?.disconnect();
|
|
3833
|
+
} catch (error2) {
|
|
3834
|
+
if (!/No matching key/i.test(error2.message)) throw error2;
|
|
3835
|
+
} finally {
|
|
3836
|
+
if (chainChanged) {
|
|
3837
|
+
provider?.removeListener("chainChanged", chainChanged);
|
|
3838
|
+
chainChanged = void 0;
|
|
3839
|
+
}
|
|
3840
|
+
if (disconnect) {
|
|
3841
|
+
provider?.removeListener("disconnect", disconnect);
|
|
3842
|
+
disconnect = void 0;
|
|
3843
|
+
}
|
|
3844
|
+
if (!connect) {
|
|
3845
|
+
connect = this.onConnect.bind(this);
|
|
3846
|
+
provider?.on("connect", connect);
|
|
3847
|
+
}
|
|
3848
|
+
if (accountsChanged) {
|
|
3849
|
+
provider?.removeListener("accountsChanged", accountsChanged);
|
|
3850
|
+
accountsChanged = void 0;
|
|
3851
|
+
}
|
|
3852
|
+
if (sessionDelete) {
|
|
3853
|
+
provider?.removeListener("session_delete", sessionDelete);
|
|
3854
|
+
sessionDelete = void 0;
|
|
3855
|
+
}
|
|
3856
|
+
this.setRequestedChainsIds([]);
|
|
3857
|
+
}
|
|
3858
|
+
},
|
|
3859
|
+
async getAccounts() {
|
|
3860
|
+
const provider = await this.getProvider();
|
|
3861
|
+
return provider.accounts.map((x) => getAddress(x));
|
|
3862
|
+
},
|
|
3863
|
+
async getProvider() {
|
|
3864
|
+
async function initProvider() {
|
|
3865
|
+
const optionalChains = config.chains.map((x) => x.id);
|
|
3866
|
+
if (!optionalChains.length) return;
|
|
3867
|
+
const { EthereumProvider } = await import("@walletconnect/ethereum-provider");
|
|
3868
|
+
return await EthereumProvider.init({
|
|
3869
|
+
...parameters,
|
|
3870
|
+
disableProviderPing: true,
|
|
3871
|
+
optionalChains,
|
|
3872
|
+
projectId: parameters.projectId,
|
|
3873
|
+
rpcMap: Object.fromEntries(
|
|
3874
|
+
config.chains.map((chain) => {
|
|
3875
|
+
const [url] = extractRpcUrls({
|
|
3876
|
+
chain,
|
|
3877
|
+
transports: config.transports
|
|
3878
|
+
});
|
|
3879
|
+
return [chain.id, url];
|
|
3880
|
+
})
|
|
3881
|
+
),
|
|
3882
|
+
showQrModal: parameters.showQrModal ?? true
|
|
3883
|
+
});
|
|
3884
|
+
}
|
|
3885
|
+
if (!provider_) {
|
|
3886
|
+
if (!providerPromise) providerPromise = initProvider();
|
|
3887
|
+
provider_ = await providerPromise;
|
|
3888
|
+
provider_?.events.setMaxListeners(Number.POSITIVE_INFINITY);
|
|
3889
|
+
}
|
|
3890
|
+
return provider_;
|
|
3891
|
+
},
|
|
3892
|
+
async getChainId() {
|
|
3893
|
+
const provider = await this.getProvider();
|
|
3894
|
+
return provider.chainId;
|
|
3895
|
+
},
|
|
3896
|
+
async isAuthorized() {
|
|
3897
|
+
try {
|
|
3898
|
+
const [accounts, provider] = await Promise.all([this.getAccounts(), this.getProvider()]);
|
|
3899
|
+
if (!accounts.length) return false;
|
|
3900
|
+
const isChainsStale = await this.isChainsStale();
|
|
3901
|
+
if (isChainsStale && provider.session) {
|
|
3902
|
+
await provider.disconnect().catch(() => {
|
|
3903
|
+
});
|
|
3904
|
+
return false;
|
|
3905
|
+
}
|
|
3906
|
+
return true;
|
|
3907
|
+
} catch {
|
|
3908
|
+
return false;
|
|
3909
|
+
}
|
|
3910
|
+
},
|
|
3911
|
+
async switchChain({ addEthereumChainParameter, chainId }) {
|
|
3912
|
+
const provider = await this.getProvider();
|
|
3913
|
+
if (!provider) throw new ProviderNotFoundError();
|
|
3914
|
+
const chain = config.chains.find((x) => x.id === chainId);
|
|
3915
|
+
if (!chain) throw new SwitchChainError(new ChainNotConfiguredError());
|
|
3916
|
+
try {
|
|
3917
|
+
await Promise.all([
|
|
3918
|
+
new Promise((resolve) => {
|
|
3919
|
+
const listener2 = ({ chainId: currentChainId }) => {
|
|
3920
|
+
if (currentChainId === chainId) {
|
|
3921
|
+
config.emitter.off("change", listener2);
|
|
3922
|
+
resolve();
|
|
3923
|
+
}
|
|
3924
|
+
};
|
|
3925
|
+
config.emitter.on("change", listener2);
|
|
3926
|
+
}),
|
|
3927
|
+
provider.request({
|
|
3928
|
+
method: "wallet_switchEthereumChain",
|
|
3929
|
+
params: [{ chainId: numberToHex3(chainId) }]
|
|
3930
|
+
})
|
|
3931
|
+
]);
|
|
3932
|
+
const requestedChains = await this.getRequestedChainsIds();
|
|
3933
|
+
this.setRequestedChainsIds([...requestedChains, chainId]);
|
|
3934
|
+
return chain;
|
|
3935
|
+
} catch (err) {
|
|
3936
|
+
const error2 = err;
|
|
3937
|
+
if (/(user rejected)/i.test(error2.message)) throw new UserRejectedRequestError(error2);
|
|
3938
|
+
try {
|
|
3939
|
+
let blockExplorerUrls;
|
|
3940
|
+
if (addEthereumChainParameter?.blockExplorerUrls)
|
|
3941
|
+
blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls;
|
|
3942
|
+
else blockExplorerUrls = chain.blockExplorers?.default.url ? [chain.blockExplorers?.default.url] : [];
|
|
3943
|
+
let rpcUrls;
|
|
3944
|
+
if (addEthereumChainParameter?.rpcUrls?.length) rpcUrls = addEthereumChainParameter.rpcUrls;
|
|
3945
|
+
else rpcUrls = [...chain.rpcUrls.default.http];
|
|
3946
|
+
const addEthereumChain = {
|
|
3947
|
+
blockExplorerUrls,
|
|
3948
|
+
chainId: numberToHex3(chainId),
|
|
3949
|
+
chainName: addEthereumChainParameter?.chainName ?? chain.name,
|
|
3950
|
+
iconUrls: addEthereumChainParameter?.iconUrls,
|
|
3951
|
+
nativeCurrency: addEthereumChainParameter?.nativeCurrency ?? chain.nativeCurrency,
|
|
3952
|
+
rpcUrls
|
|
3953
|
+
};
|
|
3954
|
+
await provider.request({
|
|
3955
|
+
method: "wallet_addEthereumChain",
|
|
3956
|
+
params: [addEthereumChain]
|
|
3957
|
+
});
|
|
3958
|
+
const requestedChains = await this.getRequestedChainsIds();
|
|
3959
|
+
this.setRequestedChainsIds([...requestedChains, chainId]);
|
|
3960
|
+
return chain;
|
|
3961
|
+
} catch (error3) {
|
|
3962
|
+
throw new UserRejectedRequestError(error3);
|
|
3963
|
+
}
|
|
3964
|
+
}
|
|
3965
|
+
},
|
|
3966
|
+
onAccountsChanged(accounts) {
|
|
3967
|
+
if (accounts.length === 0) this.onDisconnect();
|
|
3968
|
+
else
|
|
3969
|
+
config.emitter.emit("change", {
|
|
3970
|
+
accounts: accounts.map((x) => getAddress(x))
|
|
3971
|
+
});
|
|
3972
|
+
},
|
|
3973
|
+
onChainChanged(chain) {
|
|
3974
|
+
const chainId = Number(chain);
|
|
3975
|
+
config.emitter.emit("change", { chainId });
|
|
3976
|
+
},
|
|
3977
|
+
async onConnect(connectInfo) {
|
|
3978
|
+
const chainId = Number(connectInfo.chainId);
|
|
3979
|
+
const accounts = await this.getAccounts();
|
|
3980
|
+
config.emitter.emit("connect", { accounts, chainId });
|
|
3981
|
+
},
|
|
3982
|
+
async onDisconnect(_error) {
|
|
3983
|
+
this.setRequestedChainsIds([]);
|
|
3984
|
+
config.emitter.emit("disconnect");
|
|
3985
|
+
const provider = await this.getProvider();
|
|
3986
|
+
if (accountsChanged) {
|
|
3987
|
+
provider.removeListener("accountsChanged", accountsChanged);
|
|
3988
|
+
accountsChanged = void 0;
|
|
3989
|
+
}
|
|
3990
|
+
if (chainChanged) {
|
|
3991
|
+
provider.removeListener("chainChanged", chainChanged);
|
|
3992
|
+
chainChanged = void 0;
|
|
3993
|
+
}
|
|
3994
|
+
if (disconnect) {
|
|
3995
|
+
provider.removeListener("disconnect", disconnect);
|
|
3996
|
+
disconnect = void 0;
|
|
3997
|
+
}
|
|
3998
|
+
if (sessionDelete) {
|
|
3999
|
+
provider.removeListener("session_delete", sessionDelete);
|
|
4000
|
+
sessionDelete = void 0;
|
|
4001
|
+
}
|
|
4002
|
+
if (!connect) {
|
|
4003
|
+
connect = this.onConnect.bind(this);
|
|
4004
|
+
provider.on("connect", connect);
|
|
4005
|
+
}
|
|
4006
|
+
},
|
|
4007
|
+
onDisplayUri(uri) {
|
|
4008
|
+
config.emitter.emit("message", { type: "display_uri", data: uri });
|
|
4009
|
+
},
|
|
4010
|
+
onSessionDelete() {
|
|
4011
|
+
this.onDisconnect();
|
|
4012
|
+
},
|
|
4013
|
+
getNamespaceChainsIds() {
|
|
4014
|
+
if (!provider_) return [];
|
|
4015
|
+
const chainIds = provider_.session?.namespaces[NAMESPACE]?.accounts?.map(
|
|
4016
|
+
(account) => Number.parseInt(account.split(":")[1] || "")
|
|
4017
|
+
);
|
|
4018
|
+
return chainIds ?? [];
|
|
4019
|
+
},
|
|
4020
|
+
async getRequestedChainsIds() {
|
|
4021
|
+
return await config.storage?.getItem(this.requestedChainsStorageKey) ?? [];
|
|
4022
|
+
},
|
|
4023
|
+
/**
|
|
4024
|
+
* Checks if the target chains match the chains that were
|
|
4025
|
+
* initially requested by the connector for the WalletConnect session.
|
|
4026
|
+
* If there is a mismatch, this means that the chains on the connector
|
|
4027
|
+
* are considered stale, and need to be revalidated at a later point (via
|
|
4028
|
+
* connection).
|
|
4029
|
+
*
|
|
4030
|
+
* There may be a scenario where a dapp adds a chain to the
|
|
4031
|
+
* connector later on, however, this chain will not have been approved or rejected
|
|
4032
|
+
* by the wallet. In this case, the chain is considered stale.
|
|
4033
|
+
*/
|
|
4034
|
+
async isChainsStale() {
|
|
4035
|
+
if (!isNewChainsStale) return false;
|
|
4036
|
+
const connectorChains = config.chains.map((x) => x.id);
|
|
4037
|
+
const namespaceChains = this.getNamespaceChainsIds();
|
|
4038
|
+
if (namespaceChains.length && !namespaceChains.some((id) => connectorChains.includes(id))) return false;
|
|
4039
|
+
const requestedChains = await this.getRequestedChainsIds();
|
|
4040
|
+
return !connectorChains.every((id) => requestedChains.includes(id));
|
|
4041
|
+
},
|
|
4042
|
+
async setRequestedChainsIds(chains) {
|
|
4043
|
+
await config.storage?.setItem(this.requestedChainsStorageKey, chains);
|
|
4044
|
+
},
|
|
4045
|
+
get requestedChainsStorageKey() {
|
|
4046
|
+
return `${this.id}.requestedChains`;
|
|
4047
|
+
}
|
|
4048
|
+
}));
|
|
4049
|
+
}
|
|
4050
|
+
function extractRpcUrls(parameters) {
|
|
4051
|
+
const { chain } = parameters;
|
|
4052
|
+
const fallbackUrl = chain.rpcUrls.default.http[0];
|
|
4053
|
+
if (!parameters.transports) return [fallbackUrl];
|
|
4054
|
+
const transport = parameters.transports?.[chain.id]?.({ chain });
|
|
4055
|
+
const transports = transport?.value?.transports || [transport];
|
|
4056
|
+
return transports.map(({ value }) => value?.url || fallbackUrl);
|
|
4057
|
+
}
|
|
4058
|
+
|
|
4059
|
+
// src/createWagmiConfig.ts
|
|
3551
4060
|
function createWagmiConfig(config) {
|
|
4061
|
+
const connectors = [];
|
|
4062
|
+
const shouldUseSafeConnector = !(typeof window === "undefined") && window?.parent !== window;
|
|
4063
|
+
if (shouldUseSafeConnector) {
|
|
4064
|
+
connectors.push(
|
|
4065
|
+
safe({
|
|
4066
|
+
allowedDomains: [/gnosis-safe.io$/, /app.safe.global$/]
|
|
4067
|
+
})
|
|
4068
|
+
);
|
|
4069
|
+
}
|
|
4070
|
+
connectors.push(
|
|
4071
|
+
injected({ target: "metaMask" }),
|
|
4072
|
+
coinbaseWallet({
|
|
4073
|
+
appName: config.appName,
|
|
4074
|
+
overrideIsMetaMask: false
|
|
4075
|
+
})
|
|
4076
|
+
);
|
|
4077
|
+
if (config.walletConnectProjectId) {
|
|
4078
|
+
connectors.push(
|
|
4079
|
+
walletConnect({
|
|
4080
|
+
showQrModal: false,
|
|
4081
|
+
projectId: config.walletConnectProjectId
|
|
4082
|
+
})
|
|
4083
|
+
);
|
|
4084
|
+
}
|
|
3552
4085
|
const configParams = getDefaultConfig({
|
|
3553
4086
|
chains: config.chains,
|
|
3554
4087
|
transports: config.transports,
|
|
3555
4088
|
pollingInterval: config.pollingInterval,
|
|
3556
4089
|
appName: config.appName,
|
|
3557
4090
|
walletConnectProjectId: config.walletConnectProjectId,
|
|
3558
|
-
enableFamily: false
|
|
4091
|
+
enableFamily: false,
|
|
4092
|
+
connectors
|
|
3559
4093
|
});
|
|
3560
4094
|
return createConfig(configParams);
|
|
3561
4095
|
}
|
|
@@ -3608,9 +4142,11 @@ export {
|
|
|
3608
4142
|
EntryKitProvider,
|
|
3609
4143
|
createWagmiConfig,
|
|
3610
4144
|
defineConfig,
|
|
4145
|
+
getFundsQueryOptions,
|
|
3611
4146
|
internal_validateSigner,
|
|
3612
4147
|
useAccountModal,
|
|
3613
4148
|
useEntryKitConfig,
|
|
4149
|
+
useFunds,
|
|
3614
4150
|
useSessionClientReady as useSessionClient
|
|
3615
4151
|
};
|
|
3616
4152
|
//# sourceMappingURL=internal.js.map
|