@tonconnect/ui-react 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -26,7 +26,7 @@ var __objRest = (source, exclude) => {
26
26
  }
27
27
  return target;
28
28
  };
29
- import require$$0$2, { createContext as createContext$1, memo as memo$1, useContext as useContext$1, useEffect, useState } from "react";
29
+ import require$$0$2, { createContext as createContext$1, memo, useContext as useContext$1, useEffect, useState } from "react";
30
30
  var commonjsGlobal$1 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
31
31
  function getAugmentedNamespace$1(n2) {
32
32
  var f = n2.default;
@@ -4852,7 +4852,7 @@ let Updates = null;
4852
4852
  let Effects = null;
4853
4853
  let ExecCount = 0;
4854
4854
  function createRoot(fn, detachedOwner) {
4855
- const listener = Listener, owner = Owner, unowned = fn.length === 0, root = unowned && true ? UNOWNED : {
4855
+ const listener = Listener, owner = Owner, unowned = fn.length === 0, root = unowned ? UNOWNED : {
4856
4856
  owned: null,
4857
4857
  cleanups: null,
4858
4858
  context: null,
@@ -4948,8 +4948,8 @@ function createResource(pSource, pFetcher, pOptions) {
4948
4948
  runUpdates(() => {
4949
4949
  if (!err)
4950
4950
  setValue(() => v);
4951
- setError(err);
4952
4951
  setState(err ? "errored" : "ready");
4952
+ setError(err);
4953
4953
  for (const c2 of contexts.keys())
4954
4954
  c2.decrement();
4955
4955
  contexts.clear();
@@ -4988,7 +4988,7 @@ function createResource(pSource, pFetcher, pOptions) {
4988
4988
  refetching
4989
4989
  }));
4990
4990
  if (typeof p2 !== "object" || !(p2 && "then" in p2)) {
4991
- loadEnd(pr, p2);
4991
+ loadEnd(pr, p2, void 0, lookup2);
4992
4992
  return p2;
4993
4993
  }
4994
4994
  pr = p2;
@@ -4998,7 +4998,7 @@ function createResource(pSource, pFetcher, pOptions) {
4998
4998
  setState(resolved ? "refreshing" : "pending");
4999
4999
  trigger();
5000
5000
  }, false);
5001
- return p2.then((v) => loadEnd(p2, v, void 0, lookup2), (e2) => loadEnd(p2, void 0, castError(e2)));
5001
+ return p2.then((v) => loadEnd(p2, v, void 0, lookup2), (e2) => loadEnd(p2, void 0, castError(e2), lookup2));
5002
5002
  }
5003
5003
  Object.defineProperties(read, {
5004
5004
  state: {
@@ -5037,11 +5037,13 @@ function batch(fn) {
5037
5037
  return runUpdates(fn, false);
5038
5038
  }
5039
5039
  function untrack(fn) {
5040
- let result, listener = Listener;
5040
+ const listener = Listener;
5041
5041
  Listener = null;
5042
- result = fn();
5043
- Listener = listener;
5044
- return result;
5042
+ try {
5043
+ return fn();
5044
+ } finally {
5045
+ Listener = listener;
5046
+ }
5045
5047
  }
5046
5048
  function on(deps, fn, options) {
5047
5049
  const isArray = Array.isArray(deps);
@@ -5079,7 +5081,7 @@ function onCleanup(fn) {
5079
5081
  function getListener() {
5080
5082
  return Listener;
5081
5083
  }
5082
- function createContext(defaultValue) {
5084
+ function createContext(defaultValue, options) {
5083
5085
  const id = Symbol("context");
5084
5086
  return {
5085
5087
  id,
@@ -5377,7 +5379,7 @@ function resolveChildren(children2) {
5377
5379
  }
5378
5380
  return children2;
5379
5381
  }
5380
- function createProvider(id) {
5382
+ function createProvider(id, options) {
5381
5383
  return function provider(props) {
5382
5384
  let res;
5383
5385
  createRenderEffect(() => res = untrack(() => {
@@ -5385,7 +5387,7 @@ function createProvider(id) {
5385
5387
  [id]: props.value
5386
5388
  };
5387
5389
  return children(() => props.children);
5388
- }));
5390
+ }), void 0);
5389
5391
  return res;
5390
5392
  };
5391
5393
  }
@@ -5497,6 +5499,8 @@ const propTraps = {
5497
5499
  return _.get(property);
5498
5500
  },
5499
5501
  has(_, property) {
5502
+ if (property === $PROXY)
5503
+ return true;
5500
5504
  return _.has(property);
5501
5505
  },
5502
5506
  set: trueFn,
@@ -5517,68 +5521,116 @@ const propTraps = {
5517
5521
  }
5518
5522
  };
5519
5523
  function resolveSource(s2) {
5520
- return (s2 = typeof s2 === "function" ? s2() : s2) == null ? {} : s2;
5524
+ return !(s2 = typeof s2 === "function" ? s2() : s2) ? {} : s2;
5521
5525
  }
5522
5526
  function mergeProps(...sources) {
5523
- return new Proxy({
5524
- get(property) {
5525
- for (let i2 = sources.length - 1; i2 >= 0; i2--) {
5526
- const v = resolveSource(sources[i2])[property];
5527
- if (v !== void 0)
5528
- return v;
5529
- }
5530
- },
5531
- has(property) {
5532
- for (let i2 = sources.length - 1; i2 >= 0; i2--) {
5533
- if (property in resolveSource(sources[i2]))
5534
- return true;
5527
+ let proxy = false;
5528
+ for (let i2 = 0; i2 < sources.length; i2++) {
5529
+ const s2 = sources[i2];
5530
+ proxy = proxy || !!s2 && $PROXY in s2;
5531
+ sources[i2] = typeof s2 === "function" ? (proxy = true, createMemo(s2)) : s2;
5532
+ }
5533
+ if (proxy) {
5534
+ return new Proxy({
5535
+ get(property) {
5536
+ for (let i2 = sources.length - 1; i2 >= 0; i2--) {
5537
+ const v = resolveSource(sources[i2])[property];
5538
+ if (v !== void 0)
5539
+ return v;
5540
+ }
5541
+ },
5542
+ has(property) {
5543
+ for (let i2 = sources.length - 1; i2 >= 0; i2--) {
5544
+ if (property in resolveSource(sources[i2]))
5545
+ return true;
5546
+ }
5547
+ return false;
5548
+ },
5549
+ keys() {
5550
+ const keys = [];
5551
+ for (let i2 = 0; i2 < sources.length; i2++)
5552
+ keys.push(...Object.keys(resolveSource(sources[i2])));
5553
+ return [...new Set(keys)];
5554
+ }
5555
+ }, propTraps);
5556
+ }
5557
+ const target = {};
5558
+ for (let i2 = sources.length - 1; i2 >= 0; i2--) {
5559
+ if (sources[i2]) {
5560
+ const descriptors = Object.getOwnPropertyDescriptors(sources[i2]);
5561
+ for (const key in descriptors) {
5562
+ if (key in target)
5563
+ continue;
5564
+ Object.defineProperty(target, key, {
5565
+ enumerable: true,
5566
+ get() {
5567
+ for (let i3 = sources.length - 1; i3 >= 0; i3--) {
5568
+ const v = (sources[i3] || {})[key];
5569
+ if (v !== void 0)
5570
+ return v;
5571
+ }
5572
+ }
5573
+ });
5535
5574
  }
5536
- return false;
5537
- },
5538
- keys() {
5539
- const keys = [];
5540
- for (let i2 = 0; i2 < sources.length; i2++)
5541
- keys.push(...Object.keys(resolveSource(sources[i2])));
5542
- return [...new Set(keys)];
5543
5575
  }
5544
- }, propTraps);
5576
+ }
5577
+ return target;
5545
5578
  }
5546
5579
  function splitProps(props, ...keys) {
5547
5580
  const blocked = new Set(keys.flat());
5581
+ if ($PROXY in props) {
5582
+ const res = keys.map((k) => {
5583
+ return new Proxy({
5584
+ get(property) {
5585
+ return k.includes(property) ? props[property] : void 0;
5586
+ },
5587
+ has(property) {
5588
+ return k.includes(property) && property in props;
5589
+ },
5590
+ keys() {
5591
+ return k.filter((property) => property in props);
5592
+ }
5593
+ }, propTraps);
5594
+ });
5595
+ res.push(new Proxy({
5596
+ get(property) {
5597
+ return blocked.has(property) ? void 0 : props[property];
5598
+ },
5599
+ has(property) {
5600
+ return blocked.has(property) ? false : property in props;
5601
+ },
5602
+ keys() {
5603
+ return Object.keys(props).filter((k) => !blocked.has(k));
5604
+ }
5605
+ }, propTraps));
5606
+ return res;
5607
+ }
5548
5608
  const descriptors = Object.getOwnPropertyDescriptors(props);
5549
- const res = keys.map((k) => {
5609
+ keys.push(Object.keys(descriptors).filter((k) => !blocked.has(k)));
5610
+ return keys.map((k) => {
5550
5611
  const clone = {};
5551
5612
  for (let i2 = 0; i2 < k.length; i2++) {
5552
5613
  const key = k[i2];
5614
+ if (!(key in props))
5615
+ continue;
5553
5616
  Object.defineProperty(clone, key, descriptors[key] ? descriptors[key] : {
5554
5617
  get() {
5555
5618
  return props[key];
5556
5619
  },
5557
5620
  set() {
5558
5621
  return true;
5559
- }
5622
+ },
5623
+ enumerable: true
5560
5624
  });
5561
5625
  }
5562
5626
  return clone;
5563
5627
  });
5564
- res.push(new Proxy({
5565
- get(property) {
5566
- return blocked.has(property) ? void 0 : props[property];
5567
- },
5568
- has(property) {
5569
- return blocked.has(property) ? false : property in props;
5570
- },
5571
- keys() {
5572
- return Object.keys(props).filter((k) => !blocked.has(k));
5573
- }
5574
- }, propTraps));
5575
- return res;
5576
5628
  }
5577
5629
  function For(props) {
5578
5630
  const fallback = "fallback" in props && {
5579
5631
  fallback: () => props.fallback
5580
5632
  };
5581
- return createMemo(mapArray(() => props.each, props.children, fallback ? fallback : void 0));
5633
+ return createMemo(mapArray(() => props.each, props.children, fallback || void 0));
5582
5634
  }
5583
5635
  function Show(props) {
5584
5636
  let strictEqual = false;
@@ -5595,11 +5647,12 @@ function Show(props) {
5595
5647
  return fn ? untrack(() => child(c2)) : child;
5596
5648
  }
5597
5649
  return props.fallback;
5598
- });
5650
+ }, void 0, void 0);
5599
5651
  }
5600
5652
  function Switch(props) {
5601
5653
  let strictEqual = false;
5602
5654
  let keyed = false;
5655
+ const equals = (a2, b) => a2[0] === b[0] && (strictEqual ? a2[1] === b[1] : !a2[1] === !b[1]) && a2[2] === b[2];
5603
5656
  const conditions = children(() => props.children), evalConditions = createMemo(() => {
5604
5657
  let conds = conditions();
5605
5658
  if (!Array.isArray(conds))
@@ -5613,7 +5666,7 @@ function Switch(props) {
5613
5666
  }
5614
5667
  return [-1];
5615
5668
  }, void 0, {
5616
- equals: (a2, b) => a2[0] === b[0] && (strictEqual ? a2[1] === b[1] : !a2[1] === !b[1]) && a2[2] === b[2]
5669
+ equals
5617
5670
  });
5618
5671
  return createMemo(() => {
5619
5672
  const [index, when, cond] = evalConditions();
@@ -5623,7 +5676,7 @@ function Switch(props) {
5623
5676
  const fn = typeof c2 === "function" && c2.length > 0;
5624
5677
  strictEqual = keyed || fn;
5625
5678
  return fn ? untrack(() => c2(when)) : c2;
5626
- });
5679
+ }, void 0, void 0);
5627
5680
  }
5628
5681
  function Match(props) {
5629
5682
  return props;
@@ -5631,18 +5684,18 @@ function Match(props) {
5631
5684
  const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
5632
5685
  const Properties = /* @__PURE__ */ new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
5633
5686
  const ChildProperties = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]);
5634
- const Aliases = {
5687
+ const Aliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
5635
5688
  className: "class",
5636
5689
  htmlFor: "for"
5637
- };
5638
- const PropAliases = {
5690
+ });
5691
+ const PropAliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
5639
5692
  class: "className",
5640
5693
  formnovalidate: "formNoValidate",
5641
5694
  ismap: "isMap",
5642
5695
  nomodule: "noModule",
5643
5696
  playsinline: "playsInline",
5644
5697
  readonly: "readOnly"
5645
- };
5698
+ });
5646
5699
  const DelegatedEvents = /* @__PURE__ */ new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
5647
5700
  const SVGElements = /* @__PURE__ */ new Set([
5648
5701
  "altGlyph",
@@ -5726,11 +5779,6 @@ const SVGNamespace = {
5726
5779
  xlink: "http://www.w3.org/1999/xlink",
5727
5780
  xml: "http://www.w3.org/XML/1998/namespace"
5728
5781
  };
5729
- function memo(fn, equals) {
5730
- return createMemo(fn, void 0, !equals ? {
5731
- equals
5732
- } : void 0);
5733
- }
5734
5782
  function reconcileArrays(parentNode, a2, b) {
5735
5783
  let bLength = b.length, aEnd = a2.length, bEnd = bLength, aStart = 0, bStart = 0, after = a2[aEnd - 1].nextSibling, map = null;
5736
5784
  while (aStart < aEnd || bStart < bEnd) {
@@ -5788,12 +5836,12 @@ function reconcileArrays(parentNode, a2, b) {
5788
5836
  }
5789
5837
  }
5790
5838
  const $$EVENTS = "_$DX_DELEGATE";
5791
- function render(code, element, init) {
5839
+ function render(code, element, init, options = {}) {
5792
5840
  let disposer;
5793
5841
  createRoot((dispose2) => {
5794
5842
  disposer = dispose2;
5795
5843
  element === document ? code() : insert(element, code(), element.firstChild ? null : void 0, init);
5796
- });
5844
+ }, options.owner);
5797
5845
  return () => {
5798
5846
  disposer();
5799
5847
  element.textContent = "";
@@ -5890,11 +5938,14 @@ function style(node, value, prev) {
5890
5938
  }
5891
5939
  return prev;
5892
5940
  }
5893
- function spread(node, accessor, isSVG, skipChildren) {
5894
- if (typeof accessor === "function") {
5895
- createRenderEffect((current) => spreadExpression(node, accessor(), current, isSVG, skipChildren));
5896
- } else
5897
- spreadExpression(node, accessor, void 0, isSVG, skipChildren);
5941
+ function spread(node, props = {}, isSVG, skipChildren) {
5942
+ const prevProps = {};
5943
+ if (!skipChildren) {
5944
+ createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
5945
+ }
5946
+ createRenderEffect(() => props.ref && props.ref(node));
5947
+ createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
5948
+ return prevProps;
5898
5949
  }
5899
5950
  function use(fn, element, arg) {
5900
5951
  return untrack(() => fn(element, arg));
@@ -5952,9 +6003,8 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
5952
6003
  if (value === prev)
5953
6004
  return prev;
5954
6005
  if (prop === "ref") {
5955
- if (!skipRef) {
6006
+ if (!skipRef)
5956
6007
  value(node);
5957
- }
5958
6008
  } else if (prop.slice(0, 3) === "on:") {
5959
6009
  const e2 = prop.slice(3);
5960
6010
  prev && node.removeEventListener(e2, prev);
@@ -6009,7 +6059,7 @@ function eventHandler(e2) {
6009
6059
  sharedConfig.done = true;
6010
6060
  document.querySelectorAll("[id^=pl-]").forEach((elem) => elem.remove());
6011
6061
  }
6012
- while (node !== null) {
6062
+ while (node) {
6013
6063
  const handler = node[key];
6014
6064
  if (handler && !node.disabled) {
6015
6065
  const data = node[`${key}Data`];
@@ -6017,18 +6067,9 @@ function eventHandler(e2) {
6017
6067
  if (e2.cancelBubble)
6018
6068
  return;
6019
6069
  }
6020
- node = node.host && node.host !== node && node.host instanceof Node ? node.host : node.parentNode;
6070
+ node = node._$host || node.parentNode || node.host;
6021
6071
  }
6022
6072
  }
6023
- function spreadExpression(node, props, prevProps = {}, isSVG, skipChildren) {
6024
- props || (props = {});
6025
- if (!skipChildren) {
6026
- createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
6027
- }
6028
- createRenderEffect(() => props.ref && props.ref(node));
6029
- createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
6030
- return prevProps;
6031
- }
6032
6073
  function insertExpression(parent, value, current, marker, unwrapArray) {
6033
6074
  if (sharedConfig.context && !current)
6034
6075
  current = [...parent.childNodes];
@@ -6142,7 +6183,7 @@ function normalizeIncomingArray(normalized, array, current, unwrap2) {
6142
6183
  }
6143
6184
  return dynamic;
6144
6185
  }
6145
- function appendNodes(parent, array, marker) {
6186
+ function appendNodes(parent, array, marker = null) {
6146
6187
  for (let i2 = 0, len = array.length; i2 < len; i2++)
6147
6188
  parent.insertBefore(array[i2], marker);
6148
6189
  }
@@ -6201,10 +6242,11 @@ function Portal(props) {
6201
6242
  const container = createElement(props.isSVG ? "g" : "div", props.isSVG), renderRoot = useShadow && container.attachShadow ? container.attachShadow({
6202
6243
  mode: "open"
6203
6244
  }) : container;
6204
- Object.defineProperty(container, "host", {
6245
+ Object.defineProperty(container, "_$host", {
6205
6246
  get() {
6206
6247
  return marker.parentNode;
6207
- }
6248
+ },
6249
+ configurable: true
6208
6250
  });
6209
6251
  insert(renderRoot, renderPortal());
6210
6252
  mount.appendChild(container);
@@ -6507,9 +6549,9 @@ function wrap$1(value, name) {
6507
6549
  for (let i2 = 0, l2 = keys.length; i2 < l2; i2++) {
6508
6550
  const prop = keys[i2];
6509
6551
  if (desc[prop].get) {
6510
- const get = desc[prop].get.bind(p2);
6511
6552
  Object.defineProperty(value, prop, {
6512
- get
6553
+ enumerable: desc[prop].enumerable,
6554
+ get: desc[prop].get.bind(p2)
6513
6555
  });
6514
6556
  }
6515
6557
  }
@@ -6565,7 +6607,7 @@ function getDataNodes(target) {
6565
6607
  function getDataNode(nodes, property, value) {
6566
6608
  return nodes[property] || (nodes[property] = createDataNode(value));
6567
6609
  }
6568
- function proxyDescriptor(target, property) {
6610
+ function proxyDescriptor$1(target, property) {
6569
6611
  const desc = Reflect.getOwnPropertyDescriptor(target, property);
6570
6612
  if (!desc || desc.get || !desc.configurable || property === $PROXY || property === $NODE || property === $NAME)
6571
6613
  return desc;
@@ -6617,8 +6659,7 @@ const proxyTraps$1 = {
6617
6659
  has(target, property) {
6618
6660
  if (property === $RAW || property === $PROXY || property === $TRACK || property === $NODE || property === "__proto__")
6619
6661
  return true;
6620
- const tracked = getDataNodes(target)[property];
6621
- tracked && tracked();
6662
+ this.get(target, property, target);
6622
6663
  return property in target;
6623
6664
  },
6624
6665
  set() {
@@ -6628,16 +6669,15 @@ const proxyTraps$1 = {
6628
6669
  return true;
6629
6670
  },
6630
6671
  ownKeys,
6631
- getOwnPropertyDescriptor: proxyDescriptor
6672
+ getOwnPropertyDescriptor: proxyDescriptor$1
6632
6673
  };
6633
6674
  function setProperty(state, property, value, deleting = false) {
6634
6675
  if (!deleting && state[property] === value)
6635
6676
  return;
6636
- const prev = state[property];
6637
- const len = state.length;
6638
- if (value === void 0) {
6677
+ const prev = state[property], len = state.length;
6678
+ if (value === void 0)
6639
6679
  delete state[property];
6640
- } else
6680
+ else
6641
6681
  state[property] = value;
6642
6682
  let nodes = getDataNodes(state), node;
6643
6683
  if (node = getDataNode(nodes, property, prev))
@@ -6733,59 +6773,235 @@ var THEME = /* @__PURE__ */ ((THEME2) => {
6733
6773
  THEME2["LIGHT"] = "LIGHT";
6734
6774
  return THEME2;
6735
6775
  })(THEME || {});
6736
- function hexToRgb(hex) {
6737
- if (hex[0] === "#") {
6738
- hex = hex.slice(1);
6739
- }
6740
- const bigint = parseInt(hex, 16);
6741
- const r = bigint >> 16 & 255;
6742
- const g = bigint >> 8 & 255;
6743
- const b = bigint & 255;
6744
- return [r, g, b].join(",");
6745
- }
6746
- const generateLightColors = (accentColor) => ({
6747
- primary: accentColor,
6748
- secondary: `rgba(${hexToRgb(accentColor)}, 0.16)`,
6749
- backgroundPrimary: "#FFFFFF",
6750
- backgroundSecondary: "#EFF1F3",
6751
- font: {
6752
- accent: accentColor,
6776
+ const defaultLightColorsSet = {
6777
+ constant: {
6778
+ black: "#000000",
6779
+ white: "#FFFFFF"
6780
+ },
6781
+ connectButton: {
6782
+ background: "#31A6F5",
6783
+ foreground: "#FFFFFF"
6784
+ },
6785
+ accent: "#31A6F5",
6786
+ icon: {
6753
6787
  primary: "#0F0F0F",
6754
6788
  secondary: "#7A8999",
6755
- third: "#7A8999"
6789
+ tertiary: "#C1CAD2",
6790
+ success: "#29CC6A"
6791
+ },
6792
+ background: {
6793
+ primary: "#FFFFFF",
6794
+ secondary: "#F1F3F5"
6795
+ },
6796
+ text: {
6797
+ primary: "#0F0F0F",
6798
+ secondary: "#7A8999",
6799
+ subhead: "#6A7785"
6756
6800
  }
6757
- });
6758
- const generateDarkColors = (accentColor) => ({
6759
- primary: accentColor,
6760
- secondary: accentColor,
6761
- backgroundPrimary: "#121214",
6762
- backgroundSecondary: "#18181A",
6763
- font: {
6764
- accent: "#E5E5EA",
6801
+ };
6802
+ const defaultDarkColorsSet = {
6803
+ constant: {
6804
+ black: "#000000",
6805
+ white: "#FFFFFF"
6806
+ },
6807
+ connectButton: {
6808
+ background: "#31A6F5",
6809
+ foreground: "#FFFFFF"
6810
+ },
6811
+ accent: "#E5E5EA",
6812
+ icon: {
6813
+ primary: "#E5E5EA",
6814
+ secondary: "#909099",
6815
+ tertiary: "#434347",
6816
+ success: "#29CC6A"
6817
+ },
6818
+ background: {
6819
+ primary: "#121214",
6820
+ secondary: "#18181A"
6821
+ },
6822
+ text: {
6765
6823
  primary: "#E5E5EA",
6766
6824
  secondary: "#7D7D85",
6767
- third: "#909099"
6825
+ subhead: "#8C8C93"
6768
6826
  }
6769
- });
6770
- const defaultLightColors = generateLightColors("#31A6F5");
6771
- const defaultDarkColors = generateDarkColors("#262629");
6827
+ };
6828
+ var isMergeableObject = function isMergeableObject2(value) {
6829
+ return isNonNullObject(value) && !isSpecial(value);
6830
+ };
6831
+ function isNonNullObject(value) {
6832
+ return !!value && typeof value === "object";
6833
+ }
6834
+ function isSpecial(value) {
6835
+ var stringValue = Object.prototype.toString.call(value);
6836
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
6837
+ }
6838
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
6839
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
6840
+ function isReactElement(value) {
6841
+ return value.$$typeof === REACT_ELEMENT_TYPE;
6842
+ }
6843
+ function emptyTarget(val) {
6844
+ return Array.isArray(val) ? [] : {};
6845
+ }
6846
+ function cloneUnlessOtherwiseSpecified(value, options) {
6847
+ return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
6848
+ }
6849
+ function defaultArrayMerge(target, source, options) {
6850
+ return target.concat(source).map(function(element) {
6851
+ return cloneUnlessOtherwiseSpecified(element, options);
6852
+ });
6853
+ }
6854
+ function getMergeFunction(key, options) {
6855
+ if (!options.customMerge) {
6856
+ return deepmerge;
6857
+ }
6858
+ var customMerge = options.customMerge(key);
6859
+ return typeof customMerge === "function" ? customMerge : deepmerge;
6860
+ }
6861
+ function getEnumerableOwnPropertySymbols(target) {
6862
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
6863
+ return target.propertyIsEnumerable(symbol);
6864
+ }) : [];
6865
+ }
6866
+ function getKeys(target) {
6867
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
6868
+ }
6869
+ function propertyIsOnObject(object, property) {
6870
+ try {
6871
+ return property in object;
6872
+ } catch (_) {
6873
+ return false;
6874
+ }
6875
+ }
6876
+ function propertyIsUnsafe(target, key) {
6877
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
6878
+ }
6879
+ function mergeObject(target, source, options) {
6880
+ var destination = {};
6881
+ if (options.isMergeableObject(target)) {
6882
+ getKeys(target).forEach(function(key) {
6883
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
6884
+ });
6885
+ }
6886
+ getKeys(source).forEach(function(key) {
6887
+ if (propertyIsUnsafe(target, key)) {
6888
+ return;
6889
+ }
6890
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
6891
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
6892
+ } else {
6893
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
6894
+ }
6895
+ });
6896
+ return destination;
6897
+ }
6898
+ function deepmerge(target, source, options) {
6899
+ options = options || {};
6900
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
6901
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
6902
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
6903
+ var sourceIsArray = Array.isArray(source);
6904
+ var targetIsArray = Array.isArray(target);
6905
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
6906
+ if (!sourceAndTargetTypesMatch) {
6907
+ return cloneUnlessOtherwiseSpecified(source, options);
6908
+ } else if (sourceIsArray) {
6909
+ return options.arrayMerge(target, source, options);
6910
+ } else {
6911
+ return mergeObject(target, source, options);
6912
+ }
6913
+ }
6914
+ deepmerge.all = function deepmergeAll(array, options) {
6915
+ if (!Array.isArray(array)) {
6916
+ throw new Error("first argument should be an array");
6917
+ }
6918
+ return array.reduce(function(prev, next) {
6919
+ return deepmerge(prev, next, options);
6920
+ }, {});
6921
+ };
6922
+ var deepmerge_1 = deepmerge;
6923
+ var cjs = deepmerge_1;
6924
+ /*!
6925
+ * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
6926
+ *
6927
+ * Copyright (c) 2014-2017, Jon Schlinkert.
6928
+ * Released under the MIT License.
6929
+ */
6930
+ function isObject(o2) {
6931
+ return Object.prototype.toString.call(o2) === "[object Object]";
6932
+ }
6933
+ function isPlainObject(o2) {
6934
+ var ctor, prot;
6935
+ if (isObject(o2) === false)
6936
+ return false;
6937
+ ctor = o2.constructor;
6938
+ if (ctor === void 0)
6939
+ return true;
6940
+ prot = ctor.prototype;
6941
+ if (isObject(prot) === false)
6942
+ return false;
6943
+ if (prot.hasOwnProperty("isPrototypeOf") === false) {
6944
+ return false;
6945
+ }
6946
+ return true;
6947
+ }
6948
+ function mergeOptions(options, defaultOptions) {
6949
+ if (!options) {
6950
+ return defaultOptions;
6951
+ }
6952
+ const overwriteMerge = (_, sourceArray, __) => sourceArray;
6953
+ return cjs(defaultOptions, options, {
6954
+ arrayMerge: overwriteMerge,
6955
+ isMergeableObject: isPlainObject
6956
+ });
6957
+ }
6772
6958
  const [themeState, setThemeState] = createStore({
6773
6959
  theme: THEME.LIGHT,
6774
- accentColor: defaultLightColors.primary,
6775
- colors: defaultLightColors
6960
+ colors: defaultLightColorsSet,
6961
+ borderRadius: "m"
6776
6962
  });
6777
- function setTheme(theme) {
6778
- if (theme === THEME.LIGHT) {
6779
- setThemeState({
6780
- theme,
6781
- colors: defaultLightColors
6782
- });
6783
- } else {
6784
- setThemeState({
6785
- theme,
6786
- colors: defaultDarkColors
6787
- });
6963
+ const themeColorsMappingDefault = {
6964
+ [THEME.LIGHT]: defaultLightColorsSet,
6965
+ [THEME.DARK]: defaultDarkColorsSet
6966
+ };
6967
+ const themeCustomColors = {
6968
+ [THEME.LIGHT]: void 0,
6969
+ [THEME.DARK]: void 0
6970
+ };
6971
+ function setTheme(theme, colorsSet) {
6972
+ if (colorsSet) {
6973
+ themeCustomColors[THEME.DARK] = mergeOptions(
6974
+ colorsSet[THEME.DARK],
6975
+ themeCustomColors[THEME.DARK]
6976
+ );
6977
+ themeCustomColors[THEME.LIGHT] = mergeOptions(
6978
+ colorsSet[THEME.LIGHT],
6979
+ themeCustomColors[THEME.LIGHT]
6980
+ );
6788
6981
  }
6982
+ setThemeState({
6983
+ theme,
6984
+ colors: mergeOptions(themeCustomColors[theme], themeColorsMappingDefault[theme])
6985
+ });
6986
+ }
6987
+ function setBorderRadius(borderRadius) {
6988
+ setThemeState({ borderRadius });
6989
+ }
6990
+ function setColors(colorsSet) {
6991
+ themeCustomColors[THEME.DARK] = mergeOptions(
6992
+ colorsSet[THEME.DARK],
6993
+ themeCustomColors[THEME.DARK]
6994
+ );
6995
+ themeCustomColors[THEME.LIGHT] = mergeOptions(
6996
+ colorsSet[THEME.LIGHT],
6997
+ themeCustomColors[THEME.LIGHT]
6998
+ );
6999
+ setThemeState((state) => ({
7000
+ colors: mergeOptions(
7001
+ themeCustomColors[state.theme],
7002
+ themeColorsMappingDefault[state.theme]
7003
+ )
7004
+ }));
6789
7005
  }
6790
7006
  const GlobalStyles = () => {
6791
7007
  document.body.addEventListener("mousedown", () => document.body.classList.add("using-mouse"));
@@ -6823,22 +7039,41 @@ const GlobalStyles = () => {
6823
7039
  `;
6824
7040
  return createComponent(Styles, {});
6825
7041
  };
7042
+ function hexToRgb(hex) {
7043
+ if (hex[0] === "#") {
7044
+ hex = hex.slice(1);
7045
+ }
7046
+ const bigint = parseInt(hex, 16);
7047
+ const r = bigint >> 16 & 255;
7048
+ const g = bigint >> 8 & 255;
7049
+ const b = bigint & 255;
7050
+ return [r, g, b].join(",");
7051
+ }
7052
+ function rgba(color, opacity) {
7053
+ if (color[0] === "#") {
7054
+ color = hexToRgb(color);
7055
+ }
7056
+ return `rgba(${color}, ${opacity})`;
7057
+ }
7058
+ const borders$3 = {
7059
+ m: "16px",
7060
+ s: "8px",
7061
+ none: "0"
7062
+ };
6826
7063
  const ButtonStyled$2 = styled.button`
6827
- background-color: ${(props) => props.appearance === "flat" ? props.theme.colors.backgroundPrimary : props.theme.colors[props.appearance]};
6828
- color: ${(props) => props.appearance === "primary" ? "white" : props.appearance === "flat" ? props.theme.colors.font.primary : props.theme.colors.font.accent};
7064
+ background-color: ${(props) => rgba(props.theme.colors.accent, 0.12)};
7065
+ color: ${(props) => props.theme.colors.accent};
6829
7066
 
6830
- box-shadow: ${(props) => props.appearance === "flat" ? "0 4px 24px rgba(0, 0, 0, 0.16);" : "unset;"}
6831
-
6832
7067
  padding: 9px 16px;
6833
7068
  border: none;
6834
- border-radius: 16px;
7069
+ border-radius: ${(props) => borders$3[props.theme.borderRadius]};
6835
7070
  cursor: pointer;
6836
7071
 
6837
7072
  font-size: 14px;
6838
7073
  font-weight: 590;
6839
7074
  line-height: 18px;
6840
7075
  letter-spacing: -0.154px;
6841
-
7076
+
6842
7077
  transition: transform 0.1s ease-in-out;
6843
7078
 
6844
7079
  &:hover {
@@ -6850,13 +7085,12 @@ const ButtonStyled$2 = styled.button`
6850
7085
  }
6851
7086
  `;
6852
7087
  const Button = (props) => {
6853
- const appearance = () => props.appearance || "primary";
6854
7088
  return createComponent(ButtonStyled$2, {
6855
7089
  get ["class"]() {
6856
7090
  return props.class;
6857
7091
  },
6858
- get appearance() {
6859
- return appearance();
7092
+ get id() {
7093
+ return props.id;
6860
7094
  },
6861
7095
  onClick: () => props.onClick(),
6862
7096
  ref(r$) {
@@ -7264,7 +7498,7 @@ const rotationDegrees = {
7264
7498
  };
7265
7499
  const ArrowIcon = (props) => {
7266
7500
  const theme = useTheme();
7267
- const fill = () => props.fill || theme.colors.font.third;
7501
+ const fill = () => props.fill || theme.colors.icon.secondary;
7268
7502
  const direction = () => props.direction || "left";
7269
7503
  const Svg = styled("svg")`
7270
7504
  transform: rotate(${(props2) => rotationDegrees[props2.svgDirection]}deg);
@@ -7289,7 +7523,7 @@ const ArrowIcon = (props) => {
7289
7523
  const _tmpl$$e = /* @__PURE__ */ template$1(`<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.900031 0.900397L5.00002 5.00039M5.00002 5.00039L9.10003 9.1004M5.00002 5.00039L9.10003 0.900391M5.00002 5.00039L0.900024 9.1004" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>`);
7290
7524
  const CloseIcon = (props) => {
7291
7525
  const theme = useTheme();
7292
- const fill = () => props.fill || theme.colors.font.third;
7526
+ const fill = () => props.fill || theme.colors.icon.secondary;
7293
7527
  return (() => {
7294
7528
  const _el$ = _tmpl$$e.cloneNode(true), _el$2 = _el$.firstChild;
7295
7529
  createRenderEffect(() => setAttribute(_el$2, "stroke", fill()));
@@ -7304,7 +7538,7 @@ const IconButtonStyled = styled.button`
7304
7538
  width: 32px;
7305
7539
  height: 32px;
7306
7540
  border-radius: 50%;
7307
- background-color: ${(props) => props.theme.colors.backgroundSecondary};
7541
+ background-color: ${(props) => props.theme.colors.background.secondary};
7308
7542
  border: none;
7309
7543
  cursor: pointer;
7310
7544
 
@@ -7389,14 +7623,12 @@ const ModalBackgroundStyled = styled.div`
7389
7623
  const ModalWrapperClass = u`
7390
7624
  position: relative;
7391
7625
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 16px 64px rgba(0, 0, 0, 0.16);
7392
- border-radius: 24px;
7393
7626
  min-height: 100px;
7394
7627
  width: 440px;
7395
7628
  padding: 44px 56px 24px;
7396
7629
 
7397
7630
  ${media("mobile")} {
7398
7631
  width: 100%;
7399
- border-radius: 24px 24px 0 0;
7400
7632
  }
7401
7633
  `;
7402
7634
  const CloseButtonStyled = styled(IconButton)`
@@ -7407,6 +7639,11 @@ const CloseButtonStyled = styled(IconButton)`
7407
7639
  const _tmpl$$d = /* @__PURE__ */ template$1(`<div></div>`);
7408
7640
  const clickOutside = clickOutside$1;
7409
7641
  const keyPressed = escPressed;
7642
+ const borders$2 = {
7643
+ m: "24px",
7644
+ s: "16px",
7645
+ none: "0"
7646
+ };
7410
7647
  const Modal = (props) => {
7411
7648
  const theme = useTheme();
7412
7649
  return createComponent(Transition, {
@@ -7467,9 +7704,23 @@ const Modal = (props) => {
7467
7704
  onClick: () => props.onClose()
7468
7705
  }), null);
7469
7706
  insert(_el$, () => props.children, null);
7470
- createRenderEffect(() => className(_el$, cn(ModalWrapperClass, props.class, u`
7471
- background-color: ${theme.colors.backgroundPrimary};
7472
- `)));
7707
+ createRenderEffect((_p$) => {
7708
+ const _v$ = props.id, _v$2 = cn(ModalWrapperClass, props.class, u`
7709
+ background-color: ${theme.colors.background.primary};
7710
+ border-radius: ${borders$2[theme.borderRadius]};
7711
+
7712
+ ${media("mobile")} {
7713
+ border-radius: ${borders$2[theme.borderRadius]}
7714
+ ${borders$2[theme.borderRadius]} 0 0;
7715
+ }
7716
+ `);
7717
+ _v$ !== _p$._v$ && setAttribute(_el$, "id", _p$._v$ = _v$);
7718
+ _v$2 !== _p$._v$2 && className(_el$, _p$._v$2 = _v$2);
7719
+ return _p$;
7720
+ }, {
7721
+ _v$: void 0,
7722
+ _v$2: void 0
7723
+ });
7473
7724
  return _el$;
7474
7725
  }
7475
7726
  });
@@ -7514,7 +7765,7 @@ const H1Styled$2 = styled.h1`
7514
7765
  text-align: center;
7515
7766
  letter-spacing: 0.072px;
7516
7767
 
7517
- color: ${(props) => props.theme.colors.font.primary};
7768
+ color: ${(props) => props.theme.colors.text.primary};
7518
7769
 
7519
7770
  margin-top: 0;
7520
7771
  margin-bottom: 6px;
@@ -7527,7 +7778,7 @@ const H1 = (props) => {
7527
7778
  },
7528
7779
  get children() {
7529
7780
  var _a;
7530
- return memo(() => !!props.translationKey, true)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7781
+ return createMemo(() => !!props.translationKey)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7531
7782
  }
7532
7783
  });
7533
7784
  };
@@ -7540,7 +7791,7 @@ const H2Styled$1 = styled.h2`
7540
7791
  text-align: center;
7541
7792
  letter-spacing: -0.32px;
7542
7793
 
7543
- color: ${(props) => props.theme.colors.font.secondary};
7794
+ color: ${(props) => props.theme.colors.text.secondary};
7544
7795
 
7545
7796
  margin-top: 0;
7546
7797
  margin-bottom: 32px;
@@ -7553,7 +7804,7 @@ const H2 = (props) => {
7553
7804
  },
7554
7805
  get children() {
7555
7806
  var _a;
7556
- return memo(() => !!props.translationKey, true)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7807
+ return createMemo(() => !!props.translationKey)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7557
7808
  }
7558
7809
  });
7559
7810
  };
@@ -7565,17 +7816,17 @@ const H3Styled = styled.h3`
7565
7816
 
7566
7817
  letter-spacing: -0.24px;
7567
7818
 
7568
- color: ${(props) => props.theme.colors.font.primary};
7819
+ color: ${(props) => props.theme.colors.text.primary};
7569
7820
 
7570
7821
  margin-top: 0;
7571
- margin-bottom: 0px;
7822
+ margin-bottom: 0;
7572
7823
  `;
7573
7824
  const H3 = (props) => {
7574
7825
  const [t2] = useI18n();
7575
7826
  return createComponent(H3Styled, {
7576
7827
  get children() {
7577
7828
  var _a;
7578
- return memo(() => !!props.translationKey, true)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7829
+ return createMemo(() => !!props.translationKey)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7579
7830
  }
7580
7831
  });
7581
7832
  };
@@ -7591,7 +7842,7 @@ const TextStyled$3 = styled.div`
7591
7842
  const Text = (inputs) => {
7592
7843
  const theme = useTheme();
7593
7844
  const [t2] = useI18n();
7594
- const color = () => inputs.color || theme.colors.font.primary;
7845
+ const color = () => inputs.color || theme.colors.text.primary;
7595
7846
  const props = mergeProps({
7596
7847
  fontSize: "14px",
7597
7848
  fontWeight: "510",
@@ -7619,14 +7870,14 @@ const Text = (inputs) => {
7619
7870
  },
7620
7871
  get children() {
7621
7872
  var _a;
7622
- return memo(() => !!props.translationKey, true)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7873
+ return createMemo(() => !!props.translationKey)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7623
7874
  }
7624
7875
  });
7625
7876
  };
7626
7877
  const _tmpl$$c = /* @__PURE__ */ template$1(`<svg width="16" height="15" viewBox="0 0 16 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.1839 12.7069C9.6405 13.6507 9.36881 14.1226 9.05907 14.348C8.42775 14.8074 7.57228 14.8074 6.94096 14.348C6.63122 14.1226 6.35952 13.6507 5.81613 12.7069L1.52066 5.24638C0.768635 3.94024 0.392625 3.28717 0.337617 2.75894C0.225505 1.68236 0.818944 0.655911 1.80788 0.215893C2.29309 0 3.04667 0 4.55383 0H11.4462C12.9534 0 13.7069 0 14.1922 0.215893C15.1811 0.655911 15.7745 1.68236 15.6624 2.75894C15.6074 3.28717 15.2314 3.94024 14.4794 5.24638L10.1839 12.7069ZM7.10002 11.3412L2.56139 3.48002C2.31995 3.06185 2.19924 2.85276 2.18146 2.68365C2.14523 2.33896 2.33507 2.01015 2.65169 1.86919C2.80703 1.80002 3.04847 1.80002 3.53133 1.80002H3.53134L7.10002 1.80002V11.3412ZM8.90001 11.3412L13.4387 3.48002C13.6801 3.06185 13.8008 2.85276 13.8186 2.68365C13.8548 2.33896 13.665 2.01015 13.3484 1.86919C13.193 1.80002 12.9516 1.80002 12.4687 1.80002L8.90001 1.80002V11.3412Z"></path></svg>`);
7627
7878
  const TonIcon = (props) => {
7628
7879
  const theme = useTheme();
7629
- const fill = () => props.fill || theme.colors.font.primary;
7880
+ const fill = () => props.fill || theme.colors.icon.primary;
7630
7881
  return (() => {
7631
7882
  const _el$ = _tmpl$$c.cloneNode(true), _el$2 = _el$.firstChild;
7632
7883
  createRenderEffect(() => setAttribute(_el$2, "fill", fill()));
@@ -7635,7 +7886,8 @@ const TonIcon = (props) => {
7635
7886
  };
7636
7887
  const _tmpl$$b = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path d="M7.5 13L10 15.5L16.5 9" stroke="white" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>`);
7637
7888
  const SuccessIcon = (props) => {
7638
- const fill = () => props.fill || "#29CC6A";
7889
+ const theme = useTheme();
7890
+ const fill = () => props.fill || theme.colors.icon.success;
7639
7891
  return (() => {
7640
7892
  const _el$ = _tmpl$$b.cloneNode(true), _el$2 = _el$.firstChild;
7641
7893
  createRenderEffect((_p$) => {
@@ -7653,7 +7905,7 @@ const SuccessIcon = (props) => {
7653
7905
  const _tmpl$$a = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path fill-rule="evenodd" clip-rule="evenodd" d="M7.86358 9.13637C7.51211 8.7849 7.51211 8.21505 7.86358 7.86358C8.21505 7.51211 8.7849 7.51211 9.13637 7.86358L12 10.7272L14.8636 7.86358C15.2151 7.51211 15.7849 7.51211 16.1364 7.86358C16.4878 8.21505 16.4878 8.7849 16.1364 9.13637L13.2728 12L16.1364 14.8636C16.4878 15.2151 16.4878 15.7849 16.1364 16.1364C15.7849 16.4878 15.2151 16.4878 14.8636 16.1364L12 13.2728L9.13637 16.1364C8.7849 16.4878 8.21505 16.4878 7.86358 16.1364C7.51211 15.7849 7.51211 15.2151 7.86358 14.8636L10.7272 12L7.86358 9.13637Z" fill="white"></path></svg>`);
7654
7906
  const ErrorIcon = (props) => {
7655
7907
  const theme = useTheme();
7656
- const fill = () => props.fill || theme.colors.font.third;
7908
+ const fill = () => props.fill || theme.colors.icon.secondary;
7657
7909
  return (() => {
7658
7910
  const _el$ = _tmpl$$a.cloneNode(true), _el$2 = _el$.firstChild;
7659
7911
  createRenderEffect((_p$) => {
@@ -7671,7 +7923,7 @@ const ErrorIcon = (props) => {
7671
7923
  const _tmpl$$9 = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.00002 18.9282C11.8264 21.1373 16.7191 19.8263 18.9282 16C21.1374 12.1736 19.8264 7.28092 16 5.07178C12.1737 2.86264 7.28096 4.17364 5.07182 7.99998" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>`);
7672
7924
  const LoaderIcon = (props) => {
7673
7925
  const theme = useTheme();
7674
- const fill = () => props.fill || theme.colors.font.third;
7926
+ const fill = () => props.fill || theme.colors.icon.tertiary;
7675
7927
  const rotateAnimation = h`
7676
7928
  0% {
7677
7929
  transform: rotate(0deg);
@@ -7701,7 +7953,7 @@ const TonConnectUiContext = createContext();
7701
7953
  const _tmpl$$8 = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.76228 2.09998H7.79998H10.2001H10.2378H10.2378H10.2378C11.0459 2.09997 11.7067 2.09996 12.2438 2.14384C12.7997 2.18926 13.3017 2.28614 13.7706 2.52505C14.5045 2.89896 15.1011 3.49558 15.475 4.22941C15.7139 4.6983 15.8108 5.20038 15.8562 5.75629C15.9001 6.29337 15.9001 6.95422 15.9001 7.76227V7.79998V8.1H16.2H16.2377C17.0457 8.09999 17.7066 8.09998 18.2437 8.14386C18.7996 8.18928 19.3017 8.28616 19.7705 8.52507C20.5044 8.89898 21.101 9.4956 21.4749 10.2294C21.7138 10.6983 21.8107 11.2004 21.8561 11.7563C21.9 12.2934 21.9 12.9542 21.9 13.7623V13.8V16.2V16.2377C21.9 17.0458 21.9 17.7066 21.8561 18.2437C21.8107 18.7996 21.7138 19.3017 21.4749 19.7706C21.101 20.5044 20.5044 21.101 19.7705 21.4749C19.3017 21.7138 18.7996 21.8107 18.2437 21.8561C17.7066 21.9 17.0458 21.9 16.2378 21.9H16.2377H16.2H13.8H13.7623H13.7622C12.9542 21.9 12.2934 21.9 11.7563 21.8561C11.2004 21.8107 10.6983 21.7138 10.2294 21.4749C9.49561 21.101 8.89898 20.5044 8.52507 19.7706C8.28616 19.3017 8.18928 18.7996 8.14386 18.2437C8.09998 17.7066 8.09999 17.0458 8.1 16.2377V16.2V15.9H7.79998H7.76227H7.76218C6.95417 15.9 6.29335 15.9 5.75629 15.8561C5.20038 15.8107 4.6983 15.7138 4.22941 15.4749C3.49558 15.101 2.89896 14.5044 2.52505 13.7705C2.28614 13.3017 2.18926 12.7996 2.14384 12.2437C2.09996 11.7066 2.09997 11.0458 2.09998 10.2377V10.2377V10.2377V10.2V7.79998V7.76228V7.76225V7.76224C2.09997 6.9542 2.09996 6.29336 2.14384 5.75629C2.18926 5.20038 2.28614 4.6983 2.52505 4.22941C2.89896 3.49558 3.49558 2.89896 4.22941 2.52505C4.6983 2.28614 5.20038 2.18926 5.75629 2.14384C6.29336 2.09996 6.95419 2.09997 7.76222 2.09998H7.76224H7.76228ZM8.1 14.1V13.8V13.7623C8.09999 12.9542 8.09998 12.2934 8.14386 11.7563C8.18928 11.2004 8.28616 10.6983 8.52507 10.2294C8.89898 9.4956 9.49561 8.89898 10.2294 8.52507C10.6983 8.28616 11.2004 8.18928 11.7563 8.14386C12.2934 8.09998 12.9542 8.09999 13.7623 8.1H13.8H14.1001V7.79998C14.1001 6.94505 14.0994 6.35798 14.0622 5.90287C14.0259 5.45827 13.9593 5.21944 13.8712 5.0466C13.6699 4.65146 13.3486 4.3302 12.9535 4.12886C12.7806 4.04079 12.5418 3.97419 12.0972 3.93786C11.6421 3.90068 11.055 3.89998 10.2001 3.89998H7.79998C6.94505 3.89998 6.35798 3.90068 5.90287 3.93786C5.45827 3.97419 5.21944 4.04079 5.0466 4.12886C4.65146 4.3302 4.3302 4.65146 4.12886 5.0466C4.04079 5.21944 3.97419 5.45827 3.93786 5.90287C3.90068 6.35798 3.89998 6.94505 3.89998 7.79998V10.2C3.89998 11.0549 3.90068 11.642 3.93786 12.0971C3.97419 12.5417 4.04079 12.7805 4.12886 12.9534C4.3302 13.3485 4.65146 13.6698 5.0466 13.8711C5.21944 13.9592 5.45827 14.0258 5.90287 14.0621C6.35798 14.0993 6.94505 14.1 7.79998 14.1H8.1ZM11.0466 10.1289C11.2195 10.0408 11.4583 9.97421 11.9029 9.93788C12.358 9.9007 12.9451 9.9 13.8 9.9H16.2C17.0549 9.9 17.642 9.9007 18.0971 9.93788C18.5417 9.97421 18.7805 10.0408 18.9534 10.1289C19.3485 10.3302 19.6698 10.6515 19.8711 11.0466C19.9592 11.2195 20.0258 11.4583 20.0621 11.9029C20.0993 12.358 20.1 12.9451 20.1 13.8V16.2C20.1 17.0549 20.0993 17.642 20.0621 18.0971C20.0258 18.5417 19.9592 18.7805 19.8711 18.9534C19.6698 19.3485 19.3485 19.6698 18.9534 19.8711C18.7805 19.9592 18.5417 20.0258 18.0971 20.0621C17.642 20.0993 17.0549 20.1 16.2 20.1H13.8C12.9451 20.1 12.358 20.0993 11.9029 20.0621C11.4583 20.0258 11.2195 19.9592 11.0466 19.8711C10.6515 19.6698 10.3302 19.3485 10.1289 18.9534C10.0408 18.7805 9.97421 18.5417 9.93788 18.0971C9.9007 17.642 9.9 17.0549 9.9 16.2V13.8C9.9 12.9451 9.9007 12.358 9.93788 11.9029C9.97421 11.4583 10.0408 11.2195 10.1289 11.0466C10.3302 10.6515 10.6515 10.3302 11.0466 10.1289Z"></path></svg>`);
7702
7954
  const CopyIcon = (props) => {
7703
7955
  const theme = useTheme();
7704
- const fill = () => props.fill || theme.colors.font.primary;
7956
+ const fill = () => props.fill || theme.colors.icon.primary;
7705
7957
  return (() => {
7706
7958
  const _el$ = _tmpl$$8.cloneNode(true), _el$2 = _el$.firstChild;
7707
7959
  createRenderEffect(() => setAttribute(_el$2, "fill", fill()));
@@ -7711,7 +7963,7 @@ const CopyIcon = (props) => {
7711
7963
  const _tmpl$$7 = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.0001 4.00003H8.80012C7.11996 4.00003 6.27989 4.00003 5.63815 4.32701C5.07366 4.61463 4.61472 5.07357 4.3271 5.63806C4.00012 6.27979 4.00012 7.11987 4.00012 8.80003V15.2C4.00012 16.8802 4.00012 17.7203 4.3271 18.362C4.61472 18.9265 5.07366 19.3854 5.63815 19.6731C6.27989 20 7.11996 20 8.80012 20H12.0001" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9 12H21M21 12L17 8M21 12L17 16" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>`);
7712
7964
  const DisconnectIcon = (props) => {
7713
7965
  const theme = useTheme();
7714
- const fill = () => props.fill || theme.colors.font.primary;
7966
+ const fill = () => props.fill || theme.colors.icon.primary;
7715
7967
  return (() => {
7716
7968
  const _el$ = _tmpl$$7.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
7717
7969
  createRenderEffect((_p$) => {
@@ -7748,17 +8000,27 @@ function fallbackCopyTextToClipboard(text) {
7748
8000
  document.body.removeChild(textArea);
7749
8001
  }
7750
8002
  }
8003
+ const hoverBorders = {
8004
+ m: "8px",
8005
+ s: "4px",
8006
+ none: "0"
8007
+ };
8008
+ const dropdownBorders = {
8009
+ m: "16px",
8010
+ s: "8px",
8011
+ none: "0"
8012
+ };
7751
8013
  const AccountButtonDropdownStyled = styled.div`
7752
8014
  width: 256px;
7753
8015
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
7754
- border-radius: 16px;
8016
+ border-radius: ${(props) => dropdownBorders[props.theme.borderRadius]};
7755
8017
 
7756
- background-color: ${(props) => props.theme.colors.backgroundPrimary}
8018
+ background-color: ${(props) => props.theme.colors.background.primary}
7757
8019
 
7758
- color: ${(props) => props.theme.colors.font.primary}
8020
+ color: ${(props) => props.theme.colors.text.primary}
7759
8021
  `;
7760
8022
  const UlStyled$1 = styled.ul`
7761
- background-color: ${(props) => props.theme.colors.backgroundPrimary};
8023
+ background-color: ${(props) => props.theme.colors.background.primary};
7762
8024
  padding: 8px;
7763
8025
  `;
7764
8026
  const MenuButtonStyled = styled.button`
@@ -7768,15 +8030,15 @@ const MenuButtonStyled = styled.button`
7768
8030
  padding: 12px;
7769
8031
  width: 100%;
7770
8032
 
7771
- background-color: ${(props) => props.theme.colors.backgroundPrimary};
8033
+ background-color: ${(props) => props.theme.colors.background.primary};
7772
8034
  border: none;
7773
- border-radius: 8px;
8035
+ border-radius: ${(props) => hoverBorders[props.theme.borderRadius]};
7774
8036
  cursor: pointer;
7775
8037
 
7776
8038
  transition: background-color, transform 0.1s ease-in-out;
7777
8039
 
7778
8040
  &:hover {
7779
- background-color: ${(props) => props.theme.colors.backgroundSecondary};
8041
+ background-color: ${(props) => props.theme.colors.background.secondary};
7780
8042
  }
7781
8043
 
7782
8044
  &:active {
@@ -7817,6 +8079,9 @@ const AccountButtonDropdown = (props) => {
7817
8079
  get ["class"]() {
7818
8080
  return props.class;
7819
8081
  },
8082
+ get id() {
8083
+ return props.id;
8084
+ },
7820
8085
  get children() {
7821
8086
  return createComponent(UlStyled$1, {
7822
8087
  get children() {
@@ -7867,19 +8132,24 @@ const AccountButtonDropdown = (props) => {
7867
8132
  }
7868
8133
  });
7869
8134
  };
8135
+ const borders$1 = {
8136
+ m: "16px",
8137
+ s: "8px",
8138
+ none: "0"
8139
+ };
7870
8140
  const NotificationStyled = styled.div`
7871
8141
  width: 256px;
7872
8142
  padding: 12px 16px;
7873
8143
  display: flex;
7874
8144
  gap: 9px;
7875
8145
 
7876
- background-color: ${(props) => props.theme.colors.backgroundPrimary};
8146
+ background-color: ${(props) => props.theme.colors.background.primary};
7877
8147
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
7878
- border-radius: 16px;
8148
+ border-radius: ${(props) => borders$1[props.theme.borderRadius]};
7879
8149
  `;
7880
8150
  const TextStyled$2 = styled(Text)`
7881
8151
  margin-top: 4px;
7882
- color: ${(props) => props.theme.colors.font.secondary};
8152
+ color: ${(props) => props.theme.colors.text.secondary};
7883
8153
  `;
7884
8154
  const _tmpl$$5 = /* @__PURE__ */ template$1(`<div></div>`);
7885
8155
  const Notification = (props) => {
@@ -7917,7 +8187,7 @@ const Notification = (props) => {
7917
8187
  }
7918
8188
  }), null);
7919
8189
  return _el$;
7920
- })(), memo(() => props.icon)];
8190
+ })(), createMemo(() => props.icon)];
7921
8191
  }
7922
8192
  });
7923
8193
  };
@@ -7977,7 +8247,7 @@ const SuccessTransactionNotification = (props) => {
7977
8247
  return createComponent(SuccessIconStyled$1, {});
7978
8248
  },
7979
8249
  get ["class"]() {
7980
- return props.class;
8250
+ return cn(props.class, "tc-notification");
7981
8251
  },
7982
8252
  children: "Transaction sent"
7983
8253
  });
@@ -8068,25 +8338,40 @@ const Notifications = (props) => {
8068
8338
  });
8069
8339
  }
8070
8340
  }));
8071
- createRenderEffect(() => className(_el$, props.class));
8341
+ createRenderEffect((_p$) => {
8342
+ const _v$ = props.class, _v$2 = props.id;
8343
+ _v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
8344
+ _v$2 !== _p$._v$2 && setAttribute(_el$, "id", _p$._v$2 = _v$2);
8345
+ return _p$;
8346
+ }, {
8347
+ _v$: void 0,
8348
+ _v$2: void 0
8349
+ });
8072
8350
  return _el$;
8073
8351
  })();
8074
8352
  };
8075
8353
  const AccountButtonStyled = styled(Button)`
8354
+ background-color: ${(props) => props.theme.colors.connectButton.background};
8355
+ color: ${(props) => props.theme.colors.connectButton.foreground};
8356
+ box-shadow: ${(props) => `0 4px 24px ${rgba(props.theme.colors.constant.black, 0.16)}`};
8357
+
8076
8358
  display: flex;
8077
8359
  align-items: center;
8078
8360
  gap: 9px;
8079
8361
 
8080
- transition: background-color 0.1s ease-in-out;
8362
+ transition: all 0.1s ease-in-out;
8081
8363
 
8082
8364
  &:hover:not(:active) {
8083
8365
  transform: scale(1);
8084
8366
  }
8085
8367
 
8086
8368
  &:hover {
8087
- background-color: ${(props) => props.theme.colors.backgroundSecondary};
8369
+ filter: ${(props) => `brightness(${props.theme.theme === THEME.DARK ? 1.07 : 0.95})`};
8088
8370
  }
8089
8371
  `;
8372
+ const DropdownButtonStyled = styled(AccountButtonStyled)`
8373
+ background-color: ${(props) => props.theme.colors.background.primary};
8374
+ `;
8090
8375
  const DropdownContainerStyled = styled.div`
8091
8376
  display: flex;
8092
8377
  flex-direction: column;
@@ -8177,7 +8462,7 @@ const computePosition$1 = (reference, floating, config) => __async(void 0, null,
8177
8462
  } = config;
8178
8463
  const validMiddleware = middleware.filter(Boolean);
8179
8464
  const rtl = yield platform2.isRTL == null ? void 0 : platform2.isRTL(floating);
8180
- if (process.env.NODE_ENV !== "production") {
8465
+ if ({}.NODE_ENV !== "production") {
8181
8466
  if (platform2 == null) {
8182
8467
  console.error(["Floating UI: `platform` property was not passed to config. If you", "want to use Floating UI on the web, install @floating-ui/dom", "instead of the /core package. Otherwise, you can create your own", "`platform`: https://floating-ui.com/docs/platform"].join(" "));
8183
8468
  }
@@ -8234,7 +8519,7 @@ const computePosition$1 = (reference, floating, config) => __async(void 0, null,
8234
8519
  middlewareData = __spreadProps(__spreadValues({}, middlewareData), {
8235
8520
  [name]: __spreadValues(__spreadValues({}, middlewareData[name]), data)
8236
8521
  });
8237
- if (process.env.NODE_ENV !== "production") {
8522
+ if ({}.NODE_ENV !== "production") {
8238
8523
  if (resetCount > 50) {
8239
8524
  console.warn(["Floating UI: The middleware lifecycle appears to be running in an", "infinite loop. This is usually caused by a `reset` continually", "being returned without a break condition."].join(" "));
8240
8525
  }
@@ -8846,8 +9131,9 @@ function P(l2, u2, e2) {
8846
9131
  return n2().middlewareData;
8847
9132
  }, update: i2 };
8848
9133
  }
8849
- const _tmpl$$3 = /* @__PURE__ */ template$1(`<div></div>`);
9134
+ const _tmpl$$3 = /* @__PURE__ */ template$1(`<div id="tc-dropdown-container"></div>`);
8850
9135
  const AccountButton = () => {
9136
+ const theme = useTheme();
8851
9137
  const connector = useContext(ConnectorContext);
8852
9138
  const tonConnectUI2 = useContext(TonConnectUiContext);
8853
9139
  const [isOpened, setIsOpened] = createSignal(false);
@@ -8897,14 +9183,21 @@ const AccountButton = () => {
8897
9183
  },
8898
9184
  get children() {
8899
9185
  return createComponent(AccountButtonStyled, {
8900
- appearance: "flat",
8901
9186
  onClick: () => tonConnectUI2.connectWallet(),
9187
+ id: "tc-connect-button",
8902
9188
  get children() {
8903
- return [createComponent(TonIcon, {}), createComponent(Text, {
9189
+ return [createComponent(TonIcon, {
9190
+ get fill() {
9191
+ return theme.colors.connectButton.foreground;
9192
+ }
9193
+ }), createComponent(Text, {
8904
9194
  translationKey: "button.connectWallet",
8905
9195
  fontSize: "15px",
8906
9196
  letterSpacing: "-0.24px",
8907
9197
  fontWeight: "590",
9198
+ get color() {
9199
+ return theme.colors.connectButton.foreground;
9200
+ },
8908
9201
  children: "Connect wallet"
8909
9202
  })];
8910
9203
  }
@@ -8917,10 +9210,10 @@ const AccountButton = () => {
8917
9210
  get children() {
8918
9211
  return createComponent(DropdownContainerStyled, {
8919
9212
  get children() {
8920
- return [createComponent(AccountButtonStyled, {
8921
- appearance: "flat",
9213
+ return [createComponent(DropdownButtonStyled, {
8922
9214
  onClick: () => setIsOpened((v) => !v),
8923
9215
  ref: setAnchor,
9216
+ id: "tc-dropdown-button",
8924
9217
  get children() {
8925
9218
  return [createComponent(Text, {
8926
9219
  fontSize: "15px",
@@ -8976,13 +9269,16 @@ const AccountButton = () => {
8976
9269
  ref(r$) {
8977
9270
  const _ref$ = dropDownRef;
8978
9271
  typeof _ref$ === "function" ? _ref$(r$) : dropDownRef = r$;
8979
- }
9272
+ },
9273
+ id: "tc-dropdown"
8980
9274
  });
8981
9275
  }
8982
9276
  });
8983
9277
  }
8984
9278
  }), null);
8985
- insert(_el$, createComponent(NotificationsStyled, {}), null);
9279
+ insert(_el$, createComponent(NotificationsStyled, {
9280
+ id: "tc-notifications"
9281
+ }), null);
8986
9282
  createRenderEffect((_p$) => {
8987
9283
  var _a, _b;
8988
9284
  const _v$ = position.strategy, _v$2 = `${(_a = position.y) != null ? _a : 0}px`, _v$3 = `${(_b = position.x) != null ? _b : 0}px`;
@@ -9020,14 +9316,14 @@ const QrCodeStyled = styled.div`
9020
9316
  }
9021
9317
 
9022
9318
  path {
9023
- fill: ${(props) => props.theme.colors.font.primary};
9319
+ fill: ${(props) => props.theme.colors.text.primary};
9024
9320
  }
9025
9321
  `;
9026
9322
  const ImageBackground = styled.div`
9027
9323
  position: absolute;
9028
9324
  width: 52px;
9029
9325
  height: 52px;
9030
- background: ${(props) => props.theme.colors.backgroundSecondary};
9326
+ background: ${(props) => props.theme.colors.background.secondary};
9031
9327
  padding: 7px;
9032
9328
  top: 112px;
9033
9329
  left: 112px;
@@ -10720,6 +11016,11 @@ const Translation = (props) => {
10720
11016
  const [t2] = useI18n();
10721
11017
  return t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString());
10722
11018
  };
11019
+ const borders = {
11020
+ m: "16px",
11021
+ s: "8px",
11022
+ none: "0"
11023
+ };
10723
11024
  const QrCodeModalStyled = styled.div`
10724
11025
  padding: 0 24px;
10725
11026
  `;
@@ -10730,8 +11031,8 @@ const StyledIconButton = styled(IconButton)`
10730
11031
  `;
10731
11032
  const QRBackgroundStyled = styled.div`
10732
11033
  margin-bottom: 16px;
10733
- background-color: ${(props) => props.theme.colors.backgroundSecondary};
10734
- border-radius: 16px;
11034
+ background-color: ${(props) => props.theme.colors.background.secondary};
11035
+ border-radius: ${(props) => borders[props.theme.borderRadius]};
10735
11036
  display: flex;
10736
11037
  align-items: center;
10737
11038
  justify-content: center;
@@ -10748,6 +11049,7 @@ const ActionButtonStyled = styled(Button)`
10748
11049
  line-height: 20px;
10749
11050
  letter-spacing: -0.32px;
10750
11051
  width: 100%;
11052
+ border-radius: ${(props) => borders[props.theme.borderRadius]};
10751
11053
  `;
10752
11054
  const GetWalletStyled = styled.div`
10753
11055
  display: flex;
@@ -10755,7 +11057,7 @@ const GetWalletStyled = styled.div`
10755
11057
  align-items: center;
10756
11058
  `;
10757
11059
  const TextStyled$1 = styled(Text)`
10758
- color: ${(props) => props.theme.colors.font.secondary};
11060
+ color: ${(props) => props.theme.colors.text.secondary};
10759
11061
  font-size: 16px;
10760
11062
  `;
10761
11063
  function openLink(href, target = "_self") {
@@ -10782,6 +11084,9 @@ const QrCodeModal = (props) => {
10782
11084
  bridgeUrl: props.wallet.bridgeUrl
10783
11085
  });
10784
11086
  return createComponent(QrCodeModalStyled, {
11087
+ get id() {
11088
+ return props.id;
11089
+ },
10785
11090
  get children() {
10786
11091
  return [createComponent(StyledIconButton, {
10787
11092
  icon: "arrow",
@@ -10794,7 +11099,7 @@ const QrCodeModal = (props) => {
10794
11099
  };
10795
11100
  },
10796
11101
  get children() {
10797
- return ["Connect with ", memo(() => props.wallet.name)];
11102
+ return ["Connect with ", createMemo(() => props.wallet.name)];
10798
11103
  }
10799
11104
  }), createComponent(H2, {
10800
11105
  translationKey: "walletModal.qrCodeModal.scan",
@@ -10804,7 +11109,7 @@ const QrCodeModal = (props) => {
10804
11109
  };
10805
11110
  },
10806
11111
  get children() {
10807
- return ["Scan QR code with your phone’s or ", memo(() => props.wallet.name), "’s camera."];
11112
+ return ["Scan QR code with your phone’s or ", createMemo(() => props.wallet.name), "’s camera."];
10808
11113
  }
10809
11114
  }), createComponent(QRBackgroundStyled, {
10810
11115
  get children() {
@@ -10818,7 +11123,6 @@ const QrCodeModal = (props) => {
10818
11123
  }), createComponent(ButtonsContainerStyled, {
10819
11124
  get children() {
10820
11125
  return [createComponent(ActionButtonStyled, {
10821
- appearance: "secondary",
10822
11126
  onClick: () => openLink(universalLink),
10823
11127
  get children() {
10824
11128
  return createComponent(Translation, {
@@ -10829,7 +11133,7 @@ const QrCodeModal = (props) => {
10829
11133
  };
10830
11134
  },
10831
11135
  get children() {
10832
- return ["Open ", memo(() => props.wallet.name)];
11136
+ return ["Open ", createMemo(() => props.wallet.name)];
10833
11137
  }
10834
11138
  });
10835
11139
  }
@@ -10839,7 +11143,6 @@ const QrCodeModal = (props) => {
10839
11143
  },
10840
11144
  get children() {
10841
11145
  return createComponent(ActionButtonStyled, {
10842
- appearance: "secondary",
10843
11146
  onClick: () => connector.connect({
10844
11147
  jsBridgeKey: props.wallet.jsBridgeKey
10845
11148
  }),
@@ -10863,10 +11166,9 @@ const QrCodeModal = (props) => {
10863
11166
  };
10864
11167
  },
10865
11168
  get children() {
10866
- return ["Don't have ", memo(() => props.wallet.name), "?"];
11169
+ return ["Don't have ", createMemo(() => props.wallet.name), "?"];
10867
11170
  }
10868
11171
  }), createComponent(Button, {
10869
- appearance: "secondary",
10870
11172
  onClick: () => openLinkBlank(props.wallet.aboutUrl),
10871
11173
  get children() {
10872
11174
  return createComponent(Translation, {
@@ -10984,6 +11286,9 @@ const _tmpl$ = /* @__PURE__ */ template$1(`<li></li>`);
10984
11286
  const SelectWalletModal = (props) => {
10985
11287
  const learnMoreUrl = "https://ton.org/wallets";
10986
11288
  return createComponent(SelectWalletModalStyled, {
11289
+ get id() {
11290
+ return props.id;
11291
+ },
10987
11292
  get children() {
10988
11293
  return [createComponent(H1, {
10989
11294
  translationKey: "walletModal.selectWalletModal.connectWallet",
@@ -11013,7 +11318,6 @@ const SelectWalletModal = (props) => {
11013
11318
  });
11014
11319
  }
11015
11320
  }), createComponent(ButtonStyled$1, {
11016
- appearance: "secondary",
11017
11321
  onClick: () => openLinkBlank(learnMoreUrl),
11018
11322
  get children() {
11019
11323
  return createComponent(Translation, {
@@ -11025,12 +11329,6 @@ const SelectWalletModal = (props) => {
11025
11329
  }
11026
11330
  });
11027
11331
  };
11028
- const ModalWrapper = styled.div`
11029
- color: ${(props) => {
11030
- var _a;
11031
- return ((_a = props.theme) == null ? void 0 : _a.accentColor) || "blue";
11032
- }};
11033
- `;
11034
11332
  const StyledModal = styled(Modal)`
11035
11333
  padding-left: 0;
11036
11334
  padding-right: 0;
@@ -11064,21 +11362,8 @@ const LoaderContainerStyled = styled.div`
11064
11362
  const [appState, setAppState] = createStore({
11065
11363
  buttonRootId: null,
11066
11364
  language: "en",
11067
- buttonConfiguration: {},
11068
- widgetConfiguration: {}
11365
+ walletsList: {}
11069
11366
  });
11070
- class TonConnectUIError extends TonConnectError$1 {
11071
- constructor(...args) {
11072
- super(...args);
11073
- Object.setPrototypeOf(this, TonConnectUIError.prototype);
11074
- }
11075
- }
11076
- class WalletNotFoundError extends TonConnectUIError {
11077
- constructor(...args) {
11078
- super(...args);
11079
- Object.setPrototypeOf(this, WalletNotFoundError.prototype);
11080
- }
11081
- }
11082
11367
  function uiWalletToWalletInfo(uiWallet) {
11083
11368
  if ("jsBridgeKey" in uiWallet) {
11084
11369
  return __spreadProps(__spreadValues({}, uiWallet), {
@@ -11098,14 +11383,15 @@ function applyWalletsListConfiguration(walletsList, configuration) {
11098
11383
  if (typeof wallet === "string") {
11099
11384
  const walletInfo = walletsList.find((item) => item.name === wallet);
11100
11385
  if (!walletInfo) {
11101
- throw new WalletNotFoundError(
11102
- `Wallet with name === '${wallet}' wasn't found in the wallets list. Check ${wallet} correctness.`
11386
+ console.error(
11387
+ `Wallet with name === '${wallet}' wasn't found in the wallets list. Check '${wallet}' correctness. Available wallets names: ${walletsList.map((i2) => "'" + i2.name + "'").join(", ")}`
11103
11388
  );
11389
+ return null;
11104
11390
  }
11105
11391
  return walletInfo;
11106
11392
  }
11107
11393
  return uiWalletToWalletInfo(wallet);
11108
- });
11394
+ }).filter((i2) => !!i2);
11109
11395
  }
11110
11396
  const filteredWalletsList = ((_a = configuration.excludeWallets) == null ? void 0 : _a.length) ? walletsList.filter(
11111
11397
  (wallet) => {
@@ -11134,7 +11420,7 @@ const WalletsModal = () => {
11134
11420
  if (fetchedWalletsList.state !== "ready") {
11135
11421
  return null;
11136
11422
  }
11137
- return applyWalletsListConfiguration(fetchedWalletsList(), appState.widgetConfiguration.wallets);
11423
+ return applyWalletsListConfiguration(fetchedWalletsList(), appState.walletsList);
11138
11424
  });
11139
11425
  const onClose = () => {
11140
11426
  setWalletsModalOpen(false);
@@ -11172,66 +11458,63 @@ const WalletsModal = () => {
11172
11458
  }
11173
11459
  });
11174
11460
  onCleanup(unsubscribe);
11175
- return createComponent(ModalWrapper, {
11461
+ return createComponent(StyledModal, {
11462
+ get opened() {
11463
+ return walletsModalOpen();
11464
+ },
11465
+ onClose,
11466
+ id: "tc-wallets-modal-container",
11176
11467
  get children() {
11177
- return createComponent(StyledModal, {
11178
- get opened() {
11179
- return walletsModalOpen();
11468
+ return [createComponent(Show, {
11469
+ get when() {
11470
+ return !walletsList();
11471
+ },
11472
+ get children() {
11473
+ return [createComponent(H1Styled$1, {
11474
+ translationKey: "walletModal.loading",
11475
+ children: "Wallets list is loading"
11476
+ }), createComponent(LoaderContainerStyled, {
11477
+ get children() {
11478
+ return createComponent(LoaderIconStyled$1, {});
11479
+ }
11480
+ })];
11481
+ }
11482
+ }), createComponent(Show, {
11483
+ get when() {
11484
+ return walletsList();
11180
11485
  },
11181
- onClose,
11182
11486
  get children() {
11183
11487
  return [createComponent(Show, {
11184
11488
  get when() {
11185
- return !walletsList();
11489
+ return !selectedWalletInfo();
11186
11490
  },
11491
+ keyed: false,
11187
11492
  get children() {
11188
- return [createComponent(H1Styled$1, {
11189
- translationKey: "walletModal.loading",
11190
- children: "Wallets list is loading"
11191
- }), createComponent(LoaderContainerStyled, {
11192
- get children() {
11193
- return createComponent(LoaderIconStyled$1, {
11194
- fill: "#7A899970"
11195
- });
11196
- }
11197
- })];
11493
+ return createComponent(SelectWalletModal, {
11494
+ get walletsList() {
11495
+ return walletsList();
11496
+ },
11497
+ onSelect,
11498
+ id: "tc-wallets-modal"
11499
+ });
11198
11500
  }
11199
11501
  }), createComponent(Show, {
11200
11502
  get when() {
11201
- return walletsList();
11503
+ return selectedWalletInfo();
11202
11504
  },
11505
+ keyed: false,
11203
11506
  get children() {
11204
- return [createComponent(Show, {
11205
- get when() {
11206
- return !selectedWalletInfo();
11207
- },
11208
- keyed: false,
11209
- get children() {
11210
- return createComponent(SelectWalletModal, {
11211
- get walletsList() {
11212
- return walletsList();
11213
- },
11214
- onSelect
11215
- });
11216
- }
11217
- }), createComponent(Show, {
11218
- get when() {
11507
+ return createComponent(QrCodeModal, {
11508
+ get wallet() {
11219
11509
  return selectedWalletInfo();
11220
11510
  },
11221
- keyed: false,
11222
- get children() {
11223
- return createComponent(QrCodeModal, {
11224
- get wallet() {
11225
- return selectedWalletInfo();
11226
- },
11227
- onBackClick: () => setSelectedWalletInfo(null)
11228
- });
11229
- }
11230
- })];
11511
+ onBackClick: () => setSelectedWalletInfo(null),
11512
+ id: "tc-qr-modal"
11513
+ });
11231
11514
  }
11232
11515
  })];
11233
11516
  }
11234
- });
11517
+ })];
11235
11518
  }
11236
11519
  });
11237
11520
  };
@@ -11252,15 +11535,18 @@ const TextStyled = styled(Text)`
11252
11535
  text-align: center;
11253
11536
  max-width: 250px;
11254
11537
 
11255
- color: ${(props) => props.theme.colors.font.secondary};
11538
+ color: ${(props) => props.theme.colors.text.secondary};
11256
11539
  `;
11257
11540
  const ButtonStyled = styled(Button)`
11258
11541
  margin-top: 32px;
11259
11542
  `;
11260
11543
  const ActionModal = (props) => {
11261
11544
  return createComponent(ActionModalStyled, {
11545
+ get id() {
11546
+ return props.id;
11547
+ },
11262
11548
  get children() {
11263
- return [memo(() => props.icon), createComponent(H1Styled, {
11549
+ return [createMemo(() => props.icon), createComponent(H1Styled, {
11264
11550
  get translationKey() {
11265
11551
  return props.headerTranslationKey;
11266
11552
  }
@@ -11274,7 +11560,6 @@ const ActionModal = (props) => {
11274
11560
  },
11275
11561
  get children() {
11276
11562
  return createComponent(ButtonStyled, {
11277
- appearance: "secondary",
11278
11563
  onClick: () => props.onClose(),
11279
11564
  get children() {
11280
11565
  return createComponent(Translation, {
@@ -11297,12 +11582,13 @@ const ConfirmTransactionModal = (props) => {
11297
11582
  headerTranslationKey: "actionModal.confirmTransaction.header",
11298
11583
  textTranslationKey: "actionModal.confirmTransaction.text",
11299
11584
  get icon() {
11300
- return createComponent(LoaderIconStyled, {
11301
- fill: "#7A899970"
11302
- });
11585
+ return createComponent(LoaderIconStyled, {});
11303
11586
  },
11304
11587
  onClose: () => props.onClose(),
11305
- showButton: false
11588
+ showButton: false,
11589
+ get id() {
11590
+ return props.id;
11591
+ }
11306
11592
  });
11307
11593
  };
11308
11594
  const ErrorIconStyled = styled(ErrorIcon)`
@@ -11316,7 +11602,10 @@ const TransactionCanceledModal = (props) => {
11316
11602
  get icon() {
11317
11603
  return createComponent(ErrorIconStyled, {});
11318
11604
  },
11319
- onClose: () => props.onClose()
11605
+ onClose: () => props.onClose(),
11606
+ get id() {
11607
+ return props.id;
11608
+ }
11320
11609
  });
11321
11610
  };
11322
11611
  const SuccessIconStyled = styled(SuccessIcon)`
@@ -11330,16 +11619,20 @@ const TransactionSentModal = (props) => {
11330
11619
  get icon() {
11331
11620
  return createComponent(SuccessIconStyled, {});
11332
11621
  },
11333
- onClose: () => props.onClose()
11622
+ onClose: () => props.onClose(),
11623
+ get id() {
11624
+ return props.id;
11625
+ }
11334
11626
  });
11335
11627
  };
11336
11628
  const ActionsModal = () => {
11337
11629
  return createComponent(Modal, {
11338
11630
  get opened() {
11339
11631
  var _a;
11340
- return memo(() => action() !== null, true)() && ((_a = action()) == null ? void 0 : _a.openModal) === true;
11632
+ return createMemo(() => action() !== null)() && ((_a = action()) == null ? void 0 : _a.openModal) === true;
11341
11633
  },
11342
11634
  onClose: () => setAction(null),
11635
+ id: "tc-actions-modal-container",
11343
11636
  get children() {
11344
11637
  return createComponent(Switch, {
11345
11638
  get children() {
@@ -11349,7 +11642,8 @@ const ActionsModal = () => {
11349
11642
  },
11350
11643
  get children() {
11351
11644
  return createComponent(TransactionSentModal, {
11352
- onClose: () => setAction(null)
11645
+ onClose: () => setAction(null),
11646
+ id: "tc-transaction-sent-modal"
11353
11647
  });
11354
11648
  }
11355
11649
  }), createComponent(Match, {
@@ -11358,7 +11652,8 @@ const ActionsModal = () => {
11358
11652
  },
11359
11653
  get children() {
11360
11654
  return createComponent(TransactionCanceledModal, {
11361
- onClose: () => setAction(null)
11655
+ onClose: () => setAction(null),
11656
+ id: "tc-transaction-canceled-modal"
11362
11657
  });
11363
11658
  }
11364
11659
  }), createComponent(Match, {
@@ -11367,7 +11662,8 @@ const ActionsModal = () => {
11367
11662
  },
11368
11663
  get children() {
11369
11664
  return createComponent(ConfirmTransactionModal, {
11370
- onClose: () => setAction(null)
11665
+ onClose: () => setAction(null),
11666
+ id: "tc-confirm-modal"
11371
11667
  });
11372
11668
  }
11373
11669
  })];
@@ -11428,6 +11724,12 @@ const widgetController = {
11428
11724
  tonConnectUI: tonConnectUI2
11429
11725
  }), document.getElementById(root))
11430
11726
  };
11727
+ class TonConnectUIError extends TonConnectError$1 {
11728
+ constructor(...args) {
11729
+ super(...args);
11730
+ Object.setPrototypeOf(this, TonConnectUIError.prototype);
11731
+ }
11732
+ }
11431
11733
  class WalletInfoStorage {
11432
11734
  constructor() {
11433
11735
  __publicField(this, "localStorage");
@@ -11453,142 +11755,13 @@ class WalletInfoStorage {
11453
11755
  this.localStorage.removeItem(this.storageKey);
11454
11756
  }
11455
11757
  }
11456
- var isMergeableObject = function isMergeableObject2(value) {
11457
- return isNonNullObject(value) && !isSpecial(value);
11458
- };
11459
- function isNonNullObject(value) {
11460
- return !!value && typeof value === "object";
11461
- }
11462
- function isSpecial(value) {
11463
- var stringValue = Object.prototype.toString.call(value);
11464
- return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
11465
- }
11466
- var canUseSymbol = typeof Symbol === "function" && Symbol.for;
11467
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
11468
- function isReactElement(value) {
11469
- return value.$$typeof === REACT_ELEMENT_TYPE;
11470
- }
11471
- function emptyTarget(val) {
11472
- return Array.isArray(val) ? [] : {};
11473
- }
11474
- function cloneUnlessOtherwiseSpecified(value, options) {
11475
- return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
11476
- }
11477
- function defaultArrayMerge(target, source, options) {
11478
- return target.concat(source).map(function(element) {
11479
- return cloneUnlessOtherwiseSpecified(element, options);
11480
- });
11481
- }
11482
- function getMergeFunction(key, options) {
11483
- if (!options.customMerge) {
11484
- return deepmerge;
11485
- }
11486
- var customMerge = options.customMerge(key);
11487
- return typeof customMerge === "function" ? customMerge : deepmerge;
11488
- }
11489
- function getEnumerableOwnPropertySymbols(target) {
11490
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
11491
- return target.propertyIsEnumerable(symbol);
11492
- }) : [];
11493
- }
11494
- function getKeys(target) {
11495
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
11496
- }
11497
- function propertyIsOnObject(object, property) {
11498
- try {
11499
- return property in object;
11500
- } catch (_) {
11501
- return false;
11502
- }
11503
- }
11504
- function propertyIsUnsafe(target, key) {
11505
- return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
11506
- }
11507
- function mergeObject(target, source, options) {
11508
- var destination = {};
11509
- if (options.isMergeableObject(target)) {
11510
- getKeys(target).forEach(function(key) {
11511
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
11512
- });
11513
- }
11514
- getKeys(source).forEach(function(key) {
11515
- if (propertyIsUnsafe(target, key)) {
11516
- return;
11517
- }
11518
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
11519
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
11520
- } else {
11521
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
11522
- }
11523
- });
11524
- return destination;
11525
- }
11526
- function deepmerge(target, source, options) {
11527
- options = options || {};
11528
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
11529
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
11530
- options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
11531
- var sourceIsArray = Array.isArray(source);
11532
- var targetIsArray = Array.isArray(target);
11533
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
11534
- if (!sourceAndTargetTypesMatch) {
11535
- return cloneUnlessOtherwiseSpecified(source, options);
11536
- } else if (sourceIsArray) {
11537
- return options.arrayMerge(target, source, options);
11538
- } else {
11539
- return mergeObject(target, source, options);
11540
- }
11541
- }
11542
- deepmerge.all = function deepmergeAll(array, options) {
11543
- if (!Array.isArray(array)) {
11544
- throw new Error("first argument should be an array");
11545
- }
11546
- return array.reduce(function(prev, next) {
11547
- return deepmerge(prev, next, options);
11548
- }, {});
11549
- };
11550
- var deepmerge_1 = deepmerge;
11551
- var cjs = deepmerge_1;
11552
- /*!
11553
- * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
11554
- *
11555
- * Copyright (c) 2014-2017, Jon Schlinkert.
11556
- * Released under the MIT License.
11557
- */
11558
- function isObject(o2) {
11559
- return Object.prototype.toString.call(o2) === "[object Object]";
11560
- }
11561
- function isPlainObject(o2) {
11562
- var ctor, prot;
11563
- if (isObject(o2) === false)
11564
- return false;
11565
- ctor = o2.constructor;
11566
- if (ctor === void 0)
11567
- return true;
11568
- prot = ctor.prototype;
11569
- if (isObject(prot) === false)
11570
- return false;
11571
- if (prot.hasOwnProperty("isPrototypeOf") === false) {
11572
- return false;
11573
- }
11574
- return true;
11575
- }
11576
- function mergeOptions(options, defaultOptions) {
11577
- if (!options) {
11578
- return defaultOptions;
11579
- }
11580
- const overwriteMerge = (_, sourceArray, __) => sourceArray;
11581
- return cjs(defaultOptions, options, {
11582
- arrayMerge: overwriteMerge,
11583
- isMergeableObject: isPlainObject
11584
- });
11585
- }
11586
11758
  class TonConnectUI {
11587
11759
  constructor(options) {
11588
11760
  __publicField(this, "walletInfoStorage", new WalletInfoStorage());
11589
11761
  __publicField(this, "connector");
11590
11762
  __publicField(this, "_walletInfo", null);
11591
11763
  __publicField(this, "systemThemeChangeUnsubscribe", null);
11764
+ __publicField(this, "actionsConfiguration");
11592
11765
  if (options && "connector" in options && options.connector) {
11593
11766
  this.connector = options.connector;
11594
11767
  } else if (options && "manifestUrl" in options && options.manifestUrl) {
@@ -11611,7 +11784,7 @@ class TonConnectUI {
11611
11784
  }
11612
11785
  });
11613
11786
  }
11614
- this.uiOptions = options || {};
11787
+ this.uiOptions = mergeOptions(options, { uiPreferences: { theme: "SYSTEM" } });
11615
11788
  setAppState({ connector: this.connector });
11616
11789
  widgetController.renderApp(rootId, this);
11617
11790
  }
@@ -11631,28 +11804,30 @@ class TonConnectUI {
11631
11804
  return this._walletInfo;
11632
11805
  }
11633
11806
  set uiOptions(options) {
11634
- var _a;
11807
+ var _a, _b, _c, _d, _e;
11635
11808
  this.checkButtonRootExist(options.buttonRootId);
11636
- if (options.theme === "SYSTEM") {
11637
- setTheme(getSystemTheme());
11638
- if (!this.systemThemeChangeUnsubscribe) {
11639
- this.systemThemeChangeUnsubscribe = subscribeToThemeChange(
11640
- (theme) => setTheme(theme)
11641
- );
11809
+ this.actionsConfiguration = options.actionsConfiguration;
11810
+ if ((_a = options.uiPreferences) == null ? void 0 : _a.theme) {
11811
+ if (((_b = options.uiPreferences) == null ? void 0 : _b.theme) !== "SYSTEM") {
11812
+ (_c = this.systemThemeChangeUnsubscribe) == null ? void 0 : _c.call(this);
11813
+ setTheme(options.uiPreferences.theme, options.uiPreferences.colorsSet);
11814
+ } else {
11815
+ setTheme(getSystemTheme(), options.uiPreferences.colorsSet);
11816
+ if (!this.systemThemeChangeUnsubscribe) {
11817
+ this.systemThemeChangeUnsubscribe = subscribeToThemeChange(setTheme);
11818
+ }
11642
11819
  }
11643
11820
  } else {
11644
- if (options.theme) {
11645
- (_a = this.systemThemeChangeUnsubscribe) == null ? void 0 : _a.call(this);
11646
- setTheme(options.theme);
11821
+ if ((_d = options.uiPreferences) == null ? void 0 : _d.colorsSet) {
11822
+ setColors(options.uiPreferences.colorsSet);
11647
11823
  }
11648
11824
  }
11825
+ if ((_e = options.uiPreferences) == null ? void 0 : _e.borderRadius) {
11826
+ setBorderRadius(options.uiPreferences.borderRadius);
11827
+ }
11649
11828
  setAppState((state) => {
11650
11829
  const merged = mergeOptions(
11651
- __spreadValues(__spreadValues(__spreadValues({}, options.language && { language: options.language }), options.buttonConfiguration && {
11652
- buttonConfiguration: options.buttonConfiguration
11653
- }), options.widgetConfiguration && {
11654
- widgetConfiguration: options.widgetConfiguration
11655
- }),
11830
+ __spreadValues(__spreadValues({}, options.language && { language: options.language }), !!options.walletsList && { walletsList: options.walletsList }),
11656
11831
  unwrap(state)
11657
11832
  );
11658
11833
  if (options.buttonRootId !== void 0) {
@@ -11713,25 +11888,24 @@ class TonConnectUI {
11713
11888
  if (!isDevice("desktop") && "universalLink" in this.walletInfo) {
11714
11889
  openLink(this.walletInfo.universalLink);
11715
11890
  }
11716
- const notification = (options == null ? void 0 : options.notifications) || ["before", "success", "error"];
11717
- const modals = (options == null ? void 0 : options.modals) || ["before"];
11891
+ const { notifications: notifications2, modals } = this.getModalsAndNotificationsConfiguration(options);
11718
11892
  widgetController.setAction({
11719
11893
  name: "confirm-transaction",
11720
- showNotification: notification.includes("before"),
11894
+ showNotification: notifications2.includes("before"),
11721
11895
  openModal: modals.includes("before")
11722
11896
  });
11723
11897
  try {
11724
11898
  const result = yield this.connector.sendTransaction(tx);
11725
11899
  widgetController.setAction({
11726
11900
  name: "transaction-sent",
11727
- showNotification: notification.includes("success"),
11901
+ showNotification: notifications2.includes("success"),
11728
11902
  openModal: modals.includes("success")
11729
11903
  });
11730
11904
  return result;
11731
11905
  } catch (e2) {
11732
11906
  widgetController.setAction({
11733
11907
  name: "transaction-canceled",
11734
- showNotification: notification.includes("error"),
11908
+ showNotification: notifications2.includes("error"),
11735
11909
  openModal: modals.includes("error")
11736
11910
  });
11737
11911
  if (e2 instanceof TonConnectError$1) {
@@ -11740,8 +11914,6 @@ class TonConnectUI {
11740
11914
  console.error(e2);
11741
11915
  throw new TonConnectUIError("Unhandled error:" + e2);
11742
11916
  }
11743
- } finally {
11744
- widgetController.clearAction();
11745
11917
  }
11746
11918
  });
11747
11919
  }
@@ -11780,6 +11952,44 @@ class TonConnectUI {
11780
11952
  throw new TonConnectUIError(`${buttonRootId2} element not found in the document.`);
11781
11953
  }
11782
11954
  }
11955
+ getModalsAndNotificationsConfiguration(options) {
11956
+ var _a, _b, _c;
11957
+ const allActions = [
11958
+ "before",
11959
+ "success",
11960
+ "error"
11961
+ ];
11962
+ let notifications2 = allActions;
11963
+ if (((_a = this.actionsConfiguration) == null ? void 0 : _a.notifications) && ((_b = this.actionsConfiguration) == null ? void 0 : _b.notifications) !== "all") {
11964
+ notifications2 = this.actionsConfiguration.notifications;
11965
+ }
11966
+ if (options == null ? void 0 : options.notifications) {
11967
+ if (options.notifications === "all") {
11968
+ notifications2 = allActions;
11969
+ } else {
11970
+ notifications2 = options.notifications;
11971
+ }
11972
+ }
11973
+ let modals = ["before"];
11974
+ if ((_c = this.actionsConfiguration) == null ? void 0 : _c.modals) {
11975
+ if (this.actionsConfiguration.modals === "all") {
11976
+ modals = allActions;
11977
+ } else {
11978
+ modals = this.actionsConfiguration.modals;
11979
+ }
11980
+ }
11981
+ if (options == null ? void 0 : options.modals) {
11982
+ if (options.modals === "all") {
11983
+ modals = allActions;
11984
+ } else {
11985
+ modals = options.modals;
11986
+ }
11987
+ }
11988
+ return {
11989
+ notifications: notifications2,
11990
+ modals
11991
+ };
11992
+ }
11783
11993
  }
11784
11994
  const TonConnectUIContext = createContext$1(null);
11785
11995
  let tonConnectUI = null;
@@ -11794,7 +12004,7 @@ const TonConnectUIProvider = (_a) => {
11794
12004
  }
11795
12005
  return /* @__PURE__ */ jsx(TonConnectUIContext.Provider, { value: tonConnectUI, children: children2 });
11796
12006
  };
11797
- const TonConnectUIProvider$1 = memo$1(TonConnectUIProvider);
12007
+ const TonConnectUIProvider$1 = memo(TonConnectUIProvider);
11798
12008
  class TonConnectUIReactError extends TonConnectUIError {
11799
12009
  constructor(...args) {
11800
12010
  super(...args);
@@ -11829,7 +12039,7 @@ const TonConnectButton = ({ className: className2, style: style2 }) => {
11829
12039
  }, []);
11830
12040
  return /* @__PURE__ */ jsx("div", { id: buttonRootId, className: className2, style: style2 });
11831
12041
  };
11832
- const TonConnectButton$1 = memo$1(TonConnectButton);
12042
+ const TonConnectButton$1 = memo(TonConnectButton);
11833
12043
  function useTonWallet() {
11834
12044
  const [tonConnectUI2] = useTonConnectUI();
11835
12045
  const [wallet, setWallet] = useState(