@starknet-io/get-starknet
Version:
[](https://www.npmjs.com/package/@starknet-io/get-starknet)
1,096 lines (1,095 loc) • 193 kB
JavaScript
function noop() {
}
function run(t) {
return t();
}
function blank_object() {
return /* @__PURE__ */ Object.create(null);
}
function run_all(t) {
t.forEach(run);
}
function is_function(t) {
return typeof t == "function";
}
function safe_not_equal(t, e) {
return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function";
}
let src_url_equal_anchor;
function src_url_equal(t, e) {
return src_url_equal_anchor || (src_url_equal_anchor = document.createElement("a")), src_url_equal_anchor.href = e, t === src_url_equal_anchor.href;
}
function is_empty(t) {
return Object.keys(t).length === 0;
}
function null_to_empty(t) {
return t == null ? "" : t;
}
function append(t, e) {
t.appendChild(e);
}
function append_styles(t, e, r) {
const n = get_root_for_style(t);
if (!n.getElementById(e)) {
const o = element("style");
o.id = e, o.textContent = r, append_stylesheet(n, o);
}
}
function get_root_for_style(t) {
if (!t)
return document;
const e = t.getRootNode ? t.getRootNode() : t.ownerDocument;
return e && e.host ? e : t.ownerDocument;
}
function append_stylesheet(t, e) {
return append(t.head || t, e), e.sheet;
}
function insert(t, e, r) {
t.insertBefore(e, r || null);
}
function detach(t) {
t.parentNode && t.parentNode.removeChild(t);
}
function destroy_each(t, e) {
for (let r = 0; r < t.length; r += 1)
t[r] && t[r].d(e);
}
function element(t) {
return document.createElement(t);
}
function text(t) {
return document.createTextNode(t);
}
function space() {
return text(" ");
}
function listen(t, e, r, n) {
return t.addEventListener(e, r, n), () => t.removeEventListener(e, r, n);
}
function attr(t, e, r) {
r == null ? t.removeAttribute(e) : t.getAttribute(e) !== r && t.setAttribute(e, r);
}
function children(t) {
return Array.from(t.childNodes);
}
function set_data(t, e) {
e = "" + e, t.data !== e && (t.data = e);
}
let current_component;
function set_current_component(t) {
current_component = t;
}
function get_current_component() {
if (!current_component)
throw new Error("Function called outside component initialization");
return current_component;
}
function onMount(t) {
get_current_component().$$.on_mount.push(t);
}
const dirty_components = [], binding_callbacks = [];
let render_callbacks = [];
const flush_callbacks = [], resolved_promise = /* @__PURE__ */ Promise.resolve();
let update_scheduled = !1;
function schedule_update() {
update_scheduled || (update_scheduled = !0, resolved_promise.then(flush));
}
function add_render_callback(t) {
render_callbacks.push(t);
}
const seen_callbacks = /* @__PURE__ */ new Set();
let flushidx = 0;
function flush() {
if (flushidx !== 0)
return;
const t = current_component;
do {
try {
for (; flushidx < dirty_components.length; ) {
const e = dirty_components[flushidx];
flushidx++, set_current_component(e), update(e.$$);
}
} catch (e) {
throw dirty_components.length = 0, flushidx = 0, e;
}
for (set_current_component(null), dirty_components.length = 0, flushidx = 0; binding_callbacks.length; )
binding_callbacks.pop()();
for (let e = 0; e < render_callbacks.length; e += 1) {
const r = render_callbacks[e];
seen_callbacks.has(r) || (seen_callbacks.add(r), r());
}
render_callbacks.length = 0;
} while (dirty_components.length);
for (; flush_callbacks.length; )
flush_callbacks.pop()();
update_scheduled = !1, seen_callbacks.clear(), set_current_component(t);
}
function update(t) {
if (t.fragment !== null) {
t.update(), run_all(t.before_update);
const e = t.dirty;
t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, e), t.after_update.forEach(add_render_callback);
}
}
function flush_render_callbacks(t) {
const e = [], r = [];
render_callbacks.forEach((n) => t.indexOf(n) === -1 ? e.push(n) : r.push(n)), r.forEach((n) => n()), render_callbacks = e;
}
const outroing = /* @__PURE__ */ new Set();
function transition_in(t, e) {
t && t.i && (outroing.delete(t), t.i(e));
}
function mount_component(t, e, r, n) {
const { fragment: o, after_update: s } = t.$$;
o && o.m(e, r), n || add_render_callback(() => {
const i = t.$$.on_mount.map(run).filter(is_function);
t.$$.on_destroy ? t.$$.on_destroy.push(...i) : run_all(i), t.$$.on_mount = [];
}), s.forEach(add_render_callback);
}
function destroy_component(t, e) {
const r = t.$$;
r.fragment !== null && (flush_render_callbacks(r.after_update), run_all(r.on_destroy), r.fragment && r.fragment.d(e), r.on_destroy = r.fragment = null, r.ctx = []);
}
function make_dirty(t, e) {
t.$$.dirty[0] === -1 && (dirty_components.push(t), schedule_update(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31;
}
function init$1(t, e, r, n, o, s, i, a = [-1]) {
const c = current_component;
set_current_component(t);
const l = t.$$ = {
fragment: null,
ctx: [],
props: s,
update: noop,
not_equal: o,
bound: blank_object(),
on_mount: [],
on_destroy: [],
on_disconnect: [],
before_update: [],
after_update: [],
context: new Map(e.context || (c ? c.$$.context : [])),
callbacks: blank_object(),
dirty: a,
skip_bound: !1,
root: e.target || c.$$.root
};
i && i(l.root);
let u = !1;
if (l.ctx = r ? r(t, e.props || {}, (d, h, ...m) => {
const p = m.length ? m[0] : h;
return l.ctx && o(l.ctx[d], l.ctx[d] = p) && (!l.skip_bound && l.bound[d] && l.bound[d](p), u && make_dirty(t, d)), h;
}) : [], l.update(), u = !0, run_all(l.before_update), l.fragment = n ? n(l.ctx) : !1, e.target) {
if (e.hydrate) {
const d = children(e.target);
l.fragment && l.fragment.l(d), d.forEach(detach);
} else
l.fragment && l.fragment.c();
e.intro && transition_in(t.$$.fragment), mount_component(t, e.target, e.anchor, e.customElement), flush();
}
set_current_component(c);
}
class SvelteComponent {
$destroy() {
destroy_component(this, 1), this.$destroy = noop;
}
$on(e, r) {
if (!is_function(r))
return noop;
const n = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
return n.push(r), () => {
const o = n.indexOf(r);
o !== -1 && n.splice(o, 1);
};
}
$set(e) {
this.$$set && !is_empty(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
}
}
function add_css(t) {
append_styles(t, "svelte-j32xt0", `.sr-only.svelte-j32xt0{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.fixed.svelte-j32xt0{position:fixed}.inset-0.svelte-j32xt0{inset:0px}.z-40.svelte-j32xt0{z-index:40}.z-50.svelte-j32xt0{z-index:50}.mx-6.svelte-j32xt0{margin-left:1.5rem;margin-right:1.5rem}.mb-4.svelte-j32xt0{margin-bottom:1rem}.flex.svelte-j32xt0{display:flex}.h-8.svelte-j32xt0{height:2rem}.w-8.svelte-j32xt0{width:2rem}.w-full.svelte-j32xt0{width:100%}.max-w-\\[500px\\].svelte-j32xt0{max-width:500px}@keyframes svelte-j32xt0-spin{to{transform:rotate(360deg)}}.animate-spin.svelte-j32xt0{animation:svelte-j32xt0-spin 1s linear infinite}.cursor-pointer.svelte-j32xt0{cursor:pointer}.flex-col.svelte-j32xt0{flex-direction:column}.items-center.svelte-j32xt0{align-items:center}.justify-center.svelte-j32xt0{justify-content:center}.justify-between.svelte-j32xt0{justify-content:space-between}.gap-3.svelte-j32xt0{gap:0.75rem}.rounded-full.svelte-j32xt0{border-radius:9999px}.rounded-md.svelte-j32xt0{border-radius:0.375rem}.bg-black\\/25.svelte-j32xt0{background-color:rgb(0 0 0 / 0.25)}.bg-slate-100.svelte-j32xt0{--tw-bg-opacity:1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50.svelte-j32xt0{--tw-bg-opacity:1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.fill-neutral-600.svelte-j32xt0{fill:#525252}.p-3.svelte-j32xt0{padding:0.75rem}.p-4.svelte-j32xt0{padding:1rem}.text-center.svelte-j32xt0{text-align:center}.text-xl.svelte-j32xt0{font-size:1.25rem;line-height:1.75rem}.text-neutral-300.svelte-j32xt0{--tw-text-opacity:1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}.antialiased.svelte-j32xt0{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.shadow.svelte-j32xt0{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.shadow-sm.svelte-j32xt0{--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.filter.svelte-j32xt0{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)}.backdrop-blur-sm.svelte-j32xt0{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-colors.svelte-j32xt0{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.svelte-j32xt0,.svelte-j32xt0::before,.svelte-j32xt0::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.svelte-j32xt0::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.svelte-j32xt0,.svelte-j32xt0::before,.svelte-j32xt0::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}.svelte-j32xt0::before,.svelte-j32xt0::after{--tw-content:''}:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}h1.svelte-j32xt0{font-size:inherit;font-weight:inherit}a.svelte-j32xt0{color:inherit;text-decoration:inherit}.svelte-j32xt0:-moz-focusring{outline:auto}.svelte-j32xt0:-moz-ui-invalid{box-shadow:none}.svelte-j32xt0::-webkit-inner-spin-button,.svelte-j32xt0::-webkit-outer-spin-button{height:auto}.svelte-j32xt0::-webkit-search-decoration{-webkit-appearance:none}.svelte-j32xt0::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}h1.svelte-j32xt0{margin:0}ul.svelte-j32xt0{list-style:none;margin:0;padding:0}[role="button"].svelte-j32xt0{cursor:pointer}.svelte-j32xt0:disabled{cursor:default}img.svelte-j32xt0,svg.svelte-j32xt0{display:block;vertical-align:middle}img.svelte-j32xt0{max-width:100%;height:auto}.svelte-j32xt0{font-family:Nunito, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue,
sans-serif;-webkit-font-smoothing:antialiased}.hover\\:bg-slate-200.svelte-j32xt0:hover{--tw-bg-opacity:1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.dark\\:border-neutral-600.svelte-j32xt0:is(.dark *){--tw-border-opacity:1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1))}.dark\\:bg-neutral-800.svelte-j32xt0:is(.dark *){--tw-bg-opacity:1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.dark\\:bg-neutral-900.svelte-j32xt0:is(.dark *){--tw-bg-opacity:1;background-color:rgb(23 23 23 / var(--tw-bg-opacity, 1))}.dark\\:fill-neutral-300.svelte-j32xt0:is(.dark *){fill:#d4d4d4}.dark\\:text-neutral-600.svelte-j32xt0:is(.dark *){--tw-text-opacity:1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.dark\\:text-white.svelte-j32xt0:is(.dark *){--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\\:hover\\:bg-neutral-700.svelte-j32xt0:hover:is(.dark *){--tw-bg-opacity:1;background-color:rgb(64 64 64 / var(--tw-bg-opacity, 1))}`);
}
function get_each_context(t, e, r) {
const n = t.slice();
return n[20] = e[r], n;
}
function get_each_context_1(t, e, r) {
const n = t.slice();
return n[23] = e[r], n;
}
function create_else_block(t) {
let e, r;
return {
c() {
e = element("img"), attr(e, "alt", t[23].name), src_url_equal(e.src, r = t[23].icon) || attr(e, "src", r), attr(e, "class", "w-8 h-8 rounded-full svelte-j32xt0");
},
m(n, o) {
insert(n, e, o);
},
p: noop,
d(n) {
n && detach(e);
}
};
}
function create_if_block(t) {
let e;
return {
c() {
e = element("div"), e.innerHTML = `<svg aria-hidden="true" class="w-8 h-8 text-neutral-300 animate-spin dark:text-neutral-600 fill-neutral-600 dark:fill-neutral-300 svelte-j32xt0" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor" class="svelte-j32xt0"></path><path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill" class="svelte-j32xt0"></path></svg>
<span class="sr-only svelte-j32xt0">Loading...</span>`, attr(e, "role", "status"), attr(e, "class", "svelte-j32xt0");
},
m(r, n) {
insert(r, e, n);
},
p: noop,
d(r) {
r && detach(e);
}
};
}
function create_each_block_1(t) {
let e, r = t[23].name + "", n, o, s, i;
function a(h, m) {
return h[1] === h[23].id ? create_if_block : create_else_block;
}
let c = a(t), l = c(t);
function u() {
return t[12](t[23]);
}
function d(...h) {
return t[13](t[23], ...h);
}
return {
c() {
e = element("li"), n = text(r), o = space(), l.c(), attr(e, "class", "flex justify-between items-center p-3 bg-slate-100 rounded-md cursor-pointer shadow-sm hover:bg-slate-200 transition-colors dark:bg-neutral-800 dark:hover:bg-neutral-700 dark:border-neutral-600 dark:text-white svelte-j32xt0");
},
m(h, m) {
insert(h, e, m), append(e, n), append(e, o), l.m(e, null), s || (i = [
listen(e, "click", u),
listen(e, "keyup", d)
], s = !0);
},
p(h, m) {
t = h, c === (c = a(t)) && l ? l.p(t, m) : (l.d(1), l = c(t), l && (l.c(), l.m(e, null)));
},
d(h) {
h && detach(e), l.d(), s = !1, run_all(i);
}
};
}
function create_each_block(t) {
let e, r, n = t[20].name + "", o, s, i, a, c, l, u, d, h, m;
return {
c() {
e = element("a"), r = element("li"), o = text(n), s = space(), i = element("img"), l = space(), attr(i, "alt", a = t[20].name), src_url_equal(i.src, c = t[20].icon) || attr(i, "src", c), attr(i, "class", "w-8 h-8 rounded-full svelte-j32xt0"), attr(r, "class", "flex justify-between items-center p-3 bg-slate-100 rounded-md shadow-sm cursor-pointer hover:bg-slate-200 transition-colors dark:bg-neutral-800 dark:hover:bg-neutral-700 dark:border-neutral-600 dark:text-white svelte-j32xt0"), attr(e, "alt", u = t[20].name + " download link"), attr(e, "href", d = t[20].download), attr(e, "target", "_blank"), attr(e, "rel", "noopener noreferrer"), attr(e, "class", "svelte-j32xt0");
},
m(p, y) {
insert(p, e, y), append(e, r), append(r, o), append(r, s), append(r, i), append(e, l), h || (m = [
listen(r, "click", t[14]),
listen(r, "keyup", t[15])
], h = !0);
},
p(p, y) {
y & 1 && n !== (n = p[20].name + "") && set_data(o, n), y & 1 && a !== (a = p[20].name) && attr(i, "alt", a), y & 1 && !src_url_equal(i.src, c = p[20].icon) && attr(i, "src", c), y & 1 && u !== (u = p[20].name + " download link") && attr(e, "alt", u), y & 1 && d !== (d = p[20].download) && attr(e, "href", d);
},
d(p) {
p && detach(e), h = !1, run_all(m);
}
};
}
function create_fragment(t) {
let e, r, n, o, s, i, a, c, l, u, d, h, m = t[4], p = [];
for (let g = 0; g < m.length; g += 1)
p[g] = create_each_block_1(get_each_context_1(t, m, g));
let y = t[0], b = [];
for (let g = 0; g < y.length; g += 1)
b[g] = create_each_block(get_each_context(t, y, g));
return {
c() {
e = element("div"), r = element("main"), n = element("header"), o = element("h1"), o.textContent = "Connect a wallet", s = space(), i = element("span"), i.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" height="24px" width="24px" viewBox="0 0 24 24" fill="currentColor" class="svelte-j32xt0"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" class="svelte-j32xt0"></path></svg>', a = space(), c = element("ul");
for (let g = 0; g < p.length; g += 1)
p[g].c();
l = space();
for (let g = 0; g < b.length; g += 1)
b[g].c();
attr(o, "class", "text-xl svelte-j32xt0"), attr(i, "role", "button"), attr(i, "alt", "Close"), attr(i, "class", "cursor-pointer svelte-j32xt0"), attr(n, "class", "flex items-center justify-between mb-4 svelte-j32xt0"), attr(c, "class", "flex flex-col gap-3 svelte-j32xt0"), attr(r, "role", "dialog"), attr(r, "class", null_to_empty("bg-slate-50 rounded-md shadow w-full max-w-[500px] mx-6 p-4 text-center z-50 dark:bg-neutral-900 dark:text-white") + " svelte-j32xt0"), attr(e, "class", u = null_to_empty("backdrop-blur-sm fixed inset-0 flex items-center justify-center bg-black/25 z-40 " + t[2]) + " svelte-j32xt0");
},
m(g, I) {
insert(g, e, I), append(e, r), append(r, n), append(n, o), append(n, s), append(n, i), append(r, a), append(r, c);
for (let M = 0; M < p.length; M += 1)
p[M] && p[M].m(c, null);
append(c, l);
for (let M = 0; M < b.length; M += 1)
b[M] && b[M].m(c, null);
d || (h = [
listen(i, "click", t[10]),
listen(i, "keyup", t[11]),
listen(r, "click", click_handler_3),
listen(r, "keyup", keyup_handler_3),
listen(e, "click", t[16]),
listen(e, "keyup", t[17])
], d = !0);
},
p(g, [I]) {
if (I & 26) {
m = g[4];
let M;
for (M = 0; M < m.length; M += 1) {
const A = get_each_context_1(g, m, M);
p[M] ? p[M].p(A, I) : (p[M] = create_each_block_1(A), p[M].c(), p[M].m(c, l));
}
for (; M < p.length; M += 1)
p[M].d(1);
p.length = m.length;
}
if (I & 9) {
y = g[0];
let M;
for (M = 0; M < y.length; M += 1) {
const A = get_each_context(g, y, M);
b[M] ? b[M].p(A, I) : (b[M] = create_each_block(A), b[M].c(), b[M].m(c, null));
}
for (; M < b.length; M += 1)
b[M].d(1);
b.length = y.length;
}
I & 4 && u !== (u = null_to_empty("backdrop-blur-sm fixed inset-0 flex items-center justify-center bg-black/25 z-40 " + g[2]) + " svelte-j32xt0") && attr(e, "class", u);
},
i: noop,
o: noop,
d(g) {
g && detach(e), destroy_each(p, g), destroy_each(b, g), d = !1, run_all(h);
}
};
}
const click_handler_3 = (t) => t.stopPropagation(), keyup_handler_3 = (t) => t.stopPropagation();
function instance(t, e, r) {
const n = typeof window < "u" ? window : null;
let { lastWallet: o = null } = e, { installedWallets: s = [] } = e, { authorizedWallets: i = [] } = e, { discoveryWallets: a = [] } = e, { callback: c = async () => {
} } = e, { theme: l = null } = e, u = !1, d = async (w) => {
var N;
r(1, u = (N = w == null ? void 0 : w.id) != null ? N : !1), await c(w).catch(() => {
}), r(1, u = !1);
}, h = "";
l === "dark" || l === null && (n == null ? void 0 : n.matchMedia("(prefers-color-scheme: dark)").matches) ? h = "dark" : h = "";
const m = (w) => {
r(2, h = w.matches ? "dark" : "");
};
onMount(() => {
if (l === null)
return n == null || n.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", m), () => {
n == null || n.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change", m);
};
});
const p = [o, ...i, ...s].filter(Boolean), y = () => d(null), b = (w) => {
w.key === "Enter" && d(null);
}, g = (w) => d(w), I = (w, N) => {
N.key === "Enter" && d(w);
}, M = () => d(null), A = (w) => {
w.key === "Enter" && d(null);
}, E = () => d(null), S = (w) => {
w.key === "Escape" && d(null);
};
return t.$$set = (w) => {
"lastWallet" in w && r(5, o = w.lastWallet), "installedWallets" in w && r(6, s = w.installedWallets), "authorizedWallets" in w && r(7, i = w.authorizedWallets), "discoveryWallets" in w && r(0, a = w.discoveryWallets), "callback" in w && r(8, c = w.callback), "theme" in w && r(9, l = w.theme);
}, [
a,
u,
h,
d,
p,
o,
s,
i,
c,
l,
y,
b,
g,
I,
M,
A,
E,
S
];
}
class Modal extends SvelteComponent {
constructor(e) {
super(), init$1(
this,
e,
instance,
create_fragment,
safe_not_equal,
{
lastWallet: 5,
installedWallets: 6,
authorizedWallets: 7,
discoveryWallets: 0,
callback: 8,
theme: 9
},
add_css
);
}
}
function excludeWallets(t, e) {
return t.filter((r) => !e.some((n) => n.id === r.id));
}
async function show({
discoveryWallets: t,
installedWallets: e,
lastWallet: r,
authorizedWallets: n,
enable: o,
modalOptions: s
}) {
return new Promise((i) => {
var l;
const a = [r].filter(Boolean);
n = excludeWallets(n, a), e = excludeWallets(e, [
...a,
...n
]), t = excludeWallets(t, [
...a,
...e,
...n
]);
const c = new Modal({
target: document.body,
props: {
callback: async (u) => {
var h;
const d = (h = await (o == null ? void 0 : o(u))) != null ? h : u;
c.$destroy(), i(d);
},
lastWallet: r,
installedWallets: e,
authorizedWallets: n,
discoveryWallets: t,
theme: (s == null ? void 0 : s.theme) === "system" ? null : (l = s == null ? void 0 : s.theme) != null ? l : null
}
});
});
}
var te = Object.defineProperty, re = (t, e, r) => e in t ? te(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, O = (t, e, r) => (re(t, typeof e != "symbol" ? e + "" : e, r), r), Z = (t, e, r) => {
if (!e.has(t))
throw TypeError("Cannot " + r);
}, v = (t, e, r) => (Z(t, e, "read from private field"), r ? r.call(t) : e.get(t)), L = (t, e, r) => {
if (e.has(t))
throw TypeError("Cannot add the same private member more than once");
e instanceof WeakSet ? e.add(t) : e.set(t, r);
}, G = (t, e, r, n) => (Z(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r), _ = (t, e, r) => (Z(t, e, "access private method"), r);
const generateUID = () => `${Date.now()}-${Math.floor(Math.random() * 8999999999999) + 1e12}`, shuffle = (t) => {
for (let e = t.length - 1; e > 0; e--) {
const r = Math.floor(Math.random() * (e + 1));
[t[e], t[r]] = [t[r], t[e]];
}
return t;
}, pipe$1 = (...t) => (e) => t.reduce((r, n) => r.then(n), Promise.resolve(e));
function ensureKeysArray(t) {
return Object.keys(t);
}
const ssrSafeWindow$1 = typeof window < "u" ? window : null;
function getBuilderId() {
return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
}
function isDebugMode$1() {
return Boolean("");
}
function isBrowserEnv$1() {
return typeof window < "u";
}
const LOG_CATEGORY$1 = "[ Federation Runtime ]";
function assert(t, e) {
t || error(e);
}
function error(t) {
throw t instanceof Error ? (t.message = `${LOG_CATEGORY$1}: ${t.message}`, t) : new Error(`${LOG_CATEGORY$1}: ${t}`);
}
function warn$1(t) {
t instanceof Error ? (t.message = `${LOG_CATEGORY$1}: ${t.message}`, console.warn(t)) : console.warn(`${LOG_CATEGORY$1}: ${t}`);
}
function addUniqueItem(t, e) {
return t.findIndex((r) => r === e) === -1 && t.push(e), t;
}
function getFMId(t) {
return "version" in t && t.version ? `${t.name}:${t.version}` : "entry" in t && t.entry ? `${t.name}:${t.entry}` : `${t.name}`;
}
function isRemoteInfoWithEntry(t) {
return typeof t.entry < "u";
}
function isPureRemoteEntry(t) {
return !t.entry.includes(".json") && t.entry.includes(".js");
}
function safeToString$1(t) {
try {
return JSON.stringify(t, null, 2);
} catch {
return "";
}
}
function isObject(t) {
return t && typeof t == "object";
}
const objectToString = Object.prototype.toString;
function isPlainObject(t) {
return objectToString.call(t) === "[object Object]";
}
function arrayOptions(t) {
return Array.isArray(t) ? t : [
t
];
}
function _extends$1$1() {
return _extends$1$1 = Object.assign || function(t) {
for (var e = 1; e < arguments.length; e++) {
var r = arguments[e];
for (var n in r)
Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]);
}
return t;
}, _extends$1$1.apply(this, arguments);
}
function _object_without_properties_loose$1(t, e) {
if (t == null)
return {};
var r = {}, n = Object.keys(t), o, s;
for (s = 0; s < n.length; s++)
o = n[s], !(e.indexOf(o) >= 0) && (r[o] = t[o]);
return r;
}
const nativeGlobal = (() => {
try {
return new Function("return this")();
} catch {
return globalThis;
}
})(), Global = nativeGlobal;
function definePropertyGlobalVal(t, e, r) {
Object.defineProperty(t, e, {
value: r,
configurable: !1,
writable: !0
});
}
function includeOwnProperty(t, e) {
return Object.hasOwnProperty.call(t, e);
}
includeOwnProperty(globalThis, "__GLOBAL_LOADING_REMOTE_ENTRY__") || definePropertyGlobalVal(globalThis, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
const globalLoading = globalThis.__GLOBAL_LOADING_REMOTE_ENTRY__;
function setGlobalDefaultVal(t) {
var e, r, n, o, s, i;
includeOwnProperty(t, "__VMOK__") && !includeOwnProperty(t, "__FEDERATION__") && definePropertyGlobalVal(t, "__FEDERATION__", t.__VMOK__), includeOwnProperty(t, "__FEDERATION__") || (definePropertyGlobalVal(t, "__FEDERATION__", {
__GLOBAL_PLUGIN__: [],
__INSTANCES__: [],
moduleInfo: {},
__SHARE__: {},
__MANIFEST_LOADING__: {},
__PRELOADED_MAP__: /* @__PURE__ */ new Map()
}), definePropertyGlobalVal(t, "__VMOK__", t.__FEDERATION__)), (e = t.__FEDERATION__).__GLOBAL_PLUGIN__ != null || (e.__GLOBAL_PLUGIN__ = []), (r = t.__FEDERATION__).__INSTANCES__ != null || (r.__INSTANCES__ = []), (n = t.__FEDERATION__).moduleInfo != null || (n.moduleInfo = {}), (o = t.__FEDERATION__).__SHARE__ != null || (o.__SHARE__ = {}), (s = t.__FEDERATION__).__MANIFEST_LOADING__ != null || (s.__MANIFEST_LOADING__ = {}), (i = t.__FEDERATION__).__PRELOADED_MAP__ != null || (i.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
}
setGlobalDefaultVal(globalThis);
setGlobalDefaultVal(nativeGlobal);
function getGlobalFederationInstance(t, e) {
const r = getBuilderId();
return globalThis.__FEDERATION__.__INSTANCES__.find((n) => !!(r && n.options.id === getBuilderId() || n.options.name === t && !n.options.version && !e || n.options.name === t && e && n.options.version === e));
}
function setGlobalFederationInstance(t) {
globalThis.__FEDERATION__.__INSTANCES__.push(t);
}
function getGlobalFederationConstructor() {
return globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__;
}
function setGlobalFederationConstructor(t, e = isDebugMode$1()) {
e && (globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = t, globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.21");
}
function getInfoWithoutType(t, e) {
if (typeof e == "string") {
if (t[e])
return {
value: t[e],
key: e
};
{
const r = Object.keys(t);
for (const n of r) {
const [o, s] = n.split(":"), i = `${o}:${e}`, a = t[i];
if (a)
return {
value: a,
key: i
};
}
return {
value: void 0,
key: e
};
}
} else
throw new Error("key must be string");
}
const getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo, getTargetSnapshotInfoByModuleInfo = (t, e) => {
const r = getFMId(t), n = getInfoWithoutType(e, r).value;
if (n && !n.version && "version" in t && t.version && (n.version = t.version), n)
return n;
if ("version" in t && t.version) {
const { version: o } = t, s = _object_without_properties_loose$1(t, [
"version"
]), i = getFMId(s), a = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, i).value;
if ((a == null ? void 0 : a.version) === o)
return a;
}
}, getGlobalSnapshotInfoByModuleInfo = (t) => getTargetSnapshotInfoByModuleInfo(t, nativeGlobal.__FEDERATION__.moduleInfo), setGlobalSnapshotInfoByModuleInfo = (t, e) => {
const r = getFMId(t);
return nativeGlobal.__FEDERATION__.moduleInfo[r] = e, nativeGlobal.__FEDERATION__.moduleInfo;
}, addGlobalSnapshot = (t) => (nativeGlobal.__FEDERATION__.moduleInfo = _extends$1$1({}, nativeGlobal.__FEDERATION__.moduleInfo, t), () => {
const e = Object.keys(t);
for (const r of e)
delete nativeGlobal.__FEDERATION__.moduleInfo[r];
}), getRemoteEntryExports = (t, e) => {
const r = e || `__FEDERATION_${t}:custom__`, n = globalThis[r];
return {
remoteEntryKey: r,
entryExports: n
};
}, getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__, getPreloaded = (t) => globalThis.__FEDERATION__.__PRELOADED_MAP__.get(t), setPreloaded = (t) => globalThis.__FEDERATION__.__PRELOADED_MAP__.set(t, !0), DEFAULT_SCOPE = "default", DEFAULT_REMOTE_TYPE = "global", buildIdentifier = "[0-9A-Za-z-]+", build = `(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`, numericIdentifier = "0|[1-9]\\d*", numericIdentifierLoose = "[0-9]+", nonNumericIdentifier = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", preReleaseIdentifierLoose = `(?:${numericIdentifierLoose}|${nonNumericIdentifier})`, preReleaseLoose = `(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`, preReleaseIdentifier = `(?:${numericIdentifier}|${nonNumericIdentifier})`, preRelease = `(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`, xRangeIdentifier = `${numericIdentifier}|x|X|\\*`, xRangePlain = `[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`, hyphenRange = `^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`, mainVersionLoose = `(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`, loosePlain = `[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`, gtlt = "((?:<|>)?=?)", comparatorTrim = `(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`, loneTilde = "(?:~>?)", tildeTrim = `(\\s*)${loneTilde}\\s+`, loneCaret = "(?:\\^)", caretTrim = `(\\s*)${loneCaret}\\s+`, star = "(<|>)?=?\\s*\\*", caret = `^${loneCaret}${xRangePlain}$`, mainVersion = `(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`, fullPlain = `v?${mainVersion}${preRelease}?${build}?`, tilde = `^${loneTilde}${xRangePlain}$`, xRange = `^${gtlt}\\s*${xRangePlain}$`, comparator = `^${gtlt}\\s*(${fullPlain})$|^$`, gte0 = "^\\s*>=\\s*0.0.0\\s*$";
function parseRegex(t) {
return new RegExp(t);
}
function isXVersion(t) {
return !t || t.toLowerCase() === "x" || t === "*";
}
function pipe(...t) {
return (e) => t.reduce((r, n) => n(r), e);
}
function extractComparator(t) {
return t.match(parseRegex(comparator));
}
function combineVersion(t, e, r, n) {
const o = `${t}.${e}.${r}`;
return n ? `${o}-${n}` : o;
}
function parseHyphen(t) {
return t.replace(parseRegex(hyphenRange), (e, r, n, o, s, i, a, c, l, u, d, h) => (isXVersion(n) ? r = "" : isXVersion(o) ? r = `>=${n}.0.0` : isXVersion(s) ? r = `>=${n}.${o}.0` : r = `>=${r}`, isXVersion(l) ? c = "" : isXVersion(u) ? c = `<${Number(l) + 1}.0.0-0` : isXVersion(d) ? c = `<${l}.${Number(u) + 1}.0-0` : h ? c = `<=${l}.${u}.${d}-${h}` : c = `<=${c}`, `${r} ${c}`.trim()));
}
function parseComparatorTrim(t) {
return t.replace(parseRegex(comparatorTrim), "$1$2$3");
}
function parseTildeTrim(t) {
return t.replace(parseRegex(tildeTrim), "$1~");
}
function parseCaretTrim(t) {
return t.replace(parseRegex(caretTrim), "$1^");
}
function parseCarets(t) {
return t.trim().split(/\s+/).map((e) => e.replace(parseRegex(caret), (r, n, o, s, i) => isXVersion(n) ? "" : isXVersion(o) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : isXVersion(s) ? n === "0" ? `>=${n}.${o}.0 <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.0 <${Number(n) + 1}.0.0-0` : i ? n === "0" ? o === "0" ? `>=${n}.${o}.${s}-${i} <${n}.${o}.${Number(s) + 1}-0` : `>=${n}.${o}.${s}-${i} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s}-${i} <${Number(n) + 1}.0.0-0` : n === "0" ? o === "0" ? `>=${n}.${o}.${s} <${n}.${o}.${Number(s) + 1}-0` : `>=${n}.${o}.${s} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s} <${Number(n) + 1}.0.0-0`)).join(" ");
}
function parseTildes(t) {
return t.trim().split(/\s+/).map((e) => e.replace(parseRegex(tilde), (r, n, o, s, i) => isXVersion(n) ? "" : isXVersion(o) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : isXVersion(s) ? `>=${n}.${o}.0 <${n}.${Number(o) + 1}.0-0` : i ? `>=${n}.${o}.${s}-${i} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s} <${n}.${Number(o) + 1}.0-0`)).join(" ");
}
function parseXRanges(t) {
return t.split(/\s+/).map((e) => e.trim().replace(parseRegex(xRange), (r, n, o, s, i, a) => {
const c = isXVersion(o), l = c || isXVersion(s), u = l || isXVersion(i);
return n === "=" && u && (n = ""), a = "", c ? n === ">" || n === "<" ? "<0.0.0-0" : "*" : n && u ? (l && (s = 0), i = 0, n === ">" ? (n = ">=", l ? (o = Number(o) + 1, s = 0, i = 0) : (s = Number(s) + 1, i = 0)) : n === "<=" && (n = "<", l ? o = Number(o) + 1 : s = Number(s) + 1), n === "<" && (a = "-0"), `${n + o}.${s}.${i}${a}`) : l ? `>=${o}.0.0${a} <${Number(o) + 1}.0.0-0` : u ? `>=${o}.${s}.0${a} <${o}.${Number(s) + 1}.0-0` : r;
})).join(" ");
}
function parseStar(t) {
return t.trim().replace(parseRegex(star), "");
}
function parseGTE0(t) {
return t.trim().replace(parseRegex(gte0), "");
}
function compareAtom(t, e) {
return t = Number(t) || t, e = Number(e) || e, t > e ? 1 : t === e ? 0 : -1;
}
function comparePreRelease(t, e) {
const { preRelease: r } = t, { preRelease: n } = e;
if (r === void 0 && Boolean(n))
return 1;
if (Boolean(r) && n === void 0)
return -1;
if (r === void 0 && n === void 0)
return 0;
for (let o = 0, s = r.length; o <= s; o++) {
const i = r[o], a = n[o];
if (i !== a)
return i === void 0 && a === void 0 ? 0 : i ? a ? compareAtom(i, a) : -1 : 1;
}
return 0;
}
function compareVersion(t, e) {
return compareAtom(t.major, e.major) || compareAtom(t.minor, e.minor) || compareAtom(t.patch, e.patch) || comparePreRelease(t, e);
}
function eq(t, e) {
return t.version === e.version;
}
function compare(t, e) {
switch (t.operator) {
case "":
case "=":
return eq(t, e);
case ">":
return compareVersion(t, e) < 0;
case ">=":
return eq(t, e) || compareVersion(t, e) < 0;
case "<":
return compareVersion(t, e) > 0;
case "<=":
return eq(t, e) || compareVersion(t, e) > 0;
case void 0:
return !0;
default:
return !1;
}
}
function parseComparatorString(t) {
return pipe(
parseCarets,
parseTildes,
parseXRanges,
parseStar
)(t);
}
function parseRange(t) {
return pipe(
parseHyphen,
parseComparatorTrim,
parseTildeTrim,
parseCaretTrim
)(t.trim()).split(/\s+/).join(" ");
}
function satisfy(t, e) {
if (!t)
return !1;
const r = parseRange(e).split(" ").map((u) => parseComparatorString(u)).join(" ").split(/\s+/).map((u) => parseGTE0(u)), n = extractComparator(t);
if (!n)
return !1;
const [, o, , s, i, a, c] = n, l = {
operator: o,
version: combineVersion(s, i, a, c),
major: s,
minor: i,
patch: a,
preRelease: c == null ? void 0 : c.split(".")
};
for (const u of r) {
const d = extractComparator(u);
if (!d)
return !1;
const [, h, , m, p, y, b] = d, g = {
operator: h,
version: combineVersion(m, p, y, b),
major: m,
minor: p,
patch: y,
preRelease: b == null ? void 0 : b.split(".")
};
if (!compare(g, l))
return !1;
}
return !0;
}
function _extends$8() {
return _extends$8 = Object.assign || function(t) {
for (var e = 1; e < arguments.length; e++) {
var r = arguments[e];
for (var n in r)
Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]);
}
return t;
}, _extends$8.apply(this, arguments);
}
function formatShare(t, e, r) {
let n;
"get" in t ? n = t.get : "lib" in t ? n = () => Promise.resolve(t.lib) : n = () => Promise.resolve(() => {
throw new Error(`Can not get shared '${r}'!`);
});
var o, s;
return _extends$8({
deps: [],
useIn: [],
from: e,
loading: null
}, t, {
shareConfig: _extends$8({
requiredVersion: `^${t.version}`,
singleton: !1,
eager: !1,
strictVersion: !1
}, t.shareConfig),
get: n,
loaded: "lib" in t ? !0 : void 0,
version: (o = t.version) != null ? o : "0",
scope: Array.isArray(t.scope) ? t.scope : [
(s = t.scope) != null ? s : "default"
],
strategy: t.strategy || "version-first"
});
}
function formatShareConfigs(t, e) {
const r = e.shared || {}, n = e.name, o = Object.keys(r).reduce((i, a) => {
const c = arrayOptions(r[a]);
return i[a] = i[a] || [], c.forEach((l) => {
i[a].push(formatShare(l, n, a));
}), i;
}, {}), s = _extends$8({}, t.shared);
return Object.keys(o).forEach((i) => {
s[i] ? o[i].forEach((a) => {
s[i].find((c) => c.version === a.version) || s[i].push(a);
}) : s[i] = o[i];
}), {
shared: s,
shareInfos: o
};
}
function versionLt(t, e) {
const r = (n) => {
if (!Number.isNaN(Number(n))) {
const o = n.split(".");
let s = n;
for (let i = 0; i < 3 - o.length; i++)
s += ".0";
return s;
}
return n;
};
return !!satisfy(r(t), `<=${r(e)}`);
}
const findVersion = (t, e) => {
const r = e || function(n, o) {
return versionLt(n, o);
};
return Object.keys(t).reduce((n, o) => !n || r(n, o) || n === "0" ? o : n, 0);
}, isLoaded = (t) => Boolean(t.loaded) || typeof t.lib == "function";
function findSingletonVersionOrderByVersion(t, e, r) {
const n = t[e][r], o = function(s, i) {
return !isLoaded(n[s]) && versionLt(s, i);
};
return findVersion(t[e][r], o);
}
function findSingletonVersionOrderByLoaded(t, e, r) {
const n = t[e][r], o = function(s, i) {
return isLoaded(n[i]) ? isLoaded(n[s]) ? Boolean(versionLt(s, i)) : !0 : isLoaded(n[s]) ? !1 : versionLt(s, i);
};
return findVersion(t[e][r], o);
}
function getFindShareFunction(t) {
return t === "loaded-first" ? findSingletonVersionOrderByLoaded : findSingletonVersionOrderByVersion;
}
function getRegisteredShare(t, e, r, n) {
if (!t)
return;
const { shareConfig: o, scope: s = DEFAULT_SCOPE, strategy: i } = r, a = Array.isArray(s) ? s : [
s
];
for (const c of a)
if (o && t[c] && t[c][e]) {
const { requiredVersion: l } = o, u = getFindShareFunction(i)(t, c, e), d = () => {
if (o.singleton) {
if (typeof l == "string" && !satisfy(u, l)) {
const m = `Version ${u} from ${u && t[c][e][u].from} of shared singleton module ${e} does not satisfy the requirement of ${r.from} which needs ${l})`;
o.strictVersion ? error(m) : warn$1(m);
}
return t[c][e][u];
} else {
if (l === !1 || l === "*" || satisfy(u, l))
return t[c][e][u];
for (const [m, p] of Object.entries(t[c][e]))
if (satisfy(m, l))
return p;
}
}, h = {
shareScopeMap: t,
scope: c,
pkgName: e,
version: u,
GlobalFederation: Global.__FEDERATION__,
resolver: d
};
return (n.emit(h) || h).resolver();
}
}
function getGlobalShareScope() {
return Global.__FEDERATION__.__SHARE__;
}
function getTargetSharedOptions(t) {
const { pkgName: e, extraOptions: r, shareInfos: n } = t, o = (a) => {
if (!a)
return;
const c = {};
a.forEach((u) => {
c[u.version] = u;
});
const l = findVersion(c, function(u, d) {
return !isLoaded(c[u]) && versionLt(u, d);
});
return c[l];
};
var s;
const i = (s = r == null ? void 0 : r.resolver) != null ? s : o;
return Object.assign({}, i(n[e]), r == null ? void 0 : r.customShareInfo);
}
function _define_property$4(t, e, r) {
return e in t ? Object.defineProperty(t, e, {
value: r,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[e] = r, t;
}
var MANIFEST_EXT = ".json", BROWSER_LOG_KEY = "FEDERATION_DEBUG", BROWSER_LOG_VALUE = "1", NameTransformSymbol = {
AT: "@",
HYPHEN: "-",
SLASH: "/"
}, _obj, NameTransformMap = (_obj = {}, _define_property$4(_obj, NameTransformSymbol.AT, "scope_"), _define_property$4(_obj, NameTransformSymbol.HYPHEN, "_"), _define_property$4(_obj, NameTransformSymbol.SLASH, "__"), _obj), _obj1;
_obj1 = {}, _define_property$4(_obj1, NameTransformMap[NameTransformSymbol.AT], NameTransformSymbol.AT), _define_property$4(_obj1, NameTransformMap[NameTransformSymbol.HYPHEN], NameTransformSymbol.HYPHEN), _define_property$4(_obj1, NameTransformMap[NameTransformSymbol.SLASH], NameTransformSymbol.SLASH);
var SEPARATOR = ":";
function isBrowserEnv() {
return typeof window < "u";
}
function isDebugMode() {
return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? Boolean(process.env.FEDERATION_DEBUG) : typeof FEDERATION_DEBUG < "u" && Boolean(FEDERATION_DEBUG);
}
function _array_like_to_array$2(t, e) {
(e == null || e > t.length) && (e = t.length);
for (var r = 0, n = new Array(e); r < e; r++)
n[r] = t[r];
return n;
}
function _array_without_holes(t) {
if (Array.isArray(t))
return _array_like_to_array$2(t);
}
function _class_call_check(t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(t, e) {
for (var r = 0; r < e.length; r++) {
var n = e[r];
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
}
}
function _create_class(t, e, r) {
return e && _defineProperties(t.prototype, e), r && _defineProperties(t, r), t;
}
function _define_property$3(t, e, r) {
return e in t ? Object.defineProperty(t, e, {
value: r,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[e] = r, t;
}
function _iterable_to_array$1(t) {
if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null)
return Array.from(t);
}
function _non_iterable_spread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _to_consumable_array(t) {
return _array_without_holes(t) || _iterable_to_array$1(t) || _unsupported_iterable_to_array$2(t) || _non_iterable_spread();
}
function _unsupported_iterable_to_array$2(t, e) {
if (t) {
if (typeof t == "string")
return _array_like_to_array$2(t, e);
var r = Object.prototype.toString.call(t).slice(8, -1);
if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set")
return Array.from(r);
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))
return _array_like_to_array$2(t, e);
}
}
function safeToString(t) {
try {
return JSON.stringify(t, null, 2);
} catch {
return "";
}
}
var DEBUG_LOG = "[ FEDERATION DEBUG ]";
function safeGetLocalStorageItem() {
try {
if (typeof window < "u" && window.localStorage)
return localStorage.getItem(BROWSER_LOG_KEY) === BROWSER_LOG_VALUE;
} catch {
return typeof document < "u";
}
return !1;
}
var Logger = /* @__PURE__ */ function() {
function t(e) {
_class_call_check(this, t), _define_property$3(this, "enable", !1), _define_property$3(this, "identifier", void 0), this.identifier = e || DEBUG_LOG, isBrowserEnv() && safeGetLocalStorageItem() ? this.enable = !0 : isDebugMode() && (this.enable = !0);
}
return _create_class(t, [
{
key: "info",
value: function(e, r) {
if (this.enable) {
var n = safeToString(r) || "";
isBrowserEnv() ? console.info("%c ".concat(this.identifier, ": ").concat(e, " ").concat(n), "color:#3300CC") : console.info("\x1B[34m%s", "".concat(this.identifier, ": ").concat(e, " ").concat(n ? `
`.concat(n) : ""));
}
}
},
{
key: "logOriginalInfo",
value: function() {
for (var e = arguments.length, r = new Array(e), n = 0; n < e; n++)
r[n] = arguments[n];
if (this.enable)
if (isBrowserEnv()) {
var o;
console.info("%c ".concat(this.identifier, ": OriginalInfo"), "color:#3300CC"), (o = console).log.apply(o, _to_consumable_array(r));
} else {
var s;
console.info("%c ".concat(this.identifier, ": OriginalInfo"), "color:#3300CC"), (s = console).log.apply(s, _to_consumable_array(r));
}
}
}
]), t;
}(), LOG_CATEGORY = "[ Federation Runtime ]";
new Logger();
var composeKeyWithSeparator = function() {
for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++)
e[r] = arguments[r];
return e.length ? e.reduce(function(n, o) {
return o ? n ? "".concat(n).concat(SEPARATOR).concat(o) : o : n;
}, "") : "";
}, getResourceUrl = function(t, e) {
if ("getPublicPath" in t) {
var r = new Function(t.getPublicPath)();
return "".concat(r).concat(e);
} else
return "publicPath" in t ? "".concat(t.publicPath).concat(e) : (console.warn("Can not get resource url, if in debug mode, please ignore", t, e), "");
}, warn = function(t) {
console.warn("".concat(LOG_CATEGORY, ": ").concat(t));
};
function _define_property$2(t, e, r) {
return e in t ? Object.defineProperty(t, e, {
value: r,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[e] = r, t;
}
function _object_spread$2(t) {
for (var e = 1; e < arguments.length; e++) {
var r = arguments[e] != null ? arguments[e] : {}, n = Object.keys(r);
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(r).filter(function(o) {
return Object.getOwnPropertyDescriptor(r, o).enumerable;
}))), n.forEach(function(o) {
_define_property$2(t, o, r[o]);
});
}
return t;
}
function ownKeys(t, e) {
var r = Object.keys(t);
if (Object.getOwnPropertySymbols) {