@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.umd.js CHANGED
@@ -4855,7 +4855,7 @@ var __objRest = (source, exclude) => {
4855
4855
  let Effects = null;
4856
4856
  let ExecCount = 0;
4857
4857
  function createRoot(fn, detachedOwner) {
4858
- const listener = Listener, owner = Owner, unowned = fn.length === 0, root = unowned && true ? UNOWNED : {
4858
+ const listener = Listener, owner = Owner, unowned = fn.length === 0, root = unowned ? UNOWNED : {
4859
4859
  owned: null,
4860
4860
  cleanups: null,
4861
4861
  context: null,
@@ -4951,8 +4951,8 @@ var __objRest = (source, exclude) => {
4951
4951
  runUpdates(() => {
4952
4952
  if (!err)
4953
4953
  setValue(() => v);
4954
- setError(err);
4955
4954
  setState(err ? "errored" : "ready");
4955
+ setError(err);
4956
4956
  for (const c2 of contexts.keys())
4957
4957
  c2.decrement();
4958
4958
  contexts.clear();
@@ -4991,7 +4991,7 @@ var __objRest = (source, exclude) => {
4991
4991
  refetching
4992
4992
  }));
4993
4993
  if (typeof p2 !== "object" || !(p2 && "then" in p2)) {
4994
- loadEnd(pr, p2);
4994
+ loadEnd(pr, p2, void 0, lookup2);
4995
4995
  return p2;
4996
4996
  }
4997
4997
  pr = p2;
@@ -5001,7 +5001,7 @@ var __objRest = (source, exclude) => {
5001
5001
  setState(resolved ? "refreshing" : "pending");
5002
5002
  trigger();
5003
5003
  }, false);
5004
- return p2.then((v) => loadEnd(p2, v, void 0, lookup2), (e2) => loadEnd(p2, void 0, castError(e2)));
5004
+ return p2.then((v) => loadEnd(p2, v, void 0, lookup2), (e2) => loadEnd(p2, void 0, castError(e2), lookup2));
5005
5005
  }
5006
5006
  Object.defineProperties(read, {
5007
5007
  state: {
@@ -5040,11 +5040,13 @@ var __objRest = (source, exclude) => {
5040
5040
  return runUpdates(fn, false);
5041
5041
  }
5042
5042
  function untrack(fn) {
5043
- let result, listener = Listener;
5043
+ const listener = Listener;
5044
5044
  Listener = null;
5045
- result = fn();
5046
- Listener = listener;
5047
- return result;
5045
+ try {
5046
+ return fn();
5047
+ } finally {
5048
+ Listener = listener;
5049
+ }
5048
5050
  }
5049
5051
  function on(deps, fn, options) {
5050
5052
  const isArray = Array.isArray(deps);
@@ -5082,7 +5084,7 @@ var __objRest = (source, exclude) => {
5082
5084
  function getListener() {
5083
5085
  return Listener;
5084
5086
  }
5085
- function createContext(defaultValue) {
5087
+ function createContext(defaultValue, options) {
5086
5088
  const id = Symbol("context");
5087
5089
  return {
5088
5090
  id,
@@ -5096,12 +5098,12 @@ var __objRest = (source, exclude) => {
5096
5098
  }
5097
5099
  function children(fn) {
5098
5100
  const children2 = createMemo(fn);
5099
- const memo2 = createMemo(() => resolveChildren(children2()));
5100
- memo2.toArray = () => {
5101
- const c2 = memo2();
5101
+ const memo = createMemo(() => resolveChildren(children2()));
5102
+ memo.toArray = () => {
5103
+ const c2 = memo();
5102
5104
  return Array.isArray(c2) ? c2 : c2 != null ? [c2] : [];
5103
5105
  };
5104
- return memo2;
5106
+ return memo;
5105
5107
  }
5106
5108
  let SuspenseContext;
5107
5109
  function readSignal() {
@@ -5380,7 +5382,7 @@ var __objRest = (source, exclude) => {
5380
5382
  }
5381
5383
  return children2;
5382
5384
  }
5383
- function createProvider(id) {
5385
+ function createProvider(id, options) {
5384
5386
  return function provider(props) {
5385
5387
  let res;
5386
5388
  createRenderEffect(() => res = untrack(() => {
@@ -5388,7 +5390,7 @@ var __objRest = (source, exclude) => {
5388
5390
  [id]: props.value
5389
5391
  };
5390
5392
  return children(() => props.children);
5391
- }));
5393
+ }), void 0);
5392
5394
  return res;
5393
5395
  };
5394
5396
  }
@@ -5500,6 +5502,8 @@ var __objRest = (source, exclude) => {
5500
5502
  return _.get(property);
5501
5503
  },
5502
5504
  has(_, property) {
5505
+ if (property === $PROXY)
5506
+ return true;
5503
5507
  return _.has(property);
5504
5508
  },
5505
5509
  set: trueFn,
@@ -5520,68 +5524,116 @@ var __objRest = (source, exclude) => {
5520
5524
  }
5521
5525
  };
5522
5526
  function resolveSource(s2) {
5523
- return (s2 = typeof s2 === "function" ? s2() : s2) == null ? {} : s2;
5527
+ return !(s2 = typeof s2 === "function" ? s2() : s2) ? {} : s2;
5524
5528
  }
5525
5529
  function mergeProps(...sources) {
5526
- return new Proxy({
5527
- get(property) {
5528
- for (let i2 = sources.length - 1; i2 >= 0; i2--) {
5529
- const v = resolveSource(sources[i2])[property];
5530
- if (v !== void 0)
5531
- return v;
5532
- }
5533
- },
5534
- has(property) {
5535
- for (let i2 = sources.length - 1; i2 >= 0; i2--) {
5536
- if (property in resolveSource(sources[i2]))
5537
- return true;
5530
+ let proxy = false;
5531
+ for (let i2 = 0; i2 < sources.length; i2++) {
5532
+ const s2 = sources[i2];
5533
+ proxy = proxy || !!s2 && $PROXY in s2;
5534
+ sources[i2] = typeof s2 === "function" ? (proxy = true, createMemo(s2)) : s2;
5535
+ }
5536
+ if (proxy) {
5537
+ return new Proxy({
5538
+ get(property) {
5539
+ for (let i2 = sources.length - 1; i2 >= 0; i2--) {
5540
+ const v = resolveSource(sources[i2])[property];
5541
+ if (v !== void 0)
5542
+ return v;
5543
+ }
5544
+ },
5545
+ has(property) {
5546
+ for (let i2 = sources.length - 1; i2 >= 0; i2--) {
5547
+ if (property in resolveSource(sources[i2]))
5548
+ return true;
5549
+ }
5550
+ return false;
5551
+ },
5552
+ keys() {
5553
+ const keys = [];
5554
+ for (let i2 = 0; i2 < sources.length; i2++)
5555
+ keys.push(...Object.keys(resolveSource(sources[i2])));
5556
+ return [...new Set(keys)];
5557
+ }
5558
+ }, propTraps);
5559
+ }
5560
+ const target = {};
5561
+ for (let i2 = sources.length - 1; i2 >= 0; i2--) {
5562
+ if (sources[i2]) {
5563
+ const descriptors = Object.getOwnPropertyDescriptors(sources[i2]);
5564
+ for (const key in descriptors) {
5565
+ if (key in target)
5566
+ continue;
5567
+ Object.defineProperty(target, key, {
5568
+ enumerable: true,
5569
+ get() {
5570
+ for (let i3 = sources.length - 1; i3 >= 0; i3--) {
5571
+ const v = (sources[i3] || {})[key];
5572
+ if (v !== void 0)
5573
+ return v;
5574
+ }
5575
+ }
5576
+ });
5538
5577
  }
5539
- return false;
5540
- },
5541
- keys() {
5542
- const keys = [];
5543
- for (let i2 = 0; i2 < sources.length; i2++)
5544
- keys.push(...Object.keys(resolveSource(sources[i2])));
5545
- return [...new Set(keys)];
5546
5578
  }
5547
- }, propTraps);
5579
+ }
5580
+ return target;
5548
5581
  }
5549
5582
  function splitProps(props, ...keys) {
5550
5583
  const blocked = new Set(keys.flat());
5584
+ if ($PROXY in props) {
5585
+ const res = keys.map((k) => {
5586
+ return new Proxy({
5587
+ get(property) {
5588
+ return k.includes(property) ? props[property] : void 0;
5589
+ },
5590
+ has(property) {
5591
+ return k.includes(property) && property in props;
5592
+ },
5593
+ keys() {
5594
+ return k.filter((property) => property in props);
5595
+ }
5596
+ }, propTraps);
5597
+ });
5598
+ res.push(new Proxy({
5599
+ get(property) {
5600
+ return blocked.has(property) ? void 0 : props[property];
5601
+ },
5602
+ has(property) {
5603
+ return blocked.has(property) ? false : property in props;
5604
+ },
5605
+ keys() {
5606
+ return Object.keys(props).filter((k) => !blocked.has(k));
5607
+ }
5608
+ }, propTraps));
5609
+ return res;
5610
+ }
5551
5611
  const descriptors = Object.getOwnPropertyDescriptors(props);
5552
- const res = keys.map((k) => {
5612
+ keys.push(Object.keys(descriptors).filter((k) => !blocked.has(k)));
5613
+ return keys.map((k) => {
5553
5614
  const clone = {};
5554
5615
  for (let i2 = 0; i2 < k.length; i2++) {
5555
5616
  const key = k[i2];
5617
+ if (!(key in props))
5618
+ continue;
5556
5619
  Object.defineProperty(clone, key, descriptors[key] ? descriptors[key] : {
5557
5620
  get() {
5558
5621
  return props[key];
5559
5622
  },
5560
5623
  set() {
5561
5624
  return true;
5562
- }
5625
+ },
5626
+ enumerable: true
5563
5627
  });
5564
5628
  }
5565
5629
  return clone;
5566
5630
  });
5567
- res.push(new Proxy({
5568
- get(property) {
5569
- return blocked.has(property) ? void 0 : props[property];
5570
- },
5571
- has(property) {
5572
- return blocked.has(property) ? false : property in props;
5573
- },
5574
- keys() {
5575
- return Object.keys(props).filter((k) => !blocked.has(k));
5576
- }
5577
- }, propTraps));
5578
- return res;
5579
5631
  }
5580
5632
  function For(props) {
5581
5633
  const fallback = "fallback" in props && {
5582
5634
  fallback: () => props.fallback
5583
5635
  };
5584
- return createMemo(mapArray(() => props.each, props.children, fallback ? fallback : void 0));
5636
+ return createMemo(mapArray(() => props.each, props.children, fallback || void 0));
5585
5637
  }
5586
5638
  function Show(props) {
5587
5639
  let strictEqual = false;
@@ -5598,11 +5650,12 @@ var __objRest = (source, exclude) => {
5598
5650
  return fn ? untrack(() => child(c2)) : child;
5599
5651
  }
5600
5652
  return props.fallback;
5601
- });
5653
+ }, void 0, void 0);
5602
5654
  }
5603
5655
  function Switch(props) {
5604
5656
  let strictEqual = false;
5605
5657
  let keyed = false;
5658
+ const equals = (a2, b) => a2[0] === b[0] && (strictEqual ? a2[1] === b[1] : !a2[1] === !b[1]) && a2[2] === b[2];
5606
5659
  const conditions = children(() => props.children), evalConditions = createMemo(() => {
5607
5660
  let conds = conditions();
5608
5661
  if (!Array.isArray(conds))
@@ -5616,7 +5669,7 @@ var __objRest = (source, exclude) => {
5616
5669
  }
5617
5670
  return [-1];
5618
5671
  }, void 0, {
5619
- equals: (a2, b) => a2[0] === b[0] && (strictEqual ? a2[1] === b[1] : !a2[1] === !b[1]) && a2[2] === b[2]
5672
+ equals
5620
5673
  });
5621
5674
  return createMemo(() => {
5622
5675
  const [index, when, cond] = evalConditions();
@@ -5626,7 +5679,7 @@ var __objRest = (source, exclude) => {
5626
5679
  const fn = typeof c2 === "function" && c2.length > 0;
5627
5680
  strictEqual = keyed || fn;
5628
5681
  return fn ? untrack(() => c2(when)) : c2;
5629
- });
5682
+ }, void 0, void 0);
5630
5683
  }
5631
5684
  function Match(props) {
5632
5685
  return props;
@@ -5634,18 +5687,18 @@ var __objRest = (source, exclude) => {
5634
5687
  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"];
5635
5688
  const Properties = /* @__PURE__ */ new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
5636
5689
  const ChildProperties = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]);
5637
- const Aliases = {
5690
+ const Aliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
5638
5691
  className: "class",
5639
5692
  htmlFor: "for"
5640
- };
5641
- const PropAliases = {
5693
+ });
5694
+ const PropAliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
5642
5695
  class: "className",
5643
5696
  formnovalidate: "formNoValidate",
5644
5697
  ismap: "isMap",
5645
5698
  nomodule: "noModule",
5646
5699
  playsinline: "playsInline",
5647
5700
  readonly: "readOnly"
5648
- };
5701
+ });
5649
5702
  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"]);
5650
5703
  const SVGElements = /* @__PURE__ */ new Set([
5651
5704
  "altGlyph",
@@ -5729,11 +5782,6 @@ var __objRest = (source, exclude) => {
5729
5782
  xlink: "http://www.w3.org/1999/xlink",
5730
5783
  xml: "http://www.w3.org/XML/1998/namespace"
5731
5784
  };
5732
- function memo(fn, equals) {
5733
- return createMemo(fn, void 0, !equals ? {
5734
- equals
5735
- } : void 0);
5736
- }
5737
5785
  function reconcileArrays(parentNode, a2, b) {
5738
5786
  let bLength = b.length, aEnd = a2.length, bEnd = bLength, aStart = 0, bStart = 0, after = a2[aEnd - 1].nextSibling, map = null;
5739
5787
  while (aStart < aEnd || bStart < bEnd) {
@@ -5791,12 +5839,12 @@ var __objRest = (source, exclude) => {
5791
5839
  }
5792
5840
  }
5793
5841
  const $$EVENTS = "_$DX_DELEGATE";
5794
- function render(code, element, init) {
5842
+ function render(code, element, init, options = {}) {
5795
5843
  let disposer;
5796
5844
  createRoot((dispose2) => {
5797
5845
  disposer = dispose2;
5798
5846
  element === document ? code() : insert(element, code(), element.firstChild ? null : void 0, init);
5799
- });
5847
+ }, options.owner);
5800
5848
  return () => {
5801
5849
  disposer();
5802
5850
  element.textContent = "";
@@ -5893,11 +5941,14 @@ var __objRest = (source, exclude) => {
5893
5941
  }
5894
5942
  return prev;
5895
5943
  }
5896
- function spread(node, accessor, isSVG, skipChildren) {
5897
- if (typeof accessor === "function") {
5898
- createRenderEffect((current) => spreadExpression(node, accessor(), current, isSVG, skipChildren));
5899
- } else
5900
- spreadExpression(node, accessor, void 0, isSVG, skipChildren);
5944
+ function spread(node, props = {}, isSVG, skipChildren) {
5945
+ const prevProps = {};
5946
+ if (!skipChildren) {
5947
+ createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
5948
+ }
5949
+ createRenderEffect(() => props.ref && props.ref(node));
5950
+ createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
5951
+ return prevProps;
5901
5952
  }
5902
5953
  function use(fn, element, arg) {
5903
5954
  return untrack(() => fn(element, arg));
@@ -5955,9 +6006,8 @@ var __objRest = (source, exclude) => {
5955
6006
  if (value === prev)
5956
6007
  return prev;
5957
6008
  if (prop === "ref") {
5958
- if (!skipRef) {
6009
+ if (!skipRef)
5959
6010
  value(node);
5960
- }
5961
6011
  } else if (prop.slice(0, 3) === "on:") {
5962
6012
  const e2 = prop.slice(3);
5963
6013
  prev && node.removeEventListener(e2, prev);
@@ -6012,7 +6062,7 @@ var __objRest = (source, exclude) => {
6012
6062
  sharedConfig.done = true;
6013
6063
  document.querySelectorAll("[id^=pl-]").forEach((elem) => elem.remove());
6014
6064
  }
6015
- while (node !== null) {
6065
+ while (node) {
6016
6066
  const handler = node[key];
6017
6067
  if (handler && !node.disabled) {
6018
6068
  const data = node[`${key}Data`];
@@ -6020,17 +6070,8 @@ var __objRest = (source, exclude) => {
6020
6070
  if (e2.cancelBubble)
6021
6071
  return;
6022
6072
  }
6023
- node = node.host && node.host !== node && node.host instanceof Node ? node.host : node.parentNode;
6024
- }
6025
- }
6026
- function spreadExpression(node, props, prevProps = {}, isSVG, skipChildren) {
6027
- props || (props = {});
6028
- if (!skipChildren) {
6029
- createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
6073
+ node = node._$host || node.parentNode || node.host;
6030
6074
  }
6031
- createRenderEffect(() => props.ref && props.ref(node));
6032
- createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
6033
- return prevProps;
6034
6075
  }
6035
6076
  function insertExpression(parent, value, current, marker, unwrapArray) {
6036
6077
  if (sharedConfig.context && !current)
@@ -6145,7 +6186,7 @@ var __objRest = (source, exclude) => {
6145
6186
  }
6146
6187
  return dynamic;
6147
6188
  }
6148
- function appendNodes(parent, array, marker) {
6189
+ function appendNodes(parent, array, marker = null) {
6149
6190
  for (let i2 = 0, len = array.length; i2 < len; i2++)
6150
6191
  parent.insertBefore(array[i2], marker);
6151
6192
  }
@@ -6204,10 +6245,11 @@ var __objRest = (source, exclude) => {
6204
6245
  const container = createElement(props.isSVG ? "g" : "div", props.isSVG), renderRoot = useShadow && container.attachShadow ? container.attachShadow({
6205
6246
  mode: "open"
6206
6247
  }) : container;
6207
- Object.defineProperty(container, "host", {
6248
+ Object.defineProperty(container, "_$host", {
6208
6249
  get() {
6209
6250
  return marker.parentNode;
6210
- }
6251
+ },
6252
+ configurable: true
6211
6253
  });
6212
6254
  insert(renderRoot, renderPortal());
6213
6255
  mount.appendChild(container);
@@ -6510,9 +6552,9 @@ var __objRest = (source, exclude) => {
6510
6552
  for (let i2 = 0, l2 = keys.length; i2 < l2; i2++) {
6511
6553
  const prop = keys[i2];
6512
6554
  if (desc[prop].get) {
6513
- const get = desc[prop].get.bind(p2);
6514
6555
  Object.defineProperty(value, prop, {
6515
- get
6556
+ enumerable: desc[prop].enumerable,
6557
+ get: desc[prop].get.bind(p2)
6516
6558
  });
6517
6559
  }
6518
6560
  }
@@ -6568,7 +6610,7 @@ var __objRest = (source, exclude) => {
6568
6610
  function getDataNode(nodes, property, value) {
6569
6611
  return nodes[property] || (nodes[property] = createDataNode(value));
6570
6612
  }
6571
- function proxyDescriptor(target, property) {
6613
+ function proxyDescriptor$1(target, property) {
6572
6614
  const desc = Reflect.getOwnPropertyDescriptor(target, property);
6573
6615
  if (!desc || desc.get || !desc.configurable || property === $PROXY || property === $NODE || property === $NAME)
6574
6616
  return desc;
@@ -6620,8 +6662,7 @@ var __objRest = (source, exclude) => {
6620
6662
  has(target, property) {
6621
6663
  if (property === $RAW || property === $PROXY || property === $TRACK || property === $NODE || property === "__proto__")
6622
6664
  return true;
6623
- const tracked = getDataNodes(target)[property];
6624
- tracked && tracked();
6665
+ this.get(target, property, target);
6625
6666
  return property in target;
6626
6667
  },
6627
6668
  set() {
@@ -6631,16 +6672,15 @@ var __objRest = (source, exclude) => {
6631
6672
  return true;
6632
6673
  },
6633
6674
  ownKeys,
6634
- getOwnPropertyDescriptor: proxyDescriptor
6675
+ getOwnPropertyDescriptor: proxyDescriptor$1
6635
6676
  };
6636
6677
  function setProperty(state, property, value, deleting = false) {
6637
6678
  if (!deleting && state[property] === value)
6638
6679
  return;
6639
- const prev = state[property];
6640
- const len = state.length;
6641
- if (value === void 0) {
6680
+ const prev = state[property], len = state.length;
6681
+ if (value === void 0)
6642
6682
  delete state[property];
6643
- } else
6683
+ else
6644
6684
  state[property] = value;
6645
6685
  let nodes = getDataNodes(state), node;
6646
6686
  if (node = getDataNode(nodes, property, prev))
@@ -6736,59 +6776,235 @@ var __objRest = (source, exclude) => {
6736
6776
  THEME2["LIGHT"] = "LIGHT";
6737
6777
  return THEME2;
6738
6778
  })(THEME || {});
6739
- function hexToRgb(hex) {
6740
- if (hex[0] === "#") {
6741
- hex = hex.slice(1);
6742
- }
6743
- const bigint = parseInt(hex, 16);
6744
- const r = bigint >> 16 & 255;
6745
- const g = bigint >> 8 & 255;
6746
- const b = bigint & 255;
6747
- return [r, g, b].join(",");
6748
- }
6749
- const generateLightColors = (accentColor) => ({
6750
- primary: accentColor,
6751
- secondary: `rgba(${hexToRgb(accentColor)}, 0.16)`,
6752
- backgroundPrimary: "#FFFFFF",
6753
- backgroundSecondary: "#EFF1F3",
6754
- font: {
6755
- accent: accentColor,
6779
+ const defaultLightColorsSet = {
6780
+ constant: {
6781
+ black: "#000000",
6782
+ white: "#FFFFFF"
6783
+ },
6784
+ connectButton: {
6785
+ background: "#31A6F5",
6786
+ foreground: "#FFFFFF"
6787
+ },
6788
+ accent: "#31A6F5",
6789
+ icon: {
6756
6790
  primary: "#0F0F0F",
6757
6791
  secondary: "#7A8999",
6758
- third: "#7A8999"
6792
+ tertiary: "#C1CAD2",
6793
+ success: "#29CC6A"
6794
+ },
6795
+ background: {
6796
+ primary: "#FFFFFF",
6797
+ secondary: "#F1F3F5"
6798
+ },
6799
+ text: {
6800
+ primary: "#0F0F0F",
6801
+ secondary: "#7A8999",
6802
+ subhead: "#6A7785"
6759
6803
  }
6760
- });
6761
- const generateDarkColors = (accentColor) => ({
6762
- primary: accentColor,
6763
- secondary: accentColor,
6764
- backgroundPrimary: "#121214",
6765
- backgroundSecondary: "#18181A",
6766
- font: {
6767
- accent: "#E5E5EA",
6804
+ };
6805
+ const defaultDarkColorsSet = {
6806
+ constant: {
6807
+ black: "#000000",
6808
+ white: "#FFFFFF"
6809
+ },
6810
+ connectButton: {
6811
+ background: "#31A6F5",
6812
+ foreground: "#FFFFFF"
6813
+ },
6814
+ accent: "#E5E5EA",
6815
+ icon: {
6816
+ primary: "#E5E5EA",
6817
+ secondary: "#909099",
6818
+ tertiary: "#434347",
6819
+ success: "#29CC6A"
6820
+ },
6821
+ background: {
6822
+ primary: "#121214",
6823
+ secondary: "#18181A"
6824
+ },
6825
+ text: {
6768
6826
  primary: "#E5E5EA",
6769
6827
  secondary: "#7D7D85",
6770
- third: "#909099"
6828
+ subhead: "#8C8C93"
6771
6829
  }
6772
- });
6773
- const defaultLightColors = generateLightColors("#31A6F5");
6774
- const defaultDarkColors = generateDarkColors("#262629");
6830
+ };
6831
+ var isMergeableObject = function isMergeableObject2(value) {
6832
+ return isNonNullObject(value) && !isSpecial(value);
6833
+ };
6834
+ function isNonNullObject(value) {
6835
+ return !!value && typeof value === "object";
6836
+ }
6837
+ function isSpecial(value) {
6838
+ var stringValue = Object.prototype.toString.call(value);
6839
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
6840
+ }
6841
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
6842
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
6843
+ function isReactElement(value) {
6844
+ return value.$$typeof === REACT_ELEMENT_TYPE;
6845
+ }
6846
+ function emptyTarget(val) {
6847
+ return Array.isArray(val) ? [] : {};
6848
+ }
6849
+ function cloneUnlessOtherwiseSpecified(value, options) {
6850
+ return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
6851
+ }
6852
+ function defaultArrayMerge(target, source, options) {
6853
+ return target.concat(source).map(function(element) {
6854
+ return cloneUnlessOtherwiseSpecified(element, options);
6855
+ });
6856
+ }
6857
+ function getMergeFunction(key, options) {
6858
+ if (!options.customMerge) {
6859
+ return deepmerge;
6860
+ }
6861
+ var customMerge = options.customMerge(key);
6862
+ return typeof customMerge === "function" ? customMerge : deepmerge;
6863
+ }
6864
+ function getEnumerableOwnPropertySymbols(target) {
6865
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
6866
+ return target.propertyIsEnumerable(symbol);
6867
+ }) : [];
6868
+ }
6869
+ function getKeys(target) {
6870
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
6871
+ }
6872
+ function propertyIsOnObject(object, property) {
6873
+ try {
6874
+ return property in object;
6875
+ } catch (_) {
6876
+ return false;
6877
+ }
6878
+ }
6879
+ function propertyIsUnsafe(target, key) {
6880
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
6881
+ }
6882
+ function mergeObject(target, source, options) {
6883
+ var destination = {};
6884
+ if (options.isMergeableObject(target)) {
6885
+ getKeys(target).forEach(function(key) {
6886
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
6887
+ });
6888
+ }
6889
+ getKeys(source).forEach(function(key) {
6890
+ if (propertyIsUnsafe(target, key)) {
6891
+ return;
6892
+ }
6893
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
6894
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
6895
+ } else {
6896
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
6897
+ }
6898
+ });
6899
+ return destination;
6900
+ }
6901
+ function deepmerge(target, source, options) {
6902
+ options = options || {};
6903
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
6904
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
6905
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
6906
+ var sourceIsArray = Array.isArray(source);
6907
+ var targetIsArray = Array.isArray(target);
6908
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
6909
+ if (!sourceAndTargetTypesMatch) {
6910
+ return cloneUnlessOtherwiseSpecified(source, options);
6911
+ } else if (sourceIsArray) {
6912
+ return options.arrayMerge(target, source, options);
6913
+ } else {
6914
+ return mergeObject(target, source, options);
6915
+ }
6916
+ }
6917
+ deepmerge.all = function deepmergeAll(array, options) {
6918
+ if (!Array.isArray(array)) {
6919
+ throw new Error("first argument should be an array");
6920
+ }
6921
+ return array.reduce(function(prev, next) {
6922
+ return deepmerge(prev, next, options);
6923
+ }, {});
6924
+ };
6925
+ var deepmerge_1 = deepmerge;
6926
+ var cjs = deepmerge_1;
6927
+ /*!
6928
+ * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
6929
+ *
6930
+ * Copyright (c) 2014-2017, Jon Schlinkert.
6931
+ * Released under the MIT License.
6932
+ */
6933
+ function isObject(o2) {
6934
+ return Object.prototype.toString.call(o2) === "[object Object]";
6935
+ }
6936
+ function isPlainObject(o2) {
6937
+ var ctor, prot;
6938
+ if (isObject(o2) === false)
6939
+ return false;
6940
+ ctor = o2.constructor;
6941
+ if (ctor === void 0)
6942
+ return true;
6943
+ prot = ctor.prototype;
6944
+ if (isObject(prot) === false)
6945
+ return false;
6946
+ if (prot.hasOwnProperty("isPrototypeOf") === false) {
6947
+ return false;
6948
+ }
6949
+ return true;
6950
+ }
6951
+ function mergeOptions(options, defaultOptions) {
6952
+ if (!options) {
6953
+ return defaultOptions;
6954
+ }
6955
+ const overwriteMerge = (_, sourceArray, __) => sourceArray;
6956
+ return cjs(defaultOptions, options, {
6957
+ arrayMerge: overwriteMerge,
6958
+ isMergeableObject: isPlainObject
6959
+ });
6960
+ }
6775
6961
  const [themeState, setThemeState] = createStore({
6776
6962
  theme: THEME.LIGHT,
6777
- accentColor: defaultLightColors.primary,
6778
- colors: defaultLightColors
6963
+ colors: defaultLightColorsSet,
6964
+ borderRadius: "m"
6779
6965
  });
6780
- function setTheme(theme) {
6781
- if (theme === THEME.LIGHT) {
6782
- setThemeState({
6783
- theme,
6784
- colors: defaultLightColors
6785
- });
6786
- } else {
6787
- setThemeState({
6788
- theme,
6789
- colors: defaultDarkColors
6790
- });
6966
+ const themeColorsMappingDefault = {
6967
+ [THEME.LIGHT]: defaultLightColorsSet,
6968
+ [THEME.DARK]: defaultDarkColorsSet
6969
+ };
6970
+ const themeCustomColors = {
6971
+ [THEME.LIGHT]: void 0,
6972
+ [THEME.DARK]: void 0
6973
+ };
6974
+ function setTheme(theme, colorsSet) {
6975
+ if (colorsSet) {
6976
+ themeCustomColors[THEME.DARK] = mergeOptions(
6977
+ colorsSet[THEME.DARK],
6978
+ themeCustomColors[THEME.DARK]
6979
+ );
6980
+ themeCustomColors[THEME.LIGHT] = mergeOptions(
6981
+ colorsSet[THEME.LIGHT],
6982
+ themeCustomColors[THEME.LIGHT]
6983
+ );
6791
6984
  }
6985
+ setThemeState({
6986
+ theme,
6987
+ colors: mergeOptions(themeCustomColors[theme], themeColorsMappingDefault[theme])
6988
+ });
6989
+ }
6990
+ function setBorderRadius(borderRadius) {
6991
+ setThemeState({ borderRadius });
6992
+ }
6993
+ function setColors(colorsSet) {
6994
+ themeCustomColors[THEME.DARK] = mergeOptions(
6995
+ colorsSet[THEME.DARK],
6996
+ themeCustomColors[THEME.DARK]
6997
+ );
6998
+ themeCustomColors[THEME.LIGHT] = mergeOptions(
6999
+ colorsSet[THEME.LIGHT],
7000
+ themeCustomColors[THEME.LIGHT]
7001
+ );
7002
+ setThemeState((state) => ({
7003
+ colors: mergeOptions(
7004
+ themeCustomColors[state.theme],
7005
+ themeColorsMappingDefault[state.theme]
7006
+ )
7007
+ }));
6792
7008
  }
6793
7009
  const GlobalStyles = () => {
6794
7010
  document.body.addEventListener("mousedown", () => document.body.classList.add("using-mouse"));
@@ -6826,22 +7042,41 @@ var __objRest = (source, exclude) => {
6826
7042
  `;
6827
7043
  return createComponent(Styles, {});
6828
7044
  };
7045
+ function hexToRgb(hex) {
7046
+ if (hex[0] === "#") {
7047
+ hex = hex.slice(1);
7048
+ }
7049
+ const bigint = parseInt(hex, 16);
7050
+ const r = bigint >> 16 & 255;
7051
+ const g = bigint >> 8 & 255;
7052
+ const b = bigint & 255;
7053
+ return [r, g, b].join(",");
7054
+ }
7055
+ function rgba(color, opacity) {
7056
+ if (color[0] === "#") {
7057
+ color = hexToRgb(color);
7058
+ }
7059
+ return `rgba(${color}, ${opacity})`;
7060
+ }
7061
+ const borders$3 = {
7062
+ m: "16px",
7063
+ s: "8px",
7064
+ none: "0"
7065
+ };
6829
7066
  const ButtonStyled$2 = styled.button`
6830
- background-color: ${(props) => props.appearance === "flat" ? props.theme.colors.backgroundPrimary : props.theme.colors[props.appearance]};
6831
- color: ${(props) => props.appearance === "primary" ? "white" : props.appearance === "flat" ? props.theme.colors.font.primary : props.theme.colors.font.accent};
7067
+ background-color: ${(props) => rgba(props.theme.colors.accent, 0.12)};
7068
+ color: ${(props) => props.theme.colors.accent};
6832
7069
 
6833
- box-shadow: ${(props) => props.appearance === "flat" ? "0 4px 24px rgba(0, 0, 0, 0.16);" : "unset;"}
6834
-
6835
7070
  padding: 9px 16px;
6836
7071
  border: none;
6837
- border-radius: 16px;
7072
+ border-radius: ${(props) => borders$3[props.theme.borderRadius]};
6838
7073
  cursor: pointer;
6839
7074
 
6840
7075
  font-size: 14px;
6841
7076
  font-weight: 590;
6842
7077
  line-height: 18px;
6843
7078
  letter-spacing: -0.154px;
6844
-
7079
+
6845
7080
  transition: transform 0.1s ease-in-out;
6846
7081
 
6847
7082
  &:hover {
@@ -6853,13 +7088,12 @@ var __objRest = (source, exclude) => {
6853
7088
  }
6854
7089
  `;
6855
7090
  const Button = (props) => {
6856
- const appearance = () => props.appearance || "primary";
6857
7091
  return createComponent(ButtonStyled$2, {
6858
7092
  get ["class"]() {
6859
7093
  return props.class;
6860
7094
  },
6861
- get appearance() {
6862
- return appearance();
7095
+ get id() {
7096
+ return props.id;
6863
7097
  },
6864
7098
  onClick: () => props.onClick(),
6865
7099
  ref(r$) {
@@ -7267,7 +7501,7 @@ var __objRest = (source, exclude) => {
7267
7501
  };
7268
7502
  const ArrowIcon = (props) => {
7269
7503
  const theme = useTheme();
7270
- const fill = () => props.fill || theme.colors.font.third;
7504
+ const fill = () => props.fill || theme.colors.icon.secondary;
7271
7505
  const direction = () => props.direction || "left";
7272
7506
  const Svg = styled("svg")`
7273
7507
  transform: rotate(${(props2) => rotationDegrees[props2.svgDirection]}deg);
@@ -7292,7 +7526,7 @@ var __objRest = (source, exclude) => {
7292
7526
  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>`);
7293
7527
  const CloseIcon = (props) => {
7294
7528
  const theme = useTheme();
7295
- const fill = () => props.fill || theme.colors.font.third;
7529
+ const fill = () => props.fill || theme.colors.icon.secondary;
7296
7530
  return (() => {
7297
7531
  const _el$ = _tmpl$$e.cloneNode(true), _el$2 = _el$.firstChild;
7298
7532
  createRenderEffect(() => setAttribute(_el$2, "stroke", fill()));
@@ -7307,7 +7541,7 @@ var __objRest = (source, exclude) => {
7307
7541
  width: 32px;
7308
7542
  height: 32px;
7309
7543
  border-radius: 50%;
7310
- background-color: ${(props) => props.theme.colors.backgroundSecondary};
7544
+ background-color: ${(props) => props.theme.colors.background.secondary};
7311
7545
  border: none;
7312
7546
  cursor: pointer;
7313
7547
 
@@ -7392,14 +7626,12 @@ var __objRest = (source, exclude) => {
7392
7626
  const ModalWrapperClass = u`
7393
7627
  position: relative;
7394
7628
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 16px 64px rgba(0, 0, 0, 0.16);
7395
- border-radius: 24px;
7396
7629
  min-height: 100px;
7397
7630
  width: 440px;
7398
7631
  padding: 44px 56px 24px;
7399
7632
 
7400
7633
  ${media("mobile")} {
7401
7634
  width: 100%;
7402
- border-radius: 24px 24px 0 0;
7403
7635
  }
7404
7636
  `;
7405
7637
  const CloseButtonStyled = styled(IconButton)`
@@ -7410,6 +7642,11 @@ var __objRest = (source, exclude) => {
7410
7642
  const _tmpl$$d = /* @__PURE__ */ template$1(`<div></div>`);
7411
7643
  const clickOutside = clickOutside$1;
7412
7644
  const keyPressed = escPressed;
7645
+ const borders$2 = {
7646
+ m: "24px",
7647
+ s: "16px",
7648
+ none: "0"
7649
+ };
7413
7650
  const Modal = (props) => {
7414
7651
  const theme = useTheme();
7415
7652
  return createComponent(Transition, {
@@ -7470,9 +7707,23 @@ var __objRest = (source, exclude) => {
7470
7707
  onClick: () => props.onClose()
7471
7708
  }), null);
7472
7709
  insert(_el$, () => props.children, null);
7473
- createRenderEffect(() => className(_el$, cn(ModalWrapperClass, props.class, u`
7474
- background-color: ${theme.colors.backgroundPrimary};
7475
- `)));
7710
+ createRenderEffect((_p$) => {
7711
+ const _v$ = props.id, _v$2 = cn(ModalWrapperClass, props.class, u`
7712
+ background-color: ${theme.colors.background.primary};
7713
+ border-radius: ${borders$2[theme.borderRadius]};
7714
+
7715
+ ${media("mobile")} {
7716
+ border-radius: ${borders$2[theme.borderRadius]}
7717
+ ${borders$2[theme.borderRadius]} 0 0;
7718
+ }
7719
+ `);
7720
+ _v$ !== _p$._v$ && setAttribute(_el$, "id", _p$._v$ = _v$);
7721
+ _v$2 !== _p$._v$2 && className(_el$, _p$._v$2 = _v$2);
7722
+ return _p$;
7723
+ }, {
7724
+ _v$: void 0,
7725
+ _v$2: void 0
7726
+ });
7476
7727
  return _el$;
7477
7728
  }
7478
7729
  });
@@ -7517,7 +7768,7 @@ var __objRest = (source, exclude) => {
7517
7768
  text-align: center;
7518
7769
  letter-spacing: 0.072px;
7519
7770
 
7520
- color: ${(props) => props.theme.colors.font.primary};
7771
+ color: ${(props) => props.theme.colors.text.primary};
7521
7772
 
7522
7773
  margin-top: 0;
7523
7774
  margin-bottom: 6px;
@@ -7530,7 +7781,7 @@ var __objRest = (source, exclude) => {
7530
7781
  },
7531
7782
  get children() {
7532
7783
  var _a;
7533
- return memo(() => !!props.translationKey, true)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7784
+ return createMemo(() => !!props.translationKey)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7534
7785
  }
7535
7786
  });
7536
7787
  };
@@ -7543,7 +7794,7 @@ var __objRest = (source, exclude) => {
7543
7794
  text-align: center;
7544
7795
  letter-spacing: -0.32px;
7545
7796
 
7546
- color: ${(props) => props.theme.colors.font.secondary};
7797
+ color: ${(props) => props.theme.colors.text.secondary};
7547
7798
 
7548
7799
  margin-top: 0;
7549
7800
  margin-bottom: 32px;
@@ -7556,7 +7807,7 @@ var __objRest = (source, exclude) => {
7556
7807
  },
7557
7808
  get children() {
7558
7809
  var _a;
7559
- return memo(() => !!props.translationKey, true)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7810
+ return createMemo(() => !!props.translationKey)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7560
7811
  }
7561
7812
  });
7562
7813
  };
@@ -7568,17 +7819,17 @@ var __objRest = (source, exclude) => {
7568
7819
 
7569
7820
  letter-spacing: -0.24px;
7570
7821
 
7571
- color: ${(props) => props.theme.colors.font.primary};
7822
+ color: ${(props) => props.theme.colors.text.primary};
7572
7823
 
7573
7824
  margin-top: 0;
7574
- margin-bottom: 0px;
7825
+ margin-bottom: 0;
7575
7826
  `;
7576
7827
  const H3 = (props) => {
7577
7828
  const [t2] = useI18n();
7578
7829
  return createComponent(H3Styled, {
7579
7830
  get children() {
7580
7831
  var _a;
7581
- return memo(() => !!props.translationKey, true)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7832
+ return createMemo(() => !!props.translationKey)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7582
7833
  }
7583
7834
  });
7584
7835
  };
@@ -7594,7 +7845,7 @@ var __objRest = (source, exclude) => {
7594
7845
  const Text = (inputs) => {
7595
7846
  const theme = useTheme();
7596
7847
  const [t2] = useI18n();
7597
- const color = () => inputs.color || theme.colors.font.primary;
7848
+ const color = () => inputs.color || theme.colors.text.primary;
7598
7849
  const props = mergeProps({
7599
7850
  fontSize: "14px",
7600
7851
  fontWeight: "510",
@@ -7622,14 +7873,14 @@ var __objRest = (source, exclude) => {
7622
7873
  },
7623
7874
  get children() {
7624
7875
  var _a;
7625
- return memo(() => !!props.translationKey, true)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7876
+ return createMemo(() => !!props.translationKey)() ? t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString()) : props.children;
7626
7877
  }
7627
7878
  });
7628
7879
  };
7629
7880
  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>`);
7630
7881
  const TonIcon = (props) => {
7631
7882
  const theme = useTheme();
7632
- const fill = () => props.fill || theme.colors.font.primary;
7883
+ const fill = () => props.fill || theme.colors.icon.primary;
7633
7884
  return (() => {
7634
7885
  const _el$ = _tmpl$$c.cloneNode(true), _el$2 = _el$.firstChild;
7635
7886
  createRenderEffect(() => setAttribute(_el$2, "fill", fill()));
@@ -7638,7 +7889,8 @@ var __objRest = (source, exclude) => {
7638
7889
  };
7639
7890
  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>`);
7640
7891
  const SuccessIcon = (props) => {
7641
- const fill = () => props.fill || "#29CC6A";
7892
+ const theme = useTheme();
7893
+ const fill = () => props.fill || theme.colors.icon.success;
7642
7894
  return (() => {
7643
7895
  const _el$ = _tmpl$$b.cloneNode(true), _el$2 = _el$.firstChild;
7644
7896
  createRenderEffect((_p$) => {
@@ -7656,7 +7908,7 @@ var __objRest = (source, exclude) => {
7656
7908
  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>`);
7657
7909
  const ErrorIcon = (props) => {
7658
7910
  const theme = useTheme();
7659
- const fill = () => props.fill || theme.colors.font.third;
7911
+ const fill = () => props.fill || theme.colors.icon.secondary;
7660
7912
  return (() => {
7661
7913
  const _el$ = _tmpl$$a.cloneNode(true), _el$2 = _el$.firstChild;
7662
7914
  createRenderEffect((_p$) => {
@@ -7674,7 +7926,7 @@ var __objRest = (source, exclude) => {
7674
7926
  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>`);
7675
7927
  const LoaderIcon = (props) => {
7676
7928
  const theme = useTheme();
7677
- const fill = () => props.fill || theme.colors.font.third;
7929
+ const fill = () => props.fill || theme.colors.icon.tertiary;
7678
7930
  const rotateAnimation = h`
7679
7931
  0% {
7680
7932
  transform: rotate(0deg);
@@ -7704,7 +7956,7 @@ var __objRest = (source, exclude) => {
7704
7956
  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>`);
7705
7957
  const CopyIcon = (props) => {
7706
7958
  const theme = useTheme();
7707
- const fill = () => props.fill || theme.colors.font.primary;
7959
+ const fill = () => props.fill || theme.colors.icon.primary;
7708
7960
  return (() => {
7709
7961
  const _el$ = _tmpl$$8.cloneNode(true), _el$2 = _el$.firstChild;
7710
7962
  createRenderEffect(() => setAttribute(_el$2, "fill", fill()));
@@ -7714,7 +7966,7 @@ var __objRest = (source, exclude) => {
7714
7966
  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>`);
7715
7967
  const DisconnectIcon = (props) => {
7716
7968
  const theme = useTheme();
7717
- const fill = () => props.fill || theme.colors.font.primary;
7969
+ const fill = () => props.fill || theme.colors.icon.primary;
7718
7970
  return (() => {
7719
7971
  const _el$ = _tmpl$$7.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
7720
7972
  createRenderEffect((_p$) => {
@@ -7751,17 +8003,27 @@ var __objRest = (source, exclude) => {
7751
8003
  document.body.removeChild(textArea);
7752
8004
  }
7753
8005
  }
8006
+ const hoverBorders = {
8007
+ m: "8px",
8008
+ s: "4px",
8009
+ none: "0"
8010
+ };
8011
+ const dropdownBorders = {
8012
+ m: "16px",
8013
+ s: "8px",
8014
+ none: "0"
8015
+ };
7754
8016
  const AccountButtonDropdownStyled = styled.div`
7755
8017
  width: 256px;
7756
8018
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
7757
- border-radius: 16px;
8019
+ border-radius: ${(props) => dropdownBorders[props.theme.borderRadius]};
7758
8020
 
7759
- background-color: ${(props) => props.theme.colors.backgroundPrimary}
8021
+ background-color: ${(props) => props.theme.colors.background.primary}
7760
8022
 
7761
- color: ${(props) => props.theme.colors.font.primary}
8023
+ color: ${(props) => props.theme.colors.text.primary}
7762
8024
  `;
7763
8025
  const UlStyled$1 = styled.ul`
7764
- background-color: ${(props) => props.theme.colors.backgroundPrimary};
8026
+ background-color: ${(props) => props.theme.colors.background.primary};
7765
8027
  padding: 8px;
7766
8028
  `;
7767
8029
  const MenuButtonStyled = styled.button`
@@ -7771,15 +8033,15 @@ var __objRest = (source, exclude) => {
7771
8033
  padding: 12px;
7772
8034
  width: 100%;
7773
8035
 
7774
- background-color: ${(props) => props.theme.colors.backgroundPrimary};
8036
+ background-color: ${(props) => props.theme.colors.background.primary};
7775
8037
  border: none;
7776
- border-radius: 8px;
8038
+ border-radius: ${(props) => hoverBorders[props.theme.borderRadius]};
7777
8039
  cursor: pointer;
7778
8040
 
7779
8041
  transition: background-color, transform 0.1s ease-in-out;
7780
8042
 
7781
8043
  &:hover {
7782
- background-color: ${(props) => props.theme.colors.backgroundSecondary};
8044
+ background-color: ${(props) => props.theme.colors.background.secondary};
7783
8045
  }
7784
8046
 
7785
8047
  &:active {
@@ -7820,6 +8082,9 @@ var __objRest = (source, exclude) => {
7820
8082
  get ["class"]() {
7821
8083
  return props.class;
7822
8084
  },
8085
+ get id() {
8086
+ return props.id;
8087
+ },
7823
8088
  get children() {
7824
8089
  return createComponent(UlStyled$1, {
7825
8090
  get children() {
@@ -7870,19 +8135,24 @@ var __objRest = (source, exclude) => {
7870
8135
  }
7871
8136
  });
7872
8137
  };
8138
+ const borders$1 = {
8139
+ m: "16px",
8140
+ s: "8px",
8141
+ none: "0"
8142
+ };
7873
8143
  const NotificationStyled = styled.div`
7874
8144
  width: 256px;
7875
8145
  padding: 12px 16px;
7876
8146
  display: flex;
7877
8147
  gap: 9px;
7878
8148
 
7879
- background-color: ${(props) => props.theme.colors.backgroundPrimary};
8149
+ background-color: ${(props) => props.theme.colors.background.primary};
7880
8150
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
7881
- border-radius: 16px;
8151
+ border-radius: ${(props) => borders$1[props.theme.borderRadius]};
7882
8152
  `;
7883
8153
  const TextStyled$2 = styled(Text)`
7884
8154
  margin-top: 4px;
7885
- color: ${(props) => props.theme.colors.font.secondary};
8155
+ color: ${(props) => props.theme.colors.text.secondary};
7886
8156
  `;
7887
8157
  const _tmpl$$5 = /* @__PURE__ */ template$1(`<div></div>`);
7888
8158
  const Notification = (props) => {
@@ -7920,7 +8190,7 @@ var __objRest = (source, exclude) => {
7920
8190
  }
7921
8191
  }), null);
7922
8192
  return _el$;
7923
- })(), memo(() => props.icon)];
8193
+ })(), createMemo(() => props.icon)];
7924
8194
  }
7925
8195
  });
7926
8196
  };
@@ -7980,7 +8250,7 @@ var __objRest = (source, exclude) => {
7980
8250
  return createComponent(SuccessIconStyled$1, {});
7981
8251
  },
7982
8252
  get ["class"]() {
7983
- return props.class;
8253
+ return cn(props.class, "tc-notification");
7984
8254
  },
7985
8255
  children: "Transaction sent"
7986
8256
  });
@@ -8071,24 +8341,39 @@ var __objRest = (source, exclude) => {
8071
8341
  });
8072
8342
  }
8073
8343
  }));
8074
- createRenderEffect(() => className(_el$, props.class));
8344
+ createRenderEffect((_p$) => {
8345
+ const _v$ = props.class, _v$2 = props.id;
8346
+ _v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
8347
+ _v$2 !== _p$._v$2 && setAttribute(_el$, "id", _p$._v$2 = _v$2);
8348
+ return _p$;
8349
+ }, {
8350
+ _v$: void 0,
8351
+ _v$2: void 0
8352
+ });
8075
8353
  return _el$;
8076
8354
  })();
8077
8355
  };
8078
8356
  const AccountButtonStyled = styled(Button)`
8357
+ background-color: ${(props) => props.theme.colors.connectButton.background};
8358
+ color: ${(props) => props.theme.colors.connectButton.foreground};
8359
+ box-shadow: ${(props) => `0 4px 24px ${rgba(props.theme.colors.constant.black, 0.16)}`};
8360
+
8079
8361
  display: flex;
8080
8362
  align-items: center;
8081
8363
  gap: 9px;
8082
8364
 
8083
- transition: background-color 0.1s ease-in-out;
8365
+ transition: all 0.1s ease-in-out;
8084
8366
 
8085
8367
  &:hover:not(:active) {
8086
8368
  transform: scale(1);
8087
8369
  }
8088
8370
 
8089
8371
  &:hover {
8090
- background-color: ${(props) => props.theme.colors.backgroundSecondary};
8372
+ filter: ${(props) => `brightness(${props.theme.theme === THEME.DARK ? 1.07 : 0.95})`};
8091
8373
  }
8374
+ `;
8375
+ const DropdownButtonStyled = styled(AccountButtonStyled)`
8376
+ background-color: ${(props) => props.theme.colors.background.primary};
8092
8377
  `;
8093
8378
  const DropdownContainerStyled = styled.div`
8094
8379
  display: flex;
@@ -8180,7 +8465,7 @@ var __objRest = (source, exclude) => {
8180
8465
  } = config;
8181
8466
  const validMiddleware = middleware.filter(Boolean);
8182
8467
  const rtl = yield platform2.isRTL == null ? void 0 : platform2.isRTL(floating);
8183
- if (process.env.NODE_ENV !== "production") {
8468
+ if ({}.NODE_ENV !== "production") {
8184
8469
  if (platform2 == null) {
8185
8470
  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(" "));
8186
8471
  }
@@ -8237,7 +8522,7 @@ var __objRest = (source, exclude) => {
8237
8522
  middlewareData = __spreadProps(__spreadValues({}, middlewareData), {
8238
8523
  [name]: __spreadValues(__spreadValues({}, middlewareData[name]), data)
8239
8524
  });
8240
- if (process.env.NODE_ENV !== "production") {
8525
+ if ({}.NODE_ENV !== "production") {
8241
8526
  if (resetCount > 50) {
8242
8527
  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(" "));
8243
8528
  }
@@ -8849,8 +9134,9 @@ var __objRest = (source, exclude) => {
8849
9134
  return n2().middlewareData;
8850
9135
  }, update: i2 };
8851
9136
  }
8852
- const _tmpl$$3 = /* @__PURE__ */ template$1(`<div></div>`);
9137
+ const _tmpl$$3 = /* @__PURE__ */ template$1(`<div id="tc-dropdown-container"></div>`);
8853
9138
  const AccountButton = () => {
9139
+ const theme = useTheme();
8854
9140
  const connector = useContext(ConnectorContext);
8855
9141
  const tonConnectUI2 = useContext(TonConnectUiContext);
8856
9142
  const [isOpened, setIsOpened] = createSignal(false);
@@ -8900,14 +9186,21 @@ var __objRest = (source, exclude) => {
8900
9186
  },
8901
9187
  get children() {
8902
9188
  return createComponent(AccountButtonStyled, {
8903
- appearance: "flat",
8904
9189
  onClick: () => tonConnectUI2.connectWallet(),
9190
+ id: "tc-connect-button",
8905
9191
  get children() {
8906
- return [createComponent(TonIcon, {}), createComponent(Text, {
9192
+ return [createComponent(TonIcon, {
9193
+ get fill() {
9194
+ return theme.colors.connectButton.foreground;
9195
+ }
9196
+ }), createComponent(Text, {
8907
9197
  translationKey: "button.connectWallet",
8908
9198
  fontSize: "15px",
8909
9199
  letterSpacing: "-0.24px",
8910
9200
  fontWeight: "590",
9201
+ get color() {
9202
+ return theme.colors.connectButton.foreground;
9203
+ },
8911
9204
  children: "Connect wallet"
8912
9205
  })];
8913
9206
  }
@@ -8920,10 +9213,10 @@ var __objRest = (source, exclude) => {
8920
9213
  get children() {
8921
9214
  return createComponent(DropdownContainerStyled, {
8922
9215
  get children() {
8923
- return [createComponent(AccountButtonStyled, {
8924
- appearance: "flat",
9216
+ return [createComponent(DropdownButtonStyled, {
8925
9217
  onClick: () => setIsOpened((v) => !v),
8926
9218
  ref: setAnchor,
9219
+ id: "tc-dropdown-button",
8927
9220
  get children() {
8928
9221
  return [createComponent(Text, {
8929
9222
  fontSize: "15px",
@@ -8979,13 +9272,16 @@ var __objRest = (source, exclude) => {
8979
9272
  ref(r$) {
8980
9273
  const _ref$ = dropDownRef;
8981
9274
  typeof _ref$ === "function" ? _ref$(r$) : dropDownRef = r$;
8982
- }
9275
+ },
9276
+ id: "tc-dropdown"
8983
9277
  });
8984
9278
  }
8985
9279
  });
8986
9280
  }
8987
9281
  }), null);
8988
- insert(_el$, createComponent(NotificationsStyled, {}), null);
9282
+ insert(_el$, createComponent(NotificationsStyled, {
9283
+ id: "tc-notifications"
9284
+ }), null);
8989
9285
  createRenderEffect((_p$) => {
8990
9286
  var _a, _b;
8991
9287
  const _v$ = position.strategy, _v$2 = `${(_a = position.y) != null ? _a : 0}px`, _v$3 = `${(_b = position.x) != null ? _b : 0}px`;
@@ -9023,14 +9319,14 @@ var __objRest = (source, exclude) => {
9023
9319
  }
9024
9320
 
9025
9321
  path {
9026
- fill: ${(props) => props.theme.colors.font.primary};
9322
+ fill: ${(props) => props.theme.colors.text.primary};
9027
9323
  }
9028
9324
  `;
9029
9325
  const ImageBackground = styled.div`
9030
9326
  position: absolute;
9031
9327
  width: 52px;
9032
9328
  height: 52px;
9033
- background: ${(props) => props.theme.colors.backgroundSecondary};
9329
+ background: ${(props) => props.theme.colors.background.secondary};
9034
9330
  padding: 7px;
9035
9331
  top: 112px;
9036
9332
  left: 112px;
@@ -10723,6 +11019,11 @@ var __objRest = (source, exclude) => {
10723
11019
  const [t2] = useI18n();
10724
11020
  return t2(props.translationKey, props.translationValues, (_a = props.children) == null ? void 0 : _a.toString());
10725
11021
  };
11022
+ const borders = {
11023
+ m: "16px",
11024
+ s: "8px",
11025
+ none: "0"
11026
+ };
10726
11027
  const QrCodeModalStyled = styled.div`
10727
11028
  padding: 0 24px;
10728
11029
  `;
@@ -10733,8 +11034,8 @@ var __objRest = (source, exclude) => {
10733
11034
  `;
10734
11035
  const QRBackgroundStyled = styled.div`
10735
11036
  margin-bottom: 16px;
10736
- background-color: ${(props) => props.theme.colors.backgroundSecondary};
10737
- border-radius: 16px;
11037
+ background-color: ${(props) => props.theme.colors.background.secondary};
11038
+ border-radius: ${(props) => borders[props.theme.borderRadius]};
10738
11039
  display: flex;
10739
11040
  align-items: center;
10740
11041
  justify-content: center;
@@ -10751,6 +11052,7 @@ var __objRest = (source, exclude) => {
10751
11052
  line-height: 20px;
10752
11053
  letter-spacing: -0.32px;
10753
11054
  width: 100%;
11055
+ border-radius: ${(props) => borders[props.theme.borderRadius]};
10754
11056
  `;
10755
11057
  const GetWalletStyled = styled.div`
10756
11058
  display: flex;
@@ -10758,7 +11060,7 @@ var __objRest = (source, exclude) => {
10758
11060
  align-items: center;
10759
11061
  `;
10760
11062
  const TextStyled$1 = styled(Text)`
10761
- color: ${(props) => props.theme.colors.font.secondary};
11063
+ color: ${(props) => props.theme.colors.text.secondary};
10762
11064
  font-size: 16px;
10763
11065
  `;
10764
11066
  function openLink(href, target = "_self") {
@@ -10785,6 +11087,9 @@ var __objRest = (source, exclude) => {
10785
11087
  bridgeUrl: props.wallet.bridgeUrl
10786
11088
  });
10787
11089
  return createComponent(QrCodeModalStyled, {
11090
+ get id() {
11091
+ return props.id;
11092
+ },
10788
11093
  get children() {
10789
11094
  return [createComponent(StyledIconButton, {
10790
11095
  icon: "arrow",
@@ -10797,7 +11102,7 @@ var __objRest = (source, exclude) => {
10797
11102
  };
10798
11103
  },
10799
11104
  get children() {
10800
- return ["Connect with ", memo(() => props.wallet.name)];
11105
+ return ["Connect with ", createMemo(() => props.wallet.name)];
10801
11106
  }
10802
11107
  }), createComponent(H2, {
10803
11108
  translationKey: "walletModal.qrCodeModal.scan",
@@ -10807,7 +11112,7 @@ var __objRest = (source, exclude) => {
10807
11112
  };
10808
11113
  },
10809
11114
  get children() {
10810
- return ["Scan QR code with your phone’s or ", memo(() => props.wallet.name), "’s camera."];
11115
+ return ["Scan QR code with your phone’s or ", createMemo(() => props.wallet.name), "’s camera."];
10811
11116
  }
10812
11117
  }), createComponent(QRBackgroundStyled, {
10813
11118
  get children() {
@@ -10821,7 +11126,6 @@ var __objRest = (source, exclude) => {
10821
11126
  }), createComponent(ButtonsContainerStyled, {
10822
11127
  get children() {
10823
11128
  return [createComponent(ActionButtonStyled, {
10824
- appearance: "secondary",
10825
11129
  onClick: () => openLink(universalLink),
10826
11130
  get children() {
10827
11131
  return createComponent(Translation, {
@@ -10832,7 +11136,7 @@ var __objRest = (source, exclude) => {
10832
11136
  };
10833
11137
  },
10834
11138
  get children() {
10835
- return ["Open ", memo(() => props.wallet.name)];
11139
+ return ["Open ", createMemo(() => props.wallet.name)];
10836
11140
  }
10837
11141
  });
10838
11142
  }
@@ -10842,7 +11146,6 @@ var __objRest = (source, exclude) => {
10842
11146
  },
10843
11147
  get children() {
10844
11148
  return createComponent(ActionButtonStyled, {
10845
- appearance: "secondary",
10846
11149
  onClick: () => connector.connect({
10847
11150
  jsBridgeKey: props.wallet.jsBridgeKey
10848
11151
  }),
@@ -10866,10 +11169,9 @@ var __objRest = (source, exclude) => {
10866
11169
  };
10867
11170
  },
10868
11171
  get children() {
10869
- return ["Don't have ", memo(() => props.wallet.name), "?"];
11172
+ return ["Don't have ", createMemo(() => props.wallet.name), "?"];
10870
11173
  }
10871
11174
  }), createComponent(Button, {
10872
- appearance: "secondary",
10873
11175
  onClick: () => openLinkBlank(props.wallet.aboutUrl),
10874
11176
  get children() {
10875
11177
  return createComponent(Translation, {
@@ -10987,6 +11289,9 @@ var __objRest = (source, exclude) => {
10987
11289
  const SelectWalletModal = (props) => {
10988
11290
  const learnMoreUrl = "https://ton.org/wallets";
10989
11291
  return createComponent(SelectWalletModalStyled, {
11292
+ get id() {
11293
+ return props.id;
11294
+ },
10990
11295
  get children() {
10991
11296
  return [createComponent(H1, {
10992
11297
  translationKey: "walletModal.selectWalletModal.connectWallet",
@@ -11016,7 +11321,6 @@ var __objRest = (source, exclude) => {
11016
11321
  });
11017
11322
  }
11018
11323
  }), createComponent(ButtonStyled$1, {
11019
- appearance: "secondary",
11020
11324
  onClick: () => openLinkBlank(learnMoreUrl),
11021
11325
  get children() {
11022
11326
  return createComponent(Translation, {
@@ -11028,12 +11332,6 @@ var __objRest = (source, exclude) => {
11028
11332
  }
11029
11333
  });
11030
11334
  };
11031
- const ModalWrapper = styled.div`
11032
- color: ${(props) => {
11033
- var _a;
11034
- return ((_a = props.theme) == null ? void 0 : _a.accentColor) || "blue";
11035
- }};
11036
- `;
11037
11335
  const StyledModal = styled(Modal)`
11038
11336
  padding-left: 0;
11039
11337
  padding-right: 0;
@@ -11067,21 +11365,8 @@ var __objRest = (source, exclude) => {
11067
11365
  const [appState, setAppState] = createStore({
11068
11366
  buttonRootId: null,
11069
11367
  language: "en",
11070
- buttonConfiguration: {},
11071
- widgetConfiguration: {}
11368
+ walletsList: {}
11072
11369
  });
11073
- class TonConnectUIError extends TonConnectError$1 {
11074
- constructor(...args) {
11075
- super(...args);
11076
- Object.setPrototypeOf(this, TonConnectUIError.prototype);
11077
- }
11078
- }
11079
- class WalletNotFoundError extends TonConnectUIError {
11080
- constructor(...args) {
11081
- super(...args);
11082
- Object.setPrototypeOf(this, WalletNotFoundError.prototype);
11083
- }
11084
- }
11085
11370
  function uiWalletToWalletInfo(uiWallet) {
11086
11371
  if ("jsBridgeKey" in uiWallet) {
11087
11372
  return __spreadProps(__spreadValues({}, uiWallet), {
@@ -11101,14 +11386,15 @@ var __objRest = (source, exclude) => {
11101
11386
  if (typeof wallet === "string") {
11102
11387
  const walletInfo = walletsList.find((item) => item.name === wallet);
11103
11388
  if (!walletInfo) {
11104
- throw new WalletNotFoundError(
11105
- `Wallet with name === '${wallet}' wasn't found in the wallets list. Check ${wallet} correctness.`
11389
+ console.error(
11390
+ `Wallet with name === '${wallet}' wasn't found in the wallets list. Check '${wallet}' correctness. Available wallets names: ${walletsList.map((i2) => "'" + i2.name + "'").join(", ")}`
11106
11391
  );
11392
+ return null;
11107
11393
  }
11108
11394
  return walletInfo;
11109
11395
  }
11110
11396
  return uiWalletToWalletInfo(wallet);
11111
- });
11397
+ }).filter((i2) => !!i2);
11112
11398
  }
11113
11399
  const filteredWalletsList = ((_a = configuration.excludeWallets) == null ? void 0 : _a.length) ? walletsList.filter(
11114
11400
  (wallet) => {
@@ -11137,7 +11423,7 @@ var __objRest = (source, exclude) => {
11137
11423
  if (fetchedWalletsList.state !== "ready") {
11138
11424
  return null;
11139
11425
  }
11140
- return applyWalletsListConfiguration(fetchedWalletsList(), appState.widgetConfiguration.wallets);
11426
+ return applyWalletsListConfiguration(fetchedWalletsList(), appState.walletsList);
11141
11427
  });
11142
11428
  const onClose = () => {
11143
11429
  setWalletsModalOpen(false);
@@ -11175,66 +11461,63 @@ var __objRest = (source, exclude) => {
11175
11461
  }
11176
11462
  });
11177
11463
  onCleanup(unsubscribe);
11178
- return createComponent(ModalWrapper, {
11464
+ return createComponent(StyledModal, {
11465
+ get opened() {
11466
+ return walletsModalOpen();
11467
+ },
11468
+ onClose,
11469
+ id: "tc-wallets-modal-container",
11179
11470
  get children() {
11180
- return createComponent(StyledModal, {
11181
- get opened() {
11182
- return walletsModalOpen();
11471
+ return [createComponent(Show, {
11472
+ get when() {
11473
+ return !walletsList();
11474
+ },
11475
+ get children() {
11476
+ return [createComponent(H1Styled$1, {
11477
+ translationKey: "walletModal.loading",
11478
+ children: "Wallets list is loading"
11479
+ }), createComponent(LoaderContainerStyled, {
11480
+ get children() {
11481
+ return createComponent(LoaderIconStyled$1, {});
11482
+ }
11483
+ })];
11484
+ }
11485
+ }), createComponent(Show, {
11486
+ get when() {
11487
+ return walletsList();
11183
11488
  },
11184
- onClose,
11185
11489
  get children() {
11186
11490
  return [createComponent(Show, {
11187
11491
  get when() {
11188
- return !walletsList();
11492
+ return !selectedWalletInfo();
11189
11493
  },
11494
+ keyed: false,
11190
11495
  get children() {
11191
- return [createComponent(H1Styled$1, {
11192
- translationKey: "walletModal.loading",
11193
- children: "Wallets list is loading"
11194
- }), createComponent(LoaderContainerStyled, {
11195
- get children() {
11196
- return createComponent(LoaderIconStyled$1, {
11197
- fill: "#7A899970"
11198
- });
11199
- }
11200
- })];
11496
+ return createComponent(SelectWalletModal, {
11497
+ get walletsList() {
11498
+ return walletsList();
11499
+ },
11500
+ onSelect,
11501
+ id: "tc-wallets-modal"
11502
+ });
11201
11503
  }
11202
11504
  }), createComponent(Show, {
11203
11505
  get when() {
11204
- return walletsList();
11506
+ return selectedWalletInfo();
11205
11507
  },
11508
+ keyed: false,
11206
11509
  get children() {
11207
- return [createComponent(Show, {
11208
- get when() {
11209
- return !selectedWalletInfo();
11210
- },
11211
- keyed: false,
11212
- get children() {
11213
- return createComponent(SelectWalletModal, {
11214
- get walletsList() {
11215
- return walletsList();
11216
- },
11217
- onSelect
11218
- });
11219
- }
11220
- }), createComponent(Show, {
11221
- get when() {
11510
+ return createComponent(QrCodeModal, {
11511
+ get wallet() {
11222
11512
  return selectedWalletInfo();
11223
11513
  },
11224
- keyed: false,
11225
- get children() {
11226
- return createComponent(QrCodeModal, {
11227
- get wallet() {
11228
- return selectedWalletInfo();
11229
- },
11230
- onBackClick: () => setSelectedWalletInfo(null)
11231
- });
11232
- }
11233
- })];
11514
+ onBackClick: () => setSelectedWalletInfo(null),
11515
+ id: "tc-qr-modal"
11516
+ });
11234
11517
  }
11235
11518
  })];
11236
11519
  }
11237
- });
11520
+ })];
11238
11521
  }
11239
11522
  });
11240
11523
  };
@@ -11255,15 +11538,18 @@ var __objRest = (source, exclude) => {
11255
11538
  text-align: center;
11256
11539
  max-width: 250px;
11257
11540
 
11258
- color: ${(props) => props.theme.colors.font.secondary};
11541
+ color: ${(props) => props.theme.colors.text.secondary};
11259
11542
  `;
11260
11543
  const ButtonStyled = styled(Button)`
11261
11544
  margin-top: 32px;
11262
11545
  `;
11263
11546
  const ActionModal = (props) => {
11264
11547
  return createComponent(ActionModalStyled, {
11548
+ get id() {
11549
+ return props.id;
11550
+ },
11265
11551
  get children() {
11266
- return [memo(() => props.icon), createComponent(H1Styled, {
11552
+ return [createMemo(() => props.icon), createComponent(H1Styled, {
11267
11553
  get translationKey() {
11268
11554
  return props.headerTranslationKey;
11269
11555
  }
@@ -11277,7 +11563,6 @@ var __objRest = (source, exclude) => {
11277
11563
  },
11278
11564
  get children() {
11279
11565
  return createComponent(ButtonStyled, {
11280
- appearance: "secondary",
11281
11566
  onClick: () => props.onClose(),
11282
11567
  get children() {
11283
11568
  return createComponent(Translation, {
@@ -11300,12 +11585,13 @@ var __objRest = (source, exclude) => {
11300
11585
  headerTranslationKey: "actionModal.confirmTransaction.header",
11301
11586
  textTranslationKey: "actionModal.confirmTransaction.text",
11302
11587
  get icon() {
11303
- return createComponent(LoaderIconStyled, {
11304
- fill: "#7A899970"
11305
- });
11588
+ return createComponent(LoaderIconStyled, {});
11306
11589
  },
11307
11590
  onClose: () => props.onClose(),
11308
- showButton: false
11591
+ showButton: false,
11592
+ get id() {
11593
+ return props.id;
11594
+ }
11309
11595
  });
11310
11596
  };
11311
11597
  const ErrorIconStyled = styled(ErrorIcon)`
@@ -11319,7 +11605,10 @@ var __objRest = (source, exclude) => {
11319
11605
  get icon() {
11320
11606
  return createComponent(ErrorIconStyled, {});
11321
11607
  },
11322
- onClose: () => props.onClose()
11608
+ onClose: () => props.onClose(),
11609
+ get id() {
11610
+ return props.id;
11611
+ }
11323
11612
  });
11324
11613
  };
11325
11614
  const SuccessIconStyled = styled(SuccessIcon)`
@@ -11333,16 +11622,20 @@ var __objRest = (source, exclude) => {
11333
11622
  get icon() {
11334
11623
  return createComponent(SuccessIconStyled, {});
11335
11624
  },
11336
- onClose: () => props.onClose()
11625
+ onClose: () => props.onClose(),
11626
+ get id() {
11627
+ return props.id;
11628
+ }
11337
11629
  });
11338
11630
  };
11339
11631
  const ActionsModal = () => {
11340
11632
  return createComponent(Modal, {
11341
11633
  get opened() {
11342
11634
  var _a;
11343
- return memo(() => action() !== null, true)() && ((_a = action()) == null ? void 0 : _a.openModal) === true;
11635
+ return createMemo(() => action() !== null)() && ((_a = action()) == null ? void 0 : _a.openModal) === true;
11344
11636
  },
11345
11637
  onClose: () => setAction(null),
11638
+ id: "tc-actions-modal-container",
11346
11639
  get children() {
11347
11640
  return createComponent(Switch, {
11348
11641
  get children() {
@@ -11352,7 +11645,8 @@ var __objRest = (source, exclude) => {
11352
11645
  },
11353
11646
  get children() {
11354
11647
  return createComponent(TransactionSentModal, {
11355
- onClose: () => setAction(null)
11648
+ onClose: () => setAction(null),
11649
+ id: "tc-transaction-sent-modal"
11356
11650
  });
11357
11651
  }
11358
11652
  }), createComponent(Match, {
@@ -11361,7 +11655,8 @@ var __objRest = (source, exclude) => {
11361
11655
  },
11362
11656
  get children() {
11363
11657
  return createComponent(TransactionCanceledModal, {
11364
- onClose: () => setAction(null)
11658
+ onClose: () => setAction(null),
11659
+ id: "tc-transaction-canceled-modal"
11365
11660
  });
11366
11661
  }
11367
11662
  }), createComponent(Match, {
@@ -11370,7 +11665,8 @@ var __objRest = (source, exclude) => {
11370
11665
  },
11371
11666
  get children() {
11372
11667
  return createComponent(ConfirmTransactionModal, {
11373
- onClose: () => setAction(null)
11668
+ onClose: () => setAction(null),
11669
+ id: "tc-confirm-modal"
11374
11670
  });
11375
11671
  }
11376
11672
  })];
@@ -11431,6 +11727,12 @@ var __objRest = (source, exclude) => {
11431
11727
  tonConnectUI: tonConnectUI2
11432
11728
  }), document.getElementById(root))
11433
11729
  };
11730
+ class TonConnectUIError extends TonConnectError$1 {
11731
+ constructor(...args) {
11732
+ super(...args);
11733
+ Object.setPrototypeOf(this, TonConnectUIError.prototype);
11734
+ }
11735
+ }
11434
11736
  class WalletInfoStorage {
11435
11737
  constructor() {
11436
11738
  __publicField(this, "localStorage");
@@ -11456,142 +11758,13 @@ var __objRest = (source, exclude) => {
11456
11758
  this.localStorage.removeItem(this.storageKey);
11457
11759
  }
11458
11760
  }
11459
- var isMergeableObject = function isMergeableObject2(value) {
11460
- return isNonNullObject(value) && !isSpecial(value);
11461
- };
11462
- function isNonNullObject(value) {
11463
- return !!value && typeof value === "object";
11464
- }
11465
- function isSpecial(value) {
11466
- var stringValue = Object.prototype.toString.call(value);
11467
- return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
11468
- }
11469
- var canUseSymbol = typeof Symbol === "function" && Symbol.for;
11470
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
11471
- function isReactElement(value) {
11472
- return value.$$typeof === REACT_ELEMENT_TYPE;
11473
- }
11474
- function emptyTarget(val) {
11475
- return Array.isArray(val) ? [] : {};
11476
- }
11477
- function cloneUnlessOtherwiseSpecified(value, options) {
11478
- return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
11479
- }
11480
- function defaultArrayMerge(target, source, options) {
11481
- return target.concat(source).map(function(element) {
11482
- return cloneUnlessOtherwiseSpecified(element, options);
11483
- });
11484
- }
11485
- function getMergeFunction(key, options) {
11486
- if (!options.customMerge) {
11487
- return deepmerge;
11488
- }
11489
- var customMerge = options.customMerge(key);
11490
- return typeof customMerge === "function" ? customMerge : deepmerge;
11491
- }
11492
- function getEnumerableOwnPropertySymbols(target) {
11493
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
11494
- return target.propertyIsEnumerable(symbol);
11495
- }) : [];
11496
- }
11497
- function getKeys(target) {
11498
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
11499
- }
11500
- function propertyIsOnObject(object, property) {
11501
- try {
11502
- return property in object;
11503
- } catch (_) {
11504
- return false;
11505
- }
11506
- }
11507
- function propertyIsUnsafe(target, key) {
11508
- return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
11509
- }
11510
- function mergeObject(target, source, options) {
11511
- var destination = {};
11512
- if (options.isMergeableObject(target)) {
11513
- getKeys(target).forEach(function(key) {
11514
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
11515
- });
11516
- }
11517
- getKeys(source).forEach(function(key) {
11518
- if (propertyIsUnsafe(target, key)) {
11519
- return;
11520
- }
11521
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
11522
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
11523
- } else {
11524
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
11525
- }
11526
- });
11527
- return destination;
11528
- }
11529
- function deepmerge(target, source, options) {
11530
- options = options || {};
11531
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
11532
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
11533
- options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
11534
- var sourceIsArray = Array.isArray(source);
11535
- var targetIsArray = Array.isArray(target);
11536
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
11537
- if (!sourceAndTargetTypesMatch) {
11538
- return cloneUnlessOtherwiseSpecified(source, options);
11539
- } else if (sourceIsArray) {
11540
- return options.arrayMerge(target, source, options);
11541
- } else {
11542
- return mergeObject(target, source, options);
11543
- }
11544
- }
11545
- deepmerge.all = function deepmergeAll(array, options) {
11546
- if (!Array.isArray(array)) {
11547
- throw new Error("first argument should be an array");
11548
- }
11549
- return array.reduce(function(prev, next) {
11550
- return deepmerge(prev, next, options);
11551
- }, {});
11552
- };
11553
- var deepmerge_1 = deepmerge;
11554
- var cjs = deepmerge_1;
11555
- /*!
11556
- * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
11557
- *
11558
- * Copyright (c) 2014-2017, Jon Schlinkert.
11559
- * Released under the MIT License.
11560
- */
11561
- function isObject(o2) {
11562
- return Object.prototype.toString.call(o2) === "[object Object]";
11563
- }
11564
- function isPlainObject(o2) {
11565
- var ctor, prot;
11566
- if (isObject(o2) === false)
11567
- return false;
11568
- ctor = o2.constructor;
11569
- if (ctor === void 0)
11570
- return true;
11571
- prot = ctor.prototype;
11572
- if (isObject(prot) === false)
11573
- return false;
11574
- if (prot.hasOwnProperty("isPrototypeOf") === false) {
11575
- return false;
11576
- }
11577
- return true;
11578
- }
11579
- function mergeOptions(options, defaultOptions) {
11580
- if (!options) {
11581
- return defaultOptions;
11582
- }
11583
- const overwriteMerge = (_, sourceArray, __) => sourceArray;
11584
- return cjs(defaultOptions, options, {
11585
- arrayMerge: overwriteMerge,
11586
- isMergeableObject: isPlainObject
11587
- });
11588
- }
11589
11761
  class TonConnectUI {
11590
11762
  constructor(options) {
11591
11763
  __publicField(this, "walletInfoStorage", new WalletInfoStorage());
11592
11764
  __publicField(this, "connector");
11593
11765
  __publicField(this, "_walletInfo", null);
11594
11766
  __publicField(this, "systemThemeChangeUnsubscribe", null);
11767
+ __publicField(this, "actionsConfiguration");
11595
11768
  if (options && "connector" in options && options.connector) {
11596
11769
  this.connector = options.connector;
11597
11770
  } else if (options && "manifestUrl" in options && options.manifestUrl) {
@@ -11614,7 +11787,7 @@ var __objRest = (source, exclude) => {
11614
11787
  }
11615
11788
  });
11616
11789
  }
11617
- this.uiOptions = options || {};
11790
+ this.uiOptions = mergeOptions(options, { uiPreferences: { theme: "SYSTEM" } });
11618
11791
  setAppState({ connector: this.connector });
11619
11792
  widgetController.renderApp(rootId, this);
11620
11793
  }
@@ -11634,28 +11807,30 @@ var __objRest = (source, exclude) => {
11634
11807
  return this._walletInfo;
11635
11808
  }
11636
11809
  set uiOptions(options) {
11637
- var _a;
11810
+ var _a, _b, _c, _d, _e;
11638
11811
  this.checkButtonRootExist(options.buttonRootId);
11639
- if (options.theme === "SYSTEM") {
11640
- setTheme(getSystemTheme());
11641
- if (!this.systemThemeChangeUnsubscribe) {
11642
- this.systemThemeChangeUnsubscribe = subscribeToThemeChange(
11643
- (theme) => setTheme(theme)
11644
- );
11812
+ this.actionsConfiguration = options.actionsConfiguration;
11813
+ if ((_a = options.uiPreferences) == null ? void 0 : _a.theme) {
11814
+ if (((_b = options.uiPreferences) == null ? void 0 : _b.theme) !== "SYSTEM") {
11815
+ (_c = this.systemThemeChangeUnsubscribe) == null ? void 0 : _c.call(this);
11816
+ setTheme(options.uiPreferences.theme, options.uiPreferences.colorsSet);
11817
+ } else {
11818
+ setTheme(getSystemTheme(), options.uiPreferences.colorsSet);
11819
+ if (!this.systemThemeChangeUnsubscribe) {
11820
+ this.systemThemeChangeUnsubscribe = subscribeToThemeChange(setTheme);
11821
+ }
11645
11822
  }
11646
11823
  } else {
11647
- if (options.theme) {
11648
- (_a = this.systemThemeChangeUnsubscribe) == null ? void 0 : _a.call(this);
11649
- setTheme(options.theme);
11824
+ if ((_d = options.uiPreferences) == null ? void 0 : _d.colorsSet) {
11825
+ setColors(options.uiPreferences.colorsSet);
11650
11826
  }
11651
11827
  }
11828
+ if ((_e = options.uiPreferences) == null ? void 0 : _e.borderRadius) {
11829
+ setBorderRadius(options.uiPreferences.borderRadius);
11830
+ }
11652
11831
  setAppState((state) => {
11653
11832
  const merged = mergeOptions(
11654
- __spreadValues(__spreadValues(__spreadValues({}, options.language && { language: options.language }), options.buttonConfiguration && {
11655
- buttonConfiguration: options.buttonConfiguration
11656
- }), options.widgetConfiguration && {
11657
- widgetConfiguration: options.widgetConfiguration
11658
- }),
11833
+ __spreadValues(__spreadValues({}, options.language && { language: options.language }), !!options.walletsList && { walletsList: options.walletsList }),
11659
11834
  unwrap(state)
11660
11835
  );
11661
11836
  if (options.buttonRootId !== void 0) {
@@ -11716,25 +11891,24 @@ var __objRest = (source, exclude) => {
11716
11891
  if (!isDevice("desktop") && "universalLink" in this.walletInfo) {
11717
11892
  openLink(this.walletInfo.universalLink);
11718
11893
  }
11719
- const notification = (options == null ? void 0 : options.notifications) || ["before", "success", "error"];
11720
- const modals = (options == null ? void 0 : options.modals) || ["before"];
11894
+ const { notifications: notifications2, modals } = this.getModalsAndNotificationsConfiguration(options);
11721
11895
  widgetController.setAction({
11722
11896
  name: "confirm-transaction",
11723
- showNotification: notification.includes("before"),
11897
+ showNotification: notifications2.includes("before"),
11724
11898
  openModal: modals.includes("before")
11725
11899
  });
11726
11900
  try {
11727
11901
  const result = yield this.connector.sendTransaction(tx);
11728
11902
  widgetController.setAction({
11729
11903
  name: "transaction-sent",
11730
- showNotification: notification.includes("success"),
11904
+ showNotification: notifications2.includes("success"),
11731
11905
  openModal: modals.includes("success")
11732
11906
  });
11733
11907
  return result;
11734
11908
  } catch (e2) {
11735
11909
  widgetController.setAction({
11736
11910
  name: "transaction-canceled",
11737
- showNotification: notification.includes("error"),
11911
+ showNotification: notifications2.includes("error"),
11738
11912
  openModal: modals.includes("error")
11739
11913
  });
11740
11914
  if (e2 instanceof TonConnectError$1) {
@@ -11743,8 +11917,6 @@ var __objRest = (source, exclude) => {
11743
11917
  console.error(e2);
11744
11918
  throw new TonConnectUIError("Unhandled error:" + e2);
11745
11919
  }
11746
- } finally {
11747
- widgetController.clearAction();
11748
11920
  }
11749
11921
  });
11750
11922
  }
@@ -11783,6 +11955,44 @@ var __objRest = (source, exclude) => {
11783
11955
  throw new TonConnectUIError(`${buttonRootId2} element not found in the document.`);
11784
11956
  }
11785
11957
  }
11958
+ getModalsAndNotificationsConfiguration(options) {
11959
+ var _a, _b, _c;
11960
+ const allActions = [
11961
+ "before",
11962
+ "success",
11963
+ "error"
11964
+ ];
11965
+ let notifications2 = allActions;
11966
+ if (((_a = this.actionsConfiguration) == null ? void 0 : _a.notifications) && ((_b = this.actionsConfiguration) == null ? void 0 : _b.notifications) !== "all") {
11967
+ notifications2 = this.actionsConfiguration.notifications;
11968
+ }
11969
+ if (options == null ? void 0 : options.notifications) {
11970
+ if (options.notifications === "all") {
11971
+ notifications2 = allActions;
11972
+ } else {
11973
+ notifications2 = options.notifications;
11974
+ }
11975
+ }
11976
+ let modals = ["before"];
11977
+ if ((_c = this.actionsConfiguration) == null ? void 0 : _c.modals) {
11978
+ if (this.actionsConfiguration.modals === "all") {
11979
+ modals = allActions;
11980
+ } else {
11981
+ modals = this.actionsConfiguration.modals;
11982
+ }
11983
+ }
11984
+ if (options == null ? void 0 : options.modals) {
11985
+ if (options.modals === "all") {
11986
+ modals = allActions;
11987
+ } else {
11988
+ modals = options.modals;
11989
+ }
11990
+ }
11991
+ return {
11992
+ notifications: notifications2,
11993
+ modals
11994
+ };
11995
+ }
11786
11996
  }
11787
11997
  const TonConnectUIContext = require$$0$2.createContext(null);
11788
11998
  let tonConnectUI = null;